Skip to content

Commit 5b5ba23

Browse files
author
aidasberesinevicius
committed
Correct SalesUoM assignment
1 parent 65f76c1 commit 5b5ba23

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

Apps/W1/Shopify/app/src/Inventory/Codeunits/ShpfyInventoryAPI.Codeunit.al

+3-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ codeunit 30195 "Shpfy Inventory API"
3333
ShopifyVariant: Record "Shpfy Variant";
3434
StockCalculation: Interface "Shpfy Stock Calculation";
3535
UOM: Code[10];
36+
SalesUOM: Code[10];
3637
begin
3738
SetShop(ShopInventory."Shop Code");
3839
if ShopifyProduct.Get(ShopInventory."Product Id") and ShopifyVariant.Get(ShopInventory."Variant Id") then begin
@@ -48,6 +49,7 @@ codeunit 30195 "Shpfy Inventory API"
4849
end;
4950

5051
StockCalculationFactory(StockCalculation, ShopLocation."Stock Calculation");
52+
SalesUOM := Item."Sales Unit of Measure";
5153
Stock := StockCalculation.GetStock(Item);
5254

5355
case ShopifyVariant."UoM Option Id" of
@@ -58,7 +60,7 @@ codeunit 30195 "Shpfy Inventory API"
5860
3:
5961
UOM := CopyStr(ShopifyVariant."Option 3 Value", 1, MaxStrLen(UOM));
6062
else
61-
UOM := Item."Sales Unit of Measure";
63+
UOM := SalesUOM;
6264
end;
6365
if (UOM <> '') and (UOM <> Item."Base Unit of Measure") then
6466
if ItemUnitofMeasure.Get(Item."No.", UOM) then

0 commit comments

Comments
 (0)