Sales.Invoices
Documentation | WideWorldImporters |
Schema | Sales |
Name | Invoices |
Module | Sales |
Columns
Key | Name | Data type | Null | Attributes | References | Description | ||
---|---|---|---|---|---|---|---|---|
1 | InvoiceID | int | Default: NEXT VALUE FOR [Sequences].[InvoiceID] | Numeric ID used for reference to an invoice within the database | ||||
Numeric ID used for reference to an invoice within the database Default: NEXT VALUE FOR [Sequences].[InvoiceID] |
||||||||
2 | CustomerID | int | Sales.Customers | Customer for this invoice | ||||
Customer for this invoice References: Sales.Customers |
||||||||
3 | BillToCustomerID | int | Sales.Customers | Bill to customer for this invoice (invoices might be billed to a head office) | ||||
Bill to customer for this invoice (invoices might be billed to a head office) References: Sales.Customers |
||||||||
4 | OrderID | int | Sales.Orders | Sales order (if any) for this invoice | ||||
Sales order (if any) for this invoice References: Sales.Orders |
||||||||
5 | DeliveryMethodID | int | Application.DeliveryMethods | How these stock items are beign delivered | ||||
How these stock items are beign delivered References: Application.DeliveryMethods |
||||||||
6 | ContactPersonID | int | Application.People | Customer contact for this invoice | ||||
Customer contact for this invoice References: Application.People |
||||||||
7 | AccountsPersonID | int | Application.People | Customer accounts contact for this invoice | ||||
Customer accounts contact for this invoice References: Application.People |
||||||||
8 | SalespersonPersonID | int | Application.People | Salesperson for this invoice | ||||
Salesperson for this invoice References: Application.People |
||||||||
9 | PackedByPersonID | int | Application.People | Person who packed this shipment (or checked the packing) | ||||
Person who packed this shipment (or checked the packing) References: Application.People |
||||||||
10 | InvoiceDate | date | Date that this invoice was raised | |||||
Date that this invoice was raised |
||||||||
11 | CustomerPurchaseOrderNumber | nvarchar(20) | Purchase Order Number received from customer | |||||
Purchase Order Number received from customer |
||||||||
12 | IsCreditNote | bit | Is this a credit note (rather than an invoice) | |||||
Is this a credit note (rather than an invoice) |
||||||||
13 | CreditNoteReason | nvarchar(MAX) | Reason that this credit note needed to be generated (if applicable) | |||||
Reason that this credit note needed to be generated (if applicable) |
||||||||
14 | Comments | nvarchar(MAX) | Any comments related to this invoice (sent to customer) | |||||
Any comments related to this invoice (sent to customer) |
||||||||
15 | DeliveryInstructions | nvarchar(MAX) | Any comments related to delivery (sent to customer) | |||||
Any comments related to delivery (sent to customer) |
||||||||
16 | InternalComments | nvarchar(MAX) | Any internal comments related to this invoice (not sent to the customer) | |||||
Any internal comments related to this invoice (not sent to the customer) |
||||||||
17 | TotalDryItems | int | Total number of dry packages (information for the delivery driver) | |||||
Total number of dry packages (information for the delivery driver) |
||||||||
18 | TotalChillerItems | int | Total number of chiller packages (information for the delivery driver) | |||||
Total number of chiller packages (information for the delivery driver) |
||||||||
19 | DeliveryRun | nvarchar(5) | Delivery run for this shipment | |||||
Delivery run for this shipment |
||||||||
20 | RunPosition | nvarchar(5) | Position in the delivery run for this shipment | |||||
Position in the delivery run for this shipment |
||||||||
21 | ReturnedDeliveryData | nvarchar(MAX) | JSON-structured data returned from delivery devices for deliveries made directly by the organization | |||||
JSON-structured data returned from delivery devices for deliveries made directly by the organization |
||||||||
22 | ConfirmedDeliveryTime | datetime2(7) | Computed: TRY_CONVERT([datetime2](7),json_value([ReturnedDeliveryData],N'$.DeliveredWhen'),(126)) | Confirmed delivery date and time promoted from JSON delivery data | ||||
Confirmed delivery date and time promoted from JSON delivery data Computed: TRY_CONVERT([datetime2](7),json_value([ReturnedDeliveryData],N'$.DeliveredWhen'),(126)) |
||||||||
23 | ConfirmedReceivedBy | nvarchar(4000) | Computed: json_value([ReturnedDeliveryData],N'$.ReceivedBy') | Confirmed receiver promoted from JSON delivery data | ||||
Confirmed receiver promoted from JSON delivery data Computed: json_value([ReturnedDeliveryData],N'$.ReceivedBy') |
||||||||
24 | LastEditedBy | int | Application.People | |||||
References: Application.People | ||||||||
25 | 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.Invoices | Sales.Customers | Sales.Invoices.CustomerID = Sales.Customers.CustomerID | FK_Sales_Invoices_CustomerID_Sales_Customers Foreign key constraint referencing Customers.CustomerID |
|
Sales.Invoices.CustomerID = Sales.Customers.CustomerID Name: FK_Sales_Invoices_CustomerID_Sales_CustomersForeign key constraint referencing Customers.CustomerID |
||||
Sales.Invoices | Sales.Customers | Sales.Invoices.BillToCustomerID = Sales.Customers.CustomerID | FK_Sales_Invoices_BillToCustomerID_Sales_Customers Foreign key constraint referencing Customers.CustomerID |
|
Sales.Invoices.BillToCustomerID = Sales.Customers.CustomerID Name: FK_Sales_Invoices_BillToCustomerID_Sales_CustomersForeign key constraint referencing Customers.CustomerID |
||||
Sales.Invoices | Application.DeliveryMethods | Sales.Invoices.DeliveryMethodID = Application.DeliveryMethods.DeliveryMethodID | FK_Sales_Invoices_DeliveryMethodID_Application_DeliveryMethods Foreign key constraint referencing DeliveryMethods.DeliveryMethodID |
|
Sales.Invoices.DeliveryMethodID = Application.DeliveryMethods.DeliveryMethodID Name: FK_Sales_Invoices_DeliveryMethodID_Application_DeliveryMethodsForeign key constraint referencing DeliveryMethods.DeliveryMethodID |
||||
Sales.Invoices | Sales.Orders | Sales.Invoices.OrderID = Sales.Orders.OrderID | FK_Sales_Invoices_OrderID_Sales_Orders Foreign key constraint referencing Orders.OrderID |
|
Sales.Invoices.OrderID = Sales.Orders.OrderID Name: FK_Sales_Invoices_OrderID_Sales_OrdersForeign key constraint referencing Orders.OrderID |
||||
Sales.Invoices | Application.People | Sales.Invoices.PackedByPersonID = Application.People.PersonID | FK_Sales_Invoices_PackedByPersonID_Application_People Foreign key constraint referencing People.PersonID |
|
Sales.Invoices.PackedByPersonID = Application.People.PersonID Name: FK_Sales_Invoices_PackedByPersonID_Application_PeopleForeign key constraint referencing People.PersonID |
||||
Sales.Invoices | Application.People | Sales.Invoices.SalespersonPersonID = Application.People.PersonID | FK_Sales_Invoices_SalespersonPersonID_Application_People Foreign key constraint referencing People.PersonID |
|
Sales.Invoices.SalespersonPersonID = Application.People.PersonID Name: FK_Sales_Invoices_SalespersonPersonID_Application_PeopleForeign key constraint referencing People.PersonID |
||||
Sales.Invoices | Application.People | Sales.Invoices.AccountsPersonID = Application.People.PersonID | FK_Sales_Invoices_AccountsPersonID_Application_People Foreign key constraint referencing People.PersonID |
|
Sales.Invoices.AccountsPersonID = Application.People.PersonID Name: FK_Sales_Invoices_AccountsPersonID_Application_PeopleForeign key constraint referencing People.PersonID |
||||
Sales.Invoices | Application.People | Sales.Invoices.LastEditedBy = Application.People.PersonID | FK_Sales_Invoices_Application_People Foreign key constraint referencing People.PersonID |
|
Sales.Invoices.LastEditedBy = Application.People.PersonID Name: FK_Sales_Invoices_Application_PeopleForeign key constraint referencing People.PersonID |
||||
Sales.Invoices | Application.People | Sales.Invoices.ContactPersonID = Application.People.PersonID | FK_Sales_Invoices_ContactPersonID_Application_People Foreign key constraint referencing People.PersonID |
|
Sales.Invoices.ContactPersonID = Application.People.PersonID Name: FK_Sales_Invoices_ContactPersonID_Application_PeopleForeign key constraint referencing People.PersonID |
||||
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.InvoiceLines | Sales.Invoices | Sales.InvoiceLines.InvoiceID = Sales.Invoices.InvoiceID | FK_Sales_InvoiceLines_InvoiceID_Sales_Invoices Foreign key constraint referencing Invoices.InvoiceID |
|
Sales.InvoiceLines.InvoiceID = Sales.Invoices.InvoiceID Name: FK_Sales_InvoiceLines_InvoiceID_Sales_InvoicesForeign key constraint referencing Invoices.InvoiceID |
||||
Warehouse.StockItemTransactions | Sales.Invoices | Warehouse.StockItemTransactions.InvoiceID = Sales.Invoices.InvoiceID | FK_Warehouse_StockItemTransactions_InvoiceID_Sales_Invoices Foreign key constraint referencing Invoices.InvoiceID |
|
Warehouse.StockItemTransactions.InvoiceID = Sales.Invoices.InvoiceID Name: FK_Warehouse_StockItemTransactions_InvoiceID_Sales_InvoicesForeign key constraint referencing Invoices.InvoiceID |
Unique keys
Key name | Columns | Description | |
---|---|---|---|
PK_Sales_Invoices | InvoiceID | Primary key (clustered) constraint. | |
Primary key (clustered) constraint. |
Uses
Used by
Name |
---|
Sales.Invoices
|
Exported: 2019-02-04 23:04, Last imported: 2018-08-10 09:51