Skip to content

Commit b8de616

Browse files
committed
Added missing fields in suppliers view/procedure
1 parent 19e5287 commit b8de616

2 files changed

Lines changed: 16 additions & 7 deletions

File tree

samples/databases/wide-world-importers/wwi-ssdt/wwi-ssdt/WebApi/Stored Procedures/UpdateSupplierFromJson.sql

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -10,21 +10,21 @@ AS BEGIN
1010
DeliveryCityID = ISNULL(json.DeliveryCityID, Purchasing.Suppliers.DeliveryCityID),
1111
PostalCityID = ISNULL(json.PostalCityID, Purchasing.Suppliers.PostalCityID),
1212
SupplierReference = json.SupplierReference,
13-
BankAccountName = json.BankAccountName,
14-
BankAccountBranch = json.BankAccountBranch,
15-
BankAccountCode = json.BankAccountCode,
16-
BankAccountNumber = json.BankAccountNumber,
13+
BankAccountName = ISNULL(json.BankAccountName, Purchasing.Suppliers.BankAccountName),
14+
BankAccountBranch = ISNULL(json.BankAccountBranch, Purchasing.Suppliers.BankAccountBranch),
15+
BankAccountCode = ISNULL(json.BankAccountCode, Purchasing.Suppliers.BankAccountCode),
16+
BankAccountNumber = ISNULL(json.BankAccountNumber, Purchasing.Suppliers.BankAccountNumber),
1717
BankInternationalCode = json.BankInternationalCode,
1818
PaymentDays = ISNULL(json.PaymentDays, Purchasing.Suppliers.PaymentDays),
19-
InternalComments = json.InternalComments,
19+
InternalComments = ISNULL(json.InternalComments, Purchasing.Suppliers.InternalComments),
2020
PhoneNumber = ISNULL(json.PhoneNumber, Purchasing.Suppliers.PhoneNumber),
2121
FaxNumber = ISNULL(json.FaxNumber, Purchasing.Suppliers.FaxNumber),
2222
WebsiteURL = ISNULL(json.WebsiteURL, Purchasing.Suppliers.WebsiteURL),
2323
DeliveryAddressLine1 = ISNULL(json.DeliveryAddressLine1, Purchasing.Suppliers.DeliveryAddressLine1),
24-
DeliveryAddressLine2 = json.DeliveryAddressLine2,
24+
DeliveryAddressLine2 = ISNULL(json.DeliveryAddressLine2, Purchasing.Suppliers.DeliveryAddressLine2),
2525
DeliveryPostalCode = ISNULL(json.DeliveryPostalCode, Purchasing.Suppliers.DeliveryPostalCode),
2626
PostalAddressLine1 = ISNULL(json.PostalAddressLine1, Purchasing.Suppliers.PostalAddressLine1),
27-
PostalAddressLine2 = json.PostalAddressLine2,
27+
PostalAddressLine2 = ISNULL(json.PostalAddressLine2, Purchasing.Suppliers.PostalAddressLine2),
2828
PostalPostalCode = ISNULL(json.PostalPostalCode, Purchasing.Suppliers.PostalPostalCode),
2929
LastEditedBy = @UserID
3030
FROM OPENJSON (@Supplier)

samples/databases/wide-world-importers/wwi-ssdt/wwi-ssdt/WebApi/Views/Suppliers.sql

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,15 @@ SELECT s.SupplierID,
99
s.FaxNumber,
1010
s.WebsiteURL,
1111
s.SupplierReference,
12+
s.BankAccountName,
13+
s.BankAccountBranch,
14+
s.BankAccountCode,
15+
s.BankAccountNumber,
16+
s.BankInternationalCode,
17+
s.PostalAddressLine1,
18+
s.PostalAddressLine2,
19+
s.PostalPostalCode,
20+
s.PaymentDays,
1221
DeliveryLocation = JSON_QUERY((SELECT
1322
[type] = 'Feature',
1423
[geometry.type] = 'Point',

0 commit comments

Comments
 (0)