This page contains technical detail about the physical database structure. It is not required for normal day to day operation of the Point Of Sale.
Overview
This table holds individual payments relating to a sale. It is a child of the sales table. Not all payment lines in this table alter the outstanding to pay amount on a sale. Some payment types and codes hold records of payments that were attempted but did not succeed.
Mesh
On mesh configured systems, this table is maintained as an output
Columns
FieldName | Datatype | Meta Info | Gnap | Description |
sid | long | 100/E | Internal sale number allocated to this sale. References Sales.sid | |
type | long | 101/E | Coded number indicating the type of payment. | |
amount | money | 102/s | Amount of this payment. Signs of payments are dependant of payment types definition. | |
amount2 | money | 118/s | Effective amount of this payment. Provided for report writers to simplify SQL. This holds the sign corrected amounts, such that "select sid,sum(amount2) from payments group by sid" | |
eftpos_id | long | 103/E | The link to eftpos payment information, typically via the STAN field. STAN is not unique and can be repeated on different terminals | |
datetime | date | 104/s | Date and time the payment was applied to the sale | |
sequence | long | 105/E | ||
rid | long | 106/E | ||
authcode | string:24,zerolen | 107/s | ||
foreignamount | money | 108/s | ||
foreignrate | string | 109/s | ||
cardnum | string(24 | 110/s | ||
cardname | string(32 | 111/s | ||
relatedtype | long | 112/E | ||
bartercardexp | string | 113/s | ||
externalref | string 82 | 114/s | Holds a reference number to an external payment provider. | |
SvcAccid | long | 115/E | The Prepay card account this payment references, if this payment was made by a prepay card | |
dayseqnum | long | 116/E | ||
physkey | string:44,zerolen | 117/s | Unique key for this record |
Indexing
The primary key on this table is sid,sequence
The field physkey does not currently require an index as access to this table is usually via the sid field.