SALESORDERPAYMENT

Stores payments for a sales order.

Primary Key

Primary Key Field Type
ID uniqueidentifier

Fields

Field Field Type Null Notes Description
DATEADDED datetime Default = getdate() Indicates the date this record was added.
DATECHANGED datetime Default = getdate() Indicates the date this record was last changed.
TS timestamp Timestamp.
TSLONG bigint (Computed) yes CONVERT(bigint, TS) Numeric representation of the timestamp.
AMOUNTTENDERED money Default = 0 The amount tendered for this payment.
AMOUNT money Default = 0 The actual amount of the payment.
CHANGEDUE money Default = 0 The change due for this payment.
PAYMENTDATEWITHTIMEOFFSET datetimeoffset yes The date the payment was made with time zone awareness.
DONOTRECONCILE bit Default = 0 Determines whether the payment should be reconciled.
DEPOSITED bit Default = 0

Foreign Keys

Foreign Key Field Type Null Notes Description
SALESORDERID uniqueidentifier SALESORDER.ID The sales order record for this payment.
PAYMENTID uniqueidentifier FINANCIALTRANSACTION.ID The payment record for this sales order.
ADDEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.
CHANGEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.
RECONCILIATIONID uniqueidentifier yes RECONCILIATION.ID The reconciliation record for this payment.
APPUSERID uniqueidentifier yes APPUSER.ID The application user who entered the payment.

Indexes

Index Name Fields Unique Primary Clustered
IX_SALESORDERPAYMENT_APPUSERID APPUSERID
IX_SALESORDERPAYMENT_DATEADDED DATEADDED yes
IX_SALESORDERPAYMENT_DATECHANGED DATECHANGED
IX_SALESORDERPAYMENT_PAYMENTID PAYMENTID
IX_SALESORDERPAYMENT_RECONCILIATIONID RECONCILIATIONID
IX_SALESORDERPAYMENT_SALESORDERID SALESORDERID
PK_SALESORDERPAYMENT ID yes yes

Triggers

Trigger Name Description
TR_SALESORDERPAYMENT_AUDIT_UPDATE
TR_SALESORDERPAYMENT_AUDIT_DELETE