Sales.CustomerTransactions
Documentation | WideWorldImporters |
Schema | Sales |
Name | CustomerTransactions |
Module | Sales |
Columns
Key | Name | Data type | Null | Attributes | References | Description | ||
---|---|---|---|---|---|---|---|---|
1 | CustomerTransactionID | int | Default: NEXT VALUE FOR [Sequences].[TransactionID] | Numeric ID used to refer to a customer transaction within the database | ||||
Numeric ID used to refer to a customer transaction within the database Default: NEXT VALUE FOR [Sequences].[TransactionID] |
||||||||
2 | CustomerID | int | Sales.Customers | Customer for this transaction | ||||
Customer for this transaction References: Sales.Customers |
||||||||
3 | TransactionTypeID | int | Application.TransactionTypes | Type of transaction | ||||
Type of transaction References: Application.TransactionTypes |
||||||||
4 | InvoiceID | int | Sales.Invoices | ID of an invoice (for transactions associated with an invoice) | ||||
ID of an invoice (for transactions associated with an invoice) References: Sales.Invoices |
||||||||
5 | PaymentMethodID | int | Application.PaymentMethods | ID of a payment method (for transactions involving payments) | ||||
ID of a payment method (for transactions involving payments) References: Application.PaymentMethods |
||||||||
6 | TransactionDate | date | Date for the transaction | |||||
Date for the transaction |
||||||||
7 | AmountExcludingTax | decimal(18, 2) | Transaction amount (excluding tax) | |||||
Transaction amount (excluding tax) |
||||||||
8 | TaxAmount | decimal(18, 2) | Tax amount calculated | |||||
Tax amount calculated |
||||||||
9 | TransactionAmount | decimal(18, 2) | Transaction amount (including tax) | |||||
Transaction amount (including tax) |
||||||||
10 | OutstandingBalance | decimal(18, 2) | Amount still outstanding for this transaction | |||||
Amount still outstanding for this transaction |
||||||||
11 | FinalizationDate | date | Date that this transaction was finalized (if it has been) | |||||
Date that this transaction was finalized (if it has been) |
||||||||
12 | IsFinalized | bit | Computed: case when [FinalizationDate] IS NULL then CONVERT([bit],(0)) else CONVERT([bit],(1)) end | Is this transaction finalized (invoices, credits and payments have been matched) | ||||
Is this transaction finalized (invoices, credits and payments have been matched) Computed: case when [FinalizationDate] IS NULL then CONVERT([bit],(0)) else CONVERT([bit],(1)) end |
||||||||
13 | LastEditedBy | int | Application.People | |||||
References: Application.People | ||||||||
14 | LastEditedWhen | datetime2(7) | Default: sysdatetime() | When this row was last edited | ||||
When this row was last edited Default: sysdatetime() |
Relations
Foreign table | Primary table | Join | Title / Name / Description | |
---|---|---|---|---|
Sales.CustomerTransactions | Sales.Customers | Sales.CustomerTransactions.CustomerID = Sales.Customers.CustomerID | FK_Sales_CustomerTransactions_CustomerID_Sales_Customers Foreign key constraint referencing Customers.CustomerID |
|
Sales.CustomerTransactions.CustomerID = Sales.Customers.CustomerID Name: FK_Sales_CustomerTransactions_CustomerID_Sales_CustomersForeign key constraint referencing Customers.CustomerID |
||||
Sales.CustomerTransactions | Sales.Invoices | Sales.CustomerTransactions.InvoiceID = Sales.Invoices.InvoiceID | FK_Sales_CustomerTransactions_InvoiceID_Sales_Invoices Foreign key constraint referencing Invoices.InvoiceID |
|
Sales.CustomerTransactions.InvoiceID = Sales.Invoices.InvoiceID Name: FK_Sales_CustomerTransactions_InvoiceID_Sales_InvoicesForeign key constraint referencing Invoices.InvoiceID |
||||
Sales.CustomerTransactions | Application.PaymentMethods | Sales.CustomerTransactions.PaymentMethodID = Application.PaymentMethods.PaymentMethodID | FK_Sales_CustomerTransactions_PaymentMethodID_Application_PaymentMethods Foreign key constraint referencing PaymentMethods.PaymentMethodID |
|
Sales.CustomerTransactions.PaymentMethodID = Application.PaymentMethods.PaymentMethodID Name: FK_Sales_CustomerTransactions_PaymentMethodID_Application_PaymentMethodsForeign key constraint referencing PaymentMethods.PaymentMethodID |
||||
Sales.CustomerTransactions | Application.People | Sales.CustomerTransactions.LastEditedBy = Application.People.PersonID | FK_Sales_CustomerTransactions_Application_People Foreign key constraint referencing People.PersonID |
|
Sales.CustomerTransactions.LastEditedBy = Application.People.PersonID Name: FK_Sales_CustomerTransactions_Application_PeopleForeign key constraint referencing People.PersonID |
||||
Sales.CustomerTransactions | Application.TransactionTypes | Sales.CustomerTransactions.TransactionTypeID = Application.TransactionTypes.TransactionTypeID | FK_Sales_CustomerTransactions_TransactionTypeID_Application_TransactionTypes Foreign key constraint referencing TransactionTypes.TransactionTypeID |
|
Sales.CustomerTransactions.TransactionTypeID = Application.TransactionTypes.TransactionTypeID Name: FK_Sales_CustomerTransactions_TransactionTypeID_Application_TransactionTypesForeign key constraint referencing TransactionTypes.TransactionTypeID |
Unique keys
Key name | Columns | Description | |
---|---|---|---|
PK_Sales_CustomerTransactions | CustomerTransactionID | Primary key (nonclustered) constraint. | |
Primary key (nonclustered) constraint. |
Uses
Name |
---|
Sales.CustomerTransactions
|
Exported: 2019-02-04 23:04, Last imported: 2018-08-10 09:51