<><><><><><><><><><><><><><><><><><><><><><><><><>
<>                                              <>
<>   Program to link to UBS Accounting System   <>
Welcome you to write program to link to UBS Accounting System. The process
is very simple. It consists of 2 interface programs, X and Y as indicated
below.
+-------------------+     +-------------------+     +-------------------+
|     Your Data     |  X  |    GLPOST9.DBF    |  Y  |  UBS Accounting   |
+-------------------+ ==> +-------------------+ ==> +-------------------+
an intermediate file
What you have to do is to write an interface program X that will update
the GLPOST9.DBF.
Normally, one record in your data file will generate 2 records in GLPOST9.
The second interface program i.e. Y is handled by UBS Accounting System.
The program will update all necessary data files in UBS Accounting.
Example
^^^^^^^
Assuming that you have a billing system for a clinic and would like to
update the UBS Accounting.
For every bill in your clinic system, you need to append 2 records into
the accounting system. The following example shows how 4 bills (4 records)
in the clinic system generate 8 transactions (8 records) in GLPOST9.DBF.
|     BILLS.DBF     |  X  |    GLPOST9.DBF    |  Y  |    GLPOST.DBF     |
clinic data files         intermediate file        UBS Accounting files
Please refer to the following sample data files
1) File structure for BILLS.DBF
2) Records in BILLS.DBF
3) Fields in GLPOST9 required to be updated
4) Interface program X
5) Records in GLPOST9
FILE STRUCTURE : BILLS.DBF
^^^^^^^^^^^^^^^^^^^^^^^^^^
Field  Field Name      Type           Width     Dec
1  PERIOD          Numeric            2
2  DATE            Date               8
3  CODE            Character          8
4  BILLNO          Character          8
5  TREATMENT       Character         20
6  AMOUNT          Numeric           12       2
SAMPLE RECORDS IN FILE BILLS.DBF
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
PERIOD  DATE       CODE        BILLNO       TREATEMENT         AMOUNT
1  02/01/94   3000/A01    B112         OPERATION          150.00
1  03/02/94   3000/B01    B113         MEDICINE            20.00
1  04/03/94   3000/A01    B114         MEDICINE            15.00
1  05/04/94   3000/B01    B115         OPERATION          200.00
FIELDS IN GLPOST9.DBF THAT ARE REQUIRED TO BE UPDATED
FIELD NO.     FIELD NAME    REMARK
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1.        FPERIOD       PERIOD 1 - 18
4.        ACCNO         eg DEBTOR CODE, SALES A/C
5.        REFERENCE     ie BILL NO.
7.        DATE          TRANSACTION DATE
8.        DESP          DESCRIPTION TO APPEAR ON LEDGER
11.        DEBITAMT      AMOUNT YOU WANT TO DEBIT
12.        CREDITAMT     AMOUNT YOU WANT TO CREDIT
14.        ARAPTYPE      I = INVOICE        C = CREDIT NOTE
D = DEBIT NOTE     P = PAYMENT
R = RETURN CHEQUE  H = CASH SALE
15.        AGE           0 FOR INVOICE, 11 FOR PAYMENT
****************************************************
*  SAMPLE PROGRAM THAT ADD RECORDS TO GLPOST9.DBF  *
*  5000/000 IS THE SALES ACCOUNT NO.               *
SET TALK OFF
SELECT A
USE BILLS
SELECT B
USE GLPOST9
SALESACC = "5000/000"
DO WHILE .NOT. EOF()
APPEND BLANK
REPLACE FPERIOD   WITH A->PERIOD, ;
DATE      WITH A->DATE,   ;
ACCNO     WITH A->CODE,   ;
REFERENCE WITH A->BILLNO, ;
DESP      WITH A->TREATMENT
REPLACE DEBITAMT  WITH A->AMOUNT, ;
CREDITAMT WITH 0,         ;
ARAPTYPE  WITH "I",       ;
AGE       WITH 0
ACCNO     WITH SALESACC,  ;
REPLACE DEBITAMT  WITH 0,         ;
CREDITAMT WITH A->AMOUNT
SKIP
ENDDO
CLOSE DATABASES
DATAFLOW
^^^^^^^^
+----------------------------------------------------------+
|    BILLS.DBF     |            GLPOST9.DBF                |
|------------------+---------------------------------------|
| Code    Amount   |  Accno      Debitamt     Creditamt    |
| 3000/A01   150   |  3000/A01      150                    |
|                  |  5000/000                    150      |
| 3000/B01    20   |  3000/B01       20                    |
| 3000/A01    15   |  3000/A01       15                    |
|                  |  5000/000                     15      |
| 3000/B01   200   |  3000/B01      200                    |
|                  |  5000/000                    200      |
Records in GLPOST9 to be generated by your program
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FPERIOD  DATE   ACCNO    REF   DESP       DEBITAMT  CREDITAMT  ARAPTYPE  AGE
1   02/01/94 3000/A01 B112  OPERATION    150.00      0.00       I      0
1   02/01/94 5000/000 B112  OPERATION      0.00    150.00       I      0
1   03/01/94 3000/B01 B113  MEDICINE      20.00      0.00       I      0
1   03/01/94 5000/000 B113  MEDICINE       0.00     20.00       I      0
1   04/01/94 3000/A01 B114  MEDICINE      15.00      0.00       I      0
1   04/01/94 5000/000 B114  MEDICINE       0.00     15.00       I      0
1   05/01/94 3000/B01 B115  OPERATION    200.00      0.00       I      0
1   05/01/94 5000/000 B115  OPERATION      0.00    200.00       I      0
Using Debtor & Creditor Files
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
(Please list out the file structure of both files)
File Name      Index Key       Index Tag         Index File
^^^^^^^^^      ^^^^^^^^^       ^^^^^^^^^         ^^^^^^^^^^
ARCUST         CUSTNO          CUSTNOI           ARCUST
NAME            NAMEI
APVEND         CUSTNO          CUSTNOI           APVEND
Program Codes
^^^^^^^^^^^^^
USE ARCUST
INDEX ON CUSTNO TAG CUSTNOI
INDEX ON NAME TAG NAMEI
USE APVEND