From c5842c73bbe4ed327a8dddc1ebe6740aeb725e8c Mon Sep 17 00:00:00 2001 From: Jiawen Sun Date: Tue, 18 Nov 2025 16:44:14 +0100 Subject: [PATCH 1/7] Add microsoftInternal__NAV-201401 --- dataset/bcbench_nav.jsonl | 1 + 1 file changed, 1 insertion(+) diff --git a/dataset/bcbench_nav.jsonl b/dataset/bcbench_nav.jsonl index c03cbfa64..8ed5f9c74 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-201401", "base_commit": "c1c259bd038176f703ea589225b4a6cf9b7f198d", "created_at": "2024-11-28", "environment_setup_version": "27.1", "project_paths": ["App\\Layers\\W1\\BaseApp", "App\\Layers\\W1\\Tests\\SCM"], "hints_text": "", "FAIL_TO_PASS": [{"codeunitID": 137033, "functionName": ["InitValueOfTypeFieldOnItemJournalLine"]}, {"codeunitID": 137163, "functionName": ["ValueEntryTypeBlankOnPostingPurchase"]}, {"codeunitID": 137163, "functionName": ["ValueEntryTypeBlankOnPostingSales"]}], "PASS_TO_PASS": [], "problem_statement": "Title: Export/import item data tool replaces Type = for Value Entries with Type = Work Center.\nRepro Steps:\nPost assembly order Ensure that Type = ' ' on value entry for assembly output. Export item data Import it back. Type value for the assembly output is now \"Work Center\". The \"Work Center\" enum value is 0, which appears to be assigned when importing a blank (' ') value.\nDescription:\n\n", "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\nindex a2506b2d267..bd37d2498c5 100644\n--- a/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\n@@ -2173,6 +2173,18 @@\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+ [Test]\n+ procedure InitValueOfTypeFieldOnItemJournalLine()\n+ var\n+ ItemJournalLine: Record \"Item Journal Line\";\n+ begin\n+ // [SCENARIO] Init value of the Type field on Item Journal Line is .\n+ Initialize();\n+\n+ ItemJournalLine.Init();\n+ ItemJournalLine.TestField(Type, ItemJournalLine.Type::\" \");\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\ndiff --git a/App/Layers/W1/Tests/SCM/SCMOrdersVI.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMOrdersVI.Codeunit.al\nindex 1678946c4b5..99c2fe3eebe 100644\n--- a/App/Layers/W1/Tests/SCM/SCMOrdersVI.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMOrdersVI.Codeunit.al\n@@ -3215,6 +3215,42 @@\n Assert.IsFalse(SalesHeader.Find(), '');\n end;\n \n+ [Test]\n+ procedure ValueEntryTypeBlankOnPostingPurchase()\n+ var\n+ PurchaseHeader: Record \"Purchase Header\";\n+ PurchaseLine: Record \"Purchase Line\";\n+ ValueEntry: Record \"Value Entry\";\n+ begin\n+ // [SCENARIO 556628] Field \"Type\" in Value Entry for purchase is blank on posting.\n+ Initialize();\n+\n+ CreatePurchaseDocument(PurchaseHeader, PurchaseLine, PurchaseHeader.\"Document Type\"::Order, PurchaseLine.Type::Item, '', LibraryInventory.CreateItemNo(), 1);\n+ LibraryPurchase.PostPurchaseDocument(PurchaseHeader, true, true);\n+\n+ ValueEntry.SetRange(\"Item No.\", PurchaseLine.\"No.\");\n+ ValueEntry.FindFirst();\n+ ValueEntry.TestField(Type, ValueEntry.Type::\" \");\n+ end;\n+\n+ [Test]\n+ procedure ValueEntryTypeBlankOnPostingSales()\n+ var\n+ SalesHeader: Record \"Sales Header\";\n+ SalesLine: Record \"Sales Line\";\n+ ValueEntry: Record \"Value Entry\";\n+ begin\n+ // [SCENARIO 556628] Field \"Type\" in Value Entry for sales is blank on posting.\n+ Initialize();\n+\n+ CreateSalesDocument(SalesHeader, SalesLine, SalesHeader.\"Document Type\"::Order, SalesLine.Type::Item, '', LibraryInventory.CreateItemNo(), 1, '');\n+ LibrarySales.PostSalesDocument(SalesHeader, true, true);\n+\n+ ValueEntry.SetRange(\"Item No.\", SalesLine.\"No.\");\n+ ValueEntry.FindFirst();\n+ ValueEntry.TestField(Type, ValueEntry.Type::\" \");\n+ end;\n+\n local procedure Initialize()\n begin\n LibraryTestInitialize.OnTestInitialize(CODEUNIT::\"SCM Orders VI\");\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Assembly/Document/AssemblyOrders.Page.al b/App/Layers/W1/BaseApp/Assembly/Document/AssemblyOrders.Page.al\nindex 05f2dc4a32b..c2290e74f17 100644\n--- a/App/Layers/W1/BaseApp/Assembly/Document/AssemblyOrders.Page.al\n+++ b/App/Layers/W1/BaseApp/Assembly/Document/AssemblyOrders.Page.al\n@@ -16,7 +16,7 @@ using Microsoft.Warehouse.Ledger;\n \n page 902 \"Assembly Orders\"\n {\n- AdditionalSearchTerms = 'kitting order,kit sale';\n+ AdditionalSearchTerms = 'kitting order,kit sale,asm order';\n ApplicationArea = Assembly;\n Caption = 'Assembly Orders';\n CardPageID = \"Assembly Order\";\ndiff --git a/App/Layers/W1/BaseApp/Inventory/Item/ExportItemData.XmlPort.al b/App/Layers/W1/BaseApp/Inventory/Item/ExportItemData.XmlPort.al\nindex 2f2f41c66c3..5226d4582ba 100644\n--- a/App/Layers/W1/BaseApp/Inventory/Item/ExportItemData.XmlPort.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Item/ExportItemData.XmlPort.al\n@@ -32,7 +32,7 @@ xmlport 5801 \"Export Item Data\"\n tabledata \"Item Application Entry\" = rimd,\n tabledata \"Production Order\" = rimd,\n tabledata \"Prod. Order Line\" = rimd,\n- tabledata \"Value entry\" = rimd,\n+ tabledata \"Value Entry\" = rimd,\n tabledata \"Item Application Entry History\" = rimd,\n tabledata \"Capacity Ledger Entry\" = rimd,\n tabledata \"Avg. Cost Adjmt. Entry Point\" = rimd,\n@@ -1044,6 +1044,14 @@ xmlport 5801 \"Export Item Data\"\n }\n fieldelement(ValueEntry_Type; ValueEntry.Type)\n {\n+ trigger OnAfterAssignField()\n+ begin\n+ if ValueEntry.Type = ValueEntry.Type::\"Work Center\" then\n+ if not (ValueEntry.\"Item Ledger Entry Type\" in [ValueEntry.\"Item Ledger Entry Type\"::Output,\n+ ValueEntry.\"Item Ledger Entry Type\"::\" \"])\n+ then\n+ ValueEntry.Type := ValueEntry.Type::\" \";\n+ end;\n }\n fieldelement(ValueEntry_No; ValueEntry.\"No.\")\n {\ndiff --git a/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al b/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al\nindex a9357fe8da1..6cb31d26988 100644\n--- a/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al\n@@ -1530,6 +1530,7 @@ table 83 \"Item Journal Line\"\n field(5830; Type; Enum Microsoft.Manufacturing.Capacity.\"Capacity Type Journal\")\n {\n Caption = 'Type';\n+ InitValue = \" \";\n \n trigger OnValidate()\n begin\n"} From c5a2d7e86fb213291458b7ae72f36ae36a2383c1 Mon Sep 17 00:00:00 2001 From: Jiawen Sun Date: Tue, 18 Nov 2025 20:22:30 +0100 Subject: [PATCH 2/7] Use 26.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 8ed5f9c74..ac12fc7b0 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-201401", "base_commit": "c1c259bd038176f703ea589225b4a6cf9b7f198d", "created_at": "2024-11-28", "environment_setup_version": "27.1", "project_paths": ["App\\Layers\\W1\\BaseApp", "App\\Layers\\W1\\Tests\\SCM"], "hints_text": "", "FAIL_TO_PASS": [{"codeunitID": 137033, "functionName": ["InitValueOfTypeFieldOnItemJournalLine"]}, {"codeunitID": 137163, "functionName": ["ValueEntryTypeBlankOnPostingPurchase"]}, {"codeunitID": 137163, "functionName": ["ValueEntryTypeBlankOnPostingSales"]}], "PASS_TO_PASS": [], "problem_statement": "Title: Export/import item data tool replaces Type = for Value Entries with Type = Work Center.\nRepro Steps:\nPost assembly order Ensure that Type = ' ' on value entry for assembly output. Export item data Import it back. Type value for the assembly output is now \"Work Center\". The \"Work Center\" enum value is 0, which appears to be assigned when importing a blank (' ') value.\nDescription:\n\n", "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\nindex a2506b2d267..bd37d2498c5 100644\n--- a/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\n@@ -2173,6 +2173,18 @@\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+ [Test]\n+ procedure InitValueOfTypeFieldOnItemJournalLine()\n+ var\n+ ItemJournalLine: Record \"Item Journal Line\";\n+ begin\n+ // [SCENARIO] Init value of the Type field on Item Journal Line is .\n+ Initialize();\n+\n+ ItemJournalLine.Init();\n+ ItemJournalLine.TestField(Type, ItemJournalLine.Type::\" \");\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\ndiff --git a/App/Layers/W1/Tests/SCM/SCMOrdersVI.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMOrdersVI.Codeunit.al\nindex 1678946c4b5..99c2fe3eebe 100644\n--- a/App/Layers/W1/Tests/SCM/SCMOrdersVI.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMOrdersVI.Codeunit.al\n@@ -3215,6 +3215,42 @@\n Assert.IsFalse(SalesHeader.Find(), '');\n end;\n \n+ [Test]\n+ procedure ValueEntryTypeBlankOnPostingPurchase()\n+ var\n+ PurchaseHeader: Record \"Purchase Header\";\n+ PurchaseLine: Record \"Purchase Line\";\n+ ValueEntry: Record \"Value Entry\";\n+ begin\n+ // [SCENARIO 556628] Field \"Type\" in Value Entry for purchase is blank on posting.\n+ Initialize();\n+\n+ CreatePurchaseDocument(PurchaseHeader, PurchaseLine, PurchaseHeader.\"Document Type\"::Order, PurchaseLine.Type::Item, '', LibraryInventory.CreateItemNo(), 1);\n+ LibraryPurchase.PostPurchaseDocument(PurchaseHeader, true, true);\n+\n+ ValueEntry.SetRange(\"Item No.\", PurchaseLine.\"No.\");\n+ ValueEntry.FindFirst();\n+ ValueEntry.TestField(Type, ValueEntry.Type::\" \");\n+ end;\n+\n+ [Test]\n+ procedure ValueEntryTypeBlankOnPostingSales()\n+ var\n+ SalesHeader: Record \"Sales Header\";\n+ SalesLine: Record \"Sales Line\";\n+ ValueEntry: Record \"Value Entry\";\n+ begin\n+ // [SCENARIO 556628] Field \"Type\" in Value Entry for sales is blank on posting.\n+ Initialize();\n+\n+ CreateSalesDocument(SalesHeader, SalesLine, SalesHeader.\"Document Type\"::Order, SalesLine.Type::Item, '', LibraryInventory.CreateItemNo(), 1, '');\n+ LibrarySales.PostSalesDocument(SalesHeader, true, true);\n+\n+ ValueEntry.SetRange(\"Item No.\", SalesLine.\"No.\");\n+ ValueEntry.FindFirst();\n+ ValueEntry.TestField(Type, ValueEntry.Type::\" \");\n+ end;\n+\n local procedure Initialize()\n begin\n LibraryTestInitialize.OnTestInitialize(CODEUNIT::\"SCM Orders VI\");\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Assembly/Document/AssemblyOrders.Page.al b/App/Layers/W1/BaseApp/Assembly/Document/AssemblyOrders.Page.al\nindex 05f2dc4a32b..c2290e74f17 100644\n--- a/App/Layers/W1/BaseApp/Assembly/Document/AssemblyOrders.Page.al\n+++ b/App/Layers/W1/BaseApp/Assembly/Document/AssemblyOrders.Page.al\n@@ -16,7 +16,7 @@ using Microsoft.Warehouse.Ledger;\n \n page 902 \"Assembly Orders\"\n {\n- AdditionalSearchTerms = 'kitting order,kit sale';\n+ AdditionalSearchTerms = 'kitting order,kit sale,asm order';\n ApplicationArea = Assembly;\n Caption = 'Assembly Orders';\n CardPageID = \"Assembly Order\";\ndiff --git a/App/Layers/W1/BaseApp/Inventory/Item/ExportItemData.XmlPort.al b/App/Layers/W1/BaseApp/Inventory/Item/ExportItemData.XmlPort.al\nindex 2f2f41c66c3..5226d4582ba 100644\n--- a/App/Layers/W1/BaseApp/Inventory/Item/ExportItemData.XmlPort.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Item/ExportItemData.XmlPort.al\n@@ -32,7 +32,7 @@ xmlport 5801 \"Export Item Data\"\n tabledata \"Item Application Entry\" = rimd,\n tabledata \"Production Order\" = rimd,\n tabledata \"Prod. Order Line\" = rimd,\n- tabledata \"Value entry\" = rimd,\n+ tabledata \"Value Entry\" = rimd,\n tabledata \"Item Application Entry History\" = rimd,\n tabledata \"Capacity Ledger Entry\" = rimd,\n tabledata \"Avg. Cost Adjmt. Entry Point\" = rimd,\n@@ -1044,6 +1044,14 @@ xmlport 5801 \"Export Item Data\"\n }\n fieldelement(ValueEntry_Type; ValueEntry.Type)\n {\n+ trigger OnAfterAssignField()\n+ begin\n+ if ValueEntry.Type = ValueEntry.Type::\"Work Center\" then\n+ if not (ValueEntry.\"Item Ledger Entry Type\" in [ValueEntry.\"Item Ledger Entry Type\"::Output,\n+ ValueEntry.\"Item Ledger Entry Type\"::\" \"])\n+ then\n+ ValueEntry.Type := ValueEntry.Type::\" \";\n+ end;\n }\n fieldelement(ValueEntry_No; ValueEntry.\"No.\")\n {\ndiff --git a/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al b/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al\nindex a9357fe8da1..6cb31d26988 100644\n--- a/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al\n@@ -1530,6 +1530,7 @@ table 83 \"Item Journal Line\"\n field(5830; Type; Enum Microsoft.Manufacturing.Capacity.\"Capacity Type Journal\")\n {\n Caption = 'Type';\n+ InitValue = \" \";\n \n trigger OnValidate()\n begin\n"} +{"repo": "microsoftInternal/NAV", "instance_id": "microsoftInternal__NAV-201401", "base_commit": "c1c259bd038176f703ea589225b4a6cf9b7f198d", "created_at": "2024-11-28", "environment_setup_version": "26.0", "project_paths": ["App\\Layers\\W1\\BaseApp", "App\\Layers\\W1\\Tests\\SCM"], "hints_text": "", "FAIL_TO_PASS": [{"codeunitID": 137033, "functionName": ["InitValueOfTypeFieldOnItemJournalLine"]}, {"codeunitID": 137163, "functionName": ["ValueEntryTypeBlankOnPostingPurchase"]}, {"codeunitID": 137163, "functionName": ["ValueEntryTypeBlankOnPostingSales"]}], "PASS_TO_PASS": [], "problem_statement": "Title: Export/import item data tool replaces Type = for Value Entries with Type = Work Center.\nRepro Steps:\nPost assembly order Ensure that Type = ' ' on value entry for assembly output. Export item data Import it back. Type value for the assembly output is now \"Work Center\". The \"Work Center\" enum value is 0, which appears to be assigned when importing a blank (' ') value.\nDescription:\n\n", "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\nindex a2506b2d267..bd37d2498c5 100644\n--- a/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\n@@ -2173,6 +2173,18 @@\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+ [Test]\n+ procedure InitValueOfTypeFieldOnItemJournalLine()\n+ var\n+ ItemJournalLine: Record \"Item Journal Line\";\n+ begin\n+ // [SCENARIO] Init value of the Type field on Item Journal Line is .\n+ Initialize();\n+\n+ ItemJournalLine.Init();\n+ ItemJournalLine.TestField(Type, ItemJournalLine.Type::\" \");\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\ndiff --git a/App/Layers/W1/Tests/SCM/SCMOrdersVI.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMOrdersVI.Codeunit.al\nindex 1678946c4b5..99c2fe3eebe 100644\n--- a/App/Layers/W1/Tests/SCM/SCMOrdersVI.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMOrdersVI.Codeunit.al\n@@ -3215,6 +3215,42 @@\n Assert.IsFalse(SalesHeader.Find(), '');\n end;\n \n+ [Test]\n+ procedure ValueEntryTypeBlankOnPostingPurchase()\n+ var\n+ PurchaseHeader: Record \"Purchase Header\";\n+ PurchaseLine: Record \"Purchase Line\";\n+ ValueEntry: Record \"Value Entry\";\n+ begin\n+ // [SCENARIO 556628] Field \"Type\" in Value Entry for purchase is blank on posting.\n+ Initialize();\n+\n+ CreatePurchaseDocument(PurchaseHeader, PurchaseLine, PurchaseHeader.\"Document Type\"::Order, PurchaseLine.Type::Item, '', LibraryInventory.CreateItemNo(), 1);\n+ LibraryPurchase.PostPurchaseDocument(PurchaseHeader, true, true);\n+\n+ ValueEntry.SetRange(\"Item No.\", PurchaseLine.\"No.\");\n+ ValueEntry.FindFirst();\n+ ValueEntry.TestField(Type, ValueEntry.Type::\" \");\n+ end;\n+\n+ [Test]\n+ procedure ValueEntryTypeBlankOnPostingSales()\n+ var\n+ SalesHeader: Record \"Sales Header\";\n+ SalesLine: Record \"Sales Line\";\n+ ValueEntry: Record \"Value Entry\";\n+ begin\n+ // [SCENARIO 556628] Field \"Type\" in Value Entry for sales is blank on posting.\n+ Initialize();\n+\n+ CreateSalesDocument(SalesHeader, SalesLine, SalesHeader.\"Document Type\"::Order, SalesLine.Type::Item, '', LibraryInventory.CreateItemNo(), 1, '');\n+ LibrarySales.PostSalesDocument(SalesHeader, true, true);\n+\n+ ValueEntry.SetRange(\"Item No.\", SalesLine.\"No.\");\n+ ValueEntry.FindFirst();\n+ ValueEntry.TestField(Type, ValueEntry.Type::\" \");\n+ end;\n+\n local procedure Initialize()\n begin\n LibraryTestInitialize.OnTestInitialize(CODEUNIT::\"SCM Orders VI\");\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Assembly/Document/AssemblyOrders.Page.al b/App/Layers/W1/BaseApp/Assembly/Document/AssemblyOrders.Page.al\nindex 05f2dc4a32b..c2290e74f17 100644\n--- a/App/Layers/W1/BaseApp/Assembly/Document/AssemblyOrders.Page.al\n+++ b/App/Layers/W1/BaseApp/Assembly/Document/AssemblyOrders.Page.al\n@@ -16,7 +16,7 @@ using Microsoft.Warehouse.Ledger;\n \n page 902 \"Assembly Orders\"\n {\n- AdditionalSearchTerms = 'kitting order,kit sale';\n+ AdditionalSearchTerms = 'kitting order,kit sale,asm order';\n ApplicationArea = Assembly;\n Caption = 'Assembly Orders';\n CardPageID = \"Assembly Order\";\ndiff --git a/App/Layers/W1/BaseApp/Inventory/Item/ExportItemData.XmlPort.al b/App/Layers/W1/BaseApp/Inventory/Item/ExportItemData.XmlPort.al\nindex 2f2f41c66c3..5226d4582ba 100644\n--- a/App/Layers/W1/BaseApp/Inventory/Item/ExportItemData.XmlPort.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Item/ExportItemData.XmlPort.al\n@@ -32,7 +32,7 @@ xmlport 5801 \"Export Item Data\"\n tabledata \"Item Application Entry\" = rimd,\n tabledata \"Production Order\" = rimd,\n tabledata \"Prod. Order Line\" = rimd,\n- tabledata \"Value entry\" = rimd,\n+ tabledata \"Value Entry\" = rimd,\n tabledata \"Item Application Entry History\" = rimd,\n tabledata \"Capacity Ledger Entry\" = rimd,\n tabledata \"Avg. Cost Adjmt. Entry Point\" = rimd,\n@@ -1044,6 +1044,14 @@ xmlport 5801 \"Export Item Data\"\n }\n fieldelement(ValueEntry_Type; ValueEntry.Type)\n {\n+ trigger OnAfterAssignField()\n+ begin\n+ if ValueEntry.Type = ValueEntry.Type::\"Work Center\" then\n+ if not (ValueEntry.\"Item Ledger Entry Type\" in [ValueEntry.\"Item Ledger Entry Type\"::Output,\n+ ValueEntry.\"Item Ledger Entry Type\"::\" \"])\n+ then\n+ ValueEntry.Type := ValueEntry.Type::\" \";\n+ end;\n }\n fieldelement(ValueEntry_No; ValueEntry.\"No.\")\n {\ndiff --git a/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al b/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al\nindex a9357fe8da1..6cb31d26988 100644\n--- a/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al\n@@ -1530,6 +1530,7 @@ table 83 \"Item Journal Line\"\n field(5830; Type; Enum Microsoft.Manufacturing.Capacity.\"Capacity Type Journal\")\n {\n Caption = 'Type';\n+ InitValue = \" \";\n \n trigger OnValidate()\n begin\n"} From 9bafdeb6ddecaf40bfbbb3e37b5d02e0629eff91 Mon Sep 17 00:00:00 2001 From: Jiawen Sun Date: Tue, 18 Nov 2025 20:23:07 +0100 Subject: [PATCH 3/7] Use 25.5 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 ac12fc7b0..3f90b5d59 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-201401", "base_commit": "c1c259bd038176f703ea589225b4a6cf9b7f198d", "created_at": "2024-11-28", "environment_setup_version": "26.0", "project_paths": ["App\\Layers\\W1\\BaseApp", "App\\Layers\\W1\\Tests\\SCM"], "hints_text": "", "FAIL_TO_PASS": [{"codeunitID": 137033, "functionName": ["InitValueOfTypeFieldOnItemJournalLine"]}, {"codeunitID": 137163, "functionName": ["ValueEntryTypeBlankOnPostingPurchase"]}, {"codeunitID": 137163, "functionName": ["ValueEntryTypeBlankOnPostingSales"]}], "PASS_TO_PASS": [], "problem_statement": "Title: Export/import item data tool replaces Type = for Value Entries with Type = Work Center.\nRepro Steps:\nPost assembly order Ensure that Type = ' ' on value entry for assembly output. Export item data Import it back. Type value for the assembly output is now \"Work Center\". The \"Work Center\" enum value is 0, which appears to be assigned when importing a blank (' ') value.\nDescription:\n\n", "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\nindex a2506b2d267..bd37d2498c5 100644\n--- a/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\n@@ -2173,6 +2173,18 @@\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+ [Test]\n+ procedure InitValueOfTypeFieldOnItemJournalLine()\n+ var\n+ ItemJournalLine: Record \"Item Journal Line\";\n+ begin\n+ // [SCENARIO] Init value of the Type field on Item Journal Line is .\n+ Initialize();\n+\n+ ItemJournalLine.Init();\n+ ItemJournalLine.TestField(Type, ItemJournalLine.Type::\" \");\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\ndiff --git a/App/Layers/W1/Tests/SCM/SCMOrdersVI.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMOrdersVI.Codeunit.al\nindex 1678946c4b5..99c2fe3eebe 100644\n--- a/App/Layers/W1/Tests/SCM/SCMOrdersVI.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMOrdersVI.Codeunit.al\n@@ -3215,6 +3215,42 @@\n Assert.IsFalse(SalesHeader.Find(), '');\n end;\n \n+ [Test]\n+ procedure ValueEntryTypeBlankOnPostingPurchase()\n+ var\n+ PurchaseHeader: Record \"Purchase Header\";\n+ PurchaseLine: Record \"Purchase Line\";\n+ ValueEntry: Record \"Value Entry\";\n+ begin\n+ // [SCENARIO 556628] Field \"Type\" in Value Entry for purchase is blank on posting.\n+ Initialize();\n+\n+ CreatePurchaseDocument(PurchaseHeader, PurchaseLine, PurchaseHeader.\"Document Type\"::Order, PurchaseLine.Type::Item, '', LibraryInventory.CreateItemNo(), 1);\n+ LibraryPurchase.PostPurchaseDocument(PurchaseHeader, true, true);\n+\n+ ValueEntry.SetRange(\"Item No.\", PurchaseLine.\"No.\");\n+ ValueEntry.FindFirst();\n+ ValueEntry.TestField(Type, ValueEntry.Type::\" \");\n+ end;\n+\n+ [Test]\n+ procedure ValueEntryTypeBlankOnPostingSales()\n+ var\n+ SalesHeader: Record \"Sales Header\";\n+ SalesLine: Record \"Sales Line\";\n+ ValueEntry: Record \"Value Entry\";\n+ begin\n+ // [SCENARIO 556628] Field \"Type\" in Value Entry for sales is blank on posting.\n+ Initialize();\n+\n+ CreateSalesDocument(SalesHeader, SalesLine, SalesHeader.\"Document Type\"::Order, SalesLine.Type::Item, '', LibraryInventory.CreateItemNo(), 1, '');\n+ LibrarySales.PostSalesDocument(SalesHeader, true, true);\n+\n+ ValueEntry.SetRange(\"Item No.\", SalesLine.\"No.\");\n+ ValueEntry.FindFirst();\n+ ValueEntry.TestField(Type, ValueEntry.Type::\" \");\n+ end;\n+\n local procedure Initialize()\n begin\n LibraryTestInitialize.OnTestInitialize(CODEUNIT::\"SCM Orders VI\");\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Assembly/Document/AssemblyOrders.Page.al b/App/Layers/W1/BaseApp/Assembly/Document/AssemblyOrders.Page.al\nindex 05f2dc4a32b..c2290e74f17 100644\n--- a/App/Layers/W1/BaseApp/Assembly/Document/AssemblyOrders.Page.al\n+++ b/App/Layers/W1/BaseApp/Assembly/Document/AssemblyOrders.Page.al\n@@ -16,7 +16,7 @@ using Microsoft.Warehouse.Ledger;\n \n page 902 \"Assembly Orders\"\n {\n- AdditionalSearchTerms = 'kitting order,kit sale';\n+ AdditionalSearchTerms = 'kitting order,kit sale,asm order';\n ApplicationArea = Assembly;\n Caption = 'Assembly Orders';\n CardPageID = \"Assembly Order\";\ndiff --git a/App/Layers/W1/BaseApp/Inventory/Item/ExportItemData.XmlPort.al b/App/Layers/W1/BaseApp/Inventory/Item/ExportItemData.XmlPort.al\nindex 2f2f41c66c3..5226d4582ba 100644\n--- a/App/Layers/W1/BaseApp/Inventory/Item/ExportItemData.XmlPort.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Item/ExportItemData.XmlPort.al\n@@ -32,7 +32,7 @@ xmlport 5801 \"Export Item Data\"\n tabledata \"Item Application Entry\" = rimd,\n tabledata \"Production Order\" = rimd,\n tabledata \"Prod. Order Line\" = rimd,\n- tabledata \"Value entry\" = rimd,\n+ tabledata \"Value Entry\" = rimd,\n tabledata \"Item Application Entry History\" = rimd,\n tabledata \"Capacity Ledger Entry\" = rimd,\n tabledata \"Avg. Cost Adjmt. Entry Point\" = rimd,\n@@ -1044,6 +1044,14 @@ xmlport 5801 \"Export Item Data\"\n }\n fieldelement(ValueEntry_Type; ValueEntry.Type)\n {\n+ trigger OnAfterAssignField()\n+ begin\n+ if ValueEntry.Type = ValueEntry.Type::\"Work Center\" then\n+ if not (ValueEntry.\"Item Ledger Entry Type\" in [ValueEntry.\"Item Ledger Entry Type\"::Output,\n+ ValueEntry.\"Item Ledger Entry Type\"::\" \"])\n+ then\n+ ValueEntry.Type := ValueEntry.Type::\" \";\n+ end;\n }\n fieldelement(ValueEntry_No; ValueEntry.\"No.\")\n {\ndiff --git a/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al b/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al\nindex a9357fe8da1..6cb31d26988 100644\n--- a/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al\n@@ -1530,6 +1530,7 @@ table 83 \"Item Journal Line\"\n field(5830; Type; Enum Microsoft.Manufacturing.Capacity.\"Capacity Type Journal\")\n {\n Caption = 'Type';\n+ InitValue = \" \";\n \n trigger OnValidate()\n begin\n"} +{"repo": "microsoftInternal/NAV", "instance_id": "microsoftInternal__NAV-201401", "base_commit": "c1c259bd038176f703ea589225b4a6cf9b7f198d", "created_at": "2024-11-28", "environment_setup_version": "25.5", "project_paths": ["App\\Layers\\W1\\BaseApp", "App\\Layers\\W1\\Tests\\SCM"], "hints_text": "", "FAIL_TO_PASS": [{"codeunitID": 137033, "functionName": ["InitValueOfTypeFieldOnItemJournalLine"]}, {"codeunitID": 137163, "functionName": ["ValueEntryTypeBlankOnPostingPurchase"]}, {"codeunitID": 137163, "functionName": ["ValueEntryTypeBlankOnPostingSales"]}], "PASS_TO_PASS": [], "problem_statement": "Title: Export/import item data tool replaces Type = for Value Entries with Type = Work Center.\nRepro Steps:\nPost assembly order Ensure that Type = ' ' on value entry for assembly output. Export item data Import it back. Type value for the assembly output is now \"Work Center\". The \"Work Center\" enum value is 0, which appears to be assigned when importing a blank (' ') value.\nDescription:\n\n", "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\nindex a2506b2d267..bd37d2498c5 100644\n--- a/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\n@@ -2173,6 +2173,18 @@\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+ [Test]\n+ procedure InitValueOfTypeFieldOnItemJournalLine()\n+ var\n+ ItemJournalLine: Record \"Item Journal Line\";\n+ begin\n+ // [SCENARIO] Init value of the Type field on Item Journal Line is .\n+ Initialize();\n+\n+ ItemJournalLine.Init();\n+ ItemJournalLine.TestField(Type, ItemJournalLine.Type::\" \");\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\ndiff --git a/App/Layers/W1/Tests/SCM/SCMOrdersVI.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMOrdersVI.Codeunit.al\nindex 1678946c4b5..99c2fe3eebe 100644\n--- a/App/Layers/W1/Tests/SCM/SCMOrdersVI.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMOrdersVI.Codeunit.al\n@@ -3215,6 +3215,42 @@\n Assert.IsFalse(SalesHeader.Find(), '');\n end;\n \n+ [Test]\n+ procedure ValueEntryTypeBlankOnPostingPurchase()\n+ var\n+ PurchaseHeader: Record \"Purchase Header\";\n+ PurchaseLine: Record \"Purchase Line\";\n+ ValueEntry: Record \"Value Entry\";\n+ begin\n+ // [SCENARIO 556628] Field \"Type\" in Value Entry for purchase is blank on posting.\n+ Initialize();\n+\n+ CreatePurchaseDocument(PurchaseHeader, PurchaseLine, PurchaseHeader.\"Document Type\"::Order, PurchaseLine.Type::Item, '', LibraryInventory.CreateItemNo(), 1);\n+ LibraryPurchase.PostPurchaseDocument(PurchaseHeader, true, true);\n+\n+ ValueEntry.SetRange(\"Item No.\", PurchaseLine.\"No.\");\n+ ValueEntry.FindFirst();\n+ ValueEntry.TestField(Type, ValueEntry.Type::\" \");\n+ end;\n+\n+ [Test]\n+ procedure ValueEntryTypeBlankOnPostingSales()\n+ var\n+ SalesHeader: Record \"Sales Header\";\n+ SalesLine: Record \"Sales Line\";\n+ ValueEntry: Record \"Value Entry\";\n+ begin\n+ // [SCENARIO 556628] Field \"Type\" in Value Entry for sales is blank on posting.\n+ Initialize();\n+\n+ CreateSalesDocument(SalesHeader, SalesLine, SalesHeader.\"Document Type\"::Order, SalesLine.Type::Item, '', LibraryInventory.CreateItemNo(), 1, '');\n+ LibrarySales.PostSalesDocument(SalesHeader, true, true);\n+\n+ ValueEntry.SetRange(\"Item No.\", SalesLine.\"No.\");\n+ ValueEntry.FindFirst();\n+ ValueEntry.TestField(Type, ValueEntry.Type::\" \");\n+ end;\n+\n local procedure Initialize()\n begin\n LibraryTestInitialize.OnTestInitialize(CODEUNIT::\"SCM Orders VI\");\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Assembly/Document/AssemblyOrders.Page.al b/App/Layers/W1/BaseApp/Assembly/Document/AssemblyOrders.Page.al\nindex 05f2dc4a32b..c2290e74f17 100644\n--- a/App/Layers/W1/BaseApp/Assembly/Document/AssemblyOrders.Page.al\n+++ b/App/Layers/W1/BaseApp/Assembly/Document/AssemblyOrders.Page.al\n@@ -16,7 +16,7 @@ using Microsoft.Warehouse.Ledger;\n \n page 902 \"Assembly Orders\"\n {\n- AdditionalSearchTerms = 'kitting order,kit sale';\n+ AdditionalSearchTerms = 'kitting order,kit sale,asm order';\n ApplicationArea = Assembly;\n Caption = 'Assembly Orders';\n CardPageID = \"Assembly Order\";\ndiff --git a/App/Layers/W1/BaseApp/Inventory/Item/ExportItemData.XmlPort.al b/App/Layers/W1/BaseApp/Inventory/Item/ExportItemData.XmlPort.al\nindex 2f2f41c66c3..5226d4582ba 100644\n--- a/App/Layers/W1/BaseApp/Inventory/Item/ExportItemData.XmlPort.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Item/ExportItemData.XmlPort.al\n@@ -32,7 +32,7 @@ xmlport 5801 \"Export Item Data\"\n tabledata \"Item Application Entry\" = rimd,\n tabledata \"Production Order\" = rimd,\n tabledata \"Prod. Order Line\" = rimd,\n- tabledata \"Value entry\" = rimd,\n+ tabledata \"Value Entry\" = rimd,\n tabledata \"Item Application Entry History\" = rimd,\n tabledata \"Capacity Ledger Entry\" = rimd,\n tabledata \"Avg. Cost Adjmt. Entry Point\" = rimd,\n@@ -1044,6 +1044,14 @@ xmlport 5801 \"Export Item Data\"\n }\n fieldelement(ValueEntry_Type; ValueEntry.Type)\n {\n+ trigger OnAfterAssignField()\n+ begin\n+ if ValueEntry.Type = ValueEntry.Type::\"Work Center\" then\n+ if not (ValueEntry.\"Item Ledger Entry Type\" in [ValueEntry.\"Item Ledger Entry Type\"::Output,\n+ ValueEntry.\"Item Ledger Entry Type\"::\" \"])\n+ then\n+ ValueEntry.Type := ValueEntry.Type::\" \";\n+ end;\n }\n fieldelement(ValueEntry_No; ValueEntry.\"No.\")\n {\ndiff --git a/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al b/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al\nindex a9357fe8da1..6cb31d26988 100644\n--- a/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al\n@@ -1530,6 +1530,7 @@ table 83 \"Item Journal Line\"\n field(5830; Type; Enum Microsoft.Manufacturing.Capacity.\"Capacity Type Journal\")\n {\n Caption = 'Type';\n+ InitValue = \" \";\n \n trigger OnValidate()\n begin\n"} From 37554887a57de84800f4e783fe6fab32c949b5d2 Mon Sep 17 00:00:00 2001 From: Jiawen Sun Date: Tue, 18 Nov 2025 21:02:17 +0100 Subject: [PATCH 4/7] 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 3f90b5d59..6eead0fae 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-201401", "base_commit": "c1c259bd038176f703ea589225b4a6cf9b7f198d", "created_at": "2024-11-28", "environment_setup_version": "25.5", "project_paths": ["App\\Layers\\W1\\BaseApp", "App\\Layers\\W1\\Tests\\SCM"], "hints_text": "", "FAIL_TO_PASS": [{"codeunitID": 137033, "functionName": ["InitValueOfTypeFieldOnItemJournalLine"]}, {"codeunitID": 137163, "functionName": ["ValueEntryTypeBlankOnPostingPurchase"]}, {"codeunitID": 137163, "functionName": ["ValueEntryTypeBlankOnPostingSales"]}], "PASS_TO_PASS": [], "problem_statement": "Title: Export/import item data tool replaces Type = for Value Entries with Type = Work Center.\nRepro Steps:\nPost assembly order Ensure that Type = ' ' on value entry for assembly output. Export item data Import it back. Type value for the assembly output is now \"Work Center\". The \"Work Center\" enum value is 0, which appears to be assigned when importing a blank (' ') value.\nDescription:\n\n", "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\nindex a2506b2d267..bd37d2498c5 100644\n--- a/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\n@@ -2173,6 +2173,18 @@\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+ [Test]\n+ procedure InitValueOfTypeFieldOnItemJournalLine()\n+ var\n+ ItemJournalLine: Record \"Item Journal Line\";\n+ begin\n+ // [SCENARIO] Init value of the Type field on Item Journal Line is .\n+ Initialize();\n+\n+ ItemJournalLine.Init();\n+ ItemJournalLine.TestField(Type, ItemJournalLine.Type::\" \");\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\ndiff --git a/App/Layers/W1/Tests/SCM/SCMOrdersVI.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMOrdersVI.Codeunit.al\nindex 1678946c4b5..99c2fe3eebe 100644\n--- a/App/Layers/W1/Tests/SCM/SCMOrdersVI.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMOrdersVI.Codeunit.al\n@@ -3215,6 +3215,42 @@\n Assert.IsFalse(SalesHeader.Find(), '');\n end;\n \n+ [Test]\n+ procedure ValueEntryTypeBlankOnPostingPurchase()\n+ var\n+ PurchaseHeader: Record \"Purchase Header\";\n+ PurchaseLine: Record \"Purchase Line\";\n+ ValueEntry: Record \"Value Entry\";\n+ begin\n+ // [SCENARIO 556628] Field \"Type\" in Value Entry for purchase is blank on posting.\n+ Initialize();\n+\n+ CreatePurchaseDocument(PurchaseHeader, PurchaseLine, PurchaseHeader.\"Document Type\"::Order, PurchaseLine.Type::Item, '', LibraryInventory.CreateItemNo(), 1);\n+ LibraryPurchase.PostPurchaseDocument(PurchaseHeader, true, true);\n+\n+ ValueEntry.SetRange(\"Item No.\", PurchaseLine.\"No.\");\n+ ValueEntry.FindFirst();\n+ ValueEntry.TestField(Type, ValueEntry.Type::\" \");\n+ end;\n+\n+ [Test]\n+ procedure ValueEntryTypeBlankOnPostingSales()\n+ var\n+ SalesHeader: Record \"Sales Header\";\n+ SalesLine: Record \"Sales Line\";\n+ ValueEntry: Record \"Value Entry\";\n+ begin\n+ // [SCENARIO 556628] Field \"Type\" in Value Entry for sales is blank on posting.\n+ Initialize();\n+\n+ CreateSalesDocument(SalesHeader, SalesLine, SalesHeader.\"Document Type\"::Order, SalesLine.Type::Item, '', LibraryInventory.CreateItemNo(), 1, '');\n+ LibrarySales.PostSalesDocument(SalesHeader, true, true);\n+\n+ ValueEntry.SetRange(\"Item No.\", SalesLine.\"No.\");\n+ ValueEntry.FindFirst();\n+ ValueEntry.TestField(Type, ValueEntry.Type::\" \");\n+ end;\n+\n local procedure Initialize()\n begin\n LibraryTestInitialize.OnTestInitialize(CODEUNIT::\"SCM Orders VI\");\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Assembly/Document/AssemblyOrders.Page.al b/App/Layers/W1/BaseApp/Assembly/Document/AssemblyOrders.Page.al\nindex 05f2dc4a32b..c2290e74f17 100644\n--- a/App/Layers/W1/BaseApp/Assembly/Document/AssemblyOrders.Page.al\n+++ b/App/Layers/W1/BaseApp/Assembly/Document/AssemblyOrders.Page.al\n@@ -16,7 +16,7 @@ using Microsoft.Warehouse.Ledger;\n \n page 902 \"Assembly Orders\"\n {\n- AdditionalSearchTerms = 'kitting order,kit sale';\n+ AdditionalSearchTerms = 'kitting order,kit sale,asm order';\n ApplicationArea = Assembly;\n Caption = 'Assembly Orders';\n CardPageID = \"Assembly Order\";\ndiff --git a/App/Layers/W1/BaseApp/Inventory/Item/ExportItemData.XmlPort.al b/App/Layers/W1/BaseApp/Inventory/Item/ExportItemData.XmlPort.al\nindex 2f2f41c66c3..5226d4582ba 100644\n--- a/App/Layers/W1/BaseApp/Inventory/Item/ExportItemData.XmlPort.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Item/ExportItemData.XmlPort.al\n@@ -32,7 +32,7 @@ xmlport 5801 \"Export Item Data\"\n tabledata \"Item Application Entry\" = rimd,\n tabledata \"Production Order\" = rimd,\n tabledata \"Prod. Order Line\" = rimd,\n- tabledata \"Value entry\" = rimd,\n+ tabledata \"Value Entry\" = rimd,\n tabledata \"Item Application Entry History\" = rimd,\n tabledata \"Capacity Ledger Entry\" = rimd,\n tabledata \"Avg. Cost Adjmt. Entry Point\" = rimd,\n@@ -1044,6 +1044,14 @@ xmlport 5801 \"Export Item Data\"\n }\n fieldelement(ValueEntry_Type; ValueEntry.Type)\n {\n+ trigger OnAfterAssignField()\n+ begin\n+ if ValueEntry.Type = ValueEntry.Type::\"Work Center\" then\n+ if not (ValueEntry.\"Item Ledger Entry Type\" in [ValueEntry.\"Item Ledger Entry Type\"::Output,\n+ ValueEntry.\"Item Ledger Entry Type\"::\" \"])\n+ then\n+ ValueEntry.Type := ValueEntry.Type::\" \";\n+ end;\n }\n fieldelement(ValueEntry_No; ValueEntry.\"No.\")\n {\ndiff --git a/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al b/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al\nindex a9357fe8da1..6cb31d26988 100644\n--- a/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al\n@@ -1530,6 +1530,7 @@ table 83 \"Item Journal Line\"\n field(5830; Type; Enum Microsoft.Manufacturing.Capacity.\"Capacity Type Journal\")\n {\n Caption = 'Type';\n+ InitValue = \" \";\n \n trigger OnValidate()\n begin\n"} +{"repo": "microsoftInternal/NAV", "instance_id": "microsoftInternal__NAV-201401", "base_commit": "c1c259bd038176f703ea589225b4a6cf9b7f198d", "created_at": "2024-11-28", "environment_setup_version": "25.0", "project_paths": ["App\\Layers\\W1\\BaseApp", "App\\Layers\\W1\\Tests\\SCM"], "hints_text": "", "FAIL_TO_PASS": [{"codeunitID": 137033, "functionName": ["InitValueOfTypeFieldOnItemJournalLine"]}, {"codeunitID": 137163, "functionName": ["ValueEntryTypeBlankOnPostingPurchase"]}, {"codeunitID": 137163, "functionName": ["ValueEntryTypeBlankOnPostingSales"]}], "PASS_TO_PASS": [], "problem_statement": "Title: Export/import item data tool replaces Type = for Value Entries with Type = Work Center.\nRepro Steps:\nPost assembly order Ensure that Type = ' ' on value entry for assembly output. Export item data Import it back. Type value for the assembly output is now \"Work Center\". The \"Work Center\" enum value is 0, which appears to be assigned when importing a blank (' ') value.\nDescription:\n\n", "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\nindex a2506b2d267..bd37d2498c5 100644\n--- a/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\n@@ -2173,6 +2173,18 @@\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+ [Test]\n+ procedure InitValueOfTypeFieldOnItemJournalLine()\n+ var\n+ ItemJournalLine: Record \"Item Journal Line\";\n+ begin\n+ // [SCENARIO] Init value of the Type field on Item Journal Line is .\n+ Initialize();\n+\n+ ItemJournalLine.Init();\n+ ItemJournalLine.TestField(Type, ItemJournalLine.Type::\" \");\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\ndiff --git a/App/Layers/W1/Tests/SCM/SCMOrdersVI.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMOrdersVI.Codeunit.al\nindex 1678946c4b5..99c2fe3eebe 100644\n--- a/App/Layers/W1/Tests/SCM/SCMOrdersVI.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMOrdersVI.Codeunit.al\n@@ -3215,6 +3215,42 @@\n Assert.IsFalse(SalesHeader.Find(), '');\n end;\n \n+ [Test]\n+ procedure ValueEntryTypeBlankOnPostingPurchase()\n+ var\n+ PurchaseHeader: Record \"Purchase Header\";\n+ PurchaseLine: Record \"Purchase Line\";\n+ ValueEntry: Record \"Value Entry\";\n+ begin\n+ // [SCENARIO 556628] Field \"Type\" in Value Entry for purchase is blank on posting.\n+ Initialize();\n+\n+ CreatePurchaseDocument(PurchaseHeader, PurchaseLine, PurchaseHeader.\"Document Type\"::Order, PurchaseLine.Type::Item, '', LibraryInventory.CreateItemNo(), 1);\n+ LibraryPurchase.PostPurchaseDocument(PurchaseHeader, true, true);\n+\n+ ValueEntry.SetRange(\"Item No.\", PurchaseLine.\"No.\");\n+ ValueEntry.FindFirst();\n+ ValueEntry.TestField(Type, ValueEntry.Type::\" \");\n+ end;\n+\n+ [Test]\n+ procedure ValueEntryTypeBlankOnPostingSales()\n+ var\n+ SalesHeader: Record \"Sales Header\";\n+ SalesLine: Record \"Sales Line\";\n+ ValueEntry: Record \"Value Entry\";\n+ begin\n+ // [SCENARIO 556628] Field \"Type\" in Value Entry for sales is blank on posting.\n+ Initialize();\n+\n+ CreateSalesDocument(SalesHeader, SalesLine, SalesHeader.\"Document Type\"::Order, SalesLine.Type::Item, '', LibraryInventory.CreateItemNo(), 1, '');\n+ LibrarySales.PostSalesDocument(SalesHeader, true, true);\n+\n+ ValueEntry.SetRange(\"Item No.\", SalesLine.\"No.\");\n+ ValueEntry.FindFirst();\n+ ValueEntry.TestField(Type, ValueEntry.Type::\" \");\n+ end;\n+\n local procedure Initialize()\n begin\n LibraryTestInitialize.OnTestInitialize(CODEUNIT::\"SCM Orders VI\");\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Assembly/Document/AssemblyOrders.Page.al b/App/Layers/W1/BaseApp/Assembly/Document/AssemblyOrders.Page.al\nindex 05f2dc4a32b..c2290e74f17 100644\n--- a/App/Layers/W1/BaseApp/Assembly/Document/AssemblyOrders.Page.al\n+++ b/App/Layers/W1/BaseApp/Assembly/Document/AssemblyOrders.Page.al\n@@ -16,7 +16,7 @@ using Microsoft.Warehouse.Ledger;\n \n page 902 \"Assembly Orders\"\n {\n- AdditionalSearchTerms = 'kitting order,kit sale';\n+ AdditionalSearchTerms = 'kitting order,kit sale,asm order';\n ApplicationArea = Assembly;\n Caption = 'Assembly Orders';\n CardPageID = \"Assembly Order\";\ndiff --git a/App/Layers/W1/BaseApp/Inventory/Item/ExportItemData.XmlPort.al b/App/Layers/W1/BaseApp/Inventory/Item/ExportItemData.XmlPort.al\nindex 2f2f41c66c3..5226d4582ba 100644\n--- a/App/Layers/W1/BaseApp/Inventory/Item/ExportItemData.XmlPort.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Item/ExportItemData.XmlPort.al\n@@ -32,7 +32,7 @@ xmlport 5801 \"Export Item Data\"\n tabledata \"Item Application Entry\" = rimd,\n tabledata \"Production Order\" = rimd,\n tabledata \"Prod. Order Line\" = rimd,\n- tabledata \"Value entry\" = rimd,\n+ tabledata \"Value Entry\" = rimd,\n tabledata \"Item Application Entry History\" = rimd,\n tabledata \"Capacity Ledger Entry\" = rimd,\n tabledata \"Avg. Cost Adjmt. Entry Point\" = rimd,\n@@ -1044,6 +1044,14 @@ xmlport 5801 \"Export Item Data\"\n }\n fieldelement(ValueEntry_Type; ValueEntry.Type)\n {\n+ trigger OnAfterAssignField()\n+ begin\n+ if ValueEntry.Type = ValueEntry.Type::\"Work Center\" then\n+ if not (ValueEntry.\"Item Ledger Entry Type\" in [ValueEntry.\"Item Ledger Entry Type\"::Output,\n+ ValueEntry.\"Item Ledger Entry Type\"::\" \"])\n+ then\n+ ValueEntry.Type := ValueEntry.Type::\" \";\n+ end;\n }\n fieldelement(ValueEntry_No; ValueEntry.\"No.\")\n {\ndiff --git a/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al b/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al\nindex a9357fe8da1..6cb31d26988 100644\n--- a/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al\n@@ -1530,6 +1530,7 @@ table 83 \"Item Journal Line\"\n field(5830; Type; Enum Microsoft.Manufacturing.Capacity.\"Capacity Type Journal\")\n {\n Caption = 'Type';\n+ InitValue = \" \";\n \n trigger OnValidate()\n begin\n"} From 8646811801e814c5acaef4ed1ca3178bb0c37ae6 Mon Sep 17 00:00:00 2001 From: Jiawen Sun Date: Wed, 19 Nov 2025 00:01:35 +0100 Subject: [PATCH 5/7] 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 6eead0fae..3074a9fec 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-201401", "base_commit": "c1c259bd038176f703ea589225b4a6cf9b7f198d", "created_at": "2024-11-28", "environment_setup_version": "25.0", "project_paths": ["App\\Layers\\W1\\BaseApp", "App\\Layers\\W1\\Tests\\SCM"], "hints_text": "", "FAIL_TO_PASS": [{"codeunitID": 137033, "functionName": ["InitValueOfTypeFieldOnItemJournalLine"]}, {"codeunitID": 137163, "functionName": ["ValueEntryTypeBlankOnPostingPurchase"]}, {"codeunitID": 137163, "functionName": ["ValueEntryTypeBlankOnPostingSales"]}], "PASS_TO_PASS": [], "problem_statement": "Title: Export/import item data tool replaces Type = for Value Entries with Type = Work Center.\nRepro Steps:\nPost assembly order Ensure that Type = ' ' on value entry for assembly output. Export item data Import it back. Type value for the assembly output is now \"Work Center\". The \"Work Center\" enum value is 0, which appears to be assigned when importing a blank (' ') value.\nDescription:\n\n", "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\nindex a2506b2d267..bd37d2498c5 100644\n--- a/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\n@@ -2173,6 +2173,18 @@\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+ [Test]\n+ procedure InitValueOfTypeFieldOnItemJournalLine()\n+ var\n+ ItemJournalLine: Record \"Item Journal Line\";\n+ begin\n+ // [SCENARIO] Init value of the Type field on Item Journal Line is .\n+ Initialize();\n+\n+ ItemJournalLine.Init();\n+ ItemJournalLine.TestField(Type, ItemJournalLine.Type::\" \");\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\ndiff --git a/App/Layers/W1/Tests/SCM/SCMOrdersVI.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMOrdersVI.Codeunit.al\nindex 1678946c4b5..99c2fe3eebe 100644\n--- a/App/Layers/W1/Tests/SCM/SCMOrdersVI.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMOrdersVI.Codeunit.al\n@@ -3215,6 +3215,42 @@\n Assert.IsFalse(SalesHeader.Find(), '');\n end;\n \n+ [Test]\n+ procedure ValueEntryTypeBlankOnPostingPurchase()\n+ var\n+ PurchaseHeader: Record \"Purchase Header\";\n+ PurchaseLine: Record \"Purchase Line\";\n+ ValueEntry: Record \"Value Entry\";\n+ begin\n+ // [SCENARIO 556628] Field \"Type\" in Value Entry for purchase is blank on posting.\n+ Initialize();\n+\n+ CreatePurchaseDocument(PurchaseHeader, PurchaseLine, PurchaseHeader.\"Document Type\"::Order, PurchaseLine.Type::Item, '', LibraryInventory.CreateItemNo(), 1);\n+ LibraryPurchase.PostPurchaseDocument(PurchaseHeader, true, true);\n+\n+ ValueEntry.SetRange(\"Item No.\", PurchaseLine.\"No.\");\n+ ValueEntry.FindFirst();\n+ ValueEntry.TestField(Type, ValueEntry.Type::\" \");\n+ end;\n+\n+ [Test]\n+ procedure ValueEntryTypeBlankOnPostingSales()\n+ var\n+ SalesHeader: Record \"Sales Header\";\n+ SalesLine: Record \"Sales Line\";\n+ ValueEntry: Record \"Value Entry\";\n+ begin\n+ // [SCENARIO 556628] Field \"Type\" in Value Entry for sales is blank on posting.\n+ Initialize();\n+\n+ CreateSalesDocument(SalesHeader, SalesLine, SalesHeader.\"Document Type\"::Order, SalesLine.Type::Item, '', LibraryInventory.CreateItemNo(), 1, '');\n+ LibrarySales.PostSalesDocument(SalesHeader, true, true);\n+\n+ ValueEntry.SetRange(\"Item No.\", SalesLine.\"No.\");\n+ ValueEntry.FindFirst();\n+ ValueEntry.TestField(Type, ValueEntry.Type::\" \");\n+ end;\n+\n local procedure Initialize()\n begin\n LibraryTestInitialize.OnTestInitialize(CODEUNIT::\"SCM Orders VI\");\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Assembly/Document/AssemblyOrders.Page.al b/App/Layers/W1/BaseApp/Assembly/Document/AssemblyOrders.Page.al\nindex 05f2dc4a32b..c2290e74f17 100644\n--- a/App/Layers/W1/BaseApp/Assembly/Document/AssemblyOrders.Page.al\n+++ b/App/Layers/W1/BaseApp/Assembly/Document/AssemblyOrders.Page.al\n@@ -16,7 +16,7 @@ using Microsoft.Warehouse.Ledger;\n \n page 902 \"Assembly Orders\"\n {\n- AdditionalSearchTerms = 'kitting order,kit sale';\n+ AdditionalSearchTerms = 'kitting order,kit sale,asm order';\n ApplicationArea = Assembly;\n Caption = 'Assembly Orders';\n CardPageID = \"Assembly Order\";\ndiff --git a/App/Layers/W1/BaseApp/Inventory/Item/ExportItemData.XmlPort.al b/App/Layers/W1/BaseApp/Inventory/Item/ExportItemData.XmlPort.al\nindex 2f2f41c66c3..5226d4582ba 100644\n--- a/App/Layers/W1/BaseApp/Inventory/Item/ExportItemData.XmlPort.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Item/ExportItemData.XmlPort.al\n@@ -32,7 +32,7 @@ xmlport 5801 \"Export Item Data\"\n tabledata \"Item Application Entry\" = rimd,\n tabledata \"Production Order\" = rimd,\n tabledata \"Prod. Order Line\" = rimd,\n- tabledata \"Value entry\" = rimd,\n+ tabledata \"Value Entry\" = rimd,\n tabledata \"Item Application Entry History\" = rimd,\n tabledata \"Capacity Ledger Entry\" = rimd,\n tabledata \"Avg. Cost Adjmt. Entry Point\" = rimd,\n@@ -1044,6 +1044,14 @@ xmlport 5801 \"Export Item Data\"\n }\n fieldelement(ValueEntry_Type; ValueEntry.Type)\n {\n+ trigger OnAfterAssignField()\n+ begin\n+ if ValueEntry.Type = ValueEntry.Type::\"Work Center\" then\n+ if not (ValueEntry.\"Item Ledger Entry Type\" in [ValueEntry.\"Item Ledger Entry Type\"::Output,\n+ ValueEntry.\"Item Ledger Entry Type\"::\" \"])\n+ then\n+ ValueEntry.Type := ValueEntry.Type::\" \";\n+ end;\n }\n fieldelement(ValueEntry_No; ValueEntry.\"No.\")\n {\ndiff --git a/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al b/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al\nindex a9357fe8da1..6cb31d26988 100644\n--- a/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al\n@@ -1530,6 +1530,7 @@ table 83 \"Item Journal Line\"\n field(5830; Type; Enum Microsoft.Manufacturing.Capacity.\"Capacity Type Journal\")\n {\n Caption = 'Type';\n+ InitValue = \" \";\n \n trigger OnValidate()\n begin\n"} +{"repo": "microsoftInternal/NAV", "instance_id": "microsoftInternal__NAV-201401", "base_commit": "c1c259bd038176f703ea589225b4a6cf9b7f198d", "created_at": "2024-11-28", "environment_setup_version": "24.5", "project_paths": ["App\\Layers\\W1\\BaseApp", "App\\Layers\\W1\\Tests\\SCM"], "hints_text": "", "FAIL_TO_PASS": [{"codeunitID": 137033, "functionName": ["InitValueOfTypeFieldOnItemJournalLine"]}, {"codeunitID": 137163, "functionName": ["ValueEntryTypeBlankOnPostingPurchase"]}, {"codeunitID": 137163, "functionName": ["ValueEntryTypeBlankOnPostingSales"]}], "PASS_TO_PASS": [], "problem_statement": "Title: Export/import item data tool replaces Type = for Value Entries with Type = Work Center.\nRepro Steps:\nPost assembly order Ensure that Type = ' ' on value entry for assembly output. Export item data Import it back. Type value for the assembly output is now \"Work Center\". The \"Work Center\" enum value is 0, which appears to be assigned when importing a blank (' ') value.\nDescription:\n\n", "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\nindex a2506b2d267..bd37d2498c5 100644\n--- a/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\n@@ -2173,6 +2173,18 @@\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+ [Test]\n+ procedure InitValueOfTypeFieldOnItemJournalLine()\n+ var\n+ ItemJournalLine: Record \"Item Journal Line\";\n+ begin\n+ // [SCENARIO] Init value of the Type field on Item Journal Line is .\n+ Initialize();\n+\n+ ItemJournalLine.Init();\n+ ItemJournalLine.TestField(Type, ItemJournalLine.Type::\" \");\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\ndiff --git a/App/Layers/W1/Tests/SCM/SCMOrdersVI.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMOrdersVI.Codeunit.al\nindex 1678946c4b5..99c2fe3eebe 100644\n--- a/App/Layers/W1/Tests/SCM/SCMOrdersVI.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMOrdersVI.Codeunit.al\n@@ -3215,6 +3215,42 @@\n Assert.IsFalse(SalesHeader.Find(), '');\n end;\n \n+ [Test]\n+ procedure ValueEntryTypeBlankOnPostingPurchase()\n+ var\n+ PurchaseHeader: Record \"Purchase Header\";\n+ PurchaseLine: Record \"Purchase Line\";\n+ ValueEntry: Record \"Value Entry\";\n+ begin\n+ // [SCENARIO 556628] Field \"Type\" in Value Entry for purchase is blank on posting.\n+ Initialize();\n+\n+ CreatePurchaseDocument(PurchaseHeader, PurchaseLine, PurchaseHeader.\"Document Type\"::Order, PurchaseLine.Type::Item, '', LibraryInventory.CreateItemNo(), 1);\n+ LibraryPurchase.PostPurchaseDocument(PurchaseHeader, true, true);\n+\n+ ValueEntry.SetRange(\"Item No.\", PurchaseLine.\"No.\");\n+ ValueEntry.FindFirst();\n+ ValueEntry.TestField(Type, ValueEntry.Type::\" \");\n+ end;\n+\n+ [Test]\n+ procedure ValueEntryTypeBlankOnPostingSales()\n+ var\n+ SalesHeader: Record \"Sales Header\";\n+ SalesLine: Record \"Sales Line\";\n+ ValueEntry: Record \"Value Entry\";\n+ begin\n+ // [SCENARIO 556628] Field \"Type\" in Value Entry for sales is blank on posting.\n+ Initialize();\n+\n+ CreateSalesDocument(SalesHeader, SalesLine, SalesHeader.\"Document Type\"::Order, SalesLine.Type::Item, '', LibraryInventory.CreateItemNo(), 1, '');\n+ LibrarySales.PostSalesDocument(SalesHeader, true, true);\n+\n+ ValueEntry.SetRange(\"Item No.\", SalesLine.\"No.\");\n+ ValueEntry.FindFirst();\n+ ValueEntry.TestField(Type, ValueEntry.Type::\" \");\n+ end;\n+\n local procedure Initialize()\n begin\n LibraryTestInitialize.OnTestInitialize(CODEUNIT::\"SCM Orders VI\");\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Assembly/Document/AssemblyOrders.Page.al b/App/Layers/W1/BaseApp/Assembly/Document/AssemblyOrders.Page.al\nindex 05f2dc4a32b..c2290e74f17 100644\n--- a/App/Layers/W1/BaseApp/Assembly/Document/AssemblyOrders.Page.al\n+++ b/App/Layers/W1/BaseApp/Assembly/Document/AssemblyOrders.Page.al\n@@ -16,7 +16,7 @@ using Microsoft.Warehouse.Ledger;\n \n page 902 \"Assembly Orders\"\n {\n- AdditionalSearchTerms = 'kitting order,kit sale';\n+ AdditionalSearchTerms = 'kitting order,kit sale,asm order';\n ApplicationArea = Assembly;\n Caption = 'Assembly Orders';\n CardPageID = \"Assembly Order\";\ndiff --git a/App/Layers/W1/BaseApp/Inventory/Item/ExportItemData.XmlPort.al b/App/Layers/W1/BaseApp/Inventory/Item/ExportItemData.XmlPort.al\nindex 2f2f41c66c3..5226d4582ba 100644\n--- a/App/Layers/W1/BaseApp/Inventory/Item/ExportItemData.XmlPort.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Item/ExportItemData.XmlPort.al\n@@ -32,7 +32,7 @@ xmlport 5801 \"Export Item Data\"\n tabledata \"Item Application Entry\" = rimd,\n tabledata \"Production Order\" = rimd,\n tabledata \"Prod. Order Line\" = rimd,\n- tabledata \"Value entry\" = rimd,\n+ tabledata \"Value Entry\" = rimd,\n tabledata \"Item Application Entry History\" = rimd,\n tabledata \"Capacity Ledger Entry\" = rimd,\n tabledata \"Avg. Cost Adjmt. Entry Point\" = rimd,\n@@ -1044,6 +1044,14 @@ xmlport 5801 \"Export Item Data\"\n }\n fieldelement(ValueEntry_Type; ValueEntry.Type)\n {\n+ trigger OnAfterAssignField()\n+ begin\n+ if ValueEntry.Type = ValueEntry.Type::\"Work Center\" then\n+ if not (ValueEntry.\"Item Ledger Entry Type\" in [ValueEntry.\"Item Ledger Entry Type\"::Output,\n+ ValueEntry.\"Item Ledger Entry Type\"::\" \"])\n+ then\n+ ValueEntry.Type := ValueEntry.Type::\" \";\n+ end;\n }\n fieldelement(ValueEntry_No; ValueEntry.\"No.\")\n {\ndiff --git a/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al b/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al\nindex a9357fe8da1..6cb31d26988 100644\n--- a/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al\n@@ -1530,6 +1530,7 @@ table 83 \"Item Journal Line\"\n field(5830; Type; Enum Microsoft.Manufacturing.Capacity.\"Capacity Type Journal\")\n {\n Caption = 'Type';\n+ InitValue = \" \";\n \n trigger OnValidate()\n begin\n"} From 30d529a487e1cc7ae53f10eb8a6fad8b12aff773 Mon Sep 17 00:00:00 2001 From: Jiawen Sun Date: Wed, 19 Nov 2025 00:47:08 +0100 Subject: [PATCH 6/7] 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 3074a9fec..5ed5b36a1 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-201401", "base_commit": "c1c259bd038176f703ea589225b4a6cf9b7f198d", "created_at": "2024-11-28", "environment_setup_version": "24.5", "project_paths": ["App\\Layers\\W1\\BaseApp", "App\\Layers\\W1\\Tests\\SCM"], "hints_text": "", "FAIL_TO_PASS": [{"codeunitID": 137033, "functionName": ["InitValueOfTypeFieldOnItemJournalLine"]}, {"codeunitID": 137163, "functionName": ["ValueEntryTypeBlankOnPostingPurchase"]}, {"codeunitID": 137163, "functionName": ["ValueEntryTypeBlankOnPostingSales"]}], "PASS_TO_PASS": [], "problem_statement": "Title: Export/import item data tool replaces Type = for Value Entries with Type = Work Center.\nRepro Steps:\nPost assembly order Ensure that Type = ' ' on value entry for assembly output. Export item data Import it back. Type value for the assembly output is now \"Work Center\". The \"Work Center\" enum value is 0, which appears to be assigned when importing a blank (' ') value.\nDescription:\n\n", "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\nindex a2506b2d267..bd37d2498c5 100644\n--- a/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\n@@ -2173,6 +2173,18 @@\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+ [Test]\n+ procedure InitValueOfTypeFieldOnItemJournalLine()\n+ var\n+ ItemJournalLine: Record \"Item Journal Line\";\n+ begin\n+ // [SCENARIO] Init value of the Type field on Item Journal Line is .\n+ Initialize();\n+\n+ ItemJournalLine.Init();\n+ ItemJournalLine.TestField(Type, ItemJournalLine.Type::\" \");\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\ndiff --git a/App/Layers/W1/Tests/SCM/SCMOrdersVI.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMOrdersVI.Codeunit.al\nindex 1678946c4b5..99c2fe3eebe 100644\n--- a/App/Layers/W1/Tests/SCM/SCMOrdersVI.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMOrdersVI.Codeunit.al\n@@ -3215,6 +3215,42 @@\n Assert.IsFalse(SalesHeader.Find(), '');\n end;\n \n+ [Test]\n+ procedure ValueEntryTypeBlankOnPostingPurchase()\n+ var\n+ PurchaseHeader: Record \"Purchase Header\";\n+ PurchaseLine: Record \"Purchase Line\";\n+ ValueEntry: Record \"Value Entry\";\n+ begin\n+ // [SCENARIO 556628] Field \"Type\" in Value Entry for purchase is blank on posting.\n+ Initialize();\n+\n+ CreatePurchaseDocument(PurchaseHeader, PurchaseLine, PurchaseHeader.\"Document Type\"::Order, PurchaseLine.Type::Item, '', LibraryInventory.CreateItemNo(), 1);\n+ LibraryPurchase.PostPurchaseDocument(PurchaseHeader, true, true);\n+\n+ ValueEntry.SetRange(\"Item No.\", PurchaseLine.\"No.\");\n+ ValueEntry.FindFirst();\n+ ValueEntry.TestField(Type, ValueEntry.Type::\" \");\n+ end;\n+\n+ [Test]\n+ procedure ValueEntryTypeBlankOnPostingSales()\n+ var\n+ SalesHeader: Record \"Sales Header\";\n+ SalesLine: Record \"Sales Line\";\n+ ValueEntry: Record \"Value Entry\";\n+ begin\n+ // [SCENARIO 556628] Field \"Type\" in Value Entry for sales is blank on posting.\n+ Initialize();\n+\n+ CreateSalesDocument(SalesHeader, SalesLine, SalesHeader.\"Document Type\"::Order, SalesLine.Type::Item, '', LibraryInventory.CreateItemNo(), 1, '');\n+ LibrarySales.PostSalesDocument(SalesHeader, true, true);\n+\n+ ValueEntry.SetRange(\"Item No.\", SalesLine.\"No.\");\n+ ValueEntry.FindFirst();\n+ ValueEntry.TestField(Type, ValueEntry.Type::\" \");\n+ end;\n+\n local procedure Initialize()\n begin\n LibraryTestInitialize.OnTestInitialize(CODEUNIT::\"SCM Orders VI\");\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Assembly/Document/AssemblyOrders.Page.al b/App/Layers/W1/BaseApp/Assembly/Document/AssemblyOrders.Page.al\nindex 05f2dc4a32b..c2290e74f17 100644\n--- a/App/Layers/W1/BaseApp/Assembly/Document/AssemblyOrders.Page.al\n+++ b/App/Layers/W1/BaseApp/Assembly/Document/AssemblyOrders.Page.al\n@@ -16,7 +16,7 @@ using Microsoft.Warehouse.Ledger;\n \n page 902 \"Assembly Orders\"\n {\n- AdditionalSearchTerms = 'kitting order,kit sale';\n+ AdditionalSearchTerms = 'kitting order,kit sale,asm order';\n ApplicationArea = Assembly;\n Caption = 'Assembly Orders';\n CardPageID = \"Assembly Order\";\ndiff --git a/App/Layers/W1/BaseApp/Inventory/Item/ExportItemData.XmlPort.al b/App/Layers/W1/BaseApp/Inventory/Item/ExportItemData.XmlPort.al\nindex 2f2f41c66c3..5226d4582ba 100644\n--- a/App/Layers/W1/BaseApp/Inventory/Item/ExportItemData.XmlPort.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Item/ExportItemData.XmlPort.al\n@@ -32,7 +32,7 @@ xmlport 5801 \"Export Item Data\"\n tabledata \"Item Application Entry\" = rimd,\n tabledata \"Production Order\" = rimd,\n tabledata \"Prod. Order Line\" = rimd,\n- tabledata \"Value entry\" = rimd,\n+ tabledata \"Value Entry\" = rimd,\n tabledata \"Item Application Entry History\" = rimd,\n tabledata \"Capacity Ledger Entry\" = rimd,\n tabledata \"Avg. Cost Adjmt. Entry Point\" = rimd,\n@@ -1044,6 +1044,14 @@ xmlport 5801 \"Export Item Data\"\n }\n fieldelement(ValueEntry_Type; ValueEntry.Type)\n {\n+ trigger OnAfterAssignField()\n+ begin\n+ if ValueEntry.Type = ValueEntry.Type::\"Work Center\" then\n+ if not (ValueEntry.\"Item Ledger Entry Type\" in [ValueEntry.\"Item Ledger Entry Type\"::Output,\n+ ValueEntry.\"Item Ledger Entry Type\"::\" \"])\n+ then\n+ ValueEntry.Type := ValueEntry.Type::\" \";\n+ end;\n }\n fieldelement(ValueEntry_No; ValueEntry.\"No.\")\n {\ndiff --git a/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al b/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al\nindex a9357fe8da1..6cb31d26988 100644\n--- a/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al\n@@ -1530,6 +1530,7 @@ table 83 \"Item Journal Line\"\n field(5830; Type; Enum Microsoft.Manufacturing.Capacity.\"Capacity Type Journal\")\n {\n Caption = 'Type';\n+ InitValue = \" \";\n \n trigger OnValidate()\n begin\n"} +{"repo": "microsoftInternal/NAV", "instance_id": "microsoftInternal__NAV-201401", "base_commit": "c1c259bd038176f703ea589225b4a6cf9b7f198d", "created_at": "2024-11-28", "environment_setup_version": "24.0", "project_paths": ["App\\Layers\\W1\\BaseApp", "App\\Layers\\W1\\Tests\\SCM"], "hints_text": "", "FAIL_TO_PASS": [{"codeunitID": 137033, "functionName": ["InitValueOfTypeFieldOnItemJournalLine"]}, {"codeunitID": 137163, "functionName": ["ValueEntryTypeBlankOnPostingPurchase"]}, {"codeunitID": 137163, "functionName": ["ValueEntryTypeBlankOnPostingSales"]}], "PASS_TO_PASS": [], "problem_statement": "Title: Export/import item data tool replaces Type = for Value Entries with Type = Work Center.\nRepro Steps:\nPost assembly order Ensure that Type = ' ' on value entry for assembly output. Export item data Import it back. Type value for the assembly output is now \"Work Center\". The \"Work Center\" enum value is 0, which appears to be assigned when importing a blank (' ') value.\nDescription:\n\n", "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\nindex a2506b2d267..bd37d2498c5 100644\n--- a/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\n@@ -2173,6 +2173,18 @@\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+ [Test]\n+ procedure InitValueOfTypeFieldOnItemJournalLine()\n+ var\n+ ItemJournalLine: Record \"Item Journal Line\";\n+ begin\n+ // [SCENARIO] Init value of the Type field on Item Journal Line is .\n+ Initialize();\n+\n+ ItemJournalLine.Init();\n+ ItemJournalLine.TestField(Type, ItemJournalLine.Type::\" \");\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\ndiff --git a/App/Layers/W1/Tests/SCM/SCMOrdersVI.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMOrdersVI.Codeunit.al\nindex 1678946c4b5..99c2fe3eebe 100644\n--- a/App/Layers/W1/Tests/SCM/SCMOrdersVI.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMOrdersVI.Codeunit.al\n@@ -3215,6 +3215,42 @@\n Assert.IsFalse(SalesHeader.Find(), '');\n end;\n \n+ [Test]\n+ procedure ValueEntryTypeBlankOnPostingPurchase()\n+ var\n+ PurchaseHeader: Record \"Purchase Header\";\n+ PurchaseLine: Record \"Purchase Line\";\n+ ValueEntry: Record \"Value Entry\";\n+ begin\n+ // [SCENARIO 556628] Field \"Type\" in Value Entry for purchase is blank on posting.\n+ Initialize();\n+\n+ CreatePurchaseDocument(PurchaseHeader, PurchaseLine, PurchaseHeader.\"Document Type\"::Order, PurchaseLine.Type::Item, '', LibraryInventory.CreateItemNo(), 1);\n+ LibraryPurchase.PostPurchaseDocument(PurchaseHeader, true, true);\n+\n+ ValueEntry.SetRange(\"Item No.\", PurchaseLine.\"No.\");\n+ ValueEntry.FindFirst();\n+ ValueEntry.TestField(Type, ValueEntry.Type::\" \");\n+ end;\n+\n+ [Test]\n+ procedure ValueEntryTypeBlankOnPostingSales()\n+ var\n+ SalesHeader: Record \"Sales Header\";\n+ SalesLine: Record \"Sales Line\";\n+ ValueEntry: Record \"Value Entry\";\n+ begin\n+ // [SCENARIO 556628] Field \"Type\" in Value Entry for sales is blank on posting.\n+ Initialize();\n+\n+ CreateSalesDocument(SalesHeader, SalesLine, SalesHeader.\"Document Type\"::Order, SalesLine.Type::Item, '', LibraryInventory.CreateItemNo(), 1, '');\n+ LibrarySales.PostSalesDocument(SalesHeader, true, true);\n+\n+ ValueEntry.SetRange(\"Item No.\", SalesLine.\"No.\");\n+ ValueEntry.FindFirst();\n+ ValueEntry.TestField(Type, ValueEntry.Type::\" \");\n+ end;\n+\n local procedure Initialize()\n begin\n LibraryTestInitialize.OnTestInitialize(CODEUNIT::\"SCM Orders VI\");\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Assembly/Document/AssemblyOrders.Page.al b/App/Layers/W1/BaseApp/Assembly/Document/AssemblyOrders.Page.al\nindex 05f2dc4a32b..c2290e74f17 100644\n--- a/App/Layers/W1/BaseApp/Assembly/Document/AssemblyOrders.Page.al\n+++ b/App/Layers/W1/BaseApp/Assembly/Document/AssemblyOrders.Page.al\n@@ -16,7 +16,7 @@ using Microsoft.Warehouse.Ledger;\n \n page 902 \"Assembly Orders\"\n {\n- AdditionalSearchTerms = 'kitting order,kit sale';\n+ AdditionalSearchTerms = 'kitting order,kit sale,asm order';\n ApplicationArea = Assembly;\n Caption = 'Assembly Orders';\n CardPageID = \"Assembly Order\";\ndiff --git a/App/Layers/W1/BaseApp/Inventory/Item/ExportItemData.XmlPort.al b/App/Layers/W1/BaseApp/Inventory/Item/ExportItemData.XmlPort.al\nindex 2f2f41c66c3..5226d4582ba 100644\n--- a/App/Layers/W1/BaseApp/Inventory/Item/ExportItemData.XmlPort.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Item/ExportItemData.XmlPort.al\n@@ -32,7 +32,7 @@ xmlport 5801 \"Export Item Data\"\n tabledata \"Item Application Entry\" = rimd,\n tabledata \"Production Order\" = rimd,\n tabledata \"Prod. Order Line\" = rimd,\n- tabledata \"Value entry\" = rimd,\n+ tabledata \"Value Entry\" = rimd,\n tabledata \"Item Application Entry History\" = rimd,\n tabledata \"Capacity Ledger Entry\" = rimd,\n tabledata \"Avg. Cost Adjmt. Entry Point\" = rimd,\n@@ -1044,6 +1044,14 @@ xmlport 5801 \"Export Item Data\"\n }\n fieldelement(ValueEntry_Type; ValueEntry.Type)\n {\n+ trigger OnAfterAssignField()\n+ begin\n+ if ValueEntry.Type = ValueEntry.Type::\"Work Center\" then\n+ if not (ValueEntry.\"Item Ledger Entry Type\" in [ValueEntry.\"Item Ledger Entry Type\"::Output,\n+ ValueEntry.\"Item Ledger Entry Type\"::\" \"])\n+ then\n+ ValueEntry.Type := ValueEntry.Type::\" \";\n+ end;\n }\n fieldelement(ValueEntry_No; ValueEntry.\"No.\")\n {\ndiff --git a/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al b/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al\nindex a9357fe8da1..6cb31d26988 100644\n--- a/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al\n@@ -1530,6 +1530,7 @@ table 83 \"Item Journal Line\"\n field(5830; Type; Enum Microsoft.Manufacturing.Capacity.\"Capacity Type Journal\")\n {\n Caption = 'Type';\n+ InitValue = \" \";\n \n trigger OnValidate()\n begin\n"} From bf77cdc0d4eb24d81a1c08961f01947fc0050edc Mon Sep 17 00:00:00 2001 From: "Haoran Sun (Business Central)" Date: Tue, 25 Nov 2025 08:19:36 +0100 Subject: [PATCH 7/7] try 25.4 --- 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 5ed5b36a1..aff0ed072 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-201401", "base_commit": "c1c259bd038176f703ea589225b4a6cf9b7f198d", "created_at": "2024-11-28", "environment_setup_version": "24.0", "project_paths": ["App\\Layers\\W1\\BaseApp", "App\\Layers\\W1\\Tests\\SCM"], "hints_text": "", "FAIL_TO_PASS": [{"codeunitID": 137033, "functionName": ["InitValueOfTypeFieldOnItemJournalLine"]}, {"codeunitID": 137163, "functionName": ["ValueEntryTypeBlankOnPostingPurchase"]}, {"codeunitID": 137163, "functionName": ["ValueEntryTypeBlankOnPostingSales"]}], "PASS_TO_PASS": [], "problem_statement": "Title: Export/import item data tool replaces Type = for Value Entries with Type = Work Center.\nRepro Steps:\nPost assembly order Ensure that Type = ' ' on value entry for assembly output. Export item data Import it back. Type value for the assembly output is now \"Work Center\". The \"Work Center\" enum value is 0, which appears to be assigned when importing a blank (' ') value.\nDescription:\n\n", "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\nindex a2506b2d267..bd37d2498c5 100644\n--- a/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\n@@ -2173,6 +2173,18 @@\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+ [Test]\n+ procedure InitValueOfTypeFieldOnItemJournalLine()\n+ var\n+ ItemJournalLine: Record \"Item Journal Line\";\n+ begin\n+ // [SCENARIO] Init value of the Type field on Item Journal Line is .\n+ Initialize();\n+\n+ ItemJournalLine.Init();\n+ ItemJournalLine.TestField(Type, ItemJournalLine.Type::\" \");\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\ndiff --git a/App/Layers/W1/Tests/SCM/SCMOrdersVI.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMOrdersVI.Codeunit.al\nindex 1678946c4b5..99c2fe3eebe 100644\n--- a/App/Layers/W1/Tests/SCM/SCMOrdersVI.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMOrdersVI.Codeunit.al\n@@ -3215,6 +3215,42 @@\n Assert.IsFalse(SalesHeader.Find(), '');\n end;\n \n+ [Test]\n+ procedure ValueEntryTypeBlankOnPostingPurchase()\n+ var\n+ PurchaseHeader: Record \"Purchase Header\";\n+ PurchaseLine: Record \"Purchase Line\";\n+ ValueEntry: Record \"Value Entry\";\n+ begin\n+ // [SCENARIO 556628] Field \"Type\" in Value Entry for purchase is blank on posting.\n+ Initialize();\n+\n+ CreatePurchaseDocument(PurchaseHeader, PurchaseLine, PurchaseHeader.\"Document Type\"::Order, PurchaseLine.Type::Item, '', LibraryInventory.CreateItemNo(), 1);\n+ LibraryPurchase.PostPurchaseDocument(PurchaseHeader, true, true);\n+\n+ ValueEntry.SetRange(\"Item No.\", PurchaseLine.\"No.\");\n+ ValueEntry.FindFirst();\n+ ValueEntry.TestField(Type, ValueEntry.Type::\" \");\n+ end;\n+\n+ [Test]\n+ procedure ValueEntryTypeBlankOnPostingSales()\n+ var\n+ SalesHeader: Record \"Sales Header\";\n+ SalesLine: Record \"Sales Line\";\n+ ValueEntry: Record \"Value Entry\";\n+ begin\n+ // [SCENARIO 556628] Field \"Type\" in Value Entry for sales is blank on posting.\n+ Initialize();\n+\n+ CreateSalesDocument(SalesHeader, SalesLine, SalesHeader.\"Document Type\"::Order, SalesLine.Type::Item, '', LibraryInventory.CreateItemNo(), 1, '');\n+ LibrarySales.PostSalesDocument(SalesHeader, true, true);\n+\n+ ValueEntry.SetRange(\"Item No.\", SalesLine.\"No.\");\n+ ValueEntry.FindFirst();\n+ ValueEntry.TestField(Type, ValueEntry.Type::\" \");\n+ end;\n+\n local procedure Initialize()\n begin\n LibraryTestInitialize.OnTestInitialize(CODEUNIT::\"SCM Orders VI\");\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Assembly/Document/AssemblyOrders.Page.al b/App/Layers/W1/BaseApp/Assembly/Document/AssemblyOrders.Page.al\nindex 05f2dc4a32b..c2290e74f17 100644\n--- a/App/Layers/W1/BaseApp/Assembly/Document/AssemblyOrders.Page.al\n+++ b/App/Layers/W1/BaseApp/Assembly/Document/AssemblyOrders.Page.al\n@@ -16,7 +16,7 @@ using Microsoft.Warehouse.Ledger;\n \n page 902 \"Assembly Orders\"\n {\n- AdditionalSearchTerms = 'kitting order,kit sale';\n+ AdditionalSearchTerms = 'kitting order,kit sale,asm order';\n ApplicationArea = Assembly;\n Caption = 'Assembly Orders';\n CardPageID = \"Assembly Order\";\ndiff --git a/App/Layers/W1/BaseApp/Inventory/Item/ExportItemData.XmlPort.al b/App/Layers/W1/BaseApp/Inventory/Item/ExportItemData.XmlPort.al\nindex 2f2f41c66c3..5226d4582ba 100644\n--- a/App/Layers/W1/BaseApp/Inventory/Item/ExportItemData.XmlPort.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Item/ExportItemData.XmlPort.al\n@@ -32,7 +32,7 @@ xmlport 5801 \"Export Item Data\"\n tabledata \"Item Application Entry\" = rimd,\n tabledata \"Production Order\" = rimd,\n tabledata \"Prod. Order Line\" = rimd,\n- tabledata \"Value entry\" = rimd,\n+ tabledata \"Value Entry\" = rimd,\n tabledata \"Item Application Entry History\" = rimd,\n tabledata \"Capacity Ledger Entry\" = rimd,\n tabledata \"Avg. Cost Adjmt. Entry Point\" = rimd,\n@@ -1044,6 +1044,14 @@ xmlport 5801 \"Export Item Data\"\n }\n fieldelement(ValueEntry_Type; ValueEntry.Type)\n {\n+ trigger OnAfterAssignField()\n+ begin\n+ if ValueEntry.Type = ValueEntry.Type::\"Work Center\" then\n+ if not (ValueEntry.\"Item Ledger Entry Type\" in [ValueEntry.\"Item Ledger Entry Type\"::Output,\n+ ValueEntry.\"Item Ledger Entry Type\"::\" \"])\n+ then\n+ ValueEntry.Type := ValueEntry.Type::\" \";\n+ end;\n }\n fieldelement(ValueEntry_No; ValueEntry.\"No.\")\n {\ndiff --git a/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al b/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al\nindex a9357fe8da1..6cb31d26988 100644\n--- a/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al\n@@ -1530,6 +1530,7 @@ table 83 \"Item Journal Line\"\n field(5830; Type; Enum Microsoft.Manufacturing.Capacity.\"Capacity Type Journal\")\n {\n Caption = 'Type';\n+ InitValue = \" \";\n \n trigger OnValidate()\n begin\n"} +{"repo": "microsoftInternal/NAV", "instance_id": "microsoftInternal__NAV-201401", "base_commit": "c1c259bd038176f703ea589225b4a6cf9b7f198d", "created_at": "2024-11-28", "environment_setup_version": "25.4", "project_paths": ["App\\Layers\\W1\\BaseApp", "App\\Layers\\W1\\Tests\\SCM"], "hints_text": "", "FAIL_TO_PASS": [{"codeunitID": 137033, "functionName": ["InitValueOfTypeFieldOnItemJournalLine"]}, {"codeunitID": 137163, "functionName": ["ValueEntryTypeBlankOnPostingPurchase"]}, {"codeunitID": 137163, "functionName": ["ValueEntryTypeBlankOnPostingSales"]}], "PASS_TO_PASS": [], "problem_statement": "Title: Export/import item data tool replaces Type = for Value Entries with Type = Work Center.\nRepro Steps:\nPost assembly order Ensure that Type = ' ' on value entry for assembly output. Export item data Import it back. Type value for the assembly output is now \"Work Center\". The \"Work Center\" enum value is 0, which appears to be assigned when importing a blank (' ') value.\nDescription:\n\n", "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\nindex a2506b2d267..bd37d2498c5 100644\n--- a/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMItemJournal.Codeunit.al\n@@ -2173,6 +2173,18 @@\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+ [Test]\n+ procedure InitValueOfTypeFieldOnItemJournalLine()\n+ var\n+ ItemJournalLine: Record \"Item Journal Line\";\n+ begin\n+ // [SCENARIO] Init value of the Type field on Item Journal Line is .\n+ Initialize();\n+\n+ ItemJournalLine.Init();\n+ ItemJournalLine.TestField(Type, ItemJournalLine.Type::\" \");\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\ndiff --git a/App/Layers/W1/Tests/SCM/SCMOrdersVI.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMOrdersVI.Codeunit.al\nindex 1678946c4b5..99c2fe3eebe 100644\n--- a/App/Layers/W1/Tests/SCM/SCMOrdersVI.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMOrdersVI.Codeunit.al\n@@ -3215,6 +3215,42 @@\n Assert.IsFalse(SalesHeader.Find(), '');\n end;\n \n+ [Test]\n+ procedure ValueEntryTypeBlankOnPostingPurchase()\n+ var\n+ PurchaseHeader: Record \"Purchase Header\";\n+ PurchaseLine: Record \"Purchase Line\";\n+ ValueEntry: Record \"Value Entry\";\n+ begin\n+ // [SCENARIO 556628] Field \"Type\" in Value Entry for purchase is blank on posting.\n+ Initialize();\n+\n+ CreatePurchaseDocument(PurchaseHeader, PurchaseLine, PurchaseHeader.\"Document Type\"::Order, PurchaseLine.Type::Item, '', LibraryInventory.CreateItemNo(), 1);\n+ LibraryPurchase.PostPurchaseDocument(PurchaseHeader, true, true);\n+\n+ ValueEntry.SetRange(\"Item No.\", PurchaseLine.\"No.\");\n+ ValueEntry.FindFirst();\n+ ValueEntry.TestField(Type, ValueEntry.Type::\" \");\n+ end;\n+\n+ [Test]\n+ procedure ValueEntryTypeBlankOnPostingSales()\n+ var\n+ SalesHeader: Record \"Sales Header\";\n+ SalesLine: Record \"Sales Line\";\n+ ValueEntry: Record \"Value Entry\";\n+ begin\n+ // [SCENARIO 556628] Field \"Type\" in Value Entry for sales is blank on posting.\n+ Initialize();\n+\n+ CreateSalesDocument(SalesHeader, SalesLine, SalesHeader.\"Document Type\"::Order, SalesLine.Type::Item, '', LibraryInventory.CreateItemNo(), 1, '');\n+ LibrarySales.PostSalesDocument(SalesHeader, true, true);\n+\n+ ValueEntry.SetRange(\"Item No.\", SalesLine.\"No.\");\n+ ValueEntry.FindFirst();\n+ ValueEntry.TestField(Type, ValueEntry.Type::\" \");\n+ end;\n+\n local procedure Initialize()\n begin\n LibraryTestInitialize.OnTestInitialize(CODEUNIT::\"SCM Orders VI\");\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Assembly/Document/AssemblyOrders.Page.al b/App/Layers/W1/BaseApp/Assembly/Document/AssemblyOrders.Page.al\nindex 05f2dc4a32b..c2290e74f17 100644\n--- a/App/Layers/W1/BaseApp/Assembly/Document/AssemblyOrders.Page.al\n+++ b/App/Layers/W1/BaseApp/Assembly/Document/AssemblyOrders.Page.al\n@@ -16,7 +16,7 @@ using Microsoft.Warehouse.Ledger;\n \n page 902 \"Assembly Orders\"\n {\n- AdditionalSearchTerms = 'kitting order,kit sale';\n+ AdditionalSearchTerms = 'kitting order,kit sale,asm order';\n ApplicationArea = Assembly;\n Caption = 'Assembly Orders';\n CardPageID = \"Assembly Order\";\ndiff --git a/App/Layers/W1/BaseApp/Inventory/Item/ExportItemData.XmlPort.al b/App/Layers/W1/BaseApp/Inventory/Item/ExportItemData.XmlPort.al\nindex 2f2f41c66c3..5226d4582ba 100644\n--- a/App/Layers/W1/BaseApp/Inventory/Item/ExportItemData.XmlPort.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Item/ExportItemData.XmlPort.al\n@@ -32,7 +32,7 @@ xmlport 5801 \"Export Item Data\"\n tabledata \"Item Application Entry\" = rimd,\n tabledata \"Production Order\" = rimd,\n tabledata \"Prod. Order Line\" = rimd,\n- tabledata \"Value entry\" = rimd,\n+ tabledata \"Value Entry\" = rimd,\n tabledata \"Item Application Entry History\" = rimd,\n tabledata \"Capacity Ledger Entry\" = rimd,\n tabledata \"Avg. Cost Adjmt. Entry Point\" = rimd,\n@@ -1044,6 +1044,14 @@ xmlport 5801 \"Export Item Data\"\n }\n fieldelement(ValueEntry_Type; ValueEntry.Type)\n {\n+ trigger OnAfterAssignField()\n+ begin\n+ if ValueEntry.Type = ValueEntry.Type::\"Work Center\" then\n+ if not (ValueEntry.\"Item Ledger Entry Type\" in [ValueEntry.\"Item Ledger Entry Type\"::Output,\n+ ValueEntry.\"Item Ledger Entry Type\"::\" \"])\n+ then\n+ ValueEntry.Type := ValueEntry.Type::\" \";\n+ end;\n }\n fieldelement(ValueEntry_No; ValueEntry.\"No.\")\n {\ndiff --git a/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al b/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al\nindex a9357fe8da1..6cb31d26988 100644\n--- a/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al\n@@ -1530,6 +1530,7 @@ table 83 \"Item Journal Line\"\n field(5830; Type; Enum Microsoft.Manufacturing.Capacity.\"Capacity Type Journal\")\n {\n Caption = 'Type';\n+ InitValue = \" \";\n \n trigger OnValidate()\n begin\n"}