GM-X ERP for Blockchain - The ORDER subsystem

By Tony Marston

13th August 2007
Amended 12th April 2023

Introduction
1. Orders, Items and Item Features
2. Order Roles and Item Roles
3. Order Contact Mechanisms
4. Order Status and Item Status
5. Order Terms and Item Terms
6. Quantity Breaks and Value Breaks
7. Order Adjustments and Item Adjustments
8. Order Payments
9. Reserved Items
10. Non-Conformance Reports
11. Building Purchase Orders from Sales Orders
12. Links to other entities
13. Order Extra Values
14. Order Item Extra Values
15. Saved Shopping Basket
16. Order Control Data
17. Initial Values
Amendment History

Introduction

Orders are the mechanism by which one party requests products from another party, and can be one of the following:

While there are differences between these order types, there are enough similarities for them to share the same model.

There can be a great deal of information associated with each order, such as:


Orders, Items and Item Features

Each order has one or more order items, and each order item identifies a product and a quantity. An order item may have any number of features, and may be related to other order items.

Figure 1 - Orders, Items and Item Features

order-01 (2K)

SALE_TYPE table

This is used to identify when different methods of selling are possible so that reports by sale type can be produced. This can also be used to provide a separate PRICE_COMPONENT for each sale type.

FieldTypeDescription
sale_type_id string Identity.
sale_type_desc string Description.
queue_id_default string Optional. Links to an entry on the EMAIL_QUEUE table. This is used when composing an email for an order of this sale type to help identify which EMAIL_SIGNATURE to use.
is_sales_tax_included boolean Required. Identifies if prices include Sales Tax or not.

Here are some examples:

IdDescriptionQueueSales Tax Included?
CAT Catalogue Sales sales No
RET Retail sales sales Yes
WWW Internet Sales sales Yes

ORDER_HEADER table

This holds information about the order as a whole.

FieldTypeDescription
order_type string One of "Sales", "Purchase" or "Transfer". This allows each order type to have its own numbering sequence.
order_id numeric A number which is generated by the system.
order_status_type_id string The current status of the order. This mirrors the contents of the ORDER_STATUS_HIST table and is required to enable order counts by status.
order_date date Required. The date on which the order was placed.
due_date date Required. The date on which the order is due. This information is used to identify orders which are overdue and require some sort of action. It can be set to any date which is not earlier than order_date, and can be automatically set to a number of days beyond order_date by setting a value for order_due_days in the Order Control Data.

For purchase orders this date will automatically be changed to the latest estimated_deleivery_date from the ORDER_ITEM table if this is greater than the current value.

earliest_ship_date date Optional. The earliest date on which the items can be picked and shipped. This date is usually specified by the customer to prevent shipments being sent out during periods when they may not be available to receive them.
party_id number Links to an entry on the PARTY table. For sales orders this identifies the customer. For purchase orders ths identifies the supplier. For transfer orders this identifies the organisation performing the transfer.
party_id_internal number Links to an entry on the PARTY table. This identifies the party on whom this order is being raised. It will initially be taken from the Functional Unit which was identified in the LOGON screen.
contact_mech_id_primary numeric Optional. Links to a postal address entry on the CONTACT_MECHANISM table. This identifies the primary address of party_id.
contact_mech_id_billing numeric Optional. Links to an entry on the CONTACT_MECHANISM table. This is only required if the billing address for party_id is different from the primary address. It is not restricted to a postal address as it may be a FAX number or an e-mail address.
contact_mech_id_delivery numeric Optional. Links to a postal address entry on the CONTACT_MECHANISM table. This is only required if the delivery address for party_id is different from the primary address.
contact_name_delivery string Optional. By default the delivery name is the same as the party name for party_id, but this field can be used to specify an alternative.
contact_mech_id_confirmation numeric Optional. Links to an entry on the CONTACT_MECHANISM table. This is only used if the customer/supplier wishes to see a copy of the completed sales order before it is approved. It may be a postal address, a FAX number, or an e-mail address.
contact_mech_id_blockchain numeric Optional. Links to an entry on the CONTACT_MECHANISM table. This holds the blockchain address for party_id.
po_number string Optional. The identity of the associated Purchase Order, as supplied by the customer.
sale_type_id string Optional. Links to an entry on the SALE_TYPE table.
item_count numeric Display only. The count of related entries on the ORDER_ITEM table.
order_value numeric Display only. The sum of all values from related entries on the ORDER_ITEM table. This is the value in home/functional currency.
adjusted_value numeric Display only. The order_value plus the sum of all values from any order adjustments such as surcharges, discounts and taxes. This is the value in home/functional currency.
The following fields are used to deal with transactions which are carried out in a currency which is different from that of the functional unit. Please see FAQ24 for details.
currency_code string Links to an entry on the CURRENCY_CODE table. This identifies the transaction currency. This defaults to the operating/home currency of the party identified in party_id, but may be changed by the user.
exchange_rate numeric Optional. Obtained from the Exchange Rate table when the order is created, but only if the transaction currency is different from the functional currency. The exchange rate lookup is FROM the functional currency TO the transaction currency.

Note that this is the inverse of the lookup method used in the INVOICE subsystem which converts from transaction to functional currency. This is because all prices obtained from the PRICE_COMPONENT table are deemed to be in the organisation's home/functional currency, so if the customer chooses a different currency then the prices have to be converted to that currency using the current exchange rate. The alternative would be to have a separate price for each currency, but that would be too impractical.

order_value_tx numeric This is the same as order_value, but expressed in transaction currency.
adjusted_value_tx numeric This is the same as adjusted_value, but expressed in transaction currency.

When a sales order is created the following steps are performed:

  1. When the customer is identified the following lookups are made using the PARTY_CONTACT_MECHANISM and PARTY_CONTACT_MECH_PURPOSE tables:

    Although default contact mechanisms for each of these purposes may have been defined in the database, each one can be overridden to provide alternative values for that particular order.

  2. After the details have been written to the ORDER_HEADER table the following records are also added:

ORDER_ITEM table

This holds information on individual items with an order. Each item specifies a product and a quantity, and may have related records on ORDER_ITEM_FEATURE and ORDER_ITEM_ADJUSTMENT.

FieldTypeDescription
order_type string Links to an entry on the ORDER_HEADER table.
order_id numeric Links to an entry on the ORDER_HEADER table.
order_item_seq_no numeric A sequence number which is generated by the system. This starts at 1 for each order.
order_item_status_type_id string Links to an entry on the ORDER_ITEM_STATUS_TYPE table.

The current value is also held on the ORDER_ITEM_STATUS_HIST table.

price_component_id numeric Optional. Links to an entry on the PRICE_COMPONENT table. This identifies the source of any price. It is read-only.
product_id string Required. Links to an entry on the PRODUCT table.
order_item_desc string Initially set to product_name, but may be altered by the user.
quantity numeric Required. This identifies how many units of product_id are required. Minimum value is 1.
free_units numeric Display only. An adjustment associated with this item may be a discount which is expressed as a number of free units instead of a percentage or a value. This field will identify how many units will be free of charge as a result of such a discount.
unit_price numeric The unit price for this product. This is extracted from the PRICE_COMPONENT table, and may either be the agreed price for this customer, or a special price for this class of customer, or the product's base price. This is the value in home/functional currency.
feature_price numeric Display only. The value (discount or surcharge) of any optional features which have been selected for this item. This is the value in home/functional currency.
adjusted_price numeric Display only. The price for this item which is unit_price plus feature_price plus any surcharges or discounts from the ORDER_ITEM_ADJUSTMENT table. This is the value in home/functional currency.

The total item value, which is sometimes known as extended_price, is calculated as adjusted_price * quantity.

estimated_delivery_date date Optional.
shipping_instructions string Optional.
item_comments string Optional. Comments for internal use.
supplier_notes string Optional. Notes for the supplier/manufacturer.
supplier_part_no string Optional. Identifies the supplier's part number on purchase orders.
quote_id number Optional. Links to an entry on the QUOTE_ITEM table.
quote_item_seq_no number Optional. Links to an entry on the QUOTE_ITEM table..
item_receipt_id number Optional. Links to an entry on the ITEM_RECEIPT table after a process has been performed which converts one product into another. In this case the product on the purchase order will be for a service, not a good.
The following fields are used to deal with transactions which are carried out in a currency which is different from that of the functional unit. Please see FAQ24 for details.
unit_price_tx numeric This is the same as unit_price, but expressed in transaction currency.
feature_price_tx numeric This is the same as feature_price, but expressed in transaction currency.
adjusted_price_tx numeric This is the same as adjusted_price, but expressed in transaction currency.

