home *** CD-ROM | disk | FTP | other *** search
/ Software Du Jour / SoftwareDuJour.iso / BUSINESS / DBASE / DBASEACC.ARC / DEPTRANS.PRG < prev    next >
Encoding:
Text File  |  1979-12-31  |  1.4 KB  |  64 lines

  1.  
  2.  
  3.  
  4. *DEPTRANS.CMD FILE
  5. *Applies deposits from the GetDep file against the matching invoices in the
  6. *Invoices file as payments are received against them.
  7.  
  8.  
  9. GO TOP
  10. ERASE
  11. DO WHILE .NOT. EOF
  12.     STORE STR(#,5) TO Number
  13.     @ 6,20 SAY 'RECORD NUMBER  '+Number
  14.     ? CHR (7) + CHR(27) + CHR(121)
  15.  
  16.     IF Inv:Nmbr= ' ' .OR. *
  17.  SKIP
  18.     ELSE
  19.  @ 7,20 SAY 'INVOICE NUMBER '+Inv:Nmbr
  20.  STORE Inv:Nmbr TO Key
  21.  
  22.  SELECT SECONDARY
  23.  USE Invoices INDEX Invoices
  24.  FIND &Key
  25.  STORE T TO Again
  26.  STORE 'T' TO Decision
  27.  IF # = 0
  28.      DO WHILE Again
  29.   @  9,15 SAY 'THIS INVOICE NUMBER IS NOT IN THE INVOICE FILE.'
  30.   @ 11,15 SAY '     E to EDIT it.                             '
  31.   @ 12,15 SAY '     C to CONTINUE.                            '
  32.   ?
  33.   ? CHR(7)
  34.   WAIT TO Decision
  35.  
  36.   IF !(Decision) = 'E'
  37.       SELECT PRIMARY
  38.       EDIT &Number
  39.       SELECT SECONDARY
  40.       STORE F TO Again
  41.   ELSE
  42.       IF !(Decision) = 'C'
  43.    STORE F TO Again
  44.       ELSE
  45.    STORE T TO Again
  46.       ENDIF C
  47.   ENDIF E
  48.      ENDDO
  49.  ELSE
  50.      REPLACE Amt:Rcd WITH (Amt:Rcd + Deposit), Date:Rcd WITH Dep:Date
  51.  ENDIF 0
  52.  SELECT PRIMARY
  53.  
  54.  *We do not skip to the next record if the record was edited.  This
  55.  *allows us to run the edited record through the process again.
  56.  
  57.  IF !(Decision <> 'E'
  58.      SKIP
  59.  ENDIF
  60.     ENDIF no invoice number or record deleted
  61. ENDDO the transfer
  62.  
  63.  
  64.