***********
* PCEDOFF *
***********
SET EXACT ON
STORE 0 TO nr:off
USE &offertes INDEX &offertes
FIND &cur:prod
DO WHILE (cur:prod = prod:nr) .AND. (.NOT. EOF)
   STORE nr:off + 1 TO nr:off
   SKIP +1
ENDDO
FIND &cur:prod
ERASE
STORE "." TO choice
DO WHILE .NOT. (choice $ 'eE')
   STORE "." TO akk
   DO WHILE .NOT. (akk $ 'jJ')
      STORE "." TO akk
      @ 1,10 SAY "--READER'S DIGEST PRODUCTION ADMINISTRATION CONTROL SYSTEM--"
      @  2,10 SAY "----------------- WIJZIGEN OFFERTEGEGEVENS -----------------"
      @  4, 0 SAY "PRODUKTIENUMMER"
      @  4,16 SAY $(prod:nr,1,2) + "/" + $(prod:nr,3,5)
      @  6, 6 SAY "DATUM OFFERTE"
      @  6,20 GET dat:off PICTURE "##/##/##"
      @  6,41 SAY "LEVERANCIER"
      @  6,53 GET leveranc
      @  8,22 SAY "TOTAALPRIJS"
      @  8,34 GET tot:prs PICTURE "#######.##"
      @ 10, 2 SAY "PRIJS PER 1000 STUKS IN GULDENS"
      @ 10,37 GET pr:dz:fl PICTURE "####.##"
      @ 11,16 SAY "IN VREEMDE VALUTA"
      @ 11,37 GET pr:dz:vv PICTURE "####.##" 
      @ 12,28 SAY "KOERS"
      @ 12,37 GET koers PICTURE "####.##"
      @ 14,19 SAY "DIVERSE KOSTEN"
      @ 14,37 GET div:kost PICTURE "####.##"
      @ 15,66 SAY "AKKOORD"
      @ 15,74 GET akk PICTURE "!"
      @ 16, 0 SAY "--------------------------------------------------------------------------------"
      @ 22,58 SAY "HUIDIGE DATUM"
      @ 22,72 SAY sysdate
      IF choice $ 'wW'
         READ
      ELSE
         STORE 'J' TO akk 
      ENDIF
      CLEAR GETS
      DO WHILE .NOT. (akk $ 'jJnN')
         STORE "." TO akk
         @ 15,74 GET akk PICTURE "!"
         READ
         CLEAR GETS
      ENDDO
   ENDDO
   @ 17,22 SAY "<V> - Vorige     <RETURN> - Volgende"
   @ 18,22 SAY "<T> - Toevoegen       <W> - Wijzigen"
   @ 19,22 SAY "<A> - Afvoeren        <E> - Einde"
   @ 21,32 SAY "UW KEUZE SVP :.:"
   STORE "-" TO choice
   DO WHILE .NOT. (choice $ "V.TWAE")
      STORE "." TO choice
      @ 21,45 GET choice PICTURE "!"
      READ
      CLEAR GETS
   ENDDO
   DO CASE
      CASE choice = "."
           SKIP +1
           IF (cur:prod # prod:nr) .OR. EOF
              FIND &cur:prod
           ENDIF
      CASE choice = "V"
           SKIP -1
           IF (cur:prod # prod:nr) .OR. EOF
              FIND &cur:prod
           ENDIF
      CASE choice = "T"
           IF nr:off < 10
              APPEND BLANK
              REPLACE prod:nr WITH cur:prod
              STORE "W" TO choice
              STORE nr:off + 1 TO nr:off
           ELSE
              STORE "." TO akk
              @ 22,0 SAY "MAXIMUM AANTAL OFFERTES IS BEREIKT, DRUK RETURN " GET akk
              READ
              CLEAR GETS
              @ 22,0 SAY "                                                   "
           ENDIF
      CASE choice = "A"
           STORE "-" TO akk
           @ 22,0 SAY "WILT U AFVOEREN ? (J/N) "
           DO WHILE .NOT. (akk $ '.jJnN')
              STORE "." TO akk
              @ 22,24 GET akk PICTURE "!"
              READ
              CLEAR GETS
           ENDDO
           @ 22,0 SAY "                             "
           IF akk $ "jJ"
              REPLACE prod:nr WITH "*"
              STORE STR(#,5) TO recno
              DELETE RECORD &recno
              FIND &cur:prod
              IF (#=0)
                 APPEND BLANK
                 REPLACE prod:nr WITH cur:prod
              ENDIF
              STORE nr:off - 1 TO nr:off
              IF nr:off < 1
                 STORE 1 TO nr:off
              ENDIF
           ELSE
              STORE "-" TO choice
           ENDIF
   ENDCASE   
ENDDO
USE
RETURN
*
* EINDE PROGRAMMA
*
