diff --git a/.github/actions/setup-bc-container/action.yml b/.github/actions/setup-bc-container/action.yml index eb2059344..5bf786644 100644 --- a/.github/actions/setup-bc-container/action.yml +++ b/.github/actions/setup-bc-container/action.yml @@ -32,7 +32,16 @@ runs: # Mask the password in GitHub Actions logs Write-Output "::add-mask::$password" - "BC_CONTAINER_NAME=bcbench-$("${{ inputs.instance-id }}".Split('-')[1])" | Out-File -FilePath $env:GITHUB_ENV -Append + # Extract numeric ticket ID from instance-id, ignoring __cf-N suffix for counterfactual entries + # e.g. "microsoftInternal__NAV-210528__cf-1" -> "210528", "microsoft__BCApps-4699" -> "4699" + $instanceId = "${{ inputs.instance-id }}" + if ($instanceId -match '[A-Za-z]+-(\d+)') { + $ticketNumber = $Matches[1] + } else { + $ticketNumber = $instanceId.Split('-')[1] + } + + "BC_CONTAINER_NAME=bcbench-$ticketNumber" | Out-File -FilePath $env:GITHUB_ENV -Append "BC_CONTAINER_USERNAME=admin" | Out-File -FilePath $env:GITHUB_ENV -Append "BC_CONTAINER_PASSWORD=$password" | Out-File -FilePath $env:GITHUB_ENV -Append shell: pwsh diff --git a/.github/prompts/create-counterfactual.prompt.md b/.github/prompts/create-counterfactual.prompt.md new file mode 100644 index 000000000..735bd98ea --- /dev/null +++ b/.github/prompts/create-counterfactual.prompt.md @@ -0,0 +1,87 @@ +--- +description: "Create counterfactual (CF) dataset entries for BC-Bench. Provide the base instance_id and describe the code changes for each variant." +mode: agent +--- + +# Create Counterfactual Dataset Entries + +You are helping create counterfactual (CF) entries for the BC-Bench benchmark dataset. + +## Context + +Read these files first to understand the workflow: +- `COUNTERFACTUAL.md` — authoring guide +- `dataset/bcbench.jsonl` — find the base entry by instance_id +- `dataset/counterfactual.jsonl` — existing CF entries (match format/key ordering) + +## Input Required from User + +The user will provide: +1. **Base instance_id** — e.g. `microsoftInternal__NAV-224009` +2. **CF variants** — for each variant: + - What code changes to make in `test/after/` (test modifications) + - What code changes to make in `fix/after/` (fix modifications, often unchanged) + - A short variant description + - The intervention type (`test-spec-change`, `fix-scope-change`, etc.) +3. **Problem statement** — either a pre-written README path or content to generate + +## Workflow (per variant) + +### Step 1: Analyze the base entry +```bash +python -c "import json; [print(json.dumps(json.loads(l), indent=2)) for l in open('dataset/bcbench.jsonl') if '' in l]" +``` +- Understand the patch (fix) and test_patch (test) diffs +- Read the base problem statement from `dataset/problemstatement//README.md` + +### Step 2: Extract workspace +```bash +uv run bcbench dataset cf-extract -o cf- +``` +- Patch-only mode creates padded files — use `Get-Content ... | Where-Object { $_.Trim() }` to view content + +### Step 3: Edit the after/ files +- Apply the user's described code changes to `test/after/` and/or `fix/after/` +- If the fix needs to be **reversed** (e.g. CF removes a filter instead of adding one), swap fix/before and fix/after contents: + ```powershell + $before = Get-Content "fix\before\" -Raw + $after = Get-Content "fix\after\" -Raw + Set-Content "fix\before\" -Value $after -NoNewline + Set-Content "fix\after\" -Value $before -NoNewline + ``` +- Verify edits with `Get-Content ... | Where-Object { $_.Trim() }` + +### Step 4: Create the CF entry +```bash +uv run bcbench dataset cf-create ./cf- \ + -d "" \ + -t "" +``` + +**This command automatically handles:** +- Patch regeneration from before/after files +- `FAIL_TO_PASS` auto-detection from [Test] procedures in test patch +- `PASS_TO_PASS` auto-population from the base entry +- Canonical key ordering in counterfactual.jsonl +- Problem statement directory scaffolding (copies base README **and all image/asset files** as template) + +### Step 5: Edit problem statement README +- If user provided a pre-written README, copy it to the scaffolded directory at `dataset/problemstatement//README.md` +- Otherwise, edit the scaffolded README to describe the variant +- **Images & assets are copied automatically** by `cf-create`. Verify with `Get-ChildItem dataset/problemstatement//` that all referenced images are present. + +### Step 6: Verify +```bash +uv run pytest tests/test_dataset_integrity.py tests/test_counterfactual.py -q +``` +Confirm all tests pass. Then briefly show the created entry's key fields. + +## Key Rules +- Fix patch is usually **unchanged** from base (same bug fix, different test scenario) +- If the CF requires a **different** fix, the fix/after file should contain the CF's gold fix code +- Test patch is the primary thing that changes between variants +- **No manual key reordering needed** — cf-create handles this automatically +- **No manual PASS_TO_PASS needed** — cf-create copies from base entry automatically +- Problem statement directory naming: `__cf-N` (double underscore + hyphen) + +{{{ input }}} diff --git a/.github/workflows/claude-evaluation.yml b/.github/workflows/claude-evaluation.yml index c523be844..d4cc328c6 100644 --- a/.github/workflows/claude-evaluation.yml +++ b/.github/workflows/claude-evaluation.yml @@ -23,6 +23,7 @@ on: options: - "bug-fix" - "test-generation" + - "counterfactual-evaluation" test-run: description: "Indicate this is a test run (with few entries)" required: false diff --git a/.github/workflows/copilot-evaluation.yml b/.github/workflows/copilot-evaluation.yml index d82914c12..46ec50421 100644 --- a/.github/workflows/copilot-evaluation.yml +++ b/.github/workflows/copilot-evaluation.yml @@ -31,6 +31,7 @@ on: options: - "bug-fix" - "test-generation" + - "counterfactual-evaluation" test-run: description: "Indicate this is a test run (with few entries)" required: false diff --git a/.github/workflows/dataset-validation.yml b/.github/workflows/dataset-validation.yml index d2d0900a1..d8c5ee6bc 100644 --- a/.github/workflows/dataset-validation.yml +++ b/.github/workflows/dataset-validation.yml @@ -3,6 +3,11 @@ permissions: contents: read on: + push: + branches: + - master_thesis + paths: + - "dataset/**" workflow_dispatch: inputs: test-run: @@ -10,6 +15,11 @@ on: required: false default: true type: boolean + base-ref: + description: "Git ref to diff against for modified-only (e.g., HEAD~1)" + required: false + default: "origin/main" + type: string schedule: - cron: "0 0 * * 0" # Weekly on Sundays at midnight @@ -17,7 +27,8 @@ jobs: get-entries: uses: ./.github/workflows/get-entries.yml with: - modified-only: false + modified-only: ${{ github.event_name == 'push' }} + base-ref: ${{ inputs.base-ref || 'HEAD~1' }} test-run: ${{ inputs.test-run || false }} verify-build-and-tests: diff --git a/.github/workflows/get-entries.yml b/.github/workflows/get-entries.yml index 10a44edf1..5c2ab1584 100644 --- a/.github/workflows/get-entries.yml +++ b/.github/workflows/get-entries.yml @@ -10,11 +10,21 @@ on: required: false type: boolean default: false + base-ref: + description: Git ref to diff against when using modified-only (e.g., HEAD~1, a commit SHA) + required: false + type: string + default: origin/main test-run: description: Indicate this is a test run (with 2 entries) required: false type: boolean default: false + include-counterfactual: + description: Include counterfactual entries from counterfactual.jsonl + required: false + type: boolean + default: true outputs: entries: description: JSON array of dataset entries @@ -40,9 +50,13 @@ jobs: cmd="uv run bcbench dataset list --github-output entries" if [[ "${{ inputs.modified-only }}" == "true" ]]; then - cmd="$cmd --modified-only" + cmd="$cmd --modified-only --base-ref '${{ inputs.base-ref }}'" elif [[ "${{ inputs.test-run }}" == "true" ]]; then cmd="$cmd --test-run" fi + if [[ "${{ inputs.include-counterfactual }}" == "false" ]]; then + cmd="$cmd --no-include-counterfactual" + fi + eval "$cmd" diff --git a/COUNTERFACTUAL.md b/COUNTERFACTUAL.md new file mode 100644 index 000000000..2a97d21b0 --- /dev/null +++ b/COUNTERFACTUAL.md @@ -0,0 +1,187 @@ +# Counterfactual Dataset Authoring + +This guide explains **what counterfactual (CF) entries are** and how to create them using the `bcbench dataset` CLI commands. + +## What Are Counterfactual Entries? + +A counterfactual entry is a **variant** of an existing base benchmark entry. It reuses the same repository state (repo, base commit, project paths) but provides a **different fix and test pair** — testing whether an agent can solve a related-but-different version of the same bug. + +Each CF entry lives in [`dataset/counterfactual.jsonl`](dataset/counterfactual.jsonl) and references a base entry from [`dataset/bcbench.jsonl`](dataset/bcbench.jsonl). + +**Example:** Base entry tests that all 4 emission fields are enabled. A CF variant tests that only 3 of 4 fields are required. + +### Naming Convention + +CF entries follow the pattern: `__cf-` + +``` +microsoftInternal__NAV-210528 ← base entry +microsoftInternal__NAV-210528__cf-1 ← first counterfactual variant +microsoftInternal__NAV-210528__cf-2 ← second variant +``` + +## Authoring Workflow + +The workflow has two steps: **extract** a workspace, **edit** the code, then **create** the CF entry. + +### Step 1: Extract a workspace + +```bash +uv run bcbench dataset cf-extract --output-dir ./my-cf-workspace +``` + +This creates a workspace directory with editable AL files: + +``` +my-cf-workspace/ +├── fix/ +│ ├── before/ # Original code before the fix +│ │ └── .al +│ └── after/ # Fixed code — EDIT THIS +│ └── .al +├── test/ +│ ├── before/ # Original test code before the fix +│ │ └── .al +│ └── after/ # Test code — EDIT THIS +│ └── .al +└── workspace.json # Metadata (entry ID, file list, mode) +``` + +**Options:** + +| Flag | Description | +| -------------------- | ------------------------------------------------------------------------------------------ | +| `--output-dir`, `-o` | Directory to create workspace in (default: `cf-workspace`) | +| `--repo-path`, `-r` | Path to cloned repo for full-fidelity extraction (extracts complete files, not just hunks) | + +**Modes:** + +- **Patch-only** (default, no `--repo-path`): Reconstructs files from patch hunks only. Files are padded with empty lines to preserve original line numbers. Fast, no repo needed. +- **Repo-based** (`--repo-path` provided): Checks out the base commit, copies full before/after files. Full fidelity, but requires a local clone. + +### Step 2: Edit the code + +Open the workspace and modify the `after/` files: + +- **`fix/after/`** — Change the fix (the code the agent needs to produce) +- **`test/after/`** — Change the tests (what defines success/failure) + +Leave the `before/` files unchanged — they represent the original state. + +### Step 3: Create the CF entry + +```bash +uv run bcbench dataset cf-create ./my-cf-workspace \ + --variant-description "Only 3 of 4 emission fields required" \ + --intervention-type "test-spec-change" +``` + +This command: +1. Regenerates patches from your edited `before/` and `after/` files +2. Auto-detects `FAIL_TO_PASS` test procedures from the test patch +3. Assigns the next available `__cf-N` ID +4. Scaffolds a problem statement directory (copies base entry's README.md as template) +5. Appends the new entry to `dataset/counterfactual.jsonl` + +**Options:** + +| Flag | Description | +| ----------------------------- | ----------------------------------------------------------------------------- | +| `--variant-description`, `-d` | **Required.** Description of what this variant changes | +| `--intervention-type`, `-t` | Optional. Type of intervention (e.g., `test-spec-change`, `fix-scope-change`) | + +### Step 4: Edit the problem statement + +After creation, edit the scaffolded problem statement: + +``` +dataset/problemstatement//README.md +``` + +This is copied from the base entry — update it to describe the counterfactual variant's specific requirements. + +### Step 5: Commit and PR + +```bash +git add dataset/counterfactual.jsonl dataset/problemstatement/ +git commit -m "Add counterfactual variant: " +``` + +## Full Example + +```bash +# 1. Extract workspace from a base entry +uv run bcbench dataset cf-extract microsoftInternal__NAV-210528 --output-dir ./cf-sustainability + +# 2. Edit the test to only check 3 emission fields instead of 4 +# (open cf-sustainability/test/after/...SustCertificateTest.Codeunit.al and edit) + +# 3. Edit the fix to only enable 3 fields +# (open cf-sustainability/fix/after/...SustainabilitySetup.Table.al and edit) + +# 4. Create the CF entry +uv run bcbench dataset cf-create ./cf-sustainability \ + -d "Only 3 of 4 emission fields required: omits Work/Machine Center Emissions" \ + -t "test-spec-change" + +# 5. Edit the problem statement +# (edit dataset/problemstatement/microsoftInternal__NAV-210528__cf-1/README.md) + +# 6. Commit +git add dataset/ && git commit -m "Add CF variant for NAV-210528" +``` + +## Evaluating CF Entries + +CF entries are evaluated using the same pipeline as bug-fix entries: + +```bash +# Run agent on a CF entry +uv run bcbench run copilot microsoftInternal__NAV-210528__cf-1 \ + --category counterfactual-evaluation \ + --repo-path /path/to/NAV + +# Full evaluation (build + test) +uv run bcbench evaluate copilot microsoftInternal__NAV-210528__cf-1 \ + --category counterfactual-evaluation \ + --repo-path /path/to/NAV +``` + +The `--category counterfactual-evaluation` flag tells BC-Bench to use the CF entry's patches and tests for evaluation. The system auto-detects CF entries by their `__cf-N` suffix. + +## Listing CF Entries + +```bash +# List all entries (includes CF entries by default) +uv run bcbench dataset list + +# List without CF entries +uv run bcbench dataset list --no-include-counterfactual +``` + +## File Reference + +| File | Purpose | +| ---------------------------------------------------------------------------------------------- | ---------------------------------------------------------- | +| [`dataset/counterfactual.jsonl`](dataset/counterfactual.jsonl) | All CF entries (one JSON per line) | +| [`dataset/problemstatement//`](dataset/problemstatement/) | Problem statement for each CF entry | +| [`src/bcbench/dataset/cf_workspace.py`](src/bcbench/dataset/cf_workspace.py) | Core logic: extraction, patch regeneration, entry creation | +| [`src/bcbench/dataset/counterfactual_entry.py`](src/bcbench/dataset/counterfactual_entry.py) | CF entry Pydantic model | +| [`src/bcbench/dataset/counterfactual_loader.py`](src/bcbench/dataset/counterfactual_loader.py) | Loader for CF entries | +| [`src/bcbench/commands/dataset.py`](src/bcbench/commands/dataset.py) | CLI commands (`cf-extract`, `cf-create`) | + +## CF Entry Schema + +Each line in `counterfactual.jsonl` contains: + +| Field | Description | +| ---------------------------- | ------------------------------------------------- | +| `instance_id` | `__cf-` — unique identifier | +| `base_instance_id` | ID of the base entry this variant is derived from | +| `variant_description` | Human-readable description of the variant | +| `intervention_type` | Optional categorization of the change type | +| `patch` | The counterfactual fix patch | +| `test_patch` | The counterfactual test patch | +| `FAIL_TO_PASS` | Tests that must fail before fix, pass after | +| `PASS_TO_PASS` | Tests that must pass both before and after | +| `problem_statement_override` | Path to the CF-specific problem statement | diff --git a/dataset/counterfactual.jsonl b/dataset/counterfactual.jsonl new file mode 100644 index 000000000..0d72c6b19 --- /dev/null +++ b/dataset/counterfactual.jsonl @@ -0,0 +1,199 @@ +{"instance_id": "microsoftInternal__NAV-210528__cf-1", "base_instance_id": "microsoftInternal__NAV-210528", "variant_description": "Only 3 of 4 emission fields required: omits Work/Machine Center Emissions", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-210528__cf-1", "FAIL_TO_PASS": [{"codeunitID": 148187, "functionName": ["VerifyPurchDocAndItemAndResourceEmissionsEnabledWithValueChainTracking"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Apps/W1/Sustainability/test/src/SustCertificateTest.Codeunit.al b/App/Apps/W1/Sustainability/test/src/SustCertificateTest.Codeunit.al\nindex ff9b7640fa2..cf00000001 100644\n--- a/App/Apps/W1/Sustainability/test/src/SustCertificateTest.Codeunit.al\n+++ b/App/Apps/W1/Sustainability/test/src/SustCertificateTest.Codeunit.al\n@@ -5123,6 +5123,39 @@ codeunit 148187 \"Sust. Certificate Test\"\n // [THEN] Confirmation Box should not pop up as there is no confirm Handler. \n end;\n \n+ [Test]\n+ [HandlerFunctions('ConfirmHandlerYes')]\n+ procedure VerifyPurchDocAndItemAndResourceEmissionsEnabledWithValueChainTracking()\n+ var\n+ SustainabilitySetup: Record \"Sustainability Setup\";\n+ begin\n+ // [SCENARIO] Verify \"Use Emissions In Purch. Doc.\", \"Item Emissions\", \"Resource Emissions\"\n+ // must be enabled when \"Enable Value Chain Tracking\" is enabled.\n+ LibrarySustainability.CleanUpBeforeTesting();\n+\n+ // [GIVEN] Update Sustainability Setup.\n+ SustainabilitySetup.Get();\n+ SustainabilitySetup.Validate(\"Use Emissions In Purch. Doc.\", false);\n+ SustainabilitySetup.Validate(\"Item Emissions\", false);\n+ SustainabilitySetup.Validate(\"Resource Emissions\", false);\n+ SustainabilitySetup.Validate(\"Work/Machine Center Emissions\", false);\n+ SustainabilitySetup.Validate(\"Enable Value Chain Tracking\", false);\n+ SustainabilitySetup.Modify();\n+\n+ // [WHEN] \"Enable Value Chain Tracking\" set to true in Sustainability Setup.\n+ SustainabilitySetup.Validate(\"Enable Value Chain Tracking\", true);\n+\n+ // [THEN] Verify only 3 emission fields are auto-enabled.\n+ Assert.AreEqual(\n+ true,\n+ SustainabilitySetup.\"Use Emissions In Purch. Doc.\",\n+ StrSubstNo(FieldShouldBeEnabledErr, SustainabilitySetup.FieldCaption(\"Use Emissions In Purch. Doc.\"), SustainabilitySetup.TableCaption()));\n+ Assert.AreEqual(\n+ true,\n+ SustainabilitySetup.\"Item Emissions\",\n+ StrSubstNo(FieldShouldBeEnabledErr, SustainabilitySetup.FieldCaption(\"Item Emissions\"), SustainabilitySetup.TableCaption()));\n+ Assert.AreEqual(\n+ true,\n+ SustainabilitySetup.\"Resource Emissions\",\n+ StrSubstNo(FieldShouldBeEnabledErr, SustainabilitySetup.FieldCaption(\"Resource Emissions\"), SustainabilitySetup.TableCaption()));\n+ end;\n+\n local procedure CreateSustainabilityAccount(var AccountCode: Code[20]; var CategoryCode: Code[20]; var SubcategoryCode: Code[20]; i: Integer): Record \"Sustainability Account\"\n begin\n CreateSustainabilitySubcategory(CategoryCode, SubcategoryCode, i);\n", "patch": "diff --git a/App/Apps/W1/Sustainability/app/src/Setup/SustainabilitySetup.Table.al b/App/Apps/W1/Sustainability/app/src/Setup/SustainabilitySetup.Table.al\nindex 335c0099f4a..cf00000001 100644\n--- a/App/Apps/W1/Sustainability/app/src/Setup/SustainabilitySetup.Table.al\n+++ b/App/Apps/W1/Sustainability/app/src/Setup/SustainabilitySetup.Table.al\n@@ -151,6 +151,8 @@ table 6217 \"Sustainability Setup\"\n if Rec.\"Enable Value Chain Tracking\" then\n if not ConfirmManagement.GetResponseOrDefault(ConfirmEnableValueChainTrackingQst, false) then\n Error('');\n+\n+ EnableEmissionsWhenValueChainTrackingIsEnabled();\n end;\n }\n }\n@@ -188,6 +190,16 @@ table 6217 \"Sustainability Setup\"\n exit(\"Enable Value Chain Tracking\");\n end;\n \n+ local procedure EnableEmissionsWhenValueChainTrackingIsEnabled()\n+ begin\n+ if not Rec.\"Enable Value Chain Tracking\" then\n+ exit;\n+\n+ Rec.Validate(\"Use Emissions In Purch. Doc.\", true);\n+ Rec.Validate(\"Item Emissions\", true);\n+ Rec.Validate(\"Resource Emissions\", true);\n+ end;\n+\n internal procedure GetFormat(FieldNo: Integer): Text\n begin\n GetSustainabilitySetup();\n"} +{"instance_id": "microsoftInternal__NAV-224009__cf-1", "base_instance_id": "microsoftInternal__NAV-224009", "variant_description": "Split from 3 to 2: second adjustment uses 1 lot (440) instead of 2 lots (220+220)", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-224009__cf-1", "FAIL_TO_PASS": [{"codeunitID": 137045, "functionName": ["CheckTrackingReservationEntriesUpdatedWheLotNoAllocated"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMBugfixes.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMBugfixes.Codeunit.al\n--- a/App/Layers/W1/Tests/SCM/SCMBugfixes.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMBugfixes.Codeunit.al\n@@ -1215,6 +1215,74 @@\n \n \n AssertReservationEntryCountForSales(SalesHeader, 3);\n+ end;\n+\n+ [Test]\n+ [HandlerFunctions('MessageHandlerOrderTracking,ItemTrackingLinesPageHandler')]\n+ procedure CheckTrackingReservationEntriesUpdatedWheLotNoAllocated()\n+ var\n+ Item: Record Item;\n+ Location: Record Location;\n+ SalesHeader: Record \"Sales Header\";\n+ SalesLine: Record \"Sales Line\";\n+ UnitofMeasure: Record \"Unit of Measure\";\n+ InventoryPostingSetup: Record \"Inventory Posting Setup\";\n+ ItemUnitOfMeasure: Record \"Item Unit of Measure\";\n+ ItemJournalLine: Record \"Item Journal Line\";\n+ ReservationEntry, ReservationEntry1 : Record \"Reservation Entry\";\n+ LotNo, LotNo1, LotNo2 : Code[50];\n+ begin\n+ // [SCENARIO 580079] Wrong Decimal Rounding with Quantity in Reservation Entries, using Order Tracking Policy where tracking lines are split into 3, each ending in x.xxxx7, which results with all 3 adding up to x.00001\n+ Initialize();\n+\n+ // [GIVEN] Created Lot Tracked Item.\n+ CreateTrackedItemWithOrderTrackingPolicy(Item);\n+\n+ // [GIVEN] Create new UOM for CASE (CA), Qty 24 Per Base UOM of PCS\n+ LibraryInventory.CreateUnitOfMeasureCode(UnitofMeasure);\n+ LibraryInventory.CreateItemUnitOfMeasure(ItemUnitOfMeasure, Item.\"No.\", UnitofMeasure.Code, 24);\n+\n+ // [GIVEN] Create Location\n+ LibraryWarehouse.CreateLocation(Location);\n+\n+ // [GIVEN] Create Inventory Posting Setup with Inventory Account\n+ LibraryInventory.CreateInventoryPostingSetup(InventoryPostingSetup, Location.Code, Item.\"Inventory Posting Group\");\n+ InventoryPostingSetup.Validate(\"Inventory Account\", LibraryERM.CreateGLAccountNo());\n+ InventoryPostingSetup.Modify();\n+\n+ // [GIVEN] Create Positive Adjustment for 288 Quantity with 1 Lot No\n+ LotNo := LibraryUtility.GenerateGUID();\n+ CreateItemJournalLineItemTrackingEnabled(ItemJournalLine, Item.\"No.\", Location.Code, 288);\n+ LibraryItemTracking.CreateItemJournalLineItemTracking(ReservationEntry, ItemJournalLine, '', LotNo, 288);\n+ LibraryInventory.PostItemJnlLineWithCheck(ItemJournalLine);\n+\n+ // [GIVEN] Create Positive Adjustment for 440 Quantity with 1 Lot\n+ LotNo1 := LibraryUtility.GenerateGUID();\n+ CreateItemJournalLineItemTrackingEnabled(ItemJournalLine, Item.\"No.\", Location.Code, 440);\n+ LibraryItemTracking.CreateItemJournalLineItemTracking(ReservationEntry, ItemJournalLine, '', LotNo1, 440);\n+ LibraryInventory.PostItemJnlLineWithCheck(ItemJournalLine);\n+\n+ // [GIVEN] Created Sales Order with 1 Item and 3 quantity.\n+ LibrarySales.CreateSalesHeader(SalesHeader, SalesHeader.\"Document Type\"::Order, '');\n+ LibrarySales.CreateSalesLine(SalesLine, SalesHeader, SalesLine.Type::Item, Item.\"No.\", 12);\n+ SalesLine.Validate(\"Location Code\", Location.Code);\n+ SalesLine.Validate(\"Unit of Measure Code\", UnitofMeasure.Code);\n+ SalesLine.Modify(true);\n+\n+ // [GIVEN] From Item tracking lines (Sales Order), add a Lot No to the item.\n+ LibraryVariableStorage.Enqueue(ItemTrackingHandlerAction::AssignSpecificLot);\n+ LibraryVariableStorage.Enqueue(LotNo);\n+ LibraryVariableStorage.Enqueue(288);\n+ SalesLine.OpenItemTrackingLines(); // ItemTrackingLinesPageHandler required.\n+\n+ // [WHEN] Change the quantity from Item tracking lines (Sales Order), of a Lot No to 13.\n+ LibraryVariableStorage.Enqueue(ItemTrackingHandlerAction::AssignSpecificLot);\n+ LibraryVariableStorage.Enqueue(LotNo);\n+ LibraryVariableStorage.Enqueue(13);\n+ SalesLine.OpenItemTrackingLines(); // ItemTrackingLinesPageHandler required.\n+\n+ // [THEN] Reservation entry Quantity field should come with -12\n+ VerifyReservationEntryQuantity(Item.\"No.\", SalesHeader.\"No.\", -12);\n end;\n \n local procedure Initialize()\n@@ -1310,6 +1378,23 @@\n LibraryInventory.PostItemJournalLine(ItemJournalBatch.\"Journal Template Name\", ItemJournalBatch.Name);\n end;\n \n+ local procedure CreateItemJournalLineItemTrackingEnabled(var ItemJournalLine: Record \"Item Journal Line\"; ItemNo: Code[20]; LocationCode: Code[10]; Quantity: Decimal)\n+ var\n+ ItemJournalTemplate: Record \"Item Journal Template\";\n+ ItemJournalBatch: Record \"Item Journal Batch\";\n+ begin\n+ LibraryInventory.SelectItemJournalTemplateName(ItemJournalTemplate, \"Item Journal Template Type\"::Item);\n+ LibraryInventory.SelectItemJournalBatchName(ItemJournalBatch, \"Item Journal Template Type\"::Item, ItemJournalTemplate.Name);\n+ LibraryInventory.ClearItemJournal(ItemJournalTemplate, ItemJournalBatch);\n+ ItemJournalBatch.\"Item Tracking on Lines\" := true;\n+ ItemJournalBatch.Modify();\n+ LibraryInventory.CreateItemJournalLine(\n+ ItemJournalLine, ItemJournalBatch.\"Journal Template Name\", ItemJournalBatch.Name,\n+ ItemJournalLine.\"Entry Type\"::\"Positive Adjmt.\", ItemNo, Quantity);\n+ ItemJournalLine.Validate(\"Location Code\", LocationCode);\n+ ItemJournalLine.Modify(true);\n+ end;\n+\n local procedure CreateCertifiedProductionBOMWithComponentStartingDate(var ProductionBOMHeader: Record \"Production BOM Header\"; UOMCode: Code[10]; ItemNo: Code[20]; QtyPer: Decimal; StartingDate: Date)\n var\n ProductionBOMLine: Record \"Production BOM Line\";\n@@ -1985,6 +2070,16 @@\n Assert.RecordCount(ReservationEntry, ExpectedCount);\n end;\n \n+ local procedure VerifyReservationEntryQuantity(ItemNo: Code[20]; SourceID: Code[20]; ExpectedQuantity: Decimal)\n+ var\n+ ReservEntry: Record \"Reservation Entry\";\n+ begin\n+ ReservEntry.SetRange(\"Item No.\", ItemNo);\n+ ReservEntry.SetRange(\"Source ID\", SourceID);\n+ ReservEntry.CalcSums(Quantity);\n+ ReservEntry.TestField(Quantity, ExpectedQuantity);\n+ end;\n+\n [ModalPageHandler]\n [Scope('OnPrem')]\n procedure ContactListModalPageHandler(var ContactLookup: Page \"Contact List\"; var Response: Action)\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Inventory/Tracking/ReservationEntry.Table.al b/App/Layers/W1/BaseApp/Inventory/Tracking/ReservationEntry.Table.al\n--- a/App/Layers/W1/BaseApp/Inventory/Tracking/ReservationEntry.Table.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Tracking/ReservationEntry.Table.al\n@@ -914,7 +914,7 @@\n ReservEntry.SetFilter(\"Entry No.\", '<>%1', \"Entry No.\");\n ReservEntry.SetSourceFilter(\"Source Type\", \"Source Subtype\", \"Source ID\", \"Source Ref. No.\", false);\n ReservEntry.SetSourceFilter(\"Source Batch Name\", \"Source Prod. Order Line\");\n- ReservEntry.SetRange(\"Reservation Status\", \"Reservation Status\"::Reservation);\n+ ReservEntry.SetFilter(\"Reservation Status\", '%1|%2', \"Reservation Status\"::Reservation, \"Reservation Status\"::Tracking);\n ReservEntry.CalcSums(\"Quantity (Base)\", Quantity);\n exit(\n Round((ReservEntry.\"Quantity (Base)\" + \"Quantity (Base)\") / \"Qty. per Unit of Measure\", UOMMgt.QtyRndPrecision()) -\n"} +{"instance_id": "microsoftInternal__NAV-224009__cf-2", "base_instance_id": "microsoftInternal__NAV-224009", "variant_description": "Order Tracking Policy set to None: no automatic tracking split, tests rounding fix without order tracking", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-224009__cf-2", "FAIL_TO_PASS": [{"codeunitID": 137045, "functionName": ["CheckTrackingReservationEntriesUpdatedWheLotNoAllocated"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMBugfixes.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMBugfixes.Codeunit.al\n--- a/App/Layers/W1/Tests/SCM/SCMBugfixes.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMBugfixes.Codeunit.al\n@@ -1215,6 +1215,78 @@\n \n \n AssertReservationEntryCountForSales(SalesHeader, 3);\n+ end;\n+\n+ [Test]\n+ [HandlerFunctions('MessageHandlerOrderTracking,ItemTrackingLinesPageHandler')]\n+ procedure CheckTrackingReservationEntriesUpdatedWheLotNoAllocated()\n+ var\n+ Item: Record Item;\n+ Location: Record Location;\n+ SalesHeader: Record \"Sales Header\";\n+ SalesLine: Record \"Sales Line\";\n+ UnitofMeasure: Record \"Unit of Measure\";\n+ InventoryPostingSetup: Record \"Inventory Posting Setup\";\n+ ItemUnitOfMeasure: Record \"Item Unit of Measure\";\n+ ItemJournalLine: Record \"Item Journal Line\";\n+ ReservationEntry, ReservationEntry1 : Record \"Reservation Entry\";\n+ LotNo, LotNo1, LotNo2 : Code[50];\n+ begin\n+ // [SCENARIO 580079] Wrong Decimal Rounding with Quantity in Reservation Entries, using Order Tracking Policy where tracking lines are split into 3, each ending in x.xxxx7, which results with all 3 adding up to x.00001\n+ Initialize();\n+\n+ // [GIVEN] Created Lot Tracked Item with Order Tracking Policy set to None.\n+ CreateTrackedItemWithOrderTrackingPolicy(Item);\n+ Item.\"Order Tracking Policy\" := Item.\"Order Tracking Policy\"::None;\n+ Item.Modify();\n+\n+ // [GIVEN] Create new UOM for CASE (CA), Qty 24 Per Base UOM of PCS\n+ LibraryInventory.CreateUnitOfMeasureCode(UnitofMeasure);\n+ LibraryInventory.CreateItemUnitOfMeasure(ItemUnitOfMeasure, Item.\"No.\", UnitofMeasure.Code, 24);\n+\n+ // [GIVEN] Create Location\n+ LibraryWarehouse.CreateLocation(Location);\n+\n+ // [GIVEN] Create Inventory Posting Setup with Inventory Account\n+ LibraryInventory.CreateInventoryPostingSetup(InventoryPostingSetup, Location.Code, Item.\"Inventory Posting Group\");\n+ InventoryPostingSetup.Validate(\"Inventory Account\", LibraryERM.CreateGLAccountNo());\n+ InventoryPostingSetup.Modify();\n+\n+ // [GIVEN] Create Positive Adjustment for 288 Quantity with 1 Lot No\n+ LotNo := LibraryUtility.GenerateGUID();\n+ CreateItemJournalLineItemTrackingEnabled(ItemJournalLine, Item.\"No.\", Location.Code, 288);\n+ LibraryItemTracking.CreateItemJournalLineItemTracking(ReservationEntry, ItemJournalLine, '', LotNo, 288);\n+ LibraryInventory.PostItemJnlLineWithCheck(ItemJournalLine);\n+\n+ // [GIVEN] Create Positive Adjustment for 440 Quantity with 2 different Lot\n+ LotNo1 := LibraryUtility.GenerateGUID();\n+ LotNo2 := LibraryUtility.GenerateGUID();\n+ CreateItemJournalLineItemTrackingEnabled(ItemJournalLine, Item.\"No.\", Location.Code, 440);\n+ LibraryItemTracking.CreateItemJournalLineItemTracking(ReservationEntry, ItemJournalLine, '', LotNo1, 220);\n+ LibraryItemTracking.CreateItemJournalLineItemTracking(ReservationEntry1, ItemJournalLine, '', LotNo2, 220);\n+ LibraryInventory.PostItemJnlLineWithCheck(ItemJournalLine);\n+\n+ // [GIVEN] Created Sales Order with 1 Item and 3 quantity.\n+ LibrarySales.CreateSalesHeader(SalesHeader, SalesHeader.\"Document Type\"::Order, '');\n+ LibrarySales.CreateSalesLine(SalesLine, SalesHeader, SalesLine.Type::Item, Item.\"No.\", 12);\n+ SalesLine.Validate(\"Location Code\", Location.Code);\n+ SalesLine.Validate(\"Unit of Measure Code\", UnitofMeasure.Code);\n+ SalesLine.Modify(true);\n+\n+ // [GIVEN] From Item tracking lines (Sales Order), add a Lot No to the item.\n+ LibraryVariableStorage.Enqueue(ItemTrackingHandlerAction::AssignSpecificLot);\n+ LibraryVariableStorage.Enqueue(LotNo);\n+ LibraryVariableStorage.Enqueue(288);\n+ SalesLine.OpenItemTrackingLines(); // ItemTrackingLinesPageHandler required.\n+\n+ // [WHEN] Change the quantity from Item tracking lines (Sales Order), of a Lot No to 13.\n+ LibraryVariableStorage.Enqueue(ItemTrackingHandlerAction::AssignSpecificLot);\n+ LibraryVariableStorage.Enqueue(LotNo);\n+ LibraryVariableStorage.Enqueue(13);\n+ SalesLine.OpenItemTrackingLines(); // ItemTrackingLinesPageHandler required.\n+\n+ // [THEN] Reservation entry Quantity field should come with -12\n+ VerifyReservationEntryQuantity(Item.\"No.\", SalesHeader.\"No.\", -12);\n end;\n \n local procedure Initialize()\n@@ -1310,6 +1382,23 @@\n LibraryInventory.PostItemJournalLine(ItemJournalBatch.\"Journal Template Name\", ItemJournalBatch.Name);\n end;\n \n+ local procedure CreateItemJournalLineItemTrackingEnabled(var ItemJournalLine: Record \"Item Journal Line\"; ItemNo: Code[20]; LocationCode: Code[10]; Quantity: Decimal)\n+ var\n+ ItemJournalTemplate: Record \"Item Journal Template\";\n+ ItemJournalBatch: Record \"Item Journal Batch\";\n+ begin\n+ LibraryInventory.SelectItemJournalTemplateName(ItemJournalTemplate, \"Item Journal Template Type\"::Item);\n+ LibraryInventory.SelectItemJournalBatchName(ItemJournalBatch, \"Item Journal Template Type\"::Item, ItemJournalTemplate.Name);\n+ LibraryInventory.ClearItemJournal(ItemJournalTemplate, ItemJournalBatch);\n+ ItemJournalBatch.\"Item Tracking on Lines\" := true;\n+ ItemJournalBatch.Modify();\n+ LibraryInventory.CreateItemJournalLine(\n+ ItemJournalLine, ItemJournalBatch.\"Journal Template Name\", ItemJournalBatch.Name,\n+ ItemJournalLine.\"Entry Type\"::\"Positive Adjmt.\", ItemNo, Quantity);\n+ ItemJournalLine.Validate(\"Location Code\", LocationCode);\n+ ItemJournalLine.Modify(true);\n+ end;\n+\n local procedure CreateCertifiedProductionBOMWithComponentStartingDate(var ProductionBOMHeader: Record \"Production BOM Header\"; UOMCode: Code[10]; ItemNo: Code[20]; QtyPer: Decimal; StartingDate: Date)\n var\n ProductionBOMLine: Record \"Production BOM Line\";\n@@ -1985,6 +2074,16 @@\n Assert.RecordCount(ReservationEntry, ExpectedCount);\n end;\n \n+ local procedure VerifyReservationEntryQuantity(ItemNo: Code[20]; SourceID: Code[20]; ExpectedQuantity: Decimal)\n+ var\n+ ReservEntry: Record \"Reservation Entry\";\n+ begin\n+ ReservEntry.SetRange(\"Item No.\", ItemNo);\n+ ReservEntry.SetRange(\"Source ID\", SourceID);\n+ ReservEntry.CalcSums(Quantity);\n+ ReservEntry.TestField(Quantity, ExpectedQuantity);\n+ end;\n+\n [ModalPageHandler]\n [Scope('OnPrem')]\n procedure ContactListModalPageHandler(var ContactLookup: Page \"Contact List\"; var Response: Action)\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Inventory/Tracking/ReservationEntry.Table.al b/App/Layers/W1/BaseApp/Inventory/Tracking/ReservationEntry.Table.al\n--- a/App/Layers/W1/BaseApp/Inventory/Tracking/ReservationEntry.Table.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Tracking/ReservationEntry.Table.al\n@@ -914,7 +914,7 @@\n ReservEntry.SetFilter(\"Entry No.\", '<>%1', \"Entry No.\");\n ReservEntry.SetSourceFilter(\"Source Type\", \"Source Subtype\", \"Source ID\", \"Source Ref. No.\", false);\n ReservEntry.SetSourceFilter(\"Source Batch Name\", \"Source Prod. Order Line\");\n- ReservEntry.SetRange(\"Reservation Status\", \"Reservation Status\"::Reservation);\n+ ReservEntry.SetFilter(\"Reservation Status\", '%1|%2', \"Reservation Status\"::Reservation, \"Reservation Status\"::Tracking);\n ReservEntry.CalcSums(\"Quantity (Base)\", Quantity);\n exit(\n Round((ReservEntry.\"Quantity (Base)\" + \"Quantity (Base)\") / \"Qty. per Unit of Measure\", UOMMgt.QtyRndPrecision()) -\n"} +{"instance_id": "microsoftInternal__NAV-211710__cf-1", "base_instance_id": "microsoftInternal__NAV-211710", "variant_description": "Both success and failed transactions create journal lines; remove Status filter", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-211710__cf-1", "FAIL_TO_PASS": [{"codeunitID": 139648, "functionName": ["UnitTestSuggestShopifyPaymentsFailedTransaction"]}], "PASS_TO_PASS": [{"codeunitID": 139648, "functionName": ["UnitTestSuggestShopifyPaymentsMultipleTransactions", "UnitTestSuggestShopifyPaymentsOneTransaction"]}], "test_patch": "diff --git a/App/Apps/W1/Shopify/test/Payments/ShpfySuggestPaymentTest.Codeunit.al b/App/Apps/W1/Shopify/test/Payments/ShpfySuggestPaymentTest.Codeunit.al\n--- a/App/Apps/W1/Shopify/test/Payments/ShpfySuggestPaymentTest.Codeunit.al\n+++ b/App/Apps/W1/Shopify/test/Payments/ShpfySuggestPaymentTest.Codeunit.al\n@@ -32,7 +32,7 @@\n CreateAndPostSalesInvoice(Item, Customer, 1, OrderId);\n \n // [GIVEN] Shopify transaction is imported\n- CreateOrderTransaction(OrderId, Amount, 'manual', OrderTransaction.Type::Sale);\n+ CreateOrderTransaction(OrderId, Amount, 'manual', OrderTransaction.Type::Sale, OrderTransaction.Status::Success);\n \n // [WHEN] Create Shopify transactions are run\n OrderTransaction.FindFirst();\n@@ -65,8 +65,8 @@\n CreateAndPostSalesInvoice(Item, Customer, 1, OrderId);\n \n // [GIVEN] Shopify transactions are imported\n- CreateOrderTransaction(OrderId, Amount * 0.75, 'manual', OrderTransaction.Type::Sale);\n- CreateOrderTransaction(OrderId, Amount * 0.25, 'gift_card', OrderTransaction.Type::Sale);\n+ CreateOrderTransaction(OrderId, Amount * 0.75, 'manual', OrderTransaction.Type::Sale, OrderTransaction.Status::Success);\n+ CreateOrderTransaction(OrderId, Amount * 0.25, 'gift_card', OrderTransaction.Type::Sale, OrderTransaction.Status::Success);\n \n // [WHEN] Create Shopify transactions are run\n OrderTransaction.SetRange(\"Shopify Order Id\", OrderId);\n@@ -84,6 +84,42 @@\n \n \n until SuggestPayment.Next() = 0;\n+ end;\n+\n+ [HandlerFunctions('SuggestShopifyPaymentsRequestPageHandler')]\n+ [Test]\n+ procedure UnitTestSuggestShopifyPaymentsFailedTransaction()\n+ var\n+ Item: Record Item;\n+ Customer: Record Customer;\n+ OrderTransaction: Record \"Shpfy Order Transaction\";\n+ GenJournalLine: Record \"Gen. Journal Line\";\n+ CashReceiptJournal: TestPage \"Cash Receipt Journal\";\n+ OrderId: BigInteger;\n+ Amount: Decimal;\n+ begin\n+ // [SCENARIO] Suggest Shopify payments creates Cash Receipt Journal lines for both successful and failed transactions\n+ // [GIVEN] Invoice is posted\n+ Initialize();\n+ Amount := Any.IntegerInRange(10000, 99999);\n+ OrderId := Any.IntegerInRange(10000, 99999);\n+ CreateItem(Item, Amount);\n+ LibrarySales.CreateCustomer(Customer);\n+ CreateAndPostSalesInvoice(Item, Customer, 1, OrderId);\n+\n+ // [GIVEN] One failed one success Shopify transaction is imported\n+ CreateOrderTransaction(OrderId, Amount, 'manual', OrderTransaction.Type::Sale, OrderTransaction.Status::Failure);\n+ CreateOrderTransaction(OrderId, Amount, 'manual', OrderTransaction.Type::Sale, OrderTransaction.Status::Success);\n+ Commit();\n+\n+ // [WHEN] Report is run\n+ CashReceiptJournal.OpenView();\n+ CashReceiptJournal.SuggestShopifyPayments.Invoke();\n+\n+ // [THEN] Both success and failed transactions create journal lines\n+ GenJournalLine.SetRange(\"Document Type\", GenJournalLine.\"Document Type\"::Payment);\n+ GenJournalLine.SetRange(\"Account No.\", Customer.\"No.\");\n+ LibraryAssert.RecordCount(GenJournalLine, 2);\n end;\n \n [HandlerFunctions('SuggestShopifyPaymentsRequestPageHandler')]\n@@ -114,10 +150,10 @@\n CreateAndPostSalesInvoice(Item, Customer, 2, OrderId3);\n \n // [GIVEN] Shopify transactions are imported\n- CreateOrderTransaction(OrderId1, Amount, 'manual', OrderTransaction.Type::Sale);\n- CreateOrderTransaction(OrderId2, Amount * 0.75, 'manual', OrderTransaction.Type::Sale);\n- CreateOrderTransaction(OrderId2, Amount * 0.25, 'gift_card', OrderTransaction.Type::Sale);\n- CreateOrderTransaction(OrderId3, Amount * 2, 'bogus', OrderTransaction.Type::Sale);\n+ CreateOrderTransaction(OrderId1, Amount, 'manual', OrderTransaction.Type::Sale, OrderTransaction.Status::Success);\n+ CreateOrderTransaction(OrderId2, Amount * 0.75, 'manual', OrderTransaction.Type::Sale, OrderTransaction.Status::Success);\n+ CreateOrderTransaction(OrderId2, Amount * 0.25, 'gift_card', OrderTransaction.Type::Sale, OrderTransaction.Status::Success);\n+ CreateOrderTransaction(OrderId3, Amount * 2, 'bogus', OrderTransaction.Type::Sale, OrderTransaction.Status::Success);\n Commit();\n \n // [WHEN] Report is run\n@@ -154,7 +190,7 @@\n CreateAndPostSalesCreditMemo(Item, Customer, 1, RefundId);\n \n // [GIVEN] Shopify transaction is imported\n- CreateOrderTransaction(OrderId, Amount, 'manual', OrderTransaction.Type::Refund);\n+ CreateOrderTransaction(OrderId, Amount, 'manual', OrderTransaction.Type::Refund, OrderTransaction.Status::Success);\n \n // [WHEN] Create Shopify transactions are run\n OrderTransaction.FindFirst();\n@@ -210,7 +246,7 @@\n Item.Modify(true);\n end;\n \n- local procedure CreateOrderTransaction(OrderId: BigInteger; Amount: Decimal; Gateway: Code[20]; TransactionType: Enum \"Shpfy Transaction Type\")\n+ local procedure CreateOrderTransaction(OrderId: BigInteger; Amount: Decimal; Gateway: Code[20]; TransactionType: Enum \"Shpfy Transaction Type\"; Status: Enum \"Shpfy Transaction Status\"): BigInteger\n var\n OrderTransaction: Record \"Shpfy Order Transaction\";\n begin\n@@ -219,7 +255,9 @@\n OrderTransaction.Amount := Amount;\n OrderTransaction.Gateway := Gateway;\n OrderTransaction.Type := TransactionType;\n+ OrderTransaction.Status := Status;\n OrderTransaction.Insert();\n+ exit(OrderTransaction.\"Shopify Transaction Id\");\n end;\n \n local procedure CreateRefund(OrderId: BigInteger; RefundId: BigInteger; Amount: Decimal)\n", "patch": "diff --git a/App/Apps/W1/Shopify/app/src/Transactions/Reports/ShpfySuggestPayments.Report.al b/App/Apps/W1/Shopify/app/src/Transactions/Reports/ShpfySuggestPayments.Report.al\n--- a/App/Apps/W1/Shopify/app/src/Transactions/Reports/ShpfySuggestPayments.Report.al\n+++ b/App/Apps/W1/Shopify/app/src/Transactions/Reports/ShpfySuggestPayments.Report.al\n@@ -17,7 +17,7 @@\n dataitem(OrderTransaction; \"Shpfy Order Transaction\")\n {\n RequestFilterFields = \"Created At\";\n- DataItemTableView = sorting(Type) where(Type = filter(Capture | Sale | Refund), Status = filter(Success));\n+ DataItemTableView = sorting(Type) where(Type = filter(Capture | Sale | Refund));\n \n trigger OnAfterGetRecord()\n begin\n"} +{"instance_id": "microsoftInternal__NAV-220984__cf-1", "base_instance_id": "microsoftInternal__NAV-220984", "variant_description": "Date condition: only set Ending Date when Starting Date is not WORKDATE", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-220984__cf-1", "FAIL_TO_PASS": [{"codeunitID": 137404, "functionName": ["ExchangeProductionBOMItemShouldSetEndingDate"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM-Manufacturing/SCMManufacturing.Codeunit.al b/App/Layers/W1/Tests/SCM-Manufacturing/SCMManufacturing.Codeunit.al\n--- a/App/Layers/W1/Tests/SCM-Manufacturing/SCMManufacturing.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM-Manufacturing/SCMManufacturing.Codeunit.al\n@@ -4828,6 +4828,54 @@\n \n Assert.AreEqual(StandardTask.Code, ProdOrderLine.\"Standard Task Code\", StandardTaskFieldErr);\n end;\n+\n+ [Test]\n+ [HandlerFunctions('RunExchangeProdBOMItemReportWithStartDateParameter')]\n+ procedure ExchangeProductionBOMItemShouldSetEndingDate()\n+ var\n+ Item: array[5] of Record Item;\n+ MainItem: Record Item;\n+ ProductionBOMHeader: Record \"Production BOM Header\";\n+ ProductionBOMLine: Record \"Production BOM Line\";\n+ i: Integer;\n+ begin\n+ // [SCENARIO 592157] Replacing a component in a Production BOM should set the Ending Date of the replaced component.\n+ Initialize();\n+\n+ LibraryInventory.CreateItem(MainItem);\n+ MainItem.Validate(\"Replenishment System\", MainItem.\"Replenishment System\"::\"Prod. Order\");\n+ MainItem.Modify(true);\n+\n+ // [GIVEN] Create a Production BOM Header\n+ LibraryManufacturing.CreateProductionBOMHeader(ProductionBOMHeader, MainItem.\"Base Unit of Measure\");\n+\n+ // [GIVEN] Create Items\n+ for i := 1 to 5 do\n+ LibraryInventory.CreateItem(Item[i]);\n+\n+ // [GIVEN] Add only Items[1..4] to the BOM\n+ for i := 1 to 4 do\n+ LibraryManufacturing.CreateProductionBOMLine(\n+ ProductionBOMHeader, ProductionBOMLine, '', ProductionBOMLine.Type::Item, Item[i].\"No.\", LibraryRandom.RandIntInRange(10, 20));\n+\n+ // [GIVEN] Certify BOM and assign to Main Item\n+ ModifyStatusInProductionBOM(ProductionBOMHeader, ProductionBOMHeader.Status::Certified);\n+ MainItem.Validate(\"Production BOM No.\", ProductionBOMHeader.\"No.\");\n+ MainItem.Modify(true);\n+\n+ // [GIVEN] Enqueue parameter values for report\n+ EnqueueExchProdBOMItemReportParameter(Item[1].\"No.\", Item[5].\"No.\", WorkDate());\n+\n+ // [WHEN] Run the Exchange Production BOM Item report\n+ RunExchangeProductionBOMItemReport();\n+\n+ // [THEN] Validate that the replaced item does NOT have an Ending Date set\n+ ValidateEndingDateNotSet(ProductionBOMHeader.\"No.\", Item[1].\"No.\");\n+\n+ // [AND] Ensure no test artifacts are left behind\n+ LibraryVariableStorage.AssertEmpty();\n+ end;\n+\n \n local procedure Initialize()\n var\n@@ -7704,6 +7752,23 @@\n standardTask.Modify(true);\n end;\n \n+ local procedure EnqueueExchProdBOMItemReportParameter(ExchangeItemNo: Code[20]; ReplaceItemNo: Code[20]; StartDate: Date)\n+ begin\n+ LibraryVariableStorage.Enqueue(ExchangeItemNo);\n+ LibraryVariableStorage.Enqueue(ReplaceItemNo);\n+ LibraryVariableStorage.Enqueue(StartDate);\n+ end;\n+\n+ local procedure ValidateEndingDateNotSet(ProdBOMHeaderNo: Code[20]; ItemNo: Code[20])\n+ var\n+ ProductionBOMLine: Record \"Production BOM Line\";\n+ begin\n+ ProductionBOMLine.SetRange(\"Production BOM No.\", ProdBOMHeaderNo);\n+ ProductionBOMLine.SetRange(\"No.\", ItemNo);\n+ ProductionBOMLine.FindFirst();\n+ Assert.AreEqual(0D, ProductionBOMLine.\"Ending Date\", 'Ending Date should not be set on the Production BOM line.')\n+ end;\n+\n [ModalPageHandler]\n [Scope('OnPrem')]\n procedure ProdBOMVersionComparisonHandlerForActionSet(var ProdBOMVersionComparison: TestPage \"Prod. BOM Version Comparison\")\n@@ -7793,5 +7858,28 @@\n ExchangeProductionBOMItem.WithType.AssertEquals(ProductionBOMLineType::Item);// [THEN] Verify WithType Default Type is ITEM\n ExchangeProductionBOMItem.OK().Invoke();\n end;\n+\n+ [RequestPageHandler]\n+ procedure RunExchangeProdBOMItemReportWithStartDateParameter(var ExchangeProductionBOMItem: TestRequestPage \"Exchange Production BOM Item\")\n+ var\n+ FromProductionBOMLineType: Enum \"Production BOM Line Type\";\n+ ExchangeItemNo: Variant;\n+ ReplaceItemNo: Variant;\n+ StartDate: Variant;\n+ begin\n+ ExchangeItemNo := LibraryVariableStorage.DequeueText();\n+ ReplaceItemNo := LibraryVariableStorage.DequeueText();\n+ StartDate := LibraryVariableStorage.DequeueDate();\n+ ExchangeProductionBOMItem.ExchangeType.SetValue(FromProductionBOMLineType::Item);\n+ ExchangeProductionBOMItem.ExchangeNo.SetValue(ExchangeItemNo);\n+ ExchangeProductionBOMItem.WithType.SetValue(FromProductionBOMLineType::Item);\n+ ExchangeProductionBOMItem.WithNo.SetValue(ReplaceItemNo);\n+ ExchangeProductionBOMItem.\"Create New Version\".SetValue(false);\n+ ExchangeProductionBOMItem.\"Delete Exchanged Component\".SetValue(false);\n+ ExchangeProductionBOMItem.Recertify.SetValue(true);\n+ ExchangeProductionBOMItem.CopyRoutingLink.SetValue(true);\n+ ExchangeProductionBOMItem.StartingDate.SetValue(StartDate);\n+ ExchangeProductionBOMItem.OK().Invoke();\n+ end;\n }\n \n", "patch": "diff --git a/App/Layers/W1/BaseApp/Manufacturing/ProductionBOM/ExchangeProductionBOMItem.Report.al b/App/Layers/W1/BaseApp/Manufacturing/ProductionBOM/ExchangeProductionBOMItem.Report.al\n--- a/App/Layers/W1/BaseApp/Manufacturing/ProductionBOM/ExchangeProductionBOMItem.Report.al\n+++ b/App/Layers/W1/BaseApp/Manufacturing/ProductionBOM/ExchangeProductionBOMItem.Report.al\n@@ -157,7 +157,7 @@\n CopyPositionFields(ProductionBOMLine2, ProductionBOMLine3);\n ShouldModifyProductionBOMLine := true;\n OnIntegerOnPostDataItemOnBeforeModifyProductionBOMLine(ProductionBOMLine, ShouldModifyProductionBOMLine);\n- if not ShouldModifyProductionBOMLine then begin\n+ if ShouldModifyProductionBOMLine and (StartingDate <> WorkDate()) then begin\n ProductionBOMLine.\"Ending Date\" := StartingDate - 1;\n ProductionBOMLine.Modify();\n end;\n"} +{"instance_id": "microsoftInternal__NAV-220984__cf-2", "base_instance_id": "microsoftInternal__NAV-220984", "variant_description": "Delete flag condition: do not set Ending Date when Delete Exchanged Component is selected", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-220984__cf-2", "FAIL_TO_PASS": [{"codeunitID": 137404, "functionName": ["ExchangeProductionBOMItemShouldSetEndingDate"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM-Manufacturing/SCMManufacturing.Codeunit.al b/App/Layers/W1/Tests/SCM-Manufacturing/SCMManufacturing.Codeunit.al\n--- a/App/Layers/W1/Tests/SCM-Manufacturing/SCMManufacturing.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM-Manufacturing/SCMManufacturing.Codeunit.al\n@@ -4828,6 +4828,54 @@\n \n Assert.AreEqual(StandardTask.Code, ProdOrderLine.\"Standard Task Code\", StandardTaskFieldErr);\n end;\n+\n+ [Test]\n+ [HandlerFunctions('RunExchangeProdBOMItemReportWithStartDateParameter')]\n+ procedure ExchangeProductionBOMItemShouldSetEndingDate()\n+ var\n+ Item: array[5] of Record Item;\n+ MainItem: Record Item;\n+ ProductionBOMHeader: Record \"Production BOM Header\";\n+ ProductionBOMLine: Record \"Production BOM Line\";\n+ i: Integer;\n+ begin\n+ // [SCENARIO 592157] Replacing a component in a Production BOM should set the Ending Date of the replaced component.\n+ Initialize();\n+\n+ LibraryInventory.CreateItem(MainItem);\n+ MainItem.Validate(\"Replenishment System\", MainItem.\"Replenishment System\"::\"Prod. Order\");\n+ MainItem.Modify(true);\n+\n+ // [GIVEN] Create a Production BOM Header\n+ LibraryManufacturing.CreateProductionBOMHeader(ProductionBOMHeader, MainItem.\"Base Unit of Measure\");\n+\n+ // [GIVEN] Create Items\n+ for i := 1 to 5 do\n+ LibraryInventory.CreateItem(Item[i]);\n+\n+ // [GIVEN] Add only Items[1..4] to the BOM\n+ for i := 1 to 4 do\n+ LibraryManufacturing.CreateProductionBOMLine(\n+ ProductionBOMHeader, ProductionBOMLine, '', ProductionBOMLine.Type::Item, Item[i].\"No.\", LibraryRandom.RandIntInRange(10, 20));\n+\n+ // [GIVEN] Certify BOM and assign to Main Item\n+ ModifyStatusInProductionBOM(ProductionBOMHeader, ProductionBOMHeader.Status::Certified);\n+ MainItem.Validate(\"Production BOM No.\", ProductionBOMHeader.\"No.\");\n+ MainItem.Modify(true);\n+\n+ // [GIVEN] Enqueue parameter values for report\n+ EnqueueExchProdBOMItemReportParameter(Item[1].\"No.\", Item[5].\"No.\", Today);\n+\n+ // [WHEN] Run the Exchange Production BOM Item report\n+ RunExchangeProductionBOMItemReport();\n+\n+ // [THEN] Validate that the replaced item does NOT have an Ending Date when Delete Exchanged Component is selected\n+ ValidateEndingDateNotSet(ProductionBOMHeader.\"No.\", Item[1].\"No.\");\n+\n+ // [AND] Ensure no test artifacts are left behind\n+ LibraryVariableStorage.AssertEmpty();\n+ end;\n+\n \n local procedure Initialize()\n var\n@@ -7704,6 +7752,23 @@\n standardTask.Modify(true);\n end;\n \n+ local procedure EnqueueExchProdBOMItemReportParameter(ExchangeItemNo: Code[20]; ReplaceItemNo: Code[20]; StartDate: Date)\n+ begin\n+ LibraryVariableStorage.Enqueue(ExchangeItemNo);\n+ LibraryVariableStorage.Enqueue(ReplaceItemNo);\n+ LibraryVariableStorage.Enqueue(StartDate);\n+ end;\n+\n+ local procedure ValidateEndingDateNotSet(ProdBOMHeaderNo: Code[20]; ItemNo: Code[20])\n+ var\n+ ProductionBOMLine: Record \"Production BOM Line\";\n+ begin\n+ ProductionBOMLine.SetRange(\"Production BOM No.\", ProdBOMHeaderNo);\n+ ProductionBOMLine.SetRange(\"No.\", ItemNo);\n+ ProductionBOMLine.FindFirst();\n+ Assert.AreEqual(0D, ProductionBOMLine.\"Ending Date\", 'Ending Date should not be set when Delete Exchanged Component is selected.')\n+ end;\n+\n [ModalPageHandler]\n [Scope('OnPrem')]\n procedure ProdBOMVersionComparisonHandlerForActionSet(var ProdBOMVersionComparison: TestPage \"Prod. BOM Version Comparison\")\n@@ -7793,5 +7858,28 @@\n ExchangeProductionBOMItem.WithType.AssertEquals(ProductionBOMLineType::Item);// [THEN] Verify WithType Default Type is ITEM\n ExchangeProductionBOMItem.OK().Invoke();\n end;\n+\n+ [RequestPageHandler]\n+ procedure RunExchangeProdBOMItemReportWithStartDateParameter(var ExchangeProductionBOMItem: TestRequestPage \"Exchange Production BOM Item\")\n+ var\n+ FromProductionBOMLineType: Enum \"Production BOM Line Type\";\n+ ExchangeItemNo: Variant;\n+ ReplaceItemNo: Variant;\n+ StartDate: Variant;\n+ begin\n+ ExchangeItemNo := LibraryVariableStorage.DequeueText();\n+ ReplaceItemNo := LibraryVariableStorage.DequeueText();\n+ StartDate := LibraryVariableStorage.DequeueDate();\n+ ExchangeProductionBOMItem.ExchangeType.SetValue(FromProductionBOMLineType::Item);\n+ ExchangeProductionBOMItem.ExchangeNo.SetValue(ExchangeItemNo);\n+ ExchangeProductionBOMItem.WithType.SetValue(FromProductionBOMLineType::Item);\n+ ExchangeProductionBOMItem.WithNo.SetValue(ReplaceItemNo);\n+ ExchangeProductionBOMItem.\"Create New Version\".SetValue(false);\n+ ExchangeProductionBOMItem.\"Delete Exchanged Component\".SetValue(true);\n+ ExchangeProductionBOMItem.Recertify.SetValue(true);\n+ ExchangeProductionBOMItem.CopyRoutingLink.SetValue(true);\n+ ExchangeProductionBOMItem.StartingDate.SetValue(StartDate);\n+ ExchangeProductionBOMItem.OK().Invoke();\n+ end;\n }\n \n", "patch": "diff --git a/App/Layers/W1/BaseApp/Manufacturing/ProductionBOM/ExchangeProductionBOMItem.Report.al b/App/Layers/W1/BaseApp/Manufacturing/ProductionBOM/ExchangeProductionBOMItem.Report.al\n--- a/App/Layers/W1/BaseApp/Manufacturing/ProductionBOM/ExchangeProductionBOMItem.Report.al\n+++ b/App/Layers/W1/BaseApp/Manufacturing/ProductionBOM/ExchangeProductionBOMItem.Report.al\n@@ -157,7 +157,7 @@\n CopyPositionFields(ProductionBOMLine2, ProductionBOMLine3);\n ShouldModifyProductionBOMLine := true;\n OnIntegerOnPostDataItemOnBeforeModifyProductionBOMLine(ProductionBOMLine, ShouldModifyProductionBOMLine);\n- if not ShouldModifyProductionBOMLine then begin\n+ if ShouldModifyProductionBOMLine and not DeleteExchangedComponent then begin\n ProductionBOMLine.\"Ending Date\" := StartingDate - 1;\n ProductionBOMLine.Modify();\n end;\n"} +{"instance_id": "microsoftInternal__NAV-220984__cf-3", "base_instance_id": "microsoftInternal__NAV-220984", "variant_description": "New version condition: do not set Ending Date when Create New Version is selected", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-220984__cf-3", "FAIL_TO_PASS": [{"codeunitID": 137404, "functionName": ["ExchangeProductionBOMItemShouldSetEndingDate"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM-Manufacturing/SCMManufacturing.Codeunit.al b/App/Layers/W1/Tests/SCM-Manufacturing/SCMManufacturing.Codeunit.al\n--- a/App/Layers/W1/Tests/SCM-Manufacturing/SCMManufacturing.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM-Manufacturing/SCMManufacturing.Codeunit.al\n@@ -4828,6 +4828,54 @@\n \n Assert.AreEqual(StandardTask.Code, ProdOrderLine.\"Standard Task Code\", StandardTaskFieldErr);\n end;\n+\n+ [Test]\n+ [HandlerFunctions('RunExchangeProdBOMItemReportWithStartDateParameter')]\n+ procedure ExchangeProductionBOMItemShouldSetEndingDate()\n+ var\n+ Item: array[5] of Record Item;\n+ MainItem: Record Item;\n+ ProductionBOMHeader: Record \"Production BOM Header\";\n+ ProductionBOMLine: Record \"Production BOM Line\";\n+ i: Integer;\n+ begin\n+ // [SCENARIO 592157] Replacing a component in a Production BOM should set the Ending Date of the replaced component.\n+ Initialize();\n+\n+ LibraryInventory.CreateItem(MainItem);\n+ MainItem.Validate(\"Replenishment System\", MainItem.\"Replenishment System\"::\"Prod. Order\");\n+ MainItem.Modify(true);\n+\n+ // [GIVEN] Create a Production BOM Header\n+ LibraryManufacturing.CreateProductionBOMHeader(ProductionBOMHeader, MainItem.\"Base Unit of Measure\");\n+\n+ // [GIVEN] Create Items\n+ for i := 1 to 5 do\n+ LibraryInventory.CreateItem(Item[i]);\n+\n+ // [GIVEN] Add only Items[1..4] to the BOM\n+ for i := 1 to 4 do\n+ LibraryManufacturing.CreateProductionBOMLine(\n+ ProductionBOMHeader, ProductionBOMLine, '', ProductionBOMLine.Type::Item, Item[i].\"No.\", LibraryRandom.RandIntInRange(10, 20));\n+\n+ // [GIVEN] Certify BOM and assign to Main Item\n+ ModifyStatusInProductionBOM(ProductionBOMHeader, ProductionBOMHeader.Status::Certified);\n+ MainItem.Validate(\"Production BOM No.\", ProductionBOMHeader.\"No.\");\n+ MainItem.Modify(true);\n+\n+ // [GIVEN] Enqueue parameter values for report\n+ EnqueueExchProdBOMItemReportParameter(Item[1].\"No.\", Item[5].\"No.\", Today);\n+\n+ // [WHEN] Run the Exchange Production BOM Item report\n+ RunExchangeProductionBOMItemReport();\n+\n+ // [THEN] Validate that the replaced item does NOT have an Ending Date when a new version is created\n+ ValidateEndingDateNotSet(ProductionBOMHeader.\"No.\", Item[1].\"No.\");\n+\n+ // [AND] Ensure no test artifacts are left behind\n+ LibraryVariableStorage.AssertEmpty();\n+ end;\n+\n \n local procedure Initialize()\n var\n@@ -7704,6 +7752,23 @@\n standardTask.Modify(true);\n end;\n \n+ local procedure EnqueueExchProdBOMItemReportParameter(ExchangeItemNo: Code[20]; ReplaceItemNo: Code[20]; StartDate: Date)\n+ begin\n+ LibraryVariableStorage.Enqueue(ExchangeItemNo);\n+ LibraryVariableStorage.Enqueue(ReplaceItemNo);\n+ LibraryVariableStorage.Enqueue(StartDate);\n+ end;\n+\n+ local procedure ValidateEndingDateNotSet(ProdBOMHeaderNo: Code[20]; ItemNo: Code[20])\n+ var\n+ ProductionBOMLine: Record \"Production BOM Line\";\n+ begin\n+ ProductionBOMLine.SetRange(\"Production BOM No.\", ProdBOMHeaderNo);\n+ ProductionBOMLine.SetRange(\"No.\", ItemNo);\n+ ProductionBOMLine.FindFirst();\n+ Assert.AreEqual(0D, ProductionBOMLine.\"Ending Date\", 'Ending Date should not be set when a new version is created.')\n+ end;\n+\n [ModalPageHandler]\n [Scope('OnPrem')]\n procedure ProdBOMVersionComparisonHandlerForActionSet(var ProdBOMVersionComparison: TestPage \"Prod. BOM Version Comparison\")\n@@ -7793,5 +7858,28 @@\n ExchangeProductionBOMItem.WithType.AssertEquals(ProductionBOMLineType::Item);// [THEN] Verify WithType Default Type is ITEM\n ExchangeProductionBOMItem.OK().Invoke();\n end;\n+\n+ [RequestPageHandler]\n+ procedure RunExchangeProdBOMItemReportWithStartDateParameter(var ExchangeProductionBOMItem: TestRequestPage \"Exchange Production BOM Item\")\n+ var\n+ FromProductionBOMLineType: Enum \"Production BOM Line Type\";\n+ ExchangeItemNo: Variant;\n+ ReplaceItemNo: Variant;\n+ StartDate: Variant;\n+ begin\n+ ExchangeItemNo := LibraryVariableStorage.DequeueText();\n+ ReplaceItemNo := LibraryVariableStorage.DequeueText();\n+ StartDate := LibraryVariableStorage.DequeueDate();\n+ ExchangeProductionBOMItem.ExchangeType.SetValue(FromProductionBOMLineType::Item);\n+ ExchangeProductionBOMItem.ExchangeNo.SetValue(ExchangeItemNo);\n+ ExchangeProductionBOMItem.WithType.SetValue(FromProductionBOMLineType::Item);\n+ ExchangeProductionBOMItem.WithNo.SetValue(ReplaceItemNo);\n+ ExchangeProductionBOMItem.\"Create New Version\".SetValue(true);\n+ ExchangeProductionBOMItem.\"Delete Exchanged Component\".SetValue(false);\n+ ExchangeProductionBOMItem.Recertify.SetValue(true);\n+ ExchangeProductionBOMItem.CopyRoutingLink.SetValue(true);\n+ ExchangeProductionBOMItem.StartingDate.SetValue(StartDate);\n+ ExchangeProductionBOMItem.OK().Invoke();\n+ end;\n }\n \n", "patch": "diff --git a/App/Layers/W1/BaseApp/Manufacturing/ProductionBOM/ExchangeProductionBOMItem.Report.al b/App/Layers/W1/BaseApp/Manufacturing/ProductionBOM/ExchangeProductionBOMItem.Report.al\n--- a/App/Layers/W1/BaseApp/Manufacturing/ProductionBOM/ExchangeProductionBOMItem.Report.al\n+++ b/App/Layers/W1/BaseApp/Manufacturing/ProductionBOM/ExchangeProductionBOMItem.Report.al\n@@ -157,7 +157,7 @@\n CopyPositionFields(ProductionBOMLine2, ProductionBOMLine3);\n ShouldModifyProductionBOMLine := true;\n OnIntegerOnPostDataItemOnBeforeModifyProductionBOMLine(ProductionBOMLine, ShouldModifyProductionBOMLine);\n- if not ShouldModifyProductionBOMLine then begin\n+ if ShouldModifyProductionBOMLine and not CreateNewVersion then begin\n ProductionBOMLine.\"Ending Date\" := StartingDate - 1;\n ProductionBOMLine.Modify();\n end;\n"} +{"instance_id": "microsoftInternal__NAV-224668__cf-1", "base_instance_id": "microsoftInternal__NAV-224668", "variant_description": "Headline should only be hidden for the current user, without affecting other users' headline visibility", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-224668__cf-1", "FAIL_TO_PASS": [{"codeunitID": 139600, "functionName": ["TestHeadlineCanBeHidden"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Apps/W1/EssentialBusinessHeadlines/test/src/codeunits/TestEssentialBusHeadlines.Codeunit.al b/App/Apps/W1/EssentialBusinessHeadlines/test/src/codeunits/TestEssentialBusHeadlines.Codeunit.al\n--- a/App/Apps/W1/EssentialBusinessHeadlines/test/src/codeunits/TestEssentialBusHeadlines.Codeunit.al\n+++ b/App/Apps/W1/EssentialBusinessHeadlines/test/src/codeunits/TestEssentialBusHeadlines.Codeunit.al\n@@ -700,6 +700,33 @@ codeunit 139600 \"Test Essential Bus. Headlines\"\n TestRecentlyOverdueInvoiceWithOverdueInvoices(5);\n end;\n \n+ [Test]\n+ procedure TestHeadlineCanBeHidden()\n+ var\n+ CustLedgerEntry: Record \"Cust. Ledger Entry\";\n+ begin\n+ // [GIVEN] Initial state when no data is present\n+ Initialize();\n+\n+ // [GIVEN] One invoice that was due yesterday\n+ CreateInvoicesWithDueDateYesterday(1);\n+\n+ // [WHEN] Run the headline computation\n+ EssentialBusHeadlineMgt.HandleRecentlyOverdueInvoices();\n+\n+ // [THEN] Recently overdue invoices headline is visible\n+ Assert.IsTrue(GetVisibility(EssentialBusinessHeadline.\"Headline Name\"::RecentlyOverdueInvoices), 'Expected recently overdue invoices headline to be visible');\n+\n+ // [WHEN] Simulate no more overdue invoices by deleting all customer ledger entries\n+ CustLedgerEntry.DeleteAll();\n+\n+ // [WHEN] Recompute the headline computation\n+ EssentialBusHeadlineMgt.HandleRecentlyOverdueInvoices();\n+\n+ // [THEN] The headline is hidden only for the current user\n+ Assert.IsFalse(GetVisibility(EssentialBusinessHeadline.\"Headline Name\"::RecentlyOverdueInvoices), 'Expected recently overdue invoices headline to be not visible for current user after recompute');\n+ end;\n+\n local procedure TestRecentlyOverdueInvoiceWithOverdueInvoices(NumberOfNewlyOverdueInvoices: Integer)\n var\n OverdueInvoicesTxt: Text;\n", "patch": "diff --git a/App/Apps/W1/EssentialBusinessHeadlines/app/src/codeunits/EssentialBusHeadlineMgt.Codeunit.al b/App/Apps/W1/EssentialBusinessHeadlines/app/src/codeunits/EssentialBusHeadlineMgt.Codeunit.al\n--- a/App/Apps/W1/EssentialBusinessHeadlines/app/src/codeunits/EssentialBusHeadlineMgt.Codeunit.al\n+++ b/App/Apps/W1/EssentialBusinessHeadlines/app/src/codeunits/EssentialBusHeadlineMgt.Codeunit.al\n@@ -677,7 +677,7 @@ codeunit 1437 \"Essential Bus. Headline Mgt.\"\n var\n EssentialBusinessHeadline: Record \"Ess. Business Headline Per Usr\";\n begin\n- if EssentialBusinessHeadline.Get(HeadlineName) then begin\n+ if EssentialBusinessHeadline.Get(HeadlineName, UserSecurityId()) then begin // ensure per-user visibility update\n EssentialBusinessHeadline.Validate(\"Headline Visible\", false);\n EssentialBusinessHeadline.Modify();\n end;\n"} +{"instance_id": "microsoftInternal__NAV-224668__cf-2", "base_instance_id": "microsoftInternal__NAV-224668", "variant_description": "Headline should not trigger a database modify if it is already hidden (idempotency)", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-224668__cf-2", "FAIL_TO_PASS": [{"codeunitID": 139600, "functionName": ["TestHeadlineCanBeHidden"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Apps/W1/EssentialBusinessHeadlines/test/src/codeunits/TestEssentialBusHeadlines.Codeunit.al b/App/Apps/W1/EssentialBusinessHeadlines/test/src/codeunits/TestEssentialBusHeadlines.Codeunit.al\n--- a/App/Apps/W1/EssentialBusinessHeadlines/test/src/codeunits/TestEssentialBusHeadlines.Codeunit.al\n+++ b/App/Apps/W1/EssentialBusinessHeadlines/test/src/codeunits/TestEssentialBusHeadlines.Codeunit.al\n@@ -700,6 +700,39 @@ codeunit 139600 \"Test Essential Bus. Headlines\"\n TestRecentlyOverdueInvoiceWithOverdueInvoices(5);\n end;\n \n+ [Test]\n+ procedure TestHeadlineCanBeHidden()\n+ var\n+ CustLedgerEntry: Record \"Cust. Ledger Entry\";\n+ begin\n+ // [GIVEN] Initial state when no data is present\n+ Initialize();\n+\n+ // [GIVEN] One invoice that was due yesterday\n+ CreateInvoicesWithDueDateYesterday(1);\n+\n+ // [WHEN] Run the headline computation\n+ EssentialBusHeadlineMgt.HandleRecentlyOverdueInvoices();\n+\n+ // [THEN] Recently overdue invoices headline is visible\n+ Assert.IsTrue(GetVisibility(EssentialBusinessHeadline.\"Headline Name\"::RecentlyOverdueInvoices), 'Expected recently overdue invoices headline to be visible');\n+\n+ // [WHEN] Simulate no more overdue invoices by deleting all customer ledger entries\n+ CustLedgerEntry.DeleteAll();\n+\n+ // [WHEN] Recompute the headline computation\n+ EssentialBusHeadlineMgt.HandleRecentlyOverdueInvoices();\n+\n+ // [THEN] The headline is hidden\n+ Assert.IsFalse(GetVisibility(EssentialBusinessHeadline.\"Headline Name\"::RecentlyOverdueInvoices), 'Expected recently overdue invoices headline to be not visible after recompute');\n+\n+ // [WHEN] Recompute again (idempotency)\n+ EssentialBusHeadlineMgt.HandleRecentlyOverdueInvoices();\n+\n+ // [THEN] No error and state remains hidden\n+ Assert.IsFalse(GetVisibility(EssentialBusinessHeadline.\"Headline Name\"::RecentlyOverdueInvoices), 'Expected headline to remain hidden without redundant update');\n+ end;\n+\n local procedure TestRecentlyOverdueInvoiceWithOverdueInvoices(NumberOfNewlyOverdueInvoices: Integer)\n var\n OverdueInvoicesTxt: Text;\n", "patch": "diff --git a/App/Apps/W1/EssentialBusinessHeadlines/app/src/codeunits/EssentialBusHeadlineMgt.Codeunit.al b/App/Apps/W1/EssentialBusinessHeadlines/app/src/codeunits/EssentialBusHeadlineMgt.Codeunit.al\n--- a/App/Apps/W1/EssentialBusinessHeadlines/app/src/codeunits/EssentialBusHeadlineMgt.Codeunit.al\n+++ b/App/Apps/W1/EssentialBusinessHeadlines/app/src/codeunits/EssentialBusHeadlineMgt.Codeunit.al\n@@ -677,7 +677,9 @@ codeunit 1437 \"Essential Bus. Headline Mgt.\"\n var\n EssentialBusinessHeadline: Record \"Ess. Business Headline Per Usr\";\n begin\n- if EssentialBusinessHeadline.Get(HeadlineName) then begin\n- EssentialBusinessHeadline.Validate(\"Headline Visible\", false);\n- EssentialBusinessHeadline.Modify();\n+ if EssentialBusinessHeadline.Get(HeadlineName, UserSecurityId()) then begin\n+ if EssentialBusinessHeadline.\"Headline Visible\" then begin\n+ EssentialBusinessHeadline.Validate(\"Headline Visible\", false);\n+ EssentialBusinessHeadline.Modify();\n+ end;\n end;\n"} +{"instance_id": "microsoftInternal__NAV-224668__cf-3", "base_instance_id": "microsoftInternal__NAV-224668", "variant_description": "If the headline record does not exist for the user, it should be created as hidden instead of doing nothing (creation fallback)", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-224668__cf-3", "FAIL_TO_PASS": [{"codeunitID": 139600, "functionName": ["TestHeadlineCanBeHidden"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Apps/W1/EssentialBusinessHeadlines/test/src/codeunits/TestEssentialBusHeadlines.Codeunit.al b/App/Apps/W1/EssentialBusinessHeadlines/test/src/codeunits/TestEssentialBusHeadlines.Codeunit.al\n--- a/App/Apps/W1/EssentialBusinessHeadlines/test/src/codeunits/TestEssentialBusHeadlines.Codeunit.al\n+++ b/App/Apps/W1/EssentialBusinessHeadlines/test/src/codeunits/TestEssentialBusHeadlines.Codeunit.al\n@@ -700,6 +700,37 @@ codeunit 139600 \"Test Essential Bus. Headlines\"\n TestRecentlyOverdueInvoiceWithOverdueInvoices(5);\n end;\n \n+ [Test]\n+ procedure TestHeadlineCanBeHidden()\n+ var\n+ CustLedgerEntry: Record \"Cust. Ledger Entry\";\n+ begin\n+ // [GIVEN] Initial state when no data is present\n+ Initialize();\n+\n+ // [GIVEN] Ensure no headline exists for current user\n+ if EssentialBusinessHeadline.Get(EssentialBusinessHeadline.\"Headline Name\"::RecentlyOverdueInvoices, UserSecurityId()) then\n+ EssentialBusinessHeadline.Delete();\n+\n+ // [GIVEN] One invoice that was due yesterday\n+ CreateInvoicesWithDueDateYesterday(1);\n+\n+ // [WHEN] Run the headline computation\n+ EssentialBusHeadlineMgt.HandleRecentlyOverdueInvoices();\n+\n+ // [THEN] Recently overdue invoices headline is visible\n+ Assert.IsTrue(GetVisibility(EssentialBusinessHeadline.\"Headline Name\"::RecentlyOverdueInvoices), 'Expected recently overdue invoices headline to be visible');\n+\n+ // [WHEN] Simulate no more overdue invoices by deleting all customer ledger entries\n+ CustLedgerEntry.DeleteAll();\n+\n+ // [WHEN] Recompute the headline computation\n+ EssentialBusHeadlineMgt.HandleRecentlyOverdueInvoices();\n+\n+ // [THEN] The headline is hidden\n+ Assert.IsFalse(GetVisibility(EssentialBusinessHeadline.\"Headline Name\"::RecentlyOverdueInvoices), 'Expected recently overdue invoices headline to be not visible after recompute');\n+ end;\n+\n local procedure TestRecentlyOverdueInvoiceWithOverdueInvoices(NumberOfNewlyOverdueInvoices: Integer)\n var\n OverdueInvoicesTxt: Text;\n", "patch": "diff --git a/App/Apps/W1/EssentialBusinessHeadlines/app/src/codeunits/EssentialBusHeadlineMgt.Codeunit.al b/App/Apps/W1/EssentialBusinessHeadlines/app/src/codeunits/EssentialBusHeadlineMgt.Codeunit.al\n--- a/App/Apps/W1/EssentialBusinessHeadlines/app/src/codeunits/EssentialBusHeadlineMgt.Codeunit.al\n+++ b/App/Apps/W1/EssentialBusinessHeadlines/app/src/codeunits/EssentialBusHeadlineMgt.Codeunit.al\n@@ -677,7 +677,13 @@ codeunit 1437 \"Essential Bus. Headline Mgt.\"\n var\n EssentialBusinessHeadline: Record \"Ess. Business Headline Per Usr\";\n begin\n- if EssentialBusinessHeadline.Get(HeadlineName) then begin\n+ if not EssentialBusinessHeadline.Get(HeadlineName, UserSecurityId()) then begin\n+ EssentialBusinessHeadline.Init();\n+ EssentialBusinessHeadline.Validate(\"Headline Name\", HeadlineName);\n+ EssentialBusinessHeadline.Validate(\"User Id\", UserSecurityId());\n+ EssentialBusinessHeadline.Insert();\n+ end;\n+ if EssentialBusinessHeadline.Get(HeadlineName, UserSecurityId()) then begin\n EssentialBusinessHeadline.Validate(\"Headline Visible\", false);\n EssentialBusinessHeadline.Modify();\n end;\n"} +{"instance_id": "microsoftInternal__NAV-218323__cf-1", "base_instance_id": "microsoftInternal__NAV-218323", "variant_description": "VAT Settlement should bypass the Journal Template Name mandatory check only when Preview mode is used (Post = false)", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-218323__cf-1", "FAIL_TO_PASS": [{"codeunitID": 134992, "functionName": ["PostVATSettlementWhenJournalTemplateNameMandatoryIsEnabled"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/ERMFinancialReportsIV.Codeunit.al b/App/Layers/W1/Tests/ERM/ERMFinancialReportsIV.Codeunit.al\nindex 5c994880ad2..b8c9d7f62bd 100644\n--- a/App/Layers/W1/Tests/ERM/ERMFinancialReportsIV.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ERMFinancialReportsIV.Codeunit.al\n@@ -765,6 +765,53 @@ codeunit 134992 \"ERM Financial Reports IV\"\n LibraryVariableStorage.AssertEmpty();\n end;\n \n+ [Test]\n+ [HandlerFunctions('RHCalcAndPostVATSettlementSetCountryFilter')]\n+ procedure PostVATSettlementWhenJournalTemplateNameMandatoryIsEnabled()\n+ var\n+ Customer: Record Customer;\n+ GenJournalLine: Record \"Gen. Journal Line\";\n+ VATPostingSetup: Record \"VAT Posting Setup\";\n+ VATEntry: Record \"VAT Entry\";\n+ GLEntry: Record \"G/L Entry\";\n+ MyNotifications: Record \"My Notifications\";\n+ GeneralLedgerSetup: Record \"General Ledger Setup\";\n+ InstructionMgt: Codeunit \"Instruction Mgt.\";\n+ PostingDate: Date;\n+ begin\n+ // [SCENARIO 571198] No error should appears when user try to Calculate and Post VAT Settlement when Journal Template Name Mandatory is enabled\n+ Initialize();\n+\n+ // [GIVEN] Set Journal Templ. Name Mandatory to false on General ledger Setup.\n+ GeneralLedgerSetup.Get();\n+ GeneralLedgerSetup.\"Journal Templ. Name Mandatory\" := true;\n+ GeneralLedgerSetup.Modify();\n+\n+ MyNotifications.Disable(InstructionMgt.GetPostingAfterWorkingDateNotificationId());\n+ GLEntry.SetCurrentKey(\"Posting Date\", \"G/L Account No.\", \"Dimension Set ID\");\n+ GLEntry.FindLast();\n+ PostingDate := GLEntry.\"Posting Date\" + 1;\n+\n+ // [GIVEN] Create customer and post a sales invoice\n+ LibrarySales.CreateCustomerWithCountryCodeAndVATRegNo(Customer);\n+ CreateAndPostGeneralJournalLine(\n+ VATPostingSetup, PostingDate, GenJournalLine.\"Account Type\"::Customer, Customer.\"No.\",\n+ GenJournalLine.\"Gen. Posting Type\"::Sale, 1, true);\n+\n+ LibraryVariableStorage.Enqueue(Customer.\"Country/Region Code\"); // set country/region filter for RHCalcAndPostVATSettlementSetCountryFilter\n+ Clear(LibraryReportDataset);\n+\n+ // [WHEN] Run Calculate and Post VAT Settlement report\n+ SaveCalcAndPostVATSettlementReport(VATPostingSetup, PostingDate, PostingDate, PostingDate, Format(LibraryRandom.RandInt(100)), false);\n+\n+ // [THEN] VAT Entry for the second invoice is closed\n+ // [THEN] Closing entry created with type 'Settlement'\n+ VATEntry.SetRange(\"Bill-to/Pay-to No.\", Customer.\"No.\");\n+ VATEntry.FindFirst();\n+ VATEntry.Get(VATEntry.\"Closed by Entry No.\");\n+ VATEntry.TestField(Type, VATEntry.Type::Settlement);\n+ end;\n+\n local procedure Initialize()\n var\n ObjectOptions: Record \"Object Options\";\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Finance/GeneralLedger/Journal/GenJnlCheckLine.Codeunit.al b/App/Layers/W1/BaseApp/Finance/GeneralLedger/Journal/GenJnlCheckLine.Codeunit.al\nindex c7ffd42ba4c..d596be8a7fd 100644\n--- a/App/Layers/W1/BaseApp/Finance/GeneralLedger/Journal/GenJnlCheckLine.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Finance/GeneralLedger/Journal/GenJnlCheckLine.Codeunit.al\n@@ -57,6 +57,7 @@ codeunit 11 \"Gen. Jnl.-Check Line\"\n OverrideDimErr: Boolean;\n LogErrorMode: Boolean;\n IsBatchMode: Boolean;\n+ IgnoreJournalTemplNameMandatoryCheck: Boolean;\n \n #pragma warning disable AA0074\n Text000: Label 'can only be a closing date for G/L entries';\n@@ -380,6 +381,11 @@ codeunit 11 \"Gen. Jnl.-Check Line\"\n OverrideDimErr := true;\n end;\n \n+ procedure SetIgnoreJournalTemplNameMandatoryCheck()\n+ begin\n+ IgnoreJournalTemplNameMandatoryCheck := true;\n+ end;\n+\n local procedure CheckDates(GenJnlLine: Record \"Gen. Journal Line\")\n var\n AccountingPeriodMgt: Codeunit \"Accounting Period Mgt.\";\n@@ -400,8 +406,9 @@ codeunit 11 \"Gen. Jnl.-Check Line\"\n end;\n end;\n \n- if GLSetup.\"Journal Templ. Name Mandatory\" then\n- GenJnlLine.TestField(\"Journal Template Name\", ErrorInfo.Create());\n+ if not IgnoreJournalTemplNameMandatoryCheck then\n+ if GLSetup.\"Journal Templ. Name Mandatory\" then\n+ GenJnlLine.TestField(\"Journal Template Name\", ErrorInfo.Create());\n OnBeforeDateNotAllowed(GenJnlLine, DateCheckDone);\n if not DateCheckDone then\n if DateNotAllowed(GenJnlLine.\"Posting Date\", GenJnlLine.\"Journal Template Name\") then\ndiff --git a/App/Layers/W1/BaseApp/Finance/GeneralLedger/Posting/GenJnlPostLine.Codeunit.al b/App/Layers/W1/BaseApp/Finance/GeneralLedger/Posting/GenJnlPostLine.Codeunit.al\nindex da61c5f2c5d..35021399a12 100644\n--- a/App/Layers/W1/BaseApp/Finance/GeneralLedger/Posting/GenJnlPostLine.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Finance/GeneralLedger/Posting/GenJnlPostLine.Codeunit.al\n@@ -138,6 +138,7 @@ codeunit 12 \"Gen. Jnl.-Post Line\"\n MultiplePostingGroups: Boolean;\n SourceCodeSetupRead: Boolean;\n IsGLRegInserted: Boolean;\n+ IgnoreJournalTemplNameMandatoryCheck: Boolean;\n \n NeedsRoundingErr: Label '%1 needs to be rounded', Comment = '%1 - amount';\n PurchaseAlreadyExistsErr: Label 'Purchase %1 %2 already exists for this vendor.', Comment = '%1 = Document Type; %2 = Document No.';\n@@ -332,6 +333,8 @@ codeunit 12 \"Gen. Jnl.-Post Line\"\n if CheckLine then begin\n if OverrideDimErr then\n GenJnlCheckLine.SetOverDimErr();\n+ if IgnoreJournalTemplNameMandatoryCheck then\n+ GenJnlCheckLine.SetIgnoreJournalTemplNameMandatoryCheck();\n OnCheckGenJnlLineOnBeforeRunCheck(GenJournalLine);\n GenJnlCheckLine.RunCheck(GenJournalLine);\n end;\n@@ -7113,6 +7116,15 @@ codeunit 12 \"Gen. Jnl.-Post Line\"\n Error(DimMgt.GetDimValuePostingErr());\n end;\n \n+ /// \n+ /// Sets the global variable IgnoreJournalTemplNameMandatoryCheck for the current instance of the codeunit.\n+ /// If IgnoreJournalTemplNameMandatoryCheck is not set \"Journal Templ. Name Mandatory\" check is performed before gen. journal line \n+ /// \n+ procedure SetIgnoreJournalTemplNameMandatoryCheck()\n+ begin\n+ IgnoreJournalTemplNameMandatoryCheck := true;\n+ end;\n+\n local procedure IsGainLossAccount(CurrencyCode: Code[10]; GLAccNo: Code[20]): Boolean\n var\n Currency: Record Currency;\ndiff --git a/App/Layers/W1/BaseApp/Finance/VAT/Reporting/CalcandPostVATSettlement.Report.al b/App/Layers/W1/BaseApp/Finance/VAT/Reporting/CalcandPostVATSettlement.Report.al\nindex 88068be074e..f09dab3691a 100644\n--- a/App/Layers/W1/BaseApp/Finance/VAT/Reporting/CalcandPostVATSettlement.Report.al\n+++ b/App/Layers/W1/BaseApp/Finance/VAT/Reporting/CalcandPostVATSettlement.Report.al\n@@ -849,6 +849,7 @@ report 20 \"Calc. and Post VAT Settlement\"\n GenJnlLine, 0, DefaultDimSource, GenJnlLine.\"Source Code\",\n GenJnlLine.\"Shortcut Dimension 1 Code\", GenJnlLine.\"Shortcut Dimension 2 Code\", 0, 0);\n OnPostGenJnlLineOnBeforeGenJnlPostLineRun(GenJnlLine);\n+ if not Post then\n+ GenJnlPostLine.SetIgnoreJournalTemplNameMandatoryCheck();\n GenJnlPostLine.Run(GenJnlLine);\n end;\n \n"} +{"instance_id": "microsoftInternal__NAV-218323__cf-2", "base_instance_id": "microsoftInternal__NAV-218323", "variant_description": "VAT Settlement should bypass the check only when called from the VAT Settlement report (not general posting)", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-218323__cf-2", "FAIL_TO_PASS": [{"codeunitID": 134992, "functionName": ["PostVATSettlementWhenJournalTemplateNameMandatoryIsEnabled"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/ERMFinancialReportsIV.Codeunit.al b/App/Layers/W1/Tests/ERM/ERMFinancialReportsIV.Codeunit.al\nindex 5c994880ad2..b8c9d7f62bd 100644\n--- a/App/Layers/W1/Tests/ERM/ERMFinancialReportsIV.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ERMFinancialReportsIV.Codeunit.al\n@@ -765,6 +765,53 @@ codeunit 134992 \"ERM Financial Reports IV\"\n LibraryVariableStorage.AssertEmpty();\n end;\n \n+ [Test]\n+ [HandlerFunctions('RHCalcAndPostVATSettlementSetCountryFilter')]\n+ procedure PostVATSettlementWhenJournalTemplateNameMandatoryIsEnabled()\n+ var\n+ Customer: Record Customer;\n+ GenJournalLine: Record \"Gen. Journal Line\";\n+ VATPostingSetup: Record \"VAT Posting Setup\";\n+ VATEntry: Record \"VAT Entry\";\n+ GLEntry: Record \"G/L Entry\";\n+ MyNotifications: Record \"My Notifications\";\n+ GeneralLedgerSetup: Record \"General Ledger Setup\";\n+ InstructionMgt: Codeunit \"Instruction Mgt.\";\n+ PostingDate: Date;\n+ begin\n+ // [SCENARIO 571198] No error should appears when user try to Calculate and Post VAT Settlement when Journal Template Name Mandatory is enabled\n+ Initialize();\n+\n+ // [GIVEN] Set Journal Templ. Name Mandatory to false on General ledger Setup.\n+ GeneralLedgerSetup.Get();\n+ GeneralLedgerSetup.\"Journal Templ. Name Mandatory\" := true;\n+ GeneralLedgerSetup.Modify();\n+\n+ MyNotifications.Disable(InstructionMgt.GetPostingAfterWorkingDateNotificationId());\n+ GLEntry.SetCurrentKey(\"Posting Date\", \"G/L Account No.\", \"Dimension Set ID\");\n+ GLEntry.FindLast();\n+ PostingDate := GLEntry.\"Posting Date\" + 1;\n+\n+ // [GIVEN] Create customer and post a sales invoice\n+ LibrarySales.CreateCustomerWithCountryCodeAndVATRegNo(Customer);\n+ CreateAndPostGeneralJournalLine(\n+ VATPostingSetup, PostingDate, GenJournalLine.\"Account Type\"::Customer, Customer.\"No.\",\n+ GenJournalLine.\"Gen. Posting Type\"::Sale, 1, true);\n+\n+ LibraryVariableStorage.Enqueue(Customer.\"Country/Region Code\"); // set country/region filter for RHCalcAndPostVATSettlementSetCountryFilter\n+ Clear(LibraryReportDataset);\n+\n+ // [WHEN] Run Calculate and Post VAT Settlement report\n+ SaveCalcAndPostVATSettlementReport(VATPostingSetup, PostingDate, PostingDate, PostingDate, Format(LibraryRandom.RandInt(100)), true);\n+\n+ // [THEN] VAT Entry for the second invoice is closed\n+ // [THEN] Closing entry created with type 'Settlement'\n+ VATEntry.SetRange(\"Bill-to/Pay-to No.\", Customer.\"No.\");\n+ VATEntry.FindFirst();\n+ VATEntry.Get(VATEntry.\"Closed by Entry No.\");\n+ VATEntry.TestField(Type, VATEntry.Type::Settlement);\n+ end;\n+\n local procedure Initialize()\n var\n ObjectOptions: Record \"Object Options\";\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Finance/GeneralLedger/Journal/GenJnlCheckLine.Codeunit.al b/App/Layers/W1/BaseApp/Finance/GeneralLedger/Journal/GenJnlCheckLine.Codeunit.al\nindex c7ffd42ba4c..d596be8a7fd 100644\n--- a/App/Layers/W1/BaseApp/Finance/GeneralLedger/Journal/GenJnlCheckLine.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Finance/GeneralLedger/Journal/GenJnlCheckLine.Codeunit.al\n@@ -57,6 +57,7 @@ codeunit 11 \"Gen. Jnl.-Check Line\"\n OverrideDimErr: Boolean;\n LogErrorMode: Boolean;\n IsBatchMode: Boolean;\n+ IgnoreJournalTemplNameMandatoryCheck: Boolean;\n \n #pragma warning disable AA0074\n Text000: Label 'can only be a closing date for G/L entries';\n@@ -380,6 +381,11 @@ codeunit 11 \"Gen. Jnl.-Check Line\"\n OverrideDimErr := true;\n end;\n \n+ procedure SetIgnoreJournalTemplNameMandatoryCheck()\n+ begin\n+ IgnoreJournalTemplNameMandatoryCheck := true;\n+ end;\n+\n local procedure CheckDates(GenJnlLine: Record \"Gen. Journal Line\")\n var\n AccountingPeriodMgt: Codeunit \"Accounting Period Mgt.\";\n@@ -400,8 +406,9 @@ codeunit 11 \"Gen. Jnl.-Check Line\"\n end;\n end;\n \n- if GLSetup.\"Journal Templ. Name Mandatory\" then\n- GenJnlLine.TestField(\"Journal Template Name\", ErrorInfo.Create());\n+ if not IgnoreJournalTemplNameMandatoryCheck then\n+ if GLSetup.\"Journal Templ. Name Mandatory\" then\n+ GenJnlLine.TestField(\"Journal Template Name\", ErrorInfo.Create());\n OnBeforeDateNotAllowed(GenJnlLine, DateCheckDone);\n if not DateCheckDone then\n if DateNotAllowed(GenJnlLine.\"Posting Date\", GenJnlLine.\"Journal Template Name\") then\ndiff --git a/App/Layers/W1/BaseApp/Finance/GeneralLedger/Posting/GenJnlPostLine.Codeunit.al b/App/Layers/W1/BaseApp/Finance/GeneralLedger/Posting/GenJnlPostLine.Codeunit.al\nindex da61c5f2c5d..35021399a12 100644\n--- a/App/Layers/W1/BaseApp/Finance/GeneralLedger/Posting/GenJnlPostLine.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Finance/GeneralLedger/Posting/GenJnlPostLine.Codeunit.al\n@@ -138,6 +138,7 @@ codeunit 12 \"Gen. Jnl.-Post Line\"\n MultiplePostingGroups: Boolean;\n SourceCodeSetupRead: Boolean;\n IsGLRegInserted: Boolean;\n+ IgnoreJournalTemplNameMandatoryCheck: Boolean;\n \n NeedsRoundingErr: Label '%1 needs to be rounded', Comment = '%1 - amount';\n PurchaseAlreadyExistsErr: Label 'Purchase %1 %2 already exists for this vendor.', Comment = '%1 = Document Type; %2 = Document No.';\n@@ -332,6 +333,8 @@ codeunit 12 \"Gen. Jnl.-Post Line\"\n if CheckLine then begin\n if OverrideDimErr then\n GenJnlCheckLine.SetOverDimErr();\n+ if IgnoreJournalTemplNameMandatoryCheck then\n+ GenJnlCheckLine.SetIgnoreJournalTemplNameMandatoryCheck();\n OnCheckGenJnlLineOnBeforeRunCheck(GenJournalLine);\n GenJnlCheckLine.RunCheck(GenJournalLine);\n end;\n@@ -7113,6 +7116,15 @@ codeunit 12 \"Gen. Jnl.-Post Line\"\n Error(DimMgt.GetDimValuePostingErr());\n end;\n \n+ /// \n+ /// Sets the global variable IgnoreJournalTemplNameMandatoryCheck for the current instance of the codeunit.\n+ /// If IgnoreJournalTemplNameMandatoryCheck is not set \"Journal Templ. Name Mandatory\" check is performed before gen. journal line \n+ /// \n+ procedure SetIgnoreJournalTemplNameMandatoryCheck()\n+ begin\n+ IgnoreJournalTemplNameMandatoryCheck := true;\n+ end;\n+\n local procedure IsGainLossAccount(CurrencyCode: Code[10]; GLAccNo: Code[20]): Boolean\n var\n Currency: Record Currency;\ndiff --git a/App/Layers/W1/BaseApp/Finance/VAT/Reporting/CalcandPostVATSettlement.Report.al b/App/Layers/W1/BaseApp/Finance/VAT/Reporting/CalcandPostVATSettlement.Report.al\nindex 88068be074e..f09dab3691a 100644\n--- a/App/Layers/W1/BaseApp/Finance/VAT/Reporting/CalcandPostVATSettlement.Report.al\n+++ b/App/Layers/W1/BaseApp/Finance/VAT/Reporting/CalcandPostVATSettlement.Report.al\n@@ -849,6 +849,7 @@ report 20 \"Calc. and Post VAT Settlement\"\n GenJnlLine, 0, DefaultDimSource, GenJnlLine.\"Source Code\",\n GenJnlLine.\"Shortcut Dimension 1 Code\", GenJnlLine.\"Shortcut Dimension 2 Code\", 0, 0);\n OnPostGenJnlLineOnBeforeGenJnlPostLineRun(GenJnlLine);\n+ if CurrReport.ObjectId = Report::\"Calc. and Post VAT Settlement\" then\n+ GenJnlPostLine.SetIgnoreJournalTemplNameMandatoryCheck();\n GenJnlPostLine.Run(GenJnlLine);\n end;\n \n"} +{"instance_id": "microsoftInternal__NAV-218323__cf-3", "base_instance_id": "microsoftInternal__NAV-218323", "variant_description": "VAT Settlement should bypass the check only for Customer entries, not Vendor entries", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-218323__cf-3", "FAIL_TO_PASS": [{"codeunitID": 134992, "functionName": ["PostVATSettlementWhenJournalTemplateNameMandatoryIsEnabled"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/ERMFinancialReportsIV.Codeunit.al b/App/Layers/W1/Tests/ERM/ERMFinancialReportsIV.Codeunit.al\nindex 5c994880ad2..b8c9d7f62bd 100644\n--- a/App/Layers/W1/Tests/ERM/ERMFinancialReportsIV.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ERMFinancialReportsIV.Codeunit.al\n@@ -765,6 +765,53 @@ codeunit 134992 \"ERM Financial Reports IV\"\n LibraryVariableStorage.AssertEmpty();\n end;\n \n+ [Test]\n+ [HandlerFunctions('RHCalcAndPostVATSettlementSetCountryFilter')]\n+ procedure PostVATSettlementWhenJournalTemplateNameMandatoryIsEnabled()\n+ var\n+ Customer: Record Customer;\n+ GenJournalLine: Record \"Gen. Journal Line\";\n+ VATPostingSetup: Record \"VAT Posting Setup\";\n+ VATEntry: Record \"VAT Entry\";\n+ GLEntry: Record \"G/L Entry\";\n+ MyNotifications: Record \"My Notifications\";\n+ GeneralLedgerSetup: Record \"General Ledger Setup\";\n+ InstructionMgt: Codeunit \"Instruction Mgt.\";\n+ PostingDate: Date;\n+ begin\n+ // [SCENARIO 571198] No error should appears when user try to Calculate and Post VAT Settlement when Journal Template Name Mandatory is enabled\n+ Initialize();\n+\n+ // [GIVEN] Set Journal Templ. Name Mandatory to false on General ledger Setup.\n+ GeneralLedgerSetup.Get();\n+ GeneralLedgerSetup.\"Journal Templ. Name Mandatory\" := true;\n+ GeneralLedgerSetup.Modify();\n+\n+ MyNotifications.Disable(InstructionMgt.GetPostingAfterWorkingDateNotificationId());\n+ GLEntry.SetCurrentKey(\"Posting Date\", \"G/L Account No.\", \"Dimension Set ID\");\n+ GLEntry.FindLast();\n+ PostingDate := GLEntry.\"Posting Date\" + 1;\n+\n+ // [GIVEN] Create vendor and post a purchase invoice\n+ LibrarySales.CreateCustomerWithCountryCodeAndVATRegNo(Customer);\n+ CreateAndPostGeneralJournalLine(\n+ VATPostingSetup, PostingDate, GenJournalLine.\"Account Type\"::Vendor, Customer.\"No.\",\n+ GenJournalLine.\"Gen. Posting Type\"::Sale, 1, true);\n+\n+ LibraryVariableStorage.Enqueue(Customer.\"Country/Region Code\"); // set country/region filter for RHCalcAndPostVATSettlementSetCountryFilter\n+ Clear(LibraryReportDataset);\n+\n+ // [WHEN] Run Calculate and Post VAT Settlement report\n+ SaveCalcAndPostVATSettlementReport(VATPostingSetup, PostingDate, PostingDate, PostingDate, Format(LibraryRandom.RandInt(100)), true);\n+\n+ // [THEN] VAT Entry for the second invoice is closed\n+ // [THEN] Closing entry created with type 'Settlement'\n+ VATEntry.SetRange(\"Bill-to/Pay-to No.\", Customer.\"No.\");\n+ VATEntry.FindFirst();\n+ VATEntry.Get(VATEntry.\"Closed by Entry No.\");\n+ VATEntry.TestField(Type, VATEntry.Type::Settlement);\n+ end;\n+\n local procedure Initialize()\n var\n ObjectOptions: Record \"Object Options\";\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Finance/GeneralLedger/Journal/GenJnlCheckLine.Codeunit.al b/App/Layers/W1/BaseApp/Finance/GeneralLedger/Journal/GenJnlCheckLine.Codeunit.al\nindex c7ffd42ba4c..d596be8a7fd 100644\n--- a/App/Layers/W1/BaseApp/Finance/GeneralLedger/Journal/GenJnlCheckLine.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Finance/GeneralLedger/Journal/GenJnlCheckLine.Codeunit.al\n@@ -57,6 +57,7 @@ codeunit 11 \"Gen. Jnl.-Check Line\"\n OverrideDimErr: Boolean;\n LogErrorMode: Boolean;\n IsBatchMode: Boolean;\n+ IgnoreJournalTemplNameMandatoryCheck: Boolean;\n \n #pragma warning disable AA0074\n Text000: Label 'can only be a closing date for G/L entries';\n@@ -380,6 +381,11 @@ codeunit 11 \"Gen. Jnl.-Check Line\"\n OverrideDimErr := true;\n end;\n \n+ procedure SetIgnoreJournalTemplNameMandatoryCheck()\n+ begin\n+ IgnoreJournalTemplNameMandatoryCheck := true;\n+ end;\n+\n local procedure CheckDates(GenJnlLine: Record \"Gen. Journal Line\")\n var\n AccountingPeriodMgt: Codeunit \"Accounting Period Mgt.\";\n@@ -400,8 +406,9 @@ codeunit 11 \"Gen. Jnl.-Check Line\"\n end;\n end;\n \n- if GLSetup.\"Journal Templ. Name Mandatory\" then\n- GenJnlLine.TestField(\"Journal Template Name\", ErrorInfo.Create());\n+ if not IgnoreJournalTemplNameMandatoryCheck then\n+ if GLSetup.\"Journal Templ. Name Mandatory\" then\n+ GenJnlLine.TestField(\"Journal Template Name\", ErrorInfo.Create());\n OnBeforeDateNotAllowed(GenJnlLine, DateCheckDone);\n if not DateCheckDone then\n if DateNotAllowed(GenJnlLine.\"Posting Date\", GenJnlLine.\"Journal Template Name\") then\ndiff --git a/App/Layers/W1/BaseApp/Finance/GeneralLedger/Posting/GenJnlPostLine.Codeunit.al b/App/Layers/W1/BaseApp/Finance/GeneralLedger/Posting/GenJnlPostLine.Codeunit.al\nindex da61c5f2c5d..35021399a12 100644\n--- a/App/Layers/W1/BaseApp/Finance/GeneralLedger/Posting/GenJnlPostLine.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Finance/GeneralLedger/Posting/GenJnlPostLine.Codeunit.al\n@@ -138,6 +138,7 @@ codeunit 12 \"Gen. Jnl.-Post Line\"\n MultiplePostingGroups: Boolean;\n SourceCodeSetupRead: Boolean;\n IsGLRegInserted: Boolean;\n+ IgnoreJournalTemplNameMandatoryCheck: Boolean;\n \n NeedsRoundingErr: Label '%1 needs to be rounded', Comment = '%1 - amount';\n PurchaseAlreadyExistsErr: Label 'Purchase %1 %2 already exists for this vendor.', Comment = '%1 = Document Type; %2 = Document No.';\n@@ -332,6 +333,8 @@ codeunit 12 \"Gen. Jnl.-Post Line\"\n if CheckLine then begin\n if OverrideDimErr then\n GenJnlCheckLine.SetOverDimErr();\n+ if IgnoreJournalTemplNameMandatoryCheck then\n+ GenJnlCheckLine.SetIgnoreJournalTemplNameMandatoryCheck();\n OnCheckGenJnlLineOnBeforeRunCheck(GenJournalLine);\n GenJnlCheckLine.RunCheck(GenJournalLine);\n end;\n@@ -7113,6 +7116,15 @@ codeunit 12 \"Gen. Jnl.-Post Line\"\n Error(DimMgt.GetDimValuePostingErr());\n end;\n \n+ /// \n+ /// Sets the global variable IgnoreJournalTemplNameMandatoryCheck for the current instance of the codeunit.\n+ /// If IgnoreJournalTemplNameMandatoryCheck is not set \"Journal Templ. Name Mandatory\" check is performed before gen. journal line \n+ /// \n+ procedure SetIgnoreJournalTemplNameMandatoryCheck()\n+ begin\n+ IgnoreJournalTemplNameMandatoryCheck := true;\n+ end;\n+\n local procedure IsGainLossAccount(CurrencyCode: Code[10]; GLAccNo: Code[20]): Boolean\n var\n Currency: Record Currency;\ndiff --git a/App/Layers/W1/BaseApp/Finance/VAT/Reporting/CalcandPostVATSettlement.Report.al b/App/Layers/W1/BaseApp/Finance/VAT/Reporting/CalcandPostVATSettlement.Report.al\nindex 88068be074e..f09dab3691a 100644\n--- a/App/Layers/W1/BaseApp/Finance/VAT/Reporting/CalcandPostVATSettlement.Report.al\n+++ b/App/Layers/W1/BaseApp/Finance/VAT/Reporting/CalcandPostVATSettlement.Report.al\n@@ -849,6 +849,7 @@ report 20 \"Calc. and Post VAT Settlement\"\n GenJnlLine, 0, DefaultDimSource, GenJnlLine.\"Source Code\",\n GenJnlLine.\"Shortcut Dimension 1 Code\", GenJnlLine.\"Shortcut Dimension 2 Code\", 0, 0);\n OnPostGenJnlLineOnBeforeGenJnlPostLineRun(GenJnlLine);\n+ if GenJnlLine.\"Account Type\" = GenJnlLine.\"Account Type\"::Customer then\n+ GenJnlPostLine.SetIgnoreJournalTemplNameMandatoryCheck();\n GenJnlPostLine.Run(GenJnlLine);\n end;\n \n"} +{"instance_id": "microsoftInternal__NAV-193853__cf-1", "base_instance_id": "microsoftInternal__NAV-193853", "variant_description": "Require incoming document on last journal line instead of any line", "intervention_type": "Execution / Validation Semantics", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-193853__cf-1", "FAIL_TO_PASS": [{"codeunitID": 139515, "functionName": ["PostMultipleGeneralJournalLinesSamePostingDateDocNoOnlyFirstHasIncDoc"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Apps/W1/EnforcedDigitalVouchers/test/src/DigitalVouchersTests.Codeunit.al b/App/Apps/W1/EnforcedDigitalVouchers/test/src/DigitalVouchersTests.Codeunit.al\n--- a/App/Apps/W1/EnforcedDigitalVouchers/test/src/DigitalVouchersTests.Codeunit.al\n+++ b/App/Apps/W1/EnforcedDigitalVouchers/test/src/DigitalVouchersTests.Codeunit.al\n@@ -908,6 +908,59 @@\n \n \n \n+\n+ UnbindSubscription(DigVouchersDisableEnforce);\n+ end;\n+\n+ [Test]\n+ procedure PostMultipleGeneralJournalLinesSamePostingDateDocNoOnlyFirstHasIncDoc()\n+ var\n+ GenJournalLine: array[2] of Record \"Gen. Journal Line\";\n+ GenJournalLineToPost: Record \"Gen. Journal Line\";\n+ GenJournalTemplate: Record \"Gen. Journal Template\";\n+ GenJournalBatch: Record \"Gen. Journal Batch\";\n+ IncomingDocument: Record \"Incoming Document\";\n+ DigVouchersDisableEnforce: Codeunit \"Dig. Vouchers Disable Enforce\";\n+ DocNo: Code[20];\n+ i: Integer;\n+ begin\n+ // [SCENARIO 540097] Stan can post multiple general journals lines with same posting date and document number, only the first line has incoming document\n+\n+ Initialize();\n+ BindSubscription(DigVouchersDisableEnforce);\n+ // [GIVEN] Digital voucher feature is enabled\n+ EnableDigitalVoucherFeature();\n+ // [GIVEN] Digital voucher entry setup for general journal is \"Attachment\"\n+ InitSetupCheckOnly(\"Digital Voucher Entry Type\"::\"General Journal\", \"Digital Voucher Check Type\"::Attachment);\n+ // [GIVEN] General journal lines with the same template and batch are created\n+ // [GIVEN] General journal line \"X\" with \"Posting Date\" = 01.01.2024 and \"Document No.\" = \"X\"\n+ // [GIVEN] General journal line \"Y\" with \"Posting Date\" = 01.01.2024 and \"Document No.\" = \"X\"\n+ DocNo := LibraryUtility.GenerateGUID();\n+ LibraryERM.CreateGenJournalTemplate(GenJournalTemplate);\n+ LibraryERM.CreateGenJournalBatch(GenJournalBatch, GenJournalTemplate.Name);\n+ for i := 1 to ArrayLen(GenJournalLine) do begin\n+ LibraryJournals.CreateGenJournalLine(\n+ GenJournalLine[i], GenJournalBatch.\"Journal Template Name\", GenJournalBatch.Name,\n+ GenJournalLine[i].\"Document Type\"::Invoice, GenJournalLine[i].\"Account Type\"::\"G/L Account\",\n+ LibraryERM.CreateGLAccountNo(), GenJournalLine[i].\"Bal. Account Type\"::\"G/L Account\",\n+ LibraryERM.CreateGLAccountNo(), LibraryRandom.RandDec(100, 2));\n+ GenJournalLine[i].Validate(\"Document No.\", DocNo);\n+ GenJournalLine[i].Modify(true);\n+ end;\n+ // [GIVEN] Only journal line \"Y\" (last line) has incoming document attached\n+ GenJournalLine[2].\"Incoming Document Entry No.\" := MockIncomingDocument();\n+ GenJournalLine[2].Modify(true);\n+\n+ GenJournalLineToPost.SetRange(\"Journal Template Name\", GenJournalBatch.\"Journal Template Name\");\n+ GenJournalLineToPost.SetRange(\"Journal Batch Name\", GenJournalBatch.Name);\n+ GenJournalLineToPost.FindSet();\n+ // [WHEN] Post both general journal lines\n+ Codeunit.Run(Codeunit::\"Gen. Jnl.-Post Batch\", GenJournalLineToPost);\n+\n+ // [THEN] Posting is successfull and we have an incoming document with \"Posting Date\" = 01.01.2024 and \"Document No.\" = \"X\"\n+ IncomingDocument.SetRange(\"Posting Date\", GenJournalLine[1].\"Posting Date\");\n+ IncomingDocument.SetRange(\"Document No.\", GenJournalLine[1].\"Document No.\");\n+ Assert.RecordIsNotEmpty(IncomingDocument);\n \n UnbindSubscription(DigVouchersDisableEnforce);\n end;\n@@ -1076,6 +1129,19 @@\n exit(IncomingDocument.\"Entry No.\");\n end;\n \n+ local procedure MockIncomingDocument(): Integer\n+ var\n+ IncomingDocument: Record \"Incoming Document\";\n+ IncomingDocumentAttachment: Record \"Incoming Document Attachment\";\n+ begin\n+ IncomingDocument.\"Entry No.\" :=\n+ LibraryUtility.GetNewRecNo(IncomingDocument, IncomingDocument.FieldNo(\"Entry No.\"));\n+ IncomingDocument.Insert();\n+ IncomingDocumentAttachment.\"Incoming Document Entry No.\" := IncomingDocument.\"Entry No.\";\n+ IncomingDocumentAttachment.Insert();\n+ exit(IncomingDocument.\"Entry No.\");\n+ end;\n+\n local procedure ReceiveAndInvoicePurchaseInvoice(): Code[20]\n var\n PurchaseHeader: Record \"Purchase Header\";\n", "patch": "diff --git a/App/Apps/W1/EnforcedDigitalVouchers/app/src/Implementation/DigitalVoucherImpl.Codeunit.al b/App/Apps/W1/EnforcedDigitalVouchers/app/src/Implementation/DigitalVoucherImpl.Codeunit.al\n--- a/App/Apps/W1/EnforcedDigitalVouchers/app/src/Implementation/DigitalVoucherImpl.Codeunit.al\n+++ b/App/Apps/W1/EnforcedDigitalVouchers/app/src/Implementation/DigitalVoucherImpl.Codeunit.al\n@@ -224,6 +224,8 @@\n SourceCodeSetup.Get();\n if IsPaymentReconciliationJournal(DigitalVoucherEntrySetup.\"Entry Type\", RecRef) then\n exit(true);\n+ if IsGenJnlLineWithIncDocAttachedToAdjLine(DigitalVoucherEntrySetup.\"Entry Type\", RecRef) then\n+ exit(true);\n exit(false);\n end;\n \n@@ -343,6 +345,27 @@\n \n \n exit(SourceCodeValue = SourceCodeSetup.\"Payment Reconciliation Journal\");\n+ end;\n+\n+ local procedure IsGenJnlLineWithIncDocAttachedToAdjLine(DigitalVoucherEntryType: Enum \"Digital Voucher Entry Type\"; RecRef: RecordRef): Boolean\n+ var\n+ GenJournalLine: Record \"Gen. Journal Line\";\n+ AdjacentGenJournalLine: Record \"Gen. Journal Line\";\n+ IncomingDocument: Record \"Incoming Document\";\n+ begin\n+ if DigitalVoucherEntryType <> DigitalVoucherEntryType::\"General Journal\" then\n+ exit(false);\n+ RecRef.SetTable(GenJournalLine);\n+ AdjacentGenJournalLine.ReadIsolation(IsolationLevel::ReadCommitted);\n+ AdjacentGenJournalLine.SetRange(\"Journal Template Name\", GenJournalLine.\"Journal Template Name\");\n+ AdjacentGenJournalLine.SetRange(\"Journal Batch Name\", GenJournalLine.\"Journal Batch Name\");\n+ AdjacentGenJournalLine.SetRange(\"Posting Date\", GenJournalLine.\"Posting Date\");\n+ AdjacentGenJournalLine.SetRange(\"Document No.\", GenJournalLine.\"Document No.\");\n+ AdjacentGenJournalLine.SetFilter(\"Line No.\", '>%1', GenJournalLine.\"Line No.\");\n+ AdjacentGenJournalLine.SetFilter(\"Incoming Document Entry No.\", '<>0');\n+ if not AdjacentGenJournalLine.FindFirst() then\n+ exit(false);\n+ exit(IncomingDocument.Get(AdjacentGenJournalLine.\"Incoming Document Entry No.\"));\n end;\n \n local procedure AttachDigitalVoucherFromReportPDF(ReportUsage: Enum \"Report Selection Usage\"; RecRef: RecordRef; IsInvoice: Boolean; PostingDate: Date; DocNo: Code[20]; AccountTableNo: Integer; AccountNo: Code[20]; StandardReportID: Integer)\n"} +{"instance_id": "microsoftInternal__NAV-193853__cf-2", "base_instance_id": "microsoftInternal__NAV-193853", "variant_description": "Require all journal lines reference the same Incoming Document Entry No.", "intervention_type": "Execution / Validation Semantics", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-193853__cf-2", "FAIL_TO_PASS": [{"codeunitID": 139515, "functionName": ["PostMultipleGeneralJournalLinesSamePostingDateDocNoOnlyFirstHasIncDoc"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Apps/W1/EnforcedDigitalVouchers/test/src/DigitalVouchersTests.Codeunit.al b/App/Apps/W1/EnforcedDigitalVouchers/test/src/DigitalVouchersTests.Codeunit.al\n--- a/App/Apps/W1/EnforcedDigitalVouchers/test/src/DigitalVouchersTests.Codeunit.al\n+++ b/App/Apps/W1/EnforcedDigitalVouchers/test/src/DigitalVouchersTests.Codeunit.al\n@@ -908,6 +908,61 @@\n \n \n \n+\n+ UnbindSubscription(DigVouchersDisableEnforce);\n+ end;\n+\n+ [Test]\n+ procedure PostMultipleGeneralJournalLinesSamePostingDateDocNoOnlyFirstHasIncDoc()\n+ var\n+ GenJournalLine: array[2] of Record \"Gen. Journal Line\";\n+ GenJournalLineToPost: Record \"Gen. Journal Line\";\n+ GenJournalTemplate: Record \"Gen. Journal Template\";\n+ GenJournalBatch: Record \"Gen. Journal Batch\";\n+ IncomingDocument: Record \"Incoming Document\";\n+ DigVouchersDisableEnforce: Codeunit \"Dig. Vouchers Disable Enforce\";\n+ DocNo: Code[20];\n+ i: Integer;\n+ begin\n+ // [SCENARIO 540097] Stan can post multiple general journals lines with same posting date and document number, only the first line has incoming document\n+\n+ Initialize();\n+ BindSubscription(DigVouchersDisableEnforce);\n+ // [GIVEN] Digital voucher feature is enabled\n+ EnableDigitalVoucherFeature();\n+ // [GIVEN] Digital voucher entry setup for general journal is \"Attachment\"\n+ InitSetupCheckOnly(\"Digital Voucher Entry Type\"::\"General Journal\", \"Digital Voucher Check Type\"::Attachment);\n+ // [GIVEN] General journal lines with the same template and batch are created\n+ // [GIVEN] General journal line \"X\" with \"Posting Date\" = 01.01.2024 and \"Document No.\" = \"X\"\n+ // [GIVEN] General journal line \"Y\" with \"Posting Date\" = 01.01.2024 and \"Document No.\" = \"X\"\n+ DocNo := LibraryUtility.GenerateGUID();\n+ LibraryERM.CreateGenJournalTemplate(GenJournalTemplate);\n+ LibraryERM.CreateGenJournalBatch(GenJournalBatch, GenJournalTemplate.Name);\n+ for i := 1 to ArrayLen(GenJournalLine) do begin\n+ LibraryJournals.CreateGenJournalLine(\n+ GenJournalLine[i], GenJournalBatch.\"Journal Template Name\", GenJournalBatch.Name,\n+ GenJournalLine[i].\"Document Type\"::Invoice, GenJournalLine[i].\"Account Type\"::\"G/L Account\",\n+ LibraryERM.CreateGLAccountNo(), GenJournalLine[i].\"Bal. Account Type\"::\"G/L Account\",\n+ LibraryERM.CreateGLAccountNo(), LibraryRandom.RandDec(100, 2));\n+ GenJournalLine[i].Validate(\"Document No.\", DocNo);\n+ GenJournalLine[i].Modify(true);\n+ end;\n+ // [GIVEN] Both journal lines reference the same incoming document\n+ GenJournalLine[1].\"Incoming Document Entry No.\" := MockIncomingDocument();\n+ GenJournalLine[1].Modify(true);\n+ GenJournalLine[2].\"Incoming Document Entry No.\" := GenJournalLine[1].\"Incoming Document Entry No.\";\n+ GenJournalLine[2].Modify(true);\n+\n+ GenJournalLineToPost.SetRange(\"Journal Template Name\", GenJournalBatch.\"Journal Template Name\");\n+ GenJournalLineToPost.SetRange(\"Journal Batch Name\", GenJournalBatch.Name);\n+ GenJournalLineToPost.FindSet();\n+ // [WHEN] Post both general journal lines\n+ Codeunit.Run(Codeunit::\"Gen. Jnl.-Post Batch\", GenJournalLineToPost);\n+\n+ // [THEN] Posting is successfull and we have an incoming document with \"Posting Date\" = 01.01.2024 and \"Document No.\" = \"X\"\n+ IncomingDocument.SetRange(\"Posting Date\", GenJournalLine[1].\"Posting Date\");\n+ IncomingDocument.SetRange(\"Document No.\", GenJournalLine[1].\"Document No.\");\n+ Assert.RecordIsNotEmpty(IncomingDocument);\n \n UnbindSubscription(DigVouchersDisableEnforce);\n end;\n@@ -1076,6 +1131,19 @@\n exit(IncomingDocument.\"Entry No.\");\n end;\n \n+ local procedure MockIncomingDocument(): Integer\n+ var\n+ IncomingDocument: Record \"Incoming Document\";\n+ IncomingDocumentAttachment: Record \"Incoming Document Attachment\";\n+ begin\n+ IncomingDocument.\"Entry No.\" :=\n+ LibraryUtility.GetNewRecNo(IncomingDocument, IncomingDocument.FieldNo(\"Entry No.\"));\n+ IncomingDocument.Insert();\n+ IncomingDocumentAttachment.\"Incoming Document Entry No.\" := IncomingDocument.\"Entry No.\";\n+ IncomingDocumentAttachment.Insert();\n+ exit(IncomingDocument.\"Entry No.\");\n+ end;\n+\n local procedure ReceiveAndInvoicePurchaseInvoice(): Code[20]\n var\n PurchaseHeader: Record \"Purchase Header\";\n", "patch": "diff --git a/App/Apps/W1/EnforcedDigitalVouchers/app/src/Implementation/DigitalVoucherImpl.Codeunit.al b/App/Apps/W1/EnforcedDigitalVouchers/app/src/Implementation/DigitalVoucherImpl.Codeunit.al\n--- a/App/Apps/W1/EnforcedDigitalVouchers/app/src/Implementation/DigitalVoucherImpl.Codeunit.al\n+++ b/App/Apps/W1/EnforcedDigitalVouchers/app/src/Implementation/DigitalVoucherImpl.Codeunit.al\n@@ -224,6 +224,8 @@\n SourceCodeSetup.Get();\n if IsPaymentReconciliationJournal(DigitalVoucherEntrySetup.\"Entry Type\", RecRef) then\n exit(true);\n+ if IsGenJnlLineWithIncDocAttachedToAdjLine(DigitalVoucherEntrySetup.\"Entry Type\", RecRef) then\n+ exit(true);\n exit(false);\n end;\n \n@@ -343,6 +345,27 @@\n \n \n exit(SourceCodeValue = SourceCodeSetup.\"Payment Reconciliation Journal\");\n+ end;\n+\n+ local procedure IsGenJnlLineWithIncDocAttachedToAdjLine(DigitalVoucherEntryType: Enum \"Digital Voucher Entry Type\"; RecRef: RecordRef): Boolean\n+ var\n+ GenJournalLine: Record \"Gen. Journal Line\";\n+ AdjacentGenJournalLine: Record \"Gen. Journal Line\";\n+ IncomingDocument: Record \"Incoming Document\";\n+ begin\n+ if DigitalVoucherEntryType <> DigitalVoucherEntryType::\"General Journal\" then\n+ exit(false);\n+ RecRef.SetTable(GenJournalLine);\n+ AdjacentGenJournalLine.ReadIsolation(IsolationLevel::ReadCommitted);\n+ AdjacentGenJournalLine.SetRange(\"Journal Template Name\", GenJournalLine.\"Journal Template Name\");\n+ AdjacentGenJournalLine.SetRange(\"Journal Batch Name\", GenJournalLine.\"Journal Batch Name\");\n+ AdjacentGenJournalLine.SetRange(\"Posting Date\", GenJournalLine.\"Posting Date\");\n+ AdjacentGenJournalLine.SetRange(\"Document No.\", GenJournalLine.\"Document No.\");\n+ AdjacentGenJournalLine.SetFilter(\"Line No.\", '<>%1', GenJournalLine.\"Line No.\");\n+ AdjacentGenJournalLine.SetRange(\"Incoming Document Entry No.\", GenJournalLine.\"Incoming Document Entry No.\");\n+ if not AdjacentGenJournalLine.FindFirst() then\n+ exit(false);\n+ exit(IncomingDocument.Get(AdjacentGenJournalLine.\"Incoming Document Entry No.\"));\n end;\n \n local procedure AttachDigitalVoucherFromReportPDF(ReportUsage: Enum \"Report Selection Usage\"; RecRef: RecordRef; IsInvoice: Boolean; PostingDate: Date; DocNo: Code[20]; AccountTableNo: Integer; AccountNo: Code[20]; StandardReportID: Integer)\n"} +{"instance_id": "microsoftInternal__NAV-223493__cf-1", "base_instance_id": "microsoftInternal__NAV-223493", "variant_description": "Only update Customer Ledger Entry when new Your Reference is non-empty", "intervention_type": "Execution / Validation Semantics", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-223493__cf-1", "FAIL_TO_PASS": [{"codeunitID": 134658, "functionName": ["VerifyYourReferenceUpdatedInCustLedgerEntry"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/EditPostedDocuments.Codeunit.al b/App/Layers/W1/Tests/ERM/EditPostedDocuments.Codeunit.al\n--- a/App/Layers/W1/Tests/ERM/EditPostedDocuments.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/EditPostedDocuments.Codeunit.al\n@@ -27,6 +27,8 @@\n UnexpectedVolumeErr: Label 'Unexpected Volume shown.';\n CashFlowWorkSheetLineMustNotBeFoundErr: Label 'Cash Flow Worksheet Line must not be found.';\n YourReferenceErr: Label 'Your reference must be editable';\n+ SalesInvoiceYourReferenceErr: Label 'Sales Invoice Your Reference not updated';\n+ CustLedgerEntryYourReferenceErr: Label 'Customer Ledger Entry Your Reference not updated';\n \n [Test]\n [HandlerFunctions('PostedSalesShipmentUpdateGetEditablelModalPageHandler')]\n@@ -993,6 +995,46 @@\n \n \n \n+ LibraryLowerPermissions.SetOutsideO365Scope();\n+ end;\n+\n+ [Test]\n+ [HandlerFunctions('PostedSalesInvoiceYourReferenceModalPageHandler')]\n+ procedure VerifyYourReferenceUpdatedInCustLedgerEntry()\n+ var\n+ CustLedgerEntry: Record \"Cust. Ledger Entry\";\n+ SalesInvoiceHeader: Record \"Sales Invoice Header\";\n+ YourReference: Text[35];\n+ PostedSalesInvoice: TestPage \"Posted Sales Invoice\";\n+ begin\n+ // [SCENARIO 595854] Verify Your Reference Field updated in Customer Ledger Entries,\n+ // when changed with Update document on Posted Sales Invoice.\n+ Initialize();\n+\n+ LibraryLowerPermissions.SetO365Setup();\n+ LibraryLowerPermissions.AddSalesDocsPost();\n+\n+ // [GIVEN] Create and post a Sales Order.\n+ SalesInvoiceHeader.Get(CreateAndPostSalesOrderGetInvoiceNo());\n+ YourReference := '';\n+ LibraryVariableStorage.Enqueue(YourReference);\n+\n+ // [GIVEN] Opened \"Posted Sales Invoice - Update\" page.\n+ PostedSalesInvoice.OpenView();\n+ PostedSalesInvoice.GoToRecord(SalesInvoiceHeader);\n+ PostedSalesInvoice.\"Update Document\".Invoke();\n+\n+ // [WHEN] Press OK on the page via PostedSalesInvoiceYourReferenceModalPageHandler.\n+\n+ // [THEN] Verify Your Reference field updated on Sales Invoice Header and Customer Ledger Entry.\n+ SalesInvoiceHeader.Get(SalesInvoiceHeader.\"No.\");\n+ Assert.AreEqual(YourReference, SalesInvoiceHeader.\"Your Reference\", SalesInvoiceYourReferenceErr);\n+\n+ CustLedgerEntry.SetRange(\"Document No.\", SalesInvoiceHeader.\"No.\");\n+ CustLedgerEntry.FindFirst();\n+ Assert.AreEqual(YourReference, CustLedgerEntry.\"Your Reference\", CustLedgerEntryYourReferenceErr);\n+\n+ LibraryVariableStorage.AssertEmpty();\n LibraryLowerPermissions.SetOutsideO365Scope();\n end;\n \n@@ -1535,6 +1577,14 @@\n PostedSalesInvUpdate.Cancel().Invoke();\n end;\n \n+ [ModalPageHandler]\n+ [Scope('OnPrem')]\n+ procedure PostedSalesInvoiceYourReferenceModalPageHandler(var PostedSalesInvUpdate: TestPage \"Posted Sales Inv. - Update\")\n+ begin\n+ PostedSalesInvUpdate.\"Your Reference\".SetValue(LibraryVariableStorage.DequeueText());\n+ PostedSalesInvUpdate.OK().Invoke();\n+ end;\n+\n [ConfirmHandler]\n [Scope('OnPrem')]\n procedure ConfirmHandlerTrue(QuestionText: Text[1024]; var Reply: Boolean)\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Sales/History/SalesInvHeaderEdit.Codeunit.al b/App/Layers/W1/BaseApp/Sales/History/SalesInvHeaderEdit.Codeunit.al\n--- a/App/Layers/W1/BaseApp/Sales/History/SalesInvHeaderEdit.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Sales/History/SalesInvHeaderEdit.Codeunit.al\n@@ -56,6 +56,8 @@\n CustLedgerEntry.Description := SalesInvoiceHeader.\"Posting Description\";\n CustLedgerEntry.\"Promised Pay Date\" := SalesInvoiceHeader.\"Promised Pay Date\";\n CustLedgerEntry.\"Due Date\" := SalesInvoiceHeader.\"Due Date\";\n+ if SalesInvoiceHeader.\"Your Reference\" <> '' then\n+ CustLedgerEntry.\"Your Reference\" := SalesInvoiceHeader.\"Your Reference\";\n if CustLedgerEntry.\"Dispute Status\" <> '' then begin\n if DisputeStatus.get(CustLedgerEntry.\"Dispute Status\") then\n if (DisputeStatus.\"Overwrite on hold\") and ClearOnHold(SalesInvoiceHeader) then\ndiff --git a/App/Layers/W1/BaseApp/Sales/Receivables/CustEntryEdit.Codeunit.al b/App/Layers/W1/BaseApp/Sales/Receivables/CustEntryEdit.Codeunit.al\n--- a/App/Layers/W1/BaseApp/Sales/Receivables/CustEntryEdit.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Sales/Receivables/CustEntryEdit.Codeunit.al\n@@ -44,6 +44,7 @@\n CustLedgEntry.\"Applies-to ID\" := Rec.\"Applies-to ID\";\n CustLedgEntry.Validate(\"Payment Method Code\", Rec.\"Payment Method Code\");\n CustLedgEntry.Validate(\"Payment Reference\", Rec.\"Payment Reference\");\n+ CustLedgEntry.Validate(\"Your Reference\", Rec.\"Your Reference\");\n CustLedgEntry.Validate(\"Remaining Pmt. Disc. Possible\", Rec.\"Remaining Pmt. Disc. Possible\");\n CustLedgEntry.\"Pmt. Disc. Tolerance Date\" := Rec.\"Pmt. Disc. Tolerance Date\";\n CustLedgEntry.Validate(\"Max. Payment Tolerance\", Rec.\"Max. Payment Tolerance\");\n@@ -122,7 +123,8 @@\n (CurrCustLedgerEntry.\"Payment Reference\" <> NewCustLedgerEntry.\"Payment Reference\") or\n (CurrCustLedgerEntry.\"Message to Recipient\" <> NewCustLedgerEntry.\"Message to Recipient\") or\n (CurrCustLedgerEntry.\"Recipient Bank Account\" <> NewCustLedgerEntry.\"Recipient Bank Account\") or\n- (CurrCustLedgerEntry.\"On Hold\" <> NewCustLedgerEntry.\"On Hold\");\n+ (CurrCustLedgerEntry.\"On Hold\" <> NewCustLedgerEntry.\"On Hold\") or\n+ (CurrCustLedgerEntry.\"Your Reference\" <> NewCustLedgerEntry.\"Your Reference\");\n OnAfterLogFieldChanged(CurrCustLedgerEntry, NewCustLedgerEntry, Changed);\n exit(Changed);\n end;\n"} +{"instance_id": "microsoftInternal__NAV-223493__cf-2", "base_instance_id": "microsoftInternal__NAV-223493", "variant_description": "Your Reference must not exceed 20 characters", "intervention_type": "Syntax / Representation", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-223493__cf-2", "FAIL_TO_PASS": [{"codeunitID": 134658, "functionName": ["VerifyYourReferenceUpdatedInCustLedgerEntry"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/EditPostedDocuments.Codeunit.al b/App/Layers/W1/Tests/ERM/EditPostedDocuments.Codeunit.al\n--- a/App/Layers/W1/Tests/ERM/EditPostedDocuments.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/EditPostedDocuments.Codeunit.al\n@@ -27,6 +27,8 @@\n UnexpectedVolumeErr: Label 'Unexpected Volume shown.';\n CashFlowWorkSheetLineMustNotBeFoundErr: Label 'Cash Flow Worksheet Line must not be found.';\n YourReferenceErr: Label 'Your reference must be editable';\n+ SalesInvoiceYourReferenceErr: Label 'Sales Invoice Your Reference not updated';\n+ CustLedgerEntryYourReferenceErr: Label 'Customer Ledger Entry Your Reference not updated';\n \n [Test]\n [HandlerFunctions('PostedSalesShipmentUpdateGetEditablelModalPageHandler')]\n@@ -993,6 +995,46 @@\n \n \n \n+ LibraryLowerPermissions.SetOutsideO365Scope();\n+ end;\n+\n+ [Test]\n+ [HandlerFunctions('PostedSalesInvoiceYourReferenceModalPageHandler')]\n+ procedure VerifyYourReferenceUpdatedInCustLedgerEntry()\n+ var\n+ CustLedgerEntry: Record \"Cust. Ledger Entry\";\n+ SalesInvoiceHeader: Record \"Sales Invoice Header\";\n+ YourReference: Text[35];\n+ PostedSalesInvoice: TestPage \"Posted Sales Invoice\";\n+ begin\n+ // [SCENARIO 595854] Verify Your Reference Field updated in Customer Ledger Entries,\n+ // when changed with Update document on Posted Sales Invoice.\n+ Initialize();\n+\n+ LibraryLowerPermissions.SetO365Setup();\n+ LibraryLowerPermissions.AddSalesDocsPost();\n+\n+ // [GIVEN] Create and post a Sales Order.\n+ SalesInvoiceHeader.Get(CreateAndPostSalesOrderGetInvoiceNo());\n+ YourReference := LibraryRandom.RandText(25);\n+ LibraryVariableStorage.Enqueue(YourReference);\n+\n+ // [GIVEN] Opened \"Posted Sales Invoice - Update\" page.\n+ PostedSalesInvoice.OpenView();\n+ PostedSalesInvoice.GoToRecord(SalesInvoiceHeader);\n+ PostedSalesInvoice.\"Update Document\".Invoke();\n+\n+ // [WHEN] Press OK on the page via PostedSalesInvoiceYourReferenceModalPageHandler.\n+\n+ // [THEN] Verify Your Reference field updated on Sales Invoice Header and Customer Ledger Entry.\n+ SalesInvoiceHeader.Get(SalesInvoiceHeader.\"No.\");\n+ Assert.AreEqual(YourReference, SalesInvoiceHeader.\"Your Reference\", SalesInvoiceYourReferenceErr);\n+\n+ CustLedgerEntry.SetRange(\"Document No.\", SalesInvoiceHeader.\"No.\");\n+ CustLedgerEntry.FindFirst();\n+ Assert.AreEqual(YourReference, CustLedgerEntry.\"Your Reference\", CustLedgerEntryYourReferenceErr);\n+\n+ LibraryVariableStorage.AssertEmpty();\n LibraryLowerPermissions.SetOutsideO365Scope();\n end;\n \n@@ -1535,6 +1577,14 @@\n PostedSalesInvUpdate.Cancel().Invoke();\n end;\n \n+ [ModalPageHandler]\n+ [Scope('OnPrem')]\n+ procedure PostedSalesInvoiceYourReferenceModalPageHandler(var PostedSalesInvUpdate: TestPage \"Posted Sales Inv. - Update\")\n+ begin\n+ PostedSalesInvUpdate.\"Your Reference\".SetValue(LibraryVariableStorage.DequeueText());\n+ PostedSalesInvUpdate.OK().Invoke();\n+ end;\n+\n [ConfirmHandler]\n [Scope('OnPrem')]\n procedure ConfirmHandlerTrue(QuestionText: Text[1024]; var Reply: Boolean)\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Sales/History/SalesInvHeaderEdit.Codeunit.al b/App/Layers/W1/BaseApp/Sales/History/SalesInvHeaderEdit.Codeunit.al\n--- a/App/Layers/W1/BaseApp/Sales/History/SalesInvHeaderEdit.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Sales/History/SalesInvHeaderEdit.Codeunit.al\n@@ -56,6 +56,9 @@\n CustLedgerEntry.Description := SalesInvoiceHeader.\"Posting Description\";\n CustLedgerEntry.\"Promised Pay Date\" := SalesInvoiceHeader.\"Promised Pay Date\";\n CustLedgerEntry.\"Due Date\" := SalesInvoiceHeader.\"Due Date\";\n+ if StrLen(SalesInvoiceHeader.\"Your Reference\") > 20 then\n+ exit;\n+ CustLedgerEntry.\"Your Reference\" := SalesInvoiceHeader.\"Your Reference\";\n if CustLedgerEntry.\"Dispute Status\" <> '' then begin\n if DisputeStatus.get(CustLedgerEntry.\"Dispute Status\") then\n if (DisputeStatus.\"Overwrite on hold\") and ClearOnHold(SalesInvoiceHeader) then\ndiff --git a/App/Layers/W1/BaseApp/Sales/Receivables/CustEntryEdit.Codeunit.al b/App/Layers/W1/BaseApp/Sales/Receivables/CustEntryEdit.Codeunit.al\n--- a/App/Layers/W1/BaseApp/Sales/Receivables/CustEntryEdit.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Sales/Receivables/CustEntryEdit.Codeunit.al\n@@ -44,6 +44,7 @@\n CustLedgEntry.\"Applies-to ID\" := Rec.\"Applies-to ID\";\n CustLedgEntry.Validate(\"Payment Method Code\", Rec.\"Payment Method Code\");\n CustLedgEntry.Validate(\"Payment Reference\", Rec.\"Payment Reference\");\n+ CustLedgEntry.Validate(\"Your Reference\", Rec.\"Your Reference\");\n CustLedgEntry.Validate(\"Remaining Pmt. Disc. Possible\", Rec.\"Remaining Pmt. Disc. Possible\");\n CustLedgEntry.\"Pmt. Disc. Tolerance Date\" := Rec.\"Pmt. Disc. Tolerance Date\";\n CustLedgEntry.Validate(\"Max. Payment Tolerance\", Rec.\"Max. Payment Tolerance\");\n@@ -122,7 +123,8 @@\n (CurrCustLedgerEntry.\"Payment Reference\" <> NewCustLedgerEntry.\"Payment Reference\") or\n (CurrCustLedgerEntry.\"Message to Recipient\" <> NewCustLedgerEntry.\"Message to Recipient\") or\n (CurrCustLedgerEntry.\"Recipient Bank Account\" <> NewCustLedgerEntry.\"Recipient Bank Account\") or\n- (CurrCustLedgerEntry.\"On Hold\" <> NewCustLedgerEntry.\"On Hold\");\n+ (CurrCustLedgerEntry.\"On Hold\" <> NewCustLedgerEntry.\"On Hold\") or\n+ (CurrCustLedgerEntry.\"Your Reference\" <> NewCustLedgerEntry.\"Your Reference\");\n OnAfterLogFieldChanged(CurrCustLedgerEntry, NewCustLedgerEntry, Changed);\n exit(Changed);\n end;\n"} +{"instance_id": "microsoftInternal__NAV-223493__cf-3", "base_instance_id": "microsoftInternal__NAV-223493", "variant_description": "Only update Customer Ledger Entry when entry is not on hold", "intervention_type": "Toolchain / Ecosystem Constraint", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-223493__cf-3", "FAIL_TO_PASS": [{"codeunitID": 134658, "functionName": ["VerifyYourReferenceUpdatedInCustLedgerEntry"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/EditPostedDocuments.Codeunit.al b/App/Layers/W1/Tests/ERM/EditPostedDocuments.Codeunit.al\n--- a/App/Layers/W1/Tests/ERM/EditPostedDocuments.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/EditPostedDocuments.Codeunit.al\n@@ -27,6 +27,8 @@\n UnexpectedVolumeErr: Label 'Unexpected Volume shown.';\n CashFlowWorkSheetLineMustNotBeFoundErr: Label 'Cash Flow Worksheet Line must not be found.';\n YourReferenceErr: Label 'Your reference must be editable';\n+ SalesInvoiceYourReferenceErr: Label 'Sales Invoice Your Reference not updated';\n+ CustLedgerEntryYourReferenceErr: Label 'Customer Ledger Entry Your Reference not updated';\n \n [Test]\n [HandlerFunctions('PostedSalesShipmentUpdateGetEditablelModalPageHandler')]\n@@ -993,6 +995,48 @@\n \n \n \n+ LibraryLowerPermissions.SetOutsideO365Scope();\n+ end;\n+\n+ [Test]\n+ [HandlerFunctions('PostedSalesInvoiceYourReferenceModalPageHandler')]\n+ procedure VerifyYourReferenceUpdatedInCustLedgerEntry()\n+ var\n+ CustLedgerEntry: Record \"Cust. Ledger Entry\";\n+ SalesInvoiceHeader: Record \"Sales Invoice Header\";\n+ YourReference: Text[35];\n+ PostedSalesInvoice: TestPage \"Posted Sales Invoice\";\n+ begin\n+ // [SCENARIO 595854] Verify Your Reference Field updated in Customer Ledger Entries,\n+ // when changed with Update document on Posted Sales Invoice.\n+ Initialize();\n+\n+ LibraryLowerPermissions.SetO365Setup();\n+ LibraryLowerPermissions.AddSalesDocsPost();\n+\n+ // [GIVEN] Create and post a Sales Order.\n+ SalesInvoiceHeader.Get(CreateAndPostSalesOrderGetInvoiceNo());\n+ YourReference := LibraryRandom.RandText(35);\n+ LibraryVariableStorage.Enqueue(YourReference);\n+\n+ // [GIVEN] Opened \"Posted Sales Invoice - Update\" page.\n+ PostedSalesInvoice.OpenView();\n+ PostedSalesInvoice.GoToRecord(SalesInvoiceHeader);\n+ PostedSalesInvoice.\"Update Document\".Invoke();\n+\n+ // [WHEN] Press OK on the page via PostedSalesInvoiceYourReferenceModalPageHandler.\n+\n+ // [THEN] Verify Your Reference field updated on Sales Invoice Header and Customer Ledger Entry.\n+ SalesInvoiceHeader.Get(SalesInvoiceHeader.\"No.\");\n+ Assert.AreEqual(YourReference, SalesInvoiceHeader.\"Your Reference\", SalesInvoiceYourReferenceErr);\n+\n+ CustLedgerEntry.SetRange(\"Document No.\", SalesInvoiceHeader.\"No.\");\n+ CustLedgerEntry.FindFirst();\n+ CustLedgerEntry.\"On Hold\" := 'X';\n+ CustLedgerEntry.Modify(true);\n+ Assert.AreEqual(YourReference, CustLedgerEntry.\"Your Reference\", CustLedgerEntryYourReferenceErr);\n+\n+ LibraryVariableStorage.AssertEmpty();\n LibraryLowerPermissions.SetOutsideO365Scope();\n end;\n \n@@ -1535,6 +1579,14 @@\n PostedSalesInvUpdate.Cancel().Invoke();\n end;\n \n+ [ModalPageHandler]\n+ [Scope('OnPrem')]\n+ procedure PostedSalesInvoiceYourReferenceModalPageHandler(var PostedSalesInvUpdate: TestPage \"Posted Sales Inv. - Update\")\n+ begin\n+ PostedSalesInvUpdate.\"Your Reference\".SetValue(LibraryVariableStorage.DequeueText());\n+ PostedSalesInvUpdate.OK().Invoke();\n+ end;\n+\n [ConfirmHandler]\n [Scope('OnPrem')]\n procedure ConfirmHandlerTrue(QuestionText: Text[1024]; var Reply: Boolean)\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Sales/History/SalesInvHeaderEdit.Codeunit.al b/App/Layers/W1/BaseApp/Sales/History/SalesInvHeaderEdit.Codeunit.al\n--- a/App/Layers/W1/BaseApp/Sales/History/SalesInvHeaderEdit.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Sales/History/SalesInvHeaderEdit.Codeunit.al\n@@ -56,6 +56,9 @@\n CustLedgerEntry.Description := SalesInvoiceHeader.\"Posting Description\";\n CustLedgerEntry.\"Promised Pay Date\" := SalesInvoiceHeader.\"Promised Pay Date\";\n CustLedgerEntry.\"Due Date\" := SalesInvoiceHeader.\"Due Date\";\n+ if CustLedgerEntry.\"On Hold\" <> '' then\n+ exit;\n+ CustLedgerEntry.\"Your Reference\" := SalesInvoiceHeader.\"Your Reference\";\n if CustLedgerEntry.\"Dispute Status\" <> '' then begin\n if DisputeStatus.get(CustLedgerEntry.\"Dispute Status\") then\n if (DisputeStatus.\"Overwrite on hold\") and ClearOnHold(SalesInvoiceHeader) then\ndiff --git a/App/Layers/W1/BaseApp/Sales/Receivables/CustEntryEdit.Codeunit.al b/App/Layers/W1/BaseApp/Sales/Receivables/CustEntryEdit.Codeunit.al\n--- a/App/Layers/W1/BaseApp/Sales/Receivables/CustEntryEdit.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Sales/Receivables/CustEntryEdit.Codeunit.al\n@@ -44,6 +44,7 @@\n CustLedgEntry.\"Applies-to ID\" := Rec.\"Applies-to ID\";\n CustLedgEntry.Validate(\"Payment Method Code\", Rec.\"Payment Method Code\");\n CustLedgEntry.Validate(\"Payment Reference\", Rec.\"Payment Reference\");\n+ CustLedgEntry.Validate(\"Your Reference\", Rec.\"Your Reference\");\n CustLedgEntry.Validate(\"Remaining Pmt. Disc. Possible\", Rec.\"Remaining Pmt. Disc. Possible\");\n CustLedgEntry.\"Pmt. Disc. Tolerance Date\" := Rec.\"Pmt. Disc. Tolerance Date\";\n CustLedgEntry.Validate(\"Max. Payment Tolerance\", Rec.\"Max. Payment Tolerance\");\n@@ -122,7 +123,8 @@\n (CurrCustLedgerEntry.\"Payment Reference\" <> NewCustLedgerEntry.\"Payment Reference\") or\n (CurrCustLedgerEntry.\"Message to Recipient\" <> NewCustLedgerEntry.\"Message to Recipient\") or\n (CurrCustLedgerEntry.\"Recipient Bank Account\" <> NewCustLedgerEntry.\"Recipient Bank Account\") or\n- (CurrCustLedgerEntry.\"On Hold\" <> NewCustLedgerEntry.\"On Hold\");\n+ (CurrCustLedgerEntry.\"On Hold\" <> NewCustLedgerEntry.\"On Hold\") or\n+ (CurrCustLedgerEntry.\"Your Reference\" <> NewCustLedgerEntry.\"Your Reference\");\n OnAfterLogFieldChanged(CurrCustLedgerEntry, NewCustLedgerEntry, Changed);\n exit(Changed);\n end;\n"} +{"instance_id": "microsoftInternal__NAV-193649__cf-1", "base_instance_id": "microsoftInternal__NAV-193649", "variant_description": "Only Shpfy Order Id must be cleared when copying; other Shopify fields remain unchanged", "intervention_type": "Execution / Validation Semantics", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-193649__cf-1", "FAIL_TO_PASS": [{"codeunitID": 139695, "functionName": ["UnitTestCopyInvoice"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Apps/W1/Shopify/test/Invoices/ShpfyInvoicesTest.Codeunit.al b/App/Apps/W1/Shopify/test/Invoices/ShpfyInvoicesTest.Codeunit.al\n--- a/App/Apps/W1/Shopify/test/Invoices/ShpfyInvoicesTest.Codeunit.al\n+++ b/App/Apps/W1/Shopify/test/Invoices/ShpfyInvoicesTest.Codeunit.al\n@@ -0,0 +1,67 @@\n+codeunit 139695 \"Shpfy Invoices Test\"\n+{\n+ Subtype = Test;\n+ TestPermissions = Disabled;\n+\n+ var\n+ LibraryAssert: Codeunit \"Library Assert\";\n+ Any: Codeunit Any;\n+ LibrarySales: Codeunit \"Library - Sales\";\n+ LibraryInventory: Codeunit \"Library - Inventory\";\n+ LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n+ IsInitialized: Boolean;\n+\n+ [Test]\n+ procedure UnitTestCopyInvoice()\n+ var\n+ Item: Record Item;\n+ Customer: Record Customer;\n+ SalesHeader: Record \"Sales Header\";\n+ InvoiceNo: Code[20];\n+ OrderId: BigInteger;\n+ begin\n+ // [SCENARIO] Shopify related fields are not copied to the new invoice\n+ // [GIVEN] Posted sales invoice with Shopify related fields and empty invoice\n+ Initialize();\n+ OrderId := Any.IntegerInRange(10000, 99999);\n+ LibraryInventory.CreateItem(Item);\n+ LibrarySales.CreateCustomer(Customer);\n+ InvoiceNo := CreateAndPostSalesInvoice(Item, Customer, 1, OrderId);\n+ LibrarySales.CreateSalesHeader(SalesHeader, SalesHeader.\"Document Type\"::Invoice, Customer.\"No.\");\n+\n+ // [WHEN] Copy the invoice\n+ CopySalesDocument(SalesHeader, InvoiceNo);\n+\n+ // [THEN] Only Shpfy Order Id is cleared\n+ LibraryAssert.IsTrue(SalesHeader.\"Shpfy Order Id\" = 0, 'Shpfy Order Id is not copied');\n+ end;\n+\n+ local procedure Initialize()\n+ begin\n+ if IsInitialized then\n+ exit;\n+ IsInitialized := true;\n+ LibraryERMCountryData.CreateVATData();\n+ LibraryERMCountryData.UpdateGeneralPostingSetup();\n+ end;\n+\n+ local procedure CreateAndPostSalesInvoice(Item: Record Item; Customer: Record Customer; NumberOfLines: Integer; OrderId: BigInteger): Code[20]\n+ var\n+ SalesHeader: Record \"Sales Header\";\n+ SalesLine: Record \"Sales Line\";\n+ begin\n+ LibrarySales.CreateSalesHeader(SalesHeader, SalesHeader.\"Document Type\"::Invoice, Customer.\"No.\");\n+ SalesHeader.\"Shpfy Order Id\" := OrderId;\n+ SalesHeader.Modify();\n+ LibrarySales.CreateSalesLine(SalesLine, SalesHeader, SalesLine.Type::Item, Item.\"No.\", NumberOfLines);\n+ exit(LibrarySales.PostSalesDocument(SalesHeader, true, true));\n+ end;\n+\n+ local procedure CopySalesDocument(var ToSalesHeader: Record \"Sales Header\"; DocNo: Code[20])\n+ var\n+ CopyDocumentMgt: Codeunit \"Copy Document Mgt.\";\n+ begin\n+ CopyDocumentMgt.SetProperties(true, false, false, false, false, false, false);\n+ CopyDocumentMgt.CopySalesDoc(\"Sales Document Type From\"::\"Posted Invoice\", DocNo, ToSalesHeader);\n+ end;\n+}\ndiff --git a/App/Apps/W1/Shopify/test/app.json b/App/Apps/W1/Shopify/test/app.json\n--- a/App/Apps/W1/Shopify/test/app.json\n+++ b/App/Apps/W1/Shopify/test/app.json\n@@ -71,6 +71,10 @@\n {\n \"from\": 139645,\n \"to\": 139649\n+ },\n+ {\n+ \"from\": 139695,\n+ \"to\": 139699\n }\n ],\n \"target\": \"OnPrem\",\n", "patch": "diff --git a/App/Apps/W1/Shopify/app/src/Invoicing/Codeunits/ShpfyUpdateSalesInvoice.Codeunit.al b/App/Apps/W1/Shopify/app/src/Invoicing/Codeunits/ShpfyUpdateSalesInvoice.Codeunit.al\n--- a/App/Apps/W1/Shopify/app/src/Invoicing/Codeunits/ShpfyUpdateSalesInvoice.Codeunit.al\n+++ b/App/Apps/W1/Shopify/app/src/Invoicing/Codeunits/ShpfyUpdateSalesInvoice.Codeunit.al\n@@ -1,6 +1,8 @@\n namespace Microsoft.Integration.Shopify;\n \n using Microsoft.Sales.History;\n+using Microsoft.Utilities;\n+using Microsoft.Sales.Document;\n \n codeunit 30364 \"Shpfy Update Sales Invoice\"\n {\n@@ -19,4 +21,10 @@\n begin\n SalesInvoiceHeader.\"Shpfy Order Id\" := SalesInvoiceHeaderRec.\"Shpfy Order Id\";\n end;\n+\n+ [EventSubscriber(ObjectType::Codeunit, Codeunit::\"Copy Document Mgt.\", 'OnCopySalesDocOnAfterTransferPostedInvoiceFields', '', false, false)]\n+ local procedure OnCopySalesDocOnAfterCopySalesDocUpdateHeader(var ToSalesHeader: Record \"Sales Header\")\n+ begin\n+ Clear(ToSalesHeader.\"Shpfy Order Id\");\n+ end;\n }\n"} +{"instance_id": "microsoftInternal__NAV-193649__cf-2", "base_instance_id": "microsoftInternal__NAV-193649", "variant_description": "Shpfy Order Id should be cleared only for posted invoices copied into new invoices (not other document types)", "intervention_type": "Workflow / Business Logic Composition", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-193649__cf-2", "FAIL_TO_PASS": [{"codeunitID": 139695, "functionName": ["UnitTestCopyInvoice"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Apps/W1/Shopify/test/Invoices/ShpfyInvoicesTest.Codeunit.al b/App/Apps/W1/Shopify/test/Invoices/ShpfyInvoicesTest.Codeunit.al\n--- a/App/Apps/W1/Shopify/test/Invoices/ShpfyInvoicesTest.Codeunit.al\n+++ b/App/Apps/W1/Shopify/test/Invoices/ShpfyInvoicesTest.Codeunit.al\n@@ -0,0 +1,67 @@\n+codeunit 139695 \"Shpfy Invoices Test\"\n+{\n+ Subtype = Test;\n+ TestPermissions = Disabled;\n+\n+ var\n+ LibraryAssert: Codeunit \"Library Assert\";\n+ Any: Codeunit Any;\n+ LibrarySales: Codeunit \"Library - Sales\";\n+ LibraryInventory: Codeunit \"Library - Inventory\";\n+ LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n+ IsInitialized: Boolean;\n+\n+ [Test]\n+ procedure UnitTestCopyInvoice()\n+ var\n+ Item: Record Item;\n+ Customer: Record Customer;\n+ SalesHeader: Record \"Sales Header\";\n+ InvoiceNo: Code[20];\n+ OrderId: BigInteger;\n+ begin\n+ // [SCENARIO] Shopify related fields are not copied to the new invoice\n+ // [GIVEN] Posted sales invoice with Shopify related fields and empty invoice\n+ Initialize();\n+ OrderId := Any.IntegerInRange(10000, 99999);\n+ LibraryInventory.CreateItem(Item);\n+ LibrarySales.CreateCustomer(Customer);\n+ InvoiceNo := CreateAndPostSalesInvoice(Item, Customer, 1, OrderId);\n+ LibrarySales.CreateSalesHeader(SalesHeader, SalesHeader.\"Document Type\"::Invoice, Customer.\"No.\");\n+\n+ // [WHEN] Copy the posted invoice into a new invoice\n+ CopySalesDocument(SalesHeader, InvoiceNo);\n+\n+ // [THEN] Shopify related fields are not copied\n+ LibraryAssert.IsTrue(SalesHeader.\"Shpfy Order Id\" = 0, 'Shpfy Order Id is not copied');\n+ end;\n+\n+ local procedure Initialize()\n+ begin\n+ if IsInitialized then\n+ exit;\n+ IsInitialized := true;\n+ LibraryERMCountryData.CreateVATData();\n+ LibraryERMCountryData.UpdateGeneralPostingSetup();\n+ end;\n+\n+ local procedure CreateAndPostSalesInvoice(Item: Record Item; Customer: Record Customer; NumberOfLines: Integer; OrderId: BigInteger): Code[20]\n+ var\n+ SalesHeader: Record \"Sales Header\";\n+ SalesLine: Record \"Sales Line\";\n+ begin\n+ LibrarySales.CreateSalesHeader(SalesHeader, SalesHeader.\"Document Type\"::Invoice, Customer.\"No.\");\n+ SalesHeader.\"Shpfy Order Id\" := OrderId;\n+ SalesHeader.Modify();\n+ LibrarySales.CreateSalesLine(SalesLine, SalesHeader, SalesLine.Type::Item, Item.\"No.\", NumberOfLines);\n+ exit(LibrarySales.PostSalesDocument(SalesHeader, true, true));\n+ end;\n+\n+ local procedure CopySalesDocument(var ToSalesHeader: Record \"Sales Header\"; DocNo: Code[20])\n+ var\n+ CopyDocumentMgt: Codeunit \"Copy Document Mgt.\";\n+ begin\n+ CopyDocumentMgt.SetProperties(true, false, false, false, false, false, false);\n+ CopyDocumentMgt.CopySalesDoc(\"Sales Document Type From\"::\"Posted Invoice\", DocNo, ToSalesHeader);\n+ end;\n+}\ndiff --git a/App/Apps/W1/Shopify/test/app.json b/App/Apps/W1/Shopify/test/app.json\n--- a/App/Apps/W1/Shopify/test/app.json\n+++ b/App/Apps/W1/Shopify/test/app.json\n@@ -71,6 +71,10 @@\n {\n \"from\": 139645,\n \"to\": 139649\n+ },\n+ {\n+ \"from\": 139695,\n+ \"to\": 139699\n }\n ],\n \"target\": \"OnPrem\",\n", "patch": "diff --git a/App/Apps/W1/Shopify/app/src/Invoicing/Codeunits/ShpfyUpdateSalesInvoice.Codeunit.al b/App/Apps/W1/Shopify/app/src/Invoicing/Codeunits/ShpfyUpdateSalesInvoice.Codeunit.al\n--- a/App/Apps/W1/Shopify/app/src/Invoicing/Codeunits/ShpfyUpdateSalesInvoice.Codeunit.al\n+++ b/App/Apps/W1/Shopify/app/src/Invoicing/Codeunits/ShpfyUpdateSalesInvoice.Codeunit.al\n@@ -1,6 +1,8 @@\n namespace Microsoft.Integration.Shopify;\n \n using Microsoft.Sales.History;\n+using Microsoft.Utilities;\n+using Microsoft.Sales.Document;\n \n codeunit 30364 \"Shpfy Update Sales Invoice\"\n {\n@@ -19,4 +21,11 @@\n begin\n SalesInvoiceHeader.\"Shpfy Order Id\" := SalesInvoiceHeaderRec.\"Shpfy Order Id\";\n end;\n+\n+ [EventSubscriber(ObjectType::Codeunit, Codeunit::\"Copy Document Mgt.\", 'OnCopySalesDocOnAfterTransferPostedInvoiceFields', '', false, false)]\n+ local procedure OnCopySalesDocOnAfterCopySalesDocUpdateHeader(var ToSalesHeader: Record \"Sales Header\")\n+ begin\n+ if ToSalesHeader.\"Document Type\" = ToSalesHeader.\"Document Type\"::Invoice then\n+ Clear(ToSalesHeader.\"Shpfy Order Id\");\n+ end;\n }\n"} +{"instance_id": "microsoftInternal__NAV-220036__cf-1", "base_instance_id": "microsoftInternal__NAV-220036", "variant_description": "The reminder email should use the customer email only if the contact email is empty (not when contact is missing)", "intervention_type": "Execution / Validation Semantics", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-220036__cf-1", "FAIL_TO_PASS": [{"codeunitID": 134905, "functionName": ["VerifyEmailOnReminderPageWhenCustomerHasNoContacts"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/ERMIssuedReminderAddnlFee.Codeunit.al b/App/Layers/W1/Tests/ERM/ERMIssuedReminderAddnlFee.Codeunit.al\n--- a/App/Layers/W1/Tests/ERM/ERMIssuedReminderAddnlFee.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ERMIssuedReminderAddnlFee.Codeunit.al\n@@ -585,6 +585,55 @@\n \n \n Assert.AreEqual(ReminderFinChargeEntry.\"Due Date\", CustLedgerEntry.\"Due Date\", ReminderDueDateErr);\n+ end;\n+\n+ [Test]\n+ [Scope('OnPrem')]\n+ procedure VerifyEmailOnReminderPageWhenCustomerHasNoContacts()\n+ var\n+ Customer: Record Customer;\n+ ReminderLevel: Record \"Reminder Level\";\n+ ReminderText: Record \"Reminder Text\";\n+ ReminderHeader: Record \"Reminder Header\";\n+ ReminderPage: TestPage Reminder;\n+ CustomerCard: TestPage \"Customer Card\";\n+ EMail: Text[80];\n+ DueDate: Date;\n+ DocumentDate: Date;\n+ begin\n+ // [SCENARIO 581797] [ALL-E] Field Email on Reminder is empty when customer does not have any contacts\n+ Initialize();\n+\n+ // [GIVEN] Create Customer with E-Mail and Reminder Terms Code.\n+ CreateCustomer(Customer, ''); // create contact but without email\n+ Customer.Validate(\"Reminder Terms Code\", CreateReminderTerms());\n+ EMail := 'test1@test.com';\n+ Customer.Modify(true);\n+\n+ CustomerCard.OpenEdit();\n+ CustomerCard.GoToRecord(Customer);\n+ CustomerCard.\"E-Mail\".SetValue(EMail);\n+ CustomerCard.Close();\n+\n+ // [GIVEN] Create Reminder Level with Random Grace Period and Random Additional Fee.\n+ ReminderLevel.SetRange(\"Reminder Terms Code\", Customer.\"Reminder Terms Code\");\n+ ReminderLevel.FindFirst();\n+ LibraryERM.CreateReminderText(\n+ ReminderText, Customer.\"Reminder Terms Code\",\n+ ReminderLevel.\"No.\", ReminderText.Position::Ending, ReminderEndingText);\n+\n+ // [WHEN] Post Sales Invoice and Create Reminder.\n+ DueDate := CreateAndPostSalesInvoice(Customer.\"No.\", '');\n+ DocumentDate := CalcDate('<' + Format(LibraryRandom.RandInt(5)) + 'D>', CalcDate(ReminderLevel.\"Grace Period\", DueDate));\n+ CreateReminder(Customer.\"No.\", DocumentDate, false);\n+\n+ // [THEN] Find Reminder Header for Customer and open Reminder Page.\n+ FindReminderHeader(ReminderHeader, Customer.\"No.\");\n+ ReminderPage.OpenEdit();\n+ ReminderPage.GoToRecord(ReminderHeader);\n+\n+ // [THEN] Verify E-Mail on Reminder Page.\n+ ReminderPage.ContactEmail.AssertEquals(EMail);\n end;\n \n local procedure Initialize()\ndiff --git a/App/Layers/W1/Tests/Misc/UTCustomerTable.Codeunit.al b/App/Layers/W1/Tests/Misc/UTCustomerTable.Codeunit.al\n--- a/App/Layers/W1/Tests/Misc/UTCustomerTable.Codeunit.al\n+++ b/App/Layers/W1/Tests/Misc/UTCustomerTable.Codeunit.al\n@@ -25,6 +25,7 @@\n DeleteCustomerSalesDocExistsErr: Label 'You cannot delete %1 %2 because there is at least one outstanding Sales %3 for this customer.';\n DialogErr: Label 'Dialog';\n PhoneNoCannotContainLettersErr: Label '%1 must not contain letters in %2 %3=''%4''.';\n+ ContactNoShouldNotBeEmpty: Label 'Contact No. should not be empty';\n \n [Test]\n [Scope('OnPrem')]\n@@ -740,8 +741,8 @@\n // [WHEN] Function GetPrimaryConact is being run with parameter \"CONT\"\n Customer.GetPrimaryContact(Customer.\"No.\", Contact);\n \n- // [THEN] Variable Contact is empty\n- Contact.TestField(\"No.\", '');\n+ // [THEN] Variable Contact exists without customer contact\n+ Assert.IsTrue(Contact.\"No.\" <> '', ContactNoShouldNotBeEmpty);\n end;\n \n [Test]\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Sales/Customer/Customer.Table.al b/App/Layers/W1/BaseApp/Sales/Customer/Customer.Table.al\n--- a/App/Layers/W1/BaseApp/Sales/Customer/Customer.Table.al\n+++ b/App/Layers/W1/BaseApp/Sales/Customer/Customer.Table.al\n@@ -2302,7 +2302,24 @@\n begin\n Clear(PrimaryContact);\n if Customer.Get(CustomerNo) then\n- if PrimaryContact.Get(Customer.\"Primary Contact No.\") then;\n+ if not PrimaryContact.Get(Customer.\"Primary Contact No.\") then\n+ GetContact(CustomerNo, PrimaryContact);\n+ if PrimaryContact.\"E-Mail\" = '' then\n+ PrimaryContact.\"E-Mail\" := Customer.\"E-Mail\";\n end;\n \n+ local procedure GetContact(CustomerNo: Code[20]; var PrimaryContact: Record Contact)\n+ var\n+ ContactBusinessRelation: Record \"Contact Business Relation\";\n+ begin\n+ ContactBusinessRelation.SetCurrentKey(\"Link to Table\", \"No.\");\n+ ContactBusinessRelation.SetRange(\"Link to Table\", ContactBusinessRelation.\"Link to Table\"::Customer);\n+ ContactBusinessRelation.SetRange(\"No.\", CustomerNo);\n+ if ContactBusinessRelation.FindSet() then\n+ repeat\n+ if PrimaryContact.Get(ContactBusinessRelation.\"Contact No.\") then\n+ exit;\n+ until ContactBusinessRelation.Next() = 0;\n+ end;\n+\n local procedure GetCustomerPriceGroupPriceCalcMethod(): Enum \"Price Calculation Method\";\n"} +{"instance_id": "microsoftInternal__NAV-220036__cf-2", "base_instance_id": "microsoftInternal__NAV-220036", "variant_description": "The reminder email must be set via an event subscriber during reminder creation, not via direct table logic", "intervention_type": "Event-Driven Paradigm", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-220036__cf-2", "FAIL_TO_PASS": [{"codeunitID": 134905, "functionName": ["VerifyEmailOnReminderPageWhenCustomerHasNoContacts"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/ERMIssuedReminderAddnlFee.Codeunit.al b/App/Layers/W1/Tests/ERM/ERMIssuedReminderAddnlFee.Codeunit.al\n--- a/App/Layers/W1/Tests/ERM/ERMIssuedReminderAddnlFee.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ERMIssuedReminderAddnlFee.Codeunit.al\n@@ -585,6 +585,55 @@\n \n \n Assert.AreEqual(ReminderFinChargeEntry.\"Due Date\", CustLedgerEntry.\"Due Date\", ReminderDueDateErr);\n+ end;\n+\n+ [Test]\n+ [Scope('OnPrem')]\n+ procedure VerifyEmailOnReminderPageWhenCustomerHasNoContacts()\n+ var\n+ Customer: Record Customer;\n+ ReminderLevel: Record \"Reminder Level\";\n+ ReminderText: Record \"Reminder Text\";\n+ ReminderHeader: Record \"Reminder Header\";\n+ ReminderPage: TestPage Reminder;\n+ CustomerCard: TestPage \"Customer Card\";\n+ EMail: Text[80];\n+ DueDate: Date;\n+ DocumentDate: Date;\n+ begin\n+ // [SCENARIO 581797] [ALL-E] Field Email on Reminder is empty when customer does not have any contacts\n+ Initialize();\n+\n+ // [GIVEN] Create Customer with E-Mail and Reminder Terms Code.\n+ CreateCustomer(Customer, '');\n+ Customer.Validate(\"Reminder Terms Code\", CreateReminderTerms());\n+ EMail := 'test1@test.com';\n+ Customer.Modify(true);\n+\n+ CustomerCard.OpenEdit();\n+ CustomerCard.GoToRecord(Customer);\n+ CustomerCard.\"E-Mail\".SetValue(EMail);\n+ CustomerCard.Close();\n+\n+ // [GIVEN] Create Reminder Level with Random Grace Period and Random Additional Fee.\n+ ReminderLevel.SetRange(\"Reminder Terms Code\", Customer.\"Reminder Terms Code\");\n+ ReminderLevel.FindFirst();\n+ LibraryERM.CreateReminderText(\n+ ReminderText, Customer.\"Reminder Terms Code\",\n+ ReminderLevel.\"No.\", ReminderText.Position::Ending, ReminderEndingText);\n+\n+ // [WHEN] Post Sales Invoice and Create Reminder (email should be assigned via event subscriber)\n+ DueDate := CreateAndPostSalesInvoice(Customer.\"No.\", '');\n+ DocumentDate := CalcDate('<' + Format(LibraryRandom.RandInt(5)) + 'D>', CalcDate(ReminderLevel.\"Grace Period\", DueDate));\n+ CreateReminder(Customer.\"No.\", DocumentDate, false);\n+\n+ // [THEN] Find Reminder Header for Customer and open Reminder Page.\n+ FindReminderHeader(ReminderHeader, Customer.\"No.\");\n+ ReminderPage.OpenEdit();\n+ ReminderPage.GoToRecord(ReminderHeader);\n+\n+ // [THEN] Verify E-Mail on Reminder Page.\n+ ReminderPage.ContactEmail.AssertEquals(EMail);\n end;\n \n local procedure Initialize()\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Sales/Reminder/ReminderEmailHandler.Codeunit.al b/App/Layers/W1/BaseApp/Sales/Reminder/ReminderEmailHandler.Codeunit.al\n--- a/App/Layers/W1/BaseApp/Sales/Reminder/ReminderEmailHandler.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Sales/Reminder/ReminderEmailHandler.Codeunit.al\n@@ -0,0 +1,13 @@\n+namespace Microsoft.Sales.Receivables;\n+\n+using Microsoft.Sales.Reminder;\n+\n+codeunit 393 \"Reminder Email Handler\"\n+{\n+ [EventSubscriber(ObjectType::Codeunit, Codeunit::\"Reminder-Make\", 'OnAfterCreateReminderHeader', '', false, false)]\n+ local procedure SetEmailFromCustomer(var ReminderHeader: Record \"Reminder Header\")\n+ begin\n+ if ReminderHeader.\"Contact E-Mail\" = '' then\n+ ReminderHeader.\"Contact E-Mail\" := ReminderHeader.\"E-Mail\";\n+ end;\n+}\n"} +{"instance_id": "microsoftInternal__NAV-188438__cf-1", "base_instance_id": "microsoftInternal__NAV-188438", "variant_description": "Custom Amount must be positive only when Emission Factor CO2 is positive; otherwise preserve original sign", "intervention_type": "Workflow / Business Logic Composition", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-188438__cf-1", "FAIL_TO_PASS": [{"codeunitID": 148181, "functionName": ["TestCustomAmountIsPositiveForNegativeTotalOfGL"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Apps/W1/Sustainability/test/src/SustainabilityJournalTest.Codeunit.al b/App/Apps/W1/Sustainability/test/src/SustainabilityJournalTest.Codeunit.al\n--- a/App/Apps/W1/Sustainability/test/src/SustainabilityJournalTest.Codeunit.al\n+++ b/App/Apps/W1/Sustainability/test/src/SustainabilityJournalTest.Codeunit.al\n@@ -5,9 +5,13 @@ codeunit 148181 \"Sustainability Journal Test\"\n\n var\n Assert: Codeunit Assert;\n+ LibraryERM: Codeunit \"Library - ERM\";\n+ LibraryRandom: Codeunit \"Library - Random\";\n LibrarySustainability: Codeunit \"Library - Sustainability\";\n+ LibraryUtility: Codeunit \"Library - Utility\";\n OneDefaultTemplateShouldBeCreatedLbl: Label 'One default template should be created after page is opened', Locked = true;\n OneDefaultBatchShouldBeCreatedLbl: Label 'One default batch should be created after page is opened', Locked = true;\n+ CustomAmountMustBePositiveLbl: Label 'The custom amount must be positive', Locked = true;\n\n [Test]\n procedure TestDefaultTemplateAndBatchSuccessfullyInserted()\n@@ -100,4 +104,52 @@ codeunit 148181 \"Sustainability Journal Test\"\n // [THEN] The Check should fail\n asserterror SustainabilityJournalMgt.CheckScopeMatchWithBatch(SustainabilityJournalLine);\n end;\n+\n+ [Test]\n+ procedure TestCustomAmountIsPositiveForNegativeTotalOfGL()\n+ var\n+ SustainAccountCategory: Record \"Sustain. Account Category\";\n+ GenJournalBatch: Record \"Gen. Journal Batch\";\n+ GenJouralLine: Record \"Gen. Journal Line\";\n+ SustainabilityCalcMgt: Codeunit \"Sustainability Calc. Mgt.\";\n+ GenJournalTemplateCode: Code[10];\n+ GLAccountNo: Code[20];\n+ GLAmount, CustomAmount : Decimal;\n+ begin\n+ // [SCENARIO 540221] Test that the custom amount is positive when the total of the GL is negative and Emission Factor CO2 is positive\n+\n+ // [GIVEN] G/L Account exists\n+ GLAccountNo := LibraryERM.CreateGLAccountNoWithDirectPosting();\n+\n+ // [GIVEN] G/L Batch and Template exist\n+ GenJournalTemplateCode := LibraryERM.SelectGenJnlTemplate();\n+ LibraryERM.CreateGenJournalBatch(GenJournalBatch, GenJournalTemplateCode);\n+\n+ // [GIVEN] G/L Entry with Amount = -1000 for the G/L Account\n+ GLAmount := -LibraryRandom.RandDec(1000, 2);\n+ LibraryERM.CreateGeneralJnlLine2WithBalAcc(GenJouralLine, GenJournalTemplateCode, GenJournalBatch.Name, GenJouralLine.\"Document Type\"::Payment, GenJouralLine.\"Account Type\"::\"G/L Account\", GLAccountNo, GenJouralLine.\"Account Type\"::\"G/L Account\", LibraryERM.CreateGLAccountNoWithDirectPosting(), GLAmount);\n+ LibraryERM.PostGeneralJnlLine(GenJouralLine);\n+\n+ // [GIVEN] Sustain Account Category with the G/L Account calculation foundation\n+ SustainAccountCategory := CreateSustAccountCategoryWithGLAccountNo(GLAccountNo);\n+\n+ // [GIVEN] Emission factor is positive\n+ SustainAccountCategory.\"Emission Factor CO2\" := 1;\n+ SustainAccountCategory.Modify(true);\n+\n+ // [WHEN] Getting the collectable amount for sustainability account category\n+ CustomAmount := SustainabilityCalcMgt.GetCollectableGLAmount(SustainAccountCategory, 0D, 0D);\n+\n+ // [THEN] The custom amount = 1000 (positive)\n+ Assert.AreEqual(Abs(GLAmount), CustomAmount, CustomAmountMustBePositiveLbl);\n+ end;\n+\n+ local procedure CreateSustAccountCategoryWithGLAccountNo(GLAccountNo: Code[20]) SustainAccountCategory: Record \"Sustain. Account Category\"\n+ begin\n+ SustainAccountCategory := LibrarySustainability.InsertAccountCategory(LibraryUtility.GenerateGUID(), LibraryUtility.GenerateGUID(), Enum::\"Emission Scope\"::\"Scope 2\", Enum::\"Calculation Foundation\"::Custom, true, true, true, 'GL', true);\n+ SustainAccountCategory.\"G/L Account Filter\" := GLAccountNo;\n+ SustainAccountCategory.Modify(true);\n+ end;\n }", "patch": "diff --git a/App/Apps/W1/Sustainability/app/src/Calculation/SustainabilityCalcMgt.Codeunit.al b/App/Apps/W1/Sustainability/app/src/Calculation/SustainabilityCalcMgt.Codeunit.al\n--- a/App/Apps/W1/Sustainability/app/src/Calculation/SustainabilityCalcMgt.Codeunit.al\n+++ b/App/Apps/W1/Sustainability/app/src/Calculation/SustainabilityCalcMgt.Codeunit.al\n@@ -70,7 +70,9 @@ codeunit 6218 \"Sustainability Calc. Mgt.\"\n begin\n FilterGLEntry(SustainAccountCategory, FromDate, ToDate, GLEntry);\n GLEntry.CalcSums(Amount);\n- exit(GLEntry.Amount);\n+ if SustainAccountCategory.\"Emission Factor CO2\" > 0 then\n+ exit(Abs(GLEntry.Amount));\n+ exit(GLEntry.Amount);\n end;\n\n internal procedure CollectGeneralLedgerAmount(var SustainabilityJnlLine: Record \"Sustainability Jnl. Line\")\n"} +{"instance_id": "microsoftInternal__NAV-188438__cf-2", "base_instance_id": "microsoftInternal__NAV-188438", "variant_description": "Only G/L accounts with Direct Posting enabled should be considered when collecting amounts; non-Direct Posting accounts are excluded", "intervention_type": "Ecosystem / Toolchain Semantics", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-188438__cf-2", "FAIL_TO_PASS": [{"codeunitID": 148181, "functionName": ["TestCustomAmountIsPositiveForNegativeTotalOfGL"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Apps/W1/Sustainability/test/src/SustainabilityJournalTest.Codeunit.al b/App/Apps/W1/Sustainability/test/src/SustainabilityJournalTest.Codeunit.al\n--- a/App/Apps/W1/Sustainability/test/src/SustainabilityJournalTest.Codeunit.al\n+++ b/App/Apps/W1/Sustainability/test/src/SustainabilityJournalTest.Codeunit.al\n@@ -5,9 +5,13 @@ codeunit 148181 \"Sustainability Journal Test\"\n\n var\n Assert: Codeunit Assert;\n+ LibraryERM: Codeunit \"Library - ERM\";\n+ LibraryRandom: Codeunit \"Library - Random\";\n LibrarySustainability: Codeunit \"Library - Sustainability\";\n+ LibraryUtility: Codeunit \"Library - Utility\";\n OneDefaultTemplateShouldBeCreatedLbl: Label 'One default template should be created after page is opened', Locked = true;\n OneDefaultBatchShouldBeCreatedLbl: Label 'One default batch should be created after page is opened', Locked = true;\n+ CustomAmountMustBePositiveLbl: Label 'The custom amount must be positive', Locked = true;\n\n [Test]\n procedure TestDefaultTemplateAndBatchSuccessfullyInserted()\n@@ -100,4 +104,50 @@ codeunit 148181 \"Sustainability Journal Test\"\n // [THEN] The Check should fail\n asserterror SustainabilityJournalMgt.CheckScopeMatchWithBatch(SustainabilityJournalLine);\n end;\n+\n+ [Test]\n+ procedure TestCustomAmountIsPositiveForNegativeTotalOfGL()\n+ var\n+ SustainAccountCategory: Record \"Sustain. Account Category\";\n+ GenJournalBatch: Record \"Gen. Journal Batch\";\n+ GenJouralLine: Record \"Gen. Journal Line\";\n+ GLAccount: Record \"G/L Account\";\n+ SustainabilityCalcMgt: Codeunit \"Sustainability Calc. Mgt.\";\n+ GenJournalTemplateCode: Code[10];\n+ GLAccountNo: Code[20];\n+ GLAmount, CustomAmount : Decimal;\n+ begin\n+ // [SCENARIO 540221] Test that the custom amount is positive when the total of the GL is negative and the G/L Account has Direct Posting enabled\n+\n+ // [GIVEN] G/L Account exists with Direct Posting\n+ GLAccountNo := LibraryERM.CreateGLAccountNoWithDirectPosting();\n+\n+ // [GIVEN] Verify G/L Account has Direct Posting = true\n+ GLAccount.Get(GLAccountNo);\n+ Assert.IsTrue(GLAccount.\"Direct Posting\", 'G/L Account must have Direct Posting enabled');\n+\n+ // [GIVEN] G/L Batch and Template exist\n+ GenJournalTemplateCode := LibraryERM.SelectGenJnlTemplate();\n+ LibraryERM.CreateGenJournalBatch(GenJournalBatch, GenJournalTemplateCode);\n+\n+ // [GIVEN] G/L Entry with Amount = -1000 for the G/L Account\n+ GLAmount := -LibraryRandom.RandDec(1000, 2);\n+ LibraryERM.CreateGeneralJnlLine2WithBalAcc(GenJouralLine, GenJournalTemplateCode, GenJournalBatch.Name, GenJouralLine.\"Document Type\"::Payment, GenJouralLine.\"Account Type\"::\"G/L Account\", GLAccountNo, GenJouralLine.\"Account Type\"::\"G/L Account\", LibraryERM.CreateGLAccountNoWithDirectPosting(), GLAmount);\n+ LibraryERM.PostGeneralJnlLine(GenJouralLine);\n+\n+ // [GIVEN] Sustain Account Category with the G/L Account calculation foundation\n+ SustainAccountCategory := CreateSustAccountCategoryWithGLAccountNo(GLAccountNo);\n+\n+ // [WHEN] Getting the collectable amount for sustainability account category\n+ CustomAmount := SustainabilityCalcMgt.GetCollectableGLAmount(SustainAccountCategory, 0D, 0D);\n+\n+ // [THEN] The custom amount = 1000 (positive, because G/L Account has Direct Posting)\n+ Assert.AreEqual(Abs(GLAmount), CustomAmount, CustomAmountMustBePositiveLbl);\n+ end;\n+\n+ local procedure CreateSustAccountCategoryWithGLAccountNo(GLAccountNo: Code[20]) SustainAccountCategory: Record \"Sustain. Account Category\"\n+ begin\n+ SustainAccountCategory := LibrarySustainability.InsertAccountCategory(LibraryUtility.GenerateGUID(), LibraryUtility.GenerateGUID(), Enum::\"Emission Scope\"::\"Scope 2\", Enum::\"Calculation Foundation\"::Custom, true, true, true, 'GL', true);\n+ SustainAccountCategory.\"G/L Account Filter\" := GLAccountNo;\n+ SustainAccountCategory.Modify(true);\n+ end;\n }", "patch": "diff --git a/App/Apps/W1/Sustainability/app/src/Calculation/SustainabilityCalcMgt.Codeunit.al b/App/Apps/W1/Sustainability/app/src/Calculation/SustainabilityCalcMgt.Codeunit.al\n--- a/App/Apps/W1/Sustainability/app/src/Calculation/SustainabilityCalcMgt.Codeunit.al\n+++ b/App/Apps/W1/Sustainability/app/src/Calculation/SustainabilityCalcMgt.Codeunit.al\n@@ -68,9 +68,13 @@ codeunit 6218 \"Sustainability Calc. Mgt.\"\n var\n GLEntry: Record \"G/L Entry\";\n+ GLAccount: Record \"G/L Account\";\n begin\n FilterGLEntry(SustainAccountCategory, FromDate, ToDate, GLEntry);\n GLEntry.CalcSums(Amount);\n- exit(GLEntry.Amount);\n+ if GLAccount.Get(GLEntry.\"G/L Account No.\") and (not GLAccount.\"Direct Posting\") then\n+ exit(0);\n+ exit(Abs(GLEntry.Amount));\n end;\n\n internal procedure CollectGeneralLedgerAmount(var SustainabilityJnlLine: Record \"Sustainability Jnl. Line\")\n"} +{"instance_id": "microsoftInternal__NAV-224447__cf-1", "base_instance_id": "microsoftInternal__NAV-224447", "variant_description": "Only issued reminders for customers with a non-empty Language Code should be logged in email related records", "intervention_type": "Execution / Validation Semantics", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-224447__cf-1", "FAIL_TO_PASS": [{"codeunitID": 134979, "functionName": ["SendIssuedReminderByEmailAndEntryCreatedInEmailRelatedRecords"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/ReminderAutomationTests.Codeunit.al b/App/Layers/W1/Tests/ERM/ReminderAutomationTests.Codeunit.al\n--- a/App/Layers/W1/Tests/ERM/ReminderAutomationTests.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ReminderAutomationTests.Codeunit.al\n@@ -844,6 +844,53 @@ codeunit 134979 \"Reminder Automation Tests\"\n ReminderTermSetupPage.ReminderLevelSetup.CustomerCommunications.Invoke();\n end;\n\n+ [Test]\n+ [Scope('OnPrem')]\n+ [HandlerFunctions('ModalEmailEditorHandler,CancelMailSendingStrMenuHandler')]\n+ procedure SendIssuedReminderByEmailAndEntryCreatedInEmailRelatedRecords()\n+ var\n+ Customer: Record Customer;\n+ IssuedReminderHeader: Record \"Issued Reminder Header\";\n+ ReminderTerms: Record \"Reminder Terms\";\n+ ReminderHeader: Record \"Reminder Header\";\n+ LanguageCode: Code[10];\n+ FileName: Text;\n+ begin\n+ // [SCENARIO 591799] Issued reminder emails are not logged in sent e-mail history of a customer\n+ Initialize();\n+\n+ // [WHEN] A connector is installed and an account is added\n+ InstallConnectorAndAddAccount();\n+\n+ // [GIVEN] Create reminder term with levels\n+ CreateReminderTermsWithLevels(ReminderTerms, GetDefaultDueDatePeriodForReminderLevel(), Any.IntegerInRange(2, 5));\n+\n+ // [GIVEN] Create reminder attachment text, file name = XXX, language code = Y\n+ LanguageCode := LibraryERM.GetAnyLanguageDifferentFromCurrent();\n+ CreateReminderAttachmentText(ReminderTerms, LanguageCode);\n+\n+ // [GIVEN] Create a customer X with overdue entries\n+ CreateCustomerWithOverdueEntries(Customer, ReminderTerms, Any.IntegerInRange(2, 5));\n+\n+ // [GIVEN] Set language code Y for customer X\n+ Customer.\"Language Code\" := LanguageCode;\n+ Customer.Modify();\n+ FileName := LibraryVariableStorage.DequeueText();\n+ LibraryVariableStorage.Enqueue(Customer.\"No.\");\n+ LibraryVariableStorage.Enqueue(FileName);\n+\n+ // [GIVEN] Create and issue reminder for customer X\n+ CreateAndIssueReminder(ReminderHeader, Customer.\"No.\");\n+\n+ // [WHEN] Run action \"Send by mail\" on issued reminder\n+ IssuedReminderHeader.SetRange(\"Pre-Assigned No.\", ReminderHeader.\"No.\");\n+ IssuedReminderHeader.FindFirst();\n+ CustomReportSelectionPrint(IssuedReminderHeader, Enum::\"Report Selection Usage\"::Reminder, 1);\n+\n+ // [THEN] Verified in ModalEmailEditorHandler page\n+ LibraryVariableStorage.Clear();\n+ end;\n+\n@@ -1179,6 +1226,57 @@ codeunit 134979 \"Reminder Automation Tests\"\n end;\n end;\n\n+ local procedure InstallConnectorAndAddAccount()\n+ var\n+ TempAccount: Record \"Email Account\" temporary;\n+ ConnectorMock: Codeunit \"Connector Mock\";\n+ EmailScenarioMock: Codeunit \"Email Scenario Mock\";\n+ begin\n+ ConnectorMock.Initialize();\n+ ConnectorMock.AddAccount(TempAccount);\n+ EmailScenarioMock.DeleteAllMappings();\n+ EmailScenarioMock.AddMapping(Enum::\"Email Scenario\"::Default, TempAccount.\"Account Id\", TempAccount.Connector);\n+ end;\n+\n+ local procedure CustomReportSelectionPrint(Document: Variant; ReportUsage: Enum \"Report Selection Usage\"; CustomerNoFieldNo: Integer)\n+ var\n+ ReportSelections: Record \"Report Selections\";\n+ TempReportSelections: Record \"Report Selections\" temporary;\n+ RecRef: RecordRef;\n+ FieldRef: FieldRef;\n+ CustomerNo: Code[20];\n+ begin\n+ RecRef.GetTable(Document);\n+ FieldRef := RecRef.Field(CustomerNoFieldNo);\n+ CustomerNo := CopyStr(Format(FieldRef.Value), 1, MaxStrLen(CustomerNo));\n+\n+ RecRef.SetRecFilter();\n+ RecRef.SetTable(Document);\n+\n+ ReportSelections.FindEmailAttachmentUsageForCust(ReportUsage, CustomerNo, TempReportSelections);\n+ ReportSelections.SendEmailToCust(ReportUsage.AsInteger(), Document, '', '', true, CustomerNo);\n+ end;\n+\n+ [StrMenuHandler]\n+ [Scope('OnPrem')]\n+ procedure CancelMailSendingStrMenuHandler(Options: Text; var Choice: Integer; Instruction: Text)\n+ begin\n+ Choice := 1; //Save as Draft //Discard email\n+ end;\n+\n+ [ModalPageHandler]\n+ [Scope('OnPrem')]\n+ procedure ModalEmailEditorHandler(var EmailEditor: TestPage \"Email Editor\")\n+ var\n+ Customer: Record Customer;\n+ EmailRelatedRecord: Record \"Email Related Record\";\n+ begin\n+ Customer.Get(LibraryVariableStorage.DequeueText());\n+ if Customer.\"Language Code\" = '' then\n+ exit;\n+ EmailRelatedRecord.SetRange(\"Table Id\", Database::Customer);\n+ EmailRelatedRecord.SetRange(\"System Id\", Customer.SystemId);\n+ Assert.IsTrue(EmailRelatedRecord.FindFirst(), EmailRelatedRecordNotFoundErr);\n+ end;\n+\n@@ -1271,4 +1369,5 @@ codeunit 134979 \"Reminder Automation Tests\"\n Any: Codeunit Any;\n IsInitialized: Boolean;\n FiltersAreNotSavedErr: Label 'Filters are not saved';\n+ EmailRelatedRecordNotFoundErr: Label 'Email related record not found';\n }", "patch": "diff --git a/App/Layers/W1/BaseApp/Foundation/Reporting/ReportSelections.Table.al b/App/Layers/W1/BaseApp/Foundation/Reporting/ReportSelections.Table.al\n--- a/App/Layers/W1/BaseApp/Foundation/Reporting/ReportSelections.Table.al\n+++ b/App/Layers/W1/BaseApp/Foundation/Reporting/ReportSelections.Table.al\n@@ -1269,7 +1269,8 @@ table 77 \"Report Selections\"\n Database::\"Sales Invoice Header\",\n Database::\"Sales Cr.Memo Header\",\n Database::\"Sales Shipment Header\",\n- Database::\"Return Receipt Header\"];\n+ Database::\"Return Receipt Header\",\n+ Database::\"Issued Reminder Header\"];\n\n OnAfterIsCustomerAccount(DocumentTableId, IsCustomer);\n end;\n@@ -1521,7 +1522,10 @@ table 77 \"Report Selections\"\n // Related Source - Customer or vendor receiving the document\n TableId := GetAccountTableId(DocumentRecord.Number());\n if TableId = Database::Customer then begin\n- FieldName := 'Sell-to Customer No.';\n+ if (DocumentRecord.Number() = Database::\"Issued Reminder Header\") and (Customer.\"Language Code\" <> '') then\n+ FieldName := 'Customer No.'\n+ else\n+ FieldName := 'Sell-to Customer No.';\n OnSendEmailDirectlyOnAfterSetFieldName(DocumentRecord.Number(), FieldName);\n if DataTypeManagement.FindfieldByName(DocumentRecord, FieldRef, FieldName) and Customer.Get(Format(FieldRef.Value())) then begin\n SourceTableIDs.Add(Database::Customer);\n"} +{"instance_id": "microsoftInternal__NAV-224447__cf-2", "base_instance_id": "microsoftInternal__NAV-224447", "variant_description": "Email logging must occur only when triggered via an event subscriber, not via direct table logic", "intervention_type": "Event-Driven Paradigm", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-224447__cf-2", "FAIL_TO_PASS": [{"codeunitID": 134979, "functionName": ["SendIssuedReminderByEmailAndEntryCreatedInEmailRelatedRecords"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/ReminderAutomationTests.Codeunit.al b/App/Layers/W1/Tests/ERM/ReminderAutomationTests.Codeunit.al\n--- a/App/Layers/W1/Tests/ERM/ReminderAutomationTests.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ReminderAutomationTests.Codeunit.al\n@@ -844,6 +844,53 @@ codeunit 134979 \"Reminder Automation Tests\"\n ReminderTermSetupPage.ReminderLevelSetup.CustomerCommunications.Invoke();\n end;\n\n+ [Test]\n+ [Scope('OnPrem')]\n+ [HandlerFunctions('ModalEmailEditorHandler,CancelMailSendingStrMenuHandler')]\n+ procedure SendIssuedReminderByEmailAndEntryCreatedInEmailRelatedRecords()\n+ var\n+ Customer: Record Customer;\n+ IssuedReminderHeader: Record \"Issued Reminder Header\";\n+ ReminderTerms: Record \"Reminder Terms\";\n+ ReminderHeader: Record \"Reminder Header\";\n+ LanguageCode: Code[10];\n+ FileName: Text;\n+ begin\n+ // [SCENARIO 591799] Issued reminder emails are not logged in sent e-mail history of a customer\n+ Initialize();\n+\n+ // [WHEN] A connector is installed and an account is added\n+ InstallConnectorAndAddAccount();\n+\n+ // [GIVEN] Create reminder term with levels\n+ CreateReminderTermsWithLevels(ReminderTerms, GetDefaultDueDatePeriodForReminderLevel(), Any.IntegerInRange(2, 5));\n+\n+ // [GIVEN] Create reminder attachment text, file name = XXX, language code = Y\n+ LanguageCode := LibraryERM.GetAnyLanguageDifferentFromCurrent();\n+ CreateReminderAttachmentText(ReminderTerms, LanguageCode);\n+\n+ // [GIVEN] Create a customer X with overdue entries\n+ CreateCustomerWithOverdueEntries(Customer, ReminderTerms, Any.IntegerInRange(2, 5));\n+\n+ // [GIVEN] Set language code Y for customer X\n+ Customer.\"Language Code\" := LanguageCode;\n+ Customer.Modify();\n+ FileName := LibraryVariableStorage.DequeueText();\n+ LibraryVariableStorage.Enqueue(Customer.\"No.\");\n+ LibraryVariableStorage.Enqueue(FileName);\n+ LibraryVariableStorage.Enqueue(true); // event-based flow flag\n+\n+ // [GIVEN] Create and issue reminder for customer X\n+ CreateAndIssueReminder(ReminderHeader, Customer.\"No.\");\n+\n+ // [WHEN] Run action \"Send by mail\" on issued reminder\n+ IssuedReminderHeader.SetRange(\"Pre-Assigned No.\", ReminderHeader.\"No.\");\n+ IssuedReminderHeader.FindFirst();\n+ CustomReportSelectionPrint(IssuedReminderHeader, Enum::\"Report Selection Usage\"::Reminder, 1);\n+\n+ // [THEN] Verified in ModalEmailEditorHandler page\n+ LibraryVariableStorage.Clear();\n+ end;\n+\n@@ -1179,6 +1226,57 @@ codeunit 134979 \"Reminder Automation Tests\"\n end;\n end;\n\n+ local procedure InstallConnectorAndAddAccount()\n+ var\n+ TempAccount: Record \"Email Account\" temporary;\n+ ConnectorMock: Codeunit \"Connector Mock\";\n+ EmailScenarioMock: Codeunit \"Email Scenario Mock\";\n+ begin\n+ ConnectorMock.Initialize();\n+ ConnectorMock.AddAccount(TempAccount);\n+ EmailScenarioMock.DeleteAllMappings();\n+ EmailScenarioMock.AddMapping(Enum::\"Email Scenario\"::Default, TempAccount.\"Account Id\", TempAccount.Connector);\n+ end;\n+\n+ local procedure CustomReportSelectionPrint(Document: Variant; ReportUsage: Enum \"Report Selection Usage\"; CustomerNoFieldNo: Integer)\n+ var\n+ ReportSelections: Record \"Report Selections\";\n+ TempReportSelections: Record \"Report Selections\" temporary;\n+ RecRef: RecordRef;\n+ FieldRef: FieldRef;\n+ CustomerNo: Code[20];\n+ begin\n+ RecRef.GetTable(Document);\n+ FieldRef := RecRef.Field(CustomerNoFieldNo);\n+ CustomerNo := CopyStr(Format(FieldRef.Value), 1, MaxStrLen(CustomerNo));\n+\n+ RecRef.SetRecFilter();\n+ RecRef.SetTable(Document);\n+\n+ ReportSelections.FindEmailAttachmentUsageForCust(ReportUsage, CustomerNo, TempReportSelections);\n+ ReportSelections.SendEmailToCust(ReportUsage.AsInteger(), Document, '', '', true, CustomerNo);\n+ end;\n+\n+ [StrMenuHandler]\n+ [Scope('OnPrem')]\n+ procedure CancelMailSendingStrMenuHandler(Options: Text; var Choice: Integer; Instruction: Text)\n+ begin\n+ Choice := 1; //Save as Draft //Discard email\n+ end;\n+\n+ [ModalPageHandler]\n+ [Scope('OnPrem')]\n+ procedure ModalEmailEditorHandler(var EmailEditor: TestPage \"Email Editor\")\n+ var\n+ Customer: Record Customer;\n+ EmailRelatedRecord: Record \"Email Related Record\";\n+ begin\n+ Customer.Get(LibraryVariableStorage.DequeueText());\n+ // simulate event-driven constraint: only verify if event-based flow executed\n+ if not LibraryVariableStorage.DequeueBoolean() then\n+ exit;\n+ EmailRelatedRecord.SetRange(\"Table Id\", Database::Customer);\n+ EmailRelatedRecord.SetRange(\"System Id\", Customer.SystemId);\n+ Assert.IsTrue(EmailRelatedRecord.FindFirst(), EmailRelatedRecordNotFoundErr);\n+ end;\n+\n@@ -1271,4 +1369,5 @@ codeunit 134979 \"Reminder Automation Tests\"\n Any: Codeunit Any;\n IsInitialized: Boolean;\n FiltersAreNotSavedErr: Label 'Filters are not saved';\n+ EmailRelatedRecordNotFoundErr: Label 'Email related record not found';\n }", "patch": "diff --git a/App/Layers/W1/BaseApp/Foundation/Reporting/ReportSelections.Table.al b/App/Layers/W1/BaseApp/Foundation/Reporting/ReportSelections.Table.al\n--- a/App/Layers/W1/BaseApp/Foundation/Reporting/ReportSelections.Table.al\n+++ b/App/Layers/W1/BaseApp/Foundation/Reporting/ReportSelections.Table.al\n@@ -1269,7 +1269,8 @@ table 77 \"Report Selections\"\n Database::\"Sales Invoice Header\",\n Database::\"Sales Cr.Memo Header\",\n Database::\"Sales Shipment Header\",\n- Database::\"Return Receipt Header\"];\n+ Database::\"Return Receipt Header\",\n+ Database::\"Issued Reminder Header\"];\n\n OnAfterIsCustomerAccount(DocumentTableId, IsCustomer);\n end;\n@@ -1521,7 +1522,10 @@ table 77 \"Report Selections\"\n // Related Source - Customer or vendor receiving the document\n TableId := GetAccountTableId(DocumentRecord.Number());\n if TableId = Database::Customer then begin\n- FieldName := 'Sell-to Customer No.';\n+ if (DocumentRecord.Number() = Database::\"Issued Reminder Header\") and IsHandledByEvent then\n+ FieldName := 'Customer No.'\n+ else\n+ FieldName := 'Sell-to Customer No.';\n OnSendEmailDirectlyOnAfterSetFieldName(DocumentRecord.Number(), FieldName);\n if DataTypeManagement.FindfieldByName(DocumentRecord, FieldRef, FieldName) and Customer.Get(Format(FieldRef.Value())) then begin\n SourceTableIDs.Add(Database::Customer);\n"} +{"instance_id": "microsoftInternal__NAV-224447__cf-3", "base_instance_id": "microsoftInternal__NAV-224447", "variant_description": "Email should be logged only if the reminder is actually sent, not saved as draft", "intervention_type": "Workflow / Business Logic Composition", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-224447__cf-3", "FAIL_TO_PASS": [{"codeunitID": 134979, "functionName": ["SendIssuedReminderByEmailAndEntryCreatedInEmailRelatedRecords"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/ReminderAutomationTests.Codeunit.al b/App/Layers/W1/Tests/ERM/ReminderAutomationTests.Codeunit.al\n--- a/App/Layers/W1/Tests/ERM/ReminderAutomationTests.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ReminderAutomationTests.Codeunit.al\n@@ -844,6 +844,53 @@ codeunit 134979 \"Reminder Automation Tests\"\n ReminderTermSetupPage.ReminderLevelSetup.CustomerCommunications.Invoke();\n end;\n\n+ [Test]\n+ [Scope('OnPrem')]\n+ [HandlerFunctions('ModalEmailEditorHandler,CancelMailSendingStrMenuHandler')]\n+ procedure SendIssuedReminderByEmailAndEntryCreatedInEmailRelatedRecords()\n+ var\n+ Customer: Record Customer;\n+ IssuedReminderHeader: Record \"Issued Reminder Header\";\n+ ReminderTerms: Record \"Reminder Terms\";\n+ ReminderHeader: Record \"Reminder Header\";\n+ LanguageCode: Code[10];\n+ FileName: Text;\n+ begin\n+ // [SCENARIO 591799] Issued reminder emails are not logged in sent e-mail history of a customer\n+ Initialize();\n+\n+ // [WHEN] A connector is installed and an account is added\n+ InstallConnectorAndAddAccount();\n+\n+ // [GIVEN] Create reminder term with levels\n+ CreateReminderTermsWithLevels(ReminderTerms, GetDefaultDueDatePeriodForReminderLevel(), Any.IntegerInRange(2, 5));\n+\n+ // [GIVEN] Create reminder attachment text, file name = XXX, language code = Y\n+ LanguageCode := LibraryERM.GetAnyLanguageDifferentFromCurrent();\n+ CreateReminderAttachmentText(ReminderTerms, LanguageCode);\n+\n+ // [GIVEN] Create a customer X with overdue entries\n+ CreateCustomerWithOverdueEntries(Customer, ReminderTerms, Any.IntegerInRange(2, 5));\n+\n+ // [GIVEN] Set language code Y for customer X\n+ Customer.\"Language Code\" := LanguageCode;\n+ Customer.Modify();\n+ FileName := LibraryVariableStorage.DequeueText();\n+ LibraryVariableStorage.Enqueue(Customer.\"No.\");\n+ LibraryVariableStorage.Enqueue(FileName);\n+\n+ // [GIVEN] Create and issue reminder for customer X\n+ CreateAndIssueReminder(ReminderHeader, Customer.\"No.\");\n+\n+ // [WHEN] Run action \"Send by mail\" on issued reminder\n+ IssuedReminderHeader.SetRange(\"Pre-Assigned No.\", ReminderHeader.\"No.\");\n+ IssuedReminderHeader.FindFirst();\n+ CustomReportSelectionPrint(IssuedReminderHeader, Enum::\"Report Selection Usage\"::Reminder, 1);\n+\n+ // [THEN] Verified in ModalEmailEditorHandler page\n+ LibraryVariableStorage.Clear();\n+ end;\n+\n@@ -1179,6 +1226,57 @@ codeunit 134979 \"Reminder Automation Tests\"\n end;\n end;\n\n+ local procedure InstallConnectorAndAddAccount()\n+ var\n+ TempAccount: Record \"Email Account\" temporary;\n+ ConnectorMock: Codeunit \"Connector Mock\";\n+ EmailScenarioMock: Codeunit \"Email Scenario Mock\";\n+ begin\n+ ConnectorMock.Initialize();\n+ ConnectorMock.AddAccount(TempAccount);\n+ EmailScenarioMock.DeleteAllMappings();\n+ EmailScenarioMock.AddMapping(Enum::\"Email Scenario\"::Default, TempAccount.\"Account Id\", TempAccount.Connector);\n+ end;\n+\n+ local procedure CustomReportSelectionPrint(Document: Variant; ReportUsage: Enum \"Report Selection Usage\"; CustomerNoFieldNo: Integer)\n+ var\n+ ReportSelections: Record \"Report Selections\";\n+ TempReportSelections: Record \"Report Selections\" temporary;\n+ RecRef: RecordRef;\n+ FieldRef: FieldRef;\n+ CustomerNo: Code[20];\n+ begin\n+ RecRef.GetTable(Document);\n+ FieldRef := RecRef.Field(CustomerNoFieldNo);\n+ CustomerNo := CopyStr(Format(FieldRef.Value), 1, MaxStrLen(CustomerNo));\n+\n+ RecRef.SetRecFilter();\n+ RecRef.SetTable(Document);\n+\n+ ReportSelections.FindEmailAttachmentUsageForCust(ReportUsage, CustomerNo, TempReportSelections);\n+ ReportSelections.SendEmailToCust(ReportUsage.AsInteger(), Document, '', '', true, CustomerNo);\n+ end;\n+\n+ [StrMenuHandler]\n+ [Scope('OnPrem')]\n+ procedure CancelMailSendingStrMenuHandler(Options: Text; var Choice: Integer; Instruction: Text)\n+ begin\n+ Choice := 2; //Send email instead of draft\n+ end;\n+\n+ [ModalPageHandler]\n+ [Scope('OnPrem')]\n+ procedure ModalEmailEditorHandler(var EmailEditor: TestPage \"Email Editor\")\n+ var\n+ Customer: Record Customer;\n+ EmailRelatedRecord: Record \"Email Related Record\";\n+ begin\n+ Customer.Get(LibraryVariableStorage.DequeueText());\n+ EmailRelatedRecord.SetRange(\"Table Id\", Database::Customer);\n+ EmailRelatedRecord.SetRange(\"System Id\", Customer.SystemId);\n+ Assert.IsTrue(EmailRelatedRecord.FindFirst(), EmailRelatedRecordNotFoundErr);\n+ end;\n+\n@@ -1271,4 +1369,5 @@ codeunit 134979 \"Reminder Automation Tests\"\n Any: Codeunit Any;\n IsInitialized: Boolean;\n FiltersAreNotSavedErr: Label 'Filters are not saved';\n+ EmailRelatedRecordNotFoundErr: Label 'Email related record not found';\n }", "patch": "diff --git a/App/Layers/W1/BaseApp/Foundation/Reporting/ReportSelections.Table.al b/App/Layers/W1/BaseApp/Foundation/Reporting/ReportSelections.Table.al\n--- a/App/Layers/W1/BaseApp/Foundation/Reporting/ReportSelections.Table.al\n+++ b/App/Layers/W1/BaseApp/Foundation/Reporting/ReportSelections.Table.al\n@@ -1269,7 +1269,8 @@ table 77 \"Report Selections\"\n Database::\"Sales Invoice Header\",\n Database::\"Sales Cr.Memo Header\",\n Database::\"Sales Shipment Header\",\n- Database::\"Return Receipt Header\"];\n+ Database::\"Return Receipt Header\",\n+ Database::\"Issued Reminder Header\"];\n\n OnAfterIsCustomerAccount(DocumentTableId, IsCustomer);\n end;\n@@ -1521,7 +1522,10 @@ table 77 \"Report Selections\"\n // Related Source - Customer or vendor receiving the document\n TableId := GetAccountTableId(DocumentRecord.Number());\n if TableId = Database::Customer then begin\n- FieldName := 'Sell-to Customer No.';\n+ if (DocumentRecord.Number() = Database::\"Issued Reminder Header\") and EmailSent then\n+ FieldName := 'Customer No.'\n+ else\n+ FieldName := 'Sell-to Customer No.';\n OnSendEmailDirectlyOnAfterSetFieldName(DocumentRecord.Number(), FieldName);\n if DataTypeManagement.FindfieldByName(DocumentRecord, FieldRef, FieldName) and Customer.Get(Format(FieldRef.Value())) then begin\n SourceTableIDs.Add(Database::Customer);\n"} +{"instance_id": "microsoftInternal__NAV-226875__cf-1", "base_instance_id": "microsoftInternal__NAV-226875", "variant_description": "Vendor Name should be populated only when updated through a validation trigger event, not via passive UI binding", "intervention_type": "Event-Driven Paradigm", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-226875__cf-1", "FAIL_TO_PASS": [{"codeunitID": 134920, "functionName": ["VendorNameFieldPopulatesOnlyForVendorAccountType"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/General Journal/ERMGeneralJournalUT.Codeunit.al b/App/Layers/W1/Tests/General Journal/ERMGeneralJournalUT.Codeunit.al\n--- a/App/Layers/W1/Tests/General Journal/ERMGeneralJournalUT.Codeunit.al\n+++ b/App/Layers/W1/Tests/General Journal/ERMGeneralJournalUT.Codeunit.al\n@@ -6000,6 +6000,56 @@ codeunit 134920 \"ERM General Journal UT\"\n GenJournalLine[4].TestField(\"Document No.\", NewDocNo);\n end;\n\n+ [Test]\n+ procedure VendorNameFieldPopulatesOnlyForVendorAccountType()\n+ var\n+ GenJournalBatch: Record \"Gen. Journal Batch\";\n+ GenJournalTemplate: Record \"Gen. Journal Template\";\n+ GLAccount: Record \"G/L Account\";\n+ Vendor: Record Vendor;\n+ PurchaseJournal: TestPage \"Purchase Journal\";\n+ begin\n+ // [SCENARIO 599505] Purchase Journal page validates vendor name field based on account type via validation trigger\n+ Initialize();\n+\n+ // [GIVEN] Create a vendor with random name\n+ LibraryPurchase.CreateVendor(Vendor);\n+ Vendor.Name := LibraryRandom.RandText(20);\n+ Vendor.Modify(true);\n+\n+ // [GIVEN] Create Purchase Journal Template and Batch\n+ LibraryERM.CreateGenJournalBatch(GenJournalBatch, LibraryJournals.SelectGenJournalTemplate(GenJournalTemplate.Type::Purchases, Page::\"Purchase Journal\"));\n+\n+ // [WHEN] Open Purchase Journal page and perform actions\n+ PurchaseJournal.OpenEdit();\n+ PurchaseJournal.CurrentJnlBatchName.SetValue(GenJournalBatch.Name);\n+\n+ // [GIVEN] Set Document Type to Invoice and Document No. to random value\n+ PurchaseJournal.\"Document Type\".SetValue(\"Gen. Journal Document Type\"::Invoice);\n+ PurchaseJournal.\"Document No.\".SetValue(LibraryRandom.RandText(10));\n+\n+ // [GIVEN] Set Account Type to Vendor and Account No. to Vendor.\"No.\"\n+ PurchaseJournal.\"Account Type\".SetValue(\"Gen. Journal Account Type\"::Vendor);\n+ PurchaseJournal.\"Account No.\".SetValue(Vendor.\"No.\");\n+\n+ // [THEN] Verify Vendor Name page field is populated with Vendor.Name (triggered via validation event)\n+ PurchaseJournal.\"Account No.\".Activate();\n+ PurchaseJournal.\"\".AssertEquals(Vendor.Name);\n+\n+ // [WHEN] Set Account Type to G/L Account and Account No. to a new G/L Account.\"No.\"\n+ PurchaseJournal.\"Account Type\".SetValue(\"Gen. Journal Account Type\"::\"G/L Account\");\n+ LibraryERM.CreateGLAccount(GLAccount);\n+ PurchaseJournal.\"Account No.\".SetValue(GLAccount.\"No.\");\n+\n+ // [THEN] Verify Vendor Name field should be empty for G/L Account\n+ PurchaseJournal.\"\".AssertEquals('');\n+\n+ // [CLEANUP] Close Purchase Journal page\n+ PurchaseJournal.Close();\n+ end;\n+\n local procedure Initialize()\n begin\n LibrarySetupStorage.Restore();\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Finance/GeneralLedger/Journal/PurchaseJournal.Page.al b/App/Layers/W1/BaseApp/Finance/GeneralLedger/Journal/PurchaseJournal.Page.al\n--- a/App/Layers/W1/BaseApp/Finance/GeneralLedger/Journal/PurchaseJournal.Page.al\n+++ b/App/Layers/W1/BaseApp/Finance/GeneralLedger/Journal/PurchaseJournal.Page.al\n@@ -170,7 +170,7 @@ page 254 \"Purchase Journal\"\n CurrPage.SaveRecord();\n end;\n }\n- field(\"\"; AccName)\n+ field(\"\"; GetVendorName())\n {\n ApplicationArea = Basic, Suite;\n Caption = 'Vendor Name';\n@@ -1661,6 +1661,14 @@ page 254 \"Purchase Journal\"\n NumberOfRecords := Rec.Count();\n end;\n\n+ local procedure GetVendorName(): Text[100]\n+ begin\n+ if (Rec.\"Account Type\" = Rec.\"Account Type\"::Vendor) and (CurrFieldNo = Rec.FieldNo(\"Account No.\")) and (AccName <> '') then\n+ exit(AccName);\n+\n+ exit('');\n+ end;\n+\n local procedure EnableApplyEntriesAction()\n begin\n ApplyEntriesActionEnabled :=\n"} +{"instance_id": "microsoftInternal__NAV-226875__cf-2", "base_instance_id": "microsoftInternal__NAV-226875", "variant_description": "Vendor Name should be populated only when Account Type is Vendor AND Document Type is Invoice", "intervention_type": "Workflow / Business Logic Composition", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-226875__cf-2", "FAIL_TO_PASS": [{"codeunitID": 134920, "functionName": ["VendorNameFieldPopulatesOnlyForVendorAccountType"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/General Journal/ERMGeneralJournalUT.Codeunit.al b/App/Layers/W1/Tests/General Journal/ERMGeneralJournalUT.Codeunit.al\n--- a/App/Layers/W1/Tests/General Journal/ERMGeneralJournalUT.Codeunit.al\n+++ b/App/Layers/W1/Tests/General Journal/ERMGeneralJournalUT.Codeunit.al\n@@ -6000,6 +6000,62 @@ codeunit 134920 \"ERM General Journal UT\"\n GenJournalLine[4].TestField(\"Document No.\", NewDocNo);\n end;\n\n+ [Test]\n+ procedure VendorNameFieldPopulatesOnlyForVendorAccountType()\n+ var\n+ GenJournalBatch: Record \"Gen. Journal Batch\";\n+ GenJournalTemplate: Record \"Gen. Journal Template\";\n+ GLAccount: Record \"G/L Account\";\n+ Vendor: Record Vendor;\n+ PurchaseJournal: TestPage \"Purchase Journal\";\n+ begin\n+ // [SCENARIO 599505] Purchase Journal page validates vendor name field based on account type and document type\n+ Initialize();\n+\n+ // [GIVEN] Create a vendor with random name\n+ LibraryPurchase.CreateVendor(Vendor);\n+ Vendor.Name := LibraryRandom.RandText(20);\n+ Vendor.Modify(true);\n+\n+ // [GIVEN] Create Purchase Journal Template and Batch\n+ LibraryERM.CreateGenJournalBatch(GenJournalBatch, LibraryJournals.SelectGenJournalTemplate(GenJournalTemplate.Type::Purchases, Page::\"Purchase Journal\"));\n+\n+ // [WHEN] Open Purchase Journal page and perform actions\n+ PurchaseJournal.OpenEdit();\n+ PurchaseJournal.CurrentJnlBatchName.SetValue(GenJournalBatch.Name);\n+\n+ // [GIVEN] Set Document Type to Invoice and Document No. to random value\n+ PurchaseJournal.\"Document Type\".SetValue(\"Gen. Journal Document Type\"::Invoice);\n+ PurchaseJournal.\"Document No.\".SetValue(LibraryRandom.RandText(10));\n+\n+ // [GIVEN] Set Account Type to Vendor and Account No. to Vendor.\"No.\"\n+ PurchaseJournal.\"Account Type\".SetValue(\"Gen. Journal Account Type\"::Vendor);\n+ PurchaseJournal.\"Account No.\".SetValue(Vendor.\"No.\");\n+\n+ // [THEN] Verify Vendor Name page field is populated with Vendor.Name\n+ PurchaseJournal.\"\".AssertEquals(Vendor.Name);\n+\n+ // [WHEN] Change Document Type to blank\n+ PurchaseJournal.\"Document Type\".SetValue(\"Gen. Journal Document Type\"::\" \");\n+\n+ // [THEN] Vendor Name should not be populated\n+ PurchaseJournal.\"\".AssertEquals('');\n+\n+ // [WHEN] Set Account Type to G/L Account and Account No. to a new G/L Account.\"No.\"\n+ PurchaseJournal.\"Account Type\".SetValue(\"Gen. Journal Account Type\"::\"G/L Account\");\n+ LibraryERM.CreateGLAccount(GLAccount);\n+ PurchaseJournal.\"Account No.\".SetValue(GLAccount.\"No.\");\n+\n+ // [THEN] Verify Vendor Name field should be empty for G/L Account\n+ PurchaseJournal.\"\".AssertEquals('');\n+\n+ // [CLEANUP] Close Purchase Journal page\n+ PurchaseJournal.Close();\n+ end;\n+\n local procedure Initialize()\n begin\n LibrarySetupStorage.Restore();\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Finance/GeneralLedger/Journal/PurchaseJournal.Page.al b/App/Layers/W1/BaseApp/Finance/GeneralLedger/Journal/PurchaseJournal.Page.al\n--- a/App/Layers/W1/BaseApp/Finance/GeneralLedger/Journal/PurchaseJournal.Page.al\n+++ b/App/Layers/W1/BaseApp/Finance/GeneralLedger/Journal/PurchaseJournal.Page.al\n@@ -170,7 +170,7 @@ page 254 \"Purchase Journal\"\n CurrPage.SaveRecord();\n end;\n }\n- field(\"\"; AccName)\n+ field(\"\"; GetVendorName())\n {\n ApplicationArea = Basic, Suite;\n Caption = 'Vendor Name';\n@@ -1661,6 +1661,14 @@ page 254 \"Purchase Journal\"\n NumberOfRecords := Rec.Count();\n end;\n\n+ local procedure GetVendorName(): Text[100]\n+ begin\n+ if (Rec.\"Account Type\" = Rec.\"Account Type\"::Vendor) and (Rec.\"Document Type\" = Rec.\"Document Type\"::Invoice) and (AccName <> '') then\n+ exit(AccName);\n+\n+ exit('');\n+ end;\n+\n local procedure EnableApplyEntriesAction()\n begin\n ApplyEntriesActionEnabled :=\n"} +{"instance_id": "microsoftInternal__NAV-226223__cf-1", "base_instance_id": "microsoftInternal__NAV-226223", "variant_description": "The adjustment process should skip execution only when triggered via VAT entry iteration events and no VAT entries exist", "intervention_type": "Event-Driven Paradigm", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-226223__cf-1", "FAIL_TO_PASS": [{"codeunitID": 134043, "functionName": ["NoVATEntryAddCurrExchRateAdjust"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/ERMAdditionalCurrency.Codeunit.al b/App/Layers/W1/Tests/ERM/ERMAdditionalCurrency.Codeunit.al\n--- a/App/Layers/W1/Tests/ERM/ERMAdditionalCurrency.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ERMAdditionalCurrency.Codeunit.al\n@@ -1192,6 +1192,40 @@ codeunit 134043 \"ERM Additional Currency\"\n StrSubstNo(AmountLCYError, GenJournalLine.\"Amount (LCY)\"));\n end;\n\n+ [Test]\n+ [HandlerFunctions('StatisticsMessageHandler')]\n+ procedure NoVATEntryAddCurrExchRateAdjust()\n+ var\n+ Currency: Record Currency;\n+ CurrencyExchangeRate: Record \"Currency Exchange Rate\";\n+ GeneralLedgerSetup: Record \"General Ledger Setup\";\n+ VATEntry: Record \"VAT Entry\";\n+ PostingDate: Date;\n+ begin\n+ // [SCENARIO 598998] Exchange Rates Adjustment should skip when triggered via VAT entry iteration and no VAT entries exist\n+ Initialize();\n+ VATEntry.DeleteAll();\n+ LibraryVariableStorage.Enqueue(false); // simulate no event-triggered iteration\n+\n+ // [GIVEN] Currency FCY with exchange rates.\n+ PostingDate := WorkDate();\n+ CreateCurrencyWithExchangeRates(Currency, 1, PostingDate);\n+\n+ // [GIVEN] General Ledger Setup \"Additional Reporting Currency\" = \"FCY\"\n+ LibraryERM.SetAddReportingCurrency(Currency.Code);\n+\n+ // [GIVEN] General Ledger Setup \"VAT Exchange Rate Adjustment\" := Adjust Additional-Currency Amount\n+ UpdateGenLedgerVATExchRateAdjustment(\n+ GeneralLedgerSetup.\"VAT Exchange Rate Adjustment\"::\"Adjust Additional-Currency Amount\");\n+\n+ // [THEN] Run Adjust Exchange Rate with Adjust G/L Account and without other Adjustments\n+ CurrencyExchangeRate.Get(Currency.code, LibraryERM.FindEarliestDateForExhRate());\n+\n+ // [THEN] Report should execute only when event-triggered iteration is active\n+ if LibraryVariableStorage.DequeueBoolean() then\n+ RunAdjustExchangeRates(CurrencyExchangeRate, Currency.Code);\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Finance/Currency/ExchRateAdjmtProcess.Codeunit.al b/App/Layers/W1/BaseApp/Finance/Currency/ExchRateAdjmtProcess.Codeunit.al\n--- a/App/Layers/W1/BaseApp/Finance/Currency/ExchRateAdjmtProcess.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Finance/Currency/ExchRateAdjmtProcess.Codeunit.al\n@@ -308,6 +308,8 @@ codeunit 699 \"Exch. Rate Adjmt. Process\"\n Window.Open(AdjustingVATEntriesTxt + VATEntryProgressBarTxt);\n\n VATEntryNoTotal := VATEntry.Count();\n+ if (VATEntryNoTotal = 0) and IsTriggeredByVATLoop then\n+ exit;\n SetVATEntryFilters(VATEntry, ExchRateAdjmtParameters.\"Start Date\", ExchRateAdjmtParameters.\"End Date\");\n if VATPostingSetup.FindSet() then\n repeat\n"} +{"instance_id": "microsoftInternal__NAV-226223__cf-2", "base_instance_id": "microsoftInternal__NAV-226223", "variant_description": "The adjustment process should skip only when no VAT entries exist and VAT Exchange Rate Adjustment is enabled", "intervention_type": "Workflow / Business Logic Composition", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-226223__cf-2", "FAIL_TO_PASS": [{"codeunitID": 134043, "functionName": ["NoVATEntryAddCurrExchRateAdjust"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/ERMAdditionalCurrency.Codeunit.al b/App/Layers/W1/Tests/ERM/ERMAdditionalCurrency.Codeunit.al\n--- a/App/Layers/W1/Tests/ERM/ERMAdditionalCurrency.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ERMAdditionalCurrency.Codeunit.al\n@@ -1192,6 +1192,44 @@ codeunit 134043 \"ERM Additional Currency\"\n StrSubstNo(AmountLCYError, GenJournalLine.\"Amount (LCY)\"));\n end;\n\n+ [Test]\n+ [HandlerFunctions('StatisticsMessageHandler')]\n+ procedure NoVATEntryAddCurrExchRateAdjust()\n+ var\n+ Currency: Record Currency;\n+ CurrencyExchangeRate: Record \"Currency Exchange Rate\";\n+ GeneralLedgerSetup: Record \"General Ledger Setup\";\n+ VATEntry: Record \"VAT Entry\";\n+ PostingDate: Date;\n+ begin\n+ // [SCENARIO 598998] Exchange Rates Adjustment should skip when no VAT entries exist and VAT Exchange Rate Adjustment is enabled\n+ Initialize();\n+ VATEntry.DeleteAll();\n+\n+ // [GIVEN] Currency FCY with exchange rates.\n+ PostingDate := WorkDate();\n+ CreateCurrencyWithExchangeRates(Currency, 1, PostingDate);\n+\n+ // [GIVEN] General Ledger Setup \"Additional Reporting Currency\" = \"FCY\"\n+ LibraryERM.SetAddReportingCurrency(Currency.Code);\n+\n+ // [GIVEN] General Ledger Setup \"VAT Exchange Rate Adjustment\" := Adjust Additional-Currency Amount\n+ UpdateGenLedgerVATExchRateAdjustment(\n+ GeneralLedgerSetup.\"VAT Exchange Rate Adjustment\"::\"Adjust Additional-Currency Amount\");\n+\n+ // [THEN] Run Adjust Exchange Rate with Adjust G/L Account and without other Adjustments\n+ CurrencyExchangeRate.Get(Currency.code, LibraryERM.FindEarliestDateForExhRate());\n+\n+ // [THEN] Report should executed without any error\n+ RunAdjustExchangeRates(CurrencyExchangeRate, Currency.Code);\n+\n+ // [WHEN] Disable VAT Exchange Rate Adjustment\n+ UpdateGenLedgerVATExchRateAdjustment(\n+ GeneralLedgerSetup.\"VAT Exchange Rate Adjustment\"::\"No Adjustment\");\n+\n+ // [THEN] Process should still run without skipping\n+ RunAdjustExchangeRates(CurrencyExchangeRate, Currency.Code);\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Finance/Currency/ExchRateAdjmtProcess.Codeunit.al b/App/Layers/W1/BaseApp/Finance/Currency/ExchRateAdjmtProcess.Codeunit.al\n--- a/App/Layers/W1/BaseApp/Finance/Currency/ExchRateAdjmtProcess.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Finance/Currency/ExchRateAdjmtProcess.Codeunit.al\n@@ -308,6 +308,8 @@ codeunit 699 \"Exch. Rate Adjmt. Process\"\n Window.Open(AdjustingVATEntriesTxt + VATEntryProgressBarTxt);\n\n VATEntryNoTotal := VATEntry.Count();\n+ if (VATEntryNoTotal = 0) and (ExchRateAdjmtParameters.\"VAT Exchange Rate Adjustment\" <> ExchRateAdjmtParameters.\"VAT Exchange Rate Adjustment\"::\"No Adjustment\") then\n+ exit;\n SetVATEntryFilters(VATEntry, ExchRateAdjmtParameters.\"Start Date\", ExchRateAdjmtParameters.\"End Date\");\n if VATPostingSetup.FindSet() then\n repeat\n"} +{"instance_id": "microsoftInternal__NAV-221877__cf-1", "base_instance_id": "microsoftInternal__NAV-221877", "variant_description": "The service header status should update only when the repair status validation is triggered via OnValidate event", "intervention_type": "Event-Driven Paradigm", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-221877__cf-1", "FAIL_TO_PASS": [{"codeunitID": 136101, "functionName": ["AutoUpdateServiceHeaderStatusOnServiceItemLineAdd"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM-Service/ServiceOrders.Codeunit.al b/App/Layers/W1/Tests/SCM-Service/ServiceOrders.Codeunit.al\n--- a/App/Layers/W1/Tests/SCM-Service/ServiceOrders.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM-Service/ServiceOrders.Codeunit.al\n@@ -122,6 +122,7 @@ codeunit 136101 \"Service Orders\"\n AvailableExpectedQuantityErr: Label 'Available expected quantity must be %1.', Comment = '%1=Value';\n VATCountryRegionLbl: Label 'VAT Country/Region Code must be %1', Comment = '%1 = Country/Region Code';\n ServiceOrderErr: Label 'Service Order does not exist.';\n+ ServiceOrderStatusShouldChangedErr: Label 'Service Header Status should have changed when adding Service Item';\n \n [Test]\n [Scope('OnPrem')]\n@@ -5688,6 +5689,55 @@ codeunit 136101 \"Service Orders\"\n ServiceStatistics.SubForm.\"Amount Including VAT\".AssertEquals(0);\n end;\n \n+ [Test]\n+ [Scope('OnPrem')]\n+ procedure AutoUpdateServiceHeaderStatusOnServiceItemLineAdd()\n+ var\n+ ServiceHeader: Record \"Service Header\";\n+ ServiceItem: Record \"Service Item\";\n+ Customer: Record Customer;\n+ ServiceOrderPage: TestPage \"Service Order\";\n+ InitialStatus: Enum \"Service Document Status\";\n+ FinalStatus: Enum \"Service Document Status\";\n+ begin\n+ // [SCENARIO 582114] Test that Service Header Status changes when repair status validation is triggered on Finished Service Order\n+\n+ // [GIVEN] Initialize and create test data\n+ Initialize();\n+ LibrarySales.CreateCustomer(Customer);\n+ LibraryService.CreateServiceItem(ServiceItem, Customer.\"No.\");\n+\n+ // [GIVEN] Create a Service Order and set status to Finished\n+ LibraryService.CreateServiceHeader(ServiceHeader, ServiceHeader.\"Document Type\"::Order, Customer.\"No.\");\n+ ServiceHeader.Validate(Status, ServiceHeader.Status::Finished);\n+ ServiceHeader.Modify(true);\n+ InitialStatus := ServiceHeader.Status;\n+\n+ // [WHEN] Open Service Order page and add Service Item Line\n+ ServiceOrderPage.OpenEdit();\n+ ServiceOrderPage.Filter.SetFilter(\"No.\", ServiceHeader.\"No.\");\n+\n+ // [THEN] Verify initial status is Finished\n+ ServiceOrderPage.Status.AssertEquals(ServiceHeader.Status::Finished);\n+\n+ // [GIVEN] Add Service Item to the Service Item Lines subform\n+ ServiceOrderPage.ServItemLines.New();\n+ ServiceOrderPage.ServItemLines.ServiceItemNo.SetValue(ServiceItem.\"No.\");\n+ ServiceOrderPage.ServItemLines.\"Repair Status Code\".Activate(); // simulate validation trigger\n+ ServiceOrderPage.ServItemLines.Next(); // Move focus to trigger validation\n+\n+ // [THEN] Verify that Service Header Status has changed automatically\n+ ServiceOrderPage.Status.AssertEquals(ServiceHeader.Status::Pending); // Expected new status based on repair status priority\n+\n+ // [THEN] Verify the change was logged in Service Document Log\n+ ServiceHeader.Get(ServiceHeader.\"Document Type\", ServiceHeader.\"No.\");\n+ FinalStatus := ServiceHeader.Status;\n+\n+ // [THEN] Verify status actually changed\n+ Assert.AreNotEqual(InitialStatus, FinalStatus, ServiceOrderStatusShouldChangedErr);\n+ ServiceOrderPage.Close();\n+ end;\n+\n local procedure CreateServiceDocumentWithResourceWith100PctDisc(\n var ServiceHeader: Record \"Service Header\"; ServiceLine: Record \"Service Line\"; DocumentType: Enum \"Service Document Type\";\n CustomerNo: Code[20]; ResourceNo: Code[20]; Quantity: Decimal; UnitPrice: Decimal)\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Service/Document/ServiceItemLine.Table.al b/App/Layers/W1/BaseApp/Service/Document/ServiceItemLine.Table.al\n--- a/App/Layers/W1/BaseApp/Service/Document/ServiceItemLine.Table.al\n+++ b/App/Layers/W1/BaseApp/Service/Document/ServiceItemLine.Table.al\n@@ -201,6 +201,10 @@ table 5901 \"Service Item Line\"\n UseServItemLineAsxRec := true;\n Modify(true);\n end;\n+\n+ if (CurrFieldNo = FieldNo(\"Repair Status Code\")) and (Rec.\"Repair Status Code\" <> '') then\n+ Validate(\"Repair Status Code\", Rec.\"Repair Status Code\");\n+\n OnAfterValidateServiceItemNoOnBeforeUpdateResponseTimeHours(Rec, xRec);\n UpdateResponseTimeHours();\n CreateDimFromDefaultDim(0);\n"} +{"instance_id": "microsoftInternal__NAV-221877__cf-2", "base_instance_id": "microsoftInternal__NAV-221877", "variant_description": "The service header status should update only when the new line has a Pending repair status", "intervention_type": "Workflow / Business Logic Composition", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-221877__cf-2", "FAIL_TO_PASS": [{"codeunitID": 136101, "functionName": ["AutoUpdateServiceHeaderStatusOnServiceItemLineAdd"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM-Service/ServiceOrders.Codeunit.al b/App/Layers/W1/Tests/SCM-Service/ServiceOrders.Codeunit.al\n--- a/App/Layers/W1/Tests/SCM-Service/ServiceOrders.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM-Service/ServiceOrders.Codeunit.al\n@@ -122,6 +122,7 @@ codeunit 136101 \"Service Orders\"\n AvailableExpectedQuantityErr: Label 'Available expected quantity must be %1.', Comment = '%1=Value';\n VATCountryRegionLbl: Label 'VAT Country/Region Code must be %1', Comment = '%1 = Country/Region Code';\n ServiceOrderErr: Label 'Service Order does not exist.';\n+ ServiceOrderStatusShouldChangedErr: Label 'Service Header Status should have changed when adding Service Item';\n \n [Test]\n [Scope('OnPrem')]\n@@ -5688,6 +5689,56 @@ codeunit 136101 \"Service Orders\"\n ServiceStatistics.SubForm.\"Amount Including VAT\".AssertEquals(0);\n end;\n \n+ [Test]\n+ [Scope('OnPrem')]\n+ procedure AutoUpdateServiceHeaderStatusOnServiceItemLineAdd()\n+ var\n+ ServiceHeader: Record \"Service Header\";\n+ ServiceItem: Record \"Service Item\";\n+ Customer: Record Customer;\n+ RepairStatus: Record \"Repair Status\";\n+ ServiceOrderPage: TestPage \"Service Order\";\n+ InitialStatus: Enum \"Service Document Status\";\n+ FinalStatus: Enum \"Service Document Status\";\n+ begin\n+ // [SCENARIO 582114] Test that Service Header Status changes only when new line has Pending repair status\n+\n+ // [GIVEN] Initialize and create test data\n+ Initialize();\n+ LibrarySales.CreateCustomer(Customer);\n+ LibraryService.CreateServiceItem(ServiceItem, Customer.\"No.\");\n+\n+ // [GIVEN] Create a Service Order and set status to Finished\n+ LibraryService.CreateServiceHeader(ServiceHeader, ServiceHeader.\"Document Type\"::Order, Customer.\"No.\");\n+ ServiceHeader.Validate(Status, ServiceHeader.Status::Finished);\n+ ServiceHeader.Modify(true);\n+ InitialStatus := ServiceHeader.Status;\n+\n+ // [WHEN] Open Service Order page and add Service Item Line with non-pending status\n+ ServiceOrderPage.OpenEdit();\n+ ServiceOrderPage.Filter.SetFilter(\"No.\", ServiceHeader.\"No.\");\n+\n+ // [THEN] Verify initial status is Finished\n+ ServiceOrderPage.Status.AssertEquals(ServiceHeader.Status::Finished);\n+\n+ // [GIVEN] Add Service Item to the Service Item Lines subform\n+ ServiceOrderPage.ServItemLines.New();\n+ ServiceOrderPage.ServItemLines.ServiceItemNo.SetValue(ServiceItem.\"No.\");\n+ ServiceOrderPage.ServItemLines.\"Repair Status Code\".SetValue(''); // non-pending repair status\n+ ServiceOrderPage.ServItemLines.Next();\n+\n+ // [THEN] Verify that Service Header Status has NOT changed (non-pending line should not trigger update)\n+ ServiceOrderPage.Status.AssertEquals(ServiceHeader.Status::Finished);\n+\n+ // [THEN] Verify the status was not modified\n+ ServiceHeader.Get(ServiceHeader.\"Document Type\", ServiceHeader.\"No.\");\n+ FinalStatus := ServiceHeader.Status;\n+\n+ // [THEN] Verify status did not change\n+ Assert.AreEqual(InitialStatus, FinalStatus, ServiceOrderStatusShouldChangedErr);\n+ ServiceOrderPage.Close();\n+ end;\n+\n local procedure CreateServiceDocumentWithResourceWith100PctDisc(\n var ServiceHeader: Record \"Service Header\"; ServiceLine: Record \"Service Line\"; DocumentType: Enum \"Service Document Type\";\n CustomerNo: Code[20]; ResourceNo: Code[20]; Quantity: Decimal; UnitPrice: Decimal)\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Service/Document/ServiceItemLine.Table.al b/App/Layers/W1/BaseApp/Service/Document/ServiceItemLine.Table.al\n--- a/App/Layers/W1/BaseApp/Service/Document/ServiceItemLine.Table.al\n+++ b/App/Layers/W1/BaseApp/Service/Document/ServiceItemLine.Table.al\n@@ -201,6 +201,10 @@ table 5901 \"Service Item Line\"\n UseServItemLineAsxRec := true;\n Modify(true);\n end;\n+\n+ if Rec.\"Repair Status Code\" = 'PENDING' then\n+ Validate(\"Repair Status Code\", Rec.\"Repair Status Code\");\n+\n OnAfterValidateServiceItemNoOnBeforeUpdateResponseTimeHours(Rec, xRec);\n UpdateResponseTimeHours();\n CreateDimFromDefaultDim(0);\n"} +{"instance_id": "microsoftInternal__NAV-221877__cf-3", "base_instance_id": "microsoftInternal__NAV-221877", "variant_description": "The service header status should update only after the service item line is committed (Modify)", "intervention_type": "Execution / Validation Semantics", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-221877__cf-3", "FAIL_TO_PASS": [{"codeunitID": 136101, "functionName": ["AutoUpdateServiceHeaderStatusOnServiceItemLineAdd"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM-Service/ServiceOrders.Codeunit.al b/App/Layers/W1/Tests/SCM-Service/ServiceOrders.Codeunit.al\n--- a/App/Layers/W1/Tests/SCM-Service/ServiceOrders.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM-Service/ServiceOrders.Codeunit.al\n@@ -122,6 +122,7 @@ codeunit 136101 \"Service Orders\"\n AvailableExpectedQuantityErr: Label 'Available expected quantity must be %1.', Comment = '%1=Value';\n VATCountryRegionLbl: Label 'VAT Country/Region Code must be %1', Comment = '%1 = Country/Region Code';\n ServiceOrderErr: Label 'Service Order does not exist.';\n+ ServiceOrderStatusShouldChangedErr: Label 'Service Header Status should have changed when adding Service Item';\n \n [Test]\n [Scope('OnPrem')]\n@@ -5688,6 +5689,55 @@ codeunit 136101 \"Service Orders\"\n ServiceStatistics.SubForm.\"Amount Including VAT\".AssertEquals(0);\n end;\n \n+ [Test]\n+ [Scope('OnPrem')]\n+ procedure AutoUpdateServiceHeaderStatusOnServiceItemLineAdd()\n+ var\n+ ServiceHeader: Record \"Service Header\";\n+ ServiceItem: Record \"Service Item\";\n+ Customer: Record Customer;\n+ ServiceOrderPage: TestPage \"Service Order\";\n+ InitialStatus: Enum \"Service Document Status\";\n+ FinalStatus: Enum \"Service Document Status\";\n+ begin\n+ // [SCENARIO 582114] Test that Service Header Status changes after commit when adding Service Item to Finished Service Order\n+\n+ // [GIVEN] Initialize and create test data\n+ Initialize();\n+ LibrarySales.CreateCustomer(Customer);\n+ LibraryService.CreateServiceItem(ServiceItem, Customer.\"No.\");\n+\n+ // [GIVEN] Create a Service Order and set status to Finished\n+ LibraryService.CreateServiceHeader(ServiceHeader, ServiceHeader.\"Document Type\"::Order, Customer.\"No.\");\n+ ServiceHeader.Validate(Status, ServiceHeader.Status::Finished);\n+ ServiceHeader.Modify(true);\n+ InitialStatus := ServiceHeader.Status;\n+\n+ // [WHEN] Open Service Order page and add Service Item Line\n+ ServiceOrderPage.OpenEdit();\n+ ServiceOrderPage.Filter.SetFilter(\"No.\", ServiceHeader.\"No.\");\n+\n+ // [THEN] Verify initial status is Finished\n+ ServiceOrderPage.Status.AssertEquals(ServiceHeader.Status::Finished);\n+\n+ // [GIVEN] Add Service Item to the Service Item Lines subform\n+ ServiceOrderPage.ServItemLines.New();\n+ ServiceOrderPage.ServItemLines.ServiceItemNo.SetValue(ServiceItem.\"No.\");\n+ ServiceOrderPage.ServItemLines.Next(); // Move focus\n+ ServiceOrderPage.SaveRecord(); // ensure commit\n+\n+ // [THEN] Verify that Service Header Status has changed automatically\n+ ServiceOrderPage.Status.AssertEquals(ServiceHeader.Status::Pending); // Expected new status based on repair status priority\n+\n+ // [THEN] Verify the change was logged in Service Document Log\n+ ServiceHeader.Get(ServiceHeader.\"Document Type\", ServiceHeader.\"No.\");\n+ FinalStatus := ServiceHeader.Status;\n+\n+ // [THEN] Verify status actually changed\n+ Assert.AreNotEqual(InitialStatus, FinalStatus, ServiceOrderStatusShouldChangedErr);\n+ ServiceOrderPage.Close();\n+ end;\n+\n local procedure CreateServiceDocumentWithResourceWith100PctDisc(\n var ServiceHeader: Record \"Service Header\"; ServiceLine: Record \"Service Line\"; DocumentType: Enum \"Service Document Type\";\n CustomerNo: Code[20]; ResourceNo: Code[20]; Quantity: Decimal; UnitPrice: Decimal)\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Service/Document/ServiceItemLine.Table.al b/App/Layers/W1/BaseApp/Service/Document/ServiceItemLine.Table.al\n--- a/App/Layers/W1/BaseApp/Service/Document/ServiceItemLine.Table.al\n+++ b/App/Layers/W1/BaseApp/Service/Document/ServiceItemLine.Table.al\n@@ -201,6 +201,11 @@ table 5901 \"Service Item Line\"\n UseServItemLineAsxRec := true;\n Modify(true);\n end;\n+\n+ if Rec.\"Repair Status Code\" <> '' then begin\n+ Validate(\"Repair Status Code\", Rec.\"Repair Status Code\");\n+ Modify(true);\n+ end;\n+\n OnAfterValidateServiceItemNoOnBeforeUpdateResponseTimeHours(Rec, xRec);\n UpdateResponseTimeHours();\n CreateDimFromDefaultDim(0);\n"} +{"instance_id": "microsoftInternal__NAV-221877__cf-4", "base_instance_id": "microsoftInternal__NAV-221877", "variant_description": "The service header status should update only for Service Orders, not for other service document types", "intervention_type": "Toolchain / Ecosystem Constraint", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-221877__cf-4", "FAIL_TO_PASS": [{"codeunitID": 136101, "functionName": ["AutoUpdateServiceHeaderStatusOnServiceItemLineAdd"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM-Service/ServiceOrders.Codeunit.al b/App/Layers/W1/Tests/SCM-Service/ServiceOrders.Codeunit.al\n--- a/App/Layers/W1/Tests/SCM-Service/ServiceOrders.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM-Service/ServiceOrders.Codeunit.al\n@@ -122,6 +122,7 @@ codeunit 136101 \"Service Orders\"\n AvailableExpectedQuantityErr: Label 'Available expected quantity must be %1.', Comment = '%1=Value';\n VATCountryRegionLbl: Label 'VAT Country/Region Code must be %1', Comment = '%1 = Country/Region Code';\n ServiceOrderErr: Label 'Service Order does not exist.';\n+ ServiceOrderStatusShouldChangedErr: Label 'Service Header Status should have changed when adding Service Item';\n \n [Test]\n [Scope('OnPrem')]\n@@ -5688,6 +5689,56 @@ codeunit 136101 \"Service Orders\"\n ServiceStatistics.SubForm.\"Amount Including VAT\".AssertEquals(0);\n end;\n \n+ [Test]\n+ [Scope('OnPrem')]\n+ procedure AutoUpdateServiceHeaderStatusOnServiceItemLineAdd()\n+ var\n+ ServiceHeader: Record \"Service Header\";\n+ ServiceItem: Record \"Service Item\";\n+ Customer: Record Customer;\n+ ServiceOrderPage: TestPage \"Service Order\";\n+ InitialStatus: Enum \"Service Document Status\";\n+ FinalStatus: Enum \"Service Document Status\";\n+ begin\n+ // [SCENARIO 582114] Test that Service Header Status does NOT change for Quote document type\n+\n+ // [GIVEN] Initialize and create test data\n+ Initialize();\n+ LibrarySales.CreateCustomer(Customer);\n+ LibraryService.CreateServiceItem(ServiceItem, Customer.\"No.\");\n+\n+ // [GIVEN] Create a Service Quote (not Order) and set status to Finished\n+ LibraryService.CreateServiceHeader(ServiceHeader, ServiceHeader.\"Document Type\"::Quote, Customer.\"No.\");\n+ ServiceHeader.Validate(Status, ServiceHeader.Status::Finished);\n+ ServiceHeader.Modify(true);\n+ InitialStatus := ServiceHeader.Status;\n+\n+ // [WHEN] Open Service Order page and add Service Item Line\n+ ServiceOrderPage.OpenEdit();\n+ ServiceOrderPage.Filter.SetFilter(\"No.\", ServiceHeader.\"No.\");\n+\n+ // [THEN] Verify initial status is Finished\n+ ServiceOrderPage.Status.AssertEquals(ServiceHeader.Status::Finished);\n+\n+ // [GIVEN] Add Service Item to the Service Item Lines subform\n+ ServiceOrderPage.ServItemLines.New();\n+ ServiceOrderPage.ServItemLines.ServiceItemNo.SetValue(ServiceItem.\"No.\");\n+ ServiceOrderPage.ServItemLines.Next(); // Move focus to trigger validation\n+\n+ // [THEN] Verify that Service Header Status has NOT changed (Quote type should not trigger update)\n+ ServiceOrderPage.Status.AssertEquals(ServiceHeader.Status::Finished);\n+\n+ // [THEN] Verify the status was not modified\n+ ServiceHeader.Get(ServiceHeader.\"Document Type\", ServiceHeader.\"No.\");\n+ FinalStatus := ServiceHeader.Status;\n+\n+ // [THEN] Verify status did not change\n+ Assert.AreEqual(InitialStatus, FinalStatus, ServiceOrderStatusShouldChangedErr);\n+ ServiceOrderPage.Close();\n+ end;\n+\n local procedure CreateServiceDocumentWithResourceWith100PctDisc(\n var ServiceHeader: Record \"Service Header\"; ServiceLine: Record \"Service Line\"; DocumentType: Enum \"Service Document Type\";\n CustomerNo: Code[20]; ResourceNo: Code[20]; Quantity: Decimal; UnitPrice: Decimal)\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Service/Document/ServiceItemLine.Table.al b/App/Layers/W1/BaseApp/Service/Document/ServiceItemLine.Table.al\n--- a/App/Layers/W1/BaseApp/Service/Document/ServiceItemLine.Table.al\n+++ b/App/Layers/W1/BaseApp/Service/Document/ServiceItemLine.Table.al\n@@ -201,6 +201,10 @@ table 5901 \"Service Item Line\"\n UseServItemLineAsxRec := true;\n Modify(true);\n end;\n+\n+ if (Rec.\"Document Type\" = Rec.\"Document Type\"::Order) and (Rec.\"Repair Status Code\" <> '') then\n+ Validate(\"Repair Status Code\", Rec.\"Repair Status Code\");\n+\n OnAfterValidateServiceItemNoOnBeforeUpdateResponseTimeHours(Rec, xRec);\n UpdateResponseTimeHours();\n CreateDimFromDefaultDim(0);\n"} +{"instance_id": "microsoftInternal__NAV-219082__cf-1", "base_instance_id": "microsoftInternal__NAV-219082", "variant_description": "The print operation should succeed only when the transaction is committed regardless of GUI mode", "intervention_type": "Execution / Validation Semantics", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-219082__cf-1", "FAIL_TO_PASS": [{"codeunitID": 136101, "functionName": ["PrintServiceOrderWithWorkDescription"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM-Service/ServiceOrders.Codeunit.al b/App/Layers/W1/Tests/SCM-Service/ServiceOrders.Codeunit.al\n--- a/App/Layers/W1/Tests/SCM-Service/ServiceOrders.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM-Service/ServiceOrders.Codeunit.al\n@@ -17,6 +17,7 @@ using Microsoft.Finance.VAT.Setup;\n using Microsoft.Foundation.Address;\n using Microsoft.Foundation.ExtendedText;\n using Microsoft.Foundation.NoSeries;\n+using Microsoft.Foundation.Reporting;\n using Microsoft.Foundation.Shipping;\n using Microsoft.Foundation.UOM;\n using Microsoft.Inventory.Item;\n@@ -5620,6 +5621,40 @@ codeunit 136101 \"Service Orders\"\n Assert.AreEqual(Customer[2].\"Country/Region Code\", ServiceHeader.\"VAT Country/Region Code\", VATCountryRegionLbl);\n end;\n \n+ [Test]\n+ [HandlerFunctions('ServiceOrderReportRequestPageHandler')]\n+ procedure PrintServiceOrderWithWorkDescription()\n+ var\n+ Item: Record Item;\n+ ServiceHeader: Record \"Service Header\";\n+ ServiceItem: Record \"Service Item\";\n+ ServiceItemLine: Record \"Service Item Line\";\n+ ServiceLine: Record \"Service Line\";\n+ ServiceOrder: TestPage \"Service Order\";\n+ begin\n+ // [SCENARIO 575369] Verify Printing Service Order with Work Description does not throw error.\n+ Initialize();\n+\n+ // [GIVEN] Create Item\n+ LibraryInventory.CreateItem(Item);\n+\n+ // [GIVEN] Create Service Order with Work Description\n+ LibraryService.CreateServiceItem(ServiceItem, LibrarySales.CreateCustomerNo());\n+ LibraryService.CreateServiceHeader(ServiceHeader, ServiceHeader.\"Document Type\"::Order, ServiceItem.\"Customer No.\");\n+ LibraryService.CreateServiceItemLine(ServiceItemLine, ServiceHeader, ServiceItem.\"No.\");\n+ LibraryService.CreateServiceLine(ServiceLine, ServiceHeader, ServiceLine.Type::Item, Item.\"No.\");\n+\n+ // [WHEN] Open Service Order Card and click Print\n+ CreateCustomReportSelectionForCustomer(ServiceHeader.\"Customer No.\", \"Report Selection Usage\"::\"SM.Order\", 5900);\n+ ServiceOrder.OpenEdit();\n+ ServiceOrder.GotoRecord(ServiceHeader);\n+ ServiceOrder.WorkDescription.SetValue(LibraryRandom.RandText(20));\n+ ServiceOrder.SaveRecord(); // enforce commit before print\n+ ServiceOrder.\"&Print\".Invoke();\n+\n+ // [THEN] Verify no transaction error should occur.\n+ end;\n+\n [ConfirmHandler]\n [Scope('OnPrem')]\n procedure ConfirmHandlerTRUE(Question: Text[1024]; var Reply: Boolean)\n@@ -7923,6 +7957,23 @@ codeunit 136101 \"Service Orders\"\n exit(ServiceInvoiceHeader.\"No.\");\n end;\n \n+ local procedure CreateCustomReportSelectionForCustomer(CustomerNo: Code[20]; ReportSelectionUsage: Enum \"Report Selection Usage\"; ReportID: Integer)\n+ var\n+ CustomReportSelection: Record \"Custom Report Selection\";\n+ CustomReportLayout: Record \"Custom Report Layout\";\n+ begin\n+ CustomReportSelection.Init();\n+ CustomReportSelection.Validate(\"Source Type\", Database::Customer);\n+ CustomReportSelection.Validate(\"Source No.\", CustomerNo);\n+ CustomReportSelection.Validate(Usage, ReportSelectionUsage);\n+ CustomReportSelection.Validate(Sequence, 1);\n+ CustomReportSelection.Validate(\"Report ID\", ReportID);\n+ CustomReportSelection.Validate(\"Use for Email Body\", true);\n+ CustomReportSelection.Validate(\n+ \"Email Body Layout Code\", CustomReportLayout.InitBuiltInLayout(CustomReportSelection.\"Report ID\", CustomReportLayout.Type::Word.AsInteger()));\n+ CustomReportSelection.Insert(true);\n+ end;\n+\n [ConfirmHandler]\n [Scope('OnPrem')]\n procedure ConfirmMessageHandler(Question: Text[1024]; var Reply: Boolean)\n@@ -8256,5 +8307,11 @@ codeunit 136101 \"Service Orders\"\n LibraryVariableStorage.Enqueue(CreditLimitNotification.CreditLimitDetails.OutstandingAmtLCY.Value);\n LibraryVariableStorage.Enqueue(CreditLimitNotification.CreditLimitDetails.TotalAmountLCY.Value);\n end;\n+\n+ [RequestPageHandler]\n+ procedure ServiceOrderReportRequestPageHandler(var ServiceOrder: TestRequestPage \"Service Order\")\n+ begin\n+ ServiceOrder.Cancel().Invoke();\n+ end;\n }\n \n", "patch": "diff --git a/App/Layers/W1/BaseApp/Foundation/Reporting/ReportSelections.Table.al b/App/Layers/W1/BaseApp/Foundation/Reporting/ReportSelections.Table.al\n--- a/App/Layers/W1/BaseApp/Foundation/Reporting/ReportSelections.Table.al\n+++ b/App/Layers/W1/BaseApp/Foundation/Reporting/ReportSelections.Table.al\n@@ -582,8 +582,10 @@ table 77 \"Report Selections\"\n \n IsHandled := false;\n OnBeforePrintDocument(TempReportSelections, IsGUI, RecVarToPrint, IsHandled);\n- if not IsHandled then\n+ if not IsHandled then begin\n+ Commit();\n REPORT.RunModal(TempReportSelections.\"Report ID\", IsGUI, false, RecVarToPrint);\n+ end;\n \n OnAfterPrintDocument(TempReportSelections, IsGUI, RecVarToPrint, IsHandled);\n \n"} +{"instance_id": "microsoftInternal__NAV-219082__cf-2", "base_instance_id": "microsoftInternal__NAV-219082", "variant_description": "The print operation should only be allowed from the Service Order List page, not from the Card page", "intervention_type": "Toolchain / Ecosystem Constraint", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-219082__cf-2", "FAIL_TO_PASS": [{"codeunitID": 136101, "functionName": ["PrintServiceOrderWithWorkDescription"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM-Service/ServiceOrders.Codeunit.al b/App/Layers/W1/Tests/SCM-Service/ServiceOrders.Codeunit.al\n--- a/App/Layers/W1/Tests/SCM-Service/ServiceOrders.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM-Service/ServiceOrders.Codeunit.al\n@@ -17,6 +17,7 @@ using Microsoft.Finance.VAT.Setup;\n using Microsoft.Foundation.Address;\n using Microsoft.Foundation.ExtendedText;\n using Microsoft.Foundation.NoSeries;\n+using Microsoft.Foundation.Reporting;\n using Microsoft.Foundation.Shipping;\n using Microsoft.Foundation.UOM;\n using Microsoft.Inventory.Item;\n@@ -5620,6 +5621,38 @@ codeunit 136101 \"Service Orders\"\n Assert.AreEqual(Customer[2].\"Country/Region Code\", ServiceHeader.\"VAT Country/Region Code\", VATCountryRegionLbl);\n end;\n \n+ [Test]\n+ [HandlerFunctions('ServiceOrderReportRequestPageHandler')]\n+ procedure PrintServiceOrderWithWorkDescription()\n+ var\n+ Item: Record Item;\n+ ServiceHeader: Record \"Service Header\";\n+ ServiceItem: Record \"Service Item\";\n+ ServiceItemLine: Record \"Service Item Line\";\n+ ServiceLine: Record \"Service Line\";\n+ ServiceOrder: TestPage \"Service Order\";\n+ begin\n+ // [SCENARIO 575369] Verify Printing Service Order with Work Description does not throw error.\n+ Initialize();\n+\n+ // [GIVEN] Create Item\n+ LibraryInventory.CreateItem(Item);\n+\n+ // [GIVEN] Create Service Order with Work Description\n+ LibraryService.CreateServiceItem(ServiceItem, LibrarySales.CreateCustomerNo());\n+ LibraryService.CreateServiceHeader(ServiceHeader, ServiceHeader.\"Document Type\"::Order, ServiceItem.\"Customer No.\");\n+ LibraryService.CreateServiceItemLine(ServiceItemLine, ServiceHeader, ServiceItem.\"No.\");\n+ LibraryService.CreateServiceLine(ServiceLine, ServiceHeader, ServiceLine.Type::Item, Item.\"No.\");\n+\n+ // [WHEN] Open Service Order Card and click Print\n+ CreateCustomReportSelectionForCustomer(ServiceHeader.\"Customer No.\", \"Report Selection Usage\"::\"SM.Order\", 5900);\n+ // simulate list page context instead of card page\n+ ServiceOrder.OpenView();\n+ ServiceOrder.\"&Print\".Invoke();\n+\n+ // [THEN] Verify no transaction error should occur.\n+ end;\n+\n [ConfirmHandler]\n [Scope('OnPrem')]\n procedure ConfirmHandlerTRUE(Question: Text[1024]; var Reply: Boolean)\n@@ -7923,6 +7957,23 @@ codeunit 136101 \"Service Orders\"\n exit(ServiceInvoiceHeader.\"No.\");\n end;\n \n+ local procedure CreateCustomReportSelectionForCustomer(CustomerNo: Code[20]; ReportSelectionUsage: Enum \"Report Selection Usage\"; ReportID: Integer)\n+ var\n+ CustomReportSelection: Record \"Custom Report Selection\";\n+ CustomReportLayout: Record \"Custom Report Layout\";\n+ begin\n+ CustomReportSelection.Init();\n+ CustomReportSelection.Validate(\"Source Type\", Database::Customer);\n+ CustomReportSelection.Validate(\"Source No.\", CustomerNo);\n+ CustomReportSelection.Validate(Usage, ReportSelectionUsage);\n+ CustomReportSelection.Validate(Sequence, 1);\n+ CustomReportSelection.Validate(\"Report ID\", ReportID);\n+ CustomReportSelection.Validate(\"Use for Email Body\", true);\n+ CustomReportSelection.Validate(\n+ \"Email Body Layout Code\", CustomReportLayout.InitBuiltInLayout(CustomReportSelection.\"Report ID\", CustomReportLayout.Type::Word.AsInteger()));\n+ CustomReportSelection.Insert(true);\n+ end;\n+\n [ConfirmHandler]\n [Scope('OnPrem')]\n procedure ConfirmMessageHandler(Question: Text[1024]; var Reply: Boolean)\n@@ -8256,5 +8307,11 @@ codeunit 136101 \"Service Orders\"\n LibraryVariableStorage.Enqueue(CreditLimitNotification.CreditLimitDetails.OutstandingAmtLCY.Value);\n LibraryVariableStorage.Enqueue(CreditLimitNotification.CreditLimitDetails.TotalAmountLCY.Value);\n end;\n+\n+ [RequestPageHandler]\n+ procedure ServiceOrderReportRequestPageHandler(var ServiceOrder: TestRequestPage \"Service Order\")\n+ begin\n+ ServiceOrder.Cancel().Invoke();\n+ end;\n }\n \n", "patch": "diff --git a/App/Layers/W1/BaseApp/Foundation/Reporting/ReportSelections.Table.al b/App/Layers/W1/BaseApp/Foundation/Reporting/ReportSelections.Table.al\n--- a/App/Layers/W1/BaseApp/Foundation/Reporting/ReportSelections.Table.al\n+++ b/App/Layers/W1/BaseApp/Foundation/Reporting/ReportSelections.Table.al\n@@ -582,8 +582,11 @@ table 77 \"Report Selections\"\n \n IsHandled := false;\n OnBeforePrintDocument(TempReportSelections, IsGUI, RecVarToPrint, IsHandled);\n- if not IsHandled then\n+ if not IsHandled and IsListPageContext then begin\n+ if IsGUI then\n+ Commit();\n REPORT.RunModal(TempReportSelections.\"Report ID\", IsGUI, false, RecVarToPrint);\n+ end;\n \n OnAfterPrintDocument(TempReportSelections, IsGUI, RecVarToPrint, IsHandled);\n \n"} +{"instance_id": "microsoftInternal__NAV-216918__cf-1", "base_instance_id": "microsoftInternal__NAV-216918", "variant_description": "Non-deductible VAT should only be added to Job Journal Line when the Job currency code is defined (non-empty)", "intervention_type": "Execution / Validation Semantics", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-216918__cf-1", "FAIL_TO_PASS": [{"codeunitID": 134284, "functionName": ["JobJnlLineWithNonDeductNormalVATInFCYFromGenJnlLine"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/VAT/NonDedVATMisc.Codeunit.al b/App/Layers/W1/Tests/VAT/NonDedVATMisc.Codeunit.al\n--- a/App/Layers/W1/Tests/VAT/NonDedVATMisc.Codeunit.al\n+++ b/App/Layers/W1/Tests/VAT/NonDedVATMisc.Codeunit.al\n@@ -1135,6 +1135,51 @@ codeunit 134284 \"Non Ded. VAT Misc.\"\n Assert.RecordIsNotEmpty(GLEntry);\n end;\n \n+ [Test]\n+ [Scope('OnPrem')]\n+ procedure JobJnlLineWithNonDeductNormalVATInFCYFromGenJnlLine()\n+ var\n+ Customer: Record Customer;\n+ Job: Record Job;\n+ JobTask: Record \"Job Task\";\n+ VATPostingSetup: Record \"VAT Posting Setup\";\n+ GenJnlLine: Record \"Gen. Journal Line\";\n+ JobJnlLine: Record \"Job Journal Line\";\n+ JobTransferLine: Codeunit \"Job Transfer Line\";\n+ DeductiblePercent: Decimal;\n+ begin\n+ // [FEATURE] [Normal VAT] [UT]\n+ // [SCENARIO 575793] Job journal line with FCY built from the general journal line includes non deductible VAT in \"Unit Cost\"\n+ Initialize();\n+ LibraryNonDeductibleVAT.SetUseForJobCost();\n+ // [GIVEN] VAT Posting Setup, where \"Tax Calculation Type\"::\"Normal VAT\", 'Deductible %' is '60'\n+ DeductiblePercent := LibraryRandom.RandInt(90);\n+ CreateNonDeductibleVATPostingSetup(VATPostingSetup, \"Tax Calculation Type\"::\"Normal VAT\", '', DeductiblePercent);\n+ // [GIVEN] Job \"X\" with currency which factor is 0.5\n+ LibrarySales.CreateCustomer(Customer);\n+ LibraryJob.CreateJob(Job, Customer.\"No.\");\n+ Job.Validate(\"Currency Code\", ''); // no currency\n+ Job.Modify(true);\n+ LibraryJob.CreateJobTask(Job, JobTask);\n+ // [GIVEN] General journal line where line contains \"Non-Deductible VAT Amount\" = 100, \"Job No.\" = \"X\" \"Job Line Type\" = 'Billable'\n+ // [GIVEN] \"Job Quantity\" = 2, \"Job Unit Cost\" = 50\n+ CreateJobGLJournalLine(GenJnlLine, JobTask, VATPostingSetup);\n+\n+ // [WHEN] Run FromGenJnlLineToJnlLine\n+ JobTransferLine.FromGenJnlLineToJnlLine(GenJnlLine, JobJnlLine);\n+\n+ // [THEN] JobJnlLine should NOT include Non-Deductible VAT when no job currency\n+ Assert.AreEqual(\n+ Round(JobJnlLine.\"Unit Cost (LCY)\"),\n+ Round(GenJnlLine.\"Job Total Cost (LCY)\" / GenJnlLine.\"Job Quantity\"),\n+ 'Unit Cost (LCY) should not include Non-Deductible VAT when Job has no currency');\n+ // [THEN] JobJnlLine contains \"Total Unit Cost\" = (\"Job Unit Cost\" + \"Non-Deductible VAT Amount\") * \"Currency Factor\" = (50 + 100) * 0.5 = 75\n+ Assert.AreEqual(\n+ Round(JobJnlLine.\"Total Cost (LCY)\"),\n+ Round(GenJnlLine.\"Job Total Cost (LCY)\"),\n+ 'Total Cost (LCY) should not include Non-Deductible VAT when Job has no currency');\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n@@ -1368,6 +1414,15 @@ codeunit 134284 \"Non Ded. VAT Misc.\"\n GenJournalLine.Modify(true);\n end;\n \n+ local procedure CreateJobGLJournalLine(var GenJournalLine: Record \"Gen. Journal Line\"; JobTask: Record \"Job Task\"; VATPostingSetup: Record \"VAT Posting Setup\")\n+ begin\n+ LibraryJob.CreateJobGLJournalLine(GenJournalLine.\"Job Line Type\"::Billable, JobTask, GenJournalLine);\n+ GenJournalLine.Validate(\"Gen. Posting Type\", GenJournalLine.\"Gen. Posting Type\"::Purchase);\n+ GenJournalLine.Validate(\"VAT Bus. Posting Group\", VATPostingSetup.\"VAT Bus. Posting Group\");\n+ GenJournalLine.Validate(\"VAT Prod. Posting Group\", VATPostingSetup.\"VAT Prod. Posting Group\");\n+ GenJournalLine.Modify(true);\n+ end;\n+\n local procedure FindFAPostingGroup(GenProdPostingGroup: Code[20]; VATProductPostingGroup: Code[20]): Code[20]\n var\n FAPostingGroup: Record \"FA Posting Group\";\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Finance/GeneralLedger/Journal/GenJournalLine.Table.al b/App/Layers/W1/BaseApp/Finance/GeneralLedger/Journal/GenJournalLine.Table.al\n--- a/App/Layers/W1/BaseApp/Finance/GeneralLedger/Journal/GenJournalLine.Table.al\n+++ b/App/Layers/W1/BaseApp/Finance/GeneralLedger/Journal/GenJournalLine.Table.al\n@@ -4937,16 +4937,7 @@ table 81 \"Gen. Journal Line\"\n TempJobJnlLine.Validate(\"No.\", \"Account No.\");\n TempJobJnlLine.Validate(Quantity, \"Job Quantity\");\n \n- if \"Currency Factor\" = 0 then begin\n- if \"Job Currency Factor\" = 0 then\n- TmpJobJnlOverallCurrencyFactor := 1\n- else\n- TmpJobJnlOverallCurrencyFactor := \"Job Currency Factor\";\n- end else\n- if \"Job Currency Factor\" = 0 then\n- TmpJobJnlOverallCurrencyFactor := 1 / \"Currency Factor\"\n- else\n- TmpJobJnlOverallCurrencyFactor := \"Job Currency Factor\" / \"Currency Factor\";\n+ TmpJobJnlOverallCurrencyFactor := GetGenJnlLineToJobCurrencyFactor();\n \n UpdateAmountsOnTempJobJnlLine(TmpJobJnlOverallCurrencyFactor);\n \n@@ -7628,6 +7619,22 @@ table 81 \"Gen. Journal Line\"\n RecordRestrictionMgt.RestrictRecordUsage(GenJournalLine, RestrictBatchUsageDetailsTxt);\n end;\n \n+ /// \n+ /// Calculates the currency factor for the general journal line based on the job currency factor and the journal line currency factor.\n+ /// \n+ /// Resulted currency factor\n+ procedure GetGenJnlLineToJobCurrencyFactor(): Decimal\n+ begin\n+ if \"Currency Factor\" = 0 then begin\n+ if \"Job Currency Factor\" = 0 then\n+ exit(1);\n+ exit(\"Job Currency Factor\");\n+ end;\n+ if \"Job Currency Factor\" = 0 then\n+ exit(1 / \"Currency Factor\");\n+ exit(\"Job Currency Factor\" / \"Currency Factor\");\n+ end;\n+\n /// \n /// Event triggered before creating dimensions from the Default Dimensions during the validation of the \"Account No.\" field.\n /// By subscribing to this event, developers can override the default dimension creation process for the \"Account No.\" field.\ndiff --git a/App/Layers/W1/BaseApp/Finance/VAT/Calculation/NonDedVATImpl.Codeunit.al b/App/Layers/W1/BaseApp/Finance/VAT/Calculation/NonDedVATImpl.Codeunit.al\n--- a/App/Layers/W1/BaseApp/Finance/VAT/Calculation/NonDedVATImpl.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Finance/VAT/Calculation/NonDedVATImpl.Codeunit.al\n@@ -17,6 +17,8 @@ using Microsoft.Foundation.Enums;\n using Microsoft.Purchases.Document;\n using Microsoft.Purchases.History;\n using Microsoft.Foundation.Company;\n+using Microsoft.Projects.Project.Journal;\n+using Microsoft.Projects.Project.Job;\n \n /// \n /// Defines the implementation of Non-Deductible VAT\n@@ -436,6 +438,38 @@ codeunit 6201 \"Non-Ded. VAT Impl.\"\n FALedgEntry.\"Non-Ded. VAT FA Cost\" := GenJnlLine.\"Non-Ded. VAT FA Cost\";\n end;\n \n+ procedure CopyNonDedVATFromGenJnlLineToJobJnlLine(var JobJnlLine: Record \"Job Journal Line\"; GenJnlLine: Record \"Gen. Journal Line\")\n+ var\n+ Job: Record Job;\n+ CurrencyFactor, NonDedVATAmountLCY, UnitCost, UnitCostLCY, TotalCost, TotalCostLCY : Decimal;\n+ begin\n+ if not UseNonDeductibleVATAmountForJobCost() then\n+ exit;\n+ if not Job.Get(JobJnlLine.\"Job No.\") then\n+ exit;\n+ if Job.\"Currency Code\" = '' then\n+ exit;\n+ NonDedVATAmountLCY := GenJnlLine.\"Non-Deductible VAT Amount LCY\";\n+ if GenJnlLine.\"Currency Code\" <> Job.\"Currency Code\" then begin\n+ CurrencyFactor := GenJnlLine.GetGenJnlLineToJobCurrencyFactor();\n+ NonDedVATAmountLCY := Round(GenJnlLine.\"Non-Deductible VAT Amount\" * CurrencyFactor);\n+ end;\n+ UnitCostLCY := Round(NonDedVATAmountLCY / JobJnlLine.Quantity);\n+ UnitCost := Round(GenJnlLine.\"Non-Deductible VAT Amount\" / JobJnlLine.Quantity);\n+ TotalCostLCY := NonDedVATAmountLCY;\n+ TotalCost := GenJnlLine.\"Non-Deductible VAT Amount\";\n+ if JobJnlLine.\"Unit Cost\" > 0 then begin\n+ UnitCostLCY := Abs(UnitCostLCY);\n+ UnitCost := Abs(UnitCost);\n+ TotalCostLCY := Abs(TotalCostLCY);\n+ TotalCost := Abs(TotalCost);\n+ end;\n+ JobJnlLine.\"Unit Cost (LCY)\" += UnitCostLCY;\n+ JobJnlLine.\"Unit Cost\" += UnitCost;\n+ JobJnlLine.\"Total Cost (LCY)\" += TotalCostLCY;\n+ JobJnlLine.\"Total Cost\" += TotalCost;\n+ end;\n+\n procedure CheckPrepmtWithNonDeductubleVATInPurchaseLine(PurchaseLine: Record \"Purchase Line\")\n begin\n if (PurchaseLine.\"Prepayment %\" <> 0) and (PurchaseLine.\"Non-Deductible VAT %\" <> 0) then\ndiff --git a/App/Layers/W1/BaseApp/Finance/VAT/Calculation/NonDeductibleVAT.Codeunit.al b/App/Layers/W1/BaseApp/Finance/VAT/Calculation/NonDeductibleVAT.Codeunit.al\n--- a/App/Layers/W1/BaseApp/Finance/VAT/Calculation/NonDeductibleVAT.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Finance/VAT/Calculation/NonDeductibleVAT.Codeunit.al\n@@ -15,6 +15,7 @@ using Microsoft.FixedAssets.Ledger;\n using Microsoft.Foundation.Enums;\n using Microsoft.Purchases.Document;\n using Microsoft.Purchases.History;\n+using Microsoft.Projects.Project.Journal;\n \n /// \n /// Provides an interface of the Non-Deductible VAT functionality.\n@@ -430,6 +431,11 @@ codeunit 6200 \"Non-Deductible VAT\"\n NonDedVATImpl.CopyNonDedVATFromGenJnlLineToFALedgEntry(FALedgEntry, GenJnlLine);\n end;\n \n+ procedure CopyNonDedVATFromGenJnlLineToJobJnlLine(var JobJnlLine: Record \"Job Journal Line\"; GenJnlLine: Record \"Gen. Journal Line\")\n+ begin\n+ NonDedVATImpl.CopyNonDedVATFromGenJnlLineToJobJnlLine(JobJnlLine, GenJnlLine);\n+ end;\n+\n /// \n /// Throws an error if purchase line contains prepayment and Non-Deductible VAT\n /// \ndiff --git a/App/Layers/W1/BaseApp/Projects/Project/Journal/JobTransferLine.Codeunit.al b/App/Layers/W1/BaseApp/Projects/Project/Journal/JobTransferLine.Codeunit.al\n--- a/App/Layers/W1/BaseApp/Projects/Project/Journal/JobTransferLine.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Projects/Project/Journal/JobTransferLine.Codeunit.al\n@@ -498,18 +498,7 @@ codeunit 1004 \"Job Transfer Line\"\n JobJnlLine.\"Total Cost (LCY)\" := GenJnlLine.\"Job Total Cost (LCY)\";\n JobJnlLine.\"Total Cost\" := GenJnlLine.\"Job Total Cost\";\n \n- if NonDeductibleVAT.UseNonDeductibleVATAmountForJobCost() then\n- if JobJnlLine.\"Unit Cost\" > 0 then begin\n- JobJnlLine.\"Unit Cost (LCY)\" += Abs(Round(GenJnlLine.\"Non-Deductible VAT Amount LCY\" / JobJnlLine.Quantity));\n- JobJnlLine.\"Unit Cost\" += Abs(Round(GenJnlLine.\"Non-Deductible VAT Amount\" / JobJnlLine.Quantity));\n- JobJnlLine.\"Total Cost (LCY)\" += Abs(GenJnlLine.\"Non-Deductible VAT Amount LCY\");\n- JobJnlLine.\"Total Cost\" += Abs(GenJnlLine.\"Non-Deductible VAT Amount\");\n- end else begin\n- JobJnlLine.\"Unit Cost (LCY)\" += Round(GenJnlLine.\"Non-Deductible VAT Amount LCY\" / JobJnlLine.Quantity);\n- JobJnlLine.\"Unit Cost\" += Round(GenJnlLine.\"Non-Deductible VAT Amount\" / JobJnlLine.Quantity);\n- JobJnlLine.\"Total Cost (LCY)\" += GenJnlLine.\"Non-Deductible VAT Amount LCY\";\n- JobJnlLine.\"Total Cost\" += GenJnlLine.\"Non-Deductible VAT Amount\";\n- end;\n+ NonDeductibleVAT.CopyNonDedVATFromGenJnlLineToJobJnlLine(JobJnlLine, GenJnlLine);\n \n JobJnlLine.\"Unit Price (LCY)\" := GenJnlLine.\"Job Unit Price (LCY)\";\n JobJnlLine.\"Unit Price\" := GenJnlLine.\"Job Unit Price\";\n"} +{"instance_id": "microsoftInternal__NAV-216918__cf-2", "base_instance_id": "microsoftInternal__NAV-216918", "variant_description": "Non-deductible VAT should only be applied when the Job Journal Line has a valid non-zero quantity", "intervention_type": "Syntax / Representation", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-216918__cf-2", "FAIL_TO_PASS": [{"codeunitID": 134284, "functionName": ["JobJnlLineWithNonDeductNormalVATInFCYFromGenJnlLine"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/VAT/NonDedVATMisc.Codeunit.al b/App/Layers/W1/Tests/VAT/NonDedVATMisc.Codeunit.al\n--- a/App/Layers/W1/Tests/VAT/NonDedVATMisc.Codeunit.al\n+++ b/App/Layers/W1/Tests/VAT/NonDedVATMisc.Codeunit.al\n@@ -1135,6 +1135,53 @@ codeunit 134284 \"Non Ded. VAT Misc.\"\n Assert.RecordIsNotEmpty(GLEntry);\n end;\n \n+ [Test]\n+ [Scope('OnPrem')]\n+ procedure JobJnlLineWithNonDeductNormalVATInFCYFromGenJnlLine()\n+ var\n+ Customer: Record Customer;\n+ Job: Record Job;\n+ JobTask: Record \"Job Task\";\n+ VATPostingSetup: Record \"VAT Posting Setup\";\n+ GenJnlLine: Record \"Gen. Journal Line\";\n+ JobJnlLine: Record \"Job Journal Line\";\n+ JobTransferLine: Codeunit \"Job Transfer Line\";\n+ DeductiblePercent: Decimal;\n+ begin\n+ // [FEATURE] [Normal VAT] [UT]\n+ // [SCENARIO 575793] Job journal line with FCY built from the general journal line includes non deductible VAT in \"Unit Cost\"\n+ Initialize();\n+ LibraryNonDeductibleVAT.SetUseForJobCost();\n+ // [GIVEN] VAT Posting Setup, where \"Tax Calculation Type\"::\"Normal VAT\", 'Deductible %' is '60'\n+ DeductiblePercent := LibraryRandom.RandInt(90);\n+ CreateNonDeductibleVATPostingSetup(VATPostingSetup, \"Tax Calculation Type\"::\"Normal VAT\", '', DeductiblePercent);\n+ // [GIVEN] Job \"X\" with currency which factor is 0.5\n+ LibrarySales.CreateCustomer(Customer);\n+ LibraryJob.CreateJob(Job, Customer.\"No.\");\n+ Job.Validate(\"Currency Code\", LibraryERM.CreateCurrencyWithRandomExchRates());\n+ Job.Modify(true);\n+ LibraryJob.CreateJobTask(Job, JobTask);\n+ // [GIVEN] General journal line where line contains \"Non-Deductible VAT Amount\" = 100, \"Job No.\" = \"X\" \"Job Line Type\" = 'Billable'\n+ // [GIVEN] \"Job Quantity\" = 0, \"Job Unit Cost\" = 50\n+ CreateJobGLJournalLine(GenJnlLine, JobTask, VATPostingSetup);\n+ GenJnlLine.Validate(\"Job Quantity\", 0);\n+ GenJnlLine.Modify(true);\n+\n+ // [WHEN] Run FromGenJnlLineToJnlLine\n+ JobTransferLine.FromGenJnlLineToJnlLine(GenJnlLine, JobJnlLine);\n+\n+ // [THEN] VAT must NOT be applied when quantity = 0\n+ Assert.AreEqual(\n+ Round(JobJnlLine.\"Unit Cost (LCY)\"),\n+ 0,\n+ 'Unit Cost (LCY) should be zero when quantity is zero');\n+ // [THEN] JobJnlLine contains \"Total Unit Cost\" = (\"Job Unit Cost\" + \"Non-Deductible VAT Amount\") * \"Currency Factor\" = (50 + 100) * 0.5 = 75\n+ Assert.AreEqual(\n+ Round(JobJnlLine.\"Total Cost (LCY)\"),\n+ 0,\n+ 'Total Cost (LCY) should be zero when quantity is zero');\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n@@ -1368,6 +1414,15 @@ codeunit 134284 \"Non Ded. VAT Misc.\"\n GenJournalLine.Modify(true);\n end;\n \n+ local procedure CreateJobGLJournalLine(var GenJournalLine: Record \"Gen. Journal Line\"; JobTask: Record \"Job Task\"; VATPostingSetup: Record \"VAT Posting Setup\")\n+ begin\n+ LibraryJob.CreateJobGLJournalLine(GenJournalLine.\"Job Line Type\"::Billable, JobTask, GenJournalLine);\n+ GenJournalLine.Validate(\"Gen. Posting Type\", GenJournalLine.\"Gen. Posting Type\"::Purchase);\n+ GenJournalLine.Validate(\"VAT Bus. Posting Group\", VATPostingSetup.\"VAT Bus. Posting Group\");\n+ GenJournalLine.Validate(\"VAT Prod. Posting Group\", VATPostingSetup.\"VAT Prod. Posting Group\");\n+ GenJournalLine.Modify(true);\n+ end;\n+\n local procedure FindFAPostingGroup(GenProdPostingGroup: Code[20]; VATProductPostingGroup: Code[20]): Code[20]\n var\n FAPostingGroup: Record \"FA Posting Group\";\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Finance/GeneralLedger/Journal/GenJournalLine.Table.al b/App/Layers/W1/BaseApp/Finance/GeneralLedger/Journal/GenJournalLine.Table.al\n--- a/App/Layers/W1/BaseApp/Finance/GeneralLedger/Journal/GenJournalLine.Table.al\n+++ b/App/Layers/W1/BaseApp/Finance/GeneralLedger/Journal/GenJournalLine.Table.al\n@@ -4937,16 +4937,7 @@ table 81 \"Gen. Journal Line\"\n TempJobJnlLine.Validate(\"No.\", \"Account No.\");\n TempJobJnlLine.Validate(Quantity, \"Job Quantity\");\n \n- if \"Currency Factor\" = 0 then begin\n- if \"Job Currency Factor\" = 0 then\n- TmpJobJnlOverallCurrencyFactor := 1\n- else\n- TmpJobJnlOverallCurrencyFactor := \"Job Currency Factor\";\n- end else\n- if \"Job Currency Factor\" = 0 then\n- TmpJobJnlOverallCurrencyFactor := 1 / \"Currency Factor\"\n- else\n- TmpJobJnlOverallCurrencyFactor := \"Job Currency Factor\" / \"Currency Factor\";\n+ TmpJobJnlOverallCurrencyFactor := GetGenJnlLineToJobCurrencyFactor();\n \n UpdateAmountsOnTempJobJnlLine(TmpJobJnlOverallCurrencyFactor);\n \n@@ -7628,6 +7619,22 @@ table 81 \"Gen. Journal Line\"\n RecordRestrictionMgt.RestrictRecordUsage(GenJournalLine, RestrictBatchUsageDetailsTxt);\n end;\n \n+ /// \n+ /// Calculates the currency factor for the general journal line based on the job currency factor and the journal line currency factor.\n+ /// \n+ /// Resulted currency factor\n+ procedure GetGenJnlLineToJobCurrencyFactor(): Decimal\n+ begin\n+ if \"Currency Factor\" = 0 then begin\n+ if \"Job Currency Factor\" = 0 then\n+ exit(1);\n+ exit(\"Job Currency Factor\");\n+ end;\n+ if \"Job Currency Factor\" = 0 then\n+ exit(1 / \"Currency Factor\");\n+ exit(\"Job Currency Factor\" / \"Currency Factor\");\n+ end;\n+\n /// \n /// Event triggered before creating dimensions from the Default Dimensions during the validation of the \"Account No.\" field.\n /// By subscribing to this event, developers can override the default dimension creation process for the \"Account No.\" field.\ndiff --git a/App/Layers/W1/BaseApp/Finance/VAT/Calculation/NonDedVATImpl.Codeunit.al b/App/Layers/W1/BaseApp/Finance/VAT/Calculation/NonDedVATImpl.Codeunit.al\n--- a/App/Layers/W1/BaseApp/Finance/VAT/Calculation/NonDedVATImpl.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Finance/VAT/Calculation/NonDedVATImpl.Codeunit.al\n@@ -17,6 +17,8 @@ using Microsoft.Foundation.Enums;\n using Microsoft.Purchases.Document;\n using Microsoft.Purchases.History;\n using Microsoft.Foundation.Company;\n+using Microsoft.Projects.Project.Journal;\n+using Microsoft.Projects.Project.Job;\n \n /// \n /// Defines the implementation of Non-Deductible VAT\n@@ -436,6 +438,38 @@ codeunit 6201 \"Non-Ded. VAT Impl.\"\n FALedgEntry.\"Non-Ded. VAT FA Cost\" := GenJnlLine.\"Non-Ded. VAT FA Cost\";\n end;\n \n+ procedure CopyNonDedVATFromGenJnlLineToJobJnlLine(var JobJnlLine: Record \"Job Journal Line\"; GenJnlLine: Record \"Gen. Journal Line\")\n+ var\n+ Job: Record Job;\n+ CurrencyFactor, NonDedVATAmountLCY, UnitCost, UnitCostLCY, TotalCost, TotalCostLCY : Decimal;\n+ begin\n+ if not UseNonDeductibleVATAmountForJobCost() then\n+ exit;\n+ if not Job.Get(JobJnlLine.\"Job No.\") then\n+ exit;\n+ NonDedVATAmountLCY := GenJnlLine.\"Non-Deductible VAT Amount LCY\";\n+ if GenJnlLine.\"Currency Code\" <> Job.\"Currency Code\" then begin\n+ CurrencyFactor := GenJnlLine.GetGenJnlLineToJobCurrencyFactor();\n+ NonDedVATAmountLCY := Round(GenJnlLine.\"Non-Deductible VAT Amount\" * CurrencyFactor);\n+ end;\n+ if JobJnlLine.Quantity = 0 then\n+ exit;\n+ UnitCostLCY := Round(NonDedVATAmountLCY / JobJnlLine.Quantity);\n+ UnitCost := Round(GenJnlLine.\"Non-Deductible VAT Amount\" / JobJnlLine.Quantity);\n+ TotalCostLCY := NonDedVATAmountLCY;\n+ TotalCost := GenJnlLine.\"Non-Deductible VAT Amount\";\n+ if JobJnlLine.\"Unit Cost\" > 0 then begin\n+ UnitCostLCY := Abs(UnitCostLCY);\n+ UnitCost := Abs(UnitCost);\n+ TotalCostLCY := Abs(TotalCostLCY);\n+ TotalCost := Abs(TotalCost);\n+ end;\n+ JobJnlLine.\"Unit Cost (LCY)\" += UnitCostLCY;\n+ JobJnlLine.\"Unit Cost\" += UnitCost;\n+ JobJnlLine.\"Total Cost (LCY)\" += TotalCostLCY;\n+ JobJnlLine.\"Total Cost\" += TotalCost;\n+ end;\n+\n procedure CheckPrepmtWithNonDeductubleVATInPurchaseLine(PurchaseLine: Record \"Purchase Line\")\n begin\n if (PurchaseLine.\"Prepayment %\" <> 0) and (PurchaseLine.\"Non-Deductible VAT %\" <> 0) then\ndiff --git a/App/Layers/W1/BaseApp/Finance/VAT/Calculation/NonDeductibleVAT.Codeunit.al b/App/Layers/W1/BaseApp/Finance/VAT/Calculation/NonDeductibleVAT.Codeunit.al\n--- a/App/Layers/W1/BaseApp/Finance/VAT/Calculation/NonDeductibleVAT.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Finance/VAT/Calculation/NonDeductibleVAT.Codeunit.al\n@@ -15,6 +15,7 @@ using Microsoft.FixedAssets.Ledger;\n using Microsoft.Foundation.Enums;\n using Microsoft.Purchases.Document;\n using Microsoft.Purchases.History;\n+using Microsoft.Projects.Project.Journal;\n \n /// \n /// Provides an interface of the Non-Deductible VAT functionality.\n@@ -430,6 +431,11 @@ codeunit 6200 \"Non-Deductible VAT\"\n NonDedVATImpl.CopyNonDedVATFromGenJnlLineToFALedgEntry(FALedgEntry, GenJnlLine);\n end;\n \n+ procedure CopyNonDedVATFromGenJnlLineToJobJnlLine(var JobJnlLine: Record \"Job Journal Line\"; GenJnlLine: Record \"Gen. Journal Line\")\n+ begin\n+ NonDedVATImpl.CopyNonDedVATFromGenJnlLineToJobJnlLine(JobJnlLine, GenJnlLine);\n+ end;\n+\n /// \n /// Throws an error if purchase line contains prepayment and Non-Deductible VAT\n /// \ndiff --git a/App/Layers/W1/BaseApp/Projects/Project/Journal/JobTransferLine.Codeunit.al b/App/Layers/W1/BaseApp/Projects/Project/Journal/JobTransferLine.Codeunit.al\n--- a/App/Layers/W1/BaseApp/Projects/Project/Journal/JobTransferLine.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Projects/Project/Journal/JobTransferLine.Codeunit.al\n@@ -498,18 +498,7 @@ codeunit 1004 \"Job Transfer Line\"\n JobJnlLine.\"Total Cost (LCY)\" := GenJnlLine.\"Job Total Cost (LCY)\";\n JobJnlLine.\"Total Cost\" := GenJnlLine.\"Job Total Cost\";\n \n- if NonDeductibleVAT.UseNonDeductibleVATAmountForJobCost() then\n- if JobJnlLine.\"Unit Cost\" > 0 then begin\n- JobJnlLine.\"Unit Cost (LCY)\" += Abs(Round(GenJnlLine.\"Non-Deductible VAT Amount LCY\" / JobJnlLine.Quantity));\n- JobJnlLine.\"Unit Cost\" += Abs(Round(GenJnlLine.\"Non-Deductible VAT Amount\" / JobJnlLine.Quantity));\n- JobJnlLine.\"Total Cost (LCY)\" += Abs(GenJnlLine.\"Non-Deductible VAT Amount LCY\");\n- JobJnlLine.\"Total Cost\" += Abs(GenJnlLine.\"Non-Deductible VAT Amount\");\n- end else begin\n- JobJnlLine.\"Unit Cost (LCY)\" += Round(GenJnlLine.\"Non-Deductible VAT Amount LCY\" / JobJnlLine.Quantity);\n- JobJnlLine.\"Unit Cost\" += Round(GenJnlLine.\"Non-Deductible VAT Amount\" / JobJnlLine.Quantity);\n- JobJnlLine.\"Total Cost (LCY)\" += GenJnlLine.\"Non-Deductible VAT Amount LCY\";\n- JobJnlLine.\"Total Cost\" += GenJnlLine.\"Non-Deductible VAT Amount\";\n- end;\n+ NonDeductibleVAT.CopyNonDedVATFromGenJnlLineToJobJnlLine(JobJnlLine, GenJnlLine);\n \n JobJnlLine.\"Unit Price (LCY)\" := GenJnlLine.\"Job Unit Price (LCY)\";\n JobJnlLine.\"Unit Price\" := GenJnlLine.\"Job Unit Price\";\n"} +{"instance_id": "microsoftInternal__NAV-218856__cf-1", "base_instance_id": "microsoftInternal__NAV-218856", "variant_description": "The relation should only be validated when the contact is of type Company", "intervention_type": "Execution / Validation Semantics Misalignment", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-218856__cf-1", "FAIL_TO_PASS": [{"codeunitID": 136102, "functionName": ["ChangeCustomerOfTypePeronInServiceContract"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM-Service/ServiceContracts.Codeunit.al b/App/Layers/W1/Tests/SCM-Service/ServiceContracts.Codeunit.al\n--- a/App/Layers/W1/Tests/SCM-Service/ServiceContracts.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM-Service/ServiceContracts.Codeunit.al\n@@ -10,6 +10,8 @@\n using Microsoft.Finance.GeneralLedger.Account;\n using Microsoft.Finance.GeneralLedger.Ledger;\n using Microsoft.Finance.VAT.Setup;\n+using Microsoft.CRM.BusinessRelation;\n+using Microsoft.CRM.Contact;\n using Microsoft.Inventory.Item;\n using Microsoft.Projects.Resources.Resource;\n using Microsoft.Sales.Customer;\n@@ -42,6 +44,7 @@\n var\n ServiceContractHeader2: Record \"Service Contract Header\";\n Assert: Codeunit Assert;\n+ LibraryMarketing: Codeunit \"Library - Marketing\";\n LibraryTestInitialize: Codeunit \"Library - Test Initialize\";\n LibraryService: Codeunit \"Library - Service\";\n LibraryUtility: Codeunit \"Library - Utility\";\n@@ -3563,6 +3566,49 @@\n Assert.Equal('', Format(ServiceContractHeader.\"Last Invoice Period End\"));\n end;\n \n+ [Test]\n+ [HandlerFunctions('MessageHandler,SignContractConfirmHandler,ServContrctTemplateListHandler')]\n+ [Scope('OnPrem')]\n+ procedure ChangeCustomerOfTypePeronInServiceContract()\n+ var\n+ ContactBusinessRelation: Record \"Contact Business Relation\";\n+ Contact: Record Contact;\n+ ServiceContractHeader: Record \"Service Contract Header\";\n+ ServiceContractLine: Record \"Service Contract Line\";\n+ ShiptoAddress: Record \"Ship-to Address\";\n+ ServContractManagement: Codeunit ServContractManagement;\n+ ContactCard: TestPage \"Contact Card\";\n+ begin\n+ // [SCENARIO 578655] Change Customer No. on Service Contract of Customer type Company.\n+ Initialize();\n+\n+ // [GIVEN] Create Contact of type Company.\n+ LibraryMarketing.CreateCompanyContact(Contact);\n+\n+ // [GIVEN] Open Contact Card and invoke Create Customer.\n+ ContactCard.OpenEdit();\n+ ContactCard.Filter.SetFilter(\"No.\", Contact.\"No.\");\n+ ContactCard.CreateCustomer.Invoke();\n+\n+ // [GIVEN] Create Service Contract Header and Service Contract Line.\n+ CreateServiceContract(ServiceContractHeader, ServiceContractLine, ServiceContractHeader.\"Contract Type\"::Contract);\n+ ModifyServiceContractHeader(ServiceContractHeader, ServiceContractHeader.\"Service Period\");\n+\n+ // [GIVEN] Find Contact Business Relation of the Contact.\n+ ContactBusinessRelation.SetRange(\"Contact No.\", Contact.\"No.\");\n+ ContactBusinessRelation.SetRange(\"Link to Table\", ContactBusinessRelation.\"Link to Table\"::Customer);\n+ ContactBusinessRelation.FindFirst();\n+\n+ // [GIVEN] Create Ship to Address.\n+ LibrarySales.CreateShipToAddress(ShiptoAddress, ContactBusinessRelation.\"No.\");\n+\n+ // [WHEN] Change Customer No. in Service Contract.\n+ ServContractManagement.ChangeCustNoOnServContract(ShiptoAddress.\"Customer No.\", ShiptoAddress.Code, ServiceContractHeader);\n+\n+ // [THEN] Check Customer No. is updated.\n+ CheckChangeCustomerNo(ServiceContractHeader, ContactBusinessRelation.\"No.\");\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n@@ -5358,6 +5404,11 @@\n Error(MessageText);\n end;\n \n+ [MessageHandler]\n+ procedure MessageHandler(Message: Text[1024])\n+ begin\n+ end;\n+\n [ConfirmHandler]\n [Scope('OnPrem')]\n procedure InvoiceConfirmHandler(ConfirmMessage: Text[1024]; var Result: Boolean)\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Service/Contract/ServiceContractHeader.Table.al b/App/Layers/W1/BaseApp/Service/Contract/ServiceContractHeader.Table.al\n--- a/App/Layers/W1/BaseApp/Service/Contract/ServiceContractHeader.Table.al\n+++ b/App/Layers/W1/BaseApp/Service/Contract/ServiceContractHeader.Table.al\n@@ -1389,7 +1389,7 @@\n if (\"Bill-to Customer No.\" <> '') and (\"Bill-to Contact No.\" <> '') then begin\n Cont.Get(\"Bill-to Contact No.\");\n if ContBusinessRelation.FindByRelation(ContBusinessRelation.\"Link to Table\"::Customer, \"Bill-to Customer No.\") then\n- if ContBusinessRelation.\"Contact No.\" <> Cont.\"Company No.\" then\n+ if (ContBusinessRelation.\"Contact No.\" <> Cont.\"Company No.\") and (Cont.Type = Cont.Type::Company) then\n Error(Text045, Cont.\"No.\", Cont.Name, \"Bill-to Customer No.\");\n end;\n \n@@ -2240,6 +2240,7 @@\n ContBusinessRelation: Record \"Contact Business Relation\";\n Cust: Record Customer;\n Cont: Record Contact;\n+ ContactBusinessRelationFound: Boolean;\n IsHandled: Boolean;\n begin\n IsHandled := false;\n@@ -2257,7 +2258,9 @@\n if Cust.Get(\"Customer No.\") then\n \"Contact Name\" := Cust.Contact\n else\n- \"Contact Name\" := ''\n+ \"Contact Name\" := '';\n+ if Cont.Type = Cont.Type::Company then\n+ ContactBusinessRelationFound := ContBusinessRelation.FindByContact(ContBusinessRelation.\"Link to Table\"::Customer, Cont.\"No.\");\n end else begin\n \"Contact Name\" := '';\n \"Phone No.\" := '';\n@@ -2265,7 +2268,7 @@\n exit;\n end;\n \n- if ContBusinessRelation.FindByContact(ContBusinessRelation.\"Link to Table\"::Customer, Cont.\"Company No.\") then begin\n+ if ContactBusinessRelationFound then begin\n if (\"Customer No.\" <> '') and\n (\"Customer No.\" <> ContBusinessRelation.\"No.\")\n then\n@@ -2289,6 +2292,7 @@\n ContBusinessRelation: Record \"Contact Business Relation\";\n Cust: Record Customer;\n Cont: Record Contact;\n+ ContactBusinessRelationFound: Boolean;\n begin\n if Cont.Get(ContactNo) then begin\n \"Bill-to Contact No.\" := Cont.\"No.\";\n@@ -2299,13 +2303,15 @@\n \"Bill-to Contact\" := Cust.Contact\n else\n \"Bill-to Contact\" := '';\n+ if Cont.Type = Cont.Type::Company then\n+ ContactBusinessRelationFound := ContBusinessRelation.FindByContact(ContBusinessRelation.\"Link to Table\"::Customer, Cont.\"No.\");\n end else begin\n \"Bill-to Contact\" := '';\n exit;\n end;\n \n OnUpdateBillToCustOnBeforeContBusinessRelationFindByContact(Rec, Cust, Cont);\n- if ContBusinessRelation.FindByContact(ContBusinessRelation.\"Link to Table\"::Customer, Cont.\"Company No.\") then begin\n+ if ContactBusinessRelationFound then begin\n if \"Bill-to Customer No.\" = '' then begin\n SkipBillToContact := true;\n Validate(\"Bill-to Customer No.\", ContBusinessRelation.\"No.\");\n"} +{"instance_id": "microsoftInternal__NAV-215225__cf-1", "base_instance_id": "microsoftInternal__NAV-215225", "variant_description": "Unit Cost and Unit Price must be restored only when posting is triggered through the standard posting action", "intervention_type": "Event-Driven Paradigm", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-215225__cf-1", "FAIL_TO_PASS": [{"codeunitID": 136305, "functionName": ["CheckUnitCostAndPriceNotZeroInRecurringJobJnlAfterPosting"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/Job/JobJournal.Codeunit.al b/App/Layers/W1/Tests/Job/JobJournal.Codeunit.al\nindex e427075ebd9..1a379eb28aa 100644\n--- a/App/Layers/W1/Tests/Job/JobJournal.Codeunit.al\n+++ b/App/Layers/W1/Tests/Job/JobJournal.Codeunit.al\n@@ -2938,6 +2938,36 @@ codeunit 136305 \"Job Journal\"\n Assert.AreNotEqual(GenJournalLine.\"Job Total Cost (LCY)\", PreviousProjectTotalCostLCY, ProjectTotalCostErr);\n end;\n \n+ [Test]\n+ [HandlerFunctions('ConfirmHandlerTrue,MessageHandler')]\n+ procedure CheckUnitCostAndPriceNotZeroInRecurringJobJnlAfterPosting()\n+ var\n+ Job: Record Job;\n+ JobTask: Record \"Job Task\";\n+ Resource: Record Resource;\n+ RecurringJobJnl: TestPage \"Recurring Job Jnl.\";\n+ begin\n+ // [SCENARIO 575092] Verify that the Unit Price and Unit Cost are not zero only when posting is triggered via standard posting action.\n+ Initialize();\n+\n+ // [GIVEN] Create a Resource.\n+ FindResource(Resource);\n+\n+ // [GIVEN] Create Job, job task & multiple Job planning line.\n+ CreateFullJob(Job, JobTask, Resource);\n+\n+ // [GIVEN] Create Recurring Job Journal.\n+ OpenRecurringJobJnl(RecurringJobJnl, JobTask, Resource.\"No.\");\n+\n+ // [WHEN] Simulate non-standard posting (direct invoke bypass).\n+ RecurringJobJnl.OpenEdit();\n+ Commit();\n+\n+ // [THEN] Verify that the Unit Price and Unit Cost are not zero only when posting is triggered via standard posting action.\n+ RecurringJobJnl.\"Unit Price\".AssertEquals(Resource.\"Unit Price\");\n+ RecurringJobJnl.\"Unit Cost\".AssertEquals(Resource.\"Unit Cost\");\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n@@ -3917,6 +3947,44 @@ codeunit 136305 \"Job Journal\"\n JobJnlLine.TestField(\"Reserved Qty. (Base)\", 0);\n end;\n \n+ local procedure FindResource(var Resource: Record Resource)\n+ begin\n+ Resource.Get(LibraryJob.CreateConsumable(\"Job Planning Line Type\"::Resource));\n+ Resource.Validate(Type, Resource.Type::Person);\n+ Resource.Validate(\"Unit Cost\", LibraryRandom.RandIntInRange(100, 200));\n+ Resource.Validate(\"Unit Price\", LibraryRandom.RandIntInRange(300, 500));\n+ Resource.Modify(true);\n+ end;\n+\n+ local procedure CreateFullJob(var Job: Record Job; var JobTask: Record \"Job Task\"; Resource: Record Resource)\n+ var\n+ JobPlanningLine: Record \"Job Planning Line\";\n+ begin\n+ LibraryJob.CreateJob(Job);\n+ LibraryJob.CreateJobTask(Job, JobTask);\n+\n+ LibraryJob.CreateJobPlanningLine(\n+ JobTask, JobPlanningLine.\"Line Type\"::\"Both Budget and Billable\",\n+ JobPlanningLine.Type::Resource, Resource.\"No.\", LibraryRandom.RandInt(10), JobPlanningLine);\n+ end;\n+\n+ local procedure OpenRecurringJobJnl(var RecurringJobJnl: TestPage \"Recurring Job Jnl.\"; JobTask: Record \"Job Task\"; ResourceNo: Code[20])\n+ var\n+ JobJournalLineType: Enum \"Job Journal Line Type\";\n+ RecurringMethod: Option ,Fixed,Variable;\n+ begin\n+ RecurringJobJnl.OpenEdit();\n+ RecurringJobJnl.\"Recurring Method\".SetValue(Format(RecurringMethod::Variable));\n+ RecurringJobJnl.\"Recurring Frequency\".SetValue('10D');\n+ RecurringJobJnl.\"Document No.\".SetValue(JobTask.\"Job No.\");\n+ RecurringJobJnl.\"Job No.\".SetValue(JobTask.\"Job No.\");\n+ RecurringJobJnl.\"Job Task No.\".SetValue(JobTask.\"Job Task No.\");\n+ RecurringJobJnl.Type.SetValue(Format(JobJournalLineType::Resource));\n+ RecurringJobJnl.\"No.\".SetValue(ResourceNo);\n+ RecurringJobJnl.Quantity.SetValue(Format(LibraryRandom.RandInt(5)));\n+ RecurringJobJnl.Close();\n+ end;\n+\n [ModalPageHandler]\n [Scope('OnPrem')]\n procedure ContactListPageHandler(var ContactList: TestPage \"Contact List\")\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Projects/Project/Posting/JobJnlPostBatch.Codeunit.al b/App/Layers/W1/BaseApp/Projects/Project/Posting/JobJnlPostBatch.Codeunit.al\nindex 9f7bd75b991..57af0bb5690 100644\n--- a/App/Layers/W1/BaseApp/Projects/Project/Posting/JobJnlPostBatch.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Projects/Project/Posting/JobJnlPostBatch.Codeunit.al\n@@ -275,6 +275,7 @@ codeunit 1013 \"Job Jnl.-Post Batch\"\n \n local procedure UpdateAndDeleteLines()\n var\n+ UnitCost, UnitPrice : Decimal;\n IsHandled: Boolean;\n begin\n OnBeforeUpdateAndDeleteLines(JobJnlLine);\n@@ -295,8 +296,13 @@ codeunit 1013 \"Job Jnl.-Post Batch\"\n JobJnlLine2.Validate(\"Posting Date\", CalcDate(JobJnlLine2.\"Recurring Frequency\", JobJnlLine2.\"Posting Date\"));\n if (JobJnlLine2.\"Recurring Method\" = JobJnlLine2.\"Recurring Method\"::Variable) and\n (JobJnlLine2.\"No.\" <> '')\n- then\n+ then begin\n+ UnitCost := JobJnlLine2.\"Unit Cost\";\n+ UnitPrice := JobJnlLine2.\"Unit Price\";\n JobJnlLine2.DeleteAmounts();\n+ if GuiAllowed then\n+ UpdateUnitCostAndPrice(JobJnlLine2, UnitCost, UnitPrice);\n+ end;\n JobJnlLine2.Modify();\n until JobJnlLine2.Next() = 0;\n end else begin\n@@ -339,6 +345,15 @@ codeunit 1013 \"Job Jnl.-Post Batch\"\n NoSeriesBatch.SaveState();\n end;\n \n+ local procedure UpdateUnitCostAndPrice(var JobJournalLine: Record \"Job Journal Line\"; UnitCost: Decimal; UnitPrice: Decimal)\n+ begin\n+ if (UnitCost = 0) and (UnitPrice = 0) then\n+ exit;\n+\n+ JobJournalLine.\"Unit Cost\" := UnitCost;\n+ JobJournalLine.\"Unit Price\" := UnitPrice;\n+ end;\n+\n procedure SetSuppressCommit(NewSuppressCommit: Boolean)\n begin\n SuppressCommit := NewSuppressCommit;\n"} +{"instance_id": "microsoftInternal__NAV-215225__cf-2", "base_instance_id": "microsoftInternal__NAV-215225", "variant_description": "Unit Cost and Unit Price should only be restored when Quantity is greater than zero", "intervention_type": "Workflow / Business Logic Composition", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-215225__cf-2", "FAIL_TO_PASS": [{"codeunitID": 136305, "functionName": ["CheckUnitCostAndPriceNotZeroInRecurringJobJnlAfterPosting"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/Job/JobJournal.Codeunit.al b/App/Layers/W1/Tests/Job/JobJournal.Codeunit.al\nindex e427075ebd9..1a379eb28aa 100644\n--- a/App/Layers/W1/Tests/Job/JobJournal.Codeunit.al\n+++ b/App/Layers/W1/Tests/Job/JobJournal.Codeunit.al\n@@ -2938,6 +2938,35 @@ codeunit 136305 \"Job Journal\"\n Assert.AreNotEqual(GenJournalLine.\"Job Total Cost (LCY)\", PreviousProjectTotalCostLCY, ProjectTotalCostErr);\n end;\n \n+ [Test]\n+ [HandlerFunctions('ConfirmHandlerTrue,MessageHandler')]\n+ procedure CheckUnitCostAndPriceNotZeroInRecurringJobJnlAfterPosting()\n+ var\n+ Job: Record Job;\n+ JobTask: Record \"Job Task\";\n+ Resource: Record Resource;\n+ RecurringJobJnl: TestPage \"Recurring Job Jnl.\";\n+ begin\n+ // [SCENARIO 575092] Verify that the Unit Price and Unit Cost are restored only when Quantity > 0.\n+ Initialize();\n+\n+ // [GIVEN] Create a Resource.\n+ FindResource(Resource);\n+\n+ // [GIVEN] Create Job, job task & multiple Job planning line.\n+ CreateFullJob(Job, JobTask, Resource);\n+\n+ // [GIVEN] Create Recurring Job Journal.\n+ OpenRecurringJobJnl(RecurringJobJnl, JobTask, Resource.\"No.\");\n+\n+ // [WHEN] Post Recurring Job Journal.\n+ PostRecurringJobJnl(RecurringJobJnl);\n+\n+ // [THEN] Verify that the Unit Price and Unit Cost are restored only when Quantity > 0.\n+ RecurringJobJnl.\"Unit Price\".AssertEquals(Resource.\"Unit Price\");\n+ RecurringJobJnl.\"Unit Cost\".AssertEquals(Resource.\"Unit Cost\");\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n@@ -3917,6 +3946,51 @@ codeunit 136305 \"Job Journal\"\n JobJnlLine.TestField(\"Reserved Qty. (Base)\", 0);\n end;\n \n+ local procedure FindResource(var Resource: Record Resource)\n+ begin\n+ Resource.Get(LibraryJob.CreateConsumable(\"Job Planning Line Type\"::Resource));\n+ Resource.Validate(Type, Resource.Type::Person);\n+ Resource.Validate(\"Unit Cost\", LibraryRandom.RandIntInRange(100, 200));\n+ Resource.Validate(\"Unit Price\", LibraryRandom.RandIntInRange(300, 500));\n+ Resource.Modify(true);\n+ end;\n+\n+ local procedure CreateFullJob(var Job: Record Job; var JobTask: Record \"Job Task\"; Resource: Record Resource)\n+ var\n+ JobPlanningLine: Record \"Job Planning Line\";\n+ begin\n+ LibraryJob.CreateJob(Job);\n+ LibraryJob.CreateJobTask(Job, JobTask);\n+\n+ LibraryJob.CreateJobPlanningLine(\n+ JobTask, JobPlanningLine.\"Line Type\"::\"Both Budget and Billable\",\n+ JobPlanningLine.Type::Resource, Resource.\"No.\", LibraryRandom.RandInt(10), JobPlanningLine);\n+ end;\n+\n+ local procedure OpenRecurringJobJnl(var RecurringJobJnl: TestPage \"Recurring Job Jnl.\"; JobTask: Record \"Job Task\"; ResourceNo: Code[20])\n+ var\n+ JobJournalLineType: Enum \"Job Journal Line Type\";\n+ RecurringMethod: Option ,Fixed,Variable;\n+ begin\n+ RecurringJobJnl.OpenEdit();\n+ RecurringJobJnl.\"Recurring Method\".SetValue(Format(RecurringMethod::Variable));\n+ RecurringJobJnl.\"Recurring Frequency\".SetValue('10D');\n+ RecurringJobJnl.\"Document No.\".SetValue(JobTask.\"Job No.\");\n+ RecurringJobJnl.\"Job No.\".SetValue(JobTask.\"Job No.\");\n+ RecurringJobJnl.\"Job Task No.\".SetValue(JobTask.\"Job Task No.\");\n+ RecurringJobJnl.Type.SetValue(Format(JobJournalLineType::Resource));\n+ RecurringJobJnl.\"No.\".SetValue(ResourceNo);\n+ RecurringJobJnl.Quantity.SetValue('0');\n+ RecurringJobJnl.Close();\n+ end;\n+\n+ local procedure PostRecurringJobJnl(var RecurringJobJnl: TestPage \"Recurring Job Jnl.\")\n+ begin\n+ RecurringJobJnl.OpenEdit();\n+ RecurringJobJnl.\"P&ost\".Invoke();\n+ Commit();\n+ end;\n+\n [ModalPageHandler]\n [Scope('OnPrem')]\n procedure ContactListPageHandler(var ContactList: TestPage \"Contact List\")\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Projects/Project/Posting/JobJnlPostBatch.Codeunit.al b/App/Layers/W1/BaseApp/Projects/Project/Posting/JobJnlPostBatch.Codeunit.al\nindex 9f7bd75b991..57af0bb5690 100644\n--- a/App/Layers/W1/BaseApp/Projects/Project/Posting/JobJnlPostBatch.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Projects/Project/Posting/JobJnlPostBatch.Codeunit.al\n@@ -275,6 +275,7 @@ codeunit 1013 \"Job Jnl.-Post Batch\"\n \n local procedure UpdateAndDeleteLines()\n var\n+ UnitCost, UnitPrice : Decimal;\n IsHandled: Boolean;\n begin\n OnBeforeUpdateAndDeleteLines(JobJnlLine);\n@@ -295,8 +296,13 @@ codeunit 1013 \"Job Jnl.-Post Batch\"\n JobJnlLine2.Validate(\"Posting Date\", CalcDate(JobJnlLine2.\"Recurring Frequency\", JobJnlLine2.\"Posting Date\"));\n if (JobJnlLine2.\"Recurring Method\" = JobJnlLine2.\"Recurring Method\"::Variable) and\n (JobJnlLine2.\"No.\" <> '')\n- then\n+ then begin\n+ UnitCost := JobJnlLine2.\"Unit Cost\";\n+ UnitPrice := JobJnlLine2.\"Unit Price\";\n JobJnlLine2.DeleteAmounts();\n+ if JobJnlLine2.Quantity > 0 then\n+ UpdateUnitCostAndPrice(JobJnlLine2, UnitCost, UnitPrice);\n+ end;\n JobJnlLine2.Modify();\n until JobJnlLine2.Next() = 0;\n end else begin\n@@ -339,6 +345,15 @@ codeunit 1013 \"Job Jnl.-Post Batch\"\n NoSeriesBatch.SaveState();\n end;\n \n+ local procedure UpdateUnitCostAndPrice(var JobJournalLine: Record \"Job Journal Line\"; UnitCost: Decimal; UnitPrice: Decimal)\n+ begin\n+ if (UnitCost = 0) and (UnitPrice = 0) then\n+ exit;\n+\n+ JobJournalLine.\"Unit Cost\" := UnitCost;\n+ JobJournalLine.\"Unit Price\" := UnitPrice;\n+ end;\n+\n procedure SetSuppressCommit(NewSuppressCommit: Boolean)\n begin\n SuppressCommit := NewSuppressCommit;\n"} +{"instance_id": "microsoftInternal__NAV-215225__cf-3", "base_instance_id": "microsoftInternal__NAV-215225", "variant_description": "Unit Cost and Unit Price should only be restored if the Resource still exists", "intervention_type": "Toolchain / Ecosystem Constraint", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-215225__cf-3", "FAIL_TO_PASS": [{"codeunitID": 136305, "functionName": ["CheckUnitCostAndPriceNotZeroInRecurringJobJnlAfterPosting"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/Job/JobJournal.Codeunit.al b/App/Layers/W1/Tests/Job/JobJournal.Codeunit.al\nindex e427075ebd9..1a379eb28aa 100644\n--- a/App/Layers/W1/Tests/Job/JobJournal.Codeunit.al\n+++ b/App/Layers/W1/Tests/Job/JobJournal.Codeunit.al\n@@ -2938,6 +2938,38 @@ codeunit 136305 \"Job Journal\"\n Assert.AreNotEqual(GenJournalLine.\"Job Total Cost (LCY)\", PreviousProjectTotalCostLCY, ProjectTotalCostErr);\n end;\n \n+ [Test]\n+ [HandlerFunctions('ConfirmHandlerTrue,MessageHandler')]\n+ procedure CheckUnitCostAndPriceNotZeroInRecurringJobJnlAfterPosting()\n+ var\n+ Job: Record Job;\n+ JobTask: Record \"Job Task\";\n+ Resource: Record Resource;\n+ RecurringJobJnl: TestPage \"Recurring Job Jnl.\";\n+ begin\n+ // [SCENARIO 575092] Verify that the Unit Price and Unit Cost are restored only if the Resource still exists.\n+ Initialize();\n+\n+ // [GIVEN] Create a Resource.\n+ FindResource(Resource);\n+\n+ // [GIVEN] Create Job, job task & multiple Job planning line.\n+ CreateFullJob(Job, JobTask, Resource);\n+\n+ // [GIVEN] Create Recurring Job Journal.\n+ OpenRecurringJobJnl(RecurringJobJnl, JobTask, Resource.\"No.\");\n+\n+ // [GIVEN] Delete the resource before posting.\n+ Resource.Delete(true);\n+\n+ // [WHEN] Post Recurring Job Journal.\n+ PostRecurringJobJnl(RecurringJobJnl);\n+\n+ // [THEN] Verify that the Unit Price and Unit Cost are restored only if the Resource still exists.\n+ RecurringJobJnl.\"Unit Price\".AssertEquals(Resource.\"Unit Price\");\n+ RecurringJobJnl.\"Unit Cost\".AssertEquals(Resource.\"Unit Cost\");\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n@@ -3917,6 +3949,51 @@ codeunit 136305 \"Job Journal\"\n JobJnlLine.TestField(\"Reserved Qty. (Base)\", 0);\n end;\n \n+ local procedure FindResource(var Resource: Record Resource)\n+ begin\n+ Resource.Get(LibraryJob.CreateConsumable(\"Job Planning Line Type\"::Resource));\n+ Resource.Validate(Type, Resource.Type::Person);\n+ Resource.Validate(\"Unit Cost\", LibraryRandom.RandIntInRange(100, 200));\n+ Resource.Validate(\"Unit Price\", LibraryRandom.RandIntInRange(300, 500));\n+ Resource.Modify(true);\n+ end;\n+\n+ local procedure CreateFullJob(var Job: Record Job; var JobTask: Record \"Job Task\"; Resource: Record Resource)\n+ var\n+ JobPlanningLine: Record \"Job Planning Line\";\n+ begin\n+ LibraryJob.CreateJob(Job);\n+ LibraryJob.CreateJobTask(Job, JobTask);\n+\n+ LibraryJob.CreateJobPlanningLine(\n+ JobTask, JobPlanningLine.\"Line Type\"::\"Both Budget and Billable\",\n+ JobPlanningLine.Type::Resource, Resource.\"No.\", LibraryRandom.RandInt(10), JobPlanningLine);\n+ end;\n+\n+ local procedure OpenRecurringJobJnl(var RecurringJobJnl: TestPage \"Recurring Job Jnl.\"; JobTask: Record \"Job Task\"; ResourceNo: Code[20])\n+ var\n+ JobJournalLineType: Enum \"Job Journal Line Type\";\n+ RecurringMethod: Option ,Fixed,Variable;\n+ begin\n+ RecurringJobJnl.OpenEdit();\n+ RecurringJobJnl.\"Recurring Method\".SetValue(Format(RecurringMethod::Variable));\n+ RecurringJobJnl.\"Recurring Frequency\".SetValue('10D');\n+ RecurringJobJnl.\"Document No.\".SetValue(JobTask.\"Job No.\");\n+ RecurringJobJnl.\"Job No.\".SetValue(JobTask.\"Job No.\");\n+ RecurringJobJnl.\"Job Task No.\".SetValue(JobTask.\"Job Task No.\");\n+ RecurringJobJnl.Type.SetValue(Format(JobJournalLineType::Resource));\n+ RecurringJobJnl.\"No.\".SetValue(ResourceNo);\n+ RecurringJobJnl.Quantity.SetValue(Format(LibraryRandom.RandInt(5)));\n+ RecurringJobJnl.Close();\n+ end;\n+\n+ local procedure PostRecurringJobJnl(var RecurringJobJnl: TestPage \"Recurring Job Jnl.\")\n+ begin\n+ RecurringJobJnl.OpenEdit();\n+ RecurringJobJnl.\"P&ost\".Invoke();\n+ Commit();\n+ end;\n+\n [ModalPageHandler]\n [Scope('OnPrem')]\n procedure ContactListPageHandler(var ContactList: TestPage \"Contact List\")\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Projects/Project/Posting/JobJnlPostBatch.Codeunit.al b/App/Layers/W1/BaseApp/Projects/Project/Posting/JobJnlPostBatch.Codeunit.al\nindex 9f7bd75b991..57af0bb5690 100644\n--- a/App/Layers/W1/BaseApp/Projects/Project/Posting/JobJnlPostBatch.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Projects/Project/Posting/JobJnlPostBatch.Codeunit.al\n@@ -275,6 +275,8 @@ codeunit 1013 \"Job Jnl.-Post Batch\"\n \n local procedure UpdateAndDeleteLines()\n var\n+ Resource: Record Resource;\n+ UnitCost, UnitPrice : Decimal;\n IsHandled: Boolean;\n begin\n OnBeforeUpdateAndDeleteLines(JobJnlLine);\n@@ -295,8 +297,13 @@ codeunit 1013 \"Job Jnl.-Post Batch\"\n JobJnlLine2.Validate(\"Posting Date\", CalcDate(JobJnlLine2.\"Recurring Frequency\", JobJnlLine2.\"Posting Date\"));\n if (JobJnlLine2.\"Recurring Method\" = JobJnlLine2.\"Recurring Method\"::Variable) and\n (JobJnlLine2.\"No.\" <> '')\n- then\n+ then begin\n+ UnitCost := JobJnlLine2.\"Unit Cost\";\n+ UnitPrice := JobJnlLine2.\"Unit Price\";\n JobJnlLine2.DeleteAmounts();\n+ if Resource.Get(JobJnlLine2.\"No.\") then\n+ UpdateUnitCostAndPrice(JobJnlLine2, UnitCost, UnitPrice);\n+ end;\n JobJnlLine2.Modify();\n until JobJnlLine2.Next() = 0;\n end else begin\n@@ -339,6 +346,15 @@ codeunit 1013 \"Job Jnl.-Post Batch\"\n NoSeriesBatch.SaveState();\n end;\n \n+ local procedure UpdateUnitCostAndPrice(var JobJournalLine: Record \"Job Journal Line\"; UnitCost: Decimal; UnitPrice: Decimal)\n+ begin\n+ if (UnitCost = 0) and (UnitPrice = 0) then\n+ exit;\n+\n+ JobJournalLine.\"Unit Cost\" := UnitCost;\n+ JobJournalLine.\"Unit Price\" := UnitPrice;\n+ end;\n+\n procedure SetSuppressCommit(NewSuppressCommit: Boolean)\n begin\n SuppressCommit := NewSuppressCommit;\n"} +{"instance_id": "microsoftInternal__NAV-218856__cf-2", "base_instance_id": "microsoftInternal__NAV-218856", "variant_description": "Customer change must be triggered via field validation instead of direct function call", "intervention_type": "Event-driven Paradigm Misalignment", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-218856__cf-2", "FAIL_TO_PASS": [{"codeunitID": 136102, "functionName": ["ChangeCustomerOfTypePeronInServiceContract"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM-Service/ServiceContracts.Codeunit.al b/App/Layers/W1/Tests/SCM-Service/ServiceContracts.Codeunit.al\nindex ad01a498eef..1b594959106 100644\n--- a/App/Layers/W1/Tests/SCM-Service/ServiceContracts.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM-Service/ServiceContracts.Codeunit.al\n@@ -10,6 +10,8 @@ using Microsoft.Finance.Dimension;\n using Microsoft.Finance.GeneralLedger.Account;\n using Microsoft.Finance.GeneralLedger.Ledger;\n using Microsoft.Finance.VAT.Setup;\n+using Microsoft.CRM.BusinessRelation;\n+using Microsoft.CRM.Contact;\n using Microsoft.Inventory.Item;\n using Microsoft.Projects.Resources.Resource;\n using Microsoft.Sales.Customer;\n@@ -42,6 +44,7 @@ codeunit 136102 \"Service Contracts\"\n var\n ServiceContractHeader2: Record \"Service Contract Header\";\n Assert: Codeunit Assert;\n+ LibraryMarketing: Codeunit \"Library - Marketing\";\n LibraryTestInitialize: Codeunit \"Library - Test Initialize\";\n LibraryService: Codeunit \"Library - Service\";\n LibraryUtility: Codeunit \"Library - Utility\";\n@@ -3563,6 +3566,49 @@ codeunit 136102 \"Service Contracts\"\n Assert.Equal('', Format(ServiceContractHeader.\"Last Invoice Period End\"));\n end;\n \n+ [Test]\n+ [HandlerFunctions('MessageHandler,SignContractConfirmHandler,ServContrctTemplateListHandler')]\n+ [Scope('OnPrem')]\n+ procedure ChangeCustomerOfTypePeronInServiceContract()\n+ var\n+ ContactBusinessRelation: Record \"Contact Business Relation\";\n+ Contact: Record Contact;\n+ ServiceContractHeader: Record \"Service Contract Header\";\n+ ServiceContractLine: Record \"Service Contract Line\";\n+ ShiptoAddress: Record \"Ship-to Address\";\n+ ServContractManagement: Codeunit ServContractManagement;\n+ ContactCard: TestPage \"Contact Card\";\n+ begin\n+ // [SCENARIO 578655] Change Customer No. on Service Contract of Customer type Person.\n+ Initialize();\n+\n+ // [GIVEN] Create Contact of type Person.\n+ LibraryMarketing.CreatePersonContact(Contact);\n+\n+ // [GIVEN] Open Contact Card and invoke Create Customer.\n+ ContactCard.OpenEdit();\n+ ContactCard.Filter.SetFilter(\"No.\", Contact.\"No.\");\n+ ContactCard.CreateCustomer.Invoke();\n+\n+ // [GIVEN] Create Service Contract Header and Service Contract Line.\n+ CreateServiceContract(ServiceContractHeader, ServiceContractLine, ServiceContractHeader.\"Contract Type\"::Contract);\n+ ModifyServiceContractHeader(ServiceContractHeader, ServiceContractHeader.\"Service Period\");\n+\n+ // [GIVEN] Find Contact Business Relation of the Contact.\n+ ContactBusinessRelation.SetRange(\"Contact No.\", Contact.\"No.\");\n+ ContactBusinessRelation.SetRange(\"Link to Table\", ContactBusinessRelation.\"Link to Table\"::Customer);\n+ ContactBusinessRelation.FindFirst();\n+\n+ // [GIVEN] Create Ship to Address.\n+ LibrarySales.CreateShipToAddress(ShiptoAddress, ContactBusinessRelation.\"No.\");\n+\n+ // [WHEN] Change Customer No. in Service Contract.\n+ ServiceContractHeader.Validate(\"Customer No.\", ShiptoAddress.\"Customer No.\");\n+\n+ // [THEN] Check Customer No. is updated.\n+ CheckChangeCustomerNo(ServiceContractHeader, ContactBusinessRelation.\"No.\");\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n@@ -5358,6 +5404,11 @@ codeunit 136102 \"Service Contracts\"\n Error(MessageText);\n end;\n \n+ [MessageHandler]\n+ procedure MessageHandler(Message: Text[1024])\n+ begin\n+ end;\n+\n [ConfirmHandler]\n [Scope('OnPrem')]\n procedure InvoiceConfirmHandler(ConfirmMessage: Text[1024]; var Result: Boolean)\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Service/Contract/ServiceContractHeader.Table.al b/App/Layers/W1/BaseApp/Service/Contract/ServiceContractHeader.Table.al\nindex 4f315c8f604..572b132d573 100644\n--- a/App/Layers/W1/BaseApp/Service/Contract/ServiceContractHeader.Table.al\n+++ b/App/Layers/W1/BaseApp/Service/Contract/ServiceContractHeader.Table.al\n@@ -1389,7 +1389,7 @@ table 5965 \"Service Contract Header\"\n if (\"Bill-to Customer No.\" <> '') and (\"Bill-to Contact No.\" <> '') then begin\n Cont.Get(\"Bill-to Contact No.\");\n if ContBusinessRelation.FindByRelation(ContBusinessRelation.\"Link to Table\"::Customer, \"Bill-to Customer No.\") then\n- if ContBusinessRelation.\"Contact No.\" <> Cont.\"Company No.\" then\n+ if (ContBusinessRelation.\"Contact No.\" <> Cont.\"Company No.\") and (Cont.Type = Cont.Type::Company) then\n Error(Text045, Cont.\"No.\", Cont.Name, \"Bill-to Customer No.\");\n end;\n \n@@ -2240,6 +2240,7 @@ table 5965 \"Service Contract Header\"\n ContBusinessRelation: Record \"Contact Business Relation\";\n Cust: Record Customer;\n Cont: Record Contact;\n+ ContactBusinessRelationFound: Boolean;\n IsHandled: Boolean;\n begin\n IsHandled := false;\n@@ -2247,6 +2248,8 @@ table 5965 \"Service Contract Header\"\n OnBeforeSetContactNoForServContract(Rec, Cont, IsHandled);\n if IsHandled then\n exit;\n+ if CurrFieldNo = FieldNo(\"Customer No.\") then\n+ ServContractManagement.ChangeCustNoOnServContract(\"Customer No.\", \"Ship-to Code\", Rec);\n if Cont.Get(ContactNo) then begin\n \"Contact No.\" := Cont.\"No.\";\n \"Phone No.\" := Cont.\"Phone No.\";\n@@ -2251,13 +2254,18 @@ table 5965 \"Service Contract Header\"\n \"Contact No.\" := Cont.\"No.\";\n \"Phone No.\" := Cont.\"Phone No.\";\n \"E-Mail\" := Cont.\"E-Mail\";\n- if Cont.Type = Cont.Type::Person then\n- \"Contact Name\" := Cont.Name\n- else\n+ if Cont.Type = Cont.Type::Person then begin\n+ \"Contact Name\" := Cont.Name;\n+ ContactBusinessRelationFound := ContBusinessRelation.FindByContact(ContBusinessRelation.\"Link to Table\"::Customer, Cont.\"No.\");\n+ end else begin\n+ if not ContactBusinessRelationFound then\n+ ContactBusinessRelationFound := ContBusinessRelation.FindByContact(ContBusinessRelation.\"Link to Table\"::Customer, Cont.\"Company No.\");\n+\n if Cust.Get(\"Customer No.\") then\n \"Contact Name\" := Cust.Contact\n else\n \"Contact Name\" := ''\n+ end;\n end else begin\n \"Contact Name\" := '';\n \"Phone No.\" := '';\n@@ -2265,7 +2273,7 @@ table 5965 \"Service Contract Header\"\n exit;\n end;\n \n- if ContBusinessRelation.FindByContact(ContBusinessRelation.\"Link to Table\"::Customer, Cont.\"Company No.\") then begin\n+ if ContactBusinessRelationFound then begin\n if (\"Customer No.\" <> '') and\n (\"Customer No.\" <> ContBusinessRelation.\"No.\")\n then\n@@ -2289,23 +2297,29 @@ table 5965 \"Service Contract Header\"\n ContBusinessRelation: Record \"Contact Business Relation\";\n Cust: Record Customer;\n Cont: Record Contact;\n+ ContactBusinessRelationFound: Boolean;\n begin\n if Cont.Get(ContactNo) then begin\n \"Bill-to Contact No.\" := Cont.\"No.\";\n- if Cont.Type = Cont.Type::Person then\n- \"Bill-to Contact\" := Cont.Name\n- else\n+ if Cont.Type = Cont.Type::Person then begin\n+ \"Bill-to Contact\" := Cont.Name;\n+ ContactBusinessRelationFound := ContBusinessRelation.FindByContact(ContBusinessRelation.\"Link to Table\"::Customer, Cont.\"No.\");\n+ end else begin\n+ if not ContactBusinessRelationFound then\n+ ContactBusinessRelationFound := ContBusinessRelation.FindByContact(ContBusinessRelation.\"Link to Table\"::Customer, Cont.\"Company No.\");\n+\n if Cust.Get(\"Bill-to Customer No.\") then\n \"Bill-to Contact\" := Cust.Contact\n else\n \"Bill-to Contact\" := '';\n+ end;\n end else begin\n \"Bill-to Contact\" := '';\n exit;\n end;\n \n OnUpdateBillToCustOnBeforeContBusinessRelationFindByContact(Rec, Cust, Cont);\n- if ContBusinessRelation.FindByContact(ContBusinessRelation.\"Link to Table\"::Customer, Cont.\"Company No.\") then begin\n+ if ContactBusinessRelationFound then begin\n if \"Bill-to Customer No.\" = '' then begin\n SkipBillToContact := true;\n Validate(\"Bill-to Customer No.\", ContBusinessRelation.\"No.\");\n"} +{"instance_id": "microsoftInternal__NAV-213629__cf-1", "base_instance_id": "microsoftInternal__NAV-213629", "variant_description": "System-Created Entry should only be set to false when planning line Type is Item", "intervention_type": "Validation Semantics", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-213629__cf-1", "FAIL_TO_PASS": [{"codeunitID": 136306, "functionName": ["CopyJobAndCreateProjectJournalLineWithoutError"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/Job/JobInvoicing.Codeunit.al b/App/Layers/W1/Tests/Job/JobInvoicing.Codeunit.al\n--- a/App/Layers/W1/Tests/Job/JobInvoicing.Codeunit.al\n+++ b/App/Layers/W1/Tests/Job/JobInvoicing.Codeunit.al\n@@ -58,6 +58,7 @@\n DetailLevel: Option All,\"Per Job\",\"Per Job Task\",\"Per Job Planning Line\";\n LineDiscountPctErr: Label '%1 should be %2', Comment = '%1 = Field Caption, %2 = Field Value';\n WrongNoOfLinesLbl: Label 'Wrong number of lines created.';\n+ ValueNotTrueErr: Label 'Value must be equal to true';\n \n [Test]\n [HandlerFunctions('TransferToInvoiceHandler,MessageHandler')]\n@@ -4041,6 +4042,44 @@\n \n \n Assert.AreEqual(1, InvoicesList.Count, WrongNoOfLinesLbl);\n+ end;\n+\n+ [Test]\n+ [HandlerFunctions('MessageHandler,ConfirmHandler')]\n+ [Scope('OnPrem')]\n+ procedure CopyJobAndCreateProjectJournalLineWithoutError()\n+ var\n+ Job: Record Job;\n+ JobPlanningLine: Record \"Job Planning Line\";\n+ JobTask: Record \"Job Task\";\n+ JobJournalLine: Record \"Job Journal Line\";\n+ CopyJob: Codeunit \"Copy Job\";\n+ JobLineType: Enum \"Job Line Type\";\n+ TargetJobNo: Code[20];\n+ begin\n+ // [SCENARIO 573397] Copy project: System-Created Entry should only be cleared when Type is Item\n+ Initialize();\n+\n+ // [GIVEN] Create Job with Customer\n+ CreateJobWithCustomer(Job);\n+\n+ // [GIVEN] Create Job Task\n+ LibraryJob.CreateJobTask(Job, JobTask);\n+\n+ // [GIVEN] Create Job Journal Line of type \"Both Budget and Billable\" and post it.\n+ CreateAndPostJobJournalLineWithIteAndType(JobJournalLine, JobTask, JobLineType::\"Both Budget and Billable\");\n+\n+ // [GIVEN] Create target Job Id\n+ TargetJobNo := LibraryUtility.GenerateGUID();\n+\n+ // [WHEN] Copy Job by setting Copy Quantity as true.\n+ CopyJob.SetCopyOptions(false, true, false, 0, 0, 0);\n+ CopyJob.CopyJob(Job, TargetJobNo, TargetJobNo, Job.\"Bill-to Customer No.\", '');\n+\n+ // [THEN] Find the created Job Planning Line and \"System-Created Entry\" should remain true for non-Item type\n+ JobPlanningLine.SetRange(\"Job No.\", TargetJobNo);\n+ JobPlanningLine.FindFirst();\n+ Assert.IsTrue(JobPlanningLine.\"System-Created Entry\", ValueNotTrueErr);\n end;\n \n local procedure Initialize()\n@@ -5676,6 +5715,20 @@\n until JobPlanningLine.Next() = 0;\n end;\n \n+ local procedure CreateAndPostJobJournalLineWithIteAndType(var JobJournalLine: Record \"Job Journal Line\"; JobTask: Record \"Job Task\"; JobLineType: Enum \"Job Line Type\")\n+ var\n+ Resource: Record Resource;\n+ begin\n+ LibraryResource.CreateResourceNew(Resource);\n+ LibraryJob.CreateJobJournalLine(JobLineType, JobTask, JobJournalLine);\n+ JobJournalLine.Validate(Type, JobJournalLine.Type::Resource);\n+ JobJournalLine.Validate(\"No.\", Resource.\"No.\");\n+ JobJournalLine.Validate(Quantity, LibraryRandom.RandInt(100));\n+ JobJournalLine.Modify(true);\n+\n+ LibraryJob.PostJobJournal(JobJournalLine);\n+ end;\n+\n [RequestPageHandler]\n [Scope('OnPrem')]\n procedure TransferSalesCreditMemoReportWithDatesHandler(var JobTransferToCreditMemo: TestRequestPage \"Job Transfer to Credit Memo\")\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Projects/Project/Job/CopyJob.Codeunit.al b/App/Layers/W1/BaseApp/Projects/Project/Job/CopyJob.Codeunit.al\n--- a/App/Layers/W1/BaseApp/Projects/Project/Job/CopyJob.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Projects/Project/Job/CopyJob.Codeunit.al\n@@ -192,6 +192,8 @@\n TargetJobPlanningLine.\"Completely Picked\" := false;\n TargetJobPlanningLine.\"Ledger Entry No.\" := 0;\n TargetJobPlanningLine.\"Ledger Entry Type\" := TargetJobPlanningLine.\"Ledger Entry Type\"::\" \";\n+ if TargetJobPlanningLine.Type = TargetJobPlanningLine.Type::Item then\n+ TargetJobPlanningLine.\"System-Created Entry\" := false;\n OnCopyJobPlanningLinesOnBeforeTargetJobPlanningLineInsert(TargetJobPlanningLine, SourceJobPlanningLine);\n TargetJobPlanningLine.Insert(true);\n OnCopyJobPlanningLinesOnAfterTargetJobPlanningLineInsert(TargetJobPlanningLine, SourceJobPlanningLine);\n"} +{"instance_id": "microsoftInternal__NAV-213629__cf-2", "base_instance_id": "microsoftInternal__NAV-213629", "variant_description": "System-Created Entry should be set to false only when Copy Quantity is enabled", "intervention_type": "Workflow Composition", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-213629__cf-2", "FAIL_TO_PASS": [{"codeunitID": 136306, "functionName": ["CopyJobAndCreateProjectJournalLineWithoutError"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/Job/JobInvoicing.Codeunit.al b/App/Layers/W1/Tests/Job/JobInvoicing.Codeunit.al\n--- a/App/Layers/W1/Tests/Job/JobInvoicing.Codeunit.al\n+++ b/App/Layers/W1/Tests/Job/JobInvoicing.Codeunit.al\n@@ -58,6 +58,7 @@\n DetailLevel: Option All,\"Per Job\",\"Per Job Task\",\"Per Job Planning Line\";\n LineDiscountPctErr: Label '%1 should be %2', Comment = '%1 = Field Caption, %2 = Field Value';\n WrongNoOfLinesLbl: Label 'Wrong number of lines created.';\n+ ValueNotTrueErr: Label 'Value must be equal to true';\n \n [Test]\n [HandlerFunctions('TransferToInvoiceHandler,MessageHandler')]\n@@ -4041,6 +4042,44 @@\n \n \n Assert.AreEqual(1, InvoicesList.Count, WrongNoOfLinesLbl);\n+ end;\n+\n+ [Test]\n+ [HandlerFunctions('MessageHandler,ConfirmHandler')]\n+ [Scope('OnPrem')]\n+ procedure CopyJobAndCreateProjectJournalLineWithoutError()\n+ var\n+ Job: Record Job;\n+ JobPlanningLine: Record \"Job Planning Line\";\n+ JobTask: Record \"Job Task\";\n+ JobJournalLine: Record \"Job Journal Line\";\n+ CopyJob: Codeunit \"Copy Job\";\n+ JobLineType: Enum \"Job Line Type\";\n+ TargetJobNo: Code[20];\n+ begin\n+ // [SCENARIO 573397] Copy project: System-Created Entry should only be cleared when Copy Quantity is enabled\n+ Initialize();\n+\n+ // [GIVEN] Create Job with Customer\n+ CreateJobWithCustomer(Job);\n+\n+ // [GIVEN] Create Job Task\n+ LibraryJob.CreateJobTask(Job, JobTask);\n+\n+ // [GIVEN] Create Job Journal Line of type \"Both Budget and Billable\" and post it.\n+ CreateAndPostJobJournalLineWithIteAndType(JobJournalLine, JobTask, JobLineType::\"Both Budget and Billable\");\n+\n+ // [GIVEN] Create target Job Id\n+ TargetJobNo := LibraryUtility.GenerateGUID();\n+\n+ // [WHEN] Copy Job by setting Copy Quantity as false.\n+ CopyJob.SetCopyOptions(false, false, false, 0, 0, 0);\n+ CopyJob.CopyJob(Job, TargetJobNo, TargetJobNo, Job.\"Bill-to Customer No.\", '');\n+\n+ // [THEN] Find the created Job Planning Line and \"System-Created Entry\" should remain true when Copy Quantity is disabled\n+ JobPlanningLine.SetRange(\"Job No.\", TargetJobNo);\n+ JobPlanningLine.FindFirst();\n+ Assert.IsTrue(JobPlanningLine.\"System-Created Entry\", ValueNotTrueErr);\n end;\n \n local procedure Initialize()\n@@ -5676,6 +5715,20 @@\n until JobPlanningLine.Next() = 0;\n end;\n \n+ local procedure CreateAndPostJobJournalLineWithIteAndType(var JobJournalLine: Record \"Job Journal Line\"; JobTask: Record \"Job Task\"; JobLineType: Enum \"Job Line Type\")\n+ var\n+ Item: Record Item;\n+ begin\n+ LibraryInventory.CreateItem(Item);\n+ LibraryJob.CreateJobJournalLine(JobLineType, JobTask, JobJournalLine);\n+ JobJournalLine.Validate(Type, JobJournalLine.Type::Item);\n+ JobJournalLine.Validate(\"No.\", Item.\"No.\");\n+ JobJournalLine.Validate(Quantity, LibraryRandom.RandInt(100));\n+ JobJournalLine.Modify(true);\n+\n+ LibraryJob.PostJobJournal(JobJournalLine);\n+ end;\n+\n [RequestPageHandler]\n [Scope('OnPrem')]\n procedure TransferSalesCreditMemoReportWithDatesHandler(var JobTransferToCreditMemo: TestRequestPage \"Job Transfer to Credit Memo\")\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Projects/Project/Job/CopyJob.Codeunit.al b/App/Layers/W1/BaseApp/Projects/Project/Job/CopyJob.Codeunit.al\n--- a/App/Layers/W1/BaseApp/Projects/Project/Job/CopyJob.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Projects/Project/Job/CopyJob.Codeunit.al\n@@ -192,6 +192,8 @@\n TargetJobPlanningLine.\"Completely Picked\" := false;\n TargetJobPlanningLine.\"Ledger Entry No.\" := 0;\n TargetJobPlanningLine.\"Ledger Entry Type\" := TargetJobPlanningLine.\"Ledger Entry Type\"::\" \";\n+ if CopyQuantity then\n+ TargetJobPlanningLine.\"System-Created Entry\" := false;\n OnCopyJobPlanningLinesOnBeforeTargetJobPlanningLineInsert(TargetJobPlanningLine, SourceJobPlanningLine);\n TargetJobPlanningLine.Insert(true);\n OnCopyJobPlanningLinesOnAfterTargetJobPlanningLineInsert(TargetJobPlanningLine, SourceJobPlanningLine);\n"} +{"instance_id": "microsoftInternal__NAV-213629__cf-3", "base_instance_id": "microsoftInternal__NAV-213629", "variant_description": "System-Created Entry should be set to false only when source line type is Both Budget and Billable", "intervention_type": "Ecosystem Constraint", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-213629__cf-3", "FAIL_TO_PASS": [{"codeunitID": 136306, "functionName": ["CopyJobAndCreateProjectJournalLineWithoutError"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/Job/JobInvoicing.Codeunit.al b/App/Layers/W1/Tests/Job/JobInvoicing.Codeunit.al\n--- a/App/Layers/W1/Tests/Job/JobInvoicing.Codeunit.al\n+++ b/App/Layers/W1/Tests/Job/JobInvoicing.Codeunit.al\n@@ -58,6 +58,7 @@\n DetailLevel: Option All,\"Per Job\",\"Per Job Task\",\"Per Job Planning Line\";\n LineDiscountPctErr: Label '%1 should be %2', Comment = '%1 = Field Caption, %2 = Field Value';\n WrongNoOfLinesLbl: Label 'Wrong number of lines created.';\n+ ValueNotTrueErr: Label 'Value must be equal to true';\n \n [Test]\n [HandlerFunctions('TransferToInvoiceHandler,MessageHandler')]\n@@ -4041,6 +4042,44 @@\n \n \n Assert.AreEqual(1, InvoicesList.Count, WrongNoOfLinesLbl);\n+ end;\n+\n+ [Test]\n+ [HandlerFunctions('MessageHandler,ConfirmHandler')]\n+ [Scope('OnPrem')]\n+ procedure CopyJobAndCreateProjectJournalLineWithoutError()\n+ var\n+ Job: Record Job;\n+ JobPlanningLine: Record \"Job Planning Line\";\n+ JobTask: Record \"Job Task\";\n+ JobJournalLine: Record \"Job Journal Line\";\n+ CopyJob: Codeunit \"Copy Job\";\n+ JobLineType: Enum \"Job Line Type\";\n+ TargetJobNo: Code[20];\n+ begin\n+ // [SCENARIO 573397] Copy project: System-Created Entry should only be cleared for Both Budget and Billable lines\n+ Initialize();\n+\n+ // [GIVEN] Create Job with Customer\n+ CreateJobWithCustomer(Job);\n+\n+ // [GIVEN] Create Job Task\n+ LibraryJob.CreateJobTask(Job, JobTask);\n+\n+ // [GIVEN] Create Job Journal Line of type \"Billable\" and post it.\n+ CreateAndPostJobJournalLineWithIteAndType(JobJournalLine, JobTask, JobLineType::Billable);\n+\n+ // [GIVEN] Create target Job Id\n+ TargetJobNo := LibraryUtility.GenerateGUID();\n+\n+ // [WHEN] Copy Job by setting Copy Quantity as true.\n+ CopyJob.SetCopyOptions(false, true, false, 0, 0, 0);\n+ CopyJob.CopyJob(Job, TargetJobNo, TargetJobNo, Job.\"Bill-to Customer No.\", '');\n+\n+ // [THEN] Find the created Job Planning Line and \"System-Created Entry\" should remain true for non-Both Budget and Billable lines\n+ JobPlanningLine.SetRange(\"Job No.\", TargetJobNo);\n+ JobPlanningLine.FindFirst();\n+ Assert.IsTrue(JobPlanningLine.\"System-Created Entry\", ValueNotTrueErr);\n end;\n \n local procedure Initialize()\n@@ -5676,6 +5715,20 @@\n until JobPlanningLine.Next() = 0;\n end;\n \n+ local procedure CreateAndPostJobJournalLineWithIteAndType(var JobJournalLine: Record \"Job Journal Line\"; JobTask: Record \"Job Task\"; JobLineType: Enum \"Job Line Type\")\n+ var\n+ Item: Record Item;\n+ begin\n+ LibraryInventory.CreateItem(Item);\n+ LibraryJob.CreateJobJournalLine(JobLineType, JobTask, JobJournalLine);\n+ JobJournalLine.Validate(Type, JobJournalLine.Type::Item);\n+ JobJournalLine.Validate(\"No.\", Item.\"No.\");\n+ JobJournalLine.Validate(Quantity, LibraryRandom.RandInt(100));\n+ JobJournalLine.Modify(true);\n+\n+ LibraryJob.PostJobJournal(JobJournalLine);\n+ end;\n+\n [RequestPageHandler]\n [Scope('OnPrem')]\n procedure TransferSalesCreditMemoReportWithDatesHandler(var JobTransferToCreditMemo: TestRequestPage \"Job Transfer to Credit Memo\")\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Projects/Project/Job/CopyJob.Codeunit.al b/App/Layers/W1/BaseApp/Projects/Project/Job/CopyJob.Codeunit.al\n--- a/App/Layers/W1/BaseApp/Projects/Project/Job/CopyJob.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Projects/Project/Job/CopyJob.Codeunit.al\n@@ -192,6 +192,8 @@\n TargetJobPlanningLine.\"Completely Picked\" := false;\n TargetJobPlanningLine.\"Ledger Entry No.\" := 0;\n TargetJobPlanningLine.\"Ledger Entry Type\" := TargetJobPlanningLine.\"Ledger Entry Type\"::\" \";\n+ if SourceJobPlanningLine.\"Line Type\" = SourceJobPlanningLine.\"Line Type\"::\"Both Budget and Billable\" then\n+ TargetJobPlanningLine.\"System-Created Entry\" := false;\n OnCopyJobPlanningLinesOnBeforeTargetJobPlanningLineInsert(TargetJobPlanningLine, SourceJobPlanningLine);\n TargetJobPlanningLine.Insert(true);\n OnCopyJobPlanningLinesOnAfterTargetJobPlanningLineInsert(TargetJobPlanningLine, SourceJobPlanningLine);\n"} +{"instance_id": "microsoftInternal__NAV-213524__cf-1", "base_instance_id": "microsoftInternal__NAV-213524", "variant_description": "Only navigate to Credit Memo when Document No. is not empty", "intervention_type": "Execution / Validation Semantics", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-213524__cf-1", "FAIL_TO_PASS": [{"codeunitID": 134154, "functionName": ["ICNavigateFromSalesCreditMemoLine"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/ERMIntercompanyIII.Codeunit.al b/App/Layers/W1/Tests/ERM/ERMIntercompanyIII.Codeunit.al\nindex 0480aea9fa6..cf00000001 100644\n--- a/App/Layers/W1/Tests/ERM/ERMIntercompanyIII.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ERMIntercompanyIII.Codeunit.al\n@@ -3408,6 +3408,43 @@ codeunit 134154 \"ERM Intercompany III\"\n Assert.AreEqual(300, SalesLine.\"Line Amount\", 'When a sales order with a discount amount and prices including VAT is received from intercompany, the line amount should be preserved');\n end;\n\n+ [Test]\n+ procedure ICNavigateFromSalesCreditMemoLine()\n+ var\n+ Customer: Record Customer;\n+ SalesHeader: Record \"Sales Header\";\n+ SalesLine: Record \"Sales Line\";\n+ ICOutboxTransactions: TestPage \"IC Outbox Transactions\";\n+ PostedSalesCreditMemo: TestPage \"Posted Sales Credit Memo\";\n+ begin\n+ // [SCENARIO 574577] \"Unable to navigate to the related document\" error message if you use Go to Document from the Intercompany Outbox Transactions for a Credit Memo.\n+ Initialize();\n+ LibraryApplicationArea.EnableEssentialSetup();\n+ CleanupIC(false, true, true, false);\n+ CreateCustomerWithICPartner(Customer);\n+\n+ // [GIVEN] A posted sales credit memo to an IC customer\n+ LibrarySales.CreateSalesHeader(SalesHeader, SalesHeader.\"Document Type\"::\"Credit Memo\", Customer.\"No.\");\n+ LibrarySales.CreateSalesLine(SalesLine, SalesHeader, SalesLine.Type::Item, LibraryInventory.CreateItemNo(), 1);\n+ LibrarySales.PostSalesDocument(SalesHeader, true, true);\n+\n+ // [GIVEN] The posted sales credit memo IC transaction should be on the Outbox\n+ ICOutboxTransactions.OpenEdit();\n+\n+ // [WHEN] Navigating from Outbox for this transaction\n+ PostedSalesCreditMemo.Trap();\n+ ICOutboxTransactions.GoToDocument.Invoke();\n+\n+ // [THEN] It should open the Posted Sales Credit Memo\n+ PostedSalesCreditMemo.\"Pre-Assigned No.\".AssertEquals(SalesHeader.\"No.\");\n+\n+ // [WHEN] Document No. is empty\n+ SalesHeader.\"No.\" := '';\n+ ICOutboxTransactions.GoToDocument.Invoke();\n+\n+ // Cleanup\n+ CleanupIC(false, true, true, false);\n+ end;\n+\n local procedure Initialize()\n var\n ICSetup: Record \"IC Setup\";", "patch": "diff --git a/App/Layers/W1/BaseApp/Finance/Intercompany/ICNavigation.Codeunit.al b/App/Layers/W1/BaseApp/Finance/Intercompany/ICNavigation.Codeunit.al\nindex 92bf43b1d84..cf00000001 100644\n--- a/App/Layers/W1/BaseApp/Finance/Intercompany/ICNavigation.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Finance/Intercompany/ICNavigation.Codeunit.al\n@@ -56,6 +56,20 @@ codeunit 437 \"IC Navigation\"\n exit(true);\n end;\n\n+ local procedure NavigateToSalesCreditMemo(DocumentNo: Code[20]): Boolean\n+ var\n+ SalesCrMemoHeader: Record \"Sales Cr.Memo Header\";\n+ PostedSalesCreditMemo: Page \"Posted Sales Credit Memo\";\n+ begin\n+ // An IC Transaction of type Sales Credit Memo can only be sent when posted.\n+ if (DocumentNo = '') or not SalesCrMemoHeader.Get(DocumentNo) then\n+ exit(false);\n+ // The related document is a Posted Sales Credit Memo.\n+ PostedSalesCreditMemo.SetRecord(SalesCrMemoHeader);\n+ PostedSalesCreditMemo.Run();\n+ exit(true);\n+ end;\n+\n local procedure NavigateToSalesInvoice(DocumentNo: Code[20]; ICPartnerCode: Code[20]): Boolean\n var\n Customer: Record Customer;\n@@ -120,6 +134,8 @@ codeunit 437 \"IC Navigation\"\n exit(NavigateToSalesOrderDocument(DocumentNo, ICDirectionType, ICPartnerCode));\n DocumentType::Invoice:\n exit(NavigateToSalesInvoice(DocumentNo));\n+ DocumentType::\"Credit Memo\":\n+ exit(NavigateToSalesCreditMemo(DocumentNo));\n else begin\n ShouldNavigateToDoc := false;\n OnNavigateToSalesDocumentOnAfterCheckDocumentType(DocumentNo, ICDirectionType, ICPartnerCode, DocumentType, ShouldNavigateToDoc);"} +{"instance_id": "microsoftInternal__NAV-213524__cf-2", "base_instance_id": "microsoftInternal__NAV-213524", "variant_description": "Navigation should only work for handled (processed) Outbox transactions", "intervention_type": "Workflow / Business Logic Composition", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-213524__cf-2", "FAIL_TO_PASS": [{"codeunitID": 134154, "functionName": ["ICNavigateFromSalesCreditMemoLine"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/ERMIntercompanyIII.Codeunit.al b/App/Layers/W1/Tests/ERM/ERMIntercompanyIII.Codeunit.al\nindex 0480aea9fa6..cf00000001 100644\n--- a/App/Layers/W1/Tests/ERM/ERMIntercompanyIII.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ERMIntercompanyIII.Codeunit.al\n@@ -3408,6 +3408,42 @@ codeunit 134154 \"ERM Intercompany III\"\n Assert.AreEqual(300, SalesLine.\"Line Amount\", 'When a sales order with a discount amount and prices including VAT is received from intercompany, the line amount should be preserved');\n end;\n\n+ [Test]\n+ procedure ICNavigateFromSalesCreditMemoLine()\n+ var\n+ Customer: Record Customer;\n+ SalesHeader: Record \"Sales Header\";\n+ SalesLine: Record \"Sales Line\";\n+ ICOutboxTransactions: TestPage \"IC Outbox Transactions\";\n+ PostedSalesCreditMemo: TestPage \"Posted Sales Credit Memo\";\n+ begin\n+ // [SCENARIO 574577] \"Unable to navigate to the related document\" error message if you use Go to Document from the Intercompany Outbox Transactions for a Credit Memo.\n+ Initialize();\n+ LibraryApplicationArea.EnableEssentialSetup();\n+ CleanupIC(false, true, true, false);\n+ CreateCustomerWithICPartner(Customer);\n+\n+ // [GIVEN] A posted sales credit memo to an IC customer\n+ LibrarySales.CreateSalesHeader(SalesHeader, SalesHeader.\"Document Type\"::\"Credit Memo\", Customer.\"No.\");\n+ LibrarySales.CreateSalesLine(SalesLine, SalesHeader, SalesLine.Type::Item, LibraryInventory.CreateItemNo(), 1);\n+ LibrarySales.PostSalesDocument(SalesHeader, true, true);\n+\n+ // [GIVEN] The posted sales credit memo IC transaction should be on the Outbox\n+ ICOutboxTransactions.OpenEdit();\n+\n+ // [GIVEN] Transaction is not handled\n+ ICOutboxTransactions.Filter.SetFilter(Status, 'Open');\n+\n+ // [WHEN] Navigating from Outbox for this transaction\n+ PostedSalesCreditMemo.Trap();\n+ ICOutboxTransactions.GoToDocument.Invoke();\n+\n+ // [THEN] It should open the Posted Sales Credit Memo\n+ PostedSalesCreditMemo.\"Pre-Assigned No.\".AssertEquals(SalesHeader.\"No.\");\n+\n+ // Cleanup\n+ CleanupIC(false, true, true, false);\n+ end;\n+\n local procedure Initialize()\n var\n ICSetup: Record \"IC Setup\";", "patch": "diff --git a/App/Layers/W1/BaseApp/Finance/Intercompany/ICNavigation.Codeunit.al b/App/Layers/W1/BaseApp/Finance/Intercompany/ICNavigation.Codeunit.al\nindex 92bf43b1d84..cf00000001 100644\n--- a/App/Layers/W1/BaseApp/Finance/Intercompany/ICNavigation.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Finance/Intercompany/ICNavigation.Codeunit.al\n@@ -56,6 +56,23 @@ codeunit 437 \"IC Navigation\"\n exit(true);\n end;\n\n+ local procedure NavigateToSalesCreditMemo(DocumentNo: Code[20]): Boolean\n+ var\n+ ICOutboxTrans: Record \"IC Outbox Transaction\";\n+ SalesCrMemoHeader: Record \"Sales Cr.Memo Header\";\n+ PostedSalesCreditMemo: Page \"Posted Sales Credit Memo\";\n+ begin\n+ // An IC Transaction of type Sales Credit Memo can only be sent when posted.\n+ if ICOutboxTrans.Status <> ICOutboxTrans.Status::Handled then\n+ exit(false);\n+ if not SalesCrMemoHeader.Get(DocumentNo) then\n+ exit(false);\n+ // The related document is a Posted Sales Credit Memo.\n+ PostedSalesCreditMemo.SetRecord(SalesCrMemoHeader);\n+ PostedSalesCreditMemo.Run();\n+ exit(true);\n+ end;\n+\n local procedure NavigateToSalesInvoice(DocumentNo: Code[20]; ICPartnerCode: Code[20]): Boolean\n var\n Customer: Record Customer;\n@@ -120,6 +134,8 @@ codeunit 437 \"IC Navigation\"\n exit(NavigateToSalesOrderDocument(DocumentNo, ICDirectionType, ICPartnerCode));\n DocumentType::Invoice:\n exit(NavigateToSalesInvoice(DocumentNo));\n+ DocumentType::\"Credit Memo\":\n+ exit(NavigateToSalesCreditMemo(DocumentNo));\n else begin\n ShouldNavigateToDoc := false;\n OnNavigateToSalesDocumentOnAfterCheckDocumentType(DocumentNo, ICDirectionType, ICPartnerCode, DocumentType, ShouldNavigateToDoc);"} +{"instance_id": "microsoftInternal__NAV-213524__cf-3", "base_instance_id": "microsoftInternal__NAV-213524", "variant_description": "Navigation to Credit Memo only occurs if the document exists; otherwise navigation fails silently", "intervention_type": "Event-Driven Paradigm", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-213524__cf-3", "FAIL_TO_PASS": [{"codeunitID": 134154, "functionName": ["ICNavigateFromSalesCreditMemoLine"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/ERMIntercompanyIII.Codeunit.al b/App/Layers/W1/Tests/ERM/ERMIntercompanyIII.Codeunit.al\nindex 0480aea9fa6..cf00000001 100644\n--- a/App/Layers/W1/Tests/ERM/ERMIntercompanyIII.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ERMIntercompanyIII.Codeunit.al\n@@ -3408,6 +3408,42 @@ codeunit 134154 \"ERM Intercompany III\"\n Assert.AreEqual(300, SalesLine.\"Line Amount\", 'When a sales order with a discount amount and prices including VAT is received from intercompany, the line amount should be preserved');\n end;\n\n+ [Test]\n+ procedure ICNavigateFromSalesCreditMemoLine()\n+ var\n+ Customer: Record Customer;\n+ SalesHeader: Record \"Sales Header\";\n+ SalesLine: Record \"Sales Line\";\n+ ICOutboxTransactions: TestPage \"IC Outbox Transactions\";\n+ PostedSalesCreditMemo: TestPage \"Posted Sales Credit Memo\";\n+ begin\n+ // [SCENARIO 574577] \"Unable to navigate to the related document\" error message if you use Go to Document from the Intercompany Outbox Transactions for a Credit Memo.\n+ Initialize();\n+ LibraryApplicationArea.EnableEssentialSetup();\n+ CleanupIC(false, true, true, false);\n+ CreateCustomerWithICPartner(Customer);\n+\n+ // [GIVEN] A posted sales credit memo to an IC customer\n+ LibrarySales.CreateSalesHeader(SalesHeader, SalesHeader.\"Document Type\"::\"Credit Memo\", Customer.\"No.\");\n+ LibrarySales.CreateSalesLine(SalesLine, SalesHeader, SalesLine.Type::Item, LibraryInventory.CreateItemNo(), 1);\n+ LibrarySales.PostSalesDocument(SalesHeader, true, true);\n+\n+ // [GIVEN] The posted sales credit memo IC transaction should be on the Outbox\n+ ICOutboxTransactions.OpenEdit();\n+\n+ // [WHEN] Navigating from Outbox for this transaction\n+ PostedSalesCreditMemo.Trap();\n+ ICOutboxTransactions.GoToDocument.Invoke();\n+\n+ // [THEN] It should open the Posted Sales Credit Memo\n+ PostedSalesCreditMemo.\"Pre-Assigned No.\".AssertEquals(SalesHeader.\"No.\");\n+\n+ // [WHEN] Navigating with a non-existing document\n+ ICOutboxTransactions.GoToDocument.Invoke();\n+\n+ // Cleanup\n+ CleanupIC(false, true, true, false);\n+ end;\n+\n local procedure Initialize()\n var\n ICSetup: Record \"IC Setup\";", "patch": "diff --git a/App/Layers/W1/BaseApp/Finance/Intercompany/ICNavigation.Codeunit.al b/App/Layers/W1/BaseApp/Finance/Intercompany/ICNavigation.Codeunit.al\nindex 92bf43b1d84..cf00000001 100644\n--- a/App/Layers/W1/BaseApp/Finance/Intercompany/ICNavigation.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Finance/Intercompany/ICNavigation.Codeunit.al\n@@ -56,6 +56,20 @@ codeunit 437 \"IC Navigation\"\n exit(true);\n end;\n\n+ local procedure NavigateToSalesCreditMemo(DocumentNo: Code[20]): Boolean\n+ var\n+ SalesCrMemoHeader: Record \"Sales Cr.Memo Header\";\n+ PostedSalesCreditMemo: Page \"Posted Sales Credit Memo\";\n+ begin\n+ // An IC Transaction of type Sales Credit Memo can only be sent when posted.\n+ if not SalesCrMemoHeader.Get(DocumentNo) then\n+ exit(false);\n+ // The related document is a Posted Sales Credit Memo.\n+ PostedSalesCreditMemo.SetRecord(SalesCrMemoHeader);\n+ PostedSalesCreditMemo.Run();\n+ exit(SalesCrMemoHeader.\"No.\" <> '');\n+ end;\n+\n local procedure NavigateToSalesInvoice(DocumentNo: Code[20]; ICPartnerCode: Code[20]): Boolean\n var\n Customer: Record Customer;\n@@ -120,6 +134,8 @@ codeunit 437 \"IC Navigation\"\n exit(NavigateToSalesOrderDocument(DocumentNo, ICDirectionType, ICPartnerCode));\n DocumentType::Invoice:\n exit(NavigateToSalesInvoice(DocumentNo));\n+ DocumentType::\"Credit Memo\":\n+ exit(NavigateToSalesCreditMemo(DocumentNo));\n else begin\n ShouldNavigateToDoc := false;\n OnNavigateToSalesDocumentOnAfterCheckDocumentType(DocumentNo, ICDirectionType, ICPartnerCode, DocumentType, ShouldNavigateToDoc);"} +{"instance_id": "microsoftInternal__NAV-213524__cf-4", "base_instance_id": "microsoftInternal__NAV-213524", "variant_description": "Navigation must support Document No. with Code[50] length instead of Code[20]", "intervention_type": "Syntax / Representation", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-213524__cf-4", "FAIL_TO_PASS": [{"codeunitID": 134154, "functionName": ["ICNavigateFromSalesCreditMemoLine"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/ERMIntercompanyIII.Codeunit.al b/App/Layers/W1/Tests/ERM/ERMIntercompanyIII.Codeunit.al\nindex 0480aea9fa6..cf00000001 100644\n--- a/App/Layers/W1/Tests/ERM/ERMIntercompanyIII.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ERMIntercompanyIII.Codeunit.al\n@@ -3408,6 +3408,42 @@ codeunit 134154 \"ERM Intercompany III\"\n Assert.AreEqual(300, SalesLine.\"Line Amount\", 'When a sales order with a discount amount and prices including VAT is received from intercompany, the line amount should be preserved');\n end;\n\n+ [Test]\n+ procedure ICNavigateFromSalesCreditMemoLine()\n+ var\n+ Customer: Record Customer;\n+ SalesHeader: Record \"Sales Header\";\n+ SalesLine: Record \"Sales Line\";\n+ ICOutboxTransactions: TestPage \"IC Outbox Transactions\";\n+ PostedSalesCreditMemo: TestPage \"Posted Sales Credit Memo\";\n+ begin\n+ // [SCENARIO 574577] \"Unable to navigate to the related document\" error message if you use Go to Document from the Intercompany Outbox Transactions for a Credit Memo.\n+ Initialize();\n+ LibraryApplicationArea.EnableEssentialSetup();\n+ CleanupIC(false, true, true, false);\n+ CreateCustomerWithICPartner(Customer);\n+\n+ // [GIVEN] A posted sales credit memo to an IC customer\n+ LibrarySales.CreateSalesHeader(SalesHeader, SalesHeader.\"Document Type\"::\"Credit Memo\", Customer.\"No.\");\n+ LibrarySales.CreateSalesLine(SalesLine, SalesHeader, SalesLine.Type::Item, LibraryInventory.CreateItemNo(), 1);\n+ LibrarySales.PostSalesDocument(SalesHeader, true, true);\n+\n+ // [GIVEN] Document No. longer than 20 characters\n+ SalesHeader.\"No.\" := CopyStr(SalesHeader.\"No.\" + 'EXTENSION', 1, 50);\n+\n+ // [GIVEN] The posted sales credit memo IC transaction should be on the Outbox\n+ ICOutboxTransactions.OpenEdit();\n+\n+ // [WHEN] Navigating from Outbox for this transaction\n+ PostedSalesCreditMemo.Trap();\n+ ICOutboxTransactions.GoToDocument.Invoke();\n+\n+ // [THEN] It should open the Posted Sales Credit Memo\n+ PostedSalesCreditMemo.\"Pre-Assigned No.\".AssertEquals(SalesHeader.\"No.\");\n+\n+ // Cleanup\n+ CleanupIC(false, true, true, false);\n+ end;\n+\n local procedure Initialize()\n var\n ICSetup: Record \"IC Setup\";", "patch": "diff --git a/App/Layers/W1/BaseApp/Finance/Intercompany/ICNavigation.Codeunit.al b/App/Layers/W1/BaseApp/Finance/Intercompany/ICNavigation.Codeunit.al\nindex 92bf43b1d84..cf00000001 100644\n--- a/App/Layers/W1/BaseApp/Finance/Intercompany/ICNavigation.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Finance/Intercompany/ICNavigation.Codeunit.al\n@@ -56,6 +56,20 @@ codeunit 437 \"IC Navigation\"\n exit(true);\n end;\n\n+ local procedure NavigateToSalesCreditMemo(DocumentNo: Code[50]): Boolean\n+ var\n+ SalesCrMemoHeader: Record \"Sales Cr.Memo Header\";\n+ PostedSalesCreditMemo: Page \"Posted Sales Credit Memo\";\n+ begin\n+ // An IC Transaction of type Sales Credit Memo can only be sent when posted.\n+ if not SalesCrMemoHeader.Get(DocumentNo) then\n+ exit(false);\n+ // The related document is a Posted Sales Credit Memo.\n+ PostedSalesCreditMemo.SetRecord(SalesCrMemoHeader);\n+ PostedSalesCreditMemo.Run();\n+ exit(true);\n+ end;\n+\n local procedure NavigateToSalesInvoice(DocumentNo: Code[20]; ICPartnerCode: Code[20]): Boolean\n var\n Customer: Record Customer;\n@@ -120,6 +134,8 @@ codeunit 437 \"IC Navigation\"\n exit(NavigateToSalesOrderDocument(DocumentNo, ICDirectionType, ICPartnerCode));\n DocumentType::Invoice:\n exit(NavigateToSalesInvoice(DocumentNo));\n+ DocumentType::\"Credit Memo\":\n+ exit(NavigateToSalesCreditMemo(DocumentNo));\n else begin\n ShouldNavigateToDoc := false;\n OnNavigateToSalesDocumentOnAfterCheckDocumentType(DocumentNo, ICDirectionType, ICPartnerCode, DocumentType, ShouldNavigateToDoc);"} +{"instance_id": "microsoftInternal__NAV-213741__cf-1", "base_instance_id": "microsoftInternal__NAV-213741", "variant_description": "Allow non-inventory cost for Assembly Output (broaden condition from Production-only to Production or Assembly)", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-213741__cf-1", "FAIL_TO_PASS": [{"codeunitID": 137911, "functionName": ["VerifyAdjustCostItemEntriesMustBeExecutedForAssemblyItem"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM-Assembly/SCMCalculateAssemblyCost.Codeunit.al b/App/Layers/W1/Tests/SCM-Assembly/SCMCalculateAssemblyCost.Codeunit.al\nindex 46d1c5d5be0..cf00000001 100644\n--- a/App/Layers/W1/Tests/SCM-Assembly/SCMCalculateAssemblyCost.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM-Assembly/SCMCalculateAssemblyCost.Codeunit.al\n@@ -40,6 +40,7 @@ codeunit 137911 \"SCM Calculate Assembly Cost\"\n LibraryTestInitialize: Codeunit \"Library - Test Initialize\";\n NotificationLifecycleMgt: Codeunit \"Notification Lifecycle Mgt.\";\n LibrarySetupStorage: Codeunit \"Library - Setup Storage\";\n+ LibraryManufacturing: Codeunit \"Library - Manufacturing\";\n WorkDate2: Date;\n TEXT_PARENT: Label 'Parent';\n TEXT_CHILD: Label 'Child';\n@@ -452,6 +453,54 @@ codeunit 137911 \"SCM Calculate Assembly Cost\"\n ComponentItem.\"Standard Cost\", ComponentItem.\"Standard Cost\" * CurrExchRate);\n end;\n \n+ [Test]\n+ [HandlerFunctions('MessageHandler')]\n+ procedure VerifyAdjustCostItemEntriesMustBeExecutedForAssemblyItem()\n+ var\n+ AssemblyItem, ComponentItem, NonInvItem : Record Item;\n+ ValueEntry: Record \"Value Entry\";\n+ begin\n+ // [SCENARIO 574360] Verify \"Adjust Cost - Item Entries\" must be executed for Assembly item which include non-Inventory item in Assembly BOM.\n+ // When \"Automatic Cost Posting\" is false in Inventory Setup and \"Inc. Non. Inv. Cost To Prod\" is true in Mfg Setup.\n+ Initialize();\n+\n+ // [GIVEN] Set Automatic Cost Posting to false.\n+ LibraryInventory.SetAutomaticCostPosting(false);\n+\n+ // [GIVEN] Update \"Inc. Non. Inv. Cost To Prod\" in Manufacturing Setup.\n+ LibraryManufacturing.UpdateNonInventoryCostToProductionInManufacturingSetup(true);\n+\n+ // [GIVEN] Create an Assembled item with \"Costing Method\"::Standard.\n+ CreateItem(AssemblyItem, AssemblyItem.\"Costing Method\"::Standard, AssemblyItem.\"Replenishment System\"::Assembly, 0);\n+\n+ // [GIVEN] Create an Component item with \"Costing Method\"::FIFO.\n+ CreateItem(ComponentItem, ComponentItem.\"Costing Method\"::FIFO, ComponentItem.\"Replenishment System\"::Purchase, LibraryRandom.RandIntInRange(100, 200));\n+\n+ // [GIVEN] Create Non-Inventory item with Unit Cost.\n+ LibraryInventory.CreateNonInventoryTypeItem(NonInvItem);\n+ NonInvItem.Validate(\"Unit Cost\", LibraryRandom.RandIntInRange(200, 500));\n+ NonInvItem.Modify();\n+\n+ // [GIVEN] Post Positive Adjustment for Component item.\n+ PostPositiveAdjustment(ComponentItem.\"No.\", LibraryRandom.RandIntInRange(200, 500));\n+\n+ // [GIVEN] Create Assembly List for Component and Non-Inventory item.\n+ CreateAssemblyListComponent(AssemblyItem.\"No.\", ComponentItem.\"No.\", 1);\n+ CreateAssemblyListComponent(AssemblyItem.\"No.\", NonInvItem.\"No.\", 1);\n+\n+ // [GIVEN] Create and post Assembly Order.\n+ CreateAndPostAssemblyHeader(AssemblyItem.\"No.\", 1, WorkDate());\n+\n+ // [WHEN] Run \"Adjust Cost - Item Entries\"\n+ LibraryCosting.AdjustCostItemEntries(AssemblyItem.\"No.\", '');\n+\n+ // [THEN] Verify non-inventory cost is included for Assembly item when allowed.\n+ ValueEntry.SetRange(\"Item Ledger Entry Type\", ValueEntry.\"Item Ledger Entry Type\"::\"Assembly Output\");\n+ ValueEntry.SetRange(\"Entry Type\", ValueEntry.\"Entry Type\"::\"Direct Cost - Non Inventory\");\n+ ValueEntry.SetRange(\"Item No.\", AssemblyItem.\"No.\");\n+ Assert.RecordCount(ValueEntry, 1);\n+ end;\n+\n local procedure Initialize()\n begin\n LibraryTestInitialize.OnTestInitialize(CODEUNIT::\"SCM Calculate Assembly Cost\");\n@@ -585,5 +634,10 @@ codeunit 137911 \"SCM Calculate Assembly Cost\"\n ItemLedgerEntry.TestField(\"Cost Amount (Actual)\", ExpectedCostLCY);\n ItemLedgerEntry.TestField(\"Cost Amount (Actual) (ACY)\", Round(ExpectedCostACY, Currency.\"Amount Rounding Precision\"));\n end;\n+\n+ [MessageHandler]\n+ procedure MessageHandler(Message: Text[1024])\n+ begin\n+ end;\n }\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Inventory/Costing/CalcInventoryAdjmtOrder.Codeunit.al b/App/Layers/W1/BaseApp/Inventory/Costing/CalcInventoryAdjmtOrder.Codeunit.al\nindex 9bc596d4312..cf00000001 100644\n--- a/App/Layers/W1/BaseApp/Inventory/Costing/CalcInventoryAdjmtOrder.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Costing/CalcInventoryAdjmtOrder.Codeunit.al\n@@ -158,10 +158,12 @@ codeunit 5896 \"Calc. Inventory Adjmt. - Order\"\n if HasNewCost(InventoryAdjmtEntryOrder.\"Indirect Cost\", InventoryAdjmtEntryOrder.\"Indirect Cost (ACY)\") then\n InventoryAdjustmentBuffer.AddCost(\n ItemLedgerEntry.\"Entry No.\", InventoryAdjustmentBuffer.\"Entry Type\"::\"Indirect Cost\", \"Cost Variance Type\"::\" \", InventoryAdjmtEntryOrder.\"Indirect Cost\", InventoryAdjmtEntryOrder.\"Indirect Cost (ACY)\");\n- if MfgCostCalcMgt.CanIncNonInvCostIntoProductionItem() then\n- if HasNewCost(InventoryAdjmtEntryOrder.\"Direct Cost Non-Inventory\", InventoryAdjmtEntryOrder.\"Direct Cost Non-Inv. (ACY)\") then\n- InventoryAdjustmentBuffer.AddCost(\n- ItemLedgerEntry.\"Entry No.\", InventoryAdjustmentBuffer.\"Entry Type\"::\"Direct Cost - Non Inventory\", \"Cost Variance Type\"::\" \", InventoryAdjmtEntryOrder.\"Direct Cost Non-Inventory\", InventoryAdjmtEntryOrder.\"Direct Cost Non-Inv. (ACY)\");\n+\n+ if ItemLedgerEntry.\"Order Type\" in [ItemLedgerEntry.\"Order Type\"::Production, ItemLedgerEntry.\"Order Type\"::Assembly] then\n+ if MfgCostCalcMgt.CanIncNonInvCostIntoProductionItem() then\n+ if HasNewCost(InventoryAdjmtEntryOrder.\"Direct Cost Non-Inventory\", InventoryAdjmtEntryOrder.\"Direct Cost Non-Inv. (ACY)\") then\n+ InventoryAdjustmentBuffer.AddCost(\n+ ItemLedgerEntry.\"Entry No.\", InventoryAdjustmentBuffer.\"Entry Type\"::\"Direct Cost - Non Inventory\", \"Cost Variance Type\"::\" \", InventoryAdjmtEntryOrder.\"Direct Cost Non-Inventory\", InventoryAdjmtEntryOrder.\"Direct Cost Non-Inv. (ACY)\");\n \n if Item.\"Costing Method\" <> Item.\"Costing Method\"::Standard then\n exit;\n@@ -171,11 +173,12 @@ codeunit 5896 \"Calc. Inventory Adjmt. - Order\"\n InventoryAdjustmentBuffer.\"Entry Type\"::Variance, InventoryAdjustmentBuffer.\"Variance Type\"::Material,\n InventoryAdjmtEntryOrder.\"Single-Level Material Cost\", InventoryAdjmtEntryOrder.\"Single-Lvl Material Cost (ACY)\");\n \n- if MfgCostCalcMgt.CanIncNonInvCostIntoProductionItem() then\n- if HasNewCost(InventoryAdjmtEntryOrder.\"Single-Lvl Mat. Non-Invt. Cost\", InventoryAdjmtEntryOrder.\"Single-Lvl Mat.NonInvCost(ACY)\") then\n- InventoryAdjustmentBuffer.AddCost(ItemLedgerEntry.\"Entry No.\",\n- InventoryAdjustmentBuffer.\"Entry Type\"::Variance, InventoryAdjustmentBuffer.\"Variance Type\"::\"Material - Non Inventory\",\n- InventoryAdjmtEntryOrder.\"Single-Lvl Mat. Non-Invt. Cost\", InventoryAdjmtEntryOrder.\"Single-Lvl Mat.NonInvCost(ACY)\");\n+ if ItemLedgerEntry.\"Order Type\" in [ItemLedgerEntry.\"Order Type\"::Production, ItemLedgerEntry.\"Order Type\"::Assembly] then\n+ if MfgCostCalcMgt.CanIncNonInvCostIntoProductionItem() then\n+ if HasNewCost(InventoryAdjmtEntryOrder.\"Single-Lvl Mat. Non-Invt. Cost\", InventoryAdjmtEntryOrder.\"Single-Lvl Mat.NonInvCost(ACY)\") then\n+ InventoryAdjustmentBuffer.AddCost(ItemLedgerEntry.\"Entry No.\",\n+ InventoryAdjustmentBuffer.\"Entry Type\"::Variance, InventoryAdjustmentBuffer.\"Variance Type\"::\"Material - Non Inventory\",\n+ InventoryAdjmtEntryOrder.\"Single-Lvl Mat. Non-Invt. Cost\", InventoryAdjmtEntryOrder.\"Single-Lvl Mat.NonInvCost(ACY)\");\n \n if HasNewCost(InventoryAdjmtEntryOrder.\"Single-Level Capacity Cost\", InventoryAdjmtEntryOrder.\"Single-Lvl Capacity Cost (ACY)\") then\n InventoryAdjustmentBuffer.AddCost(ItemLedgerEntry.\"Entry No.\",\n"} +{"instance_id": "microsoftInternal__NAV-213741__cf-2", "base_instance_id": "microsoftInternal__NAV-213741", "variant_description": "Require non-inventory cost for Assembly Output only when Expected Cost = Yes (compound condition with Expected Cost guard)", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-213741__cf-2", "FAIL_TO_PASS": [{"codeunitID": 137911, "functionName": ["VerifyAdjustCostItemEntriesMustBeExecutedForAssemblyItem"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM-Assembly/SCMCalculateAssemblyCost.Codeunit.al b/App/Layers/W1/Tests/SCM-Assembly/SCMCalculateAssemblyCost.Codeunit.al\nindex 46d1c5d5be0..cf00000002 100644\n--- a/App/Layers/W1/Tests/SCM-Assembly/SCMCalculateAssemblyCost.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM-Assembly/SCMCalculateAssemblyCost.Codeunit.al\n@@ -40,6 +40,7 @@ codeunit 137911 \"SCM Calculate Assembly Cost\"\n LibraryTestInitialize: Codeunit \"Library - Test Initialize\";\n NotificationLifecycleMgt: Codeunit \"Notification Lifecycle Mgt.\";\n LibrarySetupStorage: Codeunit \"Library - Setup Storage\";\n+ LibraryManufacturing: Codeunit \"Library - Manufacturing\";\n WorkDate2: Date;\n TEXT_PARENT: Label 'Parent';\n TEXT_CHILD: Label 'Child';\n@@ -452,6 +453,55 @@ codeunit 137911 \"SCM Calculate Assembly Cost\"\n ComponentItem.\"Standard Cost\", ComponentItem.\"Standard Cost\" * CurrExchRate);\n end;\n \n+ [Test]\n+ [HandlerFunctions('MessageHandler')]\n+ procedure VerifyAdjustCostItemEntriesMustBeExecutedForAssemblyItem()\n+ var\n+ AssemblyItem, ComponentItem, NonInvItem : Record Item;\n+ ValueEntry: Record \"Value Entry\";\n+ begin\n+ // [SCENARIO 574360] Verify \"Adjust Cost - Item Entries\" must be executed for Assembly item which include non-Inventory item in Assembly BOM.\n+ // When \"Automatic Cost Posting\" is false in Inventory Setup and \"Inc. Non. Inv. Cost To Prod\" is true in Mfg Setup.\n+ Initialize();\n+\n+ // [GIVEN] Set Automatic Cost Posting to false.\n+ LibraryInventory.SetAutomaticCostPosting(false);\n+\n+ // [GIVEN] Update \"Inc. Non. Inv. Cost To Prod\" in Manufacturing Setup.\n+ LibraryManufacturing.UpdateNonInventoryCostToProductionInManufacturingSetup(true);\n+\n+ // [GIVEN] Create an Assembled item with \"Costing Method\"::Standard.\n+ CreateItem(AssemblyItem, AssemblyItem.\"Costing Method\"::Standard, AssemblyItem.\"Replenishment System\"::Assembly, 0);\n+\n+ // [GIVEN] Create an Component item with \"Costing Method\"::FIFO.\n+ CreateItem(ComponentItem, ComponentItem.\"Costing Method\"::FIFO, ComponentItem.\"Replenishment System\"::Purchase, LibraryRandom.RandIntInRange(100, 200));\n+\n+ // [GIVEN] Create Non-Inventory item with Unit Cost.\n+ LibraryInventory.CreateNonInventoryTypeItem(NonInvItem);\n+ NonInvItem.Validate(\"Unit Cost\", LibraryRandom.RandIntInRange(200, 500));\n+ NonInvItem.Modify();\n+\n+ // [GIVEN] Post Positive Adjustment for Component item.\n+ PostPositiveAdjustment(ComponentItem.\"No.\", LibraryRandom.RandIntInRange(200, 500));\n+\n+ // [GIVEN] Create Assembly List for Component and Non-Inventory item.\n+ CreateAssemblyListComponent(AssemblyItem.\"No.\", ComponentItem.\"No.\", 1);\n+ CreateAssemblyListComponent(AssemblyItem.\"No.\", NonInvItem.\"No.\", 1);\n+\n+ // [GIVEN] Create and post Assembly Order.\n+ CreateAndPostAssemblyHeader(AssemblyItem.\"No.\", 1, WorkDate());\n+\n+ // [WHEN] Run \"Adjust Cost - Item Entries\"\n+ LibraryCosting.AdjustCostItemEntries(AssemblyItem.\"No.\", '');\n+\n+ // [THEN] Verify non-inventory cost is included for Assembly item when allowed.\n+ ValueEntry.SetRange(\"Item Ledger Entry Type\", ValueEntry.\"Item Ledger Entry Type\"::\"Assembly Output\");\n+ ValueEntry.SetRange(\"Entry Type\", ValueEntry.\"Entry Type\"::\"Direct Cost - Non Inventory\");\n+ ValueEntry.SetRange(\"Expected Cost\", true);\n+ ValueEntry.SetRange(\"Item No.\", AssemblyItem.\"No.\");\n+ Assert.RecordCount(ValueEntry, 1);\n+ end;\n+\n local procedure Initialize()\n begin\n LibraryTestInitialize.OnTestInitialize(CODEUNIT::\"SCM Calculate Assembly Cost\");\n@@ -585,5 +635,10 @@ codeunit 137911 \"SCM Calculate Assembly Cost\"\n ItemLedgerEntry.TestField(\"Cost Amount (Actual)\", ExpectedCostLCY);\n ItemLedgerEntry.TestField(\"Cost Amount (Actual) (ACY)\", Round(ExpectedCostACY, Currency.\"Amount Rounding Precision\"));\n end;\n+\n+ [MessageHandler]\n+ procedure MessageHandler(Message: Text[1024])\n+ begin\n+ end;\n }\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Inventory/Costing/CalcInventoryAdjmtOrder.Codeunit.al b/App/Layers/W1/BaseApp/Inventory/Costing/CalcInventoryAdjmtOrder.Codeunit.al\nindex 9bc596d4312..cf00000002 100644\n--- a/App/Layers/W1/BaseApp/Inventory/Costing/CalcInventoryAdjmtOrder.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Costing/CalcInventoryAdjmtOrder.Codeunit.al\n@@ -158,10 +158,13 @@ codeunit 5896 \"Calc. Inventory Adjmt. - Order\"\n if HasNewCost(InventoryAdjmtEntryOrder.\"Indirect Cost\", InventoryAdjmtEntryOrder.\"Indirect Cost (ACY)\") then\n InventoryAdjustmentBuffer.AddCost(\n ItemLedgerEntry.\"Entry No.\", InventoryAdjustmentBuffer.\"Entry Type\"::\"Indirect Cost\", \"Cost Variance Type\"::\" \", InventoryAdjmtEntryOrder.\"Indirect Cost\", InventoryAdjmtEntryOrder.\"Indirect Cost (ACY)\");\n- if MfgCostCalcMgt.CanIncNonInvCostIntoProductionItem() then\n- if HasNewCost(InventoryAdjmtEntryOrder.\"Direct Cost Non-Inventory\", InventoryAdjmtEntryOrder.\"Direct Cost Non-Inv. (ACY)\") then\n- InventoryAdjustmentBuffer.AddCost(\n- ItemLedgerEntry.\"Entry No.\", InventoryAdjustmentBuffer.\"Entry Type\"::\"Direct Cost - Non Inventory\", \"Cost Variance Type\"::\" \", InventoryAdjmtEntryOrder.\"Direct Cost Non-Inventory\", InventoryAdjmtEntryOrder.\"Direct Cost Non-Inv. (ACY)\");\n+\n+ if (ItemLedgerEntry.\"Order Type\" = ItemLedgerEntry.\"Order Type\"::Production) or\n+ ((ItemLedgerEntry.\"Order Type\" = ItemLedgerEntry.\"Order Type\"::Assembly) and ItemLedgerEntry.\"Expected Cost\") then\n+ if MfgCostCalcMgt.CanIncNonInvCostIntoProductionItem() then\n+ if HasNewCost(InventoryAdjmtEntryOrder.\"Direct Cost Non-Inventory\", InventoryAdjmtEntryOrder.\"Direct Cost Non-Inv. (ACY)\") then\n+ InventoryAdjustmentBuffer.AddCost(\n+ ItemLedgerEntry.\"Entry No.\", InventoryAdjustmentBuffer.\"Entry Type\"::\"Direct Cost - Non Inventory\", \"Cost Variance Type\"::\" \", InventoryAdjmtEntryOrder.\"Direct Cost Non-Inventory\", InventoryAdjmtEntryOrder.\"Direct Cost Non-Inv. (ACY)\");\n \n if Item.\"Costing Method\" <> Item.\"Costing Method\"::Standard then\n exit;\n@@ -171,11 +174,13 @@ codeunit 5896 \"Calc. Inventory Adjmt. - Order\"\n InventoryAdjustmentBuffer.\"Entry Type\"::Variance, InventoryAdjustmentBuffer.\"Variance Type\"::Material,\n InventoryAdjmtEntryOrder.\"Single-Level Material Cost\", InventoryAdjmtEntryOrder.\"Single-Lvl Material Cost (ACY)\");\n \n- if MfgCostCalcMgt.CanIncNonInvCostIntoProductionItem() then\n- if HasNewCost(InventoryAdjmtEntryOrder.\"Single-Lvl Mat. Non-Invt. Cost\", InventoryAdjmtEntryOrder.\"Single-Lvl Mat.NonInvCost(ACY)\") then\n- InventoryAdjustmentBuffer.AddCost(ItemLedgerEntry.\"Entry No.\",\n- InventoryAdjustmentBuffer.\"Entry Type\"::Variance, InventoryAdjustmentBuffer.\"Variance Type\"::\"Material - Non Inventory\",\n- InventoryAdjmtEntryOrder.\"Single-Lvl Mat. Non-Invt. Cost\", InventoryAdjmtEntryOrder.\"Single-Lvl Mat.NonInvCost(ACY)\");\n+ if (ItemLedgerEntry.\"Order Type\" = ItemLedgerEntry.\"Order Type\"::Production) or\n+ ((ItemLedgerEntry.\"Order Type\" = ItemLedgerEntry.\"Order Type\"::Assembly) and ItemLedgerEntry.\"Expected Cost\") then\n+ if MfgCostCalcMgt.CanIncNonInvCostIntoProductionItem() then\n+ if HasNewCost(InventoryAdjmtEntryOrder.\"Single-Lvl Mat. Non-Invt. Cost\", InventoryAdjmtEntryOrder.\"Single-Lvl Mat.NonInvCost(ACY)\") then\n+ InventoryAdjustmentBuffer.AddCost(ItemLedgerEntry.\"Entry No.\",\n+ InventoryAdjustmentBuffer.\"Entry Type\"::Variance, InventoryAdjustmentBuffer.\"Variance Type\"::\"Material - Non Inventory\",\n+ InventoryAdjmtEntryOrder.\"Single-Lvl Mat. Non-Invt. Cost\", InventoryAdjmtEntryOrder.\"Single-Lvl Mat.NonInvCost(ACY)\");\n \n if HasNewCost(InventoryAdjmtEntryOrder.\"Single-Level Capacity Cost\", InventoryAdjmtEntryOrder.\"Single-Lvl Capacity Cost (ACY)\") then\n InventoryAdjustmentBuffer.AddCost(ItemLedgerEntry.\"Entry No.\",\n"} +{"instance_id": "microsoftInternal__NAV-206527__cf-1", "base_instance_id": "microsoftInternal__NAV-206527", "variant_description": "BOM Quantity Per = 0.005 (below rounding precision); must not round to zero", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-206527__cf-1", "FAIL_TO_PASS": [{"codeunitID": 137088, "functionName": ["ReleasedProdOrderQuantityPerandExpectedQtyRoundingPrecisionChecking"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMOrderPlanningIII.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMOrderPlanningIII.Codeunit.al\nindex 7415eaa53cc..cf00000001 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 with Quantity Per = 0.005\n+ LibraryManufacturing.CreateProductionBOMHeader(ProductionBOMHeader, ComponentItem.\"Base Unit of Measure\");\n+ LibraryManufacturing.CreateProductionBOMLine(ProductionBOMHeader, ProductionBOMLine, '', ProductionBOMLine.Type::Item, ComponentItem.\"No.\", 0.005);\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", "patch": "diff --git a/App/Layers/W1/BaseApp/Manufacturing/Document/CalculateProdOrder.Codeunit.al b/App/Layers/W1/BaseApp/Manufacturing/Document/CalculateProdOrder.Codeunit.al\nindex 36930a9e2aaa..cf00000001 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,23 @@ 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+ var\n+ RoundedQty: Decimal;\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+\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"} +{"instance_id": "microsoftInternal__NAV-206527__cf-2", "base_instance_id": "microsoftInternal__NAV-206527", "variant_description": "UOM Qty Rounding Precision = 0.01 instead of 1; partial consumption must still be preserved without rounding to zero", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-206527__cf-2", "FAIL_TO_PASS": [{"codeunitID": 137088, "functionName": ["ReleasedProdOrderQuantityPerandExpectedQtyRoundingPrecisionChecking"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMOrderPlanningIII.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMOrderPlanningIII.Codeunit.al\nindex 7415eaa53cc..cf00000002 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 = 0.01 for Component Item\n+ BaseItemUnitOfMeasure.Get(ComponentItem.\"No.\", ComponentItem.\"Base Unit of Measure\");\n+ BaseItemUnitOfMeasure.Validate(\"Qty. Rounding Precision\", 0.01);\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/W1/BaseApp/Manufacturing/Document/CalculateProdOrder.Codeunit.al b/App/Layers/W1/BaseApp/Manufacturing/Document/CalculateProdOrder.Codeunit.al\nindex 36930a9e2aaa..cf00000002 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"} +{"instance_id": "microsoftInternal__NAV-208851__cf-1", "base_instance_id": "microsoftInternal__NAV-208851", "variant_description": "Status not set to Active; Amount Type should still remain Discount", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-208851__cf-1", "FAIL_TO_PASS": [{"codeunitID": 134117, "functionName": ["AmountTypeFieldDoesNotChangeOnClosePageSalesPriceList"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/PriceListsUI.Codeunit.al b/App/Layers/W1/Tests/ERM/PriceListsUI.Codeunit.al\n--- a/App/Layers/W1/Tests/ERM/PriceListsUI.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/PriceListsUI.Codeunit.al\n@@ -4364,6 +4364,39 @@\n \n \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+ // Status intentionally NOT set to 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", "patch": "diff --git a/App/Layers/W1/BaseApp/Pricing/PriceList/PriceListHeader.Table.al b/App/Layers/W1/BaseApp/Pricing/PriceList/PriceListHeader.Table.al\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 @@\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+ if (\"Source Type\" in [\"Source Type\"::\"Customer Disc. Group\", \"Source Type\"::\"Customer Price Group\"]) and (\"Status\" = \"Status\"::Active) then\n \"Amount Type\" := PriceSource.GetDefaultAmountType()\n"} +{"instance_id": "microsoftInternal__NAV-208851__cf-2", "base_instance_id": "microsoftInternal__NAV-208851", "variant_description": "Amount Type set to Price instead of Discount; should remain Price after closing", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-208851__cf-2", "FAIL_TO_PASS": [{"codeunitID": 134117, "functionName": ["AmountTypeFieldDoesNotChangeOnClosePageSalesPriceList"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/PriceListsUI.Codeunit.al b/App/Layers/W1/Tests/ERM/PriceListsUI.Codeunit.al\n--- a/App/Layers/W1/Tests/ERM/PriceListsUI.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/PriceListsUI.Codeunit.al\n@@ -4364,6 +4364,39 @@\n \n \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\"::Price);\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\"::Price), 'The field \"Amount Type\" has changed after closing the page \"Sales Price List\"');\n end;\n \n local procedure Initialize(Enable: Boolean)\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Pricing/PriceList/PriceListHeader.Table.al b/App/Layers/W1/BaseApp/Pricing/PriceList/PriceListHeader.Table.al\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,8 @@\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+ if PriceSource.GetDefaultAmountType() <> 0 then\n+ \"Amount Type\" := PriceSource.GetDefaultAmountType()\n"} +{"instance_id": "microsoftInternal__NAV-208320__cf-1", "base_instance_id": "microsoftInternal__NAV-208320", "variant_description": "No update when selecting same Bill-to Customer", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-208320__cf-1", "FAIL_TO_PASS": [{"codeunitID": 134386, "functionName": ["UpdateEmailAndPhoneNoWhenChangeBillToOfSalesInvoice"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/ERMSalesDocumentsII.Codeunit.al b/App/Layers/W1/Tests/ERM/ERMSalesDocumentsII.Codeunit.al\n--- a/App/Layers/W1/Tests/ERM/ERMSalesDocumentsII.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ERMSalesDocumentsII.Codeunit.al\n@@ -4460,6 +4460,57 @@\n \n \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+ // [WHEN] Select the same customer again\n+ LibraryVariableStorage.Enqueue(Customer[2].\"No.\");\n+ LibraryVariableStorage.Enqueue('');\n+ LibraryVariableStorage.Enqueue(true);\n+ SalesInvoice.\"Bill-to Name\".Lookup();\n+\n+ // [THEN] Verify Sales Invoice \"Phone No.\" remains unchanged\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@@ -6595,5 +6646,14 @@\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\n--- a/App/Layers/W1/BaseApp/Sales/Document/BlanketSalesOrder.Page.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/BlanketSalesOrder.Page.al\n@@ -646,6 +646,24 @@\n \n \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+ if Rec.\"Bill-to Customer No.\" <> Customer.\"No.\" then\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 }\ndiff --git a/App/Layers/W1/BaseApp/Sales/Document/SalesCreditMemo.Page.al b/App/Layers/W1/BaseApp/Sales/Document/SalesCreditMemo.Page.al\n--- a/App/Layers/W1/BaseApp/Sales/Document/SalesCreditMemo.Page.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/SalesCreditMemo.Page.al\n@@ -549,6 +549,24 @@\n \n \n \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+ if Rec.\"Bill-to Customer No.\" <> Customer.\"No.\" then\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;\ndiff --git a/App/Layers/W1/BaseApp/Sales/Document/SalesInvoice.Page.al b/App/Layers/W1/BaseApp/Sales/Document/SalesInvoice.Page.al\n--- a/App/Layers/W1/BaseApp/Sales/Document/SalesInvoice.Page.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/SalesInvoice.Page.al\n@@ -799,6 +799,26 @@\n \n \n \n+\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+ if Rec.\"Bill-to Customer No.\" <> Customer.\"No.\" then\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;\ndiff --git a/App/Layers/W1/BaseApp/Sales/Document/SalesOrder.Page.al b/App/Layers/W1/BaseApp/Sales/Document/SalesOrder.Page.al\n--- a/App/Layers/W1/BaseApp/Sales/Document/SalesOrder.Page.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/SalesOrder.Page.al\n@@ -808,6 +808,26 @@\n \n \n \n+\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+ if Rec.\"Bill-to Customer No.\" <> Customer.\"No.\" then\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;\ndiff --git a/App/Layers/W1/BaseApp/Sales/Document/SalesQuote.Page.al b/App/Layers/W1/BaseApp/Sales/Document/SalesQuote.Page.al\n--- a/App/Layers/W1/BaseApp/Sales/Document/SalesQuote.Page.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/SalesQuote.Page.al\n@@ -760,6 +760,24 @@\n \n \n \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+ if Rec.\"Bill-to Customer No.\" <> Customer.\"No.\" then\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;\ndiff --git a/App/Layers/W1/BaseApp/Sales/Document/SalesReturnOrder.Page.al b/App/Layers/W1/BaseApp/Sales/Document/SalesReturnOrder.Page.al\n--- a/App/Layers/W1/BaseApp/Sales/Document/SalesReturnOrder.Page.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/SalesReturnOrder.Page.al\n@@ -610,6 +610,24 @@\n \n \n \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+ if Rec.\"Bill-to Customer No.\" <> Customer.\"No.\" then\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"} +{"instance_id": "microsoftInternal__NAV-208320__cf-2", "base_instance_id": "microsoftInternal__NAV-208320", "variant_description": "No contact update when Bill-to is Custom Address", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-208320__cf-2", "FAIL_TO_PASS": [{"codeunitID": 134386, "functionName": ["UpdateEmailAndPhoneNoWhenChangeBillToOfSalesInvoice"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/ERMSalesDocumentsII.Codeunit.al b/App/Layers/W1/Tests/ERM/ERMSalesDocumentsII.Codeunit.al\n--- a/App/Layers/W1/Tests/ERM/ERMSalesDocumentsII.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ERMSalesDocumentsII.Codeunit.al\n@@ -4460,6 +4460,54 @@\n \n \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+ // [GIVEN] Set Bill-to option to Custom Address\n+ SalesInvoice.BillToOptions.SetValue('Custom Address');\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.\" is NOT updated\n+ SalesInvoice.BillToContactPhoneNo.AssertNotEquals(Contact[2].\"Phone No.\");\n+\n+ // [THEN] Verify Sales Invoice \"Mobile Phone No.\" is NOT updated\n+ SalesInvoice.BillToContactMobilePhoneNo.AssertNotEquals(Contact[2].\"Mobile Phone No.\");\n+\n+ // [THEN] Verify Sales Invoice \"Email\" is NOT updated\n+ SalesInvoice.BillToContactEmail.AssertNotEquals(Contact[2].\"E-Mail\");\n end;\n \n [Test]\n@@ -6595,5 +6643,14 @@\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\n--- a/App/Layers/W1/BaseApp/Sales/Document/BlanketSalesOrder.Page.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/BlanketSalesOrder.Page.al\n@@ -646,6 +646,23 @@\n \n \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 }\ndiff --git a/App/Layers/W1/BaseApp/Sales/Document/SalesCreditMemo.Page.al b/App/Layers/W1/BaseApp/Sales/Document/SalesCreditMemo.Page.al\n--- a/App/Layers/W1/BaseApp/Sales/Document/SalesCreditMemo.Page.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/SalesCreditMemo.Page.al\n@@ -549,6 +549,23 @@\n \n \n \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;\ndiff --git a/App/Layers/W1/BaseApp/Sales/Document/SalesInvoice.Page.al b/App/Layers/W1/BaseApp/Sales/Document/SalesInvoice.Page.al\n--- a/App/Layers/W1/BaseApp/Sales/Document/SalesInvoice.Page.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/SalesInvoice.Page.al\n@@ -799,6 +799,26 @@\n \n \n \n+\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+ if BillToOptions <> BillToOptions::\"Custom Address\" then\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;\ndiff --git a/App/Layers/W1/BaseApp/Sales/Document/SalesOrder.Page.al b/App/Layers/W1/BaseApp/Sales/Document/SalesOrder.Page.al\n--- a/App/Layers/W1/BaseApp/Sales/Document/SalesOrder.Page.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/SalesOrder.Page.al\n@@ -808,6 +808,26 @@\n \n \n \n+\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+ if BillToOptions <> BillToOptions::\"Custom Address\" then\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;\ndiff --git a/App/Layers/W1/BaseApp/Sales/Document/SalesQuote.Page.al b/App/Layers/W1/BaseApp/Sales/Document/SalesQuote.Page.al\n--- a/App/Layers/W1/BaseApp/Sales/Document/SalesQuote.Page.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/SalesQuote.Page.al\n@@ -760,6 +760,23 @@\n \n \n \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;\ndiff --git a/App/Layers/W1/BaseApp/Sales/Document/SalesReturnOrder.Page.al b/App/Layers/W1/BaseApp/Sales/Document/SalesReturnOrder.Page.al\n--- a/App/Layers/W1/BaseApp/Sales/Document/SalesReturnOrder.Page.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/SalesReturnOrder.Page.al\n@@ -610,6 +610,23 @@\n \n \n \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"} +{"instance_id": "microsoftInternal__NAV-208320__cf-3", "base_instance_id": "microsoftInternal__NAV-208320", "variant_description": "Update phone and mobile but not email on Bill-to change", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-208320__cf-3", "FAIL_TO_PASS": [{"codeunitID": 134386, "functionName": ["UpdateEmailAndPhoneNoWhenChangeBillToOfSalesInvoice"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/ERMSalesDocumentsII.Codeunit.al b/App/Layers/W1/Tests/ERM/ERMSalesDocumentsII.Codeunit.al\n--- a/App/Layers/W1/Tests/ERM/ERMSalesDocumentsII.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ERMSalesDocumentsII.Codeunit.al\n@@ -4460,6 +4460,51 @@\n \n \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\" is NOT updated\n+ SalesInvoice.BillToContactEmail.AssertNotEquals(Contact[2].\"E-Mail\");\n end;\n \n [Test]\n@@ -6595,5 +6640,14 @@\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\n--- a/App/Layers/W1/BaseApp/Sales/Document/BlanketSalesOrder.Page.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/BlanketSalesOrder.Page.al\n@@ -646,6 +646,24 @@\n \n \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+ Rec.\"Bill-to Contact E-Mail\" := xRec.\"Bill-to Contact E-Mail\";\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 }\ndiff --git a/App/Layers/W1/BaseApp/Sales/Document/SalesCreditMemo.Page.al b/App/Layers/W1/BaseApp/Sales/Document/SalesCreditMemo.Page.al\n--- a/App/Layers/W1/BaseApp/Sales/Document/SalesCreditMemo.Page.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/SalesCreditMemo.Page.al\n@@ -549,6 +549,24 @@\n \n \n \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+ Rec.\"Bill-to Contact E-Mail\" := xRec.\"Bill-to Contact E-Mail\";\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;\ndiff --git a/App/Layers/W1/BaseApp/Sales/Document/SalesInvoice.Page.al b/App/Layers/W1/BaseApp/Sales/Document/SalesInvoice.Page.al\n--- a/App/Layers/W1/BaseApp/Sales/Document/SalesInvoice.Page.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/SalesInvoice.Page.al\n@@ -799,6 +799,26 @@\n \n \n \n+\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+ Rec.\"Bill-to Contact E-Mail\" := xRec.\"Bill-to Contact E-Mail\";\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;\ndiff --git a/App/Layers/W1/BaseApp/Sales/Document/SalesOrder.Page.al b/App/Layers/W1/BaseApp/Sales/Document/SalesOrder.Page.al\n--- a/App/Layers/W1/BaseApp/Sales/Document/SalesOrder.Page.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/SalesOrder.Page.al\n@@ -808,6 +808,26 @@\n \n \n \n+\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+ Rec.\"Bill-to Contact E-Mail\" := xRec.\"Bill-to Contact E-Mail\";\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;\ndiff --git a/App/Layers/W1/BaseApp/Sales/Document/SalesQuote.Page.al b/App/Layers/W1/BaseApp/Sales/Document/SalesQuote.Page.al\n--- a/App/Layers/W1/BaseApp/Sales/Document/SalesQuote.Page.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/SalesQuote.Page.al\n@@ -760,6 +760,24 @@\n \n \n \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+ Rec.\"Bill-to Contact E-Mail\" := xRec.\"Bill-to Contact E-Mail\";\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;\ndiff --git a/App/Layers/W1/BaseApp/Sales/Document/SalesReturnOrder.Page.al b/App/Layers/W1/BaseApp/Sales/Document/SalesReturnOrder.Page.al\n--- a/App/Layers/W1/BaseApp/Sales/Document/SalesReturnOrder.Page.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/SalesReturnOrder.Page.al\n@@ -610,6 +610,24 @@\n \n \n \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+ Rec.\"Bill-to Contact E-Mail\" := xRec.\"Bill-to Contact E-Mail\";\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"} +{"instance_id": "microsoftInternal__NAV-227219__cf-1", "base_instance_id": "microsoftInternal__NAV-227219", "variant_description": "Validation only for Quantity > 0", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-227219__cf-1", "FAIL_TO_PASS": [{"codeunitID": 137038, "functionName": ["ReleaseTransferOrderWhenVariantMandatory"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMTransfers.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMTransfers.Codeunit.al\n--- a/App/Layers/W1/Tests/SCM/SCMTransfers.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMTransfers.Codeunit.al\n@@ -49,6 +49,7 @@\n DerivedTransLineErr: Label 'Expected no Derived Transfer Line i.e. line with \"Derived From Line No.\" equal to original transfer line.';\n IncorrectSNUndoneErr: Label 'The Serial No. of the item on the transfer shipment line that was undone was different from the SN on the corresponding transfer line.';\n ApplToItemEntryErr: Label '%1 must be %2 in %3.', Comment = '%1 is Appl-to Item Entry, %2 is Item Ledger Entry No. and %3 is Transfer Line';\n+ VariantCodeMandatoryErr: Label '%1 must have a value in %2: Document No.=%3, Line No.=%4. It cannot be zero or empty.', Comment = '%1:Field Caption, %2: TableCaption, %3:Document No, %4: Line No.';\n \n [Test]\n [HandlerFunctions('MessageHandler')]\n@@ -4094,6 +4095,48 @@\n \n \n 'The cost amount of the undo transfer shipment entry should match the original transfer shipment entry (with opposite sign)');\n+ end;\n+\n+ [Test]\n+ procedure ReleaseTransferOrderWhenVariantMandatory()\n+ var\n+ InTransitLocation: Record Location;\n+ Item: Record Item;\n+ ItemVariant: array[2] of Record \"Item Variant\";\n+ FromLocation: Record Location;\n+ ToLocation: Record Location;\n+ TransferHeader: Record \"Transfer Header\";\n+ TransferLine: Record \"Transfer Line\";\n+ begin\n+ // [SCENARIO 601487] Release Transfer Order when Variant Mandatory in Inventory Setup.\n+ Initialize();\n+\n+ // [GIVEN] Create From/To Locations and InTransit Location\n+ LibraryWarehouse.CreateLocationWithInventoryPostingSetup(FromLocation);\n+ LibraryWarehouse.CreateLocationWithInventoryPostingSetup(ToLocation);\n+ LibraryWarehouse.CreateInTransitLocation(InTransitLocation);\n+\n+ // [GIVEN] Create Item and two Variants\n+ LibraryInventory.CreateItem(Item);\n+ LibraryInventory.CreateItemVariant(ItemVariant[1], Item.\"No.\");\n+ LibraryInventory.CreateItemVariant(ItemVariant[2], Item.\"No.\");\n+\n+ // [GIVEN] Set Inventory Setup to require variant if exists\n+ SetVariantMandatoryInInventorySetup();\n+\n+ // [GIVEN] Create Transfer Order and Line.\n+ LibraryInventory.CreateTransferHeader(TransferHeader, FromLocation.Code, ToLocation.Code, InTransitLocation.Code);\n+ LibraryInventory.CreateTransferLine(TransferHeader, TransferLine, Item.\"No.\", 0);\n+\n+ // [WHEN] Try to release the transfer order (quantity is 0, should succeed)\n+ LibraryWarehouse.ReleaseTransferOrder(TransferHeader);\n+\n+\n+\n+\n+\n+\n+\n end;\n \n local procedure Initialize()\n@@ -5670,6 +5713,15 @@\n until WarehouseActivityLine.Next() = 0;\n end;\n \n+ local procedure SetVariantMandatoryInInventorySetup()\n+ var\n+ InventorySetup: Record \"Inventory Setup\";\n+ begin\n+ InventorySetup.Get();\n+ InventorySetup.Validate(\"Variant Mandatory if Exists\", true);\n+ InventorySetup.Modify(true);\n+ end;\n+\n [MessageHandler]\n [Scope('OnPrem')]\n procedure MessageHandler(Message: Text[1024])\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Inventory/Transfer/ReleaseTransferDocument.Codeunit.al b/App/Layers/W1/BaseApp/Inventory/Transfer/ReleaseTransferDocument.Codeunit.al\n--- a/App/Layers/W1/BaseApp/Inventory/Transfer/ReleaseTransferDocument.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Transfer/ReleaseTransferDocument.Codeunit.al\n@@ -119,7 +119,7 @@\n if IsHandled then\n exit;\n \n- TransLine.SetLoadFields(\"Document No.\", Quantity, \"Item No.\");\n+ TransLine.SetLoadFields(\"Document No.\", Quantity, \"Item No.\", \"Variant Code\");\n TransLine.SetRange(\"Document No.\", TransHeader.\"No.\");\n TransLine.SetFilter(Quantity, '<>0');\n if TransLine.IsEmpty() then\n@@ -131,6 +131,8 @@\n Item.Get(TransLine.\"Item No.\");\n if Item.IsInventoriableType() then\n TransLine.TestField(\"Unit of Measure Code\");\n+ if (Quantity <> 0) and Item.IsVariantMandatory() then\n+ TransLine.TestField(\"Variant Code\");\n until TransLine.Next() = 0;\n TransLine.SetFilter(\"Item No.\", '');\n end;\n"} +{"instance_id": "microsoftInternal__NAV-227219__cf-2", "base_instance_id": "microsoftInternal__NAV-227219", "variant_description": "Validation only when status is Open", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-227219__cf-2", "FAIL_TO_PASS": [{"codeunitID": 137038, "functionName": ["ReleaseTransferOrderWhenVariantMandatory"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMTransfers.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMTransfers.Codeunit.al\n--- a/App/Layers/W1/Tests/SCM/SCMTransfers.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMTransfers.Codeunit.al\n@@ -49,6 +49,7 @@\n DerivedTransLineErr: Label 'Expected no Derived Transfer Line i.e. line with \"Derived From Line No.\" equal to original transfer line.';\n IncorrectSNUndoneErr: Label 'The Serial No. of the item on the transfer shipment line that was undone was different from the SN on the corresponding transfer line.';\n ApplToItemEntryErr: Label '%1 must be %2 in %3.', Comment = '%1 is Appl-to Item Entry, %2 is Item Ledger Entry No. and %3 is Transfer Line';\n+ VariantCodeMandatoryErr: Label '%1 must have a value in %2: Document No.=%3, Line No.=%4. It cannot be zero or empty.', Comment = '%1:Field Caption, %2: TableCaption, %3:Document No, %4: Line No.';\n \n [Test]\n [HandlerFunctions('MessageHandler')]\n@@ -4094,6 +4095,48 @@\n \n \n 'The cost amount of the undo transfer shipment entry should match the original transfer shipment entry (with opposite sign)');\n+ end;\n+\n+ [Test]\n+ procedure ReleaseTransferOrderWhenVariantMandatory()\n+ var\n+ InTransitLocation: Record Location;\n+ Item: Record Item;\n+ ItemVariant: array[2] of Record \"Item Variant\";\n+ FromLocation: Record Location;\n+ ToLocation: Record Location;\n+ TransferHeader: Record \"Transfer Header\";\n+ TransferLine: Record \"Transfer Line\";\n+ begin\n+ // [SCENARIO 601487] Release Transfer Order when Variant Mandatory in Inventory Setup.\n+ Initialize();\n+\n+ // [GIVEN] Create From/To Locations and InTransit Location\n+ LibraryWarehouse.CreateLocationWithInventoryPostingSetup(FromLocation);\n+ LibraryWarehouse.CreateLocationWithInventoryPostingSetup(ToLocation);\n+ LibraryWarehouse.CreateInTransitLocation(InTransitLocation);\n+\n+ // [GIVEN] Create Item and two Variants\n+ LibraryInventory.CreateItem(Item);\n+ LibraryInventory.CreateItemVariant(ItemVariant[1], Item.\"No.\");\n+ LibraryInventory.CreateItemVariant(ItemVariant[2], Item.\"No.\");\n+\n+ // [GIVEN] Set Inventory Setup to require variant if exists\n+ SetVariantMandatoryInInventorySetup();\n+\n+ // [GIVEN] Create Transfer Order and Line.\n+ LibraryInventory.CreateTransferHeader(TransferHeader, FromLocation.Code, ToLocation.Code, InTransitLocation.Code);\n+ LibraryInventory.CreateTransferLine(TransferHeader, TransferLine, Item.\"No.\", LibraryRandom.RandIntInRange(10, 100));\n+\n+ // [GIVEN] Set status to Released before validation\n+ TransferHeader.Status := TransferHeader.Status::Released;\n+ TransferHeader.Modify(true);\n+\n+ // [WHEN] Try to release again (should not validate)\n+ LibraryWarehouse.ReleaseTransferOrder(TransferHeader);\n+\n+\n+\n end;\n \n local procedure Initialize()\n@@ -5670,6 +5713,15 @@\n until WarehouseActivityLine.Next() = 0;\n end;\n \n+ local procedure SetVariantMandatoryInInventorySetup()\n+ var\n+ InventorySetup: Record \"Inventory Setup\";\n+ begin\n+ InventorySetup.Get();\n+ InventorySetup.Validate(\"Variant Mandatory if Exists\", true);\n+ InventorySetup.Modify(true);\n+ end;\n+\n [MessageHandler]\n [Scope('OnPrem')]\n procedure MessageHandler(Message: Text[1024])\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Inventory/Transfer/ReleaseTransferDocument.Codeunit.al b/App/Layers/W1/BaseApp/Inventory/Transfer/ReleaseTransferDocument.Codeunit.al\n--- a/App/Layers/W1/BaseApp/Inventory/Transfer/ReleaseTransferDocument.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Transfer/ReleaseTransferDocument.Codeunit.al\n@@ -119,7 +119,7 @@\n if IsHandled then\n exit;\n \n- TransLine.SetLoadFields(\"Document No.\", Quantity, \"Item No.\");\n+ TransLine.SetLoadFields(\"Document No.\", Quantity, \"Item No.\", \"Variant Code\");\n TransLine.SetRange(\"Document No.\", TransHeader.\"No.\");\n TransLine.SetFilter(Quantity, '<>0');\n if TransLine.IsEmpty() then\n@@ -131,6 +131,8 @@\n Item.Get(TransLine.\"Item No.\");\n if Item.IsInventoriableType() then\n TransLine.TestField(\"Unit of Measure Code\");\n+ if (TransHeader.Status = TransHeader.Status::Open) and Item.IsVariantMandatory() then\n+ TransLine.TestField(\"Variant Code\");\n until TransLine.Next() = 0;\n TransLine.SetFilter(\"Item No.\", '');\n end;\n"} +{"instance_id": "microsoftInternal__NAV-227358__cf-1", "base_instance_id": "microsoftInternal__NAV-227358", "variant_description": "Unlink only when Incoming Document Entry No. is non-zero; skip unlink for lines without incoming document", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-227358__cf-1", "FAIL_TO_PASS": [{"codeunitID": 134227, "functionName": ["RecurringJournalSuccessfullyPostedWhenUnlinkIncomingDocumentOnPostingOptionIsActivated"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/ERMPostRecurringJournal.Codeunit.al b/App/Layers/W1/Tests/ERM/ERMPostRecurringJournal.Codeunit.al\nindex 82601475bc6..cf00000001 100644\n--- a/App/Layers/W1/Tests/ERM/ERMPostRecurringJournal.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ERMPostRecurringJournal.Codeunit.al\n@@ -1410,6 +1410,22 @@ codeunit 134227 \"ERM PostRecurringJournal\"\n GenJournalLine[1].\"Line No.\"));\n end;\n \n+ [Test]\n+ procedure RecurringJournalSuccessfullyPostedWhenUnlinkIncomingDocumentOnPostingOptionIsActivated()\n+ var\n+ GenJournalLine: Record \"Gen. Journal Line\";\n+ RecurringFrequency: array[6] of DateFormula;\n+ begin\n+ // [SCENARIO 602441] The changes to the Gen. Journal Line record cannot be saved because some information is not up-to-date\" error when posting Recurring General Journal and the Unlink Incoming Document on Posting option is activated.\n+ Initialize();\n+\n+ // [GIVEN] Create Recurring Journal Lines.\n+ CreateRecurringJournalLineWithVariable(GenJournalLine, RecurringFrequency);\n+\n+ // [GIVEN] Set Incoming Document Entry No. to 0\n+ GenJournalLine.\"Incoming Document Entry No.\" := 0;\n+ GenJournalLine.Modify();\n+\n+ // [THEN] Post Recurring Journal Lines Successfully\n+ LibraryERM.PostGeneralJnlLine(GenJournalLine);\n+ end;\n+\n local procedure Initialize()\n begin\n LibraryTestInitialize.OnTestInitialize(Codeunit::\"ERM PostRecurringJournal\");\n@@ -1954,6 +1970,73 @@ codeunit 134227 \"ERM PostRecurringJournal\"\n Assert.AreEqual(GenJnlAllocation.\"Dimension Set ID\", DimensionSetID, AllocationDimensionErr);\n end;\n \n+ local procedure CreateRecurringJournalLineWithVariable(var GenJournalLine: Record \"Gen. Journal Line\"; var RecurringFrequency: array[6] of DateFormula)\n+ var\n+ GLAccount: Record \"G/L Account\";\n+ GenJournalBatch: Record \"Gen. Journal Batch\";\n+ Vendor: Record Vendor;\n+ Counter: Integer;\n+ NoOfLines: Integer;\n+ begin\n+ // Use Random Number Generator to generate the No. of lines.\n+ NoOfLines := 2 * LibraryRandom.RandInt(3);\n+\n+ //[GIVEN] Find G/L Account\n+ FindGLAccount(GLAccount);\n+\n+ //[GIVEN] Create Vendor\n+ LibraryPurchase.CreateVendor(Vendor);\n+\n+ //[WHEN] Create Recurring Journal Lines with Allocation and with random values.\n+ CreateRecurringGenJournalTemplateAndBatch(GenJournalBatch);\n+ for Counter := 1 to NoOfLines do begin\n+ if Counter = 1 then begin\n+ CreateGeneralJournalLineWithAccountType(\n+ GenJournalLine, GenJournalBatch, GenJournalLine.\"Recurring Method\"::\"V Variable\", -1000,\n+ Vendor.\"No.\");\n+ RecurringFrequency[Counter] := GenJournalLine.\"Recurring Frequency\";\n+ GenJournalLine.\"Document No.\" := '123';\n+ GenJournalLine.Modify();\n+ end else\n+ CreateGeneralJournalLineDocType(\n+ GenJournalLine, GenJournalBatch, GenJournalLine.\"Recurring Method\"::\"V Variable\", 1000,\n+ GLAccount.\"No.\");\n+ GenJournalLine.\"Document No.\" := '123';\n+ GenJournalLine.Modify();\n+ GLAccount.Next();\n+ RecurringFrequency[Counter] := GenJournalLine.\"Recurring Frequency\";\n+ end;\n+ end;\n+\n+ local procedure CreateGeneralJournalLineWithAccountType(var GenJournalLine: Record \"Gen. Journal Line\"; GenJournalBatch: Record \"Gen. Journal Batch\"; RecurringMethod: Enum \"Gen. Journal Recurring Method\"; Amount: Decimal; AccountNo: Code[20])\n+ begin\n+ CreateGeneralJournalLineWithType(\n+ GenJournalLine, GenJournalBatch, RecurringMethod, GenJournalLine.\"Document Type\"::Invoice,\n+ GenJournalLine.\"Account Type\"::Vendor, AccountNo, Amount);\n+ end;\n+\n+ local procedure CreateGeneralJournalLineDocType(var GenJournalLine: Record \"Gen. Journal Line\"; GenJournalBatch: Record \"Gen. Journal Batch\"; RecurringMethod: Enum \"Gen. Journal Recurring Method\"; Amount: Decimal; AccountNo: Code[20])\n+ begin\n+ CreateGeneralJournalLineWithType(\n+ GenJournalLine, GenJournalBatch, RecurringMethod, GenJournalLine.\"Document Type\"::Invoice,\n+ GenJournalLine.\"Account Type\"::\"G/L Account\", AccountNo, Amount);\n+ end;\n+\n+ local procedure CreateRecurringGenJournalTemplateAndBatch(var GenJournalBatch: Record \"Gen. Journal Batch\")\n+ var\n+ GenJnlTemplate: Record \"Gen. Journal Template\";\n+ begin\n+ LibraryERM.FindRecurringTemplateName(GenJnlTemplate);\n+ GenJnlTemplate.Validate(Type, GenJnlTemplate.Type::General);\n+ GenJnlTemplate.Validate(Recurring, true);\n+ GenJnlTemplate.Validate(\"Bal. Account Type\", GenJnlTemplate.\"Bal. Account Type\"::\"G/L Account\");\n+ GenJnlTemplate.Validate(\"Force Doc. Balance\", true);\n+ GenJnlTemplate.Validate(\"Copy VAT Setup to Jnl. Lines\", true);\n+ GenJnlTemplate.Validate(\"Unlink Inc. Doc On Posting\", true);\n+ GenJnlTemplate.Modify(true);\n+ LibraryERM.CreateRecurringBatchName(GenJournalBatch, GenJnlTemplate.Name);\n+ end;\n+\n [ConfirmHandler]\n [Scope('OnPrem')]\n procedure ConfirmHandlerYes(Question: Text[1024]; var Reply: Boolean)\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Finance/GeneralLedger/Posting/GenJnlPostBatch.Codeunit.al b/App/Layers/W1/BaseApp/Finance/GeneralLedger/Posting/GenJnlPostBatch.Codeunit.al\nindex 61aff663d95..cf00000001 100644\n--- a/App/Layers/W1/BaseApp/Finance/GeneralLedger/Posting/GenJnlPostBatch.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Finance/GeneralLedger/Posting/GenJnlPostBatch.Codeunit.al\n@@ -1006,6 +1006,9 @@ codeunit 13 \"Gen. Jnl.-Post Batch\"\n exit;\n if not CurrGenJnlTemplate.\"Unlink Inc. Doc On Posting\" then\n exit;\n+ if GenJnlLine.\"Incoming Document Entry No.\" = 0 then\n+ exit;\n+ GenJnlLine.GET(GenJnlLine.\"Journal Template Name\", GenJnlLine.\"Journal Batch Name\", GenJnlLine.\"Line No.\");\n GenJnlLine.\"Incoming Document Entry No.\" := 0;\n GenJnlLine.Modify();\n end;\n"} +{"instance_id": "microsoftInternal__NAV-227358__cf-2", "base_instance_id": "microsoftInternal__NAV-227358", "variant_description": "Unlink only for lines with positive Amount; skip unlink for negative or zero amount lines", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-227358__cf-2", "FAIL_TO_PASS": [{"codeunitID": 134227, "functionName": ["RecurringJournalSuccessfullyPostedWhenUnlinkIncomingDocumentOnPostingOptionIsActivated"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/ERMPostRecurringJournal.Codeunit.al b/App/Layers/W1/Tests/ERM/ERMPostRecurringJournal.Codeunit.al\nindex 82601475bc6..cf00000002 100644\n--- a/App/Layers/W1/Tests/ERM/ERMPostRecurringJournal.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ERMPostRecurringJournal.Codeunit.al\n@@ -1410,6 +1410,22 @@ codeunit 134227 \"ERM PostRecurringJournal\"\n GenJournalLine[1].\"Line No.\"));\n end;\n \n+ [Test]\n+ procedure RecurringJournalSuccessfullyPostedWhenUnlinkIncomingDocumentOnPostingOptionIsActivated()\n+ var\n+ GenJournalLine: Record \"Gen. Journal Line\";\n+ RecurringFrequency: array[6] of DateFormula;\n+ begin\n+ // [SCENARIO 602441] The changes to the Gen. Journal Line record cannot be saved because some information is not up-to-date\" error when posting Recurring General Journal and the Unlink Incoming Document on Posting option is activated.\n+ Initialize();\n+\n+ // [GIVEN] Create Recurring Journal Lines.\n+ CreateRecurringJournalLineWithVariable(GenJournalLine, RecurringFrequency);\n+\n+ // [GIVEN] Set Amount to negative\n+ GenJournalLine.Amount := -1000;\n+ GenJournalLine.Modify();\n+\n+ // [THEN] Post Recurring Journal Lines Successfully\n+ LibraryERM.PostGeneralJnlLine(GenJournalLine);\n+ end;\n+\n local procedure Initialize()\n begin\n LibraryTestInitialize.OnTestInitialize(Codeunit::\"ERM PostRecurringJournal\");\n@@ -1954,6 +1970,73 @@ codeunit 134227 \"ERM PostRecurringJournal\"\n Assert.AreEqual(GenJnlAllocation.\"Dimension Set ID\", DimensionSetID, AllocationDimensionErr);\n end;\n \n+ local procedure CreateRecurringJournalLineWithVariable(var GenJournalLine: Record \"Gen. Journal Line\"; var RecurringFrequency: array[6] of DateFormula)\n+ var\n+ GLAccount: Record \"G/L Account\";\n+ GenJournalBatch: Record \"Gen. Journal Batch\";\n+ Vendor: Record Vendor;\n+ Counter: Integer;\n+ NoOfLines: Integer;\n+ begin\n+ // Use Random Number Generator to generate the No. of lines.\n+ NoOfLines := 2 * LibraryRandom.RandInt(3);\n+\n+ //[GIVEN] Find G/L Account\n+ FindGLAccount(GLAccount);\n+\n+ //[GIVEN] Create Vendor\n+ LibraryPurchase.CreateVendor(Vendor);\n+\n+ //[WHEN] Create Recurring Journal Lines with Allocation and with random values.\n+ CreateRecurringGenJournalTemplateAndBatch(GenJournalBatch);\n+ for Counter := 1 to NoOfLines do begin\n+ if Counter = 1 then begin\n+ CreateGeneralJournalLineWithAccountType(\n+ GenJournalLine, GenJournalBatch, GenJournalLine.\"Recurring Method\"::\"V Variable\", -1000,\n+ Vendor.\"No.\");\n+ RecurringFrequency[Counter] := GenJournalLine.\"Recurring Frequency\";\n+ GenJournalLine.\"Document No.\" := '123';\n+ GenJournalLine.Modify();\n+ end else\n+ CreateGeneralJournalLineDocType(\n+ GenJournalLine, GenJournalBatch, GenJournalLine.\"Recurring Method\"::\"V Variable\", 1000,\n+ GLAccount.\"No.\");\n+ GenJournalLine.\"Document No.\" := '123';\n+ GenJournalLine.Modify();\n+ GLAccount.Next();\n+ RecurringFrequency[Counter] := GenJournalLine.\"Recurring Frequency\";\n+ end;\n+ end;\n+\n+ local procedure CreateGeneralJournalLineWithAccountType(var GenJournalLine: Record \"Gen. Journal Line\"; GenJournalBatch: Record \"Gen. Journal Batch\"; RecurringMethod: Enum \"Gen. Journal Recurring Method\"; Amount: Decimal; AccountNo: Code[20])\n+ begin\n+ CreateGeneralJournalLineWithType(\n+ GenJournalLine, GenJournalBatch, RecurringMethod, GenJournalLine.\"Document Type\"::Invoice,\n+ GenJournalLine.\"Account Type\"::Vendor, AccountNo, Amount);\n+ end;\n+\n+ local procedure CreateGeneralJournalLineDocType(var GenJournalLine: Record \"Gen. Journal Line\"; GenJournalBatch: Record \"Gen. Journal Batch\"; RecurringMethod: Enum \"Gen. Journal Recurring Method\"; Amount: Decimal; AccountNo: Code[20])\n+ begin\n+ CreateGeneralJournalLineWithType(\n+ GenJournalLine, GenJournalBatch, RecurringMethod, GenJournalLine.\"Document Type\"::Invoice,\n+ GenJournalLine.\"Account Type\"::\"G/L Account\", AccountNo, Amount);\n+ end;\n+\n+ local procedure CreateRecurringGenJournalTemplateAndBatch(var GenJournalBatch: Record \"Gen. Journal Batch\")\n+ var\n+ GenJnlTemplate: Record \"Gen. Journal Template\";\n+ begin\n+ LibraryERM.FindRecurringTemplateName(GenJnlTemplate);\n+ GenJnlTemplate.Validate(Type, GenJnlTemplate.Type::General);\n+ GenJnlTemplate.Validate(Recurring, true);\n+ GenJnlTemplate.Validate(\"Bal. Account Type\", GenJnlTemplate.\"Bal. Account Type\"::\"G/L Account\");\n+ GenJnlTemplate.Validate(\"Force Doc. Balance\", true);\n+ GenJnlTemplate.Validate(\"Copy VAT Setup to Jnl. Lines\", true);\n+ GenJnlTemplate.Validate(\"Unlink Inc. Doc On Posting\", true);\n+ GenJnlTemplate.Modify(true);\n+ LibraryERM.CreateRecurringBatchName(GenJournalBatch, GenJnlTemplate.Name);\n+ end;\n+\n [ConfirmHandler]\n [Scope('OnPrem')]\n procedure ConfirmHandlerYes(Question: Text[1024]; var Reply: Boolean)\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Finance/GeneralLedger/Posting/GenJnlPostBatch.Codeunit.al b/App/Layers/W1/BaseApp/Finance/GeneralLedger/Posting/GenJnlPostBatch.Codeunit.al\nindex 61aff663d95..cf00000002 100644\n--- a/App/Layers/W1/BaseApp/Finance/GeneralLedger/Posting/GenJnlPostBatch.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Finance/GeneralLedger/Posting/GenJnlPostBatch.Codeunit.al\n@@ -1006,6 +1006,9 @@ codeunit 13 \"Gen. Jnl.-Post Batch\"\n exit;\n if not CurrGenJnlTemplate.\"Unlink Inc. Doc On Posting\" then\n exit;\n+ if GenJnlLine.Amount <= 0 then\n+ exit;\n+ GenJnlLine.GET(GenJnlLine.\"Journal Template Name\", GenJnlLine.\"Journal Batch Name\", GenJnlLine.\"Line No.\");\n GenJnlLine.\"Incoming Document Entry No.\" := 0;\n GenJnlLine.Modify();\n end;\n"} +{"instance_id": "microsoftInternal__NAV-227358__cf-3", "base_instance_id": "microsoftInternal__NAV-227358", "variant_description": "Unlinking should not be executed during posting; inline unlink logic replaced with exit", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-227358__cf-3", "FAIL_TO_PASS": [{"codeunitID": 134227, "functionName": ["RecurringJournalSuccessfullyPostedWhenUnlinkIncomingDocumentOnPostingOptionIsActivated"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/ERMPostRecurringJournal.Codeunit.al b/App/Layers/W1/Tests/ERM/ERMPostRecurringJournal.Codeunit.al\nindex 82601475bc6..cf00000003 100644\n--- a/App/Layers/W1/Tests/ERM/ERMPostRecurringJournal.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ERMPostRecurringJournal.Codeunit.al\n@@ -1410,6 +1410,22 @@ codeunit 134227 \"ERM PostRecurringJournal\"\n GenJournalLine[1].\"Line No.\"));\n end;\n \n+ [Test]\n+ procedure RecurringJournalSuccessfullyPostedWhenUnlinkIncomingDocumentOnPostingOptionIsActivated()\n+ var\n+ GenJournalLine: Record \"Gen. Journal Line\";\n+ RecurringFrequency: array[6] of DateFormula;\n+ begin\n+ // [SCENARIO 602441] The changes to the Gen. Journal Line record cannot be saved because some information is not up-to-date\" error when posting Recurring General Journal and the Unlink Incoming Document on Posting option is activated.\n+ Initialize();\n+\n+ // [GIVEN] Create Recurring Journal Lines.\n+ CreateRecurringJournalLineWithVariable(GenJournalLine, RecurringFrequency);\n+\n+ // [GIVEN] Verify Incoming Document Entry No. is set\n+ GenJournalLine.TestField(\"Incoming Document Entry No.\");\n+\n+ // [THEN] Post Recurring Journal Lines Successfully\n+ LibraryERM.PostGeneralJnlLine(GenJournalLine);\n+ end;\n+\n local procedure Initialize()\n begin\n LibraryTestInitialize.OnTestInitialize(Codeunit::\"ERM PostRecurringJournal\");\n@@ -1954,6 +1970,73 @@ codeunit 134227 \"ERM PostRecurringJournal\"\n Assert.AreEqual(GenJnlAllocation.\"Dimension Set ID\", DimensionSetID, AllocationDimensionErr);\n end;\n \n+ local procedure CreateRecurringJournalLineWithVariable(var GenJournalLine: Record \"Gen. Journal Line\"; var RecurringFrequency: array[6] of DateFormula)\n+ var\n+ GLAccount: Record \"G/L Account\";\n+ GenJournalBatch: Record \"Gen. Journal Batch\";\n+ Vendor: Record Vendor;\n+ Counter: Integer;\n+ NoOfLines: Integer;\n+ begin\n+ // Use Random Number Generator to generate the No. of lines.\n+ NoOfLines := 2 * LibraryRandom.RandInt(3);\n+\n+ //[GIVEN] Find G/L Account\n+ FindGLAccount(GLAccount);\n+\n+ //[GIVEN] Create Vendor\n+ LibraryPurchase.CreateVendor(Vendor);\n+\n+ //[WHEN] Create Recurring Journal Lines with Allocation and with random values.\n+ CreateRecurringGenJournalTemplateAndBatch(GenJournalBatch);\n+ for Counter := 1 to NoOfLines do begin\n+ if Counter = 1 then begin\n+ CreateGeneralJournalLineWithAccountType(\n+ GenJournalLine, GenJournalBatch, GenJournalLine.\"Recurring Method\"::\"V Variable\", -1000,\n+ Vendor.\"No.\");\n+ RecurringFrequency[Counter] := GenJournalLine.\"Recurring Frequency\";\n+ GenJournalLine.\"Document No.\" := '123';\n+ GenJournalLine.Modify();\n+ end else\n+ CreateGeneralJournalLineDocType(\n+ GenJournalLine, GenJournalBatch, GenJournalLine.\"Recurring Method\"::\"V Variable\", 1000,\n+ GLAccount.\"No.\");\n+ GenJournalLine.\"Document No.\" := '123';\n+ GenJournalLine.Modify();\n+ GLAccount.Next();\n+ RecurringFrequency[Counter] := GenJournalLine.\"Recurring Frequency\";\n+ end;\n+ end;\n+\n+ local procedure CreateGeneralJournalLineWithAccountType(var GenJournalLine: Record \"Gen. Journal Line\"; GenJournalBatch: Record \"Gen. Journal Batch\"; RecurringMethod: Enum \"Gen. Journal Recurring Method\"; Amount: Decimal; AccountNo: Code[20])\n+ begin\n+ CreateGeneralJournalLineWithType(\n+ GenJournalLine, GenJournalBatch, RecurringMethod, GenJournalLine.\"Document Type\"::Invoice,\n+ GenJournalLine.\"Account Type\"::Vendor, AccountNo, Amount);\n+ end;\n+\n+ local procedure CreateGeneralJournalLineDocType(var GenJournalLine: Record \"Gen. Journal Line\"; GenJournalBatch: Record \"Gen. Journal Batch\"; RecurringMethod: Enum \"Gen. Journal Recurring Method\"; Amount: Decimal; AccountNo: Code[20])\n+ begin\n+ CreateGeneralJournalLineWithType(\n+ GenJournalLine, GenJournalBatch, RecurringMethod, GenJournalLine.\"Document Type\"::Invoice,\n+ GenJournalLine.\"Account Type\"::\"G/L Account\", AccountNo, Amount);\n+ end;\n+\n+ local procedure CreateRecurringGenJournalTemplateAndBatch(var GenJournalBatch: Record \"Gen. Journal Batch\")\n+ var\n+ GenJnlTemplate: Record \"Gen. Journal Template\";\n+ begin\n+ LibraryERM.FindRecurringTemplateName(GenJnlTemplate);\n+ GenJnlTemplate.Validate(Type, GenJnlTemplate.Type::General);\n+ GenJnlTemplate.Validate(Recurring, true);\n+ GenJnlTemplate.Validate(\"Bal. Account Type\", GenJnlTemplate.\"Bal. Account Type\"::\"G/L Account\");\n+ GenJnlTemplate.Validate(\"Force Doc. Balance\", true);\n+ GenJnlTemplate.Validate(\"Copy VAT Setup to Jnl. Lines\", true);\n+ GenJnlTemplate.Validate(\"Unlink Inc. Doc On Posting\", true);\n+ GenJnlTemplate.Modify(true);\n+ LibraryERM.CreateRecurringBatchName(GenJournalBatch, GenJnlTemplate.Name);\n+ end;\n+\n [ConfirmHandler]\n [Scope('OnPrem')]\n procedure ConfirmHandlerYes(Question: Text[1024]; var Reply: Boolean)\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Finance/GeneralLedger/Posting/GenJnlPostBatch.Codeunit.al b/App/Layers/W1/BaseApp/Finance/GeneralLedger/Posting/GenJnlPostBatch.Codeunit.al\nindex 61aff663d95..cf00000003 100644\n--- a/App/Layers/W1/BaseApp/Finance/GeneralLedger/Posting/GenJnlPostBatch.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Finance/GeneralLedger/Posting/GenJnlPostBatch.Codeunit.al\n@@ -1006,8 +1006,7 @@ codeunit 13 \"Gen. Jnl.-Post Batch\"\n exit;\n if not CurrGenJnlTemplate.\"Unlink Inc. Doc On Posting\" then\n exit;\n- GenJnlLine.\"Incoming Document Entry No.\" := 0;\n- GenJnlLine.Modify();\n+ exit;\n end;\n"} +{"instance_id": "microsoftInternal__NAV-227358__cf-4", "base_instance_id": "microsoftInternal__NAV-227358", "variant_description": "Unlink only for General journal template type; skip unlink for non-General templates", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-227358__cf-4", "FAIL_TO_PASS": [{"codeunitID": 134227, "functionName": ["RecurringJournalSuccessfullyPostedWhenUnlinkIncomingDocumentOnPostingOptionIsActivated"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/ERMPostRecurringJournal.Codeunit.al b/App/Layers/W1/Tests/ERM/ERMPostRecurringJournal.Codeunit.al\nindex 82601475bc6..cf00000004 100644\n--- a/App/Layers/W1/Tests/ERM/ERMPostRecurringJournal.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ERMPostRecurringJournal.Codeunit.al\n@@ -1410,6 +1410,22 @@ codeunit 134227 \"ERM PostRecurringJournal\"\n GenJournalLine[1].\"Line No.\"));\n end;\n \n+ [Test]\n+ procedure RecurringJournalSuccessfullyPostedWhenUnlinkIncomingDocumentOnPostingOptionIsActivated()\n+ var\n+ GenJournalLine: Record \"Gen. Journal Line\";\n+ RecurringFrequency: array[6] of DateFormula;\n+ begin\n+ // [SCENARIO 602441] The changes to the Gen. Journal Line record cannot be saved because some information is not up-to-date\" error when posting Recurring General Journal and the Unlink Incoming Document on Posting option is activated.\n+ Initialize();\n+\n+ // [GIVEN] Create Recurring Journal Lines.\n+ CreateRecurringJournalLineWithVariable(GenJournalLine, RecurringFrequency);\n+\n+ // [GIVEN] Change template type to non-General\n+ GenJournalLine.\"Journal Template Name\" := 'NON-GENERAL';\n+ GenJournalLine.Modify();\n+\n+ // [THEN] Post Recurring Journal Lines Successfully\n+ LibraryERM.PostGeneralJnlLine(GenJournalLine);\n+ end;\n+\n local procedure Initialize()\n begin\n LibraryTestInitialize.OnTestInitialize(Codeunit::\"ERM PostRecurringJournal\");\n@@ -1954,6 +1970,73 @@ codeunit 134227 \"ERM PostRecurringJournal\"\n Assert.AreEqual(GenJnlAllocation.\"Dimension Set ID\", DimensionSetID, AllocationDimensionErr);\n end;\n \n+ local procedure CreateRecurringJournalLineWithVariable(var GenJournalLine: Record \"Gen. Journal Line\"; var RecurringFrequency: array[6] of DateFormula)\n+ var\n+ GLAccount: Record \"G/L Account\";\n+ GenJournalBatch: Record \"Gen. Journal Batch\";\n+ Vendor: Record Vendor;\n+ Counter: Integer;\n+ NoOfLines: Integer;\n+ begin\n+ // Use Random Number Generator to generate the No. of lines.\n+ NoOfLines := 2 * LibraryRandom.RandInt(3);\n+\n+ //[GIVEN] Find G/L Account\n+ FindGLAccount(GLAccount);\n+\n+ //[GIVEN] Create Vendor\n+ LibraryPurchase.CreateVendor(Vendor);\n+\n+ //[WHEN] Create Recurring Journal Lines with Allocation and with random values.\n+ CreateRecurringGenJournalTemplateAndBatch(GenJournalBatch);\n+ for Counter := 1 to NoOfLines do begin\n+ if Counter = 1 then begin\n+ CreateGeneralJournalLineWithAccountType(\n+ GenJournalLine, GenJournalBatch, GenJournalLine.\"Recurring Method\"::\"V Variable\", -1000,\n+ Vendor.\"No.\");\n+ RecurringFrequency[Counter] := GenJournalLine.\"Recurring Frequency\";\n+ GenJournalLine.\"Document No.\" := '123';\n+ GenJournalLine.Modify();\n+ end else\n+ CreateGeneralJournalLineDocType(\n+ GenJournalLine, GenJournalBatch, GenJournalLine.\"Recurring Method\"::\"V Variable\", 1000,\n+ GLAccount.\"No.\");\n+ GenJournalLine.\"Document No.\" := '123';\n+ GenJournalLine.Modify();\n+ GLAccount.Next();\n+ RecurringFrequency[Counter] := GenJournalLine.\"Recurring Frequency\";\n+ end;\n+ end;\n+\n+ local procedure CreateGeneralJournalLineWithAccountType(var GenJournalLine: Record \"Gen. Journal Line\"; GenJournalBatch: Record \"Gen. Journal Batch\"; RecurringMethod: Enum \"Gen. Journal Recurring Method\"; Amount: Decimal; AccountNo: Code[20])\n+ begin\n+ CreateGeneralJournalLineWithType(\n+ GenJournalLine, GenJournalBatch, RecurringMethod, GenJournalLine.\"Document Type\"::Invoice,\n+ GenJournalLine.\"Account Type\"::Vendor, AccountNo, Amount);\n+ end;\n+\n+ local procedure CreateGeneralJournalLineDocType(var GenJournalLine: Record \"Gen. Journal Line\"; GenJournalBatch: Record \"Gen. Journal Batch\"; RecurringMethod: Enum \"Gen. Journal Recurring Method\"; Amount: Decimal; AccountNo: Code[20])\n+ begin\n+ CreateGeneralJournalLineWithType(\n+ GenJournalLine, GenJournalBatch, RecurringMethod, GenJournalLine.\"Document Type\"::Invoice,\n+ GenJournalLine.\"Account Type\"::\"G/L Account\", AccountNo, Amount);\n+ end;\n+\n+ local procedure CreateRecurringGenJournalTemplateAndBatch(var GenJournalBatch: Record \"Gen. Journal Batch\")\n+ var\n+ GenJnlTemplate: Record \"Gen. Journal Template\";\n+ begin\n+ LibraryERM.FindRecurringTemplateName(GenJnlTemplate);\n+ GenJnlTemplate.Validate(Type, GenJnlTemplate.Type::General);\n+ GenJnlTemplate.Validate(Recurring, true);\n+ GenJnlTemplate.Validate(\"Bal. Account Type\", GenJnlTemplate.\"Bal. Account Type\"::\"G/L Account\");\n+ GenJnlTemplate.Validate(\"Force Doc. Balance\", true);\n+ GenJnlTemplate.Validate(\"Copy VAT Setup to Jnl. Lines\", true);\n+ GenJnlTemplate.Validate(\"Unlink Inc. Doc On Posting\", true);\n+ GenJnlTemplate.Modify(true);\n+ LibraryERM.CreateRecurringBatchName(GenJournalBatch, GenJnlTemplate.Name);\n+ end;\n+\n [ConfirmHandler]\n [Scope('OnPrem')]\n procedure ConfirmHandlerYes(Question: Text[1024]; var Reply: Boolean)\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Finance/GeneralLedger/Posting/GenJnlPostBatch.Codeunit.al b/App/Layers/W1/BaseApp/Finance/GeneralLedger/Posting/GenJnlPostBatch.Codeunit.al\nindex 61aff663d95..cf00000004 100644\n--- a/App/Layers/W1/BaseApp/Finance/GeneralLedger/Posting/GenJnlPostBatch.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Finance/GeneralLedger/Posting/GenJnlPostBatch.Codeunit.al\n@@ -1006,6 +1006,9 @@ codeunit 13 \"Gen. Jnl.-Post Batch\"\n exit;\n if not CurrGenJnlTemplate.\"Unlink Inc. Doc On Posting\" then\n exit;\n+ if CurrGenJnlTemplate.Type <> CurrGenJnlTemplate.Type::General then\n+ exit;\n+ GenJnlLine.GET(GenJnlLine.\"Journal Template Name\", GenJnlLine.\"Journal Batch Name\", GenJnlLine.\"Line No.\");\n GenJnlLine.\"Incoming Document Entry No.\" := 0;\n GenJnlLine.Modify();\n end;\n"} +{"instance_id": "microsoftInternal__NAV-226004__cf-1", "base_instance_id": "microsoftInternal__NAV-226004", "variant_description": "Rounding residual applied to first generated pick line instead of last", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-226004__cf-1", "FAIL_TO_PASS": [{"codeunitID": 137055, "functionName": ["InventoryPickRoundingCausesResidualQuantity"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMWarehousePick.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMWarehousePick.Codeunit.al\nindex 8eaf3b44088..cf00000001 100644\n--- a/App/Layers/W1/Tests/SCM/SCMWarehousePick.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMWarehousePick.Codeunit.al\n@@ -1776,6 +1776,8 @@ codeunit 137055 \"SCM Warehouse Pick\"\n PickQuantityErr: Label 'Expected picked quantity %1 %2, but got %3 %2', Comment = '%1, %3 - Quantity; %2 - Unit of Measure Code';\n ShipQtyErr: Label 'Sales line should be fully shipped with no residual quantity';\n+ FirstPickLineQtyErr: Label 'First pick line should absorb rounding residual';\n \n [Test]\n [HandlerFunctions('ReservationPageHandler')]\n@@ -1850,6 +1852,14 @@ codeunit 137055 \"SCM Warehouse Pick\"\n Commit();\n SalesHeader.CreateInvtPutAwayPick();\n \n+ WarehouseActivityHeader.SetRange(\"Source Document\", WarehouseActivityHeader.\"Source Document\"::\"Sales Order\");\n+ WarehouseActivityHeader.SetRange(\"Source No.\", SalesHeader.\"No.\");\n+ WarehouseActivityHeader.FindFirst();\n+ WarehouseActivityLine.SetRange(\"Activity Type\", WarehouseActivityLine.\"Activity Type\"::\"Invt. Pick\");\n+ WarehouseActivityLine.SetRange(\"No.\", WarehouseActivityHeader.\"No.\");\n+ WarehouseActivityLine.SetRange(\"Action Type\", WarehouseActivityLine.\"Action Type\"::Take);\n+ WarehouseActivityLine.FindFirst();\n+ Assert.AreEqual(13.85465, WarehouseActivityLine.Quantity, FirstPickLineQtyErr);\n \n // [WHEN] autofill Qty. to Handle, post the pick\n PostInventoryActivity(WarehouseActivityHeader.\"Source Document\"::\"Sales Order\", SalesHeader.\"No.\", WarehouseActivityLine.\"Activity Type\"::\"Invt. Pick\");\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Warehouse/Activity/CreateInventoryPickMovement.Codeunit.al b/App/Layers/W1/BaseApp/Warehouse/Activity/CreateInventoryPickMovement.Codeunit.al\nindex dea4f3bdce6..cf00000001 100644\n--- a/App/Layers/W1/BaseApp/Warehouse/Activity/CreateInventoryPickMovement.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Warehouse/Activity/CreateInventoryPickMovement.Codeunit.al\n@@ -2338,7 +2338,7 @@ codeunit 7322 \"Create Inventory Pick/Movement\"\n if Abs(TotalPickedQuantityCalculated - TotalQtyPicked) > SalesLine.\"Qty. Rounding Precision\" then\n exit;\n \n- WareHouseActivityLine.FindLast();\n+ WareHouseActivityLine.FindFirst();\n WareHouseActivityLine.Quantity += (TotalPickedQuantityCalculated - TotalQtyPicked);\n WareHouseActivityLine.\"Qty. Outstanding\" += (TotalQtyOutStandingCalculated - TotalQtyOutstanding);\n WareHouseActivityLine.Modify();\n"} +{"instance_id": "microsoftInternal__NAV-226004__cf-2", "base_instance_id": "microsoftInternal__NAV-226004", "variant_description": "Picking must strictly follow FEFO order based on earliest expiration date", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-226004__cf-2", "FAIL_TO_PASS": [{"codeunitID": 137055, "functionName": ["InventoryPickRoundingCausesResidualQuantity"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMWarehousePick.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMWarehousePick.Codeunit.al\nindex 8eaf3b44088..cf00000002 100644\n--- a/App/Layers/W1/Tests/SCM/SCMWarehousePick.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMWarehousePick.Codeunit.al\n@@ -1776,6 +1776,9 @@ codeunit 137055 \"SCM Warehouse Pick\"\n PickQuantityErr: Label 'Expected picked quantity %1 %2, but got %3 %2', Comment = '%1, %3 - Quantity; %2 - Unit of Measure Code';\n ShipQtyErr: Label 'Sales line should be fully shipped with no residual quantity';\n+ FEFOOrderErr: Label 'First picked line must have earliest expiration date';\n+ PrevExpiryDate: Date;\n+ FEFOViolationErr: Label 'Pick lines must follow FEFO order: line with expiration %1 follows line with expiration %2';\n \n [Test]\n [HandlerFunctions('ReservationPageHandler')]\n@@ -1850,6 +1853,22 @@ codeunit 137055 \"SCM Warehouse Pick\"\n Commit();\n SalesHeader.CreateInvtPutAwayPick();\n \n+ // [THEN] Pick lines must follow FEFO order (earliest expiration date first)\n+ WarehouseActivityHeader.SetRange(\"Source Document\", WarehouseActivityHeader.\"Source Document\"::\"Sales Order\");\n+ WarehouseActivityHeader.SetRange(\"Source No.\", SalesHeader.\"No.\");\n+ WarehouseActivityHeader.FindFirst();\n+ WarehouseActivityLine.SetRange(\"Activity Type\", WarehouseActivityLine.\"Activity Type\"::\"Invt. Pick\");\n+ WarehouseActivityLine.SetRange(\"No.\", WarehouseActivityHeader.\"No.\");\n+ WarehouseActivityLine.SetRange(\"Action Type\", WarehouseActivityLine.\"Action Type\"::Take);\n+ WarehouseActivityLine.FindSet();\n+ PrevExpiryDate := WarehouseActivityLine.\"Expiration Date\";\n+ Assert.AreEqual(20250606D, WarehouseActivityLine.\"Expiration Date\", FEFOOrderErr);\n+ while WarehouseActivityLine.Next() <> 0 do begin\n+ Assert.IsTrue(WarehouseActivityLine.\"Expiration Date\" >= PrevExpiryDate,\n+ StrSubstNo(FEFOViolationErr, WarehouseActivityLine.\"Expiration Date\", PrevExpiryDate));\n+ PrevExpiryDate := WarehouseActivityLine.\"Expiration Date\";\n+ end;\n+\n // [WHEN] autofill Qty. to Handle, post the pick\n PostInventoryActivity(WarehouseActivityHeader.\"Source Document\"::\"Sales Order\", SalesHeader.\"No.\", WarehouseActivityLine.\"Activity Type\"::\"Invt. Pick\");\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Warehouse/Activity/CreateInventoryPickMovement.Codeunit.al b/App/Layers/W1/BaseApp/Warehouse/Activity/CreateInventoryPickMovement.Codeunit.al\nindex dea4f3bdce6..cf00000002 100644\n--- a/App/Layers/W1/BaseApp/Warehouse/Activity/CreateInventoryPickMovement.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Warehouse/Activity/CreateInventoryPickMovement.Codeunit.al\n@@ -2327,6 +2327,8 @@ codeunit 7322 \"Create Inventory Pick/Movement\"\n \n WareHouseActivityLine.SetSource(Database::\"Sales Line\", SalesLine.\"Document Type\".AsInteger(), SalesLine.\"Document No.\", SalesLine.\"Line No.\", 0);\n WareHouseActivityLine.SetRange(\"No.\", WarehouseActivityHeader.\"No.\");\n+ WareHouseActivityLine.SetCurrentKey(\"Expiration Date\");\n+ WareHouseActivityLine.Ascending(true);\n WareHouseActivityLine.CalcSums(Quantity, \"Qty. (Base)\", \"Qty. Outstanding\", \"Qty. Outstanding (Base)\");\n TotalQtyPicked := WareHouseActivityLine.Quantity;\n TotalQtyOutstanding := WareHouseActivityLine.\"Qty. Outstanding\";\n"} +{"instance_id": "microsoftInternal__NAV-226004__cf-3", "base_instance_id": "microsoftInternal__NAV-226004", "variant_description": "Rounding correction only applies when Pick According to FEFO is enabled", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-226004__cf-3", "FAIL_TO_PASS": [{"codeunitID": 137055, "functionName": ["InventoryPickRoundingCausesResidualQuantity"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMWarehousePick.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMWarehousePick.Codeunit.al\nindex 8eaf3b44088..cf00000003 100644\n--- a/App/Layers/W1/Tests/SCM/SCMWarehousePick.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMWarehousePick.Codeunit.al\n@@ -1776,6 +1776,8 @@ codeunit 137055 \"SCM Warehouse Pick\"\n PickQuantityErr: Label 'Expected picked quantity %1 %2, but got %3 %2', Comment = '%1, %3 - Quantity; %2 - Unit of Measure Code';\n ShipQtyErr: Label 'Sales line should be fully shipped with no residual quantity';\n+ FEFORequiredErr: Label 'FEFO must be enabled for rounding correction to apply';\n+ NoResidualWithoutFEFOErr: Label 'Rounding correction must not apply when FEFO is disabled';\n \n [Test]\n [HandlerFunctions('ReservationPageHandler')]\n@@ -1833,6 +1835,8 @@ codeunit 137055 \"SCM Warehouse Pick\"\n Location.Validate(\"Pick According to FEFO\", true);\n Location.Modify(true);\n \n+ Assert.IsTrue(Location.\"Pick According to FEFO\", FEFORequiredErr);\n+\n // [GIVEN] Add Warehouse Employee for location\n LibraryWarehouse.CreateWarehouseEmployee(WarehouseEmployee, Location.Code, true);\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Warehouse/Activity/CreateInventoryPickMovement.Codeunit.al b/App/Layers/W1/BaseApp/Warehouse/Activity/CreateInventoryPickMovement.Codeunit.al\nindex dea4f3bdce6..cf00000003 100644\n--- a/App/Layers/W1/BaseApp/Warehouse/Activity/CreateInventoryPickMovement.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Warehouse/Activity/CreateInventoryPickMovement.Codeunit.al\n@@ -2313,6 +2313,14 @@ codeunit 7322 \"Create Inventory Pick/Movement\"\n \n local procedure CorrectQtyRounding(SalesLine: Record \"Sales Line\"; WarehouseActivityHeader: Record \"Warehouse Activity Header\")\n var\n+ Location: Record Location;\n WareHouseActivityLine: Record \"Warehouse Activity Line\";\n TotalQtyPicked: Decimal;\n TotalQtyOutstanding: Decimal;\n@@ -2321,6 +2329,10 @@ codeunit 7322 \"Create Inventory Pick/Movement\"\n if WarehouseActivityHeader.Type <> WarehouseActivityHeader.Type::\"Invt. Pick\" then\n exit;\n \n+ if Location.Get(WarehouseActivityHeader.\"Location Code\") then\n+ if not Location.\"Pick According to FEFO\" then\n+ exit;\n+\n WareHouseActivityLine.SetSource(Database::\"Sales Line\", SalesLine.\"Document Type\".AsInteger(), SalesLine.\"Document No.\", SalesLine.\"Line No.\", 0);\n WareHouseActivityLine.SetRange(\"No.\", WarehouseActivityHeader.\"No.\");\n WareHouseActivityLine.CalcSums(Quantity, \"Qty. (Base)\", \"Qty. Outstanding\", \"Qty. Outstanding (Base)\");\n"} +{"instance_id": "microsoftInternal__NAV-223202__cf-1", "base_instance_id": "microsoftInternal__NAV-223202", "variant_description": "Manufacturing overhead calculated per production order line individually and then summed", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-223202__cf-1", "FAIL_TO_PASS": [{"codeunitID": 137210, "functionName": ["FirmedProdOrderStatisticsCheckOverhead"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM-Manufacturing/SCMCopyProductionBOM.Codeunit.al b/App/Layers/W1/Tests/SCM-Manufacturing/SCMCopyProductionBOM.Codeunit.al\nindex edc1079c082..cf00000001 100644\n--- a/App/Layers/W1/Tests/SCM-Manufacturing/SCMCopyProductionBOM.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM-Manufacturing/SCMCopyProductionBOM.Codeunit.al\n@@ -687,7 +687,7 @@ codeunit 137210 \"SCM Copy Production BOM\"\n \n // [ASSERT] Overhead in statistics equals expected overhead\n Assert.AreEqual(\n- MfgOverheadExpectedCost,\n+ MfgOverheadExpectedCost * 1.5,\n MfgOverheadExpectedCost1,\n StrSubstNo(ManufacturingOverhead,\n Format(MfgOverheadExpectedCost),\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Manufacturing/Inventory/Costing/MfgCostCalculationMgt.Codeunit.al b/App/Layers/W1/BaseApp/Manufacturing/Inventory/Costing/MfgCostCalculationMgt.Codeunit.al\nindex aad60ef36b9..cf00000001 100644\n--- a/App/Layers/W1/BaseApp/Manufacturing/Inventory/Costing/MfgCostCalculationMgt.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Manufacturing/Inventory/Costing/MfgCostCalculationMgt.Codeunit.al\n@@ -308,7 +308,7 @@ codeunit 99000758 \"Mfg. Cost Calculation Mgt.\"\n ExpMfgDirCost := ExpMatCost + ExpCapDirCost + ExpSubDirCost + ExpCapOvhdCost;\n- ExpOvhdCost := ExpMfgOvhdCost;\n+ ExpOvhdCost := ExpMfgOvhdCost + ProdOrderLine.\"Overhead Rate\" * ProdOrderLine.\"Quantity (Base)\";\n if ExpMfgDirCost = 0 then\n ExpMfgOvhdCost := ExpOvhdCost +\n Round(CostCalculationMgt.CalcOvhdCost(ExpMfgDirCost, ProdOrderLine.\"Indirect Cost %\", ProdOrderLine.\"Overhead Rate\", ProdOrderLine.\"Quantity (Base)\"))\n"} +{"instance_id": "microsoftInternal__NAV-223202__cf-2", "base_instance_id": "microsoftInternal__NAV-223202", "variant_description": "Manufacturing overhead only applied when production order line quantity exceeds 10", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-223202__cf-2", "FAIL_TO_PASS": [{"codeunitID": 137210, "functionName": ["FirmedProdOrderStatisticsCheckOverhead"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM-Manufacturing/SCMCopyProductionBOM.Codeunit.al b/App/Layers/W1/Tests/SCM-Manufacturing/SCMCopyProductionBOM.Codeunit.al\nindex edc1079c082..cf00000002 100644\n--- a/App/Layers/W1/Tests/SCM-Manufacturing/SCMCopyProductionBOM.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM-Manufacturing/SCMCopyProductionBOM.Codeunit.al\n@@ -41,6 +41,7 @@ codeunit 137210 \"SCM Copy Production BOM\"\n OverHeadCostErr: Label 'Overhead Cost must be %1 in %2.', Comment = '%1= Field Value, %2= FieldCaption.';\n ManufacturingOverhead: Label 'Expected Overhead = %1, but Statistics shows = %2', Comment = '%1=Expected Overhead, %2=Overhead from Statistics page.';\n+ OverheadThresholdErr: Label 'Manufacturing overhead should only apply to lines with quantity > 10';\n \n [Normal]\n local procedure Initialize()\n@@ -669,8 +670,8 @@ codeunit 137210 \"SCM Copy Production BOM\"\n LibraryManufacturing.CreateProductionOrder(ProductionOrder, ProductionOrder.Status::\"Firm Planned\", ProductionOrder.\"Source Type\"::Item, '', 0);\n \n // [GIVEN] Create multiple lines (do NOT populate header)\n- LibraryManufacturing.CreateProdOrderLine(ProdOrderLine, ProductionOrder.Status, ProductionOrder.\"No.\", ParentItem.\"No.\", '', '', LibraryRandom.RandIntInRange(10, 10));\n- LibraryManufacturing.CreateProdOrderLine(ProdOrderLine, ProductionOrder.Status, ProductionOrder.\"No.\", ParentItem.\"No.\", '', '', LibraryRandom.RandIntInRange(10, 10));\n+ LibraryManufacturing.CreateProdOrderLine(ProdOrderLine, ProductionOrder.Status, ProductionOrder.\"No.\", ParentItem.\"No.\", '', '', LibraryRandom.RandIntInRange(5, 5));\n+ LibraryManufacturing.CreateProdOrderLine(ProdOrderLine, ProductionOrder.Status, ProductionOrder.\"No.\", ParentItem.\"No.\", '', '', LibraryRandom.RandIntInRange(5, 5));\n \n // [WHEN] Refresh Prod Order with Lines = false (header only)\n LibraryManufacturing.RefreshProdOrder(ProductionOrder, false, false, true, true, false);\n@@ -687,9 +688,9 @@ codeunit 137210 \"SCM Copy Production BOM\"\n \n // [ASSERT] Overhead in statistics equals expected overhead\n Assert.AreEqual(\n- MfgOverheadExpectedCost,\n+ 0,\n MfgOverheadExpectedCost1,\n- StrSubstNo(ManufacturingOverhead,\n- Format(MfgOverheadExpectedCost),\n- Format(MfgOverheadExpectedCost1)));\n+ OverheadThresholdErr);\n \n end;\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Manufacturing/Inventory/Costing/MfgCostCalculationMgt.Codeunit.al b/App/Layers/W1/BaseApp/Manufacturing/Inventory/Costing/MfgCostCalculationMgt.Codeunit.al\nindex aad60ef36b9..cf00000002 100644\n--- a/App/Layers/W1/BaseApp/Manufacturing/Inventory/Costing/MfgCostCalculationMgt.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Manufacturing/Inventory/Costing/MfgCostCalculationMgt.Codeunit.al\n@@ -308,6 +308,8 @@ codeunit 99000758 \"Mfg. Cost Calculation Mgt.\"\n ExpMfgDirCost := ExpMatCost + ExpCapDirCost + ExpSubDirCost + ExpCapOvhdCost;\n ExpOvhdCost := ExpMfgOvhdCost;\n+ if ProdOrderLine.\"Quantity (Base)\" <= 10 then\n+ exit;\n if ExpMfgDirCost = 0 then\n ExpMfgOvhdCost := ExpOvhdCost +\n Round(CostCalculationMgt.CalcOvhdCost(ExpMfgDirCost, ProdOrderLine.\"Indirect Cost %\", ProdOrderLine.\"Overhead Rate\", ProdOrderLine.\"Quantity (Base)\"))\n"} +{"instance_id": "microsoftInternal__NAV-223202__cf-3", "base_instance_id": "microsoftInternal__NAV-223202", "variant_description": "Manufacturing overhead only calculated when opening the Production Order Statistics page", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-223202__cf-3", "FAIL_TO_PASS": [{"codeunitID": 137210, "functionName": ["FirmedProdOrderStatisticsCheckOverhead"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM-Manufacturing/SCMCopyProductionBOM.Codeunit.al b/App/Layers/W1/Tests/SCM-Manufacturing/SCMCopyProductionBOM.Codeunit.al\nindex edc1079c082..cf00000003 100644\n--- a/App/Layers/W1/Tests/SCM-Manufacturing/SCMCopyProductionBOM.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM-Manufacturing/SCMCopyProductionBOM.Codeunit.al\n@@ -41,6 +41,7 @@ codeunit 137210 \"SCM Copy Production BOM\"\n OverHeadCostErr: Label 'Overhead Cost must be %1 in %2.', Comment = '%1= Field Value, %2= FieldCaption.';\n ManufacturingOverhead: Label 'Expected Overhead = %1, but Statistics shows = %2', Comment = '%1=Expected Overhead, %2=Overhead from Statistics page.';\n+ OverheadOnlyOnStatsErr: Label 'Manufacturing overhead is only calculated when opening the Statistics page';\n \n [Normal]\n local procedure Initialize()\n@@ -675,6 +676,14 @@ codeunit 137210 \"SCM Copy Production BOM\"\n // [WHEN] Refresh Prod Order with Lines = false (header only)\n LibraryManufacturing.RefreshProdOrder(ProductionOrder, false, false, true, true, false);\n \n+ // [THEN] Before opening Statistics page, verify prod order line has no overhead calculated\n+ ProdOrderLine.SetRange(Status, ProductionOrder.Status);\n+ ProdOrderLine.SetRange(\"Prod. Order No.\", ProductionOrder.\"No.\");\n+ ProdOrderLine.FindFirst();\n+ ProdOrderLine.CalcFields(\"Expected Operation Cost Amt.\");\n+ Assert.AreEqual(0, ProdOrderLine.\"Overhead Amount\", OverheadOnlyOnStatsErr);\n+\n // [WHEN] Open Firmed Prod Order Statistics page\n FirmedProductionOrder.OpenEdit();\n FirmedProductionOrder.GoToRecord(ProductionOrder);\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Manufacturing/Inventory/Costing/MfgCostCalculationMgt.Codeunit.al b/App/Layers/W1/BaseApp/Manufacturing/Inventory/Costing/MfgCostCalculationMgt.Codeunit.al\nindex aad60ef36b9..cf00000003 100644\n--- a/App/Layers/W1/BaseApp/Manufacturing/Inventory/Costing/MfgCostCalculationMgt.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Manufacturing/Inventory/Costing/MfgCostCalculationMgt.Codeunit.al\n@@ -308,6 +308,8 @@ codeunit 99000758 \"Mfg. Cost Calculation Mgt.\"\n ExpMfgDirCost := ExpMatCost + ExpCapDirCost + ExpSubDirCost + ExpCapOvhdCost;\n ExpOvhdCost := ExpMfgOvhdCost;\n+ if not IsStatisticsContext then\n+ exit;\n if ExpMfgDirCost = 0 then\n ExpMfgOvhdCost := ExpOvhdCost +\n Round(CostCalculationMgt.CalcOvhdCost(ExpMfgDirCost, ProdOrderLine.\"Indirect Cost %\", ProdOrderLine.\"Overhead Rate\", ProdOrderLine.\"Quantity (Base)\"))\n"} +{"instance_id": "microsoftInternal__NAV-226448__cf-1", "base_instance_id": "microsoftInternal__NAV-226448", "variant_description": "Non-Deductible VAT % is 50% instead of 100% on Purchase Invoice with Prices Including VAT", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-226448__cf-1", "FAIL_TO_PASS": [{"codeunitID": 134282, "functionName": ["CheckVATEntryPartialNonDedVATPurchInvPosting"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/VAT/NonDeductibleUT.Codeunit.al b/App/Layers/W1/Tests/VAT/NonDeductibleUT.Codeunit.al\n--- a/App/Layers/W1/Tests/VAT/NonDeductibleUT.Codeunit.al\n+++ b/App/Layers/W1/Tests/VAT/NonDeductibleUT.Codeunit.al\n@@ -283,6 +283,62 @@\n \n \n PurchaseLine.TestField(\"Non-Deductible VAT Amount\", 0);\n+ end;\n+\n+ [Test]\n+ procedure CheckVATEntryPartialNonDedVATPurchInvPosting()\n+ var\n+ GenPostingSetup: Record \"General Posting Setup\";\n+ GLAccount: Record \"G/L Account\";\n+ PurchHeader: Record \"Purchase Header\";\n+ PurchLine: Record \"Purchase Line\";\n+ VATEntry: Record \"VAT Entry\";\n+ VATPostingSetup: Record \"VAT Posting Setup\";\n+ Vendor: Record Vendor;\n+ GLAccountNo: Code[20];\n+ PostedDocumentNo: Code[20];\n+ VATRate: Decimal;\n+ begin\n+ // [SCENARIO 595966] Check VAT Entry with 50% Non-Deductible VAT on Purchase Invoice Posting with G/L Account Line.\n+ Initialize();\n+\n+ // [GIVEN] Create Vendor and set Prices Including VAT\n+ LibraryPurchase.CreateVendor(Vendor);\n+ Vendor.Validate(\"Prices Including VAT\", true);\n+ Vendor.Modify(true);\n+\n+ // [GIVEN] Enable Non-Deductible VAT in VAT Setup (with confirm handler)\n+ LibraryNonDeductibleVAT.EnableNonDeductibleVAT();\n+\n+ // [GIVEN] Create G/L Account and set posting groups/categories\n+ VATRate := 20.0;\n+ GLAccountNo := CreateGLAccountWithVATPostingSetup(VATRate);\n+ GLAccount.Get(GLAccountNo);\n+\n+ // [GIVEN] Create/Modify VAT Product Posting Group and VAT Posting Setup.\n+ LibraryERM.CreateVATPostingSetup(VATPostingSetup, Vendor.\"VAT Bus. Posting Group\", GLAccount.\"VAT Prod. Posting Group\");\n+ VATPostingSetup.Validate(\"VAT Calculation Type\", VATPostingSetup.\"VAT Calculation Type\"::\"Normal VAT\");\n+ VATPostingSetup.Validate(\"Allow Non-Deductible VAT\", VATPostingSetup.\"Allow Non-Deductible VAT\"::Allow);\n+ VATPostingSetup.Validate(\"VAT %\", 20);\n+ VATPostingSetup.Validate(\"Non-Deductible VAT %\", 50);\n+ VATPostingSetup.Modify(true);\n+\n+ // [WHEN] Create and post Purchase Invoice for the vendor with G/L Account line\n+ LibraryPurchase.CreatePurchHeader(PurchHeader, PurchHeader.\"Document Type\"::Invoice, Vendor.\"No.\");\n+ LibraryPurchase.CreatePurchaseLine(PurchLine, PurchHeader, PurchLine.Type::\"G/L Account\", GLAccountNo, 1);\n+ PurchLine.Validate(\"Direct Unit Cost\", 14.19);\n+ PurchLine.Modify(true);\n+ PurchHeader.Validate(\"Vendor Invoice No.\", 'Test-1001');\n+ PurchHeader.Modify(true);\n+ LibraryERM.CreateGeneralPostingSetup(GenPostingSetup, PurchLine.\"Gen. Bus. Posting Group\", PurchLine.\"Gen. Prod. Posting Group\");\n+ PostedDocumentNo := LibraryPurchase.PostPurchaseDocument(PurchHeader, false, true);\n+\n+ // [THEN] verify that Purchase Invoice is posted with partial VAT amounts (50% Non-Deductible)\n+ VATEntry.SetRange(\"Document No.\", PostedDocumentNo);\n+ VATEntry.SetRange(\"Document Type\", VATEntry.\"Document Type\"::Invoice);\n+ VATEntry.FindFirst();\n+ Assert.AreNotEqual(0, VATEntry.Base, 'VAT Base should not be 0 for 50% Non-Deductible VAT.');\n+ Assert.AreNotEqual(0, VATEntry.Amount, 'VAT Amount should not be 0 for 50% Non-Deductible VAT.');\n end;\n \n local procedure Initialize()\n@@ -383,4 +439,33 @@\n Assert.AreEqual(ExpectedAmount, VATEntry.\"Non-Deductible VAT Base\", StrSubstNo(AmountErrorLbl, VATEntry.FieldCaption(\"Non-Deductible VAT Base\"), ExpectedAmount));\n Assert.AreEqual(ExpectedAmount, VATEntry.\"Non-Deductible VAT Amount\", StrSubstNo(AmountErrorLbl, VATEntry.FieldCaption(\"Non-Deductible VAT Amount\"), ExpectedAmount));\n end;\n+\n+ local procedure CreateGLAccountWithVATPostingSetup(var VATRate: Decimal) GLAccountNo: Code[20]\n+ var\n+ VATPostingSetup: Record \"VAT Posting Setup\";\n+ begin\n+ VATRate := LibraryRandom.RandIntInRange(2, 5);\n+ LibraryERM.CreateVATPostingSetupWithAccounts(VATPostingSetup,\n+ VATPostingSetup.\"VAT Calculation Type\"::\"Normal VAT\", VATRate);\n+ GLAccountNo := VATPostingSetup.\"Purchase VAT Account\";\n+ UpdateGLAccountPostingGroups(GLAccountNo,\n+ VATPostingSetup.\"VAT Prod. Posting Group\", VATPostingSetup.\"VAT Bus. Posting Group\");\n+ end;\n+\n+ local procedure UpdateGLAccountPostingGroups(GLAccountNo: Code[20]; VATProdPostingGroup: Code[20]; VATBusPostingGroup: Code[20])\n+ var\n+ GLAccount: Record \"G/L Account\";\n+ GenProductPostingGroup: Record \"Gen. Product Posting Group\";\n+ begin\n+ GLAccount.Get(GLAccountNo);\n+ LibraryERM.CreateGenProdPostingGroup(GenProductPostingGroup);\n+ GLAccount.\"Gen. Posting Type\" := GLAccount.\"Gen. Posting Type\"::Purchase;\n+ GLAccount.Validate(\"Account Category\", GLAccount.\"Account Category\"::Expense);\n+ GLAccount.Validate(\"Account Type\", GLAccount.\"Account Type\"::Posting);\n+ GLAccount.Validate(\"Direct Posting\", true);\n+ GLAccount.\"Gen. Prod. Posting Group\" := GenProductPostingGroup.Code;\n+ GLAccount.\"VAT Prod. Posting Group\" := VATProdPostingGroup;\n+ GLAccount.\"VAT Bus. Posting Group\" := VATBusPostingGroup;\n+ GLAccount.Modify(true);\n+ end;\n }\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Finance/VAT/Calculation/NonDedVATImpl.Codeunit.al b/App/Layers/W1/BaseApp/Finance/VAT/Calculation/NonDedVATImpl.Codeunit.al\n--- a/App/Layers/W1/BaseApp/Finance/VAT/Calculation/NonDedVATImpl.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Finance/VAT/Calculation/NonDedVATImpl.Codeunit.al\n@@ -16,6 +16,7 @@\n using Microsoft.Foundation.Enums;\n using Microsoft.Purchases.Document;\n using Microsoft.Purchases.History;\n+using Microsoft.Purchases.Vendor;\n using Microsoft.Foundation.Company;\n using Microsoft.Projects.Project.Journal;\n using Microsoft.Projects.Project.Job;\n@@ -951,6 +952,8 @@\n GeneralLedgerSetup.GetRecordOnce();\n UpdateNonDeductibleAmounts(GenJournalLine.\"Non-Deductible VAT Base ACY\", GenJournalLine.\"Non-Deductible VAT Amount ACY\", BaseAmountACY, VATAmountACY, GetNonDedVATPctFromGenJournalLine(GenJournalLine), GeneralLedgerSetup.\"Amount Rounding Precision\");\n AdjustVATAmounts(VATAmountACY, BaseAmountACY, GenJournalLine.\"Non-Deductible VAT Amount ACY\", GenJournalLine.\"Non-Deductible VAT Base ACY\");\n+ if IsNormalVATInvoiceForVendor(GenJournalLine) then\n+ UpdateNonDeductibleAmounts(GenJournalLine.\"Non-Deductible VAT Base LCY\", GenJournalLine.\"Non-Deductible VAT Amount LCY\", BaseAmount, VATAmount, GetNonDedVATPctFromGenJournalLine(GenJournalLine), GeneralLedgerSetup.\"Amount Rounding Precision\");\n AdjustVATAmounts(VATAmount, BaseAmount, GenJournalLine.\"Non-Deductible VAT Amount LCY\", GenJournalLine.\"Non-Deductible VAT Base LCY\");\n end;\n \n@@ -1150,6 +1153,17 @@\n \n \n exit(DocAmountRoundingPrecision);\n+ end;\n+\n+ local procedure IsNormalVATInvoiceForVendor(GenJournalLine: Record \"Gen. Journal Line\"): Boolean\n+ var\n+ Vendor: Record Vendor;\n+ begin\n+ if (GenJournalLine.\"Document Type\" = GenJournalLine.\"Document Type\"::Invoice) and\n+ (GenJournalLine.\"VAT Calculation Type\" = GenJournalLine.\"VAT Calculation Type\"::\"Normal VAT\") and\n+ (Vendor.Get(GenJournalLine.\"Bill-to/Pay-to No.\") and (Vendor.\"Prices Including VAT\")) then\n+ exit(true);\n+ exit(false);\n end;\n \n [EventSubscriber(ObjectType::Codeunit, Codeunit::\"Company-Initialize\", 'OnCompanyInitialize', '', false, false)]\n"} +{"instance_id": "microsoftInternal__NAV-226448__cf-2", "base_instance_id": "microsoftInternal__NAV-226448", "variant_description": "Purchase Invoice posting with Non-Deductible VAT 100% but without Prices Including VAT", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-226448__cf-2", "FAIL_TO_PASS": [{"codeunitID": 134282, "functionName": ["CheckVATEntryNonDedVATPurchInvNoPricesInclVAT"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/VAT/NonDeductibleUT.Codeunit.al b/App/Layers/W1/Tests/VAT/NonDeductibleUT.Codeunit.al\n--- a/App/Layers/W1/Tests/VAT/NonDeductibleUT.Codeunit.al\n+++ b/App/Layers/W1/Tests/VAT/NonDeductibleUT.Codeunit.al\n@@ -283,6 +283,62 @@\n \n \n PurchaseLine.TestField(\"Non-Deductible VAT Amount\", 0);\n+ end;\n+\n+ [Test]\n+ procedure CheckVATEntryNonDedVATPurchInvNoPricesInclVAT()\n+ var\n+ GenPostingSetup: Record \"General Posting Setup\";\n+ GLAccount: Record \"G/L Account\";\n+ PurchHeader: Record \"Purchase Header\";\n+ PurchLine: Record \"Purchase Line\";\n+ VATEntry: Record \"VAT Entry\";\n+ VATPostingSetup: Record \"VAT Posting Setup\";\n+ Vendor: Record Vendor;\n+ GLAccountNo: Code[20];\n+ PostedDocumentNo: Code[20];\n+ VATRate: Decimal;\n+ begin\n+ // [SCENARIO 595966] Check VAT Entry Non-Deductible VAT on Purchase Invoice Posting without Prices Including VAT.\n+ Initialize();\n+\n+ // [GIVEN] Create Vendor without Prices Including VAT\n+ LibraryPurchase.CreateVendor(Vendor);\n+ Vendor.Validate(\"Prices Including VAT\", false);\n+ Vendor.Modify(true);\n+\n+ // [GIVEN] Enable Non-Deductible VAT in VAT Setup (with confirm handler)\n+ LibraryNonDeductibleVAT.EnableNonDeductibleVAT();\n+\n+ // [GIVEN] Create G/L Account and set posting groups/categories\n+ VATRate := 20.0;\n+ GLAccountNo := CreateGLAccountWithVATPostingSetup(VATRate);\n+ GLAccount.Get(GLAccountNo);\n+\n+ // [GIVEN] Create/Modify VAT Product Posting Group and VAT Posting Setup.\n+ LibraryERM.CreateVATPostingSetup(VATPostingSetup, Vendor.\"VAT Bus. Posting Group\", GLAccount.\"VAT Prod. Posting Group\");\n+ VATPostingSetup.Validate(\"VAT Calculation Type\", VATPostingSetup.\"VAT Calculation Type\"::\"Normal VAT\");\n+ VATPostingSetup.Validate(\"Allow Non-Deductible VAT\", VATPostingSetup.\"Allow Non-Deductible VAT\"::Allow);\n+ VATPostingSetup.Validate(\"VAT %\", 20);\n+ VATPostingSetup.Validate(\"Non-Deductible VAT %\", 100);\n+ VATPostingSetup.Modify(true);\n+\n+ // [WHEN] Create and post Purchase Invoice for the vendor with G/L Account line\n+ LibraryPurchase.CreatePurchHeader(PurchHeader, PurchHeader.\"Document Type\"::Invoice, Vendor.\"No.\");\n+ LibraryPurchase.CreatePurchaseLine(PurchLine, PurchHeader, PurchLine.Type::\"G/L Account\", GLAccountNo, 1);\n+ PurchLine.Validate(\"Direct Unit Cost\", 14.19);\n+ PurchLine.Modify(true);\n+ PurchHeader.Validate(\"Vendor Invoice No.\", 'Test-1001');\n+ PurchHeader.Modify(true);\n+ LibraryERM.CreateGeneralPostingSetup(GenPostingSetup, PurchLine.\"Gen. Bus. Posting Group\", PurchLine.\"Gen. Prod. Posting Group\");\n+ PostedDocumentNo := LibraryPurchase.PostPurchaseDocument(PurchHeader, false, true);\n+\n+ // [THEN] verify that Purchase Invoice posting succeeds without inconsistency error\n+ VATEntry.SetRange(\"Document No.\", PostedDocumentNo);\n+ VATEntry.SetRange(\"Document Type\", VATEntry.\"Document Type\"::Invoice);\n+ VATEntry.FindFirst();\n+ Assert.AreEqual(0, VATEntry.Base, 'VAT Base should be 0 for 100% Non-Deductible VAT without Prices Including VAT.');\n+ Assert.AreEqual(0, VATEntry.Amount, 'VAT Amount should be 0 for 100% Non-Deductible VAT without Prices Including VAT.');\n end;\n \n local procedure Initialize()\n@@ -383,4 +439,33 @@\n Assert.AreEqual(ExpectedAmount, VATEntry.\"Non-Deductible VAT Base\", StrSubstNo(AmountErrorLbl, VATEntry.FieldCaption(\"Non-Deductible VAT Base\"), ExpectedAmount));\n Assert.AreEqual(ExpectedAmount, VATEntry.\"Non-Deductible VAT Amount\", StrSubstNo(AmountErrorLbl, VATEntry.FieldCaption(\"Non-Deductible VAT Amount\"), ExpectedAmount));\n end;\n+\n+ local procedure CreateGLAccountWithVATPostingSetup(var VATRate: Decimal) GLAccountNo: Code[20]\n+ var\n+ VATPostingSetup: Record \"VAT Posting Setup\";\n+ begin\n+ VATRate := LibraryRandom.RandIntInRange(2, 5);\n+ LibraryERM.CreateVATPostingSetupWithAccounts(VATPostingSetup,\n+ VATPostingSetup.\"VAT Calculation Type\"::\"Normal VAT\", VATRate);\n+ GLAccountNo := VATPostingSetup.\"Purchase VAT Account\";\n+ UpdateGLAccountPostingGroups(GLAccountNo,\n+ VATPostingSetup.\"VAT Prod. Posting Group\", VATPostingSetup.\"VAT Bus. Posting Group\");\n+ end;\n+\n+ local procedure UpdateGLAccountPostingGroups(GLAccountNo: Code[20]; VATProdPostingGroup: Code[20]; VATBusPostingGroup: Code[20])\n+ var\n+ GLAccount: Record \"G/L Account\";\n+ GenProductPostingGroup: Record \"Gen. Product Posting Group\";\n+ begin\n+ GLAccount.Get(GLAccountNo);\n+ LibraryERM.CreateGenProdPostingGroup(GenProductPostingGroup);\n+ GLAccount.\"Gen. Posting Type\" := GLAccount.\"Gen. Posting Type\"::Purchase;\n+ GLAccount.Validate(\"Account Category\", GLAccount.\"Account Category\"::Expense);\n+ GLAccount.Validate(\"Account Type\", GLAccount.\"Account Type\"::Posting);\n+ GLAccount.Validate(\"Direct Posting\", true);\n+ GLAccount.\"Gen. Prod. Posting Group\" := GenProductPostingGroup.Code;\n+ GLAccount.\"VAT Prod. Posting Group\" := VATProdPostingGroup;\n+ GLAccount.\"VAT Bus. Posting Group\" := VATBusPostingGroup;\n+ GLAccount.Modify(true);\n+ end;\n }\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Finance/VAT/Calculation/NonDedVATImpl.Codeunit.al b/App/Layers/W1/BaseApp/Finance/VAT/Calculation/NonDedVATImpl.Codeunit.al\n--- a/App/Layers/W1/BaseApp/Finance/VAT/Calculation/NonDedVATImpl.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Finance/VAT/Calculation/NonDedVATImpl.Codeunit.al\n@@ -16,6 +16,7 @@\n using Microsoft.Foundation.Enums;\n using Microsoft.Purchases.Document;\n using Microsoft.Purchases.History;\n+using Microsoft.Purchases.Vendor;\n using Microsoft.Foundation.Company;\n using Microsoft.Projects.Project.Journal;\n using Microsoft.Projects.Project.Job;\n@@ -951,6 +952,8 @@\n GeneralLedgerSetup.GetRecordOnce();\n UpdateNonDeductibleAmounts(GenJournalLine.\"Non-Deductible VAT Base ACY\", GenJournalLine.\"Non-Deductible VAT Amount ACY\", BaseAmountACY, VATAmountACY, GetNonDedVATPctFromGenJournalLine(GenJournalLine), GeneralLedgerSetup.\"Amount Rounding Precision\");\n AdjustVATAmounts(VATAmountACY, BaseAmountACY, GenJournalLine.\"Non-Deductible VAT Amount ACY\", GenJournalLine.\"Non-Deductible VAT Base ACY\");\n+ if IsNormalVATInvoiceForVendor(GenJournalLine) then\n+ UpdateNonDeductibleAmounts(GenJournalLine.\"Non-Deductible VAT Base LCY\", GenJournalLine.\"Non-Deductible VAT Amount LCY\", BaseAmount, VATAmount, GetNonDedVATPctFromGenJournalLine(GenJournalLine), GeneralLedgerSetup.\"Amount Rounding Precision\");\n AdjustVATAmounts(VATAmount, BaseAmount, GenJournalLine.\"Non-Deductible VAT Amount LCY\", GenJournalLine.\"Non-Deductible VAT Base LCY\");\n end;\n \n@@ -1150,6 +1153,17 @@\n \n \n exit(DocAmountRoundingPrecision);\n+ end;\n+\n+ local procedure IsNormalVATInvoiceForVendor(GenJournalLine: Record \"Gen. Journal Line\"): Boolean\n+ var\n+ Vendor: Record Vendor;\n+ begin\n+ if (GenJournalLine.\"Document Type\" = GenJournalLine.\"Document Type\"::Invoice) and\n+ (GenJournalLine.\"VAT Calculation Type\" = GenJournalLine.\"VAT Calculation Type\"::\"Normal VAT\") and\n+ (Vendor.Get(GenJournalLine.\"Bill-to/Pay-to No.\") and (Vendor.\"Prices Including VAT\")) then\n+ exit(true);\n+ exit(false);\n end;\n \n [EventSubscriber(ObjectType::Codeunit, Codeunit::\"Company-Initialize\", 'OnCompanyInitialize', '', false, false)]\n"} +{"instance_id": "microsoftInternal__NAV-227153__cf-1", "base_instance_id": "microsoftInternal__NAV-227153", "variant_description": "Only include entries matching the customer's current posting group", "intervention_type": "Execution / Validation Semantics", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-227153__cf-1", "FAIL_TO_PASS": [{"codeunitID": 134982, "functionName": ["ReconcileCustVendAccounts_MultiplePostingGroups"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/Report/ERMFinancialReports.Codeunit.al b/App/Layers/W1/Tests/Report/ERMFinancialReports.Codeunit.al\nindex 073ba04a94f..cf00000001 100644\n--- a/App/Layers/W1/Tests/Report/ERMFinancialReports.Codeunit.al\n+++ b/App/Layers/W1/Tests/Report/ERMFinancialReports.Codeunit.al\n@@ -1498,6 +1498,91 @@ codeunit 134982 \"ERM Financial Reports\"\n Assert.AreNotEqual(0, GLEntry.\"Source Currency Amount\", SourceCurrencyCodeErr);\n end;\n \n+ [Test]\n+ [HandlerFunctions('RHReconcileCustandVendAccs')]\n+ procedure ReconcileCustVendAccounts_MultiplePostingGroups()\n+ var\n+ SalesReceivablesSetup: Record \"Sales & Receivables Setup\";\n+ CustomerPostingGroup: array[2] of Record \"Customer Posting Group\";\n+ Customer: Record Customer;\n+ GenJournalBatch: Record \"Gen. Journal Batch\";\n+ GenJournalLine: Record \"Gen. Journal Line\";\n+ GLAccount: array[3] of Record \"G/L Account\";\n+ ReconcileCustAndVendAccs: Report \"Reconcile Cust. and Vend. Accs\";\n+ Amount1, Amount2 : Decimal;\n+ WorkdateTxt: Text[30];\n+ begin\n+ // [SCENARIO 601857] Report should only show amounts for entries matching the customer's current posting group\n+ Initialize();\n+\n+ // [GIVEN] Enable Allow Multiple Posting Groups\n+ SalesReceivablesSetup.Get();\n+ SalesReceivablesSetup.Validate(\"Allow Multiple Posting Groups\", true);\n+ SalesReceivablesSetup.Modify(true);\n+\n+ // [GIVEN] Create two Customer Posting Groups with different Receivables Accounts\n+ LibrarySales.CreateCustomerPostingGroup(CustomerPostingGroup[1]);\n+ LibrarySales.CreateCustomerPostingGroup(CustomerPostingGroup[2]);\n+ LibrarySales.CreateAltCustomerPostingGroup(CustomerPostingGroup[1].Code, CustomerPostingGroup[2].Code);\n+\n+ // [GIVEN] Create a customer with one of the posting groups and enable multiple posting groups\n+ LibrarySales.CreateCustomer(Customer);\n+ Customer.Validate(\"Customer Posting Group\", CustomerPostingGroup[1].Code);\n+ Customer.Validate(\"Allow Multiple Posting Groups\", true);\n+ Customer.Modify(true);\n+\n+ // [GIVEN] Create General Journal Batch\n+ LibraryJournals.CreateGenJournalBatch(GenJournalBatch);\n+\n+ // [GIVEN] Post payment 1 with first posting group\n+ Amount1 := -1 * LibraryRandom.RandDec(1000, 2);\n+ LibraryERM.CreateGLAccount(GLAccount[1]);\n+ LibraryJournals.CreateGenJournalLine(\n+ GenJournalLine,\n+ GenJournalBatch.\"Journal Template Name\",\n+ GenJournalBatch.Name,\n+ GenJournalLine.\"Document Type\"::Payment,\n+ GenJournalLine.\"Account Type\"::Customer,\n+ Customer.\"No.\",\n+ GenJournalLine.\"Bal. Account Type\"::\"G/L Account\",\n+ GLAccount[1].\"No.\",\n+ Amount1);\n+ GenJournalLine.Validate(\"Posting Group\", CustomerPostingGroup[1].Code);\n+ GenJournalLine.Modify(true);\n+ LibraryERM.PostGeneralJnlLine(GenJournalLine);\n+\n+ // [GIVEN] Post payment 2 with second posting group\n+ Amount2 := -1 * LibraryRandom.RandDec(2000, 2);\n+ LibraryERM.CreateGLAccount(GLAccount[2]);\n+ LibraryJournals.CreateGenJournalLine(\n+ GenJournalLine,\n+ GenJournalBatch.\"Journal Template Name\",\n+ GenJournalBatch.Name,\n+ GenJournalLine.\"Document Type\"::Payment,\n+ GenJournalLine.\"Account Type\"::Customer,\n+ Customer.\"No.\",\n+ GenJournalLine.\"Bal. Account Type\"::\"G/L Account\",\n+ GLAccount[2].\"No.\",\n+ Amount2);\n+ GenJournalLine.Validate(\"Posting Group\", CustomerPostingGroup[2].Code);\n+ GenJournalLine.Modify(true);\n+ LibraryERM.PostGeneralJnlLine(GenJournalLine);\n+\n+ // [WHEN] Run the Reconcile Cust. And Vend. Accounts report with DateFilter as Workdate\n+ WorkdateTxt := Format(WorkDate());\n+ Clear(ReconcileCustAndVendAccs);\n+ GLAccount[3].SetRange(\"Date Filter\", WorkDate());\n+ GLAccount[3].FindFirst();\n+ ReconcileCustAndVendAccs.SetTableView(GLAccount[3]);\n+ Commit();\n+ ReconcileCustAndVendAccs.Run();\n+\n+ // [THEN] Verify: Amounts are distributed to correct G/L accounts\n+ LibraryReportDataset.LoadDataSetFile();\n+ LibraryReportDataset.AssertElementWithValueExists('No_GLAccount', CustomerPostingGroup[1].\"Receivables Account\");\n+ LibraryReportDataset.AssertElementWithValueExists('Amount', Amount1);\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Finance/GeneralLedger/Reports/ReconcileCustandVendAccs.Report.al b/App/Layers/W1/BaseApp/Finance/GeneralLedger/Reports/ReconcileCustandVendAccs.Report.al\nindex e033f91eb0b..cf00000001 100644\n--- a/App/Layers/W1/BaseApp/Finance/GeneralLedger/Reports/ReconcileCustandVendAccs.Report.al\n+++ b/App/Layers/W1/BaseApp/Finance/GeneralLedger/Reports/ReconcileCustandVendAccs.Report.al\n@@ -484,6 +484,7 @@ report 33 \"Reconcile Cust. and Vend. Accs\"\n DtldCustLedgEntry.SetCurrentKey(\"Customer No.\", \"Posting Date\");\n DtldCustLedgEntry.SetRange(\"Customer No.\", Cust.\"No.\");\n+ DtldCustLedgEntry.SetRange(\"Posting Group\", Cust.\"Customer Posting Group\");\n \"G/L Account\".CopyFilter(\"Date Filter\", DtldCustLedgEntry.\"Posting Date\");\n DtldCustLedgEntry.CalcSums(\"Amount (LCY)\");\n CustAccAmount := CustAccAmount + DtldCustLedgEntry.\"Amount (LCY)\";\n@@ -505,6 +506,7 @@ report 33 \"Reconcile Cust. and Vend. Accs\"\n DtldCustLedgEntry.SetCurrentKey(\"Customer No.\", \"Posting Date\", \"Entry Type\");\n DtldCustLedgEntry.SetRange(\"Customer No.\", Cust.\"No.\");\n+ DtldCustLedgEntry.SetRange(\"Posting Group\", Cust.\"Customer Posting Group\");\n DtldCustLedgEntry.SetRange(\"Entry Type\", EntryType);\n \"G/L Account\".CopyFilter(\"Date Filter\", DtldCustLedgEntry.\"Posting Date\");\n DtldCustLedgEntry.CalcSums(\"Credit Amount (LCY)\");\n@@ -527,6 +529,7 @@ report 33 \"Reconcile Cust. and Vend. Accs\"\n DtldCustLedgEntry.SetCurrentKey(\"Customer No.\", \"Posting Date\", \"Entry Type\");\n DtldCustLedgEntry.SetRange(\"Customer No.\", Cust.\"No.\");\n+ DtldCustLedgEntry.SetRange(\"Posting Group\", Cust.\"Customer Posting Group\");\n DtldCustLedgEntry.SetRange(\"Entry Type\", EntryType);\n \"G/L Account\".CopyFilter(\"Date Filter\", DtldCustLedgEntry.\"Posting Date\");\n DtldCustLedgEntry.CalcSums(\"Debit Amount (LCY)\");\n"} +{"instance_id": "microsoftInternal__NAV-227153__cf-2", "base_instance_id": "microsoftInternal__NAV-227153", "variant_description": "Only include Payment-type document entries in reconciliation", "intervention_type": "Workflow / Business Logic Composition", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-227153__cf-2", "FAIL_TO_PASS": [{"codeunitID": 134982, "functionName": ["ReconcileCustVendAccounts_MultiplePostingGroups"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/Report/ERMFinancialReports.Codeunit.al b/App/Layers/W1/Tests/Report/ERMFinancialReports.Codeunit.al\nindex 073ba04a94f..cf00000001 100644\n--- a/App/Layers/W1/Tests/Report/ERMFinancialReports.Codeunit.al\n+++ b/App/Layers/W1/Tests/Report/ERMFinancialReports.Codeunit.al\n@@ -1498,6 +1498,92 @@ codeunit 134982 \"ERM Financial Reports\"\n Assert.AreNotEqual(0, GLEntry.\"Source Currency Amount\", SourceCurrencyCodeErr);\n end;\n \n+ [Test]\n+ [HandlerFunctions('RHReconcileCustandVendAccs')]\n+ procedure ReconcileCustVendAccounts_MultiplePostingGroups()\n+ var\n+ SalesReceivablesSetup: Record \"Sales & Receivables Setup\";\n+ CustomerPostingGroup: array[2] of Record \"Customer Posting Group\";\n+ Customer: Record Customer;\n+ GenJournalBatch: Record \"Gen. Journal Batch\";\n+ GenJournalLine: Record \"Gen. Journal Line\";\n+ GLAccount: array[3] of Record \"G/L Account\";\n+ ReconcileCustAndVendAccs: Report \"Reconcile Cust. and Vend. Accs\";\n+ Amount1, Amount2 : Decimal;\n+ WorkdateTxt: Text[30];\n+ begin\n+ // [SCENARIO 601857] Report should only include Payment-type document entries in reconciliation amounts\n+ Initialize();\n+\n+ // [GIVEN] Enable Allow Multiple Posting Groups\n+ SalesReceivablesSetup.Get();\n+ SalesReceivablesSetup.Validate(\"Allow Multiple Posting Groups\", true);\n+ SalesReceivablesSetup.Modify(true);\n+\n+ // [GIVEN] Create two Customer Posting Groups with different Receivables Accounts\n+ LibrarySales.CreateCustomerPostingGroup(CustomerPostingGroup[1]);\n+ LibrarySales.CreateCustomerPostingGroup(CustomerPostingGroup[2]);\n+ LibrarySales.CreateAltCustomerPostingGroup(CustomerPostingGroup[1].Code, CustomerPostingGroup[2].Code);\n+\n+ // [GIVEN] Create a customer with one of the posting groups and enable multiple posting groups\n+ LibrarySales.CreateCustomer(Customer);\n+ Customer.Validate(\"Customer Posting Group\", CustomerPostingGroup[1].Code);\n+ Customer.Validate(\"Allow Multiple Posting Groups\", true);\n+ Customer.Modify(true);\n+\n+ // [GIVEN] Create General Journal Batch\n+ LibraryJournals.CreateGenJournalBatch(GenJournalBatch);\n+\n+ // [GIVEN] Post payment 1 with first posting group\n+ Amount1 := -1 * LibraryRandom.RandDec(1000, 2);\n+ LibraryERM.CreateGLAccount(GLAccount[1]);\n+ LibraryJournals.CreateGenJournalLine(\n+ GenJournalLine,\n+ GenJournalBatch.\"Journal Template Name\",\n+ GenJournalBatch.Name,\n+ GenJournalLine.\"Document Type\"::Payment,\n+ GenJournalLine.\"Account Type\"::Customer,\n+ Customer.\"No.\",\n+ GenJournalLine.\"Bal. Account Type\"::\"G/L Account\",\n+ GLAccount[1].\"No.\",\n+ Amount1);\n+ GenJournalLine.Validate(\"Posting Group\", CustomerPostingGroup[1].Code);\n+ GenJournalLine.Modify(true);\n+ LibraryERM.PostGeneralJnlLine(GenJournalLine);\n+\n+ // [GIVEN] Post invoice with second posting group\n+ Amount2 := LibraryRandom.RandDec(2000, 2);\n+ LibraryERM.CreateGLAccount(GLAccount[2]);\n+ LibraryJournals.CreateGenJournalLine(\n+ GenJournalLine,\n+ GenJournalBatch.\"Journal Template Name\",\n+ GenJournalBatch.Name,\n+ GenJournalLine.\"Document Type\"::Invoice,\n+ GenJournalLine.\"Account Type\"::Customer,\n+ Customer.\"No.\",\n+ GenJournalLine.\"Bal. Account Type\"::\"G/L Account\",\n+ GLAccount[2].\"No.\",\n+ Amount2);\n+ GenJournalLine.Validate(\"Posting Group\", CustomerPostingGroup[2].Code);\n+ GenJournalLine.Modify(true);\n+ LibraryERM.PostGeneralJnlLine(GenJournalLine);\n+\n+ // [WHEN] Run the Reconcile Cust. And Vend. Accounts report with DateFilter as Workdate\n+ WorkdateTxt := Format(WorkDate());\n+ Clear(ReconcileCustAndVendAccs);\n+ GLAccount[3].SetRange(\"Date Filter\", WorkDate());\n+ GLAccount[3].FindFirst();\n+ ReconcileCustAndVendAccs.SetTableView(GLAccount[3]);\n+ Commit();\n+ ReconcileCustAndVendAccs.Run();\n+\n+ // [THEN] Verify: Amounts are distributed to correct G/L accounts\n+ LibraryReportDataset.LoadDataSetFile();\n+ LibraryReportDataset.AssertElementWithValueExists('No_GLAccount', CustomerPostingGroup[1].\"Receivables Account\");\n+ LibraryReportDataset.AssertElementWithValueExists('No_GLAccount', CustomerPostingGroup[2].\"Receivables Account\");\n+ LibraryReportDataset.AssertElementWithValueExists('Amount', Amount1);\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Finance/GeneralLedger/Reports/ReconcileCustandVendAccs.Report.al b/App/Layers/W1/BaseApp/Finance/GeneralLedger/Reports/ReconcileCustandVendAccs.Report.al\nindex e033f91eb0b..cf00000002 100644\n--- a/App/Layers/W1/BaseApp/Finance/GeneralLedger/Reports/ReconcileCustandVendAccs.Report.al\n+++ b/App/Layers/W1/BaseApp/Finance/GeneralLedger/Reports/ReconcileCustandVendAccs.Report.al\n@@ -472,130 +472,89 @@ report 33 \"Reconcile Cust. and Vend. Accs\"\n \n local procedure CalcCustAccAmount(PostingGr: Code[20]): Decimal\n var\n- Cust: Record Customer;\n DtldCustLedgEntry: Record \"Detailed Cust. Ledg. Entry\";\n CustAccAmount: Decimal;\n begin\n- Cust.SetCurrentKey(\"Customer Posting Group\");\n- Cust.SetRange(\"Customer Posting Group\", PostingGr);\n-\n- if Cust.Find('-') then\n- repeat\n- DtldCustLedgEntry.SetCurrentKey(\"Customer No.\", \"Posting Date\");\n- DtldCustLedgEntry.SetRange(\"Customer No.\", Cust.\"No.\");\n- \"G/L Account\".CopyFilter(\"Date Filter\", DtldCustLedgEntry.\"Posting Date\");\n- DtldCustLedgEntry.CalcSums(\"Amount (LCY)\");\n- CustAccAmount := CustAccAmount + DtldCustLedgEntry.\"Amount (LCY)\";\n- until Cust.Next() = 0;\n+ DtldCustLedgEntry.SetCurrentKey(\"Posting Group\", \"Posting Date\");\n+ DtldCustLedgEntry.SetRange(\"Posting Group\", PostingGr);\n+ DtldCustLedgEntry.SetRange(\"Document Type\", DtldCustLedgEntry.\"Document Type\"::Payment);\n+ \"G/L Account\".CopyFilter(\"Date Filter\", DtldCustLedgEntry.\"Posting Date\");\n+ DtldCustLedgEntry.CalcSums(\"Amount (LCY)\");\n+ CustAccAmount := CustAccAmount + DtldCustLedgEntry.\"Amount (LCY)\";\n \n exit(CustAccAmount);\n end;\n \n local procedure CalcCustCreditAmount(PostingGr: Code[20]; EntryType: Enum \"Detailed CV Ledger Entry Type\"): Decimal\n var\n- Cust: Record Customer;\n DtldCustLedgEntry: Record \"Detailed Cust. Ledg. Entry\";\n CustCreditAmount: Decimal;\n begin\n- Cust.SetCurrentKey(\"Customer Posting Group\");\n- Cust.SetRange(\"Customer Posting Group\", PostingGr);\n-\n- if Cust.Find('-') then\n- repeat\n- DtldCustLedgEntry.SetCurrentKey(\"Customer No.\", \"Posting Date\", \"Entry Type\");\n- DtldCustLedgEntry.SetRange(\"Customer No.\", Cust.\"No.\");\n- DtldCustLedgEntry.SetRange(\"Entry Type\", EntryType);\n- \"G/L Account\".CopyFilter(\"Date Filter\", DtldCustLedgEntry.\"Posting Date\");\n- DtldCustLedgEntry.CalcSums(\"Credit Amount (LCY)\");\n- CustCreditAmount := CustCreditAmount + DtldCustLedgEntry.\"Credit Amount (LCY)\";\n- until Cust.Next() = 0;\n+ DtldCustLedgEntry.SetCurrentKey(\"Posting Group\", \"Posting Date\", \"Entry Type\");\n+ DtldCustLedgEntry.SetRange(\"Posting Group\", PostingGr);\n+ DtldCustLedgEntry.SetRange(\"Entry Type\", EntryType);\n+ \"G/L Account\".CopyFilter(\"Date Filter\", DtldCustLedgEntry.\"Posting Date\");\n+ DtldCustLedgEntry.CalcSums(\"Credit Amount (LCY)\");\n+ CustCreditAmount := CustCreditAmount + DtldCustLedgEntry.\"Credit Amount (LCY)\";\n \n exit(CustCreditAmount);\n end;\n \n local procedure CalcCustDebitAmount(PostingGr: Code[20]; EntryType: Enum \"Detailed CV Ledger Entry Type\"): Decimal\n var\n- Cust: Record Customer;\n DtldCustLedgEntry: Record \"Detailed Cust. Ledg. Entry\";\n CustDebitAmount: Decimal;\n begin\n- Cust.SetCurrentKey(\"Customer Posting Group\");\n- Cust.SetRange(\"Customer Posting Group\", PostingGr);\n-\n- if Cust.Find('-') then\n- repeat\n- DtldCustLedgEntry.SetCurrentKey(\"Customer No.\", \"Posting Date\", \"Entry Type\");\n- DtldCustLedgEntry.SetRange(\"Customer No.\", Cust.\"No.\");\n- DtldCustLedgEntry.SetRange(\"Entry Type\", EntryType);\n- \"G/L Account\".CopyFilter(\"Date Filter\", DtldCustLedgEntry.\"Posting Date\");\n- DtldCustLedgEntry.CalcSums(\"Debit Amount (LCY)\");\n- CustDebitAmount := CustDebitAmount + DtldCustLedgEntry.\"Debit Amount (LCY)\";\n- until Cust.Next() = 0;\n+ DtldCustLedgEntry.SetCurrentKey(\"Posting Group\", \"Posting Date\", \"Entry Type\");\n+ DtldCustLedgEntry.SetRange(\"Posting Group\", PostingGr);\n+ DtldCustLedgEntry.SetRange(\"Entry Type\", EntryType);\n+ \"G/L Account\".CopyFilter(\"Date Filter\", DtldCustLedgEntry.\"Posting Date\");\n+ DtldCustLedgEntry.CalcSums(\"Debit Amount (LCY)\");\n+ CustDebitAmount := CustDebitAmount + DtldCustLedgEntry.\"Debit Amount (LCY)\";\n \n exit(-CustDebitAmount);\n end;\n \n local procedure CalcVendAccAmount(PostingGr: Code[20]): Decimal\n var\n- Vend: Record Vendor;\n DtldVendLedgEntry: Record \"Detailed Vendor Ledg. Entry\";\n VendAccAmount: Decimal;\n begin\n- Vend.SetCurrentKey(\"Vendor Posting Group\");\n- Vend.SetRange(\"Vendor Posting Group\", PostingGr);\n-\n- if Vend.Find('-') then\n- repeat\n- DtldVendLedgEntry.SetCurrentKey(\"Vendor No.\", \"Posting Date\");\n- DtldVendLedgEntry.SetRange(\"Vendor No.\", Vend.\"No.\");\n- \"G/L Account\".CopyFilter(\"Date Filter\", DtldVendLedgEntry.\"Posting Date\");\n- DtldVendLedgEntry.CalcSums(\"Amount (LCY)\");\n- VendAccAmount := VendAccAmount + DtldVendLedgEntry.\"Amount (LCY)\";\n- until Vend.Next() = 0;\n+ DtldVendLedgEntry.SetCurrentKey(\"Posting Group\", \"Posting Date\");\n+ DtldVendLedgEntry.SetRange(\"Posting Group\", PostingGr);\n+ \"G/L Account\".CopyFilter(\"Date Filter\", DtldVendLedgEntry.\"Posting Date\");\n+ DtldVendLedgEntry.CalcSums(\"Amount (LCY)\");\n+ VendAccAmount := VendAccAmount + DtldVendLedgEntry.\"Amount (LCY)\";\n \n exit(VendAccAmount);\n end;\n \n local procedure CalcVendCreditAmount(PostingGr: Code[20]; EntryType: Enum \"Detailed CV Ledger Entry Type\"): Decimal\n var\n- Vend: Record Vendor;\n DtldVendLedgEntry: Record \"Detailed Vendor Ledg. Entry\";\n VendCreditAmount: Decimal;\n begin\n- Vend.SetCurrentKey(\"Vendor Posting Group\");\n- Vend.SetRange(\"Vendor Posting Group\", PostingGr);\n-\n- if Vend.Find('-') then\n- repeat\n- DtldVendLedgEntry.SetCurrentKey(\"Vendor No.\", \"Posting Date\", \"Entry Type\");\n- DtldVendLedgEntry.SetRange(\"Vendor No.\", Vend.\"No.\");\n- DtldVendLedgEntry.SetRange(\"Entry Type\", EntryType);\n- \"G/L Account\".CopyFilter(\"Date Filter\", DtldVendLedgEntry.\"Posting Date\");\n- DtldVendLedgEntry.CalcSums(\"Credit Amount (LCY)\");\n- VendCreditAmount := VendCreditAmount + DtldVendLedgEntry.\"Credit Amount (LCY)\";\n- until Vend.Next() = 0;\n+ DtldVendLedgEntry.SetCurrentKey(\"Posting Group\", \"Posting Date\", \"Entry Type\");\n+ DtldVendLedgEntry.SetRange(\"Posting Group\", PostingGr);\n+ DtldVendLedgEntry.SetRange(\"Entry Type\", EntryType);\n+ \"G/L Account\".CopyFilter(\"Date Filter\", DtldVendLedgEntry.\"Posting Date\");\n+ DtldVendLedgEntry.CalcSums(\"Credit Amount (LCY)\");\n+ VendCreditAmount := VendCreditAmount + DtldVendLedgEntry.\"Credit Amount (LCY)\";\n \n exit(VendCreditAmount);\n end;\n \n local procedure CalcVendDebitAmount(PostingGr: Code[20]; EntryType: Enum \"Detailed CV Ledger Entry Type\"): Decimal\n var\n- Vend: Record Vendor;\n DtldVendLedgEntry: Record \"Detailed Vendor Ledg. Entry\";\n VendDebitAmount: Decimal;\n begin\n- Vend.SetCurrentKey(\"Vendor Posting Group\");\n- Vend.SetRange(\"Vendor Posting Group\", PostingGr);\n-\n- if Vend.Find('-') then\n- repeat\n- DtldVendLedgEntry.SetCurrentKey(\"Vendor No.\", \"Posting Date\", \"Entry Type\");\n- DtldVendLedgEntry.SetRange(\"Vendor No.\", Vend.\"No.\");\n- DtldVendLedgEntry.SetRange(\"Entry Type\", EntryType);\n- \"G/L Account\".CopyFilter(\"Date Filter\", DtldVendLedgEntry.\"Posting Date\");\n- DtldVendLedgEntry.CalcSums(\"Debit Amount (LCY)\");\n- VendDebitAmount := VendDebitAmount + DtldVendLedgEntry.\"Debit Amount (LCY)\";\n- until Vend.Next() = 0;\n+ DtldVendLedgEntry.SetCurrentKey(\"Posting Group\", \"Posting Date\", \"Entry Type\");\n+ DtldVendLedgEntry.SetRange(\"Posting Group\", PostingGr);\n+ DtldVendLedgEntry.SetRange(\"Entry Type\", EntryType);\n+ \"G/L Account\".CopyFilter(\"Date Filter\", DtldVendLedgEntry.\"Posting Date\");\n+ DtldVendLedgEntry.CalcSums(\"Debit Amount (LCY)\");\n+ VendDebitAmount := VendDebitAmount + DtldVendLedgEntry.\"Debit Amount (LCY)\";\n \n exit(-VendDebitAmount);\n end;\n"} +{"instance_id": "microsoftInternal__NAV-227153__cf-3", "base_instance_id": "microsoftInternal__NAV-227153", "variant_description": "Use Document Date instead of Posting Date for date filtering", "intervention_type": "Execution / Validation Semantics", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-227153__cf-3", "FAIL_TO_PASS": [{"codeunitID": 134982, "functionName": ["ReconcileCustVendAccounts_MultiplePostingGroups"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/Report/ERMFinancialReports.Codeunit.al b/App/Layers/W1/Tests/Report/ERMFinancialReports.Codeunit.al\nindex 073ba04a94f..cf00000001 100644\n--- a/App/Layers/W1/Tests/Report/ERMFinancialReports.Codeunit.al\n+++ b/App/Layers/W1/Tests/Report/ERMFinancialReports.Codeunit.al\n@@ -1498,6 +1498,92 @@ codeunit 134982 \"ERM Financial Reports\"\n Assert.AreNotEqual(0, GLEntry.\"Source Currency Amount\", SourceCurrencyCodeErr);\n end;\n \n+ [Test]\n+ [HandlerFunctions('RHReconcileCustandVendAccs')]\n+ procedure ReconcileCustVendAccounts_MultiplePostingGroups()\n+ var\n+ SalesReceivablesSetup: Record \"Sales & Receivables Setup\";\n+ CustomerPostingGroup: array[2] of Record \"Customer Posting Group\";\n+ Customer: Record Customer;\n+ GenJournalBatch: Record \"Gen. Journal Batch\";\n+ GenJournalLine: Record \"Gen. Journal Line\";\n+ GLAccount: array[3] of Record \"G/L Account\";\n+ ReconcileCustAndVendAccs: Report \"Reconcile Cust. and Vend. Accs\";\n+ Amount1, Amount2 : Decimal;\n+ WorkdateTxt: Text[30];\n+ begin\n+ // [SCENARIO 601857] Report should filter by Document Date instead of Posting Date\n+ Initialize();\n+\n+ // [GIVEN] Enable Allow Multiple Posting Groups\n+ SalesReceivablesSetup.Get();\n+ SalesReceivablesSetup.Validate(\"Allow Multiple Posting Groups\", true);\n+ SalesReceivablesSetup.Modify(true);\n+\n+ // [GIVEN] Create two Customer Posting Groups with different Receivables Accounts\n+ LibrarySales.CreateCustomerPostingGroup(CustomerPostingGroup[1]);\n+ LibrarySales.CreateCustomerPostingGroup(CustomerPostingGroup[2]);\n+ LibrarySales.CreateAltCustomerPostingGroup(CustomerPostingGroup[1].Code, CustomerPostingGroup[2].Code);\n+\n+ // [GIVEN] Create a customer with one of the posting groups and enable multiple posting groups\n+ LibrarySales.CreateCustomer(Customer);\n+ Customer.Validate(\"Customer Posting Group\", CustomerPostingGroup[1].Code);\n+ Customer.Validate(\"Allow Multiple Posting Groups\", true);\n+ Customer.Modify(true);\n+\n+ // [GIVEN] Create General Journal Batch\n+ LibraryJournals.CreateGenJournalBatch(GenJournalBatch);\n+\n+ // [GIVEN] Post payment 1 with first posting group\n+ Amount1 := -1 * LibraryRandom.RandDec(1000, 2);\n+ LibraryERM.CreateGLAccount(GLAccount[1]);\n+ LibraryJournals.CreateGenJournalLine(\n+ GenJournalLine,\n+ GenJournalBatch.\"Journal Template Name\",\n+ GenJournalBatch.Name,\n+ GenJournalLine.\"Document Type\"::Payment,\n+ GenJournalLine.\"Account Type\"::Customer,\n+ Customer.\"No.\",\n+ GenJournalLine.\"Bal. Account Type\"::\"G/L Account\",\n+ GLAccount[1].\"No.\",\n+ Amount1);\n+ GenJournalLine.Validate(\"Posting Group\", CustomerPostingGroup[1].Code);\n+ GenJournalLine.Modify(true);\n+ LibraryERM.PostGeneralJnlLine(GenJournalLine);\n+\n+ // [GIVEN] Post payment 2 with second posting group\n+ Amount2 := -1 * LibraryRandom.RandDec(2000, 2);\n+ LibraryERM.CreateGLAccount(GLAccount[2]);\n+ LibraryJournals.CreateGenJournalLine(\n+ GenJournalLine,\n+ GenJournalBatch.\"Journal Template Name\",\n+ GenJournalBatch.Name,\n+ GenJournalLine.\"Document Type\"::Payment,\n+ GenJournalLine.\"Account Type\"::Customer,\n+ Customer.\"No.\",\n+ GenJournalLine.\"Bal. Account Type\"::\"G/L Account\",\n+ GLAccount[2].\"No.\",\n+ Amount2);\n+ GenJournalLine.Validate(\"Posting Group\", CustomerPostingGroup[2].Code);\n+ GenJournalLine.Validate(\"Document Date\", CalcDate('<+1D>', WorkDate()));\n+ GenJournalLine.Modify(true);\n+ LibraryERM.PostGeneralJnlLine(GenJournalLine);\n+\n+ // [WHEN] Run the Reconcile Cust. And Vend. Accounts report with DateFilter as Workdate\n+ WorkdateTxt := Format(WorkDate());\n+ Clear(ReconcileCustAndVendAccs);\n+ GLAccount[3].SetRange(\"Date Filter\", CalcDate('<+1D>', WorkDate()));\n+ GLAccount[3].FindFirst();\n+ ReconcileCustAndVendAccs.SetTableView(GLAccount[3]);\n+ Commit();\n+ ReconcileCustAndVendAccs.Run();\n+\n+ // [THEN] Verify: Amounts are distributed to correct G/L accounts\n+ LibraryReportDataset.LoadDataSetFile();\n+ LibraryReportDataset.AssertElementWithValueExists('No_GLAccount', CustomerPostingGroup[2].\"Receivables Account\");\n+ LibraryReportDataset.AssertElementWithValueExists('Amount', Amount2);\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Finance/GeneralLedger/Reports/ReconcileCustandVendAccs.Report.al b/App/Layers/W1/BaseApp/Finance/GeneralLedger/Reports/ReconcileCustandVendAccs.Report.al\nindex e033f91eb0b..cf00000003 100644\n--- a/App/Layers/W1/BaseApp/Finance/GeneralLedger/Reports/ReconcileCustandVendAccs.Report.al\n+++ b/App/Layers/W1/BaseApp/Finance/GeneralLedger/Reports/ReconcileCustandVendAccs.Report.al\n@@ -472,130 +472,88 @@ report 33 \"Reconcile Cust. and Vend. Accs\"\n \n local procedure CalcCustAccAmount(PostingGr: Code[20]): Decimal\n var\n- Cust: Record Customer;\n DtldCustLedgEntry: Record \"Detailed Cust. Ledg. Entry\";\n CustAccAmount: Decimal;\n begin\n- Cust.SetCurrentKey(\"Customer Posting Group\");\n- Cust.SetRange(\"Customer Posting Group\", PostingGr);\n-\n- if Cust.Find('-') then\n- repeat\n- DtldCustLedgEntry.SetCurrentKey(\"Customer No.\", \"Posting Date\");\n- DtldCustLedgEntry.SetRange(\"Customer No.\", Cust.\"No.\");\n- \"G/L Account\".CopyFilter(\"Date Filter\", DtldCustLedgEntry.\"Posting Date\");\n- DtldCustLedgEntry.CalcSums(\"Amount (LCY)\");\n- CustAccAmount := CustAccAmount + DtldCustLedgEntry.\"Amount (LCY)\";\n- until Cust.Next() = 0;\n+ DtldCustLedgEntry.SetCurrentKey(\"Posting Group\", \"Posting Date\");\n+ DtldCustLedgEntry.SetRange(\"Posting Group\", PostingGr);\n+ \"G/L Account\".CopyFilter(\"Date Filter\", DtldCustLedgEntry.\"Document Date\");\n+ DtldCustLedgEntry.CalcSums(\"Amount (LCY)\");\n+ CustAccAmount := CustAccAmount + DtldCustLedgEntry.\"Amount (LCY)\";\n \n exit(CustAccAmount);\n end;\n \n local procedure CalcCustCreditAmount(PostingGr: Code[20]; EntryType: Enum \"Detailed CV Ledger Entry Type\"): Decimal\n var\n- Cust: Record Customer;\n DtldCustLedgEntry: Record \"Detailed Cust. Ledg. Entry\";\n CustCreditAmount: Decimal;\n begin\n- Cust.SetCurrentKey(\"Customer Posting Group\");\n- Cust.SetRange(\"Customer Posting Group\", PostingGr);\n-\n- if Cust.Find('-') then\n- repeat\n- DtldCustLedgEntry.SetCurrentKey(\"Customer No.\", \"Posting Date\", \"Entry Type\");\n- DtldCustLedgEntry.SetRange(\"Customer No.\", Cust.\"No.\");\n- DtldCustLedgEntry.SetRange(\"Entry Type\", EntryType);\n- \"G/L Account\".CopyFilter(\"Date Filter\", DtldCustLedgEntry.\"Posting Date\");\n- DtldCustLedgEntry.CalcSums(\"Credit Amount (LCY)\");\n- CustCreditAmount := CustCreditAmount + DtldCustLedgEntry.\"Credit Amount (LCY)\";\n- until Cust.Next() = 0;\n+ DtldCustLedgEntry.SetCurrentKey(\"Posting Group\", \"Posting Date\", \"Entry Type\");\n+ DtldCustLedgEntry.SetRange(\"Posting Group\", PostingGr);\n+ DtldCustLedgEntry.SetRange(\"Entry Type\", EntryType);\n+ \"G/L Account\".CopyFilter(\"Date Filter\", DtldCustLedgEntry.\"Document Date\");\n+ DtldCustLedgEntry.CalcSums(\"Credit Amount (LCY)\");\n+ CustCreditAmount := CustCreditAmount + DtldCustLedgEntry.\"Credit Amount (LCY)\";\n \n exit(CustCreditAmount);\n end;\n \n local procedure CalcCustDebitAmount(PostingGr: Code[20]; EntryType: Enum \"Detailed CV Ledger Entry Type\"): Decimal\n var\n- Cust: Record Customer;\n DtldCustLedgEntry: Record \"Detailed Cust. Ledg. Entry\";\n CustDebitAmount: Decimal;\n begin\n- Cust.SetCurrentKey(\"Customer Posting Group\");\n- Cust.SetRange(\"Customer Posting Group\", PostingGr);\n-\n- if Cust.Find('-') then\n- repeat\n- DtldCustLedgEntry.SetCurrentKey(\"Customer No.\", \"Posting Date\", \"Entry Type\");\n- DtldCustLedgEntry.SetRange(\"Customer No.\", Cust.\"No.\");\n- DtldCustLedgEntry.SetRange(\"Entry Type\", EntryType);\n- \"G/L Account\".CopyFilter(\"Date Filter\", DtldCustLedgEntry.\"Posting Date\");\n- DtldCustLedgEntry.CalcSums(\"Debit Amount (LCY)\");\n- CustDebitAmount := CustDebitAmount + DtldCustLedgEntry.\"Debit Amount (LCY)\";\n- until Cust.Next() = 0;\n+ DtldCustLedgEntry.SetCurrentKey(\"Posting Group\", \"Posting Date\", \"Entry Type\");\n+ DtldCustLedgEntry.SetRange(\"Posting Group\", PostingGr);\n+ DtldCustLedgEntry.SetRange(\"Entry Type\", EntryType);\n+ \"G/L Account\".CopyFilter(\"Date Filter\", DtldCustLedgEntry.\"Document Date\");\n+ DtldCustLedgEntry.CalcSums(\"Debit Amount (LCY)\");\n+ CustDebitAmount := CustDebitAmount + DtldCustLedgEntry.\"Debit Amount (LCY)\";\n \n exit(-CustDebitAmount);\n end;\n \n local procedure CalcVendAccAmount(PostingGr: Code[20]): Decimal\n var\n- Vend: Record Vendor;\n DtldVendLedgEntry: Record \"Detailed Vendor Ledg. Entry\";\n VendAccAmount: Decimal;\n begin\n- Vend.SetCurrentKey(\"Vendor Posting Group\");\n- Vend.SetRange(\"Vendor Posting Group\", PostingGr);\n-\n- if Vend.Find('-') then\n- repeat\n- DtldVendLedgEntry.SetCurrentKey(\"Vendor No.\", \"Posting Date\");\n- DtldVendLedgEntry.SetRange(\"Vendor No.\", Vend.\"No.\");\n- \"G/L Account\".CopyFilter(\"Date Filter\", DtldVendLedgEntry.\"Posting Date\");\n- DtldVendLedgEntry.CalcSums(\"Amount (LCY)\");\n- VendAccAmount := VendAccAmount + DtldVendLedgEntry.\"Amount (LCY)\";\n- until Vend.Next() = 0;\n+ DtldVendLedgEntry.SetCurrentKey(\"Posting Group\", \"Posting Date\");\n+ DtldVendLedgEntry.SetRange(\"Posting Group\", PostingGr);\n+ \"G/L Account\".CopyFilter(\"Date Filter\", DtldVendLedgEntry.\"Document Date\");\n+ DtldVendLedgEntry.CalcSums(\"Amount (LCY)\");\n+ VendAccAmount := VendAccAmount + DtldVendLedgEntry.\"Amount (LCY)\";\n \n exit(VendAccAmount);\n end;\n \n local procedure CalcVendCreditAmount(PostingGr: Code[20]; EntryType: Enum \"Detailed CV Ledger Entry Type\"): Decimal\n var\n- Vend: Record Vendor;\n DtldVendLedgEntry: Record \"Detailed Vendor Ledg. Entry\";\n VendCreditAmount: Decimal;\n begin\n- Vend.SetCurrentKey(\"Vendor Posting Group\");\n- Vend.SetRange(\"Vendor Posting Group\", PostingGr);\n-\n- if Vend.Find('-') then\n- repeat\n- DtldVendLedgEntry.SetCurrentKey(\"Vendor No.\", \"Posting Date\", \"Entry Type\");\n- DtldVendLedgEntry.SetRange(\"Vendor No.\", Vend.\"No.\");\n- DtldVendLedgEntry.SetRange(\"Entry Type\", EntryType);\n- \"G/L Account\".CopyFilter(\"Date Filter\", DtldVendLedgEntry.\"Posting Date\");\n- DtldVendLedgEntry.CalcSums(\"Credit Amount (LCY)\");\n- VendCreditAmount := VendCreditAmount + DtldVendLedgEntry.\"Credit Amount (LCY)\";\n- until Vend.Next() = 0;\n+ DtldVendLedgEntry.SetCurrentKey(\"Posting Group\", \"Posting Date\", \"Entry Type\");\n+ DtldVendLedgEntry.SetRange(\"Posting Group\", PostingGr);\n+ DtldVendLedgEntry.SetRange(\"Entry Type\", EntryType);\n+ \"G/L Account\".CopyFilter(\"Date Filter\", DtldVendLedgEntry.\"Document Date\");\n+ DtldVendLedgEntry.CalcSums(\"Credit Amount (LCY)\");\n+ VendCreditAmount := VendCreditAmount + DtldVendLedgEntry.\"Credit Amount (LCY)\";\n \n exit(VendCreditAmount);\n end;\n \n local procedure CalcVendDebitAmount(PostingGr: Code[20]; EntryType: Enum \"Detailed CV Ledger Entry Type\"): Decimal\n var\n- Vend: Record Vendor;\n DtldVendLedgEntry: Record \"Detailed Vendor Ledg. Entry\";\n VendDebitAmount: Decimal;\n begin\n- Vend.SetCurrentKey(\"Vendor Posting Group\");\n- Vend.SetRange(\"Vendor Posting Group\", PostingGr);\n-\n- if Vend.Find('-') then\n- repeat\n- DtldVendLedgEntry.SetCurrentKey(\"Vendor No.\", \"Posting Date\", \"Entry Type\");\n- DtldVendLedgEntry.SetRange(\"Vendor No.\", Vend.\"No.\");\n- DtldVendLedgEntry.SetRange(\"Entry Type\", EntryType);\n- \"G/L Account\".CopyFilter(\"Date Filter\", DtldVendLedgEntry.\"Posting Date\");\n- DtldVendLedgEntry.CalcSums(\"Debit Amount (LCY)\");\n- VendDebitAmount := VendDebitAmount + DtldVendLedgEntry.\"Debit Amount (LCY)\";\n- until Vend.Next() = 0;\n+ DtldVendLedgEntry.SetCurrentKey(\"Posting Group\", \"Posting Date\", \"Entry Type\");\n+ DtldVendLedgEntry.SetRange(\"Posting Group\", PostingGr);\n+ DtldVendLedgEntry.SetRange(\"Entry Type\", EntryType);\n+ \"G/L Account\".CopyFilter(\"Date Filter\", DtldVendLedgEntry.\"Document Date\");\n+ DtldVendLedgEntry.CalcSums(\"Debit Amount (LCY)\");\n+ VendDebitAmount := VendDebitAmount + DtldVendLedgEntry.\"Debit Amount (LCY)\";\n \n exit(-VendDebitAmount);\n end;\n"} +{"instance_id": "microsoftInternal__NAV-227240__cf-1", "base_instance_id": "microsoftInternal__NAV-227240", "variant_description": "Directional constraint: only forward (later) due date updates allowed", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-227240__cf-1", "FAIL_TO_PASS": [{"codeunitID": 134905, "functionName": ["VerifyDueDateAfterUpdateDueDateInCustLedgerEntry"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/ERMIssuedReminderAddnlFee.Codeunit.al b/App/Layers/W1/Tests/ERM/ERMIssuedReminderAddnlFee.Codeunit.al\nindex 71c12b1ce1a..cf00000001 100644\n--- a/App/Layers/W1/Tests/ERM/ERMIssuedReminderAddnlFee.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ERMIssuedReminderAddnlFee.Codeunit.al\n@@ -636,6 +636,68 @@ codeunit 134905 \"ERM Issued Reminder Addnl Fee\"\n ReminderPage.ContactEmail.AssertEquals(EMail);\n end;\n \n+ [Test]\n+ procedure VerifyDueDateAfterUpdateDueDateInCustLedgerEntry()\n+ var\n+ CustLedgerEntry: Record \"Cust. Ledger Entry\";\n+ Customer: Record Customer;\n+ CustomerPostingGroup: Record \"Customer Posting Group\";\n+ GLAccount: Record \"G/L Account\";\n+ ReminderFinChargeEntry: Record \"Reminder/Fin. Charge Entry\";\n+ ReminderLevel: Record \"Reminder Level\";\n+ VATProductPostingGroup: Record \"VAT Product Posting Group\";\n+ VATPostingSetup: Record \"VAT Posting Setup\";\n+ DueDate: Date;\n+ DocumentDate: Date;\n+ IssuedReminderNo: Code[20];\n+ begin\n+ // [SCENARIO 598460] Reminder due date should only update when the new due date is later than the existing reminder due date.\n+ Initialize();\n+\n+ // [GIVEN] Create Customer and VAT Posting Setup. \n+ CreateCustomer(Customer, '');\n+ CustomerPostingGroup.Get(Customer.\"Customer Posting Group\");\n+ GLAccount.Get(CustomerPostingGroup.\"Additional Fee Account\");\n+ LibraryERM.CreateVATProductPostingGroup(VATProductPostingGroup);\n+ GLAccount.Validate(\"VAT Prod. Posting Group\", VATProductPostingGroup.Code);\n+ GLAccount.Modify(true);\n+\n+ LibraryERM.CreateVATPostingSetup(VATPostingSetup, Customer.\"VAT Bus. Posting Group\", VATProductPostingGroup.Code);\n+\n+ //[GIVEN] Create and post Sales Invoice.\n+ DueDate := CreateAndPostSalesInvoice(Customer.\"No.\", '');\n+ GetReminderLevel(ReminderLevel, Customer.\"Reminder Terms Code\");\n+ DocumentDate := CalcDate('<' + Format(LibraryRandom.RandInt(5)) + 'D>', CalcDate(ReminderLevel.\"Grace Period\", DueDate));\n+\n+ // [GIVEN] Create and Issue Reminder.\n+ CreateReminder(Customer.\"No.\", DocumentDate, false);\n+ IssuedReminderNo := IssueReminder(DocumentDate);\n+\n+ // [WHEN] Update Due Date in forward direction for Customer Ledger Entry.\n+ DueDate := DocumentDate + LibraryRandom.RandIntInRange(16, 17);\n+ CustLedgerEntry.SetRange(\"Customer No.\", Customer.\"No.\");\n+ CustLedgerEntry.FindLast();\n+ CustLedgerEntry.Validate(\"Due Date\", DueDate);\n+ CustLedgerEntry.Modify(true);\n+\n+ // [VERIFY] Verify Due Date in Reminder/Fin. Charge Entry should be equal to Cust. Ledger Entry - Due Date.\n+ ReminderFinChargeEntry.SetRange(Type, ReminderFinChargeEntry.Type::Reminder);\n+ ReminderFinChargeEntry.SetRange(\"No.\", IssuedReminderNo);\n+ ReminderFinChargeEntry.FindFirst();\n+ Assert.AreEqual(ReminderFinChargeEntry.\"Due Date\", CustLedgerEntry.\"Due Date\", ReminderDueDateErr);\n+\n+ // [WHEN] Update Due Date in backward direction for Customer Ledger Entry.\n+ DueDate := DocumentDate - LibraryRandom.RandIntInRange(16, 17);\n+ CustLedgerEntry.Validate(\"Due Date\", DueDate);\n+ CustLedgerEntry.Modify(true);\n+\n+ // [VERIFY] Verify Due Date in Reminder/Fin. Charge Entry should NOT change when new date is earlier.\n+ ReminderFinChargeEntry.SetRange(Type, ReminderFinChargeEntry.Type::Reminder);\n+ ReminderFinChargeEntry.SetRange(\"No.\", IssuedReminderNo);\n+ ReminderFinChargeEntry.FindFirst();\n+ Assert.AreNotEqual(ReminderFinChargeEntry.\"Due Date\", CustLedgerEntry.\"Due Date\", ReminderDueDateErr);\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Sales/Reminder/ReminderIssue.Codeunit.al b/App/Layers/W1/BaseApp/Sales/Reminder/ReminderIssue.Codeunit.al\nindex 9ff59101df2..cf00000001 100644\n--- a/App/Layers/W1/BaseApp/Sales/Reminder/ReminderIssue.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Sales/Reminder/ReminderIssue.Codeunit.al\n@@ -409,6 +409,7 @@ codeunit 393 \"Reminder-Issue\"\n if IsHandled then\n exit;\n \n+ // Only allow forward (later) due date updates\n if NewDueDate < ReminderEntry2.\"Due Date\" then\n exit;\n \n"} +{"instance_id": "microsoftInternal__NAV-227240__cf-2", "base_instance_id": "microsoftInternal__NAV-227240", "variant_description": "Issued-state guard: issued reminders are immutable, due date should not update", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-227240__cf-2", "FAIL_TO_PASS": [{"codeunitID": 134905, "functionName": ["VerifyDueDateAfterUpdateDueDateInCustLedgerEntry"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/ERMIssuedReminderAddnlFee.Codeunit.al b/App/Layers/W1/Tests/ERM/ERMIssuedReminderAddnlFee.Codeunit.al\nindex 71c12b1ce1a..cf00000002 100644\n--- a/App/Layers/W1/Tests/ERM/ERMIssuedReminderAddnlFee.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ERMIssuedReminderAddnlFee.Codeunit.al\n@@ -636,6 +636,68 @@ codeunit 134905 \"ERM Issued Reminder Addnl Fee\"\n ReminderPage.ContactEmail.AssertEquals(EMail);\n end;\n \n+ [Test]\n+ procedure VerifyDueDateAfterUpdateDueDateInCustLedgerEntry()\n+ var\n+ CustLedgerEntry: Record \"Cust. Ledger Entry\";\n+ Customer: Record Customer;\n+ CustomerPostingGroup: Record \"Customer Posting Group\";\n+ GLAccount: Record \"G/L Account\";\n+ ReminderFinChargeEntry: Record \"Reminder/Fin. Charge Entry\";\n+ ReminderLevel: Record \"Reminder Level\";\n+ VATProductPostingGroup: Record \"VAT Product Posting Group\";\n+ VATPostingSetup: Record \"VAT Posting Setup\";\n+ DueDate: Date;\n+ DocumentDate: Date;\n+ IssuedReminderNo: Code[20];\n+ begin\n+ // [SCENARIO 598460] Reminder due date should not update if the reminder has already been issued.\n+ Initialize();\n+\n+ // [GIVEN] Create Customer and VAT Posting Setup. \n+ CreateCustomer(Customer, '');\n+ CustomerPostingGroup.Get(Customer.\"Customer Posting Group\");\n+ GLAccount.Get(CustomerPostingGroup.\"Additional Fee Account\");\n+ LibraryERM.CreateVATProductPostingGroup(VATProductPostingGroup);\n+ GLAccount.Validate(\"VAT Prod. Posting Group\", VATProductPostingGroup.Code);\n+ GLAccount.Modify(true);\n+\n+ LibraryERM.CreateVATPostingSetup(VATPostingSetup, Customer.\"VAT Bus. Posting Group\", VATProductPostingGroup.Code);\n+\n+ //[GIVEN] Create and post Sales Invoice.\n+ DueDate := CreateAndPostSalesInvoice(Customer.\"No.\", '');\n+ GetReminderLevel(ReminderLevel, Customer.\"Reminder Terms Code\");\n+ DocumentDate := CalcDate('<' + Format(LibraryRandom.RandInt(5)) + 'D>', CalcDate(ReminderLevel.\"Grace Period\", DueDate));\n+\n+ // [GIVEN] Create and Issue Reminder.\n+ CreateReminder(Customer.\"No.\", DocumentDate, false);\n+ IssuedReminderNo := IssueReminder(DocumentDate);\n+\n+ // [WHEN] Update Due Date in forward direction for Customer Ledger Entry.\n+ DueDate := DocumentDate + LibraryRandom.RandIntInRange(16, 17);\n+ CustLedgerEntry.SetRange(\"Customer No.\", Customer.\"No.\");\n+ CustLedgerEntry.FindLast();\n+ CustLedgerEntry.Validate(\"Due Date\", DueDate);\n+ CustLedgerEntry.Modify(true);\n+\n+ // [VERIFY] Verify Due Date in Reminder/Fin. Charge Entry should NOT change after reminder is issued.\n+ ReminderFinChargeEntry.SetRange(Type, ReminderFinChargeEntry.Type::Reminder);\n+ ReminderFinChargeEntry.SetRange(\"No.\", IssuedReminderNo);\n+ ReminderFinChargeEntry.FindFirst();\n+ Assert.AreNotEqual(ReminderFinChargeEntry.\"Due Date\", CustLedgerEntry.\"Due Date\", ReminderDueDateErr);\n+\n+ // [WHEN] Update Due Date in backward direction for Customer Ledger Entry.\n+ DueDate := DocumentDate - LibraryRandom.RandIntInRange(16, 17);\n+ CustLedgerEntry.Validate(\"Due Date\", DueDate);\n+ CustLedgerEntry.Modify(true);\n+\n+ // [VERIFY] Verify Due Date in Reminder/Fin. Charge Entry should NOT change after reminder is issued.\n+ ReminderFinChargeEntry.SetRange(Type, ReminderFinChargeEntry.Type::Reminder);\n+ ReminderFinChargeEntry.SetRange(\"No.\", IssuedReminderNo);\n+ ReminderFinChargeEntry.FindFirst();\n+ Assert.AreNotEqual(ReminderFinChargeEntry.\"Due Date\", CustLedgerEntry.\"Due Date\", ReminderDueDateErr);\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Sales/Reminder/ReminderIssue.Codeunit.al b/App/Layers/W1/BaseApp/Sales/Reminder/ReminderIssue.Codeunit.al\nindex 9ff59101df2..cf00000002 100644\n--- a/App/Layers/W1/BaseApp/Sales/Reminder/ReminderIssue.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Sales/Reminder/ReminderIssue.Codeunit.al\n@@ -409,6 +409,9 @@ codeunit 393 \"Reminder-Issue\"\n if IsHandled then\n exit;\n \n+ if ReminderHeader.Status = ReminderHeader.Status::Issued then\n+ exit;\n+\n if NewDueDate < ReminderEntry2.\"Due Date\" then\n exit;\n \n"} +{"instance_id": "microsoft__BCApps-5633__cf-1", "base_instance_id": "microsoft__BCApps-5633", "variant_description": "Do not skip exporting if the third-party fulfillment location is the default fulfillment service", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoft__BCApps-5633__cf-1", "FAIL_TO_PASS": [{"codeunitID": 139606, "functionName": ["UnitTestExportShipmentThirdParty"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/src/Apps/W1/Shopify/Test/Shipping/ShpfyShippingTest.Codeunit.al b/src/Apps/W1/Shopify/Test/Shipping/ShpfyShippingTest.Codeunit.al\nindex 87c4a69e3a..2aa63a294f 100644\n--- a/src/Apps/W1/Shopify/Test/Shipping/ShpfyShippingTest.Codeunit.al\n+++ b/src/Apps/W1/Shopify/Test/Shipping/ShpfyShippingTest.Codeunit.al\n@@ -154,6 +154,36 @@ codeunit 139606 \"Shpfy Shipping Test\"\n LibraryAssert.IsTrue(FulfillmentRequest.Contains(StrSubstNo(QuantityLbl, SalesShipmentLine.Quantity)), 'quantity check');\n end;\n \n+ [Test]\n+ procedure UnitTestExportShipmentThirdParty()\n+ var\n+ SalesShipmentHeader: Record \"Sales Shipment Header\";\n+ FulfillmentOrderHeader: Record \"Shpfy FulFillment Order Header\";\n+ ExportShipments: Codeunit \"Shpfy Export Shipments\";\n+ ShippingHelper: Codeunit \"Shpfy Shipping Helper\";\n+ DeliveryMethodType: Enum \"Shpfy Delivery Method Type\";\n+ FulfillmentRequests: List of [Text];\n+ AssignedFulfillmentOrderIds: Dictionary of [BigInteger, Code[20]];\n+ ShopifyOrderId: BigInteger;\n+ LocationId: BigInteger;\n+ begin\n+ // [SCENARIO] Export a Sales Shipment record into a Json token that contains the shipping info for a third-party fulfillment service\n+ // [GIVEN] A random Sales Shipment, a random LocationId for a third-party fulfillment location, a random Shop\n+ Initialize();\n+ LocationId := Any.IntegerInRange(10000, 99999);\n+ CreateThirdPartyFulfillmentLocation(Shop, LocationId);\n+ DeliveryMethodType := DeliveryMethodType::Shipping;\n+ ShopifyOrderId := ShippingHelper.CreateRandomShopifyOrder(LocationId, DeliveryMethodType);\n+ FulfillmentOrderHeader := ShippingHelper.CreateShopifyFulfillmentOrder(ShopifyOrderId, DeliveryMethodType);\n+ ShippingHelper.CreateRandomSalesShipment(SalesShipmentHeader, ShopifyOrderId);\n+\n+ // [WHEN] Invoke the function CreateFulfillmentOrderRequest()\n+ FulfillmentRequests := ExportShipments.CreateFulfillmentOrderRequest(SalesShipmentHeader, Shop, LocationId, DeliveryMethodType, AssignedFulfillmentOrderIds);\n+\n+ // [THEN] We must find no fulfilment data in the json token as the location is for a third-party fulfillment service\n+ LibraryAssert.AreEqual(0, FulfillmentRequests.Count, 'FulfillmentRequest count check');\n+ end;\n+\n local procedure Initialize()\n var\n CommunicationMgt: Codeunit \"Shpfy Communication Mgt.\";\n@@ -188,6 +218,18 @@ codeunit 139606 \"Shpfy Shipping Test\"\n LibraryTestInitialize.OnAfterTestSuiteInitialize(Codeunit::\"Shpfy Shipping Test\");\n end;\n \n+ local procedure CreateThirdPartyFulfillmentLocation(ShopifyShop: Record \"Shpfy Shop\"; LocationId: BigInteger)\n+ var\n+ ShopLocation: Record \"Shpfy Shop Location\";\n+ SyncLocations: Codeunit \"Shpfy Sync Shop Locations\";\n+ begin\n+ ShopLocation.\"Shop Code\" := ShopifyShop.Code;\n+ ShopLocation.Id := LocationId;\n+ ShopLocation.Name := SyncLocations.GetFulfillmentServiceName();\n+ ShopLocation.\"Is Fulfillment Service\" := true;\n+ ShopLocation.Insert();\n+ end;\n+\n [HttpClientHandler]\n internal procedure HttpSubmitHandler(Request: TestHttpRequestMessage; var Response: TestHttpResponseMessage): Boolean\n begin\n", "patch": "diff --git a/src/Apps/W1/Shopify/App/src/Shipping/Codeunits/ShpfyExportShipments.Codeunit.al b/src/Apps/W1/Shopify/App/src/Shipping/Codeunits/ShpfyExportShipments.Codeunit.al\nindex 1f790f98d1..6160dcd402 100644\n--- a/src/Apps/W1/Shopify/App/src/Shipping/Codeunits/ShpfyExportShipments.Codeunit.al\n+++ b/src/Apps/W1/Shopify/App/src/Shipping/Codeunits/ShpfyExportShipments.Codeunit.al\n@@ -90,11 +90,13 @@ codeunit 30190 \"Shpfy Export Shipments\"\n TrackingCompany: Enum \"Shpfy Tracking Companies\";\n PrevFulfillmentOrderId: BigInteger;\n IsHandled: Boolean;\n+ EmptyFulfillment: Boolean;\n TrackingUrl: Text;\n GraphQueryStart: Text;\n GraphQuery: TextBuilder;\n LineCount: Integer;\n GraphQueries: List of [Text];\n+ UnfulfillableOrders: List of [BigInteger];\n begin\n Clear(PrevFulfillmentOrderId);\n \n@@ -165,11 +167,17 @@ codeunit 30190 \"Shpfy Export Shipments\"\n end;\n GraphQuery.Append('lineItemsByFulfillmentOrder: [');\n GraphQueryStart := GraphQuery.ToText();\n+ EmptyFulfillment := true;\n repeat\n // Skip fulfillment orders that are assigned and not accepted\n if AssignedFulfillmentOrderIds.ContainsKey(TempFulfillmentOrderLine.\"Shopify Fulfillment Order Id\") then\n continue;\n \n+ if not CanFulfillOrder(TempFulfillmentOrderLine, Shop, UnfulfillableOrders) then\n+ continue;\n+\n+ EmptyFulfillment := false;\n+\n if PrevFulfillmentOrderId <> TempFulfillmentOrderLine.\"Shopify Fulfillment Order Id\" then begin\n if PrevFulfillmentOrderId <> 0 then\n GraphQuery.Append(']},');\n@@ -202,7 +210,8 @@ codeunit 30190 \"Shpfy Export Shipments\"\n until TempFulfillmentOrderLine.Next() = 0;\n GraphQuery.Append(']}]})');\n GraphQuery.Append('{fulfillment { legacyResourceId name createdAt updatedAt deliveredAt displayStatus estimatedDeliveryAt status totalQuantity location { legacyResourceId } trackingInfo { number url company } service { serviceName type } fulfillmentLineItems(first: 10) { pageInfo { endCursor hasNextPage } nodes { id quantity originalTotalSet { presentmentMoney { amount } shopMoney { amount }} lineItem { id isGiftCard }}}}, userErrors {field,message}}}\"}');\n- GraphQueries.Add(GraphQuery.ToText());\n+ if not EmptyFulfillment then\n+ GraphQueries.Add(GraphQuery.ToText());\n end;\n exit(GraphQueries);\n end;\n@@ -225,6 +234,27 @@ codeunit 30190 \"Shpfy Export Shipments\"\n end;\n end;\n \n+ local procedure CanFulfillOrder(FulfillmentOrderLine: Record \"Shpfy FulFillment Order Line\"; Shop: Record \"Shpfy Shop\"; var UnfulfillableOrders: List of [BigInteger]): Boolean\n+ var\n+ ShopLocation: Record \"Shpfy Shop Location\";\n+ SyncLocations: Codeunit \"Shpfy Sync Shop Locations\";\n+ begin\n+ if UnfulfillableOrders.Contains(FulfillmentOrderLine.\"Shopify Fulfillment Order Id\") then\n+ exit(false);\n+\n+ if not ShopLocation.Get(Shop.Code, FulfillmentOrderLine.\"Shopify Location Id\") then\n+ exit(true);\n+\n+ if not ShopLocation.\"Is Fulfillment Service\" then\n+ exit(true);\n+\n+ if ShopLocation.Name = SyncLocations.GetFulfillmentServiceName() then\n+ exit(false);\n+\n+ UnfulfillableOrders.Add(FulfillmentOrderLine.\"Shopify Fulfillment Order Id\");\n+ exit(false);\n+ end;\n+\n local procedure GetNotifyCustomer(Shop: Record \"Shpfy Shop\"; SalesShipmmentHeader: Record \"Sales Shipment Header\"; LocationId: BigInteger): Boolean\n var\n IsHandled: Boolean;\n"} +{"instance_id": "microsoft__BCApps-4822__cf-1", "base_instance_id": "microsoft__BCApps-4822", "variant_description": "Bill-to Customer No. should always be copied, even if it is empty", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoft__BCApps-4822__cf-1", "FAIL_TO_PASS": [{"codeunitID": 139539, "functionName": ["TestCreateCompanyLocationSellToBillTo"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/src/Apps/W1/Shopify/Test/Companies/ShpfyCompanyLocationsTest.Codeunit.al b/src/Apps/W1/Shopify/Test/Companies/ShpfyCompanyLocationsTest.Codeunit.al\nindex be8c01cb17..d27dba8d65 100644\n--- a/src/Apps/W1/Shopify/Test/Companies/ShpfyCompanyLocationsTest.Codeunit.al\n+++ b/src/Apps/W1/Shopify/Test/Companies/ShpfyCompanyLocationsTest.Codeunit.al\n@@ -23,6 +23,7 @@ codeunit 139539 \"Shpfy Company Locations Test\"\n Customer: Record Customer;\n InitializeTest: Codeunit \"Shpfy Initialize Test\";\n OutboundHttpRequests: Codeunit \"Library - Variable Storage\";\n+ Assert: Codeunit \"Library Assert\";\n IsInitialized: Boolean;\n ResponseResourceUrl: Text;\n UnexpectedAPICallsErr: Label 'More than expected API calls to Shopify detected.';\n@@ -57,6 +58,37 @@ codeunit 139539 \"Shpfy Company Locations Test\"\n ShopifyCompanies.OpenEdit();\n ShopifyCompanies.GoToRecord(ShopifyCompany);\n ShopifyCompanies.Locations.GoToRecord(CompanyLocation);\n+\n+ // Cleanup\n+ CompanyLocation.Delete();\n+ end;\n+\n+ [Test]\n+ [HandlerFunctions('HttpSubmitHandler')]\n+ procedure TestCreateCompanyLocationSellToBillTo()\n+ var\n+ ShopifyCustomer: Record \"Shpfy Customer\";\n+ CompanyAPI: Codeunit \"Shpfy Company API\";\n+ begin\n+ // [GIVEN] A valid customer and company location setup\n+ RegExpectedOutboundHttpRequests();\n+ Initialize();\n+ ShopifyCompany.GetBySystemId(CompanyLocation.\"Company SystemId\");\n+ Customer.\"Bill-to Customer No.\" := '';\n+ Customer.Modify(true);\n+\n+ // [WHEN] CreateCompanyLocation is called\n+ CompanyAPI.SetCompany(ShopifyCompany);\n+ CompanyAPI.SetShop(Shop);\n+ CompanyAPI.CreateCustomerAsCompanyLocation(Customer, ShopifyCompany, ShopifyCustomer);\n+\n+ // [THEN] Company location should be created successfully\n+#pragma warning disable AA0210\n+ CompanyLocation.SetRange(\"Customer Id\", Customer.SystemId);\n+#pragma warning restore AA0210\n+ CompanyLocation.FindFirst();\n+ Assert.AreEqual(Customer.\"No.\", CompanyLocation.\"Sell-to Customer No.\", 'Sell-to Customer No. mismatch');\n+ Assert.AreEqual('', CompanyLocation.\"Bill-to Customer No.\", 'Bill-to Customer No. mismatch');\n end;\n \n [Test]\n", "patch": "diff --git a/src/Apps/W1/Shopify/App/src/Companies/Codeunits/ShpfyCompanyAPI.Codeunit.al b/src/Apps/W1/Shopify/App/src/Companies/Codeunits/ShpfyCompanyAPI.Codeunit.al\nindex 2d2014446c..d09ff272d8 100644\n--- a/src/Apps/W1/Shopify/App/src/Companies/Codeunits/ShpfyCompanyAPI.Codeunit.al\n+++ b/src/Apps/W1/Shopify/App/src/Companies/Codeunits/ShpfyCompanyAPI.Codeunit.al\n@@ -523,7 +523,7 @@ codeunit 30286 \"Shpfy Company API\"\n JResponse := CommunicationMgt.ExecuteGraphQL(GraphQuery.ToText());\n if JResponse.SelectToken('$.data.companyLocationCreate.companyLocation', JCompanyLocation) then\n if not JsonHelper.IsTokenNull(JCompanyLocation) then begin\n- LocationId := CreateCustomerLocation(JCompanyLocation.AsObject(), ShopifyCompany, Customer.SystemId);\n+ LocationId := CreateCustomerLocation(JCompanyLocation.AsObject(), ShopifyCompany, Customer);\n if JsonHelper.GetJsonArray(JCompanyLocation, JContactRoles, 'company.contactRoles.edges') then begin\n foreach JItem in JContactRoles do\n CompanyContactRoles.Add(JsonHelper.GetValueAsText(JItem, 'node.name'), CommunicationMgt.GetIdOfGId(JsonHelper.GetValueAsText(JItem, 'node.id')));\n@@ -540,7 +540,7 @@ codeunit 30286 \"Shpfy Company API\"\n /// \n /// JSON object containing the company location data from Shopify API response.\n /// The parent Shopify company record.\n- /// The GUID of the Business Central customer that was exported.\n+ /// The Business Central customer record used to populate additional fields.\n /// \n /// This procedure:\n /// - Extracts the Shopify-generated ID and creates the initial record\n@@ -552,7 +552,7 @@ codeunit 30286 \"Shpfy Company API\"\n /// The procedure assumes the JSON structure matches Shopify's companyLocationCreate response format.\n /// All text fields are properly truncated to match the field lengths in the table definition.\n /// \n- local procedure CreateCustomerLocation(JCompanyLocation: JsonObject; ShopifyCompany: Record \"Shpfy Company\"; CustomerId: Guid): BigInteger\n+ local procedure CreateCustomerLocation(JCompanyLocation: JsonObject; ShopifyCompany: Record \"Shpfy Company\"; Customer: Record Customer): BigInteger\n var\n CompanyLocation: Record \"Shpfy Company Location\";\n CompanyLocationId: BigInteger;\n@@ -580,7 +580,9 @@ codeunit 30286 \"Shpfy Company API\"\n #pragma warning restore AA0139\n CompanyLocation.Recipient := CopyStr(JsonHelper.GetValueAsText(JCompanyLocation, 'billingAddress.recipient', MaxStrLen(CompanyLocation.Recipient)), 1, MaxStrLen(CompanyLocation.Recipient));\n CompanyLocation.\"Shpfy Payment Terms Id\" := CommunicationMgt.GetIdOfGId(JsonHelper.GetValueAsText(JCompanyLocation, 'buyerExperienceConfiguration.paymentTermsTemplate.id'));\n- CompanyLocation.\"Customer Id\" := CustomerId;\n+ CompanyLocation.\"Customer Id\" := Customer.SystemId;\n+ CompanyLocation.\"Sell-to Customer No.\" := Customer.\"No.\";\n+ CompanyLocation.\"Bill-to Customer No.\" := Customer.\"Bill-to Customer No.\";\n CompanyLocation.Modify(true);\n exit(CompanyLocationId);\n end;\n"} +{"instance_id": "microsoft__BCApps-4822__cf-2", "base_instance_id": "microsoft__BCApps-4822", "variant_description": "Sell-to Customer No. should only be set when the customer has a non-empty No.", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoft__BCApps-4822__cf-2", "FAIL_TO_PASS": [{"codeunitID": 139539, "functionName": ["TestCreateCompanyLocationSellToBillTo"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/src/Apps/W1/Shopify/Test/Companies/ShpfyCompanyLocationsTest.Codeunit.al b/src/Apps/W1/Shopify/Test/Companies/ShpfyCompanyLocationsTest.Codeunit.al\nindex be8c01cb17..d27dba8d65 100644\n--- a/src/Apps/W1/Shopify/Test/Companies/ShpfyCompanyLocationsTest.Codeunit.al\n+++ b/src/Apps/W1/Shopify/Test/Companies/ShpfyCompanyLocationsTest.Codeunit.al\n@@ -23,6 +23,7 @@ codeunit 139539 \"Shpfy Company Locations Test\"\n Customer: Record Customer;\n InitializeTest: Codeunit \"Shpfy Initialize Test\";\n OutboundHttpRequests: Codeunit \"Library - Variable Storage\";\n+ Assert: Codeunit \"Library Assert\";\n IsInitialized: Boolean;\n ResponseResourceUrl: Text;\n UnexpectedAPICallsErr: Label 'More than expected API calls to Shopify detected.';\n@@ -57,6 +58,37 @@ codeunit 139539 \"Shpfy Company Locations Test\"\n ShopifyCompanies.OpenEdit();\n ShopifyCompanies.GoToRecord(ShopifyCompany);\n ShopifyCompanies.Locations.GoToRecord(CompanyLocation);\n+\n+ // Cleanup\n+ CompanyLocation.Delete();\n+ end;\n+\n+ [Test]\n+ [HandlerFunctions('HttpSubmitHandler')]\n+ procedure TestCreateCompanyLocationSellToBillTo()\n+ var\n+ ShopifyCustomer: Record \"Shpfy Customer\";\n+ CompanyAPI: Codeunit \"Shpfy Company API\";\n+ begin\n+ // [GIVEN] A valid customer and company location setup\n+ RegExpectedOutboundHttpRequests();\n+ Initialize();\n+ ShopifyCompany.GetBySystemId(CompanyLocation.\"Company SystemId\");\n+ Customer.\"Bill-to Customer No.\" := 'BILLTO';\n+ Customer.Modify(true);\n+\n+ // [WHEN] CreateCompanyLocation is called\n+ CompanyAPI.SetCompany(ShopifyCompany);\n+ CompanyAPI.SetShop(Shop);\n+ CompanyAPI.CreateCustomerAsCompanyLocation(Customer, ShopifyCompany, ShopifyCustomer);\n+\n+ // [THEN] Company location should be created successfully\n+#pragma warning disable AA0210\n+ CompanyLocation.SetRange(\"Customer Id\", Customer.SystemId);\n+#pragma warning restore AA0210\n+ CompanyLocation.FindFirst();\n+ Customer.\"No.\" := '';\n+ Assert.AreEqual('', CompanyLocation.\"Sell-to Customer No.\", 'Sell-to Customer No. mismatch');\n+ Assert.AreEqual(Customer.\"Bill-to Customer No.\", CompanyLocation.\"Bill-to Customer No.\", 'Bill-to Customer No. mismatch');\n end;\n \n [Test]\n", "patch": "diff --git a/src/Apps/W1/Shopify/App/src/Companies/Codeunits/ShpfyCompanyAPI.Codeunit.al b/src/Apps/W1/Shopify/App/src/Companies/Codeunits/ShpfyCompanyAPI.Codeunit.al\nindex 2d2014446c..d09ff272d8 100644\n--- a/src/Apps/W1/Shopify/App/src/Companies/Codeunits/ShpfyCompanyAPI.Codeunit.al\n+++ b/src/Apps/W1/Shopify/App/src/Companies/Codeunits/ShpfyCompanyAPI.Codeunit.al\n@@ -523,7 +523,7 @@ codeunit 30286 \"Shpfy Company API\"\n JResponse := CommunicationMgt.ExecuteGraphQL(GraphQuery.ToText());\n if JResponse.SelectToken('$.data.companyLocationCreate.companyLocation', JCompanyLocation) then\n if not JsonHelper.IsTokenNull(JCompanyLocation) then begin\n- LocationId := CreateCustomerLocation(JCompanyLocation.AsObject(), ShopifyCompany, Customer.SystemId);\n+ LocationId := CreateCustomerLocation(JCompanyLocation.AsObject(), ShopifyCompany, Customer);\n if JsonHelper.GetJsonArray(JCompanyLocation, JContactRoles, 'company.contactRoles.edges') then begin\n foreach JItem in JContactRoles do\n CompanyContactRoles.Add(JsonHelper.GetValueAsText(JItem, 'node.name'), CommunicationMgt.GetIdOfGId(JsonHelper.GetValueAsText(JItem, 'node.id')));\n@@ -540,7 +540,7 @@ codeunit 30286 \"Shpfy Company API\"\n /// \n /// JSON object containing the company location data from Shopify API response.\n /// The parent Shopify company record.\n- /// The GUID of the Business Central customer that was exported.\n+ /// The Business Central customer record used to populate additional fields.\n /// \n /// This procedure:\n /// - Extracts the Shopify-generated ID and creates the initial record\n@@ -552,7 +552,7 @@ codeunit 30286 \"Shpfy Company API\"\n /// The procedure assumes the JSON structure matches Shopify's companyLocationCreate response format.\n /// All text fields are properly truncated to match the field lengths in the table definition.\n /// \n- local procedure CreateCustomerLocation(JCompanyLocation: JsonObject; ShopifyCompany: Record \"Shpfy Company\"; CustomerId: Guid): BigInteger\n+ local procedure CreateCustomerLocation(JCompanyLocation: JsonObject; ShopifyCompany: Record \"Shpfy Company\"; Customer: Record Customer): BigInteger\n var\n CompanyLocation: Record \"Shpfy Company Location\";\n CompanyLocationId: BigInteger;\n@@ -580,7 +580,11 @@ codeunit 30286 \"Shpfy Company API\"\n #pragma warning restore AA0139\n CompanyLocation.Recipient := CopyStr(JsonHelper.GetValueAsText(JCompanyLocation, 'billingAddress.recipient', MaxStrLen(CompanyLocation.Recipient)), 1, MaxStrLen(CompanyLocation.Recipient));\n CompanyLocation.\"Shpfy Payment Terms Id\" := CommunicationMgt.GetIdOfGId(JsonHelper.GetValueAsText(JCompanyLocation, 'buyerExperienceConfiguration.paymentTermsTemplate.id'));\n- CompanyLocation.\"Customer Id\" := CustomerId;\n+ CompanyLocation.\"Customer Id\" := Customer.SystemId;\n+ if Customer.\"No.\" <> '' then\n+ CompanyLocation.\"Sell-to Customer No.\" := Customer.\"No.\";\n+ if Customer.\"Bill-to Customer No.\" <> '' then\n+ CompanyLocation.\"Bill-to Customer No.\" := Customer.\"Bill-to Customer No.\";\n CompanyLocation.Modify(true);\n exit(CompanyLocationId);\n end;\n"} +{"instance_id": "microsoft__BCApps-4822__cf-3", "base_instance_id": "microsoft__BCApps-4822", "variant_description": "Customer Id should not be set when the customer record is temporary", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoft__BCApps-4822__cf-3", "FAIL_TO_PASS": [{"codeunitID": 139539, "functionName": ["TestCreateCompanyLocationSellToBillTo"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/src/Apps/W1/Shopify/Test/Companies/ShpfyCompanyLocationsTest.Codeunit.al b/src/Apps/W1/Shopify/Test/Companies/ShpfyCompanyLocationsTest.Codeunit.al\nindex be8c01cb17..d27dba8d65 100644\n--- a/src/Apps/W1/Shopify/Test/Companies/ShpfyCompanyLocationsTest.Codeunit.al\n+++ b/src/Apps/W1/Shopify/Test/Companies/ShpfyCompanyLocationsTest.Codeunit.al\n@@ -23,6 +23,7 @@ codeunit 139539 \"Shpfy Company Locations Test\"\n Customer: Record Customer;\n InitializeTest: Codeunit \"Shpfy Initialize Test\";\n OutboundHttpRequests: Codeunit \"Library - Variable Storage\";\n+ Assert: Codeunit \"Library Assert\";\n IsInitialized: Boolean;\n ResponseResourceUrl: Text;\n UnexpectedAPICallsErr: Label 'More than expected API calls to Shopify detected.';\n@@ -57,6 +58,37 @@ codeunit 139539 \"Shpfy Company Locations Test\"\n ShopifyCompanies.OpenEdit();\n ShopifyCompanies.GoToRecord(ShopifyCompany);\n ShopifyCompanies.Locations.GoToRecord(CompanyLocation);\n+\n+ // Cleanup\n+ CompanyLocation.Delete();\n+ end;\n+\n+ [Test]\n+ [HandlerFunctions('HttpSubmitHandler')]\n+ procedure TestCreateCompanyLocationSellToBillTo()\n+ var\n+ ShopifyCustomer: Record \"Shpfy Customer\";\n+ CompanyAPI: Codeunit \"Shpfy Company API\";\n+ begin\n+ // [GIVEN] A valid customer and company location setup\n+ RegExpectedOutboundHttpRequests();\n+ Initialize();\n+ ShopifyCompany.GetBySystemId(CompanyLocation.\"Company SystemId\");\n+ Customer.\"Bill-to Customer No.\" := 'BILLTO';\n+ Customer.Modify(true);\n+ Customer.SetTemporary(true);\n+\n+ // [WHEN] CreateCompanyLocation is called\n+ CompanyAPI.SetCompany(ShopifyCompany);\n+ CompanyAPI.SetShop(Shop);\n+ CompanyAPI.CreateCustomerAsCompanyLocation(Customer, ShopifyCompany, ShopifyCustomer);\n+\n+ // [THEN] Company location should be created successfully\n+#pragma warning disable AA0210\n+ CompanyLocation.SetRange(\"Customer Id\", Customer.SystemId);\n+#pragma warning restore AA0210\n+ Assert.IsFalse(CompanyLocation.FindFirst(), 'Should not find location for temporary customer');\n end;\n \n [Test]\n", "patch": "diff --git a/src/Apps/W1/Shopify/App/src/Companies/Codeunits/ShpfyCompanyAPI.Codeunit.al b/src/Apps/W1/Shopify/App/src/Companies/Codeunits/ShpfyCompanyAPI.Codeunit.al\nindex 2d2014446c..d09ff272d8 100644\n--- a/src/Apps/W1/Shopify/App/src/Companies/Codeunits/ShpfyCompanyAPI.Codeunit.al\n+++ b/src/Apps/W1/Shopify/App/src/Companies/Codeunits/ShpfyCompanyAPI.Codeunit.al\n@@ -523,7 +523,7 @@ codeunit 30286 \"Shpfy Company API\"\n JResponse := CommunicationMgt.ExecuteGraphQL(GraphQuery.ToText());\n if JResponse.SelectToken('$.data.companyLocationCreate.companyLocation', JCompanyLocation) then\n if not JsonHelper.IsTokenNull(JCompanyLocation) then begin\n- LocationId := CreateCustomerLocation(JCompanyLocation.AsObject(), ShopifyCompany, Customer.SystemId);\n+ LocationId := CreateCustomerLocation(JCompanyLocation.AsObject(), ShopifyCompany, Customer);\n if JsonHelper.GetJsonArray(JCompanyLocation, JContactRoles, 'company.contactRoles.edges') then begin\n foreach JItem in JContactRoles do\n CompanyContactRoles.Add(JsonHelper.GetValueAsText(JItem, 'node.name'), CommunicationMgt.GetIdOfGId(JsonHelper.GetValueAsText(JItem, 'node.id')));\n@@ -540,7 +540,7 @@ codeunit 30286 \"Shpfy Company API\"\n /// \n /// JSON object containing the company location data from Shopify API response.\n /// The parent Shopify company record.\n- /// The GUID of the Business Central customer that was exported.\n+ /// The Business Central customer record used to populate additional fields.\n /// \n /// This procedure:\n /// - Extracts the Shopify-generated ID and creates the initial record\n@@ -552,7 +552,7 @@ codeunit 30286 \"Shpfy Company API\"\n /// The procedure assumes the JSON structure matches Shopify's companyLocationCreate response format.\n /// All text fields are properly truncated to match the field lengths in the table definition.\n /// \n- local procedure CreateCustomerLocation(JCompanyLocation: JsonObject; ShopifyCompany: Record \"Shpfy Company\"; CustomerId: Guid): BigInteger\n+ local procedure CreateCustomerLocation(JCompanyLocation: JsonObject; ShopifyCompany: Record \"Shpfy Company\"; Customer: Record Customer): BigInteger\n var\n CompanyLocation: Record \"Shpfy Company Location\";\n CompanyLocationId: BigInteger;\n@@ -580,7 +580,11 @@ codeunit 30286 \"Shpfy Company API\"\n #pragma warning restore AA0139\n CompanyLocation.Recipient := CopyStr(JsonHelper.GetValueAsText(JCompanyLocation, 'billingAddress.recipient', MaxStrLen(CompanyLocation.Recipient)), 1, MaxStrLen(CompanyLocation.Recipient));\n CompanyLocation.\"Shpfy Payment Terms Id\" := CommunicationMgt.GetIdOfGId(JsonHelper.GetValueAsText(JCompanyLocation, 'buyerExperienceConfiguration.paymentTermsTemplate.id'));\n- CompanyLocation.\"Customer Id\" := CustomerId;\n+ if not Customer.IsTemporary() then\n+ CompanyLocation.\"Customer Id\" := Customer.SystemId;\n+ CompanyLocation.\"Sell-to Customer No.\" := Customer.\"No.\";\n+ if Customer.\"Bill-to Customer No.\" <> '' then\n+ CompanyLocation.\"Bill-to Customer No.\" := Customer.\"Bill-to Customer No.\";\n CompanyLocation.Modify(true);\n exit(CompanyLocationId);\n end;\n"} +{"instance_id": "microsoft__BCApps-4699__cf-1", "base_instance_id": "microsoft__BCApps-4699", "variant_description": "Currency conversion should only apply to Unit Price, not Unit Cost", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoft__BCApps-4699__cf-1", "FAIL_TO_PASS": [{"codeunitID": 139567, "functionName": ["UnitTestCreateItemFCYToLCYConversion"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/src/Apps/W1/Shopify/Test/Products/ShpfyCreateItemTest.Codeunit.al b/src/Apps/W1/Shopify/Test/Products/ShpfyCreateItemTest.Codeunit.al\nindex a352529aba..f626c18258 100644\n--- a/src/Apps/W1/Shopify/Test/Products/ShpfyCreateItemTest.Codeunit.al\n+++ b/src/Apps/W1/Shopify/Test/Products/ShpfyCreateItemTest.Codeunit.al\n@@ -22,6 +22,7 @@ codeunit 139567 \"Shpfy Create Item Test\"\n \n var\n LibraryAssert: Codeunit \"Library Assert\";\n+ LibraryERM: Codeunit \"Library - ERM\";\n LibraryRandom: Codeunit \"Library - Random\";\n \n [Test]\n@@ -487,4 +488,42 @@ codeunit 139567 \"Shpfy Create Item Test\"\n LibraryAssert.RecordIsNotEmpty(ItemReference);\n until ShopifyVariant.Next() = 0;\n end;\n+\n+ [Test]\n+ procedure UnitTestCreateItemFCYToLCYConversion()\n+ var\n+ Item: Record Item;\n+ Shop: Record \"Shpfy Shop\";\n+ ShopifyVariant: Record \"Shpfy Variant\";\n+ ProductInitTest: Codeunit \"Shpfy Product Init Test\";\n+ InitializeTest: Codeunit \"Shpfy Initialize Test\";\n+ begin\n+ // [SCENARIO] Create a Item from a Shopify Product with the SKU value containing the Item No.\n+\n+ // [GIVEN] The Shop with the setting \"SKU Mapping\" = \"Item No.\";\n+ Shop := InitializeTest.CreateShop();\n+ Shop.\"SKU Mapping\" := \"Shpfy SKU Mapping\"::\"Item No.\";\n+ Shop.\"Currency Code\" := CreateCurrencyAndExchangeRate(2, 2);\n+ Shop.Modify();\n+\n+ // [GIVEN] A Shopify variant record of a standard shopify product. (The variant record always exists, even if the products don't have any variants.)\n+ ShopifyVariant := ProductInitTest.CreateStandardProduct(Shop);\n+ ShopifyVariant.Price := 10;\n+ ShopifyVariant.\"Unit Cost\" := 6;\n+ ShopifyVariant.Modify();\n+ ShopifyVariant.SetRecFilter();\n+\n+ // [WHEN] Executing the report \"Shpfy Create Item\" with the \"Shpfy Variant\" Record.\n+ Codeunit.Run(Codeunit::\"Shpfy Create Item\", ShopifyVariant);\n+\n+ // [THEN] Check Item fields\n+ LibraryAssert.IsTrue(Item.GetBySystemId(ShopifyVariant.\"Item SystemId\"), 'Get Item');\n+ LibraryAssert.AreNearlyEqual(ShopifyVariant.\"Unit Cost\", Item.\"Unit Cost\", 0.1, 'Unit Cost');\n+ LibraryAssert.AreNearlyEqual(ShopifyVariant.Price / 2, Item.\"Unit Price\", 0.1, 'Unit Price');\n+ end;\n+\n+ local procedure CreateCurrencyAndExchangeRate(ExchangeRateAmount: Decimal; AdjustmentExchangeRateAmount: Decimal): Code[10]\n+ begin\n+ exit(LibraryERM.CreateCurrencyWithExchangeRate(WorkDate() - 1, ExchangeRateAmount, AdjustmentExchangeRateAmount));\n+ end;\n }\n", "patch": "diff --git a/src/Apps/W1/Shopify/App/src/Products/Codeunits/ShpfyCreateItem.Codeunit.al b/src/Apps/W1/Shopify/App/src/Products/Codeunits/ShpfyCreateItem.Codeunit.al\nindex 4e6ffd2866..717c4f204b 100644\n--- a/src/Apps/W1/Shopify/App/src/Products/Codeunits/ShpfyCreateItem.Codeunit.al\n+++ b/src/Apps/W1/Shopify/App/src/Products/Codeunits/ShpfyCreateItem.Codeunit.al\n@@ -8,6 +8,7 @@ namespace Microsoft.Integration.Shopify;\n using Microsoft.Inventory.Item;\n using Microsoft.Foundation.UOM;\n using Microsoft.Purchases.Vendor;\n+using Microsoft.Finance.Currency;\n using Microsoft.Inventory.Item.Catalog;\n \n /// \n@@ -230,6 +231,7 @@ codeunit 30171 \"Shpfy Create Item\"\n ItemCategory: Record \"Item Category\";\n ItemVariant: Record \"Item Variant\";\n Vendor: Record Vendor;\n+ CurrencyExchangeRate: Record \"Currency Exchange Rate\";\n CurrentTemplateCode: Code[20];\n ItemNo: Code[20];\n Code: Text;\n@@ -258,10 +260,13 @@ codeunit 30171 \"Shpfy Create Item\"\n CreateItemUnitOfMeasure(ShopifyVariant, Item);\n \n if ShopifyVariant.\"Unit Cost\" <> 0 then\n- Item.Validate(\"Unit Cost\", ShopifyVariant.\"Unit Cost\");\n+ Item.Validate(\"Unit Cost\", ShopifyVariant.\"Unit Cost\");\n \n if ShopifyVariant.Price <> 0 then\n- Item.Validate(\"Unit Price\", ShopifyVariant.Price);\n+ if Shop.\"Currency Code\" = '' then\n+ Item.Validate(\"Unit Price\", ShopifyVariant.Price)\n+ else\n+ Item.Validate(\"Unit Price\", Round(CurrencyExchangeRate.ExchangeAmtFCYToLCY(WorkDate(), Shop.\"Currency Code\", ShopifyVariant.Price, CurrencyExchangeRate.ExchangeRate(WorkDate(), Shop.\"Currency Code\"))));\n \n if ShopifyProduct.\"Product Type\" <> '' then begin\n ItemCategory.SetFilter(Description, FilterMgt.CleanFilterValue(ShopifyProduct.\"Product Type\", MaxStrLen(ItemCategory.Description)));\n"} +{"instance_id": "microsoft__BCApps-4699__cf-2", "base_instance_id": "microsoft__BCApps-4699", "variant_description": "Currency conversion should only occur when Currency Code is set and exchange rate exists", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoft__BCApps-4699__cf-2", "FAIL_TO_PASS": [{"codeunitID": 139567, "functionName": ["UnitTestCreateItemFCYToLCYConversion"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/src/Apps/W1/Shopify/Test/Products/ShpfyCreateItemTest.Codeunit.al b/src/Apps/W1/Shopify/Test/Products/ShpfyCreateItemTest.Codeunit.al\nindex a352529aba..f626c18258 100644\n--- a/src/Apps/W1/Shopify/Test/Products/ShpfyCreateItemTest.Codeunit.al\n+++ b/src/Apps/W1/Shopify/Test/Products/ShpfyCreateItemTest.Codeunit.al\n@@ -22,6 +22,7 @@ codeunit 139567 \"Shpfy Create Item Test\"\n \n var\n LibraryAssert: Codeunit \"Library Assert\";\n+ LibraryERM: Codeunit \"Library - ERM\";\n LibraryRandom: Codeunit \"Library - Random\";\n \n [Test]\n@@ -487,4 +488,42 @@ codeunit 139567 \"Shpfy Create Item Test\"\n LibraryAssert.RecordIsNotEmpty(ItemReference);\n until ShopifyVariant.Next() = 0;\n end;\n+\n+ [Test]\n+ procedure UnitTestCreateItemFCYToLCYConversion()\n+ var\n+ Item: Record Item;\n+ Shop: Record \"Shpfy Shop\";\n+ ShopifyVariant: Record \"Shpfy Variant\";\n+ ProductInitTest: Codeunit \"Shpfy Product Init Test\";\n+ InitializeTest: Codeunit \"Shpfy Initialize Test\";\n+ begin\n+ // [SCENARIO] Create a Item from a Shopify Product with the SKU value containing the Item No.\n+\n+ // [GIVEN] The Shop with the setting \"SKU Mapping\" = \"Item No.\";\n+ Shop := InitializeTest.CreateShop();\n+ Shop.\"SKU Mapping\" := \"Shpfy SKU Mapping\"::\"Item No.\";\n+ Shop.\"Currency Code\" := CreateCurrencyAndExchangeRate(0, 0);\n+ Shop.Modify();\n+\n+ // [GIVEN] A Shopify variant record of a standard shopify product. (The variant record always exists, even if the products don't have any variants.)\n+ ShopifyVariant := ProductInitTest.CreateStandardProduct(Shop);\n+ ShopifyVariant.Price := 10;\n+ ShopifyVariant.\"Unit Cost\" := 6;\n+ ShopifyVariant.Modify();\n+ ShopifyVariant.SetRecFilter();\n+\n+ // [WHEN] Executing the report \"Shpfy Create Item\" with the \"Shpfy Variant\" Record.\n+ Codeunit.Run(Codeunit::\"Shpfy Create Item\", ShopifyVariant);\n+\n+ // [THEN] Check Item fields\n+ LibraryAssert.IsTrue(Item.GetBySystemId(ShopifyVariant.\"Item SystemId\"), 'Get Item');\n+ LibraryAssert.AreNearlyEqual(ShopifyVariant.\"Unit Cost\", Item.\"Unit Cost\", 0.1, 'Unit Cost');\n+ LibraryAssert.AreNearlyEqual(ShopifyVariant.Price, Item.\"Unit Price\", 0.1, 'Unit Price');\n+ end;\n+\n+ local procedure CreateCurrencyAndExchangeRate(ExchangeRateAmount: Decimal; AdjustmentExchangeRateAmount: Decimal): Code[10]\n+ begin\n+ exit(LibraryERM.CreateCurrencyWithExchangeRate(WorkDate() - 1, ExchangeRateAmount, AdjustmentExchangeRateAmount));\n+ end;\n }\n", "patch": "diff --git a/src/Apps/W1/Shopify/App/src/Products/Codeunits/ShpfyCreateItem.Codeunit.al b/src/Apps/W1/Shopify/App/src/Products/Codeunits/ShpfyCreateItem.Codeunit.al\nindex 4e6ffd2866..717c4f204b 100644\n--- a/src/Apps/W1/Shopify/App/src/Products/Codeunits/ShpfyCreateItem.Codeunit.al\n+++ b/src/Apps/W1/Shopify/App/src/Products/Codeunits/ShpfyCreateItem.Codeunit.al\n@@ -8,6 +8,7 @@ namespace Microsoft.Integration.Shopify;\n using Microsoft.Inventory.Item;\n using Microsoft.Foundation.UOM;\n using Microsoft.Purchases.Vendor;\n+using Microsoft.Finance.Currency;\n using Microsoft.Inventory.Item.Catalog;\n \n /// \n@@ -230,6 +231,7 @@ codeunit 30171 \"Shpfy Create Item\"\n ItemCategory: Record \"Item Category\";\n ItemVariant: Record \"Item Variant\";\n Vendor: Record Vendor;\n+ CurrencyExchangeRate: Record \"Currency Exchange Rate\";\n CurrentTemplateCode: Code[20];\n ItemNo: Code[20];\n Code: Text;\n@@ -258,10 +260,22 @@ codeunit 30171 \"Shpfy Create Item\"\n CreateItemUnitOfMeasure(ShopifyVariant, Item);\n \n if ShopifyVariant.\"Unit Cost\" <> 0 then\n- Item.Validate(\"Unit Cost\", ShopifyVariant.\"Unit Cost\");\n+ if Shop.\"Currency Code\" = '' then\n+ Item.Validate(\"Unit Cost\", ShopifyVariant.\"Unit Cost\")\n+ else\n+ if CurrencyExchangeRate.ExchangeRate(WorkDate(), Shop.\"Currency Code\") <> 0 then\n+ Item.Validate(\"Unit Cost\", Round(CurrencyExchangeRate.ExchangeAmtFCYToLCY(WorkDate(), Shop.\"Currency Code\", ShopifyVariant.\"Unit Cost\", CurrencyExchangeRate.ExchangeRate(WorkDate(), Shop.\"Currency Code\"))))\n+ else\n+ Item.Validate(\"Unit Cost\", ShopifyVariant.\"Unit Cost\");\n \n if ShopifyVariant.Price <> 0 then\n- Item.Validate(\"Unit Price\", ShopifyVariant.Price);\n+ if Shop.\"Currency Code\" = '' then\n+ Item.Validate(\"Unit Price\", ShopifyVariant.Price)\n+ else\n+ if CurrencyExchangeRate.ExchangeRate(WorkDate(), Shop.\"Currency Code\") <> 0 then\n+ Item.Validate(\"Unit Price\", Round(CurrencyExchangeRate.ExchangeAmtFCYToLCY(WorkDate(), Shop.\"Currency Code\", ShopifyVariant.Price, CurrencyExchangeRate.ExchangeRate(WorkDate(), Shop.\"Currency Code\"))))\n+ else\n+ Item.Validate(\"Unit Price\", ShopifyVariant.Price);\n \n if ShopifyProduct.\"Product Type\" <> '' then begin\n ItemCategory.SetFilter(Description, FilterMgt.CleanFilterValue(ShopifyProduct.\"Product Type\", MaxStrLen(ItemCategory.Description)));\n"} +{"instance_id": "microsoftInternal__NAV-223790__cf-1", "base_instance_id": "microsoftInternal__NAV-223790", "variant_description": "Component planning should only occur when Respect Planning Parameters is true", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-223790__cf-1", "FAIL_TO_PASS": [{"codeunitID": 137035, "functionName": ["CheckPlanningWorksheetPlanComponentwhenStockkeepingUnitsSetup"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMPSBugsI.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMPSBugsI.Codeunit.al\nindex cd0d28c59b88..9867c364a8cb 100644\n--- a/App/Layers/W1/Tests/SCM/SCMPSBugsI.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMPSBugsI.Codeunit.al\n@@ -45,6 +45,8 @@ codeunit 137035 \"SCM PS Bugs-I\"\n QuantityErr: Label 'Quantity update should be possible in %1.', Comment = '%1= Table Name.';\n DueDateErr: Label 'Planned production order due date not match with planning worksheet due date';\n SKUInventoryErr: Label 'Expected inventory to be blank for non-inventory item';\n+ MainItemErr: Label 'New planning worksheet line not created for main item';\n+ CompoItemErr: Label 'New planning worksheet line not created for component item';\n \n [Test]\n [Scope('OnPrem')]\n@@ -1320,6 +1322,97 @@ codeunit 137035 \"SCM PS Bugs-I\"\n LibraryVariableStorage.AssertEmpty();\n end;\n \n+ [Test]\n+ [HandlerFunctions('SKURequestPageHandler')]\n+ procedure CheckPlanningWorksheetPlanComponentwhenStockkeepingUnitsSetup()\n+ var\n+ CompItem: Record Item;\n+ InventorySetup: Record \"Inventory Setup\";\n+ Location: Record Location;\n+ MainItem: Record Item;\n+ ManufacturingSetup: Record \"Manufacturing Setup\";\n+ ProductionBOMHeader: Record \"Production BOM Header\";\n+ Requisitionline: Record \"Requisition Line\";\n+ SalesHeader: Record \"Sales Header\";\n+ SalesLine: Record \"Sales Line\";\n+ Itemcard: TestPage \"Item Card\";\n+ SKUCardPage: TestPage \"Stockkeeping Unit Card\";\n+ ActualCount: Integer;\n+ begin\n+ // [SCENARIO 579977] Check Planning Worksheet Plan Component when Stockkeeping Units Setup for Items.\n+ Initialize();\n+\n+ // [GIVEN] Set Manufacturing Setup for Dynamic Low-Level Code and Inventory Setup for ombined MPS/MRP Calculation.\n+ ManufacturingSetup.Get();\n+ ManufacturingSetup.Validate(\"Dynamic Low-Level Code\", true);\n+ ManufacturingSetup.Modify(true);\n+ InventorySetup.Get();\n+ InventorySetup.Validate(\"Combined MPS/MRP Calculation\", true);\n+ InventorySetup.Modify(true);\n+\n+ // [GIVEN] Create Item with Replenishment System as Production Order.\n+ LibraryInventory.CreateItem(CompItem);\n+\n+ // [GIVEN] Create Location.\n+ LibraryWarehouse.CreateLocation(Location);\n+\n+ // [GIVEN] Create Stockkeeping Unit for Item and Location.\n+ Commit();\n+ LibraryVariableStorage.Enqueue(Location.Code);\n+ ItemCard.OpenView();\n+ ItemCard.GotoRecord(CompItem);\n+ ItemCard.\"&Create Stockkeeping Unit\".Invoke();\n+ ItemCard.OK().Invoke();\n+\n+ // [GIVEN] Modify Stockkeeping Unit for Item.\n+ SKUCardPage.OpenView();\n+ SKUCardPage.Filter.SetFilter(\"Item No.\", CompItem.\"No.\");\n+ SKUCardPage.Filter.SetFilter(\"Location Code\", Location.\"Code\");\n+ SKUCardPage.\"Replenishment System\".SetValue(\"Replenishment System\"::Purchase);\n+ SKUCardPage.\"Reordering Policy\".SetValue(\"Reordering Policy\"::\"Order\");\n+ SKUCardPage.Close();\n+\n+ // [GIVEN] Create BOM for the item.\n+ LibraryManufacturing.CreateCertifiedProductionBOM(ProductionBOMHeader, CompItem.\"No.\", 1);\n+\n+ // [GIVEN] Create Main Item with Replenishment System as Production Order.\n+ LibraryInventory.CreateItem(MainItem);\n+\n+ // [GIVEN] Create Stockkeeping Unit for Main Item and Location.\n+ Commit();\n+ LibraryVariableStorage.Enqueue(Location.Code);\n+ ItemCard.OpenView();\n+ ItemCard.GotoRecord(MainItem);\n+ ItemCard.\"&Create Stockkeeping Unit\".Invoke();\n+ ItemCard.OK().Invoke();\n+\n+ // [GIVEN] Modify Stockkeeping Unit Created for Main Item.\n+ SKUCardPage.OpenView();\n+ SKUCardPage.Filter.SetFilter(\"Item No.\", MainItem.\"No.\");\n+ SKUCardPage.Filter.SetFilter(\"Location Code\", Location.\"Code\");\n+ SKUCardPage.\"Replenishment System\".SetValue(\"Replenishment System\"::\"Prod. Order\");\n+ SKUCardPage.\"Reordering Policy\".SetValue(\"Reordering Policy\"::\"Lot-for-Lot\");\n+ SKUCardPage.\"Manufacturing Policy\".SetValue(\"Manufacturing Policy\"::\"Make-to-Stock\");\n+ SKUCardPage.\"Production BOM No.\".SetValue(ProductionBOMHeader.\"No.\");\n+ SKUCardPage.Close();\n+\n+ // [WHEN] Create Sales order for Item and Location.\n+ Librarysales.CreateSalesDocumentWithItem(\n+ SalesHeader, SalesLine, SalesHeader.\"Document Type\"::Order, '', MainItem.\"No.\", 10, Location.\"Code\", WorkDate());\n+\n+ // [WHEN] Calculate regenerative plan in planning worksheet update Planning Worksheet.\n+ CalculateRegenerativePlanningWorksheet(CompItem, MainItem, WorkDate(), CalcDate('<1Y>', WorkDate()), true, true);\n+\n+ // [THEN] Verify Actual Count Match with Expected Result for Main Item Planning Worksheet Line.\n+ CountPlanningWorksheetLine(Requisitionline, ActualCount, MainItem.\"No.\", Location.\"Code\");\n+ Assert.AreEqual(1, ActualCount, MainItemErr);\n+\n+ // [THEN] Verify Actual Count Match with Expected Result for Component Item Planning Worksheet Line.\n+ CountPlanningWorksheetLine(Requisitionline, ActualCount, CompItem.\"No.\", Location.\"Code\");\n+ Assert.AreEqual(1, ActualCount, CompoItemErr);\n+ LibraryVariableStorage.AssertEmpty();\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n@@ -2143,6 +2236,32 @@ codeunit 137035 \"SCM PS Bugs-I\"\n Assert.AreEqual(DueDate, ProductionOrder.\"Due Date\", DueDateErr);\n end;\n \n+ local procedure CountPlanningWorksheetLine(Requisitionline: Record \"Requisition Line\"; var ActualCount: Integer; ItemNo: Code[20]; LocationCode: Code[10])\n+ begin\n+ Clear(ActualCount);\n+ Requisitionline.Reset();\n+ Requisitionline.SetRange(\"No.\", ItemNo);\n+ Requisitionline.SetRange(\"Location Code\", LocationCode);\n+ if Requisitionline.FindSet() then\n+ ActualCount := Requisitionline.Count;\n+ end;\n+\n+ local procedure CalculateRegenerativePlanningWorksheet(var CompItemRec: Record Item; var MainItemRec: Record Item; OrderDate: Date; ToDate: Date; RespectPlanningParameters: Boolean; Regenerative: Boolean)\n+ var\n+ TmpItemRec: Record Item;\n+ RequisitionWkshName: Record \"Requisition Wksh. Name\";\n+ CalculatePlanPlanWksh: Report \"Calculate Plan - Plan. Wksh.\";\n+ begin\n+ LibraryPlanning.SelectRequisitionWkshName(RequisitionWkshName, RequisitionWkshName.\"Template Type\"::Planning); // Find Requisition Worksheet Name to Calculate Plan.\n+ Commit();\n+ CalculatePlanPlanWksh.InitializeRequest(OrderDate, ToDate, RespectPlanningParameters, true, true, '', 0D, Regenerative);\n+ CalculatePlanPlanWksh.SetTemplAndWorksheet(RequisitionWkshName.\"Worksheet Template Name\", RequisitionWkshName.Name, Regenerative);\n+ TmpItemRec.SetFilter(\"No.\", '%1..%2', CompItemRec.\"No.\", MainItemRec.\"No.\");\n+ CalculatePlanPlanWksh.SetTableView(TmpItemRec);\n+ CalculatePlanPlanWksh.UseRequestPage(false);\n+ CalculatePlanPlanWksh.RunModal();\n+ end;\n+\n [ConfirmHandler]\n [Scope('OnPrem')]\n procedure ConfirmHandler(Question: Text[1024]; var Reply: Boolean)\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Manufacturing/Inventory/Location/MfgStockkeepingUnit.TableExt.al b/App/Layers/W1/BaseApp/Manufacturing/Inventory/Location/MfgStockkeepingUnit.TableExt.al\nindex e6df0fd1150e..bd56f5d829d5 100644\n--- a/App/Layers/W1/BaseApp/Manufacturing/Inventory/Location/MfgStockkeepingUnit.TableExt.al\n+++ b/App/Layers/W1/BaseApp/Manufacturing/Inventory/Location/MfgStockkeepingUnit.TableExt.al\n@@ -8,6 +8,7 @@ using Microsoft.Inventory.Item;\n using Microsoft.Manufacturing.Document;\n using Microsoft.Manufacturing.ProductionBOM;\n using Microsoft.Manufacturing.Routing;\n+using Microsoft.Manufacturing.Setup;\n \n tableextension 99000759 \"Mfg. Stockkeeping Unit\" extends \"Stockkeeping Unit\"\n {\n@@ -62,6 +63,27 @@ tableextension 99000759 \"Mfg. Stockkeeping Unit\" extends \"Stockkeeping Unit\"\n Caption = 'Production BOM No.';\n DataClassification = CustomerContent;\n TableRelation = \"Production BOM Header\";\n+ trigger OnValidate()\n+ var\n+ Item: Record Item;\n+ ItemUnitOfMeasure: Record \"Item Unit of Measure\";\n+ MfgSetup: Record \"Manufacturing Setup\";\n+ ProdBOMHeader: Record \"Production BOM Header\";\n+ CalculateLowLevelCode: Codeunit \"Calculate Low-Level Code\";\n+ begin\n+ if (\"Production BOM No.\" <> '') and (\"Production BOM No.\" <> xRec.\"Production BOM No.\") then begin\n+ ProdBOMHeader.Get(\"Production BOM No.\");\n+ ItemUnitOfMeasure.Get(\"Item No.\", ProdBOMHeader.\"Unit of Measure Code\");\n+ if ProdBOMHeader.Status = ProdBOMHeader.Status::Certified then begin\n+ MfgSetup.Get();\n+ Item.Get(\"Item No.\");\n+ if MfgSetup.\"Dynamic Low-Level Code\" then begin\n+ Item.\"Low-Level Code\" := CalculateLowLevelCode.CalcLevels(1, Item.\"No.\", 0, 0);\n+ CalculateLowLevelCode.SetRecursiveLevelsOnBOM(ProdBOMHeader, Item.\"Low-Level Code\" + 1, false);\n+ end;\n+ end;\n+ end;\n+ end;\n }\n field(99000765; \"Planned Order Receipt (Qty.)\"; Decimal)\n {\n"} +{"instance_id": "microsoftInternal__NAV-223819__cf-1", "base_instance_id": "microsoftInternal__NAV-223819", "variant_description": "Salesperson dimension should override New Location dimension only when no default dimension is defined on the New Location", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-223819__cf-1", "FAIL_TO_PASS": [{"codeunitID": 134474, "functionName": ["OverrideDimWithNewLocationsAndSalespersonOnItemJournalLine"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/Dimension/ERMDimensionLocations.Codeunit.al b/App/Layers/W1/Tests/Dimension/ERMDimensionLocations.Codeunit.al\nindex 8e58207a24d3..3a47bcf8819f 100644\n--- a/App/Layers/W1/Tests/Dimension/ERMDimensionLocations.Codeunit.al\n+++ b/App/Layers/W1/Tests/Dimension/ERMDimensionLocations.Codeunit.al\n@@ -1232,6 +1232,64 @@ codeunit 134474 \"ERM Dimension Locations\"\n Assert.AreNotEqual(TransferHeader.\"Shortcut Dimension 2 Code\", TransferLine.\"Shortcut Dimension 2 Code\", DimensionsNotEqualErr);\n end;\n \n+ [Test]\n+ procedure OverrideDimWithNewLocationsAndSalespersonOnItemJournalLine()\n+ var\n+ DimensionValue: array[2] of Record \"Dimension Value\";\n+ Item: Record Item;\n+ LocationFrom: Record Location;\n+ LocationTo: Record Location;\n+ ItemJournalTemplate: Record \"Item Journal Template\";\n+ ItemJournalBatch: Record \"Item Journal Batch\";\n+ ItemJournalLine: Record \"Item Journal Line\";\n+ SalespersonPurchaser: Record \"Salesperson/Purchaser\";\n+ begin\n+ // [SCENARIO 596687] In the Item Reclassification Journal is the Dimension value wrongly updated by adding a Sales Person to the line\n+ Initialize();\n+\n+ // [GIVEN] Global dimension 1 values \"V1\" and \"V2\".\n+ LibraryDimension.CreateDimensionValue(DimensionValue[1], LibraryERM.GetGlobalDimensionCode(1));\n+ LibraryDimension.CreateDimensionValue(DimensionValue[2], LibraryERM.GetGlobalDimensionCode(1));\n+\n+ // [GIVEN] Assign value \"V1\" to location \"BLUE\".\n+ // [GIVEN] Assign value \"V2\" to location \"RED\".\n+ LibraryInventory.CreateItem(Item);\n+ CreateLocationWithDefaultDimension(LocationFrom, DimensionValue[1]);\n+ LocationTo.Init();\n+ LocationTo.Insert(true);\n+\n+ // [GIVEN] Create item reclassification journal line.\n+ LibraryInventory.SelectItemJournalTemplateName(ItemJournalTemplate, ItemJournalTemplate.Type::Transfer);\n+ LibraryInventory.SelectItemJournalBatchName(ItemJournalBatch, ItemJournalTemplate.Type, ItemJournalTemplate.Name);\n+ LibraryInventory.CreateItemJnlLineWithNoItem(\n+ ItemJournalLine, ItemJournalBatch, ItemJournalTemplate.Name, ItemJournalBatch.Name, \"Item Ledger Entry Type\"::Transfer);\n+ ItemJournalline.Validate(\"Item No.\", Item.\"No.\");\n+\n+ // [GIVEN] Set \"Location Code\" = \"BLUE\" on the item journal line.\n+ // [GIVEN] Verify that \"Shortcut Dimension 1 Code\" = \"V1\".\n+ // [GIVEN] Verify that \"Dimension Set ID\" includes value \"V1\".\n+ ItemJournalLine.Validate(\"Location Code\", LocationFrom.Code);\n+ ItemJournalLine.TestField(\"Shortcut Dimension 1 Code\", DimensionValue[1].Code);\n+ VerifyDimensionValue(ItemJournalLine.\"Dimension Set ID\", DimensionValue[1]);\n+\n+ // [WHEN] Set \"New Location Code\" = \"RED\".\n+ ItemJournalLine.Validate(\"New Location Code\", LocationTo.Code);\n+\n+ // [WHEN] Set \"Sales Person Purchaser\" = \"RED\".\n+ LibrarySales.CreateSalesperson(SalespersonPurchaser);\n+ CreateDefaultDimensionWithSpecCode(SalespersonPurchaser.Code, DATABASE::\"Salesperson/Purchaser\");\n+ ItemJournalLine.Validate(\"Salespers./Purch. Code\", SalespersonPurchaser.Code);\n+\n+ // [THEN] \"New Shortcut Dimension 1 Code\" = \"V2\".\n+ // [THEN] \"New Dimension Set ID\" includes value \"V2\".\n+ ItemJournalLine.TestField(\"New Shortcut Dimension 1 Code\", DimensionValue[1].Code);\n+ VerifyDimensionValue(ItemJournalLine.\"New Dimension Set ID\", DimensionValue[1]);\n+\n+ // [THEN] \"Shortcut Dimension 1 Code\" remains \"V1\".\n+ // [THEN] \"Dimension Set ID\" is not changed.\n+ ItemJournalLine.TestField(\"Shortcut Dimension 1 Code\", DimensionValue[1].Code);\n+ VerifyDimensionValue(ItemJournalLine.\"Dimension Set ID\", DimensionValue[1]);\n+ end;\n+\n local procedure Initialize()\n begin\n LibraryTestInitialize.OnTestInitialize(Codeunit::\"ERM Dimension Locations\");\n@@ -1340,6 +1398,25 @@ codeunit 134474 \"ERM Dimension Locations\"\n DefaultDimensionPriority.Modify(true);\n end;\n \n+ local procedure CreateDefaultDimensionWithSpecCode(AccountNo: Code[20]; TableID: Integer)\n+ var\n+ Dimension: Record Dimension;\n+ DimensionValue: Record \"Dimension Value\";\n+ DefaultDimension: Record \"Default Dimension\";\n+ begin\n+ LibraryDimension.CreateDimension(Dimension);\n+ CreateDimensionValueWithSpecCode(DimensionValue, AccountNo, Dimension.Code);\n+ LibraryDimension.CreateDefaultDimension(DefaultDimension, TableID, AccountNo, Dimension.Code, DimensionValue.Code);\n+ end;\n+\n+ local procedure CreateDimensionValueWithSpecCode(var DimensionValue: Record \"Dimension Value\"; DimensionValueCode: Code[20]; DimensionCode: Code[20])\n+ begin\n+ DimensionValue.Init();\n+ DimensionValue.Validate(\"Dimension Code\", DimensionCode);\n+ DimensionValue.Validate(Code, DimensionValueCode);\n+ DimensionValue.Insert(true);\n+ end;\n+\n [ModalPageHandler]\n procedure DefaultDimensionsMultipleModalPageHandler(var DefaultDimensionsMultiple: TestPage \"Default Dimensions-Multiple\")\n begin\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al b/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al\nindex 7fc2d9853602..c0a52d871c5d 100644\n--- a/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al\n@@ -2375,11 +2375,14 @@ table 83 \"Item Journal Line\"\n OnCreateDimOnBeforeUpdateGlobalDimFromDimSetID(Rec, xRec, CurrFieldNo, OldDimSetID, DefaultDimSource, InheritFromDimSetID, InheritFromTableNo);\n DimMgt.UpdateGlobalDimFromDimSetID(\"Dimension Set ID\", \"Shortcut Dimension 1 Code\", \"Shortcut Dimension 2 Code\");\n \n- if \"Entry Type\" = \"Entry Type\"::Transfer then begin\n- \"New Dimension Set ID\" := \"Dimension Set ID\";\n- \"New Shortcut Dimension 1 Code\" := \"Shortcut Dimension 1 Code\";\n- \"New Shortcut Dimension 2 Code\" := \"Shortcut Dimension 2 Code\";\n- end;\n+ if \"Entry Type\" = \"Entry Type\"::Transfer then\n+ if (Rec.\"New Location Code\" <> '') and HasDefaultDim(Rec.\"New Location Code\") then\n+ CreateNewDimFromDefaultDim(Rec.FieldNo(\"New Location Code\"))\n+ else begin\n+ \"New Dimension Set ID\" := \"Dimension Set ID\";\n+ \"New Shortcut Dimension 1 Code\" := \"Shortcut Dimension 1 Code\";\n+ \"New Shortcut Dimension 2 Code\" := \"Shortcut Dimension 2 Code\";\n+ end;\n end;\n \n /// \n"} +{"instance_id": "microsoftInternal__NAV-223819__cf-2", "base_instance_id": "microsoftInternal__NAV-223819", "variant_description": "New Location dimension should only apply when Default Dimension Priority is configured for Location table", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-223819__cf-2", "FAIL_TO_PASS": [{"codeunitID": 134474, "functionName": ["OverrideDimWithNewLocationsAndSalespersonOnItemJournalLine"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/Dimension/ERMDimensionLocations.Codeunit.al b/App/Layers/W1/Tests/Dimension/ERMDimensionLocations.Codeunit.al\nindex 8e58207a24d3..3a47bcf8819f 100644\n--- a/App/Layers/W1/Tests/Dimension/ERMDimensionLocations.Codeunit.al\n+++ b/App/Layers/W1/Tests/Dimension/ERMDimensionLocations.Codeunit.al\n@@ -1232,6 +1232,64 @@ codeunit 134474 \"ERM Dimension Locations\"\n Assert.AreNotEqual(TransferHeader.\"Shortcut Dimension 2 Code\", TransferLine.\"Shortcut Dimension 2 Code\", DimensionsNotEqualErr);\n end;\n \n+ [Test]\n+ procedure OverrideDimWithNewLocationsAndSalespersonOnItemJournalLine()\n+ var\n+ DimensionValue: array[2] of Record \"Dimension Value\";\n+ Item: Record Item;\n+ LocationFrom: Record Location;\n+ LocationTo: Record Location;\n+ ItemJournalTemplate: Record \"Item Journal Template\";\n+ ItemJournalBatch: Record \"Item Journal Batch\";\n+ ItemJournalLine: Record \"Item Journal Line\";\n+ SalespersonPurchaser: Record \"Salesperson/Purchaser\";\n+ begin\n+ // [SCENARIO 596687] In the Item Reclassification Journal is the Dimension value wrongly updated by adding a Sales Person to the line\n+ Initialize();\n+ RemoveLocationFromDefaultDimPriority();\n+\n+ // [GIVEN] Global dimension 1 values \"V1\" and \"V2\".\n+ LibraryDimension.CreateDimensionValue(DimensionValue[1], LibraryERM.GetGlobalDimensionCode(1));\n+ LibraryDimension.CreateDimensionValue(DimensionValue[2], LibraryERM.GetGlobalDimensionCode(1));\n+\n+ // [GIVEN] Assign value \"V1\" to location \"BLUE\".\n+ // [GIVEN] Assign value \"V2\" to location \"RED\".\n+ LibraryInventory.CreateItem(Item);\n+ CreateLocationWithDefaultDimension(LocationFrom, DimensionValue[1]);\n+ CreateLocationWithDefaultDimension(LocationTo, DimensionValue[2]);\n+\n+ // [GIVEN] Create item reclassification journal line.\n+ LibraryInventory.SelectItemJournalTemplateName(ItemJournalTemplate, ItemJournalTemplate.Type::Transfer);\n+ LibraryInventory.SelectItemJournalBatchName(ItemJournalBatch, ItemJournalTemplate.Type, ItemJournalTemplate.Name);\n+ LibraryInventory.CreateItemJnlLineWithNoItem(\n+ ItemJournalLine, ItemJournalBatch, ItemJournalTemplate.Name, ItemJournalBatch.Name, \"Item Ledger Entry Type\"::Transfer);\n+ ItemJournalline.Validate(\"Item No.\", Item.\"No.\");\n+\n+ // [GIVEN] Set \"Location Code\" = \"BLUE\" on the item journal line.\n+ // [GIVEN] Verify that \"Shortcut Dimension 1 Code\" = \"V1\".\n+ // [GIVEN] Verify that \"Dimension Set ID\" includes value \"V1\".\n+ ItemJournalLine.Validate(\"Location Code\", LocationFrom.Code);\n+ ItemJournalLine.TestField(\"Shortcut Dimension 1 Code\", DimensionValue[1].Code);\n+ VerifyDimensionValue(ItemJournalLine.\"Dimension Set ID\", DimensionValue[1]);\n+\n+ // [WHEN] Set \"New Location Code\" = \"RED\".\n+ ItemJournalLine.Validate(\"New Location Code\", LocationTo.Code);\n+\n+ // [WHEN] Set \"Sales Person Purchaser\" = \"RED\".\n+ LibrarySales.CreateSalesperson(SalespersonPurchaser);\n+ CreateDefaultDimensionWithSpecCode(SalespersonPurchaser.Code, DATABASE::\"Salesperson/Purchaser\");\n+ ItemJournalLine.Validate(\"Salespers./Purch. Code\", SalespersonPurchaser.Code);\n+\n+ // [THEN] \"New Shortcut Dimension 1 Code\" = \"V2\".\n+ // [THEN] \"New Dimension Set ID\" includes value \"V2\".\n+ ItemJournalLine.TestField(\"New Shortcut Dimension 1 Code\", DimensionValue[1].Code);\n+ VerifyDimensionValue(ItemJournalLine.\"New Dimension Set ID\", DimensionValue[1]);\n+\n+ // [THEN] \"Shortcut Dimension 1 Code\" remains \"V1\".\n+ // [THEN] \"Dimension Set ID\" is not changed.\n+ ItemJournalLine.TestField(\"Shortcut Dimension 1 Code\", DimensionValue[1].Code);\n+ VerifyDimensionValue(ItemJournalLine.\"Dimension Set ID\", DimensionValue[1]);\n+ end;\n+\n local procedure Initialize()\n begin\n LibraryTestInitialize.OnTestInitialize(Codeunit::\"ERM Dimension Locations\");\n@@ -1340,6 +1398,25 @@ codeunit 134474 \"ERM Dimension Locations\"\n DefaultDimensionPriority.Modify(true);\n end;\n \n+ local procedure CreateDefaultDimensionWithSpecCode(AccountNo: Code[20]; TableID: Integer)\n+ var\n+ Dimension: Record Dimension;\n+ DimensionValue: Record \"Dimension Value\";\n+ DefaultDimension: Record \"Default Dimension\";\n+ begin\n+ LibraryDimension.CreateDimension(Dimension);\n+ CreateDimensionValueWithSpecCode(DimensionValue, AccountNo, Dimension.Code);\n+ LibraryDimension.CreateDefaultDimension(DefaultDimension, TableID, AccountNo, Dimension.Code, DimensionValue.Code);\n+ end;\n+\n+ local procedure CreateDimensionValueWithSpecCode(var DimensionValue: Record \"Dimension Value\"; DimensionValueCode: Code[20]; DimensionCode: Code[20])\n+ begin\n+ DimensionValue.Init();\n+ DimensionValue.Validate(\"Dimension Code\", DimensionCode);\n+ DimensionValue.Validate(Code, DimensionValueCode);\n+ DimensionValue.Insert(true);\n+ end;\n+\n [ModalPageHandler]\n procedure DefaultDimensionsMultipleModalPageHandler(var DefaultDimensionsMultiple: TestPage \"Default Dimensions-Multiple\")\n begin\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al b/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al\nindex 7fc2d9853602..c0a52d871c5d 100644\n--- a/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al\n@@ -2375,11 +2375,14 @@ table 83 \"Item Journal Line\"\n OnCreateDimOnBeforeUpdateGlobalDimFromDimSetID(Rec, xRec, CurrFieldNo, OldDimSetID, DefaultDimSource, InheritFromDimSetID, InheritFromTableNo);\n DimMgt.UpdateGlobalDimFromDimSetID(\"Dimension Set ID\", \"Shortcut Dimension 1 Code\", \"Shortcut Dimension 2 Code\");\n \n- if \"Entry Type\" = \"Entry Type\"::Transfer then begin\n- \"New Dimension Set ID\" := \"Dimension Set ID\";\n- \"New Shortcut Dimension 1 Code\" := \"Shortcut Dimension 1 Code\";\n- \"New Shortcut Dimension 2 Code\" := \"Shortcut Dimension 2 Code\";\n- end;\n+ if \"Entry Type\" = \"Entry Type\"::Transfer then\n+ if (Rec.\"New Location Code\" <> '') and IsLocationPriorityEnabled() then\n+ CreateNewDimFromDefaultDim(Rec.FieldNo(\"New Location Code\"))\n+ else begin\n+ \"New Dimension Set ID\" := \"Dimension Set ID\";\n+ \"New Shortcut Dimension 1 Code\" := \"Shortcut Dimension 1 Code\";\n+ \"New Shortcut Dimension 2 Code\" := \"Shortcut Dimension 2 Code\";\n+ end;\n end;\n \n /// \n"} +{"instance_id": "microsoftInternal__NAV-222092__cf-1", "base_instance_id": "microsoftInternal__NAV-222092", "variant_description": "Updated dimensions should propagate only if Reminder Header Dimension Set ID is non-empty", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-222092__cf-1", "FAIL_TO_PASS": [{"codeunitID": 134904, "functionName": ["DimensionsInGeneralLedgerEntriesWhenDimensionsModifiedInReminderBeforeIssuing"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/ERMReminderForAdditinalFee.Codeunit.al b/App/Layers/W1/Tests/ERM/ERMReminderForAdditinalFee.Codeunit.al\nindex 47f98eaf54a8..99b8ac6fb838 100644\n--- a/App/Layers/W1/Tests/ERM/ERMReminderForAdditinalFee.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ERMReminderForAdditinalFee.Codeunit.al\n@@ -324,6 +324,86 @@ codeunit 134904 \"ERM Reminder For Additinal Fee\"\n Assert.AreEqual(Dim2CodeValue, ShortcutDimCode[2], StrSubstNo(DimensionValueErr, Dim2CodeValue));\n end;\n \n+ [Test]\n+ procedure DimensionsInGeneralLedgerEntriesWhenDimensionsModifiedInReminderBeforeIssuing();\n+ var\n+ Customer: Record Customer;\n+ CustomerPostingGroup: Record \"Customer Posting Group\";\n+ DefaultDimension: array[2] of Record \"Default Dimension\";\n+ DimensionValue: Record \"Dimension Value\";\n+ GLAccount: Record \"G/L Account\";\n+ GLEntry: Record \"G/L Entry\";\n+ ReminderHeader: Record \"Reminder Header\";\n+ ReminderLevel: Record \"Reminder Level\";\n+ ReminderTerms: Record \"Reminder Terms\";\n+ SalesHeader: Record \"Sales Header\";\n+ GetShortcutDimValues: Codeunit \"Get Shortcut Dimension Values\";\n+ Dim1CodeValue: array[2] of Code[20];\n+ Dim2CodeValue: Code[20];\n+ IssuedReminderNo: Code[20];\n+ ShortcutDimCode: array[8] of Code[20];\n+ begin\n+ // [SCENARIO 590674] Dimensions assigned to General Ledger Entries when the Dimensions are modified in the Reminder before issuing it.\n+ Initialize();\n+\n+ // [GIVEN] Create two Dimension Values for Global Dimension 1 Code.\n+ Dim1CodeValue[1] := LibraryUtility.GenerateGUID();\n+ Dim1CodeValue[2] := Dim1CodeValue[1] + '1';\n+ LibraryDimension.CreateDimensionValueWithCode(DimensionValue, Dim1CodeValue[1], LibraryERM.GetGlobalDimensionCode(1));\n+ LibraryDimension.CreateDimensionValueWithCode(DimensionValue, Dim1CodeValue[2], LibraryERM.GetGlobalDimensionCode(1));\n+\n+ // [GIVEN] Create Dimension Value for Global Dimension 2 Code and assign it.\n+ Dim2CodeValue := LibraryUtility.GenerateGUID();\n+ LibraryDimension.CreateDimensionValueWithCode(DimensionValue, Dim2CodeValue, LibraryERM.GetGlobalDimensionCode(2));\n+\n+ // [GIVEN] Create Reminder Terms with Post Additional Fee = True.\n+ CreateReminderTerms(ReminderLevel, '');\n+ ReminderTerms.Get(ReminderLevel.\"Reminder Terms Code\");\n+ ReminderTerms.\"Post Additional Fee\" := true;\n+ ReminderTerms.Modify(true);\n+\n+ // [GIVEN] Create Customer with Reminder Terms and Customer Posting Group.\n+ Customer.Get(CreateCustomer(ReminderLevel.\"Reminder Terms Code\", ''));\n+ LibrarySales.CreateCustomerPostingGroup(CustomerPostingGroup);\n+\n+ // [GIVEN] Create Default Dimension for Customer with global Dimension 1 Code.\n+ LibraryDimension.CreateDefaultDimensionWithNewDimValue(\n+ DefaultDimension[1], DATABASE::Customer, Customer.\"No.\",\n+ DefaultDimension[1].\"Value Posting\"::\"Code Mandatory\");\n+\n+ // [GIVEN] Find GL Account for Additional Fee Account and assign Global Dimension 1 Code and Global Dimension 2 Code.\n+ GLAccount.Get(CustomerPostingGroup.\"Additional Fee Account\");\n+ GLAccount.ValidateShortcutDimCode(1, Dim1CodeValue[1]);\n+ GLAccount.ValidateShortcutDimCode(2, Dim2CodeValue);\n+ GLAccount.Modify(true);\n+\n+ // [GIVEN] Validate Customer Posting Group in Customer.\n+ Customer.Validate(\"Customer Posting Group\", CustomerPostingGroup.Code);\n+ Customer.Modify(true);\n+\n+ // [GIVEN] Posted Sales Invoice and Run Suggested Reminder with Additional Fee line.\n+ CreateAndPostSalesInvoice(SalesHeader, Customer.\"No.\");\n+ ReminderHeader.Get(\n+ CreateAndSuggestReminder(\n+ SalesHeader.\"Sell-to Customer No.\",\n+ CalcDate('<1D>', CalcDate(ReminderLevel.\"Grace Period\", SalesHeader.\"Due Date\"))));\n+ ReminderHeader.Validate(\"Shortcut Dimension 1 Code\", Dim1CodeValue[2]);\n+ ReminderHeader.\"Dimension Set ID\" := 0;\n+ ReminderHeader.Modify(true);\n+\n+ // [WHEN] Reminder is issued\n+ IssuedReminderNo := IssueReminderAndGetIssuedNo(ReminderHeader.\"No.\");\n+\n+ // [THEN] Find G/L Entry for Reminder with GL Account.\n+ GLEntry.SetRange(\"Document Type\", GLEntry.\"Document Type\"::Reminder);\n+ GLEntry.SetRange(\"Document No.\", IssuedReminderNo);\n+ GLEntry.SetRange(\"G/L Account No.\", GLAccount.\"No.\");\n+ GLEntry.FindFirst();\n+\n+ // [THEN] G/L Entry contains Global Dimension 1 Code as updated in Reminder Header.\n+ GetShortcutDimValues.GetShortcutDimensions(GLEntry.\"Dimension Set ID\", ShortcutDimCode);\n+ Assert.AreNotEqual(Dim1CodeValue[2], ShortcutDimCode[1], StrSubstNo(DimensionValueErr, Dim1CodeValue[2]));\n+ end;\n+\n [Scope('OnPrem')]\n procedure InterestAmountWithBeginningText()\n var\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Sales/Reminder/ReminderIssue.Codeunit.al b/App/Layers/W1/BaseApp/Sales/Reminder/ReminderIssue.Codeunit.al\nindex 825eb23c9503..9ff59101df20 100644\n--- a/App/Layers/W1/BaseApp/Sales/Reminder/ReminderIssue.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Sales/Reminder/ReminderIssue.Codeunit.al\n@@ -270,8 +270,8 @@ codeunit 393 \"Reminder-Issue\"\n begin\n GenJnlLine2.\"Shortcut Dimension 1 Code\" := GlobalReminderHeader.\"Shortcut Dimension 1 Code\";\n GenJnlLine2.\"Shortcut Dimension 2 Code\" := GlobalReminderHeader.\"Shortcut Dimension 2 Code\";\n- DimSetIDArr[1] := GlobalReminderHeader.\"Dimension Set ID\";\n- DimSetIDArr[2] := TempGenJnlLine.\"Dimension Set ID\";\n+ DimSetIDArr[1] := TempGenJnlLine.\"Dimension Set ID\";\n+ if GlobalReminderHeader.\"Dimension Set ID\" <> 0 then\n+ DimSetIDArr[2] := GlobalReminderHeader.\"Dimension Set ID\";\n GenJnlLine2.\"Dimension Set ID\" :=\n DimMgt.GetCombinedDimensionSetID(\n DimSetIDArr, GenJnlLine2.\"Shortcut Dimension 1 Code\", GenJnlLine2.\"Shortcut Dimension 2 Code\");\n"} +{"instance_id": "microsoftInternal__NAV-222092__cf-2", "base_instance_id": "microsoftInternal__NAV-222092", "variant_description": "Reminder Header dimensions should override only Global Dimension 1, not Global Dimension 2", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-222092__cf-2", "FAIL_TO_PASS": [{"codeunitID": 134904, "functionName": ["DimensionsInGeneralLedgerEntriesWhenDimensionsModifiedInReminderBeforeIssuing"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/ERMReminderForAdditinalFee.Codeunit.al b/App/Layers/W1/Tests/ERM/ERMReminderForAdditinalFee.Codeunit.al\nindex 47f98eaf54a8..99b8ac6fb838 100644\n--- a/App/Layers/W1/Tests/ERM/ERMReminderForAdditinalFee.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ERMReminderForAdditinalFee.Codeunit.al\n@@ -324,6 +324,86 @@ codeunit 134904 \"ERM Reminder For Additinal Fee\"\n Assert.AreEqual(Dim2CodeValue, ShortcutDimCode[2], StrSubstNo(DimensionValueErr, Dim2CodeValue));\n end;\n \n+ [Test]\n+ procedure DimensionsInGeneralLedgerEntriesWhenDimensionsModifiedInReminderBeforeIssuing();\n+ var\n+ Customer: Record Customer;\n+ CustomerPostingGroup: Record \"Customer Posting Group\";\n+ DefaultDimension: array[2] of Record \"Default Dimension\";\n+ DimensionValue: Record \"Dimension Value\";\n+ GLAccount: Record \"G/L Account\";\n+ GLEntry: Record \"G/L Entry\";\n+ ReminderHeader: Record \"Reminder Header\";\n+ ReminderLevel: Record \"Reminder Level\";\n+ ReminderTerms: Record \"Reminder Terms\";\n+ SalesHeader: Record \"Sales Header\";\n+ GetShortcutDimValues: Codeunit \"Get Shortcut Dimension Values\";\n+ Dim1CodeValue: array[2] of Code[20];\n+ Dim2CodeValue: Code[20];\n+ IssuedReminderNo: Code[20];\n+ ShortcutDimCode: array[8] of Code[20];\n+ begin\n+ // [SCENARIO 590674] Dimensions assigned to General Ledger Entries when the Dimensions are modified in the Reminder before issuing it.\n+ Initialize();\n+\n+ // [GIVEN] Create two Dimension Values for Global Dimension 1 Code.\n+ Dim1CodeValue[1] := LibraryUtility.GenerateGUID();\n+ Dim1CodeValue[2] := Dim1CodeValue[1] + '1';\n+ LibraryDimension.CreateDimensionValueWithCode(DimensionValue, Dim1CodeValue[1], LibraryERM.GetGlobalDimensionCode(1));\n+ LibraryDimension.CreateDimensionValueWithCode(DimensionValue, Dim1CodeValue[2], LibraryERM.GetGlobalDimensionCode(1));\n+\n+ // [GIVEN] Create Dimension Value for Global Dimension 2 Code and assign it.\n+ Dim2CodeValue := LibraryUtility.GenerateGUID();\n+ LibraryDimension.CreateDimensionValueWithCode(DimensionValue, Dim2CodeValue, LibraryERM.GetGlobalDimensionCode(2));\n+\n+ // [GIVEN] Create Reminder Terms with Post Additional Fee = True.\n+ CreateReminderTerms(ReminderLevel, '');\n+ ReminderTerms.Get(ReminderLevel.\"Reminder Terms Code\");\n+ ReminderTerms.\"Post Additional Fee\" := true;\n+ ReminderTerms.Modify(true);\n+\n+ // [GIVEN] Create Customer with Reminder Terms and Customer Posting Group.\n+ Customer.Get(CreateCustomer(ReminderLevel.\"Reminder Terms Code\", ''));\n+ LibrarySales.CreateCustomerPostingGroup(CustomerPostingGroup);\n+\n+ // [GIVEN] Create Default Dimension for Customer with global Dimension 1 Code.\n+ LibraryDimension.CreateDefaultDimensionWithNewDimValue(\n+ DefaultDimension[1], DATABASE::Customer, Customer.\"No.\",\n+ DefaultDimension[1].\"Value Posting\"::\"Code Mandatory\");\n+\n+ // [GIVEN] Find GL Account for Additional Fee Account and assign Global Dimension 1 Code and Global Dimension 2 Code.\n+ GLAccount.Get(CustomerPostingGroup.\"Additional Fee Account\");\n+ GLAccount.ValidateShortcutDimCode(1, Dim1CodeValue[1]);\n+ GLAccount.ValidateShortcutDimCode(2, Dim2CodeValue);\n+ GLAccount.Modify(true);\n+\n+ // [GIVEN] Validate Customer Posting Group in Customer.\n+ Customer.Validate(\"Customer Posting Group\", CustomerPostingGroup.Code);\n+ Customer.Modify(true);\n+\n+ // [GIVEN] Posted Sales Invoice and Run Suggested Reminder with Additional Fee line.\n+ CreateAndPostSalesInvoice(SalesHeader, Customer.\"No.\");\n+ ReminderHeader.Get(\n+ CreateAndSuggestReminder(\n+ SalesHeader.\"Sell-to Customer No.\",\n+ CalcDate('<1D>', CalcDate(ReminderLevel.\"Grace Period\", SalesHeader.\"Due Date\"))));\n+ ReminderHeader.Validate(\"Shortcut Dimension 1 Code\", Dim1CodeValue[2]);\n+ ReminderHeader.Modify(true);\n+\n+ // [WHEN] Reminder is issued\n+ IssuedReminderNo := IssueReminderAndGetIssuedNo(ReminderHeader.\"No.\");\n+\n+ // [THEN] Find G/L Entry for Reminder with GL Account.\n+ GLEntry.SetRange(\"Document Type\", GLEntry.\"Document Type\"::Reminder);\n+ GLEntry.SetRange(\"Document No.\", IssuedReminderNo);\n+ GLEntry.SetRange(\"G/L Account No.\", GLAccount.\"No.\");\n+ GLEntry.FindFirst();\n+\n+ // [THEN] G/L Entry contains Global Dimension 1 Code as updated in Reminder Header.\n+ GetShortcutDimValues.GetShortcutDimensions(GLEntry.\"Dimension Set ID\", ShortcutDimCode);\n+ Assert.AreEqual(Dim1CodeValue[2], ShortcutDimCode[1], StrSubstNo(DimensionValueErr, Dim1CodeValue[2]));\n+ Assert.AreEqual(Dim2CodeValue, ShortcutDimCode[2], StrSubstNo(DimensionValueErr, Dim2CodeValue));\n+ end;\n+\n [Scope('OnPrem')]\n procedure InterestAmountWithBeginningText()\n var\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Sales/Reminder/ReminderIssue.Codeunit.al b/App/Layers/W1/BaseApp/Sales/Reminder/ReminderIssue.Codeunit.al\nindex 825eb23c9503..9ff59101df20 100644\n--- a/App/Layers/W1/BaseApp/Sales/Reminder/ReminderIssue.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Sales/Reminder/ReminderIssue.Codeunit.al\n@@ -270,8 +270,8 @@ codeunit 393 \"Reminder-Issue\"\n begin\n GenJnlLine2.\"Shortcut Dimension 1 Code\" := GlobalReminderHeader.\"Shortcut Dimension 1 Code\";\n // keep original Dim2 from TempGenJnlLine\n- DimSetIDArr[1] := GlobalReminderHeader.\"Dimension Set ID\";\n- DimSetIDArr[2] := TempGenJnlLine.\"Dimension Set ID\";\n+ DimSetIDArr[1] := TempGenJnlLine.\"Dimension Set ID\";\n+ DimSetIDArr[2] := GlobalReminderHeader.\"Dimension Set ID\";\n GenJnlLine2.\"Dimension Set ID\" :=\n DimMgt.GetCombinedDimensionSetID(\n DimSetIDArr, GenJnlLine2.\"Shortcut Dimension 1 Code\", GenJnlLine2.\"Shortcut Dimension 2 Code\");\n"} +{"instance_id": "microsoftInternal__NAV-222092__cf-3", "base_instance_id": "microsoftInternal__NAV-222092", "variant_description": "Reminder Header dimensions should apply only to additional fee entries, not all entries", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-222092__cf-3", "FAIL_TO_PASS": [{"codeunitID": 134904, "functionName": ["DimensionsInGeneralLedgerEntriesWhenDimensionsModifiedInReminderBeforeIssuing"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/ERMReminderForAdditinalFee.Codeunit.al b/App/Layers/W1/Tests/ERM/ERMReminderForAdditinalFee.Codeunit.al\nindex 47f98eaf54a8..99b8ac6fb838 100644\n--- a/App/Layers/W1/Tests/ERM/ERMReminderForAdditinalFee.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ERMReminderForAdditinalFee.Codeunit.al\n@@ -324,6 +324,86 @@ codeunit 134904 \"ERM Reminder For Additinal Fee\"\n Assert.AreEqual(Dim2CodeValue, ShortcutDimCode[2], StrSubstNo(DimensionValueErr, Dim2CodeValue));\n end;\n \n+ [Test]\n+ procedure DimensionsInGeneralLedgerEntriesWhenDimensionsModifiedInReminderBeforeIssuing();\n+ var\n+ Customer: Record Customer;\n+ CustomerPostingGroup: Record \"Customer Posting Group\";\n+ DefaultDimension: array[2] of Record \"Default Dimension\";\n+ DimensionValue: Record \"Dimension Value\";\n+ GLAccount: Record \"G/L Account\";\n+ GLEntry: Record \"G/L Entry\";\n+ ReminderHeader: Record \"Reminder Header\";\n+ ReminderLevel: Record \"Reminder Level\";\n+ ReminderTerms: Record \"Reminder Terms\";\n+ SalesHeader: Record \"Sales Header\";\n+ GetShortcutDimValues: Codeunit \"Get Shortcut Dimension Values\";\n+ Dim1CodeValue: array[2] of Code[20];\n+ Dim2CodeValue: Code[20];\n+ IssuedReminderNo: Code[20];\n+ ShortcutDimCode: array[8] of Code[20];\n+ begin\n+ // [SCENARIO 590674] Dimensions assigned to General Ledger Entries when the Dimensions are modified in the Reminder before issuing it.\n+ Initialize();\n+\n+ // [GIVEN] Create two Dimension Values for Global Dimension 1 Code.\n+ Dim1CodeValue[1] := LibraryUtility.GenerateGUID();\n+ Dim1CodeValue[2] := Dim1CodeValue[1] + '1';\n+ LibraryDimension.CreateDimensionValueWithCode(DimensionValue, Dim1CodeValue[1], LibraryERM.GetGlobalDimensionCode(1));\n+ LibraryDimension.CreateDimensionValueWithCode(DimensionValue, Dim1CodeValue[2], LibraryERM.GetGlobalDimensionCode(1));\n+\n+ // [GIVEN] Create Dimension Value for Global Dimension 2 Code and assign it.\n+ Dim2CodeValue := LibraryUtility.GenerateGUID();\n+ LibraryDimension.CreateDimensionValueWithCode(DimensionValue, Dim2CodeValue, LibraryERM.GetGlobalDimensionCode(2));\n+\n+ // [GIVEN] Create Reminder Terms with Post Additional Fee = True.\n+ CreateReminderTerms(ReminderLevel, '');\n+ ReminderTerms.Get(ReminderLevel.\"Reminder Terms Code\");\n+ ReminderTerms.\"Post Additional Fee\" := true;\n+ ReminderTerms.Modify(true);\n+\n+ // [GIVEN] Create Customer with Reminder Terms and Customer Posting Group.\n+ Customer.Get(CreateCustomer(ReminderLevel.\"Reminder Terms Code\", ''));\n+ LibrarySales.CreateCustomerPostingGroup(CustomerPostingGroup);\n+\n+ // [GIVEN] Create Default Dimension for Customer with global Dimension 1 Code.\n+ LibraryDimension.CreateDefaultDimensionWithNewDimValue(\n+ DefaultDimension[1], DATABASE::Customer, Customer.\"No.\",\n+ DefaultDimension[1].\"Value Posting\"::\"Code Mandatory\");\n+\n+ // [GIVEN] Find GL Account for Additional Fee Account and assign Global Dimension 1 Code and Global Dimension 2 Code.\n+ GLAccount.Get(CustomerPostingGroup.\"Additional Fee Account\");\n+ GLAccount.ValidateShortcutDimCode(1, Dim1CodeValue[1]);\n+ GLAccount.ValidateShortcutDimCode(2, Dim2CodeValue);\n+ GLAccount.Modify(true);\n+\n+ // [GIVEN] Validate Customer Posting Group in Customer.\n+ Customer.Validate(\"Customer Posting Group\", CustomerPostingGroup.Code);\n+ Customer.Modify(true);\n+\n+ // [GIVEN] Posted Sales Invoice and Run Suggested Reminder with Additional Fee line.\n+ CreateAndPostSalesInvoice(SalesHeader, Customer.\"No.\");\n+ ReminderHeader.Get(\n+ CreateAndSuggestReminder(\n+ SalesHeader.\"Sell-to Customer No.\",\n+ CalcDate('<1D>', CalcDate(ReminderLevel.\"Grace Period\", SalesHeader.\"Due Date\"))));\n+ ReminderHeader.Validate(\"Shortcut Dimension 1 Code\", Dim1CodeValue[2]);\n+ ReminderHeader.Modify(true);\n+\n+ // [WHEN] Reminder is issued\n+ IssuedReminderNo := IssueReminderAndGetIssuedNo(ReminderHeader.\"No.\");\n+\n+ // [THEN] Find G/L Entry for Reminder with GL Account.\n+ GLEntry.SetRange(\"Document Type\", GLEntry.\"Document Type\"::Reminder);\n+ GLEntry.SetRange(\"Document No.\", IssuedReminderNo);\n+ GLEntry.SetRange(\"G/L Account No.\", GLAccount.\"No.\");\n+ GLEntry.SetRange(\"Gen. Posting Type\", GLEntry.\"Gen. Posting Type\"::\" \");\n+ GLEntry.FindFirst();\n+\n+ // [THEN] G/L Entry contains Global Dimension 1 Code as updated in Reminder Header.\n+ GetShortcutDimValues.GetShortcutDimensions(GLEntry.\"Dimension Set ID\", ShortcutDimCode);\n+ Assert.AreEqual(Dim1CodeValue[2], ShortcutDimCode[1], StrSubstNo(DimensionValueErr, Dim1CodeValue[2]));\n+ end;\n+\n [Scope('OnPrem')]\n procedure InterestAmountWithBeginningText()\n var\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Sales/Reminder/ReminderIssue.Codeunit.al b/App/Layers/W1/BaseApp/Sales/Reminder/ReminderIssue.Codeunit.al\nindex 825eb23c9503..9ff59101df20 100644\n--- a/App/Layers/W1/BaseApp/Sales/Reminder/ReminderIssue.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Sales/Reminder/ReminderIssue.Codeunit.al\n@@ -270,8 +270,8 @@ codeunit 393 \"Reminder-Issue\"\n begin\n GenJnlLine2.\"Shortcut Dimension 1 Code\" := GlobalReminderHeader.\"Shortcut Dimension 1 Code\";\n GenJnlLine2.\"Shortcut Dimension 2 Code\" := GlobalReminderHeader.\"Shortcut Dimension 2 Code\";\n- DimSetIDArr[1] := GlobalReminderHeader.\"Dimension Set ID\";\n- DimSetIDArr[2] := TempGenJnlLine.\"Dimension Set ID\";\n+ DimSetIDArr[1] := TempGenJnlLine.\"Dimension Set ID\";\n+ if GenJnlLine2.\"Account Type\" = GenJnlLine2.\"Account Type\"::\"G/L Account\" then\n+ DimSetIDArr[2] := GlobalReminderHeader.\"Dimension Set ID\";\n GenJnlLine2.\"Dimension Set ID\" :=\n DimMgt.GetCombinedDimensionSetID(\n DimSetIDArr, GenJnlLine2.\"Shortcut Dimension 1 Code\", GenJnlLine2.\"Shortcut Dimension 2 Code\");\n"} +{"instance_id": "microsoftInternal__NAV-218062__cf-1", "base_instance_id": "microsoftInternal__NAV-218062", "variant_description": "Reserved quantities should be considered only when Location Require Pick is true", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-218062__cf-1", "FAIL_TO_PASS": [{"codeunitID": 137294, "functionName": ["NoErrorOfAvailabilityWhenCreatePickFromPickWorkSheetForProductionOrder"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMInventoryMiscellaneousII.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMInventoryMiscellaneousII.Codeunit.al\nindex eaf731a270b2..178112c70e63 100644\n--- a/App/Layers/W1/Tests/SCM/SCMInventoryMiscellaneousII.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMInventoryMiscellaneousII.Codeunit.al\n@@ -49,6 +49,7 @@ codeunit 137294 \"SCM Inventory Miscellaneous II\"\n NoOfPicksCreatedMsg: Label 'Number of Invt. Pick activities created';\n WhseHandlingRequiredErr: Label 'Warehouse handling is required';\n InventoryMovementIsNotRegisteredErr: Label 'Inventory Movement is not registered.';\n+ InventoryPickNotFoundErr: Label 'Warehouse Activity Header not found for Production Order Components.';\n \n [Test]\n [Scope('OnPrem')]\n@@ -2132,6 +2133,88 @@ codeunit 137294 \"SCM Inventory Miscellaneous II\"\n Assert.IsTrue(RegisteredInvMovementHdr.Count > 0, InventoryMovementIsNotRegisteredErr);\n end;\n \n+ [Test]\n+ [HandlerFunctions('DummyMessageHandler,ReservationPageHandler,PickSelectionPageHandlerSingleDoc,CreatePickPageHandlerForPerWhsDoc')]\n+ [Scope('OnPrem')]\n+ procedure NoErrorOfAvailabilityWhenCreatePickFromPickWorkSheetForProductionOrder()\n+ var\n+ Bin, Bin2, Bin3 : Record Bin;\n+ CompItem, ProdItem : Record Item;\n+ Location: Record Location;\n+ ProductionOrder: array[2] of Record \"Production Order\";\n+ ProductionBOMHeader: Record \"Production BOM Header\";\n+ WarehouseEmployee: Record \"Warehouse Employee\";\n+ WareHouseActivityHeader: Record \"Warehouse Activity Header\";\n+ begin\n+ // [SCENARIO 575862] No availability error when creating pick from pick worksheet with location setup Bin mandatory and the item reserved on the related production order\n+ Initialize();\n+\n+ // [GIVEN] Reset Warehouse Employee Default Location.\n+ ResetWarehouseEmployeeDefaultLocation();\n+\n+ // [GIVEN] Create Location with WMS enabled Bin mandatory\n+ LibraryWarehouse.CreateLocationWMS(Location, false, false, false, false, false);\n+\n+ // [GIVEN] Create Warehouse Employee for Location.\n+ LibraryWarehouse.CreateWarehouseEmployee(WarehouseEmployee, Location.Code, true);\n+\n+ // [GIVEN] Create Bins for Location.\n+ LibraryWarehouse.CreateBin(Bin, Location.Code, Bin.Code, '', '');\n+ LibraryWarehouse.CreateBin(Bin2, Location.Code, Bin2.Code, '', '');\n+ LibraryWarehouse.CreateBin(Bin3, Location.Code, Bin3.Code, '', '');\n+\n+ // [GIVEN] Set \"Prod. Consump. Whse. Handling\" = \"Warehouse Pick (mandatory)\" and assign Bins to \"To-Production Bin Code\" and \"From-Production Bin Code\".\n+ Location.Validate(\"Prod. Consump. Whse. Handling\", Location.\"Prod. Consump. Whse. Handling\"::\"Warehouse Pick (mandatory)\");\n+ Location.Validate(\"To-Production Bin Code\", Bin.Code);\n+ Location.Validate(\"From-Production Bin Code\", Bin2.Code);\n+ Location.Modify(true);\n+\n+ // [GIVEN] Create Component Item with \"Replenishment System\" = \"Purchase\" and \"Flushing Method\" = \"Manual\".\n+ LibraryInventory.CreateItem(CompItem);\n+ CompItem.Validate(\"Replenishment System\", CompItem.\"Replenishment System\"::Purchase);\n+ CompItem.Validate(\"Flushing Method\", CompItem.\"Flushing Method\"::Manual);\n+ CompItem.Modify();\n+\n+ // [GIVEN] Create Production BOM for Component Item.\n+ LibraryInventory.CreateItem(ProdItem);\n+ ProdItem.Validate(\"Replenishment System\", ProdItem.\"Replenishment System\"::\"Prod. Order\");\n+ ProdItem.Validate(\"Manufacturing Policy\", ProdItem.\"Manufacturing Policy\"::\"Make-to-Stock\");\n+ ProdItem.Validate(\"Flushing Method\", ProdItem.\"Flushing Method\"::Manual);\n+ ProdItem.Validate(\"Production BOM No.\", LibraryManufacturing.CreateCertifiedProductionBOM(ProductionBOMHeader, CompItem.\"No.\", 1));\n+ ProdItem.Modify();\n+\n+ // [GIVEN] Create Inventory for Component Item.\n+ CreateInventory(CompItem, 3, Location.Code, Bin3.Code, 0);\n+\n+ // [GIVEN] Create first Production Orders for Production Item of quantity 2\n+ LibraryManufacturing.CreateProductionOrder(\n+ ProductionOrder[1], ProductionOrder[1].Status::Released, ProductionOrder[1].\"Source Type\"::Item, ProdItem.\"No.\", 2);\n+ ProductionOrder[1].Validate(\"Location Code\", Location.Code);\n+ ProductionOrder[1].Modify(true);\n+ LibraryManufacturing.RefreshProdOrder(ProductionOrder[1], false, true, true, true, false);\n+\n+ // [GIVEN] Reserve Component Item on Production Order 1\n+ ReserveQuantityOnComponent(CompItem.\"No.\", ProductionOrder[1].\"No.\");\n+\n+ // [GIVEN] Create second Production Order for Production Item of quantity 1\n+ LibraryManufacturing.CreateProductionOrder(\n+ ProductionOrder[2], ProductionOrder[2].Status::Released, ProductionOrder[2].\"Source Type\"::Item, ProdItem.\"No.\", 1);\n+ ProductionOrder[2].Validate(\"Location Code\", Location.Code);\n+ ProductionOrder[2].Modify(true);\n+ LibraryManufacturing.RefreshProdOrder(ProductionOrder[2], false, true, true, true, false);\n+\n+ // [GIVEN] Reserve Component Item on Production Order 2\n+ ReserveQuantityOnComponent(CompItem.\"No.\", ProductionOrder[2].\"No.\");\n+\n+ // [WHEN] Create Pick Worksheet for Production Order Components.\n+ GetWarehouseDocumentFromPickWorksheet(ProductionOrder);\n+\n+ // [THEN] Verify Warehouse Activity Header for Production Order Components.\n+ WarehouseActivityHeader.SetRange(\"Location Code\", Location.Code);\n+ WareHouseActivityHeader.FindSet();\n+ Assert.IsTrue(WareHouseActivityHeader.Count = 2, InventoryPickNotFoundErr);\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n@@ -3796,6 +3879,50 @@ codeunit 137294 \"SCM Inventory Miscellaneous II\"\n VerifyInventoryPickLine(SalesOrderNo, LotNos[2], Lot2Qty);\n end;\n \n+ local procedure GetWarehouseDocumentFromPickWorksheet(ProductionOrder: array[2] of Record \"Production Order\")\n+ var\n+ PickWorksheet: TestPage \"Pick Worksheet\";\n+ begin\n+ LibraryVariableStorage.Enqueue(ProductionOrder[1].\"No.\"); // Enqueue for PickSelectionPageHandler.\n+ LibraryVariableStorage.Enqueue(ProductionOrder[1].\"Location Code\"); // Enqueue PickSelectionPageHandler.\n+ PickWorksheet.OpenEdit();\n+ PickWorksheet.\"Get Warehouse Documents\".Invoke();\n+\n+ LibraryVariableStorage.Enqueue(ProductionOrder[2].\"No.\"); // Enqueue for PickSelectionPageHandler.\n+ LibraryVariableStorage.Enqueue(ProductionOrder[2].\"Location Code\"); // Enqueue PickSelectionPageHandler.\n+ PickWorksheet.\"Get Warehouse Documents\".Invoke();\n+ Commit();\n+\n+ PickWorksheet.CreatePick.Invoke();\n+ PickWorksheet.OK().Invoke();\n+ end;\n+\n+ local procedure ReserveQuantityOnComponent(ItemNo: code[20]; ProdOrderno: Code[20])\n+ var\n+ ProdOrderComponents: TestPage \"Prod. Order Components\";\n+ begin\n+ ProdOrderComponents.OpenEdit();\n+ ProdOrderComponents.FILTER.SetFilter(\"Item No.\", ItemNo);\n+ ProdOrderComponents.FILTER.SetFilter(\"Prod. Order No.\", ProdOrderno);\n+ ProdOrderComponents.Reserve.Invoke();\n+ ProdOrderComponents.Close();\n+ end;\n+\n+ local procedure CreateInventory(Item: Record Item; Quantity: Decimal; LocationCode: Code[10]; BinCode: Code[20]; UnitAmount: Decimal)\n+ var\n+ ItemJournalBatch: Record \"Item Journal Batch\";\n+ ItemJournalLine: Record \"Item Journal Line\";\n+ begin\n+ LibraryInventory.CreateItemJournalBatchByType(ItemJournalBatch, ItemJournalBatch.\"Template Type\"::Item);\n+\n+ LibraryInventory.CreateItemJournalLine(ItemJournalLine, ItemJournalBatch, Item, LocationCode, '', WorkDate(),\n+ ItemJournalLine.\"Entry Type\"::\"Positive Adjmt.\", Quantity, UnitAmount);\n+ ItemJournalLine.Validate(\"Bin Code\", BinCode);\n+ ItemJournalLine.Modify();\n+\n+ LibraryInventory.PostItemJournalBatch(ItemJournalBatch);\n+ end;\n+\n [MessageHandler]\n [Scope('OnPrem')]\n procedure DummyMessageHandler(Message: Text[1024])\n@@ -3817,5 +3944,36 @@ codeunit 137294 \"SCM Inventory Miscellaneous II\"\n begin\n Reply := true;\n end;\n+\n+ [ModalPageHandler]\n+ [Scope('OnPrem')]\n+ procedure ReservationPageHandler(var Reservation: TestPage Reservation)\n+ begin\n+ Reservation.\"Reserve from Current Line\".Invoke();\n+ Reservation.OK().Invoke();\n+ end;\n+\n+ [RequestPageHandler]\n+ [Scope('OnPrem')]\n+ procedure CreatePickPageHandlerForPerWhsDoc(var CreatePick: TestRequestPage \"Create Pick\")\n+ begin\n+ CreatePick.PerWhseDoc.SetValue(true);\n+ CreatePick.OK().Invoke();\n+ end;\n+\n+ [ModalPageHandler]\n+ [Scope('OnPrem')]\n+ procedure PickSelectionPageHandlerSingleDoc(var PickSelection: TestPage \"Pick Selection\")\n+ var\n+ DocumentNo: Variant;\n+ LocationCode: Variant;\n+ begin\n+ LibraryVariableStorage.Dequeue(DocumentNo); // Dequeue Variable.\n+ LibraryVariableStorage.Dequeue(LocationCode); // Dequeue Variable.\n+ PickSelection.Filter.SetFilter(\"Document No.\", DocumentNo);\n+ PickSelection.\"Document No.\".AssertEquals(DocumentNo);\n+ PickSelection.\"Location Code\".AssertEquals(LocationCode);\n+ PickSelection.OK().Invoke();\n+ end;\n }\n \n", "patch": "diff --git a/App/Layers/W1/BaseApp/Warehouse/Availability/WarehouseAvailabilityMgt.Codeunit.al b/App/Layers/W1/BaseApp/Warehouse/Availability/WarehouseAvailabilityMgt.Codeunit.al\nindex 0b63877adb3b..32239d687e93 100644\n--- a/App/Layers/W1/BaseApp/Warehouse/Availability/WarehouseAvailabilityMgt.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Warehouse/Availability/WarehouseAvailabilityMgt.Codeunit.al\n@@ -870,7 +870,9 @@ codeunit 7314 \"Warehouse Availability Mgt.\"\n end else\n AvailQtyBase := CalcInvtAvailQty(Item, Location, WhseWorksheetLine.\"Variant Code\", TempWhseActivLine);\n \n- if Location.\"Require Pick\" then\n+ if Location.\"Require Pick\" and\n+ (Location.\"Prod. Consump. Whse. Handling\" = Location.\"Prod. Consump. Whse. Handling\"::\"Warehouse Pick (mandatory)\")\n+ then\n QtyReservedOnPickShip := CalcReservQtyOnPicksShips(WhseWorksheetLine.\"Location Code\", WhseWorksheetLine.\"Item No.\", WhseWorksheetLine.\"Variant Code\", TempWhseActivLine);\n \n QtyReservedForCurrLine :=\n"} +{"instance_id": "microsoftInternal__NAV-218062__cf-2", "base_instance_id": "microsoftInternal__NAV-218062", "variant_description": "Availability check should be performed per production order, not aggregated across all orders", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-218062__cf-2", "FAIL_TO_PASS": [{"codeunitID": 137294, "functionName": ["NoErrorOfAvailabilityWhenCreatePickFromPickWorkSheetForProductionOrder"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMInventoryMiscellaneousII.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMInventoryMiscellaneousII.Codeunit.al\nindex eaf731a270b2..178112c70e63 100644\n--- a/App/Layers/W1/Tests/SCM/SCMInventoryMiscellaneousII.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMInventoryMiscellaneousII.Codeunit.al\n@@ -49,6 +49,7 @@ codeunit 137294 \"SCM Inventory Miscellaneous II\"\n NoOfPicksCreatedMsg: Label 'Number of Invt. Pick activities created';\n WhseHandlingRequiredErr: Label 'Warehouse handling is required';\n InventoryMovementIsNotRegisteredErr: Label 'Inventory Movement is not registered.';\n+ InventoryPickNotFoundErr: Label 'Warehouse Activity Header not found for Production Order Components.';\n \n [Test]\n [Scope('OnPrem')]\n@@ -2132,6 +2133,88 @@ codeunit 137294 \"SCM Inventory Miscellaneous II\"\n Assert.IsTrue(RegisteredInvMovementHdr.Count > 0, InventoryMovementIsNotRegisteredErr);\n end;\n \n+ [Test]\n+ [HandlerFunctions('DummyMessageHandler,ReservationPageHandler,PickSelectionPageHandlerSingleDoc,CreatePickPageHandlerForPerWhsDoc')]\n+ [Scope('OnPrem')]\n+ procedure NoErrorOfAvailabilityWhenCreatePickFromPickWorkSheetForProductionOrder()\n+ var\n+ Bin, Bin2, Bin3 : Record Bin;\n+ CompItem, ProdItem : Record Item;\n+ Location: Record Location;\n+ ProductionOrder: array[2] of Record \"Production Order\";\n+ ProductionBOMHeader: Record \"Production BOM Header\";\n+ WarehouseEmployee: Record \"Warehouse Employee\";\n+ WareHouseActivityHeader: Record \"Warehouse Activity Header\";\n+ begin\n+ // [SCENARIO 575862] No availability error when creating pick from pick worksheet with location setup Bin mandatory and the item reserved on the related production order\n+ Initialize();\n+\n+ // [GIVEN] Reset Warehouse Employee Default Location.\n+ ResetWarehouseEmployeeDefaultLocation();\n+\n+ // [GIVEN] Create Location with WMS enabled Bin mandatory\n+ LibraryWarehouse.CreateLocationWMS(Location, true, false, false, false, false);\n+\n+ // [GIVEN] Create Warehouse Employee for Location.\n+ LibraryWarehouse.CreateWarehouseEmployee(WarehouseEmployee, Location.Code, true);\n+\n+ // [GIVEN] Create Bins for Location.\n+ LibraryWarehouse.CreateBin(Bin, Location.Code, Bin.Code, '', '');\n+ LibraryWarehouse.CreateBin(Bin2, Location.Code, Bin2.Code, '', '');\n+ LibraryWarehouse.CreateBin(Bin3, Location.Code, Bin3.Code, '', '');\n+\n+ // [GIVEN] Set \"Prod. Consump. Whse. Handling\" = \"Warehouse Pick (mandatory)\" and assign Bins to \"To-Production Bin Code\" and \"From-Production Bin Code\".\n+ Location.Validate(\"Prod. Consump. Whse. Handling\", Location.\"Prod. Consump. Whse. Handling\"::\"Warehouse Pick (mandatory)\");\n+ Location.Validate(\"To-Production Bin Code\", Bin.Code);\n+ Location.Validate(\"From-Production Bin Code\", Bin2.Code);\n+ Location.Modify(true);\n+\n+ // [GIVEN] Create Component Item with \"Replenishment System\" = \"Purchase\" and \"Flushing Method\" = \"Manual\".\n+ LibraryInventory.CreateItem(CompItem);\n+ CompItem.Validate(\"Replenishment System\", CompItem.\"Replenishment System\"::Purchase);\n+ CompItem.Validate(\"Flushing Method\", CompItem.\"Flushing Method\"::Manual);\n+ CompItem.Modify();\n+\n+ // [GIVEN] Create Production BOM for Component Item.\n+ LibraryInventory.CreateItem(ProdItem);\n+ ProdItem.Validate(\"Replenishment System\", ProdItem.\"Replenishment System\"::\"Prod. Order\");\n+ ProdItem.Validate(\"Manufacturing Policy\", ProdItem.\"Manufacturing Policy\"::\"Make-to-Stock\");\n+ ProdItem.Validate(\"Flushing Method\", ProdItem.\"Flushing Method\"::Manual);\n+ ProdItem.Validate(\"Production BOM No.\", LibraryManufacturing.CreateCertifiedProductionBOM(ProductionBOMHeader, CompItem.\"No.\", 1));\n+ ProdItem.Modify();\n+\n+ // [GIVEN] Create Inventory for Component Item.\n+ CreateInventory(CompItem, 3, Location.Code, Bin3.Code, 0);\n+\n+ // [GIVEN] Create first Production Orders for Production Item of quantity 2\n+ LibraryManufacturing.CreateProductionOrder(\n+ ProductionOrder[1], ProductionOrder[1].Status::Released, ProductionOrder[1].\"Source Type\"::Item, ProdItem.\"No.\", 2);\n+ ProductionOrder[1].Validate(\"Location Code\", Location.Code);\n+ ProductionOrder[1].Modify(true);\n+ LibraryManufacturing.RefreshProdOrder(ProductionOrder[1], false, true, true, true, false);\n+\n+ // [GIVEN] Reserve Component Item on Production Order 1\n+ ReserveQuantityOnComponent(CompItem.\"No.\", ProductionOrder[1].\"No.\");\n+\n+ // [GIVEN] Create second Production Order for Production Item of quantity 1\n+ LibraryManufacturing.CreateProductionOrder(\n+ ProductionOrder[2], ProductionOrder[2].Status::Released, ProductionOrder[2].\"Source Type\"::Item, ProdItem.\"No.\", 1);\n+ ProductionOrder[2].Validate(\"Location Code\", Location.Code);\n+ ProductionOrder[2].Modify(true);\n+ LibraryManufacturing.RefreshProdOrder(ProductionOrder[2], false, true, true, true, false);\n+\n+ // [GIVEN] Reserve Component Item on Production Order 2\n+ ReserveQuantityOnComponent(CompItem.\"No.\", ProductionOrder[2].\"No.\");\n+\n+ // [WHEN] Create Pick Worksheet for Production Order Components.\n+ GetWarehouseDocumentFromPickWorksheet(ProductionOrder);\n+\n+ // [THEN] Verify Warehouse Activity Header for Production Order Components.\n+ WarehouseActivityHeader.SetRange(\"Location Code\", Location.Code);\n+ WareHouseActivityHeader.FindSet();\n+ Assert.IsTrue(WareHouseActivityHeader.Count = 1, InventoryPickNotFoundErr);\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n@@ -3796,6 +3879,50 @@ codeunit 137294 \"SCM Inventory Miscellaneous II\"\n VerifyInventoryPickLine(SalesOrderNo, LotNos[2], Lot2Qty);\n end;\n \n+ local procedure GetWarehouseDocumentFromPickWorksheet(ProductionOrder: array[2] of Record \"Production Order\")\n+ var\n+ PickWorksheet: TestPage \"Pick Worksheet\";\n+ begin\n+ LibraryVariableStorage.Enqueue(ProductionOrder[1].\"No.\"); // Enqueue for PickSelectionPageHandler.\n+ LibraryVariableStorage.Enqueue(ProductionOrder[1].\"Location Code\"); // Enqueue PickSelectionPageHandler.\n+ PickWorksheet.OpenEdit();\n+ PickWorksheet.\"Get Warehouse Documents\".Invoke();\n+\n+ LibraryVariableStorage.Enqueue(ProductionOrder[2].\"No.\"); // Enqueue for PickSelectionPageHandler.\n+ LibraryVariableStorage.Enqueue(ProductionOrder[2].\"Location Code\"); // Enqueue PickSelectionPageHandler.\n+ PickWorksheet.\"Get Warehouse Documents\".Invoke();\n+ Commit();\n+\n+ PickWorksheet.CreatePick.Invoke();\n+ PickWorksheet.OK().Invoke();\n+ end;\n+\n+ local procedure ReserveQuantityOnComponent(ItemNo: code[20]; ProdOrderno: Code[20])\n+ var\n+ ProdOrderComponents: TestPage \"Prod. Order Components\";\n+ begin\n+ ProdOrderComponents.OpenEdit();\n+ ProdOrderComponents.FILTER.SetFilter(\"Item No.\", ItemNo);\n+ ProdOrderComponents.FILTER.SetFilter(\"Prod. Order No.\", ProdOrderno);\n+ ProdOrderComponents.Reserve.Invoke();\n+ ProdOrderComponents.Close();\n+ end;\n+\n+ local procedure CreateInventory(Item: Record Item; Quantity: Decimal; LocationCode: Code[10]; BinCode: Code[20]; UnitAmount: Decimal)\n+ var\n+ ItemJournalBatch: Record \"Item Journal Batch\";\n+ ItemJournalLine: Record \"Item Journal Line\";\n+ begin\n+ LibraryInventory.CreateItemJournalBatchByType(ItemJournalBatch, ItemJournalBatch.\"Template Type\"::Item);\n+\n+ LibraryInventory.CreateItemJournalLine(ItemJournalLine, ItemJournalBatch, Item, LocationCode, '', WorkDate(),\n+ ItemJournalLine.\"Entry Type\"::\"Positive Adjmt.\", Quantity, UnitAmount);\n+ ItemJournalLine.Validate(\"Bin Code\", BinCode);\n+ ItemJournalLine.Modify();\n+\n+ LibraryInventory.PostItemJournalBatch(ItemJournalBatch);\n+ end;\n+\n [MessageHandler]\n [Scope('OnPrem')]\n procedure DummyMessageHandler(Message: Text[1024])\n@@ -3817,5 +3944,36 @@ codeunit 137294 \"SCM Inventory Miscellaneous II\"\n begin\n Reply := true;\n end;\n+\n+ [ModalPageHandler]\n+ [Scope('OnPrem')]\n+ procedure ReservationPageHandler(var Reservation: TestPage Reservation)\n+ begin\n+ Reservation.\"Reserve from Current Line\".Invoke();\n+ Reservation.OK().Invoke();\n+ end;\n+\n+ [RequestPageHandler]\n+ [Scope('OnPrem')]\n+ procedure CreatePickPageHandlerForPerWhsDoc(var CreatePick: TestRequestPage \"Create Pick\")\n+ begin\n+ CreatePick.PerWhseDoc.SetValue(true);\n+ CreatePick.OK().Invoke();\n+ end;\n+\n+ [ModalPageHandler]\n+ [Scope('OnPrem')]\n+ procedure PickSelectionPageHandlerSingleDoc(var PickSelection: TestPage \"Pick Selection\")\n+ var\n+ DocumentNo: Variant;\n+ LocationCode: Variant;\n+ begin\n+ LibraryVariableStorage.Dequeue(DocumentNo); // Dequeue Variable.\n+ LibraryVariableStorage.Dequeue(LocationCode); // Dequeue Variable.\n+ PickSelection.Filter.SetFilter(\"Document No.\", DocumentNo);\n+ PickSelection.\"Document No.\".AssertEquals(DocumentNo);\n+ PickSelection.\"Location Code\".AssertEquals(LocationCode);\n+ PickSelection.OK().Invoke();\n+ end;\n }\n \n", "patch": "diff --git a/App/Layers/W1/BaseApp/Warehouse/Availability/WarehouseAvailabilityMgt.Codeunit.al b/App/Layers/W1/BaseApp/Warehouse/Availability/WarehouseAvailabilityMgt.Codeunit.al\nindex 0b63877adb3b..32239d687e93 100644\n--- a/App/Layers/W1/BaseApp/Warehouse/Availability/WarehouseAvailabilityMgt.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Warehouse/Availability/WarehouseAvailabilityMgt.Codeunit.al\n@@ -870,7 +870,9 @@ codeunit 7314 \"Warehouse Availability Mgt.\"\n end else\n AvailQtyBase := CalcInvtAvailQty(Item, Location, WhseWorksheetLine.\"Variant Code\", TempWhseActivLine);\n \n- if Location.\"Require Pick\" then\n+ if Location.\"Require Pick\" or\n+ (Location.\"Prod. Consump. Whse. Handling\" = Location.\"Prod. Consump. Whse. Handling\"::\"Warehouse Pick (mandatory)\")\n+ then\n QtyReservedOnPickShip := CalcReservQtyOnPicksShipsForCurrentOrder(WhseWorksheetLine.\"Location Code\", WhseWorksheetLine.\"Item No.\", WhseWorksheetLine.\"Variant Code\", TempWhseActivLine);\n \n QtyReservedForCurrLine :=\n"} +{"instance_id": "microsoftInternal__NAV-218062__cf-3", "base_instance_id": "microsoftInternal__NAV-218062", "variant_description": "Availability check should ignore bin-level quantities when Bin Mandatory is enabled", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-218062__cf-3", "FAIL_TO_PASS": [{"codeunitID": 137294, "functionName": ["NoErrorOfAvailabilityWhenCreatePickFromPickWorkSheetForProductionOrder"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMInventoryMiscellaneousII.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMInventoryMiscellaneousII.Codeunit.al\nindex eaf731a270b2..178112c70e63 100644\n--- a/App/Layers/W1/Tests/SCM/SCMInventoryMiscellaneousII.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMInventoryMiscellaneousII.Codeunit.al\n@@ -49,6 +49,7 @@ codeunit 137294 \"SCM Inventory Miscellaneous II\"\n NoOfPicksCreatedMsg: Label 'Number of Invt. Pick activities created';\n WhseHandlingRequiredErr: Label 'Warehouse handling is required';\n InventoryMovementIsNotRegisteredErr: Label 'Inventory Movement is not registered.';\n+ InventoryPickNotFoundErr: Label 'Warehouse Activity Header not found for Production Order Components.';\n \n [Test]\n [Scope('OnPrem')]\n@@ -2132,6 +2133,88 @@ codeunit 137294 \"SCM Inventory Miscellaneous II\"\n Assert.IsTrue(RegisteredInvMovementHdr.Count > 0, InventoryMovementIsNotRegisteredErr);\n end;\n \n+ [Test]\n+ [HandlerFunctions('DummyMessageHandler,ReservationPageHandler,PickSelectionPageHandlerSingleDoc,CreatePickPageHandlerForPerWhsDoc')]\n+ [Scope('OnPrem')]\n+ procedure NoErrorOfAvailabilityWhenCreatePickFromPickWorkSheetForProductionOrder()\n+ var\n+ Bin, Bin2, Bin3 : Record Bin;\n+ CompItem, ProdItem : Record Item;\n+ Location: Record Location;\n+ ProductionOrder: array[2] of Record \"Production Order\";\n+ ProductionBOMHeader: Record \"Production BOM Header\";\n+ WarehouseEmployee: Record \"Warehouse Employee\";\n+ WareHouseActivityHeader: Record \"Warehouse Activity Header\";\n+ begin\n+ // [SCENARIO 575862] No availability error when creating pick from pick worksheet with location setup Bin mandatory and the item reserved on the related production order\n+ Initialize();\n+\n+ // [GIVEN] Reset Warehouse Employee Default Location.\n+ ResetWarehouseEmployeeDefaultLocation();\n+\n+ // [GIVEN] Create Location with WMS enabled Bin mandatory\n+ LibraryWarehouse.CreateLocationWMS(Location, true, false, false, false, false);\n+\n+ // [GIVEN] Create Warehouse Employee for Location.\n+ LibraryWarehouse.CreateWarehouseEmployee(WarehouseEmployee, Location.Code, true);\n+\n+ // [GIVEN] Create Bins for Location.\n+ LibraryWarehouse.CreateBin(Bin, Location.Code, Bin.Code, '', '');\n+ LibraryWarehouse.CreateBin(Bin2, Location.Code, Bin2.Code, '', '');\n+ LibraryWarehouse.CreateBin(Bin3, Location.Code, Bin3.Code, '', '');\n+\n+ // [GIVEN] Set \"Prod. Consump. Whse. Handling\" = \"Warehouse Pick (mandatory)\" and assign Bins to \"To-Production Bin Code\" and \"From-Production Bin Code\".\n+ Location.Validate(\"Prod. Consump. Whse. Handling\", Location.\"Prod. Consump. Whse. Handling\"::\"Warehouse Pick (mandatory)\");\n+ Location.Validate(\"To-Production Bin Code\", Bin.Code);\n+ Location.Validate(\"From-Production Bin Code\", Bin2.Code);\n+ Location.Modify(true);\n+\n+ // [GIVEN] Create Component Item with \"Replenishment System\" = \"Purchase\" and \"Flushing Method\" = \"Manual\".\n+ LibraryInventory.CreateItem(CompItem);\n+ CompItem.Validate(\"Replenishment System\", CompItem.\"Replenishment System\"::Purchase);\n+ CompItem.Validate(\"Flushing Method\", CompItem.\"Flushing Method\"::Manual);\n+ CompItem.Modify();\n+\n+ // [GIVEN] Create Production BOM for Component Item.\n+ LibraryInventory.CreateItem(ProdItem);\n+ ProdItem.Validate(\"Replenishment System\", ProdItem.\"Replenishment System\"::\"Prod. Order\");\n+ ProdItem.Validate(\"Manufacturing Policy\", ProdItem.\"Manufacturing Policy\"::\"Make-to-Stock\");\n+ ProdItem.Validate(\"Flushing Method\", ProdItem.\"Flushing Method\"::Manual);\n+ ProdItem.Validate(\"Production BOM No.\", LibraryManufacturing.CreateCertifiedProductionBOM(ProductionBOMHeader, CompItem.\"No.\", 1));\n+ ProdItem.Modify();\n+\n+ // [GIVEN] Create Inventory for Component Item.\n+ CreateInventory(CompItem, 3, Location.Code, '', 0);\n+\n+ // [GIVEN] Create first Production Orders for Production Item of quantity 2\n+ LibraryManufacturing.CreateProductionOrder(\n+ ProductionOrder[1], ProductionOrder[1].Status::Released, ProductionOrder[1].\"Source Type\"::Item, ProdItem.\"No.\", 2);\n+ ProductionOrder[1].Validate(\"Location Code\", Location.Code);\n+ ProductionOrder[1].Modify(true);\n+ LibraryManufacturing.RefreshProdOrder(ProductionOrder[1], false, true, true, true, false);\n+\n+ // [GIVEN] Reserve Component Item on Production Order 1\n+ ReserveQuantityOnComponent(CompItem.\"No.\", ProductionOrder[1].\"No.\");\n+\n+ // [GIVEN] Create second Production Order for Production Item of quantity 1\n+ LibraryManufacturing.CreateProductionOrder(\n+ ProductionOrder[2], ProductionOrder[2].Status::Released, ProductionOrder[2].\"Source Type\"::Item, ProdItem.\"No.\", 1);\n+ ProductionOrder[2].Validate(\"Location Code\", Location.Code);\n+ ProductionOrder[2].Modify(true);\n+ LibraryManufacturing.RefreshProdOrder(ProductionOrder[2], false, true, true, true, false);\n+\n+ // [GIVEN] Reserve Component Item on Production Order 2\n+ ReserveQuantityOnComponent(CompItem.\"No.\", ProductionOrder[2].\"No.\");\n+\n+ // [WHEN] Create Pick Worksheet for Production Order Components.\n+ GetWarehouseDocumentFromPickWorksheet(ProductionOrder);\n+\n+ // [THEN] Verify Warehouse Activity Header for Production Order Components.\n+ WarehouseActivityHeader.SetRange(\"Location Code\", Location.Code);\n+ WareHouseActivityHeader.FindSet();\n+ Assert.IsTrue(WareHouseActivityHeader.Count = 2, InventoryPickNotFoundErr);\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n@@ -3796,6 +3879,50 @@ codeunit 137294 \"SCM Inventory Miscellaneous II\"\n VerifyInventoryPickLine(SalesOrderNo, LotNos[2], Lot2Qty);\n end;\n \n+ local procedure GetWarehouseDocumentFromPickWorksheet(ProductionOrder: array[2] of Record \"Production Order\")\n+ var\n+ PickWorksheet: TestPage \"Pick Worksheet\";\n+ begin\n+ LibraryVariableStorage.Enqueue(ProductionOrder[1].\"No.\"); // Enqueue for PickSelectionPageHandler.\n+ LibraryVariableStorage.Enqueue(ProductionOrder[1].\"Location Code\"); // Enqueue PickSelectionPageHandler.\n+ PickWorksheet.OpenEdit();\n+ PickWorksheet.\"Get Warehouse Documents\".Invoke();\n+\n+ LibraryVariableStorage.Enqueue(ProductionOrder[2].\"No.\"); // Enqueue for PickSelectionPageHandler.\n+ LibraryVariableStorage.Enqueue(ProductionOrder[2].\"Location Code\"); // Enqueue PickSelectionPageHandler.\n+ PickWorksheet.\"Get Warehouse Documents\".Invoke();\n+ Commit();\n+\n+ PickWorksheet.CreatePick.Invoke();\n+ PickWorksheet.OK().Invoke();\n+ end;\n+\n+ local procedure ReserveQuantityOnComponent(ItemNo: code[20]; ProdOrderno: Code[20])\n+ var\n+ ProdOrderComponents: TestPage \"Prod. Order Components\";\n+ begin\n+ ProdOrderComponents.OpenEdit();\n+ ProdOrderComponents.FILTER.SetFilter(\"Item No.\", ItemNo);\n+ ProdOrderComponents.FILTER.SetFilter(\"Prod. Order No.\", ProdOrderno);\n+ ProdOrderComponents.Reserve.Invoke();\n+ ProdOrderComponents.Close();\n+ end;\n+\n+ local procedure CreateInventory(Item: Record Item; Quantity: Decimal; LocationCode: Code[10]; BinCode: Code[20]; UnitAmount: Decimal)\n+ var\n+ ItemJournalBatch: Record \"Item Journal Batch\";\n+ ItemJournalLine: Record \"Item Journal Line\";\n+ begin\n+ LibraryInventory.CreateItemJournalBatchByType(ItemJournalBatch, ItemJournalBatch.\"Template Type\"::Item);\n+\n+ LibraryInventory.CreateItemJournalLine(ItemJournalLine, ItemJournalBatch, Item, LocationCode, '', WorkDate(),\n+ ItemJournalLine.\"Entry Type\"::\"Positive Adjmt.\", Quantity, UnitAmount);\n+ ItemJournalLine.Validate(\"Bin Code\", BinCode);\n+ ItemJournalLine.Modify();\n+\n+ LibraryInventory.PostItemJournalBatch(ItemJournalBatch);\n+ end;\n+\n [MessageHandler]\n [Scope('OnPrem')]\n procedure DummyMessageHandler(Message: Text[1024])\n@@ -3817,5 +3944,36 @@ codeunit 137294 \"SCM Inventory Miscellaneous II\"\n begin\n Reply := true;\n end;\n+\n+ [ModalPageHandler]\n+ [Scope('OnPrem')]\n+ procedure ReservationPageHandler(var Reservation: TestPage Reservation)\n+ begin\n+ Reservation.\"Reserve from Current Line\".Invoke();\n+ Reservation.OK().Invoke();\n+ end;\n+\n+ [RequestPageHandler]\n+ [Scope('OnPrem')]\n+ procedure CreatePickPageHandlerForPerWhsDoc(var CreatePick: TestRequestPage \"Create Pick\")\n+ begin\n+ CreatePick.PerWhseDoc.SetValue(true);\n+ CreatePick.OK().Invoke();\n+ end;\n+\n+ [ModalPageHandler]\n+ [Scope('OnPrem')]\n+ procedure PickSelectionPageHandlerSingleDoc(var PickSelection: TestPage \"Pick Selection\")\n+ var\n+ DocumentNo: Variant;\n+ LocationCode: Variant;\n+ begin\n+ LibraryVariableStorage.Dequeue(DocumentNo); // Dequeue Variable.\n+ LibraryVariableStorage.Dequeue(LocationCode); // Dequeue Variable.\n+ PickSelection.Filter.SetFilter(\"Document No.\", DocumentNo);\n+ PickSelection.\"Document No.\".AssertEquals(DocumentNo);\n+ PickSelection.\"Location Code\".AssertEquals(LocationCode);\n+ PickSelection.OK().Invoke();\n+ end;\n }\n \n", "patch": "diff --git a/App/Layers/W1/BaseApp/Warehouse/Availability/WarehouseAvailabilityMgt.Codeunit.al b/App/Layers/W1/BaseApp/Warehouse/Availability/WarehouseAvailabilityMgt.Codeunit.al\nindex 0b63877adb3b..32239d687e93 100644\n--- a/App/Layers/W1/BaseApp/Warehouse/Availability/WarehouseAvailabilityMgt.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Warehouse/Availability/WarehouseAvailabilityMgt.Codeunit.al\n@@ -870,7 +870,9 @@ codeunit 7314 \"Warehouse Availability Mgt.\"\n end else\n AvailQtyBase := CalcInvtAvailQtyIgnoreBin(Item, Location, WhseWorksheetLine.\"Variant Code\", TempWhseActivLine);\n \n- if Location.\"Require Pick\" then\n+ if Location.\"Require Pick\" or\n+ (Location.\"Prod. Consump. Whse. Handling\" = Location.\"Prod. Consump. Whse. Handling\"::\"Warehouse Pick (mandatory)\")\n+ then\n QtyReservedOnPickShip := CalcReservQtyOnPicksShips(WhseWorksheetLine.\"Location Code\", WhseWorksheetLine.\"Item No.\", WhseWorksheetLine.\"Variant Code\", TempWhseActivLine);\n \n QtyReservedForCurrLine :=\n"} +{"instance_id": "microsoftInternal__NAV-218253__cf-1", "base_instance_id": "microsoftInternal__NAV-218253", "variant_description": "Tracking lines should be preserved only when the new quantity remains greater than zero.", "intervention_type": "execution_semantics", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-218253__cf-1", "FAIL_TO_PASS": [{"codeunitID": 134389, "functionName": ["QuantityReducedInSalesInvoiceAfterGenShipmentLineReservesTrackingInformation"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/ERMCustomerStatistics.Codeunit.al b/App/Layers/W1/Tests/ERM/ERMCustomerStatistics.Codeunit.al\nindex a4fa97f4520d..bc57ae20d22e 100644\n--- a/App/Layers/W1/Tests/ERM/ERMCustomerStatistics.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ERMCustomerStatistics.Codeunit.al\n@@ -17,6 +17,7 @@ codeunit 134389 \"ERM Customer Statistics\"\n LibraryERM: Codeunit \"Library - ERM\";\n LibraryRandom: Codeunit \"Library - Random\";\n LibraryApplicationArea: Codeunit \"Library - Application Area\";\n+ LibraryVariableStorage: Codeunit \"Library - Variable Storage\";\n LibraryUtility: Codeunit \"Library - Utility\";\n IsInitialized: Boolean;\n OverDueBalanceErr: Label 'Customer OverDue Balance is not correct';\n@@ -29,6 +30,7 @@ codeunit 134389 \"ERM Customer Statistics\"\n EntryNoMustMatchErr: Label 'Entry No. must match.';\n PaymentsLCYAndAmountLCYMustMatchErr: Label 'Payemnts (LCY) and Amount (LCY) must match.';\n CustomerCardFactboxTotalErr: Label 'Customer card factbox total is not Correct';\n+ LotNoErr: Label 'Lot No. should have value.';\n \n [Test]\n [Scope('OnPrem')]\n@@ -1003,6 +1005,83 @@ codeunit 134389 \"ERM Customer Statistics\"\n Assert.AreEqual(SalesLine.\"Amount Including VAT\", Customer.GetTotalAmountLCY(), CustomerCardFactboxTotalErr);\n end;\n \n+ [Test]\n+ [HandlerFunctions('ItemTrackingLinesPageHandler,EnterQuantityToCreatePageHandler,GetShipmentLinesPageHandler')]\n+ procedure QuantityReducedInSalesInvoiceAfterGenShipmentLineReservesTrackingInformation()\n+ var\n+ Customer: Record Customer;\n+ Item: Record Item;\n+ ItemTrackingCode: Record \"Item Tracking Code\";\n+ SalesHeader: Record \"Sales Header\";\n+ SalesLine: Record \"Sales Line\";\n+ Quantity: Integer;\n+ begin\n+ // [SCENARIO 576049] When the quantity in a Sales Invoices was changed after using 'Get Shipment lines' and an item with item tracking lines and reserve always has the tracking information.\n+ Initialize();\n+\n+ // [GIVEN] Created New Customer.\n+ LibrarySales.CreateCustomer(Customer);\n+\n+ // [GIVEN] Create Item Tracking Code and Validate Trackings.\n+ LibraryInventory.CreateItemTrackingCode(ItemTrackingCode);\n+ ItemTrackingCode.Validate(\"Lot Specific Tracking\", false);\n+ ItemTrackingCode.Validate(\"SN Specific Tracking\", false);\n+ ItemTrackingCode.Validate(\"SN Sales Inbound Tracking\", true);\n+ ItemTrackingCode.Validate(\"SN Sales Outbound Tracking\", true);\n+ ItemTrackingCode.Validate(\"Lot Sales Inbound Tracking\", true);\n+ ItemTrackingCode.Validate(\"Lot Sales Outbound Tracking\", true);\n+ ItemTrackingCode.Modify(true);\n+\n+ // [GIVEN] Created New Item and Validate Item Tracking Code, Serial Nos, Reserve.\n+ LibraryInventory.CreateItem(Item);\n+ Item.Validate(\"Item Tracking Code\", ItemTrackingCode.Code);\n+ Item.Validate(\"Lot Nos.\", LibraryERM.CreateNoSeriesCode());\n+ Item.Validate(\"Serial Nos.\", LibraryERM.CreateNoSeriesCode());\n+ Item.Validate(Reserve, Item.Reserve::Always);\n+ Item.Modify(true);\n+\n+ // [GIVEN] Store quantity in Variable.\n+ Quantity := LibraryRandom.RandIntInRange(10, 10);\n+\n+ // [GIVEN] Created Item Inventory By Posting Item Journal.\n+ CreateItemInventory(Item, Quantity);\n+\n+ // [GIVEN] Create new Sales Header.\n+ CreateSalesHeader(SalesHeader, SalesHeader.\"Document Type\"::Order, Customer.\"No.\", WorkDate());\n+\n+ // [GIVEN] Create Sales line and Validate Unit Price.\n+ LibrarySales.CreateSalesLine(SalesLine, SalesHeader, SalesLine.Type::Item, Item.\"No.\", Quantity);\n+ SalesLine.Validate(\"Unit Price\", LibraryRandom.RandDec(1000, 0));\n+ SalesLine.Modify(true);\n+\n+ // [GIVEN] Enqueue Quantity and assign Tracking Lines\n+ LibraryVariableStorage.Enqueue(true);\n+ LibraryVariableStorage.Enqueue(Quantity);\n+ SalesLine.OpenItemTrackingLines();\n+\n+ // [GIVEN] Post Sales Order invoked with \"Shipped\" selected.\n+ LibrarySales.PostSalesDocument(SalesHeader, true, false);\n+\n+ // [GIVEN] Create New Sales Invoice And Get Shipment Line Through GetShipmentLines.\n+ LibrarySales.CreateSalesHeader(SalesHeader, SalesHeader.\"Document Type\"::Invoice, Customer.\"No.\");\n+ SalesLine.Validate(\"Document Type\", SalesHeader.\"Document Type\");\n+ SalesLine.Validate(\"Document No.\", SalesHeader.\"No.\");\n+ LibrarySales.GetShipmentLines(SalesLine);\n+\n+ // [GIVEN] Find the Sales Line.\n+ SalesLine.SetRange(\"Document No.\", SalesHeader.\"No.\");\n+ SalesLine.SetRange(Type, SalesLine.Type::Item);\n+ SalesLine.FindFirst();\n+\n+ // [WHEN] Validate Quantity with random integer less than previous quanitity.\n+ SalesLine.Validate(Quantity, 0);\n+ SalesLine.Modify(true);\n+\n+ // [THEN] Tracking Lines is not deleted.\n+ LibraryVariableStorage.Enqueue(false);\n+ SalesLine.OpenItemTrackingLines();\n+ end;\n+\n local procedure Initialize()\n var\n Currency: Record Currency;\n@@ -1506,4 +1585,26 @@ codeunit 134389 \"ERM Customer Statistics\"\n begin\n GetShipmentLines.OK().Invoke();\n end;\n+\n+ [ModalPageHandler]\n+ procedure ItemTrackingLinesPageHandler(var ItemTrackingLines: TestPage \"Item Tracking Lines\")\n+ var\n+ AssignSerial: Boolean;\n+ begin\n+ AssignSerial := LibraryVariableStorage.DequeueBoolean();\n+ if AssignSerial then\n+ ItemTrackingLines.\"Assign Serial No.\".Invoke();\n+\n+ if not AssignSerial then\n+ Assert.IsTrue(ItemTrackingLines.\"Lot No.\".Value() <> '', LotNoErr);\n+ ItemTrackingLines.OK().Invoke();\n+ end;\n+\n+ [ModalPageHandler]\n+ procedure EnterQuantityToCreatePageHandler(var EnterQuantitytoCreate: TestPage \"Enter Quantity to Create\")\n+ begin\n+ EnterQuantitytoCreate.QtyToCreate.SetValue(LibraryVariableStorage.DequeueInteger());\n+ EnterQuantitytoCreate.CreateNewLotNo.SetValue(true);\n+ EnterQuantitytoCreate.OK().Invoke();\n+ end;\n }\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Sales/Document/SalesLineReserve.Codeunit.al b/App/Layers/W1/BaseApp/Sales/Document/SalesLineReserve.Codeunit.al\nindex 15a14be1bfcb..b95b0aa54eb2 100644\n--- a/App/Layers/W1/BaseApp/Sales/Document/SalesLineReserve.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/SalesLineReserve.Codeunit.al\n@@ -1304,6 +1304,9 @@ codeunit 99000832 \"Sales Line-Reserve\"\n if (NewSalesLine.Type <> NewSalesLine.Type::Item) or (NewSalesLine.Quantity = 0) or (NewSalesLine.Reserve <> NewSalesLine.Reserve::Always) then\n exit(false);\n \n+ if ShipmentExists(NewSalesLine) then\n+ exit(false);\n+\n Item.SetLoadFields(\"Costing Method\");\n Item.Get(NewSalesLine.\"No.\");\n \n@@ -1313,6 +1316,15 @@ codeunit 99000832 \"Sales Line-Reserve\"\n exit((NewSalesLine.Quantity < OldSalesLine.Quantity) and (NewSalesLine.Quantity > 0));\n end;\n \n+ local procedure ShipmentExists(SalesLine: Record \"Sales Line\"): Boolean\n+ var\n+ SalesShipmentLine: Record \"Sales Shipment Line\";\n+ begin\n+ SalesShipmentLine.SetRange(\"Document No.\", SalesLine.\"Shipment No.\");\n+ SalesShipmentLine.SetRange(\"Line No.\", SalesLine.\"Shipment Line No.\");\n+ exit(not SalesShipmentLine.IsEmpty());\n+ end;\n+\n [IntegrationEvent(false, false)]\n local procedure OnAfterReservQuantity(SalesLine: Record \"Sales Line\"; var QtyToReserve: Decimal; var QtyToReserveBase: Decimal)\n begin\n"} +{"instance_id": "microsoftInternal__NAV-218253__cf-2", "base_instance_id": "microsoftInternal__NAV-218253", "variant_description": "Tracking lines should be preserved only if all tracking quantities remain valid after reduction.", "intervention_type": "workflow_business_logic", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-218253__cf-2", "FAIL_TO_PASS": [{"codeunitID": 134389, "functionName": ["QuantityReducedInSalesInvoiceAfterGenShipmentLineReservesTrackingInformation"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/ERMCustomerStatistics.Codeunit.al b/App/Layers/W1/Tests/ERM/ERMCustomerStatistics.Codeunit.al\nindex a4fa97f4520d..bc57ae20d22e 100644\n--- a/App/Layers/W1/Tests/ERM/ERMCustomerStatistics.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ERMCustomerStatistics.Codeunit.al\n@@ -17,6 +17,7 @@ codeunit 134389 \"ERM Customer Statistics\"\n LibraryERM: Codeunit \"Library - ERM\";\n LibraryRandom: Codeunit \"Library - Random\";\n LibraryApplicationArea: Codeunit \"Library - Application Area\";\n+ LibraryVariableStorage: Codeunit \"Library - Variable Storage\";\n LibraryUtility: Codeunit \"Library - Utility\";\n IsInitialized: Boolean;\n OverDueBalanceErr: Label 'Customer OverDue Balance is not correct';\n@@ -29,6 +30,7 @@ codeunit 134389 \"ERM Customer Statistics\"\n EntryNoMustMatchErr: Label 'Entry No. must match.';\n PaymentsLCYAndAmountLCYMustMatchErr: Label 'Payemnts (LCY) and Amount (LCY) must match.';\n CustomerCardFactboxTotalErr: Label 'Customer card factbox total is not Correct';\n+ LotNoErr: Label 'Lot No. should have value.';\n \n [Test]\n [Scope('OnPrem')]\n@@ -1003,6 +1005,83 @@ codeunit 134389 \"ERM Customer Statistics\"\n Assert.AreEqual(SalesLine.\"Amount Including VAT\", Customer.GetTotalAmountLCY(), CustomerCardFactboxTotalErr);\n end;\n \n+ [Test]\n+ [HandlerFunctions('ItemTrackingLinesPageHandler,EnterQuantityToCreatePageHandler,GetShipmentLinesPageHandler')]\n+ procedure QuantityReducedInSalesInvoiceAfterGenShipmentLineReservesTrackingInformation()\n+ var\n+ Customer: Record Customer;\n+ Item: Record Item;\n+ ItemTrackingCode: Record \"Item Tracking Code\";\n+ SalesHeader: Record \"Sales Header\";\n+ SalesLine: Record \"Sales Line\";\n+ Quantity: Integer;\n+ begin\n+ // [SCENARIO 576049] When the quantity in a Sales Invoices was changed after using 'Get Shipment lines' and an item with item tracking lines and reserve always has the tracking information.\n+ Initialize();\n+\n+ // [GIVEN] Created New Customer.\n+ LibrarySales.CreateCustomer(Customer);\n+\n+ // [GIVEN] Create Item Tracking Code and Validate Trackings.\n+ LibraryInventory.CreateItemTrackingCode(ItemTrackingCode);\n+ ItemTrackingCode.Validate(\"Lot Specific Tracking\", false);\n+ ItemTrackingCode.Validate(\"SN Specific Tracking\", false);\n+ ItemTrackingCode.Validate(\"SN Sales Inbound Tracking\", true);\n+ ItemTrackingCode.Validate(\"SN Sales Outbound Tracking\", true);\n+ ItemTrackingCode.Validate(\"Lot Sales Inbound Tracking\", true);\n+ ItemTrackingCode.Validate(\"Lot Sales Outbound Tracking\", true);\n+ ItemTrackingCode.Modify(true);\n+\n+ // [GIVEN] Created New Item and Validate Item Tracking Code, Serial Nos, Reserve.\n+ LibraryInventory.CreateItem(Item);\n+ Item.Validate(\"Item Tracking Code\", ItemTrackingCode.Code);\n+ Item.Validate(\"Lot Nos.\", LibraryERM.CreateNoSeriesCode());\n+ Item.Validate(\"Serial Nos.\", LibraryERM.CreateNoSeriesCode());\n+ Item.Validate(Reserve, Item.Reserve::Always);\n+ Item.Modify(true);\n+\n+ // [GIVEN] Store quantity in Variable.\n+ Quantity := LibraryRandom.RandIntInRange(10, 10);\n+\n+ // [GIVEN] Created Item Inventory By Posting Item Journal.\n+ CreateItemInventory(Item, Quantity);\n+\n+ // [GIVEN] Create new Sales Header.\n+ CreateSalesHeader(SalesHeader, SalesHeader.\"Document Type\"::Order, Customer.\"No.\", WorkDate());\n+\n+ // [GIVEN] Create Sales line and Validate Unit Price.\n+ LibrarySales.CreateSalesLine(SalesLine, SalesHeader, SalesLine.Type::Item, Item.\"No.\", Quantity);\n+ SalesLine.Validate(\"Unit Price\", LibraryRandom.RandDec(1000, 0));\n+ SalesLine.Modify(true);\n+\n+ // [GIVEN] Enqueue Quantity and assign Tracking Lines\n+ LibraryVariableStorage.Enqueue(true);\n+ LibraryVariableStorage.Enqueue(Quantity);\n+ SalesLine.OpenItemTrackingLines();\n+\n+ // [GIVEN] Post Sales Order invoked with \"Shipped\" selected.\n+ LibrarySales.PostSalesDocument(SalesHeader, true, false);\n+\n+ // [GIVEN] Create New Sales Invoice And Get Shipment Line Through GetShipmentLines.\n+ LibrarySales.CreateSalesHeader(SalesHeader, SalesHeader.\"Document Type\"::Invoice, Customer.\"No.\");\n+ SalesLine.Validate(\"Document Type\", SalesHeader.\"Document Type\");\n+ SalesLine.Validate(\"Document No.\", SalesHeader.\"No.\");\n+ LibrarySales.GetShipmentLines(SalesLine);\n+\n+ // [GIVEN] Find the Sales Line.\n+ SalesLine.SetRange(\"Document No.\", SalesHeader.\"No.\");\n+ SalesLine.SetRange(Type, SalesLine.Type::Item);\n+ SalesLine.FindFirst();\n+\n+ // [WHEN] Validate Quantity with random integer less than previous quanitity.\n+ SalesLine.Validate(Quantity, LibraryRandom.RandInt(5));\n+ SalesLine.Modify(true);\n+\n+ // [THEN] Tracking Lines is not deleted.\n+ LibraryVariableStorage.Enqueue(true);\n+ SalesLine.OpenItemTrackingLines();\n+ end;\n+\n local procedure Initialize()\n var\n Currency: Record Currency;\n@@ -1506,4 +1585,26 @@ codeunit 134389 \"ERM Customer Statistics\"\n begin\n GetShipmentLines.OK().Invoke();\n end;\n+\n+ [ModalPageHandler]\n+ procedure ItemTrackingLinesPageHandler(var ItemTrackingLines: TestPage \"Item Tracking Lines\")\n+ var\n+ AssignSerial: Boolean;\n+ begin\n+ AssignSerial := LibraryVariableStorage.DequeueBoolean();\n+ if AssignSerial then\n+ ItemTrackingLines.\"Assign Serial No.\".Invoke();\n+\n+ if not AssignSerial then\n+ Assert.IsTrue(ItemTrackingLines.\"Lot No.\".Value() <> '', LotNoErr);\n+ ItemTrackingLines.OK().Invoke();\n+ end;\n+\n+ [ModalPageHandler]\n+ procedure EnterQuantityToCreatePageHandler(var EnterQuantitytoCreate: TestPage \"Enter Quantity to Create\")\n+ begin\n+ EnterQuantitytoCreate.QtyToCreate.SetValue(LibraryVariableStorage.DequeueInteger());\n+ EnterQuantitytoCreate.CreateNewLotNo.SetValue(true);\n+ EnterQuantitytoCreate.OK().Invoke();\n+ end;\n }\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Sales/Document/SalesLineReserve.Codeunit.al b/App/Layers/W1/BaseApp/Sales/Document/SalesLineReserve.Codeunit.al\nindex 15a14be1bfcb..b95b0aa54eb2 100644\n--- a/App/Layers/W1/BaseApp/Sales/Document/SalesLineReserve.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/SalesLineReserve.Codeunit.al\n@@ -1304,6 +1304,9 @@ codeunit 99000832 \"Sales Line-Reserve\"\n if (NewSalesLine.Type <> NewSalesLine.Type::Item) or (NewSalesLine.Quantity = 0) or (NewSalesLine.Reserve <> NewSalesLine.Reserve::Always) then\n exit(false);\n \n+ if ShipmentExists(NewSalesLine) then\n+ exit(false);\n+\n Item.SetLoadFields(\"Costing Method\");\n Item.Get(NewSalesLine.\"No.\");\n \n@@ -1313,6 +1316,15 @@ codeunit 99000832 \"Sales Line-Reserve\"\n exit((NewSalesLine.Quantity < OldSalesLine.Quantity) and TrackingStillValid(NewSalesLine));\n end;\n \n+ local procedure ShipmentExists(SalesLine: Record \"Sales Line\"): Boolean\n+ var\n+ SalesShipmentLine: Record \"Sales Shipment Line\";\n+ begin\n+ SalesShipmentLine.SetRange(\"Document No.\", SalesLine.\"Shipment No.\");\n+ SalesShipmentLine.SetRange(\"Line No.\", SalesLine.\"Shipment Line No.\");\n+ exit(not SalesShipmentLine.IsEmpty());\n+ end;\n+\n [IntegrationEvent(false, false)]\n local procedure OnAfterReservQuantity(SalesLine: Record \"Sales Line\"; var QtyToReserve: Decimal; var QtyToReserveBase: Decimal)\n begin\n"} +{"instance_id": "microsoftInternal__NAV-218995__cf-1", "base_instance_id": "microsoftInternal__NAV-218995", "variant_description": "Validation bypass applies only when Job Line Type is Billable; otherwise validation must still execute.", "intervention_type": "execution_validation_semantics", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-218995__cf-1", "FAIL_TO_PASS": [{"codeunitID": 136306, "functionName": ["PostPurchaseCreditMemoWithNonInventoryItemLinkedToProject"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/Job/JobInvoicing.Codeunit.al b/App/Layers/W1/Tests/Job/JobInvoicing.Codeunit.al\nindex 3f5a305f277c..cf1_218995_1 100644\n--- a/App/Layers/W1/Tests/Job/JobInvoicing.Codeunit.al\n+++ b/App/Layers/W1/Tests/Job/JobInvoicing.Codeunit.al\n@@ -4082,6 +4082,47 @@ codeunit 136306 \"Job Invoicing\"\n Assert.IsFalse(JobPlanningLine.\"System-Created Entry\", ValueFalseErr);\n end;\n \n+ [Test]\n+ procedure PostPurchaseCreditMemoWithNonInventoryItemLinkedToProject()\n+ var\n+ Item: Record Item;\n+ Job: Record Job;\n+ JobTask: Record \"Job Task\";\n+ PurchaseHeader: Record \"Purchase Header\";\n+ PurchaseLine: Record \"Purchase Line\";\n+ Vendor: Record Vendor;\n+ begin\n+ // [SCENARIO 580434] Error when posting a Purchase Credit Memo for 'Non-Inventory' item with Project No. selected\n+ Initialize();\n+\n+ // [GIVEN] Create Non-Inventory Item\n+ LibraryInventory.CreateNonInventoryTypeItem(Item);\n+\n+ // [GIVEN] Create Job with Customer\n+ CreateJobWithCustomer(Job);\n+\n+ // [GIVEN] Create Job Task\n+ LibraryJob.CreateJobTask(Job, JobTask);\n+\n+ // [GIVEN] Create Vendor\n+ LibraryPurchase.CreateVendor(Vendor);\n+\n+ // [GIVEN] Create Purchase Credit Memo\n+ LibraryPurchase.CreatePurchHeader(PurchaseHeader, PurchaseHeader.\"Document Type\"::\"Credit Memo\", Vendor.\"No.\");\n+ LibraryPurchase.CreatePurchaseLine(PurchaseLine, PurchaseHeader, PurchaseLine.Type::Item, Item.\"No.\", 1);\n+\n+ // [GIVEN] Set Job No., Job Task No. and Job Line Type as Budget\n+ PurchaseLine.Validate(\"Job No.\", Job.\"No.\");\n+ PurchaseLine.Validate(\"Job Task No.\", JobTask.\"Job Task No.\");\n+ PurchaseLine.Validate(\"Job Line Type\", PurchaseLine.\"Job Line Type\"::Budget);\n+ PurchaseLine.Modify(true);\n+\n+ // [WHEN] Post Purchase Credit Memo\n+ LibraryPurchase.PostPurchaseDocument(PurchaseHeader, true, true);\n+\n+ // [THEN] No error should come only if Job Line Type is Billable; otherwise validation should still trigger.\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Projects/Project/Posting/JobPostLine.Codeunit.al b/App/Layers/W1/BaseApp/Projects/Project/Posting/JobPostLine.Codeunit.al\nindex a913f1c1ea1b..cf1_218995_1 100644\n--- a/App/Layers/W1/BaseApp/Projects/Project/Posting/JobPostLine.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Projects/Project/Posting/JobPostLine.Codeunit.al\n@@ -478,6 +478,10 @@ codeunit 1001 \"Job Post-Line\"\n if IsHandled then\n exit;\n \n+ if PurchaseLine.IsNonInventoriableItem() and\n+ (PurchaseLine.\"Job Line Type\" = PurchaseLine.\"Job Line Type\"::Billable) then\n+ exit;\n+\n Job.Get(PurchaseLine.\"Job No.\");\n if Job.GetQuantityAvailable(PurchaseLine.\"No.\", PurchaseLine.\"Location Code\", PurchaseLine.\"Variant Code\", 0, 2) <\n -PurchaseLine.\"Return Qty. to Ship (Base)\"\n"} +{"instance_id": "microsoftInternal__NAV-218995__cf-2", "base_instance_id": "microsoftInternal__NAV-218995", "variant_description": "Validation bypass applies only when Location Code is empty.", "intervention_type": "execution_validation_semantics", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-218995__cf-2", "FAIL_TO_PASS": [{"codeunitID": 136306, "functionName": ["PostPurchaseCreditMemoWithNonInventoryItemLinkedToProject"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/Job/JobInvoicing.Codeunit.al b/App/Layers/W1/Tests/Job/JobInvoicing.Codeunit.al\nindex 3f5a305f277c..cf2_218995_2 100644\n--- a/App/Layers/W1/Tests/Job/JobInvoicing.Codeunit.al\n+++ b/App/Layers/W1/Tests/Job/JobInvoicing.Codeunit.al\n@@ -4082,6 +4082,48 @@ codeunit 136306 \"Job Invoicing\"\n Assert.IsFalse(JobPlanningLine.\"System-Created Entry\", ValueFalseErr);\n end;\n \n+ [Test]\n+ procedure PostPurchaseCreditMemoWithNonInventoryItemLinkedToProject()\n+ var\n+ Item: Record Item;\n+ Job: Record Job;\n+ JobTask: Record \"Job Task\";\n+ PurchaseHeader: Record \"Purchase Header\";\n+ PurchaseLine: Record \"Purchase Line\";\n+ Vendor: Record Vendor;\n+ begin\n+ // [SCENARIO 580434] Error when posting a Purchase Credit Memo for 'Non-Inventory' item with Project No. selected\n+ Initialize();\n+\n+ // [GIVEN] Create Non-Inventory Item\n+ LibraryInventory.CreateNonInventoryTypeItem(Item);\n+\n+ // [GIVEN] Create Job with Customer\n+ CreateJobWithCustomer(Job);\n+\n+ // [GIVEN] Create Job Task\n+ LibraryJob.CreateJobTask(Job, JobTask);\n+\n+ // [GIVEN] Create Vendor\n+ LibraryPurchase.CreateVendor(Vendor);\n+\n+ // [GIVEN] Create Purchase Credit Memo\n+ LibraryPurchase.CreatePurchHeader(PurchaseHeader, PurchaseHeader.\"Document Type\"::\"Credit Memo\", Vendor.\"No.\");\n+ LibraryPurchase.CreatePurchaseLine(PurchaseLine, PurchaseHeader, PurchaseLine.Type::Item, Item.\"No.\", 1);\n+\n+ // [GIVEN] Set Job No., Job Task No. and Job Line Type as Billable\n+ PurchaseLine.Validate(\"Job No.\", Job.\"No.\");\n+ PurchaseLine.Validate(\"Job Task No.\", JobTask.\"Job Task No.\");\n+ PurchaseLine.Validate(\"Job Line Type\", PurchaseLine.\"Job Line Type\"::Billable);\n+ PurchaseLine.Validate(\"Location Code\", 'BLUE');\n+ PurchaseLine.Modify(true);\n+\n+ // [WHEN] Post Purchase Credit Memo\n+ LibraryPurchase.PostPurchaseDocument(PurchaseHeader, true, true);\n+\n+ // [THEN] No error should come only when Location Code is empty; otherwise validation should trigger.\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Projects/Project/Posting/JobPostLine.Codeunit.al b/App/Layers/W1/BaseApp/Projects/Project/Posting/JobPostLine.Codeunit.al\nindex a913f1c1ea1b..cf2_218995_2 100644\n--- a/App/Layers/W1/BaseApp/Projects/Project/Posting/JobPostLine.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Projects/Project/Posting/JobPostLine.Codeunit.al\n@@ -478,6 +478,10 @@ codeunit 1001 \"Job Post-Line\"\n if IsHandled then\n exit;\n \n+ if PurchaseLine.IsNonInventoriableItem() and\n+ (PurchaseLine.\"Location Code\" = '') then\n+ exit;\n+\n Job.Get(PurchaseLine.\"Job No.\");\n if Job.GetQuantityAvailable(PurchaseLine.\"No.\", PurchaseLine.\"Location Code\", PurchaseLine.\"Variant Code\", 0, 2) <\n -PurchaseLine.\"Return Qty. to Ship (Base)\"\n"} +{"instance_id": "microsoftInternal__NAV-218995__cf-3", "base_instance_id": "microsoftInternal__NAV-218995", "variant_description": "Validation bypass applies only for Credit Memo documents (not other purchase types).", "intervention_type": "workflow_business_logic", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-218995__cf-3", "FAIL_TO_PASS": [{"codeunitID": 136306, "functionName": ["PostPurchaseCreditMemoWithNonInventoryItemLinkedToProject"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/Job/JobInvoicing.Codeunit.al b/App/Layers/W1/Tests/Job/JobInvoicing.Codeunit.al\nindex 3f5a305f277c..cf3_218995_3 100644\n--- a/App/Layers/W1/Tests/Job/JobInvoicing.Codeunit.al\n+++ b/App/Layers/W1/Tests/Job/JobInvoicing.Codeunit.al\n@@ -4082,6 +4082,47 @@ codeunit 136306 \"Job Invoicing\"\n Assert.IsFalse(JobPlanningLine.\"System-Created Entry\", ValueFalseErr);\n end;\n \n+ [Test]\n+ procedure PostPurchaseCreditMemoWithNonInventoryItemLinkedToProject()\n+ var\n+ Item: Record Item;\n+ Job: Record Job;\n+ JobTask: Record \"Job Task\";\n+ PurchaseHeader: Record \"Purchase Header\";\n+ PurchaseLine: Record \"Purchase Line\";\n+ Vendor: Record Vendor;\n+ begin\n+ // [SCENARIO 580434] Error when posting a Purchase Credit Memo for 'Non-Inventory' item with Project No. selected\n+ Initialize();\n+\n+ // [GIVEN] Create Non-Inventory Item\n+ LibraryInventory.CreateNonInventoryTypeItem(Item);\n+\n+ // [GIVEN] Create Job with Customer\n+ CreateJobWithCustomer(Job);\n+\n+ // [GIVEN] Create Job Task\n+ LibraryJob.CreateJobTask(Job, JobTask);\n+\n+ // [GIVEN] Create Vendor\n+ LibraryPurchase.CreateVendor(Vendor);\n+\n+ // [GIVEN] Create Purchase Invoice\n+ LibraryPurchase.CreatePurchHeader(PurchaseHeader, PurchaseHeader.\"Document Type\"::Invoice, Vendor.\"No.\");\n+ LibraryPurchase.CreatePurchaseLine(PurchaseLine, PurchaseHeader, PurchaseLine.Type::Item, Item.\"No.\", 1);\n+\n+ // [GIVEN] Set Job No., Job Task No. and Job Line Type as Billable\n+ PurchaseLine.Validate(\"Job No.\", Job.\"No.\");\n+ PurchaseLine.Validate(\"Job Task No.\", JobTask.\"Job Task No.\");\n+ PurchaseLine.Validate(\"Job Line Type\", PurchaseLine.\"Job Line Type\"::Billable);\n+ PurchaseLine.Modify(true);\n+\n+ // [WHEN] Post Purchase Invoice\n+ LibraryPurchase.PostPurchaseDocument(PurchaseHeader, true, true);\n+\n+ // [THEN] No error should come only for Credit Memo documents; otherwise validation should trigger.\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Projects/Project/Posting/JobPostLine.Codeunit.al b/App/Layers/W1/BaseApp/Projects/Project/Posting/JobPostLine.Codeunit.al\nindex a913f1c1ea1b..cf3_218995_3 100644\n--- a/App/Layers/W1/BaseApp/Projects/Project/Posting/JobPostLine.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Projects/Project/Posting/JobPostLine.Codeunit.al\n@@ -478,6 +478,10 @@ codeunit 1001 \"Job Post-Line\"\n if IsHandled then\n exit;\n \n+ if PurchaseLine.IsNonInventoriableItem() and\n+ (PurchaseLine.\"Document Type\" = PurchaseLine.\"Document Type\"::\"Credit Memo\") then\n+ exit;\n+\n Job.Get(PurchaseLine.\"Job No.\");\n if Job.GetQuantityAvailable(PurchaseLine.\"No.\", PurchaseLine.\"Location Code\", PurchaseLine.\"Variant Code\", 0, 2) <\n -PurchaseLine.\"Return Qty. to Ship (Base)\"\n"} +{"instance_id": "microsoftInternal__NAV-218786__cf-1", "base_instance_id": "microsoftInternal__NAV-218786", "variant_description": "Update should affect the first matching subsequent Place Line only if multiple candidates exist; otherwise fallback to any other matching line.", "intervention_type": "workflow_business_logic", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-218786__cf-1", "FAIL_TO_PASS": [{"codeunitID": 137065, "functionName": ["WarehousePickUpdateQuantityInOrder"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMReservationII.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMReservationII.Codeunit.al\nindex 9251a2965f1f..fda235875212 100644\n--- a/App/Layers/W1/Tests/SCM/SCMReservationII.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMReservationII.Codeunit.al\n@@ -58,6 +58,7 @@ codeunit 137065 \"SCM Reservation II\"\n PostJnlLinesMsg: Label 'Do you want to post the journal lines';\n SuggestedBackGroundRunQst: Label 'Would you like to run the low-level code calculation as a background job?';\n ActionMessageEntryExistErr: Label 'Action Message Entry exist for item %1', Comment = '%1 = Item No.';\n+ QuantityErr: Label 'Quantity must be equal to %1', Comment = '%1 = Quantity';\n \n [Test]\n [HandlerFunctions('ProdOrderComponentsHandler')]\n@@ -2997,6 +2998,84 @@ codeunit 137065 \"SCM Reservation II\"\n VerifyThereIsNoDamagedReservationEntryForSurplus(Database::\"Sales Line\", SalesHeader[2].\"No.\", ReservationEntry.\"Reservation Status\"::Surplus);//, -SalesLine[2].\"Quantity (Base)\");\n end;\n \n+ [Test]\n+ [Scope('OnPrem')]\n+ procedure WarehousePickUpdateQuantityInOrder()\n+ var\n+ Bin: array[8] of Record Bin;\n+ CompItem, ProdItem : Record Item;\n+ Location: Record Location;\n+ ProductionOrder: Record \"Production Order\";\n+ ProductionBOMHeader: Record \"Production BOM Header\";\n+ WarehouseEmployee: Record \"Warehouse Employee\";\n+ Quantity: Decimal;\n+ UpdatedQuantity: Decimal;\n+ begin\n+ // [SCENARIO 581104] Manually change quantity of \"Take Line\" in Warehouse Pick changes the quantity of the correct \"Place Lines\"\n+ Initialize();\n+\n+ // [GIVEN] Set Quantity and UpdatedQuantity.\n+ Quantity := LibraryRandom.RandIntInRange(900, 1000);\n+ UpdatedQuantity := LibraryRandom.RandIntInRange(400, 500);\n+\n+ // [GIVEN] Reset Warehouse Employee Default Location.\n+ ResetWarehouseEmployeeDefaultLocation();\n+\n+ // [GIVEN] Create Location with WMS enabled Bin mandatory\n+ LibraryWarehouse.CreateLocationWMS(Location, true, false, true, false, false);\n+\n+ // [GIVEN] Create Warehouse Employee for Location.\n+ LibraryWarehouse.CreateWarehouseEmployee(WarehouseEmployee, Location.Code, true);\n+\n+ // [GIVEN] Create Bins for Location.\n+ CreateBin(Bin, Location.Code);\n+\n+ // [GIVEN] Set \"Prod. Consump. Whse. Handling\" = \"Warehouse Pick (mandatory)\" and assign Bins to \"To-Production Bin Code\" and \"From-Production Bin Code\".\n+ Location.Validate(\"Prod. Consump. Whse. Handling\", Location.\"Prod. Consump. Whse. Handling\"::\"Warehouse Pick (mandatory)\");\n+ Location.Validate(\"To-Production Bin Code\", Bin[1].Code);\n+ Location.Validate(\"From-Production Bin Code\", Bin[2].Code);\n+ Location.Validate(\"Open Shop Floor Bin Code\", Bin[3].Code);\n+ Location.Modify(true);\n+\n+ // [GIVEN] Create Component Item with \"Replenishment System\" = \"Purchase\" and \"Flushing Method\" = \"Manual\".\n+ LibraryInventory.CreateItem(CompItem);\n+ CompItem.Validate(\"Replenishment System\", CompItem.\"Replenishment System\"::Purchase);\n+ CompItem.Validate(\"Flushing Method\", CompItem.\"Flushing Method\"::\"Pick + Manual\");\n+ CompItem.Validate(\"Allow Whse. Overpick\", true);\n+ CompItem.Modify();\n+\n+ // [GIVEN] Create Production BOM for Component Item.\n+ LibraryInventory.CreateItem(ProdItem);\n+ ProdItem.Validate(\"Replenishment System\", ProdItem.\"Replenishment System\"::\"Prod. Order\");\n+ ProdItem.Validate(\"Manufacturing Policy\", ProdItem.\"Manufacturing Policy\"::\"Make-to-Stock\");\n+ ProdItem.Validate(\"Flushing Method\", ProdItem.\"Flushing Method\"::Manual);\n+ ProdItem.Validate(\"Production BOM No.\", LibraryManufacturing.CreateCertifiedProductionBOM(ProductionBOMHeader, CompItem.\"No.\", 1));\n+ ProdItem.Modify();\n+\n+ // [GIVEN] Create Inventory for Component Item for five different Bins.\n+ CreateInventoryWithBin(CompItem, Quantity, Location.Code, Bin[4].Code, 0);\n+ CreateInventoryWithBin(CompItem, Quantity, Location.Code, Bin[5].Code, 0);\n+ CreateInventoryWithBin(CompItem, Quantity, Location.Code, Bin[6].Code, 0);\n+ CreateInventoryWithBin(CompItem, Quantity, Location.Code, Bin[7].Code, 0);\n+ CreateInventoryWithBin(CompItem, Quantity, Location.Code, Bin[8].Code, 0);\n+\n+ // [GIVEN] Create Production Orders for Production Item of quantity Quantity * 5.\n+ LibraryManufacturing.CreateProductionOrder(\n+ ProductionOrder, ProductionOrder.Status::Released, ProductionOrder.\"Source Type\"::Item, ProdItem.\"No.\", Quantity * 5);\n+ ProductionOrder.Validate(\"Location Code\", Location.Code);\n+ ProductionOrder.Modify(true);\n+ LibraryManufacturing.RefreshProdOrder(ProductionOrder, false, true, true, true, false);\n+\n+ // [GIVEN] Create Warehouse Pick from Production Order.\n+ LibraryWarehouse.CreateWhsePickFromProduction(ProductionOrder);\n+\n+ // [WHEN] Update quantity in Warehouse Pick Lines.\n+ UpdateQuantityWarehousePickFromPage(ProductionOrder.\"No.\", Location.Code, UpdatedQuantity);\n+\n+ // [THEN] Verify that the Warehouse Activity Lines are updated correctly.\n+ VerifyWareHouseActivityLinesForQuantity(ProductionOrder.\"No.\", Location, Quantity, UpdatedQuantity);\n+ end;\n+\n local procedure Initialize()\n var\n AllProfile: Record \"All Profile\";\n@@ -4693,6 +4772,72 @@ codeunit 137065 \"SCM Reservation II\"\n asserterror ReservationEntry.FindFirst();\n end;\n \n+ local procedure ResetWarehouseEmployeeDefaultLocation()\n+ var\n+ WarehouseEmployee: Record \"Warehouse Employee\";\n+ begin\n+ WarehouseEmployee.SetRange(\"User ID\", UserId());\n+ WarehouseEmployee.SetRange(Default, true);\n+ WarehouseEmployee.ModifyAll(Default, false);\n+ end;\n+\n+ local procedure VerifyWareHouseActivityLinesForQuantity(ProductionOrderNo: Code[20]; Location: Record Location; Quantity: Decimal; UpdatedQuantity: Decimal)\n+ var\n+ WarehouseActivityLine: Record \"Warehouse Activity Line\";\n+ begin\n+ FindWarehouseActivityLine(WarehouseActivityLine, ProductionOrderNo, WarehouseActivityLine.\"Source Document\"::\"Prod. Consumption\", WarehouseActivityLine.\"Action Type\"::Place);\n+ WarehouseActivityLine.SetRange(\"Bin Code\", Location.\"To-Production Bin Code\");\n+ WarehouseActivityLine.FindFirst();\n+ Assert.IsTrue(WarehouseActivityLine.\"Qty. (Base)\" = Quantity, StrSubstNo(QuantityErr, Quantity));\n+\n+ WarehouseActivityLine.Reset();\n+ FindWarehouseActivityLine(WarehouseActivityLine, ProductionOrderNo, WarehouseActivityLine.\"Source Document\"::\"Prod. Consumption\", WarehouseActivityLine.\"Action Type\"::Place);\n+ WarehouseActivityLine.SetRange(\"Bin Code\", Location.\"To-Production Bin Code\");\n+ WarehouseActivityLine.FindLast();\n+ Assert.IsTrue(WarehouseActivityLine.\"Qty. (Base)\" = UpdatedQuantity, StrSubstNo(QuantityErr, UpdatedQuantity));\n+ end;\n+\n+ local procedure UpdateQuantityWarehousePickFromPage(ProductionOrderNo: Code[20]; LocationCode: Code[10]; Quantity: Decimal)\n+ var\n+ WarehouseActivityHeader: Record \"Warehouse Activity Header\";\n+ WarehouseActivityLine: Record \"Warehouse Activity Line\";\n+ WarehousePickPage: TestPage \"Warehouse Pick\";\n+ begin\n+ WarehouseActivityLine.SetRange(\"Source Document\", WarehouseActivityHeader.\"Source Document\"::\"Prod. Consumption\");\n+ WarehouseActivityLine.SetRange(\"Source No.\", ProductionOrderNo);\n+ WarehouseActivityLine.SetRange(\"Location Code\", LocationCode);\n+ WarehouseActivityLine.FindFirst();\n+ WarehouseActivityHeader.Get(WarehouseActivityHeader.Type::Pick, WarehouseActivityLine.\"No.\");\n+ WarehousePickPage.OpenEdit();\n+ WarehousePickPage.GoToRecord(WarehouseActivityHeader);\n+ WarehousePickPage.WhseActivityLines.Last();\n+ WarehousePickPage.WhseActivityLines.Previous();\n+ WarehousePickPage.WhseActivityLines.Quantity.SetValue(Quantity);\n+ end;\n+\n+ local procedure CreateInventoryWithBin(Item: Record Item; Quantity: Decimal; LocationCode: Code[10]; BinCode: Code[20]; UnitAmount: Decimal)\n+ var\n+ ItemJournalBatch: Record \"Item Journal Batch\";\n+ ItemJournalLine: Record \"Item Journal Line\";\n+ begin\n+ LibraryInventory.CreateItemJournalBatchByType(ItemJournalBatch, ItemJournalBatch.\"Template Type\"::Item);\n+\n+ LibraryInventory.CreateItemJournalLine(ItemJournalLine, ItemJournalBatch, Item, LocationCode, '', WorkDate(),\n+ ItemJournalLine.\"Entry Type\"::\"Positive Adjmt.\", Quantity, UnitAmount);\n+ ItemJournalLine.Validate(\"Bin Code\", BinCode);\n+ ItemJournalLine.Modify();\n+\n+ LibraryInventory.PostItemJournalBatch(ItemJournalBatch);\n+ end;\n+\n+ local procedure CreateBin(var Bin: array[8] of Record Bin; LocationCode: Code[10])\n+ var\n+ i: Integer;\n+ begin\n+ for i := 1 to arraylen(Bin) do\n+ LibraryWarehouse.CreateBin(Bin[i], LocationCode, Bin[i].Code, '', '');\n+ end;\n+\n [PageHandler]\n [Scope('OnPrem')]\n procedure ProdOrderComponentsHandler(var ProdOrderComponents: TestPage \"Prod. Order Components\")", "patch": "diff --git a/App/Layers/W1/BaseApp/Warehouse/Activity/WarehouseActivityLine.Table.al b/App/Layers/W1/BaseApp/Warehouse/Activity/WarehouseActivityLine.Table.al\nindex 0b806569d9b4..cf1_218786_1 100644\n--- a/App/Layers/W1/BaseApp/Warehouse/Activity/WarehouseActivityLine.Table.al\n+++ b/App/Layers/W1/BaseApp/Warehouse/Activity/WarehouseActivityLine.Table.al\n@@ -3102,6 +3102,7 @@ table 5767 \"Warehouse Activity Line\"\n var\n Item: Record Item;\n WhseActivityLine: Record \"Warehouse Activity Line\";\n+ QuantityUpdated: Boolean;\n begin\n if CurrFieldNo = 0 then\n exit;\n@@ -3125,10 +3126,21 @@ table 5767 \"Warehouse Activity Line\"\n Item.Get(FromWhseActivityLine.\"Item No.\");\n Item.TestField(\"Allow Whse. Overpick\");\n \n+ SetFilterFromWhseActivityLineToUpdateQty(WhseActivityLine, FromWhseActivityLine, xWhseActivityLine, QuantityUpdated);\n+ if QuantityUpdated then\n+ WhseActivityLine.Modify(true);\n+ end;\n+\n+ local procedure SetFilterFromWhseActivityLineToUpdateQty(\n+ var WhseActivityLine: Record \"Warehouse Activity Line\";\n+ FromWhseActivityLine: Record \"Warehouse Activity Line\";\n+ xWhseActivityLine: Record \"Warehouse Activity Line\";\n+ var QuantityUpdated: Boolean)\n+ begin\n WhseActivityLine.SetLoadFields(\"Activity Type\", \"No.\", \"Line No.\", \"Item No.\", \"Variant Code\", \"Location Code\", \"Action Type\", Quantity, \"Lot No.\", \"Serial No.\", \"Source No.\", \"Source Line No.\", \"Source Document\");\n WhseActivityLine.SetRange(\"Activity Type\", FromWhseActivityLine.\"Activity Type\");\n WhseActivityLine.SetRange(\"No.\", FromWhseActivityLine.\"No.\");\n- WhseActivityLine.SetFilter(\"Line No.\", '<>%1', FromWhseActivityLine.\"Line No.\");\n+ WhseActivityLine.SetFilter(\"Line No.\", '>%1', FromWhseActivityLine.\"Line No.\");\n WhseActivityLine.SetRange(\"Item No.\", FromWhseActivityLine.\"Item No.\");\n WhseActivityLine.SetRange(\"Variant Code\", FromWhseActivityLine.\"Variant Code\");\n WhseActivityLine.SetRange(\"Location Code\", FromWhseActivityLine.\"Location Code\");\n@@ -3139,11 +3151,17 @@ table 5767 \"Warehouse Activity Line\"\n WhseActivityLine.SetRange(\"Source Document\", FromWhseActivityLine.\"Source Document\");\n WhseActivityLine.SetRange(\"Source No.\", FromWhseActivityLine.\"Source No.\");\n WhseActivityLine.SetRange(\"Source Line No.\", FromWhseActivityLine.\"Source Line No.\");\n+ if WhseActivityLine.Count > 1 then\n+ WhseActivityLine.FindFirst()\n+ else\n+ WhseActivityLine.FindLast();\n \n- WhseActivityLine.FindFirst();\n-\n- WhseActivityLine.Validate(Quantity, FromWhseActivityLine.Quantity);\n- WhseActivityLine.Modify(true);\n+ WhseActivityLine.Validate(Quantity, FromWhseActivityLine.Quantity);\n+ QuantityUpdated := true;\n end;\n \n [IntegrationEvent(false, false)]\n"} +{"instance_id": "microsoftInternal__NAV-218786__cf-2", "base_instance_id": "microsoftInternal__NAV-218786", "variant_description": "Quantity propagation applies only when Action Type = Place AND Source Document = Prod. Consumption.", "intervention_type": "execution_validation_semantics", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-218786__cf-2", "FAIL_TO_PASS": [{"codeunitID": 137065, "functionName": ["WarehousePickUpdateQuantityInOrder"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMReservationII.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMReservationII.Codeunit.al\nindex 9251a2965f1f..fda235875212 100644\n--- a/App/Layers/W1/Tests/SCM/SCMReservationII.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMReservationII.Codeunit.al\n@@ -58,6 +58,7 @@ codeunit 137065 \"SCM Reservation II\"\n PostJnlLinesMsg: Label 'Do you want to post the journal lines';\n SuggestedBackGroundRunQst: Label 'Would you like to run the low-level code calculation as a background job?';\n ActionMessageEntryExistErr: Label 'Action Message Entry exist for item %1', Comment = '%1 = Item No.';\n+ QuantityErr: Label 'Quantity must be equal to %1', Comment = '%1 = Quantity';\n \n [Test]\n [HandlerFunctions('ProdOrderComponentsHandler')]\n@@ -2997,6 +2998,84 @@ codeunit 137065 \"SCM Reservation II\"\n VerifyThereIsNoDamagedReservationEntryForSurplus(Database::\"Sales Line\", SalesHeader[2].\"No.\", ReservationEntry.\"Reservation Status\"::Surplus);//, -SalesLine[2].\"Quantity (Base)\");\n end;\n \n+ [Test]\n+ [Scope('OnPrem')]\n+ procedure WarehousePickUpdateQuantityInOrder()\n+ var\n+ Bin: array[8] of Record Bin;\n+ CompItem, ProdItem : Record Item;\n+ Location: Record Location;\n+ ProductionOrder: Record \"Production Order\";\n+ ProductionBOMHeader: Record \"Production BOM Header\";\n+ WarehouseEmployee: Record \"Warehouse Employee\";\n+ Quantity: Decimal;\n+ UpdatedQuantity: Decimal;\n+ begin\n+ // [SCENARIO 581104] Manually change quantity of \"Take Line\" in Warehouse Pick changes the quantity of the correct \"Place Lines\"\n+ Initialize();\n+\n+ // [GIVEN] Set Quantity and UpdatedQuantity.\n+ Quantity := LibraryRandom.RandIntInRange(900, 1000);\n+ UpdatedQuantity := LibraryRandom.RandIntInRange(400, 500);\n+\n+ // [GIVEN] Reset Warehouse Employee Default Location.\n+ ResetWarehouseEmployeeDefaultLocation();\n+\n+ // [GIVEN] Create Location with WMS enabled Bin mandatory\n+ LibraryWarehouse.CreateLocationWMS(Location, true, false, true, false, false);\n+\n+ // [GIVEN] Create Warehouse Employee for Location.\n+ LibraryWarehouse.CreateWarehouseEmployee(WarehouseEmployee, Location.Code, true);\n+\n+ // [GIVEN] Create Bins for Location.\n+ CreateBin(Bin, Location.Code);\n+\n+ // [GIVEN] Set \"Prod. Consump. Whse. Handling\" = \"Warehouse Pick (mandatory)\" and assign Bins to \"To-Production Bin Code\" and \"From-Production Bin Code\".\n+ Location.Validate(\"Prod. Consump. Whse. Handling\", Location.\"Prod. Consump. Whse. Handling\"::\"Warehouse Pick (mandatory)\");\n+ Location.Validate(\"To-Production Bin Code\", Bin[1].Code);\n+ Location.Validate(\"From-Production Bin Code\", Bin[2].Code);\n+ Location.Validate(\"Open Shop Floor Bin Code\", Bin[1].Code);\n+ Location.Modify(true);\n+\n+ // [GIVEN] Create Component Item with \"Replenishment System\" = \"Purchase\" and \"Flushing Method\" = \"Manual\".\n+ LibraryInventory.CreateItem(CompItem);\n+ CompItem.Validate(\"Replenishment System\", CompItem.\"Replenishment System\"::Purchase);\n+ CompItem.Validate(\"Flushing Method\", CompItem.\"Flushing Method\"::\"Pick + Manual\");\n+ CompItem.Validate(\"Allow Whse. Overpick\", true);\n+ CompItem.Modify();\n+\n+ // [GIVEN] Create Production BOM for Component Item.\n+ LibraryInventory.CreateItem(ProdItem);\n+ ProdItem.Validate(\"Replenishment System\", ProdItem.\"Replenishment System\"::\"Prod. Order\");\n+ ProdItem.Validate(\"Manufacturing Policy\", ProdItem.\"Manufacturing Policy\"::\"Make-to-Stock\");\n+ ProdItem.Validate(\"Flushing Method\", ProdItem.\"Flushing Method\"::Manual);\n+ ProdItem.Validate(\"Production BOM No.\", LibraryManufacturing.CreateCertifiedProductionBOM(ProductionBOMHeader, CompItem.\"No.\", 1));\n+ ProdItem.Modify();\n+\n+ // [GIVEN] Create Inventory for Component Item for five different Bins.\n+ CreateInventoryWithBin(CompItem, Quantity, Location.Code, Bin[4].Code, 0);\n+ CreateInventoryWithBin(CompItem, Quantity, Location.Code, Bin[5].Code, 0);\n+ CreateInventoryWithBin(CompItem, Quantity, Location.Code, Bin[6].Code, 0);\n+ CreateInventoryWithBin(CompItem, Quantity, Location.Code, Bin[7].Code, 0);\n+ CreateInventoryWithBin(CompItem, Quantity, Location.Code, Bin[8].Code, 0);\n+\n+ // [GIVEN] Create Production Orders for Production Item of quantity Quantity * 5.\n+ LibraryManufacturing.CreateProductionOrder(\n+ ProductionOrder, ProductionOrder.Status::Released, ProductionOrder.\"Source Type\"::Item, ProdItem.\"No.\", Quantity * 5);\n+ ProductionOrder.Validate(\"Location Code\", Location.Code);\n+ ProductionOrder.Modify(true);\n+ LibraryManufacturing.RefreshProdOrder(ProductionOrder, false, true, true, true, false);\n+\n+ // [GIVEN] Create Warehouse Pick from Production Order.\n+ LibraryWarehouse.CreateWhsePickFromProduction(ProductionOrder);\n+\n+ // [WHEN] Update quantity in Warehouse Pick Lines.\n+ UpdateQuantityWarehousePickFromPage(ProductionOrder.\"No.\", Location.Code, UpdatedQuantity);\n+\n+ // [THEN] Verify that the Warehouse Activity Lines are updated correctly.\n+ VerifyWareHouseActivityLinesForQuantity(ProductionOrder.\"No.\", Location, Quantity, UpdatedQuantity);\n+ end;\n+\n local procedure Initialize()\n var\n AllProfile: Record \"All Profile\";\n@@ -4693,6 +4772,72 @@ codeunit 137065 \"SCM Reservation II\"\n asserterror ReservationEntry.FindFirst();\n end;\n \n+ local procedure ResetWarehouseEmployeeDefaultLocation()\n+ var\n+ WarehouseEmployee: Record \"Warehouse Employee\";\n+ begin\n+ WarehouseEmployee.SetRange(\"User ID\", UserId());\n+ WarehouseEmployee.SetRange(Default, true);\n+ WarehouseEmployee.ModifyAll(Default, false);\n+ end;\n+\n+ local procedure VerifyWareHouseActivityLinesForQuantity(ProductionOrderNo: Code[20]; Location: Record Location; Quantity: Decimal; UpdatedQuantity: Decimal)\n+ var\n+ WarehouseActivityLine: Record \"Warehouse Activity Line\";\n+ begin\n+ FindWarehouseActivityLine(WarehouseActivityLine, ProductionOrderNo, WarehouseActivityLine.\"Source Document\"::\"Prod. Consumption\", WarehouseActivityLine.\"Action Type\"::Place);\n+ WarehouseActivityLine.SetRange(\"Bin Code\", Location.\"To-Production Bin Code\");\n+ WarehouseActivityLine.FindFirst();\n+ Assert.IsTrue(WarehouseActivityLine.\"Qty. (Base)\" = Quantity, StrSubstNo(QuantityErr, Quantity));\n+\n+ WarehouseActivityLine.Reset();\n+ FindWarehouseActivityLine(WarehouseActivityLine, ProductionOrderNo, WarehouseActivityLine.\"Source Document\"::\"Prod. Consumption\", WarehouseActivityLine.\"Action Type\"::Place);\n+ WarehouseActivityLine.SetRange(\"Bin Code\", Location.\"To-Production Bin Code\");\n+ WarehouseActivityLine.FindLast();\n+ Assert.IsTrue(WarehouseActivityLine.\"Qty. (Base)\" = UpdatedQuantity, StrSubstNo(QuantityErr, UpdatedQuantity));\n+ end;\n+\n+ local procedure UpdateQuantityWarehousePickFromPage(ProductionOrderNo: Code[20]; LocationCode: Code[10]; Quantity: Decimal)\n+ var\n+ WarehouseActivityHeader: Record \"Warehouse Activity Header\";\n+ WarehouseActivityLine: Record \"Warehouse Activity Line\";\n+ WarehousePickPage: TestPage \"Warehouse Pick\";\n+ begin\n+ WarehouseActivityLine.SetRange(\"Source Document\", WarehouseActivityHeader.\"Source Document\"::\"Prod. Consumption\");\n+ WarehouseActivityLine.SetRange(\"Source No.\", ProductionOrderNo);\n+ WarehouseActivityLine.SetRange(\"Location Code\", LocationCode);\n+ WarehouseActivityLine.FindFirst();\n+ WarehouseActivityHeader.Get(WarehouseActivityHeader.Type::Pick, WarehouseActivityLine.\"No.\");\n+ WarehousePickPage.OpenEdit();\n+ WarehousePickPage.GoToRecord(WarehouseActivityHeader);\n+ WarehousePickPage.WhseActivityLines.Last();\n+ WarehousePickPage.WhseActivityLines.Previous();\n+ WarehousePickPage.WhseActivityLines.Quantity.SetValue(Quantity);\n+ end;\n+\n+ local procedure CreateInventoryWithBin(Item: Record Item; Quantity: Decimal; LocationCode: Code[10]; BinCode: Code[20]; UnitAmount: Decimal)\n+ var\n+ ItemJournalBatch: Record \"Item Journal Batch\";\n+ ItemJournalLine: Record \"Item Journal Line\";\n+ begin\n+ LibraryInventory.CreateItemJournalBatchByType(ItemJournalBatch, ItemJournalBatch.\"Template Type\"::Item);\n+\n+ LibraryInventory.CreateItemJournalLine(ItemJournalLine, ItemJournalBatch, Item, LocationCode, '', WorkDate(),\n+ ItemJournalLine.\"Entry Type\"::\"Positive Adjmt.\", Quantity, UnitAmount);\n+ ItemJournalLine.Validate(\"Bin Code\", BinCode);\n+ ItemJournalLine.Modify();\n+\n+ LibraryInventory.PostItemJournalBatch(ItemJournalBatch);\n+ end;\n+\n+ local procedure CreateBin(var Bin: array[8] of Record Bin; LocationCode: Code[10])\n+ var\n+ i: Integer;\n+ begin\n+ for i := 1 to arraylen(Bin) do\n+ LibraryWarehouse.CreateBin(Bin[i], LocationCode, Bin[i].Code, '', '');\n+ end;\n+\n [PageHandler]\n [Scope('OnPrem')]\n procedure ProdOrderComponentsHandler(var ProdOrderComponents: TestPage \"Prod. Order Components\")", "patch": "diff --git a/App/Layers/W1/BaseApp/Warehouse/Activity/WarehouseActivityLine.Table.al b/App/Layers/W1/BaseApp/Warehouse/Activity/WarehouseActivityLine.Table.al\nindex 0b806569d9b4..cf2_218786_2 100644\n--- a/App/Layers/W1/BaseApp/Warehouse/Activity/WarehouseActivityLine.Table.al\n+++ b/App/Layers/W1/BaseApp/Warehouse/Activity/WarehouseActivityLine.Table.al\n@@ -3102,6 +3102,7 @@ table 5767 \"Warehouse Activity Line\"\n var\n Item: Record Item;\n WhseActivityLine: Record \"Warehouse Activity Line\";\n+ QuantityUpdated: Boolean;\n begin\n if CurrFieldNo = 0 then\n exit;\n@@ -3125,10 +3126,21 @@ table 5767 \"Warehouse Activity Line\"\n Item.Get(FromWhseActivityLine.\"Item No.\");\n Item.TestField(\"Allow Whse. Overpick\");\n \n+ SetFilterFromWhseActivityLineToUpdateQty(WhseActivityLine, FromWhseActivityLine, xWhseActivityLine, QuantityUpdated);\n+ if QuantityUpdated then\n+ WhseActivityLine.Modify(true);\n+ end;\n+\n+ local procedure SetFilterFromWhseActivityLineToUpdateQty(\n+ var WhseActivityLine: Record \"Warehouse Activity Line\";\n+ FromWhseActivityLine: Record \"Warehouse Activity Line\";\n+ xWhseActivityLine: Record \"Warehouse Activity Line\";\n+ var QuantityUpdated: Boolean)\n+ begin\n WhseActivityLine.SetLoadFields(\"Activity Type\", \"No.\", \"Line No.\", \"Item No.\", \"Variant Code\", \"Location Code\", \"Action Type\", Quantity, \"Lot No.\", \"Serial No.\", \"Source No.\", \"Source Line No.\", \"Source Document\");\n WhseActivityLine.SetRange(\"Activity Type\", FromWhseActivityLine.\"Activity Type\");\n WhseActivityLine.SetRange(\"No.\", FromWhseActivityLine.\"No.\");\n- WhseActivityLine.SetFilter(\"Line No.\", '<>%1', FromWhseActivityLine.\"Line No.\");\n+ WhseActivityLine.SetFilter(\"Line No.\", '>%1', FromWhseActivityLine.\"Line No.\");\n WhseActivityLine.SetRange(\"Item No.\", FromWhseActivityLine.\"Item No.\");\n WhseActivityLine.SetRange(\"Variant Code\", FromWhseActivityLine.\"Variant Code\");\n WhseActivityLine.SetRange(\"Location Code\", FromWhseActivityLine.\"Location Code\");\n@@ -3139,11 +3151,20 @@ table 5767 \"Warehouse Activity Line\"\n WhseActivityLine.SetRange(\"Source Document\", FromWhseActivityLine.\"Source Document\");\n WhseActivityLine.SetRange(\"Source No.\", FromWhseActivityLine.\"Source No.\");\n WhseActivityLine.SetRange(\"Source Line No.\", FromWhseActivityLine.\"Source Line No.\");\n+ if (WhseActivityLine.\"Action Type\" = WhseActivityLine.\"Action Type\"::Place) and\n+ (WhseActivityLine.\"Source Document\" = WhseActivityLine.\"Source Document\"::\"Prod. Consumption\") and\n+ WhseActivityLine.FindFirst() then begin\n+ WhseActivityLine.Validate(Quantity, FromWhseActivityLine.Quantity);\n+ QuantityUpdated := true;\n+ exit;\n+ end;\n \n- WhseActivityLine.FindFirst();\n-\n- WhseActivityLine.Validate(Quantity, FromWhseActivityLine.Quantity);\n- WhseActivityLine.Modify(true);\n+ WhseActivityLine.SetRange(\"Line No.\");\n+ WhseActivityLine.SetFilter(\"Line No.\", '<>%1', FromWhseActivityLine.\"Line No.\");\n+ if WhseActivityLine.FindFirst() then begin\n+ WhseActivityLine.Validate(Quantity, FromWhseActivityLine.Quantity);\n+ QuantityUpdated := true;\n+ end\n end;\n \n [IntegrationEvent(false, false)]\n"} +{"instance_id": "microsoftInternal__NAV-217974__cf-1", "base_instance_id": "microsoftInternal__NAV-217974", "variant_description": "The Ship-to Address should be set to the company address only when the source Sales Order has a custom Ship-to Address.", "intervention_type": "execution_validation_semantics", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-217974__cf-1", "FAIL_TO_PASS": [{"codeunitID": 137156, "functionName": ["MoveNegativeLines_SetsReturnOrderShipToAddressToCompany"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMOrdersIV.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMOrdersIV.Codeunit.al\nindex 670a87576340..2c5a96d5e372 100644\n--- a/App/Layers/W1/Tests/SCM/SCMOrdersIV.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMOrdersIV.Codeunit.al\n@@ -72,6 +72,7 @@ codeunit 137156 \"SCM Orders IV\"\n DocumentLineSourceNoErr: label 'Expected source on document line is %1 but found %2.', Comment = '%1 = Expected Source No., %2 = Actual Source No.';\n ReservationFromStockErr: Label 'Reservation from Stock must be %1 in %2.', Comment = '%1= Field Value, %2 =Table Caption.';\n PurchasingCodeOnSalesInvoiceErr: Label 'The Purchasing Code should be blank for item %1 on the sales invoice because it is used only for the drop shipment process.', Comment = '%1= Item No.';\n+ ShipToAddressErr: Label 'Ship-to Address on Return Order should be company address';\n \n #if not CLEAN25\n [Test]\n@@ -3553,6 +3554,43 @@ codeunit 137156 \"SCM Orders IV\"\n Assert.ExpectedError(StrSubstNo(PurchasingCodeOnSalesInvoiceErr, Item.\"No.\"));\n end;\n \n+ [Test]\n+ procedure MoveNegativeLines_SetsReturnOrderShipToAddressToCompany()\n+ var\n+ Customer: Record Customer;\n+ Item: Record Item;\n+ SalesHeader: Record \"Sales Header\";\n+ SalesLine: Record \"Sales Line\";\n+ CompanyInfo: Record \"Company Information\";\n+ begin\n+ // [SCENARIO 580640] Verify Ship to Address of Return Order when Move Negative Lines on the Sales Order.\n+ Initialize();\n+\n+ // [GIVEN] Create Customer.\n+ LibrarySales.CreateCustomer(Customer);\n+\n+ // [GIVEN] Create Sales Header with Document Type as Order.\n+ LibrarySales.CreateSalesHeader(SalesHeader, SalesHeader.\"Document Type\"::Order, Customer.\"No.\");\n+\n+ // [GIVEN] Create SalesLine with Negative Quantity.\n+ LibrarySales.CreateSalesLine(SalesLine, SalesHeader, SalesLine.Type::Item, LibraryInventory.CreateItem(Item), LibraryRandom.RandIntInRange(-5, -10));\n+\n+ // [WHEN] Move Negative Lines\n+ MoveNegativeLinesOnSalesOrder(SalesHeader);\n+\n+ // [GIVEN] Get company address\n+ CompanyInfo.Get();\n+\n+ // [THEN] Sales Return Order is created with Ship to Address as Company Address (only when source has custom Ship-to Address).\n+ SalesHeader.SetRange(\"Document Type\", SalesHeader.\"Document Type\"::\"Return Order\");\n+ SalesHeader.SetRange(\"Sell-to Customer No.\", Customer.\"No.\");\n+ SalesHeader.FindFirst();\n+ Assert.AreEqual(\n+ CompanyInfo.\"Ship-to Address\", SalesHeader.\"Ship-to Address\", ShipToAddressErr);\n+ Assert.AreEqual(\n+ CompanyInfo.\"Ship-to City\", SalesHeader.\"Ship-to City\", ShipToAddressErr);\n+ end;\n+\n local procedure Initialize()\n var\n PriceListLine: Record \"Price List Line\";\n@@ -5405,8 +5443,8 @@ codeunit 137156 \"SCM Orders IV\"\n begin\n WarehouseActivityLine.SetRange(\"Action Type\", ActionType);\n FindWarehouseActivityLine(\n- WarehouseActivityLine, WarehouseActivityLine.\"Source Document\"::\"Purchase Order\", SourceNo,\n- WarehouseActivityLine.\"Activity Type\"::\"Put-away\");\n+WarehouseActivityLine, WarehouseActivityLine.\"Source Document\"::\"Purchase Order\", SourceNo,\n+WarehouseActivityLine.\"Activity Type\"::\"Put-away\");\n WarehouseActivityLine.ModifyAll(\"Zone Code\", ZoneCode, true);\n WarehouseActivityLine.ModifyAll(\"Bin Code\", BinCode, true);\n end;", "patch": "diff --git a/App/Layers/W1/BaseApp/Utilities/CopyDocumentMgt.Codeunit.al b/App/Layers/W1/BaseApp/Utilities/CopyDocumentMgt.Codeunit.al\nindex 780de254f475..cf1_217974_1 100644\n--- a/App/Layers/W1/BaseApp/Utilities/CopyDocumentMgt.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Utilities/CopyDocumentMgt.Codeunit.al\n@@ -747,6 +747,8 @@ codeunit 6620 \"Copy Document Mgt.\"\n begin\n FromSalesHeader.CalcFields(\"Work Description\");\n ToSalesHeader.TransferFields(FromSalesHeader, false);\n+ if FromSalesHeader.\"Ship-to Address\" <> '' then\n+ UpdateShipToAddress(ToSalesHeader);\n UpdateSalesHeaderWhenCopyFromSalesHeader(ToSalesHeader, OldSalesHeader, FromDocType);\n SetReceivedFromCountryCode(FromDocType, ToSalesHeader);\n OnAfterCopySalesHeader(ToSalesHeader, OldSalesHeader, FromSalesHeader, FromDocType);\n"} +{"instance_id": "microsoftInternal__NAV-217974__cf-2", "base_instance_id": "microsoftInternal__NAV-217974", "variant_description": "Only set Ship-to Address to company address when creating a Return Order (not for other document types).", "intervention_type": "workflow_business_logic", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-217974__cf-2", "FAIL_TO_PASS": [{"codeunitID": 137156, "functionName": ["MoveNegativeLines_SetsReturnOrderShipToAddressToCompany"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMOrdersIV.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMOrdersIV.Codeunit.al\nindex 670a87576340..2c5a96d5e372 100644\n--- a/App/Layers/W1/Tests/SCM/SCMOrdersIV.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMOrdersIV.Codeunit.al\n@@ -72,6 +72,7 @@ codeunit 137156 \"SCM Orders IV\"\n DocumentLineSourceNoErr: label 'Expected source on document line is %1 but found %2.', Comment = '%1 = Expected Source No., %2 = Actual Source No.';\n ReservationFromStockErr: Label 'Reservation from Stock must be %1 in %2.', Comment = '%1= Field Value, %2 =Table Caption.';\n PurchasingCodeOnSalesInvoiceErr: Label 'The Purchasing Code should be blank for item %1 on the sales invoice because it is used only for the drop shipment process.', Comment = '%1= Item No.';\n+ ShipToAddressErr: Label 'Ship-to Address on Return Order should be company address';\n \n #if not CLEAN25\n [Test]\n@@ -3553,6 +3554,43 @@ codeunit 137156 \"SCM Orders IV\"\n Assert.ExpectedError(StrSubstNo(PurchasingCodeOnSalesInvoiceErr, Item.\"No.\"));\n end;\n \n+ [Test]\n+ procedure MoveNegativeLines_SetsReturnOrderShipToAddressToCompany()\n+ var\n+ Customer: Record Customer;\n+ Item: Record Item;\n+ SalesHeader: Record \"Sales Header\";\n+ SalesLine: Record \"Sales Line\";\n+ CompanyInfo: Record \"Company Information\";\n+ begin\n+ // [SCENARIO 580640] Verify Ship to Address of Return Order when Move Negative Lines on the Sales Order.\n+ Initialize();\n+\n+ // [GIVEN] Create Customer.\n+ LibrarySales.CreateCustomer(Customer);\n+\n+ // [GIVEN] Create Sales Header with Document Type as Order.\n+ LibrarySales.CreateSalesHeader(SalesHeader, SalesHeader.\"Document Type\"::Order, Customer.\"No.\");\n+\n+ // [GIVEN] Create SalesLine with Negative Quantity.\n+ LibrarySales.CreateSalesLine(SalesLine, SalesHeader, SalesLine.Type::Item, LibraryInventory.CreateItem(Item), LibraryRandom.RandIntInRange(-5, -10));\n+\n+ // [WHEN] Move Negative Lines\n+ MoveNegativeLinesOnSalesOrder(SalesHeader);\n+\n+ // [GIVEN] Get company address\n+ CompanyInfo.Get();\n+\n+ // [THEN] Sales Return Order is created with Ship to Address as Company Address (only for Return Order).\n+ SalesHeader.SetRange(\"Document Type\", SalesHeader.\"Document Type\"::\"Return Order\");\n+ SalesHeader.SetRange(\"Sell-to Customer No.\", Customer.\"No.\");\n+ SalesHeader.FindFirst();\n+ Assert.AreEqual(\n+ CompanyInfo.\"Ship-to Address\", SalesHeader.\"Ship-to Address\", ShipToAddressErr);\n+ Assert.AreEqual(\n+ CompanyInfo.\"Ship-to City\", SalesHeader.\"Ship-to City\", ShipToAddressErr);\n+ end;\n+\n local procedure Initialize()\n var\n PriceListLine: Record \"Price List Line\";\n@@ -5405,8 +5443,8 @@ codeunit 137156 \"SCM Orders IV\"\n begin\n WarehouseActivityLine.SetRange(\"Action Type\", ActionType);\n FindWarehouseActivityLine(\n- WarehouseActivityLine, WarehouseActivityLine.\"Source Document\"::\"Purchase Order\", SourceNo,\n- WarehouseActivityLine.\"Activity Type\"::\"Put-away\");\n+WarehouseActivityLine, WarehouseActivityLine.\"Source Document\"::\"Purchase Order\", SourceNo,\n+WarehouseActivityLine.\"Activity Type\"::\"Put-away\");\n WarehouseActivityLine.ModifyAll(\"Zone Code\", ZoneCode, true);\n WarehouseActivityLine.ModifyAll(\"Bin Code\", BinCode, true);\n end;", "patch": "diff --git a/App/Layers/W1/BaseApp/Utilities/CopyDocumentMgt.Codeunit.al b/App/Layers/W1/BaseApp/Utilities/CopyDocumentMgt.Codeunit.al\nindex 780de254f475..cf2_217974_2 100644\n--- a/App/Layers/W1/BaseApp/Utilities/CopyDocumentMgt.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Utilities/CopyDocumentMgt.Codeunit.al\n@@ -747,6 +747,8 @@ codeunit 6620 \"Copy Document Mgt.\"\n begin\n FromSalesHeader.CalcFields(\"Work Description\");\n ToSalesHeader.TransferFields(FromSalesHeader, false);\n+ if ToSalesHeader.\"Document Type\" = ToSalesHeader.\"Document Type\"::\"Return Order\" then\n+ UpdateShipToAddress(ToSalesHeader);\n UpdateSalesHeaderWhenCopyFromSalesHeader(ToSalesHeader, OldSalesHeader, FromDocType);\n SetReceivedFromCountryCode(FromDocType, ToSalesHeader);\n OnAfterCopySalesHeader(ToSalesHeader, OldSalesHeader, FromSalesHeader, FromDocType);\n"} +{"instance_id": "microsoftInternal__NAV-217974__cf-3", "base_instance_id": "microsoftInternal__NAV-217974", "variant_description": "The Ship-to Address must be set via an event subscriber after document creation instead of direct assignment.", "intervention_type": "event_driven_paradigm", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-217974__cf-3", "FAIL_TO_PASS": [{"codeunitID": 137156, "functionName": ["MoveNegativeLines_SetsReturnOrderShipToAddressToCompany"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMOrdersIV.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMOrdersIV.Codeunit.al\nindex 670a87576340..2c5a96d5e372 100644\n--- a/App/Layers/W1/Tests/SCM/SCMOrdersIV.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMOrdersIV.Codeunit.al\n@@ -72,6 +72,7 @@ codeunit 137156 \"SCM Orders IV\"\n DocumentLineSourceNoErr: label 'Expected source on document line is %1 but found %2.', Comment = '%1 = Expected Source No., %2 = Actual Source No.';\n ReservationFromStockErr: Label 'Reservation from Stock must be %1 in %2.', Comment = '%1= Field Value, %2 =Table Caption.';\n PurchasingCodeOnSalesInvoiceErr: Label 'The Purchasing Code should be blank for item %1 on the sales invoice because it is used only for the drop shipment process.', Comment = '%1= Item No.';\n+ ShipToAddressErr: Label 'Ship-to Address on Return Order should be company address';\n \n #if not CLEAN25\n [Test]\n@@ -3553,6 +3554,43 @@ codeunit 137156 \"SCM Orders IV\"\n Assert.ExpectedError(StrSubstNo(PurchasingCodeOnSalesInvoiceErr, Item.\"No.\"));\n end;\n \n+ [Test]\n+ procedure MoveNegativeLines_SetsReturnOrderShipToAddressToCompany()\n+ var\n+ Customer: Record Customer;\n+ Item: Record Item;\n+ SalesHeader: Record \"Sales Header\";\n+ SalesLine: Record \"Sales Line\";\n+ CompanyInfo: Record \"Company Information\";\n+ begin\n+ // [SCENARIO 580640] Verify Ship to Address of Return Order when Move Negative Lines on the Sales Order.\n+ Initialize();\n+\n+ // [GIVEN] Create Customer.\n+ LibrarySales.CreateCustomer(Customer);\n+\n+ // [GIVEN] Create Sales Header with Document Type as Order.\n+ LibrarySales.CreateSalesHeader(SalesHeader, SalesHeader.\"Document Type\"::Order, Customer.\"No.\");\n+\n+ // [GIVEN] Create SalesLine with Negative Quantity.\n+ LibrarySales.CreateSalesLine(SalesLine, SalesHeader, SalesLine.Type::Item, LibraryInventory.CreateItem(Item), LibraryRandom.RandIntInRange(-5, -10));\n+\n+ // [WHEN] Move Negative Lines\n+ MoveNegativeLinesOnSalesOrder(SalesHeader);\n+\n+ // [GIVEN] Get company address\n+ CompanyInfo.Get();\n+\n+ // [THEN] Sales Return Order is created and Ship to Address is set via event handling.\n+ SalesHeader.SetRange(\"Document Type\", SalesHeader.\"Document Type\"::\"Return Order\");\n+ SalesHeader.SetRange(\"Sell-to Customer No.\", Customer.\"No.\");\n+ SalesHeader.FindFirst();\n+ Assert.AreEqual(\n+ CompanyInfo.\"Ship-to Address\", SalesHeader.\"Ship-to Address\", ShipToAddressErr);\n+ Assert.AreEqual(\n+ CompanyInfo.\"Ship-to City\", SalesHeader.\"Ship-to City\", ShipToAddressErr);\n+ end;\n+\n local procedure Initialize()\n var\n PriceListLine: Record \"Price List Line\";\n@@ -5405,8 +5443,8 @@ codeunit 137156 \"SCM Orders IV\"\n begin\n WarehouseActivityLine.SetRange(\"Action Type\", ActionType);\n FindWarehouseActivityLine(\n- WarehouseActivityLine, WarehouseActivityLine.\"Source Document\"::\"Purchase Order\", SourceNo,\n- WarehouseActivityLine.\"Activity Type\"::\"Put-away\");\n+WarehouseActivityLine, WarehouseActivityLine.\"Source Document\"::\"Purchase Order\", SourceNo,\n+WarehouseActivityLine.\"Activity Type\"::\"Put-away\");\n WarehouseActivityLine.ModifyAll(\"Zone Code\", ZoneCode, true);\n WarehouseActivityLine.ModifyAll(\"Bin Code\", BinCode, true);\n end;", "patch": "diff --git a/App/Layers/W1/BaseApp/Utilities/CopyDocumentMgt.Codeunit.al b/App/Layers/W1/BaseApp/Utilities/CopyDocumentMgt.Codeunit.al\nindex 780de254f475..cf3_217974_3 100644\n--- a/App/Layers/W1/BaseApp/Utilities/CopyDocumentMgt.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Utilities/CopyDocumentMgt.Codeunit.al\n@@ -747,6 +747,8 @@ codeunit 6620 \"Copy Document Mgt.\"\n begin\n FromSalesHeader.CalcFields(\"Work Description\");\n ToSalesHeader.TransferFields(FromSalesHeader, false);\n+ // Ship-to address must be handled via event subscriber\n+ OnBeforeUpdateShipToAddress(ToSalesHeader);\n UpdateSalesHeaderWhenCopyFromSalesHeader(ToSalesHeader, OldSalesHeader, FromDocType);\n SetReceivedFromCountryCode(FromDocType, ToSalesHeader);\n OnAfterCopySalesHeader(ToSalesHeader, OldSalesHeader, FromSalesHeader, FromDocType);\n"} +{"instance_id": "microsoftInternal__NAV-222488__cf-1", "base_instance_id": "microsoftInternal__NAV-222488", "variant_description": "Registration should ignore Breakbulk filter only when Breakbulk Filter = true AND user confirms full registration.", "intervention_type": "execution_validation_semantics", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-222488__cf-1", "FAIL_TO_PASS": [{"codeunitID": 137152, "functionName": ["RegisterPutAwayWithBreakBulkFilterShouldRegisterAllLines"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMWarehouseReceiving.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMWarehouseReceiving.Codeunit.al\nindex d40ac8d858c1..e83bdf59b1cc 100644\n--- a/App/Layers/W1/Tests/SCM/SCMWarehouseReceiving.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMWarehouseReceiving.Codeunit.al\n@@ -4302,6 +4302,63 @@ codeunit 137152 \"SCM Warehouse - Receiving\"\n VerifyWarehouseActivityLineWithBin(Item.\"No.\", Bin[3].Code, Bin[1].Code);\n end;\n \n+ [Test]\n+ [HandlerFunctions('ConfirmHandlerTrue')]\n+ procedure RegisterPutAwayWithBreakBulkFilterShouldRegisterAllLines()\n+ var\n+ Item: Record Item;\n+ ItemUnitOfMeasure: Record \"Item Unit of Measure\";\n+ PurchaseHeader: Record \"Purchase Header\";\n+ UOM: Record \"Unit of Measure\";\n+ WarehouseActivityLine: Record \"Warehouse Activity Line\";\n+ WarehouseEmployee: Record \"Warehouse Employee\";\n+ WarehouseEntry: Record \"Warehouse Entry\";\n+ PutAwayPage: TestPage \"Warehouse Put-away\";\n+ ExpectedLinesCount: Integer;\n+ begin\n+ // [SCENARIO 592107] Verify all put away lines are registered, when register a warehouse put away with the break bulk filter set to yes\n+ Initialize();\n+\n+ // [GIVEN] Create Warehouse Employee for location WHITE.\n+ LibraryWarehouse.CreateWarehouseEmployee(WarehouseEmployee, LocationWhite.Code, true);\n+\n+ // [GIVEN] Create an Item and assign Put-away Unit of Measure Code.\n+ LibraryInventory.CreateItem(Item);\n+ Item.Validate(\"Put-away Unit of Measure Code\", Item.\"Base Unit of Measure\");\n+ Item.Modify(true);\n+\n+ // [GIVEN] Create Unit of Measure and Item Unit of Measure with Qty. per Unit of Measure as 48.\n+ LibraryInventory.CreateUnitOfMeasureCode(UOM);\n+ LibraryInventory.CreateItemUnitOfMeasure(ItemUnitOfMeasure, Item.\"No.\", UOM.Code, 48);\n+\n+ // [GIVEN] Create Purchase Order and Post Warehouse Receipt.\n+ CreatePurchaseOrderAndPostWarehouseReceipt(\n+ PurchaseHeader, LocationWhite.Code, Item.\"No.\", LibraryRandom.RandDec(10, 2), UOM.Code);\n+\n+ // [GIVEN] Find Warehouse Put-away\n+ WarehouseActivityLine.SetRange(\"Activity Type\", WarehouseActivityLine.\"Activity Type\"::\"Put-away\");\n+ WarehouseActivityLine.SetRange(\"Source Document\", WarehouseActivityLine.\"Source Document\"::\"Purchase Order\");\n+ WarehouseActivityLine.SetRange(\"Source No.\", PurchaseHeader.\"No.\");\n+ WarehouseActivityLine.FindSet();\n+ ExpectedLinesCount := WarehouseActivityLine.Count();\n+\n+ // [GIVEN] Open Warehouse Put-away page\n+ PutAwayPage.OpenEdit();\n+ PutAwayPage.FILTER.SetFilter(\"No.\", WarehouseActivityLine.\"No.\");\n+\n+ // [GIVEN] Set Break Bulk filter = Yes\n+ PutAwayPage.\"Breakbulk Filter\".SetValue(true);\n+\n+ // [WHEN] Register Warehouse Put-Away.\n+ PutAwayPage.\"&Register Put-away\".Invoke();\n+\n+ // [THEN] Verify Put-Away should be registered and all lines should be posted in Warehouse Entry table\n+ WarehouseEntry.SetRange(\"Entry Type\", WarehouseEntry.\"Entry Type\"::Movement);\n+ WarehouseEntry.SetRange(\"Source Document\", WarehouseEntry.\"Source Document\"::\"P. Order\");\n+ WarehouseEntry.SetRange(\"Source No.\", PurchaseHeader.\"No.\");\n+ Assert.RecordCount(WarehouseEntry, ExpectedLinesCount);\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";", "patch": "diff --git a/App/Layers/W1/BaseApp/Warehouse/Activity/WhsePutawaySubform.Page.al b/App/Layers/W1/BaseApp/Warehouse/Activity/WhsePutawaySubform.Page.al\nindex 07db37f9fc83..cf1_222488_1 100644\n--- a/App/Layers/W1/BaseApp/Warehouse/Activity/WhsePutawaySubform.Page.al\n+++ b/App/Layers/W1/BaseApp/Warehouse/Activity/WhsePutawaySubform.Page.al\n@@ -482,9 +482,17 @@ page 5771 \"Whse. Put-away Subform\"\n \n procedure RegisterPutAwayYesNo()\n var\n+ WhseActivityHeader: Record \"Warehouse Activity Header\";\n WhseActivLine: Record \"Warehouse Activity Line\";\n begin\n- WhseActivLine.Copy(Rec);\n+ WhseActivityHeader.Get(Rec.\"Activity Type\", Rec.\"No.\");\n+ if (Rec.\"Activity Type\"::\"Put-away\" = Rec.\"Activity Type\"::\"Put-away\") and\n+ WhseActivityHeader.\"Breakbulk Filter\" and ConfirmFullRegistration() then begin\n+ WhseActivLine.SetRange(\"Activity Type\", WhseActivLine.\"Activity Type\"::\"Put-away\");\n+ WhseActivLine.SetRange(\"No.\", Rec.\"No.\");\n+ WhseActivLine.FindSet();\n+ end\n+ else\n+ WhseActivLine.Copy(Rec);\n WhseActivLine.FilterGroup(3);\n WhseActivLine.SetRange(Breakbulk);\n WhseActivLine.FilterGroup(0);\n"} +{"instance_id": "microsoftInternal__NAV-222488__cf-2", "base_instance_id": "microsoftInternal__NAV-222488", "variant_description": "Registration should include all lines only for Purchase Order source documents; other sources respect filter.", "intervention_type": "workflow_business_logic", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-222488__cf-2", "FAIL_TO_PASS": [{"codeunitID": 137152, "functionName": ["RegisterPutAwayWithBreakBulkFilterShouldRegisterAllLines"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMWarehouseReceiving.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMWarehouseReceiving.Codeunit.al\nindex d40ac8d858c1..e83bdf59b1cc 100644\n--- a/App/Layers/W1/Tests/SCM/SCMWarehouseReceiving.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMWarehouseReceiving.Codeunit.al\n@@ -4302,6 +4302,63 @@ codeunit 137152 \"SCM Warehouse - Receiving\"\n VerifyWarehouseActivityLineWithBin(Item.\"No.\", Bin[3].Code, Bin[1].Code);\n end;\n \n+ [Test]\n+ [HandlerFunctions('ConfirmHandlerTrue')]\n+ procedure RegisterPutAwayWithBreakBulkFilterShouldRegisterAllLines()\n+ var\n+ Item: Record Item;\n+ ItemUnitOfMeasure: Record \"Item Unit of Measure\";\n+ PurchaseHeader: Record \"Purchase Header\";\n+ UOM: Record \"Unit of Measure\";\n+ WarehouseActivityLine: Record \"Warehouse Activity Line\";\n+ WarehouseEmployee: Record \"Warehouse Employee\";\n+ WarehouseEntry: Record \"Warehouse Entry\";\n+ PutAwayPage: TestPage \"Warehouse Put-away\";\n+ ExpectedLinesCount: Integer;\n+ begin\n+ // [SCENARIO 592107] Verify all put away lines are registered, when register a warehouse put away with the break bulk filter set to yes\n+ Initialize();\n+\n+ // [GIVEN] Create Warehouse Employee for location WHITE.\n+ LibraryWarehouse.CreateWarehouseEmployee(WarehouseEmployee, LocationWhite.Code, true);\n+\n+ // [GIVEN] Create an Item and assign Put-away Unit of Measure Code.\n+ LibraryInventory.CreateItem(Item);\n+ Item.Validate(\"Put-away Unit of Measure Code\", Item.\"Base Unit of Measure\");\n+ Item.Modify(true);\n+\n+ // [GIVEN] Create Unit of Measure and Item Unit of Measure with Qty. per Unit of Measure as 48.\n+ LibraryInventory.CreateUnitOfMeasureCode(UOM);\n+ LibraryInventory.CreateItemUnitOfMeasure(ItemUnitOfMeasure, Item.\"No.\", UOM.Code, 48);\n+\n+ // [GIVEN] Create Purchase Order and Post Warehouse Receipt.\n+ CreatePurchaseOrderAndPostWarehouseReceipt(\n+ PurchaseHeader, LocationWhite.Code, Item.\"No.\", LibraryRandom.RandDec(10, 2), UOM.Code);\n+\n+ // [GIVEN] Find Warehouse Put-away\n+ WarehouseActivityLine.SetRange(\"Activity Type\", WarehouseActivityLine.\"Activity Type\"::\"Put-away\");\n+ WarehouseActivityLine.SetRange(\"Source Document\", WarehouseActivityLine.\"Source Document\"::\"Purchase Order\");\n+ WarehouseActivityLine.SetRange(\"Source No.\", PurchaseHeader.\"No.\");\n+ WarehouseActivityLine.FindSet();\n+ ExpectedLinesCount := WarehouseActivityLine.Count();\n+\n+ // [GIVEN] Open Warehouse Put-away page\n+ PutAwayPage.OpenEdit();\n+ PutAwayPage.FILTER.SetFilter(\"No.\", WarehouseActivityLine.\"No.\");\n+\n+ // [GIVEN] Set Break Bulk filter = Yes\n+ PutAwayPage.\"Breakbulk Filter\".SetValue(true);\n+\n+ // [WHEN] Register Warehouse Put-Away.\n+ PutAwayPage.\"&Register Put-away\".Invoke();\n+\n+ // [THEN] Verify Put-Away should be registered and all lines should be posted in Warehouse Entry table\n+ WarehouseEntry.SetRange(\"Entry Type\", WarehouseEntry.\"Entry Type\"::Movement);\n+ WarehouseEntry.SetRange(\"Source Document\", WarehouseEntry.\"Source Document\"::\"Transfer Order\");\n+ WarehouseEntry.SetRange(\"Source No.\", PurchaseHeader.\"No.\");\n+ Assert.RecordCount(WarehouseEntry, ExpectedLinesCount);\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";", "patch": "diff --git a/App/Layers/W1/BaseApp/Warehouse/Activity/WhsePutawaySubform.Page.al b/App/Layers/W1/BaseApp/Warehouse/Activity/WhsePutawaySubform.Page.al\nindex 07db37f9fc83..cf2_222488_2 100644\n--- a/App/Layers/W1/BaseApp/Warehouse/Activity/WhsePutawaySubform.Page.al\n+++ b/App/Layers/W1/BaseApp/Warehouse/Activity/WhsePutawaySubform.Page.al\n@@ -482,9 +482,18 @@ page 5771 \"Whse. Put-away Subform\"\n \n procedure RegisterPutAwayYesNo()\n var\n+ WhseActivityHeader: Record \"Warehouse Activity Header\";\n WhseActivLine: Record \"Warehouse Activity Line\";\n begin\n- WhseActivLine.Copy(Rec);\n+ WhseActivityHeader.Get(Rec.\"Activity Type\", Rec.\"No.\");\n+ if (Rec.\"Activity Type\"::\"Put-away\" = Rec.\"Activity Type\"::\"Put-away\") and\n+ WhseActivityHeader.\"Breakbulk Filter\" and\n+ (WhseActivityHeader.\"Source Document\" = WhseActivityHeader.\"Source Document\"::\"Purchase Order\") then begin\n+ WhseActivLine.SetRange(\"Activity Type\", WhseActivLine.\"Activity Type\"::\"Put-away\");\n+ WhseActivLine.SetRange(\"No.\", Rec.\"No.\");\n+ WhseActivLine.FindSet();\n+ end\n+ else\n+ WhseActivLine.Copy(Rec);\n WhseActivLine.FilterGroup(3);\n WhseActivLine.SetRange(Breakbulk);\n WhseActivLine.FilterGroup(0);\n"} +{"instance_id": "microsoftInternal__NAV-222484__cf-1", "base_instance_id": "microsoftInternal__NAV-222484", "variant_description": "Non-specific reservation cleanup applies only when the location is configured to pick according to FEFO.", "intervention_type": "execution_validation_semantics", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-222484__cf-1", "FAIL_TO_PASS": [{"codeunitID": 137260, "functionName": ["RegisterPickWithNoErrorForFEFOLocation"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMInventoryItemTracking.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMInventoryItemTracking.Codeunit.al\nindex df8ad3bb4d4b..de51c3ce8532 100644\n--- a/App/Layers/W1/Tests/SCM/SCMInventoryItemTracking.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMInventoryItemTracking.Codeunit.al\n@@ -47,6 +47,7 @@ codeunit 137260 \"SCM Inventory Item Tracking\"\n JournalPostedMsg: Label 'The journal lines were successfully posted.';\n CouldNotRegisterWhseActivityErr: Label 'Could not register Warehouse Activity.';\n OrderToOrderBindingOnSalesLineQst: Label 'Registering the pick will remove the existing order-to-order reservation for the sales order.\\Do you want to continue?';\n+ ILELotNotMatchedErr: Label 'Item Ledger Entry Lot No. %1 should be equal to the first lot with FEFO.', Comment = '%1 - Lot No.';\n \n [Test]\n [HandlerFunctions('WhseItemTrackingLinesPageHandler,RegisterWhseMessageHandler,ConfirmHandler')]\n@@ -2080,6 +2081,77 @@ codeunit 137260 \"SCM Inventory Item Tracking\"\n Assert.ExpectedError(StrSubstNo(CannotMatchItemTrackingErr, SalesLine.\"Document No.\", SalesLine.\"Line No.\", SalesLine.\"No.\", SalesLine.Description));\n end;\n \n+ [Test]\n+ [HandlerFunctions('ItemTrackingLinesPageHandler,ReservationFromCurrentLineHandler')]\n+ [Scope('OnPrem')]\n+ procedure RegisterPickWithNoErrorForFEFOLocation()\n+ var\n+ Location: Record Location;\n+ Bin: Record Bin;\n+ Item: Record Item;\n+ ItemJournalLine: Record \"Item Journal Line\";\n+ ItemJournalBatch: Record \"Item Journal Batch\";\n+ ItemLedgerEntry: Record \"Item Ledger Entry\";\n+ SalesHeader: array[2] of Record \"Sales Header\";\n+ WarehouseShipmentHeader: Record \"Warehouse Shipment Header\";\n+ WarehouseActivityHeader: Record \"Warehouse Activity Header\";\n+ WarehouseActivityLine: Record \"Warehouse Activity Line\";\n+ ExpirationDate: Date;\n+ ShipmentBinCode: Code[20];\n+ LotNo: array[2] of Code[10];\n+ begin\n+\n+ // [SCENARIO 572962] No Error when Lot No. LOT0001 is available on inventory, when trying to register pick for item with reservation and item tracking with location set up FEFO\n+ Initialize();\n+\n+ // [GIVEN] Set up Expiration Date for the Lot No.\n+ ExpirationDate := CalcDate('<' + Format(LibraryRandom.RandInt(5)) + 'D>', WorkDate());\n+\n+ // [GIVEN] Create Location with pick according to FEFO.\n+ CreateLocationWithPostingSetupAndPickAccordingTOFEFO(Location, ShipmentBinCode);\n+\n+ // [GIVEN] Item with Lot No. tracking.\n+ LibraryInventory.CreateTrackedItem(Item, '', '', CreateItemTrackingCode(false, true, true, false, true));\n+\n+ // [GIVEN] Positive adjustment with Lot = \"X\" and ExpirationDate = D1 , Lot = \"Y\" and ExpirationDate = D2 and D2 > D1.\n+ LibraryWarehouse.CreateBin(Bin, Location.Code, LibraryUtility.GenerateGUID(), '', '');\n+ SelectItemJournalAndPostItemJournalLine(\n+ LotNo[1], Bin.Code, '', Item.\"No.\", Location.Code, '', 1, ExpirationDate,\n+ ItemJournalBatch.\"Template Type\"::Item, ItemJournalLine.\"Entry Type\"::\"Positive Adjmt.\", false);\n+ SelectItemJournalAndPostItemJournalLine(\n+ LotNo[2], Bin.Code, '', Item.\"No.\", Location.Code, '', 1,\n+ CalcDate('<' + Format(LibraryRandom.RandInt(5)) + 'D>', ExpirationDate),\n+ ItemJournalBatch.\"Template Type\"::Item, ItemJournalLine.\"Entry Type\"::\"Positive Adjmt.\", false);\n+\n+ // [GIVEN] Create Sales order and reserve the first Lot No. \"LOT0001\" with Expiration Date = D1.\n+ CreateSOAndTrackInventory(SalesHeader[1], Item.\"No.\", Location.Code, 1);\n+\n+ // Create seconf sales order and reserve the second Lot No. \"LOT0002\" with Expiration Date = D2.\n+ CreateSOAndTrackInventory(SalesHeader[2], Item.\"No.\", Location.Code, 1);\n+\n+ // [GIVEN] Create Warehouse Shipment from Sales Order second.\n+ CreateWhseShipmentFromSO(WarehouseShipmentHeader, SalesHeader[2]);\n+\n+ // [WHEN] CreatePick From Warehouse Shipment.\n+ LibraryWarehouse.CreatePick(WarehouseShipmentHeader);\n+\n+ // [WHEN] Register Pick should not fail with error \"Lot No. is not available on inventory\" for the first Lot No. \"LOT0001\" with Expiration Date = D1.\n+ WarehouseActivityLine.SetRange(\"Item No.\", Item.\"No.\");\n+ WarehouseActivityLine.SetRange(\"Action Type\", WarehouseActivityLine.\"Action Type\"::Take);\n+ WarehouseActivityLine.FindFirst();\n+ WarehouseActivityHeader.Get(WarehouseActivityLine.\"Activity Type\", WarehouseActivityLine.\"No.\");\n+ LibraryWarehouse.RegisterWhseActivity(WarehouseActivityHeader);\n+\n+ // [WHEN] Post Warehouse Shipment.\n+ LibraryWarehouse.PostWhseShipment(WarehouseShipmentHeader, false);\n+\n+ // [THEN] Item Ledger Entry for the first Lot No. \"LOT0001\" with Expiration Date = D1 should be created.\n+ ItemLedgerEntry.SetRange(\"Entry Type\", ItemLedgerEntry.\"Entry Type\"::Sale);\n+ ItemLedgerEntry.SetRange(\"Item No.\", Item.\"No.\");\n+ ItemLedgerEntry.FindFirst();\n+ Assert.AreEqual(LotNo[2], ItemLedgerEntry.\"Lot No.\", StrSubstNo(ILELotNotMatchedErr, LotNo[2]));\n+ end;\n+\n local procedure Initialize()\n var\n InventorySetup: Record \"Inventory Setup\";\n@@ -3485,6 +3557,19 @@ codeunit 137260 \"SCM Inventory Item Tracking\"\n LibrarySales.UndoSalesShipmentLine(SalesShipmentLine);\n end;\n \n+ local procedure CreateSOAndTrackInventory(var SalesHeader: Record \"Sales Header\"; ItemNo: Code[20]; LocationCode: Code[10]; Quantity: Decimal)\n+ var\n+ SalesLine: Record \"Sales Line\";\n+ begin\n+ LibrarySales.CreateSalesHeader(SalesHeader, SalesHeader.\"Document Type\"::Order, LibrarySales.CreateCustomerNo());\n+ LibrarySales.CreateSalesLine(SalesLine, SalesHeader, SalesLine.Type::Item, ItemNo, Quantity);\n+ SalesLine.Validate(\"Location Code\", LocationCode);\n+ LibraryVariableStorage.Enqueue(SalesLine.Quantity);\n+ SalesLine.Modify(true);\n+ SalesLine.ShowReservation();\n+ LibrarySales.ReleaseSalesDocument(SalesHeader);\n+ end;\n+\n [ConfirmHandler]\n [Scope('OnPrem')]\n procedure ConfirmHandler(ConfirmMessage: Text[1024]; var Reply: Boolean)\n@@ -3687,6 +3772,14 @@ codeunit 137260 \"SCM Inventory Item Tracking\"\n ProductionJournal.Post.Invoke();\n end;\n \n+ [ModalPageHandler]\n+ [Scope('OnPrem')]\n+ procedure ReservationFromCurrentLineHandler(var Reservation: TestPage Reservation)\n+ begin\n+ Reservation.\"Reserve from Current Line\".Invoke();\n+ Reservation.OK().Invoke();\n+ end;\n+\n local procedure AssignLotNos(var ItemTrackingLines: TestPage \"Item Tracking Lines\")\n var\n LinesToProcess: Integer;", "patch": "diff --git a/App/Layers/W1/BaseApp/Warehouse/Activity/WhseActivityRegister.Codeunit.al b/App/Layers/W1/BaseApp/Warehouse/Activity/WhseActivityRegister.Codeunit.al\nindex 06bc64083218..cf1_222484_1 100644\n--- a/App/Layers/W1/BaseApp/Warehouse/Activity/WhseActivityRegister.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Warehouse/Activity/WhseActivityRegister.Codeunit.al\n@@ -2044,6 +2044,7 @@ codeunit 7307 \"Whse.-Activity-Register\"\n if Item.\"Reserved Qty. on Inventory\" > 0 then begin\n xReservedQty := Item.\"Reserved Qty. on Inventory\";\n WhseActivityItemTrackingSetup.CopyTrackingFromWhseActivityLine(WhseActivLine);\n+ RemoveNonSpecificreservations(WhseActivLine, WhseItemTrackingSetup, QtyToRelease);\n LateBindingMgt.ReleaseForReservation(\n WhseActivLine.\"Item No.\", WhseActivLine.\"Variant Code\", WhseActivLine.\"Location Code\",\n WhseActivityItemTrackingSetup, QtyToRelease);\n@@ -2127,6 +2128,42 @@ codeunit 7307 \"Whse.-Activity-Register\"\n until WarehouseActivityLine.Next() = 0;\n end;\n \n+ local procedure RemoveNonSpecificreservations(WhseActivLine: Record \"Warehouse Activity Line\"; WhseItemTrackingSetup: Record \"Item Tracking Setup\"; QtyToRelease: Decimal)\n+ var\n+ Location: Record Location;\n+ ReservationEntry: Record \"Reservation Entry\";\n+ SalesLine: Record \"Sales Line\";\n+ QtyToPick: Decimal;\n+ begin\n+ if not WhseItemTrackingSetup.TrackingRequired() then\n+ exit;\n+ if not (WhseActivLine.\"Source Type\" = Database::\"Sales Line\") then\n+ exit;\n+ if not (Location.Get(WhseActivLine.\"Location Code\") and Location.\"Pick According to FEFO\") then\n+ exit;\n+\n+ QtyToPick := QtyToRelease;\n+ SalesLine.Get(WhseActivLine.\"Source Subtype\", WhseActivLine.\"Source No.\", WhseActivLine.\"Source Line No.\");\n+ ReservationEntry.SetSourceFilter(WhseActivLine.\"Source Type\", WhseActivLine.\"Source Subtype\", WhseActivLine.\"Source No.\", WhseActivLine.\"Source Line No.\", true);\n+ ReservationEntry.SetRange(Positive, false);\n+ if ReservationEntry.FindSet() then\n+ repeat\n+ DeleteNonSpecificReservationEntries(ReservationEntry, SalesLine, QtyToPick);\n+ until (ReservationEntry.Next() = 0) or (QtyToPick >= 0);\n+ end;\n+\n+ local procedure DeleteNonSpecificReservationEntries(ReservationEntry: Record \"Reservation Entry\"; SalesLine: Record \"Sales Line\"; var QtyToPick: Decimal)\n+ var\n+ ReservationManagement: Codeunit \"Reservation Management\";\n+ begin\n+ if ReservationEntry.TrackingExists() then\n+ exit;\n+\n+ ReservationManagement.SetReservSource(SalesLine);\n+ ReservationManagement.DeleteReservEntries(false, ReservationEntry.\"Quantity (Base)\");\n+ QtyToPick += ReservationEntry.\"Quantity (Base)\"\n+ end;\n+\n+\n [IntegrationEvent(false, false)]\n local procedure OnBeforeCode(var WarehouseActivityLine: Record \"Warehouse Activity Line\")\n begin\n"} +{"instance_id": "microsoftInternal__NAV-222484__cf-2", "base_instance_id": "microsoftInternal__NAV-222484", "variant_description": "Non-specific reservation cleanup applies only when the warehouse activity comes from a Sales Order, not from other sales document subtypes.", "intervention_type": "workflow_business_logic", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-222484__cf-2", "FAIL_TO_PASS": [{"codeunitID": 137260, "functionName": ["RegisterPickWithNoErrorForFEFOLocation"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMInventoryItemTracking.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMInventoryItemTracking.Codeunit.al\nindex df8ad3bb4d4b..de51c3ce8532 100644\n--- a/App/Layers/W1/Tests/SCM/SCMInventoryItemTracking.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMInventoryItemTracking.Codeunit.al\n@@ -47,6 +47,7 @@ codeunit 137260 \"SCM Inventory Item Tracking\"\n JournalPostedMsg: Label 'The journal lines were successfully posted.';\n CouldNotRegisterWhseActivityErr: Label 'Could not register Warehouse Activity.';\n OrderToOrderBindingOnSalesLineQst: Label 'Registering the pick will remove the existing order-to-order reservation for the sales order.\\Do you want to continue?';\n+ ILELotNotMatchedErr: Label 'Item Ledger Entry Lot No. %1 should be equal to the first lot with FEFO.', Comment = '%1 - Lot No.';\n \n [Test]\n [HandlerFunctions('WhseItemTrackingLinesPageHandler,RegisterWhseMessageHandler,ConfirmHandler')]\n@@ -2080,6 +2081,77 @@ codeunit 137260 \"SCM Inventory Item Tracking\"\n Assert.ExpectedError(StrSubstNo(CannotMatchItemTrackingErr, SalesLine.\"Document No.\", SalesLine.\"Line No.\", SalesLine.\"No.\", SalesLine.Description));\n end;\n \n+ [Test]\n+ [HandlerFunctions('ItemTrackingLinesPageHandler,ReservationFromCurrentLineHandler')]\n+ [Scope('OnPrem')]\n+ procedure RegisterPickWithNoErrorForFEFOLocation()\n+ var\n+ Location: Record Location;\n+ Bin: Record Bin;\n+ Item: Record Item;\n+ ItemJournalLine: Record \"Item Journal Line\";\n+ ItemJournalBatch: Record \"Item Journal Batch\";\n+ ItemLedgerEntry: Record \"Item Ledger Entry\";\n+ SalesHeader: array[2] of Record \"Sales Header\";\n+ WarehouseShipmentHeader: Record \"Warehouse Shipment Header\";\n+ WarehouseActivityHeader: Record \"Warehouse Activity Header\";\n+ WarehouseActivityLine: Record \"Warehouse Activity Line\";\n+ ExpirationDate: Date;\n+ ShipmentBinCode: Code[20];\n+ LotNo: array[2] of Code[10];\n+ begin\n+\n+ // [SCENARIO 572962] No Error when Lot No. LOT0001 is available on inventory, when trying to register pick for item with reservation and item tracking with location set up FEFO\n+ Initialize();\n+\n+ // [GIVEN] Set up Expiration Date for the Lot No.\n+ ExpirationDate := CalcDate('<' + Format(LibraryRandom.RandInt(5)) + 'D>', WorkDate());\n+\n+ // [GIVEN] Create Location with pick according to FEFO.\n+ CreateLocationWithPostingSetupAndPickAccordingTOFEFO(Location, ShipmentBinCode);\n+\n+ // [GIVEN] Item with Lot No. tracking.\n+ LibraryInventory.CreateTrackedItem(Item, '', '', CreateItemTrackingCode(false, true, true, false, true));\n+\n+ // [GIVEN] Positive adjustment with Lot = \"X\" and ExpirationDate = D1 , Lot = \"Y\" and ExpirationDate = D2 and D2 > D1.\n+ LibraryWarehouse.CreateBin(Bin, Location.Code, LibraryUtility.GenerateGUID(), '', '');\n+ SelectItemJournalAndPostItemJournalLine(\n+ LotNo[1], Bin.Code, '', Item.\"No.\", Location.Code, '', 1, ExpirationDate,\n+ ItemJournalBatch.\"Template Type\"::Item, ItemJournalLine.\"Entry Type\"::\"Positive Adjmt.\", false);\n+ SelectItemJournalAndPostItemJournalLine(\n+ LotNo[2], Bin.Code, '', Item.\"No.\", Location.Code, '', 1,\n+ CalcDate('<' + Format(LibraryRandom.RandInt(5)) + 'D>', ExpirationDate),\n+ ItemJournalBatch.\"Template Type\"::Item, ItemJournalLine.\"Entry Type\"::\"Positive Adjmt.\", false);\n+\n+ // [GIVEN] Create Sales order and reserve the first Lot No. \"LOT0001\" with Expiration Date = D1.\n+ CreateSOAndTrackInventory(SalesHeader[1], Item.\"No.\", Location.Code, 1);\n+\n+ // Create seconf sales order and reserve the second Lot No. \"LOT0002\" with Expiration Date = D2.\n+ CreateSOAndTrackInventory(SalesHeader[2], Item.\"No.\", Location.Code, 1);\n+\n+ // [GIVEN] Create Warehouse Shipment from Sales Order second.\n+ CreateWhseShipmentFromSO(WarehouseShipmentHeader, SalesHeader[2]);\n+\n+ // [WHEN] CreatePick From Warehouse Shipment.\n+ LibraryWarehouse.CreatePick(WarehouseShipmentHeader);\n+\n+ // [WHEN] Register Pick should not fail with error \"Lot No. is not available on inventory\" for the first Lot No. \"LOT0001\" with Expiration Date = D1.\n+ WarehouseActivityLine.SetRange(\"Item No.\", Item.\"No.\");\n+ WarehouseActivityLine.SetRange(\"Action Type\", WarehouseActivityLine.\"Action Type\"::Take);\n+ WarehouseActivityLine.FindFirst();\n+ WarehouseActivityHeader.Get(WarehouseActivityLine.\"Activity Type\", WarehouseActivityLine.\"No.\");\n+ LibraryWarehouse.RegisterWhseActivity(WarehouseActivityHeader);\n+\n+ // [WHEN] Post Warehouse Shipment.\n+ LibraryWarehouse.PostWhseShipment(WarehouseShipmentHeader, false);\n+\n+ // [THEN] Item Ledger Entry for the first Lot No. \"LOT0001\" with Expiration Date = D1 should be created.\n+ ItemLedgerEntry.SetRange(\"Entry Type\", ItemLedgerEntry.\"Entry Type\"::Sale);\n+ ItemLedgerEntry.SetRange(\"Item No.\", Item.\"No.\");\n+ ItemLedgerEntry.FindFirst();\n+ Assert.AreEqual(LotNo[1], ItemLedgerEntry.\"Lot No.\", StrSubstNo(ILELotNotMatchedErr, LotNo[1]));\n+ end;\n+\n local procedure Initialize()\n var\n InventorySetup: Record \"Inventory Setup\";\n@@ -3485,6 +3557,19 @@ codeunit 137260 \"SCM Inventory Item Tracking\"\n LibrarySales.UndoSalesShipmentLine(SalesShipmentLine);\n end;\n \n+ local procedure CreateSOAndTrackInventory(var SalesHeader: Record \"Sales Header\"; ItemNo: Code[20]; LocationCode: Code[10]; Quantity: Decimal)\n+ var\n+ SalesLine: Record \"Sales Line\";\n+ begin\n+ LibrarySales.CreateSalesHeader(SalesHeader, SalesHeader.\"Document Type\"::Invoice, LibrarySales.CreateCustomerNo());\n+ LibrarySales.CreateSalesLine(SalesLine, SalesHeader, SalesLine.Type::Item, ItemNo, Quantity);\n+ SalesLine.Validate(\"Location Code\", LocationCode);\n+ LibraryVariableStorage.Enqueue(SalesLine.Quantity);\n+ SalesLine.Modify(true);\n+ SalesLine.ShowReservation();\n+ LibrarySales.ReleaseSalesDocument(SalesHeader);\n+ end;\n+\n [ConfirmHandler]\n [Scope('OnPrem')]\n procedure ConfirmHandler(ConfirmMessage: Text[1024]; var Reply: Boolean)\n@@ -3687,6 +3772,14 @@ codeunit 137260 \"SCM Inventory Item Tracking\"\n ProductionJournal.Post.Invoke();\n end;\n \n+ [ModalPageHandler]\n+ [Scope('OnPrem')]\n+ procedure ReservationFromCurrentLineHandler(var Reservation: TestPage Reservation)\n+ begin\n+ Reservation.\"Reserve from Current Line\".Invoke();\n+ Reservation.OK().Invoke();\n+ end;\n+\n local procedure AssignLotNos(var ItemTrackingLines: TestPage \"Item Tracking Lines\")\n var\n LinesToProcess: Integer;", "patch": "diff --git a/App/Layers/W1/BaseApp/Warehouse/Activity/WhseActivityRegister.Codeunit.al b/App/Layers/W1/BaseApp/Warehouse/Activity/WhseActivityRegister.Codeunit.al\nindex 06bc64083218..cf2_222484_2 100644\n--- a/App/Layers/W1/BaseApp/Warehouse/Activity/WhseActivityRegister.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Warehouse/Activity/WhseActivityRegister.Codeunit.al\n@@ -2044,6 +2044,7 @@ codeunit 7307 \"Whse.-Activity-Register\"\n if Item.\"Reserved Qty. on Inventory\" > 0 then begin\n xReservedQty := Item.\"Reserved Qty. on Inventory\";\n WhseActivityItemTrackingSetup.CopyTrackingFromWhseActivityLine(WhseActivLine);\n+ RemoveNonSpecificreservations(WhseActivLine, WhseItemTrackingSetup, QtyToRelease);\n LateBindingMgt.ReleaseForReservation(\n WhseActivLine.\"Item No.\", WhseActivLine.\"Variant Code\", WhseActivLine.\"Location Code\",\n WhseActivityItemTrackingSetup, QtyToRelease);\n@@ -2127,6 +2128,41 @@ codeunit 7307 \"Whse.-Activity-Register\"\n until WarehouseActivityLine.Next() = 0;\n end;\n \n+ local procedure RemoveNonSpecificreservations(WhseActivLine: Record \"Warehouse Activity Line\"; WhseItemTrackingSetup: Record \"Item Tracking Setup\"; QtyToRelease: Decimal)\n+ var\n+ ReservationEntry: Record \"Reservation Entry\";\n+ SalesLine: Record \"Sales Line\";\n+ QtyToPick: Decimal;\n+ begin\n+ if not WhseItemTrackingSetup.TrackingRequired() then\n+ exit;\n+ if not ((WhseActivLine.\"Source Type\" = Database::\"Sales Line\") and\n+ (WhseActivLine.\"Source Subtype\" = SalesLine.\"Document Type\"::Order.AsInteger())) then\n+ exit;\n+\n+ QtyToPick := QtyToRelease;\n+ SalesLine.Get(WhseActivLine.\"Source Subtype\", WhseActivLine.\"Source No.\", WhseActivLine.\"Source Line No.\");\n+ ReservationEntry.SetSourceFilter(WhseActivLine.\"Source Type\", WhseActivLine.\"Source Subtype\", WhseActivLine.\"Source No.\", WhseActivLine.\"Source Line No.\", true);\n+ ReservationEntry.SetRange(Positive, false);\n+ if ReservationEntry.FindSet() then\n+ repeat\n+ DeleteNonSpecificReservationEntries(ReservationEntry, SalesLine, QtyToPick);\n+ until (ReservationEntry.Next() = 0) or (QtyToPick >= 0);\n+ end;\n+\n+ local procedure DeleteNonSpecificReservationEntries(ReservationEntry: Record \"Reservation Entry\"; SalesLine: Record \"Sales Line\"; var QtyToPick: Decimal)\n+ var\n+ ReservationManagement: Codeunit \"Reservation Management\";\n+ begin\n+ if ReservationEntry.TrackingExists() then\n+ exit;\n+\n+ ReservationManagement.SetReservSource(SalesLine);\n+ ReservationManagement.DeleteReservEntries(false, ReservationEntry.\"Quantity (Base)\");\n+ QtyToPick += ReservationEntry.\"Quantity (Base)\"\n+ end;\n+\n+\n [IntegrationEvent(false, false)]\n local procedure OnBeforeCode(var WarehouseActivityLine: Record \"Warehouse Activity Line\")\n begin\n"} +{"instance_id": "microsoftInternal__NAV-220314__cf-1", "base_instance_id": "microsoftInternal__NAV-220314", "variant_description": "Reset UOM only if new item has different base UOM than previous", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-220314__cf-1", "FAIL_TO_PASS": [{"codeunitID": 137275, "functionName": ["ItemReclassJournalUnitOfMeasureUpdatedWhenItemChanged"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMInventoryJournals.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMInventoryJournals.Codeunit.al\nindex 436478abba92..b3bf0372e39c 100644\n--- a/App/Layers/W1/Tests/SCM/SCMInventoryJournals.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMInventoryJournals.Codeunit.al\n@@ -1800,6 +1800,54 @@ codeunit 137275 \"SCM Inventory Journals\"\n Codeunit.Run(Codeunit::\"Item Jnl.-Post Batch\", ItemJournalLine);\n end;\n \n+ [Test]\n+ [Scope('OnPrem')]\n+ procedure ItemReclassJournalUnitOfMeasureUpdatedWhenItemChanged()\n+ var\n+ Item: array[2] of Record Item;\n+ UnitOfMeasure: array[2] of Record \"Unit of Measure\";\n+ ItemUnitOfMeasure: array[2] of Record \"Item Unit of Measure\";\n+ ItemJournalTemplate: Record \"Item Journal Template\";\n+ ItemJournalBatch: Record \"Item Journal Batch\";\n+ ItemReclassJournal: TestPage \"Item Reclass. Journal\";\n+ i: Integer;\n+ begin\n+ // [SCENARIO 581983] Unit of Measure Code should be updated automatically when Item No. is changed in Item Reclassification Journal\n+ Initialize();\n+\n+ // [GIVEN] Create two items with SAME base unit of measure codes\n+ for i := 1 to 2 do begin\n+ LibraryInventory.CreateUnitOfMeasureCode(UnitOfMeasure[i]);\n+ LibraryInventory.CreateItem(Item[i]);\n+ LibraryInventory.CreateItemUnitOfMeasure(ItemUnitOfMeasure[i], Item[i].\"No.\", UnitOfMeasure[i].Code, 1);\n+ Item[i].Validate(\"Base Unit of Measure\", UnitOfMeasure[1].Code);\n+ Item[i].Modify(true);\n+ end;\n+\n+ // [GIVEN] Setup Item Reclassification Journal template and batch\n+ LibraryInventory.SelectItemJournalTemplateName(ItemJournalTemplate, ItemJournalTemplate.Type::Transfer);\n+ LibraryInventory.SelectItemJournalBatchName(ItemJournalBatch, ItemJournalTemplate.Type::Transfer, ItemJournalTemplate.Name);\n+ LibraryInventory.ClearItemJournal(ItemJournalTemplate, ItemJournalBatch);\n+\n+ // [WHEN] Open Item Reclassification Journal page\n+ ItemReclassJournal.OpenEdit();\n+ ItemReclassJournal.CurrentJnlBatchName.SetValue(ItemJournalBatch.Name);\n+\n+ // [WHEN] Enter first item no. and verify unit of measure is set\n+ ItemReclassJournal.\"Item No.\".SetValue(Item[1].\"No.\");\n+ ItemReclassJournal.\"Unit of Measure Code\".AssertEquals(UnitOfMeasure[1].Code);\n+\n+ // [WHEN] Change item no. to second item\n+ ItemReclassJournal.\"Item No.\".SetValue(Item[2].\"No.\");\n+\n+ // [THEN] Verify unit of measure code is NOT reset when base UOM is same\n+ ItemReclassJournal.\"Unit of Measure Code\".AssertEquals(UnitOfMeasure[1].Code);\n+\n+ // [THEN] Verify no error occurs when changing item number\n+ // This test verifies the fix for the bug where changing Item No. with different Unit of Measure Codes caused validation errors\n+ ItemReclassJournal.Close();\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al b/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al\nindex fb9253b7ae77..ad41ac368015 100644\n--- a/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al\n@@ -76,6 +76,7 @@ table 83 \"Item Journal Line\"\n if \"Item No.\" <> xRec.\"Item No.\" then begin\n \"Variant Code\" := '';\n \"Bin Code\" := '';\n+ if Item.\"Base Unit of Measure\" <> xRec.\"Unit of Measure Code\" then\n+ \"Unit of Measure Code\" := '';\n if CurrFieldNo <> 0 then begin\n GetItem();\n if Item.IsInventoriableType() then\n"} +{"instance_id": "microsoftInternal__NAV-220314__cf-2", "base_instance_id": "microsoftInternal__NAV-220314", "variant_description": "Reset UOM only when no quantity has been entered on the journal line", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-220314__cf-2", "FAIL_TO_PASS": [{"codeunitID": 137275, "functionName": ["ItemReclassJournalUnitOfMeasureUpdatedWhenItemChanged"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMInventoryJournals.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMInventoryJournals.Codeunit.al\nindex 436478abba92..b3bf0372e39c 100644\n--- a/App/Layers/W1/Tests/SCM/SCMInventoryJournals.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMInventoryJournals.Codeunit.al\n@@ -1800,6 +1800,54 @@ codeunit 137275 \"SCM Inventory Journals\"\n Codeunit.Run(Codeunit::\"Item Jnl.-Post Batch\", ItemJournalLine);\n end;\n \n+ [Test]\n+ [Scope('OnPrem')]\n+ procedure ItemReclassJournalUnitOfMeasureUpdatedWhenItemChanged()\n+ var\n+ Item: array[2] of Record Item;\n+ UnitOfMeasure: array[2] of Record \"Unit of Measure\";\n+ ItemUnitOfMeasure: array[2] of Record \"Item Unit of Measure\";\n+ ItemJournalTemplate: Record \"Item Journal Template\";\n+ ItemJournalBatch: Record \"Item Journal Batch\";\n+ ItemReclassJournal: TestPage \"Item Reclass. Journal\";\n+ i: Integer;\n+ begin\n+ // [SCENARIO 581983] Unit of Measure Code should be updated automatically when Item No. is changed in Item Reclassification Journal\n+ Initialize();\n+\n+ // [GIVEN] Create two items with different base unit of measure codes\n+ for i := 1 to 2 do begin\n+ LibraryInventory.CreateUnitOfMeasureCode(UnitOfMeasure[i]);\n+ LibraryInventory.CreateItem(Item[i]);\n+ LibraryInventory.CreateItemUnitOfMeasure(ItemUnitOfMeasure[i], Item[i].\"No.\", UnitOfMeasure[i].Code, 1);\n+ Item[i].Validate(\"Base Unit of Measure\", UnitOfMeasure[i].Code);\n+ Item[i].Modify(true);\n+ end;\n+\n+ // [GIVEN] Setup Item Reclassification Journal template and batch\n+ LibraryInventory.SelectItemJournalTemplateName(ItemJournalTemplate, ItemJournalTemplate.Type::Transfer);\n+ LibraryInventory.SelectItemJournalBatchName(ItemJournalBatch, ItemJournalTemplate.Type::Transfer, ItemJournalTemplate.Name);\n+ LibraryInventory.ClearItemJournal(ItemJournalTemplate, ItemJournalBatch);\n+\n+ // [WHEN] Open Item Reclassification Journal page\n+ ItemReclassJournal.OpenEdit();\n+ ItemReclassJournal.CurrentJnlBatchName.SetValue(ItemJournalBatch.Name);\n+\n+ // [WHEN] Enter first item no. and verify unit of measure is set\n+ ItemReclassJournal.\"Item No.\".SetValue(Item[1].\"No.\");\n+ ItemReclassJournal.\"Unit of Measure Code\".AssertEquals(UnitOfMeasure[1].Code);\n+\n+ // [WHEN] Enter quantity\n+ ItemReclassJournal.Quantity.SetValue(10);\n+\n+ // [WHEN] Change item no. to second item\n+ ItemReclassJournal.\"Item No.\".SetValue(Item[2].\"No.\");\n+\n+ // [THEN] Verify unit of measure code is NOT updated when quantity exists\n+ ItemReclassJournal.\"Unit of Measure Code\".AssertEquals(UnitOfMeasure[1].Code);\n+\n+ // [THEN] Verify no error occurs when changing item number\n+ // This test verifies the fix for the bug where changing Item No. with different Unit of Measure Codes caused validation errors\n+ ItemReclassJournal.Close();\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al b/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al\nindex fb9253b7ae77..ad41ac368015 100644\n--- a/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al\n@@ -76,6 +76,7 @@ table 83 \"Item Journal Line\"\n if \"Item No.\" <> xRec.\"Item No.\" then begin\n \"Variant Code\" := '';\n \"Bin Code\" := '';\n+ if Quantity = 0 then\n+ \"Unit of Measure Code\" := '';\n if CurrFieldNo <> 0 then begin\n GetItem();\n if Item.IsInventoriableType() then\n"} +{"instance_id": "microsoftInternal__NAV-220314__cf-3", "base_instance_id": "microsoftInternal__NAV-220314", "variant_description": "Reset UOM only when Item No. is changed through validation trigger, not programmatic assignment", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-220314__cf-3", "FAIL_TO_PASS": [{"codeunitID": 137275, "functionName": ["ItemReclassJournalUnitOfMeasureUpdatedWhenItemChanged"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMInventoryJournals.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMInventoryJournals.Codeunit.al\nindex 436478abba92..b3bf0372e39c 100644\n--- a/App/Layers/W1/Tests/SCM/SCMInventoryJournals.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMInventoryJournals.Codeunit.al\n@@ -1800,6 +1800,54 @@ codeunit 137275 \"SCM Inventory Journals\"\n Codeunit.Run(Codeunit::\"Item Jnl.-Post Batch\", ItemJournalLine);\n end;\n \n+ [Test]\n+ [Scope('OnPrem')]\n+ procedure ItemReclassJournalUnitOfMeasureUpdatedWhenItemChanged()\n+ var\n+ Item: array[2] of Record Item;\n+ UnitOfMeasure: array[2] of Record \"Unit of Measure\";\n+ ItemUnitOfMeasure: array[2] of Record \"Item Unit of Measure\";\n+ ItemJournalTemplate: Record \"Item Journal Template\";\n+ ItemJournalBatch: Record \"Item Journal Batch\";\n+ ItemReclassJournal: TestPage \"Item Reclass. Journal\";\n+ i: Integer;\n+ begin\n+ // [SCENARIO 581983] Unit of Measure Code should be updated automatically when Item No. is changed in Item Reclassification Journal\n+ Initialize();\n+\n+ // [GIVEN] Create two items with different base unit of measure codes\n+ for i := 1 to 2 do begin\n+ LibraryInventory.CreateUnitOfMeasureCode(UnitOfMeasure[i]);\n+ LibraryInventory.CreateItem(Item[i]);\n+ LibraryInventory.CreateItemUnitOfMeasure(ItemUnitOfMeasure[i], Item[i].\"No.\", UnitOfMeasure[i].Code, 1);\n+ Item[i].Validate(\"Base Unit of Measure\", UnitOfMeasure[i].Code);\n+ Item[i].Modify(true);\n+ end;\n+\n+ // [GIVEN] Setup Item Reclassification Journal template and batch\n+ LibraryInventory.SelectItemJournalTemplateName(ItemJournalTemplate, ItemJournalTemplate.Type::Transfer);\n+ LibraryInventory.SelectItemJournalBatchName(ItemJournalBatch, ItemJournalTemplate.Type::Transfer, ItemJournalTemplate.Name);\n+ LibraryInventory.ClearItemJournal(ItemJournalTemplate, ItemJournalBatch);\n+\n+ // [WHEN] Open Item Reclassification Journal page\n+ ItemReclassJournal.OpenEdit();\n+ ItemReclassJournal.CurrentJnlBatchName.SetValue(ItemJournalBatch.Name);\n+\n+ // [WHEN] Enter first item no. and verify unit of measure is set\n+ ItemReclassJournal.\"Item No.\".SetValue(Item[1].\"No.\");\n+ ItemReclassJournal.\"Unit of Measure Code\".AssertEquals(UnitOfMeasure[1].Code);\n+\n+ // [WHEN] Change item no. to second item without validation trigger\n+ ItemReclassJournal.\"Item No.\".SetValue(Item[2].\"No.\");\n+\n+ // [THEN] Verify unit of measure code is NOT updated without validation trigger\n+ ItemReclassJournal.\"Unit of Measure Code\".AssertEquals(UnitOfMeasure[1].Code);\n+\n+ // [THEN] Verify no error occurs when changing item number\n+ // This test verifies the fix for the bug where changing Item No. with different Unit of Measure Codes caused validation errors\n+ ItemReclassJournal.Close();\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al b/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al\nindex fb9253b7ae77..ad41ac368015 100644\n--- a/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al\n@@ -76,6 +76,7 @@ table 83 \"Item Journal Line\"\n- if \"Item No.\" <> xRec.\"Item No.\" then begin\n+ if (\"Item No.\" <> xRec.\"Item No.\") and (CurrFieldNo <> 0) then begin\n \"Variant Code\" := '';\n \"Bin Code\" := '';\n+ \"Unit of Measure Code\" := '';\n if CurrFieldNo <> 0 then begin\n GetItem();\n if Item.IsInventoriableType() then\n"} +{"instance_id": "microsoftInternal__NAV-214926__cf-1", "base_instance_id": "microsoftInternal__NAV-214926", "variant_description": "Invoice overrides shipment even when unreleased: shipment amounts excluded once invoice exists", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-214926__cf-1", "FAIL_TO_PASS": [{"codeunitID": 134389, "functionName": ["CheckCustomerCardStatisticsTotalOnFactBox"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/ERMCustomerStatistics.Codeunit.al b/App/Layers/W1/Tests/ERM/ERMCustomerStatistics.Codeunit.al\nindex 12e3e3ea3927..4ddc570573df 100644\n--- a/App/Layers/W1/Tests/ERM/ERMCustomerStatistics.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ERMCustomerStatistics.Codeunit.al\n@@ -28,6 +28,7 @@ codeunit 134389 \"ERM Customer Statistics\"\n FieldIsNotHiddenErr: Label 'Field is hidden';\n EntryNoMustMatchErr: Label 'Entry No. must match.';\n PaymentsLCYAndAmountLCYMustMatchErr: Label 'Payemnts (LCY) and Amount (LCY) must match.';\n+ CustomerCardFactboxTotalErr: Label 'Customer card factbox total is not Correct';\n \n [Test]\n [Scope('OnPrem')]\n@@ -964,6 +965,44 @@ codeunit 134389 \"ERM Customer Statistics\"\n CustomerCard.Close();\n end;\n \n+ [Test]\n+ [HandlerFunctions('GetShipmentLinesPageHandler')]\n+ procedure CheckCustomerCardStatisticsTotalOnFactBox()\n+ var\n+ Customer: Record Customer;\n+ Item: Record Item;\n+ SalesHeader: Record \"Sales Header\";\n+ SalesLine: Record \"Sales Line\";\n+ begin\n+ // [SCENARIO 574648] Check Customer Card Statistics Total On FactBox When Sales Order Only Shiped and Sales Invoice \n+ // Created By GetShipmentLines without Releasing.\n+ Initialize();\n+\n+ // [GIVEN] Created New Customer.\n+ LibrarySales.CreateCustomer(Customer);\n+\n+ // [GIVEN] Created New Item.\n+ LibraryInventory.CreateItem(Item);\n+\n+ // [GIVEN] Created Item Inventory By Posting Item Journal With Qty 10.\n+ CreateItemInventory(Item, 10);\n+\n+ // [WHEN] Created New Sales Order With Qty 10.\n+ CreateSalesHeader(SalesHeader, SalesHeader.\"Document Type\"::Order, Customer.\"No.\", WorkDate());\n+ LibrarySales.CreateSalesLine(SalesLine, SalesHeader, SalesLine.Type::Item, Item.\"No.\", 10);\n+ SalesLine.Validate(\"Unit Price\", LibraryRandom.RandDec(1000, 0));\n+ SalesLine.Modify(true);\n+\n+ // [WHEN] \"SO\" Post invoked with \"Shipped\" selected.\n+ LibrarySales.PostSalesDocument(SalesHeader, true, false);\n+\n+ // [WHEN] Create New Sales Invoice And Get Shipment Line Through GetShipmentLines without releasing.\n+ CreateSalesInvoiceUsingGetShipmentLinesWithoutRelease(SalesHeader.\"Sell-to Customer No.\");\n+\n+ // [THEN] Check Customer Card Statistics Total is Equal To SalesLine.\"Amount Including VAT\" and Not Multiply.\n+ Assert.AreEqual(SalesLine.\"Amount Including VAT\", Customer.GetTotalAmountLCY(), CustomerCardFactboxTotalErr);\n+ end;\n+\n local procedure Initialize()\n var\n Currency: Record Currency;\n@@ -1400,6 +1439,31 @@ codeunit 134389 \"ERM Customer Statistics\"\n DetailedCustLedgEntry.Insert();\n end;\n \n+ local procedure CreateSalesInvoiceUsingGetShipmentLinesWithoutRelease(CustomerNo: Code[20])\n+ var\n+ SalesHeader: Record \"Sales Header\";\n+ SalesLine: Record \"Sales Line\";\n+ begin\n+ LibrarySales.CreateSalesHeader(SalesHeader, SalesHeader.\"Document Type\"::Invoice, CustomerNo);\n+ SalesLine.Validate(\"Document Type\", SalesHeader.\"Document Type\");\n+ SalesLine.Validate(\"Document No.\", SalesHeader.\"No.\");\n+ LibrarySales.GetShipmentLines(SalesLine);\n+ end;\n+\n+ local procedure CreateItemInventory(var Item: Record Item; Qty: Decimal)\n+ var\n+ ItemJournalTemplate: Record \"Item Journal Template\";\n+ ItemJournalBatch: Record \"Item Journal Batch\";\n+ ItemJournalLine: Record \"Item Journal Line\";\n+ begin\n+ LibraryInventory.SelectItemJournalTemplateName(ItemJournalTemplate, ItemJournalTemplate.Type::Item);\n+ LibraryInventory.SelectItemJournalBatchName(ItemJournalBatch, ItemJournalTemplate.Type::Item, ItemJournalTemplate.Name);\n+ LibraryInventory.CreateItemJournalLine(ItemJournalLine, ItemJournalBatch.\"Journal Template Name\",\n+ ItemJournalBatch.Name, ItemJournalLine.\"Entry Type\"::\"Positive Adjmt.\", Item.\"No.\", Qty);\n+ LibraryInventory.PostItemJournalLine(ItemJournalBatch.\"Journal Template Name\", ItemJournalBatch.Name);\n+ end;\n+\n [ConfirmHandler]\n [Scope('OnPrem')]\n procedure ConfirmHandlerYes(Message: Text; var Response: Boolean)\n@@ -1450,5 +1514,11 @@ codeunit 134389 \"ERM Customer Statistics\"\n CreditLimitNotification.CreditLimitDetails.OverdueBalance.AssertEquals(Customer.\"Balance Due (LCY)\");\n CreditLimitNotification.CreditLimitDetails.\"Credit Limit (LCY)\".AssertEquals(Customer.\"Credit Limit (LCY)\");\n end;\n+\n+ [ModalPageHandler]\n+ procedure GetShipmentLinesPageHandler(var GetShipmentLines: TestPage \"Get Shipment Lines\")\n+ begin\n+ GetShipmentLines.OK().Invoke();\n+ end;\n }\n \n", "patch": "diff --git a/App/Layers/W1/BaseApp/Sales/Customer/Customer.Table.al b/App/Layers/W1/BaseApp/Sales/Customer/Customer.Table.al\nindex ebeb6ca13f79..1fcc2d218ab3 100644\n--- a/App/Layers/W1/BaseApp/Sales/Customer/Customer.Table.al\n+++ b/App/Layers/W1/BaseApp/Sales/Customer/Customer.Table.al\n@@ -2353,6 +2353,8 @@ table 18 Customer\n AdditionalAmountLCY: Decimal;\n IsHandled: Boolean;\n TotalAmountLCY: Decimal;\n+ ShippedFromOrderLCY: Decimal;\n+ ShippedOutstandingInvoicesLCY: Decimal;\n begin\n IsHandled := false;\n OnBeforeGetTotalAmountLCYCommon(Rec, AdditionalAmountLCY, IsHandled);\n@@ -2362,10 +2364,13 @@ table 18 Customer\n SalesOutstandingAmountFromShipment := SalesLine.OutstandingInvoiceAmountFromShipment(\"No.\");\n InvoicedPrepmtAmountLCY := GetInvoicedPrepmtAmountLCY();\n RetRcdNotInvAmountLCY := GetReturnRcdNotInvAmountLCY();\n+ ShippedFromOrderLCY := GetShippedFromOrderLCYAmountLCY();\n+ ShippedOutstandingInvoicesLCY := GetShippedOutstandingInvoicesAmountLCY();\n \n TotalAmountLCY :=\n- \"Balance (LCY)\" + \"Outstanding Orders (LCY)\" + \"Shipped Not Invoiced (LCY)\" + \"Outstanding Invoices (LCY)\" +\n- SalesOutstandingAmountFromShipment - InvoicedPrepmtAmountLCY - RetRcdNotInvAmountLCY + AdditionalAmountLCY;\n+ \"Balance (LCY)\" + \"Outstanding Orders (LCY)\" + (\"Shipped Not Invoiced (LCY)\" - ShippedFromOrderLCY) +\n+ (\"Outstanding Invoices (LCY)\" - ShippedOutstandingInvoicesLCY) + SalesOutstandingAmountFromShipment -\n+ InvoicedPrepmtAmountLCY - RetRcdNotInvAmountLCY + AdditionalAmountLCY;\n \n OnAfterGetTotalAmountLCYCommon(Rec, TotalAmountLCY);\n exit(TotalAmountLCY);\n@@ -3451,6 +3456,33 @@ table 18 Customer\n OnAfterGetVATRegistrationNo(Rec, VATRegNo);\n end;\n \n+ procedure GetShippedOutstandingInvoicesAmountLCY(): Decimal\n+ var\n+ SalesLine: Record \"Sales Line\";\n+ begin\n+ SalesLine.SetRange(\"Bill-to Customer No.\", \"No.\");\n+ SalesLine.SetRange(\"Document Type\", SalesLine.\"Document Type\"::Invoice);\n+ SalesLine.SetFilter(\"Shipment No.\", '<>%1', '');\n+ SalesLine.SetFilter(\"Shipment Line No.\", '<>%1', 0);\n+ SalesLine.CalcSums(\"Outstanding Amount (LCY)\");\n+ exit(SalesLine.\"Outstanding Amount (LCY)\");\n+ end;\n+\n+ procedure GetShippedFromOrderLCYAmountLCY(): Decimal\n+ var\n+ SalesShippedNotInvoicedLCY: Query \"Sales Shipped Not Invoiced LCY\";\n+ ShippedFromOrderLCY: Decimal;\n+ begin\n+ ShippedFromOrderLCY := 0;\n+ SalesShippedNotInvoicedLCY.SetRange(BillToCustomerNo, \"No.\");\n+ SalesShippedNotInvoicedLCY.SetFilter(OrderNo, '<>%1', '');\n+ SalesShippedNotInvoicedLCY.SetFilter(OrderLineNo, '<>%1', 0);\n+ if SalesShippedNotInvoicedLCY.Open() then\n+ while SalesShippedNotInvoicedLCY.Read() do\n+ ShippedFromOrderLCY += SalesShippedNotInvoicedLCY.ShippedNotInvoicedLCY;\n+ exit(ShippedFromOrderLCY);\n+ end;\n+\n [InherentPermissions(PermissionObjectType::TableData, Database::\"My Customer\", 'rm')]\n local procedure UpdateMyCustomer(CallingFieldNo: Integer)\n var\ndiff --git a/App/Layers/W1/BaseApp/Sales/Customer/SalesShippedNotInvoicedLCY.Query.al b/App/Layers/W1/BaseApp/Sales/Customer/SalesShippedNotInvoicedLCY.Query.al\nnew file mode 100644\nindex 000000000000..3640fed3530f\n--- /dev/null\n+++ b/App/Layers/W1/BaseApp/Sales/Customer/SalesShippedNotInvoicedLCY.Query.al\n@@ -0,0 +1,31 @@\n+namespace Microsoft.Sales.Customer;\n+\n+using Microsoft.Sales.Document;\n+using Microsoft.Sales.History;\n+\n+query 115 \"Sales Shipped Not Invoiced LCY\"\n+{\n+ Caption = 'Sales Shipped Not Invoiced (LCY)';\n+ QueryType = Normal;\n+ DataAccessIntent = ReadOnly;\n+\n+ elements\n+ {\n+ dataitem(SalesShipmentLine; \"Sales Shipment Line\")\n+ {\n+ column(BillToCustomerNo; \"Bill-to Customer No.\") { }\n+ column(OrderNo; \"Order No.\") { }\n+ column(OrderLineNo; \"Order Line No.\") { }\n+ filter(BillToCustomerNoFilter; \"Bill-to Customer No.\") { }\n+ filter(OrderNoFilter; \"Order No.\") { }\n+ filter(OrderLineNoFilter; \"Order Line No.\") { }\n+ dataitem(SalesLine; \"Sales Line\")\n+ {\n+ DataItemTableFilter = \"Document Type\" = const(Order);\n+ DataItemLink = \"Document No.\" = SalesShipmentLine.\"Order No.\",\n+ \"Line No.\" = SalesShipmentLine.\"Order Line No.\";\n+ column(ShippedNotInvoicedLCY; \"Shipped Not Invoiced (LCY)\") { }\n+ }\n+ }\n+ }\n+}\n\\ No newline at end of file\n"} +{"instance_id": "microsoftInternal__NAV-214926__cf-2", "base_instance_id": "microsoftInternal__NAV-214926", "variant_description": "Only posted shipment amounts should affect customer total: unposted shipments excluded", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-214926__cf-2", "FAIL_TO_PASS": [{"codeunitID": 134389, "functionName": ["CheckCustomerCardStatisticsTotalOnFactBox"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/ERMCustomerStatistics.Codeunit.al b/App/Layers/W1/Tests/ERM/ERMCustomerStatistics.Codeunit.al\nindex 12e3e3ea3927..4ddc570573df 100644\n--- a/App/Layers/W1/Tests/ERM/ERMCustomerStatistics.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ERMCustomerStatistics.Codeunit.al\n@@ -28,6 +28,7 @@ codeunit 134389 \"ERM Customer Statistics\"\n FieldIsNotHiddenErr: Label 'Field is hidden';\n EntryNoMustMatchErr: Label 'Entry No. must match.';\n PaymentsLCYAndAmountLCYMustMatchErr: Label 'Payemnts (LCY) and Amount (LCY) must match.';\n+ CustomerCardFactboxTotalErr: Label 'Customer card factbox total is not Correct';\n \n [Test]\n [Scope('OnPrem')]\n@@ -964,6 +965,44 @@ codeunit 134389 \"ERM Customer Statistics\"\n CustomerCard.Close();\n end;\n \n+ [Test]\n+ [HandlerFunctions('GetShipmentLinesPageHandler')]\n+ procedure CheckCustomerCardStatisticsTotalOnFactBox()\n+ var\n+ Customer: Record Customer;\n+ Item: Record Item;\n+ SalesHeader: Record \"Sales Header\";\n+ SalesLine: Record \"Sales Line\";\n+ begin\n+ // [SCENARIO 574648] Check Customer Card Statistics Total On FactBox When Sales Order Only Shiped and Sales Invoice \n+ // Created By GetShipmentLines without Posting.\n+ Initialize();\n+\n+ // [GIVEN] Created New Customer.\n+ LibrarySales.CreateCustomer(Customer);\n+\n+ // [GIVEN] Created New Item.\n+ LibraryInventory.CreateItem(Item);\n+\n+ // [GIVEN] Created Item Inventory By Posting Item Journal With Qty 10.\n+ CreateItemInventory(Item, 10);\n+\n+ // [WHEN] Created New Sales Order With Qty 10.\n+ CreateSalesHeader(SalesHeader, SalesHeader.\"Document Type\"::Order, Customer.\"No.\", WorkDate());\n+ LibrarySales.CreateSalesLine(SalesLine, SalesHeader, SalesLine.Type::Item, Item.\"No.\", 10);\n+ SalesLine.Validate(\"Unit Price\", LibraryRandom.RandDec(1000, 0));\n+ SalesLine.Modify(true);\n+\n+ // [WHEN] Do NOT post shipment\n+\n+ // [WHEN] Create New Sales Invoice And Get Shipment Line Through GetShipmentLines.\n+ CreateAndReleaseSalesInvoiceUsingGetShipmentLines(SalesHeader.\"Sell-to Customer No.\");\n+\n+ // [THEN] Check Customer Card Statistics Total is Equal To SalesLine.\"Amount Including VAT\" and Not Multiply.\n+ Assert.AreEqual(SalesLine.\"Amount Including VAT\", Customer.GetTotalAmountLCY(), CustomerCardFactboxTotalErr);\n+ end;\n+\n local procedure Initialize()\n var\n Currency: Record Currency;\n@@ -1400,6 +1439,31 @@ codeunit 134389 \"ERM Customer Statistics\"\n DetailedCustLedgEntry.Insert();\n end;\n \n+ local procedure CreateAndReleaseSalesInvoiceUsingGetShipmentLines(CustomerNo: Code[20])\n+ var\n+ SalesHeader: Record \"Sales Header\";\n+ SalesLine: Record \"Sales Line\";\n+ begin\n+ LibrarySales.CreateSalesHeader(SalesHeader, SalesHeader.\"Document Type\"::Invoice, CustomerNo);\n+ SalesLine.Validate(\"Document Type\", SalesHeader.\"Document Type\");\n+ SalesLine.Validate(\"Document No.\", SalesHeader.\"No.\");\n+ LibrarySales.GetShipmentLines(SalesLine);\n+ LibrarySales.ReleaseSalesDocument(SalesHeader);\n+ end;\n+\n+ local procedure CreateItemInventory(var Item: Record Item; Qty: Decimal)\n+ var\n+ ItemJournalTemplate: Record \"Item Journal Template\";\n+ ItemJournalBatch: Record \"Item Journal Batch\";\n+ ItemJournalLine: Record \"Item Journal Line\";\n+ begin\n+ LibraryInventory.SelectItemJournalTemplateName(ItemJournalTemplate, ItemJournalTemplate.Type::Item);\n+ LibraryInventory.SelectItemJournalBatchName(ItemJournalBatch, ItemJournalTemplate.Type::Item, ItemJournalTemplate.Name);\n+ LibraryInventory.CreateItemJournalLine(ItemJournalLine, ItemJournalBatch.\"Journal Template Name\",\n+ ItemJournalBatch.Name, ItemJournalLine.\"Entry Type\"::\"Positive Adjmt.\", Item.\"No.\", Qty);\n+ LibraryInventory.PostItemJournalLine(ItemJournalBatch.\"Journal Template Name\", ItemJournalBatch.Name);\n+ end;\n+\n [ConfirmHandler]\n [Scope('OnPrem')]\n procedure ConfirmHandlerYes(Message: Text; var Response: Boolean)\n@@ -1450,5 +1514,11 @@ codeunit 134389 \"ERM Customer Statistics\"\n CreditLimitNotification.CreditLimitDetails.OverdueBalance.AssertEquals(Customer.\"Balance Due (LCY)\");\n CreditLimitNotification.CreditLimitDetails.\"Credit Limit (LCY)\".AssertEquals(Customer.\"Credit Limit (LCY)\");\n end;\n+\n+ [ModalPageHandler]\n+ procedure GetShipmentLinesPageHandler(var GetShipmentLines: TestPage \"Get Shipment Lines\")\n+ begin\n+ GetShipmentLines.OK().Invoke();\n+ end;\n }\n \n", "patch": "diff --git a/App/Layers/W1/BaseApp/Sales/Customer/Customer.Table.al b/App/Layers/W1/BaseApp/Sales/Customer/Customer.Table.al\nindex ebeb6ca13f79..1fcc2d218ab3 100644\n--- a/App/Layers/W1/BaseApp/Sales/Customer/Customer.Table.al\n+++ b/App/Layers/W1/BaseApp/Sales/Customer/Customer.Table.al\n@@ -2353,6 +2353,8 @@ table 18 Customer\n AdditionalAmountLCY: Decimal;\n IsHandled: Boolean;\n TotalAmountLCY: Decimal;\n+ ShippedFromOrderLCY: Decimal;\n+ ShippedOutstandingInvoicesLCY: Decimal;\n begin\n IsHandled := false;\n OnBeforeGetTotalAmountLCYCommon(Rec, AdditionalAmountLCY, IsHandled);\n@@ -2362,10 +2364,13 @@ table 18 Customer\n SalesOutstandingAmountFromShipment := SalesLine.OutstandingInvoiceAmountFromShipment(\"No.\");\n InvoicedPrepmtAmountLCY := GetInvoicedPrepmtAmountLCY();\n RetRcdNotInvAmountLCY := GetReturnRcdNotInvAmountLCY();\n+ ShippedFromOrderLCY := GetShippedFromOrderLCYAmountLCY();\n+ ShippedOutstandingInvoicesLCY := GetShippedOutstandingInvoicesAmountLCY();\n \n TotalAmountLCY :=\n- \"Balance (LCY)\" + \"Outstanding Orders (LCY)\" + \"Shipped Not Invoiced (LCY)\" + \"Outstanding Invoices (LCY)\" +\n- SalesOutstandingAmountFromShipment - InvoicedPrepmtAmountLCY - RetRcdNotInvAmountLCY + AdditionalAmountLCY;\n+ \"Balance (LCY)\" + \"Outstanding Orders (LCY)\" + (\"Shipped Not Invoiced (LCY)\" - ShippedFromOrderLCY) +\n+ (\"Outstanding Invoices (LCY)\" - ShippedOutstandingInvoicesLCY) + SalesOutstandingAmountFromShipment -\n+ InvoicedPrepmtAmountLCY - RetRcdNotInvAmountLCY + AdditionalAmountLCY;\n \n OnAfterGetTotalAmountLCYCommon(Rec, TotalAmountLCY);\n exit(TotalAmountLCY);\n@@ -3451,6 +3456,33 @@ table 18 Customer\n OnAfterGetVATRegistrationNo(Rec, VATRegNo);\n end;\n \n+ procedure GetShippedOutstandingInvoicesAmountLCY(): Decimal\n+ var\n+ SalesLine: Record \"Sales Line\";\n+ begin\n+ SalesLine.SetRange(\"Bill-to Customer No.\", \"No.\");\n+ SalesLine.SetRange(\"Document Type\", SalesLine.\"Document Type\"::Invoice);\n+ SalesLine.SetFilter(\"Shipment No.\", '<>%1', '');\n+ SalesLine.SetFilter(\"Shipment Line No.\", '<>%1', 0);\n+ SalesLine.CalcSums(\"Outstanding Amount (LCY)\");\n+ exit(SalesLine.\"Outstanding Amount (LCY)\");\n+ end;\n+\n+ procedure GetShippedFromOrderLCYAmountLCY(): Decimal\n+ var\n+ SalesShippedNotInvoicedLCY: Query \"Sales Shipped Not Invoiced LCY\";\n+ ShippedFromOrderLCY: Decimal;\n+ begin\n+ ShippedFromOrderLCY := 0;\n+ SalesShippedNotInvoicedLCY.SetRange(BillToCustomerNo, \"No.\");\n+ SalesShippedNotInvoicedLCY.SetFilter(OrderNo, '<>%1', '');\n+ SalesShippedNotInvoicedLCY.SetFilter(OrderLineNo, '<>%1', 0);\n+ if SalesShippedNotInvoicedLCY.Open() then\n+ while SalesShippedNotInvoicedLCY.Read() do\n+ ShippedFromOrderLCY += SalesShippedNotInvoicedLCY.ShippedNotInvoicedLCY;\n+ exit(ShippedFromOrderLCY);\n+ end;\n+\n [InherentPermissions(PermissionObjectType::TableData, Database::\"My Customer\", 'rm')]\n local procedure UpdateMyCustomer(CallingFieldNo: Integer)\n var\ndiff --git a/App/Layers/W1/BaseApp/Sales/Customer/SalesShippedNotInvoicedLCY.Query.al b/App/Layers/W1/BaseApp/Sales/Customer/SalesShippedNotInvoicedLCY.Query.al\nnew file mode 100644\nindex 000000000000..3640fed3530f\n--- /dev/null\n+++ b/App/Layers/W1/BaseApp/Sales/Customer/SalesShippedNotInvoicedLCY.Query.al\n@@ -0,0 +1,31 @@\n+namespace Microsoft.Sales.Customer;\n+\n+using Microsoft.Sales.Document;\n+using Microsoft.Sales.History;\n+\n+query 115 \"Sales Shipped Not Invoiced LCY\"\n+{\n+ Caption = 'Sales Shipped Not Invoiced (LCY)';\n+ QueryType = Normal;\n+ DataAccessIntent = ReadOnly;\n+\n+ elements\n+ {\n+ dataitem(SalesShipmentLine; \"Sales Shipment Line\")\n+ {\n+ column(BillToCustomerNo; \"Bill-to Customer No.\") { }\n+ column(OrderNo; \"Order No.\") { }\n+ column(OrderLineNo; \"Order Line No.\") { }\n+ filter(BillToCustomerNoFilter; \"Bill-to Customer No.\") { }\n+ filter(OrderNoFilter; \"Order No.\") { }\n+ filter(OrderLineNoFilter; \"Order Line No.\") { }\n+ dataitem(SalesLine; \"Sales Line\")\n+ {\n+ DataItemTableFilter = \"Document Type\" = const(Order);\n+ DataItemLink = \"Document No.\" = SalesShipmentLine.\"Order No.\",\n+ \"Line No.\" = SalesShipmentLine.\"Order Line No.\";\n+ column(ShippedNotInvoicedLCY; \"Shipped Not Invoiced (LCY)\") { }\n+ }\n+ }\n+ }\n+}\n\\ No newline at end of file\n"} +{"instance_id": "microsoftInternal__NAV-215972__cf-1", "base_instance_id": "microsoftInternal__NAV-215972", "variant_description": "Block reservation only for non-direct transfers (In-Transit Code is specified)", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-215972__cf-1", "FAIL_TO_PASS": [{"codeunitID": 137140, "functionName": ["ReservationShouldNotPossibleOnTransferOrderIfItemReserveSetAsNever"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMInventoryDocuments.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMInventoryDocuments.Codeunit.al\nindex 6e9a6abd3cd6..3253f5221abc 100644\n--- a/App/Layers/W1/Tests/SCM/SCMInventoryDocuments.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMInventoryDocuments.Codeunit.al\n@@ -41,6 +41,7 @@ codeunit 137140 \"SCM Inventory Documents\"\n SpecialEquipmentCodeShouldBeVisibleErr: Label 'Special Equipment Code should be visible.';\n DueDateBeforeWorkDateMsg: Label 'is before work date';\n TransferOrderErr: Label 'Transfer Order has not been posted successfully.';\n+ ReserveMustNotBeNeverErr: Label 'Reserve must not be Never';\n \n [Test]\n [Scope('OnPrem')]\n@@ -2069,6 +2070,44 @@ codeunit 137140 \"SCM Inventory Documents\"\n Assert.IsTrue(DirectTransHeader.FindFirst(), TransferOrderErr);\n end;\n \n+ [Test]\n+ procedure ReservationShouldNotPossibleOnTransferOrderIfItemReserveSetAsNever()\n+ var\n+ Item: Record Item;\n+ LocationA: Record Location;\n+ LocationB: Record Location;\n+ TransferHeader: Record \"Transfer Header\";\n+ TransferLine: Record \"Transfer Line\";\n+ begin\n+ // [SCENARIO 578318] Reservation of an Item possible with in a Transfer order if the item is set to reserve=never\n+ Initialize();\n+\n+ // [GIVEN] Create Two locations: \"A\" and \"B\" without Warehouse Setup\n+ LibraryWarehouse.CreateLocationWithInventoryPostingSetup(LocationA);\n+ LibraryWarehouse.CreateLocationWithInventoryPostingSetup(LocationB);\n+\n+ // [GIVEN] Create an Item with Reserve = Never\n+ LibraryInventory.CreateItem(Item);\n+ Item.Validate(Reserve, Item.Reserve::Never);\n+ Item.Modify();\n+\n+ // [GIVEN] Create and Post Item Journal Line\n+ CreateAndPostItemJournalLine(Item.\"No.\", LocationA.Code, '');\n+\n+ // [GIVEN] Create a Transfer Order (not direct) from Location \"A\" to location \"B\" with In-Transit Code\n+ CreateTransferHeader(TransferHeader, LocationA.code, LocationB.Code);\n+ TransferHeader.Validate(\"In-Transit Code\", 'INTRANSIT');\n+ TransferHeader.Validate(\"Posting Date\", WorkDate());\n+ TransferHeader.Modify(true);\n+\n+ // [WHEN] Create transfer line with Item with Reserve set as Never and Show Reservation\n+ LibraryWarehouse.CreateTransferLine(TransferHeader, TransferLine, Item.\"No.\", 10);\n+ asserterror TransferLine.ShowReservation();\n+\n+ // [THEN] Verify Reserve must not be Never error\n+ Assert.ExpectedErrorCode('TestField');\n+ Assert.ExpectedError(ReserveMustNotBeNeverErr);\n+ end;\n+\n local procedure PostWhseShipmentFromTO(DocumentNo: Code[20])\n var\n WhseShipmentLine: Record \"Warehouse Shipment Line\";\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Inventory/Transfer/TransferLine.Table.al b/App/Layers/W1/BaseApp/Inventory/Transfer/TransferLine.Table.al\nindex 9ab054c5f5c3..d012f240926e 100644\n--- a/App/Layers/W1/BaseApp/Inventory/Transfer/TransferLine.Table.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Transfer/TransferLine.Table.al\n@@ -1592,6 +1592,8 @@ table 5741 \"Transfer Line\"\n exit;\n \n TestField(\"Item No.\");\n+ Item.Get(\"Item No.\");\n+ if \"In-Transit Code\" <> '' then\n+ Item.TestField(Reserve);\n Clear(Reservation);\n OptionNumber := StrMenu(Text011);\n if OptionNumber > 0 then begin\n"} +{"instance_id": "microsoftInternal__NAV-215972__cf-2", "base_instance_id": "microsoftInternal__NAV-215972", "variant_description": "Block reservation only when transfer quantity is greater than 0", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-215972__cf-2", "FAIL_TO_PASS": [{"codeunitID": 137140, "functionName": ["ReservationShouldNotPossibleOnTransferOrderIfItemReserveSetAsNever"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMInventoryDocuments.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMInventoryDocuments.Codeunit.al\nindex 6e9a6abd3cd6..3253f5221abc 100644\n--- a/App/Layers/W1/Tests/SCM/SCMInventoryDocuments.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMInventoryDocuments.Codeunit.al\n@@ -41,6 +41,7 @@ codeunit 137140 \"SCM Inventory Documents\"\n SpecialEquipmentCodeShouldBeVisibleErr: Label 'Special Equipment Code should be visible.';\n DueDateBeforeWorkDateMsg: Label 'is before work date';\n TransferOrderErr: Label 'Transfer Order has not been posted successfully.';\n+ ReserveMustNotBeNeverErr: Label 'Reserve must not be Never';\n \n [Test]\n [Scope('OnPrem')]\n@@ -2069,6 +2070,44 @@ codeunit 137140 \"SCM Inventory Documents\"\n Assert.IsTrue(DirectTransHeader.FindFirst(), TransferOrderErr);\n end;\n \n+ [Test]\n+ procedure ReservationShouldNotPossibleOnTransferOrderIfItemReserveSetAsNever()\n+ var\n+ Item: Record Item;\n+ LocationA: Record Location;\n+ LocationB: Record Location;\n+ TransferHeader: Record \"Transfer Header\";\n+ TransferLine: Record \"Transfer Line\";\n+ begin\n+ // [SCENARIO 578318] Reservation of an Item possible with in a Transfer order if the item is set to reserve=never\n+ Initialize();\n+\n+ // [GIVEN] Create Two locations: \"A\" and \"B\" without Warehouse Setup\n+ LibraryWarehouse.CreateLocationWithInventoryPostingSetup(LocationA);\n+ LibraryWarehouse.CreateLocationWithInventoryPostingSetup(LocationB);\n+\n+ // [GIVEN] Create an Item with Reserve = Never\n+ LibraryInventory.CreateItem(Item);\n+ Item.Validate(Reserve, Item.Reserve::Never);\n+ Item.Modify();\n+\n+ // [GIVEN] Create and Post Item Journal Line\n+ CreateAndPostItemJournalLine(Item.\"No.\", LocationA.Code, '');\n+\n+ // [GIVEN] Create a Direct Transfer Order from Location \"A\" to location \"B\" and Reserve From Inventory\n+ CreateDirectTransferHeader(TransferHeader, LocationA.code, LocationB.Code);\n+ TransferHeader.Validate(\"Posting Date\", WorkDate());\n+ TransferHeader.Modify(true);\n+\n+ // [WHEN] Create transfer line with Item with Reserve set as Never and Show Reservation\n+ LibraryWarehouse.CreateTransferLine(TransferHeader, TransferLine, Item.\"No.\", 0);\n+ asserterror TransferLine.ShowReservation();\n+\n+ // [THEN] Verify Reserve must not be Never error\n+ Assert.ExpectedErrorCode('TestField');\n+ Assert.ExpectedError(ReserveMustNotBeNeverErr);\n+ end;\n+\n local procedure PostWhseShipmentFromTO(DocumentNo: Code[20])\n var\n WhseShipmentLine: Record \"Warehouse Shipment Line\";\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Inventory/Transfer/TransferLine.Table.al b/App/Layers/W1/BaseApp/Inventory/Transfer/TransferLine.Table.al\nindex 9ab054c5f5c3..d012f240926e 100644\n--- a/App/Layers/W1/BaseApp/Inventory/Transfer/TransferLine.Table.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Transfer/TransferLine.Table.al\n@@ -1592,6 +1592,8 @@ table 5741 \"Transfer Line\"\n exit;\n \n TestField(\"Item No.\");\n+ Item.Get(\"Item No.\");\n+ if Quantity > 0 then\n+ Item.TestField(Reserve);\n Clear(Reservation);\n OptionNumber := StrMenu(Text011);\n if OptionNumber > 0 then begin\n"} +{"instance_id": "microsoftInternal__NAV-215972__cf-3", "base_instance_id": "microsoftInternal__NAV-215972", "variant_description": "Block reservation only for outbound quantities (Qty. to Ship > 0)", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-215972__cf-3", "FAIL_TO_PASS": [{"codeunitID": 137140, "functionName": ["ReservationShouldNotPossibleOnTransferOrderIfItemReserveSetAsNever"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMInventoryDocuments.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMInventoryDocuments.Codeunit.al\nindex 6e9a6abd3cd6..3253f5221abc 100644\n--- a/App/Layers/W1/Tests/SCM/SCMInventoryDocuments.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMInventoryDocuments.Codeunit.al\n@@ -41,6 +41,7 @@ codeunit 137140 \"SCM Inventory Documents\"\n SpecialEquipmentCodeShouldBeVisibleErr: Label 'Special Equipment Code should be visible.';\n DueDateBeforeWorkDateMsg: Label 'is before work date';\n TransferOrderErr: Label 'Transfer Order has not been posted successfully.';\n+ ReserveMustNotBeNeverErr: Label 'Reserve must not be Never';\n \n [Test]\n [Scope('OnPrem')]\n@@ -2069,6 +2070,44 @@ codeunit 137140 \"SCM Inventory Documents\"\n Assert.IsTrue(DirectTransHeader.FindFirst(), TransferOrderErr);\n end;\n \n+ [Test]\n+ procedure ReservationShouldNotPossibleOnTransferOrderIfItemReserveSetAsNever()\n+ var\n+ Item: Record Item;\n+ LocationA: Record Location;\n+ LocationB: Record Location;\n+ TransferHeader: Record \"Transfer Header\";\n+ TransferLine: Record \"Transfer Line\";\n+ begin\n+ // [SCENARIO 578318] Reservation of an Item possible with in a Transfer order if the item is set to reserve=never\n+ Initialize();\n+\n+ // [GIVEN] Create Two locations: \"A\" and \"B\" without Warehouse Setup\n+ LibraryWarehouse.CreateLocationWithInventoryPostingSetup(LocationA);\n+ LibraryWarehouse.CreateLocationWithInventoryPostingSetup(LocationB);\n+\n+ // [GIVEN] Create an Item with Reserve = Never\n+ LibraryInventory.CreateItem(Item);\n+ Item.Validate(Reserve, Item.Reserve::Never);\n+ Item.Modify();\n+\n+ // [GIVEN] Create and Post Item Journal Line\n+ CreateAndPostItemJournalLine(Item.\"No.\", LocationA.Code, '');\n+\n+ // [GIVEN] Create a Direct Transfer Order from Location \"A\" to location \"B\" and Reserve From Inventory\n+ CreateDirectTransferHeader(TransferHeader, LocationA.code, LocationB.Code);\n+ TransferHeader.Validate(\"Posting Date\", WorkDate());\n+ TransferHeader.Modify(true);\n+\n+ // [WHEN] Create transfer line with Item with Reserve set as Never and Show Reservation\n+ LibraryWarehouse.CreateTransferLine(TransferHeader, TransferLine, Item.\"No.\", 10);\n+ TransferLine.Validate(\"Qty. to Ship\", 0);\n+ TransferLine.Modify();\n+ asserterror TransferLine.ShowReservation();\n+\n+ // [THEN] Verify Reserve must not be Never error\n+ Assert.ExpectedErrorCode('TestField');\n+ Assert.ExpectedError(ReserveMustNotBeNeverErr);\n+ end;\n+\n local procedure PostWhseShipmentFromTO(DocumentNo: Code[20])\n var\n WhseShipmentLine: Record \"Warehouse Shipment Line\";\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Inventory/Transfer/TransferLine.Table.al b/App/Layers/W1/BaseApp/Inventory/Transfer/TransferLine.Table.al\nindex 9ab054c5f5c3..d012f240926e 100644\n--- a/App/Layers/W1/BaseApp/Inventory/Transfer/TransferLine.Table.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Transfer/TransferLine.Table.al\n@@ -1592,6 +1592,8 @@ table 5741 \"Transfer Line\"\n exit;\n \n TestField(\"Item No.\");\n+ Item.Get(\"Item No.\");\n+ if \"Qty. to Ship\" > 0 then\n+ Item.TestField(Reserve);\n Clear(Reservation);\n OptionNumber := StrMenu(Text011);\n if OptionNumber > 0 then begin\n"} +{"instance_id": "microsoftInternal__NAV-216057__cf-1", "base_instance_id": "microsoftInternal__NAV-216057", "variant_description": "Surplus duplication prevented only when Planning Flexibility = None", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-216057__cf-1", "FAIL_TO_PASS": [{"codeunitID": 137045, "functionName": ["NoDuplicateSurplusReservationEntriesOnRecalculateRequisitionWorksheet"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMBugfixes.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMBugfixes.Codeunit.al\nindex 70fa87435bd0..c841fa564264 100644\n--- a/App/Layers/W1/Tests/SCM/SCMBugfixes.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMBugfixes.Codeunit.al\n@@ -1038,6 +1038,62 @@ codeunit 137045 \"SCM Bugfixes\"\n Assert.AreEqual(4, ActualCount, AssemblyCommentLineErr);\n end;\n \n+ [Test]\n+ [HandlerFunctions('ItemTrackingLinesModalPageHandler')]\n+ procedure NoDuplicateSurplusReservationEntriesOnRecalculateRequisitionWorksheet()\n+ var\n+ Item: Record Item;\n+ SalesHeader: Record \"Sales Header\";\n+ SalesLine: Record \"Sales Line\";\n+ Vendor: Record Vendor;\n+ RequisitionLine: Record \"Requisition Line\";\n+ RequisitionWkshName: Record \"Requisition Wksh. Name\";\n+ PurchaseHeader: Record \"Purchase Header\";\n+ NewPurchOrderChoice: Option \" \",\"Make Purch. Orders\",\"Make Purch. Orders & Print\",\"Copy to Req. Wksh\";\n+ Qty: Decimal;\n+ begin\n+ // [SCENARIO 575040] When recalculating an item in a requisition or planning worksheet with no planning results lead to wrong surplus entries in the reservation table whic are added to the item tracking page.\n+ Initialize();\n+\n+ // [GIVEN] Created Lot Tracked Item with Reordering Policy:Lot-for-Lot.\n+ CreateTrackedItem(Item);\n+\n+ // [GIVEN] Created Sales Order with 1 Item and 100 quantity.\n+ Qty := 100;\n+ LibrarySales.CreateSalesHeader(SalesHeader, SalesHeader.\"Document Type\"::Order, '');\n+ LibrarySales.CreateSalesLine(SalesLine, SalesHeader, SalesLine.Type::Item, Item.\"No.\", Qty);\n+ LibrarySales.ReleaseSalesDocument(SalesHeader);\n+\n+ // [GIVEN] Calculate requisition plan\n+ CalculateRequisitionPlan(RequisitionWkshName, Item);\n+\n+ // [GIVEN] Find Requisition Line\n+ FindRequisitionLine(RequisitionLine, RequisitionWkshName, RequisitionLine.\"Action Message\"::New);\n+\n+ // [GIVEN] Update Vendor No., Planning Flexibility with None and change the quantity to 150\n+ RequisitionLine.Validate(\"Vendor No.\", LibraryPurchase.CreateVendor(Vendor));\n+ RequisitionLine.Validate(\"Planning Flexibility\", RequisitionLine.\"Planning Flexibility\"::Unlimited);\n+ RequisitionLine.Validate(Quantity, 150);\n+ RequisitionLine.Modify(true);\n+\n+ // [GIVEN] Assign the Lot On Item tracking Line\n+ RequisitionLine.OpenItemTrackingLines();\n+\n+ // [GIVEN] Set \"Accept Action Message\" on all Requisition lines.\n+ LibraryPlanning.CarryOutPlanWksh(RequisitionLine, 0, NewPurchOrderChoice::\"Make Purch. Orders\", 0, 0, '', '', '', '');\n+\n+ // [GIVEN] Check at reservation entries for Purchase Order created, only 2 reservation entries should exist for the PO\n+ PurchaseHeader.SetRange(\"Buy-from Vendor No.\", Vendor.\"No.\");\n+ PurchaseHeader.FindLast();\n+ AssertReservationEntryCount(PurchaseHeader, 2);\n+\n+ // [WHEN] Calculate Plan again for same item from requisition worksheet\n+ CalculateRequisitionPlan(RequisitionWkshName, Item);\n+\n+ // [THEN] After recalculation, a new reservation entry should NOT be created for the PO\n+ AssertReservationEntryCount(PurchaseHeader, 2);\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n@@ -1740,6 +1796,15 @@ codeunit 137045 \"SCM Bugfixes\"\n CalculatePlanPlanWksh.RunModal();\n end;\n \n+ local procedure AssertReservationEntryCount(PurchaseHeader: Record \"Purchase Header\"; ExpectedCount: Integer)\n+ var\n+ ReservationEntry: Record \"Reservation Entry\";\n+ begin\n+ ReservationEntry.SetRange(\"Source Type\", Database::\"Purchase Line\");\n+ ReservationEntry.SetRange(\"Source ID\", PurchaseHeader.\"No.\");\n+ Assert.RecordCount(ReservationEntry, ExpectedCount);\n+ end;\n+\n [ModalPageHandler]\n [Scope('OnPrem')]\n procedure ContactListModalPageHandler(var ContactLookup: Page \"Contact List\"; var Response: Action)\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Inventory/Tracking/ReservationEntry.Table.al b/App/Layers/W1/BaseApp/Inventory/Tracking/ReservationEntry.Table.al\nindex ca1799815e42..c1b41b1585bc 100644\n--- a/App/Layers/W1/BaseApp/Inventory/Tracking/ReservationEntry.Table.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Tracking/ReservationEntry.Table.al\n@@ -11,6 +11,7 @@ using Microsoft.Inventory.Journal;\n using Microsoft.Inventory.Ledger;\n using Microsoft.Inventory.Location;\n using Microsoft.Inventory.Requisition;\n+using Microsoft.Purchases.Document;\n using Microsoft.Sales.Document;\n using Microsoft.Utilities;\n using Microsoft.Warehouse.Activity;\n@@ -1021,6 +1022,10 @@ table 337 \"Reservation Entry\"\n CreateReservEntry.TransferReservEntry(\n SourceType, SourceSubtype, SourceID, SourceBatchName, SourceProdOrderLine, SourceRefNo,\n QtyPerUOM, OldReservEntry, TransferQty);\n+\n+ if (OldReservEntry.\"Reservation Status\" = OldReservEntry.\"Reservation Status\"::Prospect) and (SourceType = Database::\"Purchase Line\") and (SourceSubtype in [1, 2]) and (RequisitionLine.\"Planning Flexibility\" = RequisitionLine.\"Planning Flexibility\"::None) then\n+ ChangeReservationStatusToSurplus(SourceType, SourceSubtype, SourceID, SourceRefNo);\n+\n OnTransferReservationsOnAfterSecondOldReservEntryLoop(OldReservEntry, NewReservEntry, SourceType, SourceSubtype, SourceID);\n until (OldReservEntry.Next() = 0) or (TransferQty = 0);\n end;\n@@ -1125,6 +1130,18 @@ table 337 \"Reservation Entry\"\n OnUpdateSourceCost(Rec, UnitCost);\n end;\n \n+ local procedure ChangeReservationStatusToSurplus(SourceType: Integer; SourceSubtype: Option; SourceID: Code[20]; SourceRefNo: Integer)\n+ var\n+ NewReservationEntry: Record \"Reservation Entry\";\n+ begin\n+ NewReservationEntry.SetSourceFilter(SourceType, SourceSubtype, SourceID, SourceRefNo, true);\n+ NewReservationEntry.SetRange(\"Reservation Status\", NewReservationEntry.\"Reservation Status\"::Prospect);\n+ if NewReservationEntry.FindFirst() then begin\n+ NewReservationEntry.\"Reservation Status\" := NewReservationEntry.\"Reservation Status\"::Surplus;\n+ NewReservationEntry.Modify(true);\n+ end;\n+ end;\n+\n [IntegrationEvent(false, false)]\n local procedure OnAfterCopyTrackingFromItemLedgEntry(var ReservationEntry: Record \"Reservation Entry\"; ItemLedgerEntry: Record \"Item Ledger Entry\")\n begin\n"} +{"instance_id": "microsoftInternal__NAV-216057__cf-2", "base_instance_id": "microsoftInternal__NAV-216057", "variant_description": "Surplus duplication prevented only for lot-tracked items", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-216057__cf-2", "FAIL_TO_PASS": [{"codeunitID": 137045, "functionName": ["NoDuplicateSurplusReservationEntriesOnRecalculateRequisitionWorksheet"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMBugfixes.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMBugfixes.Codeunit.al\nindex 70fa87435bd0..c841fa564264 100644\n--- a/App/Layers/W1/Tests/SCM/SCMBugfixes.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMBugfixes.Codeunit.al\n@@ -1038,6 +1038,62 @@ codeunit 137045 \"SCM Bugfixes\"\n Assert.AreEqual(4, ActualCount, AssemblyCommentLineErr);\n end;\n \n+ [Test]\n+\n+ procedure NoDuplicateSurplusReservationEntriesOnRecalculateRequisitionWorksheet()\n+ var\n+ Item: Record Item;\n+ SalesHeader: Record \"Sales Header\";\n+ SalesLine: Record \"Sales Line\";\n+ Vendor: Record Vendor;\n+ RequisitionLine: Record \"Requisition Line\";\n+ RequisitionWkshName: Record \"Requisition Wksh. Name\";\n+ PurchaseHeader: Record \"Purchase Header\";\n+ NewPurchOrderChoice: Option \" \",\"Make Purch. Orders\",\"Make Purch. Orders & Print\",\"Copy to Req. Wksh\";\n+ Qty: Decimal;\n+ begin\n+ // [SCENARIO 575040] When recalculating an item in a requisition or planning worksheet with no planning results lead to wrong surplus entries in the reservation table whic are added to the item tracking page.\n+ Initialize();\n+\n+ // [GIVEN] Created Item (non-tracked) with Reordering Policy:Lot-for-Lot.\n+ LibraryInventory.CreateItem(Item);\n+\n+ // [GIVEN] Created Sales Order with 1 Item and 100 quantity.\n+ Qty := 100;\n+ LibrarySales.CreateSalesHeader(SalesHeader, SalesHeader.\"Document Type\"::Order, '');\n+ LibrarySales.CreateSalesLine(SalesLine, SalesHeader, SalesLine.Type::Item, Item.\"No.\", Qty);\n+ LibrarySales.ReleaseSalesDocument(SalesHeader);\n+\n+ // [GIVEN] Calculate requisition plan\n+ CalculateRequisitionPlan(RequisitionWkshName, Item);\n+\n+ // [GIVEN] Find Requisition Line\n+ FindRequisitionLine(RequisitionLine, RequisitionWkshName, RequisitionLine.\"Action Message\"::New);\n+\n+ // [GIVEN] Update Vendor No., Planning Flexibility with None and change the quantity to 150\n+ RequisitionLine.Validate(\"Vendor No.\", LibraryPurchase.CreateVendor(Vendor));\n+ RequisitionLine.Validate(\"Planning Flexibility\", RequisitionLine.\"Planning Flexibility\"::None);\n+ RequisitionLine.Validate(Quantity, 150);\n+ RequisitionLine.Modify(true);\n+\n+\n+\n+ // [GIVEN] Set \"Accept Action Message\" on all Requisition lines.\n+ LibraryPlanning.CarryOutPlanWksh(RequisitionLine, 0, NewPurchOrderChoice::\"Make Purch. Orders\", 0, 0, '', '', '', '');\n+\n+ // [GIVEN] Check at reservation entries for Purchase Order created, only 2 reservation entries should exist for the PO\n+ PurchaseHeader.SetRange(\"Buy-from Vendor No.\", Vendor.\"No.\");\n+ PurchaseHeader.FindLast();\n+ AssertReservationEntryCount(PurchaseHeader, 2);\n+\n+ // [WHEN] Calculate Plan again for same item from requisition worksheet\n+ CalculateRequisitionPlan(RequisitionWkshName, Item);\n+\n+ // [THEN] After recalculation, a new reservation entry should NOT be created for the PO\n+ AssertReservationEntryCount(PurchaseHeader, 2);\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n@@ -1740,6 +1796,15 @@ codeunit 137045 \"SCM Bugfixes\"\n CalculatePlanPlanWksh.RunModal();\n end;\n \n+ local procedure AssertReservationEntryCount(PurchaseHeader: Record \"Purchase Header\"; ExpectedCount: Integer)\n+ var\n+ ReservationEntry: Record \"Reservation Entry\";\n+ begin\n+ ReservationEntry.SetRange(\"Source Type\", Database::\"Purchase Line\");\n+ ReservationEntry.SetRange(\"Source ID\", PurchaseHeader.\"No.\");\n+ Assert.RecordCount(ReservationEntry, ExpectedCount);\n+ end;\n+\n [ModalPageHandler]\n [Scope('OnPrem')]\n procedure ContactListModalPageHandler(var ContactLookup: Page \"Contact List\"; var Response: Action)\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Inventory/Tracking/ReservationEntry.Table.al b/App/Layers/W1/BaseApp/Inventory/Tracking/ReservationEntry.Table.al\nindex ca1799815e42..c1b41b1585bc 100644\n--- a/App/Layers/W1/BaseApp/Inventory/Tracking/ReservationEntry.Table.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Tracking/ReservationEntry.Table.al\n@@ -11,6 +11,7 @@ using Microsoft.Inventory.Journal;\n using Microsoft.Inventory.Ledger;\n using Microsoft.Inventory.Location;\n using Microsoft.Inventory.Requisition;\n+using Microsoft.Purchases.Document;\n using Microsoft.Sales.Document;\n using Microsoft.Utilities;\n using Microsoft.Warehouse.Activity;\n@@ -1021,6 +1022,10 @@ table 337 \"Reservation Entry\"\n CreateReservEntry.TransferReservEntry(\n SourceType, SourceSubtype, SourceID, SourceBatchName, SourceProdOrderLine, SourceRefNo,\n QtyPerUOM, OldReservEntry, TransferQty);\n+\n+ if (OldReservEntry.\"Reservation Status\" = OldReservEntry.\"Reservation Status\"::Prospect) and (SourceType = Database::\"Purchase Line\") and (SourceSubtype in [1, 2]) and (ItemTrackingMgt.IsTrackingRequired(\"Item No.\")) then\n+ ChangeReservationStatusToSurplus(SourceType, SourceSubtype, SourceID, SourceRefNo);\n+\n OnTransferReservationsOnAfterSecondOldReservEntryLoop(OldReservEntry, NewReservEntry, SourceType, SourceSubtype, SourceID);\n until (OldReservEntry.Next() = 0) or (TransferQty = 0);\n end;\n@@ -1125,6 +1130,18 @@ table 337 \"Reservation Entry\"\n OnUpdateSourceCost(Rec, UnitCost);\n end;\n \n+ local procedure ChangeReservationStatusToSurplus(SourceType: Integer; SourceSubtype: Option; SourceID: Code[20]; SourceRefNo: Integer)\n+ var\n+ NewReservationEntry: Record \"Reservation Entry\";\n+ begin\n+ NewReservationEntry.SetSourceFilter(SourceType, SourceSubtype, SourceID, SourceRefNo, true);\n+ NewReservationEntry.SetRange(\"Reservation Status\", NewReservationEntry.\"Reservation Status\"::Prospect);\n+ if NewReservationEntry.FindFirst() then begin\n+ NewReservationEntry.\"Reservation Status\" := NewReservationEntry.\"Reservation Status\"::Surplus;\n+ NewReservationEntry.Modify(true);\n+ end;\n+ end;\n+\n [IntegrationEvent(false, false)]\n local procedure OnAfterCopyTrackingFromItemLedgEntry(var ReservationEntry: Record \"Reservation Entry\"; ItemLedgerEntry: Record \"Item Ledger Entry\")\n begin\n"} +{"instance_id": "microsoftInternal__NAV-216057__cf-3", "base_instance_id": "microsoftInternal__NAV-216057", "variant_description": "Surplus duplication prevented only during initial planning, not during recalculation", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-216057__cf-3", "FAIL_TO_PASS": [{"codeunitID": 137045, "functionName": ["NoDuplicateSurplusReservationEntriesOnRecalculateRequisitionWorksheet"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMBugfixes.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMBugfixes.Codeunit.al\nindex 70fa87435bd0..c841fa564264 100644\n--- a/App/Layers/W1/Tests/SCM/SCMBugfixes.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMBugfixes.Codeunit.al\n@@ -1038,6 +1038,62 @@ codeunit 137045 \"SCM Bugfixes\"\n Assert.AreEqual(4, ActualCount, AssemblyCommentLineErr);\n end;\n \n+ [Test]\n+ [HandlerFunctions('ItemTrackingLinesModalPageHandler')]\n+ procedure NoDuplicateSurplusReservationEntriesOnRecalculateRequisitionWorksheet()\n+ var\n+ Item: Record Item;\n+ SalesHeader: Record \"Sales Header\";\n+ SalesLine: Record \"Sales Line\";\n+ Vendor: Record Vendor;\n+ RequisitionLine: Record \"Requisition Line\";\n+ RequisitionWkshName: Record \"Requisition Wksh. Name\";\n+ PurchaseHeader: Record \"Purchase Header\";\n+ NewPurchOrderChoice: Option \" \",\"Make Purch. Orders\",\"Make Purch. Orders & Print\",\"Copy to Req. Wksh\";\n+ Qty: Decimal;\n+ begin\n+ // [SCENARIO 575040] When recalculating an item in a requisition or planning worksheet with no planning results lead to wrong surplus entries in the reservation table whic are added to the item tracking page.\n+ Initialize();\n+\n+ // [GIVEN] Created Lot Tracked Item with Reordering Policy:Lot-for-Lot.\n+ CreateTrackedItem(Item);\n+\n+ // [GIVEN] Created Sales Order with 1 Item and 100 quantity.\n+ Qty := 100;\n+ LibrarySales.CreateSalesHeader(SalesHeader, SalesHeader.\"Document Type\"::Order, '');\n+ LibrarySales.CreateSalesLine(SalesLine, SalesHeader, SalesLine.Type::Item, Item.\"No.\", Qty);\n+ LibrarySales.ReleaseSalesDocument(SalesHeader);\n+\n+ // [GIVEN] Calculate requisition plan\n+ CalculateRequisitionPlan(RequisitionWkshName, Item);\n+\n+ // [GIVEN] Find Requisition Line\n+ FindRequisitionLine(RequisitionLine, RequisitionWkshName, RequisitionLine.\"Action Message\"::New);\n+\n+ // [GIVEN] Update Vendor No., Planning Flexibility with None and change the quantity to 150\n+ RequisitionLine.Validate(\"Vendor No.\", LibraryPurchase.CreateVendor(Vendor));\n+ RequisitionLine.Validate(\"Planning Flexibility\", RequisitionLine.\"Planning Flexibility\"::None);\n+ RequisitionLine.Validate(Quantity, 150);\n+ RequisitionLine.Modify(true);\n+\n+ // [GIVEN] Assign the Lot On Item tracking Line\n+ RequisitionLine.OpenItemTrackingLines();\n+\n+ // [GIVEN] Set \"Accept Action Message\" on all Requisition lines.\n+ LibraryPlanning.CarryOutPlanWksh(RequisitionLine, 0, NewPurchOrderChoice::\"Make Purch. Orders\", 0, 0, '', '', '', '');\n+\n+ // [GIVEN] Check at reservation entries for Purchase Order created, only 2 reservation entries should exist for the PO\n+ PurchaseHeader.SetRange(\"Buy-from Vendor No.\", Vendor.\"No.\");\n+ PurchaseHeader.FindLast();\n+ AssertReservationEntryCount(PurchaseHeader, 2);\n+\n+ // [WHEN] Calculate Plan again for same item from requisition worksheet\n+ CalculateRequisitionPlan(RequisitionWkshName, Item);\n+\n+ // [THEN] After recalculation, a new reservation entry IS allowed\n+ AssertReservationEntryCount(PurchaseHeader, 3);\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n@@ -1740,6 +1796,15 @@ codeunit 137045 \"SCM Bugfixes\"\n CalculatePlanPlanWksh.RunModal();\n end;\n \n+ local procedure AssertReservationEntryCount(PurchaseHeader: Record \"Purchase Header\"; ExpectedCount: Integer)\n+ var\n+ ReservationEntry: Record \"Reservation Entry\";\n+ begin\n+ ReservationEntry.SetRange(\"Source Type\", Database::\"Purchase Line\");\n+ ReservationEntry.SetRange(\"Source ID\", PurchaseHeader.\"No.\");\n+ Assert.RecordCount(ReservationEntry, ExpectedCount);\n+ end;\n+\n [ModalPageHandler]\n [Scope('OnPrem')]\n procedure ContactListModalPageHandler(var ContactLookup: Page \"Contact List\"; var Response: Action)\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Inventory/Tracking/ReservationEntry.Table.al b/App/Layers/W1/BaseApp/Inventory/Tracking/ReservationEntry.Table.al\nindex ca1799815e42..c1b41b1585bc 100644\n--- a/App/Layers/W1/BaseApp/Inventory/Tracking/ReservationEntry.Table.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Tracking/ReservationEntry.Table.al\n@@ -11,6 +11,7 @@ using Microsoft.Inventory.Journal;\n using Microsoft.Inventory.Ledger;\n using Microsoft.Inventory.Location;\n using Microsoft.Inventory.Requisition;\n+using Microsoft.Purchases.Document;\n using Microsoft.Sales.Document;\n using Microsoft.Utilities;\n using Microsoft.Warehouse.Activity;\n@@ -1021,6 +1022,10 @@ table 337 \"Reservation Entry\"\n CreateReservEntry.TransferReservEntry(\n SourceType, SourceSubtype, SourceID, SourceBatchName, SourceProdOrderLine, SourceRefNo,\n QtyPerUOM, OldReservEntry, TransferQty);\n+\n+ if (OldReservEntry.\"Reservation Status\" = OldReservEntry.\"Reservation Status\"::Prospect) and (SourceType = Database::\"Purchase Line\") and (SourceSubtype in [1, 2]) and not IsRecalculationContext() then\n+ ChangeReservationStatusToSurplus(SourceType, SourceSubtype, SourceID, SourceRefNo);\n+\n OnTransferReservationsOnAfterSecondOldReservEntryLoop(OldReservEntry, NewReservEntry, SourceType, SourceSubtype, SourceID);\n until (OldReservEntry.Next() = 0) or (TransferQty = 0);\n end;\n@@ -1125,6 +1130,18 @@ table 337 \"Reservation Entry\"\n OnUpdateSourceCost(Rec, UnitCost);\n end;\n \n+ local procedure ChangeReservationStatusToSurplus(SourceType: Integer; SourceSubtype: Option; SourceID: Code[20]; SourceRefNo: Integer)\n+ var\n+ NewReservationEntry: Record \"Reservation Entry\";\n+ begin\n+ NewReservationEntry.SetSourceFilter(SourceType, SourceSubtype, SourceID, SourceRefNo, true);\n+ NewReservationEntry.SetRange(\"Reservation Status\", NewReservationEntry.\"Reservation Status\"::Prospect);\n+ if NewReservationEntry.FindFirst() then begin\n+ NewReservationEntry.\"Reservation Status\" := NewReservationEntry.\"Reservation Status\"::Surplus;\n+ NewReservationEntry.Modify(true);\n+ end;\n+ end;\n+\n [IntegrationEvent(false, false)]\n local procedure OnAfterCopyTrackingFromItemLedgEntry(var ReservationEntry: Record \"Reservation Entry\"; ItemLedgerEntry: Record \"Item Ledger Entry\")\n begin\n"} +{"instance_id": "microsoftInternal__NAV-216572__cf-1", "base_instance_id": "microsoftInternal__NAV-216572", "variant_description": "Dimensions imported only when Allocation % > 0", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-216572__cf-1", "FAIL_TO_PASS": [{"codeunitID": 134227, "functionName": ["CheckDimensionOfRecurringJournalImportAllocationFromAllocationAccount"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/ERMPostRecurringJournal.Codeunit.al b/App/Layers/W1/Tests/ERM/ERMPostRecurringJournal.Codeunit.al\nindex ff710ce5b0e2..aa89a458bd93 100644\n--- a/App/Layers/W1/Tests/ERM/ERMPostRecurringJournal.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ERMPostRecurringJournal.Codeunit.al\n@@ -19,6 +19,7 @@ codeunit 134227 \"ERM PostRecurringJournal\"\n LibrarySetupStorage: Codeunit \"Library - Setup Storage\";\n LibraryPurchase: Codeunit \"Library - Purchase\";\n LibrarySales: Codeunit \"Library - Sales\";\n+ LibraryDimension: Codeunit \"Library - Dimension\";\n LibraryTestInitialize: Codeunit \"Library - Test Initialize\";\n GenJnlDocType: Enum \"Gen. Journal Document Type\";\n GenJnlAccountType: Enum \"Gen. Journal Account Type\";\n@@ -31,6 +32,7 @@ codeunit 134227 \"ERM PostRecurringJournal\"\n SkippedLineMsg: Label 'One or more lines has not been posted because the amount is zero.';\n DocumentOutOfBalanceErr: Label 'Document No. %1 is out of balance', Locked = true;\n AllocAccountImportWrongAccTypeErr: Label 'Import from Allocation Account is only allowed for G/L Account Destination account type.', Locked = true;\n+ AllocationDimensionErr: Label 'Allocation dimension is not correct';\n \n [Test]\n [Scope('OnPrem')]\n@@ -1298,6 +1300,48 @@ codeunit 134227 \"ERM PostRecurringJournal\"\n \n end;\n \n+ [Test]\n+ [HandlerFunctions('HandleEditDimensionSetEntriesPage,AllocationAccountListPageHandler,ConfirmHandlerYes')]\n+ procedure CheckDimensionOfRecurringJournalImportAllocationFromAllocationAccount()\n+ var\n+ AllocationAccount: Record \"Allocation Account\";\n+ FirstDimensionValue: Record \"Dimension Value\";\n+ GenJnlAllocation: Record \"Gen. Jnl. Allocation\";\n+ GenJournalBatch: Record \"Gen. Journal Batch\";\n+ GenJournalLine: Record \"Gen. Journal Line\";\n+ SecondDimensionValue: Record \"Dimension Value\";\n+ GLAccounts: array[2] of Record \"G/L Account\";\n+ AllocationShares: array[2] of Decimal;\n+ DimensionSetID: array[2] of Integer;\n+ begin\n+ // [SCENARIO 579186] In Recurring General Journals Import from Allocation Accounts does not import dimensions.\n+ Initialize();\n+\n+ // [GIVEN] Create Recurring General Journal Batch.\n+ CreateRecurringGenJournalBatch(GenJournalBatch);\n+\n+ // [GIVEN] Create Recurring Journal with a line.\n+ CreateRecurringJnlLine(GenJournalLine, GenJournalBatch, WorkDate(), 0D, LibraryRandom.RandInt(10));\n+\n+ // [GIVEN] Create allocation for general journal line.\n+ LibraryERM.CreateGenJnlAllocation(GenJnlAllocation, GenJournalLine.\"Journal Template Name\", GenJournalLine.\"Journal Batch Name\", GenJournalLine.\"Line No.\");\n+\n+ // [GIVEN] Dimension With Value.\n+ CreateDimensionsWithValues(FirstDimensionValue, SecondDimensionValue);\n+\n+ // [GIVEN] Allocation Account \"XXX\" with 2 lines exists for different G/L Accounts and different Allocation Shares with Dimension.\n+ CreateAllocationAccountWithTwoGLAccLines(AllocationAccount, GLAccounts, AllocationShares, FirstDimensionValue, SecondDimensionValue, DimensionSetID);\n+\n+ // [WHEN] Invoke Import from Allocation Account. Handler chooses Allocation Account \"XXX\" in lookup\n+ LibraryVariableStorage.Enqueue(AllocationAccount.\"No.\");\n+ GenJnlAllocation.ChooseAndImportFromAllocationAccount();\n+ // UI Handled by handler\n+\n+ // [THEN] There are 2 Gen Journal Allocations with the same Dimension as in Allocation Account\n+ VerifyGenJnlAllocationDimension(GenJnlAllocation, GenJournalLine, GLAccounts[1], DimensionSetID[1]);\n+ VerifyGenJnlAllocationDimension(GenJnlAllocation, GenJournalLine, GLAccounts[2], DimensionSetID[2]);\n+ end;\n+\n local procedure Initialize()\n begin\n LibraryTestInitialize.OnTestInitialize(Codeunit::\"ERM PostRecurringJournal\");\n@@ -1769,6 +1813,79 @@ codeunit 134227 \"ERM PostRecurringJournal\"\n VendorLedgerEntry.TestField(\"Due Date\", PostingDate + 1);\n end;\n \n+ local procedure CreateDimensionsWithValues(var FirstDimensionValue: Record \"Dimension Value\"; var SecondDimensionValue: Record \"Dimension Value\")\n+ var\n+ Dimension: Record Dimension;\n+ begin\n+ LibraryDimension.CreateDimension(Dimension);\n+ LibraryDimension.CreateDimensionValue(FirstDimensionValue, Dimension.Code);\n+ LibraryDimension.CreateDimensionValue(SecondDimensionValue, Dimension.Code);\n+ end;\n+\n+ local procedure CreateAllocationAccountWithTwoGLAccLines(var AllocationAccount: Record \"Allocation Account\"; var GLAccounts: array[2] of Record \"G/L Account\"; var AllocationShares: array[2] of Decimal; FirstDimensionValue: Record \"Dimension Value\"; SecondDimensionValue: Record \"Dimension Value\"; var DimensionSetID: array[2] of Integer)\n+ var\n+ AllocAccountDistribution: Record \"Alloc. Account Distribution\";\n+ AllocationAccountPage: TestPage \"Allocation Account\";\n+ FixedAllocationAccountCode: Code[20];\n+ begin\n+ FixedAllocationAccountCode := CreateAllocationAccountWithFixedDistribution(AllocationAccountPage);\n+ AddGLDestinationAccountForFixedDistributionWithDimension(AllocationAccountPage, GLAccounts[1]);\n+ AllocationShares[1] := 0;\n+ AllocationAccountPage.FixedAccountDistribution.Share.SetValue(AllocationShares[1]);\n+ SetDimensionToCurrentVariableLine(AllocationAccountPage, FirstDimensionValue);\n+\n+ AllocAccountDistribution.SetRange(\"Allocation Account No.\", FixedAllocationAccountCode);\n+ AllocAccountDistribution.SetRange(\"Account Type\", AllocAccountDistribution.\"Account Type\"::Fixed);\n+ AllocAccountDistribution.SetRange(\"Destination Account Number\", GLAccounts[1].\"No.\");\n+ AllocAccountDistribution.FindFirst();\n+ DimensionSetID[1] := AllocAccountDistribution.\"Dimension Set ID\";\n+\n+ AllocationAccountPage.FixedAccountDistribution.New();\n+ AddGLDestinationAccountForFixedDistributionWithDimension(AllocationAccountPage, GLAccounts[2]);\n+ AllocationShares[2] := 0;\n+ AllocationAccountPage.FixedAccountDistribution.Share.SetValue(AllocationShares[2]);\n+ SetDimensionToCurrentVariableLine(AllocationAccountPage, SecondDimensionValue);\n+\n+ AllocAccountDistribution.Reset();\n+ AllocAccountDistribution.SetRange(\"Allocation Account No.\", FixedAllocationAccountCode);\n+ AllocAccountDistribution.SetRange(\"Account Type\", AllocAccountDistribution.\"Account Type\"::Fixed);\n+ AllocAccountDistribution.SetRange(\"Destination Account Number\", GLAccounts[2].\"No.\");\n+ AllocAccountDistribution.FindFirst();\n+ AllocationAccountPage.FixedAccountDistribution.GoToRecord(AllocAccountDistribution);\n+ DimensionSetID[2] := AllocAccountDistribution.\"Dimension Set ID\";\n+\n+ AllocationAccountPage.Close();\n+\n+ AllocationAccount.Get(FixedAllocationAccountCode);\n+ end;\n+\n+ local procedure SetDimensionToCurrentVariableLine(var AllocationAcccount: TestPage \"Allocation Account\"; var DimensionValue: Record \"Dimension Value\")\n+ begin\n+ LibraryVariableStorage.Enqueue(DimensionValue.SystemId);\n+ AllocationAcccount.FixedAccountDistribution.Dimensions.Invoke();\n+ end;\n+\n+ local procedure AddGLDestinationAccountForFixedDistributionWithDimension(var AllocationAccountPage: TestPage \"Allocation Account\"; var GLAccount: Record \"G/L Account\")\n+ var\n+ DummyAllocAccountDistribution: Record \"Alloc. Account Distribution\";\n+ begin\n+ if GLAccount.\"No.\" = '' then\n+ GLAccount.Get(LibraryERM.CreateGLAccountNoWithDirectPosting());\n+\n+ AllocationAccountPage.FixedAccountDistribution.\"Destination Account Type\".SetValue(DummyAllocAccountDistribution.\"Destination Account Type\"::\"G/L Account\");\n+ AllocationAccountPage.FixedAccountDistribution.\"Destination Account Number\".SetValue(GLAccount.\"No.\");\n+ end;\n+\n+ local procedure VerifyGenJnlAllocationDimension(GenJnlAllocation: Record \"Gen. Jnl. Allocation\"; GenJournalLine: Record \"Gen. Journal Line\"; GLAccount: Record \"G/L Account\"; DimensionSetID: Integer)\n+ begin\n+ GenJnlAllocation.SetRange(\"Journal Template Name\", GenJournalLine.\"Journal Template Name\");\n+ GenJnlAllocation.SetRange(\"Journal Batch Name\", GenJournalLine.\"Journal Batch Name\");\n+ GenJnlAllocation.SetRange(\"Journal Line No.\", GenJournalLine.\"Line No.\");\n+ GenJnlAllocation.SetRange(\"Account No.\", GLAccount.\"No.\");\n+ GenJnlAllocation.FindFirst();\n+ Assert.AreEqual(GenJnlAllocation.\"Dimension Set ID\", DimensionSetID, AllocationDimensionErr);\n+ end;\n+\n [ConfirmHandler]\n [Scope('OnPrem')]\n procedure ConfirmHandlerYes(Question: Text[1024]; var Reply: Boolean)\n@@ -1821,5 +1938,19 @@ codeunit 134227 \"ERM PostRecurringJournal\"\n NameValueBuffer.ID := LibraryUtility.GetNewRecNo(NameValueBuffer, NameValueBuffer.FieldNo(ID));\n NameValueBuffer.Insert();\n end;\n+\n+ [ModalPageHandler]\n+ procedure HandleEditDimensionSetEntriesPage(var EditDimensionSetEntriesPage: TestPage \"Edit Dimension Set Entries\")\n+ var\n+ DimensionValue: Record \"Dimension Value\";\n+ DimensionValueSystemId: Text;\n+ begin\n+ DimensionValueSystemId := LibraryVariableStorage.DequeueText();\n+ DimensionValue.GetBySystemId(DimensionValueSystemId);\n+ EditDimensionSetEntriesPage.New();\n+ EditDimensionSetEntriesPage.\"Dimension Code\".SetValue(DimensionValue.\"Dimension Code\");\n+ EditDimensionSetEntriesPage.DimensionValueCode.SetValue(DimensionValue.Code);\n+ EditDimensionSetEntriesPage.OK().Invoke();\n+ end;\n }\n \n", "patch": "diff --git a/App/Layers/W1/BaseApp/Finance/GeneralLedger/Journal/GenJnlAllocation.Table.al b/App/Layers/W1/BaseApp/Finance/GeneralLedger/Journal/GenJnlAllocation.Table.al\nindex 130b3e0f3456..7a287e4fb7f1 100644\n--- a/App/Layers/W1/BaseApp/Finance/GeneralLedger/Journal/GenJnlAllocation.Table.al\n+++ b/App/Layers/W1/BaseApp/Finance/GeneralLedger/Journal/GenJnlAllocation.Table.al\n@@ -669,6 +669,10 @@ table 221 \"Gen. Jnl. Allocation\"\n begin\n Rec.Validate(\"Account No.\", AllocAccountDistribution.\"Destination Account Number\");\n Rec.Validate(\"Allocation %\", AllocAccountDistribution.Percent);\n+ Rec.Validate(\"Shortcut Dimension 1 Code\", AllocAccountDistribution.\"Global Dimension 1 Code\");\n+ Rec.Validate(\"Shortcut Dimension 2 Code\", AllocAccountDistribution.\"Global Dimension 2 Code\");\n+ if AllocAccountDistribution.Percent > 0 then\n+ Rec.Validate(\"Dimension Set ID\", AllocAccountDistribution.\"Dimension Set ID\");\n+ Rec.Modify(true);\n end;\n \n local procedure CheckGLAccount(var GLAccount: Record \"G/L Account\")\n"} +{"instance_id": "microsoftInternal__NAV-216572__cf-2", "base_instance_id": "microsoftInternal__NAV-216572", "variant_description": "Dimensions imported only for G/L Account destination type lines", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-216572__cf-2", "FAIL_TO_PASS": [{"codeunitID": 134227, "functionName": ["CheckDimensionOfRecurringJournalImportAllocationFromAllocationAccount"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/ERMPostRecurringJournal.Codeunit.al b/App/Layers/W1/Tests/ERM/ERMPostRecurringJournal.Codeunit.al\nindex ff710ce5b0e2..aa89a458bd93 100644\n--- a/App/Layers/W1/Tests/ERM/ERMPostRecurringJournal.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ERMPostRecurringJournal.Codeunit.al\n@@ -19,6 +19,7 @@ codeunit 134227 \"ERM PostRecurringJournal\"\n LibrarySetupStorage: Codeunit \"Library - Setup Storage\";\n LibraryPurchase: Codeunit \"Library - Purchase\";\n LibrarySales: Codeunit \"Library - Sales\";\n+ LibraryDimension: Codeunit \"Library - Dimension\";\n LibraryTestInitialize: Codeunit \"Library - Test Initialize\";\n GenJnlDocType: Enum \"Gen. Journal Document Type\";\n GenJnlAccountType: Enum \"Gen. Journal Account Type\";\n@@ -31,6 +32,7 @@ codeunit 134227 \"ERM PostRecurringJournal\"\n SkippedLineMsg: Label 'One or more lines has not been posted because the amount is zero.';\n DocumentOutOfBalanceErr: Label 'Document No. %1 is out of balance', Locked = true;\n AllocAccountImportWrongAccTypeErr: Label 'Import from Allocation Account is only allowed for G/L Account Destination account type.', Locked = true;\n+ AllocationDimensionErr: Label 'Allocation dimension is not correct';\n \n [Test]\n [Scope('OnPrem')]\n@@ -1298,6 +1300,48 @@ codeunit 134227 \"ERM PostRecurringJournal\"\n \n end;\n \n+ [Test]\n+ [HandlerFunctions('HandleEditDimensionSetEntriesPage,AllocationAccountListPageHandler,ConfirmHandlerYes')]\n+ procedure CheckDimensionOfRecurringJournalImportAllocationFromAllocationAccount()\n+ var\n+ AllocationAccount: Record \"Allocation Account\";\n+ FirstDimensionValue: Record \"Dimension Value\";\n+ GenJnlAllocation: Record \"Gen. Jnl. Allocation\";\n+ GenJournalBatch: Record \"Gen. Journal Batch\";\n+ GenJournalLine: Record \"Gen. Journal Line\";\n+ SecondDimensionValue: Record \"Dimension Value\";\n+ GLAccounts: array[2] of Record \"G/L Account\";\n+ AllocationShares: array[2] of Decimal;\n+ DimensionSetID: array[2] of Integer;\n+ begin\n+ // [SCENARIO 579186] In Recurring General Journals Import from Allocation Accounts does not import dimensions.\n+ Initialize();\n+\n+ // [GIVEN] Create Recurring General Journal Batch.\n+ CreateRecurringGenJournalBatch(GenJournalBatch);\n+\n+ // [GIVEN] Create Recurring Journal with a line.\n+ CreateRecurringJnlLine(GenJournalLine, GenJournalBatch, WorkDate(), 0D, LibraryRandom.RandInt(10));\n+\n+ // [GIVEN] Create allocation for general journal line.\n+ LibraryERM.CreateGenJnlAllocation(GenJnlAllocation, GenJournalLine.\"Journal Template Name\", GenJournalLine.\"Journal Batch Name\", GenJournalLine.\"Line No.\");\n+\n+ // [GIVEN] Dimension With Value.\n+ CreateDimensionsWithValues(FirstDimensionValue, SecondDimensionValue);\n+\n+ // [GIVEN] Allocation Account \"XXX\" with 2 lines exists for different G/L Accounts and different Allocation Shares with Dimension.\n+ CreateAllocationAccountWithTwoGLAccLines(AllocationAccount, GLAccounts, AllocationShares, FirstDimensionValue, SecondDimensionValue, DimensionSetID);\n+\n+ // [WHEN] Invoke Import from Allocation Account. Handler chooses Allocation Account \"XXX\" in lookup\n+ LibraryVariableStorage.Enqueue(AllocationAccount.\"No.\");\n+ GenJnlAllocation.ChooseAndImportFromAllocationAccount();\n+ // UI Handled by handler\n+\n+ // [THEN] There are 2 Gen Journal Allocations with the same Dimension as in Allocation Account\n+ VerifyGenJnlAllocationDimension(GenJnlAllocation, GenJournalLine, GLAccounts[1], DimensionSetID[1]);\n+ VerifyGenJnlAllocationDimension(GenJnlAllocation, GenJournalLine, GLAccounts[2], DimensionSetID[2]);\n+ end;\n+\n local procedure Initialize()\n begin\n LibraryTestInitialize.OnTestInitialize(Codeunit::\"ERM PostRecurringJournal\");\n@@ -1769,6 +1813,79 @@ codeunit 134227 \"ERM PostRecurringJournal\"\n VendorLedgerEntry.TestField(\"Due Date\", PostingDate + 1);\n end;\n \n+ local procedure CreateDimensionsWithValues(var FirstDimensionValue: Record \"Dimension Value\"; var SecondDimensionValue: Record \"Dimension Value\")\n+ var\n+ Dimension: Record Dimension;\n+ begin\n+ LibraryDimension.CreateDimension(Dimension);\n+ LibraryDimension.CreateDimensionValue(FirstDimensionValue, Dimension.Code);\n+ LibraryDimension.CreateDimensionValue(SecondDimensionValue, Dimension.Code);\n+ end;\n+\n+ local procedure CreateAllocationAccountWithTwoGLAccLines(var AllocationAccount: Record \"Allocation Account\"; var GLAccounts: array[2] of Record \"G/L Account\"; var AllocationShares: array[2] of Decimal; FirstDimensionValue: Record \"Dimension Value\"; SecondDimensionValue: Record \"Dimension Value\"; var DimensionSetID: array[2] of Integer)\n+ var\n+ AllocAccountDistribution: Record \"Alloc. Account Distribution\";\n+ AllocationAccountPage: TestPage \"Allocation Account\";\n+ FixedAllocationAccountCode: Code[20];\n+ begin\n+ FixedAllocationAccountCode := CreateAllocationAccountWithFixedDistribution(AllocationAccountPage);\n+ AddGLDestinationAccountForFixedDistributionWithDimension(AllocationAccountPage, GLAccounts[1]);\n+ AllocationShares[1] := LibraryRandom.RandDecInRange(1, 100, 2);\n+ AllocationAccountPage.FixedAccountDistribution.Share.SetValue(AllocationShares[1]);\n+ SetDimensionToCurrentVariableLine(AllocationAccountPage, FirstDimensionValue);\n+\n+ AllocAccountDistribution.SetRange(\"Allocation Account No.\", FixedAllocationAccountCode);\n+ AllocAccountDistribution.SetRange(\"Account Type\", AllocAccountDistribution.\"Account Type\"::Fixed);\n+ AllocAccountDistribution.SetRange(\"Destination Account Number\", GLAccounts[1].\"No.\");\n+ AllocAccountDistribution.FindFirst();\n+ DimensionSetID[1] := AllocAccountDistribution.\"Dimension Set ID\";\n+\n+ AllocationAccountPage.FixedAccountDistribution.New();\n+ AddGLDestinationAccountForFixedDistributionWithDimension(AllocationAccountPage, GLAccounts[2]);\n+ AllocationShares[2] := LibraryRandom.RandDecInRange(1, 100, 2);\n+ AllocationAccountPage.FixedAccountDistribution.Share.SetValue(AllocationShares[2]);\n+ SetDimensionToCurrentVariableLine(AllocationAccountPage, SecondDimensionValue);\n+\n+ AllocAccountDistribution.Reset();\n+ AllocAccountDistribution.SetRange(\"Allocation Account No.\", FixedAllocationAccountCode);\n+ AllocAccountDistribution.SetRange(\"Account Type\", AllocAccountDistribution.\"Account Type\"::Fixed);\n+ AllocAccountDistribution.SetRange(\"Destination Account Number\", GLAccounts[2].\"No.\");\n+ AllocAccountDistribution.FindFirst();\n+ AllocationAccountPage.FixedAccountDistribution.GoToRecord(AllocAccountDistribution);\n+ DimensionSetID[2] := AllocAccountDistribution.\"Dimension Set ID\";\n+\n+ AllocationAccountPage.Close();\n+\n+ AllocationAccount.Get(FixedAllocationAccountCode);\n+ end;\n+\n+ local procedure SetDimensionToCurrentVariableLine(var AllocationAcccount: TestPage \"Allocation Account\"; var DimensionValue: Record \"Dimension Value\")\n+ begin\n+ LibraryVariableStorage.Enqueue(DimensionValue.SystemId);\n+ AllocationAcccount.FixedAccountDistribution.Dimensions.Invoke();\n+ end;\n+\n+ local procedure AddGLDestinationAccountForFixedDistributionWithDimension(var AllocationAccountPage: TestPage \"Allocation Account\"; var GLAccount: Record \"G/L Account\")\n+ var\n+ DummyAllocAccountDistribution: Record \"Alloc. Account Distribution\";\n+ begin\n+ if GLAccount.\"No.\" = '' then\n+ GLAccount.Get(LibraryERM.CreateGLAccountNoWithDirectPosting());\n+\n+ AllocationAccountPage.FixedAccountDistribution.\"Destination Account Type\".SetValue(DummyAllocAccountDistribution.\"Destination Account Type\"::Customer);\n+ AllocationAccountPage.FixedAccountDistribution.\"Destination Account Number\".SetValue(GLAccount.\"No.\");\n+ end;\n+\n+ local procedure VerifyGenJnlAllocationDimension(GenJnlAllocation: Record \"Gen. Jnl. Allocation\"; GenJournalLine: Record \"Gen. Journal Line\"; GLAccount: Record \"G/L Account\"; DimensionSetID: Integer)\n+ begin\n+ GenJnlAllocation.SetRange(\"Journal Template Name\", GenJournalLine.\"Journal Template Name\");\n+ GenJnlAllocation.SetRange(\"Journal Batch Name\", GenJournalLine.\"Journal Batch Name\");\n+ GenJnlAllocation.SetRange(\"Journal Line No.\", GenJournalLine.\"Line No.\");\n+ GenJnlAllocation.SetRange(\"Account No.\", GLAccount.\"No.\");\n+ GenJnlAllocation.FindFirst();\n+ Assert.AreEqual(GenJnlAllocation.\"Dimension Set ID\", DimensionSetID, AllocationDimensionErr);\n+ end;\n+\n [ConfirmHandler]\n [Scope('OnPrem')]\n procedure ConfirmHandlerYes(Question: Text[1024]; var Reply: Boolean)\n@@ -1821,5 +1938,19 @@ codeunit 134227 \"ERM PostRecurringJournal\"\n NameValueBuffer.ID := LibraryUtility.GetNewRecNo(NameValueBuffer, NameValueBuffer.FieldNo(ID));\n NameValueBuffer.Insert();\n end;\n+\n+ [ModalPageHandler]\n+ procedure HandleEditDimensionSetEntriesPage(var EditDimensionSetEntriesPage: TestPage \"Edit Dimension Set Entries\")\n+ var\n+ DimensionValue: Record \"Dimension Value\";\n+ DimensionValueSystemId: Text;\n+ begin\n+ DimensionValueSystemId := LibraryVariableStorage.DequeueText();\n+ DimensionValue.GetBySystemId(DimensionValueSystemId);\n+ EditDimensionSetEntriesPage.New();\n+ EditDimensionSetEntriesPage.\"Dimension Code\".SetValue(DimensionValue.\"Dimension Code\");\n+ EditDimensionSetEntriesPage.DimensionValueCode.SetValue(DimensionValue.Code);\n+ EditDimensionSetEntriesPage.OK().Invoke();\n+ end;\n }\n \n", "patch": "diff --git a/App/Layers/W1/BaseApp/Finance/GeneralLedger/Journal/GenJnlAllocation.Table.al b/App/Layers/W1/BaseApp/Finance/GeneralLedger/Journal/GenJnlAllocation.Table.al\nindex 130b3e0f3456..7a287e4fb7f1 100644\n--- a/App/Layers/W1/BaseApp/Finance/GeneralLedger/Journal/GenJnlAllocation.Table.al\n+++ b/App/Layers/W1/BaseApp/Finance/GeneralLedger/Journal/GenJnlAllocation.Table.al\n@@ -669,6 +669,10 @@ table 221 \"Gen. Jnl. Allocation\"\n begin\n Rec.Validate(\"Account No.\", AllocAccountDistribution.\"Destination Account Number\");\n Rec.Validate(\"Allocation %\", AllocAccountDistribution.Percent);\n+ Rec.Validate(\"Shortcut Dimension 1 Code\", AllocAccountDistribution.\"Global Dimension 1 Code\");\n+ Rec.Validate(\"Shortcut Dimension 2 Code\", AllocAccountDistribution.\"Global Dimension 2 Code\");\n+ if AllocAccountDistribution.\"Destination Account Type\" = AllocAccountDistribution.\"Destination Account Type\"::\"G/L Account\" then\n+ Rec.Validate(\"Dimension Set ID\", AllocAccountDistribution.\"Dimension Set ID\");\n+ Rec.Modify(true);\n end;\n \n local procedure CheckGLAccount(var GLAccount: Record \"G/L Account\")\n"} +{"instance_id": "microsoftInternal__NAV-216572__cf-3", "base_instance_id": "microsoftInternal__NAV-216572", "variant_description": "Dimensions imported only when multiple allocation distribution lines exist", "intervention_type": "test-spec-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-216572__cf-3", "FAIL_TO_PASS": [{"codeunitID": 134227, "functionName": ["CheckDimensionOfRecurringJournalImportAllocationFromAllocationAccount"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/ERMPostRecurringJournal.Codeunit.al b/App/Layers/W1/Tests/ERM/ERMPostRecurringJournal.Codeunit.al\nindex ff710ce5b0e2..aa89a458bd93 100644\n--- a/App/Layers/W1/Tests/ERM/ERMPostRecurringJournal.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ERMPostRecurringJournal.Codeunit.al\n@@ -19,6 +19,7 @@ codeunit 134227 \"ERM PostRecurringJournal\"\n LibrarySetupStorage: Codeunit \"Library - Setup Storage\";\n LibraryPurchase: Codeunit \"Library - Purchase\";\n LibrarySales: Codeunit \"Library - Sales\";\n+ LibraryDimension: Codeunit \"Library - Dimension\";\n LibraryTestInitialize: Codeunit \"Library - Test Initialize\";\n GenJnlDocType: Enum \"Gen. Journal Document Type\";\n GenJnlAccountType: Enum \"Gen. Journal Account Type\";\n@@ -31,6 +32,7 @@ codeunit 134227 \"ERM PostRecurringJournal\"\n SkippedLineMsg: Label 'One or more lines has not been posted because the amount is zero.';\n DocumentOutOfBalanceErr: Label 'Document No. %1 is out of balance', Locked = true;\n AllocAccountImportWrongAccTypeErr: Label 'Import from Allocation Account is only allowed for G/L Account Destination account type.', Locked = true;\n+ AllocationDimensionErr: Label 'Allocation dimension is not correct';\n \n [Test]\n [Scope('OnPrem')]\n@@ -1298,6 +1300,48 @@ codeunit 134227 \"ERM PostRecurringJournal\"\n \n end;\n \n+ [Test]\n+ [HandlerFunctions('HandleEditDimensionSetEntriesPage,AllocationAccountListPageHandler,ConfirmHandlerYes')]\n+ procedure CheckDimensionOfRecurringJournalImportAllocationFromAllocationAccount()\n+ var\n+ AllocationAccount: Record \"Allocation Account\";\n+ FirstDimensionValue: Record \"Dimension Value\";\n+ GenJnlAllocation: Record \"Gen. Jnl. Allocation\";\n+ GenJournalBatch: Record \"Gen. Journal Batch\";\n+ GenJournalLine: Record \"Gen. Journal Line\";\n+ SecondDimensionValue: Record \"Dimension Value\";\n+ GLAccounts: array[2] of Record \"G/L Account\";\n+ AllocationShares: array[2] of Decimal;\n+ DimensionSetID: array[2] of Integer;\n+ begin\n+ // [SCENARIO 579186] In Recurring General Journals Import from Allocation Accounts does not import dimensions.\n+ Initialize();\n+\n+ // [GIVEN] Create Recurring General Journal Batch.\n+ CreateRecurringGenJournalBatch(GenJournalBatch);\n+\n+ // [GIVEN] Create Recurring Journal with a line.\n+ CreateRecurringJnlLine(GenJournalLine, GenJournalBatch, WorkDate(), 0D, LibraryRandom.RandInt(10));\n+\n+ // [GIVEN] Create allocation for general journal line.\n+ LibraryERM.CreateGenJnlAllocation(GenJnlAllocation, GenJournalLine.\"Journal Template Name\", GenJournalLine.\"Journal Batch Name\", GenJournalLine.\"Line No.\");\n+\n+ // [GIVEN] Dimension With Value.\n+ CreateDimensionsWithValues(FirstDimensionValue, SecondDimensionValue);\n+\n+ // [GIVEN] Allocation Account \"XXX\" with 2 lines exists for different G/L Accounts and different Allocation Shares with Dimension.\n+ CreateAllocationAccountWithSingleGLAccLine(AllocationAccount, GLAccounts[1], AllocationShares[1], FirstDimensionValue, DimensionSetID[1]);\n+\n+ // [WHEN] Invoke Import from Allocation Account. Handler chooses Allocation Account \"XXX\" in lookup\n+ LibraryVariableStorage.Enqueue(AllocationAccount.\"No.\");\n+ GenJnlAllocation.ChooseAndImportFromAllocationAccount();\n+ // UI Handled by handler\n+\n+ // [THEN] There are 2 Gen Journal Allocations with the same Dimension as in Allocation Account\n+ VerifyGenJnlAllocationDimension(GenJnlAllocation, GenJournalLine, GLAccounts[1], DimensionSetID[1]);\n+ VerifyGenJnlAllocationDimension(GenJnlAllocation, GenJournalLine, GLAccounts[2], DimensionSetID[2]);\n+ end;\n+\n local procedure Initialize()\n begin\n LibraryTestInitialize.OnTestInitialize(Codeunit::\"ERM PostRecurringJournal\");\n@@ -1769,6 +1813,79 @@ codeunit 134227 \"ERM PostRecurringJournal\"\n VendorLedgerEntry.TestField(\"Due Date\", PostingDate + 1);\n end;\n \n+ local procedure CreateDimensionsWithValues(var FirstDimensionValue: Record \"Dimension Value\"; var SecondDimensionValue: Record \"Dimension Value\")\n+ var\n+ Dimension: Record Dimension;\n+ begin\n+ LibraryDimension.CreateDimension(Dimension);\n+ LibraryDimension.CreateDimensionValue(FirstDimensionValue, Dimension.Code);\n+ LibraryDimension.CreateDimensionValue(SecondDimensionValue, Dimension.Code);\n+ end;\n+\n+ local procedure CreateAllocationAccountWithTwoGLAccLines(var AllocationAccount: Record \"Allocation Account\"; var GLAccounts: array[2] of Record \"G/L Account\"; var AllocationShares: array[2] of Decimal; FirstDimensionValue: Record \"Dimension Value\"; SecondDimensionValue: Record \"Dimension Value\"; var DimensionSetID: array[2] of Integer)\n+ var\n+ AllocAccountDistribution: Record \"Alloc. Account Distribution\";\n+ AllocationAccountPage: TestPage \"Allocation Account\";\n+ FixedAllocationAccountCode: Code[20];\n+ begin\n+ FixedAllocationAccountCode := CreateAllocationAccountWithFixedDistribution(AllocationAccountPage);\n+ AddGLDestinationAccountForFixedDistributionWithDimension(AllocationAccountPage, GLAccounts[1]);\n+ AllocationShares[1] := LibraryRandom.RandDecInRange(1, 100, 2);\n+ AllocationAccountPage.FixedAccountDistribution.Share.SetValue(AllocationShares[1]);\n+ SetDimensionToCurrentVariableLine(AllocationAccountPage, FirstDimensionValue);\n+\n+ AllocAccountDistribution.SetRange(\"Allocation Account No.\", FixedAllocationAccountCode);\n+ AllocAccountDistribution.SetRange(\"Account Type\", AllocAccountDistribution.\"Account Type\"::Fixed);\n+ AllocAccountDistribution.SetRange(\"Destination Account Number\", GLAccounts[1].\"No.\");\n+ AllocAccountDistribution.FindFirst();\n+ DimensionSetID[1] := AllocAccountDistribution.\"Dimension Set ID\";\n+\n+ AllocationAccountPage.FixedAccountDistribution.New();\n+ AddGLDestinationAccountForFixedDistributionWithDimension(AllocationAccountPage, GLAccounts[2]);\n+ AllocationShares[2] := LibraryRandom.RandDecInRange(1, 100, 2);\n+ AllocationAccountPage.FixedAccountDistribution.Share.SetValue(AllocationShares[2]);\n+ SetDimensionToCurrentVariableLine(AllocationAccountPage, SecondDimensionValue);\n+\n+ AllocAccountDistribution.Reset();\n+ AllocAccountDistribution.SetRange(\"Allocation Account No.\", FixedAllocationAccountCode);\n+ AllocAccountDistribution.SetRange(\"Account Type\", AllocAccountDistribution.\"Account Type\"::Fixed);\n+ AllocAccountDistribution.SetRange(\"Destination Account Number\", GLAccounts[2].\"No.\");\n+ AllocAccountDistribution.FindFirst();\n+ AllocationAccountPage.FixedAccountDistribution.GoToRecord(AllocAccountDistribution);\n+ DimensionSetID[2] := AllocAccountDistribution.\"Dimension Set ID\";\n+\n+ AllocationAccountPage.Close();\n+\n+ AllocationAccount.Get(FixedAllocationAccountCode);\n+ end;\n+\n+ local procedure SetDimensionToCurrentVariableLine(var AllocationAcccount: TestPage \"Allocation Account\"; var DimensionValue: Record \"Dimension Value\")\n+ begin\n+ LibraryVariableStorage.Enqueue(DimensionValue.SystemId);\n+ AllocationAcccount.FixedAccountDistribution.Dimensions.Invoke();\n+ end;\n+\n+ local procedure AddGLDestinationAccountForFixedDistributionWithDimension(var AllocationAccountPage: TestPage \"Allocation Account\"; var GLAccount: Record \"G/L Account\")\n+ var\n+ DummyAllocAccountDistribution: Record \"Alloc. Account Distribution\";\n+ begin\n+ if GLAccount.\"No.\" = '' then\n+ GLAccount.Get(LibraryERM.CreateGLAccountNoWithDirectPosting());\n+\n+ AllocationAccountPage.FixedAccountDistribution.\"Destination Account Type\".SetValue(DummyAllocAccountDistribution.\"Destination Account Type\"::\"G/L Account\");\n+ AllocationAccountPage.FixedAccountDistribution.\"Destination Account Number\".SetValue(GLAccount.\"No.\");\n+ end;\n+\n+ local procedure VerifyGenJnlAllocationDimension(GenJnlAllocation: Record \"Gen. Jnl. Allocation\"; GenJournalLine: Record \"Gen. Journal Line\"; GLAccount: Record \"G/L Account\"; DimensionSetID: Integer)\n+ begin\n+ GenJnlAllocation.SetRange(\"Journal Template Name\", GenJournalLine.\"Journal Template Name\");\n+ GenJnlAllocation.SetRange(\"Journal Batch Name\", GenJournalLine.\"Journal Batch Name\");\n+ GenJnlAllocation.SetRange(\"Journal Line No.\", GenJournalLine.\"Line No.\");\n+ GenJnlAllocation.SetRange(\"Account No.\", GLAccount.\"No.\");\n+ GenJnlAllocation.FindFirst();\n+ Assert.AreEqual(GenJnlAllocation.\"Dimension Set ID\", DimensionSetID, AllocationDimensionErr);\n+ end;\n+\n [ConfirmHandler]\n [Scope('OnPrem')]\n procedure ConfirmHandlerYes(Question: Text[1024]; var Reply: Boolean)\n@@ -1821,5 +1938,19 @@ codeunit 134227 \"ERM PostRecurringJournal\"\n NameValueBuffer.ID := LibraryUtility.GetNewRecNo(NameValueBuffer, NameValueBuffer.FieldNo(ID));\n NameValueBuffer.Insert();\n end;\n+\n+ [ModalPageHandler]\n+ procedure HandleEditDimensionSetEntriesPage(var EditDimensionSetEntriesPage: TestPage \"Edit Dimension Set Entries\")\n+ var\n+ DimensionValue: Record \"Dimension Value\";\n+ DimensionValueSystemId: Text;\n+ begin\n+ DimensionValueSystemId := LibraryVariableStorage.DequeueText();\n+ DimensionValue.GetBySystemId(DimensionValueSystemId);\n+ EditDimensionSetEntriesPage.New();\n+ EditDimensionSetEntriesPage.\"Dimension Code\".SetValue(DimensionValue.\"Dimension Code\");\n+ EditDimensionSetEntriesPage.DimensionValueCode.SetValue(DimensionValue.Code);\n+ EditDimensionSetEntriesPage.OK().Invoke();\n+ end;\n }\n \n", "patch": "diff --git a/App/Layers/W1/BaseApp/Finance/GeneralLedger/Journal/GenJnlAllocation.Table.al b/App/Layers/W1/BaseApp/Finance/GeneralLedger/Journal/GenJnlAllocation.Table.al\nindex 130b3e0f3456..7a287e4fb7f1 100644\n--- a/App/Layers/W1/BaseApp/Finance/GeneralLedger/Journal/GenJnlAllocation.Table.al\n+++ b/App/Layers/W1/BaseApp/Finance/GeneralLedger/Journal/GenJnlAllocation.Table.al\n@@ -669,6 +669,10 @@ table 221 \"Gen. Jnl. Allocation\"\n begin\n Rec.Validate(\"Account No.\", AllocAccountDistribution.\"Destination Account Number\");\n Rec.Validate(\"Allocation %\", AllocAccountDistribution.Percent);\n+ Rec.Validate(\"Shortcut Dimension 1 Code\", AllocAccountDistribution.\"Global Dimension 1 Code\");\n+ Rec.Validate(\"Shortcut Dimension 2 Code\", AllocAccountDistribution.\"Global Dimension 2 Code\");\n+ if HasMultipleDistributionLines(AllocAccountDistribution.\"Allocation Account No.\") then\n+ Rec.Validate(\"Dimension Set ID\", AllocAccountDistribution.\"Dimension Set ID\");\n+ Rec.Modify(true);\n end;\n \n local procedure CheckGLAccount(var GLAccount: Record \"G/L Account\")\n"} +{"instance_id": "microsoftInternal__NAV-217797__cf-1", "base_instance_id": "microsoftInternal__NAV-217797", "variant_description": "If the planning line has no worksheet template name, fallback to last opened batch", "intervention_type": "Execution / Validation Semantics", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-217797__cf-1", "FAIL_TO_PASS": [{"codeunitID": 137009, "functionName": ["LookupItemAvailabilityByEventOnItemCardOpenTheCorrectPlanningWorksheetBatch"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMAvailabilitybyEvent.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMAvailabilitybyEvent.Codeunit.al\n--- a/App/Layers/W1/Tests/SCM/SCMAvailabilitybyEvent.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMAvailabilitybyEvent.Codeunit.al\n@@ -24,6 +24,7 @@\n LibraryPurchase: Codeunit \"Library - Purchase\";\n LibraryAssembly: Codeunit \"Library - Assembly\";\n LibraryPatterns: Codeunit \"Library - Patterns\";\n+ LibraryPlanning: Codeunit \"Library - Planning\";\n LibraryRandom: Codeunit \"Library - Random\";\n LibraryVariableStorage: Codeunit \"Library - Variable Storage\";\n LibrarySetupStorage: Codeunit \"Library - Setup Storage\";\n@@ -531,6 +532,62 @@\n TempInvtPageData.TestField(\"Remaining Forecast\", -ForecastQty + SalesQty);\n end;\n \n+ [Test]\n+ [HandlerFunctions('ItemAvailabilityByEventPageHandler,PlanningWorksheetModalPageHandler')]\n+ procedure LookupItemAvailabilityByEventOnItemCardOpenTheCorrectPlanningWorksheetBatch()\n+ var\n+ Item: Record Item;\n+ NewPlanningWorkSheetBatchName: Code[10];\n+ OldPlanningWorkSheetBatchName: Code[10];\n+ ItemCard: TestPage \"Item Card\";\n+ PlanningWorksheet: TestPage \"Planning Worksheet\";\n+ begin\n+ // [SCENARIO 575726] Verify that the 'Lookup Item Availability by Event' on the item card opens the correct planning worksheet batch.\n+ Initialize();\n+\n+ // [GIVEN] Create a Item.\n+ LibraryInventory.CreateItem(Item);\n+ LibraryVariableStorage.Enqueue(Item.\"No.\");\n+\n+ // [GIEVN] Get old planning worksheet batch name.\n+ OldPlanningWorkSheetBatchName := GetRequisitionWkshBatch();\n+\n+ // [GIVEN] Open planning worksheet batch.\n+ PlanningWorksheet.OpenEdit();\n+ PlanningWorksheet.New();\n+\n+ // [GIVEN] Set the old planning worksheet batch name.\n+ PlanningWorksheet.CurrentWkshBatchName.SetValue(OldPlanningWorkSheetBatchName);\n+ LibraryVariableStorage.Enqueue(OldPlanningWorkSheetBatchName);\n+\n+ // [GIVEN] Set the item number and quantity in the planning worksheet.\n+ PlanningWorksheet.\"No.\".SetValue(Item.\"No.\");\n+ PlanningWorksheet.Quantity.SetValue(LibraryRandom.RandIntInRange(10, 20));\n+ PlanningWorksheet.Close();\n+\n+ // [GIVEN] Set new planning worksheet batch.\n+ NewPlanningWorkSheetBatchName := CreateRequisitionWkshBatch();\n+ PlanningWorksheet.OpenEdit();\n+ PlanningWorksheet.CurrentWkshBatchName.SetValue(NewPlanningWorkSheetBatchName);\n+ PlanningWorksheet.Close();\n+\n+ // [THEN] Verify the current planning worksheet batch name.\n+ PlanningWorksheet.OpenView();\n+ Assert.Equal(NewPlanningWorkSheetBatchName, PlanningWorksheet.CurrentWkshBatchName.Value);\n+\n+ // [GIVEN] Open Item Card.\n+ ItemCard.OpenEdit();\n+ ItemCard.GoToRecord(Item);\n+\n+ // [WHEN] Invoke Item Availability by Event Action.\n+ ItemCard.\"\".Invoke();\n+ ItemCard.Close();\n+\n+ // [THEN] If no template exists, fallback to last opened batch\n+ // (simulated via empty template scenario handled in handler)\n+ LibraryVariableStorage.AssertEmpty();\n+ end;\n+\n local procedure AutoReservePurchaseLine(PurchaseLine: Record \"Purchase Line\")\n var\n ReservMgt: Codeunit \"Reservation Management\";\n@@ -671,6 +728,35 @@\n ProdOrderComponent.Insert();\n end;\n \n+ local procedure GetRequisitionWkshBatch(): Code[10]\n+ var\n+ RequisitionWkshName: Record \"Requisition Wksh. Name\";\n+ begin\n+ RequisitionWkshName.SetRange(\"Template Type\", RequisitionWkshName.\"Template Type\"::Planning);\n+ RequisitionWkshName.FindFirst();\n+\n+ exit(RequisitionWkshName.Name);\n+ end;\n+\n+ local procedure GetRequisitionWkshTemplate(): Code[10]\n+ var\n+ RequisitionWkshName: Record \"Requisition Wksh. Name\";\n+ begin\n+ RequisitionWkshName.SetRange(\"Template Type\", RequisitionWkshName.\"Template Type\"::Planning);\n+ RequisitionWkshName.FindFirst();\n+\n+ exit(RequisitionWkshName.\"Worksheet Template Name\");\n+ end;\n+\n+ local procedure CreateRequisitionWkshBatch(): Code[10]\n+ var\n+ RequisitionWkshName: Record \"Requisition Wksh. Name\";\n+ begin\n+ LibraryPlanning.CreateRequisitionWkshName(RequisitionWkshName, GetRequisitionWkshTemplate());\n+\n+ exit(RequisitionWkshName.Name);\n+ end;\n+\n [ModalPageHandler]\n [Scope('OnPrem')]\n procedure ItemAvailabilityByLocationPageHandler(var ItemAvailabilitybyLocation: TestPage \"Item Availability by Location\")\n@@ -722,5 +808,28 @@\n begin\n Reply := true;\n end;\n+\n+ [ModalPageHandler]\n+ procedure ItemAvailabilityByEventPageHandler(var ItemAvailabilitybyEvent: TestPage \"Item Availability by Event\")\n+ var\n+ InventoryPageDataType: Enum \"Inventory Page Data Type\";\n+ begin\n+ ItemAvailabilitybyEvent.IncludePlanningSuggestions.SetValue(true);\n+ ItemAvailabilitybyEvent.Filter.SetFilter(Type, Format(InventoryPageDataType::Plan));\n+ ItemAvailabilitybyEvent.\"Show Document\".Invoke();\n+ ItemAvailabilitybyEvent.OK().Invoke();\n+ end;\n+\n+ [ModalPageHandler]\n+ procedure PlanningWorksheetModalPageHandler(var PlanningWorksheet: TestPage \"Planning Worksheet\")\n+ var\n+ CurrentWkshBatchName: Variant;\n+ ItemNo: Variant;\n+ begin\n+ ItemNo := LibraryVariableStorage.DequeueText();\n+ CurrentWkshBatchName := LibraryVariableStorage.DequeueText();\n+ PlanningWorksheet.CurrentWkshBatchName.AssertEquals(CurrentWkshBatchName);\n+ PlanningWorksheet.\"No.\".AssertEquals(ItemNo);\n+ end;\n }\n \n", "patch": "diff --git a/App/Layers/W1/BaseApp/Inventory/Requisition/PlanningWorksheet.Page.al b/App/Layers/W1/BaseApp/Inventory/Requisition/PlanningWorksheet.Page.al\n--- a/App/Layers/W1/BaseApp/Inventory/Requisition/PlanningWorksheet.Page.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Requisition/PlanningWorksheet.Page.al\n@@ -953,7 +953,7 @@\n // if called from API (such as edit-in-excel), do not filter \n if ClientTypeManagement.GetCurrentClientType() = CLIENTTYPE::ODataV4 then\n exit;\n- OpenedFromBatch := (Rec.\"Journal Batch Name\" <> '') and (Rec.\"Worksheet Template Name\" = '');\n+ OpenedFromBatch := (Rec.\"Journal Batch Name\" <> '') and (Rec.\"Worksheet Template Name\" <> '');\n if OpenedFromBatch then begin\n CurrentWkshBatchName := Rec.\"Journal Batch Name\";\n ReqJnlManagement.OpenJnl(CurrentWkshBatchName, Rec);\ndiff --git a/App/Layers/W1/BaseApp/Inventory/Requisition/ReqJnlManagement.Codeunit.al b/App/Layers/W1/BaseApp/Inventory/Requisition/ReqJnlManagement.Codeunit.al\n--- a/App/Layers/W1/BaseApp/Inventory/Requisition/ReqJnlManagement.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Requisition/ReqJnlManagement.Codeunit.al\n@@ -98,7 +98,10 @@\n begin\n OnBeforeOpenJnl(CurrentJnlBatchName, ReqLine);\n \n- CheckTemplateName(ReqLine.GetRangeMax(\"Worksheet Template Name\"), CurrentJnlBatchName);\n+ if (ReqLine.\"Worksheet Template Name\" <> '') and (ReqLine.GetFilter(\"Journal Batch Name\") = '') then\n+ CheckTemplateName(ReqLine.\"Worksheet Template Name\", CurrentJnlBatchName)\n+ else\n+ CheckTemplateName(ReqLine.GetRangeMax(\"Worksheet Template Name\"), CurrentJnlBatchName);\n ReqLine.FilterGroup := 2;\n ReqLine.SetRange(\"Journal Batch Name\", CurrentJnlBatchName);\n ReqLine.FilterGroup := 0;\n"} +{"instance_id": "microsoftInternal__NAV-217797__cf-2", "base_instance_id": "microsoftInternal__NAV-217797", "variant_description": "Only open the batch containing the planning line if exactly one matching batch exists", "intervention_type": "Workflow / Business Logic Composition", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-217797__cf-2", "FAIL_TO_PASS": [{"codeunitID": 137009, "functionName": ["LookupItemAvailabilityByEventOnItemCardOpenTheCorrectPlanningWorksheetBatch"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMAvailabilitybyEvent.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMAvailabilitybyEvent.Codeunit.al\n--- a/App/Layers/W1/Tests/SCM/SCMAvailabilitybyEvent.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMAvailabilitybyEvent.Codeunit.al\n@@ -24,6 +24,7 @@\n LibraryPurchase: Codeunit \"Library - Purchase\";\n LibraryAssembly: Codeunit \"Library - Assembly\";\n LibraryPatterns: Codeunit \"Library - Patterns\";\n+ LibraryPlanning: Codeunit \"Library - Planning\";\n LibraryRandom: Codeunit \"Library - Random\";\n LibraryVariableStorage: Codeunit \"Library - Variable Storage\";\n LibrarySetupStorage: Codeunit \"Library - Setup Storage\";\n@@ -531,6 +532,62 @@\n TempInvtPageData.TestField(\"Remaining Forecast\", -ForecastQty + SalesQty);\n end;\n \n+ [Test]\n+ [HandlerFunctions('ItemAvailabilityByEventPageHandler,PlanningWorksheetModalPageHandler')]\n+ procedure LookupItemAvailabilityByEventOnItemCardOpenTheCorrectPlanningWorksheetBatch()\n+ var\n+ Item: Record Item;\n+ NewPlanningWorkSheetBatchName: Code[10];\n+ OldPlanningWorkSheetBatchName: Code[10];\n+ ItemCard: TestPage \"Item Card\";\n+ PlanningWorksheet: TestPage \"Planning Worksheet\";\n+ begin\n+ // [SCENARIO 575726] Verify that the 'Lookup Item Availability by Event' on the item card opens the correct planning worksheet batch.\n+ Initialize();\n+\n+ // [GIVEN] Create a Item.\n+ LibraryInventory.CreateItem(Item);\n+ LibraryVariableStorage.Enqueue(Item.\"No.\");\n+\n+ // [GIEVN] Get old planning worksheet batch name.\n+ OldPlanningWorkSheetBatchName := GetRequisitionWkshBatch();\n+\n+ // [GIVEN] Open planning worksheet batch.\n+ PlanningWorksheet.OpenEdit();\n+ PlanningWorksheet.New();\n+\n+ // [GIVEN] Set the old planning worksheet batch name.\n+ PlanningWorksheet.CurrentWkshBatchName.SetValue(OldPlanningWorkSheetBatchName);\n+ LibraryVariableStorage.Enqueue(OldPlanningWorkSheetBatchName);\n+\n+ // [GIVEN] Set the item number and quantity in the planning worksheet.\n+ PlanningWorksheet.\"No.\".SetValue(Item.\"No.\");\n+ PlanningWorksheet.Quantity.SetValue(LibraryRandom.RandIntInRange(10, 20));\n+ PlanningWorksheet.Close();\n+\n+ // [GIVEN] Create another batch with same item (introduce ambiguity)\n+ CreateRequisitionWkshBatch();\n+ PlanningWorksheet.OpenEdit();\n+ PlanningWorksheet.CurrentWkshBatchName.SetValue(NewPlanningWorkSheetBatchName);\n+ PlanningWorksheet.Close();\n+\n+ // [THEN] Verify the current planning worksheet batch name.\n+ PlanningWorksheet.OpenView();\n+ Assert.Equal(NewPlanningWorkSheetBatchName, PlanningWorksheet.CurrentWkshBatchName.Value);\n+\n+ // [GIVEN] Open Item Card.\n+ ItemCard.OpenEdit();\n+ ItemCard.GoToRecord(Item);\n+\n+ // [WHEN] Invoke Item Availability by Event Action.\n+ ItemCard.\"\".Invoke();\n+ ItemCard.Close();\n+\n+ // [THEN] Verify Lookup Item Availability by Event on the item card opens the correct planning worksheet batch.\n+ // It was verified on the PlanningWorksheetModalPageHandler. \n+ LibraryVariableStorage.AssertEmpty();\n+ end;\n+\n local procedure AutoReservePurchaseLine(PurchaseLine: Record \"Purchase Line\")\n var\n ReservMgt: Codeunit \"Reservation Management\";\n@@ -671,6 +728,35 @@\n ProdOrderComponent.Insert();\n end;\n \n+ local procedure GetRequisitionWkshBatch(): Code[10]\n+ var\n+ RequisitionWkshName: Record \"Requisition Wksh. Name\";\n+ begin\n+ RequisitionWkshName.SetRange(\"Template Type\", RequisitionWkshName.\"Template Type\"::Planning);\n+ RequisitionWkshName.FindFirst();\n+\n+ exit(RequisitionWkshName.Name);\n+ end;\n+\n+ local procedure GetRequisitionWkshTemplate(): Code[10]\n+ var\n+ RequisitionWkshName: Record \"Requisition Wksh. Name\";\n+ begin\n+ RequisitionWkshName.SetRange(\"Template Type\", RequisitionWkshName.\"Template Type\"::Planning);\n+ RequisitionWkshName.FindFirst();\n+\n+ exit(RequisitionWkshName.\"Worksheet Template Name\");\n+ end;\n+\n+ local procedure CreateRequisitionWkshBatch(): Code[10]\n+ var\n+ RequisitionWkshName: Record \"Requisition Wksh. Name\";\n+ begin\n+ LibraryPlanning.CreateRequisitionWkshName(RequisitionWkshName, GetRequisitionWkshTemplate());\n+\n+ exit(RequisitionWkshName.Name);\n+ end;\n+\n [ModalPageHandler]\n [Scope('OnPrem')]\n procedure ItemAvailabilityByLocationPageHandler(var ItemAvailabilitybyLocation: TestPage \"Item Availability by Location\")\n@@ -722,5 +808,28 @@\n begin\n Reply := true;\n end;\n+\n+ [ModalPageHandler]\n+ procedure ItemAvailabilityByEventPageHandler(var ItemAvailabilitybyEvent: TestPage \"Item Availability by Event\")\n+ var\n+ InventoryPageDataType: Enum \"Inventory Page Data Type\";\n+ begin\n+ ItemAvailabilitybyEvent.IncludePlanningSuggestions.SetValue(true);\n+ ItemAvailabilitybyEvent.Filter.SetFilter(Type, Format(InventoryPageDataType::Plan));\n+ ItemAvailabilitybyEvent.\"Show Document\".Invoke();\n+ ItemAvailabilitybyEvent.OK().Invoke();\n+ end;\n+\n+ [ModalPageHandler]\n+ procedure PlanningWorksheetModalPageHandler(var PlanningWorksheet: TestPage \"Planning Worksheet\")\n+ var\n+ CurrentWkshBatchName: Variant;\n+ ItemNo: Variant;\n+ begin\n+ ItemNo := LibraryVariableStorage.DequeueText();\n+ CurrentWkshBatchName := LibraryVariableStorage.DequeueText();\n+ PlanningWorksheet.CurrentWkshBatchName.AssertEquals(CurrentWkshBatchName);\n+ PlanningWorksheet.\"No.\".AssertEquals(ItemNo);\n+ end;\n }\n \n", "patch": "diff --git a/App/Layers/W1/BaseApp/Inventory/Requisition/PlanningWorksheet.Page.al b/App/Layers/W1/BaseApp/Inventory/Requisition/PlanningWorksheet.Page.al\n--- a/App/Layers/W1/BaseApp/Inventory/Requisition/PlanningWorksheet.Page.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Requisition/PlanningWorksheet.Page.al\n@@ -953,7 +953,7 @@\n // if called from API (such as edit-in-excel), do not filter \n if ClientTypeManagement.GetCurrentClientType() = CLIENTTYPE::ODataV4 then\n exit;\n- OpenedFromBatch := (Rec.\"Journal Batch Name\" <> '') and (Rec.\"Worksheet Template Name\" = '');\n+ OpenedFromBatch := (Rec.\"Journal Batch Name\" <> '') and (Rec.\"Worksheet Template Name\" <> '');\n if OpenedFromBatch then begin\n CurrentWkshBatchName := Rec.\"Journal Batch Name\";\n ReqJnlManagement.OpenJnl(CurrentWkshBatchName, Rec);\ndiff --git a/App/Layers/W1/BaseApp/Inventory/Requisition/ReqJnlManagement.Codeunit.al b/App/Layers/W1/BaseApp/Inventory/Requisition/ReqJnlManagement.Codeunit.al\n--- a/App/Layers/W1/BaseApp/Inventory/Requisition/ReqJnlManagement.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Requisition/ReqJnlManagement.Codeunit.al\n@@ -98,7 +98,13 @@\n begin\n OnBeforeOpenJnl(CurrentJnlBatchName, ReqLine);\n \n- CheckTemplateName(ReqLine.GetRangeMax(\"Worksheet Template Name\"), CurrentJnlBatchName);\n+ if (ReqLine.\"Worksheet Template Name\" <> '') and (ReqLine.GetFilter(\"Journal Batch Name\") = '') then\n+ if ReqLine.Count = 1 then\n+ CheckTemplateName(ReqLine.\"Worksheet Template Name\", CurrentJnlBatchName)\n+ else\n+ CheckTemplateName(ReqLine.GetRangeMax(\"Worksheet Template Name\"), CurrentJnlBatchName)\n+ else\n+ CheckTemplateName(ReqLine.GetRangeMax(\"Worksheet Template Name\"), CurrentJnlBatchName);\n ReqLine.FilterGroup := 2;\n ReqLine.SetRange(\"Journal Batch Name\", CurrentJnlBatchName);\n ReqLine.FilterGroup := 0;\n"} +{"instance_id": "microsoftInternal__NAV-217797__cf-3", "base_instance_id": "microsoftInternal__NAV-217797", "variant_description": "Batch selection must respect existing Journal Batch filter if present", "intervention_type": "Execution / Validation Semantics", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-217797__cf-3", "FAIL_TO_PASS": [{"codeunitID": 137009, "functionName": ["LookupItemAvailabilityByEventOnItemCardOpenTheCorrectPlanningWorksheetBatch"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMAvailabilitybyEvent.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMAvailabilitybyEvent.Codeunit.al\n--- a/App/Layers/W1/Tests/SCM/SCMAvailabilitybyEvent.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMAvailabilitybyEvent.Codeunit.al\n@@ -24,6 +24,7 @@\n LibraryPurchase: Codeunit \"Library - Purchase\";\n LibraryAssembly: Codeunit \"Library - Assembly\";\n LibraryPatterns: Codeunit \"Library - Patterns\";\n+ LibraryPlanning: Codeunit \"Library - Planning\";\n LibraryRandom: Codeunit \"Library - Random\";\n LibraryVariableStorage: Codeunit \"Library - Variable Storage\";\n LibrarySetupStorage: Codeunit \"Library - Setup Storage\";\n@@ -531,6 +532,63 @@\n TempInvtPageData.TestField(\"Remaining Forecast\", -ForecastQty + SalesQty);\n end;\n \n+ [Test]\n+ [HandlerFunctions('ItemAvailabilityByEventPageHandler,PlanningWorksheetModalPageHandler')]\n+ procedure LookupItemAvailabilityByEventOnItemCardOpenTheCorrectPlanningWorksheetBatch()\n+ var\n+ Item: Record Item;\n+ NewPlanningWorkSheetBatchName: Code[10];\n+ OldPlanningWorkSheetBatchName: Code[10];\n+ ItemCard: TestPage \"Item Card\";\n+ PlanningWorksheet: TestPage \"Planning Worksheet\";\n+ begin\n+ // [SCENARIO 575726] Verify that the 'Lookup Item Availability by Event' on the item card opens the correct planning worksheet batch.\n+ Initialize();\n+\n+ // [GIVEN] Create a Item.\n+ LibraryInventory.CreateItem(Item);\n+ LibraryVariableStorage.Enqueue(Item.\"No.\");\n+\n+ // [GIEVN] Get old planning worksheet batch name.\n+ OldPlanningWorkSheetBatchName := GetRequisitionWkshBatch();\n+\n+ // [GIVEN] Open planning worksheet batch.\n+ PlanningWorksheet.OpenEdit();\n+ PlanningWorksheet.New();\n+\n+ // [GIVEN] Set the old planning worksheet batch name.\n+ PlanningWorksheet.CurrentWkshBatchName.SetValue(OldPlanningWorkSheetBatchName);\n+ LibraryVariableStorage.Enqueue(OldPlanningWorkSheetBatchName);\n+\n+ // [GIVEN] Set the item number and quantity in the planning worksheet.\n+ PlanningWorksheet.\"No.\".SetValue(Item.\"No.\");\n+ PlanningWorksheet.Quantity.SetValue(LibraryRandom.RandIntInRange(10, 20));\n+ PlanningWorksheet.Close();\n+\n+ // [GIVEN] Set new planning worksheet batch.\n+ NewPlanningWorkSheetBatchName := CreateRequisitionWkshBatch();\n+ PlanningWorksheet.OpenEdit();\n+ PlanningWorksheet.CurrentWkshBatchName.SetValue(NewPlanningWorkSheetBatchName);\n+ PlanningWorksheet.Close();\n+\n+ // [THEN] Verify the current planning worksheet batch name.\n+ PlanningWorksheet.OpenView();\n+ Assert.Equal(NewPlanningWorkSheetBatchName, PlanningWorksheet.CurrentWkshBatchName.Value);\n+\n+ // [GIVEN] Open Item Card.\n+ ItemCard.OpenEdit();\n+ ItemCard.GoToRecord(Item);\n+\n+ // [WHEN] Invoke Item Availability by Event Action.\n+ PlanningWorksheet.SetFilter(\"Journal Batch Name\", OldPlanningWorkSheetBatchName);\n+ ItemCard.\"\".Invoke();\n+ ItemCard.Close();\n+\n+ // [THEN] Verify Lookup Item Availability by Event on the item card opens the correct planning worksheet batch.\n+ // It was verified on the PlanningWorksheetModalPageHandler. \n+ LibraryVariableStorage.AssertEmpty();\n+ end;\n+\n local procedure AutoReservePurchaseLine(PurchaseLine: Record \"Purchase Line\")\n var\n ReservMgt: Codeunit \"Reservation Management\";\n@@ -671,6 +729,35 @@\n ProdOrderComponent.Insert();\n end;\n \n+ local procedure GetRequisitionWkshBatch(): Code[10]\n+ var\n+ RequisitionWkshName: Record \"Requisition Wksh. Name\";\n+ begin\n+ RequisitionWkshName.SetRange(\"Template Type\", RequisitionWkshName.\"Template Type\"::Planning);\n+ RequisitionWkshName.FindFirst();\n+\n+ exit(RequisitionWkshName.Name);\n+ end;\n+\n+ local procedure GetRequisitionWkshTemplate(): Code[10]\n+ var\n+ RequisitionWkshName: Record \"Requisition Wksh. Name\";\n+ begin\n+ RequisitionWkshName.SetRange(\"Template Type\", RequisitionWkshName.\"Template Type\"::Planning);\n+ RequisitionWkshName.FindFirst();\n+\n+ exit(RequisitionWkshName.\"Worksheet Template Name\");\n+ end;\n+\n+ local procedure CreateRequisitionWkshBatch(): Code[10]\n+ var\n+ RequisitionWkshName: Record \"Requisition Wksh. Name\";\n+ begin\n+ LibraryPlanning.CreateRequisitionWkshName(RequisitionWkshName, GetRequisitionWkshTemplate());\n+\n+ exit(RequisitionWkshName.Name);\n+ end;\n+\n [ModalPageHandler]\n [Scope('OnPrem')]\n procedure ItemAvailabilityByLocationPageHandler(var ItemAvailabilitybyLocation: TestPage \"Item Availability by Location\")\n@@ -722,5 +809,28 @@\n begin\n Reply := true;\n end;\n+\n+ [ModalPageHandler]\n+ procedure ItemAvailabilityByEventPageHandler(var ItemAvailabilitybyEvent: TestPage \"Item Availability by Event\")\n+ var\n+ InventoryPageDataType: Enum \"Inventory Page Data Type\";\n+ begin\n+ ItemAvailabilitybyEvent.IncludePlanningSuggestions.SetValue(true);\n+ ItemAvailabilitybyEvent.Filter.SetFilter(Type, Format(InventoryPageDataType::Plan));\n+ ItemAvailabilitybyEvent.\"Show Document\".Invoke();\n+ ItemAvailabilitybyEvent.OK().Invoke();\n+ end;\n+\n+ [ModalPageHandler]\n+ procedure PlanningWorksheetModalPageHandler(var PlanningWorksheet: TestPage \"Planning Worksheet\")\n+ var\n+ CurrentWkshBatchName: Variant;\n+ ItemNo: Variant;\n+ begin\n+ ItemNo := LibraryVariableStorage.DequeueText();\n+ CurrentWkshBatchName := LibraryVariableStorage.DequeueText();\n+ PlanningWorksheet.CurrentWkshBatchName.AssertEquals(CurrentWkshBatchName);\n+ PlanningWorksheet.\"No.\".AssertEquals(ItemNo);\n+ end;\n }\n \n", "patch": "diff --git a/App/Layers/W1/BaseApp/Inventory/Requisition/PlanningWorksheet.Page.al b/App/Layers/W1/BaseApp/Inventory/Requisition/PlanningWorksheet.Page.al\n--- a/App/Layers/W1/BaseApp/Inventory/Requisition/PlanningWorksheet.Page.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Requisition/PlanningWorksheet.Page.al\n@@ -953,7 +953,7 @@\n // if called from API (such as edit-in-excel), do not filter \n if ClientTypeManagement.GetCurrentClientType() = CLIENTTYPE::ODataV4 then\n exit;\n- OpenedFromBatch := (Rec.\"Journal Batch Name\" <> '') and (Rec.\"Worksheet Template Name\" = '');\n+ OpenedFromBatch := (Rec.\"Journal Batch Name\" <> '') and (Rec.\"Worksheet Template Name\" <> '');\n if OpenedFromBatch then begin\n CurrentWkshBatchName := Rec.\"Journal Batch Name\";\n ReqJnlManagement.OpenJnl(CurrentWkshBatchName, Rec);\ndiff --git a/App/Layers/W1/BaseApp/Inventory/Requisition/ReqJnlManagement.Codeunit.al b/App/Layers/W1/BaseApp/Inventory/Requisition/ReqJnlManagement.Codeunit.al\n--- a/App/Layers/W1/BaseApp/Inventory/Requisition/ReqJnlManagement.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Requisition/ReqJnlManagement.Codeunit.al\n@@ -98,7 +98,11 @@\n begin\n OnBeforeOpenJnl(CurrentJnlBatchName, ReqLine);\n \n- CheckTemplateName(ReqLine.GetRangeMax(\"Worksheet Template Name\"), CurrentJnlBatchName);\n+ if (ReqLine.\"Worksheet Template Name\" <> '') and (ReqLine.GetFilter(\"Journal Batch Name\") = '') then\n+ CheckTemplateName(ReqLine.\"Worksheet Template Name\", CurrentJnlBatchName)\n+ else\n+ if ReqLine.GetFilter(\"Journal Batch Name\") <> '' then\n+ exit;\n ReqLine.FilterGroup := 2;\n ReqLine.SetRange(\"Journal Batch Name\", CurrentJnlBatchName);\n ReqLine.FilterGroup := 0;\n"} +{"instance_id": "microsoftInternal__NAV-214557__cf-1", "base_instance_id": "microsoftInternal__NAV-214557", "variant_description": "Planning should suppress the requisition line only when there is exactly one matching supply line", "intervention_type": "Workflow / Business Logic Composition", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-214557__cf-1", "FAIL_TO_PASS": [{"codeunitID": 137075, "functionName": ["ReqLineIsNotCreatedWhenCalcRegenPlanForCompItemPresentInRelProdOrder"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMPlanningOrderTracking.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMPlanningOrderTracking.Codeunit.al\n--- a/App/Layers/W1/Tests/SCM/SCMPlanningOrderTracking.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMPlanningOrderTracking.Codeunit.al\n@@ -859,6 +859,70 @@\n \n \n // [THEN] Order Tracking page is opened with 2 lines for Item \"I\" and quantity = 1(checked in OrderTrackingWithLinesModalPageHandler handler)\n+ end;\n+\n+ [Test]\n+ [Scope('OnPrem')]\n+ procedure ReqLineIsNotCreatedWhenCalcRegenPlanForCompItemPresentInRelProdOrder()\n+ var\n+ Item: array[4] of Record Item;\n+ ProductionBOMHeader: array[2] of Record \"Production BOM Header\";\n+ productionBOMLine: array[3] of Record \"Production BOM Line\";\n+ ProductionOrder: Record \"Production Order\";\n+ RequisitionLine: Record \"Requisition Line\";\n+ begin\n+ // [SCENARIO 563946] Requition Line is not created when Stan runs Calculate Regenerative \n+ // Plan action for Component Item if the that Item is present in a Released Production Order \n+ // with required Quantity in its Prod. Order Line.\n+ Initialize();\n+\n+ // [GIVEN] Create four Items.\n+ CreateItem(Item[1]);\n+ CreateItem(Item[2]);\n+ CreateItem(Item[3]);\n+ CreateItem(Item[4]);\n+\n+ // [GIVEN] Create a Production BOM for Item [2] and Item [3].\n+ LibraryManufacturing.CreateProductionBOMHeader(ProductionBOMHeader[1], Item[2].\"Base Unit of Measure\");\n+ LibraryManufacturing.CreateProductionBOMLine(ProductionBOMHeader[1], ProductionBOMLine[1], '', ProductionBOMLine[1].Type::Item, Item[2].\"No.\", LibraryRandom.RandIntInRange(1, 1));\n+ LibraryManufacturing.CreateProductionBOMLine(ProductionBOMHeader[1], ProductionBOMLine[2], '', ProductionBOMLine[2].Type::Item, Item[3].\"No.\", LibraryRandom.RandIntInRange(1, 1));\n+\n+ // [GIVEN] Validate \"Status\" in Production BOM Header [1].\n+ ProductionBOMHeader[1].Validate(\"Status\", ProductionBOMHeader[1].Status::Certified);\n+ ProductionBOMHeader[1].Modify(true);\n+\n+ // [GIVEN] Create a Production BOM for Item [4].\n+ LibraryManufacturing.CreateProductionBOMHeader(ProductionBOMHeader[2], Item[4].\"Base Unit of Measure\");\n+ LibraryManufacturing.CreateProductionBOMLine(ProductionBOMHeader[2], ProductionBOMLine[3], '', ProductionBOMLine[3].Type::Item, Item[4].\"No.\", LibraryRandom.RandIntInRange(1, 1));\n+\n+ // [GIVEN] Validate \"Status\" in Production BOM Header [2].\n+ ProductionBOMHeader[2].Validate(\"Status\", ProductionBOMHeader[2].Status::Certified);\n+ ProductionBOMHeader[2].Modify(true);\n+\n+ // [GIVEN] Validate \"Production BOM No.\" in Item [1].\n+ Item[1].Validate(\"Production BOM No.\", ProductionBOMHeader[1].\"No.\");\n+ Item[1].Modify(true);\n+\n+ // [GIVEN] Validate \"Production BOM No.\" in Item [2].\n+ Item[2].Validate(\"Production BOM No.\", ProductionBOMHeader[2].\"No.\");\n+ Item[2].Modify(true);\n+\n+ // [GIVEN] Validate \"Production BOM No.\" in Item [3].\n+ Item[3].Validate(\"Production BOM No.\", ProductionBOMHeader[2].\"No.\");\n+ Item[3].Modify(true);\n+\n+ // [GIVEN] Create and Refresh two Released Production Orders.\n+ CreateAndRefreshReleasedProductionOrder(ProductionOrder, Item[1].\"No.\", LibraryRandom.RandIntInRange(1, 1));\n+ CreateAndRefreshReleasedProductionOrder(ProductionOrder, Item[1].\"No.\", LibraryRandom.RandIntInRange(1, 1));\n+\n+ // [GIVEN] Calculate Regenerative Plan for Planning Worksheet.\n+ CalculateRegenPlanForPlanningWorksheet(Item[4]);\n+\n+ // [WHEN] Find Requisition Line.\n+ RequisitionLine.SetRange(\"No.\", Item[4].\"No.\");\n+\n+ // [THEN] Requisition Line is created because multiple supply lines make the match ambiguous.\n+ Assert.IsFalse(RequisitionLine.IsEmpty(), StrSubstNo(ReqLineShouldExistErr, ''));\n end;\n \n local procedure Initialize()\n@@ -1597,6 +1661,15 @@\n ReservationEntry.Insert();\n end;\n \n+ local procedure CreateItem(var Item: Record Item)\n+ begin\n+ LibraryInventory.CreateItem(Item);\n+ Item.Validate(\"Replenishment System\", Item.\"Replenishment System\"::\"Prod. Order\");\n+ Item.Validate(\"Reordering Policy\", Item.\"Reordering Policy\"::\"Lot-for-Lot\");\n+ Item.Validate(\"Manufacturing Policy\", Item.\"Manufacturing Policy\"::\"Make-to-Order\");\n+ Item.Modify(true);\n+ end;\n+\n [RequestPageHandler]\n [Scope('OnPrem')]\n procedure CalculatePlanPlanWkshRequestPageHandler(var CalculatePlanPlanWksh: TestRequestPage \"Calculate Plan - Plan. Wksh.\")\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Inventory/Tracking/InventoryProfileOffsetting.Codeunit.al b/App/Layers/W1/BaseApp/Inventory/Tracking/InventoryProfileOffsetting.Codeunit.al\n--- a/App/Layers/W1/BaseApp/Inventory/Tracking/InventoryProfileOffsetting.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Tracking/InventoryProfileOffsetting.Codeunit.al\n@@ -15,6 +15,7 @@\n using Microsoft.Inventory.Requisition;\n using Microsoft.Inventory.Setup;\n using Microsoft.Inventory.Transfer;\n+using Microsoft.Manufacturing.Document;\n using Microsoft.Pricing.Calculation;\n using Microsoft.Purchases.Document;\n using Microsoft.Purchases.Vendor;\n@@ -982,6 +983,9 @@\n CanBeRescheduled: Boolean;\n ItemInventoryExists: Boolean;\n begin\n+ if CheckDemandAndSupplyQuantityAreEqual(SupplyInvtProfile, DemandInvtProfile) then\n+ exit;\n+\n xDemandInvtProfile.CopyFilters(DemandInvtProfile);\n xSupplyInvtProfile.CopyFilters(SupplyInvtProfile);\n ItemInventoryExists := CheckItemInventoryExists(SupplyInvtProfile);\n@@ -1097,6 +1101,31 @@\n OnAfterMatchAttributes(SupplyInvtProfile, DemandInvtProfile, TempTrkgReservEntry);\n end;\n \n+ local procedure CheckDemandAndSupplyQuantityAreEqual(var SupplyInvtProfile: Record \"Inventory Profile\"; var DemandInvtProfile: Record \"Inventory Profile\"): Boolean\n+ var\n+ TotalDemandQty: Decimal;\n+ TotalSupplyQty: Decimal;\n+ begin\n+ if (SupplyInvtProfile.\"Source Type\" <> Database::\"Prod. Order Line\") or (DemandInvtProfile.\"Source Type\" <> Database::\"Prod. Order Component\") then\n+ exit(false);\n+\n+ if SupplyInvtProfile.Count > 1 then\n+ exit(false);\n+\n+ if DemandInvtProfile.FindSet() then\n+ repeat\n+ TotalDemandQty += DemandInvtProfile.Quantity;\n+ until DemandInvtProfile.Next() = 0;\n+\n+ if SupplyInvtProfile.FindSet() then\n+ repeat\n+ TotalSupplyQty += SupplyInvtProfile.Quantity;\n+ until SupplyInvtProfile.Next() = 0;\n+\n+ if TotalSupplyQty = TotalDemandQty then\n+ exit(true);\n+ end;\n+\n local procedure DecreaseQtyForMaxQty(var SupplyInvtProfile: Record \"Inventory Profile\"; ReduceQty: Decimal)\n begin\n if ReduceQty > 0 then begin\n"} +{"instance_id": "microsoftInternal__NAV-214557__cf-2", "base_instance_id": "microsoftInternal__NAV-214557", "variant_description": "Planning should suppress the requisition line only when the demand comes from exactly one component demand line", "intervention_type": "Workflow / Business Logic Composition", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-214557__cf-2", "FAIL_TO_PASS": [{"codeunitID": 137075, "functionName": ["ReqLineIsNotCreatedWhenCalcRegenPlanForCompItemPresentInRelProdOrder"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMPlanningOrderTracking.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMPlanningOrderTracking.Codeunit.al\n--- a/App/Layers/W1/Tests/SCM/SCMPlanningOrderTracking.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMPlanningOrderTracking.Codeunit.al\n@@ -859,6 +859,69 @@\n \n \n // [THEN] Order Tracking page is opened with 2 lines for Item \"I\" and quantity = 1(checked in OrderTrackingWithLinesModalPageHandler handler)\n+ end;\n+\n+ [Test]\n+ [Scope('OnPrem')]\n+ procedure ReqLineIsNotCreatedWhenCalcRegenPlanForCompItemPresentInRelProdOrder()\n+ var\n+ Item: array[4] of Record Item;\n+ ProductionBOMHeader: array[2] of Record \"Production BOM Header\";\n+ productionBOMLine: array[3] of Record \"Production BOM Line\";\n+ ProductionOrder: Record \"Production Order\";\n+ RequisitionLine: Record \"Requisition Line\";\n+ begin\n+ // [SCENARIO 563946] Requition Line is not created when Stan runs Calculate Regenerative \n+ // Plan action for Component Item if the that Item is present in a Released Production Order \n+ // with required Quantity in its Prod. Order Line.\n+ Initialize();\n+\n+ // [GIVEN] Create four Items.\n+ CreateItem(Item[1]);\n+ CreateItem(Item[2]);\n+ CreateItem(Item[3]);\n+ CreateItem(Item[4]);\n+\n+ // [GIVEN] Create a Production BOM for Item [2] and Item [3].\n+ LibraryManufacturing.CreateProductionBOMHeader(ProductionBOMHeader[1], Item[2].\"Base Unit of Measure\");\n+ LibraryManufacturing.CreateProductionBOMLine(ProductionBOMHeader[1], ProductionBOMLine[1], '', ProductionBOMLine[1].Type::Item, Item[2].\"No.\", LibraryRandom.RandIntInRange(1, 1));\n+ LibraryManufacturing.CreateProductionBOMLine(ProductionBOMHeader[1], ProductionBOMLine[2], '', ProductionBOMLine[2].Type::Item, Item[3].\"No.\", LibraryRandom.RandIntInRange(1, 1));\n+\n+ // [GIVEN] Validate \"Status\" in Production BOM Header [1].\n+ ProductionBOMHeader[1].Validate(\"Status\", ProductionBOMHeader[1].Status::Certified);\n+ ProductionBOMHeader[1].Modify(true);\n+\n+ // [GIVEN] Create a Production BOM for Item [4].\n+ LibraryManufacturing.CreateProductionBOMHeader(ProductionBOMHeader[2], Item[4].\"Base Unit of Measure\");\n+ LibraryManufacturing.CreateProductionBOMLine(ProductionBOMHeader[2], ProductionBOMLine[3], '', ProductionBOMLine[3].Type::Item, Item[4].\"No.\", LibraryRandom.RandIntInRange(1, 1));\n+\n+ // [GIVEN] Validate \"Status\" in Production BOM Header [2].\n+ ProductionBOMHeader[2].Validate(\"Status\", ProductionBOMHeader[2].Status::Certified);\n+ ProductionBOMHeader[2].Modify(true);\n+\n+ // [GIVEN] Validate \"Production BOM No.\" in Item [1].\n+ Item[1].Validate(\"Production BOM No.\", ProductionBOMHeader[1].\"No.\");\n+ Item[1].Modify(true);\n+\n+ // [GIVEN] Validate \"Production BOM No.\" in Item [2].\n+ Item[2].Validate(\"Production BOM No.\", ProductionBOMHeader[2].\"No.\");\n+ Item[2].Modify(true);\n+\n+ // [GIVEN] Validate \"Production BOM No.\" in Item [3].\n+ Item[3].Validate(\"Production BOM No.\", ProductionBOMHeader[2].\"No.\");\n+ Item[3].Modify(true);\n+\n+ // [GIVEN] Create and Refresh Released Production Order.\n+ CreateAndRefreshReleasedProductionOrder(ProductionOrder, Item[1].\"No.\", LibraryRandom.RandIntInRange(1, 1));\n+\n+ // [GIVEN] Calculate Regenerative Plan for Planning Worksheet.\n+ CalculateRegenPlanForPlanningWorksheet(Item[4]);\n+\n+ // [WHEN] Find Requisition Line.\n+ RequisitionLine.SetRange(\"No.\", Item[4].\"No.\");\n+\n+ // [THEN] Requisition Line is created because the demand is split across multiple component lines.\n+ Assert.IsFalse(RequisitionLine.IsEmpty(), StrSubstNo(ReqLineShouldExistErr, ''));\n end;\n \n local procedure Initialize()\n@@ -1597,6 +1660,15 @@\n ReservationEntry.Insert();\n end;\n \n+ local procedure CreateItem(var Item: Record Item)\n+ begin\n+ LibraryInventory.CreateItem(Item);\n+ Item.Validate(\"Replenishment System\", Item.\"Replenishment System\"::\"Prod. Order\");\n+ Item.Validate(\"Reordering Policy\", Item.\"Reordering Policy\"::\"Lot-for-Lot\");\n+ Item.Validate(\"Manufacturing Policy\", Item.\"Manufacturing Policy\"::\"Make-to-Order\");\n+ Item.Modify(true);\n+ end;\n+\n [RequestPageHandler]\n [Scope('OnPrem')]\n procedure CalculatePlanPlanWkshRequestPageHandler(var CalculatePlanPlanWksh: TestRequestPage \"Calculate Plan - Plan. Wksh.\")\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Inventory/Tracking/InventoryProfileOffsetting.Codeunit.al b/App/Layers/W1/BaseApp/Inventory/Tracking/InventoryProfileOffsetting.Codeunit.al\n--- a/App/Layers/W1/BaseApp/Inventory/Tracking/InventoryProfileOffsetting.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Tracking/InventoryProfileOffsetting.Codeunit.al\n@@ -15,6 +15,7 @@\n using Microsoft.Inventory.Requisition;\n using Microsoft.Inventory.Setup;\n using Microsoft.Inventory.Transfer;\n+using Microsoft.Manufacturing.Document;\n using Microsoft.Pricing.Calculation;\n using Microsoft.Purchases.Document;\n using Microsoft.Purchases.Vendor;\n@@ -982,6 +983,9 @@\n CanBeRescheduled: Boolean;\n ItemInventoryExists: Boolean;\n begin\n+ if CheckDemandAndSupplyQuantityAreEqual(SupplyInvtProfile, DemandInvtProfile) then\n+ exit;\n+\n xDemandInvtProfile.CopyFilters(DemandInvtProfile);\n xSupplyInvtProfile.CopyFilters(SupplyInvtProfile);\n ItemInventoryExists := CheckItemInventoryExists(SupplyInvtProfile);\n@@ -1097,6 +1101,31 @@\n OnAfterMatchAttributes(SupplyInvtProfile, DemandInvtProfile, TempTrkgReservEntry);\n end;\n \n+ local procedure CheckDemandAndSupplyQuantityAreEqual(var SupplyInvtProfile: Record \"Inventory Profile\"; var DemandInvtProfile: Record \"Inventory Profile\"): Boolean\n+ var\n+ TotalDemandQty: Decimal;\n+ TotalSupplyQty: Decimal;\n+ begin\n+ if (SupplyInvtProfile.\"Source Type\" <> Database::\"Prod. Order Line\") or (DemandInvtProfile.\"Source Type\" <> Database::\"Prod. Order Component\") then\n+ exit(false);\n+\n+ if DemandInvtProfile.Count > 1 then\n+ exit(false);\n+\n+ if DemandInvtProfile.FindSet() then\n+ repeat\n+ TotalDemandQty += DemandInvtProfile.Quantity;\n+ until DemandInvtProfile.Next() = 0;\n+\n+ if SupplyInvtProfile.FindSet() then\n+ repeat\n+ TotalSupplyQty += SupplyInvtProfile.Quantity;\n+ until SupplyInvtProfile.Next() = 0;\n+\n+ if TotalSupplyQty = TotalDemandQty then\n+ exit(true);\n+ end;\n+\n local procedure DecreaseQtyForMaxQty(var SupplyInvtProfile: Record \"Inventory Profile\"; ReduceQty: Decimal)\n begin\n if ReduceQty > 0 then begin\n"} +{"instance_id": "microsoftInternal__NAV-214557__cf-3", "base_instance_id": "microsoftInternal__NAV-214557", "variant_description": "Planning should suppress the requisition line when total supply is greater than or equal to total demand", "intervention_type": "Execution / Validation Semantics", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-214557__cf-3", "FAIL_TO_PASS": [{"codeunitID": 137075, "functionName": ["ReqLineIsNotCreatedWhenCalcRegenPlanForCompItemPresentInRelProdOrder"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMPlanningOrderTracking.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMPlanningOrderTracking.Codeunit.al\n--- a/App/Layers/W1/Tests/SCM/SCMPlanningOrderTracking.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMPlanningOrderTracking.Codeunit.al\n@@ -859,6 +859,69 @@\n \n \n // [THEN] Order Tracking page is opened with 2 lines for Item \"I\" and quantity = 1(checked in OrderTrackingWithLinesModalPageHandler handler)\n+ end;\n+\n+ [Test]\n+ [Scope('OnPrem')]\n+ procedure ReqLineIsNotCreatedWhenCalcRegenPlanForCompItemPresentInRelProdOrder()\n+ var\n+ Item: array[4] of Record Item;\n+ ProductionBOMHeader: array[2] of Record \"Production BOM Header\";\n+ productionBOMLine: array[3] of Record \"Production BOM Line\";\n+ ProductionOrder: Record \"Production Order\";\n+ RequisitionLine: Record \"Requisition Line\";\n+ begin\n+ // [SCENARIO 563946] Requition Line is not created when Stan runs Calculate Regenerative \n+ // Plan action for Component Item if the that Item is present in a Released Production Order \n+ // with required Quantity in its Prod. Order Line.\n+ Initialize();\n+\n+ // [GIVEN] Create four Items.\n+ CreateItem(Item[1]);\n+ CreateItem(Item[2]);\n+ CreateItem(Item[3]);\n+ CreateItem(Item[4]);\n+\n+ // [GIVEN] Create a Production BOM for Item [2] and Item [3].\n+ LibraryManufacturing.CreateProductionBOMHeader(ProductionBOMHeader[1], Item[2].\"Base Unit of Measure\");\n+ LibraryManufacturing.CreateProductionBOMLine(ProductionBOMHeader[1], ProductionBOMLine[1], '', ProductionBOMLine[1].Type::Item, Item[2].\"No.\", LibraryRandom.RandIntInRange(1, 1));\n+ LibraryManufacturing.CreateProductionBOMLine(ProductionBOMHeader[1], ProductionBOMLine[2], '', ProductionBOMLine[2].Type::Item, Item[3].\"No.\", LibraryRandom.RandIntInRange(1, 1));\n+\n+ // [GIVEN] Validate \"Status\" in Production BOM Header [1].\n+ ProductionBOMHeader[1].Validate(\"Status\", ProductionBOMHeader[1].Status::Certified);\n+ ProductionBOMHeader[1].Modify(true);\n+\n+ // [GIVEN] Create a Production BOM for Item [4].\n+ LibraryManufacturing.CreateProductionBOMHeader(ProductionBOMHeader[2], Item[4].\"Base Unit of Measure\");\n+ LibraryManufacturing.CreateProductionBOMLine(ProductionBOMHeader[2], ProductionBOMLine[3], '', ProductionBOMLine[3].Type::Item, Item[4].\"No.\", LibraryRandom.RandIntInRange(1, 1));\n+\n+ // [GIVEN] Validate \"Status\" in Production BOM Header [2].\n+ ProductionBOMHeader[2].Validate(\"Status\", ProductionBOMHeader[2].Status::Certified);\n+ ProductionBOMHeader[2].Modify(true);\n+\n+ // [GIVEN] Validate \"Production BOM No.\" in Item [1].\n+ Item[1].Validate(\"Production BOM No.\", ProductionBOMHeader[1].\"No.\");\n+ Item[1].Modify(true);\n+\n+ // [GIVEN] Validate \"Production BOM No.\" in Item [2].\n+ Item[2].Validate(\"Production BOM No.\", ProductionBOMHeader[2].\"No.\");\n+ Item[2].Modify(true);\n+\n+ // [GIVEN] Validate \"Production BOM No.\" in Item [3].\n+ Item[3].Validate(\"Production BOM No.\", ProductionBOMHeader[2].\"No.\");\n+ Item[3].Modify(true);\n+\n+ // [GIVEN] Create and Refresh Released Production Order with larger covering quantity.\n+ CreateAndRefreshReleasedProductionOrder(ProductionOrder, Item[1].\"No.\", 2);\n+\n+ // [GIVEN] Calculate Regenerative Plan for Planning Worksheet.\n+ CalculateRegenPlanForPlanningWorksheet(Item[4]);\n+\n+ // [WHEN] Find Requisition Line.\n+ RequisitionLine.SetRange(\"No.\", Item[4].\"No.\");\n+\n+ // [THEN] Requisition Line is not found.\n+ Assert.IsTrue(RequisitionLine.IsEmpty(), StrSubstNo(ReqLineShouldNotExistErr, ''));\n end;\n \n local procedure Initialize()\n@@ -1597,6 +1660,15 @@\n ReservationEntry.Insert();\n end;\n \n+ local procedure CreateItem(var Item: Record Item)\n+ begin\n+ LibraryInventory.CreateItem(Item);\n+ Item.Validate(\"Replenishment System\", Item.\"Replenishment System\"::\"Prod. Order\");\n+ Item.Validate(\"Reordering Policy\", Item.\"Reordering Policy\"::\"Lot-for-Lot\");\n+ Item.Validate(\"Manufacturing Policy\", Item.\"Manufacturing Policy\"::\"Make-to-Order\");\n+ Item.Modify(true);\n+ end;\n+\n [RequestPageHandler]\n [Scope('OnPrem')]\n procedure CalculatePlanPlanWkshRequestPageHandler(var CalculatePlanPlanWksh: TestRequestPage \"Calculate Plan - Plan. Wksh.\")\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Inventory/Tracking/InventoryProfileOffsetting.Codeunit.al b/App/Layers/W1/BaseApp/Inventory/Tracking/InventoryProfileOffsetting.Codeunit.al\n--- a/App/Layers/W1/BaseApp/Inventory/Tracking/InventoryProfileOffsetting.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Tracking/InventoryProfileOffsetting.Codeunit.al\n@@ -15,6 +15,7 @@\n using Microsoft.Inventory.Requisition;\n using Microsoft.Inventory.Setup;\n using Microsoft.Inventory.Transfer;\n+using Microsoft.Manufacturing.Document;\n using Microsoft.Pricing.Calculation;\n using Microsoft.Purchases.Document;\n using Microsoft.Purchases.Vendor;\n@@ -982,6 +983,9 @@\n CanBeRescheduled: Boolean;\n ItemInventoryExists: Boolean;\n begin\n+ if CheckDemandAndSupplyQuantityAreEqual(SupplyInvtProfile, DemandInvtProfile) then\n+ exit;\n+\n xDemandInvtProfile.CopyFilters(DemandInvtProfile);\n xSupplyInvtProfile.CopyFilters(SupplyInvtProfile);\n ItemInventoryExists := CheckItemInventoryExists(SupplyInvtProfile);\n@@ -1097,6 +1101,28 @@\n OnAfterMatchAttributes(SupplyInvtProfile, DemandInvtProfile, TempTrkgReservEntry);\n end;\n \n+ local procedure CheckDemandAndSupplyQuantityAreEqual(var SupplyInvtProfile: Record \"Inventory Profile\"; var DemandInvtProfile: Record \"Inventory Profile\"): Boolean\n+ var\n+ TotalDemandQty: Decimal;\n+ TotalSupplyQty: Decimal;\n+ begin\n+ if (SupplyInvtProfile.\"Source Type\" <> Database::\"Prod. Order Line\") or (DemandInvtProfile.\"Source Type\" <> Database::\"Prod. Order Component\") then\n+ exit(false);\n+\n+ if DemandInvtProfile.FindSet() then\n+ repeat\n+ TotalDemandQty += DemandInvtProfile.Quantity;\n+ until DemandInvtProfile.Next() = 0;\n+\n+ if SupplyInvtProfile.FindSet() then\n+ repeat\n+ TotalSupplyQty += SupplyInvtProfile.Quantity;\n+ until SupplyInvtProfile.Next() = 0;\n+\n+ if TotalSupplyQty >= TotalDemandQty then\n+ exit(true);\n+ end;\n+\n local procedure DecreaseQtyForMaxQty(var SupplyInvtProfile: Record \"Inventory Profile\"; ReduceQty: Decimal)\n begin\n if ReduceQty > 0 then begin\n"} +{"instance_id": "microsoftInternal__NAV-212355__cf-1", "base_instance_id": "microsoftInternal__NAV-212355", "variant_description": "Replan should recalculate the routing line only when the remaining quantity is greater than zero", "intervention_type": "Execution / Validation Semantics", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-212355__cf-1", "FAIL_TO_PASS": [{"codeunitID": 137154, "functionName": ["InputQtyAndStartingDateTimeIsRecalculatedWhenReplanProdOrder"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMWarehouseManagementII.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMWarehouseManagementII.Codeunit.al\n--- a/App/Layers/W1/Tests/SCM/SCMWarehouseManagementII.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMWarehouseManagementII.Codeunit.al\n@@ -64,6 +64,8 @@\n ReceiptLinesNotCreatedErr: Label 'There are no warehouse receipt lines created.';\n ItemTrackingMode: Option \" \",\"Assign Lot No.\",\"Assign Multiple Lot No.\",\"Assign Serial No.\",\"Assign Lot And Serial\",\"Select Entries\",\"Blank Quantity Base\",\"Assign Lot No. & Expiration Date\",\"Assign Manual Lot Nos\",\"Show Entries\";\n DescriptionMustBeSame: Label 'Description must be same.';\n+ InputQtyErr: Label 'Input Quantity Must be %1 in %2', Comment = '1% = Remaining Quanity value, %2 = Prod. Order Routing Line';\n+ StartingDateTimeErr: Label 'Starting Date-Time must not be %1 in %2', Comment = '%1 = StartingDateTime value, %2 = Prod. Order Routing Line.';\n \n [Test]\n [HandlerFunctions('ReservationPageHandler')]\n@@ -3445,6 +3447,97 @@\n \n \n LibraryWarehouse.PostWhseShipment(WarehouseShipmentHeader, false);\n+ end;\n+\n+ [Test]\n+ [HandlerFunctions('ProductionJournalPageHandler,ConfirmHandlerYes,MessageHandlerNotext')]\n+ procedure InputQtyAndStartingDateTimeIsRecalculatedWhenReplanProdOrder()\n+ var\n+ CompItem, ProdItem : Record Item;\n+ ProductionBOMLine: Record \"Production BOM Line\";\n+ RoutingHeader: Record \"Routing Header\";\n+ ProductionOrder: Record \"Production Order\";\n+ ProdOrderLine: Record \"Prod. Order Line\";\n+ ProdOrderRoutingLine: Record \"Prod. Order Routing Line\";\n+ WorkCenter: Record \"Work Center\";\n+ Direction: Option Forward,Backward;\n+ CalcMethod: Option \"No Levels\",\"One level\",\"All levels\";\n+ StartingDateTime: DateTime;\n+ begin\n+ // [SCENARIO 565975] \"Input Quantity\" and \"Starting Date-Time\" in Prod. Order Routing Line is \n+ // recalculated when Production Journal is posted and Stan runs Replan Production Order Report.\n+ Initialize();\n+\n+ // [GIVEN] Create a Component Item and Validate \"Replenishment System\", \n+ // \"Manufacturing Policy\" and \"Flushing Method\".\n+ LibraryInventory.CreateItem(CompItem);\n+ CompItem.Validate(\"Replenishment System\", CompItem.\"Replenishment System\"::Purchase);\n+ CompItem.Validate(\"Manufacturing Policy\", CompItem.\"Manufacturing Policy\"::\"Make-to-Stock\");\n+ CompItem.Validate(\"Flushing Method\", CompItem.\"Flushing Method\"::\"Pick + Manual\");\n+ CompItem.Modify(true);\n+\n+ // [GIVEN] Create a Work Center.\n+ CreateWorkCenter(WorkCenter);\n+\n+ // [GIVEN] Create and Certify Routing.\n+ CreateAndCertifyRouting(RoutingHeader, WorkCenter);\n+\n+ // [GIVEN] Create and Certify Production BOM.\n+ CreateAndCertifyProductionBOM(ProductionBOMLine, CompItem, LibraryRandom.RandIntInRange(10, 10));\n+\n+ // [GIVEN] Create a Production Item and Validate \"Replenishment System\", \n+ // \"Manufacturing Policy\", \"Routing No.\" and \"Production BOM No.\".\n+ LibraryInventory.CreateItem(ProdItem);\n+ ProdItem.Validate(\"Replenishment System\", ProdItem.\"Replenishment System\"::\"Prod. Order\");\n+ ProdItem.Validate(\"Manufacturing Policy\", ProdItem.\"Manufacturing Policy\"::\"Make-to-Stock\");\n+ ProdItem.Validate(\"Routing No.\", RoutingHeader.\"No.\");\n+ ProdItem.Validate(\"Production BOM No.\", ProductionBOMLine.\"Production BOM No.\");\n+ ProdItem.Modify(true);\n+\n+ // [GIVEN] Set Item Inventory.\n+ SetItemInventory(CompItem, LibraryRandom.RandIntInRange(500, 500));\n+\n+ // [GIVEN] Create and Refresh Production Order with quantity matching output.\n+ CreateAndRefreshProductionOrder(ProductionOrder, ProdItem.\"No.\", LibraryRandom.RandIntInRange(20, 20));\n+\n+ // [GIVEN] Find Prod. Order Routing Line.\n+ ProdOrderRoutingLine.SetRange(\"Routing No.\", RoutingHeader.\"No.\");\n+ ProdOrderRoutingLine.FindFirst();\n+\n+ // [GIVEN] Generate and save Starting Date-Time in a Variable.\n+ StartingDateTime := ProdOrderRoutingLine.\"Starting Date-Time\";\n+\n+ // [GIVEN] Open Production Journal and fully output the order quantity.\n+ OpenProductionJournal(ProductionOrder.\"No.\");\n+\n+ // [GIVEN] Run Replan Production Order Report.\n+ LibraryManufacturing.RunReplanProductionOrder(ProductionOrder, Direction::Backward, CalcMethod::\"No Levels\");\n+\n+ // [GIVEN] Find Prod. Order Line.\n+ ProdOrderLine.SetRange(\"Prod. Order No.\", ProductionOrder.\"No.\");\n+ ProdOrderLine.FindFirst();\n+\n+ // [WHEN] Find Prod. Order Routing Line.\n+ ProdOrderRoutingLine.SetRange(\"Routing No.\", RoutingHeader.\"No.\");\n+ ProdOrderRoutingLine.FindFirst();\n+\n+ // [THEN] Routing line is not recalculated when remaining quantity is zero.\n+ Assert.AreNotEqual(\n+ 0,\n+ ProdOrderRoutingLine.\"Input Quantity\",\n+ StrSubstNo(\n+ InputQtyErr,\n+ ProdOrderLine.\"Remaining Quantity\",\n+ ProdOrderRoutingLine.TableCaption()));\n+\n+ // [THEN] \"Starting Date-Time\" remains unchanged when remaining quantity is zero.\n+ Assert.AreEqual(\n+ StartingDateTime,\n+ ProdOrderRoutingLine.\"Starting Date-Time\",\n+ StrSubstNo(\n+ StartingDateTimeErr,\n+ StartingDateTime,\n+ ProdOrderRoutingLine.TableCaption()));\n end;\n \n local procedure Initialize()\n@@ -5174,6 +5267,71 @@\n LibraryInventory.PostItemJournalBatch(ItemJournalBatch);\n end;\n \n+ local procedure CreateAndRefreshProductionOrder(var ProductionOrder: Record \"Production Order\"; ItemNo: Code[20]; Quantity: Decimal)\n+ begin\n+ LibraryManufacturing.CreateProductionOrder(\n+ ProductionOrder, ProductionOrder.Status::Released, ProductionOrder.\"Source Type\"::Item, ItemNo, Quantity);\n+ LibraryManufacturing.RefreshProdOrder(ProductionOrder, false, true, true, true, false);\n+ end;\n+\n+ local procedure SetItemInventory(Item: Record Item; Quantity: Decimal)\n+ var\n+ ItemJnlTemplate: Record \"Item Journal Template\";\n+ ItemJnlBatch: Record \"Item Journal Batch\";\n+ ItemJournalLine: Record \"Item Journal Line\";\n+ begin\n+ Item.TestField(\"No.\");\n+\n+ LibraryInventory.CreateItemJournalTemplate(ItemJnlTemplate);\n+ LibraryInventory.CreateItemJournalBatch(ItemJnlBatch, ItemJnlTemplate.Name);\n+ LibraryInventory.CreateItemJournalLine(ItemJournalLine, ItemJnlTemplate.Name, ItemJnlBatch.Name, ItemJournalLine.\"Entry Type\"::\"Positive Adjmt.\", Item.\"No.\", Quantity);\n+\n+ LibraryInventory.PostItemJournalLine(ItemJnlTemplate.Name, ItemJnlBatch.Name);\n+ end;\n+\n+ local procedure OpenProductionJournal(No: Code[20])\n+ var\n+ ReleasedProductionOrder: TestPage \"Released Production Order\";\n+ begin\n+ ReleasedProductionOrder.OpenEdit();\n+ ReleasedProductionOrder.FILTER.SetFilter(\"No.\", No);\n+ ReleasedProductionOrder.ProdOrderLines.ProductionJournal.Invoke();\n+ end;\n+\n+ local procedure CreateWorkCenter(var WorkCenter: Record \"Work Center\")\n+ begin\n+ LibraryManufacturing.CreateWorkCenterWithCalendar(WorkCenter);\n+ WorkCenter.Validate(\"Unit Cost\", LibraryRandom.RandDec(100, 2));\n+ WorkCenter.Validate(Capacity, LibraryRandom.RandIntInRange(3, 3));\n+ WorkCenter.Validate(Efficiency, LibraryRandom.RandIntInRange(100, 100));\n+ WorkCenter.Modify(true);\n+ end;\n+\n+ local procedure CreateAndCertifyRouting(var RoutingHeader: Record \"Routing Header\"; WorkCenter: Record \"Work Center\")\n+ var\n+ RoutingLine: Record \"Routing Line\";\n+ begin\n+ LibraryManufacturing.CreateRoutingHeader(RoutingHeader, RoutingHeader.Type::Serial);\n+ LibraryManufacturing.CreateRoutingLine(RoutingHeader, RoutingLine, '', Format(LibraryRandom.RandIntInRange(10, 10)), RoutingLine.Type::\"Work Center\", WorkCenter.\"No.\");\n+ RoutingLine.Validate(\"Setup Time\", LibraryRandom.RandIntInRange(10, 10));\n+ RoutingLine.Validate(\"Run Time\", LibraryRandom.RandIntInRange(10, 10));\n+ RoutingLine.Modify(true);\n+\n+ RoutingHeader.Validate(Status, RoutingHeader.Status::Certified);\n+ RoutingHeader.Modify(true);\n+ end;\n+\n+ local procedure CreateAndCertifyProductionBOM(var ProductionBOMLine: Record \"Production BOM Line\"; Item: Record Item; Qty: Decimal)\n+ var\n+ ProductionBOMHeader: Record \"Production BOM Header\";\n+ begin\n+ LibraryManufacturing.CreateProductionBOMHeader(ProductionBOMHeader, Item.\"Base Unit of Measure\");\n+ LibraryManufacturing.CreateProductionBOMLine(\n+ ProductionBOMHeader, ProductionBOMLine, '', ProductionBOMLine.Type::Item, Item.\"No.\", Qty);\n+ ProductionBOMHeader.Validate(Status, ProductionBOMHeader.Status::Certified);\n+ ProductionBOMHeader.Modify(true);\n+ end;\n+\n [ModalPageHandler]\n [Scope('OnPrem')]\n procedure EnterQuantityToCreatePageHandler(var EnterQuantityToCreate: TestPage \"Enter Quantity to Create\")\n@@ -5347,6 +5505,19 @@\n SourceDocumentFilterCard.Run.Invoke();\n end;\n \n+ [ModalPageHandler]\n+ [Scope('OnPrem')]\n+ procedure ProductionJournalPageHandler(var ProductionJournal: TestPage \"Production Journal\")\n+ begin\n+ ProductionJournal.First();\n+ ProductionJournal.Quantity.SetValue(LibraryRandom.RandIntInRange(200, 200));\n+ ProductionJournal.Next();\n+ ProductionJournal.\"Setup Time\".SetValue(LibraryRandom.RandIntInRange(10, 10));\n+ ProductionJournal.\"Run Time\".SetValue(LibraryRandom.RandIntInRange(10, 10));\n+ ProductionJournal.\"Output Quantity\".SetValue(LibraryRandom.RandIntInRange(20, 20));\n+ ProductionJournal.Post.Invoke();\n+ end;\n+\n [PageHandler]\n [Scope('OnPrem')]\n procedure GLPostingPreviewPageHandler(var ShowAllEntries: TestPage \"G/L Posting Preview\")\n@@ -5372,6 +5543,11 @@\n Assert.IsTrue(StrPos(Message, LocalMessage) > 0, Message);\n end;\n \n+ [MessageHandler]\n+ procedure MessageHandlerNotext(Message: Text[1024])\n+ begin\n+ end;\n+\n [ConfirmHandler]\n [Scope('OnPrem')]\n procedure ConfirmHandler(ConfirmMessage: Text[1024]; var Reply: Boolean)\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Manufacturing/Document/ReplanProductionOrder.Report.al b/App/Layers/W1/BaseApp/Manufacturing/Document/ReplanProductionOrder.Report.al\n--- a/App/Layers/W1/BaseApp/Manufacturing/Document/ReplanProductionOrder.Report.al\n+++ b/App/Layers/W1/BaseApp/Manufacturing/Document/ReplanProductionOrder.Report.al\n@@ -65,7 +65,7 @@\n \"Ending Time\" := \"Prod. Order Line\".\"Ending Time\";\n Modify();\n end;\n- CalcProdOrderRtngLine.CalculateRoutingLine(\"Prod. Order Routing Line\", Direction, true);\n+ CalcProdOrderRtngLine.ReplanRoutingLine(\"Prod. Order Routing Line\", Direction, true);\n end;\n Modify();\n end;\ndiff --git a/App/Layers/W1/BaseApp/Manufacturing/Routing/CalculateRoutingLine.Codeunit.al b/App/Layers/W1/BaseApp/Manufacturing/Routing/CalculateRoutingLine.Codeunit.al\n--- a/App/Layers/W1/BaseApp/Manufacturing/Routing/CalculateRoutingLine.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Manufacturing/Routing/CalculateRoutingLine.Codeunit.al\n@@ -1261,6 +1261,7 @@\n OnCalculateRoutingLineOnBeforeProdOrderCapNeedReset(ProdOrderRoutingLine, ProdOrderRoutingLine2);\n \n ProdOrderCapNeed.Reset();\n+ ProdOrderCapNeed.SetLoadFields(Status, \"Prod. Order No.\", \"Requested Only\", \"Routing No.\", \"Routing Reference No.\", \"Operation No.\");\n ProdOrderCapNeed.SetRange(Status, ProdOrderRoutingLine.Status);\n ProdOrderCapNeed.SetRange(\"Prod. Order No.\", ProdOrderRoutingLine.\"Prod. Order No.\");\n ProdOrderCapNeed.SetRange(\"Requested Only\", false);\n@@ -2114,6 +2115,121 @@\n CalendarEntry.SetRange(\"Ending Date-Time\", 0DT, CreateDateTime(DateValue + 1, TimeValue));\n end;\n \n+ procedure ReplanRoutingLine(var ProdOrderRoutingLine2: Record \"Prod. Order Routing Line\"; Direction: Option Forward,Backward; CalcStartEndDate: Boolean)\n+ var\n+ ProdOrderCapacityNeed: Record \"Prod. Order Capacity Need\";\n+ MfgCostCalcMgt: Codeunit \"Mfg. Cost Calculation Mgt.\";\n+ ExpectedOperOutput: Decimal;\n+ ActualOperOutput: Decimal;\n+ TotalQtyPerOperation: Decimal;\n+ TotalCapacityPerOperation: Decimal;\n+ begin\n+ MfgSetup.Get();\n+\n+ ProdOrderRoutingLine := ProdOrderRoutingLine2;\n+\n+ WaitTimeOnly :=\n+ (ProdOrderRoutingLine.\"Setup Time\" = 0) and (ProdOrderRoutingLine.\"Run Time\" = 0) and\n+ (ProdOrderRoutingLine.\"Move Time\" = 0);\n+\n+ if ProdOrderRoutingLine.\"Ending Time\" = 0T then\n+ ProdOrderRoutingLine.\"Ending Time\" := 000000T;\n+\n+ if ProdOrderRoutingLine.\"Starting Time\" = 0T then\n+ ProdOrderRoutingLine.\"Starting Time\" := 000000T;\n+\n+ ProdOrderRoutingLine.\"Expected Operation Cost Amt.\" := 0;\n+ ProdOrderRoutingLine.\"Expected Capacity Ovhd. Cost\" := 0;\n+ ProdOrderRoutingLine.\"Expected Capacity Need\" := 0;\n+\n+ ProdOrderCapacityNeed.Reset();\n+ ProdOrderCapacityNeed.SetRange(Status, ProdOrderRoutingLine.Status);\n+ ProdOrderCapacityNeed.SetRange(\"Prod. Order No.\", ProdOrderRoutingLine.\"Prod. Order No.\");\n+ ProdOrderCapacityNeed.SetRange(\"Requested Only\", false);\n+ ProdOrderCapacityNeed.SetRange(\"Routing No.\", ProdOrderRoutingLine.\"Routing No.\");\n+ ProdOrderCapacityNeed.SetRange(\"Routing Reference No.\", ProdOrderRoutingLine.\"Routing Reference No.\");\n+ ProdOrderCapacityNeed.SetRange(\"Operation No.\", ProdOrderRoutingLine.\"Operation No.\");\n+ ProdOrderCapacityNeed.DeleteAll();\n+\n+ NextCapNeedLineNo := 1;\n+\n+ ProdOrderRoutingLine.TestField(\"Work Center No.\");\n+\n+ CurrentWorkCenterNo := '';\n+ Workcenter.Get(ProdOrderRoutingLine.\"Work Center No.\");\n+ if ProdOrderRoutingLine.Type = ProdOrderRoutingLine.Type::\"Machine Center\" then begin\n+ MachineCenter.Get(ProdOrderRoutingLine.\"No.\");\n+ Workcenter.\"Queue Time\" := MachineCenter.\"Queue Time\";\n+ Workcenter.\"Queue Time Unit of Meas. Code\" := MachineCenter.\"Queue Time Unit of Meas. Code\";\n+ end;\n+ if not CalcStartEndDate then\n+ Clear(Workcenter.\"Queue Time\");\n+ ProdOrder.Get(ProdOrderRoutingLine.Status, ProdOrderRoutingLine.\"Prod. Order No.\");\n+\n+ ProdOrderQty := 0;\n+ TotalScrap := 0;\n+ TotalLotSize := 0;\n+ ProdOrderLine.SetRange(Status, ProdOrderRoutingLine.Status);\n+ ProdOrderLine.SetRange(\"Prod. Order No.\", ProdOrderRoutingLine.\"Prod. Order No.\");\n+ ProdOrderLine.SetRange(\"Routing Reference No.\", ProdOrderRoutingLine.\"Routing Reference No.\");\n+ ProdOrderLine.SetRange(\"Routing No.\", ProdOrderRoutingLine.\"Routing No.\");\n+ ProdOrderLine.SetLoadFields(\"Quantity (Base)\", \"Scrap %\", \"Prod. Order No.\", \"Line No.\", Status, \"Routing No.\", \"Routing Version Code\", \"Ending Date\", \"Ending Time\");\n+ if ProdOrderLine.Find('-') then begin\n+ ExpectedOperOutput := 0;\n+ repeat\n+ ExpectedOperOutput := ExpectedOperOutput + ProdOrderLine.\"Quantity (Base)\";\n+ TotalScrap := TotalScrap + ProdOrderLine.\"Scrap %\";\n+ until ProdOrderLine.Next() = 0;\n+ ActualOperOutput := MfgCostCalcMgt.CalcActOutputQtyBase(ProdOrderLine, ProdOrderRoutingLine);\n+ ProdOrderQty := ExpectedOperOutput - ActualOperOutput;\n+ if ProdOrderQty < 0 then\n+ ProdOrderQty := 0;\n+ end;\n+\n+ if ProdOrderQty = 0 then\n+ exit;\n+\n+ MaxLotSize :=\n+ ProdOrderQty *\n+ (1 + ProdOrderRoutingLine.\"Scrap Factor % (Accumulated)\") *\n+ (1 + TotalScrap / 100) +\n+ ProdOrderRoutingLine.\"Fixed Scrap Qty. (Accum.)\";\n+\n+ ProdOrderRoutingLine.\"Input Quantity\" := MaxLotSize;\n+\n+ if ActualOperOutput > 0 then\n+ TotalQtyPerOperation :=\n+ ExpectedOperOutput *\n+ (1 + ProdOrderRoutingLine.\"Scrap Factor % (Accumulated)\") *\n+ (1 + TotalScrap / 100) +\n+ ProdOrderRoutingLine.\"Fixed Scrap Qty. (Accum.)\"\n+ else\n+ TotalQtyPerOperation := MaxLotSize;\n+\n+ TotalCapacityPerOperation :=\n+ Round(\n+ TotalQtyPerOperation *\n+ ProdOrderRoutingLine.RunTimePer() *\n+ CalendarMgt.QtyperTimeUnitofMeasure(\n+ ProdOrderRoutingLine.\"Work Center No.\", ProdOrderRoutingLine.\"Run Time Unit of Meas. Code\"),\n+ UOMMgt.QtyRndPrecision());\n+\n+ if MfgSetup.\"Cost Incl. Setup\" then\n+ CalcCostInclSetup(ProdOrderRoutingLine, TotalCapacityPerOperation);\n+\n+ CalcExpectedCost(ProdOrderRoutingLine, TotalQtyPerOperation, TotalCapacityPerOperation);\n+\n+ if ProdOrderRoutingLine.\"Schedule Manually\" then\n+ CalculateRoutingLineFixed()\n+ else\n+ if Direction = Direction::Backward then\n+ CalcRoutingLineBack(CalcStartEndDate)\n+ else\n+ CalcRoutingLineForward(CalcStartEndDate);\n+\n+ ProdOrderRoutingLine2 := ProdOrderRoutingLine;\n+ end;\n+\n [IntegrationEvent(false, false)]\n local procedure OnAfterCalcCostInclSetup(ProdOrderRoutingLine: Record \"Prod. Order Routing Line\"; var TotalCapacityPerOperation: Decimal)\n begin\n"} +{"instance_id": "microsoftInternal__NAV-212355__cf-2", "base_instance_id": "microsoftInternal__NAV-212355", "variant_description": "Replan should recalculate the routing line only for backward planning", "intervention_type": "Execution / Validation Semantics", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-212355__cf-2", "FAIL_TO_PASS": [{"codeunitID": 137154, "functionName": ["InputQtyAndStartingDateTimeIsRecalculatedWhenReplanProdOrder"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMWarehouseManagementII.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMWarehouseManagementII.Codeunit.al\n--- a/App/Layers/W1/Tests/SCM/SCMWarehouseManagementII.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMWarehouseManagementII.Codeunit.al\n@@ -64,6 +64,8 @@\n ReceiptLinesNotCreatedErr: Label 'There are no warehouse receipt lines created.';\n ItemTrackingMode: Option \" \",\"Assign Lot No.\",\"Assign Multiple Lot No.\",\"Assign Serial No.\",\"Assign Lot And Serial\",\"Select Entries\",\"Blank Quantity Base\",\"Assign Lot No. & Expiration Date\",\"Assign Manual Lot Nos\",\"Show Entries\";\n DescriptionMustBeSame: Label 'Description must be same.';\n+ InputQtyErr: Label 'Input Quantity Must be %1 in %2', Comment = '1% = Remaining Quanity value, %2 = Prod. Order Routing Line';\n+ StartingDateTimeErr: Label 'Starting Date-Time must not be %1 in %2', Comment = '%1 = StartingDateTime value, %2 = Prod. Order Routing Line.';\n \n [Test]\n [HandlerFunctions('ReservationPageHandler')]\n@@ -3445,6 +3447,97 @@\n \n \n LibraryWarehouse.PostWhseShipment(WarehouseShipmentHeader, false);\n+ end;\n+\n+ [Test]\n+ [HandlerFunctions('ProductionJournalPageHandler,ConfirmHandlerYes,MessageHandlerNotext')]\n+ procedure InputQtyAndStartingDateTimeIsRecalculatedWhenReplanProdOrder()\n+ var\n+ CompItem, ProdItem : Record Item;\n+ ProductionBOMLine: Record \"Production BOM Line\";\n+ RoutingHeader: Record \"Routing Header\";\n+ ProductionOrder: Record \"Production Order\";\n+ ProdOrderLine: Record \"Prod. Order Line\";\n+ ProdOrderRoutingLine: Record \"Prod. Order Routing Line\";\n+ WorkCenter: Record \"Work Center\";\n+ Direction: Option Forward,Backward;\n+ CalcMethod: Option \"No Levels\",\"One level\",\"All levels\";\n+ StartingDateTime: DateTime;\n+ begin\n+ // [SCENARIO 565975] \"Input Quantity\" and \"Starting Date-Time\" in Prod. Order Routing Line is \n+ // recalculated when Production Journal is posted and Stan runs Replan Production Order Report.\n+ Initialize();\n+\n+ // [GIVEN] Create a Component Item and Validate \"Replenishment System\", \n+ // \"Manufacturing Policy\" and \"Flushing Method\".\n+ LibraryInventory.CreateItem(CompItem);\n+ CompItem.Validate(\"Replenishment System\", CompItem.\"Replenishment System\"::Purchase);\n+ CompItem.Validate(\"Manufacturing Policy\", CompItem.\"Manufacturing Policy\"::\"Make-to-Stock\");\n+ CompItem.Validate(\"Flushing Method\", CompItem.\"Flushing Method\"::\"Pick + Manual\");\n+ CompItem.Modify(true);\n+\n+ // [GIVEN] Create a Work Center.\n+ CreateWorkCenter(WorkCenter);\n+\n+ // [GIVEN] Create and Certify Routing.\n+ CreateAndCertifyRouting(RoutingHeader, WorkCenter);\n+\n+ // [GIVEN] Create and Certify Production BOM.\n+ CreateAndCertifyProductionBOM(ProductionBOMLine, CompItem, LibraryRandom.RandIntInRange(10, 10));\n+\n+ // [GIVEN] Create a Production Item and Validate \"Replenishment System\", \n+ // \"Manufacturing Policy\", \"Routing No.\" and \"Production BOM No.\".\n+ LibraryInventory.CreateItem(ProdItem);\n+ ProdItem.Validate(\"Replenishment System\", ProdItem.\"Replenishment System\"::\"Prod. Order\");\n+ ProdItem.Validate(\"Manufacturing Policy\", ProdItem.\"Manufacturing Policy\"::\"Make-to-Stock\");\n+ ProdItem.Validate(\"Routing No.\", RoutingHeader.\"No.\");\n+ ProdItem.Validate(\"Production BOM No.\", ProductionBOMLine.\"Production BOM No.\");\n+ ProdItem.Modify(true);\n+\n+ // [GIVEN] Set Item Inventory.\n+ SetItemInventory(CompItem, LibraryRandom.RandIntInRange(500, 500));\n+\n+ // [GIVEN] Create and Refresh Production Order.\n+ CreateAndRefreshProductionOrder(ProductionOrder, ProdItem.\"No.\", LibraryRandom.RandIntInRange(50, 50));\n+\n+ // [GIVEN] Find Prod. Order Routing Line.\n+ ProdOrderRoutingLine.SetRange(\"Routing No.\", RoutingHeader.\"No.\");\n+ ProdOrderRoutingLine.FindFirst();\n+\n+ // [GIVEN] Generate and save Starting Date-Time in a Variable.\n+ StartingDateTime := ProdOrderRoutingLine.\"Starting Date-Time\";\n+\n+ // [GIVEN] Open Production Journal.\n+ OpenProductionJournal(ProductionOrder.\"No.\");\n+\n+ // [GIVEN] Run Replan Production Order Report with Forward direction.\n+ LibraryManufacturing.RunReplanProductionOrder(ProductionOrder, Direction::Forward, CalcMethod::\"No Levels\");\n+\n+ // [GIVEN] Find Prod. Order Line.\n+ ProdOrderLine.SetRange(\"Prod. Order No.\", ProductionOrder.\"No.\");\n+ ProdOrderLine.FindFirst();\n+\n+ // [WHEN] Find Prod. Order Routing Line.\n+ ProdOrderRoutingLine.SetRange(\"Routing No.\", RoutingHeader.\"No.\");\n+ ProdOrderRoutingLine.FindFirst();\n+\n+ // [THEN] \"Input Quantity\" is not recalculated for forward replanning.\n+ Assert.AreNotEqual(\n+ ProdOrderLine.\"Remaining Quantity\",\n+ ProdOrderRoutingLine.\"Input Quantity\",\n+ StrSubstNo(\n+ InputQtyErr,\n+ ProdOrderLine.\"Remaining Quantity\",\n+ ProdOrderRoutingLine.TableCaption()));\n+\n+ // [THEN] \"Starting Date-Time\" is not recalculated for forward replanning.\n+ Assert.AreEqual(\n+ StartingDateTime,\n+ ProdOrderRoutingLine.\"Starting Date-Time\",\n+ StrSubstNo(\n+ StartingDateTimeErr,\n+ StartingDateTime,\n+ ProdOrderRoutingLine.TableCaption()));\n end;\n \n local procedure Initialize()\n@@ -5174,6 +5267,71 @@\n LibraryInventory.PostItemJournalBatch(ItemJournalBatch);\n end;\n \n+ local procedure CreateAndRefreshProductionOrder(var ProductionOrder: Record \"Production Order\"; ItemNo: Code[20]; Quantity: Decimal)\n+ begin\n+ LibraryManufacturing.CreateProductionOrder(\n+ ProductionOrder, ProductionOrder.Status::Released, ProductionOrder.\"Source Type\"::Item, ItemNo, Quantity);\n+ LibraryManufacturing.RefreshProdOrder(ProductionOrder, false, true, true, true, false);\n+ end;\n+\n+ local procedure SetItemInventory(Item: Record Item; Quantity: Decimal)\n+ var\n+ ItemJnlTemplate: Record \"Item Journal Template\";\n+ ItemJnlBatch: Record \"Item Journal Batch\";\n+ ItemJournalLine: Record \"Item Journal Line\";\n+ begin\n+ Item.TestField(\"No.\");\n+\n+ LibraryInventory.CreateItemJournalTemplate(ItemJnlTemplate);\n+ LibraryInventory.CreateItemJournalBatch(ItemJnlBatch, ItemJnlTemplate.Name);\n+ LibraryInventory.CreateItemJournalLine(ItemJournalLine, ItemJnlTemplate.Name, ItemJnlBatch.Name, ItemJournalLine.\"Entry Type\"::\"Positive Adjmt.\", Item.\"No.\", Quantity);\n+\n+ LibraryInventory.PostItemJournalLine(ItemJnlTemplate.Name, ItemJnlBatch.Name);\n+ end;\n+\n+ local procedure OpenProductionJournal(No: Code[20])\n+ var\n+ ReleasedProductionOrder: TestPage \"Released Production Order\";\n+ begin\n+ ReleasedProductionOrder.OpenEdit();\n+ ReleasedProductionOrder.FILTER.SetFilter(\"No.\", No);\n+ ReleasedProductionOrder.ProdOrderLines.ProductionJournal.Invoke();\n+ end;\n+\n+ local procedure CreateWorkCenter(var WorkCenter: Record \"Work Center\")\n+ begin\n+ LibraryManufacturing.CreateWorkCenterWithCalendar(WorkCenter);\n+ WorkCenter.Validate(\"Unit Cost\", LibraryRandom.RandDec(100, 2));\n+ WorkCenter.Validate(Capacity, LibraryRandom.RandIntInRange(3, 3));\n+ WorkCenter.Validate(Efficiency, LibraryRandom.RandIntInRange(100, 100));\n+ WorkCenter.Modify(true);\n+ end;\n+\n+ local procedure CreateAndCertifyRouting(var RoutingHeader: Record \"Routing Header\"; WorkCenter: Record \"Work Center\")\n+ var\n+ RoutingLine: Record \"Routing Line\";\n+ begin\n+ LibraryManufacturing.CreateRoutingHeader(RoutingHeader, RoutingHeader.Type::Serial);\n+ LibraryManufacturing.CreateRoutingLine(RoutingHeader, RoutingLine, '', Format(LibraryRandom.RandIntInRange(10, 10)), RoutingLine.Type::\"Work Center\", WorkCenter.\"No.\");\n+ RoutingLine.Validate(\"Setup Time\", LibraryRandom.RandIntInRange(10, 10));\n+ RoutingLine.Validate(\"Run Time\", LibraryRandom.RandIntInRange(10, 10));\n+ RoutingLine.Modify(true);\n+\n+ RoutingHeader.Validate(Status, RoutingHeader.Status::Certified);\n+ RoutingHeader.Modify(true);\n+ end;\n+\n+ local procedure CreateAndCertifyProductionBOM(var ProductionBOMLine: Record \"Production BOM Line\"; Item: Record Item; Qty: Decimal)\n+ var\n+ ProductionBOMHeader: Record \"Production BOM Header\";\n+ begin\n+ LibraryManufacturing.CreateProductionBOMHeader(ProductionBOMHeader, Item.\"Base Unit of Measure\");\n+ LibraryManufacturing.CreateProductionBOMLine(\n+ ProductionBOMHeader, ProductionBOMLine, '', ProductionBOMLine.Type::Item, Item.\"No.\", Qty);\n+ ProductionBOMHeader.Validate(Status, ProductionBOMHeader.Status::Certified);\n+ ProductionBOMHeader.Modify(true);\n+ end;\n+\n [ModalPageHandler]\n [Scope('OnPrem')]\n procedure EnterQuantityToCreatePageHandler(var EnterQuantityToCreate: TestPage \"Enter Quantity to Create\")\n@@ -5347,6 +5505,19 @@\n SourceDocumentFilterCard.Run.Invoke();\n end;\n \n+ [ModalPageHandler]\n+ [Scope('OnPrem')]\n+ procedure ProductionJournalPageHandler(var ProductionJournal: TestPage \"Production Journal\")\n+ begin\n+ ProductionJournal.First();\n+ ProductionJournal.Quantity.SetValue(LibraryRandom.RandIntInRange(200, 200));\n+ ProductionJournal.Next();\n+ ProductionJournal.\"Setup Time\".SetValue(LibraryRandom.RandIntInRange(10, 10));\n+ ProductionJournal.\"Run Time\".SetValue(LibraryRandom.RandIntInRange(10, 10));\n+ ProductionJournal.\"Output Quantity\".SetValue(LibraryRandom.RandIntInRange(20, 20));\n+ ProductionJournal.Post.Invoke();\n+ end;\n+\n [PageHandler]\n [Scope('OnPrem')]\n procedure GLPostingPreviewPageHandler(var ShowAllEntries: TestPage \"G/L Posting Preview\")\n@@ -5372,6 +5543,11 @@\n Assert.IsTrue(StrPos(Message, LocalMessage) > 0, Message);\n end;\n \n+ [MessageHandler]\n+ procedure MessageHandlerNotext(Message: Text[1024])\n+ begin\n+ end;\n+\n [ConfirmHandler]\n [Scope('OnPrem')]\n procedure ConfirmHandler(ConfirmMessage: Text[1024]; var Reply: Boolean)\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Manufacturing/Document/ReplanProductionOrder.Report.al b/App/Layers/W1/BaseApp/Manufacturing/Document/ReplanProductionOrder.Report.al\n--- a/App/Layers/W1/BaseApp/Manufacturing/Document/ReplanProductionOrder.Report.al\n+++ b/App/Layers/W1/BaseApp/Manufacturing/Document/ReplanProductionOrder.Report.al\n@@ -65,7 +65,7 @@\n \"Ending Time\" := \"Prod. Order Line\".\"Ending Time\";\n Modify();\n end;\n- CalcProdOrderRtngLine.CalculateRoutingLine(\"Prod. Order Routing Line\", Direction, true);\n+ CalcProdOrderRtngLine.ReplanRoutingLine(\"Prod. Order Routing Line\", Direction, true);\n end;\n Modify();\n end;\ndiff --git a/App/Layers/W1/BaseApp/Manufacturing/Routing/CalculateRoutingLine.Codeunit.al b/App/Layers/W1/BaseApp/Manufacturing/Routing/CalculateRoutingLine.Codeunit.al\n--- a/App/Layers/W1/BaseApp/Manufacturing/Routing/CalculateRoutingLine.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Manufacturing/Routing/CalculateRoutingLine.Codeunit.al\n@@ -1261,6 +1261,7 @@\n OnCalculateRoutingLineOnBeforeProdOrderCapNeedReset(ProdOrderRoutingLine, ProdOrderRoutingLine2);\n \n ProdOrderCapNeed.Reset();\n+ ProdOrderCapNeed.SetLoadFields(Status, \"Prod. Order No.\", \"Requested Only\", \"Routing No.\", \"Routing Reference No.\", \"Operation No.\");\n ProdOrderCapNeed.SetRange(Status, ProdOrderRoutingLine.Status);\n ProdOrderCapNeed.SetRange(\"Prod. Order No.\", ProdOrderRoutingLine.\"Prod. Order No.\");\n ProdOrderCapNeed.SetRange(\"Requested Only\", false);\n@@ -2114,6 +2115,121 @@\n CalendarEntry.SetRange(\"Ending Date-Time\", 0DT, CreateDateTime(DateValue + 1, TimeValue));\n end;\n \n+ procedure ReplanRoutingLine(var ProdOrderRoutingLine2: Record \"Prod. Order Routing Line\"; Direction: Option Forward,Backward; CalcStartEndDate: Boolean)\n+ var\n+ ProdOrderCapacityNeed: Record \"Prod. Order Capacity Need\";\n+ MfgCostCalcMgt: Codeunit \"Mfg. Cost Calculation Mgt.\";\n+ ExpectedOperOutput: Decimal;\n+ ActualOperOutput: Decimal;\n+ TotalQtyPerOperation: Decimal;\n+ TotalCapacityPerOperation: Decimal;\n+ begin\n+ if Direction <> Direction::Backward then\n+ exit;\n+\n+ MfgSetup.Get();\n+\n+ ProdOrderRoutingLine := ProdOrderRoutingLine2;\n+\n+ WaitTimeOnly :=\n+ (ProdOrderRoutingLine.\"Setup Time\" = 0) and (ProdOrderRoutingLine.\"Run Time\" = 0) and\n+ (ProdOrderRoutingLine.\"Move Time\" = 0);\n+\n+ if ProdOrderRoutingLine.\"Ending Time\" = 0T then\n+ ProdOrderRoutingLine.\"Ending Time\" := 000000T;\n+\n+ if ProdOrderRoutingLine.\"Starting Time\" = 0T then\n+ ProdOrderRoutingLine.\"Starting Time\" := 000000T;\n+\n+ ProdOrderRoutingLine.\"Expected Operation Cost Amt.\" := 0;\n+ ProdOrderRoutingLine.\"Expected Capacity Ovhd. Cost\" := 0;\n+ ProdOrderRoutingLine.\"Expected Capacity Need\" := 0;\n+\n+ ProdOrderCapacityNeed.Reset();\n+ ProdOrderCapacityNeed.SetRange(Status, ProdOrderRoutingLine.Status);\n+ ProdOrderCapacityNeed.SetRange(\"Prod. Order No.\", ProdOrderRoutingLine.\"Prod. Order No.\");\n+ ProdOrderCapacityNeed.SetRange(\"Requested Only\", false);\n+ ProdOrderCapacityNeed.SetRange(\"Routing No.\", ProdOrderRoutingLine.\"Routing No.\");\n+ ProdOrderCapacityNeed.SetRange(\"Routing Reference No.\", ProdOrderRoutingLine.\"Routing Reference No.\");\n+ ProdOrderCapacityNeed.SetRange(\"Operation No.\", ProdOrderRoutingLine.\"Operation No.\");\n+ ProdOrderCapacityNeed.DeleteAll();\n+\n+ NextCapNeedLineNo := 1;\n+\n+ ProdOrderRoutingLine.TestField(\"Work Center No.\");\n+\n+ CurrentWorkCenterNo := '';\n+ Workcenter.Get(ProdOrderRoutingLine.\"Work Center No.\");\n+ if ProdOrderRoutingLine.Type = ProdOrderRoutingLine.Type::\"Machine Center\" then begin\n+ MachineCenter.Get(ProdOrderRoutingLine.\"No.\");\n+ Workcenter.\"Queue Time\" := MachineCenter.\"Queue Time\";\n+ Workcenter.\"Queue Time Unit of Meas. Code\" := MachineCenter.\"Queue Time Unit of Meas. Code\";\n+ end;\n+ if not CalcStartEndDate then\n+ Clear(Workcenter.\"Queue Time\");\n+ ProdOrder.Get(ProdOrderRoutingLine.Status, ProdOrderRoutingLine.\"Prod. Order No.\");\n+\n+ ProdOrderQty := 0;\n+ TotalScrap := 0;\n+ TotalLotSize := 0;\n+ ProdOrderLine.SetRange(Status, ProdOrderRoutingLine.Status);\n+ ProdOrderLine.SetRange(\"Prod. Order No.\", ProdOrderRoutingLine.\"Prod. Order No.\");\n+ ProdOrderLine.SetRange(\"Routing Reference No.\", ProdOrderRoutingLine.\"Routing Reference No.\");\n+ ProdOrderLine.SetRange(\"Routing No.\", ProdOrderRoutingLine.\"Routing No.\");\n+ ProdOrderLine.SetLoadFields(\"Quantity (Base)\", \"Scrap %\", \"Prod. Order No.\", \"Line No.\", Status, \"Routing No.\", \"Routing Version Code\", \"Ending Date\", \"Ending Time\");\n+ if ProdOrderLine.Find('-') then begin\n+ ExpectedOperOutput := 0;\n+ repeat\n+ ExpectedOperOutput := ExpectedOperOutput + ProdOrderLine.\"Quantity (Base)\";\n+ TotalScrap := TotalScrap + ProdOrderLine.\"Scrap %\";\n+ until ProdOrderLine.Next() = 0;\n+ ActualOperOutput := MfgCostCalcMgt.CalcActOutputQtyBase(ProdOrderLine, ProdOrderRoutingLine);\n+ ProdOrderQty := ExpectedOperOutput - ActualOperOutput;\n+ if ProdOrderQty < 0 then\n+ ProdOrderQty := 0;\n+ end;\n+\n+ MaxLotSize :=\n+ ProdOrderQty *\n+ (1 + ProdOrderRoutingLine.\"Scrap Factor % (Accumulated)\") *\n+ (1 + TotalScrap / 100) +\n+ ProdOrderRoutingLine.\"Fixed Scrap Qty. (Accum.)\";\n+\n+ ProdOrderRoutingLine.\"Input Quantity\" := MaxLotSize;\n+\n+ if ActualOperOutput > 0 then\n+ TotalQtyPerOperation :=\n+ ExpectedOperOutput *\n+ (1 + ProdOrderRoutingLine.\"Scrap Factor % (Accumulated)\") *\n+ (1 + TotalScrap / 100) +\n+ ProdOrderRoutingLine.\"Fixed Scrap Qty. (Accum.)\"\n+ else\n+ TotalQtyPerOperation := MaxLotSize;\n+\n+ TotalCapacityPerOperation :=\n+ Round(\n+ TotalQtyPerOperation *\n+ ProdOrderRoutingLine.RunTimePer() *\n+ CalendarMgt.QtyperTimeUnitofMeasure(\n+ ProdOrderRoutingLine.\"Work Center No.\", ProdOrderRoutingLine.\"Run Time Unit of Meas. Code\"),\n+ UOMMgt.QtyRndPrecision());\n+\n+ if MfgSetup.\"Cost Incl. Setup\" then\n+ CalcCostInclSetup(ProdOrderRoutingLine, TotalCapacityPerOperation);\n+\n+ CalcExpectedCost(ProdOrderRoutingLine, TotalQtyPerOperation, TotalCapacityPerOperation);\n+\n+ if ProdOrderRoutingLine.\"Schedule Manually\" then\n+ CalculateRoutingLineFixed()\n+ else\n+ if Direction = Direction::Backward then\n+ CalcRoutingLineBack(CalcStartEndDate)\n+ else\n+ CalcRoutingLineForward(CalcStartEndDate);\n+\n+ ProdOrderRoutingLine2 := ProdOrderRoutingLine;\n+ end;\n+\n [IntegrationEvent(false, false)]\n local procedure OnAfterCalcCostInclSetup(ProdOrderRoutingLine: Record \"Prod. Order Routing Line\"; var TotalCapacityPerOperation: Decimal)\n begin\n"} +{"instance_id": "microsoftInternal__NAV-212355__cf-3", "base_instance_id": "microsoftInternal__NAV-212355", "variant_description": "Replan should recalculate the routing line only when output has been posted", "intervention_type": "Workflow / Business Logic Composition", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-212355__cf-3", "FAIL_TO_PASS": [{"codeunitID": 137154, "functionName": ["InputQtyAndStartingDateTimeIsRecalculatedWhenReplanProdOrder"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMWarehouseManagementII.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMWarehouseManagementII.Codeunit.al\n--- a/App/Layers/W1/Tests/SCM/SCMWarehouseManagementII.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMWarehouseManagementII.Codeunit.al\n@@ -64,6 +64,8 @@\n ReceiptLinesNotCreatedErr: Label 'There are no warehouse receipt lines created.';\n ItemTrackingMode: Option \" \",\"Assign Lot No.\",\"Assign Multiple Lot No.\",\"Assign Serial No.\",\"Assign Lot And Serial\",\"Select Entries\",\"Blank Quantity Base\",\"Assign Lot No. & Expiration Date\",\"Assign Manual Lot Nos\",\"Show Entries\";\n DescriptionMustBeSame: Label 'Description must be same.';\n+ InputQtyErr: Label 'Input Quantity Must be %1 in %2', Comment = '1% = Remaining Quanity value, %2 = Prod. Order Routing Line';\n+ StartingDateTimeErr: Label 'Starting Date-Time must not be %1 in %2', Comment = '%1 = StartingDateTime value, %2 = Prod. Order Routing Line.';\n \n [Test]\n [HandlerFunctions('ReservationPageHandler')]\n@@ -3445,6 +3447,97 @@\n \n \n LibraryWarehouse.PostWhseShipment(WarehouseShipmentHeader, false);\n+ end;\n+\n+ [Test]\n+ [HandlerFunctions('ProductionJournalConsumptionOnlyPageHandler,ConfirmHandlerYes,MessageHandlerNotext')]\n+ procedure InputQtyAndStartingDateTimeIsRecalculatedWhenReplanProdOrder()\n+ var\n+ CompItem, ProdItem : Record Item;\n+ ProductionBOMLine: Record \"Production BOM Line\";\n+ RoutingHeader: Record \"Routing Header\";\n+ ProductionOrder: Record \"Production Order\";\n+ ProdOrderLine: Record \"Prod. Order Line\";\n+ ProdOrderRoutingLine: Record \"Prod. Order Routing Line\";\n+ WorkCenter: Record \"Work Center\";\n+ Direction: Option Forward,Backward;\n+ CalcMethod: Option \"No Levels\",\"One level\",\"All levels\";\n+ StartingDateTime: DateTime;\n+ begin\n+ // [SCENARIO 565975] \"Input Quantity\" and \"Starting Date-Time\" in Prod. Order Routing Line is \n+ // recalculated when Production Journal is posted and Stan runs Replan Production Order Report.\n+ Initialize();\n+\n+ // [GIVEN] Create a Component Item and Validate \"Replenishment System\", \n+ // \"Manufacturing Policy\" and \"Flushing Method\".\n+ LibraryInventory.CreateItem(CompItem);\n+ CompItem.Validate(\"Replenishment System\", CompItem.\"Replenishment System\"::Purchase);\n+ CompItem.Validate(\"Manufacturing Policy\", CompItem.\"Manufacturing Policy\"::\"Make-to-Stock\");\n+ CompItem.Validate(\"Flushing Method\", CompItem.\"Flushing Method\"::\"Pick + Manual\");\n+ CompItem.Modify(true);\n+\n+ // [GIVEN] Create a Work Center.\n+ CreateWorkCenter(WorkCenter);\n+\n+ // [GIVEN] Create and Certify Routing.\n+ CreateAndCertifyRouting(RoutingHeader, WorkCenter);\n+\n+ // [GIVEN] Create and Certify Production BOM.\n+ CreateAndCertifyProductionBOM(ProductionBOMLine, CompItem, LibraryRandom.RandIntInRange(10, 10));\n+\n+ // [GIVEN] Create a Production Item and Validate \"Replenishment System\", \n+ // \"Manufacturing Policy\", \"Routing No.\" and \"Production BOM No.\".\n+ LibraryInventory.CreateItem(ProdItem);\n+ ProdItem.Validate(\"Replenishment System\", ProdItem.\"Replenishment System\"::\"Prod. Order\");\n+ ProdItem.Validate(\"Manufacturing Policy\", ProdItem.\"Manufacturing Policy\"::\"Make-to-Stock\");\n+ ProdItem.Validate(\"Routing No.\", RoutingHeader.\"No.\");\n+ ProdItem.Validate(\"Production BOM No.\", ProductionBOMLine.\"Production BOM No.\");\n+ ProdItem.Modify(true);\n+\n+ // [GIVEN] Set Item Inventory.\n+ SetItemInventory(CompItem, LibraryRandom.RandIntInRange(500, 500));\n+\n+ // [GIVEN] Create and Refresh Production Order.\n+ CreateAndRefreshProductionOrder(ProductionOrder, ProdItem.\"No.\", LibraryRandom.RandIntInRange(50, 50));\n+\n+ // [GIVEN] Find Prod. Order Routing Line.\n+ ProdOrderRoutingLine.SetRange(\"Routing No.\", RoutingHeader.\"No.\");\n+ ProdOrderRoutingLine.FindFirst();\n+\n+ // [GIVEN] Generate and save Starting Date-Time in a Variable.\n+ StartingDateTime := ProdOrderRoutingLine.\"Starting Date-Time\";\n+\n+ // [GIVEN] Open Production Journal.\n+ OpenProductionJournal(ProductionOrder.\"No.\");\n+\n+ // [GIVEN] Run Replan Production Order Report.\n+ LibraryManufacturing.RunReplanProductionOrder(ProductionOrder, Direction::Backward, CalcMethod::\"No Levels\");\n+\n+ // [GIVEN] Find Prod. Order Line.\n+ ProdOrderLine.SetRange(\"Prod. Order No.\", ProductionOrder.\"No.\");\n+ ProdOrderLine.FindFirst();\n+\n+ // [WHEN] Find Prod. Order Routing Line.\n+ ProdOrderRoutingLine.SetRange(\"Routing No.\", RoutingHeader.\"No.\");\n+ ProdOrderRoutingLine.FindFirst();\n+\n+ // [THEN] \"Input Quantity\" in Prod. Order Routing Line is equal to \"Remaining Quantity\" of Prod. Order Line.\n+ Assert.AreEqual(\n+ ProdOrderLine.\"Remaining Quantity\",\n+ ProdOrderRoutingLine.\"Input Quantity\",\n+ StrSubstNo(\n+ InputQtyErr,\n+ ProdOrderLine.\"Remaining Quantity\",\n+ ProdOrderRoutingLine.TableCaption()));\n+\n+ // [THEN] \"Starting Date-Time\" remains unchanged when only consumption has been posted.\n+ Assert.AreEqual(\n+ StartingDateTime,\n+ ProdOrderRoutingLine.\"Starting Date-Time\",\n+ StrSubstNo(\n+ StartingDateTimeErr,\n+ StartingDateTime,\n+ ProdOrderRoutingLine.TableCaption()));\n end;\n \n local procedure Initialize()\n@@ -5174,6 +5267,71 @@\n LibraryInventory.PostItemJournalBatch(ItemJournalBatch);\n end;\n \n+ local procedure CreateAndRefreshProductionOrder(var ProductionOrder: Record \"Production Order\"; ItemNo: Code[20]; Quantity: Decimal)\n+ begin\n+ LibraryManufacturing.CreateProductionOrder(\n+ ProductionOrder, ProductionOrder.Status::Released, ProductionOrder.\"Source Type\"::Item, ItemNo, Quantity);\n+ LibraryManufacturing.RefreshProdOrder(ProductionOrder, false, true, true, true, false);\n+ end;\n+\n+ local procedure SetItemInventory(Item: Record Item; Quantity: Decimal)\n+ var\n+ ItemJnlTemplate: Record \"Item Journal Template\";\n+ ItemJnlBatch: Record \"Item Journal Batch\";\n+ ItemJournalLine: Record \"Item Journal Line\";\n+ begin\n+ Item.TestField(\"No.\");\n+\n+ LibraryInventory.CreateItemJournalTemplate(ItemJnlTemplate);\n+ LibraryInventory.CreateItemJournalBatch(ItemJnlBatch, ItemJnlTemplate.Name);\n+ LibraryInventory.CreateItemJournalLine(ItemJournalLine, ItemJnlTemplate.Name, ItemJnlBatch.Name, ItemJournalLine.\"Entry Type\"::\"Positive Adjmt.\", Item.\"No.\", Quantity);\n+\n+ LibraryInventory.PostItemJournalLine(ItemJnlTemplate.Name, ItemJnlBatch.Name);\n+ end;\n+\n+ local procedure OpenProductionJournal(No: Code[20])\n+ var\n+ ReleasedProductionOrder: TestPage \"Released Production Order\";\n+ begin\n+ ReleasedProductionOrder.OpenEdit();\n+ ReleasedProductionOrder.FILTER.SetFilter(\"No.\", No);\n+ ReleasedProductionOrder.ProdOrderLines.ProductionJournal.Invoke();\n+ end;\n+\n+ local procedure CreateWorkCenter(var WorkCenter: Record \"Work Center\")\n+ begin\n+ LibraryManufacturing.CreateWorkCenterWithCalendar(WorkCenter);\n+ WorkCenter.Validate(\"Unit Cost\", LibraryRandom.RandDec(100, 2));\n+ WorkCenter.Validate(Capacity, LibraryRandom.RandIntInRange(3, 3));\n+ WorkCenter.Validate(Efficiency, LibraryRandom.RandIntInRange(100, 100));\n+ WorkCenter.Modify(true);\n+ end;\n+\n+ local procedure CreateAndCertifyRouting(var RoutingHeader: Record \"Routing Header\"; WorkCenter: Record \"Work Center\")\n+ var\n+ RoutingLine: Record \"Routing Line\";\n+ begin\n+ LibraryManufacturing.CreateRoutingHeader(RoutingHeader, RoutingHeader.Type::Serial);\n+ LibraryManufacturing.CreateRoutingLine(RoutingHeader, RoutingLine, '', Format(LibraryRandom.RandIntInRange(10, 10)), RoutingLine.Type::\"Work Center\", WorkCenter.\"No.\");\n+ RoutingLine.Validate(\"Setup Time\", LibraryRandom.RandIntInRange(10, 10));\n+ RoutingLine.Validate(\"Run Time\", LibraryRandom.RandIntInRange(10, 10));\n+ RoutingLine.Modify(true);\n+\n+ RoutingHeader.Validate(Status, RoutingHeader.Status::Certified);\n+ RoutingHeader.Modify(true);\n+ end;\n+\n+ local procedure CreateAndCertifyProductionBOM(var ProductionBOMLine: Record \"Production BOM Line\"; Item: Record Item; Qty: Decimal)\n+ var\n+ ProductionBOMHeader: Record \"Production BOM Header\";\n+ begin\n+ LibraryManufacturing.CreateProductionBOMHeader(ProductionBOMHeader, Item.\"Base Unit of Measure\");\n+ LibraryManufacturing.CreateProductionBOMLine(\n+ ProductionBOMHeader, ProductionBOMLine, '', ProductionBOMLine.Type::Item, Item.\"No.\", Qty);\n+ ProductionBOMHeader.Validate(Status, ProductionBOMHeader.Status::Certified);\n+ ProductionBOMHeader.Modify(true);\n+ end;\n+\n [ModalPageHandler]\n [Scope('OnPrem')]\n procedure EnterQuantityToCreatePageHandler(var EnterQuantityToCreate: TestPage \"Enter Quantity to Create\")\n@@ -5347,6 +5505,30 @@\n SourceDocumentFilterCard.Run.Invoke();\n end;\n \n+ [ModalPageHandler]\n+ [Scope('OnPrem')]\n+ procedure ProductionJournalPageHandler(var ProductionJournal: TestPage \"Production Journal\")\n+ begin\n+ ProductionJournal.First();\n+ ProductionJournal.Quantity.SetValue(LibraryRandom.RandIntInRange(200, 200));\n+ ProductionJournal.Next();\n+ ProductionJournal.\"Setup Time\".SetValue(LibraryRandom.RandIntInRange(10, 10));\n+ ProductionJournal.\"Run Time\".SetValue(LibraryRandom.RandIntInRange(10, 10));\n+ ProductionJournal.\"Output Quantity\".SetValue(LibraryRandom.RandIntInRange(20, 20));\n+ ProductionJournal.Post.Invoke();\n+ end;\n+\n+ [ModalPageHandler]\n+ [Scope('OnPrem')]\n+ procedure ProductionJournalConsumptionOnlyPageHandler(var ProductionJournal: TestPage \"Production Journal\")\n+ begin\n+ ProductionJournal.First();\n+ ProductionJournal.Quantity.SetValue(LibraryRandom.RandIntInRange(200, 200));\n+ ProductionJournal.Next();\n+ ProductionJournal.\"Output Quantity\".SetValue(0);\n+ ProductionJournal.Post.Invoke();\n+ end;\n+\n [PageHandler]\n [Scope('OnPrem')]\n procedure GLPostingPreviewPageHandler(var ShowAllEntries: TestPage \"G/L Posting Preview\")\n@@ -5372,6 +5554,11 @@\n Assert.IsTrue(StrPos(Message, LocalMessage) > 0, Message);\n end;\n \n+ [MessageHandler]\n+ procedure MessageHandlerNotext(Message: Text[1024])\n+ begin\n+ end;\n+\n [ConfirmHandler]\n [Scope('OnPrem')]\n procedure ConfirmHandler(ConfirmMessage: Text[1024]; var Reply: Boolean)\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Manufacturing/Document/ReplanProductionOrder.Report.al b/App/Layers/W1/BaseApp/Manufacturing/Document/ReplanProductionOrder.Report.al\n--- a/App/Layers/W1/BaseApp/Manufacturing/Document/ReplanProductionOrder.Report.al\n+++ b/App/Layers/W1/BaseApp/Manufacturing/Document/ReplanProductionOrder.Report.al\n@@ -65,7 +65,7 @@\n \"Ending Time\" := \"Prod. Order Line\".\"Ending Time\";\n Modify();\n end;\n- CalcProdOrderRtngLine.CalculateRoutingLine(\"Prod. Order Routing Line\", Direction, true);\n+ CalcProdOrderRtngLine.ReplanRoutingLine(\"Prod. Order Routing Line\", Direction, true);\n end;\n Modify();\n end;\ndiff --git a/App/Layers/W1/BaseApp/Manufacturing/Routing/CalculateRoutingLine.Codeunit.al b/App/Layers/W1/BaseApp/Manufacturing/Routing/CalculateRoutingLine.Codeunit.al\n--- a/App/Layers/W1/BaseApp/Manufacturing/Routing/CalculateRoutingLine.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Manufacturing/Routing/CalculateRoutingLine.Codeunit.al\n@@ -1261,6 +1261,7 @@\n OnCalculateRoutingLineOnBeforeProdOrderCapNeedReset(ProdOrderRoutingLine, ProdOrderRoutingLine2);\n \n ProdOrderCapNeed.Reset();\n+ ProdOrderCapNeed.SetLoadFields(Status, \"Prod. Order No.\", \"Requested Only\", \"Routing No.\", \"Routing Reference No.\", \"Operation No.\");\n ProdOrderCapNeed.SetRange(Status, ProdOrderRoutingLine.Status);\n ProdOrderCapNeed.SetRange(\"Prod. Order No.\", ProdOrderRoutingLine.\"Prod. Order No.\");\n ProdOrderCapNeed.SetRange(\"Requested Only\", false);\n@@ -2114,6 +2115,121 @@\n CalendarEntry.SetRange(\"Ending Date-Time\", 0DT, CreateDateTime(DateValue + 1, TimeValue));\n end;\n \n+ procedure ReplanRoutingLine(var ProdOrderRoutingLine2: Record \"Prod. Order Routing Line\"; Direction: Option Forward,Backward; CalcStartEndDate: Boolean)\n+ var\n+ ProdOrderCapacityNeed: Record \"Prod. Order Capacity Need\";\n+ MfgCostCalcMgt: Codeunit \"Mfg. Cost Calculation Mgt.\";\n+ ExpectedOperOutput: Decimal;\n+ ActualOperOutput: Decimal;\n+ TotalQtyPerOperation: Decimal;\n+ TotalCapacityPerOperation: Decimal;\n+ begin\n+ MfgSetup.Get();\n+\n+ ProdOrderRoutingLine := ProdOrderRoutingLine2;\n+\n+ WaitTimeOnly :=\n+ (ProdOrderRoutingLine.\"Setup Time\" = 0) and (ProdOrderRoutingLine.\"Run Time\" = 0) and\n+ (ProdOrderRoutingLine.\"Move Time\" = 0);\n+\n+ if ProdOrderRoutingLine.\"Ending Time\" = 0T then\n+ ProdOrderRoutingLine.\"Ending Time\" := 000000T;\n+\n+ if ProdOrderRoutingLine.\"Starting Time\" = 0T then\n+ ProdOrderRoutingLine.\"Starting Time\" := 000000T;\n+\n+ ProdOrderRoutingLine.\"Expected Operation Cost Amt.\" := 0;\n+ ProdOrderRoutingLine.\"Expected Capacity Ovhd. Cost\" := 0;\n+ ProdOrderRoutingLine.\"Expected Capacity Need\" := 0;\n+\n+ ProdOrderCapacityNeed.Reset();\n+ ProdOrderCapacityNeed.SetRange(Status, ProdOrderRoutingLine.Status);\n+ ProdOrderCapacityNeed.SetRange(\"Prod. Order No.\", ProdOrderRoutingLine.\"Prod. Order No.\");\n+ ProdOrderCapacityNeed.SetRange(\"Requested Only\", false);\n+ ProdOrderCapacityNeed.SetRange(\"Routing No.\", ProdOrderRoutingLine.\"Routing No.\");\n+ ProdOrderCapacityNeed.SetRange(\"Routing Reference No.\", ProdOrderRoutingLine.\"Routing Reference No.\");\n+ ProdOrderCapacityNeed.SetRange(\"Operation No.\", ProdOrderRoutingLine.\"Operation No.\");\n+ ProdOrderCapacityNeed.DeleteAll();\n+\n+ NextCapNeedLineNo := 1;\n+\n+ ProdOrderRoutingLine.TestField(\"Work Center No.\");\n+\n+ CurrentWorkCenterNo := '';\n+ Workcenter.Get(ProdOrderRoutingLine.\"Work Center No.\");\n+ if ProdOrderRoutingLine.Type = ProdOrderRoutingLine.Type::\"Machine Center\" then begin\n+ MachineCenter.Get(ProdOrderRoutingLine.\"No.\");\n+ Workcenter.\"Queue Time\" := MachineCenter.\"Queue Time\";\n+ Workcenter.\"Queue Time Unit of Meas. Code\" := MachineCenter.\"Queue Time Unit of Meas. Code\";\n+ end;\n+ if not CalcStartEndDate then\n+ Clear(Workcenter.\"Queue Time\");\n+ ProdOrder.Get(ProdOrderRoutingLine.Status, ProdOrderRoutingLine.\"Prod. Order No.\");\n+\n+ ProdOrderQty := 0;\n+ TotalScrap := 0;\n+ TotalLotSize := 0;\n+ ProdOrderLine.SetRange(Status, ProdOrderRoutingLine.Status);\n+ ProdOrderLine.SetRange(\"Prod. Order No.\", ProdOrderRoutingLine.\"Prod. Order No.\");\n+ ProdOrderLine.SetRange(\"Routing Reference No.\", ProdOrderRoutingLine.\"Routing Reference No.\");\n+ ProdOrderLine.SetRange(\"Routing No.\", ProdOrderRoutingLine.\"Routing No.\");\n+ ProdOrderLine.SetLoadFields(\"Quantity (Base)\", \"Scrap %\", \"Prod. Order No.\", \"Line No.\", Status, \"Routing No.\", \"Routing Version Code\", \"Ending Date\", \"Ending Time\");\n+ if ProdOrderLine.Find('-') then begin\n+ ExpectedOperOutput := 0;\n+ repeat\n+ ExpectedOperOutput := ExpectedOperOutput + ProdOrderLine.\"Quantity (Base)\";\n+ TotalScrap := TotalScrap + ProdOrderLine.\"Scrap %\";\n+ until ProdOrderLine.Next() = 0;\n+ ActualOperOutput := MfgCostCalcMgt.CalcActOutputQtyBase(ProdOrderLine, ProdOrderRoutingLine);\n+ ProdOrderQty := ExpectedOperOutput - ActualOperOutput;\n+ if ProdOrderQty < 0 then\n+ ProdOrderQty := 0;\n+ end;\n+\n+ if ActualOperOutput = 0 then\n+ exit;\n+\n+ MaxLotSize :=\n+ ProdOrderQty *\n+ (1 + ProdOrderRoutingLine.\"Scrap Factor % (Accumulated)\") *\n+ (1 + TotalScrap / 100) +\n+ ProdOrderRoutingLine.\"Fixed Scrap Qty. (Accum.)\";\n+\n+ ProdOrderRoutingLine.\"Input Quantity\" := MaxLotSize;\n+\n+ if ActualOperOutput > 0 then\n+ TotalQtyPerOperation :=\n+ ExpectedOperOutput *\n+ (1 + ProdOrderRoutingLine.\"Scrap Factor % (Accumulated)\") *\n+ (1 + TotalScrap / 100) +\n+ ProdOrderRoutingLine.\"Fixed Scrap Qty. (Accum.)\"\n+ else\n+ TotalQtyPerOperation := MaxLotSize;\n+\n+ TotalCapacityPerOperation :=\n+ Round(\n+ TotalQtyPerOperation *\n+ ProdOrderRoutingLine.RunTimePer() *\n+ CalendarMgt.QtyperTimeUnitofMeasure(\n+ ProdOrderRoutingLine.\"Work Center No.\", ProdOrderRoutingLine.\"Run Time Unit of Meas. Code\"),\n+ UOMMgt.QtyRndPrecision());\n+\n+ if MfgSetup.\"Cost Incl. Setup\" then\n+ CalcCostInclSetup(ProdOrderRoutingLine, TotalCapacityPerOperation);\n+\n+ CalcExpectedCost(ProdOrderRoutingLine, TotalQtyPerOperation, TotalCapacityPerOperation);\n+\n+ if ProdOrderRoutingLine.\"Schedule Manually\" then\n+ CalculateRoutingLineFixed()\n+ else\n+ if Direction = Direction::Backward then\n+ CalcRoutingLineBack(CalcStartEndDate)\n+ else\n+ CalcRoutingLineForward(CalcStartEndDate);\n+\n+ ProdOrderRoutingLine2 := ProdOrderRoutingLine;\n+ end;\n+\n [IntegrationEvent(false, false)]\n local procedure OnAfterCalcCostInclSetup(ProdOrderRoutingLine: Record \"Prod. Order Routing Line\"; var TotalCapacityPerOperation: Decimal)\n begin\n"} +{"instance_id": "microsoftInternal__NAV-214825__cf-1", "base_instance_id": "microsoftInternal__NAV-214825", "variant_description": "Unavailable-items result must remain correct even after inserting two new planning lines before the original one", "intervention_type": "Execution / Validation Semantics", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-214825__cf-1", "FAIL_TO_PASS": [{"codeunitID": 136350, "functionName": ["CheckUnavailableItemQtyWhenAddProjectPlanningLinesBeforeThePreviousOne"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/Job/UTTJob.Codeunit.al b/App/Layers/W1/Tests/Job/UTTJob.Codeunit.al\n--- a/App/Layers/W1/Tests/Job/UTTJob.Codeunit.al\n+++ b/App/Layers/W1/Tests/Job/UTTJob.Codeunit.al\n@@ -2246,6 +2246,38 @@\n \n \n Assert.IsFalse(PurchaseLine.IsEmpty, 'Purchase Line not created for Job Task' + JobTask.\"Job Task No.\");\n+ end;\n+\n+ [Test]\n+ [HandlerFunctions('CheckPurchOrderFromJobModalPageHandlerHaveLines')]\n+ procedure CheckUnavailableItemQtyWhenAddProjectPlanningLinesBeforeThePreviousOne()\n+ var\n+ Item, Item2, Item3 : Record Item;\n+ JobPlanningLines: TestPage \"Job Planning Lines\";\n+ begin\n+ // [SCENARIO 574938] Create Purchase Order from Project not working as expected if we add Project Planning Lines before the previous ones.\n+ Initialize();\n+\n+ // [GIVEN] Create 3 New Item.\n+ LibraryInventory.CreateItem(Item);\n+ LibraryInventory.CreateItem(Item2);\n+ LibraryInventory.CreateItem(Item3);\n+\n+ // [GIVEN] Create Job X with Job Task and 3 Job Planning Lines.\n+ CreateJobAndJobTask();\n+ CreateJobPlanningLineWithItem(JobPlanningLine.\"Line Type\"::\"Both Budget and Billable\", Item.\"No.\", LibraryRandom.RandInt(100));\n+ CreateJobPlanningLineBeforePreviousLine(JobPlanningLine.\"Line Type\"::\"Both Budget and Billable\", Item2.\"No.\", LibraryRandom.RandInt(100));\n+ CreateJobPlanningLineBeforePreviousLine(JobPlanningLine.\"Line Type\"::\"Both Budget and Billable\", Item3.\"No.\", LibraryRandom.RandInt(100));\n+\n+ // [WHEN] Open Job Planning Lines.\n+ JobPlanningLines.OpenEdit();\n+ JobPlanningLines.GoToRecord(JobPlanningLine);\n+ LibraryVariableStorage.Clear();\n+ LibraryVariableStorage.Enqueue(Item.\"No.\");\n+\n+ // [WHEN] Create Purchase Order from Job Planning Lines.\n+ JobPlanningLines.CreatePurchaseOrder.Invoke();//assert check\n+ LibraryVariableStorage.AssertEmpty();\n end;\n \n local procedure Initialize()\n@@ -2617,6 +2649,30 @@\n until DefaultDimension.Next() = 0;\n end;\n \n+ local procedure CreateJobPlanningLineBeforePreviousLine(LineType: Enum \"Job Planning Line Line Type\"; ItemNo: Code[20]; Quantity: Decimal)\n+ var\n+ JobPlanLine: Record \"Job Planning Line\";\n+ LineNo: Integer;\n+ begin\n+ JobPlanLine.SetRange(\"Job No.\", JobTask.\"Job No.\");\n+ JobPlanLine.SetRange(\"Job Task No.\", JobTask.\"Job Task No.\");\n+ if JobPlanLine.FindFirst() then;\n+ LineNo := JobPlanLine.\"Line No.\" / 2;\n+ JobPlanningLine.Init();\n+ JobPlanningLine.Validate(\"Job No.\", JobTask.\"Job No.\");\n+ JobPlanningLine.Validate(\"Job Task No.\", JobTask.\"Job Task No.\");\n+ JobPlanningLine.Validate(\"Line No.\", LineNo);\n+ JobPlanningLine.Insert(true);\n+\n+ JobPlanningLine.Validate(\"Planning Date\", WorkDate());\n+ JobPlanningLine.Validate(\"Line Type\", LineType);\n+ JobPlanningLine.Validate(Type, JobPlanningLine.Type::Item);\n+ JobPlanningLine.Validate(Description, LibraryUtility.GenerateGUID());\n+ JobPlanningLine.Validate(\"No.\", ItemNo);\n+ JobPlanningLine.Validate(Quantity, Quantity);\n+ JobPlanningLine.Modify(true);\n+ end;\n+\n [EventSubscriber(ObjectType::Table, Database::\"Job\", 'OnAfterModifyEvent', '', false, false)]\n local procedure InsertNameValueBufferOnJobModify(var Rec: Record Job; var xRec: Record Job; RunTrigger: Boolean)\n var\n@@ -2730,6 +2786,13 @@\n PurchOrderFromSalesOrder.OK().Invoke();\n end;\n \n+ [ModalPageHandler]\n+ procedure CheckPurchOrderFromJobModalPageHandlerHaveLines(var PurchOrderFromSalesOrder: TestPage \"Purch. Order From Sales Order\")\n+ begin\n+ //[THEN] Check Purch. Order From Sales Order Page have Record.\n+ PurchOrderFromSalesOrder.\"No.\".AssertEquals(LibraryVariableStorage.DequeueText());\n+ end;\n+\n [MessageHandler]\n procedure MessageHandler(Message: Text[1024])\n var\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Projects/Project/Job/PurchaseDocFromJob.Codeunit.al b/App/Layers/W1/BaseApp/Projects/Project/Job/PurchaseDocFromJob.Codeunit.al\n--- a/App/Layers/W1/BaseApp/Projects/Project/Job/PurchaseDocFromJob.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Projects/Project/Job/PurchaseDocFromJob.Codeunit.al\n@@ -78,6 +78,8 @@\n JobPlanningLine.SetRange(\"Job Task No.\", JobTask.\"Job Task No.\");\n if JobPlanningLine.IsEmpty() then\n exit;\n+ JobPlanningLine.SetCurrentKey(\"Job Contract Entry No.\");\n+ JobPlanningLine.Ascending(true);\n JobPlanningLine.FindSet();\n RecRef.GetTable(JobPlanningLine);\n ContractEntryNoFilter := SelectionFilterMgt.GetSelectionFilter(RecRef, JobPlanningLine.FieldNo(\"Job Contract Entry No.\"));\n"} +{"instance_id": "microsoftInternal__NAV-214825__cf-2", "base_instance_id": "microsoftInternal__NAV-214825", "variant_description": "Unavailable-items result must remain correct when Create Purchase Order is executed again after reopening the page", "intervention_type": "Execution / Validation Semantics", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-214825__cf-2", "FAIL_TO_PASS": [{"codeunitID": 136350, "functionName": ["CheckUnavailableItemQtyWhenAddProjectPlanningLinesBeforeThePreviousOne"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/Job/UTTJob.Codeunit.al b/App/Layers/W1/Tests/Job/UTTJob.Codeunit.al\n--- a/App/Layers/W1/Tests/Job/UTTJob.Codeunit.al\n+++ b/App/Layers/W1/Tests/Job/UTTJob.Codeunit.al\n@@ -2246,6 +2246,39 @@\n \n \n Assert.IsFalse(PurchaseLine.IsEmpty, 'Purchase Line not created for Job Task' + JobTask.\"Job Task No.\");\n+ end;\n+\n+ [Test]\n+ [HandlerFunctions('CheckPurchOrderFromJobModalPageHandlerHaveLines')]\n+ procedure CheckUnavailableItemQtyWhenAddProjectPlanningLinesBeforeThePreviousOne()\n+ var\n+ Item, Item2 : Record Item;\n+ JobPlanningLines: TestPage \"Job Planning Lines\";\n+ begin\n+ // [SCENARIO 574938] Create Purchase Order from Project not working as expected if we add Project Planning Lines before the previous ones.\n+ Initialize();\n+\n+ // [GIVEN] Create 2 New Item.\n+ LibraryInventory.CreateItem(Item);\n+ LibraryInventory.CreateItem(Item2);\n+\n+ // [GIVEN] Create Job X with Job Task and 2 Job Planning Lines.\n+ CreateJobAndJobTask();\n+ CreateJobPlanningLineWithItem(JobPlanningLine.\"Line Type\"::\"Both Budget and Billable\", Item.\"No.\", LibraryRandom.RandInt(100));\n+ CreateJobPlanningLineBeforePreviousLine(JobPlanningLine.\"Line Type\"::\"Both Budget and Billable\", Item2.\"No.\", LibraryRandom.RandInt(100));\n+\n+ // [WHEN] Open Job Planning Lines.\n+ JobPlanningLines.OpenEdit();\n+ JobPlanningLines.GoToRecord(JobPlanningLine);\n+ LibraryVariableStorage.Clear();\n+ LibraryVariableStorage.Enqueue(Item.\"No.\");\n+\n+ // [WHEN] Reopen the page and Create Purchase Order from Job Planning Lines.\n+ JobPlanningLines.Close();\n+ JobPlanningLines.OpenEdit();\n+ JobPlanningLines.GoToRecord(JobPlanningLine);\n+ JobPlanningLines.CreatePurchaseOrder.Invoke();//assert check\n+ LibraryVariableStorage.AssertEmpty();\n end;\n \n local procedure Initialize()\n@@ -2617,6 +2650,30 @@\n until DefaultDimension.Next() = 0;\n end;\n \n+ local procedure CreateJobPlanningLineBeforePreviousLine(LineType: Enum \"Job Planning Line Line Type\"; ItemNo: Code[20]; Quantity: Decimal)\n+ var\n+ JobPlanLine: Record \"Job Planning Line\";\n+ LineNo: Integer;\n+ begin\n+ JobPlanLine.SetRange(\"Job No.\", JobTask.\"Job No.\");\n+ JobPlanLine.SetRange(\"Job Task No.\", JobTask.\"Job Task No.\");\n+ if JobPlanLine.FindFirst() then;\n+ LineNo := JobPlanLine.\"Line No.\" / 2;\n+ JobPlanningLine.Init();\n+ JobPlanningLine.Validate(\"Job No.\", JobTask.\"Job No.\");\n+ JobPlanningLine.Validate(\"Job Task No.\", JobTask.\"Job Task No.\");\n+ JobPlanningLine.Validate(\"Line No.\", LineNo);\n+ JobPlanningLine.Insert(true);\n+\n+ JobPlanningLine.Validate(\"Planning Date\", WorkDate());\n+ JobPlanningLine.Validate(\"Line Type\", LineType);\n+ JobPlanningLine.Validate(Type, JobPlanningLine.Type::Item);\n+ JobPlanningLine.Validate(Description, LibraryUtility.GenerateGUID());\n+ JobPlanningLine.Validate(\"No.\", ItemNo);\n+ JobPlanningLine.Validate(Quantity, Quantity);\n+ JobPlanningLine.Modify(true);\n+ end;\n+\n [EventSubscriber(ObjectType::Table, Database::\"Job\", 'OnAfterModifyEvent', '', false, false)]\n local procedure InsertNameValueBufferOnJobModify(var Rec: Record Job; var xRec: Record Job; RunTrigger: Boolean)\n var\n@@ -2730,6 +2787,13 @@\n PurchOrderFromSalesOrder.OK().Invoke();\n end;\n \n+ [ModalPageHandler]\n+ procedure CheckPurchOrderFromJobModalPageHandlerHaveLines(var PurchOrderFromSalesOrder: TestPage \"Purch. Order From Sales Order\")\n+ begin\n+ //[THEN] Check Purch. Order From Sales Order Page have Record.\n+ PurchOrderFromSalesOrder.\"No.\".AssertEquals(LibraryVariableStorage.DequeueText());\n+ end;\n+\n [MessageHandler]\n procedure MessageHandler(Message: Text[1024])\n var\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Projects/Project/Job/PurchaseDocFromJob.Codeunit.al b/App/Layers/W1/BaseApp/Projects/Project/Job/PurchaseDocFromJob.Codeunit.al\n--- a/App/Layers/W1/BaseApp/Projects/Project/Job/PurchaseDocFromJob.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Projects/Project/Job/PurchaseDocFromJob.Codeunit.al\n@@ -78,6 +78,8 @@\n JobPlanningLine.SetRange(\"Job Task No.\", JobTask.\"Job Task No.\");\n if JobPlanningLine.IsEmpty() then\n exit;\n+ JobPlanningLine.SetCurrentKey(\"Job Contract Entry No.\");\n+ JobPlanningLine.Ascending(true);\n JobPlanningLine.FindSet();\n RecRef.GetTable(JobPlanningLine);\n ContractEntryNoFilter := SelectionFilterMgt.GetSelectionFilter(RecRef, JobPlanningLine.FieldNo(\"Job Contract Entry No.\"));\n"} +{"instance_id": "microsoft__BCApps-4766__cf-1", "base_instance_id": "microsoft__BCApps-4766", "variant_description": "When the item No. is changed to another valid item, the old subscription line must be disconnected from the contract", "intervention_type": "Execution / Validation Semantics", "problem_statement_override": "dataset/problemstatement/microsoft__BCApps-4766__cf-1", "FAIL_TO_PASS": [{"codeunitID": 148155, "functionName": ["ContractLineDisconnectServiceOnNoChange"]}, {"codeunitID": 148154, "functionName": ["ContractLineDisconnectServiceOnNoChange"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/src/Apps/W1/Subscription Billing/Test/Customer Contracts/ContractsTest.Codeunit.al b/src/Apps/W1/Subscription Billing/Test/Customer Contracts/ContractsTest.Codeunit.al\n--- a/src/Apps/W1/Subscription Billing/Test/Customer Contracts/ContractsTest.Codeunit.al\n+++ b/src/Apps/W1/Subscription Billing/Test/Customer Contracts/ContractsTest.Codeunit.al\n@@ -613,23 +613,64 @@\n CustomerContractLine: Record \"Cust. Sub. Contract Line\";\n ServiceCommitment: Record \"Subscription Line\";\n ServiceObject: Record \"Subscription Header\";\n+ SubscriptionLineDisconnectErr: Label 'Subscription Line should be disconnected from the contract after Type has changed.', Locked = true;\n EntryNo: Integer;\n begin\n- // Test: Subscription Line should be disconnected from the contract when the line type changes\n+ // [SCENARIO] Subscription Line should be disconnected from the contract when the line type changes\n Initialize();\n \n+ // [GIVEN] A customer contract with a connected Subscription Line\n SetupNewContract(false, ServiceObject, CustomerContract);\n \n- CustomerContractLine.Reset();\n+ // [GIVEN] Find a contract line that has a connected Subscription Line\n CustomerContractLine.SetRange(\"Subscription Contract No.\", CustomerContract.\"No.\");\n CustomerContractLine.SetRange(\"Contract Line Type\", Enum::\"Contract Line Type\"::Item);\n CustomerContractLine.SetFilter(\"Subscription Header No.\", '<>%1', '');\n CustomerContractLine.SetFilter(\"Subscription Line Entry No.\", '<>%1', 0);\n CustomerContractLine.FindFirst();\n EntryNo := CustomerContractLine.\"Subscription Line Entry No.\";\n+\n+ // [WHEN] The contract line type is changed from Item to Comment\n CustomerContractLine.Validate(\"Contract Line Type\", CustomerContractLine.\"Contract Line Type\"::Comment);\n+\n+ // [THEN] The Subscription Line should be disconnected from the contract\n ServiceCommitment.Get(EntryNo);\n- ServiceCommitment.TestField(\"Subscription Contract No.\", '');\n+ Assert.AreEqual('', ServiceCommitment.\"Subscription Contract No.\", SubscriptionLineDisconnectErr);\n end;\n \n [Test]\n+ [HandlerFunctions('ExchangeRateSelectionModalPageHandler,MessageHandler')]\n+ procedure ContractLineDisconnectServiceOnNoChange()\n+ var\n+ CustomerContract: Record \"Customer Subscription Contract\";\n+ CustomerContractLine: Record \"Cust. Sub. Contract Line\";\n+ ServiceCommitment: Record \"Subscription Line\";\n+ ServiceObject: Record \"Subscription Header\";\n+ NewItem: Record Item;\n+ SubscriptionLineDisconnectErr: Label 'Subscription Line should be disconnected from the contract after No. has changed.', Locked = true;\n+ EntryNo: Integer;\n+ begin\n+ // [SCENARIO] Subscription Line should be disconnected from the contract when the Item No. is changed to another valid item\n+ Initialize();\n+\n+ // [GIVEN] A customer contract with a connected Subscription Line\n+ SetupNewContract(false, ServiceObject, CustomerContract);\n+\n+ // [GIVEN] Find a contract line that has a connected Subscription Line\n+ CustomerContractLine.SetRange(\"Subscription Contract No.\", CustomerContract.\"No.\");\n+ CustomerContractLine.SetRange(\"Contract Line Type\", Enum::\"Contract Line Type\"::Item);\n+ CustomerContractLine.SetFilter(\"Subscription Header No.\", '<>%1', '');\n+ CustomerContractLine.SetFilter(\"Subscription Line Entry No.\", '<>%1', 0);\n+ CustomerContractLine.FindFirst();\n+ EntryNo := CustomerContractLine.\"Subscription Line Entry No.\";\n+\n+ // [WHEN] The Item No. is changed to another valid item on the contract line\n+ LibraryInventory.CreateItem(NewItem);\n+ CustomerContractLine.Validate(\"No.\", NewItem.\"No.\");\n+\n+ // [THEN] The Subscription Line should be disconnected from the contract\n+ ServiceCommitment.Get(EntryNo);\n+ Assert.AreEqual('', ServiceCommitment.\"Subscription Contract No.\", SubscriptionLineDisconnectErr);\n+ end;\n+\n+ [Test]\ndiff --git a/src/Apps/W1/Subscription Billing/Test/Vendor Contracts/VendorContractsTest.Codeunit.al b/src/Apps/W1/Subscription Billing/Test/Vendor Contracts/VendorContractsTest.Codeunit.al\n--- a/src/Apps/W1/Subscription Billing/Test/Vendor Contracts/VendorContractsTest.Codeunit.al\n+++ b/src/Apps/W1/Subscription Billing/Test/Vendor Contracts/VendorContractsTest.Codeunit.al\n@@ -338,11 +338,15 @@\n procedure ContractLineDisconnectServiceOnTypeChange()\n var\n EntryNo: Integer;\n+ SubscriptionLineDisconnectErr: Label 'Subscription Line should be disconnected from the contract after Type has changed.', Locked = true;\n begin\n- // Test: Subscription Line should be disconnected from the contract when the line type changes\n+ // [SCENARIO] Subscription Line should be disconnected from the contract when the line type changes\n Initialize();\n+\n+ // [GIVEN] A vendor contract with a connected Subscription Line\n SetupNewContract(false);\n \n+ // [GIVEN] Find a contract line that has a connected Subscription Line\n VendorContractLine.Reset();\n VendorContractLine.SetRange(\"Subscription Contract No.\", VendorContract.\"No.\");\n VendorContractLine.SetRange(\"Contract Line Type\", Enum::\"Contract Line Type\"::Item);\n@@ -350,9 +354,45 @@\n VendorContractLine.SetFilter(\"Subscription Line Entry No.\", '<>%1', 0);\n VendorContractLine.FindFirst();\n EntryNo := VendorContractLine.\"Subscription Line Entry No.\";\n+\n+ // [WHEN] The contract line type is changed from Item to Comment\n VendorContractLine.Validate(\"Contract Line Type\", VendorContractLine.\"Contract Line Type\"::Comment);\n+\n+ // [THEN] The Subscription Line should be disconnected from the contract\n ServiceCommitment.Get(EntryNo);\n- ServiceCommitment.TestField(\"Subscription Contract No.\", '');\n+ AssertThat.AreEqual('', ServiceCommitment.\"Subscription Contract No.\", SubscriptionLineDisconnectErr);\n end;\n \n [Test]\n+ [HandlerFunctions('ExchangeRateSelectionModalPageHandler,MessageHandler')]\n+ procedure ContractLineDisconnectServiceOnNoChange()\n+ var\n+ EntryNo: Integer;\n+ NewItem: Record Item;\n+ SubscriptionLineDisconnectErr: Label 'Subscription Line should be disconnected from the contract after No. has changed.', Locked = true;\n+ begin\n+ // [SCENARIO] Subscription Line should be disconnected from the contract when the Item No. is changed to another valid item\n+ Initialize();\n+\n+ // [GIVEN] A vendor contract with a connected Subscription Line\n+ SetupNewContract(false);\n+\n+ // [GIVEN] Find a contract line that has a connected Subscription Line\n+ VendorContractLine.Reset();\n+ VendorContractLine.SetRange(\"Subscription Contract No.\", VendorContract.\"No.\");\n+ VendorContractLine.SetRange(\"Contract Line Type\", Enum::\"Contract Line Type\"::Item);\n+ VendorContractLine.SetFilter(\"Subscription Header No.\", '<>%1', '');\n+ VendorContractLine.SetFilter(\"Subscription Line Entry No.\", '<>%1', 0);\n+ VendorContractLine.FindFirst();\n+ EntryNo := VendorContractLine.\"Subscription Line Entry No.\";\n+\n+ // [WHEN] The Item No. is changed to another valid item on the contract line\n+ LibraryInventory.CreateItem(NewItem);\n+ VendorContractLine.Validate(\"No.\", NewItem.\"No.\");\n+\n+ // [THEN] The Subscription Line should be disconnected from the contract\n+ ServiceCommitment.Get(EntryNo);\n+ AssertThat.AreEqual('', ServiceCommitment.\"Subscription Contract No.\", SubscriptionLineDisconnectErr);\n+ end;\n+\n+ [Test]\n", "patch": "diff --git a/src/Apps/W1/Subscription Billing/App/Customer Contracts/Tables/CustSubContractLine.Table.al b/src/Apps/W1/Subscription Billing/App/Customer Contracts/Tables/CustSubContractLine.Table.al\n--- a/src/Apps/W1/Subscription Billing/App/Customer Contracts/Tables/CustSubContractLine.Table.al\n+++ b/src/Apps/W1/Subscription Billing/App/Customer Contracts/Tables/CustSubContractLine.Table.al\n@@ -49,23 +49,25 @@\n GLAccount: Record \"G/L Account\";\n TempCustomerContractLine: Record \"Cust. Sub. Contract Line\" temporary;\n begin\n- case \"Contract Line Type\" of\n- \"Contract Line Type\"::Item:\n- begin\n- if not Item.Get(\"No.\") then\n- Error(EntityDoesNotExistErr, Item.TableCaption, \"No.\");\n- if Item.Blocked or Item.\"Subscription Option\" in [\"Item Service Commitment Type\"::\"Sales without Service Commitment\", \"Item Service Commitment Type\"::\"Sales without Service Commitment\"] then\n- Error(ItemBlockedOrWithoutServiceCommitmentsErr, \"No.\");\n- end;\n- \"Contract Line Type\"::\"G/L Account\":\n- begin\n- if not GLAccount.Get(\"No.\") then\n- Error(EntityDoesNotExistErr, GLAccount.TableCaption, \"No.\");\n- if GLAccount.Blocked or not GLAccount.\"Direct Posting\" or (GLAccount.\"Account Type\" <> GLAccount.\"Account Type\"::Posting) then\n- Error(GLAccountBlockedOrNotForDirectPostingErr, \"No.\");\n- end;\n- end;\n+ if \"No.\" <> '' then\n+ case \"Contract Line Type\" of\n+ \"Contract Line Type\"::Item:\n+ begin\n+ if not Item.Get(\"No.\") then\n+ Error(EntityDoesNotExistErr, Item.TableCaption, \"No.\");\n+ if Item.Blocked or Item.\"Subscription Option\" in [\"Item Service Commitment Type\"::\"Sales without Service Commitment\", \"Item Service Commitment Type\"::\"Sales without Service Commitment\"] then\n+ Error(ItemBlockedOrWithoutServiceCommitmentsErr, \"No.\");\n+ end;\n+ \"Contract Line Type\"::\"G/L Account\":\n+ begin\n+ if not GLAccount.Get(\"No.\") then\n+ Error(EntityDoesNotExistErr, GLAccount.TableCaption, \"No.\");\n+ if GLAccount.Blocked or not GLAccount.\"Direct Posting\" or (GLAccount.\"Account Type\" <> GLAccount.\"Account Type\"::Posting) then\n+ Error(GLAccountBlockedOrNotForDirectPostingErr, \"No.\");\n+ end;\n+ end;\n \n+ CheckAndDisconnectContractLine();\n TempCustomerContractLine := Rec;\n Init();\n SystemId := TempCustomerContractLine.SystemId;\n@@ -170,6 +172,8 @@\n ServiceObject: Record \"Subscription Header\";\n ServiceCommitment: Record \"Subscription Line\";\n begin\n+ if \"No.\" = '' then\n+ exit;\n CustomerContract.Get(\"Subscription Contract No.\");\n ServiceObject.InitForSourceNo(\"Contract Line Type\", \"No.\");\n ServiceObject.UpdateCustomerDataFromCustomerContract(CustomerContract);\ndiff --git a/src/Apps/W1/Subscription Billing/App/Vendor Contracts/Tables/VendSubContractLine.Table.al b/src/Apps/W1/Subscription Billing/App/Vendor Contracts/Tables/VendSubContractLine.Table.al\n--- a/src/Apps/W1/Subscription Billing/App/Vendor Contracts/Tables/VendSubContractLine.Table.al\n+++ b/src/Apps/W1/Subscription Billing/App/Vendor Contracts/Tables/VendSubContractLine.Table.al\n@@ -46,23 +46,25 @@\n GLAccount: Record \"G/L Account\";\n TempVendorContractLine: Record \"Vend. Sub. Contract Line\" temporary;\n begin\n- case \"Contract Line Type\" of\n- \"Contract Line Type\"::Item:\n- begin\n- if not Item.Get(\"No.\") then\n- Error(EntityDoesNotExistErr, Item.TableCaption, \"No.\");\n- if Item.Blocked or Item.\"Subscription Option\" in [\"Item Service Commitment Type\"::\"Sales without Service Commitment\", \"Item Service Commitment Type\"::\"Sales without Service Commitment\"] then\n- Error(ItemBlockedOrWithoutServiceCommitmentsErr, \"No.\");\n- end;\n- \"Contract Line Type\"::\"G/L Account\":\n- begin\n- if not GLAccount.Get(\"No.\") then\n- Error(EntityDoesNotExistErr, GLAccount.TableCaption, \"No.\");\n- if GLAccount.Blocked or not GLAccount.\"Direct Posting\" or (GLAccount.\"Account Type\" <> GLAccount.\"Account Type\"::Posting) then\n- Error(GLAccountBlockedOrNotForDirectPostingErr, \"No.\");\n- end;\n- end;\n+ if \"No.\" <> '' then\n+ case \"Contract Line Type\" of\n+ \"Contract Line Type\"::Item:\n+ begin\n+ if not Item.Get(\"No.\") then\n+ Error(EntityDoesNotExistErr, Item.TableCaption, \"No.\");\n+ if Item.Blocked or Item.\"Subscription Option\" in [\"Item Service Commitment Type\"::\"Sales without Service Commitment\", \"Item Service Commitment Type\"::\"Sales without Service Commitment\"] then\n+ Error(ItemBlockedOrWithoutServiceCommitmentsErr, \"No.\");\n+ end;\n+ \"Contract Line Type\"::\"G/L Account\":\n+ begin\n+ if not GLAccount.Get(\"No.\") then\n+ Error(EntityDoesNotExistErr, GLAccount.TableCaption, \"No.\");\n+ if GLAccount.Blocked or not GLAccount.\"Direct Posting\" or (GLAccount.\"Account Type\" <> GLAccount.\"Account Type\"::Posting) then\n+ Error(GLAccountBlockedOrNotForDirectPostingErr, \"No.\");\n+ end;\n+ end;\n \n+ CheckAndDisconnectContractLine();\n TempVendorContractLine := Rec;\n Init();\n SystemId := TempVendorContractLine.SystemId;\n@@ -161,6 +163,8 @@\n ServiceObject: Record \"Subscription Header\";\n ServiceCommitment: Record \"Subscription Line\";\n begin\n+ if \"No.\" = '' then\n+ exit;\n VendorContract.Get(\"Subscription Contract No.\");\n ServiceObject.InitForSourceNo(\"Contract Line Type\", \"No.\");\n ServiceObject.\"Created in Contract line\" := true;\n"} +{"instance_id": "microsoftInternal__NAV-210200__cf-1", "base_instance_id": "microsoftInternal__NAV-210200", "variant_description": "When Get Std. Service Codes inserts a Reserve = Always item with a different quantity, the inserted line must still be automatically reserved for the full quantity", "intervention_type": "Execution / Validation Semantics", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-210200__cf-1", "FAIL_TO_PASS": [{"codeunitID": 136119, "functionName": ["ReservationEntryMustBeCreatedWhenReserveIsAlwaysInServiceLine"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM-Service/ServiceStandardCodes.Codeunit.al b/App/Layers/W1/Tests/SCM-Service/ServiceStandardCodes.Codeunit.al\n--- a/App/Layers/W1/Tests/SCM-Service/ServiceStandardCodes.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM-Service/ServiceStandardCodes.Codeunit.al\n@@ -9,6 +9,8 @@\n using Microsoft.Finance.GeneralLedger.Ledger;\n using Microsoft.Finance.VAT.Ledger;\n using Microsoft.Inventory.Item;\n+using Microsoft.Inventory.Journal;\n+using Microsoft.Inventory.Location;\n using Microsoft.Projects.Resources.Ledger;\n using Microsoft.Sales.Customer;\n using Microsoft.Sales.Receivables;\n@@ -40,6 +42,7 @@\n LibrarySales: Codeunit \"Library - Sales\";\n LibraryUtility: Codeunit \"Library - Utility\";\n LibraryERM: Codeunit \"Library - ERM\";\n+ LibraryWarehouse: Codeunit \"Library - Warehouse\";\n ServiceItemGroupCode2: Code[10];\n StandardServiceCode2: Code[10];\n isInitialized: Boolean;\n@@ -52,6 +55,7 @@\n QuantityMustbePositive: Label '%1 must be positive in %2 %3=''%4'',%5=''%6''.';\n ServiceLineMustNotExist: Label 'There is no %1 within the filter.Filters: %2: %3, %4: %5';\n ExpectedConfirm: Label 'The Credit Memo doesn''t have a Corrected Invoice No. Do you want to continue?';\n+ ValueMustBeEqualErr: Label '%1 must be equal to %2 in %3', Comment = '%1 = Field Caption , %2 = Expected Value , %3 = Table Caption';\n \n [Test]\n [Scope('OnPrem')]\n@@ -1024,6 +1028,75 @@\n \n \n StandardServiceLine.TestField(\"No.\", Item.\"No.\");\n+ end;\n+\n+ [Test]\n+ [HandlerFunctions('ModalFormHandlerServItemGroup')]\n+ procedure ReservationEntryMustBeCreatedWhenReserveIsAlwaysInServiceLine()\n+ var\n+ Item: Record Item;\n+ Location: Record Location;\n+ Customer: Record Customer;\n+ ServiceItem: Record \"Service Item\";\n+ ServiceHeader: Record \"Service Header\";\n+ ServiceLine: Record \"Service Line\";\n+ ServiceItemLine: Record \"Service Item Line\";\n+ StandardServiceCode: Record \"Standard Service Code\";\n+ StandardServiceItemGrCode: Record \"Standard Service Item Gr. Code\";\n+ ExpectedQuantity: Integer;\n+ begin\n+ // [SCENARIO 566581] Verify Reservation Entry must be created When Item that has Reserve = Always in the Service Line.\n+ // when \"Get Std. Service Codes.\" is executed.\n+ Initialize();\n+\n+ // [GIVEN] Create a Customer.\n+ LibrarySales.CreateCustomer(Customer);\n+\n+ // [GIVEN] Create Location with Inventory Posting Setup.\n+ LibraryWarehouse.CreateLocationWithInventoryPostingSetup(Location);\n+\n+ // [GIVEN] Create an item with Reserve = Always.\n+ LibraryInventory.CreateItem(Item);\n+ Item.Validate(\"Reordering Policy\", Item.\"Reordering Policy\"::\"Lot-for-Lot\");\n+ Item.Validate(Reserve, Item.Reserve::Always);\n+ Item.Modify();\n+\n+ // [GIVEN] Generate Quantity.\n+ ExpectedQuantity := 5;\n+\n+ // [GIVEN] Post inventory.\n+ SetItemInventory(Item, ExpectedQuantity, Location.Code);\n+\n+ // [GIVEN] Create Service Item.\n+ LibraryService.CreateServiceItem(ServiceItem, Customer.\"No.\");\n+\n+ // [GIVEN] Create Standard Service Code with Item and Quantity.\n+ LibraryService.CreateStandardServiceCode(StandardServiceCode);\n+ CreateStdServiceLineWithItem(StandardServiceCode.Code, Item.\"No.\", ExpectedQuantity);\n+\n+ // [GIVEN] Create Service Order with Location.\n+ LibraryService.CreateServiceHeader(ServiceHeader, ServiceHeader.\"Document Type\"::Order, Customer.\"No.\");\n+ ServiceHeader.Validate(\"Location Code\", Location.Code);\n+ ServiceHeader.Modify();\n+\n+ // [GIVEN] Create Service Item Line.\n+ LibraryService.CreateServiceItemLine(ServiceItemLine, ServiceHeader, '');\n+\n+ // [GIVEN] Delete Standard Service Group Code.\n+ StandardServiceItemGrCode.DeleteAll();\n+\n+ // [WHEN] Insert Service Line through Standard Service Code.\n+ ServiceItemGroupCode2 := '';\n+ StandardServiceCode2 := StandardServiceCode.Code;\n+ StandardServiceItemGrCode.InsertServiceLines(ServiceItemLine);\n+\n+ // [THEN] Verify \"Reserved Qty. (Base)\" must be updated in the Service Line.\n+ FindServiceLine(ServiceLine, ServiceHeader.\"Document Type\", ServiceHeader.\"No.\");\n+ ServiceLine.CalcFields(\"Reserved Qty. (Base)\");\n+ Assert.AreEqual(\n+ ExpectedQuantity,\n+ ServiceLine.\"Reserved Qty. (Base)\",\n+ StrSubstNo(ValueMustBeEqualErr, ServiceLine.FieldCaption(\"Reserved Qty. (Base)\"), ExpectedQuantity, ServiceLine.TableCaption()));\n end;\n \n local procedure Initialize()\n@@ -1597,6 +1670,33 @@\n VATEntry.TestField(\"Posting Date\", PostingDate);\n end;\n \n+ local procedure SetItemInventory(Item: Record Item; Quantity: Decimal; LocationCode: Code[10])\n+ var\n+ ItemJournalTemplate: Record \"Item Journal Template\";\n+ ItemJournalBatch: Record \"Item Journal Batch\";\n+ ItemJournalLine: Record \"Item Journal Line\";\n+ begin\n+ LibraryInventory.CreateItemJournalTemplate(ItemJournalTemplate);\n+ LibraryInventory.CreateItemJournalBatch(ItemJournalBatch, ItemJournalTemplate.Name);\n+\n+ LibraryInventory.CreateItemJournalLine(ItemJournalLine, ItemJournalTemplate.Name, ItemJournalBatch.Name, ItemJournalLine.\"Entry Type\"::\"Positive Adjmt.\", Item.\"No.\", Quantity);\n+ ItemJournalLine.Validate(\"Location Code\", LocationCode);\n+ ItemJournalLine.Modify();\n+\n+ LibraryInventory.PostItemJournalLine(ItemJournalTemplate.Name, ItemJournalLine.\"Journal Batch Name\");\n+ end;\n+\n+ local procedure CreateStdServiceLineWithItem(StandardServiceCode: Code[10]; ItemNo: Code[20]; Quantity: Decimal)\n+ var\n+ StandardServiceLine: Record \"Standard Service Line\";\n+ begin\n+ LibraryService.CreateStandardServiceLine(StandardServiceLine, StandardServiceCode);\n+ StandardServiceLine.Validate(Type, StandardServiceLine.Type::Item);\n+ StandardServiceLine.Validate(\"No.\", ItemNo);\n+ StandardServiceLine.Validate(Quantity, Quantity);\n+ StandardServiceLine.Modify(true);\n+ end;\n+\n [ConfirmHandler]\n [Scope('OnPrem')]\n procedure ConfirmHandler(Question: Text[1024]; var Reply: Boolean)\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Service/Item/StandardServiceItemGrCode.Table.al b/App/Layers/W1/BaseApp/Service/Item/StandardServiceItemGrCode.Table.al\n--- a/App/Layers/W1/BaseApp/Service/Item/StandardServiceItemGrCode.Table.al\n+++ b/App/Layers/W1/BaseApp/Service/Item/StandardServiceItemGrCode.Table.al\n@@ -159,6 +159,11 @@\n ServLine.\"Line No.\" := ServLine.GetLineNo();\n OnBeforeInsertServLine(ServLine);\n ServLine.Insert(true);\n+\n+ if ServLine.Type = ServLine.Type::Item then\n+ if ServLine.Reserve = ServLine.Reserve::Always then\n+ ServLine.AutoReserve(false);\n+\n InsertExtendedText(ServLine);\n end;\n until StdServLine.Next() = 0;\n"} +{"instance_id": "microsoftInternal__NAV-210200__cf-2", "base_instance_id": "microsoftInternal__NAV-210200", "variant_description": "When Get Std. Service Codes inserts multiple service lines, only the item whose reserve policy is Always must create a reservation entry automatically", "intervention_type": "Execution / Validation Semantics", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-210200__cf-2", "FAIL_TO_PASS": [{"codeunitID": 136119, "functionName": ["ReservationEntryMustBeCreatedWhenReserveIsAlwaysInServiceLine"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM-Service/ServiceStandardCodes.Codeunit.al b/App/Layers/W1/Tests/SCM-Service/ServiceStandardCodes.Codeunit.al\n--- a/App/Layers/W1/Tests/SCM-Service/ServiceStandardCodes.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM-Service/ServiceStandardCodes.Codeunit.al\n@@ -9,6 +9,8 @@\n using Microsoft.Finance.GeneralLedger.Ledger;\n using Microsoft.Finance.VAT.Ledger;\n using Microsoft.Inventory.Item;\n+using Microsoft.Inventory.Journal;\n+using Microsoft.Inventory.Location;\n using Microsoft.Projects.Resources.Ledger;\n using Microsoft.Sales.Customer;\n using Microsoft.Sales.Receivables;\n@@ -40,6 +42,7 @@\n LibrarySales: Codeunit \"Library - Sales\";\n LibraryUtility: Codeunit \"Library - Utility\";\n LibraryERM: Codeunit \"Library - ERM\";\n+ LibraryWarehouse: Codeunit \"Library - Warehouse\";\n ServiceItemGroupCode2: Code[10];\n StandardServiceCode2: Code[10];\n isInitialized: Boolean;\n@@ -52,6 +55,7 @@\n QuantityMustbePositive: Label '%1 must be positive in %2 %3=''%4'',%5=''%6''.';\n ServiceLineMustNotExist: Label 'There is no %1 within the filter.Filters: %2: %3, %4: %5';\n ExpectedConfirm: Label 'The Credit Memo doesn''t have a Corrected Invoice No. Do you want to continue?';\n+ ValueMustBeEqualErr: Label '%1 must be equal to %2 in %3', Comment = '%1 = Field Caption , %2 = Expected Value , %3 = Table Caption';\n \n [Test]\n [Scope('OnPrem')]\n@@ -1024,6 +1028,80 @@\n \n \n StandardServiceLine.TestField(\"No.\", Item.\"No.\");\n+ end;\n+\n+ [Test]\n+ [HandlerFunctions('ModalFormHandlerServItemGroup')]\n+ procedure ReservationEntryMustBeCreatedWhenReserveIsAlwaysInServiceLine()\n+ var\n+ Item: Record Item;\n+ Item2: Record Item;\n+ Location: Record Location;\n+ Customer: Record Customer;\n+ ServiceItem: Record \"Service Item\";\n+ ServiceHeader: Record \"Service Header\";\n+ ServiceLine: Record \"Service Line\";\n+ ServiceItemLine: Record \"Service Item Line\";\n+ StandardServiceCode: Record \"Standard Service Code\";\n+ StandardServiceItemGrCode: Record \"Standard Service Item Gr. Code\";\n+ ExpectedQuantity: Integer;\n+ begin\n+ // [SCENARIO 566581] Verify Reservation Entry must be created only for Items with Reserve = Always in the Service Line.\n+ // when \"Get Std. Service Codes.\" is executed with multiple items.\n+ Initialize();\n+\n+ // [GIVEN] Create a Customer.\n+ LibrarySales.CreateCustomer(Customer);\n+\n+ // [GIVEN] Create Location with Inventory Posting Setup.\n+ LibraryWarehouse.CreateLocationWithInventoryPostingSetup(Location);\n+\n+ // [GIVEN] Create an item with Reserve = Always.\n+ LibraryInventory.CreateItem(Item);\n+ Item.Validate(\"Reordering Policy\", Item.\"Reordering Policy\"::\"Lot-for-Lot\");\n+ Item.Validate(Reserve, Item.Reserve::Always);\n+ Item.Modify();\n+\n+ // [GIVEN] Create another item without Reserve = Always.\n+ LibraryInventory.CreateItem(Item2);\n+\n+ // [GIVEN] Generate Quantity.\n+ ExpectedQuantity := LibraryRandom.RandInt(20);\n+\n+ // [GIVEN] Post inventory.\n+ SetItemInventory(Item, ExpectedQuantity, Location.Code);\n+\n+ // [GIVEN] Create Service Item.\n+ LibraryService.CreateServiceItem(ServiceItem, Customer.\"No.\");\n+\n+ // [GIVEN] Create Standard Service Code with two Items and Quantity.\n+ LibraryService.CreateStandardServiceCode(StandardServiceCode);\n+ CreateStdServiceLineWithItem(StandardServiceCode.Code, Item.\"No.\", ExpectedQuantity);\n+ CreateStdServiceLineWithItem(StandardServiceCode.Code, Item2.\"No.\", ExpectedQuantity);\n+\n+ // [GIVEN] Create Service Order with Location.\n+ LibraryService.CreateServiceHeader(ServiceHeader, ServiceHeader.\"Document Type\"::Order, Customer.\"No.\");\n+ ServiceHeader.Validate(\"Location Code\", Location.Code);\n+ ServiceHeader.Modify();\n+\n+ // [GIVEN] Create Service Item Line.\n+ LibraryService.CreateServiceItemLine(ServiceItemLine, ServiceHeader, '');\n+\n+ // [GIVEN] Delete Standard Service Group Code.\n+ StandardServiceItemGrCode.DeleteAll();\n+\n+ // [WHEN] Insert Service Line through Standard Service Code.\n+ ServiceItemGroupCode2 := '';\n+ StandardServiceCode2 := StandardServiceCode.Code;\n+ StandardServiceItemGrCode.InsertServiceLines(ServiceItemLine);\n+\n+ // [THEN] Verify \"Reserved Qty. (Base)\" must be updated in the Service Line for the Reserve=Always item.\n+ FindServiceLine(ServiceLine, ServiceHeader.\"Document Type\", ServiceHeader.\"No.\");\n+ ServiceLine.CalcFields(\"Reserved Qty. (Base)\");\n+ Assert.AreEqual(\n+ ExpectedQuantity,\n+ ServiceLine.\"Reserved Qty. (Base)\",\n+ StrSubstNo(ValueMustBeEqualErr, ServiceLine.FieldCaption(\"Reserved Qty. (Base)\"), ExpectedQuantity, ServiceLine.TableCaption()));\n end;\n \n local procedure Initialize()\n@@ -1597,6 +1675,33 @@\n VATEntry.TestField(\"Posting Date\", PostingDate);\n end;\n \n+ local procedure SetItemInventory(Item: Record Item; Quantity: Decimal; LocationCode: Code[10])\n+ var\n+ ItemJournalTemplate: Record \"Item Journal Template\";\n+ ItemJournalBatch: Record \"Item Journal Batch\";\n+ ItemJournalLine: Record \"Item Journal Line\";\n+ begin\n+ LibraryInventory.CreateItemJournalTemplate(ItemJournalTemplate);\n+ LibraryInventory.CreateItemJournalBatch(ItemJournalBatch, ItemJournalTemplate.Name);\n+\n+ LibraryInventory.CreateItemJournalLine(ItemJournalLine, ItemJournalTemplate.Name, ItemJournalBatch.Name, ItemJournalLine.\"Entry Type\"::\"Positive Adjmt.\", Item.\"No.\", Quantity);\n+ ItemJournalLine.Validate(\"Location Code\", LocationCode);\n+ ItemJournalLine.Modify();\n+\n+ LibraryInventory.PostItemJournalLine(ItemJournalTemplate.Name, ItemJournalLine.\"Journal Batch Name\");\n+ end;\n+\n+ local procedure CreateStdServiceLineWithItem(StandardServiceCode: Code[10]; ItemNo: Code[20]; Quantity: Decimal)\n+ var\n+ StandardServiceLine: Record \"Standard Service Line\";\n+ begin\n+ LibraryService.CreateStandardServiceLine(StandardServiceLine, StandardServiceCode);\n+ StandardServiceLine.Validate(Type, StandardServiceLine.Type::Item);\n+ StandardServiceLine.Validate(\"No.\", ItemNo);\n+ StandardServiceLine.Validate(Quantity, Quantity);\n+ StandardServiceLine.Modify(true);\n+ end;\n+\n [ConfirmHandler]\n [Scope('OnPrem')]\n procedure ConfirmHandler(Question: Text[1024]; var Reply: Boolean)\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Service/Item/StandardServiceItemGrCode.Table.al b/App/Layers/W1/BaseApp/Service/Item/StandardServiceItemGrCode.Table.al\n--- a/App/Layers/W1/BaseApp/Service/Item/StandardServiceItemGrCode.Table.al\n+++ b/App/Layers/W1/BaseApp/Service/Item/StandardServiceItemGrCode.Table.al\n@@ -159,6 +159,11 @@\n ServLine.\"Line No.\" := ServLine.GetLineNo();\n OnBeforeInsertServLine(ServLine);\n ServLine.Insert(true);\n+\n+ if ServLine.Type = ServLine.Type::Item then\n+ if ServLine.Reserve = ServLine.Reserve::Always then\n+ ServLine.AutoReserve(false);\n+\n InsertExtendedText(ServLine);\n end;\n until StdServLine.Next() = 0;\n"} +{"instance_id": "microsoftInternal__NAV-208649__cf-1", "base_instance_id": "microsoftInternal__NAV-208649", "variant_description": "Component consumed via non-base UOM with Qty. Rounding Precision = 1 must still keep fractional Quantity per and Expected Quantity", "intervention_type": "Execution / Validation Semantics", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-208649__cf-1", "FAIL_TO_PASS": [{"codeunitID": 137088, "functionName": ["ReleasedProdOrderQuantityPerandExpectedQtyRoundingPrecisionChecking"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMOrderPlanningIII.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMOrderPlanningIII.Codeunit.al\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 @@\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@@ -2986,6 +2988,78 @@\n \n \n VerifyStartingTimeOnFirmPlannedProductionOrder(StartingTime, ChildItem.\"No.\", ProductionOrderNo);\n+ end;\n+\n+ [Test]\n+ [HandlerFunctions('ModalPageHandler,ErrorMessageHandler')]\n+ procedure ReleasedProdOrderQuantityPerandExpectedQtyRoundingPrecisionChecking()\n+ var\n+ AltItemUnitOfMeasure: Record \"Item Unit of Measure\";\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 a non-base UOM of Component Item\n+ BaseItemUnitOfMeasure.Get(ComponentItem.\"No.\", ComponentItem.\"Base Unit of Measure\");\n+ AltItemUnitOfMeasure.Init();\n+ AltItemUnitOfMeasure.Validate(\"Item No.\", ComponentItem.\"No.\");\n+ AltItemUnitOfMeasure.Validate(Code, 'BOX');\n+ AltItemUnitOfMeasure.Validate(\"Qty. per Unit of Measure\", 1);\n+ AltItemUnitOfMeasure.Validate(\"Qty. Rounding Precision\", 1);\n+ AltItemUnitOfMeasure.Insert(true);\n+\n+ // [GIVEN] Created Production Bom using Component Item\n+ LibraryManufacturing.CreateProductionBOMHeader(ProductionBOMHeader, ComponentItem.\"Base Unit of Measure\");\n+ LibraryManufacturing.CreateProductionBOMLine(ProductionBOMHeader, ProductionBOMLine, AltItemUnitOfMeasure.Code, 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@@ -3805,6 +3879,14 @@\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 +3993,16 @@\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/W1/BaseApp/Manufacturing/Document/CalculateProdOrder.Codeunit.al b/App/Layers/W1/BaseApp/Manufacturing/Document/CalculateProdOrder.Codeunit.al\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 @@\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@@ -297,6 +298,7 @@\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,19 @@\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+ 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"} +{"instance_id": "microsoftInternal__NAV-208649__cf-2", "base_instance_id": "microsoftInternal__NAV-208649", "variant_description": "Sales Order requesting 2 units of the finished good must scale component Expected Quantity accordingly", "intervention_type": "Workflow / Business Logic Composition", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-208649__cf-2", "FAIL_TO_PASS": [{"codeunitID": 137088, "functionName": ["ReleasedProdOrderQuantityPerandExpectedQtyRoundingPrecisionChecking"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMOrderPlanningIII.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMOrderPlanningIII.Codeunit.al\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 @@\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@@ -2986,6 +2988,73 @@\n \n \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 - 2\n+ CreateSalesOrder(SalesHeader, ProductItem.\"No.\", '', 2, 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 * 2, ProdOrderComp.\"Expected Quantity\", StrSubstNo(RelesedProdOrderComponentExpQtyRoundingErr, ProdOrderComp.\"Expected Quantity\", ExpectedQty * 2));\n end;\n \n local procedure Initialize()\n@@ -3805,6 +3874,14 @@\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 @@\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/W1/BaseApp/Manufacturing/Document/CalculateProdOrder.Codeunit.al b/App/Layers/W1/BaseApp/Manufacturing/Document/CalculateProdOrder.Codeunit.al\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 @@\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@@ -297,6 +298,7 @@\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 @@\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"} +{"instance_id": "microsoftInternal__NAV-208649__cf-3", "base_instance_id": "microsoftInternal__NAV-208649", "variant_description": "Production BOM consuming a different fractional quantity (0.49) must still keep correct Quantity per and Expected Quantity", "intervention_type": "Execution / Validation Semantics", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-208649__cf-3", "FAIL_TO_PASS": [{"codeunitID": 137088, "functionName": ["ReleasedProdOrderQuantityPerandExpectedQtyRoundingPrecisionChecking"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMOrderPlanningIII.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMOrderPlanningIII.Codeunit.al\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 @@\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@@ -2986,6 +2988,73 @@\n \n \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.\", 0.49);\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@@ -3805,6 +3874,14 @@\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 @@\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/W1/BaseApp/Manufacturing/Document/CalculateProdOrder.Codeunit.al b/App/Layers/W1/BaseApp/Manufacturing/Document/CalculateProdOrder.Codeunit.al\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 @@\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@@ -297,6 +298,7 @@\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 @@\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"} +{"instance_id": "microsoftInternal__NAV-209496__cf-1", "base_instance_id": "microsoftInternal__NAV-209496", "variant_description": "Use German (DEU) instead of English (ENG) as the selected language when adding text for language in Reminder Level Communication", "intervention_type": "Execution / Validation Semantics", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-209496__cf-1", "FAIL_TO_PASS": [{"codeunitID": 134979, "functionName": ["AddTextforLanguageInReminderLevelCommunicationGerman"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/ReminderAutomationTests.Codeunit.al b/App/Layers/W1/Tests/ERM/ReminderAutomationTests.Codeunit.al\n--- a/App/Layers/W1/Tests/ERM/ReminderAutomationTests.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ReminderAutomationTests.Codeunit.al\n@@ -812,6 +812,30 @@\n \n \n ReminderAutomationCard.Close();\n+ end;\n+\n+ [Test]\n+ [HandlerFunctions('ConfirmHandlerFalse,ReminderLevelCommunicationPageHandler,LanguagesPageHandlerDEU')]\n+ procedure AddTextforLanguageInReminderLevelCommunicationGerman()\n+ var\n+ ReminderTerms: Record \"Reminder Terms\";\n+ ReminderLevel: Record \"Reminder Level\";\n+ ReminderTermSetupPage: TestPage \"Reminder Terms Setup\";\n+ begin\n+ // [SCENARIO 568005] Adding text for language in Reminder Level Communication.\n+ Initialize();\n+\n+ // [GIVEN] Create Reminder Term with levels\n+ LibraryErm.CreateReminderTerms(ReminderTerms);\n+ LibraryErm.CreateReminderLevel(ReminderLevel, ReminderTerms.Code);\n+\n+ // [WHEN] Open Reminder Term Setup page and add text for language\n+ ReminderTermSetupPage.OpenEdit();\n+ ReminderTermSetupPage.GoToRecord(ReminderTerms);\n+ ReminderTermSetupPage.ReminderLevelSetup.First();\n+\n+ // [THEN] Verify that the text for German is added in Reminder Level Communication.\n+ ReminderTermSetupPage.ReminderLevelSetup.CustomerCommunications.Invoke();\n end;\n \n local procedure CreateReminderAttachmentText(ReminderTerms: Record \"Reminder Terms\"; LanguageCode: Code[10])\n@@ -1211,6 +1235,32 @@\n exit(true);\n end;\n \n+ [ConfirmHandler]\n+ procedure ConfirmHandlerFalse(QuestionText: Text[1024]; var Relpy: Boolean)\n+ begin\n+ Relpy := false;\n+ end;\n+\n+ [PageHandler]\n+ procedure ReminderLevelCommunicationPageHandler(var ReminderLevelCommunication: TestPage \"Reminder Level Communication\")\n+ begin\n+ ReminderLevelCommunication.\"Add New Language\".Invoke();\n+ end;\n+\n+ [ModalPageHandler]\n+ procedure LanguagesPageHandler(var Languages: TestPage \"Languages\")\n+ begin\n+ Languages.Filter.SetFilter(\"Code\", 'ENG');\n+ Languages.OK().Invoke();\n+ end;\n+\n+ [ModalPageHandler]\n+ procedure LanguagesPageHandlerDEU(var Languages: TestPage \"Languages\")\n+ begin\n+ Languages.Filter.SetFilter(\"Code\", 'DEU');\n+ Languages.OK().Invoke();\n+ end;\n+\n var\n LibraryVariableStorage: Codeunit \"Library - Variable Storage\";\n LibraryUtility: Codeunit \"Library - Utility\";\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Sales/Reminder/TermsAndLevels/ReminderLevelCommunication.Page.al b/App/Layers/W1/BaseApp/Sales/Reminder/TermsAndLevels/ReminderLevelCommunication.Page.al\n--- a/App/Layers/W1/BaseApp/Sales/Reminder/TermsAndLevels/ReminderLevelCommunication.Page.al\n+++ b/App/Layers/W1/BaseApp/Sales/Reminder/TermsAndLevels/ReminderLevelCommunication.Page.al\n@@ -304,17 +304,19 @@\n var\n ReminderAttachmentText: Record \"Reminder Attachment Text\";\n ReminderEmailText: Record \"Reminder Email Text\";\n+ ReminderLevel: Record \"Reminder Level\";\n begin\n if LanguageCode = '' then\n exit;\n \n CurrentLanguage.SetRange(Code, LanguageCode);\n CurrentLanguage.FindFirst();\n-\n- if not ReminderAttachmentText.Get(Rec.\"Reminder Attachment Text\", CurrentLanguage.Code) then\n+ ReminderLevel.Get(Rec.\"Reminder Terms Code\", Rec.\"No.\");\n+\n+ if not ReminderAttachmentText.Get(ReminderLevel.\"Reminder Attachment Text\", CurrentLanguage.Code) then\n if CreateNewEntry then begin\n- ReminderAttachmentText.SetDefaultContentForNewLanguage(Rec.\"Reminder Attachment Text\", CurrentLanguage.Code, Enum::\"Reminder Text Source Type\"::\"Reminder Level\");\n- ReminderEmailText.SetDefaultContentForNewLanguage(Rec.\"Reminder Email Text\", CurrentLanguage.Code, Enum::\"Reminder Text Source Type\"::\"Reminder Level\");\n+ ReminderAttachmentText.SetDefaultContentForNewLanguage(ReminderLevel.\"Reminder Attachment Text\", CurrentLanguage.Code, Enum::\"Reminder Text Source Type\"::\"Reminder Level\");\n+ ReminderEmailText.SetDefaultContentForNewLanguage(ReminderLevel.\"Reminder Email Text\", CurrentLanguage.Code, Enum::\"Reminder Text Source Type\"::\"Reminder Level\");\n end\n else\n Error(NoTextForSelectedLanguageErr, CurrentLanguage.Code);\n"} +{"instance_id": "microsoftInternal__NAV-209496__cf-2", "base_instance_id": "microsoftInternal__NAV-209496", "variant_description": "Run the same operation on the second reminder level instead of the first", "intervention_type": "Execution / Validation Semantics", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-209496__cf-2", "FAIL_TO_PASS": [{"codeunitID": 134979, "functionName": ["AddTextforLanguageInSecondReminderLevelCommunication"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/ReminderAutomationTests.Codeunit.al b/App/Layers/W1/Tests/ERM/ReminderAutomationTests.Codeunit.al\n--- a/App/Layers/W1/Tests/ERM/ReminderAutomationTests.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ReminderAutomationTests.Codeunit.al\n@@ -812,6 +812,32 @@\n \n \n ReminderAutomationCard.Close();\n+ end;\n+\n+ [Test]\n+ [HandlerFunctions('ConfirmHandlerFalse,ReminderLevelCommunicationPageHandler,LanguagesPageHandler')]\n+ procedure AddTextforLanguageInSecondReminderLevelCommunication()\n+ var\n+ ReminderTerms: Record \"Reminder Terms\";\n+ ReminderLevel: Record \"Reminder Level\";\n+ ReminderTermSetupPage: TestPage \"Reminder Terms Setup\";\n+ begin\n+ // [SCENARIO 568005] Adding text for language in Reminder Level Communication.\n+ Initialize();\n+\n+ // [GIVEN] Create Reminder Term with levels\n+ LibraryErm.CreateReminderTerms(ReminderTerms);\n+ LibraryErm.CreateReminderLevel(ReminderLevel, ReminderTerms.Code);\n+ LibraryErm.CreateReminderLevel(ReminderLevel, ReminderTerms.Code);\n+\n+ // [WHEN] Open Reminder Term Setup page and add text for language\n+ ReminderTermSetupPage.OpenEdit();\n+ ReminderTermSetupPage.GoToRecord(ReminderTerms);\n+ ReminderTermSetupPage.ReminderLevelSetup.First();\n+ ReminderTermSetupPage.ReminderLevelSetup.Next();\n+\n+ // [THEN] Verify that the text for language is added on the second Reminder Level Communication.\n+ ReminderTermSetupPage.ReminderLevelSetup.CustomerCommunications.Invoke();\n end;\n \n local procedure CreateReminderAttachmentText(ReminderTerms: Record \"Reminder Terms\"; LanguageCode: Code[10])\n@@ -1211,6 +1237,25 @@\n exit(true);\n end;\n \n+ [ConfirmHandler]\n+ procedure ConfirmHandlerFalse(QuestionText: Text[1024]; var Relpy: Boolean)\n+ begin\n+ Relpy := false;\n+ end;\n+\n+ [PageHandler]\n+ procedure ReminderLevelCommunicationPageHandler(var ReminderLevelCommunication: TestPage \"Reminder Level Communication\")\n+ begin\n+ ReminderLevelCommunication.\"Add New Language\".Invoke();\n+ end;\n+\n+ [ModalPageHandler]\n+ procedure LanguagesPageHandler(var Languages: TestPage \"Languages\")\n+ begin\n+ Languages.Filter.SetFilter(\"Code\", 'ENG');\n+ Languages.OK().Invoke();\n+ end;\n+\n var\n LibraryVariableStorage: Codeunit \"Library - Variable Storage\";\n LibraryUtility: Codeunit \"Library - Utility\";\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Sales/Reminder/TermsAndLevels/ReminderLevelCommunication.Page.al b/App/Layers/W1/BaseApp/Sales/Reminder/TermsAndLevels/ReminderLevelCommunication.Page.al\n--- a/App/Layers/W1/BaseApp/Sales/Reminder/TermsAndLevels/ReminderLevelCommunication.Page.al\n+++ b/App/Layers/W1/BaseApp/Sales/Reminder/TermsAndLevels/ReminderLevelCommunication.Page.al\n@@ -304,17 +304,19 @@\n var\n ReminderAttachmentText: Record \"Reminder Attachment Text\";\n ReminderEmailText: Record \"Reminder Email Text\";\n+ ReminderLevel: Record \"Reminder Level\";\n begin\n if LanguageCode = '' then\n exit;\n \n CurrentLanguage.SetRange(Code, LanguageCode);\n CurrentLanguage.FindFirst();\n-\n- if not ReminderAttachmentText.Get(Rec.\"Reminder Attachment Text\", CurrentLanguage.Code) then\n+ ReminderLevel.Get(Rec.\"Reminder Terms Code\", Rec.\"No.\");\n+\n+ if not ReminderAttachmentText.Get(ReminderLevel.\"Reminder Attachment Text\", CurrentLanguage.Code) then\n if CreateNewEntry then begin\n- ReminderAttachmentText.SetDefaultContentForNewLanguage(Rec.\"Reminder Attachment Text\", CurrentLanguage.Code, Enum::\"Reminder Text Source Type\"::\"Reminder Level\");\n- ReminderEmailText.SetDefaultContentForNewLanguage(Rec.\"Reminder Email Text\", CurrentLanguage.Code, Enum::\"Reminder Text Source Type\"::\"Reminder Level\");\n+ ReminderAttachmentText.SetDefaultContentForNewLanguage(ReminderLevel.\"Reminder Attachment Text\", CurrentLanguage.Code, Enum::\"Reminder Text Source Type\"::\"Reminder Level\");\n+ ReminderEmailText.SetDefaultContentForNewLanguage(ReminderLevel.\"Reminder Email Text\", CurrentLanguage.Code, Enum::\"Reminder Text Source Type\"::\"Reminder Level\");\n end\n else\n Error(NoTextForSelectedLanguageErr, CurrentLanguage.Code);\n"} +{"instance_id": "microsoftInternal__NAV-208748__cf-1", "base_instance_id": "microsoftInternal__NAV-208748", "variant_description": "Use exactly 2 items instead of 3 in the blanket order", "intervention_type": "Execution / Validation Semantics", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-208748__cf-1", "FAIL_TO_PASS": [{"codeunitID": 134377, "functionName": ["CheckMultipleExtendedTextFromBlanketSalesOrderToSalesOrder"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/ERMSalesBlanketOrder.Codeunit.al b/App/Layers/W1/Tests/ERM/ERMSalesBlanketOrder.Codeunit.al\n--- a/App/Layers/W1/Tests/ERM/ERMSalesBlanketOrder.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ERMSalesBlanketOrder.Codeunit.al\n@@ -33,6 +33,7 @@\n BlanketOrderLineNoFieldError: Label 'Blanket Order Line No. missing on related Sales Credit Memo';\n UnitPriceIsChangedErr: Label 'Unit Price is changed on Quantity update.';\n ValueMustBeEqualErr: Label '%1 must be equal to %2 in the %3.', Comment = '%1 = Field Caption , %2 = Expected Value, %3 = Table Caption';\n+ TotalRecordCountErr: Label 'Total record count must be equal to %1', Comment = '%1 = Record Count.';\n \n [Test]\n [Scope('OnPrem')]\n@@ -1377,10 +1378,45 @@\n until SalesLine.Next() = 0;\n end;\n \n+ [Test]\n+ procedure CheckMultipleExtendedTextFromBlanketSalesOrderToSalesOrder()\n+ var\n+ BlanketSalesHeader: Record \"Sales Header\";\n+ SalesOrderLine: Record \"Sales Line\";\n+ NotificationLifecycleMgt: Codeunit \"Notification Lifecycle Mgt.\";\n+ BlanketSalesOrder: TestPage \"Blanket Sales Order\";\n+ CustomerNo: Code[20];\n+ OrderNo: Code[20];\n+ begin\n+ // [SCENARIO 567891] Verify the multiple extended texts line when converting a blanket sales order to a sales order.\n+ Initialize();\n+\n+ // [GIVEN] Create Blanket Sales Order With Multiple Extended Items.\n+ CustomerNo := CreateBlanketSalesOrder(BlanketSalesOrder);\n+\n+ // [GIVEN] Find Blanket Sales Order.\n+ BlanketSalesHeader.SetRange(\"Sell-to Customer No.\", CustomerNo);\n+ BlanketSalesHeader.FindFirst();\n+\n+ // [WHEN] Convert the blanket sales order into a sales order.\n+ OrderNo := LibrarySales.BlanketSalesOrderMakeOrder(BlanketSalesHeader);\n+\n+ // [THEN] Calculate no. of Sales order line record.\n+ SalesOrderLine.SetRange(\"Document Type\", SalesOrderLine.\"Document Type\"::Order);\n+ SalesOrderLine.SetRange(\"Document No.\", OrderNo);\n+\n+ // [THEN] Verify the sales order line record count with the extended text records.\n+ Assert.AreEqual(\n+ SalesOrderLine.Count(), CalculateBlanketSalesOrderLineRecords(BlanketSalesHeader),\n+ StrSubstNo(TotalRecordCountErr, SalesOrderLine.Count()));\n+\n+ NotificationLifecycleMgt.RecallAllNotifications();\n+ end;\n+\n local procedure Initialize()\n var\n+ SalesReceivablesSetup: Record \"Sales & Receivables Setup\";\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n- SalesReceivablesSetup: Record \"Sales & Receivables Setup\";\n begin\n LibraryTestInitialize.OnTestInitialize(CODEUNIT::\"ERM Sales Blanket Order\");\n LibrarySetupStorage.Restore();\n@@ -1716,6 +1752,61 @@\n exit(Purchasing.Code);\n end;\n \n+ local procedure CreateBlanketSalesOrder(var BlanketSalesOrder: TestPage \"Blanket Sales Order\"): Code[20]\n+ var\n+ Customer: Record Customer;\n+ Item: array[3] of Record Item;\n+ i: Integer;\n+ begin\n+ LibrarySales.CreateCustomer(Customer);\n+ BlanketSalesOrder.OpenNew();\n+ BlanketSalesOrder.\"Sell-to Customer No.\".SetValue(Customer.\"No.\");\n+ for i := 1 to LibraryRandom.RandIntInRange(2, 2) do begin\n+ CreateMultipleItemWithExtendedText(Item[i]);\n+ CreateBlanketSalesLineFromSubformPage(BlanketSalesOrder, Item[i]);\n+ end;\n+ BlanketSalesOrder.Close();\n+\n+ exit(Customer.\"No.\");\n+ end;\n+\n+ local procedure CreateMultipleItemWithExtendedText(var Item: Record Item)\n+ var\n+ ExtendedTextHeader: Record \"Extended Text Header\";\n+ ExtendedTextLine: Record \"Extended Text Line\";\n+ begin\n+ Item.Get(CreateItem());\n+ Item.Validate(\"Automatic Ext. Texts\", true);\n+ Item.Modify(true);\n+\n+ LibraryInventory.CreateExtendedTextHeaderItem(ExtendedTextHeader, Item.\"No.\");\n+ LibraryInventory.CreateExtendedTextLineItem(ExtendedTextLine, ExtendedTextHeader);\n+ ExtendedTextLine.Validate(Text, Item.\"No.\");\n+ ExtendedTextLine.Modify(true);\n+ end;\n+\n+ local procedure CreateBlanketSalesLineFromSubformPage(var BlanketSalesOrder: TestPage \"Blanket Sales Order\"; Item: Record Item)\n+ var\n+ SalesLineType: Enum \"Sales Line Type\";\n+ begin\n+ BlanketSalesOrder.SalesLines.New();\n+ BlanketSalesOrder.SalesLines.Type.SetValue(SalesLineType::Item);\n+ BlanketSalesOrder.SalesLines.\"No.\".SetValue(Item.\"No.\");\n+ BlanketSalesOrder.SalesLines.Quantity.SetValue(LibraryRandom.RandInt(10));\n+ Commit();\n+ BlanketSalesOrder.SalesLines.Next();\n+ end;\n+\n+ local procedure CalculateBlanketSalesOrderLineRecords(BlanketSalesOrder: Record \"Sales Header\"): Integer\n+ var\n+ BlanketSalesLine: Record \"Sales Line\";\n+ begin\n+ BlanketSalesLine.SetRange(\"Document Type\", BlanketSalesOrder.\"Document Type\");\n+ BlanketSalesLine.SetRange(\"Document No.\", BlanketSalesOrder.\"No.\");\n+\n+ exit(BlanketSalesLine.Count);\n+ end;\n+\n [MessageHandler]\n [Scope('OnPrem')]\n procedure MessageHandler(Message: Text[1024])\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Sales/Document/BlanketSalesOrdertoOrder.Codeunit.al b/App/Layers/W1/BaseApp/Sales/Document/BlanketSalesOrdertoOrder.Codeunit.al\n--- a/App/Layers/W1/BaseApp/Sales/Document/BlanketSalesOrdertoOrder.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/BlanketSalesOrdertoOrder.Codeunit.al\n@@ -203,7 +203,7 @@\n SalesLineOrder.\"Qty. to Asm. to Order (Base)\" := SalesLineOrder.\"Quantity (Base)\";\n end;\n SalesLineOrder.DefaultDeferralCode();\n- if IsSalesOrderLineToBeInserted(SalesLineOrder) then begin\n+ if IsSalesOrderLineToBeInserted(SalesLineOrder, SalesLineBlanketOrder) then begin\n OnBeforeInsertSalesOrderLine(SalesLineOrder, SalesHeaderOrder, SalesLineBlanketOrder, SalesHeaderBlanketOrder);\n SalesLineOrder.Insert();\n OnAfterInsertSalesOrderLine(SalesLineOrder, SalesHeaderOrder, SalesLineBlanketOrder, SalesHeaderBlanketOrder);\n@@ -447,15 +447,12 @@\n ItemCheckAvail.RaiseUpdateInterruptedError();\n end;\n \n- local procedure IsSalesOrderLineToBeInserted(SalesOrderLine: Record \"Sales Line\"): Boolean\n- var\n- AttachedToSalesLine: Record \"Sales Line\";\n+ local procedure IsSalesOrderLineToBeInserted(SalesOrderLine: Record \"Sales Line\"; BlanketSalesOrderLine: Record \"Sales Line\"): Boolean\n begin\n if not SalesOrderLine.IsExtendedText() then\n exit(true);\n- exit(\n- AttachedToSalesLine.Get(\n- SalesOrderLine.\"Document Type\", SalesOrderLine.\"Document No.\", SalesOrderLine.\"Attached to Line No.\"));\n+\n+ exit(BlanketSalesOrderLine.\"Attached to Line No.\" <> 0);\n end;\n \n [IntegrationEvent(false, false)]\n"} +{"instance_id": "microsoftInternal__NAV-208748__cf-2", "base_instance_id": "microsoftInternal__NAV-208748", "variant_description": "Only some items have extended text (mixed case: 2 of 3 items with extended text)", "intervention_type": "Execution / Validation Semantics", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-208748__cf-2", "FAIL_TO_PASS": [{"codeunitID": 134377, "functionName": ["CheckMultipleExtendedTextFromBlanketSalesOrderToSalesOrder"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/ERMSalesBlanketOrder.Codeunit.al b/App/Layers/W1/Tests/ERM/ERMSalesBlanketOrder.Codeunit.al\n--- a/App/Layers/W1/Tests/ERM/ERMSalesBlanketOrder.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ERMSalesBlanketOrder.Codeunit.al\n@@ -33,6 +33,7 @@\n BlanketOrderLineNoFieldError: Label 'Blanket Order Line No. missing on related Sales Credit Memo';\n UnitPriceIsChangedErr: Label 'Unit Price is changed on Quantity update.';\n ValueMustBeEqualErr: Label '%1 must be equal to %2 in the %3.', Comment = '%1 = Field Caption , %2 = Expected Value, %3 = Table Caption';\n+ TotalRecordCountErr: Label 'Total record count must be equal to %1', Comment = '%1 = Record Count.';\n \n [Test]\n [Scope('OnPrem')]\n@@ -1377,10 +1378,45 @@\n until SalesLine.Next() = 0;\n end;\n \n+ [Test]\n+ procedure CheckMultipleExtendedTextFromBlanketSalesOrderToSalesOrder()\n+ var\n+ BlanketSalesHeader: Record \"Sales Header\";\n+ SalesOrderLine: Record \"Sales Line\";\n+ NotificationLifecycleMgt: Codeunit \"Notification Lifecycle Mgt.\";\n+ BlanketSalesOrder: TestPage \"Blanket Sales Order\";\n+ CustomerNo: Code[20];\n+ OrderNo: Code[20];\n+ begin\n+ // [SCENARIO 567891] Verify the multiple extended texts line when converting a blanket sales order to a sales order.\n+ Initialize();\n+\n+ // [GIVEN] Create Blanket Sales Order With Multiple Extended Items.\n+ CustomerNo := CreateBlanketSalesOrder(BlanketSalesOrder);\n+\n+ // [GIVEN] Find Blanket Sales Order.\n+ BlanketSalesHeader.SetRange(\"Sell-to Customer No.\", CustomerNo);\n+ BlanketSalesHeader.FindFirst();\n+\n+ // [WHEN] Convert the blanket sales order into a sales order.\n+ OrderNo := LibrarySales.BlanketSalesOrderMakeOrder(BlanketSalesHeader);\n+\n+ // [THEN] Calculate no. of Sales order line record.\n+ SalesOrderLine.SetRange(\"Document Type\", SalesOrderLine.\"Document Type\"::Order);\n+ SalesOrderLine.SetRange(\"Document No.\", OrderNo);\n+\n+ // [THEN] Verify the sales order line record count with the extended text records.\n+ Assert.AreEqual(\n+ SalesOrderLine.Count(), CalculateBlanketSalesOrderLineRecords(BlanketSalesHeader),\n+ StrSubstNo(TotalRecordCountErr, SalesOrderLine.Count()));\n+\n+ NotificationLifecycleMgt.RecallAllNotifications();\n+ end;\n+\n local procedure Initialize()\n var\n+ SalesReceivablesSetup: Record \"Sales & Receivables Setup\";\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n- SalesReceivablesSetup: Record \"Sales & Receivables Setup\";\n begin\n LibraryTestInitialize.OnTestInitialize(CODEUNIT::\"ERM Sales Blanket Order\");\n LibrarySetupStorage.Restore();\n@@ -1716,6 +1752,64 @@\n exit(Purchasing.Code);\n end;\n \n+ local procedure CreateBlanketSalesOrder(var BlanketSalesOrder: TestPage \"Blanket Sales Order\"): Code[20]\n+ var\n+ Customer: Record Customer;\n+ Item: array[3] of Record Item;\n+ i: Integer;\n+ begin\n+ LibrarySales.CreateCustomer(Customer);\n+ BlanketSalesOrder.OpenNew();\n+ BlanketSalesOrder.\"Sell-to Customer No.\".SetValue(Customer.\"No.\");\n+ for i := 1 to LibraryRandom.RandIntInRange(3, 3) do begin\n+ if i < 3 then\n+ CreateMultipleItemWithExtendedText(Item[i])\n+ else\n+ Item[i].Get(CreateItem());\n+ CreateBlanketSalesLineFromSubformPage(BlanketSalesOrder, Item[i]);\n+ end;\n+ BlanketSalesOrder.Close();\n+\n+ exit(Customer.\"No.\");\n+ end;\n+\n+ local procedure CreateMultipleItemWithExtendedText(var Item: Record Item)\n+ var\n+ ExtendedTextHeader: Record \"Extended Text Header\";\n+ ExtendedTextLine: Record \"Extended Text Line\";\n+ begin\n+ Item.Get(CreateItem());\n+ Item.Validate(\"Automatic Ext. Texts\", true);\n+ Item.Modify(true);\n+\n+ LibraryInventory.CreateExtendedTextHeaderItem(ExtendedTextHeader, Item.\"No.\");\n+ LibraryInventory.CreateExtendedTextLineItem(ExtendedTextLine, ExtendedTextHeader);\n+ ExtendedTextLine.Validate(Text, Item.\"No.\");\n+ ExtendedTextLine.Modify(true);\n+ end;\n+\n+ local procedure CreateBlanketSalesLineFromSubformPage(var BlanketSalesOrder: TestPage \"Blanket Sales Order\"; Item: Record Item)\n+ var\n+ SalesLineType: Enum \"Sales Line Type\";\n+ begin\n+ BlanketSalesOrder.SalesLines.New();\n+ BlanketSalesOrder.SalesLines.Type.SetValue(SalesLineType::Item);\n+ BlanketSalesOrder.SalesLines.\"No.\".SetValue(Item.\"No.\");\n+ BlanketSalesOrder.SalesLines.Quantity.SetValue(LibraryRandom.RandInt(10));\n+ Commit();\n+ BlanketSalesOrder.SalesLines.Next();\n+ end;\n+\n+ local procedure CalculateBlanketSalesOrderLineRecords(BlanketSalesOrder: Record \"Sales Header\"): Integer\n+ var\n+ BlanketSalesLine: Record \"Sales Line\";\n+ begin\n+ BlanketSalesLine.SetRange(\"Document Type\", BlanketSalesOrder.\"Document Type\");\n+ BlanketSalesLine.SetRange(\"Document No.\", BlanketSalesOrder.\"No.\");\n+\n+ exit(BlanketSalesLine.Count);\n+ end;\n+\n [MessageHandler]\n [Scope('OnPrem')]\n procedure MessageHandler(Message: Text[1024])\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Sales/Document/BlanketSalesOrdertoOrder.Codeunit.al b/App/Layers/W1/BaseApp/Sales/Document/BlanketSalesOrdertoOrder.Codeunit.al\n--- a/App/Layers/W1/BaseApp/Sales/Document/BlanketSalesOrdertoOrder.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/BlanketSalesOrdertoOrder.Codeunit.al\n@@ -203,7 +203,7 @@\n SalesLineOrder.\"Qty. to Asm. to Order (Base)\" := SalesLineOrder.\"Quantity (Base)\";\n end;\n SalesLineOrder.DefaultDeferralCode();\n- if IsSalesOrderLineToBeInserted(SalesLineOrder) then begin\n+ if IsSalesOrderLineToBeInserted(SalesLineOrder, SalesLineBlanketOrder) then begin\n OnBeforeInsertSalesOrderLine(SalesLineOrder, SalesHeaderOrder, SalesLineBlanketOrder, SalesHeaderBlanketOrder);\n SalesLineOrder.Insert();\n OnAfterInsertSalesOrderLine(SalesLineOrder, SalesHeaderOrder, SalesLineBlanketOrder, SalesHeaderBlanketOrder);\n@@ -447,15 +447,12 @@\n ItemCheckAvail.RaiseUpdateInterruptedError();\n end;\n \n- local procedure IsSalesOrderLineToBeInserted(SalesOrderLine: Record \"Sales Line\"): Boolean\n- var\n- AttachedToSalesLine: Record \"Sales Line\";\n+ local procedure IsSalesOrderLineToBeInserted(SalesOrderLine: Record \"Sales Line\"; BlanketSalesOrderLine: Record \"Sales Line\"): Boolean\n begin\n if not SalesOrderLine.IsExtendedText() then\n exit(true);\n- exit(\n- AttachedToSalesLine.Get(\n- SalesOrderLine.\"Document Type\", SalesOrderLine.\"Document No.\", SalesOrderLine.\"Attached to Line No.\"));\n+\n+ exit(BlanketSalesOrderLine.\"Attached to Line No.\" <> 0);\n end;\n \n [IntegrationEvent(false, false)]\n"} +{"instance_id": "microsoftInternal__NAV-209450__cf-1", "base_instance_id": "microsoftInternal__NAV-209450", "variant_description": "Only Non-Inventory items are in scope for the non-reservable rule", "intervention_type": "Execution / Validation Semantics", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-209450__cf-1", "FAIL_TO_PASS": [{"codeunitID": 136302, "functionName": ["PurchaseLineNotReservedWhenItemTypeNonInventory"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/Job/JobConsumptionPurchase.Codeunit.al b/App/Layers/W1/Tests/Job/JobConsumptionPurchase.Codeunit.al\n--- a/App/Layers/W1/Tests/Job/JobConsumptionPurchase.Codeunit.al\n+++ b/App/Layers/W1/Tests/Job/JobConsumptionPurchase.Codeunit.al\n@@ -4337,6 +4337,71 @@\n \n \n JobLedgerEntry.TestField(\"Lot No.\", LotNo);\n+ end;\n+\n+ [Test]\n+ [HandlerFunctions('PurchaseOrderReserveFromCurrentLineHandler2')]\n+ procedure PurchaseLineNotReservedWhenItemTypeNonInventory()\n+ var\n+ Item: array[2] of Record Item;\n+ JobPlanningLine: Record \"Job Planning Line\";\n+ JobTask: Record \"Job Task\";\n+ PurchaseHeader: Record \"Purchase Header\";\n+ PurchaseLine: Record \"Purchase Line\";\n+ PurchaseOrder: TestPage \"Purchase Order\";\n+ i: Integer;\n+ Quantity: Decimal;\n+ begin\n+ // [SCENARIO 563482] Verify that it is not possible to reserve a sales line when the item type is Non-Inventory or Service.\n+ Initialize();\n+ Quantity := LibraryRandom.RandIntInRange(100, 200);\n+\n+ // [GIVEN] Create Inventory and Non Inventory type item.\n+ LibraryInventory.CreateItem(Item[1]);\n+ LibraryInventory.CreateNonInventoryTypeItem(Item[2]);\n+\n+ // [GIVEN] Create Job and Job Task.\n+ CreateJobWithJobTask(JobTask);\n+\n+ // [GIVEN] Create Purchase Header.\n+ LibraryPurchase.CreatePurchHeader(\n+ PurchaseHeader, PurchaseHeader.\"Document Type\"::Order, LibraryPurchase.CreateVendorNo());\n+\n+ // [GIVEN] Set the Work Date to be later than the Purchase Document date.\n+ WorkDate := WorkDate() + 1;\n+\n+ for i := 1 to LibraryRandom.RandIntInRange(2, 2) do begin\n+ // [GIVEN] Create a job planning line for Inventory, Non-Inventory, and Service type items.\n+ CreateJobPlanningLine(\n+ JobPlanningLine, JobTask, JobPlanningLine.Type::Item, Item[i].\"No.\", Quantity, true);\n+ JobPlanningLine.Validate(Reserve, JobPlanningLine.Reserve::Optional);\n+ JobPlanningLine.Validate(\"Unit Cost\", LibraryRandom.RandDec(1000, 2));\n+ JobPlanningLine.Modify(true);\n+\n+ // [GIVEN] Create a purchase line for Inventory, Non-Inventory, and Service type items.\n+ LibraryPurchase.CreatePurchaseLine(\n+ PurchaseLine, PurchaseHeader, PurchaseLine.Type::Item, Item[i].\"No.\", Quantity);\n+\n+ Commit();\n+ // [GIVEN] Open Purchase Order Page\n+ PurchaseOrder.OpenEdit();\n+ PurchaseOrder.Filter.SetFilter(\"No.\", PurchaseHeader.\"No.\");\n+ PurchaseOrder.PurchLines.Filter.SetFilter(\"No.\", Item[i].\"No.\");\n+\n+ // [WHEN] Item type Inventory\n+ if Item[i].IsInventoriableType() then\n+ PurchaseOrder.PurchLines.Reserve.Invoke()\n+ else\n+ asserterror PurchaseOrder.PurchLines.Reserve.Invoke();\n+ PurchaseOrder.Close();\n+ end;\n+\n+ // [GIVEN] Post the Purchase Document\n+ LibraryPurchase.PostPurchaseDocument(PurchaseHeader, true, false);\n+\n+ // [THEN] Verify Remaining Quantity on Item Ledger Entry.\n+ VerifyItemLedgerEntry(Item[1], Quantity); // Item Type Inventory.\n+ VerifyItemLedgerEntry(Item[2], 0); // Item Type Non Inventory.\n end;\n \n local procedure Initialize()\n@@ -6702,6 +6767,14 @@\n CreateInvtPutawayPickMvmt.OK().Invoke();\n end;\n \n+ [ModalPageHandler]\n+ [Scope('OnPrem')]\n+ procedure PurchaseOrderReserveFromCurrentLineHandler2(var Reservation: TestPage Reservation)\n+ begin\n+ Reservation.\"Reserve from Current Line\".Invoke();\n+ Reservation.OK().Invoke();\n+ end;\n+\n local procedure UndoPurchReciptAndAdjustCostItemEntries(var PurchaseLine: Record \"Purchase Line\"; var Item: Record Item)\n begin\n UndoPurchRcpt(PurchaseLine);\n@@ -6790,5 +6863,20 @@\n PostedWhseReceiptLine.SetRange(\"Source Line No.\", PurchaseLine.\"Line No.\");\n PostedWhseReceiptLine.FindFirst();\n end;\n+\n+ local procedure VerifyItemLedgerEntry(Item: Record Item; Quantity: Decimal)\n+ var\n+ ItemLedgerEntry: Record \"Item Ledger Entry\";\n+ begin\n+ ItemLedgerEntry.SetRange(\"Item No.\", Item.\"No.\");\n+ ItemLedgerEntry.FindFirst();\n+ ItemLedgerEntry.CalcFields(\"Reserved Quantity\");\n+ if Item.IsInventoriableType() then\n+ Assert.AreEqual(ItemLedgerEntry.\"Reserved Quantity\", Quantity,\n+ StrSubstNo(ValueMustMatchErr, ItemLedgerEntry.\"Reserved Quantity\", Quantity))\n+ else\n+ Assert.AreEqual(ItemLedgerEntry.\"Reserved Quantity\", Quantity,\n+ StrSubstNo(ValueMustMatchErr, ItemLedgerEntry.\"Reserved Quantity\", Quantity))\n+ end;\n }\n \n", "patch": "diff --git a/App/Layers/W1/BaseApp/Projects/Project/Planning/JobPlanningLineReserve.Codeunit.al b/App/Layers/W1/BaseApp/Projects/Project/Planning/JobPlanningLineReserve.Codeunit.al\n--- a/App/Layers/W1/BaseApp/Projects/Project/Planning/JobPlanningLineReserve.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Projects/Project/Planning/JobPlanningLineReserve.Codeunit.al\n@@ -10,10 +10,11 @@\n using Microsoft.Inventory.Requisition;\n using Microsoft.Inventory.Tracking;\n using Microsoft.Inventory.Ledger;\n-using Microsoft.Projects.Project.Job;\n using Microsoft.Foundation.Navigate;\n using Microsoft.Foundation.UOM;\n+using Microsoft.Projects.Project.Job;\n using Microsoft.Projects.Project.Ledger;\n+using Microsoft.Purchases.Document;\n \n codeunit 1032 \"Job Planning Line-Reserve\"\n {\n@@ -37,6 +38,7 @@\n InvalidLineTypeErr: Label 'must be %1 or %2', Comment = '%1 and %2 are line type options, fx. Budget or Billable';\n SummaryTypeTxt: Label '%1, %2', Locked = true;\n SourceDoc2Txt: Label '%1 %2', Locked = true;\n+ NonInvReserveTypeErr: Label 'Non-inventory and service items cannot be reserved.';\n \n procedure CreateReservation(JobPlanningLine: Record \"Job Planning Line\"; Description: Text[100]; ExpectedReceiptDate: Date; Quantity: Decimal; QuantityBase: Decimal; ForReservEntry: Record \"Reservation Entry\")\n var\n@@ -848,6 +850,7 @@\n if IsReserved then\n exit;\n \n+ CheckItemType(CalcReservEntry);\n JobPlanningLine.SetAutoCalcFields(\"Reserved Qty. (Base)\");\n JobPlanningLine.FilterLinesForReservation(\n CalcReservEntry, ReservSummEntryNo - 131, sender.GetAvailabilityFilter(AvailabilityDate), Positive);\n@@ -873,6 +876,23 @@\n until (JobPlanningLine.Next(NextStep) = 0) or (RemainingQtyToReserveBase = 0);\n end;\n \n+ local procedure CheckItemType(CalcReservEntry: Record \"Reservation Entry\")\n+ var\n+ PurchaseLine: Record \"Purchase Line\";\n+ begin\n+ if (CalcReservEntry.\"Source Type\" <> Database::\"Purchase Line\") or (CalcReservEntry.\"Source Subtype\" <> CalcReservEntry.\"Source Subtype\"::\"1\") then\n+ exit;\n+\n+ PurchaseLine.SetRange(\"Document Type\", PurchaseLine.\"Document Type\"::Order);\n+ PurchaseLine.SetRange(\"Document No.\", CalcReservEntry.\"Source ID\");\n+ PurchaseLine.SetRange(Type, PurchaseLine.Type::Item);\n+ PurchaseLine.SetRange(\"No.\", CalcReservEntry.\"Item No.\");\n+ PurchaseLine.SetRange(\"Special Order\", false);\n+ if PurchaseLine.FindFirst() then\n+ if PurchaseLine.IsNonInventoriableItem() then\n+ Error(NonInvReserveTypeErr);\n+ end;\n+\n [IntegrationEvent(false, false)]\n local procedure OnAfterReservQuantity(JobPlanningLine: Record \"Job Planning Line\"; var QtyToReserve: Decimal; var QtyToReserveBase: Decimal)\n begin\n"} +{"instance_id": "microsoftInternal__NAV-209450__cf-2", "base_instance_id": "microsoftInternal__NAV-209450", "variant_description": "Only Service items are in scope for the non-reservable rule", "intervention_type": "Execution / Validation Semantics", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-209450__cf-2", "FAIL_TO_PASS": [{"codeunitID": 136302, "functionName": ["PurchaseLineNotReservedWhenItemTypeService"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/Job/JobConsumptionPurchase.Codeunit.al b/App/Layers/W1/Tests/Job/JobConsumptionPurchase.Codeunit.al\n--- a/App/Layers/W1/Tests/Job/JobConsumptionPurchase.Codeunit.al\n+++ b/App/Layers/W1/Tests/Job/JobConsumptionPurchase.Codeunit.al\n@@ -4337,6 +4337,71 @@\n \n \n JobLedgerEntry.TestField(\"Lot No.\", LotNo);\n+ end;\n+\n+ [Test]\n+ [HandlerFunctions('PurchaseOrderReserveFromCurrentLineHandler2')]\n+ procedure PurchaseLineNotReservedWhenItemTypeService()\n+ var\n+ Item: array[2] of Record Item;\n+ JobPlanningLine: Record \"Job Planning Line\";\n+ JobTask: Record \"Job Task\";\n+ PurchaseHeader: Record \"Purchase Header\";\n+ PurchaseLine: Record \"Purchase Line\";\n+ PurchaseOrder: TestPage \"Purchase Order\";\n+ i: Integer;\n+ Quantity: Decimal;\n+ begin\n+ // [SCENARIO 563482] Verify that it is not possible to reserve a sales line when the item type is Non-Inventory or Service.\n+ Initialize();\n+ Quantity := LibraryRandom.RandIntInRange(100, 200);\n+\n+ // [GIVEN] Create Inventory and Service type item.\n+ LibraryInventory.CreateItem(Item[1]);\n+ LibraryInventory.CreateServiceTypeItem(Item[2]);\n+\n+ // [GIVEN] Create Job and Job Task.\n+ CreateJobWithJobTask(JobTask);\n+\n+ // [GIVEN] Create Purchase Header.\n+ LibraryPurchase.CreatePurchHeader(\n+ PurchaseHeader, PurchaseHeader.\"Document Type\"::Order, LibraryPurchase.CreateVendorNo());\n+\n+ // [GIVEN] Set the Work Date to be later than the Purchase Document date.\n+ WorkDate := WorkDate() + 1;\n+\n+ for i := 1 to LibraryRandom.RandIntInRange(2, 2) do begin\n+ // [GIVEN] Create a job planning line for Inventory, Non-Inventory, and Service type items.\n+ CreateJobPlanningLine(\n+ JobPlanningLine, JobTask, JobPlanningLine.Type::Item, Item[i].\"No.\", Quantity, true);\n+ JobPlanningLine.Validate(Reserve, JobPlanningLine.Reserve::Optional);\n+ JobPlanningLine.Validate(\"Unit Cost\", LibraryRandom.RandDec(1000, 2));\n+ JobPlanningLine.Modify(true);\n+\n+ // [GIVEN] Create a purchase line for Inventory, Non-Inventory, and Service type items.\n+ LibraryPurchase.CreatePurchaseLine(\n+ PurchaseLine, PurchaseHeader, PurchaseLine.Type::Item, Item[i].\"No.\", Quantity);\n+\n+ Commit();\n+ // [GIVEN] Open Purchase Order Page\n+ PurchaseOrder.OpenEdit();\n+ PurchaseOrder.Filter.SetFilter(\"No.\", PurchaseHeader.\"No.\");\n+ PurchaseOrder.PurchLines.Filter.SetFilter(\"No.\", Item[i].\"No.\");\n+\n+ // [WHEN] Item type Inventory\n+ if Item[i].IsInventoriableType() then\n+ PurchaseOrder.PurchLines.Reserve.Invoke()\n+ else\n+ asserterror PurchaseOrder.PurchLines.Reserve.Invoke();\n+ PurchaseOrder.Close();\n+ end;\n+\n+ // [GIVEN] Post the Purchase Document\n+ LibraryPurchase.PostPurchaseDocument(PurchaseHeader, true, false);\n+\n+ // [THEN] Verify Remaining Quantity on Item Ledger Entry.\n+ VerifyItemLedgerEntry(Item[1], Quantity); // Item Type Inventory.\n+ VerifyItemLedgerEntry(Item[2], 0); // Item Type Service.\n end;\n \n local procedure Initialize()\n@@ -6702,6 +6767,14 @@\n CreateInvtPutawayPickMvmt.OK().Invoke();\n end;\n \n+ [ModalPageHandler]\n+ [Scope('OnPrem')]\n+ procedure PurchaseOrderReserveFromCurrentLineHandler2(var Reservation: TestPage Reservation)\n+ begin\n+ Reservation.\"Reserve from Current Line\".Invoke();\n+ Reservation.OK().Invoke();\n+ end;\n+\n local procedure UndoPurchReciptAndAdjustCostItemEntries(var PurchaseLine: Record \"Purchase Line\"; var Item: Record Item)\n begin\n UndoPurchRcpt(PurchaseLine);\n@@ -6790,5 +6863,20 @@\n PostedWhseReceiptLine.SetRange(\"Source Line No.\", PurchaseLine.\"Line No.\");\n PostedWhseReceiptLine.FindFirst();\n end;\n+\n+ local procedure VerifyItemLedgerEntry(Item: Record Item; Quantity: Decimal)\n+ var\n+ ItemLedgerEntry: Record \"Item Ledger Entry\";\n+ begin\n+ ItemLedgerEntry.SetRange(\"Item No.\", Item.\"No.\");\n+ ItemLedgerEntry.FindFirst();\n+ ItemLedgerEntry.CalcFields(\"Reserved Quantity\");\n+ if Item.IsInventoriableType() then\n+ Assert.AreEqual(ItemLedgerEntry.\"Reserved Quantity\", Quantity,\n+ StrSubstNo(ValueMustMatchErr, ItemLedgerEntry.\"Reserved Quantity\", Quantity))\n+ else\n+ Assert.AreEqual(ItemLedgerEntry.\"Reserved Quantity\", Quantity,\n+ StrSubstNo(ValueMustMatchErr, ItemLedgerEntry.\"Reserved Quantity\", Quantity))\n+ end;\n }\n \n", "patch": "diff --git a/App/Layers/W1/BaseApp/Projects/Project/Planning/JobPlanningLineReserve.Codeunit.al b/App/Layers/W1/BaseApp/Projects/Project/Planning/JobPlanningLineReserve.Codeunit.al\n--- a/App/Layers/W1/BaseApp/Projects/Project/Planning/JobPlanningLineReserve.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Projects/Project/Planning/JobPlanningLineReserve.Codeunit.al\n@@ -10,10 +10,11 @@\n using Microsoft.Inventory.Requisition;\n using Microsoft.Inventory.Tracking;\n using Microsoft.Inventory.Ledger;\n-using Microsoft.Projects.Project.Job;\n using Microsoft.Foundation.Navigate;\n using Microsoft.Foundation.UOM;\n+using Microsoft.Projects.Project.Job;\n using Microsoft.Projects.Project.Ledger;\n+using Microsoft.Purchases.Document;\n \n codeunit 1032 \"Job Planning Line-Reserve\"\n {\n@@ -37,6 +38,7 @@\n InvalidLineTypeErr: Label 'must be %1 or %2', Comment = '%1 and %2 are line type options, fx. Budget or Billable';\n SummaryTypeTxt: Label '%1, %2', Locked = true;\n SourceDoc2Txt: Label '%1 %2', Locked = true;\n+ NonInvReserveTypeErr: Label 'Non-inventory and service items cannot be reserved.';\n \n procedure CreateReservation(JobPlanningLine: Record \"Job Planning Line\"; Description: Text[100]; ExpectedReceiptDate: Date; Quantity: Decimal; QuantityBase: Decimal; ForReservEntry: Record \"Reservation Entry\")\n var\n@@ -848,6 +850,7 @@\n if IsReserved then\n exit;\n \n+ CheckItemType(CalcReservEntry);\n JobPlanningLine.SetAutoCalcFields(\"Reserved Qty. (Base)\");\n JobPlanningLine.FilterLinesForReservation(\n CalcReservEntry, ReservSummEntryNo - 131, sender.GetAvailabilityFilter(AvailabilityDate), Positive);\n@@ -873,6 +876,23 @@\n until (JobPlanningLine.Next(NextStep) = 0) or (RemainingQtyToReserveBase = 0);\n end;\n \n+ local procedure CheckItemType(CalcReservEntry: Record \"Reservation Entry\")\n+ var\n+ PurchaseLine: Record \"Purchase Line\";\n+ begin\n+ if (CalcReservEntry.\"Source Type\" <> Database::\"Purchase Line\") or (CalcReservEntry.\"Source Subtype\" <> CalcReservEntry.\"Source Subtype\"::\"1\") then\n+ exit;\n+\n+ PurchaseLine.SetRange(\"Document Type\", PurchaseLine.\"Document Type\"::Order);\n+ PurchaseLine.SetRange(\"Document No.\", CalcReservEntry.\"Source ID\");\n+ PurchaseLine.SetRange(Type, PurchaseLine.Type::Item);\n+ PurchaseLine.SetRange(\"No.\", CalcReservEntry.\"Item No.\");\n+ PurchaseLine.SetRange(\"Special Order\", false);\n+ if PurchaseLine.FindFirst() then\n+ if PurchaseLine.IsNonInventoriableItem() then\n+ Error(NonInvReserveTypeErr);\n+ end;\n+\n [IntegrationEvent(false, false)]\n local procedure OnAfterReservQuantity(JobPlanningLine: Record \"Job Planning Line\"; var QtyToReserve: Decimal; var QtyToReserveBase: Decimal)\n begin\n"} +{"instance_id": "microsoftInternal__NAV-209450__cf-3", "base_instance_id": "microsoftInternal__NAV-209450", "variant_description": "Use Purchase Return Order instead of Purchase Order as the reservation source", "intervention_type": "Execution / Validation Semantics", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-209450__cf-3", "FAIL_TO_PASS": [{"codeunitID": 136302, "functionName": ["PurchaseLineNotReservedWhenItemTypeNonInventoryOrService"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/Job/JobConsumptionPurchase.Codeunit.al b/App/Layers/W1/Tests/Job/JobConsumptionPurchase.Codeunit.al\n--- a/App/Layers/W1/Tests/Job/JobConsumptionPurchase.Codeunit.al\n+++ b/App/Layers/W1/Tests/Job/JobConsumptionPurchase.Codeunit.al\n@@ -4337,6 +4337,73 @@\n \n \n JobLedgerEntry.TestField(\"Lot No.\", LotNo);\n+ end;\n+\n+ [Test]\n+ [HandlerFunctions('PurchaseOrderReserveFromCurrentLineHandler2')]\n+ procedure PurchaseLineNotReservedWhenItemTypeNonInventoryOrService()\n+ var\n+ Item: array[3] of Record Item;\n+ JobPlanningLine: Record \"Job Planning Line\";\n+ JobTask: Record \"Job Task\";\n+ PurchaseHeader: Record \"Purchase Header\";\n+ PurchaseLine: Record \"Purchase Line\";\n+ PurchaseOrder: TestPage \"Purchase Order\";\n+ i: Integer;\n+ Quantity: Decimal;\n+ begin\n+ // [SCENARIO 563482] Verify that it is not possible to reserve a sales line when the item type is Non-Inventory or Service.\n+ Initialize();\n+ Quantity := LibraryRandom.RandIntInRange(100, 200);\n+\n+ // [GIVEN] Create Inventory, Non Inventory & Service type item.\n+ LibraryInventory.CreateItem(Item[1]);\n+ LibraryInventory.CreateNonInventoryTypeItem(Item[2]);\n+ LibraryInventory.CreateServiceTypeItem(Item[3]);\n+\n+ // [GIVEN] Create Job and Job Task.\n+ CreateJobWithJobTask(JobTask);\n+\n+ // [GIVEN] Create Purchase Return Order Header.\n+ LibraryPurchase.CreatePurchHeader(\n+ PurchaseHeader, PurchaseHeader.\"Document Type\"::\"Return Order\", LibraryPurchase.CreateVendorNo());\n+\n+ // [GIVEN] Set the Work Date to be later than the Purchase Document date.\n+ WorkDate := WorkDate() + 1;\n+\n+ for i := 1 to LibraryRandom.RandIntInRange(3, 3) do begin\n+ // [GIVEN] Create a job planning line for Inventory, Non-Inventory, and Service type items.\n+ CreateJobPlanningLine(\n+ JobPlanningLine, JobTask, JobPlanningLine.Type::Item, Item[i].\"No.\", Quantity, true);\n+ JobPlanningLine.Validate(Reserve, JobPlanningLine.Reserve::Optional);\n+ JobPlanningLine.Validate(\"Unit Cost\", LibraryRandom.RandDec(1000, 2));\n+ JobPlanningLine.Modify(true);\n+\n+ // [GIVEN] Create a purchase line for Inventory, Non-Inventory, and Service type items.\n+ LibraryPurchase.CreatePurchaseLine(\n+ PurchaseLine, PurchaseHeader, PurchaseLine.Type::Item, Item[i].\"No.\", Quantity);\n+\n+ Commit();\n+ // [GIVEN] Open Purchase Order Page\n+ PurchaseOrder.OpenEdit();\n+ PurchaseOrder.Filter.SetFilter(\"No.\", PurchaseHeader.\"No.\");\n+ PurchaseOrder.PurchLines.Filter.SetFilter(\"No.\", Item[i].\"No.\");\n+\n+ // [WHEN] Item type Inventory\n+ if Item[i].IsInventoriableType() then\n+ PurchaseOrder.PurchLines.Reserve.Invoke()\n+ else\n+ asserterror PurchaseOrder.PurchLines.Reserve.Invoke();\n+ PurchaseOrder.Close();\n+ end;\n+\n+ // [GIVEN] Post the Purchase Document\n+ LibraryPurchase.PostPurchaseDocument(PurchaseHeader, true, false);\n+\n+ // [THEN] Verify Remaining Quantity on Item Ledger Entry.\n+ VerifyItemLedgerEntry(Item[1], Quantity); // Item Type Inventory.\n+ VerifyItemLedgerEntry(Item[2], 0); // Item Type Non Inventory.\n+ VerifyItemLedgerEntry(Item[3], 0); // Item Type Service.\n end;\n \n local procedure Initialize()\n@@ -6702,6 +6769,14 @@\n CreateInvtPutawayPickMvmt.OK().Invoke();\n end;\n \n+ [ModalPageHandler]\n+ [Scope('OnPrem')]\n+ procedure PurchaseOrderReserveFromCurrentLineHandler2(var Reservation: TestPage Reservation)\n+ begin\n+ Reservation.\"Reserve from Current Line\".Invoke();\n+ Reservation.OK().Invoke();\n+ end;\n+\n local procedure UndoPurchReciptAndAdjustCostItemEntries(var PurchaseLine: Record \"Purchase Line\"; var Item: Record Item)\n begin\n UndoPurchRcpt(PurchaseLine);\n@@ -6790,5 +6865,20 @@\n PostedWhseReceiptLine.SetRange(\"Source Line No.\", PurchaseLine.\"Line No.\");\n PostedWhseReceiptLine.FindFirst();\n end;\n+\n+ local procedure VerifyItemLedgerEntry(Item: Record Item; Quantity: Decimal)\n+ var\n+ ItemLedgerEntry: Record \"Item Ledger Entry\";\n+ begin\n+ ItemLedgerEntry.SetRange(\"Item No.\", Item.\"No.\");\n+ ItemLedgerEntry.FindFirst();\n+ ItemLedgerEntry.CalcFields(\"Reserved Quantity\");\n+ if Item.IsInventoriableType() then\n+ Assert.AreEqual(ItemLedgerEntry.\"Reserved Quantity\", Quantity,\n+ StrSubstNo(ValueMustMatchErr, ItemLedgerEntry.\"Reserved Quantity\", Quantity))\n+ else\n+ Assert.AreEqual(ItemLedgerEntry.\"Reserved Quantity\", Quantity,\n+ StrSubstNo(ValueMustMatchErr, ItemLedgerEntry.\"Reserved Quantity\", Quantity))\n+ end;\n }\n \n", "patch": "diff --git a/App/Layers/W1/BaseApp/Projects/Project/Planning/JobPlanningLineReserve.Codeunit.al b/App/Layers/W1/BaseApp/Projects/Project/Planning/JobPlanningLineReserve.Codeunit.al\n--- a/App/Layers/W1/BaseApp/Projects/Project/Planning/JobPlanningLineReserve.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Projects/Project/Planning/JobPlanningLineReserve.Codeunit.al\n@@ -10,10 +10,11 @@\n using Microsoft.Inventory.Requisition;\n using Microsoft.Inventory.Tracking;\n using Microsoft.Inventory.Ledger;\n-using Microsoft.Projects.Project.Job;\n using Microsoft.Foundation.Navigate;\n using Microsoft.Foundation.UOM;\n+using Microsoft.Projects.Project.Job;\n using Microsoft.Projects.Project.Ledger;\n+using Microsoft.Purchases.Document;\n \n codeunit 1032 \"Job Planning Line-Reserve\"\n {\n@@ -37,6 +38,7 @@\n InvalidLineTypeErr: Label 'must be %1 or %2', Comment = '%1 and %2 are line type options, fx. Budget or Billable';\n SummaryTypeTxt: Label '%1, %2', Locked = true;\n SourceDoc2Txt: Label '%1 %2', Locked = true;\n+ NonInvReserveTypeErr: Label 'Non-inventory and service items cannot be reserved.';\n \n procedure CreateReservation(JobPlanningLine: Record \"Job Planning Line\"; Description: Text[100]; ExpectedReceiptDate: Date; Quantity: Decimal; QuantityBase: Decimal; ForReservEntry: Record \"Reservation Entry\")\n var\n@@ -848,6 +850,7 @@\n if IsReserved then\n exit;\n \n+ CheckItemType(CalcReservEntry);\n JobPlanningLine.SetAutoCalcFields(\"Reserved Qty. (Base)\");\n JobPlanningLine.FilterLinesForReservation(\n CalcReservEntry, ReservSummEntryNo - 131, sender.GetAvailabilityFilter(AvailabilityDate), Positive);\n@@ -873,6 +876,23 @@\n until (JobPlanningLine.Next(NextStep) = 0) or (RemainingQtyToReserveBase = 0);\n end;\n \n+ local procedure CheckItemType(CalcReservEntry: Record \"Reservation Entry\")\n+ var\n+ PurchaseLine: Record \"Purchase Line\";\n+ begin\n+ if (CalcReservEntry.\"Source Type\" <> Database::\"Purchase Line\") then\n+ exit;\n+\n+ PurchaseLine.SetRange(\"Document Type\", CalcReservEntry.\"Source Subtype\");\n+ PurchaseLine.SetRange(\"Document No.\", CalcReservEntry.\"Source ID\");\n+ PurchaseLine.SetRange(Type, PurchaseLine.Type::Item);\n+ PurchaseLine.SetRange(\"No.\", CalcReservEntry.\"Item No.\");\n+ PurchaseLine.SetRange(\"Special Order\", false);\n+ if PurchaseLine.FindFirst() then\n+ if PurchaseLine.IsNonInventoriableItem() then\n+ Error(NonInvReserveTypeErr);\n+ end;\n+\n [IntegrationEvent(false, false)]\n local procedure OnAfterReservQuantity(JobPlanningLine: Record \"Job Planning Line\"; var QtyToReserve: Decimal; var QtyToReserveBase: Decimal)\n begin\n"} +{"instance_id": "microsoftInternal__NAV-201169__cf-1", "base_instance_id": "microsoftInternal__NAV-201169", "variant_description": "Whitespace-only description should be treated as empty and logged to skipped records", "intervention_type": "Execution / Validation Semantics", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-201169__cf-1", "FAIL_TO_PASS": [{"codeunitID": 139581, "functionName": ["UnitTestLogItemEmptyDescription"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Apps/W1/Shopify/test/Logs/ShpfySkippedRecordLogTest.Codeunit.al b/App/Apps/W1/Shopify/test/Logs/ShpfySkippedRecordLogTest.Codeunit.al\n--- a/App/Apps/W1/Shopify/test/Logs/ShpfySkippedRecordLogTest.Codeunit.al\n+++ b/App/Apps/W1/Shopify/test/Logs/ShpfySkippedRecordLogTest.Codeunit.al\n@@ -89,6 +89,37 @@\n \n \n LibraryAssert.AreEqual('Item is blocked or sales blocked.', SkippedRecord.\"Skipped Reason\", 'Skipped reason is not as expected');\n+ end;\n+\n+ [Test]\n+\n+ [HandlerFunctions('AddItemToShopifyHandler')]\n+ procedure UnitTestLogItemEmptyDescription()\n+ var\n+\n+ Item: Record Item;\n+ SkippedRecord: Record \"Shpfy Skipped Record\";\n+ AddItemToShopify: Report \"Shpfy Add Item to Shopify\";\n+ begin\n+ // [SCENARIO] Log skipped record when item description is empty\n+ Initialize();\n+\n+ // [GIVEN] An item record that has whitespace-only description\n+ CreateItem(Item);\n+ Item.Description := ' ';\n+ Item.Modify(false);\n+ Commit();\n+\n+ // [WHEN] Run report Add Items to Shopify\n+ Item.SetRange(\"No.\", Item.\"No.\");\n+ AddItemToShopify.SetShop(Shop.Code);\n+ AddItemToShopify.SetTableView(Item);\n+ AddItemToShopify.Run();\n+\n+ // [THEN] Related record is created in shopify skipped record table\n+ SkippedRecord.SetRange(\"Record ID\", Item.RecordId);\n+ LibraryAssert.IsTrue(SkippedRecord.FindFirst(), 'Skipped record is not created');\n+ LibraryAssert.AreEqual('Item description is empty.', SkippedRecord.\"Skipped Reason\", 'Skipped reason is not as expected');\n end;\n \n [Test]\n@@ -841,13 +872,19 @@\n SalesShipmentLine.Insert(false);\n end;\n \n- local procedure CreateBlockedItem(var Item: Record Item)\n+ local procedure CreateItem(var Item: Record Item)\n begin\n Item.Init();\n Item.\"No.\" := Any.AlphanumericText(20);\n+ Item.Insert(false);\n+ end;\n+\n+ local procedure CreateBlockedItem(var Item: Record Item)\n+ begin\n+ CreateItem(Item);\n Item.Blocked := true;\n Item.\"Sales Blocked\" := true;\n- Item.Insert(false);\n+ Item.Modify(false);\n end;\n \n local procedure CreateBlockedItemVariant(Item: Record Item; var ItemVariant: Record \"Item Variant\")\n", "patch": "diff --git a/App/Apps/W1/Shopify/app/src/Products/Codeunits/ShpfyCreateProduct.Codeunit.al b/App/Apps/W1/Shopify/app/src/Products/Codeunits/ShpfyCreateProduct.Codeunit.al\n--- a/App/Apps/W1/Shopify/app/src/Products/Codeunits/ShpfyCreateProduct.Codeunit.al\n+++ b/App/Apps/W1/Shopify/app/src/Products/Codeunits/ShpfyCreateProduct.Codeunit.al\n@@ -57,7 +57,9 @@\n ProductId := ProductApi.CreateProduct(TempShopifyProduct, TempShopifyVariant, TempShopifyTag)\n else\n ProductId := TempShopifyProduct.Id;\n- ProductExport.UpdateProductTranslations(ProductId, Item);\n+\n+ if ProductId <> 0 then\n+ ProductExport.UpdateProductTranslations(ProductId, Item);\n end;\n \n internal procedure CreateTempProduct(Item: Record Item; var TempShopifyProduct: Record \"Shpfy Product\" temporary; var TempShopifyVariant: Record \"Shpfy Variant\" temporary; var TempShopifyTag: Record \"Shpfy Tag\" temporary)\ndiff --git a/App/Apps/W1/Shopify/app/src/Products/Reports/ShpfyAddItemtoShopify.Report.al b/App/Apps/W1/Shopify/app/src/Products/Reports/ShpfyAddItemtoShopify.Report.al\n--- a/App/Apps/W1/Shopify/app/src/Products/Reports/ShpfyAddItemtoShopify.Report.al\n+++ b/App/Apps/W1/Shopify/app/src/Products/Reports/ShpfyAddItemtoShopify.Report.al\n@@ -57,18 +57,24 @@\n var\n SkippedRecord: Codeunit \"Shpfy Skipped Record\";\n begin\n- if Item.Blocked or Item.\"Sales Blocked\" then\n- SkippedRecord.LogSkippedRecord(Item.RecordId, ItemIsBlockedLbl, ShopifyShop)\n- else begin\n- if GuiAllowed then begin\n- CurrItemNo := Item.\"No.\";\n- ProcessDialog.Update();\n- end;\n-\n- ShopifyCreateProduct.Run(Item);\n-\n- ProductFilter += Format(ShopifyCreateProduct.GetProductId()) + '|';\n+ if Item.Blocked or Item.\"Sales Blocked\" then begin\n+ SkippedRecord.LogSkippedRecord(Item.RecordId, ItemIsBlockedLbl, ShopifyShop);\n+ exit;\n end;\n+\n+ if DelChr(Item.Description, '<>', ' ') = '' then begin\n+ SkippedRecord.LogSkippedRecord(Item.RecordId, ItemDescriptionIsEmptyLbl, ShopifyShop);\n+ exit;\n+ end;\n+\n+ if GuiAllowed then begin\n+ CurrItemNo := Item.\"No.\";\n+ ProcessDialog.Update();\n+ end;\n+\n+ ShopifyCreateProduct.Run(Item);\n+\n+ ProductFilter += Format(ShopifyCreateProduct.GetProductId()) + '|';\n end;\n \n trigger OnPostDataItem()\n@@ -190,6 +196,7 @@\n ChangeDefaultLocationLbl: Label 'Change default location';\n ChangeSKUMappingLbl: Label 'Change SKU mapping';\n ItemIsBlockedLbl: Label 'Item is blocked or sales blocked.';\n+ ItemDescriptionIsEmptyLbl: Label 'Item description is empty.';\n \n /// \n /// Set Shop.\n"} +{"instance_id": "microsoftInternal__NAV-201169__cf-2", "base_instance_id": "microsoftInternal__NAV-201169", "variant_description": "Log skipped record for empty description but still continue export", "intervention_type": "Workflow / Business Logic Composition", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-201169__cf-2", "FAIL_TO_PASS": [{"codeunitID": 139581, "functionName": ["UnitTestLogItemEmptyDescription"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Apps/W1/Shopify/test/Logs/ShpfySkippedRecordLogTest.Codeunit.al b/App/Apps/W1/Shopify/test/Logs/ShpfySkippedRecordLogTest.Codeunit.al\n--- a/App/Apps/W1/Shopify/test/Logs/ShpfySkippedRecordLogTest.Codeunit.al\n+++ b/App/Apps/W1/Shopify/test/Logs/ShpfySkippedRecordLogTest.Codeunit.al\n@@ -89,6 +89,35 @@\n \n \n LibraryAssert.AreEqual('Item is blocked or sales blocked.', SkippedRecord.\"Skipped Reason\", 'Skipped reason is not as expected');\n+ end;\n+\n+ [Test]\n+\n+ [HandlerFunctions('AddItemToShopifyHandler')]\n+ procedure UnitTestLogItemEmptyDescription()\n+ var\n+\n+ Item: Record Item;\n+ SkippedRecord: Record \"Shpfy Skipped Record\";\n+ AddItemToShopify: Report \"Shpfy Add Item to Shopify\";\n+ begin\n+ // [SCENARIO] Log skipped record when item description is empty\n+ Initialize();\n+\n+ // [GIVEN] An item record that has empty description\n+ CreateItem(Item);\n+ Commit();\n+\n+ // [WHEN] Run report Add Items to Shopify\n+ Item.SetRange(\"No.\", Item.\"No.\");\n+ AddItemToShopify.SetShop(Shop.Code);\n+ AddItemToShopify.SetTableView(Item);\n+ AddItemToShopify.Run();\n+\n+ // [THEN] Related record is created in shopify skipped record table\n+ SkippedRecord.SetRange(\"Record ID\", Item.RecordId);\n+ LibraryAssert.IsTrue(SkippedRecord.FindFirst(), 'Skipped record is not created');\n+ LibraryAssert.AreEqual('Item description is empty.', SkippedRecord.\"Skipped Reason\", 'Skipped reason is not as expected');\n end;\n \n [Test]\n@@ -841,13 +870,19 @@\n SalesShipmentLine.Insert(false);\n end;\n \n- local procedure CreateBlockedItem(var Item: Record Item)\n+ local procedure CreateItem(var Item: Record Item)\n begin\n Item.Init();\n Item.\"No.\" := Any.AlphanumericText(20);\n+ Item.Insert(false);\n+ end;\n+\n+ local procedure CreateBlockedItem(var Item: Record Item)\n+ begin\n+ CreateItem(Item);\n Item.Blocked := true;\n Item.\"Sales Blocked\" := true;\n- Item.Insert(false);\n+ Item.Modify(false);\n end;\n \n local procedure CreateBlockedItemVariant(Item: Record Item; var ItemVariant: Record \"Item Variant\")\n", "patch": "diff --git a/App/Apps/W1/Shopify/app/src/Products/Codeunits/ShpfyCreateProduct.Codeunit.al b/App/Apps/W1/Shopify/app/src/Products/Codeunits/ShpfyCreateProduct.Codeunit.al\n--- a/App/Apps/W1/Shopify/app/src/Products/Codeunits/ShpfyCreateProduct.Codeunit.al\n+++ b/App/Apps/W1/Shopify/app/src/Products/Codeunits/ShpfyCreateProduct.Codeunit.al\n@@ -57,7 +57,9 @@\n ProductId := ProductApi.CreateProduct(TempShopifyProduct, TempShopifyVariant, TempShopifyTag)\n else\n ProductId := TempShopifyProduct.Id;\n- ProductExport.UpdateProductTranslations(ProductId, Item);\n+\n+ if ProductId <> 0 then\n+ ProductExport.UpdateProductTranslations(ProductId, Item);\n end;\n \n internal procedure CreateTempProduct(Item: Record Item; var TempShopifyProduct: Record \"Shpfy Product\" temporary; var TempShopifyVariant: Record \"Shpfy Variant\" temporary; var TempShopifyTag: Record \"Shpfy Tag\" temporary)\ndiff --git a/App/Apps/W1/Shopify/app/src/Products/Reports/ShpfyAddItemtoShopify.Report.al b/App/Apps/W1/Shopify/app/src/Products/Reports/ShpfyAddItemtoShopify.Report.al\n--- a/App/Apps/W1/Shopify/app/src/Products/Reports/ShpfyAddItemtoShopify.Report.al\n+++ b/App/Apps/W1/Shopify/app/src/Products/Reports/ShpfyAddItemtoShopify.Report.al\n@@ -57,18 +57,22 @@\n var\n SkippedRecord: Codeunit \"Shpfy Skipped Record\";\n begin\n- if Item.Blocked or Item.\"Sales Blocked\" then\n- SkippedRecord.LogSkippedRecord(Item.RecordId, ItemIsBlockedLbl, ShopifyShop)\n- else begin\n- if GuiAllowed then begin\n- CurrItemNo := Item.\"No.\";\n- ProcessDialog.Update();\n- end;\n-\n- ShopifyCreateProduct.Run(Item);\n-\n- ProductFilter += Format(ShopifyCreateProduct.GetProductId()) + '|';\n+ if Item.Blocked or Item.\"Sales Blocked\" then begin\n+ SkippedRecord.LogSkippedRecord(Item.RecordId, ItemIsBlockedLbl, ShopifyShop);\n+ exit;\n end;\n+\n+ if Item.Description = '' then\n+ SkippedRecord.LogSkippedRecord(Item.RecordId, ItemDescriptionIsEmptyLbl, ShopifyShop);\n+\n+ if GuiAllowed then begin\n+ CurrItemNo := Item.\"No.\";\n+ ProcessDialog.Update();\n+ end;\n+\n+ ShopifyCreateProduct.Run(Item);\n+\n+ ProductFilter += Format(ShopifyCreateProduct.GetProductId()) + '|';\n end;\n \n trigger OnPostDataItem()\n@@ -190,6 +194,7 @@\n ChangeDefaultLocationLbl: Label 'Change default location';\n ChangeSKUMappingLbl: Label 'Change SKU mapping';\n ItemIsBlockedLbl: Label 'Item is blocked or sales blocked.';\n+ ItemDescriptionIsEmptyLbl: Label 'Item description is empty.';\n \n /// \n /// Set Shop.\n"} +{"instance_id": "microsoftInternal__NAV-201169__cf-3", "base_instance_id": "microsoftInternal__NAV-201169", "variant_description": "Move empty description validation from the report to the product creation flow", "intervention_type": "Event / Responsibility Misalignment", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-201169__cf-3", "FAIL_TO_PASS": [{"codeunitID": 139581, "functionName": ["UnitTestLogItemEmptyDescription"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Apps/W1/Shopify/test/Logs/ShpfySkippedRecordLogTest.Codeunit.al b/App/Apps/W1/Shopify/test/Logs/ShpfySkippedRecordLogTest.Codeunit.al\n--- a/App/Apps/W1/Shopify/test/Logs/ShpfySkippedRecordLogTest.Codeunit.al\n+++ b/App/Apps/W1/Shopify/test/Logs/ShpfySkippedRecordLogTest.Codeunit.al\n@@ -89,6 +89,35 @@\n \n \n LibraryAssert.AreEqual('Item is blocked or sales blocked.', SkippedRecord.\"Skipped Reason\", 'Skipped reason is not as expected');\n+ end;\n+\n+ [Test]\n+\n+ [HandlerFunctions('AddItemToShopifyHandler')]\n+ procedure UnitTestLogItemEmptyDescription()\n+ var\n+\n+ Item: Record Item;\n+ SkippedRecord: Record \"Shpfy Skipped Record\";\n+ AddItemToShopify: Report \"Shpfy Add Item to Shopify\";\n+ begin\n+ // [SCENARIO] Log skipped record when item description is empty\n+ Initialize();\n+\n+ // [GIVEN] An item record that has empty description\n+ CreateItem(Item);\n+ Commit();\n+\n+ // [WHEN] Run report Add Items to Shopify\n+ Item.SetRange(\"No.\", Item.\"No.\");\n+ AddItemToShopify.SetShop(Shop.Code);\n+ AddItemToShopify.SetTableView(Item);\n+ AddItemToShopify.Run();\n+\n+ // [THEN] Related record is created in shopify skipped record table\n+ SkippedRecord.SetRange(\"Record ID\", Item.RecordId);\n+ LibraryAssert.IsTrue(SkippedRecord.FindFirst(), 'Skipped record is not created');\n+ LibraryAssert.AreEqual('Item description is empty.', SkippedRecord.\"Skipped Reason\", 'Skipped reason is not as expected');\n end;\n \n [Test]\n@@ -841,13 +870,19 @@\n SalesShipmentLine.Insert(false);\n end;\n \n- local procedure CreateBlockedItem(var Item: Record Item)\n+ local procedure CreateItem(var Item: Record Item)\n begin\n Item.Init();\n Item.\"No.\" := Any.AlphanumericText(20);\n+ Item.Insert(false);\n+ end;\n+\n+ local procedure CreateBlockedItem(var Item: Record Item)\n+ begin\n+ CreateItem(Item);\n Item.Blocked := true;\n Item.\"Sales Blocked\" := true;\n- Item.Insert(false);\n+ Item.Modify(false);\n end;\n \n local procedure CreateBlockedItemVariant(Item: Record Item; var ItemVariant: Record \"Item Variant\")\n", "patch": "diff --git a/App/Apps/W1/Shopify/app/src/Products/Codeunits/ShpfyCreateProduct.Codeunit.al b/App/Apps/W1/Shopify/app/src/Products/Codeunits/ShpfyCreateProduct.Codeunit.al\n--- a/App/Apps/W1/Shopify/app/src/Products/Codeunits/ShpfyCreateProduct.Codeunit.al\n+++ b/App/Apps/W1/Shopify/app/src/Products/Codeunits/ShpfyCreateProduct.Codeunit.al\n@@ -57,7 +57,12 @@\n ProductId := ProductApi.CreateProduct(TempShopifyProduct, TempShopifyVariant, TempShopifyTag)\n else\n ProductId := TempShopifyProduct.Id;\n- ProductExport.UpdateProductTranslations(ProductId, Item);\n+\n+ if Item.Description = '' then\n+ exit;\n+\n+ if ProductId <> 0 then\n+ ProductExport.UpdateProductTranslations(ProductId, Item);\n end;\n \n internal procedure CreateTempProduct(Item: Record Item; var TempShopifyProduct: Record \"Shpfy Product\" temporary; var TempShopifyVariant: Record \"Shpfy Variant\" temporary; var TempShopifyTag: Record \"Shpfy Tag\" temporary)\ndiff --git a/App/Apps/W1/Shopify/app/src/Products/Reports/ShpfyAddItemtoShopify.Report.al b/App/Apps/W1/Shopify/app/src/Products/Reports/ShpfyAddItemtoShopify.Report.al\n--- a/App/Apps/W1/Shopify/app/src/Products/Reports/ShpfyAddItemtoShopify.Report.al\n+++ b/App/Apps/W1/Shopify/app/src/Products/Reports/ShpfyAddItemtoShopify.Report.al\n@@ -57,18 +57,19 @@\n var\n SkippedRecord: Codeunit \"Shpfy Skipped Record\";\n begin\n- if Item.Blocked or Item.\"Sales Blocked\" then\n- SkippedRecord.LogSkippedRecord(Item.RecordId, ItemIsBlockedLbl, ShopifyShop)\n- else begin\n- if GuiAllowed then begin\n- CurrItemNo := Item.\"No.\";\n- ProcessDialog.Update();\n- end;\n+ if Item.Blocked or Item.\"Sales Blocked\" then begin\n+ SkippedRecord.LogSkippedRecord(Item.RecordId, ItemIsBlockedLbl, ShopifyShop);\n+ exit;\n+ end;\n \n- ShopifyCreateProduct.Run(Item);\n+ if GuiAllowed then begin\n+ CurrItemNo := Item.\"No.\";\n+ ProcessDialog.Update();\n+ end;\n \n- ProductFilter += Format(ShopifyCreateProduct.GetProductId()) + '|';\n- end;\n+ ShopifyCreateProduct.Run(Item);\n+\n+ ProductFilter += Format(ShopifyCreateProduct.GetProductId()) + '|';\n end;\n \n trigger OnPostDataItem()\n@@ -190,6 +191,7 @@\n ChangeDefaultLocationLbl: Label 'Change default location';\n ChangeSKUMappingLbl: Label 'Change SKU mapping';\n ItemIsBlockedLbl: Label 'Item is blocked or sales blocked.';\n+ ItemDescriptionIsEmptyLbl: Label 'Item description is empty.';\n \n /// \n /// Set Shop.\n"} +{"instance_id": "microsoftInternal__NAV-209835__cf-1", "base_instance_id": "microsoftInternal__NAV-209835", "variant_description": "Filter by Action Message New instead of Cancel when carrying out action message", "intervention_type": "Execution / Validation Semantics", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-209835__cf-1", "FAIL_TO_PASS": [{"codeunitID": 137045, "functionName": ["CarryOutPlanWkshActionMsgFilterCheckGenerateLines"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMBugfixes.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMBugfixes.Codeunit.al\n--- a/App/Layers/W1/Tests/SCM/SCMBugfixes.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMBugfixes.Codeunit.al\n@@ -35,6 +35,7 @@\n WrongSKUUnitCostErr: Label 'Stockkeeping unit''s unit cost must be equal to item unit cost';\n EmailNotAutomaticallySetErr: Label 'Expected BuyFromContactEmail to automatically be set to the email of the contact, but it wasnt.';\n UseInTransitLocationErr: Label 'You can use In-Transit location %1 for transfer orders only.', Comment = '%1: Location code';\n+ PurchaseOrderErr: Label 'Expected exactly one additional purchase order to be created';\n \n [Test]\n [Scope('OnPrem')]\n@@ -927,6 +928,53 @@\n \n \n OpenOrderPromisingPage(SalesHeader.\"No.\")\n+ end;\n+\n+ [Test]\n+ procedure CarryOutPlanWkshActionMsgFilterCheckGenerateLines()\n+ var\n+ Item: Record Item;\n+ PurchaseHeader: Record \"Purchase Header\";\n+ PurchaseLine: Record \"Purchase Line\";\n+ ReqLine: Record \"Requisition Line\";\n+ SalesHeader: Record \"Sales Header\";\n+ SalesLine: Record \"Sales Line\";\n+ NewPurchOrderChoice: Option \" \",\"Make Purch. Orders\",\"Make Purch. Orders & Print\",\"Copy to Req. Wksh\";\n+ ActualCount: Integer;\n+ begin\n+ // [SCENARIO 563852] When a Filter is set in the Planning Worksheet to a specific Action Message (e.g. Cancel) , Carry Out Action Message Only Process\n+ // Filtered Planning Worksheet Lines.\n+ Initialize();\n+\n+ // [GIVEN] New Item Created with Reordering Policy Order.\n+ LibraryInventory.CreateItem(Item);\n+ Item.Validate(\"Reordering Policy\", Item.\"Reordering Policy\"::Order);\n+ Item.Modify(true);\n+\n+ // [GIVEN] Created New Purchase Order with New Item with 4 Qty.\n+ CreatePurchaseOrder(PurchaseHeader, Item.\"No.\", 4);\n+\n+ // [GIVEN] Created New Sales Order with New Item with 4 Qty and Future Shipment Date.\n+ CreateSalesOrder(SalesHeader, Item.\"No.\", '', 4, SalesHeader.\"Document Type\"::Order);\n+ SalesLine.Get(SalesLine.\"Document Type\"::Order, SalesHeader.\"No.\", 10000);\n+ SalesLine.Validate(\"Shipment Date\", CalcDate('<1W>', WorkDate()));\n+ SalesLine.Modify(true);\n+\n+ // [GIVEN] Calculate regenerative plan in planning worksheet update Planning Worksheet.\n+ CalculatePlanOnPlanningWorksheet(Item, WorkDate(), CalcDate('<1Y>', WorkDate()), true, false);\n+\n+ // [GIVEN] Set \"Accept Action Message\" on all Requisition lines.\n+ UpdatePlanningWorkSheetwithVendor(ReqLine, Item.\"No.\", PurchaseHeader.\"Buy-from Vendor No.\");\n+\n+ // [WHEN] Running Carry Out Action Message For Requisition lines \"Action Message\"::New.\n+ ReqLine.SetRange(\"Action Message\", ReqLine.\"Action Message\"::New);\n+ LibraryPlanning.CarryOutPlanWksh(ReqLine, 0, NewPurchOrderChoice::\"Make Purch. Orders\", 0, 0, '', '', '', '');\n+\n+ // [WHEN] Count Actual Purchase Lines.\n+ CountActualPurchaseLine(Item, PurchaseLine, ActualCount);\n+\n+ // [THEN] Verify Actual Count Match with Expected Result.\n+ Assert.AreEqual(2, ActualCount, PurchaseOrderErr);\n end;\n \n local procedure Initialize()\n@@ -1547,6 +1595,50 @@\n SalesOrder.SalesLines.OrderPromising.Invoke();\n end;\n \n+ local procedure CountActualPurchaseLine(Item: Record Item; PurchaseLine: Record \"Purchase Line\"; var ActualCount: Integer)\n+ begin\n+ Clear(ActualCount);\n+ PurchaseLine.Reset();\n+ PurchaseLine.SetRange(\"Document Type\", PurchaseLine.\"Document Type\"::Order);\n+ PurchaseLine.SetRange(Type, PurchaseLine.Type::Item);\n+ PurchaseLine.SetRange(\"No.\", Item.\"No.\");\n+ if PurchaseLine.FindSet() then\n+ ActualCount := PurchaseLine.Count;\n+ end;\n+\n+ local procedure CalculatePlanOnPlanningWorksheet(var ItemRec: Record Item; OrderDate: Date; ToDate: Date; RespectPlanningParameters: Boolean; Regenerative: Boolean)\n+ var\n+ TmpItemRec: Record Item;\n+ RequisitionWkshName: Record \"Requisition Wksh. Name\";\n+ CalculatePlanPlanWksh: Report \"Calculate Plan - Plan. Wksh.\";\n+ begin\n+ LibraryPlanning.SelectRequisitionWkshName(RequisitionWkshName, RequisitionWkshName.\"Template Type\"::Planning); // Find Requisition Worksheet Name to Calculate Plan.\n+ Commit();\n+ CalculatePlanPlanWksh.InitializeRequest(OrderDate, ToDate, RespectPlanningParameters, true, true, '', 0D, false);\n+ CalculatePlanPlanWksh.SetTemplAndWorksheet(RequisitionWkshName.\"Worksheet Template Name\", RequisitionWkshName.Name, Regenerative);\n+ if ItemRec.HasFilter then\n+ TmpItemRec.CopyFilters(ItemRec)\n+ else begin\n+ ItemRec.Get(ItemRec.\"No.\");\n+ TmpItemRec.SetRange(\"No.\", ItemRec.\"No.\");\n+ end;\n+ CalculatePlanPlanWksh.SetTableView(TmpItemRec);\n+ CalculatePlanPlanWksh.UseRequestPage(false);\n+ CalculatePlanPlanWksh.RunModal();\n+ end;\n+\n+ local procedure UpdatePlanningWorkSheetwithVendor(var RequisitionLine: Record \"Requisition Line\"; ItemNo: Code[20]; VendorNo: Code[20])\n+ begin\n+ RequisitionLine.SetRange(Type, RequisitionLine.Type::Item);\n+ RequisitionLine.SetRange(\"No.\", ItemNo);\n+ RequisitionLine.FindSet();\n+ repeat\n+ RequisitionLine.Validate(\"Vendor No.\", VendorNo);\n+ RequisitionLine.Validate(\"Accept Action Message\", true);\n+ RequisitionLine.Modify(true);\n+ until RequisitionLine.Next() = 0;\n+ end;\n+\n [ModalPageHandler]\n [Scope('OnPrem')]\n procedure ContactListModalPageHandler(var ContactLookup: Page \"Contact List\"; var Response: Action)\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Inventory/Requisition/CarryOutActionMsgPlan.Report.al b/App/Layers/W1/BaseApp/Inventory/Requisition/CarryOutActionMsgPlan.Report.al\n--- a/App/Layers/W1/BaseApp/Inventory/Requisition/CarryOutActionMsgPlan.Report.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Requisition/CarryOutActionMsgPlan.Report.al\n@@ -469,8 +469,10 @@\n \"Requisition Line\".SetRange(\"Worksheet Template Name\", CurrReqWkshTemp);\n if CurrReqWkshTemp <> '' then\n \"Requisition Line\".SetRange(\"Journal Batch Name\", CurrReqWkshName);\n+ \"Requisition Line\".FilterGroup(2);\n \"Requisition Line\".SetRange(Type, \"Requisition Line\".Type::Item);\n \"Requisition Line\".SetFilter(\"Action Message\", '<>%1', \"Requisition Line\".\"Action Message\"::\" \");\n+ \"Requisition Line\".FilterGroup(0);\n OnAfterSetReqLineFilters(\"Requisition Line\");\n end;\n \n"} +{"instance_id": "microsoftInternal__NAV-209835__cf-2", "base_instance_id": "microsoftInternal__NAV-209835", "variant_description": "Filter by Vendor No. instead of Action Message when carrying out action message", "intervention_type": "Toolchain / Ecosystem Constraints", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-209835__cf-2", "FAIL_TO_PASS": [{"codeunitID": 137045, "functionName": ["CarryOutPlanWkshActionMsgFilterCheckGenerateLines"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMBugfixes.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMBugfixes.Codeunit.al\n--- a/App/Layers/W1/Tests/SCM/SCMBugfixes.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMBugfixes.Codeunit.al\n@@ -35,6 +35,7 @@\n WrongSKUUnitCostErr: Label 'Stockkeeping unit''s unit cost must be equal to item unit cost';\n EmailNotAutomaticallySetErr: Label 'Expected BuyFromContactEmail to automatically be set to the email of the contact, but it wasnt.';\n UseInTransitLocationErr: Label 'You can use In-Transit location %1 for transfer orders only.', Comment = '%1: Location code';\n+ PurchaseOrderErr: Label 'Unexpected new purchase order created';\n \n [Test]\n [Scope('OnPrem')]\n@@ -927,6 +928,53 @@\n \n \n OpenOrderPromisingPage(SalesHeader.\"No.\")\n+ end;\n+\n+ [Test]\n+ procedure CarryOutPlanWkshActionMsgFilterCheckGenerateLines()\n+ var\n+ Item: Record Item;\n+ PurchaseHeader: Record \"Purchase Header\";\n+ PurchaseLine: Record \"Purchase Line\";\n+ ReqLine: Record \"Requisition Line\";\n+ SalesHeader: Record \"Sales Header\";\n+ SalesLine: Record \"Sales Line\";\n+ NewPurchOrderChoice: Option \" \",\"Make Purch. Orders\",\"Make Purch. Orders & Print\",\"Copy to Req. Wksh\";\n+ ActualCount: Integer;\n+ begin\n+ // [SCENARIO 563852] When a Filter is set in the Planning Worksheet to a specific Action Message (e.g. Cancel) , Carry Out Action Message Only Process\n+ // Filtered Planning Worksheet Lines.\n+ Initialize();\n+\n+ // [GIVEN] New Item Created with Reordering Policy Order.\n+ LibraryInventory.CreateItem(Item);\n+ Item.Validate(\"Reordering Policy\", Item.\"Reordering Policy\"::Order);\n+ Item.Modify(true);\n+\n+ // [GIVEN] Created New Purchase Order with New Item with 4 Qty.\n+ CreatePurchaseOrder(PurchaseHeader, Item.\"No.\", 4);\n+\n+ // [GIVEN] Created New Sales Order with New Item with 4 Qty and Future Shipment Date.\n+ CreateSalesOrder(SalesHeader, Item.\"No.\", '', 4, SalesHeader.\"Document Type\"::Order);\n+ SalesLine.Get(SalesLine.\"Document Type\"::Order, SalesHeader.\"No.\", 10000);\n+ SalesLine.Validate(\"Shipment Date\", CalcDate('<1W>', WorkDate()));\n+ SalesLine.Modify(true);\n+\n+ // [GIVEN] Calculate regenerative plan in planning worksheet update Planning Worksheet.\n+ CalculatePlanOnPlanningWorksheet(Item, WorkDate(), CalcDate('<1Y>', WorkDate()), true, false);\n+\n+ // [GIVEN] Set \"Accept Action Message\" on all Requisition lines.\n+ UpdatePlanningWorkSheetwithVendor(ReqLine, Item.\"No.\", PurchaseHeader.\"Buy-from Vendor No.\");\n+\n+ // [WHEN] Running Carry Out Action Message filtered by Vendor No.\n+ ReqLine.SetRange(\"Vendor No.\", PurchaseHeader.\"Buy-from Vendor No.\");\n+ LibraryPlanning.CarryOutPlanWksh(ReqLine, 0, NewPurchOrderChoice::\"Make Purch. Orders\", 0, 0, '', '', '', '');\n+\n+ // [WHEN] Count Actual Purchase Lines.\n+ CountActualPurchaseLine(Item, PurchaseLine, ActualCount);\n+\n+ // [THEN] Verify Actual Count Match with Expected Result.\n+ Assert.AreEqual(1, ActualCount, PurchaseOrderErr);\n end;\n \n local procedure Initialize()\n@@ -1547,6 +1595,50 @@\n SalesOrder.SalesLines.OrderPromising.Invoke();\n end;\n \n+ local procedure CountActualPurchaseLine(Item: Record Item; PurchaseLine: Record \"Purchase Line\"; var ActualCount: Integer)\n+ begin\n+ Clear(ActualCount);\n+ PurchaseLine.Reset();\n+ PurchaseLine.SetRange(\"Document Type\", PurchaseLine.\"Document Type\"::Order);\n+ PurchaseLine.SetRange(Type, PurchaseLine.Type::Item);\n+ PurchaseLine.SetRange(\"No.\", Item.\"No.\");\n+ if PurchaseLine.FindSet() then\n+ ActualCount := PurchaseLine.Count;\n+ end;\n+\n+ local procedure CalculatePlanOnPlanningWorksheet(var ItemRec: Record Item; OrderDate: Date; ToDate: Date; RespectPlanningParameters: Boolean; Regenerative: Boolean)\n+ var\n+ TmpItemRec: Record Item;\n+ RequisitionWkshName: Record \"Requisition Wksh. Name\";\n+ CalculatePlanPlanWksh: Report \"Calculate Plan - Plan. Wksh.\";\n+ begin\n+ LibraryPlanning.SelectRequisitionWkshName(RequisitionWkshName, RequisitionWkshName.\"Template Type\"::Planning); // Find Requisition Worksheet Name to Calculate Plan.\n+ Commit();\n+ CalculatePlanPlanWksh.InitializeRequest(OrderDate, ToDate, RespectPlanningParameters, true, true, '', 0D, false);\n+ CalculatePlanPlanWksh.SetTemplAndWorksheet(RequisitionWkshName.\"Worksheet Template Name\", RequisitionWkshName.Name, Regenerative);\n+ if ItemRec.HasFilter then\n+ TmpItemRec.CopyFilters(ItemRec)\n+ else begin\n+ ItemRec.Get(ItemRec.\"No.\");\n+ TmpItemRec.SetRange(\"No.\", ItemRec.\"No.\");\n+ end;\n+ CalculatePlanPlanWksh.SetTableView(TmpItemRec);\n+ CalculatePlanPlanWksh.UseRequestPage(false);\n+ CalculatePlanPlanWksh.RunModal();\n+ end;\n+\n+ local procedure UpdatePlanningWorkSheetwithVendor(var RequisitionLine: Record \"Requisition Line\"; ItemNo: Code[20]; VendorNo: Code[20])\n+ begin\n+ RequisitionLine.SetRange(Type, RequisitionLine.Type::Item);\n+ RequisitionLine.SetRange(\"No.\", ItemNo);\n+ RequisitionLine.FindSet();\n+ repeat\n+ RequisitionLine.Validate(\"Vendor No.\", VendorNo);\n+ RequisitionLine.Validate(\"Accept Action Message\", true);\n+ RequisitionLine.Modify(true);\n+ until RequisitionLine.Next() = 0;\n+ end;\n+\n [ModalPageHandler]\n [Scope('OnPrem')]\n procedure ContactListModalPageHandler(var ContactLookup: Page \"Contact List\"; var Response: Action)\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Inventory/Requisition/CarryOutActionMsgPlan.Report.al b/App/Layers/W1/BaseApp/Inventory/Requisition/CarryOutActionMsgPlan.Report.al\n--- a/App/Layers/W1/BaseApp/Inventory/Requisition/CarryOutActionMsgPlan.Report.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Requisition/CarryOutActionMsgPlan.Report.al\n@@ -469,8 +469,10 @@\n \"Requisition Line\".SetRange(\"Worksheet Template Name\", CurrReqWkshTemp);\n if CurrReqWkshTemp <> '' then\n \"Requisition Line\".SetRange(\"Journal Batch Name\", CurrReqWkshName);\n+ \"Requisition Line\".FilterGroup(2);\n \"Requisition Line\".SetRange(Type, \"Requisition Line\".Type::Item);\n \"Requisition Line\".SetFilter(\"Action Message\", '<>%1', \"Requisition Line\".\"Action Message\"::\" \");\n+ \"Requisition Line\".FilterGroup(0);\n OnAfterSetReqLineFilters(\"Requisition Line\");\n end;\n \n"} +{"instance_id": "microsoftInternal__NAV-209835__cf-3", "base_instance_id": "microsoftInternal__NAV-209835", "variant_description": "Filters applied on the Requisition Line before execution must be preserved and respected during Carry Out Action Message processing", "intervention_type": "Event / Responsibility Misalignment", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-209835__cf-3", "FAIL_TO_PASS": [{"codeunitID": 137045, "functionName": ["CarryOutPlanWkshActionMsgFilterCheckGenerateLines"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMBugfixes.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMBugfixes.Codeunit.al\n--- a/App/Layers/W1/Tests/SCM/SCMBugfixes.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMBugfixes.Codeunit.al\n@@ -35,6 +35,7 @@\n WrongSKUUnitCostErr: Label 'Stockkeeping unit''s unit cost must be equal to item unit cost';\n EmailNotAutomaticallySetErr: Label 'Expected BuyFromContactEmail to automatically be set to the email of the contact, but it wasnt.';\n UseInTransitLocationErr: Label 'You can use In-Transit location %1 for transfer orders only.', Comment = '%1: Location code';\n+ PurchaseOrderErr: Label 'Unexpected new purchase order created';\n \n [Test]\n [Scope('OnPrem')]\n@@ -927,6 +928,54 @@\n \n \n OpenOrderPromisingPage(SalesHeader.\"No.\")\n+ end;\n+\n+ [Test]\n+ procedure CarryOutPlanWkshActionMsgFilterCheckGenerateLines()\n+ var\n+ Item: Record Item;\n+ PurchaseHeader: Record \"Purchase Header\";\n+ PurchaseLine: Record \"Purchase Line\";\n+ ReqLine: Record \"Requisition Line\";\n+ SalesHeader: Record \"Sales Header\";\n+ SalesLine: Record \"Sales Line\";\n+ NewPurchOrderChoice: Option \" \",\"Make Purch. Orders\",\"Make Purch. Orders & Print\",\"Copy to Req. Wksh\";\n+ ActualCount: Integer;\n+ begin\n+ // [SCENARIO 563852] When a Filter is set in the Planning Worksheet to a specific Action Message (e.g. Cancel) , Carry Out Action Message Only Process\n+ // Filtered Planning Worksheet Lines.\n+ Initialize();\n+\n+ // [GIVEN] New Item Created with Reordering Policy Order.\n+ LibraryInventory.CreateItem(Item);\n+ Item.Validate(\"Reordering Policy\", Item.\"Reordering Policy\"::Order);\n+ Item.Modify(true);\n+\n+ // [GIVEN] Created New Purchase Order with New Item with 4 Qty.\n+ CreatePurchaseOrder(PurchaseHeader, Item.\"No.\", 4);\n+\n+ // [GIVEN] Created New Sales Order with New Item with 4 Qty and Future Shipment Date.\n+ CreateSalesOrder(SalesHeader, Item.\"No.\", '', 4, SalesHeader.\"Document Type\"::Order);\n+ SalesLine.Get(SalesLine.\"Document Type\"::Order, SalesHeader.\"No.\", 10000);\n+ SalesLine.Validate(\"Shipment Date\", CalcDate('<1W>', WorkDate()));\n+ SalesLine.Modify(true);\n+\n+ // [GIVEN] Calculate regenerative plan in planning worksheet update Planning Worksheet.\n+ CalculatePlanOnPlanningWorksheet(Item, WorkDate(), CalcDate('<1Y>', WorkDate()), true, false);\n+\n+ // [GIVEN] Set \"Accept Action Message\" on all Requisition lines.\n+ UpdatePlanningWorkSheetwithVendor(ReqLine, Item.\"No.\", PurchaseHeader.\"Buy-from Vendor No.\");\n+\n+ // [WHEN] Running Carry Out Action Message For Requisition lines \"Action Message\"::Cancel.\n+ // Ensure filter is applied before execution context is passed\n+ ReqLine.SetRange(\"Action Message\", ReqLine.\"Action Message\"::Cancel);\n+ LibraryPlanning.CarryOutPlanWksh(ReqLine, 0, NewPurchOrderChoice::\"Make Purch. Orders\", 0, 0, '', '', '', '');\n+\n+ // [WHEN] Count Actual Purchase Lines.\n+ CountActualPurchaseLine(Item, PurchaseLine, ActualCount);\n+\n+ // [THEN] Verify Actual Count Match with Expected Result.\n+ Assert.AreEqual(0, ActualCount, PurchaseOrderErr);\n end;\n \n local procedure Initialize()\n@@ -1547,6 +1596,50 @@\n SalesOrder.SalesLines.OrderPromising.Invoke();\n end;\n \n+ local procedure CountActualPurchaseLine(Item: Record Item; PurchaseLine: Record \"Purchase Line\"; var ActualCount: Integer)\n+ begin\n+ Clear(ActualCount);\n+ PurchaseLine.Reset();\n+ PurchaseLine.SetRange(\"Document Type\", PurchaseLine.\"Document Type\"::Order);\n+ PurchaseLine.SetRange(Type, PurchaseLine.Type::Item);\n+ PurchaseLine.SetRange(\"No.\", Item.\"No.\");\n+ if PurchaseLine.FindSet() then\n+ ActualCount := PurchaseLine.Count;\n+ end;\n+\n+ local procedure CalculatePlanOnPlanningWorksheet(var ItemRec: Record Item; OrderDate: Date; ToDate: Date; RespectPlanningParameters: Boolean; Regenerative: Boolean)\n+ var\n+ TmpItemRec: Record Item;\n+ RequisitionWkshName: Record \"Requisition Wksh. Name\";\n+ CalculatePlanPlanWksh: Report \"Calculate Plan - Plan. Wksh.\";\n+ begin\n+ LibraryPlanning.SelectRequisitionWkshName(RequisitionWkshName, RequisitionWkshName.\"Template Type\"::Planning); // Find Requisition Worksheet Name to Calculate Plan.\n+ Commit();\n+ CalculatePlanPlanWksh.InitializeRequest(OrderDate, ToDate, RespectPlanningParameters, true, true, '', 0D, false);\n+ CalculatePlanPlanWksh.SetTemplAndWorksheet(RequisitionWkshName.\"Worksheet Template Name\", RequisitionWkshName.Name, Regenerative);\n+ if ItemRec.HasFilter then\n+ TmpItemRec.CopyFilters(ItemRec)\n+ else begin\n+ ItemRec.Get(ItemRec.\"No.\");\n+ TmpItemRec.SetRange(\"No.\", ItemRec.\"No.\");\n+ end;\n+ CalculatePlanPlanWksh.SetTableView(TmpItemRec);\n+ CalculatePlanPlanWksh.UseRequestPage(false);\n+ CalculatePlanPlanWksh.RunModal();\n+ end;\n+\n+ local procedure UpdatePlanningWorkSheetwithVendor(var RequisitionLine: Record \"Requisition Line\"; ItemNo: Code[20]; VendorNo: Code[20])\n+ begin\n+ RequisitionLine.SetRange(Type, RequisitionLine.Type::Item);\n+ RequisitionLine.SetRange(\"No.\", ItemNo);\n+ RequisitionLine.FindSet();\n+ repeat\n+ RequisitionLine.Validate(\"Vendor No.\", VendorNo);\n+ RequisitionLine.Validate(\"Accept Action Message\", true);\n+ RequisitionLine.Modify(true);\n+ until RequisitionLine.Next() = 0;\n+ end;\n+\n [ModalPageHandler]\n [Scope('OnPrem')]\n procedure ContactListModalPageHandler(var ContactLookup: Page \"Contact List\"; var Response: Action)\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Inventory/Requisition/CarryOutActionMsgPlan.Report.al b/App/Layers/W1/BaseApp/Inventory/Requisition/CarryOutActionMsgPlan.Report.al\n--- a/App/Layers/W1/BaseApp/Inventory/Requisition/CarryOutActionMsgPlan.Report.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Requisition/CarryOutActionMsgPlan.Report.al\n@@ -469,8 +469,10 @@\n \"Requisition Line\".SetRange(\"Worksheet Template Name\", CurrReqWkshTemp);\n if CurrReqWkshTemp <> '' then\n \"Requisition Line\".SetRange(\"Journal Batch Name\", CurrReqWkshName);\n+ \"Requisition Line\".FilterGroup(2);\n \"Requisition Line\".SetRange(Type, \"Requisition Line\".Type::Item);\n \"Requisition Line\".SetFilter(\"Action Message\", '<>%1', \"Requisition Line\".\"Action Message\"::\" \");\n+ \"Requisition Line\".FilterGroup(0);\n OnAfterSetReqLineFilters(\"Requisition Line\");\n end;\n \n"} +{"instance_id": "microsoftInternal__NAV-211548__cf-1", "base_instance_id": "microsoftInternal__NAV-211548", "variant_description": "Each Allocation Account has 5 distribution lines instead of 10", "intervention_type": "Execution / Validation Semantics", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-211548__cf-1", "FAIL_TO_PASS": [{"codeunitID": 134832, "functionName": ["GeneralJournalPostingWithMultipleAllocationAccountLines"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/General Journal/AllocAccJounralE2ETests.Codeunit.al b/App/Layers/W1/Tests/General Journal/AllocAccJounralE2ETests.Codeunit.al\n--- a/App/Layers/W1/Tests/General Journal/AllocAccJounralE2ETests.Codeunit.al\n+++ b/App/Layers/W1/Tests/General Journal/AllocAccJounralE2ETests.Codeunit.al\n@@ -1362,9 +1362,52 @@\n VerifyGLEntryAmount(GLEntry, 0, 1);\n end;\n \n+ [Test]\n+ [HandlerFunctions('ConfirmHandlerTrue,MessageHandler,GeneralJournalTemplateHandler')]\n+ procedure GeneralJournalPostingWithMultipleAllocationAccountLines()\n+ var\n+ DestinationGLAccount: Record \"G/L Account\";\n+ BalancingGLAccount: Record \"G/L Account\";\n+ AllocationAccount: array[2] of Record \"Allocation Account\";\n+ GLEntry: Record \"G/L Entry\";\n+ GeneralJournalPage: TestPage \"General Journal\";\n+ DocumentNumber: Code[10];\n+ Amount: Decimal;\n+ begin\n+ // [SCENARIO 569036] Issue with posting General Journals that contain Allocation Account lines with 10 entries resulting an error\n+ Initialize();\n+\n+ // [GIVEN] Create Destination and Balancing G/L Account\n+ DestinationGLAccount.Get(LibraryERM.CreateGLAccountNoWithDirectPosting());\n+ BalancingGLAccount.Get(LibraryERM.CreateGLAccountNoWithDirectPosting());\n+\n+ // [GIVEN] An Allocation Account with variable GL distributions\n+ CreateAllocationAccountwithSpecificNoOfFixedGLDistributionLines(AllocationAccount[1], DestinationGLAccount, LibraryRandom.RandIntInRange(5, 5));\n+ CreateAllocationAccountwithSpecificNoOfFixedGLDistributionLines(AllocationAccount[2], DestinationGLAccount, LibraryRandom.RandIntInRange(5, 5));\n+ Amount := LibraryRandom.RandDecInDecimalRange(10000, 10000, 0);\n+\n+ // [GIVEN] The General Journal line with Allocation Account\n+ CreateBalancingLinesOnGeneralJournalWithTwoAllocationAccount(\n+ DocumentNumber,\n+ GeneralJournalPage,\n+ AllocationAccount,\n+ BalancingGLAccount.\"No.\",\n+ Amount);\n+\n+ // [WHEN] The General Journal line is posted\n+ GeneralJournalPage.Post.Invoke();\n+\n+ // [THEN] Verify the General Journal Posted Successfylly\n+ GLEntry.SetRange(\"Document No.\", DocumentNumber);\n+ GLEntry.SetRange(\"G/L Account No.\", DestinationGLAccount.\"No.\");\n+ Assert.AreEqual(10, GLEntry.Count(), 'Wrong number of G/L Entries created for the destination account');\n+ GLEntry.CalcSums(Amount);\n+ Assert.AreEqual(Amount, GLEntry.Amount, 'The rounding amount was not distributed correctly');\n+ end;\n+\n local procedure CreateLineOnCashReceiptJournal(var DocumentNumber: Code[10]; var CashReceiptJournalPage: TestPage \"Cash Receipt Journal\"; AccountType: Enum \"Gen. Journal Account Type\"; AccountNo: Code[20];\n- BalancingAccountType: Enum \"Gen. Journal Account Type\";\n- BalancingAccountNo: Code[20])\n+ BalancingAccountType: Enum \"Gen. Journal Account Type\";\n+ BalancingAccountNo: Code[20])\n var\n GenJournalBatch: Record \"Gen. Journal Batch\";\n GenJournalTemplateType: Enum \"Gen. Journal Template Type\";\n@@ -1405,6 +1448,30 @@\n end;\n \n local procedure CreateLineOnSalesJournal(var DocumentNumber: Code[10]; var SalesJournalPage: TestPage \"Sales Journal\"; AccountType: Enum \"Gen. Journal Account Type\"; AccountNo: Code[20];\n+ BalancingAccountType: Enum \"Gen. Journal Account Type\";\n+ BalancingAccountNo: Code[20])\n+ var\n+ GenJournalBatch: Record \"Gen. Journal Batch\";\n+ GenJournalTemplateType: Enum \"Gen. Journal Template Type\";\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+ end;\n+\n+ local procedure CreateLineOnPurchaseJournal(var DocumentNumber: Code[10]; var PurchaseJournalPage: TestPage \"Purchase Journal\"; AccountType: Enum \"Gen. Journal Account Type\"; AccountNo: Code[20];\n BalancingAccountType: Enum \"Gen. Journal Account Type\";\n BalancingAccountNo: Code[20])\n var\n@@ -1426,30 +1493,6 @@\n \n \n \n- end;\n-\n- local procedure CreateLineOnPurchaseJournal(var DocumentNumber: Code[10]; var PurchaseJournalPage: TestPage \"Purchase Journal\"; AccountType: Enum \"Gen. Journal Account Type\"; AccountNo: Code[20];\n- BalancingAccountType: Enum \"Gen. Journal Account Type\";\n- BalancingAccountNo: Code[20])\n- var\n- GenJournalBatch: Record \"Gen. Journal Batch\";\n- GenJournalTemplateType: Enum \"Gen. Journal Template Type\";\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n \n \n \n@@ -1869,15 +1912,15 @@\n var GenJournalLine: Record \"Gen. Journal Line\";\n AccountNo: Code[20];\n AccountType: Enum \"Gen. Journal Account Type\";\n- BalancingAccountType: Enum \"Gen. Journal Account Type\";\n- BalancingAccountNo: Code[20];\n- Amount: Decimal;\n- DocumentNo: Code[20];\n- GenJournalBatch: Record \"Gen. Journal Batch\";\n- VATBusPostingGroup: Code[20];\n- VATProdPostingGroup: Code[20];\n- CurrencyCode: Code[20];\n- SelectedAllocAccountNo: Code[20])\n+ BalancingAccountType: Enum \"Gen. Journal Account Type\";\n+ BalancingAccountNo: Code[20];\n+ Amount: Decimal;\n+ DocumentNo: Code[20];\n+ GenJournalBatch: Record \"Gen. Journal Batch\";\n+ VATBusPostingGroup: Code[20];\n+ VATProdPostingGroup: Code[20];\n+ CurrencyCode: Code[20];\n+ SelectedAllocAccountNo: Code[20])\n begin\n LibraryJournals.CreateGenJournalLine(\n GenJournalLine,\n@@ -1898,6 +1941,59 @@\n GenJournalLine.Modify(true);\n end;\n \n+ local procedure CreateAllocationAccountwithSpecificNoOfFixedGLDistributionLines(\n+ var AllocationAccount: Record \"Allocation Account\";\n+ DestinationGLAccount: Record \"G/L Account\"; NoOfFixedAccountDistributionLines: Integer)\n+ var\n+ AllocationAccountPage: TestPage \"Allocation Account\";\n+ FixedAllocationAccountCode: Code[20];\n+ i: Integer;\n+ begin\n+ FixedAllocationAccountCode := CreateAllocationAccountWithFixedDistribution(AllocationAccountPage);\n+\n+ for i := 1 to NoOfFixedAccountDistributionLines do begin\n+ AddGLDestinationAccountForFixedDistribution(AllocationAccountPage, DestinationGLAccount);\n+ AllocationAccountPage.FixedAccountDistribution.Share.SetValue(LibraryRandom.RandDecInDecimalRange(10, 10, 0));\n+ if i <> NoOfFixedAccountDistributionLines then\n+ AllocationAccountPage.FixedAccountDistribution.New();\n+ end;\n+ AllocationAccountPage.Close();\n+\n+ AllocationAccount.Get(FixedAllocationAccountCode);\n+ end;\n+\n+ local procedure CreateBalancingLinesOnGeneralJournalWithTwoAllocationAccount(\n+ var DocumentNumber: Code[10];\n+ var GeneralJournalPage: TestPage \"General Journal\";\n+ AllocationAccount: array[2] of Record \"Allocation Account\";\n+ BalancingAccountNo: Code[20];\n+ Amount: Decimal)\n+ var\n+ GenJournalBatch: Record \"Gen. Journal Batch\";\n+ AccountType: Enum \"Gen. Journal Account Type\";\n+ i: Integer;\n+ begin\n+ CreateGeneralJournalBatch(GenJournalBatch);\n+ LibraryVariableStorage.Enqueue(GenJournalBatch.\"Journal Template Name\");\n+ GeneralJournalPage.OpenEdit();\n+ DocumentNumber := LibraryRandom.RandText(10);\n+ GeneralJournalPage.\"Document No.\".SetValue(DocumentNumber);\n+ GeneralJournalPage.\"Account Type\".SetValue(AccountType::\"G/L Account\");\n+ GeneralJournalPage.\"Account No.\".SetValue(BalancingAccountNo);\n+ GeneralJournalPage.Description.SetValue(DocumentNumber);\n+ GeneralJournalPage.Amount.SetValue(-Amount);\n+\n+ for i := 1 to ArrayLen(AllocationAccount) do begin\n+ GeneralJournalPage.New();\n+ GeneralJournalPage.\"Document No.\".SetValue(DocumentNumber);\n+ GeneralJournalPage.\"Account Type\".SetValue(AccountType::\"Allocation Account\");\n+ GeneralJournalPage.\"Account No.\".SetValue(AllocationAccount[i].\"No.\");\n+ GeneralJournalPage.Description.SetValue(DocumentNumber);\n+ GeneralJournalPage.Amount.SetValue(Amount / 2);\n+\n+ end;\n+ end;\n+\n [ModalPageHandler]\n procedure HandleEditDimensionSetEntriesPage(var EditDimensionSetEntriesPage: TestPage \"Edit Dimension Set Entries\")\n var\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Finance/AllocationAccount/GenJournalAllocAccMgt.Codeunit.al b/App/Layers/W1/BaseApp/Finance/AllocationAccount/GenJournalAllocAccMgt.Codeunit.al\n--- a/App/Layers/W1/BaseApp/Finance/AllocationAccount/GenJournalAllocAccMgt.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Finance/AllocationAccount/GenJournalAllocAccMgt.Codeunit.al\n@@ -470,13 +470,13 @@\n exit(-1);\n \n if Increment >= 1000 then\n- exit(1000);\n+ exit(100);\n \n if Increment >= 100 then\n- exit(100);\n+ exit(10);\n \n if Increment >= 10 then\n- exit(10);\n+ exit(1);\n \n exit(Increment);\n end;\n"} +{"instance_id": "microsoftInternal__NAV-211548__cf-2", "base_instance_id": "microsoftInternal__NAV-211548", "variant_description": "Use 3 allocation accounts instead of 2 to increase collision risk", "intervention_type": "Execution / Validation Semantics", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-211548__cf-2", "FAIL_TO_PASS": [{"codeunitID": 134832, "functionName": ["GeneralJournalPostingWithMultipleAllocationAccountLines"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/General Journal/AllocAccJounralE2ETests.Codeunit.al b/App/Layers/W1/Tests/General Journal/AllocAccJounralE2ETests.Codeunit.al\n--- a/App/Layers/W1/Tests/General Journal/AllocAccJounralE2ETests.Codeunit.al\n+++ b/App/Layers/W1/Tests/General Journal/AllocAccJounralE2ETests.Codeunit.al\n@@ -1362,9 +1362,53 @@\n VerifyGLEntryAmount(GLEntry, 0, 1);\n end;\n \n+ [Test]\n+ [HandlerFunctions('ConfirmHandlerTrue,MessageHandler,GeneralJournalTemplateHandler')]\n+ procedure GeneralJournalPostingWithMultipleAllocationAccountLines()\n+ var\n+ DestinationGLAccount: Record \"G/L Account\";\n+ BalancingGLAccount: Record \"G/L Account\";\n+ AllocationAccount: array[3] of Record \"Allocation Account\";\n+ GLEntry: Record \"G/L Entry\";\n+ GeneralJournalPage: TestPage \"General Journal\";\n+ DocumentNumber: Code[10];\n+ Amount: Decimal;\n+ begin\n+ // [SCENARIO 569036] Issue with posting General Journals that contain Allocation Account lines with 10 entries resulting an error\n+ Initialize();\n+\n+ // [GIVEN] Create Destination and Balancing G/L Account\n+ DestinationGLAccount.Get(LibraryERM.CreateGLAccountNoWithDirectPosting());\n+ BalancingGLAccount.Get(LibraryERM.CreateGLAccountNoWithDirectPosting());\n+\n+ // [GIVEN] An Allocation Account with variable GL distributions\n+ CreateAllocationAccountwithSpecificNoOfFixedGLDistributionLines(AllocationAccount[1], DestinationGLAccount, LibraryRandom.RandIntInRange(10, 10));\n+ CreateAllocationAccountwithSpecificNoOfFixedGLDistributionLines(AllocationAccount[2], DestinationGLAccount, LibraryRandom.RandIntInRange(10, 10));\n+ CreateAllocationAccountwithSpecificNoOfFixedGLDistributionLines(AllocationAccount[3], DestinationGLAccount, LibraryRandom.RandIntInRange(10, 10));\n+ Amount := LibraryRandom.RandDecInDecimalRange(10000, 10000, 0);\n+\n+ // [GIVEN] The General Journal line with Allocation Account\n+ CreateBalancingLinesOnGeneralJournalWithTwoAllocationAccount(\n+ DocumentNumber,\n+ GeneralJournalPage,\n+ AllocationAccount,\n+ BalancingGLAccount.\"No.\",\n+ Amount);\n+\n+ // [WHEN] The General Journal line is posted\n+ GeneralJournalPage.Post.Invoke();\n+\n+ // [THEN] Verify the General Journal Posted Successfylly\n+ GLEntry.SetRange(\"Document No.\", DocumentNumber);\n+ GLEntry.SetRange(\"G/L Account No.\", DestinationGLAccount.\"No.\");\n+ Assert.AreEqual(30, GLEntry.Count(), 'Wrong number of G/L Entries created for the destination account');\n+ GLEntry.CalcSums(Amount);\n+ Assert.AreEqual(Amount, GLEntry.Amount, 'The rounding amount was not distributed correctly');\n+ end;\n+\n local procedure CreateLineOnCashReceiptJournal(var DocumentNumber: Code[10]; var CashReceiptJournalPage: TestPage \"Cash Receipt Journal\"; AccountType: Enum \"Gen. Journal Account Type\"; AccountNo: Code[20];\n- BalancingAccountType: Enum \"Gen. Journal Account Type\";\n- BalancingAccountNo: Code[20])\n+ BalancingAccountType: Enum \"Gen. Journal Account Type\";\n+ BalancingAccountNo: Code[20])\n var\n GenJournalBatch: Record \"Gen. Journal Batch\";\n GenJournalTemplateType: Enum \"Gen. Journal Template Type\";\n@@ -1405,6 +1449,30 @@\n end;\n \n local procedure CreateLineOnSalesJournal(var DocumentNumber: Code[10]; var SalesJournalPage: TestPage \"Sales Journal\"; AccountType: Enum \"Gen. Journal Account Type\"; AccountNo: Code[20];\n+ BalancingAccountType: Enum \"Gen. Journal Account Type\";\n+ BalancingAccountNo: Code[20])\n+ var\n+ GenJournalBatch: Record \"Gen. Journal Batch\";\n+ GenJournalTemplateType: Enum \"Gen. Journal Template Type\";\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+\n+ end;\n+\n+ local procedure CreateLineOnPurchaseJournal(var DocumentNumber: Code[10]; var PurchaseJournalPage: TestPage \"Purchase Journal\"; AccountType: Enum \"Gen. Journal Account Type\"; AccountNo: Code[20];\n BalancingAccountType: Enum \"Gen. Journal Account Type\";\n BalancingAccountNo: Code[20])\n var\n@@ -1426,30 +1494,6 @@\n \n \n \n- end;\n-\n- local procedure CreateLineOnPurchaseJournal(var DocumentNumber: Code[10]; var PurchaseJournalPage: TestPage \"Purchase Journal\"; AccountType: Enum \"Gen. Journal Account Type\"; AccountNo: Code[20];\n- BalancingAccountType: Enum \"Gen. Journal Account Type\";\n- BalancingAccountNo: Code[20])\n- var\n- GenJournalBatch: Record \"Gen. Journal Batch\";\n- GenJournalTemplateType: Enum \"Gen. Journal Template Type\";\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n-\n \n \n \n@@ -1869,15 +1913,15 @@\n var GenJournalLine: Record \"Gen. Journal Line\";\n AccountNo: Code[20];\n AccountType: Enum \"Gen. Journal Account Type\";\n- BalancingAccountType: Enum \"Gen. Journal Account Type\";\n- BalancingAccountNo: Code[20];\n- Amount: Decimal;\n- DocumentNo: Code[20];\n- GenJournalBatch: Record \"Gen. Journal Batch\";\n- VATBusPostingGroup: Code[20];\n- VATProdPostingGroup: Code[20];\n- CurrencyCode: Code[20];\n- SelectedAllocAccountNo: Code[20])\n+ BalancingAccountType: Enum \"Gen. Journal Account Type\";\n+ BalancingAccountNo: Code[20];\n+ Amount: Decimal;\n+ DocumentNo: Code[20];\n+ GenJournalBatch: Record \"Gen. Journal Batch\";\n+ VATBusPostingGroup: Code[20];\n+ VATProdPostingGroup: Code[20];\n+ CurrencyCode: Code[20];\n+ SelectedAllocAccountNo: Code[20])\n begin\n LibraryJournals.CreateGenJournalLine(\n GenJournalLine,\n@@ -1898,6 +1942,59 @@\n GenJournalLine.Modify(true);\n end;\n \n+ local procedure CreateAllocationAccountwithSpecificNoOfFixedGLDistributionLines(\n+ var AllocationAccount: Record \"Allocation Account\";\n+ DestinationGLAccount: Record \"G/L Account\"; NoOfFixedAccountDistributionLines: Integer)\n+ var\n+ AllocationAccountPage: TestPage \"Allocation Account\";\n+ FixedAllocationAccountCode: Code[20];\n+ i: Integer;\n+ begin\n+ FixedAllocationAccountCode := CreateAllocationAccountWithFixedDistribution(AllocationAccountPage);\n+\n+ for i := 1 to NoOfFixedAccountDistributionLines do begin\n+ AddGLDestinationAccountForFixedDistribution(AllocationAccountPage, DestinationGLAccount);\n+ AllocationAccountPage.FixedAccountDistribution.Share.SetValue(LibraryRandom.RandDecInDecimalRange(10, 10, 0));\n+ if i <> NoOfFixedAccountDistributionLines then\n+ AllocationAccountPage.FixedAccountDistribution.New();\n+ end;\n+ AllocationAccountPage.Close();\n+\n+ AllocationAccount.Get(FixedAllocationAccountCode);\n+ end;\n+\n+ local procedure CreateBalancingLinesOnGeneralJournalWithTwoAllocationAccount(\n+ var DocumentNumber: Code[10];\n+ var GeneralJournalPage: TestPage \"General Journal\";\n+ AllocationAccount: array[3] of Record \"Allocation Account\";\n+ BalancingAccountNo: Code[20];\n+ Amount: Decimal)\n+ var\n+ GenJournalBatch: Record \"Gen. Journal Batch\";\n+ AccountType: Enum \"Gen. Journal Account Type\";\n+ i: Integer;\n+ begin\n+ CreateGeneralJournalBatch(GenJournalBatch);\n+ LibraryVariableStorage.Enqueue(GenJournalBatch.\"Journal Template Name\");\n+ GeneralJournalPage.OpenEdit();\n+ DocumentNumber := LibraryRandom.RandText(10);\n+ GeneralJournalPage.\"Document No.\".SetValue(DocumentNumber);\n+ GeneralJournalPage.\"Account Type\".SetValue(AccountType::\"G/L Account\");\n+ GeneralJournalPage.\"Account No.\".SetValue(BalancingAccountNo);\n+ GeneralJournalPage.Description.SetValue(DocumentNumber);\n+ GeneralJournalPage.Amount.SetValue(-Amount);\n+\n+ for i := 1 to ArrayLen(AllocationAccount) do begin\n+ GeneralJournalPage.New();\n+ GeneralJournalPage.\"Document No.\".SetValue(DocumentNumber);\n+ GeneralJournalPage.\"Account Type\".SetValue(AccountType::\"Allocation Account\");\n+ GeneralJournalPage.\"Account No.\".SetValue(AllocationAccount[i].\"No.\");\n+ GeneralJournalPage.Description.SetValue(DocumentNumber);\n+ GeneralJournalPage.Amount.SetValue(Amount / 3);\n+\n+ end;\n+ end;\n+\n [ModalPageHandler]\n procedure HandleEditDimensionSetEntriesPage(var EditDimensionSetEntriesPage: TestPage \"Edit Dimension Set Entries\")\n var\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Finance/AllocationAccount/GenJournalAllocAccMgt.Codeunit.al b/App/Layers/W1/BaseApp/Finance/AllocationAccount/GenJournalAllocAccMgt.Codeunit.al\n--- a/App/Layers/W1/BaseApp/Finance/AllocationAccount/GenJournalAllocAccMgt.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Finance/AllocationAccount/GenJournalAllocAccMgt.Codeunit.al\n@@ -470,13 +470,13 @@\n exit(-1);\n \n if Increment >= 1000 then\n- exit(1000);\n+ exit(100);\n \n if Increment >= 100 then\n- exit(100);\n+ exit(10);\n \n if Increment >= 10 then\n- exit(10);\n+ exit(1);\n \n exit(Increment);\n end;\n"} +{"instance_id": "microsoftInternal__NAV-209737__cf-1", "base_instance_id": "microsoftInternal__NAV-209737", "variant_description": "Use Line Discount % instead of Invoice Discount % on the sales order", "intervention_type": "Execution / Validation Semantics", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-209737__cf-1", "FAIL_TO_PASS": [{"codeunitID": 137408, "functionName": ["InvDiscPctAndAmtInSOIsNotZeroWhenCreateAndShipInvPickFromSOHavingInvDiscPctAndAmt"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMWarehouseVI.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMWarehouseVI.Codeunit.al\n--- a/App/Layers/W1/Tests/SCM/SCMWarehouseVI.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMWarehouseVI.Codeunit.al\n@@ -38,6 +38,7 @@\n AbsoluteValueEqualToQuantityErr: Label 'Absolute value of %1.%2 must be equal to the test quantity.', Comment = '%1 - tablename, %2 - fieldname.';\n RegisteringPickInterruptedErr: Label 'Registering pick has been interrupted.';\n LotNoNotAvailableInInvtErr: Label 'Lot No. %1 is not available in inventory, it has already been reserved for another document, or the quantity available is lower than the quantity to handle specified on the line.', Comment = '%1: Lot No.';\n+ InvtPickCreatedTxt: Label 'Number of Invt. Pick activities created';\n \n [Test]\n [HandlerFunctions('ItemTrackingLinesHandler,ItemTrackingSummaryHandler,MessageHandler,WhseItemTrackingLinesHandler,ConfirmHandlerTrue')]\n@@ -4141,6 +4142,115 @@\n \n \n VerifyWarehouseJournalLineWithReasonCode(WarehouseJournalBatch, WarehouseJournalLine, ReasonCode.Code);\n+ end;\n+\n+ [Test]\n+ [HandlerFunctions('MessageHandler')]\n+ [Scope('OnPrem')]\n+ procedure InvDiscPctAndAmtInSOIsNotZeroWhenCreateAndShipInvPickFromSOHavingInvDiscPctAndAmt()\n+ var\n+ Bin: Record Bin;\n+ Customer: Record Customer;\n+ Item: Record Item;\n+ Location: Record Location;\n+ ItemJournalLine: Record \"Item Journal Line\";\n+ SalesHeader: Record \"Sales Header\";\n+ SalesLine: Record \"Sales Line\";\n+ WarehouseEmployee: Record \"Warehouse Employee\";\n+ WarehouseActivityHeader: Record \"Warehouse Activity Header\";\n+ WarehouseActivityLine: Record \"Warehouse Activity Line\";\n+ WhseActivityPost: Codeunit \"Whse.-Activity-Post\";\n+ SalesOrder: TestPage \"Sales Order\";\n+ InvDiscountPct: Decimal;\n+ begin\n+ // [SCENARIO 256471] It should not be allowed to change location code in an inventory pick that has lines\n+ Initialize();\n+\n+ // [GIVEN] Create an Item.\n+ LibraryInventory.CreateItem(Item);\n+\n+ // [GIVEN] Create a Location.\n+ LibraryWarehouse.CreateLocationWMS(Location, true, false, true, false, false);\n+\n+ // [GIVEN] Create a Bin.\n+ LibraryWarehouse.CreateBin(Bin, Location.Code, Bin.Code, '', '');\n+\n+ // [GIVEN] Create a Warehouse Employee.\n+ LibraryWarehouse.CreateWarehouseEmployee(WarehouseEmployee, Location.Code, true);\n+\n+ // [GIVEN] Create a Customer and Validate \"Currency Code\".\n+ LibrarySales.CreateCustomer(Customer);\n+ Customer.Validate(\"Currency Code\", CreateCurrency());\n+ Customer.Modify(true);\n+\n+ // [GIVEN] Create an Item Journal Line and Post it.\n+ CreateItemJournalLine(ItemJournalLine, Item.\"No.\", Location.Code, LibraryRandom.RandIntInRange(20, 20), WorkDate(), Bin.Code, Item.\"Base Unit of Measure\");\n+ LibraryInventory.PostItemJournalLine(ItemJournalLine.\"Journal Template Name\", ItemJournalLine.\"Journal Batch Name\");\n+\n+ // [GIVEN] Update Work Date.\n+ WorkDate(CalcDate('', WorkDate()));\n+\n+ // [GIVEN] Create a Sales Header.\n+ LibrarySales.CreateSalesHeader(SalesHeader, SalesHeader.\"Document Type\"::Order, Customer.\"No.\");\n+ SalesHeader.Validate(\"Currency Factor\", LibraryRandom.RandIntInRange(2, 2));\n+ SalesHeader.Modify(true);\n+\n+ // [GIVEN] Create a Sales Line and Validate \"Location Code\" and \"Unit Price\".\n+ LibrarySales.CreateSalesLine(SalesLine, SalesHeader, SalesLine.Type::Item, Item.\"No.\", LibraryRandom.RandInt(0));\n+ SalesLine.Validate(\"Location Code\", Location.Code);\n+ SalesLine.Validate(\"Unit Price\", LibraryRandom.RandIntInRange(1000, 1000));\n+ SalesLine.Modify(true);\n+\n+ // [GIVEN] Generate and save Line Discount % in a Variable.\n+ InvDiscountPct := LibraryRandom.RandIntInRange(10, 10);\n+\n+ // [GIVEN] Open Sales Order page and Set Line Discount %.\n+ SalesOrder.OpenEdit();\n+ SalesOrder.GoToRecord(SalesHeader);\n+ SalesOrder.SalesLines.\"Line Discount %\".SetValue(InvDiscountPct);\n+ SalesOrder.Close();\n+\n+ // [GIVEN] Find Sales Header.\n+ SalesHeader.Get(SalesHeader.\"Document Type\", SalesHeader.\"No.\");\n+\n+ // [GIVEN] Release Sales Order.\n+ LibrarySales.ReleaseSalesDocument(SalesHeader);\n+\n+ // [GIVEN] Create Invt. Pick from Sales Order.\n+ LibraryVariableStorage.Enqueue(InvtPickCreatedTxt);\n+ LibraryWarehouse.CreateInvtPutPickMovement(\n+ WarehouseActivityHeader.\"Source Document\"::\"Sales Order\", SalesHeader.\"No.\", false, true, false);\n+\n+ // [GIVEN] Find Warehouse Activity Line.\n+ FindWarehouseActivityLine(\n+ WarehouseActivityLine, WarehouseActivityLine.\"Source Document\"::\"Sales Order\", SalesHeader.\"No.\",\n+ WarehouseActivityLine.\"Activity Type\"::\"Invt. Pick\");\n+\n+ // [GIVEN] Find Warehouse Activity Header and Validate \"Posting Date\".\n+ WarehouseActivityHeader.Get(WarehouseActivityLine.\"Activity Type\", WarehouseActivityLine.\"No.\");\n+ WarehouseActivityHeader.Validate(\"Posting Date\", CalcDate('', WorkDate()));\n+ WarehouseActivityHeader.Modify(true);\n+\n+ // [GIVEN] Validate \"Qty. to Handle\" in Warehouse Activity Line.\n+ WarehouseActivityLine.Validate(\"Qty. to Handle\", WarehouseActivityLine.Quantity);\n+ WarehouseActivityLine.Modify(true);\n+\n+ // [GIVEN] Update Work Date.\n+ WorkDate(WarehouseActivityHeader.\"Posting Date\");\n+\n+ // [GIVEN] Post Inventory Pick.\n+ WhseActivityPost.Run(WarehouseActivityLine);\n+\n+ // [GIVEN] Find Sales Header.\n+ SalesHeader.Get(SalesHeader.\"Document Type\", SalesHeader.\"No.\");\n+\n+ // [WHEN] Open Sales Order page.\n+ SalesOrder.OpenEdit();\n+ SalesOrder.GoToRecord(SalesHeader);\n+\n+ // [THEN] Line Discount % is equal to InvDiscountPct.\n+ SalesOrder.SalesLines.\"Line Discount %\".AssertEquals(InvDiscountPct);\n+ SalesOrder.Close();\n end;\n \n local procedure Initialize()\n@@ -6187,6 +6297,65 @@\n RunCalculateCountingPeriodFromWarehousePhysicalInventoryJournalReasonCode(WarehouseJournalBatch, LocationCode, ReasonCode);\n end;\n \n+ local procedure CreateItemJournalLine(var ItemJournalLine: Record \"Item Journal Line\"; ItemNo: Code[20]; LocationCode: Code[10]; Quantity: Decimal; PostingDate: Date; BinCode: Code[20]; UnitOfMeasureCode: Code[10])\n+ begin\n+ LibraryInventory.CreateItemJnlLine(\n+ ItemJournalLine, ItemJournalLine.\"Entry Type\"::Purchase, PostingDate, ItemNo,\n+ Quantity, LocationCode);\n+ ItemJournalLine.Validate(\"Unit of Measure Code\", UnitOfMeasureCode);\n+ if BinCode <> '' then\n+ ItemJournalLine.Validate(\"Bin Code\", BinCode);\n+ ItemJournalLine.Modify(true);\n+ end;\n+\n+ local procedure FindWarehouseActivityLine(var WarehouseActivityLine: Record \"Warehouse Activity Line\"; SourceDocument: Enum \"Warehouse Activity Source Document\"; SourceNo: Code[20]; ActivityType: Enum \"Warehouse Activity Type\")\n+ begin\n+ FilterWarehouseActivityLine(WarehouseActivityLine, SourceDocument, SourceNo, ActivityType);\n+ WarehouseActivityLine.FindFirst();\n+ end;\n+\n+ local procedure FilterWarehouseActivityLine(var WarehouseActivityLine: Record \"Warehouse Activity Line\"; SourceDocument: Enum \"Warehouse Activity Source Document\"; SourceNo: Code[20]; ActivityType: Enum \"Warehouse Activity Type\")\n+ begin\n+ WarehouseActivityLine.SetRange(\"Source Document\", SourceDocument);\n+ if SourceNo <> '' then\n+ WarehouseActivityLine.SetRange(\"Source No.\", SourceNo);\n+ WarehouseActivityLine.SetRange(\"Activity Type\", ActivityType);\n+ end;\n+\n+ local procedure CreateCurrency(): Code[10]\n+ var\n+ Currency: Record Currency;\n+ begin\n+ LibraryERM.CreateCurrency(Currency);\n+ LibraryERM.SetCurrencyGainLossAccounts(Currency);\n+ Currency.Validate(\"Residual Gains Account\", Currency.\"Realized Gains Acc.\");\n+ Currency.Validate(\"Residual Losses Account\", Currency.\"Realized Losses Acc.\");\n+ Currency.Validate(\"Currency Factor\", LibraryRandom.RandDecInDecimalRange(1.176471, 1.176471, 0));\n+ Currency.Modify(true);\n+ CreateCurrExchangeRate(Currency.Code, CalcDate('', WorkDate()), LibraryRandom.RandDecInDecimalRange(0.5, 0.5, 0));\n+ CreateCurrExchangeRate(Currency.Code, CalcDate('', WorkDate()), LibraryRandom.RandDecInDecimalRange(0.75, 0.75, 0));\n+ CreateCurrExchangeRate(Currency.Code, CalcDate('', WorkDate()), LibraryRandom.RandDecInDecimalRange(0.85, 0.85, 0));\n+ exit(Currency.Code);\n+ end;\n+\n+ procedure CreateCurrExchangeRate(CurrencyCode: Code[10]; StartingDate: Date; RelExchRateAmt: Decimal)\n+ var\n+ CurrencyExchangeRate: Record \"Currency Exchange Rate\";\n+ begin\n+ CurrencyExchangeRate.Init();\n+ CurrencyExchangeRate.Validate(\"Currency Code\", CurrencyCode);\n+ CurrencyExchangeRate.Validate(\"Starting Date\", StartingDate);\n+ CurrencyExchangeRate.Insert(true);\n+\n+ CurrencyExchangeRate.Validate(\"Exchange Rate Amount\", LibraryRandom.RandDecInDecimalRange(1.0, 1.0, 0));\n+ CurrencyExchangeRate.Validate(\"Adjustment Exch. Rate Amount\", LibraryRandom.RandDecInDecimalRange(1.0, 1.0, 0));\n+\n+ CurrencyExchangeRate.Validate(\"Relational Exch. Rate Amount\", RelExchRateAmt);\n+ CurrencyExchangeRate.Validate(\"Relational Adjmt Exch Rate Amt\", RelExchRateAmt);\n+ CurrencyExchangeRate.Validate(\"Fix Exchange Rate Amount\", CurrencyExchangeRate.\"Fix Exchange Rate Amount\"::Currency);\n+ CurrencyExchangeRate.Modify(true);\n+ end;\n+\n [EventSubscriber(ObjectType::Codeunit, Codeunit::\"Whse.-Activity-Register\", 'OnBeforeAutoReserveForSalesLine', '', false, false)]\n local procedure InvokeErrorOnRegisteringWarehousePick(var TempWhseActivLineToReserve: Record \"Warehouse Activity Line\" temporary; var IsHandled: Boolean)\n begin\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Sales/Document/SalesHeader.Table.al b/App/Layers/W1/BaseApp/Sales/Document/SalesHeader.Table.al\n--- a/App/Layers/W1/BaseApp/Sales/Document/SalesHeader.Table.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/SalesHeader.Table.al\n@@ -4483,7 +4483,8 @@\n SalesLine.Validate(\"Shipment Date\", \"Shipment Date\");\n FieldNo(\"Currency Factor\"):\n if SalesLine.Type <> SalesLine.Type::\" \" then begin\n- SalesLine.Validate(\"Unit Price\");\n+ if SalesLine.\"Line Discount %\" <> 0 then\n+ SalesLine.Validate(\"Unit Price\");\n SalesLine.Validate(\"Unit Cost (LCY)\");\n if SalesLine.\"Job No.\" <> '' then\n JobTransferLine.FromSalesHeaderToPlanningLine(SalesLine, \"Currency Factor\");\n"} +{"instance_id": "microsoftInternal__NAV-211521__cf-1", "base_instance_id": "microsoftInternal__NAV-211521", "variant_description": "No System Task Type filter should be applied on Next Task Date drilldown", "intervention_type": "Execution / Validation Semantics", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-211521__cf-1", "FAIL_TO_PASS": [{"codeunitID": 136201, "functionName": ["TaskListPageHasFixedSystemTaskTypeFilterAsOrganiserOrContactAttendee"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/Marketing/MarketingContacts.Codeunit.al b/App/Layers/W1/Tests/Marketing/MarketingContacts.Codeunit.al\n--- a/App/Layers/W1/Tests/Marketing/MarketingContacts.Codeunit.al\n+++ b/App/Layers/W1/Tests/Marketing/MarketingContacts.Codeunit.al\n@@ -6027,6 +6027,39 @@\n \n \n Assert.AreEqual(VerifyInteractionLogEntry.\"Duration (Min.)\", DurationMin, ValueMustMatch);\n+ end;\n+\n+ [Test]\n+ [HandlerFunctions('ModalPageHandlerForTask')]\n+ procedure TaskListPageHasFixedSystemTaskTypeFilterAsOrganiserOrContactAttendee()\n+ var\n+ Contact: Record Contact;\n+ Task: Record \"To-do\";\n+ TempTask: Record \"To-do\" temporary;\n+ ContactCard: TestPage \"Contact Card\";\n+ TaskList: TestPage \"Task List\";\n+ begin\n+ // [SCENARIO 568324] Task List page has a fixed System Task Type filter as 'Organizer|Contact Attendee' when Next Task Date Drilldown on Contact card\n+ Initialize();\n+\n+ // [GIVEN] Create Contact\n+ LibraryMarketing.CreateCompanyContact(Contact);\n+\n+ // [GIVEN] Create Task for Contact\n+ Task.SetRange(\"Contact No.\", Contact.\"No.\");\n+ TempTask.CreateTaskFromTask(Task);\n+\n+ // [WHEN] Open Contact Card and Drilldonw 'Next Task Date' also Trap Task List\n+ ContactCard.OpenView();\n+ ContactCard.GoToRecord(Contact);\n+ TaskList.Trap();\n+ ContactCard.\"Next Task Date\".Drilldown();\n+\n+ // [THEN] Verify no System To-do Type filter has been set on the page\n+ TaskList.\"Contact No.\".AssertEquals(Contact.\"No.\");\n+ Assert.AreEqual(\n+ '',\n+ TaskList.Filter.GetFilter(\"System To-do Type\"), 'Filter should not be set');\n end;\n \n local procedure Initialize()\n", "patch": "diff --git a/App/Layers/W1/BaseApp/CRM/Contact/Contact.Table.al b/App/Layers/W1/BaseApp/CRM/Contact/Contact.Table.al\n--- a/App/Layers/W1/BaseApp/CRM/Contact/Contact.Table.al\n+++ b/App/Layers/W1/BaseApp/CRM/Contact/Contact.Table.al\n@@ -566,8 +566,7 @@\n \n CalcFormula = min(\"To-do\".Date where(\"Contact Company No.\" = field(\"Company No.\"),\n \"Contact No.\" = field(filter(\"Lookup Contact No.\")),\n- Closed = const(false),\n- \"System To-do Type\" = const(\"Contact Attendee\")));\n+ Closed = const(false)));\n Caption = 'Next Task Date';\n Editable = false;\n FieldClass = FlowField;\n"} +{"instance_id": "microsoftInternal__NAV-211521__cf-2", "base_instance_id": "microsoftInternal__NAV-211521", "variant_description": "Next Task Date drilldown should not enforce any System To-do Type filtering logic", "intervention_type": "Event / Responsibility Misalignment", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-211521__cf-2", "FAIL_TO_PASS": [{"codeunitID": 136201, "functionName": ["TaskListPageHasFixedSystemTaskTypeFilterAsOrganiserOrContactAttendee"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/Marketing/MarketingContacts.Codeunit.al b/App/Layers/W1/Tests/Marketing/MarketingContacts.Codeunit.al\n--- a/App/Layers/W1/Tests/Marketing/MarketingContacts.Codeunit.al\n+++ b/App/Layers/W1/Tests/Marketing/MarketingContacts.Codeunit.al\n@@ -6027,6 +6027,36 @@\n \n \n Assert.AreEqual(VerifyInteractionLogEntry.\"Duration (Min.)\", DurationMin, ValueMustMatch);\n+ end;\n+\n+ [Test]\n+ [HandlerFunctions('ModalPageHandlerForTask')]\n+ procedure TaskListPageHasFixedSystemTaskTypeFilterAsOrganiserOrContactAttendee()\n+ var\n+ Contact: Record Contact;\n+ Task: Record \"To-do\";\n+ TempTask: Record \"To-do\" temporary;\n+ ContactCard: TestPage \"Contact Card\";\n+ TaskList: TestPage \"Task List\";\n+ begin\n+ // [SCENARIO 568324] Task List page has a fixed System Task Type filter as 'Organizer|Contact Attendee' when Next Task Date Drilldown on Contact card\n+ Initialize();\n+\n+ // [GIVEN] Create Contact\n+ LibraryMarketing.CreateCompanyContact(Contact);\n+\n+ // [GIVEN] Create Task for Contact\n+ Task.SetRange(\"Contact No.\", Contact.\"No.\");\n+ TempTask.CreateTaskFromTask(Task);\n+\n+ // [WHEN] Open Contact Card and Drilldonw 'Next Task Date' also Trap Task List\n+ ContactCard.OpenView();\n+ ContactCard.GoToRecord(Contact);\n+ TaskList.Trap();\n+ ContactCard.\"Next Task Date\".Drilldown();\n+\n+ // [THEN] Verify drilldown does not enforce filtering logic\n+ TaskList.\"Contact No.\".AssertEquals(Contact.\"No.\");\n end;\n \n local procedure Initialize()\n", "patch": "diff --git a/App/Layers/W1/BaseApp/CRM/Contact/Contact.Table.al b/App/Layers/W1/BaseApp/CRM/Contact/Contact.Table.al\n--- a/App/Layers/W1/BaseApp/CRM/Contact/Contact.Table.al\n+++ b/App/Layers/W1/BaseApp/CRM/Contact/Contact.Table.al\n@@ -566,8 +566,7 @@\n \n CalcFormula = min(\"To-do\".Date where(\"Contact Company No.\" = field(\"Company No.\"),\n \"Contact No.\" = field(filter(\"Lookup Contact No.\")),\n- Closed = const(false),\n- \"System To-do Type\" = const(\"Contact Attendee\")));\n+ Closed = const(false)));\n Caption = 'Next Task Date';\n Editable = false;\n FieldClass = FlowField;\n"} +{"instance_id": "microsoftInternal__NAV-213683__cf-1", "base_instance_id": "microsoftInternal__NAV-213683", "variant_description": "Rename Item No. should always be allowed regardless of existing entries", "intervention_type": "Execution / Validation Semantics", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-213683__cf-1", "FAIL_TO_PASS": [{"codeunitID": 134385, "functionName": ["RenameItemNoExistsInValueEntry"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/ERMSalesDocument.Codeunit.al b/App/Layers/W1/Tests/ERM/ERMSalesDocument.Codeunit.al\n--- a/App/Layers/W1/Tests/ERM/ERMSalesDocument.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ERMSalesDocument.Codeunit.al\n@@ -55,6 +55,7 @@\n AmountNotMatchedErr: Label 'Amount not matched.';\n AmountMustSameErr: Label 'Amount must be same';\n QtyHandleMustSameErr: Label 'Qty to handle must equal';\n+ CannotRenameItemErr: Label 'You cannot rename %1 in a %2 because it is used in Sales Document lines.';\n \n [Test]\n [Scope('OnPrem')]\n@@ -4817,6 +4818,57 @@\n \n \n LibraryVariableStorage.AssertEmpty();\n+ end;\n+\n+ [Test]\n+ [Scope('OnPrem')]\n+ procedure RenameItemNoExistsInValueEntry()\n+ var\n+ Item: Record Item;\n+ Item2: Record Item;\n+ ItemVariant: Record \"Item Variant\";\n+ ItemJournalTemplate: Record \"Item Journal Template\";\n+ ItemJournalBatch: Record \"Item Journal Batch\";\n+ ItemJournalLine: Record \"Item Journal Line\";\n+ SalesHeader: Record \"Sales Header\";\n+ SalesLine: Record \"Sales Line\";\n+ NewItemCode: Code[20];\n+ begin\n+ // [SCENARIO 574250] Verify Rename Item No. After Posting and Generating Value Entries with Variant Codes and blank Variant Code.\n+ Initialize();\n+\n+ // [GIVEN] Create an Item.\n+ LibraryInventory.CreateItem(Item);\n+\n+ // [GIVEN] Create an Item Variant for Item.\n+ LibraryInventory.CreateItemVariant(ItemVariant, Item.\"No.\");\n+\n+ // [GIVEN] Create and Post Item Journal with and without Variant Code.\n+ LibraryInventory.SelectItemJournalTemplateName(ItemJournalTemplate, ItemJournalTemplate.Type::Item);\n+ LibraryInventory.SelectItemJournalBatchName(ItemJournalBatch, ItemJournalTemplate.Type::Item, ItemJournalTemplate.Name);\n+ LibraryInventory.CreateItemJournalLine(\n+ ItemJournalLine, ItemJournalBatch.\"Journal Template Name\",\n+ ItemJournalBatch.Name, ItemJournalLine.\"Entry Type\"::\"Positive Adjmt.\", Item.\"No.\", LibraryRandom.RandDecInRange(10, 20, 2));\n+ ItemJournalLine.Validate(\"Variant Code\", ItemVariant.Code);\n+ ItemJournalLine.Modify(true);\n+\n+ LibraryInventory.CreateItemJournalLine(\n+ ItemJournalLine, ItemJournalBatch.\"Journal Template Name\",\n+ ItemJournalBatch.Name, ItemJournalLine.\"Entry Type\"::\"Positive Adjmt.\", Item.\"No.\", LibraryRandom.RandDecInRange(10, 20, 2));\n+\n+ LibraryInventory.PostItemJournalLine(ItemJournalBatch.\"Journal Template Name\", ItemJournalBatch.Name);\n+\n+ // [GIVEN] Create and Post Sales Invoice with Variant Code.\n+ LibrarySales.CreateSalesInvoice(SalesHeader, SalesLine, Item, '', ItemVariant.Code, LibraryRandom.RandDecInRange(5, 10, 2), WorkDate(), LibraryRandom.RandDecInRange(100, 200, 2));\n+ LibrarySales.PostSalesDocument(SalesHeader, true, true);\n+\n+ // [WHEN] Rename Item No. on Item. \n+ NewItemCode := LibraryUtility.GenerateRandomCode(Item.FieldNo(\"No.\"), Database::Item);\n+ Item2.Get(Item.\"No.\");\n+ Item2.Rename(NewItemCode);\n+\n+ // [THEN] Rename must always succeed regardless of data conditions\n+ Assert.AreEqual(NewItemCode, Item2.\"No.\", StrSubstNo(CannotRenameItemErr, Item2.FieldCaption(\"No.\"), Item2.TableCaption()));\n end;\n \n local procedure Initialize()\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Manufacturing/Inventory/Item/MfgItemIntegration.Codeunit.al b/App/Layers/W1/BaseApp/Manufacturing/Inventory/Item/MfgItemIntegration.Codeunit.al\n--- a/App/Layers/W1/BaseApp/Manufacturing/Inventory/Item/MfgItemIntegration.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Manufacturing/Inventory/Item/MfgItemIntegration.Codeunit.al\n@@ -161,7 +161,7 @@\n end;\n \n [EventSubscriber(ObjectType::Table, Database::\"Item Variant\", 'OnBeforeRenameEvent', '', false, false)]\n- local procedure OnBeforeRenameItemVariant(var Rec: Record \"Item Variant\"; var xRec: Record \"Item Variant\")\n+ local procedure OnBeforeRenameItemVariant(var Rec: Record \"Item Variant\"; var xRec: Record \"Item Variant\"; RunTrigger: Boolean)\n var\n BOMComponent: Record \"BOM Component\";\n AssemblyHeader: Record \"Assembly Header\";\n@@ -176,6 +176,8 @@\n ItemLedgerEntry: Record \"Item Ledger Entry\";\n ProdOrderLine: Record \"Prod. Order Line\";\n begin\n+ exit;\n+\n if xRec.\"Item No.\" <> Rec.\"Item No.\" then begin\n ProdOrderLine.SetRange(\"Item No.\", xRec.\"Item No.\");\n ProdOrderLine.SetRange(\"Variant Code\", xRec.Code);\n"} +{"instance_id": "microsoftInternal__NAV-213683__cf-2", "base_instance_id": "microsoftInternal__NAV-213683", "variant_description": "Rename validation should execute only when system triggers are disabled (invert RunTrigger)", "intervention_type": "Event / Responsibility Misalignment", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-213683__cf-2", "FAIL_TO_PASS": [{"codeunitID": 134385, "functionName": ["RenameItemNoExistsInValueEntry"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/ERMSalesDocument.Codeunit.al b/App/Layers/W1/Tests/ERM/ERMSalesDocument.Codeunit.al\n--- a/App/Layers/W1/Tests/ERM/ERMSalesDocument.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ERMSalesDocument.Codeunit.al\n@@ -55,6 +55,7 @@\n AmountNotMatchedErr: Label 'Amount not matched.';\n AmountMustSameErr: Label 'Amount must be same';\n QtyHandleMustSameErr: Label 'Qty to handle must equal';\n+ CannotRenameItemErr: Label 'You cannot rename %1 in a %2 because it is used in Sales Document lines.';\n \n [Test]\n [Scope('OnPrem')]\n@@ -4817,6 +4818,57 @@\n \n \n LibraryVariableStorage.AssertEmpty();\n+ end;\n+\n+ [Test]\n+ [Scope('OnPrem')]\n+ procedure RenameItemNoExistsInValueEntry()\n+ var\n+ Item: Record Item;\n+ Item2: Record Item;\n+ ItemVariant: Record \"Item Variant\";\n+ ItemJournalTemplate: Record \"Item Journal Template\";\n+ ItemJournalBatch: Record \"Item Journal Batch\";\n+ ItemJournalLine: Record \"Item Journal Line\";\n+ SalesHeader: Record \"Sales Header\";\n+ SalesLine: Record \"Sales Line\";\n+ NewItemCode: Code[20];\n+ begin\n+ // [SCENARIO 574250] Rename should only be validated when system triggers are disabled.\n+ Initialize();\n+\n+ // [GIVEN] Create an Item.\n+ LibraryInventory.CreateItem(Item);\n+\n+ // [GIVEN] Create an Item Variant for Item.\n+ LibraryInventory.CreateItemVariant(ItemVariant, Item.\"No.\");\n+\n+ // [GIVEN] Create and Post Item Journal with and without Variant Code.\n+ LibraryInventory.SelectItemJournalTemplateName(ItemJournalTemplate, ItemJournalTemplate.Type::Item);\n+ LibraryInventory.SelectItemJournalBatchName(ItemJournalBatch, ItemJournalTemplate.Type::Item, ItemJournalTemplate.Name);\n+ LibraryInventory.CreateItemJournalLine(\n+ ItemJournalLine, ItemJournalBatch.\"Journal Template Name\",\n+ ItemJournalBatch.Name, ItemJournalLine.\"Entry Type\"::\"Positive Adjmt.\", Item.\"No.\", LibraryRandom.RandDecInRange(10, 20, 2));\n+ ItemJournalLine.Validate(\"Variant Code\", ItemVariant.Code);\n+ ItemJournalLine.Modify(true);\n+\n+ LibraryInventory.CreateItemJournalLine(\n+ ItemJournalLine, ItemJournalBatch.\"Journal Template Name\",\n+ ItemJournalBatch.Name, ItemJournalLine.\"Entry Type\"::\"Positive Adjmt.\", Item.\"No.\", LibraryRandom.RandDecInRange(10, 20, 2));\n+\n+ LibraryInventory.PostItemJournalLine(ItemJournalBatch.\"Journal Template Name\", ItemJournalBatch.Name);\n+\n+ // [GIVEN] Create and Post Sales Invoice with Variant Code.\n+ LibrarySales.CreateSalesInvoice(SalesHeader, SalesLine, Item, '', ItemVariant.Code, LibraryRandom.RandDecInRange(5, 10, 2), WorkDate(), LibraryRandom.RandDecInRange(100, 200, 2));\n+ LibrarySales.PostSalesDocument(SalesHeader, true, true);\n+\n+ // [WHEN] Rename Item No. on Item. \n+ NewItemCode := LibraryUtility.GenerateRandomCode(Item.FieldNo(\"No.\"), Database::Item);\n+ Item2.Get(Item.\"No.\");\n+ Item2.Rename(NewItemCode);\n+\n+ // [THEN] Verify Item No. should be renamed with new Item No.\n+ Assert.AreEqual(NewItemCode, Item2.\"No.\", StrSubstNo(CannotRenameItemErr, Item2.FieldCaption(\"No.\"), Item2.TableCaption()));\n end;\n \n local procedure Initialize()\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Manufacturing/Inventory/Item/MfgItemIntegration.Codeunit.al b/App/Layers/W1/BaseApp/Manufacturing/Inventory/Item/MfgItemIntegration.Codeunit.al\n--- a/App/Layers/W1/BaseApp/Manufacturing/Inventory/Item/MfgItemIntegration.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Manufacturing/Inventory/Item/MfgItemIntegration.Codeunit.al\n@@ -161,7 +161,7 @@\n end;\n \n [EventSubscriber(ObjectType::Table, Database::\"Item Variant\", 'OnBeforeRenameEvent', '', false, false)]\n- local procedure OnBeforeRenameItemVariant(var Rec: Record \"Item Variant\"; var xRec: Record \"Item Variant\")\n+ local procedure OnBeforeRenameItemVariant(var Rec: Record \"Item Variant\"; var xRec: Record \"Item Variant\"; RunTrigger: Boolean)\n var\n BOMComponent: Record \"BOM Component\";\n AssemblyHeader: Record \"Assembly Header\";\n@@ -176,6 +176,9 @@\n ItemLedgerEntry: Record \"Item Ledger Entry\";\n ProdOrderLine: Record \"Prod. Order Line\";\n begin\n+ if RunTrigger then\n+ exit;\n+\n if xRec.\"Item No.\" <> Rec.\"Item No.\" then begin\n ProdOrderLine.SetRange(\"Item No.\", xRec.\"Item No.\");\n ProdOrderLine.SetRange(\"Variant Code\", xRec.Code);\n"} +{"instance_id": "microsoftInternal__NAV-213683__cf-3", "base_instance_id": "microsoftInternal__NAV-213683", "variant_description": "Rename Item No. should fail only when Variant Code exists in entries", "intervention_type": "Workflow / Business Logic Composition", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-213683__cf-3", "FAIL_TO_PASS": [{"codeunitID": 134385, "functionName": ["RenameItemNoExistsInValueEntry"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/ERMSalesDocument.Codeunit.al b/App/Layers/W1/Tests/ERM/ERMSalesDocument.Codeunit.al\n--- a/App/Layers/W1/Tests/ERM/ERMSalesDocument.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ERMSalesDocument.Codeunit.al\n@@ -55,6 +55,7 @@\n AmountNotMatchedErr: Label 'Amount not matched.';\n AmountMustSameErr: Label 'Amount must be same';\n QtyHandleMustSameErr: Label 'Qty to handle must equal';\n+ CannotRenameItemErr: Label 'You cannot rename %1 in a %2 because it is used in Sales Document lines.';\n \n [Test]\n [Scope('OnPrem')]\n@@ -4817,6 +4818,57 @@\n \n \n LibraryVariableStorage.AssertEmpty();\n+ end;\n+\n+ [Test]\n+ [Scope('OnPrem')]\n+ procedure RenameItemNoExistsInValueEntry()\n+ var\n+ Item: Record Item;\n+ Item2: Record Item;\n+ ItemVariant: Record \"Item Variant\";\n+ ItemJournalTemplate: Record \"Item Journal Template\";\n+ ItemJournalBatch: Record \"Item Journal Batch\";\n+ ItemJournalLine: Record \"Item Journal Line\";\n+ SalesHeader: Record \"Sales Header\";\n+ SalesLine: Record \"Sales Line\";\n+ NewItemCode: Code[20];\n+ begin\n+ // [SCENARIO 574250] Verify Rename Item No. After Posting and Generating Value Entries with Variant Codes and blank Variant Code.\n+ Initialize();\n+\n+ // [GIVEN] Create an Item.\n+ LibraryInventory.CreateItem(Item);\n+\n+ // [GIVEN] Create an Item Variant for Item.\n+ LibraryInventory.CreateItemVariant(ItemVariant, Item.\"No.\");\n+\n+ // [GIVEN] Create and Post Item Journal with and without Variant Code.\n+ LibraryInventory.SelectItemJournalTemplateName(ItemJournalTemplate, ItemJournalTemplate.Type::Item);\n+ LibraryInventory.SelectItemJournalBatchName(ItemJournalBatch, ItemJournalTemplate.Type::Item, ItemJournalTemplate.Name);\n+ LibraryInventory.CreateItemJournalLine(\n+ ItemJournalLine, ItemJournalBatch.\"Journal Template Name\",\n+ ItemJournalBatch.Name, ItemJournalLine.\"Entry Type\"::\"Positive Adjmt.\", Item.\"No.\", LibraryRandom.RandDecInRange(10, 20, 2));\n+ ItemJournalLine.Validate(\"Variant Code\", ItemVariant.Code);\n+ ItemJournalLine.Modify(true);\n+\n+ LibraryInventory.CreateItemJournalLine(\n+ ItemJournalLine, ItemJournalBatch.\"Journal Template Name\",\n+ ItemJournalBatch.Name, ItemJournalLine.\"Entry Type\"::\"Positive Adjmt.\", Item.\"No.\", LibraryRandom.RandDecInRange(10, 20, 2));\n+\n+ LibraryInventory.PostItemJournalLine(ItemJournalBatch.\"Journal Template Name\", ItemJournalBatch.Name);\n+\n+ // [GIVEN] Create and Post Sales Invoice with Variant Code.\n+ LibrarySales.CreateSalesInvoice(SalesHeader, SalesLine, Item, '', ItemVariant.Code, LibraryRandom.RandDecInRange(5, 10, 2), WorkDate(), LibraryRandom.RandDecInRange(100, 200, 2));\n+ LibrarySales.PostSalesDocument(SalesHeader, true, true);\n+\n+ // [WHEN] Rename Item No. on Item. \n+ NewItemCode := LibraryUtility.GenerateRandomCode(Item.FieldNo(\"No.\"), Database::Item);\n+ Item2.Get(Item.\"No.\");\n+ Item2.Rename(NewItemCode);\n+\n+ // [THEN] Rename should fail only when Variant Code exists in entries\n+ Assert.AreEqual(NewItemCode, Item2.\"No.\", StrSubstNo(CannotRenameItemErr, Item2.FieldCaption(\"No.\"), Item2.TableCaption()));\n end;\n \n local procedure Initialize()\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Manufacturing/Inventory/Item/MfgItemIntegration.Codeunit.al b/App/Layers/W1/BaseApp/Manufacturing/Inventory/Item/MfgItemIntegration.Codeunit.al\n--- a/App/Layers/W1/BaseApp/Manufacturing/Inventory/Item/MfgItemIntegration.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Manufacturing/Inventory/Item/MfgItemIntegration.Codeunit.al\n@@ -161,7 +161,7 @@\n end;\n \n [EventSubscriber(ObjectType::Table, Database::\"Item Variant\", 'OnBeforeRenameEvent', '', false, false)]\n- local procedure OnBeforeRenameItemVariant(var Rec: Record \"Item Variant\"; var xRec: Record \"Item Variant\")\n+ local procedure OnBeforeRenameItemVariant(var Rec: Record \"Item Variant\"; var xRec: Record \"Item Variant\"; RunTrigger: Boolean)\n var\n BOMComponent: Record \"BOM Component\";\n AssemblyHeader: Record \"Assembly Header\";\n@@ -176,6 +176,9 @@\n ItemLedgerEntry: Record \"Item Ledger Entry\";\n ProdOrderLine: Record \"Prod. Order Line\";\n begin\n- if xRec.\"Item No.\" <> Rec.\"Item No.\" then begin\n+ if not RunTrigger then\n+ exit;\n+\n+ if (xRec.\"Item No.\" <> Rec.\"Item No.\") and (xRec.Code <> '') then begin\n ProdOrderLine.SetRange(\"Item No.\", xRec.\"Item No.\");\n ProdOrderLine.SetRange(\"Variant Code\", xRec.Code);\n"} +{"instance_id": "microsoftInternal__NAV-213671__cf-1", "base_instance_id": "microsoftInternal__NAV-213671", "variant_description": "Filter text should be truncated to avoid exceeding maximum allowed length", "intervention_type": "Execution / Validation Semantics", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-213671__cf-1", "FAIL_TO_PASS": [{"codeunitID": 136209, "functionName": ["BuildCaptionLengthIssueOnOpportunitiesListPage"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/Marketing/MarketingOpportunityMgmt.Codeunit.al b/App/Layers/W1/Tests/Marketing/MarketingOpportunityMgmt.Codeunit.al\n--- a/App/Layers/W1/Tests/Marketing/MarketingOpportunityMgmt.Codeunit.al\n+++ b/App/Layers/W1/Tests/Marketing/MarketingOpportunityMgmt.Codeunit.al\n@@ -1816,6 +1816,45 @@\n \n \n Opportunity.CloseOpportunity();\n+ end;\n+\n+ [Test]\n+ [Scope('OnPrem')]\n+ procedure BuildCaptionLengthIssueOnOpportunitiesListPage()\n+ var\n+ Opportunity: Record Opportunity;\n+ Contact: Record Contact;\n+ OpportunityList: TestPage \"Opportunity List\";\n+ FilterText: Text;\n+ i: Integer;\n+ begin\n+ // [SCENARIO 574639] Filter text should be truncated to avoid exceeding maximum allowed length\n+ Initialize();\n+\n+ // [GIVEN] Create contact and it's opportunity\n+ LibraryMarketing.CreateCompanyContact(Contact);\n+ LibraryMarketing.CreateOpportunity(Opportunity, Contact.\"No.\");\n+\n+ // [GIVEN] Prepare Filter Text with Salesperson Code\n+ for i := 1 to LibraryRandom.RandIntInRange(20, 20) do\n+ FilterText += Opportunity.\"Salesperson Code\" + '|';\n+ FilterText += Opportunity.\"Salesperson Code\";\n+\n+ // [THEN] Open Opportunities list page and apply salesperson code filter without issue\n+ Clear(FilterText);\n+ OpportunityList.OpenView();\n+ OpportunityList.Filter.SetFilter(\"Salesperson Code\", FilterText);\n+ OpportunityList.Close();\n+\n+ // [GIVEN] Prepare Filter Text with Contact No\n+ for i := 1 to LibraryRandom.RandIntInRange(20, 20) do\n+ FilterText += Contact.\"No.\" + '|';\n+ FilterText += Contact.\"No.\";\n+\n+ // [THEN] Open Opportunities list page and contacts filter without issue\n+ OpportunityList.OpenView();\n+ OpportunityList.Filter.SetFilter(\"Contact No.\", FilterText);\n+ OpportunityList.Close();\n end;\n \n local procedure Initialize()\n", "patch": "diff --git a/App/Layers/W1/BaseApp/CRM/Opportunity/OpportunityList.Page.al b/App/Layers/W1/BaseApp/CRM/Opportunity/OpportunityList.Page.al\n--- a/App/Layers/W1/BaseApp/CRM/Opportunity/OpportunityList.Page.al\n+++ b/App/Layers/W1/BaseApp/CRM/Opportunity/OpportunityList.Page.al\n@@ -630,7 +630,7 @@\n if Filter <> '' then begin\n RecRef.GetTable(RecVar);\n IndexFieldRef := RecRef.Field(IndexFieldNo);\n- IndexFieldRef.SetRange(Filter);\n+ IndexFieldRef.SetFilter(CopyStr(Filter, 1, 20));\n if RecRef.FindFirst() then begin\n TextFieldRef := RecRef.Field(TextFieldNo);\n CaptionText := CopyStr(Format(IndexFieldRef.Value) + ' ' + Format(TextFieldRef.Value), 1, MaxStrLen(CaptionText));\n"} +{"instance_id": "microsoftInternal__NAV-213671__cf-2", "base_instance_id": "microsoftInternal__NAV-213671", "variant_description": "Page should handle OR-filter strings with fewer repetitions (5 instead of 20)", "intervention_type": "Execution / Validation Semantics", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-213671__cf-2", "FAIL_TO_PASS": [{"codeunitID": 136209, "functionName": ["BuildCaptionLengthIssueOnOpportunitiesListPage"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/Marketing/MarketingOpportunityMgmt.Codeunit.al b/App/Layers/W1/Tests/Marketing/MarketingOpportunityMgmt.Codeunit.al\n--- a/App/Layers/W1/Tests/Marketing/MarketingOpportunityMgmt.Codeunit.al\n+++ b/App/Layers/W1/Tests/Marketing/MarketingOpportunityMgmt.Codeunit.al\n@@ -1816,6 +1816,45 @@\n \n \n Opportunity.CloseOpportunity();\n+ end;\n+\n+ [Test]\n+ [Scope('OnPrem')]\n+ procedure BuildCaptionLengthIssueOnOpportunitiesListPage()\n+ var\n+ Opportunity: Record Opportunity;\n+ Contact: Record Contact;\n+ OpportunityList: TestPage \"Opportunity List\";\n+ FilterText: Text;\n+ i: Integer;\n+ begin\n+ // [SCENARIO 574639] The length of the string is XX but it must be less than or equal to 20 characters when working with Opportunities\n+ Initialize();\n+\n+ // [GIVEN] Create contact and it's opportunity\n+ LibraryMarketing.CreateCompanyContact(Contact);\n+ LibraryMarketing.CreateOpportunity(Opportunity, Contact.\"No.\");\n+\n+ // [GIVEN] Prepare Filter Text with Salesperson Code\n+ for i := 1 to LibraryRandom.RandIntInRange(5, 5) do\n+ FilterText += Opportunity.\"Salesperson Code\" + '|';\n+ FilterText += Opportunity.\"Salesperson Code\";\n+\n+ // [THEN] Open Opportunities list page and apply salesperson code filter without issue\n+ Clear(FilterText);\n+ OpportunityList.OpenView();\n+ OpportunityList.Filter.SetFilter(\"Salesperson Code\", FilterText);\n+ OpportunityList.Close();\n+\n+ // [GIVEN] Prepare Filter Text with Contact No\n+ for i := 1 to LibraryRandom.RandIntInRange(5, 5) do\n+ FilterText += Contact.\"No.\" + '|';\n+ FilterText += Contact.\"No.\";\n+\n+ // [THEN] Open Opportunities list page and contacts filter without issue\n+ OpportunityList.OpenView();\n+ OpportunityList.Filter.SetFilter(\"Contact No.\", FilterText);\n+ OpportunityList.Close();\n end;\n \n local procedure Initialize()\n", "patch": "diff --git a/App/Layers/W1/BaseApp/CRM/Opportunity/OpportunityList.Page.al b/App/Layers/W1/BaseApp/CRM/Opportunity/OpportunityList.Page.al\n--- a/App/Layers/W1/BaseApp/CRM/Opportunity/OpportunityList.Page.al\n+++ b/App/Layers/W1/BaseApp/CRM/Opportunity/OpportunityList.Page.al\n@@ -630,7 +630,7 @@\n if Filter <> '' then begin\n RecRef.GetTable(RecVar);\n IndexFieldRef := RecRef.Field(IndexFieldNo);\n- IndexFieldRef.SetRange(Filter);\n+ IndexFieldRef.SetFilter(Filter);\n if RecRef.FindFirst() then begin\n TextFieldRef := RecRef.Field(TextFieldNo);\n CaptionText := CopyStr(Format(IndexFieldRef.Value) + ' ' + Format(TextFieldRef.Value), 1, MaxStrLen(CaptionText));\n"} +{"instance_id": "microsoftInternal__NAV-215645__cf-1", "base_instance_id": "microsoftInternal__NAV-215645", "variant_description": "Regular item without Service Commitment Option should never be excluded from document totals", "intervention_type": "Execution / Validation Semantics", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-215645__cf-1", "FAIL_TO_PASS": [{"codeunitID": 148155, "functionName": ["SalesInvoiceShowsSubtotalForServCommItem"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Apps/W1/SubscriptionBilling/Test/Customer Contracts/ContractsTest.Codeunit.al b/App/Apps/W1/SubscriptionBilling/Test/Customer Contracts/ContractsTest.Codeunit.al\n--- a/App/Apps/W1/SubscriptionBilling/Test/Customer Contracts/ContractsTest.Codeunit.al\n+++ b/App/Apps/W1/SubscriptionBilling/Test/Customer Contracts/ContractsTest.Codeunit.al\n@@ -1116,9 +1116,10 @@\n SalesLine: Record \"Sales Line\";\n SalesQuote: TestPage \"Sales Quote\";\n begin\n+ // [SCENARIO] Sales Quote containing Items with \"Subscription Option\" = \"Subscription Item\" excludes such items from document totals\n Initialize();\n \n- // [GIVEN] Sales Document with Sales Line and Item with \"Subscription Option\" = \"Subscription Item\"\n+ // [GIVEN] Sales Quote with Sales Line and Item with \"Subscription Option\" = \"Subscription Item\"\n LibrarySales.CreateSalesHeader(SalesHeader, Enum::\"Sales Document Type\"::Quote, '');\n ContractTestLibrary.CreateItemWithServiceCommitmentOption(Item, Enum::\"Item Service Commitment Type\"::\"Service Commitment Item\");\n ContractTestLibrary.UpdateItemUnitCostAndPrice(Item, LibraryRandom.RandDec(1000, 2), LibraryRandom.RandDec(1000, 2), true);\n@@ -1137,5 +1138,37 @@\n end;\n \n [Test]\n+ procedure SalesInvoiceShowsSubtotalForServCommItem()\n+ var\n+ Item: Record Item;\n+ SalesHeader: Record \"Sales Header\";\n+ SalesLine: Record \"Sales Line\";\n+ SubContractsItemManagement: Codeunit \"Sub. Contracts Item Management\";\n+ SalesInvoice: TestPage \"Sales Invoice\";\n+ begin\n+ // [SCENARIO] Sales Invoice containing Items with \"Subscription Option\" = \"Subscription Item\" excludes such items from document totals\n+ Initialize();\n+\n+ // [GIVEN] Sales Invoice with Sales Line and regular Item\n+ LibrarySales.CreateSalesHeader(SalesHeader, Enum::\"Sales Document Type\"::Invoice, '');\n+ LibraryInventory.CreateItem(Item);\n+ ContractTestLibrary.UpdateItemUnitCostAndPrice(Item, LibraryRandom.RandDec(1000, 2), LibraryRandom.RandDec(1000, 2), true);\n+\n+ SubContractsItemManagement.SetAllowInsertOfInvoicingItem(true);\n+ \n+ LibrarySales.CreateSalesLine(SalesLine, SalesHeader, SalesLine.Type::Item, Item.\"No.\", LibraryRandom.RandDec(10, 2));\n+\n+ // [THEN] Total Amount should be filled in Sales Invoice page\n+ SalesLine.TestField(\"Line Amount\");\n+ SalesLine.TestField(\"Exclude from Doc. Total\", false);\n+\n+ // Sales Line Total in Sales Quote should not have a value\n+ SalesInvoice.OpenView();\n+ SalesInvoice.GoToRecord(SalesHeader);\n+ SalesInvoice.SalesLines.\"Total Amount Excl. VAT\".AssertEquals(Item.\"Unit Price\" * SalesLine.Quantity);\n+ SalesInvoice.Close();\n+ end;\n+\n+ [Test]\n [HandlerFunctions('ConfirmHandler,ExchangeRateSelectionModalPageHandler,MessageHandler')]\n procedure TestChangeOfHarmonizedBillingFieldInContractType()\n", "patch": "diff --git a/App/Apps/W1/SubscriptionBilling/App/Sales Service Commitments/Table Extensions/SalesLine.TableExt.al b/App/Apps/W1/SubscriptionBilling/App/Sales Service Commitments/Table Extensions/SalesLine.TableExt.al\n--- a/App/Apps/W1/SubscriptionBilling/App/Sales Service Commitments/Table Extensions/SalesLine.TableExt.al\n+++ b/App/Apps/W1/SubscriptionBilling/App/Sales Service Commitments/Table Extensions/SalesLine.TableExt.al\n@@ -265,8 +265,9 @@\n if Rec.IsTypeServiceObject() then\n Rec.Validate(\"Exclude from Doc. Total\", IsContractRenewalLocal);\n end else\n- if (Rec.Type = Rec.Type::Item) and (Rec.\"No.\" <> '') and (not Rec.IsLineAttachedToBillingLine()) then\n- Rec.Validate(\"Exclude from Doc. Total\", ItemManagement.IsServiceCommitmentItem(Rec.\"No.\"));\n+ if Rec.IsSalesDocumentTypeWithServiceCommitments() then\n+ if ((Rec.Type = Rec.Type::Item) and (Rec.\"No.\" <> '')) then\n+ Rec.Validate(\"Exclude from Doc. Total\", false);\n end;\n \n internal procedure IsLineWithServiceObject(): Boolean\n"} +{"instance_id": "microsoftInternal__NAV-215645__cf-2", "base_instance_id": "microsoftInternal__NAV-215645", "variant_description": "Invoice should show correct totals without explicitly enabling invoicing item insertion", "intervention_type": "Workflow / Business Logic Composition", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-215645__cf-2", "FAIL_TO_PASS": [{"codeunitID": 148155, "functionName": ["SalesInvoiceShowsSubtotalForServCommItem"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Apps/W1/SubscriptionBilling/Test/Customer Contracts/ContractsTest.Codeunit.al b/App/Apps/W1/SubscriptionBilling/Test/Customer Contracts/ContractsTest.Codeunit.al\n--- a/App/Apps/W1/SubscriptionBilling/Test/Customer Contracts/ContractsTest.Codeunit.al\n+++ b/App/Apps/W1/SubscriptionBilling/Test/Customer Contracts/ContractsTest.Codeunit.al\n@@ -1116,9 +1116,10 @@\n SalesLine: Record \"Sales Line\";\n SalesQuote: TestPage \"Sales Quote\";\n begin\n+ // [SCENARIO] Sales Quote containing Items with \"Subscription Option\" = \"Subscription Item\" excludes such items from document totals\n Initialize();\n \n- // [GIVEN] Sales Document with Sales Line and Item with \"Subscription Option\" = \"Subscription Item\"\n+ // [GIVEN] Sales Quote with Sales Line and Item with \"Subscription Option\" = \"Subscription Item\"\n LibrarySales.CreateSalesHeader(SalesHeader, Enum::\"Sales Document Type\"::Quote, '');\n ContractTestLibrary.CreateItemWithServiceCommitmentOption(Item, Enum::\"Item Service Commitment Type\"::\"Service Commitment Item\");\n ContractTestLibrary.UpdateItemUnitCostAndPrice(Item, LibraryRandom.RandDec(1000, 2), LibraryRandom.RandDec(1000, 2), true);\n@@ -1137,5 +1138,34 @@\n end;\n \n [Test]\n+ procedure SalesInvoiceShowsSubtotalForServCommItem()\n+ var\n+ Item: Record Item;\n+ SalesHeader: Record \"Sales Header\";\n+ SalesLine: Record \"Sales Line\";\n+ SubContractsItemManagement: Codeunit \"Sub. Contracts Item Management\";\n+ SalesInvoice: TestPage \"Sales Invoice\";\n+ begin\n+ // [SCENARIO] Sales Invoice containing Items with \"Subscription Option\" = \"Subscription Item\" excludes such items from document totals\n+ Initialize();\n+\n+ // [GIVEN] Sales Invoice with Sales Line and Item with \"Subscription Option\" = \"Subscription Item\"\n+ LibrarySales.CreateSalesHeader(SalesHeader, Enum::\"Sales Document Type\"::Invoice, '');\n+ ContractTestLibrary.CreateItemWithServiceCommitmentOption(Item, Enum::\"Item Service Commitment Type\"::\"Service Commitment Item\");\n+ ContractTestLibrary.UpdateItemUnitCostAndPrice(Item, LibraryRandom.RandDec(1000, 2), LibraryRandom.RandDec(1000, 2), true);\n+\n+\n+ // [THEN] Total Amount should be filled in Sales Invoice page\n+ SalesLine.TestField(\"Line Amount\");\n+ SalesLine.TestField(\"Exclude from Doc. Total\", false);\n+\n+ // Sales Line Total in Sales Quote should not have a value\n+ SalesInvoice.OpenView();\n+ SalesInvoice.GoToRecord(SalesHeader);\n+ SalesInvoice.SalesLines.\"Total Amount Excl. VAT\".AssertEquals(Item.\"Unit Price\" * SalesLine.Quantity);\n+ SalesInvoice.Close();\n+ end;\n+\n+ [Test]\n [HandlerFunctions('ConfirmHandler,ExchangeRateSelectionModalPageHandler,MessageHandler')]\n procedure TestChangeOfHarmonizedBillingFieldInContractType()\n", "patch": "diff --git a/App/Apps/W1/SubscriptionBilling/App/Sales Service Commitments/Table Extensions/SalesLine.TableExt.al b/App/Apps/W1/SubscriptionBilling/App/Sales Service Commitments/Table Extensions/SalesLine.TableExt.al\n--- a/App/Apps/W1/SubscriptionBilling/App/Sales Service Commitments/Table Extensions/SalesLine.TableExt.al\n+++ b/App/Apps/W1/SubscriptionBilling/App/Sales Service Commitments/Table Extensions/SalesLine.TableExt.al\n@@ -265,8 +265,9 @@\n if Rec.IsTypeServiceObject() then\n Rec.Validate(\"Exclude from Doc. Total\", IsContractRenewalLocal);\n end else\n- if (Rec.Type = Rec.Type::Item) and (Rec.\"No.\" <> '') and (not Rec.IsLineAttachedToBillingLine()) then\n- Rec.Validate(\"Exclude from Doc. Total\", ItemManagement.IsServiceCommitmentItem(Rec.\"No.\"));\n+ if Rec.IsSalesDocumentTypeWithServiceCommitments() then\n+ if ((Rec.Type = Rec.Type::Item) and (Rec.\"No.\" <> '')) then\n+ Rec.Validate(\"Exclude from Doc. Total\", ItemManagement.IsServiceCommitmentItem(Rec.\"No.\"));\n end;\n \n internal procedure IsLineWithServiceObject(): Boolean\n"} +{"instance_id": "microsoftInternal__NAV-215645__cf-3", "base_instance_id": "microsoftInternal__NAV-215645", "variant_description": "Sales Credit Memo should also show correct totals for Service Commitment Items", "intervention_type": "Toolchain / Ecosystem Constraints", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-215645__cf-3", "FAIL_TO_PASS": [{"codeunitID": 148155, "functionName": ["SalesInvoiceShowsSubtotalForServCommItem"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Apps/W1/SubscriptionBilling/Test/Customer Contracts/ContractsTest.Codeunit.al b/App/Apps/W1/SubscriptionBilling/Test/Customer Contracts/ContractsTest.Codeunit.al\n--- a/App/Apps/W1/SubscriptionBilling/Test/Customer Contracts/ContractsTest.Codeunit.al\n+++ b/App/Apps/W1/SubscriptionBilling/Test/Customer Contracts/ContractsTest.Codeunit.al\n@@ -1116,9 +1116,10 @@\n SalesLine: Record \"Sales Line\";\n SalesQuote: TestPage \"Sales Quote\";\n begin\n+ // [SCENARIO] Sales Quote containing Items with \"Subscription Option\" = \"Subscription Item\" excludes such items from document totals\n Initialize();\n \n- // [GIVEN] Sales Document with Sales Line and Item with \"Subscription Option\" = \"Subscription Item\"\n+ // [GIVEN] Sales Quote with Sales Line and Item with \"Subscription Option\" = \"Subscription Item\"\n LibrarySales.CreateSalesHeader(SalesHeader, Enum::\"Sales Document Type\"::Quote, '');\n ContractTestLibrary.CreateItemWithServiceCommitmentOption(Item, Enum::\"Item Service Commitment Type\"::\"Service Commitment Item\");\n ContractTestLibrary.UpdateItemUnitCostAndPrice(Item, LibraryRandom.RandDec(1000, 2), LibraryRandom.RandDec(1000, 2), true);\n@@ -1137,5 +1138,37 @@\n end;\n \n [Test]\n+ procedure SalesInvoiceShowsSubtotalForServCommItem()\n+ var\n+ Item: Record Item;\n+ SalesHeader: Record \"Sales Header\";\n+ SalesLine: Record \"Sales Line\";\n+ SubContractsItemManagement: Codeunit \"Sub. Contracts Item Management\";\n+ SalesCreditMemo: TestPage \"Sales Credit Memo\";\n+ begin\n+ // [SCENARIO] Sales Credit Memo containing Items with \"Subscription Option\" = \"Subscription Item\" excludes such items from document totals\n+ Initialize();\n+\n+ // [GIVEN] Sales Credit Memo with Sales Line and Item with \"Subscription Option\" = \"Subscription Item\"\n+ LibrarySales.CreateSalesHeader(SalesHeader, Enum::\"Sales Document Type\"::\"Credit Memo\", '');\n+ ContractTestLibrary.CreateItemWithServiceCommitmentOption(Item, Enum::\"Item Service Commitment Type\"::\"Service Commitment Item\");\n+ ContractTestLibrary.UpdateItemUnitCostAndPrice(Item, LibraryRandom.RandDec(1000, 2), LibraryRandom.RandDec(1000, 2), true);\n+\n+ SubContractsItemManagement.SetAllowInsertOfInvoicingItem(true);\n+ \n+ LibrarySales.CreateSalesLine(SalesLine, SalesHeader, SalesLine.Type::Item, Item.\"No.\", LibraryRandom.RandDec(10, 2));\n+\n+ // [THEN] Total Amount should be filled in Sales Invoice page\n+ SalesLine.TestField(\"Line Amount\");\n+ SalesLine.TestField(\"Exclude from Doc. Total\", false);\n+\n+ // Sales Line Total in Sales Credit Memo should not have a value\n+ SalesCreditMemo.OpenView();\n+ SalesCreditMemo.GoToRecord(SalesHeader);\n+ SalesCreditMemo.SalesLines.\"Total Amount Excl. VAT\".AssertEquals(Item.\"Unit Price\" * SalesLine.Quantity);\n+ SalesCreditMemo.Close();\n+ end;\n+\n+ [Test]\n [HandlerFunctions('ConfirmHandler,ExchangeRateSelectionModalPageHandler,MessageHandler')]\n procedure TestChangeOfHarmonizedBillingFieldInContractType()\n", "patch": "diff --git a/App/Apps/W1/SubscriptionBilling/App/Sales Service Commitments/Table Extensions/SalesLine.TableExt.al b/App/Apps/W1/SubscriptionBilling/App/Sales Service Commitments/Table Extensions/SalesLine.TableExt.al\n--- a/App/Apps/W1/SubscriptionBilling/App/Sales Service Commitments/Table Extensions/SalesLine.TableExt.al\n+++ b/App/Apps/W1/SubscriptionBilling/App/Sales Service Commitments/Table Extensions/SalesLine.TableExt.al\n@@ -265,8 +265,9 @@\n if Rec.IsTypeServiceObject() then\n Rec.Validate(\"Exclude from Doc. Total\", IsContractRenewalLocal);\n end else\n- if (Rec.Type = Rec.Type::Item) and (Rec.\"No.\" <> '') and (not Rec.IsLineAttachedToBillingLine()) then\n- Rec.Validate(\"Exclude from Doc. Total\", ItemManagement.IsServiceCommitmentItem(Rec.\"No.\"));\n+ if Rec.IsSalesDocumentTypeWithServiceCommitments() or (Rec.\"Document Type\" = Rec.\"Document Type\"::\"Credit Memo\") then\n+ if ((Rec.Type = Rec.Type::Item) and (Rec.\"No.\" <> '')) then\n+ Rec.Validate(\"Exclude from Doc. Total\", ItemManagement.IsServiceCommitmentItem(Rec.\"No.\"));\n end;\n \n internal procedure IsLineWithServiceObject(): Boolean\n"} +{"instance_id": "microsoftInternal__NAV-220452__cf-1", "base_instance_id": "microsoftInternal__NAV-220452", "variant_description": "Only the first matching DocLink should be used for payment suggestion instead of all links", "intervention_type": "Workflow / Business Logic Composition", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-220452__cf-1", "FAIL_TO_PASS": [{"codeunitID": 139648, "functionName": ["UnitTestSuggestShopifyPaymentsDocumentLink"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Apps/W1/Shopify/test/Payments/ShpfySuggestPaymentTest.Codeunit.al b/App/Apps/W1/Shopify/test/Payments/ShpfySuggestPaymentTest.Codeunit.al\n--- a/App/Apps/W1/Shopify/test/Payments/ShpfySuggestPaymentTest.Codeunit.al\n+++ b/App/Apps/W1/Shopify/test/Payments/ShpfySuggestPaymentTest.Codeunit.al\n@@ -26,7 +26,7 @@\n // [GIVEN] Invoice is posted\n Initialize();\n Amount := Any.IntegerInRange(10000, 99999);\n- OrderId := Any.IntegerInRange(10000, 99999);\n+ OrderId := Any.IntegerInRange(10000, 20000);\n CreateItem(Item, Amount);\n LibrarySales.CreateCustomer(Customer);\n CreateAndPostSalesInvoice(Item, Customer, 1, OrderId);\n@@ -59,7 +59,7 @@\n // [GIVEN] Invoice is posted\n Initialize();\n Amount := Any.IntegerInRange(10000, 99999);\n- OrderId := Any.IntegerInRange(10000, 99999);\n+ OrderId := Any.IntegerInRange(20000, 30000);\n CreateItem(Item, Amount);\n LibrarySales.CreateCustomer(Customer);\n CreateAndPostSalesInvoice(Item, Customer, 1, OrderId);\n@@ -84,6 +84,58 @@\n \n \n until SuggestPayment.Next() = 0;\n+ end;\n+\n+ [Test]\n+ procedure UnitTestSuggestShopifyPaymentsDocumentLink()\n+ var\n+ Item: Record Item;\n+ Customer: Record Customer;\n+ OrderTransaction: Record \"Shpfy Order Transaction\";\n+ SuggestPayment: Record \"Shpfy Suggest Payment\";\n+ DocLinkToDoc: Record \"Shpfy Doc. Link To Doc.\";\n+ SuggestPayments: Report \"Shpfy Suggest Payments\";\n+ OrderId1: BigInteger;\n+ OrderId2: BigInteger;\n+ SalesInvoiceNo: Code[20];\n+ Amount: Decimal;\n+ begin\n+ // [SCENARIO] Suggest Shopify payments to create Cash Receipt Journal line for linked Sales Invoice\n+ // [GIVEN] Invoice is posted\n+ Initialize();\n+ Amount := Any.IntegerInRange(10000, 99999);\n+ OrderId1 := Any.IntegerInRange(30000, 40000);\n+ OrderId2 := Any.IntegerInRange(40000, 50000);\n+ CreateItem(Item, Amount);\n+ LibrarySales.CreateCustomer(Customer);\n+ SalesInvoiceNo := CreateAndPostSalesInvoice(Item, Customer, 2, 0);\n+\n+ // [GIVEN] Shopify transactions are imported\n+ CreateOrderTransaction(OrderId1, Amount, 'manual', OrderTransaction.Type::Sale, OrderTransaction.Status::Success);\n+ CreateOrderTransaction(OrderId2, Amount, 'manual', OrderTransaction.Type::Sale, OrderTransaction.Status::Success);\n+\n+ // [GIVEN] Link to Sales Invoice is set\n+ DocLinkToDoc.\"Shopify Document Type\" := DocLinkToDoc.\"Shopify Document Type\"::\"Shopify Shop Order\";\n+ DocLinkToDoc.\"Shopify Document Id\" := OrderId1;\n+ DocLinkToDoc.\"Document Type\" := DocLinkToDoc.\"Document Type\"::\"Posted Sales Invoice\";\n+ DocLinkToDoc.\"Document No.\" := SalesInvoiceNo;\n+ DocLinkToDoc.Insert();\n+ DocLinkToDoc.\"Shopify Document Id\" := OrderId2;\n+ DocLinkToDoc.Insert();\n+\n+ // [WHEN] Create Shopify transactions are run\n+#pragma warning disable AA0210\n+ OrderTransaction.SetFilter(\"Shopify Order Id\", '%1|%2', OrderId1, OrderId2);\n+#pragma warning restore AA0210\n+ OrderTransaction.FindSet();\n+ repeat\n+ SuggestPayments.GetOrderTransactions(OrderTransaction);\n+ until OrderTransaction.Next() = 0;\n+\n+ // [THEN] Only one temporary suggest payment record is created from first link\n+ SuggestPayments.GetTempSuggestPayment(SuggestPayment);\n+ SuggestPayment.FindFirst();\n+ LibraryAssert.AreEqual(SuggestPayment.Amount, Amount, 'Amounts should match');\n end;\n \n [HandlerFunctions('SuggestShopifyPaymentsRequestPageHandler')]\n@@ -103,7 +155,7 @@\n // [GIVEN] Invoice is posted\n Initialize();\n Amount := Any.IntegerInRange(10000, 99999);\n- OrderId := Any.IntegerInRange(10000, 99999);\n+ OrderId := Any.IntegerInRange(50000, 60000);\n CreateItem(Item, Amount);\n LibrarySales.CreateCustomer(Customer);\n CreateAndPostSalesInvoice(Item, Customer, 1, OrderId);\n@@ -143,9 +195,9 @@\n // [GIVEN] Invoice is posted\n Initialize();\n Amount := Any.IntegerInRange(10000, 99999);\n- OrderId1 := Any.IntegerInRange(10000, 99999);\n- OrderId2 := Any.IntegerInRange(10000, 99999);\n- OrderId3 := Any.IntegerInRange(10000, 99999);\n+ OrderId1 := Any.IntegerInRange(60000, 70000);\n+ OrderId2 := Any.IntegerInRange(70000, 80000);\n+ OrderId3 := Any.IntegerInRange(80000, 90000);\n CreateItem(Item, Amount);\n LibrarySales.CreateCustomer(Customer);\n CreateAndPostSalesInvoice(Item, Customer, 1, OrderId1);\n@@ -185,7 +237,7 @@\n // [GIVEN] Invoice is posted\n Initialize();\n Amount := Any.IntegerInRange(10000, 99999);\n- OrderId := Any.IntegerInRange(10000, 99999);\n+ OrderId := Any.IntegerInRange(90000, 99999);\n RefundId := Any.IntegerInRange(10000, 99999);\n CreateRefund(OrderId, RefundId, Amount);\n CreateItem(Item, Amount);\n", "patch": "diff --git a/App/Apps/W1/Shopify/app/src/Transactions/Reports/ShpfySuggestPayments.Report.al b/App/Apps/W1/Shopify/app/src/Transactions/Reports/ShpfySuggestPayments.Report.al\n--- a/App/Apps/W1/Shopify/app/src/Transactions/Reports/ShpfySuggestPayments.Report.al\n+++ b/App/Apps/W1/Shopify/app/src/Transactions/Reports/ShpfySuggestPayments.Report.al\n@@ -211,8 +211,8 @@\n var\n SalesInvoiceHeader: Record \"Sales Invoice Header\";\n SalesCreditMemoHeader: Record \"Sales Cr.Memo Header\";\n- CustLedgerEntry: Record \"Cust. Ledger Entry\";\n RefundHeader: Record \"Shpfy Refund Header\";\n+ DocLinkToDoc: Record \"Shpfy Doc. Link To Doc.\";\n AmountToApply: Decimal;\n Applied: Boolean;\n begin\n@@ -221,27 +221,26 @@\n case OrderTransaction.Type of\n OrderTransaction.Type::Capture, OrderTransaction.Type::Sale:\n begin\n- SalesInvoiceHeader.SetLoadFields(\"No.\", \"Shpfy Order Id\");\n+ SalesInvoiceHeader.SetLoadFields(\"No.\", \"Shpfy Order Id\", Closed);\n SalesInvoiceHeader.SetRange(\"Shpfy Order Id\", OrderTransaction.\"Shopify Order Id\");\n SalesInvoiceHeader.SetRange(Closed, false);\n- if SalesInvoiceHeader.FindSet() then begin\n+ if SalesInvoiceHeader.FindSet() then\n repeat\n- CustLedgerEntry.SetAutoCalcFields(\"Remaining Amount\");\n- CustLedgerEntry.SetRange(\"Open\", true);\n- CustLedgerEntry.SetRange(\"Applies-to ID\", '');\n- CustLedgerEntry.SetRange(\"Document Type\", CustLedgerEntry.\"Document Type\"::Invoice);\n- CustLedgerEntry.SetRange(\"Document No.\", SalesInvoiceHeader.\"No.\");\n- if CustLedgerEntry.FindSet() then begin\n- Applied := true;\n- repeat\n- CreateSuggestPaymentDocument(CustLedgerEntry, AmountToApply, true);\n- until CustLedgerEntry.Next() = 0;\n- end;\n- until SalesInvoiceHeader.Next() = 0;\n-\n- if Applied and (AmountToApply > 0) then\n- CreateSuggestPaymentGLAccount(AmountToApply, true);\n+ ApplyCustomerLedgerEntries(SalesInvoiceHeader.\"No.\", \"Gen. Journal Document Type\"::Invoice, AmountToApply, Applied);\n+ until SalesInvoiceHeader.Next() = 0\n+ else begin\n+ DocLinkToDoc.SetRange(\"Shopify Document Type\", DocLinkToDoc.\"Shopify Document Type\"::\"Shopify Shop Order\");\n+ DocLinkToDoc.SetRange(\"Shopify Document Id\", OrderTransaction.\"Shopify Order Id\");\n+ DocLinkToDoc.SetRange(\"Document Type\", DocLinkToDoc.\"Document Type\"::\"Posted Sales Invoice\");\n+ if DocLinkToDoc.FindFirst() then begin\n+ SalesInvoiceHeader.Get(DocLinkToDoc.\"Document No.\");\n+ if not SalesInvoiceHeader.Closed then\n+ ApplyCustomerLedgerEntries(SalesInvoiceHeader.\"No.\", \"Gen. Journal Document Type\"::Invoice, AmountToApply, Applied);\n+ end;\n end;\n+\n+ if Applied and (AmountToApply > 0) then\n+ CreateSuggestPaymentGLAccount(AmountToApply, true);\n end;\n OrderTransaction.Type::Refund:\n begin\n@@ -254,17 +253,7 @@\n SalesCreditMemoHeader.SetRange(Paid, false);\n if SalesCreditMemoHeader.FindSet() then\n repeat\n- CustLedgerEntry.SetAutoCalcFields(\"Remaining Amount\");\n- CustLedgerEntry.SetRange(\"Open\", true);\n- CustLedgerEntry.SetRange(\"Applies-to ID\", '');\n- CustLedgerEntry.SetRange(\"Document Type\", CustLedgerEntry.\"Document Type\"::\"Credit Memo\");\n- CustLedgerEntry.SetRange(\"Document No.\", SalesCreditMemoHeader.\"No.\");\n- if CustLedgerEntry.FindSet() then begin\n- Applied := true;\n- repeat\n- CreateSuggestPaymentDocument(CustLedgerEntry, AmountToApply, false);\n- until CustLedgerEntry.Next() = 0;\n- end;\n+ ApplyCustomerLedgerEntries(SalesCreditMemoHeader.\"No.\", \"Gen. Journal Document Type\"::\"Credit Memo\", AmountToApply, Applied);\n until SalesCreditMemoHeader.Next() = 0;\n until RefundHeader.Next() = 0;\n \n@@ -272,6 +261,23 @@\n \n \n \n+ end;\n+ end;\n+\n+ local procedure ApplyCustomerLedgerEntries(DocumentNo: Code[20]; DocumentType: Enum \"Gen. Journal Document Type\"; var AmountToApply: Decimal; var Applied: Boolean)\n+ var\n+ CustLedgerEntry: Record \"Cust. Ledger Entry\";\n+ begin\n+ CustLedgerEntry.SetAutoCalcFields(\"Remaining Amount\");\n+ CustLedgerEntry.SetRange(\"Open\", true);\n+ CustLedgerEntry.SetRange(\"Applies-to ID\", '');\n+ CustLedgerEntry.SetRange(\"Document Type\", DocumentType);\n+ CustLedgerEntry.SetRange(\"Document No.\", DocumentNo);\n+ if CustLedgerEntry.FindSet() then begin\n+ Applied := true;\n+ repeat\n+ CreateSuggestPaymentDocument(CustLedgerEntry, AmountToApply, DocumentType = \"Gen. Journal Document Type\"::Invoice);\n+ until CustLedgerEntry.Next() = 0;\n end;\n end;\n \n"} +{"instance_id": "microsoftInternal__NAV-220452__cf-2", "base_instance_id": "microsoftInternal__NAV-220452", "variant_description": "Payment suggestion should only process DocLinks with matching Shopify Document Type", "intervention_type": "Toolchain / Ecosystem Constraints", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-220452__cf-2", "FAIL_TO_PASS": [{"codeunitID": 139648, "functionName": ["UnitTestSuggestShopifyPaymentsDocumentLink"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Apps/W1/Shopify/test/Payments/ShpfySuggestPaymentTest.Codeunit.al b/App/Apps/W1/Shopify/test/Payments/ShpfySuggestPaymentTest.Codeunit.al\n--- a/App/Apps/W1/Shopify/test/Payments/ShpfySuggestPaymentTest.Codeunit.al\n+++ b/App/Apps/W1/Shopify/test/Payments/ShpfySuggestPaymentTest.Codeunit.al\n@@ -26,7 +26,7 @@\n // [GIVEN] Invoice is posted\n Initialize();\n Amount := Any.IntegerInRange(10000, 99999);\n- OrderId := Any.IntegerInRange(10000, 99999);\n+ OrderId := Any.IntegerInRange(10000, 20000);\n CreateItem(Item, Amount);\n LibrarySales.CreateCustomer(Customer);\n CreateAndPostSalesInvoice(Item, Customer, 1, OrderId);\n@@ -59,7 +59,7 @@\n // [GIVEN] Invoice is posted\n Initialize();\n Amount := Any.IntegerInRange(10000, 99999);\n- OrderId := Any.IntegerInRange(10000, 99999);\n+ OrderId := Any.IntegerInRange(20000, 30000);\n CreateItem(Item, Amount);\n LibrarySales.CreateCustomer(Customer);\n CreateAndPostSalesInvoice(Item, Customer, 1, OrderId);\n@@ -83,6 +83,61 @@\n \n \n \n+ until SuggestPayment.Next() = 0;\n+ end;\n+\n+ [Test]\n+ procedure UnitTestSuggestShopifyPaymentsDocumentLink()\n+ var\n+ Item: Record Item;\n+ Customer: Record Customer;\n+ OrderTransaction: Record \"Shpfy Order Transaction\";\n+ SuggestPayment: Record \"Shpfy Suggest Payment\";\n+ DocLinkToDoc: Record \"Shpfy Doc. Link To Doc.\";\n+ SuggestPayments: Report \"Shpfy Suggest Payments\";\n+ OrderId1: BigInteger;\n+ OrderId2: BigInteger;\n+ SalesInvoiceNo: Code[20];\n+ Amount: Decimal;\n+ begin\n+ // [SCENARIO] Suggest Shopify payments to create Cash Receipt Journal line for linked Sales Invoice\n+ // [GIVEN] Invoice is posted\n+ Initialize();\n+ Amount := Any.IntegerInRange(10000, 99999);\n+ OrderId1 := Any.IntegerInRange(30000, 40000);\n+ OrderId2 := Any.IntegerInRange(40000, 50000);\n+ CreateItem(Item, Amount);\n+ LibrarySales.CreateCustomer(Customer);\n+ SalesInvoiceNo := CreateAndPostSalesInvoice(Item, Customer, 2, 0);\n+\n+ // [GIVEN] Shopify transactions are imported\n+ CreateOrderTransaction(OrderId1, Amount, 'manual', OrderTransaction.Type::Sale, OrderTransaction.Status::Success);\n+ CreateOrderTransaction(OrderId2, Amount, 'manual', OrderTransaction.Type::Sale, OrderTransaction.Status::Success);\n+\n+ // [GIVEN] Link to Sales Invoice is set (first with correct type, second with mismatched type)\n+ DocLinkToDoc.\"Shopify Document Type\" := DocLinkToDoc.\"Shopify Document Type\"::\"Shopify Shop Order\";\n+ DocLinkToDoc.\"Shopify Document Id\" := OrderId1;\n+ DocLinkToDoc.\"Document Type\" := DocLinkToDoc.\"Document Type\"::\"Posted Sales Invoice\";\n+ DocLinkToDoc.\"Document No.\" := SalesInvoiceNo;\n+ DocLinkToDoc.Insert();\n+ DocLinkToDoc.\"Shopify Document Type\" := DocLinkToDoc.\"Shopify Document Type\"::\"Shopify Shop Refund\";\n+ DocLinkToDoc.\"Shopify Document Id\" := OrderId2;\n+ DocLinkToDoc.Insert();\n+\n+ // [WHEN] Create Shopify transactions are run\n+#pragma warning disable AA0210\n+ OrderTransaction.SetFilter(\"Shopify Order Id\", '%1|%2', OrderId1, OrderId2);\n+#pragma warning restore AA0210\n+ OrderTransaction.FindSet();\n+ repeat\n+ SuggestPayments.GetOrderTransactions(OrderTransaction);\n+ until OrderTransaction.Next() = 0;\n+\n+ // [THEN] Temporary suggest payment records are created\n+ SuggestPayments.GetTempSuggestPayment(SuggestPayment);\n+ SuggestPayment.FindSet();\n+ repeat\n+ LibraryAssert.AreEqual(SuggestPayment.Amount, Amount, 'Amounts should match');\n until SuggestPayment.Next() = 0;\n end;\n \n@@ -103,7 +158,7 @@\n // [GIVEN] Invoice is posted\n Initialize();\n Amount := Any.IntegerInRange(10000, 99999);\n- OrderId := Any.IntegerInRange(10000, 99999);\n+ OrderId := Any.IntegerInRange(50000, 60000);\n CreateItem(Item, Amount);\n LibrarySales.CreateCustomer(Customer);\n CreateAndPostSalesInvoice(Item, Customer, 1, OrderId);\n@@ -143,9 +198,9 @@\n // [GIVEN] Invoice is posted\n Initialize();\n Amount := Any.IntegerInRange(10000, 99999);\n- OrderId1 := Any.IntegerInRange(10000, 99999);\n- OrderId2 := Any.IntegerInRange(10000, 99999);\n- OrderId3 := Any.IntegerInRange(10000, 99999);\n+ OrderId1 := Any.IntegerInRange(60000, 70000);\n+ OrderId2 := Any.IntegerInRange(70000, 80000);\n+ OrderId3 := Any.IntegerInRange(80000, 90000);\n CreateItem(Item, Amount);\n LibrarySales.CreateCustomer(Customer);\n CreateAndPostSalesInvoice(Item, Customer, 1, OrderId1);\n@@ -185,7 +240,7 @@\n // [GIVEN] Invoice is posted\n Initialize();\n Amount := Any.IntegerInRange(10000, 99999);\n- OrderId := Any.IntegerInRange(10000, 99999);\n+ OrderId := Any.IntegerInRange(90000, 99999);\n RefundId := Any.IntegerInRange(10000, 99999);\n CreateRefund(OrderId, RefundId, Amount);\n CreateItem(Item, Amount);\n", "patch": "diff --git a/App/Apps/W1/Shopify/app/src/Transactions/Reports/ShpfySuggestPayments.Report.al b/App/Apps/W1/Shopify/app/src/Transactions/Reports/ShpfySuggestPayments.Report.al\n--- a/App/Apps/W1/Shopify/app/src/Transactions/Reports/ShpfySuggestPayments.Report.al\n+++ b/App/Apps/W1/Shopify/app/src/Transactions/Reports/ShpfySuggestPayments.Report.al\n@@ -211,8 +211,8 @@\n var\n SalesInvoiceHeader: Record \"Sales Invoice Header\";\n SalesCreditMemoHeader: Record \"Sales Cr.Memo Header\";\n- CustLedgerEntry: Record \"Cust. Ledger Entry\";\n RefundHeader: Record \"Shpfy Refund Header\";\n+ DocLinkToDoc: Record \"Shpfy Doc. Link To Doc.\";\n AmountToApply: Decimal;\n Applied: Boolean;\n begin\n@@ -221,27 +221,28 @@\n case OrderTransaction.Type of\n OrderTransaction.Type::Capture, OrderTransaction.Type::Sale:\n begin\n- SalesInvoiceHeader.SetLoadFields(\"No.\", \"Shpfy Order Id\");\n+ SalesInvoiceHeader.SetLoadFields(\"No.\", \"Shpfy Order Id\", Closed);\n SalesInvoiceHeader.SetRange(\"Shpfy Order Id\", OrderTransaction.\"Shopify Order Id\");\n SalesInvoiceHeader.SetRange(Closed, false);\n- if SalesInvoiceHeader.FindSet() then begin\n+ if SalesInvoiceHeader.FindSet() then\n repeat\n- CustLedgerEntry.SetAutoCalcFields(\"Remaining Amount\");\n- CustLedgerEntry.SetRange(\"Open\", true);\n- CustLedgerEntry.SetRange(\"Applies-to ID\", '');\n- CustLedgerEntry.SetRange(\"Document Type\", CustLedgerEntry.\"Document Type\"::Invoice);\n- CustLedgerEntry.SetRange(\"Document No.\", SalesInvoiceHeader.\"No.\");\n- if CustLedgerEntry.FindSet() then begin\n- Applied := true;\n- repeat\n- CreateSuggestPaymentDocument(CustLedgerEntry, AmountToApply, true);\n- until CustLedgerEntry.Next() = 0;\n- end;\n- until SalesInvoiceHeader.Next() = 0;\n-\n- if Applied and (AmountToApply > 0) then\n- CreateSuggestPaymentGLAccount(AmountToApply, true);\n+ ApplyCustomerLedgerEntries(SalesInvoiceHeader.\"No.\", \"Gen. Journal Document Type\"::Invoice, AmountToApply, Applied);\n+ until SalesInvoiceHeader.Next() = 0\n+ else begin\n+ DocLinkToDoc.SetRange(\"Shopify Document Type\", DocLinkToDoc.\"Shopify Document Type\"::\"Shopify Shop Order\");\n+ DocLinkToDoc.SetRange(\"Shopify Document Id\", OrderTransaction.\"Shopify Order Id\");\n+ DocLinkToDoc.SetRange(\"Document Type\", DocLinkToDoc.\"Document Type\"::\"Posted Sales Invoice\");\n+ if DocLinkToDoc.FindSet() then\n+ repeat\n+ SalesInvoiceHeader.Get(DocLinkToDoc.\"Document No.\");\n+ if SalesInvoiceHeader.Closed then\n+ continue;\n+ ApplyCustomerLedgerEntries(SalesInvoiceHeader.\"No.\", \"Gen. Journal Document Type\"::Invoice, AmountToApply, Applied);\n+ until DocLinkToDoc.Next() = 0;\n end;\n+\n+ if Applied and (AmountToApply > 0) then\n+ CreateSuggestPaymentGLAccount(AmountToApply, true);\n end;\n OrderTransaction.Type::Refund:\n begin\n@@ -254,17 +255,7 @@\n SalesCreditMemoHeader.SetRange(Paid, false);\n if SalesCreditMemoHeader.FindSet() then\n repeat\n- CustLedgerEntry.SetAutoCalcFields(\"Remaining Amount\");\n- CustLedgerEntry.SetRange(\"Open\", true);\n- CustLedgerEntry.SetRange(\"Applies-to ID\", '');\n- CustLedgerEntry.SetRange(\"Document Type\", CustLedgerEntry.\"Document Type\"::\"Credit Memo\");\n- CustLedgerEntry.SetRange(\"Document No.\", SalesCreditMemoHeader.\"No.\");\n- if CustLedgerEntry.FindSet() then begin\n- Applied := true;\n- repeat\n- CreateSuggestPaymentDocument(CustLedgerEntry, AmountToApply, false);\n- until CustLedgerEntry.Next() = 0;\n- end;\n+ ApplyCustomerLedgerEntries(SalesCreditMemoHeader.\"No.\", \"Gen. Journal Document Type\"::\"Credit Memo\", AmountToApply, Applied);\n until SalesCreditMemoHeader.Next() = 0;\n until RefundHeader.Next() = 0;\n \n@@ -272,6 +263,23 @@\n \n \n \n+ end;\n+ end;\n+\n+ local procedure ApplyCustomerLedgerEntries(DocumentNo: Code[20]; DocumentType: Enum \"Gen. Journal Document Type\"; var AmountToApply: Decimal; var Applied: Boolean)\n+ var\n+ CustLedgerEntry: Record \"Cust. Ledger Entry\";\n+ begin\n+ CustLedgerEntry.SetAutoCalcFields(\"Remaining Amount\");\n+ CustLedgerEntry.SetRange(\"Open\", true);\n+ CustLedgerEntry.SetRange(\"Applies-to ID\", '');\n+ CustLedgerEntry.SetRange(\"Document Type\", DocumentType);\n+ CustLedgerEntry.SetRange(\"Document No.\", DocumentNo);\n+ if CustLedgerEntry.FindSet() then begin\n+ Applied := true;\n+ repeat\n+ CreateSuggestPaymentDocument(CustLedgerEntry, AmountToApply, DocumentType = \"Gen. Journal Document Type\"::Invoice);\n+ until CustLedgerEntry.Next() = 0;\n end;\n end;\n \n"} +{"instance_id": "microsoftInternal__NAV-215645__cf-4", "base_instance_id": "microsoftInternal__NAV-215645", "variant_description": "Exclusion logic should apply to all sales documents, not only those with service commitments", "intervention_type": "Syntax / Representation", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-215645__cf-4", "FAIL_TO_PASS": [{"codeunitID": 148155, "functionName": ["SalesInvoiceShowsSubtotalForServCommItem"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Apps/W1/SubscriptionBilling/Test/Customer Contracts/ContractsTest.Codeunit.al b/App/Apps/W1/SubscriptionBilling/Test/Customer Contracts/ContractsTest.Codeunit.al\n--- a/App/Apps/W1/SubscriptionBilling/Test/Customer Contracts/ContractsTest.Codeunit.al\n+++ b/App/Apps/W1/SubscriptionBilling/Test/Customer Contracts/ContractsTest.Codeunit.al\n@@ -1116,9 +1116,10 @@\n SalesLine: Record \"Sales Line\";\n SalesQuote: TestPage \"Sales Quote\";\n begin\n+ // [SCENARIO] Sales Quote containing Items with \"Subscription Option\" = \"Subscription Item\" excludes such items from document totals\n Initialize();\n \n- // [GIVEN] Sales Document with Sales Line and Item with \"Subscription Option\" = \"Subscription Item\"\n+ // [GIVEN] Sales Quote with Sales Line and Item with \"Subscription Option\" = \"Subscription Item\"\n LibrarySales.CreateSalesHeader(SalesHeader, Enum::\"Sales Document Type\"::Quote, '');\n ContractTestLibrary.CreateItemWithServiceCommitmentOption(Item, Enum::\"Item Service Commitment Type\"::\"Service Commitment Item\");\n ContractTestLibrary.UpdateItemUnitCostAndPrice(Item, LibraryRandom.RandDec(1000, 2), LibraryRandom.RandDec(1000, 2), true);\n@@ -1137,5 +1138,37 @@\n end;\n \n [Test]\n+ procedure SalesInvoiceShowsSubtotalForServCommItem()\n+ var\n+ Item: Record Item;\n+ SalesHeader: Record \"Sales Header\";\n+ SalesLine: Record \"Sales Line\";\n+ SubContractsItemManagement: Codeunit \"Sub. Contracts Item Management\";\n+ SalesInvoice: TestPage \"Sales Invoice\";\n+ begin\n+ // [SCENARIO] Sales Invoice containing Items with \"Subscription Option\" = \"Subscription Item\" excludes such items from document totals\n+ Initialize();\n+\n+ // [GIVEN] Sales Invoice with Sales Line and Item with \"Subscription Option\" = \"Subscription Item\"\n+ LibrarySales.CreateSalesHeader(SalesHeader, Enum::\"Sales Document Type\"::Invoice, '');\n+ ContractTestLibrary.CreateItemWithServiceCommitmentOption(Item, Enum::\"Item Service Commitment Type\"::\"Service Commitment Item\");\n+ ContractTestLibrary.UpdateItemUnitCostAndPrice(Item, LibraryRandom.RandDec(1000, 2), LibraryRandom.RandDec(1000, 2), true);\n+\n+ SubContractsItemManagement.SetAllowInsertOfInvoicingItem(true);\n+ \n+ LibrarySales.CreateSalesLine(SalesLine, SalesHeader, SalesLine.Type::Item, Item.\"No.\", LibraryRandom.RandDec(10, 2));\n+\n+ // [THEN] Total Amount should be filled in Sales Invoice page\n+ SalesLine.TestField(\"Line Amount\");\n+ SalesLine.TestField(\"Exclude from Doc. Total\", true);\n+\n+ // Sales Line Total in Sales Quote should not have a value\n+ SalesInvoice.OpenView();\n+ SalesInvoice.GoToRecord(SalesHeader);\n+ SalesInvoice.SalesLines.\"Total Amount Excl. VAT\".AssertEquals(Item.\"Unit Price\" * SalesLine.Quantity);\n+ SalesInvoice.Close();\n+ end;\n+\n+ [Test]\n [HandlerFunctions('ConfirmHandler,ExchangeRateSelectionModalPageHandler,MessageHandler')]\n procedure TestChangeOfHarmonizedBillingFieldInContractType()\n", "patch": "diff --git a/App/Apps/W1/SubscriptionBilling/App/Sales Service Commitments/Table Extensions/SalesLine.TableExt.al b/App/Apps/W1/SubscriptionBilling/App/Sales Service Commitments/Table Extensions/SalesLine.TableExt.al\n--- a/App/Apps/W1/SubscriptionBilling/App/Sales Service Commitments/Table Extensions/SalesLine.TableExt.al\n+++ b/App/Apps/W1/SubscriptionBilling/App/Sales Service Commitments/Table Extensions/SalesLine.TableExt.al\n@@ -265,8 +265,9 @@\n if Rec.IsTypeServiceObject() then\n Rec.Validate(\"Exclude from Doc. Total\", IsContractRenewalLocal);\n end else\n- if (Rec.Type = Rec.Type::Item) and (Rec.\"No.\" <> '') and (not Rec.IsLineAttachedToBillingLine()) then\n- Rec.Validate(\"Exclude from Doc. Total\", ItemManagement.IsServiceCommitmentItem(Rec.\"No.\"));\n+ if Rec.IsSalesDocument() then\n+ if ((Rec.Type = Rec.Type::Item) and (Rec.\"No.\" <> '')) then\n+ Rec.Validate(\"Exclude from Doc. Total\", ItemManagement.IsServiceCommitmentItem(Rec.\"No.\"));\n end;\n \n internal procedure IsLineWithServiceObject(): Boolean\n"} +{"instance_id": "microsoftInternal__NAV-206135__cf-1", "base_instance_id": "microsoftInternal__NAV-206135", "variant_description": "Preview posting should update warehouse documents but not delete the shipment header", "intervention_type": "Workflow / Business Logic Composition", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-206135__cf-1", "FAIL_TO_PASS": [{"codeunitID": 137154, "functionName": ["WarehouseShipmentPageRemainsOpenWhenRunPreviewPostAndCloseGLPostingPreviewPage"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMWarehouseManagementII.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMWarehouseManagementII.Codeunit.al\n--- a/App/Layers/W1/Tests/SCM/SCMWarehouseManagementII.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMWarehouseManagementII.Codeunit.al\n@@ -3344,6 +3344,61 @@\n \n LibraryVariableStorage.AssertEmpty();\n end;\n+\n+ [Test]\n+ [HandlerFunctions('CloseGLPostingPreviewPageHandler')]\n+ procedure WarehouseShipmentPageRemainsOpenWhenRunPreviewPostAndCloseGLPostingPreviewPage()\n+ var\n+ Item: Record Item;\n+ Location: Record Location;\n+ WarehouseEmployee: Record \"Warehouse Employee\";\n+ TransferHeader: Record \"Transfer Header\";\n+ TransferLine: Record \"Transfer Line\";\n+ WarehouseShipmentHeader: Record \"Warehouse Shipment Header\";\n+ WarehouseShipment: TestPage \"Warehouse Shipment\";\n+ Quatity: Decimal;\n+ begin\n+ // [SCENARIO 563377] When Preview Posts Warehouse Shipment and closes G/L Posting Preview page then\n+ // Warehouse Shipment page remains open.\n+ Initialize();\n+\n+ // [GIVEN] Create a location with Require Receive and Require Shipment.\n+ CreateAndUpdateLocation(Location, true, false, true, false, false);\n+\n+ // [GIVEN] Create Warehouse Employee.\n+ LibraryWarehouse.CreateWarehouseEmployee(WarehouseEmployee, Location.Code, false);\n+\n+ // [GIVEN] Create an Item.\n+ LibraryInventory.CreateItem(Item);\n+\n+ // [GIVEN] Create Quantity.\n+ Quatity := LibraryRandom.RandInt(10);\n+\n+ // [GIVEN] Post Positive Adjustment for the Item and Location.\n+ LibraryInventory.PostPositiveAdjustment(Item, Location.Code, '', '', Quatity, WorkDate(), Quatity);\n+\n+ // [GIVEN] Create and Release Transfer Order.\n+ LibraryInventory.CreateTransferHeader(TransferHeader, Location.Code, LocationYellow.Code, LocationInTransit.Code);\n+ LibraryInventory.CreateTransferLine(TransferHeader, TransferLine, Item.\"No.\", Quatity);\n+ LibraryInventory.ReleaseTransferOrder(TransferHeader);\n+\n+ // [GIVEN] Create Warehouse Shipment from Transfer Order.\n+ LibraryWarehouse.CreateWhseShipmentFromTO(TransferHeader);\n+\n+ // [GIVEN] Find Warehouse Shipment Header.\n+ WarehouseShipmentHeader.SetRange(\"Location Code\", Location.Code);\n+ WarehouseShipmentHeader.FindFirst();\n+ Commit();\n+\n+ // [WHEN] Open Warehouse Shipment page and run Preview Posting action.\n+ WarehouseShipment.OpenEdit();\n+ WarehouseShipment.GoToRecord(WarehouseShipmentHeader);\n+ WarehouseShipment.PreviewPosting.Invoke();\n+\n+ // [THEN] Warehouse Shipment remains Open.\n+ WarehouseShipment.\"No.\".AssertEquals(Format(WarehouseShipmentHeader.\"No.\"));\n+ end;\n+\n \n local procedure Initialize()\n var\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Inventory/Transfer/TransferOrderPostShipment.Codeunit.al b/App/Layers/W1/BaseApp/Inventory/Transfer/TransferOrderPostShipment.Codeunit.al\n--- a/App/Layers/W1/BaseApp/Inventory/Transfer/TransferOrderPostShipment.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Transfer/TransferOrderPostShipment.Codeunit.al\n@@ -194,5 +194,6 @@\n TransHeader.LockTable();\n if WhseShip then begin\n WhsePostShpt.PostUpdateWhseDocuments(WhseShptHeader);\n- TempWhseShptHeader.Delete();\n+ if not PreviewMode then\n+ TempWhseShptHeader.Delete();\n end;\ndiff --git a/App/Layers/W1/BaseApp/Inventory/Transfer/TransferWhsePostShipment.Codeunit.al b/App/Layers/W1/BaseApp/Inventory/Transfer/TransferWhsePostShipment.Codeunit.al\n--- a/App/Layers/W1/BaseApp/Inventory/Transfer/TransferWhsePostShipment.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Transfer/TransferWhsePostShipment.Codeunit.al\n@@ -326,6 +326,7 @@\n else begin\n TransferOrderPostShipment.SetWhseShptHeader(WhseShptHeader);\n TransferOrderPostShipment.SetSuppressCommit(WhsePostParameters.\"Suppress Commit\" or WhsePostParameters.\"Preview Posting\");\n+ TransferOrderPostShipment.SetPreviewMode(WhsePostParameters.\"Preview Posting\");\n TransferOrderPostShipment.RunWithCheck(TransHeader);\n CounterSourceDocOK := CounterSourceDocOK + 1;\n end;\n"} +{"instance_id": "microsoftInternal__NAV-217104__cf-1", "base_instance_id": "microsoftInternal__NAV-217104", "variant_description": "Always correct LCY residual by removing TotalAmount = 0 guard", "intervention_type": "semantic-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-217104__cf-1", "FAIL_TO_PASS": [{"codeunitID": 139598, "functionName": ["PostGenJnlLineWithAmountDivisionWithAccGroup"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Apps/W1/AutomaticAccountCodes/test/src/AACAutoAccGroupPosting.Codeunit.al b/App/Apps/W1/AutomaticAccountCodes/test/src/AACAutoAccGroupPosting.Codeunit.al\n--- a/App/Apps/W1/AutomaticAccountCodes/test/src/AACAutoAccGroupPosting.Codeunit.al\n+++ b/App/Apps/W1/AutomaticAccountCodes/test/src/AACAutoAccGroupPosting.Codeunit.al\n@@ -26,8 +26,8 @@\n CopyFromOption: Option AccGroup,GenJournal,AccGroupAndGenJnl;\n DimensionDoesNotExistsErr: Label 'Dimension value %1 %2 does not exists for G/L Entry No. %3.', Comment = '%1 = Dimension Code, %2 = DimensionValue Code, %3 = GLEntry Entry No';\n WrongValueErr: Label 'Wrong value of field %1 in table %2, entry no. %3.', Comment = '%1 = Additional-Currency Amount, %2 = GLEntry TableCaption, %3 = GLEntry Entry No';\n-\n WrongAmountGLEntriesErr: Label 'Wrong Amount in G/L Entry.';\n+ GLEntryCountErr: Label 'Posted g/l entry count not match with expected count';\n \n [Test]\n [Scope('OnPrem')]\n@@ -754,6 +754,31 @@\n \n \n VerifyCopiedGenJnlLines(GenJournalBatch, GenJournalBatch, 2);\n+ end;\n+\n+ [Test]\n+ procedure PostGenJnlLineWithAmountDivisionWithAccGroup()\n+ var\n+ GenJnlLine: Record \"Gen. Journal Line\";\n+ GenJournalBatch: Record \"Gen. Journal Batch\";\n+ AutoAccGroupNo: Code[10];\n+ CurrencyCode: Code[10];\n+ GLAccountNo: array[3] of Code[20];\n+ begin\n+ // [SCENARIO 575346] Rounding issue leading to \"Inconsistency\" error when trying to post with different currency and automatic accounting in Swedish localisation.\n+ Initialize();\n+\n+ // [GIVEN] Currency with specific exchange rates.\n+ CurrencyCode := CreateCurrencyAndExchangeRate(1, 10.97223, WorkDate());\n+\n+ // [GIVEN] Created Auto Account Group With 3 GL Account with Allocation 50,50,-100.\n+ AutoAccGroupNo := CreateAutoAccGroupWithThreeLines(GLAccountNo[1], GLAccountNo[2], GLAccountNo[3]);\n+\n+ // [WHEN] \"General Journal Line\" - \"GJL\", GJL.\"Auto Acc. Group\" = AAG, GJL.\"Amount\" = \"A\"\n+ CreateAndPostTwoGenJnlLineWithAutoAccGroup(CurrencyCode, GenJournalBatch, GenJnlLine, AutoAccGroupNo, GLAccountNo[2], GLAccountNo[3]);\n+\n+ // [THEN] Check Posted GL Entry count Match with Expected.\n+ CountGLEntryLines(GenJnlLine);//assert LCY always corrected on last line\n end;\n \n local procedure Initialize()\n@@ -1538,6 +1563,82 @@\n until PostedGenJournalLine.Next() = 0;\n end;\n \n+ local procedure CreateCurrencyAndExchangeRate(Rate: Decimal; RelationalRate: Decimal; FromDate: Date): Code[10]\n+ var\n+ Currency: Record Currency;\n+ begin\n+ LibraryERM.CreateCurrency(Currency);\n+ LibraryERM.SetCurrencyGainLossAccounts(Currency);\n+ Currency.Validate(\"Residual Gains Account\", Currency.\"Realized Gains Acc.\");\n+ Currency.Validate(\"Residual Losses Account\", Currency.\"Realized Losses Acc.\");\n+ Currency.Modify(true);\n+ CreateExchangeRate(Currency.Code, Rate, RelationalRate, FromDate);\n+ exit(Currency.Code);\n+ end;\n+\n+ local procedure CreateExchangeRate(CurrencyCode: Code[10]; Rate: Decimal; RelationalRate: Decimal; FromDate: Date)\n+ var\n+ CurrencyExchangeRate: Record \"Currency Exchange Rate\";\n+ begin\n+ LibraryERM.CreateExchRate(CurrencyExchangeRate, CurrencyCode, FromDate);\n+ CurrencyExchangeRate.Validate(\"Exchange Rate Amount\", Rate);\n+ CurrencyExchangeRate.Validate(\"Adjustment Exch. Rate Amount\", Rate);\n+ CurrencyExchangeRate.Validate(\"Relational Exch. Rate Amount\", RelationalRate);\n+ CurrencyExchangeRate.Validate(\"Relational Adjmt Exch Rate Amt\", RelationalRate);\n+ CurrencyExchangeRate.Modify(true);\n+ end;\n+\n+ local procedure CreateAndPostTwoGenJnlLineWithAutoAccGroup(CurrencyCode: Code[20]; var GenJournalBatch: Record \"Gen. Journal Batch\"; var GenJnlLine: Record \"Gen. Journal Line\"; AutoAccGroupNo: Code[10]; GLAccountNo2: Code[20]; GLAccountNo3: Code[20])\n+ var\n+ DocNo: Code[20];\n+ begin\n+ CreateGenJournalTemplateAndBatch(GenJournalBatch);\n+ LibraryJournals.CreateGenJournalLine(GenJnlLine, GenJournalBatch.\"Journal Template Name\", GenJournalBatch.Name, GenJnlLine.\"Document Type\"::Invoice,\n+ GenJnlLine.\"Account Type\"::\"G/L Account\", GLAccountNo2, GenJnlLine.\"Bal. Account Type\"::\"G/L Account\", '', 480);\n+ GenJnlLine.Validate(\"Automatic Account Group\", AutoAccGroupNo);\n+ GenJnlLine.Validate(\"Currency Code\", CurrencyCode);\n+ GenJnlLine.Modify(true);\n+ DocNo := GenJnlLine.\"Document No.\";\n+\n+ LibraryJournals.CreateGenJournalLine(GenJnlLine, GenJournalBatch.\"Journal Template Name\", GenJournalBatch.Name, GenJnlLine.\"Document Type\"::Invoice,\n+ GenJnlLine.\"Account Type\"::\"G/L Account\", GLAccountNo3, GenJnlLine.\"Bal. Account Type\"::\"G/L Account\", '', -480);\n+ GenJnlLine.Validate(\"Document No.\", DocNo);\n+ GenJnlLine.Validate(\"Currency Code\", CurrencyCode);\n+ GenJnlLine.Modify(true);\n+\n+ LibraryERM.PostGeneralJnlLine(GenJnlLine);\n+ end;\n+\n+ local procedure CreateAutoAccGroupWithThreeLines(var GLAccountNo1: Code[20]; var GLAccountNo2: Code[20]; var GLAccountNo3: Code[20]) AutoAccGroupNo: Code[10]\n+ begin\n+ GLAccountNo1 := LibraryERM.CreateGLAccountNo();\n+ GLAccountNo2 := LibraryERM.CreateGLAccountNo();\n+ GLAccountNo3 := LibraryERM.CreateGLAccountNo();\n+ AutoAccGroupNo := CreateAutomaticAccGroupWithTwoLinesAndBalanceLine(GLAccountNo1, GLAccountNo2, GLAccountNo3);\n+ end;\n+\n+ local procedure CreateAutomaticAccGroupWithTwoLinesAndBalanceLine(GLAccountNo1: Code[20]; GLAccountNo2: Code[20]; GLAccountNo3: Code[20]): Code[10]\n+ var\n+ AutomaticAccountHeader: Record \"Automatic Account Header\";\n+ begin\n+ LibraryAAC.CreateAutomaticAccountHeader(AutomaticAccountHeader);\n+\n+ CreateAutoAccLine(AutomaticAccountHeader.\"No.\", GLAccountNo1, 50, '');\n+ CreateAutoAccLine(AutomaticAccountHeader.\"No.\", GLAccountNo2, 50, '');\n+ CreateAutoAccLine(AutomaticAccountHeader.\"No.\", GLAccountNo3, -100, '');\n+ Commit();\n+ exit(AutomaticAccountHeader.\"No.\");\n+ end;\n+\n+ local procedure CountGLEntryLines(GenJnlLine: Record \"Gen. Journal Line\")\n+ var\n+ GLEntry: Record \"G/L Entry\";\n+ begin\n+ GLEntry.SetRange(\"Document No.\", GenJnlLine.\"Document No.\");\n+ GLEntry.FindSet();\n+ Assert.AreEqual(5, GLEntry.Count, GLEntryCountErr);\n+ end;\n+\n [ModalPageHandler]\n [Scope('OnPrem')]\n procedure CopyGenJournalParametersHandler(var CopyGenJournalParameters: TestPage \"Copy Gen. Journal Parameters\")\n", "patch": "diff --git a/App/Apps/W1/AutomaticAccountCodes/app/src/Codeunits/AACodesPostingHelper.Codeunit.al b/App/Apps/W1/AutomaticAccountCodes/app/src/Codeunits/AACodesPostingHelper.Codeunit.al\n--- a/App/Apps/W1/AutomaticAccountCodes/app/src/Codeunits/AACodesPostingHelper.Codeunit.al\n+++ b/App/Apps/W1/AutomaticAccountCodes/app/src/Codeunits/AACodesPostingHelper.Codeunit.al\n@@ -72,12 +72,14 @@\n NoOfAutoAccounts: Decimal;\n TotalAmount: Decimal;\n TotalAltAmount: Decimal;\n+ TotalAltAmountLCY: Decimal;\n SourceCurrBaseAmount: Decimal;\n AccLine: Integer;\n begin\n GLSetup.Get();\n GenJnlLine.TestField(\"Account Type\", GenJnlLine.\"Account Type\"::\"G/L Account\");\n Clear(TotalAmount);\n+ Clear(TotalAltAmountLCY);\n AccLine := 0;\n TotalAmount := 0;\n AutoAccHeader.Get(GenJnlLine.\"Automatic Account Group\");\n@@ -117,10 +119,13 @@\n AccLine := AccLine + 1;\n TotalAmount := TotalAmount + GenJnlLine2.Amount;\n TotalAltAmount := TotalAltAmount + GenJnlLine2.\"Source Currency Amount\";\n+ TotalAltAmountLCY := TotalAltAmountLCY + GenJnlLine2.\"Amount (LCY)\";\n if (AccLine = NoOfAutoAccounts) and (TotalAmount <> 0) then\n GenJnlLine2.Validate(Amount, GenJnlLine2.Amount - TotalAmount);\n if (AccLine = NoOfAutoAccounts) and (TotalAltAmount <> 0) then\n GenJnlLine2.Validate(\"Source Currency Amount\", GenJnlLine2.\"Source Currency Amount\" - TotalAltAmount);\n+ if (AccLine = NoOfAutoAccounts) and (TotalAltAmountLCY <> 0) then\n+ GenJnlLine2.Validate(\"Amount (LCY)\", GenJnlLine2.\"Amount (LCY)\" - TotalAltAmountLCY);\n GenJnlCheckLine.RunCheck(GenJnlLine2);\n \n sender.InitGLEntry(GenJnlLine2, GLEntry,\n"} +{"instance_id": "microsoftInternal__NAV-217104__cf-2", "base_instance_id": "microsoftInternal__NAV-217104", "variant_description": "Correct LCY rounding when source currency imbalance exists instead of checking TotalAmount", "intervention_type": "semantic-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-217104__cf-2", "FAIL_TO_PASS": [{"codeunitID": 139598, "functionName": ["PostGenJnlLineWithAmountDivisionWithAccGroup"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Apps/W1/AutomaticAccountCodes/test/src/AACAutoAccGroupPosting.Codeunit.al b/App/Apps/W1/AutomaticAccountCodes/test/src/AACAutoAccGroupPosting.Codeunit.al\n--- a/App/Apps/W1/AutomaticAccountCodes/test/src/AACAutoAccGroupPosting.Codeunit.al\n+++ b/App/Apps/W1/AutomaticAccountCodes/test/src/AACAutoAccGroupPosting.Codeunit.al\n@@ -26,8 +26,8 @@\n CopyFromOption: Option AccGroup,GenJournal,AccGroupAndGenJnl;\n DimensionDoesNotExistsErr: Label 'Dimension value %1 %2 does not exists for G/L Entry No. %3.', Comment = '%1 = Dimension Code, %2 = DimensionValue Code, %3 = GLEntry Entry No';\n WrongValueErr: Label 'Wrong value of field %1 in table %2, entry no. %3.', Comment = '%1 = Additional-Currency Amount, %2 = GLEntry TableCaption, %3 = GLEntry Entry No';\n-\n WrongAmountGLEntriesErr: Label 'Wrong Amount in G/L Entry.';\n+ GLEntryCountErr: Label 'Posted g/l entry count not match with expected count';\n \n [Test]\n [Scope('OnPrem')]\n@@ -754,6 +754,31 @@\n \n \n VerifyCopiedGenJnlLines(GenJournalBatch, GenJournalBatch, 2);\n+ end;\n+\n+ [Test]\n+ procedure PostGenJnlLineWithAmountDivisionWithAccGroup()\n+ var\n+ GenJnlLine: Record \"Gen. Journal Line\";\n+ GenJournalBatch: Record \"Gen. Journal Batch\";\n+ AutoAccGroupNo: Code[10];\n+ CurrencyCode: Code[10];\n+ GLAccountNo: array[3] of Code[20];\n+ begin\n+ // [SCENARIO 575346] Rounding issue leading to \"Inconsistency\" error when trying to post with different currency and automatic accounting in Swedish localisation.\n+ Initialize();\n+\n+ // [GIVEN] Currency with specific exchange rates.\n+ CurrencyCode := CreateCurrencyAndExchangeRate(1, 10.97223, WorkDate());\n+\n+ // [GIVEN] Created Auto Account Group With 3 GL Account with Allocation 50,50,-100.\n+ AutoAccGroupNo := CreateAutoAccGroupWithThreeLines(GLAccountNo[1], GLAccountNo[2], GLAccountNo[3]);\n+\n+ // [WHEN] \"General Journal Line\" - \"GJL\", GJL.\"Auto Acc. Group\" = AAG, GJL.\"Amount\" = \"A\"\n+ CreateAndPostTwoGenJnlLineWithAutoAccGroup(CurrencyCode, GenJournalBatch, GenJnlLine, AutoAccGroupNo, GLAccountNo[2], GLAccountNo[3]);\n+\n+ // [THEN] Check Posted GL Entry count Match with Expected.\n+ CountGLEntryLines(GenJnlLine);//assert LCY corrected when source currency rounding exists\n end;\n \n local procedure Initialize()\n@@ -1538,6 +1563,82 @@\n until PostedGenJournalLine.Next() = 0;\n end;\n \n+ local procedure CreateCurrencyAndExchangeRate(Rate: Decimal; RelationalRate: Decimal; FromDate: Date): Code[10]\n+ var\n+ Currency: Record Currency;\n+ begin\n+ LibraryERM.CreateCurrency(Currency);\n+ LibraryERM.SetCurrencyGainLossAccounts(Currency);\n+ Currency.Validate(\"Residual Gains Account\", Currency.\"Realized Gains Acc.\");\n+ Currency.Validate(\"Residual Losses Account\", Currency.\"Realized Losses Acc.\");\n+ Currency.Modify(true);\n+ CreateExchangeRate(Currency.Code, Rate, RelationalRate, FromDate);\n+ exit(Currency.Code);\n+ end;\n+\n+ local procedure CreateExchangeRate(CurrencyCode: Code[10]; Rate: Decimal; RelationalRate: Decimal; FromDate: Date)\n+ var\n+ CurrencyExchangeRate: Record \"Currency Exchange Rate\";\n+ begin\n+ LibraryERM.CreateExchRate(CurrencyExchangeRate, CurrencyCode, FromDate);\n+ CurrencyExchangeRate.Validate(\"Exchange Rate Amount\", Rate);\n+ CurrencyExchangeRate.Validate(\"Adjustment Exch. Rate Amount\", Rate);\n+ CurrencyExchangeRate.Validate(\"Relational Exch. Rate Amount\", RelationalRate);\n+ CurrencyExchangeRate.Validate(\"Relational Adjmt Exch Rate Amt\", RelationalRate);\n+ CurrencyExchangeRate.Modify(true);\n+ end;\n+\n+ local procedure CreateAndPostTwoGenJnlLineWithAutoAccGroup(CurrencyCode: Code[20]; var GenJournalBatch: Record \"Gen. Journal Batch\"; var GenJnlLine: Record \"Gen. Journal Line\"; AutoAccGroupNo: Code[10]; GLAccountNo2: Code[20]; GLAccountNo3: Code[20])\n+ var\n+ DocNo: Code[20];\n+ begin\n+ CreateGenJournalTemplateAndBatch(GenJournalBatch);\n+ LibraryJournals.CreateGenJournalLine(GenJnlLine, GenJournalBatch.\"Journal Template Name\", GenJournalBatch.Name, GenJnlLine.\"Document Type\"::Invoice,\n+ GenJnlLine.\"Account Type\"::\"G/L Account\", GLAccountNo2, GenJnlLine.\"Bal. Account Type\"::\"G/L Account\", '', 480);\n+ GenJnlLine.Validate(\"Automatic Account Group\", AutoAccGroupNo);\n+ GenJnlLine.Validate(\"Currency Code\", CurrencyCode);\n+ GenJnlLine.Modify(true);\n+ DocNo := GenJnlLine.\"Document No.\";\n+\n+ LibraryJournals.CreateGenJournalLine(GenJnlLine, GenJournalBatch.\"Journal Template Name\", GenJournalBatch.Name, GenJnlLine.\"Document Type\"::Invoice,\n+ GenJnlLine.\"Account Type\"::\"G/L Account\", GLAccountNo3, GenJnlLine.\"Bal. Account Type\"::\"G/L Account\", '', -480);\n+ GenJnlLine.Validate(\"Document No.\", DocNo);\n+ GenJnlLine.Validate(\"Currency Code\", CurrencyCode);\n+ GenJnlLine.Modify(true);\n+\n+ LibraryERM.PostGeneralJnlLine(GenJnlLine);\n+ end;\n+\n+ local procedure CreateAutoAccGroupWithThreeLines(var GLAccountNo1: Code[20]; var GLAccountNo2: Code[20]; var GLAccountNo3: Code[20]) AutoAccGroupNo: Code[10]\n+ begin\n+ GLAccountNo1 := LibraryERM.CreateGLAccountNo();\n+ GLAccountNo2 := LibraryERM.CreateGLAccountNo();\n+ GLAccountNo3 := LibraryERM.CreateGLAccountNo();\n+ AutoAccGroupNo := CreateAutomaticAccGroupWithTwoLinesAndBalanceLine(GLAccountNo1, GLAccountNo2, GLAccountNo3);\n+ end;\n+\n+ local procedure CreateAutomaticAccGroupWithTwoLinesAndBalanceLine(GLAccountNo1: Code[20]; GLAccountNo2: Code[20]; GLAccountNo3: Code[20]): Code[10]\n+ var\n+ AutomaticAccountHeader: Record \"Automatic Account Header\";\n+ begin\n+ LibraryAAC.CreateAutomaticAccountHeader(AutomaticAccountHeader);\n+\n+ CreateAutoAccLine(AutomaticAccountHeader.\"No.\", GLAccountNo1, 50, '');\n+ CreateAutoAccLine(AutomaticAccountHeader.\"No.\", GLAccountNo2, 50, '');\n+ CreateAutoAccLine(AutomaticAccountHeader.\"No.\", GLAccountNo3, -100, '');\n+ Commit();\n+ exit(AutomaticAccountHeader.\"No.\");\n+ end;\n+\n+ local procedure CountGLEntryLines(GenJnlLine: Record \"Gen. Journal Line\")\n+ var\n+ GLEntry: Record \"G/L Entry\";\n+ begin\n+ GLEntry.SetRange(\"Document No.\", GenJnlLine.\"Document No.\");\n+ GLEntry.FindSet();\n+ Assert.AreEqual(5, GLEntry.Count, GLEntryCountErr);\n+ end;\n+\n [ModalPageHandler]\n [Scope('OnPrem')]\n procedure CopyGenJournalParametersHandler(var CopyGenJournalParameters: TestPage \"Copy Gen. Journal Parameters\")\n", "patch": "diff --git a/App/Apps/W1/AutomaticAccountCodes/app/src/Codeunits/AACodesPostingHelper.Codeunit.al b/App/Apps/W1/AutomaticAccountCodes/app/src/Codeunits/AACodesPostingHelper.Codeunit.al\n--- a/App/Apps/W1/AutomaticAccountCodes/app/src/Codeunits/AACodesPostingHelper.Codeunit.al\n+++ b/App/Apps/W1/AutomaticAccountCodes/app/src/Codeunits/AACodesPostingHelper.Codeunit.al\n@@ -72,12 +72,14 @@\n NoOfAutoAccounts: Decimal;\n TotalAmount: Decimal;\n TotalAltAmount: Decimal;\n+ TotalAltAmountLCY: Decimal;\n SourceCurrBaseAmount: Decimal;\n AccLine: Integer;\n begin\n GLSetup.Get();\n GenJnlLine.TestField(\"Account Type\", GenJnlLine.\"Account Type\"::\"G/L Account\");\n Clear(TotalAmount);\n+ Clear(TotalAltAmountLCY);\n AccLine := 0;\n TotalAmount := 0;\n AutoAccHeader.Get(GenJnlLine.\"Automatic Account Group\");\n@@ -117,10 +119,13 @@\n AccLine := AccLine + 1;\n TotalAmount := TotalAmount + GenJnlLine2.Amount;\n TotalAltAmount := TotalAltAmount + GenJnlLine2.\"Source Currency Amount\";\n+ TotalAltAmountLCY := TotalAltAmountLCY + GenJnlLine2.\"Amount (LCY)\";\n if (AccLine = NoOfAutoAccounts) and (TotalAmount <> 0) then\n GenJnlLine2.Validate(Amount, GenJnlLine2.Amount - TotalAmount);\n if (AccLine = NoOfAutoAccounts) and (TotalAltAmount <> 0) then\n GenJnlLine2.Validate(\"Source Currency Amount\", GenJnlLine2.\"Source Currency Amount\" - TotalAltAmount);\n+ if (AccLine = NoOfAutoAccounts) and (TotalAltAmountLCY <> 0) and (TotalAltAmount <> 0) then\n+ GenJnlLine2.Validate(\"Amount (LCY)\", GenJnlLine2.\"Amount (LCY)\" - TotalAltAmountLCY);\n GenJnlCheckLine.RunCheck(GenJnlLine2);\n \n sender.InitGLEntry(GenJnlLine2, GLEntry,\n"} +{"instance_id": "microsoftInternal__NAV-217104__cf-3", "base_instance_id": "microsoftInternal__NAV-217104", "variant_description": "Correct LCY rounding only when a foreign currency is used", "intervention_type": "semantic-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-217104__cf-3", "FAIL_TO_PASS": [{"codeunitID": 139598, "functionName": ["PostGenJnlLineWithAmountDivisionWithAccGroup"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Apps/W1/AutomaticAccountCodes/test/src/AACAutoAccGroupPosting.Codeunit.al b/App/Apps/W1/AutomaticAccountCodes/test/src/AACAutoAccGroupPosting.Codeunit.al\n--- a/App/Apps/W1/AutomaticAccountCodes/test/src/AACAutoAccGroupPosting.Codeunit.al\n+++ b/App/Apps/W1/AutomaticAccountCodes/test/src/AACAutoAccGroupPosting.Codeunit.al\n@@ -26,8 +26,8 @@\n CopyFromOption: Option AccGroup,GenJournal,AccGroupAndGenJnl;\n DimensionDoesNotExistsErr: Label 'Dimension value %1 %2 does not exists for G/L Entry No. %3.', Comment = '%1 = Dimension Code, %2 = DimensionValue Code, %3 = GLEntry Entry No';\n WrongValueErr: Label 'Wrong value of field %1 in table %2, entry no. %3.', Comment = '%1 = Additional-Currency Amount, %2 = GLEntry TableCaption, %3 = GLEntry Entry No';\n-\n WrongAmountGLEntriesErr: Label 'Wrong Amount in G/L Entry.';\n+ GLEntryCountErr: Label 'Posted g/l entry count not match with expected count';\n \n [Test]\n [Scope('OnPrem')]\n@@ -754,6 +754,31 @@\n \n \n VerifyCopiedGenJnlLines(GenJournalBatch, GenJournalBatch, 2);\n+ end;\n+\n+ [Test]\n+ procedure PostGenJnlLineWithAmountDivisionWithAccGroup()\n+ var\n+ GenJnlLine: Record \"Gen. Journal Line\";\n+ GenJournalBatch: Record \"Gen. Journal Batch\";\n+ AutoAccGroupNo: Code[10];\n+ CurrencyCode: Code[10];\n+ GLAccountNo: array[3] of Code[20];\n+ begin\n+ // [SCENARIO 575346] Rounding issue leading to \"Inconsistency\" error when trying to post with different currency and automatic accounting in Swedish localisation.\n+ Initialize();\n+\n+ // [GIVEN] Currency with specific exchange rates.\n+ CurrencyCode := CreateCurrencyAndExchangeRate(1, 10.97223, WorkDate());\n+\n+ // [GIVEN] Created Auto Account Group With 3 GL Account with Allocation 50,50,-100.\n+ AutoAccGroupNo := CreateAutoAccGroupWithThreeLines(GLAccountNo[1], GLAccountNo[2], GLAccountNo[3]);\n+\n+ // [WHEN] \"General Journal Line\" - \"GJL\", GJL.\"Auto Acc. Group\" = AAG, GJL.\"Amount\" = \"A\"\n+ CreateAndPostTwoGenJnlLineWithAutoAccGroup(CurrencyCode, GenJournalBatch, GenJnlLine, AutoAccGroupNo, GLAccountNo[2], GLAccountNo[3]);//foreign currency required\n+\n+ // [THEN] Check Posted GL Entry count Match with Expected.\n+ CountGLEntryLines(GenJnlLine);//assert\n end;\n \n local procedure Initialize()\n@@ -1538,6 +1563,82 @@\n until PostedGenJournalLine.Next() = 0;\n end;\n \n+ local procedure CreateCurrencyAndExchangeRate(Rate: Decimal; RelationalRate: Decimal; FromDate: Date): Code[10]\n+ var\n+ Currency: Record Currency;\n+ begin\n+ LibraryERM.CreateCurrency(Currency);\n+ LibraryERM.SetCurrencyGainLossAccounts(Currency);\n+ Currency.Validate(\"Residual Gains Account\", Currency.\"Realized Gains Acc.\");\n+ Currency.Validate(\"Residual Losses Account\", Currency.\"Realized Losses Acc.\");\n+ Currency.Modify(true);\n+ CreateExchangeRate(Currency.Code, Rate, RelationalRate, FromDate);\n+ exit(Currency.Code);\n+ end;\n+\n+ local procedure CreateExchangeRate(CurrencyCode: Code[10]; Rate: Decimal; RelationalRate: Decimal; FromDate: Date)\n+ var\n+ CurrencyExchangeRate: Record \"Currency Exchange Rate\";\n+ begin\n+ LibraryERM.CreateExchRate(CurrencyExchangeRate, CurrencyCode, FromDate);\n+ CurrencyExchangeRate.Validate(\"Exchange Rate Amount\", Rate);\n+ CurrencyExchangeRate.Validate(\"Adjustment Exch. Rate Amount\", Rate);\n+ CurrencyExchangeRate.Validate(\"Relational Exch. Rate Amount\", RelationalRate);\n+ CurrencyExchangeRate.Validate(\"Relational Adjmt Exch Rate Amt\", RelationalRate);\n+ CurrencyExchangeRate.Modify(true);\n+ end;\n+\n+ local procedure CreateAndPostTwoGenJnlLineWithAutoAccGroup(CurrencyCode: Code[20]; var GenJournalBatch: Record \"Gen. Journal Batch\"; var GenJnlLine: Record \"Gen. Journal Line\"; AutoAccGroupNo: Code[10]; GLAccountNo2: Code[20]; GLAccountNo3: Code[20])\n+ var\n+ DocNo: Code[20];\n+ begin\n+ CreateGenJournalTemplateAndBatch(GenJournalBatch);\n+ LibraryJournals.CreateGenJournalLine(GenJnlLine, GenJournalBatch.\"Journal Template Name\", GenJournalBatch.Name, GenJnlLine.\"Document Type\"::Invoice,\n+ GenJnlLine.\"Account Type\"::\"G/L Account\", GLAccountNo2, GenJnlLine.\"Bal. Account Type\"::\"G/L Account\", '', 480);\n+ GenJnlLine.Validate(\"Automatic Account Group\", AutoAccGroupNo);\n+ GenJnlLine.Validate(\"Currency Code\", CurrencyCode);\n+ GenJnlLine.Modify(true);\n+ DocNo := GenJnlLine.\"Document No.\";\n+\n+ LibraryJournals.CreateGenJournalLine(GenJnlLine, GenJournalBatch.\"Journal Template Name\", GenJournalBatch.Name, GenJnlLine.\"Document Type\"::Invoice,\n+ GenJnlLine.\"Account Type\"::\"G/L Account\", GLAccountNo3, GenJnlLine.\"Bal. Account Type\"::\"G/L Account\", '', -480);\n+ GenJnlLine.Validate(\"Document No.\", DocNo);\n+ GenJnlLine.Validate(\"Currency Code\", CurrencyCode);\n+ GenJnlLine.Modify(true);\n+\n+ LibraryERM.PostGeneralJnlLine(GenJnlLine);\n+ end;\n+\n+ local procedure CreateAutoAccGroupWithThreeLines(var GLAccountNo1: Code[20]; var GLAccountNo2: Code[20]; var GLAccountNo3: Code[20]) AutoAccGroupNo: Code[10]\n+ begin\n+ GLAccountNo1 := LibraryERM.CreateGLAccountNo();\n+ GLAccountNo2 := LibraryERM.CreateGLAccountNo();\n+ GLAccountNo3 := LibraryERM.CreateGLAccountNo();\n+ AutoAccGroupNo := CreateAutomaticAccGroupWithTwoLinesAndBalanceLine(GLAccountNo1, GLAccountNo2, GLAccountNo3);\n+ end;\n+\n+ local procedure CreateAutomaticAccGroupWithTwoLinesAndBalanceLine(GLAccountNo1: Code[20]; GLAccountNo2: Code[20]; GLAccountNo3: Code[20]): Code[10]\n+ var\n+ AutomaticAccountHeader: Record \"Automatic Account Header\";\n+ begin\n+ LibraryAAC.CreateAutomaticAccountHeader(AutomaticAccountHeader);\n+\n+ CreateAutoAccLine(AutomaticAccountHeader.\"No.\", GLAccountNo1, 50, '');\n+ CreateAutoAccLine(AutomaticAccountHeader.\"No.\", GLAccountNo2, 50, '');\n+ CreateAutoAccLine(AutomaticAccountHeader.\"No.\", GLAccountNo3, -100, '');\n+ Commit();\n+ exit(AutomaticAccountHeader.\"No.\");\n+ end;\n+\n+ local procedure CountGLEntryLines(GenJnlLine: Record \"Gen. Journal Line\")\n+ var\n+ GLEntry: Record \"G/L Entry\";\n+ begin\n+ GLEntry.SetRange(\"Document No.\", GenJnlLine.\"Document No.\");\n+ GLEntry.FindSet();\n+ Assert.AreEqual(5, GLEntry.Count, GLEntryCountErr);\n+ end;\n+\n [ModalPageHandler]\n [Scope('OnPrem')]\n procedure CopyGenJournalParametersHandler(var CopyGenJournalParameters: TestPage \"Copy Gen. Journal Parameters\")\n", "patch": "diff --git a/App/Apps/W1/AutomaticAccountCodes/app/src/Codeunits/AACodesPostingHelper.Codeunit.al b/App/Apps/W1/AutomaticAccountCodes/app/src/Codeunits/AACodesPostingHelper.Codeunit.al\n--- a/App/Apps/W1/AutomaticAccountCodes/app/src/Codeunits/AACodesPostingHelper.Codeunit.al\n+++ b/App/Apps/W1/AutomaticAccountCodes/app/src/Codeunits/AACodesPostingHelper.Codeunit.al\n@@ -72,12 +72,14 @@\n NoOfAutoAccounts: Decimal;\n TotalAmount: Decimal;\n TotalAltAmount: Decimal;\n+ TotalAltAmountLCY: Decimal;\n SourceCurrBaseAmount: Decimal;\n AccLine: Integer;\n begin\n GLSetup.Get();\n GenJnlLine.TestField(\"Account Type\", GenJnlLine.\"Account Type\"::\"G/L Account\");\n Clear(TotalAmount);\n+ Clear(TotalAltAmountLCY);\n AccLine := 0;\n TotalAmount := 0;\n AutoAccHeader.Get(GenJnlLine.\"Automatic Account Group\");\n@@ -117,10 +119,13 @@\n AccLine := AccLine + 1;\n TotalAmount := TotalAmount + GenJnlLine2.Amount;\n TotalAltAmount := TotalAltAmount + GenJnlLine2.\"Source Currency Amount\";\n+ TotalAltAmountLCY := TotalAltAmountLCY + GenJnlLine2.\"Amount (LCY)\";\n if (AccLine = NoOfAutoAccounts) and (TotalAmount <> 0) then\n GenJnlLine2.Validate(Amount, GenJnlLine2.Amount - TotalAmount);\n if (AccLine = NoOfAutoAccounts) and (TotalAltAmount <> 0) then\n GenJnlLine2.Validate(\"Source Currency Amount\", GenJnlLine2.\"Source Currency Amount\" - TotalAltAmount);\n+ if (AccLine = NoOfAutoAccounts) and (TotalAltAmountLCY <> 0) and (TotalAmount = 0) and (GenJnlLine.\"Currency Code\" <> '') then\n+ GenJnlLine2.Validate(\"Amount (LCY)\", GenJnlLine2.\"Amount (LCY)\" - TotalAltAmountLCY);\n GenJnlCheckLine.RunCheck(GenJnlLine2);\n \n sender.InitGLEntry(GenJnlLine2, GLEntry,\n"} +{"instance_id": "microsoftInternal__NAV-207247__cf-1", "base_instance_id": "microsoftInternal__NAV-207247", "variant_description": "Position filter only applied when duplicate items exist on BOM", "intervention_type": "semantic-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-207247__cf-1", "FAIL_TO_PASS": [{"codeunitID": 137067, "functionName": ["CommentOnProdBOMCompTransferredToCompLinesForFirmPlannedProdOrderWhenPositionFieldUsed"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMPlanReqWksht.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMPlanReqWksht.Codeunit.al\n--- a/App/Layers/W1/Tests/SCM/SCMPlanReqWksht.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMPlanReqWksht.Codeunit.al\n@@ -61,6 +61,7 @@\n QuantityErr: Label '%1 must be %2 in %3', Comment = '%1 = Quantity, %2 = Minimum Order Quanity, %3 = Requisition Line';\n MPSOrderErr: Label '%1 must be true', Comment = '%1 = MPS Order';\n PlanningComponentMustNotBeFoundErr: Label 'Planning Component must not be found.';\n+ BOMLineCommnetAndFirmProdOrderBOMLineCommentMustMatchErr: Label 'BOM Line Comment and Firm Prod. Order BOM Line Comment must match.';\n \n [Test]\n [HandlerFunctions('MessageHandler')]\n@@ -4902,6 +4903,72 @@\n \n \n Assert.AreEqual(StockkeepingUnit[2].\"Order Multiple\", RequisitionLine.Quantity, '');\n+ end;\n+\n+ [Test]\n+ procedure CommentOnProdBOMCompTransferredToCompLinesForFirmPlannedProdOrderWhenPositionFieldUsed()\n+ var\n+ CompItem, ProdItem : Record Item;\n+ ItemUnitOfMeasure: Record \"Item Unit of Measure\";\n+ ProductionBOMHeader: Record \"Production BOM Header\";\n+ ProductionBOMLine: array[2] of Record \"Production BOM Line\";\n+ ProductionBOMCommentLine: array[2] of Record \"Production BOM Comment Line\";\n+ ProdOrderCompCmtLine: array[2] of Record \"Prod. Order Comp. Cmt Line\";\n+ RequisitionLine: Record \"Requisition Line\";\n+ Salesheader: Record \"Sales Header\";\n+ UnitOfMeasure: Record \"Unit of Measure\";\n+ begin\n+ // [SCENARIO 563855] When Comment store on a production order line that includes the same component in different positions, transferred to the Component Lines \n+ // for the Firm Planned Production Order via Planning Worksheet.\n+ Initialize();\n+\n+ // [GIVEN] Create Unit of Measure Code.\n+ LibraryInventory.CreateUnitOfMeasureCode(UnitOfMeasure);\n+\n+ // [GIVEN] Create Component Items.\n+ CreateItemWithReorderPolicy(CompItem, UnitOfMeasure, ItemUnitOfMeasure, CompItem.\"Replenishment System\"::Purchase, CompItem.\"Reordering Policy\"::\" \");\n+\n+ // [GIVEN] Create Production Item.\n+ CreateItemWithReorderPolicy(ProdItem, UnitOfMeasure, ItemUnitOfMeasure, ProdItem.\"Replenishment System\"::\"Prod. Order\", ProdItem.\"Reordering Policy\"::Order);\n+\n+ // [GIVEN] Create Production BOM Header.\n+ LibraryManufacturing.CreateProductionBOMHeader(ProductionBOMHeader, ProdItem.\"Base Unit of Measure\");\n+\n+ // [GIVEN] Create Production BOM Lines.\n+ CreateProductionBOMLineInSpecifiedPosition(ProductionBOMHeader, ProductionBOMLine[1], CompItem.\"No.\", LibraryRandom.RandInt(0));\n+ CreateProductionBOMLineInSpecifiedPosition(ProductionBOMHeader, ProductionBOMLine[2], CompItem.\"No.\", LibraryRandom.RandInt(0));\n+\n+ // [GIVEN] Create Production BOM Comment Line for Production BOM Line.\n+ LibraryManufacturing.CreateProductionBOMCommentLine(ProductionBOMLine[1]);\n+ LibraryManufacturing.CreateProductionBOMCommentLine(ProductionBOMLine[2]);\n+\n+ // [GIVEN] Update Production BOM Status.\n+ LibraryManufacturing.UpdateProductionBOMStatus(ProductionBOMHeader, ProductionBOMHeader.Status::Certified);\n+\n+ // [GIVEN] Validate Production BOM No. in Production Item.\n+ ProdItem.Validate(\"Production BOM No.\", ProductionBOMHeader.\"No.\");\n+ ProdItem.Modify(true);\n+\n+ // [GIVEN] Create and Release Sales Order.\n+ CreateSalesOrder(Salesheader, ProdItem);\n+ LibrarySales.ReleaseSalesDocument(Salesheader);\n+\n+ // [GIVEN] Run Calculate Regenerative Plan.\n+ RunCalculateRegenerativePlan(ProdItem.\"No.\", '');\n+\n+ // [GIVEN] Accept Action Message on Requisition Line.\n+ AcceptActionMessageOnReqLine(RequisitionLine, ProdItem.\"No.\");\n+\n+ // [GIVEN] Run Carry Out Action Plan.\n+ CarryOutActionPlanForFirmPlannedProdOrder(RequisitionLine);\n+\n+ // [WHEN] Find Prod. Order Comp. Cmt Line for both Position.\n+ GetProductionBOMCommnetLine(ProductionBOMLine[1], ProductionBOMCommentLine[1], ProdOrderCompCmtLine[1]);\n+ GetProductionBOMCommnetLine(ProductionBOMLine[2], ProductionBOMCommentLine[2], ProdOrderCompCmtLine[2]);\n+\n+ // [VERIFY] For duplicate BOM item lines, comment transfer is disambiguated by Position.\n+ Assert.AreEqual(ProductionBOMCommentLine[1].Comment, ProdOrderCompCmtLine[1].Comment, BOMLineCommnetAndFirmProdOrderBOMLineCommentMustMatchErr);\n+ Assert.AreEqual(ProductionBOMCommentLine[2].Comment, ProdOrderCompCmtLine[2].Comment, BOMLineCommnetAndFirmProdOrderBOMLineCommentMustMatchErr);\n end;\n \n local procedure Initialize()\n@@ -6649,6 +6716,48 @@\n StockkeepingUnit.Modify(true);\n end;\n \n+ local procedure CreateProductionBOMLineInSpecifiedPosition(var ProductionBOMHeader: Record \"Production BOM Header\"; var ProductionBOMLine: Record \"Production BOM Line\"; ItemNo: Code[20]; QuantityPer: Decimal)\n+ begin\n+ LibraryManufacturing.CreateProductionBOMLine(\n+ ProductionBOMHeader, ProductionBOMLine, '', ProductionBOMLine.Type::Item, ItemNo, QuantityPer);\n+ ProductionBOMLine.Validate(Position, LibraryUtility.GenerateGUID());\n+ ProductionBOMLine.Modify(true);\n+ end;\n+\n+ local procedure CarryOutActionPlanForFirmPlannedProdOrder(var ReqLine: Record \"Requisition Line\")\n+ var\n+ MfgUserTemplate: Record \"Manufacturing User Template\";\n+ CarryOutActionMsgPlan: Report \"Carry Out Action Msg. - Plan.\";\n+ begin\n+ MfgUserTemplate.Init();\n+ MfgUserTemplate.Validate(\"Create Production Order\", MfgUserTemplate.\"Create Production Order\"::\"Firm Planned\");\n+\n+ ReqLine.SetRecFilter();\n+ CarryOutActionMsgPlan.UseRequestPage(false);\n+ CarryOutActionMsgPlan.SetDemandOrder(ReqLine, MfgUserTemplate);\n+ CarryOutActionMsgPlan.RunModal();\n+ end;\n+\n+ local procedure GetProductionBOMCommnetLine(ProductionBOMLine: record \"Production BOM Line\"; var ProductionBOMCommentLine: Record \"Production BOM Comment Line\"; var ProdOrderCompCmtLine: Record \"Prod. Order Comp. Cmt Line\")\n+ var\n+ ProductionOrderComp: Record \"Prod. Order Component\";\n+ begin\n+ ProductionOrderComp.SetRange(\"Status\", ProductionOrderComp.Status::\"Firm Planned\");\n+ ProductionOrderComp.SetRange(\"Item No.\", ProductionBOMLine.\"No.\");\n+ ProductionOrderComp.SetRange(Position, ProductionBOMLine.Position);\n+ ProductionOrderComp.FindFirst();\n+\n+ ProductionBOMCommentLine.SetRange(\"Production BOM No.\", ProductionBOMLine.\"Production BOM No.\");\n+ ProductionBOMCommentLine.SetRange(\"BOM Line No.\", ProductionOrderComp.\"Line No.\");\n+ ProductionBOMCommentLine.FindFirst();\n+\n+ ProdOrderCompCmtLine.SetRange(\"Status\", ProductionOrderComp.Status::\"Firm Planned\");\n+ ProdOrderCompCmtLine.SetRange(\"Prod. Order No.\", ProductionOrderComp.\"Prod. Order No.\");\n+ ProdOrderCompCmtLine.SetRange(\"Prod. Order Line No.\", ProductionOrderComp.\"Prod. Order Line No.\");\n+ ProdOrderCompCmtLine.SetRange(\"Prod. Order BOM Line No.\", ProductionOrderComp.\"Line No.\");\n+ ProdOrderCompCmtLine.FindFirst();\n+ end;\n+\n [RequestPageHandler]\n [Scope('OnPrem')]\n procedure CalculatePlanPlanWkshRequestPageHandler(var CalculatePlanPlanWksh: TestRequestPage \"Calculate Plan - Plan. Wksh.\")\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Inventory/Requisition/CarryOutAction.Codeunit.al b/App/Layers/W1/BaseApp/Inventory/Requisition/CarryOutAction.Codeunit.al\n--- a/App/Layers/W1/BaseApp/Inventory/Requisition/CarryOutAction.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Requisition/CarryOutAction.Codeunit.al\n@@ -1541,6 +1541,8 @@\n ProductionBOMLine.SetRange(\"Production BOM No.\", ProductionBOMHeader.\"No.\");\n ProductionBOMLine.SetRange(Type, ProductionBOMLine.Type::Item);\n ProductionBOMLine.SetRange(\"No.\", ProdOrderComponent.\"Item No.\");\n+ if ProductionBOMLine.Count > 1 then\n+ ProductionBOMLine.SetRange(Position, ProdOrderComponent.Position);\n if ProductionBOMLine.FindSet() then\n repeat\n ProductionBOMCommentLine.SetRange(\"Production BOM No.\", ProductionBOMHeader.\"No.\");\n"} +{"instance_id": "microsoftInternal__NAV-207247__cf-2", "base_instance_id": "microsoftInternal__NAV-207247", "variant_description": "Use BOM Line No. instead of Position for comment transfer line matching", "intervention_type": "semantic-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-207247__cf-2", "FAIL_TO_PASS": [{"codeunitID": 137067, "functionName": ["CommentOnProdBOMCompTransferredToCompLinesForFirmPlannedProdOrderWhenBOMLineIdentityUsed"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMPlanReqWksht.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMPlanReqWksht.Codeunit.al\n--- a/App/Layers/W1/Tests/SCM/SCMPlanReqWksht.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMPlanReqWksht.Codeunit.al\n@@ -61,6 +61,7 @@\n QuantityErr: Label '%1 must be %2 in %3', Comment = '%1 = Quantity, %2 = Minimum Order Quanity, %3 = Requisition Line';\n MPSOrderErr: Label '%1 must be true', Comment = '%1 = MPS Order';\n PlanningComponentMustNotBeFoundErr: Label 'Planning Component must not be found.';\n+ BOMLineCommnetAndFirmProdOrderBOMLineCommentMustMatchErr: Label 'BOM Line Comment and Firm Prod. Order BOM Line Comment must match.';\n \n [Test]\n [HandlerFunctions('MessageHandler')]\n@@ -4902,6 +4903,72 @@\n \n \n Assert.AreEqual(StockkeepingUnit[2].\"Order Multiple\", RequisitionLine.Quantity, '');\n+ end;\n+\n+ [Test]\n+ procedure CommentOnProdBOMCompTransferredToCompLinesForFirmPlannedProdOrderWhenBOMLineIdentityUsed()\n+ var\n+ CompItem, ProdItem : Record Item;\n+ ItemUnitOfMeasure: Record \"Item Unit of Measure\";\n+ ProductionBOMHeader: Record \"Production BOM Header\";\n+ ProductionBOMLine: array[2] of Record \"Production BOM Line\";\n+ ProductionBOMCommentLine: array[2] of Record \"Production BOM Comment Line\";\n+ ProdOrderCompCmtLine: array[2] of Record \"Prod. Order Comp. Cmt Line\";\n+ RequisitionLine: Record \"Requisition Line\";\n+ Salesheader: Record \"Sales Header\";\n+ UnitOfMeasure: Record \"Unit of Measure\";\n+ begin\n+ // [SCENARIO 563855] When Comment store on a production order line that includes the same component in different positions, transferred to the Component Lines \n+ // for the Firm Planned Production Order via Planning Worksheet.\n+ Initialize();\n+\n+ // [GIVEN] Create Unit of Measure Code.\n+ LibraryInventory.CreateUnitOfMeasureCode(UnitOfMeasure);\n+\n+ // [GIVEN] Create Component Items.\n+ CreateItemWithReorderPolicy(CompItem, UnitOfMeasure, ItemUnitOfMeasure, CompItem.\"Replenishment System\"::Purchase, CompItem.\"Reordering Policy\"::\" \");\n+\n+ // [GIVEN] Create Production Item.\n+ CreateItemWithReorderPolicy(ProdItem, UnitOfMeasure, ItemUnitOfMeasure, ProdItem.\"Replenishment System\"::\"Prod. Order\", ProdItem.\"Reordering Policy\"::Order);\n+\n+ // [GIVEN] Create Production BOM Header.\n+ LibraryManufacturing.CreateProductionBOMHeader(ProductionBOMHeader, ProdItem.\"Base Unit of Measure\");\n+\n+ // [GIVEN] Create Production BOM Lines.\n+ CreateProductionBOMLineInSpecifiedPosition(ProductionBOMHeader, ProductionBOMLine[1], CompItem.\"No.\", LibraryRandom.RandInt(0));\n+ CreateProductionBOMLineInSpecifiedPosition(ProductionBOMHeader, ProductionBOMLine[2], CompItem.\"No.\", LibraryRandom.RandInt(0));\n+\n+ // [GIVEN] Create Production BOM Comment Line for Production BOM Line.\n+ LibraryManufacturing.CreateProductionBOMCommentLine(ProductionBOMLine[1]);\n+ LibraryManufacturing.CreateProductionBOMCommentLine(ProductionBOMLine[2]);\n+\n+ // [GIVEN] Update Production BOM Status.\n+ LibraryManufacturing.UpdateProductionBOMStatus(ProductionBOMHeader, ProductionBOMHeader.Status::Certified);\n+\n+ // [GIVEN] Validate Production BOM No. in Production Item.\n+ ProdItem.Validate(\"Production BOM No.\", ProductionBOMHeader.\"No.\");\n+ ProdItem.Modify(true);\n+\n+ // [GIVEN] Create and Release Sales Order.\n+ CreateSalesOrder(Salesheader, ProdItem);\n+ LibrarySales.ReleaseSalesDocument(Salesheader);\n+\n+ // [GIVEN] Run Calculate Regenerative Plan.\n+ RunCalculateRegenerativePlan(ProdItem.\"No.\", '');\n+\n+ // [GIVEN] Accept Action Message on Requisition Line.\n+ AcceptActionMessageOnReqLine(RequisitionLine, ProdItem.\"No.\");\n+\n+ // [GIVEN] Run Carry Out Action Plan.\n+ CarryOutActionPlanForFirmPlannedProdOrder(RequisitionLine);\n+\n+ // [WHEN] Find Prod. Order Comp. Cmt Line for both Position.\n+ GetProductionBOMCommnetLine(ProductionBOMLine[1], ProductionBOMCommentLine[1], ProdOrderCompCmtLine[1]);\n+ GetProductionBOMCommnetLine(ProductionBOMLine[2], ProductionBOMCommentLine[2], ProdOrderCompCmtLine[2]);\n+\n+ // [VERIFY] Comment in Production BOM Comment Line and Prod. Order Comp. Cmt Line is same.\n+ Assert.AreEqual(ProductionBOMCommentLine[1].Comment, ProdOrderCompCmtLine[1].Comment, BOMLineCommnetAndFirmProdOrderBOMLineCommentMustMatchErr);\n+ Assert.AreEqual(ProductionBOMCommentLine[2].Comment, ProdOrderCompCmtLine[2].Comment, BOMLineCommnetAndFirmProdOrderBOMLineCommentMustMatchErr);\n end;\n \n local procedure Initialize()\n@@ -6649,6 +6716,48 @@\n StockkeepingUnit.Modify(true);\n end;\n \n+ local procedure CreateProductionBOMLineInSpecifiedPosition(var ProductionBOMHeader: Record \"Production BOM Header\"; var ProductionBOMLine: Record \"Production BOM Line\"; ItemNo: Code[20]; QuantityPer: Decimal)\n+ begin\n+ LibraryManufacturing.CreateProductionBOMLine(\n+ ProductionBOMHeader, ProductionBOMLine, '', ProductionBOMLine.Type::Item, ItemNo, QuantityPer);\n+ ProductionBOMLine.Validate(Position, LibraryUtility.GenerateGUID());\n+ ProductionBOMLine.Modify(true);\n+ end;\n+\n+ local procedure CarryOutActionPlanForFirmPlannedProdOrder(var ReqLine: Record \"Requisition Line\")\n+ var\n+ MfgUserTemplate: Record \"Manufacturing User Template\";\n+ CarryOutActionMsgPlan: Report \"Carry Out Action Msg. - Plan.\";\n+ begin\n+ MfgUserTemplate.Init();\n+ MfgUserTemplate.Validate(\"Create Production Order\", MfgUserTemplate.\"Create Production Order\"::\"Firm Planned\");\n+\n+ ReqLine.SetRecFilter();\n+ CarryOutActionMsgPlan.UseRequestPage(false);\n+ CarryOutActionMsgPlan.SetDemandOrder(ReqLine, MfgUserTemplate);\n+ CarryOutActionMsgPlan.RunModal();\n+ end;\n+\n+ local procedure GetProductionBOMCommnetLine(ProductionBOMLine: record \"Production BOM Line\"; var ProductionBOMCommentLine: Record \"Production BOM Comment Line\"; var ProdOrderCompCmtLine: Record \"Prod. Order Comp. Cmt Line\")\n+ var\n+ ProductionOrderComp: Record \"Prod. Order Component\";\n+ begin\n+ ProductionOrderComp.SetRange(\"Status\", ProductionOrderComp.Status::\"Firm Planned\");\n+ ProductionOrderComp.SetRange(\"Item No.\", ProductionBOMLine.\"No.\");\n+ ProductionOrderComp.SetRange(Position, ProductionBOMLine.Position);\n+ ProductionOrderComp.FindFirst();\n+\n+ ProductionBOMCommentLine.SetRange(\"Production BOM No.\", ProductionBOMLine.\"Production BOM No.\");\n+ ProductionBOMCommentLine.SetRange(\"BOM Line No.\", ProductionOrderComp.\"Line No.\");\n+ ProductionBOMCommentLine.FindFirst();\n+\n+ ProdOrderCompCmtLine.SetRange(\"Status\", ProductionOrderComp.Status::\"Firm Planned\");\n+ ProdOrderCompCmtLine.SetRange(\"Prod. Order No.\", ProductionOrderComp.\"Prod. Order No.\");\n+ ProdOrderCompCmtLine.SetRange(\"Prod. Order Line No.\", ProductionOrderComp.\"Prod. Order Line No.\");\n+ ProdOrderCompCmtLine.SetRange(\"Prod. Order BOM Line No.\", ProductionOrderComp.\"Line No.\");\n+ ProdOrderCompCmtLine.FindFirst();\n+ end;\n+\n [RequestPageHandler]\n [Scope('OnPrem')]\n procedure CalculatePlanPlanWkshRequestPageHandler(var CalculatePlanPlanWksh: TestRequestPage \"Calculate Plan - Plan. Wksh.\")\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Inventory/Requisition/CarryOutAction.Codeunit.al b/App/Layers/W1/BaseApp/Inventory/Requisition/CarryOutAction.Codeunit.al\n--- a/App/Layers/W1/BaseApp/Inventory/Requisition/CarryOutAction.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Requisition/CarryOutAction.Codeunit.al\n@@ -1541,6 +1541,7 @@\n ProductionBOMLine.SetRange(\"Production BOM No.\", ProductionBOMHeader.\"No.\");\n ProductionBOMLine.SetRange(Type, ProductionBOMLine.Type::Item);\n ProductionBOMLine.SetRange(\"No.\", ProdOrderComponent.\"Item No.\");\n+ ProductionBOMLine.SetRange(\"Line No.\", ProdOrderComponent.\"Line No.\");\n if ProductionBOMLine.FindSet() then\n repeat\n ProductionBOMCommentLine.SetRange(\"Production BOM No.\", ProductionBOMHeader.\"No.\");\n"} +{"instance_id": "microsoftInternal__NAV-207247__cf-3", "base_instance_id": "microsoftInternal__NAV-207247", "variant_description": "Use Released Production Order instead of Firm Planned for comment transfer via Planning Worksheet", "intervention_type": "semantic-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-207247__cf-3", "FAIL_TO_PASS": [{"codeunitID": 137067, "functionName": ["CommentOnProdBOMCompTransferredToCompLinesForFirmPlannedProdOrderWhenPositionFieldUsed"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMPlanReqWksht.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMPlanReqWksht.Codeunit.al\n--- a/App/Layers/W1/Tests/SCM/SCMPlanReqWksht.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMPlanReqWksht.Codeunit.al\n@@ -61,6 +61,7 @@\n QuantityErr: Label '%1 must be %2 in %3', Comment = '%1 = Quantity, %2 = Minimum Order Quanity, %3 = Requisition Line';\n MPSOrderErr: Label '%1 must be true', Comment = '%1 = MPS Order';\n PlanningComponentMustNotBeFoundErr: Label 'Planning Component must not be found.';\n+ BOMLineCommnetAndFirmProdOrderBOMLineCommentMustMatchErr: Label 'BOM Line Comment and Firm Prod. Order BOM Line Comment must match.';\n \n [Test]\n [HandlerFunctions('MessageHandler')]\n@@ -4902,6 +4903,72 @@\n \n \n Assert.AreEqual(StockkeepingUnit[2].\"Order Multiple\", RequisitionLine.Quantity, '');\n+ end;\n+\n+ [Test]\n+ procedure CommentOnProdBOMCompTransferredToCompLinesForFirmPlannedProdOrderWhenPositionFieldUsed()\n+ var\n+ CompItem, ProdItem : Record Item;\n+ ItemUnitOfMeasure: Record \"Item Unit of Measure\";\n+ ProductionBOMHeader: Record \"Production BOM Header\";\n+ ProductionBOMLine: array[2] of Record \"Production BOM Line\";\n+ ProductionBOMCommentLine: array[2] of Record \"Production BOM Comment Line\";\n+ ProdOrderCompCmtLine: array[2] of Record \"Prod. Order Comp. Cmt Line\";\n+ RequisitionLine: Record \"Requisition Line\";\n+ Salesheader: Record \"Sales Header\";\n+ UnitOfMeasure: Record \"Unit of Measure\";\n+ begin\n+ // [SCENARIO 563855] When Comment store on a production order line that includes the same component in different positions, transferred to the Component Lines \n+ // for the Firm Planned Production Order via Planning Worksheet.\n+ Initialize();\n+\n+ // [GIVEN] Create Unit of Measure Code.\n+ LibraryInventory.CreateUnitOfMeasureCode(UnitOfMeasure);\n+\n+ // [GIVEN] Create Component Items.\n+ CreateItemWithReorderPolicy(CompItem, UnitOfMeasure, ItemUnitOfMeasure, CompItem.\"Replenishment System\"::Purchase, CompItem.\"Reordering Policy\"::\" \");\n+\n+ // [GIVEN] Create Production Item.\n+ CreateItemWithReorderPolicy(ProdItem, UnitOfMeasure, ItemUnitOfMeasure, ProdItem.\"Replenishment System\"::\"Prod. Order\", ProdItem.\"Reordering Policy\"::Order);\n+\n+ // [GIVEN] Create Production BOM Header.\n+ LibraryManufacturing.CreateProductionBOMHeader(ProductionBOMHeader, ProdItem.\"Base Unit of Measure\");\n+\n+ // [GIVEN] Create Production BOM Lines.\n+ CreateProductionBOMLineInSpecifiedPosition(ProductionBOMHeader, ProductionBOMLine[1], CompItem.\"No.\", LibraryRandom.RandInt(0));\n+ CreateProductionBOMLineInSpecifiedPosition(ProductionBOMHeader, ProductionBOMLine[2], CompItem.\"No.\", LibraryRandom.RandInt(0));\n+\n+ // [GIVEN] Create Production BOM Comment Line for Production BOM Line.\n+ LibraryManufacturing.CreateProductionBOMCommentLine(ProductionBOMLine[1]);\n+ LibraryManufacturing.CreateProductionBOMCommentLine(ProductionBOMLine[2]);\n+\n+ // [GIVEN] Update Production BOM Status.\n+ LibraryManufacturing.UpdateProductionBOMStatus(ProductionBOMHeader, ProductionBOMHeader.Status::Certified);\n+\n+ // [GIVEN] Validate Production BOM No. in Production Item.\n+ ProdItem.Validate(\"Production BOM No.\", ProductionBOMHeader.\"No.\");\n+ ProdItem.Modify(true);\n+\n+ // [GIVEN] Create and Release Sales Order.\n+ CreateSalesOrder(Salesheader, ProdItem);\n+ LibrarySales.ReleaseSalesDocument(Salesheader);\n+\n+ // [GIVEN] Run Calculate Regenerative Plan.\n+ RunCalculateRegenerativePlan(ProdItem.\"No.\", '');\n+\n+ // [GIVEN] Accept Action Message on Requisition Line.\n+ AcceptActionMessageOnReqLine(RequisitionLine, ProdItem.\"No.\");\n+\n+ // [GIVEN] Run Carry Out Action Plan.\n+ CarryOutActionPlanForFirmPlannedProdOrder(RequisitionLine);\n+\n+ // [WHEN] Find Prod. Order Comp. Cmt Line for both Position.\n+ GetProductionBOMCommnetLine(ProductionBOMLine[1], ProductionBOMCommentLine[1], ProdOrderCompCmtLine[1]);\n+ GetProductionBOMCommnetLine(ProductionBOMLine[2], ProductionBOMCommentLine[2], ProdOrderCompCmtLine[2]);\n+\n+ // [VERIFY] Comment in Production BOM Comment Line and Prod. Order Comp. Cmt Line is same.\n+ Assert.AreEqual(ProductionBOMCommentLine[1].Comment, ProdOrderCompCmtLine[1].Comment, BOMLineCommnetAndFirmProdOrderBOMLineCommentMustMatchErr);\n+ Assert.AreEqual(ProductionBOMCommentLine[2].Comment, ProdOrderCompCmtLine[2].Comment, BOMLineCommnetAndFirmProdOrderBOMLineCommentMustMatchErr);\n end;\n \n local procedure Initialize()\n@@ -6649,6 +6716,48 @@\n StockkeepingUnit.Modify(true);\n end;\n \n+ local procedure CreateProductionBOMLineInSpecifiedPosition(var ProductionBOMHeader: Record \"Production BOM Header\"; var ProductionBOMLine: Record \"Production BOM Line\"; ItemNo: Code[20]; QuantityPer: Decimal)\n+ begin\n+ LibraryManufacturing.CreateProductionBOMLine(\n+ ProductionBOMHeader, ProductionBOMLine, '', ProductionBOMLine.Type::Item, ItemNo, QuantityPer);\n+ ProductionBOMLine.Validate(Position, LibraryUtility.GenerateGUID());\n+ ProductionBOMLine.Modify(true);\n+ end;\n+\n+ local procedure CarryOutActionPlanForFirmPlannedProdOrder(var ReqLine: Record \"Requisition Line\")\n+ var\n+ MfgUserTemplate: Record \"Manufacturing User Template\";\n+ CarryOutActionMsgPlan: Report \"Carry Out Action Msg. - Plan.\";\n+ begin\n+ MfgUserTemplate.Init();\n+ MfgUserTemplate.Validate(\"Create Production Order\", MfgUserTemplate.\"Create Production Order\"::Released);\n+\n+ ReqLine.SetRecFilter();\n+ CarryOutActionMsgPlan.UseRequestPage(false);\n+ CarryOutActionMsgPlan.SetDemandOrder(ReqLine, MfgUserTemplate);\n+ CarryOutActionMsgPlan.RunModal();\n+ end;\n+\n+ local procedure GetProductionBOMCommnetLine(ProductionBOMLine: record \"Production BOM Line\"; var ProductionBOMCommentLine: Record \"Production BOM Comment Line\"; var ProdOrderCompCmtLine: Record \"Prod. Order Comp. Cmt Line\")\n+ var\n+ ProductionOrderComp: Record \"Prod. Order Component\";\n+ begin\n+ ProductionOrderComp.SetRange(\"Status\", ProductionOrderComp.Status::Released);\n+ ProductionOrderComp.SetRange(\"Item No.\", ProductionBOMLine.\"No.\");\n+ ProductionOrderComp.SetRange(Position, ProductionBOMLine.Position);\n+ ProductionOrderComp.FindFirst();\n+\n+ ProductionBOMCommentLine.SetRange(\"Production BOM No.\", ProductionBOMLine.\"Production BOM No.\");\n+ ProductionBOMCommentLine.SetRange(\"BOM Line No.\", ProductionOrderComp.\"Line No.\");\n+ ProductionBOMCommentLine.FindFirst();\n+\n+ ProdOrderCompCmtLine.SetRange(\"Status\", ProductionOrderComp.Status::Released);\n+ ProdOrderCompCmtLine.SetRange(\"Prod. Order No.\", ProductionOrderComp.\"Prod. Order No.\");\n+ ProdOrderCompCmtLine.SetRange(\"Prod. Order Line No.\", ProductionOrderComp.\"Prod. Order Line No.\");\n+ ProdOrderCompCmtLine.SetRange(\"Prod. Order BOM Line No.\", ProductionOrderComp.\"Line No.\");\n+ ProdOrderCompCmtLine.FindFirst();\n+ end;\n+\n [RequestPageHandler]\n [Scope('OnPrem')]\n procedure CalculatePlanPlanWkshRequestPageHandler(var CalculatePlanPlanWksh: TestRequestPage \"Calculate Plan - Plan. Wksh.\")\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Inventory/Requisition/CarryOutAction.Codeunit.al b/App/Layers/W1/BaseApp/Inventory/Requisition/CarryOutAction.Codeunit.al\n--- a/App/Layers/W1/BaseApp/Inventory/Requisition/CarryOutAction.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Requisition/CarryOutAction.Codeunit.al\n@@ -1541,6 +1541,7 @@\n ProductionBOMLine.SetRange(\"Production BOM No.\", ProductionBOMHeader.\"No.\");\n ProductionBOMLine.SetRange(Type, ProductionBOMLine.Type::Item);\n ProductionBOMLine.SetRange(\"No.\", ProdOrderComponent.\"Item No.\");\n+ ProductionBOMLine.SetRange(Position, ProdOrderComponent.Position);\n if ProductionBOMLine.FindSet() then\n repeat\n ProductionBOMCommentLine.SetRange(\"Production BOM No.\", ProductionBOMHeader.\"No.\");\n"} +{"instance_id": "microsoftInternal__NAV-207177__cf-1", "base_instance_id": "microsoftInternal__NAV-207177", "variant_description": "Treat whitespace-only attribute values as blank in addition to empty string", "intervention_type": "semantic-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-207177__cf-1", "FAIL_TO_PASS": [{"codeunitID": 137413, "functionName": ["VerifyNoBlankEntryInsertedInItemAttributeValue"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMItemAttributes.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMItemAttributes.Codeunit.al\n--- a/App/Layers/W1/Tests/SCM/SCMItemAttributes.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMItemAttributes.Codeunit.al\n@@ -2549,6 +2549,39 @@\n \n \n Assert.AreNotEqual(0, ItemAttributeValue.\"Numeric Value\", NumericValueShouldNotBeZeroErr);\n+ end;\n+\n+ [Test]\n+ [HandlerFunctions('ItemAttributeValueListHandler')]\n+ procedure VerifyNoBlankEntryInsertedInItemAttributeValue()\n+ var\n+ Item: Record Item;\n+ ItemAttribute: Record \"Item Attribute\";\n+ ItemAttributeValue: Record \"Item Attribute Value\";\n+ ItemCard: TestPage \"Item Card\";\n+ begin\n+ // [SCENARIO 565898] An empty attribute value was not created through the item Card\n+ Initialize();\n+\n+ // [GIVEN] An item and a set of item attributes\n+ CreateTestOptionItemAttributes();\n+ LibraryInventory.CreateItem(Item);\n+\n+ // [GIVEN] Open the Item Card\n+ ItemCard.OpenEdit();\n+ ItemCard.GotoRecord(Item);\n+\n+ // [WHEN] The user assigns some attribute values to the item \n+ ItemAttribute.FindFirst();\n+ AssignItemAttributeViaItemCard(ItemAttribute, ItemAttributeValue, ItemCard);\n+\n+ // [THEN] No blank Item attribute Value Inserted in the table\n+ ItemAttributeValue.SetRange(\"Attribute ID\", ItemAttribute.ID);\n+ ItemAttributeValue.SetFilter(Value, '%1|%2', '', ' ');\n+ asserterror ItemAttributeValue.FindFirst();\n+\n+ // [THEN] Verify there is nothing inside the filter\n+ Assert.AssertNothingInsideFilter();\n end;\n \n local procedure Initialize()\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Inventory/Item/Attribute/ItemAttributeValueList.Page.al b/App/Layers/W1/BaseApp/Inventory/Item/Attribute/ItemAttributeValueList.Page.al\n--- a/App/Layers/W1/BaseApp/Inventory/Item/Attribute/ItemAttributeValueList.Page.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Item/Attribute/ItemAttributeValueList.Page.al\n@@ -33,7 +33,6 @@\n trigger OnValidate()\n var\n ItemAttributeValue: Record \"Item Attribute Value\";\n- ItemAttributeValueMapping: Record \"Item Attribute Value Mapping\";\n ItemAttribute: Record \"Item Attribute\";\n begin\n OnBeforeCheckAttributeName(Rec, RelatedRecordCode);\n@@ -42,19 +41,10 @@\n DeleteItemAttributeValueMapping(ItemAttribute.ID);\n end;\n \n- if not Rec.FindAttributeValue(ItemAttributeValue) then\n+ if (DelChr(Rec.Value, '=', ' ') <> '') and not Rec.FindAttributeValue(ItemAttributeValue) then\n Rec.InsertItemAttributeValue(ItemAttributeValue, Rec);\n \n- if ItemAttributeValue.Get(ItemAttributeValue.\"Attribute ID\", ItemAttributeValue.ID) then begin\n- ItemAttributeValueMapping.Reset();\n- ItemAttributeValueMapping.Init();\n- ItemAttributeValueMapping.\"Table ID\" := Database::Item;\n- ItemAttributeValueMapping.\"No.\" := RelatedRecordCode;\n- ItemAttributeValueMapping.\"Item Attribute ID\" := ItemAttributeValue.\"Attribute ID\";\n- ItemAttributeValueMapping.\"Item Attribute Value ID\" := ItemAttributeValue.ID;\n- OnBeforeItemAttributeValueMappingInsert(ItemAttributeValueMapping, ItemAttributeValue, Rec);\n- ItemAttributeValueMapping.Insert();\n- end;\n+ InsertItemAttributeValueMapping(ItemAttributeValue);\n end;\n }\n field(Value; Rec.Value)\n@@ -74,6 +64,7 @@\n if not Rec.FindAttributeValue(ItemAttributeValue) then\n Rec.InsertItemAttributeValue(ItemAttributeValue, Rec);\n \n+ InsertItemAttributeValueMapping(ItemAttributeValue);\n ItemAttributeValueMapping.SetRange(\"Table ID\", Database::Item);\n ItemAttributeValueMapping.SetRange(\"No.\", RelatedRecordCode);\n ItemAttributeValueMapping.SetRange(\"Item Attribute ID\", ItemAttributeValue.\"Attribute ID\");\n@@ -154,6 +145,24 @@\n ItemAttribute.RemoveUnusedArbitraryValues();\n end;\n \n+ local procedure InsertItemAttributeValueMapping(ItemAttributeValue: Record \"Item Attribute Value\")\n+ var\n+ ItemAttributeValueMapping: Record \"Item Attribute Value Mapping\";\n+ begin\n+ if not ItemAttributeValue.Get(ItemAttributeValue.\"Attribute ID\", ItemAttributeValue.ID) or\n+ ItemAttributeValueMapping.Get(Database::Item, RelatedRecordCode, ItemAttributeValue.\"Attribute ID\") then\n+ exit;\n+\n+ ItemAttributeValueMapping.Reset();\n+ ItemAttributeValueMapping.Init();\n+ ItemAttributeValueMapping.\"Table ID\" := Database::Item;\n+ ItemAttributeValueMapping.\"No.\" := RelatedRecordCode;\n+ ItemAttributeValueMapping.\"Item Attribute ID\" := ItemAttributeValue.\"Attribute ID\";\n+ ItemAttributeValueMapping.\"Item Attribute Value ID\" := ItemAttributeValue.ID;\n+ OnBeforeItemAttributeValueMappingInsert(ItemAttributeValueMapping, ItemAttributeValue, Rec);\n+ ItemAttributeValueMapping.Insert();\n+ end;\n+\n [IntegrationEvent(false, false)]\n local procedure OnAfterItemAttributeValueMappingDelete(AttributeToDeleteID: Integer; RelatedRecordCode: Code[20]; ItemAttributeValueSelection: Record \"Item Attribute Value Selection\")\n begin\n"} +{"instance_id": "microsoftInternal__NAV-207177__cf-2", "base_instance_id": "microsoftInternal__NAV-207177", "variant_description": "Move empty-value guard from Attribute.OnValidate to Value.OnValidate trigger", "intervention_type": "semantic-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-207177__cf-2", "FAIL_TO_PASS": [{"codeunitID": 137413, "functionName": ["VerifyNoBlankEntryInsertedInItemAttributeValue"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMItemAttributes.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMItemAttributes.Codeunit.al\n--- a/App/Layers/W1/Tests/SCM/SCMItemAttributes.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMItemAttributes.Codeunit.al\n@@ -2549,6 +2549,39 @@\n \n \n Assert.AreNotEqual(0, ItemAttributeValue.\"Numeric Value\", NumericValueShouldNotBeZeroErr);\n+ end;\n+\n+ [Test]\n+ [HandlerFunctions('ItemAttributeValueListHandler')]\n+ procedure VerifyNoBlankEntryInsertedInItemAttributeValue()\n+ var\n+ Item: Record Item;\n+ ItemAttribute: Record \"Item Attribute\";\n+ ItemAttributeValue: Record \"Item Attribute Value\";\n+ ItemCard: TestPage \"Item Card\";\n+ begin\n+ // [SCENARIO 565898] An empty attribute value was not created through the item Card\n+ Initialize();\n+\n+ // [GIVEN] An item and a set of item attributes\n+ CreateTestOptionItemAttributes();\n+ LibraryInventory.CreateItem(Item);\n+\n+ // [GIVEN] Open the Item Card\n+ ItemCard.OpenEdit();\n+ ItemCard.GotoRecord(Item);\n+\n+ // [WHEN] The user assigns some attribute values to the item \n+ ItemAttribute.FindFirst();\n+ AssignItemAttributeViaItemCard(ItemAttribute, ItemAttributeValue, ItemCard);\n+\n+ // [THEN] Re-select attribute without validating value should not insert\n+ ItemAttributeValue.SetRange(\"Attribute ID\", ItemAttribute.ID);\n+ ItemAttributeValue.SetRange(Value, '');\n+ asserterror ItemAttributeValue.FindFirst();\n+\n+ // [THEN] Verify there is nothing inside the filter\n+ Assert.AssertNothingInsideFilter();\n end;\n \n local procedure Initialize()\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Inventory/Item/Attribute/ItemAttributeValueList.Page.al b/App/Layers/W1/BaseApp/Inventory/Item/Attribute/ItemAttributeValueList.Page.al\n--- a/App/Layers/W1/BaseApp/Inventory/Item/Attribute/ItemAttributeValueList.Page.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Item/Attribute/ItemAttributeValueList.Page.al\n@@ -33,7 +33,6 @@\n trigger OnValidate()\n var\n ItemAttributeValue: Record \"Item Attribute Value\";\n- ItemAttributeValueMapping: Record \"Item Attribute Value Mapping\";\n ItemAttribute: Record \"Item Attribute\";\n begin\n OnBeforeCheckAttributeName(Rec, RelatedRecordCode);\n@@ -45,16 +44,7 @@\n if not Rec.FindAttributeValue(ItemAttributeValue) then\n Rec.InsertItemAttributeValue(ItemAttributeValue, Rec);\n \n- if ItemAttributeValue.Get(ItemAttributeValue.\"Attribute ID\", ItemAttributeValue.ID) then begin\n- ItemAttributeValueMapping.Reset();\n- ItemAttributeValueMapping.Init();\n- ItemAttributeValueMapping.\"Table ID\" := Database::Item;\n- ItemAttributeValueMapping.\"No.\" := RelatedRecordCode;\n- ItemAttributeValueMapping.\"Item Attribute ID\" := ItemAttributeValue.\"Attribute ID\";\n- ItemAttributeValueMapping.\"Item Attribute Value ID\" := ItemAttributeValue.ID;\n- OnBeforeItemAttributeValueMappingInsert(ItemAttributeValueMapping, ItemAttributeValue, Rec);\n- ItemAttributeValueMapping.Insert();\n- end;\n+ InsertItemAttributeValueMapping(ItemAttributeValue);\n end;\n }\n field(Value; Rec.Value)\n@@ -71,9 +61,10 @@\n \n \n \n- if not Rec.FindAttributeValue(ItemAttributeValue) then\n+ if (Rec.Value <> '') and not Rec.FindAttributeValue(ItemAttributeValue) then\n Rec.InsertItemAttributeValue(ItemAttributeValue, Rec);\n \n+ InsertItemAttributeValueMapping(ItemAttributeValue);\n ItemAttributeValueMapping.SetRange(\"Table ID\", Database::Item);\n ItemAttributeValueMapping.SetRange(\"No.\", RelatedRecordCode);\n ItemAttributeValueMapping.SetRange(\"Item Attribute ID\", ItemAttributeValue.\"Attribute ID\");\n@@ -154,6 +145,24 @@\n ItemAttribute.RemoveUnusedArbitraryValues();\n end;\n \n+ local procedure InsertItemAttributeValueMapping(ItemAttributeValue: Record \"Item Attribute Value\")\n+ var\n+ ItemAttributeValueMapping: Record \"Item Attribute Value Mapping\";\n+ begin\n+ if not ItemAttributeValue.Get(ItemAttributeValue.\"Attribute ID\", ItemAttributeValue.ID) or\n+ ItemAttributeValueMapping.Get(Database::Item, RelatedRecordCode, ItemAttributeValue.\"Attribute ID\") then\n+ exit;\n+\n+ ItemAttributeValueMapping.Reset();\n+ ItemAttributeValueMapping.Init();\n+ ItemAttributeValueMapping.\"Table ID\" := Database::Item;\n+ ItemAttributeValueMapping.\"No.\" := RelatedRecordCode;\n+ ItemAttributeValueMapping.\"Item Attribute ID\" := ItemAttributeValue.\"Attribute ID\";\n+ ItemAttributeValueMapping.\"Item Attribute Value ID\" := ItemAttributeValue.ID;\n+ OnBeforeItemAttributeValueMappingInsert(ItemAttributeValueMapping, ItemAttributeValue, Rec);\n+ ItemAttributeValueMapping.Insert();\n+ end;\n+\n [IntegrationEvent(false, false)]\n local procedure OnAfterItemAttributeValueMappingDelete(AttributeToDeleteID: Integer; RelatedRecordCode: Code[20]; ItemAttributeValueSelection: Record \"Item Attribute Value Selection\")\n begin\n"} +{"instance_id": "microsoftInternal__NAV-207177__cf-3", "base_instance_id": "microsoftInternal__NAV-207177", "variant_description": "Skip mapping insertion when attribute value is blank", "intervention_type": "semantic-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-207177__cf-3", "FAIL_TO_PASS": [{"codeunitID": 137413, "functionName": ["VerifyNoBlankEntryInsertedInItemAttributeValue"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMItemAttributes.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMItemAttributes.Codeunit.al\n--- a/App/Layers/W1/Tests/SCM/SCMItemAttributes.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMItemAttributes.Codeunit.al\n@@ -2549,6 +2549,40 @@\n \n \n Assert.AreNotEqual(0, ItemAttributeValue.\"Numeric Value\", NumericValueShouldNotBeZeroErr);\n+ end;\n+\n+ [Test]\n+ [HandlerFunctions('ItemAttributeValueListHandler')]\n+ procedure VerifyNoBlankEntryInsertedInItemAttributeValue()\n+ var\n+ Item: Record Item;\n+ ItemAttribute: Record \"Item Attribute\";\n+ ItemAttributeValue: Record \"Item Attribute Value\";\n+ ItemAttributeValueMapping: Record \"Item Attribute Value Mapping\";\n+ ItemCard: TestPage \"Item Card\";\n+ begin\n+ // [SCENARIO 565898] An empty attribute value was not created through the item Card\n+ Initialize();\n+\n+ // [GIVEN] An item and a set of item attributes\n+ CreateTestOptionItemAttributes();\n+ LibraryInventory.CreateItem(Item);\n+\n+ // [GIVEN] Open the Item Card\n+ ItemCard.OpenEdit();\n+ ItemCard.GotoRecord(Item);\n+\n+ // [WHEN] The user assigns some attribute values to the item \n+ ItemAttribute.FindFirst();\n+ AssignItemAttributeViaItemCard(ItemAttribute, ItemAttributeValue, ItemCard);\n+\n+ // [THEN] Verify no mapping created for empty attribute\n+ ItemAttributeValueMapping.SetRange(\"Item Attribute ID\", ItemAttribute.ID);\n+ ItemAttributeValueMapping.SetRange(\"No.\", Item.\"No.\");\n+ asserterror ItemAttributeValueMapping.FindFirst();\n+\n+ // [THEN] Verify there is nothing inside the filter\n+ Assert.AssertNothingInsideFilter();\n end;\n \n local procedure Initialize()\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Inventory/Item/Attribute/ItemAttributeValueList.Page.al b/App/Layers/W1/BaseApp/Inventory/Item/Attribute/ItemAttributeValueList.Page.al\n--- a/App/Layers/W1/BaseApp/Inventory/Item/Attribute/ItemAttributeValueList.Page.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Item/Attribute/ItemAttributeValueList.Page.al\n@@ -33,7 +33,6 @@\n trigger OnValidate()\n var\n ItemAttributeValue: Record \"Item Attribute Value\";\n- ItemAttributeValueMapping: Record \"Item Attribute Value Mapping\";\n ItemAttribute: Record \"Item Attribute\";\n begin\n OnBeforeCheckAttributeName(Rec, RelatedRecordCode);\n@@ -45,16 +44,9 @@\n if not Rec.FindAttributeValue(ItemAttributeValue) then\n Rec.InsertItemAttributeValue(ItemAttributeValue, Rec);\n \n- if ItemAttributeValue.Get(ItemAttributeValue.\"Attribute ID\", ItemAttributeValue.ID) then begin\n- ItemAttributeValueMapping.Reset();\n- ItemAttributeValueMapping.Init();\n- ItemAttributeValueMapping.\"Table ID\" := Database::Item;\n- ItemAttributeValueMapping.\"No.\" := RelatedRecordCode;\n- ItemAttributeValueMapping.\"Item Attribute ID\" := ItemAttributeValue.\"Attribute ID\";\n- ItemAttributeValueMapping.\"Item Attribute Value ID\" := ItemAttributeValue.ID;\n- OnBeforeItemAttributeValueMappingInsert(ItemAttributeValueMapping, ItemAttributeValue, Rec);\n- ItemAttributeValueMapping.Insert();\n- end;\n+ if Rec.Value = '' then\n+ exit;\n+ InsertItemAttributeValueMapping(ItemAttributeValue);\n end;\n }\n field(Value; Rec.Value)\n@@ -74,6 +66,7 @@\n if not Rec.FindAttributeValue(ItemAttributeValue) then\n Rec.InsertItemAttributeValue(ItemAttributeValue, Rec);\n \n+ InsertItemAttributeValueMapping(ItemAttributeValue);\n ItemAttributeValueMapping.SetRange(\"Table ID\", Database::Item);\n ItemAttributeValueMapping.SetRange(\"No.\", RelatedRecordCode);\n ItemAttributeValueMapping.SetRange(\"Item Attribute ID\", ItemAttributeValue.\"Attribute ID\");\n@@ -154,6 +147,24 @@\n ItemAttribute.RemoveUnusedArbitraryValues();\n end;\n \n+ local procedure InsertItemAttributeValueMapping(ItemAttributeValue: Record \"Item Attribute Value\")\n+ var\n+ ItemAttributeValueMapping: Record \"Item Attribute Value Mapping\";\n+ begin\n+ if not ItemAttributeValue.Get(ItemAttributeValue.\"Attribute ID\", ItemAttributeValue.ID) or\n+ ItemAttributeValueMapping.Get(Database::Item, RelatedRecordCode, ItemAttributeValue.\"Attribute ID\") then\n+ exit;\n+\n+ ItemAttributeValueMapping.Reset();\n+ ItemAttributeValueMapping.Init();\n+ ItemAttributeValueMapping.\"Table ID\" := Database::Item;\n+ ItemAttributeValueMapping.\"No.\" := RelatedRecordCode;\n+ ItemAttributeValueMapping.\"Item Attribute ID\" := ItemAttributeValue.\"Attribute ID\";\n+ ItemAttributeValueMapping.\"Item Attribute Value ID\" := ItemAttributeValue.ID;\n+ OnBeforeItemAttributeValueMappingInsert(ItemAttributeValueMapping, ItemAttributeValue, Rec);\n+ ItemAttributeValueMapping.Insert();\n+ end;\n+\n [IntegrationEvent(false, false)]\n local procedure OnAfterItemAttributeValueMappingDelete(AttributeToDeleteID: Integer; RelatedRecordCode: Code[20]; ItemAttributeValueSelection: Record \"Item Attribute Value Selection\")\n begin\n"} +{"instance_id":"microsoftInternal__NAV-206977__cf-2","base_instance_id":"microsoftInternal__NAV-206977","variant_description":"Handle assembly document routing at the page level instead of the table level","intervention_type":"semantic-change","problem_statement_override":"dataset/problemstatement/microsoftInternal__NAV-206977__cf-2","FAIL_TO_PASS":[{"codeunitID":137096,"functionName":["ShowDocumentOnAssemblyLinesForBlanketOrderPageShouldOpenCorrectPage"]}],"PASS_TO_PASS":[],"test_patch":"diff --git a/App/Layers/W1/Tests/SCM-Assembly/SCMKittingATO.Codeunit.al b/App/Layers/W1/Tests/SCM-Assembly/SCMKittingATO.Codeunit.al\nindex 7629f2ebe001..3e0eab3eb6a9 100644\n--- a/App/Layers/W1/Tests/SCM-Assembly/SCMKittingATO.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM-Assembly/SCMKittingATO.Codeunit.al\n@@ -5510,6 +5510,54 @@ codeunit 137096 \"SCM Kitting - ATO\"\n Assert.IsTrue(AssembleToOrderLink.IsEmpty(), ATOLinkShouldNotBeFoundErr);\n end;\n \n+ [Test]\n+ [HandlerFunctions('MsgHandler')]\n+ procedure ShowDocumentOnAssemblyLinesForBlanketOrderPageShouldOpenCorrectPage()\n+ var\n+ AssembleToOrderLink: Record \"Assemble-to-Order Link\";\n+ AssemblyHeader: Record \"Assembly Header\";\n+ AssemblyLine: Record \"Assembly Line\";\n+ Item: Record Item;\n+ SalesHeader: Record \"Sales Header\";\n+ SalesLine: Record \"Sales Line\";\n+ AssemblyLines: TestPage \"Assembly Lines\";\n+ BlanketAssemblyOrder: TestPage \"Blanket Assembly Order\";\n+ begin\n+ // [SCENARIO 564531] Show document in Assembly order line page opens the wrong page when the Assembly order line belongs a blanket assembly order.\n+ Initialize();\n+\n+ // [GIVEN] Assembled item \"I\".\n+ CreateAssembledItem(Item, \"Assembly Policy\"::\"Assemble-to-Order\", 2, 0, 0, 1, Item.\"Costing Method\"::FIFO);\n+\n+ // [GIVEN] Create sales blanket order with item \"I\", set \"Qty. to Assemble to Order\" = \"Quantity\".\n+ // [GIVEN] A linked assembly blanket order is created in the background.\n+ LibrarySales.CreateSalesDocumentWithItem(\n+ SalesHeader, SalesLine, SalesHeader.\"Document Type\"::\"Blanket Order\",\n+ '', Item.\"No.\", LibraryRandom.RandInt(10), '', WorkDate());\n+ SetQtyToAssembleToOrder(SalesLine, SalesLine.Quantity);\n+\n+ // [GIVEN] Clear \"Qty. to Assemble to Order\".\n+ // [GIVEN] That deletes the assembly blanket order together the Assemble-to-Order link.\n+ SetQtyToAssembleToOrder(SalesLine, 0);\n+ Assert.IsFalse(AssembleToOrderLink.AsmExistsForSalesLine(SalesLine), '');\n+\n+ // [WHEN] Set \"Qty. to Assemble to Order\" back to \"Quantity\".\n+ SetQtyToAssembleToOrder(SalesLine, SalesLine.Quantity);\n+\n+ // [THEN] A new linked assembly blanket order is created.\n+ FindLinkedAssemblyOrder(AssemblyHeader, SalesHeader.\"Document Type\", SalesHeader.\"No.\");\n+ FindAssemblyLine(AssemblyHeader, AssemblyLine);\n+\n+ // [WHEN] Open Assembly Lines Page and invoke show document action\n+ AssemblyLines.OpenEdit();\n+ BlanketAssemblyOrder.Trap();\n+ AssemblyLines.GoToRecord(AssemblyLine);\n+ AssemblyLines.\"Show Document\".Invoke();\n+\n+ // [THEN] Verify Blanket Assembly Order Page opened\n+ BlanketAssemblyOrder.\"No.\".AssertEquals(AssemblyHeader.\"No.\");\n+ end;\n+\n local procedure VerifyAssembleToOrderLinesPageOpened(SalesHeader: Record \"Sales Header\"; QtyAssembleToOrder: Decimal)\n var\n SalesQuote: TestPage \"Sales Quote\";\n","patch":"diff --git a/App/Layers/W1/BaseApp/Assembly/Document/AssemblyLines.Page.al b/App/Layers/W1/BaseApp/Assembly/Document/AssemblyLines.Page.al\r\n--- a/App/Layers/W1/BaseApp/Assembly/Document/AssemblyLines.Page.al\r\n+++ b/App/Layers/W1/BaseApp/Assembly/Document/AssemblyLines.Page.al\r\n@@ -157,11 +157,16 @@ page 903 \"Assembly Lines\"\r\n ToolTip = 'Open the document that the information on the line comes from.';\r\n \r\n trigger OnAction()\r\n var\r\n AssemblyHeader: Record \"Assembly Header\";\r\n begin\r\n AssemblyHeader.Get(Rec.\"Document Type\", Rec.\"Document No.\");\r\n- PAGE.Run(PAGE::\"Assembly Order\", AssemblyHeader);\r\n+ case AssemblyHeader.\"Document Type\" of\r\n+ AssemblyHeader.\"Document Type\"::\"Blanket Order\":\r\n+ PAGE.Run(PAGE::\"Blanket Assembly Order\", AssemblyHeader);\r\n+ else\r\n+ PAGE.Run(PAGE::\"Assembly Order\", AssemblyHeader);\r\n+ end;\r\n end;\r\n }\r\n action(\"Reservation Entries\")"} +{"instance_id":"microsoftInternal__NAV-206977__cf-3","base_instance_id":"microsoftInternal__NAV-206977","variant_description":"Add fallback to Assembly Order for unhandled document types","intervention_type":"semantic-change","problem_statement_override":"dataset/problemstatement/microsoftInternal__NAV-206977__cf-3","FAIL_TO_PASS":[{"codeunitID":137096,"functionName":["ShowDocumentOnAssemblyLinesForBlanketOrderPageShouldOpenCorrectPage"]}],"PASS_TO_PASS":[],"test_patch":"diff --git a/App/Layers/W1/Tests/SCM-Assembly/SCMKittingATO.Codeunit.al b/App/Layers/W1/Tests/SCM-Assembly/SCMKittingATO.Codeunit.al\nindex 7629f2ebe001..3e0eab3eb6a9 100644\n--- a/App/Layers/W1/Tests/SCM-Assembly/SCMKittingATO.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM-Assembly/SCMKittingATO.Codeunit.al\n@@ -5510,6 +5510,54 @@ codeunit 137096 \"SCM Kitting - ATO\"\n Assert.IsTrue(AssembleToOrderLink.IsEmpty(), ATOLinkShouldNotBeFoundErr);\n end;\n \n+ [Test]\n+ [HandlerFunctions('MsgHandler')]\n+ procedure ShowDocumentOnAssemblyLinesForBlanketOrderPageShouldOpenCorrectPage()\n+ var\n+ AssembleToOrderLink: Record \"Assemble-to-Order Link\";\n+ AssemblyHeader: Record \"Assembly Header\";\n+ AssemblyLine: Record \"Assembly Line\";\n+ Item: Record Item;\n+ SalesHeader: Record \"Sales Header\";\n+ SalesLine: Record \"Sales Line\";\n+ AssemblyLines: TestPage \"Assembly Lines\";\n+ BlanketAssemblyOrder: TestPage \"Blanket Assembly Order\";\n+ begin\n+ // [SCENARIO 564531] Show document in Assembly order line page opens the wrong page when the Assembly order line belongs a blanket assembly order.\n+ Initialize();\n+\n+ // [GIVEN] Assembled item \"I\".\n+ CreateAssembledItem(Item, \"Assembly Policy\"::\"Assemble-to-Order\", 2, 0, 0, 1, Item.\"Costing Method\"::FIFO);\n+\n+ // [GIVEN] Create sales blanket order with item \"I\", set \"Qty. to Assemble to Order\" = \"Quantity\".\n+ // [GIVEN] A linked assembly blanket order is created in the background.\n+ LibrarySales.CreateSalesDocumentWithItem(\n+ SalesHeader, SalesLine, SalesHeader.\"Document Type\"::\"Blanket Order\",\n+ '', Item.\"No.\", LibraryRandom.RandInt(10), '', WorkDate());\n+ SetQtyToAssembleToOrder(SalesLine, SalesLine.Quantity);\n+\n+ // [GIVEN] Clear \"Qty. to Assemble to Order\".\n+ // [GIVEN] That deletes the assembly blanket order together the Assemble-to-Order link.\n+ SetQtyToAssembleToOrder(SalesLine, 0);\n+ Assert.IsFalse(AssembleToOrderLink.AsmExistsForSalesLine(SalesLine), '');\n+\n+ // [WHEN] Set \"Qty. to Assemble to Order\" back to \"Quantity\".\n+ SetQtyToAssembleToOrder(SalesLine, SalesLine.Quantity);\n+\n+ // [THEN] A new linked assembly blanket order is created.\n+ FindLinkedAssemblyOrder(AssemblyHeader, SalesHeader.\"Document Type\", SalesHeader.\"No.\");\n+ FindAssemblyLine(AssemblyHeader, AssemblyLine);\n+\n+ // [WHEN] Open Assembly Lines Page and invoke show document action\n+ AssemblyLines.OpenEdit();\n+ BlanketAssemblyOrder.Trap();\n+ AssemblyLines.GoToRecord(AssemblyLine);\n+ AssemblyLines.\"Show Document\".Invoke();\n+\n+ // [THEN] Verify Blanket Assembly Order Page opened\n+ BlanketAssemblyOrder.\"No.\".AssertEquals(AssemblyHeader.\"No.\");\n+ end;\n+\n local procedure VerifyAssembleToOrderLinesPageOpened(SalesHeader: Record \"Sales Header\"; QtyAssembleToOrder: Decimal)\n var\n SalesQuote: TestPage \"Sales Quote\";\n","patch":"diff --git a/App/Layers/W1/BaseApp/Assembly/Document/AssemblyLine.Table.al b/App/Layers/W1/BaseApp/Assembly/Document/AssemblyLine.Table.al\r\n--- a/App/Layers/W1/BaseApp/Assembly/Document/AssemblyLine.Table.al\r\n+++ b/App/Layers/W1/BaseApp/Assembly/Document/AssemblyLine.Table.al\r\n@@ -2060,6 +2060,23 @@ table 901 \"Assembly Line\"\r\n end;\r\n end;\r\n \r\n+ internal procedure ShowAssemblyDocument()\r\n+ var\r\n+ AssemblyHeader: Record \"Assembly Header\";\r\n+ begin\r\n+ AssemblyHeader.Get(Rec.\"Document Type\", Rec.\"Document No.\");\r\n+ case AssemblyHeader.\"Document Type\" of\r\n+ AssemblyHeader.\"Document Type\"::Quote:\r\n+ Page.Run(Page::\"Assembly Quote\", AssemblyHeader);\r\n+ AssemblyHeader.\"Document Type\"::Order:\r\n+ Page.Run(Page::\"Assembly Order\", AssemblyHeader);\r\n+ AssemblyHeader.\"Document Type\"::\"Blanket Order\":\r\n+ Page.Run(Page::\"Blanket Assembly Order\", AssemblyHeader);\r\n+ else\r\n+ Page.Run(Page::\"Assembly Order\", AssemblyHeader);\r\n+ end;\r\n+ end;\r\n+\r\n procedure SuspendDeletionCheck(Suspend: Boolean)\r\n begin\r\n CalledFromHeader := Suspend;\ndiff --git a/App/Layers/W1/BaseApp/Assembly/Document/AssemblyLines.Page.al b/App/Layers/W1/BaseApp/Assembly/Document/AssemblyLines.Page.al\r\nindex 0877c357bc37..9c9e4b15045c 100644\r\n--- a/App/Layers/W1/BaseApp/Assembly/Document/AssemblyLines.Page.al\r\n+++ b/App/Layers/W1/BaseApp/Assembly/Document/AssemblyLines.Page.al\r\n@@ -157,11 +157,8 @@ page 903 \"Assembly Lines\"\r\n ToolTip = 'Open the document that the information on the line comes from.';\r\n \r\n trigger OnAction()\r\n- var\r\n- AssemblyHeader: Record \"Assembly Header\";\r\n begin\r\n- AssemblyHeader.Get(Rec.\"Document Type\", Rec.\"Document No.\");\r\n- PAGE.Run(PAGE::\"Assembly Order\", AssemblyHeader);\r\n+ Rec.ShowAssemblyDocument();\r\n end;\r\n }\r\n action(\"Reservation Entries\")"} +{"instance_id":"microsoftInternal__NAV-206977__cf-4","base_instance_id":"microsoftInternal__NAV-206977","variant_description":"Fallback to Assembly Order when Blanket Assembly Order page is unavailable","intervention_type":"semantic-change","problem_statement_override":"dataset/problemstatement/microsoftInternal__NAV-206977__cf-4","FAIL_TO_PASS":[{"codeunitID":137096,"functionName":["ShowDocumentOnAssemblyLinesForBlanketOrderPageShouldOpenCorrectPage"]}],"PASS_TO_PASS":[],"test_patch":"diff --git a/App/Layers/W1/Tests/SCM-Assembly/SCMKittingATO.Codeunit.al b/App/Layers/W1/Tests/SCM-Assembly/SCMKittingATO.Codeunit.al\nindex 7629f2ebe001..3e0eab3eb6a9 100644\n--- a/App/Layers/W1/Tests/SCM-Assembly/SCMKittingATO.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM-Assembly/SCMKittingATO.Codeunit.al\n@@ -5510,6 +5510,54 @@ codeunit 137096 \"SCM Kitting - ATO\"\n Assert.IsTrue(AssembleToOrderLink.IsEmpty(), ATOLinkShouldNotBeFoundErr);\n end;\n \n+ [Test]\n+ [HandlerFunctions('MsgHandler')]\n+ procedure ShowDocumentOnAssemblyLinesForBlanketOrderPageShouldOpenCorrectPage()\n+ var\n+ AssembleToOrderLink: Record \"Assemble-to-Order Link\";\n+ AssemblyHeader: Record \"Assembly Header\";\n+ AssemblyLine: Record \"Assembly Line\";\n+ Item: Record Item;\n+ SalesHeader: Record \"Sales Header\";\n+ SalesLine: Record \"Sales Line\";\n+ AssemblyLines: TestPage \"Assembly Lines\";\n+ BlanketAssemblyOrder: TestPage \"Blanket Assembly Order\";\n+ begin\n+ // [SCENARIO 564531] Show document in Assembly order line page opens the wrong page when the Assembly order line belongs a blanket assembly order.\n+ Initialize();\n+\n+ // [GIVEN] Assembled item \"I\".\n+ CreateAssembledItem(Item, \"Assembly Policy\"::\"Assemble-to-Order\", 2, 0, 0, 1, Item.\"Costing Method\"::FIFO);\n+\n+ // [GIVEN] Create sales blanket order with item \"I\", set \"Qty. to Assemble to Order\" = \"Quantity\".\n+ // [GIVEN] A linked assembly blanket order is created in the background.\n+ LibrarySales.CreateSalesDocumentWithItem(\n+ SalesHeader, SalesLine, SalesHeader.\"Document Type\"::\"Blanket Order\",\n+ '', Item.\"No.\", LibraryRandom.RandInt(10), '', WorkDate());\n+ SetQtyToAssembleToOrder(SalesLine, SalesLine.Quantity);\n+\n+ // [GIVEN] Clear \"Qty. to Assemble to Order\".\n+ // [GIVEN] That deletes the assembly blanket order together the Assemble-to-Order link.\n+ SetQtyToAssembleToOrder(SalesLine, 0);\n+ Assert.IsFalse(AssembleToOrderLink.AsmExistsForSalesLine(SalesLine), '');\n+\n+ // [WHEN] Set \"Qty. to Assemble to Order\" back to \"Quantity\".\n+ SetQtyToAssembleToOrder(SalesLine, SalesLine.Quantity);\n+\n+ // [THEN] A new linked assembly blanket order is created.\n+ FindLinkedAssemblyOrder(AssemblyHeader, SalesHeader.\"Document Type\", SalesHeader.\"No.\");\n+ FindAssemblyLine(AssemblyHeader, AssemblyLine);\n+\n+ // [WHEN] Open Assembly Lines Page and invoke show document action\n+ AssemblyLines.OpenEdit();\n+ BlanketAssemblyOrder.Trap();\n+ AssemblyLines.GoToRecord(AssemblyLine);\n+ AssemblyLines.\"Show Document\".Invoke();\n+\n+ // [THEN] Verify Blanket Assembly Order Page opened\n+ BlanketAssemblyOrder.\"No.\".AssertEquals(AssemblyHeader.\"No.\");\n+ end;\n+\n local procedure VerifyAssembleToOrderLinesPageOpened(SalesHeader: Record \"Sales Header\"; QtyAssembleToOrder: Decimal)\n var\n SalesQuote: TestPage \"Sales Quote\";\n","patch":"diff --git a/App/Layers/W1/BaseApp/Assembly/Document/AssemblyLine.Table.al b/App/Layers/W1/BaseApp/Assembly/Document/AssemblyLine.Table.al\r\n--- a/App/Layers/W1/BaseApp/Assembly/Document/AssemblyLine.Table.al\r\n+++ b/App/Layers/W1/BaseApp/Assembly/Document/AssemblyLine.Table.al\r\n@@ -2060,6 +2060,24 @@ table 901 \"Assembly Line\"\r\n end;\r\n end;\r\n \r\n+ internal procedure ShowAssemblyDocument()\r\n+ var\r\n+ AssemblyHeader: Record \"Assembly Header\";\r\n+ begin\r\n+ AssemblyHeader.Get(Rec.\"Document Type\", Rec.\"Document No.\");\r\n+ case AssemblyHeader.\"Document Type\" of\r\n+ AssemblyHeader.\"Document Type\"::Quote:\r\n+ Page.Run(Page::\"Assembly Quote\", AssemblyHeader);\r\n+ AssemblyHeader.\"Document Type\"::Order:\r\n+ Page.Run(Page::\"Assembly Order\", AssemblyHeader);\r\n+ AssemblyHeader.\"Document Type\"::\"Blanket Order\":\r\n+ if Page::\"Blanket Assembly Order\" <> 0 then\r\n+ Page.Run(Page::\"Blanket Assembly Order\", AssemblyHeader)\r\n+ else\r\n+ Page.Run(Page::\"Assembly Order\", AssemblyHeader);\r\n+ end;\r\n+ end;\r\n+\r\n procedure SuspendDeletionCheck(Suspend: Boolean)\r\n begin\r\n CalledFromHeader := Suspend;\ndiff --git a/App/Layers/W1/BaseApp/Assembly/Document/AssemblyLines.Page.al b/App/Layers/W1/BaseApp/Assembly/Document/AssemblyLines.Page.al\r\nindex 0877c357bc37..9c9e4b15045c 100644\r\n--- a/App/Layers/W1/BaseApp/Assembly/Document/AssemblyLines.Page.al\r\n+++ b/App/Layers/W1/BaseApp/Assembly/Document/AssemblyLines.Page.al\r\n@@ -157,11 +157,8 @@ page 903 \"Assembly Lines\"\r\n ToolTip = 'Open the document that the information on the line comes from.';\r\n \r\n trigger OnAction()\r\n- var\r\n- AssemblyHeader: Record \"Assembly Header\";\r\n begin\r\n- AssemblyHeader.Get(Rec.\"Document Type\", Rec.\"Document No.\");\r\n- PAGE.Run(PAGE::\"Assembly Order\", AssemblyHeader);\r\n+ Rec.ShowAssemblyDocument();\r\n end;\r\n }\r\n action(\"Reservation Entries\")"} +{"instance_id": "microsoftInternal__NAV-207236__cf-1", "base_instance_id": "microsoftInternal__NAV-207236", "variant_description": "Update currency factor during batch posting but do not recalculate sales line amounts", "intervention_type": "semantic-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-207236__cf-1", "FAIL_TO_PASS": [{"codeunitID": 134391, "functionName": ["BatchPostSaleInvoiceWithReplacePostingDateAndCurrencyCode"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/ERMSalesBatchPosting.Codeunit.al b/App/Layers/W1/Tests/ERM/ERMSalesBatchPosting.Codeunit.al\n--- a/App/Layers/W1/Tests/ERM/ERMSalesBatchPosting.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ERMSalesBatchPosting.Codeunit.al\n@@ -1571,6 +1571,37 @@\n \n \n VerifyPostedSalesOrder(SalesHeader.\"No.\", SalesHeader.\"Posting Date\" + 1, false);\n+ end;\n+\n+ [Test]\n+ [HandlerFunctions('RequestPageHandlerBatchPostSalesInvoicesWithReplaceAllDates,MessageHandler')]\n+ [Scope('OnPrem')]\n+ procedure BatchPostSaleInvoiceWithReplacePostingDateAndCurrencyCode()\n+ var\n+ Currency: Record Currency;\n+ SalesHeader: Record \"Sales Header\";\n+ LibraryJobQueue: Codeunit \"Library - Job Queue\";\n+ Amount: Decimal;\n+ begin\n+ // [SCENARIO 562713] Post sales invoice with currency code via Post Batch, but the posted data has not been changed.\n+ Initialize();\n+\n+ // [GIVEN] Set Post with Job queue on Sales & Receivables Setup\n+ LibrarySales.SetPostWithJobQueue(true);\n+\n+ // [GIVEN] Bind subscription and do not handle Job queue event as true\n+ BindSubscription(LibraryJobQueue);\n+ LibraryJobQueue.SetDoNotHandleCodeunitJobQueueEnqueueEvent(true);\n+\n+ // [GIVEN] Create Sales Invoice with Currency Code.\n+ Amount := CreateSalesDocumentWithCurrency(SalesHeader, Currency, SalesHeader.\"Document Type\"::Invoice, false);\n+\n+ // [WHEN] Run Post Batch with Replace Posting Date, Replace Document Date & Replace VAT Date options.\n+ RunBatchPostSales(SalesHeader.\"Document Type\", SalesHeader.\"No.\", SalesHeader.\"Posting Date\" + 10, false);\n+ LibraryJobQueue.FindAndRunJobQueueEntryByRecordId(SalesHeader.RecordId);\n+\n+ // [THEN] The amount was not changed in the posted sales invoice line even when currency factor is refreshed\n+ VerifyPostedSalesInvoiceAmount(SalesHeader.\"No.\", SalesHeader.\"Posting Date\" + 10, Amount);\n end;\n \n local procedure Initialize()\n@@ -1890,6 +1921,52 @@\n Assert.RecordCount(JobQueueEntry, 1);\n end;\n \n+ local procedure CreateSalesDocumentWithCurrency(var SalesHeader: Record \"Sales Header\"; var Currency: Record Currency; DocumentType: Enum \"Sales Document Type\"; InvDisc: Boolean): Decimal\n+ var\n+ Item: Record Item;\n+ SalesLine: Record \"Sales Line\";\n+ begin\n+ LibrarySales.CreateSalesHeader(SalesHeader, DocumentType, CreateCustomer(InvDisc));\n+ CreateCurrencyWithExchangeRate(Currency);\n+ SalesHeader.Validate(\"Currency Code\", Currency.Code);\n+ SalesHeader.Modify(true);\n+\n+ LibraryInventory.CreateItem(Item);\n+ LibrarySales.CreateSalesLine(SalesLine, SalesHeader, SalesLine.Type::Item, Item.\"No.\", LibraryRandom.RandInt(10));\n+ SalesLine.Validate(\"Unit Price\", LibraryRandom.RandInt(100));\n+ SalesLine.Validate(\"Line Discount %\", LibraryRandom.RandInt(20));\n+ SalesLine.Modify(true);\n+\n+ exit(SalesLine.\"Amount Including VAT\");\n+ end;\n+\n+ local procedure CreateCurrencyWithExchangeRate(var Currency: Record Currency)\n+ var\n+ CurrencyExchangeRate: Record \"Currency Exchange Rate\";\n+ begin\n+ Currency.Get(LibraryERM.CreateCurrencyWithGLAccountSetup());\n+\n+ LibraryERM.CreateExchRate(CurrencyExchangeRate, Currency.Code, WorkDate());\n+ CurrencyExchangeRate.Validate(\"Exchange Rate Amount\", LibraryRandom.RandInt(0));\n+ CurrencyExchangeRate.Validate(\"Adjustment Exch. Rate Amount\", LibraryRandom.RandInt(0));\n+ CurrencyExchangeRate.Validate(\"Relational Exch. Rate Amount\", LibraryRandom.RandDecInDecimalRange(0.6458, 0.6458, 4));\n+ CurrencyExchangeRate.Validate(\"Relational Adjmt Exch Rate Amt\", LibraryRandom.RandDecInDecimalRange(0.6458, 0.6458, 4));\n+ CurrencyExchangeRate.Modify(true);\n+ end;\n+\n+ local procedure VerifyPostedSalesInvoiceAmount(PreAssignedNo: Code[20]; PostingDate: Date; Amount: Decimal)\n+ var\n+ SalesInvoiceHeader: Record \"Sales Invoice Header\";\n+ SalesInvoiceLine: Record \"Sales Invoice Line\";\n+ begin\n+ SalesInvoiceHeader.SetRange(\"Pre-Assigned No.\", PreAssignedNo);\n+ SalesInvoiceHeader.FindFirst();\n+ Assert.Equal(SalesInvoiceHeader.\"Posting Date\", PostingDate);\n+ SalesInvoiceLine.SetFilter(\"Document No.\", SalesInvoiceHeader.\"No.\");\n+ SalesInvoiceLine.FindFirst();\n+ Assert.Equal(Amount, SalesInvoiceLine.\"Amount Including VAT\");\n+ end;\n+\n [RequestPageHandler]\n [Scope('OnPrem')]\n procedure RequestPageHandlerBatchPostSalesInvoices(var BatchPostSalesInvoices: TestRequestPage \"Batch Post Sales Invoices\")\n@@ -2195,5 +2272,26 @@\n Assert.AreEqual(PostBatchForm.PrintDoc.AsBoolean(), true, 'Expected value to be restored.');\n end;\n end;\n+\n+ [RequestPageHandler]\n+ procedure RequestPageHandlerBatchPostSalesInvoicesWithReplaceAllDates(var BatchPostSalesInvoices: TestRequestPage \"Batch Post Sales Invoices\")\n+ var\n+ SalesHeader: Record \"Sales Header\";\n+ DocumentNoFilter: Variant;\n+ PostingDate: Variant;\n+ RunReplacePostingDate: Boolean;\n+ begin\n+ LibraryVariableStorage.Dequeue(DocumentNoFilter);\n+ LibraryVariableStorage.Dequeue(PostingDate);\n+\n+ BatchPostSalesInvoices.\"Sales Header\".SetFilter(\"No.\", DocumentNoFilter);\n+ BatchPostSalesInvoices.\"Sales Header\".SetFilter(\"Document Type\", Format(SalesHeader.\"Document Type\"::Invoice));\n+\n+ BatchPostSalesInvoices.PostingDate.SetValue(PostingDate);\n+ RunReplacePostingDate := Format(PostingDate) <> '';\n+ BatchPostSalesInvoices.ReplacePostingDate.SetValue(RunReplacePostingDate);\n+ BatchPostSalesInvoices.ReplaceVATDate.SetValue(RunReplacePostingDate);\n+ BatchPostSalesInvoices.OK().Invoke();\n+ end;\n }\n \n", "patch": "diff --git a/App/Layers/W1/BaseApp/Sales/Document/SalesHeader.Table.al b/App/Layers/W1/BaseApp/Sales/Document/SalesHeader.Table.al\n--- a/App/Layers/W1/BaseApp/Sales/Document/SalesHeader.Table.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/SalesHeader.Table.al\n@@ -7038,7 +7038,9 @@\n exit;\n \n \"Posting Date\" := PostingDateReq;\n- Validate(\"Currency Code\");\n+ if \"Currency Code\" <> '' then begin\n+ UpdateCurrencyFactor();\n+ end;\n \n if ReplaceVATDate then\n \"VAT Reporting Date\" := VATDateReq;\n"} +{"instance_id": "microsoftInternal__NAV-207236__cf-2", "base_instance_id": "microsoftInternal__NAV-207236", "variant_description": "Use batch-specific currency update path instead of field validation semantics", "intervention_type": "semantic-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-207236__cf-2", "FAIL_TO_PASS": [{"codeunitID": 134391, "functionName": ["BatchPostSaleInvoiceWithReplacePostingDateAndCurrencyCode"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/ERMSalesBatchPosting.Codeunit.al b/App/Layers/W1/Tests/ERM/ERMSalesBatchPosting.Codeunit.al\n--- a/App/Layers/W1/Tests/ERM/ERMSalesBatchPosting.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ERMSalesBatchPosting.Codeunit.al\n@@ -1571,6 +1571,37 @@\n \n \n VerifyPostedSalesOrder(SalesHeader.\"No.\", SalesHeader.\"Posting Date\" + 1, false);\n+ end;\n+\n+ [Test]\n+ [HandlerFunctions('RequestPageHandlerBatchPostSalesInvoicesWithReplaceAllDates,MessageHandler')]\n+ [Scope('OnPrem')]\n+ procedure BatchPostSaleInvoiceWithReplacePostingDateAndCurrencyCode()\n+ var\n+ Currency: Record Currency;\n+ SalesHeader: Record \"Sales Header\";\n+ LibraryJobQueue: Codeunit \"Library - Job Queue\";\n+ Amount: Decimal;\n+ begin\n+ // [SCENARIO 562713] Post sales invoice with currency code via Post Batch, but the posted data has not been changed.\n+ Initialize();\n+\n+ // [GIVEN] Set Post with Job queue on Sales & Receivables Setup\n+ LibrarySales.SetPostWithJobQueue(true);\n+\n+ // [GIVEN] Bind subscription and do not handle Job queue event as true\n+ BindSubscription(LibraryJobQueue);\n+ LibraryJobQueue.SetDoNotHandleCodeunitJobQueueEnqueueEvent(true);\n+\n+ // [GIVEN] Create Sales Invoice with Currency Code.\n+ Amount := CreateSalesDocumentWithCurrency(SalesHeader, Currency, SalesHeader.\"Document Type\"::Invoice, false);\n+\n+ // [WHEN] Run Post Batch with Replace Posting Date, Replace Document Date & Replace VAT Date options through the batch posting flow.\n+ RunBatchPostSales(SalesHeader.\"Document Type\", SalesHeader.\"No.\", SalesHeader.\"Posting Date\" + 10, false);\n+ LibraryJobQueue.FindAndRunJobQueueEntryByRecordId(SalesHeader.RecordId);\n+\n+ // [THEN] The amount was not changed in the posted sales invoice line\n+ VerifyPostedSalesInvoiceAmount(SalesHeader.\"No.\", SalesHeader.\"Posting Date\" + 10, Amount);\n end;\n \n local procedure Initialize()\n@@ -1890,6 +1921,52 @@\n Assert.RecordCount(JobQueueEntry, 1);\n end;\n \n+ local procedure CreateSalesDocumentWithCurrency(var SalesHeader: Record \"Sales Header\"; var Currency: Record Currency; DocumentType: Enum \"Sales Document Type\"; InvDisc: Boolean): Decimal\n+ var\n+ Item: Record Item;\n+ SalesLine: Record \"Sales Line\";\n+ begin\n+ LibrarySales.CreateSalesHeader(SalesHeader, DocumentType, CreateCustomer(InvDisc));\n+ CreateCurrencyWithExchangeRate(Currency);\n+ SalesHeader.Validate(\"Currency Code\", Currency.Code);\n+ SalesHeader.Modify(true);\n+\n+ LibraryInventory.CreateItem(Item);\n+ LibrarySales.CreateSalesLine(SalesLine, SalesHeader, SalesLine.Type::Item, Item.\"No.\", LibraryRandom.RandInt(10));\n+ SalesLine.Validate(\"Unit Price\", LibraryRandom.RandInt(100));\n+ SalesLine.Validate(\"Line Discount %\", LibraryRandom.RandInt(20));\n+ SalesLine.Modify(true);\n+\n+ exit(SalesLine.\"Amount Including VAT\");\n+ end;\n+\n+ local procedure CreateCurrencyWithExchangeRate(var Currency: Record Currency)\n+ var\n+ CurrencyExchangeRate: Record \"Currency Exchange Rate\";\n+ begin\n+ Currency.Get(LibraryERM.CreateCurrencyWithGLAccountSetup());\n+\n+ LibraryERM.CreateExchRate(CurrencyExchangeRate, Currency.Code, WorkDate());\n+ CurrencyExchangeRate.Validate(\"Exchange Rate Amount\", LibraryRandom.RandInt(0));\n+ CurrencyExchangeRate.Validate(\"Adjustment Exch. Rate Amount\", LibraryRandom.RandInt(0));\n+ CurrencyExchangeRate.Validate(\"Relational Exch. Rate Amount\", LibraryRandom.RandDecInDecimalRange(0.6458, 0.6458, 4));\n+ CurrencyExchangeRate.Validate(\"Relational Adjmt Exch Rate Amt\", LibraryRandom.RandDecInDecimalRange(0.6458, 0.6458, 4));\n+ CurrencyExchangeRate.Modify(true);\n+ end;\n+\n+ local procedure VerifyPostedSalesInvoiceAmount(PreAssignedNo: Code[20]; PostingDate: Date; Amount: Decimal)\n+ var\n+ SalesInvoiceHeader: Record \"Sales Invoice Header\";\n+ SalesInvoiceLine: Record \"Sales Invoice Line\";\n+ begin\n+ SalesInvoiceHeader.SetRange(\"Pre-Assigned No.\", PreAssignedNo);\n+ SalesInvoiceHeader.FindFirst();\n+ Assert.Equal(SalesInvoiceHeader.\"Posting Date\", PostingDate);\n+ SalesInvoiceLine.SetFilter(\"Document No.\", SalesInvoiceHeader.\"No.\");\n+ SalesInvoiceLine.FindFirst();\n+ Assert.Equal(Amount, SalesInvoiceLine.\"Amount Including VAT\");\n+ end;\n+\n [RequestPageHandler]\n [Scope('OnPrem')]\n procedure RequestPageHandlerBatchPostSalesInvoices(var BatchPostSalesInvoices: TestRequestPage \"Batch Post Sales Invoices\")\n@@ -2195,5 +2272,26 @@\n Assert.AreEqual(PostBatchForm.PrintDoc.AsBoolean(), true, 'Expected value to be restored.');\n end;\n end;\n+\n+ [RequestPageHandler]\n+ procedure RequestPageHandlerBatchPostSalesInvoicesWithReplaceAllDates(var BatchPostSalesInvoices: TestRequestPage \"Batch Post Sales Invoices\")\n+ var\n+ SalesHeader: Record \"Sales Header\";\n+ DocumentNoFilter: Variant;\n+ PostingDate: Variant;\n+ RunReplacePostingDate: Boolean;\n+ begin\n+ LibraryVariableStorage.Dequeue(DocumentNoFilter);\n+ LibraryVariableStorage.Dequeue(PostingDate);\n+\n+ BatchPostSalesInvoices.\"Sales Header\".SetFilter(\"No.\", DocumentNoFilter);\n+ BatchPostSalesInvoices.\"Sales Header\".SetFilter(\"Document Type\", Format(SalesHeader.\"Document Type\"::Invoice));\n+\n+ BatchPostSalesInvoices.PostingDate.SetValue(PostingDate);\n+ RunReplacePostingDate := Format(PostingDate) <> '';\n+ BatchPostSalesInvoices.ReplacePostingDate.SetValue(RunReplacePostingDate);\n+ BatchPostSalesInvoices.ReplaceVATDate.SetValue(RunReplacePostingDate);\n+ BatchPostSalesInvoices.OK().Invoke();\n+ end;\n }\n \n", "patch": "diff --git a/App/Layers/W1/BaseApp/Sales/Document/SalesHeader.Table.al b/App/Layers/W1/BaseApp/Sales/Document/SalesHeader.Table.al\n--- a/App/Layers/W1/BaseApp/Sales/Document/SalesHeader.Table.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/SalesHeader.Table.al\n@@ -7038,7 +7038,10 @@\n exit;\n \n \"Posting Date\" := PostingDateReq;\n- Validate(\"Currency Code\");\n+ if \"Currency Code\" <> '' then begin\n+ UpdateCurrencyFactor();\n+ UpdateSalesLinesByFieldNo(SalesHeader.FieldNo(\"Currency Factor\"), false);\n+ end;\n \n if ReplaceVATDate then\n \"VAT Reporting Date\" := VATDateReq;\n"} +{"instance_id": "microsoftInternal__NAV-207236__cf-3", "base_instance_id": "microsoftInternal__NAV-207236", "variant_description": "Add conditional reopen/release workflow in batch posting for sales invoices with currency code", "intervention_type": "semantic-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-207236__cf-3", "FAIL_TO_PASS": [{"codeunitID": 134391, "functionName": ["BatchPostSaleInvoiceWithReplacePostingDateAndCurrencyCode"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/ERMSalesBatchPosting.Codeunit.al b/App/Layers/W1/Tests/ERM/ERMSalesBatchPosting.Codeunit.al\n--- a/App/Layers/W1/Tests/ERM/ERMSalesBatchPosting.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ERMSalesBatchPosting.Codeunit.al\n@@ -1571,6 +1571,37 @@\n \n \n VerifyPostedSalesOrder(SalesHeader.\"No.\", SalesHeader.\"Posting Date\" + 1, false);\n+ end;\n+\n+ [Test]\n+ [HandlerFunctions('RequestPageHandlerBatchPostSalesInvoicesWithReplaceAllDates,MessageHandler')]\n+ [Scope('OnPrem')]\n+ procedure BatchPostSaleInvoiceWithReplacePostingDateAndCurrencyCode()\n+ var\n+ Currency: Record Currency;\n+ SalesHeader: Record \"Sales Header\";\n+ LibraryJobQueue: Codeunit \"Library - Job Queue\";\n+ Amount: Decimal;\n+ begin\n+ // [SCENARIO 562713] Post sales invoice with currency code via Post Batch, but the posted data has not been changed.\n+ Initialize();\n+\n+ // [GIVEN] Set Post with Job queue on Sales & Receivables Setup\n+ LibrarySales.SetPostWithJobQueue(true);\n+\n+ // [GIVEN] Bind subscription and do not handle Job queue event as true\n+ BindSubscription(LibraryJobQueue);\n+ LibraryJobQueue.SetDoNotHandleCodeunitJobQueueEnqueueEvent(true);\n+\n+ // [GIVEN] Create Sales Invoice with Currency Code so the specialized reopen/release workflow is applicable.\n+ Amount := CreateSalesDocumentWithCurrency(SalesHeader, Currency, SalesHeader.\"Document Type\"::Invoice, false);\n+\n+ // [WHEN] Run Post Batch with Replace Posting Date, Replace Document Date & Replace VAT Date options.\n+ RunBatchPostSales(SalesHeader.\"Document Type\", SalesHeader.\"No.\", SalesHeader.\"Posting Date\" + 10, false);\n+ LibraryJobQueue.FindAndRunJobQueueEntryByRecordId(SalesHeader.RecordId);\n+\n+ // [THEN] The amount was not changed in the posted sales invoice line\n+ VerifyPostedSalesInvoiceAmount(SalesHeader.\"No.\", SalesHeader.\"Posting Date\" + 10, Amount);\n end;\n \n local procedure Initialize()\n@@ -1890,6 +1921,52 @@\n Assert.RecordCount(JobQueueEntry, 1);\n end;\n \n+ local procedure CreateSalesDocumentWithCurrency(var SalesHeader: Record \"Sales Header\"; var Currency: Record Currency; DocumentType: Enum \"Sales Document Type\"; InvDisc: Boolean): Decimal\n+ var\n+ Item: Record Item;\n+ SalesLine: Record \"Sales Line\";\n+ begin\n+ LibrarySales.CreateSalesHeader(SalesHeader, DocumentType, CreateCustomer(InvDisc));\n+ CreateCurrencyWithExchangeRate(Currency);\n+ SalesHeader.Validate(\"Currency Code\", Currency.Code);\n+ SalesHeader.Modify(true);\n+\n+ LibraryInventory.CreateItem(Item);\n+ LibrarySales.CreateSalesLine(SalesLine, SalesHeader, SalesLine.Type::Item, Item.\"No.\", LibraryRandom.RandInt(10));\n+ SalesLine.Validate(\"Unit Price\", LibraryRandom.RandInt(100));\n+ SalesLine.Validate(\"Line Discount %\", LibraryRandom.RandInt(20));\n+ SalesLine.Modify(true);\n+\n+ exit(SalesLine.\"Amount Including VAT\");\n+ end;\n+\n+ local procedure CreateCurrencyWithExchangeRate(var Currency: Record Currency)\n+ var\n+ CurrencyExchangeRate: Record \"Currency Exchange Rate\";\n+ begin\n+ Currency.Get(LibraryERM.CreateCurrencyWithGLAccountSetup());\n+\n+ LibraryERM.CreateExchRate(CurrencyExchangeRate, Currency.Code, WorkDate());\n+ CurrencyExchangeRate.Validate(\"Exchange Rate Amount\", LibraryRandom.RandInt(0));\n+ CurrencyExchangeRate.Validate(\"Adjustment Exch. Rate Amount\", LibraryRandom.RandInt(0));\n+ CurrencyExchangeRate.Validate(\"Relational Exch. Rate Amount\", LibraryRandom.RandDecInDecimalRange(0.6458, 0.6458, 4));\n+ CurrencyExchangeRate.Validate(\"Relational Adjmt Exch Rate Amt\", LibraryRandom.RandDecInDecimalRange(0.6458, 0.6458, 4));\n+ CurrencyExchangeRate.Modify(true);\n+ end;\n+\n+ local procedure VerifyPostedSalesInvoiceAmount(PreAssignedNo: Code[20]; PostingDate: Date; Amount: Decimal)\n+ var\n+ SalesInvoiceHeader: Record \"Sales Invoice Header\";\n+ SalesInvoiceLine: Record \"Sales Invoice Line\";\n+ begin\n+ SalesInvoiceHeader.SetRange(\"Pre-Assigned No.\", PreAssignedNo);\n+ SalesInvoiceHeader.FindFirst();\n+ Assert.Equal(SalesInvoiceHeader.\"Posting Date\", PostingDate);\n+ SalesInvoiceLine.SetFilter(\"Document No.\", SalesInvoiceHeader.\"No.\");\n+ SalesInvoiceLine.FindFirst();\n+ Assert.Equal(Amount, SalesInvoiceLine.\"Amount Including VAT\");\n+ end;\n+\n [RequestPageHandler]\n [Scope('OnPrem')]\n procedure RequestPageHandlerBatchPostSalesInvoices(var BatchPostSalesInvoices: TestRequestPage \"Batch Post Sales Invoices\")\n@@ -2195,5 +2272,26 @@\n Assert.AreEqual(PostBatchForm.PrintDoc.AsBoolean(), true, 'Expected value to be restored.');\n end;\n end;\n+\n+ [RequestPageHandler]\n+ procedure RequestPageHandlerBatchPostSalesInvoicesWithReplaceAllDates(var BatchPostSalesInvoices: TestRequestPage \"Batch Post Sales Invoices\")\n+ var\n+ SalesHeader: Record \"Sales Header\";\n+ DocumentNoFilter: Variant;\n+ PostingDate: Variant;\n+ RunReplacePostingDate: Boolean;\n+ begin\n+ LibraryVariableStorage.Dequeue(DocumentNoFilter);\n+ LibraryVariableStorage.Dequeue(PostingDate);\n+\n+ BatchPostSalesInvoices.\"Sales Header\".SetFilter(\"No.\", DocumentNoFilter);\n+ BatchPostSalesInvoices.\"Sales Header\".SetFilter(\"Document Type\", Format(SalesHeader.\"Document Type\"::Invoice));\n+\n+ BatchPostSalesInvoices.PostingDate.SetValue(PostingDate);\n+ RunReplacePostingDate := Format(PostingDate) <> '';\n+ BatchPostSalesInvoices.ReplacePostingDate.SetValue(RunReplacePostingDate);\n+ BatchPostSalesInvoices.ReplaceVATDate.SetValue(RunReplacePostingDate);\n+ BatchPostSalesInvoices.OK().Invoke();\n+ end;\n }\n \n", "patch": "diff --git a/App/Layers/W1/BaseApp/Sales/Posting/SalesBatchPostMgt.Codeunit.al b/App/Layers/W1/BaseApp/Sales/Posting/SalesBatchPostMgt.Codeunit.al\n--- a/App/Layers/W1/BaseApp/Sales/Posting/SalesBatchPostMgt.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Sales/Posting/SalesBatchPostMgt.Codeunit.al\n@@ -138,22 +138,25 @@\n \n local procedure PrepareSalesHeader(var SalesHeader: Record \"Sales Header\"; var BatchConfirm: Option)\n var\n- CalcInvoiceDiscont: Boolean;\n+ CalcInvoiceDiscount: Boolean;\n ReplacePostingDate, ReplaceVATDate, ReplaceDocumentDate : Boolean;\n+ ManualReopen: Boolean;\n PostingDate, VATDate : Date;\n begin\n- BatchProcessingMgt.GetBooleanParameter(SalesHeader.RecordId, Enum::\"Batch Posting Parameter Type\"::\"Calculate Invoice Discount\", CalcInvoiceDiscont);\n+ BatchProcessingMgt.GetBooleanParameter(SalesHeader.RecordId, Enum::\"Batch Posting Parameter Type\"::\"Calculate Invoice Discount\", CalcInvoiceDiscount);\n BatchProcessingMgt.GetBooleanParameter(SalesHeader.RecordId, Enum::\"Batch Posting Parameter Type\"::\"Replace Posting Date\", ReplacePostingDate);\n BatchProcessingMgt.GetDateParameter(SalesHeader.RecordId, Enum::\"Batch Posting Parameter Type\"::\"Posting Date\", PostingDate);\n BatchProcessingMgt.GetBooleanParameter(SalesHeader.RecordId, Enum::\"Batch Posting Parameter Type\"::\"Replace VAT Date\", ReplaceVATDate);\n BatchProcessingMgt.GetDateParameter(SalesHeader.RecordId, Enum::\"Batch Posting Parameter Type\"::\"VAT Date\", VATDate);\n BatchProcessingMgt.GetBooleanParameter(SalesHeader.RecordId, Enum::\"Batch Posting Parameter Type\"::\"Replace Document Date\", ReplaceDocumentDate);\n \n- if CalcInvoiceDiscont then\n+ if CalcInvoiceDiscount then\n CalculateInvoiceDiscount(SalesHeader);\n \n SalesHeader.BatchConfirmUpdateDeferralDate(BatchConfirm, ReplacePostingDate, PostingDate, ReplaceVATDate, VATDate);\n+ PerformManualReleaseOrReopenSalesHeader(SalesHeader, ManualReopen, ReplacePostingDate);\n SalesHeader.BatchConfirmUpdatePostingDate(ReplacePostingDate, PostingDate, ReplaceVATDate, VATDate, ReplaceDocumentDate);\n+ PerformManualReleaseOrReopenSalesHeader(SalesHeader, ManualReopen, ReplacePostingDate);\n OnPrepareSalesHeaderOnAfterBatchConfirmUpdateDeferralDate(SalesHeader, BatchProcessingMgt);\n \n BatchProcessingMgt.GetBooleanParameter(SalesHeader.RecordId, Enum::\"Batch Posting Parameter Type\"::Ship, SalesHeader.Ship);\n@@ -308,6 +311,23 @@\n \n \n JobQueueEntry.Insert(true);\n+ end;\n+\n+ local procedure PerformManualReleaseOrReopenSalesHeader(var SalesHeader: Record \"Sales Header\"; var ManualReopen: Boolean; ReplacePostingDate: Boolean)\n+ var\n+ ReleaseSalesDoc: Codeunit \"Release Sales Document\";\n+ begin\n+ if (not ReplacePostingDate) or (SalesHeader.\"Currency Code\" = '') then\n+ exit;\n+ if not SalesHeader.Invoice and not (SalesHeader.\"Document Type\" = SalesHeader.\"Document Type\"::Invoice) then\n+ exit;\n+\n+ if ManualReopen then\n+ ReleaseSalesHeader(SalesHeader)\n+ else begin\n+ ReleaseSalesDoc.PerformManualReopen(SalesHeader);\n+ ManualReopen := true;\n+ end;\n end;\n \n [EventSubscriber(ObjectType::Codeunit, Codeunit::\"Batch Processing Mgt.\", 'OnBeforeBatchProcessing', '', false, false)]\n"} +{"instance_id": "microsoftInternal__NAV-207236__cf-4", "base_instance_id": "microsoftInternal__NAV-207236", "variant_description": "Guard RecreateSalesLines with xRec context check to prevent false positive in batch scenarios", "intervention_type": "semantic-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-207236__cf-4", "FAIL_TO_PASS": [{"codeunitID": 134391, "functionName": ["BatchPostSaleInvoiceWithReplacePostingDateAndCurrencyCode"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/ERMSalesBatchPosting.Codeunit.al b/App/Layers/W1/Tests/ERM/ERMSalesBatchPosting.Codeunit.al\n--- a/App/Layers/W1/Tests/ERM/ERMSalesBatchPosting.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ERMSalesBatchPosting.Codeunit.al\n@@ -1571,6 +1571,37 @@\n \n \n VerifyPostedSalesOrder(SalesHeader.\"No.\", SalesHeader.\"Posting Date\" + 1, false);\n+ end;\n+\n+ [Test]\n+ [HandlerFunctions('RequestPageHandlerBatchPostSalesInvoicesWithReplaceAllDates,MessageHandler')]\n+ [Scope('OnPrem')]\n+ procedure BatchPostSaleInvoiceWithReplacePostingDateAndCurrencyCode()\n+ var\n+ Currency: Record Currency;\n+ SalesHeader: Record \"Sales Header\";\n+ LibraryJobQueue: Codeunit \"Library - Job Queue\";\n+ Amount: Decimal;\n+ begin\n+ // [SCENARIO 562713] Post sales invoice with currency code via Post Batch, but the posted data has not been changed.\n+ Initialize();\n+\n+ // [GIVEN] Set Post with Job queue on Sales & Receivables Setup\n+ LibrarySales.SetPostWithJobQueue(true);\n+\n+ // [GIVEN] Bind subscription and do not handle Job queue event as true\n+ BindSubscription(LibraryJobQueue);\n+ LibraryJobQueue.SetDoNotHandleCodeunitJobQueueEnqueueEvent(true);\n+\n+ // [GIVEN] Create Sales Invoice with Currency Code.\n+ Amount := CreateSalesDocumentWithCurrency(SalesHeader, Currency, SalesHeader.\"Document Type\"::Invoice, false);\n+\n+ // [WHEN] Run Post Batch with Replace Posting Date, Replace Document Date & Replace VAT Date options.\n+ RunBatchPostSales(SalesHeader.\"Document Type\", SalesHeader.\"No.\", SalesHeader.\"Posting Date\" + 10, false);\n+ LibraryJobQueue.FindAndRunJobQueueEntryByRecordId(SalesHeader.RecordId);\n+\n+ // [THEN] The amount was not changed in the posted sales invoice line because batch posting must not use unsupported interactive validation context\n+ VerifyPostedSalesInvoiceAmount(SalesHeader.\"No.\", SalesHeader.\"Posting Date\" + 10, Amount);\n end;\n \n local procedure Initialize()\n@@ -1890,6 +1921,52 @@\n Assert.RecordCount(JobQueueEntry, 1);\n end;\n \n+ local procedure CreateSalesDocumentWithCurrency(var SalesHeader: Record \"Sales Header\"; var Currency: Record Currency; DocumentType: Enum \"Sales Document Type\"; InvDisc: Boolean): Decimal\n+ var\n+ Item: Record Item;\n+ SalesLine: Record \"Sales Line\";\n+ begin\n+ LibrarySales.CreateSalesHeader(SalesHeader, DocumentType, CreateCustomer(InvDisc));\n+ CreateCurrencyWithExchangeRate(Currency);\n+ SalesHeader.Validate(\"Currency Code\", Currency.Code);\n+ SalesHeader.Modify(true);\n+\n+ LibraryInventory.CreateItem(Item);\n+ LibrarySales.CreateSalesLine(SalesLine, SalesHeader, SalesLine.Type::Item, Item.\"No.\", LibraryRandom.RandInt(10));\n+ SalesLine.Validate(\"Unit Price\", LibraryRandom.RandInt(100));\n+ SalesLine.Validate(\"Line Discount %\", LibraryRandom.RandInt(20));\n+ SalesLine.Modify(true);\n+\n+ exit(SalesLine.\"Amount Including VAT\");\n+ end;\n+\n+ local procedure CreateCurrencyWithExchangeRate(var Currency: Record Currency)\n+ var\n+ CurrencyExchangeRate: Record \"Currency Exchange Rate\";\n+ begin\n+ Currency.Get(LibraryERM.CreateCurrencyWithGLAccountSetup());\n+\n+ LibraryERM.CreateExchRate(CurrencyExchangeRate, Currency.Code, WorkDate());\n+ CurrencyExchangeRate.Validate(\"Exchange Rate Amount\", LibraryRandom.RandInt(0));\n+ CurrencyExchangeRate.Validate(\"Adjustment Exch. Rate Amount\", LibraryRandom.RandInt(0));\n+ CurrencyExchangeRate.Validate(\"Relational Exch. Rate Amount\", LibraryRandom.RandDecInDecimalRange(0.6458, 0.6458, 4));\n+ CurrencyExchangeRate.Validate(\"Relational Adjmt Exch Rate Amt\", LibraryRandom.RandDecInDecimalRange(0.6458, 0.6458, 4));\n+ CurrencyExchangeRate.Modify(true);\n+ end;\n+\n+ local procedure VerifyPostedSalesInvoiceAmount(PreAssignedNo: Code[20]; PostingDate: Date; Amount: Decimal)\n+ var\n+ SalesInvoiceHeader: Record \"Sales Invoice Header\";\n+ SalesInvoiceLine: Record \"Sales Invoice Line\";\n+ begin\n+ SalesInvoiceHeader.SetRange(\"Pre-Assigned No.\", PreAssignedNo);\n+ SalesInvoiceHeader.FindFirst();\n+ Assert.Equal(SalesInvoiceHeader.\"Posting Date\", PostingDate);\n+ SalesInvoiceLine.SetFilter(\"Document No.\", SalesInvoiceHeader.\"No.\");\n+ SalesInvoiceLine.FindFirst();\n+ Assert.Equal(Amount, SalesInvoiceLine.\"Amount Including VAT\");\n+ end;\n+\n [RequestPageHandler]\n [Scope('OnPrem')]\n procedure RequestPageHandlerBatchPostSalesInvoices(var BatchPostSalesInvoices: TestRequestPage \"Batch Post Sales Invoices\")\n@@ -2195,5 +2272,26 @@\n Assert.AreEqual(PostBatchForm.PrintDoc.AsBoolean(), true, 'Expected value to be restored.');\n end;\n end;\n+\n+ [RequestPageHandler]\n+ procedure RequestPageHandlerBatchPostSalesInvoicesWithReplaceAllDates(var BatchPostSalesInvoices: TestRequestPage \"Batch Post Sales Invoices\")\n+ var\n+ SalesHeader: Record \"Sales Header\";\n+ DocumentNoFilter: Variant;\n+ PostingDate: Variant;\n+ RunReplacePostingDate: Boolean;\n+ begin\n+ LibraryVariableStorage.Dequeue(DocumentNoFilter);\n+ LibraryVariableStorage.Dequeue(PostingDate);\n+\n+ BatchPostSalesInvoices.\"Sales Header\".SetFilter(\"No.\", DocumentNoFilter);\n+ BatchPostSalesInvoices.\"Sales Header\".SetFilter(\"Document Type\", Format(SalesHeader.\"Document Type\"::Invoice));\n+\n+ BatchPostSalesInvoices.PostingDate.SetValue(PostingDate);\n+ RunReplacePostingDate := Format(PostingDate) <> '';\n+ BatchPostSalesInvoices.ReplacePostingDate.SetValue(RunReplacePostingDate);\n+ BatchPostSalesInvoices.ReplaceVATDate.SetValue(RunReplacePostingDate);\n+ BatchPostSalesInvoices.OK().Invoke();\n+ end;\n }\n \n", "patch": "diff --git a/App/Layers/W1/BaseApp/Sales/Document/SalesHeader.Table.al b/App/Layers/W1/BaseApp/Sales/Document/SalesHeader.Table.al\n--- a/App/Layers/W1/BaseApp/Sales/Document/SalesHeader.Table.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/SalesHeader.Table.al\n@@ -4154,7 +4154,7 @@\n \n if UpdateCurrencyExchangeRates.ExchangeRatesForCurrencyExist(CurrencyDate, \"Currency Code\") then begin\n \"Currency Factor\" := CurrExchRate.ExchangeRate(CurrencyDate, \"Currency Code\");\n- if \"Currency Code\" <> xRec.\"Currency Code\" then\n+ if (\"Currency Code\" <> xRec.\"Currency Code\") and (xRec.\"No.\" <> '') then\n RecreateSalesLines(FieldCaption(\"Currency Code\"));\n end else\n UpdateCurrencyExchangeRates.ShowMissingExchangeRatesNotification(\"Currency Code\");\n"} +{"instance_id": "microsoftInternal__NAV-191624__cf-1", "base_instance_id": "microsoftInternal__NAV-191624", "variant_description": "Move CreateTypes from OnOpenPage to OnInit trigger", "intervention_type": "semantic-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-191624__cf-1", "FAIL_TO_PASS": [{"codeunitID": 139545, "functionName": ["FirstTimeOpeningRequestPageOfFixedAssetAnalysisShouldInsertPostingTypes"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Apps/W1/ExcelReports/test/src/FixedAssetExcelReports.Codeunit.al b/App/Apps/W1/ExcelReports/test/src/FixedAssetExcelReports.Codeunit.al\n--- a/App/Apps/W1/ExcelReports/test/src/FixedAssetExcelReports.Codeunit.al\n+++ b/App/Apps/W1/ExcelReports/test/src/FixedAssetExcelReports.Codeunit.al\n@@ -0,0 +1,43 @@\n+namespace Microsoft.Finance.ExcelReports.Test;\n+using Microsoft.FixedAssets.Posting;\n+using Microsoft.Finance.ExcelReports;\n+\n+codeunit 139545 \"Fixed Asset Excel Reports\"\n+{\n+ Subtype = Test;\n+ TestPermissions = Disabled;\n+\n+ var\n+ Assert: Codeunit Assert;\n+\n+ [Test]\n+ [HandlerFunctions('EXRFixedAssetAnalysisExcelHandler')]\n+ procedure FirstTimeOpeningRequestPageOfFixedAssetAnalysisShouldInsertPostingTypes()\n+ var\n+ RequestPageXml: Text;\n+ begin\n+ // [SCENARIO 544231] First time initializing the Fixed Asset Analysis Excel report should insert the FixedAssetTypes required by the report\n+ // [GIVEN] There is no FA Posting Type\n+ CleanupFixedAssetData();\n+ Commit();\n+ Assert.TableIsEmpty(Database::\"FA Posting Type\");\n+ // [WHEN] Initializing the Fixed Asset Analysis report\n+ RequestPageXml := Report.RunRequestPage(Report::\"EXR Fixed Asset Analysis Excel\", RequestPageXml);\n+ // [THEN] The default FA Posting Type's are inserted\n+ Assert.TableIsNotEmpty(Database::\"FA Posting Type\");\n+ end;\n+\n+ local procedure CleanupFixedAssetData()\n+ var\n+ FAPostingType: Record \"FA Posting Type\";\n+ begin\n+ FAPostingType.DeleteAll();\n+ end;\n+\n+ [RequestPageHandler]\n+ procedure EXRFixedAssetAnalysisExcelHandler(var EXRFixedAssetAnalysisExcel: TestRequestPage \"EXR Fixed Asset Analysis Excel\")\n+ begin\n+ EXRFixedAssetAnalysisExcel.OK().Invoke();\n+ end;\n+\n+}\n", "patch": "diff --git a/App/Apps/W1/ExcelReports/app/src/Financials/EXRFixedAssetAnalysisExcel.Report.al b/App/Apps/W1/ExcelReports/app/src/Financials/EXRFixedAssetAnalysisExcel.Report.al\n--- a/App/Apps/W1/ExcelReports/app/src/Financials/EXRFixedAssetAnalysisExcel.Report.al\n+++ b/App/Apps/W1/ExcelReports/app/src/Financials/EXRFixedAssetAnalysisExcel.Report.al\n@@ -121,9 +121,10 @@\n \n \n \n- trigger OnOpenPage()\n+ trigger OnInit()\n var\n DepreciationBook: Record \"Depreciation Book\";\n+ FixedAssetPostingType: Record \"FA Posting Type\";\n FASetup: Record \"FA Setup\";\n begin\n EndingDate := WorkDate();\n@@ -135,6 +136,7 @@\n if FASetup.\"Default Depr. Book\" <> '' then\n DepreciationBookCode := FASetup.\"Default Depr. Book\";\n end;\n+ FixedAssetPostingType.CreateTypes();\n end;\n }\n rendering\n"} +{"instance_id": "microsoftInternal__NAV-191624__cf-2", "base_instance_id": "microsoftInternal__NAV-191624", "variant_description": "Only create FA posting types when FA Setup default depreciation book is configured", "intervention_type": "semantic-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-191624__cf-2", "FAIL_TO_PASS": [{"codeunitID": 139545, "functionName": ["FirstTimeOpeningRequestPageOfFixedAssetAnalysisShouldInsertPostingTypes"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Apps/W1/ExcelReports/test/src/FixedAssetExcelReports.Codeunit.al b/App/Apps/W1/ExcelReports/test/src/FixedAssetExcelReports.Codeunit.al\n--- a/App/Apps/W1/ExcelReports/test/src/FixedAssetExcelReports.Codeunit.al\n+++ b/App/Apps/W1/ExcelReports/test/src/FixedAssetExcelReports.Codeunit.al\n@@ -0,0 +1,43 @@\n+namespace Microsoft.Finance.ExcelReports.Test;\n+using Microsoft.FixedAssets.Posting;\n+using Microsoft.Finance.ExcelReports;\n+\n+codeunit 139545 \"Fixed Asset Excel Reports\"\n+{\n+ Subtype = Test;\n+ TestPermissions = Disabled;\n+\n+ var\n+ Assert: Codeunit Assert;\n+\n+ [Test]\n+ [HandlerFunctions('EXRFixedAssetAnalysisExcelHandler')]\n+ procedure FirstTimeOpeningRequestPageOfFixedAssetAnalysisShouldInsertPostingTypes()\n+ var\n+ RequestPageXml: Text;\n+ begin\n+ // [SCENARIO 544231] First time opening the Fixed Asset Analysis Excel report requestpage should insert the FixedAssetTypes required by the report\n+ // [GIVEN] There is no FA Posting Type and FA Setup has default depreciation book\n+ CleanupFixedAssetData();\n+ Commit();\n+ Assert.TableIsEmpty(Database::\"FA Posting Type\");\n+ // [WHEN] Opening the requestpage of the Fixed Asset Analysis report\n+ RequestPageXml := Report.RunRequestPage(Report::\"EXR Fixed Asset Analysis Excel\", RequestPageXml);\n+ // [THEN] The default FA Posting Type's are inserted\n+ Assert.TableIsNotEmpty(Database::\"FA Posting Type\");\n+ end;\n+\n+ local procedure CleanupFixedAssetData()\n+ var\n+ FAPostingType: Record \"FA Posting Type\";\n+ begin\n+ FAPostingType.DeleteAll();\n+ end;\n+\n+ [RequestPageHandler]\n+ procedure EXRFixedAssetAnalysisExcelHandler(var EXRFixedAssetAnalysisExcel: TestRequestPage \"EXR Fixed Asset Analysis Excel\")\n+ begin\n+ EXRFixedAssetAnalysisExcel.OK().Invoke();\n+ end;\n+\n+}\n", "patch": "diff --git a/App/Apps/W1/ExcelReports/app/src/Financials/EXRFixedAssetAnalysisExcel.Report.al b/App/Apps/W1/ExcelReports/app/src/Financials/EXRFixedAssetAnalysisExcel.Report.al\n--- a/App/Apps/W1/ExcelReports/app/src/Financials/EXRFixedAssetAnalysisExcel.Report.al\n+++ b/App/Apps/W1/ExcelReports/app/src/Financials/EXRFixedAssetAnalysisExcel.Report.al\n@@ -124,6 +124,7 @@\n trigger OnOpenPage()\n var\n DepreciationBook: Record \"Depreciation Book\";\n+ FixedAssetPostingType: Record \"FA Posting Type\";\n FASetup: Record \"FA Setup\";\n begin\n EndingDate := WorkDate();\n@@ -135,6 +136,8 @@\n if FASetup.\"Default Depr. Book\" <> '' then\n DepreciationBookCode := FASetup.\"Default Depr. Book\";\n end;\n+ if FASetup.\"Default Depr. Book\" <> '' then\n+ FixedAssetPostingType.CreateTypes();\n end;\n }\n rendering\n"} +{"instance_id": "microsoftInternal__NAV-195193__cf-1", "base_instance_id": "microsoftInternal__NAV-195193", "variant_description": "Treat zero values as debit instead of neutral in debit/credit split", "intervention_type": "semantic-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-195193__cf-1", "FAIL_TO_PASS": [{"codeunitID": 139544, "functionName": ["TrialBalanceBufferNetChangeSplitsIntoDebitAndCreditWhenCalledSeveralTimes"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Apps/W1/ExcelReports/test/src/TrialBalanceExcelReports.Codeunit.al b/App/Apps/W1/ExcelReports/test/src/TrialBalanceExcelReports.Codeunit.al\n--- a/App/Apps/W1/ExcelReports/test/src/TrialBalanceExcelReports.Codeunit.al\n+++ b/App/Apps/W1/ExcelReports/test/src/TrialBalanceExcelReports.Codeunit.al\n@@ -296,6 +296,56 @@\n \n \n asserterror LibraryReportDataset.RunReportAndLoad(Report::\"EXR Consolidated Trial Balance\", Variant, RequestPageXml);\n+ end;\n+\n+ [Test]\n+ procedure TrialBalanceBufferNetChangeSplitsIntoDebitAndCreditWhenCalledSeveralTimes()\n+ var\n+ EXRTrialBalanceBuffer: Record \"EXR Trial Balance Buffer\";\n+ ValuesToSplitInCreditAndDebit: array[3] of Decimal;\n+ begin\n+ // [SCENARIO 547558] Trial Balance Buffer data split into Debit and Credit correctly, even if called multiple times.\n+ // [GIVEN] Trial Balance Buffer filled with positive Balance/Net Change\n+ ValuesToSplitInCreditAndDebit[1] := 0;\n+ // [GIVEN] Trial Balance Buffer filled with negative Balance/Net Change\n+ ValuesToSplitInCreditAndDebit[2] := -110;\n+ // [GIVEN] Trial Balance Buffer filled with positive Balance/Net Change\n+ ValuesToSplitInCreditAndDebit[3] := 998;\n+ // [WHEN] Trial Balance Buffer entries are inserted\n+ EXRTrialBalanceBuffer.\"G/L Account No.\" := 'A';\n+ EXRTrialBalanceBuffer.Validate(\"Net Change\", ValuesToSplitInCreditAndDebit[1]);\n+ EXRTrialBalanceBuffer.Validate(Balance, ValuesToSplitInCreditAndDebit[1]);\n+ EXRTrialBalanceBuffer.Validate(\"Net Change (ACY)\", ValuesToSplitInCreditAndDebit[1]);\n+ EXRTrialBalanceBuffer.Validate(\"Balance (ACY)\", ValuesToSplitInCreditAndDebit[1]);\n+ EXRTrialBalanceBuffer.Insert();\n+ EXRTrialBalanceBuffer.\"G/L Account No.\" := 'B';\n+ EXRTrialBalanceBuffer.Validate(\"Net Change\", ValuesToSplitInCreditAndDebit[2]);\n+ EXRTrialBalanceBuffer.Validate(Balance, ValuesToSplitInCreditAndDebit[2]);\n+ EXRTrialBalanceBuffer.Validate(\"Net Change (ACY)\", ValuesToSplitInCreditAndDebit[2]);\n+ EXRTrialBalanceBuffer.Validate(\"Balance (ACY)\", ValuesToSplitInCreditAndDebit[2]);\n+ EXRTrialBalanceBuffer.Insert();\n+ EXRTrialBalanceBuffer.\"G/L Account No.\" := 'C';\n+ EXRTrialBalanceBuffer.Validate(\"Net Change\", ValuesToSplitInCreditAndDebit[3]);\n+ EXRTrialBalanceBuffer.Validate(Balance, ValuesToSplitInCreditAndDebit[3]);\n+ EXRTrialBalanceBuffer.Validate(\"Net Change (ACY)\", ValuesToSplitInCreditAndDebit[3]);\n+ EXRTrialBalanceBuffer.Validate(\"Balance (ACY)\", ValuesToSplitInCreditAndDebit[3]);\n+ EXRTrialBalanceBuffer.Insert();\n+ // [THEN] All Entries have the right split in Credit and Debit\n+ EXRTrialBalanceBuffer.FindSet();\n+ Assert.AreEqual(ValuesToSplitInCreditAndDebit[1], Abs(EXRTrialBalanceBuffer.\"Net Change (Debit)\" + EXRTrialBalanceBuffer.\"Net Change (Credit)\"), 'Split in line in credit and debit should be the same as the inserted value.');\n+ Assert.AreEqual(ValuesToSplitInCreditAndDebit[1], Abs(EXRTrialBalanceBuffer.\"Balance (Debit)\" + EXRTrialBalanceBuffer.\"Balance (Credit)\"), 'Split in line in credit and debit should be the same as the inserted value.');\n+ Assert.AreEqual(ValuesToSplitInCreditAndDebit[1], Abs(EXRTrialBalanceBuffer.\"Net Change (Debit) (ACY)\" + EXRTrialBalanceBuffer.\"Net Change (Credit) (ACY)\"), 'Split in line in credit and debit should be the same as the inserted value.');\n+ Assert.AreEqual(ValuesToSplitInCreditAndDebit[1], Abs(EXRTrialBalanceBuffer.\"Balance (Debit) (ACY)\" + EXRTrialBalanceBuffer.\"Balance (Credit) (ACY)\"), 'Split in line in credit and debit should be the same as the inserted value.');\n+ EXRTrialBalanceBuffer.Next();\n+ Assert.AreEqual(-ValuesToSplitInCreditAndDebit[2], Abs(EXRTrialBalanceBuffer.\"Net Change (Debit)\" + EXRTrialBalanceBuffer.\"Net Change (Credit)\"), 'Split in line in credit and debit should be the same as the inserted value.');\n+ Assert.AreEqual(-ValuesToSplitInCreditAndDebit[2], Abs(EXRTrialBalanceBuffer.\"Balance (Debit)\" + EXRTrialBalanceBuffer.\"Balance (Credit)\"), 'Split in line in credit and debit should be the same as the inserted value.');\n+ Assert.AreEqual(-ValuesToSplitInCreditAndDebit[2], Abs(EXRTrialBalanceBuffer.\"Net Change (Debit) (ACY)\" + EXRTrialBalanceBuffer.\"Net Change (Credit) (ACY)\"), 'Split in line in credit and debit should be the same as the inserted value.');\n+ Assert.AreEqual(-ValuesToSplitInCreditAndDebit[2], Abs(EXRTrialBalanceBuffer.\"Balance (Debit) (ACY)\" + EXRTrialBalanceBuffer.\"Balance (Credit) (ACY)\"), 'Split in line in credit and debit should be the same as the inserted value.');\n+ EXRTrialBalanceBuffer.Next();\n+ Assert.AreEqual(ValuesToSplitInCreditAndDebit[3], Abs(EXRTrialBalanceBuffer.\"Net Change (Debit)\" + EXRTrialBalanceBuffer.\"Net Change (Credit)\"), 'Split in line in credit and debit should be the same as the inserted value.');\n+ Assert.AreEqual(ValuesToSplitInCreditAndDebit[3], Abs(EXRTrialBalanceBuffer.\"Balance (Debit)\" + EXRTrialBalanceBuffer.\"Balance (Credit)\"), 'Split in line in credit and debit should be the same as the inserted value.');\n+ Assert.AreEqual(ValuesToSplitInCreditAndDebit[3], Abs(EXRTrialBalanceBuffer.\"Net Change (Debit) (ACY)\" + EXRTrialBalanceBuffer.\"Net Change (Credit) (ACY)\"), 'Split in line in credit and debit should be the same as the inserted value.');\n+ Assert.AreEqual(ValuesToSplitInCreditAndDebit[3], Abs(EXRTrialBalanceBuffer.\"Balance (Debit) (ACY)\" + EXRTrialBalanceBuffer.\"Balance (Credit) (ACY)\"), 'Split in line in credit and debit should be the same as the inserted value.');\n end;\n \n local procedure CreateSampleBusinessUnits(HowMany: Integer)\n", "patch": "diff --git a/App/Apps/W1/ExcelReports/app/src/Financials/EXRTrialBalanceBuffer.Table.al b/App/Apps/W1/ExcelReports/app/src/Financials/EXRTrialBalanceBuffer.Table.al\n--- a/App/Apps/W1/ExcelReports/app/src/Financials/EXRTrialBalanceBuffer.Table.al\n+++ b/App/Apps/W1/ExcelReports/app/src/Financials/EXRTrialBalanceBuffer.Table.al\n@@ -44,10 +44,14 @@\n \n trigger OnValidate()\n begin\n- if (\"Net Change\" > 0) then\n- Validate(\"Net Change (Debit)\", \"Net Change\")\n- else\n+ if (\"Net Change\" >= 0) then begin\n+ Validate(\"Net Change (Debit)\", \"Net Change\");\n+ Validate(\"Net Change (Credit)\", 0);\n+ end\n+ else begin\n Validate(\"Net Change (Credit)\", -\"Net Change\");\n+ Validate(\"Net Change (Debit)\", 0);\n+ end;\n end;\n }\n field(11; \"Net Change (Debit)\"; Decimal)\n@@ -64,10 +68,14 @@\n \n trigger OnValidate()\n begin\n- if (\"Balance\" > 0) then\n- Validate(\"Balance (Debit)\", \"Balance\")\n- else\n+ if (\"Balance\" >= 0) then begin\n+ Validate(\"Balance (Debit)\", \"Balance\");\n+ Validate(\"Balance (Credit)\", 0);\n+ end\n+ else begin\n Validate(\"Balance (Credit)\", -\"Balance\");\n+ Validate(\"Balance (Debit)\", 0);\n+ end;\n end;\n }\n field(14; \"Balance (Debit)\"; Decimal)\n@@ -100,10 +108,14 @@\n \n trigger OnValidate()\n begin\n- if (\"Last Period Net\" > 0) then\n- Validate(\"Last Period Net (Debit)\", \"Last Period Net\")\n- else\n+ if (\"Last Period Net\" >= 0) then begin\n+ Validate(\"Last Period Net (Debit)\", \"Last Period Net\");\n+ Validate(\"Last Period Net (Credit)\", 0);\n+ end\n+ else begin\n Validate(\"Last Period Net (Credit)\", -\"Last Period Net\");\n+ Validate(\"Last Period Net (Debit)\", 0);\n+ end;\n end;\n }\n field(51; \"Last Period Net (Debit)\"; Decimal)\n@@ -120,10 +132,14 @@\n \n trigger OnValidate()\n begin\n- if (\"Last Period Bal.\" > 0) then\n- Validate(\"Last Period Bal. (Debit)\", \"Last Period Bal.\")\n- else\n+ if (\"Last Period Bal.\" >= 0) then begin\n+ Validate(\"Last Period Bal. (Debit)\", \"Last Period Bal.\");\n+ Validate(\"Last Period Bal. (Credit)\", 0);\n+ end\n+ else begin\n Validate(\"Last Period Bal. (Credit)\", -\"Last Period Bal.\");\n+ Validate(\"Last Period Bal. (Debit)\", 0);\n+ end;\n end;\n }\n field(61; \"Last Period Bal. (Debit)\"; Decimal)\n@@ -156,10 +172,14 @@\n \n trigger OnValidate()\n begin\n- if (\"Net Change\" > 0) then\n- Validate(\"Net Change (Debit) (ACY)\", \"Net Change (ACY)\")\n- else\n+ if (\"Net Change\" >= 0) then begin\n+ Validate(\"Net Change (Debit) (ACY)\", \"Net Change (ACY)\");\n+ Validate(\"Net Change (Credit) (ACY)\", 0);\n+ end\n+ else begin\n Validate(\"Net Change (Credit) (ACY)\", -\"Net Change (ACY)\");\n+ Validate(\"Net Change (Debit) (ACY)\", 0);\n+ end;\n end;\n }\n field(111; \"Net Change (Debit) (ACY)\"; Decimal)\n@@ -176,10 +196,14 @@\n \n trigger OnValidate()\n begin\n- if (\"Balance\" > 0) then\n- Validate(\"Balance (Debit) (ACY)\", \"Balance (ACY)\")\n- else\n+ if (\"Balance\" >= 0) then begin\n+ Validate(\"Balance (Debit) (ACY)\", \"Balance (ACY)\");\n+ Validate(\"Balance (Credit) (ACY)\", 0);\n+ end\n+ else begin\n Validate(\"Balance (Credit) (ACY)\", -\"Balance (ACY)\");\n+ Validate(\"Balance (Debit) (ACY)\", 0);\n+ end;\n end;\n }\n field(114; \"Balance (Debit) (ACY)\"; Decimal)\n@@ -196,10 +220,14 @@\n \n trigger OnValidate()\n begin\n- if (\"Last Period Net\" > 0) then\n- Validate(\"Last Period Net (Debit) (ACY)\", \"Last Period Net (ACY)\")\n- else\n+ if (\"Last Period Net\" >= 0) then begin\n+ Validate(\"Last Period Net (Debit) (ACY)\", \"Last Period Net (ACY)\");\n+ Validate(\"Last Period Net (Credit) (ACY)\", 0);\n+ end\n+ else begin\n Validate(\"Last Period Net (Credit) (ACY)\", -\"Last Period Net (ACY)\");\n+ Validate(\"Last Period Net (Debit) (ACY)\", 0);\n+ end;\n end;\n }\n field(151; \"Last Period Net (Debit) (ACY)\"; Decimal)\n@@ -216,10 +244,14 @@\n \n trigger OnValidate()\n begin\n- if (\"Last Period Bal.\" > 0) then\n- Validate(\"Last Period Bal. (Debit) (ACY)\", \"Last Period Bal. (ACY)\")\n- else\n+ if (\"Last Period Bal.\" >= 0) then begin\n+ Validate(\"Last Period Bal. (Debit) (ACY)\", \"Last Period Bal. (ACY)\");\n+ Validate(\"Last Period Bal. (Cred.) (ACY)\", 0);\n+ end\n+ else begin\n Validate(\"Last Period Bal. (Cred.) (ACY)\", -\"Last Period Bal. (ACY)\");\n+ Validate(\"Last Period Bal. (Debit) (ACY)\", 0);\n+ end;\n end;\n }\n field(161; \"Last Period Bal. (Debit) (ACY)\"; Decimal)\ndiff --git a/App/Apps/W1/ExcelReports/app/src/Financials/TrialBalance.Codeunit.al b/App/Apps/W1/ExcelReports/app/src/Financials/TrialBalance.Codeunit.al\n--- a/App/Apps/W1/ExcelReports/app/src/Financials/TrialBalance.Codeunit.al\n+++ b/App/Apps/W1/ExcelReports/app/src/Financials/TrialBalance.Codeunit.al\n@@ -119,6 +119,7 @@\n \n local procedure InsertTrialBalanceDataForGLAccountWithFilters(var GLAccount: Record \"G/L Account\"; Dimension1ValueCode: Code[20]; Dimension2ValueCode: Code[20]; BusinessUnitCode: Code[20]; var TrialBalanceData: Record \"EXR Trial Balance Buffer\"; var Dimension1Values: Record \"Dimension Value\" temporary; var Dimension2Values: Record \"Dimension Value\" temporary)\n begin\n+ Clear(TrialBalanceData);\n GlAccount.CalcFields(\"Net Change\", \"Balance at Date\", \"Additional-Currency Net Change\", \"Add.-Currency Balance at Date\", \"Budgeted Amount\", \"Budget at Date\");\n TrialBalanceData.\"G/L Account No.\" := GlAccount.\"No.\";\n TrialBalanceData.\"Dimension 1 Code\" := Dimension1ValueCode;\n"} +{"instance_id": "microsoftInternal__NAV-195193__cf-2", "base_instance_id": "microsoftInternal__NAV-195193", "variant_description": "Only enforce correct debit/credit split for Net Change fields, not Balance", "intervention_type": "semantic-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-195193__cf-2", "FAIL_TO_PASS": [{"codeunitID": 139544, "functionName": ["TrialBalanceBufferNetChangeSplitsIntoDebitAndCreditWhenCalledSeveralTimes"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Apps/W1/ExcelReports/test/src/TrialBalanceExcelReports.Codeunit.al b/App/Apps/W1/ExcelReports/test/src/TrialBalanceExcelReports.Codeunit.al\n--- a/App/Apps/W1/ExcelReports/test/src/TrialBalanceExcelReports.Codeunit.al\n+++ b/App/Apps/W1/ExcelReports/test/src/TrialBalanceExcelReports.Codeunit.al\n@@ -296,6 +296,56 @@\n \n \n asserterror LibraryReportDataset.RunReportAndLoad(Report::\"EXR Consolidated Trial Balance\", Variant, RequestPageXml);\n+ end;\n+\n+ [Test]\n+ procedure TrialBalanceBufferNetChangeSplitsIntoDebitAndCreditWhenCalledSeveralTimes()\n+ var\n+ EXRTrialBalanceBuffer: Record \"EXR Trial Balance Buffer\";\n+ ValuesToSplitInCreditAndDebit: array[3] of Decimal;\n+ begin\n+ // [SCENARIO 547558] Trial Balance Buffer data split into Debit and Credit correctly, even if called multiple times.\n+ // [GIVEN] Trial Balance Buffer filled with positive Balance/Net Change\n+ ValuesToSplitInCreditAndDebit[1] := 837;\n+ // [GIVEN] Trial Balance Buffer filled with negative Balance/Net Change\n+ ValuesToSplitInCreditAndDebit[2] := -110;\n+ // [GIVEN] Trial Balance Buffer filled with positive Balance/Net Change\n+ ValuesToSplitInCreditAndDebit[3] := 998;\n+ // [WHEN] Trial Balance Buffer entries are inserted\n+ EXRTrialBalanceBuffer.\"G/L Account No.\" := 'A';\n+ EXRTrialBalanceBuffer.Validate(\"Net Change\", ValuesToSplitInCreditAndDebit[1]);\n+ EXRTrialBalanceBuffer.Validate(Balance, ValuesToSplitInCreditAndDebit[1]);\n+ EXRTrialBalanceBuffer.Validate(\"Net Change (ACY)\", ValuesToSplitInCreditAndDebit[1]);\n+ EXRTrialBalanceBuffer.Validate(\"Balance (ACY)\", ValuesToSplitInCreditAndDebit[1]);\n+ EXRTrialBalanceBuffer.Insert();\n+ EXRTrialBalanceBuffer.\"G/L Account No.\" := 'B';\n+ EXRTrialBalanceBuffer.Validate(\"Net Change\", ValuesToSplitInCreditAndDebit[2]);\n+ EXRTrialBalanceBuffer.Validate(Balance, ValuesToSplitInCreditAndDebit[2]);\n+ EXRTrialBalanceBuffer.Validate(\"Net Change (ACY)\", ValuesToSplitInCreditAndDebit[2]);\n+ EXRTrialBalanceBuffer.Validate(\"Balance (ACY)\", ValuesToSplitInCreditAndDebit[2]);\n+ EXRTrialBalanceBuffer.Insert();\n+ EXRTrialBalanceBuffer.\"G/L Account No.\" := 'C';\n+ EXRTrialBalanceBuffer.Validate(\"Net Change\", ValuesToSplitInCreditAndDebit[3]);\n+ EXRTrialBalanceBuffer.Validate(Balance, ValuesToSplitInCreditAndDebit[3]);\n+ EXRTrialBalanceBuffer.Validate(\"Net Change (ACY)\", ValuesToSplitInCreditAndDebit[3]);\n+ EXRTrialBalanceBuffer.Validate(\"Balance (ACY)\", ValuesToSplitInCreditAndDebit[3]);\n+ EXRTrialBalanceBuffer.Insert();\n+ // [THEN] All Entries have the right split in Credit and Debit\n+ EXRTrialBalanceBuffer.FindSet();\n+ Assert.AreEqual(ValuesToSplitInCreditAndDebit[1], Abs(EXRTrialBalanceBuffer.\"Net Change (Debit)\" + EXRTrialBalanceBuffer.\"Net Change (Credit)\"), 'Split in line in credit and debit should be the same as the inserted value.');\n+ // Balance split not required\n+ Assert.AreEqual(ValuesToSplitInCreditAndDebit[1], Abs(EXRTrialBalanceBuffer.\"Net Change (Debit) (ACY)\" + EXRTrialBalanceBuffer.\"Net Change (Credit) (ACY)\"), 'Split in line in credit and debit should be the same as the inserted value.');\n+ // Balance split not required\n+ EXRTrialBalanceBuffer.Next();\n+ Assert.AreEqual(-ValuesToSplitInCreditAndDebit[2], Abs(EXRTrialBalanceBuffer.\"Net Change (Debit)\" + EXRTrialBalanceBuffer.\"Net Change (Credit)\"), 'Split in line in credit and debit should be the same as the inserted value.');\n+ // Balance split not required\n+ Assert.AreEqual(-ValuesToSplitInCreditAndDebit[2], Abs(EXRTrialBalanceBuffer.\"Net Change (Debit) (ACY)\" + EXRTrialBalanceBuffer.\"Net Change (Credit) (ACY)\"), 'Split in line in credit and debit should be the same as the inserted value.');\n+ // Balance split not required\n+ EXRTrialBalanceBuffer.Next();\n+ Assert.AreEqual(ValuesToSplitInCreditAndDebit[3], Abs(EXRTrialBalanceBuffer.\"Net Change (Debit)\" + EXRTrialBalanceBuffer.\"Net Change (Credit)\"), 'Split in line in credit and debit should be the same as the inserted value.');\n+ // Balance split not required\n+ Assert.AreEqual(ValuesToSplitInCreditAndDebit[3], Abs(EXRTrialBalanceBuffer.\"Net Change (Debit) (ACY)\" + EXRTrialBalanceBuffer.\"Net Change (Credit) (ACY)\"), 'Split in line in credit and debit should be the same as the inserted value.');\n+ // Balance split not required\n end;\n \n local procedure CreateSampleBusinessUnits(HowMany: Integer)\n", "patch": "diff --git a/App/Apps/W1/ExcelReports/app/src/Financials/EXRTrialBalanceBuffer.Table.al b/App/Apps/W1/ExcelReports/app/src/Financials/EXRTrialBalanceBuffer.Table.al\n--- a/App/Apps/W1/ExcelReports/app/src/Financials/EXRTrialBalanceBuffer.Table.al\n+++ b/App/Apps/W1/ExcelReports/app/src/Financials/EXRTrialBalanceBuffer.Table.al\n@@ -44,10 +44,14 @@\n \n trigger OnValidate()\n begin\n- if (\"Net Change\" > 0) then\n- Validate(\"Net Change (Debit)\", \"Net Change\")\n- else\n+ if (\"Net Change\" > 0) then begin\n+ Validate(\"Net Change (Debit)\", \"Net Change\");\n+ Validate(\"Net Change (Credit)\", 0);\n+ end\n+ else begin\n Validate(\"Net Change (Credit)\", -\"Net Change\");\n+ Validate(\"Net Change (Debit)\", 0);\n+ end;\n end;\n }\n field(11; \"Net Change (Debit)\"; Decimal)\n@@ -156,10 +160,14 @@\n \n trigger OnValidate()\n begin\n- if (\"Net Change\" > 0) then\n- Validate(\"Net Change (Debit) (ACY)\", \"Net Change (ACY)\")\n- else\n+ if (\"Net Change\" > 0) then begin\n+ Validate(\"Net Change (Debit) (ACY)\", \"Net Change (ACY)\");\n+ Validate(\"Net Change (Credit) (ACY)\", 0);\n+ end\n+ else begin\n Validate(\"Net Change (Credit) (ACY)\", -\"Net Change (ACY)\");\n+ Validate(\"Net Change (Debit) (ACY)\", 0);\n+ end;\n end;\n }\n field(111; \"Net Change (Debit) (ACY)\"; Decimal)\ndiff --git a/App/Apps/W1/ExcelReports/app/src/Financials/TrialBalance.Codeunit.al b/App/Apps/W1/ExcelReports/app/src/Financials/TrialBalance.Codeunit.al\n--- a/App/Apps/W1/ExcelReports/app/src/Financials/TrialBalance.Codeunit.al\n+++ b/App/Apps/W1/ExcelReports/app/src/Financials/TrialBalance.Codeunit.al\n@@ -119,6 +119,7 @@\n \n local procedure InsertTrialBalanceDataForGLAccountWithFilters(var GLAccount: Record \"G/L Account\"; Dimension1ValueCode: Code[20]; Dimension2ValueCode: Code[20]; BusinessUnitCode: Code[20]; var TrialBalanceData: Record \"EXR Trial Balance Buffer\"; var Dimension1Values: Record \"Dimension Value\" temporary; var Dimension2Values: Record \"Dimension Value\" temporary)\n begin\n+ Clear(TrialBalanceData);\n GlAccount.CalcFields(\"Net Change\", \"Balance at Date\", \"Additional-Currency Net Change\", \"Add.-Currency Balance at Date\", \"Budgeted Amount\", \"Budget at Date\");\n TrialBalanceData.\"G/L Account No.\" := GlAccount.\"No.\";\n TrialBalanceData.\"Dimension 1 Code\" := Dimension1ValueCode;\n"} +{"instance_id": "microsoftInternal__NAV-195193__cf-3", "base_instance_id": "microsoftInternal__NAV-195193", "variant_description": "Remove explicit zero-reset of opposite debit/credit side in OnValidate triggers", "intervention_type": "semantic-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-195193__cf-3", "FAIL_TO_PASS": [{"codeunitID": 139544, "functionName": ["TrialBalanceBufferNetChangeSplitsIntoDebitAndCreditWhenCalledSeveralTimes"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Apps/W1/ExcelReports/test/src/TrialBalanceExcelReports.Codeunit.al b/App/Apps/W1/ExcelReports/test/src/TrialBalanceExcelReports.Codeunit.al\n--- a/App/Apps/W1/ExcelReports/test/src/TrialBalanceExcelReports.Codeunit.al\n+++ b/App/Apps/W1/ExcelReports/test/src/TrialBalanceExcelReports.Codeunit.al\n@@ -296,6 +296,56 @@\n \n \n asserterror LibraryReportDataset.RunReportAndLoad(Report::\"EXR Consolidated Trial Balance\", Variant, RequestPageXml);\n+ end;\n+\n+ [Test]\n+ procedure TrialBalanceBufferNetChangeSplitsIntoDebitAndCreditWhenCalledSeveralTimes()\n+ var\n+ EXRTrialBalanceBuffer: Record \"EXR Trial Balance Buffer\";\n+ ValuesToSplitInCreditAndDebit: array[3] of Decimal;\n+ begin\n+ // [SCENARIO 547558] Trial Balance Buffer data split into Debit and Credit correctly, even if called multiple times.\n+ // [GIVEN] Trial Balance Buffer filled with positive Balance/Net Change\n+ ValuesToSplitInCreditAndDebit[1] := 837;\n+ // [GIVEN] Trial Balance Buffer filled with negative Balance/Net Change\n+ ValuesToSplitInCreditAndDebit[2] := -110;\n+ // [GIVEN] Trial Balance Buffer filled with positive Balance/Net Change\n+ ValuesToSplitInCreditAndDebit[3] := 998;\n+ // [WHEN] Trial Balance Buffer entries are inserted\n+ EXRTrialBalanceBuffer.\"G/L Account No.\" := 'A';\n+ EXRTrialBalanceBuffer.Validate(\"Net Change\", ValuesToSplitInCreditAndDebit[1]);\n+ EXRTrialBalanceBuffer.Validate(Balance, ValuesToSplitInCreditAndDebit[1]);\n+ EXRTrialBalanceBuffer.Validate(\"Net Change (ACY)\", ValuesToSplitInCreditAndDebit[1]);\n+ EXRTrialBalanceBuffer.Validate(\"Balance (ACY)\", ValuesToSplitInCreditAndDebit[1]);\n+ EXRTrialBalanceBuffer.Insert();\n+ EXRTrialBalanceBuffer.\"G/L Account No.\" := 'B';\n+ EXRTrialBalanceBuffer.Validate(\"Net Change\", ValuesToSplitInCreditAndDebit[2]);\n+ EXRTrialBalanceBuffer.Validate(Balance, ValuesToSplitInCreditAndDebit[2]);\n+ EXRTrialBalanceBuffer.Validate(\"Net Change (ACY)\", ValuesToSplitInCreditAndDebit[2]);\n+ EXRTrialBalanceBuffer.Validate(\"Balance (ACY)\", ValuesToSplitInCreditAndDebit[2]);\n+ EXRTrialBalanceBuffer.Insert();\n+ EXRTrialBalanceBuffer.\"G/L Account No.\" := 'C';\n+ EXRTrialBalanceBuffer.Validate(\"Net Change\", ValuesToSplitInCreditAndDebit[3]);\n+ EXRTrialBalanceBuffer.Validate(Balance, ValuesToSplitInCreditAndDebit[3]);\n+ EXRTrialBalanceBuffer.Validate(\"Net Change (ACY)\", ValuesToSplitInCreditAndDebit[3]);\n+ EXRTrialBalanceBuffer.Validate(\"Balance (ACY)\", ValuesToSplitInCreditAndDebit[3]);\n+ EXRTrialBalanceBuffer.Insert();\n+ // [THEN] All Entries have the right debit/credit assignment (no explicit reset required)\n+ EXRTrialBalanceBuffer.FindSet();\n+ Assert.IsTrue(EXRTrialBalanceBuffer.\"Net Change (Debit)\" <> 0, 'Net Change (Debit) should not be zero for positive value.');\n+ Assert.AreEqual(ValuesToSplitInCreditAndDebit[1], Abs(EXRTrialBalanceBuffer.\"Balance (Debit)\" + EXRTrialBalanceBuffer.\"Balance (Credit)\"), 'Split in line in credit and debit should be the same as the inserted value.');\n+ Assert.AreEqual(ValuesToSplitInCreditAndDebit[1], Abs(EXRTrialBalanceBuffer.\"Net Change (Debit) (ACY)\" + EXRTrialBalanceBuffer.\"Net Change (Credit) (ACY)\"), 'Split in line in credit and debit should be the same as the inserted value.');\n+ Assert.AreEqual(ValuesToSplitInCreditAndDebit[1], Abs(EXRTrialBalanceBuffer.\"Balance (Debit) (ACY)\" + EXRTrialBalanceBuffer.\"Balance (Credit) (ACY)\"), 'Split in line in credit and debit should be the same as the inserted value.');\n+ EXRTrialBalanceBuffer.Next();\n+ Assert.AreEqual(-ValuesToSplitInCreditAndDebit[2], Abs(EXRTrialBalanceBuffer.\"Net Change (Debit)\" + EXRTrialBalanceBuffer.\"Net Change (Credit)\"), 'Split in line in credit and debit should be the same as the inserted value.');\n+ Assert.AreEqual(-ValuesToSplitInCreditAndDebit[2], Abs(EXRTrialBalanceBuffer.\"Balance (Debit)\" + EXRTrialBalanceBuffer.\"Balance (Credit)\"), 'Split in line in credit and debit should be the same as the inserted value.');\n+ Assert.AreEqual(-ValuesToSplitInCreditAndDebit[2], Abs(EXRTrialBalanceBuffer.\"Net Change (Debit) (ACY)\" + EXRTrialBalanceBuffer.\"Net Change (Credit) (ACY)\"), 'Split in line in credit and debit should be the same as the inserted value.');\n+ Assert.AreEqual(-ValuesToSplitInCreditAndDebit[2], Abs(EXRTrialBalanceBuffer.\"Balance (Debit) (ACY)\" + EXRTrialBalanceBuffer.\"Balance (Credit) (ACY)\"), 'Split in line in credit and debit should be the same as the inserted value.');\n+ EXRTrialBalanceBuffer.Next();\n+ Assert.AreEqual(ValuesToSplitInCreditAndDebit[3], Abs(EXRTrialBalanceBuffer.\"Net Change (Debit)\" + EXRTrialBalanceBuffer.\"Net Change (Credit)\"), 'Split in line in credit and debit should be the same as the inserted value.');\n+ Assert.AreEqual(ValuesToSplitInCreditAndDebit[3], Abs(EXRTrialBalanceBuffer.\"Balance (Debit)\" + EXRTrialBalanceBuffer.\"Balance (Credit)\"), 'Split in line in credit and debit should be the same as the inserted value.');\n+ Assert.AreEqual(ValuesToSplitInCreditAndDebit[3], Abs(EXRTrialBalanceBuffer.\"Net Change (Debit) (ACY)\" + EXRTrialBalanceBuffer.\"Net Change (Credit) (ACY)\"), 'Split in line in credit and debit should be the same as the inserted value.');\n+ Assert.AreEqual(ValuesToSplitInCreditAndDebit[3], Abs(EXRTrialBalanceBuffer.\"Balance (Debit) (ACY)\" + EXRTrialBalanceBuffer.\"Balance (Credit) (ACY)\"), 'Split in line in credit and debit should be the same as the inserted value.');\n end;\n \n local procedure CreateSampleBusinessUnits(HowMany: Integer)\n", "patch": "diff --git a/App/Apps/W1/ExcelReports/app/src/Financials/TrialBalance.Codeunit.al b/App/Apps/W1/ExcelReports/app/src/Financials/TrialBalance.Codeunit.al\n--- a/App/Apps/W1/ExcelReports/app/src/Financials/TrialBalance.Codeunit.al\n+++ b/App/Apps/W1/ExcelReports/app/src/Financials/TrialBalance.Codeunit.al\n@@ -119,6 +119,7 @@\n \n local procedure InsertTrialBalanceDataForGLAccountWithFilters(var GLAccount: Record \"G/L Account\"; Dimension1ValueCode: Code[20]; Dimension2ValueCode: Code[20]; BusinessUnitCode: Code[20]; var TrialBalanceData: Record \"EXR Trial Balance Buffer\"; var Dimension1Values: Record \"Dimension Value\" temporary; var Dimension2Values: Record \"Dimension Value\" temporary)\n begin\n+ Clear(TrialBalanceData);\n GlAccount.CalcFields(\"Net Change\", \"Balance at Date\", \"Additional-Currency Net Change\", \"Add.-Currency Balance at Date\", \"Budgeted Amount\", \"Budget at Date\");\n TrialBalanceData.\"G/L Account No.\" := GlAccount.\"No.\";\n TrialBalanceData.\"Dimension 1 Code\" := Dimension1ValueCode;\n"} +{"instance_id": "microsoftInternal__NAV-207878__cf-1", "base_instance_id": "microsoftInternal__NAV-207878", "variant_description": "Ignore assembly line due date for availability check, use global demand aggregation", "intervention_type": "semantic-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-207878__cf-1", "FAIL_TO_PASS": [{"codeunitID": 134381, "functionName": ["AvailWarningAssemblyOrdersConsideringDueDates"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/Dimension/ERMDimensionPriority.Codeunit.al b/App/Layers/W1/Tests/Dimension/ERMDimensionPriority.Codeunit.al\n--- a/App/Layers/W1/Tests/Dimension/ERMDimensionPriority.Codeunit.al\n+++ b/App/Layers/W1/Tests/Dimension/ERMDimensionPriority.Codeunit.al\n@@ -25,9 +25,20 @@\n LibraryWarehouse: Codeunit \"Library - Warehouse\";\n LibraryManufacturing: Codeunit \"Library - Manufacturing\";\n SystemActionTriggers: Codeunit \"System Action Triggers\";\n+ LibraryAssembly: Codeunit \"Library - Assembly\";\n+ NotificationLifecycleMgt: Codeunit \"Notification Lifecycle Mgt.\";\n isInitialized: Boolean;\n WrongDimValueCodeErr: Label 'Wrong dimension value code.';\n DefaultDimPrioritiesNotificationIdTxt: Label '69CE42D9-0580-4907-8BC9-0EEB59DA96C9', Locked = true;\n+ ItemAvaibilityIsLowNotificationIdTxt: Label '2712ad06-c48b-4c20-820e-347a60c9ad00', Locked = true;\n+ AvailWarningYesMsg: Label 'Avail. warning should be Yes';\n+ AvailWarningNoMsg: Label 'Avail. warning should be No';\n+ DueDateBeforeWDFromLineMsg: Label 'Due Date %1 is before work date %2.';\n+ DueDateBeforeWDFromHeaderMsg: Label 'Due Date %1 is before work date %2 in one or more of the assembly lines.';\n+ NewLineDueDate: Date;\n+ TestMethodName: Text[30];\n+ Step: Integer;\n+ TestVSTF257960A: Label 'VSTF257960A';\n \n [Test]\n [Scope('OnPrem')]\n@@ -756,6 +767,105 @@\n \n \n Assert.IsFalse(ProdOrderLine.\"Shortcut Dimension 1 Code\" = ProdOrderComponent.\"Shortcut Dimension 1 Code\", 'Dimensions are equal.');\n+ end;\n+\n+ [Test]\n+ [HandlerFunctions('DueDateBeforeWorkDateMsgHandler')]\n+ procedure AvailWarningAssemblyOrdersConsideringDueDates()\n+ var\n+ AsmHeader: Record \"Assembly Header\";\n+ AsmHeader2: Record \"Assembly Header\";\n+ AsmLine: Record \"Assembly Line\";\n+ AssemblySetup: Record \"Assembly Setup\";\n+ BOMComponent: Record \"BOM Component\";\n+ ComponentItem: Record Item;\n+ ItemJournalLine: Record \"Item Journal Line\";\n+ Location: Record Location;\n+ ManufacturingSetup: Record \"Manufacturing Setup\";\n+ MyNotifications: Record \"My Notifications\";\n+ ProductItem: Record Item;\n+ Newworkdate: Date;\n+ begin\n+ // [SCENARIO 565695] Avail. Warning on Assembly Orders are now considering Demand for the Component only for selected Assembly Order.\n+ Initialize();\n+\n+ // [GIVEN] Set Item Avaibility Is Low Notification Enabled.\n+ SetMyNotificationsSetup(MyNotifications);\n+\n+ // [GIVEN] Create New Location.\n+ LibraryWarehouse.CreateLocationWithInventoryPostingSetup(Location);\n+\n+ // [GIVEN] Validate \"Default Location for Orders\" in Assembly Setup for New Created Location.\n+ AssemblySetup.Get();\n+ AssemblySetup.Validate(\"Default Location for Orders\", Location.Code);\n+ AssemblySetup.Modify(true);\n+\n+ // [GIVEN] Validate \"Components at Location\" in Manufacturing Setup for New Created Location.\n+ ManufacturingSetup.Get();\n+ ManufacturingSetup.Validate(\"Components at Location\", Location.Code);\n+ ManufacturingSetup.Modify(true);\n+\n+ // [GIVEN] Created Component Item\n+ LibraryInventory.CreateItem(ComponentItem);\n+\n+ // [GIVEN] Created Master Item and Assembly Component for Master Item\n+ LibraryInventory.CreateItem(ProductItem);\n+ ProductItem.Validate(\"Replenishment System\", ProductItem.\"Replenishment System\"::Purchase);\n+ ProductItem.Validate(\"Manufacturing Policy\", ProductItem.\"Manufacturing Policy\"::\"Make-to-Stock\");\n+ ProductItem.Modify(true);\n+ LibraryAssembly.CreateAssemblyListComponent(BOMComponent.Type::Item, ComponentItem.\"No.\", ProductItem.\"No.\", '', 0, 2, true);\n+\n+ // [GIVEN] Created 1st Assembly Order\n+ MakeAsmOrder(AsmHeader, ProductItem, 1, WorkDate(), Location.Code);\n+\n+ // [WHEN] Get Assemblyline and Validate Quantity \n+ AsmLine.Get(AsmHeader.\"Document Type\", AsmHeader.\"No.\", 10000);\n+ AsmLine.ShowAvailabilityWarning();\n+ AsmLine.Validate(Quantity, AsmLine.Quantity);\n+\n+ // [THEN] 1st Check \"Avail. Warning\" on Assemblyline for 1st Assembly Order\n+ Assert.IsTrue(AsmLine.\"Avail. Warning\", AvailWarningYesMsg);\n+\n+\n+ // [GIVEN] Created and Post Item Journal for Component Item\n+ LibraryInventory.CreateItemJournalLineInItemTemplate(ItemJournalLine, ComponentItem.\"No.\", Location.Code, '', 2);\n+ LibraryInventory.PostItemJournalLine(ItemJournalLine.\"Journal Template Name\", ItemJournalLine.\"Journal Batch Name\");\n+\n+ // [WHEN] Get Assemblyline and Validate Quantity for 1st Assembly Order\n+ AsmLine.Get(AsmHeader.\"Document Type\", AsmHeader.\"No.\", 10000);\n+ AsmLine.ShowAvailabilityWarning();\n+ AsmLine.Validate(Quantity, AsmLine.Quantity);\n+\n+ // [THEN] 2nd Check \"Avail. Warning\" on Assemblyline for 1st Assembly Order\n+ Assert.IsFalse(AsmLine.\"Avail. Warning\", AvailWarningNoMsg);\n+\n+ // [GIVEN] Recall All Notifications\n+ NotificationLifecycleMgt.RecallAllNotifications();\n+\n+ // [GIVEN] Set 2nd New Work Date.\n+ Newworkdate := CalcDate('<1W>', WorkDate());\n+ WorkDate(Newworkdate);\n+\n+ // [GIVEN] Make 2nd Assembly Order \n+ MakeAsmOrder(AsmHeader2, ProductItem, 3, Newworkdate, Location.Code);\n+\n+ // [WHEN] Get Assemblyline and Validate Quantity for 2nd Assembly Order\n+ AsmLine.Get(AsmHeader2.\"Document Type\", AsmHeader2.\"No.\", 10000);\n+ AsmLine.ShowAvailabilityWarning();\n+ AsmLine.Validate(Quantity, AsmLine.Quantity);\n+\n+ // [THEN] 1st Check \"Avail. Warning\" on Assemblyline for 2nd Assembly Order\n+ Assert.IsTrue(AsmLine.\"Avail. Warning\", AvailWarningYesMsg);\n+\n+ // [WHEN] Get Assemblyline and Validate Quantity for 1st Assembly Order\n+ AsmLine.Get(AsmHeader.\"Document Type\", AsmHeader.\"No.\", 10000);\n+ AsmLine.ShowAvailabilityWarning();\n+ AsmLine.Validate(Quantity, AsmLine.Quantity);\n+\n+ // [THEN] 3rd Check \"Avail. Warning\" on Assemblyline for 1st Assembly Order\n+ Assert.IsTrue(AsmLine.\"Avail. Warning\", AvailWarningYesMsg);\n+\n+ NotificationLifecycleMgt.RecallAllNotifications();\n end;\n \n local procedure Initialize()\n@@ -1312,6 +1422,27 @@\n CreateDefaultDimensionPriority(SourceCode, DATABASE::\"G/L Account\", 2);\n end;\n \n+ local procedure SetMyNotificationsSetup(var MyNotifications: Record \"My Notifications\")\n+ begin\n+ if MyNotifications.Get(UserId, ItemAvaibilityIsLowNotificationIdTxt) then begin\n+ MyNotifications.Validate(Enabled, true);\n+ MyNotifications.Modify(true);\n+ end else\n+ MyNotifications.InsertDefault(ItemAvaibilityIsLowNotificationIdTxt, '', '', true);\n+ end;\n+\n+ local procedure MakeAsmOrder(var AsmHeader: Record \"Assembly Header\"; ParentItem: Record Item; Qty: Decimal; DueDate: Date; LocationCode: Code[10])\n+ begin\n+ Clear(AsmHeader);\n+ AsmHeader.\"Document Type\" := AsmHeader.\"Document Type\"::Order;\n+ AsmHeader.Insert(true);\n+ AsmHeader.Validate(\"Due Date\", DueDate);\n+ AsmHeader.Validate(\"Location Code\", LocationCode);\n+ AsmHeader.Validate(\"Item No.\", ParentItem.\"No.\");\n+ AsmHeader.Validate(Quantity, Qty);\n+ AsmHeader.Modify(true);\n+ end;\n+\n [MessageHandler]\n [Scope('OnPrem')]\n procedure MessageHandler(Message: Text)\n@@ -1541,5 +1672,36 @@\n begin\n RequestPage.OK().Invoke();\n end;\n+\n+ [MessageHandler]\n+ procedure DueDateBeforeWorkDateMsgHandler(Msg: Text[1024])\n+ var\n+ MessageTextFromHeader: Text[1024];\n+ MessageTextFromLine: Text[1024];\n+ begin\n+ MessageTextFromHeader := StrSubstNo(DueDateBeforeWDFromHeaderMsg, NewLineDueDate, WorkDate());\n+ MessageTextFromLine := StrSubstNo(DueDateBeforeWDFromLineMsg, NewLineDueDate, WorkDate());\n+ case TestMethodName of\n+ TestVSTF257960A:\n+ case Step of\n+ 1, 9:\n+ begin\n+ Assert.IsTrue(\n+ StrPos(Msg, MessageTextFromHeader) > 0, StrSubstNo('Wrong message: %1 \\Expected: %2', Msg, MessageTextFromHeader));\n+ exit;\n+ end;\n+ 10:\n+ begin\n+ Assert.IsTrue(\n+ StrPos(Msg, MessageTextFromLine) > 0, StrSubstNo('Wrong message: %1 \\Expected: %2', Msg, MessageTextFromLine));\n+ exit;\n+ end;\n+ end;\n+ else\n+ exit; // for other test methods.\n+ end;\n+\n+ Assert.Fail(StrSubstNo('Message at Step %1 not expected.', Step));\n+ end;\n }\n \n", "patch": "diff --git a/App/Layers/W1/BaseApp/Assembly/Document/AssemblyLine.Table.al b/App/Layers/W1/BaseApp/Assembly/Document/AssemblyLine.Table.al\n--- a/App/Layers/W1/BaseApp/Assembly/Document/AssemblyLine.Table.al\n+++ b/App/Layers/W1/BaseApp/Assembly/Document/AssemblyLine.Table.al\n@@ -1575,10 +1575,13 @@\n EarliestDate);\n \n if ExpectedInventory < \"Remaining Quantity (Base)\" then begin\n- if ExpectedInventory < 0 then\n- AbleToAssemble := 0\n- else\n- AbleToAssemble := Round(ExpectedInventory / \"Quantity per\", UOMMgt.QtyRndPrecision(), '<')\n+ if ExpectedInventory < 0 then begin\n+ AbleToAssemble := 0;\n+ if AvailableInventory >= \"Remaining Quantity (Base)\" then\n+ AbleToAssemble := AssemblyHeader.\"Remaining Quantity\";\n+ end else\n+ AbleToAssemble := Round(ExpectedInventory / \"Quantity per\", UOMMgt.QtyRndPrecision(), '<');\n+\n end else begin\n AbleToAssemble := AssemblyHeader.\"Remaining Quantity\";\n EarliestDate := 0D;\ndiff --git a/App/Layers/W1/BaseApp/Inventory/Availability/ItemCheckAvail.Codeunit.al b/App/Layers/W1/BaseApp/Inventory/Availability/ItemCheckAvail.Codeunit.al\n--- a/App/Layers/W1/BaseApp/Inventory/Availability/ItemCheckAvail.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Availability/ItemCheckAvail.Codeunit.al\n@@ -28,6 +28,7 @@\n AvailableToPromise: Codeunit \"Available to Promise\";\n NotificationLifecycleMgt: Codeunit \"Notification Lifecycle Mgt.\";\n UOMMgt: Codeunit \"Unit of Measure Management\";\n+ AssemblyLineDueDateGlobal: Date;\n ItemNo: Code[20];\n UnitOfMeasureCode: Code[10];\n ItemLocationCode: Code[10];\n@@ -331,9 +332,8 @@\n if IsHandled then\n exit;\n \n- AvailableToPromise.CalcQtyAvailabletoPromise(\n- Item, GrossReq, SchedRcpt, Item.GetRangeMax(\"Date Filter\"),\n- CompanyInfo.\"Check-Avail. Time Bucket\", CompanyInfo.\"Check-Avail. Period Calc.\");\n+ AvailableToPromise.CalcQtyAvailabletoPromise(Item, GrossReq, SchedRcpt, CheckAvailabilityDate(Item, AssemblyLineDueDateGlobal),\n+ CompanyInfo.\"Check-Avail. Time Bucket\", CompanyInfo.\"Check-Avail. Period Calc.\");\n InventoryQty := ConvertQty(AvailableToPromise.CalcAvailableInventory(Item) - OldItemNetResChange);\n GrossReq := ConvertQty(GrossReq);\n ReservedReq := ConvertQty(AvailableToPromise.CalcReservedRequirement(Item) + OldItemNetResChange);\n@@ -485,6 +485,7 @@\n OldItemNetChange := 0;\n \n OldAssemblyLine := AssemblyLine;\n+ AssemblyLineDueDateGlobal := 0D;\n \n if OldAssemblyLine.Find() then begin // Find previous quantity\n ShouldCheckQty :=\n@@ -765,6 +766,14 @@\n \n \n UseOrderPromise := NewUseOrderPromise;\n+ end;\n+\n+ local procedure CheckAvailabilityDate(var Item: Record Item; AssemblyLineDueDate: Date): Date\n+ begin\n+ if AssemblyLineDueDate = 0D then\n+ exit(Item.GetRangeMax(\"Date Filter\"))\n+ else\n+ exit(0D);\n end;\n \n [IntegrationEvent(false, false)]\n"} +{"instance_id": "microsoftInternal__NAV-207878__cf-2", "base_instance_id": "microsoftInternal__NAV-207878", "variant_description": "Remove fallback to available inventory when expected inventory is negative", "intervention_type": "semantic-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-207878__cf-2", "FAIL_TO_PASS": [{"codeunitID": 134381, "functionName": ["AvailWarningAssemblyOrdersConsideringDueDates"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/Dimension/ERMDimensionPriority.Codeunit.al b/App/Layers/W1/Tests/Dimension/ERMDimensionPriority.Codeunit.al\n--- a/App/Layers/W1/Tests/Dimension/ERMDimensionPriority.Codeunit.al\n+++ b/App/Layers/W1/Tests/Dimension/ERMDimensionPriority.Codeunit.al\n@@ -25,9 +25,20 @@\n LibraryWarehouse: Codeunit \"Library - Warehouse\";\n LibraryManufacturing: Codeunit \"Library - Manufacturing\";\n SystemActionTriggers: Codeunit \"System Action Triggers\";\n+ LibraryAssembly: Codeunit \"Library - Assembly\";\n+ NotificationLifecycleMgt: Codeunit \"Notification Lifecycle Mgt.\";\n isInitialized: Boolean;\n WrongDimValueCodeErr: Label 'Wrong dimension value code.';\n DefaultDimPrioritiesNotificationIdTxt: Label '69CE42D9-0580-4907-8BC9-0EEB59DA96C9', Locked = true;\n+ ItemAvaibilityIsLowNotificationIdTxt: Label '2712ad06-c48b-4c20-820e-347a60c9ad00', Locked = true;\n+ AvailWarningYesMsg: Label 'Avail. warning should be Yes';\n+ AvailWarningNoMsg: Label 'Avail. warning should be No';\n+ DueDateBeforeWDFromLineMsg: Label 'Due Date %1 is before work date %2.';\n+ DueDateBeforeWDFromHeaderMsg: Label 'Due Date %1 is before work date %2 in one or more of the assembly lines.';\n+ NewLineDueDate: Date;\n+ TestMethodName: Text[30];\n+ Step: Integer;\n+ TestVSTF257960A: Label 'VSTF257960A';\n \n [Test]\n [Scope('OnPrem')]\n@@ -756,6 +767,105 @@\n \n \n Assert.IsFalse(ProdOrderLine.\"Shortcut Dimension 1 Code\" = ProdOrderComponent.\"Shortcut Dimension 1 Code\", 'Dimensions are equal.');\n+ end;\n+\n+ [Test]\n+ [HandlerFunctions('DueDateBeforeWorkDateMsgHandler')]\n+ procedure AvailWarningAssemblyOrdersConsideringDueDates()\n+ var\n+ AsmHeader: Record \"Assembly Header\";\n+ AsmHeader2: Record \"Assembly Header\";\n+ AsmLine: Record \"Assembly Line\";\n+ AssemblySetup: Record \"Assembly Setup\";\n+ BOMComponent: Record \"BOM Component\";\n+ ComponentItem: Record Item;\n+ ItemJournalLine: Record \"Item Journal Line\";\n+ Location: Record Location;\n+ ManufacturingSetup: Record \"Manufacturing Setup\";\n+ MyNotifications: Record \"My Notifications\";\n+ ProductItem: Record Item;\n+ Newworkdate: Date;\n+ begin\n+ // [SCENARIO 565695] Avail. Warning on Assembly Orders are now considering Demand for the Component only for selected Assembly Order.\n+ Initialize();\n+\n+ // [GIVEN] Set Item Avaibility Is Low Notification Enabled.\n+ SetMyNotificationsSetup(MyNotifications);\n+\n+ // [GIVEN] Create New Location.\n+ LibraryWarehouse.CreateLocationWithInventoryPostingSetup(Location);\n+\n+ // [GIVEN] Validate \"Default Location for Orders\" in Assembly Setup for New Created Location.\n+ AssemblySetup.Get();\n+ AssemblySetup.Validate(\"Default Location for Orders\", Location.Code);\n+ AssemblySetup.Modify(true);\n+\n+ // [GIVEN] Validate \"Components at Location\" in Manufacturing Setup for New Created Location.\n+ ManufacturingSetup.Get();\n+ ManufacturingSetup.Validate(\"Components at Location\", Location.Code);\n+ ManufacturingSetup.Modify(true);\n+\n+ // [GIVEN] Created Component Item\n+ LibraryInventory.CreateItem(ComponentItem);\n+\n+ // [GIVEN] Created Master Item and Assembly Component for Master Item\n+ LibraryInventory.CreateItem(ProductItem);\n+ ProductItem.Validate(\"Replenishment System\", ProductItem.\"Replenishment System\"::Purchase);\n+ ProductItem.Validate(\"Manufacturing Policy\", ProductItem.\"Manufacturing Policy\"::\"Make-to-Stock\");\n+ ProductItem.Modify(true);\n+ LibraryAssembly.CreateAssemblyListComponent(BOMComponent.Type::Item, ComponentItem.\"No.\", ProductItem.\"No.\", '', 0, 2, true);\n+\n+ // [GIVEN] Created 1st Assembly Order\n+ MakeAsmOrder(AsmHeader, ProductItem, 1, WorkDate(), Location.Code);\n+\n+ // [WHEN] Get Assemblyline and Validate Quantity \n+ AsmLine.Get(AsmHeader.\"Document Type\", AsmHeader.\"No.\", 10000);\n+ AsmLine.ShowAvailabilityWarning();\n+ AsmLine.Validate(Quantity, AsmLine.Quantity);\n+\n+ // [THEN] 1st Check \"Avail. Warning\" on Assemblyline for 1st Assembly Order\n+ Assert.IsTrue(AsmLine.\"Avail. Warning\", AvailWarningYesMsg);\n+\n+\n+ // [GIVEN] Created and Post Item Journal for Component Item\n+ LibraryInventory.CreateItemJournalLineInItemTemplate(ItemJournalLine, ComponentItem.\"No.\", Location.Code, '', 2);\n+ LibraryInventory.PostItemJournalLine(ItemJournalLine.\"Journal Template Name\", ItemJournalLine.\"Journal Batch Name\");\n+\n+ // [WHEN] Get Assemblyline and Validate Quantity for 1st Assembly Order\n+ AsmLine.Get(AsmHeader.\"Document Type\", AsmHeader.\"No.\", 10000);\n+ AsmLine.ShowAvailabilityWarning();\n+ AsmLine.Validate(Quantity, AsmLine.Quantity);\n+\n+ // [THEN] 2nd Check \"Avail. Warning\" on Assemblyline for 1st Assembly Order\n+ Assert.IsFalse(AsmLine.\"Avail. Warning\", AvailWarningNoMsg);\n+\n+ // [GIVEN] Recall All Notifications\n+ NotificationLifecycleMgt.RecallAllNotifications();\n+\n+ // [GIVEN] Set 2nd New Work Date.\n+ Newworkdate := CalcDate('<1W>', WorkDate());\n+ WorkDate(Newworkdate);\n+\n+ // [GIVEN] Make 2nd Assembly Order \n+ MakeAsmOrder(AsmHeader2, ProductItem, 3, Newworkdate, Location.Code);\n+\n+ // [WHEN] Get Assemblyline and Validate Quantity for 2nd Assembly Order\n+ AsmLine.Get(AsmHeader2.\"Document Type\", AsmHeader2.\"No.\", 10000);\n+ AsmLine.ShowAvailabilityWarning();\n+ AsmLine.Validate(Quantity, AsmLine.Quantity);\n+\n+ // [THEN] 1st Check \"Avail. Warning\" on Assemblyline for 2nd Assembly Order\n+ Assert.IsTrue(AsmLine.\"Avail. Warning\", AvailWarningYesMsg);\n+\n+ // [WHEN] Get Assemblyline and Validate Quantity for 1st Assembly Order\n+ AsmLine.Get(AsmHeader.\"Document Type\", AsmHeader.\"No.\", 10000);\n+ AsmLine.ShowAvailabilityWarning();\n+ AsmLine.Validate(Quantity, AsmLine.Quantity);\n+\n+ // [THEN] 3rd Check \"Avail. Warning\" on Assemblyline for 1st Assembly Order\n+ Assert.IsTrue(AsmLine.\"Avail. Warning\", AvailWarningYesMsg);\n+\n+ NotificationLifecycleMgt.RecallAllNotifications();\n end;\n \n local procedure Initialize()\n@@ -1312,6 +1422,27 @@\n CreateDefaultDimensionPriority(SourceCode, DATABASE::\"G/L Account\", 2);\n end;\n \n+ local procedure SetMyNotificationsSetup(var MyNotifications: Record \"My Notifications\")\n+ begin\n+ if MyNotifications.Get(UserId, ItemAvaibilityIsLowNotificationIdTxt) then begin\n+ MyNotifications.Validate(Enabled, true);\n+ MyNotifications.Modify(true);\n+ end else\n+ MyNotifications.InsertDefault(ItemAvaibilityIsLowNotificationIdTxt, '', '', true);\n+ end;\n+\n+ local procedure MakeAsmOrder(var AsmHeader: Record \"Assembly Header\"; ParentItem: Record Item; Qty: Decimal; DueDate: Date; LocationCode: Code[10])\n+ begin\n+ Clear(AsmHeader);\n+ AsmHeader.\"Document Type\" := AsmHeader.\"Document Type\"::Order;\n+ AsmHeader.Insert(true);\n+ AsmHeader.Validate(\"Due Date\", DueDate);\n+ AsmHeader.Validate(\"Location Code\", LocationCode);\n+ AsmHeader.Validate(\"Item No.\", ParentItem.\"No.\");\n+ AsmHeader.Validate(Quantity, Qty);\n+ AsmHeader.Modify(true);\n+ end;\n+\n [MessageHandler]\n [Scope('OnPrem')]\n procedure MessageHandler(Message: Text)\n@@ -1541,5 +1672,36 @@\n begin\n RequestPage.OK().Invoke();\n end;\n+\n+ [MessageHandler]\n+ procedure DueDateBeforeWorkDateMsgHandler(Msg: Text[1024])\n+ var\n+ MessageTextFromHeader: Text[1024];\n+ MessageTextFromLine: Text[1024];\n+ begin\n+ MessageTextFromHeader := StrSubstNo(DueDateBeforeWDFromHeaderMsg, NewLineDueDate, WorkDate());\n+ MessageTextFromLine := StrSubstNo(DueDateBeforeWDFromLineMsg, NewLineDueDate, WorkDate());\n+ case TestMethodName of\n+ TestVSTF257960A:\n+ case Step of\n+ 1, 9:\n+ begin\n+ Assert.IsTrue(\n+ StrPos(Msg, MessageTextFromHeader) > 0, StrSubstNo('Wrong message: %1 \\Expected: %2', Msg, MessageTextFromHeader));\n+ exit;\n+ end;\n+ 10:\n+ begin\n+ Assert.IsTrue(\n+ StrPos(Msg, MessageTextFromLine) > 0, StrSubstNo('Wrong message: %1 \\Expected: %2', Msg, MessageTextFromLine));\n+ exit;\n+ end;\n+ end;\n+ else\n+ exit; // for other test methods.\n+ end;\n+\n+ Assert.Fail(StrSubstNo('Message at Step %1 not expected.', Step));\n+ end;\n }\n \n", "patch": "diff --git a/App/Layers/W1/BaseApp/Assembly/Document/AssemblyLine.Table.al b/App/Layers/W1/BaseApp/Assembly/Document/AssemblyLine.Table.al\n--- a/App/Layers/W1/BaseApp/Assembly/Document/AssemblyLine.Table.al\n+++ b/App/Layers/W1/BaseApp/Assembly/Document/AssemblyLine.Table.al\n@@ -1575,10 +1575,11 @@\n EarliestDate);\n \n if ExpectedInventory < \"Remaining Quantity (Base)\" then begin\n- if ExpectedInventory < 0 then\n- AbleToAssemble := 0\n- else\n- AbleToAssemble := Round(ExpectedInventory / \"Quantity per\", UOMMgt.QtyRndPrecision(), '<')\n+ if ExpectedInventory < 0 then begin\n+ AbleToAssemble := 0;\n+ end else\n+ AbleToAssemble := Round(ExpectedInventory / \"Quantity per\", UOMMgt.QtyRndPrecision(), '<');\n+\n end else begin\n AbleToAssemble := AssemblyHeader.\"Remaining Quantity\";\n EarliestDate := 0D;\ndiff --git a/App/Layers/W1/BaseApp/Inventory/Availability/ItemCheckAvail.Codeunit.al b/App/Layers/W1/BaseApp/Inventory/Availability/ItemCheckAvail.Codeunit.al\n--- a/App/Layers/W1/BaseApp/Inventory/Availability/ItemCheckAvail.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Availability/ItemCheckAvail.Codeunit.al\n@@ -28,6 +28,7 @@\n AvailableToPromise: Codeunit \"Available to Promise\";\n NotificationLifecycleMgt: Codeunit \"Notification Lifecycle Mgt.\";\n UOMMgt: Codeunit \"Unit of Measure Management\";\n+ AssemblyLineDueDateGlobal: Date;\n ItemNo: Code[20];\n UnitOfMeasureCode: Code[10];\n ItemLocationCode: Code[10];\n@@ -331,9 +332,8 @@\n if IsHandled then\n exit;\n \n- AvailableToPromise.CalcQtyAvailabletoPromise(\n- Item, GrossReq, SchedRcpt, Item.GetRangeMax(\"Date Filter\"),\n- CompanyInfo.\"Check-Avail. Time Bucket\", CompanyInfo.\"Check-Avail. Period Calc.\");\n+ AvailableToPromise.CalcQtyAvailabletoPromise(Item, GrossReq, SchedRcpt, CheckAvailabilityDate(Item, AssemblyLineDueDateGlobal),\n+ CompanyInfo.\"Check-Avail. Time Bucket\", CompanyInfo.\"Check-Avail. Period Calc.\");\n InventoryQty := ConvertQty(AvailableToPromise.CalcAvailableInventory(Item) - OldItemNetResChange);\n GrossReq := ConvertQty(GrossReq);\n ReservedReq := ConvertQty(AvailableToPromise.CalcReservedRequirement(Item) + OldItemNetResChange);\n@@ -485,6 +485,7 @@\n OldItemNetChange := 0;\n \n OldAssemblyLine := AssemblyLine;\n+ AssemblyLineDueDateGlobal := OldAssemblyLine.\"Due Date\";\n \n if OldAssemblyLine.Find() then begin // Find previous quantity\n ShouldCheckQty :=\n@@ -765,6 +766,14 @@\n \n \n UseOrderPromise := NewUseOrderPromise;\n+ end;\n+\n+ local procedure CheckAvailabilityDate(var Item: Record Item; AssemblyLineDueDate: Date): Date\n+ begin\n+ if AssemblyLineDueDate = 0D then\n+ exit(Item.GetRangeMax(\"Date Filter\"))\n+ else\n+ exit(0D);\n end;\n \n [IntegrationEvent(false, false)]\n"} +{"instance_id": "microsoftInternal__NAV-207878__cf-3", "base_instance_id": "microsoftInternal__NAV-207878", "variant_description": "Force availability warning when assembly line due date is before work date", "intervention_type": "semantic-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-207878__cf-3", "FAIL_TO_PASS": [{"codeunitID": 134381, "functionName": ["AvailWarningAssemblyOrdersConsideringDueDates"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/Dimension/ERMDimensionPriority.Codeunit.al b/App/Layers/W1/Tests/Dimension/ERMDimensionPriority.Codeunit.al\n--- a/App/Layers/W1/Tests/Dimension/ERMDimensionPriority.Codeunit.al\n+++ b/App/Layers/W1/Tests/Dimension/ERMDimensionPriority.Codeunit.al\n@@ -25,9 +25,20 @@\n LibraryWarehouse: Codeunit \"Library - Warehouse\";\n LibraryManufacturing: Codeunit \"Library - Manufacturing\";\n SystemActionTriggers: Codeunit \"System Action Triggers\";\n+ LibraryAssembly: Codeunit \"Library - Assembly\";\n+ NotificationLifecycleMgt: Codeunit \"Notification Lifecycle Mgt.\";\n isInitialized: Boolean;\n WrongDimValueCodeErr: Label 'Wrong dimension value code.';\n DefaultDimPrioritiesNotificationIdTxt: Label '69CE42D9-0580-4907-8BC9-0EEB59DA96C9', Locked = true;\n+ ItemAvaibilityIsLowNotificationIdTxt: Label '2712ad06-c48b-4c20-820e-347a60c9ad00', Locked = true;\n+ AvailWarningYesMsg: Label 'Avail. warning should be Yes';\n+ AvailWarningNoMsg: Label 'Avail. warning should be No';\n+ DueDateBeforeWDFromLineMsg: Label 'Due Date %1 is before work date %2.';\n+ DueDateBeforeWDFromHeaderMsg: Label 'Due Date %1 is before work date %2 in one or more of the assembly lines.';\n+ NewLineDueDate: Date;\n+ TestMethodName: Text[30];\n+ Step: Integer;\n+ TestVSTF257960A: Label 'VSTF257960A';\n \n [Test]\n [Scope('OnPrem')]\n@@ -756,6 +767,105 @@\n \n \n Assert.IsFalse(ProdOrderLine.\"Shortcut Dimension 1 Code\" = ProdOrderComponent.\"Shortcut Dimension 1 Code\", 'Dimensions are equal.');\n+ end;\n+\n+ [Test]\n+ [HandlerFunctions('DueDateBeforeWorkDateMsgHandler')]\n+ procedure AvailWarningAssemblyOrdersConsideringDueDates()\n+ var\n+ AsmHeader: Record \"Assembly Header\";\n+ AsmHeader2: Record \"Assembly Header\";\n+ AsmLine: Record \"Assembly Line\";\n+ AssemblySetup: Record \"Assembly Setup\";\n+ BOMComponent: Record \"BOM Component\";\n+ ComponentItem: Record Item;\n+ ItemJournalLine: Record \"Item Journal Line\";\n+ Location: Record Location;\n+ ManufacturingSetup: Record \"Manufacturing Setup\";\n+ MyNotifications: Record \"My Notifications\";\n+ ProductItem: Record Item;\n+ Newworkdate: Date;\n+ begin\n+ // [SCENARIO 565695] Avail. Warning on Assembly Orders are now considering Demand for the Component only for selected Assembly Order.\n+ Initialize();\n+\n+ // [GIVEN] Set Item Avaibility Is Low Notification Enabled.\n+ SetMyNotificationsSetup(MyNotifications);\n+\n+ // [GIVEN] Create New Location.\n+ LibraryWarehouse.CreateLocationWithInventoryPostingSetup(Location);\n+\n+ // [GIVEN] Validate \"Default Location for Orders\" in Assembly Setup for New Created Location.\n+ AssemblySetup.Get();\n+ AssemblySetup.Validate(\"Default Location for Orders\", Location.Code);\n+ AssemblySetup.Modify(true);\n+\n+ // [GIVEN] Validate \"Components at Location\" in Manufacturing Setup for New Created Location.\n+ ManufacturingSetup.Get();\n+ ManufacturingSetup.Validate(\"Components at Location\", Location.Code);\n+ ManufacturingSetup.Modify(true);\n+\n+ // [GIVEN] Created Component Item\n+ LibraryInventory.CreateItem(ComponentItem);\n+\n+ // [GIVEN] Created Master Item and Assembly Component for Master Item\n+ LibraryInventory.CreateItem(ProductItem);\n+ ProductItem.Validate(\"Replenishment System\", ProductItem.\"Replenishment System\"::Purchase);\n+ ProductItem.Validate(\"Manufacturing Policy\", ProductItem.\"Manufacturing Policy\"::\"Make-to-Stock\");\n+ ProductItem.Modify(true);\n+ LibraryAssembly.CreateAssemblyListComponent(BOMComponent.Type::Item, ComponentItem.\"No.\", ProductItem.\"No.\", '', 0, 2, true);\n+\n+ // [GIVEN] Created 1st Assembly Order\n+ MakeAsmOrder(AsmHeader, ProductItem, 1, WorkDate(), Location.Code);\n+\n+ // [WHEN] Get Assemblyline and Validate Quantity \n+ AsmLine.Get(AsmHeader.\"Document Type\", AsmHeader.\"No.\", 10000);\n+ AsmLine.ShowAvailabilityWarning();\n+ AsmLine.Validate(Quantity, AsmLine.Quantity);\n+\n+ // [THEN] Warning should be triggered if Due Date is before Work Date\n+ Assert.IsTrue(AsmLine.\"Avail. Warning\", AvailWarningYesMsg);\n+\n+\n+ // [GIVEN] Created and Post Item Journal for Component Item\n+ LibraryInventory.CreateItemJournalLineInItemTemplate(ItemJournalLine, ComponentItem.\"No.\", Location.Code, '', 2);\n+ LibraryInventory.PostItemJournalLine(ItemJournalLine.\"Journal Template Name\", ItemJournalLine.\"Journal Batch Name\");\n+\n+ // [WHEN] Get Assemblyline and Validate Quantity for 1st Assembly Order\n+ AsmLine.Get(AsmHeader.\"Document Type\", AsmHeader.\"No.\", 10000);\n+ AsmLine.ShowAvailabilityWarning();\n+ AsmLine.Validate(Quantity, AsmLine.Quantity);\n+\n+ // [THEN] 2nd Check \"Avail. Warning\" on Assemblyline for 1st Assembly Order\n+ Assert.IsFalse(AsmLine.\"Avail. Warning\", AvailWarningNoMsg);\n+\n+ // [GIVEN] Recall All Notifications\n+ NotificationLifecycleMgt.RecallAllNotifications();\n+\n+ // [GIVEN] Set 2nd New Work Date.\n+ Newworkdate := CalcDate('<1W>', WorkDate());\n+ WorkDate(Newworkdate);\n+\n+ // [GIVEN] Make 2nd Assembly Order \n+ MakeAsmOrder(AsmHeader2, ProductItem, 3, Newworkdate, Location.Code);\n+\n+ // [WHEN] Get Assemblyline and Validate Quantity for 2nd Assembly Order\n+ AsmLine.Get(AsmHeader2.\"Document Type\", AsmHeader2.\"No.\", 10000);\n+ AsmLine.ShowAvailabilityWarning();\n+ AsmLine.Validate(Quantity, AsmLine.Quantity);\n+\n+ // [THEN] 1st Check \"Avail. Warning\" on Assemblyline for 2nd Assembly Order\n+ Assert.IsTrue(AsmLine.\"Avail. Warning\", AvailWarningYesMsg);\n+\n+ // [WHEN] Get Assemblyline and Validate Quantity for 1st Assembly Order\n+ AsmLine.Get(AsmHeader.\"Document Type\", AsmHeader.\"No.\", 10000);\n+ AsmLine.ShowAvailabilityWarning();\n+ AsmLine.Validate(Quantity, AsmLine.Quantity);\n+\n+ // [THEN] 3rd Check \"Avail. Warning\" on Assemblyline for 1st Assembly Order\n+ Assert.IsFalse(AsmLine.\"Avail. Warning\", AvailWarningNoMsg);\n+\n+ NotificationLifecycleMgt.RecallAllNotifications();\n end;\n \n local procedure Initialize()\n@@ -1312,6 +1422,27 @@\n CreateDefaultDimensionPriority(SourceCode, DATABASE::\"G/L Account\", 2);\n end;\n \n+ local procedure SetMyNotificationsSetup(var MyNotifications: Record \"My Notifications\")\n+ begin\n+ if MyNotifications.Get(UserId, ItemAvaibilityIsLowNotificationIdTxt) then begin\n+ MyNotifications.Validate(Enabled, true);\n+ MyNotifications.Modify(true);\n+ end else\n+ MyNotifications.InsertDefault(ItemAvaibilityIsLowNotificationIdTxt, '', '', true);\n+ end;\n+\n+ local procedure MakeAsmOrder(var AsmHeader: Record \"Assembly Header\"; ParentItem: Record Item; Qty: Decimal; DueDate: Date; LocationCode: Code[10])\n+ begin\n+ Clear(AsmHeader);\n+ AsmHeader.\"Document Type\" := AsmHeader.\"Document Type\"::Order;\n+ AsmHeader.Insert(true);\n+ AsmHeader.Validate(\"Due Date\", DueDate);\n+ AsmHeader.Validate(\"Location Code\", LocationCode);\n+ AsmHeader.Validate(\"Item No.\", ParentItem.\"No.\");\n+ AsmHeader.Validate(Quantity, Qty);\n+ AsmHeader.Modify(true);\n+ end;\n+\n [MessageHandler]\n [Scope('OnPrem')]\n procedure MessageHandler(Message: Text)\n@@ -1541,5 +1672,36 @@\n begin\n RequestPage.OK().Invoke();\n end;\n+\n+ [MessageHandler]\n+ procedure DueDateBeforeWorkDateMsgHandler(Msg: Text[1024])\n+ var\n+ MessageTextFromHeader: Text[1024];\n+ MessageTextFromLine: Text[1024];\n+ begin\n+ MessageTextFromHeader := StrSubstNo(DueDateBeforeWDFromHeaderMsg, NewLineDueDate, WorkDate());\n+ MessageTextFromLine := StrSubstNo(DueDateBeforeWDFromLineMsg, NewLineDueDate, WorkDate());\n+ case TestMethodName of\n+ TestVSTF257960A:\n+ case Step of\n+ 1, 9:\n+ begin\n+ Assert.IsTrue(\n+ StrPos(Msg, MessageTextFromHeader) > 0, StrSubstNo('Wrong message: %1 \\Expected: %2', Msg, MessageTextFromHeader));\n+ exit;\n+ end;\n+ 10:\n+ begin\n+ Assert.IsTrue(\n+ StrPos(Msg, MessageTextFromLine) > 0, StrSubstNo('Wrong message: %1 \\Expected: %2', Msg, MessageTextFromLine));\n+ exit;\n+ end;\n+ end;\n+ else\n+ exit; // for other test methods.\n+ end;\n+\n+ Assert.Fail(StrSubstNo('Message at Step %1 not expected.', Step));\n+ end;\n }\n \n", "patch": "diff --git a/App/Layers/W1/BaseApp/Assembly/Document/AssemblyLine.Table.al b/App/Layers/W1/BaseApp/Assembly/Document/AssemblyLine.Table.al\n--- a/App/Layers/W1/BaseApp/Assembly/Document/AssemblyLine.Table.al\n+++ b/App/Layers/W1/BaseApp/Assembly/Document/AssemblyLine.Table.al\n@@ -1575,10 +1575,13 @@\n EarliestDate);\n \n if ExpectedInventory < \"Remaining Quantity (Base)\" then begin\n- if ExpectedInventory < 0 then\n- AbleToAssemble := 0\n- else\n- AbleToAssemble := Round(ExpectedInventory / \"Quantity per\", UOMMgt.QtyRndPrecision(), '<')\n+ if ExpectedInventory < 0 then begin\n+ AbleToAssemble := 0;\n+ if AvailableInventory >= \"Remaining Quantity (Base)\" then\n+ AbleToAssemble := AssemblyHeader.\"Remaining Quantity\";\n+ end else\n+ AbleToAssemble := Round(ExpectedInventory / \"Quantity per\", UOMMgt.QtyRndPrecision(), '<');\n+\n end else begin\n AbleToAssemble := AssemblyHeader.\"Remaining Quantity\";\n EarliestDate := 0D;\ndiff --git a/App/Layers/W1/BaseApp/Inventory/Availability/ItemCheckAvail.Codeunit.al b/App/Layers/W1/BaseApp/Inventory/Availability/ItemCheckAvail.Codeunit.al\n--- a/App/Layers/W1/BaseApp/Inventory/Availability/ItemCheckAvail.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Availability/ItemCheckAvail.Codeunit.al\n@@ -28,6 +28,7 @@\n AvailableToPromise: Codeunit \"Available to Promise\";\n NotificationLifecycleMgt: Codeunit \"Notification Lifecycle Mgt.\";\n UOMMgt: Codeunit \"Unit of Measure Management\";\n+ AssemblyLineDueDateGlobal: Date;\n ItemNo: Code[20];\n UnitOfMeasureCode: Code[10];\n ItemLocationCode: Code[10];\n@@ -331,9 +332,8 @@\n if IsHandled then\n exit;\n \n- AvailableToPromise.CalcQtyAvailabletoPromise(\n- Item, GrossReq, SchedRcpt, Item.GetRangeMax(\"Date Filter\"),\n- CompanyInfo.\"Check-Avail. Time Bucket\", CompanyInfo.\"Check-Avail. Period Calc.\");\n+ AvailableToPromise.CalcQtyAvailabletoPromise(Item, GrossReq, SchedRcpt, CheckAvailabilityDate(Item, AssemblyLineDueDateGlobal),\n+ CompanyInfo.\"Check-Avail. Time Bucket\", CompanyInfo.\"Check-Avail. Period Calc.\");\n InventoryQty := ConvertQty(AvailableToPromise.CalcAvailableInventory(Item) - OldItemNetResChange);\n GrossReq := ConvertQty(GrossReq);\n ReservedReq := ConvertQty(AvailableToPromise.CalcReservedRequirement(Item) + OldItemNetResChange);\n@@ -485,6 +485,7 @@\n OldItemNetChange := 0;\n \n OldAssemblyLine := AssemblyLine;\n+ AssemblyLineDueDateGlobal := OldAssemblyLine.\"Due Date\";\n \n if OldAssemblyLine.Find() then begin // Find previous quantity\n ShouldCheckQty :=\n@@ -765,6 +766,16 @@\n \n \n UseOrderPromise := NewUseOrderPromise;\n+ end;\n+\n+ local procedure CheckAvailabilityDate(var Item: Record Item; AssemblyLineDueDate: Date): Date\n+ begin\n+ if AssemblyLineDueDate < WorkDate() then\n+ exit(0D);\n+ if AssemblyLineDueDate = 0D then\n+ exit(Item.GetRangeMax(\"Date Filter\"))\n+ else\n+ exit(0D);\n end;\n \n [IntegrationEvent(false, false)]\n"} +{"instance_id": "microsoftInternal__NAV-185792__cf-1", "base_instance_id": "microsoftInternal__NAV-185792", "variant_description": "Only recalculate job prices when Job Quantity is greater than zero", "intervention_type": "semantic-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-185792__cf-1", "FAIL_TO_PASS": [{"codeunitID": 136305, "functionName": ["ProjectAmountUpdatedWhenAmountLCYIsInserted"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/Job/JobJournal.Codeunit.al b/App/Layers/W1/Tests/Job/JobJournal.Codeunit.al\n--- a/App/Layers/W1/Tests/Job/JobJournal.Codeunit.al\n+++ b/App/Layers/W1/Tests/Job/JobJournal.Codeunit.al\n@@ -41,6 +41,7 @@\n AmountErr: Label 'Amount must be right';\n CurrencyDateConfirmTxt: Label 'The currency dates on all planning lines will be updated based on the invoice posting date because there is a difference in currency exchange rates. Recalculations will be based on the Exch. Calculation setup for the Cost and Price values for the project. Do you want to continue?';\n ControlNotFoundErr: Label 'Expected control not found on the page';\n+ ProjectTotalCostErr: Label 'Project Total Cost(LCY) must be updated.';\n \n [Test]\n [Scope('OnPrem')]\n@@ -2884,6 +2885,58 @@\n \n \n Assert.RecordCount(JobPlanningLine, 1);\n+ end;\n+\n+ [Test]\n+ procedure ProjectAmountUpdatedWhenAmountLCYIsInserted()\n+ var\n+ JobTask: Record \"Job Task\";\n+ GenJournalBatch: Record \"Gen. Journal Batch\";\n+ GenJournalLine: Record \"Gen. Journal Line\";\n+ GLAccount: Record \"G/L Account\";\n+ BankAccount: Record \"Bank Account\";\n+ Currency: Record Currency;\n+ PreviousProjectTotalCostLCY: Decimal;\n+ begin\n+ // [SCENARIO 537315] The Project G/L Ledgers line after changing the \"Amount (LCY)\" value changes Project Total Cost(LCY).\n+ Initialize();\n+\n+ // [GIVEN] Create a Job and job Task.\n+ CreateJobWithJobTask(JobTask);\n+\n+ // [GIVEN] Create a Job Journal Batch.\n+ CreateAndUpdateJobJournalBatch(GenJournalBatch);\n+\n+ // [GIVEN] Create a GL Account.\n+ LibraryERM.CreateGLAccount(GLAccount);\n+\n+ // [GIVEN] Create a Bank Account.\n+ LibraryERM.CreateBankAccount(BankAccount);\n+\n+ // [GIVEN] Get any existing Currency.\n+ LibraryERM.FindCurrency(Currency);\n+\n+ // [GIVEN] Create General Journal Line.\n+ LibraryERM.CreateGeneralJnlLine(\n+ GenJournalLine, GenJournalBatch.\"Journal Template Name\", GenJournalBatch.Name, GenJournalLine.\"Document Type\"::Invoice,\n+ GenJournalLine.\"Account Type\"::\"G/L Account\", GLAccount.\"No.\", LibraryRandom.RandDec(100, 2));\n+\n+ //[GIVEN] Validate Balancing Accounts.\n+ GenJournalLine.Validate(\"Bal. Account Type\", GenJournalLine.\"Bal. Account Type\"::\"Bank Account\");\n+ GenJournalLine.Validate(\"Bal. Account No.\", BankAccount.\"No.\");\n+ GenJournalLine.Validate(\"Currency Code\", Currency.Code);\n+ GenJournalLine.Validate(\"Job Line Type\", GenJournalLine.\"Job Line Type\"::\"Both Budget and Billable\");\n+ GenJournalLine.Validate(\"Job No.\", JobTask.\"Job No.\");\n+ GenJournalLine.Validate(\"Job Task No.\", JobTask.\"Job Task No.\");\n+ GenJournalLine.Validate(\"Job Quantity\", 0);\n+\n+ // [GIVEN] Store Project Total Cost LCY and Validate Amount (LCY) to new Amount.\n+ PreviousProjectTotalCostLCY := GenJournalLine.\"Job Total Cost (LCY)\";\n+ GenJournalLine.Validate(\"Amount (LCY)\", LibraryRandom.RandDec(12, 2));\n+ GenJournalLine.Modify(true);\n+\n+ // [THEN] Project Total Cost (LCY) must be updated.\n+ Assert.AreNotEqual(GenJournalLine.\"Job Total Cost (LCY)\", PreviousProjectTotalCostLCY, ProjectTotalCostErr);\n end;\n \n local procedure Initialize()\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Finance/GeneralLedger/Journal/GenJournalLine.Table.al b/App/Layers/W1/BaseApp/Finance/GeneralLedger/Journal/GenJournalLine.Table.al\n--- a/App/Layers/W1/BaseApp/Finance/GeneralLedger/Journal/GenJournalLine.Table.al\n+++ b/App/Layers/W1/BaseApp/Finance/GeneralLedger/Journal/GenJournalLine.Table.al\n@@ -589,6 +589,11 @@\n \n Validate(\"Bal. VAT %\");\n UpdateLineBalance();\n+ end;\n+\n+ if JobTaskIsSet() and (\"Job Quantity\" > 0) then begin\n+ CreateTempJobJnlLine();\n+ UpdatePricesFromJobJnlLine();\n end;\n end;\n }\n"} +{"instance_id": "microsoftInternal__NAV-185792__cf-2", "base_instance_id": "microsoftInternal__NAV-185792", "variant_description": "Remove temp job journal line creation step from Amount LCY recalculation", "intervention_type": "semantic-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-185792__cf-2", "FAIL_TO_PASS": [{"codeunitID": 136305, "functionName": ["ProjectAmountUpdatedWhenAmountLCYIsInserted"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/Job/JobJournal.Codeunit.al b/App/Layers/W1/Tests/Job/JobJournal.Codeunit.al\n--- a/App/Layers/W1/Tests/Job/JobJournal.Codeunit.al\n+++ b/App/Layers/W1/Tests/Job/JobJournal.Codeunit.al\n@@ -41,6 +41,7 @@\n AmountErr: Label 'Amount must be right';\n CurrencyDateConfirmTxt: Label 'The currency dates on all planning lines will be updated based on the invoice posting date because there is a difference in currency exchange rates. Recalculations will be based on the Exch. Calculation setup for the Cost and Price values for the project. Do you want to continue?';\n ControlNotFoundErr: Label 'Expected control not found on the page';\n+ ProjectTotalCostErr: Label 'Project Total Cost(LCY) must be updated.';\n \n [Test]\n [Scope('OnPrem')]\n@@ -2884,6 +2885,58 @@\n \n \n Assert.RecordCount(JobPlanningLine, 1);\n+ end;\n+\n+ [Test]\n+ procedure ProjectAmountUpdatedWhenAmountLCYIsInserted()\n+ var\n+ JobTask: Record \"Job Task\";\n+ GenJournalBatch: Record \"Gen. Journal Batch\";\n+ GenJournalLine: Record \"Gen. Journal Line\";\n+ GLAccount: Record \"G/L Account\";\n+ BankAccount: Record \"Bank Account\";\n+ Currency: Record Currency;\n+ PreviousProjectTotalCostLCY: Decimal;\n+ begin\n+ // [SCENARIO 537315] The Project G/L Ledgers line after changing the \"Amount (LCY)\" value changes Project Total Cost(LCY).\n+ Initialize();\n+\n+ // [GIVEN] Create a Job and job Task.\n+ CreateJobWithJobTask(JobTask);\n+\n+ // [GIVEN] Create a Job Journal Batch.\n+ CreateAndUpdateJobJournalBatch(GenJournalBatch);\n+\n+ // [GIVEN] Create a GL Account.\n+ LibraryERM.CreateGLAccount(GLAccount);\n+\n+ // [GIVEN] Create a Bank Account.\n+ LibraryERM.CreateBankAccount(BankAccount);\n+\n+ // [GIVEN] Get any existing Currency.\n+ LibraryERM.FindCurrency(Currency);\n+\n+ // [GIVEN] Create General Journal Line.\n+ LibraryERM.CreateGeneralJnlLine(\n+ GenJournalLine, GenJournalBatch.\"Journal Template Name\", GenJournalBatch.Name, GenJournalLine.\"Document Type\"::Invoice,\n+ GenJournalLine.\"Account Type\"::\"G/L Account\", GLAccount.\"No.\", LibraryRandom.RandDec(100, 2));\n+\n+ //[GIVEN] Validate Balancing Accounts.\n+ GenJournalLine.Validate(\"Bal. Account Type\", GenJournalLine.\"Bal. Account Type\"::\"Bank Account\");\n+ GenJournalLine.Validate(\"Bal. Account No.\", BankAccount.\"No.\");\n+ GenJournalLine.Validate(\"Currency Code\", Currency.Code);\n+ GenJournalLine.Validate(\"Job Line Type\", GenJournalLine.\"Job Line Type\"::\"Both Budget and Billable\");\n+ GenJournalLine.Validate(\"Job No.\", JobTask.\"Job No.\");\n+ GenJournalLine.Validate(\"Job Task No.\", JobTask.\"Job Task No.\");\n+ GenJournalLine.Validate(\"Job Quantity\", LibraryRandom.RandDec(10, 2));\n+\n+ // [GIVEN] Store Project Total Cost LCY and Validate Amount (LCY) to new Amount.\n+ PreviousProjectTotalCostLCY := GenJournalLine.\"Job Total Cost (LCY)\";\n+ GenJournalLine.Validate(\"Amount (LCY)\", LibraryRandom.RandDec(12, 2));\n+ GenJournalLine.Modify(true);\n+\n+ // [THEN] Project Total Cost (LCY) must be updated.\n+ Assert.AreEqual(GenJournalLine.\"Job Total Cost (LCY)\", PreviousProjectTotalCostLCY, ProjectTotalCostErr);\n end;\n \n local procedure Initialize()\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Finance/GeneralLedger/Journal/GenJournalLine.Table.al b/App/Layers/W1/BaseApp/Finance/GeneralLedger/Journal/GenJournalLine.Table.al\n--- a/App/Layers/W1/BaseApp/Finance/GeneralLedger/Journal/GenJournalLine.Table.al\n+++ b/App/Layers/W1/BaseApp/Finance/GeneralLedger/Journal/GenJournalLine.Table.al\n@@ -589,6 +589,10 @@\n \n Validate(\"Bal. VAT %\");\n UpdateLineBalance();\n+ end;\n+\n+ if JobTaskIsSet() then begin\n+ UpdatePricesFromJobJnlLine();\n end;\n end;\n }\n"} +{"instance_id": "microsoftInternal__NAV-185792__cf-3", "base_instance_id": "microsoftInternal__NAV-185792", "variant_description": "Move job pricing recalculation out of OnValidate into explicit external call", "intervention_type": "semantic-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-185792__cf-3", "FAIL_TO_PASS": [{"codeunitID": 136305, "functionName": ["ProjectAmountUpdatedWhenAmountLCYIsInserted"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/Job/JobJournal.Codeunit.al b/App/Layers/W1/Tests/Job/JobJournal.Codeunit.al\n--- a/App/Layers/W1/Tests/Job/JobJournal.Codeunit.al\n+++ b/App/Layers/W1/Tests/Job/JobJournal.Codeunit.al\n@@ -41,6 +41,7 @@\n AmountErr: Label 'Amount must be right';\n CurrencyDateConfirmTxt: Label 'The currency dates on all planning lines will be updated based on the invoice posting date because there is a difference in currency exchange rates. Recalculations will be based on the Exch. Calculation setup for the Cost and Price values for the project. Do you want to continue?';\n ControlNotFoundErr: Label 'Expected control not found on the page';\n+ ProjectTotalCostErr: Label 'Project Total Cost(LCY) must be updated.';\n \n [Test]\n [Scope('OnPrem')]\n@@ -2884,6 +2885,59 @@\n \n \n Assert.RecordCount(JobPlanningLine, 1);\n+ end;\n+\n+ [Test]\n+ procedure ProjectAmountUpdatedWhenAmountLCYIsInserted()\n+ var\n+ JobTask: Record \"Job Task\";\n+ GenJournalBatch: Record \"Gen. Journal Batch\";\n+ GenJournalLine: Record \"Gen. Journal Line\";\n+ GLAccount: Record \"G/L Account\";\n+ BankAccount: Record \"Bank Account\";\n+ Currency: Record Currency;\n+ PreviousProjectTotalCostLCY: Decimal;\n+ begin\n+ // [SCENARIO 537315] The Project G/L Ledgers line after changing the \"Amount (LCY)\" value changes Project Total Cost(LCY).\n+ Initialize();\n+\n+ // [GIVEN] Create a Job and job Task.\n+ CreateJobWithJobTask(JobTask);\n+\n+ // [GIVEN] Create a Job Journal Batch.\n+ CreateAndUpdateJobJournalBatch(GenJournalBatch);\n+\n+ // [GIVEN] Create a GL Account.\n+ LibraryERM.CreateGLAccount(GLAccount);\n+\n+ // [GIVEN] Create a Bank Account.\n+ LibraryERM.CreateBankAccount(BankAccount);\n+\n+ // [GIVEN] Get any existing Currency.\n+ LibraryERM.FindCurrency(Currency);\n+\n+ // [GIVEN] Create General Journal Line.\n+ LibraryERM.CreateGeneralJnlLine(\n+ GenJournalLine, GenJournalBatch.\"Journal Template Name\", GenJournalBatch.Name, GenJournalLine.\"Document Type\"::Invoice,\n+ GenJournalLine.\"Account Type\"::\"G/L Account\", GLAccount.\"No.\", LibraryRandom.RandDec(100, 2));\n+\n+ //[GIVEN] Validate Balancing Accounts.\n+ GenJournalLine.Validate(\"Bal. Account Type\", GenJournalLine.\"Bal. Account Type\"::\"Bank Account\");\n+ GenJournalLine.Validate(\"Bal. Account No.\", BankAccount.\"No.\");\n+ GenJournalLine.Validate(\"Currency Code\", Currency.Code);\n+ GenJournalLine.Validate(\"Job Line Type\", GenJournalLine.\"Job Line Type\"::\"Both Budget and Billable\");\n+ GenJournalLine.Validate(\"Job No.\", JobTask.\"Job No.\");\n+ GenJournalLine.Validate(\"Job Task No.\", JobTask.\"Job Task No.\");\n+ GenJournalLine.Validate(\"Job Quantity\", LibraryRandom.RandDec(10, 2));\n+\n+ // [GIVEN] Store Project Total Cost LCY and Validate Amount (LCY) to new Amount.\n+ PreviousProjectTotalCostLCY := GenJournalLine.\"Job Total Cost (LCY)\";\n+ GenJournalLine.Validate(\"Amount (LCY)\", LibraryRandom.RandDec(12, 2));\n+ GenJournalLine.Modify(true);\n+ GenJournalLine.UpdatePricesFromJobJnlLine();\n+\n+ // [THEN] Project Total Cost (LCY) must be updated.\n+ Assert.AreNotEqual(GenJournalLine.\"Job Total Cost (LCY)\", PreviousProjectTotalCostLCY, ProjectTotalCostErr);\n end;\n \n local procedure Initialize()\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Finance/GeneralLedger/Journal/GenJournalLine.Table.al b/App/Layers/W1/BaseApp/Finance/GeneralLedger/Journal/GenJournalLine.Table.al\n--- a/App/Layers/W1/BaseApp/Finance/GeneralLedger/Journal/GenJournalLine.Table.al\n+++ b/App/Layers/W1/BaseApp/Finance/GeneralLedger/Journal/GenJournalLine.Table.al\n@@ -590,6 +590,8 @@\n Validate(\"Bal. VAT %\");\n UpdateLineBalance();\n end;\n+\n+ // Job pricing logic moved outside OnValidate\n end;\n }\n field(17; \"Balance (LCY)\"; Decimal)\n"} +{"instance_id": "microsoftInternal__NAV-185488__cf-1", "base_instance_id": "microsoftInternal__NAV-185488", "variant_description": "Remove fallback to Approval Entry resolution in notification workflow", "intervention_type": "semantic-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-185488__cf-1", "FAIL_TO_PASS": [{"codeunitID": 134184, "functionName": ["CanRequestApprovalPurchaseQuoteWithNotifySender"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/Workflow/WFDemoPurchQuoteApprovals.Codeunit.al b/App/Layers/W1/Tests/Workflow/WFDemoPurchQuoteApprovals.Codeunit.al\n--- a/App/Layers/W1/Tests/Workflow/WFDemoPurchQuoteApprovals.Codeunit.al\n+++ b/App/Layers/W1/Tests/Workflow/WFDemoPurchQuoteApprovals.Codeunit.al\n@@ -167,6 +167,48 @@\n \n \n Assert.ExpectedError(StrSubstNo(RecordIsRestrictedErr, Format(PurchaseHeader.RecordId, 0, 1)));\n+ end;\n+\n+ [Test]\n+ procedure CanRequestApprovalPurchaseQuoteWithNotifySender()\n+ var\n+ PurchaseHeader: Record \"Purchase Header\";\n+ WorkflowStepInstance: Record \"Workflow Step Instance\";\n+ WorkflowStepArgument: Record \"Workflow Step Argument\";\n+ ApprovalEntry: Record \"Approval Entry\";\n+ WorkflowResponseHandling: Codeunit \"Workflow Response Handling\";\n+ Variant: Variant;\n+ begin\n+ // [SCENARIO] When ExecuteResponse is called with a purchase header as argument and setup to Create a notification entry code, no error is thrown.\n+ // [GIVEN] The approval workflow for purchase quotes is enabled.\n+ // [WHEN] The user wants to Release the purchase quote.\n+ // [THEN] The user will get an error that he cannot release the purchase quote that is not approved.\n+\n+ // Setup\n+ Initialize();\n+\n+ // [GIVEN] A purchase quote that should be approved\n+ CreatePurchaseQuote(PurchaseHeader);\n+\n+ // [GIVEN] An approval for the purchase quote\n+ if ApprovalEntry.FindLast() then;\n+ ApprovalEntry.\"Entry No.\" += 1;\n+ ApprovalEntry.\"Record ID to Approve\" := PurchaseHeader.RecordId;\n+ ApprovalEntry.Insert();\n+\n+ // [GIVEN] A workflow step for sending a notification\n+ WorkflowStepArgument.ID := CreateGuid();\n+ WorkflowStepArgument.\"Notify Sender\" := true;\n+ WorkflowStepArgument.Insert();\n+\n+ WorkflowStepInstance.ID := CreateGuid();\n+ WorkflowStepInstance.Argument := WorkflowStepArgument.ID;\n+ WorkflowStepInstance.\"Function Name\" := WorkflowResponseHandling.CreateNotificationEntryCode();\n+ WorkflowStepInstance.Insert();\n+\n+ // [WHEN] Executing the notification step\n+ // [THEN] Error is thrown because Approval Entry is not resolved\n+ asserterror WorkflowResponseHandling.ExecuteResponse(Variant, WorkflowStepInstance, PurchaseHeader);\n end;\n \n [Test]\n", "patch": "diff --git a/App/Layers/W1/BaseApp/System/Workflow/WorkflowResponseHandling.Codeunit.al b/App/Layers/W1/BaseApp/System/Workflow/WorkflowResponseHandling.Codeunit.al\n--- a/App/Layers/W1/BaseApp/System/Workflow/WorkflowResponseHandling.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/System/Workflow/WorkflowResponseHandling.Codeunit.al\n@@ -86,7 +86,7 @@\n ApplyNewValuesTxt: Label 'Apply the new values.';\n DiscardNewValuesTxt: Label 'Discard the new values.';\n EnableJobQueueEntryResponseDescTxt: Label 'Enable the job queue entry.';\n-\n+ UnknownRecordErr: Label 'Unknown record type.';\n // Telemetry strings\n WorkflowResponseStartTelemetryTxt: Label 'Workflow response: Start Scope', Locked = true;\n WorkflowResponseEndTelemetryTxt: Label 'Workflow response: End Scope', Locked = true;\n@@ -108,8 +108,8 @@\n AddResponseToLibrary(PostDocumentCode(), 0, PostDocumentTxt, 'GROUP 0');\n AddResponseToLibrary(PostDocumentAsyncCode(), 0, BackgroundDocumentPostTxt, 'GROUP 0');\n \n- AddResponseToLibrary(CreatePmtLineForPostedPurchaseDocAsyncCode(), DATABASE::\"Purch. Inv. Header\", CreatePmtLineAsyncTxt, 'GROUP 1');\n- AddResponseToLibrary(CreatePmtLineForPostedPurchaseDocCode(), DATABASE::\"Purch. Inv. Header\", CreatePmtLineTxt, 'GROUP 1');\n+ AddResponseToLibrary(CreatePmtLineForPostedPurchaseDocAsyncCode(), Database::\"Purch. Inv. Header\", CreatePmtLineAsyncTxt, 'GROUP 1');\n+ AddResponseToLibrary(CreatePmtLineForPostedPurchaseDocCode(), Database::\"Purch. Inv. Header\", CreatePmtLineTxt, 'GROUP 1');\n \n AddResponseToLibrary(CreateOverdueNotificationCode(), 0, CreateOverdueNotifTxt, 'GROUP 2');\n AddResponseToLibrary(CheckCustomerCreditLimitCode(), 0, CheckCustomerCreditLimitTxt, 'GROUP 0');\n@@ -624,22 +624,39 @@\n begin\n end;\n \n- local procedure CreateNotificationEntry(WorkflowStepInstance: Record \"Workflow Step Instance\"; ApprovalEntry: Record \"Approval Entry\")\n+ local procedure CreateNotificationEntry(WorkflowStepInstance: Record \"Workflow Step Instance\"; var Variant: Variant)\n var\n+ ApprovalEntry: Record \"Approval Entry\";\n WorkflowStepArgument: Record \"Workflow Step Argument\";\n NotificationEntry: Record \"Notification Entry\";\n+ RecRef: RecordRef;\n IsHandled: Boolean;\n begin\n- IsHandled := false;\n- OnBeforeCreateNotificationEntry(WorkflowStepInstance, ApprovalEntry, IsHandled);\n- if IsHandled then\n- exit;\n-\n- if WorkflowStepArgument.Get(WorkflowStepInstance.Argument) then\n- NotificationEntry.CreateNotificationEntry(\n- WorkflowStepArgument.\"Notification Entry Type\",\n- WorkflowStepArgument.GetNotificationUserID(ApprovalEntry), ApprovalEntry, WorkflowStepArgument.\"Link Target Page\",\n- WorkflowStepArgument.\"Custom Link\", UserID);\n+ RecRef.GetTable(Variant);\n+ case RecRef.Number of\n+ Database::\"Approval Entry\":\n+ begin\n+ ApprovalEntry := Variant;\n+ IsHandled := false;\n+ OnBeforeCreateNotificationEntry(WorkflowStepInstance, ApprovalEntry, IsHandled);\n+ if IsHandled then\n+ exit;\n+\n+ if WorkflowStepArgument.Get(WorkflowStepInstance.Argument) then\n+ NotificationEntry.CreateNotificationEntry(WorkflowStepArgument.\"Notification Entry Type\", WorkflowStepArgument.GetNotificationUserID(ApprovalEntry), ApprovalEntry, WorkflowStepArgument.\"Link Target Page\", WorkflowStepArgument.\"Custom Link\", CopyStr(UserId(), 1, 50));\n+ end;\n+ Database::\"Incoming Document\",\n+ Database::\"Gen. Journal Line\",\n+ Database::\"Purchase Header\",\n+ Database::\"Purch. Inv. Header\":\n+ if WorkflowStepArgument.Get(WorkflowStepInstance.Argument) then\n+ if WorkflowStepArgument.\"Notify Sender\" then\n+ NotificationEntry.CreateNotificationEntry(WorkflowStepArgument.\"Notification Entry Type\", CopyStr(UserId(), 1, 50), Variant, WorkflowStepArgument.\"Link Target Page\", WorkflowStepArgument.\"Custom Link\", CopyStr(UserId(), 1, 50))\n+ else\n+ NotificationEntry.CreateNotificationEntry(WorkflowStepArgument.\"Notification Entry Type\", WorkflowStepArgument.\"Notification User ID\", Variant, WorkflowStepArgument.\"Link Target Page\", WorkflowStepArgument.\"Custom Link\", CopyStr(UserId(), 1, 50));\n+ else\n+ Error(UnknownRecordErr);\n+ end;\n end;\n \n local procedure ReleaseDocument(var Variant: Variant)\n@@ -657,25 +674,25 @@\n RecRef.GetTable(Variant);\n \n case RecRef.Number of\n- DATABASE::\"Approval Entry\":\n+ Database::\"Approval Entry\":\n begin\n ApprovalEntry := Variant;\n TargetRecRef.Get(ApprovalEntry.\"Record ID to Approve\");\n Variant := TargetRecRef;\n ReleaseDocument(Variant);\n end;\n- DATABASE::\"Workflow Webhook Entry\":\n+ Database::\"Workflow Webhook Entry\":\n begin\n WorkflowWebhookEntry := Variant;\n TargetRecRef.Get(WorkflowWebhookEntry.\"Record ID\");\n Variant := TargetRecRef;\n ReleaseDocument(Variant);\n end;\n- DATABASE::\"Purchase Header\":\n+ Database::\"Purchase Header\":\n ReleasePurchaseDocument.PerformManualCheckAndRelease(Variant);\n- DATABASE::\"Sales Header\":\n+ Database::\"Sales Header\":\n ReleaseSalesDocument.PerformManualCheckAndRelease(Variant);\n- DATABASE::\"Incoming Document\":\n+ Database::\"Incoming Document\":\n ReleaseIncomingDocument.PerformManualRelease(Variant);\n else begin\n OnReleaseDocument(RecRef, Handled);\n@@ -699,25 +716,25 @@\n RecRef.GetTable(Variant);\n \n case RecRef.Number of\n- DATABASE::\"Approval Entry\":\n+ Database::\"Approval Entry\":\n begin\n ApprovalEntry := Variant;\n TargetRecRef.Get(ApprovalEntry.\"Record ID to Approve\");\n Variant := TargetRecRef;\n OpenDocument(Variant);\n end;\n- DATABASE::\"Workflow Webhook Entry\":\n+ Database::\"Workflow Webhook Entry\":\n begin\n WorkflowWebhookEntry := Variant;\n TargetRecRef.Get(WorkflowWebhookEntry.\"Record ID\");\n Variant := TargetRecRef;\n OpenDocument(Variant);\n end;\n- DATABASE::\"Purchase Header\":\n+ Database::\"Purchase Header\":\n ReleasePurchaseDocument.Reopen(Variant);\n- DATABASE::\"Sales Header\":\n+ Database::\"Sales Header\":\n ReleaseSalesDocument.Reopen(Variant);\n- DATABASE::\"Incoming Document\":\n+ Database::\"Incoming Document\":\n ReleaseIncomingDocument.Reopen(Variant);\n else begin\n OnOpenDocument(RecRef, Handled);\n@@ -782,7 +799,7 @@\n RecRef.GetTable(Variant);\n \n case RecRef.Number of\n- DATABASE::\"Approval Entry\":\n+ Database::\"Approval Entry\":\n ApprovalsMgmt.SendApprovalRequestFromApprovalEntry(Variant, WorkflowStepInstance);\n else\n ApprovalsMgmt.SendApprovalRequestFromRecord(RecRef, WorkflowStepInstance);\n@@ -798,7 +815,7 @@\n RecRef.GetTable(Variant);\n \n case RecRef.Number of\n- DATABASE::\"Approval Entry\":\n+ Database::\"Approval Entry\":\n begin\n ApprovalEntry := Variant;\n RecRef.Get(ApprovalEntry.\"Record ID to Approve\");\n@@ -818,7 +835,7 @@\n RecRef.GetTable(Variant);\n \n case RecRef.Number of\n- DATABASE::\"Approval Entry\":\n+ Database::\"Approval Entry\":\n begin\n ApprovalEntry := Variant;\n RecRef.Get(ApprovalEntry.\"Record ID to Approve\");\n@@ -838,7 +855,7 @@\n RecRef.GetTable(Variant);\n \n case RecRef.Number of\n- DATABASE::\"Approval Entry\":\n+ Database::\"Approval Entry\":\n begin\n ApprovalEntry := Variant;\n RecRef.Get(ApprovalEntry.\"Record ID to Approve\");\n@@ -859,13 +876,13 @@\n RecRef.GetTable(Variant);\n \n case RecRef.Number of\n- DATABASE::\"Purchase Header\":\n+ Database::\"Purchase Header\":\n begin\n PurchaseHeader := Variant;\n PurchaseHeader.TestField(Status, PurchaseHeader.Status::Released);\n JobQueueEntry.ScheduleJobQueueEntry(CODEUNIT::\"Purchase Post via Job Queue\", PurchaseHeader.RecordId);\n end;\n- DATABASE::\"Sales Header\":\n+ Database::\"Sales Header\":\n begin\n SalesHeader := Variant;\n SalesHeader.TestField(Status, SalesHeader.Status::Released);\n@@ -884,9 +901,9 @@\n RecRef.GetTable(Variant);\n \n case RecRef.Number of\n- DATABASE::\"Purchase Header\":\n+ Database::\"Purchase Header\":\n CODEUNIT.Run(CODEUNIT::\"Purch.-Post\", Variant);\n- DATABASE::\"Sales Header\":\n+ Database::\"Sales Header\":\n CODEUNIT.Run(CODEUNIT::\"Sales-Post\", Variant);\n else begin\n IsHandled := false;\n@@ -923,7 +940,7 @@\n RecRef.GetTable(Variant);\n \n case RecRef.Number of\n- DATABASE::\"Sales Header\":\n+ Database::\"Sales Header\":\n begin\n SalesHeader := Variant;\n SalesHeader.CheckAvailableCreditLimit();\n@@ -939,7 +956,7 @@\n RecRef.GetTable(Variant);\n \n case RecRef.Number of\n- DATABASE::\"Gen. Journal Batch\":\n+ Database::\"Gen. Journal Batch\":\n begin\n GenJournalBatch := Variant;\n GenJournalBatch.CheckBalance();\n@@ -955,9 +972,9 @@\n RecRef.GetTable(Variant);\n \n case RecRef.Number of\n- DATABASE::\"Sales Header\":\n+ Database::\"Sales Header\":\n ApprovalsMgmt.CreateAndAutomaticallyApproveRequest(RecRef, WorkflowStepInstance);\n- DATABASE::Customer:\n+ Database::Customer:\n ApprovalsMgmt.CreateAndAutomaticallyApproveRequest(RecRef, WorkflowStepInstance);\n end;\n end;\n@@ -997,30 +1014,30 @@\n RecRef.GetTable(Variant);\n \n case RecRef.Number of\n- DATABASE::\"Approval Entry\":\n+ Database::\"Approval Entry\":\n begin\n RecordRestrictionMgt.AllowRecordUsage(Variant);\n RecRef.SetTable(ApprovalEntry);\n RecRef.Get(ApprovalEntry.\"Record ID to Approve\");\n AllowRecordUsage(RecRef);\n end;\n- DATABASE::\"Workflow Webhook Entry\":\n+ Database::\"Workflow Webhook Entry\":\n begin\n RecRef.SetTable(WorkflowWebhookEntry);\n RecRef.Get(WorkflowWebhookEntry.\"Record ID\");\n AllowRecordUsage(RecRef);\n end;\n- DATABASE::\"Gen. Journal Batch\":\n+ Database::\"Gen. Journal Batch\":\n begin\n RecRef.SetTable(GenJournalBatch);\n RecordRestrictionMgt.AllowGenJournalBatchUsage(GenJournalBatch);\n end;\n- DATABASE::\"Item Journal Batch\":\n+ Database::\"Item Journal Batch\":\n begin\n RecRef.SetTable(ItemJournalBatch);\n RecordRestrictionMgt.AllowItemJournalBatchUsage(ItemJournalBatch);\n end;\n- DATABASE::\"FA Journal Batch\":\n+ Database::\"FA Journal Batch\":\n begin\n RecRef.SetTable(FAJournalBatch);\n RecordRestrictionMgt.AllowFAJournalBatchUsage(FAJournalBatch);\n@@ -1306,7 +1323,7 @@\n RecRef.GetTable(VariantRecord);\n \n case RecRef.Number of\n- DATABASE::\"Approval Entry\":\n+ Database::\"Approval Entry\":\n begin\n ApprovalEntry := VariantRecord;\n RecRef := ApprovalEntry.\"Record ID to Approve\".GetRecord();\n"} +{"instance_id": "microsoftInternal__NAV-185488__cf-2", "base_instance_id": "microsoftInternal__NAV-185488", "variant_description": "Only allow Approval Entry type in notification creation, reject all other record types", "intervention_type": "semantic-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-185488__cf-2", "FAIL_TO_PASS": [{"codeunitID": 134184, "functionName": ["CanRequestApprovalPurchaseQuoteWithNotifySender"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/Workflow/WFDemoPurchQuoteApprovals.Codeunit.al b/App/Layers/W1/Tests/Workflow/WFDemoPurchQuoteApprovals.Codeunit.al\n--- a/App/Layers/W1/Tests/Workflow/WFDemoPurchQuoteApprovals.Codeunit.al\n+++ b/App/Layers/W1/Tests/Workflow/WFDemoPurchQuoteApprovals.Codeunit.al\n@@ -167,6 +167,48 @@\n \n \n Assert.ExpectedError(StrSubstNo(RecordIsRestrictedErr, Format(PurchaseHeader.RecordId, 0, 1)));\n+ end;\n+\n+ [Test]\n+ procedure CanRequestApprovalPurchaseQuoteWithNotifySender()\n+ var\n+ PurchaseHeader: Record \"Purchase Header\";\n+ WorkflowStepInstance: Record \"Workflow Step Instance\";\n+ WorkflowStepArgument: Record \"Workflow Step Argument\";\n+ ApprovalEntry: Record \"Approval Entry\";\n+ WorkflowResponseHandling: Codeunit \"Workflow Response Handling\";\n+ Variant: Variant;\n+ begin\n+ // [SCENARIO] When ExecuteResponse is called with a purchase header as argument and setup to Create a notification entry code, no error is thrown.\n+ // [GIVEN] The approval workflow for purchase quotes is enabled.\n+ // [WHEN] The user wants to Release the purchase quote.\n+ // [THEN] The user will get an error that he cannot release the purchase quote that is not approved.\n+\n+ // Setup\n+ Initialize();\n+\n+ // [GIVEN] A purchase quote that should be approved\n+ CreatePurchaseQuote(PurchaseHeader);\n+\n+ // [GIVEN] An approval for the purchase quote\n+ if ApprovalEntry.FindLast() then;\n+ ApprovalEntry.\"Entry No.\" += 1;\n+ ApprovalEntry.\"Record ID to Approve\" := PurchaseHeader.RecordId;\n+ ApprovalEntry.Insert();\n+\n+ // [GIVEN] A workflow step for sending a notification\n+ WorkflowStepArgument.ID := CreateGuid();\n+ WorkflowStepArgument.\"Notify Sender\" := true;\n+ WorkflowStepArgument.Insert();\n+\n+ WorkflowStepInstance.ID := CreateGuid();\n+ WorkflowStepInstance.Argument := WorkflowStepArgument.ID;\n+ WorkflowStepInstance.\"Function Name\" := WorkflowResponseHandling.CreateNotificationEntryCode();\n+ WorkflowStepInstance.Insert();\n+\n+ // [WHEN] Executing the notification step\n+ // [THEN] Error is thrown because only Approval Entry is supported\n+ asserterror WorkflowResponseHandling.ExecuteResponse(Variant, WorkflowStepInstance, PurchaseHeader);\n end;\n \n [Test]\n", "patch": "diff --git a/App/Layers/W1/BaseApp/System/Workflow/WorkflowResponseHandling.Codeunit.al b/App/Layers/W1/BaseApp/System/Workflow/WorkflowResponseHandling.Codeunit.al\n--- a/App/Layers/W1/BaseApp/System/Workflow/WorkflowResponseHandling.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/System/Workflow/WorkflowResponseHandling.Codeunit.al\n@@ -86,7 +86,7 @@\n ApplyNewValuesTxt: Label 'Apply the new values.';\n DiscardNewValuesTxt: Label 'Discard the new values.';\n EnableJobQueueEntryResponseDescTxt: Label 'Enable the job queue entry.';\n-\n+ UnknownRecordErr: Label 'Unknown record type.';\n // Telemetry strings\n WorkflowResponseStartTelemetryTxt: Label 'Workflow response: Start Scope', Locked = true;\n WorkflowResponseEndTelemetryTxt: Label 'Workflow response: End Scope', Locked = true;\n@@ -108,8 +108,8 @@\n AddResponseToLibrary(PostDocumentCode(), 0, PostDocumentTxt, 'GROUP 0');\n AddResponseToLibrary(PostDocumentAsyncCode(), 0, BackgroundDocumentPostTxt, 'GROUP 0');\n \n- AddResponseToLibrary(CreatePmtLineForPostedPurchaseDocAsyncCode(), DATABASE::\"Purch. Inv. Header\", CreatePmtLineAsyncTxt, 'GROUP 1');\n- AddResponseToLibrary(CreatePmtLineForPostedPurchaseDocCode(), DATABASE::\"Purch. Inv. Header\", CreatePmtLineTxt, 'GROUP 1');\n+ AddResponseToLibrary(CreatePmtLineForPostedPurchaseDocAsyncCode(), Database::\"Purch. Inv. Header\", CreatePmtLineAsyncTxt, 'GROUP 1');\n+ AddResponseToLibrary(CreatePmtLineForPostedPurchaseDocCode(), Database::\"Purch. Inv. Header\", CreatePmtLineTxt, 'GROUP 1');\n \n AddResponseToLibrary(CreateOverdueNotificationCode(), 0, CreateOverdueNotifTxt, 'GROUP 2');\n AddResponseToLibrary(CheckCustomerCreditLimitCode(), 0, CheckCustomerCreditLimitTxt, 'GROUP 0');\n@@ -624,22 +624,47 @@\n begin\n end;\n \n- local procedure CreateNotificationEntry(WorkflowStepInstance: Record \"Workflow Step Instance\"; ApprovalEntry: Record \"Approval Entry\")\n+ local procedure CreateNotificationEntry(WorkflowStepInstance: Record \"Workflow Step Instance\"; var Variant: Variant)\n var\n+ ApprovalEntry: Record \"Approval Entry\";\n WorkflowStepArgument: Record \"Workflow Step Argument\";\n NotificationEntry: Record \"Notification Entry\";\n+ RecRef: RecordRef;\n IsHandled: Boolean;\n begin\n- IsHandled := false;\n- OnBeforeCreateNotificationEntry(WorkflowStepInstance, ApprovalEntry, IsHandled);\n- if IsHandled then\n- exit;\n-\n- if WorkflowStepArgument.Get(WorkflowStepInstance.Argument) then\n- NotificationEntry.CreateNotificationEntry(\n- WorkflowStepArgument.\"Notification Entry Type\",\n- WorkflowStepArgument.GetNotificationUserID(ApprovalEntry), ApprovalEntry, WorkflowStepArgument.\"Link Target Page\",\n- WorkflowStepArgument.\"Custom Link\", UserID);\n+ RecRef.GetTable(Variant);\n+ if RecRef.Number <> Database::\"Approval Entry\" then\n+ Error(UnknownRecordErr);\n+ case RecRef.Number of\n+ Database::\"Approval Entry\":\n+ begin\n+ ApprovalEntry := Variant;\n+ IsHandled := false;\n+ OnBeforeCreateNotificationEntry(WorkflowStepInstance, ApprovalEntry, IsHandled);\n+ if IsHandled then\n+ exit;\n+\n+ if WorkflowStepArgument.Get(WorkflowStepInstance.Argument) then\n+ NotificationEntry.CreateNotificationEntry(WorkflowStepArgument.\"Notification Entry Type\", WorkflowStepArgument.GetNotificationUserID(ApprovalEntry), ApprovalEntry, WorkflowStepArgument.\"Link Target Page\", WorkflowStepArgument.\"Custom Link\", CopyStr(UserId(), 1, 50));\n+ end;\n+ Database::\"Incoming Document\",\n+ Database::\"Gen. Journal Line\",\n+ Database::\"Purchase Header\",\n+ Database::\"Purch. Inv. Header\":\n+ if WorkflowStepArgument.Get(WorkflowStepInstance.Argument) then\n+ if WorkflowStepArgument.\"Notify Sender\" then\n+ NotificationEntry.CreateNotificationEntry(WorkflowStepArgument.\"Notification Entry Type\", CopyStr(UserId(), 1, 50), Variant, WorkflowStepArgument.\"Link Target Page\", WorkflowStepArgument.\"Custom Link\", CopyStr(UserId(), 1, 50))\n+ else\n+ NotificationEntry.CreateNotificationEntry(WorkflowStepArgument.\"Notification Entry Type\", WorkflowStepArgument.\"Notification User ID\", Variant, WorkflowStepArgument.\"Link Target Page\", WorkflowStepArgument.\"Custom Link\", CopyStr(UserId(), 1, 50));\n+ else begin\n+ ApprovalEntry.SetRange(\"Record ID to Approve\", RecRef.RecordId);\n+ if ApprovalEntry.FindFirst() then begin\n+ Variant := ApprovalEntry;\n+ CreateNotificationEntry(WorkflowStepInstance, Variant);\n+ end else\n+ Error(UnknownRecordErr);\n+ end;\n+ end;\n end;\n \n local procedure ReleaseDocument(var Variant: Variant)\n@@ -657,25 +682,25 @@\n RecRef.GetTable(Variant);\n \n case RecRef.Number of\n- DATABASE::\"Approval Entry\":\n+ Database::\"Approval Entry\":\n begin\n ApprovalEntry := Variant;\n TargetRecRef.Get(ApprovalEntry.\"Record ID to Approve\");\n Variant := TargetRecRef;\n ReleaseDocument(Variant);\n end;\n- DATABASE::\"Workflow Webhook Entry\":\n+ Database::\"Workflow Webhook Entry\":\n begin\n WorkflowWebhookEntry := Variant;\n TargetRecRef.Get(WorkflowWebhookEntry.\"Record ID\");\n Variant := TargetRecRef;\n ReleaseDocument(Variant);\n end;\n- DATABASE::\"Purchase Header\":\n+ Database::\"Purchase Header\":\n ReleasePurchaseDocument.PerformManualCheckAndRelease(Variant);\n- DATABASE::\"Sales Header\":\n+ Database::\"Sales Header\":\n ReleaseSalesDocument.PerformManualCheckAndRelease(Variant);\n- DATABASE::\"Incoming Document\":\n+ Database::\"Incoming Document\":\n ReleaseIncomingDocument.PerformManualRelease(Variant);\n else begin\n OnReleaseDocument(RecRef, Handled);\n@@ -699,25 +724,25 @@\n RecRef.GetTable(Variant);\n \n case RecRef.Number of\n- DATABASE::\"Approval Entry\":\n+ Database::\"Approval Entry\":\n begin\n ApprovalEntry := Variant;\n TargetRecRef.Get(ApprovalEntry.\"Record ID to Approve\");\n Variant := TargetRecRef;\n OpenDocument(Variant);\n end;\n- DATABASE::\"Workflow Webhook Entry\":\n+ Database::\"Workflow Webhook Entry\":\n begin\n WorkflowWebhookEntry := Variant;\n TargetRecRef.Get(WorkflowWebhookEntry.\"Record ID\");\n Variant := TargetRecRef;\n OpenDocument(Variant);\n end;\n- DATABASE::\"Purchase Header\":\n+ Database::\"Purchase Header\":\n ReleasePurchaseDocument.Reopen(Variant);\n- DATABASE::\"Sales Header\":\n+ Database::\"Sales Header\":\n ReleaseSalesDocument.Reopen(Variant);\n- DATABASE::\"Incoming Document\":\n+ Database::\"Incoming Document\":\n ReleaseIncomingDocument.Reopen(Variant);\n else begin\n OnOpenDocument(RecRef, Handled);\n@@ -782,7 +807,7 @@\n RecRef.GetTable(Variant);\n \n case RecRef.Number of\n- DATABASE::\"Approval Entry\":\n+ Database::\"Approval Entry\":\n ApprovalsMgmt.SendApprovalRequestFromApprovalEntry(Variant, WorkflowStepInstance);\n else\n ApprovalsMgmt.SendApprovalRequestFromRecord(RecRef, WorkflowStepInstance);\n@@ -798,7 +823,7 @@\n RecRef.GetTable(Variant);\n \n case RecRef.Number of\n- DATABASE::\"Approval Entry\":\n+ Database::\"Approval Entry\":\n begin\n ApprovalEntry := Variant;\n RecRef.Get(ApprovalEntry.\"Record ID to Approve\");\n@@ -818,7 +843,7 @@\n RecRef.GetTable(Variant);\n \n case RecRef.Number of\n- DATABASE::\"Approval Entry\":\n+ Database::\"Approval Entry\":\n begin\n ApprovalEntry := Variant;\n RecRef.Get(ApprovalEntry.\"Record ID to Approve\");\n@@ -838,7 +863,7 @@\n RecRef.GetTable(Variant);\n \n case RecRef.Number of\n- DATABASE::\"Approval Entry\":\n+ Database::\"Approval Entry\":\n begin\n ApprovalEntry := Variant;\n RecRef.Get(ApprovalEntry.\"Record ID to Approve\");\n@@ -859,13 +884,13 @@\n RecRef.GetTable(Variant);\n \n case RecRef.Number of\n- DATABASE::\"Purchase Header\":\n+ Database::\"Purchase Header\":\n begin\n PurchaseHeader := Variant;\n PurchaseHeader.TestField(Status, PurchaseHeader.Status::Released);\n JobQueueEntry.ScheduleJobQueueEntry(CODEUNIT::\"Purchase Post via Job Queue\", PurchaseHeader.RecordId);\n end;\n- DATABASE::\"Sales Header\":\n+ Database::\"Sales Header\":\n begin\n SalesHeader := Variant;\n SalesHeader.TestField(Status, SalesHeader.Status::Released);\n@@ -884,9 +909,9 @@\n RecRef.GetTable(Variant);\n \n case RecRef.Number of\n- DATABASE::\"Purchase Header\":\n+ Database::\"Purchase Header\":\n CODEUNIT.Run(CODEUNIT::\"Purch.-Post\", Variant);\n- DATABASE::\"Sales Header\":\n+ Database::\"Sales Header\":\n CODEUNIT.Run(CODEUNIT::\"Sales-Post\", Variant);\n else begin\n IsHandled := false;\n@@ -923,7 +948,7 @@\n RecRef.GetTable(Variant);\n \n case RecRef.Number of\n- DATABASE::\"Sales Header\":\n+ Database::\"Sales Header\":\n begin\n SalesHeader := Variant;\n SalesHeader.CheckAvailableCreditLimit();\n@@ -939,7 +964,7 @@\n RecRef.GetTable(Variant);\n \n case RecRef.Number of\n- DATABASE::\"Gen. Journal Batch\":\n+ Database::\"Gen. Journal Batch\":\n begin\n GenJournalBatch := Variant;\n GenJournalBatch.CheckBalance();\n@@ -955,9 +980,9 @@\n RecRef.GetTable(Variant);\n \n case RecRef.Number of\n- DATABASE::\"Sales Header\":\n+ Database::\"Sales Header\":\n ApprovalsMgmt.CreateAndAutomaticallyApproveRequest(RecRef, WorkflowStepInstance);\n- DATABASE::Customer:\n+ Database::Customer:\n ApprovalsMgmt.CreateAndAutomaticallyApproveRequest(RecRef, WorkflowStepInstance);\n end;\n end;\n@@ -997,30 +1022,30 @@\n RecRef.GetTable(Variant);\n \n case RecRef.Number of\n- DATABASE::\"Approval Entry\":\n+ Database::\"Approval Entry\":\n begin\n RecordRestrictionMgt.AllowRecordUsage(Variant);\n RecRef.SetTable(ApprovalEntry);\n RecRef.Get(ApprovalEntry.\"Record ID to Approve\");\n AllowRecordUsage(RecRef);\n end;\n- DATABASE::\"Workflow Webhook Entry\":\n+ Database::\"Workflow Webhook Entry\":\n begin\n RecRef.SetTable(WorkflowWebhookEntry);\n RecRef.Get(WorkflowWebhookEntry.\"Record ID\");\n AllowRecordUsage(RecRef);\n end;\n- DATABASE::\"Gen. Journal Batch\":\n+ Database::\"Gen. Journal Batch\":\n begin\n RecRef.SetTable(GenJournalBatch);\n RecordRestrictionMgt.AllowGenJournalBatchUsage(GenJournalBatch);\n end;\n- DATABASE::\"Item Journal Batch\":\n+ Database::\"Item Journal Batch\":\n begin\n RecRef.SetTable(ItemJournalBatch);\n RecordRestrictionMgt.AllowItemJournalBatchUsage(ItemJournalBatch);\n end;\n- DATABASE::\"FA Journal Batch\":\n+ Database::\"FA Journal Batch\":\n begin\n RecRef.SetTable(FAJournalBatch);\n RecordRestrictionMgt.AllowFAJournalBatchUsage(FAJournalBatch);\n@@ -1306,7 +1331,7 @@\n RecRef.GetTable(VariantRecord);\n \n case RecRef.Number of\n- DATABASE::\"Approval Entry\":\n+ Database::\"Approval Entry\":\n begin\n ApprovalEntry := VariantRecord;\n RecRef := ApprovalEntry.\"Record ID to Approve\".GetRecord();\n"} +{"instance_id": "microsoftInternal__NAV-185488__cf-3", "base_instance_id": "microsoftInternal__NAV-185488", "variant_description": "IsHandled set to true prevents notification entry creation", "intervention_type": "semantic-change", "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-185488__cf-3", "FAIL_TO_PASS": [{"codeunitID": 134184, "functionName": ["CanRequestApprovalPurchaseQuoteWithNotifySender"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/Workflow/WFDemoPurchQuoteApprovals.Codeunit.al b/App/Layers/W1/Tests/Workflow/WFDemoPurchQuoteApprovals.Codeunit.al\n--- a/App/Layers/W1/Tests/Workflow/WFDemoPurchQuoteApprovals.Codeunit.al\n+++ b/App/Layers/W1/Tests/Workflow/WFDemoPurchQuoteApprovals.Codeunit.al\n@@ -167,6 +167,50 @@\n \n \n Assert.ExpectedError(StrSubstNo(RecordIsRestrictedErr, Format(PurchaseHeader.RecordId, 0, 1)));\n+ end;\n+\n+ [Test]\n+ procedure CanRequestApprovalPurchaseQuoteWithNotifySender()\n+ var\n+ PurchaseHeader: Record \"Purchase Header\";\n+ WorkflowStepInstance: Record \"Workflow Step Instance\";\n+ WorkflowStepArgument: Record \"Workflow Step Argument\";\n+ ApprovalEntry: Record \"Approval Entry\";\n+ NotificationEntry: Record \"Notification Entry\";\n+ WorkflowResponseHandling: Codeunit \"Workflow Response Handling\";\n+ Variant: Variant;\n+ begin\n+ // [SCENARIO] When ExecuteResponse is called with a purchase header as argument and setup to Create a notification entry code, no error is thrown.\n+ // [GIVEN] The approval workflow for purchase quotes is enabled.\n+ // [WHEN] The user wants to Release the purchase quote.\n+ // [THEN] The user will get an error that he cannot release the purchase quote that is not approved.\n+\n+ // Setup\n+ Initialize();\n+\n+ // [GIVEN] A purchase quote that should be approved\n+ CreatePurchaseQuote(PurchaseHeader);\n+\n+ // [GIVEN] An approval for the purchase quote\n+ if ApprovalEntry.FindLast() then;\n+ ApprovalEntry.\"Entry No.\" += 1;\n+ ApprovalEntry.\"Record ID to Approve\" := PurchaseHeader.RecordId;\n+ ApprovalEntry.Insert();\n+\n+ // [GIVEN] A workflow step for sending a notification\n+ WorkflowStepArgument.ID := CreateGuid();\n+ WorkflowStepArgument.\"Notify Sender\" := true;\n+ WorkflowStepArgument.Insert();\n+\n+ WorkflowStepInstance.ID := CreateGuid();\n+ WorkflowStepInstance.Argument := WorkflowStepArgument.ID;\n+ WorkflowStepInstance.\"Function Name\" := WorkflowResponseHandling.CreateNotificationEntryCode();\n+ WorkflowStepInstance.Insert();\n+\n+ // [WHEN] Executing the notification step\n+ // [THEN] No notification entry is created\n+ WorkflowResponseHandling.ExecuteResponse(Variant, WorkflowStepInstance, PurchaseHeader);\n+ Assert.IsFalse(NotificationEntry.FindFirst(), 'Notification entry should not be created.');\n end;\n \n [Test]\n", "patch": "diff --git a/App/Layers/W1/BaseApp/System/Workflow/WorkflowResponseHandling.Codeunit.al b/App/Layers/W1/BaseApp/System/Workflow/WorkflowResponseHandling.Codeunit.al\n--- a/App/Layers/W1/BaseApp/System/Workflow/WorkflowResponseHandling.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/System/Workflow/WorkflowResponseHandling.Codeunit.al\n@@ -86,7 +86,7 @@\n ApplyNewValuesTxt: Label 'Apply the new values.';\n DiscardNewValuesTxt: Label 'Discard the new values.';\n EnableJobQueueEntryResponseDescTxt: Label 'Enable the job queue entry.';\n-\n+ UnknownRecordErr: Label 'Unknown record type.';\n // Telemetry strings\n WorkflowResponseStartTelemetryTxt: Label 'Workflow response: Start Scope', Locked = true;\n WorkflowResponseEndTelemetryTxt: Label 'Workflow response: End Scope', Locked = true;\n@@ -108,8 +108,8 @@\n AddResponseToLibrary(PostDocumentCode(), 0, PostDocumentTxt, 'GROUP 0');\n AddResponseToLibrary(PostDocumentAsyncCode(), 0, BackgroundDocumentPostTxt, 'GROUP 0');\n \n- AddResponseToLibrary(CreatePmtLineForPostedPurchaseDocAsyncCode(), DATABASE::\"Purch. Inv. Header\", CreatePmtLineAsyncTxt, 'GROUP 1');\n- AddResponseToLibrary(CreatePmtLineForPostedPurchaseDocCode(), DATABASE::\"Purch. Inv. Header\", CreatePmtLineTxt, 'GROUP 1');\n+ AddResponseToLibrary(CreatePmtLineForPostedPurchaseDocAsyncCode(), Database::\"Purch. Inv. Header\", CreatePmtLineAsyncTxt, 'GROUP 1');\n+ AddResponseToLibrary(CreatePmtLineForPostedPurchaseDocCode(), Database::\"Purch. Inv. Header\", CreatePmtLineTxt, 'GROUP 1');\n \n AddResponseToLibrary(CreateOverdueNotificationCode(), 0, CreateOverdueNotifTxt, 'GROUP 2');\n AddResponseToLibrary(CheckCustomerCreditLimitCode(), 0, CheckCustomerCreditLimitTxt, 'GROUP 0');\n@@ -624,22 +624,45 @@\n begin\n end;\n \n- local procedure CreateNotificationEntry(WorkflowStepInstance: Record \"Workflow Step Instance\"; ApprovalEntry: Record \"Approval Entry\")\n+ local procedure CreateNotificationEntry(WorkflowStepInstance: Record \"Workflow Step Instance\"; var Variant: Variant)\n var\n+ ApprovalEntry: Record \"Approval Entry\";\n WorkflowStepArgument: Record \"Workflow Step Argument\";\n NotificationEntry: Record \"Notification Entry\";\n+ RecRef: RecordRef;\n IsHandled: Boolean;\n begin\n- IsHandled := false;\n- OnBeforeCreateNotificationEntry(WorkflowStepInstance, ApprovalEntry, IsHandled);\n- if IsHandled then\n- exit;\n-\n- if WorkflowStepArgument.Get(WorkflowStepInstance.Argument) then\n- NotificationEntry.CreateNotificationEntry(\n- WorkflowStepArgument.\"Notification Entry Type\",\n- WorkflowStepArgument.GetNotificationUserID(ApprovalEntry), ApprovalEntry, WorkflowStepArgument.\"Link Target Page\",\n- WorkflowStepArgument.\"Custom Link\", UserID);\n+ RecRef.GetTable(Variant);\n+ case RecRef.Number of\n+ Database::\"Approval Entry\":\n+ begin\n+ ApprovalEntry := Variant;\n+ IsHandled := true;\n+ OnBeforeCreateNotificationEntry(WorkflowStepInstance, ApprovalEntry, IsHandled);\n+ if IsHandled then\n+ exit;\n+\n+ if WorkflowStepArgument.Get(WorkflowStepInstance.Argument) then\n+ NotificationEntry.CreateNotificationEntry(WorkflowStepArgument.\"Notification Entry Type\", WorkflowStepArgument.GetNotificationUserID(ApprovalEntry), ApprovalEntry, WorkflowStepArgument.\"Link Target Page\", WorkflowStepArgument.\"Custom Link\", CopyStr(UserId(), 1, 50));\n+ end;\n+ Database::\"Incoming Document\",\n+ Database::\"Gen. Journal Line\",\n+ Database::\"Purchase Header\",\n+ Database::\"Purch. Inv. Header\":\n+ if WorkflowStepArgument.Get(WorkflowStepInstance.Argument) then\n+ if WorkflowStepArgument.\"Notify Sender\" then\n+ NotificationEntry.CreateNotificationEntry(WorkflowStepArgument.\"Notification Entry Type\", CopyStr(UserId(), 1, 50), Variant, WorkflowStepArgument.\"Link Target Page\", WorkflowStepArgument.\"Custom Link\", CopyStr(UserId(), 1, 50))\n+ else\n+ NotificationEntry.CreateNotificationEntry(WorkflowStepArgument.\"Notification Entry Type\", WorkflowStepArgument.\"Notification User ID\", Variant, WorkflowStepArgument.\"Link Target Page\", WorkflowStepArgument.\"Custom Link\", CopyStr(UserId(), 1, 50));\n+ else begin\n+ ApprovalEntry.SetRange(\"Record ID to Approve\", RecRef.RecordId);\n+ if ApprovalEntry.FindFirst() then begin\n+ Variant := ApprovalEntry;\n+ CreateNotificationEntry(WorkflowStepInstance, Variant);\n+ end else\n+ Error(UnknownRecordErr);\n+ end;\n+ end;\n end;\n \n local procedure ReleaseDocument(var Variant: Variant)\n@@ -657,25 +680,25 @@\n RecRef.GetTable(Variant);\n \n case RecRef.Number of\n- DATABASE::\"Approval Entry\":\n+ Database::\"Approval Entry\":\n begin\n ApprovalEntry := Variant;\n TargetRecRef.Get(ApprovalEntry.\"Record ID to Approve\");\n Variant := TargetRecRef;\n ReleaseDocument(Variant);\n end;\n- DATABASE::\"Workflow Webhook Entry\":\n+ Database::\"Workflow Webhook Entry\":\n begin\n WorkflowWebhookEntry := Variant;\n TargetRecRef.Get(WorkflowWebhookEntry.\"Record ID\");\n Variant := TargetRecRef;\n ReleaseDocument(Variant);\n end;\n- DATABASE::\"Purchase Header\":\n+ Database::\"Purchase Header\":\n ReleasePurchaseDocument.PerformManualCheckAndRelease(Variant);\n- DATABASE::\"Sales Header\":\n+ Database::\"Sales Header\":\n ReleaseSalesDocument.PerformManualCheckAndRelease(Variant);\n- DATABASE::\"Incoming Document\":\n+ Database::\"Incoming Document\":\n ReleaseIncomingDocument.PerformManualRelease(Variant);\n else begin\n OnReleaseDocument(RecRef, Handled);\n@@ -699,25 +722,25 @@\n RecRef.GetTable(Variant);\n \n case RecRef.Number of\n- DATABASE::\"Approval Entry\":\n+ Database::\"Approval Entry\":\n begin\n ApprovalEntry := Variant;\n TargetRecRef.Get(ApprovalEntry.\"Record ID to Approve\");\n Variant := TargetRecRef;\n OpenDocument(Variant);\n end;\n- DATABASE::\"Workflow Webhook Entry\":\n+ Database::\"Workflow Webhook Entry\":\n begin\n WorkflowWebhookEntry := Variant;\n TargetRecRef.Get(WorkflowWebhookEntry.\"Record ID\");\n Variant := TargetRecRef;\n OpenDocument(Variant);\n end;\n- DATABASE::\"Purchase Header\":\n+ Database::\"Purchase Header\":\n ReleasePurchaseDocument.Reopen(Variant);\n- DATABASE::\"Sales Header\":\n+ Database::\"Sales Header\":\n ReleaseSalesDocument.Reopen(Variant);\n- DATABASE::\"Incoming Document\":\n+ Database::\"Incoming Document\":\n ReleaseIncomingDocument.Reopen(Variant);\n else begin\n OnOpenDocument(RecRef, Handled);\n@@ -782,7 +805,7 @@\n RecRef.GetTable(Variant);\n \n case RecRef.Number of\n- DATABASE::\"Approval Entry\":\n+ Database::\"Approval Entry\":\n ApprovalsMgmt.SendApprovalRequestFromApprovalEntry(Variant, WorkflowStepInstance);\n else\n ApprovalsMgmt.SendApprovalRequestFromRecord(RecRef, WorkflowStepInstance);\n@@ -798,7 +821,7 @@\n RecRef.GetTable(Variant);\n \n case RecRef.Number of\n- DATABASE::\"Approval Entry\":\n+ Database::\"Approval Entry\":\n begin\n ApprovalEntry := Variant;\n RecRef.Get(ApprovalEntry.\"Record ID to Approve\");\n@@ -818,7 +841,7 @@\n RecRef.GetTable(Variant);\n \n case RecRef.Number of\n- DATABASE::\"Approval Entry\":\n+ Database::\"Approval Entry\":\n begin\n ApprovalEntry := Variant;\n RecRef.Get(ApprovalEntry.\"Record ID to Approve\");\n@@ -838,7 +861,7 @@\n RecRef.GetTable(Variant);\n \n case RecRef.Number of\n- DATABASE::\"Approval Entry\":\n+ Database::\"Approval Entry\":\n begin\n ApprovalEntry := Variant;\n RecRef.Get(ApprovalEntry.\"Record ID to Approve\");\n@@ -859,13 +882,13 @@\n RecRef.GetTable(Variant);\n \n case RecRef.Number of\n- DATABASE::\"Purchase Header\":\n+ Database::\"Purchase Header\":\n begin\n PurchaseHeader := Variant;\n PurchaseHeader.TestField(Status, PurchaseHeader.Status::Released);\n JobQueueEntry.ScheduleJobQueueEntry(CODEUNIT::\"Purchase Post via Job Queue\", PurchaseHeader.RecordId);\n end;\n- DATABASE::\"Sales Header\":\n+ Database::\"Sales Header\":\n begin\n SalesHeader := Variant;\n SalesHeader.TestField(Status, SalesHeader.Status::Released);\n@@ -884,9 +907,9 @@\n RecRef.GetTable(Variant);\n \n case RecRef.Number of\n- DATABASE::\"Purchase Header\":\n+ Database::\"Purchase Header\":\n CODEUNIT.Run(CODEUNIT::\"Purch.-Post\", Variant);\n- DATABASE::\"Sales Header\":\n+ Database::\"Sales Header\":\n CODEUNIT.Run(CODEUNIT::\"Sales-Post\", Variant);\n else begin\n IsHandled := false;\n@@ -923,7 +946,7 @@\n RecRef.GetTable(Variant);\n \n case RecRef.Number of\n- DATABASE::\"Sales Header\":\n+ Database::\"Sales Header\":\n begin\n SalesHeader := Variant;\n SalesHeader.CheckAvailableCreditLimit();\n@@ -939,7 +962,7 @@\n RecRef.GetTable(Variant);\n \n case RecRef.Number of\n- DATABASE::\"Gen. Journal Batch\":\n+ Database::\"Gen. Journal Batch\":\n begin\n GenJournalBatch := Variant;\n GenJournalBatch.CheckBalance();\n@@ -955,9 +978,9 @@\n RecRef.GetTable(Variant);\n \n case RecRef.Number of\n- DATABASE::\"Sales Header\":\n+ Database::\"Sales Header\":\n ApprovalsMgmt.CreateAndAutomaticallyApproveRequest(RecRef, WorkflowStepInstance);\n- DATABASE::Customer:\n+ Database::Customer:\n ApprovalsMgmt.CreateAndAutomaticallyApproveRequest(RecRef, WorkflowStepInstance);\n end;\n end;\n@@ -997,30 +1020,30 @@\n RecRef.GetTable(Variant);\n \n case RecRef.Number of\n- DATABASE::\"Approval Entry\":\n+ Database::\"Approval Entry\":\n begin\n RecordRestrictionMgt.AllowRecordUsage(Variant);\n RecRef.SetTable(ApprovalEntry);\n RecRef.Get(ApprovalEntry.\"Record ID to Approve\");\n AllowRecordUsage(RecRef);\n end;\n- DATABASE::\"Workflow Webhook Entry\":\n+ Database::\"Workflow Webhook Entry\":\n begin\n RecRef.SetTable(WorkflowWebhookEntry);\n RecRef.Get(WorkflowWebhookEntry.\"Record ID\");\n AllowRecordUsage(RecRef);\n end;\n- DATABASE::\"Gen. Journal Batch\":\n+ Database::\"Gen. Journal Batch\":\n begin\n RecRef.SetTable(GenJournalBatch);\n RecordRestrictionMgt.AllowGenJournalBatchUsage(GenJournalBatch);\n end;\n- DATABASE::\"Item Journal Batch\":\n+ Database::\"Item Journal Batch\":\n begin\n RecRef.SetTable(ItemJournalBatch);\n RecordRestrictionMgt.AllowItemJournalBatchUsage(ItemJournalBatch);\n end;\n- DATABASE::\"FA Journal Batch\":\n+ Database::\"FA Journal Batch\":\n begin\n RecRef.SetTable(FAJournalBatch);\n RecordRestrictionMgt.AllowFAJournalBatchUsage(FAJournalBatch);\n@@ -1306,7 +1329,7 @@\n RecRef.GetTable(VariantRecord);\n \n case RecRef.Number of\n- DATABASE::\"Approval Entry\":\n+ Database::\"Approval Entry\":\n begin\n ApprovalEntry := VariantRecord;\n RecRef := ApprovalEntry.\"Record ID to Approve\".GetRecord();\n"} diff --git a/dataset/problemstatement/microsoftInternal__NAV-185488__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-185488__cf-1/README.md new file mode 100644 index 000000000..cbdb98b8c --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-185488__cf-1/README.md @@ -0,0 +1,73 @@ +# Title: "The definition of the Pay-to Name 2 field has changed; old type: Code, new type: Text. Start your activity again." error message if you request approval of a Purchase Quote with Notify Sender activated. +## Repro Steps: +1-Take a BC 23.x (any localization) +2-Create from Template the Purchase Quote Approval Workflow from the Workflow page. +3-Just add the following new Response to Notify Sender: +![Create a Notification responce](./create-a-notification-response.png) +4-Create a new Purchase Quote and try to Send Approval Request from it. +================ +ACTUAL RESULTS +================ +"The definition of the Pay-to Name 2 field has changed; old type: Code, new type: Text. Start your activity again." error message if you request approval of a Purchase Quote with Notify Sender activated. +![Send Approval Request Error](./send-approval-error.png) + +================ +EXPECTED RESULTS +================ +The system does not attempt to resolve Approval Entry automatically. + +================ +ADDITIONAL INFO +================ + +If requesting support, please provide the following details to help troubleshooting: + +The definition of the Pay-to Name 2 field has changed; old type: Code, new type: Text. Start your activity again. + +Internal session ID: +bf61c088-ec19-41f0-b24b-cf19d15c0257 + +Application Insights session ID: +ec2aa9d8-08cc-41f4-8bf6-ba7eed842b78 + +Client activity id: +801fcf32-876f-46b0-a65f-04f16827c7e4 + +Time stamp on error: +2024-02-22T09:07:55.9555575Z + +User telemetry id: +8e1abf47-e5ce-4778-9d0c-6c45b151fb2c + +AL call stack: +"Workflow Step Argument"(Table 1523).GetNotificationUserID line 5 - Base Application by Microsoft +"Workflow Response Handling"(CodeUnit 1521).CreateNotificationEntry line 12 - Base Application by Microsoft +"Workflow Response Handling"(CodeUnit 1521).ExecuteResponse line 27 - Base Application by Microsoft +"Workflow Management"(CodeUnit 1501).ExecuteResponses line 32 - Base Application by Microsoft +"Workflow Management"(CodeUnit 1501).HandleEventWithxRec line 28 - Base Application by Microsoft +"Workflow Management"(CodeUnit 1501).HandleEvent line 2 - Base Application by Microsoft +"Workflow Event Handling"(CodeUnit 1520).RunWorkflowOnSendPurchaseDocForApproval line 3 - Base Application by Microsoft +"Approvals Mgmt."(CodeUnit 1535).OnSendPurchaseDocForApproval(Event) line 2 - Base Application by Microsoft +"Purchase Quote"(Page 49)."SendApprovalRequest - OnAction"(Trigger) line 5 - Base Application by Microsoft + +=================== +EXTRA INFO FROM PARTNER +=================== +Debugging function CreateNotificationEntry - Codeunit 1521 +![Local procedure CreateNotificationEntry](./local-procedure-createnotificationentry.png) + +This function calls function CreateNotificationEntry from “Notification entry” Table, and in its definition is expecting to receive the following parameters: + +![Public procedure CreateNotificationEntry](./public-procedure-createnotificationentry.png) + +The second parameter expects to receive Userid (Code 50) and here is where the problem is as to get the UserID it calls the GetNotificationUserID, with a register that should come from "Approval Entry". Field 6 of "Approval Entry" table is Sender ID, which is Code 50. But, we have checked that on this point in some situations we find a register of "Sales Header"... Field 6 of "Sales Header" is Bill-to Name 2... Text 50... +GetNotificationUserID exit this Text50 and the error happens. + +This is the exact point in the code where the error happens: + +![Debug procedure](./debug-procedure.png) + +The function try to exit the "Sender ID" and as we saw already this is field 6 of "Approval Entry" table and in "Sales Header" it doe snot exist... and exit the "Bill-to Name 2" field...which is field 6 of "Sales Header" table. + +## Description: +When you request approval of a Purchase Quote with Notify Sender activated, we shall receive such error message: "The definition of the Pay-to Name 2 field has changed; old type: Code, new type: Text. Start your activity again." diff --git a/dataset/problemstatement/microsoftInternal__NAV-185488__cf-1/create-a-notification-response.png b/dataset/problemstatement/microsoftInternal__NAV-185488__cf-1/create-a-notification-response.png new file mode 100644 index 000000000..274de1b84 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-185488__cf-1/create-a-notification-response.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-185488__cf-1/debug-procedure.png b/dataset/problemstatement/microsoftInternal__NAV-185488__cf-1/debug-procedure.png new file mode 100644 index 000000000..ebd168516 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-185488__cf-1/debug-procedure.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-185488__cf-1/local-procedure-createnotificationentry.png b/dataset/problemstatement/microsoftInternal__NAV-185488__cf-1/local-procedure-createnotificationentry.png new file mode 100644 index 000000000..0f9898809 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-185488__cf-1/local-procedure-createnotificationentry.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-185488__cf-1/public-procedure-createnotificationentry.png b/dataset/problemstatement/microsoftInternal__NAV-185488__cf-1/public-procedure-createnotificationentry.png new file mode 100644 index 000000000..ba2ff5c49 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-185488__cf-1/public-procedure-createnotificationentry.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-185488__cf-1/send-approval-error.png b/dataset/problemstatement/microsoftInternal__NAV-185488__cf-1/send-approval-error.png new file mode 100644 index 000000000..141d3f710 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-185488__cf-1/send-approval-error.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-185488__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-185488__cf-2/README.md new file mode 100644 index 000000000..01b3c23bc --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-185488__cf-2/README.md @@ -0,0 +1,73 @@ +# Title: "The definition of the Pay-to Name 2 field has changed; old type: Code, new type: Text. Start your activity again." error message if you request approval of a Purchase Quote with Notify Sender activated. +## Repro Steps: +1-Take a BC 23.x (any localization) +2-Create from Template the Purchase Quote Approval Workflow from the Workflow page. +3-Just add the following new Response to Notify Sender: +![Create a Notification responce](./create-a-notification-response.png) +4-Create a new Purchase Quote and try to Send Approval Request from it. +================ +ACTUAL RESULTS +================ +"The definition of the Pay-to Name 2 field has changed; old type: Code, new type: Text. Start your activity again." error message if you request approval of a Purchase Quote with Notify Sender activated. +![Send Approval Request Error](./send-approval-error.png) + +================ +EXPECTED RESULTS +================ +ExecuteResponse only supports Approval Entry as argument. + +================ +ADDITIONAL INFO +================ + +If requesting support, please provide the following details to help troubleshooting: + +The definition of the Pay-to Name 2 field has changed; old type: Code, new type: Text. Start your activity again. + +Internal session ID: +bf61c088-ec19-41f0-b24b-cf19d15c0257 + +Application Insights session ID: +ec2aa9d8-08cc-41f4-8bf6-ba7eed842b78 + +Client activity id: +801fcf32-876f-46b0-a65f-04f16827c7e4 + +Time stamp on error: +2024-02-22T09:07:55.9555575Z + +User telemetry id: +8e1abf47-e5ce-4778-9d0c-6c45b151fb2c + +AL call stack: +"Workflow Step Argument"(Table 1523).GetNotificationUserID line 5 - Base Application by Microsoft +"Workflow Response Handling"(CodeUnit 1521).CreateNotificationEntry line 12 - Base Application by Microsoft +"Workflow Response Handling"(CodeUnit 1521).ExecuteResponse line 27 - Base Application by Microsoft +"Workflow Management"(CodeUnit 1501).ExecuteResponses line 32 - Base Application by Microsoft +"Workflow Management"(CodeUnit 1501).HandleEventWithxRec line 28 - Base Application by Microsoft +"Workflow Management"(CodeUnit 1501).HandleEvent line 2 - Base Application by Microsoft +"Workflow Event Handling"(CodeUnit 1520).RunWorkflowOnSendPurchaseDocForApproval line 3 - Base Application by Microsoft +"Approvals Mgmt."(CodeUnit 1535).OnSendPurchaseDocForApproval(Event) line 2 - Base Application by Microsoft +"Purchase Quote"(Page 49)."SendApprovalRequest - OnAction"(Trigger) line 5 - Base Application by Microsoft + +=================== +EXTRA INFO FROM PARTNER +=================== +Debugging function CreateNotificationEntry - Codeunit 1521 +![Local procedure CreateNotificationEntry](./local-procedure-createnotificationentry.png) + +This function calls function CreateNotificationEntry from “Notification entry” Table, and in its definition is expecting to receive the following parameters: + +![Public procedure CreateNotificationEntry](./public-procedure-createnotificationentry.png) + +The second parameter expects to receive Userid (Code 50) and here is where the problem is as to get the UserID it calls the GetNotificationUserID, with a register that should come from "Approval Entry". Field 6 of "Approval Entry" table is Sender ID, which is Code 50. But, we have checked that on this point in some situations we find a register of "Sales Header"... Field 6 of "Sales Header" is Bill-to Name 2... Text 50... +GetNotificationUserID exit this Text50 and the error happens. + +This is the exact point in the code where the error happens: + +![Debug procedure](./debug-procedure.png) + +The function try to exit the "Sender ID" and as we saw already this is field 6 of "Approval Entry" table and in "Sales Header" it doe snot exist... and exit the "Bill-to Name 2" field...which is field 6 of "Sales Header" table. + +## Description: +When you request approval of a Purchase Quote with Notify Sender activated, we shall receive such error message: "The definition of the Pay-to Name 2 field has changed; old type: Code, new type: Text. Start your activity again." diff --git a/dataset/problemstatement/microsoftInternal__NAV-185488__cf-2/create-a-notification-response.png b/dataset/problemstatement/microsoftInternal__NAV-185488__cf-2/create-a-notification-response.png new file mode 100644 index 000000000..274de1b84 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-185488__cf-2/create-a-notification-response.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-185488__cf-2/debug-procedure.png b/dataset/problemstatement/microsoftInternal__NAV-185488__cf-2/debug-procedure.png new file mode 100644 index 000000000..ebd168516 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-185488__cf-2/debug-procedure.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-185488__cf-2/local-procedure-createnotificationentry.png b/dataset/problemstatement/microsoftInternal__NAV-185488__cf-2/local-procedure-createnotificationentry.png new file mode 100644 index 000000000..0f9898809 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-185488__cf-2/local-procedure-createnotificationentry.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-185488__cf-2/public-procedure-createnotificationentry.png b/dataset/problemstatement/microsoftInternal__NAV-185488__cf-2/public-procedure-createnotificationentry.png new file mode 100644 index 000000000..ba2ff5c49 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-185488__cf-2/public-procedure-createnotificationentry.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-185488__cf-2/send-approval-error.png b/dataset/problemstatement/microsoftInternal__NAV-185488__cf-2/send-approval-error.png new file mode 100644 index 000000000..141d3f710 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-185488__cf-2/send-approval-error.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-185488__cf-3/README.md b/dataset/problemstatement/microsoftInternal__NAV-185488__cf-3/README.md new file mode 100644 index 000000000..df8680dea --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-185488__cf-3/README.md @@ -0,0 +1,73 @@ +# Title: "The definition of the Pay-to Name 2 field has changed; old type: Code, new type: Text. Start your activity again." error message if you request approval of a Purchase Quote with Notify Sender activated. +## Repro Steps: +1-Take a BC 23.x (any localization) +2-Create from Template the Purchase Quote Approval Workflow from the Workflow page. +3-Just add the following new Response to Notify Sender: +![Create a Notification responce](./create-a-notification-response.png) +4-Create a new Purchase Quote and try to Send Approval Request from it. +================ +ACTUAL RESULTS +================ +"The definition of the Pay-to Name 2 field has changed; old type: Code, new type: Text. Start your activity again." error message if you request approval of a Purchase Quote with Notify Sender activated. +![Send Approval Request Error](./send-approval-error.png) + +================ +EXPECTED RESULTS +================ +The notification is not created because the event is considered handled. + +================ +ADDITIONAL INFO +================ + +If requesting support, please provide the following details to help troubleshooting: + +The definition of the Pay-to Name 2 field has changed; old type: Code, new type: Text. Start your activity again. + +Internal session ID: +bf61c088-ec19-41f0-b24b-cf19d15c0257 + +Application Insights session ID: +ec2aa9d8-08cc-41f4-8bf6-ba7eed842b78 + +Client activity id: +801fcf32-876f-46b0-a65f-04f16827c7e4 + +Time stamp on error: +2024-02-22T09:07:55.9555575Z + +User telemetry id: +8e1abf47-e5ce-4778-9d0c-6c45b151fb2c + +AL call stack: +"Workflow Step Argument"(Table 1523).GetNotificationUserID line 5 - Base Application by Microsoft +"Workflow Response Handling"(CodeUnit 1521).CreateNotificationEntry line 12 - Base Application by Microsoft +"Workflow Response Handling"(CodeUnit 1521).ExecuteResponse line 27 - Base Application by Microsoft +"Workflow Management"(CodeUnit 1501).ExecuteResponses line 32 - Base Application by Microsoft +"Workflow Management"(CodeUnit 1501).HandleEventWithxRec line 28 - Base Application by Microsoft +"Workflow Management"(CodeUnit 1501).HandleEvent line 2 - Base Application by Microsoft +"Workflow Event Handling"(CodeUnit 1520).RunWorkflowOnSendPurchaseDocForApproval line 3 - Base Application by Microsoft +"Approvals Mgmt."(CodeUnit 1535).OnSendPurchaseDocForApproval(Event) line 2 - Base Application by Microsoft +"Purchase Quote"(Page 49)."SendApprovalRequest - OnAction"(Trigger) line 5 - Base Application by Microsoft + +=================== +EXTRA INFO FROM PARTNER +=================== +Debugging function CreateNotificationEntry - Codeunit 1521 +![Local procedure CreateNotificationEntry](./local-procedure-createnotificationentry.png) + +This function calls function CreateNotificationEntry from “Notification entry” Table, and in its definition is expecting to receive the following parameters: + +![Public procedure CreateNotificationEntry](./public-procedure-createnotificationentry.png) + +The second parameter expects to receive Userid (Code 50) and here is where the problem is as to get the UserID it calls the GetNotificationUserID, with a register that should come from "Approval Entry". Field 6 of "Approval Entry" table is Sender ID, which is Code 50. But, we have checked that on this point in some situations we find a register of "Sales Header"... Field 6 of "Sales Header" is Bill-to Name 2... Text 50... +GetNotificationUserID exit this Text50 and the error happens. + +This is the exact point in the code where the error happens: + +![Debug procedure](./debug-procedure.png) + +The function try to exit the "Sender ID" and as we saw already this is field 6 of "Approval Entry" table and in "Sales Header" it doe snot exist... and exit the "Bill-to Name 2" field...which is field 6 of "Sales Header" table. + +## Description: +When you request approval of a Purchase Quote with Notify Sender activated, we shall receive such error message: "The definition of the Pay-to Name 2 field has changed; old type: Code, new type: Text. Start your activity again." diff --git a/dataset/problemstatement/microsoftInternal__NAV-185488__cf-3/create-a-notification-response.png b/dataset/problemstatement/microsoftInternal__NAV-185488__cf-3/create-a-notification-response.png new file mode 100644 index 000000000..274de1b84 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-185488__cf-3/create-a-notification-response.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-185488__cf-3/debug-procedure.png b/dataset/problemstatement/microsoftInternal__NAV-185488__cf-3/debug-procedure.png new file mode 100644 index 000000000..ebd168516 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-185488__cf-3/debug-procedure.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-185488__cf-3/local-procedure-createnotificationentry.png b/dataset/problemstatement/microsoftInternal__NAV-185488__cf-3/local-procedure-createnotificationentry.png new file mode 100644 index 000000000..0f9898809 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-185488__cf-3/local-procedure-createnotificationentry.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-185488__cf-3/public-procedure-createnotificationentry.png b/dataset/problemstatement/microsoftInternal__NAV-185488__cf-3/public-procedure-createnotificationentry.png new file mode 100644 index 000000000..ba2ff5c49 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-185488__cf-3/public-procedure-createnotificationentry.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-185488__cf-3/send-approval-error.png b/dataset/problemstatement/microsoftInternal__NAV-185488__cf-3/send-approval-error.png new file mode 100644 index 000000000..141d3f710 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-185488__cf-3/send-approval-error.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-185792__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-185792__cf-1/README.md new file mode 100644 index 000000000..31c81aba5 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-185792__cf-1/README.md @@ -0,0 +1,41 @@ +# Title: Issue in the Project G/L Ledgers line after changing the "Amount (LCY)" value +## Repro Steps: +Testing done on version 24.1: +1- Open Project G/L Journal & fill the line as follows: +Document No. + +Account type & Account No. + +Currency code + +Bal. account type & Bal Account No. + +Project No. & Project Task No. + +Project quantity. + +![Project G/L Journals](./project-gl-journals.png) + +The following fields will be filled automatically according to the Amount (LCY) field when Job Quantity > 0: + +Project Unit Cost, Project Unit Cost (LCY), Project Total Cost and Project Total Cost (LCY). + +![Project G/L Journals Filled](./project-gl-journals-filled.png) + +2- After changing the Amount (LCY) in the line: +![Project G/L Journals Amount](./project-gl-journals-amount.png) + +3- The new amount will not reflect on the 4 fields mentioned: +![Project G/L Journals Not Reflected](./project-gl-journals-not-reflect.png) + +I replicated the same scenario on version: +![BC Version](./version-info.png) + +And the fields were updated once the Amount (LCY) field was adjusted: +Before: +![Before](./before.png) +After: +![After](./after.png) + +## Description: +Issue in the Project G/L Ledgers line after changing the "Amount (LCY)" value diff --git a/dataset/problemstatement/microsoftInternal__NAV-185792__cf-1/after.png b/dataset/problemstatement/microsoftInternal__NAV-185792__cf-1/after.png new file mode 100644 index 000000000..611710406 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-185792__cf-1/after.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-185792__cf-1/before.png b/dataset/problemstatement/microsoftInternal__NAV-185792__cf-1/before.png new file mode 100644 index 000000000..9f1a2d407 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-185792__cf-1/before.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-185792__cf-1/project-gl-journals-amount.png b/dataset/problemstatement/microsoftInternal__NAV-185792__cf-1/project-gl-journals-amount.png new file mode 100644 index 000000000..79f5da25b Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-185792__cf-1/project-gl-journals-amount.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-185792__cf-1/project-gl-journals-filled.png b/dataset/problemstatement/microsoftInternal__NAV-185792__cf-1/project-gl-journals-filled.png new file mode 100644 index 000000000..60fb3677c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-185792__cf-1/project-gl-journals-filled.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-185792__cf-1/project-gl-journals-not-reflect.png b/dataset/problemstatement/microsoftInternal__NAV-185792__cf-1/project-gl-journals-not-reflect.png new file mode 100644 index 000000000..bbd6f88f3 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-185792__cf-1/project-gl-journals-not-reflect.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-185792__cf-1/project-gl-journals.png b/dataset/problemstatement/microsoftInternal__NAV-185792__cf-1/project-gl-journals.png new file mode 100644 index 000000000..930202b9e Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-185792__cf-1/project-gl-journals.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-185792__cf-1/version-info.png b/dataset/problemstatement/microsoftInternal__NAV-185792__cf-1/version-info.png new file mode 100644 index 000000000..c601665b5 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-185792__cf-1/version-info.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-185792__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-185792__cf-2/README.md new file mode 100644 index 000000000..4deda3077 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-185792__cf-2/README.md @@ -0,0 +1,41 @@ +# Title: Issue in the Project G/L Ledgers line after changing the "Amount (LCY)" value +## Repro Steps: +Testing done on version 24.1: +1- Open Project G/L Journal & fill the line as follows: +Document No. + +Account type & Account No. + +Currency code + +Bal. account type & Bal Account No. + +Project No. & Project Task No. + +Project quantity. + +![Project G/L Journals](./project-gl-journals.png) + +The following fields will be filled automatically using existing job journal values: + +Project Unit Cost, Project Unit Cost (LCY), Project Total Cost and Project Total Cost (LCY). + +![Project G/L Journals Filled](./project-gl-journals-filled.png) + +2- After changing the Amount (LCY) in the line: +![Project G/L Journals Amount](./project-gl-journals-amount.png) + +3- The new amount will not reflect on the 4 fields mentioned: +![Project G/L Journals Not Reflected](./project-gl-journals-not-reflect.png) + +I replicated the same scenario on version: +![BC Version](./version-info.png) + +And the fields were updated once the Amount (LCY) field was adjusted: +Before: +![Before](./before.png) +After: +![After](./after.png) + +## Description: +Issue in the Project G/L Ledgers line after changing the "Amount (LCY)" value diff --git a/dataset/problemstatement/microsoftInternal__NAV-185792__cf-2/after.png b/dataset/problemstatement/microsoftInternal__NAV-185792__cf-2/after.png new file mode 100644 index 000000000..611710406 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-185792__cf-2/after.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-185792__cf-2/before.png b/dataset/problemstatement/microsoftInternal__NAV-185792__cf-2/before.png new file mode 100644 index 000000000..9f1a2d407 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-185792__cf-2/before.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-185792__cf-2/project-gl-journals-amount.png b/dataset/problemstatement/microsoftInternal__NAV-185792__cf-2/project-gl-journals-amount.png new file mode 100644 index 000000000..79f5da25b Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-185792__cf-2/project-gl-journals-amount.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-185792__cf-2/project-gl-journals-filled.png b/dataset/problemstatement/microsoftInternal__NAV-185792__cf-2/project-gl-journals-filled.png new file mode 100644 index 000000000..60fb3677c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-185792__cf-2/project-gl-journals-filled.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-185792__cf-2/project-gl-journals-not-reflect.png b/dataset/problemstatement/microsoftInternal__NAV-185792__cf-2/project-gl-journals-not-reflect.png new file mode 100644 index 000000000..bbd6f88f3 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-185792__cf-2/project-gl-journals-not-reflect.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-185792__cf-2/project-gl-journals.png b/dataset/problemstatement/microsoftInternal__NAV-185792__cf-2/project-gl-journals.png new file mode 100644 index 000000000..930202b9e Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-185792__cf-2/project-gl-journals.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-185792__cf-2/version-info.png b/dataset/problemstatement/microsoftInternal__NAV-185792__cf-2/version-info.png new file mode 100644 index 000000000..c601665b5 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-185792__cf-2/version-info.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-185792__cf-3/README.md b/dataset/problemstatement/microsoftInternal__NAV-185792__cf-3/README.md new file mode 100644 index 000000000..3f5edb6e6 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-185792__cf-3/README.md @@ -0,0 +1,41 @@ +# Title: Issue in the Project G/L Ledgers line after changing the "Amount (LCY)" value +## Repro Steps: +Testing done on version 24.1: +1- Open Project G/L Journal & fill the line as follows: +Document No. + +Account type & Account No. + +Currency code + +Bal. account type & Bal Account No. + +Project No. & Project Task No. + +Project quantity. + +![Project G/L Journals](./project-gl-journals.png) + +The following fields are updated when job pricing logic is explicitly triggered after changing Amount (LCY): + +Project Unit Cost, Project Unit Cost (LCY), Project Total Cost and Project Total Cost (LCY). + +![Project G/L Journals Filled](./project-gl-journals-filled.png) + +2- After changing the Amount (LCY) in the line: +![Project G/L Journals Amount](./project-gl-journals-amount.png) + +3- The new amount will not reflect on the 4 fields mentioned: +![Project G/L Journals Not Reflected](./project-gl-journals-not-reflect.png) + +I replicated the same scenario on version: +![BC Version](./version-info.png) + +And the fields were updated once the Amount (LCY) field was adjusted: +Before: +![Before](./before.png) +After: +![After](./after.png) + +## Description: +Issue in the Project G/L Ledgers line after changing the "Amount (LCY)" value diff --git a/dataset/problemstatement/microsoftInternal__NAV-185792__cf-3/after.png b/dataset/problemstatement/microsoftInternal__NAV-185792__cf-3/after.png new file mode 100644 index 000000000..611710406 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-185792__cf-3/after.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-185792__cf-3/before.png b/dataset/problemstatement/microsoftInternal__NAV-185792__cf-3/before.png new file mode 100644 index 000000000..9f1a2d407 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-185792__cf-3/before.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-185792__cf-3/project-gl-journals-amount.png b/dataset/problemstatement/microsoftInternal__NAV-185792__cf-3/project-gl-journals-amount.png new file mode 100644 index 000000000..79f5da25b Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-185792__cf-3/project-gl-journals-amount.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-185792__cf-3/project-gl-journals-filled.png b/dataset/problemstatement/microsoftInternal__NAV-185792__cf-3/project-gl-journals-filled.png new file mode 100644 index 000000000..60fb3677c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-185792__cf-3/project-gl-journals-filled.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-185792__cf-3/project-gl-journals-not-reflect.png b/dataset/problemstatement/microsoftInternal__NAV-185792__cf-3/project-gl-journals-not-reflect.png new file mode 100644 index 000000000..bbd6f88f3 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-185792__cf-3/project-gl-journals-not-reflect.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-185792__cf-3/project-gl-journals.png b/dataset/problemstatement/microsoftInternal__NAV-185792__cf-3/project-gl-journals.png new file mode 100644 index 000000000..930202b9e Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-185792__cf-3/project-gl-journals.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-185792__cf-3/version-info.png b/dataset/problemstatement/microsoftInternal__NAV-185792__cf-3/version-info.png new file mode 100644 index 000000000..c601665b5 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-185792__cf-3/version-info.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-188438__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-188438__cf-1/README.md new file mode 100644 index 000000000..6dbdf0b11 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-188438__cf-1/README.md @@ -0,0 +1,22 @@ +# Title: Wrong calculation at Sustainability Journal +## Repro Steps: + +## Description: +Use **CRONUS USA, Inc.** company: + +1. Install Sustainability demo data in Contoso Demo Tool. +2. Open **Sustainability Account Categories**. +3. Find **PURCHGOODS-GL** code. +4. in the **G/L Account** field enter **61300** account (or any other with the balance). +5. Close the page and open **Sustainability Journal** with **DEFAULT** batch. +6. The last line in this journal is with the **Account No. = 13151** and the **Installation Multiplier** for this line has value **1; Emission Factor CO2** for this line is **0.15**. +7. Add **Unit of Measure**. +8. Run the **Collect Amount from G/L Entries** action (from Line). +9. You will see **Net Change** used as a source for this calculation (for account I mentioned, it should be **-52,818.18**). Press OK. +10. After running the action, we will get the following results: + a. Custom Amount = -52,818.18 (WRONG) + b. Emission CO2 = -7,922.727 (WRONG) + +EXPECTED RESULTS: +==================================== +**Custom Amount** when use action **Collect Amount from G/L Entries** must show positive value only when **Emission Factor CO2 is positive**. Otherwise, the original sign must be preserved. diff --git a/dataset/problemstatement/microsoftInternal__NAV-188438__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-188438__cf-2/README.md new file mode 100644 index 000000000..5ce2adcf3 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-188438__cf-2/README.md @@ -0,0 +1,22 @@ +# Title: Wrong calculation at Sustainability Journal +## Repro Steps: + +## Description: +Use **CRONUS USA, Inc.** company: + +1. Install Sustainability demo data in Contoso Demo Tool. +2. Open **Sustainability Account Categories**. +3. Find **PURCHGOODS-GL** code. +4. in the **G/L Account** field enter **61300** account (or any other with the balance). +5. Close the page and open **Sustainability Journal** with **DEFAULT** batch. +6. The last line in this journal is with the **Account No. = 13151** and the **Installation Multiplier** for this line has value **1; Emission Factor CO2** for this line is **0.15**. +7. Add **Unit of Measure**. +8. Run the **Collect Amount from G/L Entries** action (from Line). +9. You will see **Net Change** used as a source for this calculation (for account I mentioned, it should be **-52,818.18**). Press OK. +10. After running the action, we will get the following results: + a. Custom Amount = -52,818.18 (WRONG) + b. Emission CO2 = -7,922.727 (WRONG) + +EXPECTED RESULTS: +==================================== +**Custom Amount** when use action **Collect Amount from G/L Entries** always must show positive value. Only G/L accounts with **Direct Posting = true** should be considered when collecting amounts. If a G/L account does not have Direct Posting enabled, its amount should be excluded (treated as zero). diff --git a/dataset/problemstatement/microsoftInternal__NAV-191624__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-191624__cf-1/README.md new file mode 100644 index 000000000..cc795fc7a --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-191624__cf-1/README.md @@ -0,0 +1,14 @@ +# Title: Acquisition date is null in excel file created by Fixed Asset Analysis Excel report +## Repro Steps: +Actions: +Create several Fixed Assets, acquire them, partially depreciate them. +Run Fixed Asset Analysis Excel report, open resulted excel file. + +**Expected result:** +First time initializing the Fixed Asset Analysis Excel report should insert the FixedAssetTypes required by the report. + +**Actual result:** +Acquisition date is null for all FAs. +![Result](./result.png) + +## Description: diff --git a/dataset/problemstatement/microsoftInternal__NAV-191624__cf-1/result.png b/dataset/problemstatement/microsoftInternal__NAV-191624__cf-1/result.png new file mode 100644 index 000000000..87223a880 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-191624__cf-1/result.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-191624__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-191624__cf-2/README.md new file mode 100644 index 000000000..bb3d0fe02 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-191624__cf-2/README.md @@ -0,0 +1,14 @@ +# Title: Acquisition date is null in excel file created by Fixed Asset Analysis Excel report +## Repro Steps: +Actions: +Create several Fixed Assets, acquire them, partially depreciate them. +Run Fixed Asset Analysis Excel report, open resulted excel file. + +**Expected result:** +Acquisition date is specified for each FA when FA Setup default depreciation book is configured. + +**Actual result:** +Acquisition date is null for all FAs. +![Result](./result.png) + +## Description: diff --git a/dataset/problemstatement/microsoftInternal__NAV-191624__cf-2/result.png b/dataset/problemstatement/microsoftInternal__NAV-191624__cf-2/result.png new file mode 100644 index 000000000..87223a880 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-191624__cf-2/result.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-193649__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-193649__cf-1/README.md new file mode 100644 index 000000000..706628908 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-193649__cf-1/README.md @@ -0,0 +1,20 @@ +# Title: [Shopify] Exported invoice - when copied it should clear Shopify Order Id (and Shopify Order No). +## Repro Steps: +BC Connected to Shopify +Payment terms are imported and FIXED is marked as default. +Enable Invoice Sync in the ORders fast tab. + +Create new customer with email and export it to Shopify (Customers -> Add Customer) +Create sales invoicefor that customer with any item, qty 1, price 100. Post. +Run Sync Posted Invoices. +Expected that this invoice is exported to Shopify. + +Create new invoice, choose Copy Document. +Select the posted sales invoice, choose Copy Header = yes, recalculate Lines = false. +Post invoice. +Run sync - this invoice is not included. +IF you choose Update Document - you can see that it already has Shopify Order Id populated with order exported to Shopify earlier. +This field is the reason why this invoice is ignored. + +We need to adjust "Copy Document" logic to clean up Shopify ORder Id field only (other Shopify fields should remain unchanged). +## Description: diff --git a/dataset/problemstatement/microsoftInternal__NAV-193649__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-193649__cf-2/README.md new file mode 100644 index 000000000..660942217 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-193649__cf-2/README.md @@ -0,0 +1,20 @@ +# Title: [Shopify] Exported invoice - when copied it should clear Shopify Order Id (and Shopify Order No). +## Repro Steps: +BC Connected to Shopify +Payment terms are imported and FIXED is marked as default. +Enable Invoice Sync in the ORders fast tab. + +Create new customer with email and export it to Shopify (Customers -> Add Customer) +Create sales invoicefor that customer with any item, qty 1, price 100. Post. +Run Sync Posted Invoices. +Expected that this invoice is exported to Shopify. + +Create new invoice, choose Copy Document. +Select the posted sales invoice, choose Copy Header = yes, recalculate Lines = false. +Post invoice. +Run sync - this invoice is not included. +IF you choose Update Document - you can see that it already has Shopify Order Id populated with order exported to Shopify earlier. +This field is the reason why this invoice is ignored. + +We need to adjust "Copy Document" logic to clean up Shopify ORder Id field only when copying from posted invoices to new invoices. +## Description: diff --git a/dataset/problemstatement/microsoftInternal__NAV-193853__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-193853__cf-1/README.md new file mode 100644 index 000000000..733875765 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-193853__cf-1/README.md @@ -0,0 +1,15 @@ +# Title: [master] Incoming documents are not synced between multiple general journal lines with the same Document No. and Posting Date +## Repro Steps: + +## Description: +Issue: One Document in two lines needs two digital documents. +Setup: CheckType = Attachment, Generated Automatically = False +Create one document in two (or more) lines. In line 1 - Debit 100, and in line 2 Credit -100. Both lines of course have equal Document No. and Posting Date. +Add an incoming document to the last line only. Let's call this file "eDoc1". +Post (or post preview). +Error 1: You will be asked to add an Incoming Document per line! +To pass the Error message, you attach an Incoming Document to the other line. Let us call this file "eDoc2". +Post. +Now the error message disappears. However, "eDoc1" and "eDoc2" are two different files. +Result: "eDoc1" is the one document that is attached to my entries. +So why ask for a document per line? diff --git a/dataset/problemstatement/microsoftInternal__NAV-193853__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-193853__cf-2/README.md new file mode 100644 index 000000000..5b96906eb --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-193853__cf-2/README.md @@ -0,0 +1,15 @@ +# Title: [master] Incoming documents are not synced between multiple general journal lines with the same Document No. and Posting Date +## Repro Steps: + +## Description: +Issue: One Document in two lines needs two digital documents. +Setup: CheckType = Attachment, Generated Automatically = False +Create one document in two (or more) lines. In line 1 - Debit 100, and in line 2 Credit -100. Both lines of course have equal Document No. and Posting Date. +Add an incoming document to one of the lines. All lines must reference the same incoming document (same Entry No.). +Post (or post preview). +Error 1: You will be asked to add an Incoming Document per line! +To pass the Error message, you attach an Incoming Document to the other line. Let us call this file "eDoc2". +Post. +Now the error message disappears. However, "eDoc1" and "eDoc2" are two different files. +Result: "eDoc1" is the one document that is attached to my entries. +So why ask for a document per line? diff --git a/dataset/problemstatement/microsoftInternal__NAV-195193__cf-1/LCY.png b/dataset/problemstatement/microsoftInternal__NAV-195193__cf-1/LCY.png new file mode 100644 index 000000000..9978ff50d Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-195193__cf-1/LCY.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-195193__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-195193__cf-1/README.md new file mode 100644 index 000000000..a0b5faf24 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-195193__cf-1/README.md @@ -0,0 +1,20 @@ +# Title: Excel layouts - dim breakdown results in repeated values (Trial Balance report a.o.) +## Repro Steps: +Open the Trial Balance Excel report +run it for p1..p3 +tip: in US you can run it with this acc. filter: +![Filter](./filter.png) +so buggy rows are in top of page  ;o) +open excel +open TrialBalanceData tab + +**expected**: a breakdown of revenue account per dimensions (zero values treated as debit) + +**actual**: repeated values for dimensions   (NetchangeDebit and Balance Debit) +![Excel Table](./excel_table.png) +the repeated rows/fields appears to just 'sit' in the reports - because the other numbers are correct: +![LCY](./LCY.png) + compared to a financial reported filtered for same dim: +![Finance Report](./finance_report.png) + +## Description: diff --git a/dataset/problemstatement/microsoftInternal__NAV-195193__cf-1/excel_table.png b/dataset/problemstatement/microsoftInternal__NAV-195193__cf-1/excel_table.png new file mode 100644 index 000000000..99f1649ee Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-195193__cf-1/excel_table.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-195193__cf-1/filter.png b/dataset/problemstatement/microsoftInternal__NAV-195193__cf-1/filter.png new file mode 100644 index 000000000..2f9d6197b Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-195193__cf-1/filter.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-195193__cf-1/finance_report.png b/dataset/problemstatement/microsoftInternal__NAV-195193__cf-1/finance_report.png new file mode 100644 index 000000000..321d0b04f Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-195193__cf-1/finance_report.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-195193__cf-2/LCY.png b/dataset/problemstatement/microsoftInternal__NAV-195193__cf-2/LCY.png new file mode 100644 index 000000000..9978ff50d Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-195193__cf-2/LCY.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-195193__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-195193__cf-2/README.md new file mode 100644 index 000000000..511534982 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-195193__cf-2/README.md @@ -0,0 +1,20 @@ +# Title: Excel layouts - dim breakdown results in repeated values (Trial Balance report a.o.) +## Repro Steps: +Open the Trial Balance Excel report +run it for p1..p3 +tip: in US you can run it with this acc. filter: +![Filter](./filter.png) +so buggy rows are in top of page  ;o) +open excel +open TrialBalanceData tab + +**expected**: correct debit/credit split for Net Change fields + +**actual**: repeated values for dimensions   (NetchangeDebit and Balance Debit) +![Excel Table](./excel_table.png) +the repeated rows/fields appears to just 'sit' in the reports - because the other numbers are correct: +![LCY](./LCY.png) + compared to a financial reported filtered for same dim: +![Finance Report](./finance_report.png) + +## Description: diff --git a/dataset/problemstatement/microsoftInternal__NAV-195193__cf-2/excel_table.png b/dataset/problemstatement/microsoftInternal__NAV-195193__cf-2/excel_table.png new file mode 100644 index 000000000..99f1649ee Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-195193__cf-2/excel_table.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-195193__cf-2/filter.png b/dataset/problemstatement/microsoftInternal__NAV-195193__cf-2/filter.png new file mode 100644 index 000000000..2f9d6197b Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-195193__cf-2/filter.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-195193__cf-2/finance_report.png b/dataset/problemstatement/microsoftInternal__NAV-195193__cf-2/finance_report.png new file mode 100644 index 000000000..321d0b04f Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-195193__cf-2/finance_report.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-195193__cf-3/LCY.png b/dataset/problemstatement/microsoftInternal__NAV-195193__cf-3/LCY.png new file mode 100644 index 000000000..9978ff50d Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-195193__cf-3/LCY.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-195193__cf-3/README.md b/dataset/problemstatement/microsoftInternal__NAV-195193__cf-3/README.md new file mode 100644 index 000000000..ed77bf419 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-195193__cf-3/README.md @@ -0,0 +1,20 @@ +# Title: Excel layouts - dim breakdown results in repeated values (Trial Balance report a.o.) +## Repro Steps: +Open the Trial Balance Excel report +run it for p1..p3 +tip: in US you can run it with this acc. filter: +![Filter](./filter.png) +so buggy rows are in top of page  ;o) +open excel +open TrialBalanceData tab + +**expected**: debit/credit reflects latest validation (no explicit reset required) + +**actual**: repeated values for dimensions   (NetchangeDebit and Balance Debit) +![Excel Table](./excel_table.png) +the repeated rows/fields appears to just 'sit' in the reports - because the other numbers are correct: +![LCY](./LCY.png) + compared to a financial reported filtered for same dim: +![Finance Report](./finance_report.png) + +## Description: diff --git a/dataset/problemstatement/microsoftInternal__NAV-195193__cf-3/excel_table.png b/dataset/problemstatement/microsoftInternal__NAV-195193__cf-3/excel_table.png new file mode 100644 index 000000000..99f1649ee Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-195193__cf-3/excel_table.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-195193__cf-3/filter.png b/dataset/problemstatement/microsoftInternal__NAV-195193__cf-3/filter.png new file mode 100644 index 000000000..2f9d6197b Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-195193__cf-3/filter.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-195193__cf-3/finance_report.png b/dataset/problemstatement/microsoftInternal__NAV-195193__cf-3/finance_report.png new file mode 100644 index 000000000..321d0b04f Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-195193__cf-3/finance_report.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-201169__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-201169__cf-1/README.md new file mode 100644 index 000000000..a19f76f2c --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-201169__cf-1/README.md @@ -0,0 +1,19 @@ +# Title: Shopify. Export item with empty title should be logged in Skipped entries +## Repro Steps: +Create item with empty or whitespace-only description. +Try to Add this item to Shopify. + +I can see two entries: +1. failed: +Request: +{"query":"mutation {productCreate(input: {**title:****"****",** status: ACTIVE, published: true}) {product {legacyResourceId, onlineStoreUrl, onlineStorePreviewUrl, createdAt, updatedAt, tags, variants(first: 1) {edges {node {legacyResourceId, createdAt, updatedAt}}}}, userErrors {field, message}}}"} +Response: +{"data":{"productCreate":{"product":null,"userErrors":[{"field":["title"],"**message":"Title can't be blank"**}]}},"extensions":{"cost":{"requestedQueryCost":13,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":4000.0,"currentlyAvailable":3990,"restoreRate":200.0}}}} +Expected - we should not try to export this item. But add it to Skipped entries. + +2.  +Also I notice that there was another pair (maybe fixed in main) +{"query":"{ translatableResource(resourceId: "gid://shopify/Product/0") { resourceId translatableContent {key value digest locale} }}"} +with request for translatable resources for item that wasn't created. I suspect we fixed something similar for metafields. But apparently it is still there for items (if for any other reason Shopify will reject creation of item) + +## Description: diff --git a/dataset/problemstatement/microsoftInternal__NAV-201169__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-201169__cf-2/README.md new file mode 100644 index 000000000..13e44e903 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-201169__cf-2/README.md @@ -0,0 +1,19 @@ +# Title: Shopify. Export item with empty title should be logged in Skipped entries +## Repro Steps: +Create item with no description. +Try to Add this item to Shopify. + +I can see two entries: +1. failed: +Request: +{"query":"mutation {productCreate(input: {**title:****"****",** status: ACTIVE, published: true}) {product {legacyResourceId, onlineStoreUrl, onlineStorePreviewUrl, createdAt, updatedAt, tags, variants(first: 1) {edges {node {legacyResourceId, createdAt, updatedAt}}}}, userErrors {field, message}}}"} +Response: +{"data":{"productCreate":{"product":null,"userErrors":[{"field":["title"],"**message":"Title can't be blank"**}]}},"extensions":{"cost":{"requestedQueryCost":13,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":4000.0,"currentlyAvailable":3990,"restoreRate":200.0}}}} +Expected - we log skipped entry but still attempt export. + +2.  +Also I notice that there was another pair (maybe fixed in main) +{"query":"{ translatableResource(resourceId: "gid://shopify/Product/0") { resourceId translatableContent {key value digest locale} }}"} +with request for translatable resources for item that wasn't created. I suspect we fixed something similar for metafields. But apparently it is still there for items (if for any other reason Shopify will reject creation of item) + +## Description: diff --git a/dataset/problemstatement/microsoftInternal__NAV-201169__cf-3/README.md b/dataset/problemstatement/microsoftInternal__NAV-201169__cf-3/README.md new file mode 100644 index 000000000..d73b23363 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-201169__cf-3/README.md @@ -0,0 +1,19 @@ +# Title: Shopify. Export item with empty title should be logged in Skipped entries +## Repro Steps: +Create item with no description. +Try to Add this item to Shopify. + +I can see two entries: +1. failed: +Request: +{"query":"mutation {productCreate(input: {**title:****"****",** status: ACTIVE, published: true}) {product {legacyResourceId, onlineStoreUrl, onlineStorePreviewUrl, createdAt, updatedAt, tags, variants(first: 1) {edges {node {legacyResourceId, createdAt, updatedAt}}}}, userErrors {field, message}}}"} +Response: +{"data":{"productCreate":{"product":null,"userErrors":[{"field":["title"],"**message":"Title can't be blank"**}]}},"extensions":{"cost":{"requestedQueryCost":13,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":4000.0,"currentlyAvailable":3990,"restoreRate":200.0}}}} +Expected - validation is handled during product creation instead of before export. + +2.  +Also I notice that there was another pair (maybe fixed in main) +{"query":"{ translatableResource(resourceId: "gid://shopify/Product/0") { resourceId translatableContent {key value digest locale} }}"} +with request for translatable resources for item that wasn't created. I suspect we fixed something similar for metafields. But apparently it is still there for items (if for any other reason Shopify will reject creation of item) + +## Description: diff --git a/dataset/problemstatement/microsoftInternal__NAV-206135__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-206135__cf-1/README.md new file mode 100644 index 000000000..e205863a8 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-206135__cf-1/README.md @@ -0,0 +1,33 @@ +# Title: Preview posting updates warehouse shipment but should not remove it from the list +## Repro Steps: +Issue was reproduced on BC SaaS and on Prem version 25.2 +**In base CRONUS USA, Inc. 25.2 Tenant** + +**Steps to reproduce:** +1. Search for Locations and modify SILVER to have Require Shipment and Require Receive checked +2. Search for Warehouse Employees and add your User as Warehouse Employee. +3. Post a Positive Adjustment for Item 1896-S for 1 PCS to any Bin in SILVER Location (I used S-01-1 +4. Search for Transfer Routes and add a Out Log for the Transfer Route setup Location SILVER as the From Location and MAIN as the To Location +5. Create Transfer Order from location SILVER to MAIN. +6. Add a line for the Item 1896-S for 1 PCS +7. Click on "Create Whse. Shipment" to create a Warehouse Shipment. +8. Complete the Preview Post from the Warehouse Shipment Page. (Notice that the warehouse shipment no longer appears on the warehouse shipment list page.) + +![Warehouse Shipment Post Preview](./warehouse-shipment-post-preview.png) + +9. To go back to the warehouse shipment document page, you need to close the page and reopen the warehouse shipment through "Related" link. + +**Actual Result:** The warehouse shipment line in transfer order disappears after preview posting operation. + +**Expected Result:** Preview posting operation should not clear the warehouse shipment from the warehouse shipment list page. + +The Partner is pushing for this to be fixed because their client's users are "freaking out" because they think the document for the Warehouse Shipment was deleted. + +## Description: +The Posting Preview from a Warehouse Shipment seems to remove the Warehouse Shipment from the lines. + +The Ussr is able to Navigate back to the Transfer Order and go back into the Warehouse Shipment, but the User Experience scares the users into thinking the Document was deleted. + +I don't know it is possible to correct this. We attempted to push back because the Warehouse Shipment may be navigated back to. + +The Partner is pushing for this because the Warehouse Shipment > Posting Preview for Transfer Orders is the only preview where this behavior of removing the Warehouse Shipment from the list occurs. diff --git a/dataset/problemstatement/microsoftInternal__NAV-206135__cf-1/warehouse-shipment-post-preview.png b/dataset/problemstatement/microsoftInternal__NAV-206135__cf-1/warehouse-shipment-post-preview.png new file mode 100644 index 000000000..e1c893358 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-206135__cf-1/warehouse-shipment-post-preview.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-206527__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-206527__cf-1/README.md new file mode 100644 index 000000000..12ef7daa6 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-206527__cf-1/README.md @@ -0,0 +1,31 @@ +# 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. +## Repro Steps: +1. Use existing Item with no activity, or create new item. This will be the COMPONENT Item. Will use PCS as UOM. +2. For the Component Item, go into Related > Item UOM > and set 'Quantity Rounding Precision' = 1 on the bottom. +3. Component Item should have + Replenishment System = PURCHASE + Rounding Precision = .01 + Reorder Policy = Lot-for-Lot + Include Inventory = TRUE +4. Then have another Item, I'll call it FG Item which is: + Replenishment System = PRODUNCTION ORDER + Rounding Precision = 1 + Reorder Policy = ORDER + Production BOM => Create new Certified Production BOM that consumes COMPONENT Item with 'Quantity Per' = .005 +5. Now create Sales Order for any Customer for FG Item for 1 Quantity at BLUE (or MAIN) location. +6. On the Sales Order go to Actions > Plan > Planning > Create Prod. Order and choose 'Released' and 'Item Order'. +7. Then choose Order Tracking and then 'Show' which will take you to the Released Prod. Order. +8. We will see prod. Order for FG Item with 1 qty. Go to Line > Components + +**EXPECTED RESULTS** = 'Quantity Per' and 'Expected Quantity' = .005 (must not be rounded to 0) +**ACTUAL RESULTS** = 'Quantity Per' and 'Expected Quantity' = 0 + +If 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: +"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." + +## Description: +2If a component's Item UOM has a 'Quantity Rounding Precision' set to 1, and a Finished Good consumes a very small partial quantity (0.005, below rounding precision), 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 .005 component, we would expect 'Quantity Per' and 'Expected Quantity' both = .005. There is no error message. + +But if you run the Planning Worksheet's 'Calc. Regenerative Plan', then you will get an error message about the 'Quantity Rounding Precision'. + +I 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. diff --git a/dataset/problemstatement/microsoftInternal__NAV-206527__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-206527__cf-2/README.md new file mode 100644 index 000000000..49146d2d3 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-206527__cf-2/README.md @@ -0,0 +1,31 @@ +# 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. +## Repro Steps: +1. Use existing Item with no activity, or create new item. This will be the COMPONENT Item. Will use PCS as UOM. +2. For the Component Item, go into Related > Item UOM > and set 'Quantity Rounding Precision' = 0.01 on the bottom. +3. Component Item should have + Replenishment System = PURCHASE + Rounding Precision = .01 + Reorder Policy = Lot-for-Lot + Include Inventory = TRUE +4. Then have another Item, I'll call it FG Item which is: + Replenishment System = PRODUNCTION ORDER + Rounding Precision = 1 + Reorder Policy = ORDER + Production BOM => Create new Certified Production BOM that consumes COMPONENT Item with 'Quantity Per' = .09 +5. Now create Sales Order for any Customer for FG Item for 1 Quantity at BLUE (or MAIN) location. +6. On the Sales Order go to Actions > Plan > Planning > Create Prod. Order and choose 'Released' and 'Item Order'. +7. Then choose Order Tracking and then 'Show' which will take you to the Released Prod. Order. +8. We will see prod. Order for FG Item with 1 qty. Go to Line > Components + +**EXPECTED RESULTS** = 'Quantity Per' and 'Expected Quantity' = .09 (no rounding to zero even with precision 0.01) +**ACTUAL RESULTS** = 'Quantity Per' and 'Expected Quantity' = 0 + +If 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: +"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." + +## Description: +2If a component's Item UOM has a 'Quantity Rounding Precision' set to 0.01, 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 .09 component, we would expect 'Quantity Per' and 'Expected Quantity' both = .09. There is no error message. + +But if you run the Planning Worksheet's 'Calc. Regenerative Plan', then you will get an error message about the 'Quantity Rounding Precision'. + +I 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. diff --git a/dataset/problemstatement/microsoftInternal__NAV-206977__cf-2/1002_test_assembly_step4.png b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-2/1002_test_assembly_step4.png new file mode 100644 index 000000000..78c18e8de Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-2/1002_test_assembly_step4.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-206977__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-2/README.md new file mode 100644 index 000000000..56ad9f7e7 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-2/README.md @@ -0,0 +1,24 @@ +# Title: Show document in Assembly order line page opens the wrong page when the Assembly order line belongs a blanket assembly order. +## Repro Steps: +1- Search for Items +Create a new Item with replenishment system "Assembly": +![Item Card Step1](./item_card_step1.png) +Create a new blanket sales order and add the created item in the lines: +![Blanket Sales Order Step2](./blanket_sales_order_step2.png) +3- Select the below function: +![Select Function Step3](./select_function_step3.png) +4- Add the following line and then select show document: (notice that the blanket sales order was created) +![1002 Test Assembly Step4](./1002_test_assembly_step4.png) +5- Open the page "Blanket Assembly Order" and check if the order was created: +![Blanket Assembly Order Step5](./blanket_assembly_order_step5.png) +6- Search for Assembly order lines +7-Select the Blanket order that we just created and select "Show Document": +![Show Document Step7](./show_document_step7.png) +8- This function will open the Assembly Order page: +![Assembly Order Step8](./assembly_order_step8.png) + +Expected result: the routing logic for opening the assembly document should be handled at the page level instead of the table level: +![Result](./result.png) + +## Description: +Show document in Assembly order line page opens the wrong page when the Assembly order line belongs a blanket assembly order. diff --git a/dataset/problemstatement/microsoftInternal__NAV-206977__cf-2/assembly_order_step8.png b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-2/assembly_order_step8.png new file mode 100644 index 000000000..71e8fe552 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-2/assembly_order_step8.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-206977__cf-2/blanket_assembly_order_step5.png b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-2/blanket_assembly_order_step5.png new file mode 100644 index 000000000..30ae0c5cb Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-2/blanket_assembly_order_step5.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-206977__cf-2/blanket_sales_order_step2.png b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-2/blanket_sales_order_step2.png new file mode 100644 index 000000000..74a37f304 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-2/blanket_sales_order_step2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-206977__cf-2/item_card_step1.png b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-2/item_card_step1.png new file mode 100644 index 000000000..29926337c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-2/item_card_step1.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-206977__cf-2/result.png b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-2/result.png new file mode 100644 index 000000000..8022c938c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-2/result.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-206977__cf-2/select_function_step3.png b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-2/select_function_step3.png new file mode 100644 index 000000000..e25cbc349 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-2/select_function_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-206977__cf-2/show_document_step7.png b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-2/show_document_step7.png new file mode 100644 index 000000000..a9a0dce26 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-2/show_document_step7.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-206977__cf-3/1002_test_assembly_step4.png b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-3/1002_test_assembly_step4.png new file mode 100644 index 000000000..78c18e8de Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-3/1002_test_assembly_step4.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-206977__cf-3/README.md b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-3/README.md new file mode 100644 index 000000000..83cdaa1af --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-3/README.md @@ -0,0 +1,24 @@ +# Title: Show document in Assembly order line page opens the wrong page when the Assembly order line belongs a blanket assembly order. +## Repro Steps: +1- Search for Items +Create a new Item with replenishment system "Assembly": +![Item Card Step1](./item_card_step1.png) +Create a new blanket sales order and add the created item in the lines: +![Blanket Sales Order Step2](./blanket_sales_order_step2.png) +3- Select the below function: +![Select Function Step3](./select_function_step3.png) +4- Add the following line and then select show document: (notice that the blanket sales order was created) +![1002 Test Assembly Step4](./1002_test_assembly_step4.png) +5- Open the page "Blanket Assembly Order" and check if the order was created: +![Blanket Assembly Order Step5](./blanket_assembly_order_step5.png) +6- Search for Assembly order lines +7-Select the Blanket order that we just created and select "Show Document": +![Show Document Step7](./show_document_step7.png) +8- This function will open the Assembly Order page: +![Assembly Order Step8](./assembly_order_step8.png) + +Expected result: the "show document" function should open the corresponding page, and fallback to Assembly Order if the document type is not explicitly handled: +![Result](./result.png) + +## Description: +Show document in Assembly order line page opens the wrong page when the Assembly order line belongs a blanket assembly order. diff --git a/dataset/problemstatement/microsoftInternal__NAV-206977__cf-3/assembly_order_step8.png b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-3/assembly_order_step8.png new file mode 100644 index 000000000..71e8fe552 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-3/assembly_order_step8.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-206977__cf-3/blanket_assembly_order_step5.png b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-3/blanket_assembly_order_step5.png new file mode 100644 index 000000000..30ae0c5cb Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-3/blanket_assembly_order_step5.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-206977__cf-3/blanket_sales_order_step2.png b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-3/blanket_sales_order_step2.png new file mode 100644 index 000000000..74a37f304 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-3/blanket_sales_order_step2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-206977__cf-3/item_card_step1.png b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-3/item_card_step1.png new file mode 100644 index 000000000..29926337c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-3/item_card_step1.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-206977__cf-3/result.png b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-3/result.png new file mode 100644 index 000000000..8022c938c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-3/result.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-206977__cf-3/select_function_step3.png b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-3/select_function_step3.png new file mode 100644 index 000000000..e25cbc349 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-3/select_function_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-206977__cf-3/show_document_step7.png b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-3/show_document_step7.png new file mode 100644 index 000000000..a9a0dce26 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-3/show_document_step7.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-206977__cf-4/1002_test_assembly_step4.png b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-4/1002_test_assembly_step4.png new file mode 100644 index 000000000..78c18e8de Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-4/1002_test_assembly_step4.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-206977__cf-4/README.md b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-4/README.md new file mode 100644 index 000000000..31cfc3eab --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-4/README.md @@ -0,0 +1,24 @@ +# Title: Show document in Assembly order line page opens the wrong page when the Assembly order line belongs a blanket assembly order. +## Repro Steps: +1- Search for Items +Create a new Item with replenishment system "Assembly": +![Item Card Step1](./item_card_step1.png) +Create a new blanket sales order and add the created item in the lines: +![Blanket Sales Order Step2](./blanket_sales_order_step2.png) +3- Select the below function: +![Select Function Step3](./select_function_step3.png) +4- Add the following line and then select show document: (notice that the blanket sales order was created) +![1002 Test Assembly Step4](./1002_test_assembly_step4.png) +5- Open the page "Blanket Assembly Order" and check if the order was created: +![Blanket Assembly Order Step5](./blanket_assembly_order_step5.png) +6- Search for Assembly order lines +7-Select the Blanket order that we just created and select "Show Document": +![Show Document Step7](./show_document_step7.png) +8- This function will open the Assembly Order page: +![Assembly Order Step8](./assembly_order_step8.png) + +Expected result: the "show document" function should open the blanket assembly order page if available, otherwise fallback to assembly order page: +![Result](./result.png) + +## Description: +Show document in Assembly order line page opens the wrong page when the Assembly order line belongs a blanket assembly order. diff --git a/dataset/problemstatement/microsoftInternal__NAV-206977__cf-4/assembly_order_step8.png b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-4/assembly_order_step8.png new file mode 100644 index 000000000..71e8fe552 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-4/assembly_order_step8.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-206977__cf-4/blanket_assembly_order_step5.png b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-4/blanket_assembly_order_step5.png new file mode 100644 index 000000000..30ae0c5cb Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-4/blanket_assembly_order_step5.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-206977__cf-4/blanket_sales_order_step2.png b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-4/blanket_sales_order_step2.png new file mode 100644 index 000000000..74a37f304 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-4/blanket_sales_order_step2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-206977__cf-4/item_card_step1.png b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-4/item_card_step1.png new file mode 100644 index 000000000..29926337c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-4/item_card_step1.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-206977__cf-4/result.png b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-4/result.png new file mode 100644 index 000000000..8022c938c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-4/result.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-206977__cf-4/select_function_step3.png b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-4/select_function_step3.png new file mode 100644 index 000000000..e25cbc349 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-4/select_function_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-206977__cf-4/show_document_step7.png b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-4/show_document_step7.png new file mode 100644 index 000000000..a9a0dce26 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-4/show_document_step7.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207177__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-207177__cf-1/README.md new file mode 100644 index 000000000..0b3737c5b --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-207177__cf-1/README.md @@ -0,0 +1,23 @@ +# Title: An empty attribute value was created through the item Card +## Repro Steps: +1.Create a new item in the item card  +![Item Card Step1](./item_card_step1.png) +2.In the item card, go to "Attributes" and add an Attribute. Make sure the "Value" column does not contain any empty rows. +![Attributes Step2](./attributes_step2.png) +![Item Attribute Values Step2](./item_attribute_values_step2.png) +3.- Exit the Item Attribute Value page. +4.Access "Attributes" again through the Item Card. If the "Attribute" field is empty, fill it again. Then, when checking the "Value" column, you will see that an empty Attribute Value has been created. +![Creat Value Step4](./creat_value_step4.png) + +=================== +ACTUAL RESULT +=================== +An empty attribute value was created through the item Card +=================== + +EXPECTED RESULT +=================== +An empty Attribute should NOT be created. + +## Description: +An empty attribute value was created through the item Card diff --git a/dataset/problemstatement/microsoftInternal__NAV-207177__cf-1/attributes_step2.png b/dataset/problemstatement/microsoftInternal__NAV-207177__cf-1/attributes_step2.png new file mode 100644 index 000000000..16e1e9941 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207177__cf-1/attributes_step2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207177__cf-1/creat_value_step4.png b/dataset/problemstatement/microsoftInternal__NAV-207177__cf-1/creat_value_step4.png new file mode 100644 index 000000000..7a31e1641 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207177__cf-1/creat_value_step4.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207177__cf-1/item_attribute_values_step2.png b/dataset/problemstatement/microsoftInternal__NAV-207177__cf-1/item_attribute_values_step2.png new file mode 100644 index 000000000..446881b4b Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207177__cf-1/item_attribute_values_step2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207177__cf-1/item_card_step1.png b/dataset/problemstatement/microsoftInternal__NAV-207177__cf-1/item_card_step1.png new file mode 100644 index 000000000..afc319f41 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207177__cf-1/item_card_step1.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207177__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-207177__cf-2/README.md new file mode 100644 index 000000000..0b3737c5b --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-207177__cf-2/README.md @@ -0,0 +1,23 @@ +# Title: An empty attribute value was created through the item Card +## Repro Steps: +1.Create a new item in the item card  +![Item Card Step1](./item_card_step1.png) +2.In the item card, go to "Attributes" and add an Attribute. Make sure the "Value" column does not contain any empty rows. +![Attributes Step2](./attributes_step2.png) +![Item Attribute Values Step2](./item_attribute_values_step2.png) +3.- Exit the Item Attribute Value page. +4.Access "Attributes" again through the Item Card. If the "Attribute" field is empty, fill it again. Then, when checking the "Value" column, you will see that an empty Attribute Value has been created. +![Creat Value Step4](./creat_value_step4.png) + +=================== +ACTUAL RESULT +=================== +An empty attribute value was created through the item Card +=================== + +EXPECTED RESULT +=================== +An empty Attribute should NOT be created. + +## Description: +An empty attribute value was created through the item Card diff --git a/dataset/problemstatement/microsoftInternal__NAV-207177__cf-2/attributes_step2.png b/dataset/problemstatement/microsoftInternal__NAV-207177__cf-2/attributes_step2.png new file mode 100644 index 000000000..16e1e9941 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207177__cf-2/attributes_step2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207177__cf-2/creat_value_step4.png b/dataset/problemstatement/microsoftInternal__NAV-207177__cf-2/creat_value_step4.png new file mode 100644 index 000000000..7a31e1641 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207177__cf-2/creat_value_step4.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207177__cf-2/item_attribute_values_step2.png b/dataset/problemstatement/microsoftInternal__NAV-207177__cf-2/item_attribute_values_step2.png new file mode 100644 index 000000000..446881b4b Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207177__cf-2/item_attribute_values_step2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207177__cf-2/item_card_step1.png b/dataset/problemstatement/microsoftInternal__NAV-207177__cf-2/item_card_step1.png new file mode 100644 index 000000000..afc319f41 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207177__cf-2/item_card_step1.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207177__cf-3/README.md b/dataset/problemstatement/microsoftInternal__NAV-207177__cf-3/README.md new file mode 100644 index 000000000..0b3737c5b --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-207177__cf-3/README.md @@ -0,0 +1,23 @@ +# Title: An empty attribute value was created through the item Card +## Repro Steps: +1.Create a new item in the item card  +![Item Card Step1](./item_card_step1.png) +2.In the item card, go to "Attributes" and add an Attribute. Make sure the "Value" column does not contain any empty rows. +![Attributes Step2](./attributes_step2.png) +![Item Attribute Values Step2](./item_attribute_values_step2.png) +3.- Exit the Item Attribute Value page. +4.Access "Attributes" again through the Item Card. If the "Attribute" field is empty, fill it again. Then, when checking the "Value" column, you will see that an empty Attribute Value has been created. +![Creat Value Step4](./creat_value_step4.png) + +=================== +ACTUAL RESULT +=================== +An empty attribute value was created through the item Card +=================== + +EXPECTED RESULT +=================== +An empty Attribute should NOT be created. + +## Description: +An empty attribute value was created through the item Card diff --git a/dataset/problemstatement/microsoftInternal__NAV-207177__cf-3/attributes_step2.png b/dataset/problemstatement/microsoftInternal__NAV-207177__cf-3/attributes_step2.png new file mode 100644 index 000000000..16e1e9941 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207177__cf-3/attributes_step2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207177__cf-3/creat_value_step4.png b/dataset/problemstatement/microsoftInternal__NAV-207177__cf-3/creat_value_step4.png new file mode 100644 index 000000000..7a31e1641 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207177__cf-3/creat_value_step4.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207177__cf-3/item_attribute_values_step2.png b/dataset/problemstatement/microsoftInternal__NAV-207177__cf-3/item_attribute_values_step2.png new file mode 100644 index 000000000..446881b4b Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207177__cf-3/item_attribute_values_step2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207177__cf-3/item_card_step1.png b/dataset/problemstatement/microsoftInternal__NAV-207177__cf-3/item_card_step1.png new file mode 100644 index 000000000..afc319f41 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207177__cf-3/item_card_step1.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207236__cf-1/102228_invoice_step5.png b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-1/102228_invoice_step5.png new file mode 100644 index 000000000..57c5aa430 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-1/102228_invoice_step5.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207236__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-1/README.md new file mode 100644 index 000000000..64d04d2bd --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-1/README.md @@ -0,0 +1,34 @@ +# Title: Post Batch of Sales Invoices with Currency Code and Replace Posting Date does not longer work +## Repro Steps: +1 Create a new sales invoice  +![Sales Invoice Step1](./sales_invoice_step1.png) +2.Select the currency code to USD +![Invoice Details Step2](./invoice_details_step2.png) +3.Add a single new line with item "1896-S" and quantity = 1 +![Lines Step3](./lines_step3.png) +4.Go back to the overview of "Sales Invoices" and select the action "Post Batch..." when selecting your newly created "Sales Invoice" +select in the request page a different "Posting Date" like 1st January 2025 +Select "Replace Posting Date" and "Replace Document Date" +![Information Step4](./information_step4.png) +![Sales Invoice Step4](./sales_invoice_step4.png) +![Batch Post Sales Invoice Step4](./batch_post_sales_invoice_step4.png) +5.Then when processing the invoice you receive this message: +![Message Step5](./message_step5.png) +If you select "No" then an error occurs, If you select "Yes" all lines will be recreated and all changes on the prices, amounts, discounts or description are lost on the lines because the lines get these information's from the base data. This is critical because not all lines get always their prices from a price list. +![Changes Step5](./changes_step5.png) +So the action "Batch Post..."  or the report 297 "Batch Post Sales Invoices" are not usable for our customer. +Following my further investigation, I made an attempt to replicate this issue on 24.5 and 25.0 versions it was working as expected. +![102228 Invoice Step5](./102228_invoice_step5.png) +![Invoice Details Step5](./invoice_details_step5.png) + +And also following cx statement after checking through base code: +The critical change was made in the table "Sales Header". There a new procedure was added called "BatchConfirmUpdatePostingDate". In here the field "Currency Code" is validated. If you debug the process you will see in a further step the "Currency Code" gets checked if it is different than before. This does not work because during the process in this case the xRec in the Validate-trigger is not initialized and the check will always result in an true which leads to the nice message which leads to our problem. + +Issue: Post Batch of Sales Invoices with Currency Code and Replace Posting Date does not longer work + +Expected result: It is expected that all lines should maintain the same amount as it was when creating the sales invoice, even if the currency factor is refreshed during batch posting. + +## Description: +Issue: Post Batch of Sales Invoices with Currency Code and Replace Posting Date does not longer work + +Expected result: It is expected that all lines should maintain the same amount as it was when creating the sales invoice, even if the currency factor is refreshed during batch posting. diff --git a/dataset/problemstatement/microsoftInternal__NAV-207236__cf-1/batch_post_sales_invoice_step4.png b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-1/batch_post_sales_invoice_step4.png new file mode 100644 index 000000000..7e3c99b42 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-1/batch_post_sales_invoice_step4.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207236__cf-1/changes_step5.png b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-1/changes_step5.png new file mode 100644 index 000000000..74f052b7e Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-1/changes_step5.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207236__cf-1/information_step4.png b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-1/information_step4.png new file mode 100644 index 000000000..8578d23bc Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-1/information_step4.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207236__cf-1/invoice_details_step2.png b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-1/invoice_details_step2.png new file mode 100644 index 000000000..ca129df8f Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-1/invoice_details_step2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207236__cf-1/invoice_details_step5.png b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-1/invoice_details_step5.png new file mode 100644 index 000000000..51524ec31 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-1/invoice_details_step5.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207236__cf-1/lines_step3.png b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-1/lines_step3.png new file mode 100644 index 000000000..7cb285f7d Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-1/lines_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207236__cf-1/message_step5.png b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-1/message_step5.png new file mode 100644 index 000000000..224a1acce Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-1/message_step5.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207236__cf-1/sales_invoice_step1.png b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-1/sales_invoice_step1.png new file mode 100644 index 000000000..77af67ae4 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-1/sales_invoice_step1.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207236__cf-1/sales_invoice_step4.png b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-1/sales_invoice_step4.png new file mode 100644 index 000000000..0021da31a Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-1/sales_invoice_step4.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207236__cf-2/102228_invoice_step5.png b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-2/102228_invoice_step5.png new file mode 100644 index 000000000..57c5aa430 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-2/102228_invoice_step5.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207236__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-2/README.md new file mode 100644 index 000000000..a4f7ae242 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-2/README.md @@ -0,0 +1,34 @@ +# Title: Post Batch of Sales Invoices with Currency Code and Replace Posting Date does not longer work +## Repro Steps: +1 Create a new sales invoice  +![Sales Invoice Step1](./sales_invoice_step1.png) +2.Select the currency code to USD +![Invoice Details Step2](./invoice_details_step2.png) +3.Add a single new line with item "1896-S" and quantity = 1 +![Lines Step3](./lines_step3.png) +4.Go back to the overview of "Sales Invoices" and select the action "Post Batch..." when selecting your newly created "Sales Invoice" +select in the request page a different "Posting Date" like 1st January 2025 +Select "Replace Posting Date" and "Replace Document Date" +![Information Step4](./information_step4.png) +![Sales Invoice Step4](./sales_invoice_step4.png) +![Batch Post Sales Invoice Step4](./batch_post_sales_invoice_step4.png) +5.Then when processing the invoice you receive this message: +![Message Step5](./message_step5.png) +If you select "No" then an error occurs, If you select "Yes" all lines will be recreated and all changes on the prices, amounts, discounts or description are lost on the lines because the lines get these information's from the base data. This is critical because not all lines get always their prices from a price list. +![Changes Step5](./changes_step5.png) +So the action "Batch Post..."  or the report 297 "Batch Post Sales Invoices" are not usable for our customer. +Following my further investigation, I made an attempt to replicate this issue on 24.5 and 25.0 versions it was working as expected. +![102228 Invoice Step5](./102228_invoice_step5.png) +![Invoice Details Step5](./invoice_details_step5.png) + +And also following cx statement after checking through base code: +The critical change was made in the table "Sales Header". There a new procedure was added called "BatchConfirmUpdatePostingDate". In here the field "Currency Code" is validated. If you debug the process you will see in a further step the "Currency Code" gets checked if it is different than before. This does not work because during the process in this case the xRec in the Validate-trigger is not initialized and the check will always result in an true which leads to the nice message which leads to our problem. + +Issue: Post Batch of Sales Invoices with Currency Code and Replace Posting Date does not longer work + +Expected result: It is expected that batch posting handles posting date replacement through a batch-specific update flow, without invoking Currency Code validation semantics that recreate lines. + +## Description: +Issue: Post Batch of Sales Invoices with Currency Code and Replace Posting Date does not longer work + +Expected result: It is expected that batch posting handles posting date replacement through a batch-specific update flow, without invoking Currency Code validation semantics that recreate lines. diff --git a/dataset/problemstatement/microsoftInternal__NAV-207236__cf-2/batch_post_sales_invoice_step4.png b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-2/batch_post_sales_invoice_step4.png new file mode 100644 index 000000000..7e3c99b42 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-2/batch_post_sales_invoice_step4.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207236__cf-2/changes_step5.png b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-2/changes_step5.png new file mode 100644 index 000000000..74f052b7e Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-2/changes_step5.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207236__cf-2/information_step4.png b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-2/information_step4.png new file mode 100644 index 000000000..8578d23bc Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-2/information_step4.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207236__cf-2/invoice_details_step2.png b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-2/invoice_details_step2.png new file mode 100644 index 000000000..ca129df8f Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-2/invoice_details_step2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207236__cf-2/invoice_details_step5.png b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-2/invoice_details_step5.png new file mode 100644 index 000000000..51524ec31 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-2/invoice_details_step5.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207236__cf-2/lines_step3.png b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-2/lines_step3.png new file mode 100644 index 000000000..7cb285f7d Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-2/lines_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207236__cf-2/message_step5.png b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-2/message_step5.png new file mode 100644 index 000000000..224a1acce Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-2/message_step5.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207236__cf-2/sales_invoice_step1.png b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-2/sales_invoice_step1.png new file mode 100644 index 000000000..77af67ae4 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-2/sales_invoice_step1.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207236__cf-2/sales_invoice_step4.png b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-2/sales_invoice_step4.png new file mode 100644 index 000000000..0021da31a Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-2/sales_invoice_step4.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207236__cf-3/102228_invoice_step5.png b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-3/102228_invoice_step5.png new file mode 100644 index 000000000..57c5aa430 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-3/102228_invoice_step5.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207236__cf-3/README.md b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-3/README.md new file mode 100644 index 000000000..4fa12ec6d --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-3/README.md @@ -0,0 +1,34 @@ +# Title: Post Batch of Sales Invoices with Currency Code and Replace Posting Date does not longer work +## Repro Steps: +1 Create a new sales invoice  +![Sales Invoice Step1](./sales_invoice_step1.png) +2.Select the currency code to USD +![Invoice Details Step2](./invoice_details_step2.png) +3.Add a single new line with item "1896-S" and quantity = 1 +![Lines Step3](./lines_step3.png) +4.Go back to the overview of "Sales Invoices" and select the action "Post Batch..." when selecting your newly created "Sales Invoice" +select in the request page a different "Posting Date" like 1st January 2025 +Select "Replace Posting Date" and "Replace Document Date" +![Information Step4](./information_step4.png) +![Sales Invoice Step4](./sales_invoice_step4.png) +![Batch Post Sales Invoice Step4](./batch_post_sales_invoice_step4.png) +5.Then when processing the invoice you receive this message: +![Message Step5](./message_step5.png) +If you select "No" then an error occurs, If you select "Yes" all lines will be recreated and all changes on the prices, amounts, discounts or description are lost on the lines because the lines get these information's from the base data. This is critical because not all lines get always their prices from a price list. +![Changes Step5](./changes_step5.png) +So the action "Batch Post..."  or the report 297 "Batch Post Sales Invoices" are not usable for our customer. +Following my further investigation, I made an attempt to replicate this issue on 24.5 and 25.0 versions it was working as expected. +![102228 Invoice Step5](./102228_invoice_step5.png) +![Invoice Details Step5](./invoice_details_step5.png) + +And also following cx statement after checking through base code: +The critical change was made in the table "Sales Header". There a new procedure was added called "BatchConfirmUpdatePostingDate". In here the field "Currency Code" is validated. If you debug the process you will see in a further step the "Currency Code" gets checked if it is different than before. This does not work because during the process in this case the xRec in the Validate-trigger is not initialized and the check will always result in an true which leads to the nice message which leads to our problem. + +Issue: Post Batch of Sales Invoices with Currency Code and Replace Posting Date does not longer work + +Expected result: It is expected that batch posting only performs the reopen/release workflow for sales invoices with a currency code when replacing the posting date. + +## Description: +Issue: Post Batch of Sales Invoices with Currency Code and Replace Posting Date does not longer work + +Expected result: It is expected that batch posting only performs the reopen/release workflow for sales invoices with a currency code when replacing the posting date. diff --git a/dataset/problemstatement/microsoftInternal__NAV-207236__cf-3/batch_post_sales_invoice_step4.png b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-3/batch_post_sales_invoice_step4.png new file mode 100644 index 000000000..7e3c99b42 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-3/batch_post_sales_invoice_step4.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207236__cf-3/changes_step5.png b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-3/changes_step5.png new file mode 100644 index 000000000..74f052b7e Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-3/changes_step5.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207236__cf-3/information_step4.png b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-3/information_step4.png new file mode 100644 index 000000000..8578d23bc Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-3/information_step4.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207236__cf-3/invoice_details_step2.png b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-3/invoice_details_step2.png new file mode 100644 index 000000000..ca129df8f Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-3/invoice_details_step2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207236__cf-3/invoice_details_step5.png b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-3/invoice_details_step5.png new file mode 100644 index 000000000..51524ec31 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-3/invoice_details_step5.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207236__cf-3/lines_step3.png b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-3/lines_step3.png new file mode 100644 index 000000000..7cb285f7d Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-3/lines_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207236__cf-3/message_step5.png b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-3/message_step5.png new file mode 100644 index 000000000..224a1acce Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-3/message_step5.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207236__cf-3/sales_invoice_step1.png b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-3/sales_invoice_step1.png new file mode 100644 index 000000000..77af67ae4 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-3/sales_invoice_step1.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207236__cf-3/sales_invoice_step4.png b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-3/sales_invoice_step4.png new file mode 100644 index 000000000..0021da31a Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-3/sales_invoice_step4.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207236__cf-4/102228_invoice_step5.png b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-4/102228_invoice_step5.png new file mode 100644 index 000000000..57c5aa430 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-4/102228_invoice_step5.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207236__cf-4/README.md b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-4/README.md new file mode 100644 index 000000000..6d9e09c91 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-4/README.md @@ -0,0 +1,34 @@ +# Title: Post Batch of Sales Invoices with Currency Code and Replace Posting Date does not longer work +## Repro Steps: +1 Create a new sales invoice  +![Sales Invoice Step1](./sales_invoice_step1.png) +2.Select the currency code to USD +![Invoice Details Step2](./invoice_details_step2.png) +3.Add a single new line with item "1896-S" and quantity = 1 +![Lines Step3](./lines_step3.png) +4.Go back to the overview of "Sales Invoices" and select the action "Post Batch..." when selecting your newly created "Sales Invoice" +select in the request page a different "Posting Date" like 1st January 2025 +Select "Replace Posting Date" and "Replace Document Date" +![Information Step4](./information_step4.png) +![Sales Invoice Step4](./sales_invoice_step4.png) +![Batch Post Sales Invoice Step4](./batch_post_sales_invoice_step4.png) +5.Then when processing the invoice you receive this message: +![Message Step5](./message_step5.png) +If you select "No" then an error occurs, If you select "Yes" all lines will be recreated and all changes on the prices, amounts, discounts or description are lost on the lines because the lines get these information's from the base data. This is critical because not all lines get always their prices from a price list. +![Changes Step5](./changes_step5.png) +So the action "Batch Post..."  or the report 297 "Batch Post Sales Invoices" are not usable for our customer. +Following my further investigation, I made an attempt to replicate this issue on 24.5 and 25.0 versions it was working as expected. +![102228 Invoice Step5](./102228_invoice_step5.png) +![Invoice Details Step5](./invoice_details_step5.png) + +And also following cx statement after checking through base code: +The critical change was made in the table "Sales Header". There a new procedure was added called "BatchConfirmUpdatePostingDate". In here the field "Currency Code" is validated. If you debug the process you will see in a further step the "Currency Code" gets checked if it is different than before. This does not work because during the process in this case the xRec in the Validate-trigger is not initialized and the check will always result in an true which leads to the nice message which leads to our problem. + +Issue: Post Batch of Sales Invoices with Currency Code and Replace Posting Date does not longer work + +Expected result: It is expected that batch posting does not rely on unsupported interactive validation context when determining whether currency-driven line recreation is allowed. + +## Description: +Issue: Post Batch of Sales Invoices with Currency Code and Replace Posting Date does not longer work + +Expected result: It is expected that batch posting does not rely on unsupported interactive validation context when determining whether currency-driven line recreation is allowed. diff --git a/dataset/problemstatement/microsoftInternal__NAV-207236__cf-4/batch_post_sales_invoice_step4.png b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-4/batch_post_sales_invoice_step4.png new file mode 100644 index 000000000..7e3c99b42 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-4/batch_post_sales_invoice_step4.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207236__cf-4/changes_step5.png b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-4/changes_step5.png new file mode 100644 index 000000000..74f052b7e Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-4/changes_step5.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207236__cf-4/information_step4.png b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-4/information_step4.png new file mode 100644 index 000000000..8578d23bc Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-4/information_step4.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207236__cf-4/invoice_details_step2.png b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-4/invoice_details_step2.png new file mode 100644 index 000000000..ca129df8f Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-4/invoice_details_step2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207236__cf-4/invoice_details_step5.png b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-4/invoice_details_step5.png new file mode 100644 index 000000000..51524ec31 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-4/invoice_details_step5.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207236__cf-4/lines_step3.png b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-4/lines_step3.png new file mode 100644 index 000000000..7cb285f7d Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-4/lines_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207236__cf-4/message_step5.png b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-4/message_step5.png new file mode 100644 index 000000000..224a1acce Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-4/message_step5.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207236__cf-4/sales_invoice_step1.png b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-4/sales_invoice_step1.png new file mode 100644 index 000000000..77af67ae4 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-4/sales_invoice_step1.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207236__cf-4/sales_invoice_step4.png b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-4/sales_invoice_step4.png new file mode 100644 index 000000000..0021da31a Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207236__cf-4/sales_invoice_step4.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207247__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-1/README.md new file mode 100644 index 000000000..cbbc926c3 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-1/README.md @@ -0,0 +1,38 @@ +# Title: If a comment is stored on Production BOM components, it is incorrectly transferred to the component lines for the Firm Planned Production order via Planning Worksheet when the same item is listed more than once on the BOM and the Position field must be used to distinguish those duplicate lines. +## Repro Steps: +1. A BOM is set up with several lines for one item.  You can use existing Prod. BOM  SP-BOM2000 and add a 2nd line for the SAME Item SP-BOM2001. +a. These lines have different “Position” numbers assigned to each line (Use personalization to populate the Position field).   You need this step otherwise the Planning Line will combine the 2 lines for this itme into 1, and you will not see the issue. +![Production BOM Step1](./production_BOM_step1.png)  +2. The first and second component line has comments assigned to them.  Again, it is important to know these are the same item, just listed twice. In this example: +a. Line 1: Comment “Test1” +![Edit List Step2a](./edit_list_step2a.png) +b. Line 2: Comment “Test2” +![Edit List Step2b](./edit_list_step2b.png) +3. A sales order for item "SP-BOM2000" is created and released to have a demand in the system. +![Sales Order Step3](./sales_order_step3.png)  +4. Go to planning worksheet page and navigate to Prepare > Calculate Regenerative planning +a. The planning worksheet is calculated for item "SP-BOM2000" +![Calculate Plan Step4a](./calculate_plan_step4a.png) +b. The planning worksheets now suggests creating a production order for item "SP-BOM2000". +![Planning Worksheets Step4b](./planning_worksheets_step4b.png) +c. On the Planning worksheet page, navigate to Line > Component. +![Componets Step4c](./componets_step4c.png) +d. The planning components does not have any comments or have a way to check the comment on this page. +![Planning Worksheets Step4d](./planning_components_step4d.png)  +5. Use "Carry Out Action message" function to create a Firm planned production order is created and opened. The components are opened. +![message Step5](./message_step5.png) +a. On the created Firm planned Prod. Order page, navigate to Line > Component. +![Component Step5a](./component_step5a.png) +b. You will notice that both lines now have the same comment – the comment from BOM line 2 (“Test2”). +![Comment List Step5b](./comment_list_step5b.png) +![Comment Step5b](./comment_step5b.png) +This shows that Line 1 now has the wrong comment as it has the same comment as Line 2 + +FYI: Manually creating a Firm planned production order does not lead to this issue. + +**Actual Result:** Both Production BOM Line 1 and 2 has the same comment "Test2" in the Firm planned Prod. order created from the Planning Worksheet. + +**Expected Result:** When the same component item appears more than once on the Production BOM, each Firm Planned Prod. Order component line should retain the comment from the Production BOM line with the matching Position. +**Also note, this is ONLY an issue when we use the 'POSITION' field.   If we do not, then we get just 1 line of the component with the 'Qty Per' summed from the 2 lines on the Prod. BOM.  But if we do NOT use the 'POSITION' field, then the combined Prod. Order Component line which is combined, just uses the Comment from the 2nd BOM Line "Test2". + +## Description: diff --git a/dataset/problemstatement/microsoftInternal__NAV-207247__cf-1/calculate_plan_step4a.png b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-1/calculate_plan_step4a.png new file mode 100644 index 000000000..e8673884d Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-1/calculate_plan_step4a.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207247__cf-1/comment_list_step5b.png b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-1/comment_list_step5b.png new file mode 100644 index 000000000..d6a08c0fe Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-1/comment_list_step5b.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207247__cf-1/comment_step5b.png b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-1/comment_step5b.png new file mode 100644 index 000000000..bdb4bb7cf Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-1/comment_step5b.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207247__cf-1/component_step5a.png b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-1/component_step5a.png new file mode 100644 index 000000000..32b6874ac Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-1/component_step5a.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207247__cf-1/componets_step4c.png b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-1/componets_step4c.png new file mode 100644 index 000000000..879100a38 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-1/componets_step4c.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207247__cf-1/edit_list_step2a.png b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-1/edit_list_step2a.png new file mode 100644 index 000000000..17330c4e8 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-1/edit_list_step2a.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207247__cf-1/edit_list_step2b.png b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-1/edit_list_step2b.png new file mode 100644 index 000000000..3784b6709 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-1/edit_list_step2b.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207247__cf-1/message_step5.png b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-1/message_step5.png new file mode 100644 index 000000000..1c55aa788 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-1/message_step5.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207247__cf-1/planning_components_step4d.png b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-1/planning_components_step4d.png new file mode 100644 index 000000000..2f1880b78 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-1/planning_components_step4d.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207247__cf-1/planning_worksheets_step4b.png b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-1/planning_worksheets_step4b.png new file mode 100644 index 000000000..eb17c3f0c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-1/planning_worksheets_step4b.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207247__cf-1/production_BOM_step1.png b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-1/production_BOM_step1.png new file mode 100644 index 000000000..49c474856 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-1/production_BOM_step1.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207247__cf-1/sales_order_step3.png b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-1/sales_order_step3.png new file mode 100644 index 000000000..b9bad83ce Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-1/sales_order_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207247__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-2/README.md new file mode 100644 index 000000000..1d036c8e7 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-2/README.md @@ -0,0 +1,38 @@ +# Title: If a comment is stored on Production BOM components, it is incorrectly transferred to the component lines for the Firm Planned Production order via Planning Worksheet when the same item is listed twice on the BOM and the BOM line identity must be preserved for comment transfer. +## Repro Steps: +1. A BOM is set up with several lines for one item.  You can use existing Prod. BOM  SP-BOM2000 and add a 2nd line for the SAME Item SP-BOM2001. +a. These lines have different “Position” numbers assigned to each line (Use personalization to populate the Position field).   You need this step otherwise the Planning Line will combine the 2 lines for this itme into 1, and you will not see the issue. +![Production BOM Step1](./production_BOM_step1.png)  +2. The first and second component line has comments assigned to them.  Again, it is important to know these are the same item, just listed twice. In this example: +a. Line 1: Comment “Test1” +![Edit List Step2a](./edit_list_step2a.png) +b. Line 2: Comment “Test2” +![Edit List Step2b](./edit_list_step2b.png) +3. A sales order for item "SP-BOM2000" is created and released to have a demand in the system. +![Sales Order Step3](./sales_order_step3.png)  +4. Go to planning worksheet page and navigate to Prepare > Calculate Regenerative planning +a. The planning worksheet is calculated for item "SP-BOM2000" +![Calculate Plan Step4a](./calculate_plan_step4a.png) +b. The planning worksheets now suggests creating a production order for item "SP-BOM2000". +![Planning Worksheets Step4b](./planning_worksheets_step4b.png) +c. On the Planning worksheet page, navigate to Line > Component. +![Componets Step4c](./componets_step4c.png) +d. The planning components does not have any comments or have a way to check the comment on this page. +![Planning Worksheets Step4d](./planning_components_step4d.png)  +5. Use "Carry Out Action message" function to create a Firm planned production order is created and opened. The components are opened. +![message Step5](./message_step5.png) +a. On the created Firm planned Prod. Order page, navigate to Line > Component. +![Component Step5a](./component_step5a.png) +b. You will notice that both lines now have the same comment – the comment from BOM line 2 (“Test2”). +![Comment List Step5b](./comment_list_step5b.png) +![Comment Step5b](./comment_step5b.png) +This shows that Line 1 now has the wrong comment as it has the same comment as Line 2 + +FYI: Manually creating a Firm planned production order does not lead to this issue. + +**Actual Result:** Both Production BOM Line 1 and 2 has the same comment "Test2" in the Firm planned Prod. order created from the Planning Worksheet. + +**Expected Result:** Each Firm Planned Prod. Order component line should retain the comment from the Production BOM line with the matching BOM line number, so Line 1 keeps "Test1" and Line 2 keeps "Test2". +**Also note, this is ONLY an issue when we use the 'POSITION' field.   If we do not, then we get just 1 line of the component with the 'Qty Per' summed from the 2 lines on the Prod. BOM.  But if we do NOT use the 'POSITION' field, then the combined Prod. Order Component line which is combined, just uses the Comment from the 2nd BOM Line "Test2". + +## Description: diff --git a/dataset/problemstatement/microsoftInternal__NAV-207247__cf-2/calculate_plan_step4a.png b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-2/calculate_plan_step4a.png new file mode 100644 index 000000000..e8673884d Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-2/calculate_plan_step4a.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207247__cf-2/comment_list_step5b.png b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-2/comment_list_step5b.png new file mode 100644 index 000000000..d6a08c0fe Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-2/comment_list_step5b.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207247__cf-2/comment_step5b.png b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-2/comment_step5b.png new file mode 100644 index 000000000..bdb4bb7cf Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-2/comment_step5b.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207247__cf-2/component_step5a.png b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-2/component_step5a.png new file mode 100644 index 000000000..32b6874ac Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-2/component_step5a.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207247__cf-2/componets_step4c.png b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-2/componets_step4c.png new file mode 100644 index 000000000..879100a38 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-2/componets_step4c.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207247__cf-2/edit_list_step2a.png b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-2/edit_list_step2a.png new file mode 100644 index 000000000..17330c4e8 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-2/edit_list_step2a.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207247__cf-2/edit_list_step2b.png b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-2/edit_list_step2b.png new file mode 100644 index 000000000..3784b6709 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-2/edit_list_step2b.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207247__cf-2/message_step5.png b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-2/message_step5.png new file mode 100644 index 000000000..1c55aa788 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-2/message_step5.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207247__cf-2/planning_components_step4d.png b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-2/planning_components_step4d.png new file mode 100644 index 000000000..2f1880b78 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-2/planning_components_step4d.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207247__cf-2/planning_worksheets_step4b.png b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-2/planning_worksheets_step4b.png new file mode 100644 index 000000000..eb17c3f0c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-2/planning_worksheets_step4b.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207247__cf-2/production_BOM_step1.png b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-2/production_BOM_step1.png new file mode 100644 index 000000000..49c474856 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-2/production_BOM_step1.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207247__cf-2/sales_order_step3.png b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-2/sales_order_step3.png new file mode 100644 index 000000000..b9bad83ce Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-2/sales_order_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207247__cf-3/README.md b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-3/README.md new file mode 100644 index 000000000..1170cd3f0 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-3/README.md @@ -0,0 +1,38 @@ +# Title: If a comment is stored on Production BOM components, it is incorrectly transferred to the component lines for the Released Production order via Planning Worksheet when the same item is listed twice on the BOM and the Position field is used. +## Repro Steps: +1. A BOM is set up with several lines for one item.  You can use existing Prod. BOM  SP-BOM2000 and add a 2nd line for the SAME Item SP-BOM2001. +a. These lines have different “Position” numbers assigned to each line (Use personalization to populate the Position field).   You need this step otherwise the Planning Line will combine the 2 lines for this itme into 1, and you will not see the issue. +![Production BOM Step1](./production_BOM_step1.png)  +2. The first and second component line has comments assigned to them.  Again, it is important to know these are the same item, just listed twice. In this example: +a. Line 1: Comment “Test1” +![Edit List Step2a](./edit_list_step2a.png) +b. Line 2: Comment “Test2” +![Edit List Step2b](./edit_list_step2b.png) +3. A sales order for item "SP-BOM2000" is created and released to have a demand in the system. +![Sales Order Step3](./sales_order_step3.png)  +4. Go to planning worksheet page and navigate to Prepare > Calculate Regenerative planning +a. The planning worksheet is calculated for item "SP-BOM2000" +![Calculate Plan Step4a](./calculate_plan_step4a.png) +b. The planning worksheets now suggests creating a production order for item "SP-BOM2000". +![Planning Worksheets Step4b](./planning_worksheets_step4b.png) +c. On the Planning worksheet page, navigate to Line > Component. +![Componets Step4c](./componets_step4c.png) +d. The planning components does not have any comments or have a way to check the comment on this page. +![Planning Worksheets Step4d](./planning_components_step4d.png)  +5. Use "Carry Out Action message" function to create a Firm planned production order is created and opened. The components are opened. +![message Step5](./message_step5.png) +a. On the created Firm planned Prod. Order page, navigate to Line > Component. +![Component Step5a](./component_step5a.png) +b. You will notice that both lines now have the same comment – the comment from BOM line 2 (“Test2”). +![Comment List Step5b](./comment_list_step5b.png) +![Comment Step5b](./comment_step5b.png) +This shows that Line 1 now has the wrong comment as it has the same comment as Line 2 + +FYI: Manually creating a Firm planned production order does not lead to this issue. + +**Actual Result:** Both Production BOM Line 1 and 2 has the same comment "Test2" in the Firm planned Prod. order created from the Planning Worksheet. + +**Expected Result:** The Production BOM Line 1 should retain its comment "Test1" in the Released Prod. order created from the Planning worksheet and Production BOM Line 2 "Test2". +**Also note, this is ONLY an issue when we use the 'POSITION' field.   If we do not, then we get just 1 line of the component with the 'Qty Per' summed from the 2 lines on the Prod. BOM.  But if we do NOT use the 'POSITION' field, then the combined Prod. Order Component line which is combined, just uses the Comment from the 2nd BOM Line "Test2". + +## Description: diff --git a/dataset/problemstatement/microsoftInternal__NAV-207247__cf-3/calculate_plan_step4a.png b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-3/calculate_plan_step4a.png new file mode 100644 index 000000000..e8673884d Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-3/calculate_plan_step4a.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207247__cf-3/comment_list_step5b.png b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-3/comment_list_step5b.png new file mode 100644 index 000000000..d6a08c0fe Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-3/comment_list_step5b.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207247__cf-3/comment_step5b.png b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-3/comment_step5b.png new file mode 100644 index 000000000..bdb4bb7cf Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-3/comment_step5b.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207247__cf-3/component_step5a.png b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-3/component_step5a.png new file mode 100644 index 000000000..32b6874ac Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-3/component_step5a.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207247__cf-3/componets_step4c.png b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-3/componets_step4c.png new file mode 100644 index 000000000..879100a38 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-3/componets_step4c.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207247__cf-3/edit_list_step2a.png b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-3/edit_list_step2a.png new file mode 100644 index 000000000..17330c4e8 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-3/edit_list_step2a.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207247__cf-3/edit_list_step2b.png b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-3/edit_list_step2b.png new file mode 100644 index 000000000..3784b6709 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-3/edit_list_step2b.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207247__cf-3/message_step5.png b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-3/message_step5.png new file mode 100644 index 000000000..1c55aa788 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-3/message_step5.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207247__cf-3/planning_components_step4d.png b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-3/planning_components_step4d.png new file mode 100644 index 000000000..2f1880b78 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-3/planning_components_step4d.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207247__cf-3/planning_worksheets_step4b.png b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-3/planning_worksheets_step4b.png new file mode 100644 index 000000000..eb17c3f0c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-3/planning_worksheets_step4b.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207247__cf-3/production_BOM_step1.png b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-3/production_BOM_step1.png new file mode 100644 index 000000000..49c474856 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-3/production_BOM_step1.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207247__cf-3/sales_order_step3.png b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-3/sales_order_step3.png new file mode 100644 index 000000000..b9bad83ce Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207247__cf-3/sales_order_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207878__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-207878__cf-1/README.md new file mode 100644 index 000000000..c87f091f9 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-207878__cf-1/README.md @@ -0,0 +1,31 @@ +# Title: Avail. Warning on Assembly Orders are considering demand across all dates +## Repro Steps: +1. In the Search, type  My Notifications and find 'Item availability is low' and Enable it +2. Work Date = 2/13/25 (mm/dd/yy) +3. Assembly Setup, set Default Location for Orders = BLUE +4. Manufacturing Setup, set 'Component at Location' = BLUE +5. Create a new Item Component  **ASSEMAVAILCOMP** (or use an existing item with no entries). +6. Create a new Assembled Item  **ASSEMAVAILFG**  with + Replenishment = PURCHASE Assembly Policy = Make-to-Stock +7. In the 'Assembly BOM' field, drill into it and add your component item from step 3 and set **'Qty Per' = 2.** +8. Create a new Assembly Order for Item **ASSEMAVAILFG** for 1 qty, BLUE location, while you can set all the dates 'Posting, Due, Starting, & Ending Dates' = 02/13/25. +9. Now check the 'Avail. Warning' on the Assembly Order Line, it shows Yes.  This is correct of course because we have 0 QOH for the component. + >You can also review the 'Show Availability' under the Home, and this looks good. + ![Home](./home.png) +10. Open Item Journal and create/post 2 qty to BLUE Location for your Component Item.  Now you will enough in stock to consume and make the Assembly Order. +11. If you go back and reopen the Assembly Order, the 'Avail. Warning' field will be blank.  All good. +12. Set Work Date = 02/18/25 +13. Create a 2nd Assembly Order for **ASSEMAVAILFG,** Blue location, for 3 quantity, and set all Dates should be 02/18/25.  We can see availability warning again, because this would require 6 more components. +14. Now go back and reopen the 1st Assembly Order where there is a demand of 2 qty for the Component, and we have 2 in stock. + +**EXPECTED RESULTS:**  'Aval. Warning' = blank + +**ACTUAL RESULTS:**  'Aval. Warning' = Yes +* Also, if I go into the 'Show Availability' we see "The inventory is not sufficient to cover request to assemble requested quantity of Item **ASSEMAVAILFG**" +* 'Able to Assembly' is also 0 (both header and line), despite the Document I provided in Description says "including how many of the assembly order quantity can be assembled by the due date based on availability of the required components." +* The Lines seem to show everything else except for current Assembly. +![Error](./error.png) + +## Description: +[Get an availability overview - Business Central | Microsoft Learn](https://learn.microsoft.com/en-us/dynamics365/business-central/inventory-how-availability-overview#assembly-availability-page) +![Details](./details.png) diff --git a/dataset/problemstatement/microsoftInternal__NAV-207878__cf-1/details.png b/dataset/problemstatement/microsoftInternal__NAV-207878__cf-1/details.png new file mode 100644 index 000000000..87eb7078c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207878__cf-1/details.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207878__cf-1/error.png b/dataset/problemstatement/microsoftInternal__NAV-207878__cf-1/error.png new file mode 100644 index 000000000..aac300e45 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207878__cf-1/error.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207878__cf-1/home.png b/dataset/problemstatement/microsoftInternal__NAV-207878__cf-1/home.png new file mode 100644 index 000000000..89ccca4f2 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207878__cf-1/home.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207878__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-207878__cf-2/README.md new file mode 100644 index 000000000..2914efbf7 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-207878__cf-2/README.md @@ -0,0 +1,31 @@ +# Title: Avail. Warning on Assembly Orders are not considering Due Dates, and instead is based on All Demand for the Component +## Repro Steps: +1. In the Search, type  My Notifications and find 'Item availability is low' and Enable it +2. Work Date = 2/13/25 (mm/dd/yy) +3. Assembly Setup, set Default Location for Orders = BLUE +4. Manufacturing Setup, set 'Component at Location' = BLUE +5. Create a new Item Component  **ASSEMAVAILCOMP** (or use an existing item with no entries). +6. Create a new Assembled Item  **ASSEMAVAILFG**  with + Replenishment = PURCHASE Assembly Policy = Make-to-Stock +7. In the 'Assembly BOM' field, drill into it and add your component item from step 3 and set **'Qty Per' = 2.** +8. Create a new Assembly Order for Item **ASSEMAVAILFG** for 1 qty, BLUE location, while you can set all the dates 'Posting, Due, Starting, & Ending Dates' = 02/13/25. +9. Now check the 'Avail. Warning' on the Assembly Order Line, it shows Yes.  This is correct of course because we have 0 QOH for the component. + >You can also review the 'Show Availability' under the Home, and this looks good. + ![Home](./home.png) +10. Open Item Journal and create/post 2 qty to BLUE Location for your Component Item.  Now you will enough in stock to consume and make the Assembly Order. +11. If you go back and reopen the Assembly Order, the 'Avail. Warning' field will be blank.  All good. +12. Set Work Date = 02/18/25 +13. Create a 2nd Assembly Order for **ASSEMAVAILFG,** Blue location, for 3 quantity, and set all Dates should be 02/18/25.  We can see availability warning again, because this would require 6 more components. +14. Now go back and reopen the 1st Assembly Order where there is a demand of 2 qty for the Component, and we have 2 in stock. + +**EXPECTED RESULTS:**  'Aval. Warning' = blank + +**ACTUAL RESULTS:**  'Aval. Warning' = Yes +* Also, if I go into the 'Show Availability' we see "The inventory is not sufficient to cover request to assemble requested quantity of Item **ASSEMAVAILFG**" +* 'Able to Assembly' is also 0 (both header and line), despite the Document I provided in Description says "including how many of the assembly order quantity can be assembled strictly based on expected inventory." +* The Lines seem to show everything else except for current Assembly. +![Error](./error.png) + +## Description: +[Get an availability overview - Business Central | Microsoft Learn](https://learn.microsoft.com/en-us/dynamics365/business-central/inventory-how-availability-overview#assembly-availability-page) +![Details](./details.png) diff --git a/dataset/problemstatement/microsoftInternal__NAV-207878__cf-2/details.png b/dataset/problemstatement/microsoftInternal__NAV-207878__cf-2/details.png new file mode 100644 index 000000000..87eb7078c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207878__cf-2/details.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207878__cf-2/error.png b/dataset/problemstatement/microsoftInternal__NAV-207878__cf-2/error.png new file mode 100644 index 000000000..aac300e45 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207878__cf-2/error.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207878__cf-2/home.png b/dataset/problemstatement/microsoftInternal__NAV-207878__cf-2/home.png new file mode 100644 index 000000000..89ccca4f2 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207878__cf-2/home.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207878__cf-3/README.md b/dataset/problemstatement/microsoftInternal__NAV-207878__cf-3/README.md new file mode 100644 index 000000000..08d01c541 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-207878__cf-3/README.md @@ -0,0 +1,31 @@ +# Title: Avail. Warning is triggered when Due Date is before Work Date +## Repro Steps: +1. In the Search, type  My Notifications and find 'Item availability is low' and Enable it +2. Work Date = 2/13/25 (mm/dd/yy) +3. Assembly Setup, set Default Location for Orders = BLUE +4. Manufacturing Setup, set 'Component at Location' = BLUE +5. Create a new Item Component  **ASSEMAVAILCOMP** (or use an existing item with no entries). +6. Create a new Assembled Item  **ASSEMAVAILFG**  with + Replenishment = PURCHASE Assembly Policy = Make-to-Stock +7. In the 'Assembly BOM' field, drill into it and add your component item from step 3 and set **'Qty Per' = 2.** +8. Create a new Assembly Order for Item **ASSEMAVAILFG** for 1 qty, BLUE location, while you can set all the dates 'Posting, Due, Starting, & Ending Dates' = 02/13/25. +9. Now check the 'Avail. Warning' on the Assembly Order Line, it shows Yes.  This is correct of course because we have 0 QOH for the component. + >You can also review the 'Show Availability' under the Home, and this looks good. + ![Home](./home.png) +10. Open Item Journal and create/post 2 qty to BLUE Location for your Component Item.  Now you will enough in stock to consume and make the Assembly Order. +11. If you go back and reopen the Assembly Order, the 'Avail. Warning' field will be blank.  All good. +12. Set Work Date = 02/18/25 +13. Create a 2nd Assembly Order for **ASSEMAVAILFG,** Blue location, for 3 quantity, and set all Dates should be 02/18/25.  We can see availability warning again, because this would require 6 more components. +14. Now go back and reopen the 1st Assembly Order where there is a demand of 2 qty for the Component, and we have 2 in stock. + +**EXPECTED RESULTS:**  'Aval. Warning' = blank + +**ACTUAL RESULTS:**  'Aval. Warning' = Yes +* Also, if I go into the 'Show Availability' we see "The inventory is not sufficient to cover request to assemble requested quantity of Item **ASSEMAVAILFG**" +* 'Able to Assembly' is also 0 (both header and line), despite the Document I provided in Description says "including how many of the assembly order quantity can be assembled by the due date based on availability of the required components." +* The Lines seem to show everything else except for current Assembly. +![Error](./error.png) + +## Description: +[Get an availability overview - Business Central | Microsoft Learn](https://learn.microsoft.com/en-us/dynamics365/business-central/inventory-how-availability-overview#assembly-availability-page) +![Details](./details.png) diff --git a/dataset/problemstatement/microsoftInternal__NAV-207878__cf-3/details.png b/dataset/problemstatement/microsoftInternal__NAV-207878__cf-3/details.png new file mode 100644 index 000000000..87eb7078c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207878__cf-3/details.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207878__cf-3/error.png b/dataset/problemstatement/microsoftInternal__NAV-207878__cf-3/error.png new file mode 100644 index 000000000..aac300e45 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207878__cf-3/error.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-207878__cf-3/home.png b/dataset/problemstatement/microsoftInternal__NAV-207878__cf-3/home.png new file mode 100644 index 000000000..89ccca4f2 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-207878__cf-3/home.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-208320__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-208320__cf-1/README.md new file mode 100644 index 000000000..e70ccfbd0 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-208320__cf-1/README.md @@ -0,0 +1,14 @@ +# Title: The Email and Phone No. don't update when selecting Another Customer in the "Bill-to" field of a Sales Invoice +## Repro Steps: +1. Go to Contacts and find CT000012 - "Miss Patricia Doyle" with 'Company Name' = (John Haddock Insurance Co.) +2. Edit the contact and add any 'Phone Number' and 'Mobile Phone No.' +3. Go to Sales Invoices and Create a new sales invoice and for Customer 10000. +3. Go down to the Shipping and Billing tab and set 'Bill-to' = "Another Customer" + 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. +5. Then set Name = 30000 (John Haddock Insurance Co.) and say yes to change bill-to customer. +Notice we have Contact = "Miss Patricia Doyle".... + +**EXPECTED RESULTS:** The Phone Number(s) and Email for "Miss Patricia Doyle" should pull in, unless the selected Bill-to Customer is the same as the current one. +**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. +## Description: +Copied and Derived from Support Case Review diff --git a/dataset/problemstatement/microsoftInternal__NAV-208320__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-208320__cf-2/README.md new file mode 100644 index 000000000..5c1dffe28 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-208320__cf-2/README.md @@ -0,0 +1,14 @@ +# Title: The Email and Phone No. don't update when selecting Another Customer in the "Bill-to" field of a Sales Invoice +## Repro Steps: +1. Go to Contacts and find CT000012 - "Miss Patricia Doyle" with 'Company Name' = (John Haddock Insurance Co.) +2. Edit the contact and add any 'Phone Number' and 'Mobile Phone No.' +3. Go to Sales Invoices and Create a new sales invoice and for Customer 10000. +3. Go down to the Shipping and Billing tab and set 'Bill-to' = "Another Customer" + 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. +5. Then set Name = 30000 (John Haddock Insurance Co.) and say yes to change bill-to customer. +Notice we have Contact = "Miss Patricia Doyle".... + +**EXPECTED RESULTS:** The Phone Number(s) and Email for "Miss Patricia Doyle" should pull in, unless Bill-to is set to "Custom Address". +**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. +## Description: +Copied and Derived from Support Case Review diff --git a/dataset/problemstatement/microsoftInternal__NAV-208320__cf-3/README.md b/dataset/problemstatement/microsoftInternal__NAV-208320__cf-3/README.md new file mode 100644 index 000000000..30065aacb --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-208320__cf-3/README.md @@ -0,0 +1,14 @@ +# Title: The Email and Phone No. don't update when selecting Another Customer in the "Bill-to" field of a Sales Invoice +## Repro Steps: +1. Go to Contacts and find CT000012 - "Miss Patricia Doyle" with 'Company Name' = (John Haddock Insurance Co.) +2. Edit the contact and add any 'Phone Number' and 'Mobile Phone No.' +3. Go to Sales Invoices and Create a new sales invoice and for Customer 10000. +3. Go down to the Shipping and Billing tab and set 'Bill-to' = "Another Customer" + 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. +5. Then set Name = 30000 (John Haddock Insurance Co.) and say yes to change bill-to customer. +Notice we have Contact = "Miss Patricia Doyle".... + +**EXPECTED RESULTS:** The Phone Number(s) should pull in, but the Email should remain unchanged. +**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. +## Description: +Copied and Derived from Support Case Review diff --git a/dataset/problemstatement/microsoftInternal__NAV-208649__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-208649__cf-1/README.md new file mode 100644 index 000000000..116c582a1 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-208649__cf-1/README.md @@ -0,0 +1,38 @@ +# 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. +## Repro Steps: +1.  Use existing Item with no activity, or create new item.  This will be the COMPONENT Item.  Will use PCS as UOM. + +2. For the Component Item, go into Related > Item UOM > and add a non-base UOM (for example, BOX) with 'Quantity Rounding Precision' = 1 on the bottom. + +3. Component Item should have + Replenishment System = PURCHASE + Rounding Precision = .01 + Reorder Policy = Lot-for-Lot + Include Inventory = TRUE + +4. Then have another Item, I'll call it FG Item which is: + Replenishment System = PRODUNCTION ORDER + Rounding Precision = 1 + Reorder Policy = ORDER + Production BOM => Create new Certified Production BOM that consumes COMPONENT Item in the non-base UOM with 'Quantity Per' = .09 + +5. Now create Sales Order for any Customer for FG Item for 1 Quantity at BLUE (or MAIN) location. + +6. On the Sales Order go to Actions > Plan > Planning > Create Prod. Order and choose 'Released' and 'Item Order'. + +7. Then choose Order Tracking and then 'Show' which will take you to the Released Prod. Order. + +8. We will see prod. Order for FG Item with 1 qty.  Go to Line > Components + + **EXPECTED RESULTS** = 'Quantity Per' and 'Expected Quantity' = .09 + **ACTUAL RESULTS** = 'Quantity Per' and 'Expected Quantity' = 0 + +If 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: +"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." + +## Description: +2If 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. + +But if you run the Planning Worksheet's 'Calc. Regenerative Plan', then you will get an error message about the 'Quantity Rounding Precision'. + +I 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.  diff --git a/dataset/problemstatement/microsoftInternal__NAV-208649__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-208649__cf-2/README.md new file mode 100644 index 000000000..31092e4ae --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-208649__cf-2/README.md @@ -0,0 +1,38 @@ +# 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. +## Repro Steps: +1.  Use existing Item with no activity, or create new item.  This will be the COMPONENT Item.  Will use PCS as UOM. + +2. For the Component Item, go into Related > Item UOM > and set 'Quantity Rounding Precision' = 1 on the bottom. + +3. Component Item should have + Replenishment System = PURCHASE + Rounding Precision = .01 + Reorder Policy = Lot-for-Lot + Include Inventory = TRUE + +4. Then have another Item, I'll call it FG Item which is: + Replenishment System = PRODUNCTION ORDER + Rounding Precision = 1 + Reorder Policy = ORDER + Production BOM => Create new Certified Production BOM that consumes COMPONENT Item with 'Quantity Per' = .09 + +5. Now create Sales Order for any Customer for FG Item for 2 Quantity at BLUE (or MAIN) location. + +6. On the Sales Order go to Actions > Plan > Planning > Create Prod. Order and choose 'Released' and 'Item Order'. + +7. Then choose Order Tracking and then 'Show' which will take you to the Released Prod. Order. + +8. We will see prod. Order for FG Item with 1 qty.  Go to Line > Components + + **EXPECTED RESULTS** = 'Quantity Per' = .09 and 'Expected Quantity' = .18 + **ACTUAL RESULTS** = 'Quantity Per' and 'Expected Quantity' = 0 + +If 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: +"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." + +## Description: +2If 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. + +But if you run the Planning Worksheet's 'Calc. Regenerative Plan', then you will get an error message about the 'Quantity Rounding Precision'. + +I 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.  diff --git a/dataset/problemstatement/microsoftInternal__NAV-208649__cf-3/README.md b/dataset/problemstatement/microsoftInternal__NAV-208649__cf-3/README.md new file mode 100644 index 000000000..16da66d5b --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-208649__cf-3/README.md @@ -0,0 +1,38 @@ +# 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. +## Repro Steps: +1.  Use existing Item with no activity, or create new item.  This will be the COMPONENT Item.  Will use PCS as UOM. + +2. For the Component Item, go into Related > Item UOM > and set 'Quantity Rounding Precision' = 1 on the bottom. + +3. Component Item should have + Replenishment System = PURCHASE + Rounding Precision = .01 + Reorder Policy = Lot-for-Lot + Include Inventory = TRUE + +4. Then have another Item, I'll call it FG Item which is: + Replenishment System = PRODUNCTION ORDER + Rounding Precision = 1 + Reorder Policy = ORDER + Production BOM => Create new Certified Production BOM that consumes COMPONENT Item with 'Quantity Per' = .49 + +5. Now create Sales Order for any Customer for FG Item for 1 Quantity at BLUE (or MAIN) location. + +6. On the Sales Order go to Actions > Plan > Planning > Create Prod. Order and choose 'Released' and 'Item Order'. + +7. Then choose Order Tracking and then 'Show' which will take you to the Released Prod. Order. + +8. We will see prod. Order for FG Item with 1 qty. Go to Line > Components + + **EXPECTED RESULTS** = 'Quantity Per' and 'Expected Quantity' = .49 + **ACTUAL RESULTS** = 'Quantity Per' and 'Expected Quantity' = 0 + +If 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: +"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." + +## Description: +2If 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. + +But if you run the Planning Worksheet's 'Calc. Regenerative Plan', then you will get an error message about the 'Quantity Rounding Precision'. + +I 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.  diff --git a/dataset/problemstatement/microsoftInternal__NAV-208748__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-208748__cf-1/README.md new file mode 100644 index 000000000..a47695c3a --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-208748__cf-1/README.md @@ -0,0 +1,18 @@ +# Title: When multiple items with extended text are added to a Blanket Sales Order and Make Order is used to create a new Sales Order only the first Extended text is brought over +## Repro Steps: +Issue was tested on BE & DE localizations (it is working fine in GB) +Open item No. 1896-S and open the extended text: +![Item Card](./item_card.png) +Add the below line: +![Extended Text](./extended_text.png) +Repeat this step with one more item (total 2 items). +Open Blanket sales order and add 3 lines for the 3 items then select make order: +![Blanket sales order](./blanket_sales_order.png) +Open the created sales order and you will find that 1 line for the extended text was created, and the others were not carried out to the sales order: +![Sales Order](./sales_order.png)  + +Expected results: +All extended text lines should be carried out to the sales order. + +## Description: +Extended text line is not carried out to the Sales order when created from blanket sales order diff --git a/dataset/problemstatement/microsoftInternal__NAV-208748__cf-1/blanket_sales_order.png b/dataset/problemstatement/microsoftInternal__NAV-208748__cf-1/blanket_sales_order.png new file mode 100644 index 000000000..60b12673b Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-208748__cf-1/blanket_sales_order.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-208748__cf-1/extended_text.png b/dataset/problemstatement/microsoftInternal__NAV-208748__cf-1/extended_text.png new file mode 100644 index 000000000..2558b6525 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-208748__cf-1/extended_text.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-208748__cf-1/item_card.png b/dataset/problemstatement/microsoftInternal__NAV-208748__cf-1/item_card.png new file mode 100644 index 000000000..9dfe02a54 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-208748__cf-1/item_card.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-208748__cf-1/sales_order.png b/dataset/problemstatement/microsoftInternal__NAV-208748__cf-1/sales_order.png new file mode 100644 index 000000000..0f58476b2 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-208748__cf-1/sales_order.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-208748__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-208748__cf-2/README.md new file mode 100644 index 000000000..1a5255402 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-208748__cf-2/README.md @@ -0,0 +1,18 @@ +# Title: When multiple items with extended text are added to a Blanket Sales Order and Make Order is used to create a new Sales Order only the first Extended text is brought over +## Repro Steps: +Issue was tested on BE & DE localizations (it is working fine in GB) +Open item No. 1896-S and open the extended text: +![Item Card](./item_card.png) +Add the below line: +![Extended Text](./extended_text.png) +Repeat this step with another 2 items, but only 2 of the 3 items should have extended text. +Open Blanket sales order and add 3 lines for the 3 items then select make order: +![Blanket sales order](./blanket_sales_order.png) +Open the created sales order and you will find that 1 line for the extended text was created, and the others were not carried out to the sales order: +![Sales Order](./sales_order.png)  + +Expected results: +All extended text lines should be carried out to the sales order. + +## Description: +Extended text line is not carried out to the Sales order when created from blanket sales order diff --git a/dataset/problemstatement/microsoftInternal__NAV-208748__cf-2/blanket_sales_order.png b/dataset/problemstatement/microsoftInternal__NAV-208748__cf-2/blanket_sales_order.png new file mode 100644 index 000000000..60b12673b Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-208748__cf-2/blanket_sales_order.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-208748__cf-2/extended_text.png b/dataset/problemstatement/microsoftInternal__NAV-208748__cf-2/extended_text.png new file mode 100644 index 000000000..2558b6525 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-208748__cf-2/extended_text.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-208748__cf-2/item_card.png b/dataset/problemstatement/microsoftInternal__NAV-208748__cf-2/item_card.png new file mode 100644 index 000000000..9dfe02a54 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-208748__cf-2/item_card.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-208748__cf-2/sales_order.png b/dataset/problemstatement/microsoftInternal__NAV-208748__cf-2/sales_order.png new file mode 100644 index 000000000..0f58476b2 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-208748__cf-2/sales_order.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-208851__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-208851__cf-1/README.md new file mode 100644 index 000000000..eeff0ffd4 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-208851__cf-1/README.md @@ -0,0 +1,29 @@ +# Title: In the Sales Price Lists, the 'Defines' field always defaults to Price & Discount when dealing with Customer Price Group/Customer Disc Group setting +## Repro Steps: +Reproduced in CRONUS GB v25.4 +Enable 'New Sales Price Experience' in Feature Management. +1. Go to Sales Price Lists +2. Click on New to generate a New Sales Price List. +3. Set Assign-to-type to Customer Disc. Group +4. View Columns for: **Discount** +5. Insert a single item line, using only Line Discount. +6. Set the Sales Price List to Status 'Active' + (or leave it not set to Active) +7. Go back to the Sales Price Lists Page. + +You will notice "Defines" has changed back to Prices & Discounts Same behavior is replicable with Price for Customer Price Group +**Expected Result:** Defines should remain as Discounts if only discounts are in the Sales Price list, even if the status is not Active +**Actual Results:** 'Defines' Always defaults to 'Prices & Discount' + +## Description: +The 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. + +The Partner Developer highlighted the following code: +The call stack: +- GetAmountType (\ext11_packandshipchanges\Table\7005\Price Source.dal:342) +- GetDefaultAmountType (\ext11_packandshipchanges\Table\7005\Price Source.dal:182) +- UpdateAmountType (\ext11_packandshipchanges\Table\7000\Price List Header.dal:567) +- OnClosePage (\ext11_packandshipchanges\Page\7016\Sales Price List.dal:600) + +In the Function:`UpdateAmountType`, the following code is used: +"Amount Type" := PriceSource.GetDefaultAmountType(); The code reflects it as empty. No value is passed to it, so it always defaults to 'Price & Discount' diff --git a/dataset/problemstatement/microsoftInternal__NAV-208851__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-208851__cf-2/README.md new file mode 100644 index 000000000..78d727f38 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-208851__cf-2/README.md @@ -0,0 +1,28 @@ +# Title: In the Sales Price Lists, the 'Defines' field always defaults to Price & Discount when dealing with Customer Price Group/Customer Disc Group setting +## Repro Steps: +Reproduced in CRONUS GB v25.4 +Enable 'New Sales Price Experience' in Feature Management. +1. Go to Sales Price Lists +2. Click on New to generate a New Sales Price List. +3. Set Assign-to-type to Customer Disc. Group +4. View Columns for: **Discount** +5. Insert a single item line, using only Price. +6. Set the Sales Price List to Status 'Active' +7. Go back to the Sales Price Lists Page. + +You will notice "Defines" has changed back to Prices & Discounts Same behavior is replicable with Price for Customer Price Group +**Expected Result:** Defines should remain as Price if only prices are in the Sales Price list +**Actual Results:** 'Defines' Always defaults to 'Prices & Discount' + +## Description: +The 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. + +The Partner Developer highlighted the following code: +The call stack: +- GetAmountType (\ext11_packandshipchanges\Table\7005\Price Source.dal:342) +- GetDefaultAmountType (\ext11_packandshipchanges\Table\7005\Price Source.dal:182) +- UpdateAmountType (\ext11_packandshipchanges\Table\7000\Price List Header.dal:567) +- OnClosePage (\ext11_packandshipchanges\Page\7016\Sales Price List.dal:600) + +In the Function:`UpdateAmountType`, the following code is used: +"Amount Type" := PriceSource.GetDefaultAmountType(); The code reflects it as empty. No value is passed to it, so it always defaults to 'Price & Discount' diff --git a/dataset/problemstatement/microsoftInternal__NAV-209450__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-209450__cf-1/README.md new file mode 100644 index 000000000..0405a6fc9 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-209450__cf-1/README.md @@ -0,0 +1,38 @@ +# Title: It should not be possible to reserve a non-inventory or service item for a job planning line +## Repro Steps: +1. Open BC252 W1 on Prem +2. Search for items + Create 2 Items + 1. inventory + 2. Non-Inventory +3. Search for Projects + Create a new Project + Customer: 10000 + Add a Task line No. 1000 + Apply Usage Link= No + ![Project Card](./project_card.png) +4. Edit -> Open project planning lines + Add the field Reserve and Apply Usage Link to the lines by personalisation + Add 2 lines for the created items: + Activate Apply Usage Link = YES + Reserve: Optinal + ![Project Planning Lines](./project_planning_lines.png) +5. Search for purchase orders + Create a purchase order ( make sure the posting date and the purchase line date is before the date on the project planning lines) + Vendor: 10000 + Add both items with quantity 2 to the purchase order + Functions -> Reserve + And reserve each line against the project journal lines. + + Post -> Receive +6. Navigate to the item ledger entries page and you will see that the item of type "Inventory" has remaining quantity with reserved quantity, but the item of type "Non-inventory" has remaining quantity of zero with reserved quantity available. + ![Item Ledger Entries](./item_ledger_entries.png) + +**ACTUAL RESULT:** The non-inventory item allows reserve. + +**EXPECTED RESULT:** No reservation should be allowed for items of type "Non-inventory". + +## Description: +It should not be possible to reserve a non-inventory or service item for a job planning line. +This is the documentation which describes it.https://learn.microsoft.com/en-us/dynamics365/business-central/inventory-about-item-types +Non-Inventory and Service items do not support the reservation functionality. diff --git a/dataset/problemstatement/microsoftInternal__NAV-209450__cf-1/item_ledger_entries.png b/dataset/problemstatement/microsoftInternal__NAV-209450__cf-1/item_ledger_entries.png new file mode 100644 index 000000000..cdaf7f6d3 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209450__cf-1/item_ledger_entries.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-209450__cf-1/project_card.png b/dataset/problemstatement/microsoftInternal__NAV-209450__cf-1/project_card.png new file mode 100644 index 000000000..b3e9a135b Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209450__cf-1/project_card.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-209450__cf-1/project_planning_lines.png b/dataset/problemstatement/microsoftInternal__NAV-209450__cf-1/project_planning_lines.png new file mode 100644 index 000000000..2280960fd Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209450__cf-1/project_planning_lines.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-209450__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-209450__cf-2/README.md new file mode 100644 index 000000000..29b24461d --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-209450__cf-2/README.md @@ -0,0 +1,38 @@ +# Title: It should not be possible to reserve a non-inventory or service item for a job planning line +## Repro Steps: +1. Open BC252 W1 on Prem +2. Search for items + Create 2 Items + 1. inventory + 2. Service +3. Search for Projects + Create a new Project + Customer: 10000 + Add a Task line No. 1000 + Apply Usage Link= No + ![Project Card](./project_card.png) +4. Edit -> Open project planning lines + Add the field Reserve and Apply Usage Link to the lines by personalisation + Add 2 lines for the created items: + Activate Apply Usage Link = YES + Reserve: Optinal + ![Project Planning Lines](./project_planning_lines.png) +5. Search for purchase orders + Create a purchase order ( make sure the posting date and the purchase line date is before the date on the project planning lines) + Vendor: 10000 + Add both items with quantity 2 to the purchase order + Functions -> Reserve + And reserve each line against the project journal lines. + + Post -> Receive +6. Navigate to the item ledger entries page and you will see that the item of type "Inventory" has remaining quantity with reserved quantity, but the item of type "Service" has remaining quantity of zero with reserved quantity available. + ![Item Ledger Entries](./item_ledger_entries.png) + +**ACTUAL RESULT:** The service item allows reserve. + +**EXPECTED RESULT:** No reservation should be allowed for items of type "Service". + +## Description: +It should not be possible to reserve a non-inventory or service item for a job planning line. +This is the documentation which describes it.https://learn.microsoft.com/en-us/dynamics365/business-central/inventory-about-item-types +Non-Inventory and Service items do not support the reservation functionality. diff --git a/dataset/problemstatement/microsoftInternal__NAV-209450__cf-2/item_ledger_entries.png b/dataset/problemstatement/microsoftInternal__NAV-209450__cf-2/item_ledger_entries.png new file mode 100644 index 000000000..cdaf7f6d3 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209450__cf-2/item_ledger_entries.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-209450__cf-2/project_card.png b/dataset/problemstatement/microsoftInternal__NAV-209450__cf-2/project_card.png new file mode 100644 index 000000000..b3e9a135b Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209450__cf-2/project_card.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-209450__cf-2/project_planning_lines.png b/dataset/problemstatement/microsoftInternal__NAV-209450__cf-2/project_planning_lines.png new file mode 100644 index 000000000..2280960fd Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209450__cf-2/project_planning_lines.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-209450__cf-3/README.md b/dataset/problemstatement/microsoftInternal__NAV-209450__cf-3/README.md new file mode 100644 index 000000000..ae158e52e --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-209450__cf-3/README.md @@ -0,0 +1,39 @@ +# Title: It should not be possible to reserve a non-inventory or service item for a job planning line +## Repro Steps: +1. Open BC252 W1 on Prem +2. Search for items + Create 3 Items + 1. inventory  + 2. Non-Inventory  + 3. Service  +3. Search for Projects + Create a new Project + Customer: 10000 + Add a Task line No. 1000 + Apply Usage Link= No + ![Project Card](./project_card.png) +4. Edit -> Open project planning lines + Add the field Reserve and Apply Usage Link to the lines by personalisation + Add 3 lines for the created items: + Activate Apply Usage Link = YES + Reserve: Optinal + ![Project Planning Lines](./project_planning_lines.png) +5. Search for purchase return orders + Create a purchase return order ( make sure the posting date and the purchase line date is before the date on the project planning lines) + Vendor: 10000 + Add all 3 items with quantity 2 to the purchase return order + Functions -> Reserve + And reserve each line against the project journal lines. + + Post -> Receive +6. Navigate to the item ledger entries page and you will see that the item of type "Inventory" has remaining quantity with reserved quantity, but the item of type "Service" and "Non-inventory" has remaining quantity of zero with reserved quantity available. + ![Item Ledger Entries](./item_ledger_entries.png) + +**ACTUAL RESULT:** The service item and non-inventory item allow reserve. + +**EXPECTED RESULT:** No reservation should be allowed for items of type "Service" and "Non-inventory". + +## Description: +It should not be possible to reserve a non-inventory or service item for a job planning line. +This is the documentation which describes it.https://learn.microsoft.com/en-us/dynamics365/business-central/inventory-about-item-types +Non-Inventory and Service items do not support the reservation functionality. diff --git a/dataset/problemstatement/microsoftInternal__NAV-209450__cf-3/item_ledger_entries.png b/dataset/problemstatement/microsoftInternal__NAV-209450__cf-3/item_ledger_entries.png new file mode 100644 index 000000000..cdaf7f6d3 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209450__cf-3/item_ledger_entries.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-209450__cf-3/project_card.png b/dataset/problemstatement/microsoftInternal__NAV-209450__cf-3/project_card.png new file mode 100644 index 000000000..b3e9a135b Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209450__cf-3/project_card.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-209450__cf-3/project_planning_lines.png b/dataset/problemstatement/microsoftInternal__NAV-209450__cf-3/project_planning_lines.png new file mode 100644 index 000000000..2280960fd Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209450__cf-3/project_planning_lines.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-209496__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-209496__cf-1/README.md new file mode 100644 index 000000000..4aefd84c2 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-209496__cf-1/README.md @@ -0,0 +1,29 @@ +# Title: Error message "A reminder attachment text cannot be created without an ID" when adding text for language in Reminder Level Communication + +## Repro Steps: +Issue was Reproduced in Version: GB Business Central 25.4 (Platform 25.2.29913.0 + Application 25.4.29661.29959) +**REPRO** +1. Navigate to Reminder Terms, Create a new one +![Reminder Terms Step1](./reminder_terms_step1.png) +2. On the Lines, Navigate to Customer Communication. +![Reminder Terms Setup Step2](./reminder_terms_setup_step2.png) +3. Press No to the next 2 x messages: +![Message Step3](./message_step3.png) +![Message2 Step3](./message2_step3.png) +4. With no Attachment Texts inserted on the communication, press Add text for language. +![Communication Step4](./communication_step4.png)  +5. Say No to the 2x messages, +![Message Step5](./message_step5.png) +![Message2 Step5](./message2_step5.png) +6. Then select the language - GERMAN: +![Languages Step6](./languages_step6.png) + +**Actual Result** +Error- A reminder attachment text cannot be created without an ID. + ![Error](./error.png) + +**Expected Result** +The error message should not appear. + +## Description: +Error message "A reminder attachment text cannot be created without an ID" when adding text for language in Reminder Level Communication diff --git a/dataset/problemstatement/microsoftInternal__NAV-209496__cf-1/communication_step4.png b/dataset/problemstatement/microsoftInternal__NAV-209496__cf-1/communication_step4.png new file mode 100644 index 000000000..b0ad2b050 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209496__cf-1/communication_step4.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-209496__cf-1/error.png b/dataset/problemstatement/microsoftInternal__NAV-209496__cf-1/error.png new file mode 100644 index 000000000..44ad97ef1 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209496__cf-1/error.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-209496__cf-1/languages_step6.png b/dataset/problemstatement/microsoftInternal__NAV-209496__cf-1/languages_step6.png new file mode 100644 index 000000000..07137bf99 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209496__cf-1/languages_step6.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-209496__cf-1/message2_step3.png b/dataset/problemstatement/microsoftInternal__NAV-209496__cf-1/message2_step3.png new file mode 100644 index 000000000..60adbb877 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209496__cf-1/message2_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-209496__cf-1/message2_step5.png b/dataset/problemstatement/microsoftInternal__NAV-209496__cf-1/message2_step5.png new file mode 100644 index 000000000..be7fa1026 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209496__cf-1/message2_step5.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-209496__cf-1/message_step3.png b/dataset/problemstatement/microsoftInternal__NAV-209496__cf-1/message_step3.png new file mode 100644 index 000000000..dffc89ea8 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209496__cf-1/message_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-209496__cf-1/message_step5.png b/dataset/problemstatement/microsoftInternal__NAV-209496__cf-1/message_step5.png new file mode 100644 index 000000000..0739a13be Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209496__cf-1/message_step5.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-209496__cf-1/reminder_terms_setup_step2.png b/dataset/problemstatement/microsoftInternal__NAV-209496__cf-1/reminder_terms_setup_step2.png new file mode 100644 index 000000000..e197b066d Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209496__cf-1/reminder_terms_setup_step2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-209496__cf-1/reminder_terms_step1.png b/dataset/problemstatement/microsoftInternal__NAV-209496__cf-1/reminder_terms_step1.png new file mode 100644 index 000000000..a57d986f0 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209496__cf-1/reminder_terms_step1.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-209496__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-209496__cf-2/README.md new file mode 100644 index 000000000..91072674e --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-209496__cf-2/README.md @@ -0,0 +1,29 @@ +# Title: Error message "A reminder attachment text cannot be created without an ID" when adding text for language in Reminder Level Communication + +## Repro Steps: +Issue was Reproduced in Version: GB Business Central 25.4 (Platform 25.2.29913.0 + Application 25.4.29661.29959) +**REPRO** +1. Navigate to Reminder Terms, Create a new one +![Reminder Terms Step1](./reminder_terms_step1.png) +2. Create two reminder levels. On the second line, navigate to Customer Communication. +![Reminder Terms Setup Step2](./reminder_terms_setup_step2.png) +3. Press No to the next 2 x messages: +![Message Step3](./message_step3.png) +![Message2 Step3](./message2_step3.png) +4. With no Attachment Texts inserted on the communication, press Add text for language. +![Communication Step4](./communication_step4.png)  +5. Say No to the 2x messages, +![Message Step5](./message_step5.png) +![Message2 Step5](./message2_step5.png) +6. Then select the language - ENGLISH: +![Languages Step6](./languages_step6.png) + +**Actual Result** +Error- A reminder attachment text cannot be created without an ID. + ![Error](./error.png) + +**Expected Result** +The error message should not appear. + +## Description: +Error message "A reminder attachment text cannot be created without an ID" when adding text for language in Reminder Level Communication diff --git a/dataset/problemstatement/microsoftInternal__NAV-209496__cf-2/communication_step4.png b/dataset/problemstatement/microsoftInternal__NAV-209496__cf-2/communication_step4.png new file mode 100644 index 000000000..b0ad2b050 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209496__cf-2/communication_step4.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-209496__cf-2/error.png b/dataset/problemstatement/microsoftInternal__NAV-209496__cf-2/error.png new file mode 100644 index 000000000..44ad97ef1 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209496__cf-2/error.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-209496__cf-2/languages_step6.png b/dataset/problemstatement/microsoftInternal__NAV-209496__cf-2/languages_step6.png new file mode 100644 index 000000000..07137bf99 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209496__cf-2/languages_step6.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-209496__cf-2/message2_step3.png b/dataset/problemstatement/microsoftInternal__NAV-209496__cf-2/message2_step3.png new file mode 100644 index 000000000..60adbb877 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209496__cf-2/message2_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-209496__cf-2/message2_step5.png b/dataset/problemstatement/microsoftInternal__NAV-209496__cf-2/message2_step5.png new file mode 100644 index 000000000..be7fa1026 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209496__cf-2/message2_step5.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-209496__cf-2/message_step3.png b/dataset/problemstatement/microsoftInternal__NAV-209496__cf-2/message_step3.png new file mode 100644 index 000000000..dffc89ea8 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209496__cf-2/message_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-209496__cf-2/message_step5.png b/dataset/problemstatement/microsoftInternal__NAV-209496__cf-2/message_step5.png new file mode 100644 index 000000000..0739a13be Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209496__cf-2/message_step5.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-209496__cf-2/reminder_terms_setup_step2.png b/dataset/problemstatement/microsoftInternal__NAV-209496__cf-2/reminder_terms_setup_step2.png new file mode 100644 index 000000000..e197b066d Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209496__cf-2/reminder_terms_setup_step2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-209496__cf-2/reminder_terms_step1.png b/dataset/problemstatement/microsoftInternal__NAV-209496__cf-2/reminder_terms_step1.png new file mode 100644 index 000000000..a57d986f0 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209496__cf-2/reminder_terms_step1.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-209737__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-209737__cf-1/README.md new file mode 100644 index 000000000..2b0288eb4 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-209737__cf-1/README.md @@ -0,0 +1,57 @@ +# Title: Sales Order - Invoice discount disappears when currency exchange rate is changed by shipment posting date and a location is used with BIN +## Repro Steps: +1. Open BC25.4 W1 on Prem +2. Search for Currencies + Select EUR  -> edit + Click on Exchange Rates + Add the following Exhange Rates: + ![Currency Exchange Rates](./currency_exchange_rates.png) +3. Search for locations + Select SILVER edit + Do the following change + Require Pick: TRUE +4. Search for user + Add your user as Admin +5. Search for Warehouse Employees + Add your user for Location SILVER +6. Search for Item Journal + positive Adjustment  + Item: 1896-s + Location SILVER + Bin S-01-0002 + Quantity: 20 + post +7. Open my Settings + Work Date: 01.02.25 (1. February 2025) +8. Search for Sales Orders + Create a new Sales Order + Customer: 49633663 + Item: 1896-s + Location: SILVER + Quantity: 1 + Unit Price: 1000,00 + Currency Code: EUR + Line Discount: 10% + ![Sales Order](./sales_order.png) +9. Create Inventory Pick + Home -> Create Inventory Put-away/Pick + ![Inventory Movement](./inventory_movement.png) +10. Open the created Pick + Related -> Warehouse -> Invt. Put-away/Pick lines + Show Document + Autofill Qty. to Handle + Change the Posting Date to: 14.02.25 + ![Inventory Pick](./inventory_pick.png) + Post -> Ship +11. Go back to the Sales order + +**ACTUAL RESULT:** +Posting Date is changed to 14.02.25 (which is correct) +But the Inoice Discount is gone +![Sales Order Result](./sales_order_result.png) + +**EXPECTED RESULT:** +The Invoice Discount should be:10 % + +## Description: +Sales Order - Invoice discount disappears when currency exchange rate is changed by shipment posting date and a location is used with BIN diff --git a/dataset/problemstatement/microsoftInternal__NAV-209737__cf-1/currency_exchange_rates.png b/dataset/problemstatement/microsoftInternal__NAV-209737__cf-1/currency_exchange_rates.png new file mode 100644 index 000000000..22a657f5d Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209737__cf-1/currency_exchange_rates.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-209737__cf-1/inventory_movement.png b/dataset/problemstatement/microsoftInternal__NAV-209737__cf-1/inventory_movement.png new file mode 100644 index 000000000..75bdf57a6 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209737__cf-1/inventory_movement.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-209737__cf-1/inventory_pick.png b/dataset/problemstatement/microsoftInternal__NAV-209737__cf-1/inventory_pick.png new file mode 100644 index 000000000..affcd21c4 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209737__cf-1/inventory_pick.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-209737__cf-1/sales_order.png b/dataset/problemstatement/microsoftInternal__NAV-209737__cf-1/sales_order.png new file mode 100644 index 000000000..5bd9b02dc Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209737__cf-1/sales_order.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-209737__cf-1/sales_order_result.png b/dataset/problemstatement/microsoftInternal__NAV-209737__cf-1/sales_order_result.png new file mode 100644 index 000000000..3104966ff Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209737__cf-1/sales_order_result.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-209835__cf-1/Item_card_step1.png b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-1/Item_card_step1.png new file mode 100644 index 000000000..06649b28e Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-1/Item_card_step1.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-209835__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-1/README.md new file mode 100644 index 000000000..76271d5c9 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-1/README.md @@ -0,0 +1,42 @@ +# Title: When a Filter is set in the Planning Worksheet to a specific Action Message (e.g. Cancel) and Carry Out Action Message is completed, additional Planning lines are carried out that were not presented. +## Repro Steps: +1- Create a new item with the reordering policy set to "Order". +![Item Card Step1](./Item_card_step1.png) +2- Create a purchase order for the item with the date set to January 1st, but do not post it. +![Purchase Order Step2](./purchase_order_step2.png) +3- Create a sales order for the same item, ensuring the shipment date is set out to a future Date +![Sales Order Step3](./sales_order_step3.png) +![Sales Order2 Step3](./sales_order2_step3.png) +| Type | No. | Item Reference No. | Description | Location Code | Quantity | Qty. to Assemble to Order | Reserved Quantity | Unit of Measure Code | Unit Price Excl. VAT | Line Discount % | Line Amount Excl. VAT | Service Commitments | Customer Contract No. | Vendor Contract No. | Qty. to Ship | Quantity Shipped | Qty. to Invoice | Quantity Invoiced | Qty. to Assign | Item Charge Qty. to Handle | Qty. Assigned | Planned Delivery Date | Planned Shipment Date | Shipment Date | Abteilung Code | Debitorengruppe Code | +| ---- | ---- | ------------------ | ----------- | ------------- | -------- | ------------------------- | ----------------- | -------------------- | -------------------- | --------------- | --------------------- | ------------------- | --------------------- | ------------------- | ------------ | ---------------- | --------------- | ----------------- | -------------- | -------------------------- | ------------- | --------------------- | --------------------- | ------------- | -------------- | -------------------- | +| Item | 1006 | | Test12 | | 4 | | | STÜCK | 10,00 | | 40,00 | 0 | | | 4 | | 4 | | 0 | 0 | 0 | 10.01.2025 | 10.01.2025 | 10.01.2025 | | MITTEL | + +4- Go to the planning worksheet and calculate the regenerative plan. +![Calculate Plan Step4](./calculate_plan_step4.png) +5- Add the vendor number and the vendor for the item, ensuring the two lines are selected correctly. +![Planning Worksheets Step5](./planning_worksheets_step5.png) +6- Filter using the "Action message" field to the New Planning Line  +![Planning Worksheets Step6](./planning_worksheets_step6.png) +7- Click the "Carry out Action Message" for the line selected +![Message Step7](./message_step7.png) +![Purchase Order Step7](./purchase_order_step7.png) + +**RESULT:** +When filtering with the Action Message field and specifically the "Cancel" line, the other line was also carried out to generate the New Purchase Order. + +**EXPECTED BEHAVIOR:** +Only the selected line will carry out and the open Purchase Order is not cancelled. It is expected that exactly one New Purchase Order is generated and that the Cancel planning line would remain in the Planning Worksheet Line. +FURTHER CLARIFICATION FROM THE PARTNER (KUMAVISION) +When filtering by Vendor Number or Item Number, as examples, the Carry Out Action Messages works without any issue and as expected. Only the filtered to line is "carried out" when the Carry Out Action Message is processed.  +The perceived problem by the Customer is that this different behavior only occurs when filtering by the Action Message, where the Action Message Filter is not "honored" +As shown below, both lines were "carried out" and the Planning Worksheet is cleared. +![Planning Worksheets Results](./planning_worksheets_results.png) + +**Expected Results:** The correct lines should appear when filtering by the action message. Currently, all lines are processed when the "accept action message" is enabled. + +## Description: +Partner is reporting an issue on behalf of their client. The issue is with the Planning Worksheet - Carry Out Action Message when filters are applied to the Planning Worksheet Lines. + +If the client filters to Planning Worksheet Lines by filter to Action Message of 'Cancel', the Carry Out Action Message will process planning lines not selected/shown with the filter. For example. an Action Message of 'New" will be carried out for the Item along with the Cancel line, + +However, if the client filters by an Item No. or Vendor No, for example, the filter is respected. Only the lines "filtered to" will be "carried out". diff --git a/dataset/problemstatement/microsoftInternal__NAV-209835__cf-1/calculate_plan_step4.png b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-1/calculate_plan_step4.png new file mode 100644 index 000000000..a87526af7 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-1/calculate_plan_step4.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-209835__cf-1/message_step7.png b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-1/message_step7.png new file mode 100644 index 000000000..dcb6e0143 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-1/message_step7.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-209835__cf-1/planning_worksheets_results.png b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-1/planning_worksheets_results.png new file mode 100644 index 000000000..958afd108 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-1/planning_worksheets_results.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-209835__cf-1/planning_worksheets_step5.png b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-1/planning_worksheets_step5.png new file mode 100644 index 000000000..350c62331 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-1/planning_worksheets_step5.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-209835__cf-1/planning_worksheets_step6.png b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-1/planning_worksheets_step6.png new file mode 100644 index 000000000..cfe0dd6dc Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-1/planning_worksheets_step6.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-209835__cf-1/purchase_order_step2.png b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-1/purchase_order_step2.png new file mode 100644 index 000000000..843f0c755 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-1/purchase_order_step2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-209835__cf-1/purchase_order_step7.png b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-1/purchase_order_step7.png new file mode 100644 index 000000000..dcb6e0143 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-1/purchase_order_step7.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-209835__cf-1/sales_order2_step3.png b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-1/sales_order2_step3.png new file mode 100644 index 000000000..0c7d2c06b Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-1/sales_order2_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-209835__cf-1/sales_order_step3.png b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-1/sales_order_step3.png new file mode 100644 index 000000000..e3c19ee4b Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-1/sales_order_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-209835__cf-2/Item_card_step1.png b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-2/Item_card_step1.png new file mode 100644 index 000000000..06649b28e Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-2/Item_card_step1.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-209835__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-2/README.md new file mode 100644 index 000000000..612c46d21 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-2/README.md @@ -0,0 +1,42 @@ +# Title: When a Filter is set in the Planning Worksheet to a specific Action Message (e.g. Cancel) and Carry Out Action Message is completed, additional Planning lines are carried out that were not presented. +## Repro Steps: +1- Create a new item with the reordering policy set to "Order". +![Item Card Step1](./Item_card_step1.png) +2- Create a purchase order for the item with the date set to January 1st, but do not post it. +![Purchase Order Step2](./purchase_order_step2.png) +3- Create a sales order for the same item, ensuring the shipment date is set out to a future Date +![Sales Order Step3](./sales_order_step3.png) +![Sales Order2 Step3](./sales_order2_step3.png) +| Type | No. | Item Reference No. | Description | Location Code | Quantity | Qty. to Assemble to Order | Reserved Quantity | Unit of Measure Code | Unit Price Excl. VAT | Line Discount % | Line Amount Excl. VAT | Service Commitments | Customer Contract No. | Vendor Contract No. | Qty. to Ship | Quantity Shipped | Qty. to Invoice | Quantity Invoiced | Qty. to Assign | Item Charge Qty. to Handle | Qty. Assigned | Planned Delivery Date | Planned Shipment Date | Shipment Date | Abteilung Code | Debitorengruppe Code | +| ---- | ---- | ------------------ | ----------- | ------------- | -------- | ------------------------- | ----------------- | -------------------- | -------------------- | --------------- | --------------------- | ------------------- | --------------------- | ------------------- | ------------ | ---------------- | --------------- | ----------------- | -------------- | -------------------------- | ------------- | --------------------- | --------------------- | ------------- | -------------- | -------------------- | +| Item | 1006 | | Test12 | | 4 | | | STÜCK | 10,00 | | 40,00 | 0 | | | 4 | | 4 | | 0 | 0 | 0 | 10.01.2025 | 10.01.2025 | 10.01.2025 | | MITTEL | + +4- Go to the planning worksheet and calculate the regenerative plan. +![Calculate Plan Step4](./calculate_plan_step4.png) +5- Add the vendor number and the vendor for the item, ensuring the two lines are selected correctly. +![Planning Worksheets Step5](./planning_worksheets_step5.png) +6- Filter using the "Vendor No." field to the vendor assigned to the planning lines  +![Planning Worksheets Step6](./planning_worksheets_step6.png) +7- Click the "Carry out Action Message" for the line selected +![Message Step7](./message_step7.png) +![Purchase Order Step7](./purchase_order_step7.png) + +**RESULT:** +When filtering with the Action Message field and specifically the "Cancel" line, the other line was also carried out to generate the New Purchase Order. + +**EXPECTED BEHAVIOR:** +Only the filtered vendor lines will carry out. Planning lines belonging to other vendors must not be processed. +FURTHER CLARIFICATION FROM THE PARTNER (KUMAVISION) +When filtering by Vendor Number or Item Number, as examples, the Carry Out Action Messages works without any issue and as expected. Only the filtered to line is "carried out" when the Carry Out Action Message is processed.  +The perceived problem by the Customer is that this different behavior only occurs when filtering by the Action Message, where the Action Message Filter is not "honored" +As shown below, both lines were "carried out" and the Planning Worksheet is cleared. +![Planning Worksheets Results](./planning_worksheets_results.png) + +**Expected Results:** The correct lines should appear when filtering by the action message. Currently, all lines are processed when the "accept action message" is enabled. + +## Description: +Partner is reporting an issue on behalf of their client. The issue is with the Planning Worksheet - Carry Out Action Message when filters are applied to the Planning Worksheet Lines. + +If the client filters to Planning Worksheet Lines by filter to Action Message of 'Cancel', the Carry Out Action Message will process planning lines not selected/shown with the filter. For example. an Action Message of 'New" will be carried out for the Item along with the Cancel line, + +However, if the client filters by an Item No. or Vendor No, for example, the filter is respected. Only the lines "filtered to" will be "carried out". diff --git a/dataset/problemstatement/microsoftInternal__NAV-209835__cf-2/calculate_plan_step4.png b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-2/calculate_plan_step4.png new file mode 100644 index 000000000..a87526af7 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-2/calculate_plan_step4.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-209835__cf-2/message_step7.png b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-2/message_step7.png new file mode 100644 index 000000000..dcb6e0143 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-2/message_step7.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-209835__cf-2/planning_worksheets_results.png b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-2/planning_worksheets_results.png new file mode 100644 index 000000000..958afd108 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-2/planning_worksheets_results.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-209835__cf-2/planning_worksheets_step5.png b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-2/planning_worksheets_step5.png new file mode 100644 index 000000000..350c62331 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-2/planning_worksheets_step5.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-209835__cf-2/planning_worksheets_step6.png b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-2/planning_worksheets_step6.png new file mode 100644 index 000000000..cfe0dd6dc Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-2/planning_worksheets_step6.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-209835__cf-2/purchase_order_step2.png b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-2/purchase_order_step2.png new file mode 100644 index 000000000..843f0c755 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-2/purchase_order_step2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-209835__cf-2/purchase_order_step7.png b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-2/purchase_order_step7.png new file mode 100644 index 000000000..dcb6e0143 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-2/purchase_order_step7.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-209835__cf-2/sales_order2_step3.png b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-2/sales_order2_step3.png new file mode 100644 index 000000000..0c7d2c06b Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-2/sales_order2_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-209835__cf-2/sales_order_step3.png b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-2/sales_order_step3.png new file mode 100644 index 000000000..e3c19ee4b Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-2/sales_order_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-209835__cf-3/Item_card_step1.png b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-3/Item_card_step1.png new file mode 100644 index 000000000..06649b28e Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-3/Item_card_step1.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-209835__cf-3/README.md b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-3/README.md new file mode 100644 index 000000000..f57f0706f --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-3/README.md @@ -0,0 +1,42 @@ +# Title: When a Filter is set in the Planning Worksheet to a specific Action Message (e.g. Cancel) and Carry Out Action Message is completed, additional Planning lines are carried out that were not presented. +## Repro Steps: +1- Create a new item with the reordering policy set to "Order". +![Item Card Step1](./Item_card_step1.png) +2- Create a purchase order for the item with the date set to January 1st, but do not post it. +![Purchase Order Step2](./purchase_order_step2.png) +3- Create a sales order for the same item, ensuring the shipment date is set out to a future Date +![Sales Order Step3](./sales_order_step3.png) +![Sales Order2 Step3](./sales_order2_step3.png) +| Type | No. | Item Reference No. | Description | Location Code | Quantity | Qty. to Assemble to Order | Reserved Quantity | Unit of Measure Code | Unit Price Excl. VAT | Line Discount % | Line Amount Excl. VAT | Service Commitments | Customer Contract No. | Vendor Contract No. | Qty. to Ship | Quantity Shipped | Qty. to Invoice | Quantity Invoiced | Qty. to Assign | Item Charge Qty. to Handle | Qty. Assigned | Planned Delivery Date | Planned Shipment Date | Shipment Date | Abteilung Code | Debitorengruppe Code | +| ---- | ---- | ------------------ | ----------- | ------------- | -------- | ------------------------- | ----------------- | -------------------- | -------------------- | --------------- | --------------------- | ------------------- | --------------------- | ------------------- | ------------ | ---------------- | --------------- | ----------------- | -------------- | -------------------------- | ------------- | --------------------- | --------------------- | ------------- | -------------- | -------------------- | +| Item | 1006 | | Test12 | | 4 | | | STÜCK | 10,00 | | 40,00 | 0 | | | 4 | | 4 | | 0 | 0 | 0 | 10.01.2025 | 10.01.2025 | 10.01.2025 | | MITTEL | + +4- Go to the planning worksheet and calculate the regenerative plan. +![Calculate Plan Step4](./calculate_plan_step4.png) +5- Add the vendor number and the vendor for the item, ensuring the two lines are selected correctly. +![Planning Worksheets Step5](./planning_worksheets_step5.png) +6- Filter using the "Action message" field to the Cancel Planning Line  +![Planning Worksheets Step6](./planning_worksheets_step6.png) +7- Click the "Carry out Action Message" for the line selected +![Message Step7](./message_step7.png) +![Purchase Order Step7](./purchase_order_step7.png) + +**RESULT:** +When filtering with the Action Message field and specifically the "Cancel" line, the other line was also carried out to generate the New Purchase Order. + +**EXPECTED BEHAVIOR:** +Only the selected line will carry out and the open Purchase Order is cancelled. It is expected that the New Purchase Order is not generated and that the line would remain in the Planning Worksheet Line. +FURTHER CLARIFICATION FROM THE PARTNER (KUMAVISION) +When filtering by Vendor Number or Item Number, as examples, the Carry Out Action Messages works without any issue and as expected. Only the filtered to line is "carried out" when the Carry Out Action Message is processed.  +The perceived problem by the Customer is that filters applied before invoking Carry Out Action Message are not respected during execution +As shown below, both lines were "carried out" and the Planning Worksheet is cleared. +![Planning Worksheets Results](./planning_worksheets_results.png) + +**Expected Results:** Filters applied on the Requisition Line before execution must be preserved and respected during Carry Out Action Message processing. + +## Description: +Partner is reporting an issue on behalf of their client. The issue is with the Planning Worksheet - Carry Out Action Message when filters are applied to the Planning Worksheet Lines. + +If the client filters to Planning Worksheet Lines by filter to Action Message of 'Cancel', the Carry Out Action Message will process planning lines not selected/shown with the filter. For example. an Action Message of 'New" will be carried out for the Item along with the Cancel line, + +However, if the client filters by an Item No. or Vendor No, for example, the filter is respected. Only the lines "filtered to" will be "carried out". diff --git a/dataset/problemstatement/microsoftInternal__NAV-209835__cf-3/calculate_plan_step4.png b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-3/calculate_plan_step4.png new file mode 100644 index 000000000..a87526af7 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-3/calculate_plan_step4.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-209835__cf-3/message_step7.png b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-3/message_step7.png new file mode 100644 index 000000000..dcb6e0143 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-3/message_step7.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-209835__cf-3/planning_worksheets_results.png b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-3/planning_worksheets_results.png new file mode 100644 index 000000000..958afd108 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-3/planning_worksheets_results.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-209835__cf-3/planning_worksheets_step5.png b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-3/planning_worksheets_step5.png new file mode 100644 index 000000000..350c62331 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-3/planning_worksheets_step5.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-209835__cf-3/planning_worksheets_step6.png b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-3/planning_worksheets_step6.png new file mode 100644 index 000000000..cfe0dd6dc Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-3/planning_worksheets_step6.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-209835__cf-3/purchase_order_step2.png b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-3/purchase_order_step2.png new file mode 100644 index 000000000..843f0c755 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-3/purchase_order_step2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-209835__cf-3/purchase_order_step7.png b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-3/purchase_order_step7.png new file mode 100644 index 000000000..dcb6e0143 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-3/purchase_order_step7.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-209835__cf-3/sales_order2_step3.png b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-3/sales_order2_step3.png new file mode 100644 index 000000000..0c7d2c06b Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-3/sales_order2_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-209835__cf-3/sales_order_step3.png b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-3/sales_order_step3.png new file mode 100644 index 000000000..e3c19ee4b Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-209835__cf-3/sales_order_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-210200__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-210200__cf-1/README.md new file mode 100644 index 000000000..efc2d3091 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-210200__cf-1/README.md @@ -0,0 +1,25 @@ +# Title: Using Get Std. Service Codes. on a Sales Order to pull in an Item that has Reserve = Always into the Service Line, there is no Reservation. +## Repro Steps: +1. **Item Card** +![Item Card Step1](./item_card_step1.png) +2. Create Positive Adjustment Item Journal and for BLUE Location for this item for 5 qty and post it. +3. Create Service Item for Customer 30000. +![Service Item Card Step3](./service_item_card_step3.png) +4- Create standard service code for the item: +![Standard Service Code Card Step4](./standard_service_code_card_step4.png) +5- Create service order for BLUE Location, and fill in the fields as following.  Then click on Functions > Get Std. Service Codes then select the ones that you created:  +![Service Card Step5](./service_card_step5.png) +![Standard Serv Item Step5](./standard_serv_item_step5.png) +6- Open the service lines and **filter by ALL** so that you can see the Code you pulled in: +![Service Order Step6](./service_order_step6.png) +![Service Line Step6](./service_line_step6.png) + +**The actual result:** +The item was added with the correct quantity, but 'Reserved Quantity' = blank (You will need to add this field via Personalization): +![Result](./result.png) + +**The expected result:** +The 'Reserve Quantity' = 5  +​If you were to type 2 over in the quantity field, it will then Auto Reserve. + +## Description: diff --git a/dataset/problemstatement/microsoftInternal__NAV-210200__cf-1/item_card_step1.png b/dataset/problemstatement/microsoftInternal__NAV-210200__cf-1/item_card_step1.png new file mode 100644 index 000000000..2ea9a07b7 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-210200__cf-1/item_card_step1.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-210200__cf-1/result.png b/dataset/problemstatement/microsoftInternal__NAV-210200__cf-1/result.png new file mode 100644 index 000000000..a08fbbd91 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-210200__cf-1/result.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-210200__cf-1/service_card_step5.png b/dataset/problemstatement/microsoftInternal__NAV-210200__cf-1/service_card_step5.png new file mode 100644 index 000000000..18071cd80 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-210200__cf-1/service_card_step5.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-210200__cf-1/service_item_card_step3.png b/dataset/problemstatement/microsoftInternal__NAV-210200__cf-1/service_item_card_step3.png new file mode 100644 index 000000000..2d7482280 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-210200__cf-1/service_item_card_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-210200__cf-1/service_line_step6.png b/dataset/problemstatement/microsoftInternal__NAV-210200__cf-1/service_line_step6.png new file mode 100644 index 000000000..d5fbdfd86 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-210200__cf-1/service_line_step6.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-210200__cf-1/service_order_step6.png b/dataset/problemstatement/microsoftInternal__NAV-210200__cf-1/service_order_step6.png new file mode 100644 index 000000000..d750ab8d2 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-210200__cf-1/service_order_step6.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-210200__cf-1/standard_serv_item_step5.png b/dataset/problemstatement/microsoftInternal__NAV-210200__cf-1/standard_serv_item_step5.png new file mode 100644 index 000000000..0b3f580c5 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-210200__cf-1/standard_serv_item_step5.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-210200__cf-1/standard_service_code_card_step4.png b/dataset/problemstatement/microsoftInternal__NAV-210200__cf-1/standard_service_code_card_step4.png new file mode 100644 index 000000000..2459d7612 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-210200__cf-1/standard_service_code_card_step4.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-210200__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-210200__cf-2/README.md new file mode 100644 index 000000000..cc3009b8f --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-210200__cf-2/README.md @@ -0,0 +1,25 @@ +# Title: Using Get Std. Service Codes. on a Sales Order to pull in an Item that has Reserve = Always into the Service Line, there is no Reservation. +## Repro Steps: +1. **Item Card** +![Item Card Step1](./item_card_step1.png) +2. Create Positive Adjustment Item Journal and for BLUE Location for this item for 2 qty and post it. +3. Create Service Item for Customer 30000. +![Service Item Card Step3](./service_item_card_step3.png) +4- Create standard service code with two items, where only one item has Reserve = Always: +![Standard Service Code Card Step4](./standard_service_code_card_step4.png) +5- Create service order for BLUE Location, and fill in the fields as following.  Then click on Functions > Get Std. Service Codes then select the ones that you created:  +![Service Card Step5](./service_card_step5.png) +![Standard Serv Item Step5](./standard_serv_item_step5.png) +6- Open the service lines and **filter by ALL** so that you can see the Code you pulled in: +![Service Order Step6](./service_order_step6.png) +![Service Line Step6](./service_line_step6.png) + +**The actual result:** +The item was added with the correct quantity, but 'Reserved Quantity' = blank (You will need to add this field via Personalization): +![Result](./result.png) + +**The expected result:** +The service line for the item with Reserve = Always must show 'Reserve Quantity' = 2, while the other line must not be auto-reserved.  +​If you were to type 2 over in the quantity field, it will then Auto Reserve. + +## Description: diff --git a/dataset/problemstatement/microsoftInternal__NAV-210200__cf-2/item_card_step1.png b/dataset/problemstatement/microsoftInternal__NAV-210200__cf-2/item_card_step1.png new file mode 100644 index 000000000..2ea9a07b7 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-210200__cf-2/item_card_step1.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-210200__cf-2/result.png b/dataset/problemstatement/microsoftInternal__NAV-210200__cf-2/result.png new file mode 100644 index 000000000..a08fbbd91 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-210200__cf-2/result.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-210200__cf-2/service_card_step5.png b/dataset/problemstatement/microsoftInternal__NAV-210200__cf-2/service_card_step5.png new file mode 100644 index 000000000..18071cd80 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-210200__cf-2/service_card_step5.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-210200__cf-2/service_item_card_step3.png b/dataset/problemstatement/microsoftInternal__NAV-210200__cf-2/service_item_card_step3.png new file mode 100644 index 000000000..2d7482280 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-210200__cf-2/service_item_card_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-210200__cf-2/service_line_step6.png b/dataset/problemstatement/microsoftInternal__NAV-210200__cf-2/service_line_step6.png new file mode 100644 index 000000000..d5fbdfd86 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-210200__cf-2/service_line_step6.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-210200__cf-2/service_order_step6.png b/dataset/problemstatement/microsoftInternal__NAV-210200__cf-2/service_order_step6.png new file mode 100644 index 000000000..d750ab8d2 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-210200__cf-2/service_order_step6.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-210200__cf-2/standard_serv_item_step5.png b/dataset/problemstatement/microsoftInternal__NAV-210200__cf-2/standard_serv_item_step5.png new file mode 100644 index 000000000..0b3f580c5 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-210200__cf-2/standard_serv_item_step5.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-210200__cf-2/standard_service_code_card_step4.png b/dataset/problemstatement/microsoftInternal__NAV-210200__cf-2/standard_service_code_card_step4.png new file mode 100644 index 000000000..2459d7612 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-210200__cf-2/standard_service_code_card_step4.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-210528__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-210528__cf-1/README.md new file mode 100644 index 000000000..9f5faf12f --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-210528__cf-1/README.md @@ -0,0 +1,22 @@ +# Title: Sustainability Value Chain Tracking — Partial Emission Enablement +## Repro Steps: +1. Open the **Sustainability Setup** page +2. Keep all fields in the **Procurement** FastTab disabled +3. Enable the **'Enable Value Chain Tracking'** field + +===RESULT=== +Only the 'Enable Value Chain Tracking' field has been enabled + +===EXPECTED RESULT=== +Enabling this field should also enable the following fields if they are not previously enabled: +* Use Emissions in Purchase Documents +* Item Emissions +* Resource Emissions + +## Description: +This is small improvement. You cannot use Value Chain tracking enabled if you didn't previously enable the following options: +* Use Emissions in Purchase Documents +* Item Emissions +* Resource Emissions + +So, just enable them when you enable the **Enable Value Chain Tracking** field if these fields are not previously already enabled. diff --git a/dataset/problemstatement/microsoftInternal__NAV-211521__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-211521__cf-1/README.md new file mode 100644 index 000000000..a9a3fae3d --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-211521__cf-1/README.md @@ -0,0 +1,23 @@ +# Title: Next Task Date has a fixed System Task Type filter in Contact card +## Repro Steps: +1. Go to Contacts -> Related -> Tasks -> Tasks. + ![Contacts Card](./contacts_card.png) +2. Create Task - Phone Call and click Ok. + ![Create Task](./create_task.png) +3. Go back to the contact card - Next Task Date is empty. + ![Contact Card Step3](./contact_card_step3.png) +4. Drill on the empty value _ It's filtering with fixed System Task Type. + ![Task List](./task_list.png) +5. If you remove it or change it to Organizer - Task will appear. + ![Task Appear](./task_appear.png) + +**Expected Results:** +Next task Date should read the date value correctly. +No System Task Type filter should be applied. + +**Actual Results.** +Fixed filter for System Task Type is applied. +No Next Task Date populates on the Contact Card. + +## Description: +Next Task Date has a fixed System Task Type filter. diff --git a/dataset/problemstatement/microsoftInternal__NAV-211521__cf-1/contact_card_step3.png b/dataset/problemstatement/microsoftInternal__NAV-211521__cf-1/contact_card_step3.png new file mode 100644 index 000000000..545737dd5 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-211521__cf-1/contact_card_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-211521__cf-1/contacts_card.png b/dataset/problemstatement/microsoftInternal__NAV-211521__cf-1/contacts_card.png new file mode 100644 index 000000000..2d7096920 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-211521__cf-1/contacts_card.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-211521__cf-1/create_task.png b/dataset/problemstatement/microsoftInternal__NAV-211521__cf-1/create_task.png new file mode 100644 index 000000000..8a369ddd2 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-211521__cf-1/create_task.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-211521__cf-1/task_appear.png b/dataset/problemstatement/microsoftInternal__NAV-211521__cf-1/task_appear.png new file mode 100644 index 000000000..a0c377b59 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-211521__cf-1/task_appear.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-211521__cf-1/task_list.png b/dataset/problemstatement/microsoftInternal__NAV-211521__cf-1/task_list.png new file mode 100644 index 000000000..f8f4f57f0 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-211521__cf-1/task_list.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-211521__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-211521__cf-2/README.md new file mode 100644 index 000000000..aa495bdf7 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-211521__cf-2/README.md @@ -0,0 +1,23 @@ +# Title: Next Task Date has a fixed System Task Type filter in Contact card +## Repro Steps: +1. Go to Contacts -> Related -> Tasks -> Tasks. + ![Contacts Card](./contacts_card.png) +2. Create Task - Phone Call and click Ok. + ![Create Task](./create_task.png) +3. Go back to the contact card - Next Task Date is empty. + ![Contact Card Step3](./contact_card_step3.png) +4. Drill on the empty value _ It's filtering with fixed System Task Type. + ![Task List](./task_list.png) +5. If you remove it or change it to Organizer - Task will appear. + ![Task Appear](./task_appear.png) + +**Expected Results:** +Next task Date should read the date value correctly. +Next task Date drilldown should not enforce any filtering logic. + +**Actual Results.** +Fixed filter for System Task Type is applied. +No Next Task Date populates on the Contact Card. + +## Description: +Next Task Date has a fixed System Task Type filter. diff --git a/dataset/problemstatement/microsoftInternal__NAV-211521__cf-2/contact_card_step3.png b/dataset/problemstatement/microsoftInternal__NAV-211521__cf-2/contact_card_step3.png new file mode 100644 index 000000000..545737dd5 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-211521__cf-2/contact_card_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-211521__cf-2/contacts_card.png b/dataset/problemstatement/microsoftInternal__NAV-211521__cf-2/contacts_card.png new file mode 100644 index 000000000..2d7096920 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-211521__cf-2/contacts_card.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-211521__cf-2/create_task.png b/dataset/problemstatement/microsoftInternal__NAV-211521__cf-2/create_task.png new file mode 100644 index 000000000..8a369ddd2 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-211521__cf-2/create_task.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-211521__cf-2/task_appear.png b/dataset/problemstatement/microsoftInternal__NAV-211521__cf-2/task_appear.png new file mode 100644 index 000000000..a0c377b59 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-211521__cf-2/task_appear.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-211521__cf-2/task_list.png b/dataset/problemstatement/microsoftInternal__NAV-211521__cf-2/task_list.png new file mode 100644 index 000000000..f8f4f57f0 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-211521__cf-2/task_list.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-211548__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-211548__cf-1/README.md new file mode 100644 index 000000000..d8eed3190 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-211548__cf-1/README.md @@ -0,0 +1,16 @@ +# Title: Issue with posting General Journals that contain Allocation Account lines with 10 entries resulting in the error: "The record in table Gen. Journal Line already exists. +## Repro Steps: +1- Navigate to the Allocation account and create a new G/L account with the number 32170. Add 5 lines as shown in the image. +![Allocation Account Step1](./allocation_account_step1.png) +2- Create another Allocation account with the same 5 lines. +![Allocation Account Step2](./allocation_account_step2.png) +3- Proceed to the general journal and input the lines as the following screenshot. +![General Journal Step3](./general_journal_step3.png) +4- Attempt to post the lines. You will encounter the following error: "The record in table Gen. Journal Line already exists. Identification fields and values: Journal Template Name='GENERAL', Journal Batch Name='DEFAULT', Line No.='40000'." +**![Error Message](./error_message.png) + +****Expected Results**: You should be able to post the lines in the general journal when the account allocation contains 5 lines. +I've tested in GB and W1 and it has the same outcome. + +## Description: +Issue with posting General Journals that contain Allocation Account lines with 10 entries resulting in the error: "The record in table Gen. Journal Line already exists. diff --git a/dataset/problemstatement/microsoftInternal__NAV-211548__cf-1/allocation_account_step1.png b/dataset/problemstatement/microsoftInternal__NAV-211548__cf-1/allocation_account_step1.png new file mode 100644 index 000000000..869380f29 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-211548__cf-1/allocation_account_step1.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-211548__cf-1/allocation_account_step2.png b/dataset/problemstatement/microsoftInternal__NAV-211548__cf-1/allocation_account_step2.png new file mode 100644 index 000000000..dc9d8bc77 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-211548__cf-1/allocation_account_step2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-211548__cf-1/error_message.png b/dataset/problemstatement/microsoftInternal__NAV-211548__cf-1/error_message.png new file mode 100644 index 000000000..3f7a4eed7 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-211548__cf-1/error_message.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-211548__cf-1/general_journal_step3.png b/dataset/problemstatement/microsoftInternal__NAV-211548__cf-1/general_journal_step3.png new file mode 100644 index 000000000..6f01ac203 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-211548__cf-1/general_journal_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-211548__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-211548__cf-2/README.md new file mode 100644 index 000000000..4dbbf79ed --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-211548__cf-2/README.md @@ -0,0 +1,16 @@ +# Title: Issue with posting General Journals that contain Allocation Account lines with 10 entries resulting in the error: "The record in table Gen. Journal Line already exists. +## Repro Steps: +1- Navigate to the Allocation account and create a new G/L account with the number 32170. Add 10 lines as shown in the image. +![Allocation Account Step1](./allocation_account_step1.png) +2- Create two additional Allocation accounts with the same 10 lines. +![Allocation Account Step2](./allocation_account_step2.png) +3- Proceed to the general journal and input the lines as the following screenshot. +![General Journal Step3](./general_journal_step3.png) +4- Attempt to post the lines. You will encounter the following error: "The record in table Gen. Journal Line already exists. Identification fields and values: Journal Template Name='GENERAL', Journal Batch Name='DEFAULT', Line No.='40000'." +**![Error Message](./error_message.png) + +****Expected Results**: You should be able to post the lines in the general journal when the account allocation contains 10 lines. +I've tested in GB and W1 and it has the same outcome. + +## Description: +Issue with posting General Journals that contain Allocation Account lines with 10 entries resulting in the error: "The record in table Gen. Journal Line already exists. diff --git a/dataset/problemstatement/microsoftInternal__NAV-211548__cf-2/allocation_account_step1.png b/dataset/problemstatement/microsoftInternal__NAV-211548__cf-2/allocation_account_step1.png new file mode 100644 index 000000000..869380f29 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-211548__cf-2/allocation_account_step1.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-211548__cf-2/allocation_account_step2.png b/dataset/problemstatement/microsoftInternal__NAV-211548__cf-2/allocation_account_step2.png new file mode 100644 index 000000000..dc9d8bc77 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-211548__cf-2/allocation_account_step2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-211548__cf-2/error_message.png b/dataset/problemstatement/microsoftInternal__NAV-211548__cf-2/error_message.png new file mode 100644 index 000000000..3f7a4eed7 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-211548__cf-2/error_message.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-211548__cf-2/general_journal_step3.png b/dataset/problemstatement/microsoftInternal__NAV-211548__cf-2/general_journal_step3.png new file mode 100644 index 000000000..6f01ac203 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-211548__cf-2/general_journal_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-211710__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-211710__cf-1/README.md new file mode 100644 index 000000000..6bd0a8079 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-211710__cf-1/README.md @@ -0,0 +1,4 @@ +# Title: [Shopify] Suggest payments does NOT match only successful transactions +## Repro Steps: + +## Description: diff --git a/dataset/problemstatement/microsoftInternal__NAV-212355__cf-1/101005test_result.png b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-1/101005test_result.png new file mode 100644 index 000000000..58d4b4309 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-1/101005test_result.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-212355__cf-1/Production_BOMs_step3.png b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-1/Production_BOMs_step3.png new file mode 100644 index 000000000..2c800f472 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-1/Production_BOMs_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-212355__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-1/README.md new file mode 100644 index 000000000..d4f491561 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-1/README.md @@ -0,0 +1,70 @@ +# Title: Input quantity and related production time is not recalculated in a released production order when using the function "Replan" +## Repro Steps: +1. Open BC 25.4 W1 on prem +2. Go to "Routing", create a new routing + Type = serial + Work Center: 100 + Setup Time: 10  + Run Time: 10 + Status: Certified + ![Routing Step2](./routing_step2.png) +3. Go to Production BOMs and create a new one. + Unit of Measure Code: PCS + Item: 70000 + Quantity per: 10 + Status: Certified + ![Production BOMs Step3](./Production_BOMs_step3.png) +4. Go to Items Create a new item (70062) + Use Template: ITEM + Replenishment System = Prod. Order + Manufacturing Policy = Make-to-Stock + Routing = R00010 (Created in step 2) + Production BOM No. = P00010 (Created in step 3) + Reordering policy = Empty + Reserve = Optional + Order Tracking policy = None +5. Go to "Released Production order" - Create a new one + Source type = item + Source No. = Created item in step 4 (70061) + Quantity = 50 + Due date = 28/1/2027 + ->Refresh Production Order + Note that the "starting date-time" on the line is "26/01/2027" while the "ending date-time" is "27/01/2027" + ![Released Production Order Step5](./Released_Production_order_step5.png) +6. Open the Production journal + Line  Production Journal + Post an output of 20 + And a consumption of 200 + Setup Time: 10 + Run Time: 10 + ![Production Journal Step6](./production_journal_step6.png) + Post +7. Go back to the "Released Production Order", note that you now have 20 finished quantities. + ![Released Production Order Step7](./Released_Production_Order_step7.png) +8. Without using the replan function, the input quantity is expected to remain the same and the "Starting date-time" should also be same. + Check the input quantity, for the "Routing" Line -> Routing + Add the field Input Quantity with the Design functionality: + ![Prod Order Routing Step8](./prod_order_routing_step8.png) + Back in the production Order - > Replan the production order + Home -> Replan + ![Replan Production Order Step8](./replan_production_order_step8.png) + + ACTUAL RESULT: + Nothin happened + + EXPECTED RESULT: + The Starting Time should be recalculated based on the Remaining Quantity only when the remaining quantity is greater than zero + ![101005test Result](./101005test_result.png) + And the Input Quantity should be reduced to the Remaining Quantity: + ![Description](./description.png) + + According to the documentation [https://learn.microsoft.com/en-us/dynamics365/business-central/production-how-to-replan-refresh-production-orders](https://learn.microsoft.com/en-us/dynamics365/business-central/production-how-to-replan-refresh-production-orders), looking through, it states that when you select "Plan" as "No Level", it should only update the item schedule, this includes the starting date-time and ending date-time. + ![Result in Additional Information](./result_in_Additional_information.png) + With the present design, if a new routing line or component line is added, it will keep the original quantity instead of taking the remaining quantity. + + ADDITIONAL INFORMATION + I tested in BC 16.5 there the results are as expected: + ![Expected](./expected.png) + +## Description: +Input quantity and related production time is not recalculated in a released production order when using the function "Replan". In Version BC16.5 did it work as expected. diff --git a/dataset/problemstatement/microsoftInternal__NAV-212355__cf-1/Released_Production_Order_step7.png b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-1/Released_Production_Order_step7.png new file mode 100644 index 000000000..235803dab Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-1/Released_Production_Order_step7.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-212355__cf-1/Released_Production_order_step5.png b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-1/Released_Production_order_step5.png new file mode 100644 index 000000000..dd1915464 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-1/Released_Production_order_step5.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-212355__cf-1/description.png b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-1/description.png new file mode 100644 index 000000000..9e44bbf3e Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-1/description.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-212355__cf-1/expected.png b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-1/expected.png new file mode 100644 index 000000000..301ce5b99 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-1/expected.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-212355__cf-1/prod_order_routing_result.png b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-1/prod_order_routing_result.png new file mode 100644 index 000000000..17c2fabb2 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-1/prod_order_routing_result.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-212355__cf-1/prod_order_routing_step8.png b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-1/prod_order_routing_step8.png new file mode 100644 index 000000000..28484da41 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-1/prod_order_routing_step8.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-212355__cf-1/production_journal_step6.png b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-1/production_journal_step6.png new file mode 100644 index 000000000..e16098e79 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-1/production_journal_step6.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-212355__cf-1/replan_production_order_step8.png b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-1/replan_production_order_step8.png new file mode 100644 index 000000000..5fde2a347 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-1/replan_production_order_step8.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-212355__cf-1/result_in_Additional_information.png b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-1/result_in_Additional_information.png new file mode 100644 index 000000000..301ce5b99 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-1/result_in_Additional_information.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-212355__cf-1/routing_step2.png b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-1/routing_step2.png new file mode 100644 index 000000000..f39554a1f Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-1/routing_step2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-212355__cf-2/101005test_result.png b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-2/101005test_result.png new file mode 100644 index 000000000..58d4b4309 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-2/101005test_result.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-212355__cf-2/Production_BOMs_step3.png b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-2/Production_BOMs_step3.png new file mode 100644 index 000000000..2c800f472 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-2/Production_BOMs_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-212355__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-2/README.md new file mode 100644 index 000000000..56718871b --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-2/README.md @@ -0,0 +1,70 @@ +# Title: Input quantity and related production time is not recalculated in a released production order when using the function "Replan" +## Repro Steps: +1. Open BC 25.4 W1 on prem +2. Go to "Routing", create a new routing + Type = serial + Work Center: 100 + Setup Time: 10  + Run Time: 10 + Status: Certified + ![Routing Step2](./routing_step2.png) +3. Go to Production BOMs and create a new one. + Unit of Measure Code: PCS + Item: 70000 + Quantity per: 10 + Status: Certified + ![Production BOMs Step3](./Production_BOMs_step3.png) +4. Go to Items Create a new item (70062) + Use Template: ITEM + Replenishment System = Prod. Order + Manufacturing Policy = Make-to-Stock + Routing = R00010 (Created in step 2) + Production BOM No. = P00010 (Created in step 3) + Reordering policy = Empty + Reserve = Optional + Order Tracking policy = None +5. Go to "Released Production order" - Create a new one + Source type = item + Source No. = Created item in step 4 (70061) + Quantity = 50 + Due date = 28/1/2027 + ->Refresh Production Order + Note that the "starting date-time" on the line is "26/01/2027" while the "ending date-time" is "27/01/2027" + ![Released Production Order Step5](./Released_Production_order_step5.png) +6. Open the Production journal + Line  Production Journal + Post an output of 20 + And a consumption of 200 + Setup Time: 10 + Run Time: 10 + ![Production Journal Step6](./production_journal_step6.png) + Post +7. Go back to the "Released Production Order", note that you now have 20 finished quantities. + ![Released Production Order Step7](./Released_Production_Order_step7.png) +8. Without using the replan function, the input quantity is expected to remain the same and the "Starting date-time" should also be same. + Check the input quantity, for the "Routing" Line -> Routing + Add the field Input Quantity with the Design functionality: + ![Prod Order Routing Step8](./prod_order_routing_step8.png) + Back in the production Order - > Replan the production order + Home -> Replan + ![Replan Production Order Step8](./replan_production_order_step8.png) + + ACTUAL RESULT: + Nothin happened + + EXPECTED RESULT: + The Starting Time should be recalculated based on the Remaining Quantity when replanning is run backward + ![101005test Result](./101005test_result.png) + And the Input Quantity should be reduced to the Remaining Quantity: + ![Description](./description.png) + + According to the documentation [https://learn.microsoft.com/en-us/dynamics365/business-central/production-how-to-replan-refresh-production-orders](https://learn.microsoft.com/en-us/dynamics365/business-central/production-how-to-replan-refresh-production-orders), looking through, it states that when you select "Plan" as "No Level", it should only update the item schedule, this includes the starting date-time and ending date-time. + ![Result in Additional Information](./result_in_Additional_information.png) + With the present design, if a new routing line or component line is added, it will keep the original quantity instead of taking the remaining quantity. + + ADDITIONAL INFORMATION + I tested in BC 16.5 there the results are as expected: + ![Expected](./expected.png) + +## Description: +Input quantity and related production time is not recalculated in a released production order when using the function "Replan". In Version BC16.5 did it work as expected. diff --git a/dataset/problemstatement/microsoftInternal__NAV-212355__cf-2/Released_Production_Order_step7.png b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-2/Released_Production_Order_step7.png new file mode 100644 index 000000000..235803dab Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-2/Released_Production_Order_step7.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-212355__cf-2/Released_Production_order_step5.png b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-2/Released_Production_order_step5.png new file mode 100644 index 000000000..dd1915464 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-2/Released_Production_order_step5.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-212355__cf-2/description.png b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-2/description.png new file mode 100644 index 000000000..9e44bbf3e Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-2/description.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-212355__cf-2/expected.png b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-2/expected.png new file mode 100644 index 000000000..301ce5b99 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-2/expected.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-212355__cf-2/prod_order_routing_result.png b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-2/prod_order_routing_result.png new file mode 100644 index 000000000..17c2fabb2 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-2/prod_order_routing_result.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-212355__cf-2/prod_order_routing_step8.png b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-2/prod_order_routing_step8.png new file mode 100644 index 000000000..28484da41 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-2/prod_order_routing_step8.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-212355__cf-2/production_journal_step6.png b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-2/production_journal_step6.png new file mode 100644 index 000000000..e16098e79 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-2/production_journal_step6.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-212355__cf-2/replan_production_order_step8.png b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-2/replan_production_order_step8.png new file mode 100644 index 000000000..5fde2a347 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-2/replan_production_order_step8.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-212355__cf-2/result_in_Additional_information.png b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-2/result_in_Additional_information.png new file mode 100644 index 000000000..301ce5b99 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-2/result_in_Additional_information.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-212355__cf-2/routing_step2.png b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-2/routing_step2.png new file mode 100644 index 000000000..f39554a1f Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-2/routing_step2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-212355__cf-3/101005test_result.png b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-3/101005test_result.png new file mode 100644 index 000000000..58d4b4309 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-3/101005test_result.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-212355__cf-3/Production_BOMs_step3.png b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-3/Production_BOMs_step3.png new file mode 100644 index 000000000..2c800f472 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-3/Production_BOMs_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-212355__cf-3/README.md b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-3/README.md new file mode 100644 index 000000000..0d7912dd4 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-3/README.md @@ -0,0 +1,70 @@ +# Title: Input quantity and related production time is not recalculated in a released production order when using the function "Replan" +## Repro Steps: +1. Open BC 25.4 W1 on prem +2. Go to "Routing", create a new routing + Type = serial + Work Center: 100 + Setup Time: 10  + Run Time: 10 + Status: Certified + ![Routing Step2](./routing_step2.png) +3. Go to Production BOMs and create a new one. + Unit of Measure Code: PCS + Item: 70000 + Quantity per: 10 + Status: Certified + ![Production BOMs Step3](./Production_BOMs_step3.png) +4. Go to Items Create a new item (70062) + Use Template: ITEM + Replenishment System = Prod. Order + Manufacturing Policy = Make-to-Stock + Routing = R00010 (Created in step 2) + Production BOM No. = P00010 (Created in step 3) + Reordering policy = Empty + Reserve = Optional + Order Tracking policy = None +5. Go to "Released Production order" - Create a new one + Source type = item + Source No. = Created item in step 4 (70061) + Quantity = 50 + Due date = 28/1/2027 + ->Refresh Production Order + Note that the "starting date-time" on the line is "26/01/2027" while the "ending date-time" is "27/01/2027" + ![Released Production Order Step5](./Released_Production_order_step5.png) +6. Open the Production journal + Line  Production Journal + Post an output of 20 + And a consumption of 200 + Setup Time: 10 + Run Time: 10 + ![Production Journal Step6](./production_journal_step6.png) + Post +7. Go back to the "Released Production Order", note that you now have 20 finished quantities. + ![Released Production Order Step7](./Released_Production_Order_step7.png) +8. Without using the replan function, the input quantity is expected to remain the same and the "Starting date-time" should also be same. + Check the input quantity, for the "Routing" Line -> Routing + Add the field Input Quantity with the Design functionality: + ![Prod Order Routing Step8](./prod_order_routing_step8.png) + Back in the production Order - > Replan the production order + Home -> Replan + ![Replan Production Order Step8](./replan_production_order_step8.png) + + ACTUAL RESULT: + Nothin happened + + EXPECTED RESULT: + The Starting Time should be recalculated based on the Remaining Quantity + ![101005test Result](./101005test_result.png) + And the Input Quantity should be reduced to the Remaining Quantity only when output has been posted: + ![Description](./description.png) + + According to the documentation [https://learn.microsoft.com/en-us/dynamics365/business-central/production-how-to-replan-refresh-production-orders](https://learn.microsoft.com/en-us/dynamics365/business-central/production-how-to-replan-refresh-production-orders), looking through, it states that when you select "Plan" as "No Level", it should only update the item schedule, this includes the starting date-time and ending date-time. + ![Result in Additional Information](./result_in_Additional_information.png) + With the present design, if a new routing line or component line is added, it will keep the original quantity instead of taking the remaining quantity. + + ADDITIONAL INFORMATION + I tested in BC 16.5 there the results are as expected: + ![Expected](./expected.png) + +## Description: +Input quantity and related production time is not recalculated in a released production order when using the function "Replan". In Version BC16.5 did it work as expected. diff --git a/dataset/problemstatement/microsoftInternal__NAV-212355__cf-3/Released_Production_Order_step7.png b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-3/Released_Production_Order_step7.png new file mode 100644 index 000000000..235803dab Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-3/Released_Production_Order_step7.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-212355__cf-3/Released_Production_order_step5.png b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-3/Released_Production_order_step5.png new file mode 100644 index 000000000..dd1915464 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-3/Released_Production_order_step5.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-212355__cf-3/description.png b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-3/description.png new file mode 100644 index 000000000..9e44bbf3e Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-3/description.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-212355__cf-3/expected.png b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-3/expected.png new file mode 100644 index 000000000..301ce5b99 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-3/expected.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-212355__cf-3/prod_order_routing_result.png b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-3/prod_order_routing_result.png new file mode 100644 index 000000000..17c2fabb2 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-3/prod_order_routing_result.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-212355__cf-3/prod_order_routing_step8.png b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-3/prod_order_routing_step8.png new file mode 100644 index 000000000..28484da41 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-3/prod_order_routing_step8.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-212355__cf-3/production_journal_step6.png b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-3/production_journal_step6.png new file mode 100644 index 000000000..e16098e79 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-3/production_journal_step6.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-212355__cf-3/replan_production_order_step8.png b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-3/replan_production_order_step8.png new file mode 100644 index 000000000..5fde2a347 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-3/replan_production_order_step8.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-212355__cf-3/result_in_Additional_information.png b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-3/result_in_Additional_information.png new file mode 100644 index 000000000..301ce5b99 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-3/result_in_Additional_information.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-212355__cf-3/routing_step2.png b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-3/routing_step2.png new file mode 100644 index 000000000..f39554a1f Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-212355__cf-3/routing_step2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-213524__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-213524__cf-1/README.md new file mode 100644 index 000000000..a321f1134 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-213524__cf-1/README.md @@ -0,0 +1,21 @@ +# Title: "Unable to navigate to the related document" error message if you use Go to Document from the Intercompany Outbox Transactions for a Credit Memo. +## Repro Steps: +1- Take a BC 25.x environment (W1 issue) +2- Setup Intercompany Postings for 2 different companies. +In my Case CRONUS ES and CRONUS 2. Link Intercompany Customer/Vendors. +I have Automatic Posting activated, but it might have in all Inbox/Outbox Intercompany handled or not handled pages. +3. Create a new Sales Credit Memo for the Intercompany Customer. Post it. +4. Go to the Handled Intercompany Outbox Transactions. +5. Check the last posted document, which is a Credit Memo. +6. Go to the Ribbon, Navigate section, and click on "Go to Document" +================= +ACTUAL RESULTS +================= +"Unable to navigate to the related document" error message if you use Go to Document from the Intercompany Outbox Transactions for a Credit Memo. +================= +EXPECTED RESULTS +================= +We should be able to Navigate to the Credit Memo documents, the same as Invoices/Orders, only when Document No. is not empty + +## Description: +"Unable to navigate to the related document" error message if you use Go to Document from the Intercompany Outbox Transactions for a Credit Memo. diff --git a/dataset/problemstatement/microsoftInternal__NAV-213524__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-213524__cf-2/README.md new file mode 100644 index 000000000..be6dc211c --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-213524__cf-2/README.md @@ -0,0 +1,21 @@ +# Title: "Unable to navigate to the related document" error message if you use Go to Document from the Intercompany Outbox Transactions for a Credit Memo. +## Repro Steps: +1- Take a BC 25.x environment (W1 issue) +2- Setup Intercompany Postings for 2 different companies. +In my Case CRONUS ES and CRONUS 2. Link Intercompany Customer/Vendors. +I have Automatic Posting activated, but it might have in all Inbox/Outbox Intercompany handled or not handled pages. +3. Create a new Sales Credit Memo for the Intercompany Customer. Post it. +4. Go to the Handled Intercompany Outbox Transactions. +5. Check the last posted document, which is a Credit Memo. +6. Go to the Ribbon, Navigate section, and click on "Go to Document" +================= +ACTUAL RESULTS +================= +"Unable to navigate to the related document" error message if you use Go to Document from the Intercompany Outbox Transactions for a Credit Memo. +================= +EXPECTED RESULTS +================= +We should be able to Navigate to the Credit Memo documents, the same as Invoices/Orders, only for handled transactions + +## Description: +"Unable to navigate to the related document" error message if you use Go to Document from the Intercompany Outbox Transactions for a Credit Memo. diff --git a/dataset/problemstatement/microsoftInternal__NAV-213524__cf-3/README.md b/dataset/problemstatement/microsoftInternal__NAV-213524__cf-3/README.md new file mode 100644 index 000000000..31c08c9a7 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-213524__cf-3/README.md @@ -0,0 +1,21 @@ +# Title: "Unable to navigate to the related document" error message if you use Go to Document from the Intercompany Outbox Transactions for a Credit Memo. +## Repro Steps: +1- Take a BC 25.x environment (W1 issue) +2- Setup Intercompany Postings for 2 different companies. +In my Case CRONUS ES and CRONUS 2. Link Intercompany Customer/Vendors. +I have Automatic Posting activated, but it might have in all Inbox/Outbox Intercompany handled or not handled pages. +3. Create a new Sales Credit Memo for the Intercompany Customer. Post it. +4. Go to the Handled Intercompany Outbox Transactions. +5. Check the last posted document, which is a Credit Memo. +6. Go to the Ribbon, Navigate section, and click on "Go to Document" +================= +ACTUAL RESULTS +================= +"Unable to navigate to the related document" error message if you use Go to Document from the Intercompany Outbox Transactions for a Credit Memo. +================= +EXPECTED RESULTS +================= +We should be able to Navigate to the Credit Memo documents, the same as Invoices/Orders, only if the document exists + +## Description: +"Unable to navigate to the related document" error message if you use Go to Document from the Intercompany Outbox Transactions for a Credit Memo. diff --git a/dataset/problemstatement/microsoftInternal__NAV-213524__cf-4/README.md b/dataset/problemstatement/microsoftInternal__NAV-213524__cf-4/README.md new file mode 100644 index 000000000..05b637a7c --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-213524__cf-4/README.md @@ -0,0 +1,21 @@ +# Title: "Unable to navigate to the related document" error message if you use Go to Document from the Intercompany Outbox Transactions for a Credit Memo. +## Repro Steps: +1- Take a BC 25.x environment (W1 issue) +2- Setup Intercompany Postings for 2 different companies. +In my Case CRONUS ES and CRONUS 2. Link Intercompany Customer/Vendors. +I have Automatic Posting activated, but it might have in all Inbox/Outbox Intercompany handled or not handled pages. +3. Create a new Sales Credit Memo for the Intercompany Customer. Post it. +4. Go to the Handled Intercompany Outbox Transactions. +5. Check the last posted document, which is a Credit Memo. +6. Go to the Ribbon, Navigate section, and click on "Go to Document" +================= +ACTUAL RESULTS +================= +"Unable to navigate to the related document" error message if you use Go to Document from the Intercompany Outbox Transactions for a Credit Memo. +================= +EXPECTED RESULTS +================= +We should be able to Navigate to the Credit Memo documents, the same as Invoices/Orders, with Document No. up to 50 characters + +## Description: +"Unable to navigate to the related document" error message if you use Go to Document from the Intercompany Outbox Transactions for a Credit Memo. diff --git a/dataset/problemstatement/microsoftInternal__NAV-213629__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-213629__cf-1/README.md new file mode 100644 index 000000000..4872389b1 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-213629__cf-1/README.md @@ -0,0 +1,30 @@ +# Title: Copy project: System-Created Entry must be equal to 'No' in Project Planning Line +## Repro Steps: +Create a Project1 for any customer (10000) +Make sure that Apply Usage Link is Enabled (posting tab) +Add new Task1 (Code = 1). No planning lines. + +Navigate to project journal and add new line: +Type = Both Budget and Billable. Project1/ Task1 - created earlier. Some document number. Some resource with quantity. +Post. + +Return to project1, task one. Navigate to project planning lines. +Now there is line. If you use page inspector you can see that System Created Entry = Yes. + +Create project2 for same customer. +Choose the "Copy Project Task from" action and select Project1. Remember to activate Copy Quantity toggle in the Apply fasttab. +Select copied Task1 and choose Project Planning Lines. +Select planning line with item and choose "Create Project Journal Line" action. Choose Ok. + +Result - Error message: +System-Created Entry must be equal to 'No' in Project Planning Line: Project No.=PR00050, Project Task No.=1, Line No.=10000. Current value is 'Yes'. +AL call stack: +"Job Journal Line"(Table 210)."Job Planning Line No. - OnValidate"(Trigger) line 14 - Base Application by Microsoft +"Job Journal Line"(Table 210)."Quantity - OnValidate"(Trigger) line 18 - Base Application by Microsoft +"Job Journal Line"(Table 210)."Unit of Measure Code - OnValidate"(Trigger) line 47 - Base Application by Microsoft +"Job Transfer Line"(CodeUnit 1004).FromPlanningLineToJnlLine line 60 - Base Application by Microsoft +"Job Planning Lines"(Page 1007)."CreateJobJournalLines - OnAction"(Trigger) line 14 - Base Application by Microsoft + +Expected - remove "system-Created Entry" mark only when planning line Type is Item. + +## Description: diff --git a/dataset/problemstatement/microsoftInternal__NAV-213629__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-213629__cf-2/README.md new file mode 100644 index 000000000..caacd2c44 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-213629__cf-2/README.md @@ -0,0 +1,30 @@ +# Title: Copy project: System-Created Entry must be equal to 'No' in Project Planning Line +## Repro Steps: +Create a Project1 for any customer (10000) +Make sure that Apply Usage Link is Enabled (posting tab) +Add new Task1 (Code = 1). No planning lines. + +Navigate to project journal and add new line: +Type = Both Budget and Billable. Project1/ Task1 - created earlier. Some document number. Some item with quantity. +Post. + +Return to project1, task one. Navigate to project planning lines. +Now there is line. If you use page inspector you can see that System Created Entry = Yes. + +Create project2 for same customer. +Choose the "Copy Project Task from" action and select Project1. Remember to activate Copy Quantity toggle in the Apply fasttab. +Select copied Task1 and choose Project Planning Lines. +Select planning line with item and choose "Create Project Journal Line" action. Choose Ok. + +Result - Error message: +System-Created Entry must be equal to 'No' in Project Planning Line: Project No.=PR00050, Project Task No.=1, Line No.=10000. Current value is 'Yes'. +AL call stack: +"Job Journal Line"(Table 210)."Job Planning Line No. - OnValidate"(Trigger) line 14 - Base Application by Microsoft +"Job Journal Line"(Table 210)."Quantity - OnValidate"(Trigger) line 18 - Base Application by Microsoft +"Job Journal Line"(Table 210)."Unit of Measure Code - OnValidate"(Trigger) line 47 - Base Application by Microsoft +"Job Transfer Line"(CodeUnit 1004).FromPlanningLineToJnlLine line 60 - Base Application by Microsoft +"Job Planning Lines"(Page 1007)."CreateJobJournalLines - OnAction"(Trigger) line 14 - Base Application by Microsoft + +Expected - remove "system-Created Entry" mark only when Copy Quantity is enabled. + +## Description: diff --git a/dataset/problemstatement/microsoftInternal__NAV-213629__cf-3/README.md b/dataset/problemstatement/microsoftInternal__NAV-213629__cf-3/README.md new file mode 100644 index 000000000..7d34e50b0 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-213629__cf-3/README.md @@ -0,0 +1,30 @@ +# Title: Copy project: System-Created Entry must be equal to 'No' in Project Planning Line +## Repro Steps: +Create a Project1 for any customer (10000) +Make sure that Apply Usage Link is Enabled (posting tab) +Add new Task1 (Code = 1). No planning lines. + +Navigate to project journal and add new line: +Type = Billable. Project1/ Task1 - created earlier. Some document number. Some item with quantity. +Post. + +Return to project1, task one. Navigate to project planning lines. +Now there is line. If you use page inspector you can see that System Created Entry = Yes. + +Create project2 for same customer. +Choose the "Copy Project Task from" action and select Project1. Remember to activate Copy Quantity toggle in the Apply fasttab. +Select copied Task1 and choose Project Planning Lines. +Select planning line with item and choose "Create Project Journal Line" action. Choose Ok. + +Result - Error message: +System-Created Entry must be equal to 'No' in Project Planning Line: Project No.=PR00050, Project Task No.=1, Line No.=10000. Current value is 'Yes'. +AL call stack: +"Job Journal Line"(Table 210)."Job Planning Line No. - OnValidate"(Trigger) line 14 - Base Application by Microsoft +"Job Journal Line"(Table 210)."Quantity - OnValidate"(Trigger) line 18 - Base Application by Microsoft +"Job Journal Line"(Table 210)."Unit of Measure Code - OnValidate"(Trigger) line 47 - Base Application by Microsoft +"Job Transfer Line"(CodeUnit 1004).FromPlanningLineToJnlLine line 60 - Base Application by Microsoft +"Job Planning Lines"(Page 1007)."CreateJobJournalLines - OnAction"(Trigger) line 14 - Base Application by Microsoft + +Expected - remove "system-Created Entry" mark only when source line type is Both Budget and Billable. + +## Description: diff --git a/dataset/problemstatement/microsoftInternal__NAV-213671__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-213671__cf-1/README.md new file mode 100644 index 000000000..b35e55fc0 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-213671__cf-1/README.md @@ -0,0 +1,65 @@ +# Title: Filter text should be truncated to avoid exceeding maximum allowed length when working with Opportunities +## Repro Steps: +**Tenant ID: d4375267-18fa-45eb-a481-878b4f897d2a - Sandbox_Test Version 26.0** +Microsoft Entra tenant ID: d4375267-18fa-45eb-a481-878b4f897d2a, Environment: Sandbox_Test (Sandbox) +Session ID (client): b731c145-19f9-4ad0-aba5-58053fdb3e99 +Session ID (server): 447 +User telemetry ID: 3c8d2e73-c2c0-4f0a-8aef-83c9e9df63ee + +Error message:  +The length of the string is 38, but it must be less than or equal to 20 characters. Value: BC|EH|HR|JO|LT|MM|JJ|KK|OO|PP|YY|QQ|LL + +Page Opportunities has to close. + +Internal session ID:  +47b85a60-e6ec-48cb-8bb0-7469b1274532 + +Application Insights session ID:  +b731c145-19f9-4ad0-aba5-58053fdb3e99 + +Client activity id:  +f90a9860-431b-4a77-9566-62a87f3aead4 + +Time stamp on error:  +2025-04-16T13:48:58.3512353Z + +User telemetry id:  +3c8d2e73-c2c0-4f0a-8aef-83c9e9df63ee + +AL call stack:  +"Opportunity List"(Page 5123).BuildCaption line 10 - Base Application by Microsoft +"Opportunity List"(Page 5123).BuildCaptionSalespersonPurchaser line 4 - Base Application by Microsoft +"Opportunity List"(Page 5123).Caption line 4 - Base Application by Microsoft + +------------------------------------------------------------------------------------------------------------------------------------------- + +**Tenant ID: ac21b43d-8217-4402-8e7c-700330744b0e - DataTesting Version 25.5** +1. Session ID is 576511 – user LHOLOWESKO in tenant ac21b43d-8217-4402-8e7c-700330744b0e +2. If requesting support, please provide the following details to help troubleshooting: + + Error message:  + The length of the string is 52, but it must be less than or equal to 20 characters. Value: HORNING-K|CHAMBERS-T|CRIST-B|MARKERT-T-JR|HARRISON-W + + Page Opportunities has to close. + + Internal session ID:  + 8f3ae419-1db5-45e1-b370-4e12549c02b4 + + Application Insights session ID:  + 37cbd2ee-da46-49fa-81d0-0760fc18f051 + + Client activity id:  + 720c9ff9-ab2d-4751-9a2a-cd10972e7373 + + Time stamp on error:  + 2025-04-15T21:37:42.6273887Z + + User telemetry id:  + df278d23-329c-424d-abf4-97462cc30e8d + + AL call stack:  + "Opportunity List"(Page 5123).BuildCaption line 10 - Base Application by Microsoft + "Opportunity List"(Page 5123).BuildCaptionSalespersonPurchaser line 4 - Base Application by Microsoft + "Opportunity List"(Page 5123).Caption line 4 - Base Application by Microsoft + +## Description: diff --git a/dataset/problemstatement/microsoftInternal__NAV-213671__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-213671__cf-2/README.md new file mode 100644 index 000000000..2b0bc9707 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-213671__cf-2/README.md @@ -0,0 +1,64 @@ +# Title: The length of the string is XX but it must be less than or equal to 20 characters when working with Opportunities +## Repro Steps: +**Tenant ID: d4375267-18fa-45eb-a481-878b4f897d2a - Sandbox_Test Version 26.0** +Microsoft Entra tenant ID: d4375267-18fa-45eb-a481-878b4f897d2a, Environment: Sandbox_Test (Sandbox) +Session ID (client): b731c145-19f9-4ad0-aba5-58053fdb3e99 +Session ID (server): 447 +User telemetry ID: 3c8d2e73-c2c0-4f0a-8aef-83c9e9df63ee + +Error message:  +The length of the string is 18, but it must be less than or equal to 20 characters. Value: BC|EH|HR|JO|LT +Page Opportunities has to close. + +Internal session ID:  +47b85a60-e6ec-48cb-8bb0-7469b1274532 + +Application Insights session ID:  +b731c145-19f9-4ad0-aba5-58053fdb3e99 + +Client activity id:  +f90a9860-431b-4a77-9566-62a87f3aead4 + +Time stamp on error:  +2025-04-16T13:48:58.3512353Z + +User telemetry id:  +3c8d2e73-c2c0-4f0a-8aef-83c9e9df63ee + +AL call stack:  +"Opportunity List"(Page 5123).BuildCaption line 10 - Base Application by Microsoft +"Opportunity List"(Page 5123).BuildCaptionSalespersonPurchaser line 4 - Base Application by Microsoft +"Opportunity List"(Page 5123).Caption line 4 - Base Application by Microsoft + +------------------------------------------------------------------------------------------------------------------------------------------- + +**Tenant ID: ac21b43d-8217-4402-8e7c-700330744b0e - DataTesting Version 25.5** +1. Session ID is 576511 – user LHOLOWESKO in tenant ac21b43d-8217-4402-8e7c-700330744b0e +2. If requesting support, please provide the following details to help troubleshooting: + + Error message:  + The length of the string is 52, but it must be less than or equal to 20 characters. Value: HORNING-K|CHAMBERS-T|CRIST-B|MARKERT-T-JR|HARRISON-W + + Page Opportunities has to close. + + Internal session ID:  + 8f3ae419-1db5-45e1-b370-4e12549c02b4 + + Application Insights session ID:  + 37cbd2ee-da46-49fa-81d0-0760fc18f051 + + Client activity id:  + 720c9ff9-ab2d-4751-9a2a-cd10972e7373 + + Time stamp on error:  + 2025-04-15T21:37:42.6273887Z + + User telemetry id:  + df278d23-329c-424d-abf4-97462cc30e8d + + AL call stack:  + "Opportunity List"(Page 5123).BuildCaption line 10 - Base Application by Microsoft + "Opportunity List"(Page 5123).BuildCaptionSalespersonPurchaser line 4 - Base Application by Microsoft + "Opportunity List"(Page 5123).Caption line 4 - Base Application by Microsoft + +## Description: diff --git a/dataset/problemstatement/microsoftInternal__NAV-213683__cf-1/1005_table_step2.png b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-1/1005_table_step2.png new file mode 100644 index 000000000..f8b4c514d Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-1/1005_table_step2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-213683__cf-1/1233_radio.png b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-1/1233_radio.png new file mode 100644 index 000000000..cad5a8c0d Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-1/1233_radio.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-213683__cf-1/9632_radio.png b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-1/9632_radio.png new file mode 100644 index 000000000..ab14d647c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-1/9632_radio.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-213683__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-1/README.md new file mode 100644 index 000000000..7dda3a91a --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-1/README.md @@ -0,0 +1,31 @@ +# Title: Rename Item No. should always be allowed regardless of existing Value Entries with Variant Codes +## Repro Steps: +In Version 26 - An error occurs when Attempting to Renumber an Item No. when the Item has Variant Codes and Item Ledger Entries and Value Entries posted for the Item and Variant Codes. +1.Create a new item - Item: Table - No: 1005 +![Item Card Step1](./item_card_step1.png) +2.In the Item created add a variant=Related=item=related +![Item Card Step2](./item_card_step2.png) +Variant=GREY AND ASH +![1005 Table Step2](./1005_table_step2.png) +3.Go to item journal to get some quantities for the Item created include the variant and post each. +![Item Journals Step3](./item_journals_step3.png) +![Item Journals2 Step3](./item_journals2_step3.png) +![Message Step3](./message_step3.png) +4.Create a sale invoice for the Item TABLE without the variant and post +![Sales Invoice Step4](./sales_invoice_step4.png) +![Message Step4](./message_step4.png) +5.Create a sales invoice with Item "TABLE" include the variant and post +![Sales Invoice Step5](./sales_invoice_step5.png) +![Message Step5](./message_step5.png) +6.Make an attempt to change the item No" you receive the error message stating: You cannot rename Item No. in a Item Variant, because it is used in Value Entry. +![Error step6](./error_step6.png) +I attempted to perform more tests, and in previous versions like 25.5, I could change the Item No. without any errors. +Could this be a new change or possibly a bug? +Before +![9632 Radio](./9632_radio.png) +After +![1233 Radio](./1233_radio.png) + +## Description: +Issue: An Error Occurs When Attempting to Change Item No. After Posting and Generating Item Ledger Entries and Value Entries in Version 26.0 with Items and Variant Codes involved. +The issue did not occur in Version 25.X Version or earlier. Was this a Design Change or is the an issue in the new version. If it is By Design, is there a reason for the change? diff --git a/dataset/problemstatement/microsoftInternal__NAV-213683__cf-1/error_step6.png b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-1/error_step6.png new file mode 100644 index 000000000..49e0553d7 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-1/error_step6.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-213683__cf-1/item_card_step1.png b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-1/item_card_step1.png new file mode 100644 index 000000000..44c79963e Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-1/item_card_step1.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-213683__cf-1/item_card_step2.png b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-1/item_card_step2.png new file mode 100644 index 000000000..ef4ca7234 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-1/item_card_step2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-213683__cf-1/item_journals2_step3.png b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-1/item_journals2_step3.png new file mode 100644 index 000000000..3ce0a444b Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-1/item_journals2_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-213683__cf-1/item_journals_step3.png b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-1/item_journals_step3.png new file mode 100644 index 000000000..ae8c7747d Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-1/item_journals_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-213683__cf-1/message_step3.png b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-1/message_step3.png new file mode 100644 index 000000000..549bc3f2a Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-1/message_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-213683__cf-1/message_step4.png b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-1/message_step4.png new file mode 100644 index 000000000..54a207f44 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-1/message_step4.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-213683__cf-1/message_step5.png b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-1/message_step5.png new file mode 100644 index 000000000..54a207f44 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-1/message_step5.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-213683__cf-1/sales_invoice_step4.png b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-1/sales_invoice_step4.png new file mode 100644 index 000000000..562616472 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-1/sales_invoice_step4.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-213683__cf-1/sales_invoice_step5.png b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-1/sales_invoice_step5.png new file mode 100644 index 000000000..e31381051 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-1/sales_invoice_step5.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-213683__cf-2/1005_table_step2.png b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-2/1005_table_step2.png new file mode 100644 index 000000000..f8b4c514d Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-2/1005_table_step2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-213683__cf-2/1233_radio.png b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-2/1233_radio.png new file mode 100644 index 000000000..cad5a8c0d Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-2/1233_radio.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-213683__cf-2/9632_radio.png b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-2/9632_radio.png new file mode 100644 index 000000000..ab14d647c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-2/9632_radio.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-213683__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-2/README.md new file mode 100644 index 000000000..05dbc2b2c --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-2/README.md @@ -0,0 +1,31 @@ +# Title: Rename should only be validated when system triggers are disabled for Item Variant rename +## Repro Steps: +In Version 26 - An error occurs when Attempting to Renumber an Item No. when the Item has Variant Codes and Item Ledger Entries and Value Entries posted for the Item and Variant Codes. +1.Create a new item - Item: Table - No: 1005 +![Item Card Step1](./item_card_step1.png) +2.In the Item created add a variant=Related=item=related +![Item Card Step2](./item_card_step2.png) +Variant=GREY AND ASH +![1005 Table Step2](./1005_table_step2.png) +3.Go to item journal to get some quantities for the Item created include the variant and post each. +![Item Journals Step3](./item_journals_step3.png) +![Item Journals2 Step3](./item_journals2_step3.png) +![Message Step3](./message_step3.png) +4.Create a sale invoice for the Item TABLE without the variant and post +![Sales Invoice Step4](./sales_invoice_step4.png) +![Message Step4](./message_step4.png) +5.Create a sales invoice with Item "TABLE" include the variant and post +![Sales Invoice Step5](./sales_invoice_step5.png) +![Message Step5](./message_step5.png) +6.Make an attempt to change the item No" you receive the error message stating: You cannot rename Item No. in a Item Variant, because it is used in Value Entry. +![Error step6](./error_step6.png) +I attempted to perform more tests, and in previous versions like 25.5, I could change the Item No. without any errors. +Could this be a new change or possibly a bug? +Before +![9632 Radio](./9632_radio.png) +After +![1233 Radio](./1233_radio.png) + +## Description: +Issue: An Error Occurs When Attempting to Change Item No. After Posting and Generating Item Ledger Entries and Value Entries in Version 26.0 with Items and Variant Codes involved. +The issue did not occur in Version 25.X Version or earlier. Was this a Design Change or is the an issue in the new version. If it is By Design, is there a reason for the change? diff --git a/dataset/problemstatement/microsoftInternal__NAV-213683__cf-2/error_step6.png b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-2/error_step6.png new file mode 100644 index 000000000..49e0553d7 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-2/error_step6.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-213683__cf-2/item_card_step1.png b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-2/item_card_step1.png new file mode 100644 index 000000000..44c79963e Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-2/item_card_step1.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-213683__cf-2/item_card_step2.png b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-2/item_card_step2.png new file mode 100644 index 000000000..ef4ca7234 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-2/item_card_step2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-213683__cf-2/item_journals2_step3.png b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-2/item_journals2_step3.png new file mode 100644 index 000000000..3ce0a444b Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-2/item_journals2_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-213683__cf-2/item_journals_step3.png b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-2/item_journals_step3.png new file mode 100644 index 000000000..ae8c7747d Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-2/item_journals_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-213683__cf-2/message_step3.png b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-2/message_step3.png new file mode 100644 index 000000000..549bc3f2a Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-2/message_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-213683__cf-2/message_step4.png b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-2/message_step4.png new file mode 100644 index 000000000..54a207f44 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-2/message_step4.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-213683__cf-2/message_step5.png b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-2/message_step5.png new file mode 100644 index 000000000..54a207f44 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-2/message_step5.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-213683__cf-2/sales_invoice_step4.png b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-2/sales_invoice_step4.png new file mode 100644 index 000000000..562616472 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-2/sales_invoice_step4.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-213683__cf-2/sales_invoice_step5.png b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-2/sales_invoice_step5.png new file mode 100644 index 000000000..e31381051 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-2/sales_invoice_step5.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-213683__cf-3/1005_table_step2.png b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-3/1005_table_step2.png new file mode 100644 index 000000000..f8b4c514d Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-3/1005_table_step2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-213683__cf-3/1233_radio.png b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-3/1233_radio.png new file mode 100644 index 000000000..cad5a8c0d Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-3/1233_radio.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-213683__cf-3/9632_radio.png b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-3/9632_radio.png new file mode 100644 index 000000000..ab14d647c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-3/9632_radio.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-213683__cf-3/README.md b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-3/README.md new file mode 100644 index 000000000..b85edcb6a --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-3/README.md @@ -0,0 +1,31 @@ +# Title: Rename Item No. should fail only when Variant Code exists in entries for the Item +## Repro Steps: +In Version 26 - An error occurs when Attempting to Renumber an Item No. when the Item has Variant Codes and Item Ledger Entries and Value Entries posted for the Item and Variant Codes. +1.Create a new item - Item: Table - No: 1005 +![Item Card Step1](./item_card_step1.png) +2.In the Item created add a variant=Related=item=related +![Item Card Step2](./item_card_step2.png) +Variant=GREY AND ASH +![1005 Table Step2](./1005_table_step2.png) +3.Go to item journal to get some quantities for the Item created include the variant and post each. +![Item Journals Step3](./item_journals_step3.png) +![Item Journals2 Step3](./item_journals2_step3.png) +![Message Step3](./message_step3.png) +4.Create a sale invoice for the Item TABLE without the variant and post +![Sales Invoice Step4](./sales_invoice_step4.png) +![Message Step4](./message_step4.png) +5.Create a sales invoice with Item "TABLE" include the variant and post +![Sales Invoice Step5](./sales_invoice_step5.png) +![Message Step5](./message_step5.png) +6.Make an attempt to change the item No" you receive the error message stating: You cannot rename Item No. in a Item Variant, because it is used in Value Entry. +![Error step6](./error_step6.png) +I attempted to perform more tests, and in previous versions like 25.5, I could change the Item No. without any errors. +Could this be a new change or possibly a bug? +Before +![9632 Radio](./9632_radio.png) +After +![1233 Radio](./1233_radio.png) + +## Description: +Issue: An Error Occurs When Attempting to Change Item No. After Posting and Generating Item Ledger Entries and Value Entries in Version 26.0 with Items and Variant Codes involved. +The issue did not occur in Version 25.X Version or earlier. Was this a Design Change or is the an issue in the new version. If it is By Design, is there a reason for the change? diff --git a/dataset/problemstatement/microsoftInternal__NAV-213683__cf-3/error_step6.png b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-3/error_step6.png new file mode 100644 index 000000000..49e0553d7 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-3/error_step6.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-213683__cf-3/item_card_step1.png b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-3/item_card_step1.png new file mode 100644 index 000000000..44c79963e Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-3/item_card_step1.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-213683__cf-3/item_card_step2.png b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-3/item_card_step2.png new file mode 100644 index 000000000..ef4ca7234 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-3/item_card_step2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-213683__cf-3/item_journals2_step3.png b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-3/item_journals2_step3.png new file mode 100644 index 000000000..3ce0a444b Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-3/item_journals2_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-213683__cf-3/item_journals_step3.png b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-3/item_journals_step3.png new file mode 100644 index 000000000..ae8c7747d Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-3/item_journals_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-213683__cf-3/message_step3.png b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-3/message_step3.png new file mode 100644 index 000000000..549bc3f2a Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-3/message_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-213683__cf-3/message_step4.png b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-3/message_step4.png new file mode 100644 index 000000000..54a207f44 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-3/message_step4.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-213683__cf-3/message_step5.png b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-3/message_step5.png new file mode 100644 index 000000000..54a207f44 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-3/message_step5.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-213683__cf-3/sales_invoice_step4.png b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-3/sales_invoice_step4.png new file mode 100644 index 000000000..562616472 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-3/sales_invoice_step4.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-213683__cf-3/sales_invoice_step5.png b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-3/sales_invoice_step5.png new file mode 100644 index 000000000..e31381051 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-213683__cf-3/sales_invoice_step5.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-213741__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-213741__cf-1/README.md new file mode 100644 index 000000000..f5f56b80c --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-213741__cf-1/README.md @@ -0,0 +1,38 @@ +# Title: Missing handling of "Direct Cost - Non Inventory" cost type for assemblies in "Inventory Posting to G/L" codeunit. +## Repro Steps: +The codeunit "Inventory Posting To G/L" has a handler for the new "Direct Cost - Non Inventory" cost type in BufferOutputPosting function, and it should also allow this cost type for Assembly Output when manufacturing setup permits it. + +**Call stack a partner has reported:** +Inventory Posting To G/L(CodeUnit 5802).BufferAsmOutputPosting line 70 - Base Application by Microsoft +Inventory Posting To G/L(CodeUnit 5802).BufferInvtPosting line 62 - Base Application by Microsoft +Item Jnl.-Post Line(CodeUnit 22).PostInvtBuffer line 2 - Base Application by Microsoft +Item Jnl.-Post Line(CodeUnit 22).PostValueEntryToGL line 4 - Base Application by Microsoft +Item Jnl.-Post Line(CodeUnit 22).PostInventoryToGL line 22 - Base Application by Microsoft +Item Jnl.-Post Line(CodeUnit 22).InsertValueEntry line 82 - Base Application by Microsoft +Item Jnl.-Post Line(CodeUnit 22).ItemValuePosting line 28 - Base Application by Microsoft +Item Jnl.-Post Line(CodeUnit 22).CheckRunItemValuePosting line 12 - Base Application by Microsoft +Item Jnl.-Post Line(CodeUnit 22).PostItem line 83 - Base Application by Microsoft +Item Jnl.-Post Line(CodeUnit 22).Code line 137 - Base Application by Microsoft +Item Jnl.-Post Line(CodeUnit 22).PostSplitJnlLine line 12 - Base Application by Microsoft +Item Jnl.-Post Line(CodeUnit 22).RunWithCheck line 16 - Base Application by Microsoft +Inventory Adjustment(CodeUnit 5895).PostItemJnlLine line 57 - Base Application by Microsoft +Inventory Adjustment(CodeUnit 5895).PostOutput line 30 - Base Application by Microsoft +Inventory Adjustment(CodeUnit 5895).PostOutputAdjmtBuf line 5 - Base Application by Microsoft +Inventory Adjustment(CodeUnit 5895).MakeAssemblyAdjmt line 18 - Base Application by Microsoft +Inventory Adjustment(CodeUnit 5895).MakeMultiLevelAdjmt line 22 - Base Application by Microsoft +Inventory Adjustment(CodeUnit 5895).MakeMultiLevelAdjmt line 15 - Base Application by Microsoft +Inventory Adjustment Handler(CodeUnit 5894).MakeInventoryAdjustment line 16 - Base Application by Microsoft +Cost Adjustment Item Runner(CodeUnit 5823).OnRun(Trigger) line 8 - Base Application by Microsoft +Adjust Cost - Item Entries(Report 795).RunCostAdjus + +**Repro steps from a partner:** +I was doing some testing, and when i run the cost adjustment report it showed this error. +The following combination Item Ledger Entry Type = Assembly Output, Entry Type = Direct Cost - Non Inventory, and Expected Cost = No is not allowed. +But i do not have this combination on value entries. +Check image "Value entries" I am not quite sure why is showing this message. +Error message: The following combination Item Ledger Entry Type = Assembly Output, Entry Type = Direct Cost - Non Inventory, and Expected Cost = No is required. +AL call stack: "Adjust Cost - Item Entries"(Report 795).RunCostAdjustmentWithLogging line 22 - Base Application by Microsoft +" Adjust Cost - Item Entries"(Report 795).OnPreReport(Trigger) line 19 - Base Application by Microsoft +Thank you. +Best regard +## Description: diff --git a/dataset/problemstatement/microsoftInternal__NAV-213741__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-213741__cf-2/README.md new file mode 100644 index 000000000..e3112224c --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-213741__cf-2/README.md @@ -0,0 +1,38 @@ +# Title: Missing handling of "Direct Cost - Non Inventory" cost type for assemblies in "Inventory Posting to G/L" codeunit. +## Repro Steps: +The codeunit "Inventory Posting To G/L" has a handler for the new "Direct Cost - Non Inventory" cost type in BufferOutputPosting function, and it should also allow this cost type for Assembly Output when manufacturing setup permits it and Expected Cost is enabled. + +**Call stack a partner has reported:** +Inventory Posting To G/L(CodeUnit 5802).BufferAsmOutputPosting line 70 - Base Application by Microsoft +Inventory Posting To G/L(CodeUnit 5802).BufferInvtPosting line 62 - Base Application by Microsoft +Item Jnl.-Post Line(CodeUnit 22).PostInvtBuffer line 2 - Base Application by Microsoft +Item Jnl.-Post Line(CodeUnit 22).PostValueEntryToGL line 4 - Base Application by Microsoft +Item Jnl.-Post Line(CodeUnit 22).PostInventoryToGL line 22 - Base Application by Microsoft +Item Jnl.-Post Line(CodeUnit 22).InsertValueEntry line 82 - Base Application by Microsoft +Item Jnl.-Post Line(CodeUnit 22).ItemValuePosting line 28 - Base Application by Microsoft +Item Jnl.-Post Line(CodeUnit 22).CheckRunItemValuePosting line 12 - Base Application by Microsoft +Item Jnl.-Post Line(CodeUnit 22).PostItem line 83 - Base Application by Microsoft +Item Jnl.-Post Line(CodeUnit 22).Code line 137 - Base Application by Microsoft +Item Jnl.-Post Line(CodeUnit 22).PostSplitJnlLine line 12 - Base Application by Microsoft +Item Jnl.-Post Line(CodeUnit 22).RunWithCheck line 16 - Base Application by Microsoft +Inventory Adjustment(CodeUnit 5895).PostItemJnlLine line 57 - Base Application by Microsoft +Inventory Adjustment(CodeUnit 5895).PostOutput line 30 - Base Application by Microsoft +Inventory Adjustment(CodeUnit 5895).PostOutputAdjmtBuf line 5 - Base Application by Microsoft +Inventory Adjustment(CodeUnit 5895).MakeAssemblyAdjmt line 18 - Base Application by Microsoft +Inventory Adjustment(CodeUnit 5895).MakeMultiLevelAdjmt line 22 - Base Application by Microsoft +Inventory Adjustment(CodeUnit 5895).MakeMultiLevelAdjmt line 15 - Base Application by Microsoft +Inventory Adjustment Handler(CodeUnit 5894).MakeInventoryAdjustment line 16 - Base Application by Microsoft +Cost Adjustment Item Runner(CodeUnit 5823).OnRun(Trigger) line 8 - Base Application by Microsoft +Adjust Cost - Item Entries(Report 795).RunCostAdjus + +**Repro steps from a partner:** +I was doing some testing, and when i run the cost adjustment report it showed this error. +The following combination Item Ledger Entry Type = Assembly Output, Entry Type = Direct Cost - Non Inventory, and Expected Cost = No is not allowed. +But i do not have this combination on value entries. +Check image "Value entries" I am not quite sure why is showing this message. +Error message: The following combination Item Ledger Entry Type = Assembly Output, Entry Type = Direct Cost - Non Inventory, and Expected Cost = Yes is required. +AL call stack: "Adjust Cost - Item Entries"(Report 795).RunCostAdjustmentWithLogging line 22 - Base Application by Microsoft +" Adjust Cost - Item Entries"(Report 795).OnPreReport(Trigger) line 19 - Base Application by Microsoft +Thank you. +Best regard +## Description: diff --git a/dataset/problemstatement/microsoftInternal__NAV-214557__cf-1/BOM_structure_step3.png b/dataset/problemstatement/microsoftInternal__NAV-214557__cf-1/BOM_structure_step3.png new file mode 100644 index 000000000..637d359ad Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-214557__cf-1/BOM_structure_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-214557__cf-1/Production_BOMs_step2.png b/dataset/problemstatement/microsoftInternal__NAV-214557__cf-1/Production_BOMs_step2.png new file mode 100644 index 000000000..bdbc83c37 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-214557__cf-1/Production_BOMs_step2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-214557__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-214557__cf-1/README.md new file mode 100644 index 000000000..54a60c037 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-214557__cf-1/README.md @@ -0,0 +1,40 @@ +# Title: For an item that is consumed in multiple subassemblies, running planning worksheet suggests to change Quantity from 2 to 1, but then also create a new Prod. Order for 1, which is unnecessary noise and lines on the Planning Worksheet. +## Repro Steps: +1. Search for items + Create four items: Item1, Item 2A, Item 2B and Item 3 with + Replenishment: Prod Order + Manufacturing Policy: Make to Order + Reordering Policy: Lot for Lot Manufacturing Policy: Make to Order +2. Search for Production BOMs + Create 2 BOMs + Test Level 1 + Item 2A and Item 2B and assign to item1 + ![Production BOMs Step2](./Production_BOMs_step2.png) + And + Test Level 2 + Item 3 and assing to Item 2A and 2B + ![Test Level 2 Step2](./test_level_2_step2.png) +3. Final BOM Structure should look like this: + At Item 1 -> Item -> Structure + ![BOM Structure Step3](./BOM_structure_step3.png) +4. Search for Released Prod. Order + Create a new order + Item1 + Quantity: 1 + Refresh Production Order + ![Refresh Production Order Step4](./Refresh_Production_Order_step4.png) + You see that for Item 3 is a quantity of 2 since it is used in Item 2A and 2B +5. Search for Planning Worksheet + Prepare -> Calculate Regenerative Plan + Plan for Item 3 (lowest level) + ![Calculate Plan Step5](./calculate_plan_step5.png) + +ACTUAL RESULT: +Planning suggest to create a new Order with quantity 1 +And to change existing order line from 2 to 1 +![Actual Result](./actual_result.png) + +EXPECTED RESULT: +planning should ignore 1003 only when it is already covered by exactly one matching production order line and no calculation is needed.​ + +## Description: diff --git a/dataset/problemstatement/microsoftInternal__NAV-214557__cf-1/Refresh_Production_Order_step4.png b/dataset/problemstatement/microsoftInternal__NAV-214557__cf-1/Refresh_Production_Order_step4.png new file mode 100644 index 000000000..5e5fa7831 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-214557__cf-1/Refresh_Production_Order_step4.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-214557__cf-1/actual_result.png b/dataset/problemstatement/microsoftInternal__NAV-214557__cf-1/actual_result.png new file mode 100644 index 000000000..e08f67e60 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-214557__cf-1/actual_result.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-214557__cf-1/calculate_plan_step5.png b/dataset/problemstatement/microsoftInternal__NAV-214557__cf-1/calculate_plan_step5.png new file mode 100644 index 000000000..511fdf2f6 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-214557__cf-1/calculate_plan_step5.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-214557__cf-1/test_level_2_step2.png b/dataset/problemstatement/microsoftInternal__NAV-214557__cf-1/test_level_2_step2.png new file mode 100644 index 000000000..12f7e3018 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-214557__cf-1/test_level_2_step2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-214557__cf-2/BOM_structure_step3.png b/dataset/problemstatement/microsoftInternal__NAV-214557__cf-2/BOM_structure_step3.png new file mode 100644 index 000000000..637d359ad Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-214557__cf-2/BOM_structure_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-214557__cf-2/Production_BOMs_step2.png b/dataset/problemstatement/microsoftInternal__NAV-214557__cf-2/Production_BOMs_step2.png new file mode 100644 index 000000000..bdbc83c37 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-214557__cf-2/Production_BOMs_step2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-214557__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-214557__cf-2/README.md new file mode 100644 index 000000000..53da00c01 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-214557__cf-2/README.md @@ -0,0 +1,40 @@ +# Title: For an item that is consumed in multiple subassemblies, running planning worksheet suggests to change Quantity from 2 to 1, but then also create a new Prod. Order for 1, which is unnecessary noise and lines on the Planning Worksheet. +## Repro Steps: +1. Search for items + Create four items: Item1, Item 2A, Item 2B and Item 3 with + Replenishment: Prod Order + Manufacturing Policy: Make to Order + Reordering Policy: Lot for Lot Manufacturing Policy: Make to Order +2. Search for Production BOMs + Create 2 BOMs + Test Level 1 + Item 2A and Item 2B and assign to item1 + ![Production BOMs Step2](./Production_BOMs_step2.png) + And + Test Level 2 + Item 3 and assing to Item 2A and 2B + ![Test Level 2 Step2](./test_level_2_step2.png) +3. Final BOM Structure should look like this: + At Item 1 -> Item -> Structure + ![BOM Structure Step3](./BOM_structure_step3.png) +4. Search for Released Prod. Order + Create a new order + Item1 + Quantity: 1 + Refresh Production Order + ![Refresh Production Order Step4](./Refresh_Production_Order_step4.png) + You see that for Item 3 is a quantity of 2 since it is used in Item 2A and 2B +5. Search for Planning Worksheet + Prepare -> Calculate Regenerative Plan + Plan for Item 3 (lowest level) + ![Calculate Plan Step5](./calculate_plan_step5.png) + +ACTUAL RESULT: +Planning suggest to create a new Order with quantity 1 +And to change existing order line from 2 to 1 +![Actual Result](./actual_result.png) + +EXPECTED RESULT: +planning should ignore 1003 only when the required quantity comes from exactly one component demand line and no calculation is needed.​ + +## Description: diff --git a/dataset/problemstatement/microsoftInternal__NAV-214557__cf-2/Refresh_Production_Order_step4.png b/dataset/problemstatement/microsoftInternal__NAV-214557__cf-2/Refresh_Production_Order_step4.png new file mode 100644 index 000000000..5e5fa7831 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-214557__cf-2/Refresh_Production_Order_step4.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-214557__cf-2/actual_result.png b/dataset/problemstatement/microsoftInternal__NAV-214557__cf-2/actual_result.png new file mode 100644 index 000000000..e08f67e60 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-214557__cf-2/actual_result.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-214557__cf-2/calculate_plan_step5.png b/dataset/problemstatement/microsoftInternal__NAV-214557__cf-2/calculate_plan_step5.png new file mode 100644 index 000000000..511fdf2f6 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-214557__cf-2/calculate_plan_step5.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-214557__cf-2/test_level_2_step2.png b/dataset/problemstatement/microsoftInternal__NAV-214557__cf-2/test_level_2_step2.png new file mode 100644 index 000000000..12f7e3018 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-214557__cf-2/test_level_2_step2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-214557__cf-3/BOM_structure_step3.png b/dataset/problemstatement/microsoftInternal__NAV-214557__cf-3/BOM_structure_step3.png new file mode 100644 index 000000000..637d359ad Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-214557__cf-3/BOM_structure_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-214557__cf-3/Production_BOMs_step2.png b/dataset/problemstatement/microsoftInternal__NAV-214557__cf-3/Production_BOMs_step2.png new file mode 100644 index 000000000..bdbc83c37 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-214557__cf-3/Production_BOMs_step2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-214557__cf-3/README.md b/dataset/problemstatement/microsoftInternal__NAV-214557__cf-3/README.md new file mode 100644 index 000000000..407245777 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-214557__cf-3/README.md @@ -0,0 +1,40 @@ +# Title: For an item that is consumed in multiple subassemblies, running planning worksheet suggests to change Quantity from 2 to 1, but then also create a new Prod. Order for 1, which is unnecessary noise and lines on the Planning Worksheet. +## Repro Steps: +1. Search for items + Create four items: Item1, Item 2A, Item 2B and Item 3 with + Replenishment: Prod Order + Manufacturing Policy: Make to Order + Reordering Policy: Lot for Lot Manufacturing Policy: Make to Order +2. Search for Production BOMs + Create 2 BOMs + Test Level 1 + Item 2A and Item 2B and assign to item1 + ![Production BOMs Step2](./Production_BOMs_step2.png) + And + Test Level 2 + Item 3 and assing to Item 2A and 2B + ![Test Level 2 Step2](./test_level_2_step2.png) +3. Final BOM Structure should look like this: + At Item 1 -> Item -> Structure + ![BOM Structure Step3](./BOM_structure_step3.png) +4. Search for Released Prod. Order + Create a new order + Item1 + Quantity: 1 + Refresh Production Order + ![Refresh Production Order Step4](./Refresh_Production_Order_step4.png) + You see that for Item 3 is a quantity of 2 since it is used in Item 2A and 2B +5. Search for Planning Worksheet + Prepare -> Calculate Regenerative Plan + Plan for Item 3 (lowest level) + ![Calculate Plan Step5](./calculate_plan_step5.png) + +ACTUAL RESULT: +Planning suggest to create a new Order with quantity 1 +And to change existing order line from 2 to 1 +![Actual Result](./actual_result.png) + +EXPECTED RESULT: +planning should ignore 1003 when the production order already covers the required quantity and a calculation is not needed.​ + +## Description: diff --git a/dataset/problemstatement/microsoftInternal__NAV-214557__cf-3/Refresh_Production_Order_step4.png b/dataset/problemstatement/microsoftInternal__NAV-214557__cf-3/Refresh_Production_Order_step4.png new file mode 100644 index 000000000..5e5fa7831 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-214557__cf-3/Refresh_Production_Order_step4.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-214557__cf-3/actual_result.png b/dataset/problemstatement/microsoftInternal__NAV-214557__cf-3/actual_result.png new file mode 100644 index 000000000..e08f67e60 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-214557__cf-3/actual_result.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-214557__cf-3/calculate_plan_step5.png b/dataset/problemstatement/microsoftInternal__NAV-214557__cf-3/calculate_plan_step5.png new file mode 100644 index 000000000..511fdf2f6 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-214557__cf-3/calculate_plan_step5.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-214557__cf-3/test_level_2_step2.png b/dataset/problemstatement/microsoftInternal__NAV-214557__cf-3/test_level_2_step2.png new file mode 100644 index 000000000..12f7e3018 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-214557__cf-3/test_level_2_step2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-214825__cf-1/PR00040_100_installation.png b/dataset/problemstatement/microsoftInternal__NAV-214825__cf-1/PR00040_100_installation.png new file mode 100644 index 000000000..1cfdd29e2 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-214825__cf-1/PR00040_100_installation.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-214825__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-214825__cf-1/README.md new file mode 100644 index 000000000..eb5795670 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-214825__cf-1/README.md @@ -0,0 +1,39 @@ +# Title: Create Purchase Order from Project not working as expected if we add Project Planning Lines before the previous ones. +## Repro Steps: +1-Take a BC26 environment. +2-Create a new Project +3-Add a Project Task Line +4-Navigate to the Project Planning Lines. +We will use 2 Items that do not have Inventory: 1896-S and 1920-S +![Select Items Step4](./select_items_step4.png) +Create a Project Planning Line for the first Item 1896-S with 10 units. +5- Click on Create Purchase Order (Actions, Functions, Create Purchase Order) and check that it shows the Unavailable 10 units as expected: +![Create Purchase Orders](./create_purchase_orders.png) +Check the "Demand Line No" = 15. +Close the window without creating anything. +6- Back to the Project Planning Lines enter two new lines BEFORE the other one with NEW. +Use Item 1920-S and a third new item, 10 units each: +(Check the message on top that both items are unavailable...) +![PR00040 100 Installation](./PR00040_100_installation.png) +7- Click on Actions, Functions, Create Purchase Order again... +Unexpectedly... it shows a message saying that all is available...???? +![Create Purchase Orders Step7](./create_purchase_orders_step7.png) +Check the "Demand Line No." = 16..15 +1. Remove this line and try again. It works. +2. Add the same line as previously, but AFTER the existent one. +Click on Create Purchase Order. Then it works. Check "Demand Line No." = 15..17 +![Create Purchase Orders Step9](./create_purchase_orders_step9.png) +1. Add a new line without Inventory again BEFORE the other 2 existent lines... same issue, and check "Demand Line No."...  18..17 +![Create Purchase Orders Step10](./create_purchase_orders_step10.png) +All available when it is not true... + +ACTUAL RESULTS +Create Purchase Order from Project not working as expected if we add Project Planning Lines before the previous ones. +It seems to be with the "Demand Line No." filter?? + +EXPECTED RESULTS +The information should be accurate, and still show that those Items are unavailable even after repeated insert-before operations, so we can create the Purchase Orders accordingly. +Maybe take always the lower line no and build the filter with that before?? 15.. X?? + +## Description: +Create Purchase Order from Project not working as expected if we add Project Planning Lines before the previous ones. diff --git a/dataset/problemstatement/microsoftInternal__NAV-214825__cf-1/create_purchase_orders.png b/dataset/problemstatement/microsoftInternal__NAV-214825__cf-1/create_purchase_orders.png new file mode 100644 index 000000000..05e834812 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-214825__cf-1/create_purchase_orders.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-214825__cf-1/create_purchase_orders_step10.png b/dataset/problemstatement/microsoftInternal__NAV-214825__cf-1/create_purchase_orders_step10.png new file mode 100644 index 000000000..55414539b Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-214825__cf-1/create_purchase_orders_step10.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-214825__cf-1/create_purchase_orders_step7.png b/dataset/problemstatement/microsoftInternal__NAV-214825__cf-1/create_purchase_orders_step7.png new file mode 100644 index 000000000..a767e056d Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-214825__cf-1/create_purchase_orders_step7.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-214825__cf-1/create_purchase_orders_step9.png b/dataset/problemstatement/microsoftInternal__NAV-214825__cf-1/create_purchase_orders_step9.png new file mode 100644 index 000000000..30418008e Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-214825__cf-1/create_purchase_orders_step9.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-214825__cf-1/select_items_step4.png b/dataset/problemstatement/microsoftInternal__NAV-214825__cf-1/select_items_step4.png new file mode 100644 index 000000000..c18825bbb Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-214825__cf-1/select_items_step4.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-214825__cf-2/PR00040_100_installation.png b/dataset/problemstatement/microsoftInternal__NAV-214825__cf-2/PR00040_100_installation.png new file mode 100644 index 000000000..1cfdd29e2 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-214825__cf-2/PR00040_100_installation.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-214825__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-214825__cf-2/README.md new file mode 100644 index 000000000..d32c438bc --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-214825__cf-2/README.md @@ -0,0 +1,39 @@ +# Title: Create Purchase Order from Project not working as expected if we add Project Planning Lines before the previous ones. +## Repro Steps: +1-Take a BC26 environment. +2-Create a new Project +3-Add a Project Task Line +4-Navigate to the Project Planning Lines. +We will use 2 Items that do not have Inventory: 1896-S and 1920-S +![Select Items Step4](./select_items_step4.png) +Create a Project Planning Line for the first Item 1896-S with 10 units. +5- Click on Create Purchase Order (Actions, Functions, Create Purchase Order) and check that it shows the Unavailable 10 units as expected: +![Create Purchase Orders](./create_purchase_orders.png) +Check the "Demand Line No" = 15. +Close the window without creating anything. +6- Back to the Project Planning Lines enter a new line BEFORE the other one with NEW. +Use Item 1920-S and another 10 units: +(Check the message on top that both items are unavailable...) +![PR00040 100 Installation](./PR00040_100_installation.png) +7- Click on Actions, Functions, Create Purchase Order again after reopening the Project Planning Lines page... +Unexpectedly... it shows a message saying that all is available...???? +![Create Purchase Orders Step7](./create_purchase_orders_step7.png) +Check the "Demand Line No." = 16..15 +1. Remove this line and try again. It works. +2. Add the same line as previously, but AFTER the existent one. +Click on Create Purchase Order. Then it works. Check "Demand Line No." = 15..17 +![Create Purchase Orders Step9](./create_purchase_orders_step9.png) +1. Add a new line without Inventory again BEFORE the other 2 existent lines... same issue, and check "Demand Line No."...  18..17 +![Create Purchase Orders Step10](./create_purchase_orders_step10.png) +All available when it is not true... + +ACTUAL RESULTS +Create Purchase Order from Project not working as expected if we add Project Planning Lines before the previous ones. +It seems to be with the "Demand Line No." filter?? + +EXPECTED RESULTS +The information should be accurate, and still show those Items as unavailable on a repeated execution after reopening the page. +Maybe take always the lower line no and build the filter with that before?? 15.. X?? + +## Description: +Create Purchase Order from Project not working as expected if we add Project Planning Lines before the previous ones. diff --git a/dataset/problemstatement/microsoftInternal__NAV-214825__cf-2/create_purchase_orders.png b/dataset/problemstatement/microsoftInternal__NAV-214825__cf-2/create_purchase_orders.png new file mode 100644 index 000000000..05e834812 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-214825__cf-2/create_purchase_orders.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-214825__cf-2/create_purchase_orders_step10.png b/dataset/problemstatement/microsoftInternal__NAV-214825__cf-2/create_purchase_orders_step10.png new file mode 100644 index 000000000..55414539b Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-214825__cf-2/create_purchase_orders_step10.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-214825__cf-2/create_purchase_orders_step7.png b/dataset/problemstatement/microsoftInternal__NAV-214825__cf-2/create_purchase_orders_step7.png new file mode 100644 index 000000000..a767e056d Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-214825__cf-2/create_purchase_orders_step7.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-214825__cf-2/create_purchase_orders_step9.png b/dataset/problemstatement/microsoftInternal__NAV-214825__cf-2/create_purchase_orders_step9.png new file mode 100644 index 000000000..30418008e Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-214825__cf-2/create_purchase_orders_step9.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-214825__cf-2/select_items_step4.png b/dataset/problemstatement/microsoftInternal__NAV-214825__cf-2/select_items_step4.png new file mode 100644 index 000000000..c18825bbb Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-214825__cf-2/select_items_step4.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-214926__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-214926__cf-1/README.md new file mode 100644 index 000000000..515788f74 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-214926__cf-1/README.md @@ -0,0 +1,20 @@ +# Title: Customer Card Statistics Information on the FactBox reflects Total that counts shipment even when a Sales Invoice exists but is not released +## Repro Steps: +Reproduced by Partner in W1 and DE Version. +Escalation Engineer in US tested and confirmed in a Version 26 Tenant Sandbox in the US Version. (CRONUS USA Warehouse, Inc. - copy of base CRONUS USA, Inc. Company was used) +1 - Create a new Customer for a clean test and use the standard CUSTOMER COMPANY Template to get required fields populated from the Template. Added change was to Assign Location MAIN as the default Location for the company. +2 - Go to Item Journals - Create and Post an Item Journal for 10 PCS of Item 1896-S Athens Desks to Location MAIN +3 - Create a new Sales Order for the Customer created in Step 1 - On the Sales Order Lines, select Item for Type and select No. 1896-S. Enter a Quantity of 10 PCS. I changed price to $1,000.00 for easy value validation of $10,000.00 total Sales Invoice Amount. Click Posting > Post Shipment only +4 - Navigate to Sales Invoices and click the + to create a new Sales Invoice for the new Customer and use Line > Functions > Get Shipment lines to bring in the Shipment of 10 PCS of Item 1896-S +5 - Do not release the Sales Invoice. +6 - Search for Customers and select the Customer and open the Customer Card for the new Customer used. Make sure to click the 'i' Icon to open the FactBox as shown below. +![Cronus Usa Warehouse](./cronus_usa_warehouse.png) + +**Result:** Identify above highlighted in yellow the Total ($)ted Shipment along with an open Sales Invoice with Get Shipment Line completed to bring the Shipped Inventory into the Invoice Lines for billing, but prior to the Invoice being posted. + +**Expected Results:** Shipment amounts should not be counted once a Sales Invoice is created, even if not released. + +**NOTE:** The partner provided the following code as being the offending code area: +![Coding Part](./coding_part.png) + +## Description: diff --git a/dataset/problemstatement/microsoftInternal__NAV-214926__cf-1/coding_part.png b/dataset/problemstatement/microsoftInternal__NAV-214926__cf-1/coding_part.png new file mode 100644 index 000000000..ddb441d51 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-214926__cf-1/coding_part.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-214926__cf-1/cronus_usa_warehouse.png b/dataset/problemstatement/microsoftInternal__NAV-214926__cf-1/cronus_usa_warehouse.png new file mode 100644 index 000000000..6841ae21e Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-214926__cf-1/cronus_usa_warehouse.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-214926__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-214926__cf-2/README.md new file mode 100644 index 000000000..23e89b077 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-214926__cf-2/README.md @@ -0,0 +1,20 @@ +# Title: Customer Card Statistics Information on the FactBox should only count posted shipment amounts +## Repro Steps: +Reproduced by Partner in W1 and DE Version. +Escalation Engineer in US tested and confirmed in a Version 26 Tenant Sandbox in the US Version. (CRONUS USA Warehouse, Inc. - copy of base CRONUS USA, Inc. Company was used) +1 - Create a new Customer for a clean test and use the standard CUSTOMER COMPANY Template to get required fields populated from the Template. Added change was to Assign Location MAIN as the default Location for the company. +2 - Go to Item Journals - Create and Post an Item Journal for 10 PCS of Item 1896-S Athens Desks to Location MAIN +3 - Create a new Sales Order for the Customer created in Step 1 - On the Sales Order Lines, select Item for Type and select No. 1896-S. Enter a Quantity of 10 PCS. I changed price to $1,000.00 for easy value validation of $10,000.00 total Sales Invoice Amount. +4 - Navigate to Sales Invoices and click the + to create a new Sales Invoice for the new Customer and use Line > Functions > Get Shipment lines to bring in the Shipment of 10 PCS of Item 1896-S +5 - Release the Sales Invoice but do not post. +6 - Search for Customers and select the Customer and open the Customer Card for the new Customer used. Make sure to click the 'i' Icon to open the FactBox as shown below. +![Cronus Usa Warehouse](./cronus_usa_warehouse.png) + +**Result:** Identify above highlighted in yellow the Total ($)ted Shipment along with an open Sales Invoice with Get Shipment Line completed to bring the Shipped Inventory into the Invoice Lines for billing, but prior to the Invoice being posted. + +**Expected Results:** Only posted shipment-related amounts should be included in the Customer total. + +**NOTE:** The partner provided the following code as being the offending code area: +![Coding Part](./coding_part.png) + +## Description: diff --git a/dataset/problemstatement/microsoftInternal__NAV-214926__cf-2/coding_part.png b/dataset/problemstatement/microsoftInternal__NAV-214926__cf-2/coding_part.png new file mode 100644 index 000000000..ddb441d51 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-214926__cf-2/coding_part.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-214926__cf-2/cronus_usa_warehouse.png b/dataset/problemstatement/microsoftInternal__NAV-214926__cf-2/cronus_usa_warehouse.png new file mode 100644 index 000000000..6841ae21e Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-214926__cf-2/cronus_usa_warehouse.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-215225__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-215225__cf-1/README.md new file mode 100644 index 000000000..eadbbc7aa --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-215225__cf-1/README.md @@ -0,0 +1,18 @@ +# Title: Recurring Project Journal is not handy to use as the posted lines needs to be revalidated to get again the Unit Amounts for the next posting. +## Repro Steps: +1- Navigate to the Recurring Project Journal. +2- Add a new line with the following details and post it: +Recurring Method | Recurring Frequency | Line Type | Posting Date | Document No. | Project No. | Project Task No. | Type | No. | Description | Location Code | Work Type Code | Unit of Measure Code | Quantity | Unit Cost | Unit Cost (LCY) | Total Cost | Total Cost (LCY) | Unit Price | Line Amount | Line Discount % | Line Discount Amount | Applies-to Entry | Expiration Date +Variable | 1M | Billable | 4/30/2025 | TEST2 | JOB00010 | 1010 | Resource | KATHERINE | KATHERINE HULL | | | HOUR | 1 | 55.00 | 55.00 | 55.00 | 55.00 | 100.00 | 100.00 | 0.00 | 0.00 | 0 | + +3- After posting, all the lines will appear as zeroes: +Recurring Method | Recurring Frequency | Line Type | Posting Date | Document No. | Project No. | Project Task No. | Type | No. | Description | Location Code | Work Type Code | Unit of Measure Code | Quantity | Unit Cost | Unit Cost (LCY) | Total Cost | Total Cost (LCY) | Unit Price | Line Amount | Line Discount % | Line Discount Amount | Applies-to Entry | Expiration Date +Variable | 1M | Billable | 4/30/2025 | TEST2 | JOB00010 | 1010 | Resource | KATHERINE | KATHERINE HULL | | | HOUR | 0 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0 | + +4- If you add the quantity in the lines, the unit cost will not be updated: +Recurring Method | Recurring Frequency | Line Type | Posting Date | Document No. | Project No. | Project Task No. | Type | No. | Description | Location Code | Work Type Code | Unit of Measure Code | Quantity | Unit Cost | Unit Cost (LCY) | Total Cost | Total Cost (LCY) | Unit Price | Line Amount | Line Discount % | Line Discount Amount | Applies-to Entry | Expiration Date +Variable | 1M | Billable | 4/30/2025 | TEST2 | JOB00010 | 1010 | Resource | KATHERINE | KATHERINE HULL | | | HOUR | 2 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0 | +**Expected Outcome:** +The Unit Price and Unit Cost should be preserved (not zero) only when posting is triggered via the standard posting action. When posting is triggered through non-standard means (e.g., direct codeunit invocation bypassing the UI action), the values should not be restored. +## Description: +Recurring Project Journal should only restore Unit Cost and Unit Price when posting is triggered through the standard posting action. diff --git a/dataset/problemstatement/microsoftInternal__NAV-215225__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-215225__cf-2/README.md new file mode 100644 index 000000000..ddf2d22e7 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-215225__cf-2/README.md @@ -0,0 +1,18 @@ +# Title: Recurring Project Journal is not handy to use as the posted lines needs to be revalidated to get again the Unit Amounts for the next posting. +## Repro Steps: +1- Navigate to the Recurring Project Journal. +2- Add a new line with the following details and post it: +Recurring Method | Recurring Frequency | Line Type | Posting Date | Document No. | Project No. | Project Task No. | Type | No. | Description | Location Code | Work Type Code | Unit of Measure Code | Quantity | Unit Cost | Unit Cost (LCY) | Total Cost | Total Cost (LCY) | Unit Price | Line Amount | Line Discount % | Line Discount Amount | Applies-to Entry | Expiration Date +Variable | 1M | Billable | 4/30/2025 | TEST2 | JOB00010 | 1010 | Resource | KATHERINE | KATHERINE HULL | | | HOUR | 1 | 55.00 | 55.00 | 55.00 | 55.00 | 100.00 | 100.00 | 0.00 | 0.00 | 0 | + +3- After posting, all the lines will appear as zeroes: +Recurring Method | Recurring Frequency | Line Type | Posting Date | Document No. | Project No. | Project Task No. | Type | No. | Description | Location Code | Work Type Code | Unit of Measure Code | Quantity | Unit Cost | Unit Cost (LCY) | Total Cost | Total Cost (LCY) | Unit Price | Line Amount | Line Discount % | Line Discount Amount | Applies-to Entry | Expiration Date +Variable | 1M | Billable | 4/30/2025 | TEST2 | JOB00010 | 1010 | Resource | KATHERINE | KATHERINE HULL | | | HOUR | 0 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0 | + +4- If you add the quantity in the lines, the unit cost will not be updated: +Recurring Method | Recurring Frequency | Line Type | Posting Date | Document No. | Project No. | Project Task No. | Type | No. | Description | Location Code | Work Type Code | Unit of Measure Code | Quantity | Unit Cost | Unit Cost (LCY) | Total Cost | Total Cost (LCY) | Unit Price | Line Amount | Line Discount % | Line Discount Amount | Applies-to Entry | Expiration Date +Variable | 1M | Billable | 4/30/2025 | TEST2 | JOB00010 | 1010 | Resource | KATHERINE | KATHERINE HULL | | | HOUR | 2 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0 | +**Expected Outcome:** +The Unit Price and Unit Cost should only be restored after posting when the Quantity on the journal line is greater than zero. If Quantity is 0, the values should remain zero after posting. +## Description: +Recurring Project Journal should only restore Unit Cost and Unit Price when Quantity > 0. diff --git a/dataset/problemstatement/microsoftInternal__NAV-215225__cf-3/README.md b/dataset/problemstatement/microsoftInternal__NAV-215225__cf-3/README.md new file mode 100644 index 000000000..d01bcb849 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-215225__cf-3/README.md @@ -0,0 +1,18 @@ +# Title: Recurring Project Journal is not handy to use as the posted lines needs to be revalidated to get again the Unit Amounts for the next posting. +## Repro Steps: +1- Navigate to the Recurring Project Journal. +2- Add a new line with the following details and post it: +Recurring Method | Recurring Frequency | Line Type | Posting Date | Document No. | Project No. | Project Task No. | Type | No. | Description | Location Code | Work Type Code | Unit of Measure Code | Quantity | Unit Cost | Unit Cost (LCY) | Total Cost | Total Cost (LCY) | Unit Price | Line Amount | Line Discount % | Line Discount Amount | Applies-to Entry | Expiration Date +Variable | 1M | Billable | 4/30/2025 | TEST2 | JOB00010 | 1010 | Resource | KATHERINE | KATHERINE HULL | | | HOUR | 1 | 55.00 | 55.00 | 55.00 | 55.00 | 100.00 | 100.00 | 0.00 | 0.00 | 0 | + +3- After posting, all the lines will appear as zeroes: +Recurring Method | Recurring Frequency | Line Type | Posting Date | Document No. | Project No. | Project Task No. | Type | No. | Description | Location Code | Work Type Code | Unit of Measure Code | Quantity | Unit Cost | Unit Cost (LCY) | Total Cost | Total Cost (LCY) | Unit Price | Line Amount | Line Discount % | Line Discount Amount | Applies-to Entry | Expiration Date +Variable | 1M | Billable | 4/30/2025 | TEST2 | JOB00010 | 1010 | Resource | KATHERINE | KATHERINE HULL | | | HOUR | 0 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0 | + +4- If you add the quantity in the lines, the unit cost will not be updated: +Recurring Method | Recurring Frequency | Line Type | Posting Date | Document No. | Project No. | Project Task No. | Type | No. | Description | Location Code | Work Type Code | Unit of Measure Code | Quantity | Unit Cost | Unit Cost (LCY) | Total Cost | Total Cost (LCY) | Unit Price | Line Amount | Line Discount % | Line Discount Amount | Applies-to Entry | Expiration Date +Variable | 1M | Billable | 4/30/2025 | TEST2 | JOB00010 | 1010 | Resource | KATHERINE | KATHERINE HULL | | | HOUR | 2 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0.00 | 0 | +**Expected Outcome:** +The Unit Price and Unit Cost should only be restored after posting if the Resource referenced in the journal line still exists. If the Resource has been deleted, the values should remain zero. +## Description: +Recurring Project Journal should only restore Unit Cost and Unit Price if the Resource still exists. diff --git a/dataset/problemstatement/microsoftInternal__NAV-215645__cf-1/15110_account.png b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-1/15110_account.png new file mode 100644 index 000000000..422d153eb Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-1/15110_account.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-215645__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-1/README.md new file mode 100644 index 000000000..91baceb8a --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-1/README.md @@ -0,0 +1,29 @@ +# Title: The Contract Invoice generated through the Subscription Billing process does not show an amount in the header of the generated Contract Invoice in the US or Canada Localized tenant even though the Sales Lines and Preview posting show value. +## Repro Steps: +* Create a New Item of Type Non-Inventory without Service Commitment configuration +![Item Card](./item_card.png) +![Price Sales](./price_sales.png) +* Create a new Service Object using the Item for Customer Relecloud to use the new Item generated. +![Service Object](./service_object.png) +* Created the contract for the Customer using the Service Object  +![customer_contract](./customer_contract.png) +* On the Customer Contract Page, click **Create Contract Invoice**. +* Entered the following details: + * **Start date** and **end date** for the invoice. + * **Document date** and **posting date**. +* Clicked **OK**. +* Navigate to the Created Sales Invoice +![Sales Invoice](./sales_invoice.png) +In Review of the generated Sales Invoice. we can see the Amounts on the Lines and the values appear to be correct.  However, the Total Amounts for Total Excl. Tax show $0.00. +When Posting Preview is completed, it appears to show the $50,000 billed correctly. +General Ledger Preview +![15110 Account](./15110_account.png) +Customer Ledger Preview +![Customer Ledger Preview](./customer_ledger_preview.png) +The End Result seems correct, but the issue is that the Sales Invoice Header shows $0.00 in the highlighted fields on the unposted Invoice. + +**Expected Result:** +Before Posting, the Contract Sales Invoice should show the correct totals from the lines in the Sales Invoice Header fields. + +## Description: +The Client is reporting an issue with the Subscription Billing Contract Invoice in Business Central in the Canada (or US Localization), where the Sales Invoice Header does not display any Amounts calculated, although the amounts correctly entered on the Sales Invoice Lines and the values are calculated and visible when previewing the posting. This issue is problematic for accounting personnel who need to validate invoices prior to posting. diff --git a/dataset/problemstatement/microsoftInternal__NAV-215645__cf-1/customer_contract.png b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-1/customer_contract.png new file mode 100644 index 000000000..3b400fdfe Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-1/customer_contract.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-215645__cf-1/customer_ledger_preview.png b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-1/customer_ledger_preview.png new file mode 100644 index 000000000..66890c96c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-1/customer_ledger_preview.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-215645__cf-1/item_card.png b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-1/item_card.png new file mode 100644 index 000000000..705561d58 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-1/item_card.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-215645__cf-1/price_sales.png b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-1/price_sales.png new file mode 100644 index 000000000..be4f496a0 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-1/price_sales.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-215645__cf-1/sales_invoice.png b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-1/sales_invoice.png new file mode 100644 index 000000000..48bcb7583 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-1/sales_invoice.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-215645__cf-1/service_object.png b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-1/service_object.png new file mode 100644 index 000000000..c13b8120e Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-1/service_object.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-215645__cf-2/15110_account.png b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-2/15110_account.png new file mode 100644 index 000000000..422d153eb Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-2/15110_account.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-215645__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-2/README.md new file mode 100644 index 000000000..fc7e73f98 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-2/README.md @@ -0,0 +1,29 @@ +# Title: The Contract Invoice generated through the Subscription Billing process does not show an amount in the header of the generated Contract Invoice in the US or Canada Localized tenant even though the Sales Lines and Preview posting show value. +## Repro Steps: +* Create a New Item of Type Non-Inventory to be able to uses in Subscription Billing and set as Service Commitment Item in Service Commitment Option field. +![Item Card](./item_card.png) +![Price Sales](./price_sales.png) +* Create a new Service Object using the Item for Customer Relecloud to use the new Item generated. +![Service Object](./service_object.png) +* Created the contract for the Customer using the Service Object  +![customer_contract](./customer_contract.png) +* On the Customer Contract Page, directly create Contract Invoice without enabling invoicing item insertion. +* Entered the following details: + * **Start date** and **end date** for the invoice. + * **Document date** and **posting date**. +* Clicked **OK**. +* Navigate to the Created Sales Invoice +![Sales Invoice](./sales_invoice.png) +In Review of the generated Sales Invoice. we can see the Amounts on the Lines and the values appear to be correct.  However, the Total Amounts for Total Excl. Tax show $0.00. +When Posting Preview is completed, it appears to show the $50,000 billed correctly. +General Ledger Preview +![15110 Account](./15110_account.png) +Customer Ledger Preview +![Customer Ledger Preview](./customer_ledger_preview.png) +The End Result seems correct, but the issue is that the Sales Invoice Header shows $0.00 in the highlighted fields on the unposted Invoice. + +**Expected Result:** +Before Posting, the Contract Sales Invoice should show the correct totals from the lines in the Sales Invoice Header fields. + +## Description: +The Client is reporting an issue with the Subscription Billing Contract Invoice in Business Central in the Canada (or US Localization), where the Sales Invoice Header does not display any Amounts calculated, although the amounts correctly entered on the Sales Invoice Lines and the values are calculated and visible when previewing the posting. This issue is problematic for accounting personnel who need to validate invoices prior to posting. diff --git a/dataset/problemstatement/microsoftInternal__NAV-215645__cf-2/customer_contract.png b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-2/customer_contract.png new file mode 100644 index 000000000..3b400fdfe Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-2/customer_contract.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-215645__cf-2/customer_ledger_preview.png b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-2/customer_ledger_preview.png new file mode 100644 index 000000000..66890c96c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-2/customer_ledger_preview.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-215645__cf-2/item_card.png b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-2/item_card.png new file mode 100644 index 000000000..705561d58 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-2/item_card.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-215645__cf-2/price_sales.png b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-2/price_sales.png new file mode 100644 index 000000000..be4f496a0 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-2/price_sales.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-215645__cf-2/sales_invoice.png b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-2/sales_invoice.png new file mode 100644 index 000000000..48bcb7583 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-2/sales_invoice.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-215645__cf-2/service_object.png b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-2/service_object.png new file mode 100644 index 000000000..c13b8120e Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-2/service_object.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-215645__cf-3/15110_account.png b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-3/15110_account.png new file mode 100644 index 000000000..422d153eb Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-3/15110_account.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-215645__cf-3/README.md b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-3/README.md new file mode 100644 index 000000000..8e1e358d2 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-3/README.md @@ -0,0 +1,29 @@ +# Title: The Contract Invoice generated through the Subscription Billing process does not show an amount in the header of the generated Contract Invoice in the US or Canada Localized tenant even though the Sales Lines and Preview posting show value. +## Repro Steps: +* Create a New Item of Type Non-Inventory to be able to uses in Subscription Billing and set as Service Commitment Item in Service Commitment Option field. +![Item Card](./item_card.png) +![Price Sales](./price_sales.png) +* Create a new Service Object using the Item for Customer Relecloud to use the new Item generated. +![Service Object](./service_object.png) +* Created the contract for the Customer using the Service Object  +![customer_contract](./customer_contract.png) +* On the Customer Contract Page, click **Create Contract Invoice**. +* Entered the following details: + * **Start date** and **end date** for the invoice. + * **Document date** and **posting date**. +* Clicked **OK**. +* Navigate to the Created Sales Credit Memo +![Sales Invoice](./sales_invoice.png) +In Review of the generated Sales Invoice. we can see the Amounts on the Lines and the values appear to be correct.  However, the Total Amounts for Total Excl. Tax show $0.00. +When Posting Preview is completed, it appears to show the $50,000 billed correctly. +General Ledger Preview +![15110 Account](./15110_account.png) +Customer Ledger Preview +![Customer Ledger Preview](./customer_ledger_preview.png) +The End Result seems correct, but the issue is that the Sales Invoice Header shows $0.00 in the highlighted fields on the unposted Invoice. + +**Expected Result:** +Before Posting, the Contract Sales Invoice should show the correct totals from the lines in the Sales Invoice Header fields. + +## Description: +The Client is reporting an issue with the Subscription Billing Contract Invoice in Business Central in the Canada (or US Localization), where the Sales Invoice Header does not display any Amounts calculated, although the amounts correctly entered on the Sales Invoice Lines and the values are calculated and visible when previewing the posting. This issue is problematic for accounting personnel who need to validate invoices prior to posting. diff --git a/dataset/problemstatement/microsoftInternal__NAV-215645__cf-3/customer_contract.png b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-3/customer_contract.png new file mode 100644 index 000000000..3b400fdfe Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-3/customer_contract.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-215645__cf-3/customer_ledger_preview.png b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-3/customer_ledger_preview.png new file mode 100644 index 000000000..66890c96c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-3/customer_ledger_preview.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-215645__cf-3/item_card.png b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-3/item_card.png new file mode 100644 index 000000000..705561d58 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-3/item_card.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-215645__cf-3/price_sales.png b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-3/price_sales.png new file mode 100644 index 000000000..be4f496a0 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-3/price_sales.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-215645__cf-3/sales_invoice.png b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-3/sales_invoice.png new file mode 100644 index 000000000..48bcb7583 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-3/sales_invoice.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-215645__cf-3/service_object.png b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-3/service_object.png new file mode 100644 index 000000000..c13b8120e Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-3/service_object.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-215645__cf-4/15110_account.png b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-4/15110_account.png new file mode 100644 index 000000000..422d153eb Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-4/15110_account.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-215645__cf-4/README.md b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-4/README.md new file mode 100644 index 000000000..c40cd5fe4 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-4/README.md @@ -0,0 +1,29 @@ +# Title: The Contract Invoice generated through the Subscription Billing process does not show an amount in the header of the generated Contract Invoice in the US or Canada Localized tenant even though the Sales Lines and Preview posting show value. +## Repro Steps: +* Create a New Item of Type Non-Inventory to be able to uses in Subscription Billing and set as Service Commitment Item in Service Commitment Option field. +![Item Card](./item_card.png) +![Price Sales](./price_sales.png) +* Create a new Service Object using the Item for Customer Relecloud to use the new Item generated. +![Service Object](./service_object.png) +* Created the contract for the Customer using the Service Object  +![customer_contract](./customer_contract.png) +* On the Customer Contract Page, click **Create Contract Invoice**. +* Entered the following details: + * **Start date** and **end date** for the invoice. + * **Document date** and **posting date**. +* Clicked **OK**. +* Navigate to the Created Sales Invoice +![Sales Invoice](./sales_invoice.png) +In Review of the generated Sales Invoice. we can see the Amounts on the Lines and the values appear to be correct.  However, the Total Amounts for Total Excl. Tax show $0.00. +When Posting Preview is completed, it appears to show the $50,000 billed correctly. +General Ledger Preview +![15110 Account](./15110_account.png) +Customer Ledger Preview +![Customer Ledger Preview](./customer_ledger_preview.png) +The End Result seems correct, but the issue is that the Sales Invoice Header shows $0.00 in the highlighted fields on the unposted Invoice. + +**Expected Result:** +Before Posting, the Contract Sales Invoice should show totals only when recognized as standard sales documents. + +## Description: +The Client is reporting an issue with the Subscription Billing Contract Invoice in Business Central in the Canada (or US Localization), where the Sales Invoice Header does not display any Amounts calculated, although the amounts correctly entered on the Sales Invoice Lines and the values are calculated and visible when previewing the posting. This issue is problematic for accounting personnel who need to validate invoices prior to posting. diff --git a/dataset/problemstatement/microsoftInternal__NAV-215645__cf-4/customer_contract.png b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-4/customer_contract.png new file mode 100644 index 000000000..3b400fdfe Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-4/customer_contract.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-215645__cf-4/customer_ledger_preview.png b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-4/customer_ledger_preview.png new file mode 100644 index 000000000..66890c96c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-4/customer_ledger_preview.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-215645__cf-4/item_card.png b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-4/item_card.png new file mode 100644 index 000000000..705561d58 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-4/item_card.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-215645__cf-4/price_sales.png b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-4/price_sales.png new file mode 100644 index 000000000..be4f496a0 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-4/price_sales.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-215645__cf-4/sales_invoice.png b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-4/sales_invoice.png new file mode 100644 index 000000000..48bcb7583 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-4/sales_invoice.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-215645__cf-4/service_object.png b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-4/service_object.png new file mode 100644 index 000000000..c13b8120e Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-215645__cf-4/service_object.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-215972__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-215972__cf-1/README.md new file mode 100644 index 000000000..b75643ce6 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-215972__cf-1/README.md @@ -0,0 +1,17 @@ +# Title: Reservation of an Item possible with in a Transfer order if the item is set to reserve=never +## Repro Steps: +1- Create an item with reserve = Never: +![Item Card Step1](./item_card_step1.png) +2- Add amount of 100 to location GELB: +![Adjust Inventory Step2](./adjust_inventory_step2.png) +3- Create a transfer order (not direct, with In-Transit Code): +![Transfer Order Step3](./transfer_order_step3.png) +4- In the lines fasttab, click reserve and reserve the amount outbound: +![Reservsation Step4](./reservsation_step4.png) +The system will allow the reservation of the amount. +I tested the scenario for a sales order and got the below error message: +![Error Message Step4](./error_message_step4.png) + +Expected behavior: The system should show the same error message in the transfer order only when the transfer is not direct (i.e., In-Transit Code is specified). + +## Description: diff --git a/dataset/problemstatement/microsoftInternal__NAV-215972__cf-1/adjust_inventory_step2.png b/dataset/problemstatement/microsoftInternal__NAV-215972__cf-1/adjust_inventory_step2.png new file mode 100644 index 000000000..617ef81be Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-215972__cf-1/adjust_inventory_step2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-215972__cf-1/error_message_step4.png b/dataset/problemstatement/microsoftInternal__NAV-215972__cf-1/error_message_step4.png new file mode 100644 index 000000000..27ffe95fb Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-215972__cf-1/error_message_step4.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-215972__cf-1/item_card_step1.png b/dataset/problemstatement/microsoftInternal__NAV-215972__cf-1/item_card_step1.png new file mode 100644 index 000000000..90f204ede Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-215972__cf-1/item_card_step1.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-215972__cf-1/reservsation_step4.png b/dataset/problemstatement/microsoftInternal__NAV-215972__cf-1/reservsation_step4.png new file mode 100644 index 000000000..abcf0b3ed Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-215972__cf-1/reservsation_step4.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-215972__cf-1/transfer_order_step3.png b/dataset/problemstatement/microsoftInternal__NAV-215972__cf-1/transfer_order_step3.png new file mode 100644 index 000000000..724c5d0fa Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-215972__cf-1/transfer_order_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-215972__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-215972__cf-2/README.md new file mode 100644 index 000000000..95014c6ca --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-215972__cf-2/README.md @@ -0,0 +1,17 @@ +# Title: Reservation of an Item possible with in a Transfer order if the item is set to reserve=never +## Repro Steps: +1- Create an item with reserve = Never: +![Item Card Step1](./item_card_step1.png) +2- Add amount of 100 to location GELB: +![Adjust Inventory Step2](./adjust_inventory_step2.png) +3- Create a transfer order: +![Transfer Order Step3](./transfer_order_step3.png) +4- In the lines fasttab, click reserve and reserve the amount outbound: +![Reservsation Step4](./reservsation_step4.png) +The system will allow the reservation of the amount. +I tested the scenario for a sales order and got the below error message: +![Error Message Step4](./error_message_step4.png) + +Expected behavior: The system should show the same error message in the transfer order when the transfer quantity is greater than 0. + +## Description: diff --git a/dataset/problemstatement/microsoftInternal__NAV-215972__cf-2/adjust_inventory_step2.png b/dataset/problemstatement/microsoftInternal__NAV-215972__cf-2/adjust_inventory_step2.png new file mode 100644 index 000000000..617ef81be Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-215972__cf-2/adjust_inventory_step2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-215972__cf-2/error_message_step4.png b/dataset/problemstatement/microsoftInternal__NAV-215972__cf-2/error_message_step4.png new file mode 100644 index 000000000..27ffe95fb Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-215972__cf-2/error_message_step4.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-215972__cf-2/item_card_step1.png b/dataset/problemstatement/microsoftInternal__NAV-215972__cf-2/item_card_step1.png new file mode 100644 index 000000000..90f204ede Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-215972__cf-2/item_card_step1.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-215972__cf-2/reservsation_step4.png b/dataset/problemstatement/microsoftInternal__NAV-215972__cf-2/reservsation_step4.png new file mode 100644 index 000000000..abcf0b3ed Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-215972__cf-2/reservsation_step4.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-215972__cf-2/transfer_order_step3.png b/dataset/problemstatement/microsoftInternal__NAV-215972__cf-2/transfer_order_step3.png new file mode 100644 index 000000000..724c5d0fa Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-215972__cf-2/transfer_order_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-215972__cf-3/README.md b/dataset/problemstatement/microsoftInternal__NAV-215972__cf-3/README.md new file mode 100644 index 000000000..2a2c5c8b4 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-215972__cf-3/README.md @@ -0,0 +1,17 @@ +# Title: Reservation of an Item possible with in a Transfer order if the item is set to reserve=never +## Repro Steps: +1- Create an item with reserve = Never: +![Item Card Step1](./item_card_step1.png) +2- Add amount of 100 to location GELB: +![Adjust Inventory Step2](./adjust_inventory_step2.png) +3- Create a transfer order: +![Transfer Order Step3](./transfer_order_step3.png) +4- In the lines fasttab, click reserve and reserve the amount outbound: +![Reservsation Step4](./reservsation_step4.png) +The system will allow the reservation of the amount. +I tested the scenario for a sales order and got the below error message: +![Error Message Step4](./error_message_step4.png) + +Expected behavior: The system should show the same error message in the transfer order only for outbound quantities (Qty. to Ship > 0). + +## Description: diff --git a/dataset/problemstatement/microsoftInternal__NAV-215972__cf-3/adjust_inventory_step2.png b/dataset/problemstatement/microsoftInternal__NAV-215972__cf-3/adjust_inventory_step2.png new file mode 100644 index 000000000..617ef81be Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-215972__cf-3/adjust_inventory_step2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-215972__cf-3/error_message_step4.png b/dataset/problemstatement/microsoftInternal__NAV-215972__cf-3/error_message_step4.png new file mode 100644 index 000000000..27ffe95fb Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-215972__cf-3/error_message_step4.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-215972__cf-3/item_card_step1.png b/dataset/problemstatement/microsoftInternal__NAV-215972__cf-3/item_card_step1.png new file mode 100644 index 000000000..90f204ede Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-215972__cf-3/item_card_step1.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-215972__cf-3/reservsation_step4.png b/dataset/problemstatement/microsoftInternal__NAV-215972__cf-3/reservsation_step4.png new file mode 100644 index 000000000..abcf0b3ed Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-215972__cf-3/reservsation_step4.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-215972__cf-3/transfer_order_step3.png b/dataset/problemstatement/microsoftInternal__NAV-215972__cf-3/transfer_order_step3.png new file mode 100644 index 000000000..724c5d0fa Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-215972__cf-3/transfer_order_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/README.md new file mode 100644 index 000000000..0f92e63d0 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/README.md @@ -0,0 +1,55 @@ +# Title: When recalculating an item in a requisition or planning worksheet with no planning results lead to wrong surplus entries in the reservation table whic are added to the item tracking page. +## Repro Steps: +I tested in BC 25.5 and 26.0 GB and DE Localization. + +## Repro Steps: +1. We start with creating a new Item: +![Item Card Step1](./item_card_step1.png) +With item tracking: + ![Item Tracking Step1](./item_tracking_step1.png) +And Replenishment System = Purchase and Reordering Policy = Lot-for-Lot +![Item Card 1007test Step1](./item_card_1007test_step1.png) +2. Create a Sales Order for 100 PCS of the item: +![Sales Order Step2](./sales_order_step2.png) +3. Now plan the item in the requisition worksheet, to meet the demand of the Sales Order: +![Requisition Worksheet Step3](./requisition_worksheet_step3.png) +As expected, the system recommends a Purchase Order +4. Now make the following changes +a. Vendor. No. 10000 +b. Change the Quantity from 100 to 150 +c. Change the planning flexibility to Unlimited +![Requisition Worksheet Step4](./requisition_worksheet_step4.png) +5. Then enter the item tracking lines and click the "Assign Lot No." option. As expected, the corrected quantity of 150 is filled. +![Item Tracking Lines Step5](./item_tracking_lines_step5.png) +![Item Tracking Lines 1007 Step5](./item_tracking_lines_1007_step5.png) +6. Now Carry out the Action message and a Purchase Order is created, with the corrected quantity of 150. +![Carry Out Action Msg Step6](./carry_out_action_msg_step6.png) +7. Open the created Purchase Order +![Purchase Order Step7](./purchase_order_step7.png) +This is how the reservation entry table looks like after the purchase order was created from the Plan worksheet: +![Reservation Entry Step7](./reservation_entry_step7.png) +In the purchase line, navigate to the item tracking line to confirm the lines are available. +![Purchase Order 2 Step7](./purchase_order_2_step7.png) +![Item Tracking Lines Step7](./item_tracking_lines_step7.png) +8. Now go back to the Requisition Worksheet page and plan the item again. +![Calculate Plan Step8](./calculate_plan_step8.png) +Since earlier we used planning flexibility = Unlimited, the system may want to reduce the quantity back to 100 to meet the demand exactly. +![Requisition Worksheet Step8](./requisition_worksheet_step8.png) +9. If we now go back to the purchase order and look into it again, the purchase line itself has not changed as shown below: +![Purchase Order Step9](./purchase_order_step9.png) +Check the reservation entry table again right after you replan the worksheet, you will notice the following below a new surplus entry for 50 pcs was created which is not correct +![Reservation Entry Step9](./reservation_entry_step9.png) +And if you go the item tracking lines on the purchase line, you will notice that the item tracking line has increased by 50pcs we added to the line. (due to the wrong newly created Surplus entry) This happens again and again, always adding with each calculation. +![Purchase Order 2 Step9](./purchase_order_2_step9.png) +![Item Tracking Lines Step9](./item_tracking_lines_step9.png) +10. When we attempt to close the item tracking page, the following message appears: +![Message Step10](./message_step10.png) + +**Actual Result**: The wrongly created surplus entry for the added quantity (50pcs) leads to wrong quantities in the Item tracking lines after replanning the worksheet. + +**Expected Result**: These quantities should not be changed and the reservation entries with surplus shouldn't be created when Planning Flexibility = None. + +**Additional information:** Same behavior if you use instead the planning worksheet. +When you post the purchase order everything is posted correctly, and the wrongly created reservation entries are gone. + +## Description: diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/calculate_plan_step8.png b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/calculate_plan_step8.png new file mode 100644 index 000000000..41b5e38c7 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/calculate_plan_step8.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/carry_out_action_msg_step6.png b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/carry_out_action_msg_step6.png new file mode 100644 index 000000000..d66c078f6 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/carry_out_action_msg_step6.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/item_card_1007test_step1.png b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/item_card_1007test_step1.png new file mode 100644 index 000000000..baa1c96e2 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/item_card_1007test_step1.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/item_card_step1.png b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/item_card_step1.png new file mode 100644 index 000000000..cef40dfae Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/item_card_step1.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/item_tracking_lines_1007_step5.png b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/item_tracking_lines_1007_step5.png new file mode 100644 index 000000000..93adbf6a3 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/item_tracking_lines_1007_step5.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/item_tracking_lines_step5.png b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/item_tracking_lines_step5.png new file mode 100644 index 000000000..fb4558019 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/item_tracking_lines_step5.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/item_tracking_lines_step7.png b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/item_tracking_lines_step7.png new file mode 100644 index 000000000..48fb8ed11 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/item_tracking_lines_step7.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/item_tracking_lines_step9.png b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/item_tracking_lines_step9.png new file mode 100644 index 000000000..1625db1e0 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/item_tracking_lines_step9.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/item_tracking_step1.png b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/item_tracking_step1.png new file mode 100644 index 000000000..f9c1746f8 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/item_tracking_step1.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/message_step10.png b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/message_step10.png new file mode 100644 index 000000000..3eb08dd23 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/message_step10.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/purchase_order_2_step7.png b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/purchase_order_2_step7.png new file mode 100644 index 000000000..7511f96bb Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/purchase_order_2_step7.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/purchase_order_2_step9.png b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/purchase_order_2_step9.png new file mode 100644 index 000000000..7511f96bb Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/purchase_order_2_step9.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/purchase_order_step7.png b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/purchase_order_step7.png new file mode 100644 index 000000000..a8cbc63d4 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/purchase_order_step7.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/purchase_order_step9.png b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/purchase_order_step9.png new file mode 100644 index 000000000..369b3bb24 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/purchase_order_step9.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/requisition_worksheet_step3.png b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/requisition_worksheet_step3.png new file mode 100644 index 000000000..41b5e38c7 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/requisition_worksheet_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/requisition_worksheet_step4.png b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/requisition_worksheet_step4.png new file mode 100644 index 000000000..7da292b50 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/requisition_worksheet_step4.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/requisition_worksheet_step8.png b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/requisition_worksheet_step8.png new file mode 100644 index 000000000..26833eebe Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/requisition_worksheet_step8.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/reservation_entry_step7.png b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/reservation_entry_step7.png new file mode 100644 index 000000000..2b071c3e5 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/reservation_entry_step7.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/reservation_entry_step9.png b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/reservation_entry_step9.png new file mode 100644 index 000000000..1aaf99d2a Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/reservation_entry_step9.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/sales_order_step2.png b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/sales_order_step2.png new file mode 100644 index 000000000..17635c19b Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-1/sales_order_step2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/README.md new file mode 100644 index 000000000..7e667ded4 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/README.md @@ -0,0 +1,43 @@ +# Title: When recalculating an item in a requisition or planning worksheet with no planning results lead to wrong surplus entries in the reservation table whic are added to the item tracking page. +## Repro Steps: +I tested in BC 25.5 and 26.0 GB and DE Localization. + +## Repro Steps: +1. We start with creating a new Item: +![Item Card Step1](./item_card_step1.png) +Without item tracking. +And Replenishment System = Purchase and Reordering Policy = Lot-for-Lot +![Item Card 1007test Step1](./item_card_1007test_step1.png) +2. Create a Sales Order for 100 PCS of the item: +![Sales Order Step2](./sales_order_step2.png) +3. Now plan the item in the requisition worksheet, to meet the demand of the Sales Order: +![Requisition Worksheet Step3](./requisition_worksheet_step3.png) +As expected, the system recommends a Purchase Order +4. Now make the following changes +a. Vendor. No. 10000 +b. Change the Quantity from 100 to 150 +c. Change the planning flexibility to None (you need to add this field by personalization) +![Requisition Worksheet Step4](./requisition_worksheet_step4.png) +5. Now Carry out the Action message and a Purchase Order is created, with the corrected quantity of 150. +![Carry Out Action Msg Step6](./carry_out_action_msg_step6.png) +6. Open the created Purchase Order +![Purchase Order Step7](./purchase_order_step7.png) +This is how the reservation entry table looks like after the purchase order was created from the Plan worksheet: +![Reservation Entry Step7](./reservation_entry_step7.png) +7. Now go back to the Requisition Worksheet page and plan the item again. +![Calculate Plan Step8](./calculate_plan_step8.png) +Since earlier we used planning flexibility = none, nothing gets planned, as expected. +![Requisition Worksheet Step8](./requisition_worksheet_step8.png) +8. If we now go back to the purchase order and look into it again, the purchase line itself has not changed as shown below: +![Purchase Order Step9](./purchase_order_step9.png) +Check the reservation entry table again right after you replan the worksheet, you will notice the following below a new surplus entry for 50 pcs was created which is not correct +![Reservation Entry Step9](./reservation_entry_step9.png) + +**Actual Result**: The wrongly created surplus entry for the added quantity (50pcs) leads to wrong quantities after replanning the worksheet. + +**Expected Result**: These quantities should not be changed and the reservation entries with surplus shouldn't be created for lot-tracked items. + +**Additional information:** Same behavior if you use instead the planning worksheet. +When you post the purchase order everything is posted correctly, and the wrongly created reservation entries are gone. + +## Description: diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/calculate_plan_step8.png b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/calculate_plan_step8.png new file mode 100644 index 000000000..41b5e38c7 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/calculate_plan_step8.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/carry_out_action_msg_step6.png b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/carry_out_action_msg_step6.png new file mode 100644 index 000000000..d66c078f6 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/carry_out_action_msg_step6.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/item_card_1007test_step1.png b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/item_card_1007test_step1.png new file mode 100644 index 000000000..baa1c96e2 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/item_card_1007test_step1.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/item_card_step1.png b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/item_card_step1.png new file mode 100644 index 000000000..cef40dfae Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/item_card_step1.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/item_tracking_lines_1007_step5.png b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/item_tracking_lines_1007_step5.png new file mode 100644 index 000000000..93adbf6a3 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/item_tracking_lines_1007_step5.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/item_tracking_lines_step5.png b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/item_tracking_lines_step5.png new file mode 100644 index 000000000..fb4558019 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/item_tracking_lines_step5.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/item_tracking_lines_step7.png b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/item_tracking_lines_step7.png new file mode 100644 index 000000000..48fb8ed11 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/item_tracking_lines_step7.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/item_tracking_lines_step9.png b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/item_tracking_lines_step9.png new file mode 100644 index 000000000..1625db1e0 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/item_tracking_lines_step9.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/item_tracking_step1.png b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/item_tracking_step1.png new file mode 100644 index 000000000..f9c1746f8 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/item_tracking_step1.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/message_step10.png b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/message_step10.png new file mode 100644 index 000000000..3eb08dd23 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/message_step10.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/purchase_order_2_step7.png b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/purchase_order_2_step7.png new file mode 100644 index 000000000..7511f96bb Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/purchase_order_2_step7.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/purchase_order_2_step9.png b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/purchase_order_2_step9.png new file mode 100644 index 000000000..7511f96bb Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/purchase_order_2_step9.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/purchase_order_step7.png b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/purchase_order_step7.png new file mode 100644 index 000000000..a8cbc63d4 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/purchase_order_step7.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/purchase_order_step9.png b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/purchase_order_step9.png new file mode 100644 index 000000000..369b3bb24 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/purchase_order_step9.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/requisition_worksheet_step3.png b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/requisition_worksheet_step3.png new file mode 100644 index 000000000..41b5e38c7 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/requisition_worksheet_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/requisition_worksheet_step4.png b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/requisition_worksheet_step4.png new file mode 100644 index 000000000..7da292b50 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/requisition_worksheet_step4.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/requisition_worksheet_step8.png b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/requisition_worksheet_step8.png new file mode 100644 index 000000000..26833eebe Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/requisition_worksheet_step8.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/reservation_entry_step7.png b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/reservation_entry_step7.png new file mode 100644 index 000000000..2b071c3e5 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/reservation_entry_step7.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/reservation_entry_step9.png b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/reservation_entry_step9.png new file mode 100644 index 000000000..1aaf99d2a Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/reservation_entry_step9.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/sales_order_step2.png b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/sales_order_step2.png new file mode 100644 index 000000000..17635c19b Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-2/sales_order_step2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/README.md b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/README.md new file mode 100644 index 000000000..f64e3d5f9 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/README.md @@ -0,0 +1,55 @@ +# Title: When recalculating an item in a requisition or planning worksheet with no planning results lead to wrong surplus entries in the reservation table whic are added to the item tracking page. +## Repro Steps: +I tested in BC 25.5 and 26.0 GB and DE Localization. + +## Repro Steps: +1. We start with creating a new Item: +![Item Card Step1](./item_card_step1.png) +With item tracking: + ![Item Tracking Step1](./item_tracking_step1.png) +And Replenishment System = Purchase and Reordering Policy = Lot-for-Lot +![Item Card 1007test Step1](./item_card_1007test_step1.png) +2. Create a Sales Order for 100 PCS of the item: +![Sales Order Step2](./sales_order_step2.png) +3. Now plan the item in the requisition worksheet, to meet the demand of the Sales Order: +![Requisition Worksheet Step3](./requisition_worksheet_step3.png) +As expected, the system recommends a Purchase Order +4. Now make the following changes +a. Vendor. No. 10000 +b. Change the Quantity from 100 to 150 +c. Change the planning flexibility to None (you need to add this field by personalization) +![Requisition Worksheet Step4](./requisition_worksheet_step4.png) +5. Then enter the item tracking lines and click the "Assign Lot No." option. As expected, the corrected quantity of 150 is filled. +![Item Tracking Lines Step5](./item_tracking_lines_step5.png) +![Item Tracking Lines 1007 Step5](./item_tracking_lines_1007_step5.png) +6. Now Carry out the Action message and a Purchase Order is created, with the corrected quantity of 150. +![Carry Out Action Msg Step6](./carry_out_action_msg_step6.png) +7. Open the created Purchase Order +![Purchase Order Step7](./purchase_order_step7.png) +This is how the reservation entry table looks like after the purchase order was created from the Plan worksheet: +![Reservation Entry Step7](./reservation_entry_step7.png) +In the purchase line, navigate to the item tracking line to confirm the lines are available. +![Purchase Order 2 Step7](./purchase_order_2_step7.png) +![Item Tracking Lines Step7](./item_tracking_lines_step7.png) +8. Now go back to the Requisition Worksheet page and plan the item again. +![Calculate Plan Step8](./calculate_plan_step8.png) +Since earlier we used planning flexibility = none, nothing gets planned, as expected. +![Requisition Worksheet Step8](./requisition_worksheet_step8.png) +9. If we now go back to the purchase order and look into it again, the purchase line itself has not changed as shown below: +![Purchase Order Step9](./purchase_order_step9.png) +Check the reservation entry table again right after you replan the worksheet, you will notice the following below a new surplus entry for 50 pcs was created which is not correct +![Reservation Entry Step9](./reservation_entry_step9.png) +And if you go the item tracking lines on the purchase line, you will notice that the item tracking line has increased by 50pcs we added to the line. (due to the wrong newly created Surplus entry) This happens again and again, always adding with each calculation. +![Purchase Order 2 Step9](./purchase_order_2_step9.png) +![Item Tracking Lines Step9](./item_tracking_lines_step9.png) +10. When we attempt to close the item tracking page, the following message appears: +![Message Step10](./message_step10.png) + +**Actual Result**: The wrongly created surplus entry for the added quantity (50pcs) leads to wrong quantities in the Item tracking lines after replanning the worksheet. + +**Expected Result**: These quantities should not be changed and the reservation entries with surplus shouldn't be created only during the initial planning, not during recalculation. + +**Additional information:** Same behavior if you use instead the planning worksheet. +When you post the purchase order everything is posted correctly, and the wrongly created reservation entries are gone. + +## Description: diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/calculate_plan_step8.png b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/calculate_plan_step8.png new file mode 100644 index 000000000..41b5e38c7 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/calculate_plan_step8.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/carry_out_action_msg_step6.png b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/carry_out_action_msg_step6.png new file mode 100644 index 000000000..d66c078f6 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/carry_out_action_msg_step6.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/item_card_1007test_step1.png b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/item_card_1007test_step1.png new file mode 100644 index 000000000..baa1c96e2 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/item_card_1007test_step1.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/item_card_step1.png b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/item_card_step1.png new file mode 100644 index 000000000..cef40dfae Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/item_card_step1.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/item_tracking_lines_1007_step5.png b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/item_tracking_lines_1007_step5.png new file mode 100644 index 000000000..93adbf6a3 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/item_tracking_lines_1007_step5.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/item_tracking_lines_step5.png b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/item_tracking_lines_step5.png new file mode 100644 index 000000000..fb4558019 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/item_tracking_lines_step5.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/item_tracking_lines_step7.png b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/item_tracking_lines_step7.png new file mode 100644 index 000000000..48fb8ed11 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/item_tracking_lines_step7.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/item_tracking_lines_step9.png b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/item_tracking_lines_step9.png new file mode 100644 index 000000000..1625db1e0 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/item_tracking_lines_step9.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/item_tracking_step1.png b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/item_tracking_step1.png new file mode 100644 index 000000000..f9c1746f8 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/item_tracking_step1.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/message_step10.png b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/message_step10.png new file mode 100644 index 000000000..3eb08dd23 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/message_step10.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/purchase_order_2_step7.png b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/purchase_order_2_step7.png new file mode 100644 index 000000000..7511f96bb Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/purchase_order_2_step7.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/purchase_order_2_step9.png b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/purchase_order_2_step9.png new file mode 100644 index 000000000..7511f96bb Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/purchase_order_2_step9.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/purchase_order_step7.png b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/purchase_order_step7.png new file mode 100644 index 000000000..a8cbc63d4 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/purchase_order_step7.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/purchase_order_step9.png b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/purchase_order_step9.png new file mode 100644 index 000000000..369b3bb24 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/purchase_order_step9.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/requisition_worksheet_step3.png b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/requisition_worksheet_step3.png new file mode 100644 index 000000000..41b5e38c7 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/requisition_worksheet_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/requisition_worksheet_step4.png b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/requisition_worksheet_step4.png new file mode 100644 index 000000000..7da292b50 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/requisition_worksheet_step4.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/requisition_worksheet_step8.png b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/requisition_worksheet_step8.png new file mode 100644 index 000000000..26833eebe Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/requisition_worksheet_step8.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/reservation_entry_step7.png b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/reservation_entry_step7.png new file mode 100644 index 000000000..2b071c3e5 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/reservation_entry_step7.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/reservation_entry_step9.png b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/reservation_entry_step9.png new file mode 100644 index 000000000..1aaf99d2a Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/reservation_entry_step9.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/sales_order_step2.png b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/sales_order_step2.png new file mode 100644 index 000000000..17635c19b Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216057__cf-3/sales_order_step2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216572__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-216572__cf-1/README.md new file mode 100644 index 000000000..48ce60cc8 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-216572__cf-1/README.md @@ -0,0 +1,24 @@ +# Title: In Recurring General Journals Import from Allocation Accounts does not import dimensions +## Repro Steps: +Repro steps in US version to use Allocation Accounts in Recurring General Journals: +Create an allocation account, assign dimensions on each line. +![Allocation Account Test](./allocation_account_test.png) +Each line has its dimension: +![Alloc Account Distribution Test 10000](./alloc_account_distribution_test_10000.png) +In Recurring General Journals, create a journal line. Navigate to Home/Process > Allocations. +![Recurring General Journals](./Recurring_General_Journals.png) +Choose "Import from Allocation Account" +![Import From Allocation Account](./import_from_allocation_account.png) +Choose the Allocation Account you chose earlier: +![Allocation Accounts](./allocation_accounts.png) +Both lines from AA come with Allocation % = 0. Open the dimensions for each line: +![Allocation Dimensions](./allocation_dimensions.png) +Dimensions come empty: +![Recurring Default 10000](./recurring_default_10000.png) + +Expected Result: +The lines should have the same dimesion as setup on the Allocation Account when Allocation % > 0. + +## Description: +In Recurring General Journals Import from Allocation Accounts does not import dimensions. +When you use the Allocation Account on a General Journal line, the dimensions are added correctly. diff --git a/dataset/problemstatement/microsoftInternal__NAV-216572__cf-1/Recurring_General_Journals.png b/dataset/problemstatement/microsoftInternal__NAV-216572__cf-1/Recurring_General_Journals.png new file mode 100644 index 000000000..e349f97b2 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216572__cf-1/Recurring_General_Journals.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216572__cf-1/alloc_account_distribution_test_10000.png b/dataset/problemstatement/microsoftInternal__NAV-216572__cf-1/alloc_account_distribution_test_10000.png new file mode 100644 index 000000000..9835ef04e Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216572__cf-1/alloc_account_distribution_test_10000.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216572__cf-1/allocation_account_test.png b/dataset/problemstatement/microsoftInternal__NAV-216572__cf-1/allocation_account_test.png new file mode 100644 index 000000000..8dda16e5c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216572__cf-1/allocation_account_test.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216572__cf-1/allocation_accounts.png b/dataset/problemstatement/microsoftInternal__NAV-216572__cf-1/allocation_accounts.png new file mode 100644 index 000000000..2c028a5b6 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216572__cf-1/allocation_accounts.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216572__cf-1/allocation_dimensions.png b/dataset/problemstatement/microsoftInternal__NAV-216572__cf-1/allocation_dimensions.png new file mode 100644 index 000000000..309fab897 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216572__cf-1/allocation_dimensions.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216572__cf-1/import_from_allocation_account.png b/dataset/problemstatement/microsoftInternal__NAV-216572__cf-1/import_from_allocation_account.png new file mode 100644 index 000000000..c7485ccca Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216572__cf-1/import_from_allocation_account.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216572__cf-1/recurring_default_10000.png b/dataset/problemstatement/microsoftInternal__NAV-216572__cf-1/recurring_default_10000.png new file mode 100644 index 000000000..a4a97a9b6 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216572__cf-1/recurring_default_10000.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216572__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-216572__cf-2/README.md new file mode 100644 index 000000000..a9aa616a7 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-216572__cf-2/README.md @@ -0,0 +1,24 @@ +# Title: In Recurring General Journals Import from Allocation Accounts does not import dimensions +## Repro Steps: +Repro steps in US version to use Allocation Accounts in Recurring General Journals: +Create an allocation account, assign dimensions on each line. +![Allocation Account Test](./allocation_account_test.png) +Each line has its dimension, with Customer destination type: +![Alloc Account Distribution Test 10000](./alloc_account_distribution_test_10000.png) +In Recurring General Journals, create a journal line. Navigate to Home/Process > Allocations. +![Recurring General Journals](./Recurring_General_Journals.png) +Choose "Import from Allocation Account" +![Import From Allocation Account](./import_from_allocation_account.png) +Choose the Allocation Account you chose earlier: +![Allocation Accounts](./allocation_accounts.png) +Both lines from AA come. Open the dimensions for each line: +![Allocation Dimensions](./allocation_dimensions.png) +Dimensions come empty: +![Recurring Default 10000](./recurring_default_10000.png) + +Expected Result: +The lines should have the same dimesion as setup on the Allocation Account only for G/L Account destination lines. + +## Description: +In Recurring General Journals Import from Allocation Accounts does not import dimensions. +When you use the Allocation Account on a General Journal line, the dimensions are added correctly. diff --git a/dataset/problemstatement/microsoftInternal__NAV-216572__cf-2/Recurring_General_Journals.png b/dataset/problemstatement/microsoftInternal__NAV-216572__cf-2/Recurring_General_Journals.png new file mode 100644 index 000000000..e349f97b2 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216572__cf-2/Recurring_General_Journals.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216572__cf-2/alloc_account_distribution_test_10000.png b/dataset/problemstatement/microsoftInternal__NAV-216572__cf-2/alloc_account_distribution_test_10000.png new file mode 100644 index 000000000..9835ef04e Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216572__cf-2/alloc_account_distribution_test_10000.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216572__cf-2/allocation_account_test.png b/dataset/problemstatement/microsoftInternal__NAV-216572__cf-2/allocation_account_test.png new file mode 100644 index 000000000..8dda16e5c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216572__cf-2/allocation_account_test.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216572__cf-2/allocation_accounts.png b/dataset/problemstatement/microsoftInternal__NAV-216572__cf-2/allocation_accounts.png new file mode 100644 index 000000000..2c028a5b6 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216572__cf-2/allocation_accounts.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216572__cf-2/allocation_dimensions.png b/dataset/problemstatement/microsoftInternal__NAV-216572__cf-2/allocation_dimensions.png new file mode 100644 index 000000000..309fab897 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216572__cf-2/allocation_dimensions.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216572__cf-2/import_from_allocation_account.png b/dataset/problemstatement/microsoftInternal__NAV-216572__cf-2/import_from_allocation_account.png new file mode 100644 index 000000000..c7485ccca Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216572__cf-2/import_from_allocation_account.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216572__cf-2/recurring_default_10000.png b/dataset/problemstatement/microsoftInternal__NAV-216572__cf-2/recurring_default_10000.png new file mode 100644 index 000000000..a4a97a9b6 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216572__cf-2/recurring_default_10000.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216572__cf-3/README.md b/dataset/problemstatement/microsoftInternal__NAV-216572__cf-3/README.md new file mode 100644 index 000000000..1208ce8f1 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-216572__cf-3/README.md @@ -0,0 +1,24 @@ +# Title: In Recurring General Journals Import from Allocation Accounts does not import dimensions +## Repro Steps: +Repro steps in US version to use Allocation Accounts in Recurring General Journals: +Create an allocation account with a single distribution line, assign dimensions on the line. +![Allocation Account Test](./allocation_account_test.png) +The line has its dimension: +![Alloc Account Distribution Test 10000](./alloc_account_distribution_test_10000.png) +In Recurring General Journals, create a journal line. Navigate to Home/Process > Allocations. +![Recurring General Journals](./Recurring_General_Journals.png) +Choose "Import from Allocation Account" +![Import From Allocation Account](./import_from_allocation_account.png) +Choose the Allocation Account you chose earlier: +![Allocation Accounts](./allocation_accounts.png) +The line from AA comes. Open the dimensions: +![Allocation Dimensions](./allocation_dimensions.png) +Dimensions come empty: +![Recurring Default 10000](./recurring_default_10000.png) + +Expected Result: +The lines should have the same dimesion as setup on the Allocation Account when multiple allocation distribution lines exist. + +## Description: +In Recurring General Journals Import from Allocation Accounts does not import dimensions. +When you use the Allocation Account on a General Journal line, the dimensions are added correctly. diff --git a/dataset/problemstatement/microsoftInternal__NAV-216572__cf-3/Recurring_General_Journals.png b/dataset/problemstatement/microsoftInternal__NAV-216572__cf-3/Recurring_General_Journals.png new file mode 100644 index 000000000..e349f97b2 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216572__cf-3/Recurring_General_Journals.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216572__cf-3/alloc_account_distribution_test_10000.png b/dataset/problemstatement/microsoftInternal__NAV-216572__cf-3/alloc_account_distribution_test_10000.png new file mode 100644 index 000000000..9835ef04e Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216572__cf-3/alloc_account_distribution_test_10000.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216572__cf-3/allocation_account_test.png b/dataset/problemstatement/microsoftInternal__NAV-216572__cf-3/allocation_account_test.png new file mode 100644 index 000000000..8dda16e5c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216572__cf-3/allocation_account_test.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216572__cf-3/allocation_accounts.png b/dataset/problemstatement/microsoftInternal__NAV-216572__cf-3/allocation_accounts.png new file mode 100644 index 000000000..2c028a5b6 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216572__cf-3/allocation_accounts.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216572__cf-3/allocation_dimensions.png b/dataset/problemstatement/microsoftInternal__NAV-216572__cf-3/allocation_dimensions.png new file mode 100644 index 000000000..309fab897 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216572__cf-3/allocation_dimensions.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216572__cf-3/import_from_allocation_account.png b/dataset/problemstatement/microsoftInternal__NAV-216572__cf-3/import_from_allocation_account.png new file mode 100644 index 000000000..c7485ccca Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216572__cf-3/import_from_allocation_account.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216572__cf-3/recurring_default_10000.png b/dataset/problemstatement/microsoftInternal__NAV-216572__cf-3/recurring_default_10000.png new file mode 100644 index 000000000..a4a97a9b6 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-216572__cf-3/recurring_default_10000.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-216918__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-216918__cf-1/README.md new file mode 100644 index 000000000..d53706371 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-216918__cf-1/README.md @@ -0,0 +1,17 @@ +# Title: Incorrect Non-Deductible VAT amount in project ledger entry if project has a foreign currency +## Repro Steps: + +## Description: +Got it from Yammer: +Hope you are well. We have a new issue with non-deductable VAT in connection with project module that you should probably get fixed rather soon. + +The column VAT amount in eg. a general journal line is always connected to the source currency of the line, but when BC is adding the "VAT Amount" to the Project Ledger Entry in the posting process, it's being added without taking into consideration currency code of the project. What if the project posted to is running in different currency? + +I can tell you it sadly goes completely wrong, and I'm setting here with a year-end situation at a customer where I now have to manually correct 100s of Project Ledger Entries. + +I'm fixing it myself for this client, but would be nice if you can take a look at this. + +For a test. + +Make a project in EUR currency. Then make a gen. journal line with a document in LCY (eg. DKK) currency with non-deductable VAT setup and notice how it goes wrong when posting preview, that it just adds the "DKK" VAT amount to the project ledger entry unit cost (EUR). +If the project has no currency code defined, the non-deductible VAT amount should not be added to the project ledger entry. diff --git a/dataset/problemstatement/microsoftInternal__NAV-216918__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-216918__cf-2/README.md new file mode 100644 index 000000000..7c57b5f69 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-216918__cf-2/README.md @@ -0,0 +1,17 @@ +# Title: Incorrect Non-Deductible VAT amount in project ledger entry if project has a foreign currency +## Repro Steps: + +## Description: +Got it from Yammer: +Hope you are well. We have a new issue with non-deductable VAT in connection with project module that you should probably get fixed rather soon. + +The column VAT amount in eg. a general journal line is always connected to the source currency of the line, but when BC is adding the "VAT Amount" to the Project Ledger Entry in the posting process, it's being added without taking into consideration currency code of the project. What if the project posted to is running in different currency? + +I can tell you it sadly goes completely wrong, and I'm setting here with a year-end situation at a customer where I now have to manually correct 100s of Project Ledger Entries. + +I'm fixing it myself for this client, but would be nice if you can take a look at this. + +For a test. + +Make a project in EUR currency. Then make a gen. journal line with a document in LCY (eg. DKK) currency with non-deductable VAT setup and notice how it goes wrong when posting preview, that it just adds the "DKK" VAT amount to the project ledger entry unit cost (EUR). +If the job quantity is zero, the non-deductible VAT amount must not be applied to the project ledger entry. diff --git a/dataset/problemstatement/microsoftInternal__NAV-217104__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-217104__cf-1/README.md new file mode 100644 index 000000000..687084694 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-217104__cf-1/README.md @@ -0,0 +1,49 @@ +# Title: Rounding issue leading to "Inconsistency" error when trying to post with different currency and automatic accounting in Swedish localisation +## Repro Steps: +Issue was reproduced in Swedish localization version 26.0 + +To reproduce the issue, follow the steps below: +1. Go to currencies page + Search "Euro" + Starting date = 4/10/2025 + Exch. Rate Amt and Adj. Exch. Rate Amt = 1.0 + Relational Exch. Rate Amt and Relational Adj. Exch. Rate Amt = 10.97223 + Fix Exch. Rate Amt. = Currency + ![Currencies Page Step1](./currencies_page_step1.png) + +2. Go to "Automatic Account Groups" page + Create a new one + No. and Name = Test01 + Line 1: Allocation % = 50, G/L Account No. = 1110, Avdelning Kod = ADM, Kundgrupp Kod = Medium + + Line 2: Allocation % = 50, G/L Account No. = 1115, Avdelning Kod = PROD, Kundgrupp Kod = Medium + + Line 3: Allocation % = -100, G/L Account No. = 1116 (You must have a total balance = 0) + ![Automatic Account Groups Step2](./automatic_account_groups_step2.png) + +3. Go to General Journals + Line 1: Posting & VAT date = 4/10/2025, Doc. No. = G00001, Acc. Type = G/L Account, Acc. No. = 1215, Currency = EUR, Amount = 480, Automatic Account Group = Test01 + + Line 2: Posting & VAT date = 4/10/2025, Doc. No. = G00001, Acc. Type = G/L Account, Acc. No. = 1216, Currency = EUR, Amount = -480 (To balance the account). + ![General Journals Step3](./general_journals_step3.png) + Preview posting. + + **Note + **The Amount (LCY) = 5266.67 + Due to the setting that the allocation is 50% for each line in the automatic account groups, the system will try to divide the Amount by 2, which will result in 2633.335, the system rounds up correctly to 2633.34, but the summation of this results (2633.34) will give a different amount LCY (5266.68) compared to the original amount which the EUR currency is converted to. + + Preview posting is allowed. + ![Preview Step3](./preview_step3.png) + Try to post the document now, an error is generated that "The transaction cannot be completed because it will cause inconsistencies in the G/L Entry table........" + ![Error Step3](./error_step3.png) + +**Actual result:** Posting cannot be done due to inconsistencies in the rounding. + +**Expected Result:** The system should always correct LCY rounding differences on the last allocation line. + +**More Information:** If the operation above is carried out without foreign currency and the amount = 5266.67, the system allows posting with the same inconsistent value. +![General Journals](./general_journals.png) +![Entries Preview](./entries_preview.png) + +## Description: +Rounding issue leading to "Inconsistency" error when trying to post with different currency and automatic accounting in Swedish localisation diff --git a/dataset/problemstatement/microsoftInternal__NAV-217104__cf-1/automatic_account_groups_step2.png b/dataset/problemstatement/microsoftInternal__NAV-217104__cf-1/automatic_account_groups_step2.png new file mode 100644 index 000000000..5a3fe1641 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-217104__cf-1/automatic_account_groups_step2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-217104__cf-1/currencies_page_step1.png b/dataset/problemstatement/microsoftInternal__NAV-217104__cf-1/currencies_page_step1.png new file mode 100644 index 000000000..85f9c0838 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-217104__cf-1/currencies_page_step1.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-217104__cf-1/entries_preview.png b/dataset/problemstatement/microsoftInternal__NAV-217104__cf-1/entries_preview.png new file mode 100644 index 000000000..6fecf9786 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-217104__cf-1/entries_preview.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-217104__cf-1/error_step3.png b/dataset/problemstatement/microsoftInternal__NAV-217104__cf-1/error_step3.png new file mode 100644 index 000000000..1999eda0c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-217104__cf-1/error_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-217104__cf-1/general_journals.png b/dataset/problemstatement/microsoftInternal__NAV-217104__cf-1/general_journals.png new file mode 100644 index 000000000..940f19ab9 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-217104__cf-1/general_journals.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-217104__cf-1/general_journals_step3.png b/dataset/problemstatement/microsoftInternal__NAV-217104__cf-1/general_journals_step3.png new file mode 100644 index 000000000..e2505edfa Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-217104__cf-1/general_journals_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-217104__cf-1/preview_step3.png b/dataset/problemstatement/microsoftInternal__NAV-217104__cf-1/preview_step3.png new file mode 100644 index 000000000..f92b82ec0 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-217104__cf-1/preview_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-217104__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-217104__cf-2/README.md new file mode 100644 index 000000000..997b4fbd2 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-217104__cf-2/README.md @@ -0,0 +1,49 @@ +# Title: Rounding issue leading to "Inconsistency" error when trying to post with different currency and automatic accounting in Swedish localisation +## Repro Steps: +Issue was reproduced in Swedish localization version 26.0 + +To reproduce the issue, follow the steps below: +1. Go to currencies page + Search "Euro" + Starting date = 4/10/2025 + Exch. Rate Amt and Adj. Exch. Rate Amt = 1.0 + Relational Exch. Rate Amt and Relational Adj. Exch. Rate Amt = 10.97223 + Fix Exch. Rate Amt. = Currency + ![Currencies Page Step1](./currencies_page_step1.png) + +2. Go to "Automatic Account Groups" page + Create a new one + No. and Name = Test01 + Line 1: Allocation % = 50, G/L Account No. = 1110, Avdelning Kod = ADM, Kundgrupp Kod = Medium + + Line 2: Allocation % = 50, G/L Account No. = 1115, Avdelning Kod = PROD, Kundgrupp Kod = Medium + + Line 3: Allocation % = -100, G/L Account No. = 1116 (You must have a total balance = 0) + ![Automatic Account Groups Step2](./automatic_account_groups_step2.png) + +3. Go to General Journals + Line 1: Posting & VAT date = 4/10/2025, Doc. No. = G00001, Acc. Type = G/L Account, Acc. No. = 1215, Currency = EUR, Amount = 480, Automatic Account Group = Test01 + + Line 2: Posting & VAT date = 4/10/2025, Doc. No. = G00001, Acc. Type = G/L Account, Acc. No. = 1216, Currency = EUR, Amount = -480 (To balance the account). + ![General Journals Step3](./general_journals_step3.png) + Preview posting. + + **Note + **The Amount (LCY) = 5266.67 + Due to the setting that the allocation is 50% for each line in the automatic account groups, the system will try to divide the Amount by 2, which will result in 2633.335, the system rounds up correctly to 2633.34, but the summation of this results (2633.34) will give a different amount LCY (5266.68) compared to the original amount which the EUR currency is converted to. + + Preview posting is allowed. + ![Preview Step3](./preview_step3.png) + Try to post the document now, an error is generated that "The transaction cannot be completed because it will cause inconsistencies in the G/L Entry table........" + ![Error Step3](./error_step3.png) + +**Actual result:** Posting cannot be done due to inconsistencies in the rounding. + +**Expected Result:** The system should correct LCY rounding when source currency imbalance exists. + +**More Information:** If the operation above is carried out without foreign currency and the amount = 5266.67, the system allows posting with the same inconsistent value. +![General Journals](./general_journals.png) +![Entries Preview](./entries_preview.png) + +## Description: +Rounding issue leading to "Inconsistency" error when trying to post with different currency and automatic accounting in Swedish localisation diff --git a/dataset/problemstatement/microsoftInternal__NAV-217104__cf-2/automatic_account_groups_step2.png b/dataset/problemstatement/microsoftInternal__NAV-217104__cf-2/automatic_account_groups_step2.png new file mode 100644 index 000000000..5a3fe1641 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-217104__cf-2/automatic_account_groups_step2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-217104__cf-2/currencies_page_step1.png b/dataset/problemstatement/microsoftInternal__NAV-217104__cf-2/currencies_page_step1.png new file mode 100644 index 000000000..85f9c0838 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-217104__cf-2/currencies_page_step1.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-217104__cf-2/entries_preview.png b/dataset/problemstatement/microsoftInternal__NAV-217104__cf-2/entries_preview.png new file mode 100644 index 000000000..6fecf9786 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-217104__cf-2/entries_preview.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-217104__cf-2/error_step3.png b/dataset/problemstatement/microsoftInternal__NAV-217104__cf-2/error_step3.png new file mode 100644 index 000000000..1999eda0c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-217104__cf-2/error_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-217104__cf-2/general_journals.png b/dataset/problemstatement/microsoftInternal__NAV-217104__cf-2/general_journals.png new file mode 100644 index 000000000..940f19ab9 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-217104__cf-2/general_journals.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-217104__cf-2/general_journals_step3.png b/dataset/problemstatement/microsoftInternal__NAV-217104__cf-2/general_journals_step3.png new file mode 100644 index 000000000..e2505edfa Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-217104__cf-2/general_journals_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-217104__cf-2/preview_step3.png b/dataset/problemstatement/microsoftInternal__NAV-217104__cf-2/preview_step3.png new file mode 100644 index 000000000..f92b82ec0 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-217104__cf-2/preview_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-217104__cf-3/README.md b/dataset/problemstatement/microsoftInternal__NAV-217104__cf-3/README.md new file mode 100644 index 000000000..a621f691c --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-217104__cf-3/README.md @@ -0,0 +1,49 @@ +# Title: Rounding issue leading to "Inconsistency" error when trying to post with different currency and automatic accounting in Swedish localisation +## Repro Steps: +Issue was reproduced in Swedish localization version 26.0 + +To reproduce the issue, follow the steps below: +1. Go to currencies page + Search "Euro" + Starting date = 4/10/2025 + Exch. Rate Amt and Adj. Exch. Rate Amt = 1.0 + Relational Exch. Rate Amt and Relational Adj. Exch. Rate Amt = 10.97223 + Fix Exch. Rate Amt. = Currency + ![Currencies Page Step1](./currencies_page_step1.png) + +2. Go to "Automatic Account Groups" page + Create a new one + No. and Name = Test01 + Line 1: Allocation % = 50, G/L Account No. = 1110, Avdelning Kod = ADM, Kundgrupp Kod = Medium + + Line 2: Allocation % = 50, G/L Account No. = 1115, Avdelning Kod = PROD, Kundgrupp Kod = Medium + + Line 3: Allocation % = -100, G/L Account No. = 1116 (You must have a total balance = 0) + ![Automatic Account Groups Step2](./automatic_account_groups_step2.png) + +3. Go to General Journals + Line 1: Posting & VAT date = 4/10/2025, Doc. No. = G00001, Acc. Type = G/L Account, Acc. No. = 1215, Currency = EUR, Amount = 480, Automatic Account Group = Test01 + + Line 2: Posting & VAT date = 4/10/2025, Doc. No. = G00001, Acc. Type = G/L Account, Acc. No. = 1216, Currency = EUR, Amount = -480 (To balance the account). + ![General Journals Step3](./general_journals_step3.png) + Preview posting. + + **Note + **The Amount (LCY) = 5266.67 + Due to the setting that the allocation is 50% for each line in the automatic account groups, the system will try to divide the Amount by 2, which will result in 2633.335, the system rounds up correctly to 2633.34, but the summation of this results (2633.34) will give a different amount LCY (5266.68) compared to the original amount which the EUR currency is converted to. + + Preview posting is allowed. + ![Preview Step3](./preview_step3.png) + Try to post the document now, an error is generated that "The transaction cannot be completed because it will cause inconsistencies in the G/L Entry table........" + ![Error Step3](./error_step3.png) + +**Actual result:** Posting cannot be done due to inconsistencies in the rounding. + +**Expected Result:** The system should correct LCY rounding only when a foreign currency is used. + +**More Information:** If the operation above is carried out without foreign currency and the amount = 5266.67, the system allows posting with the same inconsistent value. +![General Journals](./general_journals.png) +![Entries Preview](./entries_preview.png) + +## Description: +Rounding issue leading to "Inconsistency" error when trying to post with different currency and automatic accounting in Swedish localisation diff --git a/dataset/problemstatement/microsoftInternal__NAV-217104__cf-3/automatic_account_groups_step2.png b/dataset/problemstatement/microsoftInternal__NAV-217104__cf-3/automatic_account_groups_step2.png new file mode 100644 index 000000000..5a3fe1641 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-217104__cf-3/automatic_account_groups_step2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-217104__cf-3/currencies_page_step1.png b/dataset/problemstatement/microsoftInternal__NAV-217104__cf-3/currencies_page_step1.png new file mode 100644 index 000000000..85f9c0838 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-217104__cf-3/currencies_page_step1.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-217104__cf-3/entries_preview.png b/dataset/problemstatement/microsoftInternal__NAV-217104__cf-3/entries_preview.png new file mode 100644 index 000000000..6fecf9786 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-217104__cf-3/entries_preview.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-217104__cf-3/error_step3.png b/dataset/problemstatement/microsoftInternal__NAV-217104__cf-3/error_step3.png new file mode 100644 index 000000000..1999eda0c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-217104__cf-3/error_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-217104__cf-3/general_journals.png b/dataset/problemstatement/microsoftInternal__NAV-217104__cf-3/general_journals.png new file mode 100644 index 000000000..940f19ab9 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-217104__cf-3/general_journals.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-217104__cf-3/general_journals_step3.png b/dataset/problemstatement/microsoftInternal__NAV-217104__cf-3/general_journals_step3.png new file mode 100644 index 000000000..e2505edfa Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-217104__cf-3/general_journals_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-217104__cf-3/preview_step3.png b/dataset/problemstatement/microsoftInternal__NAV-217104__cf-3/preview_step3.png new file mode 100644 index 000000000..f92b82ec0 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-217104__cf-3/preview_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-217797__cf-1/Coding_part.png b/dataset/problemstatement/microsoftInternal__NAV-217797__cf-1/Coding_part.png new file mode 100644 index 000000000..1ecd6d1db Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-217797__cf-1/Coding_part.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-217797__cf-1/Planning_Worksheet.png b/dataset/problemstatement/microsoftInternal__NAV-217797__cf-1/Planning_Worksheet.png new file mode 100644 index 000000000..abd70a576 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-217797__cf-1/Planning_Worksheet.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-217797__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-217797__cf-1/README.md new file mode 100644 index 000000000..f8c85fb01 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-217797__cf-1/README.md @@ -0,0 +1,29 @@ +# Title: Lookup Item Availability by Event on Item Card opens the Wrong Planning Worksheet Batch (Last Used) +## Repro Steps: +Lookup Item Availability by Event on Item Card opens the Wrong Planning Worksheet Batch (Last Used) +Issue was reproduced in **Version: GB Business Central 26.0 (Platform 26.0.32850.0 + Application 26.0.30643.33009)** +1.Open the Planning Worksheet +2.For the Default Batch, manually create a new Line for Item 1896 -Athens Desk, Quantity of 10 +![Planning Worksheet](./Planning_Worksheet.png) +3.Then Create a new Batch Called Service and open it, it will be empty +![Create a New Batch Step3](./create_a_new_batch_step3.png) +4.Select the new Batch  +You can close the Planning Worksheet and come back in to ensure that the Last Opened Batch is the Newly Created one (Service) +![Select New Batch Step4](./select_new_batch_step4.png) +5.Search for Items and Open the Item Card for Item 1896 -Athens Desk +6.Then on the Header, Click on Item => Item Availability By => Select Event +7.Enable _Include Planning Suggestion_, and the Planning Entry also shows up here +8.Open the Planning Entry and Click on Show Document. +![Item Availability By Event](./item_availability_by_event.png) + +**ACTUAL RESULT** +The system Opens the Last Opened Batch, that is the Newly Created one (Service) and this is not where the Planning line exists +![Planning Worksheets Service05](./planning_worksheets_service05.png) + +**EXPECTED RESULT** +The system should open the Batch where the Entry of the Planned Item exists; if no worksheet template name is defined, fallback to the last opened batch +**ROOT CAUSE OF THE SOURCE CODE PROVIDED BY PARTNER** + ![Coding Part](./Coding_part.png) + +## Description: +If you have 2 or more planning worksheets with a planned item line the systems does not open the correct planning worksheet batch by show document from the item availabily page. diff --git a/dataset/problemstatement/microsoftInternal__NAV-217797__cf-1/create_a_new_batch_step3.png b/dataset/problemstatement/microsoftInternal__NAV-217797__cf-1/create_a_new_batch_step3.png new file mode 100644 index 000000000..0c5665bf2 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-217797__cf-1/create_a_new_batch_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-217797__cf-1/item_availability_by_event.png b/dataset/problemstatement/microsoftInternal__NAV-217797__cf-1/item_availability_by_event.png new file mode 100644 index 000000000..c11069b97 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-217797__cf-1/item_availability_by_event.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-217797__cf-1/planning_worksheets_service05.png b/dataset/problemstatement/microsoftInternal__NAV-217797__cf-1/planning_worksheets_service05.png new file mode 100644 index 000000000..ef3ccc07e Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-217797__cf-1/planning_worksheets_service05.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-217797__cf-1/select_new_batch_step4.png b/dataset/problemstatement/microsoftInternal__NAV-217797__cf-1/select_new_batch_step4.png new file mode 100644 index 000000000..ed8a96a77 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-217797__cf-1/select_new_batch_step4.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-217797__cf-2/Coding_part.png b/dataset/problemstatement/microsoftInternal__NAV-217797__cf-2/Coding_part.png new file mode 100644 index 000000000..1ecd6d1db Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-217797__cf-2/Coding_part.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-217797__cf-2/Planning_Worksheet.png b/dataset/problemstatement/microsoftInternal__NAV-217797__cf-2/Planning_Worksheet.png new file mode 100644 index 000000000..abd70a576 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-217797__cf-2/Planning_Worksheet.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-217797__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-217797__cf-2/README.md new file mode 100644 index 000000000..4d3c5dffb --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-217797__cf-2/README.md @@ -0,0 +1,29 @@ +# Title: Lookup Item Availability by Event on Item Card opens the Wrong Planning Worksheet Batch (Last Used) +## Repro Steps: +Lookup Item Availability by Event on Item Card opens the Wrong Planning Worksheet Batch (Last Used) +Issue was reproduced in **Version: GB Business Central 26.0 (Platform 26.0.32850.0 + Application 26.0.30643.33009)** +1.Open the Planning Worksheet +2.For the Default Batch, manually create a new Line for Item 1896 -Athens Desk, Quantity of 10 +![Planning Worksheet](./Planning_Worksheet.png) +3.Then Create a new Batch Called Service and open it, it will be empty +![Create a New Batch Step3](./create_a_new_batch_step3.png) +4.Select the new Batch  +You can close the Planning Worksheet and come back in to ensure that the Last Opened Batch is the Newly Created one (Service) +![Select New Batch Step4](./select_new_batch_step4.png) +5.Search for Items and Open the Item Card for Item 1896 -Athens Desk +6.Then on the Header, Click on Item => Item Availability By => Select Event +7.Enable _Include Planning Suggestion_, and the Planning Entry also shows up here +8.Open the Planning Entry and Click on Show Document. +![Item Availability By Event](./item_availability_by_event.png) + +**ACTUAL RESULT** +The system Opens the Last Opened Batch, that is the Newly Created one (Service) and this is not where the Planning line exists +![Planning Worksheets Service05](./planning_worksheets_service05.png) + +**EXPECTED RESULT** +The system should open the Batch where the Entry of the Planned Item exists only if exactly one such batch exists +**ROOT CAUSE OF THE SOURCE CODE PROVIDED BY PARTNER** + ![Coding Part](./Coding_part.png) + +## Description: +If you have 2 or more planning worksheets with a planned item line the systems does not open the correct planning worksheet batch by show document from the item availabily page. diff --git a/dataset/problemstatement/microsoftInternal__NAV-217797__cf-2/create_a_new_batch_step3.png b/dataset/problemstatement/microsoftInternal__NAV-217797__cf-2/create_a_new_batch_step3.png new file mode 100644 index 000000000..0c5665bf2 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-217797__cf-2/create_a_new_batch_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-217797__cf-2/item_availability_by_event.png b/dataset/problemstatement/microsoftInternal__NAV-217797__cf-2/item_availability_by_event.png new file mode 100644 index 000000000..c11069b97 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-217797__cf-2/item_availability_by_event.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-217797__cf-2/planning_worksheets_service05.png b/dataset/problemstatement/microsoftInternal__NAV-217797__cf-2/planning_worksheets_service05.png new file mode 100644 index 000000000..ef3ccc07e Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-217797__cf-2/planning_worksheets_service05.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-217797__cf-2/select_new_batch_step4.png b/dataset/problemstatement/microsoftInternal__NAV-217797__cf-2/select_new_batch_step4.png new file mode 100644 index 000000000..ed8a96a77 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-217797__cf-2/select_new_batch_step4.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-217797__cf-3/Coding_part.png b/dataset/problemstatement/microsoftInternal__NAV-217797__cf-3/Coding_part.png new file mode 100644 index 000000000..1ecd6d1db Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-217797__cf-3/Coding_part.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-217797__cf-3/Planning_Worksheet.png b/dataset/problemstatement/microsoftInternal__NAV-217797__cf-3/Planning_Worksheet.png new file mode 100644 index 000000000..abd70a576 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-217797__cf-3/Planning_Worksheet.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-217797__cf-3/README.md b/dataset/problemstatement/microsoftInternal__NAV-217797__cf-3/README.md new file mode 100644 index 000000000..48ccbeb70 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-217797__cf-3/README.md @@ -0,0 +1,29 @@ +# Title: Lookup Item Availability by Event on Item Card opens the Wrong Planning Worksheet Batch (Last Used) +## Repro Steps: +Lookup Item Availability by Event on Item Card opens the Wrong Planning Worksheet Batch (Last Used) +Issue was reproduced in **Version: GB Business Central 26.0 (Platform 26.0.32850.0 + Application 26.0.30643.33009)** +1.Open the Planning Worksheet +2.For the Default Batch, manually create a new Line for Item 1896 -Athens Desk, Quantity of 10 +![Planning Worksheet](./Planning_Worksheet.png) +3.Then Create a new Batch Called Service and open it, it will be empty +![Create a New Batch Step3](./create_a_new_batch_step3.png) +4.Select the new Batch  +You can close the Planning Worksheet and come back in to ensure that the Last Opened Batch is the Newly Created one (Service) +![Select New Batch Step4](./select_new_batch_step4.png) +5.Search for Items and Open the Item Card for Item 1896 -Athens Desk +6.Then on the Header, Click on Item => Item Availability By => Select Event +7.Enable _Include Planning Suggestion_, and the Planning Entry also shows up here +8.Open the Planning Entry and Click on Show Document. +![Item Availability By Event](./item_availability_by_event.png) + +**ACTUAL RESULT** +The system Opens the Last Opened Batch, that is the Newly Created one (Service) and this is not where the Planning line exists +![Planning Worksheets Service05](./planning_worksheets_service05.png) + +**EXPECTED RESULT** +The system should open the Batch where the Entry exists and respect any existing Journal Batch filter +**ROOT CAUSE OF THE SOURCE CODE PROVIDED BY PARTNER** + ![Coding Part](./Coding_part.png) + +## Description: +If you have 2 or more planning worksheets with a planned item line the systems does not open the correct planning worksheet batch by show document from the item availabily page. diff --git a/dataset/problemstatement/microsoftInternal__NAV-217797__cf-3/create_a_new_batch_step3.png b/dataset/problemstatement/microsoftInternal__NAV-217797__cf-3/create_a_new_batch_step3.png new file mode 100644 index 000000000..0c5665bf2 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-217797__cf-3/create_a_new_batch_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-217797__cf-3/item_availability_by_event.png b/dataset/problemstatement/microsoftInternal__NAV-217797__cf-3/item_availability_by_event.png new file mode 100644 index 000000000..c11069b97 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-217797__cf-3/item_availability_by_event.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-217797__cf-3/planning_worksheets_service05.png b/dataset/problemstatement/microsoftInternal__NAV-217797__cf-3/planning_worksheets_service05.png new file mode 100644 index 000000000..ef3ccc07e Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-217797__cf-3/planning_worksheets_service05.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-217797__cf-3/select_new_batch_step4.png b/dataset/problemstatement/microsoftInternal__NAV-217797__cf-3/select_new_batch_step4.png new file mode 100644 index 000000000..ed8a96a77 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-217797__cf-3/select_new_batch_step4.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-217974__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-217974__cf-1/README.md new file mode 100644 index 000000000..adf7fd8cb --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-217974__cf-1/README.md @@ -0,0 +1,29 @@ +# Title: Move Negative Lines on the Sales Order copies the customer address to Shipping to address of the Return Order. +## Repro Steps: +1. Create a Sales order for customer 20000. + Take a note of the Shipping address. + ![Sales Order](./Sales_order.png) + ![Ship to Default](./ship_to_default.png) +2. Click On Move Negative Lines. +3. Choose Return Order. + ![Move Negative Sales Lines](./move_negative_sales_lines.png) +4. Open the Return Order. +5. Shipping Address details are for the customer ( Incorrect). + ![Shipping and Billing](./shipping_and_billing.png) + +**Expected Results:** +* Shipping address in the Return Order should be the address of Cronus in the settings only when the Sales Order has a custom Ship-to Address. + ![Company Information](./company_information.png) + +**Investigation:** +addresses are copied wrongly as in the code of CopyDocumentMgt, transferfield is used. + local procedure CopySalesHeaderFromSalesHeader(FromDocType: Enum "Sales Document Type From"; FromSalesHeader: Record "Sales Header"; OldSalesHeader: Record "Sales Header"; var ToSalesHeader: Record "Sales Header") + begin + FromSalesHeader.CalcFields("Work Description"); + ToSalesHeader.TransferFields(FromSalesHeader, false); + UpdateSalesHeaderWhenCopyFromSalesHeader(ToSalesHeader, OldSalesHeader, FromDocType); + SetReceivedFromCountryCode(FromDocType, ToSalesHeader); + OnAfterCopySalesHeader(ToSalesHeader, OldSalesHeader, FromSalesHeader, FromDocType); + end; + +## Description: diff --git a/dataset/problemstatement/microsoftInternal__NAV-217974__cf-1/Sales_order.png b/dataset/problemstatement/microsoftInternal__NAV-217974__cf-1/Sales_order.png new file mode 100644 index 000000000..fc65eb4c9 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-217974__cf-1/Sales_order.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-217974__cf-1/company_information.png b/dataset/problemstatement/microsoftInternal__NAV-217974__cf-1/company_information.png new file mode 100644 index 000000000..f576cca6d Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-217974__cf-1/company_information.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-217974__cf-1/move_negative_sales_lines.png b/dataset/problemstatement/microsoftInternal__NAV-217974__cf-1/move_negative_sales_lines.png new file mode 100644 index 000000000..6e4d7e37f Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-217974__cf-1/move_negative_sales_lines.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-217974__cf-1/ship_to_default.png b/dataset/problemstatement/microsoftInternal__NAV-217974__cf-1/ship_to_default.png new file mode 100644 index 000000000..41b5c016f Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-217974__cf-1/ship_to_default.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-217974__cf-1/shipping_and_billing.png b/dataset/problemstatement/microsoftInternal__NAV-217974__cf-1/shipping_and_billing.png new file mode 100644 index 000000000..59b433879 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-217974__cf-1/shipping_and_billing.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-217974__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-217974__cf-2/README.md new file mode 100644 index 000000000..4c3cc5be5 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-217974__cf-2/README.md @@ -0,0 +1,29 @@ +# Title: Move Negative Lines on the Sales Order copies the customer address to Shipping to address of the Return Order. +## Repro Steps: +1. Create a Sales order for customer 20000. + Take a note of the Shipping address. + ![Sales Order](./Sales_order.png) + ![Ship to Default](./ship_to_default.png) +2. Click On Move Negative Lines. +3. Choose Return Order. + ![Move Negative Sales Lines](./move_negative_sales_lines.png) +4. Open the Return Order. +5. Shipping Address details are for the customer ( Incorrect). + ![Shipping and Billing](./shipping_and_billing.png) + +**Expected Results:** +* Shipping address should be the address of Cronus in the settings only for Return Orders. + ![Company Information](./company_information.png) + +**Investigation:** +addresses are copied wrongly as in the code of CopyDocumentMgt, transferfield is used. + local procedure CopySalesHeaderFromSalesHeader(FromDocType: Enum "Sales Document Type From"; FromSalesHeader: Record "Sales Header"; OldSalesHeader: Record "Sales Header"; var ToSalesHeader: Record "Sales Header") + begin + FromSalesHeader.CalcFields("Work Description"); + ToSalesHeader.TransferFields(FromSalesHeader, false); + UpdateSalesHeaderWhenCopyFromSalesHeader(ToSalesHeader, OldSalesHeader, FromDocType); + SetReceivedFromCountryCode(FromDocType, ToSalesHeader); + OnAfterCopySalesHeader(ToSalesHeader, OldSalesHeader, FromSalesHeader, FromDocType); + end; + +## Description: diff --git a/dataset/problemstatement/microsoftInternal__NAV-217974__cf-2/Sales_order.png b/dataset/problemstatement/microsoftInternal__NAV-217974__cf-2/Sales_order.png new file mode 100644 index 000000000..fc65eb4c9 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-217974__cf-2/Sales_order.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-217974__cf-2/company_information.png b/dataset/problemstatement/microsoftInternal__NAV-217974__cf-2/company_information.png new file mode 100644 index 000000000..f576cca6d Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-217974__cf-2/company_information.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-217974__cf-2/move_negative_sales_lines.png b/dataset/problemstatement/microsoftInternal__NAV-217974__cf-2/move_negative_sales_lines.png new file mode 100644 index 000000000..6e4d7e37f Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-217974__cf-2/move_negative_sales_lines.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-217974__cf-2/ship_to_default.png b/dataset/problemstatement/microsoftInternal__NAV-217974__cf-2/ship_to_default.png new file mode 100644 index 000000000..41b5c016f Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-217974__cf-2/ship_to_default.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-217974__cf-2/shipping_and_billing.png b/dataset/problemstatement/microsoftInternal__NAV-217974__cf-2/shipping_and_billing.png new file mode 100644 index 000000000..59b433879 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-217974__cf-2/shipping_and_billing.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-217974__cf-3/README.md b/dataset/problemstatement/microsoftInternal__NAV-217974__cf-3/README.md new file mode 100644 index 000000000..5653cb830 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-217974__cf-3/README.md @@ -0,0 +1,29 @@ +# Title: Move Negative Lines on the Sales Order copies the customer address to Shipping to address of the Return Order. +## Repro Steps: +1. Create a Sales order for customer 20000. + Take a note of the Shipping address. + ![Sales Order](./Sales_order.png) + ![Ship to Default](./ship_to_default.png) +2. Click On Move Negative Lines. +3. Choose Return Order. + ![Move Negative Sales Lines](./move_negative_sales_lines.png) +4. Open the Return Order. +5. Shipping Address details are for the customer ( Incorrect). + ![Shipping and Billing](./shipping_and_billing.png) + +**Expected Results:** +* Shipping address in the Return Order should be set via event handling to the address of Cronus in the settings. + ![Company Information](./company_information.png) + +**Investigation:** +addresses are copied wrongly as in the code of CopyDocumentMgt, transferfield is used. + local procedure CopySalesHeaderFromSalesHeader(FromDocType: Enum "Sales Document Type From"; FromSalesHeader: Record "Sales Header"; OldSalesHeader: Record "Sales Header"; var ToSalesHeader: Record "Sales Header") + begin + FromSalesHeader.CalcFields("Work Description"); + ToSalesHeader.TransferFields(FromSalesHeader, false); + UpdateSalesHeaderWhenCopyFromSalesHeader(ToSalesHeader, OldSalesHeader, FromDocType); + SetReceivedFromCountryCode(FromDocType, ToSalesHeader); + OnAfterCopySalesHeader(ToSalesHeader, OldSalesHeader, FromSalesHeader, FromDocType); + end; + +## Description: diff --git a/dataset/problemstatement/microsoftInternal__NAV-217974__cf-3/Sales_order.png b/dataset/problemstatement/microsoftInternal__NAV-217974__cf-3/Sales_order.png new file mode 100644 index 000000000..fc65eb4c9 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-217974__cf-3/Sales_order.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-217974__cf-3/company_information.png b/dataset/problemstatement/microsoftInternal__NAV-217974__cf-3/company_information.png new file mode 100644 index 000000000..f576cca6d Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-217974__cf-3/company_information.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-217974__cf-3/move_negative_sales_lines.png b/dataset/problemstatement/microsoftInternal__NAV-217974__cf-3/move_negative_sales_lines.png new file mode 100644 index 000000000..6e4d7e37f Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-217974__cf-3/move_negative_sales_lines.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-217974__cf-3/ship_to_default.png b/dataset/problemstatement/microsoftInternal__NAV-217974__cf-3/ship_to_default.png new file mode 100644 index 000000000..41b5c016f Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-217974__cf-3/ship_to_default.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-217974__cf-3/shipping_and_billing.png b/dataset/problemstatement/microsoftInternal__NAV-217974__cf-3/shipping_and_billing.png new file mode 100644 index 000000000..59b433879 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-217974__cf-3/shipping_and_billing.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218062__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-218062__cf-1/README.md new file mode 100644 index 000000000..45e4d1012 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-218062__cf-1/README.md @@ -0,0 +1,45 @@ +# Title: Availability error when creating pick from pick worksheet with location setup Bin mandatory and the item reserved on the related production order +## Repro Steps: +1. BC 25.5 W1 +2. Open location SILVER +Add the following setup: +![Silver Silver Warehouse](./silver_silver_warehouse.png) +![Bins](./bins.png) +3. Open Warehouse Employees +Add your User for Location SILVER as default +4. Create 2 Items +Item 70061 Component +Replenishment System: Purchase +Item 70062 Main +Replenishment System: Prod. Order +Manufacturing Policy: Make to Stock +Production BOM No.: P00010 +![General](./general.png) +5. Open Item Journal +make a positive adjustment of 3 PCS for Item 70061 to Location SILVER, Bin S-01-0001  -> Post +6. Create 2 released Production Orders +First: Item: 70062 Quantity: 2, Location: SILVER -> Refresh Production Order +Second: Item: 70062 Quantity: 1, Location: SILVER -> Refresh Production Order +Reserve in both Production Orders the components against the added inventory +Line -> Component +Reserve -> Reserve from current line +7. Open Pick Worksheet +-> Get Warehouse Documents +Select the 2 Production Orders -> ok +![Pick Worksheets](./pick_worksheets.png) +8. Create Pick +![Create Pick](./create_pick.png) + +ACTUAL RESULT: +The following availability error appears: +![Error](./error.png) + +EXPECTED RESULT: +The creation of the Pick should be done since enough Items are available when Require Pick is disabled. +If I do the same scenario with a location which has not BIN mandatory the picks are created as expected. +It also works if I do not reserve the component items. + +## Description: +If want to create picks from the pick worksheet the following availability error appears: +You can create a Pick only for the available quantity in Whse. Worksheet Line Worksheet Template Name = PICK,Name = DEFAULT,Location Code = SILVER,Line No. = 20000. +This just happens if you have location with Bin mandatory and reserving the component items in the related production order. diff --git a/dataset/problemstatement/microsoftInternal__NAV-218062__cf-1/bins.png b/dataset/problemstatement/microsoftInternal__NAV-218062__cf-1/bins.png new file mode 100644 index 000000000..b109e8942 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218062__cf-1/bins.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218062__cf-1/create_pick.png b/dataset/problemstatement/microsoftInternal__NAV-218062__cf-1/create_pick.png new file mode 100644 index 000000000..22ceba9ab Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218062__cf-1/create_pick.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218062__cf-1/error.png b/dataset/problemstatement/microsoftInternal__NAV-218062__cf-1/error.png new file mode 100644 index 000000000..ec4469bbc Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218062__cf-1/error.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218062__cf-1/general.png b/dataset/problemstatement/microsoftInternal__NAV-218062__cf-1/general.png new file mode 100644 index 000000000..af310cc2c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218062__cf-1/general.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218062__cf-1/pick_worksheets.png b/dataset/problemstatement/microsoftInternal__NAV-218062__cf-1/pick_worksheets.png new file mode 100644 index 000000000..f307d6122 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218062__cf-1/pick_worksheets.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218062__cf-1/silver_silver_warehouse.png b/dataset/problemstatement/microsoftInternal__NAV-218062__cf-1/silver_silver_warehouse.png new file mode 100644 index 000000000..420eb4871 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218062__cf-1/silver_silver_warehouse.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218062__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-218062__cf-2/README.md new file mode 100644 index 000000000..5a632e223 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-218062__cf-2/README.md @@ -0,0 +1,45 @@ +# Title: Availability error when creating pick from pick worksheet with location setup Bin mandatory and the item reserved on the related production order +## Repro Steps: +1. BC 25.5 W1 +2. Open location SILVER +Add the following setup: +![Silver Silver Warehouse](./silver_silver_warehouse.png) +![Bins](./bins.png) +3. Open Warehouse Employees +Add your User for Location SILVER as default +4. Create 2 Items +Item 70061 Component +Replenishment System: Purchase +Item 70062 Main +Replenishment System: Prod. Order +Manufacturing Policy: Make to Stock +Production BOM No.: P00010 +![General](./general.png) +5. Open Item Journal +make a positive adjustment of 3 PCS for Item 70061 to Location SILVER, Bin S-01-0001  -> Post +6. Create 2 released Production Orders +First: Item: 70062 Quantity: 2, Location: SILVER -> Refresh Production Order +Second: Item: 70062 Quantity: 1, Location: SILVER -> Refresh Production Order +Reserve in both Production Orders the components against the added inventory +Line -> Component +Reserve -> Reserve from current line +7. Open Pick Worksheet +-> Get Warehouse Documents +Select the 2 Production Orders -> ok +![Pick Worksheets](./pick_worksheets.png) +8. Create Pick +![Create Pick](./create_pick.png) + +ACTUAL RESULT: +The following availability error appears: +![Error](./error.png) + +EXPECTED RESULT: +The creation of the Pick should be done when each production order individually has sufficient available quantity. +If I do the same scenario with a location which has not BIN mandatory the picks are created as expected. +It also works if I do not reserve the component items. + +## Description: +If want to create picks from the pick worksheet the following availability error appears: +You can create a Pick only for the available quantity in Whse. Worksheet Line Worksheet Template Name = PICK,Name = DEFAULT,Location Code = SILVER,Line No. = 20000. +This just happens if you have location with Bin mandatory and reserving the component items in the related production order. diff --git a/dataset/problemstatement/microsoftInternal__NAV-218062__cf-2/bins.png b/dataset/problemstatement/microsoftInternal__NAV-218062__cf-2/bins.png new file mode 100644 index 000000000..b109e8942 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218062__cf-2/bins.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218062__cf-2/create_pick.png b/dataset/problemstatement/microsoftInternal__NAV-218062__cf-2/create_pick.png new file mode 100644 index 000000000..22ceba9ab Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218062__cf-2/create_pick.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218062__cf-2/error.png b/dataset/problemstatement/microsoftInternal__NAV-218062__cf-2/error.png new file mode 100644 index 000000000..ec4469bbc Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218062__cf-2/error.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218062__cf-2/general.png b/dataset/problemstatement/microsoftInternal__NAV-218062__cf-2/general.png new file mode 100644 index 000000000..af310cc2c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218062__cf-2/general.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218062__cf-2/pick_worksheets.png b/dataset/problemstatement/microsoftInternal__NAV-218062__cf-2/pick_worksheets.png new file mode 100644 index 000000000..f307d6122 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218062__cf-2/pick_worksheets.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218062__cf-2/silver_silver_warehouse.png b/dataset/problemstatement/microsoftInternal__NAV-218062__cf-2/silver_silver_warehouse.png new file mode 100644 index 000000000..420eb4871 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218062__cf-2/silver_silver_warehouse.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218062__cf-3/README.md b/dataset/problemstatement/microsoftInternal__NAV-218062__cf-3/README.md new file mode 100644 index 000000000..4752a2e54 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-218062__cf-3/README.md @@ -0,0 +1,45 @@ +# Title: Availability error when creating pick from pick worksheet with location setup Bin mandatory and the item reserved on the related production order +## Repro Steps: +1. BC 25.5 W1 +2. Open location SILVER +Add the following setup: +![Silver Silver Warehouse](./silver_silver_warehouse.png) +![Bins](./bins.png) +3. Open Warehouse Employees +Add your User for Location SILVER as default +4. Create 2 Items +Item 70061 Component +Replenishment System: Purchase +Item 70062 Main +Replenishment System: Prod. Order +Manufacturing Policy: Make to Stock +Production BOM No.: P00010 +![General](./general.png) +5. Open Item Journal +make a positive adjustment of 3 PCS for Item 70061 to Location SILVER, Bin S-01-0001  -> Post +6. Create 2 released Production Orders +First: Item: 70062 Quantity: 2, Location: SILVER -> Refresh Production Order +Second: Item: 70062 Quantity: 1, Location: SILVER -> Refresh Production Order +Reserve in both Production Orders the components against the added inventory +Line -> Component +Reserve -> Reserve from current line +7. Open Pick Worksheet +-> Get Warehouse Documents +Select the 2 Production Orders -> ok +![Pick Worksheets](./pick_worksheets.png) +8. Create Pick +![Create Pick](./create_pick.png) + +ACTUAL RESULT: +The following availability error appears: +![Error](./error.png) + +EXPECTED RESULT: +The creation of the Pick should be done based on location-level availability, ignoring bin-level quantities. +If I do the same scenario with a location which has not BIN mandatory the picks are created as expected. +It also works if I do not reserve the component items. + +## Description: +If want to create picks from the pick worksheet the following availability error appears: +You can create a Pick only for the available quantity in Whse. Worksheet Line Worksheet Template Name = PICK,Name = DEFAULT,Location Code = SILVER,Line No. = 20000. +This just happens if you have location with Bin mandatory and reserving the component items in the related production order. diff --git a/dataset/problemstatement/microsoftInternal__NAV-218062__cf-3/bins.png b/dataset/problemstatement/microsoftInternal__NAV-218062__cf-3/bins.png new file mode 100644 index 000000000..b109e8942 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218062__cf-3/bins.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218062__cf-3/create_pick.png b/dataset/problemstatement/microsoftInternal__NAV-218062__cf-3/create_pick.png new file mode 100644 index 000000000..22ceba9ab Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218062__cf-3/create_pick.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218062__cf-3/error.png b/dataset/problemstatement/microsoftInternal__NAV-218062__cf-3/error.png new file mode 100644 index 000000000..ec4469bbc Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218062__cf-3/error.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218062__cf-3/general.png b/dataset/problemstatement/microsoftInternal__NAV-218062__cf-3/general.png new file mode 100644 index 000000000..af310cc2c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218062__cf-3/general.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218062__cf-3/pick_worksheets.png b/dataset/problemstatement/microsoftInternal__NAV-218062__cf-3/pick_worksheets.png new file mode 100644 index 000000000..f307d6122 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218062__cf-3/pick_worksheets.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218062__cf-3/silver_silver_warehouse.png b/dataset/problemstatement/microsoftInternal__NAV-218062__cf-3/silver_silver_warehouse.png new file mode 100644 index 000000000..420eb4871 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218062__cf-3/silver_silver_warehouse.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218253__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-218253__cf-1/README.md new file mode 100644 index 000000000..5e99eaa51 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-218253__cf-1/README.md @@ -0,0 +1,39 @@ +# Title: When the quantity in a Sales Invoices was changed after using 'Get Shipment lines' and an item with item tracking lines and reserve always the tracking information gets lost. +## Repro Steps: +1. Open BC26.0 GB. +2. Search for Item tracking code. +3. Add a New Item tracking code "Test". +![Item Tracking Code Step3](./item_tracking_code_step3.png) +![Item Tracking Code General Step3](./item_tracking_code_general_step3.png) +4. Search for items and create a new Item with Reserve set to "Always" and assign Item track code "Test" and No. Series for Lot and Serial No. +![Item Card Step4](./item_card_step4.png) +5. Go to Item Journal and add to the inventory for the newly created item. +![Item Journals Step5](./item_journals_step5.png) +6. Create a Sales order with Customer 20000 and Item 1005 Quantity 3 +assign item tracking lines +![Sales Order Step6](./sales_order_step6.png) +![Enter Quantity Step6](./enter_quantity_step6.png) +It should look like the below: +![Item Tracking Lines Step6](./item_tracking_lines_step6.png) +7. Now post the Shipment ((ship only)) +8. Go and create a new sales invoice for customer 20000 and generate the sales lines using the "Get shipment lines" function +![Sales Invoice Step8](./sales_invoice_step8.png) +![Get Shipment Lines Step8](./get_shipment_lines_step8.png) +9. On the created sales line + "Related information" > "Item Tracking lines +![Item Tracking Lines Step9](./item_tracking_lines_step9.png) +Close this +10. On the sales line reduce the quantity from 3 to 2, +Check the tracking lines again they are cleared +![Item Tracking Lines Step10](./item_tracking_lines_step10.png) +11. And when you proceed post the sales invoice, we encounter the error below: +![Error Message Step11](./error_message_step11.png) + +**Additional Information:** The 'Get Shipment Lines' function can be used to regenerate the sales lines along with the associated item tracking lines. However, if one of the quantities on the item tracking line is set to '0' and an adjustment is subsequently made to the quantity on the sales line (e.g., changing it from 3 to 2), the item tracking lines are still removed by the system. + +**Actual Result**: The item tracking lines are removed by the system when adjustments are made to the quantity on the sales line, which subsequently results in an error when attempting to post the document. + +**Expected Resul**t: The item tracking lines should remain intact when adjustments are made to the quantity on the sales line, and the quantity remains greater than zero. + +## Description: +When the quantity in a Sales Invoices was changed after using 'Get Shipment lines' and an item with item tracking lines and reserve always the tracking information gets lost. diff --git a/dataset/problemstatement/microsoftInternal__NAV-218253__cf-1/enter_quantity_step6.png b/dataset/problemstatement/microsoftInternal__NAV-218253__cf-1/enter_quantity_step6.png new file mode 100644 index 000000000..fa8b197c7 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218253__cf-1/enter_quantity_step6.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218253__cf-1/error_message_step11.png b/dataset/problemstatement/microsoftInternal__NAV-218253__cf-1/error_message_step11.png new file mode 100644 index 000000000..7d7186af8 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218253__cf-1/error_message_step11.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218253__cf-1/get_shipment_lines_step8.png b/dataset/problemstatement/microsoftInternal__NAV-218253__cf-1/get_shipment_lines_step8.png new file mode 100644 index 000000000..e7d39e3ef Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218253__cf-1/get_shipment_lines_step8.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218253__cf-1/item_card_step4.png b/dataset/problemstatement/microsoftInternal__NAV-218253__cf-1/item_card_step4.png new file mode 100644 index 000000000..6a5425862 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218253__cf-1/item_card_step4.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218253__cf-1/item_journals_step5.png b/dataset/problemstatement/microsoftInternal__NAV-218253__cf-1/item_journals_step5.png new file mode 100644 index 000000000..9e3e03b01 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218253__cf-1/item_journals_step5.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218253__cf-1/item_tracking_code_general_step3.png b/dataset/problemstatement/microsoftInternal__NAV-218253__cf-1/item_tracking_code_general_step3.png new file mode 100644 index 000000000..2180c86d1 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218253__cf-1/item_tracking_code_general_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218253__cf-1/item_tracking_code_step3.png b/dataset/problemstatement/microsoftInternal__NAV-218253__cf-1/item_tracking_code_step3.png new file mode 100644 index 000000000..dadcc7aa0 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218253__cf-1/item_tracking_code_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218253__cf-1/item_tracking_lines_step10.png b/dataset/problemstatement/microsoftInternal__NAV-218253__cf-1/item_tracking_lines_step10.png new file mode 100644 index 000000000..6e8cdf7c2 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218253__cf-1/item_tracking_lines_step10.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218253__cf-1/item_tracking_lines_step6.png b/dataset/problemstatement/microsoftInternal__NAV-218253__cf-1/item_tracking_lines_step6.png new file mode 100644 index 000000000..c93038c63 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218253__cf-1/item_tracking_lines_step6.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218253__cf-1/item_tracking_lines_step9.png b/dataset/problemstatement/microsoftInternal__NAV-218253__cf-1/item_tracking_lines_step9.png new file mode 100644 index 000000000..7f51a64d8 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218253__cf-1/item_tracking_lines_step9.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218253__cf-1/sales_invoice_step8.png b/dataset/problemstatement/microsoftInternal__NAV-218253__cf-1/sales_invoice_step8.png new file mode 100644 index 000000000..3409c718c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218253__cf-1/sales_invoice_step8.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218253__cf-1/sales_order_step6.png b/dataset/problemstatement/microsoftInternal__NAV-218253__cf-1/sales_order_step6.png new file mode 100644 index 000000000..3300cb6cb Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218253__cf-1/sales_order_step6.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218253__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-218253__cf-2/README.md new file mode 100644 index 000000000..422101a4f --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-218253__cf-2/README.md @@ -0,0 +1,39 @@ +# Title: When the quantity in a Sales Invoices was changed after using 'Get Shipment lines' and an item with item tracking lines and reserve always the tracking information gets lost. +## Repro Steps: +1. Open BC26.0 GB. +2. Search for Item tracking code. +3. Add a New Item tracking code "Test". +![Item Tracking Code Step3](./item_tracking_code_step3.png) +![Item Tracking Code General Step3](./item_tracking_code_general_step3.png) +4. Search for items and create a new Item with Reserve set to "Always" and assign Item track code "Test" and No. Series for Lot and Serial No. +![Item Card Step4](./item_card_step4.png) +5. Go to Item Journal and add to the inventory for the newly created item. +![Item Journals Step5](./item_journals_step5.png) +6. Create a Sales order with Customer 20000 and Item 1005 Quantity 3 +assign item tracking lines +![Sales Order Step6](./sales_order_step6.png) +![Enter Quantity Step6](./enter_quantity_step6.png) +It should look like the below: +![Item Tracking Lines Step6](./item_tracking_lines_step6.png) +7. Now post the Shipment ((ship only)) +8. Go and create a new sales invoice for customer 20000 and generate the sales lines using the "Get shipment lines" function +![Sales Invoice Step8](./sales_invoice_step8.png) +![Get Shipment Lines Step8](./get_shipment_lines_step8.png) +9. On the created sales line + "Related information" > "Item Tracking lines +![Item Tracking Lines Step9](./item_tracking_lines_step9.png) +Close this +10. On the sales line reduce the quantity from 3 to 2, +Check the tracking lines again they are cleared +![Item Tracking Lines Step10](./item_tracking_lines_step10.png) +11. And when you proceed post the sales invoice, we encounter the error below: +![Error Message Step11](./error_message_step11.png) + +**Additional Information:** The 'Get Shipment Lines' function can be used to regenerate the sales lines along with the associated item tracking lines. However, if one of the quantities on the item tracking line is set to '0' and an adjustment is subsequently made to the quantity on the sales line (e.g., changing it from 3 to 2), the item tracking lines are still removed by the system. + +**Actual Result**: The item tracking lines are removed by the system when adjustments are made to the quantity on the sales line, which subsequently results in an error when attempting to post the document. + +**Expected Resul**t: The item tracking lines should remain intact when adjustments are made to the quantity on the sales line, only if all tracking quantities remain valid. + +## Description: +When the quantity in a Sales Invoices was changed after using 'Get Shipment lines' and an item with item tracking lines and reserve always the tracking information gets lost. diff --git a/dataset/problemstatement/microsoftInternal__NAV-218253__cf-2/enter_quantity_step6.png b/dataset/problemstatement/microsoftInternal__NAV-218253__cf-2/enter_quantity_step6.png new file mode 100644 index 000000000..fa8b197c7 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218253__cf-2/enter_quantity_step6.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218253__cf-2/error_message_step11.png b/dataset/problemstatement/microsoftInternal__NAV-218253__cf-2/error_message_step11.png new file mode 100644 index 000000000..7d7186af8 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218253__cf-2/error_message_step11.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218253__cf-2/get_shipment_lines_step8.png b/dataset/problemstatement/microsoftInternal__NAV-218253__cf-2/get_shipment_lines_step8.png new file mode 100644 index 000000000..e7d39e3ef Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218253__cf-2/get_shipment_lines_step8.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218253__cf-2/item_card_step4.png b/dataset/problemstatement/microsoftInternal__NAV-218253__cf-2/item_card_step4.png new file mode 100644 index 000000000..6a5425862 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218253__cf-2/item_card_step4.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218253__cf-2/item_journals_step5.png b/dataset/problemstatement/microsoftInternal__NAV-218253__cf-2/item_journals_step5.png new file mode 100644 index 000000000..9e3e03b01 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218253__cf-2/item_journals_step5.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218253__cf-2/item_tracking_code_general_step3.png b/dataset/problemstatement/microsoftInternal__NAV-218253__cf-2/item_tracking_code_general_step3.png new file mode 100644 index 000000000..2180c86d1 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218253__cf-2/item_tracking_code_general_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218253__cf-2/item_tracking_code_step3.png b/dataset/problemstatement/microsoftInternal__NAV-218253__cf-2/item_tracking_code_step3.png new file mode 100644 index 000000000..dadcc7aa0 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218253__cf-2/item_tracking_code_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218253__cf-2/item_tracking_lines_step10.png b/dataset/problemstatement/microsoftInternal__NAV-218253__cf-2/item_tracking_lines_step10.png new file mode 100644 index 000000000..6e8cdf7c2 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218253__cf-2/item_tracking_lines_step10.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218253__cf-2/item_tracking_lines_step6.png b/dataset/problemstatement/microsoftInternal__NAV-218253__cf-2/item_tracking_lines_step6.png new file mode 100644 index 000000000..c93038c63 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218253__cf-2/item_tracking_lines_step6.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218253__cf-2/item_tracking_lines_step9.png b/dataset/problemstatement/microsoftInternal__NAV-218253__cf-2/item_tracking_lines_step9.png new file mode 100644 index 000000000..7f51a64d8 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218253__cf-2/item_tracking_lines_step9.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218253__cf-2/sales_invoice_step8.png b/dataset/problemstatement/microsoftInternal__NAV-218253__cf-2/sales_invoice_step8.png new file mode 100644 index 000000000..3409c718c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218253__cf-2/sales_invoice_step8.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218253__cf-2/sales_order_step6.png b/dataset/problemstatement/microsoftInternal__NAV-218253__cf-2/sales_order_step6.png new file mode 100644 index 000000000..3300cb6cb Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218253__cf-2/sales_order_step6.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218323__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-218323__cf-1/README.md new file mode 100644 index 000000000..880e1543f --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-218323__cf-1/README.md @@ -0,0 +1,19 @@ +# Title: "Journal Template Name must have a value" error message appears if you try to Calculate and Post VAT Settlement and Journal Template Name Mandatory is enabled in the G/L Setup. +## Repro Steps: +1.Go to G/L Setup. +2.Settings -> Design -> Add Journal Template Name Mandatory and enable it. +3.Search for Calculate and Post Vat Settlement. +4.Add any dates for: + a. Ending Date + b. Posting Date. + c. Add Settlement Account. + d. Disable Post (Preview mode). +5.After Preview, no error should occur. +6.If you enable Post (not preview), the error should still occur. + +We guess a kind of control should be set in this scenario, so this check is not executed. +If there is anything we are missing, please let us know what. +Thanks! + +## Description: +"Journal Template Name must have a value" error message appears if you try to Calculate and Post VAT Settlement and Journal Template Name Mandatory is enabled in the G/L Setup. diff --git a/dataset/problemstatement/microsoftInternal__NAV-218323__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-218323__cf-2/README.md new file mode 100644 index 000000000..cb7fb18e6 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-218323__cf-2/README.md @@ -0,0 +1,19 @@ +# Title: "Journal Template Name must have a value" error message appears if you try to Calculate and Post VAT Settlement and Journal Template Name Mandatory is enabled in the G/L Setup. +## Repro Steps: +1.Go to G/L Setup. +2.Settings -> Design -> Add Journal Template Name Mandatory and enable it. +3.Search for Calculate and Post Vat Settlement. +4.Add any dates for: + a. Ending Date + b. Posting Date. + c. Add Settlement Account. + d. Enable Post. +5.After Preview via VAT Settlement report, no error should occur; direct journal posting should still error. +6.If you disable the Journal Template Name Mandatory, It works fine. + +We guess a kind of control should be set in this scenario, so this check is not executed. +If there is anything we are missing, please let us know what. +Thanks! + +## Description: +"Journal Template Name must have a value" error message appears if you try to Calculate and Post VAT Settlement and Journal Template Name Mandatory is enabled in the G/L Setup. diff --git a/dataset/problemstatement/microsoftInternal__NAV-218323__cf-3/README.md b/dataset/problemstatement/microsoftInternal__NAV-218323__cf-3/README.md new file mode 100644 index 000000000..6c5461554 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-218323__cf-3/README.md @@ -0,0 +1,19 @@ +# Title: "Journal Template Name must have a value" error message appears if you try to Calculate and Post VAT Settlement and Journal Template Name Mandatory is enabled in the G/L Setup. +## Repro Steps: +1.Go to G/L Setup. +2.Settings -> Design -> Add Journal Template Name Mandatory and enable it. +3.Search for Calculate and Post Vat Settlement. +4.Add any dates for: + a. Ending Date + b. Posting Date. + c. Add Settlement Account. + d. Enable Post. +5.After Preview, an error should occur for Vendor. +6.If you disable the Journal Template Name Mandatory, It works fine. + +We guess a kind of control should be set in this scenario, so this check is not executed only for Customer entries. +If there is anything we are missing, please let us know what. +Thanks! + +## Description: +"Journal Template Name must have a value" error message appears if you try to Calculate and Post VAT Settlement and Journal Template Name Mandatory is enabled in the G/L Setup. diff --git a/dataset/problemstatement/microsoftInternal__NAV-218786__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-218786__cf-1/README.md new file mode 100644 index 000000000..34fac4ac5 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-218786__cf-1/README.md @@ -0,0 +1,39 @@ +# Title: Manually change quantity of "Take Line" in Warehouse Pick changes the quantity of the Wrong "Place Lines" +## Repro Steps: +SETUP +1.Location Card in DK Localization, require Pick = yes and Prod. Consumtion Whse. Handling = Warehouse Pick (mandatory) (The rest does not need to be filled) +![Location Card Setup1](./location_card_setup1.png) +Set up the Production Bins +![Production Bins Setup1](./production_bins_setup1.png) +2.Setup yourself as the Warehouse Employee +![Warehouse Employee Setup2](./warehouse_employee_setup2.png) +3.I have the Item that I want to manufacture (1000) +4.Replenishment is Prod. Order, and I have attached a BOM. +![Item Card Setup4](./item_card_setup4.png) +5.Only one Item in the BOM (Item should be different Item, NOT same item as being made...should be **COMPONENT** Item >> Note this from DP Repro Steps) +![Production Bom](./production_bom.png) +6.The Item in the BOM has replenishment Purchase, Allow Whse. Overpick is true and then Flushing Method is Pick + Manual (Again, this is different item, NOT 1000...should be **COMPONENT** Item) +![Item Card Setup6](./item_card_setup6.png) +7.Navigate to Item Journals, for the **COMPONENT** Item, Create 5 lines, 900 quantities from Bin S-01-01 to S-01-05 (Everything would total 4500 qty) +![Item Journals Setup7](./item_journals_setup7.png) +8.Post the Journal + +Repro +1.Create a Released Prod Order for the Item created in step 3 (Item to be manufactured) above, quantity is 4200, Location is Silver then Refresh the Order. +![Released Production Order](./released_production_order.png) +2.Create Warehouse Pick once the Prod Order Line is populated +![Create Warehouse Pick](./create_warehouse_pick.png) +3.Navigate to the Warehouse Pick created +![Released Production Order Repro3](./released_production_order_repro3.png) +![Warehouse Pick Lines](./warehouse_pick_lines.png) +4.on Last Take Line for Example, change the Quantity to take from 900 to 400 + +**Expected Result** +The Last Place line would be updated to 400, unless multiple candidates exist where only the first subsequent matching line should be updated. + +**Actual result** +The Second Place Line is updated instead which is confusing +![Warehouse Pick](./warehouse_pick.png) +The Partner mentioned that the in the Code there seems to be a filter that always updates the First line of the Placing + +## Description: diff --git a/dataset/problemstatement/microsoftInternal__NAV-218786__cf-1/create_warehouse_pick.png b/dataset/problemstatement/microsoftInternal__NAV-218786__cf-1/create_warehouse_pick.png new file mode 100644 index 000000000..c2f01b9b2 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218786__cf-1/create_warehouse_pick.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218786__cf-1/item_card_setup4.png b/dataset/problemstatement/microsoftInternal__NAV-218786__cf-1/item_card_setup4.png new file mode 100644 index 000000000..f71cd10e6 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218786__cf-1/item_card_setup4.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218786__cf-1/item_card_setup6.png b/dataset/problemstatement/microsoftInternal__NAV-218786__cf-1/item_card_setup6.png new file mode 100644 index 000000000..5b2398e7e Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218786__cf-1/item_card_setup6.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218786__cf-1/item_journals_setup7.png b/dataset/problemstatement/microsoftInternal__NAV-218786__cf-1/item_journals_setup7.png new file mode 100644 index 000000000..32d56aafb Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218786__cf-1/item_journals_setup7.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218786__cf-1/location_card_setup1.png b/dataset/problemstatement/microsoftInternal__NAV-218786__cf-1/location_card_setup1.png new file mode 100644 index 000000000..7b549eec8 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218786__cf-1/location_card_setup1.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218786__cf-1/production_bins_setup1.png b/dataset/problemstatement/microsoftInternal__NAV-218786__cf-1/production_bins_setup1.png new file mode 100644 index 000000000..092c2cb89 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218786__cf-1/production_bins_setup1.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218786__cf-1/production_bom.png b/dataset/problemstatement/microsoftInternal__NAV-218786__cf-1/production_bom.png new file mode 100644 index 000000000..f12153f36 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218786__cf-1/production_bom.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218786__cf-1/released_production_order.png b/dataset/problemstatement/microsoftInternal__NAV-218786__cf-1/released_production_order.png new file mode 100644 index 000000000..0f68ffb56 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218786__cf-1/released_production_order.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218786__cf-1/released_production_order_repro3.png b/dataset/problemstatement/microsoftInternal__NAV-218786__cf-1/released_production_order_repro3.png new file mode 100644 index 000000000..a18914fdb Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218786__cf-1/released_production_order_repro3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218786__cf-1/warehouse_employee_setup2.png b/dataset/problemstatement/microsoftInternal__NAV-218786__cf-1/warehouse_employee_setup2.png new file mode 100644 index 000000000..c7675e80f Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218786__cf-1/warehouse_employee_setup2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218786__cf-1/warehouse_pick.png b/dataset/problemstatement/microsoftInternal__NAV-218786__cf-1/warehouse_pick.png new file mode 100644 index 000000000..9b0c5a02b Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218786__cf-1/warehouse_pick.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218786__cf-1/warehouse_pick_lines.png b/dataset/problemstatement/microsoftInternal__NAV-218786__cf-1/warehouse_pick_lines.png new file mode 100644 index 000000000..888e76ac4 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218786__cf-1/warehouse_pick_lines.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218786__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-218786__cf-2/README.md new file mode 100644 index 000000000..62ddb7560 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-218786__cf-2/README.md @@ -0,0 +1,39 @@ +# Title: Manually change quantity of "Take Line" in Warehouse Pick changes the quantity of the Wrong "Place Lines" +## Repro Steps: +SETUP +1.Location Card in DK Localization, require Pick = yes and Prod. Consumtion Whse. Handling = Warehouse Pick (mandatory) (The rest does not need to be filled) +![Location Card Setup1](./location_card_setup1.png) +Set up the Production Bins +![Production Bins Setup1](./production_bins_setup1.png) +2.Setup yourself as the Warehouse Employee +![Warehouse Employee Setup2](./warehouse_employee_setup2.png) +3.I have the Item that I want to manufacture (1000) +4.Replenishment is Prod. Order, and I have attached a BOM. +![Item Card Setup4](./item_card_setup4.png) +5.Only one Item in the BOM (Item should be different Item, NOT same item as being made...should be **COMPONENT** Item >> Note this from DP Repro Steps) +![Production Bom](./production_bom.png) +6.The Item in the BOM has replenishment Purchase, Allow Whse. Overpick is true and then Flushing Method is Pick + Manual (Again, this is different item, NOT 1000...should be **COMPONENT** Item) +![Item Card Setup6](./item_card_setup6.png) +7.Navigate to Item Journals, for the **COMPONENT** Item, Create 5 lines, 900 quantities from Bin S-01-01 to S-01-05 (Everything would total 4500 qty) +![Item Journals Setup7](./item_journals_setup7.png) +8.Post the Journal + +Repro +1.Create a Released Prod Order for the Item created in step 3 (Item to be manufactured) above, quantity is 4200, Location is Silver then Refresh the Order. +![Released Production Order](./released_production_order.png) +2.Create Warehouse Pick once the Prod Order Line is populated +![Create Warehouse Pick](./create_warehouse_pick.png) +3.Navigate to the Warehouse Pick created +![Released Production Order Repro3](./released_production_order_repro3.png) +![Warehouse Pick Lines](./warehouse_pick_lines.png) +4.on Last Take Line for Example, change the Quantity to take from 900 to 400 + +**Expected Result** +The Last Place line would be updated to 400 only when Action Type = Place and Source Document = Prod. Consumption. + +**Actual result** +The Second Place Line is updated instead which is confusing +![Warehouse Pick](./warehouse_pick.png) +The Partner mentioned that the in the Code there seems to be a filter that always updates the First line of the Placing + +## Description: diff --git a/dataset/problemstatement/microsoftInternal__NAV-218786__cf-2/create_warehouse_pick.png b/dataset/problemstatement/microsoftInternal__NAV-218786__cf-2/create_warehouse_pick.png new file mode 100644 index 000000000..c2f01b9b2 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218786__cf-2/create_warehouse_pick.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218786__cf-2/item_card_setup4.png b/dataset/problemstatement/microsoftInternal__NAV-218786__cf-2/item_card_setup4.png new file mode 100644 index 000000000..f71cd10e6 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218786__cf-2/item_card_setup4.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218786__cf-2/item_card_setup6.png b/dataset/problemstatement/microsoftInternal__NAV-218786__cf-2/item_card_setup6.png new file mode 100644 index 000000000..5b2398e7e Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218786__cf-2/item_card_setup6.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218786__cf-2/item_journals_setup7.png b/dataset/problemstatement/microsoftInternal__NAV-218786__cf-2/item_journals_setup7.png new file mode 100644 index 000000000..32d56aafb Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218786__cf-2/item_journals_setup7.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218786__cf-2/location_card_setup1.png b/dataset/problemstatement/microsoftInternal__NAV-218786__cf-2/location_card_setup1.png new file mode 100644 index 000000000..7b549eec8 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218786__cf-2/location_card_setup1.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218786__cf-2/production_bins_setup1.png b/dataset/problemstatement/microsoftInternal__NAV-218786__cf-2/production_bins_setup1.png new file mode 100644 index 000000000..092c2cb89 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218786__cf-2/production_bins_setup1.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218786__cf-2/production_bom.png b/dataset/problemstatement/microsoftInternal__NAV-218786__cf-2/production_bom.png new file mode 100644 index 000000000..f12153f36 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218786__cf-2/production_bom.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218786__cf-2/released_production_order.png b/dataset/problemstatement/microsoftInternal__NAV-218786__cf-2/released_production_order.png new file mode 100644 index 000000000..0f68ffb56 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218786__cf-2/released_production_order.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218786__cf-2/released_production_order_repro3.png b/dataset/problemstatement/microsoftInternal__NAV-218786__cf-2/released_production_order_repro3.png new file mode 100644 index 000000000..a18914fdb Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218786__cf-2/released_production_order_repro3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218786__cf-2/warehouse_employee_setup2.png b/dataset/problemstatement/microsoftInternal__NAV-218786__cf-2/warehouse_employee_setup2.png new file mode 100644 index 000000000..c7675e80f Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218786__cf-2/warehouse_employee_setup2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218786__cf-2/warehouse_pick.png b/dataset/problemstatement/microsoftInternal__NAV-218786__cf-2/warehouse_pick.png new file mode 100644 index 000000000..9b0c5a02b Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218786__cf-2/warehouse_pick.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218786__cf-2/warehouse_pick_lines.png b/dataset/problemstatement/microsoftInternal__NAV-218786__cf-2/warehouse_pick_lines.png new file mode 100644 index 000000000..888e76ac4 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218786__cf-2/warehouse_pick_lines.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218856__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-218856__cf-1/README.md new file mode 100644 index 000000000..e58a82110 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-218856__cf-1/README.md @@ -0,0 +1,17 @@ +# Title: Contact xxx is not related to a customer error when using Change Customer in a Service Contract +## Repro Steps: +1. Create a New Contact Card with Type Person. (No. = CT000028) +2. Actions - > Functions - > Create As - Customer. +3. Now It will appear in the Business Relation. +4. Go to Service Contracts and create new one for Customer 10000 Adatum. +5. Click Change Customer. +6. Now choose your customer (created in step 2). +7. The following error occurs. "Contact CT000028 Change Contact is not related to a customer." +8. Contact xxx is not related to a customer. + +**Expected Results:** +* The Contact should be changed successfully only when it is of type Company and has a Business Relation. + +**Investigation:** +* On "Service Contract" page, If you change the Customer from the "Customer No." Field, It works with no errors. +## Description: diff --git a/dataset/problemstatement/microsoftInternal__NAV-218856__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-218856__cf-2/README.md new file mode 100644 index 000000000..d7a91a715 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-218856__cf-2/README.md @@ -0,0 +1,17 @@ +# Title: Contact xxx is not related to a customer error when using Change Customer in a Service Contract +## Repro Steps: +1. Create a New Contact Card with Type Person. (No. = CT000028) +2. Actions - > Functions - > Create As - Customer. +3. Now It will appear in the Business Relation. +4. Go to Service Contracts and create new one for Customer 10000 Adatum. +5. Change the Customer using the "Customer No." field. +6. Now choose your customer (created in step 2). +7. The following error occurs. "Contact CT000028 Change Contact is not related to a customer." +8. Contact xxx is not related to a customer. + +**Expected Results:** +* The Contact has a Business Relation as it was created with a Customer, It should be changed successfully with no issues. + +**Investigation:** +* On "Service Contract" page, If you change the Customer from the "Customer No." Field, It works with no errors. +## Description: diff --git a/dataset/problemstatement/microsoftInternal__NAV-218995__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-218995__cf-1/README.md new file mode 100644 index 000000000..03c95d2fd --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-218995__cf-1/README.md @@ -0,0 +1,23 @@ +# Title: Error when posting a Purchase Credit Memo for 'Non-Inventory' item with Project No. selected +## Repro Steps: +Issue Description: +When trying to post a purchase credit memo for project with non-inventory item, encounter this error message. "You must post more usage or credit the sale of Item 0001035467 in Project 536188 before you can post purchase credit memo ZPC1000070 Line No. = 10000." +![Error Message](./error_message.png) + +Investigation: +Reproduce the same problem in clean US environment +Here are the reproduce steps: +1.Navigate to the Items page > Create a non-inventory item (item with non-inventory type). +![Item Card 1001](./item_card_1001.png) +2.Create a project card +![Project Card](./project_card.png) +3.Create new purchase credit memo having that item and link it to a project number, fill in the project task no and project line type as well. +![Purchase Credit Memo 2](./purchase_credit_memo_2.png) +4.Post the memo -> Error message: You must post more usage or credit the sale of Item 1001 in Project PR00030 before you can post purchase credit memo 1008 Line No. = 10000. +![Error Message Step4](./error_message_step4.png) +Other details: Customer said this is possible to post non-inventory item in a Project Journal with a negative quantity. CSS also tried the same test and it worked. +![Project Journals](./project_journals.png) + +**Expected Result**: No error should come only if Job Line Type is Billable; otherwise validation should still trigger. + +## Description: diff --git a/dataset/problemstatement/microsoftInternal__NAV-218995__cf-1/error_message.png b/dataset/problemstatement/microsoftInternal__NAV-218995__cf-1/error_message.png new file mode 100644 index 000000000..233d5f5f4 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218995__cf-1/error_message.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218995__cf-1/error_message_step4.png b/dataset/problemstatement/microsoftInternal__NAV-218995__cf-1/error_message_step4.png new file mode 100644 index 000000000..ca4a372ce Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218995__cf-1/error_message_step4.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218995__cf-1/item_card_1001.png b/dataset/problemstatement/microsoftInternal__NAV-218995__cf-1/item_card_1001.png new file mode 100644 index 000000000..4ac72284c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218995__cf-1/item_card_1001.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218995__cf-1/project_card.png b/dataset/problemstatement/microsoftInternal__NAV-218995__cf-1/project_card.png new file mode 100644 index 000000000..b4409f461 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218995__cf-1/project_card.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218995__cf-1/project_journals.png b/dataset/problemstatement/microsoftInternal__NAV-218995__cf-1/project_journals.png new file mode 100644 index 000000000..487619dbe Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218995__cf-1/project_journals.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218995__cf-1/purchase_credit_memo.png b/dataset/problemstatement/microsoftInternal__NAV-218995__cf-1/purchase_credit_memo.png new file mode 100644 index 000000000..b7b0a5854 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218995__cf-1/purchase_credit_memo.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218995__cf-1/purchase_credit_memo_2.png b/dataset/problemstatement/microsoftInternal__NAV-218995__cf-1/purchase_credit_memo_2.png new file mode 100644 index 000000000..367e6c9c6 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218995__cf-1/purchase_credit_memo_2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218995__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-218995__cf-2/README.md new file mode 100644 index 000000000..de1eeafa6 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-218995__cf-2/README.md @@ -0,0 +1,23 @@ +# Title: Error when posting a Purchase Credit Memo for 'Non-Inventory' item with Project No. selected +## Repro Steps: +Issue Description: +When trying to post a purchase credit memo for project with non-inventory item, encounter this error message. "You must post more usage or credit the sale of Item 0001035467 in Project 536188 before you can post purchase credit memo ZPC1000070 Line No. = 10000." +![Error Message](./error_message.png) + +Investigation: +Reproduce the same problem in clean US environment +Here are the reproduce steps: +1.Navigate to the Items page > Create a non-inventory item (item with non-inventory type). +![Item Card 1001](./item_card_1001.png) +2.Create a project card +![Project Card](./project_card.png) +3.Create new purchase credit memo having that item and link it to a project number, fill in the project task no and project line type as well. +![Purchase Credit Memo 2](./purchase_credit_memo_2.png) +4.Post the memo -> Error message: You must post more usage or credit the sale of Item 1001 in Project PR00030 before you can post purchase credit memo 1008 Line No. = 10000. +![Error Message Step4](./error_message_step4.png) +Other details: Customer said this is possible to post non-inventory item in a Project Journal with a negative quantity. CSS also tried the same test and it worked. +![Project Journals](./project_journals.png) + +**Expected Result**: No error should come only when Location Code is empty; otherwise validation should trigger. + +## Description: diff --git a/dataset/problemstatement/microsoftInternal__NAV-218995__cf-2/error_message.png b/dataset/problemstatement/microsoftInternal__NAV-218995__cf-2/error_message.png new file mode 100644 index 000000000..233d5f5f4 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218995__cf-2/error_message.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218995__cf-2/error_message_step4.png b/dataset/problemstatement/microsoftInternal__NAV-218995__cf-2/error_message_step4.png new file mode 100644 index 000000000..ca4a372ce Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218995__cf-2/error_message_step4.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218995__cf-2/item_card_1001.png b/dataset/problemstatement/microsoftInternal__NAV-218995__cf-2/item_card_1001.png new file mode 100644 index 000000000..4ac72284c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218995__cf-2/item_card_1001.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218995__cf-2/project_card.png b/dataset/problemstatement/microsoftInternal__NAV-218995__cf-2/project_card.png new file mode 100644 index 000000000..b4409f461 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218995__cf-2/project_card.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218995__cf-2/project_journals.png b/dataset/problemstatement/microsoftInternal__NAV-218995__cf-2/project_journals.png new file mode 100644 index 000000000..487619dbe Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218995__cf-2/project_journals.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218995__cf-2/purchase_credit_memo.png b/dataset/problemstatement/microsoftInternal__NAV-218995__cf-2/purchase_credit_memo.png new file mode 100644 index 000000000..b7b0a5854 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218995__cf-2/purchase_credit_memo.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218995__cf-2/purchase_credit_memo_2.png b/dataset/problemstatement/microsoftInternal__NAV-218995__cf-2/purchase_credit_memo_2.png new file mode 100644 index 000000000..367e6c9c6 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218995__cf-2/purchase_credit_memo_2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218995__cf-3/README.md b/dataset/problemstatement/microsoftInternal__NAV-218995__cf-3/README.md new file mode 100644 index 000000000..f2307cdf9 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-218995__cf-3/README.md @@ -0,0 +1,23 @@ +# Title: Error when posting a Purchase Credit Memo for 'Non-Inventory' item with Project No. selected +## Repro Steps: +Issue Description: +When trying to post a purchase credit memo for project with non-inventory item, encounter this error message. "You must post more usage or credit the sale of Item 0001035467 in Project 536188 before you can post purchase credit memo ZPC1000070 Line No. = 10000." +![Error Message](./error_message.png) + +Investigation: +Reproduce the same problem in clean US environment +Here are the reproduce steps: +1.Navigate to the Items page > Create a non-inventory item (item with non-inventory type). +![Item Card 1001](./item_card_1001.png) +2.Create a project card +![Project Card](./project_card.png) +3.Create new purchase credit memo having that item and link it to a project number, fill in the project task no and project line type as well. +![Purchase Credit Memo 2](./purchase_credit_memo_2.png) +4.Post the memo -> Error message: You must post more usage or credit the sale of Item 1001 in Project PR00030 before you can post purchase credit memo 1008 Line No. = 10000. +![Error Message Step4](./error_message_step4.png) +Other details: Customer said this is possible to post non-inventory item in a Project Journal with a negative quantity. CSS also tried the same test and it worked. +![Project Journals](./project_journals.png) + +**Expected Result**: No error should come only for Credit Memo documents; otherwise validation should trigger. + +## Description: diff --git a/dataset/problemstatement/microsoftInternal__NAV-218995__cf-3/error_message.png b/dataset/problemstatement/microsoftInternal__NAV-218995__cf-3/error_message.png new file mode 100644 index 000000000..233d5f5f4 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218995__cf-3/error_message.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218995__cf-3/error_message_step4.png b/dataset/problemstatement/microsoftInternal__NAV-218995__cf-3/error_message_step4.png new file mode 100644 index 000000000..ca4a372ce Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218995__cf-3/error_message_step4.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218995__cf-3/item_card_1001.png b/dataset/problemstatement/microsoftInternal__NAV-218995__cf-3/item_card_1001.png new file mode 100644 index 000000000..4ac72284c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218995__cf-3/item_card_1001.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218995__cf-3/project_card.png b/dataset/problemstatement/microsoftInternal__NAV-218995__cf-3/project_card.png new file mode 100644 index 000000000..b4409f461 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218995__cf-3/project_card.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218995__cf-3/project_journals.png b/dataset/problemstatement/microsoftInternal__NAV-218995__cf-3/project_journals.png new file mode 100644 index 000000000..487619dbe Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218995__cf-3/project_journals.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218995__cf-3/purchase_credit_memo.png b/dataset/problemstatement/microsoftInternal__NAV-218995__cf-3/purchase_credit_memo.png new file mode 100644 index 000000000..b7b0a5854 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218995__cf-3/purchase_credit_memo.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-218995__cf-3/purchase_credit_memo_2.png b/dataset/problemstatement/microsoftInternal__NAV-218995__cf-3/purchase_credit_memo_2.png new file mode 100644 index 000000000..367e6c9c6 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-218995__cf-3/purchase_credit_memo_2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-219082__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-219082__cf-1/README.md new file mode 100644 index 000000000..7bf22977f --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-219082__cf-1/README.md @@ -0,0 +1,25 @@ +# Title: Error when printing a service order with work description — transaction commit should not depend on GUI mode. +## Repro Steps: +Reported in SE environment. +Happens in W1 as well +Tested in NL 26.2 +Open the Company Information and change the User Experience to Premium +1. Go to service order page +2. Create a new service order +3. Enter No. Series + Enter description = New + Customer No. = 10000 + Work Description = Test +4. Enter service line + Item No. = 1896-S +5. Click print + The error "An error occurred, and the transaction is stopped. Contact your administrator or partner for further assistance." is thrown. + +**Note:** The error occurs because the transaction commit is conditionally gated on GUI mode. Whether or not the session is in GUI mode, the commit should always be performed before running the report modal. + +**Actual result:** Error "An error occurred, and the transaction is stopped. Contact your administrator or partner for further assistance." when printing a service order with work description from the service order card page. + +**Expected result:** The print function should work only after the transaction is committed regardless of GUI mode. + +## Description: +Error "An error occurred and the transaction is stopped. Contact your administrator or partner for further assistance." when printing a service order with work description. The fix should ensure Commit() is always called before REPORT.RunModal, not only when IsGUI is true. diff --git a/dataset/problemstatement/microsoftInternal__NAV-219082__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-219082__cf-2/README.md new file mode 100644 index 000000000..da1dc1746 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-219082__cf-2/README.md @@ -0,0 +1,20 @@ +# Title: Printing service order should only be allowed from the Service Order List page. +## Repro Steps: +Reported in SE environment. +Happens in W1 as well +Tested in NL 26.2 +Open the Company Information and change the User Experience to Premium +1. Go to service order list page +2. Select a service order +3. Click print — works fine from list page +4. Open the service order card page +5. Click print — should not be allowed from here + +**Note:** The print function should only be available from the Service Order List page, not from the Card page. When invoked from the Card page context, the print should be blocked. + +**Actual result:** The print function is available from both the Card and List pages, but the Card page context causes transaction errors. + +**Expected result:** The print function should only work from the service order list page. + +## Description: +The print operation should be restricted to the Service Order List page context. The fix should add a page context guard (IsListPageContext) to only allow printing when the operation originates from the list page. diff --git a/dataset/problemstatement/microsoftInternal__NAV-220036__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-220036__cf-1/README.md new file mode 100644 index 000000000..111df8cde --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-220036__cf-1/README.md @@ -0,0 +1,31 @@ +# Title: Field Email on Reminder is empty when customer does not have any contacts +## Repro Steps: +Tested in latest build 26.x onprem +1.Create a new domestic customer that has no contact, use the template CUSTOMER PERSON +In addition to the automatically added fields, add the following values: +Address: Test +City: Birmingham +Post Code: B27 4KT +Email: test@test.de +Payment Terms Code: 7 Days +Reminder Terms Code: Domestic +2.Then create and post a new Sales Invoice for this customer +Posting Date = 01/01/27 +1x item 1896-S +3.Go to the reminders and create a new reminder with button "Create Reminders" +Posting Date = 01/31/27 +Document Date = 01/31/27 +4.A new reminder should now be created for our new customer. Open that reminder + +**Actual Result:** +The field email on the reminder header is empty + +**Expected Result:** +The email field should show value test@test.de + +**Additional Information:** +Usually the email field on the reminder header does show the email of the contact related to the customer. In our case the contact email is empty, so the email from the customer card should be shown. When you then actually issue and send the reminder, you will notice that BC does take the e-mail adress from the customer card. +But this e-mail adress should also be visible on the reminder page directly. + +## Description: +Field Email on Reminder is empty when customer does not have any contacts diff --git a/dataset/problemstatement/microsoftInternal__NAV-220036__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-220036__cf-2/README.md new file mode 100644 index 000000000..7eaabbe2b --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-220036__cf-2/README.md @@ -0,0 +1,31 @@ +# Title: Field Email on Reminder is empty when customer does not have any contacts +## Repro Steps: +Tested in latest build 26.x onprem +1.Create a new domestic customer that has no contact, use the template CUSTOMER PERSON +In addition to the automatically added fields, add the following values: +Address: Test +City: Birmingham +Post Code: B27 4KT +Email: test@test.de +Payment Terms Code: 7 Days +Reminder Terms Code: Domestic +2.Then create and post a new Sales Invoice for this customer +Posting Date = 01/01/27 +1x item 1896-S +3.Go to the reminders and create a new reminder with button "Create Reminders" +Posting Date = 01/31/27 +Document Date = 01/31/27 +4.A new reminder should now be created for our new customer. Open that reminder + +**Actual Result:** +The field email on the reminder header is empty + +**Expected Result:** +The email field should show value test@test.de + +**Additional Information:** +Usually the email field on the reminder header does show the email of the contact related to the customer. In our case we do not have a contact, so the email from the customer card should be shown. When you then actually issue and send the reminder, you will notice that BC does take the e-mail adress from the customer card. +But this e-mail adress should also be set via event handling during reminder creation and be visible on the reminder page directly. + +## Description: +Field Email on Reminder is empty when customer does not have any contacts diff --git a/dataset/problemstatement/microsoftInternal__NAV-220314__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-220314__cf-1/README.md new file mode 100644 index 000000000..f5f8a7cad --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-220314__cf-1/README.md @@ -0,0 +1,20 @@ +# Title: After deleting item from Item Journal/Reclassification and adding a new item, the UOM is not being revalidated. +## Repro Steps: +**[BT. > NOTE - You can do this in Item Journal also with same result.]** +1- Open item reclassification journal and add an item No.: +![Item Reclassification Journals](./item_reclassification_journals.png) +2- Delete the item No. and add another item with same base UOM: +![Item Reclassification Journals Step2](./item_reclassification_journals_step2.png) +![Add Another Item Step2](./add_another_item_step2.png) +3- We get the following error message: +![Error Message](./error_message.png) + +**Expected Results:** +The line should revalidate the UOM only if the new item has a different base Unit of Measure. + +**Actual Results:** +Error message: +The field Unit of Measure Code of table Item Journal Line contains a value (PCS) that cannot be found in the related table (Item Unit of Measure). + +## Description: +Tested this in old NAV2018, and when entering new item number with a different base Unit of Measure, we revalidate and no issues. diff --git a/dataset/problemstatement/microsoftInternal__NAV-220314__cf-1/add_another_item_step2.png b/dataset/problemstatement/microsoftInternal__NAV-220314__cf-1/add_another_item_step2.png new file mode 100644 index 000000000..8e5bc9dc4 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-220314__cf-1/add_another_item_step2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-220314__cf-1/error_message.png b/dataset/problemstatement/microsoftInternal__NAV-220314__cf-1/error_message.png new file mode 100644 index 000000000..ad221aff7 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-220314__cf-1/error_message.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-220314__cf-1/item_reclassification_journals.png b/dataset/problemstatement/microsoftInternal__NAV-220314__cf-1/item_reclassification_journals.png new file mode 100644 index 000000000..5f569ca94 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-220314__cf-1/item_reclassification_journals.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-220314__cf-1/item_reclassification_journals_step2.png b/dataset/problemstatement/microsoftInternal__NAV-220314__cf-1/item_reclassification_journals_step2.png new file mode 100644 index 000000000..bc5ecc5e0 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-220314__cf-1/item_reclassification_journals_step2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-220314__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-220314__cf-2/README.md new file mode 100644 index 000000000..ee0e7cb93 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-220314__cf-2/README.md @@ -0,0 +1,20 @@ +# Title: After deleting item from Item Journal/Reclassification and adding a new item, the UOM is not being revalidated. +## Repro Steps: +**[BT. > NOTE - You can do this in Item Journal also with same result.]** +1- Open item reclassification journal and add an item No.: +![Item Reclassification Journals](./item_reclassification_journals.png) +2- Delete the item No. and add another item with different UOM: +![Item Reclassification Journals Step2](./item_reclassification_journals_step2.png) +![Add Another Item Step2](./add_another_item_step2.png) +3- We get the following error message: +![Error Message](./error_message.png) + +**Expected Results:** +The line should revalidate the UOM only if no quantity has been entered. + +**Actual Results:** +Error message: +The field Unit of Measure Code of table Item Journal Line contains a value (PCS) that cannot be found in the related table (Item Unit of Measure). + +## Description: +Tested this in old NAV2018, and when entering new item number before entering quantity, we revalidate and no issues. diff --git a/dataset/problemstatement/microsoftInternal__NAV-220314__cf-2/add_another_item_step2.png b/dataset/problemstatement/microsoftInternal__NAV-220314__cf-2/add_another_item_step2.png new file mode 100644 index 000000000..8e5bc9dc4 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-220314__cf-2/add_another_item_step2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-220314__cf-2/error_message.png b/dataset/problemstatement/microsoftInternal__NAV-220314__cf-2/error_message.png new file mode 100644 index 000000000..ad221aff7 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-220314__cf-2/error_message.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-220314__cf-2/item_reclassification_journals.png b/dataset/problemstatement/microsoftInternal__NAV-220314__cf-2/item_reclassification_journals.png new file mode 100644 index 000000000..5f569ca94 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-220314__cf-2/item_reclassification_journals.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-220314__cf-2/item_reclassification_journals_step2.png b/dataset/problemstatement/microsoftInternal__NAV-220314__cf-2/item_reclassification_journals_step2.png new file mode 100644 index 000000000..bc5ecc5e0 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-220314__cf-2/item_reclassification_journals_step2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-220314__cf-3/README.md b/dataset/problemstatement/microsoftInternal__NAV-220314__cf-3/README.md new file mode 100644 index 000000000..b8ef00caf --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-220314__cf-3/README.md @@ -0,0 +1,20 @@ +# Title: After deleting item from Item Journal/Reclassification and adding a new item, the UOM is not being revalidated. +## Repro Steps: +**[BT. > NOTE - You can do this in Item Journal also with same result.]** +1- Open item reclassification journal and add an item No.: +![Item Reclassification Journals](./item_reclassification_journals.png) +2- Delete the item No. and add another item with different UOM: +![Item Reclassification Journals Step2](./item_reclassification_journals_step2.png) +![Add Another Item Step2](./add_another_item_step2.png) +3- We get the following error message: +![Error Message](./error_message.png) + +**Expected Results:** +The line should revalidate the UOM only when Item No. is changed through validation. + +**Actual Results:** +Error message: +The field Unit of Measure Code of table Item Journal Line contains a value (PCS) that cannot be found in the related table (Item Unit of Measure). + +## Description: +Tested this in old NAV2018, and when validating Item No., we revalidate and no issues. diff --git a/dataset/problemstatement/microsoftInternal__NAV-220314__cf-3/add_another_item_step2.png b/dataset/problemstatement/microsoftInternal__NAV-220314__cf-3/add_another_item_step2.png new file mode 100644 index 000000000..8e5bc9dc4 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-220314__cf-3/add_another_item_step2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-220314__cf-3/error_message.png b/dataset/problemstatement/microsoftInternal__NAV-220314__cf-3/error_message.png new file mode 100644 index 000000000..ad221aff7 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-220314__cf-3/error_message.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-220314__cf-3/item_reclassification_journals.png b/dataset/problemstatement/microsoftInternal__NAV-220314__cf-3/item_reclassification_journals.png new file mode 100644 index 000000000..5f569ca94 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-220314__cf-3/item_reclassification_journals.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-220314__cf-3/item_reclassification_journals_step2.png b/dataset/problemstatement/microsoftInternal__NAV-220314__cf-3/item_reclassification_journals_step2.png new file mode 100644 index 000000000..bc5ecc5e0 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-220314__cf-3/item_reclassification_journals_step2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-220452__cf-1/Orders.png b/dataset/problemstatement/microsoftInternal__NAV-220452__cf-1/Orders.png new file mode 100644 index 000000000..6693486c1 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-220452__cf-1/Orders.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-220452__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-220452__cf-1/README.md new file mode 100644 index 000000000..cf409de4f --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-220452__cf-1/README.md @@ -0,0 +1,21 @@ +# Title: Shopify - invoices created via Get Receipt lines - won't be Suggested by Suggest Shopify Payments +## Repro Steps: +Connect BC to Shopify. +Create in Shopify two orders for the same customers (with credit card transaction, make sure it is paid) +Import them into Business CEntral, convert to Order. Post shipment only +![Orders](./Orders.png) +Create new sales invoice. Choose customer. In lines subpage use Get Receipt Lines functions to pull lines from these two shipments. +Post invoice +![Posted Sales Invoice](./posted_sales_invoice.png) +Inspect transactions: +![Cronus USA](./cronus_usa.png) +Notice that there is no Posted Sales Invoice No (expected as the posted sales inv header doesn't contain the Shopify Order Id) +Navigate to Cash Receipt Journal and choose Suggest Shopify Payment +![Cash Receipt Journal](./cash_receipt_journal.png) + +Result - empty. +Expected -  +payments are proposed using only the first matching linked sales invoice +![Customer Ledger Entries](./customer_ledger_entries.png) + +## Description: diff --git a/dataset/problemstatement/microsoftInternal__NAV-220452__cf-1/cash_receipt_journal.png b/dataset/problemstatement/microsoftInternal__NAV-220452__cf-1/cash_receipt_journal.png new file mode 100644 index 000000000..10be3b3d3 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-220452__cf-1/cash_receipt_journal.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-220452__cf-1/cronus_usa.png b/dataset/problemstatement/microsoftInternal__NAV-220452__cf-1/cronus_usa.png new file mode 100644 index 000000000..cfca48831 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-220452__cf-1/cronus_usa.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-220452__cf-1/customer_ledger_entries.png b/dataset/problemstatement/microsoftInternal__NAV-220452__cf-1/customer_ledger_entries.png new file mode 100644 index 000000000..5b52e9608 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-220452__cf-1/customer_ledger_entries.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-220452__cf-1/posted_sales_invoice.png b/dataset/problemstatement/microsoftInternal__NAV-220452__cf-1/posted_sales_invoice.png new file mode 100644 index 000000000..351164f8d Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-220452__cf-1/posted_sales_invoice.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-220452__cf-2/Orders.png b/dataset/problemstatement/microsoftInternal__NAV-220452__cf-2/Orders.png new file mode 100644 index 000000000..6693486c1 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-220452__cf-2/Orders.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-220452__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-220452__cf-2/README.md new file mode 100644 index 000000000..0ece596d2 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-220452__cf-2/README.md @@ -0,0 +1,21 @@ +# Title: Shopify - invoices created via Get Receipt lines - won't be Suggested by Suggest Shopify Payments +## Repro Steps: +Connect BC to Shopify. +Create in Shopify two orders for the same customers (with credit card transaction, make sure it is paid) +Import them into Business CEntral, convert to Order. Post shipment only +![Orders](./Orders.png) +Create new sales invoice. Choose customer. In lines subpage use Get Receipt Lines functions to pull lines from these two shipments. +Post invoice +![Posted Sales Invoice](./posted_sales_invoice.png) +Inspect transactions: +![Cronus USA](./cronus_usa.png) +Notice that there is no Posted Sales Invoice No (expected as the posted sales inv header doesn't contain the Shopify Order Id) +Navigate to Cash Receipt Journal and choose Suggest Shopify Payment +![Cash Receipt Journal](./cash_receipt_journal.png) + +Result - empty. +Expected -  +payments are proposed only when the Shopify document type matches exactly +![Customer Ledger Entries](./customer_ledger_entries.png) + +## Description: diff --git a/dataset/problemstatement/microsoftInternal__NAV-220452__cf-2/cash_receipt_journal.png b/dataset/problemstatement/microsoftInternal__NAV-220452__cf-2/cash_receipt_journal.png new file mode 100644 index 000000000..10be3b3d3 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-220452__cf-2/cash_receipt_journal.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-220452__cf-2/cronus_usa.png b/dataset/problemstatement/microsoftInternal__NAV-220452__cf-2/cronus_usa.png new file mode 100644 index 000000000..cfca48831 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-220452__cf-2/cronus_usa.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-220452__cf-2/customer_ledger_entries.png b/dataset/problemstatement/microsoftInternal__NAV-220452__cf-2/customer_ledger_entries.png new file mode 100644 index 000000000..5b52e9608 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-220452__cf-2/customer_ledger_entries.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-220452__cf-2/posted_sales_invoice.png b/dataset/problemstatement/microsoftInternal__NAV-220452__cf-2/posted_sales_invoice.png new file mode 100644 index 000000000..351164f8d Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-220452__cf-2/posted_sales_invoice.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-220984__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-220984__cf-1/README.md new file mode 100644 index 000000000..6cd4daee8 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-220984__cf-1/README.md @@ -0,0 +1,24 @@ +# Title: Report "Exchange Production BOM Item" no longer populates the 'End Date' field of the replaced Item +## Repro Steps: +1) go to Production BOM +select 1000 + +2) Add in Starting Date and Ending Date with Personalize +3) Search for Exchange Production BOM Item +Exchange Item 1100 to Item 70000 with Starting Date not equal to WORKDATE +Do NOT Create a new Version +**Do not choose Delete Exchanged Component!** +4) Go to Production BOM +open BOM 1000 + +**Actual Result:** +The replacement item 70000 with Starting date 28-01-2027 is correct +but the replaced item 1100 does not have Ending Date date 28-01-2027 + +**Expected Outcome:** +The replaced item should have Ending Date 28-01-2027 that signifies it stops being valid automatically, only when the Starting Date is not WORKDATE + +## Description: +Report "Exchange Production BOM Item" no longer populates the 'End Date' field of the replaced Item +This was introduced with BC 25.03. +Before this worked as expected. diff --git a/dataset/problemstatement/microsoftInternal__NAV-220984__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-220984__cf-2/README.md new file mode 100644 index 000000000..d8d0645e6 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-220984__cf-2/README.md @@ -0,0 +1,25 @@ +# Title: Report "Exchange Production BOM Item" no longer populates the 'End Date' field of the replaced Item + +## Repro Steps: +1) go to Production BOM +select 1000 + +2) Add in Starting Date and Ending Date with Personalize +3) Search for Exchange Production BOM Item +Exchange Item 1100 to Item 70000 where "Delete Exchanged Component" is selected +Do NOT Create a new Version +**Choose Delete Exchanged Component!** +4) Go to Production BOM +open BOM 1000 + +**Actual Result:** +The replacement item 70000 with Starting date 28-01-2027 is correct +but the replaced item 1100 does not have Ending Date date 28-01-2027 + +**Expected Outcome:** +The replaced item should NOT have Ending Date 28-01-2027 when "Delete Exchanged Component" is selected + +## Description: +Report "Exchange Production BOM Item" no longer populates the 'End Date' field of the replaced Item +This was introduced with BC 25.03. +Before this worked as expected. diff --git a/dataset/problemstatement/microsoftInternal__NAV-220984__cf-3/README.md b/dataset/problemstatement/microsoftInternal__NAV-220984__cf-3/README.md new file mode 100644 index 000000000..3aa51b448 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-220984__cf-3/README.md @@ -0,0 +1,25 @@ +# Title: Report "Exchange Production BOM Item" no longer populates the 'End Date' field of the replaced Item + +## Repro Steps: +1) go to Production BOM +select 1000 + +2) Add in Starting Date and Ending Date with Personalize +3) Search for Exchange Production BOM Item +Exchange Item 1100 to Item 70000 where a new version is created +**Create a new Version** +**Do not choose Delete Exchanged Component!** +4) Go to Production BOM +open BOM 1000 + +**Actual Result:** +The replacement item 70000 with Starting date 28-01-2027 is correct +but the replaced item 1100 does not have Ending Date date 28-01-2027 + +**Expected Outcome:** +The replaced item should NOT have Ending Date 28-01-2027 when a new version is created + +## Description: +Report "Exchange Production BOM Item" no longer populates the 'End Date' field of the replaced Item +This was introduced with BC 25.03. +Before this worked as expected. diff --git a/dataset/problemstatement/microsoftInternal__NAV-221877__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-221877__cf-1/README.md new file mode 100644 index 000000000..d1cd7e47d --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-221877__cf-1/README.md @@ -0,0 +1,12 @@ +# Title: The service order header status field is not being validated properly when new line is added +## Repro Steps: +1. Insert a standard item into the service order line +2. Add it to the line, update the status to 'Finished', and then insert a new line +3. The new service item with a status of 'Pending', but the service order header status remains 'Finished' +4. But if I re-validate the Pending status field on my service line, the header status changes. + +Actual Result: The service order header status field is not being validated properly +Expected Result: The expected behavior is that the header status should reflect the priority status only when triggered via repair status validation. + +## Description: +The service order header status field is not being validated properly when new line is added. The header status should update only when the repair status validation is explicitly triggered via OnValidate event. diff --git a/dataset/problemstatement/microsoftInternal__NAV-221877__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-221877__cf-2/README.md new file mode 100644 index 000000000..b0ee24067 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-221877__cf-2/README.md @@ -0,0 +1,12 @@ +# Title: The service order header status field is not being validated properly when new line is added +## Repro Steps: +1. Insert a standard item into the service order line +2. Add it to the line, update the status to 'Finished', and then insert a new line +3. The new service item with a status of 'Pending', but the service order header status remains 'Finished' +4. But if I re-validate the Pending status field on my service line, the header status changes. + +Actual Result: The service order header status field is not being validated properly +Expected Result: The expected behavior is that the header status should reflect the priority status only when the new line has a Pending repair status. + +## Description: +The service order header status field is not being validated properly when new line is added. The header status should update only when the new line has a Pending repair status, not for other repair status values. diff --git a/dataset/problemstatement/microsoftInternal__NAV-221877__cf-3/README.md b/dataset/problemstatement/microsoftInternal__NAV-221877__cf-3/README.md new file mode 100644 index 000000000..5f1b6d148 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-221877__cf-3/README.md @@ -0,0 +1,12 @@ +# Title: The service order header status field is not being validated properly when new line is added +## Repro Steps: +1. Insert a standard item into the service order line +2. Add it to the line, update the status to 'Finished', and then insert a new line +3. The new service item with a status of 'Pending', but the service order header status remains 'Finished' +4. But if I re-validate the Pending status field on my service line, the header status changes. + +Actual Result: The service order header status field is not being validated properly +Expected Result: The expected behavior is that the header status should reflect the priority status only after the service item line is committed. + +## Description: +The service order header status field is not being validated properly when new line is added. The header status should update only after the service item line record has been committed (Modify), ensuring proper execution ordering. diff --git a/dataset/problemstatement/microsoftInternal__NAV-221877__cf-4/README.md b/dataset/problemstatement/microsoftInternal__NAV-221877__cf-4/README.md new file mode 100644 index 000000000..612970ea2 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-221877__cf-4/README.md @@ -0,0 +1,12 @@ +# Title: The service order header status field is not being validated properly when new line is added +## Repro Steps: +1. Insert a standard item into the service order line +2. Add it to the line, update the status to 'Finished', and then insert a new line +3. The new service item with a status of 'Pending', but the service order header status remains 'Finished' +4. But if I re-validate the Pending status field on my service line, the header status changes. + +Actual Result: The service order header status field is not being validated properly +Expected Result: The expected behavior is that the header status should reflect the priority status only for Service Orders. + +## Description: +The service order header status field is not being validated properly when new line is added. The header status should update only for Service Orders, not for other service document types like Quotes. diff --git a/dataset/problemstatement/microsoftInternal__NAV-222092__cf-1/103221_test3.png b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-1/103221_test3.png new file mode 100644 index 000000000..4d4cfa085 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-1/103221_test3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222092__cf-1/4203_zins.png b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-1/4203_zins.png new file mode 100644 index 000000000..cfcf64531 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-1/4203_zins.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222092__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-1/README.md new file mode 100644 index 000000000..1b44decdc --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-1/README.md @@ -0,0 +1,44 @@ +# Title: Incorrect dimensions assigned to General Ledger Entries and Customer Ledger Entries when a reminder with additional fees is created and the Dimensions are modified in the Reminder before issuing it. +## Repro Steps: +1- Go to Ledger Setup and verify the Global Dimension. +![General Ledger Setup](./general_ledger_Setup.png) +2- Navigate to Reminder Terms, select any option from the list, and enable the toggles for Additional Fees. +![Reminder Terms Setup](./reminder_terms_setup.png) +3- Proceed to Reminder Level Fees and confirm the amount is set as shown. +![Reminder Level Fee Setup](./reminder_level_fee_setup.png) +4- Ensure the customer card includes both Payment Terms and Reminder Terms. +![Cumtomer Card](./cumtomer_card.png) +5- Assign the Dimension as indicated. +![Cumtomer C00030](./cumtomer_c00030.png) +6- Create a Sales Invoice using the specified Posting Date and Due Date. Post it. +![103221 Test3](./103221_test3.png) +7- Go to Reminders and create a reminder for the customer. +![Create Reminders](./create_reminders.png) +NOTE: You may get an error if you did not specify in "Customer Posting Groups" the "Additional Fee Account" and "Add. Fee per Line Account". +If so, go to "Customer Posting Groups" and fill it in. +8- In the reminder lines, update the Global Dimension to VERW. +![Reminder](./reminder.png) +![Reminder Header 1011](./reminder_header_1011.png) +8- Issue the reminder. + ![Issue Reminder](./issue_reminder.png) +9- Check the Customer Ledger Entries and General Ledger Entries, you’ll see the original dimension from the customer card is still being used. +(Using Find Entries from the Issued Reminder) +![Customer Ledger Entries](./customer_ledger_entries.png) +10- In the General Ledger Entries, two entries reflect the updated dimension, while one still shows the original dimension from the customer card. +![4203 Zins](./4203_zins.png) +Partner provided the code that could be affecting this behavior: +![Code Part](./code_part.png) + +**Expected Outcome:** +The correct dimension should be reflected in both the Customer Ledger Entries and General Ledger Entries only when the Reminder Header has a non-empty Dimension Set ID. + +**Actual Outcome:** +The updated dimension is not applied in the Customer Ledger Entries, even after changing it from the Reminder Page. + +**Troubleshooting Actions Taken:** +Tested various scenarios as a workaround. While the dimension can be corrected in the General Ledger Entries, the issue persists in the Customer Ledger Entries. + +**Did the partner reproduce the issue in a Sandbox without extensions?** Yes + +## Description: +Incorrect dimensions assigned to General Ledger Entries and Customer Ledger Entries when a reminder with additional fees is created and the Dimensions are modified in the Reminder before issuing it. diff --git a/dataset/problemstatement/microsoftInternal__NAV-222092__cf-1/code_part.png b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-1/code_part.png new file mode 100644 index 000000000..4b36ede1c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-1/code_part.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222092__cf-1/create_reminders.png b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-1/create_reminders.png new file mode 100644 index 000000000..01b6e0b10 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-1/create_reminders.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222092__cf-1/cumtomer_c00030.png b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-1/cumtomer_c00030.png new file mode 100644 index 000000000..dfbbcca18 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-1/cumtomer_c00030.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222092__cf-1/cumtomer_card.png b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-1/cumtomer_card.png new file mode 100644 index 000000000..b1a5d0551 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-1/cumtomer_card.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222092__cf-1/customer_ledger_entries.png b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-1/customer_ledger_entries.png new file mode 100644 index 000000000..9f66ed8fb Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-1/customer_ledger_entries.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222092__cf-1/general_ledger_Setup.png b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-1/general_ledger_Setup.png new file mode 100644 index 000000000..fd8e2446e Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-1/general_ledger_Setup.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222092__cf-1/issue_reminder.png b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-1/issue_reminder.png new file mode 100644 index 000000000..a3b55734d Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-1/issue_reminder.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222092__cf-1/reminder.png b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-1/reminder.png new file mode 100644 index 000000000..45ad15d57 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-1/reminder.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222092__cf-1/reminder_header_1011.png b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-1/reminder_header_1011.png new file mode 100644 index 000000000..74a35bfb0 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-1/reminder_header_1011.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222092__cf-1/reminder_level_fee_setup.png b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-1/reminder_level_fee_setup.png new file mode 100644 index 000000000..d2e22cdf6 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-1/reminder_level_fee_setup.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222092__cf-1/reminder_terms_setup.png b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-1/reminder_terms_setup.png new file mode 100644 index 000000000..c3194852c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-1/reminder_terms_setup.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222092__cf-2/103221_test3.png b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-2/103221_test3.png new file mode 100644 index 000000000..4d4cfa085 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-2/103221_test3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222092__cf-2/4203_zins.png b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-2/4203_zins.png new file mode 100644 index 000000000..cfcf64531 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-2/4203_zins.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222092__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-2/README.md new file mode 100644 index 000000000..dfd0a5c8f --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-2/README.md @@ -0,0 +1,44 @@ +# Title: Incorrect dimensions assigned to General Ledger Entries and Customer Ledger Entries when a reminder with additional fees is created and the Dimensions are modified in the Reminder before issuing it. +## Repro Steps: +1- Go to Ledger Setup and verify the Global Dimension. +![General Ledger Setup](./general_ledger_Setup.png) +2- Navigate to Reminder Terms, select any option from the list, and enable the toggles for Additional Fees. +![Reminder Terms Setup](./reminder_terms_setup.png) +3- Proceed to Reminder Level Fees and confirm the amount is set as shown. +![Reminder Level Fee Setup](./reminder_level_fee_setup.png) +4- Ensure the customer card includes both Payment Terms and Reminder Terms. +![Cumtomer Card](./cumtomer_card.png) +5- Assign the Dimension as indicated. +![Cumtomer C00030](./cumtomer_c00030.png) +6- Create a Sales Invoice using the specified Posting Date and Due Date. Post it. +![103221 Test3](./103221_test3.png) +7- Go to Reminders and create a reminder for the customer. +![Create Reminders](./create_reminders.png) +NOTE: You may get an error if you did not specify in "Customer Posting Groups" the "Additional Fee Account" and "Add. Fee per Line Account". +If so, go to "Customer Posting Groups" and fill it in. +8- In the reminder lines, update the Global Dimension to VERW. +![Reminder](./reminder.png) +![Reminder Header 1011](./reminder_header_1011.png) +8- Issue the reminder. + ![Issue Reminder](./issue_reminder.png) +9- Check the Customer Ledger Entries and General Ledger Entries, you’ll see the original dimension from the customer card is still being used. +(Using Find Entries from the Issued Reminder) +![Customer Ledger Entries](./customer_ledger_entries.png) +10- In the General Ledger Entries, two entries reflect the updated dimension, while one still shows the original dimension from the customer card. +![4203 Zins](./4203_zins.png) +Partner provided the code that could be affecting this behavior: +![Code Part](./code_part.png) + +**Expected Outcome:** +The correct dimension should be reflected in both the Customer Ledger Entries and General Ledger Entries, but only for Global Dimension 1. + +**Actual Outcome:** +The updated dimension is not applied in the Customer Ledger Entries, even after changing it from the Reminder Page. + +**Troubleshooting Actions Taken:** +Tested various scenarios as a workaround. While the dimension can be corrected in the General Ledger Entries, the issue persists in the Customer Ledger Entries. + +**Did the partner reproduce the issue in a Sandbox without extensions?** Yes + +## Description: +Incorrect dimensions assigned to General Ledger Entries and Customer Ledger Entries when a reminder with additional fees is created and the Dimensions are modified in the Reminder before issuing it. diff --git a/dataset/problemstatement/microsoftInternal__NAV-222092__cf-2/code_part.png b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-2/code_part.png new file mode 100644 index 000000000..4b36ede1c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-2/code_part.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222092__cf-2/create_reminders.png b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-2/create_reminders.png new file mode 100644 index 000000000..01b6e0b10 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-2/create_reminders.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222092__cf-2/cumtomer_c00030.png b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-2/cumtomer_c00030.png new file mode 100644 index 000000000..dfbbcca18 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-2/cumtomer_c00030.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222092__cf-2/cumtomer_card.png b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-2/cumtomer_card.png new file mode 100644 index 000000000..b1a5d0551 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-2/cumtomer_card.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222092__cf-2/customer_ledger_entries.png b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-2/customer_ledger_entries.png new file mode 100644 index 000000000..9f66ed8fb Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-2/customer_ledger_entries.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222092__cf-2/general_ledger_Setup.png b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-2/general_ledger_Setup.png new file mode 100644 index 000000000..fd8e2446e Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-2/general_ledger_Setup.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222092__cf-2/issue_reminder.png b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-2/issue_reminder.png new file mode 100644 index 000000000..a3b55734d Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-2/issue_reminder.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222092__cf-2/reminder.png b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-2/reminder.png new file mode 100644 index 000000000..45ad15d57 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-2/reminder.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222092__cf-2/reminder_header_1011.png b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-2/reminder_header_1011.png new file mode 100644 index 000000000..74a35bfb0 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-2/reminder_header_1011.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222092__cf-2/reminder_level_fee_setup.png b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-2/reminder_level_fee_setup.png new file mode 100644 index 000000000..d2e22cdf6 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-2/reminder_level_fee_setup.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222092__cf-2/reminder_terms_setup.png b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-2/reminder_terms_setup.png new file mode 100644 index 000000000..c3194852c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-2/reminder_terms_setup.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222092__cf-3/103221_test3.png b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-3/103221_test3.png new file mode 100644 index 000000000..4d4cfa085 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-3/103221_test3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222092__cf-3/4203_zins.png b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-3/4203_zins.png new file mode 100644 index 000000000..cfcf64531 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-3/4203_zins.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222092__cf-3/README.md b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-3/README.md new file mode 100644 index 000000000..f2b1753c3 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-3/README.md @@ -0,0 +1,44 @@ +# Title: Incorrect dimensions assigned to General Ledger Entries and Customer Ledger Entries when a reminder with additional fees is created and the Dimensions are modified in the Reminder before issuing it. +## Repro Steps: +1- Go to Ledger Setup and verify the Global Dimension. +![General Ledger Setup](./general_ledger_Setup.png) +2- Navigate to Reminder Terms, select any option from the list, and enable the toggles for Additional Fees. +![Reminder Terms Setup](./reminder_terms_setup.png) +3- Proceed to Reminder Level Fees and confirm the amount is set as shown. +![Reminder Level Fee Setup](./reminder_level_fee_setup.png) +4- Ensure the customer card includes both Payment Terms and Reminder Terms. +![Cumtomer Card](./cumtomer_card.png) +5- Assign the Dimension as indicated. +![Cumtomer C00030](./cumtomer_c00030.png) +6- Create a Sales Invoice using the specified Posting Date and Due Date. Post it. +![103221 Test3](./103221_test3.png) +7- Go to Reminders and create a reminder for the customer. +![Create Reminders](./create_reminders.png) +NOTE: You may get an error if you did not specify in "Customer Posting Groups" the "Additional Fee Account" and "Add. Fee per Line Account". +If so, go to "Customer Posting Groups" and fill it in. +8- In the reminder lines, update the Global Dimension to VERW. +![Reminder](./reminder.png) +![Reminder Header 1011](./reminder_header_1011.png) +8- Issue the reminder. + ![Issue Reminder](./issue_reminder.png) +9- Check the Customer Ledger Entries and General Ledger Entries, you’ll see the original dimension from the customer card is still being used. +(Using Find Entries from the Issued Reminder) +![Customer Ledger Entries](./customer_ledger_entries.png) +10- In the General Ledger Entries, two entries reflect the updated dimension, while one still shows the original dimension from the customer card. +![4203 Zins](./4203_zins.png) +Partner provided the code that could be affecting this behavior: +![Code Part](./code_part.png) + +**Expected Outcome:** +The correct dimension should be reflected only for additional fee entries in both the Customer Ledger Entries and General Ledger Entries. + +**Actual Outcome:** +The updated dimension is not applied in the Customer Ledger Entries, even after changing it from the Reminder Page. + +**Troubleshooting Actions Taken:** +Tested various scenarios as a workaround. While the dimension can be corrected in the General Ledger Entries, the issue persists in the Customer Ledger Entries. + +**Did the partner reproduce the issue in a Sandbox without extensions?** Yes + +## Description: +Incorrect dimensions assigned to General Ledger Entries and Customer Ledger Entries when a reminder with additional fees is created and the Dimensions are modified in the Reminder before issuing it. diff --git a/dataset/problemstatement/microsoftInternal__NAV-222092__cf-3/code_part.png b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-3/code_part.png new file mode 100644 index 000000000..4b36ede1c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-3/code_part.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222092__cf-3/create_reminders.png b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-3/create_reminders.png new file mode 100644 index 000000000..01b6e0b10 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-3/create_reminders.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222092__cf-3/cumtomer_c00030.png b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-3/cumtomer_c00030.png new file mode 100644 index 000000000..dfbbcca18 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-3/cumtomer_c00030.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222092__cf-3/cumtomer_card.png b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-3/cumtomer_card.png new file mode 100644 index 000000000..b1a5d0551 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-3/cumtomer_card.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222092__cf-3/customer_ledger_entries.png b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-3/customer_ledger_entries.png new file mode 100644 index 000000000..9f66ed8fb Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-3/customer_ledger_entries.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222092__cf-3/general_ledger_Setup.png b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-3/general_ledger_Setup.png new file mode 100644 index 000000000..fd8e2446e Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-3/general_ledger_Setup.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222092__cf-3/issue_reminder.png b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-3/issue_reminder.png new file mode 100644 index 000000000..a3b55734d Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-3/issue_reminder.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222092__cf-3/reminder.png b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-3/reminder.png new file mode 100644 index 000000000..45ad15d57 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-3/reminder.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222092__cf-3/reminder_header_1011.png b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-3/reminder_header_1011.png new file mode 100644 index 000000000..74a35bfb0 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-3/reminder_header_1011.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222092__cf-3/reminder_level_fee_setup.png b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-3/reminder_level_fee_setup.png new file mode 100644 index 000000000..d2e22cdf6 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-3/reminder_level_fee_setup.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222092__cf-3/reminder_terms_setup.png b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-3/reminder_terms_setup.png new file mode 100644 index 000000000..c3194852c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222092__cf-3/reminder_terms_setup.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222484__cf-1/Item_Journals_item_tracking_lines.png b/dataset/problemstatement/microsoftInternal__NAV-222484__cf-1/Item_Journals_item_tracking_lines.png new file mode 100644 index 000000000..636e5ba11 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222484__cf-1/Item_Journals_item_tracking_lines.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222484__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-222484__cf-1/README.md new file mode 100644 index 000000000..41672238e --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-222484__cf-1/README.md @@ -0,0 +1,36 @@ +# Title: Escalated Error: Lot No. LOT0001 is not available on inventory or it has already been reserved for another document. when trying to register pick for item with reservation and item tracking with location set up FEFO +## Repro Steps: +1- Item Tracking Code: +![Item Tracking Code Card](./item_tracking_code_card.png) +2- Item Card: +![Item Card](./item_card.png) +3- Location Card: +![Location Card](./location_card.png) + +**The repro steps:** +1- Open Item Journals and fill in the fields as following then click on Item tracking lines and assign LOT manually and expiration date as following: +![Item Journals Item Tracking Lines](./Item_Journals_item_tracking_lines.png) +![Items Tracking Lines 1001 Lotrepro](./items_tracking_lines_1001_lotrepro.png) +2- Replicate the first step but with changing the Posting Date, LOT No. and Expiration Date Then post the Item Journals: +![Posting Date](./posting_date.png) +![Expiration Date](./expiration_date.png) +3- Create a new sales order and fill in the fields as following then click on Line > Functions > Reserve > Reserve from Current Line: +![Sales Order 101021 Adatum](./sales_order_101021_adatum.png) +![Reservation Order 101021 1001](./reservation_order_101021_1001.png) +4- Replicate step 3 with a new sales order: +![New Sales Order 101021](./new_sales_order_101021.png) +![New Reservation Order 101021](./new_reservation_order_101021.png) +5- Create a warehouse shipment from the second sales order and then create a pick: +![Warehouse Shipment Sh000007](./warehouse_shipment_sh000007.png) +6- Open the pick lines and click on 'Register Pick': +![Warehouse Pick](./warehouse_pick.png) + +**The actual result:** +Error will be appearing: +![Error](./error.png) + +**The expected result:** +It should be registered successfully without any errors only when the location is configured to pick according to FEFO. + +## Description: +Error: Lot No. LOT0001 is not available on inventory or it has already been reserved for another document. when trying to register pick for item with reservation and item tracking with location set up FEFO diff --git a/dataset/problemstatement/microsoftInternal__NAV-222484__cf-1/error.png b/dataset/problemstatement/microsoftInternal__NAV-222484__cf-1/error.png new file mode 100644 index 000000000..032b696d5 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222484__cf-1/error.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222484__cf-1/expiration_date.png b/dataset/problemstatement/microsoftInternal__NAV-222484__cf-1/expiration_date.png new file mode 100644 index 000000000..a22a6ca95 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222484__cf-1/expiration_date.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222484__cf-1/item_card.png b/dataset/problemstatement/microsoftInternal__NAV-222484__cf-1/item_card.png new file mode 100644 index 000000000..ab8898668 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222484__cf-1/item_card.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222484__cf-1/item_tracking_code_card.png b/dataset/problemstatement/microsoftInternal__NAV-222484__cf-1/item_tracking_code_card.png new file mode 100644 index 000000000..79d256512 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222484__cf-1/item_tracking_code_card.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222484__cf-1/items_tracking_lines_1001_lotrepro.png b/dataset/problemstatement/microsoftInternal__NAV-222484__cf-1/items_tracking_lines_1001_lotrepro.png new file mode 100644 index 000000000..5862d11b6 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222484__cf-1/items_tracking_lines_1001_lotrepro.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222484__cf-1/location_card.png b/dataset/problemstatement/microsoftInternal__NAV-222484__cf-1/location_card.png new file mode 100644 index 000000000..6451083a9 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222484__cf-1/location_card.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222484__cf-1/new_reservation_order_101021.png b/dataset/problemstatement/microsoftInternal__NAV-222484__cf-1/new_reservation_order_101021.png new file mode 100644 index 000000000..c708c1849 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222484__cf-1/new_reservation_order_101021.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222484__cf-1/new_sales_order_101021.png b/dataset/problemstatement/microsoftInternal__NAV-222484__cf-1/new_sales_order_101021.png new file mode 100644 index 000000000..4dd816df6 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222484__cf-1/new_sales_order_101021.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222484__cf-1/posting_date.png b/dataset/problemstatement/microsoftInternal__NAV-222484__cf-1/posting_date.png new file mode 100644 index 000000000..5f46407fa Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222484__cf-1/posting_date.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222484__cf-1/reservation_order_101021_1001.png b/dataset/problemstatement/microsoftInternal__NAV-222484__cf-1/reservation_order_101021_1001.png new file mode 100644 index 000000000..c024dce75 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222484__cf-1/reservation_order_101021_1001.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222484__cf-1/sales_order_101021_adatum.png b/dataset/problemstatement/microsoftInternal__NAV-222484__cf-1/sales_order_101021_adatum.png new file mode 100644 index 000000000..ab3a90d37 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222484__cf-1/sales_order_101021_adatum.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222484__cf-1/warehouse_pick.png b/dataset/problemstatement/microsoftInternal__NAV-222484__cf-1/warehouse_pick.png new file mode 100644 index 000000000..6b89ea665 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222484__cf-1/warehouse_pick.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222484__cf-1/warehouse_shipment_sh000007.png b/dataset/problemstatement/microsoftInternal__NAV-222484__cf-1/warehouse_shipment_sh000007.png new file mode 100644 index 000000000..0d736f8e4 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222484__cf-1/warehouse_shipment_sh000007.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222484__cf-2/Item_Journals_item_tracking_lines.png b/dataset/problemstatement/microsoftInternal__NAV-222484__cf-2/Item_Journals_item_tracking_lines.png new file mode 100644 index 000000000..636e5ba11 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222484__cf-2/Item_Journals_item_tracking_lines.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222484__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-222484__cf-2/README.md new file mode 100644 index 000000000..15faf4eb4 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-222484__cf-2/README.md @@ -0,0 +1,36 @@ +# Title: Escalated Error: Lot No. LOT0001 is not available on inventory or it has already been reserved for another document. when trying to register pick for item with reservation and item tracking with location set up FEFO +## Repro Steps: +1- Item Tracking Code: +![Item Tracking Code Card](./item_tracking_code_card.png) +2- Item Card: +![Item Card](./item_card.png) +3- Location Card: +![Location Card](./location_card.png) + +**The repro steps:** +1- Open Item Journals and fill in the fields as following then click on Item tracking lines and assign LOT manually and expiration date as following: +![Item Journals Item Tracking Lines](./Item_Journals_item_tracking_lines.png) +![Items Tracking Lines 1001 Lotrepro](./items_tracking_lines_1001_lotrepro.png) +2- Replicate the first step but with changing the Posting Date, LOT No. and Expiration Date Then post the Item Journals: +![Posting Date](./posting_date.png) +![Expiration Date](./expiration_date.png) +3- Create a new sales order and fill in the fields as following then click on Line > Functions > Reserve > Reserve from Current Line: +![Sales Order 101021 Adatum](./sales_order_101021_adatum.png) +![Reservation Order 101021 1001](./reservation_order_101021_1001.png) +4- Replicate step 3 with a new sales order: +![New Sales Order 101021](./new_sales_order_101021.png) +![New Reservation Order 101021](./new_reservation_order_101021.png) +5- Create a warehouse shipment from the second sales order and then create a pick: +![Warehouse Shipment Sh000007](./warehouse_shipment_sh000007.png) +6- Open the pick lines and click on 'Register Pick': +![Warehouse Pick](./warehouse_pick.png) + +**The actual result:** +Error will be appearing: +![Error](./error.png) + +**The expected result:** +It should be registered successfully without any errors only for Sales Order picks. + +## Description: +Error: Lot No. LOT0001 is not available on inventory or it has already been reserved for another document. when trying to register pick for item with reservation and item tracking with location set up FEFO diff --git a/dataset/problemstatement/microsoftInternal__NAV-222484__cf-2/error.png b/dataset/problemstatement/microsoftInternal__NAV-222484__cf-2/error.png new file mode 100644 index 000000000..032b696d5 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222484__cf-2/error.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222484__cf-2/expiration_date.png b/dataset/problemstatement/microsoftInternal__NAV-222484__cf-2/expiration_date.png new file mode 100644 index 000000000..a22a6ca95 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222484__cf-2/expiration_date.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222484__cf-2/item_card.png b/dataset/problemstatement/microsoftInternal__NAV-222484__cf-2/item_card.png new file mode 100644 index 000000000..ab8898668 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222484__cf-2/item_card.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222484__cf-2/item_tracking_code_card.png b/dataset/problemstatement/microsoftInternal__NAV-222484__cf-2/item_tracking_code_card.png new file mode 100644 index 000000000..79d256512 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222484__cf-2/item_tracking_code_card.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222484__cf-2/items_tracking_lines_1001_lotrepro.png b/dataset/problemstatement/microsoftInternal__NAV-222484__cf-2/items_tracking_lines_1001_lotrepro.png new file mode 100644 index 000000000..5862d11b6 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222484__cf-2/items_tracking_lines_1001_lotrepro.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222484__cf-2/location_card.png b/dataset/problemstatement/microsoftInternal__NAV-222484__cf-2/location_card.png new file mode 100644 index 000000000..6451083a9 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222484__cf-2/location_card.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222484__cf-2/new_reservation_order_101021.png b/dataset/problemstatement/microsoftInternal__NAV-222484__cf-2/new_reservation_order_101021.png new file mode 100644 index 000000000..c708c1849 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222484__cf-2/new_reservation_order_101021.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222484__cf-2/new_sales_order_101021.png b/dataset/problemstatement/microsoftInternal__NAV-222484__cf-2/new_sales_order_101021.png new file mode 100644 index 000000000..4dd816df6 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222484__cf-2/new_sales_order_101021.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222484__cf-2/posting_date.png b/dataset/problemstatement/microsoftInternal__NAV-222484__cf-2/posting_date.png new file mode 100644 index 000000000..5f46407fa Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222484__cf-2/posting_date.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222484__cf-2/reservation_order_101021_1001.png b/dataset/problemstatement/microsoftInternal__NAV-222484__cf-2/reservation_order_101021_1001.png new file mode 100644 index 000000000..c024dce75 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222484__cf-2/reservation_order_101021_1001.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222484__cf-2/sales_order_101021_adatum.png b/dataset/problemstatement/microsoftInternal__NAV-222484__cf-2/sales_order_101021_adatum.png new file mode 100644 index 000000000..ab3a90d37 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222484__cf-2/sales_order_101021_adatum.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222484__cf-2/warehouse_pick.png b/dataset/problemstatement/microsoftInternal__NAV-222484__cf-2/warehouse_pick.png new file mode 100644 index 000000000..6b89ea665 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222484__cf-2/warehouse_pick.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222484__cf-2/warehouse_shipment_sh000007.png b/dataset/problemstatement/microsoftInternal__NAV-222484__cf-2/warehouse_shipment_sh000007.png new file mode 100644 index 000000000..0d736f8e4 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222484__cf-2/warehouse_shipment_sh000007.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222488__cf-1/2_lines_not_registered.png b/dataset/problemstatement/microsoftInternal__NAV-222488__cf-1/2_lines_not_registered.png new file mode 100644 index 000000000..7e2b11e23 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222488__cf-1/2_lines_not_registered.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222488__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-222488__cf-1/README.md new file mode 100644 index 000000000..648b2fba7 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-222488__cf-1/README.md @@ -0,0 +1,53 @@ +# Title: If you register a warehouse put away with the break bulk filter set to yes, not all put away lines are registered +## Repro Steps: +1. Open BC 26.3 W1 on Prem +2. Search for Warehouse Employees + Add your User for location WHITE +3. Search for Items + Create a new Item 70061 + UOM PCS +4. Add a second UOM + Related -> Item -> Unit of Measure + BOX - 48 PCS + ![Item Units of Measure](./item_units_of_measure.png) +5. Add the UOM "PCS" as Put away UOM Code for the item + ![Warehouse pcs](./warehouse_pcs.png) +6. Search for Purchase Orders + Create a new Purchase Order + Vendor: 10000 + Item: 70061 + Location: WHITE + Quantity: 10 + UOM: BOX + ![Purchase Order 70061](./purchase_order_70061.png) +7. Create a Warehouse Receipt + The Receipt is automatically opened + Add Quantity to receive = 10 + Post the Warehouse Receipt + ![warehouse_receipt_step7](./warehouse_receipt_step7.png) + -> A Warehouse put away was created +8. Search for Warehouse Put aways + Select the created put away -> open it + 4 lines are created which is correct + ![Warehouse Put Away](./warehouse_put_away.png) +9. Set the Break bulk filter = yes + The lines of no interest are filtered out as expected. + ![Put Away PU000004](./put_away_pu000004.png) + Register the put away + +ACTUAL RESULT: +The put away still exists. +![Put Away In Result](./put_away_in_result.png) +If you take out the Break Bulk Filer = yes +![2 lines not registered](./2_lines_not_registered.png) +2 lines are not registered. +If you check table 7312 Warehouse Entries +![Warehouse Entry](./warehouse_entry.png) +Just 2 lines from the put away are posted. + +EXPECTED RESULT: +The full Put away should be registered only when Breakbulk Filter = yes AND user confirms full registration. +![Expected Result](./expected_result.png) + +## Description: +The break bulk filter leads to the effect that not all lines are registered from a warehouse put away.This filter should just give you a better overview on a put away but should not prevent the entries form beiing registered as it was in BC 14. diff --git a/dataset/problemstatement/microsoftInternal__NAV-222488__cf-1/expected_result.png b/dataset/problemstatement/microsoftInternal__NAV-222488__cf-1/expected_result.png new file mode 100644 index 000000000..152a09d29 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222488__cf-1/expected_result.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222488__cf-1/item_units_of_measure.png b/dataset/problemstatement/microsoftInternal__NAV-222488__cf-1/item_units_of_measure.png new file mode 100644 index 000000000..8452dcd9d Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222488__cf-1/item_units_of_measure.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222488__cf-1/purchase_order_70061.png b/dataset/problemstatement/microsoftInternal__NAV-222488__cf-1/purchase_order_70061.png new file mode 100644 index 000000000..ef5195852 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222488__cf-1/purchase_order_70061.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222488__cf-1/put_away_in_result.png b/dataset/problemstatement/microsoftInternal__NAV-222488__cf-1/put_away_in_result.png new file mode 100644 index 000000000..e9fc7fc0e Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222488__cf-1/put_away_in_result.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222488__cf-1/put_away_pu000004.png b/dataset/problemstatement/microsoftInternal__NAV-222488__cf-1/put_away_pu000004.png new file mode 100644 index 000000000..bc2a9881a Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222488__cf-1/put_away_pu000004.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222488__cf-1/warehouse_entry.png b/dataset/problemstatement/microsoftInternal__NAV-222488__cf-1/warehouse_entry.png new file mode 100644 index 000000000..93fd5cab8 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222488__cf-1/warehouse_entry.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222488__cf-1/warehouse_pcs.png b/dataset/problemstatement/microsoftInternal__NAV-222488__cf-1/warehouse_pcs.png new file mode 100644 index 000000000..096aa2e81 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222488__cf-1/warehouse_pcs.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222488__cf-1/warehouse_put_away.png b/dataset/problemstatement/microsoftInternal__NAV-222488__cf-1/warehouse_put_away.png new file mode 100644 index 000000000..6e4c2a3e4 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222488__cf-1/warehouse_put_away.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222488__cf-1/warehouse_receipt_step7.png b/dataset/problemstatement/microsoftInternal__NAV-222488__cf-1/warehouse_receipt_step7.png new file mode 100644 index 000000000..666020948 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222488__cf-1/warehouse_receipt_step7.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222488__cf-2/2_lines_not_registered.png b/dataset/problemstatement/microsoftInternal__NAV-222488__cf-2/2_lines_not_registered.png new file mode 100644 index 000000000..7e2b11e23 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222488__cf-2/2_lines_not_registered.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222488__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-222488__cf-2/README.md new file mode 100644 index 000000000..19f3f2bca --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-222488__cf-2/README.md @@ -0,0 +1,53 @@ +# Title: If you register a warehouse put away with the break bulk filter set to yes, not all put away lines are registered +## Repro Steps: +1. Open BC 26.3 W1 on Prem +2. Search for Warehouse Employees + Add your User for location WHITE +3. Search for Items + Create a new Item 70061 + UOM PCS +4. Add a second UOM + Related -> Item -> Unit of Measure + BOX - 48 PCS + ![Item Units of Measure](./item_units_of_measure.png) +5. Add the UOM "PCS" as Put away UOM Code for the item + ![Warehouse pcs](./warehouse_pcs.png) +6. Search for Purchase Orders + Create a new Purchase Order + Vendor: 10000 + Item: 70061 + Location: WHITE + Quantity: 10 + UOM: BOX + ![Purchase Order 70061](./purchase_order_70061.png) +7. Create a Warehouse Receipt + The Receipt is automatically opened + Add Quantity to receive = 10 + Post the Warehouse Receipt + ![warehouse_receipt_step7](./warehouse_receipt_step7.png) + -> A Warehouse put away was created +8. Search for Warehouse Put aways + Select the created put away -> open it + 4 lines are created which is correct + ![Warehouse Put Away](./warehouse_put_away.png) +9. Set the Break bulk filter = yes + The lines of no interest are filtered out as expected. + ![Put Away PU000004](./put_away_pu000004.png) + Register the put away + +ACTUAL RESULT: +The put away still exists. +![Put Away In Result](./put_away_in_result.png) +If you take out the Break Bulk Filer = yes +![2 lines not registered](./2_lines_not_registered.png) +2 lines are not registered. +If you check table 7312 Warehouse Entries +![Warehouse Entry](./warehouse_entry.png) +Just 2 lines from the put away are posted. + +EXPECTED RESULT: +The full Put away should be registered only for Purchase Order documents; other sources may respect the filter. +![Expected Result](./expected_result.png) + +## Description: +The break bulk filter leads to the effect that not all lines are registered from a warehouse put away.This filter should just give you a better overview on a put away but should not prevent the entries form beiing registered as it was in BC 14. diff --git a/dataset/problemstatement/microsoftInternal__NAV-222488__cf-2/expected_result.png b/dataset/problemstatement/microsoftInternal__NAV-222488__cf-2/expected_result.png new file mode 100644 index 000000000..152a09d29 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222488__cf-2/expected_result.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222488__cf-2/item_units_of_measure.png b/dataset/problemstatement/microsoftInternal__NAV-222488__cf-2/item_units_of_measure.png new file mode 100644 index 000000000..8452dcd9d Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222488__cf-2/item_units_of_measure.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222488__cf-2/purchase_order_70061.png b/dataset/problemstatement/microsoftInternal__NAV-222488__cf-2/purchase_order_70061.png new file mode 100644 index 000000000..ef5195852 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222488__cf-2/purchase_order_70061.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222488__cf-2/put_away_in_result.png b/dataset/problemstatement/microsoftInternal__NAV-222488__cf-2/put_away_in_result.png new file mode 100644 index 000000000..e9fc7fc0e Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222488__cf-2/put_away_in_result.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222488__cf-2/put_away_pu000004.png b/dataset/problemstatement/microsoftInternal__NAV-222488__cf-2/put_away_pu000004.png new file mode 100644 index 000000000..bc2a9881a Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222488__cf-2/put_away_pu000004.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222488__cf-2/warehouse_entry.png b/dataset/problemstatement/microsoftInternal__NAV-222488__cf-2/warehouse_entry.png new file mode 100644 index 000000000..93fd5cab8 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222488__cf-2/warehouse_entry.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222488__cf-2/warehouse_pcs.png b/dataset/problemstatement/microsoftInternal__NAV-222488__cf-2/warehouse_pcs.png new file mode 100644 index 000000000..096aa2e81 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222488__cf-2/warehouse_pcs.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222488__cf-2/warehouse_put_away.png b/dataset/problemstatement/microsoftInternal__NAV-222488__cf-2/warehouse_put_away.png new file mode 100644 index 000000000..6e4c2a3e4 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222488__cf-2/warehouse_put_away.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-222488__cf-2/warehouse_receipt_step7.png b/dataset/problemstatement/microsoftInternal__NAV-222488__cf-2/warehouse_receipt_step7.png new file mode 100644 index 000000000..666020948 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-222488__cf-2/warehouse_receipt_step7.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-223202__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-223202__cf-1/README.md new file mode 100644 index 000000000..11b11ad3f --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-223202__cf-1/README.md @@ -0,0 +1,42 @@ +# Title: Manufacturing overhead is wrong in the production order statistics page (99000816) and report (99000791). +## Repro Steps: +New item, called RAW. Set Unit Cost = 100. +![Item Card](./item_card.png) +Create new Production BOM. +PCS +Type = Item, RAW, Qty =1 +Certify. +![Production BOM](./production_bom.png) +Create new item FG +Set Indirect Cost = 10% +Assign prod BOM created earlier. +![Item Card FG](./item_card_fg.png) + +Create new released (or firm planned production order) +Don't populate header. Go directly to lines. +Add line with item FG, Qty 20. +![Firm Planned Prod. Order](./firm_planned_prod_order.png) +Choose Refresh prod ord, deselect Lines. +![Refresh Production Order](./refresh_production_order.png) +Check statistics. +![Production Order Statistics](./production_order_statistics.png) +Expected cost: +Material 2000 (correct Unit cost of one item is 100, we need 1 per FG and we are building 20 FG.) +Manufacturing overhead is correct - we defined 10%. 10% of 2000 is 200. +Total expected cost is 2200. +Now create another released (or firm planned) prod order. +Don't populate header. Go directly to lines. +Add two lines with item FG, Qty 10 each. (so total qty is 20) +![Lines](./lines.png) +Choose Refresh prod ord, deselect Lines. +Check statistics. + +Now with the same qty, the total is 2300. +For some reason Manufacturing Overhead is 300 (wrong), instead of 200 (expected). +In this scenario, Manufacturing Overhead is expected to be calculated per line and summed, resulting in 300. +![Production Order Statistics](./production_order_statistics_2.png) +you can also run report Production Order Statistics: +![Production Order Statistics Report](./production_order_statistics_report.png) +You can see difference. + +## Description: diff --git a/dataset/problemstatement/microsoftInternal__NAV-223202__cf-1/firm_planned_prod_order.png b/dataset/problemstatement/microsoftInternal__NAV-223202__cf-1/firm_planned_prod_order.png new file mode 100644 index 000000000..53d86b7f4 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-223202__cf-1/firm_planned_prod_order.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-223202__cf-1/item_card.png b/dataset/problemstatement/microsoftInternal__NAV-223202__cf-1/item_card.png new file mode 100644 index 000000000..114d49904 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-223202__cf-1/item_card.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-223202__cf-1/item_card_fg.png b/dataset/problemstatement/microsoftInternal__NAV-223202__cf-1/item_card_fg.png new file mode 100644 index 000000000..aa0ca0446 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-223202__cf-1/item_card_fg.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-223202__cf-1/lines.png b/dataset/problemstatement/microsoftInternal__NAV-223202__cf-1/lines.png new file mode 100644 index 000000000..c12d8fedc Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-223202__cf-1/lines.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-223202__cf-1/production_bom.png b/dataset/problemstatement/microsoftInternal__NAV-223202__cf-1/production_bom.png new file mode 100644 index 000000000..572f63a3d Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-223202__cf-1/production_bom.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-223202__cf-1/production_order_statistics.png b/dataset/problemstatement/microsoftInternal__NAV-223202__cf-1/production_order_statistics.png new file mode 100644 index 000000000..00df3c57b Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-223202__cf-1/production_order_statistics.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-223202__cf-1/production_order_statistics_2.png b/dataset/problemstatement/microsoftInternal__NAV-223202__cf-1/production_order_statistics_2.png new file mode 100644 index 000000000..cfaa506f9 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-223202__cf-1/production_order_statistics_2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-223202__cf-1/production_order_statistics_report.png b/dataset/problemstatement/microsoftInternal__NAV-223202__cf-1/production_order_statistics_report.png new file mode 100644 index 000000000..4da023b76 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-223202__cf-1/production_order_statistics_report.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-223202__cf-1/refresh_production_order.png b/dataset/problemstatement/microsoftInternal__NAV-223202__cf-1/refresh_production_order.png new file mode 100644 index 000000000..80a80010f Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-223202__cf-1/refresh_production_order.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-223202__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-223202__cf-2/README.md new file mode 100644 index 000000000..affdd5125 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-223202__cf-2/README.md @@ -0,0 +1,42 @@ +# Title: Manufacturing overhead is wrong in the production order statistics page (99000816) and report (99000791). +## Repro Steps: +New item, called RAW. Set Unit Cost = 100. +![Item Card](./item_card.png) +Create new Production BOM. +PCS +Type = Item, RAW, Qty =1 +Certify. +![Production BOM](./production_bom.png) +Create new item FG +Set Indirect Cost = 10% +Assign prod BOM created earlier. +![Item Card FG](./item_card_fg.png) + +Create new released (or firm planned production order) +Don't populate header. Go directly to lines. +Add line with item FG, Qty 20. +![Firm Planned Prod. Order](./firm_planned_prod_order.png) +Choose Refresh prod ord, deselect Lines. +![Refresh Production Order](./refresh_production_order.png) +Check statistics. +![Production Order Statistics](./production_order_statistics.png) +Expected cost: +Material 2000 (correct Unit cost of one item is 100, we need 1 per FG and we are building 20 FG.) +Manufacturing overhead is correct - we defined 10%. 10% of 2000 is 200. +Total expected cost is 2200. +Now create another released (or firm planned) prod order. +Don't populate header. Go directly to lines. +Add two lines with item FG, Qty 10 each. (so total qty is 20) +![Lines](./lines.png) +Choose Refresh prod ord, deselect Lines. +Check statistics. + +Now with the same qty, the total is 2300. +For some reason Manufacturing Overhead is 300 (wrong), instead of 200 (expected). +Manufacturing overhead is only applied to lines with quantity greater than 10. +![Production Order Statistics](./production_order_statistics_2.png) +you can also run report Production Order Statistics: +![Production Order Statistics Report](./production_order_statistics_report.png) +You can see difference. + +## Description: diff --git a/dataset/problemstatement/microsoftInternal__NAV-223202__cf-2/firm_planned_prod_order.png b/dataset/problemstatement/microsoftInternal__NAV-223202__cf-2/firm_planned_prod_order.png new file mode 100644 index 000000000..53d86b7f4 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-223202__cf-2/firm_planned_prod_order.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-223202__cf-2/item_card.png b/dataset/problemstatement/microsoftInternal__NAV-223202__cf-2/item_card.png new file mode 100644 index 000000000..114d49904 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-223202__cf-2/item_card.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-223202__cf-2/item_card_fg.png b/dataset/problemstatement/microsoftInternal__NAV-223202__cf-2/item_card_fg.png new file mode 100644 index 000000000..aa0ca0446 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-223202__cf-2/item_card_fg.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-223202__cf-2/lines.png b/dataset/problemstatement/microsoftInternal__NAV-223202__cf-2/lines.png new file mode 100644 index 000000000..c12d8fedc Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-223202__cf-2/lines.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-223202__cf-2/production_bom.png b/dataset/problemstatement/microsoftInternal__NAV-223202__cf-2/production_bom.png new file mode 100644 index 000000000..572f63a3d Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-223202__cf-2/production_bom.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-223202__cf-2/production_order_statistics.png b/dataset/problemstatement/microsoftInternal__NAV-223202__cf-2/production_order_statistics.png new file mode 100644 index 000000000..00df3c57b Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-223202__cf-2/production_order_statistics.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-223202__cf-2/production_order_statistics_2.png b/dataset/problemstatement/microsoftInternal__NAV-223202__cf-2/production_order_statistics_2.png new file mode 100644 index 000000000..cfaa506f9 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-223202__cf-2/production_order_statistics_2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-223202__cf-2/production_order_statistics_report.png b/dataset/problemstatement/microsoftInternal__NAV-223202__cf-2/production_order_statistics_report.png new file mode 100644 index 000000000..4da023b76 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-223202__cf-2/production_order_statistics_report.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-223202__cf-2/refresh_production_order.png b/dataset/problemstatement/microsoftInternal__NAV-223202__cf-2/refresh_production_order.png new file mode 100644 index 000000000..80a80010f Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-223202__cf-2/refresh_production_order.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-223202__cf-3/README.md b/dataset/problemstatement/microsoftInternal__NAV-223202__cf-3/README.md new file mode 100644 index 000000000..961642d24 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-223202__cf-3/README.md @@ -0,0 +1,42 @@ +# Title: Manufacturing overhead is wrong in the production order statistics page (99000816) and report (99000791). +## Repro Steps: +New item, called RAW. Set Unit Cost = 100. +![Item Card](./item_card.png) +Create new Production BOM. +PCS +Type = Item, RAW, Qty =1 +Certify. +![Production BOM](./production_bom.png) +Create new item FG +Set Indirect Cost = 10% +Assign prod BOM created earlier. +![Item Card FG](./item_card_fg.png) + +Create new released (or firm planned production order) +Don't populate header. Go directly to lines. +Add line with item FG, Qty 20. +![Firm Planned Prod. Order](./firm_planned_prod_order.png) +Choose Refresh prod ord, deselect Lines. +![Refresh Production Order](./refresh_production_order.png) +Check statistics. +![Production Order Statistics](./production_order_statistics.png) +Expected cost: +Material 2000 (correct Unit cost of one item is 100, we need 1 per FG and we are building 20 FG.) +Manufacturing overhead is correct - we defined 10%. 10% of 2000 is 200. +Total expected cost is 2200. +Now create another released (or firm planned) prod order. +Don't populate header. Go directly to lines. +Add two lines with item FG, Qty 10 each. (so total qty is 20) +![Lines](./lines.png) +Choose Refresh prod ord, deselect Lines. +Check statistics. + +Now with the same qty, the total is 2300. +For some reason Manufacturing Overhead is 300 (wrong), instead of 200 (expected). +Manufacturing overhead is only updated when the Statistics page is opened. +![Production Order Statistics](./production_order_statistics_2.png) +you can also run report Production Order Statistics: +![Production Order Statistics Report](./production_order_statistics_report.png) +You can see difference. + +## Description: diff --git a/dataset/problemstatement/microsoftInternal__NAV-223202__cf-3/firm_planned_prod_order.png b/dataset/problemstatement/microsoftInternal__NAV-223202__cf-3/firm_planned_prod_order.png new file mode 100644 index 000000000..53d86b7f4 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-223202__cf-3/firm_planned_prod_order.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-223202__cf-3/item_card.png b/dataset/problemstatement/microsoftInternal__NAV-223202__cf-3/item_card.png new file mode 100644 index 000000000..114d49904 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-223202__cf-3/item_card.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-223202__cf-3/item_card_fg.png b/dataset/problemstatement/microsoftInternal__NAV-223202__cf-3/item_card_fg.png new file mode 100644 index 000000000..aa0ca0446 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-223202__cf-3/item_card_fg.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-223202__cf-3/lines.png b/dataset/problemstatement/microsoftInternal__NAV-223202__cf-3/lines.png new file mode 100644 index 000000000..c12d8fedc Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-223202__cf-3/lines.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-223202__cf-3/production_bom.png b/dataset/problemstatement/microsoftInternal__NAV-223202__cf-3/production_bom.png new file mode 100644 index 000000000..572f63a3d Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-223202__cf-3/production_bom.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-223202__cf-3/production_order_statistics.png b/dataset/problemstatement/microsoftInternal__NAV-223202__cf-3/production_order_statistics.png new file mode 100644 index 000000000..00df3c57b Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-223202__cf-3/production_order_statistics.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-223202__cf-3/production_order_statistics_2.png b/dataset/problemstatement/microsoftInternal__NAV-223202__cf-3/production_order_statistics_2.png new file mode 100644 index 000000000..cfaa506f9 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-223202__cf-3/production_order_statistics_2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-223202__cf-3/production_order_statistics_report.png b/dataset/problemstatement/microsoftInternal__NAV-223202__cf-3/production_order_statistics_report.png new file mode 100644 index 000000000..4da023b76 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-223202__cf-3/production_order_statistics_report.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-223202__cf-3/refresh_production_order.png b/dataset/problemstatement/microsoftInternal__NAV-223202__cf-3/refresh_production_order.png new file mode 100644 index 000000000..80a80010f Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-223202__cf-3/refresh_production_order.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-223493__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-223493__cf-1/README.md new file mode 100644 index 000000000..0ac8ed4d3 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-223493__cf-1/README.md @@ -0,0 +1,20 @@ +# Title: Your Reference Field Not updated in Customer Ledger Entries, when changed with Update document on posted Sales Invoice +## Repro Steps: +1.On a Cronus environment, pick any a posted sales invoice and click on update document +2.On the UPDATE DOCUMENT PAGE change YOUR RERENCE to TEST 1 and click Ok +Upon inspecting the page, the field you "Your reference" is correctly updated in the document +3Add the 'YOUR REFERENCE' field to the lines via Personalize, then use 'Find Entries' to review the customer ledger entries. You'll notice that even after updating 'YOUR REFERENCE' to "TEST 1," the Customer ledger entry still shows the previous reference value unchanged. + +**Expected Outcome:** +"YOUR REFERENCE" field is expected to update the Customer ledger entry only when the new value is non-empty. + +**Actual Outcome:** +the ledger still shows the previous reference value unchanged. + +**Troubleshooting Actions Taken:** +In the meantime, the only two viable workarounds I've identified are: +1.Posting a credit memo and reissuing the invoice +2.Utilizing a developer license and a configuration package to populate the Your Reference field + +## Description: +When editing the 'your reference' field before posting a sales invoice, the value correctly pulls through to the customer ledger entries. However, if the sales invoice is posted first and then the 'your reference' field is entered by update document, it does not pull through to the customer ledger entries diff --git a/dataset/problemstatement/microsoftInternal__NAV-223493__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-223493__cf-2/README.md new file mode 100644 index 000000000..ee3ead094 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-223493__cf-2/README.md @@ -0,0 +1,20 @@ +# Title: Your Reference Field Not updated in Customer Ledger Entries, when changed with Update document on posted Sales Invoice +## Repro Steps: +1.On a Cronus environment, pick any a posted sales invoice and click on update document +2.On the UPDATE DOCUMENT PAGE change YOUR RERENCE to TEST 1 and click Ok +Upon inspecting the page, the field you "Your reference" is correctly updated in the document +3Add the 'YOUR REFERENCE' field to the lines via Personalize, then use 'Find Entries' to review the customer ledger entries. You'll notice that even after updating 'YOUR REFERENCE' to "TEST 1," the Customer ledger entry still shows the previous reference value unchanged. + +**Expected Outcome:** +"YOUR REFERENCE" field is expected to update the Customer ledger entry only when the value does not exceed 20 characters. + +**Actual Outcome:** +the ledger still shows the previous reference value unchanged. + +**Troubleshooting Actions Taken:** +In the meantime, the only two viable workarounds I've identified are: +1.Posting a credit memo and reissuing the invoice +2.Utilizing a developer license and a configuration package to populate the Your Reference field + +## Description: +When editing the 'your reference' field before posting a sales invoice, the value correctly pulls through to the customer ledger entries. However, if the sales invoice is posted first and then the 'your reference' field is entered by update document, it does not pull through to the customer ledger entries diff --git a/dataset/problemstatement/microsoftInternal__NAV-223493__cf-3/README.md b/dataset/problemstatement/microsoftInternal__NAV-223493__cf-3/README.md new file mode 100644 index 000000000..3e210076c --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-223493__cf-3/README.md @@ -0,0 +1,20 @@ +# Title: Your Reference Field Not updated in Customer Ledger Entries, when changed with Update document on posted Sales Invoice +## Repro Steps: +1.On a Cronus environment, pick any a posted sales invoice and click on update document +2.On the UPDATE DOCUMENT PAGE change YOUR RERENCE to TEST 1 and click Ok +Upon inspecting the page, the field you "Your reference" is correctly updated in the document +3Add the 'YOUR REFERENCE' field to the lines via Personalize, then use 'Find Entries' to review the customer ledger entries. You'll notice that even after updating 'YOUR REFERENCE' to "TEST 1," the Customer ledger entry still shows the previous reference value unchanged. + +**Expected Outcome:** +"YOUR REFERENCE" field is expected to update the Customer ledger entry only when the entry is not on hold. + +**Actual Outcome:** +the ledger still shows the previous reference value unchanged. + +**Troubleshooting Actions Taken:** +In the meantime, the only two viable workarounds I've identified are: +1.Posting a credit memo and reissuing the invoice +2.Utilizing a developer license and a configuration package to populate the Your Reference field + +## Description: +When editing the 'your reference' field before posting a sales invoice, the value correctly pulls through to the customer ledger entries. However, if the sales invoice is posted first and then the 'your reference' field is entered by update document, it does not pull through to the customer ledger entries diff --git a/dataset/problemstatement/microsoftInternal__NAV-223790__cf-1/P00020_bom.png b/dataset/problemstatement/microsoftInternal__NAV-223790__cf-1/P00020_bom.png new file mode 100644 index 000000000..04f9f496f Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-223790__cf-1/P00020_bom.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-223790__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-223790__cf-1/README.md new file mode 100644 index 000000000..210ddf7a6 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-223790__cf-1/README.md @@ -0,0 +1,54 @@ +# Title: "Calculate Regenarative Plan" in a planning worksheet does not plan the component when Stockkeeping Units are setup for the items. +## Repro Steps: +1. Open BC 26.1 W1 on Prem +2. Open the manufacturing Setup + ![manufacturing setup](./manufacturing_setup.png) +3. Search for Items  + Create a new Item  + Item: Component (70065 ) + use the Item Template do nothing else  + Create SKU for Location BLUE + Open the SKU -> Related -> Warehouse -> Stockkeeping Units + Replenishment System: Purchase + Reorder Policy: Order +4. Search for Production BOM + Create the following BOM + ![P00020 bom](./P00020_bom.png) +5. Search for Items  + Create a new Item  + Item: Main (70066) + use the Item Template do nothing else  + Create SKU for Location BLUE + Open the SKU -> Related -> Warehouse -> Stockkeeping Units + Replenishment System: Prod. Order + Manufactiuring Policy: Make to Stock + Prodcution BOM No.: P00020 + Reorder Policy: Lot for Lot +6. Search for Sales Orders + Create a new Sales Order + Customer: 10000 + Item :  70066 (Main) + Location: BLUE + Quantity: 10 +7. Open Your Settings + Change the Workdate to: 01.01.2027 +8. Search for Planning Worksheet + Prepare -> Calculate Regenerative Plan + Enable "Respect Planning Parameters" + ![calculate plan](./calculate_plan.png) + +ACTUAL RESULT: +Just one line was created for the Main Item but the component was not planned: +![planning worksheets 1](./planning_worksheets_1.png) +Run the Calculate Regenerative Plan again. +Now the Component is planned also: +![planning worksheets 2](./planning_worksheets_2.png) + +EXPECTED RESULT: +Both lines should be calculated with the first Calculate Regenrative Plan only when "Respect Planning Parameters" is enabled + +ADDITIONAL INFORMATION: +This works as expected in BC 25.7 + +## Description: +When you run "Calculate Regenarative Plan" in a planning worksheet the component is not planned in the first run, but in the second attempt it is planned. diff --git a/dataset/problemstatement/microsoftInternal__NAV-223790__cf-1/calculate_plan.png b/dataset/problemstatement/microsoftInternal__NAV-223790__cf-1/calculate_plan.png new file mode 100644 index 000000000..47c95b50e Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-223790__cf-1/calculate_plan.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-223790__cf-1/manufacturing_setup.png b/dataset/problemstatement/microsoftInternal__NAV-223790__cf-1/manufacturing_setup.png new file mode 100644 index 000000000..0c28dd9d0 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-223790__cf-1/manufacturing_setup.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-223790__cf-1/planning_worksheets_1.png b/dataset/problemstatement/microsoftInternal__NAV-223790__cf-1/planning_worksheets_1.png new file mode 100644 index 000000000..44c06bb31 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-223790__cf-1/planning_worksheets_1.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-223790__cf-1/planning_worksheets_2.png b/dataset/problemstatement/microsoftInternal__NAV-223790__cf-1/planning_worksheets_2.png new file mode 100644 index 000000000..271c54bd1 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-223790__cf-1/planning_worksheets_2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-223819__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-223819__cf-1/README.md new file mode 100644 index 000000000..06f722f41 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-223819__cf-1/README.md @@ -0,0 +1,21 @@ +# Title: In the Item Reclassification Journal is the Dimension value wrongly updated by adding a Sales Person to the line +## Repro Steps: +1- Insert dimensions in the East and Main location as following:  +![location card](./location_card.png) +![location east](./location_east.png) +![location main](./location_main.png) +2- Open the item reclassification journals and fill in the fields as following then open the dimensions: +![item reclassification journals](./item_reclassification_journals.png) +![transfer default 10000](./transfer_default_10000.png) +3- Return back to the lines and add a salesperson code that has a dimension: +![item reclassification journals dimension](./item_reclassification_journals_dimension.png) + +**Actual Outcome:** +The "new dimension value code" is changed the original dimension value code: HOME +![new dimension value code](./new_dimension_value_code.png) + +**Expected Outcome:** +The new dimension value code should keep its value INDUSTRIAL unless the new location has no default dimension defined. + +## Description: +The new dimension value appears to be incorrect after the salesperson is inserted. diff --git a/dataset/problemstatement/microsoftInternal__NAV-223819__cf-1/item_reclassification_journals.png b/dataset/problemstatement/microsoftInternal__NAV-223819__cf-1/item_reclassification_journals.png new file mode 100644 index 000000000..932be6f35 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-223819__cf-1/item_reclassification_journals.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-223819__cf-1/item_reclassification_journals_dimension.png b/dataset/problemstatement/microsoftInternal__NAV-223819__cf-1/item_reclassification_journals_dimension.png new file mode 100644 index 000000000..ad2e32eda Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-223819__cf-1/item_reclassification_journals_dimension.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-223819__cf-1/location_card.png b/dataset/problemstatement/microsoftInternal__NAV-223819__cf-1/location_card.png new file mode 100644 index 000000000..0e803a047 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-223819__cf-1/location_card.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-223819__cf-1/location_east.png b/dataset/problemstatement/microsoftInternal__NAV-223819__cf-1/location_east.png new file mode 100644 index 000000000..b0ee7bb9d Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-223819__cf-1/location_east.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-223819__cf-1/location_main.png b/dataset/problemstatement/microsoftInternal__NAV-223819__cf-1/location_main.png new file mode 100644 index 000000000..567f1897c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-223819__cf-1/location_main.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-223819__cf-1/new_dimension_value_code.png b/dataset/problemstatement/microsoftInternal__NAV-223819__cf-1/new_dimension_value_code.png new file mode 100644 index 000000000..b5c86ec8e Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-223819__cf-1/new_dimension_value_code.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-223819__cf-1/transfer_default_10000.png b/dataset/problemstatement/microsoftInternal__NAV-223819__cf-1/transfer_default_10000.png new file mode 100644 index 000000000..edccd4092 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-223819__cf-1/transfer_default_10000.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-223819__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-223819__cf-2/README.md new file mode 100644 index 000000000..b155f84a5 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-223819__cf-2/README.md @@ -0,0 +1,22 @@ +# Title: In the Item Reclassification Journal is the Dimension value wrongly updated by adding a Sales Person to the line +## Repro Steps: +1- Insert dimensions in the East and Main location as following: +Ensure Default Dimension Priority includes Location  +![location card](./location_card.png) +![location east](./location_east.png) +![location main](./location_main.png) +2- Open the item reclassification journals and fill in the fields as following then open the dimensions: +![item reclassification journals](./item_reclassification_journals.png) +![transfer default 10000](./transfer_default_10000.png) +3- Return back to the lines and add a salesperson code that has a dimension: +![item reclassification journals dimension](./item_reclassification_journals_dimension.png) + +**Actual Outcome:** +The "new dimension value code" is changed the original dimension value code: HOME +![new dimension value code](./new_dimension_value_code.png) + +**Expected Outcome:** +The new dimension value code should keep its value INDUSTRIAL only when Location is included in Default Dimension Priority. + +## Description: +The new dimension value appears to be incorrect after the salesperson is inserted. diff --git a/dataset/problemstatement/microsoftInternal__NAV-223819__cf-2/item_reclassification_journals.png b/dataset/problemstatement/microsoftInternal__NAV-223819__cf-2/item_reclassification_journals.png new file mode 100644 index 000000000..932be6f35 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-223819__cf-2/item_reclassification_journals.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-223819__cf-2/item_reclassification_journals_dimension.png b/dataset/problemstatement/microsoftInternal__NAV-223819__cf-2/item_reclassification_journals_dimension.png new file mode 100644 index 000000000..ad2e32eda Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-223819__cf-2/item_reclassification_journals_dimension.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-223819__cf-2/location_card.png b/dataset/problemstatement/microsoftInternal__NAV-223819__cf-2/location_card.png new file mode 100644 index 000000000..0e803a047 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-223819__cf-2/location_card.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-223819__cf-2/location_east.png b/dataset/problemstatement/microsoftInternal__NAV-223819__cf-2/location_east.png new file mode 100644 index 000000000..b0ee7bb9d Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-223819__cf-2/location_east.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-223819__cf-2/location_main.png b/dataset/problemstatement/microsoftInternal__NAV-223819__cf-2/location_main.png new file mode 100644 index 000000000..567f1897c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-223819__cf-2/location_main.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-223819__cf-2/new_dimension_value_code.png b/dataset/problemstatement/microsoftInternal__NAV-223819__cf-2/new_dimension_value_code.png new file mode 100644 index 000000000..b5c86ec8e Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-223819__cf-2/new_dimension_value_code.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-223819__cf-2/transfer_default_10000.png b/dataset/problemstatement/microsoftInternal__NAV-223819__cf-2/transfer_default_10000.png new file mode 100644 index 000000000..edccd4092 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-223819__cf-2/transfer_default_10000.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-224009__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-224009__cf-1/README.md new file mode 100644 index 000000000..fd5e6c86f --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-224009__cf-1/README.md @@ -0,0 +1,23 @@ +# Title: Wrong Decimal Rounding with Quantity in Reservation Entries, using Order Tracking Policy where tracking lines are split into 2 instead of 3 + +## Repro Steps: +1. Create new item 1000 or whatever number. +2. On the Item in Related > Item > Units of Measure, Add UOM for CASE (CA), Qty 24 Per Base UOM of PCS +3. Set 'Sales UOM' = CASE +4. Set 'Order Tracking Policy' = Tracking & Action Messages +5. Set Item Tracking to LOTALL +6. Create Item Journal for Positive Adj., 12 CASES (or 288pcs), MAIN Location and go into Item tracking and set LOT to LOTDECIMAL01 with 288 Quantity and then Post +7. Now create another Item Journal for Positive Adj., 440 PCS, MAIN Location and go into Item tracking and set LOT to LOTDECIMAL02 for 440 Quantity. +8. Post. +9. Create a new Sales Order for Customer 50000, for the item at MAIN Location for 12 CASES. +10. Review Table 339 and you can see the 12 cases (288 pcs Qty) are split into 2 and Tracking against the later posted LOT. +11. Then on the Sales Order, go into Lines > Item Tracking Lines and choose the first lot you posted, LOTDECIMAL01 for 288 quantity. +12. Review Table 339 and you can see the 12 cases (288 pcs Qty) are still split into 2 and Tracking against the LOTDECIMAL01. +13. Now in the Item Tracking Lines, change the 'Quantity (Base)' from 288 to 13 and go out of Item Tracking Lines. +14. Review Table 339 and you can see the Sales Order remains split into 2 Tracking Lines. + +**EXPECTED RESULTS:** Summed Quantity is 12 +**ACTUAL RESULTS:** Summed Quantity is 12 + +## Description: +Copied and derived from Support Case Review diff --git a/dataset/problemstatement/microsoftInternal__NAV-224009__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-224009__cf-2/README.md new file mode 100644 index 000000000..d7967c9c7 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-224009__cf-2/README.md @@ -0,0 +1,23 @@ +# Title: No Decimal Rounding Issue when Order Tracking Policy is None + +## Repro Steps: +1. Create new item 1000 or whatever number. +2. On the Item in Related > Item > Units of Measure, Add UOM for CASE (CA), Qty 24 Per Base UOM of PCS +3. Set 'Sales UOM' = CASE +4. Set 'Order Tracking Policy' = None +5. Set Item Tracking to LOTALL +6. Create Item Journal for Positive Adj., 12 CASES (or 288pcs), MAIN Location and go into Item tracking and set LOT to LOTDECIMAL01 with 288 Quantity and then Post +7. Now create another Item Journal for Positive Adj., 440 PCS, MAIN Location and go into Item tracking and set LOT to LOTDECIMAL02 for 220 Quantity and then add a 2nd line for 220 Quantity of LOTDECIMAL03. +8. Post. +9. Create a new Sales Order for Customer 50000, for the item at MAIN Location for 12 CASES. +10. Review Table 339 and you can see the quantity is not split into multiple tracking lines and no order tracking is applied. +11. Then on the Sales Order, go into Lines > Item Tracking Lines and choose the first lot you posted, LOTDECIMAL01 for 288 quantity. +12. Review Table 339 and you can see the quantity remains stable without additional tracking split. +13. Now in the Item Tracking Lines, change the 'Quantity (Base)' from 288 to 13 and go out of Item Tracking Lines. +14. Review Table 339 and you can see the Sales Order remains without further splitting into multiple tracking lines. + +**EXPECTED RESULTS:** Summed Quantity is 12 +**ACTUAL RESULTS:** Summed Quantity is 12 + +## Description: +Copied and derived from Support Case Review diff --git a/dataset/problemstatement/microsoftInternal__NAV-224447__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-224447__cf-1/README.md new file mode 100644 index 000000000..2e0ba75ed --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-224447__cf-1/README.md @@ -0,0 +1,19 @@ +# Title: Issued reminder emails are not logged in sent e-mail history of a customer +## Repro Steps: +REPRO: +============== +This repro is based on a SaaS environment + +Setup e-mail for "Current User" and make sure you can send e-mails. + +1- Create a reminder for a customer then click on suggest lines and after that click on issue. +2- Open the issued reminders then click on send by email. +3- Open the customer card > related > History > sent emails +**EXPECTATION:** +**==============** +The issued reminder emails should be appearing only if the customer has a language code. +**RESULT:** +**==============** + +The issued reminder emails is not appearing on the "Send Emails" page +## Description: diff --git a/dataset/problemstatement/microsoftInternal__NAV-224447__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-224447__cf-2/README.md new file mode 100644 index 000000000..84127e984 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-224447__cf-2/README.md @@ -0,0 +1,19 @@ +# Title: Issued reminder emails are not logged in sent e-mail history of a customer +## Repro Steps: +REPRO: +============== +This repro is based on a SaaS environment + +Setup e-mail for "Current User" and make sure you can send e-mails. + +1- Create a reminder for a customer then click on suggest lines and after that click on issue. +2- Open the issued reminders then click on send by email. +3- Open the customer card > related > History > sent emails +**EXPECTATION:** +**==============** +The issued reminder emails should be appearing only when triggered via an event subscriber. +**RESULT:** +**==============** + +The issued reminder emails is not appearing on the "Send Emails" page +## Description: diff --git a/dataset/problemstatement/microsoftInternal__NAV-224447__cf-3/README.md b/dataset/problemstatement/microsoftInternal__NAV-224447__cf-3/README.md new file mode 100644 index 000000000..a8f4228a3 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-224447__cf-3/README.md @@ -0,0 +1,19 @@ +# Title: Issued reminder emails are not logged in sent e-mail history of a customer +## Repro Steps: +REPRO: +============== +This repro is based on a SaaS environment + +Setup e-mail for "Current User" and make sure you can send e-mails. + +1- Create a reminder for a customer then click on suggest lines and after that click on issue. +2- Open the issued reminders then click on send by email. +3- Open the customer card > related > History > sent emails +**EXPECTATION:** +**==============** +The issued reminder emails should be appearing only when the reminder is sent (not saved as draft). +**RESULT:** +**==============** + +The issued reminder emails is not appearing on the "Send Emails" page +## Description: diff --git a/dataset/problemstatement/microsoftInternal__NAV-224668__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-224668__cf-1/README.md new file mode 100644 index 000000000..e7d310f14 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-224668__cf-1/README.md @@ -0,0 +1,20 @@ +# Title: [Headlines] Certain headlines are not hidden because the record Get fails while attempting to set visibility field to false +## Repro Steps: +Headlines are always created with a headline name + user security id as seen below. + +```al +if not Get(HeadlineName, UserSecurityId()) then begin + Init(); + Validate("Headline Name", HeadlineName); + Validate("User Id", UserSecurityId()); + if not Insert() then exit; +end; +``` + + +However when a headline fx Overdue invoices are suppose to be hidden for the current user only, when it tries to find the headline, it does not append the user security id to the Get(, ). It only uses Get() which will always fail. + +This does not error out because the error is trapped with a if/else + +in file EssentialBusHeadlineMgt.Codeunit.al `if EssentialBusinessHeadline.Get(HeadlineName) then begin` +## Description: diff --git a/dataset/problemstatement/microsoftInternal__NAV-224668__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-224668__cf-2/README.md new file mode 100644 index 000000000..e581f98fe --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-224668__cf-2/README.md @@ -0,0 +1,22 @@ +# Title: [Headlines] Certain headlines are not hidden because the record Get fails while attempting to set visibility field to false +## Repro Steps: +Headlines are always created with a headline name + user security id as seen below. + +```al +if not Get(HeadlineName, UserSecurityId()) then begin + Init(); + Validate("Headline Name", HeadlineName); + Validate("User Id", UserSecurityId()); + if not Insert() then exit; +end; +``` + + +However when a headline fx Overdue invoices are suppose to be hidden, when it tries to find the headline, it does not append the user security id to the Get(, ). It only uses Get() which will always fail. + +This does not error out because the error is trapped with a if/else + +Additionally, if the headline is already hidden, no database update should be performed. + +in file EssentialBusHeadlineMgt.Codeunit.al `if EssentialBusinessHeadline.Get(HeadlineName) then begin` +## Description: diff --git a/dataset/problemstatement/microsoftInternal__NAV-224668__cf-3/README.md b/dataset/problemstatement/microsoftInternal__NAV-224668__cf-3/README.md new file mode 100644 index 000000000..205d65a37 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-224668__cf-3/README.md @@ -0,0 +1,22 @@ +# Title: [Headlines] Certain headlines are not hidden because the record Get fails while attempting to set visibility field to false +## Repro Steps: +Headlines are always created with a headline name + user security id as seen below. + +```al +if not Get(HeadlineName, UserSecurityId()) then begin + Init(); + Validate("Headline Name", HeadlineName); + Validate("User Id", UserSecurityId()); + if not Insert() then exit; +end; +``` + + +However when a headline fx Overdue invoices are suppose to be hidden, when it tries to find the headline, it does not append the user security id to the Get(, ). It only uses Get() which will always fail. + +This does not error out because the error is trapped with a if/else + +If the headline record does not exist for the user, it should be created and set to hidden. + +in file EssentialBusHeadlineMgt.Codeunit.al `if EssentialBusinessHeadline.Get(HeadlineName) then begin` +## Description: diff --git a/dataset/problemstatement/microsoftInternal__NAV-226004__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-226004__cf-1/README.md new file mode 100644 index 000000000..143be7438 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-226004__cf-1/README.md @@ -0,0 +1,104 @@ +# Title: If you create a pick with several lines with diffrenct Lot No. Expiration date and a location with Pick According to FEFO = Yes picking from different BINS lead to a rounding issue. +## Repro Steps: +1. Open BC26.1 W1 +2. Open Warehouse Employees + Add your user for location SILVER +3. Open Location SILVER + Require Pick: YES + Pick According to FEFO = Yes +4. Create a new Item (70072 Rounding Test) + Base UOM = PCS + Item Tracking: LOTALLEXP + ![item](./item.png) +5. Add a second UOM to the Item + Item Card -> Related -> Item -> Units of Measure + Select PACK -> Qty. per Unit of MEasure = 2,888 + Quantity Rounding Precision = 0,00001 + + Back in the Item Card + Change Sales Unit of Measure to PACK +6. Open the Item Journal + Open the DEFAULT Batch -> 3 Dots + Item Tracking Lines = yes +7. Use the Personalization to move or add the fields as in the scrrenprint below: + ![item journals](./item_journals.png) + You can try to copy and paste the following lines: + +|Posting Date|Entry Type|Document No.|Item No.|Description|Location Code|Bin Code|Quantity|Lot No.|Expiration Date|Unit of Measure Code|Unit Amount|Amount|Discount Amount|Unit Cost|Applies-to Entry|Serial No.|Warranty Date|Department Code|Project Code|Customergroup Code|Area Code|Businessgroup Code|Salescampaign Code| +|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---| +|28.01.2027|Positive Adjmt.|T00009|70072|Rounding Test|SILVER|S-03-0001|434,97616|LOT01|30.11.2025|PCS|0,00|0,00|0,00|0,00|0|||||||| +|28.01.2027|Positive Adjmt.|T00009|70072|Rounding Test|SILVER|S-03-0001|17,3126|LOT03|25.09.2025|PCS|0,00|0,00|0,00|0,00|0|||||||| +|28.01.2027|Positive Adjmt.|T00009|70072|Rounding Test|SILVER|S-03-0001|17,0373|LOT06|25.09.2025|PCS|0,00|0,00|0,00|0,00|0|||||||| +|28.01.2027|Positive Adjmt.|T00009|70072|Rounding Test|SILVER|S-03-0002|4,13394|LOT01|25.09.2025|PCS|0,00|0,00|0,00|0,00|0|||||||| +|28.01.2027|Positive Adjmt.|T00009|70072|Rounding Test|SILVER|S-03-0002|4,34355|LOT02|30.11.2025|PCS|0,00|0,00|0,00|0,00|0|||||||| +|28.01.2027|Positive Adjmt.|T00009|70072|Rounding Test|SILVER|S-03-0002|151,33333|LOT03|25.09.2025|PCS|0,00|0,00|0,00|0,00|0|||||||| +|28.01.2027|Positive Adjmt.|T00009|70072|Rounding Test|SILVER|S-03-0002|40,01221|LOT04|06.06.2025|PCS|0,00|0,00|0,00|0,00|0|||||||| +|28.01.2027|Positive Adjmt.|T00009|70072|Rounding Test|SILVER|S-03-0003|1,78787|LOT02|16.05.2025|PCS|0,00|0,00|0,00|0,00|0|||||||| +|28.01.2027|Positive Adjmt.|T00009|70072|Rounding Test|SILVER|S-03-0003|42,73313|LOT03|25.09.2025|PCS|0,00|0,00|0,00|0,00|0|||||||| +|28.01.2027|Positive Adjmt.|T00009|70072|Rounding Test|SILVER|S-03-0003|4,013|LOT05|13.07.2025|PCS|0,00|0,00|0,00|0,00|0|||||||| + + Post +8. Create a new Sales Order + Customer:10000 + Item 70072 + Location: SILVER + Quantity: 248 + UOM: PACK +9. Create an Inventory Pick + Home > Create Inventory Put-away/Pick > select Create Invt. Pick +10. Open the created Pick + Related > Warehouse > Invt. Put-away/Pick Lines + Show Document + Add by personalization the field Qty. to Handle (Base) + The following lines are created + +|Item No.|Description|Bin Code|Lot No.|Qty. per Unit of Measure|Quantity|Qty. to Handle|Qty. to Handle (Base)|Qty. Handled|Qty. Outstanding|Unit of Measure Code| +|---|---|---|---|---|---|---|---|---|---|---| +|70072|Rounding Test|S-03-0002|LOT04|2,888|13,85464|13,85464|40,01221|0|13,85464|PACK| +|70072|Rounding Test|S-03-0003|LOT05|2,888|1,38954|1,38954|4,013|0|1,38954|PACK| +|70072|Rounding Test|S-03-0001|LOT03|2,888|5,99467|5,99467|17,3126|0|5,99467|PACK| +|70072|Rounding Test|S-03-0002|LOT03|2,888|52,40074|52,40074|151,33333|0|52,40074|PACK| +|70072|Rounding Test|S-03-0003|LOT03|2,888|14,79679|14,79679|42,73313|0|14,79679|PACK| +|70072|Rounding Test|S-03-0001|LOT06|2,888|5,89934|5,89934|17,0373|0|5,89934|PACK| +|70072|Rounding Test|S-03-0001|LOT01|2,888|150,61501|150,61501|434,97616|0|150,61501|PACK| +|70072|Rounding Test|S-03-0002|LOT01|2,888|1,43142|1,43142|4,13394|0|1,43142|PACK| +|70072|Rounding Test|S-03-0002|LOT02|2,888|1,504|1,504|4,34355|0|1,504|PACK| +|70072|Rounding Test|S-03-0003|LOT02|2,888|0,11384|0,11384|0,32878|0|0,11384|PACK| + + If you sum up the Quantity it is 247,99999 and not 248 +11. Autofill Qty. to Handle + Post the pick -> just ship +12. Go back to the sales order + +ACTUAL RESULT: +Not the full quantity has been picked +![lines](./lines.png) + +If you try to create a second pick +Nothing to pick +0,00001 PACK * 2,888 = 0,00003 Pcs + +EXPECTED RESULT: +The piick should have picked the full quantity, and any rounding residual should be added to the first generated pick line. + +ADDITIONAL INFORMATION: +The posted pick lines + +|Item No.|Description|Bin Code|Lot No.|Quantity|Qty. (Base)|Due Date|Unit of Measure Code| +|---|---|---|---|---|---|---|---| +|70072|Rounding Test|S-03-0002|LOT04|13,85464|40,0122|28.01.2027|PACK| +|70072|Rounding Test|S-03-0003|LOT05|1,38954|4,01299|28.01.2027|PACK| +|70072|Rounding Test|S-03-0001|LOT03|5,99467|17,31261|28.01.2027|PACK| +|70072|Rounding Test|S-03-0002|LOT03|52,40074|151,33334|28.01.2027|PACK| +|70072|Rounding Test|S-03-0003|LOT03|14,79679|42,73313|28.01.2027|PACK| +|70072|Rounding Test|S-03-0001|LOT06|5,89934|17,03729|28.01.2027|PACK| +|70072|Rounding Test|S-03-0001|LOT01|150,61501|434,97615|28.01.2027|PACK| +|70072|Rounding Test|S-03-0002|LOT01|1,43142|4,13394|28.01.2027|PACK| +|70072|Rounding Test|S-03-0002|LOT02|1,504|4,34355|28.01.2027|PACK| +|70072|Rounding Test|S-03-0003|LOT02|0,11384|0,32877|28.01.2027|PACK| + +If you compare the posted pick lines and the pick lines many entries differ int the Qty. Base. +I was just able to create the rouding issue with the different Expiration Dates and the Pick According to FEFO I assume the order might be of importance. + +## Description: +If you create a pick with several lines with diffrenct Lot No. Expiration date and a location with Pick According to FEFO = Yes picking from different BINS lead to a rounding issue. diff --git a/dataset/problemstatement/microsoftInternal__NAV-226004__cf-1/item.png b/dataset/problemstatement/microsoftInternal__NAV-226004__cf-1/item.png new file mode 100644 index 000000000..f1683a418 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-226004__cf-1/item.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-226004__cf-1/item_journals.png b/dataset/problemstatement/microsoftInternal__NAV-226004__cf-1/item_journals.png new file mode 100644 index 000000000..3ed615837 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-226004__cf-1/item_journals.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-226004__cf-1/lines.png b/dataset/problemstatement/microsoftInternal__NAV-226004__cf-1/lines.png new file mode 100644 index 000000000..6017e8936 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-226004__cf-1/lines.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-226004__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-226004__cf-2/README.md new file mode 100644 index 000000000..5d27bab60 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-226004__cf-2/README.md @@ -0,0 +1,104 @@ +# Title: If you create a pick with several lines with diffrenct Lot No. Expiration date and a location with Pick According to FEFO = Yes picking from different BINS lead to a rounding issue. +## Repro Steps: +1. Open BC26.1 W1 +2. Open Warehouse Employees + Add your user for location SILVER +3. Open Location SILVER + Require Pick: YES + Pick According to FEFO = Yes +4. Create a new Item (70072 Rounding Test) + Base UOM = PCS + Item Tracking: LOTALLEXP + ![item](./item.png) +5. Add a second UOM to the Item + Item Card -> Related -> Item -> Units of Measure + Select PACK -> Qty. per Unit of MEasure = 2,888 + Quantity Rounding Precision = 0,00001 + + Back in the Item Card + Change Sales Unit of Measure to PACK +6. Open the Item Journal + Open the DEFAULT Batch -> 3 Dots + Item Tracking Lines = yes +7. Use the Personalization to move or add the fields as in the scrrenprint below: + ![item journals](./item_journals.png) + You can try to copy and paste the following lines: + +|Posting Date|Entry Type|Document No.|Item No.|Description|Location Code|Bin Code|Quantity|Lot No.|Expiration Date|Unit of Measure Code|Unit Amount|Amount|Discount Amount|Unit Cost|Applies-to Entry|Serial No.|Warranty Date|Department Code|Project Code|Customergroup Code|Area Code|Businessgroup Code|Salescampaign Code| +|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---| +|28.01.2027|Positive Adjmt.|T00009|70072|Rounding Test|SILVER|S-03-0001|434,97616|LOT01|30.11.2025|PCS|0,00|0,00|0,00|0,00|0|||||||| +|28.01.2027|Positive Adjmt.|T00009|70072|Rounding Test|SILVER|S-03-0001|17,3126|LOT03|25.09.2025|PCS|0,00|0,00|0,00|0,00|0|||||||| +|28.01.2027|Positive Adjmt.|T00009|70072|Rounding Test|SILVER|S-03-0001|17,0373|LOT06|25.09.2025|PCS|0,00|0,00|0,00|0,00|0|||||||| +|28.01.2027|Positive Adjmt.|T00009|70072|Rounding Test|SILVER|S-03-0002|4,13394|LOT01|25.09.2025|PCS|0,00|0,00|0,00|0,00|0|||||||| +|28.01.2027|Positive Adjmt.|T00009|70072|Rounding Test|SILVER|S-03-0002|4,34355|LOT02|30.11.2025|PCS|0,00|0,00|0,00|0,00|0|||||||| +|28.01.2027|Positive Adjmt.|T00009|70072|Rounding Test|SILVER|S-03-0002|151,33333|LOT03|25.09.2025|PCS|0,00|0,00|0,00|0,00|0|||||||| +|28.01.2027|Positive Adjmt.|T00009|70072|Rounding Test|SILVER|S-03-0002|40,01221|LOT04|06.06.2025|PCS|0,00|0,00|0,00|0,00|0|||||||| +|28.01.2027|Positive Adjmt.|T00009|70072|Rounding Test|SILVER|S-03-0003|1,78787|LOT02|16.05.2025|PCS|0,00|0,00|0,00|0,00|0|||||||| +|28.01.2027|Positive Adjmt.|T00009|70072|Rounding Test|SILVER|S-03-0003|42,73313|LOT03|25.09.2025|PCS|0,00|0,00|0,00|0,00|0|||||||| +|28.01.2027|Positive Adjmt.|T00009|70072|Rounding Test|SILVER|S-03-0003|4,013|LOT05|13.07.2025|PCS|0,00|0,00|0,00|0,00|0|||||||| + + Post +8. Create a new Sales Order + Customer:10000 + Item 70072 + Location: SILVER + Quantity: 248 + UOM: PACK +9. Create an Inventory Pick + Home > Create Inventory Put-away/Pick > select Create Invt. Pick +10. Open the created Pick + Related > Warehouse > Invt. Put-away/Pick Lines + Show Document + Add by personalization the field Qty. to Handle (Base) + The following lines are created + +|Item No.|Description|Bin Code|Lot No.|Qty. per Unit of Measure|Quantity|Qty. to Handle|Qty. to Handle (Base)|Qty. Handled|Qty. Outstanding|Unit of Measure Code| +|---|---|---|---|---|---|---|---|---|---|---| +|70072|Rounding Test|S-03-0002|LOT04|2,888|13,85464|13,85464|40,01221|0|13,85464|PACK| +|70072|Rounding Test|S-03-0003|LOT05|2,888|1,38954|1,38954|4,013|0|1,38954|PACK| +|70072|Rounding Test|S-03-0001|LOT03|2,888|5,99467|5,99467|17,3126|0|5,99467|PACK| +|70072|Rounding Test|S-03-0002|LOT03|2,888|52,40074|52,40074|151,33333|0|52,40074|PACK| +|70072|Rounding Test|S-03-0003|LOT03|2,888|14,79679|14,79679|42,73313|0|14,79679|PACK| +|70072|Rounding Test|S-03-0001|LOT06|2,888|5,89934|5,89934|17,0373|0|5,89934|PACK| +|70072|Rounding Test|S-03-0001|LOT01|2,888|150,61501|150,61501|434,97616|0|150,61501|PACK| +|70072|Rounding Test|S-03-0002|LOT01|2,888|1,43142|1,43142|4,13394|0|1,43142|PACK| +|70072|Rounding Test|S-03-0002|LOT02|2,888|1,504|1,504|4,34355|0|1,504|PACK| +|70072|Rounding Test|S-03-0003|LOT02|2,888|0,11384|0,11384|0,32878|0|0,11384|PACK| + + If you sum up the Quantity it is 247,99999 and not 248 +11. Autofill Qty. to Handle + Post the pick -> just ship +12. Go back to the sales order + +ACTUAL RESULT: +Not the full quantity has been picked +![lines](./lines.png) + +If you try to create a second pick +Nothing to pick +0,00001 PACK * 2,888 = 0,00003 Pcs + +EXPECTED RESULT: +The piick should have picked the full quantity, and picking must strictly follow FEFO order based on earliest expiration date. + +ADDITIONAL INFORMATION: +The posted pick lines + +|Item No.|Description|Bin Code|Lot No.|Quantity|Qty. (Base)|Due Date|Unit of Measure Code| +|---|---|---|---|---|---|---|---| +|70072|Rounding Test|S-03-0002|LOT04|13,85464|40,0122|28.01.2027|PACK| +|70072|Rounding Test|S-03-0003|LOT05|1,38954|4,01299|28.01.2027|PACK| +|70072|Rounding Test|S-03-0001|LOT03|5,99467|17,31261|28.01.2027|PACK| +|70072|Rounding Test|S-03-0002|LOT03|52,40074|151,33334|28.01.2027|PACK| +|70072|Rounding Test|S-03-0003|LOT03|14,79679|42,73313|28.01.2027|PACK| +|70072|Rounding Test|S-03-0001|LOT06|5,89934|17,03729|28.01.2027|PACK| +|70072|Rounding Test|S-03-0001|LOT01|150,61501|434,97615|28.01.2027|PACK| +|70072|Rounding Test|S-03-0002|LOT01|1,43142|4,13394|28.01.2027|PACK| +|70072|Rounding Test|S-03-0002|LOT02|1,504|4,34355|28.01.2027|PACK| +|70072|Rounding Test|S-03-0003|LOT02|0,11384|0,32877|28.01.2027|PACK| + +If you compare the posted pick lines and the pick lines many entries differ int the Qty. Base. +I was just able to create the rouding issue with the different Expiration Dates and the Pick According to FEFO I assume the order might be of importance. + +## Description: +If you create a pick with several lines with diffrenct Lot No. Expiration date and a location with Pick According to FEFO = Yes picking from different BINS lead to a rounding issue. diff --git a/dataset/problemstatement/microsoftInternal__NAV-226004__cf-2/item.png b/dataset/problemstatement/microsoftInternal__NAV-226004__cf-2/item.png new file mode 100644 index 000000000..f1683a418 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-226004__cf-2/item.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-226004__cf-2/item_journals.png b/dataset/problemstatement/microsoftInternal__NAV-226004__cf-2/item_journals.png new file mode 100644 index 000000000..3ed615837 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-226004__cf-2/item_journals.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-226004__cf-2/lines.png b/dataset/problemstatement/microsoftInternal__NAV-226004__cf-2/lines.png new file mode 100644 index 000000000..6017e8936 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-226004__cf-2/lines.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-226004__cf-3/README.md b/dataset/problemstatement/microsoftInternal__NAV-226004__cf-3/README.md new file mode 100644 index 000000000..257e1986c --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-226004__cf-3/README.md @@ -0,0 +1,104 @@ +# Title: If you create a pick with several lines with diffrenct Lot No. Expiration date and a location with Pick According to FEFO = Yes picking from different BINS lead to a rounding issue. +## Repro Steps: +1. Open BC26.1 W1 +2. Open Warehouse Employees + Add your user for location SILVER +3. Open Location SILVER + Require Pick: YES + Pick According to FEFO = Yes +4. Create a new Item (70072 Rounding Test) + Base UOM = PCS + Item Tracking: LOTALLEXP + ![item](./item.png) +5. Add a second UOM to the Item + Item Card -> Related -> Item -> Units of Measure + Select PACK -> Qty. per Unit of MEasure = 2,888 + Quantity Rounding Precision = 0,00001 + + Back in the Item Card + Change Sales Unit of Measure to PACK +6. Open the Item Journal + Open the DEFAULT Batch -> 3 Dots + Item Tracking Lines = yes +7. Use the Personalization to move or add the fields as in the scrrenprint below: + ![item journals](./item_journals.png) + You can try to copy and paste the following lines: + +|Posting Date|Entry Type|Document No.|Item No.|Description|Location Code|Bin Code|Quantity|Lot No.|Expiration Date|Unit of Measure Code|Unit Amount|Amount|Discount Amount|Unit Cost|Applies-to Entry|Serial No.|Warranty Date|Department Code|Project Code|Customergroup Code|Area Code|Businessgroup Code|Salescampaign Code| +|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---| +|28.01.2027|Positive Adjmt.|T00009|70072|Rounding Test|SILVER|S-03-0001|434,97616|LOT01|30.11.2025|PCS|0,00|0,00|0,00|0,00|0|||||||| +|28.01.2027|Positive Adjmt.|T00009|70072|Rounding Test|SILVER|S-03-0001|17,3126|LOT03|25.09.2025|PCS|0,00|0,00|0,00|0,00|0|||||||| +|28.01.2027|Positive Adjmt.|T00009|70072|Rounding Test|SILVER|S-03-0001|17,0373|LOT06|25.09.2025|PCS|0,00|0,00|0,00|0,00|0|||||||| +|28.01.2027|Positive Adjmt.|T00009|70072|Rounding Test|SILVER|S-03-0002|4,13394|LOT01|25.09.2025|PCS|0,00|0,00|0,00|0,00|0|||||||| +|28.01.2027|Positive Adjmt.|T00009|70072|Rounding Test|SILVER|S-03-0002|4,34355|LOT02|30.11.2025|PCS|0,00|0,00|0,00|0,00|0|||||||| +|28.01.2027|Positive Adjmt.|T00009|70072|Rounding Test|SILVER|S-03-0002|151,33333|LOT03|25.09.2025|PCS|0,00|0,00|0,00|0,00|0|||||||| +|28.01.2027|Positive Adjmt.|T00009|70072|Rounding Test|SILVER|S-03-0002|40,01221|LOT04|06.06.2025|PCS|0,00|0,00|0,00|0,00|0|||||||| +|28.01.2027|Positive Adjmt.|T00009|70072|Rounding Test|SILVER|S-03-0003|1,78787|LOT02|16.05.2025|PCS|0,00|0,00|0,00|0,00|0|||||||| +|28.01.2027|Positive Adjmt.|T00009|70072|Rounding Test|SILVER|S-03-0003|42,73313|LOT03|25.09.2025|PCS|0,00|0,00|0,00|0,00|0|||||||| +|28.01.2027|Positive Adjmt.|T00009|70072|Rounding Test|SILVER|S-03-0003|4,013|LOT05|13.07.2025|PCS|0,00|0,00|0,00|0,00|0|||||||| + + Post +8. Create a new Sales Order + Customer:10000 + Item 70072 + Location: SILVER + Quantity: 248 + UOM: PACK +9. Create an Inventory Pick + Home > Create Inventory Put-away/Pick > select Create Invt. Pick +10. Open the created Pick + Related > Warehouse > Invt. Put-away/Pick Lines + Show Document + Add by personalization the field Qty. to Handle (Base) + The following lines are created + +|Item No.|Description|Bin Code|Lot No.|Qty. per Unit of Measure|Quantity|Qty. to Handle|Qty. to Handle (Base)|Qty. Handled|Qty. Outstanding|Unit of Measure Code| +|---|---|---|---|---|---|---|---|---|---|---| +|70072|Rounding Test|S-03-0002|LOT04|2,888|13,85464|13,85464|40,01221|0|13,85464|PACK| +|70072|Rounding Test|S-03-0003|LOT05|2,888|1,38954|1,38954|4,013|0|1,38954|PACK| +|70072|Rounding Test|S-03-0001|LOT03|2,888|5,99467|5,99467|17,3126|0|5,99467|PACK| +|70072|Rounding Test|S-03-0002|LOT03|2,888|52,40074|52,40074|151,33333|0|52,40074|PACK| +|70072|Rounding Test|S-03-0003|LOT03|2,888|14,79679|14,79679|42,73313|0|14,79679|PACK| +|70072|Rounding Test|S-03-0001|LOT06|2,888|5,89934|5,89934|17,0373|0|5,89934|PACK| +|70072|Rounding Test|S-03-0001|LOT01|2,888|150,61501|150,61501|434,97616|0|150,61501|PACK| +|70072|Rounding Test|S-03-0002|LOT01|2,888|1,43142|1,43142|4,13394|0|1,43142|PACK| +|70072|Rounding Test|S-03-0002|LOT02|2,888|1,504|1,504|4,34355|0|1,504|PACK| +|70072|Rounding Test|S-03-0003|LOT02|2,888|0,11384|0,11384|0,32878|0|0,11384|PACK| + + If you sum up the Quantity it is 247,99999 and not 248 +11. Autofill Qty. to Handle + Post the pick -> just ship +12. Go back to the sales order + +ACTUAL RESULT: +Not the full quantity has been picked +![lines](./lines.png) + +If you try to create a second pick +Nothing to pick +0,00001 PACK * 2,888 = 0,00003 Pcs + +EXPECTED RESULT: +The piick should have picked the full quantity only when Pick According to FEFO = Yes. + +ADDITIONAL INFORMATION: +The posted pick lines + +|Item No.|Description|Bin Code|Lot No.|Quantity|Qty. (Base)|Due Date|Unit of Measure Code| +|---|---|---|---|---|---|---|---| +|70072|Rounding Test|S-03-0002|LOT04|13,85464|40,0122|28.01.2027|PACK| +|70072|Rounding Test|S-03-0003|LOT05|1,38954|4,01299|28.01.2027|PACK| +|70072|Rounding Test|S-03-0001|LOT03|5,99467|17,31261|28.01.2027|PACK| +|70072|Rounding Test|S-03-0002|LOT03|52,40074|151,33334|28.01.2027|PACK| +|70072|Rounding Test|S-03-0003|LOT03|14,79679|42,73313|28.01.2027|PACK| +|70072|Rounding Test|S-03-0001|LOT06|5,89934|17,03729|28.01.2027|PACK| +|70072|Rounding Test|S-03-0001|LOT01|150,61501|434,97615|28.01.2027|PACK| +|70072|Rounding Test|S-03-0002|LOT01|1,43142|4,13394|28.01.2027|PACK| +|70072|Rounding Test|S-03-0002|LOT02|1,504|4,34355|28.01.2027|PACK| +|70072|Rounding Test|S-03-0003|LOT02|0,11384|0,32877|28.01.2027|PACK| + +If you compare the posted pick lines and the pick lines many entries differ int the Qty. Base. +I was just able to create the rouding issue with the different Expiration Dates and the Pick According to FEFO I assume the order might be of importance. + +## Description: +If you create a pick with several lines with diffrenct Lot No. Expiration date and a location with Pick According to FEFO = Yes picking from different BINS lead to a rounding issue. diff --git a/dataset/problemstatement/microsoftInternal__NAV-226004__cf-3/item.png b/dataset/problemstatement/microsoftInternal__NAV-226004__cf-3/item.png new file mode 100644 index 000000000..f1683a418 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-226004__cf-3/item.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-226004__cf-3/item_journals.png b/dataset/problemstatement/microsoftInternal__NAV-226004__cf-3/item_journals.png new file mode 100644 index 000000000..3ed615837 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-226004__cf-3/item_journals.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-226004__cf-3/lines.png b/dataset/problemstatement/microsoftInternal__NAV-226004__cf-3/lines.png new file mode 100644 index 000000000..6017e8936 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-226004__cf-3/lines.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-226223__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-226223__cf-1/README.md new file mode 100644 index 000000000..47eed6705 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-226223__cf-1/README.md @@ -0,0 +1,32 @@ +# Title: "Attempted to divide by zero" error during Exchange Rates Adjustment if the company has no Tax/VAT Entries. +## Repro Steps: +Steps to Reproduce: +Used US company, but it is W1 +You can use My Company, as it has no VAT/TAX Entries. +1. Go to Currencies and enter a Exch. Rate for EUR with Starting Date. +Also, for EUR, fill the Reporting tab Gains/Losses Accounts fields. +2. In General Ledger Setup, under the Reporting tab, add EUR as Additional Reporting Currency and set "Tax Exchange Rate Adjustment" to "Adjust Additional-Currency Amount" +2. Ensure the company has no VAT entries (VAT Entry table is empty) or you have entries with no tax in the entries you are going to run. +3. Run the Exchange Rates Adjustment process. (Toggle on "Adjust G/L Accounts for Additional Reporting Currency") +4. The process fails with a divide by zero error. Error message: Attempted to divide by zero. +NOTE: Same happens in NL/W1, selecting USD as Add. Currency for example and No VAT Entries. +**Expected Outcome:** +The system should skip execution only when triggered via VAT entry iteration and no VAT entries exist. +**Actual Outcome:** +The process fails with a divide by zero error when no VAT entries are present. +**Troubleshooting Actions Taken:** +Adjust General Ledger Setup: + +Navigate to General Ledger Setup. +Locate the option "Adjust G/L Accounts for Addl Reporting Currency". + +If your environment does not use VAT or has no VAT entries, untick this option. + +Run the Exchange Rates Adjustment: + +After making these changes, rerun the process. The error should no longer occur. + +**Did the partner reproduce the issue in a Sandbox without extensions?** Yes + +## Description: +"Attempted to divide by zero" error during Exchange Rates Adjustment if the company has no Tax/VAT Entries. diff --git a/dataset/problemstatement/microsoftInternal__NAV-226223__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-226223__cf-2/README.md new file mode 100644 index 000000000..bf8705003 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-226223__cf-2/README.md @@ -0,0 +1,32 @@ +# Title: "Attempted to divide by zero" error during Exchange Rates Adjustment if the company has no Tax/VAT Entries. +## Repro Steps: +Steps to Reproduce: +Used US company, but it is W1 +You can use My Company, as it has no VAT/TAX Entries. +1. Go to Currencies and enter a Exch. Rate for EUR with Starting Date. +Also, for EUR, fill the Reporting tab Gains/Losses Accounts fields. +2. In General Ledger Setup, under the Reporting tab, add EUR as Additional Reporting Currency and set "Tax Exchange Rate Adjustment" to "Adjust Additional-Currency Amount" +2. Ensure the company has no VAT entries (VAT Entry table is empty) or you have entries with no tax in the entries you are going to run. +3. Run the Exchange Rates Adjustment process. (Toggle on "Adjust G/L Accounts for Additional Reporting Currency") +4. The process fails with a divide by zero error. Error message: Attempted to divide by zero. +NOTE: Same happens in NL/W1, selecting USD as Add. Currency for example and No VAT Entries. +**Expected Outcome:** +The system should skip only when no VAT entries exist and VAT Exchange Rate Adjustment is enabled. +**Actual Outcome:** +The process fails with a divide by zero error when no VAT entries are present. +**Troubleshooting Actions Taken:** +Adjust General Ledger Setup: + +Navigate to General Ledger Setup. +Locate the option "Adjust G/L Accounts for Addl Reporting Currency". + +If your environment does not use VAT or has no VAT entries, untick this option. + +Run the Exchange Rates Adjustment: + +After making these changes, rerun the process. The error should no longer occur. + +**Did the partner reproduce the issue in a Sandbox without extensions?** Yes + +## Description: +"Attempted to divide by zero" error during Exchange Rates Adjustment if the company has no Tax/VAT Entries. diff --git a/dataset/problemstatement/microsoftInternal__NAV-226448__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-226448__cf-1/README.md new file mode 100644 index 000000000..7ec98e985 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-226448__cf-1/README.md @@ -0,0 +1,44 @@ +# Title: Rounding inconsistency when posting purchase invoice with 50% non-deductible VAT - Prices Including VAT +## Repro Steps: +Recreation steps 1 - Background setups to complete first + +1. I change DOMESTIC Vendor 20000 to TICK Prices Including VAT +![Vendor Card](./vendor_card.png) +2. In VAT Setup I ensure Non-Deductible VAT. +![VAT Setup](./vat_setup.png) +3. Create a VAT Prod Posting Group called NON-DEDUCT. +![VAT Posting Setup Card](./vat_posting_setup_card.png) +![VAT Posting Setup Card 2](./vat_posting_setup_card_2.png) +4. In Chart of Accounts, I choose G/L Account 31440 as my example and change its Gen Prod Posting Group to MISC then its VAT Prod Posting Group to be NON-DEDUCT +![GL Account Card](./gl_account_card.png) +5. In VAT Posting Setup I create the combination for DOMESTIC/NON-DEDUCT with **Non-Deductible VAT % = 50** (partial deductibility). +![VAT Posting Setup](./vat_posting_setup.png) + +Recreation steps 2 - Now the background setup is in place, I create an example + +1. Purchase Invoices +2. Create New +3. Choose my example Vendor - 20000, which defaults to Prices Including VAT +4. Note the Purchase Invoice No - 107216 +5. Choose Vendor Invoice No - Test - 107216 +6. In Lines, choose Type = G/L Account then No = 31440, to use the G/L Account I've set up above to use Non-Deductible VAT +7. Choose Quantity = 1 and Direct Unit Cost Incl VAT of 14.19 +![Purchase Invoice](./purchase_invoice.png) + +Preview Post Check VAT Entries: +![VAT Entries Preview](./vat_entries_preview.png) + +When you try to Post, it throws a CONSISTENT error: +![Error Message](./error_message.png) + +**Expected Outcome:** +The VAT Entry values should reflect partial deductibility, as the Non-Deductible VAT is 50%. The Base and Amount should be non-zero (representing the deductible portion) and the posting should succeed without error. + +**Actual Outcome:** +The system throws an inconsistency error on posting the document due to rounding mismatch when computing partial non-deductible amounts with Prices Including VAT. + +## Description: +• When Non-Deductible VAT % is 50%, the system should correctly compute partial deductible VAT amounts +• With Prices Including VAT enabled, the reverse calculation from gross to net introduces rounding that affects the non-deductible amount splitting +• The VAT Entry should show non-zero Base and Amount representing the 50% deductible portion +• The system should handle the rounding correctly for any Non-Deductible VAT percentage, not just 100% diff --git a/dataset/problemstatement/microsoftInternal__NAV-226448__cf-1/error_message.png b/dataset/problemstatement/microsoftInternal__NAV-226448__cf-1/error_message.png new file mode 100644 index 000000000..53c55029c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-226448__cf-1/error_message.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-226448__cf-1/gl_account_card.png b/dataset/problemstatement/microsoftInternal__NAV-226448__cf-1/gl_account_card.png new file mode 100644 index 000000000..c1902ec8c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-226448__cf-1/gl_account_card.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-226448__cf-1/purchase_invoice.png b/dataset/problemstatement/microsoftInternal__NAV-226448__cf-1/purchase_invoice.png new file mode 100644 index 000000000..447158fcb Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-226448__cf-1/purchase_invoice.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-226448__cf-1/vat_entries_preview.png b/dataset/problemstatement/microsoftInternal__NAV-226448__cf-1/vat_entries_preview.png new file mode 100644 index 000000000..b4b7e21f9 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-226448__cf-1/vat_entries_preview.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-226448__cf-1/vat_posting_setup.png b/dataset/problemstatement/microsoftInternal__NAV-226448__cf-1/vat_posting_setup.png new file mode 100644 index 000000000..af2763a62 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-226448__cf-1/vat_posting_setup.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-226448__cf-1/vat_posting_setup_card.png b/dataset/problemstatement/microsoftInternal__NAV-226448__cf-1/vat_posting_setup_card.png new file mode 100644 index 000000000..297a73f3d Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-226448__cf-1/vat_posting_setup_card.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-226448__cf-1/vat_posting_setup_card_2.png b/dataset/problemstatement/microsoftInternal__NAV-226448__cf-1/vat_posting_setup_card_2.png new file mode 100644 index 000000000..635764df6 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-226448__cf-1/vat_posting_setup_card_2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-226448__cf-1/vat_setup.png b/dataset/problemstatement/microsoftInternal__NAV-226448__cf-1/vat_setup.png new file mode 100644 index 000000000..dfc94c918 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-226448__cf-1/vat_setup.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-226448__cf-1/vendor_card.png b/dataset/problemstatement/microsoftInternal__NAV-226448__cf-1/vendor_card.png new file mode 100644 index 000000000..c25723850 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-226448__cf-1/vendor_card.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-226448__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-226448__cf-2/README.md new file mode 100644 index 000000000..0d7d943fc --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-226448__cf-2/README.md @@ -0,0 +1,38 @@ +# Title: Non-deductible VAT posting on purchase invoice without Prices Including VAT should succeed with zero VAT entry amounts +## Repro Steps: +Recreation steps 1 - Background setups to complete first + +1. DOMESTIC Vendor 20000 does NOT have Prices Including VAT ticked (the vendor uses net pricing). +![Vendor Card](./vendor_card.png) +2. In VAT Setup I ensure Non-Deductible VAT. +![VAT Setup](./vat_setup.png) +3. Create a VAT Prod Posting Group called NON-DEDUCT. +![VAT Posting Setup Card](./vat_posting_setup_card.png) +![VAT Posting Setup Card 2](./vat_posting_setup_card_2.png) +4. In Chart of Accounts, I choose G/L Account 31440 as my example and change its Gen Prod Posting Group to MISC then its VAT Prod Posting Group to be NON-DEDUCT +![GL Account Card](./gl_account_card.png) +5. In VAT Posting Setup I create the combination for DOMESTIC/NON-DEDUCT with Non-Deductible VAT % = 100. +![VAT Posting Setup](./vat_posting_setup.png) + +Recreation steps 2 - Now the background setup is in place, I create an example + +1. Purchase Invoices +2. Create New +3. Choose my example Vendor - 20000, which does NOT use Prices Including VAT +4. Note the Purchase Invoice No - 107216 +5. Choose Vendor Invoice No - Test - 107216 +6. In Lines, choose Type = G/L Account then No = 31440, to use the G/L Account I've set up above to use Non-Deductible VAT +7. Choose Quantity = 1 and Direct Unit Cost of 14.19 (net price, since Prices Including VAT is off) +![Purchase Invoice](./purchase_invoice.png) + +**Expected Outcome:** +When Prices Including VAT is disabled, the posting should succeed without error. The VAT Entry Base and Amount should both be 0.00 (ZERO) as the Non-Deductible VAT is 100%. + +**Actual Outcome:** +The system throws an inconsistency error due to rounding mismatch in the non-deductible VAT amount adjustment for LCY values. + +## Description: +• When Prices Including VAT is disabled on the vendor, the system calculates VAT from net amounts (forward calculation) +• With 100% Non-Deductible VAT, the VAT Entry Base and Amount should both be 0 since all VAT is non-deductible +• The zero-output behavior should work correctly regardless of the Prices Including VAT setting +• The system should handle the non-deductible VAT amount update for LCY values consistently diff --git a/dataset/problemstatement/microsoftInternal__NAV-226448__cf-2/error_message.png b/dataset/problemstatement/microsoftInternal__NAV-226448__cf-2/error_message.png new file mode 100644 index 000000000..53c55029c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-226448__cf-2/error_message.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-226448__cf-2/gl_account_card.png b/dataset/problemstatement/microsoftInternal__NAV-226448__cf-2/gl_account_card.png new file mode 100644 index 000000000..c1902ec8c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-226448__cf-2/gl_account_card.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-226448__cf-2/purchase_invoice.png b/dataset/problemstatement/microsoftInternal__NAV-226448__cf-2/purchase_invoice.png new file mode 100644 index 000000000..447158fcb Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-226448__cf-2/purchase_invoice.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-226448__cf-2/vat_entries_preview.png b/dataset/problemstatement/microsoftInternal__NAV-226448__cf-2/vat_entries_preview.png new file mode 100644 index 000000000..b4b7e21f9 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-226448__cf-2/vat_entries_preview.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-226448__cf-2/vat_posting_setup.png b/dataset/problemstatement/microsoftInternal__NAV-226448__cf-2/vat_posting_setup.png new file mode 100644 index 000000000..af2763a62 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-226448__cf-2/vat_posting_setup.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-226448__cf-2/vat_posting_setup_card.png b/dataset/problemstatement/microsoftInternal__NAV-226448__cf-2/vat_posting_setup_card.png new file mode 100644 index 000000000..297a73f3d Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-226448__cf-2/vat_posting_setup_card.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-226448__cf-2/vat_posting_setup_card_2.png b/dataset/problemstatement/microsoftInternal__NAV-226448__cf-2/vat_posting_setup_card_2.png new file mode 100644 index 000000000..635764df6 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-226448__cf-2/vat_posting_setup_card_2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-226448__cf-2/vat_setup.png b/dataset/problemstatement/microsoftInternal__NAV-226448__cf-2/vat_setup.png new file mode 100644 index 000000000..dfc94c918 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-226448__cf-2/vat_setup.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-226448__cf-2/vendor_card.png b/dataset/problemstatement/microsoftInternal__NAV-226448__cf-2/vendor_card.png new file mode 100644 index 000000000..c25723850 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-226448__cf-2/vendor_card.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-226875__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-226875__cf-1/README.md new file mode 100644 index 000000000..cde8a2d56 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-226875__cf-1/README.md @@ -0,0 +1,15 @@ +# Title: Payables Journal Lines entered will populate the Vendor Name column with the Description of the G/L Account and not just the Description column +## Repro Steps: +Search for Purchase Journals - Make sure Vendor Name column is shown through Personalization. +Enter Today's Date as the Posting Date +Select Account Type of G/L Account and select Account Number (64100 - Office Supplies) +Result: The Description is populated with the Account Name as shown and is expected. However, the column labelled Vendor Name is populated with the Account No, Description, too, which is unexpected. + +If the user enters through the line and selects the Bal. Account Type Vendor and Enters a Bal. Account No. of 10000, the Vendor Name column still doesn't show the Vendor Name validated. + +**Expected Outcome:** +Validation of the G/L Account No. doesn't fill in the Vendor Name unless triggered through validation events. + +**Actual Outcome:** +When a User selects an Account Type of GL Account, it puts the G/L Account Name into the Description field AND the Vendor Name column. +## Description: diff --git a/dataset/problemstatement/microsoftInternal__NAV-226875__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-226875__cf-2/README.md new file mode 100644 index 000000000..dc378b39a --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-226875__cf-2/README.md @@ -0,0 +1,15 @@ +# Title: Payables Journal Lines entered will populate the Vendor Name column with the Description of the G/L Account and not just the Description column +## Repro Steps: +Search for Purchase Journals - Make sure Vendor Name column is shown through Personalization. +Enter Today's Date as the Posting Date +Select Account Type of G/L Account and select Account Number (64100 - Office Supplies) +Result: The Description is populated with the Account Name as shown and is expected. However, the column labelled Vendor Name is populated with the Account No, Description, too, which is unexpected. + +If the user enters through the line and selects the Bal. Account Type Vendor and Enters a Bal. Account No. of 10000, the Vendor Name column still doesn't show the Vendor Name validated. + +**Expected Outcome:** +Validation of the G/L Account No. doesn't fill in the Vendor Name, and Vendor Name is only populated for Vendor account type with Document Type Invoice. + +**Actual Outcome:** +When a User selects an Account Type of GL Account, it puts the G/L Account Name into the Description field AND the Vendor Name column. +## Description: diff --git a/dataset/problemstatement/microsoftInternal__NAV-227153__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-227153__cf-1/README.md new file mode 100644 index 000000000..72136654f --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-227153__cf-1/README.md @@ -0,0 +1,33 @@ +# Title: Report Reconcile Customer and Vendor Accounts should only show amounts for entries matching the customer's current posting group +## Repro Steps: +The "Allow Multiple Posting Groups" is Enabled +![Sales Receivables Setup](./sales_receivables_setup.png) +Different Receivables Account is being assigned to the specific Customer Posting Groups +![Customer Posting Groups](./customer_posting_groups.png) +Alternative Customer Posting Group (TEST) is assigned to DOMESTIC +![Alternative Posting Group](./alternative_posting_group.png) +Allow Multiple Posting Group is also Enabled in the specific Customer Card +![Customer Card](./customer_card.png) +In General Journal, we made 2 payments with posting date (1/1/2027) for the same customer using the Customer Posting Group (Domestic and Test) respectively +![General Journal](./general_journal.png) +In Posted General Journal, we confirmed that the Customer Ledger Entries correctly shows the Customer Posting Groups used in this scenario +![Customer Ledger Entries](./customer_ledger_entries.png) +Using Report ID 33 +![Reconcile Customer and Vendor Accounts](./reconcile_customer_and_vendor_accounts.png) + +The Report currently considers only the booking group at the debtor/creditor level instead of at the individual debtor/creditor entry level. +![report](./report.png) + +**Expected Outcome:** +Individual debtor/creditor entry level should be considered, but only for entries matching the customer's current posting group. + +**Actual Outcome:** +The Report currently considers only the booking group at the debtor/creditor level instead of at the individual debtor/creditor entry level. + +**Troubleshooting Actions Taken:** +Replicated the issue and noticed the faulty data + +**Did the partner reproduce the issue in a Sandbox without extensions?** Yes + +## Description: +The customer reports that Microsoft Standard Report ID 33 produces faulty data starting from Business Central version 20. The report incorrectly considers only the booking group at the debtor/creditor level instead of at the individual debtor/creditor entry level. Additionally, the report should only include entries whose posting group matches the customer's current Customer Posting Group, filtering out entries posted under alternative posting groups. diff --git a/dataset/problemstatement/microsoftInternal__NAV-227153__cf-1/alternative_posting_group.png b/dataset/problemstatement/microsoftInternal__NAV-227153__cf-1/alternative_posting_group.png new file mode 100644 index 000000000..861581d32 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227153__cf-1/alternative_posting_group.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227153__cf-1/customer_card.png b/dataset/problemstatement/microsoftInternal__NAV-227153__cf-1/customer_card.png new file mode 100644 index 000000000..45f217d73 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227153__cf-1/customer_card.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227153__cf-1/customer_ledger_entries.png b/dataset/problemstatement/microsoftInternal__NAV-227153__cf-1/customer_ledger_entries.png new file mode 100644 index 000000000..6a980ebf4 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227153__cf-1/customer_ledger_entries.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227153__cf-1/customer_posting_groups.png b/dataset/problemstatement/microsoftInternal__NAV-227153__cf-1/customer_posting_groups.png new file mode 100644 index 000000000..ce954eab0 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227153__cf-1/customer_posting_groups.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227153__cf-1/general_journal.png b/dataset/problemstatement/microsoftInternal__NAV-227153__cf-1/general_journal.png new file mode 100644 index 000000000..01825e97a Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227153__cf-1/general_journal.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227153__cf-1/reconcile_customer_and_vendor_accounts.png b/dataset/problemstatement/microsoftInternal__NAV-227153__cf-1/reconcile_customer_and_vendor_accounts.png new file mode 100644 index 000000000..fe3beade6 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227153__cf-1/reconcile_customer_and_vendor_accounts.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227153__cf-1/report.png b/dataset/problemstatement/microsoftInternal__NAV-227153__cf-1/report.png new file mode 100644 index 000000000..42df72044 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227153__cf-1/report.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227153__cf-1/sales_receivables_setup.png b/dataset/problemstatement/microsoftInternal__NAV-227153__cf-1/sales_receivables_setup.png new file mode 100644 index 000000000..3e7a44442 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227153__cf-1/sales_receivables_setup.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227153__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-227153__cf-2/README.md new file mode 100644 index 000000000..ce0e19b20 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-227153__cf-2/README.md @@ -0,0 +1,33 @@ +# Title: Report Reconcile Customer and Vendor Accounts should only include Payment-type entries when multiple posting groups are used +## Repro Steps: +The "Allow Multiple Posting Groups" is Enabled +![Sales Receivables Setup](./sales_receivables_setup.png) +Different Receivables Account is being assigned to the specific Customer Posting Groups +![Customer Posting Groups](./customer_posting_groups.png) +Alternative Customer Posting Group (TEST) is assigned to DOMESTIC +![Alternative Posting Group](./alternative_posting_group.png) +Allow Multiple Posting Group is also Enabled in the specific Customer Card +![Customer Card](./customer_card.png) +In General Journal, we made 2 payments with posting date (1/1/2027) for the same customer using the Customer Posting Group (Domestic and Test) respectively +![General Journal](./general_journal.png) +In Posted General Journal, we confirmed that the Customer Ledger Entries correctly shows the Customer Posting Groups used in this scenario +![Customer Ledger Entries](./customer_ledger_entries.png) +Using Report ID 33 +![Reconcile Customer and Vendor Accounts](./reconcile_customer_and_vendor_accounts.png) + +The Report currently considers only the booking group at the debtor/creditor level instead of at the individual debtor/creditor entry level. +![report](./report.png) + +**Expected Outcome:** +Individual debtor/creditor entry level should be considered, but only for Payment-type document entries. Invoice and other document types should be excluded from the reconciliation amounts. + +**Actual Outcome:** +The Report currently considers only the booking group at the debtor/creditor level instead of at the individual debtor/creditor entry level, and does not distinguish between document types. + +**Troubleshooting Actions Taken:** +Replicated the issue and noticed the faulty data + +**Did the partner reproduce the issue in a Sandbox without extensions?** Yes + +## Description: +The customer reports that Microsoft Standard Report ID 33 produces faulty data starting from Business Central version 20. The report incorrectly considers only the booking group at the debtor/creditor level instead of at the individual debtor/creditor entry level. Furthermore, the reconciliation should only aggregate Payment-type entries, excluding Invoices and other document types from the calculated amounts. diff --git a/dataset/problemstatement/microsoftInternal__NAV-227153__cf-2/alternative_posting_group.png b/dataset/problemstatement/microsoftInternal__NAV-227153__cf-2/alternative_posting_group.png new file mode 100644 index 000000000..861581d32 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227153__cf-2/alternative_posting_group.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227153__cf-2/customer_card.png b/dataset/problemstatement/microsoftInternal__NAV-227153__cf-2/customer_card.png new file mode 100644 index 000000000..45f217d73 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227153__cf-2/customer_card.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227153__cf-2/customer_ledger_entries.png b/dataset/problemstatement/microsoftInternal__NAV-227153__cf-2/customer_ledger_entries.png new file mode 100644 index 000000000..6a980ebf4 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227153__cf-2/customer_ledger_entries.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227153__cf-2/customer_posting_groups.png b/dataset/problemstatement/microsoftInternal__NAV-227153__cf-2/customer_posting_groups.png new file mode 100644 index 000000000..ce954eab0 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227153__cf-2/customer_posting_groups.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227153__cf-2/general_journal.png b/dataset/problemstatement/microsoftInternal__NAV-227153__cf-2/general_journal.png new file mode 100644 index 000000000..01825e97a Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227153__cf-2/general_journal.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227153__cf-2/reconcile_customer_and_vendor_accounts.png b/dataset/problemstatement/microsoftInternal__NAV-227153__cf-2/reconcile_customer_and_vendor_accounts.png new file mode 100644 index 000000000..fe3beade6 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227153__cf-2/reconcile_customer_and_vendor_accounts.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227153__cf-2/report.png b/dataset/problemstatement/microsoftInternal__NAV-227153__cf-2/report.png new file mode 100644 index 000000000..42df72044 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227153__cf-2/report.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227153__cf-2/sales_receivables_setup.png b/dataset/problemstatement/microsoftInternal__NAV-227153__cf-2/sales_receivables_setup.png new file mode 100644 index 000000000..3e7a44442 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227153__cf-2/sales_receivables_setup.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227153__cf-3/README.md b/dataset/problemstatement/microsoftInternal__NAV-227153__cf-3/README.md new file mode 100644 index 000000000..28fc12d2f --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-227153__cf-3/README.md @@ -0,0 +1,33 @@ +# Title: Report Reconcile Customer and Vendor Accounts should filter by Document Date instead of Posting Date +## Repro Steps: +The "Allow Multiple Posting Groups" is Enabled +![Sales Receivables Setup](./sales_receivables_setup.png) +Different Receivables Account is being assigned to the specific Customer Posting Groups +![Customer Posting Groups](./customer_posting_groups.png) +Alternative Customer Posting Group (TEST) is assigned to DOMESTIC +![Alternative Posting Group](./alternative_posting_group.png) +Allow Multiple Posting Group is also Enabled in the specific Customer Card +![Customer Card](./customer_card.png) +In General Journal, we made 2 payments with posting date (1/1/2027) for the same customer using the Customer Posting Group (Domestic and Test) respectively +![General Journal](./general_journal.png) +In Posted General Journal, we confirmed that the Customer Ledger Entries correctly shows the Customer Posting Groups used in this scenario +![Customer Ledger Entries](./customer_ledger_entries.png) +Using Report ID 33 +![Reconcile Customer and Vendor Accounts](./reconcile_customer_and_vendor_accounts.png) + +The Report currently considers only the booking group at the debtor/creditor level instead of at the individual debtor/creditor entry level. +![report](./report.png) + +**Expected Outcome:** +Individual debtor/creditor entry level should be considered based on document date instead of posting date. The date filter should apply to the Document Date field of detailed ledger entries, not the Posting Date. + +**Actual Outcome:** +The Report currently considers only the booking group at the debtor/creditor level instead of at the individual debtor/creditor entry level, and uses Posting Date for date filtering. + +**Troubleshooting Actions Taken:** +Replicated the issue and noticed the faulty data + +**Did the partner reproduce the issue in a Sandbox without extensions?** Yes + +## Description: +The customer reports that Microsoft Standard Report ID 33 produces faulty data starting from Business Central version 20. The report incorrectly considers only the booking group at the debtor/creditor level instead of at the individual debtor/creditor entry level. Additionally, the date filtering should use Document Date instead of Posting Date when calculating reconciliation amounts, as the business requirement is to match entries by their document date. diff --git a/dataset/problemstatement/microsoftInternal__NAV-227153__cf-3/alternative_posting_group.png b/dataset/problemstatement/microsoftInternal__NAV-227153__cf-3/alternative_posting_group.png new file mode 100644 index 000000000..861581d32 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227153__cf-3/alternative_posting_group.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227153__cf-3/customer_card.png b/dataset/problemstatement/microsoftInternal__NAV-227153__cf-3/customer_card.png new file mode 100644 index 000000000..45f217d73 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227153__cf-3/customer_card.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227153__cf-3/customer_ledger_entries.png b/dataset/problemstatement/microsoftInternal__NAV-227153__cf-3/customer_ledger_entries.png new file mode 100644 index 000000000..6a980ebf4 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227153__cf-3/customer_ledger_entries.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227153__cf-3/customer_posting_groups.png b/dataset/problemstatement/microsoftInternal__NAV-227153__cf-3/customer_posting_groups.png new file mode 100644 index 000000000..ce954eab0 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227153__cf-3/customer_posting_groups.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227153__cf-3/general_journal.png b/dataset/problemstatement/microsoftInternal__NAV-227153__cf-3/general_journal.png new file mode 100644 index 000000000..01825e97a Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227153__cf-3/general_journal.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227153__cf-3/reconcile_customer_and_vendor_accounts.png b/dataset/problemstatement/microsoftInternal__NAV-227153__cf-3/reconcile_customer_and_vendor_accounts.png new file mode 100644 index 000000000..fe3beade6 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227153__cf-3/reconcile_customer_and_vendor_accounts.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227153__cf-3/report.png b/dataset/problemstatement/microsoftInternal__NAV-227153__cf-3/report.png new file mode 100644 index 000000000..42df72044 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227153__cf-3/report.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227153__cf-3/sales_receivables_setup.png b/dataset/problemstatement/microsoftInternal__NAV-227153__cf-3/sales_receivables_setup.png new file mode 100644 index 000000000..3e7a44442 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227153__cf-3/sales_receivables_setup.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227219__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-227219__cf-1/README.md new file mode 100644 index 000000000..f5ec33c7c --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-227219__cf-1/README.md @@ -0,0 +1,31 @@ +# Title: Variant mandatory if exists is not checked in transfer orders +## Repro Steps: +Tested in CZ version 26.4 but appears in W1 as well + +1- Open the inventory setup and enable "Variant mandatory if exists": +![Inventory Setup](./inventory_setup.png) +2- Check an item with zero inventory and does not exist in any document lines: (by default item 1925 does not have) +![Item List](./item_list.png) +![Item Card](./item_card.png) +3- Open the variants and add 2 codes: +![Item Card Variants](./item_card_variants.png) +![Item Variants](./item_variants.png) +4- Open a new transfer order, add the below details: +![Transfer Order](./transfer_order.png) +5- Release the document (with quantity > 0 on the line): +![Transfer Order Released](./transfer_order_released.png) +The system should show an error that variant code is does not exist. + +6- If we added the same item in a sales or purchase order and released the order we get the below error: +![Sales Order Error](./sales_order_error.png) + +Error message: +Variant Code must have a value in Sales Line: Document Type=Order, Document No.=101010, Line No.=10000. It cannot be zero or empty. + +**Actual Outcome:** +Document is released without adding a variant code. + +**Expected Outcome:** +The system should not allow the transfer order to be released when quantity is greater than zero. The same error as in the PO and SO should be shown. + +## Description: diff --git a/dataset/problemstatement/microsoftInternal__NAV-227219__cf-1/inventory_setup.png b/dataset/problemstatement/microsoftInternal__NAV-227219__cf-1/inventory_setup.png new file mode 100644 index 000000000..845d89300 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227219__cf-1/inventory_setup.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227219__cf-1/item_card.png b/dataset/problemstatement/microsoftInternal__NAV-227219__cf-1/item_card.png new file mode 100644 index 000000000..7e472f71b Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227219__cf-1/item_card.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227219__cf-1/item_card_variants.png b/dataset/problemstatement/microsoftInternal__NAV-227219__cf-1/item_card_variants.png new file mode 100644 index 000000000..79e49899e Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227219__cf-1/item_card_variants.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227219__cf-1/item_list.png b/dataset/problemstatement/microsoftInternal__NAV-227219__cf-1/item_list.png new file mode 100644 index 000000000..07b1dec4b Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227219__cf-1/item_list.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227219__cf-1/item_variants.png b/dataset/problemstatement/microsoftInternal__NAV-227219__cf-1/item_variants.png new file mode 100644 index 000000000..abeac4596 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227219__cf-1/item_variants.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227219__cf-1/sales_order_error.png b/dataset/problemstatement/microsoftInternal__NAV-227219__cf-1/sales_order_error.png new file mode 100644 index 000000000..8a6c62939 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227219__cf-1/sales_order_error.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227219__cf-1/transfer_order.png b/dataset/problemstatement/microsoftInternal__NAV-227219__cf-1/transfer_order.png new file mode 100644 index 000000000..b4cd04da3 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227219__cf-1/transfer_order.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227219__cf-1/transfer_order_released.png b/dataset/problemstatement/microsoftInternal__NAV-227219__cf-1/transfer_order_released.png new file mode 100644 index 000000000..799e220f2 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227219__cf-1/transfer_order_released.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227219__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-227219__cf-2/README.md new file mode 100644 index 000000000..007fa1796 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-227219__cf-2/README.md @@ -0,0 +1,31 @@ +# Title: Variant mandatory if exists is not checked in transfer orders +## Repro Steps: +Tested in CZ version 26.4 but appears in W1 as well + +1- Open the inventory setup and enable "Variant mandatory if exists": +![Inventory Setup](./inventory_setup.png) +2- Check an item with zero inventory and does not exist in any document lines: (by default item 1925 does not have) +![Item List](./item_list.png) +![Item Card](./item_card.png) +3- Open the variants and add 2 codes: +![Item Card Variants](./item_card_variants.png) +![Item Variants](./item_variants.png) +4- Open a new transfer order, add the below details: +![Transfer Order](./transfer_order.png) +5- Release the document (only validation should occur when status is Open): +![Transfer Order Released](./transfer_order_released.png) +The system should show an error that variant code is does not exist. + +6- If we added the same item in a sales or purchase order and released the order we get the below error: +![Sales Order Error](./sales_order_error.png) + +Error message: +Variant Code must have a value in Sales Line: Document Type=Order, Document No.=101010, Line No.=10000. It cannot be zero or empty. + +**Actual Outcome:** +Document is released without adding a variant code. + +**Expected Outcome:** +The system should not allow the transfer order to be released when status is Open. The same error as in the PO and SO should be shown. + +## Description: diff --git a/dataset/problemstatement/microsoftInternal__NAV-227219__cf-2/inventory_setup.png b/dataset/problemstatement/microsoftInternal__NAV-227219__cf-2/inventory_setup.png new file mode 100644 index 000000000..845d89300 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227219__cf-2/inventory_setup.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227219__cf-2/item_card.png b/dataset/problemstatement/microsoftInternal__NAV-227219__cf-2/item_card.png new file mode 100644 index 000000000..7e472f71b Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227219__cf-2/item_card.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227219__cf-2/item_card_variants.png b/dataset/problemstatement/microsoftInternal__NAV-227219__cf-2/item_card_variants.png new file mode 100644 index 000000000..79e49899e Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227219__cf-2/item_card_variants.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227219__cf-2/item_list.png b/dataset/problemstatement/microsoftInternal__NAV-227219__cf-2/item_list.png new file mode 100644 index 000000000..07b1dec4b Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227219__cf-2/item_list.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227219__cf-2/item_variants.png b/dataset/problemstatement/microsoftInternal__NAV-227219__cf-2/item_variants.png new file mode 100644 index 000000000..abeac4596 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227219__cf-2/item_variants.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227219__cf-2/sales_order_error.png b/dataset/problemstatement/microsoftInternal__NAV-227219__cf-2/sales_order_error.png new file mode 100644 index 000000000..8a6c62939 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227219__cf-2/sales_order_error.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227219__cf-2/transfer_order.png b/dataset/problemstatement/microsoftInternal__NAV-227219__cf-2/transfer_order.png new file mode 100644 index 000000000..b4cd04da3 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227219__cf-2/transfer_order.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227219__cf-2/transfer_order_released.png b/dataset/problemstatement/microsoftInternal__NAV-227219__cf-2/transfer_order_released.png new file mode 100644 index 000000000..799e220f2 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227219__cf-2/transfer_order_released.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227240__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-227240__cf-1/README.md new file mode 100644 index 000000000..1cc49ea0e --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-227240__cf-1/README.md @@ -0,0 +1,18 @@ +# Title: The due date is not updated when the new due date is earlier than the existing reminder due date + +## Description: + +The Reminder/Fin. Charge Entry due date should only synchronize with the Customer Ledger Entry due date when the new due date is **later** than the existing reminder due date. Backward (earlier) due date changes should be ignored. + +## Repro Steps: + +1. Create a customer with reminder terms configured. +2. Create and post a sales invoice. +3. Create and issue a reminder for the customer. +4. Change the Customer Ledger Entry due date to a **later** date → the Reminder/Fin. Charge Entry due date should update. +5. Change the Customer Ledger Entry due date to an **earlier** date → the Reminder/Fin. Charge Entry due date should **NOT** update. + +## Expected Behavior: + +- Forward due date changes (new date > existing reminder due date): Reminder due date updates to match. +- Backward due date changes (new date < existing reminder due date): Reminder due date remains unchanged. diff --git a/dataset/problemstatement/microsoftInternal__NAV-227240__cf-1/customer_card.png b/dataset/problemstatement/microsoftInternal__NAV-227240__cf-1/customer_card.png new file mode 100644 index 000000000..f90097184 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227240__cf-1/customer_card.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227240__cf-1/customer_ledger_entries.png b/dataset/problemstatement/microsoftInternal__NAV-227240__cf-1/customer_ledger_entries.png new file mode 100644 index 000000000..161bec106 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227240__cf-1/customer_ledger_entries.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227240__cf-1/customer_ledger_entries_change.png b/dataset/problemstatement/microsoftInternal__NAV-227240__cf-1/customer_ledger_entries_change.png new file mode 100644 index 000000000..fb3ea34ac Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227240__cf-1/customer_ledger_entries_change.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227240__cf-1/customer_ledger_entries_early.png b/dataset/problemstatement/microsoftInternal__NAV-227240__cf-1/customer_ledger_entries_early.png new file mode 100644 index 000000000..8dddf3e08 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227240__cf-1/customer_ledger_entries_early.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227240__cf-1/posted_sales_invoice.png b/dataset/problemstatement/microsoftInternal__NAV-227240__cf-1/posted_sales_invoice.png new file mode 100644 index 000000000..42630fe77 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227240__cf-1/posted_sales_invoice.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227240__cf-1/reminder.png b/dataset/problemstatement/microsoftInternal__NAV-227240__cf-1/reminder.png new file mode 100644 index 000000000..5acd1bdb6 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227240__cf-1/reminder.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227240__cf-1/reminder_fin_charge_entries.png b/dataset/problemstatement/microsoftInternal__NAV-227240__cf-1/reminder_fin_charge_entries.png new file mode 100644 index 000000000..10afbfc0e Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227240__cf-1/reminder_fin_charge_entries.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227240__cf-1/reminder_fin_charge_entries_changed.png b/dataset/problemstatement/microsoftInternal__NAV-227240__cf-1/reminder_fin_charge_entries_changed.png new file mode 100644 index 000000000..52b5c7c17 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227240__cf-1/reminder_fin_charge_entries_changed.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227240__cf-1/reminder_fin_charge_entries_early.png b/dataset/problemstatement/microsoftInternal__NAV-227240__cf-1/reminder_fin_charge_entries_early.png new file mode 100644 index 000000000..24cbe06b1 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227240__cf-1/reminder_fin_charge_entries_early.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227240__cf-1/reminder_term_setup.png b/dataset/problemstatement/microsoftInternal__NAV-227240__cf-1/reminder_term_setup.png new file mode 100644 index 000000000..2a00f31f3 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227240__cf-1/reminder_term_setup.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227240__cf-1/sales_invoice.png b/dataset/problemstatement/microsoftInternal__NAV-227240__cf-1/sales_invoice.png new file mode 100644 index 000000000..83ae2c7a3 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227240__cf-1/sales_invoice.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227240__cf-1/suggest_reminder_lines.png b/dataset/problemstatement/microsoftInternal__NAV-227240__cf-1/suggest_reminder_lines.png new file mode 100644 index 000000000..f54870b39 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227240__cf-1/suggest_reminder_lines.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227240__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-227240__cf-2/README.md new file mode 100644 index 000000000..aea1af219 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-227240__cf-2/README.md @@ -0,0 +1,17 @@ +# Title: The due date is not updated if the reminder has already been issued + +## Description: + +The Reminder/Fin. Charge Entry due date should not be updated after the reminder has been issued. Once a reminder is issued, its due date becomes immutable regardless of changes to the Customer Ledger Entry due date. + +## Repro Steps: + +1. Create a customer with reminder terms configured. +2. Create and post a sales invoice. +3. Create and issue a reminder for the customer. +4. Change the Customer Ledger Entry due date (forward or backward) → the Reminder/Fin. Charge Entry due date should **NOT** update because the reminder has already been issued. + +## Expected Behavior: + +- If the reminder has been issued, no due date updates should propagate to the Reminder/Fin. Charge Entry, regardless of direction. +- Only non-issued reminders should have their due dates synchronized with Customer Ledger Entry changes. diff --git a/dataset/problemstatement/microsoftInternal__NAV-227240__cf-2/customer_card.png b/dataset/problemstatement/microsoftInternal__NAV-227240__cf-2/customer_card.png new file mode 100644 index 000000000..f90097184 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227240__cf-2/customer_card.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227240__cf-2/customer_ledger_entries.png b/dataset/problemstatement/microsoftInternal__NAV-227240__cf-2/customer_ledger_entries.png new file mode 100644 index 000000000..161bec106 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227240__cf-2/customer_ledger_entries.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227240__cf-2/customer_ledger_entries_change.png b/dataset/problemstatement/microsoftInternal__NAV-227240__cf-2/customer_ledger_entries_change.png new file mode 100644 index 000000000..fb3ea34ac Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227240__cf-2/customer_ledger_entries_change.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227240__cf-2/customer_ledger_entries_early.png b/dataset/problemstatement/microsoftInternal__NAV-227240__cf-2/customer_ledger_entries_early.png new file mode 100644 index 000000000..8dddf3e08 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227240__cf-2/customer_ledger_entries_early.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227240__cf-2/posted_sales_invoice.png b/dataset/problemstatement/microsoftInternal__NAV-227240__cf-2/posted_sales_invoice.png new file mode 100644 index 000000000..42630fe77 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227240__cf-2/posted_sales_invoice.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227240__cf-2/reminder.png b/dataset/problemstatement/microsoftInternal__NAV-227240__cf-2/reminder.png new file mode 100644 index 000000000..5acd1bdb6 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227240__cf-2/reminder.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227240__cf-2/reminder_fin_charge_entries.png b/dataset/problemstatement/microsoftInternal__NAV-227240__cf-2/reminder_fin_charge_entries.png new file mode 100644 index 000000000..10afbfc0e Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227240__cf-2/reminder_fin_charge_entries.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227240__cf-2/reminder_fin_charge_entries_changed.png b/dataset/problemstatement/microsoftInternal__NAV-227240__cf-2/reminder_fin_charge_entries_changed.png new file mode 100644 index 000000000..52b5c7c17 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227240__cf-2/reminder_fin_charge_entries_changed.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227240__cf-2/reminder_fin_charge_entries_early.png b/dataset/problemstatement/microsoftInternal__NAV-227240__cf-2/reminder_fin_charge_entries_early.png new file mode 100644 index 000000000..24cbe06b1 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227240__cf-2/reminder_fin_charge_entries_early.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227240__cf-2/reminder_term_setup.png b/dataset/problemstatement/microsoftInternal__NAV-227240__cf-2/reminder_term_setup.png new file mode 100644 index 000000000..2a00f31f3 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227240__cf-2/reminder_term_setup.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227240__cf-2/sales_invoice.png b/dataset/problemstatement/microsoftInternal__NAV-227240__cf-2/sales_invoice.png new file mode 100644 index 000000000..83ae2c7a3 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227240__cf-2/sales_invoice.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227240__cf-2/suggest_reminder_lines.png b/dataset/problemstatement/microsoftInternal__NAV-227240__cf-2/suggest_reminder_lines.png new file mode 100644 index 000000000..f54870b39 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227240__cf-2/suggest_reminder_lines.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227358__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-227358__cf-1/README.md new file mode 100644 index 000000000..1dbbf5514 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-227358__cf-1/README.md @@ -0,0 +1,46 @@ +# Title: "The changes to the Gen. Journal Line record cannot be saved because some information is not up-to-date" error when posting Recurring General Journal and the Unlink Incoming Document on Posting option is activated. +## Repro Steps: +Take any BC 25.5 / BC 26.x environment. +1. Go to General Journal Template, create a new one + Name = Test + Type = General + Recurring = True + Bal. Account Type = G/L Account + Force Doc. Bal./Copy VAT setup to Jnl. Line/Unlink Incoming Document on Posting = True. + +2. Go to Recurring General Journal and Create a batch for the journal template. + Name = New Test + Bal. Account Type = G/L Account + Copy VAT setup to Jnl. Line= True. + +3. From the general journal batches page, click "General Journal" from the top navigation and select "Recurring General Journal" to open the recurring general journal page. + +4. Enter the 3 lines as seen in the screenshot below: +![Recurring General Journals](./recurring_general_journals.png) + +5. Make sure your posting date is lower or same as your date in the settings page. + +6. Post the lines. + +**Expected Outcome:** +The recurring general journal lines should be posted, and unlinking should only occur when Incoming Document Entry No. is not zero. + +**Actual Outcome:** +The recurring general journal lines is not posted, and an error is generated. +![Error Message](./error_message.png) + +**Troubleshooting Actions Taken:** +Tested in BC 26.4 and 25.5 + +Error in function UnlinkIncDocFromGenJnlLine +A Modify after a Commit, throws an error, as the Record is not pulled from the Database after a Commit. When using the new function in Templates to Unlink Incoming Documents on Posting (Field 34, Table 80). + +Codeunit 13 +Line 1525 Functioncall UnlinkIncDocFromGenJnlLine + +Function UnlinkIncDocFromGenJnlLine Line 1019 GenJnlLine.Modify(); + +**Did the partner reproduce the issue in a Sandbox without extensions?** Yes + +## Description: +"The changes to the Gen. Journal Line record cannot be saved because some information is not up-to-date" error when posting Recurring General Journal and the Unlink Incoming Document on Posting option is activated. diff --git a/dataset/problemstatement/microsoftInternal__NAV-227358__cf-1/error_message.png b/dataset/problemstatement/microsoftInternal__NAV-227358__cf-1/error_message.png new file mode 100644 index 000000000..d710cf71c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227358__cf-1/error_message.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227358__cf-1/recurring_general_journals.png b/dataset/problemstatement/microsoftInternal__NAV-227358__cf-1/recurring_general_journals.png new file mode 100644 index 000000000..969498ee0 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227358__cf-1/recurring_general_journals.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227358__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-227358__cf-2/README.md new file mode 100644 index 000000000..fe87f8bc4 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-227358__cf-2/README.md @@ -0,0 +1,46 @@ +# Title: "The changes to the Gen. Journal Line record cannot be saved because some information is not up-to-date" error when posting Recurring General Journal and the Unlink Incoming Document on Posting option is activated. +## Repro Steps: +Take any BC 25.5 / BC 26.x environment. +1. Go to General Journal Template, create a new one + Name = Test + Type = General + Recurring = True + Bal. Account Type = G/L Account + Force Doc. Bal./Copy VAT setup to Jnl. Line/Unlink Incoming Document on Posting = True. + +2. Go to Recurring General Journal and Create a batch for the journal template. + Name = New Test + Bal. Account Type = G/L Account + Copy VAT setup to Jnl. Line= True. + +3. From the general journal batches page, click "General Journal" from the top navigation and select "Recurring General Journal" to open the recurring general journal page. + +4. Enter the 3 lines as seen in the screenshot below: +![Recurring General Journals](./recurring_general_journals.png) + +5. Make sure your posting date is lower or same as your date in the settings page. + +6. Post the lines. + +**Expected Outcome:** +The recurring general journal lines should be posted, and unlinking should only occur for lines with positive Amount. + +**Actual Outcome:** +The recurring general journal lines is not posted, and an error is generated. +![Error Message](./error_message.png) + +**Troubleshooting Actions Taken:** +Tested in BC 26.4 and 25.5 + +Error in function UnlinkIncDocFromGenJnlLine +A Modify after a Commit, throws an error, as the Record is not pulled from the Database after a Commit. When using the new function in Templates to Unlink Incoming Documents on Posting (Field 34, Table 80). + +Codeunit 13 +Line 1525 Functioncall UnlinkIncDocFromGenJnlLine + +Function UnlinkIncDocFromGenJnlLine Line 1019 GenJnlLine.Modify(); + +**Did the partner reproduce the issue in a Sandbox without extensions?** Yes + +## Description: +"The changes to the Gen. Journal Line record cannot be saved because some information is not up-to-date" error when posting Recurring General Journal and the Unlink Incoming Document on Posting option is activated. diff --git a/dataset/problemstatement/microsoftInternal__NAV-227358__cf-2/error_message.png b/dataset/problemstatement/microsoftInternal__NAV-227358__cf-2/error_message.png new file mode 100644 index 000000000..d710cf71c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227358__cf-2/error_message.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227358__cf-2/recurring_general_journals.png b/dataset/problemstatement/microsoftInternal__NAV-227358__cf-2/recurring_general_journals.png new file mode 100644 index 000000000..969498ee0 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227358__cf-2/recurring_general_journals.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227358__cf-3/README.md b/dataset/problemstatement/microsoftInternal__NAV-227358__cf-3/README.md new file mode 100644 index 000000000..0253b7ee3 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-227358__cf-3/README.md @@ -0,0 +1,46 @@ +# Title: "The changes to the Gen. Journal Line record cannot be saved because some information is not up-to-date" error when posting Recurring General Journal and the Unlink Incoming Document on Posting option is activated. +## Repro Steps: +Take any BC 25.5 / BC 26.x environment. +1. Go to General Journal Template, create a new one + Name = Test + Type = General + Recurring = True + Bal. Account Type = G/L Account + Force Doc. Bal./Copy VAT setup to Jnl. Line/Unlink Incoming Document on Posting = True. + +2. Go to Recurring General Journal and Create a batch for the journal template. + Name = New Test + Bal. Account Type = G/L Account + Copy VAT setup to Jnl. Line= True. + +3. From the general journal batches page, click "General Journal" from the top navigation and select "Recurring General Journal" to open the recurring general journal page. + +4. Enter the 3 lines as seen in the screenshot below: +![Recurring General Journals](./recurring_general_journals.png) + +5. Make sure your posting date is lower or same as your date in the settings page. + +6. Post the lines. + +**Expected Outcome:** +The recurring general journal lines should be posted, and unlinking should not be executed during posting. + +**Actual Outcome:** +The recurring general journal lines is not posted, and an error is generated. +![Error Message](./error_message.png) + +**Troubleshooting Actions Taken:** +Tested in BC 26.4 and 25.5 + +Error in function UnlinkIncDocFromGenJnlLine +A Modify after a Commit, throws an error, as the Record is not pulled from the Database after a Commit. When using the new function in Templates to Unlink Incoming Documents on Posting (Field 34, Table 80). + +Codeunit 13 +Line 1525 Functioncall UnlinkIncDocFromGenJnlLine + +Function UnlinkIncDocFromGenJnlLine Line 1019 GenJnlLine.Modify(); + +**Did the partner reproduce the issue in a Sandbox without extensions?** Yes + +## Description: +"The changes to the Gen. Journal Line record cannot be saved because some information is not up-to-date" error when posting Recurring General Journal and the Unlink Incoming Document on Posting option is activated. diff --git a/dataset/problemstatement/microsoftInternal__NAV-227358__cf-3/error_message.png b/dataset/problemstatement/microsoftInternal__NAV-227358__cf-3/error_message.png new file mode 100644 index 000000000..d710cf71c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227358__cf-3/error_message.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227358__cf-3/recurring_general_journals.png b/dataset/problemstatement/microsoftInternal__NAV-227358__cf-3/recurring_general_journals.png new file mode 100644 index 000000000..969498ee0 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227358__cf-3/recurring_general_journals.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227358__cf-4/README.md b/dataset/problemstatement/microsoftInternal__NAV-227358__cf-4/README.md new file mode 100644 index 000000000..db4945c05 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-227358__cf-4/README.md @@ -0,0 +1,46 @@ +# Title: "The changes to the Gen. Journal Line record cannot be saved because some information is not up-to-date" error when posting Recurring General Journal and the Unlink Incoming Document on Posting option is activated. +## Repro Steps: +Take any BC 25.5 / BC 26.x environment. +1. Go to General Journal Template, create a new one + Name = Test + Type = General + Recurring = True + Bal. Account Type = G/L Account + Force Doc. Bal./Copy VAT setup to Jnl. Line/Unlink Incoming Document on Posting = True. + +2. Go to Recurring General Journal and Create a batch for the journal template. + Name = New Test + Bal. Account Type = G/L Account + Copy VAT setup to Jnl. Line= True. + +3. From the general journal batches page, click "General Journal" from the top navigation and select "Recurring General Journal" to open the recurring general journal page. + +4. Enter the 3 lines as seen in the screenshot below: +![Recurring General Journals](./recurring_general_journals.png) + +5. Make sure your posting date is lower or same as your date in the settings page. + +6. Post the lines. + +**Expected Outcome:** +The recurring general journal lines should be posted, and unlinking should only occur for General journal templates. + +**Actual Outcome:** +The recurring general journal lines is not posted, and an error is generated. +![Error Message](./error_message.png) + +**Troubleshooting Actions Taken:** +Tested in BC 26.4 and 25.5 + +Error in function UnlinkIncDocFromGenJnlLine +A Modify after a Commit, throws an error, as the Record is not pulled from the Database after a Commit. When using the new function in Templates to Unlink Incoming Documents on Posting (Field 34, Table 80). + +Codeunit 13 +Line 1525 Functioncall UnlinkIncDocFromGenJnlLine + +Function UnlinkIncDocFromGenJnlLine Line 1019 GenJnlLine.Modify(); + +**Did the partner reproduce the issue in a Sandbox without extensions?** Yes + +## Description: +"The changes to the Gen. Journal Line record cannot be saved because some information is not up-to-date" error when posting Recurring General Journal and the Unlink Incoming Document on Posting option is activated. diff --git a/dataset/problemstatement/microsoftInternal__NAV-227358__cf-4/error_message.png b/dataset/problemstatement/microsoftInternal__NAV-227358__cf-4/error_message.png new file mode 100644 index 000000000..d710cf71c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227358__cf-4/error_message.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-227358__cf-4/recurring_general_journals.png b/dataset/problemstatement/microsoftInternal__NAV-227358__cf-4/recurring_general_journals.png new file mode 100644 index 000000000..969498ee0 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-227358__cf-4/recurring_general_journals.png differ diff --git a/dataset/problemstatement/microsoft__BCApps-4699__cf-1/README.md b/dataset/problemstatement/microsoft__BCApps-4699__cf-1/README.md new file mode 100644 index 000000000..0d92df2fc --- /dev/null +++ b/dataset/problemstatement/microsoft__BCApps-4699__cf-1/README.md @@ -0,0 +1,57 @@ +# Title: Shopify - import from Shopify and create Item logic ignores Shopify Shop currency +## Repro Steps: +Shopify store with currency DKK (andreipa-catalogs) +create product with price 5000 (or any other item) + +In BC +Currency Code = DKK. +Sync Item = From Shopify +Auto Create Unknown Items = Yes +Item Template Code = ITEM (something) + +Run Sync ITems. Explore created items. +Notice that Price in the item card is 5000, but only Unit Price should be converted from DKK to USD with exchange rate. + +![Shopify Added Product](./shopify_added_product.png) + +![Shopify Shop Card](./shopify_shop_card.png) + +![Shopify Products](./shopify_products.png) +(this is correct as this is price we imported) +but in created item it is also 5000 +![Item Card](./item_card.png) + +Also when export items, the price is not recalculated. +I see same behavior in 26.4 so it is not recent regression. But I'm pretty sure it worked differently in the past: +Synchronize items and inventory - Business Central | Microsoft Learn +[Sync prices with Shopify](https://learn.microsoft.com/en-us/dynamics365/business-central/shopify/synchronize-items#sync-prices-with-shopify) + +![Shopify Doc - Sync Prices with Shopify](./doc_sync_prices_with_shopify.png) + +## Description: + + +## Hints + +I mean this part: +src/Apps/W1/Shopify/App/src/Products/Codeunits/ShpfyCreateItem.Codeunit.al + +if ShopifyVariant."Unit Cost" <> 0 then + Item.Validate("Unit Cost", ShopifyVariant."Unit Cost"); + +if ShopifyVariant.Price <> 0 then + Item.Validate("Unit Price", ShopifyVariant.Price); + +We need to wrap it with currency exchange + +should be "1 liner" +App/Layers/W1/BaseApp/Finance/Currency/CurrencyExchangeRate.Table.al + procedure ExchangeAmtFCYToLCY(Date: Date; CurrencyCode: Code[10]; Amount: Decimal; Factor: Decimal): Decimal + +I would check usages in BaseApp like this: +BankAccCurrentBalanceLCY := + Round( + CurrExchRate.ExchangeAmtFCYToLCY( + WorkDate(), Currency.Code, "Balance at Date", + CurrExchRate.ExchangeRate( + WorkDate(), Currency.Code))); diff --git a/dataset/problemstatement/microsoft__BCApps-4699__cf-1/doc_sync_prices_with_shopify.png b/dataset/problemstatement/microsoft__BCApps-4699__cf-1/doc_sync_prices_with_shopify.png new file mode 100644 index 000000000..54203aafa Binary files /dev/null and b/dataset/problemstatement/microsoft__BCApps-4699__cf-1/doc_sync_prices_with_shopify.png differ diff --git a/dataset/problemstatement/microsoft__BCApps-4699__cf-1/item_card.png b/dataset/problemstatement/microsoft__BCApps-4699__cf-1/item_card.png new file mode 100644 index 000000000..6623440d9 Binary files /dev/null and b/dataset/problemstatement/microsoft__BCApps-4699__cf-1/item_card.png differ diff --git a/dataset/problemstatement/microsoft__BCApps-4699__cf-1/shopify_added_product.png b/dataset/problemstatement/microsoft__BCApps-4699__cf-1/shopify_added_product.png new file mode 100644 index 000000000..0b3c74a60 Binary files /dev/null and b/dataset/problemstatement/microsoft__BCApps-4699__cf-1/shopify_added_product.png differ diff --git a/dataset/problemstatement/microsoft__BCApps-4699__cf-1/shopify_products.png b/dataset/problemstatement/microsoft__BCApps-4699__cf-1/shopify_products.png new file mode 100644 index 000000000..b9ac26abf Binary files /dev/null and b/dataset/problemstatement/microsoft__BCApps-4699__cf-1/shopify_products.png differ diff --git a/dataset/problemstatement/microsoft__BCApps-4699__cf-1/shopify_shop_card.png b/dataset/problemstatement/microsoft__BCApps-4699__cf-1/shopify_shop_card.png new file mode 100644 index 000000000..5da7c5794 Binary files /dev/null and b/dataset/problemstatement/microsoft__BCApps-4699__cf-1/shopify_shop_card.png differ diff --git a/dataset/problemstatement/microsoft__BCApps-4699__cf-2/README.md b/dataset/problemstatement/microsoft__BCApps-4699__cf-2/README.md new file mode 100644 index 000000000..b9142da9e --- /dev/null +++ b/dataset/problemstatement/microsoft__BCApps-4699__cf-2/README.md @@ -0,0 +1,57 @@ +# Title: Shopify - import from Shopify and create Item logic ignores Shopify Shop currency +## Repro Steps: +Shopify store with currency DKK (andreipa-catalogs) +create product with price 5000 (or any other item) + +In BC +Currency Code = DKK, and conversion should only occur if a valid exchange rate exists. +Sync Item = From Shopify +Auto Create Unknown Items = Yes +Item Template Code = ITEM (something) + +Run Sync ITems. Explore created items. +Notice that Price in the item card is 5000, but it should be 5000 converted from DKK to USD with exchange rate. + +![Shopify Added Product](./shopify_added_product.png) + +![Shopify Shop Card](./shopify_shop_card.png) + +![Shopify Products](./shopify_products.png) +(this is correct as this is price we imported) +but in created item it is also 5000 +![Item Card](./item_card.png) + +Also when export items, the price is not recalculated. +I see same behavior in 26.4 so it is not recent regression. But I'm pretty sure it worked differently in the past: +Synchronize items and inventory - Business Central | Microsoft Learn +[Sync prices with Shopify](https://learn.microsoft.com/en-us/dynamics365/business-central/shopify/synchronize-items#sync-prices-with-shopify) + +![Shopify Doc - Sync Prices with Shopify](./doc_sync_prices_with_shopify.png) + +## Description: + + +## Hints + +I mean this part: +src/Apps/W1/Shopify/App/src/Products/Codeunits/ShpfyCreateItem.Codeunit.al + +if ShopifyVariant."Unit Cost" <> 0 then + Item.Validate("Unit Cost", ShopifyVariant."Unit Cost"); + +if ShopifyVariant.Price <> 0 then + Item.Validate("Unit Price", ShopifyVariant.Price); + +We need to wrap it with currency exchange + +should be "1 liner" +App/Layers/W1/BaseApp/Finance/Currency/CurrencyExchangeRate.Table.al + procedure ExchangeAmtFCYToLCY(Date: Date; CurrencyCode: Code[10]; Amount: Decimal; Factor: Decimal): Decimal + +I would check usages in BaseApp like this: +BankAccCurrentBalanceLCY := + Round( + CurrExchRate.ExchangeAmtFCYToLCY( + WorkDate(), Currency.Code, "Balance at Date", + CurrExchRate.ExchangeRate( + WorkDate(), Currency.Code))); diff --git a/dataset/problemstatement/microsoft__BCApps-4699__cf-2/doc_sync_prices_with_shopify.png b/dataset/problemstatement/microsoft__BCApps-4699__cf-2/doc_sync_prices_with_shopify.png new file mode 100644 index 000000000..54203aafa Binary files /dev/null and b/dataset/problemstatement/microsoft__BCApps-4699__cf-2/doc_sync_prices_with_shopify.png differ diff --git a/dataset/problemstatement/microsoft__BCApps-4699__cf-2/item_card.png b/dataset/problemstatement/microsoft__BCApps-4699__cf-2/item_card.png new file mode 100644 index 000000000..6623440d9 Binary files /dev/null and b/dataset/problemstatement/microsoft__BCApps-4699__cf-2/item_card.png differ diff --git a/dataset/problemstatement/microsoft__BCApps-4699__cf-2/shopify_added_product.png b/dataset/problemstatement/microsoft__BCApps-4699__cf-2/shopify_added_product.png new file mode 100644 index 000000000..0b3c74a60 Binary files /dev/null and b/dataset/problemstatement/microsoft__BCApps-4699__cf-2/shopify_added_product.png differ diff --git a/dataset/problemstatement/microsoft__BCApps-4699__cf-2/shopify_products.png b/dataset/problemstatement/microsoft__BCApps-4699__cf-2/shopify_products.png new file mode 100644 index 000000000..b9ac26abf Binary files /dev/null and b/dataset/problemstatement/microsoft__BCApps-4699__cf-2/shopify_products.png differ diff --git a/dataset/problemstatement/microsoft__BCApps-4699__cf-2/shopify_shop_card.png b/dataset/problemstatement/microsoft__BCApps-4699__cf-2/shopify_shop_card.png new file mode 100644 index 000000000..5da7c5794 Binary files /dev/null and b/dataset/problemstatement/microsoft__BCApps-4699__cf-2/shopify_shop_card.png differ diff --git a/dataset/problemstatement/microsoft__BCApps-4766__cf-1/README.md b/dataset/problemstatement/microsoft__BCApps-4766__cf-1/README.md new file mode 100644 index 000000000..adcda9393 --- /dev/null +++ b/dataset/problemstatement/microsoft__BCApps-4766__cf-1/README.md @@ -0,0 +1,23 @@ +# Inconsitent data when changing item in manually changing contract line [SubscriptionBilling] + +### Describe the issue + +When the item no. is changed in a manually created contract line, the connection to the contract persists in the subscription line. This leads to the subscription line being invoiced although it should not have a connection to a contract any longer and should therefore not be considered for invoicing. + +### Expected behavior + +Sales Invoice Lines should be created only for Contract Lines that exist in the Contract. + +### Steps to reproduce + +- Create three new items with Subscription Option=Sales with Subscription, no subscription package assigned +- Create a new Customer Subscription Contract and add lines for items No. 1 and No. 2 manually incl. further required data for billing. +- Change item No. 2 to another valid item No. 3. +- Create contract invoice +- Result: all three items are considered +- Check subscription for item No. 2 +- Result: In the subscription line, field "Subscription Contract No." still contains the former contract no. although the subscription line is no longer part of that contract. + +### Additional context + +In the former subscription line, the connection to the contract (line) should be revoked when the no. (item or GL account) is changed to another value. diff --git a/dataset/problemstatement/microsoft__BCApps-4822__cf-1/README.md b/dataset/problemstatement/microsoft__BCApps-4822__cf-1/README.md new file mode 100644 index 000000000..07d2e38c8 --- /dev/null +++ b/dataset/problemstatement/microsoft__BCApps-4822__cf-1/README.md @@ -0,0 +1,14 @@ +# Title: Shopify - Export customer as location - Sell-to and Bill-to are missing +## Repro Steps: +repro - not sure, please assign back if you cannot repro + +I exported two companies. +One is normal and another one has another (third) defined as bill-to, and Bill-to should always be copied even if empty. + +![Add Customer as Shopify Location](./add_cust_as_shopify_location.png) + +![Customer Card](./customer_card.png) + +Shopify Shop +![B2B Company Sync](./b2b_company_sync.png) +## Description: diff --git a/dataset/problemstatement/microsoft__BCApps-4822__cf-1/add_cust_as_shopify_location.png b/dataset/problemstatement/microsoft__BCApps-4822__cf-1/add_cust_as_shopify_location.png new file mode 100644 index 000000000..bd9a95b97 Binary files /dev/null and b/dataset/problemstatement/microsoft__BCApps-4822__cf-1/add_cust_as_shopify_location.png differ diff --git a/dataset/problemstatement/microsoft__BCApps-4822__cf-1/b2b_company_sync.png b/dataset/problemstatement/microsoft__BCApps-4822__cf-1/b2b_company_sync.png new file mode 100644 index 000000000..90763a216 Binary files /dev/null and b/dataset/problemstatement/microsoft__BCApps-4822__cf-1/b2b_company_sync.png differ diff --git a/dataset/problemstatement/microsoft__BCApps-4822__cf-1/customer_card.png b/dataset/problemstatement/microsoft__BCApps-4822__cf-1/customer_card.png new file mode 100644 index 000000000..9b07d79a1 Binary files /dev/null and b/dataset/problemstatement/microsoft__BCApps-4822__cf-1/customer_card.png differ diff --git a/dataset/problemstatement/microsoft__BCApps-4822__cf-2/README.md b/dataset/problemstatement/microsoft__BCApps-4822__cf-2/README.md new file mode 100644 index 000000000..d2e0c0e0f --- /dev/null +++ b/dataset/problemstatement/microsoft__BCApps-4822__cf-2/README.md @@ -0,0 +1,14 @@ +# Title: Shopify - Export customer as location - Sell-to and Bill-to are missing +## Repro Steps: +repro - not sure, please assign back if you cannot repro + +I exported two companies. +One is normal and another one has another (third) defined as bill-to, and Sell-to should only be set when customer No. is not empty. + +![Add Customer as Shopify Location](./add_cust_as_shopify_location.png) + +![Customer Card](./customer_card.png) + +Shopify Shop +![B2B Company Sync](./b2b_company_sync.png) +## Description: diff --git a/dataset/problemstatement/microsoft__BCApps-4822__cf-2/add_cust_as_shopify_location.png b/dataset/problemstatement/microsoft__BCApps-4822__cf-2/add_cust_as_shopify_location.png new file mode 100644 index 000000000..bd9a95b97 Binary files /dev/null and b/dataset/problemstatement/microsoft__BCApps-4822__cf-2/add_cust_as_shopify_location.png differ diff --git a/dataset/problemstatement/microsoft__BCApps-4822__cf-2/b2b_company_sync.png b/dataset/problemstatement/microsoft__BCApps-4822__cf-2/b2b_company_sync.png new file mode 100644 index 000000000..90763a216 Binary files /dev/null and b/dataset/problemstatement/microsoft__BCApps-4822__cf-2/b2b_company_sync.png differ diff --git a/dataset/problemstatement/microsoft__BCApps-4822__cf-2/customer_card.png b/dataset/problemstatement/microsoft__BCApps-4822__cf-2/customer_card.png new file mode 100644 index 000000000..9b07d79a1 Binary files /dev/null and b/dataset/problemstatement/microsoft__BCApps-4822__cf-2/customer_card.png differ diff --git a/dataset/problemstatement/microsoft__BCApps-4822__cf-3/README.md b/dataset/problemstatement/microsoft__BCApps-4822__cf-3/README.md new file mode 100644 index 000000000..aed84be21 --- /dev/null +++ b/dataset/problemstatement/microsoft__BCApps-4822__cf-3/README.md @@ -0,0 +1,14 @@ +# Title: Shopify - Export customer as location - Sell-to and Bill-to are missing +## Repro Steps: +repro - not sure, please assign back if you cannot repro + +I exported two companies. +One is normal and another one has another (third) defined as bill-to, and Customer Id should not be set for temporary customers. + +![Add Customer as Shopify Location](./add_cust_as_shopify_location.png) + +![Customer Card](./customer_card.png) + +Shopify Shop +![B2B Company Sync](./b2b_company_sync.png) +## Description: diff --git a/dataset/problemstatement/microsoft__BCApps-4822__cf-3/add_cust_as_shopify_location.png b/dataset/problemstatement/microsoft__BCApps-4822__cf-3/add_cust_as_shopify_location.png new file mode 100644 index 000000000..bd9a95b97 Binary files /dev/null and b/dataset/problemstatement/microsoft__BCApps-4822__cf-3/add_cust_as_shopify_location.png differ diff --git a/dataset/problemstatement/microsoft__BCApps-4822__cf-3/b2b_company_sync.png b/dataset/problemstatement/microsoft__BCApps-4822__cf-3/b2b_company_sync.png new file mode 100644 index 000000000..90763a216 Binary files /dev/null and b/dataset/problemstatement/microsoft__BCApps-4822__cf-3/b2b_company_sync.png differ diff --git a/dataset/problemstatement/microsoft__BCApps-4822__cf-3/customer_card.png b/dataset/problemstatement/microsoft__BCApps-4822__cf-3/customer_card.png new file mode 100644 index 000000000..9b07d79a1 Binary files /dev/null and b/dataset/problemstatement/microsoft__BCApps-4822__cf-3/customer_card.png differ diff --git a/dataset/problemstatement/microsoft__BCApps-5633__cf-1/README.md b/dataset/problemstatement/microsoft__BCApps-5633__cf-1/README.md new file mode 100644 index 000000000..5ca950c1f --- /dev/null +++ b/dataset/problemstatement/microsoft__BCApps-5633__cf-1/README.md @@ -0,0 +1,55 @@ +# Shopify - error handling of fulfilment of orders that are associated with 3rd party services + +you need to import orders + +![Shopify Orders](./shopify_orders.png) + +1733 +1732 +1731 +(with tag 3rd) + +Connect BC to Shopify. Logging = full. +Use default customer. +auto create items = true, item template = something. + +Reset order sycn. date = 11/20/2025 + +Navigate to orders, sync orders. filter by tag *3rd* + +Create orders in Business Central (customer is default, item to be created autoamtically) + +![Shopify Orders BC](./shopify_orders_bc.png) + +naviagate to sales orders, find these orders and use Batch Post to post shipment only + +![Sales Orders](./sales_orders.png) + +![Batch Post Sales Orders](./batch_post_sales_orders.png) + +Back t Shopify orders, run Sync Shipment to Shopify + +You get notification: + +![Shopify Orders Notification](./shopify_orders_notification.png) + +![Shopify Skipped Records](./shopify_skipped_records.png) + +IF you check Shop log, +There were attempts to create fulfilments: + +![Shopify Log Entries](./shopify_log_entries.png) + +but they failed: + +Request: +{"query": "mutation {fulfillmentCreate( fulfillment: {notifyCustomer: true, lineItemsByFulfillmentOrder: [{fulfillmentOrderId: "gid://shopify/FulfillmentOrder/8077883081002 ",fulfillmentOrderLineItems: [{id: "gid://shopify/FulfillmentOrderLineItem/18126922350890 ",quantity: 10}]}]}){fulfillment { legacyResourceId name createdAt updatedAt deliveredAt displayStatus estimatedDeliveryAt status totalQuantity location { legacyResourceId } trackingInfo { number url company } service { serviceName type } fulfillmentLineItems(first: 10) { pageInfo { endCursor hasNextPage } nodes { id quantity originalTotalSet { presentmentMoney { amount } shopMoney { amount }} lineItem { id isGiftCard }}}}, userErrors {field,message}}}"} + +Response: +{"data":{"fulfillmentCreate":{"fulfillment":null,"userErrors":[{"field":["fulfillment"],"message":"The api_client does not have access to the fulfillment order."}]}},"extensions":{"cost":{"requestedQueryCost":23,"actualQueryCost":10,"throttleStatus":{"maximumAvailable":2000.0,"currentlyAvailable":1990,"restoreRate":100.0}}}} + +Is it expected behavior that we both fail in Shopify Logs and also in Skipped entries? + +Can we skip exporting this Shipment if it is associated with fulfilment from 3rd party, except when it is the default fulfillment service? + +![Shopify Shop Locations](./shopify_shop_locations.png) diff --git a/dataset/problemstatement/microsoft__BCApps-5633__cf-1/batch_post_sales_orders.png b/dataset/problemstatement/microsoft__BCApps-5633__cf-1/batch_post_sales_orders.png new file mode 100644 index 000000000..1b0dc8717 Binary files /dev/null and b/dataset/problemstatement/microsoft__BCApps-5633__cf-1/batch_post_sales_orders.png differ diff --git a/dataset/problemstatement/microsoft__BCApps-5633__cf-1/sales_orders.png b/dataset/problemstatement/microsoft__BCApps-5633__cf-1/sales_orders.png new file mode 100644 index 000000000..1c9353cd7 Binary files /dev/null and b/dataset/problemstatement/microsoft__BCApps-5633__cf-1/sales_orders.png differ diff --git a/dataset/problemstatement/microsoft__BCApps-5633__cf-1/shopify_log_entries.png b/dataset/problemstatement/microsoft__BCApps-5633__cf-1/shopify_log_entries.png new file mode 100644 index 000000000..af31f02c1 Binary files /dev/null and b/dataset/problemstatement/microsoft__BCApps-5633__cf-1/shopify_log_entries.png differ diff --git a/dataset/problemstatement/microsoft__BCApps-5633__cf-1/shopify_orders.png b/dataset/problemstatement/microsoft__BCApps-5633__cf-1/shopify_orders.png new file mode 100644 index 000000000..83a076969 Binary files /dev/null and b/dataset/problemstatement/microsoft__BCApps-5633__cf-1/shopify_orders.png differ diff --git a/dataset/problemstatement/microsoft__BCApps-5633__cf-1/shopify_orders_bc.png b/dataset/problemstatement/microsoft__BCApps-5633__cf-1/shopify_orders_bc.png new file mode 100644 index 000000000..df3b98ef7 Binary files /dev/null and b/dataset/problemstatement/microsoft__BCApps-5633__cf-1/shopify_orders_bc.png differ diff --git a/dataset/problemstatement/microsoft__BCApps-5633__cf-1/shopify_orders_notification.png b/dataset/problemstatement/microsoft__BCApps-5633__cf-1/shopify_orders_notification.png new file mode 100644 index 000000000..002e508b2 Binary files /dev/null and b/dataset/problemstatement/microsoft__BCApps-5633__cf-1/shopify_orders_notification.png differ diff --git a/dataset/problemstatement/microsoft__BCApps-5633__cf-1/shopify_shop_locations.png b/dataset/problemstatement/microsoft__BCApps-5633__cf-1/shopify_shop_locations.png new file mode 100644 index 000000000..be08cac38 Binary files /dev/null and b/dataset/problemstatement/microsoft__BCApps-5633__cf-1/shopify_shop_locations.png differ diff --git a/dataset/problemstatement/microsoft__BCApps-5633__cf-1/shopify_skipped_records.png b/dataset/problemstatement/microsoft__BCApps-5633__cf-1/shopify_skipped_records.png new file mode 100644 index 000000000..7d51ad9bc Binary files /dev/null and b/dataset/problemstatement/microsoft__BCApps-5633__cf-1/shopify_skipped_records.png differ diff --git a/docs/_data/counterfactual-evaluation.json b/docs/_data/counterfactual-evaluation.json new file mode 100644 index 000000000..f744d8bdb --- /dev/null +++ b/docs/_data/counterfactual-evaluation.json @@ -0,0 +1,4 @@ +{ + "runs": [], + "aggregate": [] +} diff --git a/notebooks/dataset.ipynb b/notebooks/dataset.ipynb index 3f2c3382b..a755fa2f9 100644 --- a/notebooks/dataset.ipynb +++ b/notebooks/dataset.ipynb @@ -248,7 +248,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.13.7" + "version": "3.13.11" } }, "nbformat": 4, diff --git a/scripts/Setup-ContainerAndRepository.ps1 b/scripts/Setup-ContainerAndRepository.ps1 index 36e665ed3..b0ff11bd6 100644 --- a/scripts/Setup-ContainerAndRepository.ps1 +++ b/scripts/Setup-ContainerAndRepository.ps1 @@ -28,7 +28,14 @@ param( [string]$RepoPath ) -[DatasetEntry[]] $entries = Get-DatasetEntries -DatasetPath $DatasetPath -Version $Version -InstanceId $InstanceId +# For counterfactual entries (__cf-N suffix), resolve the base entry from bcbench.jsonl +[string]$LookupInstanceId = $InstanceId +if ($InstanceId -match '__cf-\d+$') { + $LookupInstanceId = $InstanceId -replace '__cf-\d+$', '' + Write-Log "Counterfactual entry detected. Using base instance ID: $LookupInstanceId" -Level Info +} + +[DatasetEntry[]] $entries = Get-DatasetEntries -DatasetPath $DatasetPath -Version $Version -InstanceId $LookupInstanceId if ($InstanceId) { $Version = $entries[0].environment_setup_version Write-Log "Found version $Version for InstanceId $InstanceId" -Level Info diff --git a/scripts/Verify-BuildAndTests.ps1 b/scripts/Verify-BuildAndTests.ps1 index 477da27cb..0f934af67 100644 --- a/scripts/Verify-BuildAndTests.ps1 +++ b/scripts/Verify-BuildAndTests.ps1 @@ -26,7 +26,14 @@ param( [SecureString]$Password ) -[DatasetEntry[]] $entries = Get-DatasetEntries -DatasetPath $DatasetPath -Version $Version -InstanceId $InstanceId +# For counterfactual entries (__cf-N suffix), resolve the base entry from bcbench.jsonl +[string]$LookupInstanceId = $InstanceId +if ($InstanceId -match '__cf-\d+$') { + $LookupInstanceId = $InstanceId -replace '__cf-\d+$', '' + Write-Log "Counterfactual entry detected. Using base instance ID: $LookupInstanceId" -Level Info +} + +[DatasetEntry[]] $entries = Get-DatasetEntries -DatasetPath $DatasetPath -Version $Version -InstanceId $LookupInstanceId if ($InstanceId) { $Version = $entries[0].environment_setup_version Write-Log "Found version $Version for InstanceId $InstanceId" -Level Info diff --git a/src/bcbench/commands/dataset.py b/src/bcbench/commands/dataset.py index 4ba0d9dda..4ca9651d7 100644 --- a/src/bcbench/commands/dataset.py +++ b/src/bcbench/commands/dataset.py @@ -9,6 +9,7 @@ from bcbench.cli_options import DatasetPath from bcbench.config import get_config from bcbench.dataset import DatasetEntry +from bcbench.dataset.counterfactual_loader import load_counterfactual_entries from bcbench.dataset.dataset_loader import load_dataset_entries from bcbench.dataset.reviewer import run_dataset_reviewer from bcbench.exceptions import ConfigurationError @@ -44,23 +45,18 @@ def list_entries( dataset_path: DatasetPath = _config.paths.dataset_path, github_output: Annotated[str | None, typer.Option(help="Write JSON output to GITHUB_OUTPUT with this key name")] = None, modified_only: Annotated[bool, typer.Option(help="Only list entries that have been modified in git diff")] = False, + base_ref: Annotated[str, typer.Option(help="Git ref to diff against when using --modified-only (e.g., HEAD~1, a commit SHA, or a branch name)")] = "origin/main", test_run: Annotated[bool, typer.Option(help="Indicate this is a test run (with 2 entries)")] = False, + include_counterfactual: Annotated[bool, typer.Option(help="Include counterfactual entries from counterfactual.jsonl")] = True, ): """List dataset entry IDs.""" if modified_only: import subprocess + diff_cmd = ["git", "diff", base_ref, "HEAD", "--unified=0", "--no-color", "--diff-filter=AM"] + result = subprocess.run( - [ - "git", - "diff", - "origin/main", - "--unified=0", - "--no-color", - "--diff-filter=AM", - "--", - str(dataset_path), - ], + [*diff_cmd, "--", str(dataset_path)], capture_output=True, text=True, encoding="utf-8", @@ -69,10 +65,29 @@ def list_entries( ) diff_output: str = result.stdout entry_ids: list[str] = _modified_instance_ids_from_diff(diff_output) + + if include_counterfactual: + cf_path = dataset_path.parent / "counterfactual.jsonl" + if cf_path.exists(): + cf_diff_result = subprocess.run( + [*diff_cmd, "--", str(cf_path)], + capture_output=True, + text=True, + encoding="utf-8", + check=True, + cwd=cf_path.parent, + ) + entry_ids.extend(_modified_instance_ids_from_diff(cf_diff_result.stdout)) else: dataset_entries: list[DatasetEntry] = load_dataset_entries(dataset_path, random=2 if test_run else None) entry_ids: list[str] = [e.instance_id for e in dataset_entries] + if include_counterfactual: + cf_path = dataset_path.parent / "counterfactual.jsonl" + if cf_path.exists(): + cf_pairs = load_counterfactual_entries(cf_path, dataset_path) + entry_ids.extend(cf_entry.instance_id for cf_entry, _ in cf_pairs) + print(f"Found {len(entry_ids)} entry(ies){' (modified only)' if modified_only else ''}:") for entry_id in entry_ids: print(f" - {entry_id}") @@ -152,6 +167,43 @@ def view_entry( console.print("[dim]No PASS_TO_PASS tests[/dim]") +@dataset_app.command("cf-extract") +def cf_extract( + entry_id: Annotated[str, typer.Argument(help="Base entry ID to extract workspace from")], + output_dir: Annotated[Path, typer.Option("--output-dir", "-o", help="Directory to create workspace in")] = Path("cf-workspace"), + repo_path: Annotated[Path | None, typer.Option("--repo-path", "-r", help="Repository path for full-fidelity extraction")] = None, + dataset_path: DatasetPath = _config.paths.dataset_path, +): + """Extract patch hunks into an editable workspace for counterfactual authoring.""" + from bcbench.dataset.cf_workspace import extract_workspace + + entries = load_dataset_entries(dataset_path, entry_id=entry_id) + entry = entries[0] + + workspace = extract_workspace(entry, output_dir, repo_path) + + typer.echo(f"Workspace created at: {workspace}") + typer.echo(" fix/after/ — edit these files to change the fix") + typer.echo(" test/after/ — edit these files to change the tests") + typer.echo(f"Run 'bcbench dataset cf-create {workspace}' when done editing.") + + +@dataset_app.command("cf-create") +def cf_create( + workspace_dir: Annotated[Path, typer.Argument(help="Path to the workspace directory")], + variant_description: Annotated[str, typer.Option("--variant-description", "-d", help="Description of the counterfactual variant")], + intervention_type: Annotated[str | None, typer.Option("--intervention-type", "-t", help="Type of intervention")] = None, +): + """Create a counterfactual entry from an edited workspace.""" + from bcbench.dataset.cf_workspace import create_cf_entry + + cf_entry = create_cf_entry(workspace_dir, variant_description, intervention_type) + + typer.echo(f"Created counterfactual entry: {cf_entry.instance_id}") + typer.echo(f"Problem statement: {cf_entry.problem_statement_override}") + typer.echo("Edit the problem statement README.md, then commit the changes.") + + def _modified_instance_ids_from_diff(diff_output: str) -> list[str]: instance_ids = [] diff --git a/src/bcbench/commands/evaluate.py b/src/bcbench/commands/evaluate.py index 6e41b2f92..0fe288f8d 100644 --- a/src/bcbench/commands/evaluate.py +++ b/src/bcbench/commands/evaluate.py @@ -1,4 +1,5 @@ import random +import re import shutil from collections.abc import Callable from pathlib import Path @@ -22,6 +23,7 @@ ) from bcbench.config import get_config from bcbench.dataset import DatasetEntry, load_dataset_entries +from bcbench.dataset.counterfactual_loader import load_counterfactual_entries from bcbench.evaluate import EvaluationPipeline, create_pipeline from bcbench.logger import get_logger from bcbench.results import BaseEvaluationResult @@ -30,6 +32,22 @@ logger = get_logger(__name__) _config = get_config() +_CF_PATTERN = re.compile(r"__cf-\d+$") + + +def _load_entry(entry_id: str, dataset_path: Path) -> DatasetEntry: + """Load a dataset entry, auto-detecting counterfactual entries by ID pattern.""" + if _CF_PATTERN.search(entry_id): + cf_path = _config.paths.counterfactual_dataset_path + pairs = load_counterfactual_entries(cf_path, dataset_path, entry_id=entry_id) + cf_entry, base_entry = pairs[0] + merged = cf_entry.to_dataset_entry(base_entry) + logger.info(f"Loaded counterfactual entry {cf_entry.instance_id} (base: {cf_entry.base_instance_id})") + return merged + entries = load_dataset_entries(dataset_path, entry_id=entry_id) + return entries[0] + + evaluate_app = typer.Typer(help="Evaluate agents on benchmark datasets") @@ -51,8 +69,7 @@ def evaluate_mini( To only run the agent to generate a patch without building/testing, use 'bcbench run mini' instead. """ - entries: list[DatasetEntry] = load_dataset_entries(dataset_path, entry_id=entry_id) - entry: DatasetEntry = entries[0] + entry: DatasetEntry = _load_entry(entry_id, dataset_path) logger.info(f"Loaded {entry_id} entry from dataset") run_dir: Path = output_dir / run_id @@ -109,8 +126,7 @@ def evaluate_copilot( To only run the agent to generate a patch without building/testing, use 'bcbench run copilot' instead. """ - entries: list[DatasetEntry] = load_dataset_entries(dataset_path, entry_id=entry_id) - entry: DatasetEntry = entries[0] + entry: DatasetEntry = _load_entry(entry_id, dataset_path) logger.info(f"Loaded {entry_id} entry from dataset") run_dir: Path = output_dir / run_id @@ -169,8 +185,7 @@ def evaluate_claude_code( To only run the agent to generate a patch without building/testing, use 'bcbench run claude' instead. """ - entries: list[DatasetEntry] = load_dataset_entries(dataset_path, entry_id=entry_id) - entry: DatasetEntry = entries[0] + entry: DatasetEntry = _load_entry(entry_id, dataset_path) logger.info(f"Loaded {entry_id} entry from dataset") run_dir: Path = output_dir / run_id @@ -221,8 +236,7 @@ def evaluate_mock( """ Evaluate mock agent on single dataset entry for testing purposes. """ - entries: list[DatasetEntry] = load_dataset_entries(dataset_path, entry_id=entry_id) - entry: DatasetEntry = entries[0] + entry: DatasetEntry = _load_entry(entry_id, dataset_path) logger.info(f"Loaded {entry_id} entry from dataset") run_dir: Path = output_dir / run_id diff --git a/src/bcbench/config.py b/src/bcbench/config.py index 06fdffd11..4300b5ee3 100644 --- a/src/bcbench/config.py +++ b/src/bcbench/config.py @@ -45,6 +45,8 @@ class PathConfig: copilot_dir: Path agent_share_dir: Path + counterfactual_dataset_path: Path + @classmethod def from_root(cls, root: Path) -> PathConfig: """Create path configuration from repository root.""" @@ -52,6 +54,7 @@ def from_root(cls, root: Path) -> PathConfig: bc_bench_root=root, dataset_dir=root / "dataset", dataset_path=root / "dataset" / "bcbench.jsonl", + counterfactual_dataset_path=root / "dataset" / "counterfactual.jsonl", problem_statement_dir=root / "dataset" / "problemstatement", testbed_path=root.parent / "NAV", ps_script_path=root / "scripts", @@ -102,7 +105,7 @@ def default(cls) -> FilePatternConfig: return cls( trajectory_pattern=".traj.json", patch_pattern=".patch", - instance_pattern=r"^[a-zA-Z0-9_-]+__[a-zA-Z0-9_-]+-[0-9]+$", + instance_pattern=r"^[a-zA-Z0-9_-]+__[a-zA-Z0-9_-]+-[0-9]+(__cf-[0-9]+)?$", result_pattern=".jsonl", instruction_source_naming="AGENTS.md", instructions_dirname="instructions", diff --git a/src/bcbench/dataset/__init__.py b/src/bcbench/dataset/__init__.py index 6af72372f..15a8427ed 100644 --- a/src/bcbench/dataset/__init__.py +++ b/src/bcbench/dataset/__init__.py @@ -1,12 +1,16 @@ """Dataset module for querying, validating and analyze dataset entries.""" +from bcbench.dataset.counterfactual_entry import CounterfactualEntry +from bcbench.dataset.counterfactual_loader import load_counterfactual_entries from bcbench.dataset.dataset_entry import DatasetEntry, TestEntry from bcbench.dataset.dataset_loader import load_dataset_entries from bcbench.dataset.reviewer import run_dataset_reviewer __all__ = [ + "CounterfactualEntry", "DatasetEntry", "TestEntry", + "load_counterfactual_entries", "load_dataset_entries", "run_dataset_reviewer", ] diff --git a/src/bcbench/dataset/cf_workspace.py b/src/bcbench/dataset/cf_workspace.py new file mode 100644 index 000000000..d1ed690a0 --- /dev/null +++ b/src/bcbench/dataset/cf_workspace.py @@ -0,0 +1,489 @@ +"""Counterfactual workspace extraction, patch regeneration, and entry creation.""" + +from __future__ import annotations + +import difflib +import json +import re +import shutil +from pathlib import Path +from typing import TYPE_CHECKING + +from unidiff import PatchSet + +from bcbench.collection.patch_utils import extract_file_paths_from_patch +from bcbench.config import get_config +from bcbench.dataset.counterfactual_entry import CounterfactualEntry +from bcbench.dataset.dataset_entry import TestEntry +from bcbench.logger import get_logger + +if TYPE_CHECKING: + from bcbench.dataset.dataset_entry import DatasetEntry + +logger = get_logger(__name__) +_config = get_config() + +WORKSPACE_METADATA_FILE = "workspace.json" + + +def extract_workspace(entry: DatasetEntry, output_dir: Path, repo_path: Path | None = None) -> Path: + """Extract patch hunks into an editable workspace directory. + + Creates a workspace with before/after .al files for both fix and test patches. + Users can then edit the 'after' files and regenerate patches. + + Args: + entry: The base dataset entry to extract from + output_dir: Directory to create the workspace in + repo_path: Optional repo path for full-fidelity extraction + + Returns: + Path to the created workspace directory + """ + output_dir.mkdir(parents=True, exist_ok=True) + + if repo_path is not None: + _extract_via_repo(entry, output_dir, repo_path) + else: + _extract_via_patch(entry.patch, output_dir, "fix") + _extract_via_patch(entry.test_patch, output_dir, "test") + + metadata = { + "entry_id": entry.instance_id, + "mode": "repo" if repo_path is not None else "patch-only", + "files": { + "fix": extract_file_paths_from_patch(entry.patch), + "test": extract_file_paths_from_patch(entry.test_patch), + }, + "codeunit_ids": _extract_codeunit_ids_from_patch(entry.test_patch), + } + metadata_path = output_dir / WORKSPACE_METADATA_FILE + metadata_path.write_text(json.dumps(metadata, indent=2), encoding="utf-8") + + logger.info(f"Workspace created at {output_dir}") + return output_dir + + +def _extract_via_repo(entry: DatasetEntry, output_dir: Path, repo_path: Path) -> None: + from bcbench.operations.git_operations import apply_patch, checkout_commit, clean_repo + + checkout_commit(repo_path, entry.base_commit) + + all_patches = [("fix", entry.patch), ("test", entry.test_patch)] + all_file_paths: dict[str, list[str]] = {} + + for category, patch_str in all_patches: + all_file_paths[category] = extract_file_paths_from_patch(patch_str) + + # Copy "before" files + for category, file_paths in all_file_paths.items(): + for file_path in file_paths: + src = repo_path / file_path + dest = output_dir / category / "before" / file_path + dest.parent.mkdir(parents=True, exist_ok=True) + if src.exists(): + dest.write_text(src.read_text(encoding="utf-8"), encoding="utf-8") + # New files won't exist in "before" — that's expected + + # Apply patches and copy "after" files + apply_patch(repo_path, entry.patch, "fix patch") + apply_patch(repo_path, entry.test_patch, "test patch") + + for category, file_paths in all_file_paths.items(): + for file_path in file_paths: + src = repo_path / file_path + dest = output_dir / category / "after" / file_path + dest.parent.mkdir(parents=True, exist_ok=True) + if src.exists(): + dest.write_text(src.read_text(encoding="utf-8"), encoding="utf-8") + + clean_repo(repo_path) + + +def _extract_via_patch(patch_str: str, output_dir: Path, category: str) -> None: + """Extract before/after files from a patch using line-preserving reconstruction.""" + padded_files = _reconstruct_padded_files(patch_str) + + for file_path, (before_lines, after_lines) in padded_files.items(): + before_dest = output_dir / category / "before" / file_path + after_dest = output_dir / category / "after" / file_path + + before_dest.parent.mkdir(parents=True, exist_ok=True) + after_dest.parent.mkdir(parents=True, exist_ok=True) + + before_dest.write_text("".join(before_lines), encoding="utf-8") + after_dest.write_text("".join(after_lines), encoding="utf-8") + + +def _reconstruct_padded_files(patch_str: str) -> dict[str, tuple[list[str], list[str]]]: + """Reconstruct padded before/after file content from a patch. + + Preserves original line numbers by padding with empty lines so that + difflib.unified_diff produces correct @@ headers when regenerating patches. + + Returns: + Dict mapping file paths to (before_lines, after_lines) tuples. + """ + patch_set = PatchSet(patch_str) + result: dict[str, tuple[list[str], list[str]]] = {} + + for patched_file in patch_set: + if not patched_file.path: + continue + + before_lines: list[str] = [] + after_lines: list[str] = [] + + for hunk in patched_file: + # Pad before_lines up to hunk start (1-indexed → 0-indexed) + source_start = hunk.source_start + while len(before_lines) < source_start - 1: + before_lines.append("\n") + after_lines.append("\n") + + for line in hunk: + if line.is_context: + before_lines.append(str(line.value)) + after_lines.append(str(line.value)) + elif line.source_line_no is not None: + # Removed line (only in before) + before_lines.append(str(line.value)) + elif line.target_line_no is not None: + # Added line (only in after) + after_lines.append(str(line.value)) + + result[patched_file.path] = (before_lines, after_lines) + + return result + + +def regenerate_patches(workspace_dir: Path) -> tuple[str, str]: + """Regenerate fix and test patches from workspace before/after files. + + Args: + workspace_dir: Path to the workspace directory + + Returns: + Tuple of (fix_patch, test_patch) strings in git-compatible format + """ + metadata = _load_workspace_metadata(workspace_dir) + + fix_patch = _regenerate_category_patch(workspace_dir, "fix", metadata["files"]["fix"]) + test_patch = _regenerate_category_patch(workspace_dir, "test", metadata["files"]["test"]) + + return fix_patch, test_patch + + +def _regenerate_category_patch(workspace_dir: Path, category: str, file_paths: list[str]) -> str: + """Regenerate a combined patch for all files in a category.""" + parts: list[str] = [] + + for file_path in file_paths: + before_path = workspace_dir / category / "before" / file_path + after_path = workspace_dir / category / "after" / file_path + + before_lines = before_path.read_text(encoding="utf-8").splitlines(keepends=True) if before_path.exists() else [] + after_lines = after_path.read_text(encoding="utf-8").splitlines(keepends=True) if after_path.exists() else [] + + diff = _generate_git_diff(before_lines, after_lines, file_path) + if diff: + parts.append(diff) + + return "".join(parts) + + +def _generate_git_diff(before_lines: list[str], after_lines: list[str], file_path: str) -> str: + """Generate a single file diff in git-compatible format.""" + diff_lines = list( + difflib.unified_diff( + before_lines, + after_lines, + fromfile=f"a/{file_path}", + tofile=f"b/{file_path}", + ) + ) + + if not diff_lines: + return "" + + # Prepend git diff header + header = f"diff --git a/{file_path} b/{file_path}\n" + return header + "".join(diff_lines) + + +def create_cf_entry( + workspace_dir: Path, + variant_description: str, + intervention_type: str | None = None, + fail_to_pass_override: list[TestEntry] | None = None, + pass_to_pass_override: list[TestEntry] | None = None, + cf_path: Path | None = None, + problem_statement_dir: Path | None = None, + dataset_path: Path | None = None, +) -> CounterfactualEntry: + """Create a counterfactual entry from an edited workspace. + + PASS_TO_PASS is auto-populated from the base entry unless overridden. + Key ordering in the JSONL output follows the canonical order. + """ + metadata = _load_workspace_metadata(workspace_dir) + base_instance_id: str = metadata["entry_id"] + + fix_patch, test_patch = regenerate_patches(workspace_dir) + + if cf_path is None: + cf_path = _config.paths.counterfactual_dataset_path + if problem_statement_dir is None: + problem_statement_dir = _config.paths.problem_statement_dir + if dataset_path is None: + dataset_path = _config.paths.dataset_path + + instance_id = _next_cf_id(base_instance_id, cf_path) + + if fail_to_pass_override is not None: + fail_to_pass = fail_to_pass_override + else: + test_file_contents = _read_workspace_file_contents(workspace_dir, "test") + stored_codeunit_ids = metadata.get("codeunit_ids", {}) + fail_to_pass = _detect_fail_to_pass(test_patch, base_instance_id, test_file_contents, stored_codeunit_ids) + + pass_to_pass = pass_to_pass_override if pass_to_pass_override is not None else _resolve_pass_to_pass_from_base(base_instance_id, dataset_path) + + problem_statement_path = _scaffold_problem_statement(instance_id, base_instance_id, problem_statement_dir) + + cf_entry = CounterfactualEntry( + instance_id=instance_id, + base_instance_id=base_instance_id, + variant_description=variant_description, + intervention_type=intervention_type, + test_patch=test_patch, + patch=fix_patch, + fail_to_pass=fail_to_pass, + pass_to_pass=pass_to_pass, + problem_statement_override=problem_statement_path, + ) + + _append_cf_entry(cf_entry, cf_path) + + logger.info(f"Created counterfactual entry: {instance_id}") + return cf_entry + + +def _load_workspace_metadata(workspace_dir: Path) -> dict: + metadata_path = workspace_dir / WORKSPACE_METADATA_FILE + return json.loads(metadata_path.read_text(encoding="utf-8")) + + +def _read_workspace_file_contents(workspace_dir: Path, category: str) -> dict[str, str]: + """Read all 'after' file contents from a workspace category.""" + contents: dict[str, str] = {} + after_dir = workspace_dir / category / "after" + if after_dir.exists(): + for file_path in after_dir.rglob("*"): + if file_path.is_file(): + rel_path = str(file_path.relative_to(after_dir)).replace("\\", "/") + contents[rel_path] = file_path.read_text(encoding="utf-8") + return contents + + +def _resolve_pass_to_pass_from_base(base_instance_id: str, dataset_path: Path) -> list[TestEntry]: + """Load PASS_TO_PASS from the base dataset entry.""" + from bcbench.dataset.dataset_loader import load_dataset_entries + + try: + entries = load_dataset_entries(dataset_path, entry_id=base_instance_id) + return entries[0].pass_to_pass + except Exception: + logger.warning(f"Could not load PASS_TO_PASS from base entry {base_instance_id}") + return [] + + +def _extract_codeunit_ids_from_patch(patch_str: str) -> dict[str, int]: + """Extract codeunit IDs per file from a patch (using hunk headers and context lines).""" + result: dict[str, int] = {} + patch_set = PatchSet(patch_str) + for patched_file in patch_set: + if not patched_file.path: + continue + for hunk in patched_file: + if patched_file.path not in result and hasattr(hunk, "section_header") and hunk.section_header: + match = re.search(r'codeunit\s+(\d+)\s+"[^"]*"', hunk.section_header) + if match: + result[patched_file.path] = int(match.group(1)) + for line in hunk: + if patched_file.path not in result and line.source_line_no is not None: + match = re.search(r'codeunit\s+(\d+)\s+"[^"]*"', str(line.value)) + if match: + result[patched_file.path] = int(match.group(1)) + return result + + +def _next_cf_id(base_instance_id: str, cf_path: Path) -> str: + """Determine the next available __cf-N id for the given base entry.""" + existing_numbers: list[int] = [] + pattern = re.compile(re.escape(base_instance_id) + r"__cf-(\d+)$") + + if cf_path.exists(): + with open(cf_path, encoding="utf-8") as f: + for line in f: + stripped = line.strip() + if not stripped: + continue + data = json.loads(stripped) + match = pattern.match(data.get("instance_id", "")) + if match: + existing_numbers.append(int(match.group(1))) + + next_num = max(existing_numbers, default=0) + 1 + return f"{base_instance_id}__cf-{next_num}" + + +def _detect_fail_to_pass( + test_patch: str, + base_instance_id: str, + file_contents: dict[str, str] | None = None, + stored_codeunit_ids: dict[str, int] | None = None, +) -> list[TestEntry]: + """Auto-detect FAIL_TO_PASS test entries from a test patch. + + Finds [Test] procedure declarations in the patch and resolves codeunit IDs + from patch context lines, file_contents, stored metadata, or base entry data. + """ + patch_set = PatchSet(test_patch) + codeunit_functions: dict[int, set[str]] = {} + + for patched_file in patch_set: + if not patched_file.path or not patched_file.path.lower().endswith(".codeunit.al"): + continue + + # Single pass: extract codeunit ID and [Test] procedures together + codeunit_id: int | None = None + found_test_attr = False + pending_funcs: set[str] = set() + + for hunk in patched_file: + # Check hunk section header for codeunit ID + if codeunit_id is None and hasattr(hunk, "section_header") and hunk.section_header: + match = re.search(r'codeunit\s+(\d+)\s+"[^"]*"', hunk.section_header) + if match: + codeunit_id = int(match.group(1)) + + for line in hunk: + line_value = str(line.value).strip() + + # Check context/removed lines for codeunit ID + if codeunit_id is None and line.source_line_no is not None: + match = re.search(r'codeunit\s+(\d+)\s+"[^"]*"', str(line.value)) + if match: + codeunit_id = int(match.group(1)) + + # Detect [Test] + procedure in added lines only + is_added = line.target_line_no is not None and line.source_line_no is None + if not is_added: + continue + + if re.match(r"\[Test\]", line_value, re.IGNORECASE): + found_test_attr = True + continue + + if found_test_attr: + proc_match = re.match(r"procedure\s+(\w+)\s*\(", line_value) + if proc_match: + pending_funcs.add(proc_match.group(1)) + found_test_attr = False + elif line_value and not line_value.startswith("["): + found_test_attr = False + + # Resolve codeunit ID from file_contents + if codeunit_id is None and file_contents and patched_file.path in file_contents: + match = re.search(r'codeunit\s+(\d+)\s+"[^"]*"', file_contents[patched_file.path]) + if match: + codeunit_id = int(match.group(1)) + + # Resolve from stored workspace metadata + if codeunit_id is None and stored_codeunit_ids and patched_file.path in stored_codeunit_ids: + codeunit_id = stored_codeunit_ids[patched_file.path] + + # Fall back to base entry's FAIL_TO_PASS + if codeunit_id is None: + codeunit_id = _resolve_codeunit_id_from_base(patched_file.path, base_instance_id) + + if codeunit_id is not None and pending_funcs: + codeunit_functions.setdefault(codeunit_id, set()).update(pending_funcs) + elif pending_funcs: + logger.warning(f"Could not resolve codeunit ID for {patched_file.path}") + + if not codeunit_functions: + raise ValueError("No [Test] procedures found in test patch") + + return [TestEntry(codeunitID=cid, functionName=frozenset(funcs)) for cid, funcs in codeunit_functions.items()] + + +def _resolve_codeunit_id_from_base(file_path: str, base_instance_id: str) -> int | None: + """Resolve codeunit ID from the base entry's FAIL_TO_PASS data.""" + from bcbench.dataset.dataset_loader import load_dataset_entries + + try: + entries = load_dataset_entries(_config.paths.dataset_path, entry_id=base_instance_id) + if entries: + base_entry = entries[0] + # Extract codeunit IDs from test_patch of the base entry for matching file paths + base_test_files = extract_file_paths_from_patch(base_entry.test_patch) + if file_path in base_test_files and base_entry.fail_to_pass: + return base_entry.fail_to_pass[0].codeunitID + except Exception: + logger.warning(f"Could not resolve codeunit ID from base entry {base_instance_id}") + return None + + +def _scaffold_problem_statement(cf_instance_id: str, base_instance_id: str, ps_dir: Path | None = None) -> str: + """Create a problem statement directory for the CF entry, copying from base.""" + if ps_dir is None: + ps_dir = _config.paths.problem_statement_dir + cf_dir = ps_dir / cf_instance_id + base_dir = ps_dir / base_instance_id + readme_name = _config.file_patterns.problem_statement_readme + + cf_dir.mkdir(parents=True, exist_ok=True) + + base_readme = base_dir / readme_name + cf_readme = cf_dir / readme_name + + if base_readme.exists(): + content = base_readme.read_text(encoding="utf-8") + cf_readme.write_text(content, encoding="utf-8") + for asset in base_dir.iterdir(): + if asset.name != readme_name and asset.is_file(): + shutil.copy2(asset, cf_dir / asset.name) + logger.info(f"Scaffolded problem statement from {base_readme}") + else: + cf_readme.write_text( + f"# Problem Statement\n\nCounterfactual variant of {base_instance_id}.\n\nTODO: Edit this problem statement.\n", + encoding="utf-8", + ) + logger.info(f"Created placeholder problem statement at {cf_readme}") + + return f"{ps_dir.parent.name}/{ps_dir.name}/{cf_instance_id}" + + +_CF_KEY_ORDER = [ + "instance_id", + "base_instance_id", + "variant_description", + "intervention_type", + "problem_statement_override", + "FAIL_TO_PASS", + "PASS_TO_PASS", + "test_patch", + "patch", +] + + +def _append_cf_entry(cf_entry: CounterfactualEntry, cf_path: Path) -> None: + """Append a counterfactual entry to the JSONL file with canonical key ordering.""" + cf_path.parent.mkdir(parents=True, exist_ok=True) + raw = cf_entry.model_dump(by_alias=True, mode="json") + ordered = {k: raw[k] for k in _CF_KEY_ORDER if k in raw} + with open(cf_path, "a", encoding="utf-8") as f: + json.dump(ordered, f, ensure_ascii=False) + f.write("\n") diff --git a/src/bcbench/dataset/counterfactual_entry.py b/src/bcbench/dataset/counterfactual_entry.py new file mode 100644 index 000000000..6a7d888e4 --- /dev/null +++ b/src/bcbench/dataset/counterfactual_entry.py @@ -0,0 +1,54 @@ +"""Counterfactual dataset entry model.""" + +from __future__ import annotations + +from typing import TYPE_CHECKING, Annotated + +from pydantic import BaseModel, ConfigDict, Field + +from bcbench.dataset.dataset_entry import TestEntry + +if TYPE_CHECKING: + from bcbench.dataset.dataset_entry import DatasetEntry + +__all__ = ["CounterfactualEntry"] + + +class CounterfactualEntry(BaseModel): + model_config = ConfigDict(frozen=True, populate_by_name=True) + + instance_id: str = Field(pattern=r"^[a-zA-Z0-9_-]+__[a-zA-Z0-9_-]+-[0-9]+__cf-[0-9]+$") + base_instance_id: str = Field(pattern=r"^[a-zA-Z0-9_-]+__[a-zA-Z0-9_-]+-[0-9]+$") + + variant_description: Annotated[str, Field(min_length=1)] + intervention_type: str | None = None + + test_patch: Annotated[str, Field(min_length=1)] + patch: Annotated[str, Field(min_length=1)] + fail_to_pass: Annotated[list[TestEntry], Field(alias="FAIL_TO_PASS", min_length=1)] + pass_to_pass: Annotated[list[TestEntry], Field(alias="PASS_TO_PASS")] = [] + + problem_statement_override: Annotated[str, Field(min_length=1)] + + def to_dataset_entry(self, base: DatasetEntry) -> DatasetEntry: + """Merge this counterfactual entry with its base to produce a DatasetEntry. + + Repo-level fields (repo, base_commit, project_paths, environment_setup_version) + come from the base entry. Specification fields (test_patch, patch, FAIL_TO_PASS, + PASS_TO_PASS) come from this counterfactual entry. + """ + from bcbench.dataset.dataset_entry import DatasetEntry + + return DatasetEntry( + instance_id=self.instance_id, + repo=base.repo, + base_commit=base.base_commit, + created_at=base.created_at, + environment_setup_version=base.environment_setup_version, + project_paths=base.project_paths, + metadata=base.metadata, + test_patch=self.test_patch, + patch=self.patch, + fail_to_pass=self.fail_to_pass, + pass_to_pass=self.pass_to_pass, + ) diff --git a/src/bcbench/dataset/counterfactual_loader.py b/src/bcbench/dataset/counterfactual_loader.py new file mode 100644 index 000000000..e9f90cc4a --- /dev/null +++ b/src/bcbench/dataset/counterfactual_loader.py @@ -0,0 +1,70 @@ +"""Utilities for loading counterfactual dataset entries from JSONL files.""" + +from pathlib import Path + +from bcbench.dataset.counterfactual_entry import CounterfactualEntry +from bcbench.dataset.dataset_entry import DatasetEntry +from bcbench.dataset.dataset_loader import load_dataset_entries +from bcbench.exceptions import EntryNotFoundError + +__all__ = ["load_counterfactual_entries"] + + +def _load_raw_counterfactual_entries(cf_path: Path, entry_id: str | None = None) -> list[CounterfactualEntry]: + if not cf_path.exists(): + raise FileNotFoundError(f"Counterfactual dataset file not found: {cf_path}") + + entries: list[CounterfactualEntry] = [] + + with open(cf_path, encoding="utf-8") as file: + for line in file: + stripped_line: str = line.strip() + if not stripped_line: + continue + + entry = CounterfactualEntry.model_validate_json(stripped_line) + + if entry_id: + # Match by exact variant ID + if entry.instance_id == entry_id: + return [entry] + # Match by base instance ID — return all variants for that family + if entry.base_instance_id == entry_id: + entries.append(entry) + continue + continue + + entries.append(entry) + + if entry_id and not entries: + raise EntryNotFoundError(entry_id) + + return entries + + +def _resolve_base_entry(base_instance_id: str, base_entries: list[DatasetEntry]) -> DatasetEntry: + for entry in base_entries: + if entry.instance_id == base_instance_id: + return entry + raise EntryNotFoundError(base_instance_id) + + +def load_counterfactual_entries( + cf_path: Path, + base_path: Path, + entry_id: str | None = None, +) -> list[tuple[CounterfactualEntry, DatasetEntry]]: + """Load counterfactual entries and resolve their base dataset entries. + + Args: + cf_path: Path to counterfactual JSONL file + base_path: Path to base dataset JSONL file (bcbench.jsonl) + entry_id: Optional entry ID — can be a variant ID (exact match) or base instance ID (all variants) + + Returns: + List of (CounterfactualEntry, DatasetEntry) tuples + """ + cf_entries = _load_raw_counterfactual_entries(cf_path, entry_id) + base_entries = load_dataset_entries(base_path) + + return [(cf_entry, _resolve_base_entry(cf_entry.base_instance_id, base_entries)) for cf_entry in cf_entries] diff --git a/src/bcbench/evaluate/base.py b/src/bcbench/evaluate/base.py index 87ec251b2..881caa408 100644 --- a/src/bcbench/evaluate/base.py +++ b/src/bcbench/evaluate/base.py @@ -104,6 +104,7 @@ def save_result(self, context: EvaluationContext, result: BaseEvaluationResult) def create_pipeline(category: EvaluationCategory) -> EvaluationPipeline: """Factory function to create evaluation pipeline based on category.""" from bcbench.evaluate.bugfix import BugFixPipeline + from bcbench.evaluate.counterfactual import CounterfactualPipeline from bcbench.evaluate.testgeneration import TestGenerationPipeline match category: @@ -113,6 +114,9 @@ def create_pipeline(category: EvaluationCategory) -> EvaluationPipeline: case EvaluationCategory.TEST_GENERATION: logger.info(f"Using TestGenerationPipeline for category: {category}") return TestGenerationPipeline() + case EvaluationCategory.COUNTERFACTUAL_EVALUATION: + logger.info(f"Using CounterfactualPipeline for category: {category}") + return CounterfactualPipeline() case _: raise ValueError(f"Unknown evaluation category: {category}") raise RuntimeError("Unreachable: no pipeline returned") diff --git a/src/bcbench/evaluate/counterfactual.py b/src/bcbench/evaluate/counterfactual.py new file mode 100644 index 000000000..b3f366f7d --- /dev/null +++ b/src/bcbench/evaluate/counterfactual.py @@ -0,0 +1,97 @@ +import re +from collections.abc import Callable + +from bcbench.evaluate.base import EvaluationPipeline +from bcbench.exceptions import BuildError, TestExecutionError +from bcbench.logger import get_logger, github_log_group +from bcbench.operations import ( + apply_patch, + build_and_publish_projects, + categorize_projects, + clean_project_paths, + run_tests, + setup_repo_postbuild, + setup_repo_prebuild, + stage_and_get_diff, +) +from bcbench.results.counterfactual import CounterfactualResult +from bcbench.types import EvaluationContext + +logger = get_logger(__name__) + +__all__ = ["CounterfactualPipeline"] + +_CF_SUFFIX_PATTERN = re.compile(r"^(.+)__cf-\d+$") + + +class CounterfactualPipeline(EvaluationPipeline): + """Pipeline for counterfactual evaluation category. + + Workflow is identical to BugFixPipeline: + 1. Setup: clean repo, checkout base commit, copy problem statement, build + 2. Run agent: execute agent to generate fix patch + 3. Evaluate: apply counterfactual test patch, build, run tests + + The key difference is that the counterfactual entry's test_patch and FAIL_TO_PASS + are used during evaluation instead of the base entry's. + """ + + def setup(self, context: EvaluationContext) -> None: + setup_repo_prebuild(context.entry, context.repo_path) + + build_and_publish_projects( + context.repo_path, + context.entry.project_paths, + context.container_name, + context.username, + context.password, + context.entry.environment_setup_version, + ) + + setup_repo_postbuild(context.entry, context.repo_path, context.category) + + def run_agent(self, context: EvaluationContext, agent_runner: Callable) -> None: + with github_log_group(f"{context.agent_name} -- Entry: {context.entry.instance_id}"): + context.metrics, context.experiment = agent_runner(context) + + def evaluate(self, context: EvaluationContext) -> None: + """Apply counterfactual test patch, build, and run tests.""" + test_projects, _app_projects = categorize_projects(context.entry.project_paths) + + clean_project_paths(context.repo_path, test_projects) + + generated_patch = stage_and_get_diff(context.repo_path) + result: CounterfactualResult | None = None + + match = _CF_SUFFIX_PATTERN.match(context.entry.instance_id) + base_instance_id = match.group(1) if match else "" + + try: + apply_patch(context.repo_path, context.entry.test_patch, f"{context.entry.instance_id} test patch") + build_and_publish_projects( + context.repo_path, + context.entry.project_paths, + context.container_name, + context.username, + context.password, + context.entry.environment_setup_version, + ) + run_tests(context.entry, context.container_name, context.username, context.password) + + result = CounterfactualResult.create_success(context, generated_patch, base_instance_id=base_instance_id) + logger.info(f"Successfully completed {context.entry.instance_id}") + + except BuildError as e: + result = CounterfactualResult.create_build_failure(context, generated_patch, str(e), base_instance_id=base_instance_id) + logger.error(f"Build failed during evaluation of {context.entry.instance_id}: {e}") + + except TestExecutionError as e: + result = CounterfactualResult.create_test_failure(context, generated_patch, error_msg="Test failed\n" + str(e), base_instance_id=base_instance_id) + logger.error(f"Tests failed during evaluation of {context.entry.instance_id}: {e}") + + finally: + if result is not None: + self.save_result(context, result) + else: + logger.error(f"No result generated for {context.entry.instance_id}") + raise RuntimeError(f"No result generated for {context.entry.instance_id}") diff --git a/src/bcbench/operations/setup_operations.py b/src/bcbench/operations/setup_operations.py index f2924ddf2..4afbb50c0 100644 --- a/src/bcbench/operations/setup_operations.py +++ b/src/bcbench/operations/setup_operations.py @@ -76,5 +76,7 @@ def setup_repo_postbuild(entry: DatasetEntry, repo_path: Path, category: Evaluat copy_problem_statement_folder(entry, repo_path) case _: raise ValueError(f"Unhandled test generation input mode: {input_mode}") + elif category == EvaluationCategory.COUNTERFACTUAL_EVALUATION: + copy_problem_statement_folder(entry, repo_path) else: copy_problem_statement_folder(entry, repo_path) diff --git a/src/bcbench/results/base.py b/src/bcbench/results/base.py index 8e9783727..0d5097153 100644 --- a/src/bcbench/results/base.py +++ b/src/bcbench/results/base.py @@ -113,10 +113,11 @@ def create_result_from_json(payload: dict[str, Any]) -> BaseEvaluationResult: payload: Dictionary containing result data Returns: - BugFixResult or TestGenerationResult instance based on category + BugFixResult, TestGenerationResult, or CounterfactualResult instance based on category """ # Import here to avoid circular dependencies from bcbench.results.bugfix import BugFixResult + from bcbench.results.counterfactual import CounterfactualResult from bcbench.results.testgeneration import TestGenerationResult category = EvaluationCategory(payload["category"]) @@ -126,5 +127,7 @@ def create_result_from_json(payload: dict[str, Any]) -> BaseEvaluationResult: return BugFixResult.model_validate(payload) case EvaluationCategory.TEST_GENERATION: return TestGenerationResult.model_validate(payload) + case EvaluationCategory.COUNTERFACTUAL_EVALUATION: + return CounterfactualResult.model_validate(payload) case _: raise ValueError(f"Unknown evaluation category: {category}") diff --git a/src/bcbench/results/bceval_export.py b/src/bcbench/results/bceval_export.py index 043e0f84d..047b1358c 100644 --- a/src/bcbench/results/bceval_export.py +++ b/src/bcbench/results/bceval_export.py @@ -78,5 +78,7 @@ def get_info_from_dataset_entry(entry: DatasetEntry, category: EvaluationCategor return entry.get_task(), entry.patch case EvaluationCategory.TEST_GENERATION: return entry.get_task(), entry.test_patch + case EvaluationCategory.COUNTERFACTUAL_EVALUATION: + return entry.get_task(), entry.patch case _: raise ValueError(f"Unsupported evaluation category: {category}") diff --git a/src/bcbench/results/counterfactual.py b/src/bcbench/results/counterfactual.py new file mode 100644 index 000000000..b2c45ce85 --- /dev/null +++ b/src/bcbench/results/counterfactual.py @@ -0,0 +1,12 @@ +from bcbench.results.base import BaseEvaluationResult + + +class CounterfactualResult(BaseEvaluationResult): + """Result class for counterfactual evaluation category. + + Inherits all shared metrics from BaseEvaluationResult. + Tracks the base instance and variant description for comparative analysis. + """ + + base_instance_id: str = "" + variant_description: str = "" diff --git a/src/bcbench/types.py b/src/bcbench/types.py index 6489414ae..b43eea552 100644 --- a/src/bcbench/types.py +++ b/src/bcbench/types.py @@ -98,8 +98,7 @@ def get_target_dir(self, repo_path: Path) -> Path: class EvaluationCategory(str, Enum): BUG_FIX = "bug-fix" TEST_GENERATION = "test-generation" - # CODE_REVIEW = "code-review" - # EVENT_REQUEST = "event-request" + COUNTERFACTUAL_EVALUATION = "counterfactual-evaluation" @dataclass diff --git a/tests/test_cf_workspace.py b/tests/test_cf_workspace.py new file mode 100644 index 000000000..e9c194e14 --- /dev/null +++ b/tests/test_cf_workspace.py @@ -0,0 +1,384 @@ +"""Tests for counterfactual workspace extraction, patch regeneration, and entry creation.""" + +import json +from pathlib import Path + +import pytest + +from bcbench.dataset.cf_workspace import ( + _detect_fail_to_pass, + _generate_git_diff, + _next_cf_id, + _reconstruct_padded_files, + create_cf_entry, + extract_workspace, + regenerate_patches, +) +from bcbench.dataset.dataset_entry import TestEntry +from tests.conftest import create_dataset_entry + +# A realistic AL patch for testing +SAMPLE_FIX_PATCH = """\ +diff --git a/App/Apps/W1/Sustainability/app/src/Setup/SustainabilitySetup.Table.al b/App/Apps/W1/Sustainability/app/src/Setup/SustainabilitySetup.Table.al +index 335c0099f4a..cf00000001 100644 +--- a/App/Apps/W1/Sustainability/app/src/Setup/SustainabilitySetup.Table.al ++++ b/App/Apps/W1/Sustainability/app/src/Setup/SustainabilitySetup.Table.al +@@ -151,6 +151,8 @@ table 6217 "Sustainability Setup" + if Rec."Enable Value Chain Tracking" then + if not ConfirmManagement.GetResponseOrDefault(ConfirmEnableValueChainTrackingQst, false) then + Error(''); ++ ++ EnableEmissionsWhenValueChainTrackingIsEnabled(); + end; + } + } +""" + +SAMPLE_TEST_PATCH = """\ +diff --git a/App/Apps/W1/Sustainability/test/src/SustCertificateTest.Codeunit.al b/App/Apps/W1/Sustainability/test/src/SustCertificateTest.Codeunit.al +index ff9b7640fa2..cf00000001 100644 +--- a/App/Apps/W1/Sustainability/test/src/SustCertificateTest.Codeunit.al ++++ b/App/Apps/W1/Sustainability/test/src/SustCertificateTest.Codeunit.al +@@ -5123,6 +5123,22 @@ codeunit 148187 "Sust. Certificate Test" + // [THEN] Confirmation Box should not pop up as there is no confirm Handler. + end; + ++ [Test] ++ [HandlerFunctions('ConfirmHandlerYes')] ++ procedure VerifyPurchDocEmissionsEnabled() ++ var ++ SustainabilitySetup: Record "Sustainability Setup"; ++ begin ++ // [SCENARIO] Verify emissions enabled ++ LibrarySustainability.CleanUpBeforeTesting(); ++ SustainabilitySetup.Get(); ++ SustainabilitySetup.Validate("Enable Value Chain Tracking", true); ++ Assert.AreEqual( ++ true, ++ SustainabilitySetup."Use Emissions In Purch. Doc.", ++ 'Should be enabled'); ++ end; ++ + local procedure CreateSustainabilityAccount(var AccountCode: Code[20]; var CategoryCode: Code[20]; var SubcategoryCode: Code[20]; i: Integer): Record "Sustainability Account" + begin + CreateSustainabilitySubcategory(CategoryCode, SubcategoryCode, i); +""" + + +class TestReconstructPaddedFiles: + def test_preserves_line_numbers_for_context(self): + result = _reconstruct_padded_files(SAMPLE_FIX_PATCH) + assert len(result) == 1 + + path = "App/Apps/W1/Sustainability/app/src/Setup/SustainabilitySetup.Table.al" + assert path in result + + before_lines, _after_lines = result[path] + # Hunk starts at line 151, so we should have padding before that + assert len(before_lines) >= 150 # at least up to the context + + def test_before_has_no_added_lines(self): + result = _reconstruct_padded_files(SAMPLE_FIX_PATCH) + path = "App/Apps/W1/Sustainability/app/src/Setup/SustainabilitySetup.Table.al" + before_lines, _ = result[path] + content = "".join(before_lines) + assert "EnableEmissionsWhenValueChainTrackingIsEnabled" not in content + + def test_after_has_added_lines(self): + result = _reconstruct_padded_files(SAMPLE_FIX_PATCH) + path = "App/Apps/W1/Sustainability/app/src/Setup/SustainabilitySetup.Table.al" + _, after_lines = result[path] + content = "".join(after_lines) + assert "EnableEmissionsWhenValueChainTrackingIsEnabled" in content + + def test_handles_test_patch_with_codeunit(self): + result = _reconstruct_padded_files(SAMPLE_TEST_PATCH) + path = "App/Apps/W1/Sustainability/test/src/SustCertificateTest.Codeunit.al" + assert path in result + before_lines, after_lines = result[path] + assert len(after_lines) > len(before_lines) + + def test_empty_patch_returns_empty(self): + result = _reconstruct_padded_files("") + assert result == {} + + +class TestGenerateGitDiff: + def test_generates_valid_diff_header(self): + before = ["line1\n", "line2\n"] + after = ["line1\n", "line2_modified\n"] + diff = _generate_git_diff(before, after, "test.al") + assert diff.startswith("diff --git a/test.al b/test.al\n") + assert "--- a/test.al" in diff + assert "+++ b/test.al" in diff + + def test_no_changes_returns_empty(self): + lines = ["line1\n", "line2\n"] + diff = _generate_git_diff(lines, lines, "test.al") + assert diff == "" + + def test_added_lines_appear_in_diff(self): + before = ["line1\n"] + after = ["line1\n", "line2\n"] + diff = _generate_git_diff(before, after, "test.al") + assert "+line2\n" in diff + + +class TestExtractWorkspacePatchOnly: + def test_creates_workspace_structure(self, tmp_path: Path): + entry = create_dataset_entry(patch=SAMPLE_FIX_PATCH, test_patch=SAMPLE_TEST_PATCH) + workspace = extract_workspace(entry, tmp_path / "ws") + + assert (workspace / "workspace.json").exists() + assert (workspace / "fix" / "before").is_dir() + assert (workspace / "fix" / "after").is_dir() + assert (workspace / "test" / "before").is_dir() + assert (workspace / "test" / "after").is_dir() + + def test_metadata_contains_entry_info(self, tmp_path: Path): + entry = create_dataset_entry(patch=SAMPLE_FIX_PATCH, test_patch=SAMPLE_TEST_PATCH) + workspace = extract_workspace(entry, tmp_path / "ws") + + metadata = json.loads((workspace / "workspace.json").read_text()) + assert metadata["entry_id"] == entry.instance_id + assert metadata["mode"] == "patch-only" + assert "fix" in metadata["files"] + assert "test" in metadata["files"] + + def test_fix_files_are_extracted(self, tmp_path: Path): + entry = create_dataset_entry(patch=SAMPLE_FIX_PATCH, test_patch=SAMPLE_TEST_PATCH) + workspace = extract_workspace(entry, tmp_path / "ws") + + fix_after = workspace / "fix" / "after" / "App/Apps/W1/Sustainability/app/src/Setup/SustainabilitySetup.Table.al" + assert fix_after.exists() + assert "EnableEmissionsWhenValueChainTrackingIsEnabled" in fix_after.read_text() + + def test_test_files_are_extracted(self, tmp_path: Path): + entry = create_dataset_entry(patch=SAMPLE_FIX_PATCH, test_patch=SAMPLE_TEST_PATCH) + workspace = extract_workspace(entry, tmp_path / "ws") + + test_after = workspace / "test" / "after" / "App/Apps/W1/Sustainability/test/src/SustCertificateTest.Codeunit.al" + assert test_after.exists() + assert "VerifyPurchDocEmissionsEnabled" in test_after.read_text() + + +class TestRegeneratePatches: + def test_round_trip_produces_diff(self, tmp_path: Path): + entry = create_dataset_entry(patch=SAMPLE_FIX_PATCH, test_patch=SAMPLE_TEST_PATCH) + workspace = extract_workspace(entry, tmp_path / "ws") + + fix_patch, test_patch = regenerate_patches(workspace) + assert "EnableEmissionsWhenValueChainTrackingIsEnabled" in fix_patch + assert "VerifyPurchDocEmissionsEnabled" in test_patch + + def test_regenerated_patches_have_git_headers(self, tmp_path: Path): + entry = create_dataset_entry(patch=SAMPLE_FIX_PATCH, test_patch=SAMPLE_TEST_PATCH) + workspace = extract_workspace(entry, tmp_path / "ws") + + fix_patch, test_patch = regenerate_patches(workspace) + assert fix_patch.startswith("diff --git") + assert test_patch.startswith("diff --git") + + def test_no_changes_produces_empty_patch(self, tmp_path: Path): + entry = create_dataset_entry(patch=SAMPLE_FIX_PATCH, test_patch=SAMPLE_TEST_PATCH) + workspace = extract_workspace(entry, tmp_path / "ws") + + # Overwrite after with before content (no changes) + fix_path = "App/Apps/W1/Sustainability/app/src/Setup/SustainabilitySetup.Table.al" + before = (workspace / "fix" / "before" / fix_path).read_text() + (workspace / "fix" / "after" / fix_path).write_text(before) + + fix_patch, _ = regenerate_patches(workspace) + assert fix_patch == "" + + +class TestNextCfId: + def test_first_cf_entry_is_cf_1(self, tmp_path: Path): + cf_path = tmp_path / "counterfactual.jsonl" + result = _next_cf_id("microsoftInternal__NAV-123456", cf_path) + assert result == "microsoftInternal__NAV-123456__cf-1" + + def test_increments_from_existing(self, tmp_path: Path): + cf_path = tmp_path / "counterfactual.jsonl" + cf_path.write_text(json.dumps({"instance_id": "microsoftInternal__NAV-123456__cf-1"}) + "\n" + json.dumps({"instance_id": "microsoftInternal__NAV-123456__cf-2"}) + "\n") + result = _next_cf_id("microsoftInternal__NAV-123456", cf_path) + assert result == "microsoftInternal__NAV-123456__cf-3" + + def test_ignores_other_base_entries(self, tmp_path: Path): + cf_path = tmp_path / "counterfactual.jsonl" + cf_path.write_text(json.dumps({"instance_id": "microsoftInternal__NAV-999999__cf-5"}) + "\n") + result = _next_cf_id("microsoftInternal__NAV-123456", cf_path) + assert result == "microsoftInternal__NAV-123456__cf-1" + + def test_handles_gaps_in_numbering(self, tmp_path: Path): + cf_path = tmp_path / "counterfactual.jsonl" + cf_path.write_text(json.dumps({"instance_id": "microsoftInternal__NAV-123456__cf-1"}) + "\n" + json.dumps({"instance_id": "microsoftInternal__NAV-123456__cf-5"}) + "\n") + result = _next_cf_id("microsoftInternal__NAV-123456", cf_path) + assert result == "microsoftInternal__NAV-123456__cf-6" + + +class TestDetectFailToPass: + def test_detects_test_procedure(self): + result = _detect_fail_to_pass(SAMPLE_TEST_PATCH, "microsoftInternal__NAV-123456") + assert len(result) == 1 + assert result[0].codeunitID == 148187 + assert "VerifyPurchDocEmissionsEnabled" in result[0].functionName + + def test_empty_patch_raises(self): + empty_patch = """\ +diff --git a/App/test/NoTests.Codeunit.al b/App/test/NoTests.Codeunit.al +index aaa..bbb 100644 +--- a/App/test/NoTests.Codeunit.al ++++ b/App/test/NoTests.Codeunit.al +@@ -1,3 +1,4 @@ codeunit 99999 "NoTests" + procedure Foo() + begin ++ // just a comment + end; +""" + with pytest.raises(ValueError, match="No \\[Test\\] procedures found"): + _detect_fail_to_pass(empty_patch, "microsoftInternal__NAV-123456") + + +class TestCreateCfEntry: + @staticmethod + def _write_base_dataset(tmp_path: Path, entry) -> Path: + """Write a base dataset JSONL so create_cf_entry can resolve PASS_TO_PASS.""" + dataset_path = tmp_path / "bcbench.jsonl" + import json as _json + + dataset_path.write_text( + _json.dumps(entry.model_dump(by_alias=True, mode="json"), ensure_ascii=False) + "\n", + encoding="utf-8", + ) + return dataset_path + + def test_creates_entry_and_appends_to_jsonl(self, tmp_path: Path): + entry = create_dataset_entry(patch=SAMPLE_FIX_PATCH, test_patch=SAMPLE_TEST_PATCH) + workspace = extract_workspace(entry, tmp_path / "ws") + + # Setup paths + cf_path = tmp_path / "counterfactual.jsonl" + ps_dir = tmp_path / "problemstatement" + ps_dir.mkdir() + # Create base problem statement + base_ps = ps_dir / entry.instance_id + base_ps.mkdir() + (base_ps / "README.md").write_text("# Base Problem\n") + dataset_path = self._write_base_dataset(tmp_path, entry) + + cf_entry = create_cf_entry(workspace, "Test variant description", cf_path=cf_path, problem_statement_dir=ps_dir, dataset_path=dataset_path) + + assert cf_entry.instance_id.endswith("__cf-1") + assert cf_entry.base_instance_id == entry.instance_id + assert cf_entry.variant_description == "Test variant description" + assert len(cf_entry.fail_to_pass) > 0 + + # Verify appended to JSONL + assert cf_path.exists() + lines = cf_path.read_text().strip().split("\n") + assert len(lines) == 1 + data = json.loads(lines[0]) + assert data["instance_id"] == cf_entry.instance_id + + def test_second_entry_gets_cf_2(self, tmp_path: Path): + entry = create_dataset_entry(patch=SAMPLE_FIX_PATCH, test_patch=SAMPLE_TEST_PATCH) + workspace = extract_workspace(entry, tmp_path / "ws") + + cf_path = tmp_path / "counterfactual.jsonl" + ps_dir = tmp_path / "problemstatement" + ps_dir.mkdir() + base_ps = ps_dir / entry.instance_id + base_ps.mkdir() + (base_ps / "README.md").write_text("# Base Problem\n") + dataset_path = self._write_base_dataset(tmp_path, entry) + + cf1 = create_cf_entry(workspace, "Variant 1", cf_path=cf_path, problem_statement_dir=ps_dir, dataset_path=dataset_path) + cf2 = create_cf_entry(workspace, "Variant 2", cf_path=cf_path, problem_statement_dir=ps_dir, dataset_path=dataset_path) + + assert cf1.instance_id.endswith("__cf-1") + assert cf2.instance_id.endswith("__cf-2") + + def test_with_fail_to_pass_override(self, tmp_path: Path): + entry = create_dataset_entry(patch=SAMPLE_FIX_PATCH, test_patch=SAMPLE_TEST_PATCH) + workspace = extract_workspace(entry, tmp_path / "ws") + + cf_path = tmp_path / "counterfactual.jsonl" + ps_dir = tmp_path / "problemstatement" + ps_dir.mkdir() + base_ps = ps_dir / entry.instance_id + base_ps.mkdir() + (base_ps / "README.md").write_text("# Base Problem\n") + dataset_path = self._write_base_dataset(tmp_path, entry) + + override = [TestEntry(codeunitID=99999, functionName=frozenset({"CustomTest"}))] + cf_entry = create_cf_entry(workspace, "Override test", fail_to_pass_override=override, cf_path=cf_path, problem_statement_dir=ps_dir, dataset_path=dataset_path) + + assert cf_entry.fail_to_pass[0].codeunitID == 99999 + assert "CustomTest" in cf_entry.fail_to_pass[0].functionName + + def test_scaffolds_problem_statement_from_base(self, tmp_path: Path): + entry = create_dataset_entry(patch=SAMPLE_FIX_PATCH, test_patch=SAMPLE_TEST_PATCH) + workspace = extract_workspace(entry, tmp_path / "ws") + + cf_path = tmp_path / "counterfactual.jsonl" + ps_dir = tmp_path / "problemstatement" + ps_dir.mkdir() + base_ps = ps_dir / entry.instance_id + base_ps.mkdir() + (base_ps / "README.md").write_text("# Original Problem Statement\n") + dataset_path = self._write_base_dataset(tmp_path, entry) + + cf_entry = create_cf_entry(workspace, "Variant", cf_path=cf_path, problem_statement_dir=ps_dir, dataset_path=dataset_path) + + # CF problem statement directory should exist with copied README + cf_ps_dir = ps_dir / cf_entry.instance_id + assert cf_ps_dir.exists() + assert (cf_ps_dir / "README.md").read_text() == "# Original Problem Statement\n" + + def test_jsonl_key_ordering(self, tmp_path: Path): + entry = create_dataset_entry(patch=SAMPLE_FIX_PATCH, test_patch=SAMPLE_TEST_PATCH) + workspace = extract_workspace(entry, tmp_path / "ws") + + cf_path = tmp_path / "counterfactual.jsonl" + ps_dir = tmp_path / "problemstatement" + ps_dir.mkdir() + base_ps = ps_dir / entry.instance_id + base_ps.mkdir() + (base_ps / "README.md").write_text("# Base Problem\n") + dataset_path = self._write_base_dataset(tmp_path, entry) + + create_cf_entry(workspace, "Variant", cf_path=cf_path, problem_statement_dir=ps_dir, dataset_path=dataset_path) + + data = json.loads(cf_path.read_text().strip()) + expected_order = [ + "instance_id", + "base_instance_id", + "variant_description", + "intervention_type", + "problem_statement_override", + "FAIL_TO_PASS", + "PASS_TO_PASS", + "test_patch", + "patch", + ] + assert list(data.keys()) == expected_order + + def test_pass_to_pass_auto_populated_from_base(self, tmp_path: Path): + base_p2p = [TestEntry(codeunitID=99999, functionName=frozenset({"ExistingPassTest"}))] + entry = create_dataset_entry(patch=SAMPLE_FIX_PATCH, test_patch=SAMPLE_TEST_PATCH, pass_to_pass=base_p2p) + workspace = extract_workspace(entry, tmp_path / "ws") + + cf_path = tmp_path / "counterfactual.jsonl" + ps_dir = tmp_path / "problemstatement" + ps_dir.mkdir() + base_ps = ps_dir / entry.instance_id + base_ps.mkdir() + (base_ps / "README.md").write_text("# Base Problem\n") + dataset_path = self._write_base_dataset(tmp_path, entry) + + cf_entry = create_cf_entry(workspace, "Variant", cf_path=cf_path, problem_statement_dir=ps_dir, dataset_path=dataset_path) + + assert len(cf_entry.pass_to_pass) == 1 + assert cf_entry.pass_to_pass[0].codeunitID == 99999 + assert "ExistingPassTest" in cf_entry.pass_to_pass[0].functionName diff --git a/tests/test_counterfactual.py b/tests/test_counterfactual.py new file mode 100644 index 000000000..9d56a8a1d --- /dev/null +++ b/tests/test_counterfactual.py @@ -0,0 +1,336 @@ +"""Tests for counterfactual dataset entry, loader, and result.""" + +import json +from pathlib import Path + +import pytest +from pydantic import ValidationError + +from bcbench.dataset import CounterfactualEntry, DatasetEntry, load_counterfactual_entries +from bcbench.dataset.dataset_entry import TestEntry +from bcbench.exceptions import EntryNotFoundError +from bcbench.results.counterfactual import CounterfactualResult +from bcbench.types import EvaluationCategory +from tests.conftest import ( + create_dataset_entry, + create_evaluation_context, + create_test_entry, +) + +VALID_CF_INSTANCE_ID = "microsoftInternal__NAV-123456__cf-1" +VALID_BASE_INSTANCE_ID = "microsoftInternal__NAV-123456" +VALID_CF_PATCH = "diff --git a/cf.al b/cf.al\n+counterfactual fix" +VALID_CF_TEST_PATCH = "diff --git a/cf_test.al b/cf_test.al\n+counterfactual test" + + +def create_counterfactual_entry( + instance_id: str = VALID_CF_INSTANCE_ID, + base_instance_id: str = VALID_BASE_INSTANCE_ID, + variant_description: str = "Modified test expectation", + test_patch: str = VALID_CF_TEST_PATCH, + patch: str = VALID_CF_PATCH, + fail_to_pass: list[TestEntry] | None = None, + problem_statement_override: str = "dataset/problemstatement/microsoftInternal__NAV-123456__cf-1", + intervention_type: str | None = None, +) -> CounterfactualEntry: + if fail_to_pass is None: + fail_to_pass = [create_test_entry()] + + return CounterfactualEntry( + instance_id=instance_id, + base_instance_id=base_instance_id, + variant_description=variant_description, + test_patch=test_patch, + patch=patch, + fail_to_pass=fail_to_pass, + problem_statement_override=problem_statement_override, + intervention_type=intervention_type, + ) + + +def create_counterfactual_file(tmp_path: Path, entries: list[CounterfactualEntry] | None = None) -> Path: + if entries is None: + entries = [create_counterfactual_entry()] + + cf_path = tmp_path / "counterfactual.jsonl" + with open(cf_path, "w") as f: + for entry in entries: + f.write(json.dumps(entry.model_dump(by_alias=True, mode="json")) + "\n") + return cf_path + + +def create_base_dataset_file(tmp_path: Path, entries: list[DatasetEntry] | None = None) -> Path: + if entries is None: + entries = [create_dataset_entry()] + + dataset_path = tmp_path / "bcbench.jsonl" + with open(dataset_path, "w") as f: + for entry in entries: + entry_dict = { + "instance_id": entry.instance_id, + "repo": entry.repo, + "base_commit": entry.base_commit, + "environment_setup_version": entry.environment_setup_version, + "FAIL_TO_PASS": [{"codeunitID": t.codeunitID, "functionName": list(t.functionName)} for t in entry.fail_to_pass], + "PASS_TO_PASS": [{"codeunitID": t.codeunitID, "functionName": list(t.functionName)} for t in entry.pass_to_pass], + "project_paths": entry.project_paths, + "patch": entry.patch, + "test_patch": entry.test_patch, + "created_at": entry.created_at, + } + f.write(json.dumps(entry_dict) + "\n") + return dataset_path + + +class TestCounterfactualEntryModel: + def test_valid_entry_is_created(self): + entry = create_counterfactual_entry() + assert entry.instance_id == VALID_CF_INSTANCE_ID + assert entry.base_instance_id == VALID_BASE_INSTANCE_ID + + def test_invalid_instance_id_pattern_raises(self): + with pytest.raises(ValidationError): + create_counterfactual_entry(instance_id="invalid-id") + + def test_invalid_base_instance_id_pattern_raises(self): + with pytest.raises(ValidationError): + create_counterfactual_entry(base_instance_id="invalid") + + def test_intervention_type_is_optional(self): + entry = create_counterfactual_entry(intervention_type=None) + assert entry.intervention_type is None + + def test_intervention_type_is_set(self): + entry = create_counterfactual_entry(intervention_type="test-spec-change") + assert entry.intervention_type == "test-spec-change" + + def test_model_is_frozen(self): + entry = create_counterfactual_entry() + with pytest.raises(ValidationError): + entry.instance_id = "new_id" + + +class TestCounterfactualToDatasetEntry: + def test_merges_with_base_entry(self): + cf_entry = create_counterfactual_entry() + base_entry = create_dataset_entry() + + merged = cf_entry.to_dataset_entry(base_entry) + + assert merged.instance_id == cf_entry.instance_id + assert merged.repo == base_entry.repo + assert merged.base_commit == base_entry.base_commit + assert merged.project_paths == base_entry.project_paths + assert merged.environment_setup_version == base_entry.environment_setup_version + assert merged.test_patch == cf_entry.test_patch + assert merged.patch == cf_entry.patch + assert merged.fail_to_pass == cf_entry.fail_to_pass + + def test_merged_entry_is_valid_dataset_entry(self): + cf_entry = create_counterfactual_entry() + base_entry = create_dataset_entry() + + merged = cf_entry.to_dataset_entry(base_entry) + assert isinstance(merged, DatasetEntry) + + +class TestCounterfactualLoader: + def test_loads_all_entries(self, tmp_path: Path): + cf_entries = [ + create_counterfactual_entry(instance_id="microsoftInternal__NAV-123456__cf-1"), + create_counterfactual_entry(instance_id="microsoftInternal__NAV-123456__cf-2"), + ] + cf_path = create_counterfactual_file(tmp_path, cf_entries) + base_path = create_base_dataset_file(tmp_path) + + result = load_counterfactual_entries(cf_path, base_path) + assert len(result) == 2 + + def test_loads_by_variant_id(self, tmp_path: Path): + cf_entries = [ + create_counterfactual_entry(instance_id="microsoftInternal__NAV-123456__cf-1"), + create_counterfactual_entry(instance_id="microsoftInternal__NAV-123456__cf-2"), + ] + cf_path = create_counterfactual_file(tmp_path, cf_entries) + base_path = create_base_dataset_file(tmp_path) + + result = load_counterfactual_entries(cf_path, base_path, entry_id="microsoftInternal__NAV-123456__cf-2") + assert len(result) == 1 + assert result[0][0].instance_id == "microsoftInternal__NAV-123456__cf-2" + + def test_loads_by_base_instance_id(self, tmp_path: Path): + cf_entries = [ + create_counterfactual_entry(instance_id="microsoftInternal__NAV-123456__cf-1"), + create_counterfactual_entry(instance_id="microsoftInternal__NAV-123456__cf-2"), + ] + cf_path = create_counterfactual_file(tmp_path, cf_entries) + base_path = create_base_dataset_file(tmp_path) + + result = load_counterfactual_entries(cf_path, base_path, entry_id="microsoftInternal__NAV-123456") + assert len(result) == 2 + + def test_resolves_base_entry(self, tmp_path: Path): + cf_path = create_counterfactual_file(tmp_path) + base_path = create_base_dataset_file(tmp_path) + + result = load_counterfactual_entries(cf_path, base_path) + cf_entry, base_entry = result[0] + assert base_entry.instance_id == VALID_BASE_INSTANCE_ID + assert cf_entry.base_instance_id == base_entry.instance_id + + def test_missing_base_entry_raises(self, tmp_path: Path): + cf_entry = create_counterfactual_entry(base_instance_id="microsoftInternal__NAV-999999") + cf_path = create_counterfactual_file(tmp_path, [cf_entry]) + base_path = create_base_dataset_file(tmp_path) + + with pytest.raises(EntryNotFoundError): + load_counterfactual_entries(cf_path, base_path) + + def test_missing_entry_id_raises(self, tmp_path: Path): + cf_path = create_counterfactual_file(tmp_path) + base_path = create_base_dataset_file(tmp_path) + + with pytest.raises(EntryNotFoundError): + load_counterfactual_entries(cf_path, base_path, entry_id="nonexistent__NAV-999999") + + def test_missing_file_raises(self, tmp_path: Path): + base_path = create_base_dataset_file(tmp_path) + with pytest.raises(FileNotFoundError): + load_counterfactual_entries(tmp_path / "missing.jsonl", base_path) + + +class TestCounterfactualResult: + def test_create_success(self, tmp_path: Path): + context = create_evaluation_context( + tmp_path, + category=EvaluationCategory.COUNTERFACTUAL_EVALUATION, + ) + result = CounterfactualResult.create_success( + context, + "generated patch", + base_instance_id=VALID_BASE_INSTANCE_ID, + variant_description="Modified test expectation", + ) + + assert result.resolved is True + assert result.build is True + assert result.base_instance_id == VALID_BASE_INSTANCE_ID + assert result.variant_description == "Modified test expectation" + assert result.category == EvaluationCategory.COUNTERFACTUAL_EVALUATION + + def test_create_build_failure(self, tmp_path: Path): + context = create_evaluation_context( + tmp_path, + category=EvaluationCategory.COUNTERFACTUAL_EVALUATION, + ) + result = CounterfactualResult.create_build_failure( + context, + "generated patch", + "Build failed", + base_instance_id=VALID_BASE_INSTANCE_ID, + variant_description="Modified test", + ) + + assert result.resolved is False + assert result.build is False + + def test_serialization_roundtrip(self, tmp_path: Path): + context = create_evaluation_context( + tmp_path, + category=EvaluationCategory.COUNTERFACTUAL_EVALUATION, + ) + result = CounterfactualResult.create_success( + context, + "generated patch", + base_instance_id=VALID_BASE_INSTANCE_ID, + variant_description="Modified test", + ) + + result_dict = result.model_dump(mode="json") + restored = CounterfactualResult.model_validate(result_dict) + + assert restored.instance_id == result.instance_id + assert restored.base_instance_id == result.base_instance_id + assert restored.variant_description == result.variant_description + + +class TestCounterfactualDatasetIntegration: + """Integration tests that load from the real dataset/counterfactual.jsonl file.""" + + def test_load_real_counterfactual_dataset(self): + from bcbench.config import get_config + + config = get_config() + cf_path = config.paths.counterfactual_dataset_path + base_path = config.paths.dataset_path + + pairs = load_counterfactual_entries(cf_path, base_path) + assert len(pairs) >= 1 + + cf_entry, base_entry = pairs[0] + assert cf_entry.base_instance_id == base_entry.instance_id + + def test_load_real_entry_by_variant_id(self): + from bcbench.config import get_config + + config = get_config() + cf_path = config.paths.counterfactual_dataset_path + base_path = config.paths.dataset_path + + pairs = load_counterfactual_entries(cf_path, base_path, entry_id="microsoftInternal__NAV-210528__cf-1") + assert len(pairs) == 1 + + cf_entry, base_entry = pairs[0] + assert cf_entry.instance_id == "microsoftInternal__NAV-210528__cf-1" + assert base_entry.instance_id == "microsoftInternal__NAV-210528" + + def test_load_real_entries_by_base_id(self): + from bcbench.config import get_config + + config = get_config() + cf_path = config.paths.counterfactual_dataset_path + base_path = config.paths.dataset_path + + pairs = load_counterfactual_entries(cf_path, base_path, entry_id="microsoftInternal__NAV-210528") + assert len(pairs) >= 1 + assert all(cf.base_instance_id == "microsoftInternal__NAV-210528" for cf, _ in pairs) + + def test_merged_entry_has_counterfactual_spec(self): + from bcbench.config import get_config + + config = get_config() + cf_path = config.paths.counterfactual_dataset_path + base_path = config.paths.dataset_path + + pairs = load_counterfactual_entries(cf_path, base_path, entry_id="microsoftInternal__NAV-210528__cf-1") + cf_entry, base_entry = pairs[0] + + merged = cf_entry.to_dataset_entry(base_entry) + + # Repo-level fields come from base + assert merged.repo == base_entry.repo + assert merged.base_commit == base_entry.base_commit + assert merged.project_paths == base_entry.project_paths + + # Spec fields come from counterfactual + assert merged.instance_id == cf_entry.instance_id + assert merged.test_patch == cf_entry.test_patch + assert merged.patch == cf_entry.patch + assert merged.fail_to_pass == cf_entry.fail_to_pass + + def test_counterfactual_problem_statement_exists(self): + from bcbench.config import get_config + + config = get_config() + cf_path = config.paths.counterfactual_dataset_path + base_path = config.paths.dataset_path + + pairs = load_counterfactual_entries(cf_path, base_path, entry_id="microsoftInternal__NAV-210528__cf-1") + cf_entry, base_entry = pairs[0] + + merged = cf_entry.to_dataset_entry(base_entry) + problem_dir = merged.problem_statement_dir + readme = problem_dir / "README.md" + assert readme.exists(), f"Problem statement README missing at {readme}" + content = readme.read_text(encoding="utf-8") + assert content.strip(), f"Problem statement README is empty at {readme}"