When an item is added to a sales order the following steps are performed:

  1. Look for a unit_price for the product on the PRICE_COMPONENT table in the following sequence:

    The first entry which is found will be used.

  2. Look on the PROD_FEATURE_APPLICABILITY table for any features marked as "standard" or "required", and add them to the ORDER_ITEM_FEATURE table.
  3. A lookup is made on the PRICE_COMPONENT table for any item adjustments which satisfy the following criteria:

    All entries which are found in any of these categories will be written to the ORDER_ITEM_ADJUSTMENT table.

  4. A new screen is activated which will show any product features which have been marked as "optional" or "required".

ORDER_ITEM_FEATURE table

A product may have any number of features, optional or otherwise, which may be incorporated into an order. Some features may adjust the price of a product by applying either a surcharge or a discount.

FieldTypeDescription
order_type string Links to an entry on the ORDER_ITEM table.
order_id numeric Links to an entry on the ORDER_ITEM table.
order_item_seq_no numeric Links to an entry on the ORDER_ITEM table.
prod_feature_id numeric Links to an entry on the PRODUCT_FEATURE table.
price_component_id numeric Optional. Links to an entry on the PRICE_COMPONENT table. This identifies the source of any price. It is read-only.
feature_price numeric Display only. A surcharge (positive value) or discount (negative value) which is associated with this feature. The sum of all these values will be shown as the feature_price on the ORDER_ITEM record. This is the value in home/functional currency.
is_hidden boolean Signifies that this entry is not to be included in any printed output.
The following fields are used to deal with transactions which are carried out in a currency which is different from that of the functional unit. Please see FAQ24 for details.
feature_price_tx numeric This is the same as feature_price, but expressed in transaction currency.

When a feature is added to an order item the following steps are performed:

  1. Look for a price for this feature on the PRICE_COMPONENT table in the following sequence:

    The first entry which is found will be used. A positive amount is a surcharge, but it is also possible to have a discount, which will be a negative amount.

ORDER_ITEM_FEATURE_CUSTOMISATION table

This table holds all the customised values for a feature which has been selected for an order item. Some features within a feature category may be able to be customised, such as engraving options for jewellery will need the text which is to be engraved.

The total number of customisation options is identified on the PROD_FEAT_CAT_CUSTOMISATION table. Their allowability (optional or required) is identified on the PROD_FEATURE_CUSTOMISATION table.

FieldTypeDescription
order_type string Links to an entry on the ORDER_ITEM table.
order_id numeric Links to an entry on the ORDER_ITEM table.
order_item_seq_no numeric Links to an entry on the ORDER_ITEM table.
prod_feature_id numeric Links to an entry on the PRODUCT_FEATURE table.
custom_seq_no numeric Links to the seq_no field on an entry in the PROD_FEAT_CAT_CUSTOMISATION table.
feature_customisation string Text.

RELATED_ORDER_ITEM table

In some cases it may be useful to record that one order item is related to another order item.

FieldTypeDescription
order_type1 string Links to the first entry on the ORDER_ITEM table.
order_id_1 numeric Links to the first entry on the ORDER_ITEM table.
order_item_seq_no_1 numeric Links to the first entry on the ORDER_ITEM table.
order_type_2 string Links to the second entry on the ORDER_ITEM table.
order_id_2 numeric Links to the second entry on the ORDER_ITEM table.
order_item_seq_no_2 numeric Links to the second entry on the ORDER_ITEM table.

If order S-1234 is related to order P-5678 is does not matter which is identified as order #1 and order #2.


Order Roles and Item Roles

Many parties can be involved in an order. A sales order has a CUSTOMER while a purchase order has a SUPPLIER. It may be useful to record other parties associated with an order, such as:

Figure 2 - Order Roles and Item Roles

order-02 (1K)

ORDER_ROLE_TYPE table

This identifies the types of role with which parties can be related to an order.

FieldTypeDescription
order_role_type_id string Identity
order_role_type_desc string Description

Here are some examples:

ORDER_ROLE table

This records the roles that various parties have with an order. A party may have more than one role with the same order, and a role may have more than one party.

FieldTypeDescription
order_type string Links to an entry on the ORDER_HEADER table.
order_id numeric Links to an entry on the ORDER_HEADER table.
order_role_type_id string Links to an entry on the ORDER_ROLE_TYPE table.
party_id numeric Links to an entry on the PARTY table.
percent_contribution numeric Optional. The percentage contribution made by this party. This could be useful, for example, if the commission on an order needs to be shared among several people.

ITEM_ROLE_TYPE table

This identifies the types of role with which parties can be related to an individual order item.

FieldTypeDescription
item_role_type_id string Identity
item_role_type_desc string Description

Here are some examples:

ORDER_ITEM_ROLE table

This records the roles that various parties have with an order item.

FieldTypeDescription
order_type string Links to an entry on the ORDER_ITEM table.
order_id numeric Links to an entry on the ORDER_ITEM table.
order_item_seq_no numeric Links to an entry on the ORDER_ITEM table.
item_role_type_id string Links to an entry on the ITEM_ROLE_TYPE table.
party_id numeric Links to an entry on the PARTY table.

Order Contact Mechanisms

As well as the various parties associated with an order, it may be useful to record the contact mechanisms (addresses, telephone numbers) for those parties. Note that these are in addition to the various contact_mech_id_??? values which are held on the ORDER_HEADER table.

Figure 3 - Order Contact Mechanisms

order-03 (1K)

ORDER_CONTACT_MECHANISM table

This identifies contact mechanisms which apply to an order.

FieldTypeDescription
order_type string Links to an entry on the ORDER_HEADER table.
order_id numeric Links to an entry on the ORDER_HEADER table.
contact_mech_purpose_type_id string Links to an entry on the CONTACT_MECH_PURPOSE_TYPE table.
contact_mechanism_id numeric Links to an entry on the CONTACT_MECHANISM table.

ITEM_CONTACT_MECHANISM table

This identifies contact mechanisms which apply to items within an order.

FieldTypeDescription
order_type string Links to an entry on the ORDER_ITEM table.
order_id numeric Links to an entry on the ORDER_ITEM table.
order_item_seq_no numeric Links to an entry on the ORDER_ITEM table.
contact_mech_purpose_type_id string Links to an entry on the CONTACT_MECH_PURPOSE_TYPE table.
contact_mechanism_id numeric Links to an entry on the CONTACT_MECHANISM table.

Order Status and Item Status

An order will be in different states at different points in time, and instead of just recording the current state it may be more useful to maintain a history of each change in state. The same is also true for individual items within an order.

Different organisations may have different states through which an order may progress, so the number of status values is maintained on a database table, and can be added to as required. It may also be necessary to define rules which allow/prohibit a change in status from one value to another.

Figure 4 - Order and Order Item Status

order-04 (3K)

ORDER_STATUS_TYPE table

This identifies all the possible states through which an order may be progressed.

Not all status values apply to all types of order (purchase, sales, transfer), so a series of switches identifies what is applicable where. This ensures that the dropdown list for order status shows only those values which are relevant.

FieldTypeDescription
order_status_type_id string Identity
order_status_type_desc string Description
reason string Optional. A status code may be selected for a particular reason value, such as sending out different emails for different reasons.
order_status_group string There may be many different status values, so this identifies the grouping or category. Possible values are:
  • Not Authorised
  • Authorised
  • On Hold
  • Closed
Only those orders with a status value in the 'Not Authorised' group can be modified.
processing_seq numeric This identifies the order in which the various status values are normally processed. It is also used as the sequence in which the values are displayed in any lists as it is deemed to be more useful than simply sorting alphabetically by name.
is_purchase_order boolean Indicates that this value is available for purchase orders.
is_sales_order boolean Indicates that this value is available for sales orders.
is_transfer_order boolean Indicates that this value is available for transfer orders.
is_shipment boolean Indicates that this value is available for shipments.
template_id string Optional. Links to an entry on the EMAIL_TEMPLATE table.

