Home > Technical > Table Definitions > CUSTORDERHDR

CUSTORDERHDR

When a POS transaction is placed on hold, or a customer order/ layby is saved, the details are stored in the CUSTORDERHDR, CUSTORDERITEM and CUSTORDERTENDER tables. CUSTORDERHDR contains the header details for the transaction. Many of the fields are similar to those stored in DAILYSALES.

When a web order is imported through B2B it is logged in the BE database with unique values in both DAILYSALES and CUSTORDERHDR tables - to prevent clashes with orders initiated at the POS or through the back office order function.

For an order at the POS -

nextrec INTTRANS is used for CTRCODE in CUSTORDERHDR
sale ID from DYNAMIC.INI is used for INTSALEID in both DAILYSALES and CUSTORDERHDR
nextrec SALESTRANS value is used in DAILYSALES INTORDERCODE

For a back office order -

nextrec INTTRANS is used for CTRCODE in CUSTORDERHDR
sale ID from DYNAMIC.INI is used for INTSALEID in both DAILYSALES and CUSTORDERHDR
nextrec SALESTRANS value is used in DAILYSALES INTORDERCODE
nextrec BOORDER is used for CTRCODE in BOORDERHDR

For an imported web order -

nextrec POSTRANS is used for CTRCODE in CUSTORDERHDR
nextrec INTTRANS is used for INTSALEID in DAILYSALES and CUSTORDERHDR
nextrec SALESTRANS value is used in DAILYSALES INTORDERCODE

Column

Type

Description

CTRCODE

BIGINT

A unique number assigned by the system. This will eventually be stored in DAILYSALES.INTTRANSNUM.

STRTYPE

VARCHAR(10)

Status of a customer order:

ORDER

Items have been entered. There may also have been partial payments but there is an outstanding balance due.

PORDER

Items have been entered and fully paid for but the goods have not been released to the customer.

CORDER

The order is complete that is all items have been paid for and released to the customer.

XORDER

Cancelled order.

SALE

This is a held POS transaction.

LAYBY

Lay by transaction.

CLAYBY

Completed lay by.

XLAYBY

Cancelled lay by.

QUOTE

Quote transaction.

CQUOTE

Completed quote.

XQUOTE

Cancelled quote.

INTSALEID

INT

The receipt number for the transaction, if any.

INTTILLCODE

INT

The number of the till where the transaction was last saved.

TILL.INTTILLCODE

INTOPERATORID

INT

The number of the operator who last saved the sale.
USERCODE.intUserCode

DTMSALEDATETIME

DATETIME

The date/time of the transaction. For a Layby, Quote, Order, COD, Service, Paid Order or Booking, this is the date the transaction was last opened and saved.

For other transactions this is the date the transaction was originally saved.

CURSALES

DECIMAL(19,4)

The total value of sales. If the sell price included tax, then curSales will also include tax (unlike DAILYSALES where it is excluded).

DBLMEMBERID

DECIMAL(19,4)

Not used.

STRTABLE

VARCHAR(20)

The table number or reference for this transaction.

YSNCALCULATED

VARCHAR(1)

Set to 'T' if the discount logic has been applied to the transaction.

CURCOMMLEVEL

DECIMAL(19,4)

Not used.

STRNAME

VARCHAR(100)

Not used.

STRADDR1

VARCHAR(50)

Not used.

STRADDR2

VARCHAR(50)

Not used.

STRCITY

VARCHAR(50)

Not used.

STRSTATE

VARCHAR(20)

Not used.

STRPOSTCODE

VARCHAR(15)

Not used.

STRCOUNTRY

VARCHAR(50)

Not used.

STRPHONE

VARCHAR(20)

Not used.

STREMAIL

VARCHAR(60)

Not used.

DTMCREATED

DATETIME

The trading date the transaction was created.

STRSTATUS

VARCHAR(10)

The status of the transaction:

SAVE

A customer order/layby that has been saved for later use.

HELD

A sale transaction has been temporarily held. Also used for table transactions.

INT

Interrupted sales.

SCRIPT

Sale transactions that have come from the pharmacy interface.

FINAL

A customer order/layby that has been cancelled or finalised. Usually a held transaction is deleted immediately but we hold on to the order type trans for history and reporting purposes.

LINTCONTACTNUM

INT

Not used.

STRPONUMBER

VARCHAR(50)

The customer's PO# for this order.

DTMVALIDQUOTE

DATETIME

The date to which the quote transaction is valid. The date by which a customer order is required.

YSNDELIVERYPRINTED

VARCHAR(1)

'T' if the delivery notice has been printed.

DTMTAXINVOICE

DATETIME

The date of the tax invoice. Usually only paid orders have a tax invoice date as its the only transaction which has had finalised payments.

CURSALESDISCOUNT

DECIMAL(19,4)

The total value of sale discounts.

LINTCUSTOMERNUM

INT

The number of the customer to which this order belongs.

YSNLOCKED

VARCHAR(1)

No longer used.

INTCOVERS

INT

The number of covers (people) on the transaction.

INTREASONCODE

INT

The reason code used for return transactions.

DTMRECEIVED

DATETIME

The date the stock was received for this order.

STRSOURCE

VARCHAR(5)

The type of transaction that the stock was received, for example GR=Goods Receipt.

LINTREFERENCE

INT

The number of the inventory transaction that the stock was received, for example goods receipt number.

STRCARDNUM

VARCHAR(38)

The card number of the customer. Only required if the customer number is not known.

STRTRADECODE

VARCHAR(10)

The code of the location where the transaction was last saved.

TRADUNIT.strTradeCode

YSNTRAINING

VARCHAR(1)

'T' if the transaction was made in training mode.

INTORDERMETHOD

INT

Indicates how the item should be ordered. Not sure if used anymore?

STRCUSTTAXNUM

VARCHAR(20)

The customer's tax number. Only used in some countries.

STRPREPRINTSALEID

VARCHAR(20)

The preprint sale ID for the transaction (used in Taiwan).

STRLOCKTILL

VARCHAR(10)

The code of the till that currently has this transaction open. When the transaction is not in use, this will be empty.

LINTORIGTRANS

BIGINT

The transaction number of the original transaction. Used on return transactions to indicate the original transaction.

STRREPLTRADECODE

VARCHAR(10)

Not used in standard system. Some sites may use it to add replication in which case it would be set by a trigger.

DTMVALIDSTART

DATETIME

Valid start date for booking transactions.

DTMVALIDEND

DATETIME

Valid end date for booking transactions.

INTSALESMETHOD

INT

The sales method used for the transaction.

SALESMETHOD.INTCODE

DTMLASTUPDATEDTIME

DATETIME

The date/time the transaction was last updated.

DTMCREATEDTIME

DATETIME

The date/time the transaction was originally created.

INTAUTHORISEUSER

INT

The number of the user who authorised a transaction wide event, for example cancel sale.

USERCODE.INTUSERCODE

 

Primary Key: CTRCODE

Converted from CHM to HTML with chm2web Pro 2.85 (unicode)