Fieldpine Logo Documentation Home  

Salelines PHYSICAL Table Structure

This page contains technical detail about the physical database structure. This documentation is not required for normal day to day operation of the Point Of Sale.

Overview

This table holds individual items purchased on a sale. It is a child of the sales table. Salelines may be present for other structures that arent technically sales (such as writeoffs in progress) as it also holds details of any open sale being used at counters

Mesh

On mesh configured systems, this table is maintained as an output

Columns

FieldNameDatatypeMeta InfoGnapDescription
sidlong105/EInternal sale number allocated to this sale. References Sales.sid
pidlong106/EThe internal product number of the item sold.
qtylong101/EQuantity of item sold, in measurement units, which is often "units" or "grams"
unitpricemoney107/s
totalpricemoney102/sTotal price charged to customer
pidflaglong108/E Indicates what type of item is being stored in this row.
CodeDescription
0Item is a product that can be found in the products table
2Item is a product that can be found in the products table
4
5Item is a modifier
10000, 10002, 10005Item is cancelled/void etc and not visible to customer.
ridlong109/E
discid_1long110/E
discid_2long111/E
disc_1_pmoney112/s
disc_2_pmoney113/s
seqncelong114/EAn ordinal sequence number for this saleline. Used to place salelines in order they were created
qtyflagslong115/E
kitchenprintedstring116/s
fueldispenserlong117/EThe pump/dispenser this item came from for integrated fuel controllers.
fueltrantypelong118/E
fueltrannumlong119/E
serialnochar(32)104/s
linesourcelong120/EHow this item came to be recognised and added to the sale
CodeDescription
1Was scanned by barcode
2Manually entered barcode (the staff physically keyed in the number)
3Item was selected from a product finder screen
4Sold using LED style controls on User Interface (typically selling by keying PLU)
5Treat as 4 above
6Treat as 4 above
pricecauselong121/E This field holds a reason for the price being derived. Not all pricing techniques will store a cause reason. The following codes are defined.
CodeDescriptionPriceCauseData
0 or NULLNo information recorded
1Special offer handlingofferid
2Reward Programprogramid
3Kits/Combokitid (reference to kit definition, typically Productkits table)
4QtyDiscountsqid
5Global store wide discounts
6DiscountsManual applied
7PriceMaps entry. (P1547)pmid
8Customer discount percentage applied.Percentage used times 100
9Price was set via PosCommand directlyPrice set
10Discount applieddiscid
11Discount Voucher applied
12User manually set price
Where multiple price changes occur on an item, only the last cause will be stored. Which change is "last" may change without warning.
pricecausedatalong122/EAdditional key information for the pricecause field.
linetaxflagslong123/E
pvariantlong124/E
histtaxrate1long125/E
histtaxrate2long126/E
changereasonchar(64)127/sDescriptive message entered by staff member as to why this saleline was editted. Capturing change reasons needs to be enabled specifically.
tax_totincmoney128/sTotal price charged to customer, including all relevant taxes
tax_totexmoney129/sTotal price charged to customer, excluding all relevant taxes
tax_tr1money130/sTotal amount of Tax #1
tax_tr2money131/sTotal amount of Tax #2
tax_tr3money132/sTotal amount of Tax #3
linelocationlong133/E
slcdtdate134/s
physkeystringUnique Physical key of this saleline
trackedidstringReference to the exact item if tracked items are being used
qtyqohnumberInternal use only. Used to maintain stock levels where sales are fully distributed and visible at all sites all the time
regnostringContains a vehicle registration number if this item relates to a vehicle
commentscuststringLine specific comments that are considered safe to show customers and are intended for customers
commentsintstringLine specific customers that are NOT to be shown to customers and are reserved for retailer staff
picktidnumberUser id who claimed to pick this item for web fulfilment
pickqtynumberAmount actually picked, which can differ to customers order quantity
picktotalpricemoneyTotal price to charge after picking.

Indexing

The primary key on this table is sid,seqnce. The field physkey is also a unique key, if present, although historic records may not contain values for this field

Reporting servers often add an index on pid to speed reports that select by product