This contains an email message which may have certain keywords enclosed in '#' characters. These keywords will be replaced with proper values at runtime as follows:

  • #party_name# - the customer name
  • #ship_name# - the delivery name
  • #order_id# - the order number
  • #order_date# - the order date
  • #due_date# - the due date
  • #amount# - the order amount (including taxes)
  • #currency_code# - the currency in which the amount is expressed
  • #ship_address# - the delivery address
  • #order_item_details# - the details of each item within the order
  • #corp_name# - the organisation's name
  • #company_name# - an alias for #corp_name#
  • #corp_reg_no# - the organisation's registration number
  • #corp_vat_no# - the organisation's VAT number
  • #corp_tel_no# - the organisation's telephone number
  • #corp_email# - the organisation's email address
is_email_auto boolean If 'Yes' the email will be sent automatically, otherwise the user will be prompted first.

Here are some examples:

IdDescriptionSeqGroupMeaning
PEND Pending 1 Not Authorised Order entered but not yet approved.
PF1 Pro Forma Sent 2 Not Authorised Completed order has been sent to the customer for confirmation.
PF2 Confirmation Received 3 Not Authorised The customer has confirmed the order.
AWAP Awaiting Approval 4 Not Authorised The order is waiting approval to be picked.
SUP1 Sent to Supplier 5 Authorised Purchase order has been sent to supplier.
SH1 Approved for Picking 6 Authorised Items can be picked from inventory.
SH2 Awaiting Dispatch 7 Authorised Items are ready for shipping.
SH3 Dispatched/En Route 8 Authorised Shipment has been dispatched.
SH4 Delivered 9 Authorised Shipment has been delivered.
INV1 Invoice Created 10 Authorised Invoice has been created.
HOLD On Hold 98 On Hold Order has been placed on hold.
CNCL Cancelled 99 Closed Order has been cancelled.

ORDER_STATUS_RULES table

This provides a method of preventing a change in order status from anything to anything. Before a function is allowed to change the status it has to check to see if that change is valid. The current status is referred to as the FROM value while the proposed status is the TO value. If the rule table contains a record with that particular combination of FROM and TO values then it is valid and allowed to proceed. If there is no record with that combination of values then the change is not valid and not allowed to proceed.

FieldTypeDescription
order_status_type_id_from string Links to an entry on the ORDER_STATUS_TYPE table.
order_status_type_id_to string Links to an entry on the ORDER_STATUS_TYPE table.

Here are some examples:

FROM statusTO status
Pending Pro Forma Sent
Pro Forma Sent Confirmation Received
Pending Awaiting Approval
Confirmation Received Awaiting Approval
Awaiting Approval Sent to Supplier
Awaiting Approval Approved for Picking
Approved for Picking Awaiting Dispatch
Awaiting Dispatch Dispatched/En Route
Dispatched/En Route Delivered
Dispatched/En Route Invoice Created

You should note that for a sales order there are 2 routes between "pending" and "awaiting approval":

  1. pending -> awaiting approval
  2. pending -> pro forma sent -> confirmation received -> awaiting approval

Some customers may want to confirm an order before it is approved while others may not, so the choice of route is governed by the existence of a value for contact_mech_id_confirmation in the ORDER_HEADER record:

You should also note that 2 methods have been provided to change status values:

ORDER_STATUS_HIST table

This keeps a history of all changes in status for an order. The entry with the highest sequence number is the latest.

FieldTypeDescription
order_type string Links to an entry on the ORDER_HEADER table.
order_id numeric Links to an entry on the ORDER_HEADER table.
seq_no numeric Sequence number which is generated by the system. This starts at 1 for each order.
order_status_type_id string Links to an entry on the ORDER_STATUS_TYPE table.
status_date date The date on which this change was made.
status_comment string Optional. The reason why this change was made.
email_datetime date+time Display only. The date on which an email was sent based on email_template as defined in ORDER_STATUS_TYPE.

ORDER_ITEM_STATUS_TYPE table

This identifies all the possible states through which an order item may go.

FieldTypeDescription
order_item_status_type_id string Identity
order_item_status_type_desc string Description
reason string Optional. A status code may be selected for a particular reason value, such as sending out different emails for different reasons.
processing_seq numeric This identifies the order in which the various status values are normally processed. It is also used as the sequence in which the values are displayed in any lists as it is deemed to be more useful than simply sorting alphabetically by name.
is_purchase_order boolean Indicates that this value is available for purchase orders.
is_sales_order boolean Indicates that this value is available for sales orders.
template_id string Optional. Links to an entry on the EMAIL_TEMPLATE table.

This contains an email message which may have certain keywords enclosed in '#' characters. These keywords will be replaced with proper values at runtime as follows:

  • #party_name# - the customer name
  • #ship_name# - the delivery name
  • #order_id# - the order number
  • #order_date# - the order date
  • #due_date# - the due date
  • #amount# - the order amount (including taxes)
  • #currency_code# - the currency in which the amount is expressed
  • #ship_address# - the delivery address
  • #order_item_details# - the details of each item within the order
  • #corp_name# - the organisation's name
  • #company_name# - an alias for #corp_name#
  • #corp_reg_no# - the organisation's registration number
  • #corp_vat_no# - the organisation's VAT number
  • #corp_tel_no# - the organisation's telephone number
  • #corp_email# - the organisation's email address
is_email_auto boolean If 'Yes' the email will be sent automatically, otherwise the user will be prompted first.

Here are some examples:

IdDescriptionSeq
HOLD On Hold 1
PICK Picked 2
PP Part Picked 3
BACK Back Order 4
SHIP Shipped 5

ORDER_ITEM_STATUS_HIST table

This keeps a history of all changes in status for an order item. The entry with the highest sequence number is the latest.

FieldTypeDescription
order_type string Links to an entry on the ORDER_ITEM table.
order_id numeric Links to an entry on the ORDER_ITEM table.
order_item_seq_no numeric Links to an entry on the ORDER_ITEM table.
seq_no numeric Sequence number which is generated by the system.
order_item_status_type_id string Links to an entry on the ORDER_ITEM_STATUS_TYPE table.

The current value is also held on the ORDER_ITEM table.

status_date date The date on which this change was made.
status_comment string Optional. The reason why this change was made.
email_datetime date+time Display only. The date on which an email was sent based on email_template as defined in ORDER_ITEM_STATUS_TYPE.

ORDER_STATUS_TYPE_ATTACHMENT table

This identifies when outgoing emails which are sent when an order changes status need to have attachments automatically added.

FieldTypeDescription
order_status_type_id string Links to an entry on the ORDER_STATUS_TYPE table.
attachment_id number Links to an entry on the EMAIL_AUTO_ATTACHMENT table.

Order Terms and Item Terms

The parties involved in an order may agree on many arrangements or terms such as delivery terms, exchange or refund policies, and penalties for non-performance. Each order or order item may have one or more terms which are categorised by TERM_TYPE.

Figure 5 - Order Terms

order-05 (1K)

ORDER_TERMS table

This identifies the terms which have been added to an order.

FieldTypeDescription
order_type string Links to an entry on the ORDER_HEADER table.
order_id numeric Links to an entry on the ORDER_HEADER table.
seq_no numeric A number which is generated by the system. This starts at 1 for each order.
term_type_id string Links to an entry on the TERM_TYPE table.
value numeric Required if is_value_required on TERM_TYPE is 'Y', otherwise it must be empty.
place_name numeric Required if is_place_required on TERM_TYPE is 'Y', otherwise it must be empty.

This is used for Incoterms.

ORDER_ITEM_TERMS table

This identifies the terms which have been added to an order item.

FieldTypeDescription
order_type string Links to an entry on the ORDER_ITEM table.
order_id numeric Links to an entry on the ORDER_ITEM table.
order_item_seq_no numeric Links to an entry on the ORDER_ITEM table.
seq_no numeric A number which is generated by the system.This starts at 1 for each order_item.
term_type_id string Links to an entry on the TERM_TYPE table.
value numeric Required if is_value_required on TERM_TYPE is 'Y', otherwise it must be empty.

