WideWorldImporters
Sales.Invoices
//
Details of customer invoices
Created: Modified:
Columns
-
//${escapify(column.description)}[int] NOT NULL DEFAULT (NEXT VALUE FOR [Sequences].[InvoiceID])
-
//${escapify(column.description)}[int] NOT NULL
-
//${escapify(column.description)}[int] NOT NULL
-
//${escapify(column.description)}[int] NULL
-
//${escapify(column.description)}[int] NOT NULL
-
//${escapify(column.description)}[int] NOT NULL
-
//${escapify(column.description)}[int] NOT NULL
-
//${escapify(column.description)}[int] NOT NULL
-
//${escapify(column.description)}[int] NOT NULL
-
//${escapify(column.description)}[date] NOT NULL
-
//${escapify(column.description)}[nvarchar](20) NULL
-
//${escapify(column.description)}[bit] NOT NULL
-
//${escapify(column.description)}[nvarchar](MAX) NULL
-
//${escapify(column.description)}[nvarchar](MAX) NULL
-
//${escapify(column.description)}[nvarchar](MAX) NULL
-
//${escapify(column.description)}[nvarchar](MAX) NULL
-
//${escapify(column.description)}[int] NOT NULL
-
//${escapify(column.description)}[int] NOT NULL
-
//${escapify(column.description)}[nvarchar](5) NULL
-
//${escapify(column.description)}[nvarchar](5) NULL
-
//${escapify(column.description)}[nvarchar](MAX) NULL//CONSTRAINT([ReturnedDeliveryData] IS NULL OR isjson([ReturnedDeliveryData])<>(0))
-
//${escapify(column.description)}[datetime2](8) NULL
-
//${escapify(column.description)}[nvarchar](4000) NULL
-
[int] NOT NULL
-
[datetime2](8) NOT NULL DEFAULT (sysdatetime())
Indexes
-
PK_Sales_InvoicesUNIQUE CLUSTEREDInvoiceID
-
//Auto-created to support a foreign keyFK_Sales_Invoices_CustomerIDNONCLUSTEREDCustomerID
-
//Auto-created to support a foreign keyFK_Sales_Invoices_BillToCustomerIDNONCLUSTEREDBillToCustomerID
-
//Auto-created to support a foreign keyFK_Sales_Invoices_OrderIDNONCLUSTEREDOrderID
-
//Auto-created to support a foreign keyFK_Sales_Invoices_DeliveryMethodIDNONCLUSTEREDDeliveryMethodID
-
//Auto-created to support a foreign keyFK_Sales_Invoices_ContactPersonIDNONCLUSTEREDContactPersonID
-
//Auto-created to support a foreign keyFK_Sales_Invoices_AccountsPersonIDNONCLUSTEREDAccountsPersonID
-
//Auto-created to support a foreign keyFK_Sales_Invoices_SalespersonPersonIDNONCLUSTEREDSalespersonPersonID
-
//Auto-created to support a foreign keyFK_Sales_Invoices_PackedByPersonIDNONCLUSTEREDPackedByPersonID
-
//Allows quick retrieval of invoices confirmed to have been delivered in a given time periodIX_Sales_Invoices_ConfirmedDeliveryTimeNONCLUSTEREDConfirmedDeliveryTime , ConfirmedReceivedBy
Foreign Keys
-
FK_Sales_Invoices_AccountsPersonID_Application_PeopleApplication.PeopleAccountsPersonID ⥱ PersonID
-
FK_Sales_Invoices_Application_PeopleApplication.PeopleLastEditedBy ⥱ PersonID
-
FK_Sales_Invoices_BillToCustomerID_Sales_CustomersSales.CustomersBillToCustomerID ⥱ CustomerID
-
FK_Sales_Invoices_ContactPersonID_Application_PeopleApplication.PeopleContactPersonID ⥱ PersonID
-
FK_Sales_Invoices_CustomerID_Sales_CustomersSales.CustomersCustomerID ⥱ CustomerID
-
FK_Sales_Invoices_DeliveryMethodID_Application_DeliveryMethodsApplication.DeliveryMethodsDeliveryMethodID ⥱ DeliveryMethodID
-
FK_Sales_Invoices_OrderID_Sales_OrdersSales.OrdersOrderID ⥱ OrderID
-
FK_Sales_Invoices_PackedByPersonID_Application_PeopleApplication.PeoplePackedByPersonID ⥱ PersonID
-
FK_Sales_Invoices_SalespersonPersonID_Application_PeopleApplication.PeopleSalespersonPersonID ⥱ PersonID
Sample Data
InvoiceID
CustomerID
BillToCustomerID
OrderID
DeliveryMethodID
ContactPersonID
AccountsPersonID
SalespersonPersonID
PackedByPersonID
InvoiceDate
CustomerPurchaseOrderNumber
IsCreditNote
CreditNoteReason
Comments
DeliveryInstructions
InternalComments
TotalDryItems
TotalChillerItems
DeliveryRun
RunPosition
ReturnedDeliveryData
ConfirmedDeliveryTime
ConfirmedReceivedBy
LastEditedBy
LastEditedWhen
1
832
832
1
3
3032
3032
2
14
12126
NULL
NULL
NULL
Suite 24, 1345 Jun Avenue
NULL
1
NULL
NULL
NULL
{"Events": [{ "Event":"Ready for collection","EventTime":"2013-01-01T12:00:00","ConNote":"EAN-125-1051"},{ "Event":"DeliveryAttempt","EventTime":"2013-01-02T07:05:00","ConNote":"EAN-125-1051","DriverID":15,"Latitude":41.3617214,"Longitude":-81.4695602,"Status":"Delivered"}],"DeliveredWhen":"2013-01-02T07:05:00","ReceivedBy":"Aakriti Byrraju"}
Aakriti Byrraju
15
2
803
803
2
3
3003
3003
8
14
15342
NULL
NULL
NULL
Unit 7, 844 Magnusson Lane
NULL
2
NULL
NULL
NULL
{"Events": [{ "Event":"Ready for collection","EventTime":"2013-01-01T12:00:00","ConNote":"EAN-125-1052"},{ "Event":"DeliveryAttempt","EventTime":"2013-01-02T07:10:00","ConNote":"EAN-125-1052","DriverID":15,"Latitude":40.8657308,"Longitude":-120.4602262,"Status":"Delivered"}],"DeliveredWhen":"2013-01-02T07:10:00","ReceivedBy":"Bala Dixit"}
Bala Dixit
15
3
105
1
3
3
1209
1001
7
14
12211
NULL
NULL
NULL
Unit 60, 1158 Hrastovsek Boulevard
NULL
1
NULL
NULL
NULL
{"Events": [{ "Event":"Ready for collection","EventTime":"2013-01-01T12:00:00","ConNote":"EAN-125-1053"},{ "Event":"DeliveryAttempt","EventTime":"2013-01-02T07:15:00","ConNote":"EAN-125-1053","DriverID":15,"Latitude":33.4848451,"Longitude":-89.3606259,"Status":"Delivered"}],"DeliveredWhen":"2013-01-02T07:15:00","ReceivedBy":"Sung-Hwan Hwang"}
Sung-Hwan Hwang
15
4
57
1
4
3
1113
1001
16
14
17129
NULL
NULL
NULL
Unit 136, 1331 Dutta Crescent
NULL
3
NULL
NULL
NULL
{"Events": [{ "Event":"Ready for collection","EventTime":"2013-01-01T12:00:00","ConNote":"EAN-125-1054"},{ "Event":"DeliveryAttempt","EventTime":"2013-01-02T07:20:00","ConNote":"EAN-125-1054","DriverID":15,"Latitude":41.0208896,"Longitude":-81.4359458,"Status":"Delivered"}],"DeliveredWhen":"2013-01-02T07:20:00","ReceivedBy":"Aile Mae"}
Aile Mae
15
5
905
905
5
3
3105
3105
3
14
10369
NULL
NULL
NULL
Shop 30, 1476 Poddar Lane
NULL
3
NULL
NULL
NULL
{"Events": [{ "Event":"Ready for collection","EventTime":"2013-01-01T12:00:00","ConNote":"EAN-125-1055"},{ "Event":"DeliveryAttempt","EventTime":"2013-01-02T07:25:00","ConNote":"EAN-125-1055","DriverID":15,"Latitude":45.7849627,"Longitude":-93.5569028,"Status":"Delivered"}],"DeliveredWhen":"2013-01-02T07:25:00","ReceivedBy":"Sara Huiting"}
Sara Huiting
15
6
976
976
6
3
3176
3176
13
14
13383
NULL
NULL
NULL
Suite 6, 244 Lieu Crescent
NULL
3
NULL
NULL
NULL
{"Events": [{ "Event":"Ready for collection","EventTime":"2013-01-01T12:00:00","ConNote":"EAN-125-1056"},{ "Event":"DeliveryAttempt","EventTime":"2013-01-02T07:30:00","ConNote":"EAN-125-1056","DriverID":15,"Latitude":31.1835648,"Longitude":-81.3498179,"Status":"Delivered"}],"DeliveredWhen":"2013-01-02T07:30:00","ReceivedBy":"Alinne Matos"}
Alinne Matos
15
7
575
401
7
3
2349
2001
8
14
17913
NULL
NULL
NULL
Shop 227, 178 Bhogireddy Boulevard
NULL
4
NULL
NULL
NULL
{"Events": [{ "Event":"Ready for collection","EventTime":"2013-01-01T12:00:00","ConNote":"EAN-125-1057"},{ "Event":"DeliveryAttempt","EventTime":"2013-01-02T07:35:00","ConNote":"EAN-125-1057","DriverID":15,"Latitude":42.5422939,"Longitude":-76.6660589,"Status":"Delivered"}],"DeliveredWhen":"2013-01-02T07:35:00","ReceivedBy":"Dattaatraeya Tottempudi"}
Dattaatraeya Tottempudi
15
8
964
964
8
3
3164
3164
7
14
14518
NULL
NULL
NULL
Suite 24, 1300 Sonkar Road
NULL
3
NULL
NULL
NULL
{"Events": [{ "Event":"Ready for collection","EventTime":"2013-01-01T12:00:00","ConNote":"EAN-125-1058"},{ "Event":"DeliveryAttempt","EventTime":"2013-01-02T07:40:00","ConNote":"EAN-125-1058","DriverID":15,"Latitude":28.4624986,"Longitude":-82.1948076,"Status":"Delivered"}],"DeliveredWhen":"2013-01-02T07:40:00","ReceivedBy":"Ingrida Zeltina"}
Ingrida Zeltina
15
9
77
1
9
3
1153
1001
7
14
17577
NULL
NULL
NULL
Unit 176, 1675 Ribeiro Street
NULL
2
NULL
NULL
NULL
{"Events": [{ "Event":"Ready for collection","EventTime":"2013-01-01T12:00:00","ConNote":"EAN-125-1059"},{ "Event":"DeliveryAttempt","EventTime":"2013-01-02T07:45:00","ConNote":"EAN-125-1059","DriverID":15,"Latitude":30.9913064,"Longitude":-83.3726575,"Status":"Delivered"}],"DeliveredWhen":"2013-01-02T07:45:00","ReceivedBy":"Airi Vassiljev"}
Airi Vassiljev
15
10
191
1
10
3
1381
1001
20
14
18030
NULL
NULL
NULL
Suite 169, 946 Reddy Street
NULL
2
NULL
NULL
NULL
{"Events": [{ "Event":"Ready for collection","EventTime":"2013-01-01T12:00:00","ConNote":"EAN-125-1060"},{ "Event":"DeliveryAttempt","EventTime":"2013-01-02T07:50:00","ConNote":"EAN-125-1060","DriverID":15,"Latitude":33.1865071,"Longitude":-84.2113095,"Status":"Delivered"}],"DeliveredWhen":"2013-01-02T07:50:00","ReceivedBy":"Ester Ahmadian"}
Ester Ahmadian
15
11
586
401
11
3
2371
2001
3
14
17639
NULL
NULL
NULL
Shop 204, 167 Kubatova Lane
NULL
1
NULL
NULL
NULL
{"Events": [{ "Event":"Ready for collection","EventTime":"2013-01-01T12:00:00","ConNote":"EAN-125-1061"},{ "Event":"DeliveryAttempt","EventTime":"2013-01-02T07:55:00","ConNote":"EAN-125-1061","DriverID":15,"Latitude":29.1924772,"Longitude":-81.9173071,"Status":"Delivered"}],"DeliveredWhen":"2013-01-02T07:55:00","ReceivedBy":"Anete Kundzina"}
Anete Kundzina
15
12
529
401
12
3
2257
2001
15
14
10941
NULL
NULL
NULL
Suite 270, 1281 Kalejs Crescent
NULL
2
NULL
NULL
NULL
{"Events": [{ "Event":"Ready for collection","EventTime":"2013-01-01T12:00:00","ConNote":"EAN-125-1062"},{ "Event":"DeliveryAttempt","EventTime":"2013-01-02T08:00:00","ConNote":"EAN-125-1062","DriverID":15,"Latitude":32.8706936,"Longitude":-83.4887852,"Status":"Delivered"}],"DeliveredWhen":"2013-01-02T08:00:00","ReceivedBy":"Seo-yeon Rim"}
Seo-yeon Rim
15
13
473
401
13
3
2145
2001
13
14
16374
NULL
NULL
NULL
Suite 203, 229 Cao Lane
NULL
2
NULL
NULL
NULL
{"Events": [{ "Event":"Ready for collection","EventTime":"2013-01-01T12:00:00","ConNote":"EAN-125-1063"},{ "Event":"DeliveryAttempt","EventTime":"2013-01-02T08:05:00","ConNote":"EAN-125-1063","DriverID":15,"Latitude":39.3946303,"Longitude":-120.0213080,"Status":"Delivered"}],"DeliveredWhen":"2013-01-02T08:05:00","ReceivedBy":"Doru Munteanu"}
Doru Munteanu
15
14
870
870
14
3
3070
3070
8
14
17521
NULL
NULL
NULL
Shop 10, 353 Gomes Avenue
NULL
3
NULL
NULL
NULL
{"Events": [{ "Event":"Ready for collection","EventTime":"2013-01-01T12:00:00","ConNote":"EAN-125-1064"},{ "Event":"DeliveryAttempt","EventTime":"2013-01-02T08:10:00","ConNote":"EAN-125-1064","DriverID":15,"Latitude":47.8528740,"Longitude":-122.3334669,"Status":"Delivered"}],"DeliveredWhen":"2013-01-02T08:10:00","ReceivedBy":"In-Su Bae"}
In-Su Bae
15
15
991
991
15
3
3191
3191
3
14
11911
NULL
NULL
NULL
Suite 10, 129 Jo Road
NULL
2
NULL
NULL
NULL
{"Events": [{ "Event":"Ready for collection","EventTime":"2013-01-01T12:00:00","ConNote":"EAN-125-1065"},{ "Event":"DeliveryAttempt","EventTime":"2013-01-02T08:15:00","ConNote":"EAN-125-1065","DriverID":15,"Latitude":41.4353301,"Longitude":-81.6573501,"Status":"Delivered"}],"DeliveredWhen":"2013-01-02T08:15:00","ReceivedBy":"Valter Viiding"}
Valter Viiding
15
16
414
401
16
3
2027
2001
2
14
10690
NULL
NULL
NULL
Unit 212, 1837 Vasiljevic Boulevard
NULL
1
NULL
NULL
NULL
{"Events": [{ "Event":"Ready for collection","EventTime":"2013-01-01T12:00:00","ConNote":"EAN-125-1066"},{ "Event":"DeliveryAttempt","EventTime":"2013-01-02T08:20:00","ConNote":"EAN-125-1066","DriverID":15,"Latitude":39.9342780,"Longitude":-75.3901933,"Status":"Delivered"}],"DeliveredWhen":"2013-01-02T08:20:00","ReceivedBy":"Lan Chu"}
Lan Chu
15
17
910
910
17
3
3110
3110
8
14
10255
NULL
NULL
NULL
Unit 18, 469 Valbe Road
NULL
2
NULL
NULL
NULL
{"Events": [{ "Event":"Ready for collection","EventTime":"2013-01-01T12:00:00","ConNote":"EAN-125-1067"},{ "Event":"DeliveryAttempt","EventTime":"2013-01-02T08:25:00","ConNote":"EAN-125-1067","DriverID":15,"Latitude":29.3791112,"Longitude":-90.2600787,"Status":"Delivered"}],"DeliveredWhen":"2013-01-02T08:25:00","ReceivedBy":"Elina Kaleja"}
Elina Kaleja
15
18
949
949
19
3
3149
3149
7
14
16825
NULL
NULL
NULL
Suite 7, 493 Bjorklund Road
NULL
1
NULL
NULL
NULL
{"Events": [{ "Event":"Ready for collection","EventTime":"2013-01-01T12:00:00","ConNote":"EAN-125-1068"},{ "Event":"DeliveryAttempt","EventTime":"2013-01-02T08:30:00","ConNote":"EAN-125-1068","DriverID":15,"Latitude":28.9685817,"Longitude":-95.4552208,"Status":"Delivered"}],"DeliveredWhen":"2013-01-02T08:30:00","ReceivedBy":"Seo-yun Paik"}
Seo-yun Paik
15
19
973
973
20
3
3173
3173
14
14
12227
NULL
NULL
NULL
Suite 25, 1742 Valbe Avenue
NULL
3
NULL
NULL
NULL
{"Events": [{ "Event":"Ready for collection","EventTime":"2013-01-01T12:00:00","ConNote":"EAN-125-1069"},{ "Event":"DeliveryAttempt","EventTime":"2013-01-02T08:35:00","ConNote":"EAN-125-1069","DriverID":15,"Latitude":39.3034346,"Longitude":-77.9827756,"Comment":"Receiver not present"}],"DeliveredWhen":"2013-01-02T08:35:00","ReceivedBy":"Kumar Kamei"}
Kumar Kamei
15
20
884
884
22
3
3084
3084
13
14
16793
NULL
NULL
NULL
Unit 17, 1957 Nantakarn Avenue
NULL
1
NULL
NULL
NULL
{"Events": [{ "Event":"Ready for collection","EventTime":"2013-01-01T12:00:00","ConNote":"EAN-125-1070"},{ "Event":"DeliveryAttempt","EventTime":"2013-01-02T08:40:00","ConNote":"EAN-125-1070","DriverID":15,"Latitude":39.0350000,"Longitude":-87.0530000,"Status":"Delivered"}],"DeliveredWhen":"2013-01-02T08:40:00","ReceivedBy":"Anindya Ghatak"}
Anindya Ghatak
15
21
173
1
23
3
1345
1001
7
14
12467
NULL
NULL
NULL
Unit 235, 822 Shasthri Road
NULL
3
NULL
NULL
NULL
{"Events": [{ "Event":"Ready for collection","EventTime":"2013-01-01T12:00:00","ConNote":"EAN-125-1071"},{ "Event":"DeliveryAttempt","EventTime":"2013-01-02T08:45:00","ConNote":"EAN-125-1071","DriverID":15,"Latitude":41.5964825,"Longitude":-73.9109700,"Status":"Delivered"}],"DeliveredWhen":"2013-01-02T08:45:00","ReceivedBy":"Raju Atluri"}
Raju Atluri
15
22
890
890
24
3
3090
3090
16
14
13700
NULL
NULL
NULL
Suite 4, 1129 Hulsegge Boulevard
NULL
2
NULL
NULL
NULL
{"Events": [{ "Event":"Ready for collection","EventTime":"2013-01-01T12:00:00","ConNote":"EAN-125-1072"},{ "Event":"DeliveryAttempt","EventTime":"2013-01-02T08:50:00","ConNote":"EAN-125-1072","DriverID":15,"Latitude":27.2164329,"Longitude":-98.0644475,"Status":"Delivered"}],"DeliveredWhen":"2013-01-02T08:50:00","ReceivedBy":"Olya Izmaylov"}
Olya Izmaylov
15
23
189
1
25
3
1377
1001
15
14
11503
NULL
NULL
NULL
Suite 49, 1847 Alladi Street
NULL
3
NULL
NULL
NULL
{"Events": [{ "Event":"Ready for collection","EventTime":"2013-01-01T12:00:00","ConNote":"EAN-125-1073"},{ "Event":"DeliveryAttempt","EventTime":"2013-01-02T08:55:00","ConNote":"EAN-125-1073","DriverID":15,"Latitude":41.2459149,"Longitude":-75.8813075,"Status":"Delivered"}],"DeliveredWhen":"2013-01-02T08:55:00","ReceivedBy":"Sara Charlton"}
Sara Charlton
15
24
873
873
26
3
3073
3073
15
14
13916
NULL
NULL
NULL
Suite 10, 1826 Semjonov Boulevard
NULL
2
NULL
NULL
NULL
{"Events": [{ "Event":"Ready for collection","EventTime":"2013-01-01T12:00:00","ConNote":"EAN-125-1074"},{ "Event":"DeliveryAttempt","EventTime":"2013-01-02T09:00:00","ConNote":"EAN-125-1074","DriverID":15,"Latitude":35.1725399,"Longitude":-107.3689356,"Status":"Delivered"}],"DeliveredWhen":"2013-01-02T09:00:00","ReceivedBy":"Hana Hlouskova"}
Hana Hlouskova
15
25
497
401
27
3
2193
2001
6
14
17783
NULL
NULL
NULL
Shop 144, 1774 Chávez Road
NULL
2
NULL
NULL
NULL
{"Events": [{ "Event":"Ready for collection","EventTime":"2013-01-01T12:00:00","ConNote":"EAN-125-1075"},{ "Event":"DeliveryAttempt","EventTime":"2013-01-02T09:05:00","ConNote":"EAN-125-1075","DriverID":15,"Latitude":34.1092876,"Longitude":-82.2492911,"Status":"Delivered"}],"DeliveredWhen":"2013-01-02T09:05:00","ReceivedBy":"Vitezslav Holy"}
Vitezslav Holy
15