XML eGateway Import: Exporting Data for External Systems
Export is only available in Pro Version.
This page covers the tables which can be exported and the system settings which control the export process.
Export, for FTP, of Exchequer Enterprise data several times a day. This will allow external systems to lookup
Customer, Stock and Transaction Info.
- Customer/Supplier Account Info
- Accounts Price Matrix
- Stock Records, with stock levels at locations
- Stock Qty Breaks
- Outstanding Orders
- Trans in the last x months
- Outstanding Invoices
- Cost Centre/Department codes
- Stock Multi Locations codes
- General Ledger codes
- VAT codes
- Currency codes
- Jobs
- Job Analysis
- Job Time Rates
- Job Employees
- Job Types
This data can be exported in CSV format.
The exported data functionality allows an external system to display list of Exchequer data when entering a transaction. Or display outstanding Order or Invoice on a Web site.
System Settings
The Pro version of XML eGateway, in CSV format. This can then be uploaded into external/e-commerce system.
The settings for the Pro version are held in XML eGatewaySettingsPro.xml, and also available from "View >> Settings" menu.
Element Name |
Notes |
Export general settings |
|
export_directory |
Export data to directory. This can be expressed as: D:\OUT \\Server1\OUT OUT (Relative to program directory) |
export_companies |
Only set this if exporting multiples, other than the default company specified in normal settings each file created will have an Exchequer Company Code in it (OLECode) |
after_export_run |
Run program after export of ftp files to server, or move them |
export_type |
Can export as CSV, XML or JSON. CSV is most efficient |
export_readable |
Yes/No, If off no spaces or returns in XML/JSON so hard to read |
after_export_run |
Run program after export to ftp files to server, or move them |
bymail_send_errors |
Using this IMAPI mail account send any failed transactions to e-mail address |
Export times | |
export_hours_1 |
Export data at hour (24 hour clock) Two export lists can be created, so Outstanding transactions can be exported more often than GL list,etc |
export_hours_2 |
Second list of times |
export_hours_3 |
Third list of times |
Accounts | |
export_accounts |
1=export at times specified in export_hours_1,2=export_hours_2,3=export_hours_3 |
customer |
export Yes/No |
supplier |
export Yes/No |
price_matrix |
export accounts discount matrix Yes/No. more info about Exchequer Pricing |
acc_apply_filter_to_field |
Filter Enterprise account record. Fields are:ACUser1,ACUser2,ACUser3,ACUser4,ACRepCode,AcAreaCode,AcCC,AcDep Note: This filter is applied through to the export of outstanding invoices and orders, so only transactions which related to accounts to be exported, are exported |
acc_apply_filter_value |
Value to filter on. "ISBLANK" will only export those with blank values in specified field |
Stock | |
stock |
1=export at times specified in export_hours_1,2=export_hours_2,3=export_hours_3 with locations as specified in stock_locations More info |
stock_qty_breaks |
export Yes/No more info about Exchequer Pricing |
stock_locations |
Get Stock levels from location, if turned on: |
stock_apply_filter_to_field |
Filter Enterprise stock record. Fields are:STUser1,STUser2,STUser3,STUser4,STCode |
stock_apply_filter_value |
Value to filter on. "ISBLANK" will only export those with blank values in specified field |
Transactions |
|
outstanding_order |
1=export at times specified in export_hours_1,2=export_hours_2,3=export_hours_3 Orders in system waiting to be processed More Info |
outstanding_lines_only |
if Yes then only include lines relating to outstanding orders which are outstanding (waiting for delivery). Otherwise send all |
outstanding_invoice |
1=export at times specified in export_hours_1,2=export_hours_2,3=export_hours_3 Invoices waiting to be paid More Info |
include_lines |
export lines Yes/No |
previous_trans |
1=export at times specified in export_hours_1,2=export_hours_2,3=export_hours_3 Previous orders More Info |
trans_types |
Send transaction types. e.g: "SIN,SRI" for invoices "SIN,SRI,SCR,SRF,SJI,SJC" invoices and credit notes |
include_lines |
export lines Yes/No |
last_x_days |
Previous orders, go back x days |
Sundry Data | |
cost_centre |
1=export at times specified in export_hours_1,2=export_hours_2,3=export_hours_3 Cost Centres. Not all Exchequer have this analysis turned on. If not turned on, then not exported |
department |
1=export at times specified in export_hours_1,2=export_hours_2,3=export_hours_3 Departments. Not all Exchequer have this analysis turned on. If not turned on, then not exported |
location |
Locations. Not all Exchequer have locations turned on. If not turned on, then not exported |
gl |
1=export at times specified in export_hours_1,2=export_hours_2,3=export_hours_3 General/Nominal Ledger codes |
currency |
1=export at times specified in export_hours_1,2=export_hours_2,3=export_hours_3 89 different currencies, but usually only a handful are used |
vat_code |
1=export at times specified in export_hours_1,2=export_hours_2,3=export_hours_3 21 different VAT codes, but usually only a handful are used |
Job Costing | |
job |
1=export at times specified in export_hours_1,2=export_hours_2,3=export_hours_3 Job costing jobs, if enabled within system |
job_analysis |
1=export at times specified in export_hours_1,2=export_hours_2,3=export_hours_3 |
job_time_rates |
1=export at times specified in export_hours_1,2=export_hours_2,3=export_hours_3 Used for Timesheet entry |
job_employees |
1=export at times specified in export_hours_1,2=export_hours_2,3=export_hours_3 Employees for Timesheet entry |
job_types |
1=export at times specified in export_hours_1,2=export_hours_2,3=export_hours_3 Jobs can be sub categories by type |
Controlling which fields are exported
The fields to export can be turned ON/OFF by ticking and unticking the "Export", in table record of file in XMLSettings.mdb.
Backup the file before making any changes
Using MS Access, open XMLSettings.mdb, then select "Tables" and open "Table":
This lists all the tables which are exported:
Click on the "+" button, to list the fields within the table
The "Export" field controls the data exported. Two more fields "ExportOutstandingInvoices" and "ExportOutstandingOrders" control the fields exported for outstanding invoices/orders
Other fields should not be edited, as it may break the system
Calculating Exchequer Pricing
To Calculate price from Exchequer discount matrix we do the following
Example: E-commerce system:
Activity on site
User logs into accounts, and thus selects account
we get acDiscountBand (A-H) code. Get default currency "acCurrency for account (usually 1)
if acDiscountBand ="" then acDiscountBand="A"
Get acDiscount. This can contain a % discount on everything unless???
User selects stock item
we get stock record, which gives us the price for item in stPriceBandC_Price
If Stock Qty Breaks are used in Exchequer, then we would:
Get stParent1-6 from the stock record. These represent the parent codes of stock item in Exchequer stock tree.
Usually the tree is not deeper than 4 levels
Look for Qty Discount against the stock record:
Search "stockqtybreaks" table for Stock code in qbCode and for Qty between qbQuantityFrom and qbQuantityTo †
If not found:
if stParent6<>"" then
Search "stockqtybreaks" table for stParent6 in qbCode and for Qty between qbQuantityFrom and qbQuantityTo †
If not found:
if stParent5<>"" then
Search "stockqtybreaks" table for stParent5 in qbCode and for Qty between qbQuantityFrom and qbQuantityTo †
If not found:
if stParent4<>"" then
Search "stockqtybreaks" table for stParent5 in qbCode and for Qty between qbQuantityFrom and qbQuantityTo †
And so on, working your way through the possible discounts at various levels of stock tree
If a record is found then it could have:
- Band price less discount %, held in qbDiscPercent
- Special Price, held in qbPrice
- Markup %, held in qbMarkupMarginPercent
- Margin %, held in qbMarkupMarginPercent
† Exchequer has the ability to select effective dates for a price band, this should be checked also.
If Account Price Discounts are used in Exchequer, then we would:
Search in "customerprice" table for account + Stock code + band in adCode + adStockCode + adPriceBand + adCurrency
If not found:
If stParent6 <>”” then Search in "customerprice" table for adCode + adStockCode(=stParent6) + adPriceBand + adCurrency
If not found:
If stParent5 <>”” then Search in "customerprice" table for adCode + adStockCode(=stParent5) + adPriceBand + adCurrency
If not found:
If stParent4 <>”” then Search in "customerprice" table for adCode + adStockCode(=stParent4) + adPriceBand + adCurrency
And so on, working your way through the possible discounts at various levels of stock tree
If a record is found then it could have:
- Band price less discount %, held in adDiscPercent
- Special Price, held in adPrice
- Markup %, held in adMarkupMarginPercent
- Margin %, held in adMarkupMarginPercent
Note : Account Qty breaks are not supported at present as very few Exchequer customers use it
Exchequer Customer/Supplier Account Info
Table name:Customer and Supplier
Exchequer Customer and Supplier information export is turned on in Pro Settings. Select “Pro >> Settings” menu option to open the Pro Settings. see Settings Table
Account fields exported
The Customer/Supplier fields which can be exported are covered by the Import Account page. This lists the fields which can be imported, which with few exceptions can be exported, plus a list of special export fields at bottom of page.
Exchequer Accounts Price Matrix
Table name:Customerprice
This table represents the qty price breaks, in Exchequer Enterpise, which relate to account records. more info about Exchequer Pricing
FieldName | DataType | Length | Notes |
String |
String |
|
Account ID |
adCurrency |
Integer |
|
Currency to apply discount to |
adDateEffectiveFrom |
Date |
|
Effective date:from 01/01/1900 if none |
adDateEffectiveTo |
Date |
|
Effective date:to 01/01/1900 if none |
adDiscPercent |
Double |
|
Discount off Band price |
adDiscValue |
Double |
|
Specific discount value off each item in price band |
adMarkupMarginPercent |
Double |
|
Markup Margin Percent applied to Band price |
adPrice |
Double |
|
Specific price to apply to price band and currency |
adPriceBand |
String |
1 |
Price Band. Single letter A-H |
adStockCode |
String |
16 |
Stock code OR Stock Parent code of item to apply discount. Stock in Exchequer is organised in a tree structure, and stock discounts can be applied to any level of the stock tree, and thus applied to all siblings under that group in the tree. |
adType |
Integer |
|
0=Special Price,1=Discount off Band Price,2=Discount off Margin,3=Discount Mark up,4=Qty Breaks,5=Discount value based |
adUseEffectiveDates |
Boolean |
|
True if effective dates should be used |
Exchequer Stock Records, with stock levels at locations
Table name:Stock
Stock is an optional module in Exchequer Enterprise.
Exchequer Stock information export is turned on in Pro Settings. Select “Pro >> Settings” menu option to open the Pro Settings. see Settings Table
Stock fields exported
The fields which can be exported are covered by the Import Stock page. This lists the fields which can be imported, which with few exceptions can be exported, plus a list of special export fields at bottom of page.
Stock notes
Exchequer Enterprise stock record has 8 price bands, label A-H (stPriceBandA_Price-stPriceBandH_Price). These are usually in currency 1, but can be in different currencies (stPriceBandA_Currency-stPriceBandH_Currency).
Multiple locations can be enabled within Exchequer Enterprise. By default XML eGateway will export overall stock level, free to sell, and qty on order. If the installation has one or more main locations, and several sundry locations, then enter the locations to export a figure for in <stock_locations> list of settings.
Exchequer Stock Qty Breaks
Table name:Stockqtybreaks
This table represents the qty price breaks, in Exchequer Enterprise, which relate to stock items. more info about Exchequer Pricing
FieldName | DataType | Length | Notes |
qbAccount |
String |
6 |
Account Qty breaks are not supported at present |
qbCode |
String |
16 |
Stock ID |
qbCurrency |
Integer |
Currency to apply discount to |
|
qbDateEffectiveFrom |
Date |
|
Effective date:from 01/01/1900 if none |
qbDateEffectiveTo |
Date |
|
Effective date:to 01/01/1900 if none |
qbDiscPercent |
Double |
|
Discount off Band price |
qbDiscValue |
Double |
|
Specific discount value off each item in price band |
qbMarkupMarginPercent |
Double |
|
Markup Margin Percent applied to Band price |
qbPrice |
Double |
|
Specific price to apply to price band and currency |
qbPriceBand |
String |
1 |
Price Band. Single letter A-H |
qbQuantityFrom |
Double |
|
Qty from |
qbQuantityTo |
Double |
|
Qty to |
qbType |
Integer |
|
0=Special Price,1=Discount off Band Price,2=Discount off Margin,3=Discount Mark up,4=Qty Breaks,5=Discount value based |
qbUseEffectiveDates |
Boolean |
|
True if effective dates should be used |
Exchequer Outstanding Orders
Table name:Outstanding_orders and Outstanding_order_lines. The two tables are related by thOurRef (in Outstanding_orders), and tlOurRef (in Outstanding_order_lines). The Outstanding_order_lines table should then be sorted by tlLineNumber to give correct order.
Sales Order Processing is an optional module in Exchequer Enterprise.
Exchequer Outstanding Orders information export is turned on in Pro Settings. Select “Pro >> Settings” menu option to open the Pro Settings. see Settings Table
Outstanding Order Transaction fields exported
The fields to export can be turned ON/OFF by ticking and unticking the "ExportOutstandingOrders", in table record of file in XMLSettings.mdb
The fields which can be exported are covered by the Import Transaction page. This lists the fields which can be imported, which with few exceptions can be exported, plus a list of special export fields at bottom of page.
Additional settings
outstanding_lines_only |
if Yes then only include lines relating to outstanding order which are outstanding (waiting for delivery). Otherwise send all |
Exchequer Transactions in the last x months
Table name:Trans_since_x and Trans_since_x_lines. The two tables are related by thOurRef (in Trans_since_x), and tlOurRef (in Trans_since_x_lines). The Trans_since_x_lines table should then be sorted by tlLineNumber to give correct order.
Exchequer Transaction information export is turned on in Pro Settings. Select “Pro >> Settings” menu option to open the Pro Settings. see Settings Table
Transaction fields exported
The fields to export can be turned ON/OFF by ticking and unticking the "Export", in table record of file in XMLSettings.mdb
The fields which can be exported are covered by the Import Transaction page. This lists the fields which can be imported, which with few exceptions can be exported, plus a list of special export fields at bottom of page.
Additional settings
trans_types |
Send transaction types. e.g: "SIN,SRI" for invoices "SIN,SRI,SCR,SRF,SJI,SJC" invoices and credit notes |
include_lines |
export lines Yes/No |
last_x_days |
Previous orders, go back x days |
Exchequer Outstanding Invoices
Table name:Outstanding_invoice and Outstanding_invoice_lines. The two tables are related by thOurRef (in Outstanding_invoice), and tlOurRef (in Outstanding_invoice_lines). The Outstanding_invoice_lines table should then be sorted by tlLineNumber to give correct order.
Exchequer Outstanding Invoice information export is turned on in Pro Settings. Select “Pro >> Settings” menu option to open the Pro Settings. see Settings Table
Outstanding Invoice Transaction fields exported
The fields to export can be turned ON/OFF by ticking and unticking the "ExportOutstandingInvoices", in table record of file in XMLSettings.mdb
The fields which can be exported are covered by the Import Transaction page. This lists the fields which can be imported, which with few exceptions can be exported, plus a list of special export fields at bottom of page.
Additional settings
include_lines |
export lines Yes/No |
Exchequer Cost Centre/Department codes
Table name:CostCentre and Departments
Cost Centre/Departments are used as an extra analysis in Exchequer. If turned On, within Exchequer, then they are on each transaction line. The XML eGateway will set the default value within a transaction when imported. The default value depends on how the Exchequer system is setup.
This information is exported to allow the developer to display the list of Centre/Departments codes within their own app.
Cost Centre
FieldName | DataType | Length | Notes |
ccCode |
String |
3 |
ID |
ccName |
String |
30 |
Description |
Department
FieldName | DataType | Length | Notes |
cdCode |
String |
3 |
ID |
cdName |
String |
30 |
Description |
Exchequer Stock Multi Location codes
Table name:Locations
Stock is an optional module in Exchequer Enterprise.
FieldName | DataType | Length | Notes |
loCode |
String |
3 |
ID |
loContact |
String |
30 |
|
loCostCentre |
String |
3 |
|
loCounty |
String |
30 |
|
loDepartment |
String |
3 |
|
loEmailAddr |
String |
100 |
|
loFax |
String |
25 |
|
loModem |
String |
25 |
|
loName |
String |
45 |
Name of Location |
loOverrideCCDept |
Boolean |
|
|
loPhone |
String |
25 |
|
loPostcode |
String |
30 |
|
loStreet1 |
String |
30 |
|
loStreet2 |
String |
30 |
|
loTown |
String |
30 |
|
The location record allows the address of the location to be entered. But usually just the ID and name is of importance.
Exchequer General Ledger codes
Table name:GL
The general Ledger in Exchequer drives the financial analysis. Defaults for a stock item, or Job Analysis code, are usually set within Exchequer. Thus the GL Code is set automatically.
If stock and job costing is not used then the GL code would need specifying on a transaction before importing.
This information is exported to allow the developer to display the list of GL codes within their own app.
FieldName | DataType | Length | Notes |
glAltCode |
String |
50 |
Alt ID. This is an alternative code for searching on |
glCode |
Integer |
ID |
|
glCurrency |
Integer |
|
Only used if GL is restricted to 1 currency |
glName |
String |
30 |
Name of GL |
glParent |
Integer |
|
ID in of parent in tree |
glType |
String |
8 |
Head,P&L,Balance |
Exchequer VAT codes
Table name:VAT_codes
Exchequer allows 20 VAT codes.
This information is exported to allow the developer to display the list of currency codes within their own app.
FieldName | DataType | Length | Notes |
svCode |
String |
1 |
ID |
svDesc |
String |
10 |
|
svRate |
Double |
|
|
Exchequer Currency codes
Table name:Currency
Exchequer allows 89 currencies.
This information is exported to allow the developer to display the list of currency codes within their own app.
FieldName | DataType | Length | Notes |
scDesc |
String |
11 |
|
scNumber |
Integer |
|
ID of Currency |
Exchequer Jobs
Table name:Job
Job Costing is an optional module in Exchequer Enterprise.
Exchequer Job information export is turned on in Pro Settings. Select “Pro >> Settings” menu option to open the Pro Settings. see Settings Table
The fields which can be exported are covered by the Import Job page. This lists the fields which can be imported, which with few exceptions can be exported, plus a list of special export fields at bottom of page.
Exchequer Job Analysis
Table name:Jobanalysis
Job Analysis codes drive the Job costing analysis. They set the GL codes when importing.
This information is exported to allow the developer to display the list of Job Type codes within their own app.
FieldName | DataType | Length | Notes |
anCategory |
String |
20 |
Retension Type |
anCode |
String |
10 |
Record ID |
anDescription |
String |
20 |
|
anLineType |
String |
15 |
Sets line type on transaction |
anType |
String |
9 |
Labour, Materials, Overheads, Revenue |
Exchequer Job Time Rates
Table name:Jobrates
This table is used when populating timesheets within Job Costing
FieldName | DataType | Length | Notes |
trAnalysisCode |
String |
10 |
ID of analysis to apply to. Can be empty |
trChargeCurrency |
Integer |
|
Currency of trTimeCharge |
trCostCurrency |
Integer |
|
Currency of trTimeCost |
trDescription |
String |
30 |
|
trEmployeeCode |
String |
10 |
ID of employee to apply to. Can be empty |
trPayFactor |
Integer |
|
|
trPayRate |
Integer |
|
|
trPayrollCode |
Integer |
|
|
trRateCode |
String |
10 |
ID |
trTimeCharge |
Double |
|
Charge out rate per hour |
trTimeCost |
Double |
|
Cost per hour |
Exchequer Job Employees
Table name:Jobemployee
This table is used when populating timesheets within Job Costing
FieldName | DataType | Length | Notes |
emCode |
String |
10 |
Record ID |
emContractorType |
String |
15 |
|
emCostCentre |
String |
3 |
|
emDepartment |
String |
3 |
|
emEmailAddress |
String |
100 |
|
emFax |
String |
20 |
|
emMobile |
String |
20 |
|
emName |
String |
30 |
|
emNISerialNo |
String |
20 |
|
emPayrollNumber |
String |
10 |
|
emPhone |
String |
20 |
|
emSupplier |
String |
6 |
Points to supplier rec |
emType |
String |
15 |
|
emUserField1 |
String |
20 |
|
emUserField2 |
String |
20 |
|
emUserField3 |
String |
20 |
|
emUserField4 |
String |
20 |
|
Exchequer Job Types
Table name:Jobtype
This information is exported to allow the developer to display the list of Job Type codes within their own app.
FieldName | DataType | Length | Notes |
jtCode |
String |
3 |
Record ID |
jtName |
String |
30 |
|