Quantity Breaks and Value Breaks

These are used to define discounts which are applied during the compilation of sales orders. Quantity Breaks are for individual products while Value Breaks are for the order as a whole.

Figure 6 - Quantity Breaks and Value Breaks

order-06 (1K)

QUANTITY_BREAK table

This is used to identify discounts against the price of a product based on the quantity purchased, with a different discount for a different range of quantities. The actual discount values are defined in the PRICE_COMPONENT table.

FieldTypeDescription
quantity_break_id string Identity
quantity_from numeric The lower limit of this range.
quantity_to numeric The upper limit of this range.

Here are some examples:

IdQty FromQty To
6-10 6 10
11-20 11 20
21-30 21 30
31-40 31 40
41-50 41 50
51+ 51 999999999

VALUE_BREAK table

This is used to identify discounts against the total goods value of a sales order, with a different discount for a different range of values. The actual discount values are defined in the PRICE_COMPONENT table.

FieldTypeDescription
value_break_id string Identity
value_from numeric The lower limit of this range.
value_to numeric The upper limit of this range.

Here are some examples:

IdValue FromValue To
250-500 250.00 500.00
500-1000 50.01 1000.00
1K-2K 1000.01 2000.00
2K-5K 2000.01 5000.00
5K+ 5000.01 999999999.99

Order Adjustments and Item Adjustments

As well as the price of individual products an order may contain a variety of discounts or surcharges which affect its total value. Some of these adjustments may apply to individual products, such as quantity breaks, while others apply to the whole order, such as sales tax.

Figure 7 - Order/Item Adjustments

order-07 (1K)

ORDER_ADJUSTMENT_TYPE table

These are used to categorise various discounts and surcharges which may be applied to the total value of a sales order. The actual values or percentages are defined in the PRICE_COMPONENT table.

These adjustments are always processed in the sequence - (1) discounts, (2) surcharges, (3) taxes.

FieldTypeDescription
order_adjustment_type_id string Identity
order_adjustment_type_desc string Description
discount_or_surcharge string Must be either "Discount" or "Surcharge".
is_manual boolean Possible values are "YES" for MANUAL or "NO" for AUTOMATIC.

If set to "AUTOMATIC/NO" then qualifying adjustments will be added automatically when the order is created. If set to "YES/MANUAL" then items can only be added manually.

Here are some examples:

IdAdjustment TypeD_or_SM/A
COMMISSION Sales Person's Commission Surcharge Manual
DELIVERY Delivery Charge (see Note 1) Surcharge Auto
DELIVERY1 Post & Packaging (see Note 1) Surcharge Manual
DELIVERY2 Shipping and Handling charge (see Note 1) Surcharge Manual
DISC-VAL Value Discount Discount Manual
DISCOUNT Discount Discount Manual
ESD-2-10 Early Settlement Discount, 2%, 10 days Discount Manual
FEE01 Order Processing Fee Surcharge Manual
FEE02 Management Fee Surcharge Manual
HANDLING Handling charge Surcharge Manual
MISC Miscellaneous Charge Surcharge Manual
SURCHARGE Surcharge Surcharge Manual
TAX-S Sales Tax (see Note 2) Surcharge Auto
WITHHOLDING-TAX Withholding Tax Surcharge Auto

NOTE 1: all codes for automatic Delivery/Shipping must begin with 'DELIVERY' as they require special processing. They will use the delivery address instead of the order's primary address to determine the charge amount.

