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

  1.         ***********  IOPOST COMMAND FILE ***********
  2. * Gets information for insertion orders (insructions to magazine
  3. * publishers from our ad agency). Works much like Postbills and
  4. * Posttime.
  5. *******************************************************************
  6. RESTORE FROM Constant
  7.  
  8. DO GetDate
  9.  
  10. USE Inserts
  11. Copy STRUCTURE TO GetInserts
  12. USE GetInserts
  13.  
  14. * NEXT LINE ADDED 9/29/83 BECAUSE MCLIENT IS NOT DEFINED
  15. STORE CLIENT TO MCLIENT
  16. STORE ' ' TO New
  17. STORE 'Y' TO Inserting
  18. DO WHILE !(Inserting) <> 'F'
  19.    APPEND BLANK
  20.    STORE STR(#,5) TO Number
  21.    REPLACE IO:Date WITH Date, IO:Nmbr WITH Next:IO
  22.  
  23.    ERASE
  24.    * Next loop is used when there has been an error in the entry
  25.    * (defined as no client or no rate).
  26.    STORE 'T' TO Incorrect
  27.    DO WHILE !(Incorrect) <> 'F'
  28.       ERASE
  29.       @ 4,0 SAY ' INSERTION ORDER: '+IO:Nmbr
  30.       @ 4,30 SAY '            DATE:'+Date
  31.       ?
  32.       @ 6,0 SAY  '  RECORD NUMBER: '-Number
  33.       IF !(New) = 'S'
  34.          @  7,0 SAY '      OUR CLIENT :'+MClient
  35.       ELSE
  36.          @  7,0 SAY '      OUR CLIENT '
  37.          @  7,19  GET MClient
  38.          STORE !(MClient) TO MClient
  39.       ENDIF
  40.       @  8,0 SAY '      JOB NUMBER ' GET Job:Nmbr
  41.       @  9,0 SAY '  AD DESCRIPTION ' GET Ad
  42.       @ 10,0 SAY '  HOW MUCH SPACE ' GET Space
  43.       @ 11,0 SAY '  WHICH MAGAZINE ' GET Magazine
  44.       @ 12,0 SAY '     WHICH ISSUE ' GET Issue
  45.       @ 13,0 SAY 'GROSS SPACE COST ' GET Gross:Cost
  46.       @ 14,0 SAY '   DISCOUNT RATE ' GET Times
  47.       READ
  48.  
  49.      REPLACE Net:Cost WITH Gross:Cost*0.8500, Client WITH MClient,;
  50.              Ad WITH !(Ad), Magazine WITH !(Magazine), Issue WITH !(Issue)
  51.      @  7,18 SAY Client
  52.      @  9,18 SAY Ad
  53.      @ 11,18 SAY Magazine
  54.      @ 12,18 SAY Issue
  55.      @ 15,0 SAY '  NET SPACE COST ' GET Net:Cost
  56.  
  57.      IF Client <> '  ' .AND. Gross:Cost > 0 .AND. Job:Nmbr >99
  58.         @ 18,5 SAY '   C to CHANGE,'
  59.         @ 19,5 SAY '<Return> to continue.'
  60.         ?
  61.         WAIT TO New
  62.         IF !(New)='C'
  63.            STORE 'T' TO Incorrect
  64.         ELSE
  65.            @ 17, 5 SAY '   F if FINISHED,'
  66.            @ 18, 5 SAY '   S for SAME insertion order,'
  67.            @ 19, 5 say '<Return> for NEXT insertion order.'
  68.            @ 21, 0 SAY '         '
  69.            ACCEPT TO New
  70.  
  71.            IF !(New) <> 'S'
  72.               IF VAL(Next:IO) < 9999
  73.                  STORE STR(VAL(Next:IO)+1,4) TO Next:IO
  74.               ELSE
  75.                  STORE '1001' TO Next:IO
  76.            ENDIF
  77.         ENDIF
  78.         STORE New TO Inserting
  79.      ELSE
  80.         ?
  81.         ?
  82.         ?
  83.         ?
  84.         ?
  85.         ?
  86.         ? '   CLIENT, JOB or RATE missing.'
  87.         ?
  88.         ? '        F, if FINISHED,'
  89.         ? '    <Return> to correct the record.'
  90.         ?
  91.         WAIT TO Inserting
  92.         IF !(Inserting)= 'F'
  93.            DELETE RECORD &Number
  94.            STORE 'F' TO Incorrect
  95.         ELSE
  96.            STORE 'T' TO Incorrect
  97.         ENDIF
  98.      ENDIF
  99.   ENDDO Incorrect
  100. ENDDO Inserting
  101.  
  102. RELEASE Date, NoDate, Inserting, Number, Update, New, Incorrect
  103. SAVE TO Constant
  104.  
  105. COUNT FOR .NOT. * TO Any
  106. ERASE
  107. IF Any = 0
  108.    ? 'No insertions to add to the file.'
  109.    ? 'Press any key to continue.'
  110.    USE
  111.    WAIT
  112. ELSE
  113.    @ 5,10 SAY 'To print the insertions you just entered,'
  114.    @ 6,10 SAY 'press <Return>.'
  115.    WAIT TO Number
  116.    *"Number" determines the starting record number for the printout
  117.  
  118.    SET PRINT ON
  119.    ? 'IO # MAGAZINE      ISSUE    JOB   AD             ';
  120.                +'SPACE           GROSS      NET  X  DATE'
  121.    ?
  122.  
  123.   * "Output" and "Condition" needed in the Printout Command file
  124.   STORE 'Y' TO Output
  125.   STORE 'OFF' TO Condition
  126.   DO Printout
  127.  
  128.    ERASE
  129.    @ 5,20 SAY 'UPDATING THE INSERTION ORDER FILE'
  130.    USE Inserts INDEX Inserts
  131.    APPEND FROM GetInserts
  132. ENDIF
  133.  
  134. DELETE FILE GetInserts
  135. RELEASE ALL
  136. RETURN
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157. 
  158.  
  159.  
  160. IO:Nmbr
  161.       @ 4,30 SAY '            DATE:'+Date
  162.       ?
  163.       @ 6,0 SAY  '  RECORD NUMBER: '-Number
  164.       IF !(New) = 'S'
  165.          @  7,0 SAY '      OUR CLIENT :'+MCl