************
* PCREPLSL * 
************
*
* Met dit programma voeren we de keuzemogelijkheid in voor de planning-
* lijst. Uitgaande variabelen : print:okay ( T => afdrukken)
*                               select     ( T => selecteren)
*
STORE T TO print:okay
@  7,10 SAY "U KUNT NU ALLE GEVONDEN PRODUKTIENUMMERS AF LATEN DRUKKEN OF"
@  8,10 SAY "EERST EEN SELECTIE OP DE GEPLANDE LEVERDATA UITVOEREN."
@ 10,24 SAY "1- ALLE PRODUKTIENUMMERS AFDRUKKEN"
@ 11,24 SAY "2- SELECTIE INVOEREN"
@ 12,24 SAY "E- EINDE"
@ 14,27 SAY "UW KEUZE SVP"
STORE "." TO choice
DO WHILE .NOT. (choice $ "12E")
   STORE "." TO choice
   @ 14,40 GET choice PICTURE "!"
   READ
   CLEAR GETS
ENDDO
IF choice = "E" 
   STORE F TO print:okay
ENDIF
IF choice = "2"
   STORE T TO select
ELSE
   STORE F TO select
ENDIF
@ 7,0
@ 8,0
@ 10,0
@ 11,0
@ 12,0
@ 14,0
IF select
   STORE "  /  /  " TO start:per
   STORE "  /  /  " TO eind:per
   @  7, 9 SAY "U KUNT NU HET BEGIN EN HET EINDE VAN DE GEWENSTE PERIODE INVOEREN."
   @  8, 9 SAY "DE SELECTIE GESCHIEDT OVER DEZE PERIODE INCLUSIEF BEGIN EN EINDE."
   @ 10,22 SAY "BEGIN VAN PERIODE"
   STORE F TO finished
   STORE "." TO akk
   DO WHILE .NOT. finished
      @ 10,40 GET start:per PICTURE "##/##/##"
      @ 12,22 SAY "EINDE VAN PERIODE"
      @ 12,40 GET eind:per  PICTURE "##/##/##"
      @ 20,66 SAY "AKKOORD :.:"
      READ
      CLEAR GETS
      STORE "." TO akk
      DO WHILE .NOT. (akk $ "JN")
         STORE "." TO akk
         @ 20,74 GET akk PICTURE "!"
         READ
         CLEAR GETS
      ENDDO
      IF akk = "N"
         STORE "." TO again
         DO WHILE .NOT. (again $ 'JN')
            STORE "." TO again
            @ 20,57 SAY "OPNIEUW INTIKKEN " GET again PICTURE "!"
            READ
            CLEAR GETS
         ENDDO
         @ 20,57 SAY "                    "
         IF again = "N"
            STORE T TO finished
            STORE F TO print:okay
         ENDIF
      ELSE 
         STORE F TO date:error
         STORE start:per TO datum
         STORE T TO date:must
         DO pcsytd
         IF .NOT. date:okay
            STORE datum TO start:per
            STORE T TO date:error
         ENDIF
         STORE eind:per TO datum
         STORE T TO date:must
         DO pcsytd
         IF .NOT. date:okay
            STORE datum TO eind:per
            STORE T TO date:error
         ENDIF
         STORE $(start:per,7,2) + "/" + $(start:per,4,2) + "/" + $(start:per,1,2) TO memvar1  
         STORE $(eind:per,7,2) + "/" + $(eind:per,4,2) + "/" + $(eind:per,1,2) TO memvar2 
         IF memvar2 >= memvar1 .AND. .NOT. date:error
            STORE T TO finished
         ELSE
            STORE "." TO akk
            @ 22,0 SAY "DATA ZIJN ONJUIST, DRUK RETURN " GET akk
            READ
            CLEAR GETS
            @ 22,0 SAY "                                  "
         ENDIF
      ENDIF
   ENDDO
   @ 7,0
   @ 8,0
   @ 10,0
   @ 12,0
   @ 20,0
ENDIF
IF select .AND. print:okay
   STORE "PERIODE: " + start:per + " T/M " + eind:per TO periode
   STORE memvar1 TO start:per
   STORE memvar2 TO eind:per
ENDIF
RETURN
*
* EINDE PROGRAMMA
*