NOTE 2: all codes for automatic Sales Tax must begin with 'TAX' as they must be processed AFTER any non-tax surcharges. If either the order's billing address or delivery address lie within the enterprise's home area (the organisation's country) then the tax rate which applies to the home area will be used instead of that for the billing address.

DISCOUNT_CODE table

An organisation may decide to have a sales promotion involving discount vouchers. A range of voucher numbers may be issued, either individually to specific customers, or printed in trade magazines or other promotional material. If a customer supplies a valid voucher number with his next order he will be eligible for the discount that applies to that voucher.

Discount vouchers have the following properties:

FieldTypeDescription
discount_code string Unique Identity.
discount_desc string Description.
value numeric Only one of value or percent can be defined.
percent numeric Only one of value or percent can be defined.
start_date date The start date for this entry.
end_date date Optional. The end date for this entry. Blank signifies an unspecified date in the future.
usage_limit numeric This identifies how many times this discount code can be used. Zero/blank implies no limit.
usage_count numeric This identifies how many times this discount code has been used in a sales order.

ORDER_ADJUSTMENT table

This identifies those adjustments (surcharges or discounts) which apply to an order. When an order is first created the PRICE_COMPONENT table is scanned for eligible records, and if any are found they are added to this table automatically. Manual amendments can be made afterwards.

When any part of an order is amended the contents of this table is scanned to determine if any adjustments need to be made. Any effect that an individual adjustment record has is indicated in that entry's details, and the sum of all adjustments will be shown in the ORDER_HEADER details.

FieldTypeDescription
order_type string Links to an entry on the ORDER_HEADER table.
order_id numeric Links to an entry on the ORDER_HEADER table.
adjustment_seq_no numeric A sequence number which is generated by the system. This starts at 1 for each order.
order_adjustment_type_id string Links to an entry on the ORDER_ADJUSTMENT_TYPE table.
price_component_id numeric Optional. Links to an entry on the PRICE_COMPONENT table.
discount_code string Optional. Links to an entry on the DISCOUNT_CODE table.
prod_cat_id string Optional. Links to an entry on the PRODUCT_CATEGORY table.
adjustment_desc string The description for this adjustment.
amount numeric A fixed amount for this adjustment. This is the value in home/functional currency.

Only one of amount, percent or product_id_free can be used.

percent numeric A percentage amount which will be applied to applicable_amount in order to calculate the adjustment value.

Only one of amount, percent or product_id_free can be used.

rounding_method string Required. This is the method used when rounding numbers to the specified number of decimal places. Allowed values are:
  • S = Standard (values of 0.4 and below will be round DOWN, 0.5 and above will be rounded UP)
  • D = DOWN (values of 0.1 to 0.9 will always be round DOWN)
  • U = UP (values of 0.1 to 0.9 will always be rounded UP)

This is initially copied from the PRICE_COMPONENT table, but can be altered manually.

product_id_free string Links to an entry on the PRODUCT table. For Value Breaks the discount may be a free unit of a particular product instead of a monetary value. This free product will appear in the ORDER_ITEM table with a zero price.

Only one of amount, percent or product_id_free can be used.

applicable_amount numeric Display only. The order amount that was used to calculate an adjustment value using the details contained within this entry. This is the value in home/functional currency. If this field is empty then this entry was not used to produce an adjustment value.
adjustment numeric Display only. The value of this adjustment when either amount or percent is applied to applicable_amount.
value_from numeric This is used only in Value Breaks, and represents the lower part of the range of values for which this entry actually applies. This is the value in home/functional currency.
value_to numeric This is used only in Value Breaks, and represents the upper part of the range of values for which this entry actually applies. This is the value in home/functional currency.
The following fields are used to deal with transactions which are carried out in a currency which is different from that of the functional unit. Please see FAQ24 for details.
amount_tx numeric This is the same as amount, but expressed in transaction currency.
applicable_amount_tx numeric This is the same as applicable_amount, but expressed in transaction currency.
adjustment_tx numeric This is the same as adjustment, but expressed in transaction currency.
value_from_tx numeric This is the same as value_from, but expressed in transaction currency.
value_to_tx numeric This is the same as value_to, but expressed in transaction currency.

Here are some examples:

Adjustment TypeProduct CategoryAmountPercentFree ProductValue FromValue ToApplicable AmountAdjustment
Sales Tax Zero-Rated VAT              
Sales Tax Reduced Rate VAT   5.00          
Sales Tax     17.500       18.99 3.32
Value Discount       Corkscrew 50.00 250.00    
Value Discount       Wine Cooler 250.01 500.00    
Discount   10.00         28.99 -10.00

ITEM_ADJUSTMENT_TYPE table

These are used to categorise various discounts and surcharges which may be applied to individual product values when they are added to sales orders. The actual values are defined in the PRICE_COMPONENT table.

FieldTypeDescription
item_adjustment_type_id string Identity
item_adjustment_type_desc string Description
discount_or_surcharge string Must be either "Discount" or "Surcharge".
is_manual boolean Possible values are "YES" for MANUAL or "NO" for AUTOMATIC.

If set to "AUTOMATIC/NO" then qualifying adjustments will be added automatically when the order is created. If set to "YES/MANUAL" then items can only be added manually.

Here are some examples:

Adjustment TypeD_or_S
Discount D
Quantity Discount D
Surcharge S
Alcohol Tax S
Feature Charge S

ORDER_ITEM_ADJUSTMENT table

This identifies those adjustments (surcharges or discounts) which apply to an order item. When an item is added to an order the PRICE_COMPONENT table is scanned for eligible records, and if any are found they are added to this table automatically. Manual amendments can be made afterwards.

When any part of an order item is amended the contents of this table is scanned to determine if any adjustments need to be made. The sum of all adjustments will be shown in the ORDER_ITEM details.

FieldTypeDescription
order_type string Links to an entry on the ORDER_ITEM table.
order_id numeric Links to an entry on the ORDER_ITEM table.
order_item_seq_no numeric Links to an entry on the ORDER_ITEM table.
adjustment_seq_no numeric A sequence number which is generated by the system. This starts at 1 for each order_item.
item_adjustment_type_id string Links to an entry on the ITEM_ADJUSTMENT_TYPE table.
price_component_id numeric Optional. Links to an entry on the PRICE_COMPONENT table.
adjustment_desc string The description for this adjustment.
amount numeric A fixed amount for this adjustment. This is the value in home/functional currency.

Only one of amount, percent, free_units or product_id_free can be used.

percent numeric A percentage amount which will be applied to applicable_amount in order to calculate the adjustment value.

Only one of amount, percent, free_units or product_id_free can be used.

rounding_method string Required. This is the method used when rounding numbers to the specified number of decimal places. Allowed values are:
  • S = Standard (values of 0.4 and below will be round DOWN, 0.5 and above will be rounded UP)
  • D = DOWN (values of 0.1 to 0.9 will always be round DOWN)
  • U = UP (values of 0.1 to 0.9 will always be rounded UP)

This is initially copied from the PRICE_COMPONENT table, but can be altered manually.

free_units numeric For Quantity Breaks the discount may be a number of free units of the same product instead of a monetary value.

Only one of amount, percent, free_units or product_id_free can be used.

product_id_free string Optional. Links to an entry on the PRODUCT table. For Quantity Breaks the discount may be a free unit of a particular product instead of a monetary value. This free product will appear in the ORDER_ITEM table with a zero price.

Only one of amount, percent, free_units or product_id_free can be used.

applicable_amount numeric Display only. The amount that was used to calculate an adjustment value using the details contained within this entry. This is the value in home/functional currency. If this field is empty then this entry was not used to produce an adjustment value.
applicable_qty numeric Display only. The quantity that was used to calculate an adjustment value using the details contained within this entry. If this field is empty then this entry was not used to produce an adjustment value.
quantity_from numeric This is used only in Quantity Breaks, and represents the lower part of the range of values for which this entry actually applies.
quantity_to numeric This is used only in Quantity Breaks, and represents the upper part of the range of values for which this entry actually applies.
The following fields are used to deal with transactions which are carried out in a currency which is different from that of the functional unit. Please see FAQ24 for details.
amount_tx numeric This is the same as amount, but expressed in transaction currency, if applicable.
applicable_amount_tx numeric This is the same as applicable_amount, but expressed in transaction currency, if applicable.

Here are some examples:

Adjustment TypeAmountPercentFree UnitsFree ProductQty FromQty ToApplicable Qty
Quantity Discount 0.25       6 10 6
Quantity Discount 0.50       11 20  
Quantity Discount 0.75       21 30  

It should be noted that it is possible to have more than one item for the same product in the same order, perhaps with different features, so any quantity discounts have to operate on the total quantity for that product across all items within the order, and not just the quantity on the current item.


Order Payments

Some customers may pay by cheque, while others will want to pay by credit or debit card. The enterprise may have a web site through which customers may view their products and purchase them online, or they may place orders over the telephone or via email in which case the card payments will be entered on their behalf.

In order to process card payments online it is necessary for the organisation to have an account with a payment gateway. Requests can then be sent to the payment gateway via HTTPS, and their responses can be recorded in the system. The payment gateway will transfer funds from the customer's card to the organisation's account.

Note that the customer's card number is not stored in the database - it is transmitted to the payment gateway over an encrypted connection in order to authorise the payment, then it is discarded.

If the associated sales order uses a foreign currency then all payment transactions must be in the same currency.

Figure 8 - Online Payments

order-08 (2K)

ORDER_PAYMENT table

This is used to record each payment transaction against an order. For credit card transactions this records the request sent to the payment gateway, and the response to that request.

FieldTypeDescription
gateway_id string Identifies the payment gateway, such as PROTX or PAYPAL.
VendorTxCode string Unique Identity which is automatically generated.
order_type string Links to an entry on the ORDER_HEADER table.
order_id numeric Links to an entry on the ORDER_HEADER table.
ip_address string This IP address from which this entry was generated.
TxType string Identifies the request type. Can be one of the following:
  • PAYMENT - an initial request for payment.
  • VOID - cancels a payment before it is processed.
  • REFUND - refund all or part of a previous payment.
  • REPEAT - request for another payment (which need not be for the same amount as the original).
CardHolder string The name on the Credit Card.
BillingAddress string The address at which the card is registered (without the postcode).
BillingPostCode string The post/zip code of the cardholder's billing address.
ShippingAddress string The shipping address for the goods.
ShippingPostCode string The post/zip code of the shipping address.
Amount number The amount which is the subject of this request. This is the value in home/functional currency.
balance number Read only. This is initially set to the same value as Amount and is only used within the FINANCE-AR subsystem when a payment is matched with invoices.
Status string The response received from the payment gateway. Among the possible values are:
  • OK - the transaction was authorised and funds were taken from the customer's card.
  • NOTAUTHED - the transaction was not authorised by the customer's bank.
  • REJECTED - The the transaction was rejected because of a rule on the account with the payment gateway.
  • INVALID - the transaction was rejected because some information supplied was invalid. e.g. incorrect vendor name or currency.
StatusDetail string Human-readable text providing extra detail for the Status message.
VPSTxId string A unique identity provided by the payment gateway.
SecurityKey string A security key which the payment gateway uses to generate an MD5 Hash to sign the transaction.
TxAuthNo string The authorisation code for this transaction, generated by the payment gateway.
AVSCV2 string Response from AVS and CV2 checks. Will be one of the following:
  • ALL MATCH
  • SECURITY CODE MATCH ONLY
  • ADDRESS MATCH ONLY
  • NO DATA MATCHES
  • DATA NOT CHECKED
AddressResult string The specific result of the checks on the cardholder's address numeric from the AVS/CV2 checks. Possible values are:
  • MATCHED
  • NOTMATCHED
  • NOTCHECKED
  • NOTPROVIDED
PostCodeResult string The specific result of the checks on the cardholder's Post Code from the AVS/CV2 checks. Possible values are:
  • MATCHED
  • NOTMATCHED
  • NOTCHECKED
  • NOTPROVIDED
CV2Result string The specific result of the checks on the cardholder's CV2 code from the AVS/CV2 checks. Possible values are:
  • MATCHED
  • NOTMATCHED
  • NOTCHECKED
  • NOTPROVIDED
ThreeDSecureStatus string Response from the 3D-Secure service (if applicable).
CAVV string A unique value which indicates that the 3D-Secure Authentication was successful.
GiftAid boolean Indicates if this transaction is a GiftAid charitable donation.
maxmind_err string A warning message or a reason why the request to the MAXMIND MinFraud system failed.
maxmind_explanation string A brief explanation of the score, detailing what factors contributed to it, according to the original MAXMIND formula.
maxmind_score string The original fraud score in the range 0-10. This has been replaced by the risk score, but is kept for backwards compatibility.
maxmind_risk_score string New fraud score, in the range 0-100, representing the estimated probability that the order is fraud, based off of analysis of past minFraud transactions.
maxmind_data string All the other data from the MAXMIND application.
gateway_data string Data supplied by the gateway which does not have its own column.
The following fields are only used when values are input in foreign currency, in which case the amount entered will be stored in this field, then converted to home/functional currency using the inverse of exchange_rate from the ORDER_HEADER table before being stored in the home/functional currency field.
Amount_tx number This is the same as Amount, but expressed in foreign currency.
balance_tx number This is the same as balance, but expressed in foreign currency.

ORDER_PAYMENT_GATEWAY table

This is used to identify various payment methods.

FieldTypeDescription
gateway_id string Identifies the possible methods of payment.
gateway_desc string Description.
is_manual boolean Identifies if this can be selected as a manual payment.
last_seq_no numeric Identifies the last sequence number generated for this payment type. Values for VendorTxCode will be generated as <gateway_id>_nnn where nnn is the sequence number.

Here are some examples:

IdDescriptionIs Manual?Last Seq No
PROTX PROTX/SagePay N  
PAYPAL Paypal N  
CASH Cash Y 7
CHEQUE Cheque Y 3
BANKTRAN Bank Transfer Y 9

ORDER_PAYMENT_STATUS table

This is used to identify the range of values which may be used as selection criteria in the search screen. It is not use as a foreign key field as the values are under the control of the payment service provider.

FieldTypeDescription
Status string The response received from the payment gateway.

Reserved Items

In some circumstances it may be a good idea to reserve stock for a sales order so that it is still available at the item issuance stage and not issued to someone else. Reserved quantities reduce the value in qty_on_hand to indicate that the stock is not available to others.

Entries on this table may be created at any of the following stages:

Entries are deleted when the items are picked from inventory at the issuance stage.

Figure 9 - Reserved Items

order-09 (2K)

RESERVED_ITEM table

This identifies where inventory has been reserved for an order item. The quantity is used to reduce the value of qty_on_hand on the INVENTORY_ITEM record.

FieldTypeDescription
order_type string Links to an entry on the ORDER_ITEM table and also the PICKLIST_DTL table.
order_id numeric Links to an entry on the ORDER_ITEM table and also the PICKLIST_DTL table.
order_item_seq_no numeric Links to an entry on the ORDER_ITEM table and also the PICKLIST_DTL table.
seq_no numeric A sequence number assigned by the system, starting at 1 and incremented by 1, which allows an order item to have more than 1 stock reservation.
party_id numeric Links to an entry on the INVENTORY_ITEM table.
product_id string Links to an entry on the INVENTORY_ITEM table.
inventory_item_id numeric Links to an entry on the INVENTORY_ITEM table.
quantity_reserved numeric Quantity reserved.

Non-Conformance Report

If an item received from a supplier is not of the required quality then corrective action has to be taken. This action is initiated with the creation of a Non Conformance Report (NCR) which requests a response from the supplier.

Figure 10 - Non-Conformance Reports

order-10 (2K)

NON_CONFORMANCE_STATUS table

This identifies all the possible states through which a non-conformance report may be progressed.

FieldTypeDescription
ncr_status_id string Identity
ncr_status_desc string Description

Here are some examples:

NON_CONFORMANCE_REPORT table

This identifies when a problem is found with an item received from a supplier. It may be because the item was faulty, or the item did not match the specifications, or the wrong item was delivered.

FieldTypeDescription
ncr_id numeric Identity number assigned by the system.
ncr_desc string Description of the problem.
ncr_investigation string Optional. Description of the investigation into the problem.
ncr_status_id string Links to an entry on the NON_CONFORMANCE_STATUS table.
order_type string Links to an entry on the ORDER_ITEM table.
order_id numeric Links to an entry on the ORDER_ITEM table.
order_item_seq_no numeric Links to an entry on the ORDER_ITEM table.
product_id numeric Links to an entry on the PRODUCT table.
supplier_id numeric Links to an entry on the PARTY table.
date_raised date The date on which the Non Conformance Report was raised.
response_due date The date by which a response is due.
response_received date The date on which a response was received.

Building Purchase Orders from Sales Orders

In some cases an item on a sales order may need to be custom made by an external supplier, in which case it will be necessary to raise a purchase order and receive the item from that supplier before it can be shipped to the customer. During the approval process for the sales order there is the option to raise a purchase order on a particular supplier instead of picking it from stock. This does not create a purchase order immediately, it simply adds a request to the PURCHASE_ORDER_BUILD table so that they can be processed later.

Once a sufficient number of requests have been assembled a second process will take all the requests for a nominated suppler, consolidate them into a single purchase order, then delete the requests. This process will also create an entry on the RELATED_ORDER_ITEM table so that it will be possible to see the relationship between sales orders and purchase orders.

Figure 11 - Building Purchase Orders

order-11 (2K)

PURCHASE_ORDER_BUILD table

This identifies items on sales orders which need to be turned into purchase orders so that items can be obtained from suppliers before they can be despatched to customers.

FieldTypeDescription
order_type string Links to an entry on the ORDER_ITEM table.
order_id numeric Links to an entry on the ORDER_ITEM table.
order_item_seq_no numeric Links to an entry on the ORDER_ITEM table.
party_id numeric Links to an entry on the PARTY table. This identifies the supplier.

Entries will only exist on this table until they have been added to a purchase order, at which point they will be deleted.


Links to other entities

It is possible for an order to be linked to other entities within the system, such as invoices, requests, requirements and shipments.

Figure 12 - Links to other entities

order-12 (2K)

ORDER_QUOTE_LINK table

This links an Order to a Quotation.

FieldTypeDescription
order_type string Links to an entry on the ORDER_HEADER table.
order_id numeric Links to an entry on the ORDER_HEADER table.
quote_id numeric Links to an entry on the QUOTE_HEADER table.

ORDER_REQUEST_LINK table

This links an Order to a Request.

FieldTypeDescription
order_type string Links to an entry on the ORDER_HEADER table.
order_id numeric Links to an entry on the ORDER_HEADER table.
request_id numeric Links to an entry on the REQUEST table.

ORDER_REQUIREMENT_LINK table

This links an Order to a Requirement.

FieldTypeDescription
order_type string Links to an entry on the ORDER_HEADER table.
order_id numeric Links to an entry on the ORDER_HEADER table.
requirement_id numeric Links to an entry on the REQUIREMENT table.

ORDER_SHIPMENT_LINK table

This links an Order to a Shipment.

FieldTypeDescription
order_type string Links to an entry on the ORDER_HEADER table.
order_id numeric Links to an entry on the ORDER_HEADER table.
shipment_id numeric Links to an entry on the SHIPMENT table.

Figure 13 - Links between ORDER_ITEM table and other subsystems

Subsystem Table
Fixed Assets ASSET_BOOK_EVENT
General Ledger JOURNAL_ENTRY_ITEM
RECURRING_JE_ITEM
STANDING_JE_ITEM
Inventory ITEM_ISSUANCE
ITEM_RECEIPT
PICKLIST_DTL
Request QUOTE_ITEM_ORDER_ITEM
Shipment DROP_SHIPMENT_ITEM
PACKAGE_IN_CONTENT
PACKAGE_OUT_CONTENT
RETURN_MATL_AUTH_ITEM
SPLR_PACKAGE_CONTENT
Work Effort WORK_EFFORT_ASSIGNMENT
WORK_EFFORT_ORDER_ITEM

Order Extra Values

This database may be used by other systems, such as a web front end, which may have a requirement for extra fields to be held for each order. There is a NAMES table which holds the names of any such extra fields, with their validation types, and a VALUES table which holds a corresponding value for each order.

Although these values can be held in the database they cannot be considered when processing any business rules as their names and meanings are not part of the standard software. They can, however, be dealt with in any custom plugins.

Figure 14 - Order Extra Values

order-14 (2K)

ORDER_EXTRA_NAMES table

This identifies the names of extra fields which can be held for each order.

FieldTypeDescription
extra_id string Identity
extra_name string Short Name
extra_desc string Optional. Long Description
extra_type string Validation type. Allowable values are:
  • string (the default)
  • boolean
  • date
  • number(P) - a number with P digits
  • number(P,S) - a number with P digits, including S decimals

ORDER_EXTRA_VALUES table

This holds the values for any extra fields for each order.

FieldTypeDescription
order_type string Links to an entry on the ORDER_HEADER table.
order_id numeric Links to an entry on the ORDER_HEADER table.
extra_id string Links to an entry on the ORDER_EXTRA_NAMES table.
extra_value string This holds the value for this Extra Name with this Order.

Order Item Extra Values

This database may be used by other systems, such as a web front end, which may have a requirement for extra fields to be held for each order item. There is a NAMES table which holds the names of any such extra fields, with their validation types, and a VALUES table which holds a corresponding value for each order item.

Although these values can be held in the database they cannot be considered when processing any business rules as their names and meanings are not part of the standard software. They can, however, be dealt with in any custom plugins.

Figure 15 - Order Item Extra Values

order-15 (2K)

ORDER_ITEM_EXTRA_NAMES table

This identifies the names of extra fields which can be held for each order item.

FieldTypeDescription
extra_id string Identity
extra_name string Short Name
extra_desc string Optional. Long Description
extra_type string Validation type. Allowable values are:
  • string (the default)
  • boolean
  • date
  • number(P) - a number with P digits
  • number(P,S) - a number with P digits, including S decimals

ORDER_ITEM_EXTRA_VALUES table

This holds the values for any extra fields for each order item.

FieldTypeDescription
order_type string Links to an entry on the ORDER_ITEM table.
order_id numeric Links to an entry on the ORDER_ITEM table.
order_item_seq_no numeric Links to an entry on the ORDER_ITEM table.
extra_id string Links to an entry on the ORDER_ITEM_EXTRA_NAMES table.
extra_value string This holds the value for this Extra Name with this Order Item.

Saved Shopping Basket

Sometimes a customer visiting the front-end website may wish to save his/her shopping basket for later instead of purchasing the items straight away. This can be done by pressing the 'Save Basket' button on the website instead of the 'Purchase' button. If this facility is used the customer will be emailed with a hyperlink which will show the saved basket and all its items. This hyperlink can be shared with others. The 'Saved Shopping Basket' screen will have an 'Add to Cart' button which will copy the items to the 'real' shopping cart so that they may be purchased.

Figure 16 - Saved Shopping Basket

order-16 (2K)

BASKET table

This identifies where a customer has saved his/her shopping basket in the front-end website.

FieldTypeDescription
basket_id numeric A number which is generated by the system.
email_addr string Customer's Email address. This is a unique key, so it can also be used to identify a customer's saved basket.
name string The customer's name.
telephone string Optional. The customer's telephone number.

BASKET_ITEM table

This identifies the items within a saved shopping basket.

FieldTypeDescription
basket_id numeric Links to an entry on the BASKET table.
item_seq_no numeric A sequence number which is generated by the system.
product_id string Links to an entry on the PRODUCT table.
price numeric The price when this item was added to the basket.
currency_code string The currency in which the price was given.
price_date date The date on which this item was priced.

BASKET_ITEM_FEATURE table

This identifies any features for an item within a saved shopping basket..

FieldTypeDescription
basket_id numeric Links to an entry on the BASKET_ITEM table.
item_seq_no numeric Links to an entry on the BASKET_ITEM table.
prod_feature_id numeric Links to an entry on the PRODUCT_FEATURE table.

BASKET_ITEM_FEATURE_CUSTOMISATION table

This table holds all the customised values for a feature which has been selected for an item in the shopping basket. Some features within a feature category may be able to be customised, such as engraving options for jewellery will need the text which is to be engraved.

FieldTypeDescription
basket_id numeric Links to an entry on the BASKET_ITEM_FEATURE table.
item_seq_no numeric Links to an entry on the BASKET_ITEM_FEATURE table.
prod_feature_id numeric Links to an entry on the BASKET_ITEM_FEATURE table.
custom_seq_no numeric Links to the seq_no field on an entry in the PROD_FEAT_CAT_CUSTOMISATION table.
feature_customisation string Text.

Order Control Data

This information exists within a shared table in the MENU database and not a separate table within the ORDER database. It holds values which can be varied to suit that particular installation. The current values are as follows:

NameValueDescription
Address for FAX service @efaxsend.com If the contact_mech_id_confirmation field in the ORDER_HEADER indicates a FAX number then an email will be generated and sent to this service, which will then convert it into a FAX.
Order Due Days 2 When a sales order is created this number will be added to order_date to provide a value for due_date.
Show as Due (days) 2 This is used to change the colour of sales orders to indicate that they are due. The calculation is:

If due_date minus this number <= today then this order is due

Show as Overdue (days) 0 This is used to change the colour of sales orders to indicate that they are overdue. The calculation is:

If due_date minus this number <= today then this order is overdue

Skip Credit Check (Order Approval) No If this is set to 'No' a sales order will not be allowed to pass through the approval process unless the customer has been credit checked.
Copy emails to database No If this is set to 'Yes' then a copy of all generated emails will be copied to the EMAIL_MSG table.
default_payment_terms_s Default payment terms for sales orders, from the TERM_TYPE table with a term_type_id starting with 'NET_'
default_incoterms_s Default incoterms for sales orders, from the TERM_TYPE table with a term_type_id starting with 'ICC_'
default_place_name_s Default incoterms place name for sales orders.
default_payment_terms_p Default payment terms for purchase orders, from the TERM_TYPE table with a term_type_id starting with 'NET_'
default_incoterms_p Default incoterms for purchase orders, from the TERM_TYPE table with a term_type_id starting with 'ICC_'
default_place_name_p Default incoterms place name for purchase orders.

Initial Values

There may be cases where a transaction requires user input and a particular value or values remains constant for all instances of that transaction. In order to avoid having to manually input the same value(s) each time the transaction is run it is possible to define each of those values in the database and have those values automatically included in the user input. For maximum flexibility the following tables in the MENU database are used:

TableDescription
mnu_task_field Identifies the field names within each task for which initial values can be defined. Entries must be created here for each task+field before any initial values can be defined for a task+field.
mnu_initial_value_role This defines the initial values which are to be used when users within this role execute this task.
mnu_initial_value_user This defines the initial values which are to be used when this user executes this task.

Note that USER values take precedence over ROLE values.

Here are some typical cases:

Task Field Description
ord_order_header_p(output3)b
(send purchase order to printer)
printer_address The address of the printer to which the email will be sent.
subject The value to be entered in the SUBJECT field of the email.
ord_order_header_s(output3)b
(send sales order to printer)
printer_address The address of the printer to which the email will be sent.
subject The value to be entered in the SUBJECT field of the email.
ord_order_header_s(upd4)label
(print despatch labels)
_FORMAT .
_JOBNAME .
_PRINTERNAME .
_QUANTITY .
PRINTER_ADDR The email address for the printer.
SUBJECT The subject line of the generated email.
ord_order_header_t(output3)b
(send transfer order to printer)
printer_address The address of the printer to which the email will be sent.
subject The value to be entered in the SUBJECT field of the email.
ord_order_item_p(upd4)
(print labels)
PRINTER_ADDRESS The email address for the printer.
SUBJECT The subject line of the generated email.
_FORMAT .
_JOBNAME .
_PRINTERNAME .
_QUANTITY .
ord_order_item_p(upd4)image
(print product image)
PRINTER_ADDRESS The email address of the printer.
SUBJECT The subject line for the email.
FILE_PATH The file path to the image.
ord_order_item_s(multi2)
(approve sales order items)
party_id The party_id of the supplier to whom the purchase order is being issued. This should point to a default party for use when creating purchase orders from sales orders in case an order item does not have a list of possible suppliers.
_FORMAT .
_JOBNAME .
_PRINTERNAME .
_QUANTITY .
PRINTER_ADDRESS The email address for the printer.
SUBJECT The subject line of the generated email.
ord_order_item_s(upd4)ring-gauge
(print labels)
PRINTER_ADDRESS The email address for the printer.
SUBJECT The subject line of the generated email.
_FORMAT .
_JOBNAME .
_PRINTERNAME .
_QUANTITY .
sale_type_id Identifies the sale type, or range of sale types in a comma-separated list.
valid_countries List of valid country_id's. Requests from countries not in this list will be rejected.
ord_purchase_order_build(add4)
(add sales order item to pending purchase order)
party_id The party_id of the default supplier, to be used in case a product does not have a list of suppliers.

Date created: 13th August 2007

Amendment history:

12th Apr 2023 Added the ORDER_QUOTE_LINK table.
27th Sept 2022 Updated the SALE_TYPE table to include the is_sales_tax_included column.
17th Sept 2022 Updated the ORDER_ADJUSTMENT and ORDER_ITEM_ADJUSTMENT tables to include the rounding_method column.
9th May 2021 Updated the ORDER_TERMS table to include the place_name column.
20th Feb 2019 Updated the RESERVED_ITEM table to include the seq_no column.
15th Feb 2019 Updated the ORDER_ITEM table to include the item_receipt_id column.
26th Jan 2019 Updated the RESERVED_ITEM table to include the party_id column.
3rd Jan 2019 Updated the ORDER_PAYMENT table to include the balance and balance_tx columns.
17th Dec 2018 Updated the ORDER_ITEM table to include the price_component_id column.
Updated the ORDER_ITEM_FEATURE table to include the price_component_id column.
6th May 2018 Updated the ORDER_ITEM table to include the quote_id and quote_item_seq_no columns.
12th Dec 2017 Updated the ORDER_HEADER table to include the contact_mech_id_blockchain column.
3rd Apr 2017 Renamed table ONLINE_PAYMENT to ORDER_PAYMENT
Renamed table ONLINE_PAYMENT_GATEWAY to ORDER_PAYMENT_GATEWAY
Renamed table ONLINE_PAYMENT_STATUS to ORDER_PAYMENT_STATUS
Updated the ORDER_ITEM_FEATURE table to remove the feature_customisation and feature_customisation_2 columns.
Added the ORDER_ITEM_FEATURE_CUSTOMISATION table.
Updated the BASKET_ITEM_FEATURE table to remove the feature_customisation and feature_customisation_2 columns.
Added the BASKET_ITEM_FEATURE_CUSTOMISATION table.
15th Nov 2015 Updated the ORDER_STATUS_TYPE table to include the email_subject column.
Updated the ORDER_ITEM_STATUS_TYPE table to include the email_subject column.
24th Aug 2015 Updated the ORDER_STATUS_TYPE table by replacing email_text and email_subject with template_id.
Updated the ORDER_ITEM_STATUS_TYPE table by replacing email_text and email_subject with template_id.
23rd Nov 2014 Dropped the TERM_TYPE table in favour of the one in the PARTY database.
04 Jul 2014 Updated the BASKET_ITEM_FEATURE table to include the feature_customisation2 column.
Updated the ORDER_ITEM_FEATURE table to include the feature_customisation2 column.
Updated the ORDER_PAYMENT table to include the Amount_tx column.
Updated the ORDER_ADJUSTMENT table to include the amount_tx, applicable_amount_tx, value_from_tx and value_to_tx columns.
Updated the ORDER_HEADER table to include the order_value_tx and adjusted_value_tx columns.
Updated the ORDER_ITEM table to include the unit_price_tx feature_price_tx and adjusted_price_tx columns.
Updated the ORDER_ITEM_ADJUSTMENT table to include the amount_tx and applicable_amount_tx columns.
Updated the ORDER_ITEM_FEATURE table to include the feature_price_tx column.
9th Nov 2013 Added the ORDER_STATUS_TYPE_ATTACHMENT table.
14 Aug 2013 Added the ORDER_ITEM_EXTRA_NAMES table.
Added the ORDER_ITEM_EXTRA_VALUES table.
09 Jun 2012 Updated the ORDER_ITEM_STATUS_TYPE table to include the reason column.
Updated the ORDER_STATUS_TYPE table to include the reason column.
12 May 2012 Updated the BASKET_ITEM_FEATURE table to add the feature_customisation column.
18 Apr 2012 Updated the ORDER_ADJUSTMENT_TYPE table to remove the processing_seq column.
Updated the ORDER_ITEM_ADJUSTMENT table to include the applicable_amount column.
16 Jul 2011 Added the BASKET, BASKET_ITEM and BASKET_ITEM_FEATURE tables.
05 Jul 2011 Updated the ORDER_ITEM table to include the supplier_notes column.
02 Jul 2011 Updated the SALE_TYPE table to include the queue_id_default column.
08 Feb 2011 Updated the ORDER_ITEM table to include the order_item_status_type_id column.
29 Aug 2010 Updated the ORDER_HEADER table to include the party_id and party_id_internal columns. This removes the need for separate entries on the ORDER_ROLE table.
14 Jul 2010 Deleted the ORDER_NOTES and NON_CONFORMANCE_NOTES tables, which have been replaced by the PARTY_NOTES table.
08 Dec 2009 Added the ORDER_PAYMENT_GATEWAY table.
04 Dec 2009 Removed the ORDER_INVOICE_LINK table. This is because an invoice can only be related to a single order, and the order id is held on the INVOICE_HEADER record.
Added the ORDER_EXTRA_NAMES and ORDER_EXTRA_VALUES tables.
20 Oct 2009 Added the ORDER_PAYMENT_STATUS table.
05 Feb 2009 Updated the ORDER_PAYMENT table by adding the cardholder column.
23 Dec 2008 Updated the ORDER_PAYMENT table by adding the gateway and gateway_data columns.
09 Dec 2008 Added the RESERVED_ITEM table (moved from the INVENTORY database).
15 Sep 2008 Added the DISCOUNT_CODE table.
06 Aug 2008 Updated the ORDER_HEADER table by adding the earliest_ship_date column.
28 Jun 2008 Updated the ORDER_STATUS_TYPE table by adding the following columns:
  • email_template and email_auto
Updated the ORDER_ITEM_STATUS_TYPE table by adding the following columns:
  • email_template and email_auto
Updated the ORDER_STATUS_HIST table by adding the email_datetime column.
Updated the ORDER_ITEM_STATUS_HIST table by adding the email_datetime column.
26 Jun 2008 Updated the ORDER_ITEM_STATUS_HIST table by adding the status_comment column.
25 Jun 2008 Updated the ORDER_STATUS_HIST table by adding the status_comment column.
Updated the ORDER_HEADER table by adding the order_status_type_id column.
06 Jun 2008 Updated the ORDER_ITEM_FEATURE table by adding the is_hidden column.
Added the PURCHASE_ORDER_BUILD table
24 Mar 2008 Updated the ORDER_PAYMENT table by adding the following columns:
  • ThreeDSecureStatus, CAVV and GiftAid
09 Mar 2008 Updated the ORDER_PAYMENT table by adding the following columns:
  • ShippingAddress and ShippingPostCode
  • maxmind_err, maxmind_explanation, maxmind_score, maxmind_risk_score and maxmind_data
20 Feb 2008 Updated the ORDER_ITEM table by adding the supplier_part_no column.
08 Feb 2008 Updated the ORDER_ITEM_STATUS_TYPE table by adding switches is_purchase_order and is_sales_order.
21 Dec 2007 Added the NON_CONFORMANCE_STATUS table.
Added the NON_CONFORMANCE_REPORT table.
Added the NON_CONFORMANCE_NOTES table.
09 Dec 2007 Updated the ORDER_STATUS_TYPE table by adding switches is_purchase_order, is_sales_order, is_transfer_order and is_shipment.
11 Nov 2007 Updated the ORDER_STATUS_TYPE table by adding order_status_group.
06 Nov 2007 Updated the ORDER_HEADER table as follows:
  • replaced address_id_primary with contact_mech_id_primary
  • replaced address_id_delivery with contact_mech_id_delivery
  • added contact_name_delivery
Updated the ORDER_ADJUSTMENT_TYPE table by adding is_manual.
Updated the ITEM_ADJUSTMENT_TYPE table by adding is_manual.
Updated the ORDER_ITEM_FEATURE table by adding feature_customisation.

Copyright © 1999-2023 by Geoprise Technologies Licensing, All Rights Reserved.