E-Gate Services Technical Overview ![]()
Scheduler & e-Gate Services Component Only
Imported transaction data is stored in a simple "flat file" that is either of ASCII or DBF format. The file may be formatted as ASCII SDF, dBase III or ASCII delimited. The delimit character may be user defined. ASCII tab delimited or dBase III is recommended.
General Operation
Within CAPITAL an upload directory location is specified. The external application places its files in this directory. It is recommended that these files conform to the 8.3 file format and must have the extension .ETR. (Short for Electronic TRansaction.)
CAPITAL will scan the upload directory for new transaction files and import the information from these files into the e-Gate database.
The uploaded data may then be either deleted automatically or copied into a transfer directory where it may be archived by the system administrator.
During the import process, CAPITAL will flag all ETR transactions that contain invalid or unknown information. A report may be executed at a later time to list these transactions or invalid transactions may be viewed on-screen. This task should be performed periodically to ensure that acceptable data is being supplied by the client application generating the .ETR files.
If an electronic transaction contains an invalid record, a CAPITAL transaction is not generated until confirmation to proceed is received by an operator. This may require the operator to correct the transaction or supply any missing information, before the transaction can be processed. This task can be performed from within the CAPITAL application.
File Structure
The data file conforms to the standard structure of an ASCII or DBF file, which is that of a flat file divided into a series of records. Each record may have up to 3 sections:
Transaction
Payment
Product Sale Item
The section is optional if it is not required.
If a sales order consists of 5 items then a minimum of 5 records must be included in the .ETR file. The transaction and payment sections may be repeated or defined once and then left blank for subsequent records relating to the transaction.
Sections are defined by mapping fields from different areas of the data file to the database input fields within CAPITAL. Mapping options are discussed next.
File Specification
The exact arrangement of information held in an electronic transaction is not critical. CAPITAL's external file import utility will create an import profile that will allow data to be mapped to the appropriate fields from within CAPITAL.
The following information may be imported. Fields marked with a * (asterisk) are mandatory:
|
Transaction Field Reference |
Purpose |
|
|
*ORDERNO |
The transaction (sales order) number. Must be unique per new transaction. Transactions with numbers that already exist will be rejected. The number may have an alpha portion but this must appear to the front of the number. The numbers 20313, 652154, A62763, and HG37873 are valid transaction numbers but 1000c or 155B3 are NOT valid numbers.
|
9 |
|
*ACCOUNT |
Account Code. Letters or numbers permitted. Codes should be supplied in upper case. If they are not supplied in upper case they will be forced to upper case automatically. |
8 |
|
*DATE |
Date of transaction. Ideally, the preferred format is DD/MM/YY or DD/MM/YYYY. |
8 |
|
*AMOUNT |
Transaction total. Indicate the decimal portion using a decimal point. E.g, "100.55" For information on correctly formatting the transaction amount see the section: Calculating Transaction Amount. |
15 |
|
OFDATE |
Date item being ordered is to be shipped on. (The order forward date.) Ideally, the preferred format is DD/MM/YY |
8 |
|
NAME |
Name of company/individual. |
44 |
|
ADDRESS |
Address line #1 |
44 |
|
ADDRESS2 |
Address line #2 |
44 |
|
SUBURB |
The suburb. |
33 |
|
STATE |
The Australian state code. For international addresses include the state as part of the address lines. |
3 |
|
POSTCODE |
The Australian postcode. For international addresses include the zip or postcode as part of the address lines. |
4 |
|
DNAME |
Delivery name of company/individual. |
44 |
|
DADDRESS |
Delivery address line #1. |
44 |
|
DADDRESS2 |
Delivery address line #2. |
44 |
|
DSUBURB |
Delivery suburb. |
33 |
|
DSTATE |
The Australian delivery state. For international addresses include the state as part of the delivery address lines. |
3 |
|
DPOSTCODE |
Australian Delivery postcode. For international addresses include the zip or postcode as part of the delivery address lines. |
4 |
|
STATUS |
Number code indicating the transaction type. 1 = new sales order 5 = suspended Other codes are not supported at this time. If the Status field is not specified the status defaults to 1. |
1 |
|
OREFERENCE |
Customer reference/order number. |
23 |
|
OOURREF |
Our Reference (internal reference). |
44 |
|
SHIPPED |
Shipping reference, such as the carrier name or code or the method of dispatch. |
15 |
|
OTAXNO |
Tax (or GST) exemption status. |
15 |
|
TIME |
The time the order was generated, in the format: HH:MM:SS |
8 |
|
FREIGHT |
A freight charge. |
15 |
|
CHARGE1 |
User defined charge #1 |
15 |
|
CHARGE2 |
User defined charge #2 |
15 |
|
CHARGE3 |
User defined charge #3 |
15 |
|
CONTACT |
Contact name of person placing order. |
15 |
|
PHONE |
Phone number. |
19 |
|
FAX |
Fax number |
14 |
|
MOBILE |
Mobile Mobile phone number. |
14 |
|
|
E-mail address. |
44 |
|
OORDERBY |
Salesperson identification code. |
9 |
|
USERNAME |
Username/operator who processed transaction. |
20 |
|
DEPARTMENT |
Department/division that generated the transaction. If multi-location Stock Control is operating this is also the location code. |
8 |
|
Payment Field Reference |
Purpose |
|
|
CARDNO |
Credit card number. |
23 |
|
CNAME |
Card holder name. |
30 |
|
CEXPIRY |
Card expiry date in MM/YY format. Other formats are acceptable so long as the format is documented. |
5 |
|
CTYPE |
Credit Type. This is a number between 1-9 and represents an agreed code between CAPITAL and the external system. E.g., Visacard may be "3" |
1 |
|
RECEIPTNO |
Payment Receipt Number. Online payment receipt number. |
20 |
|
PAYMENT |
Payment amount. If the transaction is paid for in full, this will be the same as the Amount field. This field is not optional if payment information is supplied. If the Payment amount is not zero, then the following fields must be filled in: *CTYPE *RECEIPTNO and/or CARDNO and CNAME.
|
15 |
|
Product Sale Item Field Reference |
Purpose |
|
|
*PCODE |
Product code. Should be supplied in uppercase. If not uppercase will be forced. This field may be left blank for comment lines. |
25 |
|
TITLE |
Product description. If not specified the default product description is assumed. If the product code is left blank this line is treated as a comment line. |
40 |
|
*QTY |
Quantity ordered. The number of decimal places specified must conform to the decimal places specified in the company configuration. For example, if the company configuration supports 1 decimal point then the Qty value may have up to 1 decimal precision. Do not send quantities with a greater level of precision than supported by the company configuration. The total size of the number may not exceed 7 digits including the decimal point. The decimal point may "float" within any of the 7 digits. |
7 |
|
TAX |
Tax rate or category This is a number between 0-9999. 0 defaults to tax exempt. If not specified, the default tax rate for the product item is used. |
4 |
|
TAXCHARGE |
The tax amount charged. If not specified the default tax amount depending on the tax rate is calculated. |
15 |
|
OALLOCATE |
Order allocation quantity. This is the quantity to reserve immediately. It cannot exceed the value of the Qty field and the same remarks relating to decimal precision apply to this field. |
7 |
|
SOLDFOR |
Unit sell price. The maximum number of decimal points that may be supplied is 4. The normal default is 2. |
15 |
|
COST |
Unit cost price. The maximum number of decimal points that may be supplied is 4. The normal default is 2. |
15 |
|
REQUIRED |
Date item is required by. Ideally, the preferred format is DD/MM/YY |
8 |
|
ODISC |
The discount code. This is a number between 1-9 or a price group code. |
7 |
|
LINEREF |
The line number of the order. First ordered item = 1, second ordered item = 2, etc. |
4 |
Manadtory OEEGate Card File Fields
These fields are also required to exist in your import card file and should not be removed:
|
Field |
|
Tranfer |
|
Hold |
|
Account |
|
Orderno |
|
Date |
|
Amount |
|
Qty |
|
Comment1 |
Calculating Transaction Amount
The transaction amount field is calculated as follows:
Amount = ( Soldfor * Qty for each item ) + Freight Charges (Freight, Charge1, Charge2, Charge3)
Consider the following example. This is for sales order 1000 which is made up of 2 records. Each record represents one sale item relating to the total sales order.
|
Field |
Value |
|
OrderNo |
1000 |
|
Soldfor |
20.00 |
|
Qty |
2 |
|
Freight |
10.00 |
|
Charge1 |
0.00 |
|
Charge2 |
0.00 |
|
Charge3 |
0.00 |
|
Amount |
83.25 |
|
OrderNo |
1000 |
|
Soldfor |
6.65 |
|
Qty |
5 |
|
Freight |
10.00 |
|
Charge1 |
0.00 |
|
Charge2 |
0.00 |
|
Charge3 |
0.00 |
|
Amount |
83.25 |
Note
that the FREIGHT field (and this also applies to the charge fields),
and the AMOUNT field, are duplicated in each record. The $83.25
amount is calculated as follows:
From record #1, 20 x 2 = $40 + 10 freight = $50.00
From record #2, 6.65 x 5 = $33.25
Total from record #1 + total from record #2 = $83.25
Observe that the freight (and charge) amounts are only taken up into the transaction total once, even though they are included in each record.
Calculating Transaction Tax
If the sale item SOLDFOR amounts are inclusive of tax, tax calculations do not need to be included in the transaction file. CAPITAL will automatically calculate the tax inclusive component, based on the tax rates of the stock items in the CAPITAL inventory file. However, if some sales are tax exempt (or "tax free") then SOLDFOR amounts should also be stored in the file as ex tax amounts.
If a transaction is tax exempt/tax free, then a word or number must be placed in the OTAXNO field to indicate this. For example, placing the text message "Tax Free" in this field would be sufficient. This would prevent CAPITAL from assuming that the transaction is tax inclusive.
If the sale item SOLDFOR values are exclusive of tax, but the transaction itself is NOT tax exempt/tax free, then the AMOUNT field must include the tax component. The tax component should be placed in the TAXCHARGE field for each sale item. For example:
|
Soldfor |
= $100 ex tax |
|
Qty |
= 2 |
|
Taxcharge |
= $20.00 (total tax component) |
In order to calculate Amount, the formula becomes:
(Soldfor * Qty) + Taxcharge = add to Amount
or in this case:
$100 * 2 = $200 + $20 = $220.00
An
Important Note on Rounding:
All TAXCHARGE values must be rounded to 2 decimal points, otherwise rounding discrepancies will arise. (Rounding tax by line item ensures that users receive consistent reporting results whether they analyse sales by product groups or transaction ranges.)
Other Notes
Fields that are left blank are assigned default values. For example, if the delivery address is not assigned, CAPITAL uses the default delivery address of the account. If you wish to force a field-which may have a default value--blank, write the characters #*# into the field.
One record should be created for each sale item ordered. Certain values need only be specified once. For example, the shipping method or order number only needs to be included on the first record sent. It is also acceptable to include this information on any record sent. Whatever is received last is the value that is used provided that it is not blank.
Transaction numbers must normally be unique. If, for example, a sales order already exists in the system and clashes with an electronic transaction number, the electronic transaction will be rejected and marked for review. This behaviour can be changed, however, to permit an existing transaction to be overwritten by a newly imported transaction, subject to the setting preferences for e-Gate. However, this may only occur while the transaction has not yet been processed. If the sales order stored in CAPITAL has its status changed to 'delivered' or 'partial' delivery, e-Gate will not permit an imported sales order to replace the fully or partly processed sales order. An error alert will be raised for the transaction instead.
User defined fields may be added to the e-Gate database so comment fields, special instruction fields, additional contact information, etc., may easily be added.
Update Procedures
Users may import transaction data either by selecting "import" from the e-Gate user interface or transactions may be updated periodically via a scheduler that periodically executes a batch file that performs the transfer and imports tasks in batch mode.
This process is handled by command line switch settings when starting the CAPITAL INSTALLATION Workshop program. It is also possible to import customer records, supplier records and stock items in batch mode using the INSTWIN/IMPORT= filename settings of CAPITAL.
The /IMPORT= switch points to a CAPITAL DIM file (Data IMport script) that describes where to find the data to import, the type of data to import, how to import it, and which fields to update and/or which CAPITAL Business Script sub-programs to execute. Data that already exists in the system is updated/merged. If the data does not exist it is appended to the database as new records or accounts.
The purpose of the DIM file is to map how data is to be translated from the external system into CAPITAL. This allows for the file structure of either the external application or CAPITAL to change without bothering the other linked application. Only the format of the DIM file needs to be adjusted. This can be performed through a visual interface by an operator who does not need to have programming skills.
Transfer Process
Imported data is first deposited in a card file, and then this card file data is transferred to a transaction. Before data is transferred to a transaction, a script hook is called, if in use, to allow for further formatting and manipulation of the data.
Hook files must reside in the CAPITAL application or root data directory.
|
Script Hooks | |
|
Transaction |
Hook File Name |
|
Sales Orders |
R-OEGATE.MAC |
____________________________
Related Topics:
Trouble-Shooting The Import Process
![]() |