From 5407ae37b7d1c15ffec226a916a397ec295a2530 Mon Sep 17 00:00:00 2001 From: Jiawen Sun Date: Tue, 18 Nov 2025 17:03:16 +0100 Subject: [PATCH 1/6] Add microsoftInternal__NAV-199883 --- dataset/bcbench_nav.jsonl | 1 + 1 file changed, 1 insertion(+) diff --git a/dataset/bcbench_nav.jsonl b/dataset/bcbench_nav.jsonl index c03cbfa64..498be4680 100644 --- a/dataset/bcbench_nav.jsonl +++ b/dataset/bcbench_nav.jsonl @@ -23,3 +23,4 @@ {"repo": "microsoftInternal/NAV", "instance_id": "microsoftInternal__NAV-206527", "base_commit": "d8e867062d4137cf5df2d9d2b8a71bb53210f685", "created_at": "2025-02-07", "environment_setup_version": "26.0", "project_paths": ["App\\Layers\\W1\\BaseApp", "App\\Layers\\W1\\Tests\\SCM"], "hints_text": "", "FAIL_TO_PASS": [{"codeunitID": 137088, "functionName": ["ReleasedProdOrderQuantityPerandExpectedQtyRoundingPrecisionChecking"]}], "PASS_TO_PASS": [], "problem_statement": "Title: If a component's Item UOM has a 'Quantity Rounding Precision' of 1, & a Finished Good consumes partial quantity, the Prod. Order created from the Planning of a Sales Order pulls in the Component with a 'Qty. Per' and 'Exp. Qty.' of 0.\nRepro Steps:\n1. Use existing Item with no activity, or create new item. This will be the COMPONENT Item. Will use PCS as UOM.\n2. For the Component Item, go into Related > Item UOM > and set 'Quantity Rounding Precision' = 1 on the bottom.\n3. Component Item should have\n Replenishment System = PURCHASE\n Rounding Precision = .01\n Reorder Policy = Lot-for-Lot\n Include Inventory = TRUE\n4. Then have another Item, I'll call it FG Item which is:\n Replenishment System = PRODUNCTION ORDER\n Rounding Precision = 1\n Reorder Policy = ORDER\n Production BOM => Create new Certified Production BOM that consumes COMPONENT Item with 'Quantity Per' = .09\n5. Now create Sales Order for any Customer for FG Item for 1 Quantity at BLUE (or MAIN) location.\n6. On the Sales Order go to Actions > Plan > Planning > Create Prod. Order and choose 'Released' and 'Item Order'.\n7. Then choose Order Tracking and then 'Show' which will take you to the Released Prod. Order.\n8. We will see prod. Order for FG Item with 1 qty. Go to Line > Components\n\n**EXPECTED RESULTS** = 'Quantity Per' and 'Expected Quantity' = .09\n**ACTUAL RESULTS** = 'Quantity Per' and 'Expected Quantity' = 0\n\nIf you were then to delete the Released Production Order, and go to the Planning Worksheet and run the Calc. Regenerative Plan for the 2 items, you would receive an error:\n\"The value in the Qty. Rounding Precision field on the Item Unit of Measure page is causing the rounding precision for the Expected Quantity field to be incorrect.\"\n\nDescription:\n2If a component's Item UOM has a 'Quantity Rounding Precision' set to 1, and a Finished Good consumes partial quantity, the Production Order created from the Planning section of a Sales Order pulls in the Component but with a 'Quantity Per' and 'Expected Quantity' of 0. If we are producing 1 FG Item and the 'Quantity Per' is set to consume .1 component, we would expect 'Quantity Per' and 'Expected Quantity' both = .1. There is no error message.\n\nBut if you run the Planning Worksheet's 'Calc. Regenerative Plan', then you will get an error message about the 'Quantity Rounding Precision'.\n\nI don't believe the 'Quantity Rounding Precision' in the Item UOM should have any influence on this process. I always thought this field was only for scenario with Picking and when Base UOM is larger than the smallest UOM, and picking in smallest UOM. There is a lot of confusion about this 'Quantity Rounding Precision' field within the Item UOM actually.\n", "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMOrderPlanningIII.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMOrderPlanningIII.Codeunit.al\nindex 7415eaa53cc..2573227dbca 100644\n--- a/App/Layers/W1/Tests/SCM/SCMOrderPlanningIII.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMOrderPlanningIII.Codeunit.al\n@@ -45,6 +45,8 @@ codeunit 137088 \"SCM Order Planning - III\"\n LineExistErr: Label 'Requistion line in %1 worksheet should exist for item %2';\n PurchaseLineQuantityBaseErr: Label '%1.%2 must be nearly equal to %3.', Comment = '%1 : Purchase Line, %2 : Quantity (Base), %3 : Value.';\n BOMFixedQtyCalcFormulaErr: Label 'BOM Fixed Quantity Calculation Formula should be used to calculate the values.';\n+ RelesedProdOrderComponentQtyPerRoundingErr: Label 'Relesed Production Order Item Component Quantity per %1 Not Match With Expected Result %2';\n+ RelesedProdOrderComponentExpQtyRoundingErr: Label 'Relesed Production Order Item Component Expected Quantity %1 Not Match With Expected Result %2';\n \n [Test]\n [HandlerFunctions('MakeSupplyOrdersPageHandler')]\n@@ -2988,6 +2990,73 @@ codeunit 137088 \"SCM Order Planning - III\"\n VerifyStartingTimeOnFirmPlannedProductionOrder(StartingTime, ChildItem.\"No.\", ProductionOrderNo);\n end;\n \n+ [Test]\n+ [HandlerFunctions('ModalPageHandler,ErrorMessageHandler')]\n+ procedure ReleasedProdOrderQuantityPerandExpectedQtyRoundingPrecisionChecking()\n+ var\n+ BaseItemUnitOfMeasure: Record \"Item Unit of Measure\";\n+ ComponentItem: Record Item;\n+ ProdOrderComp: Record \"Prod. Order Component\";\n+ ProdOrderLine: Record \"Prod. Order Line\";\n+ ProductionBOMHeader: Record \"Production BOM Header\";\n+ ProductionBOMLine: Record \"Production BOM Line\";\n+ ProductionOrder: Record \"Production Order\";\n+ ProductItem: Record Item;\n+ SalesHeader: Record \"Sales Header\";\n+ ExpectedQty: Decimal;\n+ RelesedProdOrderNo: Code[20];\n+ Status: Enum \"Production Order Status\";\n+ begin\n+ // [SCENARIO 562766] If a component's Item UOM has a 'Quantity Rounding Precision' of 1, & a Finished Good consumes partial quantity, \n+ // the Prod. Order created from the Planning of a Sales Order pulls in the Component with a 'Qty. Per' and 'Exp. Qty.' of 0.\n+ Initialize();\n+\n+ // [GIVEN] Created Component Item\n+ LibraryInventory.CreateItem(ComponentItem);\n+ ComponentItem.Validate(\"Replenishment System\", ComponentItem.\"Replenishment System\"::Purchase);\n+ ComponentItem.Validate(\"Rounding Precision\", LibraryRandom.RandPrecision());\n+ ComponentItem.Validate(\"Reordering Policy\", ComponentItem.\"Reordering Policy\"::\"Lot-for-Lot\");\n+ ComponentItem.Validate(\"Include Inventory\", true);\n+ ComponentItem.Modify(true);\n+\n+ // [GIVEN] Set Qty. Rounding Precision = 1 for Component Item\n+ BaseItemUnitOfMeasure.Get(ComponentItem.\"No.\", ComponentItem.\"Base Unit of Measure\");\n+ BaseItemUnitOfMeasure.Validate(\"Qty. Rounding Precision\", 1);\n+ BaseItemUnitOfMeasure.Modify();\n+\n+ // [GIVEN] Created Production Bom using Component Item\n+ LibraryManufacturing.CreateProductionBOMHeader(ProductionBOMHeader, ComponentItem.\"Base Unit of Measure\");\n+ LibraryManufacturing.CreateProductionBOMLine(ProductionBOMHeader, ProductionBOMLine, '', ProductionBOMLine.Type::Item, ComponentItem.\"No.\", LibraryRandom.RandDecInDecimalRange(0.01, 0.99, 2));\n+ ProductionBOMHeader.Validate(Status, ProductionBOMHeader.Status::Certified);\n+ ProductionBOMHeader.Modify();\n+\n+ // [GIVEN] Created Master Item and Production Bom Assigned to Master Item\n+ LibraryInventory.CreateItem(ProductItem);\n+ ProductItem.Validate(\"Replenishment System\", ProductItem.\"Replenishment System\"::\"Prod. Order\");\n+ ProductItem.Validate(\"Rounding Precision\", 1);\n+ ProductItem.Validate(\"Reordering Policy\", ProductItem.\"Reordering Policy\"::Order);\n+ ProductItem.Validate(\"Production BOM No.\", ProductionBOMHeader.\"No.\");\n+ ProductItem.Modify(true);\n+\n+ // [GIVEN] Created Sales Order Using Master Item Quantity - 1\n+ CreateSalesOrder(SalesHeader, ProductItem.\"No.\", '', 1, 1);\n+\n+ // [WHEN] Created Released Prod. Order From Sales Order Using Planning\n+ LibraryPlanning.CreateProdOrderUsingPlanning(ProductionOrder, Status::\"Firm Planned\", SalesHeader.\"No.\", ProductItem.\"No.\");\n+ RelesedProdOrderNo := LibraryManufacturing.ChangeStatusFirmPlanToReleased(ProductionOrder.\"No.\");\n+\n+ // [WHEN] Find Released Production Order Component\n+ FindProdOrderLine(ProdOrderLine, RelesedProdOrderNo);\n+ FindProdOrderComponent(ProdOrderComp, ProdOrderLine.\"Prod. Order No.\", ComponentItem.\"No.\");\n+\n+ // [WHEN] Getting Expected result using Component Rounding Precision\n+ ExpectedQty := Round(ProductionBOMLine.\"Quantity per\" * BaseItemUnitOfMeasure.\"Qty. Rounding Precision\" / BaseItemUnitOfMeasure.\"Qty. Rounding Precision\", ComponentItem.\"Rounding Precision\");\n+\n+ // [THEN] Expected Quantity must be Equal to Production Order Component \"Quantity per\" And \"Expected Quantity\"\n+ Assert.AreEqual(ExpectedQty, ProdOrderComp.\"Quantity per\", StrSubstNo(RelesedProdOrderComponentQtyPerRoundingErr, ProdOrderComp.\"Quantity per\", ExpectedQty));\n+ Assert.AreEqual(ExpectedQty, ProdOrderComp.\"Expected Quantity\", StrSubstNo(RelesedProdOrderComponentExpQtyRoundingErr, ProdOrderComp.\"Expected Quantity\", ExpectedQty));\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n@@ -3805,6 +3874,14 @@ codeunit 137088 \"SCM Order Planning - III\"\n Assert.IsTrue(ProductionOrder.\"Starting Time\" = StartingTime, '');\n end;\n \n+ local procedure FindProdOrderLine(var ProdOrderLine: Record \"Prod. Order Line\"; ProductionOrderNo: Code[20])\n+ begin\n+ ProdOrderLine.Reset();\n+ ProdOrderLine.SetRange(Status, ProdOrderLine.Status::Released);\n+ ProdOrderLine.SetRange(\"Prod. Order No.\", ProductionOrderNo);\n+ ProdOrderLine.FindFirst();\n+ end;\n+\n [ModalPageHandler]\n [Scope('OnPrem')]\n procedure MakeSupplyOrdersPageHandler(var MakeSupplyOrders: Page \"Make Supply Orders\"; var Response: Action)\n@@ -3911,5 +3988,16 @@ codeunit 137088 \"SCM Order Planning - III\"\n begin\n Reply := true;\n end;\n+\n+ [ModalPageHandler]\n+ procedure ModalPageHandler(var CreateOrderFromSales: Page \"Create Order From Sales\"; var Response: Action)\n+ begin\n+ Response := Action::Yes;\n+ end;\n+\n+ [MessageHandler]\n+ procedure ErrorMessageHandler(Message: Text[1024])\n+ begin\n+ end;\n }\n \n", "patch": "diff --git a/App/Layers/IT/BaseApp/Manufacturing/Document/CalculateProdOrder.Codeunit.al b/App/Layers/IT/BaseApp/Manufacturing/Document/CalculateProdOrder.Codeunit.al\nindex 5f7a2b890fe..5b63565d0f1 100644\n--- a/App/Layers/IT/BaseApp/Manufacturing/Document/CalculateProdOrder.Codeunit.al\n+++ b/App/Layers/IT/BaseApp/Manufacturing/Document/CalculateProdOrder.Codeunit.al\n@@ -43,6 +43,7 @@ codeunit 99000773 \"Calculate Prod. Order\"\n ProdOrderComp: Record \"Prod. Order Component\";\n ProdOrderRoutingLine2: Record \"Prod. Order Routing Line\";\n ProdBOMLine: array[99] of Record \"Production BOM Line\";\n+ ProdLineItem: Record Item;\n UOMMgt: Codeunit \"Unit of Measure Management\";\n MfgCostCalcMgt: Codeunit \"Mfg. Cost Calculation Mgt.\";\n VersionMgt: Codeunit VersionManagement;\n@@ -286,8 +287,8 @@ codeunit 99000773 \"Calculate Prod. Order\"\n \n local procedure TransferBOMProcessItem(Level: Integer; LineQtyPerUOM: Decimal; ItemQtyPerUOM: Decimal; var ErrorOccured: Boolean)\n var\n- Item2: Record Item;\n ComponentSKU: Record \"Stockkeeping Unit\";\n+ Item2: Record Item;\n IsHandled: Boolean;\n QtyRoundPrecision: Decimal;\n begin\n@@ -323,6 +324,7 @@ codeunit 99000773 \"Calculate Prod. Order\"\n ProdOrderComp.Validate(\"Unit of Measure Code\", ProdBOMLine[Level].\"Unit of Measure Code\");\n if (ProdOrderComp.\"Item No.\" <> '') and Item2.Get(ProdOrderComp.\"Item No.\") then\n QtyRoundPrecision := UOMMgt.GetQtyRoundingPrecision(Item2, ProdBOMLine[Level].\"Unit of Measure Code\");\n+ CheckingRoundingPrecision(Item2, ProdLineItem, QtyRoundPrecision, Level);\n if QtyRoundPrecision <> 0 then\n ProdOrderComp.\"Quantity per\" := Round(ProdBOMLine[Level].\"Quantity per\" * LineQtyPerUOM / ItemQtyPerUOM, QtyRoundPrecision)\n else\n@@ -1001,6 +1003,21 @@ codeunit 99000773 \"Calculate Prod. Order\"\n ProdOrderLineToCheck.TestField(Quantity);\n end;\n \n+ local procedure CheckingRoundingPrecision(ChildItem: Record Item; ProdLineItem: Record Item; var QtyRoundPrecision: Decimal; Level: Integer)\n+ begin\n+ if (ChildItem.\"Rounding Precision\" = 0) or (QtyRoundPrecision = 0) then\n+ exit;\n+\n+ if (not ProdLineItem.Get(ProdOrderLine.\"Item No.\")) or (ProdLineItem.\"Replenishment System\" <> ProdLineItem.\"Replenishment System\"::\"Prod. Order\") then\n+ exit;\n+\n+ if (ChildItem.\"Base Unit of Measure\" <> ProdBOMLine[Level].\"Unit of Measure Code\") then\n+ exit;\n+ QtyRoundPrecision := ChildItem.\"Rounding Precision\";\n+ ProdOrderComp.\"Qty. Rounding Precision\" := ChildItem.\"Rounding Precision\";\n+ ProdOrderComp.\"Qty. Rounding Precision (Base)\" := ChildItem.\"Rounding Precision\";\n+ end;\n+\n [IntegrationEvent(false, false)]\n local procedure OnAfterInsertProdRoutingLine(var ProdOrderRoutingLine: Record \"Prod. Order Routing Line\"; ProdOrderLine: Record \"Prod. Order Line\")\n begin\ndiff --git a/App/Layers/W1/BaseApp/Manufacturing/Document/CalculateProdOrder.Codeunit.al b/App/Layers/W1/BaseApp/Manufacturing/Document/CalculateProdOrder.Codeunit.al\nindex 36930a9e2aa..5d44df0a596 100644\n--- a/App/Layers/W1/BaseApp/Manufacturing/Document/CalculateProdOrder.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Manufacturing/Document/CalculateProdOrder.Codeunit.al\n@@ -43,6 +43,7 @@ codeunit 99000773 \"Calculate Prod. Order\"\n ProdOrderComp: Record \"Prod. Order Component\";\n ProdOrderRoutingLine2: Record \"Prod. Order Routing Line\";\n ProdBOMLine: array[99] of Record \"Production BOM Line\";\n+ ProdLineItem: Record Item;\n UOMMgt: Codeunit \"Unit of Measure Management\";\n MfgCostCalcMgt: Codeunit \"Mfg. Cost Calculation Mgt.\";\n VersionMgt: Codeunit VersionManagement;\n@@ -260,8 +261,8 @@ codeunit 99000773 \"Calculate Prod. Order\"\n \n local procedure TransferBOMProcessItem(Level: Integer; LineQtyPerUOM: Decimal; ItemQtyPerUOM: Decimal; var ErrorOccured: Boolean)\n var\n- Item2: Record Item;\n ComponentSKU: Record \"Stockkeeping Unit\";\n+ Item2: Record Item;\n IsHandled: Boolean;\n QtyRoundPrecision: Decimal;\n begin\n@@ -297,6 +298,7 @@ codeunit 99000773 \"Calculate Prod. Order\"\n ProdOrderComp.Validate(\"Unit of Measure Code\", ProdBOMLine[Level].\"Unit of Measure Code\");\n if (ProdOrderComp.\"Item No.\" <> '') and Item2.Get(ProdOrderComp.\"Item No.\") then\n QtyRoundPrecision := UOMMgt.GetQtyRoundingPrecision(Item2, ProdBOMLine[Level].\"Unit of Measure Code\");\n+ CheckingRoundingPrecision(Item2, ProdLineItem, QtyRoundPrecision, Level);\n if QtyRoundPrecision <> 0 then\n ProdOrderComp.\"Quantity per\" := Round(ProdBOMLine[Level].\"Quantity per\" * LineQtyPerUOM / ItemQtyPerUOM, QtyRoundPrecision)\n else\n@@ -975,6 +977,21 @@ codeunit 99000773 \"Calculate Prod. Order\"\n ProdOrderLineToCheck.TestField(Quantity);\n end;\n \n+ local procedure CheckingRoundingPrecision(ChildItem: Record Item; ProdLineItem: Record Item; var QtyRoundPrecision: Decimal; Level: Integer)\n+ begin\n+ if (ChildItem.\"Rounding Precision\" = 0) or (QtyRoundPrecision = 0) then\n+ exit;\n+\n+ if (not ProdLineItem.Get(ProdOrderLine.\"Item No.\")) or (ProdLineItem.\"Replenishment System\" <> ProdLineItem.\"Replenishment System\"::\"Prod. Order\") then\n+ exit;\n+\n+ if (ChildItem.\"Base Unit of Measure\" <> ProdBOMLine[Level].\"Unit of Measure Code\") then\n+ exit;\n+ QtyRoundPrecision := ChildItem.\"Rounding Precision\";\n+ ProdOrderComp.\"Qty. Rounding Precision\" := ChildItem.\"Rounding Precision\";\n+ ProdOrderComp.\"Qty. Rounding Precision (Base)\" := ChildItem.\"Rounding Precision\";\n+ end;\n+\n [IntegrationEvent(false, false)]\n local procedure OnAfterInsertProdRoutingLine(var ProdOrderRoutingLine: Record \"Prod. Order Routing Line\"; ProdOrderLine: Record \"Prod. Order Line\")\n begin\n"} {"repo": "microsoftInternal/NAV", "instance_id": "microsoftInternal__NAV-208851", "base_commit": "b626cb16a65cd529d91527d1d5dac501d6ecb06e", "created_at": "2025-03-04", "environment_setup_version": "26.0", "project_paths": ["App\\Layers\\W1\\BaseApp", "App\\Layers\\W1\\Tests\\ERM"], "hints_text": "", "FAIL_TO_PASS": [{"codeunitID": 134117, "functionName": ["AmountTypeFieldDoesNotChangeOnClosePageSalesPriceList"]}], "PASS_TO_PASS": [], "problem_statement": "Title: In the Sales Price Lists, the 'Defines' field always defaults to Price & Discount when dealing with Customer Price Group/Customer Disc Group setting\nRepro Steps:\nReproduced in CRONUS GB v25.4\nEnable 'New Sales Price Experience' in Feature Management.\n1. Go to Sales Price Lists\n2. Click on New to generate a New Sales Price List.\n3. Set Assign-to-type to Customer Disc. Group\n4. View Columns for: **Discount**\n5. Insert a single item line, using only Line Discount.\n6. Set the Sales Price List to Status 'Active'\n7. Go back to the Sales Price Lists Page.\n\nYou will notice \"Defines\" has changed back to Prices & Discounts Same behavior is replicable with Price for Customer Price Group\n**Expected Result:** Defines should remain as Discounts if only discounts are in the Sales Price list\n**Actual Results:** 'Defines' Always defaults to 'Prices & Discount'\n\nDescription:\nThe issue is with the setting for the \"Defines\" field. The setting may be changed from 'Price & Discount' to 'Discount' because only Line Discounts may be used in the new Price Group configuration. However, after closing the Page, the system will always default back to the 'Price & Discount', even though only Line Discounts are defined, because the code doesn't pass the value correctly.\n\nThe Partner Developer highlighted the following code:\nThe call stack:\n- GetAmountType (\\ext11_packandshipchanges\\Table\\7005\\Price Source.dal:342)\n- GetDefaultAmountType (\\ext11_packandshipchanges\\Table\\7005\\Price Source.dal:182)\n- UpdateAmountType (\\ext11_packandshipchanges\\Table\\7000\\Price List Header.dal:567)\n- OnClosePage (\\ext11_packandshipchanges\\Page\\7016\\Sales Price List.dal:600)\n\nIn the Function:`UpdateAmountType`, the following code is used:\n\"Amount Type\" := PriceSource.GetDefaultAmountType(); The code reflects it as empty. No value is passed to it, so it always defaults to 'Price & Discount'\n", "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/PriceListsUI.Codeunit.al b/App/Layers/W1/Tests/ERM/PriceListsUI.Codeunit.al\nindex 5f586214ecb..c18252ac131 100644\n--- a/App/Layers/W1/Tests/ERM/PriceListsUI.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/PriceListsUI.Codeunit.al\n@@ -4366,6 +4366,39 @@ codeunit 134117 \"Price Lists UI\"\n PurchasePriceList.Caption()));\n end;\n \n+ [Test]\n+ procedure AmountTypeFieldDoesNotChangeOnClosePageSalesPriceList()\n+ var\n+ PriceListHeader: Record \"Price List Header\";\n+ CustomerDiscountGroup: Record \"Customer Discount Group\";\n+ SalesPriceList: TestPage \"Sales Price List\";\n+ PriceListHeaderCode: Code[20];\n+ begin\n+ // [SCENARIO 566994] Bug fix to ensure the field \"Amount Type\" does not change after closing the page \"Sales Price List\" \n+ Initialize(true);\n+\n+ // [GIVEN] Sales Price List for discount\n+ PriceListHeaderCode := LibraryUtility.GenerateGUID();\n+ SalesPriceList.OpenEdit();\n+ SalesPriceList.New();\n+ SalesPriceList.Code.SetValue(PriceListHeaderCode);\n+ SalesPriceList.Description.SetValue(LibraryUtility.GenerateGUID());\n+ SalesPriceList.SourceType.SetValue(\"Price Source Type\"::\"Customer Disc. Group\");\n+ SalesPriceList.AmountType.SetValue(\"Price Amount Type\"::Discount);\n+ CustomerDiscountGroup.Init();\n+ CustomerDiscountGroup.Code := LibraryUtility.GenerateGUID();\n+ CustomerDiscountGroup.Insert();\n+ SalesPriceList.AssignToNo.SetValue(CustomerDiscountGroup.Code);\n+ SalesPriceList.Status.SetValue(\"Price Status\"::Active);\n+\n+ // [WHEN] Close the page \"Sales Price List\"\n+ SalesPriceList.Close();\n+\n+ // [THEN] Check the field \"Amount Type\" has not reverted to Price & Discount\n+ PriceListHeader.Get(PriceListHeaderCode);\n+ Assert.IsTrue((PriceListHeader.\"Amount Type\" = PriceListHeader.\"Amount Type\"::Discount), 'The field \"Amount Type\" has changed after closing the page \"Sales Price List\"');\n+ end;\n+\n local procedure Initialize(Enable: Boolean)\n var\n PriceListHeader: Record \"Price List Header\";\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Pricing/PriceList/PriceListHeader.Table.al b/App/Layers/W1/BaseApp/Pricing/PriceList/PriceListHeader.Table.al\nindex fb6adbb607d..9e6fd459241 100644\n--- a/App/Layers/W1/BaseApp/Pricing/PriceList/PriceListHeader.Table.al\n+++ b/App/Layers/W1/BaseApp/Pricing/PriceList/PriceListHeader.Table.al\n@@ -562,6 +562,7 @@ table 7000 \"Price List Header\"\n var\n xAmountType: Enum \"Price Amount Type\";\n begin\n+ CopyTo(PriceSource);\n xAmountType := \"Amount Type\";\n if \"Source Type\" in [\"Source Type\"::\"Customer Disc. Group\", \"Source Type\"::\"Customer Price Group\"] then\n \"Amount Type\" := PriceSource.GetDefaultAmountType()\n"} {"repo": "microsoftInternal/NAV", "instance_id": "microsoftInternal__NAV-208320", "base_commit": "d080f087349d4713e1782f2f2630819714cb6738", "created_at": "2025-02-27", "environment_setup_version": "26.0", "project_paths": ["App\\Layers\\W1\\BaseApp", "App\\Layers\\W1\\Tests\\ERM"], "hints_text": "", "FAIL_TO_PASS": [{"codeunitID": 134386, "functionName": ["UpdateEmailAndPhoneNoWhenChangeBillToOfSalesInvoice"]}], "PASS_TO_PASS": [], "problem_statement": "Title: The Email and Phone No. don't update when selecting Another Customer in the \"Bill-to\" field of a Sales Invoice\nRepro Steps:\n1. Go to Contacts and find CT000012 - \"Miss Patricia Doyle\" with 'Company Name' = (John Haddock Insurance Co.)\n2. Edit the contact and add any 'Phone Number' and 'Mobile Phone No.'\n3. Go to Sales Invoices and Create a new sales invoice and for Customer 10000.\n3. Go down to the Shipping and Billing tab and set 'Bill-to' = \"Another Customer\"\n Now see how more fields are introduced, including the Contact and Contact info with Phone numbers and email, should be for \"Mr. Andy Teal\" who is contact for Customer 10000.\n5. Then set Name = 30000 (John Haddock Insurance Co.) and say yes to change bill-to customer.\nNotice we have Contact = \"Miss Patricia Doyle\"....\n\n**EXPECTED RESULTS:** The Phone Number(s) and Email for \"Miss Patricia Doyle\" should pull in.\n**ACTUAL RESULTS:** The fields are the same as they were for the previous contact \"Mr. Andy Teal\" and you need to refresh the Page so it pulls in the new Phone numbers and email for \"Mr. Andy Teal\" Contact.\nDescription:\nCopied and Derived from Support Case Review", "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/ERMSalesDocumentsII.Codeunit.al b/App/Layers/W1/Tests/ERM/ERMSalesDocumentsII.Codeunit.al\nindex bc3ad2bbe5c..30e993b56af 100644\n--- a/App/Layers/W1/Tests/ERM/ERMSalesDocumentsII.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ERMSalesDocumentsII.Codeunit.al\n@@ -4462,6 +4462,51 @@ codeunit 134386 \"ERM Sales Documents II\"\n SalesOrder.SalesLines.\"Invoice Discount Amount\".AssertEquals(SalesHeader.\"Invoice Discount Value\");\n end;\n \n+ [HandlerFunctions('CustomerLookupHandler,ConfirmHandlerYes')]\n+ [Test]\n+ procedure UpdateEmailAndPhoneNoWhenChangeBillToOfSalesInvoice()\n+ var\n+ Contact: array[2] of Record Contact;\n+ Customer: array[2] of Record Customer;\n+ SalesHeader: Record \"Sales Header\";\n+ SalesInvoice: TestPage \"Sales Invoice\";\n+ begin\n+ // [SCENARIO 564632] The Email and Phone No. should update when selecting Another Customer in the \"Bill-to\" field of a Sales Invoice\n+ Initialize();\n+\n+ // [GIVEN] Create First Customer with First Contact with Phone = \"111111111\", Mobile Phone = \"222222222\" and Email = \"contact1@mail.com\"\n+ LibraryMarketing.CreateContactWithCustomer(Contact[1], Customer[1]);\n+ UpdateContactInfo(Contact[1], '111111111', '222222222', 'contact1@mail.com');\n+ Contact[1].Modify(true);\n+\n+ // [GIVEN] Create Second Customer with Second Contact with Phone = \"333333333\", Mobile Phone = \"444444444\" and Email = \"contact2@mail.com\"\n+ LibraryMarketing.CreateContactWithCustomer(Contact[2], Customer[2]);\n+ UpdateContactInfo(Contact[2], '333333333', '444444444', 'contact2@mail.com');\n+ Contact[2].Modify(true);\n+\n+ // [GIVEN] Create Sales Invoice with First Customer\n+ LibrarySales.CreateSalesHeader(SalesHeader, SalesHeader.\"Document Type\"::Invoice, Customer[1].\"No.\");\n+\n+ // [GIVEN] Sales Invoice Card is opened\n+ LibraryVariableStorage.Enqueue(Customer[2].\"No.\");\n+ LibraryVariableStorage.Enqueue('');\n+ LibraryVariableStorage.Enqueue(true); // yes to change \"Bill-to Customer No.\"\n+ SalesInvoice.OpenEdit();\n+ SalesInvoice.FILTER.SetFilter(\"No.\", SalesHeader.\"No.\");\n+\n+ // [WHEN] Select Second Customer when lookup \"Bill-to Customer Name\"\n+ SalesInvoice.\"Bill-to Name\".Lookup();\n+\n+ // [THEN] Verify Sales Invoice \"Phone No.\" = \"333333333\"\n+ SalesInvoice.BillToContactPhoneNo.AssertEquals(Contact[2].\"Phone No.\");\n+\n+ // [THEN] Verify Sales Invoice \"Mobile Phone No.\" = \"444444444\"\n+ SalesInvoice.BillToContactMobilePhoneNo.AssertEquals(Contact[2].\"Mobile Phone No.\");\n+\n+ // [THEN] Verify Sales Invoice \"Email\" = \"contact2@mail.com\"\n+ SalesInvoice.BillToContactEmail.AssertEquals(Contact[2].\"E-Mail\");\n+ end;\n+\n [Test]\n [Scope('OnPrem')]\n procedure UpdateExtendedTextTypeNotAllowed()\n@@ -6595,5 +6640,14 @@ codeunit 134386 \"ERM Sales Documents II\"\n CustomerLookup.Filter.SetFilter(Name, LibraryVariableStorage.DequeueText());\n CustomerLookup.OK().Invoke();\n end;\n+\n+ [ModalPageHandler]\n+ procedure CustomerLookupHandler(var CustomerLookup: TestPage \"Customer Lookup\")\n+ begin\n+ CustomerLookup.GotoKey(LibraryVariableStorage.DequeueText());\n+ Assert.AreEqual(LibraryVariableStorage.DequeueText(),\n+ CustomerLookup.Filter.GetFilter(\"Date Filter\"), 'Wrong Date Filter.');\n+ CustomerLookup.OK().Invoke();\n+ end;\n }\n \n", "patch": "diff --git a/App/Layers/W1/BaseApp/Sales/Document/BlanketSalesOrder.Page.al b/App/Layers/W1/BaseApp/Sales/Document/BlanketSalesOrder.Page.al\nindex 1dee700e044..a3b2013773f 100644\n--- a/App/Layers/W1/BaseApp/Sales/Document/BlanketSalesOrder.Page.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/BlanketSalesOrder.Page.al\n@@ -648,6 +648,23 @@ page 507 \"Blanket Sales Order\"\n Rec.SetRange(\"Bill-to Customer No.\");\n CurrPage.Update();\n end;\n+\n+ trigger OnLookup(var Text: Text): Boolean\n+ var\n+ Customer: Record Customer;\n+ begin\n+ if Customer.SelectCustomer(Customer) then begin\n+ xRec := Rec;\n+ Rec.\"Bill-to Name\" := Customer.Name;\n+ Rec.Validate(\"Bill-to Customer No.\", Customer.\"No.\");\n+ end;\n+\n+ if Rec.GetFilter(\"Bill-to Customer No.\") = xRec.\"Bill-to Customer No.\" then\n+ if Rec.\"Bill-to Customer No.\" <> xRec.\"Bill-to Customer No.\" then\n+ Rec.SetRange(\"Bill-to Customer No.\");\n+\n+ CurrPage.Update();\n+ end;\n }\n field(\"Bill-to Address\"; Rec.\"Bill-to Address\")\n {\ndiff --git a/App/Layers/W1/BaseApp/Sales/Document/SalesCreditMemo.Page.al b/App/Layers/W1/BaseApp/Sales/Document/SalesCreditMemo.Page.al\nindex 84ba27e1b17..3f876b15fd0 100644\n--- a/App/Layers/W1/BaseApp/Sales/Document/SalesCreditMemo.Page.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/SalesCreditMemo.Page.al\n@@ -552,6 +552,23 @@ page 44 \"Sales Credit Memo\"\n \n CurrPage.Update();\n end;\n+\n+ trigger OnLookup(var Text: Text): Boolean\n+ var\n+ Customer: Record Customer;\n+ begin\n+ if Customer.SelectCustomer(Customer) then begin\n+ xRec := Rec;\n+ Rec.\"Bill-to Name\" := Customer.Name;\n+ Rec.Validate(\"Bill-to Customer No.\", Customer.\"No.\");\n+ end;\n+\n+ if Rec.GetFilter(\"Bill-to Customer No.\") = xRec.\"Bill-to Customer No.\" then\n+ if Rec.\"Bill-to Customer No.\" <> xRec.\"Bill-to Customer No.\" then\n+ Rec.SetRange(\"Bill-to Customer No.\");\n+\n+ CurrPage.Update();\n+ end;\n }\n field(\"Bill-to Address\"; Rec.\"Bill-to Address\")\n {\ndiff --git a/App/Layers/W1/BaseApp/Sales/Document/SalesInvoice.Page.al b/App/Layers/W1/BaseApp/Sales/Document/SalesInvoice.Page.al\nindex ee0d93e0f64..930047f5653 100644\n--- a/App/Layers/W1/BaseApp/Sales/Document/SalesInvoice.Page.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/SalesInvoice.Page.al\n@@ -803,6 +803,25 @@ page 43 \"Sales Invoice\"\n CurrPage.Update();\n end;\n end;\n+\n+ trigger OnLookup(var Text: Text): Boolean\n+ var\n+ Customer: Record Customer;\n+ begin\n+ if Customer.SelectCustomer(Customer) then begin\n+ xRec := Rec;\n+ Rec.\"Bill-to Name\" := Customer.Name;\n+ Rec.Validate(\"Bill-to Customer No.\", Customer.\"No.\");\n+ end;\n+\n+ if not ((BillToOptions = BillToOptions::\"Custom Address\") and not ShouldSearchForCustByName) then begin\n+ if Rec.GetFilter(\"Bill-to Customer No.\") = xRec.\"Bill-to Customer No.\" then\n+ if Rec.\"Bill-to Customer No.\" <> xRec.\"Bill-to Customer No.\" then\n+ Rec.SetRange(\"Bill-to Customer No.\");\n+\n+ CurrPage.Update();\n+ end;\n+ end;\n }\n field(\"Bill-to Address\"; Rec.\"Bill-to Address\")\n {\ndiff --git a/App/Layers/W1/BaseApp/Sales/Document/SalesOrder.Page.al b/App/Layers/W1/BaseApp/Sales/Document/SalesOrder.Page.al\nindex 77cf2b1863e..2a751833971 100644\n--- a/App/Layers/W1/BaseApp/Sales/Document/SalesOrder.Page.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/SalesOrder.Page.al\n@@ -812,6 +812,25 @@ page 42 \"Sales Order\"\n CurrPage.Update();\n end;\n end;\n+\n+ trigger OnLookup(var Text: Text): Boolean\n+ var\n+ Customer: Record Customer;\n+ begin\n+ if Customer.SelectCustomer(Customer) then begin\n+ xRec := Rec;\n+ Rec.\"Bill-to Name\" := Customer.Name;\n+ Rec.Validate(\"Bill-to Customer No.\", Customer.\"No.\");\n+ end;\n+\n+ if not ((BillToOptions = BillToOptions::\"Custom Address\") and not ShouldSearchForCustByName) then begin\n+ if Rec.GetFilter(\"Bill-to Customer No.\") = xRec.\"Bill-to Customer No.\" then\n+ if Rec.\"Bill-to Customer No.\" <> xRec.\"Bill-to Customer No.\" then\n+ Rec.SetRange(\"Bill-to Customer No.\");\n+\n+ CurrPage.Update();\n+ end;\n+ end;\n }\n field(\"Bill-to Address\"; Rec.\"Bill-to Address\")\n {\ndiff --git a/App/Layers/W1/BaseApp/Sales/Document/SalesQuote.Page.al b/App/Layers/W1/BaseApp/Sales/Document/SalesQuote.Page.al\nindex 7827a9ece78..5851f14e04b 100644\n--- a/App/Layers/W1/BaseApp/Sales/Document/SalesQuote.Page.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/SalesQuote.Page.al\n@@ -763,6 +763,23 @@ page 41 \"Sales Quote\"\n \n CurrPage.Update();\n end;\n+\n+ trigger OnLookup(var Text: Text): Boolean\n+ var\n+ Customer: Record Customer;\n+ begin\n+ if Customer.SelectCustomer(Customer) then begin\n+ xRec := Rec;\n+ Rec.\"Bill-to Name\" := Customer.Name;\n+ Rec.Validate(\"Bill-to Customer No.\", Customer.\"No.\");\n+ end;\n+\n+ if Rec.GetFilter(\"Bill-to Customer No.\") = xRec.\"Bill-to Customer No.\" then\n+ if Rec.\"Bill-to Customer No.\" <> xRec.\"Bill-to Customer No.\" then\n+ Rec.SetRange(\"Bill-to Customer No.\");\n+\n+ CurrPage.Update();\n+ end;\n }\n field(\"Bill-to Address\"; Rec.\"Bill-to Address\")\n {\ndiff --git a/App/Layers/W1/BaseApp/Sales/Document/SalesReturnOrder.Page.al b/App/Layers/W1/BaseApp/Sales/Document/SalesReturnOrder.Page.al\nindex e9c58725477..a0e9bb787e7 100644\n--- a/App/Layers/W1/BaseApp/Sales/Document/SalesReturnOrder.Page.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/SalesReturnOrder.Page.al\n@@ -613,6 +613,23 @@ page 6630 \"Sales Return Order\"\n \n CurrPage.Update();\n end;\n+\n+ trigger OnLookup(var Text: Text): Boolean\n+ var\n+ Customer: Record Customer;\n+ begin\n+ if Customer.SelectCustomer(Customer) then begin\n+ xRec := Rec;\n+ Rec.\"Bill-to Name\" := Customer.Name;\n+ Rec.Validate(\"Bill-to Customer No.\", Customer.\"No.\");\n+ end;\n+\n+ if Rec.GetFilter(\"Bill-to Customer No.\") = xRec.\"Bill-to Customer No.\" then\n+ if Rec.\"Bill-to Customer No.\" <> xRec.\"Bill-to Customer No.\" then\n+ Rec.SetRange(\"Bill-to Customer No.\");\n+\n+ CurrPage.Update();\n+ end;\n }\n field(\"Bill-to Address\"; Rec.\"Bill-to Address\")\n {\n"} +{"repo": "microsoftInternal/NAV", "instance_id": "microsoftInternal__NAV-199883", "base_commit": "aaf1c6d95a374d426984ab59eacb82f1047659b5", "created_at": "2024-11-12", "environment_setup_version": "24.2", "project_paths": ["App\\Layers\\W1\\BaseApp", "App\\Layers\\W1\\Tests\\SCM"], "hints_text": "", "FAIL_TO_PASS": [{"codeunitID": 137033, "functionName": ["BinContentMovementBlockedThrowsErrorWhenPostingItemJournal"]}], "PASS_TO_PASS": [], "problem_statement": "Title: [master] [ALL-E] Bin Content Block Movement is not considered when posting an item journal.\nRepro Steps:\nOpen Cronus 24.2. Go to locations. Go to the warehouse employees and add location SILVER to your user Go to the item journal.Create an entry as follows:Item No \"1896-S\"Location: SILVERBin code: S-01-0001Quantity: 40post Go to Bin ContentsSelect your entry -> Block Movement: All. Go to the item journal Create an entry as follows:Item No \"1896-S\"Location: SILVERBin code: S-01-0001Quantity: 40post The Entry is posted successfully. Expected Results: The entry shouldn't be posted for the same Item No. Block Movement Specifies how the movement of a particular item, or bin content, into or out of this bin, is blocked. Actual Results: The entry is still posted even if the Bin content has a block movement on All. Investigation: Tested on 24.2 , 23.07 and 22.13 OnPrem and the same behavior happens. It seems to be that all settings are ignored for Block Movement I tried also with Inbound and Outbound and according postings and everything can be posted.\nDescription:\nBin Content Block Movement Doesn't work as expected\n", "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\nindex 4d85519ac9a..a2506b2d267 100644\n--- a/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\n@@ -34,6 +34,8 @@\n OneEntryExpectedErr: Label 'Only one Item Ledger Entry is expected.';\n MultipleEntriesExpectedErr: Label 'Two Item Ledger Entries expected.';\n RoundingTo0Err: Label 'Rounding of the field';\n+ BlockedBinContentErr: Label 'Block Movement must not be All in Bin Content Location Code=''%1'',Bin Code=''%2'',Item No.=''%3'',Variant Code=''%4'',Unit of Measure Code=''%5''.',\n+ Comment = '%1= Location Code, %2= Bin Code, %3= Item No., %4= Varient Code, %5= Unit of Measure Code';\n \n [Test]\n [Scope('OnPrem')]\n@@ -2091,6 +2093,86 @@\n Assert.RecordIsEmpty(RecordLink);\n end;\n \n+ [Test]\n+ procedure BinContentMovementBlockedThrowsErrorWhenPostingItemJournal()\n+ var\n+ Bin: Record Bin;\n+ BinContent: Record \"Bin Content\";\n+ Item: Record Item;\n+ ItemJournalTemplate: Record \"Item Journal Template\";\n+ ItemJournalBatch: Record \"Item Journal Batch\";\n+ ItemJournalLine: Record \"Item Journal Line\";\n+ Location: Record Location;\n+ begin\n+ // [SCENARIO 538864] Bin Content Block Movement is considered when posting an Item Journal.\n+ Initialize();\n+\n+ // [GIVEN] Create an Item.\n+ LibraryInventory.CreateItem(Item);\n+\n+ // [GIVEN] Create a Location with require Bin and a Default Bin Code.\n+ LibraryWarehouse.CreateLocationWMS(Location, true, false, false, false, false);\n+\n+ // [GIVEN] Create a Bin.\n+ LibraryWarehouse.CreateBin(Bin, Location.Code, '', '', '');\n+\n+ // [GIVEN] Validate Default Bin Code in Location.\n+ Location.Validate(\"Default Bin Code\", Bin.Code);\n+ Location.Modify(true);\n+\n+ // [GIVEN] Select an Item Journal Template of Type Item.\n+ LibraryInventory.SelectItemJournalTemplateName(ItemJournalTemplate, ItemJournalTemplate.Type::Item);\n+\n+ // [GIVEN] Select an Item Journal Batch.\n+ LibraryInventory.SelectItemJournalBatchName(ItemJournalBatch, ItemJournalTemplate.Type::Item, ItemJournalTemplate.Name);\n+\n+ // [GIVEN] Create an Item Journal Line\n+ LibraryInventory.ClearItemJournal(ItemJournalTemplate, ItemJournalBatch);\n+ LibraryInventory.CreateItemJournalLine(\n+ ItemJournalLine,\n+ ItemJournalBatch.\"Journal Template Name\",\n+ ItemJournalBatch.Name,\n+ ItemJournalLine.\"Entry Type\"::Purchase,\n+ Item.\"No.\",\n+ LibraryRandom.RandInt(10));\n+\n+ // [GIVEN] Validate Location Code and Bin Code in Item Journal Line.\n+ ItemJournalLine.Validate(\"Location Code\", Location.Code);\n+ ItemJournalLine.Validate(\"Bin Code\", Bin.Code);\n+ ItemJournalLine.Modify(true);\n+\n+ // [GIVEN] Post an Item Journal.\n+ LibraryInventory.PostItemJournalLine(ItemJournalLine.\"Journal Template Name\", ItemJournalLine.\"Journal Batch Name\");\n+\n+ // [GIVEN] Find Bin Content and Validate Block Movement to All.\n+ BinContent.SetRange(\"Bin Code\", Bin.Code);\n+ BinContent.SetRange(\"Item No.\", Item.\"No.\");\n+ BinContent.SetRange(\"Location Code\", Location.Code);\n+ BinContent.FindFirst();\n+ BinContent.Validate(\"Block Movement\", BinContent.\"Block Movement\"::All);\n+ BinContent.Modify(true);\n+\n+ // [GIVEN] Clear an Item Journal\n+ LibraryInventory.ClearItemJournal(ItemJournalTemplate, ItemJournalBatch);\n+\n+ // [GIVEN] Create an Item Journal and Validate Location Code.\n+ LibraryInventory.CreateItemJournalLine(\n+ ItemJournalLine,\n+ ItemJournalBatch.\"Journal Template Name\",\n+ ItemJournalBatch.Name,\n+ ItemJournalLine.\"Entry Type\"::Purchase,\n+ Item.\"No.\",\n+ LibraryRandom.RandInt(10));\n+ ItemJournalLine.Validate(\"Location Code\", Location.Code);\n+ ItemJournalLine.Modify(true);\n+\n+ // [WHEN] Post an Item Journal.\n+ asserterror LibraryInventory.PostItemJournalLine(ItemJournalLine.\"Journal Template Name\", ItemJournalLine.\"Journal Batch Name\");\n+\n+ // [THEN] Error of Bin Content Movement blocked is raised.\n+ Assert.ExpectedError(StrSubstNo(BlockedBinContentErr, ItemJournalLine.\"Location Code\", ItemJournalLine.\"Bin Code\", ItemJournalLine.\"Item No.\", ItemJournalLine.\"Variant Code\", ItemJournalLine.\"Unit of Measure Code\"));\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Warehouse/Journal/WMSManagement.Codeunit.al b/App/Layers/W1/BaseApp/Warehouse/Journal/WMSManagement.Codeunit.al\nindex d165f3a21a7..08c0e53701b 100644\n--- a/App/Layers/W1/BaseApp/Warehouse/Journal/WMSManagement.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Warehouse/Journal/WMSManagement.Codeunit.al\n@@ -193,8 +193,10 @@ codeunit 7302 \"WMS Management\"\n GetBin(WarehouseJournalLine.\"Location Code\", WarehouseJournalLine.\"To Bin Code\");\n Bin.CheckIncreaseBin(Bin.Code, WarehouseJournalLine.\"Item No.\", WarehouseJournalLine.\"Qty. (Absolute)\", WarehouseJournalLine.Cubage, WarehouseJournalLine.Weight, WarehouseJournalLine.Cubage, WarehouseJournalLine.Weight, true, false);\n end;\n- end else\n+ end else begin\n CheckWarehouseClass(WarehouseJournalLine.\"Location Code\", WarehouseJournalLine.\"To Bin Code\", WarehouseJournalLine.\"Item No.\", WarehouseJournalLine.\"Variant Code\", WarehouseJournalLine.\"Unit of Measure Code\");\n+ CheckBinAndBinContentMovement(WarehouseJournalLine);\n+ end;\n SourceJnl::OutputJnl, SourceJnl::ConsumpJnl:\n if WarehouseJournalLine.\"To Bin Code\" <> '' then\n if Location.\"Bin Capacity Policy\" <> Location.\"Bin Capacity Policy\"::\"Never Check Capacity\" then\n@@ -1803,7 +1805,7 @@ codeunit 7302 \"WMS Management\"\n OnBeforeCheckBlockedBin(LocationCode, BinCode, ItemNo, VariantCode, UnitOfMeasureCode, CheckInbound, IsHandled);\n if not IsHandled then begin\n GetLocation(LocationCode);\n- if Location.\"Directed Put-away and Pick\" then\n+ if (Location.\"Directed Put-away and Pick\") or ((BinCode <> '') and (Location.\"Bin Capacity Policy\" = Location.\"Bin Capacity Policy\"::\"Never Check Capacity\")) then\n if BinContent.Get(LocationCode, BinCode, ItemNo, VariantCode, UnitOfMeasureCode) then begin\n if (CheckInbound and\n (BinContent.\"Block Movement\" in [BinContent.\"Block Movement\"::Inbound, BinContent.\"Block Movement\"::All])) or\n@@ -1848,6 +1850,19 @@ codeunit 7302 \"WMS Management\"\n exit(Bin2.\"Bin Type Code\");\n end;\n \n+ local procedure CheckBinAndBinContentMovement(WarehouseJournalLine: Record \"Warehouse Journal Line\")\n+ begin\n+ if WarehouseJournalLine.Quantity = 0 then\n+ exit;\n+\n+ case WarehouseJournalLine.\"Entry Type\" of\n+ WarehouseJournalLine.\"Entry Type\"::\"Positive Adjmt.\":\n+ CheckBlockedBin(WarehouseJournalLine.\"Location Code\", WarehouseJournalLine.\"To Bin Code\", WarehouseJournalLine.\"Item No.\", WarehouseJournalLine.\"Variant Code\", WarehouseJournalLine.\"Unit of Measure Code\", WarehouseJournalLine.Quantity > 0);\n+ WarehouseJournalLine.\"Entry Type\"::\"Negative Adjmt.\":\n+ CheckBlockedBin(WarehouseJournalLine.\"Location Code\", WarehouseJournalLine.\"To Bin Code\", WarehouseJournalLine.\"Item No.\", WarehouseJournalLine.\"Variant Code\", WarehouseJournalLine.\"Unit of Measure Code\", WarehouseJournalLine.Quantity < 0);\n+ end;\n+ end;\n+\n [IntegrationEvent(false, false)]\n local procedure OnAfterCheckBlockedBin(LocationCode: Code[10]; BinCode: Code[20]; ItemNo: Code[20]; VariantCode: Code[10]; UnitOfMeasureCode: Code[10]; CheckInbound: Boolean)\n begin\n"} From 1181ea0676fa57b6ac4bbf0944aa20553b4de3b9 Mon Sep 17 00:00:00 2001 From: Jiawen Sun Date: Tue, 18 Nov 2025 20:24:41 +0100 Subject: [PATCH 2/6] Use 25.0 Now --- dataset/bcbench_nav.jsonl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dataset/bcbench_nav.jsonl b/dataset/bcbench_nav.jsonl index 498be4680..bd80b689e 100644 --- a/dataset/bcbench_nav.jsonl +++ b/dataset/bcbench_nav.jsonl @@ -23,4 +23,4 @@ {"repo": "microsoftInternal/NAV", "instance_id": "microsoftInternal__NAV-206527", "base_commit": "d8e867062d4137cf5df2d9d2b8a71bb53210f685", "created_at": "2025-02-07", "environment_setup_version": "26.0", "project_paths": ["App\\Layers\\W1\\BaseApp", "App\\Layers\\W1\\Tests\\SCM"], "hints_text": "", "FAIL_TO_PASS": [{"codeunitID": 137088, "functionName": ["ReleasedProdOrderQuantityPerandExpectedQtyRoundingPrecisionChecking"]}], "PASS_TO_PASS": [], "problem_statement": "Title: If a component's Item UOM has a 'Quantity Rounding Precision' of 1, & a Finished Good consumes partial quantity, the Prod. Order created from the Planning of a Sales Order pulls in the Component with a 'Qty. Per' and 'Exp. Qty.' of 0.\nRepro Steps:\n1. Use existing Item with no activity, or create new item. This will be the COMPONENT Item. Will use PCS as UOM.\n2. For the Component Item, go into Related > Item UOM > and set 'Quantity Rounding Precision' = 1 on the bottom.\n3. Component Item should have\n Replenishment System = PURCHASE\n Rounding Precision = .01\n Reorder Policy = Lot-for-Lot\n Include Inventory = TRUE\n4. Then have another Item, I'll call it FG Item which is:\n Replenishment System = PRODUNCTION ORDER\n Rounding Precision = 1\n Reorder Policy = ORDER\n Production BOM => Create new Certified Production BOM that consumes COMPONENT Item with 'Quantity Per' = .09\n5. Now create Sales Order for any Customer for FG Item for 1 Quantity at BLUE (or MAIN) location.\n6. On the Sales Order go to Actions > Plan > Planning > Create Prod. Order and choose 'Released' and 'Item Order'.\n7. Then choose Order Tracking and then 'Show' which will take you to the Released Prod. Order.\n8. We will see prod. Order for FG Item with 1 qty. Go to Line > Components\n\n**EXPECTED RESULTS** = 'Quantity Per' and 'Expected Quantity' = .09\n**ACTUAL RESULTS** = 'Quantity Per' and 'Expected Quantity' = 0\n\nIf you were then to delete the Released Production Order, and go to the Planning Worksheet and run the Calc. Regenerative Plan for the 2 items, you would receive an error:\n\"The value in the Qty. Rounding Precision field on the Item Unit of Measure page is causing the rounding precision for the Expected Quantity field to be incorrect.\"\n\nDescription:\n2If a component's Item UOM has a 'Quantity Rounding Precision' set to 1, and a Finished Good consumes partial quantity, the Production Order created from the Planning section of a Sales Order pulls in the Component but with a 'Quantity Per' and 'Expected Quantity' of 0. If we are producing 1 FG Item and the 'Quantity Per' is set to consume .1 component, we would expect 'Quantity Per' and 'Expected Quantity' both = .1. There is no error message.\n\nBut if you run the Planning Worksheet's 'Calc. Regenerative Plan', then you will get an error message about the 'Quantity Rounding Precision'.\n\nI don't believe the 'Quantity Rounding Precision' in the Item UOM should have any influence on this process. I always thought this field was only for scenario with Picking and when Base UOM is larger than the smallest UOM, and picking in smallest UOM. There is a lot of confusion about this 'Quantity Rounding Precision' field within the Item UOM actually.\n", "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMOrderPlanningIII.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMOrderPlanningIII.Codeunit.al\nindex 7415eaa53cc..2573227dbca 100644\n--- a/App/Layers/W1/Tests/SCM/SCMOrderPlanningIII.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMOrderPlanningIII.Codeunit.al\n@@ -45,6 +45,8 @@ codeunit 137088 \"SCM Order Planning - III\"\n LineExistErr: Label 'Requistion line in %1 worksheet should exist for item %2';\n PurchaseLineQuantityBaseErr: Label '%1.%2 must be nearly equal to %3.', Comment = '%1 : Purchase Line, %2 : Quantity (Base), %3 : Value.';\n BOMFixedQtyCalcFormulaErr: Label 'BOM Fixed Quantity Calculation Formula should be used to calculate the values.';\n+ RelesedProdOrderComponentQtyPerRoundingErr: Label 'Relesed Production Order Item Component Quantity per %1 Not Match With Expected Result %2';\n+ RelesedProdOrderComponentExpQtyRoundingErr: Label 'Relesed Production Order Item Component Expected Quantity %1 Not Match With Expected Result %2';\n \n [Test]\n [HandlerFunctions('MakeSupplyOrdersPageHandler')]\n@@ -2988,6 +2990,73 @@ codeunit 137088 \"SCM Order Planning - III\"\n VerifyStartingTimeOnFirmPlannedProductionOrder(StartingTime, ChildItem.\"No.\", ProductionOrderNo);\n end;\n \n+ [Test]\n+ [HandlerFunctions('ModalPageHandler,ErrorMessageHandler')]\n+ procedure ReleasedProdOrderQuantityPerandExpectedQtyRoundingPrecisionChecking()\n+ var\n+ BaseItemUnitOfMeasure: Record \"Item Unit of Measure\";\n+ ComponentItem: Record Item;\n+ ProdOrderComp: Record \"Prod. Order Component\";\n+ ProdOrderLine: Record \"Prod. Order Line\";\n+ ProductionBOMHeader: Record \"Production BOM Header\";\n+ ProductionBOMLine: Record \"Production BOM Line\";\n+ ProductionOrder: Record \"Production Order\";\n+ ProductItem: Record Item;\n+ SalesHeader: Record \"Sales Header\";\n+ ExpectedQty: Decimal;\n+ RelesedProdOrderNo: Code[20];\n+ Status: Enum \"Production Order Status\";\n+ begin\n+ // [SCENARIO 562766] If a component's Item UOM has a 'Quantity Rounding Precision' of 1, & a Finished Good consumes partial quantity, \n+ // the Prod. Order created from the Planning of a Sales Order pulls in the Component with a 'Qty. Per' and 'Exp. Qty.' of 0.\n+ Initialize();\n+\n+ // [GIVEN] Created Component Item\n+ LibraryInventory.CreateItem(ComponentItem);\n+ ComponentItem.Validate(\"Replenishment System\", ComponentItem.\"Replenishment System\"::Purchase);\n+ ComponentItem.Validate(\"Rounding Precision\", LibraryRandom.RandPrecision());\n+ ComponentItem.Validate(\"Reordering Policy\", ComponentItem.\"Reordering Policy\"::\"Lot-for-Lot\");\n+ ComponentItem.Validate(\"Include Inventory\", true);\n+ ComponentItem.Modify(true);\n+\n+ // [GIVEN] Set Qty. Rounding Precision = 1 for Component Item\n+ BaseItemUnitOfMeasure.Get(ComponentItem.\"No.\", ComponentItem.\"Base Unit of Measure\");\n+ BaseItemUnitOfMeasure.Validate(\"Qty. Rounding Precision\", 1);\n+ BaseItemUnitOfMeasure.Modify();\n+\n+ // [GIVEN] Created Production Bom using Component Item\n+ LibraryManufacturing.CreateProductionBOMHeader(ProductionBOMHeader, ComponentItem.\"Base Unit of Measure\");\n+ LibraryManufacturing.CreateProductionBOMLine(ProductionBOMHeader, ProductionBOMLine, '', ProductionBOMLine.Type::Item, ComponentItem.\"No.\", LibraryRandom.RandDecInDecimalRange(0.01, 0.99, 2));\n+ ProductionBOMHeader.Validate(Status, ProductionBOMHeader.Status::Certified);\n+ ProductionBOMHeader.Modify();\n+\n+ // [GIVEN] Created Master Item and Production Bom Assigned to Master Item\n+ LibraryInventory.CreateItem(ProductItem);\n+ ProductItem.Validate(\"Replenishment System\", ProductItem.\"Replenishment System\"::\"Prod. Order\");\n+ ProductItem.Validate(\"Rounding Precision\", 1);\n+ ProductItem.Validate(\"Reordering Policy\", ProductItem.\"Reordering Policy\"::Order);\n+ ProductItem.Validate(\"Production BOM No.\", ProductionBOMHeader.\"No.\");\n+ ProductItem.Modify(true);\n+\n+ // [GIVEN] Created Sales Order Using Master Item Quantity - 1\n+ CreateSalesOrder(SalesHeader, ProductItem.\"No.\", '', 1, 1);\n+\n+ // [WHEN] Created Released Prod. Order From Sales Order Using Planning\n+ LibraryPlanning.CreateProdOrderUsingPlanning(ProductionOrder, Status::\"Firm Planned\", SalesHeader.\"No.\", ProductItem.\"No.\");\n+ RelesedProdOrderNo := LibraryManufacturing.ChangeStatusFirmPlanToReleased(ProductionOrder.\"No.\");\n+\n+ // [WHEN] Find Released Production Order Component\n+ FindProdOrderLine(ProdOrderLine, RelesedProdOrderNo);\n+ FindProdOrderComponent(ProdOrderComp, ProdOrderLine.\"Prod. Order No.\", ComponentItem.\"No.\");\n+\n+ // [WHEN] Getting Expected result using Component Rounding Precision\n+ ExpectedQty := Round(ProductionBOMLine.\"Quantity per\" * BaseItemUnitOfMeasure.\"Qty. Rounding Precision\" / BaseItemUnitOfMeasure.\"Qty. Rounding Precision\", ComponentItem.\"Rounding Precision\");\n+\n+ // [THEN] Expected Quantity must be Equal to Production Order Component \"Quantity per\" And \"Expected Quantity\"\n+ Assert.AreEqual(ExpectedQty, ProdOrderComp.\"Quantity per\", StrSubstNo(RelesedProdOrderComponentQtyPerRoundingErr, ProdOrderComp.\"Quantity per\", ExpectedQty));\n+ Assert.AreEqual(ExpectedQty, ProdOrderComp.\"Expected Quantity\", StrSubstNo(RelesedProdOrderComponentExpQtyRoundingErr, ProdOrderComp.\"Expected Quantity\", ExpectedQty));\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n@@ -3805,6 +3874,14 @@ codeunit 137088 \"SCM Order Planning - III\"\n Assert.IsTrue(ProductionOrder.\"Starting Time\" = StartingTime, '');\n end;\n \n+ local procedure FindProdOrderLine(var ProdOrderLine: Record \"Prod. Order Line\"; ProductionOrderNo: Code[20])\n+ begin\n+ ProdOrderLine.Reset();\n+ ProdOrderLine.SetRange(Status, ProdOrderLine.Status::Released);\n+ ProdOrderLine.SetRange(\"Prod. Order No.\", ProductionOrderNo);\n+ ProdOrderLine.FindFirst();\n+ end;\n+\n [ModalPageHandler]\n [Scope('OnPrem')]\n procedure MakeSupplyOrdersPageHandler(var MakeSupplyOrders: Page \"Make Supply Orders\"; var Response: Action)\n@@ -3911,5 +3988,16 @@ codeunit 137088 \"SCM Order Planning - III\"\n begin\n Reply := true;\n end;\n+\n+ [ModalPageHandler]\n+ procedure ModalPageHandler(var CreateOrderFromSales: Page \"Create Order From Sales\"; var Response: Action)\n+ begin\n+ Response := Action::Yes;\n+ end;\n+\n+ [MessageHandler]\n+ procedure ErrorMessageHandler(Message: Text[1024])\n+ begin\n+ end;\n }\n \n", "patch": "diff --git a/App/Layers/IT/BaseApp/Manufacturing/Document/CalculateProdOrder.Codeunit.al b/App/Layers/IT/BaseApp/Manufacturing/Document/CalculateProdOrder.Codeunit.al\nindex 5f7a2b890fe..5b63565d0f1 100644\n--- a/App/Layers/IT/BaseApp/Manufacturing/Document/CalculateProdOrder.Codeunit.al\n+++ b/App/Layers/IT/BaseApp/Manufacturing/Document/CalculateProdOrder.Codeunit.al\n@@ -43,6 +43,7 @@ codeunit 99000773 \"Calculate Prod. Order\"\n ProdOrderComp: Record \"Prod. Order Component\";\n ProdOrderRoutingLine2: Record \"Prod. Order Routing Line\";\n ProdBOMLine: array[99] of Record \"Production BOM Line\";\n+ ProdLineItem: Record Item;\n UOMMgt: Codeunit \"Unit of Measure Management\";\n MfgCostCalcMgt: Codeunit \"Mfg. Cost Calculation Mgt.\";\n VersionMgt: Codeunit VersionManagement;\n@@ -286,8 +287,8 @@ codeunit 99000773 \"Calculate Prod. Order\"\n \n local procedure TransferBOMProcessItem(Level: Integer; LineQtyPerUOM: Decimal; ItemQtyPerUOM: Decimal; var ErrorOccured: Boolean)\n var\n- Item2: Record Item;\n ComponentSKU: Record \"Stockkeeping Unit\";\n+ Item2: Record Item;\n IsHandled: Boolean;\n QtyRoundPrecision: Decimal;\n begin\n@@ -323,6 +324,7 @@ codeunit 99000773 \"Calculate Prod. Order\"\n ProdOrderComp.Validate(\"Unit of Measure Code\", ProdBOMLine[Level].\"Unit of Measure Code\");\n if (ProdOrderComp.\"Item No.\" <> '') and Item2.Get(ProdOrderComp.\"Item No.\") then\n QtyRoundPrecision := UOMMgt.GetQtyRoundingPrecision(Item2, ProdBOMLine[Level].\"Unit of Measure Code\");\n+ CheckingRoundingPrecision(Item2, ProdLineItem, QtyRoundPrecision, Level);\n if QtyRoundPrecision <> 0 then\n ProdOrderComp.\"Quantity per\" := Round(ProdBOMLine[Level].\"Quantity per\" * LineQtyPerUOM / ItemQtyPerUOM, QtyRoundPrecision)\n else\n@@ -1001,6 +1003,21 @@ codeunit 99000773 \"Calculate Prod. Order\"\n ProdOrderLineToCheck.TestField(Quantity);\n end;\n \n+ local procedure CheckingRoundingPrecision(ChildItem: Record Item; ProdLineItem: Record Item; var QtyRoundPrecision: Decimal; Level: Integer)\n+ begin\n+ if (ChildItem.\"Rounding Precision\" = 0) or (QtyRoundPrecision = 0) then\n+ exit;\n+\n+ if (not ProdLineItem.Get(ProdOrderLine.\"Item No.\")) or (ProdLineItem.\"Replenishment System\" <> ProdLineItem.\"Replenishment System\"::\"Prod. Order\") then\n+ exit;\n+\n+ if (ChildItem.\"Base Unit of Measure\" <> ProdBOMLine[Level].\"Unit of Measure Code\") then\n+ exit;\n+ QtyRoundPrecision := ChildItem.\"Rounding Precision\";\n+ ProdOrderComp.\"Qty. Rounding Precision\" := ChildItem.\"Rounding Precision\";\n+ ProdOrderComp.\"Qty. Rounding Precision (Base)\" := ChildItem.\"Rounding Precision\";\n+ end;\n+\n [IntegrationEvent(false, false)]\n local procedure OnAfterInsertProdRoutingLine(var ProdOrderRoutingLine: Record \"Prod. Order Routing Line\"; ProdOrderLine: Record \"Prod. Order Line\")\n begin\ndiff --git a/App/Layers/W1/BaseApp/Manufacturing/Document/CalculateProdOrder.Codeunit.al b/App/Layers/W1/BaseApp/Manufacturing/Document/CalculateProdOrder.Codeunit.al\nindex 36930a9e2aa..5d44df0a596 100644\n--- a/App/Layers/W1/BaseApp/Manufacturing/Document/CalculateProdOrder.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Manufacturing/Document/CalculateProdOrder.Codeunit.al\n@@ -43,6 +43,7 @@ codeunit 99000773 \"Calculate Prod. Order\"\n ProdOrderComp: Record \"Prod. Order Component\";\n ProdOrderRoutingLine2: Record \"Prod. Order Routing Line\";\n ProdBOMLine: array[99] of Record \"Production BOM Line\";\n+ ProdLineItem: Record Item;\n UOMMgt: Codeunit \"Unit of Measure Management\";\n MfgCostCalcMgt: Codeunit \"Mfg. Cost Calculation Mgt.\";\n VersionMgt: Codeunit VersionManagement;\n@@ -260,8 +261,8 @@ codeunit 99000773 \"Calculate Prod. Order\"\n \n local procedure TransferBOMProcessItem(Level: Integer; LineQtyPerUOM: Decimal; ItemQtyPerUOM: Decimal; var ErrorOccured: Boolean)\n var\n- Item2: Record Item;\n ComponentSKU: Record \"Stockkeeping Unit\";\n+ Item2: Record Item;\n IsHandled: Boolean;\n QtyRoundPrecision: Decimal;\n begin\n@@ -297,6 +298,7 @@ codeunit 99000773 \"Calculate Prod. Order\"\n ProdOrderComp.Validate(\"Unit of Measure Code\", ProdBOMLine[Level].\"Unit of Measure Code\");\n if (ProdOrderComp.\"Item No.\" <> '') and Item2.Get(ProdOrderComp.\"Item No.\") then\n QtyRoundPrecision := UOMMgt.GetQtyRoundingPrecision(Item2, ProdBOMLine[Level].\"Unit of Measure Code\");\n+ CheckingRoundingPrecision(Item2, ProdLineItem, QtyRoundPrecision, Level);\n if QtyRoundPrecision <> 0 then\n ProdOrderComp.\"Quantity per\" := Round(ProdBOMLine[Level].\"Quantity per\" * LineQtyPerUOM / ItemQtyPerUOM, QtyRoundPrecision)\n else\n@@ -975,6 +977,21 @@ codeunit 99000773 \"Calculate Prod. Order\"\n ProdOrderLineToCheck.TestField(Quantity);\n end;\n \n+ local procedure CheckingRoundingPrecision(ChildItem: Record Item; ProdLineItem: Record Item; var QtyRoundPrecision: Decimal; Level: Integer)\n+ begin\n+ if (ChildItem.\"Rounding Precision\" = 0) or (QtyRoundPrecision = 0) then\n+ exit;\n+\n+ if (not ProdLineItem.Get(ProdOrderLine.\"Item No.\")) or (ProdLineItem.\"Replenishment System\" <> ProdLineItem.\"Replenishment System\"::\"Prod. Order\") then\n+ exit;\n+\n+ if (ChildItem.\"Base Unit of Measure\" <> ProdBOMLine[Level].\"Unit of Measure Code\") then\n+ exit;\n+ QtyRoundPrecision := ChildItem.\"Rounding Precision\";\n+ ProdOrderComp.\"Qty. Rounding Precision\" := ChildItem.\"Rounding Precision\";\n+ ProdOrderComp.\"Qty. Rounding Precision (Base)\" := ChildItem.\"Rounding Precision\";\n+ end;\n+\n [IntegrationEvent(false, false)]\n local procedure OnAfterInsertProdRoutingLine(var ProdOrderRoutingLine: Record \"Prod. Order Routing Line\"; ProdOrderLine: Record \"Prod. Order Line\")\n begin\n"} {"repo": "microsoftInternal/NAV", "instance_id": "microsoftInternal__NAV-208851", "base_commit": "b626cb16a65cd529d91527d1d5dac501d6ecb06e", "created_at": "2025-03-04", "environment_setup_version": "26.0", "project_paths": ["App\\Layers\\W1\\BaseApp", "App\\Layers\\W1\\Tests\\ERM"], "hints_text": "", "FAIL_TO_PASS": [{"codeunitID": 134117, "functionName": ["AmountTypeFieldDoesNotChangeOnClosePageSalesPriceList"]}], "PASS_TO_PASS": [], "problem_statement": "Title: In the Sales Price Lists, the 'Defines' field always defaults to Price & Discount when dealing with Customer Price Group/Customer Disc Group setting\nRepro Steps:\nReproduced in CRONUS GB v25.4\nEnable 'New Sales Price Experience' in Feature Management.\n1. Go to Sales Price Lists\n2. Click on New to generate a New Sales Price List.\n3. Set Assign-to-type to Customer Disc. Group\n4. View Columns for: **Discount**\n5. Insert a single item line, using only Line Discount.\n6. Set the Sales Price List to Status 'Active'\n7. Go back to the Sales Price Lists Page.\n\nYou will notice \"Defines\" has changed back to Prices & Discounts Same behavior is replicable with Price for Customer Price Group\n**Expected Result:** Defines should remain as Discounts if only discounts are in the Sales Price list\n**Actual Results:** 'Defines' Always defaults to 'Prices & Discount'\n\nDescription:\nThe issue is with the setting for the \"Defines\" field. The setting may be changed from 'Price & Discount' to 'Discount' because only Line Discounts may be used in the new Price Group configuration. However, after closing the Page, the system will always default back to the 'Price & Discount', even though only Line Discounts are defined, because the code doesn't pass the value correctly.\n\nThe Partner Developer highlighted the following code:\nThe call stack:\n- GetAmountType (\\ext11_packandshipchanges\\Table\\7005\\Price Source.dal:342)\n- GetDefaultAmountType (\\ext11_packandshipchanges\\Table\\7005\\Price Source.dal:182)\n- UpdateAmountType (\\ext11_packandshipchanges\\Table\\7000\\Price List Header.dal:567)\n- OnClosePage (\\ext11_packandshipchanges\\Page\\7016\\Sales Price List.dal:600)\n\nIn the Function:`UpdateAmountType`, the following code is used:\n\"Amount Type\" := PriceSource.GetDefaultAmountType(); The code reflects it as empty. No value is passed to it, so it always defaults to 'Price & Discount'\n", "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/PriceListsUI.Codeunit.al b/App/Layers/W1/Tests/ERM/PriceListsUI.Codeunit.al\nindex 5f586214ecb..c18252ac131 100644\n--- a/App/Layers/W1/Tests/ERM/PriceListsUI.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/PriceListsUI.Codeunit.al\n@@ -4366,6 +4366,39 @@ codeunit 134117 \"Price Lists UI\"\n PurchasePriceList.Caption()));\n end;\n \n+ [Test]\n+ procedure AmountTypeFieldDoesNotChangeOnClosePageSalesPriceList()\n+ var\n+ PriceListHeader: Record \"Price List Header\";\n+ CustomerDiscountGroup: Record \"Customer Discount Group\";\n+ SalesPriceList: TestPage \"Sales Price List\";\n+ PriceListHeaderCode: Code[20];\n+ begin\n+ // [SCENARIO 566994] Bug fix to ensure the field \"Amount Type\" does not change after closing the page \"Sales Price List\" \n+ Initialize(true);\n+\n+ // [GIVEN] Sales Price List for discount\n+ PriceListHeaderCode := LibraryUtility.GenerateGUID();\n+ SalesPriceList.OpenEdit();\n+ SalesPriceList.New();\n+ SalesPriceList.Code.SetValue(PriceListHeaderCode);\n+ SalesPriceList.Description.SetValue(LibraryUtility.GenerateGUID());\n+ SalesPriceList.SourceType.SetValue(\"Price Source Type\"::\"Customer Disc. Group\");\n+ SalesPriceList.AmountType.SetValue(\"Price Amount Type\"::Discount);\n+ CustomerDiscountGroup.Init();\n+ CustomerDiscountGroup.Code := LibraryUtility.GenerateGUID();\n+ CustomerDiscountGroup.Insert();\n+ SalesPriceList.AssignToNo.SetValue(CustomerDiscountGroup.Code);\n+ SalesPriceList.Status.SetValue(\"Price Status\"::Active);\n+\n+ // [WHEN] Close the page \"Sales Price List\"\n+ SalesPriceList.Close();\n+\n+ // [THEN] Check the field \"Amount Type\" has not reverted to Price & Discount\n+ PriceListHeader.Get(PriceListHeaderCode);\n+ Assert.IsTrue((PriceListHeader.\"Amount Type\" = PriceListHeader.\"Amount Type\"::Discount), 'The field \"Amount Type\" has changed after closing the page \"Sales Price List\"');\n+ end;\n+\n local procedure Initialize(Enable: Boolean)\n var\n PriceListHeader: Record \"Price List Header\";\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Pricing/PriceList/PriceListHeader.Table.al b/App/Layers/W1/BaseApp/Pricing/PriceList/PriceListHeader.Table.al\nindex fb6adbb607d..9e6fd459241 100644\n--- a/App/Layers/W1/BaseApp/Pricing/PriceList/PriceListHeader.Table.al\n+++ b/App/Layers/W1/BaseApp/Pricing/PriceList/PriceListHeader.Table.al\n@@ -562,6 +562,7 @@ table 7000 \"Price List Header\"\n var\n xAmountType: Enum \"Price Amount Type\";\n begin\n+ CopyTo(PriceSource);\n xAmountType := \"Amount Type\";\n if \"Source Type\" in [\"Source Type\"::\"Customer Disc. Group\", \"Source Type\"::\"Customer Price Group\"] then\n \"Amount Type\" := PriceSource.GetDefaultAmountType()\n"} {"repo": "microsoftInternal/NAV", "instance_id": "microsoftInternal__NAV-208320", "base_commit": "d080f087349d4713e1782f2f2630819714cb6738", "created_at": "2025-02-27", "environment_setup_version": "26.0", "project_paths": ["App\\Layers\\W1\\BaseApp", "App\\Layers\\W1\\Tests\\ERM"], "hints_text": "", "FAIL_TO_PASS": [{"codeunitID": 134386, "functionName": ["UpdateEmailAndPhoneNoWhenChangeBillToOfSalesInvoice"]}], "PASS_TO_PASS": [], "problem_statement": "Title: The Email and Phone No. don't update when selecting Another Customer in the \"Bill-to\" field of a Sales Invoice\nRepro Steps:\n1. Go to Contacts and find CT000012 - \"Miss Patricia Doyle\" with 'Company Name' = (John Haddock Insurance Co.)\n2. Edit the contact and add any 'Phone Number' and 'Mobile Phone No.'\n3. Go to Sales Invoices and Create a new sales invoice and for Customer 10000.\n3. Go down to the Shipping and Billing tab and set 'Bill-to' = \"Another Customer\"\n Now see how more fields are introduced, including the Contact and Contact info with Phone numbers and email, should be for \"Mr. Andy Teal\" who is contact for Customer 10000.\n5. Then set Name = 30000 (John Haddock Insurance Co.) and say yes to change bill-to customer.\nNotice we have Contact = \"Miss Patricia Doyle\"....\n\n**EXPECTED RESULTS:** The Phone Number(s) and Email for \"Miss Patricia Doyle\" should pull in.\n**ACTUAL RESULTS:** The fields are the same as they were for the previous contact \"Mr. Andy Teal\" and you need to refresh the Page so it pulls in the new Phone numbers and email for \"Mr. Andy Teal\" Contact.\nDescription:\nCopied and Derived from Support Case Review", "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/ERMSalesDocumentsII.Codeunit.al b/App/Layers/W1/Tests/ERM/ERMSalesDocumentsII.Codeunit.al\nindex bc3ad2bbe5c..30e993b56af 100644\n--- a/App/Layers/W1/Tests/ERM/ERMSalesDocumentsII.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ERMSalesDocumentsII.Codeunit.al\n@@ -4462,6 +4462,51 @@ codeunit 134386 \"ERM Sales Documents II\"\n SalesOrder.SalesLines.\"Invoice Discount Amount\".AssertEquals(SalesHeader.\"Invoice Discount Value\");\n end;\n \n+ [HandlerFunctions('CustomerLookupHandler,ConfirmHandlerYes')]\n+ [Test]\n+ procedure UpdateEmailAndPhoneNoWhenChangeBillToOfSalesInvoice()\n+ var\n+ Contact: array[2] of Record Contact;\n+ Customer: array[2] of Record Customer;\n+ SalesHeader: Record \"Sales Header\";\n+ SalesInvoice: TestPage \"Sales Invoice\";\n+ begin\n+ // [SCENARIO 564632] The Email and Phone No. should update when selecting Another Customer in the \"Bill-to\" field of a Sales Invoice\n+ Initialize();\n+\n+ // [GIVEN] Create First Customer with First Contact with Phone = \"111111111\", Mobile Phone = \"222222222\" and Email = \"contact1@mail.com\"\n+ LibraryMarketing.CreateContactWithCustomer(Contact[1], Customer[1]);\n+ UpdateContactInfo(Contact[1], '111111111', '222222222', 'contact1@mail.com');\n+ Contact[1].Modify(true);\n+\n+ // [GIVEN] Create Second Customer with Second Contact with Phone = \"333333333\", Mobile Phone = \"444444444\" and Email = \"contact2@mail.com\"\n+ LibraryMarketing.CreateContactWithCustomer(Contact[2], Customer[2]);\n+ UpdateContactInfo(Contact[2], '333333333', '444444444', 'contact2@mail.com');\n+ Contact[2].Modify(true);\n+\n+ // [GIVEN] Create Sales Invoice with First Customer\n+ LibrarySales.CreateSalesHeader(SalesHeader, SalesHeader.\"Document Type\"::Invoice, Customer[1].\"No.\");\n+\n+ // [GIVEN] Sales Invoice Card is opened\n+ LibraryVariableStorage.Enqueue(Customer[2].\"No.\");\n+ LibraryVariableStorage.Enqueue('');\n+ LibraryVariableStorage.Enqueue(true); // yes to change \"Bill-to Customer No.\"\n+ SalesInvoice.OpenEdit();\n+ SalesInvoice.FILTER.SetFilter(\"No.\", SalesHeader.\"No.\");\n+\n+ // [WHEN] Select Second Customer when lookup \"Bill-to Customer Name\"\n+ SalesInvoice.\"Bill-to Name\".Lookup();\n+\n+ // [THEN] Verify Sales Invoice \"Phone No.\" = \"333333333\"\n+ SalesInvoice.BillToContactPhoneNo.AssertEquals(Contact[2].\"Phone No.\");\n+\n+ // [THEN] Verify Sales Invoice \"Mobile Phone No.\" = \"444444444\"\n+ SalesInvoice.BillToContactMobilePhoneNo.AssertEquals(Contact[2].\"Mobile Phone No.\");\n+\n+ // [THEN] Verify Sales Invoice \"Email\" = \"contact2@mail.com\"\n+ SalesInvoice.BillToContactEmail.AssertEquals(Contact[2].\"E-Mail\");\n+ end;\n+\n [Test]\n [Scope('OnPrem')]\n procedure UpdateExtendedTextTypeNotAllowed()\n@@ -6595,5 +6640,14 @@ codeunit 134386 \"ERM Sales Documents II\"\n CustomerLookup.Filter.SetFilter(Name, LibraryVariableStorage.DequeueText());\n CustomerLookup.OK().Invoke();\n end;\n+\n+ [ModalPageHandler]\n+ procedure CustomerLookupHandler(var CustomerLookup: TestPage \"Customer Lookup\")\n+ begin\n+ CustomerLookup.GotoKey(LibraryVariableStorage.DequeueText());\n+ Assert.AreEqual(LibraryVariableStorage.DequeueText(),\n+ CustomerLookup.Filter.GetFilter(\"Date Filter\"), 'Wrong Date Filter.');\n+ CustomerLookup.OK().Invoke();\n+ end;\n }\n \n", "patch": "diff --git a/App/Layers/W1/BaseApp/Sales/Document/BlanketSalesOrder.Page.al b/App/Layers/W1/BaseApp/Sales/Document/BlanketSalesOrder.Page.al\nindex 1dee700e044..a3b2013773f 100644\n--- a/App/Layers/W1/BaseApp/Sales/Document/BlanketSalesOrder.Page.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/BlanketSalesOrder.Page.al\n@@ -648,6 +648,23 @@ page 507 \"Blanket Sales Order\"\n Rec.SetRange(\"Bill-to Customer No.\");\n CurrPage.Update();\n end;\n+\n+ trigger OnLookup(var Text: Text): Boolean\n+ var\n+ Customer: Record Customer;\n+ begin\n+ if Customer.SelectCustomer(Customer) then begin\n+ xRec := Rec;\n+ Rec.\"Bill-to Name\" := Customer.Name;\n+ Rec.Validate(\"Bill-to Customer No.\", Customer.\"No.\");\n+ end;\n+\n+ if Rec.GetFilter(\"Bill-to Customer No.\") = xRec.\"Bill-to Customer No.\" then\n+ if Rec.\"Bill-to Customer No.\" <> xRec.\"Bill-to Customer No.\" then\n+ Rec.SetRange(\"Bill-to Customer No.\");\n+\n+ CurrPage.Update();\n+ end;\n }\n field(\"Bill-to Address\"; Rec.\"Bill-to Address\")\n {\ndiff --git a/App/Layers/W1/BaseApp/Sales/Document/SalesCreditMemo.Page.al b/App/Layers/W1/BaseApp/Sales/Document/SalesCreditMemo.Page.al\nindex 84ba27e1b17..3f876b15fd0 100644\n--- a/App/Layers/W1/BaseApp/Sales/Document/SalesCreditMemo.Page.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/SalesCreditMemo.Page.al\n@@ -552,6 +552,23 @@ page 44 \"Sales Credit Memo\"\n \n CurrPage.Update();\n end;\n+\n+ trigger OnLookup(var Text: Text): Boolean\n+ var\n+ Customer: Record Customer;\n+ begin\n+ if Customer.SelectCustomer(Customer) then begin\n+ xRec := Rec;\n+ Rec.\"Bill-to Name\" := Customer.Name;\n+ Rec.Validate(\"Bill-to Customer No.\", Customer.\"No.\");\n+ end;\n+\n+ if Rec.GetFilter(\"Bill-to Customer No.\") = xRec.\"Bill-to Customer No.\" then\n+ if Rec.\"Bill-to Customer No.\" <> xRec.\"Bill-to Customer No.\" then\n+ Rec.SetRange(\"Bill-to Customer No.\");\n+\n+ CurrPage.Update();\n+ end;\n }\n field(\"Bill-to Address\"; Rec.\"Bill-to Address\")\n {\ndiff --git a/App/Layers/W1/BaseApp/Sales/Document/SalesInvoice.Page.al b/App/Layers/W1/BaseApp/Sales/Document/SalesInvoice.Page.al\nindex ee0d93e0f64..930047f5653 100644\n--- a/App/Layers/W1/BaseApp/Sales/Document/SalesInvoice.Page.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/SalesInvoice.Page.al\n@@ -803,6 +803,25 @@ page 43 \"Sales Invoice\"\n CurrPage.Update();\n end;\n end;\n+\n+ trigger OnLookup(var Text: Text): Boolean\n+ var\n+ Customer: Record Customer;\n+ begin\n+ if Customer.SelectCustomer(Customer) then begin\n+ xRec := Rec;\n+ Rec.\"Bill-to Name\" := Customer.Name;\n+ Rec.Validate(\"Bill-to Customer No.\", Customer.\"No.\");\n+ end;\n+\n+ if not ((BillToOptions = BillToOptions::\"Custom Address\") and not ShouldSearchForCustByName) then begin\n+ if Rec.GetFilter(\"Bill-to Customer No.\") = xRec.\"Bill-to Customer No.\" then\n+ if Rec.\"Bill-to Customer No.\" <> xRec.\"Bill-to Customer No.\" then\n+ Rec.SetRange(\"Bill-to Customer No.\");\n+\n+ CurrPage.Update();\n+ end;\n+ end;\n }\n field(\"Bill-to Address\"; Rec.\"Bill-to Address\")\n {\ndiff --git a/App/Layers/W1/BaseApp/Sales/Document/SalesOrder.Page.al b/App/Layers/W1/BaseApp/Sales/Document/SalesOrder.Page.al\nindex 77cf2b1863e..2a751833971 100644\n--- a/App/Layers/W1/BaseApp/Sales/Document/SalesOrder.Page.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/SalesOrder.Page.al\n@@ -812,6 +812,25 @@ page 42 \"Sales Order\"\n CurrPage.Update();\n end;\n end;\n+\n+ trigger OnLookup(var Text: Text): Boolean\n+ var\n+ Customer: Record Customer;\n+ begin\n+ if Customer.SelectCustomer(Customer) then begin\n+ xRec := Rec;\n+ Rec.\"Bill-to Name\" := Customer.Name;\n+ Rec.Validate(\"Bill-to Customer No.\", Customer.\"No.\");\n+ end;\n+\n+ if not ((BillToOptions = BillToOptions::\"Custom Address\") and not ShouldSearchForCustByName) then begin\n+ if Rec.GetFilter(\"Bill-to Customer No.\") = xRec.\"Bill-to Customer No.\" then\n+ if Rec.\"Bill-to Customer No.\" <> xRec.\"Bill-to Customer No.\" then\n+ Rec.SetRange(\"Bill-to Customer No.\");\n+\n+ CurrPage.Update();\n+ end;\n+ end;\n }\n field(\"Bill-to Address\"; Rec.\"Bill-to Address\")\n {\ndiff --git a/App/Layers/W1/BaseApp/Sales/Document/SalesQuote.Page.al b/App/Layers/W1/BaseApp/Sales/Document/SalesQuote.Page.al\nindex 7827a9ece78..5851f14e04b 100644\n--- a/App/Layers/W1/BaseApp/Sales/Document/SalesQuote.Page.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/SalesQuote.Page.al\n@@ -763,6 +763,23 @@ page 41 \"Sales Quote\"\n \n CurrPage.Update();\n end;\n+\n+ trigger OnLookup(var Text: Text): Boolean\n+ var\n+ Customer: Record Customer;\n+ begin\n+ if Customer.SelectCustomer(Customer) then begin\n+ xRec := Rec;\n+ Rec.\"Bill-to Name\" := Customer.Name;\n+ Rec.Validate(\"Bill-to Customer No.\", Customer.\"No.\");\n+ end;\n+\n+ if Rec.GetFilter(\"Bill-to Customer No.\") = xRec.\"Bill-to Customer No.\" then\n+ if Rec.\"Bill-to Customer No.\" <> xRec.\"Bill-to Customer No.\" then\n+ Rec.SetRange(\"Bill-to Customer No.\");\n+\n+ CurrPage.Update();\n+ end;\n }\n field(\"Bill-to Address\"; Rec.\"Bill-to Address\")\n {\ndiff --git a/App/Layers/W1/BaseApp/Sales/Document/SalesReturnOrder.Page.al b/App/Layers/W1/BaseApp/Sales/Document/SalesReturnOrder.Page.al\nindex e9c58725477..a0e9bb787e7 100644\n--- a/App/Layers/W1/BaseApp/Sales/Document/SalesReturnOrder.Page.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/SalesReturnOrder.Page.al\n@@ -613,6 +613,23 @@ page 6630 \"Sales Return Order\"\n \n CurrPage.Update();\n end;\n+\n+ trigger OnLookup(var Text: Text): Boolean\n+ var\n+ Customer: Record Customer;\n+ begin\n+ if Customer.SelectCustomer(Customer) then begin\n+ xRec := Rec;\n+ Rec.\"Bill-to Name\" := Customer.Name;\n+ Rec.Validate(\"Bill-to Customer No.\", Customer.\"No.\");\n+ end;\n+\n+ if Rec.GetFilter(\"Bill-to Customer No.\") = xRec.\"Bill-to Customer No.\" then\n+ if Rec.\"Bill-to Customer No.\" <> xRec.\"Bill-to Customer No.\" then\n+ Rec.SetRange(\"Bill-to Customer No.\");\n+\n+ CurrPage.Update();\n+ end;\n }\n field(\"Bill-to Address\"; Rec.\"Bill-to Address\")\n {\n"} -{"repo": "microsoftInternal/NAV", "instance_id": "microsoftInternal__NAV-199883", "base_commit": "aaf1c6d95a374d426984ab59eacb82f1047659b5", "created_at": "2024-11-12", "environment_setup_version": "24.2", "project_paths": ["App\\Layers\\W1\\BaseApp", "App\\Layers\\W1\\Tests\\SCM"], "hints_text": "", "FAIL_TO_PASS": [{"codeunitID": 137033, "functionName": ["BinContentMovementBlockedThrowsErrorWhenPostingItemJournal"]}], "PASS_TO_PASS": [], "problem_statement": "Title: [master] [ALL-E] Bin Content Block Movement is not considered when posting an item journal.\nRepro Steps:\nOpen Cronus 24.2. Go to locations. Go to the warehouse employees and add location SILVER to your user Go to the item journal.Create an entry as follows:Item No \"1896-S\"Location: SILVERBin code: S-01-0001Quantity: 40post Go to Bin ContentsSelect your entry -> Block Movement: All. Go to the item journal Create an entry as follows:Item No \"1896-S\"Location: SILVERBin code: S-01-0001Quantity: 40post The Entry is posted successfully. Expected Results: The entry shouldn't be posted for the same Item No. Block Movement Specifies how the movement of a particular item, or bin content, into or out of this bin, is blocked. Actual Results: The entry is still posted even if the Bin content has a block movement on All. Investigation: Tested on 24.2 , 23.07 and 22.13 OnPrem and the same behavior happens. It seems to be that all settings are ignored for Block Movement I tried also with Inbound and Outbound and according postings and everything can be posted.\nDescription:\nBin Content Block Movement Doesn't work as expected\n", "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\nindex 4d85519ac9a..a2506b2d267 100644\n--- a/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\n@@ -34,6 +34,8 @@\n OneEntryExpectedErr: Label 'Only one Item Ledger Entry is expected.';\n MultipleEntriesExpectedErr: Label 'Two Item Ledger Entries expected.';\n RoundingTo0Err: Label 'Rounding of the field';\n+ BlockedBinContentErr: Label 'Block Movement must not be All in Bin Content Location Code=''%1'',Bin Code=''%2'',Item No.=''%3'',Variant Code=''%4'',Unit of Measure Code=''%5''.',\n+ Comment = '%1= Location Code, %2= Bin Code, %3= Item No., %4= Varient Code, %5= Unit of Measure Code';\n \n [Test]\n [Scope('OnPrem')]\n@@ -2091,6 +2093,86 @@\n Assert.RecordIsEmpty(RecordLink);\n end;\n \n+ [Test]\n+ procedure BinContentMovementBlockedThrowsErrorWhenPostingItemJournal()\n+ var\n+ Bin: Record Bin;\n+ BinContent: Record \"Bin Content\";\n+ Item: Record Item;\n+ ItemJournalTemplate: Record \"Item Journal Template\";\n+ ItemJournalBatch: Record \"Item Journal Batch\";\n+ ItemJournalLine: Record \"Item Journal Line\";\n+ Location: Record Location;\n+ begin\n+ // [SCENARIO 538864] Bin Content Block Movement is considered when posting an Item Journal.\n+ Initialize();\n+\n+ // [GIVEN] Create an Item.\n+ LibraryInventory.CreateItem(Item);\n+\n+ // [GIVEN] Create a Location with require Bin and a Default Bin Code.\n+ LibraryWarehouse.CreateLocationWMS(Location, true, false, false, false, false);\n+\n+ // [GIVEN] Create a Bin.\n+ LibraryWarehouse.CreateBin(Bin, Location.Code, '', '', '');\n+\n+ // [GIVEN] Validate Default Bin Code in Location.\n+ Location.Validate(\"Default Bin Code\", Bin.Code);\n+ Location.Modify(true);\n+\n+ // [GIVEN] Select an Item Journal Template of Type Item.\n+ LibraryInventory.SelectItemJournalTemplateName(ItemJournalTemplate, ItemJournalTemplate.Type::Item);\n+\n+ // [GIVEN] Select an Item Journal Batch.\n+ LibraryInventory.SelectItemJournalBatchName(ItemJournalBatch, ItemJournalTemplate.Type::Item, ItemJournalTemplate.Name);\n+\n+ // [GIVEN] Create an Item Journal Line\n+ LibraryInventory.ClearItemJournal(ItemJournalTemplate, ItemJournalBatch);\n+ LibraryInventory.CreateItemJournalLine(\n+ ItemJournalLine,\n+ ItemJournalBatch.\"Journal Template Name\",\n+ ItemJournalBatch.Name,\n+ ItemJournalLine.\"Entry Type\"::Purchase,\n+ Item.\"No.\",\n+ LibraryRandom.RandInt(10));\n+\n+ // [GIVEN] Validate Location Code and Bin Code in Item Journal Line.\n+ ItemJournalLine.Validate(\"Location Code\", Location.Code);\n+ ItemJournalLine.Validate(\"Bin Code\", Bin.Code);\n+ ItemJournalLine.Modify(true);\n+\n+ // [GIVEN] Post an Item Journal.\n+ LibraryInventory.PostItemJournalLine(ItemJournalLine.\"Journal Template Name\", ItemJournalLine.\"Journal Batch Name\");\n+\n+ // [GIVEN] Find Bin Content and Validate Block Movement to All.\n+ BinContent.SetRange(\"Bin Code\", Bin.Code);\n+ BinContent.SetRange(\"Item No.\", Item.\"No.\");\n+ BinContent.SetRange(\"Location Code\", Location.Code);\n+ BinContent.FindFirst();\n+ BinContent.Validate(\"Block Movement\", BinContent.\"Block Movement\"::All);\n+ BinContent.Modify(true);\n+\n+ // [GIVEN] Clear an Item Journal\n+ LibraryInventory.ClearItemJournal(ItemJournalTemplate, ItemJournalBatch);\n+\n+ // [GIVEN] Create an Item Journal and Validate Location Code.\n+ LibraryInventory.CreateItemJournalLine(\n+ ItemJournalLine,\n+ ItemJournalBatch.\"Journal Template Name\",\n+ ItemJournalBatch.Name,\n+ ItemJournalLine.\"Entry Type\"::Purchase,\n+ Item.\"No.\",\n+ LibraryRandom.RandInt(10));\n+ ItemJournalLine.Validate(\"Location Code\", Location.Code);\n+ ItemJournalLine.Modify(true);\n+\n+ // [WHEN] Post an Item Journal.\n+ asserterror LibraryInventory.PostItemJournalLine(ItemJournalLine.\"Journal Template Name\", ItemJournalLine.\"Journal Batch Name\");\n+\n+ // [THEN] Error of Bin Content Movement blocked is raised.\n+ Assert.ExpectedError(StrSubstNo(BlockedBinContentErr, ItemJournalLine.\"Location Code\", ItemJournalLine.\"Bin Code\", ItemJournalLine.\"Item No.\", ItemJournalLine.\"Variant Code\", ItemJournalLine.\"Unit of Measure Code\"));\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Warehouse/Journal/WMSManagement.Codeunit.al b/App/Layers/W1/BaseApp/Warehouse/Journal/WMSManagement.Codeunit.al\nindex d165f3a21a7..08c0e53701b 100644\n--- a/App/Layers/W1/BaseApp/Warehouse/Journal/WMSManagement.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Warehouse/Journal/WMSManagement.Codeunit.al\n@@ -193,8 +193,10 @@ codeunit 7302 \"WMS Management\"\n GetBin(WarehouseJournalLine.\"Location Code\", WarehouseJournalLine.\"To Bin Code\");\n Bin.CheckIncreaseBin(Bin.Code, WarehouseJournalLine.\"Item No.\", WarehouseJournalLine.\"Qty. (Absolute)\", WarehouseJournalLine.Cubage, WarehouseJournalLine.Weight, WarehouseJournalLine.Cubage, WarehouseJournalLine.Weight, true, false);\n end;\n- end else\n+ end else begin\n CheckWarehouseClass(WarehouseJournalLine.\"Location Code\", WarehouseJournalLine.\"To Bin Code\", WarehouseJournalLine.\"Item No.\", WarehouseJournalLine.\"Variant Code\", WarehouseJournalLine.\"Unit of Measure Code\");\n+ CheckBinAndBinContentMovement(WarehouseJournalLine);\n+ end;\n SourceJnl::OutputJnl, SourceJnl::ConsumpJnl:\n if WarehouseJournalLine.\"To Bin Code\" <> '' then\n if Location.\"Bin Capacity Policy\" <> Location.\"Bin Capacity Policy\"::\"Never Check Capacity\" then\n@@ -1803,7 +1805,7 @@ codeunit 7302 \"WMS Management\"\n OnBeforeCheckBlockedBin(LocationCode, BinCode, ItemNo, VariantCode, UnitOfMeasureCode, CheckInbound, IsHandled);\n if not IsHandled then begin\n GetLocation(LocationCode);\n- if Location.\"Directed Put-away and Pick\" then\n+ if (Location.\"Directed Put-away and Pick\") or ((BinCode <> '') and (Location.\"Bin Capacity Policy\" = Location.\"Bin Capacity Policy\"::\"Never Check Capacity\")) then\n if BinContent.Get(LocationCode, BinCode, ItemNo, VariantCode, UnitOfMeasureCode) then begin\n if (CheckInbound and\n (BinContent.\"Block Movement\" in [BinContent.\"Block Movement\"::Inbound, BinContent.\"Block Movement\"::All])) or\n@@ -1848,6 +1850,19 @@ codeunit 7302 \"WMS Management\"\n exit(Bin2.\"Bin Type Code\");\n end;\n \n+ local procedure CheckBinAndBinContentMovement(WarehouseJournalLine: Record \"Warehouse Journal Line\")\n+ begin\n+ if WarehouseJournalLine.Quantity = 0 then\n+ exit;\n+\n+ case WarehouseJournalLine.\"Entry Type\" of\n+ WarehouseJournalLine.\"Entry Type\"::\"Positive Adjmt.\":\n+ CheckBlockedBin(WarehouseJournalLine.\"Location Code\", WarehouseJournalLine.\"To Bin Code\", WarehouseJournalLine.\"Item No.\", WarehouseJournalLine.\"Variant Code\", WarehouseJournalLine.\"Unit of Measure Code\", WarehouseJournalLine.Quantity > 0);\n+ WarehouseJournalLine.\"Entry Type\"::\"Negative Adjmt.\":\n+ CheckBlockedBin(WarehouseJournalLine.\"Location Code\", WarehouseJournalLine.\"To Bin Code\", WarehouseJournalLine.\"Item No.\", WarehouseJournalLine.\"Variant Code\", WarehouseJournalLine.\"Unit of Measure Code\", WarehouseJournalLine.Quantity < 0);\n+ end;\n+ end;\n+\n [IntegrationEvent(false, false)]\n local procedure OnAfterCheckBlockedBin(LocationCode: Code[10]; BinCode: Code[20]; ItemNo: Code[20]; VariantCode: Code[10]; UnitOfMeasureCode: Code[10]; CheckInbound: Boolean)\n begin\n"} +{"repo": "microsoftInternal/NAV", "instance_id": "microsoftInternal__NAV-199883", "base_commit": "aaf1c6d95a374d426984ab59eacb82f1047659b5", "created_at": "2024-11-12", "environment_setup_version": "25.0", "project_paths": ["App\\Layers\\W1\\BaseApp", "App\\Layers\\W1\\Tests\\SCM"], "hints_text": "", "FAIL_TO_PASS": [{"codeunitID": 137033, "functionName": ["BinContentMovementBlockedThrowsErrorWhenPostingItemJournal"]}], "PASS_TO_PASS": [], "problem_statement": "Title: [master] [ALL-E] Bin Content Block Movement is not considered when posting an item journal.\nRepro Steps:\nOpen Cronus 24.2. Go to locations. Go to the warehouse employees and add location SILVER to your user Go to the item journal.Create an entry as follows:Item No \"1896-S\"Location: SILVERBin code: S-01-0001Quantity: 40post Go to Bin ContentsSelect your entry -> Block Movement: All. Go to the item journal Create an entry as follows:Item No \"1896-S\"Location: SILVERBin code: S-01-0001Quantity: 40post The Entry is posted successfully. Expected Results: The entry shouldn't be posted for the same Item No. Block Movement Specifies how the movement of a particular item, or bin content, into or out of this bin, is blocked. Actual Results: The entry is still posted even if the Bin content has a block movement on All. Investigation: Tested on 24.2 , 23.07 and 22.13 OnPrem and the same behavior happens. It seems to be that all settings are ignored for Block Movement I tried also with Inbound and Outbound and according postings and everything can be posted.\nDescription:\nBin Content Block Movement Doesn't work as expected\n", "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\nindex 4d85519ac9a..a2506b2d267 100644\n--- a/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\n@@ -34,6 +34,8 @@\n OneEntryExpectedErr: Label 'Only one Item Ledger Entry is expected.';\n MultipleEntriesExpectedErr: Label 'Two Item Ledger Entries expected.';\n RoundingTo0Err: Label 'Rounding of the field';\n+ BlockedBinContentErr: Label 'Block Movement must not be All in Bin Content Location Code=''%1'',Bin Code=''%2'',Item No.=''%3'',Variant Code=''%4'',Unit of Measure Code=''%5''.',\n+ Comment = '%1= Location Code, %2= Bin Code, %3= Item No., %4= Varient Code, %5= Unit of Measure Code';\n \n [Test]\n [Scope('OnPrem')]\n@@ -2091,6 +2093,86 @@\n Assert.RecordIsEmpty(RecordLink);\n end;\n \n+ [Test]\n+ procedure BinContentMovementBlockedThrowsErrorWhenPostingItemJournal()\n+ var\n+ Bin: Record Bin;\n+ BinContent: Record \"Bin Content\";\n+ Item: Record Item;\n+ ItemJournalTemplate: Record \"Item Journal Template\";\n+ ItemJournalBatch: Record \"Item Journal Batch\";\n+ ItemJournalLine: Record \"Item Journal Line\";\n+ Location: Record Location;\n+ begin\n+ // [SCENARIO 538864] Bin Content Block Movement is considered when posting an Item Journal.\n+ Initialize();\n+\n+ // [GIVEN] Create an Item.\n+ LibraryInventory.CreateItem(Item);\n+\n+ // [GIVEN] Create a Location with require Bin and a Default Bin Code.\n+ LibraryWarehouse.CreateLocationWMS(Location, true, false, false, false, false);\n+\n+ // [GIVEN] Create a Bin.\n+ LibraryWarehouse.CreateBin(Bin, Location.Code, '', '', '');\n+\n+ // [GIVEN] Validate Default Bin Code in Location.\n+ Location.Validate(\"Default Bin Code\", Bin.Code);\n+ Location.Modify(true);\n+\n+ // [GIVEN] Select an Item Journal Template of Type Item.\n+ LibraryInventory.SelectItemJournalTemplateName(ItemJournalTemplate, ItemJournalTemplate.Type::Item);\n+\n+ // [GIVEN] Select an Item Journal Batch.\n+ LibraryInventory.SelectItemJournalBatchName(ItemJournalBatch, ItemJournalTemplate.Type::Item, ItemJournalTemplate.Name);\n+\n+ // [GIVEN] Create an Item Journal Line\n+ LibraryInventory.ClearItemJournal(ItemJournalTemplate, ItemJournalBatch);\n+ LibraryInventory.CreateItemJournalLine(\n+ ItemJournalLine,\n+ ItemJournalBatch.\"Journal Template Name\",\n+ ItemJournalBatch.Name,\n+ ItemJournalLine.\"Entry Type\"::Purchase,\n+ Item.\"No.\",\n+ LibraryRandom.RandInt(10));\n+\n+ // [GIVEN] Validate Location Code and Bin Code in Item Journal Line.\n+ ItemJournalLine.Validate(\"Location Code\", Location.Code);\n+ ItemJournalLine.Validate(\"Bin Code\", Bin.Code);\n+ ItemJournalLine.Modify(true);\n+\n+ // [GIVEN] Post an Item Journal.\n+ LibraryInventory.PostItemJournalLine(ItemJournalLine.\"Journal Template Name\", ItemJournalLine.\"Journal Batch Name\");\n+\n+ // [GIVEN] Find Bin Content and Validate Block Movement to All.\n+ BinContent.SetRange(\"Bin Code\", Bin.Code);\n+ BinContent.SetRange(\"Item No.\", Item.\"No.\");\n+ BinContent.SetRange(\"Location Code\", Location.Code);\n+ BinContent.FindFirst();\n+ BinContent.Validate(\"Block Movement\", BinContent.\"Block Movement\"::All);\n+ BinContent.Modify(true);\n+\n+ // [GIVEN] Clear an Item Journal\n+ LibraryInventory.ClearItemJournal(ItemJournalTemplate, ItemJournalBatch);\n+\n+ // [GIVEN] Create an Item Journal and Validate Location Code.\n+ LibraryInventory.CreateItemJournalLine(\n+ ItemJournalLine,\n+ ItemJournalBatch.\"Journal Template Name\",\n+ ItemJournalBatch.Name,\n+ ItemJournalLine.\"Entry Type\"::Purchase,\n+ Item.\"No.\",\n+ LibraryRandom.RandInt(10));\n+ ItemJournalLine.Validate(\"Location Code\", Location.Code);\n+ ItemJournalLine.Modify(true);\n+\n+ // [WHEN] Post an Item Journal.\n+ asserterror LibraryInventory.PostItemJournalLine(ItemJournalLine.\"Journal Template Name\", ItemJournalLine.\"Journal Batch Name\");\n+\n+ // [THEN] Error of Bin Content Movement blocked is raised.\n+ Assert.ExpectedError(StrSubstNo(BlockedBinContentErr, ItemJournalLine.\"Location Code\", ItemJournalLine.\"Bin Code\", ItemJournalLine.\"Item No.\", ItemJournalLine.\"Variant Code\", ItemJournalLine.\"Unit of Measure Code\"));\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Warehouse/Journal/WMSManagement.Codeunit.al b/App/Layers/W1/BaseApp/Warehouse/Journal/WMSManagement.Codeunit.al\nindex d165f3a21a7..08c0e53701b 100644\n--- a/App/Layers/W1/BaseApp/Warehouse/Journal/WMSManagement.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Warehouse/Journal/WMSManagement.Codeunit.al\n@@ -193,8 +193,10 @@ codeunit 7302 \"WMS Management\"\n GetBin(WarehouseJournalLine.\"Location Code\", WarehouseJournalLine.\"To Bin Code\");\n Bin.CheckIncreaseBin(Bin.Code, WarehouseJournalLine.\"Item No.\", WarehouseJournalLine.\"Qty. (Absolute)\", WarehouseJournalLine.Cubage, WarehouseJournalLine.Weight, WarehouseJournalLine.Cubage, WarehouseJournalLine.Weight, true, false);\n end;\n- end else\n+ end else begin\n CheckWarehouseClass(WarehouseJournalLine.\"Location Code\", WarehouseJournalLine.\"To Bin Code\", WarehouseJournalLine.\"Item No.\", WarehouseJournalLine.\"Variant Code\", WarehouseJournalLine.\"Unit of Measure Code\");\n+ CheckBinAndBinContentMovement(WarehouseJournalLine);\n+ end;\n SourceJnl::OutputJnl, SourceJnl::ConsumpJnl:\n if WarehouseJournalLine.\"To Bin Code\" <> '' then\n if Location.\"Bin Capacity Policy\" <> Location.\"Bin Capacity Policy\"::\"Never Check Capacity\" then\n@@ -1803,7 +1805,7 @@ codeunit 7302 \"WMS Management\"\n OnBeforeCheckBlockedBin(LocationCode, BinCode, ItemNo, VariantCode, UnitOfMeasureCode, CheckInbound, IsHandled);\n if not IsHandled then begin\n GetLocation(LocationCode);\n- if Location.\"Directed Put-away and Pick\" then\n+ if (Location.\"Directed Put-away and Pick\") or ((BinCode <> '') and (Location.\"Bin Capacity Policy\" = Location.\"Bin Capacity Policy\"::\"Never Check Capacity\")) then\n if BinContent.Get(LocationCode, BinCode, ItemNo, VariantCode, UnitOfMeasureCode) then begin\n if (CheckInbound and\n (BinContent.\"Block Movement\" in [BinContent.\"Block Movement\"::Inbound, BinContent.\"Block Movement\"::All])) or\n@@ -1848,6 +1850,19 @@ codeunit 7302 \"WMS Management\"\n exit(Bin2.\"Bin Type Code\");\n end;\n \n+ local procedure CheckBinAndBinContentMovement(WarehouseJournalLine: Record \"Warehouse Journal Line\")\n+ begin\n+ if WarehouseJournalLine.Quantity = 0 then\n+ exit;\n+\n+ case WarehouseJournalLine.\"Entry Type\" of\n+ WarehouseJournalLine.\"Entry Type\"::\"Positive Adjmt.\":\n+ CheckBlockedBin(WarehouseJournalLine.\"Location Code\", WarehouseJournalLine.\"To Bin Code\", WarehouseJournalLine.\"Item No.\", WarehouseJournalLine.\"Variant Code\", WarehouseJournalLine.\"Unit of Measure Code\", WarehouseJournalLine.Quantity > 0);\n+ WarehouseJournalLine.\"Entry Type\"::\"Negative Adjmt.\":\n+ CheckBlockedBin(WarehouseJournalLine.\"Location Code\", WarehouseJournalLine.\"To Bin Code\", WarehouseJournalLine.\"Item No.\", WarehouseJournalLine.\"Variant Code\", WarehouseJournalLine.\"Unit of Measure Code\", WarehouseJournalLine.Quantity < 0);\n+ end;\n+ end;\n+\n [IntegrationEvent(false, false)]\n local procedure OnAfterCheckBlockedBin(LocationCode: Code[10]; BinCode: Code[20]; ItemNo: Code[20]; VariantCode: Code[10]; UnitOfMeasureCode: Code[10]; CheckInbound: Boolean)\n begin\n"} From 3ea1e615bd0ce781037b68422d5c9b2cc5717cc6 Mon Sep 17 00:00:00 2001 From: Jiawen Sun Date: Tue, 18 Nov 2025 20:54:19 +0100 Subject: [PATCH 3/6] Use 25.1 Now --- dataset/bcbench_nav.jsonl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dataset/bcbench_nav.jsonl b/dataset/bcbench_nav.jsonl index bd80b689e..cab147214 100644 --- a/dataset/bcbench_nav.jsonl +++ b/dataset/bcbench_nav.jsonl @@ -23,4 +23,4 @@ {"repo": "microsoftInternal/NAV", "instance_id": "microsoftInternal__NAV-206527", "base_commit": "d8e867062d4137cf5df2d9d2b8a71bb53210f685", "created_at": "2025-02-07", "environment_setup_version": "26.0", "project_paths": ["App\\Layers\\W1\\BaseApp", "App\\Layers\\W1\\Tests\\SCM"], "hints_text": "", "FAIL_TO_PASS": [{"codeunitID": 137088, "functionName": ["ReleasedProdOrderQuantityPerandExpectedQtyRoundingPrecisionChecking"]}], "PASS_TO_PASS": [], "problem_statement": "Title: If a component's Item UOM has a 'Quantity Rounding Precision' of 1, & a Finished Good consumes partial quantity, the Prod. Order created from the Planning of a Sales Order pulls in the Component with a 'Qty. Per' and 'Exp. Qty.' of 0.\nRepro Steps:\n1. Use existing Item with no activity, or create new item. This will be the COMPONENT Item. Will use PCS as UOM.\n2. For the Component Item, go into Related > Item UOM > and set 'Quantity Rounding Precision' = 1 on the bottom.\n3. Component Item should have\n Replenishment System = PURCHASE\n Rounding Precision = .01\n Reorder Policy = Lot-for-Lot\n Include Inventory = TRUE\n4. Then have another Item, I'll call it FG Item which is:\n Replenishment System = PRODUNCTION ORDER\n Rounding Precision = 1\n Reorder Policy = ORDER\n Production BOM => Create new Certified Production BOM that consumes COMPONENT Item with 'Quantity Per' = .09\n5. Now create Sales Order for any Customer for FG Item for 1 Quantity at BLUE (or MAIN) location.\n6. On the Sales Order go to Actions > Plan > Planning > Create Prod. Order and choose 'Released' and 'Item Order'.\n7. Then choose Order Tracking and then 'Show' which will take you to the Released Prod. Order.\n8. We will see prod. Order for FG Item with 1 qty. Go to Line > Components\n\n**EXPECTED RESULTS** = 'Quantity Per' and 'Expected Quantity' = .09\n**ACTUAL RESULTS** = 'Quantity Per' and 'Expected Quantity' = 0\n\nIf you were then to delete the Released Production Order, and go to the Planning Worksheet and run the Calc. Regenerative Plan for the 2 items, you would receive an error:\n\"The value in the Qty. Rounding Precision field on the Item Unit of Measure page is causing the rounding precision for the Expected Quantity field to be incorrect.\"\n\nDescription:\n2If a component's Item UOM has a 'Quantity Rounding Precision' set to 1, and a Finished Good consumes partial quantity, the Production Order created from the Planning section of a Sales Order pulls in the Component but with a 'Quantity Per' and 'Expected Quantity' of 0. If we are producing 1 FG Item and the 'Quantity Per' is set to consume .1 component, we would expect 'Quantity Per' and 'Expected Quantity' both = .1. There is no error message.\n\nBut if you run the Planning Worksheet's 'Calc. Regenerative Plan', then you will get an error message about the 'Quantity Rounding Precision'.\n\nI don't believe the 'Quantity Rounding Precision' in the Item UOM should have any influence on this process. I always thought this field was only for scenario with Picking and when Base UOM is larger than the smallest UOM, and picking in smallest UOM. There is a lot of confusion about this 'Quantity Rounding Precision' field within the Item UOM actually.\n", "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMOrderPlanningIII.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMOrderPlanningIII.Codeunit.al\nindex 7415eaa53cc..2573227dbca 100644\n--- a/App/Layers/W1/Tests/SCM/SCMOrderPlanningIII.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMOrderPlanningIII.Codeunit.al\n@@ -45,6 +45,8 @@ codeunit 137088 \"SCM Order Planning - III\"\n LineExistErr: Label 'Requistion line in %1 worksheet should exist for item %2';\n PurchaseLineQuantityBaseErr: Label '%1.%2 must be nearly equal to %3.', Comment = '%1 : Purchase Line, %2 : Quantity (Base), %3 : Value.';\n BOMFixedQtyCalcFormulaErr: Label 'BOM Fixed Quantity Calculation Formula should be used to calculate the values.';\n+ RelesedProdOrderComponentQtyPerRoundingErr: Label 'Relesed Production Order Item Component Quantity per %1 Not Match With Expected Result %2';\n+ RelesedProdOrderComponentExpQtyRoundingErr: Label 'Relesed Production Order Item Component Expected Quantity %1 Not Match With Expected Result %2';\n \n [Test]\n [HandlerFunctions('MakeSupplyOrdersPageHandler')]\n@@ -2988,6 +2990,73 @@ codeunit 137088 \"SCM Order Planning - III\"\n VerifyStartingTimeOnFirmPlannedProductionOrder(StartingTime, ChildItem.\"No.\", ProductionOrderNo);\n end;\n \n+ [Test]\n+ [HandlerFunctions('ModalPageHandler,ErrorMessageHandler')]\n+ procedure ReleasedProdOrderQuantityPerandExpectedQtyRoundingPrecisionChecking()\n+ var\n+ BaseItemUnitOfMeasure: Record \"Item Unit of Measure\";\n+ ComponentItem: Record Item;\n+ ProdOrderComp: Record \"Prod. Order Component\";\n+ ProdOrderLine: Record \"Prod. Order Line\";\n+ ProductionBOMHeader: Record \"Production BOM Header\";\n+ ProductionBOMLine: Record \"Production BOM Line\";\n+ ProductionOrder: Record \"Production Order\";\n+ ProductItem: Record Item;\n+ SalesHeader: Record \"Sales Header\";\n+ ExpectedQty: Decimal;\n+ RelesedProdOrderNo: Code[20];\n+ Status: Enum \"Production Order Status\";\n+ begin\n+ // [SCENARIO 562766] If a component's Item UOM has a 'Quantity Rounding Precision' of 1, & a Finished Good consumes partial quantity, \n+ // the Prod. Order created from the Planning of a Sales Order pulls in the Component with a 'Qty. Per' and 'Exp. Qty.' of 0.\n+ Initialize();\n+\n+ // [GIVEN] Created Component Item\n+ LibraryInventory.CreateItem(ComponentItem);\n+ ComponentItem.Validate(\"Replenishment System\", ComponentItem.\"Replenishment System\"::Purchase);\n+ ComponentItem.Validate(\"Rounding Precision\", LibraryRandom.RandPrecision());\n+ ComponentItem.Validate(\"Reordering Policy\", ComponentItem.\"Reordering Policy\"::\"Lot-for-Lot\");\n+ ComponentItem.Validate(\"Include Inventory\", true);\n+ ComponentItem.Modify(true);\n+\n+ // [GIVEN] Set Qty. Rounding Precision = 1 for Component Item\n+ BaseItemUnitOfMeasure.Get(ComponentItem.\"No.\", ComponentItem.\"Base Unit of Measure\");\n+ BaseItemUnitOfMeasure.Validate(\"Qty. Rounding Precision\", 1);\n+ BaseItemUnitOfMeasure.Modify();\n+\n+ // [GIVEN] Created Production Bom using Component Item\n+ LibraryManufacturing.CreateProductionBOMHeader(ProductionBOMHeader, ComponentItem.\"Base Unit of Measure\");\n+ LibraryManufacturing.CreateProductionBOMLine(ProductionBOMHeader, ProductionBOMLine, '', ProductionBOMLine.Type::Item, ComponentItem.\"No.\", LibraryRandom.RandDecInDecimalRange(0.01, 0.99, 2));\n+ ProductionBOMHeader.Validate(Status, ProductionBOMHeader.Status::Certified);\n+ ProductionBOMHeader.Modify();\n+\n+ // [GIVEN] Created Master Item and Production Bom Assigned to Master Item\n+ LibraryInventory.CreateItem(ProductItem);\n+ ProductItem.Validate(\"Replenishment System\", ProductItem.\"Replenishment System\"::\"Prod. Order\");\n+ ProductItem.Validate(\"Rounding Precision\", 1);\n+ ProductItem.Validate(\"Reordering Policy\", ProductItem.\"Reordering Policy\"::Order);\n+ ProductItem.Validate(\"Production BOM No.\", ProductionBOMHeader.\"No.\");\n+ ProductItem.Modify(true);\n+\n+ // [GIVEN] Created Sales Order Using Master Item Quantity - 1\n+ CreateSalesOrder(SalesHeader, ProductItem.\"No.\", '', 1, 1);\n+\n+ // [WHEN] Created Released Prod. Order From Sales Order Using Planning\n+ LibraryPlanning.CreateProdOrderUsingPlanning(ProductionOrder, Status::\"Firm Planned\", SalesHeader.\"No.\", ProductItem.\"No.\");\n+ RelesedProdOrderNo := LibraryManufacturing.ChangeStatusFirmPlanToReleased(ProductionOrder.\"No.\");\n+\n+ // [WHEN] Find Released Production Order Component\n+ FindProdOrderLine(ProdOrderLine, RelesedProdOrderNo);\n+ FindProdOrderComponent(ProdOrderComp, ProdOrderLine.\"Prod. Order No.\", ComponentItem.\"No.\");\n+\n+ // [WHEN] Getting Expected result using Component Rounding Precision\n+ ExpectedQty := Round(ProductionBOMLine.\"Quantity per\" * BaseItemUnitOfMeasure.\"Qty. Rounding Precision\" / BaseItemUnitOfMeasure.\"Qty. Rounding Precision\", ComponentItem.\"Rounding Precision\");\n+\n+ // [THEN] Expected Quantity must be Equal to Production Order Component \"Quantity per\" And \"Expected Quantity\"\n+ Assert.AreEqual(ExpectedQty, ProdOrderComp.\"Quantity per\", StrSubstNo(RelesedProdOrderComponentQtyPerRoundingErr, ProdOrderComp.\"Quantity per\", ExpectedQty));\n+ Assert.AreEqual(ExpectedQty, ProdOrderComp.\"Expected Quantity\", StrSubstNo(RelesedProdOrderComponentExpQtyRoundingErr, ProdOrderComp.\"Expected Quantity\", ExpectedQty));\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n@@ -3805,6 +3874,14 @@ codeunit 137088 \"SCM Order Planning - III\"\n Assert.IsTrue(ProductionOrder.\"Starting Time\" = StartingTime, '');\n end;\n \n+ local procedure FindProdOrderLine(var ProdOrderLine: Record \"Prod. Order Line\"; ProductionOrderNo: Code[20])\n+ begin\n+ ProdOrderLine.Reset();\n+ ProdOrderLine.SetRange(Status, ProdOrderLine.Status::Released);\n+ ProdOrderLine.SetRange(\"Prod. Order No.\", ProductionOrderNo);\n+ ProdOrderLine.FindFirst();\n+ end;\n+\n [ModalPageHandler]\n [Scope('OnPrem')]\n procedure MakeSupplyOrdersPageHandler(var MakeSupplyOrders: Page \"Make Supply Orders\"; var Response: Action)\n@@ -3911,5 +3988,16 @@ codeunit 137088 \"SCM Order Planning - III\"\n begin\n Reply := true;\n end;\n+\n+ [ModalPageHandler]\n+ procedure ModalPageHandler(var CreateOrderFromSales: Page \"Create Order From Sales\"; var Response: Action)\n+ begin\n+ Response := Action::Yes;\n+ end;\n+\n+ [MessageHandler]\n+ procedure ErrorMessageHandler(Message: Text[1024])\n+ begin\n+ end;\n }\n \n", "patch": "diff --git a/App/Layers/IT/BaseApp/Manufacturing/Document/CalculateProdOrder.Codeunit.al b/App/Layers/IT/BaseApp/Manufacturing/Document/CalculateProdOrder.Codeunit.al\nindex 5f7a2b890fe..5b63565d0f1 100644\n--- a/App/Layers/IT/BaseApp/Manufacturing/Document/CalculateProdOrder.Codeunit.al\n+++ b/App/Layers/IT/BaseApp/Manufacturing/Document/CalculateProdOrder.Codeunit.al\n@@ -43,6 +43,7 @@ codeunit 99000773 \"Calculate Prod. Order\"\n ProdOrderComp: Record \"Prod. Order Component\";\n ProdOrderRoutingLine2: Record \"Prod. Order Routing Line\";\n ProdBOMLine: array[99] of Record \"Production BOM Line\";\n+ ProdLineItem: Record Item;\n UOMMgt: Codeunit \"Unit of Measure Management\";\n MfgCostCalcMgt: Codeunit \"Mfg. Cost Calculation Mgt.\";\n VersionMgt: Codeunit VersionManagement;\n@@ -286,8 +287,8 @@ codeunit 99000773 \"Calculate Prod. Order\"\n \n local procedure TransferBOMProcessItem(Level: Integer; LineQtyPerUOM: Decimal; ItemQtyPerUOM: Decimal; var ErrorOccured: Boolean)\n var\n- Item2: Record Item;\n ComponentSKU: Record \"Stockkeeping Unit\";\n+ Item2: Record Item;\n IsHandled: Boolean;\n QtyRoundPrecision: Decimal;\n begin\n@@ -323,6 +324,7 @@ codeunit 99000773 \"Calculate Prod. Order\"\n ProdOrderComp.Validate(\"Unit of Measure Code\", ProdBOMLine[Level].\"Unit of Measure Code\");\n if (ProdOrderComp.\"Item No.\" <> '') and Item2.Get(ProdOrderComp.\"Item No.\") then\n QtyRoundPrecision := UOMMgt.GetQtyRoundingPrecision(Item2, ProdBOMLine[Level].\"Unit of Measure Code\");\n+ CheckingRoundingPrecision(Item2, ProdLineItem, QtyRoundPrecision, Level);\n if QtyRoundPrecision <> 0 then\n ProdOrderComp.\"Quantity per\" := Round(ProdBOMLine[Level].\"Quantity per\" * LineQtyPerUOM / ItemQtyPerUOM, QtyRoundPrecision)\n else\n@@ -1001,6 +1003,21 @@ codeunit 99000773 \"Calculate Prod. Order\"\n ProdOrderLineToCheck.TestField(Quantity);\n end;\n \n+ local procedure CheckingRoundingPrecision(ChildItem: Record Item; ProdLineItem: Record Item; var QtyRoundPrecision: Decimal; Level: Integer)\n+ begin\n+ if (ChildItem.\"Rounding Precision\" = 0) or (QtyRoundPrecision = 0) then\n+ exit;\n+\n+ if (not ProdLineItem.Get(ProdOrderLine.\"Item No.\")) or (ProdLineItem.\"Replenishment System\" <> ProdLineItem.\"Replenishment System\"::\"Prod. Order\") then\n+ exit;\n+\n+ if (ChildItem.\"Base Unit of Measure\" <> ProdBOMLine[Level].\"Unit of Measure Code\") then\n+ exit;\n+ QtyRoundPrecision := ChildItem.\"Rounding Precision\";\n+ ProdOrderComp.\"Qty. Rounding Precision\" := ChildItem.\"Rounding Precision\";\n+ ProdOrderComp.\"Qty. Rounding Precision (Base)\" := ChildItem.\"Rounding Precision\";\n+ end;\n+\n [IntegrationEvent(false, false)]\n local procedure OnAfterInsertProdRoutingLine(var ProdOrderRoutingLine: Record \"Prod. Order Routing Line\"; ProdOrderLine: Record \"Prod. Order Line\")\n begin\ndiff --git a/App/Layers/W1/BaseApp/Manufacturing/Document/CalculateProdOrder.Codeunit.al b/App/Layers/W1/BaseApp/Manufacturing/Document/CalculateProdOrder.Codeunit.al\nindex 36930a9e2aa..5d44df0a596 100644\n--- a/App/Layers/W1/BaseApp/Manufacturing/Document/CalculateProdOrder.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Manufacturing/Document/CalculateProdOrder.Codeunit.al\n@@ -43,6 +43,7 @@ codeunit 99000773 \"Calculate Prod. Order\"\n ProdOrderComp: Record \"Prod. Order Component\";\n ProdOrderRoutingLine2: Record \"Prod. Order Routing Line\";\n ProdBOMLine: array[99] of Record \"Production BOM Line\";\n+ ProdLineItem: Record Item;\n UOMMgt: Codeunit \"Unit of Measure Management\";\n MfgCostCalcMgt: Codeunit \"Mfg. Cost Calculation Mgt.\";\n VersionMgt: Codeunit VersionManagement;\n@@ -260,8 +261,8 @@ codeunit 99000773 \"Calculate Prod. Order\"\n \n local procedure TransferBOMProcessItem(Level: Integer; LineQtyPerUOM: Decimal; ItemQtyPerUOM: Decimal; var ErrorOccured: Boolean)\n var\n- Item2: Record Item;\n ComponentSKU: Record \"Stockkeeping Unit\";\n+ Item2: Record Item;\n IsHandled: Boolean;\n QtyRoundPrecision: Decimal;\n begin\n@@ -297,6 +298,7 @@ codeunit 99000773 \"Calculate Prod. Order\"\n ProdOrderComp.Validate(\"Unit of Measure Code\", ProdBOMLine[Level].\"Unit of Measure Code\");\n if (ProdOrderComp.\"Item No.\" <> '') and Item2.Get(ProdOrderComp.\"Item No.\") then\n QtyRoundPrecision := UOMMgt.GetQtyRoundingPrecision(Item2, ProdBOMLine[Level].\"Unit of Measure Code\");\n+ CheckingRoundingPrecision(Item2, ProdLineItem, QtyRoundPrecision, Level);\n if QtyRoundPrecision <> 0 then\n ProdOrderComp.\"Quantity per\" := Round(ProdBOMLine[Level].\"Quantity per\" * LineQtyPerUOM / ItemQtyPerUOM, QtyRoundPrecision)\n else\n@@ -975,6 +977,21 @@ codeunit 99000773 \"Calculate Prod. Order\"\n ProdOrderLineToCheck.TestField(Quantity);\n end;\n \n+ local procedure CheckingRoundingPrecision(ChildItem: Record Item; ProdLineItem: Record Item; var QtyRoundPrecision: Decimal; Level: Integer)\n+ begin\n+ if (ChildItem.\"Rounding Precision\" = 0) or (QtyRoundPrecision = 0) then\n+ exit;\n+\n+ if (not ProdLineItem.Get(ProdOrderLine.\"Item No.\")) or (ProdLineItem.\"Replenishment System\" <> ProdLineItem.\"Replenishment System\"::\"Prod. Order\") then\n+ exit;\n+\n+ if (ChildItem.\"Base Unit of Measure\" <> ProdBOMLine[Level].\"Unit of Measure Code\") then\n+ exit;\n+ QtyRoundPrecision := ChildItem.\"Rounding Precision\";\n+ ProdOrderComp.\"Qty. Rounding Precision\" := ChildItem.\"Rounding Precision\";\n+ ProdOrderComp.\"Qty. Rounding Precision (Base)\" := ChildItem.\"Rounding Precision\";\n+ end;\n+\n [IntegrationEvent(false, false)]\n local procedure OnAfterInsertProdRoutingLine(var ProdOrderRoutingLine: Record \"Prod. Order Routing Line\"; ProdOrderLine: Record \"Prod. Order Line\")\n begin\n"} {"repo": "microsoftInternal/NAV", "instance_id": "microsoftInternal__NAV-208851", "base_commit": "b626cb16a65cd529d91527d1d5dac501d6ecb06e", "created_at": "2025-03-04", "environment_setup_version": "26.0", "project_paths": ["App\\Layers\\W1\\BaseApp", "App\\Layers\\W1\\Tests\\ERM"], "hints_text": "", "FAIL_TO_PASS": [{"codeunitID": 134117, "functionName": ["AmountTypeFieldDoesNotChangeOnClosePageSalesPriceList"]}], "PASS_TO_PASS": [], "problem_statement": "Title: In the Sales Price Lists, the 'Defines' field always defaults to Price & Discount when dealing with Customer Price Group/Customer Disc Group setting\nRepro Steps:\nReproduced in CRONUS GB v25.4\nEnable 'New Sales Price Experience' in Feature Management.\n1. Go to Sales Price Lists\n2. Click on New to generate a New Sales Price List.\n3. Set Assign-to-type to Customer Disc. Group\n4. View Columns for: **Discount**\n5. Insert a single item line, using only Line Discount.\n6. Set the Sales Price List to Status 'Active'\n7. Go back to the Sales Price Lists Page.\n\nYou will notice \"Defines\" has changed back to Prices & Discounts Same behavior is replicable with Price for Customer Price Group\n**Expected Result:** Defines should remain as Discounts if only discounts are in the Sales Price list\n**Actual Results:** 'Defines' Always defaults to 'Prices & Discount'\n\nDescription:\nThe issue is with the setting for the \"Defines\" field. The setting may be changed from 'Price & Discount' to 'Discount' because only Line Discounts may be used in the new Price Group configuration. However, after closing the Page, the system will always default back to the 'Price & Discount', even though only Line Discounts are defined, because the code doesn't pass the value correctly.\n\nThe Partner Developer highlighted the following code:\nThe call stack:\n- GetAmountType (\\ext11_packandshipchanges\\Table\\7005\\Price Source.dal:342)\n- GetDefaultAmountType (\\ext11_packandshipchanges\\Table\\7005\\Price Source.dal:182)\n- UpdateAmountType (\\ext11_packandshipchanges\\Table\\7000\\Price List Header.dal:567)\n- OnClosePage (\\ext11_packandshipchanges\\Page\\7016\\Sales Price List.dal:600)\n\nIn the Function:`UpdateAmountType`, the following code is used:\n\"Amount Type\" := PriceSource.GetDefaultAmountType(); The code reflects it as empty. No value is passed to it, so it always defaults to 'Price & Discount'\n", "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/PriceListsUI.Codeunit.al b/App/Layers/W1/Tests/ERM/PriceListsUI.Codeunit.al\nindex 5f586214ecb..c18252ac131 100644\n--- a/App/Layers/W1/Tests/ERM/PriceListsUI.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/PriceListsUI.Codeunit.al\n@@ -4366,6 +4366,39 @@ codeunit 134117 \"Price Lists UI\"\n PurchasePriceList.Caption()));\n end;\n \n+ [Test]\n+ procedure AmountTypeFieldDoesNotChangeOnClosePageSalesPriceList()\n+ var\n+ PriceListHeader: Record \"Price List Header\";\n+ CustomerDiscountGroup: Record \"Customer Discount Group\";\n+ SalesPriceList: TestPage \"Sales Price List\";\n+ PriceListHeaderCode: Code[20];\n+ begin\n+ // [SCENARIO 566994] Bug fix to ensure the field \"Amount Type\" does not change after closing the page \"Sales Price List\" \n+ Initialize(true);\n+\n+ // [GIVEN] Sales Price List for discount\n+ PriceListHeaderCode := LibraryUtility.GenerateGUID();\n+ SalesPriceList.OpenEdit();\n+ SalesPriceList.New();\n+ SalesPriceList.Code.SetValue(PriceListHeaderCode);\n+ SalesPriceList.Description.SetValue(LibraryUtility.GenerateGUID());\n+ SalesPriceList.SourceType.SetValue(\"Price Source Type\"::\"Customer Disc. Group\");\n+ SalesPriceList.AmountType.SetValue(\"Price Amount Type\"::Discount);\n+ CustomerDiscountGroup.Init();\n+ CustomerDiscountGroup.Code := LibraryUtility.GenerateGUID();\n+ CustomerDiscountGroup.Insert();\n+ SalesPriceList.AssignToNo.SetValue(CustomerDiscountGroup.Code);\n+ SalesPriceList.Status.SetValue(\"Price Status\"::Active);\n+\n+ // [WHEN] Close the page \"Sales Price List\"\n+ SalesPriceList.Close();\n+\n+ // [THEN] Check the field \"Amount Type\" has not reverted to Price & Discount\n+ PriceListHeader.Get(PriceListHeaderCode);\n+ Assert.IsTrue((PriceListHeader.\"Amount Type\" = PriceListHeader.\"Amount Type\"::Discount), 'The field \"Amount Type\" has changed after closing the page \"Sales Price List\"');\n+ end;\n+\n local procedure Initialize(Enable: Boolean)\n var\n PriceListHeader: Record \"Price List Header\";\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Pricing/PriceList/PriceListHeader.Table.al b/App/Layers/W1/BaseApp/Pricing/PriceList/PriceListHeader.Table.al\nindex fb6adbb607d..9e6fd459241 100644\n--- a/App/Layers/W1/BaseApp/Pricing/PriceList/PriceListHeader.Table.al\n+++ b/App/Layers/W1/BaseApp/Pricing/PriceList/PriceListHeader.Table.al\n@@ -562,6 +562,7 @@ table 7000 \"Price List Header\"\n var\n xAmountType: Enum \"Price Amount Type\";\n begin\n+ CopyTo(PriceSource);\n xAmountType := \"Amount Type\";\n if \"Source Type\" in [\"Source Type\"::\"Customer Disc. Group\", \"Source Type\"::\"Customer Price Group\"] then\n \"Amount Type\" := PriceSource.GetDefaultAmountType()\n"} {"repo": "microsoftInternal/NAV", "instance_id": "microsoftInternal__NAV-208320", "base_commit": "d080f087349d4713e1782f2f2630819714cb6738", "created_at": "2025-02-27", "environment_setup_version": "26.0", "project_paths": ["App\\Layers\\W1\\BaseApp", "App\\Layers\\W1\\Tests\\ERM"], "hints_text": "", "FAIL_TO_PASS": [{"codeunitID": 134386, "functionName": ["UpdateEmailAndPhoneNoWhenChangeBillToOfSalesInvoice"]}], "PASS_TO_PASS": [], "problem_statement": "Title: The Email and Phone No. don't update when selecting Another Customer in the \"Bill-to\" field of a Sales Invoice\nRepro Steps:\n1. Go to Contacts and find CT000012 - \"Miss Patricia Doyle\" with 'Company Name' = (John Haddock Insurance Co.)\n2. Edit the contact and add any 'Phone Number' and 'Mobile Phone No.'\n3. Go to Sales Invoices and Create a new sales invoice and for Customer 10000.\n3. Go down to the Shipping and Billing tab and set 'Bill-to' = \"Another Customer\"\n Now see how more fields are introduced, including the Contact and Contact info with Phone numbers and email, should be for \"Mr. Andy Teal\" who is contact for Customer 10000.\n5. Then set Name = 30000 (John Haddock Insurance Co.) and say yes to change bill-to customer.\nNotice we have Contact = \"Miss Patricia Doyle\"....\n\n**EXPECTED RESULTS:** The Phone Number(s) and Email for \"Miss Patricia Doyle\" should pull in.\n**ACTUAL RESULTS:** The fields are the same as they were for the previous contact \"Mr. Andy Teal\" and you need to refresh the Page so it pulls in the new Phone numbers and email for \"Mr. Andy Teal\" Contact.\nDescription:\nCopied and Derived from Support Case Review", "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/ERMSalesDocumentsII.Codeunit.al b/App/Layers/W1/Tests/ERM/ERMSalesDocumentsII.Codeunit.al\nindex bc3ad2bbe5c..30e993b56af 100644\n--- a/App/Layers/W1/Tests/ERM/ERMSalesDocumentsII.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ERMSalesDocumentsII.Codeunit.al\n@@ -4462,6 +4462,51 @@ codeunit 134386 \"ERM Sales Documents II\"\n SalesOrder.SalesLines.\"Invoice Discount Amount\".AssertEquals(SalesHeader.\"Invoice Discount Value\");\n end;\n \n+ [HandlerFunctions('CustomerLookupHandler,ConfirmHandlerYes')]\n+ [Test]\n+ procedure UpdateEmailAndPhoneNoWhenChangeBillToOfSalesInvoice()\n+ var\n+ Contact: array[2] of Record Contact;\n+ Customer: array[2] of Record Customer;\n+ SalesHeader: Record \"Sales Header\";\n+ SalesInvoice: TestPage \"Sales Invoice\";\n+ begin\n+ // [SCENARIO 564632] The Email and Phone No. should update when selecting Another Customer in the \"Bill-to\" field of a Sales Invoice\n+ Initialize();\n+\n+ // [GIVEN] Create First Customer with First Contact with Phone = \"111111111\", Mobile Phone = \"222222222\" and Email = \"contact1@mail.com\"\n+ LibraryMarketing.CreateContactWithCustomer(Contact[1], Customer[1]);\n+ UpdateContactInfo(Contact[1], '111111111', '222222222', 'contact1@mail.com');\n+ Contact[1].Modify(true);\n+\n+ // [GIVEN] Create Second Customer with Second Contact with Phone = \"333333333\", Mobile Phone = \"444444444\" and Email = \"contact2@mail.com\"\n+ LibraryMarketing.CreateContactWithCustomer(Contact[2], Customer[2]);\n+ UpdateContactInfo(Contact[2], '333333333', '444444444', 'contact2@mail.com');\n+ Contact[2].Modify(true);\n+\n+ // [GIVEN] Create Sales Invoice with First Customer\n+ LibrarySales.CreateSalesHeader(SalesHeader, SalesHeader.\"Document Type\"::Invoice, Customer[1].\"No.\");\n+\n+ // [GIVEN] Sales Invoice Card is opened\n+ LibraryVariableStorage.Enqueue(Customer[2].\"No.\");\n+ LibraryVariableStorage.Enqueue('');\n+ LibraryVariableStorage.Enqueue(true); // yes to change \"Bill-to Customer No.\"\n+ SalesInvoice.OpenEdit();\n+ SalesInvoice.FILTER.SetFilter(\"No.\", SalesHeader.\"No.\");\n+\n+ // [WHEN] Select Second Customer when lookup \"Bill-to Customer Name\"\n+ SalesInvoice.\"Bill-to Name\".Lookup();\n+\n+ // [THEN] Verify Sales Invoice \"Phone No.\" = \"333333333\"\n+ SalesInvoice.BillToContactPhoneNo.AssertEquals(Contact[2].\"Phone No.\");\n+\n+ // [THEN] Verify Sales Invoice \"Mobile Phone No.\" = \"444444444\"\n+ SalesInvoice.BillToContactMobilePhoneNo.AssertEquals(Contact[2].\"Mobile Phone No.\");\n+\n+ // [THEN] Verify Sales Invoice \"Email\" = \"contact2@mail.com\"\n+ SalesInvoice.BillToContactEmail.AssertEquals(Contact[2].\"E-Mail\");\n+ end;\n+\n [Test]\n [Scope('OnPrem')]\n procedure UpdateExtendedTextTypeNotAllowed()\n@@ -6595,5 +6640,14 @@ codeunit 134386 \"ERM Sales Documents II\"\n CustomerLookup.Filter.SetFilter(Name, LibraryVariableStorage.DequeueText());\n CustomerLookup.OK().Invoke();\n end;\n+\n+ [ModalPageHandler]\n+ procedure CustomerLookupHandler(var CustomerLookup: TestPage \"Customer Lookup\")\n+ begin\n+ CustomerLookup.GotoKey(LibraryVariableStorage.DequeueText());\n+ Assert.AreEqual(LibraryVariableStorage.DequeueText(),\n+ CustomerLookup.Filter.GetFilter(\"Date Filter\"), 'Wrong Date Filter.');\n+ CustomerLookup.OK().Invoke();\n+ end;\n }\n \n", "patch": "diff --git a/App/Layers/W1/BaseApp/Sales/Document/BlanketSalesOrder.Page.al b/App/Layers/W1/BaseApp/Sales/Document/BlanketSalesOrder.Page.al\nindex 1dee700e044..a3b2013773f 100644\n--- a/App/Layers/W1/BaseApp/Sales/Document/BlanketSalesOrder.Page.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/BlanketSalesOrder.Page.al\n@@ -648,6 +648,23 @@ page 507 \"Blanket Sales Order\"\n Rec.SetRange(\"Bill-to Customer No.\");\n CurrPage.Update();\n end;\n+\n+ trigger OnLookup(var Text: Text): Boolean\n+ var\n+ Customer: Record Customer;\n+ begin\n+ if Customer.SelectCustomer(Customer) then begin\n+ xRec := Rec;\n+ Rec.\"Bill-to Name\" := Customer.Name;\n+ Rec.Validate(\"Bill-to Customer No.\", Customer.\"No.\");\n+ end;\n+\n+ if Rec.GetFilter(\"Bill-to Customer No.\") = xRec.\"Bill-to Customer No.\" then\n+ if Rec.\"Bill-to Customer No.\" <> xRec.\"Bill-to Customer No.\" then\n+ Rec.SetRange(\"Bill-to Customer No.\");\n+\n+ CurrPage.Update();\n+ end;\n }\n field(\"Bill-to Address\"; Rec.\"Bill-to Address\")\n {\ndiff --git a/App/Layers/W1/BaseApp/Sales/Document/SalesCreditMemo.Page.al b/App/Layers/W1/BaseApp/Sales/Document/SalesCreditMemo.Page.al\nindex 84ba27e1b17..3f876b15fd0 100644\n--- a/App/Layers/W1/BaseApp/Sales/Document/SalesCreditMemo.Page.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/SalesCreditMemo.Page.al\n@@ -552,6 +552,23 @@ page 44 \"Sales Credit Memo\"\n \n CurrPage.Update();\n end;\n+\n+ trigger OnLookup(var Text: Text): Boolean\n+ var\n+ Customer: Record Customer;\n+ begin\n+ if Customer.SelectCustomer(Customer) then begin\n+ xRec := Rec;\n+ Rec.\"Bill-to Name\" := Customer.Name;\n+ Rec.Validate(\"Bill-to Customer No.\", Customer.\"No.\");\n+ end;\n+\n+ if Rec.GetFilter(\"Bill-to Customer No.\") = xRec.\"Bill-to Customer No.\" then\n+ if Rec.\"Bill-to Customer No.\" <> xRec.\"Bill-to Customer No.\" then\n+ Rec.SetRange(\"Bill-to Customer No.\");\n+\n+ CurrPage.Update();\n+ end;\n }\n field(\"Bill-to Address\"; Rec.\"Bill-to Address\")\n {\ndiff --git a/App/Layers/W1/BaseApp/Sales/Document/SalesInvoice.Page.al b/App/Layers/W1/BaseApp/Sales/Document/SalesInvoice.Page.al\nindex ee0d93e0f64..930047f5653 100644\n--- a/App/Layers/W1/BaseApp/Sales/Document/SalesInvoice.Page.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/SalesInvoice.Page.al\n@@ -803,6 +803,25 @@ page 43 \"Sales Invoice\"\n CurrPage.Update();\n end;\n end;\n+\n+ trigger OnLookup(var Text: Text): Boolean\n+ var\n+ Customer: Record Customer;\n+ begin\n+ if Customer.SelectCustomer(Customer) then begin\n+ xRec := Rec;\n+ Rec.\"Bill-to Name\" := Customer.Name;\n+ Rec.Validate(\"Bill-to Customer No.\", Customer.\"No.\");\n+ end;\n+\n+ if not ((BillToOptions = BillToOptions::\"Custom Address\") and not ShouldSearchForCustByName) then begin\n+ if Rec.GetFilter(\"Bill-to Customer No.\") = xRec.\"Bill-to Customer No.\" then\n+ if Rec.\"Bill-to Customer No.\" <> xRec.\"Bill-to Customer No.\" then\n+ Rec.SetRange(\"Bill-to Customer No.\");\n+\n+ CurrPage.Update();\n+ end;\n+ end;\n }\n field(\"Bill-to Address\"; Rec.\"Bill-to Address\")\n {\ndiff --git a/App/Layers/W1/BaseApp/Sales/Document/SalesOrder.Page.al b/App/Layers/W1/BaseApp/Sales/Document/SalesOrder.Page.al\nindex 77cf2b1863e..2a751833971 100644\n--- a/App/Layers/W1/BaseApp/Sales/Document/SalesOrder.Page.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/SalesOrder.Page.al\n@@ -812,6 +812,25 @@ page 42 \"Sales Order\"\n CurrPage.Update();\n end;\n end;\n+\n+ trigger OnLookup(var Text: Text): Boolean\n+ var\n+ Customer: Record Customer;\n+ begin\n+ if Customer.SelectCustomer(Customer) then begin\n+ xRec := Rec;\n+ Rec.\"Bill-to Name\" := Customer.Name;\n+ Rec.Validate(\"Bill-to Customer No.\", Customer.\"No.\");\n+ end;\n+\n+ if not ((BillToOptions = BillToOptions::\"Custom Address\") and not ShouldSearchForCustByName) then begin\n+ if Rec.GetFilter(\"Bill-to Customer No.\") = xRec.\"Bill-to Customer No.\" then\n+ if Rec.\"Bill-to Customer No.\" <> xRec.\"Bill-to Customer No.\" then\n+ Rec.SetRange(\"Bill-to Customer No.\");\n+\n+ CurrPage.Update();\n+ end;\n+ end;\n }\n field(\"Bill-to Address\"; Rec.\"Bill-to Address\")\n {\ndiff --git a/App/Layers/W1/BaseApp/Sales/Document/SalesQuote.Page.al b/App/Layers/W1/BaseApp/Sales/Document/SalesQuote.Page.al\nindex 7827a9ece78..5851f14e04b 100644\n--- a/App/Layers/W1/BaseApp/Sales/Document/SalesQuote.Page.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/SalesQuote.Page.al\n@@ -763,6 +763,23 @@ page 41 \"Sales Quote\"\n \n CurrPage.Update();\n end;\n+\n+ trigger OnLookup(var Text: Text): Boolean\n+ var\n+ Customer: Record Customer;\n+ begin\n+ if Customer.SelectCustomer(Customer) then begin\n+ xRec := Rec;\n+ Rec.\"Bill-to Name\" := Customer.Name;\n+ Rec.Validate(\"Bill-to Customer No.\", Customer.\"No.\");\n+ end;\n+\n+ if Rec.GetFilter(\"Bill-to Customer No.\") = xRec.\"Bill-to Customer No.\" then\n+ if Rec.\"Bill-to Customer No.\" <> xRec.\"Bill-to Customer No.\" then\n+ Rec.SetRange(\"Bill-to Customer No.\");\n+\n+ CurrPage.Update();\n+ end;\n }\n field(\"Bill-to Address\"; Rec.\"Bill-to Address\")\n {\ndiff --git a/App/Layers/W1/BaseApp/Sales/Document/SalesReturnOrder.Page.al b/App/Layers/W1/BaseApp/Sales/Document/SalesReturnOrder.Page.al\nindex e9c58725477..a0e9bb787e7 100644\n--- a/App/Layers/W1/BaseApp/Sales/Document/SalesReturnOrder.Page.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/SalesReturnOrder.Page.al\n@@ -613,6 +613,23 @@ page 6630 \"Sales Return Order\"\n \n CurrPage.Update();\n end;\n+\n+ trigger OnLookup(var Text: Text): Boolean\n+ var\n+ Customer: Record Customer;\n+ begin\n+ if Customer.SelectCustomer(Customer) then begin\n+ xRec := Rec;\n+ Rec.\"Bill-to Name\" := Customer.Name;\n+ Rec.Validate(\"Bill-to Customer No.\", Customer.\"No.\");\n+ end;\n+\n+ if Rec.GetFilter(\"Bill-to Customer No.\") = xRec.\"Bill-to Customer No.\" then\n+ if Rec.\"Bill-to Customer No.\" <> xRec.\"Bill-to Customer No.\" then\n+ Rec.SetRange(\"Bill-to Customer No.\");\n+\n+ CurrPage.Update();\n+ end;\n }\n field(\"Bill-to Address\"; Rec.\"Bill-to Address\")\n {\n"} -{"repo": "microsoftInternal/NAV", "instance_id": "microsoftInternal__NAV-199883", "base_commit": "aaf1c6d95a374d426984ab59eacb82f1047659b5", "created_at": "2024-11-12", "environment_setup_version": "25.0", "project_paths": ["App\\Layers\\W1\\BaseApp", "App\\Layers\\W1\\Tests\\SCM"], "hints_text": "", "FAIL_TO_PASS": [{"codeunitID": 137033, "functionName": ["BinContentMovementBlockedThrowsErrorWhenPostingItemJournal"]}], "PASS_TO_PASS": [], "problem_statement": "Title: [master] [ALL-E] Bin Content Block Movement is not considered when posting an item journal.\nRepro Steps:\nOpen Cronus 24.2. Go to locations. Go to the warehouse employees and add location SILVER to your user Go to the item journal.Create an entry as follows:Item No \"1896-S\"Location: SILVERBin code: S-01-0001Quantity: 40post Go to Bin ContentsSelect your entry -> Block Movement: All. Go to the item journal Create an entry as follows:Item No \"1896-S\"Location: SILVERBin code: S-01-0001Quantity: 40post The Entry is posted successfully. Expected Results: The entry shouldn't be posted for the same Item No. Block Movement Specifies how the movement of a particular item, or bin content, into or out of this bin, is blocked. Actual Results: The entry is still posted even if the Bin content has a block movement on All. Investigation: Tested on 24.2 , 23.07 and 22.13 OnPrem and the same behavior happens. It seems to be that all settings are ignored for Block Movement I tried also with Inbound and Outbound and according postings and everything can be posted.\nDescription:\nBin Content Block Movement Doesn't work as expected\n", "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\nindex 4d85519ac9a..a2506b2d267 100644\n--- a/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\n@@ -34,6 +34,8 @@\n OneEntryExpectedErr: Label 'Only one Item Ledger Entry is expected.';\n MultipleEntriesExpectedErr: Label 'Two Item Ledger Entries expected.';\n RoundingTo0Err: Label 'Rounding of the field';\n+ BlockedBinContentErr: Label 'Block Movement must not be All in Bin Content Location Code=''%1'',Bin Code=''%2'',Item No.=''%3'',Variant Code=''%4'',Unit of Measure Code=''%5''.',\n+ Comment = '%1= Location Code, %2= Bin Code, %3= Item No., %4= Varient Code, %5= Unit of Measure Code';\n \n [Test]\n [Scope('OnPrem')]\n@@ -2091,6 +2093,86 @@\n Assert.RecordIsEmpty(RecordLink);\n end;\n \n+ [Test]\n+ procedure BinContentMovementBlockedThrowsErrorWhenPostingItemJournal()\n+ var\n+ Bin: Record Bin;\n+ BinContent: Record \"Bin Content\";\n+ Item: Record Item;\n+ ItemJournalTemplate: Record \"Item Journal Template\";\n+ ItemJournalBatch: Record \"Item Journal Batch\";\n+ ItemJournalLine: Record \"Item Journal Line\";\n+ Location: Record Location;\n+ begin\n+ // [SCENARIO 538864] Bin Content Block Movement is considered when posting an Item Journal.\n+ Initialize();\n+\n+ // [GIVEN] Create an Item.\n+ LibraryInventory.CreateItem(Item);\n+\n+ // [GIVEN] Create a Location with require Bin and a Default Bin Code.\n+ LibraryWarehouse.CreateLocationWMS(Location, true, false, false, false, false);\n+\n+ // [GIVEN] Create a Bin.\n+ LibraryWarehouse.CreateBin(Bin, Location.Code, '', '', '');\n+\n+ // [GIVEN] Validate Default Bin Code in Location.\n+ Location.Validate(\"Default Bin Code\", Bin.Code);\n+ Location.Modify(true);\n+\n+ // [GIVEN] Select an Item Journal Template of Type Item.\n+ LibraryInventory.SelectItemJournalTemplateName(ItemJournalTemplate, ItemJournalTemplate.Type::Item);\n+\n+ // [GIVEN] Select an Item Journal Batch.\n+ LibraryInventory.SelectItemJournalBatchName(ItemJournalBatch, ItemJournalTemplate.Type::Item, ItemJournalTemplate.Name);\n+\n+ // [GIVEN] Create an Item Journal Line\n+ LibraryInventory.ClearItemJournal(ItemJournalTemplate, ItemJournalBatch);\n+ LibraryInventory.CreateItemJournalLine(\n+ ItemJournalLine,\n+ ItemJournalBatch.\"Journal Template Name\",\n+ ItemJournalBatch.Name,\n+ ItemJournalLine.\"Entry Type\"::Purchase,\n+ Item.\"No.\",\n+ LibraryRandom.RandInt(10));\n+\n+ // [GIVEN] Validate Location Code and Bin Code in Item Journal Line.\n+ ItemJournalLine.Validate(\"Location Code\", Location.Code);\n+ ItemJournalLine.Validate(\"Bin Code\", Bin.Code);\n+ ItemJournalLine.Modify(true);\n+\n+ // [GIVEN] Post an Item Journal.\n+ LibraryInventory.PostItemJournalLine(ItemJournalLine.\"Journal Template Name\", ItemJournalLine.\"Journal Batch Name\");\n+\n+ // [GIVEN] Find Bin Content and Validate Block Movement to All.\n+ BinContent.SetRange(\"Bin Code\", Bin.Code);\n+ BinContent.SetRange(\"Item No.\", Item.\"No.\");\n+ BinContent.SetRange(\"Location Code\", Location.Code);\n+ BinContent.FindFirst();\n+ BinContent.Validate(\"Block Movement\", BinContent.\"Block Movement\"::All);\n+ BinContent.Modify(true);\n+\n+ // [GIVEN] Clear an Item Journal\n+ LibraryInventory.ClearItemJournal(ItemJournalTemplate, ItemJournalBatch);\n+\n+ // [GIVEN] Create an Item Journal and Validate Location Code.\n+ LibraryInventory.CreateItemJournalLine(\n+ ItemJournalLine,\n+ ItemJournalBatch.\"Journal Template Name\",\n+ ItemJournalBatch.Name,\n+ ItemJournalLine.\"Entry Type\"::Purchase,\n+ Item.\"No.\",\n+ LibraryRandom.RandInt(10));\n+ ItemJournalLine.Validate(\"Location Code\", Location.Code);\n+ ItemJournalLine.Modify(true);\n+\n+ // [WHEN] Post an Item Journal.\n+ asserterror LibraryInventory.PostItemJournalLine(ItemJournalLine.\"Journal Template Name\", ItemJournalLine.\"Journal Batch Name\");\n+\n+ // [THEN] Error of Bin Content Movement blocked is raised.\n+ Assert.ExpectedError(StrSubstNo(BlockedBinContentErr, ItemJournalLine.\"Location Code\", ItemJournalLine.\"Bin Code\", ItemJournalLine.\"Item No.\", ItemJournalLine.\"Variant Code\", ItemJournalLine.\"Unit of Measure Code\"));\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Warehouse/Journal/WMSManagement.Codeunit.al b/App/Layers/W1/BaseApp/Warehouse/Journal/WMSManagement.Codeunit.al\nindex d165f3a21a7..08c0e53701b 100644\n--- a/App/Layers/W1/BaseApp/Warehouse/Journal/WMSManagement.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Warehouse/Journal/WMSManagement.Codeunit.al\n@@ -193,8 +193,10 @@ codeunit 7302 \"WMS Management\"\n GetBin(WarehouseJournalLine.\"Location Code\", WarehouseJournalLine.\"To Bin Code\");\n Bin.CheckIncreaseBin(Bin.Code, WarehouseJournalLine.\"Item No.\", WarehouseJournalLine.\"Qty. (Absolute)\", WarehouseJournalLine.Cubage, WarehouseJournalLine.Weight, WarehouseJournalLine.Cubage, WarehouseJournalLine.Weight, true, false);\n end;\n- end else\n+ end else begin\n CheckWarehouseClass(WarehouseJournalLine.\"Location Code\", WarehouseJournalLine.\"To Bin Code\", WarehouseJournalLine.\"Item No.\", WarehouseJournalLine.\"Variant Code\", WarehouseJournalLine.\"Unit of Measure Code\");\n+ CheckBinAndBinContentMovement(WarehouseJournalLine);\n+ end;\n SourceJnl::OutputJnl, SourceJnl::ConsumpJnl:\n if WarehouseJournalLine.\"To Bin Code\" <> '' then\n if Location.\"Bin Capacity Policy\" <> Location.\"Bin Capacity Policy\"::\"Never Check Capacity\" then\n@@ -1803,7 +1805,7 @@ codeunit 7302 \"WMS Management\"\n OnBeforeCheckBlockedBin(LocationCode, BinCode, ItemNo, VariantCode, UnitOfMeasureCode, CheckInbound, IsHandled);\n if not IsHandled then begin\n GetLocation(LocationCode);\n- if Location.\"Directed Put-away and Pick\" then\n+ if (Location.\"Directed Put-away and Pick\") or ((BinCode <> '') and (Location.\"Bin Capacity Policy\" = Location.\"Bin Capacity Policy\"::\"Never Check Capacity\")) then\n if BinContent.Get(LocationCode, BinCode, ItemNo, VariantCode, UnitOfMeasureCode) then begin\n if (CheckInbound and\n (BinContent.\"Block Movement\" in [BinContent.\"Block Movement\"::Inbound, BinContent.\"Block Movement\"::All])) or\n@@ -1848,6 +1850,19 @@ codeunit 7302 \"WMS Management\"\n exit(Bin2.\"Bin Type Code\");\n end;\n \n+ local procedure CheckBinAndBinContentMovement(WarehouseJournalLine: Record \"Warehouse Journal Line\")\n+ begin\n+ if WarehouseJournalLine.Quantity = 0 then\n+ exit;\n+\n+ case WarehouseJournalLine.\"Entry Type\" of\n+ WarehouseJournalLine.\"Entry Type\"::\"Positive Adjmt.\":\n+ CheckBlockedBin(WarehouseJournalLine.\"Location Code\", WarehouseJournalLine.\"To Bin Code\", WarehouseJournalLine.\"Item No.\", WarehouseJournalLine.\"Variant Code\", WarehouseJournalLine.\"Unit of Measure Code\", WarehouseJournalLine.Quantity > 0);\n+ WarehouseJournalLine.\"Entry Type\"::\"Negative Adjmt.\":\n+ CheckBlockedBin(WarehouseJournalLine.\"Location Code\", WarehouseJournalLine.\"To Bin Code\", WarehouseJournalLine.\"Item No.\", WarehouseJournalLine.\"Variant Code\", WarehouseJournalLine.\"Unit of Measure Code\", WarehouseJournalLine.Quantity < 0);\n+ end;\n+ end;\n+\n [IntegrationEvent(false, false)]\n local procedure OnAfterCheckBlockedBin(LocationCode: Code[10]; BinCode: Code[20]; ItemNo: Code[20]; VariantCode: Code[10]; UnitOfMeasureCode: Code[10]; CheckInbound: Boolean)\n begin\n"} +{"repo": "microsoftInternal/NAV", "instance_id": "microsoftInternal__NAV-199883", "base_commit": "aaf1c6d95a374d426984ab59eacb82f1047659b5", "created_at": "2024-11-12", "environment_setup_version": "25.1", "project_paths": ["App\\Layers\\W1\\BaseApp", "App\\Layers\\W1\\Tests\\SCM"], "hints_text": "", "FAIL_TO_PASS": [{"codeunitID": 137033, "functionName": ["BinContentMovementBlockedThrowsErrorWhenPostingItemJournal"]}], "PASS_TO_PASS": [], "problem_statement": "Title: [master] [ALL-E] Bin Content Block Movement is not considered when posting an item journal.\nRepro Steps:\nOpen Cronus 24.2. Go to locations. Go to the warehouse employees and add location SILVER to your user Go to the item journal.Create an entry as follows:Item No \"1896-S\"Location: SILVERBin code: S-01-0001Quantity: 40post Go to Bin ContentsSelect your entry -> Block Movement: All. Go to the item journal Create an entry as follows:Item No \"1896-S\"Location: SILVERBin code: S-01-0001Quantity: 40post The Entry is posted successfully. Expected Results: The entry shouldn't be posted for the same Item No. Block Movement Specifies how the movement of a particular item, or bin content, into or out of this bin, is blocked. Actual Results: The entry is still posted even if the Bin content has a block movement on All. Investigation: Tested on 24.2 , 23.07 and 22.13 OnPrem and the same behavior happens. It seems to be that all settings are ignored for Block Movement I tried also with Inbound and Outbound and according postings and everything can be posted.\nDescription:\nBin Content Block Movement Doesn't work as expected\n", "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\nindex 4d85519ac9a..a2506b2d267 100644\n--- a/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\n@@ -34,6 +34,8 @@\n OneEntryExpectedErr: Label 'Only one Item Ledger Entry is expected.';\n MultipleEntriesExpectedErr: Label 'Two Item Ledger Entries expected.';\n RoundingTo0Err: Label 'Rounding of the field';\n+ BlockedBinContentErr: Label 'Block Movement must not be All in Bin Content Location Code=''%1'',Bin Code=''%2'',Item No.=''%3'',Variant Code=''%4'',Unit of Measure Code=''%5''.',\n+ Comment = '%1= Location Code, %2= Bin Code, %3= Item No., %4= Varient Code, %5= Unit of Measure Code';\n \n [Test]\n [Scope('OnPrem')]\n@@ -2091,6 +2093,86 @@\n Assert.RecordIsEmpty(RecordLink);\n end;\n \n+ [Test]\n+ procedure BinContentMovementBlockedThrowsErrorWhenPostingItemJournal()\n+ var\n+ Bin: Record Bin;\n+ BinContent: Record \"Bin Content\";\n+ Item: Record Item;\n+ ItemJournalTemplate: Record \"Item Journal Template\";\n+ ItemJournalBatch: Record \"Item Journal Batch\";\n+ ItemJournalLine: Record \"Item Journal Line\";\n+ Location: Record Location;\n+ begin\n+ // [SCENARIO 538864] Bin Content Block Movement is considered when posting an Item Journal.\n+ Initialize();\n+\n+ // [GIVEN] Create an Item.\n+ LibraryInventory.CreateItem(Item);\n+\n+ // [GIVEN] Create a Location with require Bin and a Default Bin Code.\n+ LibraryWarehouse.CreateLocationWMS(Location, true, false, false, false, false);\n+\n+ // [GIVEN] Create a Bin.\n+ LibraryWarehouse.CreateBin(Bin, Location.Code, '', '', '');\n+\n+ // [GIVEN] Validate Default Bin Code in Location.\n+ Location.Validate(\"Default Bin Code\", Bin.Code);\n+ Location.Modify(true);\n+\n+ // [GIVEN] Select an Item Journal Template of Type Item.\n+ LibraryInventory.SelectItemJournalTemplateName(ItemJournalTemplate, ItemJournalTemplate.Type::Item);\n+\n+ // [GIVEN] Select an Item Journal Batch.\n+ LibraryInventory.SelectItemJournalBatchName(ItemJournalBatch, ItemJournalTemplate.Type::Item, ItemJournalTemplate.Name);\n+\n+ // [GIVEN] Create an Item Journal Line\n+ LibraryInventory.ClearItemJournal(ItemJournalTemplate, ItemJournalBatch);\n+ LibraryInventory.CreateItemJournalLine(\n+ ItemJournalLine,\n+ ItemJournalBatch.\"Journal Template Name\",\n+ ItemJournalBatch.Name,\n+ ItemJournalLine.\"Entry Type\"::Purchase,\n+ Item.\"No.\",\n+ LibraryRandom.RandInt(10));\n+\n+ // [GIVEN] Validate Location Code and Bin Code in Item Journal Line.\n+ ItemJournalLine.Validate(\"Location Code\", Location.Code);\n+ ItemJournalLine.Validate(\"Bin Code\", Bin.Code);\n+ ItemJournalLine.Modify(true);\n+\n+ // [GIVEN] Post an Item Journal.\n+ LibraryInventory.PostItemJournalLine(ItemJournalLine.\"Journal Template Name\", ItemJournalLine.\"Journal Batch Name\");\n+\n+ // [GIVEN] Find Bin Content and Validate Block Movement to All.\n+ BinContent.SetRange(\"Bin Code\", Bin.Code);\n+ BinContent.SetRange(\"Item No.\", Item.\"No.\");\n+ BinContent.SetRange(\"Location Code\", Location.Code);\n+ BinContent.FindFirst();\n+ BinContent.Validate(\"Block Movement\", BinContent.\"Block Movement\"::All);\n+ BinContent.Modify(true);\n+\n+ // [GIVEN] Clear an Item Journal\n+ LibraryInventory.ClearItemJournal(ItemJournalTemplate, ItemJournalBatch);\n+\n+ // [GIVEN] Create an Item Journal and Validate Location Code.\n+ LibraryInventory.CreateItemJournalLine(\n+ ItemJournalLine,\n+ ItemJournalBatch.\"Journal Template Name\",\n+ ItemJournalBatch.Name,\n+ ItemJournalLine.\"Entry Type\"::Purchase,\n+ Item.\"No.\",\n+ LibraryRandom.RandInt(10));\n+ ItemJournalLine.Validate(\"Location Code\", Location.Code);\n+ ItemJournalLine.Modify(true);\n+\n+ // [WHEN] Post an Item Journal.\n+ asserterror LibraryInventory.PostItemJournalLine(ItemJournalLine.\"Journal Template Name\", ItemJournalLine.\"Journal Batch Name\");\n+\n+ // [THEN] Error of Bin Content Movement blocked is raised.\n+ Assert.ExpectedError(StrSubstNo(BlockedBinContentErr, ItemJournalLine.\"Location Code\", ItemJournalLine.\"Bin Code\", ItemJournalLine.\"Item No.\", ItemJournalLine.\"Variant Code\", ItemJournalLine.\"Unit of Measure Code\"));\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Warehouse/Journal/WMSManagement.Codeunit.al b/App/Layers/W1/BaseApp/Warehouse/Journal/WMSManagement.Codeunit.al\nindex d165f3a21a7..08c0e53701b 100644\n--- a/App/Layers/W1/BaseApp/Warehouse/Journal/WMSManagement.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Warehouse/Journal/WMSManagement.Codeunit.al\n@@ -193,8 +193,10 @@ codeunit 7302 \"WMS Management\"\n GetBin(WarehouseJournalLine.\"Location Code\", WarehouseJournalLine.\"To Bin Code\");\n Bin.CheckIncreaseBin(Bin.Code, WarehouseJournalLine.\"Item No.\", WarehouseJournalLine.\"Qty. (Absolute)\", WarehouseJournalLine.Cubage, WarehouseJournalLine.Weight, WarehouseJournalLine.Cubage, WarehouseJournalLine.Weight, true, false);\n end;\n- end else\n+ end else begin\n CheckWarehouseClass(WarehouseJournalLine.\"Location Code\", WarehouseJournalLine.\"To Bin Code\", WarehouseJournalLine.\"Item No.\", WarehouseJournalLine.\"Variant Code\", WarehouseJournalLine.\"Unit of Measure Code\");\n+ CheckBinAndBinContentMovement(WarehouseJournalLine);\n+ end;\n SourceJnl::OutputJnl, SourceJnl::ConsumpJnl:\n if WarehouseJournalLine.\"To Bin Code\" <> '' then\n if Location.\"Bin Capacity Policy\" <> Location.\"Bin Capacity Policy\"::\"Never Check Capacity\" then\n@@ -1803,7 +1805,7 @@ codeunit 7302 \"WMS Management\"\n OnBeforeCheckBlockedBin(LocationCode, BinCode, ItemNo, VariantCode, UnitOfMeasureCode, CheckInbound, IsHandled);\n if not IsHandled then begin\n GetLocation(LocationCode);\n- if Location.\"Directed Put-away and Pick\" then\n+ if (Location.\"Directed Put-away and Pick\") or ((BinCode <> '') and (Location.\"Bin Capacity Policy\" = Location.\"Bin Capacity Policy\"::\"Never Check Capacity\")) then\n if BinContent.Get(LocationCode, BinCode, ItemNo, VariantCode, UnitOfMeasureCode) then begin\n if (CheckInbound and\n (BinContent.\"Block Movement\" in [BinContent.\"Block Movement\"::Inbound, BinContent.\"Block Movement\"::All])) or\n@@ -1848,6 +1850,19 @@ codeunit 7302 \"WMS Management\"\n exit(Bin2.\"Bin Type Code\");\n end;\n \n+ local procedure CheckBinAndBinContentMovement(WarehouseJournalLine: Record \"Warehouse Journal Line\")\n+ begin\n+ if WarehouseJournalLine.Quantity = 0 then\n+ exit;\n+\n+ case WarehouseJournalLine.\"Entry Type\" of\n+ WarehouseJournalLine.\"Entry Type\"::\"Positive Adjmt.\":\n+ CheckBlockedBin(WarehouseJournalLine.\"Location Code\", WarehouseJournalLine.\"To Bin Code\", WarehouseJournalLine.\"Item No.\", WarehouseJournalLine.\"Variant Code\", WarehouseJournalLine.\"Unit of Measure Code\", WarehouseJournalLine.Quantity > 0);\n+ WarehouseJournalLine.\"Entry Type\"::\"Negative Adjmt.\":\n+ CheckBlockedBin(WarehouseJournalLine.\"Location Code\", WarehouseJournalLine.\"To Bin Code\", WarehouseJournalLine.\"Item No.\", WarehouseJournalLine.\"Variant Code\", WarehouseJournalLine.\"Unit of Measure Code\", WarehouseJournalLine.Quantity < 0);\n+ end;\n+ end;\n+\n [IntegrationEvent(false, false)]\n local procedure OnAfterCheckBlockedBin(LocationCode: Code[10]; BinCode: Code[20]; ItemNo: Code[20]; VariantCode: Code[10]; UnitOfMeasureCode: Code[10]; CheckInbound: Boolean)\n begin\n"} From 4e381a6d690180c608f5eda80ecc865afbb2c05a Mon Sep 17 00:00:00 2001 From: Jiawen Sun Date: Wed, 19 Nov 2025 00:03:15 +0100 Subject: [PATCH 4/6] Use 24.5 --- dataset/bcbench_nav.jsonl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dataset/bcbench_nav.jsonl b/dataset/bcbench_nav.jsonl index cab147214..9a7616b11 100644 --- a/dataset/bcbench_nav.jsonl +++ b/dataset/bcbench_nav.jsonl @@ -23,4 +23,4 @@ {"repo": "microsoftInternal/NAV", "instance_id": "microsoftInternal__NAV-206527", "base_commit": "d8e867062d4137cf5df2d9d2b8a71bb53210f685", "created_at": "2025-02-07", "environment_setup_version": "26.0", "project_paths": ["App\\Layers\\W1\\BaseApp", "App\\Layers\\W1\\Tests\\SCM"], "hints_text": "", "FAIL_TO_PASS": [{"codeunitID": 137088, "functionName": ["ReleasedProdOrderQuantityPerandExpectedQtyRoundingPrecisionChecking"]}], "PASS_TO_PASS": [], "problem_statement": "Title: If a component's Item UOM has a 'Quantity Rounding Precision' of 1, & a Finished Good consumes partial quantity, the Prod. Order created from the Planning of a Sales Order pulls in the Component with a 'Qty. Per' and 'Exp. Qty.' of 0.\nRepro Steps:\n1. Use existing Item with no activity, or create new item. This will be the COMPONENT Item. Will use PCS as UOM.\n2. For the Component Item, go into Related > Item UOM > and set 'Quantity Rounding Precision' = 1 on the bottom.\n3. Component Item should have\n Replenishment System = PURCHASE\n Rounding Precision = .01\n Reorder Policy = Lot-for-Lot\n Include Inventory = TRUE\n4. Then have another Item, I'll call it FG Item which is:\n Replenishment System = PRODUNCTION ORDER\n Rounding Precision = 1\n Reorder Policy = ORDER\n Production BOM => Create new Certified Production BOM that consumes COMPONENT Item with 'Quantity Per' = .09\n5. Now create Sales Order for any Customer for FG Item for 1 Quantity at BLUE (or MAIN) location.\n6. On the Sales Order go to Actions > Plan > Planning > Create Prod. Order and choose 'Released' and 'Item Order'.\n7. Then choose Order Tracking and then 'Show' which will take you to the Released Prod. Order.\n8. We will see prod. Order for FG Item with 1 qty. Go to Line > Components\n\n**EXPECTED RESULTS** = 'Quantity Per' and 'Expected Quantity' = .09\n**ACTUAL RESULTS** = 'Quantity Per' and 'Expected Quantity' = 0\n\nIf you were then to delete the Released Production Order, and go to the Planning Worksheet and run the Calc. Regenerative Plan for the 2 items, you would receive an error:\n\"The value in the Qty. Rounding Precision field on the Item Unit of Measure page is causing the rounding precision for the Expected Quantity field to be incorrect.\"\n\nDescription:\n2If a component's Item UOM has a 'Quantity Rounding Precision' set to 1, and a Finished Good consumes partial quantity, the Production Order created from the Planning section of a Sales Order pulls in the Component but with a 'Quantity Per' and 'Expected Quantity' of 0. If we are producing 1 FG Item and the 'Quantity Per' is set to consume .1 component, we would expect 'Quantity Per' and 'Expected Quantity' both = .1. There is no error message.\n\nBut if you run the Planning Worksheet's 'Calc. Regenerative Plan', then you will get an error message about the 'Quantity Rounding Precision'.\n\nI don't believe the 'Quantity Rounding Precision' in the Item UOM should have any influence on this process. I always thought this field was only for scenario with Picking and when Base UOM is larger than the smallest UOM, and picking in smallest UOM. There is a lot of confusion about this 'Quantity Rounding Precision' field within the Item UOM actually.\n", "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMOrderPlanningIII.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMOrderPlanningIII.Codeunit.al\nindex 7415eaa53cc..2573227dbca 100644\n--- a/App/Layers/W1/Tests/SCM/SCMOrderPlanningIII.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMOrderPlanningIII.Codeunit.al\n@@ -45,6 +45,8 @@ codeunit 137088 \"SCM Order Planning - III\"\n LineExistErr: Label 'Requistion line in %1 worksheet should exist for item %2';\n PurchaseLineQuantityBaseErr: Label '%1.%2 must be nearly equal to %3.', Comment = '%1 : Purchase Line, %2 : Quantity (Base), %3 : Value.';\n BOMFixedQtyCalcFormulaErr: Label 'BOM Fixed Quantity Calculation Formula should be used to calculate the values.';\n+ RelesedProdOrderComponentQtyPerRoundingErr: Label 'Relesed Production Order Item Component Quantity per %1 Not Match With Expected Result %2';\n+ RelesedProdOrderComponentExpQtyRoundingErr: Label 'Relesed Production Order Item Component Expected Quantity %1 Not Match With Expected Result %2';\n \n [Test]\n [HandlerFunctions('MakeSupplyOrdersPageHandler')]\n@@ -2988,6 +2990,73 @@ codeunit 137088 \"SCM Order Planning - III\"\n VerifyStartingTimeOnFirmPlannedProductionOrder(StartingTime, ChildItem.\"No.\", ProductionOrderNo);\n end;\n \n+ [Test]\n+ [HandlerFunctions('ModalPageHandler,ErrorMessageHandler')]\n+ procedure ReleasedProdOrderQuantityPerandExpectedQtyRoundingPrecisionChecking()\n+ var\n+ BaseItemUnitOfMeasure: Record \"Item Unit of Measure\";\n+ ComponentItem: Record Item;\n+ ProdOrderComp: Record \"Prod. Order Component\";\n+ ProdOrderLine: Record \"Prod. Order Line\";\n+ ProductionBOMHeader: Record \"Production BOM Header\";\n+ ProductionBOMLine: Record \"Production BOM Line\";\n+ ProductionOrder: Record \"Production Order\";\n+ ProductItem: Record Item;\n+ SalesHeader: Record \"Sales Header\";\n+ ExpectedQty: Decimal;\n+ RelesedProdOrderNo: Code[20];\n+ Status: Enum \"Production Order Status\";\n+ begin\n+ // [SCENARIO 562766] If a component's Item UOM has a 'Quantity Rounding Precision' of 1, & a Finished Good consumes partial quantity, \n+ // the Prod. Order created from the Planning of a Sales Order pulls in the Component with a 'Qty. Per' and 'Exp. Qty.' of 0.\n+ Initialize();\n+\n+ // [GIVEN] Created Component Item\n+ LibraryInventory.CreateItem(ComponentItem);\n+ ComponentItem.Validate(\"Replenishment System\", ComponentItem.\"Replenishment System\"::Purchase);\n+ ComponentItem.Validate(\"Rounding Precision\", LibraryRandom.RandPrecision());\n+ ComponentItem.Validate(\"Reordering Policy\", ComponentItem.\"Reordering Policy\"::\"Lot-for-Lot\");\n+ ComponentItem.Validate(\"Include Inventory\", true);\n+ ComponentItem.Modify(true);\n+\n+ // [GIVEN] Set Qty. Rounding Precision = 1 for Component Item\n+ BaseItemUnitOfMeasure.Get(ComponentItem.\"No.\", ComponentItem.\"Base Unit of Measure\");\n+ BaseItemUnitOfMeasure.Validate(\"Qty. Rounding Precision\", 1);\n+ BaseItemUnitOfMeasure.Modify();\n+\n+ // [GIVEN] Created Production Bom using Component Item\n+ LibraryManufacturing.CreateProductionBOMHeader(ProductionBOMHeader, ComponentItem.\"Base Unit of Measure\");\n+ LibraryManufacturing.CreateProductionBOMLine(ProductionBOMHeader, ProductionBOMLine, '', ProductionBOMLine.Type::Item, ComponentItem.\"No.\", LibraryRandom.RandDecInDecimalRange(0.01, 0.99, 2));\n+ ProductionBOMHeader.Validate(Status, ProductionBOMHeader.Status::Certified);\n+ ProductionBOMHeader.Modify();\n+\n+ // [GIVEN] Created Master Item and Production Bom Assigned to Master Item\n+ LibraryInventory.CreateItem(ProductItem);\n+ ProductItem.Validate(\"Replenishment System\", ProductItem.\"Replenishment System\"::\"Prod. Order\");\n+ ProductItem.Validate(\"Rounding Precision\", 1);\n+ ProductItem.Validate(\"Reordering Policy\", ProductItem.\"Reordering Policy\"::Order);\n+ ProductItem.Validate(\"Production BOM No.\", ProductionBOMHeader.\"No.\");\n+ ProductItem.Modify(true);\n+\n+ // [GIVEN] Created Sales Order Using Master Item Quantity - 1\n+ CreateSalesOrder(SalesHeader, ProductItem.\"No.\", '', 1, 1);\n+\n+ // [WHEN] Created Released Prod. Order From Sales Order Using Planning\n+ LibraryPlanning.CreateProdOrderUsingPlanning(ProductionOrder, Status::\"Firm Planned\", SalesHeader.\"No.\", ProductItem.\"No.\");\n+ RelesedProdOrderNo := LibraryManufacturing.ChangeStatusFirmPlanToReleased(ProductionOrder.\"No.\");\n+\n+ // [WHEN] Find Released Production Order Component\n+ FindProdOrderLine(ProdOrderLine, RelesedProdOrderNo);\n+ FindProdOrderComponent(ProdOrderComp, ProdOrderLine.\"Prod. Order No.\", ComponentItem.\"No.\");\n+\n+ // [WHEN] Getting Expected result using Component Rounding Precision\n+ ExpectedQty := Round(ProductionBOMLine.\"Quantity per\" * BaseItemUnitOfMeasure.\"Qty. Rounding Precision\" / BaseItemUnitOfMeasure.\"Qty. Rounding Precision\", ComponentItem.\"Rounding Precision\");\n+\n+ // [THEN] Expected Quantity must be Equal to Production Order Component \"Quantity per\" And \"Expected Quantity\"\n+ Assert.AreEqual(ExpectedQty, ProdOrderComp.\"Quantity per\", StrSubstNo(RelesedProdOrderComponentQtyPerRoundingErr, ProdOrderComp.\"Quantity per\", ExpectedQty));\n+ Assert.AreEqual(ExpectedQty, ProdOrderComp.\"Expected Quantity\", StrSubstNo(RelesedProdOrderComponentExpQtyRoundingErr, ProdOrderComp.\"Expected Quantity\", ExpectedQty));\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n@@ -3805,6 +3874,14 @@ codeunit 137088 \"SCM Order Planning - III\"\n Assert.IsTrue(ProductionOrder.\"Starting Time\" = StartingTime, '');\n end;\n \n+ local procedure FindProdOrderLine(var ProdOrderLine: Record \"Prod. Order Line\"; ProductionOrderNo: Code[20])\n+ begin\n+ ProdOrderLine.Reset();\n+ ProdOrderLine.SetRange(Status, ProdOrderLine.Status::Released);\n+ ProdOrderLine.SetRange(\"Prod. Order No.\", ProductionOrderNo);\n+ ProdOrderLine.FindFirst();\n+ end;\n+\n [ModalPageHandler]\n [Scope('OnPrem')]\n procedure MakeSupplyOrdersPageHandler(var MakeSupplyOrders: Page \"Make Supply Orders\"; var Response: Action)\n@@ -3911,5 +3988,16 @@ codeunit 137088 \"SCM Order Planning - III\"\n begin\n Reply := true;\n end;\n+\n+ [ModalPageHandler]\n+ procedure ModalPageHandler(var CreateOrderFromSales: Page \"Create Order From Sales\"; var Response: Action)\n+ begin\n+ Response := Action::Yes;\n+ end;\n+\n+ [MessageHandler]\n+ procedure ErrorMessageHandler(Message: Text[1024])\n+ begin\n+ end;\n }\n \n", "patch": "diff --git a/App/Layers/IT/BaseApp/Manufacturing/Document/CalculateProdOrder.Codeunit.al b/App/Layers/IT/BaseApp/Manufacturing/Document/CalculateProdOrder.Codeunit.al\nindex 5f7a2b890fe..5b63565d0f1 100644\n--- a/App/Layers/IT/BaseApp/Manufacturing/Document/CalculateProdOrder.Codeunit.al\n+++ b/App/Layers/IT/BaseApp/Manufacturing/Document/CalculateProdOrder.Codeunit.al\n@@ -43,6 +43,7 @@ codeunit 99000773 \"Calculate Prod. Order\"\n ProdOrderComp: Record \"Prod. Order Component\";\n ProdOrderRoutingLine2: Record \"Prod. Order Routing Line\";\n ProdBOMLine: array[99] of Record \"Production BOM Line\";\n+ ProdLineItem: Record Item;\n UOMMgt: Codeunit \"Unit of Measure Management\";\n MfgCostCalcMgt: Codeunit \"Mfg. Cost Calculation Mgt.\";\n VersionMgt: Codeunit VersionManagement;\n@@ -286,8 +287,8 @@ codeunit 99000773 \"Calculate Prod. Order\"\n \n local procedure TransferBOMProcessItem(Level: Integer; LineQtyPerUOM: Decimal; ItemQtyPerUOM: Decimal; var ErrorOccured: Boolean)\n var\n- Item2: Record Item;\n ComponentSKU: Record \"Stockkeeping Unit\";\n+ Item2: Record Item;\n IsHandled: Boolean;\n QtyRoundPrecision: Decimal;\n begin\n@@ -323,6 +324,7 @@ codeunit 99000773 \"Calculate Prod. Order\"\n ProdOrderComp.Validate(\"Unit of Measure Code\", ProdBOMLine[Level].\"Unit of Measure Code\");\n if (ProdOrderComp.\"Item No.\" <> '') and Item2.Get(ProdOrderComp.\"Item No.\") then\n QtyRoundPrecision := UOMMgt.GetQtyRoundingPrecision(Item2, ProdBOMLine[Level].\"Unit of Measure Code\");\n+ CheckingRoundingPrecision(Item2, ProdLineItem, QtyRoundPrecision, Level);\n if QtyRoundPrecision <> 0 then\n ProdOrderComp.\"Quantity per\" := Round(ProdBOMLine[Level].\"Quantity per\" * LineQtyPerUOM / ItemQtyPerUOM, QtyRoundPrecision)\n else\n@@ -1001,6 +1003,21 @@ codeunit 99000773 \"Calculate Prod. Order\"\n ProdOrderLineToCheck.TestField(Quantity);\n end;\n \n+ local procedure CheckingRoundingPrecision(ChildItem: Record Item; ProdLineItem: Record Item; var QtyRoundPrecision: Decimal; Level: Integer)\n+ begin\n+ if (ChildItem.\"Rounding Precision\" = 0) or (QtyRoundPrecision = 0) then\n+ exit;\n+\n+ if (not ProdLineItem.Get(ProdOrderLine.\"Item No.\")) or (ProdLineItem.\"Replenishment System\" <> ProdLineItem.\"Replenishment System\"::\"Prod. Order\") then\n+ exit;\n+\n+ if (ChildItem.\"Base Unit of Measure\" <> ProdBOMLine[Level].\"Unit of Measure Code\") then\n+ exit;\n+ QtyRoundPrecision := ChildItem.\"Rounding Precision\";\n+ ProdOrderComp.\"Qty. Rounding Precision\" := ChildItem.\"Rounding Precision\";\n+ ProdOrderComp.\"Qty. Rounding Precision (Base)\" := ChildItem.\"Rounding Precision\";\n+ end;\n+\n [IntegrationEvent(false, false)]\n local procedure OnAfterInsertProdRoutingLine(var ProdOrderRoutingLine: Record \"Prod. Order Routing Line\"; ProdOrderLine: Record \"Prod. Order Line\")\n begin\ndiff --git a/App/Layers/W1/BaseApp/Manufacturing/Document/CalculateProdOrder.Codeunit.al b/App/Layers/W1/BaseApp/Manufacturing/Document/CalculateProdOrder.Codeunit.al\nindex 36930a9e2aa..5d44df0a596 100644\n--- a/App/Layers/W1/BaseApp/Manufacturing/Document/CalculateProdOrder.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Manufacturing/Document/CalculateProdOrder.Codeunit.al\n@@ -43,6 +43,7 @@ codeunit 99000773 \"Calculate Prod. Order\"\n ProdOrderComp: Record \"Prod. Order Component\";\n ProdOrderRoutingLine2: Record \"Prod. Order Routing Line\";\n ProdBOMLine: array[99] of Record \"Production BOM Line\";\n+ ProdLineItem: Record Item;\n UOMMgt: Codeunit \"Unit of Measure Management\";\n MfgCostCalcMgt: Codeunit \"Mfg. Cost Calculation Mgt.\";\n VersionMgt: Codeunit VersionManagement;\n@@ -260,8 +261,8 @@ codeunit 99000773 \"Calculate Prod. Order\"\n \n local procedure TransferBOMProcessItem(Level: Integer; LineQtyPerUOM: Decimal; ItemQtyPerUOM: Decimal; var ErrorOccured: Boolean)\n var\n- Item2: Record Item;\n ComponentSKU: Record \"Stockkeeping Unit\";\n+ Item2: Record Item;\n IsHandled: Boolean;\n QtyRoundPrecision: Decimal;\n begin\n@@ -297,6 +298,7 @@ codeunit 99000773 \"Calculate Prod. Order\"\n ProdOrderComp.Validate(\"Unit of Measure Code\", ProdBOMLine[Level].\"Unit of Measure Code\");\n if (ProdOrderComp.\"Item No.\" <> '') and Item2.Get(ProdOrderComp.\"Item No.\") then\n QtyRoundPrecision := UOMMgt.GetQtyRoundingPrecision(Item2, ProdBOMLine[Level].\"Unit of Measure Code\");\n+ CheckingRoundingPrecision(Item2, ProdLineItem, QtyRoundPrecision, Level);\n if QtyRoundPrecision <> 0 then\n ProdOrderComp.\"Quantity per\" := Round(ProdBOMLine[Level].\"Quantity per\" * LineQtyPerUOM / ItemQtyPerUOM, QtyRoundPrecision)\n else\n@@ -975,6 +977,21 @@ codeunit 99000773 \"Calculate Prod. Order\"\n ProdOrderLineToCheck.TestField(Quantity);\n end;\n \n+ local procedure CheckingRoundingPrecision(ChildItem: Record Item; ProdLineItem: Record Item; var QtyRoundPrecision: Decimal; Level: Integer)\n+ begin\n+ if (ChildItem.\"Rounding Precision\" = 0) or (QtyRoundPrecision = 0) then\n+ exit;\n+\n+ if (not ProdLineItem.Get(ProdOrderLine.\"Item No.\")) or (ProdLineItem.\"Replenishment System\" <> ProdLineItem.\"Replenishment System\"::\"Prod. Order\") then\n+ exit;\n+\n+ if (ChildItem.\"Base Unit of Measure\" <> ProdBOMLine[Level].\"Unit of Measure Code\") then\n+ exit;\n+ QtyRoundPrecision := ChildItem.\"Rounding Precision\";\n+ ProdOrderComp.\"Qty. Rounding Precision\" := ChildItem.\"Rounding Precision\";\n+ ProdOrderComp.\"Qty. Rounding Precision (Base)\" := ChildItem.\"Rounding Precision\";\n+ end;\n+\n [IntegrationEvent(false, false)]\n local procedure OnAfterInsertProdRoutingLine(var ProdOrderRoutingLine: Record \"Prod. Order Routing Line\"; ProdOrderLine: Record \"Prod. Order Line\")\n begin\n"} {"repo": "microsoftInternal/NAV", "instance_id": "microsoftInternal__NAV-208851", "base_commit": "b626cb16a65cd529d91527d1d5dac501d6ecb06e", "created_at": "2025-03-04", "environment_setup_version": "26.0", "project_paths": ["App\\Layers\\W1\\BaseApp", "App\\Layers\\W1\\Tests\\ERM"], "hints_text": "", "FAIL_TO_PASS": [{"codeunitID": 134117, "functionName": ["AmountTypeFieldDoesNotChangeOnClosePageSalesPriceList"]}], "PASS_TO_PASS": [], "problem_statement": "Title: In the Sales Price Lists, the 'Defines' field always defaults to Price & Discount when dealing with Customer Price Group/Customer Disc Group setting\nRepro Steps:\nReproduced in CRONUS GB v25.4\nEnable 'New Sales Price Experience' in Feature Management.\n1. Go to Sales Price Lists\n2. Click on New to generate a New Sales Price List.\n3. Set Assign-to-type to Customer Disc. Group\n4. View Columns for: **Discount**\n5. Insert a single item line, using only Line Discount.\n6. Set the Sales Price List to Status 'Active'\n7. Go back to the Sales Price Lists Page.\n\nYou will notice \"Defines\" has changed back to Prices & Discounts Same behavior is replicable with Price for Customer Price Group\n**Expected Result:** Defines should remain as Discounts if only discounts are in the Sales Price list\n**Actual Results:** 'Defines' Always defaults to 'Prices & Discount'\n\nDescription:\nThe issue is with the setting for the \"Defines\" field. The setting may be changed from 'Price & Discount' to 'Discount' because only Line Discounts may be used in the new Price Group configuration. However, after closing the Page, the system will always default back to the 'Price & Discount', even though only Line Discounts are defined, because the code doesn't pass the value correctly.\n\nThe Partner Developer highlighted the following code:\nThe call stack:\n- GetAmountType (\\ext11_packandshipchanges\\Table\\7005\\Price Source.dal:342)\n- GetDefaultAmountType (\\ext11_packandshipchanges\\Table\\7005\\Price Source.dal:182)\n- UpdateAmountType (\\ext11_packandshipchanges\\Table\\7000\\Price List Header.dal:567)\n- OnClosePage (\\ext11_packandshipchanges\\Page\\7016\\Sales Price List.dal:600)\n\nIn the Function:`UpdateAmountType`, the following code is used:\n\"Amount Type\" := PriceSource.GetDefaultAmountType(); The code reflects it as empty. No value is passed to it, so it always defaults to 'Price & Discount'\n", "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/PriceListsUI.Codeunit.al b/App/Layers/W1/Tests/ERM/PriceListsUI.Codeunit.al\nindex 5f586214ecb..c18252ac131 100644\n--- a/App/Layers/W1/Tests/ERM/PriceListsUI.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/PriceListsUI.Codeunit.al\n@@ -4366,6 +4366,39 @@ codeunit 134117 \"Price Lists UI\"\n PurchasePriceList.Caption()));\n end;\n \n+ [Test]\n+ procedure AmountTypeFieldDoesNotChangeOnClosePageSalesPriceList()\n+ var\n+ PriceListHeader: Record \"Price List Header\";\n+ CustomerDiscountGroup: Record \"Customer Discount Group\";\n+ SalesPriceList: TestPage \"Sales Price List\";\n+ PriceListHeaderCode: Code[20];\n+ begin\n+ // [SCENARIO 566994] Bug fix to ensure the field \"Amount Type\" does not change after closing the page \"Sales Price List\" \n+ Initialize(true);\n+\n+ // [GIVEN] Sales Price List for discount\n+ PriceListHeaderCode := LibraryUtility.GenerateGUID();\n+ SalesPriceList.OpenEdit();\n+ SalesPriceList.New();\n+ SalesPriceList.Code.SetValue(PriceListHeaderCode);\n+ SalesPriceList.Description.SetValue(LibraryUtility.GenerateGUID());\n+ SalesPriceList.SourceType.SetValue(\"Price Source Type\"::\"Customer Disc. Group\");\n+ SalesPriceList.AmountType.SetValue(\"Price Amount Type\"::Discount);\n+ CustomerDiscountGroup.Init();\n+ CustomerDiscountGroup.Code := LibraryUtility.GenerateGUID();\n+ CustomerDiscountGroup.Insert();\n+ SalesPriceList.AssignToNo.SetValue(CustomerDiscountGroup.Code);\n+ SalesPriceList.Status.SetValue(\"Price Status\"::Active);\n+\n+ // [WHEN] Close the page \"Sales Price List\"\n+ SalesPriceList.Close();\n+\n+ // [THEN] Check the field \"Amount Type\" has not reverted to Price & Discount\n+ PriceListHeader.Get(PriceListHeaderCode);\n+ Assert.IsTrue((PriceListHeader.\"Amount Type\" = PriceListHeader.\"Amount Type\"::Discount), 'The field \"Amount Type\" has changed after closing the page \"Sales Price List\"');\n+ end;\n+\n local procedure Initialize(Enable: Boolean)\n var\n PriceListHeader: Record \"Price List Header\";\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Pricing/PriceList/PriceListHeader.Table.al b/App/Layers/W1/BaseApp/Pricing/PriceList/PriceListHeader.Table.al\nindex fb6adbb607d..9e6fd459241 100644\n--- a/App/Layers/W1/BaseApp/Pricing/PriceList/PriceListHeader.Table.al\n+++ b/App/Layers/W1/BaseApp/Pricing/PriceList/PriceListHeader.Table.al\n@@ -562,6 +562,7 @@ table 7000 \"Price List Header\"\n var\n xAmountType: Enum \"Price Amount Type\";\n begin\n+ CopyTo(PriceSource);\n xAmountType := \"Amount Type\";\n if \"Source Type\" in [\"Source Type\"::\"Customer Disc. Group\", \"Source Type\"::\"Customer Price Group\"] then\n \"Amount Type\" := PriceSource.GetDefaultAmountType()\n"} {"repo": "microsoftInternal/NAV", "instance_id": "microsoftInternal__NAV-208320", "base_commit": "d080f087349d4713e1782f2f2630819714cb6738", "created_at": "2025-02-27", "environment_setup_version": "26.0", "project_paths": ["App\\Layers\\W1\\BaseApp", "App\\Layers\\W1\\Tests\\ERM"], "hints_text": "", "FAIL_TO_PASS": [{"codeunitID": 134386, "functionName": ["UpdateEmailAndPhoneNoWhenChangeBillToOfSalesInvoice"]}], "PASS_TO_PASS": [], "problem_statement": "Title: The Email and Phone No. don't update when selecting Another Customer in the \"Bill-to\" field of a Sales Invoice\nRepro Steps:\n1. Go to Contacts and find CT000012 - \"Miss Patricia Doyle\" with 'Company Name' = (John Haddock Insurance Co.)\n2. Edit the contact and add any 'Phone Number' and 'Mobile Phone No.'\n3. Go to Sales Invoices and Create a new sales invoice and for Customer 10000.\n3. Go down to the Shipping and Billing tab and set 'Bill-to' = \"Another Customer\"\n Now see how more fields are introduced, including the Contact and Contact info with Phone numbers and email, should be for \"Mr. Andy Teal\" who is contact for Customer 10000.\n5. Then set Name = 30000 (John Haddock Insurance Co.) and say yes to change bill-to customer.\nNotice we have Contact = \"Miss Patricia Doyle\"....\n\n**EXPECTED RESULTS:** The Phone Number(s) and Email for \"Miss Patricia Doyle\" should pull in.\n**ACTUAL RESULTS:** The fields are the same as they were for the previous contact \"Mr. Andy Teal\" and you need to refresh the Page so it pulls in the new Phone numbers and email for \"Mr. Andy Teal\" Contact.\nDescription:\nCopied and Derived from Support Case Review", "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/ERMSalesDocumentsII.Codeunit.al b/App/Layers/W1/Tests/ERM/ERMSalesDocumentsII.Codeunit.al\nindex bc3ad2bbe5c..30e993b56af 100644\n--- a/App/Layers/W1/Tests/ERM/ERMSalesDocumentsII.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ERMSalesDocumentsII.Codeunit.al\n@@ -4462,6 +4462,51 @@ codeunit 134386 \"ERM Sales Documents II\"\n SalesOrder.SalesLines.\"Invoice Discount Amount\".AssertEquals(SalesHeader.\"Invoice Discount Value\");\n end;\n \n+ [HandlerFunctions('CustomerLookupHandler,ConfirmHandlerYes')]\n+ [Test]\n+ procedure UpdateEmailAndPhoneNoWhenChangeBillToOfSalesInvoice()\n+ var\n+ Contact: array[2] of Record Contact;\n+ Customer: array[2] of Record Customer;\n+ SalesHeader: Record \"Sales Header\";\n+ SalesInvoice: TestPage \"Sales Invoice\";\n+ begin\n+ // [SCENARIO 564632] The Email and Phone No. should update when selecting Another Customer in the \"Bill-to\" field of a Sales Invoice\n+ Initialize();\n+\n+ // [GIVEN] Create First Customer with First Contact with Phone = \"111111111\", Mobile Phone = \"222222222\" and Email = \"contact1@mail.com\"\n+ LibraryMarketing.CreateContactWithCustomer(Contact[1], Customer[1]);\n+ UpdateContactInfo(Contact[1], '111111111', '222222222', 'contact1@mail.com');\n+ Contact[1].Modify(true);\n+\n+ // [GIVEN] Create Second Customer with Second Contact with Phone = \"333333333\", Mobile Phone = \"444444444\" and Email = \"contact2@mail.com\"\n+ LibraryMarketing.CreateContactWithCustomer(Contact[2], Customer[2]);\n+ UpdateContactInfo(Contact[2], '333333333', '444444444', 'contact2@mail.com');\n+ Contact[2].Modify(true);\n+\n+ // [GIVEN] Create Sales Invoice with First Customer\n+ LibrarySales.CreateSalesHeader(SalesHeader, SalesHeader.\"Document Type\"::Invoice, Customer[1].\"No.\");\n+\n+ // [GIVEN] Sales Invoice Card is opened\n+ LibraryVariableStorage.Enqueue(Customer[2].\"No.\");\n+ LibraryVariableStorage.Enqueue('');\n+ LibraryVariableStorage.Enqueue(true); // yes to change \"Bill-to Customer No.\"\n+ SalesInvoice.OpenEdit();\n+ SalesInvoice.FILTER.SetFilter(\"No.\", SalesHeader.\"No.\");\n+\n+ // [WHEN] Select Second Customer when lookup \"Bill-to Customer Name\"\n+ SalesInvoice.\"Bill-to Name\".Lookup();\n+\n+ // [THEN] Verify Sales Invoice \"Phone No.\" = \"333333333\"\n+ SalesInvoice.BillToContactPhoneNo.AssertEquals(Contact[2].\"Phone No.\");\n+\n+ // [THEN] Verify Sales Invoice \"Mobile Phone No.\" = \"444444444\"\n+ SalesInvoice.BillToContactMobilePhoneNo.AssertEquals(Contact[2].\"Mobile Phone No.\");\n+\n+ // [THEN] Verify Sales Invoice \"Email\" = \"contact2@mail.com\"\n+ SalesInvoice.BillToContactEmail.AssertEquals(Contact[2].\"E-Mail\");\n+ end;\n+\n [Test]\n [Scope('OnPrem')]\n procedure UpdateExtendedTextTypeNotAllowed()\n@@ -6595,5 +6640,14 @@ codeunit 134386 \"ERM Sales Documents II\"\n CustomerLookup.Filter.SetFilter(Name, LibraryVariableStorage.DequeueText());\n CustomerLookup.OK().Invoke();\n end;\n+\n+ [ModalPageHandler]\n+ procedure CustomerLookupHandler(var CustomerLookup: TestPage \"Customer Lookup\")\n+ begin\n+ CustomerLookup.GotoKey(LibraryVariableStorage.DequeueText());\n+ Assert.AreEqual(LibraryVariableStorage.DequeueText(),\n+ CustomerLookup.Filter.GetFilter(\"Date Filter\"), 'Wrong Date Filter.');\n+ CustomerLookup.OK().Invoke();\n+ end;\n }\n \n", "patch": "diff --git a/App/Layers/W1/BaseApp/Sales/Document/BlanketSalesOrder.Page.al b/App/Layers/W1/BaseApp/Sales/Document/BlanketSalesOrder.Page.al\nindex 1dee700e044..a3b2013773f 100644\n--- a/App/Layers/W1/BaseApp/Sales/Document/BlanketSalesOrder.Page.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/BlanketSalesOrder.Page.al\n@@ -648,6 +648,23 @@ page 507 \"Blanket Sales Order\"\n Rec.SetRange(\"Bill-to Customer No.\");\n CurrPage.Update();\n end;\n+\n+ trigger OnLookup(var Text: Text): Boolean\n+ var\n+ Customer: Record Customer;\n+ begin\n+ if Customer.SelectCustomer(Customer) then begin\n+ xRec := Rec;\n+ Rec.\"Bill-to Name\" := Customer.Name;\n+ Rec.Validate(\"Bill-to Customer No.\", Customer.\"No.\");\n+ end;\n+\n+ if Rec.GetFilter(\"Bill-to Customer No.\") = xRec.\"Bill-to Customer No.\" then\n+ if Rec.\"Bill-to Customer No.\" <> xRec.\"Bill-to Customer No.\" then\n+ Rec.SetRange(\"Bill-to Customer No.\");\n+\n+ CurrPage.Update();\n+ end;\n }\n field(\"Bill-to Address\"; Rec.\"Bill-to Address\")\n {\ndiff --git a/App/Layers/W1/BaseApp/Sales/Document/SalesCreditMemo.Page.al b/App/Layers/W1/BaseApp/Sales/Document/SalesCreditMemo.Page.al\nindex 84ba27e1b17..3f876b15fd0 100644\n--- a/App/Layers/W1/BaseApp/Sales/Document/SalesCreditMemo.Page.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/SalesCreditMemo.Page.al\n@@ -552,6 +552,23 @@ page 44 \"Sales Credit Memo\"\n \n CurrPage.Update();\n end;\n+\n+ trigger OnLookup(var Text: Text): Boolean\n+ var\n+ Customer: Record Customer;\n+ begin\n+ if Customer.SelectCustomer(Customer) then begin\n+ xRec := Rec;\n+ Rec.\"Bill-to Name\" := Customer.Name;\n+ Rec.Validate(\"Bill-to Customer No.\", Customer.\"No.\");\n+ end;\n+\n+ if Rec.GetFilter(\"Bill-to Customer No.\") = xRec.\"Bill-to Customer No.\" then\n+ if Rec.\"Bill-to Customer No.\" <> xRec.\"Bill-to Customer No.\" then\n+ Rec.SetRange(\"Bill-to Customer No.\");\n+\n+ CurrPage.Update();\n+ end;\n }\n field(\"Bill-to Address\"; Rec.\"Bill-to Address\")\n {\ndiff --git a/App/Layers/W1/BaseApp/Sales/Document/SalesInvoice.Page.al b/App/Layers/W1/BaseApp/Sales/Document/SalesInvoice.Page.al\nindex ee0d93e0f64..930047f5653 100644\n--- a/App/Layers/W1/BaseApp/Sales/Document/SalesInvoice.Page.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/SalesInvoice.Page.al\n@@ -803,6 +803,25 @@ page 43 \"Sales Invoice\"\n CurrPage.Update();\n end;\n end;\n+\n+ trigger OnLookup(var Text: Text): Boolean\n+ var\n+ Customer: Record Customer;\n+ begin\n+ if Customer.SelectCustomer(Customer) then begin\n+ xRec := Rec;\n+ Rec.\"Bill-to Name\" := Customer.Name;\n+ Rec.Validate(\"Bill-to Customer No.\", Customer.\"No.\");\n+ end;\n+\n+ if not ((BillToOptions = BillToOptions::\"Custom Address\") and not ShouldSearchForCustByName) then begin\n+ if Rec.GetFilter(\"Bill-to Customer No.\") = xRec.\"Bill-to Customer No.\" then\n+ if Rec.\"Bill-to Customer No.\" <> xRec.\"Bill-to Customer No.\" then\n+ Rec.SetRange(\"Bill-to Customer No.\");\n+\n+ CurrPage.Update();\n+ end;\n+ end;\n }\n field(\"Bill-to Address\"; Rec.\"Bill-to Address\")\n {\ndiff --git a/App/Layers/W1/BaseApp/Sales/Document/SalesOrder.Page.al b/App/Layers/W1/BaseApp/Sales/Document/SalesOrder.Page.al\nindex 77cf2b1863e..2a751833971 100644\n--- a/App/Layers/W1/BaseApp/Sales/Document/SalesOrder.Page.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/SalesOrder.Page.al\n@@ -812,6 +812,25 @@ page 42 \"Sales Order\"\n CurrPage.Update();\n end;\n end;\n+\n+ trigger OnLookup(var Text: Text): Boolean\n+ var\n+ Customer: Record Customer;\n+ begin\n+ if Customer.SelectCustomer(Customer) then begin\n+ xRec := Rec;\n+ Rec.\"Bill-to Name\" := Customer.Name;\n+ Rec.Validate(\"Bill-to Customer No.\", Customer.\"No.\");\n+ end;\n+\n+ if not ((BillToOptions = BillToOptions::\"Custom Address\") and not ShouldSearchForCustByName) then begin\n+ if Rec.GetFilter(\"Bill-to Customer No.\") = xRec.\"Bill-to Customer No.\" then\n+ if Rec.\"Bill-to Customer No.\" <> xRec.\"Bill-to Customer No.\" then\n+ Rec.SetRange(\"Bill-to Customer No.\");\n+\n+ CurrPage.Update();\n+ end;\n+ end;\n }\n field(\"Bill-to Address\"; Rec.\"Bill-to Address\")\n {\ndiff --git a/App/Layers/W1/BaseApp/Sales/Document/SalesQuote.Page.al b/App/Layers/W1/BaseApp/Sales/Document/SalesQuote.Page.al\nindex 7827a9ece78..5851f14e04b 100644\n--- a/App/Layers/W1/BaseApp/Sales/Document/SalesQuote.Page.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/SalesQuote.Page.al\n@@ -763,6 +763,23 @@ page 41 \"Sales Quote\"\n \n CurrPage.Update();\n end;\n+\n+ trigger OnLookup(var Text: Text): Boolean\n+ var\n+ Customer: Record Customer;\n+ begin\n+ if Customer.SelectCustomer(Customer) then begin\n+ xRec := Rec;\n+ Rec.\"Bill-to Name\" := Customer.Name;\n+ Rec.Validate(\"Bill-to Customer No.\", Customer.\"No.\");\n+ end;\n+\n+ if Rec.GetFilter(\"Bill-to Customer No.\") = xRec.\"Bill-to Customer No.\" then\n+ if Rec.\"Bill-to Customer No.\" <> xRec.\"Bill-to Customer No.\" then\n+ Rec.SetRange(\"Bill-to Customer No.\");\n+\n+ CurrPage.Update();\n+ end;\n }\n field(\"Bill-to Address\"; Rec.\"Bill-to Address\")\n {\ndiff --git a/App/Layers/W1/BaseApp/Sales/Document/SalesReturnOrder.Page.al b/App/Layers/W1/BaseApp/Sales/Document/SalesReturnOrder.Page.al\nindex e9c58725477..a0e9bb787e7 100644\n--- a/App/Layers/W1/BaseApp/Sales/Document/SalesReturnOrder.Page.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/SalesReturnOrder.Page.al\n@@ -613,6 +613,23 @@ page 6630 \"Sales Return Order\"\n \n CurrPage.Update();\n end;\n+\n+ trigger OnLookup(var Text: Text): Boolean\n+ var\n+ Customer: Record Customer;\n+ begin\n+ if Customer.SelectCustomer(Customer) then begin\n+ xRec := Rec;\n+ Rec.\"Bill-to Name\" := Customer.Name;\n+ Rec.Validate(\"Bill-to Customer No.\", Customer.\"No.\");\n+ end;\n+\n+ if Rec.GetFilter(\"Bill-to Customer No.\") = xRec.\"Bill-to Customer No.\" then\n+ if Rec.\"Bill-to Customer No.\" <> xRec.\"Bill-to Customer No.\" then\n+ Rec.SetRange(\"Bill-to Customer No.\");\n+\n+ CurrPage.Update();\n+ end;\n }\n field(\"Bill-to Address\"; Rec.\"Bill-to Address\")\n {\n"} -{"repo": "microsoftInternal/NAV", "instance_id": "microsoftInternal__NAV-199883", "base_commit": "aaf1c6d95a374d426984ab59eacb82f1047659b5", "created_at": "2024-11-12", "environment_setup_version": "25.1", "project_paths": ["App\\Layers\\W1\\BaseApp", "App\\Layers\\W1\\Tests\\SCM"], "hints_text": "", "FAIL_TO_PASS": [{"codeunitID": 137033, "functionName": ["BinContentMovementBlockedThrowsErrorWhenPostingItemJournal"]}], "PASS_TO_PASS": [], "problem_statement": "Title: [master] [ALL-E] Bin Content Block Movement is not considered when posting an item journal.\nRepro Steps:\nOpen Cronus 24.2. Go to locations. Go to the warehouse employees and add location SILVER to your user Go to the item journal.Create an entry as follows:Item No \"1896-S\"Location: SILVERBin code: S-01-0001Quantity: 40post Go to Bin ContentsSelect your entry -> Block Movement: All. Go to the item journal Create an entry as follows:Item No \"1896-S\"Location: SILVERBin code: S-01-0001Quantity: 40post The Entry is posted successfully. Expected Results: The entry shouldn't be posted for the same Item No. Block Movement Specifies how the movement of a particular item, or bin content, into or out of this bin, is blocked. Actual Results: The entry is still posted even if the Bin content has a block movement on All. Investigation: Tested on 24.2 , 23.07 and 22.13 OnPrem and the same behavior happens. It seems to be that all settings are ignored for Block Movement I tried also with Inbound and Outbound and according postings and everything can be posted.\nDescription:\nBin Content Block Movement Doesn't work as expected\n", "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\nindex 4d85519ac9a..a2506b2d267 100644\n--- a/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\n@@ -34,6 +34,8 @@\n OneEntryExpectedErr: Label 'Only one Item Ledger Entry is expected.';\n MultipleEntriesExpectedErr: Label 'Two Item Ledger Entries expected.';\n RoundingTo0Err: Label 'Rounding of the field';\n+ BlockedBinContentErr: Label 'Block Movement must not be All in Bin Content Location Code=''%1'',Bin Code=''%2'',Item No.=''%3'',Variant Code=''%4'',Unit of Measure Code=''%5''.',\n+ Comment = '%1= Location Code, %2= Bin Code, %3= Item No., %4= Varient Code, %5= Unit of Measure Code';\n \n [Test]\n [Scope('OnPrem')]\n@@ -2091,6 +2093,86 @@\n Assert.RecordIsEmpty(RecordLink);\n end;\n \n+ [Test]\n+ procedure BinContentMovementBlockedThrowsErrorWhenPostingItemJournal()\n+ var\n+ Bin: Record Bin;\n+ BinContent: Record \"Bin Content\";\n+ Item: Record Item;\n+ ItemJournalTemplate: Record \"Item Journal Template\";\n+ ItemJournalBatch: Record \"Item Journal Batch\";\n+ ItemJournalLine: Record \"Item Journal Line\";\n+ Location: Record Location;\n+ begin\n+ // [SCENARIO 538864] Bin Content Block Movement is considered when posting an Item Journal.\n+ Initialize();\n+\n+ // [GIVEN] Create an Item.\n+ LibraryInventory.CreateItem(Item);\n+\n+ // [GIVEN] Create a Location with require Bin and a Default Bin Code.\n+ LibraryWarehouse.CreateLocationWMS(Location, true, false, false, false, false);\n+\n+ // [GIVEN] Create a Bin.\n+ LibraryWarehouse.CreateBin(Bin, Location.Code, '', '', '');\n+\n+ // [GIVEN] Validate Default Bin Code in Location.\n+ Location.Validate(\"Default Bin Code\", Bin.Code);\n+ Location.Modify(true);\n+\n+ // [GIVEN] Select an Item Journal Template of Type Item.\n+ LibraryInventory.SelectItemJournalTemplateName(ItemJournalTemplate, ItemJournalTemplate.Type::Item);\n+\n+ // [GIVEN] Select an Item Journal Batch.\n+ LibraryInventory.SelectItemJournalBatchName(ItemJournalBatch, ItemJournalTemplate.Type::Item, ItemJournalTemplate.Name);\n+\n+ // [GIVEN] Create an Item Journal Line\n+ LibraryInventory.ClearItemJournal(ItemJournalTemplate, ItemJournalBatch);\n+ LibraryInventory.CreateItemJournalLine(\n+ ItemJournalLine,\n+ ItemJournalBatch.\"Journal Template Name\",\n+ ItemJournalBatch.Name,\n+ ItemJournalLine.\"Entry Type\"::Purchase,\n+ Item.\"No.\",\n+ LibraryRandom.RandInt(10));\n+\n+ // [GIVEN] Validate Location Code and Bin Code in Item Journal Line.\n+ ItemJournalLine.Validate(\"Location Code\", Location.Code);\n+ ItemJournalLine.Validate(\"Bin Code\", Bin.Code);\n+ ItemJournalLine.Modify(true);\n+\n+ // [GIVEN] Post an Item Journal.\n+ LibraryInventory.PostItemJournalLine(ItemJournalLine.\"Journal Template Name\", ItemJournalLine.\"Journal Batch Name\");\n+\n+ // [GIVEN] Find Bin Content and Validate Block Movement to All.\n+ BinContent.SetRange(\"Bin Code\", Bin.Code);\n+ BinContent.SetRange(\"Item No.\", Item.\"No.\");\n+ BinContent.SetRange(\"Location Code\", Location.Code);\n+ BinContent.FindFirst();\n+ BinContent.Validate(\"Block Movement\", BinContent.\"Block Movement\"::All);\n+ BinContent.Modify(true);\n+\n+ // [GIVEN] Clear an Item Journal\n+ LibraryInventory.ClearItemJournal(ItemJournalTemplate, ItemJournalBatch);\n+\n+ // [GIVEN] Create an Item Journal and Validate Location Code.\n+ LibraryInventory.CreateItemJournalLine(\n+ ItemJournalLine,\n+ ItemJournalBatch.\"Journal Template Name\",\n+ ItemJournalBatch.Name,\n+ ItemJournalLine.\"Entry Type\"::Purchase,\n+ Item.\"No.\",\n+ LibraryRandom.RandInt(10));\n+ ItemJournalLine.Validate(\"Location Code\", Location.Code);\n+ ItemJournalLine.Modify(true);\n+\n+ // [WHEN] Post an Item Journal.\n+ asserterror LibraryInventory.PostItemJournalLine(ItemJournalLine.\"Journal Template Name\", ItemJournalLine.\"Journal Batch Name\");\n+\n+ // [THEN] Error of Bin Content Movement blocked is raised.\n+ Assert.ExpectedError(StrSubstNo(BlockedBinContentErr, ItemJournalLine.\"Location Code\", ItemJournalLine.\"Bin Code\", ItemJournalLine.\"Item No.\", ItemJournalLine.\"Variant Code\", ItemJournalLine.\"Unit of Measure Code\"));\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Warehouse/Journal/WMSManagement.Codeunit.al b/App/Layers/W1/BaseApp/Warehouse/Journal/WMSManagement.Codeunit.al\nindex d165f3a21a7..08c0e53701b 100644\n--- a/App/Layers/W1/BaseApp/Warehouse/Journal/WMSManagement.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Warehouse/Journal/WMSManagement.Codeunit.al\n@@ -193,8 +193,10 @@ codeunit 7302 \"WMS Management\"\n GetBin(WarehouseJournalLine.\"Location Code\", WarehouseJournalLine.\"To Bin Code\");\n Bin.CheckIncreaseBin(Bin.Code, WarehouseJournalLine.\"Item No.\", WarehouseJournalLine.\"Qty. (Absolute)\", WarehouseJournalLine.Cubage, WarehouseJournalLine.Weight, WarehouseJournalLine.Cubage, WarehouseJournalLine.Weight, true, false);\n end;\n- end else\n+ end else begin\n CheckWarehouseClass(WarehouseJournalLine.\"Location Code\", WarehouseJournalLine.\"To Bin Code\", WarehouseJournalLine.\"Item No.\", WarehouseJournalLine.\"Variant Code\", WarehouseJournalLine.\"Unit of Measure Code\");\n+ CheckBinAndBinContentMovement(WarehouseJournalLine);\n+ end;\n SourceJnl::OutputJnl, SourceJnl::ConsumpJnl:\n if WarehouseJournalLine.\"To Bin Code\" <> '' then\n if Location.\"Bin Capacity Policy\" <> Location.\"Bin Capacity Policy\"::\"Never Check Capacity\" then\n@@ -1803,7 +1805,7 @@ codeunit 7302 \"WMS Management\"\n OnBeforeCheckBlockedBin(LocationCode, BinCode, ItemNo, VariantCode, UnitOfMeasureCode, CheckInbound, IsHandled);\n if not IsHandled then begin\n GetLocation(LocationCode);\n- if Location.\"Directed Put-away and Pick\" then\n+ if (Location.\"Directed Put-away and Pick\") or ((BinCode <> '') and (Location.\"Bin Capacity Policy\" = Location.\"Bin Capacity Policy\"::\"Never Check Capacity\")) then\n if BinContent.Get(LocationCode, BinCode, ItemNo, VariantCode, UnitOfMeasureCode) then begin\n if (CheckInbound and\n (BinContent.\"Block Movement\" in [BinContent.\"Block Movement\"::Inbound, BinContent.\"Block Movement\"::All])) or\n@@ -1848,6 +1850,19 @@ codeunit 7302 \"WMS Management\"\n exit(Bin2.\"Bin Type Code\");\n end;\n \n+ local procedure CheckBinAndBinContentMovement(WarehouseJournalLine: Record \"Warehouse Journal Line\")\n+ begin\n+ if WarehouseJournalLine.Quantity = 0 then\n+ exit;\n+\n+ case WarehouseJournalLine.\"Entry Type\" of\n+ WarehouseJournalLine.\"Entry Type\"::\"Positive Adjmt.\":\n+ CheckBlockedBin(WarehouseJournalLine.\"Location Code\", WarehouseJournalLine.\"To Bin Code\", WarehouseJournalLine.\"Item No.\", WarehouseJournalLine.\"Variant Code\", WarehouseJournalLine.\"Unit of Measure Code\", WarehouseJournalLine.Quantity > 0);\n+ WarehouseJournalLine.\"Entry Type\"::\"Negative Adjmt.\":\n+ CheckBlockedBin(WarehouseJournalLine.\"Location Code\", WarehouseJournalLine.\"To Bin Code\", WarehouseJournalLine.\"Item No.\", WarehouseJournalLine.\"Variant Code\", WarehouseJournalLine.\"Unit of Measure Code\", WarehouseJournalLine.Quantity < 0);\n+ end;\n+ end;\n+\n [IntegrationEvent(false, false)]\n local procedure OnAfterCheckBlockedBin(LocationCode: Code[10]; BinCode: Code[20]; ItemNo: Code[20]; VariantCode: Code[10]; UnitOfMeasureCode: Code[10]; CheckInbound: Boolean)\n begin\n"} +{"repo": "microsoftInternal/NAV", "instance_id": "microsoftInternal__NAV-199883", "base_commit": "aaf1c6d95a374d426984ab59eacb82f1047659b5", "created_at": "2024-11-12", "environment_setup_version": "24.5", "project_paths": ["App\\Layers\\W1\\BaseApp", "App\\Layers\\W1\\Tests\\SCM"], "hints_text": "", "FAIL_TO_PASS": [{"codeunitID": 137033, "functionName": ["BinContentMovementBlockedThrowsErrorWhenPostingItemJournal"]}], "PASS_TO_PASS": [], "problem_statement": "Title: [master] [ALL-E] Bin Content Block Movement is not considered when posting an item journal.\nRepro Steps:\nOpen Cronus 24.2. Go to locations. Go to the warehouse employees and add location SILVER to your user Go to the item journal.Create an entry as follows:Item No \"1896-S\"Location: SILVERBin code: S-01-0001Quantity: 40post Go to Bin ContentsSelect your entry -> Block Movement: All. Go to the item journal Create an entry as follows:Item No \"1896-S\"Location: SILVERBin code: S-01-0001Quantity: 40post The Entry is posted successfully. Expected Results: The entry shouldn't be posted for the same Item No. Block Movement Specifies how the movement of a particular item, or bin content, into or out of this bin, is blocked. Actual Results: The entry is still posted even if the Bin content has a block movement on All. Investigation: Tested on 24.2 , 23.07 and 22.13 OnPrem and the same behavior happens. It seems to be that all settings are ignored for Block Movement I tried also with Inbound and Outbound and according postings and everything can be posted.\nDescription:\nBin Content Block Movement Doesn't work as expected\n", "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\nindex 4d85519ac9a..a2506b2d267 100644\n--- a/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\n@@ -34,6 +34,8 @@\n OneEntryExpectedErr: Label 'Only one Item Ledger Entry is expected.';\n MultipleEntriesExpectedErr: Label 'Two Item Ledger Entries expected.';\n RoundingTo0Err: Label 'Rounding of the field';\n+ BlockedBinContentErr: Label 'Block Movement must not be All in Bin Content Location Code=''%1'',Bin Code=''%2'',Item No.=''%3'',Variant Code=''%4'',Unit of Measure Code=''%5''.',\n+ Comment = '%1= Location Code, %2= Bin Code, %3= Item No., %4= Varient Code, %5= Unit of Measure Code';\n \n [Test]\n [Scope('OnPrem')]\n@@ -2091,6 +2093,86 @@\n Assert.RecordIsEmpty(RecordLink);\n end;\n \n+ [Test]\n+ procedure BinContentMovementBlockedThrowsErrorWhenPostingItemJournal()\n+ var\n+ Bin: Record Bin;\n+ BinContent: Record \"Bin Content\";\n+ Item: Record Item;\n+ ItemJournalTemplate: Record \"Item Journal Template\";\n+ ItemJournalBatch: Record \"Item Journal Batch\";\n+ ItemJournalLine: Record \"Item Journal Line\";\n+ Location: Record Location;\n+ begin\n+ // [SCENARIO 538864] Bin Content Block Movement is considered when posting an Item Journal.\n+ Initialize();\n+\n+ // [GIVEN] Create an Item.\n+ LibraryInventory.CreateItem(Item);\n+\n+ // [GIVEN] Create a Location with require Bin and a Default Bin Code.\n+ LibraryWarehouse.CreateLocationWMS(Location, true, false, false, false, false);\n+\n+ // [GIVEN] Create a Bin.\n+ LibraryWarehouse.CreateBin(Bin, Location.Code, '', '', '');\n+\n+ // [GIVEN] Validate Default Bin Code in Location.\n+ Location.Validate(\"Default Bin Code\", Bin.Code);\n+ Location.Modify(true);\n+\n+ // [GIVEN] Select an Item Journal Template of Type Item.\n+ LibraryInventory.SelectItemJournalTemplateName(ItemJournalTemplate, ItemJournalTemplate.Type::Item);\n+\n+ // [GIVEN] Select an Item Journal Batch.\n+ LibraryInventory.SelectItemJournalBatchName(ItemJournalBatch, ItemJournalTemplate.Type::Item, ItemJournalTemplate.Name);\n+\n+ // [GIVEN] Create an Item Journal Line\n+ LibraryInventory.ClearItemJournal(ItemJournalTemplate, ItemJournalBatch);\n+ LibraryInventory.CreateItemJournalLine(\n+ ItemJournalLine,\n+ ItemJournalBatch.\"Journal Template Name\",\n+ ItemJournalBatch.Name,\n+ ItemJournalLine.\"Entry Type\"::Purchase,\n+ Item.\"No.\",\n+ LibraryRandom.RandInt(10));\n+\n+ // [GIVEN] Validate Location Code and Bin Code in Item Journal Line.\n+ ItemJournalLine.Validate(\"Location Code\", Location.Code);\n+ ItemJournalLine.Validate(\"Bin Code\", Bin.Code);\n+ ItemJournalLine.Modify(true);\n+\n+ // [GIVEN] Post an Item Journal.\n+ LibraryInventory.PostItemJournalLine(ItemJournalLine.\"Journal Template Name\", ItemJournalLine.\"Journal Batch Name\");\n+\n+ // [GIVEN] Find Bin Content and Validate Block Movement to All.\n+ BinContent.SetRange(\"Bin Code\", Bin.Code);\n+ BinContent.SetRange(\"Item No.\", Item.\"No.\");\n+ BinContent.SetRange(\"Location Code\", Location.Code);\n+ BinContent.FindFirst();\n+ BinContent.Validate(\"Block Movement\", BinContent.\"Block Movement\"::All);\n+ BinContent.Modify(true);\n+\n+ // [GIVEN] Clear an Item Journal\n+ LibraryInventory.ClearItemJournal(ItemJournalTemplate, ItemJournalBatch);\n+\n+ // [GIVEN] Create an Item Journal and Validate Location Code.\n+ LibraryInventory.CreateItemJournalLine(\n+ ItemJournalLine,\n+ ItemJournalBatch.\"Journal Template Name\",\n+ ItemJournalBatch.Name,\n+ ItemJournalLine.\"Entry Type\"::Purchase,\n+ Item.\"No.\",\n+ LibraryRandom.RandInt(10));\n+ ItemJournalLine.Validate(\"Location Code\", Location.Code);\n+ ItemJournalLine.Modify(true);\n+\n+ // [WHEN] Post an Item Journal.\n+ asserterror LibraryInventory.PostItemJournalLine(ItemJournalLine.\"Journal Template Name\", ItemJournalLine.\"Journal Batch Name\");\n+\n+ // [THEN] Error of Bin Content Movement blocked is raised.\n+ Assert.ExpectedError(StrSubstNo(BlockedBinContentErr, ItemJournalLine.\"Location Code\", ItemJournalLine.\"Bin Code\", ItemJournalLine.\"Item No.\", ItemJournalLine.\"Variant Code\", ItemJournalLine.\"Unit of Measure Code\"));\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Warehouse/Journal/WMSManagement.Codeunit.al b/App/Layers/W1/BaseApp/Warehouse/Journal/WMSManagement.Codeunit.al\nindex d165f3a21a7..08c0e53701b 100644\n--- a/App/Layers/W1/BaseApp/Warehouse/Journal/WMSManagement.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Warehouse/Journal/WMSManagement.Codeunit.al\n@@ -193,8 +193,10 @@ codeunit 7302 \"WMS Management\"\n GetBin(WarehouseJournalLine.\"Location Code\", WarehouseJournalLine.\"To Bin Code\");\n Bin.CheckIncreaseBin(Bin.Code, WarehouseJournalLine.\"Item No.\", WarehouseJournalLine.\"Qty. (Absolute)\", WarehouseJournalLine.Cubage, WarehouseJournalLine.Weight, WarehouseJournalLine.Cubage, WarehouseJournalLine.Weight, true, false);\n end;\n- end else\n+ end else begin\n CheckWarehouseClass(WarehouseJournalLine.\"Location Code\", WarehouseJournalLine.\"To Bin Code\", WarehouseJournalLine.\"Item No.\", WarehouseJournalLine.\"Variant Code\", WarehouseJournalLine.\"Unit of Measure Code\");\n+ CheckBinAndBinContentMovement(WarehouseJournalLine);\n+ end;\n SourceJnl::OutputJnl, SourceJnl::ConsumpJnl:\n if WarehouseJournalLine.\"To Bin Code\" <> '' then\n if Location.\"Bin Capacity Policy\" <> Location.\"Bin Capacity Policy\"::\"Never Check Capacity\" then\n@@ -1803,7 +1805,7 @@ codeunit 7302 \"WMS Management\"\n OnBeforeCheckBlockedBin(LocationCode, BinCode, ItemNo, VariantCode, UnitOfMeasureCode, CheckInbound, IsHandled);\n if not IsHandled then begin\n GetLocation(LocationCode);\n- if Location.\"Directed Put-away and Pick\" then\n+ if (Location.\"Directed Put-away and Pick\") or ((BinCode <> '') and (Location.\"Bin Capacity Policy\" = Location.\"Bin Capacity Policy\"::\"Never Check Capacity\")) then\n if BinContent.Get(LocationCode, BinCode, ItemNo, VariantCode, UnitOfMeasureCode) then begin\n if (CheckInbound and\n (BinContent.\"Block Movement\" in [BinContent.\"Block Movement\"::Inbound, BinContent.\"Block Movement\"::All])) or\n@@ -1848,6 +1850,19 @@ codeunit 7302 \"WMS Management\"\n exit(Bin2.\"Bin Type Code\");\n end;\n \n+ local procedure CheckBinAndBinContentMovement(WarehouseJournalLine: Record \"Warehouse Journal Line\")\n+ begin\n+ if WarehouseJournalLine.Quantity = 0 then\n+ exit;\n+\n+ case WarehouseJournalLine.\"Entry Type\" of\n+ WarehouseJournalLine.\"Entry Type\"::\"Positive Adjmt.\":\n+ CheckBlockedBin(WarehouseJournalLine.\"Location Code\", WarehouseJournalLine.\"To Bin Code\", WarehouseJournalLine.\"Item No.\", WarehouseJournalLine.\"Variant Code\", WarehouseJournalLine.\"Unit of Measure Code\", WarehouseJournalLine.Quantity > 0);\n+ WarehouseJournalLine.\"Entry Type\"::\"Negative Adjmt.\":\n+ CheckBlockedBin(WarehouseJournalLine.\"Location Code\", WarehouseJournalLine.\"To Bin Code\", WarehouseJournalLine.\"Item No.\", WarehouseJournalLine.\"Variant Code\", WarehouseJournalLine.\"Unit of Measure Code\", WarehouseJournalLine.Quantity < 0);\n+ end;\n+ end;\n+\n [IntegrationEvent(false, false)]\n local procedure OnAfterCheckBlockedBin(LocationCode: Code[10]; BinCode: Code[20]; ItemNo: Code[20]; VariantCode: Code[10]; UnitOfMeasureCode: Code[10]; CheckInbound: Boolean)\n begin\n"} From 7556b98681540e431c012180487072b611ee4dbd Mon Sep 17 00:00:00 2001 From: Jiawen Sun Date: Wed, 19 Nov 2025 00:45:42 +0100 Subject: [PATCH 5/6] Use 24.0 --- dataset/bcbench_nav.jsonl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dataset/bcbench_nav.jsonl b/dataset/bcbench_nav.jsonl index 9a7616b11..15ab86016 100644 --- a/dataset/bcbench_nav.jsonl +++ b/dataset/bcbench_nav.jsonl @@ -23,4 +23,4 @@ {"repo": "microsoftInternal/NAV", "instance_id": "microsoftInternal__NAV-206527", "base_commit": "d8e867062d4137cf5df2d9d2b8a71bb53210f685", "created_at": "2025-02-07", "environment_setup_version": "26.0", "project_paths": ["App\\Layers\\W1\\BaseApp", "App\\Layers\\W1\\Tests\\SCM"], "hints_text": "", "FAIL_TO_PASS": [{"codeunitID": 137088, "functionName": ["ReleasedProdOrderQuantityPerandExpectedQtyRoundingPrecisionChecking"]}], "PASS_TO_PASS": [], "problem_statement": "Title: If a component's Item UOM has a 'Quantity Rounding Precision' of 1, & a Finished Good consumes partial quantity, the Prod. Order created from the Planning of a Sales Order pulls in the Component with a 'Qty. Per' and 'Exp. Qty.' of 0.\nRepro Steps:\n1. Use existing Item with no activity, or create new item. This will be the COMPONENT Item. Will use PCS as UOM.\n2. For the Component Item, go into Related > Item UOM > and set 'Quantity Rounding Precision' = 1 on the bottom.\n3. Component Item should have\n Replenishment System = PURCHASE\n Rounding Precision = .01\n Reorder Policy = Lot-for-Lot\n Include Inventory = TRUE\n4. Then have another Item, I'll call it FG Item which is:\n Replenishment System = PRODUNCTION ORDER\n Rounding Precision = 1\n Reorder Policy = ORDER\n Production BOM => Create new Certified Production BOM that consumes COMPONENT Item with 'Quantity Per' = .09\n5. Now create Sales Order for any Customer for FG Item for 1 Quantity at BLUE (or MAIN) location.\n6. On the Sales Order go to Actions > Plan > Planning > Create Prod. Order and choose 'Released' and 'Item Order'.\n7. Then choose Order Tracking and then 'Show' which will take you to the Released Prod. Order.\n8. We will see prod. Order for FG Item with 1 qty. Go to Line > Components\n\n**EXPECTED RESULTS** = 'Quantity Per' and 'Expected Quantity' = .09\n**ACTUAL RESULTS** = 'Quantity Per' and 'Expected Quantity' = 0\n\nIf you were then to delete the Released Production Order, and go to the Planning Worksheet and run the Calc. Regenerative Plan for the 2 items, you would receive an error:\n\"The value in the Qty. Rounding Precision field on the Item Unit of Measure page is causing the rounding precision for the Expected Quantity field to be incorrect.\"\n\nDescription:\n2If a component's Item UOM has a 'Quantity Rounding Precision' set to 1, and a Finished Good consumes partial quantity, the Production Order created from the Planning section of a Sales Order pulls in the Component but with a 'Quantity Per' and 'Expected Quantity' of 0. If we are producing 1 FG Item and the 'Quantity Per' is set to consume .1 component, we would expect 'Quantity Per' and 'Expected Quantity' both = .1. There is no error message.\n\nBut if you run the Planning Worksheet's 'Calc. Regenerative Plan', then you will get an error message about the 'Quantity Rounding Precision'.\n\nI don't believe the 'Quantity Rounding Precision' in the Item UOM should have any influence on this process. I always thought this field was only for scenario with Picking and when Base UOM is larger than the smallest UOM, and picking in smallest UOM. There is a lot of confusion about this 'Quantity Rounding Precision' field within the Item UOM actually.\n", "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMOrderPlanningIII.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMOrderPlanningIII.Codeunit.al\nindex 7415eaa53cc..2573227dbca 100644\n--- a/App/Layers/W1/Tests/SCM/SCMOrderPlanningIII.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMOrderPlanningIII.Codeunit.al\n@@ -45,6 +45,8 @@ codeunit 137088 \"SCM Order Planning - III\"\n LineExistErr: Label 'Requistion line in %1 worksheet should exist for item %2';\n PurchaseLineQuantityBaseErr: Label '%1.%2 must be nearly equal to %3.', Comment = '%1 : Purchase Line, %2 : Quantity (Base), %3 : Value.';\n BOMFixedQtyCalcFormulaErr: Label 'BOM Fixed Quantity Calculation Formula should be used to calculate the values.';\n+ RelesedProdOrderComponentQtyPerRoundingErr: Label 'Relesed Production Order Item Component Quantity per %1 Not Match With Expected Result %2';\n+ RelesedProdOrderComponentExpQtyRoundingErr: Label 'Relesed Production Order Item Component Expected Quantity %1 Not Match With Expected Result %2';\n \n [Test]\n [HandlerFunctions('MakeSupplyOrdersPageHandler')]\n@@ -2988,6 +2990,73 @@ codeunit 137088 \"SCM Order Planning - III\"\n VerifyStartingTimeOnFirmPlannedProductionOrder(StartingTime, ChildItem.\"No.\", ProductionOrderNo);\n end;\n \n+ [Test]\n+ [HandlerFunctions('ModalPageHandler,ErrorMessageHandler')]\n+ procedure ReleasedProdOrderQuantityPerandExpectedQtyRoundingPrecisionChecking()\n+ var\n+ BaseItemUnitOfMeasure: Record \"Item Unit of Measure\";\n+ ComponentItem: Record Item;\n+ ProdOrderComp: Record \"Prod. Order Component\";\n+ ProdOrderLine: Record \"Prod. Order Line\";\n+ ProductionBOMHeader: Record \"Production BOM Header\";\n+ ProductionBOMLine: Record \"Production BOM Line\";\n+ ProductionOrder: Record \"Production Order\";\n+ ProductItem: Record Item;\n+ SalesHeader: Record \"Sales Header\";\n+ ExpectedQty: Decimal;\n+ RelesedProdOrderNo: Code[20];\n+ Status: Enum \"Production Order Status\";\n+ begin\n+ // [SCENARIO 562766] If a component's Item UOM has a 'Quantity Rounding Precision' of 1, & a Finished Good consumes partial quantity, \n+ // the Prod. Order created from the Planning of a Sales Order pulls in the Component with a 'Qty. Per' and 'Exp. Qty.' of 0.\n+ Initialize();\n+\n+ // [GIVEN] Created Component Item\n+ LibraryInventory.CreateItem(ComponentItem);\n+ ComponentItem.Validate(\"Replenishment System\", ComponentItem.\"Replenishment System\"::Purchase);\n+ ComponentItem.Validate(\"Rounding Precision\", LibraryRandom.RandPrecision());\n+ ComponentItem.Validate(\"Reordering Policy\", ComponentItem.\"Reordering Policy\"::\"Lot-for-Lot\");\n+ ComponentItem.Validate(\"Include Inventory\", true);\n+ ComponentItem.Modify(true);\n+\n+ // [GIVEN] Set Qty. Rounding Precision = 1 for Component Item\n+ BaseItemUnitOfMeasure.Get(ComponentItem.\"No.\", ComponentItem.\"Base Unit of Measure\");\n+ BaseItemUnitOfMeasure.Validate(\"Qty. Rounding Precision\", 1);\n+ BaseItemUnitOfMeasure.Modify();\n+\n+ // [GIVEN] Created Production Bom using Component Item\n+ LibraryManufacturing.CreateProductionBOMHeader(ProductionBOMHeader, ComponentItem.\"Base Unit of Measure\");\n+ LibraryManufacturing.CreateProductionBOMLine(ProductionBOMHeader, ProductionBOMLine, '', ProductionBOMLine.Type::Item, ComponentItem.\"No.\", LibraryRandom.RandDecInDecimalRange(0.01, 0.99, 2));\n+ ProductionBOMHeader.Validate(Status, ProductionBOMHeader.Status::Certified);\n+ ProductionBOMHeader.Modify();\n+\n+ // [GIVEN] Created Master Item and Production Bom Assigned to Master Item\n+ LibraryInventory.CreateItem(ProductItem);\n+ ProductItem.Validate(\"Replenishment System\", ProductItem.\"Replenishment System\"::\"Prod. Order\");\n+ ProductItem.Validate(\"Rounding Precision\", 1);\n+ ProductItem.Validate(\"Reordering Policy\", ProductItem.\"Reordering Policy\"::Order);\n+ ProductItem.Validate(\"Production BOM No.\", ProductionBOMHeader.\"No.\");\n+ ProductItem.Modify(true);\n+\n+ // [GIVEN] Created Sales Order Using Master Item Quantity - 1\n+ CreateSalesOrder(SalesHeader, ProductItem.\"No.\", '', 1, 1);\n+\n+ // [WHEN] Created Released Prod. Order From Sales Order Using Planning\n+ LibraryPlanning.CreateProdOrderUsingPlanning(ProductionOrder, Status::\"Firm Planned\", SalesHeader.\"No.\", ProductItem.\"No.\");\n+ RelesedProdOrderNo := LibraryManufacturing.ChangeStatusFirmPlanToReleased(ProductionOrder.\"No.\");\n+\n+ // [WHEN] Find Released Production Order Component\n+ FindProdOrderLine(ProdOrderLine, RelesedProdOrderNo);\n+ FindProdOrderComponent(ProdOrderComp, ProdOrderLine.\"Prod. Order No.\", ComponentItem.\"No.\");\n+\n+ // [WHEN] Getting Expected result using Component Rounding Precision\n+ ExpectedQty := Round(ProductionBOMLine.\"Quantity per\" * BaseItemUnitOfMeasure.\"Qty. Rounding Precision\" / BaseItemUnitOfMeasure.\"Qty. Rounding Precision\", ComponentItem.\"Rounding Precision\");\n+\n+ // [THEN] Expected Quantity must be Equal to Production Order Component \"Quantity per\" And \"Expected Quantity\"\n+ Assert.AreEqual(ExpectedQty, ProdOrderComp.\"Quantity per\", StrSubstNo(RelesedProdOrderComponentQtyPerRoundingErr, ProdOrderComp.\"Quantity per\", ExpectedQty));\n+ Assert.AreEqual(ExpectedQty, ProdOrderComp.\"Expected Quantity\", StrSubstNo(RelesedProdOrderComponentExpQtyRoundingErr, ProdOrderComp.\"Expected Quantity\", ExpectedQty));\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n@@ -3805,6 +3874,14 @@ codeunit 137088 \"SCM Order Planning - III\"\n Assert.IsTrue(ProductionOrder.\"Starting Time\" = StartingTime, '');\n end;\n \n+ local procedure FindProdOrderLine(var ProdOrderLine: Record \"Prod. Order Line\"; ProductionOrderNo: Code[20])\n+ begin\n+ ProdOrderLine.Reset();\n+ ProdOrderLine.SetRange(Status, ProdOrderLine.Status::Released);\n+ ProdOrderLine.SetRange(\"Prod. Order No.\", ProductionOrderNo);\n+ ProdOrderLine.FindFirst();\n+ end;\n+\n [ModalPageHandler]\n [Scope('OnPrem')]\n procedure MakeSupplyOrdersPageHandler(var MakeSupplyOrders: Page \"Make Supply Orders\"; var Response: Action)\n@@ -3911,5 +3988,16 @@ codeunit 137088 \"SCM Order Planning - III\"\n begin\n Reply := true;\n end;\n+\n+ [ModalPageHandler]\n+ procedure ModalPageHandler(var CreateOrderFromSales: Page \"Create Order From Sales\"; var Response: Action)\n+ begin\n+ Response := Action::Yes;\n+ end;\n+\n+ [MessageHandler]\n+ procedure ErrorMessageHandler(Message: Text[1024])\n+ begin\n+ end;\n }\n \n", "patch": "diff --git a/App/Layers/IT/BaseApp/Manufacturing/Document/CalculateProdOrder.Codeunit.al b/App/Layers/IT/BaseApp/Manufacturing/Document/CalculateProdOrder.Codeunit.al\nindex 5f7a2b890fe..5b63565d0f1 100644\n--- a/App/Layers/IT/BaseApp/Manufacturing/Document/CalculateProdOrder.Codeunit.al\n+++ b/App/Layers/IT/BaseApp/Manufacturing/Document/CalculateProdOrder.Codeunit.al\n@@ -43,6 +43,7 @@ codeunit 99000773 \"Calculate Prod. Order\"\n ProdOrderComp: Record \"Prod. Order Component\";\n ProdOrderRoutingLine2: Record \"Prod. Order Routing Line\";\n ProdBOMLine: array[99] of Record \"Production BOM Line\";\n+ ProdLineItem: Record Item;\n UOMMgt: Codeunit \"Unit of Measure Management\";\n MfgCostCalcMgt: Codeunit \"Mfg. Cost Calculation Mgt.\";\n VersionMgt: Codeunit VersionManagement;\n@@ -286,8 +287,8 @@ codeunit 99000773 \"Calculate Prod. Order\"\n \n local procedure TransferBOMProcessItem(Level: Integer; LineQtyPerUOM: Decimal; ItemQtyPerUOM: Decimal; var ErrorOccured: Boolean)\n var\n- Item2: Record Item;\n ComponentSKU: Record \"Stockkeeping Unit\";\n+ Item2: Record Item;\n IsHandled: Boolean;\n QtyRoundPrecision: Decimal;\n begin\n@@ -323,6 +324,7 @@ codeunit 99000773 \"Calculate Prod. Order\"\n ProdOrderComp.Validate(\"Unit of Measure Code\", ProdBOMLine[Level].\"Unit of Measure Code\");\n if (ProdOrderComp.\"Item No.\" <> '') and Item2.Get(ProdOrderComp.\"Item No.\") then\n QtyRoundPrecision := UOMMgt.GetQtyRoundingPrecision(Item2, ProdBOMLine[Level].\"Unit of Measure Code\");\n+ CheckingRoundingPrecision(Item2, ProdLineItem, QtyRoundPrecision, Level);\n if QtyRoundPrecision <> 0 then\n ProdOrderComp.\"Quantity per\" := Round(ProdBOMLine[Level].\"Quantity per\" * LineQtyPerUOM / ItemQtyPerUOM, QtyRoundPrecision)\n else\n@@ -1001,6 +1003,21 @@ codeunit 99000773 \"Calculate Prod. Order\"\n ProdOrderLineToCheck.TestField(Quantity);\n end;\n \n+ local procedure CheckingRoundingPrecision(ChildItem: Record Item; ProdLineItem: Record Item; var QtyRoundPrecision: Decimal; Level: Integer)\n+ begin\n+ if (ChildItem.\"Rounding Precision\" = 0) or (QtyRoundPrecision = 0) then\n+ exit;\n+\n+ if (not ProdLineItem.Get(ProdOrderLine.\"Item No.\")) or (ProdLineItem.\"Replenishment System\" <> ProdLineItem.\"Replenishment System\"::\"Prod. Order\") then\n+ exit;\n+\n+ if (ChildItem.\"Base Unit of Measure\" <> ProdBOMLine[Level].\"Unit of Measure Code\") then\n+ exit;\n+ QtyRoundPrecision := ChildItem.\"Rounding Precision\";\n+ ProdOrderComp.\"Qty. Rounding Precision\" := ChildItem.\"Rounding Precision\";\n+ ProdOrderComp.\"Qty. Rounding Precision (Base)\" := ChildItem.\"Rounding Precision\";\n+ end;\n+\n [IntegrationEvent(false, false)]\n local procedure OnAfterInsertProdRoutingLine(var ProdOrderRoutingLine: Record \"Prod. Order Routing Line\"; ProdOrderLine: Record \"Prod. Order Line\")\n begin\ndiff --git a/App/Layers/W1/BaseApp/Manufacturing/Document/CalculateProdOrder.Codeunit.al b/App/Layers/W1/BaseApp/Manufacturing/Document/CalculateProdOrder.Codeunit.al\nindex 36930a9e2aa..5d44df0a596 100644\n--- a/App/Layers/W1/BaseApp/Manufacturing/Document/CalculateProdOrder.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Manufacturing/Document/CalculateProdOrder.Codeunit.al\n@@ -43,6 +43,7 @@ codeunit 99000773 \"Calculate Prod. Order\"\n ProdOrderComp: Record \"Prod. Order Component\";\n ProdOrderRoutingLine2: Record \"Prod. Order Routing Line\";\n ProdBOMLine: array[99] of Record \"Production BOM Line\";\n+ ProdLineItem: Record Item;\n UOMMgt: Codeunit \"Unit of Measure Management\";\n MfgCostCalcMgt: Codeunit \"Mfg. Cost Calculation Mgt.\";\n VersionMgt: Codeunit VersionManagement;\n@@ -260,8 +261,8 @@ codeunit 99000773 \"Calculate Prod. Order\"\n \n local procedure TransferBOMProcessItem(Level: Integer; LineQtyPerUOM: Decimal; ItemQtyPerUOM: Decimal; var ErrorOccured: Boolean)\n var\n- Item2: Record Item;\n ComponentSKU: Record \"Stockkeeping Unit\";\n+ Item2: Record Item;\n IsHandled: Boolean;\n QtyRoundPrecision: Decimal;\n begin\n@@ -297,6 +298,7 @@ codeunit 99000773 \"Calculate Prod. Order\"\n ProdOrderComp.Validate(\"Unit of Measure Code\", ProdBOMLine[Level].\"Unit of Measure Code\");\n if (ProdOrderComp.\"Item No.\" <> '') and Item2.Get(ProdOrderComp.\"Item No.\") then\n QtyRoundPrecision := UOMMgt.GetQtyRoundingPrecision(Item2, ProdBOMLine[Level].\"Unit of Measure Code\");\n+ CheckingRoundingPrecision(Item2, ProdLineItem, QtyRoundPrecision, Level);\n if QtyRoundPrecision <> 0 then\n ProdOrderComp.\"Quantity per\" := Round(ProdBOMLine[Level].\"Quantity per\" * LineQtyPerUOM / ItemQtyPerUOM, QtyRoundPrecision)\n else\n@@ -975,6 +977,21 @@ codeunit 99000773 \"Calculate Prod. Order\"\n ProdOrderLineToCheck.TestField(Quantity);\n end;\n \n+ local procedure CheckingRoundingPrecision(ChildItem: Record Item; ProdLineItem: Record Item; var QtyRoundPrecision: Decimal; Level: Integer)\n+ begin\n+ if (ChildItem.\"Rounding Precision\" = 0) or (QtyRoundPrecision = 0) then\n+ exit;\n+\n+ if (not ProdLineItem.Get(ProdOrderLine.\"Item No.\")) or (ProdLineItem.\"Replenishment System\" <> ProdLineItem.\"Replenishment System\"::\"Prod. Order\") then\n+ exit;\n+\n+ if (ChildItem.\"Base Unit of Measure\" <> ProdBOMLine[Level].\"Unit of Measure Code\") then\n+ exit;\n+ QtyRoundPrecision := ChildItem.\"Rounding Precision\";\n+ ProdOrderComp.\"Qty. Rounding Precision\" := ChildItem.\"Rounding Precision\";\n+ ProdOrderComp.\"Qty. Rounding Precision (Base)\" := ChildItem.\"Rounding Precision\";\n+ end;\n+\n [IntegrationEvent(false, false)]\n local procedure OnAfterInsertProdRoutingLine(var ProdOrderRoutingLine: Record \"Prod. Order Routing Line\"; ProdOrderLine: Record \"Prod. Order Line\")\n begin\n"} {"repo": "microsoftInternal/NAV", "instance_id": "microsoftInternal__NAV-208851", "base_commit": "b626cb16a65cd529d91527d1d5dac501d6ecb06e", "created_at": "2025-03-04", "environment_setup_version": "26.0", "project_paths": ["App\\Layers\\W1\\BaseApp", "App\\Layers\\W1\\Tests\\ERM"], "hints_text": "", "FAIL_TO_PASS": [{"codeunitID": 134117, "functionName": ["AmountTypeFieldDoesNotChangeOnClosePageSalesPriceList"]}], "PASS_TO_PASS": [], "problem_statement": "Title: In the Sales Price Lists, the 'Defines' field always defaults to Price & Discount when dealing with Customer Price Group/Customer Disc Group setting\nRepro Steps:\nReproduced in CRONUS GB v25.4\nEnable 'New Sales Price Experience' in Feature Management.\n1. Go to Sales Price Lists\n2. Click on New to generate a New Sales Price List.\n3. Set Assign-to-type to Customer Disc. Group\n4. View Columns for: **Discount**\n5. Insert a single item line, using only Line Discount.\n6. Set the Sales Price List to Status 'Active'\n7. Go back to the Sales Price Lists Page.\n\nYou will notice \"Defines\" has changed back to Prices & Discounts Same behavior is replicable with Price for Customer Price Group\n**Expected Result:** Defines should remain as Discounts if only discounts are in the Sales Price list\n**Actual Results:** 'Defines' Always defaults to 'Prices & Discount'\n\nDescription:\nThe issue is with the setting for the \"Defines\" field. The setting may be changed from 'Price & Discount' to 'Discount' because only Line Discounts may be used in the new Price Group configuration. However, after closing the Page, the system will always default back to the 'Price & Discount', even though only Line Discounts are defined, because the code doesn't pass the value correctly.\n\nThe Partner Developer highlighted the following code:\nThe call stack:\n- GetAmountType (\\ext11_packandshipchanges\\Table\\7005\\Price Source.dal:342)\n- GetDefaultAmountType (\\ext11_packandshipchanges\\Table\\7005\\Price Source.dal:182)\n- UpdateAmountType (\\ext11_packandshipchanges\\Table\\7000\\Price List Header.dal:567)\n- OnClosePage (\\ext11_packandshipchanges\\Page\\7016\\Sales Price List.dal:600)\n\nIn the Function:`UpdateAmountType`, the following code is used:\n\"Amount Type\" := PriceSource.GetDefaultAmountType(); The code reflects it as empty. No value is passed to it, so it always defaults to 'Price & Discount'\n", "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/PriceListsUI.Codeunit.al b/App/Layers/W1/Tests/ERM/PriceListsUI.Codeunit.al\nindex 5f586214ecb..c18252ac131 100644\n--- a/App/Layers/W1/Tests/ERM/PriceListsUI.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/PriceListsUI.Codeunit.al\n@@ -4366,6 +4366,39 @@ codeunit 134117 \"Price Lists UI\"\n PurchasePriceList.Caption()));\n end;\n \n+ [Test]\n+ procedure AmountTypeFieldDoesNotChangeOnClosePageSalesPriceList()\n+ var\n+ PriceListHeader: Record \"Price List Header\";\n+ CustomerDiscountGroup: Record \"Customer Discount Group\";\n+ SalesPriceList: TestPage \"Sales Price List\";\n+ PriceListHeaderCode: Code[20];\n+ begin\n+ // [SCENARIO 566994] Bug fix to ensure the field \"Amount Type\" does not change after closing the page \"Sales Price List\" \n+ Initialize(true);\n+\n+ // [GIVEN] Sales Price List for discount\n+ PriceListHeaderCode := LibraryUtility.GenerateGUID();\n+ SalesPriceList.OpenEdit();\n+ SalesPriceList.New();\n+ SalesPriceList.Code.SetValue(PriceListHeaderCode);\n+ SalesPriceList.Description.SetValue(LibraryUtility.GenerateGUID());\n+ SalesPriceList.SourceType.SetValue(\"Price Source Type\"::\"Customer Disc. Group\");\n+ SalesPriceList.AmountType.SetValue(\"Price Amount Type\"::Discount);\n+ CustomerDiscountGroup.Init();\n+ CustomerDiscountGroup.Code := LibraryUtility.GenerateGUID();\n+ CustomerDiscountGroup.Insert();\n+ SalesPriceList.AssignToNo.SetValue(CustomerDiscountGroup.Code);\n+ SalesPriceList.Status.SetValue(\"Price Status\"::Active);\n+\n+ // [WHEN] Close the page \"Sales Price List\"\n+ SalesPriceList.Close();\n+\n+ // [THEN] Check the field \"Amount Type\" has not reverted to Price & Discount\n+ PriceListHeader.Get(PriceListHeaderCode);\n+ Assert.IsTrue((PriceListHeader.\"Amount Type\" = PriceListHeader.\"Amount Type\"::Discount), 'The field \"Amount Type\" has changed after closing the page \"Sales Price List\"');\n+ end;\n+\n local procedure Initialize(Enable: Boolean)\n var\n PriceListHeader: Record \"Price List Header\";\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Pricing/PriceList/PriceListHeader.Table.al b/App/Layers/W1/BaseApp/Pricing/PriceList/PriceListHeader.Table.al\nindex fb6adbb607d..9e6fd459241 100644\n--- a/App/Layers/W1/BaseApp/Pricing/PriceList/PriceListHeader.Table.al\n+++ b/App/Layers/W1/BaseApp/Pricing/PriceList/PriceListHeader.Table.al\n@@ -562,6 +562,7 @@ table 7000 \"Price List Header\"\n var\n xAmountType: Enum \"Price Amount Type\";\n begin\n+ CopyTo(PriceSource);\n xAmountType := \"Amount Type\";\n if \"Source Type\" in [\"Source Type\"::\"Customer Disc. Group\", \"Source Type\"::\"Customer Price Group\"] then\n \"Amount Type\" := PriceSource.GetDefaultAmountType()\n"} {"repo": "microsoftInternal/NAV", "instance_id": "microsoftInternal__NAV-208320", "base_commit": "d080f087349d4713e1782f2f2630819714cb6738", "created_at": "2025-02-27", "environment_setup_version": "26.0", "project_paths": ["App\\Layers\\W1\\BaseApp", "App\\Layers\\W1\\Tests\\ERM"], "hints_text": "", "FAIL_TO_PASS": [{"codeunitID": 134386, "functionName": ["UpdateEmailAndPhoneNoWhenChangeBillToOfSalesInvoice"]}], "PASS_TO_PASS": [], "problem_statement": "Title: The Email and Phone No. don't update when selecting Another Customer in the \"Bill-to\" field of a Sales Invoice\nRepro Steps:\n1. Go to Contacts and find CT000012 - \"Miss Patricia Doyle\" with 'Company Name' = (John Haddock Insurance Co.)\n2. Edit the contact and add any 'Phone Number' and 'Mobile Phone No.'\n3. Go to Sales Invoices and Create a new sales invoice and for Customer 10000.\n3. Go down to the Shipping and Billing tab and set 'Bill-to' = \"Another Customer\"\n Now see how more fields are introduced, including the Contact and Contact info with Phone numbers and email, should be for \"Mr. Andy Teal\" who is contact for Customer 10000.\n5. Then set Name = 30000 (John Haddock Insurance Co.) and say yes to change bill-to customer.\nNotice we have Contact = \"Miss Patricia Doyle\"....\n\n**EXPECTED RESULTS:** The Phone Number(s) and Email for \"Miss Patricia Doyle\" should pull in.\n**ACTUAL RESULTS:** The fields are the same as they were for the previous contact \"Mr. Andy Teal\" and you need to refresh the Page so it pulls in the new Phone numbers and email for \"Mr. Andy Teal\" Contact.\nDescription:\nCopied and Derived from Support Case Review", "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/ERMSalesDocumentsII.Codeunit.al b/App/Layers/W1/Tests/ERM/ERMSalesDocumentsII.Codeunit.al\nindex bc3ad2bbe5c..30e993b56af 100644\n--- a/App/Layers/W1/Tests/ERM/ERMSalesDocumentsII.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ERMSalesDocumentsII.Codeunit.al\n@@ -4462,6 +4462,51 @@ codeunit 134386 \"ERM Sales Documents II\"\n SalesOrder.SalesLines.\"Invoice Discount Amount\".AssertEquals(SalesHeader.\"Invoice Discount Value\");\n end;\n \n+ [HandlerFunctions('CustomerLookupHandler,ConfirmHandlerYes')]\n+ [Test]\n+ procedure UpdateEmailAndPhoneNoWhenChangeBillToOfSalesInvoice()\n+ var\n+ Contact: array[2] of Record Contact;\n+ Customer: array[2] of Record Customer;\n+ SalesHeader: Record \"Sales Header\";\n+ SalesInvoice: TestPage \"Sales Invoice\";\n+ begin\n+ // [SCENARIO 564632] The Email and Phone No. should update when selecting Another Customer in the \"Bill-to\" field of a Sales Invoice\n+ Initialize();\n+\n+ // [GIVEN] Create First Customer with First Contact with Phone = \"111111111\", Mobile Phone = \"222222222\" and Email = \"contact1@mail.com\"\n+ LibraryMarketing.CreateContactWithCustomer(Contact[1], Customer[1]);\n+ UpdateContactInfo(Contact[1], '111111111', '222222222', 'contact1@mail.com');\n+ Contact[1].Modify(true);\n+\n+ // [GIVEN] Create Second Customer with Second Contact with Phone = \"333333333\", Mobile Phone = \"444444444\" and Email = \"contact2@mail.com\"\n+ LibraryMarketing.CreateContactWithCustomer(Contact[2], Customer[2]);\n+ UpdateContactInfo(Contact[2], '333333333', '444444444', 'contact2@mail.com');\n+ Contact[2].Modify(true);\n+\n+ // [GIVEN] Create Sales Invoice with First Customer\n+ LibrarySales.CreateSalesHeader(SalesHeader, SalesHeader.\"Document Type\"::Invoice, Customer[1].\"No.\");\n+\n+ // [GIVEN] Sales Invoice Card is opened\n+ LibraryVariableStorage.Enqueue(Customer[2].\"No.\");\n+ LibraryVariableStorage.Enqueue('');\n+ LibraryVariableStorage.Enqueue(true); // yes to change \"Bill-to Customer No.\"\n+ SalesInvoice.OpenEdit();\n+ SalesInvoice.FILTER.SetFilter(\"No.\", SalesHeader.\"No.\");\n+\n+ // [WHEN] Select Second Customer when lookup \"Bill-to Customer Name\"\n+ SalesInvoice.\"Bill-to Name\".Lookup();\n+\n+ // [THEN] Verify Sales Invoice \"Phone No.\" = \"333333333\"\n+ SalesInvoice.BillToContactPhoneNo.AssertEquals(Contact[2].\"Phone No.\");\n+\n+ // [THEN] Verify Sales Invoice \"Mobile Phone No.\" = \"444444444\"\n+ SalesInvoice.BillToContactMobilePhoneNo.AssertEquals(Contact[2].\"Mobile Phone No.\");\n+\n+ // [THEN] Verify Sales Invoice \"Email\" = \"contact2@mail.com\"\n+ SalesInvoice.BillToContactEmail.AssertEquals(Contact[2].\"E-Mail\");\n+ end;\n+\n [Test]\n [Scope('OnPrem')]\n procedure UpdateExtendedTextTypeNotAllowed()\n@@ -6595,5 +6640,14 @@ codeunit 134386 \"ERM Sales Documents II\"\n CustomerLookup.Filter.SetFilter(Name, LibraryVariableStorage.DequeueText());\n CustomerLookup.OK().Invoke();\n end;\n+\n+ [ModalPageHandler]\n+ procedure CustomerLookupHandler(var CustomerLookup: TestPage \"Customer Lookup\")\n+ begin\n+ CustomerLookup.GotoKey(LibraryVariableStorage.DequeueText());\n+ Assert.AreEqual(LibraryVariableStorage.DequeueText(),\n+ CustomerLookup.Filter.GetFilter(\"Date Filter\"), 'Wrong Date Filter.');\n+ CustomerLookup.OK().Invoke();\n+ end;\n }\n \n", "patch": "diff --git a/App/Layers/W1/BaseApp/Sales/Document/BlanketSalesOrder.Page.al b/App/Layers/W1/BaseApp/Sales/Document/BlanketSalesOrder.Page.al\nindex 1dee700e044..a3b2013773f 100644\n--- a/App/Layers/W1/BaseApp/Sales/Document/BlanketSalesOrder.Page.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/BlanketSalesOrder.Page.al\n@@ -648,6 +648,23 @@ page 507 \"Blanket Sales Order\"\n Rec.SetRange(\"Bill-to Customer No.\");\n CurrPage.Update();\n end;\n+\n+ trigger OnLookup(var Text: Text): Boolean\n+ var\n+ Customer: Record Customer;\n+ begin\n+ if Customer.SelectCustomer(Customer) then begin\n+ xRec := Rec;\n+ Rec.\"Bill-to Name\" := Customer.Name;\n+ Rec.Validate(\"Bill-to Customer No.\", Customer.\"No.\");\n+ end;\n+\n+ if Rec.GetFilter(\"Bill-to Customer No.\") = xRec.\"Bill-to Customer No.\" then\n+ if Rec.\"Bill-to Customer No.\" <> xRec.\"Bill-to Customer No.\" then\n+ Rec.SetRange(\"Bill-to Customer No.\");\n+\n+ CurrPage.Update();\n+ end;\n }\n field(\"Bill-to Address\"; Rec.\"Bill-to Address\")\n {\ndiff --git a/App/Layers/W1/BaseApp/Sales/Document/SalesCreditMemo.Page.al b/App/Layers/W1/BaseApp/Sales/Document/SalesCreditMemo.Page.al\nindex 84ba27e1b17..3f876b15fd0 100644\n--- a/App/Layers/W1/BaseApp/Sales/Document/SalesCreditMemo.Page.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/SalesCreditMemo.Page.al\n@@ -552,6 +552,23 @@ page 44 \"Sales Credit Memo\"\n \n CurrPage.Update();\n end;\n+\n+ trigger OnLookup(var Text: Text): Boolean\n+ var\n+ Customer: Record Customer;\n+ begin\n+ if Customer.SelectCustomer(Customer) then begin\n+ xRec := Rec;\n+ Rec.\"Bill-to Name\" := Customer.Name;\n+ Rec.Validate(\"Bill-to Customer No.\", Customer.\"No.\");\n+ end;\n+\n+ if Rec.GetFilter(\"Bill-to Customer No.\") = xRec.\"Bill-to Customer No.\" then\n+ if Rec.\"Bill-to Customer No.\" <> xRec.\"Bill-to Customer No.\" then\n+ Rec.SetRange(\"Bill-to Customer No.\");\n+\n+ CurrPage.Update();\n+ end;\n }\n field(\"Bill-to Address\"; Rec.\"Bill-to Address\")\n {\ndiff --git a/App/Layers/W1/BaseApp/Sales/Document/SalesInvoice.Page.al b/App/Layers/W1/BaseApp/Sales/Document/SalesInvoice.Page.al\nindex ee0d93e0f64..930047f5653 100644\n--- a/App/Layers/W1/BaseApp/Sales/Document/SalesInvoice.Page.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/SalesInvoice.Page.al\n@@ -803,6 +803,25 @@ page 43 \"Sales Invoice\"\n CurrPage.Update();\n end;\n end;\n+\n+ trigger OnLookup(var Text: Text): Boolean\n+ var\n+ Customer: Record Customer;\n+ begin\n+ if Customer.SelectCustomer(Customer) then begin\n+ xRec := Rec;\n+ Rec.\"Bill-to Name\" := Customer.Name;\n+ Rec.Validate(\"Bill-to Customer No.\", Customer.\"No.\");\n+ end;\n+\n+ if not ((BillToOptions = BillToOptions::\"Custom Address\") and not ShouldSearchForCustByName) then begin\n+ if Rec.GetFilter(\"Bill-to Customer No.\") = xRec.\"Bill-to Customer No.\" then\n+ if Rec.\"Bill-to Customer No.\" <> xRec.\"Bill-to Customer No.\" then\n+ Rec.SetRange(\"Bill-to Customer No.\");\n+\n+ CurrPage.Update();\n+ end;\n+ end;\n }\n field(\"Bill-to Address\"; Rec.\"Bill-to Address\")\n {\ndiff --git a/App/Layers/W1/BaseApp/Sales/Document/SalesOrder.Page.al b/App/Layers/W1/BaseApp/Sales/Document/SalesOrder.Page.al\nindex 77cf2b1863e..2a751833971 100644\n--- a/App/Layers/W1/BaseApp/Sales/Document/SalesOrder.Page.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/SalesOrder.Page.al\n@@ -812,6 +812,25 @@ page 42 \"Sales Order\"\n CurrPage.Update();\n end;\n end;\n+\n+ trigger OnLookup(var Text: Text): Boolean\n+ var\n+ Customer: Record Customer;\n+ begin\n+ if Customer.SelectCustomer(Customer) then begin\n+ xRec := Rec;\n+ Rec.\"Bill-to Name\" := Customer.Name;\n+ Rec.Validate(\"Bill-to Customer No.\", Customer.\"No.\");\n+ end;\n+\n+ if not ((BillToOptions = BillToOptions::\"Custom Address\") and not ShouldSearchForCustByName) then begin\n+ if Rec.GetFilter(\"Bill-to Customer No.\") = xRec.\"Bill-to Customer No.\" then\n+ if Rec.\"Bill-to Customer No.\" <> xRec.\"Bill-to Customer No.\" then\n+ Rec.SetRange(\"Bill-to Customer No.\");\n+\n+ CurrPage.Update();\n+ end;\n+ end;\n }\n field(\"Bill-to Address\"; Rec.\"Bill-to Address\")\n {\ndiff --git a/App/Layers/W1/BaseApp/Sales/Document/SalesQuote.Page.al b/App/Layers/W1/BaseApp/Sales/Document/SalesQuote.Page.al\nindex 7827a9ece78..5851f14e04b 100644\n--- a/App/Layers/W1/BaseApp/Sales/Document/SalesQuote.Page.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/SalesQuote.Page.al\n@@ -763,6 +763,23 @@ page 41 \"Sales Quote\"\n \n CurrPage.Update();\n end;\n+\n+ trigger OnLookup(var Text: Text): Boolean\n+ var\n+ Customer: Record Customer;\n+ begin\n+ if Customer.SelectCustomer(Customer) then begin\n+ xRec := Rec;\n+ Rec.\"Bill-to Name\" := Customer.Name;\n+ Rec.Validate(\"Bill-to Customer No.\", Customer.\"No.\");\n+ end;\n+\n+ if Rec.GetFilter(\"Bill-to Customer No.\") = xRec.\"Bill-to Customer No.\" then\n+ if Rec.\"Bill-to Customer No.\" <> xRec.\"Bill-to Customer No.\" then\n+ Rec.SetRange(\"Bill-to Customer No.\");\n+\n+ CurrPage.Update();\n+ end;\n }\n field(\"Bill-to Address\"; Rec.\"Bill-to Address\")\n {\ndiff --git a/App/Layers/W1/BaseApp/Sales/Document/SalesReturnOrder.Page.al b/App/Layers/W1/BaseApp/Sales/Document/SalesReturnOrder.Page.al\nindex e9c58725477..a0e9bb787e7 100644\n--- a/App/Layers/W1/BaseApp/Sales/Document/SalesReturnOrder.Page.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/SalesReturnOrder.Page.al\n@@ -613,6 +613,23 @@ page 6630 \"Sales Return Order\"\n \n CurrPage.Update();\n end;\n+\n+ trigger OnLookup(var Text: Text): Boolean\n+ var\n+ Customer: Record Customer;\n+ begin\n+ if Customer.SelectCustomer(Customer) then begin\n+ xRec := Rec;\n+ Rec.\"Bill-to Name\" := Customer.Name;\n+ Rec.Validate(\"Bill-to Customer No.\", Customer.\"No.\");\n+ end;\n+\n+ if Rec.GetFilter(\"Bill-to Customer No.\") = xRec.\"Bill-to Customer No.\" then\n+ if Rec.\"Bill-to Customer No.\" <> xRec.\"Bill-to Customer No.\" then\n+ Rec.SetRange(\"Bill-to Customer No.\");\n+\n+ CurrPage.Update();\n+ end;\n }\n field(\"Bill-to Address\"; Rec.\"Bill-to Address\")\n {\n"} -{"repo": "microsoftInternal/NAV", "instance_id": "microsoftInternal__NAV-199883", "base_commit": "aaf1c6d95a374d426984ab59eacb82f1047659b5", "created_at": "2024-11-12", "environment_setup_version": "24.5", "project_paths": ["App\\Layers\\W1\\BaseApp", "App\\Layers\\W1\\Tests\\SCM"], "hints_text": "", "FAIL_TO_PASS": [{"codeunitID": 137033, "functionName": ["BinContentMovementBlockedThrowsErrorWhenPostingItemJournal"]}], "PASS_TO_PASS": [], "problem_statement": "Title: [master] [ALL-E] Bin Content Block Movement is not considered when posting an item journal.\nRepro Steps:\nOpen Cronus 24.2. Go to locations. Go to the warehouse employees and add location SILVER to your user Go to the item journal.Create an entry as follows:Item No \"1896-S\"Location: SILVERBin code: S-01-0001Quantity: 40post Go to Bin ContentsSelect your entry -> Block Movement: All. Go to the item journal Create an entry as follows:Item No \"1896-S\"Location: SILVERBin code: S-01-0001Quantity: 40post The Entry is posted successfully. Expected Results: The entry shouldn't be posted for the same Item No. Block Movement Specifies how the movement of a particular item, or bin content, into or out of this bin, is blocked. Actual Results: The entry is still posted even if the Bin content has a block movement on All. Investigation: Tested on 24.2 , 23.07 and 22.13 OnPrem and the same behavior happens. It seems to be that all settings are ignored for Block Movement I tried also with Inbound and Outbound and according postings and everything can be posted.\nDescription:\nBin Content Block Movement Doesn't work as expected\n", "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\nindex 4d85519ac9a..a2506b2d267 100644\n--- a/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\n@@ -34,6 +34,8 @@\n OneEntryExpectedErr: Label 'Only one Item Ledger Entry is expected.';\n MultipleEntriesExpectedErr: Label 'Two Item Ledger Entries expected.';\n RoundingTo0Err: Label 'Rounding of the field';\n+ BlockedBinContentErr: Label 'Block Movement must not be All in Bin Content Location Code=''%1'',Bin Code=''%2'',Item No.=''%3'',Variant Code=''%4'',Unit of Measure Code=''%5''.',\n+ Comment = '%1= Location Code, %2= Bin Code, %3= Item No., %4= Varient Code, %5= Unit of Measure Code';\n \n [Test]\n [Scope('OnPrem')]\n@@ -2091,6 +2093,86 @@\n Assert.RecordIsEmpty(RecordLink);\n end;\n \n+ [Test]\n+ procedure BinContentMovementBlockedThrowsErrorWhenPostingItemJournal()\n+ var\n+ Bin: Record Bin;\n+ BinContent: Record \"Bin Content\";\n+ Item: Record Item;\n+ ItemJournalTemplate: Record \"Item Journal Template\";\n+ ItemJournalBatch: Record \"Item Journal Batch\";\n+ ItemJournalLine: Record \"Item Journal Line\";\n+ Location: Record Location;\n+ begin\n+ // [SCENARIO 538864] Bin Content Block Movement is considered when posting an Item Journal.\n+ Initialize();\n+\n+ // [GIVEN] Create an Item.\n+ LibraryInventory.CreateItem(Item);\n+\n+ // [GIVEN] Create a Location with require Bin and a Default Bin Code.\n+ LibraryWarehouse.CreateLocationWMS(Location, true, false, false, false, false);\n+\n+ // [GIVEN] Create a Bin.\n+ LibraryWarehouse.CreateBin(Bin, Location.Code, '', '', '');\n+\n+ // [GIVEN] Validate Default Bin Code in Location.\n+ Location.Validate(\"Default Bin Code\", Bin.Code);\n+ Location.Modify(true);\n+\n+ // [GIVEN] Select an Item Journal Template of Type Item.\n+ LibraryInventory.SelectItemJournalTemplateName(ItemJournalTemplate, ItemJournalTemplate.Type::Item);\n+\n+ // [GIVEN] Select an Item Journal Batch.\n+ LibraryInventory.SelectItemJournalBatchName(ItemJournalBatch, ItemJournalTemplate.Type::Item, ItemJournalTemplate.Name);\n+\n+ // [GIVEN] Create an Item Journal Line\n+ LibraryInventory.ClearItemJournal(ItemJournalTemplate, ItemJournalBatch);\n+ LibraryInventory.CreateItemJournalLine(\n+ ItemJournalLine,\n+ ItemJournalBatch.\"Journal Template Name\",\n+ ItemJournalBatch.Name,\n+ ItemJournalLine.\"Entry Type\"::Purchase,\n+ Item.\"No.\",\n+ LibraryRandom.RandInt(10));\n+\n+ // [GIVEN] Validate Location Code and Bin Code in Item Journal Line.\n+ ItemJournalLine.Validate(\"Location Code\", Location.Code);\n+ ItemJournalLine.Validate(\"Bin Code\", Bin.Code);\n+ ItemJournalLine.Modify(true);\n+\n+ // [GIVEN] Post an Item Journal.\n+ LibraryInventory.PostItemJournalLine(ItemJournalLine.\"Journal Template Name\", ItemJournalLine.\"Journal Batch Name\");\n+\n+ // [GIVEN] Find Bin Content and Validate Block Movement to All.\n+ BinContent.SetRange(\"Bin Code\", Bin.Code);\n+ BinContent.SetRange(\"Item No.\", Item.\"No.\");\n+ BinContent.SetRange(\"Location Code\", Location.Code);\n+ BinContent.FindFirst();\n+ BinContent.Validate(\"Block Movement\", BinContent.\"Block Movement\"::All);\n+ BinContent.Modify(true);\n+\n+ // [GIVEN] Clear an Item Journal\n+ LibraryInventory.ClearItemJournal(ItemJournalTemplate, ItemJournalBatch);\n+\n+ // [GIVEN] Create an Item Journal and Validate Location Code.\n+ LibraryInventory.CreateItemJournalLine(\n+ ItemJournalLine,\n+ ItemJournalBatch.\"Journal Template Name\",\n+ ItemJournalBatch.Name,\n+ ItemJournalLine.\"Entry Type\"::Purchase,\n+ Item.\"No.\",\n+ LibraryRandom.RandInt(10));\n+ ItemJournalLine.Validate(\"Location Code\", Location.Code);\n+ ItemJournalLine.Modify(true);\n+\n+ // [WHEN] Post an Item Journal.\n+ asserterror LibraryInventory.PostItemJournalLine(ItemJournalLine.\"Journal Template Name\", ItemJournalLine.\"Journal Batch Name\");\n+\n+ // [THEN] Error of Bin Content Movement blocked is raised.\n+ Assert.ExpectedError(StrSubstNo(BlockedBinContentErr, ItemJournalLine.\"Location Code\", ItemJournalLine.\"Bin Code\", ItemJournalLine.\"Item No.\", ItemJournalLine.\"Variant Code\", ItemJournalLine.\"Unit of Measure Code\"));\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Warehouse/Journal/WMSManagement.Codeunit.al b/App/Layers/W1/BaseApp/Warehouse/Journal/WMSManagement.Codeunit.al\nindex d165f3a21a7..08c0e53701b 100644\n--- a/App/Layers/W1/BaseApp/Warehouse/Journal/WMSManagement.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Warehouse/Journal/WMSManagement.Codeunit.al\n@@ -193,8 +193,10 @@ codeunit 7302 \"WMS Management\"\n GetBin(WarehouseJournalLine.\"Location Code\", WarehouseJournalLine.\"To Bin Code\");\n Bin.CheckIncreaseBin(Bin.Code, WarehouseJournalLine.\"Item No.\", WarehouseJournalLine.\"Qty. (Absolute)\", WarehouseJournalLine.Cubage, WarehouseJournalLine.Weight, WarehouseJournalLine.Cubage, WarehouseJournalLine.Weight, true, false);\n end;\n- end else\n+ end else begin\n CheckWarehouseClass(WarehouseJournalLine.\"Location Code\", WarehouseJournalLine.\"To Bin Code\", WarehouseJournalLine.\"Item No.\", WarehouseJournalLine.\"Variant Code\", WarehouseJournalLine.\"Unit of Measure Code\");\n+ CheckBinAndBinContentMovement(WarehouseJournalLine);\n+ end;\n SourceJnl::OutputJnl, SourceJnl::ConsumpJnl:\n if WarehouseJournalLine.\"To Bin Code\" <> '' then\n if Location.\"Bin Capacity Policy\" <> Location.\"Bin Capacity Policy\"::\"Never Check Capacity\" then\n@@ -1803,7 +1805,7 @@ codeunit 7302 \"WMS Management\"\n OnBeforeCheckBlockedBin(LocationCode, BinCode, ItemNo, VariantCode, UnitOfMeasureCode, CheckInbound, IsHandled);\n if not IsHandled then begin\n GetLocation(LocationCode);\n- if Location.\"Directed Put-away and Pick\" then\n+ if (Location.\"Directed Put-away and Pick\") or ((BinCode <> '') and (Location.\"Bin Capacity Policy\" = Location.\"Bin Capacity Policy\"::\"Never Check Capacity\")) then\n if BinContent.Get(LocationCode, BinCode, ItemNo, VariantCode, UnitOfMeasureCode) then begin\n if (CheckInbound and\n (BinContent.\"Block Movement\" in [BinContent.\"Block Movement\"::Inbound, BinContent.\"Block Movement\"::All])) or\n@@ -1848,6 +1850,19 @@ codeunit 7302 \"WMS Management\"\n exit(Bin2.\"Bin Type Code\");\n end;\n \n+ local procedure CheckBinAndBinContentMovement(WarehouseJournalLine: Record \"Warehouse Journal Line\")\n+ begin\n+ if WarehouseJournalLine.Quantity = 0 then\n+ exit;\n+\n+ case WarehouseJournalLine.\"Entry Type\" of\n+ WarehouseJournalLine.\"Entry Type\"::\"Positive Adjmt.\":\n+ CheckBlockedBin(WarehouseJournalLine.\"Location Code\", WarehouseJournalLine.\"To Bin Code\", WarehouseJournalLine.\"Item No.\", WarehouseJournalLine.\"Variant Code\", WarehouseJournalLine.\"Unit of Measure Code\", WarehouseJournalLine.Quantity > 0);\n+ WarehouseJournalLine.\"Entry Type\"::\"Negative Adjmt.\":\n+ CheckBlockedBin(WarehouseJournalLine.\"Location Code\", WarehouseJournalLine.\"To Bin Code\", WarehouseJournalLine.\"Item No.\", WarehouseJournalLine.\"Variant Code\", WarehouseJournalLine.\"Unit of Measure Code\", WarehouseJournalLine.Quantity < 0);\n+ end;\n+ end;\n+\n [IntegrationEvent(false, false)]\n local procedure OnAfterCheckBlockedBin(LocationCode: Code[10]; BinCode: Code[20]; ItemNo: Code[20]; VariantCode: Code[10]; UnitOfMeasureCode: Code[10]; CheckInbound: Boolean)\n begin\n"} +{"repo": "microsoftInternal/NAV", "instance_id": "microsoftInternal__NAV-199883", "base_commit": "aaf1c6d95a374d426984ab59eacb82f1047659b5", "created_at": "2024-11-12", "environment_setup_version": "24.0", "project_paths": ["App\\Layers\\W1\\BaseApp", "App\\Layers\\W1\\Tests\\SCM"], "hints_text": "", "FAIL_TO_PASS": [{"codeunitID": 137033, "functionName": ["BinContentMovementBlockedThrowsErrorWhenPostingItemJournal"]}], "PASS_TO_PASS": [], "problem_statement": "Title: [master] [ALL-E] Bin Content Block Movement is not considered when posting an item journal.\nRepro Steps:\nOpen Cronus 24.2. Go to locations. Go to the warehouse employees and add location SILVER to your user Go to the item journal.Create an entry as follows:Item No \"1896-S\"Location: SILVERBin code: S-01-0001Quantity: 40post Go to Bin ContentsSelect your entry -> Block Movement: All. Go to the item journal Create an entry as follows:Item No \"1896-S\"Location: SILVERBin code: S-01-0001Quantity: 40post The Entry is posted successfully. Expected Results: The entry shouldn't be posted for the same Item No. Block Movement Specifies how the movement of a particular item, or bin content, into or out of this bin, is blocked. Actual Results: The entry is still posted even if the Bin content has a block movement on All. Investigation: Tested on 24.2 , 23.07 and 22.13 OnPrem and the same behavior happens. It seems to be that all settings are ignored for Block Movement I tried also with Inbound and Outbound and according postings and everything can be posted.\nDescription:\nBin Content Block Movement Doesn't work as expected\n", "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\nindex 4d85519ac9a..a2506b2d267 100644\n--- a/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\n@@ -34,6 +34,8 @@\n OneEntryExpectedErr: Label 'Only one Item Ledger Entry is expected.';\n MultipleEntriesExpectedErr: Label 'Two Item Ledger Entries expected.';\n RoundingTo0Err: Label 'Rounding of the field';\n+ BlockedBinContentErr: Label 'Block Movement must not be All in Bin Content Location Code=''%1'',Bin Code=''%2'',Item No.=''%3'',Variant Code=''%4'',Unit of Measure Code=''%5''.',\n+ Comment = '%1= Location Code, %2= Bin Code, %3= Item No., %4= Varient Code, %5= Unit of Measure Code';\n \n [Test]\n [Scope('OnPrem')]\n@@ -2091,6 +2093,86 @@\n Assert.RecordIsEmpty(RecordLink);\n end;\n \n+ [Test]\n+ procedure BinContentMovementBlockedThrowsErrorWhenPostingItemJournal()\n+ var\n+ Bin: Record Bin;\n+ BinContent: Record \"Bin Content\";\n+ Item: Record Item;\n+ ItemJournalTemplate: Record \"Item Journal Template\";\n+ ItemJournalBatch: Record \"Item Journal Batch\";\n+ ItemJournalLine: Record \"Item Journal Line\";\n+ Location: Record Location;\n+ begin\n+ // [SCENARIO 538864] Bin Content Block Movement is considered when posting an Item Journal.\n+ Initialize();\n+\n+ // [GIVEN] Create an Item.\n+ LibraryInventory.CreateItem(Item);\n+\n+ // [GIVEN] Create a Location with require Bin and a Default Bin Code.\n+ LibraryWarehouse.CreateLocationWMS(Location, true, false, false, false, false);\n+\n+ // [GIVEN] Create a Bin.\n+ LibraryWarehouse.CreateBin(Bin, Location.Code, '', '', '');\n+\n+ // [GIVEN] Validate Default Bin Code in Location.\n+ Location.Validate(\"Default Bin Code\", Bin.Code);\n+ Location.Modify(true);\n+\n+ // [GIVEN] Select an Item Journal Template of Type Item.\n+ LibraryInventory.SelectItemJournalTemplateName(ItemJournalTemplate, ItemJournalTemplate.Type::Item);\n+\n+ // [GIVEN] Select an Item Journal Batch.\n+ LibraryInventory.SelectItemJournalBatchName(ItemJournalBatch, ItemJournalTemplate.Type::Item, ItemJournalTemplate.Name);\n+\n+ // [GIVEN] Create an Item Journal Line\n+ LibraryInventory.ClearItemJournal(ItemJournalTemplate, ItemJournalBatch);\n+ LibraryInventory.CreateItemJournalLine(\n+ ItemJournalLine,\n+ ItemJournalBatch.\"Journal Template Name\",\n+ ItemJournalBatch.Name,\n+ ItemJournalLine.\"Entry Type\"::Purchase,\n+ Item.\"No.\",\n+ LibraryRandom.RandInt(10));\n+\n+ // [GIVEN] Validate Location Code and Bin Code in Item Journal Line.\n+ ItemJournalLine.Validate(\"Location Code\", Location.Code);\n+ ItemJournalLine.Validate(\"Bin Code\", Bin.Code);\n+ ItemJournalLine.Modify(true);\n+\n+ // [GIVEN] Post an Item Journal.\n+ LibraryInventory.PostItemJournalLine(ItemJournalLine.\"Journal Template Name\", ItemJournalLine.\"Journal Batch Name\");\n+\n+ // [GIVEN] Find Bin Content and Validate Block Movement to All.\n+ BinContent.SetRange(\"Bin Code\", Bin.Code);\n+ BinContent.SetRange(\"Item No.\", Item.\"No.\");\n+ BinContent.SetRange(\"Location Code\", Location.Code);\n+ BinContent.FindFirst();\n+ BinContent.Validate(\"Block Movement\", BinContent.\"Block Movement\"::All);\n+ BinContent.Modify(true);\n+\n+ // [GIVEN] Clear an Item Journal\n+ LibraryInventory.ClearItemJournal(ItemJournalTemplate, ItemJournalBatch);\n+\n+ // [GIVEN] Create an Item Journal and Validate Location Code.\n+ LibraryInventory.CreateItemJournalLine(\n+ ItemJournalLine,\n+ ItemJournalBatch.\"Journal Template Name\",\n+ ItemJournalBatch.Name,\n+ ItemJournalLine.\"Entry Type\"::Purchase,\n+ Item.\"No.\",\n+ LibraryRandom.RandInt(10));\n+ ItemJournalLine.Validate(\"Location Code\", Location.Code);\n+ ItemJournalLine.Modify(true);\n+\n+ // [WHEN] Post an Item Journal.\n+ asserterror LibraryInventory.PostItemJournalLine(ItemJournalLine.\"Journal Template Name\", ItemJournalLine.\"Journal Batch Name\");\n+\n+ // [THEN] Error of Bin Content Movement blocked is raised.\n+ Assert.ExpectedError(StrSubstNo(BlockedBinContentErr, ItemJournalLine.\"Location Code\", ItemJournalLine.\"Bin Code\", ItemJournalLine.\"Item No.\", ItemJournalLine.\"Variant Code\", ItemJournalLine.\"Unit of Measure Code\"));\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Warehouse/Journal/WMSManagement.Codeunit.al b/App/Layers/W1/BaseApp/Warehouse/Journal/WMSManagement.Codeunit.al\nindex d165f3a21a7..08c0e53701b 100644\n--- a/App/Layers/W1/BaseApp/Warehouse/Journal/WMSManagement.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Warehouse/Journal/WMSManagement.Codeunit.al\n@@ -193,8 +193,10 @@ codeunit 7302 \"WMS Management\"\n GetBin(WarehouseJournalLine.\"Location Code\", WarehouseJournalLine.\"To Bin Code\");\n Bin.CheckIncreaseBin(Bin.Code, WarehouseJournalLine.\"Item No.\", WarehouseJournalLine.\"Qty. (Absolute)\", WarehouseJournalLine.Cubage, WarehouseJournalLine.Weight, WarehouseJournalLine.Cubage, WarehouseJournalLine.Weight, true, false);\n end;\n- end else\n+ end else begin\n CheckWarehouseClass(WarehouseJournalLine.\"Location Code\", WarehouseJournalLine.\"To Bin Code\", WarehouseJournalLine.\"Item No.\", WarehouseJournalLine.\"Variant Code\", WarehouseJournalLine.\"Unit of Measure Code\");\n+ CheckBinAndBinContentMovement(WarehouseJournalLine);\n+ end;\n SourceJnl::OutputJnl, SourceJnl::ConsumpJnl:\n if WarehouseJournalLine.\"To Bin Code\" <> '' then\n if Location.\"Bin Capacity Policy\" <> Location.\"Bin Capacity Policy\"::\"Never Check Capacity\" then\n@@ -1803,7 +1805,7 @@ codeunit 7302 \"WMS Management\"\n OnBeforeCheckBlockedBin(LocationCode, BinCode, ItemNo, VariantCode, UnitOfMeasureCode, CheckInbound, IsHandled);\n if not IsHandled then begin\n GetLocation(LocationCode);\n- if Location.\"Directed Put-away and Pick\" then\n+ if (Location.\"Directed Put-away and Pick\") or ((BinCode <> '') and (Location.\"Bin Capacity Policy\" = Location.\"Bin Capacity Policy\"::\"Never Check Capacity\")) then\n if BinContent.Get(LocationCode, BinCode, ItemNo, VariantCode, UnitOfMeasureCode) then begin\n if (CheckInbound and\n (BinContent.\"Block Movement\" in [BinContent.\"Block Movement\"::Inbound, BinContent.\"Block Movement\"::All])) or\n@@ -1848,6 +1850,19 @@ codeunit 7302 \"WMS Management\"\n exit(Bin2.\"Bin Type Code\");\n end;\n \n+ local procedure CheckBinAndBinContentMovement(WarehouseJournalLine: Record \"Warehouse Journal Line\")\n+ begin\n+ if WarehouseJournalLine.Quantity = 0 then\n+ exit;\n+\n+ case WarehouseJournalLine.\"Entry Type\" of\n+ WarehouseJournalLine.\"Entry Type\"::\"Positive Adjmt.\":\n+ CheckBlockedBin(WarehouseJournalLine.\"Location Code\", WarehouseJournalLine.\"To Bin Code\", WarehouseJournalLine.\"Item No.\", WarehouseJournalLine.\"Variant Code\", WarehouseJournalLine.\"Unit of Measure Code\", WarehouseJournalLine.Quantity > 0);\n+ WarehouseJournalLine.\"Entry Type\"::\"Negative Adjmt.\":\n+ CheckBlockedBin(WarehouseJournalLine.\"Location Code\", WarehouseJournalLine.\"To Bin Code\", WarehouseJournalLine.\"Item No.\", WarehouseJournalLine.\"Variant Code\", WarehouseJournalLine.\"Unit of Measure Code\", WarehouseJournalLine.Quantity < 0);\n+ end;\n+ end;\n+\n [IntegrationEvent(false, false)]\n local procedure OnAfterCheckBlockedBin(LocationCode: Code[10]; BinCode: Code[20]; ItemNo: Code[20]; VariantCode: Code[10]; UnitOfMeasureCode: Code[10]; CheckInbound: Boolean)\n begin\n"} From a3a3c3e99529c66a4a047cf14fe182f4e7deb6f0 Mon Sep 17 00:00:00 2001 From: "Haoran Sun (Business Central)" Date: Tue, 25 Nov 2025 08:22:12 +0100 Subject: [PATCH 6/6] try 25.5 --- dataset/bcbench_nav.jsonl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dataset/bcbench_nav.jsonl b/dataset/bcbench_nav.jsonl index 15ab86016..bcb4c77ed 100644 --- a/dataset/bcbench_nav.jsonl +++ b/dataset/bcbench_nav.jsonl @@ -23,4 +23,4 @@ {"repo": "microsoftInternal/NAV", "instance_id": "microsoftInternal__NAV-206527", "base_commit": "d8e867062d4137cf5df2d9d2b8a71bb53210f685", "created_at": "2025-02-07", "environment_setup_version": "26.0", "project_paths": ["App\\Layers\\W1\\BaseApp", "App\\Layers\\W1\\Tests\\SCM"], "hints_text": "", "FAIL_TO_PASS": [{"codeunitID": 137088, "functionName": ["ReleasedProdOrderQuantityPerandExpectedQtyRoundingPrecisionChecking"]}], "PASS_TO_PASS": [], "problem_statement": "Title: If a component's Item UOM has a 'Quantity Rounding Precision' of 1, & a Finished Good consumes partial quantity, the Prod. Order created from the Planning of a Sales Order pulls in the Component with a 'Qty. Per' and 'Exp. Qty.' of 0.\nRepro Steps:\n1. Use existing Item with no activity, or create new item. This will be the COMPONENT Item. Will use PCS as UOM.\n2. For the Component Item, go into Related > Item UOM > and set 'Quantity Rounding Precision' = 1 on the bottom.\n3. Component Item should have\n Replenishment System = PURCHASE\n Rounding Precision = .01\n Reorder Policy = Lot-for-Lot\n Include Inventory = TRUE\n4. Then have another Item, I'll call it FG Item which is:\n Replenishment System = PRODUNCTION ORDER\n Rounding Precision = 1\n Reorder Policy = ORDER\n Production BOM => Create new Certified Production BOM that consumes COMPONENT Item with 'Quantity Per' = .09\n5. Now create Sales Order for any Customer for FG Item for 1 Quantity at BLUE (or MAIN) location.\n6. On the Sales Order go to Actions > Plan > Planning > Create Prod. Order and choose 'Released' and 'Item Order'.\n7. Then choose Order Tracking and then 'Show' which will take you to the Released Prod. Order.\n8. We will see prod. Order for FG Item with 1 qty. Go to Line > Components\n\n**EXPECTED RESULTS** = 'Quantity Per' and 'Expected Quantity' = .09\n**ACTUAL RESULTS** = 'Quantity Per' and 'Expected Quantity' = 0\n\nIf you were then to delete the Released Production Order, and go to the Planning Worksheet and run the Calc. Regenerative Plan for the 2 items, you would receive an error:\n\"The value in the Qty. Rounding Precision field on the Item Unit of Measure page is causing the rounding precision for the Expected Quantity field to be incorrect.\"\n\nDescription:\n2If a component's Item UOM has a 'Quantity Rounding Precision' set to 1, and a Finished Good consumes partial quantity, the Production Order created from the Planning section of a Sales Order pulls in the Component but with a 'Quantity Per' and 'Expected Quantity' of 0. If we are producing 1 FG Item and the 'Quantity Per' is set to consume .1 component, we would expect 'Quantity Per' and 'Expected Quantity' both = .1. There is no error message.\n\nBut if you run the Planning Worksheet's 'Calc. Regenerative Plan', then you will get an error message about the 'Quantity Rounding Precision'.\n\nI don't believe the 'Quantity Rounding Precision' in the Item UOM should have any influence on this process. I always thought this field was only for scenario with Picking and when Base UOM is larger than the smallest UOM, and picking in smallest UOM. There is a lot of confusion about this 'Quantity Rounding Precision' field within the Item UOM actually.\n", "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMOrderPlanningIII.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMOrderPlanningIII.Codeunit.al\nindex 7415eaa53cc..2573227dbca 100644\n--- a/App/Layers/W1/Tests/SCM/SCMOrderPlanningIII.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMOrderPlanningIII.Codeunit.al\n@@ -45,6 +45,8 @@ codeunit 137088 \"SCM Order Planning - III\"\n LineExistErr: Label 'Requistion line in %1 worksheet should exist for item %2';\n PurchaseLineQuantityBaseErr: Label '%1.%2 must be nearly equal to %3.', Comment = '%1 : Purchase Line, %2 : Quantity (Base), %3 : Value.';\n BOMFixedQtyCalcFormulaErr: Label 'BOM Fixed Quantity Calculation Formula should be used to calculate the values.';\n+ RelesedProdOrderComponentQtyPerRoundingErr: Label 'Relesed Production Order Item Component Quantity per %1 Not Match With Expected Result %2';\n+ RelesedProdOrderComponentExpQtyRoundingErr: Label 'Relesed Production Order Item Component Expected Quantity %1 Not Match With Expected Result %2';\n \n [Test]\n [HandlerFunctions('MakeSupplyOrdersPageHandler')]\n@@ -2988,6 +2990,73 @@ codeunit 137088 \"SCM Order Planning - III\"\n VerifyStartingTimeOnFirmPlannedProductionOrder(StartingTime, ChildItem.\"No.\", ProductionOrderNo);\n end;\n \n+ [Test]\n+ [HandlerFunctions('ModalPageHandler,ErrorMessageHandler')]\n+ procedure ReleasedProdOrderQuantityPerandExpectedQtyRoundingPrecisionChecking()\n+ var\n+ BaseItemUnitOfMeasure: Record \"Item Unit of Measure\";\n+ ComponentItem: Record Item;\n+ ProdOrderComp: Record \"Prod. Order Component\";\n+ ProdOrderLine: Record \"Prod. Order Line\";\n+ ProductionBOMHeader: Record \"Production BOM Header\";\n+ ProductionBOMLine: Record \"Production BOM Line\";\n+ ProductionOrder: Record \"Production Order\";\n+ ProductItem: Record Item;\n+ SalesHeader: Record \"Sales Header\";\n+ ExpectedQty: Decimal;\n+ RelesedProdOrderNo: Code[20];\n+ Status: Enum \"Production Order Status\";\n+ begin\n+ // [SCENARIO 562766] If a component's Item UOM has a 'Quantity Rounding Precision' of 1, & a Finished Good consumes partial quantity, \n+ // the Prod. Order created from the Planning of a Sales Order pulls in the Component with a 'Qty. Per' and 'Exp. Qty.' of 0.\n+ Initialize();\n+\n+ // [GIVEN] Created Component Item\n+ LibraryInventory.CreateItem(ComponentItem);\n+ ComponentItem.Validate(\"Replenishment System\", ComponentItem.\"Replenishment System\"::Purchase);\n+ ComponentItem.Validate(\"Rounding Precision\", LibraryRandom.RandPrecision());\n+ ComponentItem.Validate(\"Reordering Policy\", ComponentItem.\"Reordering Policy\"::\"Lot-for-Lot\");\n+ ComponentItem.Validate(\"Include Inventory\", true);\n+ ComponentItem.Modify(true);\n+\n+ // [GIVEN] Set Qty. Rounding Precision = 1 for Component Item\n+ BaseItemUnitOfMeasure.Get(ComponentItem.\"No.\", ComponentItem.\"Base Unit of Measure\");\n+ BaseItemUnitOfMeasure.Validate(\"Qty. Rounding Precision\", 1);\n+ BaseItemUnitOfMeasure.Modify();\n+\n+ // [GIVEN] Created Production Bom using Component Item\n+ LibraryManufacturing.CreateProductionBOMHeader(ProductionBOMHeader, ComponentItem.\"Base Unit of Measure\");\n+ LibraryManufacturing.CreateProductionBOMLine(ProductionBOMHeader, ProductionBOMLine, '', ProductionBOMLine.Type::Item, ComponentItem.\"No.\", LibraryRandom.RandDecInDecimalRange(0.01, 0.99, 2));\n+ ProductionBOMHeader.Validate(Status, ProductionBOMHeader.Status::Certified);\n+ ProductionBOMHeader.Modify();\n+\n+ // [GIVEN] Created Master Item and Production Bom Assigned to Master Item\n+ LibraryInventory.CreateItem(ProductItem);\n+ ProductItem.Validate(\"Replenishment System\", ProductItem.\"Replenishment System\"::\"Prod. Order\");\n+ ProductItem.Validate(\"Rounding Precision\", 1);\n+ ProductItem.Validate(\"Reordering Policy\", ProductItem.\"Reordering Policy\"::Order);\n+ ProductItem.Validate(\"Production BOM No.\", ProductionBOMHeader.\"No.\");\n+ ProductItem.Modify(true);\n+\n+ // [GIVEN] Created Sales Order Using Master Item Quantity - 1\n+ CreateSalesOrder(SalesHeader, ProductItem.\"No.\", '', 1, 1);\n+\n+ // [WHEN] Created Released Prod. Order From Sales Order Using Planning\n+ LibraryPlanning.CreateProdOrderUsingPlanning(ProductionOrder, Status::\"Firm Planned\", SalesHeader.\"No.\", ProductItem.\"No.\");\n+ RelesedProdOrderNo := LibraryManufacturing.ChangeStatusFirmPlanToReleased(ProductionOrder.\"No.\");\n+\n+ // [WHEN] Find Released Production Order Component\n+ FindProdOrderLine(ProdOrderLine, RelesedProdOrderNo);\n+ FindProdOrderComponent(ProdOrderComp, ProdOrderLine.\"Prod. Order No.\", ComponentItem.\"No.\");\n+\n+ // [WHEN] Getting Expected result using Component Rounding Precision\n+ ExpectedQty := Round(ProductionBOMLine.\"Quantity per\" * BaseItemUnitOfMeasure.\"Qty. Rounding Precision\" / BaseItemUnitOfMeasure.\"Qty. Rounding Precision\", ComponentItem.\"Rounding Precision\");\n+\n+ // [THEN] Expected Quantity must be Equal to Production Order Component \"Quantity per\" And \"Expected Quantity\"\n+ Assert.AreEqual(ExpectedQty, ProdOrderComp.\"Quantity per\", StrSubstNo(RelesedProdOrderComponentQtyPerRoundingErr, ProdOrderComp.\"Quantity per\", ExpectedQty));\n+ Assert.AreEqual(ExpectedQty, ProdOrderComp.\"Expected Quantity\", StrSubstNo(RelesedProdOrderComponentExpQtyRoundingErr, ProdOrderComp.\"Expected Quantity\", ExpectedQty));\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n@@ -3805,6 +3874,14 @@ codeunit 137088 \"SCM Order Planning - III\"\n Assert.IsTrue(ProductionOrder.\"Starting Time\" = StartingTime, '');\n end;\n \n+ local procedure FindProdOrderLine(var ProdOrderLine: Record \"Prod. Order Line\"; ProductionOrderNo: Code[20])\n+ begin\n+ ProdOrderLine.Reset();\n+ ProdOrderLine.SetRange(Status, ProdOrderLine.Status::Released);\n+ ProdOrderLine.SetRange(\"Prod. Order No.\", ProductionOrderNo);\n+ ProdOrderLine.FindFirst();\n+ end;\n+\n [ModalPageHandler]\n [Scope('OnPrem')]\n procedure MakeSupplyOrdersPageHandler(var MakeSupplyOrders: Page \"Make Supply Orders\"; var Response: Action)\n@@ -3911,5 +3988,16 @@ codeunit 137088 \"SCM Order Planning - III\"\n begin\n Reply := true;\n end;\n+\n+ [ModalPageHandler]\n+ procedure ModalPageHandler(var CreateOrderFromSales: Page \"Create Order From Sales\"; var Response: Action)\n+ begin\n+ Response := Action::Yes;\n+ end;\n+\n+ [MessageHandler]\n+ procedure ErrorMessageHandler(Message: Text[1024])\n+ begin\n+ end;\n }\n \n", "patch": "diff --git a/App/Layers/IT/BaseApp/Manufacturing/Document/CalculateProdOrder.Codeunit.al b/App/Layers/IT/BaseApp/Manufacturing/Document/CalculateProdOrder.Codeunit.al\nindex 5f7a2b890fe..5b63565d0f1 100644\n--- a/App/Layers/IT/BaseApp/Manufacturing/Document/CalculateProdOrder.Codeunit.al\n+++ b/App/Layers/IT/BaseApp/Manufacturing/Document/CalculateProdOrder.Codeunit.al\n@@ -43,6 +43,7 @@ codeunit 99000773 \"Calculate Prod. Order\"\n ProdOrderComp: Record \"Prod. Order Component\";\n ProdOrderRoutingLine2: Record \"Prod. Order Routing Line\";\n ProdBOMLine: array[99] of Record \"Production BOM Line\";\n+ ProdLineItem: Record Item;\n UOMMgt: Codeunit \"Unit of Measure Management\";\n MfgCostCalcMgt: Codeunit \"Mfg. Cost Calculation Mgt.\";\n VersionMgt: Codeunit VersionManagement;\n@@ -286,8 +287,8 @@ codeunit 99000773 \"Calculate Prod. Order\"\n \n local procedure TransferBOMProcessItem(Level: Integer; LineQtyPerUOM: Decimal; ItemQtyPerUOM: Decimal; var ErrorOccured: Boolean)\n var\n- Item2: Record Item;\n ComponentSKU: Record \"Stockkeeping Unit\";\n+ Item2: Record Item;\n IsHandled: Boolean;\n QtyRoundPrecision: Decimal;\n begin\n@@ -323,6 +324,7 @@ codeunit 99000773 \"Calculate Prod. Order\"\n ProdOrderComp.Validate(\"Unit of Measure Code\", ProdBOMLine[Level].\"Unit of Measure Code\");\n if (ProdOrderComp.\"Item No.\" <> '') and Item2.Get(ProdOrderComp.\"Item No.\") then\n QtyRoundPrecision := UOMMgt.GetQtyRoundingPrecision(Item2, ProdBOMLine[Level].\"Unit of Measure Code\");\n+ CheckingRoundingPrecision(Item2, ProdLineItem, QtyRoundPrecision, Level);\n if QtyRoundPrecision <> 0 then\n ProdOrderComp.\"Quantity per\" := Round(ProdBOMLine[Level].\"Quantity per\" * LineQtyPerUOM / ItemQtyPerUOM, QtyRoundPrecision)\n else\n@@ -1001,6 +1003,21 @@ codeunit 99000773 \"Calculate Prod. Order\"\n ProdOrderLineToCheck.TestField(Quantity);\n end;\n \n+ local procedure CheckingRoundingPrecision(ChildItem: Record Item; ProdLineItem: Record Item; var QtyRoundPrecision: Decimal; Level: Integer)\n+ begin\n+ if (ChildItem.\"Rounding Precision\" = 0) or (QtyRoundPrecision = 0) then\n+ exit;\n+\n+ if (not ProdLineItem.Get(ProdOrderLine.\"Item No.\")) or (ProdLineItem.\"Replenishment System\" <> ProdLineItem.\"Replenishment System\"::\"Prod. Order\") then\n+ exit;\n+\n+ if (ChildItem.\"Base Unit of Measure\" <> ProdBOMLine[Level].\"Unit of Measure Code\") then\n+ exit;\n+ QtyRoundPrecision := ChildItem.\"Rounding Precision\";\n+ ProdOrderComp.\"Qty. Rounding Precision\" := ChildItem.\"Rounding Precision\";\n+ ProdOrderComp.\"Qty. Rounding Precision (Base)\" := ChildItem.\"Rounding Precision\";\n+ end;\n+\n [IntegrationEvent(false, false)]\n local procedure OnAfterInsertProdRoutingLine(var ProdOrderRoutingLine: Record \"Prod. Order Routing Line\"; ProdOrderLine: Record \"Prod. Order Line\")\n begin\ndiff --git a/App/Layers/W1/BaseApp/Manufacturing/Document/CalculateProdOrder.Codeunit.al b/App/Layers/W1/BaseApp/Manufacturing/Document/CalculateProdOrder.Codeunit.al\nindex 36930a9e2aa..5d44df0a596 100644\n--- a/App/Layers/W1/BaseApp/Manufacturing/Document/CalculateProdOrder.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Manufacturing/Document/CalculateProdOrder.Codeunit.al\n@@ -43,6 +43,7 @@ codeunit 99000773 \"Calculate Prod. Order\"\n ProdOrderComp: Record \"Prod. Order Component\";\n ProdOrderRoutingLine2: Record \"Prod. Order Routing Line\";\n ProdBOMLine: array[99] of Record \"Production BOM Line\";\n+ ProdLineItem: Record Item;\n UOMMgt: Codeunit \"Unit of Measure Management\";\n MfgCostCalcMgt: Codeunit \"Mfg. Cost Calculation Mgt.\";\n VersionMgt: Codeunit VersionManagement;\n@@ -260,8 +261,8 @@ codeunit 99000773 \"Calculate Prod. Order\"\n \n local procedure TransferBOMProcessItem(Level: Integer; LineQtyPerUOM: Decimal; ItemQtyPerUOM: Decimal; var ErrorOccured: Boolean)\n var\n- Item2: Record Item;\n ComponentSKU: Record \"Stockkeeping Unit\";\n+ Item2: Record Item;\n IsHandled: Boolean;\n QtyRoundPrecision: Decimal;\n begin\n@@ -297,6 +298,7 @@ codeunit 99000773 \"Calculate Prod. Order\"\n ProdOrderComp.Validate(\"Unit of Measure Code\", ProdBOMLine[Level].\"Unit of Measure Code\");\n if (ProdOrderComp.\"Item No.\" <> '') and Item2.Get(ProdOrderComp.\"Item No.\") then\n QtyRoundPrecision := UOMMgt.GetQtyRoundingPrecision(Item2, ProdBOMLine[Level].\"Unit of Measure Code\");\n+ CheckingRoundingPrecision(Item2, ProdLineItem, QtyRoundPrecision, Level);\n if QtyRoundPrecision <> 0 then\n ProdOrderComp.\"Quantity per\" := Round(ProdBOMLine[Level].\"Quantity per\" * LineQtyPerUOM / ItemQtyPerUOM, QtyRoundPrecision)\n else\n@@ -975,6 +977,21 @@ codeunit 99000773 \"Calculate Prod. Order\"\n ProdOrderLineToCheck.TestField(Quantity);\n end;\n \n+ local procedure CheckingRoundingPrecision(ChildItem: Record Item; ProdLineItem: Record Item; var QtyRoundPrecision: Decimal; Level: Integer)\n+ begin\n+ if (ChildItem.\"Rounding Precision\" = 0) or (QtyRoundPrecision = 0) then\n+ exit;\n+\n+ if (not ProdLineItem.Get(ProdOrderLine.\"Item No.\")) or (ProdLineItem.\"Replenishment System\" <> ProdLineItem.\"Replenishment System\"::\"Prod. Order\") then\n+ exit;\n+\n+ if (ChildItem.\"Base Unit of Measure\" <> ProdBOMLine[Level].\"Unit of Measure Code\") then\n+ exit;\n+ QtyRoundPrecision := ChildItem.\"Rounding Precision\";\n+ ProdOrderComp.\"Qty. Rounding Precision\" := ChildItem.\"Rounding Precision\";\n+ ProdOrderComp.\"Qty. Rounding Precision (Base)\" := ChildItem.\"Rounding Precision\";\n+ end;\n+\n [IntegrationEvent(false, false)]\n local procedure OnAfterInsertProdRoutingLine(var ProdOrderRoutingLine: Record \"Prod. Order Routing Line\"; ProdOrderLine: Record \"Prod. Order Line\")\n begin\n"} {"repo": "microsoftInternal/NAV", "instance_id": "microsoftInternal__NAV-208851", "base_commit": "b626cb16a65cd529d91527d1d5dac501d6ecb06e", "created_at": "2025-03-04", "environment_setup_version": "26.0", "project_paths": ["App\\Layers\\W1\\BaseApp", "App\\Layers\\W1\\Tests\\ERM"], "hints_text": "", "FAIL_TO_PASS": [{"codeunitID": 134117, "functionName": ["AmountTypeFieldDoesNotChangeOnClosePageSalesPriceList"]}], "PASS_TO_PASS": [], "problem_statement": "Title: In the Sales Price Lists, the 'Defines' field always defaults to Price & Discount when dealing with Customer Price Group/Customer Disc Group setting\nRepro Steps:\nReproduced in CRONUS GB v25.4\nEnable 'New Sales Price Experience' in Feature Management.\n1. Go to Sales Price Lists\n2. Click on New to generate a New Sales Price List.\n3. Set Assign-to-type to Customer Disc. Group\n4. View Columns for: **Discount**\n5. Insert a single item line, using only Line Discount.\n6. Set the Sales Price List to Status 'Active'\n7. Go back to the Sales Price Lists Page.\n\nYou will notice \"Defines\" has changed back to Prices & Discounts Same behavior is replicable with Price for Customer Price Group\n**Expected Result:** Defines should remain as Discounts if only discounts are in the Sales Price list\n**Actual Results:** 'Defines' Always defaults to 'Prices & Discount'\n\nDescription:\nThe issue is with the setting for the \"Defines\" field. The setting may be changed from 'Price & Discount' to 'Discount' because only Line Discounts may be used in the new Price Group configuration. However, after closing the Page, the system will always default back to the 'Price & Discount', even though only Line Discounts are defined, because the code doesn't pass the value correctly.\n\nThe Partner Developer highlighted the following code:\nThe call stack:\n- GetAmountType (\\ext11_packandshipchanges\\Table\\7005\\Price Source.dal:342)\n- GetDefaultAmountType (\\ext11_packandshipchanges\\Table\\7005\\Price Source.dal:182)\n- UpdateAmountType (\\ext11_packandshipchanges\\Table\\7000\\Price List Header.dal:567)\n- OnClosePage (\\ext11_packandshipchanges\\Page\\7016\\Sales Price List.dal:600)\n\nIn the Function:`UpdateAmountType`, the following code is used:\n\"Amount Type\" := PriceSource.GetDefaultAmountType(); The code reflects it as empty. No value is passed to it, so it always defaults to 'Price & Discount'\n", "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/PriceListsUI.Codeunit.al b/App/Layers/W1/Tests/ERM/PriceListsUI.Codeunit.al\nindex 5f586214ecb..c18252ac131 100644\n--- a/App/Layers/W1/Tests/ERM/PriceListsUI.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/PriceListsUI.Codeunit.al\n@@ -4366,6 +4366,39 @@ codeunit 134117 \"Price Lists UI\"\n PurchasePriceList.Caption()));\n end;\n \n+ [Test]\n+ procedure AmountTypeFieldDoesNotChangeOnClosePageSalesPriceList()\n+ var\n+ PriceListHeader: Record \"Price List Header\";\n+ CustomerDiscountGroup: Record \"Customer Discount Group\";\n+ SalesPriceList: TestPage \"Sales Price List\";\n+ PriceListHeaderCode: Code[20];\n+ begin\n+ // [SCENARIO 566994] Bug fix to ensure the field \"Amount Type\" does not change after closing the page \"Sales Price List\" \n+ Initialize(true);\n+\n+ // [GIVEN] Sales Price List for discount\n+ PriceListHeaderCode := LibraryUtility.GenerateGUID();\n+ SalesPriceList.OpenEdit();\n+ SalesPriceList.New();\n+ SalesPriceList.Code.SetValue(PriceListHeaderCode);\n+ SalesPriceList.Description.SetValue(LibraryUtility.GenerateGUID());\n+ SalesPriceList.SourceType.SetValue(\"Price Source Type\"::\"Customer Disc. Group\");\n+ SalesPriceList.AmountType.SetValue(\"Price Amount Type\"::Discount);\n+ CustomerDiscountGroup.Init();\n+ CustomerDiscountGroup.Code := LibraryUtility.GenerateGUID();\n+ CustomerDiscountGroup.Insert();\n+ SalesPriceList.AssignToNo.SetValue(CustomerDiscountGroup.Code);\n+ SalesPriceList.Status.SetValue(\"Price Status\"::Active);\n+\n+ // [WHEN] Close the page \"Sales Price List\"\n+ SalesPriceList.Close();\n+\n+ // [THEN] Check the field \"Amount Type\" has not reverted to Price & Discount\n+ PriceListHeader.Get(PriceListHeaderCode);\n+ Assert.IsTrue((PriceListHeader.\"Amount Type\" = PriceListHeader.\"Amount Type\"::Discount), 'The field \"Amount Type\" has changed after closing the page \"Sales Price List\"');\n+ end;\n+\n local procedure Initialize(Enable: Boolean)\n var\n PriceListHeader: Record \"Price List Header\";\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Pricing/PriceList/PriceListHeader.Table.al b/App/Layers/W1/BaseApp/Pricing/PriceList/PriceListHeader.Table.al\nindex fb6adbb607d..9e6fd459241 100644\n--- a/App/Layers/W1/BaseApp/Pricing/PriceList/PriceListHeader.Table.al\n+++ b/App/Layers/W1/BaseApp/Pricing/PriceList/PriceListHeader.Table.al\n@@ -562,6 +562,7 @@ table 7000 \"Price List Header\"\n var\n xAmountType: Enum \"Price Amount Type\";\n begin\n+ CopyTo(PriceSource);\n xAmountType := \"Amount Type\";\n if \"Source Type\" in [\"Source Type\"::\"Customer Disc. Group\", \"Source Type\"::\"Customer Price Group\"] then\n \"Amount Type\" := PriceSource.GetDefaultAmountType()\n"} {"repo": "microsoftInternal/NAV", "instance_id": "microsoftInternal__NAV-208320", "base_commit": "d080f087349d4713e1782f2f2630819714cb6738", "created_at": "2025-02-27", "environment_setup_version": "26.0", "project_paths": ["App\\Layers\\W1\\BaseApp", "App\\Layers\\W1\\Tests\\ERM"], "hints_text": "", "FAIL_TO_PASS": [{"codeunitID": 134386, "functionName": ["UpdateEmailAndPhoneNoWhenChangeBillToOfSalesInvoice"]}], "PASS_TO_PASS": [], "problem_statement": "Title: The Email and Phone No. don't update when selecting Another Customer in the \"Bill-to\" field of a Sales Invoice\nRepro Steps:\n1. Go to Contacts and find CT000012 - \"Miss Patricia Doyle\" with 'Company Name' = (John Haddock Insurance Co.)\n2. Edit the contact and add any 'Phone Number' and 'Mobile Phone No.'\n3. Go to Sales Invoices and Create a new sales invoice and for Customer 10000.\n3. Go down to the Shipping and Billing tab and set 'Bill-to' = \"Another Customer\"\n Now see how more fields are introduced, including the Contact and Contact info with Phone numbers and email, should be for \"Mr. Andy Teal\" who is contact for Customer 10000.\n5. Then set Name = 30000 (John Haddock Insurance Co.) and say yes to change bill-to customer.\nNotice we have Contact = \"Miss Patricia Doyle\"....\n\n**EXPECTED RESULTS:** The Phone Number(s) and Email for \"Miss Patricia Doyle\" should pull in.\n**ACTUAL RESULTS:** The fields are the same as they were for the previous contact \"Mr. Andy Teal\" and you need to refresh the Page so it pulls in the new Phone numbers and email for \"Mr. Andy Teal\" Contact.\nDescription:\nCopied and Derived from Support Case Review", "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/ERMSalesDocumentsII.Codeunit.al b/App/Layers/W1/Tests/ERM/ERMSalesDocumentsII.Codeunit.al\nindex bc3ad2bbe5c..30e993b56af 100644\n--- a/App/Layers/W1/Tests/ERM/ERMSalesDocumentsII.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ERMSalesDocumentsII.Codeunit.al\n@@ -4462,6 +4462,51 @@ codeunit 134386 \"ERM Sales Documents II\"\n SalesOrder.SalesLines.\"Invoice Discount Amount\".AssertEquals(SalesHeader.\"Invoice Discount Value\");\n end;\n \n+ [HandlerFunctions('CustomerLookupHandler,ConfirmHandlerYes')]\n+ [Test]\n+ procedure UpdateEmailAndPhoneNoWhenChangeBillToOfSalesInvoice()\n+ var\n+ Contact: array[2] of Record Contact;\n+ Customer: array[2] of Record Customer;\n+ SalesHeader: Record \"Sales Header\";\n+ SalesInvoice: TestPage \"Sales Invoice\";\n+ begin\n+ // [SCENARIO 564632] The Email and Phone No. should update when selecting Another Customer in the \"Bill-to\" field of a Sales Invoice\n+ Initialize();\n+\n+ // [GIVEN] Create First Customer with First Contact with Phone = \"111111111\", Mobile Phone = \"222222222\" and Email = \"contact1@mail.com\"\n+ LibraryMarketing.CreateContactWithCustomer(Contact[1], Customer[1]);\n+ UpdateContactInfo(Contact[1], '111111111', '222222222', 'contact1@mail.com');\n+ Contact[1].Modify(true);\n+\n+ // [GIVEN] Create Second Customer with Second Contact with Phone = \"333333333\", Mobile Phone = \"444444444\" and Email = \"contact2@mail.com\"\n+ LibraryMarketing.CreateContactWithCustomer(Contact[2], Customer[2]);\n+ UpdateContactInfo(Contact[2], '333333333', '444444444', 'contact2@mail.com');\n+ Contact[2].Modify(true);\n+\n+ // [GIVEN] Create Sales Invoice with First Customer\n+ LibrarySales.CreateSalesHeader(SalesHeader, SalesHeader.\"Document Type\"::Invoice, Customer[1].\"No.\");\n+\n+ // [GIVEN] Sales Invoice Card is opened\n+ LibraryVariableStorage.Enqueue(Customer[2].\"No.\");\n+ LibraryVariableStorage.Enqueue('');\n+ LibraryVariableStorage.Enqueue(true); // yes to change \"Bill-to Customer No.\"\n+ SalesInvoice.OpenEdit();\n+ SalesInvoice.FILTER.SetFilter(\"No.\", SalesHeader.\"No.\");\n+\n+ // [WHEN] Select Second Customer when lookup \"Bill-to Customer Name\"\n+ SalesInvoice.\"Bill-to Name\".Lookup();\n+\n+ // [THEN] Verify Sales Invoice \"Phone No.\" = \"333333333\"\n+ SalesInvoice.BillToContactPhoneNo.AssertEquals(Contact[2].\"Phone No.\");\n+\n+ // [THEN] Verify Sales Invoice \"Mobile Phone No.\" = \"444444444\"\n+ SalesInvoice.BillToContactMobilePhoneNo.AssertEquals(Contact[2].\"Mobile Phone No.\");\n+\n+ // [THEN] Verify Sales Invoice \"Email\" = \"contact2@mail.com\"\n+ SalesInvoice.BillToContactEmail.AssertEquals(Contact[2].\"E-Mail\");\n+ end;\n+\n [Test]\n [Scope('OnPrem')]\n procedure UpdateExtendedTextTypeNotAllowed()\n@@ -6595,5 +6640,14 @@ codeunit 134386 \"ERM Sales Documents II\"\n CustomerLookup.Filter.SetFilter(Name, LibraryVariableStorage.DequeueText());\n CustomerLookup.OK().Invoke();\n end;\n+\n+ [ModalPageHandler]\n+ procedure CustomerLookupHandler(var CustomerLookup: TestPage \"Customer Lookup\")\n+ begin\n+ CustomerLookup.GotoKey(LibraryVariableStorage.DequeueText());\n+ Assert.AreEqual(LibraryVariableStorage.DequeueText(),\n+ CustomerLookup.Filter.GetFilter(\"Date Filter\"), 'Wrong Date Filter.');\n+ CustomerLookup.OK().Invoke();\n+ end;\n }\n \n", "patch": "diff --git a/App/Layers/W1/BaseApp/Sales/Document/BlanketSalesOrder.Page.al b/App/Layers/W1/BaseApp/Sales/Document/BlanketSalesOrder.Page.al\nindex 1dee700e044..a3b2013773f 100644\n--- a/App/Layers/W1/BaseApp/Sales/Document/BlanketSalesOrder.Page.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/BlanketSalesOrder.Page.al\n@@ -648,6 +648,23 @@ page 507 \"Blanket Sales Order\"\n Rec.SetRange(\"Bill-to Customer No.\");\n CurrPage.Update();\n end;\n+\n+ trigger OnLookup(var Text: Text): Boolean\n+ var\n+ Customer: Record Customer;\n+ begin\n+ if Customer.SelectCustomer(Customer) then begin\n+ xRec := Rec;\n+ Rec.\"Bill-to Name\" := Customer.Name;\n+ Rec.Validate(\"Bill-to Customer No.\", Customer.\"No.\");\n+ end;\n+\n+ if Rec.GetFilter(\"Bill-to Customer No.\") = xRec.\"Bill-to Customer No.\" then\n+ if Rec.\"Bill-to Customer No.\" <> xRec.\"Bill-to Customer No.\" then\n+ Rec.SetRange(\"Bill-to Customer No.\");\n+\n+ CurrPage.Update();\n+ end;\n }\n field(\"Bill-to Address\"; Rec.\"Bill-to Address\")\n {\ndiff --git a/App/Layers/W1/BaseApp/Sales/Document/SalesCreditMemo.Page.al b/App/Layers/W1/BaseApp/Sales/Document/SalesCreditMemo.Page.al\nindex 84ba27e1b17..3f876b15fd0 100644\n--- a/App/Layers/W1/BaseApp/Sales/Document/SalesCreditMemo.Page.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/SalesCreditMemo.Page.al\n@@ -552,6 +552,23 @@ page 44 \"Sales Credit Memo\"\n \n CurrPage.Update();\n end;\n+\n+ trigger OnLookup(var Text: Text): Boolean\n+ var\n+ Customer: Record Customer;\n+ begin\n+ if Customer.SelectCustomer(Customer) then begin\n+ xRec := Rec;\n+ Rec.\"Bill-to Name\" := Customer.Name;\n+ Rec.Validate(\"Bill-to Customer No.\", Customer.\"No.\");\n+ end;\n+\n+ if Rec.GetFilter(\"Bill-to Customer No.\") = xRec.\"Bill-to Customer No.\" then\n+ if Rec.\"Bill-to Customer No.\" <> xRec.\"Bill-to Customer No.\" then\n+ Rec.SetRange(\"Bill-to Customer No.\");\n+\n+ CurrPage.Update();\n+ end;\n }\n field(\"Bill-to Address\"; Rec.\"Bill-to Address\")\n {\ndiff --git a/App/Layers/W1/BaseApp/Sales/Document/SalesInvoice.Page.al b/App/Layers/W1/BaseApp/Sales/Document/SalesInvoice.Page.al\nindex ee0d93e0f64..930047f5653 100644\n--- a/App/Layers/W1/BaseApp/Sales/Document/SalesInvoice.Page.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/SalesInvoice.Page.al\n@@ -803,6 +803,25 @@ page 43 \"Sales Invoice\"\n CurrPage.Update();\n end;\n end;\n+\n+ trigger OnLookup(var Text: Text): Boolean\n+ var\n+ Customer: Record Customer;\n+ begin\n+ if Customer.SelectCustomer(Customer) then begin\n+ xRec := Rec;\n+ Rec.\"Bill-to Name\" := Customer.Name;\n+ Rec.Validate(\"Bill-to Customer No.\", Customer.\"No.\");\n+ end;\n+\n+ if not ((BillToOptions = BillToOptions::\"Custom Address\") and not ShouldSearchForCustByName) then begin\n+ if Rec.GetFilter(\"Bill-to Customer No.\") = xRec.\"Bill-to Customer No.\" then\n+ if Rec.\"Bill-to Customer No.\" <> xRec.\"Bill-to Customer No.\" then\n+ Rec.SetRange(\"Bill-to Customer No.\");\n+\n+ CurrPage.Update();\n+ end;\n+ end;\n }\n field(\"Bill-to Address\"; Rec.\"Bill-to Address\")\n {\ndiff --git a/App/Layers/W1/BaseApp/Sales/Document/SalesOrder.Page.al b/App/Layers/W1/BaseApp/Sales/Document/SalesOrder.Page.al\nindex 77cf2b1863e..2a751833971 100644\n--- a/App/Layers/W1/BaseApp/Sales/Document/SalesOrder.Page.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/SalesOrder.Page.al\n@@ -812,6 +812,25 @@ page 42 \"Sales Order\"\n CurrPage.Update();\n end;\n end;\n+\n+ trigger OnLookup(var Text: Text): Boolean\n+ var\n+ Customer: Record Customer;\n+ begin\n+ if Customer.SelectCustomer(Customer) then begin\n+ xRec := Rec;\n+ Rec.\"Bill-to Name\" := Customer.Name;\n+ Rec.Validate(\"Bill-to Customer No.\", Customer.\"No.\");\n+ end;\n+\n+ if not ((BillToOptions = BillToOptions::\"Custom Address\") and not ShouldSearchForCustByName) then begin\n+ if Rec.GetFilter(\"Bill-to Customer No.\") = xRec.\"Bill-to Customer No.\" then\n+ if Rec.\"Bill-to Customer No.\" <> xRec.\"Bill-to Customer No.\" then\n+ Rec.SetRange(\"Bill-to Customer No.\");\n+\n+ CurrPage.Update();\n+ end;\n+ end;\n }\n field(\"Bill-to Address\"; Rec.\"Bill-to Address\")\n {\ndiff --git a/App/Layers/W1/BaseApp/Sales/Document/SalesQuote.Page.al b/App/Layers/W1/BaseApp/Sales/Document/SalesQuote.Page.al\nindex 7827a9ece78..5851f14e04b 100644\n--- a/App/Layers/W1/BaseApp/Sales/Document/SalesQuote.Page.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/SalesQuote.Page.al\n@@ -763,6 +763,23 @@ page 41 \"Sales Quote\"\n \n CurrPage.Update();\n end;\n+\n+ trigger OnLookup(var Text: Text): Boolean\n+ var\n+ Customer: Record Customer;\n+ begin\n+ if Customer.SelectCustomer(Customer) then begin\n+ xRec := Rec;\n+ Rec.\"Bill-to Name\" := Customer.Name;\n+ Rec.Validate(\"Bill-to Customer No.\", Customer.\"No.\");\n+ end;\n+\n+ if Rec.GetFilter(\"Bill-to Customer No.\") = xRec.\"Bill-to Customer No.\" then\n+ if Rec.\"Bill-to Customer No.\" <> xRec.\"Bill-to Customer No.\" then\n+ Rec.SetRange(\"Bill-to Customer No.\");\n+\n+ CurrPage.Update();\n+ end;\n }\n field(\"Bill-to Address\"; Rec.\"Bill-to Address\")\n {\ndiff --git a/App/Layers/W1/BaseApp/Sales/Document/SalesReturnOrder.Page.al b/App/Layers/W1/BaseApp/Sales/Document/SalesReturnOrder.Page.al\nindex e9c58725477..a0e9bb787e7 100644\n--- a/App/Layers/W1/BaseApp/Sales/Document/SalesReturnOrder.Page.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/SalesReturnOrder.Page.al\n@@ -613,6 +613,23 @@ page 6630 \"Sales Return Order\"\n \n CurrPage.Update();\n end;\n+\n+ trigger OnLookup(var Text: Text): Boolean\n+ var\n+ Customer: Record Customer;\n+ begin\n+ if Customer.SelectCustomer(Customer) then begin\n+ xRec := Rec;\n+ Rec.\"Bill-to Name\" := Customer.Name;\n+ Rec.Validate(\"Bill-to Customer No.\", Customer.\"No.\");\n+ end;\n+\n+ if Rec.GetFilter(\"Bill-to Customer No.\") = xRec.\"Bill-to Customer No.\" then\n+ if Rec.\"Bill-to Customer No.\" <> xRec.\"Bill-to Customer No.\" then\n+ Rec.SetRange(\"Bill-to Customer No.\");\n+\n+ CurrPage.Update();\n+ end;\n }\n field(\"Bill-to Address\"; Rec.\"Bill-to Address\")\n {\n"} -{"repo": "microsoftInternal/NAV", "instance_id": "microsoftInternal__NAV-199883", "base_commit": "aaf1c6d95a374d426984ab59eacb82f1047659b5", "created_at": "2024-11-12", "environment_setup_version": "24.0", "project_paths": ["App\\Layers\\W1\\BaseApp", "App\\Layers\\W1\\Tests\\SCM"], "hints_text": "", "FAIL_TO_PASS": [{"codeunitID": 137033, "functionName": ["BinContentMovementBlockedThrowsErrorWhenPostingItemJournal"]}], "PASS_TO_PASS": [], "problem_statement": "Title: [master] [ALL-E] Bin Content Block Movement is not considered when posting an item journal.\nRepro Steps:\nOpen Cronus 24.2. Go to locations. Go to the warehouse employees and add location SILVER to your user Go to the item journal.Create an entry as follows:Item No \"1896-S\"Location: SILVERBin code: S-01-0001Quantity: 40post Go to Bin ContentsSelect your entry -> Block Movement: All. Go to the item journal Create an entry as follows:Item No \"1896-S\"Location: SILVERBin code: S-01-0001Quantity: 40post The Entry is posted successfully. Expected Results: The entry shouldn't be posted for the same Item No. Block Movement Specifies how the movement of a particular item, or bin content, into or out of this bin, is blocked. Actual Results: The entry is still posted even if the Bin content has a block movement on All. Investigation: Tested on 24.2 , 23.07 and 22.13 OnPrem and the same behavior happens. It seems to be that all settings are ignored for Block Movement I tried also with Inbound and Outbound and according postings and everything can be posted.\nDescription:\nBin Content Block Movement Doesn't work as expected\n", "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\nindex 4d85519ac9a..a2506b2d267 100644\n--- a/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\n@@ -34,6 +34,8 @@\n OneEntryExpectedErr: Label 'Only one Item Ledger Entry is expected.';\n MultipleEntriesExpectedErr: Label 'Two Item Ledger Entries expected.';\n RoundingTo0Err: Label 'Rounding of the field';\n+ BlockedBinContentErr: Label 'Block Movement must not be All in Bin Content Location Code=''%1'',Bin Code=''%2'',Item No.=''%3'',Variant Code=''%4'',Unit of Measure Code=''%5''.',\n+ Comment = '%1= Location Code, %2= Bin Code, %3= Item No., %4= Varient Code, %5= Unit of Measure Code';\n \n [Test]\n [Scope('OnPrem')]\n@@ -2091,6 +2093,86 @@\n Assert.RecordIsEmpty(RecordLink);\n end;\n \n+ [Test]\n+ procedure BinContentMovementBlockedThrowsErrorWhenPostingItemJournal()\n+ var\n+ Bin: Record Bin;\n+ BinContent: Record \"Bin Content\";\n+ Item: Record Item;\n+ ItemJournalTemplate: Record \"Item Journal Template\";\n+ ItemJournalBatch: Record \"Item Journal Batch\";\n+ ItemJournalLine: Record \"Item Journal Line\";\n+ Location: Record Location;\n+ begin\n+ // [SCENARIO 538864] Bin Content Block Movement is considered when posting an Item Journal.\n+ Initialize();\n+\n+ // [GIVEN] Create an Item.\n+ LibraryInventory.CreateItem(Item);\n+\n+ // [GIVEN] Create a Location with require Bin and a Default Bin Code.\n+ LibraryWarehouse.CreateLocationWMS(Location, true, false, false, false, false);\n+\n+ // [GIVEN] Create a Bin.\n+ LibraryWarehouse.CreateBin(Bin, Location.Code, '', '', '');\n+\n+ // [GIVEN] Validate Default Bin Code in Location.\n+ Location.Validate(\"Default Bin Code\", Bin.Code);\n+ Location.Modify(true);\n+\n+ // [GIVEN] Select an Item Journal Template of Type Item.\n+ LibraryInventory.SelectItemJournalTemplateName(ItemJournalTemplate, ItemJournalTemplate.Type::Item);\n+\n+ // [GIVEN] Select an Item Journal Batch.\n+ LibraryInventory.SelectItemJournalBatchName(ItemJournalBatch, ItemJournalTemplate.Type::Item, ItemJournalTemplate.Name);\n+\n+ // [GIVEN] Create an Item Journal Line\n+ LibraryInventory.ClearItemJournal(ItemJournalTemplate, ItemJournalBatch);\n+ LibraryInventory.CreateItemJournalLine(\n+ ItemJournalLine,\n+ ItemJournalBatch.\"Journal Template Name\",\n+ ItemJournalBatch.Name,\n+ ItemJournalLine.\"Entry Type\"::Purchase,\n+ Item.\"No.\",\n+ LibraryRandom.RandInt(10));\n+\n+ // [GIVEN] Validate Location Code and Bin Code in Item Journal Line.\n+ ItemJournalLine.Validate(\"Location Code\", Location.Code);\n+ ItemJournalLine.Validate(\"Bin Code\", Bin.Code);\n+ ItemJournalLine.Modify(true);\n+\n+ // [GIVEN] Post an Item Journal.\n+ LibraryInventory.PostItemJournalLine(ItemJournalLine.\"Journal Template Name\", ItemJournalLine.\"Journal Batch Name\");\n+\n+ // [GIVEN] Find Bin Content and Validate Block Movement to All.\n+ BinContent.SetRange(\"Bin Code\", Bin.Code);\n+ BinContent.SetRange(\"Item No.\", Item.\"No.\");\n+ BinContent.SetRange(\"Location Code\", Location.Code);\n+ BinContent.FindFirst();\n+ BinContent.Validate(\"Block Movement\", BinContent.\"Block Movement\"::All);\n+ BinContent.Modify(true);\n+\n+ // [GIVEN] Clear an Item Journal\n+ LibraryInventory.ClearItemJournal(ItemJournalTemplate, ItemJournalBatch);\n+\n+ // [GIVEN] Create an Item Journal and Validate Location Code.\n+ LibraryInventory.CreateItemJournalLine(\n+ ItemJournalLine,\n+ ItemJournalBatch.\"Journal Template Name\",\n+ ItemJournalBatch.Name,\n+ ItemJournalLine.\"Entry Type\"::Purchase,\n+ Item.\"No.\",\n+ LibraryRandom.RandInt(10));\n+ ItemJournalLine.Validate(\"Location Code\", Location.Code);\n+ ItemJournalLine.Modify(true);\n+\n+ // [WHEN] Post an Item Journal.\n+ asserterror LibraryInventory.PostItemJournalLine(ItemJournalLine.\"Journal Template Name\", ItemJournalLine.\"Journal Batch Name\");\n+\n+ // [THEN] Error of Bin Content Movement blocked is raised.\n+ Assert.ExpectedError(StrSubstNo(BlockedBinContentErr, ItemJournalLine.\"Location Code\", ItemJournalLine.\"Bin Code\", ItemJournalLine.\"Item No.\", ItemJournalLine.\"Variant Code\", ItemJournalLine.\"Unit of Measure Code\"));\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Warehouse/Journal/WMSManagement.Codeunit.al b/App/Layers/W1/BaseApp/Warehouse/Journal/WMSManagement.Codeunit.al\nindex d165f3a21a7..08c0e53701b 100644\n--- a/App/Layers/W1/BaseApp/Warehouse/Journal/WMSManagement.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Warehouse/Journal/WMSManagement.Codeunit.al\n@@ -193,8 +193,10 @@ codeunit 7302 \"WMS Management\"\n GetBin(WarehouseJournalLine.\"Location Code\", WarehouseJournalLine.\"To Bin Code\");\n Bin.CheckIncreaseBin(Bin.Code, WarehouseJournalLine.\"Item No.\", WarehouseJournalLine.\"Qty. (Absolute)\", WarehouseJournalLine.Cubage, WarehouseJournalLine.Weight, WarehouseJournalLine.Cubage, WarehouseJournalLine.Weight, true, false);\n end;\n- end else\n+ end else begin\n CheckWarehouseClass(WarehouseJournalLine.\"Location Code\", WarehouseJournalLine.\"To Bin Code\", WarehouseJournalLine.\"Item No.\", WarehouseJournalLine.\"Variant Code\", WarehouseJournalLine.\"Unit of Measure Code\");\n+ CheckBinAndBinContentMovement(WarehouseJournalLine);\n+ end;\n SourceJnl::OutputJnl, SourceJnl::ConsumpJnl:\n if WarehouseJournalLine.\"To Bin Code\" <> '' then\n if Location.\"Bin Capacity Policy\" <> Location.\"Bin Capacity Policy\"::\"Never Check Capacity\" then\n@@ -1803,7 +1805,7 @@ codeunit 7302 \"WMS Management\"\n OnBeforeCheckBlockedBin(LocationCode, BinCode, ItemNo, VariantCode, UnitOfMeasureCode, CheckInbound, IsHandled);\n if not IsHandled then begin\n GetLocation(LocationCode);\n- if Location.\"Directed Put-away and Pick\" then\n+ if (Location.\"Directed Put-away and Pick\") or ((BinCode <> '') and (Location.\"Bin Capacity Policy\" = Location.\"Bin Capacity Policy\"::\"Never Check Capacity\")) then\n if BinContent.Get(LocationCode, BinCode, ItemNo, VariantCode, UnitOfMeasureCode) then begin\n if (CheckInbound and\n (BinContent.\"Block Movement\" in [BinContent.\"Block Movement\"::Inbound, BinContent.\"Block Movement\"::All])) or\n@@ -1848,6 +1850,19 @@ codeunit 7302 \"WMS Management\"\n exit(Bin2.\"Bin Type Code\");\n end;\n \n+ local procedure CheckBinAndBinContentMovement(WarehouseJournalLine: Record \"Warehouse Journal Line\")\n+ begin\n+ if WarehouseJournalLine.Quantity = 0 then\n+ exit;\n+\n+ case WarehouseJournalLine.\"Entry Type\" of\n+ WarehouseJournalLine.\"Entry Type\"::\"Positive Adjmt.\":\n+ CheckBlockedBin(WarehouseJournalLine.\"Location Code\", WarehouseJournalLine.\"To Bin Code\", WarehouseJournalLine.\"Item No.\", WarehouseJournalLine.\"Variant Code\", WarehouseJournalLine.\"Unit of Measure Code\", WarehouseJournalLine.Quantity > 0);\n+ WarehouseJournalLine.\"Entry Type\"::\"Negative Adjmt.\":\n+ CheckBlockedBin(WarehouseJournalLine.\"Location Code\", WarehouseJournalLine.\"To Bin Code\", WarehouseJournalLine.\"Item No.\", WarehouseJournalLine.\"Variant Code\", WarehouseJournalLine.\"Unit of Measure Code\", WarehouseJournalLine.Quantity < 0);\n+ end;\n+ end;\n+\n [IntegrationEvent(false, false)]\n local procedure OnAfterCheckBlockedBin(LocationCode: Code[10]; BinCode: Code[20]; ItemNo: Code[20]; VariantCode: Code[10]; UnitOfMeasureCode: Code[10]; CheckInbound: Boolean)\n begin\n"} +{"repo": "microsoftInternal/NAV", "instance_id": "microsoftInternal__NAV-199883", "base_commit": "aaf1c6d95a374d426984ab59eacb82f1047659b5", "created_at": "2024-11-12", "environment_setup_version": "25.5", "project_paths": ["App\\Layers\\W1\\BaseApp", "App\\Layers\\W1\\Tests\\SCM"], "hints_text": "", "FAIL_TO_PASS": [{"codeunitID": 137033, "functionName": ["BinContentMovementBlockedThrowsErrorWhenPostingItemJournal"]}], "PASS_TO_PASS": [], "problem_statement": "Title: [master] [ALL-E] Bin Content Block Movement is not considered when posting an item journal.\nRepro Steps:\nOpen Cronus 24.2. Go to locations. Go to the warehouse employees and add location SILVER to your user Go to the item journal.Create an entry as follows:Item No \"1896-S\"Location: SILVERBin code: S-01-0001Quantity: 40post Go to Bin ContentsSelect your entry -> Block Movement: All. Go to the item journal Create an entry as follows:Item No \"1896-S\"Location: SILVERBin code: S-01-0001Quantity: 40post The Entry is posted successfully. Expected Results: The entry shouldn't be posted for the same Item No. Block Movement Specifies how the movement of a particular item, or bin content, into or out of this bin, is blocked. Actual Results: The entry is still posted even if the Bin content has a block movement on All. Investigation: Tested on 24.2 , 23.07 and 22.13 OnPrem and the same behavior happens. It seems to be that all settings are ignored for Block Movement I tried also with Inbound and Outbound and according postings and everything can be posted.\nDescription:\nBin Content Block Movement Doesn't work as expected\n", "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\nindex 4d85519ac9a..a2506b2d267 100644\n--- a/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\n@@ -34,6 +34,8 @@\n OneEntryExpectedErr: Label 'Only one Item Ledger Entry is expected.';\n MultipleEntriesExpectedErr: Label 'Two Item Ledger Entries expected.';\n RoundingTo0Err: Label 'Rounding of the field';\n+ BlockedBinContentErr: Label 'Block Movement must not be All in Bin Content Location Code=''%1'',Bin Code=''%2'',Item No.=''%3'',Variant Code=''%4'',Unit of Measure Code=''%5''.',\n+ Comment = '%1= Location Code, %2= Bin Code, %3= Item No., %4= Varient Code, %5= Unit of Measure Code';\n \n [Test]\n [Scope('OnPrem')]\n@@ -2091,6 +2093,86 @@\n Assert.RecordIsEmpty(RecordLink);\n end;\n \n+ [Test]\n+ procedure BinContentMovementBlockedThrowsErrorWhenPostingItemJournal()\n+ var\n+ Bin: Record Bin;\n+ BinContent: Record \"Bin Content\";\n+ Item: Record Item;\n+ ItemJournalTemplate: Record \"Item Journal Template\";\n+ ItemJournalBatch: Record \"Item Journal Batch\";\n+ ItemJournalLine: Record \"Item Journal Line\";\n+ Location: Record Location;\n+ begin\n+ // [SCENARIO 538864] Bin Content Block Movement is considered when posting an Item Journal.\n+ Initialize();\n+\n+ // [GIVEN] Create an Item.\n+ LibraryInventory.CreateItem(Item);\n+\n+ // [GIVEN] Create a Location with require Bin and a Default Bin Code.\n+ LibraryWarehouse.CreateLocationWMS(Location, true, false, false, false, false);\n+\n+ // [GIVEN] Create a Bin.\n+ LibraryWarehouse.CreateBin(Bin, Location.Code, '', '', '');\n+\n+ // [GIVEN] Validate Default Bin Code in Location.\n+ Location.Validate(\"Default Bin Code\", Bin.Code);\n+ Location.Modify(true);\n+\n+ // [GIVEN] Select an Item Journal Template of Type Item.\n+ LibraryInventory.SelectItemJournalTemplateName(ItemJournalTemplate, ItemJournalTemplate.Type::Item);\n+\n+ // [GIVEN] Select an Item Journal Batch.\n+ LibraryInventory.SelectItemJournalBatchName(ItemJournalBatch, ItemJournalTemplate.Type::Item, ItemJournalTemplate.Name);\n+\n+ // [GIVEN] Create an Item Journal Line\n+ LibraryInventory.ClearItemJournal(ItemJournalTemplate, ItemJournalBatch);\n+ LibraryInventory.CreateItemJournalLine(\n+ ItemJournalLine,\n+ ItemJournalBatch.\"Journal Template Name\",\n+ ItemJournalBatch.Name,\n+ ItemJournalLine.\"Entry Type\"::Purchase,\n+ Item.\"No.\",\n+ LibraryRandom.RandInt(10));\n+\n+ // [GIVEN] Validate Location Code and Bin Code in Item Journal Line.\n+ ItemJournalLine.Validate(\"Location Code\", Location.Code);\n+ ItemJournalLine.Validate(\"Bin Code\", Bin.Code);\n+ ItemJournalLine.Modify(true);\n+\n+ // [GIVEN] Post an Item Journal.\n+ LibraryInventory.PostItemJournalLine(ItemJournalLine.\"Journal Template Name\", ItemJournalLine.\"Journal Batch Name\");\n+\n+ // [GIVEN] Find Bin Content and Validate Block Movement to All.\n+ BinContent.SetRange(\"Bin Code\", Bin.Code);\n+ BinContent.SetRange(\"Item No.\", Item.\"No.\");\n+ BinContent.SetRange(\"Location Code\", Location.Code);\n+ BinContent.FindFirst();\n+ BinContent.Validate(\"Block Movement\", BinContent.\"Block Movement\"::All);\n+ BinContent.Modify(true);\n+\n+ // [GIVEN] Clear an Item Journal\n+ LibraryInventory.ClearItemJournal(ItemJournalTemplate, ItemJournalBatch);\n+\n+ // [GIVEN] Create an Item Journal and Validate Location Code.\n+ LibraryInventory.CreateItemJournalLine(\n+ ItemJournalLine,\n+ ItemJournalBatch.\"Journal Template Name\",\n+ ItemJournalBatch.Name,\n+ ItemJournalLine.\"Entry Type\"::Purchase,\n+ Item.\"No.\",\n+ LibraryRandom.RandInt(10));\n+ ItemJournalLine.Validate(\"Location Code\", Location.Code);\n+ ItemJournalLine.Modify(true);\n+\n+ // [WHEN] Post an Item Journal.\n+ asserterror LibraryInventory.PostItemJournalLine(ItemJournalLine.\"Journal Template Name\", ItemJournalLine.\"Journal Batch Name\");\n+\n+ // [THEN] Error of Bin Content Movement blocked is raised.\n+ Assert.ExpectedError(StrSubstNo(BlockedBinContentErr, ItemJournalLine.\"Location Code\", ItemJournalLine.\"Bin Code\", ItemJournalLine.\"Item No.\", ItemJournalLine.\"Variant Code\", ItemJournalLine.\"Unit of Measure Code\"));\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Warehouse/Journal/WMSManagement.Codeunit.al b/App/Layers/W1/BaseApp/Warehouse/Journal/WMSManagement.Codeunit.al\nindex d165f3a21a7..08c0e53701b 100644\n--- a/App/Layers/W1/BaseApp/Warehouse/Journal/WMSManagement.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Warehouse/Journal/WMSManagement.Codeunit.al\n@@ -193,8 +193,10 @@ codeunit 7302 \"WMS Management\"\n GetBin(WarehouseJournalLine.\"Location Code\", WarehouseJournalLine.\"To Bin Code\");\n Bin.CheckIncreaseBin(Bin.Code, WarehouseJournalLine.\"Item No.\", WarehouseJournalLine.\"Qty. (Absolute)\", WarehouseJournalLine.Cubage, WarehouseJournalLine.Weight, WarehouseJournalLine.Cubage, WarehouseJournalLine.Weight, true, false);\n end;\n- end else\n+ end else begin\n CheckWarehouseClass(WarehouseJournalLine.\"Location Code\", WarehouseJournalLine.\"To Bin Code\", WarehouseJournalLine.\"Item No.\", WarehouseJournalLine.\"Variant Code\", WarehouseJournalLine.\"Unit of Measure Code\");\n+ CheckBinAndBinContentMovement(WarehouseJournalLine);\n+ end;\n SourceJnl::OutputJnl, SourceJnl::ConsumpJnl:\n if WarehouseJournalLine.\"To Bin Code\" <> '' then\n if Location.\"Bin Capacity Policy\" <> Location.\"Bin Capacity Policy\"::\"Never Check Capacity\" then\n@@ -1803,7 +1805,7 @@ codeunit 7302 \"WMS Management\"\n OnBeforeCheckBlockedBin(LocationCode, BinCode, ItemNo, VariantCode, UnitOfMeasureCode, CheckInbound, IsHandled);\n if not IsHandled then begin\n GetLocation(LocationCode);\n- if Location.\"Directed Put-away and Pick\" then\n+ if (Location.\"Directed Put-away and Pick\") or ((BinCode <> '') and (Location.\"Bin Capacity Policy\" = Location.\"Bin Capacity Policy\"::\"Never Check Capacity\")) then\n if BinContent.Get(LocationCode, BinCode, ItemNo, VariantCode, UnitOfMeasureCode) then begin\n if (CheckInbound and\n (BinContent.\"Block Movement\" in [BinContent.\"Block Movement\"::Inbound, BinContent.\"Block Movement\"::All])) or\n@@ -1848,6 +1850,19 @@ codeunit 7302 \"WMS Management\"\n exit(Bin2.\"Bin Type Code\");\n end;\n \n+ local procedure CheckBinAndBinContentMovement(WarehouseJournalLine: Record \"Warehouse Journal Line\")\n+ begin\n+ if WarehouseJournalLine.Quantity = 0 then\n+ exit;\n+\n+ case WarehouseJournalLine.\"Entry Type\" of\n+ WarehouseJournalLine.\"Entry Type\"::\"Positive Adjmt.\":\n+ CheckBlockedBin(WarehouseJournalLine.\"Location Code\", WarehouseJournalLine.\"To Bin Code\", WarehouseJournalLine.\"Item No.\", WarehouseJournalLine.\"Variant Code\", WarehouseJournalLine.\"Unit of Measure Code\", WarehouseJournalLine.Quantity > 0);\n+ WarehouseJournalLine.\"Entry Type\"::\"Negative Adjmt.\":\n+ CheckBlockedBin(WarehouseJournalLine.\"Location Code\", WarehouseJournalLine.\"To Bin Code\", WarehouseJournalLine.\"Item No.\", WarehouseJournalLine.\"Variant Code\", WarehouseJournalLine.\"Unit of Measure Code\", WarehouseJournalLine.Quantity < 0);\n+ end;\n+ end;\n+\n [IntegrationEvent(false, false)]\n local procedure OnAfterCheckBlockedBin(LocationCode: Code[10]; BinCode: Code[20]; ItemNo: Code[20]; VariantCode: Code[10]; UnitOfMeasureCode: Code[10]; CheckInbound: Boolean)\n begin\n"}