Documentation/Data formats

For administrators

Value lists

Price categories, payment and delivery types, trade points, and relationships between vl_* lists.

Value lists define price categories, payment types, delivery types and trade points. The accounting system prepares a separate XML table for each list and places it in outbox.

Common fields

FieldTypePurpose
valueTEXTThe code used by reference lists and documents.
presentationTEXTThe name shown to the user.

Both fields must be present in every list's schema. Each value must be unique within the list and remain stable when data is updated. You can change presentation without changing the code.

Standard lists

TablePurposeWhere value is used
vl_cat_pricesPrice categories.In the price_… suffixes in the product reference and the cat_price field of a customer or document.
vl_pay_typesPayment types.In the order's pay_type field.
vl_delivery_typesDelivery types.In the order's delivery_type field.
vl_trade_pointsCustomers' trade points.In a document's trade_point field and a route's trade_point_value field.

The filename matches the table name: for example, vl_pay_types.xml contains <table name="vl_pay_types">.

Payment types example

<?xml version="1.0" encoding="utf-8"?>
<table name="vl_pay_types">
  <schema>
    <field name="value" type="TEXT"/>
    <field name="presentation" type="TEXT"/>
  </schema>
  <data>
    <record>
      <f>cash</f>
      <f>Cash</f>
    </record>
    <record>
      <f>bank</f>
      <f>Bank transfer</f>
    </record>
  </data>
</table>

If the user selects Cash, the order's pay_type contains cash, rather than the text from presentation.

Price categories

For a category with value="Retail", ref_products must contain a price_Retail field. The category's presentation can be a readable name, such as Retail price.

Set ref_customers.cat_price to Retail. If a customer can use several categories, separate their codes with commas and no spaces: Retail,Wholesale. Each code must have a corresponding price field in the product reference. Use the same category codes in the price list, customer reference and product price field names.

The product and customer structures are described in References and routes.

Trade points

vl_trade_points has an additional required customer_code field of type TEXT. It links the trade point to ref_customers.code.

<?xml version="1.0" encoding="utf-8"?>
<table name="vl_trade_points">
  <schema>
    <field name="value" type="TEXT"/>
    <field name="presentation" type="TEXT"/>
    <field name="customer_code" type="TEXT KEY"/>
  </schema>
  <data>
    <record>
      <f>TP-001</f>
      <f>Central Street store</f>
      <f>C-001</f>
    </record>
    <record>
      <f>TP-002</f>
      <f>Kyivska Street store</f>
      <f>C-001</f>
    </record>
  </data>
</table>

Both trade points in this example belong to customer C-001. The selected trade point is sent in the document as TP-001 or TP-002.

Transfer to a device

Add the required tables to <get><dbs> in the profile in exchange.xml:

<dbs>
  <db name="vl_cat_prices"/>
  <db name="vl_pay_types"/>
  <db name="vl_delivery_types"/>
  <db name="vl_trade_points"/>
</dbs>

These lists are already included in the Завантажити дані (Download data) profile in the standard exchange.xml. After the exchange, check that the required options are available in documents and that trade points match the selected customer.