home *** CD-ROM | disk | FTP | other *** search
/ World of Shareware - Software Farm 2 / wosw_2.zip / wosw_2 / FINANCE / SFWD.ZIP / OE.CLA < prev    next >
Text File  |  1992-11-10  |  31KB  |  954 lines

  1. !#OM# This module changed by the Overlay Manager on 11/10/92 at 21:44:15
  2. !#OM# Map Statement Changed To Use New Map
  3. !#OM#
  4. OE         PROGRAM
  5.  
  6.  ! GLOBAL MODEL FROM OE.MDL - V2107
  7.  
  8.   !INCLUDE('C:\CLARION\MASTEROE\OE.OMM'),LIST !#OM# New Map File
  9.          !INCLUDE('STD_KEYS.CLA')
  10.          !INCLUDE('CTL_KEYS.CLA')
  11.          !INCLUDE('ALT_KEYS.CLA')
  12.          !INCLUDE('SHF_KEYS.CLA')
  13.  
  14. REJECT_KEY   EQUATE(CTRL_ESC)
  15. ACCEPT_KEY   EQUATE(F10_KEY)
  16. TRUE         EQUATE(1)
  17. FALSE         EQUATE(0)
  18.  
  19.    OMIT('#OM# OMIT Terminator #OM#')
  20.          MAP
  21.            PROC(G_OPENFILES)
  22.            PROC(G_OPENFILES2)
  23.            PROC(IDLER)
  24.            PROC(DISPBMSG)
  25.            PROC(STEPCHECK)
  26.            MODULE('OE01')
  27.          PROC(STARTSCREEN)         !introduction form
  28.            .
  29.            MODULE('OE02')
  30.          PROC(MAIN_MENU)         !Order Entry Main Menu
  31.            .
  32.            MODULE('OE03')
  33.          PROC(CUST_MAINT)         !Customer List
  34.            .
  35.            MODULE('OE04')
  36.          PROC(SREP_MAINT)         !Sales Rep Maintenance
  37.            .
  38.            MODULE('OE05')
  39.          PROC(UPD_SREP)             !UPDATE REPRESENTATIVE
  40.            .
  41.            MODULE('OE06')
  42.          PROC(FINDSREP)             !Find Sales Rep
  43.            .
  44.            MODULE('OE07')
  45.          PROC(FINDSTAX)             !Find Sales Tax Code
  46.            .
  47.            MODULE('OE08')
  48.          PROC(STAX_MAINT)         !Sales Tax Maintenance
  49.            .
  50.            MODULE('OE09')
  51.          PROC(UPD_STAX)             !UPDATE SALES TAX
  52.            .
  53.            MODULE('OE10')
  54.          PROC(REMIND_MAINT)         !STATEMENT REMINDER MAINTENANCE
  55.            .
  56.            MODULE('OE11')
  57.          PROC(COMP_MAINT)         !COMPANY SETUP
  58.            .
  59.            MODULE('OE12')
  60.          PROC(CAT_MAINT)         !Sales Catalog Maintenance
  61.            .
  62.            MODULE('OE13')
  63.          PROC(UPD_SCAT)             !UPDATE SALES CATALOG
  64.            .
  65.            MODULE('OE14')
  66.          PROC(CUSBAL_EDIT)         !UPDATE CUSTOMER BALANCES
  67.            .
  68.            MODULE('OE15')
  69.          PROC(QOI_MAINT)         !Quotation/Order/Invoice Maint
  70.            .
  71.            MODULE('OE16')
  72.          PROC(UPD_QOI)             !Edit a detail transaction
  73.            .
  74.            MODULE('OE17')
  75.          PROC(FINDCITEM)         !Find Catalog Item
  76.            .
  77.            MODULE('OE18')
  78.          PROC(FINDCUSTOMER)         !Find Customer
  79.            .
  80.            MODULE('OE19')
  81.          PROC(PRINTER_DOT)         !set printer codes-epson,ibm
  82.            .
  83.            MODULE('OE20')
  84.          PROC(PRINTER_JET)         !set printer codes-laser jet
  85.            .
  86.            MODULE('OE21')
  87.          PROC(PAY_MAINT)         !PAYMENT MAINTENANCE
  88.            .
  89.            MODULE('OE22')
  90.          PROC(UPD_PAY)             !Customer Payment Form
  91.            .
  92.            MODULE('OE23')
  93.          PROC(FINDUNPAID)         !FIND UNPAID INVOICE
  94.            .
  95.            MODULE('OE24')
  96.          PROC(FINDCUSTNADD)         !Find Customer
  97.            .
  98.            MODULE('OE25')
  99.          PROC(INQ_ORDINV)         !VIEW CUSTOMER INVOICES
  100.            .
  101.            MODULE('OE26')
  102.          PROC(VIEWINVDET)         !VIEW INVOICE DETAIL
  103.            .
  104.            MODULE('OE27')
  105.          PROC(INQ_PAYMENT)         !View Customer Payments
  106.            .
  107.            MODULE('OE28')
  108.          PROC(RPT_SALESCUS)         !PRINT SALES BY CUSTOMER
  109.            .
  110.            MODULE('OE29')
  111.          PROC(PRT_SALESCUS)         !PRINT SALES BY CUSTOMER
  112.            .
  113.            MODULE('OE30')
  114.          PROC(INVPAY_MAINT)         !INVOICE PAYMENT MAINTENANCE
  115.            .
  116.            MODULE('OE31')
  117.          PROC(QO_TO_INV)         !QUOTE TO INVOICE
  118.            .
  119.            MODULE('OE32')
  120.          PROC(QOI_DELETE)         !REMOVE OLD TRANSACTIONS
  121.            .
  122.            MODULE('OE33')
  123.          PROC(RPT_PAYMENT)         !PRINT PAYMENT REPORT
  124.            .
  125.            MODULE('OE34')
  126.          PROC(PRT_PAYMENT)         !PRINT PAYMENT REPORT
  127.            .
  128.            MODULE('OE35')
  129.          PROC(RPT_SALESTAX)         !PRINT SALES TAX REPORT
  130.            .
  131.            MODULE('OE36')
  132.          PROC(FINDSTAXNADD)         !Find Sales Tax Code
  133.            .
  134.            MODULE('OE37')
  135.          PROC(PRT_STAXREP)         !PRINT SALES TAX REPORT
  136.            .
  137.            MODULE('OE38')
  138.          PROC(RPT_COMMISSN)         !PRINT COMMISION REPORT
  139.            .
  140.            MODULE('OE39')
  141.          PROC(FINDSREPNADD)         !Find Sales Rep
  142.            .
  143.            MODULE('OE40')
  144.          PROC(PRT_COMMREP)         !PRINT SALESMAN COMMISION REP
  145.            .
  146.            MODULE('OE41')
  147.          PROC(RPT_CUSTLIST)         !PRINT CUSTOMER LIST
  148.            .
  149.            MODULE('OE42')
  150.          PROC(PRT_CUSTLIST)         !PRINT CUSTOMER LIST
  151.            .
  152.            MODULE('OE43')
  153.          PROC(RPT_CUSTLABL)         !PRINT CUSTOMER LABELS
  154.            .
  155.            MODULE('OE44')
  156.          PROC(PRT_CUSTLABL)         !PRINT CUSTOMER LABELS
  157.            .
  158.            MODULE('OE45')
  159.          PROC(RPT_STATEMNT)         !PRINT CUSTOMER STATEMENTS
  160.            .
  161.            MODULE('OE46')
  162.          PROC(RPT_AGING)         !PRINT AGING REPORT
  163.            .
  164.            MODULE('OE47')
  165.          PROC(PRT_AGING)         !Print Aging Report
  166.            .
  167.            MODULE('OE48')
  168.          PROC(RPT_CATALOG)         !Print Sales Catalog List
  169.            .
  170.            MODULE('OE49')
  171.          PROC(PRT_CATALOG)         !Print Sales Catalog
  172.            .
  173.            MODULE('OE50')
  174.          PROC(RPT_STAXCODE)         !Print Sales Tax Code List
  175.            .
  176.            MODULE('OE51')
  177.          PROC(PRT_STAXCODE)         !Sales Tax Code List
  178.            .
  179.            MODULE('OE52')
  180.          PROC(RPT_REPLIST)         !Print Sales Rep File
  181.            .
  182.            MODULE('OE53')
  183.          PROC(PRT_REPLIST)         !Print Sales Representative Lis
  184.            .
  185.            MODULE('OE54')
  186.          PROC(APPLY_FINANC)         !POST GLHOLD FILE TO G/L
  187.            .
  188.            MODULE('OE55')
  189.          PROC(DO_APPFINCHG)         !Apply Finance Charges
  190.            .
  191.            MODULE('OE56')
  192.          PROC(QOI_DO_DEL)         !Remove Old Transactions
  193.            .
  194.            MODULE('OE57')
  195.          PROC(CUSTYEAREND)         !Update Customer Balances
  196.            .
  197.            MODULE('OE58')
  198.          PROC(DO_CUSTYREND)         !Customer Year End Processing
  199.            .
  200.            MODULE('OE59')
  201.          PROC(ARMAINTMENU)         !A/R Maint Menu - ****
  202.            .
  203.            MODULE('OE60')
  204.          PROC(IVMAINTMENU)         !Inventory Maint Menu - *****
  205.            .
  206.            MODULE('OE61')
  207.          PROC(ARREPMENU)         !AR Report Menu - *****
  208.            .
  209.            MODULE('OE62')
  210.          PROC(IVREPMENU)         !IV Report Menu - *****
  211.            .
  212.            MODULE('OE63')
  213.          PROC(IV_ITEMMAINT)         !Inventory Item Maintenance
  214.            .
  215.            MODULE('OE64')
  216.          PROC(UPD_ITEM)             !UPDATE IV ITEM
  217.            .
  218.            MODULE('OE65')
  219.          PROC(IV_DISCMAINT)         !Inventory Discount Maintenance
  220.            .
  221.            MODULE('OE66')
  222.          PROC(UPD_DISC)             !UPDATE DISCOUNT
  223.            .
  224.            MODULE('OE67')
  225.          PROC(RPT_IVLIST)         !Print Inventory Listing
  226.            .
  227.            MODULE('OE68')
  228.          PROC(RPT_IVREORD)         !Print Inventory Reorder Report
  229.            .
  230.            MODULE('OE69')
  231.          PROC(PRT_IVLIST)         !Inventory Listing
  232.            .
  233.            MODULE('OE70')
  234.          PROC(PRT_IVREORD)         !Inventory Reorder Report
  235.            .
  236.            MODULE('OE71')
  237.          PROC(INQ_INVENT)         !Inventory View
  238.            .
  239.            MODULE('OE72')
  240.          PROC(INVENT_RECV)         !Receive Inventory
  241.            .
  242.            MODULE('OE73')
  243.          PROC(FINDIVITEM)         !Find Inventory Item
  244.            .
  245.            MODULE('OE74')
  246.          PROC(UPD_RINVEN)         !Update Inventory
  247.            .
  248.            MODULE('OE75')
  249.          PROC(TBL_1099)             !TABLE OF 1099 TYPES-DON'T USE
  250.            .
  251.            MODULE('OE76')
  252.          PROC(FORM_1099)         !edit the table of 1099 types
  253.            .
  254.            MODULE('OE77')
  255.          PROC(TABLE_1099)         !lookup for form 1099 type
  256.            .
  257.            MODULE('OE78')
  258.          PROC(TBL_VEND)             !VENDOR TABLE
  259.            .
  260.            MODULE('OE79')
  261.          PROC(FORM_VEN_YTD)         !FORM-YTD INFO FOR VENDORS
  262.            .
  263.            MODULE('OE80')
  264.          PROC(VEND_TABLE)         !VENDOR LOOKUP TABLE
  265.            .
  266.            MODULE('OE81')
  267.          PROC(RPT_IVREORDV)         !Print Inv Reorder Report-vends
  268.            .
  269.            MODULE('OE82')
  270.          PROC(PRT_IVREORDV)         !Inventory Reorder Report
  271.            .
  272.            MODULE('OE83')
  273.          PROC(NUM_FORM)             !QOI numbering
  274.            .
  275.            MODULE('OE84')
  276.          PROC(UPD_CUSTOMER)         !UPDATE CUSTOMER
  277.            .
  278.            MODULE('OE85')
  279.          PROC(RPT_CUSTCRD)         !PRINT CUSTOMER CARDS
  280.            .
  281.            MODULE('OE86')
  282.          PROC(PRT_CUSTCRD)         !PRINT CUSTOMER CARDS
  283.            .
  284.            MODULE('OE87')
  285.          PROC(QOI_FM_MAINT)         !QOI Form Maintenance
  286.            .
  287.            MODULE('OE88')
  288.          PROC(RPT_SALESINV)         !PRINT SALES REPORT
  289.            .
  290.            MODULE('OE89')
  291.          PROC(PRT_SALESINV)         !PRINT SALES REPORT
  292.            .
  293.            MODULE('OE90')
  294.          PROC(EOD_FORM)             !End of Day Processing for Q
  295.            .
  296.            MODULE('OE91')
  297.          PROC(CATEGORY_TBL)         !Find Category Code
  298.            .
  299.            MODULE('OE92')
  300.          PROC(UPD_CATEGORY)         !UPDATE CATEGORY
  301.            .
  302.            MODULE('OE93')
  303.          PROC(QOI_PRINT)         !PRINT QOI
  304.            .
  305.            MODULE('OE94')
  306.          PROC(RUN_QUICKEN)
  307.            .
  308.            MODULE('OE95')
  309.          PROC(MESSAGE)
  310.            .
  311.            MODULE('OE96')
  312.          PROC(VENDYEAREND)         !Update Vender Balances
  313.            .
  314.            MODULE('OE97')
  315.          PROC(DO_VENDYREND)         !Customer Year End Processing
  316.            .
  317.            MODULE('OE98')
  318.          PROC(SERIALIZE)
  319.            .
  320.            MODULE('OE99')
  321.          PROC(REGISTER)             !PRINT CUSTOMER STATEMENTS
  322.            .
  323.            MODULE('OE_MKINV')
  324.          PROC(MAKEINV)             !Turn Quote/Order into Invoice
  325.            .
  326.            MODULE('OE_STMNT')
  327.          PROC(PRT_STATEMNT)
  328.            .
  329.            MODULE('OE_VEND')
  330.          PROC(FORM_VEND)         !FORM FOR VENDOR INFORMATION
  331.            .
  332.            MODULE('AKACOPYR'),BINARY
  333.          FUNC(AKACOPYRIGHT),STRING     !Create copyright symbol
  334.          PROC(AKACOPYWRONG)         !Sets copyright chars to normal
  335.            .
  336.            MODULE('OE_HISTY')
  337.          PROC(HIST_HOTKEY)
  338.            .
  339.            MODULE('PRT_INV')
  340.          PROC(PRT_QOI)             !Print Quote, Order, Invoice
  341.            .
  342.            MODULE('DOCCVT')
  343.          PROC(DOC_CVT)             !Allow reports no blank lines
  344.            .
  345.            MODULE('PRN2CON')
  346.          PROC(PRN2CON)
  347.            .
  348.            MODULE('DEPOSIT')
  349.          PROC(PRT_DEPOSIT)         !Print Deposit for Quicken
  350.            .
  351.            MODULE('INVENTRY')
  352.          PROC(Q_INVENTORY)         !Print AP for Quicken
  353.            .
  354.            MODULE('COMMISN')
  355.          PROC(Q_COMMISSION)         !Print Quicken Commission
  356.            .
  357.            MODULE('SALESTAX')
  358.          PROC(Q_SALESTAX)         !Print Quicken Sales Tax
  359.            .
  360.            MODULE('CLRKCD'),BINARY
  361.          PROC(CLRKCD)
  362.            .
  363.          .
  364. #OM# OMIT Terminator #OM#
  365.          EJECT('FILE LAYOUTS')
  366. OE_CTRL         FILE,PRE(CTL),RECLAIM
  367.            OWNER('TURBO'),ENCRYPT
  368. RECORD           RECORD
  369. CO_NAME         STRING(50)             !YOUR COMPANY NAME
  370. CO_STREET1     STRING(50)             !STREET ADDRESS LINE 1
  371. CO_STREET2     STRING(50)             !STREET ADDRESS LINE 2
  372. CO_CSZ         STRING(50)             !COMPANY - CITY STATE ZIP
  373. TELE_1         STRING(20)             !YOUR TELEPHONE # FOR STATEMENT
  374. TELE_2         STRING(20)             !YOUR #2 TELE FOR STATMENT-fax?
  375. PASSWORD     STRING(8)             !AR PASSWORD - 8 CHRS OR LESS
  376. NEXT_INUM     LONG                 !next invoice number
  377. NEXT_QNUM     LONG                 !next quote number
  378. NEXT_ONUM     LONG                 !next order number
  379. POST_TO_Q     STRING(1)             !Post to Quicken File
  380. COSTMETHOD     STRING(1)             !Inventory Cost Method
  381. FINANCE_RATE     DECIMAL(4,4)             !RATE FOR FINANCE CALCULATIONS
  382. FINANCE_DAYS     LONG                 !DEFAULT FINANCE DAYS FOR ENTRY
  383. Q_PATH         STRING(30)             !Default location of Quicken
  384. Q_PATH_DEP     STRING(30)             !Path for Deposit File
  385. Q_PATH_AP     STRING(30)             !Path of Accounts Payable File
  386. Q_PATH_TAX     STRING(30)             !Path of Sales Tax File
  387. Q_PATH_COMM     STRING(30)             !Path to Commission File
  388. MESS_01_1     STRING(60)             !STATEMENT MESSAGE - CURRENT
  389. MESS_01_2     STRING(60)
  390. MESS_31_1     STRING(60)             !STATEMENT MESSAGE - 31-60
  391. MESS_31_2     STRING(60)
  392. MESS_61_1     STRING(60)             !STATEMENT MESSAGE 61-90
  393. MESS_61_2     STRING(60)
  394. MESS_91_1     STRING(60)             !STATEMENT MESSAGE 91-120
  395. MESS_91_2     STRING(60)
  396. MESS_121_1     STRING(60)
  397. MESS_121_2     STRING(60)
  398. MESS_ALL_1     STRING(60)             !STATEMENT MESSAGE FOR ALL STAT
  399. MESS_ALL_2     STRING(60)
  400. PRT_SMALL     GROUP                 !Control Codes for Compressed
  401. PS1           BYTE
  402. PS2           BYTE
  403. PS3           BYTE
  404. PS4           BYTE
  405. PS5           BYTE
  406.          .
  407. PRT_BIG         GROUP                 !Control Codes for Normal Print
  408. PB1           BYTE
  409. PB2           BYTE
  410. PB3           BYTE
  411. PB4           BYTE
  412. PB5           BYTE
  413.          .
  414. DEMO         STRING(1)             !Demo Flag
  415.          . .
  416.  
  417. OE_SREP         FILE,PRE(REP),CREATE,RECLAIM
  418. CODEKEY           KEY(REP:CODE),NOCASE,OPT
  419. NAMEKEY           KEY(REP:NAME),NOCASE,OPT
  420. RECORD           RECORD
  421. CODE         STRING(5)             !Sales Rep Code
  422. NAME         STRING(20)             !Sales Rep Name
  423. CATEGORY     STRING(30)             !Quicken Category
  424.          . .
  425.  
  426. OE_STAX         FILE,PRE(TAX),CREATE,RECLAIM
  427. CODEKEY           KEY(TAX:CODE),NOCASE,OPT
  428. RECORD           RECORD
  429. CODE         STRING(5)             !Sales Tax Code
  430. NAME         STRING(20)             !Sales Tax Name/Region
  431. RATE         DECIMAL(5,3)             !Sales Tax Rate
  432. CATEGORY     STRING(30)             !Quicken Category
  433.          . .
  434.  
  435. OE_SCAT         FILE,PRE(CAT),CREATE,RECLAIM
  436. CODEKEY           KEY(CAT:CODE),NOCASE,OPT
  437. VEND1KEY       KEY(CAT:VEND_NUM_PRI,CAT:CODE),DUP,NOCASE
  438. VEND2KEY       KEY(CAT:VEND_NUM_SEC,CAT:CODE),DUP,NOCASE
  439. RECORD           RECORD
  440. CODE         STRING(10)             !Item Code
  441. DESC         STRING(29)             !Item Description
  442. PRICE         DECIMAL(9,2)             !Sales Price
  443. UNIT         STRING(2)             !Item Unit
  444. CCODE         STRING(1)             !CommissionCode (C/I/N)
  445. CRATE         DECIMAL(5,2)             !Commission Rate (Code=I)
  446. TAXYN         STRING(1)             !Taxable Item? Y/N
  447. VEND_NUM_PRI     STRING(10)             !VENDOR NUMBER - PRIMARY VEND
  448. VEND_COD_PRI     STRING(14)             !PRIMARY VENDOR REORDER/CAT NUM
  449. VEND_NUM_SEC     STRING(10)             !SECONDARY VENDOR NUMBER
  450. VEND_COD_SEC     STRING(14)             !SECONDARY VENDOR REORDER/CAT #
  451.          . .
  452.  
  453. OE_INVCE     FILE,PRE(INV),CREATE,RECLAIM
  454. TYPENUMKEY     KEY(INV:TYPE,INV:NUMBER),NOCASE,OPT
  455. CUSTKEY           KEY(INV:TYPE,INV:CUSTNUM,INV:TRANDATE,INV:NUMBER),NOCASE,OPT
  456. SREPKEY           KEY(INV:TYPE,INV:SALESREP,INV:TRANDATE,INV:NUMBER),NOCASE,OPT
  457. TAXKEY           KEY(INV:TYPE,INV:TAXCODE,INV:TRANDATE,INV:NUMBER),NOCASE,OPT
  458. COMMKEY           KEY(INV:TYPE,INV:SALESREP,INV:LASTPAYDATE,INV:NUMBER),NOCASE,OPT
  459. SALESRPTKEY1   KEY(INV:NUMBER),DUP,NOCASE,OPT
  460. SALESRPTKEY2   KEY(INV:CUSTNUM),DUP,NOCASE,OPT
  461. PRINTST_KEY    KEY(INV:PRINTSTATUS),DUP,NOCASE,OPT
  462. RECORD           RECORD
  463. NUMBER         LONG                 !Invoice Number
  464. TYPE         STRING(1)             !Type:(Q)uote/(O)rder/(I)nvoice
  465. PRINTSTATUS     STRING(1)             !Printed? (*)-Yes
  466. TRANDATE     LONG                 !Transaction Date
  467. SHIPDATE     LONG                 !Ship Date
  468. DUEDATE         LONG                 !Due Date
  469. ORDREF         STRING(10)             !Our Order/Invoice Reference
  470. CUSTNUM         LONG                 !Customer Number (Internal)
  471. TERMSMSG     STRING(10)             !Customer Terms (Message)
  472. SHIPBY         STRING(10)
  473. FOBPOINT     STRING(10)
  474. CUSTPO         STRING(10)             !Customer Purchase Order Ref
  475. SALESREP     STRING(5)             !Sales Rep for this Invoice
  476. COMMRATE     DECIMAL(5,2)             !Default Commission
  477. COMMTOTAL     DECIMAL(8,2)             !Total Commission for Invoice
  478. TAXCODE         STRING(5)             !Sales Tax Code
  479. TAXRATE         DECIMAL(5,3)
  480. SALETOTAL     DECIMAL(9,2)             !Total Sales - Transaction
  481. CREDTOTAL     DECIMAL(9,2)             !Total Credits / Transaction
  482. TAXABLESALES     DECIMAL(9,2)             !Taxable amount of subtotal
  483. SUBTOTAL     DECIMAL(9,2)             !Invoice Subtotal
  484. TAXTOTAL     DECIMAL(9,2)             !Sales Tax Total
  485. FREIGHTTOTAL     DECIMAL(9,2)             !Freight Charges
  486. FINANCETOTAL     DECIMAL(9,2)             !Finance Charges Total
  487. TOTAL         DECIMAL(9,2)             !Invoice Total
  488. PAID         DECIMAL(9,2)             !Amount Paid on Invoice
  489. BALANCE         DECIMAL(9,2)             !Balance Due on Invoice
  490. LASTPAYDATE     LONG                 !Last Payment Date
  491. RETURNED     STRING(1)
  492. AMT_RETRND     DECIMAL(9,2)
  493. REASON1         STRING(20)
  494. BAD_CHECK     STRING(1)
  495. AMT_BAD_CHK     DECIMAL(9,2)
  496. REASON2         STRING(20)
  497.          . .
  498.  
  499. OE_DTAIL     FILE,PRE(DET),CREATE,RECLAIM
  500. TYPENUMLNKEY   KEY(DET:TYPE,DET:INVNUM,DET:LINE),NOCASE,OPT
  501. SALESRPTKEY4   KEY(DET:INVNUM),DUP,NOCASE,OPT
  502. RECORD           RECORD
  503. TYPE         STRING(1)             !Detail Type - QOI
  504. INVNUM         LONG                 !Invoice Number
  505. LINE         DECIMAL(4,1)             !DETAIL LINE
  506. TRANCODE     STRING(1)             !TRANSACTION CODE
  507. ITEMCODE     STRING(10)
  508. DESC         STRING(29)             !Item/Transaction Desc.
  509. ORDQTY         DECIMAL(6,2)             !Order Quantity
  510. SHPQTY         DECIMAL(6,2)             !Shipped Quantity
  511. BOQTY         DECIMAL(6,2)             !Back Order Quantity
  512. UNIT         STRING(2)             !Unit Code
  513. LPRICE         DECIMAL(9,2)             !Full Price per Unit
  514. PERCNTDISC     DECIMAL(5,2)             !Percentage Discount
  515. SPRICE         DECIMAL(9,2)             !Sell Price per Unit
  516. CRATE         DECIMAL(5,2)             !Commission Rate This Item
  517. TAXYN         STRING(1)             !Taxable Detail Line
  518.          . .
  519.  
  520. OE_PYMT         FILE,PRE(PAY),CREATE,RECLAIM
  521. INVKEY           KEY(PAY:ITYPE,PAY:INVNUM,PAY:LINE),NOCASE,OPT
  522. CUSTKEY           KEY(PAY:CUSTNUM,PAY:DATE,PAY:ITYPE,PAY:INVNUM,PAY:LINE),NOCASE,OPT
  523. DATEKEY           KEY(PAY:DATE,PAY:ITYPE,PAY:INVNUM,PAY:LINE),NOCASE,OPT
  524. RECORD           RECORD
  525. ITYPE         STRING(1)             !Invoice Type
  526. INVNUM         LONG                 !Invoice Number
  527. LINE         BYTE                 !Line Number
  528. CUSTNUM         LONG                 !Customer Number (Internal)
  529. TYPE         STRING(1)             !Type (R)eg (D)ep (A)ppDep
  530. DATE         LONG                 !Date of Payment
  531. AMOUNT         DECIMAL(9,2)             !Amount of Payment
  532. COMMENT         STRING(25)             !Comment Line
  533. CATEGORY     STRING(30)             !Quicken Category
  534.          . .
  535.  
  536. IV_ITEM         FILE,PRE(ITE),CREATE,RECLAIM
  537. CODEKEY           KEY(ITE:CODE),NOCASE,OPT
  538. VEND1KEY       KEY(ITE:VEND_NUM_PRI,ITE:CODE),DUP,NOCASE
  539. VEND2KEY       KEY(ITE:VEND_NUM_SEC,ITE:CODE),DUP,NOCASE
  540. RECORD           RECORD
  541. CODE         STRING(10)             !Inventory Code
  542. DESC         STRING(29)             !Inventory Item Description
  543. DEPARTMENT     STRING(5)             !Item Department Code
  544. QOH         LONG                 !Quantity On Hand
  545. QTYORD         LONG                 !Quantity Ordered (Reserved)
  546. MINSTOCK     LONG                 !Minimum Stock before reorder
  547. DESSTOCK     LONG                 !Desired Stock Level
  548. AVGCOST         DECIMAL(9,2)             !Average Cost
  549. TOTALVALUE     DECIMAL(9,2)             !Inventory Total Cost Value
  550. LISTPRICE     DECIMAL(9,2)             !Selling List Price
  551. UNIT         STRING(2)             !Unit Code
  552. CATEGORY     STRING(30)             !Quicken Cost of Sales Account
  553. CCODE         STRING(1)             !Commission Code (CIN)
  554. CRATE         DECIMAL(5,2)             !Commission Rate (Code=I)
  555. TAXYN         STRING(1)             !Charge Sales Tax
  556. VEND_NUM_PRI     STRING(10)             !Vendor ID - Primary
  557. VEND_COD_PRI     STRING(14)             !Vendor Part Code - Primary
  558. VEND_NUM_SEC     STRING(10)             !Vendor ID - Secondary
  559. VEND_COD_SEC     STRING(14)             !Vendor Part Code - Secondary
  560.          . .
  561.  
  562. IV_ICOST     FILE,PRE(COS),CREATE,RECLAIM
  563. CODELNKEY      KEY(COS:CODE,COS:LINE),NOCASE,OPT
  564. CODEDATEKEY    KEY(COS:CODE,COS:DATE,COS:LINE),NOCASE,OPT
  565. DATEKEY           KEY(COS:DATE,COS:CODE,COS:LINE),NOCASE,OPT
  566. VENDOR_KEY     KEY(COS:PRIM_VENDOR),DUP,NOCASE,OPT
  567. RECORD           RECORD
  568. CODE         STRING(10)             !Item Code
  569. LINE         LONG                 !Code Line
  570. DATE         LONG                 !Receive Date
  571. QTY         LONG                 !Purchase Quantity
  572. QOH         LONG                 !Quantity On Hand
  573. COST         DECIMAL(9,2)             !Purchase Cost Per Unit
  574. PRIM_VENDOR     STRING(10)
  575.          . .
  576.  
  577. IV_DISC         FILE,PRE(DIS),CREATE,RECLAIM
  578. QTYKEY           KEY(DIS:SQTY),NOCASE,OPT
  579. RECORD           RECORD
  580. SQTY         LONG                 !Start Quantity for Bracket
  581. EQTY         LONG                 !End Quantity for Bracket
  582. DISCOUNT     DECIMAL(5,2)             !Discount Percentage
  583.          . .
  584.  
  585. VEND         FILE,PRE(VEN),CREATE,RECLAIM
  586.            OWNER('$BRIX'),ENCRYPT
  587. NAME_X           KEY(VEN:VEND_NAME),DUP,NOCASE
  588. CITY_X           KEY(VEN:VEND_CITY),DUP,NOCASE
  589. ZIP_X           KEY(VEN:VEND_ZIP),DUP,NOCASE
  590. VEND_NUM_X     KEY(VEN:VEND_NUM),NOCASE,OPT
  591. RECORD           RECORD
  592. VEND_NAME     STRING(30)
  593. VEND_ADDR_1     STRING(30)
  594. VEND_ADDR_2     STRING(30)
  595. VEND_CITY     STRING(15)
  596. VEND_STATE     STRING(2)
  597. VEND_ZIP     STRING(10)
  598. VEND_COUNTRY     STRING(10)
  599. VEND_DATA_1     STRING(30)
  600. VEND_DATA_2     STRING(30)
  601. VEND_TELE_1     STRING(15)
  602. REMIT_TELE     STRING(15)
  603. REMIT_NAME     STRING(30)             !remittance name
  604. REMIT_ADDR_1     STRING(30)
  605. REMIT_ADDR_2     STRING(30)
  606. REMIT_CITY     STRING(15)
  607. REMIT_STATE     STRING(2)
  608. REMIT_ZIP     STRING(10)
  609. REMITCOUNTRY     STRING(10)
  610. REMIT_DATA_1     STRING(30)             !FUTURE USE
  611. REMIT_DATA_2     STRING(30)             !FUTURE USE
  612. CHECK_NAME     STRING(1)             !NAME FOR CHECKS
  613. VEND_NUM     STRING(10)
  614. FED_TAX_NUM     STRING(15)             !VENDOR FEDERAL TAX ID FOR 1099
  615. OUR_ACCT     STRING(15)             !OUR ACCOUNT NUMBER WITH VENDOR
  616. CURRENT_BAL     DECIMAL(11,2)
  617. VEND_AMT_1     DECIMAL(11,2)             !for your use
  618. VEND_AMT_2     DECIMAL(11,2)             !for your use
  619. VEND_AMT_3     DECIMAL(11,2)             !for your use
  620. VEND_AMT_4     DECIMAL(11,2)             !for your use
  621. VEND_AMT_5     DECIMAL(11,2)             !FUTURE USE
  622. VEND_AMT_6     DECIMAL(11,2)             !FUTURE USE
  623. PURCH_1099     DECIMAL(11,2)             !PURCHASES/PAID - 1099 YTD
  624. PERCENT_1099     DECIMAL(4,4)             !future use - 1099 WITHHOLDING
  625. WH_1099         DECIMAL(11,2)             !AMOUNT WITHHELD FOR 1099
  626. FUT_1099_1     STRING(1)             !FUTURE USE 1099
  627. FUT_1099_2     DECIMAL(11,2)             !FUTURE USE
  628. FUT_1099_3     DECIMAL(11,2)             !FUTURE USE
  629. TYPE_1099     STRING(1)             !1099 CATEGORY, MISC, DIV, ETC
  630. YTD_PURCH     DECIMAL(11,2)
  631. LAST_YR_PURC     DECIMAL(11,2)
  632. CREDIT_LIMIT     DECIMAL(11,2)
  633. DUE_IN_DAYS     LONG                 !TERMS IN DAYS
  634. DISC_DAYS     LONG
  635. TAX_RATE     DECIMAL(5,4)
  636. DISCOUNT_YN     STRING(1)
  637. DISC_RATE     DECIMAL(5,4)
  638. TERMS         STRING(15)
  639. SALESMAN     STRING(6)
  640. CONTACT         STRING(20)
  641. CONTACT_TELE     STRING(20)             !CONTACT TELEPHONE
  642. LETTER_TO     STRING(25)
  643.          . .
  644.  
  645. AP_1099         FILE,PRE(AP1),CREATE,RECLAIM,PROTECT
  646.            OWNER('$BRIX'),ENCRYPT
  647. TYPE_X           KEY(AP1:TYPE),NOCASE,OPT
  648. RECORD           RECORD
  649. TYPE         STRING(1)             !NUMBER CORRESPONDING TO FORM
  650. TYPE_DESCR     STRING(35)             !DESCRIPTION OF 1099 TYPE
  651.          . .
  652.  
  653. AP_TRAN         FILE,PRE(APT),CREATE,RECLAIM
  654.            OWNER('$BRIX'),ENCRYPT
  655. I_NUM_X           KEY(APT:INVOICE_NUM,APT:I_TRN_CODE),DUP,NOCASE,OPT
  656. I_TRN_DATE_X   KEY(APT:I_TRN_DATE),DUP,NOCASE,OPT
  657. I_TRN_DUE_X    KEY(APT:I_TRN_DUE),DUP,NOCASE
  658. VEND_NUM_X     KEY(APT:VEND_NUM),DUP,NOCASE,OPT
  659. I_TRN_NUM_X    KEY(APT:I_TRN_NUM),NOCASE,OPT
  660. RPT_X           KEY(APT:VEND_NUM,APT:INVOICE_NUM,APT:I_TRN_CODE,APT:I_TRN_POSTED),DUP,NOCASE
  661. POSTED_X       KEY(APT:I_TRN_POSTED),DUP,NOCASE
  662. RECORD           RECORD
  663. INVOICE_NUM     STRING(15)             !INVOICE NUMBER
  664. ON_HOLD         STRING(1)             !HOLD PMT DURING CALCULATIONS
  665. VEND_NUM     STRING(10)             !VENDOR NUMBER
  666. I_TRN_TYPE     STRING(1)             !TRANSACTION TYPE
  667. I_TRN_CODE     STRING(1)             !TRANSACTION CODE
  668. I_TRN_AMOUNT     DECIMAL(11,2)
  669. I_TRN_NETAMT     DECIMAL(11,2)             !NET AMOUNT OF THE INVOICE DUE
  670. I_TRN_DATE     LONG                 !TRANSACTION DATE
  671. I_TRN_DUE     LONG                 !DUE DATE FOR INVOICE
  672. I_TRN_DISC     LONG                 !DISCOUNT DATE
  673. I_TRN_DESCR     STRING(25)             !DESCRIPTION
  674. I_TRN_SLSMAN     STRING(10)             !VEND SALESMAN
  675. I_TRN_AUTH     DECIMAL(11,2)             !AUTHORIZED AMOUNT
  676. I_TRN_NUM     LONG                 !TRANSACTION NUMBER
  677. I_TRN_POSTED     STRING(1)             !TRANSACTION POSTED?
  678.          . .
  679.  
  680. AP_CKS         FILE,PRE(APC),CREATE,RECLAIM
  681.            OWNER('$BRIX'),ENCRYPT
  682. CK_NUM_X       KEY(APC:CHECK_NUMBER),DUP,NOCASE,OPT
  683. RECORD           RECORD
  684. VEND_NUM     STRING(10)             !CK VENDOR NUMBER
  685. INVOICE_NUM     STRING(15)             !INVOICE NUMBER
  686. CHECK_NUMBER     STRING(15)             !CHECK NUMBER
  687. RETURNED     STRING(1)             !RETURNED FROM BANK-FUTURE USE
  688. POSTED         STRING(1)             !CHECK POSTED-FUTURE USE
  689. CHECK_NUM     LONG                 !THE ACTUAL CHECK NUMBER - LONG
  690. PAYEE         STRING(50)             !CHECK PAYEE (VENDOR OR REMIT)
  691. I_TRN_DATE     LONG                 !DATE OF CHECK
  692. I_TRN_DESC     STRING(25)             !INVOICE DESCRIPTION
  693. I_TRN_NETAMT     DECIMAL(11,2)             !AMOUNT TO POST TO AP INVOICES
  694. I_TRN_DISAMT     DECIMAL(11,2)             !DISCOUNT AMOUNT FOR THIS INV
  695. I_TRN_CODE     STRING(1)             !TRANSACTION CODE 1,2,3
  696.          . .
  697.  
  698. OE_CUST         FILE,PRE(CUS),CREATE,RECLAIM
  699. NAMEKEY           KEY(CUS:BILL_ZIP,CUS:TICKLER_TO,CUS:BILL_NAME),DUP,NOCASE
  700. CNUMKEY           KEY(CUS:CUST_NUM),NOCASE,OPT
  701. NUMKEY           KEY(CUS:NUMBER),NOCASE,OPT
  702. NAMEKEY2       KEY(CUS:BILL_NAME),DUP,NOCASE
  703. RECORD           RECORD
  704. NUMBER         LONG                 !Internal Customer Number
  705. CUST_NUM     STRING(10)             !CUSTOMER NUMBER
  706. BILL_NAME     STRING(30)             !CUSTOMER NAME
  707. BILL_ADDR_1     STRING(30)             !BILLING ADDRESS LINE 1
  708. BILL_ADDR_2     STRING(30)             !BILLING ADDRESS LINE 2
  709. BILL_CITY     STRING(15)             !BILLING CITY
  710. BILL_STATE     STRING(2)             !BILLING STATE
  711. BILL_ZIP     STRING(@P#####PB)         !BILLING ZIP CODE
  712. BILL_COUNTRY     STRING(10)             !BILLING COUNTRY
  713. TELEPHONE_1     STRING(15)             !CUSTOMER TELEPHONE 1 -PRIMARY
  714. TELEPHONE_2     STRING(15)             !CUSTOMER PHONE 2 - FAX, ETC.
  715. SHIP_ADDR_1     STRING(30)             !SHIPPING ADDRESS LINE 1
  716. SHIP_ADDR_2     STRING(30)             !SHIPPING ADDRESS LINE 2
  717. SHIP_ADDR_3     STRING(30)             !SHIPPING LINE THREE
  718. SHIP_ADDR_4     STRING(30)             !SHIPPING ADDRESS FOUR
  719. CURRENT_BAL     DECIMAL(11,2)             !CURRENT CUSTOMER BALANCE -TOT
  720. YTD_SALES     DECIMAL(11,2)             !SALES THIS YEAR
  721. LAST_YR_SALE     DECIMAL(11,2)             !SALES FOR PRIOR YEAR
  722. LAST_I_DATE     LONG                 !LAST INVOICE DATE
  723. LAST_PMTDATE     LONG                 !LAST PAYMENT DATE
  724. LAST_PMT_AMT     DECIMAL(11,2)             !LAST PAYMENT AMOUNT
  725. LAST_INV_NUM     LONG                 !Last Invoice Number
  726. CREDIT_LIMIT     DECIMAL(11,2)             !CUTOMER CREDIT LIMIT
  727. CREDIT_RTNG     STRING(1)             !Flag for Bad Checks or Retrns
  728. DUE_IN_DAYS     LONG                 !NUMBER OF DAYS INVOICES DUE
  729. FINANCE_DAYS     LONG                 !APPLY FINANCE AFTER n DAYS
  730. SEND_REMIND     STRING(1)             !PRINT REMINDER ON STATEMENTS
  731. TAX_CODE_DEF     STRING(5)             !TAX CODE AR REF IF ANY
  732. FINANCE_YN     STRING(1)             !CHARGE CUST FINANCE CHG YES/NO
  733. FINANCE_RATE     DECIMAL(5,4)             !PERCENTAGE OF FINANCE CHG
  734. SEND_STAT     STRING(1)             !SEND STATEMENTS TO CUSTOMER
  735. TERMS         STRING(10)             !TEXT-CUST TERMS-NOT FOR CALC
  736. SALESMAN     STRING(5)             !CUSTOMER SALESMAN
  737. COMMRATE     DECIMAL(5,2)             !SALESREP COMMISSION RATE
  738. CONTACT         STRING(20)             !CUSTOMER CONTACT FOR AR
  739. TICKLER_TO     STRING(10)             !SEND SALES TICKLER MESSAGES TO
  740. ADDR_SAME     STRING(1)             !Address Same as Shipping Addr
  741.          . .
  742.  
  743. CATEGORY     FILE,PRE(CAG),CREATE,RECLAIM
  744. CATEGORY_KEY   KEY(CAG:CATEGORY),NOCASE,OPT
  745. RECORD           RECORD
  746. CATEGORY     STRING(30)             !Category Name
  747.          . .
  748.  
  749.          EJECT('GLOBAL MEMORY VARIABLES')
  750. ACTION         SHORT                 !0 = NO ACTION
  751.                          !1 = ADD RECORD
  752.                          !2 = CHANGE RECORD
  753.                          !3 = DELETE RECORD
  754.                          !4 = LOOKUP FIELD
  755.                          !5 = AUTONUMKEY ADD
  756. CHAIN_MENU     BYTE(0)             !BX CHAIN TO ACCT MENU
  757.  
  758.  
  759.          GROUP,PRE(MEM)
  760. MESSAGE           STRING(30)             !Global Message Area
  761. PAGE           SHORT                 !Report Page Number
  762. LINE           SHORT                 !Report Line Number
  763. DEVICE           STRING(30)             !Report Device Name
  764. TODAY           LONG                 !Today's Logon Date
  765. PASSWORD       STRING(8)             !Password Entry Field
  766. SDATE           LONG                 !Starting Date
  767. EDATE           LONG                 !Ending Date
  768. SNUM           LONG                 !Start Tran Number
  769. ENUM           LONG                 !Ending Tran Number
  770. SCODE           STRING(10)             !Scratch Code @S5
  771. FLAG1           BYTE                 !Special Use Flag Variable
  772. KEY_FLAG       BYTE                 !hold variable for keypress
  773. ANSWER1           STRING(1)             !Scratch Answer Field
  774. ANSWER2           STRING(1)             !Scratch Answer Field
  775. SAVEDATE       LONG                 !Scratch Variable
  776. CUSTNUM_ALPH   STRING(10)             !Customer Number Scratch
  777. CUSTNUM_NUM    LONG                 !Customer Number - Long
  778. AMT1           DECIMAL(9,2)             !Scratch Variable for $$
  779. AMT2           DECIMAL(9,2)             !Scratch Variable
  780. AMT3           DECIMAL(9,2)             !Scratch Variable
  781. AMT4           DECIMAL(9,2)             !Scratch Variable
  782. AMT5           DECIMAL(9,2)             !Scratch Variable
  783. FILENAME       STRING(50)
  784.          .
  785.  
  786.  
  787. EXITSCRN     SCREEN      WINDOW(11,50),AT(8,16),HUE(0,7)
  788.            ROW(4,18)  PAINT(1,17),HUE(16,4)
  789.            ROW(1,1)      STRING('╔═{48}╗'),HUE(4,7)
  790.            ROW(2,1)      REPEAT(9);STRING('║<0{48}>║'),HUE(4,7) .
  791.            ROW(11,1)  STRING('╚═{48}╝'),HUE(4,7)
  792.            ROW(4,18)  STRING(' Request to Exit '),HUE(30,4)
  793.            ROW(7,8)      STRING('Press')
  794.          COL(14)  STRING(' ESCAPE '),HUE(14,4)
  795.          COL(23)  STRING('again to confirm exit.')
  796.            ROW(9,10)  STRING('Any other key to restart program.')
  797.          .
  798.  
  799.          EJECT('CODE SECTION')
  800.   CODE
  801.   SETHUE(7,0)                     !SET WHITE ON BLACK
  802.   BLANK                         !  AND BLANK
  803.   HELP('OE.HLP')                 !OPEN THE HELP FILE
  804.   G_OPENFILES                     !OPEN OR CREATE FILES
  805.   SETHUE()                     !    THE SCREEN
  806. DOAGAIN
  807.   STARTSCREEN                     !introduction form
  808.   IF KEYCODE()=CTRL_ESC THEN RETURN.
  809.   IDLE()
  810.   OPEN(EXITSCRN)
  811.   ASK
  812.   CLOSE(EXITSCRN)
  813.   IF KEYCODE()<>ESC_KEY THEN GOTO DOAGAIN.
  814.   IF CHAIN_MENU = TRUE                 ! CHAIN TO ACCT MENU IF TRUE
  815.     CHAIN('ACCTMENU')                 ! CALL THE MENU
  816.   .
  817.   RETURN                     !EXIT TO DOS
  818.  
  819. IDLER         PROCEDURE
  820.   CODE
  821.   NORMAL
  822.   SHOW(25,1,TODAY(),@D1)
  823.   SHOW(25,10,CLOCK(),@T3)
  824. ! I# = INSTATE()
  825. ! IF I#<>0
  826. !    SHOW(25,67,'Ins',@S3)
  827. ! ELSE
  828. !    SHOW(25,67,'   ',@S3)
  829. ! .
  830.   PEEK(0417h,I#)
  831.   IF BAND(I#,01000000b)
  832.     SHOW(25,70,'Cap',@S3)
  833.   ELSE
  834.     SHOW(25,70,'   ',@S3)
  835.   .
  836.   PEEK(0417h,I#)
  837.   IF BAND(I#,00100000b)
  838.     SHOW(25,73,'Num',@S3)
  839.   ELSE
  840.     SHOW(25,73,'   ',@S3)
  841.   .
  842.   SHOW(25,77,FORMAT(MEMORY(1)/1000,@N4))
  843.   SETHUE()
  844.   RETURN
  845.  
  846. DISPBMSG     PROCEDURE(BMSG)
  847. BMSG         STRING(48)
  848.   CODE
  849.   SHOW(25,18,CENTER(BMSG,48))
  850.   RETURN
  851.  
  852. STEPCHECK    PROCEDURE(FIELDVALUE,STEPSIZE)
  853.  
  854. STEPSIZE     DECIMAL(8,2)
  855. FIELDVALUE   EXTERNAL
  856.   CODE
  857.   IF OMITTED(2)                     !IF STEPSIZE IS OMITTED
  858.     STEPSIZE=1                     !SET TO 1
  859.   END
  860.   CASE KEYCODE()
  861.   OF GPLUS_KEY
  862.     FIELDVALUE += STEPSIZE             !IF GREY PLUS KEY
  863.     DISPLAY(?)                     !DISPLAY NEW VALUE
  864.     SELECT(?)                     !STAY IN FIELD
  865.   OF GMINUS_KEY                     !IF GREY MINUS KEY
  866.     FIELDVALUE -= STEPSIZE
  867.     DISPLAY(?)
  868.     SELECT(?)
  869.   OF GAST_KEY                     !IF GREY ASTERICK KEY
  870.     FIELDVALUE = TODAY()             !SET TO TODAY'S DATE
  871.     DISPLAY(?)
  872.     SELECT(?)
  873.   END                         !END CASE KEYCODE()
  874.   RETURN
  875.  
  876. G_OPENFILES  PROCEDURE                 !OPEN FILES & CHECK FOR ERROR
  877.   CODE
  878.   RECOVER(120)                     !HOLDS TIMEOUT IN 120 SECONDS
  879.   G_OPENFILES2(OE_CTRL)                 !GO OPEN THE FILE
  880.                          !END OPENFILE
  881.   G_OPENFILES2(OE_SREP)                 !GO OPEN THE FILE
  882.                          !END OPENFILE
  883.   G_OPENFILES2(OE_STAX)                 !GO OPEN THE FILE
  884.                          !END OPENFILE
  885.   G_OPENFILES2(OE_SCAT)                 !GO OPEN THE FILE
  886.                          !END OPENFILE
  887.   G_OPENFILES2(OE_INVCE)             !GO OPEN THE FILE
  888.                          !END OPENFILE
  889.   G_OPENFILES2(OE_DTAIL)             !GO OPEN THE FILE
  890.                          !END OPENFILE
  891.   G_OPENFILES2(OE_PYMT)                 !GO OPEN THE FILE
  892.                          !END OPENFILE
  893.   G_OPENFILES2(IV_ITEM)                 !GO OPEN THE FILE
  894.                          !END OPENFILE
  895.   G_OPENFILES2(IV_ICOST)             !GO OPEN THE FILE
  896.                          !END OPENFILE
  897.   G_OPENFILES2(IV_DISC)                 !GO OPEN THE FILE
  898.                          !END OPENFILE
  899.   G_OPENFILES2(VEND)                 !GO OPEN THE FILE
  900.                          !END OPENFILE
  901.   G_OPENFILES2(AP_1099)                 !GO OPEN THE FILE
  902.                          !END OPENFILE
  903.   G_OPENFILES2(AP_TRAN)                 !GO OPEN THE FILE
  904.                          !END OPENFILE
  905.   G_OPENFILES2(AP_CKS)                 !GO OPEN THE FILE
  906.                          !END OPENFILE
  907.   G_OPENFILES2(OE_CUST)                 !GO OPEN THE FILE
  908.                          !END OPENFILE
  909.   G_OPENFILES2(CATEGORY)             !GO OPEN THE FILE
  910.                          !END OPENFILE
  911.   RECOVER()                     !DISARM RECOVER
  912.   BLANK                         !BLANK THE SCREEN
  913.  
  914. !─ Begin new model procedure ─────────────────────────────────────────
  915. G_OPENFILES2  PROCEDURE(DataFile)
  916. DataFile      EXTERNAL,FILE
  917. FileName      STRING(64)
  918.  
  919.           CODE
  920.   FileName = NAME(DataFile)           !STORE NAME OF FILE PASSED
  921.   SHOW(25,1,CENTER('Sharing file: ' & CLIP(FileName),80))
  922.   SHARE(DataFile)               !OPEN THE FILE IN SHARED MODE
  923.   IF ERRORCODE()               !OPEN RETURNED AN ERROR
  924.     CASE ERRORCODE()               ! CHECK FOR SPECIFIC ERROR
  925.     OF 46                   !  KEYS NEED TO BE REQUILT
  926.       SETHUE(0,7)               !  BLACK ON WHITE
  927.       SHOW(25,1,CENTER('Rebuilding keys for ' & CLIP(FileName),80))
  928.       OPEN(DataFile)               !  TRY TO GET EXCLUSIVE ACCESS
  929.       IF ERRORCODE() = 55           !  IF OPEN FAILS
  930.     SHOW(25,1,CENTER('Exclusive access required to' |
  931.      & 'rebuild keys for ' & CLIP(FileName),80))
  932.     ASK                   !    WAIT FOR A KEYSTROKE
  933.     RETURN                   !    AND EXIT
  934.       ELSE                   !  OTHERWISE
  935.     BUILD(DataFile)               !    CALL THE BUILD PROCEDURE
  936.     CLOSE(DataFile)               !    CLOSE UNSHARED FILE
  937.     SHARE(DataFile)               !    OPEN FILE SHARED
  938.     SETHUE(7,0)               !    WHITE ON BLACK
  939.     BLANK(25,1,1,80)           !    BLANK THE MESSAGE
  940.       END ! IF                   !  END IF
  941.     OF 2                     !IF NOT FOUND,
  942.       CREATE(DataFile)                 !  THEN CREATE
  943.       CLOSE(DataFile)                 !  CLOSE IT SO IT CAN
  944.       SHARE(DataFile)                 !    BE OPENED SHARED
  945.     ELSE                   ! ANY OTHER ERROR
  946.       LOOP                   !  STOP EXECUTION
  947.     STOP('Cannot share ' & CLIP(FileName) & ' - Error:' & ERROR())
  948.       END ! Loop
  949.     END ! Case
  950.   END ! If
  951. !─ End new model procedure ───────────────────────────────────────────
  952.  
  953.  
  954.