home *** CD-ROM | disk | FTP | other *** search
/ Software Du Jour / SoftwareDuJour.iso / BUSINESS / DBASE / DB3.ARC / PAYRECAP.PRG < prev    next >
Encoding:
Text File  |  1984-10-25  |  1.6 KB  |  56 lines

  1. * * * * * * * PAYRECAP.PRG * * * * * * * * 
  2. ******************************************
  3. PARAMETERS EOY,EOM,EOQ,Old
  4. IF EOM ='Y'
  5.    *
  6.    REPLACE Marker WITH 'M'
  7.    *
  8.    * If it's the end of the quarter, we total the amounts for the
  9.    * previous three months to a new record and mark it with a 'Q'.
  10.    *
  11.   IF EOQ = 'Y'
  12.       Number = STR(RECNO(),5)
  13.       TOTAL ON Marker TO Quarter FOR RECNO() >= (VAL(Number)-2)
  14.       APPEND FROM Quarter
  15.       ERASE Quarter.dbf
  16.       *
  17.       IF Old = 3
  18.          REPLACE Check_Date WITH '1ST'
  19.       ELSE
  20.          IF Old = 6
  21.             REPLACE Check_Date WITH '2ND'
  22.          ELSE
  23.             IF Old = 9
  24.                REPLACE Check_Date WITH '3RD'
  25.             ELSE
  26.                IF Old = 12
  27.                   REPLACE Check_Date WITH '4TH'
  28.                ENDIF
  29.             ENDIF
  30.          ENDIF
  31.       ENDIF
  32.       *
  33.       REPLACE Marker WITH 'Q'
  34.       *
  35.       * If it's the end of the year, we total all the quarterly amounts to
  36.       * a new record and mark it with a 'Y'.
  37.       IF EOY = 'Y'
  38.          TOTAL ON Marker TO Annual FOR Marker = 'Q'
  39.          APPEND FROM Annual
  40.          REPLACE Marker WITH 'Y', Check_Date WITH 'END'
  41.          ERASE Annual.dbf
  42.       ENDIF
  43.    ENDIF
  44.    *
  45.    * If it's the end of a month but not the end of the year, we add a new
  46.    * blank record for next month's payroll records.
  47.    IF EOY <> 'Y'
  48.       Period = YEAR(TDate) + MONTH(TDate) + 1
  49.       Period2 = STR(Period,4)
  50.       APPEND BLANK
  51.       REPLACE Check_Date WITH Period2
  52.    ENDIF
  53. ENDIF
  54. RETURN
  55. *
  56.