PAYMENTTERM

Payment Term

Primary Key

Primary Key Field Type
ID uniqueidentifier

Fields

Field Field Type Null Notes Description
NAME nvarchar(20) Default = '' Name of the payment term
DESCRIPTION nvarchar(100) Default = '' Description of the payment term
INCLUDEDISCOUNT bit Default = 0 True if the payment term includes a discount
DISCOUNTPERCENT decimal(20, 4) Default = 0.0 Discount applied when discount terms are met
DISCOUNTDAYS smallint Default = ((0)) Number of days the payment needs to be made for the discount terms to be applied
PAYMENTDUECODE tinyint Default = 0 Selects how the due date of the payment is represented
PAYMENTDUE nvarchar(12) (Computed) yes CASE [PAYMENTDUECODE] WHEN 0 THEN N'Days' WHEN 1 THEN N'Day of month' END Provides a translation for the 'PAYMENTDUECODE' field.
DAYSDUE smallint Default = ((0)) Number of days in which a payment is due. PaymentDueCode must be 'Days'
DAYOFMONTHDUE smallint Default = ((15)) Day of month on which a payment is due. PaymentDue must be 'Day of month'
MONTHDUECODE tinyint Default = 0 Month in which a payment is due
MONTHDUE nvarchar(7) (Computed) yes CASE [MONTHDUECODE] WHEN 0 THEN N'Current' WHEN 1 THEN N'Next' END Provides a translation for the 'MONTHDUECODE' field.
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.

Foreign Keys

Foreign Key Field Type Null Notes Description
ADDEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.
CHANGEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.

Indexes

Index Name Fields Unique Primary Clustered
IX_PAYMENTTERM_DATEADDED DATEADDED yes
IX_PAYMENTTERM_DATECHANGED DATECHANGED
PK_PAYMENTTERM ID yes yes
UIX_PAYMENTTERM_NAME NAME yes

Triggers

Trigger Name Description
TR_PAYMENTTERM_AUDIT_UPDATE
TR_PAYMENTTERM_AUDIT_DELETE

Referenced by

Referenced by Field
VENDOR PAYMENTTERMID