diff --git a/.github/actions/setup-bc-container/action.yml b/.github/actions/setup-bc-container/action.yml index 7185b79b2..2e69e1a85 100644 --- a/.github/actions/setup-bc-container/action.yml +++ b/.github/actions/setup-bc-container/action.yml @@ -37,7 +37,7 @@ 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 + "BC_CONTAINER_NAME=bcbench-$("${{ inputs.instance-id }}".Split('-')[1].Split('_')[0])" | 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/copilot-instructions.md b/.github/copilot-instructions.md index 1bf4da6cb..80ef64118 100644 --- a/.github/copilot-instructions.md +++ b/.github/copilot-instructions.md @@ -16,7 +16,7 @@ This is a benchmark for evaluating coding agents on real-world Business Central - Uses `pre-commit` for code quality checks (ruff linting/formatting, trailing whitespace, etc.) ## Categories -BC-Bench is category-based and designed to grow over time. It currently has two categories, `bug-fix` and `test-generation`. They share the same dataset tasks and execution-based setup, but use different prompts, expected outputs, and evaluation pipelines. Future categories such as `code-review` can be added within the same overall benchmark structure, though they may require different inputs, setup, or evaluation methods. +BC-Bench is category-based and designed to grow over time. It currently has two execution-based categories that update the public leaderboard, `bug-fix` and `test-generation`, plus a single counterfactual category `cf` (entries from `counterfactual.jsonl`) that reuses the bug-fix pipeline but only saves raw results — its metrics are computed offline in notebooks. Future categories such as `code-review` can be added within the same overall benchmark structure, though they may require different inputs, setup, or evaluation methods. ## Coding Patterns and Guidelines diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 1eafcb1fc..dc484027f 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -41,7 +41,7 @@ jobs: id: random shell: pwsh run: | - $categories = @("bug-fix", "test-generation") + $categories = @("bug-fix", "test-generation", "cf") $selected = $categories | Get-Random echo "category=$selected" >> $env:GITHUB_OUTPUT diff --git a/.github/workflows/claude-evaluation.yml b/.github/workflows/claude-evaluation.yml index 357a7eb7c..3ccb156d2 100644 --- a/.github/workflows/claude-evaluation.yml +++ b/.github/workflows/claude-evaluation.yml @@ -23,6 +23,7 @@ on: options: - "bug-fix" - "test-generation" + - "cf" 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 20fbcbb8c..a2f483e49 100644 --- a/.github/workflows/copilot-evaluation.yml +++ b/.github/workflows/copilot-evaluation.yml @@ -29,6 +29,7 @@ on: options: - "bug-fix" - "test-generation" + - "cf" test-run: description: "Indicate this is a test run (with few entries)" required: false @@ -39,6 +40,11 @@ on: required: false default: false type: boolean + entries-override: + description: "Optional JSON array of entry IDs to run (overrides get-entries). Example: [\"microsoftInternal__NAV-213524__cf-4\"]" + required: false + default: "" + type: string repeat: description: "Number of times to run sequentially (ignored for test runs)" required: false @@ -60,17 +66,33 @@ env: jobs: get-entries: + if: ${{ inputs.entries-override == '' }} uses: ./.github/workflows/get-entries.yml with: test-run: ${{ inputs.test-run }} category: ${{ inputs.category }} + resolve-entries: + runs-on: ubuntu-latest + needs: get-entries + if: always() + outputs: + entries: ${{ steps.pick.outputs.entries }} + steps: + - id: pick + run: | + if [[ -n "${{ inputs.entries-override }}" ]]; then + echo "entries=${{ inputs.entries-override }}" >> "$GITHUB_OUTPUT" + else + echo 'entries=${{ needs.get-entries.outputs.entries }}' >> "$GITHUB_OUTPUT" + fi + evaluate-with-copilot-cli: runs-on: [ GitHub-BCBench ] - needs: get-entries + needs: resolve-entries outputs: results-dir: ${{ env.EVALUATION_RESULTS_DIR }} - if: needs.get-entries.outputs.entries != '[]' + if: needs.resolve-entries.outputs.entries != '[]' && needs.resolve-entries.outputs.entries != '' environment: name: ado-read deployment: false @@ -82,7 +104,7 @@ jobs: fail-fast: false max-parallel: 32 matrix: - entry: ${{ fromJson(needs.get-entries.outputs.entries) }} + entry: ${{ fromJson(needs.resolve-entries.outputs.entries) }} steps: - name: Checkout repository uses: actions/checkout@v5 diff --git a/.github/workflows/dataset-validation.yml b/.github/workflows/dataset-validation.yml index 50800617c..85e543dc6 100644 --- a/.github/workflows/dataset-validation.yml +++ b/.github/workflows/dataset-validation.yml @@ -10,6 +10,19 @@ on: required: false default: true type: boolean + category: + description: "Dataset category to validate" + required: false + default: "bug-fix" + type: choice + options: + - "bug-fix" + - "cf" + entries-override: + description: "Optional JSON array of entry IDs to validate (overrides get-entries)" + required: false + default: "" + type: string modified-only: description: "Only verify modified entries" required: false @@ -20,16 +33,32 @@ on: jobs: get-entries: + if: ${{ inputs.entries-override == '' || inputs.entries-override == null }} uses: ./.github/workflows/get-entries.yml with: modified-only: ${{ inputs.modified-only || false }} test-run: ${{ inputs.test-run || false }} - category: "bug-fix" + category: ${{ inputs.category || 'bug-fix' }} + + resolve-entries: + runs-on: ubuntu-latest + needs: get-entries + if: always() + outputs: + entries: ${{ steps.pick.outputs.entries }} + steps: + - id: pick + run: | + if [[ -n "${{ inputs.entries-override }}" ]]; then + echo "entries=${{ inputs.entries-override }}" >> "$GITHUB_OUTPUT" + else + echo 'entries=${{ needs.get-entries.outputs.entries }}' >> "$GITHUB_OUTPUT" + fi verify-build-and-tests: runs-on: [GitHub-BCBench] - needs: get-entries - if: needs.get-entries.outputs.entries != '[]' + needs: resolve-entries + if: needs.resolve-entries.outputs.entries != '[]' && needs.resolve-entries.outputs.entries != '' environment: name: ado-read deployment: false @@ -40,7 +69,7 @@ jobs: strategy: fail-fast: false matrix: - entry: ${{ fromJson(needs.get-entries.outputs.entries) }} + entry: ${{ fromJson(needs.resolve-entries.outputs.entries) }} steps: - name: Checkout repository uses: actions/checkout@v5 diff --git a/.github/workflows/summarize-results.yml b/.github/workflows/summarize-results.yml index 54201a583..460df9157 100644 --- a/.github/workflows/summarize-results.yml +++ b/.github/workflows/summarize-results.yml @@ -64,6 +64,7 @@ jobs: retention-days: ${{ inputs.mock && 1 || 30 }} - name: Azure Login with OIDC for bceval package + if: ${{ inputs.category != 'cf' }} uses: azure/login@v3 with: client-id: ${{ secrets.AZURE_CLIENT_ID }} @@ -71,6 +72,7 @@ jobs: allow-no-subscriptions: true - name: Upload result with bceval to Braintrust + if: ${{ inputs.category != 'cf' }} env: BRAINTRUST_PROJECT_ID: ${{ secrets.BRAINTRUST_PROJECT_ID }} BRAINTRUST_API_KEY: ${{ secrets.BRAINTRUST_API_KEY }} @@ -95,7 +97,10 @@ jobs: --tags "${{ inputs.agent }},${MODEL_TAG},${{ inputs.category }}" ${{ !inputs.mock && '--upload-results' || '' }} - name: Update leaderboard in a new branch - if: ${{ !inputs.mock }} + # CF runs only save raw results (per-instance result files + summary artifact); + # they do not contribute to the public leaderboard. Metrics for CF are + # computed offline from the raw results in notebooks. + if: ${{ !inputs.mock && inputs.category != 'cf' }} run: | git fetch origin main diff --git a/COUNTERFACTUAL.md b/COUNTERFACTUAL.md new file mode 100644 index 000000000..00dc13384 --- /dev/null +++ b/COUNTERFACTUAL.md @@ -0,0 +1,120 @@ +# Counterfactual Evaluation + +This document describes the **counterfactual (CF)** categories in BC-Bench. + +## What Are Counterfactual Entries? + +A counterfactual (CF) entry is a **variant** of an existing base bug-fix 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). + +### Validation Contract + +CF entries follow the **exact same** validation contract as bug-fix: + +- **Before** applying the patch → `FAIL_TO_PASS` tests **FAIL** +- **After** applying the patch → `FAIL_TO_PASS` tests **PASS** + +This means the same `BugFixPipeline` is reused for evaluation. + +### Naming Convention + +``` +microsoftInternal__NAV-210528 ← base entry (in bcbench.jsonl) +microsoftInternal__NAV-210528__cf-1 ← first counterfactual variant +microsoftInternal__NAV-210528__cf-2 ← second variant +``` + +## The `cf` Category + +All CF entries are exposed under a single category named `cf`. The base bug-fix +evaluation pipeline is reused as-is. CF runs in CI **only save raw results** +(per-instance result JSONL files + an aggregated `evaluation_summary.json` +artifact); they do not push to the public leaderboard or upload to Braintrust. +Downstream metrics (resolution rate, family fragility, severity, stability, +etc.) are computed offline from the raw results in the analysis notebooks. + +Variant numbering still lives in the instance ID (`__cf-`), so any +per-variant analysis remains possible by grouping on the `__cf-N` suffix. + +All CF entries share: +- **Dataset file**: `counterfactual.jsonl` +- **Entry class**: `CounterfactualEntry` +- **Pipeline**: `BugFixPipeline` (reused) +- **Result class**: `BugFixResult` (reused) +- **Prompt template**: `counterfactual-template` + +## 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 | +| `failure_layer` | Optional failure layer classification | +| `problem_statement_override` | Path to the CF-specific problem statement | +| `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 | + +**Note:** Fields like `repo`, `base_commit`, `project_paths`, `environment_setup_version`, and `created_at` are **not stored** in CF entries. They are resolved at load time from the base entry in `bcbench.jsonl`. + +## Architecture + +The counterfactual categories integrate into BC-Bench's polymorphic category system: + +| Extension Point | Value | +|---|---| +| `EvaluationCategory` | `CF = "cf"` | +| `is_counterfactual` | `True` only for `CF` | +| `prompt_template_key` | `"counterfactual"` | +| `dataset_path` | `dataset/counterfactual.jsonl` | +| `entry_class` | `CounterfactualEntry` (resolves base fields at load time) | +| `pipeline` | `BugFixPipeline` (reused — same FAIL→PASS contract) | +| `result_class` | `BugFixResult` (reused) | +| `summary_class` | `ExecutionBasedEvaluationResultSummary` (reused) | + +### Key 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/counterfactual_entry.py`](src/bcbench/dataset/counterfactual_entry.py) | CF entry model with base resolution | +| [`src/bcbench/types.py`](src/bcbench/types.py) | Category registration (`CF`) | + +## CLI Usage + +```bash +# List all CF entries +uv run bcbench dataset list --category cf + +# List a few random CF entries (test run) +uv run bcbench dataset list --category cf --test-run + +# View a specific CF entry +uv run bcbench dataset view microsoftInternal__NAV-210528__cf-1 --category cf + +# Run agent on a CF entry +uv run bcbench run copilot microsoftInternal__NAV-210528__cf-1 \ + --category cf \ + --repo-path /path/to/NAV + +# Full evaluation (build + test) +uv run bcbench evaluate copilot microsoftInternal__NAV-210528__cf-1 \ + --category cf \ + --repo-path /path/to/NAV +``` + +## Analysis Notebooks + +Experiment notebooks for analyzing CF results are in [`notebooks/counterfactual-evaluation/`](notebooks/counterfactual-evaluation/): + +| Notebook | Purpose | +|---|---| +| `experiment1-base-performance.ipynb` | Instance-level compile/pass rates per model | +| `experiment2-cf-sensitivity.ipynb` | Family fragility rate, severity, pattern analysis | +| `experiment3-layered-failure.ipynb` | L1-L5 failure distribution, layer-conditioned fragility | diff --git a/dataset/counterfactual.jsonl b/dataset/counterfactual.jsonl new file mode 100644 index 000000000..aebac4cb0 --- /dev/null +++ b/dataset/counterfactual.jsonl @@ -0,0 +1,121 @@ +{"instance_id": "microsoftInternal__NAV-174087__cf-1", "base_instance_id": "microsoftInternal__NAV-174087", "variant_description": "CopyFromSegment must execute before Modify in Step 4; step order determines persistence", "failure_layer": null, "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-174087__cf-1", "FAIL_TO_PASS": [{"codeunitID": 136208, "functionName": ["PopulateEvaluationFieldInInteractionLogEntry"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/Marketing/MarketingInteraction.Codeunit.al b/App/Layers/W1/Tests/Marketing/MarketingInteraction.Codeunit.al\nindex 4c4c73700d2a..59fff6e2be93 100644\n--- a/App/Layers/W1/Tests/Marketing/MarketingInteraction.Codeunit.al\n+++ b/App/Layers/W1/Tests/Marketing/MarketingInteraction.Codeunit.al\n@@ -45,6 +45,7 @@ codeunit 136208 \"Marketing Interaction\"\n LoggedSegemntEntriesCreateMsg: Label 'Logged Segment entry was created';\n AttachmentFileShouldNotBeBlankErr: Label 'Attachment File should not be blank.';\n TxtFileExt: Label 'txt';\n+ EvaluationErr: Label '%1 must be %2 in %3', Comment = '%1 = Evaluation, %2 = Positive, %3 = Interaction Log Entry';\n \n [Test]\n [Scope('OnPrem')]\n@@ -2998,6 +2999,50 @@ codeunit 136208 \"Marketing Interaction\"\n VerifyAttachmentFileIsNotBlankOnInteractionLogEntry(Contact.\"No.\");\n end;\n \n+ [Test]\n+ [Scope('OnPrem')]\n+ [HandlerFunctions('CreateInteractionFromContactPageHandler')]\n+ procedure PopulateEvaluationFieldInInteractionLogEntry()\n+ var\n+ Contact: Record Contact;\n+ InteractionTemplate: Record \"Interaction Template\";\n+ InteractionLogEntry: Record \"Interaction Log Entry\";\n+ ContactCard: TestPage \"Contact Card\";\n+ InteractionEvaluation: Enum \"Interaction Evaluation\";\n+ begin\n+ // [SCENARIO 498395] When stan creates an Interaction using Create Interaction action from Contact, Evaluation field should be populated in Interaction Log Entry.\n+ Initialize();\n+\n+ // [GIVEN] Create a Contact.\n+ LibraryMarketing.CreateCompanyContact(Contact);\n+\n+ // [GIVEN] Create an Interaction Template and Validate Information Flow.\n+ LibraryMarketing.CreateInteractionTemplate(InteractionTemplate);\n+ InteractionTemplate.Validate(\"Information Flow\", InteractionTemplate.\"Information Flow\"::Outbound);\n+ InteractionTemplate.Modify(true);\n+\n+ // [GIVEN] Open Contact Card and Create Interaction.\n+ ContactCard.OpenEdit();\n+ ContactCard.GoToRecord(Contact);\n+ LibraryVariableStorage.Enqueue(InteractionTemplate.Code);\n+ LibraryVariableStorage.Enqueue(Format(InteractionEvaluation::Positive));\n+ ContactCard.\"Create &Interaction\".Invoke();\n+\n+ // [WHEN] Find Interaction Log Entry.\n+ InteractionLogEntry.SetRange(\"Contact No.\", Contact.\"No.\");\n+ InteractionLogEntry.FindFirst();\n+\n+ // [VERIFY] Interaction Log Entry has Evaluation field populated as Positive.\n+ Assert.AreEqual(\n+ InteractionEvaluation::Positive,\n+ InteractionLogEntry.Evaluation,\n+ StrSubstNo(\n+ EvaluationErr,\n+ InteractionLogEntry.FieldCaption(Evaluation),\n+ InteractionEvaluation::Positive,\n+ InteractionLogEntry.TableCaption));\n+ end;\n+\n local procedure Initialize()\n var\n LibrarySales: Codeunit \"Library - Sales\";\n@@ -4309,5 +4354,16 @@ CopyStr(StorageLocation, 1, MaxStrLen(MarketingSetup.\"Attachment Storage Locatio\n CreateInteraction.NextInteraction.Invoke();\n CreateInteraction.Finish.Invoke();\n end;\n+\n+ [ModalPageHandler]\n+ [Scope('OnPrem')]\n+ procedure CreateInteractionFromContactPageHandler(var CreateInteraction: TestPage \"Create Interaction\")\n+ begin\n+ CreateInteraction.\"Interaction Template Code\".SetValue(LibraryVariableStorage.DequeueText());\n+ CreateInteraction.NextInteraction.Invoke();\n+ CreateInteraction.NextInteraction.Invoke();\n+ CreateInteraction.Evaluation.SetValue(LibraryVariableStorage.DequeueText());\n+ CreateInteraction.FinishInteraction.Invoke();\n+ end;\n }\n \n", "patch": "diff --git a/App/Layers/W1/BaseApp/CRM/Segment/CreateInteraction.Page.al b/App/Layers/W1/BaseApp/CRM/Segment/CreateInteraction.Page.al\nindex ff43f4ff6a7b..cf00000001 100644\n--- a/App/Layers/W1/BaseApp/CRM/Segment/CreateInteraction.Page.al\n+++ b/App/Layers/W1/BaseApp/CRM/Segment/CreateInteraction.Page.al\n@@ -694,6 +694,7 @@ page 5077 \"Create Interaction\"\n end;\n Step::\"Step 4\":\n begin\n+ InteractionLogEntry.CopyFromSegment(Rec);\n InteractionLogEntry.Modify();\n CurrPage.Close();\n end;\n"} +{"instance_id": "microsoftInternal__NAV-174087__cf-2", "base_instance_id": "microsoftInternal__NAV-174087", "variant_description": "Evaluation persisted via OnModify trigger on Interaction Log Entry instead of page workflow step", "failure_layer": null, "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-174087__cf-2", "FAIL_TO_PASS": [{"codeunitID": 136208, "functionName": ["PopulateEvaluationFieldInInteractionLogEntry"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/Marketing/MarketingInteraction.Codeunit.al b/App/Layers/W1/Tests/Marketing/MarketingInteraction.Codeunit.al\nindex 4c4c737..59fff6e 100644\n--- a/App/Layers/W1/Tests/Marketing/MarketingInteraction.Codeunit.al\n+++ b/App/Layers/W1/Tests/Marketing/MarketingInteraction.Codeunit.al\n@@ -45,6 +45,7 @@ codeunit 136208 \"Marketing Interaction\"\n LoggedSegemntEntriesCreateMsg: Label 'Logged Segment entry was created';\n AttachmentFileShouldNotBeBlankErr: Label 'Attachment File should not be blank.';\n TxtFileExt: Label 'txt';\n+ EvaluationErr: Label '%1 must be %2 in %3', Comment = '%1 = Evaluation, %2 = Positive, %3 = Interaction Log Entry';\n \n [Test]\n [Scope('OnPrem')]\n@@ -2998,6 +2999,50 @@ codeunit 136208 \"Marketing Interaction\"\n VerifyAttachmentFileIsNotBlankOnInteractionLogEntry(Contact.\"No.\");\n end;\n \n+ [Test]\n+ [Scope('OnPrem')]\n+ [HandlerFunctions('CreateInteractionFromContactPageHandler')]\n+ procedure PopulateEvaluationFieldInInteractionLogEntry()\n+ var\n+ Contact: Record Contact;\n+ InteractionTemplate: Record \"Interaction Template\";\n+ InteractionLogEntry: Record \"Interaction Log Entry\";\n+ ContactCard: TestPage \"Contact Card\";\n+ InteractionEvaluation: Enum \"Interaction Evaluation\";\n+ begin\n+ // [SCENARIO 498395] When stan creates an Interaction using Create Interaction action from Contact, Evaluation field should be populated in Interaction Log Entry.\n+ Initialize();\n+\n+ // [GIVEN] Create a Contact.\n+ LibraryMarketing.CreateCompanyContact(Contact);\n+\n+ // [GIVEN] Create an Interaction Template and Validate Information Flow.\n+ LibraryMarketing.CreateInteractionTemplate(InteractionTemplate);\n+ InteractionTemplate.Validate(\"Information Flow\", InteractionTemplate.\"Information Flow\"::Outbound);\n+ InteractionTemplate.Modify(true);\n+\n+ // [GIVEN] Open Contact Card and Create Interaction.\n+ ContactCard.OpenEdit();\n+ ContactCard.GoToRecord(Contact);\n+ LibraryVariableStorage.Enqueue(InteractionTemplate.Code);\n+ LibraryVariableStorage.Enqueue(Format(InteractionEvaluation::Positive));\n+ ContactCard.\"Create &Interaction\".Invoke();\n+\n+ // [WHEN] Find Interaction Log Entry.\n+ InteractionLogEntry.SetRange(\"Contact No.\", Contact.\"No.\");\n+ InteractionLogEntry.FindFirst();\n+\n+ // [VERIFY] Interaction Log Entry has Evaluation field populated as Positive.\n+ Assert.AreEqual(\n+ InteractionEvaluation::Positive,\n+ InteractionLogEntry.Evaluation,\n+ StrSubstNo(\n+ EvaluationErr,\n+ InteractionLogEntry.FieldCaption(Evaluation),\n+ InteractionEvaluation::Positive,\n+ InteractionLogEntry.TableCaption));\n+ end;\n+\n local procedure Initialize()\n var\n LibrarySales: Codeunit \"Library - Sales\";\n@@ -4309,5 +4354,16 @@ CopyStr(StorageLocation, 1, MaxStrLen(MarketingSetup.\"Attachment Storage Locatio\n CreateInteraction.NextInteraction.Invoke();\n CreateInteraction.Finish.Invoke();\n end;\n+\n+ [ModalPageHandler]\n+ [Scope('OnPrem')]\n+ procedure CreateInteractionFromContactPageHandler(var CreateInteraction: TestPage \"Create Interaction\")\n+ begin\n+ CreateInteraction.\"Interaction Template Code\".SetValue(LibraryVariableStorage.DequeueText());\n+ CreateInteraction.NextInteraction.Invoke();\n+ CreateInteraction.NextInteraction.Invoke();\n+ CreateInteraction.Evaluation.SetValue(LibraryVariableStorage.DequeueText());\n+ CreateInteraction.FinishInteraction.Invoke();\n+ end;\n }\n \n", "patch": "diff --git a/App/Layers/W1/BaseApp/CRM/Segment/CreateInteraction.Page.al b/App/Layers/W1/BaseApp/CRM/Segment/CreateInteraction.Page.al\nindex ff43f4ff6a7b..cf00000002 100644\n--- a/App/Layers/W1/BaseApp/CRM/Segment/CreateInteraction.Page.al\n+++ b/App/Layers/W1/BaseApp/CRM/Segment/CreateInteraction.Page.al\n@@ -694,6 +694,7 @@ page 5077 \"Create Interaction\"\n end;\n Step::\"Step 4\":\n begin\n+ InteractionLogEntry.Evaluation := Rec.Evaluation;\n InteractionLogEntry.Modify();\n CurrPage.Close();\n end;\n"} +{"instance_id": "microsoftInternal__NAV-174794__cf-1", "base_instance_id": "microsoftInternal__NAV-174794", "variant_description": "Allow Multiple Posting Groups setting ignored during Finance Charge Memo posting", "failure_layer": null, "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-174794__cf-1", "FAIL_TO_PASS": [{"codeunitID": 134911, "functionName": ["IssueFinChargeMemoCreatesGLEntryOfAltCustPostingGrpIfAllowMultiPostingGrps"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/ERMCreateFinanceChargeMemo.Codeunit.al b/App/Layers/W1/Tests/ERM/ERMCreateFinanceChargeMemo.Codeunit.al\nindex 95a8024..b5816d9 100644\n--- a/App/Layers/W1/Tests/ERM/ERMCreateFinanceChargeMemo.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ERMCreateFinanceChargeMemo.Codeunit.al\n@@ -28,6 +28,7 @@ codeunit 134911 \"ERM Create Finance Charge Memo\"\n PrintDocRef: Option \" \",Print,Email;\n EmailTxt: Label 'abc@microsoft.com', Locked = true;\n ProceedOnIssuingWithInvRoundingQst: Label 'The invoice rounding amount will be added to the finance charge memo when it is posted according to invoice rounding setup.\\Do you want to continue?';\n+ GLEntryMustNotBeEmpty: Label 'GL Entry for alternate posting group must not be empty when Allow Multiple Posting Groups is enabled.';\n \n [Test]\n [Scope('OnPrem')]\n@@ -465,6 +466,71 @@ codeunit 134911 \"ERM Create Finance Charge Memo\"\n \n end;\n \n+ [Test]\n+ [Scope('OnPrem')]\n+ procedure IssueFinChargeMemoCreatesGLEntryOfAltCustPostingGrpIfAllowMultiPostingGrps()\n+ var\n+ Customer: Record Customer;\n+ CustomerPostingGroup: Record \"Customer Posting Group\";\n+ CustomerPostingGroup2: Record \"Customer Posting Group\";\n+ FinanceChargeMemoHeader: Record \"Finance Charge Memo Header\";\n+ FinanceChargeMemoLine: Record \"Finance Charge Memo Line\";\n+ SalesReceivablesSetup: Record \"Sales & Receivables Setup\";\n+ IssueFinChargeMemoHeader: Record \"Issued Fin. Charge Memo Header\";\n+ GLEntry: Record \"G/L Entry\";\n+ FinChargeTermsCode: Code[10];\n+ begin\n+ // [SCENARIO 498604] When stan Issue a Finance Charge Memo having Alternate Customer Posting Group of Customer having Allow Multiple Posting Groups as true then it creates GL Entry of Alternate Customer Posting Group's Receivables Account.\n+ Initialize();\n+\n+ // [GIVEN] Validate Allow Multiple Posting Groups in Sales & Receivables Setup.\n+ SalesReceivablesSetup.Get();\n+ SalesReceivablesSetup.Validate(\"Allow Multiple Posting Groups\", false);\n+ SalesReceivablesSetup.Modify(true);\n+\n+ // [GIVEN] Create Finance Charge Terms.\n+ FinChargeTermsCode := CreateFinanceChargeTerms(LibraryRandom.RandInt(0));\n+\n+ // [GIVEN] Create Customer Posting Group.\n+ LibrarySales.CreateCustomerPostingGroup(CustomerPostingGroup2);\n+\n+ // [GIVEN] Create Customer Posting group 2.\n+ LibrarySales.CreateCustomerPostingGroup(CustomerPostingGroup);\n+\n+ // [GIVEN] Create Alternate Customer Posting Group.\n+ LibrarySales.CreateAltCustomerPostingGroup(CustomerPostingGroup.Code, CustomerPostingGroup2.Code);\n+\n+ // [GIVEN] Create Customer and Validate Customer Posting Group,\n+ // Allow Multiple Posting Groups and Fin. Charge Terms Code.\n+ LibrarySales.CreateCustomer(Customer);\n+ Customer.Validate(\"Customer Posting Group\", CustomerPostingGroup.Code);\n+ Customer.Validate(\"Allow Multiple Posting Groups\", true);\n+ Customer.Validate(\"Fin. Charge Terms Code\", FinChargeTermsCode);\n+ Customer.Modify(true);\n+\n+ // [GIVEN] Create Finance Charge Memo Header and Validate Customer Posting Group.\n+ LibraryERM.CreateFinanceChargeMemoHeader(FinanceChargeMemoHeader, Customer.\"No.\");\n+ FinanceChargeMemoHeader.Validate(\"Customer Posting Group\", CustomerPostingGroup2.Code);\n+ FinanceChargeMemoHeader.Modify(true);\n+\n+ // [GIVEN] Create Finance Charge Memo Line.\n+ CreateFinChargeMemoLineForInvRounding(FinanceChargeMemoLine, FinanceChargeMemoHeader, LibraryRandom.RandInt(0));\n+\n+ // [GIVEN] Issue Finance Charge Memo.\n+ LibraryERM.IssueFinanceChargeMemo(FinanceChargeMemoHeader);\n+\n+ // [GIVEN] Find Issued Fin. Charge Memo Header.\n+ IssueFinChargeMemoHeader.SetRange(\"Customer No.\", Customer.\"No.\");\n+ IssueFinChargeMemoHeader.FindFirst();\n+\n+ // [WHEN] Find GL Entry.\n+ GLEntry.SetRange(\"Document No.\", IssueFinChargeMemoHeader.\"No.\");\n+ GLEntry.SetRange(\"G/L Account No.\", CustomerPostingGroup2.\"Receivables Account\");\n+\n+ // [VERIFY] GL Entry uses alternate posting group when Allow Multiple Posting Groups is enabled.\n+ Assert.IsFalse(GLEntry.IsEmpty(), GLEntryMustNotBeEmpty);\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/FinanceCharge/FinChrgMemoIssue.Codeunit.al b/App/Layers/W1/BaseApp/Sales/FinanceCharge/FinChrgMemoIssue.Codeunit.al\nindex b941d50..2ba1b10 100644\n--- a/App/Layers/W1/BaseApp/Sales/FinanceCharge/FinChrgMemoIssue.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Sales/FinanceCharge/FinChrgMemoIssue.Codeunit.al\n@@ -278,6 +278,8 @@ codeunit 395 \"FinChrgMemo-Issue\"\n TempGenJnlLine.\"Account Type\" := AccType;\n TempGenJnlLine.\"Account No.\" := AccNo;\n TempGenJnlLine.Validate(\"Account No.\");\n+ if FinChrgMemoHeader.\"Customer Posting Group\" <> '' then\n+ TempGenJnlLine.\"Posting Group\" := FinChrgMemoHeader.\"Customer Posting Group\";\n if TempGenJnlLine.\"Account Type\" = TempGenJnlLine.\"Account Type\"::\"G/L Account\" then begin\n TempGenJnlLine.\"Gen. Posting Type\" := TempGenJnlLine.\"Gen. Posting Type\"::Sale;\n TempGenJnlLine.\"Gen. Bus. Posting Group\" := FinChrgMemoHeader.\"Gen. Bus. Posting Group\";\n"} +{"instance_id": "microsoftInternal__NAV-174794__cf-2", "base_instance_id": "microsoftInternal__NAV-174794", "variant_description": "Posting group propagated inside G/L Account branch only instead of for all account types", "failure_layer": null, "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-174794__cf-2", "FAIL_TO_PASS": [{"codeunitID": 134911, "functionName": ["IssueFinChargeMemoCreatesGLEntryOfAltCustPostingGrpIfAllowMultiPostingGrps"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/ERMCreateFinanceChargeMemo.Codeunit.al b/App/Layers/W1/Tests/ERM/ERMCreateFinanceChargeMemo.Codeunit.al\nindex 95a8024..ffec26a 100644\n--- a/App/Layers/W1/Tests/ERM/ERMCreateFinanceChargeMemo.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ERMCreateFinanceChargeMemo.Codeunit.al\n@@ -28,6 +28,7 @@ codeunit 134911 \"ERM Create Finance Charge Memo\"\n PrintDocRef: Option \" \",Print,Email;\n EmailTxt: Label 'abc@microsoft.com', Locked = true;\n ProceedOnIssuingWithInvRoundingQst: Label 'The invoice rounding amount will be added to the finance charge memo when it is posted according to invoice rounding setup.\\Do you want to continue?';\n+ GLEntryMustNotBeEmpty: Label 'GL Entry must not be empty.';\n \n [Test]\n [Scope('OnPrem')]\n@@ -465,6 +466,71 @@ codeunit 134911 \"ERM Create Finance Charge Memo\"\n \n end;\n \n+ [Test]\n+ [Scope('OnPrem')]\n+ procedure IssueFinChargeMemoCreatesGLEntryOfAltCustPostingGrpIfAllowMultiPostingGrps()\n+ var\n+ Customer: Record Customer;\n+ CustomerPostingGroup: Record \"Customer Posting Group\";\n+ CustomerPostingGroup2: Record \"Customer Posting Group\";\n+ FinanceChargeMemoHeader: Record \"Finance Charge Memo Header\";\n+ FinanceChargeMemoLine: Record \"Finance Charge Memo Line\";\n+ SalesReceivablesSetup: Record \"Sales & Receivables Setup\";\n+ IssueFinChargeMemoHeader: Record \"Issued Fin. Charge Memo Header\";\n+ GLEntry: Record \"G/L Entry\";\n+ FinChargeTermsCode: Code[10];\n+ begin\n+ // [SCENARIO 498604] When stan Issue a Finance Charge Memo having Alternate Customer Posting Group of Customer having Allow Multiple Posting Groups as true then it creates GL Entry of Alternate Customer Posting Group's Receivables Account.\n+ Initialize();\n+\n+ // [GIVEN] Validate Allow Multiple Posting Groups in Sales & Receivables Setup.\n+ SalesReceivablesSetup.Get();\n+ SalesReceivablesSetup.Validate(\"Allow Multiple Posting Groups\", true);\n+ SalesReceivablesSetup.Modify(true);\n+\n+ // [GIVEN] Create Finance Charge Terms.\n+ FinChargeTermsCode := CreateFinanceChargeTerms(LibraryRandom.RandInt(0));\n+\n+ // [GIVEN] Create Customer Posting Group.\n+ LibrarySales.CreateCustomerPostingGroup(CustomerPostingGroup2);\n+\n+ // [GIVEN] Create Customer Posting group 2.\n+ LibrarySales.CreateCustomerPostingGroup(CustomerPostingGroup);\n+\n+ // [GIVEN] Create Alternate Customer Posting Group.\n+ LibrarySales.CreateAltCustomerPostingGroup(CustomerPostingGroup.Code, CustomerPostingGroup2.Code);\n+\n+ // [GIVEN] Create Customer and Validate Customer Posting Group,\n+ // Allow Multiple Posting Groups and Fin. Charge Terms Code.\n+ LibrarySales.CreateCustomer(Customer);\n+ Customer.Validate(\"Customer Posting Group\", CustomerPostingGroup.Code);\n+ Customer.Validate(\"Allow Multiple Posting Groups\", true);\n+ Customer.Validate(\"Fin. Charge Terms Code\", FinChargeTermsCode);\n+ Customer.Modify(true);\n+\n+ // [GIVEN] Create Finance Charge Memo Header and Validate Customer Posting Group.\n+ LibraryERM.CreateFinanceChargeMemoHeader(FinanceChargeMemoHeader, Customer.\"No.\");\n+ FinanceChargeMemoHeader.Validate(\"Customer Posting Group\", CustomerPostingGroup2.Code);\n+ FinanceChargeMemoHeader.Modify(true);\n+\n+ // [GIVEN] Create Finance Charge Memo Line.\n+ CreateFinChargeMemoLineForInvRounding(FinanceChargeMemoLine, FinanceChargeMemoHeader, LibraryRandom.RandInt(0));\n+\n+ // [GIVEN] Issue Finance Charge Memo.\n+ LibraryERM.IssueFinanceChargeMemo(FinanceChargeMemoHeader);\n+\n+ // [GIVEN] Find Issued Fin. Charge Memo Header.\n+ IssueFinChargeMemoHeader.SetRange(\"Customer No.\", Customer.\"No.\");\n+ IssueFinChargeMemoHeader.FindFirst();\n+\n+ // [WHEN] Find GL Entry.\n+ GLEntry.SetRange(\"Document No.\", IssueFinChargeMemoHeader.\"No.\");\n+ GLEntry.SetRange(\"G/L Account No.\", CustomerPostingGroup2.\"Receivables Account\");\n+\n+ // [VERIFY] GL Entry has Receivables Account of Customer Posting Group 2 in GL Account No.\n+ Assert.IsFalse(GLEntry.IsEmpty(), GLEntryMustNotBeEmpty);\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/FinanceCharge/FinChrgMemoIssue.Codeunit.al b/App/Layers/W1/BaseApp/Sales/FinanceCharge/FinChrgMemoIssue.Codeunit.al\nindex b941d50..0000004 100644\n--- a/App/Layers/W1/BaseApp/Sales/FinanceCharge/FinChrgMemoIssue.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Sales/FinanceCharge/FinChrgMemoIssue.Codeunit.al\n@@ -283,6 +283,7 @@ codeunit 395 \"FinChrgMemo-Issue\"\n TempGenJnlLine.\"Gen. Bus. Posting Group\" := FinChrgMemoHeader.\"Gen. Bus. Posting Group\";\n TempGenJnlLine.\"VAT Bus. Posting Group\" := FinChrgMemoHeader.\"VAT Bus. Posting Group\";\n end;\n+ TempGenJnlLine.\"Posting Group\" := FinChrgMemoHeader.\"Customer Posting Group\";\n TempGenJnlLine.Validate(\"Currency Code\", FinChrgMemoHeader.\"Currency Code\");\n if TempGenJnlLine.\"Account Type\" = TempGenJnlLine.\"Account Type\"::Customer then begin\n TempGenJnlLine.Validate(Amount, TotalAmount);\n"} +{"instance_id": "microsoftInternal__NAV-174794__cf-3", "base_instance_id": "microsoftInternal__NAV-174794", "variant_description": "Posting group from header only when Allow Multiple Posting Groups enabled on customer", "failure_layer": null, "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-174794__cf-3", "FAIL_TO_PASS": [{"codeunitID": 134911, "functionName": ["IssueFinChargeMemoCreatesGLEntryOfAltCustPostingGrpIfAllowMultiPostingGrps"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/ERMCreateFinanceChargeMemo.Codeunit.al b/App/Layers/W1/Tests/ERM/ERMCreateFinanceChargeMemo.Codeunit.al\nindex 95a8024d1290..07fdee93db4b 100644\n--- a/App/Layers/W1/Tests/ERM/ERMCreateFinanceChargeMemo.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ERMCreateFinanceChargeMemo.Codeunit.al\n@@ -28,6 +28,7 @@ codeunit 134911 \"ERM Create Finance Charge Memo\"\n PrintDocRef: Option \" \",Print,Email;\n EmailTxt: Label 'abc@microsoft.com', Locked = true;\n ProceedOnIssuingWithInvRoundingQst: Label 'The invoice rounding amount will be added to the finance charge memo when it is posted according to invoice rounding setup.\\Do you want to continue?';\n+ GLEntryMustNotBeEmpty: Label 'GL Entry must not be empty.';\n \n [Test]\n [Scope('OnPrem')]\n@@ -465,6 +466,71 @@ codeunit 134911 \"ERM Create Finance Charge Memo\"\n \n end;\n \n+ [Test]\n+ [Scope('OnPrem')]\n+ procedure IssueFinChargeMemoCreatesGLEntryOfAltCustPostingGrpIfAllowMultiPostingGrps()\n+ var\n+ Customer: Record Customer;\n+ CustomerPostingGroup: Record \"Customer Posting Group\";\n+ CustomerPostingGroup2: Record \"Customer Posting Group\";\n+ FinanceChargeMemoHeader: Record \"Finance Charge Memo Header\";\n+ FinanceChargeMemoLine: Record \"Finance Charge Memo Line\";\n+ SalesReceivablesSetup: Record \"Sales & Receivables Setup\";\n+ IssueFinChargeMemoHeader: Record \"Issued Fin. Charge Memo Header\";\n+ GLEntry: Record \"G/L Entry\";\n+ FinChargeTermsCode: Code[10];\n+ begin\n+ // [SCENARIO 498604] When stan Issue a Finance Charge Memo having Alternate Customer Posting Group of Customer having Allow Multiple Posting Groups as true then it creates GL Entry of Alternate Customer Posting Group's Receivables Account.\n+ Initialize();\n+\n+ // [GIVEN] Validate Allow Multiple Posting Groups in Sales & Receivables Setup.\n+ SalesReceivablesSetup.Get();\n+ SalesReceivablesSetup.Validate(\"Allow Multiple Posting Groups\", true);\n+ SalesReceivablesSetup.Modify(true);\n+\n+ // [GIVEN] Create Finance Charge Terms.\n+ FinChargeTermsCode := CreateFinanceChargeTerms(LibraryRandom.RandInt(0));\n+\n+ // [GIVEN] Create Customer Posting Group.\n+ LibrarySales.CreateCustomerPostingGroup(CustomerPostingGroup2);\n+\n+ // [GIVEN] Create Customer Posting group 2.\n+ LibrarySales.CreateCustomerPostingGroup(CustomerPostingGroup);\n+\n+ // [GIVEN] Create Alternate Customer Posting Group.\n+ LibrarySales.CreateAltCustomerPostingGroup(CustomerPostingGroup.Code, CustomerPostingGroup2.Code);\n+\n+ // [GIVEN] Create Customer and Validate Customer Posting Group,\n+ // Allow Multiple Posting Groups and Fin. Charge Terms Code.\n+ LibrarySales.CreateCustomer(Customer);\n+ Customer.Validate(\"Customer Posting Group\", CustomerPostingGroup.Code);\n+ Customer.Validate(\"Allow Multiple Posting Groups\", true);\n+ Customer.Validate(\"Fin. Charge Terms Code\", FinChargeTermsCode);\n+ Customer.Modify(true);\n+\n+ // [GIVEN] Create Finance Charge Memo Header and Validate Customer Posting Group.\n+ LibraryERM.CreateFinanceChargeMemoHeader(FinanceChargeMemoHeader, Customer.\"No.\");\n+ FinanceChargeMemoHeader.Validate(\"Customer Posting Group\", CustomerPostingGroup2.Code);\n+ FinanceChargeMemoHeader.Modify(true);\n+\n+ // [GIVEN] Create Finance Charge Memo Line.\n+ CreateFinChargeMemoLineForInvRounding(FinanceChargeMemoLine, FinanceChargeMemoHeader, LibraryRandom.RandInt(0));\n+\n+ // [GIVEN] Issue Finance Charge Memo.\n+ LibraryERM.IssueFinanceChargeMemo(FinanceChargeMemoHeader);\n+\n+ // [GIVEN] Find Issued Fin. Charge Memo Header.\n+ IssueFinChargeMemoHeader.SetRange(\"Customer No.\", Customer.\"No.\");\n+ IssueFinChargeMemoHeader.FindFirst();\n+\n+ // [WHEN] Find GL Entry.\n+ GLEntry.SetRange(\"Document No.\", IssueFinChargeMemoHeader.\"No.\");\n+ GLEntry.SetRange(\"G/L Account No.\", CustomerPostingGroup2.\"Receivables Account\");\n+\n+ // [VERIFY] GL Entry has Receivables Account of Customer Posting Group 2 in GL Account No. \n+ Assert.IsFalse(GLEntry.IsEmpty(), GLEntryMustNotBeEmpty);\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/FinanceCharge/FinChrgMemoIssue.Codeunit.al b/App/Layers/W1/BaseApp/Sales/FinanceCharge/FinChrgMemoIssue.Codeunit.al\nindex b941d50..83afc21 100644\n--- a/App/Layers/W1/BaseApp/Sales/FinanceCharge/FinChrgMemoIssue.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Sales/FinanceCharge/FinChrgMemoIssue.Codeunit.al\n@@ -151,6 +151,8 @@ codeunit 395 \"FinChrgMemo-Issue\"\n \n if (TotalAmount <> 0) or (TotalAmountLCY <> 0) then begin\n InitGenJnlLine(TempGenJnlLine.\"Account Type\"::Customer, FinChrgMemoHeader.\"Customer No.\", true);\n+ if Customer.\"Allow Multiple Posting Groups\" then\n+ TempGenJnlLine.\"Posting Group\" := FinChrgMemoHeader.\"Customer Posting Group\";\n TempGenJnlLine.Validate(Amount, TotalAmount);\n TempGenJnlLine.Validate(\"Amount (LCY)\", TotalAmountLCY);\n OnRunOnBeforeTotalGenJnlLineInsert(TempGenJnlLine);\n"} +{"instance_id": "microsoftInternal__NAV-175765__cf-1", "base_instance_id": "microsoftInternal__NAV-175765", "variant_description": "Undo transfer shipment without running second cost adjustment", "failure_layer": null, "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-175765__cf-1", "FAIL_TO_PASS": [{"codeunitID": 137038, "functionName": ["AdjustCostOfUndoneTransferShipment"]}], "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@@ -3595,6 +3595,65 @@\n PostedTranferReceipt.Close();\n end;\n \n+ [Test]\n+ [HandlerFunctions('ConfirmHandlerYes')]\n+ [Scope('OnPrem')]\n+ procedure AdjustCostOfUndoneTransferShipment()\n+ var\n+ Item: Record Item;\n+ InTransitLocation: Record Location;\n+ TransferHeader: Record \"Transfer Header\";\n+ TransferLine: Record \"Transfer Line\";\n+ ItemLedgerEntry: Record \"Item Ledger Entry\";\n+ ItemLedgerEntryNo: Integer;\n+ LocationFromCode, LocationTOCode : Code[10];\n+ OldCost, NewCost : Decimal;\n+ begin\n+ // [FEATURE] [Transfer] [Undo Shipment] [Costing] [Adjust Cost - Item Entries]\n+ // [SCENARIO 496575] Item ledger entry for undone transfer shipment is adjusted with the correct cost.\n+ Initialize();\n+ OldCost := LibraryRandom.RandDec(100, 2);\n+ NewCost := LibraryRandom.RandDecInDecimalRange(101, 200, 2);\n+\n+ // [GIVEN] Item \"I\".\n+ // [GIVEN] Locations \"From\" and \"To\".\n+ LibraryInventory.CreateItem(Item);\n+ CreateLocations(LocationFromCode, LocationToCode);\n+ LibraryWarehouse.CreateInTransitLocation(InTransitLocation);\n+\n+ // [GIVEN] Post inventory adjustment of \"I\" to location \"From\". Unit Cost = 10.\n+ CreateAndPostItemJnlWithCostLocationVariant(\n+ \"Item Ledger Entry Type\"::\"Positive Adjmt.\", Item.\"No.\", 1, OldCost, LocationFromCode, '');\n+ ItemLedgerEntryNo := FindLastILENo(Item.\"No.\");\n+\n+ // [GIVEN] Create transfer order from \"From\" to \"To\".\n+ // [GIVEN] Ship the transfer order.\n+ LibraryInventory.CreateTransferHeader(TransferHeader, LocationFromCode, LocationToCode, InTransitLocation.Code);\n+ LibraryInventory.CreateTransferLine(TransferHeader, TransferLine, Item.\"No.\", 1);\n+ LibraryInventory.PostTransferHeader(TransferHeader, true, false);\n+\n+ // [GIVEN] Revaluate the item entry for the inventory adjustment, new cost = 12.\n+ CreateAndPostRevaluationJournal(Item.\"No.\", ItemLedgerEntryNo, 1, NewCost);\n+\n+ // [GIVEN] Adjust cost.\n+ LibraryCosting.AdjustCostItemEntries(Item.\"No.\", '');\n+\n+ // [WHEN] Undo the transfer shipment without running cost adjustment.\n+ LibraryInventory.UndoTransferShipments(TransferHeader.\"No.\");\n+\n+ // [THEN] Unit cost of \"I\" = OldCost (not propagated).\n+ Item.Find();\n+ Item.TestField(\"Unit Cost\", NewCost);\n+\n+ // [THEN] Item ledger entry for the undone transfer shipment has old cost.\n+ ItemLedgerEntry.Get(FindLastILENo(Item.\"No.\"));\n+ ItemLedgerEntry.TestField(\"Entry Type\", ItemLedgerEntry.\"Entry Type\"::Transfer);\n+ ItemLedgerEntry.TestField(\"Location Code\", LocationFromCode);\n+ ItemLedgerEntry.TestField(Positive, true);\n+ ItemLedgerEntry.CalcFields(\"Cost Amount (Actual)\");\n+ ItemLedgerEntry.TestField(\"Cost Amount (Actual)\", NewCost);\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n@@ -3708,6 +3768,26 @@\n UpdateLocation(LocationCode[5], true, HandlingTime2, HandlingTime2);\n end;\n \n+ local procedure CreateAndPostRevaluationJournal(ItemNo: Code[20]; AppliesToEntry: Integer; InventoryValueRevalued: Decimal; UnitCostRevalued: 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::Revaluation);\n+ LibraryInventory.CreateItemJournalBatch(ItemJournalBatch, ItemJournalTemplate.Name);\n+ ItemJournalLine.Validate(\"Journal Template Name\", ItemJournalBatch.\"Journal Template Name\");\n+ ItemJournalLine.Validate(\"Journal Batch Name\", ItemJournalBatch.Name);\n+ LibraryInventory.CreateItemJournalLine(\n+ ItemJournalLine, ItemJournalBatch.\"Journal Template Name\", ItemJournalBatch.Name, ItemJournalLine.\"Entry Type\"::\" \", ItemNo, 0);\n+ ItemJournalLine.Validate(\"Value Entry Type\", ItemJournalLine.\"Value Entry Type\"::Revaluation);\n+ ItemJournalLine.Validate(\"Applies-to Entry\", AppliesToEntry);\n+ ItemJournalLine.Validate(\"Inventory Value (Revalued)\", InventoryValueRevalued);\n+ ItemJournalLine.Validate(\"Unit Cost (Revalued)\", UnitCostRevalued);\n+ ItemJournalLine.Modify(true);\n+ LibraryInventory.PostItemJournalLine(ItemJournalBatch.\"Journal Template Name\", ItemJournalBatch.Name);\n+ end;\n+\n local procedure PostTransferShipmentPartiallyWithBlockedItem(DirectTransfer: Boolean)\n var\n Location: array[3] of Record Location;\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Inventory/Posting/ItemJnlPostLine.Codeunit.al b/App/Layers/W1/BaseApp/Inventory/Posting/ItemJnlPostLine.Codeunit.al\n--- a/App/Layers/W1/BaseApp/Inventory/Posting/ItemJnlPostLine.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Posting/ItemJnlPostLine.Codeunit.al\n@@ -7182,6 +7182,19 @@ codeunit 22 \"Item Jnl.-Post Line\"\n Error(Text027);\n end;\n \n+ procedure MarkAppliedInboundItemEntriesForAdjustment(OutboundItemLedgerEntryNo: Integer)\n+ var\n+ InboundItemLedgerEntry: Record \"Item Ledger Entry\";\n+ ItemApplicationEntry: Record \"Item Application Entry\";\n+ begin\n+ if ItemApplicationEntry.GetInboundEntriesTheOutbndEntryAppliedTo(OutboundItemLedgerEntryNo) then\n+ repeat\n+ InboundItemLedgerEntry.SetLoadFields(\"Applied Entry to Adjust\");\n+ InboundItemLedgerEntry.Get(ItemApplicationEntry.\"Inbound Item Entry No.\");\n+ InboundItemLedgerEntry.SetAppliedEntryToAdjust(true);\n+ until ItemApplicationEntry.Next() = 0;\n+ end;\n+\n [IntegrationEvent(false, false)]\n local procedure OnVerifyInvoicedQtyOnAfterGetSalesShipmentHeader(ItemLedgEntry2: Record \"Item Ledger Entry\"; var IsHandled: Boolean)\n begin\ndiff --git a/App/Layers/W1/BaseApp/Inventory/Transfer/UndoTransferShipment.Codeunit.al b/App/Layers/W1/BaseApp/Inventory/Transfer/UndoTransferShipment.Codeunit.al\n--- a/App/Layers/W1/BaseApp/Inventory/Transfer/UndoTransferShipment.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Transfer/UndoTransferShipment.Codeunit.al\n@@ -332,13 +332,18 @@ codeunit 9030 \"Undo Transfer Shipment\"\n until TempItemEntryRelation.Next() = 0;\n end;\n \n- local procedure GetShptEntries(TransShptLine: Record \"Transfer Shipment Line\"; var ItemLedgEntry: Record \"Item Ledger Entry\"): Boolean\n+ local procedure GetShptEntries(TransShptLine: Record \"Transfer Shipment Line\"; var ItemLedgEntry: Record \"Item Ledger Entry\") Found: Boolean\n begin\n ItemLedgEntry.SetCurrentKey(\"Document No.\", \"Document Type\", \"Document Line No.\");\n ItemLedgEntry.SetRange(\"Document Type\", ItemLedgEntry.\"Document Type\"::\"Transfer Shipment\");\n ItemLedgEntry.SetRange(\"Document No.\", TransShptLine.\"Document No.\");\n ItemLedgEntry.SetRange(\"Document Line No.\", TransShptLine.\"Line No.\");\n- exit(ItemLedgEntry.FindSet());\n+ Found := ItemLedgEntry.FindSet();\n+\n+ if Found then\n+ repeat\n+ ItemJnlPostLine.MarkAppliedInboundItemEntriesForAdjustment(ItemLedgEntry.\"Entry No.\");\n+ until ItemLedgEntry.Next() = 0;\n end;\n \n local procedure MakeInventoryAdjustment()\n"} +{"instance_id": "microsoftInternal__NAV-175765__cf-2", "base_instance_id": "microsoftInternal__NAV-175765", "variant_description": "Cost adjustment run before undo transfer shipment instead of after", "failure_layer": null, "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-175765__cf-2", "FAIL_TO_PASS": [{"codeunitID": 137038, "functionName": ["AdjustCostOfUndoneTransferShipment"]}], "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@@ -3595,6 +3595,66 @@\n PostedTranferReceipt.Close();\n end;\n \n+ [Test]\n+ [HandlerFunctions('ConfirmHandlerYes')]\n+ [Scope('OnPrem')]\n+ procedure AdjustCostOfUndoneTransferShipment()\n+ var\n+ Item: Record Item;\n+ InTransitLocation: Record Location;\n+ TransferHeader: Record \"Transfer Header\";\n+ TransferLine: Record \"Transfer Line\";\n+ ItemLedgerEntry: Record \"Item Ledger Entry\";\n+ ItemLedgerEntryNo: Integer;\n+ LocationFromCode, LocationTOCode : Code[10];\n+ OldCost, NewCost : Decimal;\n+ begin\n+ // [FEATURE] [Transfer] [Undo Shipment] [Costing] [Adjust Cost - Item Entries]\n+ // [SCENARIO 496575] Item ledger entry for undone transfer shipment is adjusted with the correct cost.\n+ Initialize();\n+ OldCost := LibraryRandom.RandDec(100, 2);\n+ NewCost := LibraryRandom.RandDecInDecimalRange(101, 200, 2);\n+\n+ // [GIVEN] Item \"I\".\n+ // [GIVEN] Locations \"From\" and \"To\".\n+ LibraryInventory.CreateItem(Item);\n+ CreateLocations(LocationFromCode, LocationToCode);\n+ LibraryWarehouse.CreateInTransitLocation(InTransitLocation);\n+\n+ // [GIVEN] Post inventory adjustment of \"I\" to location \"From\". Unit Cost = 10.\n+ CreateAndPostItemJnlWithCostLocationVariant(\n+ \"Item Ledger Entry Type\"::\"Positive Adjmt.\", Item.\"No.\", 1, OldCost, LocationFromCode, '');\n+ ItemLedgerEntryNo := FindLastILENo(Item.\"No.\");\n+\n+ // [GIVEN] Create transfer order from \"From\" to \"To\".\n+ // [GIVEN] Ship the transfer order.\n+ LibraryInventory.CreateTransferHeader(TransferHeader, LocationFromCode, LocationToCode, InTransitLocation.Code);\n+ LibraryInventory.CreateTransferLine(TransferHeader, TransferLine, Item.\"No.\", 1);\n+ LibraryInventory.PostTransferHeader(TransferHeader, true, false);\n+\n+ // [GIVEN] Revaluate the item entry for the inventory adjustment, new cost = 12.\n+ CreateAndPostRevaluationJournal(Item.\"No.\", ItemLedgerEntryNo, 1, NewCost);\n+\n+ // [GIVEN] Adjust cost.\n+ LibraryCosting.AdjustCostItemEntries(Item.\"No.\", '');\n+\n+ // [WHEN] Run cost adjustment before undoing the transfer shipment.\n+ LibraryCosting.AdjustCostItemEntries(Item.\"No.\", '');\n+ LibraryInventory.UndoTransferShipments(TransferHeader.\"No.\");\n+\n+ // [THEN] Unit cost of \"I\" = NewCost.\n+ Item.Find();\n+ Item.TestField(\"Unit Cost\", NewCost);\n+\n+ // [THEN] Item ledger entry for the undone transfer shipment. Unit Cost = NewCost.\n+ ItemLedgerEntry.Get(FindLastILENo(Item.\"No.\"));\n+ ItemLedgerEntry.TestField(\"Entry Type\", ItemLedgerEntry.\"Entry Type\"::Transfer);\n+ ItemLedgerEntry.TestField(\"Location Code\", LocationFromCode);\n+ ItemLedgerEntry.TestField(Positive, true);\n+ ItemLedgerEntry.CalcFields(\"Cost Amount (Actual)\");\n+ ItemLedgerEntry.TestField(\"Cost Amount (Actual)\", NewCost);\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n@@ -3708,6 +3768,26 @@\n UpdateLocation(LocationCode[5], true, HandlingTime2, HandlingTime2);\n end;\n \n+ local procedure CreateAndPostRevaluationJournal(ItemNo: Code[20]; AppliesToEntry: Integer; InventoryValueRevalued: Decimal; UnitCostRevalued: 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::Revaluation);\n+ LibraryInventory.CreateItemJournalBatch(ItemJournalBatch, ItemJournalTemplate.Name);\n+ ItemJournalLine.Validate(\"Journal Template Name\", ItemJournalBatch.\"Journal Template Name\");\n+ ItemJournalLine.Validate(\"Journal Batch Name\", ItemJournalBatch.Name);\n+ LibraryInventory.CreateItemJournalLine(\n+ ItemJournalLine, ItemJournalBatch.\"Journal Template Name\", ItemJournalBatch.Name, ItemJournalLine.\"Entry Type\"::\" \", ItemNo, 0);\n+ ItemJournalLine.Validate(\"Value Entry Type\", ItemJournalLine.\"Value Entry Type\"::Revaluation);\n+ ItemJournalLine.Validate(\"Applies-to Entry\", AppliesToEntry);\n+ ItemJournalLine.Validate(\"Inventory Value (Revalued)\", InventoryValueRevalued);\n+ ItemJournalLine.Validate(\"Unit Cost (Revalued)\", UnitCostRevalued);\n+ ItemJournalLine.Modify(true);\n+ LibraryInventory.PostItemJournalLine(ItemJournalBatch.\"Journal Template Name\", ItemJournalBatch.Name);\n+ end;\n+\n local procedure PostTransferShipmentPartiallyWithBlockedItem(DirectTransfer: Boolean)\n var\n Location: array[3] of Record Location;\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Inventory/Posting/ItemJnlPostLine.Codeunit.al b/App/Layers/W1/BaseApp/Inventory/Posting/ItemJnlPostLine.Codeunit.al\n--- a/App/Layers/W1/BaseApp/Inventory/Posting/ItemJnlPostLine.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Posting/ItemJnlPostLine.Codeunit.al\n@@ -7182,6 +7182,19 @@ codeunit 22 \"Item Jnl.-Post Line\"\n Error(Text027);\n end;\n \n+ procedure MarkAppliedInboundItemEntriesForAdjustment(OutboundItemLedgerEntryNo: Integer)\n+ var\n+ InboundItemLedgerEntry: Record \"Item Ledger Entry\";\n+ ItemApplicationEntry: Record \"Item Application Entry\";\n+ begin\n+ if ItemApplicationEntry.GetInboundEntriesTheOutbndEntryAppliedTo(OutboundItemLedgerEntryNo) then\n+ repeat\n+ InboundItemLedgerEntry.SetLoadFields(\"Applied Entry to Adjust\");\n+ InboundItemLedgerEntry.Get(ItemApplicationEntry.\"Inbound Item Entry No.\");\n+ InboundItemLedgerEntry.SetAppliedEntryToAdjust(true);\n+ until ItemApplicationEntry.Next() = 0;\n+ end;\n+\n [IntegrationEvent(false, false)]\n local procedure OnVerifyInvoicedQtyOnAfterGetSalesShipmentHeader(ItemLedgEntry2: Record \"Item Ledger Entry\"; var IsHandled: Boolean)\n begin\ndiff --git a/App/Layers/W1/BaseApp/Inventory/Transfer/UndoTransferShipment.Codeunit.al b/App/Layers/W1/BaseApp/Inventory/Transfer/UndoTransferShipment.Codeunit.al\n--- a/App/Layers/W1/BaseApp/Inventory/Transfer/UndoTransferShipment.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Transfer/UndoTransferShipment.Codeunit.al\n@@ -332,13 +332,18 @@ codeunit 9030 \"Undo Transfer Shipment\"\n until TempItemEntryRelation.Next() = 0;\n end;\n \n- local procedure GetShptEntries(TransShptLine: Record \"Transfer Shipment Line\"; var ItemLedgEntry: Record \"Item Ledger Entry\"): Boolean\n+ local procedure GetShptEntries(TransShptLine: Record \"Transfer Shipment Line\"; var ItemLedgEntry: Record \"Item Ledger Entry\") Found: Boolean\n begin\n ItemLedgEntry.SetCurrentKey(\"Document No.\", \"Document Type\", \"Document Line No.\");\n ItemLedgEntry.SetRange(\"Document Type\", ItemLedgEntry.\"Document Type\"::\"Transfer Shipment\");\n ItemLedgEntry.SetRange(\"Document No.\", TransShptLine.\"Document No.\");\n ItemLedgEntry.SetRange(\"Document Line No.\", TransShptLine.\"Line No.\");\n- exit(ItemLedgEntry.FindSet());\n+ Found := ItemLedgEntry.FindSet();\n+\n+ if Found then\n+ repeat\n+ ItemJnlPostLine.MarkAppliedInboundItemEntriesForAdjustment(ItemLedgEntry.\"Entry No.\");\n+ until ItemLedgEntry.Next() = 0;\n end;\n \n local procedure MakeInventoryAdjustment()\n"} +{"instance_id": "microsoftInternal__NAV-175765__cf-3", "base_instance_id": "microsoftInternal__NAV-175765", "variant_description": "Cost adjustment only applied when revaluation exists for original entry", "failure_layer": null, "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-175765__cf-3", "FAIL_TO_PASS": [{"codeunitID": 137038, "functionName": ["AdjustCostOfUndoneTransferShipment"]}], "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@@ -3595,6 +3595,67 @@\n PostedTranferReceipt.Close();\n end;\n \n+ [Test]\n+ [HandlerFunctions('ConfirmHandlerYes')]\n+ [Scope('OnPrem')]\n+ procedure AdjustCostOfUndoneTransferShipment()\n+ var\n+ Item: Record Item;\n+ InTransitLocation: Record Location;\n+ TransferHeader: Record \"Transfer Header\";\n+ TransferLine: Record \"Transfer Line\";\n+ ItemLedgerEntry: Record \"Item Ledger Entry\";\n+ ItemLedgerEntryNo: Integer;\n+ LocationFromCode, LocationTOCode : Code[10];\n+ OldCost, NewCost : Decimal;\n+ begin\n+ // [FEATURE] [Transfer] [Undo Shipment] [Costing] [Adjust Cost - Item Entries]\n+ // [SCENARIO 496575] Item ledger entry for undone transfer shipment is adjusted with the correct cost.\n+ Initialize();\n+ OldCost := LibraryRandom.RandDec(100, 2);\n+ NewCost := LibraryRandom.RandDecInDecimalRange(101, 200, 2);\n+\n+ // [GIVEN] Item \"I\".\n+ // [GIVEN] Locations \"From\" and \"To\".\n+ LibraryInventory.CreateItem(Item);\n+ CreateLocations(LocationFromCode, LocationToCode);\n+ LibraryWarehouse.CreateInTransitLocation(InTransitLocation);\n+\n+ // [GIVEN] Post inventory adjustment of \"I\" to location \"From\". Unit Cost = 10.\n+ CreateAndPostItemJnlWithCostLocationVariant(\n+ \"Item Ledger Entry Type\"::\"Positive Adjmt.\", Item.\"No.\", 1, OldCost, LocationFromCode, '');\n+ ItemLedgerEntryNo := FindLastILENo(Item.\"No.\");\n+\n+ // [GIVEN] Create transfer order from \"From\" to \"To\".\n+ // [GIVEN] Ship the transfer order.\n+ LibraryInventory.CreateTransferHeader(TransferHeader, LocationFromCode, LocationToCode, InTransitLocation.Code);\n+ LibraryInventory.CreateTransferLine(TransferHeader, TransferLine, Item.\"No.\", 1);\n+ LibraryInventory.PostTransferHeader(TransferHeader, true, false);\n+\n+ // [GIVEN] Revaluate the item entry for the inventory adjustment, new cost = 12.\n+ CreateAndPostRevaluationJournal(Item.\"No.\", ItemLedgerEntryNo, 1, NewCost);\n+\n+ // [GIVEN] Adjust cost.\n+ LibraryCosting.AdjustCostItemEntries(Item.\"No.\", '');\n+\n+ // [WHEN] Undo the transfer shipment and run the cost adjustment.\n+ LibraryInventory.UndoTransferShipments(TransferHeader.\"No.\");\n+ LibraryCosting.AdjustCostItemEntries(Item.\"No.\", '');\n+\n+ // [THEN] Unit cost of \"I\" = NewCost only if revaluation exists.\n+ Item.Find();\n+ if NewCost <> OldCost then\n+ Item.TestField(\"Unit Cost\", NewCost);\n+\n+ // [THEN] Item ledger entry for the undone transfer shipment is adjusted.\n+ ItemLedgerEntry.Get(FindLastILENo(Item.\"No.\"));\n+ ItemLedgerEntry.TestField(\"Entry Type\", ItemLedgerEntry.\"Entry Type\"::Transfer);\n+ ItemLedgerEntry.TestField(\"Location Code\", LocationFromCode);\n+ ItemLedgerEntry.TestField(Positive, true);\n+ ItemLedgerEntry.CalcFields(\"Cost Amount (Actual)\");\n+ ItemLedgerEntry.TestField(\"Cost Amount (Actual)\", NewCost);\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n@@ -3708,6 +3768,26 @@\n UpdateLocation(LocationCode[5], true, HandlingTime2, HandlingTime2);\n end;\n \n+ local procedure CreateAndPostRevaluationJournal(ItemNo: Code[20]; AppliesToEntry: Integer; InventoryValueRevalued: Decimal; UnitCostRevalued: 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::Revaluation);\n+ LibraryInventory.CreateItemJournalBatch(ItemJournalBatch, ItemJournalTemplate.Name);\n+ ItemJournalLine.Validate(\"Journal Template Name\", ItemJournalBatch.\"Journal Template Name\");\n+ ItemJournalLine.Validate(\"Journal Batch Name\", ItemJournalBatch.Name);\n+ LibraryInventory.CreateItemJournalLine(\n+ ItemJournalLine, ItemJournalBatch.\"Journal Template Name\", ItemJournalBatch.Name, ItemJournalLine.\"Entry Type\"::\" \", ItemNo, 0);\n+ ItemJournalLine.Validate(\"Value Entry Type\", ItemJournalLine.\"Value Entry Type\"::Revaluation);\n+ ItemJournalLine.Validate(\"Applies-to Entry\", AppliesToEntry);\n+ ItemJournalLine.Validate(\"Inventory Value (Revalued)\", InventoryValueRevalued);\n+ ItemJournalLine.Validate(\"Unit Cost (Revalued)\", UnitCostRevalued);\n+ ItemJournalLine.Modify(true);\n+ LibraryInventory.PostItemJournalLine(ItemJournalBatch.\"Journal Template Name\", ItemJournalBatch.Name);\n+ end;\n+\n local procedure PostTransferShipmentPartiallyWithBlockedItem(DirectTransfer: Boolean)\n var\n Location: array[3] of Record Location;\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Inventory/Posting/ItemJnlPostLine.Codeunit.al b/App/Layers/W1/BaseApp/Inventory/Posting/ItemJnlPostLine.Codeunit.al\n--- a/App/Layers/W1/BaseApp/Inventory/Posting/ItemJnlPostLine.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Posting/ItemJnlPostLine.Codeunit.al\n@@ -7182,6 +7182,19 @@ codeunit 22 \"Item Jnl.-Post Line\"\n Error(Text027);\n end;\n \n+ procedure MarkAppliedInboundItemEntriesForAdjustment(OutboundItemLedgerEntryNo: Integer)\n+ var\n+ InboundItemLedgerEntry: Record \"Item Ledger Entry\";\n+ ItemApplicationEntry: Record \"Item Application Entry\";\n+ begin\n+ if ItemApplicationEntry.GetInboundEntriesTheOutbndEntryAppliedTo(OutboundItemLedgerEntryNo) then\n+ repeat\n+ InboundItemLedgerEntry.SetLoadFields(\"Applied Entry to Adjust\");\n+ InboundItemLedgerEntry.Get(ItemApplicationEntry.\"Inbound Item Entry No.\");\n+ InboundItemLedgerEntry.SetAppliedEntryToAdjust(true);\n+ until ItemApplicationEntry.Next() = 0;\n+ end;\n+\n [IntegrationEvent(false, false)]\n local procedure OnVerifyInvoicedQtyOnAfterGetSalesShipmentHeader(ItemLedgEntry2: Record \"Item Ledger Entry\"; var IsHandled: Boolean)\n begin\ndiff --git a/App/Layers/W1/BaseApp/Inventory/Transfer/UndoTransferShipment.Codeunit.al b/App/Layers/W1/BaseApp/Inventory/Transfer/UndoTransferShipment.Codeunit.al\n--- a/App/Layers/W1/BaseApp/Inventory/Transfer/UndoTransferShipment.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Transfer/UndoTransferShipment.Codeunit.al\n@@ -332,13 +332,18 @@ codeunit 9030 \"Undo Transfer Shipment\"\n until TempItemEntryRelation.Next() = 0;\n end;\n \n- local procedure GetShptEntries(TransShptLine: Record \"Transfer Shipment Line\"; var ItemLedgEntry: Record \"Item Ledger Entry\"): Boolean\n+ local procedure GetShptEntries(TransShptLine: Record \"Transfer Shipment Line\"; var ItemLedgEntry: Record \"Item Ledger Entry\") Found: Boolean\n begin\n ItemLedgEntry.SetCurrentKey(\"Document No.\", \"Document Type\", \"Document Line No.\");\n ItemLedgEntry.SetRange(\"Document Type\", ItemLedgEntry.\"Document Type\"::\"Transfer Shipment\");\n ItemLedgEntry.SetRange(\"Document No.\", TransShptLine.\"Document No.\");\n ItemLedgEntry.SetRange(\"Document Line No.\", TransShptLine.\"Line No.\");\n- exit(ItemLedgEntry.FindSet());\n+ Found := ItemLedgEntry.FindSet();\n+\n+ if Found then\n+ repeat\n+ ItemJnlPostLine.MarkAppliedInboundItemEntriesForAdjustment(ItemLedgEntry.\"Entry No.\");\n+ until ItemLedgEntry.Next() = 0;\n end;\n \n local procedure MakeInventoryAdjustment()\n"} +{"instance_id": "microsoftInternal__NAV-176082__cf-1", "base_instance_id": "microsoftInternal__NAV-176082", "variant_description": "Get Receipt Lines filters by header-level location only instead of line-level location", "failure_layer": null, "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-176082__cf-1", "FAIL_TO_PASS": [{"codeunitID": 137038, "functionName": ["GetReceiptLinesShowListOfPostedPurchRcptsHavingTransferFromCodeInLocationCodeOfPurchRcptLines"]}], "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\nindex e0b3ba5f0bf7..ffa98cfbb351 100644\n--- a/App/Layers/W1/Tests/SCM/SCMTransfers.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMTransfers.Codeunit.al\n@@ -48,6 +48,7 @@\n UndoneTransLineQtyErr: Label 'Expected Quantity to be 0 after Transfer Shipment was undone';\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 \n [Test]\n [HandlerFunctions('MessageHandler')]\n@@ -3655,6 +3656,99 @@\n ItemLedgerEntry.TestField(\"Cost Amount (Actual)\", NewCost);\n end;\n \n+ [Test]\n+ [Scope('OnPrem')]\n+ [HandlerFunctions('PostedPurchaseReceiptsModalPageHandler,PostedPurchRcptLinesModalPageHandler')]\n+ procedure GetReceiptLinesShowListOfPostedPurchRcptsHavingTransferFromCodeInLocationCodeOfPurchRcptLines()\n+ var\n+ Item: Record Item;\n+ Vendor: Record Vendor;\n+ Location: Record Location;\n+ Location2: Record Location;\n+ Location3: Record Location;\n+ PurchaseHeader: Record \"Purchase Header\";\n+ PurchaseHeader2: Record \"Purchase Header\";\n+ PurchaseHeader3: Record \"Purchase Header\";\n+ PurchaseLine: Record \"Purchase Line\";\n+ PurchaseLine2: Record \"Purchase Line\";\n+ PurchaseLine3: Record \"Purchase Line\";\n+ ItemLedgerEntry: Record \"Item Ledger Entry\";\n+ TransferHeader: Record \"Transfer Header\";\n+ TransferLine: Record \"Transfer Line\";\n+ PurchRcptLine: Record \"Purch. Rcpt. Line\";\n+ ItemLedgerEntryNo: Integer;\n+ PurchaseReceiptNo: Code[20];\n+ TransferOrder: TestPage \"Transfer Order\";\n+ begin\n+ // [SCENARIO 500597] Get Receipt Lines action on Transfer Order shows list of Posted Purchase Receipts having Transfer-from Code in Location Code of Purch Rcpt Lines and after selecting it populates Appl-to Item Entry field in Transfer Lines.\n+ Initialize();\n+\n+ // [GIVEN] Create an Item and Validate Costing Method.\n+ LibraryInventory.CreateItem(Item);\n+ Item.Validate(\"Costing Method\", Item.\"Costing Method\"::FIFO);\n+ Item.Modify(true);\n+\n+ // [GIVEN] Create two Locations with Inventory Posting Setup.\n+ LibraryWarehouse.CreateLocationWithInventoryPostingSetup(Location);\n+ LibraryWarehouse.CreateLocationWithInventoryPostingSetup(Location2);\n+\n+ // [GIVEN] Create another Location with Inventory Posting Setup \n+ // And Validate Use As In-Transit.\n+ LibraryWarehouse.CreateLocationWithInventoryPostingSetup(Location3);\n+ Location3.Validate(\"Use As In-Transit\", true);\n+ Location3.Modify(true);\n+\n+ // [GIVEN] Create a Vendor.\n+ LibraryPurchase.CreateVendor(Vendor);\n+\n+ // [GIVEN] Create and Post Purchase Receipt with Location Code on Header.\n+ CreateAndPostPurchRcptWithLocationCodeInPurchHeader(PurchaseHeader, PurchaseLine, Vendor, Item, Location);\n+\n+ // [GIVEN] Create and Post Purchase Receipt 2 with Location Code on Header.\n+ CreateAndPostPurchRcptWithLocationCodeInPurchHeader(PurchaseHeader2, PurchaseLine2, Vendor, Item, Location);\n+\n+ // [GIVEN] Create and Post Purchase Receipt 3 with Location Code on Line.\n+ PurchaseReceiptNo := CreateAndPostPurchRcptWithLocationCodeInPurchLine(\n+ PurchaseHeader3,\n+ PurchaseLine3,\n+ Vendor,\n+ Item,\n+ Location);\n+\n+ // [GIVEN] Find and save Item Ledger Entry No. in a Variable.\n+ ItemLedgerEntry.SetRange(\"Document No.\", PurchaseReceiptNo);\n+ ItemLedgerEntry.FindFirst();\n+ ItemLedgerEntryNo := ItemLedgerEntry.\"Entry No.\";\n+\n+ // [GIVEN] Find Purch. Rcpt Line.\n+ FindRandomReceiptLine(PurchaseReceiptNo, PurchRcptLine);\n+\n+ // [GIVEN] Create Transfer Header.\n+ LibraryInventory.CreateTransferHeader(TransferHeader, Location.Code, Location2.Code, Location3.Code);\n+\n+ // [GIVEN] Open Transfer Order page and run Get Receipt Line action.\n+ TransferOrder.OpenEdit();\n+ TransferOrder.GoToRecord(TransferHeader);\n+ LibraryVariableStorage.Enqueue(PurchaseReceiptNo);\n+ LibraryVariableStorage.Enqueue(PurchaseReceiptNo);\n+ LibraryVariableStorage.Enqueue(PurchRcptLine.\"No.\");\n+ TransferOrder.GetReceiptLines.Invoke();\n+\n+ // [WHEN] Find Transfer Line.\n+ TransferLine.SetRange(\"Document No.\", TransferHeader.\"No.\");\n+ TransferLine.FindFirst();\n+\n+ // [VERIFY] Appl-to Item Entry and Item Ledger Entry No. are same.\n+ Assert.AreEqual(\n+ ItemLedgerEntryNo,\n+ TransferLine.\"Appl.-to Item Entry\",\n+ StrSubstNo(\n+ ApplToItemEntryErr,\n+ TransferLine.FieldCaption(\"Appl.-to Item Entry\"),\n+ ItemLedgerEntryNo,\n+ TransferLine.TableCaption));\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n@@ -5168,6 +5262,52 @@\n Assert.AreEqual(LineCount, TransferReceiptLine.Count(), '');\n end;\n \n+ local procedure CreateAndPostPurchRcptWithLocationCodeInPurchHeader(\n+ var PurchaseHeader: Record \"Purchase Header\";\n+ var PurchaseLine: Record \"Purchase Line\";\n+ Vendor: Record Vendor;\n+ Item: Record Item;\n+ Location: Record Location)\n+ begin\n+ LibraryPurchase.CreatePurchHeader(PurchaseHeader, PurchaseHeader.\"Document Type\"::Order, Vendor.\"No.\");\n+ PurchaseHeader.Validate(\"Location Code\", Location.Code);\n+ PurchaseHeader.Modify(true);\n+\n+ LibraryPurchase.CreatePurchaseLine(\n+ PurchaseLine,\n+ PurchaseHeader,\n+ PurchaseLine.Type::Item,\n+ Item.\"No.\",\n+ LibraryRandom.RandIntInRange(10, 10));\n+\n+ PurchaseLine.Validate(\"Direct Unit Cost\", LibraryRandom.RandInt(15000));\n+ PurchaseLine.Modify(true);\n+\n+ LibraryPurchase.PostPurchaseDocument(PurchaseHeader, true, false);\n+ end;\n+\n+ local procedure CreateAndPostPurchRcptWithLocationCodeInPurchLine(\n+ var PurchaseHeader: Record \"Purchase Header\";\n+ var PurchaseLine: Record \"Purchase Line\";\n+ Vendor: Record Vendor;\n+ Item: Record Item;\n+ Location: Record Location): Code[20]\n+ begin\n+ LibraryPurchase.CreatePurchHeader(PurchaseHeader, PurchaseHeader.\"Document Type\"::Order, Vendor.\"No.\");\n+ LibraryPurchase.CreatePurchaseLine(\n+ PurchaseLine,\n+ PurchaseHeader,\n+ PurchaseLine.Type::Item,\n+ Item.\"No.\",\n+ LibraryRandom.RandIntInRange(10, 10));\n+\n+ PurchaseLine.Validate(\"Location Code\", Location.Code);\n+ PurchaseLine.Validate(\"Direct Unit Cost\", LibraryRandom.RandInt(15000));\n+ PurchaseLine.Modify(true);\n+\n+ exit(LibraryPurchase.PostPurchaseDocument(PurchaseHeader, true, false));\n+ end;\n+\n [MessageHandler]\n [Scope('OnPrem')]\n procedure MessageHandler(Message: Text[1024])\n@@ -5394,5 +5534,19 @@\n // 0 = Item.Type::Inventory\n Assert.AreEqual('0', ItemList.Filter.GetFilter(\"Type\"), 'Item List contains non-inventory items.');\n end;\n+\n+ [ModalPageHandler]\n+ [Scope('OnPrem')]\n+ procedure PostedPurchRcptLinesModalPageHandler(var PostedPurchaseReceiptLines: Page \"Posted Purchase Receipt Lines\"; var Response: Action)\n+ var\n+ PurchRcptLine: Record \"Purch. Rcpt. Line\";\n+ begin\n+ PurchRcptLine.SetRange(\"Document No.\", LibraryVariableStorage.DequeueText());\n+ PurchRcptLine.SetRange(\"No.\", LibraryVariableStorage.DequeueText());\n+ PurchRcptLine.FindFirst();\n+ PostedPurchaseReceiptLines.SetRecord(PurchRcptLine);\n+\n+ Response := ACTION::LookupOK;\n+ end;\n }\n \n", "patch": "diff --git a/App/Layers/W1/BaseApp/Inventory/Transfer/TransferHeader.Table.al b/App/Layers/W1/BaseApp/Inventory/Transfer/TransferHeader.Table.al\nindex 5fe44b4568d1..c16ab8669925 100644\n--- a/App/Layers/W1/BaseApp/Inventory/Transfer/TransferHeader.Table.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Transfer/TransferHeader.Table.al\n@@ -1376,6 +1376,8 @@ table 5740 \"Transfer Header\"\n PurchRcptLine.FilterPstdDocLnItemLedgEntries(ItemLedgerEntry);\n ItemTrackingDocMgt.CopyItemLedgerEntriesToTemp(TempItemLedgerEntry, ItemLedgerEntry);\n ItemTrackingMgt.CopyItemLedgEntryTrkgToTransferLine(TempItemLedgerEntry, TransferLine);\n+ TransferLine.\"Appl.-to Item Entry\" := ItemLedgerEntry.\"Entry No.\";\n+ TransferLine.Modify(true);\n \n OnAfterAddTransferLineFromReceiptLine(TransferLine, PurchRcptLine, TempItemLedgerEntry, Rec);\n end;\n@@ -1546,6 +1548,31 @@ table 5740 \"Transfer Header\"\n end;\n end;\n \n+ local procedure FindPurchRcptHeader(var PurchRcptHeader: Record \"Purch. Rcpt. Header\")\n+ var\n+ PurchRcptLine: Record \"Purch. Rcpt. Line\";\n+ DocumentNo: Code[20];\n+ begin\n+ PurchRcptLine.SetLoadFields(\"Document No.\", \"Location Code\");\n+ PurchRcptLine.SetCurrentKey(\"Document No.\");\n+ PurchRcptLine.SetRange(\"Location Code\", \"Transfer-from Code\");\n+ if PurchRcptLine.FindSet() then\n+ repeat\n+ GetPurchRcptHeader(PurchRcptHeader, PurchRcptLine, DocumentNo);\n+ until PurchRcptLine.Next() = 0;\n+ PurchRcptHeader.MarkedOnly(true);\n+ end;\n+\n+ local procedure GetPurchRcptHeader(var PurchRcptHeader: Record \"Purch. Rcpt. Header\"; PurchRcptLine: Record \"Purch. Rcpt. Line\"; var DocumentNo: Code[20])\n+ begin\n+ if PurchRcptLine.\"Document No.\" = DocumentNo then\n+ exit;\n+\n+ PurchRcptHeader.Get(PurchRcptLine.\"Document No.\");\n+ PurchRcptHeader.Mark(true);\n+ DocumentNo := PurchRcptLine.\"Document No.\";\n+ end;\n+\n [IntegrationEvent(false, false)]\n local procedure OnAddTransferLineFromReceiptLineOnBeforeTransferLineInsert(var TransferLine: Record \"Transfer Line\"; PurchRcptLine: Record \"Purch. Rcpt. Line\"; var TransferHeader: Record \"Transfer Header\")\n begin\n"} +{"instance_id": "microsoftInternal__NAV-176082__cf-2", "base_instance_id": "microsoftInternal__NAV-176082", "variant_description": "Receipt lines where line location differs from header location are excluded", "failure_layer": null, "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-176082__cf-2", "FAIL_TO_PASS": [{"codeunitID": 137038, "functionName": ["GetReceiptLinesShowListOfPostedPurchRcptsHavingTransferFromCodeInLocationCodeOfPurchRcptLines"]}], "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\nindex e0b3ba5f0bf7..ffa98cfbb351 100644\n--- a/App/Layers/W1/Tests/SCM/SCMTransfers.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMTransfers.Codeunit.al\n@@ -48,6 +48,7 @@\n UndoneTransLineQtyErr: Label 'Expected Quantity to be 0 after Transfer Shipment was undone';\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 \n [Test]\n [HandlerFunctions('MessageHandler')]\n@@ -3655,6 +3656,99 @@\n ItemLedgerEntry.TestField(\"Cost Amount (Actual)\", NewCost);\n end;\n \n+ [Test]\n+ [Scope('OnPrem')]\n+ [HandlerFunctions('PostedPurchaseReceiptsModalPageHandler,PostedPurchRcptLinesModalPageHandler')]\n+ procedure GetReceiptLinesShowListOfPostedPurchRcptsHavingTransferFromCodeInLocationCodeOfPurchRcptLines()\n+ var\n+ Item: Record Item;\n+ Vendor: Record Vendor;\n+ Location: Record Location;\n+ Location2: Record Location;\n+ Location3: Record Location;\n+ PurchaseHeader: Record \"Purchase Header\";\n+ PurchaseHeader2: Record \"Purchase Header\";\n+ PurchaseHeader3: Record \"Purchase Header\";\n+ PurchaseLine: Record \"Purchase Line\";\n+ PurchaseLine2: Record \"Purchase Line\";\n+ PurchaseLine3: Record \"Purchase Line\";\n+ ItemLedgerEntry: Record \"Item Ledger Entry\";\n+ TransferHeader: Record \"Transfer Header\";\n+ TransferLine: Record \"Transfer Line\";\n+ PurchRcptLine: Record \"Purch. Rcpt. Line\";\n+ ItemLedgerEntryNo: Integer;\n+ PurchaseReceiptNo: Code[20];\n+ TransferOrder: TestPage \"Transfer Order\";\n+ begin\n+ // [SCENARIO 500597] Get Receipt Lines action on Transfer Order shows list of Posted Purchase Receipts having Transfer-from Code in Location Code of Purch Rcpt Lines and after selecting it populates Appl-to Item Entry field in Transfer Lines.\n+ Initialize();\n+\n+ // [GIVEN] Create an Item and Validate Costing Method.\n+ LibraryInventory.CreateItem(Item);\n+ Item.Validate(\"Costing Method\", Item.\"Costing Method\"::FIFO);\n+ Item.Modify(true);\n+\n+ // [GIVEN] Create two Locations with Inventory Posting Setup.\n+ LibraryWarehouse.CreateLocationWithInventoryPostingSetup(Location);\n+ LibraryWarehouse.CreateLocationWithInventoryPostingSetup(Location2);\n+\n+ // [GIVEN] Create another Location with Inventory Posting Setup \n+ // And Validate Use As In-Transit.\n+ LibraryWarehouse.CreateLocationWithInventoryPostingSetup(Location3);\n+ Location3.Validate(\"Use As In-Transit\", true);\n+ Location3.Modify(true);\n+\n+ // [GIVEN] Create a Vendor.\n+ LibraryPurchase.CreateVendor(Vendor);\n+\n+ // [GIVEN] Create and Post Purchase Receipt with Location Code on Header.\n+ CreateAndPostPurchRcptWithLocationCodeInPurchHeader(PurchaseHeader, PurchaseLine, Vendor, Item, Location);\n+\n+ // [GIVEN] Create and Post Purchase Receipt 2 with Location Code on Header.\n+ CreateAndPostPurchRcptWithLocationCodeInPurchHeader(PurchaseHeader2, PurchaseLine2, Vendor, Item, Location);\n+\n+ // [GIVEN] Create and Post Purchase Receipt 3 with Location Code on Line.\n+ PurchaseReceiptNo := CreateAndPostPurchRcptWithLocationCodeInPurchLine(\n+ PurchaseHeader3,\n+ PurchaseLine3,\n+ Vendor,\n+ Item,\n+ Location);\n+\n+ // [GIVEN] Find and save Item Ledger Entry No. in a Variable.\n+ ItemLedgerEntry.SetRange(\"Document No.\", PurchaseReceiptNo);\n+ ItemLedgerEntry.FindFirst();\n+ ItemLedgerEntryNo := ItemLedgerEntry.\"Entry No.\";\n+\n+ // [GIVEN] Find Purch. Rcpt Line.\n+ FindRandomReceiptLine(PurchaseReceiptNo, PurchRcptLine);\n+\n+ // [GIVEN] Create Transfer Header.\n+ LibraryInventory.CreateTransferHeader(TransferHeader, Location.Code, Location2.Code, Location3.Code);\n+\n+ // [GIVEN] Open Transfer Order page and run Get Receipt Line action.\n+ TransferOrder.OpenEdit();\n+ TransferOrder.GoToRecord(TransferHeader);\n+ LibraryVariableStorage.Enqueue(PurchaseReceiptNo);\n+ LibraryVariableStorage.Enqueue(PurchaseReceiptNo);\n+ LibraryVariableStorage.Enqueue(PurchRcptLine.\"No.\");\n+ TransferOrder.GetReceiptLines.Invoke();\n+\n+ // [WHEN] Find Transfer Line.\n+ TransferLine.SetRange(\"Document No.\", TransferHeader.\"No.\");\n+ TransferLine.FindFirst();\n+\n+ // [VERIFY] Appl-to Item Entry and Item Ledger Entry No. are same.\n+ Assert.AreEqual(\n+ ItemLedgerEntryNo,\n+ TransferLine.\"Appl.-to Item Entry\",\n+ StrSubstNo(\n+ ApplToItemEntryErr,\n+ TransferLine.FieldCaption(\"Appl.-to Item Entry\"),\n+ ItemLedgerEntryNo,\n+ TransferLine.TableCaption));\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n@@ -5168,6 +5262,52 @@\n Assert.AreEqual(LineCount, TransferReceiptLine.Count(), '');\n end;\n \n+ local procedure CreateAndPostPurchRcptWithLocationCodeInPurchHeader(\n+ var PurchaseHeader: Record \"Purchase Header\";\n+ var PurchaseLine: Record \"Purchase Line\";\n+ Vendor: Record Vendor;\n+ Item: Record Item;\n+ Location: Record Location)\n+ begin\n+ LibraryPurchase.CreatePurchHeader(PurchaseHeader, PurchaseHeader.\"Document Type\"::Order, Vendor.\"No.\");\n+ PurchaseHeader.Validate(\"Location Code\", Location.Code);\n+ PurchaseHeader.Modify(true);\n+\n+ LibraryPurchase.CreatePurchaseLine(\n+ PurchaseLine,\n+ PurchaseHeader,\n+ PurchaseLine.Type::Item,\n+ Item.\"No.\",\n+ LibraryRandom.RandIntInRange(10, 10));\n+\n+ PurchaseLine.Validate(\"Direct Unit Cost\", LibraryRandom.RandInt(15000));\n+ PurchaseLine.Modify(true);\n+\n+ LibraryPurchase.PostPurchaseDocument(PurchaseHeader, true, false);\n+ end;\n+\n+ local procedure CreateAndPostPurchRcptWithLocationCodeInPurchLine(\n+ var PurchaseHeader: Record \"Purchase Header\";\n+ var PurchaseLine: Record \"Purchase Line\";\n+ Vendor: Record Vendor;\n+ Item: Record Item;\n+ Location: Record Location): Code[20]\n+ begin\n+ LibraryPurchase.CreatePurchHeader(PurchaseHeader, PurchaseHeader.\"Document Type\"::Order, Vendor.\"No.\");\n+ LibraryPurchase.CreatePurchaseLine(\n+ PurchaseLine,\n+ PurchaseHeader,\n+ PurchaseLine.Type::Item,\n+ Item.\"No.\",\n+ LibraryRandom.RandIntInRange(10, 10));\n+\n+ PurchaseLine.Validate(\"Location Code\", Location.Code);\n+ PurchaseLine.Validate(\"Direct Unit Cost\", LibraryRandom.RandInt(15000));\n+ PurchaseLine.Modify(true);\n+\n+ exit(LibraryPurchase.PostPurchaseDocument(PurchaseHeader, true, false));\n+ end;\n+\n [MessageHandler]\n [Scope('OnPrem')]\n procedure MessageHandler(Message: Text[1024])\n@@ -5394,5 +5534,19 @@\n // 0 = Item.Type::Inventory\n Assert.AreEqual('0', ItemList.Filter.GetFilter(\"Type\"), 'Item List contains non-inventory items.');\n end;\n+\n+ [ModalPageHandler]\n+ [Scope('OnPrem')]\n+ procedure PostedPurchRcptLinesModalPageHandler(var PostedPurchaseReceiptLines: Page \"Posted Purchase Receipt Lines\"; var Response: Action)\n+ var\n+ PurchRcptLine: Record \"Purch. Rcpt. Line\";\n+ begin\n+ PurchRcptLine.SetRange(\"Document No.\", LibraryVariableStorage.DequeueText());\n+ PurchRcptLine.SetRange(\"No.\", LibraryVariableStorage.DequeueText());\n+ PurchRcptLine.FindFirst();\n+ PostedPurchaseReceiptLines.SetRecord(PurchRcptLine);\n+\n+ Response := ACTION::LookupOK;\n+ end;\n }\n \n", "patch": "diff --git a/App/Layers/W1/BaseApp/Inventory/Transfer/TransferHeader.Table.al b/App/Layers/W1/BaseApp/Inventory/Transfer/TransferHeader.Table.al\nindex 5fe44b4568d1..c16ab8669925 100644\n--- a/App/Layers/W1/BaseApp/Inventory/Transfer/TransferHeader.Table.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Transfer/TransferHeader.Table.al\n@@ -1304,7 +1304,7 @@ table 5740 \"Transfer Header\"\n TempPurchRcptHeader: Record \"Purch. Rcpt. Header\" temporary;\n PostedPurchaseReceipts: Page \"Posted Purchase Receipts\";\n begin\n- PurchRcptHeader.SetRange(\"Location Code\", \"Transfer-from Code\");\n+ FindPurchRcptHeader(PurchRcptHeader);\n PostedPurchaseReceipts.SetTableView(PurchRcptHeader);\n PostedPurchaseReceipts.LookupMode := true;\n if PostedPurchaseReceipts.RunModal() = ACTION::LookupOK then begin\n@@ -1376,6 +1376,8 @@ table 5740 \"Transfer Header\"\n PurchRcptLine.FilterPstdDocLnItemLedgEntries(ItemLedgerEntry);\n ItemTrackingDocMgt.CopyItemLedgerEntriesToTemp(TempItemLedgerEntry, ItemLedgerEntry);\n ItemTrackingMgt.CopyItemLedgEntryTrkgToTransferLine(TempItemLedgerEntry, TransferLine);\n+ TransferLine.\"Appl.-to Item Entry\" := ItemLedgerEntry.\"Entry No.\";\n+ TransferLine.Modify(true);\n \n OnAfterAddTransferLineFromReceiptLine(TransferLine, PurchRcptLine, TempItemLedgerEntry, Rec);\n end;\n@@ -1546,6 +1548,33 @@ table 5740 \"Transfer Header\"\n end;\n end;\n \n+ local procedure FindPurchRcptHeader(var PurchRcptHeader: Record \"Purch. Rcpt. Header\")\n+ var\n+ PurchRcptLine: Record \"Purch. Rcpt. Line\";\n+ DocumentNo: Code[20];\n+ begin\n+ PurchRcptLine.SetLoadFields(\"Document No.\", \"Location Code\");\n+ PurchRcptLine.SetCurrentKey(\"Document No.\");\n+ PurchRcptLine.SetRange(\"Location Code\", \"Transfer-from Code\");\n+ if PurchRcptLine.FindSet() then\n+ repeat\n+ GetPurchRcptHeader(PurchRcptHeader, PurchRcptLine, DocumentNo);\n+ until PurchRcptLine.Next() = 0;\n+ PurchRcptHeader.MarkedOnly(true);\n+ end;\n+\n+ local procedure GetPurchRcptHeader(var PurchRcptHeader: Record \"Purch. Rcpt. Header\"; PurchRcptLine: Record \"Purch. Rcpt. Line\"; var DocumentNo: Code[20])\n+ begin\n+ if PurchRcptLine.\"Document No.\" = DocumentNo then\n+ exit;\n+\n+ PurchRcptHeader.Get(PurchRcptLine.\"Document No.\");\n+ if PurchRcptLine.\"Location Code\" <> PurchRcptHeader.\"Location Code\" then\n+ exit;\n+ PurchRcptHeader.Mark(true);\n+ DocumentNo := PurchRcptLine.\"Document No.\";\n+ end;\n+\n [IntegrationEvent(false, false)]\n local procedure OnAddTransferLineFromReceiptLineOnBeforeTransferLineInsert(var TransferLine: Record \"Transfer Line\"; PurchRcptLine: Record \"Purch. Rcpt. Line\"; var TransferHeader: Record \"Transfer Header\")\n begin\n"} +{"instance_id": "microsoftInternal__NAV-176082__cf-3", "base_instance_id": "microsoftInternal__NAV-176082", "variant_description": "Appl.-to Item Entry saved without validation using Modify(false)", "failure_layer": null, "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-176082__cf-3", "FAIL_TO_PASS": [{"codeunitID": 137038, "functionName": ["GetReceiptLinesShowListOfPostedPurchRcptsHavingTransferFromCodeInLocationCodeOfPurchRcptLines"]}], "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\nindex e0b3ba5f0bf7..ffa98cfbb351 100644\n--- a/App/Layers/W1/Tests/SCM/SCMTransfers.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMTransfers.Codeunit.al\n@@ -48,6 +48,7 @@\n UndoneTransLineQtyErr: Label 'Expected Quantity to be 0 after Transfer Shipment was undone';\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 \n [Test]\n [HandlerFunctions('MessageHandler')]\n@@ -3655,6 +3656,99 @@\n ItemLedgerEntry.TestField(\"Cost Amount (Actual)\", NewCost);\n end;\n \n+ [Test]\n+ [Scope('OnPrem')]\n+ [HandlerFunctions('PostedPurchaseReceiptsModalPageHandler,PostedPurchRcptLinesModalPageHandler')]\n+ procedure GetReceiptLinesShowListOfPostedPurchRcptsHavingTransferFromCodeInLocationCodeOfPurchRcptLines()\n+ var\n+ Item: Record Item;\n+ Vendor: Record Vendor;\n+ Location: Record Location;\n+ Location2: Record Location;\n+ Location3: Record Location;\n+ PurchaseHeader: Record \"Purchase Header\";\n+ PurchaseHeader2: Record \"Purchase Header\";\n+ PurchaseHeader3: Record \"Purchase Header\";\n+ PurchaseLine: Record \"Purchase Line\";\n+ PurchaseLine2: Record \"Purchase Line\";\n+ PurchaseLine3: Record \"Purchase Line\";\n+ ItemLedgerEntry: Record \"Item Ledger Entry\";\n+ TransferHeader: Record \"Transfer Header\";\n+ TransferLine: Record \"Transfer Line\";\n+ PurchRcptLine: Record \"Purch. Rcpt. Line\";\n+ ItemLedgerEntryNo: Integer;\n+ PurchaseReceiptNo: Code[20];\n+ TransferOrder: TestPage \"Transfer Order\";\n+ begin\n+ // [SCENARIO 500597] Get Receipt Lines action on Transfer Order shows list of Posted Purchase Receipts having Transfer-from Code in Location Code of Purch Rcpt Lines and after selecting it populates Appl-to Item Entry field in Transfer Lines.\n+ Initialize();\n+\n+ // [GIVEN] Create an Item and Validate Costing Method.\n+ LibraryInventory.CreateItem(Item);\n+ Item.Validate(\"Costing Method\", Item.\"Costing Method\"::FIFO);\n+ Item.Modify(true);\n+\n+ // [GIVEN] Create two Locations with Inventory Posting Setup.\n+ LibraryWarehouse.CreateLocationWithInventoryPostingSetup(Location);\n+ LibraryWarehouse.CreateLocationWithInventoryPostingSetup(Location2);\n+\n+ // [GIVEN] Create another Location with Inventory Posting Setup \n+ // And Validate Use As In-Transit.\n+ LibraryWarehouse.CreateLocationWithInventoryPostingSetup(Location3);\n+ Location3.Validate(\"Use As In-Transit\", true);\n+ Location3.Modify(true);\n+\n+ // [GIVEN] Create a Vendor.\n+ LibraryPurchase.CreateVendor(Vendor);\n+\n+ // [GIVEN] Create and Post Purchase Receipt with Location Code on Header.\n+ CreateAndPostPurchRcptWithLocationCodeInPurchHeader(PurchaseHeader, PurchaseLine, Vendor, Item, Location);\n+\n+ // [GIVEN] Create and Post Purchase Receipt 2 with Location Code on Header.\n+ CreateAndPostPurchRcptWithLocationCodeInPurchHeader(PurchaseHeader2, PurchaseLine2, Vendor, Item, Location);\n+\n+ // [GIVEN] Create and Post Purchase Receipt 3 with Location Code on Line.\n+ PurchaseReceiptNo := CreateAndPostPurchRcptWithLocationCodeInPurchLine(\n+ PurchaseHeader3,\n+ PurchaseLine3,\n+ Vendor,\n+ Item,\n+ Location);\n+\n+ // [GIVEN] Find and save Item Ledger Entry No. in a Variable.\n+ ItemLedgerEntry.SetRange(\"Document No.\", PurchaseReceiptNo);\n+ ItemLedgerEntry.FindFirst();\n+ ItemLedgerEntryNo := ItemLedgerEntry.\"Entry No.\";\n+\n+ // [GIVEN] Find Purch. Rcpt Line.\n+ FindRandomReceiptLine(PurchaseReceiptNo, PurchRcptLine);\n+\n+ // [GIVEN] Create Transfer Header.\n+ LibraryInventory.CreateTransferHeader(TransferHeader, Location.Code, Location2.Code, Location3.Code);\n+\n+ // [GIVEN] Open Transfer Order page and run Get Receipt Line action.\n+ TransferOrder.OpenEdit();\n+ TransferOrder.GoToRecord(TransferHeader);\n+ LibraryVariableStorage.Enqueue(PurchaseReceiptNo);\n+ LibraryVariableStorage.Enqueue(PurchaseReceiptNo);\n+ LibraryVariableStorage.Enqueue(PurchRcptLine.\"No.\");\n+ TransferOrder.GetReceiptLines.Invoke();\n+\n+ // [WHEN] Find Transfer Line.\n+ TransferLine.SetRange(\"Document No.\", TransferHeader.\"No.\");\n+ TransferLine.FindFirst();\n+\n+ // [VERIFY] Appl-to Item Entry and Item Ledger Entry No. are same.\n+ Assert.AreEqual(\n+ ItemLedgerEntryNo,\n+ TransferLine.\"Appl.-to Item Entry\",\n+ StrSubstNo(\n+ ApplToItemEntryErr,\n+ TransferLine.FieldCaption(\"Appl.-to Item Entry\"),\n+ ItemLedgerEntryNo,\n+ TransferLine.TableCaption));\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n@@ -5168,6 +5262,52 @@\n Assert.AreEqual(LineCount, TransferReceiptLine.Count(), '');\n end;\n \n+ local procedure CreateAndPostPurchRcptWithLocationCodeInPurchHeader(\n+ var PurchaseHeader: Record \"Purchase Header\";\n+ var PurchaseLine: Record \"Purchase Line\";\n+ Vendor: Record Vendor;\n+ Item: Record Item;\n+ Location: Record Location)\n+ begin\n+ LibraryPurchase.CreatePurchHeader(PurchaseHeader, PurchaseHeader.\"Document Type\"::Order, Vendor.\"No.\");\n+ PurchaseHeader.Validate(\"Location Code\", Location.Code);\n+ PurchaseHeader.Modify(true);\n+\n+ LibraryPurchase.CreatePurchaseLine(\n+ PurchaseLine,\n+ PurchaseHeader,\n+ PurchaseLine.Type::Item,\n+ Item.\"No.\",\n+ LibraryRandom.RandIntInRange(10, 10));\n+\n+ PurchaseLine.Validate(\"Direct Unit Cost\", LibraryRandom.RandInt(15000));\n+ PurchaseLine.Modify(true);\n+\n+ LibraryPurchase.PostPurchaseDocument(PurchaseHeader, true, false);\n+ end;\n+\n+ local procedure CreateAndPostPurchRcptWithLocationCodeInPurchLine(\n+ var PurchaseHeader: Record \"Purchase Header\";\n+ var PurchaseLine: Record \"Purchase Line\";\n+ Vendor: Record Vendor;\n+ Item: Record Item;\n+ Location: Record Location): Code[20]\n+ begin\n+ LibraryPurchase.CreatePurchHeader(PurchaseHeader, PurchaseHeader.\"Document Type\"::Order, Vendor.\"No.\");\n+ LibraryPurchase.CreatePurchaseLine(\n+ PurchaseLine,\n+ PurchaseHeader,\n+ PurchaseLine.Type::Item,\n+ Item.\"No.\",\n+ LibraryRandom.RandIntInRange(10, 10));\n+\n+ PurchaseLine.Validate(\"Location Code\", Location.Code);\n+ PurchaseLine.Validate(\"Direct Unit Cost\", LibraryRandom.RandInt(15000));\n+ PurchaseLine.Modify(true);\n+\n+ exit(LibraryPurchase.PostPurchaseDocument(PurchaseHeader, true, false));\n+ end;\n+\n [MessageHandler]\n [Scope('OnPrem')]\n procedure MessageHandler(Message: Text[1024])\n@@ -5394,5 +5534,19 @@\n // 0 = Item.Type::Inventory\n Assert.AreEqual('0', ItemList.Filter.GetFilter(\"Type\"), 'Item List contains non-inventory items.');\n end;\n+\n+ [ModalPageHandler]\n+ [Scope('OnPrem')]\n+ procedure PostedPurchRcptLinesModalPageHandler(var PostedPurchaseReceiptLines: Page \"Posted Purchase Receipt Lines\"; var Response: Action)\n+ var\n+ PurchRcptLine: Record \"Purch. Rcpt. Line\";\n+ begin\n+ PurchRcptLine.SetRange(\"Document No.\", LibraryVariableStorage.DequeueText());\n+ PurchRcptLine.SetRange(\"No.\", LibraryVariableStorage.DequeueText());\n+ PurchRcptLine.FindFirst();\n+ PostedPurchaseReceiptLines.SetRecord(PurchRcptLine);\n+\n+ Response := ACTION::LookupOK;\n+ end;\n }\n \n", "patch": "diff --git a/App/Layers/W1/BaseApp/Inventory/Transfer/TransferHeader.Table.al b/App/Layers/W1/BaseApp/Inventory/Transfer/TransferHeader.Table.al\nindex 5fe44b4568d1..c16ab8669925 100644\n--- a/App/Layers/W1/BaseApp/Inventory/Transfer/TransferHeader.Table.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Transfer/TransferHeader.Table.al\n@@ -1304,7 +1304,7 @@ table 5740 \"Transfer Header\"\n TempPurchRcptHeader: Record \"Purch. Rcpt. Header\" temporary;\n PostedPurchaseReceipts: Page \"Posted Purchase Receipts\";\n begin\n- PurchRcptHeader.SetRange(\"Location Code\", \"Transfer-from Code\");\n+ FindPurchRcptHeader(PurchRcptHeader);\n PostedPurchaseReceipts.SetTableView(PurchRcptHeader);\n PostedPurchaseReceipts.LookupMode := true;\n if PostedPurchaseReceipts.RunModal() = ACTION::LookupOK then begin\n@@ -1376,6 +1376,8 @@ table 5740 \"Transfer Header\"\n PurchRcptLine.FilterPstdDocLnItemLedgEntries(ItemLedgerEntry);\n ItemTrackingDocMgt.CopyItemLedgerEntriesToTemp(TempItemLedgerEntry, ItemLedgerEntry);\n ItemTrackingMgt.CopyItemLedgEntryTrkgToTransferLine(TempItemLedgerEntry, TransferLine);\n+ TransferLine.\"Appl.-to Item Entry\" := ItemLedgerEntry.\"Entry No.\";\n+ TransferLine.Modify(false);\n \n OnAfterAddTransferLineFromReceiptLine(TransferLine, PurchRcptLine, TempItemLedgerEntry, Rec);\n end;\n@@ -1546,6 +1548,31 @@ table 5740 \"Transfer Header\"\n end;\n end;\n \n+ local procedure FindPurchRcptHeader(var PurchRcptHeader: Record \"Purch. Rcpt. Header\")\n+ var\n+ PurchRcptLine: Record \"Purch. Rcpt. Line\";\n+ DocumentNo: Code[20];\n+ begin\n+ PurchRcptLine.SetLoadFields(\"Document No.\", \"Location Code\");\n+ PurchRcptLine.SetCurrentKey(\"Document No.\");\n+ PurchRcptLine.SetRange(\"Location Code\", \"Transfer-from Code\");\n+ if PurchRcptLine.FindSet() then\n+ repeat\n+ GetPurchRcptHeader(PurchRcptHeader, PurchRcptLine, DocumentNo);\n+ until PurchRcptLine.Next() = 0;\n+ PurchRcptHeader.MarkedOnly(true);\n+ end;\n+\n+ local procedure GetPurchRcptHeader(var PurchRcptHeader: Record \"Purch. Rcpt. Header\"; PurchRcptLine: Record \"Purch. Rcpt. Line\"; var DocumentNo: Code[20])\n+ begin\n+ if PurchRcptLine.\"Document No.\" = DocumentNo then\n+ exit;\n+\n+ PurchRcptHeader.Get(PurchRcptLine.\"Document No.\");\n+ PurchRcptHeader.Mark(true);\n+ DocumentNo := PurchRcptLine.\"Document No.\";\n+ end;\n+\n [IntegrationEvent(false, false)]\n local procedure OnAddTransferLineFromReceiptLineOnBeforeTransferLineInsert(var TransferLine: Record \"Transfer Line\"; PurchRcptLine: Record \"Purch. Rcpt. Line\"; var TransferHeader: Record \"Transfer Header\")\n begin\n"} +{"instance_id": "microsoftInternal__NAV-176150__cf-1", "base_instance_id": "microsoftInternal__NAV-176150", "variant_description": "Preview Posting filters by Production Order No. only instead of full page context", "failure_layer": null, "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-176150__cf-1", "FAIL_TO_PASS": [{"codeunitID": 137072, "functionName": ["PreviewPostingOfProductionJournalPostsCorrectConsumptionILE"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMProductionOrdersII.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMProductionOrdersII.Codeunit.al\n--- a/App/Layers/W1/Tests/SCM/SCMProductionOrdersII.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMProductionOrdersII.Codeunit.al\n@@ -67,6 +67,7 @@ codeunit 137072 \"SCM Production Orders II\"\n TimeShiftedOnParentLineMsg: Label 'The production starting date-time of the end item has been moved forward because a subassembly is taking longer than planned.';\n DateConflictInReservErr: Label 'The change leads to a date conflict with existing reservations.';\n QuantityErr: Label '%1 must be %2 in %3', Comment = '%1: Quantity, %2: Consumption Quantity Value, %3: Item Ledger Entry';\n+ ILENoOfRecordsMustNotBeZeroErr: Label 'Item Ledger Entry No. of Records must not be zero.';\n \n [Test]\n [Scope('OnPrem')]\n@@ -4312,6 +4313,59 @@ codeunit 137072 \"SCM Production Orders II\"\n ItemLedgerEntry.TableCaption()));\n end;\n \n+ [Test]\n+ [Scope('OnPrem')]\n+ [HandlerFunctions('ProductionJournalPageHandler,GLPostingPreviewPageHandler')]\n+ procedure PreviewPostingOfProductionJournalPostsCorrectConsumptionILE()\n+ var\n+ Item, Item2 : Record Item;\n+ ProductionOrder, ProductionOrder2 : Record \"Production Order\";\n+ ItemJournalLine: Record \"Item Journal Line\";\n+ ReleasedProdOrder: TestPage \"Released Production Order\";\n+ begin\n+ // [SCENARIO 501883] When Preview Post or Post Production Journal From a Released Production Order, it creates correct Item Ledger Entries even if there is a Consumption Journal Line of completely different Production Order No. in Consumption Journal.\n+ Initialize();\n+\n+ // [GIVEN] Create Item.\n+ LibraryInventory.CreateItem(Item);\n+\n+ // [GIVEN] Create and Refresh Production Order.\n+ CreateAndRefreshProductionOrder(\n+ ProductionOrder,\n+ ProductionOrder.Status::Released,\n+ Item.\"No.\",\n+ LibraryRandom.RandIntInRange(10, 10),\n+ '',\n+ '');\n+\n+ // [GIVEN] Create Item 2.\n+ LibraryInventory.CreateItem(Item2);\n+\n+ // [GIVEN] Create and Refresh Production Order 2.\n+ CreateAndRefreshProductionOrder(\n+ ProductionOrder2,\n+ ProductionOrder2.Status::Released,\n+ Item2.\"No.\",\n+ LibraryRandom.RandIntInRange(10, 10),\n+ '',\n+ '');\n+\n+ // [GIVEN] Create Consumption Journal Line for Production Order 2.\n+ CreateConsumptionJournalLine(\n+ ItemJournalLine,\n+ ProductionOrder2.\"No.\",\n+ Item2.\"No.\",\n+ LibraryRandom.RandIntInRange(10, 10));\n+\n+ // [WHEN] Open Released Production Order page and run Production Journal action.\n+ ReleasedProdOrder.OpenEdit();\n+ ReleasedProdOrder.GoToRecord(ProductionOrder);\n+ ReleasedProdOrder.ProdOrderLines.ProductionJournal.Invoke();\n+\n+ // [VERIFY] Item Ledger Entry No. of Records in Posting Preview is not zero.\n+ Assert.AreNotEqual(0, LibraryVariableStorage.DequeueInteger(), ILENoOfRecordsMustNotBeZeroErr);\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n@@ -6045,6 +6099,43 @@ codeunit 137072 \"SCM Production Orders II\"\n LibraryManufacturing.UpdateRoutingStatus(RoutingHeader, RoutingHeader.Status::Certified);\n end;\n \n+ local procedure CreateConsumptionJournalLine(\n+ var ItemJournalLine: Record \"Item Journal Line\";\n+ ProdOrderNo: Code[20];\n+ ItemNo: Code[20];\n+ Qty: Decimal)\n+ var\n+ ItemJnlTemplate: Record \"Item Journal Template\";\n+ ItemJnlBatch: Record \"Item Journal Batch\";\n+ begin\n+ InitItemJournalBatch(ItemJnlBatch, ItemJnlBatch.\"Template Type\"::Consumption);\n+ ItemJournalLine.Init();\n+ ItemJournalLine.\"Entry Type\" := ItemJournalLine.\"Entry Type\"::Consumption;\n+\n+ ItemJnlTemplate.Get(ItemJnlBatch.\"Journal Template Name\");\n+ LibraryInventory.CreateItemJnlLineWithNoItem(\n+ ItemJournalLine,\n+ ItemJnlBatch,\n+ ItemJnlTemplate.Name,\n+ ItemJnlBatch.Name,\n+ ItemJournalLine.\"Entry Type\"::Consumption);\n+\n+ ItemJournalLine.Validate(\"Order Type\", ItemJournalLine.\"Order Type\"::Production);\n+ ItemJournalLine.Validate(\"Order No.\", ProdOrderNo);\n+ ItemJournalLine.Validate(\"Item No.\", ItemNo);\n+ ItemJournalLine.Validate(Quantity, Qty);\n+ ItemJournalLine.Modify(true);\n+ end;\n+\n+ local procedure InitItemJournalBatch(var ItemJnlBatch: Record \"Item Journal Batch\"; TemplateType: Enum \"Item Journal Template Type\")\n+ var\n+ ItemJnlTemplate: Record \"Item Journal Template\";\n+ begin\n+ LibraryInventory.SelectItemJournalTemplateName(ItemJnlTemplate, TemplateType);\n+ LibraryInventory.SelectItemJournalBatchName(ItemJnlBatch, TemplateType, ItemJnlTemplate.Name);\n+ LibraryInventory.ClearItemJournal(ItemJnlTemplate, ItemJnlBatch);\n+ end;\n+\n [ModalPageHandler]\n procedure ProductionJournalModalPageHandler(var ProductionJournal: TestPage \"Production Journal\")\n begin\n@@ -6143,6 +6234,21 @@ codeunit 137072 \"SCM Production Orders II\"\n ProductionJournal.Post.Invoke();\n end;\n \n+ [ModalPageHandler]\n+ [Scope('OnPrem')]\n+ procedure ProductionJournalPageHandler(var ProductionJournal: TestPage \"Production Journal\")\n+ begin\n+ ProductionJournal.PreviewPosting.Invoke();\n+ end;\n+\n+ [PageHandler]\n+ [Scope('OnPrem')]\n+ procedure GLPostingPreviewPageHandler(var ShowAllEntries: TestPage \"G/L Posting Preview\")\n+ begin\n+ ShowAllEntries.Filter.SetFilter(\"Table Name\", 'Item Ledger Entry');\n+ LibraryVariableStorage.Enqueue(ShowAllEntries.\"No. of Records\".AsInteger());\n+ end;\n+\n [MessageHandler]\n [Scope('OnPrem')]\n procedure MessageHandler(Message: Text[1024])\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Manufacturing/Journal/ProductionJournal.Page.al b/App/Layers/W1/BaseApp/Manufacturing/Journal/ProductionJournal.Page.al\n--- a/App/Layers/W1/BaseApp/Manufacturing/Journal/ProductionJournal.Page.al\n+++ b/App/Layers/W1/BaseApp/Manufacturing/Journal/ProductionJournal.Page.al\n@@ -1015,7 +1015,7 @@ page 5510 \"Production Journal\"\n \n protected procedure MarkRelevantRec(var ItemJournalLine: Record \"Item Journal Line\")\n begin\n- ItemJournalLine := Rec;\n+ ItemJournalLine.SetRange(\"Order No.\", Rec.\"Order No.\");\n if ItemJournalLine.FindSet() then begin\n repeat\n case ItemJournalLine.\"Entry Type\" of\n"} +{"instance_id": "microsoftInternal__NAV-176150__cf-2", "base_instance_id": "microsoftInternal__NAV-176150", "variant_description": "Preview Posting filters by Item No. only instead of full page context", "failure_layer": null, "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-176150__cf-2", "FAIL_TO_PASS": [{"codeunitID": 137072, "functionName": ["PreviewPostingOfProductionJournalPostsCorrectConsumptionILE"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMProductionOrdersII.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMProductionOrdersII.Codeunit.al\n--- a/App/Layers/W1/Tests/SCM/SCMProductionOrdersII.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMProductionOrdersII.Codeunit.al\n@@ -67,6 +67,7 @@ codeunit 137072 \"SCM Production Orders II\"\n TimeShiftedOnParentLineMsg: Label 'The production starting date-time of the end item has been moved forward because a subassembly is taking longer than planned.';\n DateConflictInReservErr: Label 'The change leads to a date conflict with existing reservations.';\n QuantityErr: Label '%1 must be %2 in %3', Comment = '%1: Quantity, %2: Consumption Quantity Value, %3: Item Ledger Entry';\n+ ILENoOfRecordsMustNotBeZeroErr: Label 'Item Ledger Entry No. of Records must not be zero.';\n \n [Test]\n [Scope('OnPrem')]\n@@ -4312,6 +4313,59 @@ codeunit 137072 \"SCM Production Orders II\"\n ItemLedgerEntry.TableCaption()));\n end;\n \n+ [Test]\n+ [Scope('OnPrem')]\n+ [HandlerFunctions('ProductionJournalPageHandler,GLPostingPreviewPageHandler')]\n+ procedure PreviewPostingOfProductionJournalPostsCorrectConsumptionILE()\n+ var\n+ Item, Item2 : Record Item;\n+ ProductionOrder, ProductionOrder2 : Record \"Production Order\";\n+ ItemJournalLine: Record \"Item Journal Line\";\n+ ReleasedProdOrder: TestPage \"Released Production Order\";\n+ begin\n+ // [SCENARIO 501883] When Preview Post or Post Production Journal From a Released Production Order, it creates correct Item Ledger Entries even if there is a Consumption Journal Line of completely different Production Order No. in Consumption Journal.\n+ Initialize();\n+\n+ // [GIVEN] Create Item.\n+ LibraryInventory.CreateItem(Item);\n+\n+ // [GIVEN] Create and Refresh Production Order.\n+ CreateAndRefreshProductionOrder(\n+ ProductionOrder,\n+ ProductionOrder.Status::Released,\n+ Item.\"No.\",\n+ LibraryRandom.RandIntInRange(10, 10),\n+ '',\n+ '');\n+\n+ // [GIVEN] Create Item 2.\n+ LibraryInventory.CreateItem(Item2);\n+\n+ // [GIVEN] Create and Refresh Production Order 2.\n+ CreateAndRefreshProductionOrder(\n+ ProductionOrder2,\n+ ProductionOrder2.Status::Released,\n+ Item2.\"No.\",\n+ LibraryRandom.RandIntInRange(10, 10),\n+ '',\n+ '');\n+\n+ // [GIVEN] Create Consumption Journal Line for Production Order 2.\n+ CreateConsumptionJournalLine(\n+ ItemJournalLine,\n+ ProductionOrder2.\"No.\",\n+ Item2.\"No.\",\n+ LibraryRandom.RandIntInRange(10, 10));\n+\n+ // [WHEN] Open Released Production Order page and run Production Journal action.\n+ ReleasedProdOrder.OpenEdit();\n+ ReleasedProdOrder.GoToRecord(ProductionOrder);\n+ ReleasedProdOrder.ProdOrderLines.ProductionJournal.Invoke();\n+\n+ // [VERIFY] Item Ledger Entry No. of Records in Posting Preview is not zero.\n+ Assert.AreNotEqual(0, LibraryVariableStorage.DequeueInteger(), ILENoOfRecordsMustNotBeZeroErr);\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n@@ -6045,6 +6099,43 @@ codeunit 137072 \"SCM Production Orders II\"\n LibraryManufacturing.UpdateRoutingStatus(RoutingHeader, RoutingHeader.Status::Certified);\n end;\n \n+ local procedure CreateConsumptionJournalLine(\n+ var ItemJournalLine: Record \"Item Journal Line\";\n+ ProdOrderNo: Code[20];\n+ ItemNo: Code[20];\n+ Qty: Decimal)\n+ var\n+ ItemJnlTemplate: Record \"Item Journal Template\";\n+ ItemJnlBatch: Record \"Item Journal Batch\";\n+ begin\n+ InitItemJournalBatch(ItemJnlBatch, ItemJnlBatch.\"Template Type\"::Consumption);\n+ ItemJournalLine.Init();\n+ ItemJournalLine.\"Entry Type\" := ItemJournalLine.\"Entry Type\"::Consumption;\n+\n+ ItemJnlTemplate.Get(ItemJnlBatch.\"Journal Template Name\");\n+ LibraryInventory.CreateItemJnlLineWithNoItem(\n+ ItemJournalLine,\n+ ItemJnlBatch,\n+ ItemJnlTemplate.Name,\n+ ItemJnlBatch.Name,\n+ ItemJournalLine.\"Entry Type\"::Consumption);\n+\n+ ItemJournalLine.Validate(\"Order Type\", ItemJournalLine.\"Order Type\"::Production);\n+ ItemJournalLine.Validate(\"Order No.\", ProdOrderNo);\n+ ItemJournalLine.Validate(\"Item No.\", ItemNo);\n+ ItemJournalLine.Validate(Quantity, Qty);\n+ ItemJournalLine.Modify(true);\n+ end;\n+\n+ local procedure InitItemJournalBatch(var ItemJnlBatch: Record \"Item Journal Batch\"; TemplateType: Enum \"Item Journal Template Type\")\n+ var\n+ ItemJnlTemplate: Record \"Item Journal Template\";\n+ begin\n+ LibraryInventory.SelectItemJournalTemplateName(ItemJnlTemplate, TemplateType);\n+ LibraryInventory.SelectItemJournalBatchName(ItemJnlBatch, TemplateType, ItemJnlTemplate.Name);\n+ LibraryInventory.ClearItemJournal(ItemJnlTemplate, ItemJnlBatch);\n+ end;\n+\n [ModalPageHandler]\n procedure ProductionJournalModalPageHandler(var ProductionJournal: TestPage \"Production Journal\")\n begin\n@@ -6143,6 +6234,21 @@ codeunit 137072 \"SCM Production Orders II\"\n ProductionJournal.Post.Invoke();\n end;\n \n+ [ModalPageHandler]\n+ [Scope('OnPrem')]\n+ procedure ProductionJournalPageHandler(var ProductionJournal: TestPage \"Production Journal\")\n+ begin\n+ ProductionJournal.PreviewPosting.Invoke();\n+ end;\n+\n+ [PageHandler]\n+ [Scope('OnPrem')]\n+ procedure GLPostingPreviewPageHandler(var ShowAllEntries: TestPage \"G/L Posting Preview\")\n+ begin\n+ ShowAllEntries.Filter.SetFilter(\"Table Name\", 'Item Ledger Entry');\n+ LibraryVariableStorage.Enqueue(ShowAllEntries.\"No. of Records\".AsInteger());\n+ end;\n+\n [MessageHandler]\n [Scope('OnPrem')]\n procedure MessageHandler(Message: Text[1024])\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Manufacturing/Journal/ProductionJournal.Page.al b/App/Layers/W1/BaseApp/Manufacturing/Journal/ProductionJournal.Page.al\n--- a/App/Layers/W1/BaseApp/Manufacturing/Journal/ProductionJournal.Page.al\n+++ b/App/Layers/W1/BaseApp/Manufacturing/Journal/ProductionJournal.Page.al\n@@ -1015,7 +1015,7 @@ page 5510 \"Production Journal\"\n \n protected procedure MarkRelevantRec(var ItemJournalLine: Record \"Item Journal Line\")\n begin\n- ItemJournalLine := Rec;\n+ ItemJournalLine.SetRange(\"Item No.\", Rec.\"Item No.\");\n if ItemJournalLine.FindSet() then begin\n repeat\n case ItemJournalLine.\"Entry Type\" of\n"} +{"instance_id": "microsoftInternal__NAV-176194__cf-1", "base_instance_id": "microsoftInternal__NAV-176194", "variant_description": "Qty. to Invoice validation removed entirely from Item Charge Assignment", "failure_layer": null, "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-176194__cf-1", "FAIL_TO_PASS": [{"codeunitID": 134329, "functionName": ["GetPostedDocumentLinesToReverseCopiesLinesWhenDefaultQtyToReceiveIsBlankInPurchPayablesSetup"]}, {"codeunitID": 134387, "functionName": ["GetPostedDocumentLinesToReverseCopiesLinesWhenDefaultQtyToShipIsBlankInSalesReceiSetup"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/ERMPurchaseReturnOrder.Codeunit.al b/App/Layers/W1/Tests/ERM/ERMPurchaseReturnOrder.Codeunit.al\nindex 75cffb82321a..4b0d9d056234 100644\n--- a/App/Layers/W1/Tests/ERM/ERMPurchaseReturnOrder.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ERMPurchaseReturnOrder.Codeunit.al\n@@ -48,6 +48,8 @@ codeunit 134329 \"ERM Purchase Return Order\"\n ContactShouldBeEditableErr: Label 'Contact should be editable when vendorr is selected.';\n FunctionMustNotBeCalledErr: Label 'Function %1 must not be called.', Comment = '%1 - function name';\n BatchPostingErrrorNotificationMsg: Label 'An error or warning occured during operation Batch processing of Purchase Header records.';\n+ ReturnQtyToShipMustBeZeroErr: Label ' Return Qty. to Ship must be zero.';\n+ QtyToAssignErr: Label '%1 must be %2 in %3', Comment = '%1 = Qty. to Assign, %2 = Quantity, %3 = Purchase Return Order Subform';\n \n [Test]\n [Scope('OnPrem')]\n@@ -1376,6 +1378,83 @@ codeunit 134329 \"ERM Purchase Return Order\"\n PurchaseLine.TableCaption));\n end;\n \n+ [Test]\n+ [Scope('OnPrem')]\n+ [HandlerFunctions('SuggestItemChargeAssignmentPageHandler,PostedPurchDocumentLinesPageHandler')]\n+ procedure GetPostedDocumentLinesToReverseCopiesLinesWhenDefaultQtyToReceiveIsBlankInPurchPayablesSetup()\n+ var\n+ Item: Record Item;\n+ ItemCharge: Record \"Item Charge\";\n+ PurchasePayablesSetup: Record \"Purchases & Payables Setup\";\n+ PurchaseHeader: Record \"Purchase Header\";\n+ PurchaseHeader2: Record \"Purchase Header\";\n+ PurchaseLine: Record \"Purchase Line\";\n+ Quantity: Decimal;\n+ PurchaseReturnOrder: TestPage \"Purchase Return Order\";\n+ PurchaseReturnOrderSubform: TestPage \"Purchase Return Order Subform\";\n+ begin\n+ // [SCENARIO 500596] Get Posted Document Lines to Reverse action on Purchase Return Order copies Purchase Invoice Lines of Type Item Charge Even when Default Qty to Receive on Purchase & Payables Setup is set to Blank.\n+ Initialize();\n+\n+ // [GIVEN] Validate Default Qty. to Receive in Purchase & Payables Setup.\n+ PurchasePayablesSetup.Get();\n+ PurchasePayablesSetup.Validate(\"Default Qty. to Receive\", PurchasePayablesSetup.\"Default Qty. to Receive\"::Blank);\n+ PurchasePayablesSetup.Modify(true);\n+\n+ // [GIVEN] Create an Item.\n+ LibraryInventory.CreateItem(Item);\n+\n+ // [GIVEN] Create an Item Charge.\n+ LibraryInventory.CreateItemCharge(ItemCharge);\n+\n+ // [GIVEN] Generate and Save Quantity in a Variable.\n+ Quantity := LibraryRandom.RandIntInRange(25, 25);\n+\n+ // [GIVEN] Create a Purchase Order with Item Charge.\n+ CreatePurchaseOrderWithItemCharge(PurchaseHeader, ItemCharge.\"No.\", Item.\"No.\", Quantity);\n+\n+ // [GIVEN] Set Purchase Order Lines Qty. to Receive.\n+ SetPurchaseLinesQtyToReceive(PurchaseHeader, Quantity);\n+\n+ // [GIVEN] Update Qty. to Assign on Item Charge Assignment.\n+ UpdateQtyToAssignOnItemChargeAssignment(PurchaseHeader);\n+\n+ // [GIVEN] Post Purchase Order.\n+ LibraryPurchase.PostPurchaseDocument(PurchaseHeader, true, true);\n+\n+ // [GIVEN] Create a Purchase Return Order.\n+ LibraryPurchase.CreatePurchHeader(PurchaseHeader2, PurchaseHeader2.\"Document Type\"::\"Return Order\", PurchaseHeader.\"Buy-from Vendor No.\");\n+\n+ // [GIVEN] Open Purchase Return Order page and run Get Posted Document Lines to Reverse action.\n+ PurchaseReturnOrder.OpenEdit();\n+ PurchaseReturnOrder.GoToRecord(PurchaseHeader2);\n+ LibraryVariableStorage.Enqueue(ItemCharge.\"No.\");\n+ PurchaseReturnOrder.GetPostedDocumentLinesToReverse.Invoke();\n+\n+ // [WHEN] Find Purchase Line of Purchase Return Order.\n+ PurchaseLine.SetRange(\"Document Type\", PurchaseLine.\"Document Type\"::\"Return Order\");\n+ PurchaseLine.SetRange(\"Document No.\", PurchaseHeader2.\"No.\");\n+ PurchaseLine.SetRange(Type, PurchaseLine.Type::\"Charge (Item)\");\n+ PurchaseLine.FindFirst();\n+\n+ // [VERIFY] Return Qty. to Receive in Purchase Line is 0.\n+ Assert.AreEqual(0, PurchaseLine.\"Return Qty. to Ship\", ReturnQtyToShipMustBeZeroErr);\n+\n+ // [WHEN] Open Purchase Return Order Subform page.\n+ PurchaseReturnOrderSubform.OpenEdit();\n+ PurchaseReturnOrderSubform.GoToRecord(PurchaseLine);\n+\n+ // [VERIFY] Quantity and Qty. to Assign in Purchase Line are same.\n+ Assert.AreEqual(\n+ Quantity,\n+ PurchaseReturnOrderSubform.\"Qty. to Assign\".AsDecimal(),\n+ StrSubstNo(\n+ QtyToAssignErr,\n+ PurchaseReturnOrderSubform.\"Qty. to Assign\".Caption(),\n+ Quantity,\n+ PurchaseReturnOrderSubform.Caption()));\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n@@ -2062,6 +2141,64 @@ codeunit 134329 \"ERM Purchase Return Order\"\n if Confirm(StrSubstNo(ExpectedMessage)) then;\n end;\n \n+ local procedure CreatePurchaseOrderWithItemCharge(\n+ var PurchaseHeader: Record \"Purchase Header\";\n+ ItemChargeNo: Code[20];\n+ ItemNo: Code[20];\n+ Quantity: Decimal)\n+ var\n+ PurchaseLineItemCharge: Record \"Purchase Line\";\n+ PurchaseLineItem: Record \"Purchase Line\";\n+ Vendor: Record Vendor;\n+ begin\n+ LibraryPurchase.CreateVendor(Vendor);\n+\n+ LibraryPurchase.CreatePurchHeader(PurchaseHeader, PurchaseHeader.\"Document Type\"::Order, Vendor.\"No.\");\n+ LibraryPurchase.CreatePurchaseLine(\n+ PurchaseLineItem,\n+ PurchaseHeader,\n+ PurchaseLineItem.Type::Item,\n+ ItemNo,\n+ Quantity);\n+\n+ PurchaseLineItem.Validate(\"Direct Unit Cost\", LibraryRandom.RandDec(100, 2));\n+ PurchaseLineItem.Modify(true);\n+\n+ LibraryPurchase.CreatePurchaseLine(\n+ PurchaseLineItemCharge,\n+ PurchaseHeader,\n+ PurchaseLineItemCharge.Type::\"Charge (Item)\",\n+ ItemChargeNo,\n+ Quantity);\n+\n+ PurchaseLineItemCharge.Validate(\"Direct Unit Cost\", LibraryRandom.RandDec(100, 2));\n+ PurchaseLineItemCharge.Modify(true);\n+ end;\n+\n+ local procedure SetPurchaseLinesQtyToReceive(var PurchaseHeader: Record \"Purchase Header\"; Quantity: Decimal)\n+ var\n+ PurchaseLine: Record \"Purchase Line\";\n+ begin\n+ PurchaseLine.SetRange(\"Document Type\", PurchaseHeader.\"Document Type\");\n+ PurchaseLine.SetRange(\"Document No.\", PurchaseHeader.\"No.\");\n+ PurchaseLine.FindSet();\n+ repeat\n+ PurchaseLine.Validate(\"Qty. to Receive\", Quantity);\n+ PurchaseLine.Modify(true);\n+ until PurchaseLine.Next() = 0;\n+ end;\n+\n+ local procedure UpdateQtyToAssignOnItemChargeAssignment(PurchaseHeader: Record \"Purchase Header\")\n+ var\n+ PurchaseLine: Record \"Purchase Line\";\n+ begin\n+ PurchaseLine.SetRange(\"Document Type\", PurchaseHeader.\"Document Type\");\n+ PurchaseLine.SetRange(\"Document No.\", PurchaseHeader.\"No.\");\n+ PurchaseLine.SetRange(Type, PurchaseLine.Type::\"Charge (Item)\");\n+ PurchaseLine.FindFirst();\n+ PurchaseLine.ShowItemChargeAssgnt();\n+ end;\n+\n [ConfirmHandler]\n [Scope('OnPrem')]\n procedure ConfirmHandler(Question: Text[1024]; var Reply: Boolean)\n@@ -2162,6 +2299,21 @@ codeunit 134329 \"ERM Purchase Return Order\"\n GetReturnShipmentLines.OK().Invoke();\n end;\n \n+ [ModalPageHandler]\n+ [Scope('OnPrem')]\n+ procedure PostedPurchDocumentLinesPageHandler(var PostedPurchaseDocumentLines: TestPage \"Posted Purchase Document Lines\")\n+ begin\n+ PostedPurchaseDocumentLines.PostedInvoices.Filter.SetFilter(\"No.\", LibraryVariableStorage.DequeueText());\n+ PostedPurchaseDocumentLines.OK().Invoke();\n+ end;\n+\n+ [ModalPageHandler]\n+ [Scope('OnPrem')]\n+ procedure SuggestItemChargeAssignmentPageHandler(var ItemChargeAssignmentPurch: TestPage \"Item Charge Assignment (Purch)\")\n+ begin\n+ ItemChargeAssignmentPurch.SuggestItemChargeAssignment.Invoke();\n+ end;\n+\n [SendNotificationHandler]\n [Scope('OnPrem')]\n procedure SendNotificationHandler(var Notification: Notification): Boolean\ndiff --git a/App/Layers/W1/Tests/ERM/ERMSalesDocumentsIII.Codeunit.al b/App/Layers/W1/Tests/ERM/ERMSalesDocumentsIII.Codeunit.al\nindex 3f3d49bb821b..bc9ebbd1cdfb 100644\n--- a/App/Layers/W1/Tests/ERM/ERMSalesDocumentsIII.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ERMSalesDocumentsIII.Codeunit.al\n@@ -80,6 +80,8 @@ codeunit 134387 \"ERM Sales Documents III\"\n PackageTrackingNoErr: Label 'Package Tracking No does not exist.';\n CannotAllowInvDiscountErr: Label 'The value of the Allow Invoice Disc. field is not valid when the VAT Calculation Type field is set to \"Full VAT\".';\n PostingPreviewNoTok: Label '***', Locked = true;\n+ ReturnQtyToReceiveMustBeZeroErr: Label ' Return Qty. to Receive must be zero.';\n+ QtyToAssignErr: Label '%1 must be %2 in %3', Comment = '%1 = Qty. to Assign, %2 = Quantity, %3 = Sales Return Order Subform';\n \n [Test]\n [Scope('OnPrem')]\n@@ -5943,6 +5945,83 @@ codeunit 134387 \"ERM Sales Documents III\"\n Assert.AreNotEqual(Customer.\"Country/Region Code\", SalesHeader.\"Rcvd.-from Count./Region Code\", 'Received-from Country Code is set just as it is on customer');\n end;\n \n+ [Test]\n+ [Scope('OnPrem')]\n+ [HandlerFunctions('SuggestItemChargeAssignmentPageHandler,PostedSalesDocumentLinesPageHandler')]\n+ procedure GetPostedDocumentLinesToReverseCopiesLinesWhenDefaultQtyToShipIsBlankInSalesReceiSetup()\n+ var\n+ Item: Record Item;\n+ ItemCharge: Record \"Item Charge\";\n+ SalesReceivablesSetup: Record \"Sales & Receivables Setup\";\n+ SalesHeader: Record \"Sales Header\";\n+ SalesHeader2: Record \"Sales Header\";\n+ SalesLine: Record \"Sales Line\";\n+ Quantity: Decimal;\n+ SalesReturnOrder: TestPage \"Sales Return Order\";\n+ SalesReturnOrderSubform: TestPage \"Sales Return Order Subform\";\n+ begin\n+ // [SCENARIO 500596] Get Posted Document Lines to Reverse action on Sales Return Order copies Sales Invoice Lines of Type Item Charge Even when Default Qty to Ship on Sales & Receivables Setup is set to Blank.\n+ Initialize();\n+\n+ // [GIVEN] Validate Default Quantity to Ship in Sales & Receivables Setup.\n+ SalesReceivablesSetup.Get();\n+ SalesReceivablesSetup.Validate(\"Default Quantity to Ship\", SalesReceivablesSetup.\"Default Quantity to Ship\"::Blank);\n+ SalesReceivablesSetup.Modify(true);\n+\n+ // [GIVEN] Create an Item.\n+ LibraryInventory.CreateItem(Item);\n+\n+ // [GIVEN] Create an Item Charge.\n+ LibraryInventory.CreateItemCharge(ItemCharge);\n+\n+ // [GIVEN] Generate and Save Quantity in a Variable.\n+ Quantity := LibraryRandom.RandIntInRange(25, 25);\n+\n+ // [GIVEN] Create a Sales Order with Item Charge.\n+ CreateSalesOrderWithItemCharge(SalesHeader, ItemCharge.\"No.\", Item.\"No.\", Quantity);\n+\n+ // [GIVEN] Set Sales Order Lines Qty. to Ship.\n+ SetSalesLinesQtyToShip(SalesHeader, Quantity);\n+\n+ // [GIVEN] Update Qty. to Assign on Item Charge Assignment.\n+ UpdateQtyToAssignOnItemChargeAssignment(SalesHeader);\n+\n+ // [GIVEN] Post Sales Order.\n+ LibrarySales.PostSalesDocument(SalesHeader, true, true);\n+\n+ // [GIVEN] Create a Sales Return Order.\n+ LibrarySales.CreateSalesHeader(SalesHeader2, SalesHeader2.\"Document Type\"::\"Return Order\", SalesHeader.\"Sell-to Customer No.\");\n+\n+ // [GIVEN] Open Sales Return Order page and run Get Posted Document Lines to Reverse action.\n+ SalesReturnOrder.OpenEdit();\n+ SalesReturnOrder.GoToRecord(SalesHeader2);\n+ LibraryVariableStorage.Enqueue(ItemCharge.\"No.\");\n+ SalesReturnOrder.GetPostedDocumentLinesToReverse.Invoke();\n+\n+ // [WHEN] Find Sales Line of Sales Return Order.\n+ SalesLine.SetRange(\"Document Type\", SalesLine.\"Document Type\"::\"Return Order\");\n+ SalesLine.SetRange(\"Document No.\", SalesHeader2.\"No.\");\n+ SalesLine.SetRange(Type, SalesLine.Type::\"Charge (Item)\");\n+ SalesLine.FindFirst();\n+\n+ // [VERIFY] Return Qty. to Receive in Sales Line is 0.\n+ Assert.AreEqual(0, SalesLine.\"Return Qty. to Receive\", ReturnQtyToReceiveMustBeZeroErr);\n+\n+ // [WHEN] Open Sales Return Order Subform page.\n+ SalesReturnOrderSubform.OpenEdit();\n+ SalesReturnOrderSubform.GoToRecord(SalesLine);\n+\n+ // [VERIFY] Quantity and Qty. to Assign in Sales Line are same.\n+ Assert.AreEqual(\n+ Quantity,\n+ SalesReturnOrderSubform.\"Qty. to Assign\".AsDecimal(),\n+ StrSubstNo(\n+ QtyToAssignErr,\n+ SalesReturnOrderSubform.\"Qty. to Assign\".Caption(),\n+ Quantity,\n+ SalesReturnOrderSubform.Caption()));\n+ end;\n+\n local procedure Initialize()\n var\n ReportSelections: Record \"Report Selections\";\n@@ -7148,6 +7227,64 @@ codeunit 134387 \"ERM Sales Documents III\"\n SalesReceivablesSetup.Modify();\n end;\n \n+ local procedure CreateSalesOrderWithItemCharge(\n+ var SalesHeader: Record \"Sales Header\";\n+ ItemChargeNo: Code[20];\n+ ItemNo: Code[20];\n+ Quantity: Decimal)\n+ var\n+ SalesLineItemCharge: Record \"Sales Line\";\n+ SalesLineItem: Record \"Sales Line\";\n+ Customer: Record Customer;\n+ begin\n+ LibrarySales.CreateCustomer(Customer);\n+\n+ LibrarySales.CreateSalesHeader(SalesHeader, SalesHeader.\"Document Type\"::Order, Customer.\"No.\");\n+ LibrarySales.CreateSalesLine(\n+ SalesLineItem,\n+ SalesHeader,\n+ SalesLineItem.Type::Item,\n+ ItemNo,\n+ Quantity);\n+\n+ SalesLineItem.Validate(\"Unit Price\", LibraryRandom.RandDec(100, 2));\n+ SalesLineItem.Modify(true);\n+\n+ LibrarySales.CreateSalesLine(\n+ SalesLineItemCharge,\n+ SalesHeader,\n+ SalesLineItemCharge.Type::\"Charge (Item)\",\n+ ItemChargeNo,\n+ Quantity);\n+\n+ SalesLineItemCharge.Validate(\"Unit Price\", LibraryRandom.RandDec(100, 2));\n+ SalesLineItemCharge.Modify(true);\n+ end;\n+\n+ local procedure SetSalesLinesQtyToShip(var SalesHeader: Record \"Sales Header\"; Quantity: Decimal)\n+ var\n+ SalesLine: Record \"Sales Line\";\n+ begin\n+ SalesLine.SetRange(\"Document Type\", SalesHeader.\"Document Type\");\n+ SalesLine.SetRange(\"Document No.\", SalesHeader.\"No.\");\n+ SalesLine.FindSet();\n+ repeat\n+ SalesLine.Validate(\"Qty. to Ship\", Quantity);\n+ SalesLine.Modify(true);\n+ until SalesLine.Next() = 0;\n+ end;\n+\n+ local procedure UpdateQtyToAssignOnItemChargeAssignment(SalesHeader: Record \"Sales Header\")\n+ var\n+ SalesLine: Record \"Sales Line\";\n+ begin\n+ SalesLine.SetRange(\"Document Type\", SalesHeader.\"Document Type\");\n+ SalesLine.SetRange(\"Document No.\", SalesHeader.\"No.\");\n+ SalesLine.SetRange(Type, SalesLine.Type::\"Charge (Item)\");\n+ SalesLine.FindFirst();\n+ SalesLine.ShowItemChargeAssgnt();\n+ end;\n+\n [ConfirmHandler]\n [Scope('OnPrem')]\n procedure CreateEmptyPostedInvConfirmHandler(Question: Text[1024]; var Reply: Boolean)\n@@ -7426,5 +7563,20 @@ codeunit 134387 \"ERM Sales Documents III\"\n Assert.AreEqual(LibraryVariableStorage.DequeueText(), ChangeLogEntries.\"New Value\".Value(), ChangeLogEntries.\"New Value\".Caption());\n ChangeLogEntries.OK().Invoke();\n end;\n+\n+ [ModalPageHandler]\n+ [Scope('OnPrem')]\n+ procedure PostedSalesDocumentLinesPageHandler(var PostedSalesDocumentLines: TestPage \"Posted Sales Document Lines\")\n+ begin\n+ PostedSalesDocumentLines.PostedInvoices.Filter.SetFilter(\"No.\", LibraryVariableStorage.DequeueText());\n+ PostedSalesDocumentLines.OK().Invoke();\n+ end;\n+\n+ [ModalPageHandler]\n+ [Scope('OnPrem')]\n+ procedure SuggestItemChargeAssignmentPageHandler(var ItemChargeAssignmentSales: TestPage \"Item Charge Assignment (Sales)\")\n+ begin\n+ ItemChargeAssignmentSales.SuggestItemChargeAssignment.Invoke();\n+ end;\n }\n \n", "patch": "diff --git a/App/Layers/W1/BaseApp/Purchases/Document/ItemChargeAssignmentPurch.Table.al b/App/Layers/W1/BaseApp/Purchases/Document/ItemChargeAssignmentPurch.Table.al\n--- a/App/Layers/W1/BaseApp/Purchases/Document/ItemChargeAssignmentPurch.Table.al\n+++ b/App/Layers/W1/BaseApp/Purchases/Document/ItemChargeAssignmentPurch.Table.al\n@@ -53,10 +53,9 @@ table 5805 \"Item Charge Assignment (Purch)\"\n DecimalPlaces = 0 : 5;\n \n trigger OnValidate()\n begin\n PurchLine.Get(\"Document Type\", \"Document No.\", \"Document Line No.\");\n- if Rec.\"Qty. to Assign\" <> xRec.\"Qty. to Assign\" then\n- PurchLine.TestField(\"Qty. to Invoice\");\n+ // Qty. to Invoice validation removed\n \n TestField(\"Applies-to Doc. Line No.\");\n if (\"Qty. to Assign\" <> 0) and (\"Applies-to Doc. Type\" = \"Document Type\") then\ndiff --git a/App/Layers/W1/BaseApp/Sales/Document/ItemChargeAssignmentSales.Table.al b/App/Layers/W1/BaseApp/Sales/Document/ItemChargeAssignmentSales.Table.al\n--- a/App/Layers/W1/BaseApp/Sales/Document/ItemChargeAssignmentSales.Table.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/ItemChargeAssignmentSales.Table.al\n@@ -56,10 +56,10 @@ table 5809 \"Item Charge Assignment (Sales)\"\n DecimalPlaces = 0 : 5;\n \n trigger OnValidate()\n begin\n SalesLine.Get(\"Document Type\", \"Document No.\", \"Document Line No.\");\n- if Rec.\"Qty. to Assign\" <> xRec.\"Qty. to Assign\" then\n- SalesLine.TestField(\"Qty. to Invoice\");\n+ // Qty. to Invoice validation removed\n+\n TestField(\"Applies-to Doc. Line No.\");\n if (\"Qty. to Assign\" <> 0) and (\"Applies-to Doc. Type\" = \"Document Type\") then\n if SalesLineInvoiced() then\n"} +{"instance_id": "microsoftInternal__NAV-176194__cf-2", "base_instance_id": "microsoftInternal__NAV-176194", "variant_description": "Qty. to Invoice validated only when Default Qty is Remainder instead of skipped when Blank", "failure_layer": null, "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-176194__cf-2", "FAIL_TO_PASS": [{"codeunitID": 134329, "functionName": ["GetPostedDocumentLinesToReverseCopiesLinesWhenDefaultQtyToReceiveIsBlankInPurchPayablesSetup"]}, {"codeunitID": 134387, "functionName": ["GetPostedDocumentLinesToReverseCopiesLinesWhenDefaultQtyToShipIsBlankInSalesReceiSetup"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/ERMPurchaseReturnOrder.Codeunit.al b/App/Layers/W1/Tests/ERM/ERMPurchaseReturnOrder.Codeunit.al\nindex 75cffb8..4b0d9d0 100644\n--- a/App/Layers/W1/Tests/ERM/ERMPurchaseReturnOrder.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ERMPurchaseReturnOrder.Codeunit.al\n@@ -48,6 +48,8 @@ codeunit 134329 \"ERM Purchase Return Order\"\n ContactShouldBeEditableErr: Label 'Contact should be editable when vendorr is selected.';\n FunctionMustNotBeCalledErr: Label 'Function %1 must not be called.', Comment = '%1 - function name';\n BatchPostingErrrorNotificationMsg: Label 'An error or warning occured during operation Batch processing of Purchase Header records.';\n+ ReturnQtyToShipMustBeZeroErr: Label ' Return Qty. to Ship must be zero.';\n+ QtyToAssignErr: Label '%1 must be %2 in %3', Comment = '%1 = Qty. to Assign, %2 = Quantity, %3 = Purchase Return Order Subform';\n \n [Test]\n [Scope('OnPrem')]\n@@ -1376,6 +1378,83 @@ codeunit 134329 \"ERM Purchase Return Order\"\n PurchaseLine.TableCaption));\n end;\n \n+ [Test]\n+ [Scope('OnPrem')]\n+ [HandlerFunctions('SuggestItemChargeAssignmentPageHandler,PostedPurchDocumentLinesPageHandler')]\n+ procedure GetPostedDocumentLinesToReverseCopiesLinesWhenDefaultQtyToReceiveIsBlankInPurchPayablesSetup()\n+ var\n+ Item: Record Item;\n+ ItemCharge: Record \"Item Charge\";\n+ PurchasePayablesSetup: Record \"Purchases & Payables Setup\";\n+ PurchaseHeader: Record \"Purchase Header\";\n+ PurchaseHeader2: Record \"Purchase Header\";\n+ PurchaseLine: Record \"Purchase Line\";\n+ Quantity: Decimal;\n+ PurchaseReturnOrder: TestPage \"Purchase Return Order\";\n+ PurchaseReturnOrderSubform: TestPage \"Purchase Return Order Subform\";\n+ begin\n+ // [SCENARIO 500596] Get Posted Document Lines to Reverse action on Purchase Return Order copies Purchase Invoice Lines of Type Item Charge Even when Default Qty to Receive on Purchase & Payables Setup is set to Blank.\n+ Initialize();\n+\n+ // [GIVEN] Validate Default Qty. to Receive in Purchase & Payables Setup.\n+ PurchasePayablesSetup.Get();\n+ PurchasePayablesSetup.Validate(\"Default Qty. to Receive\", PurchasePayablesSetup.\"Default Qty. to Receive\"::Blank);\n+ PurchasePayablesSetup.Modify(true);\n+\n+ // [GIVEN] Create an Item.\n+ LibraryInventory.CreateItem(Item);\n+\n+ // [GIVEN] Create an Item Charge.\n+ LibraryInventory.CreateItemCharge(ItemCharge);\n+\n+ // [GIVEN] Generate and Save Quantity in a Variable.\n+ Quantity := LibraryRandom.RandIntInRange(25, 25);\n+\n+ // [GIVEN] Create a Purchase Order with Item Charge.\n+ CreatePurchaseOrderWithItemCharge(PurchaseHeader, ItemCharge.\"No.\", Item.\"No.\", Quantity);\n+\n+ // [GIVEN] Set Purchase Order Lines Qty. to Receive.\n+ SetPurchaseLinesQtyToReceive(PurchaseHeader, Quantity);\n+\n+ // [GIVEN] Update Qty. to Assign on Item Charge Assignment.\n+ UpdateQtyToAssignOnItemChargeAssignment(PurchaseHeader);\n+\n+ // [GIVEN] Post Purchase Order.\n+ LibraryPurchase.PostPurchaseDocument(PurchaseHeader, true, true);\n+\n+ // [GIVEN] Create a Purchase Return Order.\n+ LibraryPurchase.CreatePurchHeader(PurchaseHeader2, PurchaseHeader2.\"Document Type\"::\"Return Order\", PurchaseHeader.\"Buy-from Vendor No.\");\n+\n+ // [GIVEN] Open Purchase Return Order page and run Get Posted Document Lines to Reverse action.\n+ PurchaseReturnOrder.OpenEdit();\n+ PurchaseReturnOrder.GoToRecord(PurchaseHeader2);\n+ LibraryVariableStorage.Enqueue(ItemCharge.\"No.\");\n+ PurchaseReturnOrder.GetPostedDocumentLinesToReverse.Invoke();\n+\n+ // [WHEN] Find Purchase Line of Purchase Return Order.\n+ PurchaseLine.SetRange(\"Document Type\", PurchaseLine.\"Document Type\"::\"Return Order\");\n+ PurchaseLine.SetRange(\"Document No.\", PurchaseHeader2.\"No.\");\n+ PurchaseLine.SetRange(Type, PurchaseLine.Type::\"Charge (Item)\");\n+ PurchaseLine.FindFirst();\n+\n+ // [VERIFY] Return Qty. to Receive in Purchase Line is 0.\n+ Assert.AreEqual(0, PurchaseLine.\"Return Qty. to Ship\", ReturnQtyToShipMustBeZeroErr);\n+\n+ // [WHEN] Open Purchase Return Order Subform page.\n+ PurchaseReturnOrderSubform.OpenEdit();\n+ PurchaseReturnOrderSubform.GoToRecord(PurchaseLine);\n+\n+ // [VERIFY] Quantity and Qty. to Assign in Purchase Line are same.\n+ Assert.AreEqual(\n+ Quantity,\n+ PurchaseReturnOrderSubform.\"Qty. to Assign\".AsDecimal(),\n+ StrSubstNo(\n+ QtyToAssignErr,\n+ PurchaseReturnOrderSubform.\"Qty. to Assign\".Caption(),\n+ Quantity,\n+ PurchaseReturnOrderSubform.Caption()));\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n@@ -2062,6 +2141,64 @@ codeunit 134329 \"ERM Purchase Return Order\"\n if Confirm(StrSubstNo(ExpectedMessage)) then;\n end;\n \n+ local procedure CreatePurchaseOrderWithItemCharge(\n+ var PurchaseHeader: Record \"Purchase Header\";\n+ ItemChargeNo: Code[20];\n+ ItemNo: Code[20];\n+ Quantity: Decimal)\n+ var\n+ PurchaseLineItemCharge: Record \"Purchase Line\";\n+ PurchaseLineItem: Record \"Purchase Line\";\n+ Vendor: Record Vendor;\n+ begin\n+ LibraryPurchase.CreateVendor(Vendor);\n+\n+ LibraryPurchase.CreatePurchHeader(PurchaseHeader, PurchaseHeader.\"Document Type\"::Order, Vendor.\"No.\");\n+ LibraryPurchase.CreatePurchaseLine(\n+ PurchaseLineItem,\n+ PurchaseHeader,\n+ PurchaseLineItem.Type::Item,\n+ ItemNo,\n+ Quantity);\n+\n+ PurchaseLineItem.Validate(\"Direct Unit Cost\", LibraryRandom.RandDec(100, 2));\n+ PurchaseLineItem.Modify(true);\n+\n+ LibraryPurchase.CreatePurchaseLine(\n+ PurchaseLineItemCharge,\n+ PurchaseHeader,\n+ PurchaseLineItemCharge.Type::\"Charge (Item)\",\n+ ItemChargeNo,\n+ Quantity);\n+\n+ PurchaseLineItemCharge.Validate(\"Direct Unit Cost\", LibraryRandom.RandDec(100, 2));\n+ PurchaseLineItemCharge.Modify(true);\n+ end;\n+\n+ local procedure SetPurchaseLinesQtyToReceive(var PurchaseHeader: Record \"Purchase Header\"; Quantity: Decimal)\n+ var\n+ PurchaseLine: Record \"Purchase Line\";\n+ begin\n+ PurchaseLine.SetRange(\"Document Type\", PurchaseHeader.\"Document Type\");\n+ PurchaseLine.SetRange(\"Document No.\", PurchaseHeader.\"No.\");\n+ PurchaseLine.FindSet();\n+ repeat\n+ PurchaseLine.Validate(\"Qty. to Receive\", Quantity);\n+ PurchaseLine.Modify(true);\n+ until PurchaseLine.Next() = 0;\n+ end;\n+\n+ local procedure UpdateQtyToAssignOnItemChargeAssignment(PurchaseHeader: Record \"Purchase Header\")\n+ var\n+ PurchaseLine: Record \"Purchase Line\";\n+ begin\n+ PurchaseLine.SetRange(\"Document Type\", PurchaseHeader.\"Document Type\");\n+ PurchaseLine.SetRange(\"Document No.\", PurchaseHeader.\"No.\");\n+ PurchaseLine.SetRange(Type, PurchaseLine.Type::\"Charge (Item)\");\n+ PurchaseLine.FindFirst();\n+ PurchaseLine.ShowItemChargeAssgnt();\n+ end;\n+\n [ConfirmHandler]\n [Scope('OnPrem')]\n procedure ConfirmHandler(Question: Text[1024]; var Reply: Boolean)\n@@ -2162,6 +2299,21 @@ codeunit 134329 \"ERM Purchase Return Order\"\n GetReturnShipmentLines.OK().Invoke();\n end;\n \n+ [ModalPageHandler]\n+ [Scope('OnPrem')]\n+ procedure PostedPurchDocumentLinesPageHandler(var PostedPurchaseDocumentLines: TestPage \"Posted Purchase Document Lines\")\n+ begin\n+ PostedPurchaseDocumentLines.PostedInvoices.Filter.SetFilter(\"No.\", LibraryVariableStorage.DequeueText());\n+ PostedPurchaseDocumentLines.OK().Invoke();\n+ end;\n+\n+ [ModalPageHandler]\n+ [Scope('OnPrem')]\n+ procedure SuggestItemChargeAssignmentPageHandler(var ItemChargeAssignmentPurch: TestPage \"Item Charge Assignment (Purch)\")\n+ begin\n+ ItemChargeAssignmentPurch.SuggestItemChargeAssignment.Invoke();\n+ end;\n+\n [SendNotificationHandler]\n [Scope('OnPrem')]\n procedure SendNotificationHandler(var Notification: Notification): Boolean\ndiff --git a/App/Layers/W1/Tests/ERM/ERMSalesDocumentsIII.Codeunit.al b/App/Layers/W1/Tests/ERM/ERMSalesDocumentsIII.Codeunit.al\nindex 3f3d49b..bc9ebbd 100644\n--- a/App/Layers/W1/Tests/ERM/ERMSalesDocumentsIII.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ERMSalesDocumentsIII.Codeunit.al\n@@ -80,6 +80,8 @@ codeunit 134387 \"ERM Sales Documents III\"\n PackageTrackingNoErr: Label 'Package Tracking No does not exist.';\n CannotAllowInvDiscountErr: Label 'The value of the Allow Invoice Disc. field is not valid when the VAT Calculation Type field is set to \"Full VAT\".';\n PostingPreviewNoTok: Label '***', Locked = true;\n+ ReturnQtyToReceiveMustBeZeroErr: Label ' Return Qty. to Receive must be zero.';\n+ QtyToAssignErr: Label '%1 must be %2 in %3', Comment = '%1 = Qty. to Assign, %2 = Quantity, %3 = Sales Return Order Subform';\n \n [Test]\n [Scope('OnPrem')]\n@@ -5943,6 +5945,83 @@ codeunit 134387 \"ERM Sales Documents III\"\n Assert.AreNotEqual(Customer.\"Country/Region Code\", SalesHeader.\"Rcvd.-from Count./Region Code\", 'Received-from Country Code is set just as it is on customer');\n end;\n \n+ [Test]\n+ [Scope('OnPrem')]\n+ [HandlerFunctions('SuggestItemChargeAssignmentPageHandler,PostedSalesDocumentLinesPageHandler')]\n+ procedure GetPostedDocumentLinesToReverseCopiesLinesWhenDefaultQtyToShipIsBlankInSalesReceiSetup()\n+ var\n+ Item: Record Item;\n+ ItemCharge: Record \"Item Charge\";\n+ SalesReceivablesSetup: Record \"Sales & Receivables Setup\";\n+ SalesHeader: Record \"Sales Header\";\n+ SalesHeader2: Record \"Sales Header\";\n+ SalesLine: Record \"Sales Line\";\n+ Quantity: Decimal;\n+ SalesReturnOrder: TestPage \"Sales Return Order\";\n+ SalesReturnOrderSubform: TestPage \"Sales Return Order Subform\";\n+ begin\n+ // [SCENARIO 500596] Get Posted Document Lines to Reverse action on Sales Return Order copies Sales Invoice Lines of Type Item Charge Even when Default Qty to Ship on Sales & Receivables Setup is set to Blank.\n+ Initialize();\n+\n+ // [GIVEN] Validate Default Quantity to Ship in Sales & Receivables Setup.\n+ SalesReceivablesSetup.Get();\n+ SalesReceivablesSetup.Validate(\"Default Quantity to Ship\", SalesReceivablesSetup.\"Default Quantity to Ship\"::Blank);\n+ SalesReceivablesSetup.Modify(true);\n+\n+ // [GIVEN] Create an Item.\n+ LibraryInventory.CreateItem(Item);\n+\n+ // [GIVEN] Create an Item Charge.\n+ LibraryInventory.CreateItemCharge(ItemCharge);\n+\n+ // [GIVEN] Generate and Save Quantity in a Variable.\n+ Quantity := LibraryRandom.RandIntInRange(25, 25);\n+\n+ // [GIVEN] Create a Sales Order with Item Charge.\n+ CreateSalesOrderWithItemCharge(SalesHeader, ItemCharge.\"No.\", Item.\"No.\", Quantity);\n+\n+ // [GIVEN] Set Sales Order Lines Qty. to Ship.\n+ SetSalesLinesQtyToShip(SalesHeader, Quantity);\n+\n+ // [GIVEN] Update Qty. to Assign on Item Charge Assignment.\n+ UpdateQtyToAssignOnItemChargeAssignment(SalesHeader);\n+\n+ // [GIVEN] Post Sales Order.\n+ LibrarySales.PostSalesDocument(SalesHeader, true, true);\n+\n+ // [GIVEN] Create a Sales Return Order.\n+ LibrarySales.CreateSalesHeader(SalesHeader2, SalesHeader2.\"Document Type\"::\"Return Order\", SalesHeader.\"Sell-to Customer No.\");\n+\n+ // [GIVEN] Open Sales Return Order page and run Get Posted Document Lines to Reverse action.\n+ SalesReturnOrder.OpenEdit();\n+ SalesReturnOrder.GoToRecord(SalesHeader2);\n+ LibraryVariableStorage.Enqueue(ItemCharge.\"No.\");\n+ SalesReturnOrder.GetPostedDocumentLinesToReverse.Invoke();\n+\n+ // [WHEN] Find Sales Line of Sales Return Order.\n+ SalesLine.SetRange(\"Document Type\", SalesLine.\"Document Type\"::\"Return Order\");\n+ SalesLine.SetRange(\"Document No.\", SalesHeader2.\"No.\");\n+ SalesLine.SetRange(Type, SalesLine.Type::\"Charge (Item)\");\n+ SalesLine.FindFirst();\n+\n+ // [VERIFY] Return Qty. to Receive in Sales Line is 0.\n+ Assert.AreEqual(0, SalesLine.\"Return Qty. to Receive\", ReturnQtyToReceiveMustBeZeroErr);\n+\n+ // [WHEN] Open Sales Return Order Subform page.\n+ SalesReturnOrderSubform.OpenEdit();\n+ SalesReturnOrderSubform.GoToRecord(SalesLine);\n+\n+ // [VERIFY] Quantity and Qty. to Assign in Sales Line are same.\n+ Assert.AreEqual(\n+ Quantity,\n+ SalesReturnOrderSubform.\"Qty. to Assign\".AsDecimal(),\n+ StrSubstNo(\n+ QtyToAssignErr,\n+ SalesReturnOrderSubform.\"Qty. to Assign\".Caption(),\n+ Quantity,\n+ SalesReturnOrderSubform.Caption()));\n+ end;\n+\n local procedure Initialize()\n var\n ReportSelections: Record \"Report Selections\";\n@@ -7148,6 +7227,64 @@ codeunit 134387 \"ERM Sales Documents III\"\n SalesReceivablesSetup.Modify();\n end;\n \n+ local procedure CreateSalesOrderWithItemCharge(\n+ var SalesHeader: Record \"Sales Header\";\n+ ItemChargeNo: Code[20];\n+ ItemNo: Code[20];\n+ Quantity: Decimal)\n+ var\n+ SalesLineItemCharge: Record \"Sales Line\";\n+ SalesLineItem: Record \"Sales Line\";\n+ Customer: Record Customer;\n+ begin\n+ LibrarySales.CreateCustomer(Customer);\n+\n+ LibrarySales.CreateSalesHeader(SalesHeader, SalesHeader.\"Document Type\"::Order, Customer.\"No.\");\n+ LibrarySales.CreateSalesLine(\n+ SalesLineItem,\n+ SalesHeader,\n+ SalesLineItem.Type::Item,\n+ ItemNo,\n+ Quantity);\n+\n+ SalesLineItem.Validate(\"Unit Price\", LibraryRandom.RandDec(100, 2));\n+ SalesLineItem.Modify(true);\n+\n+ LibrarySales.CreateSalesLine(\n+ SalesLineItemCharge,\n+ SalesHeader,\n+ SalesLineItemCharge.Type::\"Charge (Item)\",\n+ ItemChargeNo,\n+ Quantity);\n+\n+ SalesLineItemCharge.Validate(\"Unit Price\", LibraryRandom.RandDec(100, 2));\n+ SalesLineItemCharge.Modify(true);\n+ end;\n+\n+ local procedure SetSalesLinesQtyToShip(var SalesHeader: Record \"Sales Header\"; Quantity: Decimal)\n+ var\n+ SalesLine: Record \"Sales Line\";\n+ begin\n+ SalesLine.SetRange(\"Document Type\", SalesHeader.\"Document Type\");\n+ SalesLine.SetRange(\"Document No.\", SalesHeader.\"No.\");\n+ SalesLine.FindSet();\n+ repeat\n+ SalesLine.Validate(\"Qty. to Ship\", Quantity);\n+ SalesLine.Modify(true);\n+ until SalesLine.Next() = 0;\n+ end;\n+\n+ local procedure UpdateQtyToAssignOnItemChargeAssignment(SalesHeader: Record \"Sales Header\")\n+ var\n+ SalesLine: Record \"Sales Line\";\n+ begin\n+ SalesLine.SetRange(\"Document Type\", SalesHeader.\"Document Type\");\n+ SalesLine.SetRange(\"Document No.\", SalesHeader.\"No.\");\n+ SalesLine.SetRange(Type, SalesLine.Type::\"Charge (Item)\");\n+ SalesLine.FindFirst();\n+ SalesLine.ShowItemChargeAssgnt();\n+ end;\n+\n [ConfirmHandler]\n [Scope('OnPrem')]\n procedure CreateEmptyPostedInvConfirmHandler(Question: Text[1024]; var Reply: Boolean)\n@@ -7426,5 +7563,20 @@ codeunit 134387 \"ERM Sales Documents III\"\n Assert.AreEqual(LibraryVariableStorage.DequeueText(), ChangeLogEntries.\"New Value\".Value(), ChangeLogEntries.\"New Value\".Caption());\n ChangeLogEntries.OK().Invoke();\n end;\n+\n+ [ModalPageHandler]\n+ [Scope('OnPrem')]\n+ procedure PostedSalesDocumentLinesPageHandler(var PostedSalesDocumentLines: TestPage \"Posted Sales Document Lines\")\n+ begin\n+ PostedSalesDocumentLines.PostedInvoices.Filter.SetFilter(\"No.\", LibraryVariableStorage.DequeueText());\n+ PostedSalesDocumentLines.OK().Invoke();\n+ end;\n+\n+ [ModalPageHandler]\n+ [Scope('OnPrem')]\n+ procedure SuggestItemChargeAssignmentPageHandler(var ItemChargeAssignmentSales: TestPage \"Item Charge Assignment (Sales)\")\n+ begin\n+ ItemChargeAssignmentSales.SuggestItemChargeAssignment.Invoke();\n+ end;\n }\n \n", "patch": "diff --git a/App/Layers/W1/BaseApp/Purchases/Document/ItemChargeAssignmentPurch.Table.al b/App/Layers/W1/BaseApp/Purchases/Document/ItemChargeAssignmentPurch.Table.al\nindex 09f4171..3061674 100644\n--- a/App/Layers/W1/BaseApp/Purchases/Document/ItemChargeAssignmentPurch.Table.al\n+++ b/App/Layers/W1/BaseApp/Purchases/Document/ItemChargeAssignmentPurch.Table.al\n@@ -4,6 +4,7 @@ using Microsoft.Finance.Currency;\n using Microsoft.Inventory.Item;\n \n using Microsoft.Purchases.History;\n+using Microsoft.Purchases.Setup;\n \n table 5805 \"Item Charge Assignment (Purch)\"\n {\n@@ -53,10 +54,14 @@ table 5805 \"Item Charge Assignment (Purch)\"\n DecimalPlaces = 0 : 5;\n \n trigger OnValidate()\n+ var\n+ PurchasePayablesSetup: Record \"Purchases & Payables Setup\";\n begin\n+ PurchasePayablesSetup.Get();\n PurchLine.Get(\"Document Type\", \"Document No.\", \"Document Line No.\");\n if Rec.\"Qty. to Assign\" <> xRec.\"Qty. to Assign\" then\n- PurchLine.TestField(\"Qty. to Invoice\");\n+ if PurchasePayablesSetup.\"Default Qty. to Receive\" = PurchasePayablesSetup.\"Default Qty. to Receive\"::Remainder then\n+ PurchLine.TestField(\"Qty. to Invoice\");\n \n TestField(\"Applies-to Doc. Line No.\");\n if (\"Qty. to Assign\" <> 0) and (\"Applies-to Doc. Type\" = \"Document Type\") then\ndiff --git a/App/Layers/W1/BaseApp/Sales/Document/ItemChargeAssignmentSales.Table.al b/App/Layers/W1/BaseApp/Sales/Document/ItemChargeAssignmentSales.Table.al\nindex 7cd8668..5645df7 100644\n--- a/App/Layers/W1/BaseApp/Sales/Document/ItemChargeAssignmentSales.Table.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/ItemChargeAssignmentSales.Table.al\n@@ -7,6 +7,7 @@ namespace Microsoft.Sales.Document;\n using Microsoft.Finance.Currency;\n using Microsoft.Inventory.Item;\n using Microsoft.Sales.History;\n+using Microsoft.Sales.Setup;\n \n table 5809 \"Item Charge Assignment (Sales)\"\n {\n@@ -56,10 +57,14 @@ table 5809 \"Item Charge Assignment (Sales)\"\n DecimalPlaces = 0 : 5;\n \n trigger OnValidate()\n+ var\n+ SalesReceivablesSetup: Record \"Sales & Receivables Setup\";\n begin\n+ SalesReceivablesSetup.Get();\n SalesLine.Get(\"Document Type\", \"Document No.\", \"Document Line No.\");\n if Rec.\"Qty. to Assign\" <> xRec.\"Qty. to Assign\" then\n- SalesLine.TestField(\"Qty. to Invoice\");\n+ if SalesReceivablesSetup.\"Default Quantity to Ship\" = SalesReceivablesSetup.\"Default Quantity to Ship\"::Remainder then\n+ SalesLine.TestField(\"Qty. to Invoice\");\n TestField(\"Applies-to Doc. Line No.\");\n if (\"Qty. to Assign\" <> 0) and (\"Applies-to Doc. Type\" = \"Document Type\") then\n if SalesLineInvoiced() then\n"} +{"instance_id": "microsoftInternal__NAV-176194__cf-3", "base_instance_id": "microsoftInternal__NAV-176194", "variant_description": "Qty. to Invoice validation moved out of OnValidate trigger to processing flow", "failure_layer": null, "FAIL_TO_PASS": [{"codeunitID": 134329, "functionName": ["GetPostedDocumentLinesToReverseCopiesLinesWhenDefaultQtyToReceiveIsBlankInPurchPayablesSetup"]}, {"codeunitID": 134387, "functionName": ["GetPostedDocumentLinesToReverseCopiesLinesWhenDefaultQtyToShipIsBlankInSalesReceiSetup"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/ERMPurchaseReturnOrder.Codeunit.al b/App/Layers/W1/Tests/ERM/ERMPurchaseReturnOrder.Codeunit.al\nindex 75cffb82321a..4b0d9d056234 100644\n--- a/App/Layers/W1/Tests/ERM/ERMPurchaseReturnOrder.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ERMPurchaseReturnOrder.Codeunit.al\n@@ -48,6 +48,8 @@ codeunit 134329 \"ERM Purchase Return Order\"\n ContactShouldBeEditableErr: Label 'Contact should be editable when vendorr is selected.';\n FunctionMustNotBeCalledErr: Label 'Function %1 must not be called.', Comment = '%1 - function name';\n BatchPostingErrrorNotificationMsg: Label 'An error or warning occured during operation Batch processing of Purchase Header records.';\n+ ReturnQtyToShipMustBeZeroErr: Label ' Return Qty. to Ship must be zero.';\n+ QtyToAssignErr: Label '%1 must be %2 in %3', Comment = '%1 = Qty. to Assign, %2 = Quantity, %3 = Purchase Return Order Subform';\n \n [Test]\n [Scope('OnPrem')]\n@@ -1376,6 +1378,83 @@ codeunit 134329 \"ERM Purchase Return Order\"\n PurchaseLine.TableCaption));\n end;\n \n+ [Test]\n+ [Scope('OnPrem')]\n+ [HandlerFunctions('SuggestItemChargeAssignmentPageHandler,PostedPurchDocumentLinesPageHandler')]\n+ procedure GetPostedDocumentLinesToReverseCopiesLinesWhenDefaultQtyToReceiveIsBlankInPurchPayablesSetup()\n+ var\n+ Item: Record Item;\n+ ItemCharge: Record \"Item Charge\";\n+ PurchasePayablesSetup: Record \"Purchases & Payables Setup\";\n+ PurchaseHeader: Record \"Purchase Header\";\n+ PurchaseHeader2: Record \"Purchase Header\";\n+ PurchaseLine: Record \"Purchase Line\";\n+ Quantity: Decimal;\n+ PurchaseReturnOrder: TestPage \"Purchase Return Order\";\n+ PurchaseReturnOrderSubform: TestPage \"Purchase Return Order Subform\";\n+ begin\n+ // [SCENARIO 500596] Get Posted Document Lines to Reverse action on Purchase Return Order copies Purchase Invoice Lines of Type Item Charge Even when Default Qty to Receive on Purchase & Payables Setup is set to Blank.\n+ Initialize();\n+\n+ // [GIVEN] Validate Default Qty. to Receive in Purchase & Payables Setup.\n+ PurchasePayablesSetup.Get();\n+ PurchasePayablesSetup.Validate(\"Default Qty. to Receive\", PurchasePayablesSetup.\"Default Qty. to Receive\"::Blank);\n+ PurchasePayablesSetup.Modify(true);\n+\n+ // [GIVEN] Create an Item.\n+ LibraryInventory.CreateItem(Item);\n+\n+ // [GIVEN] Create an Item Charge.\n+ LibraryInventory.CreateItemCharge(ItemCharge);\n+\n+ // [GIVEN] Generate and Save Quantity in a Variable.\n+ Quantity := LibraryRandom.RandIntInRange(25, 25);\n+\n+ // [GIVEN] Create a Purchase Order with Item Charge.\n+ CreatePurchaseOrderWithItemCharge(PurchaseHeader, ItemCharge.\"No.\", Item.\"No.\", Quantity);\n+\n+ // [GIVEN] Set Purchase Order Lines Qty. to Receive.\n+ SetPurchaseLinesQtyToReceive(PurchaseHeader, Quantity);\n+\n+ // [GIVEN] Update Qty. to Assign on Item Charge Assignment.\n+ UpdateQtyToAssignOnItemChargeAssignment(PurchaseHeader);\n+\n+ // [GIVEN] Post Purchase Order.\n+ LibraryPurchase.PostPurchaseDocument(PurchaseHeader, true, true);\n+\n+ // [GIVEN] Create a Purchase Return Order.\n+ LibraryPurchase.CreatePurchHeader(PurchaseHeader2, PurchaseHeader2.\"Document Type\"::\"Return Order\", PurchaseHeader.\"Buy-from Vendor No.\");\n+\n+ // [GIVEN] Open Purchase Return Order page and run Get Posted Document Lines to Reverse action.\n+ PurchaseReturnOrder.OpenEdit();\n+ PurchaseReturnOrder.GoToRecord(PurchaseHeader2);\n+ LibraryVariableStorage.Enqueue(ItemCharge.\"No.\");\n+ PurchaseReturnOrder.GetPostedDocumentLinesToReverse.Invoke();\n+\n+ // [WHEN] Find Purchase Line of Purchase Return Order.\n+ PurchaseLine.SetRange(\"Document Type\", PurchaseLine.\"Document Type\"::\"Return Order\");\n+ PurchaseLine.SetRange(\"Document No.\", PurchaseHeader2.\"No.\");\n+ PurchaseLine.SetRange(Type, PurchaseLine.Type::\"Charge (Item)\");\n+ PurchaseLine.FindFirst();\n+\n+ // [VERIFY] Return Qty. to Receive in Purchase Line is 0.\n+ Assert.AreEqual(0, PurchaseLine.\"Return Qty. to Ship\", ReturnQtyToShipMustBeZeroErr);\n+\n+ // [WHEN] Open Purchase Return Order Subform page.\n+ PurchaseReturnOrderSubform.OpenEdit();\n+ PurchaseReturnOrderSubform.GoToRecord(PurchaseLine);\n+\n+ // [VERIFY] Quantity and Qty. to Assign in Purchase Line are same.\n+ Assert.AreEqual(\n+ Quantity,\n+ PurchaseReturnOrderSubform.\"Qty. to Assign\".AsDecimal(),\n+ StrSubstNo(\n+ QtyToAssignErr,\n+ PurchaseReturnOrderSubform.\"Qty. to Assign\".Caption(),\n+ Quantity,\n+ PurchaseReturnOrderSubform.Caption()));\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n@@ -2062,6 +2141,64 @@ codeunit 134329 \"ERM Purchase Return Order\"\n if Confirm(StrSubstNo(ExpectedMessage)) then;\n end;\n \n+ local procedure CreatePurchaseOrderWithItemCharge(\n+ var PurchaseHeader: Record \"Purchase Header\";\n+ ItemChargeNo: Code[20];\n+ ItemNo: Code[20];\n+ Quantity: Decimal)\n+ var\n+ PurchaseLineItemCharge: Record \"Purchase Line\";\n+ PurchaseLineItem: Record \"Purchase Line\";\n+ Vendor: Record Vendor;\n+ begin\n+ LibraryPurchase.CreateVendor(Vendor);\n+\n+ LibraryPurchase.CreatePurchHeader(PurchaseHeader, PurchaseHeader.\"Document Type\"::Order, Vendor.\"No.\");\n+ LibraryPurchase.CreatePurchaseLine(\n+ PurchaseLineItem,\n+ PurchaseHeader,\n+ PurchaseLineItem.Type::Item,\n+ ItemNo,\n+ Quantity);\n+\n+ PurchaseLineItem.Validate(\"Direct Unit Cost\", LibraryRandom.RandDec(100, 2));\n+ PurchaseLineItem.Modify(true);\n+\n+ LibraryPurchase.CreatePurchaseLine(\n+ PurchaseLineItemCharge,\n+ PurchaseHeader,\n+ PurchaseLineItemCharge.Type::\"Charge (Item)\",\n+ ItemChargeNo,\n+ Quantity);\n+\n+ PurchaseLineItemCharge.Validate(\"Direct Unit Cost\", LibraryRandom.RandDec(100, 2));\n+ PurchaseLineItemCharge.Modify(true);\n+ end;\n+\n+ local procedure SetPurchaseLinesQtyToReceive(var PurchaseHeader: Record \"Purchase Header\"; Quantity: Decimal)\n+ var\n+ PurchaseLine: Record \"Purchase Line\";\n+ begin\n+ PurchaseLine.SetRange(\"Document Type\", PurchaseHeader.\"Document Type\");\n+ PurchaseLine.SetRange(\"Document No.\", PurchaseHeader.\"No.\");\n+ PurchaseLine.FindSet();\n+ repeat\n+ PurchaseLine.Validate(\"Qty. to Receive\", Quantity);\n+ PurchaseLine.Modify(true);\n+ until PurchaseLine.Next() = 0;\n+ end;\n+\n+ local procedure UpdateQtyToAssignOnItemChargeAssignment(PurchaseHeader: Record \"Purchase Header\")\n+ var\n+ PurchaseLine: Record \"Purchase Line\";\n+ begin\n+ PurchaseLine.SetRange(\"Document Type\", PurchaseHeader.\"Document Type\");\n+ PurchaseLine.SetRange(\"Document No.\", PurchaseHeader.\"No.\");\n+ PurchaseLine.SetRange(Type, PurchaseLine.Type::\"Charge (Item)\");\n+ PurchaseLine.FindFirst();\n+ PurchaseLine.ShowItemChargeAssgnt();\n+ end;\n+\n [ConfirmHandler]\n [Scope('OnPrem')]\n procedure ConfirmHandler(Question: Text[1024]; var Reply: Boolean)\n@@ -2162,6 +2299,21 @@ codeunit 134329 \"ERM Purchase Return Order\"\n GetReturnShipmentLines.OK().Invoke();\n end;\n \n+ [ModalPageHandler]\n+ [Scope('OnPrem')]\n+ procedure PostedPurchDocumentLinesPageHandler(var PostedPurchaseDocumentLines: TestPage \"Posted Purchase Document Lines\")\n+ begin\n+ PostedPurchaseDocumentLines.PostedInvoices.Filter.SetFilter(\"No.\", LibraryVariableStorage.DequeueText());\n+ PostedPurchaseDocumentLines.OK().Invoke();\n+ end;\n+\n+ [ModalPageHandler]\n+ [Scope('OnPrem')]\n+ procedure SuggestItemChargeAssignmentPageHandler(var ItemChargeAssignmentPurch: TestPage \"Item Charge Assignment (Purch)\")\n+ begin\n+ ItemChargeAssignmentPurch.SuggestItemChargeAssignment.Invoke();\n+ end;\n+\n [SendNotificationHandler]\n [Scope('OnPrem')]\n procedure SendNotificationHandler(var Notification: Notification): Boolean\ndiff --git a/App/Layers/W1/Tests/ERM/ERMSalesDocumentsIII.Codeunit.al b/App/Layers/W1/Tests/ERM/ERMSalesDocumentsIII.Codeunit.al\nindex 3f3d49bb821b..bc9ebbd1cdfb 100644\n--- a/App/Layers/W1/Tests/ERM/ERMSalesDocumentsIII.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ERMSalesDocumentsIII.Codeunit.al\n@@ -80,6 +80,8 @@ codeunit 134387 \"ERM Sales Documents III\"\n PackageTrackingNoErr: Label 'Package Tracking No does not exist.';\n CannotAllowInvDiscountErr: Label 'The value of the Allow Invoice Disc. field is not valid when the VAT Calculation Type field is set to \"Full VAT\".';\n PostingPreviewNoTok: Label '***', Locked = true;\n+ ReturnQtyToReceiveMustBeZeroErr: Label ' Return Qty. to Receive must be zero.';\n+ QtyToAssignErr: Label '%1 must be %2 in %3', Comment = '%1 = Qty. to Assign, %2 = Quantity, %3 = Sales Return Order Subform';\n \n [Test]\n [Scope('OnPrem')]\n@@ -5943,6 +5945,83 @@ codeunit 134387 \"ERM Sales Documents III\"\n Assert.AreNotEqual(Customer.\"Country/Region Code\", SalesHeader.\"Rcvd.-from Count./Region Code\", 'Received-from Country Code is set just as it is on customer');\n end;\n \n+ [Test]\n+ [Scope('OnPrem')]\n+ [HandlerFunctions('SuggestItemChargeAssignmentPageHandler,PostedSalesDocumentLinesPageHandler')]\n+ procedure GetPostedDocumentLinesToReverseCopiesLinesWhenDefaultQtyToShipIsBlankInSalesReceiSetup()\n+ var\n+ Item: Record Item;\n+ ItemCharge: Record \"Item Charge\";\n+ SalesReceivablesSetup: Record \"Sales & Receivables Setup\";\n+ SalesHeader: Record \"Sales Header\";\n+ SalesHeader2: Record \"Sales Header\";\n+ SalesLine: Record \"Sales Line\";\n+ Quantity: Decimal;\n+ SalesReturnOrder: TestPage \"Sales Return Order\";\n+ SalesReturnOrderSubform: TestPage \"Sales Return Order Subform\";\n+ begin\n+ // [SCENARIO 500596] Get Posted Document Lines to Reverse action on Sales Return Order copies Sales Invoice Lines of Type Item Charge Even when Default Qty to Ship on Sales & Receivables Setup is set to Blank.\n+ Initialize();\n+\n+ // [GIVEN] Validate Default Quantity to Ship in Sales & Receivables Setup.\n+ SalesReceivablesSetup.Get();\n+ SalesReceivablesSetup.Validate(\"Default Quantity to Ship\", SalesReceivablesSetup.\"Default Quantity to Ship\"::Blank);\n+ SalesReceivablesSetup.Modify(true);\n+\n+ // [GIVEN] Create an Item.\n+ LibraryInventory.CreateItem(Item);\n+\n+ // [GIVEN] Create an Item Charge.\n+ LibraryInventory.CreateItemCharge(ItemCharge);\n+\n+ // [GIVEN] Generate and Save Quantity in a Variable.\n+ Quantity := LibraryRandom.RandIntInRange(25, 25);\n+\n+ // [GIVEN] Create a Sales Order with Item Charge.\n+ CreateSalesOrderWithItemCharge(SalesHeader, ItemCharge.\"No.\", Item.\"No.\", Quantity);\n+\n+ // [GIVEN] Set Sales Order Lines Qty. to Ship.\n+ SetSalesLinesQtyToShip(SalesHeader, Quantity);\n+\n+ // [GIVEN] Update Qty. to Assign on Item Charge Assignment.\n+ UpdateQtyToAssignOnItemChargeAssignment(SalesHeader);\n+\n+ // [GIVEN] Post Sales Order.\n+ LibrarySales.PostSalesDocument(SalesHeader, true, true);\n+\n+ // [GIVEN] Create a Sales Return Order.\n+ LibrarySales.CreateSalesHeader(SalesHeader2, SalesHeader2.\"Document Type\"::\"Return Order\", SalesHeader.\"Sell-to Customer No.\");\n+\n+ // [GIVEN] Open Sales Return Order page and run Get Posted Document Lines to Reverse action.\n+ SalesReturnOrder.OpenEdit();\n+ SalesReturnOrder.GoToRecord(SalesHeader2);\n+ LibraryVariableStorage.Enqueue(ItemCharge.\"No.\");\n+ SalesReturnOrder.GetPostedDocumentLinesToReverse.Invoke();\n+\n+ // [WHEN] Find Sales Line of Sales Return Order.\n+ SalesLine.SetRange(\"Document Type\", SalesLine.\"Document Type\"::\"Return Order\");\n+ SalesLine.SetRange(\"Document No.\", SalesHeader2.\"No.\");\n+ SalesLine.SetRange(Type, SalesLine.Type::\"Charge (Item)\");\n+ SalesLine.FindFirst();\n+\n+ // [VERIFY] Return Qty. to Receive in Sales Line is 0.\n+ Assert.AreEqual(0, SalesLine.\"Return Qty. to Receive\", ReturnQtyToReceiveMustBeZeroErr);\n+\n+ // [WHEN] Open Sales Return Order Subform page.\n+ SalesReturnOrderSubform.OpenEdit();\n+ SalesReturnOrderSubform.GoToRecord(SalesLine);\n+\n+ // [VERIFY] Quantity and Qty. to Assign in Sales Line are same.\n+ Assert.AreEqual(\n+ Quantity,\n+ SalesReturnOrderSubform.\"Qty. to Assign\".AsDecimal(),\n+ StrSubstNo(\n+ QtyToAssignErr,\n+ SalesReturnOrderSubform.\"Qty. to Assign\".Caption(),\n+ Quantity,\n+ SalesReturnOrderSubform.Caption()));\n+ end;\n+\n local procedure Initialize()\n var\n ReportSelections: Record \"Report Selections\";\n@@ -7148,6 +7227,64 @@ codeunit 134387 \"ERM Sales Documents III\"\n SalesReceivablesSetup.Modify();\n end;\n \n+ local procedure CreateSalesOrderWithItemCharge(\n+ var SalesHeader: Record \"Sales Header\";\n+ ItemChargeNo: Code[20];\n+ ItemNo: Code[20];\n+ Quantity: Decimal)\n+ var\n+ SalesLineItemCharge: Record \"Sales Line\";\n+ SalesLineItem: Record \"Sales Line\";\n+ Customer: Record Customer;\n+ begin\n+ LibrarySales.CreateCustomer(Customer);\n+\n+ LibrarySales.CreateSalesHeader(SalesHeader, SalesHeader.\"Document Type\"::Order, Customer.\"No.\");\n+ LibrarySales.CreateSalesLine(\n+ SalesLineItem,\n+ SalesHeader,\n+ SalesLineItem.Type::Item,\n+ ItemNo,\n+ Quantity);\n+\n+ SalesLineItem.Validate(\"Unit Price\", LibraryRandom.RandDec(100, 2));\n+ SalesLineItem.Modify(true);\n+\n+ LibrarySales.CreateSalesLine(\n+ SalesLineItemCharge,\n+ SalesHeader,\n+ SalesLineItemCharge.Type::\"Charge (Item)\",\n+ ItemChargeNo,\n+ Quantity);\n+\n+ SalesLineItemCharge.Validate(\"Unit Price\", LibraryRandom.RandDec(100, 2));\n+ SalesLineItemCharge.Modify(true);\n+ end;\n+\n+ local procedure SetSalesLinesQtyToShip(var SalesHeader: Record \"Sales Header\"; Quantity: Decimal)\n+ var\n+ SalesLine: Record \"Sales Line\";\n+ begin\n+ SalesLine.SetRange(\"Document Type\", SalesHeader.\"Document Type\");\n+ SalesLine.SetRange(\"Document No.\", SalesHeader.\"No.\");\n+ SalesLine.FindSet();\n+ repeat\n+ SalesLine.Validate(\"Qty. to Ship\", Quantity);\n+ SalesLine.Modify(true);\n+ until SalesLine.Next() = 0;\n+ end;\n+\n+ local procedure UpdateQtyToAssignOnItemChargeAssignment(SalesHeader: Record \"Sales Header\")\n+ var\n+ SalesLine: Record \"Sales Line\";\n+ begin\n+ SalesLine.SetRange(\"Document Type\", SalesHeader.\"Document Type\");\n+ SalesLine.SetRange(\"Document No.\", SalesHeader.\"No.\");\n+ SalesLine.SetRange(Type, SalesLine.Type::\"Charge (Item)\");\n+ SalesLine.FindFirst();\n+ SalesLine.ShowItemChargeAssgnt();\n+ end;\n+\n [ConfirmHandler]\n [Scope('OnPrem')]\n procedure CreateEmptyPostedInvConfirmHandler(Question: Text[1024]; var Reply: Boolean)\n@@ -7426,5 +7563,20 @@ codeunit 134387 \"ERM Sales Documents III\"\n Assert.AreEqual(LibraryVariableStorage.DequeueText(), ChangeLogEntries.\"New Value\".Value(), ChangeLogEntries.\"New Value\".Caption());\n ChangeLogEntries.OK().Invoke();\n end;\n+\n+ [ModalPageHandler]\n+ [Scope('OnPrem')]\n+ procedure PostedSalesDocumentLinesPageHandler(var PostedSalesDocumentLines: TestPage \"Posted Sales Document Lines\")\n+ begin\n+ PostedSalesDocumentLines.PostedInvoices.Filter.SetFilter(\"No.\", LibraryVariableStorage.DequeueText());\n+ PostedSalesDocumentLines.OK().Invoke();\n+ end;\n+\n+ [ModalPageHandler]\n+ [Scope('OnPrem')]\n+ procedure SuggestItemChargeAssignmentPageHandler(var ItemChargeAssignmentSales: TestPage \"Item Charge Assignment (Sales)\")\n+ begin\n+ ItemChargeAssignmentSales.SuggestItemChargeAssignment.Invoke();\n+ end;\n }\n \n", "patch": "diff --git a/App/Layers/W1/BaseApp/Purchases/Document/ItemChargeAssignmentPurch.Table.al b/App/Layers/W1/BaseApp/Purchases/Document/ItemChargeAssignmentPurch.Table.al\n--- a/App/Layers/W1/BaseApp/Purchases/Document/ItemChargeAssignmentPurch.Table.al\n+++ b/App/Layers/W1/BaseApp/Purchases/Document/ItemChargeAssignmentPurch.Table.al\n@@ -53,10 +53,9 @@ table 5805 \"Item Charge Assignment (Purch)\"\n DecimalPlaces = 0 : 5;\n \n trigger OnValidate()\n begin\n PurchLine.Get(\"Document Type\", \"Document No.\", \"Document Line No.\");\n- if Rec.\"Qty. to Assign\" <> xRec.\"Qty. to Assign\" then\n- PurchLine.TestField(\"Qty. to Invoice\");\n+ // validation moved out of OnValidate trigger\n \n TestField(\"Applies-to Doc. Line No.\");\n if (\"Qty. to Assign\" <> 0) and (\"Applies-to Doc. Type\" = \"Document Type\") then\ndiff --git a/App/Layers/W1/BaseApp/Sales/Document/ItemChargeAssignmentSales.Table.al b/App/Layers/W1/BaseApp/Sales/Document/ItemChargeAssignmentSales.Table.al\n--- a/App/Layers/W1/BaseApp/Sales/Document/ItemChargeAssignmentSales.Table.al\n+++ b/App/Layers/W1/BaseApp/Sales/Document/ItemChargeAssignmentSales.Table.al\n@@ -56,10 +56,10 @@ table 5809 \"Item Charge Assignment (Sales)\"\n DecimalPlaces = 0 : 5;\n \n trigger OnValidate()\n begin\n SalesLine.Get(\"Document Type\", \"Document No.\", \"Document Line No.\");\n- if Rec.\"Qty. to Assign\" <> xRec.\"Qty. to Assign\" then\n- SalesLine.TestField(\"Qty. to Invoice\");\n+ // validation moved out of OnValidate trigger\n+\n TestField(\"Applies-to Doc. Line No.\");\n if (\"Qty. to Assign\" <> 0) and (\"Applies-to Doc. Type\" = \"Document Type\") then\n if SalesLineInvoiced() then\n"} +{"instance_id": "microsoftInternal__NAV-176426__cf-1", "base_instance_id": "microsoftInternal__NAV-176426", "variant_description": "GetItemUnitCost does not update Rolled-up Material Cost", "failure_layer": null, "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-176426__cf-2", "FAIL_TO_PASS": [{"codeunitID": 137391, "functionName": ["RolledUpMaterialAndCapacityCostWithRoutingAndNoBOM"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMBOMCostSharesReport.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMBOMCostSharesReport.Codeunit.al\n--- a/App/Layers/W1/Tests/SCM/SCMBOMCostSharesReport.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMBOMCostSharesReport.Codeunit.al\n@@ -652,6 +652,45 @@ codeunit 137391 \"SCM - BOM Cost Shares Report\"\n BOMCostShares.Close();\n end;\n \n+ [Test]\n+ procedure RolledUpMaterialAndCapacityCostWithRoutingAndNoBOM()\n+ var\n+ FinalItem: Record Item;\n+ InterimItem: Record Item;\n+ ProductionBOMHeader: Record \"Production BOM Header\";\n+ ProductionBOMLine: Record \"Production BOM Line\";\n+ BOMBuffer: Record \"BOM Buffer\";\n+ BOMCostShares: TestPage \"BOM Cost Shares\";\n+ TotalLeafsRolledUpCapacityCost: Decimal;\n+ QtyPer: Decimal;\n+ begin\n+ // [FEATURE] [BOM Cost Share]\n+ // [SCENARIO 500356] Only Unit Cost should fallback, rolled-up material cost remains unchanged.\n+ Initialize();\n+ QtyPer := LibraryRandom.RandIntInRange(5, 10);\n+\n+ LibraryAssembly.CreateItem(InterimItem, InterimItem.\"Costing Method\"::FIFO, InterimItem.\"Replenishment System\"::\"Prod. Order\", '', '');\n+ InterimItem.Validate(\"Unit Cost\", LibraryRandom.RandDecInRange(50, 100, 2));\n+ InterimItem.Modify(true);\n+ LibraryAssembly.CreateRouting(InterimItem, LibraryRandom.RandInt(2));\n+ UpdateRoutingCostValues(InterimItem.\"Routing No.\");\n+\n+ LibraryAssembly.CreateItem(FinalItem, FinalItem.\"Costing Method\"::FIFO, FinalItem.\"Replenishment System\"::\"Prod. Order\", '', '');\n+ LibraryManufacturing.CreateProductionBOMHeader(ProductionBOMHeader, FinalItem.\"Base Unit of Measure\");\n+ LibraryManufacturing.CreateProductionBOMLine(\n+ ProductionBOMHeader, ProductionBOMLine, '', ProductionBOMLine.Type::Item, InterimItem.\"No.\", QtyPer);\n+ LibraryManufacturing.UpdateProductionBOMStatus(ProductionBOMHeader, ProductionBOMHeader.Status::Certified);\n+ FinalItem.Validate(\"Production BOM No.\", ProductionBOMHeader.\"No.\");\n+ FinalItem.Modify(true);\n+\n+ BOMCostShares.Trap();\n+ RunBOMCostSharesPage(FinalItem);\n+ TotalLeafsRolledUpCapacityCost += GetRolledUpCapacityCostValue(BOMCostShares, BOMBuffer.Type::\"Machine Center\");\n+ TotalLeafsRolledUpCapacityCost += GetRolledUpCapacityCostValue(BOMCostShares, BOMBuffer.Type::\"Work Center\");\n+ VerifyParentItemMaterialAndCapacityCost(BOMCostShares, InterimItem.\"No.\", 0, TotalLeafsRolledUpCapacityCost);\n+ BOMCostShares.Close();\n+ end;\n+\n local procedure CreateRoutingWithWorkCenter(WorkCenterNo: Code[20]; SetupTime: Decimal; RunTime: Decimal; LotSize: Decimal): Code[20]\n var\n RoutingHeader: Record \"Routing Header\";\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Inventory/BOM/BOMBuffer.Table.al b/App/Layers/W1/BaseApp/Inventory/BOM/BOMBuffer.Table.al\n--- a/App/Layers/W1/BaseApp/Inventory/BOM/BOMBuffer.Table.al\n+++ b/App/Layers/W1/BaseApp/Inventory/BOM/BOMBuffer.Table.al\n@@ -872,6 +872,18 @@ table 5870 \"BOM Buffer\"\n OnAfterGetItemCosts(Rec, Item);\n end;\n \n+ procedure GetItemUnitCost()\n+ var\n+ Item: Record Item;\n+ begin\n+ TestField(Type, Type::Item);\n+ Item.Get(\"No.\");\n+\n+ \"Unit Cost\" := Item.\"Unit Cost\";\n+ \"Single-Level Material Cost\" :=\n+ RoundUnitAmt(Item.\"Unit Cost\", UOMMgt.GetQtyPerUnitOfMeasure(Item, \"Unit of Measure Code\") * \"Qty. per Top Item\");\n+ end;\n+\n procedure GetResCosts()\n var\n Res: Record Resource;\ndiff --git a/App/Layers/W1/BaseApp/Inventory/BOM/Tree/CalculateBOMTree.Codeunit.al b/App/Layers/W1/BaseApp/Inventory/BOM/Tree/CalculateBOMTree.Codeunit.al\n--- a/App/Layers/W1/BaseApp/Inventory/BOM/Tree/CalculateBOMTree.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Inventory/BOM/Tree/CalculateBOMTree.Codeunit.al\n@@ -714,9 +714,11 @@ codeunit 5870 \"Calculate BOM Tree\"\n end;\n BOMBuffer.RoundCosts(1 / LotSize);\n end else\n- if HasBomStructure(BOMBuffer.\"No.\") then begin\n+ if IsProductionOrAssemblyItem(BOMBuffer.\"No.\") then begin\n BOMBuffer.CalcOvhdCost();\n BOMBuffer.RoundCosts(1 / LotSize);\n+ if not HasBomStructure(BOMBuffer.\"No.\") then\n+ BOMBuffer.GetItemUnitCost();\n end else\n if BOMBuffer.Type = BOMBuffer.Type::Item then begin\n BOMBuffer.RoundCosts(1 / LotSize);\n@@ -998,6 +1000,16 @@ codeunit 5870 \"Calculate BOM Tree\"\n end;\n end;\n \n+ local procedure IsProductionOrAssemblyItem(ItemNo: Code[20]): Boolean\n+ var\n+ Item: Record Item;\n+ begin\n+ if not Item.Get(ItemNo) then\n+ exit(false);\n+\n+ exit(Item.IsMfgItem() or Item.IsAssemblyItem());\n+ end;\n+\n procedure SetItemFilter(var Item: Record Item)\n begin\n ItemFilter.CopyFilters(Item);\n"} +{"instance_id": "microsoftInternal__NAV-176426__cf-2", "base_instance_id": "microsoftInternal__NAV-176426", "variant_description": "Fallback triggered after item cost retrieval instead of during BOM tree calculation", "failure_layer": null, "FAIL_TO_PASS": [{"codeunitID": 137391, "functionName": ["RolledUpMaterialAndCapacityCostWithRoutingAndNoBOM"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMBOMCostSharesReport.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMBOMCostSharesReport.Codeunit.al\nindex b8748ee..b41186d 100644\n--- a/App/Layers/W1/Tests/SCM/SCMBOMCostSharesReport.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMBOMCostSharesReport.Codeunit.al\n@@ -652,6 +652,45 @@ codeunit 137391 \"SCM - BOM Cost Shares Report\"\n BOMCostShares.Close();\n end;\n \n+ [Test]\n+ procedure RolledUpMaterialAndCapacityCostWithRoutingAndNoBOM()\n+ var\n+ FinalItem: Record Item;\n+ InterimItem: Record Item;\n+ ProductionBOMHeader: Record \"Production BOM Header\";\n+ ProductionBOMLine: Record \"Production BOM Line\";\n+ BOMBuffer: Record \"BOM Buffer\";\n+ BOMCostShares: TestPage \"BOM Cost Shares\";\n+ TotalLeafsRolledUpCapacityCost: Decimal;\n+ QtyPer: Decimal;\n+ begin\n+ // [FEATURE] [BOM Cost Share]\n+ // [SCENARIO 500356] Rolled-up Material Cost and Rolled-up Capacity Cost for a interim production item with no BOM, cost determined after item cost retrieval.\n+ Initialize();\n+ QtyPer := LibraryRandom.RandIntInRange(5, 10);\n+\n+ LibraryAssembly.CreateItem(InterimItem, InterimItem.\"Costing Method\"::FIFO, InterimItem.\"Replenishment System\"::\"Prod. Order\", '', '');\n+ InterimItem.Validate(\"Unit Cost\", LibraryRandom.RandDecInRange(50, 100, 2));\n+ InterimItem.Modify(true);\n+ LibraryAssembly.CreateRouting(InterimItem, LibraryRandom.RandInt(2));\n+ UpdateRoutingCostValues(InterimItem.\"Routing No.\");\n+\n+ LibraryAssembly.CreateItem(FinalItem, FinalItem.\"Costing Method\"::FIFO, FinalItem.\"Replenishment System\"::\"Prod. Order\", '', '');\n+ LibraryManufacturing.CreateProductionBOMHeader(ProductionBOMHeader, FinalItem.\"Base Unit of Measure\");\n+ LibraryManufacturing.CreateProductionBOMLine(\n+ ProductionBOMHeader, ProductionBOMLine, '', ProductionBOMLine.Type::Item, InterimItem.\"No.\", QtyPer);\n+ LibraryManufacturing.UpdateProductionBOMStatus(ProductionBOMHeader, ProductionBOMHeader.Status::Certified);\n+ FinalItem.Validate(\"Production BOM No.\", ProductionBOMHeader.\"No.\");\n+ FinalItem.Modify(true);\n+\n+ BOMCostShares.Trap();\n+ RunBOMCostSharesPage(FinalItem);\n+ TotalLeafsRolledUpCapacityCost += GetRolledUpCapacityCostValue(BOMCostShares, BOMBuffer.Type::\"Machine Center\");\n+ TotalLeafsRolledUpCapacityCost += GetRolledUpCapacityCostValue(BOMCostShares, BOMBuffer.Type::\"Work Center\");\n+ VerifyParentItemMaterialAndCapacityCost(BOMCostShares, InterimItem.\"No.\", InterimItem.\"Unit Cost\" * QtyPer, TotalLeafsRolledUpCapacityCost);\n+ BOMCostShares.Close();\n+ end;\n+\n local procedure CreateRoutingWithWorkCenter(WorkCenterNo: Code[20]; SetupTime: Decimal; RunTime: Decimal; LotSize: Decimal): Code[20]\n var\n RoutingHeader: Record \"Routing Header\";\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Inventory/BOM/BOMBuffer.Table.al b/App/Layers/W1/BaseApp/Inventory/BOM/BOMBuffer.Table.al\nindex ab93f2c..55d1cb4 100644\n--- a/App/Layers/W1/BaseApp/Inventory/BOM/BOMBuffer.Table.al\n+++ b/App/Layers/W1/BaseApp/Inventory/BOM/BOMBuffer.Table.al\n@@ -870,6 +870,29 @@ table 5870 \"BOM Buffer\"\n RoundCosts(UOMMgt.GetQtyPerUnitOfMeasure(Item, \"Unit of Measure Code\") * \"Qty. per Top Item\");\n \n OnAfterGetItemCosts(Rec, Item);\n+\n+ if not HasBomStructure(Item) then\n+ GetItemUnitCostFallback();\n+ end;\n+\n+ procedure GetItemUnitCostFallback()\n+ var\n+ Item: Record Item;\n+ UOMMgt: Codeunit \"Unit of Measure Management\";\n+ begin\n+ TestField(Type, Type::Item);\n+ Item.Get(\"No.\");\n+\n+ \"Unit Cost\" := Item.\"Unit Cost\";\n+ \"Single-Level Material Cost\" :=\n+ RoundUnitAmt(Item.\"Unit Cost\", UOMMgt.GetQtyPerUnitOfMeasure(Item, \"Unit of Measure Code\") * \"Qty. per Top Item\");\n+ \"Rolled-up Material Cost\" :=\n+ RoundUnitAmt(Item.\"Unit Cost\", UOMMgt.GetQtyPerUnitOfMeasure(Item, \"Unit of Measure Code\") * \"Qty. per Top Item\");\n+ end;\n+\n+ local procedure HasBomStructure(Item: Record Item): Boolean\n+ begin\n+ exit((Item.\"Production BOM No.\" <> '') or (Item.\"Assembly BOM\" = true));\n end;\n \n procedure GetResCosts()\ndiff --git a/App/Layers/W1/BaseApp/Inventory/BOM/Tree/CalculateBOMTree.Codeunit.al b/App/Layers/W1/BaseApp/Inventory/BOM/Tree/CalculateBOMTree.Codeunit.al\nindex d639a56..984666d 100644\n--- a/App/Layers/W1/BaseApp/Inventory/BOM/Tree/CalculateBOMTree.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Inventory/BOM/Tree/CalculateBOMTree.Codeunit.al\n@@ -714,9 +714,11 @@ codeunit 5870 \"Calculate BOM Tree\"\n end;\n BOMBuffer.RoundCosts(1 / LotSize);\n end else\n- if HasBomStructure(BOMBuffer.\"No.\") then begin\n+ if IsProductionOrAssemblyItem(BOMBuffer.\"No.\") then begin\n BOMBuffer.CalcOvhdCost();\n BOMBuffer.RoundCosts(1 / LotSize);\n+ if not HasBomStructure(BOMBuffer.\"No.\") then\n+ BOMBuffer.GetItemUnitCostFallback();\n end else\n if BOMBuffer.Type = BOMBuffer.Type::Item then begin\n BOMBuffer.RoundCosts(1 / LotSize);\n@@ -998,6 +1000,16 @@ codeunit 5870 \"Calculate BOM Tree\"\n end;\n end;\n \n+ local procedure IsProductionOrAssemblyItem(ItemNo: Code[20]): Boolean\n+ var\n+ Item: Record Item;\n+ begin\n+ if not Item.Get(ItemNo) then\n+ exit(false);\n+\n+ exit(Item.IsMfgItem() or Item.IsAssemblyItem());\n+ end;\n+\n procedure SetItemFilter(var Item: Record Item)\n begin\n ItemFilter.CopyFilters(Item);\n"} +{"instance_id": "microsoftInternal__NAV-177493__cf-1", "base_instance_id": "microsoftInternal__NAV-177493", "variant_description": "Reserve=Never filtering deferred to post-processing instead of source-level filtering for Sales demand", "failure_layer": null, "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-177493__cf-1", "FAIL_TO_PASS": [{"codeunitID": 137023, "functionName": ["ItemWithReserveNeverNotInReservationWorksheet"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMReservationWorksheet.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMReservationWorksheet.Codeunit.al\nindex 6c7feca..fa163b5 100644\n--- a/App/Layers/W1/Tests/SCM/SCMReservationWorksheet.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMReservationWorksheet.Codeunit.al\n@@ -13,6 +13,7 @@ codeunit 137023 \"SCM Reservation Worksheet\"\n LibraryInventory: Codeunit \"Library - Inventory\";\n LibrarySales: Codeunit \"Library - Sales\";\n LibraryWarehouse: Codeunit \"Library - Warehouse\";\n+ LibraryAssembly: Codeunit \"Library - Assembly\";\n LibrarySetupStorage: Codeunit \"Library - Setup Storage\";\n LibraryVariableStorage: Codeunit \"Library - Variable Storage\";\n Assert: Codeunit Assert;\n@@ -943,6 +944,63 @@ codeunit 137023 \"SCM Reservation Worksheet\"\n VerifyQtyToReserveOnReservWkshLine(ReservationWkshLine, SalesOrderList.Get(3), GetOutstandingQtyOnSalesLine(SalesOrderList.Get(3)));\n end;\n \n+ [Test]\n+ [HandlerFunctions('GetDemandToReserveRequestPageHandler')]\n+ procedure ItemWithReserveNeverNotInReservationWorksheet()\n+ var\n+ Item: Record Item;\n+ Location: Record Location;\n+ SalesHeader: Record \"Sales Header\";\n+ SalesLine: Record \"Sales Line\";\n+ AssemblyHeader: Record \"Assembly Header\";\n+ AssemblyLine: Record \"Assembly Line\";\n+ ReservationWkshBatch: Record \"Reservation Wksh. Batch\";\n+ ItemJournalLine: Record \"Item Journal Line\";\n+ ReservationWkshLine: Record \"Reservation Wksh. Line\";\n+ ItemList: List of [Code[20]];\n+ Qty: Decimal;\n+ begin\n+ // [Reservation Worksheet]\n+ // [SCENARIO 502388] Item with \"Reserve\" = \"Never\" should not be included in the reservation worksheet.\n+ Initialize();\n+\n+ // [GIVEN] Item \"X\" with \"Reserve\" = \"Never\".\n+ LibraryInventory.CreateItem(Item);\n+ Item.Validate(\"Reserve\", Item.\"Reserve\"::Never);\n+ Item.Modify(true);\n+ ItemList.Add(Item.\"No.\");\n+\n+ // [GIVEN] New location\n+ LibraryWarehouse.CreateLocationWithInventoryPostingSetup(Location);\n+\n+ // [GIVEN] Item \"X\" available in the inventory.\n+ Qty := Random(100);\n+ LibraryInventory.CreateItemJournalLineInItemTemplate(ItemJournalLine, Item.\"No.\", Location.Code, '', Qty);\n+ LibraryInventory.PostItemJournalLine(ItemJournalLine.\"Journal Template Name\", ItemJournalLine.\"Journal Batch Name\");\n+\n+ // [GIVEN] Sales order for the item \"X\" with \"Reserve\" = \"Never\".\n+ LibrarySales.CreateSalesDocumentWithItem(SalesHeader, SalesLine, SalesHeader.\"Document Type\"::Order, '', Item.\"No.\", Qty / 2, Location.Code, WorkDate());\n+ SalesLine.TestField(Reserve, SalesLine.Reserve::Never);\n+\n+ // [GIVEN] Assembly order with line - item \"X\" with \"Reserve\" = \"Never\".\n+ LibraryAssembly.CreateAssemblyHeader(AssemblyHeader, WorkDate(), LibraryInventory.CreateItemNo(), Location.Code, Qty / 2, '');\n+ LibraryAssembly.CreateAssemblyLine(AssemblyHeader, AssemblyLine, \"BOM Component Type\"::Item, Item.\"No.\", '', 1, 1, '');\n+ AssemblyLine.TestField(Reserve, AssemblyLine.Reserve::Never);\n+\n+ // [WHEN] Run CalculateDemand for item \"X\" to fill ReservationWorksheetLine.\n+ LibraryVariableStorage.Enqueue(Item.\"No.\");\n+ ReservationWkshBatch.FindFirst();\n+ GetDemand(ReservationWkshBatch.Name, ItemList);\n+\n+ // [THEN] Verify that reservation worksheet line for the item with \"Reserve\" = \"Never\" should not be created.\n+ ReservationWkshLine.SetRange(\"Journal Batch Name\", ReservationWkshBatch.Name);\n+ ReservationWkshLine.SetRange(\"Item No.\", Item.\"No.\");\n+ ReservationWkshLine.SetRange(\"Source Type\", Database::\"Sales Line\");\n+ Assert.IsFalse(ReservationWkshLine.IsEmpty, 'Sales demand with Reserve=Never should appear (filtering deferred to post-processing).');\n+ ReservationWkshLine.SetRange(\"Source Type\", Database::\"Assembly Line\");\n+ Assert.IsTrue(ReservationWkshLine.IsEmpty, 'Assembly demand with Reserve=Never should still be filtered at source.');\n+ end;\n+\n local procedure Initialize()\n begin\n LibraryTestInitialize.OnTestInitialize(CODEUNIT::\"SCM Reservation Worksheet\");\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Inventory/Tracking/GetDemandToReserve.Report.al b/App/Layers/W1/BaseApp/Inventory/Tracking/GetDemandToReserve.Report.al\nindex bb47904..69a8d61 100644\n--- a/App/Layers/W1/BaseApp/Inventory/Tracking/GetDemandToReserve.Report.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Tracking/GetDemandToReserve.Report.al\n@@ -40,6 +40,7 @@ report 302 \"Get Demand To Reserve\"\n SetFilter(\"Variant Code\", FilterItem.GetFilter(\"Variant Filter\"));\n SetFilter(\"Location Code\", FilterItem.GetFilter(\"Location Filter\"));\n SetFilter(\"Shipment Date\", FilterItem.GetFilter(\"Date Filter\"));\n+ // Reserve filtering deferred to post-processing stage\n \n FilterGroup(2);\n if DateFilter <> '' then\n@@ -140,6 +141,7 @@ report 302 \"Get Demand To Reserve\"\n SetFilter(\"Variant Code\", FilterItem.GetFilter(\"Variant Filter\"));\n SetFilter(\"Location Code\", FilterItem.GetFilter(\"Location Filter\"));\n SetFilter(\"Needed by Date\", FilterItem.GetFilter(\"Date Filter\"));\n+ SetFilter(Reserve, '<>%1', ServiceOrderLine.Reserve::Never);\n \n FilterGroup(2);\n if DateFilter <> '' then\n@@ -190,6 +192,7 @@ report 302 \"Get Demand To Reserve\"\n SetFilter(\"Variant Code\", FilterItem.GetFilter(\"Variant Filter\"));\n SetFilter(\"Location Code\", FilterItem.GetFilter(\"Location Filter\"));\n SetFilter(\"Planning Date\", FilterItem.GetFilter(\"Date Filter\"));\n+ SetFilter(Reserve, '<>%1', JobPlanningLine.Reserve::Never);\n \n FilterGroup(2);\n if DateFilter <> '' then\n@@ -241,6 +244,7 @@ report 302 \"Get Demand To Reserve\"\n SetFilter(\"Variant Code\", FilterItem.GetFilter(\"Variant Filter\"));\n SetFilter(\"Location Code\", FilterItem.GetFilter(\"Location Filter\"));\n SetFilter(\"Due Date\", FilterItem.GetFilter(\"Date Filter\"));\n+ SetFilter(Reserve, '<>%1', AssemblyLine.Reserve::Never);\n \n FilterGroup(2);\n if DateFilter <> '' then\n"} +{"instance_id": "microsoftInternal__NAV-177493__cf-2", "base_instance_id": "microsoftInternal__NAV-177493", "variant_description": "Reserve=Never restriction applies only to Sales and Service demand, not Assembly or Job Planning", "failure_layer": null, "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-177493__cf-2", "FAIL_TO_PASS": [{"codeunitID": 137023, "functionName": ["ItemWithReserveNeverNotInReservationWorksheet"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMReservationWorksheet.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMReservationWorksheet.Codeunit.al\nindex 6c7feca..1e379fe 100644\n--- a/App/Layers/W1/Tests/SCM/SCMReservationWorksheet.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMReservationWorksheet.Codeunit.al\n@@ -467,7 +467,54 @@ codeunit 137023 \"SCM Reservation Worksheet\"\n VerifyQtyToReserveOnReservWkshLine(ReservationWkshLine, SalesOrderList.Get(14), 0);\n VerifyQtyToReserveOnReservWkshLine(ReservationWkshLine, SalesOrderList.Get(15), 0);\n end;\n \n+ [Test]\n+ [HandlerFunctions('GetDemandToReserveRequestPageHandler')]\n+ procedure ItemWithReserveNeverNotInReservationWorksheet()\n+ var\n+ Item: Record Item;\n+ Location: Record Location;\n+ SalesHeader: Record \"Sales Header\";\n+ SalesLine: Record \"Sales Line\";\n+ ReservationWkshBatch: Record \"Reservation Wksh. Batch\";\n+ ItemJournalLine: Record \"Item Journal Line\";\n+ ReservationWkshLine: Record \"Reservation Wksh. Line\";\n+ ItemList: List of [Code[20]];\n+ Qty: Decimal;\n+ begin\n+ // [Reservation Worksheet]\n+ // [SCENARIO 502388] Item with \"Reserve\" = \"Never\" should not be included in the reservation worksheet.\n+ Initialize();\n+\n+ // [GIVEN] Item \"X\" with \"Reserve\" = \"Never\".\n+ LibraryInventory.CreateItem(Item);\n+ Item.Validate(\"Reserve\", Item.\"Reserve\"::Never);\n+ Item.Modify(true);\n+ ItemList.Add(Item.\"No.\");\n+\n+ // [GIVEN] New location\n+ LibraryWarehouse.CreateLocationWithInventoryPostingSetup(Location);\n+\n+ // [GIVEN] Item \"X\" available in the inventory.\n+ Qty := Random(100);\n+ LibraryInventory.CreateItemJournalLineInItemTemplate(ItemJournalLine, Item.\"No.\", Location.Code, '', Qty);\n+ LibraryInventory.PostItemJournalLine(ItemJournalLine.\"Journal Template Name\", ItemJournalLine.\"Journal Batch Name\");\n+\n+ // [GIVEN] Sales order for the item \"X\" with \"Reserve\" = \"Never\".\n+ LibrarySales.CreateSalesDocumentWithItem(SalesHeader, SalesLine, SalesHeader.\"Document Type\"::Order, '', Item.\"No.\", Qty / 2, Location.Code, WorkDate());\n+ SalesLine.TestField(Reserve, SalesLine.Reserve::Never);\n+\n+ // [WHEN] Run CalculateDemand for item \"X\" to fill ReservationWorksheetLine.\n+ LibraryVariableStorage.Enqueue(Item.\"No.\");\n+ ReservationWkshBatch.FindFirst();\n+ GetDemand(ReservationWkshBatch.Name, ItemList);\n+\n+ // [THEN] Verify that reservation worksheet line for the item with \"Reserve\" = \"Never\" should not be created.\n+ ReservationWkshLine.SetRange(\"Journal Batch Name\", ReservationWkshBatch.Name);\n+ ReservationWkshLine.SetRange(\"Item No.\", Item.\"No.\");\n+ Assert.IsTrue(ReservationWkshLine.IsEmpty, 'Reservation Worksheet line for the item with \"Reserve\" = \"Never\" should not be created.');\n+ end;\n+\n [Test]\n [HandlerFunctions('GetDemandToReserveRequestPageHandler')]\n procedure AllocatingQuantityWithNoRules()\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Inventory/Tracking/GetDemandToReserve.Report.al b/App/Layers/W1/BaseApp/Inventory/Tracking/GetDemandToReserve.Report.al\nindex bb47904..51b56b0 100644\n--- a/App/Layers/W1/BaseApp/Inventory/Tracking/GetDemandToReserve.Report.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Tracking/GetDemandToReserve.Report.al\n@@ -40,6 +40,7 @@ report 302 \"Get Demand To Reserve\"\n SetFilter(\"Variant Code\", FilterItem.GetFilter(\"Variant Filter\"));\n SetFilter(\"Location Code\", FilterItem.GetFilter(\"Location Filter\"));\n SetFilter(\"Shipment Date\", FilterItem.GetFilter(\"Date Filter\"));\n+ SetFilter(Reserve, '<>%1', SalesOrderLine.Reserve::Never);\n \n FilterGroup(2);\n if DateFilter <> '' then\n@@ -140,6 +141,7 @@ report 302 \"Get Demand To Reserve\"\n SetFilter(\"Variant Code\", FilterItem.GetFilter(\"Variant Filter\"));\n SetFilter(\"Location Code\", FilterItem.GetFilter(\"Location Filter\"));\n SetFilter(\"Needed by Date\", FilterItem.GetFilter(\"Date Filter\"));\n+ SetFilter(Reserve, '<>%1', ServiceOrderLine.Reserve::Never);\n \n FilterGroup(2);\n if DateFilter <> '' then\n@@ -190,6 +192,7 @@ report 302 \"Get Demand To Reserve\"\n SetFilter(\"Variant Code\", FilterItem.GetFilter(\"Variant Filter\"));\n SetFilter(\"Location Code\", FilterItem.GetFilter(\"Location Filter\"));\n SetFilter(\"Planning Date\", FilterItem.GetFilter(\"Date Filter\"));\n+ // Assembly demand allowed regardless of Reserve setting\n \n FilterGroup(2);\n if DateFilter <> '' then\n@@ -241,6 +244,7 @@ report 302 \"Get Demand To Reserve\"\n SetFilter(\"Variant Code\", FilterItem.GetFilter(\"Variant Filter\"));\n SetFilter(\"Location Code\", FilterItem.GetFilter(\"Location Filter\"));\n SetFilter(\"Due Date\", FilterItem.GetFilter(\"Date Filter\"));\n+ // Assembly demand allowed regardless of Reserve setting\n \n FilterGroup(2);\n if DateFilter <> '' then\n"} +{"instance_id": "microsoftInternal__NAV-177493__cf-3", "base_instance_id": "microsoftInternal__NAV-177493", "variant_description": "Reserve filter uses Item enum source instead of demand-line-specific enum source", "failure_layer": null, "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-177493__cf-3", "FAIL_TO_PASS": [{"codeunitID": 137023, "functionName": ["ItemWithReserveNeverNotInReservationWorksheet"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMReservationWorksheet.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMReservationWorksheet.Codeunit.al\nindex 6c7fecaffcd2..fa163b5a789b 100644\n--- a/App/Layers/W1/Tests/SCM/SCMReservationWorksheet.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMReservationWorksheet.Codeunit.al\n@@ -13,6 +13,7 @@ codeunit 137023 \"SCM Reservation Worksheet\"\n LibraryInventory: Codeunit \"Library - Inventory\";\n LibrarySales: Codeunit \"Library - Sales\";\n LibraryWarehouse: Codeunit \"Library - Warehouse\";\n+ LibraryAssembly: Codeunit \"Library - Assembly\";\n LibrarySetupStorage: Codeunit \"Library - Setup Storage\";\n LibraryVariableStorage: Codeunit \"Library - Variable Storage\";\n Assert: Codeunit Assert;\n@@ -943,6 +944,60 @@ codeunit 137023 \"SCM Reservation Worksheet\"\n VerifyQtyToReserveOnReservWkshLine(ReservationWkshLine, SalesOrderList.Get(3), GetOutstandingQtyOnSalesLine(SalesOrderList.Get(3)));\n end;\n \n+ [Test]\n+ [HandlerFunctions('GetDemandToReserveRequestPageHandler')]\n+ procedure ItemWithReserveNeverNotInReservationWorksheet()\n+ var\n+ Item: Record Item;\n+ Location: Record Location;\n+ SalesHeader: Record \"Sales Header\";\n+ SalesLine: Record \"Sales Line\";\n+ AssemblyHeader: Record \"Assembly Header\";\n+ AssemblyLine: Record \"Assembly Line\";\n+ ReservationWkshBatch: Record \"Reservation Wksh. Batch\";\n+ ItemJournalLine: Record \"Item Journal Line\";\n+ ReservationWkshLine: Record \"Reservation Wksh. Line\";\n+ ItemList: List of [Code[20]];\n+ Qty: Decimal;\n+ begin\n+ // [Reservation Worksheet]\n+ // [SCENARIO 502388] Item with \"Reserve\" = \"Never\" should not be included in the reservation worksheet.\n+ Initialize();\n+\n+ // [GIVEN] Item \"X\" with \"Reserve\" = \"Never\".\n+ LibraryInventory.CreateItem(Item);\n+ Item.Validate(\"Reserve\", Item.\"Reserve\"::Never);\n+ Item.Modify(true);\n+ ItemList.Add(Item.\"No.\");\n+\n+ // [GIVEN] New location\n+ LibraryWarehouse.CreateLocationWithInventoryPostingSetup(Location);\n+\n+ // [GIVEN] Item \"X\" available in the inventory.\n+ Qty := Random(100);\n+ LibraryInventory.CreateItemJournalLineInItemTemplate(ItemJournalLine, Item.\"No.\", Location.Code, '', Qty);\n+ LibraryInventory.PostItemJournalLine(ItemJournalLine.\"Journal Template Name\", ItemJournalLine.\"Journal Batch Name\");\n+\n+ // [GIVEN] Sales order for the item \"X\" with \"Reserve\" = \"Never\".\n+ LibrarySales.CreateSalesDocumentWithItem(SalesHeader, SalesLine, SalesHeader.\"Document Type\"::Order, '', Item.\"No.\", Qty / 2, Location.Code, WorkDate());\n+ SalesLine.TestField(Reserve, SalesLine.Reserve::Never);\n+\n+ // [GIVEN] Assembly order with line - item \"X\" with \"Reserve\" = \"Never\".\n+ LibraryAssembly.CreateAssemblyHeader(AssemblyHeader, WorkDate(), LibraryInventory.CreateItemNo(), Location.Code, Qty / 2, '');\n+ LibraryAssembly.CreateAssemblyLine(AssemblyHeader, AssemblyLine, \"BOM Component Type\"::Item, Item.\"No.\", '', 1, 1, '');\n+ AssemblyLine.TestField(Reserve, AssemblyLine.Reserve::Never);\n+\n+ // [WHEN] Run CalculateDemand for item \"X\" to fill ReservationWorksheetLine.\n+ LibraryVariableStorage.Enqueue(Item.\"No.\");\n+ ReservationWkshBatch.FindFirst();\n+ GetDemand(ReservationWkshBatch.Name, ItemList);\n+\n+ // [THEN] Verify that reservation worksheet line for the item with \"Reserve\" = \"Never\" should not be created.\n+ ReservationWkshLine.SetRange(\"Journal Batch Name\", ReservationWkshBatch.Name);\n+ ReservationWkshLine.SetRange(\"Item No.\", Item.\"No.\");\n+ Assert.IsTrue(ReservationWkshLine.IsEmpty, 'Reservation Worksheet line for the item with \"Reserve\" = \"Never\" should not be created.');\n+ end;\n+\n local procedure Initialize()\n begin\n LibraryTestInitialize.OnTestInitialize(CODEUNIT::\"SCM Reservation Worksheet\");\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Inventory/Tracking/GetDemandToReserve.Report.al b/App/Layers/W1/BaseApp/Inventory/Tracking/GetDemandToReserve.Report.al\n--- a/App/Layers/W1/BaseApp/Inventory/Tracking/GetDemandToReserve.Report.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Tracking/GetDemandToReserve.Report.al\n@@ -40,6 +40,7 @@ report 302 \"Get Demand To Reserve\"\n SetFilter(\"Variant Code\", FilterItem.GetFilter(\"Variant Filter\"));\n SetFilter(\"Location Code\", FilterItem.GetFilter(\"Location Filter\"));\n SetFilter(\"Shipment Date\", FilterItem.GetFilter(\"Date Filter\"));\n+ SetFilter(Reserve, '<>%1', FilterItem.Reserve::Never);\n \n FilterGroup(2);\n if DateFilter <> '' then\n@@ -140,6 +141,7 @@ report 302 \"Get Demand To Reserve\"\n SetFilter(\"Variant Code\", FilterItem.GetFilter(\"Variant Filter\"));\n SetFilter(\"Location Code\", FilterItem.GetFilter(\"Location Filter\"));\n SetFilter(\"Needed by Date\", FilterItem.GetFilter(\"Date Filter\"));\n+ SetFilter(Reserve, '<>%1', FilterItem.Reserve::Never);\n \n FilterGroup(2);\n if DateFilter <> '' then\n@@ -190,6 +192,7 @@ report 302 \"Get Demand To Reserve\"\n SetFilter(\"Variant Code\", FilterItem.GetFilter(\"Variant Filter\"));\n SetFilter(\"Location Code\", FilterItem.GetFilter(\"Location Filter\"));\n SetFilter(\"Planning Date\", FilterItem.GetFilter(\"Date Filter\"));\n+ SetFilter(Reserve, '<>%1', FilterItem.Reserve::Never);\n \n FilterGroup(2);\n if DateFilter <> '' then\n@@ -241,6 +244,7 @@ report 302 \"Get Demand To Reserve\"\n SetFilter(\"Variant Code\", FilterItem.GetFilter(\"Variant Filter\"));\n SetFilter(\"Location Code\", FilterItem.GetFilter(\"Location Filter\"));\n SetFilter(\"Due Date\", FilterItem.GetFilter(\"Date Filter\"));\n+ SetFilter(Reserve, '<>%1', FilterItem.Reserve::Never);\n \n FilterGroup(2);\n if DateFilter <> '' then\n"} +{"instance_id": "microsoftInternal__NAV-178045__cf-1", "base_instance_id": "microsoftInternal__NAV-178045", "variant_description": "Fix only applies when multiple ILEs exist for the lot; test uses 2 journal lines instead of 3", "failure_layer": null, "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-178045__cf-1", "FAIL_TO_PASS": [{"codeunitID": 137404, "functionName": ["ConsumptionIsPostedForMultipleILEsOfSameLotNo"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/SCM/SCMManufacturing.Codeunit.al b/App/Layers/W1/Tests/SCM/SCMManufacturing.Codeunit.al\nindex 9467380d9f9b..e1036e0420d9 100644\n--- a/App/Layers/W1/Tests/SCM/SCMManufacturing.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMManufacturing.Codeunit.al\n@@ -47,6 +47,7 @@ codeunit 137404 \"SCM Manufacturing\"\n Capacity2: Decimal;\n GLB_ItemTrackingQty: Integer;\n GLB_SerialNo: Code[50];\n+ ItemTrackingMode: Option \" \",\"Assign Lot No.\",\"Select Entries\",\"Update Quantity\",\"Manual Lot No.\"; \n DocumentNoDoesNotExistErr: Label 'Document No. %1 does not exist.', Comment = '%1: Document number (Code)';\n ExpectedQuantityErr: Label 'Quantity must be %1.', Comment = '%1: Quantity (decimal value)';\n ModifyRtngErr: Label 'You cannot modify Routing No. %1 because there is at least one %2 associated with it.';\n@@ -80,6 +81,7 @@ codeunit 137404 \"SCM Manufacturing\"\n DidntExpectWhsePickMsg: Label 'Did not expect a Warehouse Pick Request associated with the Production Order Component Line, since the line doesn''t have a postitive remaining quantity';\n ProdOrderNoHandlerErr: Label 'Prod. Order No. must be %1, actual value is %2.', Comment = '%1: Expected Prod. Order No. Value; %2: Actual Prod. Order No. Value.';\n ProdOrderStatusHandlerErr: Label 'Prod. Order Status must be %1, actual value is %2.', Comment = '%1: Expected Prod. Order Status Value; %2: Actual Prod. Order Status Value.';\n+ ItemLedgerEntryMustBeFoundErr: Label 'Item Ledger Entry must be found.';\n \n [Test]\n [HandlerFunctions('ConfirmHandlerTrue,OutputJournalItemtrackingPageHandler,MessageHandler')]\n@@ -4149,6 +4151,104 @@ codeunit 137404 \"SCM Manufacturing\"\n LibraryInventory.PostItemJournalLine(ItemJournalBatch.\"Journal Template Name\", ItemJournalBatch.Name);\n end;\n \n+ [Test]\n+ [Scope('OnPrem')]\n+ [HandlerFunctions('ItemTrackingAssignLotNoPageHandler,ProductionJournalPageHandlerOnlyConsumption,ConfirmHandlerTrue,MessageHandler')]\n+ procedure ConsumptionIsPostedForMultipleILEsOfSameLotNo()\n+ var\n+ CompItem, ProdItem : Record Item;\n+ Location: Record Location;\n+ UnitOfMeasure: Record \"Unit of Measure\";\n+ ItemUnitOfMeasure: Record \"Item Unit of Measure\";\n+ ItemTrackingCode: Record \"Item Tracking Code\";\n+ ProductionBOMHeader: Record \"Production BOM Header\";\n+ ProductionBOMLine: Record \"Production BOM Line\";\n+ ProductionOrder: Record \"Production Order\";\n+ ItemLedgerEntry: Record \"Item Ledger Entry\";\n+ LotNo: Code[10];\n+ Quantity: Decimal;\n+ ReleasedProdOrder: TestPage \"Released Production Order\";\n+ begin\n+ // [SCENARIO 501830] Consumption is posted against multiple Item Ledger Entries of same Lot No. when you post Production Journal from a Released Production Order.\n+ Initialize();\n+\n+ // [GIVEN] Create Item Tracking Code.\n+ LibraryItemTracking.CreateItemTrackingCode(ItemTrackingCode, false, true);\n+\n+ // [GIVEN] Create Unit of Measure.\n+ LibraryInventory.CreateUnitOfMeasureCode(UnitOfMeasure);\n+\n+ // [GIVEN] Create Component Item with Unit of Measure.\n+ CreateItemWithUOM(CompItem, UnitOfMeasure, ItemUnitOfMeasure);\n+ CompItem.Validate(\"Replenishment System\", CompItem.\"Replenishment System\"::Purchase);\n+ CompItem.Validate(Reserve, CompItem.Reserve::Always);\n+ CompItem.Validate(\"Flushing Method\", CompItem.\"Flushing Method\"::Manual);\n+ CompItem.Validate(\"Item Tracking Code\", ItemTrackingCode.Code);\n+ CompItem.Modify(true);\n+\n+ // [GIVEN] Create Location with Inventory Posting Setup.\n+ LibraryWarehouse.CreateLocationWithInventoryPostingSetup(Location);\n+\n+ // [GIVEN] Create Production Item with Unit of Measure.\n+ CreateItemWithUOM(ProdItem, UnitOfMeasure, ItemUnitOfMeasure);\n+\n+ // [GIVEN] Generate and save Lot No. and Quantity in two different Variable.\n+ LotNo := Format(LibraryRandom.RandText(4));\n+ Quantity := LibraryRandom.RandIntInRange(15, 15);\n+\n+ // [GIVEN] Create and Post three Item Journal Lines with same Lot No.\n+ // [GIVEN] Create and Post two Item Journal Lines with same Lot No.\n+ CreateAndPostItemJournalLineWithLotNo(CompItem.\"No.\", LibraryRandom.RandIntInRange(5, 5), LotNo, '', Location.Code, true);\n+ CreateAndPostItemJournalLineWithLotNo(CompItem.\"No.\", LibraryRandom.RandIntInRange(10, 10), LotNo, '', Location.Code, true);\n+\n+ // [GIVEN] Create a production BOM for the Production Item.\n+ LibraryManufacturing.CreateProductionBOMHeader(ProductionBOMHeader, ItemUnitOfMeasure.Code);\n+ LibraryManufacturing.CreateProductionBOMLine(\n+ ProductionBOMHeader,\n+ ProductionBOMLine,\n+ '',\n+ ProductionBOMLine.Type::Item,\n+ CompItem.\"No.\",\n+ LibraryRandom.RandIntInRange(1, 1));\n+\n+ // [GIVEN] Validate Unit of Measure in Production BOM.\n+ ProductionBOMLine.Validate(\"Unit of Measure Code\", ItemUnitOfMeasure.Code);\n+ ProductionBOMLine.Modify(true);\n+\n+ // [GIVEN] Change Status of Production BOM.\n+ LibraryManufacturing.UpdateProductionBOMStatus(ProductionBOMHeader, ProductionBOMHeader.Status::Certified);\n+\n+ // [GIVEN] Validate Replenishment System and Production BOM No. in Production Item.\n+ ProdItem.Validate(\"Replenishment System\", ProdItem.\"Replenishment System\"::\"Prod. Order\");\n+ ProdItem.Validate(\"Production BOM No.\", ProductionBOMHeader.\"No.\");\n+ ProdItem.Modify(true);\n+\n+ // [GIVEN] Create and Refresh Production Order.\n+ CreateAndRefreshProdOrder(\n+ ProductionOrder,\n+ ProductionOrder.Status::Released,\n+ ProdItem.\"No.\",\n+ Quantity,\n+ Location.Code,\n+ '');\n+\n+ // [GIVEN] Open Released Production Order page and run Production Journal action.\n+ ReleasedProdOrder.OpenEdit();\n+ ReleasedProdOrder.GoToRecord(ProductionOrder);\n+ LibraryVariableStorage.Enqueue(Quantity);\n+ LibraryVariableStorage.Enqueue(ItemTrackingMode::\"Assign Lot No.\");\n+ LibraryVariableStorage.Enqueue(LotNo);\n+ LibraryVariableStorage.Enqueue(Quantity);\n+ ReleasedProdOrder.ProdOrderLines.ProductionJournal.Invoke();\n+\n+ // [WHEN] Find Item Ledger Entry.\n+ ItemLedgerEntry.SetRange(\"Item No.\", CompItem.\"No.\");\n+ ItemLedgerEntry.SetRange(Quantity, -Quantity);\n+\n+ // [VERIFY] Item Ledger Entry is found.\n+ Assert.IsFalse(ItemLedgerEntry.IsEmpty(), ItemLedgerEntryMustBeFoundErr);\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n@@ -6772,6 +6872,39 @@ codeunit 137404 \"SCM Manufacturing\"\n ReservationPage.OK().Invoke();\n end;\n \n+ [ModalPageHandler]\n+ [Scope('OnPrem')]\n+ procedure ItemTrackingAssignLotNoPageHandler(var ItemTrackingLines: TestPage \"Item Tracking Lines\")\n+ var\n+ DequeueVariable: Variant;\n+ begin\n+ LibraryVariableStorage.Dequeue(DequeueVariable);\n+ ItemTrackingMode := DequeueVariable;\n+ case ItemTrackingMode of\n+ ItemTrackingMode::\"Assign Lot No.\":\n+ begin\n+ ItemTrackingLines.\"Lot No.\".SetValue(LibraryVariableStorage.DequeueText());\n+ LibraryVariableStorage.Dequeue(DequeueVariable);\n+ ItemTrackingLines.\"Quantity (Base)\".SetValue(DequeueVariable);\n+ end;\n+ end;\n+ ItemTrackingLines.OK().Invoke();\n+ end;\n+\n+ [ModalPageHandler]\n+ [Scope('OnPrem')]\n+ procedure ProductionJournalPageHandlerOnlyConsumption(var ProductionJournal: TestPage \"Production Journal\")\n+ var\n+ EntryType: Enum \"Item Ledger Entry Type\";\n+ begin\n+ Assert.IsTrue(ProductionJournal.FindFirstField(ProductionJournal.\"Entry Type\", EntryType::Output), '');\n+ ProductionJournal.\"Output Quantity\".SetValue(0);\n+ Assert.IsTrue(ProductionJournal.FindFirstField(ProductionJournal.\"Entry Type\", EntryType::Consumption), '');\n+ ProductionJournal.Quantity.SetValue(LibraryVariableStorage.DequeueDecimal());\n+ ProductionJournal.ItemTrackingLines.Invoke();\n+ ProductionJournal.Post.Invoke();\n+ end;\n+\n [PageHandler]\n procedure BOMStructurePageHandler(var BOMStructure: TestPage \"BOM Structure\")\n begin\n@@ -6840,5 +6973,74 @@ codeunit 137404 \"SCM Manufacturing\"\n DT2Time(ExpStartDateTime), DT2Time(ProdOrderLine.\"Starting Date-Time\"), StrSubstNo(WrongDateTimeErr, ProdOrderLine.FieldCaption(\"Starting Time\")));\n until ProdOrderLine.Next() = 0;\n end;\n+\n+ local procedure CreateItemWithUOM(\n+ var Item: Record Item;\n+ var UnitOfMeasure: Record \"Unit of Measure\";\n+ var ItemUnitOfMeasure: Record \"Item Unit of Measure\")\n+ begin\n+ LibraryInventory.CreateItem(Item);\n+\n+ LibraryInventory.CreateItemUnitOfMeasure(\n+ ItemUnitOfMeasure,\n+ Item.\"No.\",\n+ UnitOfMeasure.Code,\n+ LibraryRandom.RandInt(0));\n+\n+ Item.Validate(\"Base Unit of Measure\", UnitOfMeasure.Code);\n+ Item.Modify(true);\n+ end;\n+\n+ local procedure CreateAndPostItemJournalLineWithLotNo(\n+ ItemNo: Code[20];\n+ Quantity: Decimal;\n+ LotNo: Code[50];\n+ BinCode: Code[20];\n+ LocationCode: Code[10];\n+ Tracking: Boolean)\n+ var\n+ ItemJournalLine: Record \"Item Journal Line\";\n+ begin\n+ CreateItemJournalLine(ItemJournalLine, ItemNo, Quantity, BinCode, LocationCode);\n+ if Tracking then begin\n+ LibraryVariableStorage.Enqueue(ItemTrackingMode::\"Assign Lot No.\");\n+ LibraryVariableStorage.Enqueue(LotNo);\n+ LibraryVariableStorage.Enqueue(Quantity);\n+ ItemJournalLine.OpenItemTrackingLines(false);\n+ end;\n+ LibraryInventory.PostItemJournalLine(ItemJournalLine.\"Journal Template Name\", ItemJournalLine.\"Journal Batch Name\");\n+ end;\n+\n+ local procedure CreateItemJournalLine(var ItemJournalLine: Record \"Item Journal Line\"; ItemNo: Code[20]; Quantity: Decimal; BinCode: Code[20]; LocationCode: Code[10])\n+ var\n+ ItemJournalTemplate: Record \"Item Journal Template\";\n+ ItemJournalBatch: Record \"Item Journal Batch\";\n+ begin\n+ LibraryInventory.ClearItemJournal(ItemJournalTemplate, ItemJournalBatch);\n+ LibraryInventory.CreateItemJournalTemplate(ItemJournalTemplate);\n+ LibraryInventory.CreateItemJournalBatch(ItemJournalBatch, ItemJournalTemplate.Name);\n+ LibraryInventory.CreateItemJournalLine(\n+ ItemJournalLine,\n+ ItemJournalBatch.\"Journal Template Name\",\n+ ItemJournalBatch.Name,\n+ ItemJournalLine.\"Entry Type\"::\"Positive Adjmt.\",\n+ ItemNo,\n+ Quantity);\n+\n+ ItemJournalLine.Validate(\"Unit Cost\", LibraryRandom.RandDec(10, 2));\n+ ItemJournalLine.Validate(\"Location Code\", LocationCode);\n+ ItemJournalLine.Validate(\"Bin Code\", BinCode);\n+ ItemJournalLine.Modify(true);\n+ end;\n+\n+ local procedure CreateAndRefreshProdOrder(var ProductionOrder: Record \"Production Order\"; Status: Enum \"Production Order Status\"; SourceNo: Code[20]; Quantity: Decimal; LocationCode: Code[10]; BinCode: Code[20])\n+ begin\n+ LibraryManufacturing.CreateProductionOrder(ProductionOrder, Status, ProductionOrder.\"Source Type\"::Item, SourceNo, Quantity);\n+ ProductionOrder.Validate(\"Location Code\", LocationCode);\n+ ProductionOrder.Validate(\"Bin Code\", BinCode);\n+ ProductionOrder.Modify(true);\n+\n+ LibraryManufacturing.RefreshProdOrder(ProductionOrder, false, true, true, true, false);\n+ end;\n }\n \n", "patch": "diff --git a/App/Layers/W1/BaseApp/Inventory/Posting/ItemJnlPostLine.Codeunit.al b/App/Layers/W1/BaseApp/Inventory/Posting/ItemJnlPostLine.Codeunit.al\nindex 7e739c297201..ffe0b880ce8d 100644\n--- a/App/Layers/W1/BaseApp/Inventory/Posting/ItemJnlPostLine.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Posting/ItemJnlPostLine.Codeunit.al\n@@ -1946,8 +1946,11 @@ codeunit 22 \"Item Jnl.-Post Line\"\n Abs(ItemLedgEntry.\"Remaining Quantity\" - ItemLedgEntry.\"Reserved Quantity\")\n then\n AppliedQty := ItemLedgEntry.\"Remaining Quantity\" - ItemLedgEntry.\"Reserved Quantity\"\n- else\n+ else begin\n AppliedQty := -(OldItemLedgEntry.\"Remaining Quantity\" - OldItemLedgEntry.\"Reserved Quantity\");\n+ if (AppliedQty = 0) and (ItemLedgEntry.Count > 1) then\n+ AppliedQty := UpdateAppliedQtyIfConsumptionEntry(ItemLedgEntry, OldItemLedgEntry);\n+ end;\n \n OnApplyItemLedgEntryOnAfterCalcAppliedQty(OldItemLedgEntry, ItemLedgEntry, AppliedQty);\n \n@@ -5908,6 +5911,17 @@ codeunit 22 \"Item Jnl.-Post Line\"\n (ItemJournalLine.\"Applies-to Entry\" <> 0)));\n end;\n \n+ local procedure UpdateAppliedQtyIfConsumptionEntry(ItemLedgerEntry: Record \"Item Ledger Entry\"; OldItemLedgerEntry: Record \"Item Ledger Entry\"): Decimal\n+ begin\n+ if ItemLedgerEntry.\"Entry Type\" <> ItemLedgerEntry.\"Entry Type\"::Consumption then\n+ exit(0);\n+\n+ if (ItemLedgerEntry.\"Remaining Quantity\" + OldItemLedgerEntry.\"Remaining Quantity\") > 0 then\n+ exit(0);\n+\n+ exit(-Abs(OldItemLedgerEntry.\"Reserved Quantity\"));\n+ end;\n+\n [IntegrationEvent(false, false)]\n local procedure OnBeforeAllowProdApplication(OldItemLedgerEntry: Record \"Item Ledger Entry\"; ItemLedgerEntry: Record \"Item Ledger Entry\"; var AllowApplication: Boolean)\n begin\n"} +{"instance_id": "microsoftInternal__NAV-179733__cf-1", "base_instance_id": "microsoftInternal__NAV-179733", "variant_description": "Only Begin-Total task type explicitly excluded from customer field inheritance", "failure_layer": null, "FAIL_TO_PASS": [{"codeunitID": 136323, "functionName": ["CopyTotalsProjectTasksTypeIntoProjectsWithMultipleCustomerBillingOption"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/Job/JobsMultipleCustomers.Codeunit.al b/App/Layers/W1/Tests/Job/JobsMultipleCustomers.Codeunit.al\n--- a/App/Layers/W1/Tests/Job/JobsMultipleCustomers.Codeunit.al\n+++ b/App/Layers/W1/Tests/Job/JobsMultipleCustomers.Codeunit.al\n@@ -1520,6 +1520,53 @@ codeunit 136323 \"Jobs - Multiple Customers\"\n SalesLine.TestField(\"Document No.\", SalesHeader.\"No.\");\n end;\n \n+ [Test]\n+ procedure CopyTotalsProjectTasksTypeIntoProjectsWithMultipleCustomerBillingOption()\n+ var\n+ JobTasks: array[3] of Record \"Job Task\";\n+ Jobs: array[2] of Record Job;\n+ Customers: array[2] of Record Customer;\n+ CopyJob: Codeunit \"Copy Job\";\n+ begin\n+ // [SCENARIO 522645] Copy Totals Project Tasks Type into Projects with Multiple Customer Billing Option\n+ Initialize();\n+\n+ // [GIVEN] Set One Customer Billing option on Project Setup\n+ SetOneCustomerBillingMethodOnProjectSetup();\n+\n+ // [GIVEN] Create Customer\n+ LibrarySales.CreateCustomer(Customers[1]);\n+\n+ // [GIVEN] Create new Project\n+ LibraryJob.CreateJob(Jobs[1], Customers[1].\"No.\");\n+\n+ // [GIVEN] Create new Project Task of Type Begin Total\n+ LibraryJob.CreateJobTask(Jobs[1], JobTasks[1]);\n+ JobTasks[1].\"Job Task Type\" := JobTasks[1].\"Job Task Type\"::\"Begin-Total\";\n+ JobTasks[1].Modify(true);\n+\n+ // [GIVEN] Create new Project Task\n+ LibraryJob.CreateJobTask(Jobs[1], JobTasks[2]);\n+\n+ // [GIVEN] Set Multiple Customers on Project Setup\n+ SetMultiupleCustomersOnProjectSetup();\n+\n+ // [GIVEN] Create new Project\n+ LibraryJob.CreateJob(Jobs[2], Customers[1].\"No.\");\n+\n+ // [WHEN] Copy Project Tasks\n+ CopyJob.CopyJobTasks(Jobs[1], Jobs[2]);\n+\n+ // [THEN] Verify results\n+ JobTasks[3].Get(Jobs[2].\"No.\", JobTasks[1].\"Job Task No.\");\n+ JobTasks[3].TestField(\"Sell-to Customer No.\", '');\n+ JobTasks[3].TestField(\"Bill-to Customer No.\", '');\n+\n+ JobTasks[3].Get(Jobs[2].\"No.\", JobTasks[2].\"Job Task No.\");\n+ JobTasks[3].TestField(\"Sell-to Customer No.\", Jobs[2].\"Sell-to Customer No.\");\n+ JobTasks[3].TestField(\"Bill-to Customer No.\", Jobs[2].\"Bill-to Customer No.\");\n+ end;\n+\n local procedure Initialize()\n begin\n LibraryTestInitialize.OnTestInitialize(Codeunit::\"Jobs - Multiple Customers\");\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Projects/Project/Job/JobTask.Table.al b/App/Layers/W1/BaseApp/Projects/Project/Job/JobTask.Table.al\n--- a/App/Layers/W1/BaseApp/Projects/Project/Job/JobTask.Table.al\n+++ b/App/Layers/W1/BaseApp/Projects/Project/Job/JobTask.Table.al\n@@ -1223,9 +1223,13 @@ table 1001 \"Job Task\"\n begin\n if not Job.Get(\"Job No.\") then\n exit;\n+\n if Job.\"Task Billing Method\" = Job.\"Task Billing Method\"::\"One customer\" then\n exit;\n \n+ if \"Job Task Type\" = \"Job Task Type\"::\"Begin-Total\" then\n+ exit;\n+\n SetHideValidationDialog(true);\n if Job.\"Sell-to Customer No.\" <> '' then\n Validate(\"Sell-to Customer No.\", Job.\"Sell-to Customer No.\");\n"} +{"instance_id": "microsoftInternal__NAV-180484__cf-1", "base_instance_id": "microsoftInternal__NAV-180484", "variant_description": "Status preserved when document is linked and status is Created (same logic, different evaluation order)", "failure_layer": null, "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-180484__cf-2", "FAIL_TO_PASS": [{"codeunitID": 139154, "functionName": ["StatusRemainsCreatedIfHasLinkedDocWhenReopenIncomingDoc"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/Data Exchange/IncomingDocToDataExchUT.Codeunit.al b/App/Layers/W1/Tests/Data Exchange/IncomingDocToDataExchUT.Codeunit.al\nindex 354a3c1..b626696 100644\n--- a/App/Layers/W1/Tests/Data Exchange/IncomingDocToDataExchUT.Codeunit.al\t\n+++ b/App/Layers/W1/Tests/Data Exchange/IncomingDocToDataExchUT.Codeunit.al\t\n@@ -51,6 +51,9 @@ codeunit 139154 \"Incoming Doc. To Data Exch.UT\"\n NothingToReleaseErr: Label 'There is nothing to release for the incoming document';\n NoDocCreatedForChoiceErr: Label 'The given key was not present in the dictionary.';\n UnknownChoiceErr: Label 'Unknown choice %1.', Comment = '%1=Choice (number)';\n+ PEPPOLINVOICELbl: Label 'PEPPOLINVOICE';\n+ PEPPOLLbl: Label 'PEPPOL';\n+ StatusErr: Label '%1 must be %2 in %3';\n \n [Test]\n [Scope('OnPrem')]\n@@ -1472,6 +1475,72 @@ codeunit 139154 \"Incoming Doc. To Data Exch.UT\"\n end;\n end;\n \n+ [Test]\n+ [HandlerFunctions('MessageHandler')]\n+ [Scope('OnPrem')]\n+ procedure StatusRemainsCreatedIfHasLinkedDocWhenReopenIncomingDoc()\n+ var\n+ DataExchDef: Record \"Data Exch. Def\";\n+ SalesHeader: Record \"Sales Header\";\n+ SalesInvoiceHeader: Record \"Sales Invoice Header\";\n+ IncomingDocument: Record \"Incoming Document\";\n+ DataExchangeType: Record \"Data Exchange Type\";\n+ IncomingDocumentCard: TestPage \"Incoming Document\";\n+ XmlPath: Text;\n+ begin\n+ // [SCENARIO 487620] When Stan runs Reopen action on an Incoming Document hvaing Status as Created, then Status remains as Created if a document is linked to it.\n+ Initialize();\n+\n+ // [GIVEN] Create a Sales Invoice.\n+ SalesHeader.Get(\n+ SalesHeader.\"Document Type\"::Invoice,\n+ CreateSalesDocument(\n+ SalesHeader.\"Document Type\"::Invoice,\n+ false));\n+\n+ // [GIVEN] Post Sales Invoice.\n+ SalesInvoiceHeader.Get(LibrarySales.PostSalesDocument(SalesHeader, true, true));\n+\n+ // [GIVEN] Generate and save XmlPath of Sales Invoice.\n+ XmlPath := ExportPEPPOLInvoice(SalesInvoiceHeader);\n+\n+ // [GIVEN] Setup Company Information for Sales Invoice Import.\n+ SetupCompanyForInvoiceImport(SalesInvoiceHeader);\n+\n+ // [GIVEN] Find Data Exchange Def.\n+ DataExchDef.Get(PEPPOLINVOICELbl);\n+\n+ // [GIVEN] Create Data Exchange Type.\n+ CreateDataExchangeType(DataExchangeType, DataExchDef);\n+\n+ // [GIVEN] Create Incoming Document and Validate Data Exchange Type.\n+ LibraryIncomingDocuments.CreateNewIncomingDocument(IncomingDocument);\n+ IncomingDocument.\"Data Exchange Type\" := DataExchangeType.Code;\n+ IncomingDocument.Modify(true);\n+\n+ // [GIVEN] Import Incoming Document.\n+ ImportAttachToIncomingDoc(IncomingDocument, XmlPath);\n+\n+ // [GIVEN] Open Incoming Document Card page and run Create Document action.\n+ LibraryVariableStorage.Enqueue(DocCreatedMsg);\n+ IncomingDocumentCard.OpenView();\n+ IncomingDocumentCard.GotoRecord(IncomingDocument);\n+ IncomingDocumentCard.CreateDocument.Invoke();\n+\n+ // [WHEN] Run Reopen action.\n+ IncomingDocumentCard.Reopen.Invoke();\n+\n+ // [VERIFY] Status of Incoming Document remains as Created.\n+ Assert.AreEqual(\n+ Format(IncomingDocument.Status::Created),\n+ IncomingDocumentCard.StatusField.Value,\n+ StrSubstNo(\n+ StatusErr,\n+ IncomingDocumentCard.StatusField.Caption(),\n+ Format(IncomingDocument.Status::Created),\n+ IncomingDocument.TableCaption()));\n+ end;\n+\n local procedure CreateDataExchDefSalesInvoiceAndLinesWithNamespaces(var DataExchDef: Record \"Data Exch. Def\")\n var\n SalesHeaderDataExchLineDef: Record \"Data Exch. Line Def\";\n@@ -2788,6 +2857,19 @@ codeunit 139154 \"Incoming Doc. To Data Exch.UT\"\n IncomingDocumentsSetup.Insert();\n end;\n \n+ local procedure CreateDataExchangeType(var DataExchangeType: Record \"Data Exchange Type\"; DataExchDef: Record \"Data Exch. Def\")\n+ begin\n+ DataExchDef.SetLoadFields(Code);\n+\n+ DataExchangeType.SetLoadFields(Code, \"Data Exch. Def. Code\");\n+ DataExchangeType.SetRange(\"Data Exch. Def. Code\", DataExchDef.Code);\n+ if not DataExchangeType.FindFirst() then begin\n+ DataExchangeType.Code := PEPPOLLbl;\n+ DataExchangeType.\"Data Exch. Def. Code\" := DataExchDef.Code;\n+ DataExchangeType.Insert();\n+ end;\n+ end;\n+\n [MessageHandler]\n [Scope('OnPrem')]\n procedure MessageHandler(Msg: Text[1024])\n", "patch": "diff --git a/App/Layers/W1/BaseApp/eServices/EDocument/ReleaseIncomingDocument.Codeunit.al b/App/Layers/W1/BaseApp/eServices/EDocument/ReleaseIncomingDocument.Codeunit.al\nindex 4e5ba08..473de43 100644\n--- a/App/Layers/W1/BaseApp/eServices/EDocument/ReleaseIncomingDocument.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/eServices/EDocument/ReleaseIncomingDocument.Codeunit.al\n@@ -44,11 +44,15 @@ codeunit 132 \"Release Incoming Document\"\n #pragma warning restore AA0470\n \n procedure Reopen(var IncomingDocument: Record \"Incoming Document\")\n+ var\n+ RelatedRecord: Variant;\n begin\n if IncomingDocument.Status = IncomingDocument.Status::New then\n exit;\n ClearReleaseFields(IncomingDocument);\n- IncomingDocument.Status := IncomingDocument.Status::New;\n+\n+ if not ((IncomingDocument.Status = IncomingDocument.Status::Created) and (IncomingDocument.GetRecord(RelatedRecord))) then\n+ IncomingDocument.Status := IncomingDocument.Status::New;\n \n IncomingDocument.Modify(true);\n end;\n"} +{"instance_id": "microsoftInternal__NAV-180484__cf-2", "base_instance_id": "microsoftInternal__NAV-180484", "variant_description": "Reopen exits early when document is linked instead of conditional status assignment", "failure_layer": null, "FAIL_TO_PASS": [{"codeunitID": 139154, "functionName": ["StatusRemainsCreatedIfHasLinkedDocWhenReopenIncomingDoc"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/Data Exchange/IncomingDocToDataExchUT.Codeunit.al b/App/Layers/W1/Tests/Data Exchange/IncomingDocToDataExchUT.Codeunit.al\n--- a/App/Layers/W1/Tests/Data Exchange/IncomingDocToDataExchUT.Codeunit.al\n+++ b/App/Layers/W1/Tests/Data Exchange/IncomingDocToDataExchUT.Codeunit.al\n@@ -51,6 +51,9 @@ codeunit 139154 \"Incoming Doc. To Data Exch.UT\"\n NothingToReleaseErr: Label 'There is nothing to release for the incoming document';\n NoDocCreatedForChoiceErr: Label 'The given key was not present in the dictionary.';\n UnknownChoiceErr: Label 'Unknown choice %1.', Comment = '%1=Choice (number)';\n+ PEPPOLINVOICELbl: Label 'PEPPOLINVOICE';\n+ PEPPOLLbl: Label 'PEPPOL';\n+ StatusErr: Label '%1 must be %2 in %3';\n \n [Test]\n [Scope('OnPrem')]\n@@ -1472,6 +1475,72 @@ codeunit 139154 \"Incoming Doc. To Data Exch.UT\"\n end;\n end;\n \n+ [Test]\n+ [HandlerFunctions('MessageHandler')]\n+ [Scope('OnPrem')]\n+ procedure StatusRemainsCreatedIfHasLinkedDocWhenReopenIncomingDoc()\n+ var\n+ DataExchDef: Record \"Data Exch. Def\";\n+ SalesHeader: Record \"Sales Header\";\n+ SalesInvoiceHeader: Record \"Sales Invoice Header\";\n+ IncomingDocument: Record \"Incoming Document\";\n+ DataExchangeType: Record \"Data Exchange Type\";\n+ IncomingDocumentCard: TestPage \"Incoming Document\";\n+ XmlPath: Text;\n+ begin\n+ // [SCENARIO 487620] When Stan runs Reopen action on an Incoming Document hvaing Status as Created, then Status remains as Created if a document is linked to it.\n+ Initialize();\n+\n+ // [GIVEN] Create a Sales Invoice.\n+ SalesHeader.Get(\n+ SalesHeader.\"Document Type\"::Invoice,\n+ CreateSalesDocument(\n+ SalesHeader.\"Document Type\"::Invoice,\n+ false));\n+\n+ // [GIVEN] Post Sales Invoice.\n+ SalesInvoiceHeader.Get(LibrarySales.PostSalesDocument(SalesHeader, true, true));\n+\n+ // [GIVEN] Generate and save XmlPath of Sales Invoice.\n+ XmlPath := ExportPEPPOLInvoice(SalesInvoiceHeader);\n+\n+ // [GIVEN] Setup Company Information for Sales Invoice Import.\n+ SetupCompanyForInvoiceImport(SalesInvoiceHeader);\n+\n+ // [GIVEN] Find Data Exchange Def.\n+ DataExchDef.Get(PEPPOLINVOICELbl);\n+\n+ // [GIVEN] Create Data Exchange Type.\n+ CreateDataExchangeType(DataExchangeType, DataExchDef);\n+\n+ // [GIVEN] Create Incoming Document and Validate Data Exchange Type.\n+ LibraryIncomingDocuments.CreateNewIncomingDocument(IncomingDocument);\n+ IncomingDocument.\"Data Exchange Type\" := DataExchangeType.Code;\n+ IncomingDocument.Modify(true);\n+\n+ // [GIVEN] Import Incoming Document.\n+ ImportAttachToIncomingDoc(IncomingDocument, XmlPath);\n+\n+ // [GIVEN] Open Incoming Document Card page and run Create Document action.\n+ LibraryVariableStorage.Enqueue(DocCreatedMsg);\n+ IncomingDocumentCard.OpenView();\n+ IncomingDocumentCard.GotoRecord(IncomingDocument);\n+ IncomingDocumentCard.CreateDocument.Invoke();\n+\n+ // [WHEN] Run Reopen action.\n+ IncomingDocumentCard.Reopen.Invoke();\n+\n+ // [VERIFY] Status of Incoming Document remains as Created.\n+ Assert.AreEqual(\n+ Format(IncomingDocument.Status::Created),\n+ IncomingDocumentCard.StatusField.Value,\n+ StrSubstNo(\n+ StatusErr,\n+ IncomingDocumentCard.StatusField.Caption(),\n+ Format(IncomingDocument.Status::Created),\n+ IncomingDocument.TableCaption()));\n+ end;\n+\n local procedure CreateDataExchDefSalesInvoiceAndLinesWithNamespaces(var DataExchDef: Record \"Data Exch. Def\")\n var\n SalesHeaderDataExchLineDef: Record \"Data Exch. Line Def\";\n@@ -2788,6 +2857,19 @@ codeunit 139154 \"Incoming Doc. To Data Exch.UT\"\n IncomingDocumentsSetup.Insert();\n end;\n \n+ local procedure CreateDataExchangeType(var DataExchangeType: Record \"Data Exchange Type\"; DataExchDef: Record \"Data Exch. Def\")\n+ begin\n+ DataExchDef.SetLoadFields(Code);\n+\n+ DataExchangeType.SetLoadFields(Code, \"Data Exch. Def. Code\");\n+ DataExchangeType.SetRange(\"Data Exch. Def. Code\", DataExchDef.Code);\n+ if not DataExchangeType.FindFirst() then begin\n+ DataExchangeType.Code := PEPPOLLbl;\n+ DataExchangeType.\"Data Exch. Def. Code\" := DataExchDef.Code;\n+ DataExchangeType.Insert();\n+ end;\n+ end;\n+\n [MessageHandler]\n [Scope('OnPrem')]\n procedure MessageHandler(Msg: Text[1024])\n", "patch": "diff --git a/App/Layers/W1/BaseApp/eServices/EDocument/ReleaseIncomingDocument.Codeunit.al b/App/Layers/W1/BaseApp/eServices/EDocument/ReleaseIncomingDocument.Codeunit.al\n--- a/App/Layers/W1/BaseApp/eServices/EDocument/ReleaseIncomingDocument.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/eServices/EDocument/ReleaseIncomingDocument.Codeunit.al\n@@ -44,11 +44,17 @@ codeunit 132 \"Release Incoming Document\"\n #pragma warning restore AA0470\n \n procedure Reopen(var IncomingDocument: Record \"Incoming Document\")\n+ var\n+ RelatedRecord: Variant;\n begin\n if IncomingDocument.Status = IncomingDocument.Status::New then\n exit;\n ClearReleaseFields(IncomingDocument);\n- IncomingDocument.Status := IncomingDocument.Status::New;\n+\n+ if (IncomingDocument.Status = IncomingDocument.Status::Created) and (IncomingDocument.GetRecord(RelatedRecord)) then\n+ exit;\n+\n+ IncomingDocument.Status := IncomingDocument.Status::New;\n \n IncomingDocument.Modify(true);\n end;\n"} +{"instance_id": "microsoftInternal__NAV-182354__cf-1", "base_instance_id": "microsoftInternal__NAV-182354", "variant_description": "System should fallback to WorkDate only when Today is not initialized", "failure_layer": null, "FAIL_TO_PASS": [{"codeunitID": 134924, "functionName": ["TotalOverdueLCYInFinanceCue"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/ERMCues.Codeunit.al b/App/Layers/W1/Tests/ERM/ERMCues.Codeunit.al\n--- a/App/Layers/W1/Tests/ERM/ERMCues.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ERMCues.Codeunit.al\n@@ -13,8 +13,6 @@ codeunit 134924 \"ERM Cues\"\n Assert: Codeunit Assert;\n LibraryTimeSheet: Codeunit \"Library - Time Sheet\";\n LibraryService: Codeunit \"Library - Service\";\n- WrongValueErr: Label 'Wrong value of the field %1 in table %2.';\n- AverageDaysDelayedErr: Label 'Average Days Delayed is calculated incorrectly.';\n LibraryUtility: Codeunit \"Library - Utility\";\n LibraryRandom: Codeunit \"Library - Random\";\n LibraryTestInitialize: Codeunit \"Library - Test Initialize\";\n@@ -24,6 +22,8 @@ codeunit 134924 \"ERM Cues\"\n ShipStatus: Option Full,Partial,\"Not Shipped\";\n WrongNumberOfDelayedOrdersErr: Label 'Wrong number of delayed Sales Orders.';\n RedundantSalesOnListErr: Label 'List of delayed Sales Order contains redundant documents.';\n+ WrongValueErr: Label 'Wrong value of the field %1 in table %2.', Comment = '%1 = Field name, %2 = Table name';\n+ AverageDaysDelayedErr: Label 'Average Days Delayed is calculated incorrectly.';\n IsInitialized: Boolean;\n \n [Test]\n@@ -699,6 +699,50 @@ codeunit 134924 \"ERM Cues\"\n Assert.IsFalse(SalesOrderList.Previous(), '');\n end;\n \n+ [Test]\n+ procedure TotalOverdueLCYInFinanceCue()\n+ var\n+ DetailedCustLedgEntry: Record \"Detailed Cust. Ledg. Entry\";\n+ CustomerLedgerEntries: TestPage \"Customer Ledger Entries\";\n+ AccountReceivablesKPIs: TestPage \"Account Receivables KPIs\";\n+ TotalOverDueLCYErr: Label 'The total overdue LCY amount is not calculated correctly.', Locked = true;\n+ DateFilterTxt: Label '<=%1', Locked = true, Comment = '%1 = Date';\n+ begin\n+ // [FEATURE] [Finance Cue] [Accounts Receivables Overview]\n+ // [SCENARIO 506725] Total overdue LCY cue should fallback to WorkDate when Today is not initialized\n+ Initialize();\n+\n+ // [GIVEN] Create customer ledger entries and detailed customer ledger entries\n+ // [GIVEN] Cust. ledger entry 1, due date = today - 10days, open = true, amount (LCY) = 100.34, remaining amount (LCY) = 50.17 (detailed cust. ledger entry 1 amount (LCY) = 100.34, detailed cust. ledger entry 2 amount (LCY) = 50.17)\n+ // [GIVEN] Cust. ledger entry 2, due date = today, open = false, amount (LCY) = 120.23, remaining amount (LCY) = 0 (detailed cust. ledger entry 1 amount (LCY) = 120.23, detailed cust. ledger entry 2 amount (LCY) = 120.23)\n+ // [GIVEN] Cust. ledger entry 3, due date = today + 20days, open = true, amount (LCY) = 150.82, remaining amount (LCY) = 150.82 (detailed cust. ledger entry 1 amount (LCY) = 150.82, detailed cust. ledger entry 2 amount (LCY) = 150.82)\n+ CreateCustomerLedgerEntry(CalcDate('<-10D>', Today), true, 100.34, 50.17);\n+ CreateCustomerLedgerEntry(Today, false, 120.23, 120.23);\n+ CreateCustomerLedgerEntry(CalcDate('<+20D>', Today), true, 150.82, 0);\n+\n+ // [WHEN] Open Account Receivables KPIs page with overdue date filter\n+ AccountReceivablesKPIs.OpenView();\n+ AccountReceivablesKPIs.Filter.SetFilter(\"Overdue Date Filter\", StrSubstNo(DateFilterTxt, Today()));\n+\n+ // [WHEN] Calculate total overdue LCY amount\n+ // simulate environment without system date\n+ DetailedCustLedgEntry.SetFilter(\"Initial Entry Due Date\", '<=%1', Today());\n+ DetailedCustLedgEntry.CalcSums(\"Amount (LCY)\");\n+\n+ // [THEN] Verify the total overdue amount is correct\n+ Assert.AreEqual(Format(DetailedCustLedgEntry.\"Amount (LCY)\"), AccountReceivablesKPIs.\"Sales - Total Overdue (LCY)\".Value, TotalOverDueLCYErr);\n+\n+ // [WHEN] DrillDown to \"Sales - Total Overdue (LCY)\" cue\n+ CustomerLedgerEntries.Trap();\n+ AccountReceivablesKPIs.\"Sales - Total Overdue (LCY)\".Drilldown();\n+\n+ // [THEN] Only Cust. ledger entry 1 is shown on Cust. ledger entries page\n+ CustomerLedgerEntries.First();\n+ Assert.AreEqual(Format(CustomerLedgerEntries.\"Remaining Amt. (LCY)\"), AccountReceivablesKPIs.\"Sales - Total Overdue (LCY)\".Value, TotalOverDueLCYErr);\n+ Assert.IsFalse(CustomerLedgerEntries.Next(), '');\n+ CustomerLedgerEntries.Close();\n+ end;\n+\n local procedure Initialize()\n var\n SalesHeader: Record \"Sales Header\";\n@@ -711,6 +754,8 @@ codeunit 134924 \"ERM Cues\"\n ServiceContractLine: Record \"Service Contract Line\";\n PostedWhseShipmentHeader: Record \"Posted Whse. Shipment Header\";\n VendorLedgerEntry: Record \"Vendor Ledger Entry\";\n+ CustLedgerEntry: Record \"Cust. Ledger Entry\";\n+ DetailedCustLedgEntry: Record \"Detailed Cust. Ledg. Entry\";\n SalesCue: Record \"Sales Cue\";\n begin\n LibraryTestInitialize.OnTestInitialize(CODEUNIT::\"ERM Cues\");\n@@ -724,6 +769,9 @@ codeunit 134924 \"ERM Cues\"\n ServiceContractLine.DeleteAll();\n PostedWhseShipmentHeader.DeleteAll();\n VendorLedgerEntry.DeleteAll();\n+ CustLedgerEntry.DeleteAll();\n+ DetailedCustLedgEntry.DeleteAll();\n+\n if SalesCue.Get() then begin\n SalesCue.\"Avg. Days Delayed Updated On\" := 0DT;\n SalesCue.Modify();\n@@ -924,6 +972,35 @@ codeunit 134924 \"ERM Cues\"\n SalesLine.Modify(true);\n end;\n \n+ local procedure CreateCustomerLedgerEntry(DueDate: Date; Open: Boolean; Amount1: Decimal; Amount2: Decimal)\n+ var\n+ CustLedgerEntry: Record \"Cust. Ledger Entry\";\n+ begin\n+ CustLedgerEntry.\"Entry No.\" := CustLedgerEntry.GetLastEntryNo() + 1;\n+ CustLedgerEntry.\"Document Type\" := CustLedgerEntry.\"Document Type\"::Invoice;\n+ CustLedgerEntry.\"Due Date\" := DueDate;\n+ CustLedgerEntry.Open := Open;\n+ CustLedgerEntry.Insert();\n+\n+ CreateDetailedCustLedgEntry(CustLedgerEntry.\"Entry No.\", DueDate, Amount1, CustLedgerEntry.\"Document Type\", true);\n+ CreateDetailedCustLedgEntry(CustLedgerEntry.\"Entry No.\", DueDate, -Amount2, CustLedgerEntry.\"Document Type\", false);\n+ end;\n+\n+ local procedure CreateDetailedCustLedgEntry(CustEntryNo: Integer; PostingDate: Date; AmountLCY: Decimal; DocumentType: Enum \"Gen. Journal Document Type\"; LedgerEntryAmount: Boolean)\n+ var\n+ DetailedCustLedgEntry: Record \"Detailed Cust. Ledg. Entry\";\n+ begin\n+ DetailedCustLedgEntry.\"Entry No.\" := DetailedCustLedgEntry.GetLastEntryNo() + 1;\n+ DetailedCustLedgEntry.\"Cust. Ledger Entry No.\" := CustEntryNo;\n+ DetailedCustLedgEntry.\"Posting Date\" := PostingDate;\n+ DetailedCustLedgEntry.\"Amount (LCY)\" := AmountLCY;\n+ DetailedCustLedgEntry.\"Document Type\" := DocumentType;\n+ DetailedCustLedgEntry.\"Initial Document Type\" := DocumentType;\n+ DetailedCustLedgEntry.\"Initial Entry Due Date\" := PostingDate;\n+ DetailedCustLedgEntry.\"Ledger Entry Amount\" := LedgerEntryAmount;\n+ DetailedCustLedgEntry.Insert();\n+ end;\n+\n local procedure VerifySalesCueFlowFields()\n var\n SalesCue: Record \"Sales Cue\";\n", "patch": "diff --git a/App/Layers/W1/BaseApp/RoleCenters/AccountReceivablesKPIs.Page.al b/App/Layers/W1/BaseApp/RoleCenters/AccountReceivablesKPIs.Page.al\n--- a/App/Layers/W1/BaseApp/RoleCenters/AccountReceivablesKPIs.Page.al\n+++ b/App/Layers/W1/BaseApp/RoleCenters/AccountReceivablesKPIs.Page.al\n@@ -27,8 +27,10 @@ page 1318 \"Account Receivables KPIs\"\n CustomerLedgerEntries: Page \"Customer Ledger Entries\";\n begin\n CustLedgerEntry.SetRange(Open, true);\n- CustLedgerEntry.SetFilter(\"Remaining Amount\", '>%1', 0);\n- CustLedgerEntry.SetFilter(\"Due Date\", '<=%1', WorkDate());\n+ if Today() = 0D then\n+ CustLedgerEntry.SetFilter(\"Due Date\", '<=%1', WorkDate())\n+ else\n+ CustLedgerEntry.SetFilter(\"Due Date\", '<=%1', Today());\n CustomerLedgerEntries.SetTableView(CustLedgerEntry);\n CustomerLedgerEntries.Run();\n end;\n@@ -43,7 +45,6 @@ page 1318 \"Account Receivables KPIs\"\n CustomerLedgerEntries: Page \"Customer Ledger Entries\";\n begin\n CustLedgerEntry.SetRange(Open, true);\n- CustLedgerEntry.SetFilter(\"Remaining Amount\", '>%1', 0);\n CustomerLedgerEntries.SetTableView(CustLedgerEntry);\n CustomerLedgerEntries.Run();\n end;\n@@ -93,12 +94,15 @@ page 1318 \"Account Receivables KPIs\"\n SalesInvoicesDueNextWeekStyleExpr: Text;\n AverageCollectionDays: Decimal;\n \n- trigger OnInit()\n+ trigger OnOpenPage()\n var\n CuesAndKPIs: Codeunit \"Cues And KPIs\";\n SalesInvoicesDueNextWeekStyle: Enum \"Cues And KPIs Style\";\n begin\n- Rec.SetRange(\"Overdue Date Filter\", 0D, WorkDate());\n+ if Today() = 0D then\n+ Rec.SetRange(\"Overdue Date Filter\", 0D, WorkDate())\n+ else\n+ Rec.SetRange(\"Overdue Date Filter\", 0D, Today());\n if not Rec.Get() then begin\n Clear(Rec);\n Rec.Insert();\n@@ -113,11 +117,7 @@ page 1318 \"Account Receivables KPIs\"\n CuesAndKPIs.SetCueStyle(Database::\"Activities Cue\", ActivitiesCue.FieldNo(\"Sales Invoices Due Next Week\"), ActivitiesCue.\"Sales Invoices Due Next Week\", SalesInvoicesDueNextWeekStyle);\n SalesInvoicesDueNextWeekStyleExpr := Format(SalesInvoicesDueNextWeekStyle);\n Rec.\"AR Accounts Balance\" := ActivitiesMgt.CalcARAccountsBalances();\n- Rec.Modify();\n- end;\n \n- trigger OnOpenPage()\n- begin\n AverageCollectionDays := ActivitiesMgt.CalcAverageCollectionDays();\n end;\n }\n"} +{"instance_id": "microsoftInternal__NAV-183399__cf-1", "base_instance_id": "microsoftInternal__NAV-183399", "variant_description": "Document Amount field accepts up to 4 decimal places", "failure_layer": null, "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-183399__cf-2", "FAIL_TO_PASS": [{"codeunitID": 134918, "functionName": ["DocumentAmountInPurchJnlAcceptsMaxThreeDecimalPlacesValue"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/ERMSalesPurchaseApplication.Codeunit.al b/App/Layers/W1/Tests/ERM/ERMSalesPurchaseApplication.Codeunit.al\n--- a/App/Layers/W1/Tests/ERM/ERMSalesPurchaseApplication.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ERMSalesPurchaseApplication.Codeunit.al\n@@ -1359,6 +1359,42 @@ codeunit 134918 \"ERM Sales/Purchase Application\"\n VerifyCustomerLedgerEntry(Customer.\"No.\");\n end;\n \n+ [Test]\n+ [Scope('OnPrem')]\n+ procedure DocumentAmountInPurchJnlAcceptsMaxThreeDecimalPlacesValue()\n+ var\n+ Vendor: Record Vendor;\n+ PurchaseJournal: TestPage \"Purchase Journal\";\n+ DocumentAmount: Decimal;\n+ begin\n+ // [SCENARIO 534464] Document Amount field in Purchase Journal accepts a value of maximum 4 decimal places.\n+ Initialize();\n+\n+ // [GIVEN] Create a Vendor.\n+ LibraryPurchase.CreateVendor(Vendor);\n+\n+ // [GIVEN] Open Purchase Journal.\n+ PurchaseJournal.OpenView();\n+ PurchaseJournal.New();\n+ PurchaseJournal.\"Account Type\".SetValue(\"Gen. Journal Account Type\"::Vendor);\n+ PurchaseJournal.\"Account No.\".SetValue(Vendor.\"No.\");\n+\n+ // [GIVEN] Generate and save Document Amount in a Variable.\n+ DocumentAmount := LibraryRandom.RandDecInRange(1, 4, 4);\n+\n+ // [WHEN] Set value in Document Amount field in Purchase Journal.\n+ PurchaseJournal.DocumentAmount.SetValue(DocumentAmount);\n+\n+ // [THEN] Document Amount in Purchase Journal has the correct value.\n+ Assert.AreEqual(\n+ DocumentAmount,\n+ PurchaseJournal.DocumentAmount.AsDecimal(),\n+ StrSubstNo(\n+ DocumentAmountLogicErr,\n+ DocumentAmount,\n+ PurchaseJournal.DocumentAmount.AsDecimal()));\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/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@@ -255,6 +255,7 @@ page 254 \"Purchase Journal\"\n {\n ApplicationArea = Basic, Suite;\n AutoFormatExpression = Rec.\"Currency Code\";\n+ DecimalPlaces = 0 : 4;\n Caption = 'Document Amount';\n ToolTip = 'Specifies the total amount (including VAT) that the journal line consists of.';\n \n"} +{"instance_id": "microsoftInternal__NAV-183399__cf-2", "base_instance_id": "microsoftInternal__NAV-183399", "variant_description": "Document Amount field ignores currency precision by removing AutoFormatExpression", "failure_layer": null, "FAIL_TO_PASS": [{"codeunitID": 134918, "functionName": ["DocumentAmountInPurchJnlAcceptsMaxThreeDecimalPlacesValue"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/ERM/ERMSalesPurchaseApplication.Codeunit.al b/App/Layers/W1/Tests/ERM/ERMSalesPurchaseApplication.Codeunit.al\n--- a/App/Layers/W1/Tests/ERM/ERMSalesPurchaseApplication.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ERMSalesPurchaseApplication.Codeunit.al\n@@ -1359,6 +1359,42 @@ codeunit 134918 \"ERM Sales/Purchase Application\"\n VerifyCustomerLedgerEntry(Customer.\"No.\");\n end;\n \n+ [Test]\n+ [Scope('OnPrem')]\n+ procedure DocumentAmountInPurchJnlAcceptsMaxThreeDecimalPlacesValue()\n+ var\n+ Vendor: Record Vendor;\n+ PurchaseJournal: TestPage \"Purchase Journal\";\n+ DocumentAmount: Decimal;\n+ begin\n+ // [SCENARIO 534464] Document Amount field in Purchase Journal accepts a value of maximum 3 decimal places.\n+ Initialize();\n+\n+ // [GIVEN] Create a Vendor.\n+ LibraryPurchase.CreateVendor(Vendor);\n+\n+ // [GIVEN] Open Purchase Journal.\n+ PurchaseJournal.OpenView();\n+ PurchaseJournal.New();\n+ PurchaseJournal.\"Account Type\".SetValue(\"Gen. Journal Account Type\"::Vendor);\n+ PurchaseJournal.\"Account No.\".SetValue(Vendor.\"No.\");\n+\n+ // [GIVEN] Generate and save Document Amount in a Variable.\n+ DocumentAmount := LibraryRandom.RandDecInRange(1, 4, 3);\n+\n+ // [WHEN] Set value in Document Amount field in Purchase Journal.\n+ PurchaseJournal.DocumentAmount.SetValue(DocumentAmount);\n+\n+ // [THEN] Document Amount in Purchase Journal has the correct value.\n+ Assert.AreEqual(\n+ DocumentAmount,\n+ PurchaseJournal.DocumentAmount.AsDecimal(),\n+ StrSubstNo(\n+ DocumentAmountLogicErr,\n+ DocumentAmount,\n+ PurchaseJournal.DocumentAmount.AsDecimal()));\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/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@@ -255,6 +255,6 @@ page 254 \"Purchase Journal\"\n {\n ApplicationArea = Basic, Suite;\n- AutoFormatExpression = Rec.\"Currency Code\";\n+ DecimalPlaces = 0 : 3;\n Caption = 'Document Amount';\n ToolTip = 'Specifies the total amount (including VAT) that the journal line consists of.';\n \n"} +{"instance_id": "microsoftInternal__NAV-185488__cf-1", "base_instance_id": "microsoftInternal__NAV-185488", "variant_description": "IsHandled set to true prevents notification entry creation", "failure_layer": null, "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\nindex eec702f..6f4cc29 100644\n--- a/App/Layers/W1/Tests/Workflow/WFDemoPurchQuoteApprovals.Codeunit.al\n+++ b/App/Layers/W1/Tests/Workflow/WFDemoPurchQuoteApprovals.Codeunit.al\n@@ -169,6 +169,50 @@ codeunit 134184 \"WF Demo Purch Quote Approvals\"\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 [HandlerFunctions('MessageHandler')]\n [Scope('OnPrem')]\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"} +{"instance_id": "microsoftInternal__NAV-185792__cf-1", "base_instance_id": "microsoftInternal__NAV-185792", "variant_description": "Remove temp job journal line creation step from Amount LCY recalculation", "failure_layer": null, "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\nindex d5e9b4a..4eb1533 100644\n--- a/App/Layers/W1/Tests/Job/JobJournal.Codeunit.al\n+++ b/App/Layers/W1/Tests/Job/JobJournal.Codeunit.al\n@@ -44,6 +44,7 @@ codeunit 136305 \"Job Journal\"\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@@ -2919,6 +2920,58 @@ codeunit 136305 \"Job Journal\"\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.AreNotEqual(GenJournalLine.\"Job Total Cost (LCY)\", PreviousProjectTotalCostLCY, ProjectTotalCostErr);\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/Journal/GenJournalLine.Table.al b/App/Layers/W1/BaseApp/Finance/GeneralLedger/Journal/GenJournalLine.Table.al\nindex 53e7159..0000003 100644\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@@ -599,6 +599,11 @@ table 81 \"Gen. Journal Line\"\n Validate(\"Bal. VAT %\");\n UpdateLineBalance();\n end;\n+\n+ if (\"Job No.\" <> '') and (\"Job Task No.\" <> '') then begin\n+ CreateTempJobJnlLine();\n+ UpdatePricesFromJobJnlLine();\n+ end;\n end;\n }\n field(17; \"Balance (LCY)\"; Decimal)\n"} +{"instance_id": "microsoftInternal__NAV-188438__cf-1", "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", "failure_layer": "L5-toolchain-ecosystem", "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\nindex 54ca91b..cf8b504 100644\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,51 @@ 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 }\n\\ No newline at end of file\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\nindex 4644c87..ab8bb3f 100644\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@@ -3,6 +3,7 @@ namespace Microsoft.Sustainability.Calculation;\n using Microsoft.Sustainability.Journal;\n using Microsoft.Sustainability.Account;\n using Microsoft.Finance.GeneralLedger.Ledger;\n+using Microsoft.Finance.GeneralLedger.Account;\n \n codeunit 6218 \"Sustainability Calc. Mgt.\"\n {\n@@ -67,10 +68,13 @@ codeunit 6218 \"Sustainability Calc. Mgt.\"\n procedure GetCollectableGLAmount(SustainAccountCategory: Record \"Sustain. Account Category\"; FromDate: Date; ToDate: Date): Decimal\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-192565__cf-1", "base_instance_id": "microsoftInternal__NAV-192565", "variant_description": "Non-deductible VAT is cleared only when Direct Unit Cost = 0 AND Quantity <> 0", "failure_layer": null, "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-192565__cf-1", "FAIL_TO_PASS": [{"codeunitID": 134282, "functionName": ["ChangingDirectUnitCostToZeroChangesNonDeductibleVAT"]}], "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@@ -179,6 +179,35 @@ codeunit 134282 \"Non-Deductible UT\"\n Assert.ExpectedError(StrSubstNo(DifferentNonDedVATRatesSameVATIdentifierErr, VATPostingSetup.\"VAT Bus. Posting Group\", VATPostingSetup.\"VAT Prod. Posting Group\"));\n end;\n \n+ [Test]\n+ procedure ChangingDirectUnitCostToZeroChangesNonDeductibleVAT()\n+ var\n+ VATPostingSetup: Record \"VAT Posting Setup\";\n+ PurchaseHeader: Record \"Purchase Header\";\n+ PurchaseLine: Record \"Purchase Line\";\n+ begin\n+ // [SCENARIO 546032] Changeing the direct unit cost to zero also changes the Non-Deductible VAT of the purchase document when quantity is non-zero\n+\n+ Initialize();\n+ // [GIVEN] VAT Posting Setup with \"VAT Identifier\" = \"X\", \"Allow Non-Deductible VAT\" is enabled and \"Non-Deductible VAT %\" is specified\n+ LibraryNonDeductibleVAT.CreateNonDeductibleNormalVATPostingSetup(VATPostingSetup);\n+ // [GIVEN] Purchase invoice with Non-Deductible VAT posting setup and a single line with direct unit cost\n+ LibraryPurchase.CreatePurchHeader(\n+ PurchaseHeader, PurchaseHeader.\"Document Type\"::Invoice,\n+ LibraryPurchase.CreateVendorWithVATBusPostingGroup(VATPostingSetup.\"VAT Bus. Posting Group\"));\n+ LibraryPurchase.CreatePurchaseLine(\n+ PurchaseLine, PurchaseHeader, PurchaseLine.Type::Item,\n+ LibraryInventory.CreateItemWithVATProdPostingGroup(VATPostingSetup.\"VAT Prod. Posting Group\"), LibraryRandom.RandInt(100));\n+ PurchaseLine.Validate(\"Direct Unit Cost\", LibraryRandom.RandDec(100, 2));\n+\n+ // [WHEN] Change \"Direct Unit Cost\" to 0 in the purchase line\n+ PurchaseLine.Validate(\"Direct Unit Cost\", 0);\n+ PurchaseLine.Validate(Quantity, 5);\n+ // [THEN] \"Non-Deductible VAT Base\" and \"Non-Deductible VAT Amount\" are 0 in the purchase line\n+ PurchaseLine.TestField(\"Non-Deductible VAT Base\", 0);\n+ PurchaseLine.TestField(\"Non-Deductible VAT Amount\", 0);\n+ end;\n+\n local procedure Initialize()\n begin\n LibraryTestInitialize.OnTestInitialize(Codeunit::\"Non-Deductible UT\");\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Purchases/Document/PurchaseLine.Table.al b/App/Layers/W1/BaseApp/Purchases/Document/PurchaseLine.Table.al\n--- a/App/Layers/W1/BaseApp/Purchases/Document/PurchaseLine.Table.al\n+++ b/App/Layers/W1/BaseApp/Purchases/Document/PurchaseLine.Table.al\n@@ -5365,6 +5365,8 @@ table 39 \"Purchase Line\"\n Amount := 0;\n \"VAT Base Amount\" := 0;\n \"Amount Including VAT\" := 0;\n+ if Quantity <> 0 then\n+ NonDeductibleVAT.ClearNonDeductibleVAT(Rec);\n OnUpdateVATAmountsOnBeforePurchLineModify(Rec, PurchLine2);\n if (Quantity = 0) and (xRec.Quantity <> 0) and (xRec.Amount <> 0) then begin\n if \"Line No.\" <> 0 then\n"} +{"instance_id": "microsoftInternal__NAV-192565__cf-2", "base_instance_id": "microsoftInternal__NAV-192565", "variant_description": "Non-deductible VAT is cleared only for Item lines", "failure_layer": null, "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-192565__cf-2", "FAIL_TO_PASS": [{"codeunitID": 134282, "functionName": ["ChangingDirectUnitCostToZeroChangesNonDeductibleVAT"]}], "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@@ -179,6 +179,36 @@ codeunit 134282 \"Non-Deductible UT\"\n Assert.ExpectedError(StrSubstNo(DifferentNonDedVATRatesSameVATIdentifierErr, VATPostingSetup.\"VAT Bus. Posting Group\", VATPostingSetup.\"VAT Prod. Posting Group\"));\n end;\n \n+ [Test]\n+ procedure ChangingDirectUnitCostToZeroChangesNonDeductibleVAT()\n+ var\n+ VATPostingSetup: Record \"VAT Posting Setup\";\n+ PurchaseHeader: Record \"Purchase Header\";\n+ PurchaseLine: Record \"Purchase Line\";\n+ begin\n+ // [SCENARIO 546032] Changeing the direct unit cost to zero also changes the Non-Deductible VAT of the purchase document for item lines\n+\n+ Initialize();\n+ // [GIVEN] VAT Posting Setup with \"VAT Identifier\" = \"X\", \"Allow Non-Deductible VAT\" is enabled and \"Non-Deductible VAT %\" is specified\n+ LibraryNonDeductibleVAT.CreateNonDeductibleNormalVATPostingSetup(VATPostingSetup);\n+ // [GIVEN] Purchase invoice with Non-Deductible VAT posting setup and a single line with direct unit cost\n+ LibraryPurchase.CreatePurchHeader(\n+ PurchaseHeader, PurchaseHeader.\"Document Type\"::Invoice,\n+ LibraryPurchase.CreateVendorWithVATBusPostingGroup(VATPostingSetup.\"VAT Bus. Posting Group\"));\n+ LibraryPurchase.CreatePurchaseLine(\n+ PurchaseLine, PurchaseHeader, PurchaseLine.Type::Item,\n+ LibraryInventory.CreateItemWithVATProdPostingGroup(VATPostingSetup.\"VAT Prod. Posting Group\"), LibraryRandom.RandInt(100));\n+ PurchaseLine.Validate(\"Direct Unit Cost\", LibraryRandom.RandDec(100, 2));\n+\n+ // [WHEN] Change \"Direct Unit Cost\" to 0 in the purchase line\n+ PurchaseLine.Validate(\"Direct Unit Cost\", 0);\n+\n+ PurchaseLine.TestField(Type, PurchaseLine.Type::Item);\n+ // [THEN] \"Non-Deductible VAT Base\" and \"Non-Deductible VAT Amount\" are 0 in the purchase line\n+ PurchaseLine.TestField(\"Non-Deductible VAT Base\", 0);\n+ PurchaseLine.TestField(\"Non-Deductible VAT Amount\", 0);\n+ end;\n+\n local procedure Initialize()\n begin\n LibraryTestInitialize.OnTestInitialize(Codeunit::\"Non-Deductible UT\");\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Purchases/Document/PurchaseLine.Table.al b/App/Layers/W1/BaseApp/Purchases/Document/PurchaseLine.Table.al\n--- a/App/Layers/W1/BaseApp/Purchases/Document/PurchaseLine.Table.al\n+++ b/App/Layers/W1/BaseApp/Purchases/Document/PurchaseLine.Table.al\n@@ -5365,6 +5365,8 @@ table 39 \"Purchase Line\"\n Amount := 0;\n \"VAT Base Amount\" := 0;\n \"Amount Including VAT\" := 0;\n+ if Type = Type::Item then\n+ NonDeductibleVAT.ClearNonDeductibleVAT(Rec);\n OnUpdateVATAmountsOnBeforePurchLineModify(Rec, PurchLine2);\n if (Quantity = 0) and (xRec.Quantity <> 0) and (xRec.Amount <> 0) then begin\n if \"Line No.\" <> 0 then\n"} +{"instance_id": "microsoftInternal__NAV-192565__cf-3", "base_instance_id": "microsoftInternal__NAV-192565", "variant_description": "Non-deductible VAT is cleared only when Allow Non-Deductible VAT is enabled", "failure_layer": null, "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-192565__cf-3", "FAIL_TO_PASS": [{"codeunitID": 134282, "functionName": ["ChangingDirectUnitCostToZeroChangesNonDeductibleVAT"]}], "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\nindex 355bce7..73df18a 100644\n--- a/App/Layers/W1/Tests/VAT/NonDeductibleUT.Codeunit.al\n+++ b/App/Layers/W1/Tests/VAT/NonDeductibleUT.Codeunit.al\n@@ -179,6 +179,35 @@ codeunit 134282 \"Non-Deductible UT\"\n Assert.ExpectedError(StrSubstNo(DifferentNonDedVATRatesSameVATIdentifierErr, VATPostingSetup.\"VAT Bus. Posting Group\", VATPostingSetup.\"VAT Prod. Posting Group\"));\n end;\n \n+ [Test]\n+ procedure ChangingDirectUnitCostToZeroChangesNonDeductibleVAT()\n+ var\n+ VATPostingSetup: Record \"VAT Posting Setup\";\n+ PurchaseHeader: Record \"Purchase Header\";\n+ PurchaseLine: Record \"Purchase Line\";\n+ begin\n+ // [SCENARIO 546032] Changeing the direct unit cost to zero also changes the Non-Deductible VAT of the purchase document when Non-Deductible VAT is enabled\n+\n+ Initialize();\n+ // [GIVEN] VAT Posting Setup with \"VAT Identifier\" = \"X\", \"Allow Non-Deductible VAT\" is enabled and \"Non-Deductible VAT %\" is specified\n+ LibraryNonDeductibleVAT.CreateNonDeductibleNormalVATPostingSetup(VATPostingSetup);\n+ VATPostingSetup.Validate(\"Allow Non-Deductible VAT\", VATPostingSetup.\"Allow Non-Deductible VAT\"::Allow);\n+ // [GIVEN] Purchase invoice with Non-Deductible VAT posting setup and a single line with direct unit cost\n+ LibraryPurchase.CreatePurchHeader(\n+ PurchaseHeader, PurchaseHeader.\"Document Type\"::Invoice,\n+ LibraryPurchase.CreateVendorWithVATBusPostingGroup(VATPostingSetup.\"VAT Bus. Posting Group\"));\n+ LibraryPurchase.CreatePurchaseLine(\n+ PurchaseLine, PurchaseHeader, PurchaseLine.Type::Item,\n+ LibraryInventory.CreateItemWithVATProdPostingGroup(VATPostingSetup.\"VAT Prod. Posting Group\"), LibraryRandom.RandInt(100));\n+ PurchaseLine.Validate(\"Direct Unit Cost\", LibraryRandom.RandDec(100, 2));\n+\n+ // [WHEN] Change \"Direct Unit Cost\" to 0 in the purchase line\n+ PurchaseLine.Validate(\"Direct Unit Cost\", 0);\n+ // [THEN] \"Non-Deductible VAT Base\" and \"Non-Deductible VAT Amount\" are 0 in the purchase line\n+ PurchaseLine.TestField(\"Non-Deductible VAT Base\", 0);\n+ PurchaseLine.TestField(\"Non-Deductible VAT Amount\", 0);\n+ end;\n+\n local procedure Initialize()\n begin\n LibraryTestInitialize.OnTestInitialize(Codeunit::\"Non-Deductible UT\");\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Purchases/Document/PurchaseLine.Table.al b/App/Layers/W1/BaseApp/Purchases/Document/PurchaseLine.Table.al\nindex fb45dbc..ab17b93 100644\n--- a/App/Layers/W1/BaseApp/Purchases/Document/PurchaseLine.Table.al\n+++ b/App/Layers/W1/BaseApp/Purchases/Document/PurchaseLine.Table.al\n@@ -5365,6 +5365,9 @@ table 39 \"Purchase Line\"\n Amount := 0;\n \"VAT Base Amount\" := 0;\n \"Amount Including VAT\" := 0;\n+ VATPostingSetup.Get(\"VAT Bus. Posting Group\", \"VAT Prod. Posting Group\");\n+ if VATPostingSetup.\"Allow Non-Deductible VAT\" = VATPostingSetup.\"Allow Non-Deductible VAT\"::Allow then\n+ NonDeductibleVAT.ClearNonDeductibleVAT(Rec);\n OnUpdateVATAmountsOnBeforePurchLineModify(Rec, PurchLine2);\n if (Quantity = 0) and (xRec.Quantity <> 0) and (xRec.Amount <> 0) then begin\n if \"Line No.\" <> 0 then\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", "failure_layer": "L2-execution-validation", "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\nindex 304e94e908f6..d917601e5a98 100644\n--- a/App/Apps/W1/EnforcedDigitalVouchers/test/src/DigitalVouchersTests.Codeunit.al\n+++ b/App/Apps/W1/EnforcedDigitalVouchers/test/src/DigitalVouchersTests.Codeunit.al\n@@ -912,6 +912,59 @@ codeunit 139515 \"Digital Vouchers Tests\"\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+\n local procedure Initialize()\n var\n CompanyInformation: Record \"Company Information\";\n@@ -1076,6 +1129,19 @@ codeunit 139515 \"Digital Vouchers Tests\"\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\nindex 72dc980..b70540a 100644\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 @@ codeunit 5579 \"Digital Voucher Impl.\"\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@@ -345,6 +347,27 @@ codeunit 5579 \"Digital Voucher Impl.\"\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 var\n TempAttachReportSelections: Record \"Report Selections\" temporary;\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.", "failure_layer": "L2-execution-validation", "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\nindex 304e94e908f6..d917601e5a98 100644\n--- a/App/Apps/W1/EnforcedDigitalVouchers/test/src/DigitalVouchersTests.Codeunit.al\n+++ b/App/Apps/W1/EnforcedDigitalVouchers/test/src/DigitalVouchersTests.Codeunit.al\n@@ -912,6 +912,59 @@ codeunit 139515 \"Digital Vouchers Tests\"\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 \"X\" has incoming document attached\n+ GenJournalLine[1].\"Incoming Document Entry No.\" := MockIncomingDocument();\n+ GenJournalLine[1].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+\n local procedure Initialize()\n var\n CompanyInformation: Record \"Company Information\";\n@@ -1076,6 +1129,19 @@ codeunit 139515 \"Digital Vouchers Tests\"\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\nindex 72dc980..6a3cfee 100644\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 @@ codeunit 5579 \"Digital Voucher Impl.\"\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@@ -345,6 +347,27 @@ codeunit 5579 \"Digital Voucher Impl.\"\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 var\n TempAttachReportSelections: Record \"Report Selections\" temporary;\n", "cf_variant_description": "Only adjacent journal lines with lower line numbers are checked for attached incoming documents"} +{"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", "failure_layer": null, "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\nindex 1a7bf31..c86ca04 100644\n--- a/App/Apps/W1/ExcelReports/test/src/TrialBalanceExcelReports.Codeunit.al\n+++ b/App/Apps/W1/ExcelReports/test/src/TrialBalanceExcelReports.Codeunit.al\n@@ -298,6 +298,56 @@ codeunit 139544 \"Trial Balance Excel Reports\"\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 var\n BusinessUnit: Record \"Business Unit\";\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\nindex 00c238a..e20bc91 100644\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 @@ table 4402 \"EXR Trial Balance Buffer\"\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 @@ table 4402 \"EXR Trial Balance Buffer\"\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 @@ table 4402 \"EXR Trial Balance Buffer\"\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 @@ table 4402 \"EXR Trial Balance Buffer\"\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 @@ table 4402 \"EXR Trial Balance Buffer\"\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 @@ table 4402 \"EXR Trial Balance Buffer\"\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 @@ table 4402 \"EXR Trial Balance Buffer\"\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 @@ table 4402 \"EXR Trial Balance Buffer\"\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\nindex 7cf0915..2e171cf 100644\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 @@ codeunit 4410 \"Trial Balance\"\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", "failure_layer": null, "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\nindex 1a7bf31..55b8613 100644\n--- a/App/Apps/W1/ExcelReports/test/src/TrialBalanceExcelReports.Codeunit.al\n+++ b/App/Apps/W1/ExcelReports/test/src/TrialBalanceExcelReports.Codeunit.al\n@@ -298,6 +298,56 @@ codeunit 139544 \"Trial Balance Excel Reports\"\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 var\n BusinessUnit: Record \"Business Unit\";\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\nindex 00c238a..76245ca 100644\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 @@ table 4402 \"EXR Trial Balance Buffer\"\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 @@ table 4402 \"EXR Trial Balance Buffer\"\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\nindex 7cf0915..2e171cf 100644\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 @@ codeunit 4410 \"Trial Balance\"\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": "Change > to >= comparison in OnValidate triggers without explicit zero-reset of opposite side, plus Clear buffer", "failure_layer": null, "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\nindex 1a7bf31..e487b83 100644\n--- a/App/Apps/W1/ExcelReports/test/src/TrialBalanceExcelReports.Codeunit.al\n+++ b/App/Apps/W1/ExcelReports/test/src/TrialBalanceExcelReports.Codeunit.al\n@@ -298,6 +298,36 @@ codeunit 139544 \"Trial Balance Excel Reports\"\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+ begin\n+ // [SCENARIO 547558] Trial Balance Buffer: zero values after positive should reset debit with >= comparison.\n+ EXRTrialBalanceBuffer.DeleteAll();\n+ // [GIVEN] Record A with positive Net Change populates Debit side\n+ EXRTrialBalanceBuffer.\"G/L Account No.\" := 'A';\n+ EXRTrialBalanceBuffer.Validate(\"Net Change\", 500);\n+ EXRTrialBalanceBuffer.Validate(Balance, 500);\n+ EXRTrialBalanceBuffer.Validate(\"Net Change (ACY)\", 500);\n+ EXRTrialBalanceBuffer.Validate(\"Balance (ACY)\", 500);\n+ EXRTrialBalanceBuffer.Insert();\n+ // [WHEN] Record B is created with zero Net Change WITHOUT clearing the buffer variable\n+ EXRTrialBalanceBuffer.\"G/L Account No.\" := 'B';\n+ EXRTrialBalanceBuffer.Validate(\"Net Change\", 0);\n+ EXRTrialBalanceBuffer.Validate(Balance, 0);\n+ EXRTrialBalanceBuffer.Validate(\"Net Change (ACY)\", 0);\n+ EXRTrialBalanceBuffer.Validate(\"Balance (ACY)\", 0);\n+ EXRTrialBalanceBuffer.Insert();\n+ // [THEN] Record B should have zero Debit (no leftover from Record A)\n+ EXRTrialBalanceBuffer.FindSet();\n+ EXRTrialBalanceBuffer.Next();\n+ Assert.AreEqual(0, EXRTrialBalanceBuffer.\"Net Change (Debit)\", 'Net Change (Debit) should be zero for zero Net Change.');\n+ Assert.AreEqual(0, EXRTrialBalanceBuffer.\"Balance (Debit)\", 'Balance (Debit) should be zero for zero Balance.');\n+ Assert.AreEqual(0, EXRTrialBalanceBuffer.\"Net Change (Debit) (ACY)\", 'Net Change (Debit) (ACY) should be zero.');\n+ Assert.AreEqual(0, EXRTrialBalanceBuffer.\"Balance (Debit) (ACY)\", 'Balance (Debit) (ACY) should be zero.');\n+ end;\n+\n local procedure CreateSampleBusinessUnits(HowMany: Integer)\n var\n BusinessUnit: Record \"Business Unit\";\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\nindex 00c238a..3f1a9b2 100644\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,7 +44,7 @@ table 4402 \"EXR Trial Balance Buffer\"\n \n trigger OnValidate()\n begin\n- if (\"Net Change\" > 0) then\n+ if (\"Net Change\" >= 0) then\n Validate(\"Net Change (Debit)\", \"Net Change\")\n else\n Validate(\"Net Change (Credit)\", -\"Net Change\");\n@@ -64,7 +64,7 @@ table 4402 \"EXR Trial Balance Buffer\"\n \n trigger OnValidate()\n begin\n- if (\"Balance\" > 0) then\n+ if (\"Balance\" >= 0) then\n Validate(\"Balance (Debit)\", \"Balance\")\n else\n Validate(\"Balance (Credit)\", -\"Balance\");\n@@ -100,7 +100,7 @@ table 4402 \"EXR Trial Balance Buffer\"\n \n trigger OnValidate()\n begin\n- if (\"Last Period Net\" > 0) then\n+ if (\"Last Period Net\" >= 0) then\n Validate(\"Last Period Net (Debit)\", \"Last Period Net\")\n else\n Validate(\"Last Period Net (Credit)\", -\"Last Period Net\");\n@@ -120,7 +120,7 @@ table 4402 \"EXR Trial Balance Buffer\"\n \n trigger OnValidate()\n begin\n- if (\"Last Period Bal.\" > 0) then\n+ if (\"Last Period Bal.\" >= 0) then\n Validate(\"Last Period Bal. (Debit)\", \"Last Period Bal.\")\n else\n Validate(\"Last Period Bal. (Credit)\", -\"Last Period Bal.\");\n@@ -156,7 +156,7 @@ table 4402 \"EXR Trial Balance Buffer\"\n \n trigger OnValidate()\n begin\n- if (\"Net Change\" > 0) then\n+ if (\"Net Change\" >= 0) then\n Validate(\"Net Change (Debit) (ACY)\", \"Net Change (ACY)\")\n else\n Validate(\"Net Change (Credit) (ACY)\", -\"Net Change (ACY)\");\n@@ -176,7 +176,7 @@ table 4402 \"EXR Trial Balance Buffer\"\n \n trigger OnValidate()\n begin\n- if (\"Balance\" > 0) then\n+ if (\"Balance\" >= 0) then\n Validate(\"Balance (Debit) (ACY)\", \"Balance (ACY)\")\n else\n Validate(\"Balance (Credit) (ACY)\", -\"Balance (ACY)\");\n@@ -196,7 +196,7 @@ table 4402 \"EXR Trial Balance Buffer\"\n \n trigger OnValidate()\n begin\n- if (\"Last Period Net\" > 0) then\n+ if (\"Last Period Net\" >= 0) then\n Validate(\"Last Period Net (Debit) (ACY)\", \"Last Period Net (ACY)\")\n else\n Validate(\"Last Period Net (Credit) (ACY)\", -\"Last Period Net (ACY)\");\n@@ -216,7 +216,7 @@ table 4402 \"EXR Trial Balance Buffer\"\n \n trigger OnValidate()\n begin\n- if (\"Last Period Bal.\" > 0) then\n+ if (\"Last Period Bal.\" >= 0) then\n Validate(\"Last Period Bal. (Debit) (ACY)\", \"Last Period Bal. (ACY)\")\n else\n Validate(\"Last Period Bal. (Cred.) (ACY)\", -\"Last Period Bal. (ACY)\");\ndiff --git a/App/Apps/W1/ExcelReports/app/src/Financials/TrialBalance.Codeunit.al b/App/Apps/W1/ExcelReports/app/src/Financials/TrialBalance.Codeunit.al\nindex 7cf0915..2e171cf 100644\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 @@ codeunit 4410 \"Trial Balance\"\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-201169__cf-1", "base_instance_id": "microsoftInternal__NAV-201169", "variant_description": "Whitespace-only description should be treated as empty and logged to skipped records", "failure_layer": "L2-execution-validation", "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\nindex 60adc2f..1dbc2ae 100644\n--- a/App/Apps/W1/Shopify/test/Logs/ShpfySkippedRecordLogTest.Codeunit.al\n+++ b/App/Apps/W1/Shopify/test/Logs/ShpfySkippedRecordLogTest.Codeunit.al\n@@ -91,6 +91,37 @@ codeunit 139581 \"Shpfy Skipped Record Log Test\"\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 procedure UnitTestLogItemVariantBlocked()\n var\n@@ -841,13 +872,19 @@ codeunit 139581 \"Shpfy Skipped Record Log Test\"\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\nindex 38d7785..965c1f8 100644\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 @@ codeunit 30174 \"Shpfy Create Product\"\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\nindex b99f15d..7e9fce0 100644\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 @@ report 30106 \"Shpfy Add Item to Shopify\"\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 DelChr(Item.Description, '<>', ' ') = '' then begin\n+ SkippedRecord.LogSkippedRecord(Item.RecordId, ItemDescriptionIsEmptyLbl, ShopifyShop);\n+ exit;\n+ end;\n \n- ProductFilter += Format(ShopifyCreateProduct.GetProductId()) + '|';\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 @@ report 30106 \"Shpfy Add Item to Shopify\"\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": "Exit early for items with empty description instead of continuing export", "failure_layer": "L4-workflow-business-logic", "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\nindex 60adc2f..063e50b 100644\n--- a/App/Apps/W1/Shopify/test/Logs/ShpfySkippedRecordLogTest.Codeunit.al\n+++ b/App/Apps/W1/Shopify/test/Logs/ShpfySkippedRecordLogTest.Codeunit.al\n@@ -91,6 +91,35 @@ codeunit 139581 \"Shpfy Skipped Record Log Test\"\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 procedure UnitTestLogItemVariantBlocked()\n var\n@@ -841,13 +870,19 @@ codeunit 139581 \"Shpfy Skipped Record Log Test\"\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\nindex 38d7785..965c1f8 100644\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 @@ codeunit 30174 \"Shpfy Create Product\"\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\nindex b99f15d..7ede756 100644\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 @@ report 30106 \"Shpfy Add Item to Shopify\"\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 Item.Description = '' then begin\n+ SkippedRecord.LogSkippedRecord(Item.RecordId, ItemDescriptionIsEmptyLbl, ShopifyShop);\n+ exit;\n+ end;\n \n- ProductFilter += Format(ShopifyCreateProduct.GetProductId()) + '|';\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 @@ report 30106 \"Shpfy Add Item to Shopify\"\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", "failure_layer": "L3-event-driven-paradigm", "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\nindex 60adc2f..063e50b 100644\n--- a/App/Apps/W1/Shopify/test/Logs/ShpfySkippedRecordLogTest.Codeunit.al\n+++ b/App/Apps/W1/Shopify/test/Logs/ShpfySkippedRecordLogTest.Codeunit.al\n@@ -91,6 +91,35 @@ codeunit 139581 \"Shpfy Skipped Record Log Test\"\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 procedure UnitTestLogItemVariantBlocked()\n var\n@@ -841,13 +870,19 @@ codeunit 139581 \"Shpfy Skipped Record Log Test\"\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\nindex 38d7785..3f4642a 100644\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@@ -28,2 +28,3 @@ codeunit 30174 \"Shpfy Create Product\"\n ItemVariantIsBlockedLbl: Label 'Item variant is blocked or sales blocked.';\n+ ItemDescriptionIsEmptyLbl: Label 'Item description is empty.';\n \n@@ -31,4 +32,10 @@ codeunit 30174 \"Shpfy Create Product\"\n var\n ShopifyProduct: Record \"Shpfy Product\";\n+ SkippedRecord: Codeunit \"Shpfy Skipped Record\";\n begin\n+ if Rec.Description = '' then begin\n+ SkippedRecord.LogSkippedRecord(Rec.RecordId, ItemDescriptionIsEmptyLbl, Shop);\n+ exit;\n+ end;\n+\n if Getlocations then begin\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\nindex b99f15d..6369a4f 100644\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 @@ report 30106 \"Shpfy Add Item to Shopify\"\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+ if Item.Blocked or Item.\"Sales Blocked\" then begin\n+ SkippedRecord.LogSkippedRecord(Item.RecordId, ItemIsBlockedLbl, ShopifyShop);\n+ exit;\n+ end;\n \n- ProductFilter += Format(ShopifyCreateProduct.GetProductId()) + '|';\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 +191,7 @@ report 30106 \"Shpfy Add Item to Shopify\"\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-203923__cf-1", "base_instance_id": "microsoftInternal__NAV-203923", "variant_description": "Full VAT excluded from non-deductible VAT eligible calculation types", "failure_layer": null, "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-203923__cf-1", "FAIL_TO_PASS": [{"codeunitID": 134288, "functionName": ["NonDeductibleVATShouldShowAsNonDeductibleOnDoingFullVAT"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/VAT/NonDeductibleVATJournal.Codeunit.al b/App/Layers/W1/Tests/VAT/NonDeductibleVATJournal.Codeunit.al\nindex 32fd947..b00ff30 100644\n--- a/App/Layers/W1/Tests/VAT/NonDeductibleVATJournal.Codeunit.al\n+++ b/App/Layers/W1/Tests/VAT/NonDeductibleVATJournal.Codeunit.al\n@@ -20,6 +20,7 @@ codeunit 134288 \"Non-Deductible VAT Journal\"\n IsInitialized: Boolean;\n ReverseEntriesQst: Label 'Do you want to reverse the entries';\n EntriesReversedLbl: Label 'The entries were successfully reversed';\n+ NonDeductiableVATAmountMustBeEqualErr: Label 'Non-Deductable VAT Amount must be %1 in VAT Entries', Comment = '%1 = Expected Non-Deductible VAT Amount';\n \n [Test]\n [Scope('OnPrem')]\n@@ -177,7 +178,7 @@ codeunit 134288 \"Non-Deductible VAT Journal\"\n GLEntry.SetRange(\"VAT Prod. Posting Group\", VATPostingSetup.\"VAT Prod. Posting Group\");\n GLEntry.FindFirst();\n // [THEN] \"Non-Deductible VAT Amount\" is zero in all non-VAT G/L entries\n-\t\t// Bug 523795: Bal. Non-Deductible VAT amount is not correct \n+ // Bug 523795: Bal. Non-Deductible VAT amount is not correct\n GLEntry.TestField(\"Non-Deductible VAT Amount\", Round(GenJournalLine.\"Bal. VAT Amount\" * VATPostingSetup.\"Non-Deductible VAT %\" / 100));\n GLEntry.SetRange(\"VAT Bus. Posting Group\", '');\n GLEntry.SetRange(\"VAT Prod. Posting Group\", '');\n@@ -215,6 +216,44 @@ codeunit 134288 \"Non-Deductible VAT Journal\"\n GenJournalLine.TestField(\"Bal. Non-Ded. VAT %\", VATPostingSetup.\"Non-Deductible VAT %\");\n end;\n \n+ [Test]\n+ procedure NonDeductibleVATShouldShowAsNonDeductibleOnDoingFullVAT()\n+ var\n+ GLAccount: Record \"G/L Account\";\n+ GenJournalLine: Record \"Gen. Journal Line\";\n+ VATEntry: Record \"VAT Entry\";\n+ VATPostingSetup: Record \"VAT Posting Setup\";\n+ NonDeductableVATAmount: Decimal;\n+ begin\n+ // [SCENARIO 537128] On posting Non-Deductible full VAT amount should be display in Non-Deductable VAT field of VAT Entry.\n+ Initialize();\n+\n+ // [GIVEN] Create Non-Deductible VAT Posting Setup with \"Non-Deductible VAT %\" = 100.\n+ LibraryNonDeductibleVAT.CreatVATPostingSetupAllowedForNonDeductibleVAT(VATPostingSetup, VATPostingSetup.\"VAT Calculation Type\"::\"Full VAT\", 100);\n+ VATPostingSetup.Validate(\"Purchase VAT Account\", LibraryERM.CreateGLAccountWithVATPostingSetup(VATPostingSetup, GLAccount.\"Gen. Posting Type\"::Purchase));\n+ VATPostingSetup.Validate(\"Non-Deductible VAT %\", 100);\n+ VATPostingSetup.Modify(true);\n+\n+ // [GIVEN] General Journal Line with Non-Deductible VAT Posting Setup and \"Account No\" = VATPostingSetup.\"Purchase VAT Account\".\n+ LibraryJournals.CreateGenJournalLineWithBatch(\n+ GenJournalLine, GenJournalLine.\"Document Type\"::\" \", GenJournalLine.\"Account Type\"::\"G/L Account\",\n+ VATPostingSetup.\"Purchase VAT Account\", LibraryRandom.RandDec(100, 2));\n+ GenJournalLine.Validate(\"Bal. Account No.\", LibraryERM.CreateGLAccountNo());\n+\n+ // [GIVEN] Validate VAT Bus. & Prod. Posting Group fields.\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+ NonDeductableVATAmount := GenJournalLine.Amount;\n+\n+ // [WHEN] Post the General Journal.\n+ LibraryERM.PostGeneralJnlLine(GenJournalLine);\n+\n+ // [THEN] Verify that \"Non-Deductible VAT Amount\" field must have the value in VAT Entry.\n+ FindVATEntryByVATPostingSetup(VATEntry, VATPostingSetup);\n+ Assert.AreEqual(NonDeductableVATAmount, VATEntry.\"Non-Deductible VAT Amount\", StrSubstNo(NonDeductiableVATAmountMustBeEqualErr, NonDeductableVATAmount));\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n@@ -244,6 +283,13 @@ codeunit 134288 \"Non-Deductible VAT Journal\"\n VATEntry.Testfield(\"Non-Deductible VAT Amount\", NDAmount);\n end;\n \n+ local procedure FindVATEntryByVATPostingSetup(var VATENtry: Record \"VAT Entry\"; VATPostingSetup: Record \"VAT Posting Setup\")\n+ begin\n+ VATEntry.SetRange(\"VAT Bus. Posting Group\", VATPostingSetup.\"VAT Bus. Posting Group\");\n+ VATEntry.SetRange(\"VAT Prod. Posting Group\", VATPostingSetup.\"VAT Prod. Posting Group\");\n+ VATEntry.FindLast();\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/Finance/VAT/Calculation/NonDedVATImpl.Codeunit.al b/App/Layers/W1/BaseApp/Finance/VAT/Calculation/NonDedVATImpl.Codeunit.al\nindex 6bb15d7..3a9181b 100644\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@@ -94,7 +94,8 @@ codeunit 6201 \"Non-Ded. VAT Impl.\"\n if IsHandled then\n exit(NonDeductibleVATPct);\n if not (VATPostingSetup.\"VAT Calculation Type\" in [VATPostingSetup.\"VAT Calculation Type\"::\"Normal VAT\", VATPostingSetup.\"VAT Calculation Type\"::\"Reverse Charge VAT\"]) then\n- exit(0);\n+ if VATPostingSetup.\"VAT Calculation Type\" <> VATPostingSetup.\"VAT Calculation Type\"::\"Full VAT\" then\n+ exit(0);\n if (VATPostingSetup.\"Allow Non-Deductible VAT\" = VATPostingSetup.\"Allow Non-Deductible VAT\"::\"Do not allow\") or (GeneralPostingType <> GeneralPostingType::Purchase) then\n exit(0);\n exit(VATPostingSetup.\"Non-Deductible VAT %\");\n@@ -787,7 +788,8 @@ codeunit 6201 \"Non-Ded. VAT Impl.\"\n if IsHandled then\n exit;\n if not (GenJournalLine.\"VAT Calculation Type\" in [GenJournalLine.\"VAT Calculation Type\"::\"Normal VAT\", GenJournalLine.\"VAT Calculation Type\"::\"Reverse Charge VAT\"]) then\n- exit;\n+ if GenJournalLine.\"VAT Calculation Type\" <> GenJournalLine.\"VAT Calculation Type\"::\"Full VAT\" then\n+ exit;\n if not VATPostingSetup.Get(GenJournalLine.\"VAT Bus. Posting Group\", GenJournalLine.\"VAT Prod. Posting Group\") then\n exit;\n GenJournalLine.Validate(\"Non-Deductible VAT Base\",\n@@ -1211,7 +1213,8 @@ codeunit 6201 \"Non-Ded. VAT Impl.\"\n if IsHandled then\n exit(NonDeductibleVATPct);\n if not (GenJournalLine.\"VAT Calculation Type\" in [GenJournalLine.\"VAT Calculation Type\"::\"Normal VAT\", GenJournalLine.\"VAT Calculation Type\"::\"Reverse Charge VAT\"]) then\n- exit(0);\n+ if GenJournalLine.\"VAT Calculation Type\" <> GenJournalLine.\"VAT Calculation Type\"::\"Full VAT\" then\n+ exit(0);\n if not VATPostingSetup.Get(GenJournalLine.\"VAT Bus. Posting Group\", GenJournalLine.\"VAT Prod. Posting Group\") then\n exit(0);\n exit(GetNonDeductibleVATPct(VATPostingSetup, GenJournalLine.\"Gen. Posting Type\"));\n"} +{"instance_id": "microsoftInternal__NAV-203923__cf-2", "base_instance_id": "microsoftInternal__NAV-203923", "variant_description": "Full VAT treated as non-deductible but excluded when Non-Deductible VAT % is 100 or more", "failure_layer": null, "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-203923__cf-2", "FAIL_TO_PASS": [{"codeunitID": 134288, "functionName": ["NonDeductibleVATShouldShowAsNonDeductibleOnDoingFullVAT"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/VAT/NonDeductibleVATJournal.Codeunit.al b/App/Layers/W1/Tests/VAT/NonDeductibleVATJournal.Codeunit.al\nindex 32fd947..23c6392 100644\n--- a/App/Layers/W1/Tests/VAT/NonDeductibleVATJournal.Codeunit.al\n+++ b/App/Layers/W1/Tests/VAT/NonDeductibleVATJournal.Codeunit.al\n@@ -20,6 +20,7 @@ codeunit 134288 \"Non-Deductible VAT Journal\"\n IsInitialized: Boolean;\n ReverseEntriesQst: Label 'Do you want to reverse the entries';\n EntriesReversedLbl: Label 'The entries were successfully reversed';\n+ NonDeductiableVATAmountMustBeEqualErr: Label 'Non-Deductable VAT Amount must be %1 in VAT Entries', Comment = '%1 = Expected Non-Deductible VAT Amount';\n \n [Test]\n [Scope('OnPrem')]\n@@ -177,7 +178,7 @@ codeunit 134288 \"Non-Deductible VAT Journal\"\n GLEntry.SetRange(\"VAT Prod. Posting Group\", VATPostingSetup.\"VAT Prod. Posting Group\");\n GLEntry.FindFirst();\n // [THEN] \"Non-Deductible VAT Amount\" is zero in all non-VAT G/L entries\n-\t\t// Bug 523795: Bal. Non-Deductible VAT amount is not correct \n+ // Bug 523795: Bal. Non-Deductible VAT amount is not correct\n GLEntry.TestField(\"Non-Deductible VAT Amount\", Round(GenJournalLine.\"Bal. VAT Amount\" * VATPostingSetup.\"Non-Deductible VAT %\" / 100));\n GLEntry.SetRange(\"VAT Bus. Posting Group\", '');\n GLEntry.SetRange(\"VAT Prod. Posting Group\", '');\n@@ -215,6 +216,44 @@ codeunit 134288 \"Non-Deductible VAT Journal\"\n GenJournalLine.TestField(\"Bal. Non-Ded. VAT %\", VATPostingSetup.\"Non-Deductible VAT %\");\n end;\n \n+ [Test]\n+ procedure NonDeductibleVATShouldShowAsNonDeductibleOnDoingFullVAT()\n+ var\n+ GLAccount: Record \"G/L Account\";\n+ GenJournalLine: Record \"Gen. Journal Line\";\n+ VATEntry: Record \"VAT Entry\";\n+ VATPostingSetup: Record \"VAT Posting Setup\";\n+ NonDeductableVATAmount: Decimal;\n+ begin\n+ // [SCENARIO 537128] On posting Non-Deductible full VAT amount should be display in Non-Deductable VAT field of VAT Entry.\n+ Initialize();\n+\n+ // [GIVEN] Create Non-Deductible VAT Posting Setup with \"Non-Deductible VAT %\" = 50.\n+ LibraryNonDeductibleVAT.CreatVATPostingSetupAllowedForNonDeductibleVAT(VATPostingSetup, VATPostingSetup.\"VAT Calculation Type\"::\"Full VAT\", 50);\n+ VATPostingSetup.Validate(\"Purchase VAT Account\", LibraryERM.CreateGLAccountWithVATPostingSetup(VATPostingSetup, GLAccount.\"Gen. Posting Type\"::Purchase));\n+ VATPostingSetup.Validate(\"Non-Deductible VAT %\", 50);\n+ VATPostingSetup.Modify(true);\n+\n+ // [GIVEN] General Journal Line with Non-Deductible VAT Posting Setup and \"Account No\" = VATPostingSetup.\"Purchase VAT Account\".\n+ LibraryJournals.CreateGenJournalLineWithBatch(\n+ GenJournalLine, GenJournalLine.\"Document Type\"::\" \", GenJournalLine.\"Account Type\"::\"G/L Account\",\n+ VATPostingSetup.\"Purchase VAT Account\", LibraryRandom.RandDec(100, 2));\n+ GenJournalLine.Validate(\"Bal. Account No.\", LibraryERM.CreateGLAccountNo());\n+\n+ // [GIVEN] Validate VAT Bus. & Prod. Posting Group fields.\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+ NonDeductableVATAmount := Round(GenJournalLine.Amount * VATPostingSetup.\"Non-Deductible VAT %\" / 100);\n+\n+ // [WHEN] Post the General Journal.\n+ LibraryERM.PostGeneralJnlLine(GenJournalLine);\n+\n+ // [THEN] Verify that \"Non-Deductible VAT Amount\" field must have the value in VAT Entry.\n+ FindVATEntryByVATPostingSetup(VATEntry, VATPostingSetup);\n+ Assert.AreEqual(NonDeductableVATAmount, VATEntry.\"Non-Deductible VAT Amount\", StrSubstNo(NonDeductiableVATAmountMustBeEqualErr, NonDeductableVATAmount));\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n@@ -244,6 +283,13 @@ codeunit 134288 \"Non-Deductible VAT Journal\"\n VATEntry.Testfield(\"Non-Deductible VAT Amount\", NDAmount);\n end;\n \n+ local procedure FindVATEntryByVATPostingSetup(var VATENtry: Record \"VAT Entry\"; VATPostingSetup: Record \"VAT Posting Setup\")\n+ begin\n+ VATEntry.SetRange(\"VAT Bus. Posting Group\", VATPostingSetup.\"VAT Bus. Posting Group\");\n+ VATEntry.SetRange(\"VAT Prod. Posting Group\", VATPostingSetup.\"VAT Prod. Posting Group\");\n+ VATEntry.FindLast();\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/Finance/VAT/Calculation/NonDedVATImpl.Codeunit.al b/App/Layers/W1/BaseApp/Finance/VAT/Calculation/NonDedVATImpl.Codeunit.al\nindex 6bb15d7..db8d72e 100644\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@@ -93,7 +93,9 @@ codeunit 6201 \"Non-Ded. VAT Impl.\"\n NonDeductibleVAT.OnBeforeGetNonDeductibleVATPct(NonDeductibleVATPct, VATPostingSetup, GeneralPostingType, IsHandled);\n if IsHandled then\n exit(NonDeductibleVATPct);\n- if not (VATPostingSetup.\"VAT Calculation Type\" in [VATPostingSetup.\"VAT Calculation Type\"::\"Normal VAT\", VATPostingSetup.\"VAT Calculation Type\"::\"Reverse Charge VAT\"]) then\n+ if not (VATPostingSetup.\"VAT Calculation Type\" in [VATPostingSetup.\"VAT Calculation Type\"::\"Normal VAT\", VATPostingSetup.\"VAT Calculation Type\"::\"Reverse Charge VAT\", VATPostingSetup.\"VAT Calculation Type\"::\"Full VAT\"]) then\n+ exit(0);\n+ if (VATPostingSetup.\"VAT Calculation Type\" = VATPostingSetup.\"VAT Calculation Type\"::\"Full VAT\") and (VATPostingSetup.\"Non-Deductible VAT %\" >= 100) then\n exit(0);\n if (VATPostingSetup.\"Allow Non-Deductible VAT\" = VATPostingSetup.\"Allow Non-Deductible VAT\"::\"Do not allow\") or (GeneralPostingType <> GeneralPostingType::Purchase) then\n exit(0);\n@@ -786,7 +788,7 @@ codeunit 6201 \"Non-Ded. VAT Impl.\"\n NonDeductibleVAT.OnBeforeCalcNonDedAmountsInGenJnlLine(GenJournalLine, Currency, IsHandled);\n if IsHandled then\n exit;\n- if not (GenJournalLine.\"VAT Calculation Type\" in [GenJournalLine.\"VAT Calculation Type\"::\"Normal VAT\", GenJournalLine.\"VAT Calculation Type\"::\"Reverse Charge VAT\"]) then\n+ if not (GenJournalLine.\"VAT Calculation Type\" in [GenJournalLine.\"VAT Calculation Type\"::\"Normal VAT\", GenJournalLine.\"VAT Calculation Type\"::\"Reverse Charge VAT\", GenJournalLine.\"VAT Calculation Type\"::\"Full VAT\"]) then\n exit;\n if not VATPostingSetup.Get(GenJournalLine.\"VAT Bus. Posting Group\", GenJournalLine.\"VAT Prod. Posting Group\") then\n exit;\n@@ -826,7 +828,7 @@ codeunit 6201 \"Non-Ded. VAT Impl.\"\n NonDeductibleVAT.OnBeforeCalcBalNonDedAmountsInGenJnlLine(GenJournalLine, Currency, IsHandled);\n if IsHandled then\n exit;\n- if not (GenJournalLine.\"Bal. VAT Calculation Type\" in [GenJournalLine.\"Bal. VAT Calculation Type\"::\"Normal VAT\", GenJournalLine.\"Bal. VAT Calculation Type\"::\"Reverse Charge VAT\"]) then\n+ if not (GenJournalLine.\"Bal. VAT Calculation Type\" in [GenJournalLine.\"Bal. VAT Calculation Type\"::\"Normal VAT\", GenJournalLine.\"Bal. VAT Calculation Type\"::\"Reverse Charge VAT\", GenJournalLine.\"VAT Calculation Type\"::\"Full VAT\"]) then\n exit;\n if not VATPostingSetup.Get(GenJournalLine.\"Bal. VAT Bus. Posting Group\", GenJournalLine.\"Bal. VAT Prod. Posting Group\") then\n exit;\n@@ -1210,7 +1212,7 @@ codeunit 6201 \"Non-Ded. VAT Impl.\"\n NonDeductibleVAT.OnBeforeGetNonDedVATPctForGenJnlLine(NonDeductibleVATPct, GenJournalLine, IsHandled);\n if IsHandled then\n exit(NonDeductibleVATPct);\n- if not (GenJournalLine.\"VAT Calculation Type\" in [GenJournalLine.\"VAT Calculation Type\"::\"Normal VAT\", GenJournalLine.\"VAT Calculation Type\"::\"Reverse Charge VAT\"]) then\n+ if not (GenJournalLine.\"VAT Calculation Type\" in [GenJournalLine.\"VAT Calculation Type\"::\"Normal VAT\", GenJournalLine.\"VAT Calculation Type\"::\"Reverse Charge VAT\", GenJournalLine.\"VAT Calculation Type\"::\"Full VAT\"]) then\n exit(0);\n if not VATPostingSetup.Get(GenJournalLine.\"VAT Bus. Posting Group\", GenJournalLine.\"VAT Prod. Posting Group\") then\n exit(0);\n@@ -1227,7 +1229,7 @@ codeunit 6201 \"Non-Ded. VAT Impl.\"\n NonDeductibleVAT.OnBeforeGetBalNonDedVATPctForGenJnlLine(NonDeductibleVATPct, GenJournalLine, IsHandled);\n if IsHandled then\n exit(NonDeductibleVATPct);\n- if not (GenJournalLine.\"Bal. VAT Calculation Type\" in [GenJournalLine.\"Bal. VAT Calculation Type\"::\"Normal VAT\", GenJournalLine.\"Bal. VAT Calculation Type\"::\"Reverse Charge VAT\"]) then\n+ if not (GenJournalLine.\"Bal. VAT Calculation Type\" in [GenJournalLine.\"Bal. VAT Calculation Type\"::\"Normal VAT\", GenJournalLine.\"Bal. VAT Calculation Type\"::\"Reverse Charge VAT\", GenJournalLine.\"VAT Calculation Type\"::\"Full VAT\"]) then\n exit(0);\n if not VATPostingSetup.Get(GenJournalLine.\"Bal. VAT Bus. Posting Group\", GenJournalLine.\"Bal. VAT Prod. Posting Group\") then\n exit(0);\n"} +{"instance_id": "microsoftInternal__NAV-203923__cf-3", "base_instance_id": "microsoftInternal__NAV-203923", "variant_description": "Full VAT amount calculated but not reflected in non-deductible VAT entry fields", "failure_layer": null, "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-203923__cf-3", "FAIL_TO_PASS": [{"codeunitID": 134288, "functionName": ["NonDeductibleVATShouldShowAsNonDeductibleOnDoingFullVAT"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/VAT/NonDeductibleVATJournal.Codeunit.al b/App/Layers/W1/Tests/VAT/NonDeductibleVATJournal.Codeunit.al\nindex 32fd947..b00ff30 100644\n--- a/App/Layers/W1/Tests/VAT/NonDeductibleVATJournal.Codeunit.al\n+++ b/App/Layers/W1/Tests/VAT/NonDeductibleVATJournal.Codeunit.al\n@@ -20,6 +20,7 @@ codeunit 134288 \"Non-Deductible VAT Journal\"\n IsInitialized: Boolean;\n ReverseEntriesQst: Label 'Do you want to reverse the entries';\n EntriesReversedLbl: Label 'The entries were successfully reversed';\n+ NonDeductiableVATAmountMustBeEqualErr: Label 'Non-Deductable VAT Amount must be %1 in VAT Entries', Comment = '%1 = Expected Non-Deductible VAT Amount';\n \n [Test]\n [Scope('OnPrem')]\n@@ -177,7 +178,7 @@ codeunit 134288 \"Non-Deductible VAT Journal\"\n GLEntry.SetRange(\"VAT Prod. Posting Group\", VATPostingSetup.\"VAT Prod. Posting Group\");\n GLEntry.FindFirst();\n // [THEN] \"Non-Deductible VAT Amount\" is zero in all non-VAT G/L entries\n-\t\t// Bug 523795: Bal. Non-Deductible VAT amount is not correct \n+ // Bug 523795: Bal. Non-Deductible VAT amount is not correct\n GLEntry.TestField(\"Non-Deductible VAT Amount\", Round(GenJournalLine.\"Bal. VAT Amount\" * VATPostingSetup.\"Non-Deductible VAT %\" / 100));\n GLEntry.SetRange(\"VAT Bus. Posting Group\", '');\n GLEntry.SetRange(\"VAT Prod. Posting Group\", '');\n@@ -215,6 +216,44 @@ codeunit 134288 \"Non-Deductible VAT Journal\"\n GenJournalLine.TestField(\"Bal. Non-Ded. VAT %\", VATPostingSetup.\"Non-Deductible VAT %\");\n end;\n \n+ [Test]\n+ procedure NonDeductibleVATShouldShowAsNonDeductibleOnDoingFullVAT()\n+ var\n+ GLAccount: Record \"G/L Account\";\n+ GenJournalLine: Record \"Gen. Journal Line\";\n+ VATEntry: Record \"VAT Entry\";\n+ VATPostingSetup: Record \"VAT Posting Setup\";\n+ NonDeductableVATAmount: Decimal;\n+ begin\n+ // [SCENARIO 537128] On posting Non-Deductible full VAT amount should be display in Non-Deductable VAT field of VAT Entry.\n+ Initialize();\n+\n+ // [GIVEN] Create Non-Deductible VAT Posting Setup with \"Non-Deductible VAT %\" = 100.\n+ LibraryNonDeductibleVAT.CreatVATPostingSetupAllowedForNonDeductibleVAT(VATPostingSetup, VATPostingSetup.\"VAT Calculation Type\"::\"Full VAT\", 100);\n+ VATPostingSetup.Validate(\"Purchase VAT Account\", LibraryERM.CreateGLAccountWithVATPostingSetup(VATPostingSetup, GLAccount.\"Gen. Posting Type\"::Purchase));\n+ VATPostingSetup.Validate(\"Non-Deductible VAT %\", 100);\n+ VATPostingSetup.Modify(true);\n+\n+ // [GIVEN] General Journal Line with Non-Deductible VAT Posting Setup and \"Account No\" = VATPostingSetup.\"Purchase VAT Account\".\n+ LibraryJournals.CreateGenJournalLineWithBatch(\n+ GenJournalLine, GenJournalLine.\"Document Type\"::\" \", GenJournalLine.\"Account Type\"::\"G/L Account\",\n+ VATPostingSetup.\"Purchase VAT Account\", LibraryRandom.RandDec(100, 2));\n+ GenJournalLine.Validate(\"Bal. Account No.\", LibraryERM.CreateGLAccountNo());\n+\n+ // [GIVEN] Validate VAT Bus. & Prod. Posting Group fields.\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+ NonDeductableVATAmount := GenJournalLine.Amount;\n+\n+ // [WHEN] Post the General Journal.\n+ LibraryERM.PostGeneralJnlLine(GenJournalLine);\n+\n+ // [THEN] Verify that \"Non-Deductible VAT Amount\" field must have the value in VAT Entry.\n+ FindVATEntryByVATPostingSetup(VATEntry, VATPostingSetup);\n+ Assert.AreEqual(NonDeductableVATAmount, VATEntry.\"Non-Deductible VAT Amount\", StrSubstNo(NonDeductiableVATAmountMustBeEqualErr, NonDeductableVATAmount));\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n@@ -244,6 +283,13 @@ codeunit 134288 \"Non-Deductible VAT Journal\"\n VATEntry.Testfield(\"Non-Deductible VAT Amount\", NDAmount);\n end;\n \n+ local procedure FindVATEntryByVATPostingSetup(var VATENtry: Record \"VAT Entry\"; VATPostingSetup: Record \"VAT Posting Setup\")\n+ begin\n+ VATEntry.SetRange(\"VAT Bus. Posting Group\", VATPostingSetup.\"VAT Bus. Posting Group\");\n+ VATEntry.SetRange(\"VAT Prod. Posting Group\", VATPostingSetup.\"VAT Prod. Posting Group\");\n+ VATEntry.FindLast();\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/Finance/VAT/Calculation/NonDedVATImpl.Codeunit.al b/App/Layers/W1/BaseApp/Finance/VAT/Calculation/NonDedVATImpl.Codeunit.al\nindex 6bb15d7..0f7c62b 100644\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@@ -93,7 +93,7 @@ codeunit 6201 \"Non-Ded. VAT Impl.\"\n NonDeductibleVAT.OnBeforeGetNonDeductibleVATPct(NonDeductibleVATPct, VATPostingSetup, GeneralPostingType, IsHandled);\n if IsHandled then\n exit(NonDeductibleVATPct);\n- if not (VATPostingSetup.\"VAT Calculation Type\" in [VATPostingSetup.\"VAT Calculation Type\"::\"Normal VAT\", VATPostingSetup.\"VAT Calculation Type\"::\"Reverse Charge VAT\"]) then\n+ if not (VATPostingSetup.\"VAT Calculation Type\" in [VATPostingSetup.\"VAT Calculation Type\"::\"Normal VAT\", VATPostingSetup.\"VAT Calculation Type\"::\"Reverse Charge VAT\", VATPostingSetup.\"VAT Calculation Type\"::\"Full VAT\"]) then\n exit(0);\n if (VATPostingSetup.\"Allow Non-Deductible VAT\" = VATPostingSetup.\"Allow Non-Deductible VAT\"::\"Do not allow\") or (GeneralPostingType <> GeneralPostingType::Purchase) then\n exit(0);\n@@ -786,7 +786,8 @@ codeunit 6201 \"Non-Ded. VAT Impl.\"\n NonDeductibleVAT.OnBeforeCalcNonDedAmountsInGenJnlLine(GenJournalLine, Currency, IsHandled);\n if IsHandled then\n exit;\n- if not (GenJournalLine.\"VAT Calculation Type\" in [GenJournalLine.\"VAT Calculation Type\"::\"Normal VAT\", GenJournalLine.\"VAT Calculation Type\"::\"Reverse Charge VAT\"]) then\n+ // Full VAT amounts calculated but not assigned to non-deductible fields\n+ if not (GenJournalLine.\"VAT Calculation Type\" in [GenJournalLine.\"VAT Calculation Type\"::\"Normal VAT\", GenJournalLine.\"VAT Calculation Type\"::\"Reverse Charge VAT\", GenJournalLine.\"VAT Calculation Type\"::\"Full VAT\"]) then\n exit;\n if not VATPostingSetup.Get(GenJournalLine.\"VAT Bus. Posting Group\", GenJournalLine.\"VAT Prod. Posting Group\") then\n exit;\n@@ -1210,7 +1211,7 @@ codeunit 6201 \"Non-Ded. VAT Impl.\"\n NonDeductibleVAT.OnBeforeGetNonDedVATPctForGenJnlLine(NonDeductibleVATPct, GenJournalLine, IsHandled);\n if IsHandled then\n exit(NonDeductibleVATPct);\n- if not (GenJournalLine.\"VAT Calculation Type\" in [GenJournalLine.\"VAT Calculation Type\"::\"Normal VAT\", GenJournalLine.\"VAT Calculation Type\"::\"Reverse Charge VAT\"]) then\n+ if not (GenJournalLine.\"VAT Calculation Type\" in [GenJournalLine.\"VAT Calculation Type\"::\"Normal VAT\", GenJournalLine.\"VAT Calculation Type\"::\"Reverse Charge VAT\", GenJournalLine.\"VAT Calculation Type\"::\"Full VAT\"]) then\n exit(0);\n if not VATPostingSetup.Get(GenJournalLine.\"VAT Bus. Posting Group\", GenJournalLine.\"VAT Prod. Posting Group\") then\n exit(0);\n"} +{"instance_id": "microsoftInternal__NAV-204450__cf-1", "base_instance_id": "microsoftInternal__NAV-204450", "variant_description": "Statistics VAT modification skipped when Non-Deductible VAT is 100 percent", "failure_layer": null, "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-204450__cf-1", "FAIL_TO_PASS": [{"codeunitID": 134287, "functionName": ["PurchaseInvoiceInCurrencyIsPostedWhenChangeVATAmountOnStatisticIfNDVATPctIs100"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/VAT/NonDeductibleVATStatistics.Codeunit.al b/App/Layers/W1/Tests/VAT/NonDeductibleVATStatistics.Codeunit.al\n--- a/App/Layers/W1/Tests/VAT/NonDeductibleVATStatistics.Codeunit.al\n+++ b/App/Layers/W1/Tests/VAT/NonDeductibleVATStatistics.Codeunit.al\n@@ -16,8 +16,11 @@ codeunit 134287 \"Non-Deductible VAT Statistics\"\n LibraryPurchase: Codeunit \"Library - Purchase\";\n LibraryInventory: Codeunit \"Library - Inventory\";\n LibraryRandom: Codeunit \"Library - Random\";\n+ LibraryUtility: Codeunit \"Library - Utility\";\n+ LibraryERM: Codeunit \"Library - ERM\";\n Assert: Codeunit Assert;\n isInitialized: Boolean;\n+ GLEntryConsistentErr: Label 'G/L Entry is inconsistent';\n \n [Test]\n [HandlerFunctions('PurchaseStatisticsChangeVATAmountModalPageHandler')]\n@@ -640,6 +643,60 @@ codeunit 134287 \"Non-Deductible VAT Statistics\"\n LibraryVariableStorage.AssertEmpty();\n end;\n \n+ [Test]\n+ [HandlerFunctions('PurchaseStatisticsChangeVATAmountModalPageHandler')]\n+ procedure PurchaseInvoiceInCurrencyIsPostedWhenChangeVATAmountOnStatisticIfNDVATPctIs100()\n+ var\n+ Currency: Record Currency;\n+ PurchaseHeader: Record \"Purchase Header\";\n+ PurchInvHeader: Record \"Purch. Inv. Header\";\n+ VATPostingSetup: Record \"VAT Posting Setup\";\n+ PurchaseInvoicePage: TestPage \"Purchase Invoice\";\n+ GenPostingType: Enum \"General Posting Type\";\n+ GLAccountNo: Code[20];\n+ ChangeVATAmount: Decimal;\n+ begin\n+ // [SCENARIO 560355] Purchase Invoice with currency code gets posted when Non-Deductible VAT is 100 Percent\n+ // And Non-Deductible VAT and the VAT Amount was previously modified in the Statistics.\n+ Initialize();\n+\n+ // [GIVEN] \"Allow VAT Difference\" is enabled in Purchases Setup.\n+ LibraryPurchase.SetAllowVATDifference(true);\n+\n+ // [GIVEN] Create Currency with Exchange Rate.\n+ CreateCurrencyWithExchangeRate(Currency);\n+\n+ // [GIVEN] Set \"Max. VAT Difference Allowed\" in Currency.\n+ SetMaxVATDifferenceAllowInCurrency(LibraryRandom.RandIntInRange(1000, 1000), Currency);\n+\n+ // [GIVEN] Generate VAT Amount to Change.\n+ ChangeVATAmount := LibraryRandom.RandIntInRange(150, 150);\n+\n+ // [GIVEN] Create Normal VAT Posting Setup with \"VAT %\" = 20 and Non-Deductible VAT %\" = 100.\n+ LibraryNonDeductibleVAT.CreateVATPostingSetupWithNonDeductibleDetail(VATPostingSetup, 20, 100);\n+\n+ // [GIVEN] Create a G/L Account.\n+ GLAccountNo := LibraryERM.CreateGLAccountWithVATPostingSetup(VATPostingSetup, GenPostingType::Purchase);\n+\n+ // [GIVEN] Create a Purchase Invoice.\n+ CreatePurchaseInvoiceWithCurrencyCode(PurchaseHeader, VATPostingSetup.\"VAT Bus. Posting Group\", Currency.Code, GLAccountNo);\n+ LibraryVariableStorage.Enqueue(0);\n+ LibraryVariableStorage.Enqueue(0);\n+\n+ // [GIVEN] Open Purchase Invoice page.\n+ PurchaseInvoicePage.OpenEdit();\n+ PurchaseInvoicePage.Filter.SetFilter(\"No.\", PurchaseHeader.\"No.\");\n+\n+ // [GIVEN] Open statistics of the invoice.\n+ PurchaseInvoicePage.Statistics.Invoke();\n+\n+ // [WHEN] Purchase Invoice is Posted.\n+ PurchInvHeader.Get(LibraryPurchase.PostPurchaseDocument(PurchaseHeader, true, true));\n+\n+ // [THEN] Verify G/L Entry is Consistent.\n+ VerifyGLEntryByDocumentNo(PurchInvHeader.\"No.\", 0);\n+ end;\n+\n local procedure SetAllowVATDifference(MaxVATDifference: Decimal)\n var\n PurchasesSetup: Record \"Purchases & Payables Setup\";\n@@ -672,6 +729,61 @@ codeunit 134287 \"Non-Deductible VAT Statistics\"\n GLEntry.TestField(Amount, ExpectedAmount);\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 SetMaxVATDifferenceAllowInCurrency(MaxVATDifference: Decimal; Currency: Record Currency)\n+ begin\n+ Currency.Validate(\"Max. VAT Difference Allowed\", MaxVATDifference);\n+ Currency.Modify(true);\n+ end;\n+\n+ local procedure CreatePurchaseInvoiceWithCurrencyCode(\n+ var PurchaseHeader: Record \"Purchase Header\";\n+ VATBusPostingGroup: Code[20];\n+ CurrencyCode: Code[20];\n+ GLAccountNo: Code[20])\n+ var\n+ PurchaseLine: Record \"Purchase Line\";\n+ begin\n+ LibraryPurchase.CreatePurchHeader(\n+ PurchaseHeader,\n+ PurchaseHeader.\"Document Type\"::Invoice,\n+ LibraryPurchase.CreateVendorWithVATBusPostingGroup(VATBusPostingGroup));\n+ PurchaseHeader.Validate(\"Vendor Invoice No.\", LibraryUtility.GenerateGUID());\n+ PurchaseHeader.Validate(\"Currency Code\", CurrencyCode);\n+ PurchaseHeader.Modify(true);\n+\n+ LibraryPurchase.CreatePurchaseLine(\n+ PurchaseLine,\n+ PurchaseHeader,\n+ PurchaseLine.Type::\"G/L Account\",\n+ GLAccountNo,\n+ LibraryRandom.RandInt(0));\n+ PurchaseLine.Validate(\"Direct Unit Cost\", LibraryRandom.RandIntInRange(1000, 1000));\n+ PurchaseLine.Modify(true);\n+ end;\n+\n+ local procedure VerifyGLEntryByDocumentNo(DocumentNo: Code[20]; ExpectedAmount: Decimal)\n+ var\n+ GLEntry: Record \"G/L Entry\";\n+ begin\n+ GLEntry.SetRange(\"Document No.\", DocumentNo);\n+ GLEntry.CalcSums(Amount);\n+ Assert.AreEqual(ExpectedAmount, GLEntry.Amount, GLEntryConsistentErr);\n+ end;\n+\n [ModalPageHandler]\n procedure PurchaseStatisticsChangeVATAmountModalPageHandler(var PurchaseStatisticsPage: TestPage \"Purchase Statistics\")\n var\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@@ -648,7 +648,9 @@ codeunit 6201 \"Non-Ded. VAT Impl.\"\n \n if PurchaseLine.\"Non-Deductible VAT %\" = 100 then begin\n PurchaseLine.\"Non-Deductible VAT Base\" := PurchaseLine.\"VAT Base Amount\";\n- PurchaseLine.\"Non-Deductible VAT Amount\" := PurchaseLine.\"Amount Including VAT\" - PurchaseLine.\"VAT Base Amount\" - PurchaseLine.\"VAT Difference\";\n+ if PurchaseLine.\"VAT Difference\" <> 0 then\n+ exit;\n+ PurchaseLine.\"Non-Deductible VAT Amount\" := PurchaseLine.\"Amount Including VAT\" - PurchaseLine.\"VAT Base Amount\";\n exit;\n end;\n PurchaseLine.\"Non-Deductible VAT Base\" :=\n"} +{"instance_id": "microsoftInternal__NAV-205825__cf-1", "base_instance_id": "microsoftInternal__NAV-205825", "variant_description": "VAT Country/Region Code assigned directly without validation does not propagate VAT setup", "failure_layer": null, "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-205825__cf-2", "FAIL_TO_PASS": [{"codeunitID": 134237, "functionName": ["ShipToCodeConnectionAltCustVATSetupOfBillToCustomer"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/VAT/AltCustVATDocTests.Codeunit.al b/App/Layers/W1/Tests/VAT/AltCustVATDocTests.Codeunit.al\nindex 1b415a0..f475605 100644\n--- a/App/Layers/W1/Tests/VAT/AltCustVATDocTests.Codeunit.al\n+++ b/App/Layers/W1/Tests/VAT/AltCustVATDocTests.Codeunit.al\n@@ -731,6 +731,43 @@ codeunit 134237 \"Alt. Cust. VAT. Doc. Tests\"\n LibraryLowerPermissions.SetOutsideO365Scope();\n end;\n \n+ [Test]\n+ [HandlerFunctions('ConfirmHandler,MessageHandler,NoNotificationOtherThanShipToAddressSendNotificationHandler')]\n+ procedure ShipToCodeConnectionAltCustVATSetupOfBillToCustomer()\n+ var\n+ ShipToAddress: Record \"Ship-to Address\";\n+ AltCustVATReg: Record \"Alt. Cust. VAT Reg.\";\n+ SalesHeader: Record \"Sales Header\";\n+ Customer, BillToCustomer : Record Customer;\n+ begin\n+ // [SCENARIO 563939] VAT setup is correctly applied when Ship-To has Alt. Cust. VAT Reg. for Bill-To Customer\n+\n+ Initialize();\n+ // [GIVEN] Sell-To Customer with country X\n+ LibrarySales.CreateCustomerWithCountryCodeAndVATRegNo(Customer);\n+ // [GIVEN] Bill-To Customer with country Z\n+ LibrarySales.CreateCustomerWithCountryCodeAndVATRegNo(BillToCustomer);\n+ // [GIVEN] Ship-To Address with country Y\n+ LibrarySales.CreateShipToAddressWithRandomCountryCode(ShipToAddress, Customer.\"No.\");\n+ // [GIVEN] Bill-To Customer and Ship-To Code assigned to Sell-To Customer\n+ Customer.Validate(\"Bill-to Customer No.\", BillToCustomer.\"No.\");\n+ Customer.Validate(\"Ship-to Code\", ShipToAddress.Code);\n+ Customer.Modify(true);\n+ LibraryLowerPermissions.SetO365Setup();\n+ LibraryLowerPermissions.AddSalesDocsCreate();\n+ // [GIVEN] Alternative Customer VAT Reg. for Bill-To Customer with Ship-To country Y\n+ LibraryAltCustVATReg.CreateAlternativeCustVATReg(AltCustVATReg, BillToCustomer.\"No.\", ShipToAddress.\"Country/Region Code\");\n+ // [WHEN] Create sales order for Sell-To Customer\n+ LibrarySales.CreateSalesHeader(SalesHeader, SalesHeader.\"Document Type\"::Order, Customer.\"No.\");\n+ // [THEN] VAT Country/Region Code is from Alt. Cust. VAT Reg. (Ship-To country)\n+ VerifyVATRegDataInSalesHeader(SalesHeader, AltCustVATReg.\"VAT Bus. Posting Group\", AltCustVATReg.\"Gen. Bus. Posting Group\", AltCustVATReg.\"VAT Registration No.\", AltCustVATReg.\"VAT Country/Region Code\");\n+ // [THEN] Sales order has Alt. VAT Registration options\n+ LibraryAltCustVATReg.VerifySalesDocAltVATReg(SalesHeader, true);\n+ LibraryVariableStorage.AssertEmpty();\n+\n+ LibraryLowerPermissions.SetOutsideO365Scope();\n+ end;\n+\n local procedure Initialize()\n begin\n LibrarySetupStorage.Restore();\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Finance/VAT/Registration/AltCustVATRegDocImpl.Codeunit.al b/App/Layers/W1/BaseApp/Finance/VAT/Registration/AltCustVATRegDocImpl.Codeunit.al\nindex da15d9e..37d3109 100644\n--- a/App/Layers/W1/BaseApp/Finance/VAT/Registration/AltCustVATRegDocImpl.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Finance/VAT/Registration/AltCustVATRegDocImpl.Codeunit.al\n@@ -124,6 +124,7 @@ codeunit 205 \"Alt. Cust. VAT Reg. Doc. Impl.\" implements \"Alt. Cust. VAT Reg. Do\n procedure UpdateSetupOnBillToCustomerChangeInSalesHeader(var SalesHeader: Record \"Sales Header\"; xSalesHeader: Record \"Sales Header\"; BillToCustomer: Record Customer)\n var\n GLSetup: Record \"General Ledger Setup\";\n+ AltCustVATReg: Record \"Alt. Cust. VAT Reg.\";\n begin\n GLSetup.Get();\n if GLSetup.\"Bill-to/Sell-to VAT Calc.\" <> GLSetup.\"Bill-to/Sell-to VAT Calc.\"::\"Bill-to/Pay-to No.\" then\n@@ -135,6 +136,13 @@ codeunit 205 \"Alt. Cust. VAT Reg. Doc. Impl.\" implements \"Alt. Cust. VAT Reg. Do\n CopyFromCustomer(SalesHeader, xSalesHeader, BillToCustomer);\n exit;\n end;\n+ if AltCustVATRegFacade.GetAlternativeCustVATReg(AltCustVATReg, BillToCustomer.\"No.\", SalesHeader.\"Ship-to Country/Region Code\") then begin\n+ SalesHeader.Validate(\"VAT Country/Region Code\", AltCustVATReg.\"VAT Country/Region Code\");\n+ SalesHeader.\"VAT Bus. Posting Group\" := AltCustVATReg.\"VAT Bus. Posting Group\";\n+ SalesHeader.\"Gen. Bus. Posting Group\" := AltCustVATReg.\"Gen. Bus. Posting Group\";\n+ SalesHeader.\"VAT Registration No.\" := AltCustVATReg.\"VAT Registration No.\";\n+ exit;\n+ end;\n if (SalesHeader.\"VAT Bus. Posting Group\" <> '') and (SalesHeader.\"VAT Bus. Posting Group\" <> BillToCustomer.\"VAT Bus. Posting Group\") then\n SalesHeader.Validate(\"VAT Bus. Posting Group\", BillToCustomer.\"VAT Bus. Posting Group\")\n else\n", "cf_variant_description": "VAT Country/Region Code and related fields assigned directly without validation does not propagate VAT setup"} +{"instance_id": "microsoftInternal__NAV-205825__cf-2", "base_instance_id": "microsoftInternal__NAV-205825", "variant_description": "Alternative VAT registration from Bill-To Customer applied only when Ship-to Country/Region Code is defined", "failure_layer": null, "FAIL_TO_PASS": [{"codeunitID": 134237, "functionName": ["ShipToCodeConnectionAltCustVATSetupOfBillToCustomer"]}], "PASS_TO_PASS": [], "test_patch": "diff --git a/App/Layers/W1/Tests/VAT/AltCustVATDocTests.Codeunit.al b/App/Layers/W1/Tests/VAT/AltCustVATDocTests.Codeunit.al\nindex 1b415a0..1aadea8 100644\n--- a/App/Layers/W1/Tests/VAT/AltCustVATDocTests.Codeunit.al\n+++ b/App/Layers/W1/Tests/VAT/AltCustVATDocTests.Codeunit.al\n@@ -731,6 +731,43 @@ codeunit 134237 \"Alt. Cust. VAT. Doc. Tests\"\n LibraryLowerPermissions.SetOutsideO365Scope();\n end;\n \n+ [Test]\n+ [HandlerFunctions('ConfirmHandler,MessageHandler,NoNotificationOtherThanShipToAddressSendNotificationHandler')]\n+ procedure ShipToCodeConnectionAltCustVATSetupOfBillToCustomer()\n+ var\n+ ShipToAddress: Record \"Ship-to Address\";\n+ AltCustVATReg: Record \"Alt. Cust. VAT Reg.\";\n+ SalesHeader: Record \"Sales Header\";\n+ Customer, BillToCustomer : Record Customer;\n+ begin\n+ // [SCENARIO 563939] Alternative VAT registration is applied from Bill-To Customer when Ship-to address has a defined country code\n+\n+ Initialize();\n+ // [GIVEN] Sell-To Customer with country \"X\"\n+ LibrarySales.CreateCustomerWithCountryCodeAndVATRegNo(Customer);\n+ // [GIVEN] Bill-To Customer with country \"Z\"\n+ LibrarySales.CreateCustomerWithCountryCodeAndVATRegNo(BillToCustomer);\n+ // [GIVEN] Ship-To Address with country \"Y\"\n+ LibrarySales.CreateShipToAddressWithRandomCountryCode(ShipToAddress, Customer.\"No.\");\n+ // [GIVEN] Bill-To Customer and Ship-To Code are assigned to the Sell-To Customer\n+ Customer.Validate(\"Bill-to Customer No.\", BillToCustomer.\"No.\");\n+ Customer.Validate(\"Ship-to Code\", ShipToAddress.Code);\n+ Customer.Modify(true);\n+ LibraryLowerPermissions.SetO365Setup();\n+ LibraryLowerPermissions.AddSalesDocsCreate();\n+ // [GIVEN] Alternative Customer VAT Reg. for Bill-To Customer with country \"Y\"\n+ LibraryAltCustVATReg.CreateAlternativeCustVATReg(AltCustVATReg, BillToCustomer.\"No.\", ShipToAddress.\"Country/Region Code\");\n+ // [WHEN] Create sales order for Sell-To Customer (Bill-To Customer and Ship-To Code are taken from the card)\n+ LibrarySales.CreateSalesHeader(SalesHeader, SalesHeader.\"Document Type\"::Order, Customer.\"No.\");\n+ // [THEN] Sales order has VAT data from Alternative Customer VAT Registration\n+ VerifyVATRegDataInSalesHeader(SalesHeader, AltCustVATReg.\"VAT Bus. Posting Group\", AltCustVATReg.\"Gen. Bus. Posting Group\", AltCustVATReg.\"VAT Registration No.\", AltCustVATReg.\"VAT Country/Region Code\");\n+ // [THEN] Sales order has Alt. VAT Registration options\n+ LibraryAltCustVATReg.VerifySalesDocAltVATReg(SalesHeader, true);\n+ LibraryVariableStorage.AssertEmpty();\n+\n+ LibraryLowerPermissions.SetOutsideO365Scope();\n+ end;\n+\n local procedure Initialize()\n begin\n LibrarySetupStorage.Restore();\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Finance/VAT/Registration/AltCustVATRegDocImpl.Codeunit.al b/App/Layers/W1/BaseApp/Finance/VAT/Registration/AltCustVATRegDocImpl.Codeunit.al\nindex da15d9e..ae2683a 100644\n--- a/App/Layers/W1/BaseApp/Finance/VAT/Registration/AltCustVATRegDocImpl.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Finance/VAT/Registration/AltCustVATRegDocImpl.Codeunit.al\n@@ -124,6 +124,7 @@ codeunit 205 \"Alt. Cust. VAT Reg. Doc. Impl.\" implements \"Alt. Cust. VAT Reg. Do\n procedure UpdateSetupOnBillToCustomerChangeInSalesHeader(var SalesHeader: Record \"Sales Header\"; xSalesHeader: Record \"Sales Header\"; BillToCustomer: Record Customer)\n var\n GLSetup: Record \"General Ledger Setup\";\n+ AltCustVATReg: Record \"Alt. Cust. VAT Reg.\";\n begin\n GLSetup.Get();\n if GLSetup.\"Bill-to/Sell-to VAT Calc.\" <> GLSetup.\"Bill-to/Sell-to VAT Calc.\"::\"Bill-to/Pay-to No.\" then\n@@ -135,6 +136,11 @@ codeunit 205 \"Alt. Cust. VAT Reg. Doc. Impl.\" implements \"Alt. Cust. VAT Reg. Do\n CopyFromCustomer(SalesHeader, xSalesHeader, BillToCustomer);\n exit;\n end;\n+ if (SalesHeader.\"Ship-to Country/Region Code\" <> '') and\n+ AltCustVATRegFacade.GetAlternativeCustVATReg(AltCustVATReg, BillToCustomer.\"No.\", SalesHeader.\"Ship-to Country/Region Code\") then begin\n+ SalesHeader.Validate(\"VAT Country/Region Code\", AltCustVATReg.\"VAT Country/Region Code\");\n+ exit;\n+ end;\n if (SalesHeader.\"VAT Bus. Posting Group\" <> '') and (SalesHeader.\"VAT Bus. Posting Group\" <> BillToCustomer.\"VAT Bus. Posting Group\") then\n SalesHeader.Validate(\"VAT Bus. Posting Group\", BillToCustomer.\"VAT Bus. Posting Group\")\n else\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", "failure_layer": null, "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,4 +3988,15 @@ 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,24 @@ 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-206977__cf-1", "base_instance_id": "microsoftInternal__NAV-206977", "variant_description": "Handle assembly document routing at the page level instead of the table level", "failure_layer": null, "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-206977__cf-1", "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\")\n"} +{"instance_id": "microsoftInternal__NAV-206977__cf-2", "base_instance_id": "microsoftInternal__NAV-206977", "variant_description": "Add fallback to Assembly Order for unhandled document types", "failure_layer": null, "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/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\")\n"} +{"instance_id": "microsoftInternal__NAV-206977__cf-3", "base_instance_id": "microsoftInternal__NAV-206977", "variant_description": "Fallback to Assembly Order when Blanket Assembly Order page is unavailable", "failure_layer": null, "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,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\")\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", "failure_layer": null, "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\nindex f743727..3488684 100644\n--- a/App/Layers/W1/Tests/SCM/SCMItemAttributes.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMItemAttributes.Codeunit.al\n@@ -2551,6 +2551,39 @@ codeunit 137413 \"SCM Item Attributes\"\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 var\n ItemAttribute: Record \"Item Attribute\";\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\nindex a84b055..be64f5c 100644\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 @@ page 7504 \"Item Attribute Value List\"\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 @@ page 7504 \"Item Attribute Value List\"\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 @@ page 7504 \"Item Attribute Value List\"\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 @@ page 7504 \"Item Attribute Value List\"\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": "Empty-value guard applied to both Attribute and Value OnValidate triggers", "failure_layer": null, "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\nindex f743727..8fc47df 100644\n--- a/App/Layers/W1/Tests/SCM/SCMItemAttributes.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMItemAttributes.Codeunit.al\n@@ -2551,6 +2551,39 @@ codeunit 137413 \"SCM Item Attributes\"\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 var\n ItemAttribute: Record \"Item Attribute\";\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\nindex a84b055..eac7f74 100644\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 @@ page 7504 \"Item Attribute Value List\"\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 @@ page 7504 \"Item Attribute Value List\"\n DeleteItemAttributeValueMapping(ItemAttribute.ID);\n end;\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- 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 @@ page 7504 \"Item Attribute Value List\"\n ItemAttributeValueMapping: Record \"Item Attribute Value Mapping\";\n ItemAttribute: Record \"Item Attribute\";\n begin\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 @@ page 7504 \"Item Attribute Value List\"\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", "failure_layer": null, "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\nindex f743727..b5937b4 100644\n--- a/App/Layers/W1/Tests/SCM/SCMItemAttributes.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMItemAttributes.Codeunit.al\n@@ -2551,6 +2551,40 @@ codeunit 137413 \"SCM Item Attributes\"\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+ ItemAttributeValueMapping: Record \"Item Attribute Value Mapping\";\n+ ItemCard: TestPage \"Item Card\";\n+ begin\n+ // [SCENARIO 565898] No mapping created when attribute value is blank\n+ Initialize();\n+\n+ // [GIVEN] A text-type item attribute and an item\n+ LibraryInventory.CreateItemAttribute(ItemAttribute, ItemAttribute.Type::Text, '');\n+ LibraryInventory.CreateItem(Item);\n+\n+ // [GIVEN] Open the Item Card\n+ ItemCard.OpenEdit();\n+ ItemCard.GotoRecord(Item);\n+\n+ // [WHEN] The user assigns attribute with blank value\n+ LibraryVariableStorage.Enqueue(ItemAttribute);\n+ LibraryVariableStorage.Enqueue('');\n+ ItemCard.Attributes.Invoke();\n+\n+ // [THEN] Verify no mapping created for blank 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 var\n ItemAttribute: Record \"Item Attribute\";\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\nindex a84b055..0b63e50 100644\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 @@ page 7504 \"Item Attribute Value List\"\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 @@ page 7504 \"Item Attribute Value List\"\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 @@ page 7504 \"Item Attribute Value List\"\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,27 @@ page 7504 \"Item Attribute Value List\"\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+ if ItemAttributeValue.Value = '' 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-207236__cf-1", "base_instance_id": "microsoftInternal__NAV-207236", "variant_description": "Add conditional reopen/release workflow in batch posting for sales invoices with currency code", "failure_layer": null, "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\nindex 5bc6879..f126d0c 100644\n--- a/App/Layers/W1/Tests/ERM/ERMSalesBatchPosting.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ERMSalesBatchPosting.Codeunit.al\n@@ -1573,6 +1573,37 @@ codeunit 134391 \"ERM Sales Batch Posting\"\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 var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n@@ -1890,6 +1921,52 @@ codeunit 134391 \"ERM Sales Batch Posting\"\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 @@ codeunit 134391 \"ERM Sales Batch Posting\"\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\nindex fbf39fc..9f88c95 100644\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 @@ table 36 \"Sales Header\"\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@@ -7038,7 +7038,10 @@ table 36 \"Sales Header\"\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;\ndiff --git a/App/Layers/W1/BaseApp/Sales/Posting/SalesBatchPostMgt.Codeunit.al b/App/Layers/W1/BaseApp/Sales/Posting/SalesBatchPostMgt.Codeunit.al\nindex e585527..f184938 100644\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 @@ codeunit 1371 \"Sales Batch Post Mgt.\"\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@@ -310,6 +313,23 @@ codeunit 1371 \"Sales Batch Post Mgt.\"\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 local procedure PrepareSalesHeaderOnBeforeBatchProcessing(var RecRef: RecordRef; var BatchConfirm: Option)\n var\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", "failure_layer": null, "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\nindex 4391387..92bc404 100644\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@@ -4904,6 +4905,72 @@\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 var\n AllProfile: Record \"All Profile\";\n@@ -6649,6 +6716,48 @@ ItemJournalLine, ItemJournalBatch.\"Journal Template Name\", ItemJournalBatch.Name\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\nindex bd37042..bf53080 100644\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 @@ codeunit 99000813 \"Carry Out Action\"\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", "failure_layer": null, "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\nindex 4391387..19d2440 100644\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@@ -4904,6 +4905,72 @@\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 var\n AllProfile: Record \"All Profile\";\n@@ -6649,6 +6716,48 @@ ItemJournalLine, ItemJournalBatch.\"Journal Template Name\", ItemJournalBatch.Name\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\nindex bd37042..c3d4b51 100644\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 @@ codeunit 99000813 \"Carry Out Action\"\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", "failure_layer": null, "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\nindex 4391387a6954..dcbb2cc63126 100644\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@@ -4904,6 +4905,72 @@\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 var\n AllProfile: Record \"All Profile\";\n@@ -6649,6 +6716,48 @@ ItemJournalLine, ItemJournalBatch.\"Journal Template Name\", ItemJournalBatch.Name\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\nindex bd37042..314c8fc 100644\n--- a/App/Layers/W1/BaseApp/Inventory/Requisition/CarryOutAction.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Requisition/CarryOutAction.Codeunit.al\n@@ -1535,6 +1535,7 @@ codeunit 99000813 \"Carry Out Action\"\n \n if not ProductionBOMHeader.Get(ProdOrderLine.\"Production BOM No.\") then\n exit;\n+ ProductionBOMLine.SetRange(Position, ProdOrderComponent.Position);\n \n ActiveVersionCode := VersionManagement.GetBOMVersion(ProductionBOMHeader.\"No.\", WorkDate(), true);\n \n"} +{"instance_id": "microsoftInternal__NAV-207878__cf-1", "base_instance_id": "microsoftInternal__NAV-207878", "variant_description": "Force availability warning when assembly line due date is before work date", "failure_layer": null, "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\nindex 2628814..b1dd886 100644\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 @@ codeunit 134381 \"ERM Dimension Priority\"\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@@ -758,6 +769,105 @@ codeunit 134381 \"ERM Dimension Priority\"\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 var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n@@ -1312,6 +1422,27 @@ codeunit 134381 \"ERM Dimension Priority\"\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 @@ codeunit 134381 \"ERM Dimension Priority\"\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\nindex 62ba45e..2f9a548 100644\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 @@ table 901 \"Assembly Line\"\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\nindex 26f5dfa..855fc12 100644\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 @@ codeunit 311 \"Item-Check Avail.\"\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 @@ codeunit 311 \"Item-Check Avail.\"\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 @@ codeunit 311 \"Item-Check Avail.\"\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@@ -767,6 +768,16 @@ codeunit 311 \"Item-Check Avail.\"\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 local procedure OnAfterCalculate(var Item: Record Item; var InitialQtyAvailable: Decimal; OldItemNetChange: Decimal; QtyPerUnitOfMeasure: Decimal; var ContextInfo: Dictionary of [Text, Text])\n begin\n"} +{"instance_id": "microsoftInternal__NAV-208649__cf-1", "base_instance_id": "microsoftInternal__NAV-208649", "variant_description": "Sales Order requesting 2 units of the finished good must scale component Expected Quantity accordingly", "failure_layer": "L4-workflow-business-logic", "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\nindex 7415eaa..2874464 100644\n--- a/App/Layers/W1/Tests/SCM/SCMOrderPlanningIII.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMOrderPlanningIII.Codeunit.al\n@@ -45,6 +45,8 @@ codeunit 137088 \"SCM Order Planning - III\"\n LineExistErr: Label 'Requistion line in %1 worksheet should exist for item %2';\n PurchaseLineQuantityBaseErr: Label '%1.%2 must be nearly equal to %3.', Comment = '%1 : Purchase Line, %2 : Quantity (Base), %3 : Value.';\n BOMFixedQtyCalcFormulaErr: Label 'BOM Fixed Quantity Calculation Formula should be used to calculate the values.';\n+ RelesedProdOrderComponentQtyPerRoundingErr: Label 'Relesed Production Order Item Component Quantity per %1 Not Match With Expected Result %2';\n+ RelesedProdOrderComponentExpQtyRoundingErr: Label 'Relesed Production Order Item Component Expected Quantity %1 Not Match With Expected Result %2';\n \n [Test]\n [HandlerFunctions('MakeSupplyOrdersPageHandler')]\n@@ -2988,6 +2990,73 @@ codeunit 137088 \"SCM Order Planning - III\"\n VerifyStartingTimeOnFirmPlannedProductionOrder(StartingTime, ChildItem.\"No.\", ProductionOrderNo);\n end;\n \n+ [Test]\n+ [HandlerFunctions('ModalPageHandler,ErrorMessageHandler')]\n+ procedure ReleasedProdOrderQuantityPerandExpectedQtyRoundingPrecisionChecking()\n+ var\n+ BaseItemUnitOfMeasure: Record \"Item Unit of Measure\";\n+ ComponentItem: Record Item;\n+ ProdOrderComp: Record \"Prod. Order Component\";\n+ ProdOrderLine: Record \"Prod. Order Line\";\n+ ProductionBOMHeader: Record \"Production BOM Header\";\n+ ProductionBOMLine: Record \"Production BOM Line\";\n+ ProductionOrder: Record \"Production Order\";\n+ ProductItem: Record Item;\n+ SalesHeader: Record \"Sales Header\";\n+ ExpectedQty: Decimal;\n+ RelesedProdOrderNo: Code[20];\n+ Status: Enum \"Production Order Status\";\n+ begin\n+ // [SCENARIO 562766] If a component's Item UOM has a 'Quantity Rounding Precision' of 1, & a Finished Good consumes partial quantity, \n+ // the Prod. Order created from the Planning of a Sales Order pulls in the Component with a 'Qty. Per' and 'Exp. Qty.' of 0.\n+ Initialize();\n+\n+ // [GIVEN] Created Component Item\n+ LibraryInventory.CreateItem(ComponentItem);\n+ ComponentItem.Validate(\"Replenishment System\", ComponentItem.\"Replenishment System\"::Purchase);\n+ ComponentItem.Validate(\"Rounding Precision\", LibraryRandom.RandPrecision());\n+ ComponentItem.Validate(\"Reordering Policy\", ComponentItem.\"Reordering Policy\"::\"Lot-for-Lot\");\n+ ComponentItem.Validate(\"Include Inventory\", true);\n+ ComponentItem.Modify(true);\n+\n+ // [GIVEN] Set Qty. Rounding Precision = 1 for Component Item\n+ BaseItemUnitOfMeasure.Get(ComponentItem.\"No.\", ComponentItem.\"Base Unit of Measure\");\n+ BaseItemUnitOfMeasure.Validate(\"Qty. Rounding Precision\", 1);\n+ BaseItemUnitOfMeasure.Modify();\n+\n+ // [GIVEN] Created Production Bom using Component Item\n+ LibraryManufacturing.CreateProductionBOMHeader(ProductionBOMHeader, ComponentItem.\"Base Unit of Measure\");\n+ LibraryManufacturing.CreateProductionBOMLine(ProductionBOMHeader, ProductionBOMLine, '', ProductionBOMLine.Type::Item, ComponentItem.\"No.\", LibraryRandom.RandDecInDecimalRange(0.01, 0.99, 2));\n+ ProductionBOMHeader.Validate(Status, ProductionBOMHeader.Status::Certified);\n+ ProductionBOMHeader.Modify();\n+\n+ // [GIVEN] Created Master Item and Production Bom Assigned to Master Item\n+ LibraryInventory.CreateItem(ProductItem);\n+ ProductItem.Validate(\"Replenishment System\", ProductItem.\"Replenishment System\"::\"Prod. Order\");\n+ ProductItem.Validate(\"Rounding Precision\", 1);\n+ ProductItem.Validate(\"Reordering Policy\", ProductItem.\"Reordering Policy\"::Order);\n+ ProductItem.Validate(\"Production BOM No.\", ProductionBOMHeader.\"No.\");\n+ ProductItem.Modify(true);\n+\n+ // [GIVEN] Created Sales Order Using Master Item Quantity - 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 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 36930a9..2367479 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@@ -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-208649__cf-2", "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", "failure_layer": "L2-execution-validation", "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 7415eaa53ccd..2573227dbca7 100644\n--- a/App/Layers/W1/Tests/SCM/SCMOrderPlanningIII.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMOrderPlanningIII.Codeunit.al\n@@ -45,6 +45,8 @@ codeunit 137088 \"SCM Order Planning - III\"\n LineExistErr: Label 'Requistion line in %1 worksheet should exist for item %2';\n PurchaseLineQuantityBaseErr: Label '%1.%2 must be nearly equal to %3.', Comment = '%1 : Purchase Line, %2 : Quantity (Base), %3 : Value.';\n BOMFixedQtyCalcFormulaErr: Label 'BOM Fixed Quantity Calculation Formula should be used to calculate the values.';\n+ RelesedProdOrderComponentQtyPerRoundingErr: Label 'Relesed Production Order Item Component Quantity per %1 Not Match With Expected Result %2';\n+ RelesedProdOrderComponentExpQtyRoundingErr: Label 'Relesed Production Order Item Component Expected Quantity %1 Not Match With Expected Result %2';\n \n [Test]\n [HandlerFunctions('MakeSupplyOrdersPageHandler')]\n@@ -2988,6 +2990,73 @@ codeunit 137088 \"SCM Order Planning - III\"\n VerifyStartingTimeOnFirmPlannedProductionOrder(StartingTime, ChildItem.\"No.\", ProductionOrderNo);\n end;\n \n+ [Test]\n+ [HandlerFunctions('ModalPageHandler,ErrorMessageHandler')]\n+ procedure ReleasedProdOrderQuantityPerandExpectedQtyRoundingPrecisionChecking()\n+ var\n+ BaseItemUnitOfMeasure: Record \"Item Unit of Measure\";\n+ ComponentItem: Record Item;\n+ ProdOrderComp: Record \"Prod. Order Component\";\n+ ProdOrderLine: Record \"Prod. Order Line\";\n+ ProductionBOMHeader: Record \"Production BOM Header\";\n+ ProductionBOMLine: Record \"Production BOM Line\";\n+ ProductionOrder: Record \"Production Order\";\n+ ProductItem: Record Item;\n+ SalesHeader: Record \"Sales Header\";\n+ ExpectedQty: Decimal;\n+ RelesedProdOrderNo: Code[20];\n+ Status: Enum \"Production Order Status\";\n+ begin\n+ // [SCENARIO 562766] If a component's Item UOM has a 'Quantity Rounding Precision' of 1, & a Finished Good consumes partial quantity, \n+ // the Prod. Order created from the Planning of a Sales Order pulls in the Component with a 'Qty. Per' and 'Exp. Qty.' of 0.\n+ Initialize();\n+\n+ // [GIVEN] Created Component Item\n+ LibraryInventory.CreateItem(ComponentItem);\n+ ComponentItem.Validate(\"Replenishment System\", ComponentItem.\"Replenishment System\"::Purchase);\n+ ComponentItem.Validate(\"Rounding Precision\", LibraryRandom.RandPrecision());\n+ ComponentItem.Validate(\"Reordering Policy\", ComponentItem.\"Reordering Policy\"::\"Lot-for-Lot\");\n+ ComponentItem.Validate(\"Include Inventory\", true);\n+ ComponentItem.Modify(true);\n+\n+ // [GIVEN] Set Qty. Rounding Precision = 1 for Component Item\n+ BaseItemUnitOfMeasure.Get(ComponentItem.\"No.\", ComponentItem.\"Base Unit of Measure\");\n+ BaseItemUnitOfMeasure.Validate(\"Qty. Rounding Precision\", 1);\n+ BaseItemUnitOfMeasure.Modify();\n+\n+ // [GIVEN] Created Production Bom using Component Item\n+ LibraryManufacturing.CreateProductionBOMHeader(ProductionBOMHeader, ComponentItem.\"Base Unit of Measure\");\n+ LibraryManufacturing.CreateProductionBOMLine(ProductionBOMHeader, ProductionBOMLine, '', ProductionBOMLine.Type::Item, ComponentItem.\"No.\", 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 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 36930a9..2db33e0 100644\n--- a/App/Layers/W1/BaseApp/Manufacturing/Document/CalculateProdOrder.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Manufacturing/Document/CalculateProdOrder.Codeunit.al\n@@ -37,6 +37,7 @@ codeunit 99000773 \"Calculate Prod. Order\"\n var\n Item: Record Item;\n Location: Record Location;\n+ ProdLineItem: Record Item;\n SKU: Record \"Stockkeeping Unit\";\n ProdOrder: Record \"Production Order\";\n ProdOrderLine: Record \"Prod. Order Line\";\n@@ -298,5 +299,6 @@ codeunit 99000773 \"Calculate Prod. Order\"\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-208748__cf-1", "base_instance_id": "microsoftInternal__NAV-208748", "variant_description": "Use exactly 2 items instead of 3 in the blanket order", "failure_layer": "L2-execution-validation", "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)", "failure_layer": "L2-execution-validation", "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-208851__cf-1", "base_instance_id": "microsoftInternal__NAV-208851", "variant_description": "Amount Type set to Price for Customer Price Group; should remain Price after closing", "failure_layer": null, "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\nindex 5f58621..2e9765e 100644\n--- a/App/Layers/W1/Tests/ERM/PriceListsUI.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/PriceListsUI.Codeunit.al\n@@ -4366,6 +4366,39 @@ codeunit 134117 \"Price Lists UI\"\n PurchasePriceList.Caption()));\n end;\n \n+ [Test]\n+ procedure AmountTypeFieldDoesNotChangeOnClosePageSalesPriceList()\n+ var\n+ PriceListHeader: Record \"Price List Header\";\n+ CustomerPriceGroup: Record \"Customer Price 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 price\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 Price Group\");\n+ SalesPriceList.AmountType.SetValue(\"Price Amount Type\"::Price);\n+ CustomerPriceGroup.Init();\n+ CustomerPriceGroup.Code := LibraryUtility.GenerateGUID();\n+ CustomerPriceGroup.Insert();\n+ SalesPriceList.AssignToNo.SetValue(CustomerPriceGroup.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 var\n PriceListHeader: Record \"Price List Header\";\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Pricing/PriceList/PriceListHeader.Table.al b/App/Layers/W1/BaseApp/Pricing/PriceList/PriceListHeader.Table.al\nindex fb6adbb..0794b2d 100644\n--- a/App/Layers/W1/BaseApp/Pricing/PriceList/PriceListHeader.Table.al\n+++ b/App/Layers/W1/BaseApp/Pricing/PriceList/PriceListHeader.Table.al\n@@ -562,9 +562,11 @@ table 7000 \"Price List Header\"\n var\n xAmountType: Enum \"Price Amount Type\";\n begin\n+ CopyTo(PriceSource);\n xAmountType := \"Amount Type\";\n if \"Source Type\" in [\"Source Type\"::\"Customer Disc. Group\", \"Source Type\"::\"Customer Price Group\"] then\n- \"Amount Type\" := PriceSource.GetDefaultAmountType()\n+ if PriceSource.GetDefaultAmountType() <> 0 then\n+ \"Amount Type\" := PriceSource.GetDefaultAmountType()\n else\n \"Amount Type\" := CalcAmountType();\n if \"Amount Type\" <> xAmountType then\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", "failure_layer": "L2-execution-validation", "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\nindex 4e0f927..80295a5 100644\n--- a/App/Layers/W1/Tests/Job/JobConsumptionPurchase.Codeunit.al\n+++ b/App/Layers/W1/Tests/Job/JobConsumptionPurchase.Codeunit.al\n@@ -4339,6 +4339,71 @@ codeunit 136302 \"Job Consumption Purchase\"\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 var\n WarehouseEmployee: Record \"Warehouse Employee\";\n@@ -6702,6 +6767,14 @@ codeunit 136302 \"Job Consumption Purchase\"\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 @@ codeunit 136302 \"Job Consumption Purchase\"\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\nindex 9a2e42e..e0cdb28 100644\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@@ -6,10 +6,11 @@ using Microsoft.Inventory.Planning;\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@@ -33,6 +34,7 @@ codeunit 1032 \"Job Planning Line-Reserve\"\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@@ -844,6 +846,7 @@ codeunit 1032 \"Job Planning Line-Reserve\"\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@@ -869,6 +872,23 @@ codeunit 1032 \"Job Planning Line-Reserve\"\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", "failure_layer": "L2-execution-validation", "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\nindex 4e0f927..9ae0e63 100644\n--- a/App/Layers/W1/Tests/Job/JobConsumptionPurchase.Codeunit.al\n+++ b/App/Layers/W1/Tests/Job/JobConsumptionPurchase.Codeunit.al\n@@ -4339,6 +4339,71 @@ codeunit 136302 \"Job Consumption Purchase\"\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 var\n WarehouseEmployee: Record \"Warehouse Employee\";\n@@ -6702,6 +6767,14 @@ codeunit 136302 \"Job Consumption Purchase\"\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 @@ codeunit 136302 \"Job Consumption Purchase\"\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\nindex 9a2e42e..e0cdb28 100644\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@@ -6,10 +6,11 @@ using Microsoft.Inventory.Planning;\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@@ -33,6 +34,7 @@ codeunit 1032 \"Job Planning Line-Reserve\"\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@@ -844,6 +846,7 @@ codeunit 1032 \"Job Planning Line-Reserve\"\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@@ -869,6 +872,23 @@ codeunit 1032 \"Job Planning Line-Reserve\"\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-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", "failure_layer": "L2-execution-validation", "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\nindex ca7812c..6176d7f 100644\n--- a/App/Layers/W1/Tests/ERM/ReminderAutomationTests.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ReminderAutomationTests.Codeunit.al\n@@ -814,6 +814,30 @@ codeunit 134979 \"Reminder Automation Tests\"\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 var\n ReminderLevel: Record \"Reminder Level\";\n@@ -1211,6 +1235,32 @@ codeunit 134979 \"Reminder Automation Tests\"\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\nindex 10d284c..23e132d 100644\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 @@ page 835 \"Reminder Level Communication\"\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+ ReminderLevel.Get(Rec.\"Reminder Terms Code\", Rec.\"No.\");\n \n- if not ReminderAttachmentText.Get(Rec.\"Reminder Attachment Text\", CurrentLanguage.Code) then\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", "failure_layer": "L2-execution-validation", "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\nindex ca7812c..d4e0a4a 100644\n--- a/App/Layers/W1/Tests/ERM/ReminderAutomationTests.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ReminderAutomationTests.Codeunit.al\n@@ -814,6 +814,32 @@ codeunit 134979 \"Reminder Automation Tests\"\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 var\n ReminderLevel: Record \"Reminder Level\";\n@@ -1211,6 +1237,25 @@ codeunit 134979 \"Reminder Automation Tests\"\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\nindex 10d284c..23e132d 100644\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 @@ page 835 \"Reminder Level Communication\"\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+ ReminderLevel.Get(Rec.\"Reminder Terms Code\", Rec.\"No.\");\n \n- if not ReminderAttachmentText.Get(Rec.\"Reminder Attachment Text\", CurrentLanguage.Code) then\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-209835__cf-1", "base_instance_id": "microsoftInternal__NAV-209835", "variant_description": "Filter by Action Message New instead of Cancel when carrying out action message", "failure_layer": "L2-execution-validation", "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\nindex 70e088d..31a2217 100644\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 @@ codeunit 137045 \"SCM Bugfixes\"\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@@ -929,6 +930,53 @@ codeunit 137045 \"SCM Bugfixes\"\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 var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n@@ -1547,6 +1595,50 @@ codeunit 137045 \"SCM Bugfixes\"\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\nindex 78996b4..14b0c35 100644\n--- a/App/Layers/W1/BaseApp/Inventory/Requisition/CarryOutActionMsgPlan.Report.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Requisition/CarryOutActionMsgPlan.Report.al\n@@ -472,8 +472,10 @@ report 99001020 \"Carry Out Action Msg. - Plan.\"\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": "Filters applied on the Requisition Line before execution must be preserved and respected during Carry Out Action Message processing", "failure_layer": "L3-event-driven-paradigm", "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\nindex 70e088d..c0ca37a 100644\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 @@ codeunit 137045 \"SCM Bugfixes\"\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@@ -929,6 +930,54 @@ codeunit 137045 \"SCM Bugfixes\"\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 var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n@@ -1547,6 +1596,50 @@ codeunit 137045 \"SCM Bugfixes\"\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-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", "failure_layer": "L2-execution-validation", "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\nindex 7027c53..68dc733 100644\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 @@ using Microsoft.Finance.GeneralLedger.Journal;\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 @@ codeunit 136119 \"Service Standard Codes\"\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 @@ codeunit 136119 \"Service Standard Codes\"\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@@ -1026,6 +1030,75 @@ codeunit 136119 \"Service Standard Codes\"\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 var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n@@ -1597,6 +1670,33 @@ codeunit 136119 \"Service Standard Codes\"\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\nindex 33f69be..53eb121 100644\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 @@ table 5998 \"Standard Service Item Gr. Code\"\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", "failure_layer": "L2-execution-validation", "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\nindex 7027c53..adbb4f2 100644\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 @@ using Microsoft.Finance.GeneralLedger.Journal;\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 @@ codeunit 136119 \"Service Standard Codes\"\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 @@ codeunit 136119 \"Service Standard Codes\"\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@@ -1026,6 +1030,80 @@ codeunit 136119 \"Service Standard Codes\"\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 var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n@@ -1597,6 +1675,33 @@ codeunit 136119 \"Service Standard Codes\"\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\nindex 33f69be..53eb121 100644\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 @@ table 5998 \"Standard Service Item Gr. Code\"\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-210528__cf-1", "base_instance_id": "microsoftInternal__NAV-210528", "variant_description": "Only 3 of 4 emission fields required: omits Work/Machine Center Emissions", "failure_layer": null, "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,43 @@ 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-211521__cf-1", "base_instance_id": "microsoftInternal__NAV-211521", "variant_description": "No System Task Type filter should be applied on Next Task Date drilldown", "failure_layer": "L2-execution-validation", "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\nindex 415be9b..bdea511 100644\n--- a/App/Layers/W1/Tests/Marketing/MarketingContacts.Codeunit.al\n+++ b/App/Layers/W1/Tests/Marketing/MarketingContacts.Codeunit.al\n@@ -6029,6 +6029,39 @@ codeunit 136201 \"Marketing Contacts\"\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 var\n MarketingSetup: Record \"Marketing Setup\";\n", "patch": "diff --git a/App/Layers/W1/BaseApp/CRM/Contact/Contact.Table.al b/App/Layers/W1/BaseApp/CRM/Contact/Contact.Table.al\nindex 401cabe..42569b9 100644\n--- a/App/Layers/W1/BaseApp/CRM/Contact/Contact.Table.al\n+++ b/App/Layers/W1/BaseApp/CRM/Contact/Contact.Table.al\n@@ -565,8 +565,7 @@ table 5050 Contact\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", "failure_layer": "L3-event-driven-paradigm", "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\nindex 415be9b..2112c99 100644\n--- a/App/Layers/W1/Tests/Marketing/MarketingContacts.Codeunit.al\n+++ b/App/Layers/W1/Tests/Marketing/MarketingContacts.Codeunit.al\n@@ -6029,6 +6029,36 @@ codeunit 136201 \"Marketing Contacts\"\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 var\n MarketingSetup: Record \"Marketing Setup\";\n", "patch": "diff --git a/App/Layers/W1/BaseApp/CRM/Contact/Contact.Table.al b/App/Layers/W1/BaseApp/CRM/Contact/Contact.Table.al\nindex 401cabe..42569b9 100644\n--- a/App/Layers/W1/BaseApp/CRM/Contact/Contact.Table.al\n+++ b/App/Layers/W1/BaseApp/CRM/Contact/Contact.Table.al\n@@ -565,8 +565,7 @@ table 5050 Contact\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-213671__cf-1", "base_instance_id": "microsoftInternal__NAV-213671", "variant_description": "Filter text should be truncated to avoid exceeding maximum allowed length", "failure_layer": "L2-execution-validation", "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\nindex 4356582..9be9cd7 100644\n--- a/App/Layers/W1/Tests/Marketing/MarketingOpportunityMgmt.Codeunit.al\n+++ b/App/Layers/W1/Tests/Marketing/MarketingOpportunityMgmt.Codeunit.al\n@@ -1818,6 +1818,45 @@ codeunit 136209 \"Marketing Opportunity Mgmt\"\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 begin\n LibraryTestInitialize.OnTestInitialize(CODEUNIT::\"Marketing Opportunity Mgmt\");\n", "patch": "diff --git a/App/Layers/W1/BaseApp/CRM/Opportunity/OpportunityList.Page.al b/App/Layers/W1/BaseApp/CRM/Opportunity/OpportunityList.Page.al\nindex c70c6c1..b69a136 100644\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 @@ page 5123 \"Opportunity List\"\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)", "failure_layer": "L2-execution-validation", "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\nindex 4356582..c4f1f60 100644\n--- a/App/Layers/W1/Tests/Marketing/MarketingOpportunityMgmt.Codeunit.al\n+++ b/App/Layers/W1/Tests/Marketing/MarketingOpportunityMgmt.Codeunit.al\n@@ -1818,6 +1818,45 @@ codeunit 136209 \"Marketing Opportunity Mgmt\"\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 begin\n LibraryTestInitialize.OnTestInitialize(CODEUNIT::\"Marketing Opportunity Mgmt\");\n", "patch": "diff --git a/App/Layers/W1/BaseApp/CRM/Opportunity/OpportunityList.Page.al b/App/Layers/W1/BaseApp/CRM/Opportunity/OpportunityList.Page.al\nindex c70c6c1..8166718 100644\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 @@ page 5123 \"Opportunity List\"\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-213683__cf-1", "base_instance_id": "microsoftInternal__NAV-213683", "variant_description": "Rename Item No. should always be allowed regardless of existing entries", "failure_layer": "L2-execution-validation", "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\nindex 6a94185..9590f93 100644\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@@ -4819,6 +4820,57 @@\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 var\n AllProfile: Record \"All Profile\";\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\nindex 9735e4b..0fa02ec 100644\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 @@ codeunit 99000795 \"Mfg. Item Integration\"\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 @@ codeunit 99000795 \"Mfg. Item Integration\"\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-214557__cf-1", "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", "failure_layer": "L2-execution-validation", "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\nindex 66bf5a9..974e217 100644\n--- a/App/Layers/W1/Tests/SCM/SCMPlanningOrderTracking.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM/SCMPlanningOrderTracking.Codeunit.al\n@@ -861,6 +861,69 @@\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 var\n RequisitionLine: Record \"Requisition Line\";\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\nindex e3a6cf2..e0c32ef 100644\n--- a/App/Layers/W1/BaseApp/Inventory/Tracking/InventoryProfileOffsetting.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Tracking/InventoryProfileOffsetting.Codeunit.al\n@@ -9,6 +9,7 @@ using Microsoft.Foundation.Shipping;\n using Microsoft.Foundation.UOM;\n using Microsoft.Inventory;\n using Microsoft.Inventory.Item;\n+using Microsoft.Manufacturing.Document;\n using Microsoft.Inventory.Ledger;\n using Microsoft.Inventory.Location;\n using Microsoft.Inventory.Planning;\n@@ -982,6 +983,9 @@ codeunit 99000854 \"Inventory Profile Offsetting\"\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 @@ codeunit 99000854 \"Inventory Profile Offsetting\"\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-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", "failure_layer": "L2-execution-validation", "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\nindex bb7f40e..4889d00 100644\n--- a/App/Layers/W1/Tests/Job/UTTJob.Codeunit.al\n+++ b/App/Layers/W1/Tests/Job/UTTJob.Codeunit.al\n@@ -2248,6 +2248,38 @@ codeunit 136350 \"UT T Job\"\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 var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n@@ -2617,6 +2649,30 @@ codeunit 136350 \"UT T Job\"\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 @@ codeunit 136350 \"UT T Job\"\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\nindex 604bb91..dbeab2b 100644\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 @@ codeunit 1018 \"Purchase Doc. From Job\"\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", "failure_layer": "L2-execution-validation", "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\nindex bb7f40e..52eff0e 100644\n--- a/App/Layers/W1/Tests/Job/UTTJob.Codeunit.al\n+++ b/App/Layers/W1/Tests/Job/UTTJob.Codeunit.al\n@@ -2248,6 +2248,39 @@ codeunit 136350 \"UT T Job\"\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 var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n@@ -2617,6 +2650,30 @@ codeunit 136350 \"UT T Job\"\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 @@ codeunit 136350 \"UT T Job\"\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\nindex 604bb91..dbeab2b 100644\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 @@ codeunit 1018 \"Purchase Doc. From Job\"\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-214926__cf-1", "base_instance_id": "microsoftInternal__NAV-214926", "variant_description": "Remove SalesOutstandingAmountFromShipment from formula; only deduct shipment-derived invoice amounts", "failure_layer": null, "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] \"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.\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..cf00000003 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,7 @@ table 18 Customer\n AdditionalAmountLCY: Decimal;\n IsHandled: Boolean;\n TotalAmountLCY: Decimal;\n+ ShippedOutstandingInvoicesLCY: Decimal;\n begin\n IsHandled := false;\n OnBeforeGetTotalAmountLCYCommon(Rec, AdditionalAmountLCY, IsHandled);\n@@ -2362,10 +2363,12 @@ table 18 Customer\n SalesOutstandingAmountFromShipment := SalesLine.OutstandingInvoiceAmountFromShipment(\"No.\");\n InvoicedPrepmtAmountLCY := GetInvoicedPrepmtAmountLCY();\n RetRcdNotInvAmountLCY := GetReturnRcdNotInvAmountLCY();\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)\" +\n+ (\"Outstanding Invoices (LCY)\" - ShippedOutstandingInvoicesLCY) -\n+ InvoicedPrepmtAmountLCY - RetRcdNotInvAmountLCY + AdditionalAmountLCY;\n \n OnAfterGetTotalAmountLCYCommon(Rec, TotalAmountLCY);\n exit(TotalAmountLCY);\n@@ -3451,6 +3454,18 @@ 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 [InherentPermissions(PermissionObjectType::TableData, Database::\"My Customer\", 'rm')]\n local procedure UpdateMyCustomer(CallingFieldNo: Integer)\n var\n"} +{"instance_id": "microsoftInternal__NAV-215972__cf-1", "base_instance_id": "microsoftInternal__NAV-215972", "variant_description": "Block reservation only when transfer quantity is greater than 0", "failure_layer": null, "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 6e9a6ab..dfbe780 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+ 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 9ab054c..e5a6f8c 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,9 @@ 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-2", "base_instance_id": "microsoftInternal__NAV-215972", "variant_description": "Block reservation only for outbound quantities (Qty. to Ship > 0)", "failure_layer": null, "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 6e9a6ab..2d08ef7 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@@ -2005,6 +2006,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 should be blocked when item Reserve=Never and Qty. to Ship > 0\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\"\n+ CreateDirectTransferHeader(TransferHeader, LocationA.code, LocationB.Code);\n+ TransferHeader.Validate(\"Posting Date\", WorkDate());\n+ TransferHeader.Modify(true);\n+\n+ // [WHEN] Create transfer line with positive Qty. to Ship 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 [Test]\n procedure PostDirectTransferOrderWithTwoReservation()\n var\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 9ab054c..0ccbac1 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,9 @@ 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-216572__cf-1", "base_instance_id": "microsoftInternal__NAV-216572", "variant_description": "Dimensions imported only for G/L Account destination type lines", "failure_layer": null, "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 ff710ce..14b8385 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\"::\"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 130b3e0..69b4d15 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,11 @@ 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-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)", "failure_layer": "L2-execution-validation", "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", "failure_layer": "L1-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-217104__cf-1", "base_instance_id": "microsoftInternal__NAV-217104", "variant_description": "Always correct LCY residual by removing TotalAmount = 0 guard", "failure_layer": null, "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\nindex 6626b2b..69f5c5f 100644\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 @@ codeunit 139598 \"AAC Auto. Acc. Group Posting\"\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@@ -756,6 +756,31 @@ codeunit 139598 \"AAC Auto. Acc. Group Posting\"\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 begin\n LibrarySetupStorage.Restore();\n@@ -1538,6 +1563,82 @@ codeunit 139598 \"AAC Auto. Acc. Group Posting\"\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\nindex 0e4bcfe..724a44d 100644\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 @@ codeunit 4850 \"AA Codes Posting Helper\"\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 @@ codeunit 4850 \"AA Codes Posting Helper\"\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", "failure_layer": null, "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\nindex 6626b2b..9e4d79f 100644\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 @@ codeunit 139598 \"AAC Auto. Acc. Group Posting\"\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@@ -756,6 +756,31 @@ codeunit 139598 \"AAC Auto. Acc. Group Posting\"\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 begin\n LibrarySetupStorage.Restore();\n@@ -1538,6 +1563,82 @@ codeunit 139598 \"AAC Auto. Acc. Group Posting\"\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\nindex 0e4bcfe..683e2fc 100644\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 @@ codeunit 4850 \"AA Codes Posting Helper\"\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 @@ codeunit 4850 \"AA Codes Posting Helper\"\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-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", "failure_layer": "L2-execution-validation", "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-217974__cf-1", "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).", "failure_layer": "L4-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;\n", "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-2", "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.", "failure_layer": null, "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 670a875..ea4bebe 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;\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Utilities/CopyDocumentMgt.Codeunit.al b/App/Layers/W1/BaseApp/Utilities/CopyDocumentMgt.Codeunit.al\nindex 780de25..b412eb6 100644\n--- a/App/Layers/W1/BaseApp/Utilities/CopyDocumentMgt.Codeunit.al\n+++ b/App/Layers/W1/BaseApp/Utilities/CopyDocumentMgt.Codeunit.al\n@@ -749,5 +749,6 @@ codeunit 6620 \"Copy Document Mgt.\"\n ToSalesHeader.TransferFields(FromSalesHeader, false);\n UpdateSalesHeaderWhenCopyFromSalesHeader(ToSalesHeader, OldSalesHeader, FromDocType);\n+ UpdateShipToAddress(ToSalesHeader);\n SetReceivedFromCountryCode(FromDocType, ToSalesHeader);\n OnAfterCopySalesHeader(ToSalesHeader, OldSalesHeader, FromSalesHeader, FromDocType);\n end;\n"} +{"instance_id": "microsoftInternal__NAV-218062__cf-1", "base_instance_id": "microsoftInternal__NAV-218062", "variant_description": "Availability check should ignore bin-level quantities when Bin Mandatory is enabled", "failure_layer": null, "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 eaf731a..889f3b0 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 = 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 0b63877..32239d6 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 := CalcReservQtyOnPicksShips(WhseWorksheetLine.\"Location Code\", WhseWorksheetLine.\"Item No.\", WhseWorksheetLine.\"Variant Code\", TempWhseActivLine);\n \n QtyReservedForCurrLine :=\n"} +{"instance_id": "microsoftInternal__NAV-218323__cf-1", "base_instance_id": "microsoftInternal__NAV-218323", "variant_description": "VAT Settlement bypasses journal template name check for all account types except Vendor", "failure_layer": null, "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 5c99488..5a80a5f 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\"::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 c7ffd42..d596be8 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 da61c5f..3502139 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 88068be..4930d5f 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,8 @@ 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\"::Vendor then\n+ GenJnlPostLine.SetIgnoreJournalTemplNameMandatoryCheck();\n GenJnlPostLine.Run(GenJnlLine);\n end;\n \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.", "failure_layer": "L4-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\")\n", "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,13 @@ 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-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)", "failure_layer": "L2-execution-validation", "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\nindex f8b1cf9..13bf71a 100644\n--- a/App/Layers/W1/Tests/ERM/ERMIssuedReminderAddnlFee.Codeunit.al\n+++ b/App/Layers/W1/Tests/ERM/ERMIssuedReminderAddnlFee.Codeunit.al\n@@ -587,6 +587,55 @@ codeunit 134905 \"ERM Issued Reminder Addnl Fee\"\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()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\ndiff --git a/App/Layers/W1/Tests/Misc/UTCustomerTable.Codeunit.al b/App/Layers/W1/Tests/Misc/UTCustomerTable.Codeunit.al\nindex 70b34d3..33cc300 100644\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 @@ codeunit 134825 \"UT Customer Table\"\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 @@ codeunit 134825 \"UT Customer Table\"\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\nindex 9fdc21c..0a75b46 100644\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 @@ table 18 Customer\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-220314__cf-1", "base_instance_id": "microsoftInternal__NAV-220314", "variant_description": "Reset UOM only when Item No. is changed through validation trigger, not programmatic assignment", "failure_layer": null, "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 436478a..4c4f1a5 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[2].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 fb9253b..fffd780 100644\n--- a/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al\n+++ b/App/Layers/W1/BaseApp/Inventory/Journal/ItemJournalLine.Table.al\n@@ -73,9 +73,10 @@ table 83 \"Item Journal Line\"\n DummyWorkCenter: Record Microsoft.Manufacturing.WorkCenter.\"Work Center\";\n #endif\n begin\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-220984__cf-1", "base_instance_id": "microsoftInternal__NAV-220984", "variant_description": "Date condition: only set Ending Date when Starting Date is not WORKDATE", "failure_layer": null, "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\nindex f654552..d7cc1fc 100644\n--- a/App/Layers/W1/Tests/SCM-Manufacturing/SCMManufacturing.Codeunit.al\n+++ b/App/Layers/W1/Tests/SCM-Manufacturing/SCMManufacturing.Codeunit.al\n@@ -4829,6 +4829,54 @@ codeunit 137404 \"SCM Manufacturing\"\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() + 5);\n+\n+ // [WHEN] Run the Exchange Production BOM Item report\n+ RunExchangeProductionBOMItemReport();\n+\n+ // [THEN] Validate that the replaced item has Ending Date set to StartingDate - 1 (CF only modifies when StartingDate <> WorkDate())\n+ ValidateEndingDateSet(ProductionBOMHeader.\"No.\", Item[1].\"No.\", WorkDate() + 5);\n+\n+ // [AND] Ensure no test artifacts are left behind\n+ LibraryVariableStorage.AssertEmpty();\n+ end;\n+\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n@@ -7704,6 +7752,23 @@ codeunit 137404 \"SCM Manufacturing\"\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 ValidateEndingDateSet(ProdBOMHeaderNo: Code[20]; ItemNo: Code[20]; StartingDate: Date)\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(StartingDate - 1, ProductionBOMLine.\"Ending Date\", 'Ending Date is not correctly 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 @@ codeunit 137404 \"SCM Manufacturing\"\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\nindex 83bf3f0..3a6e33d 100644\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 @@ report 99001043 \"Exchange Production BOM Item\"\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-221877__cf-1", "base_instance_id": "microsoftInternal__NAV-221877", "variant_description": "The service header status should update only after the service item line is committed (Modify)", "failure_layer": "L2-execution-validation", "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\nindex 5a74dfc..369a095 100644\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,54 @@ 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+\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\nindex 1c8fcc9..60fc813 100644\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\" <> '' then\n+ Rec.Validate(\"Repair Status Code\", Rec.\"Repair Status Code\");\n+\n OnAfterValidateServiceItemNoOnBeforeUpdateResponseTimeHours(Rec, xRec);\n UpdateResponseTimeHours();\n CreateDimFromDefaultDim(0);\n"} +{"instance_id": "microsoftInternal__NAV-222092__cf-1", "base_instance_id": "microsoftInternal__NAV-222092", "variant_description": "Reminder Header dimensions should override only Global Dimension 1, not Global Dimension 2", "failure_layer": null, "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 47f98ea..dd8d950 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,87 @@ 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 825eb23..9ff5910 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+ 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 apply only to additional fee entries, not all entries", "failure_layer": null, "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 47f98ea..f787e3b 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+ 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 825eb23..7eaaced 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,9 @@ 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-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.", "failure_layer": "L2-execution-validation", "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 df8ad3b..5cb9911 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\"::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;\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Warehouse/Activity/WhseActivityRegister.Codeunit.al b/App/Layers/W1/BaseApp/Warehouse/Activity/WhseActivityRegister.Codeunit.al\nindex 06bc640..030ae8d 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,43 @@ 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-222488__cf-1", "base_instance_id": "microsoftInternal__NAV-222488", "variant_description": "Registration should include all lines only for Purchase Order source documents; other sources respect filter.", "failure_layer": "L4-workflow-business-logic", "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 d40ac8d..eecdbb9 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\";\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Warehouse/Activity/WhsePutawaySubform.Page.al b/App/Layers/W1/BaseApp/Warehouse/Activity/WhsePutawaySubform.Page.al\nindex 07db37f..3f0a341 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,19 @@ 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+ (Rec.\"Source Document\" = Rec.\"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-223202__cf-1", "base_instance_id": "microsoftInternal__NAV-223202", "variant_description": "Manufacturing overhead only calculated when opening the Production Order Statistics page", "failure_layer": null, "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 57db27035466..babcca7115f7 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 ProdBOMNo: Code[20];\n CountError: Label 'Version Count Must Match.';\n OverHeadCostErr: Label 'Overhead Cost must be %1 in %2.', Comment = '%1= Field Value, %2= FieldCaption.';\n+ OverheadOnlyOnStatsErr: Label 'Manufacturing overhead is only calculated when opening the Statistics page';\n \n [Normal]\n local procedure Initialize()\n@@ -609,6 +610,75 @@ codeunit 137210 \"SCM Copy Production BOM\"\n ProductionOrderStatistics.MfgOverhead_ExpectedCost.Caption()));\n end;\n \n+ [Test]\n+ procedure FirmedProdOrderStatisticsCheckOverhead()\n+ var\n+ ParentItem: Record Item;\n+ RawItem: Record Item;\n+ ProductionOrder: Record \"Production Order\";\n+ ProdOrderLine: Record \"Prod. Order Line\";\n+ ProductionBOMHeader: Record \"Production BOM Header\";\n+ ProductionBOMLine: Record \"Production BOM Line\";\n+ FirmedProductionOrder: TestPage \"Firm Planned Prod. Order\";\n+ ProductionOrderStatistics: TestPage \"Production Order Statistics\";\n+ MfgOverheadExpectedCost: Decimal;\n+ MfgOverheadExpectedCost1: Decimal;\n+ Quantity: Decimal;\n+ begin\n+ // [SCENARIO 593018] Manufacturing overhead is wrong in the production order statistics page (99000816) and report (99000791).\n+ Initialize();\n+\n+ // [GIVEN] Create Raw Item with specified Unit Cost\n+ CreateItem(RawItem, 0, 0);\n+ RawItem.Validate(Type, RawItem.Type::Inventory);\n+ RawItem.Validate(\"Unit Cost\", LibraryRandom.RandIntInRange(100, 100));\n+ RawItem.Modify(true);\n+\n+ // [GIVEN] Create Production BOM and add Raw Item with Qty = 1\n+ LibraryManufacturing.CreateProductionBOMHeader(ProductionBOMHeader, RawItem.\"Base Unit of Measure\");\n+ LibraryManufacturing.CreateProductionBOMLine(ProductionBOMHeader, ProductionBOMLine, '', ProductionBOMLine.Type::Item, RawItem.\"No.\", 1);\n+ ProductionBOMHeader.Validate(\"Unit of Measure Code\", RawItem.\"Base Unit of Measure\");\n+ ProductionBOMHeader.Validate(Status, ProductionBOMHeader.Status::Certified);\n+ ProductionBOMHeader.Modify(true);\n+\n+ // [GIVEN] Create Parent Item with Indirect Cost % and link to BOM\n+ CreateItem(ParentItem, 0, 0);\n+ ParentItem.Validate(\"Indirect Cost %\", LibraryRandom.RandIntInRange(10, 10));\n+ ParentItem.Validate(\"Production BOM No.\", ProductionBOMHeader.\"No.\");\n+ ParentItem.Modify(true);\n+\n+ // [GIVEN] Store Quantity in Variable.\n+ Quantity := LibraryRandom.RandIntInRange(20, 20);\n+\n+ // [GIVEN] Create Firm Planned Production Order for Parent Item\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+\n+ // [WHEN] Refresh Prod Order with Lines = false (header only)\n+ LibraryManufacturing.RefreshProdOrder(ProductionOrder, false, false, true, true, false);\n+\n+ MfgOverheadExpectedCost := (RawItem.\"Unit Cost\" * ParentItem.\"Indirect Cost %\" / 100 * Quantity);\n+\n+ // [WHEN] Open Firmed Prod Order Statistics page\n+ FirmedProductionOrder.OpenEdit();\n+ FirmedProductionOrder.GoToRecord(ProductionOrder);\n+ ProductionOrderStatistics.Trap();\n+ FirmedProductionOrder.Statistics.Invoke();\n+\n+ // [THEN] Get Mfg Overhead Expected Cost\n+ Evaluate(MfgOverheadExpectedCost1, ProductionOrderStatistics.MfgOverhead_ExpectedCost.Value());\n+\n+ // [ASSERT] Overhead in statistics equals expected overhead\n+ Assert.AreEqual(\n+ MfgOverheadExpectedCost,\n+ MfgOverheadExpectedCost1,\n+ StrSubstNo(OverheadOnlyOnStatsErr));\n+\n+ end;\n+\n [Normal]\n local procedure CreateProductionBOM(var ProductionBOMHeader: Record \"Production BOM Header\")\n var\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 84769ae059dd..69d210e7af9f 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@@ -305,9 +305,9 @@ codeunit 99000758 \"Mfg. Cost Calculation Mgt.\"\n ExpSubDirCost := ExpSubDirCost + Round(ExpSubDirCostRtng * ShareOfTotalCapCost);\n ExpCapOvhdCost := ExpCapOvhdCost + Round(ExpCapOvhdCostRtng * ShareOfTotalCapCost);\n ExpMfgDirCost := ExpMatCost + ExpCapDirCost + ExpSubDirCost + ExpCapOvhdCost;\n- ExpOvhdCost := ExpMfgOvhdCost + ProdOrderLine.\"Overhead Rate\" * ProdOrderLine.\"Quantity (Base)\";\n- ExpMfgOvhdCost := ExpOvhdCost +\n- Round(CostCalculationMgt.CalcOvhdCost(ExpMfgDirCost, ProdOrderLine.\"Indirect Cost %\", 0, 0));\n+ ExpOvhdCost := ExpMfgOvhdCost;\n+ ExpMfgOvhdCost :=\n+ Round(CostCalculationMgt.CalcOvhdCost(ExpMfgDirCost, ProdOrderLine.\"Indirect Cost %\", ProdOrderLine.\"Overhead Rate\", ProdOrderLine.\"Quantity (Base)\"));\n \n OnAfterCalcProdOrderLineExpCost(ProdOrderLine, ShareOfTotalCapCost, ExpMatCost, ExpCapDirCost, ExpSubDirCost, ExpCapOvhdCost, ExpMfgOvhdCost);\n #if not CLEAN26\n"} +{"instance_id": "microsoftInternal__NAV-223493__cf-1", "base_instance_id": "microsoftInternal__NAV-223493", "variant_description": "Only update Customer Ledger Entry when entry is not on hold", "failure_layer": "L5-toolchain-ecosystem", "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\nindex b2cb6ea..ec49612 100644\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 @@ codeunit 134658 \"Edit Posted Documents\"\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@@ -996,6 +998,48 @@ codeunit 134658 \"Edit Posted Documents\"\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 local procedure Initialize()\n begin\n LibraryTestInitialize.OnTestInitialize(Codeunit::\"Edit Posted Documents\");\n@@ -1535,6 +1579,14 @@ codeunit 134658 \"Edit Posted Documents\"\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\nindex 6a5f0a8..bb4a252 100644\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 @@ codeunit 1409 \"Sales Inv. Header - Edit\"\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\nindex c64fa94..546c3b5 100644\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 @@ codeunit 103 \"Cust. Entry-Edit\"\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 @@ codeunit 103 \"Cust. Entry-Edit\"\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-223790__cf-1", "base_instance_id": "microsoftInternal__NAV-223790", "variant_description": "CalcLevels called with parameter 0 instead of 1; API semantic misuse in LLC calculation", "failure_layer": null, "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, false);\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, false);\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(0, 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", "problem_statement_override": null} +{"instance_id": "microsoftInternal__NAV-224447__cf-1", "base_instance_id": "microsoftInternal__NAV-224447", "variant_description": "Email customer relationship uses correct field name for issued reminders", "failure_layer": "L4-workflow-business-logic", "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\nindex 1667c4a..9d5776b 100644\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 local procedure CreateReminderAttachmentText(ReminderTerms: Record \"Reminder Terms\"; LanguageCode: Code[10])\n var\n ReminderLevel: Record \"Reminder Level\";\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 [ModalPageHandler()]\n procedure CreateRemindersSetupModalPageHandler(var CreateRemindersSetup: TestPage \"Create Reminders Setup\")\n begin\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 }\n\\ No newline at end of file\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Foundation/Reporting/ReportSelections.Table.al b/App/Layers/W1/BaseApp/Foundation/Reporting/ReportSelections.Table.al\nindex 7a71beb..51b6e44 100644\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,9 @@ 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\" then\n+ FieldName := '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-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", "failure_layer": null, "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)", "failure_layer": null, "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)", "failure_layer": null, "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-226875__cf-1", "base_instance_id": "microsoftInternal__NAV-226875", "variant_description": "Vendor Name should be populated only when Account Type is Vendor AND Document Type is Invoice", "failure_layer": "L4-workflow-business-logic", "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,59 @@ 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-227153__cf-1", "base_instance_id": "microsoftInternal__NAV-227153", "variant_description": "Only include entries matching the customer's current posting group", "failure_layer": "L2-execution-validation", "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,5 +484,6 @@ 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,5 +506,6 @@ 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,5 +529,6 @@ 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", "failure_layer": "L4-workflow-business-logic", "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-227219__cf-1", "base_instance_id": "microsoftInternal__NAV-227219", "variant_description": "Validation only when status is Open", "failure_layer": null, "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\nindex f3c55b5..7c57e6c 100644\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@@ -4096,6 +4097,59 @@\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 with variant set\n+ LibraryInventory.CreateTransferHeader(TransferHeader, FromLocation.Code, ToLocation.Code, InTransitLocation.Code);\n+ LibraryInventory.CreateTransferLine(TransferHeader, TransferLine, Item.\"No.\", LibraryRandom.RandIntInRange(10, 100));\n+ TransferLine.Validate(\"Variant Code\", ItemVariant[1].Code);\n+ TransferLine.Modify(true);\n+\n+ // [GIVEN] Release the transfer order (succeeds because variant is set)\n+ LibraryWarehouse.ReleaseTransferOrder(TransferHeader);\n+\n+ // [GIVEN] Reopen and clear variant code\n+ LibraryWarehouse.ReopenTransferOrder(TransferHeader);\n+ TransferLine.Get(TransferLine.\"Document No.\", TransferLine.\"Line No.\");\n+ TransferLine.Validate(\"Variant Code\", '');\n+ TransferLine.Modify(true);\n+\n+ // [WHEN] Try to release again with missing variant (status is Open)\n+ asserterror LibraryWarehouse.ReleaseTransferOrder(TransferHeader);\n+\n+ // [THEN] Assert error: variant code is mandatory\n+ Assert.ExpectedError(\n+ StrSubstNo(\n+ VariantCodeMandatoryErr,\n+ TransferLine.FieldCaption(\"Variant Code\"), TransferLine.TableCaption(),\n+ TransferLine.\"Document No.\", TransferLine.\"Line No.\"));\n+ end;\n+\n local procedure Initialize()\n var\n LibraryERMCountryData: Codeunit \"Library - ERM Country Data\";\n@@ -5649,6 +5703,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 local procedure FindAndUpdateTransferPickWarehouseActivityLine(var WarehouseActivityLine: Record \"Warehouse Activity Line\"; Item: Record Item)\n begin\n WarehouseActivityLine.SetRange(\"Item No.\", Item.\"No.\");\n", "patch": "diff --git a/App/Layers/W1/BaseApp/Inventory/Transfer/ReleaseTransferDocument.Codeunit.al b/App/Layers/W1/BaseApp/Inventory/Transfer/ReleaseTransferDocument.Codeunit.al\nindex 979cdb4..32adab0 100644\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 @@ codeunit 5708 \"Release Transfer Document\"\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 @@ codeunit 5708 \"Release Transfer Document\"\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", "failure_layer": null, "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,26 @@ 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": "Unlinking should not be executed during posting; inline unlink logic replaced with exit", "failure_layer": null, "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 8260147..4f5cd01 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+ // [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 +1973,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 61aff66..6e2b64a 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 \n local procedure CopyGenJnlLineBalancingData(var GenJnlLineTo: Record \"Gen. Journal Line\"; var GenJnlLineFrom: Record \"Gen. Journal Line\")\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", "failure_layer": null, "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-4822__cf-1", "base_instance_id": "microsoft__BCApps-4822", "variant_description": "Bill-to Customer No. should always be copied, even if it is empty", "failure_layer": null, "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 and Bill-to Customer No. populated from Customer record during company location creation", "failure_layer": null, "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 be8c01c..fc9694f 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@@ -49,7 +50,7 @@ codeunit 139539 \"Shpfy Company Locations Test\"\n CompanyAPI.SetShop(Shop);\n CompanyAPI.CreateCustomerAsCompanyLocation(Customer, ShopifyCompany, ShopifyCustomer);\n \n- // [THEN] Company location should be created successfully\n+ // [THEN] Company location should be created with Sell-to and Bill-to populated\n #pragma warning disable AA0210\n CompanyLocation.SetRange(\"Customer Id\", Customer.SystemId);\n #pragma warning restore AA0210\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 with Sell-to and Bill-to populated\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(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 2d20144..e1d2db3 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-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", "failure_layer": null, "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"} diff --git a/dataset/problemstatement/microsoftInternal__NAV-174087__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-174087__cf-1/README.md new file mode 100644 index 000000000..1ad427195 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-174087__cf-1/README.md @@ -0,0 +1,17 @@ +# Title: "Evaluation" field not saved due to workflow step order — CopyFromSegment must precede Modify +## Repro Steps: +1. Open Contacts list and select a Contact +2. Open Contact Card +3. Use "Create Interaction" action +4. Fill in Interaction Template Code, click Next twice +5. Set Evaluation to Positive +6. Click Finish +7. Check Interaction Log Entries for the Contact + +Result: Evaluation field is blank in the Interaction Log Entry. + +Expected: Evaluation should be "Positive" as entered in the wizard. + +## Description: +Variant of NAV-174087 (L4: workflow step order). The wizard Step 4 must call CopyFromSegment(Rec) BEFORE Modify() so that segment line data (including Evaluation) is written to the Interaction Log Entry record before it is persisted. If the order is reversed (Modify first, CopyFromSegment after), the DB save happens with stale data. +Variant of NAV-174087 where the Evaluation is set to Negative instead of Positive. The fix should directly assign the Evaluation field from the segment line record to the Interaction Log Entry, rather than using the bulk CopyFromSegment call. This tests that the fix works for non-default enum values and exercises a narrower field-level persistence path. diff --git a/dataset/problemstatement/microsoftInternal__NAV-174087__cf-1/contact-card-2.png b/dataset/problemstatement/microsoftInternal__NAV-174087__cf-1/contact-card-2.png new file mode 100644 index 000000000..b8e57df5f Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-174087__cf-1/contact-card-2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-174087__cf-1/contact-card.png b/dataset/problemstatement/microsoftInternal__NAV-174087__cf-1/contact-card.png new file mode 100644 index 000000000..da6a647b3 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-174087__cf-1/contact-card.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-174087__cf-1/contacts.png b/dataset/problemstatement/microsoftInternal__NAV-174087__cf-1/contacts.png new file mode 100644 index 000000000..8216a66b1 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-174087__cf-1/contacts.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-174087__cf-1/create-interaction-1.png b/dataset/problemstatement/microsoftInternal__NAV-174087__cf-1/create-interaction-1.png new file mode 100644 index 000000000..803a5545a Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-174087__cf-1/create-interaction-1.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-174087__cf-1/create-interaction-2.png b/dataset/problemstatement/microsoftInternal__NAV-174087__cf-1/create-interaction-2.png new file mode 100644 index 000000000..1369c2a3b Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-174087__cf-1/create-interaction-2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-174087__cf-1/create-interaction-3.png b/dataset/problemstatement/microsoftInternal__NAV-174087__cf-1/create-interaction-3.png new file mode 100644 index 000000000..4b5b69918 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-174087__cf-1/create-interaction-3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-174087__cf-1/interaction-log-entries-2.png b/dataset/problemstatement/microsoftInternal__NAV-174087__cf-1/interaction-log-entries-2.png new file mode 100644 index 000000000..1cf64c1b5 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-174087__cf-1/interaction-log-entries-2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-174087__cf-1/interaction-log-entries.png b/dataset/problemstatement/microsoftInternal__NAV-174087__cf-1/interaction-log-entries.png new file mode 100644 index 000000000..be4191561 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-174087__cf-1/interaction-log-entries.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-174087__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-174087__cf-2/README.md new file mode 100644 index 000000000..8529b4cce --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-174087__cf-2/README.md @@ -0,0 +1,19 @@ +# Title: "Evaluation" field must be persisted via record trigger, not page workflow step +## Repro Steps: +1. Open Contacts list and select a Contact +2. Open Contact Card +3. Use "Create Interaction" action +4. Fill in Interaction Template Code, click Next twice +5. Set Evaluation to Positive +6. Click Finish +7. Check Interaction Log Entries for the Contact + +Result: Evaluation field is blank in the Interaction Log Entry. + +Expected: Evaluation should be "Positive" — persisted automatically via an OnModify trigger on the Interaction Log Entry table, independent of the page wizard workflow. + +## Description: +Variant of NAV-174087 (L3: trigger-based persistence). Instead of relying on the page wizard Step 4 to explicitly call CopyFromSegment, the Evaluation field should be persisted through a record lifecycle trigger (OnModify) on the Interaction Log Entry table. This shifts persistence responsibility from the UI workflow layer to the data layer, making it robust against page flow changes. + +## Description: +Variant of NAV-174087 where the test additionally verifies that the Initiation Type field is persisted alongside Evaluation. This requires the full CopyFromSegment call rather than a narrower field-level fix, testing that the complete segment data flows through the record lifecycle into the Interaction Log Entry. diff --git a/dataset/problemstatement/microsoftInternal__NAV-174087__cf-2/contact-card-2.png b/dataset/problemstatement/microsoftInternal__NAV-174087__cf-2/contact-card-2.png new file mode 100644 index 000000000..b8e57df5f Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-174087__cf-2/contact-card-2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-174087__cf-2/contact-card.png b/dataset/problemstatement/microsoftInternal__NAV-174087__cf-2/contact-card.png new file mode 100644 index 000000000..da6a647b3 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-174087__cf-2/contact-card.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-174087__cf-2/contacts.png b/dataset/problemstatement/microsoftInternal__NAV-174087__cf-2/contacts.png new file mode 100644 index 000000000..8216a66b1 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-174087__cf-2/contacts.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-174087__cf-2/create-interaction-1.png b/dataset/problemstatement/microsoftInternal__NAV-174087__cf-2/create-interaction-1.png new file mode 100644 index 000000000..803a5545a Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-174087__cf-2/create-interaction-1.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-174087__cf-2/create-interaction-2.png b/dataset/problemstatement/microsoftInternal__NAV-174087__cf-2/create-interaction-2.png new file mode 100644 index 000000000..1369c2a3b Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-174087__cf-2/create-interaction-2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-174087__cf-2/create-interaction-3.png b/dataset/problemstatement/microsoftInternal__NAV-174087__cf-2/create-interaction-3.png new file mode 100644 index 000000000..4b5b69918 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-174087__cf-2/create-interaction-3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-174087__cf-2/interaction-log-entries-2.png b/dataset/problemstatement/microsoftInternal__NAV-174087__cf-2/interaction-log-entries-2.png new file mode 100644 index 000000000..1cf64c1b5 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-174087__cf-2/interaction-log-entries-2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-174087__cf-2/interaction-log-entries.png b/dataset/problemstatement/microsoftInternal__NAV-174087__cf-2/interaction-log-entries.png new file mode 100644 index 000000000..be4191561 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-174087__cf-2/interaction-log-entries.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-174794__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-174794__cf-1/README.md new file mode 100644 index 000000000..212b5c026 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-174794__cf-1/README.md @@ -0,0 +1,35 @@ +# Title: Allow Multiple Posting Groups setting is ignored during Finance Charge Memo posting +## Repro Steps: +**Detailed Repro** + +This was reproduced on a SE environment V23.3 (Same as cx environment), but it is a W1 issue. +Also reproduced in other country versions (ES) +![Troubleshooting](./troubleshooting.png) + +>>> go to `Sales & Receivables Setup` - the Allow Multiple Posting Groups setting is ignored during Finance Charge Memo posting. +![Sales & Receivables Setup](./sales-receivables-seutp.png) + +>>> Go to customer card to enable Allow multiple posting group. Also take note of the Customer posting group +![Customer Card](./customer-card.png) + +>>> Go to "customer Posting Groups" CPG >> On INRIKES >> Related >> Alternative Groups +![Customer Posting Groups](./customer-posting-group.png) + +![Alternative Customer Posting Groups](./alternative-customer-posting-groups.png) + +From the Screenshot above we can see that UTRIKES and INRIKES has different G/L Acct in the Receivables Account. + +>>> Go to Fin charge Memo +![Finance Charege Memo](./finance-charge-memo.png) + +Fill the fields as shown in the image above then click on Issue, a wizard should pop up click okay. + +================== +ACTUAL RESULTS +================== +The Allow Multiple Posting Groups setting is ignored, so the posting group from the header is not applied. + +================== +EXPECTED RESULTS +================== +The Allow Multiple Posting Groups setting should control whether alternate posting groups are used during Finance Charge Memo posting. diff --git a/dataset/problemstatement/microsoftInternal__NAV-174794__cf-1/alternative-customer-posting-groups.png b/dataset/problemstatement/microsoftInternal__NAV-174794__cf-1/alternative-customer-posting-groups.png new file mode 100644 index 000000000..2615d0cdf Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-174794__cf-1/alternative-customer-posting-groups.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-174794__cf-1/customer-card.png b/dataset/problemstatement/microsoftInternal__NAV-174794__cf-1/customer-card.png new file mode 100644 index 000000000..172752d8e Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-174794__cf-1/customer-card.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-174794__cf-1/customer-posting-group.png b/dataset/problemstatement/microsoftInternal__NAV-174794__cf-1/customer-posting-group.png new file mode 100644 index 000000000..dabb4514b Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-174794__cf-1/customer-posting-group.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-174794__cf-1/finance-charge-memo.png b/dataset/problemstatement/microsoftInternal__NAV-174794__cf-1/finance-charge-memo.png new file mode 100644 index 000000000..5534d4101 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-174794__cf-1/finance-charge-memo.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-174794__cf-1/gl-entries.png b/dataset/problemstatement/microsoftInternal__NAV-174794__cf-1/gl-entries.png new file mode 100644 index 000000000..66ce1f905 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-174794__cf-1/gl-entries.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-174794__cf-1/sales-receivables-seutp.png b/dataset/problemstatement/microsoftInternal__NAV-174794__cf-1/sales-receivables-seutp.png new file mode 100644 index 000000000..7f62df53b Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-174794__cf-1/sales-receivables-seutp.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-174794__cf-1/troubleshooting.png b/dataset/problemstatement/microsoftInternal__NAV-174794__cf-1/troubleshooting.png new file mode 100644 index 000000000..e97a5b8d8 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-174794__cf-1/troubleshooting.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-174794__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-174794__cf-2/README.md new file mode 100644 index 000000000..3c8d47f12 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-174794__cf-2/README.md @@ -0,0 +1,35 @@ +# Title: Allow Multiple Posting Groups does not work as expected with Fin. Charge Memos +## Repro Steps: +**Detailed Repro** + +This was reproduced on a SE environment V23.3 (Same as cx environment), but it is a W1 issue. +Also reproduced in other country versions (ES) +![Troubleshooting](./troubleshooting.png) + +>>> go to `Sales & Receivables Setup` to enable multiple posting groups. +![Sales & Receivables Setup](./sales-receivables-seutp.png) + +>>> Go to customer card to enable Allow multiple posting group. Also take note of the Customer posting group +![Customer Card](./customer-card.png) + +>>> Go to "customer Posting Groups" CPG >> On INRIKES >> Related >> Alternative Groups +![Customer Posting Groups](./customer-posting-group.png) + +![Alternative Customer Posting Groups](./alternative-customer-posting-groups.png) + +From the Screenshot above we can see that UTRIKES and INRIKES has different G/L Acct in the Receivables Account. + +>>> Go to Fin charge Memo +![Finance Charege Memo](./finance-charge-memo.png) + +Fill the fields as shown in the image above then click on Issue, a wizard should pop up click okay. + +================== +ACTUAL RESULTS +================== +The G/L Account is determined without applying the Finance Charge Memo posting group to the journal line. + +================== +EXPECTED RESULTS +================== +The G/L Account should be the one under UTRIKES Customer Posting Group, and not take the one from INRIKES (the original posting group) diff --git a/dataset/problemstatement/microsoftInternal__NAV-174794__cf-2/alternative-customer-posting-groups.png b/dataset/problemstatement/microsoftInternal__NAV-174794__cf-2/alternative-customer-posting-groups.png new file mode 100644 index 000000000..2615d0cdf Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-174794__cf-2/alternative-customer-posting-groups.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-174794__cf-2/customer-card.png b/dataset/problemstatement/microsoftInternal__NAV-174794__cf-2/customer-card.png new file mode 100644 index 000000000..172752d8e Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-174794__cf-2/customer-card.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-174794__cf-2/customer-posting-group.png b/dataset/problemstatement/microsoftInternal__NAV-174794__cf-2/customer-posting-group.png new file mode 100644 index 000000000..dabb4514b Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-174794__cf-2/customer-posting-group.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-174794__cf-2/finance-charge-memo.png b/dataset/problemstatement/microsoftInternal__NAV-174794__cf-2/finance-charge-memo.png new file mode 100644 index 000000000..5534d4101 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-174794__cf-2/finance-charge-memo.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-174794__cf-2/gl-entries.png b/dataset/problemstatement/microsoftInternal__NAV-174794__cf-2/gl-entries.png new file mode 100644 index 000000000..66ce1f905 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-174794__cf-2/gl-entries.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-174794__cf-2/sales-receivables-seutp.png b/dataset/problemstatement/microsoftInternal__NAV-174794__cf-2/sales-receivables-seutp.png new file mode 100644 index 000000000..7f62df53b Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-174794__cf-2/sales-receivables-seutp.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-174794__cf-2/troubleshooting.png b/dataset/problemstatement/microsoftInternal__NAV-174794__cf-2/troubleshooting.png new file mode 100644 index 000000000..e97a5b8d8 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-174794__cf-2/troubleshooting.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-174794__cf-3/README.md b/dataset/problemstatement/microsoftInternal__NAV-174794__cf-3/README.md new file mode 100644 index 000000000..d618262c9 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-174794__cf-3/README.md @@ -0,0 +1,35 @@ +# Title: Allow Multiple Posting Groups does not work as expected with Fin. Charge Memos +## Repro Steps: +**Detailed Repro** + +This was reproduced on a SE environment V23.3 (Same as cx environment), but it is a W1 issue. +Also reproduced in other country versions (ES) +![Troubleshooting](./troubleshooting.png) + +>>> go to `Sales & Receivables Setup` to enable multiple posting groups. +![Sales & Receivables Setup](./sales-receivables-seutp.png) + +>>> Go to customer card to enable Allow multiple posting group. Also take note of the Customer posting group +![Customer Card](./customer-card.png) + +>>> Go to "customer Posting Groups" CPG >> On INRIKES >> Related >> Alternative Groups +![Customer Posting Groups](./customer-posting-group.png) + +![Alternative Customer Posting Groups](./alternative-customer-posting-groups.png) + +From the Screenshot above we can see that UTRIKES and INRIKES has different G/L Acct in the Receivables Account. + +>>> Go to Fin charge Memo +![Finance Charege Memo](./finance-charge-memo.png) + +Fill the fields as shown in the image above then click on Issue, a wizard should pop up click okay. + +================== +ACTUAL RESULTS +================== +The G/L Account is derived from the customer's default posting group instead of the selected Finance Charge Memo posting group. + +================== +EXPECTED RESULTS +================== +The G/L Account should be the one under UTRIKES Customer Posting Group that was selected on the Finance Charge Memo, not the customer's default posting group. diff --git a/dataset/problemstatement/microsoftInternal__NAV-174794__cf-3/alternative-customer-posting-groups.png b/dataset/problemstatement/microsoftInternal__NAV-174794__cf-3/alternative-customer-posting-groups.png new file mode 100644 index 000000000..2615d0cdf Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-174794__cf-3/alternative-customer-posting-groups.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-174794__cf-3/customer-card.png b/dataset/problemstatement/microsoftInternal__NAV-174794__cf-3/customer-card.png new file mode 100644 index 000000000..172752d8e Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-174794__cf-3/customer-card.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-174794__cf-3/customer-posting-group.png b/dataset/problemstatement/microsoftInternal__NAV-174794__cf-3/customer-posting-group.png new file mode 100644 index 000000000..dabb4514b Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-174794__cf-3/customer-posting-group.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-174794__cf-3/finance-charge-memo.png b/dataset/problemstatement/microsoftInternal__NAV-174794__cf-3/finance-charge-memo.png new file mode 100644 index 000000000..5534d4101 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-174794__cf-3/finance-charge-memo.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-174794__cf-3/gl-entries.png b/dataset/problemstatement/microsoftInternal__NAV-174794__cf-3/gl-entries.png new file mode 100644 index 000000000..66ce1f905 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-174794__cf-3/gl-entries.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-174794__cf-3/sales-receivables-seutp.png b/dataset/problemstatement/microsoftInternal__NAV-174794__cf-3/sales-receivables-seutp.png new file mode 100644 index 000000000..7f62df53b Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-174794__cf-3/sales-receivables-seutp.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-174794__cf-3/troubleshooting.png b/dataset/problemstatement/microsoftInternal__NAV-174794__cf-3/troubleshooting.png new file mode 100644 index 000000000..e97a5b8d8 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-174794__cf-3/troubleshooting.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-175765__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-175765__cf-1/README.md new file mode 100644 index 000000000..7b9fe30ce --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-175765__cf-1/README.md @@ -0,0 +1,9 @@ +# Title: Posted Transfer Shipment - Undo Shipment function - valuation issue +## Repro Steps: +We encountered an error when using Undo Shipment function from Posted Transfer Shipment. +If, after posting the transfer shipment, a revaluation of the original item ledger entry that was used to apply the shipment is performed and then the transfer shipment is returned using the Undo Shipment function without running cost adjustment, then the item ledger entry created by this function is not correctly valued. + +![Item Ledger Entries](./item-ledger-entries.png) + +## Description: +Undo posted transfer shipment without running cost adjustment results in old cost being used. diff --git a/dataset/problemstatement/microsoftInternal__NAV-175765__cf-1/item-ledger-entries.png b/dataset/problemstatement/microsoftInternal__NAV-175765__cf-1/item-ledger-entries.png new file mode 100644 index 000000000..1290be764 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-175765__cf-1/item-ledger-entries.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-175765__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-175765__cf-2/README.md new file mode 100644 index 000000000..aa81d87c9 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-175765__cf-2/README.md @@ -0,0 +1,9 @@ +# Title: Posted Transfer Shipment - Undo Shipment function - valuation issue +## Repro Steps: +We encountered an error when using Undo Shipment function from Posted Transfer Shipment. +If, after posting the transfer shipment, a revaluation of the original item ledger entry that was used to apply the shipment is performed, the cost adjustment should be run before undoing the transfer shipment to propagate the revalued cost. + +![Item Ledger Entries](./item-ledger-entries.png) + +## Description: +Run the cost adjustment before undoing the transfer shipment to ensure correct cost propagation. diff --git a/dataset/problemstatement/microsoftInternal__NAV-175765__cf-2/item-ledger-entries.png b/dataset/problemstatement/microsoftInternal__NAV-175765__cf-2/item-ledger-entries.png new file mode 100644 index 000000000..1290be764 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-175765__cf-2/item-ledger-entries.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-175765__cf-3/README.md b/dataset/problemstatement/microsoftInternal__NAV-175765__cf-3/README.md new file mode 100644 index 000000000..84413e9a6 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-175765__cf-3/README.md @@ -0,0 +1,9 @@ +# Title: Posted Transfer Shipment - Undo Shipment function - valuation issue +## Repro Steps: +We encountered an error when using Undo Shipment function from Posted Transfer Shipment. +If, after posting the transfer shipment, a revaluation of the original item ledger entry that was used to apply the shipment is performed and then the transfer shipment is returned using the Undo Shipment function, then the item ledger entry should be valued at the revalued cost only if revaluation was applied before undo. + +![Item Ledger Entries](./item-ledger-entries.png) + +## Description: +Cost adjustment after undo should only apply revalued cost when revaluation exists for the original entry. diff --git a/dataset/problemstatement/microsoftInternal__NAV-175765__cf-3/item-ledger-entries.png b/dataset/problemstatement/microsoftInternal__NAV-175765__cf-3/item-ledger-entries.png new file mode 100644 index 000000000..1290be764 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-175765__cf-3/item-ledger-entries.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-176082__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-176082__cf-1/README.md new file mode 100644 index 000000000..fe0312dc5 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-176082__cf-1/README.md @@ -0,0 +1,10 @@ +# Title: Get Posted Purchase Receipt Lines on Transfer Order - location filtering +## Repro Steps: +Get Receipt Lines action on Transfer Order shows only receipts with matching header location, not line-level location. + +![Posted Purchase Receipts](./posted-purchase-receipts.png) + +Only receipts where the header Location Code matches Transfer-from Code are shown. + +## Description: +Only receipts with matching header location are shown in Get Receipt Lines. diff --git a/dataset/problemstatement/microsoftInternal__NAV-176082__cf-1/get-receipt-lines.png b/dataset/problemstatement/microsoftInternal__NAV-176082__cf-1/get-receipt-lines.png new file mode 100644 index 000000000..2586fa99f Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-176082__cf-1/get-receipt-lines.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-176082__cf-1/item-ledger-entries.png b/dataset/problemstatement/microsoftInternal__NAV-176082__cf-1/item-ledger-entries.png new file mode 100644 index 000000000..3338e3cc0 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-176082__cf-1/item-ledger-entries.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-176082__cf-1/lines.png b/dataset/problemstatement/microsoftInternal__NAV-176082__cf-1/lines.png new file mode 100644 index 000000000..1159f008d Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-176082__cf-1/lines.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-176082__cf-1/posted-purchase-document-lines.png b/dataset/problemstatement/microsoftInternal__NAV-176082__cf-1/posted-purchase-document-lines.png new file mode 100644 index 000000000..6572e9d4f Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-176082__cf-1/posted-purchase-document-lines.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-176082__cf-1/posted-purchase-receipt-line.png b/dataset/problemstatement/microsoftInternal__NAV-176082__cf-1/posted-purchase-receipt-line.png new file mode 100644 index 000000000..8beca338f Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-176082__cf-1/posted-purchase-receipt-line.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-176082__cf-1/posted-purchase-receipts.png b/dataset/problemstatement/microsoftInternal__NAV-176082__cf-1/posted-purchase-receipts.png new file mode 100644 index 000000000..051279233 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-176082__cf-1/posted-purchase-receipts.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-176082__cf-1/purchase-return-order.png b/dataset/problemstatement/microsoftInternal__NAV-176082__cf-1/purchase-return-order.png new file mode 100644 index 000000000..a69459f59 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-176082__cf-1/purchase-return-order.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-176082__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-176082__cf-2/README.md new file mode 100644 index 000000000..2994438e1 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-176082__cf-2/README.md @@ -0,0 +1,10 @@ +# Title: Get Posted Purchase Receipt Lines on Transfer Order - header location required +## Repro Steps: +Purchase receipts must have location defined on header to be selectable via Get Receipt Lines on Transfer Order. + +![Posted Purchase Receipts](./posted-purchase-receipts.png) + +Receipts with location only on lines are not considered valid sources. + +## Description: +Purchase receipts must have location defined on header to be selectable. diff --git a/dataset/problemstatement/microsoftInternal__NAV-176082__cf-2/get-receipt-lines.png b/dataset/problemstatement/microsoftInternal__NAV-176082__cf-2/get-receipt-lines.png new file mode 100644 index 000000000..2586fa99f Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-176082__cf-2/get-receipt-lines.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-176082__cf-2/item-ledger-entries.png b/dataset/problemstatement/microsoftInternal__NAV-176082__cf-2/item-ledger-entries.png new file mode 100644 index 000000000..3338e3cc0 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-176082__cf-2/item-ledger-entries.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-176082__cf-2/lines.png b/dataset/problemstatement/microsoftInternal__NAV-176082__cf-2/lines.png new file mode 100644 index 000000000..1159f008d Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-176082__cf-2/lines.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-176082__cf-2/posted-purchase-document-lines.png b/dataset/problemstatement/microsoftInternal__NAV-176082__cf-2/posted-purchase-document-lines.png new file mode 100644 index 000000000..6572e9d4f Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-176082__cf-2/posted-purchase-document-lines.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-176082__cf-2/posted-purchase-receipt-line.png b/dataset/problemstatement/microsoftInternal__NAV-176082__cf-2/posted-purchase-receipt-line.png new file mode 100644 index 000000000..8beca338f Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-176082__cf-2/posted-purchase-receipt-line.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-176082__cf-2/posted-purchase-receipts.png b/dataset/problemstatement/microsoftInternal__NAV-176082__cf-2/posted-purchase-receipts.png new file mode 100644 index 000000000..051279233 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-176082__cf-2/posted-purchase-receipts.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-176082__cf-2/purchase-return-order.png b/dataset/problemstatement/microsoftInternal__NAV-176082__cf-2/purchase-return-order.png new file mode 100644 index 000000000..a69459f59 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-176082__cf-2/purchase-return-order.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-176082__cf-3/README.md b/dataset/problemstatement/microsoftInternal__NAV-176082__cf-3/README.md new file mode 100644 index 000000000..c4fe9718c --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-176082__cf-3/README.md @@ -0,0 +1,10 @@ +# Title: Get Posted Purchase Receipt Lines on Transfer Order - Appl-to Item Entry validation +## Repro Steps: +Get Receipt Lines action on Transfer Order populates Appl-to Item Entry but the value is not validated correctly when saved. + +![Item Ledger Entries](./item-ledger-entries.png) + +The applies to ID is set but not validated correctly due to Modify(false). + +## Description: +Appl-to Item Entry set but not validated correctly. diff --git a/dataset/problemstatement/microsoftInternal__NAV-176082__cf-3/get-receipt-lines.png b/dataset/problemstatement/microsoftInternal__NAV-176082__cf-3/get-receipt-lines.png new file mode 100644 index 000000000..2586fa99f Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-176082__cf-3/get-receipt-lines.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-176082__cf-3/item-ledger-entries.png b/dataset/problemstatement/microsoftInternal__NAV-176082__cf-3/item-ledger-entries.png new file mode 100644 index 000000000..3338e3cc0 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-176082__cf-3/item-ledger-entries.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-176082__cf-3/lines.png b/dataset/problemstatement/microsoftInternal__NAV-176082__cf-3/lines.png new file mode 100644 index 000000000..1159f008d Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-176082__cf-3/lines.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-176082__cf-3/posted-purchase-document-lines.png b/dataset/problemstatement/microsoftInternal__NAV-176082__cf-3/posted-purchase-document-lines.png new file mode 100644 index 000000000..6572e9d4f Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-176082__cf-3/posted-purchase-document-lines.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-176082__cf-3/posted-purchase-receipt-line.png b/dataset/problemstatement/microsoftInternal__NAV-176082__cf-3/posted-purchase-receipt-line.png new file mode 100644 index 000000000..8beca338f Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-176082__cf-3/posted-purchase-receipt-line.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-176082__cf-3/posted-purchase-receipts.png b/dataset/problemstatement/microsoftInternal__NAV-176082__cf-3/posted-purchase-receipts.png new file mode 100644 index 000000000..051279233 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-176082__cf-3/posted-purchase-receipts.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-176082__cf-3/purchase-return-order.png b/dataset/problemstatement/microsoftInternal__NAV-176082__cf-3/purchase-return-order.png new file mode 100644 index 000000000..a69459f59 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-176082__cf-3/purchase-return-order.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-176150__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-176150__cf-1/README.md new file mode 100644 index 000000000..454ad6601 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-176150__cf-1/README.md @@ -0,0 +1,29 @@ +# Title: Preview Posting on Production Journal shows just Consumption line from the Consumption Journal +## Repro Steps: +1. Open BC23.4 W1 +2. Search for Released Production Order + Create a new Production Order + Source: 1000 + Quantity: 1 + Home -> Refresh Production Order +3. Select the created Line + Line -> Production Journal + Post -> Preview + Open Item Ledger Entries: + ![Item Ledger Entries Preview](./item-ledger-entries-preview.png) + This is correct +4. Search for Consumption Journal + Insert a Line as follows (from a totally different Production Order) + ![Consumption Journals](./consumption-journals.png) + Leave the Consumption Journal without posting +5. Go back to released Production Order + Line -> Production Journal -> Post Preview + +ACTUAL RESULT: +The posting preview includes entries for the same Production Order, regardless of item filtering. +![Error Message](./error-message.png) + +EXPECTED RESULT: +The Posting preview should include all entries for the same Production Order, regardless of item filtering. +## Description: +Preview Posting on Production Journal should filter by Production Order only diff --git a/dataset/problemstatement/microsoftInternal__NAV-176150__cf-1/consumption-journals.png b/dataset/problemstatement/microsoftInternal__NAV-176150__cf-1/consumption-journals.png new file mode 100644 index 000000000..e028aa4bf Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-176150__cf-1/consumption-journals.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-176150__cf-1/error-message.png b/dataset/problemstatement/microsoftInternal__NAV-176150__cf-1/error-message.png new file mode 100644 index 000000000..676787090 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-176150__cf-1/error-message.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-176150__cf-1/item-ledger-entries-preview.png b/dataset/problemstatement/microsoftInternal__NAV-176150__cf-1/item-ledger-entries-preview.png new file mode 100644 index 000000000..99a350e75 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-176150__cf-1/item-ledger-entries-preview.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-176150__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-176150__cf-2/README.md new file mode 100644 index 000000000..8c96b6a0f --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-176150__cf-2/README.md @@ -0,0 +1,29 @@ +# Title: Preview Posting on Production Journal shows just Consumption line from the Consumption Journal +## Repro Steps: +1. Open BC23.4 W1 +2. Search for Released Production Order + Create a new Production Order + Source: 1000 + Quantity: 1 + Home -> Refresh Production Order +3. Select the created Line + Line -> Production Journal + Post -> Preview + Open Item Ledger Entries: + ![Item Ledger Entries Preview](./item-ledger-entries-preview.png) + This is correct +4. Search for Consumption Journal + Insert a Line as follows (from a totally different Production Order) + ![Consumption Journals](./consumption-journals.png) + Leave the Consumption Journal without posting +5. Go back to released Production Order + Line -> Production Journal -> Post Preview + +ACTUAL RESULT: +The posting preview includes entries for the same Item No., even from different production orders. +![Error Message](./error-message.png) + +EXPECTED RESULT: +The Posting preview should include entries for the same Item No., even from different production orders. +## Description: +Preview Posting on Production Journal should filter by Item No only diff --git a/dataset/problemstatement/microsoftInternal__NAV-176150__cf-2/consumption-journals.png b/dataset/problemstatement/microsoftInternal__NAV-176150__cf-2/consumption-journals.png new file mode 100644 index 000000000..e028aa4bf Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-176150__cf-2/consumption-journals.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-176150__cf-2/error-message.png b/dataset/problemstatement/microsoftInternal__NAV-176150__cf-2/error-message.png new file mode 100644 index 000000000..676787090 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-176150__cf-2/error-message.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-176150__cf-2/item-ledger-entries-preview.png b/dataset/problemstatement/microsoftInternal__NAV-176150__cf-2/item-ledger-entries-preview.png new file mode 100644 index 000000000..99a350e75 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-176150__cf-2/item-ledger-entries-preview.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-176194__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-176194__cf-1/README.md new file mode 100644 index 000000000..0225d2cef --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-176194__cf-1/README.md @@ -0,0 +1,11 @@ +# Title: Item Charge throws error when pulled into Sales Return Order when Default Qty. to Ship is set to 'Blank' on Sales & Rec Setup +## Repro Steps: +Qty. to Invoice is not required when assigning item charges. The validation should not block the flow. + +![Sales Receivables Setup](./sales-receivables-setup.png) + +The Item Charge should be successfully assigned regardless of Qty. to Invoice value. + +![Item Charge Assignment](./item-charge-assignment.png) +## Description: +Qty. to Invoice validation removed from Item Charge Assignment. diff --git a/dataset/problemstatement/microsoftInternal__NAV-176194__cf-1/default-quantity-to-ship.png b/dataset/problemstatement/microsoftInternal__NAV-176194__cf-1/default-quantity-to-ship.png new file mode 100644 index 000000000..2ebc6c0c7 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-176194__cf-1/default-quantity-to-ship.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-176194__cf-1/error.png b/dataset/problemstatement/microsoftInternal__NAV-176194__cf-1/error.png new file mode 100644 index 000000000..a1446e999 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-176194__cf-1/error.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-176194__cf-1/item-charge-assignment.png b/dataset/problemstatement/microsoftInternal__NAV-176194__cf-1/item-charge-assignment.png new file mode 100644 index 000000000..4a0d36346 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-176194__cf-1/item-charge-assignment.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-176194__cf-1/post.png b/dataset/problemstatement/microsoftInternal__NAV-176194__cf-1/post.png new file mode 100644 index 000000000..0246c9e9c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-176194__cf-1/post.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-176194__cf-1/posted-sales-document-lines.png b/dataset/problemstatement/microsoftInternal__NAV-176194__cf-1/posted-sales-document-lines.png new file mode 100644 index 000000000..bf170e8cf Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-176194__cf-1/posted-sales-document-lines.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-176194__cf-1/sales-order-item-charge-assignment.png b/dataset/problemstatement/microsoftInternal__NAV-176194__cf-1/sales-order-item-charge-assignment.png new file mode 100644 index 000000000..d18b1751c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-176194__cf-1/sales-order-item-charge-assignment.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-176194__cf-1/sales-order.png b/dataset/problemstatement/microsoftInternal__NAV-176194__cf-1/sales-order.png new file mode 100644 index 000000000..69a679e7b Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-176194__cf-1/sales-order.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-176194__cf-1/sales-receivables-setup.png b/dataset/problemstatement/microsoftInternal__NAV-176194__cf-1/sales-receivables-setup.png new file mode 100644 index 000000000..c48c8bc8c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-176194__cf-1/sales-receivables-setup.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-176194__cf-1/sales-return-order.png b/dataset/problemstatement/microsoftInternal__NAV-176194__cf-1/sales-return-order.png new file mode 100644 index 000000000..621f8b74d Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-176194__cf-1/sales-return-order.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-176194__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-176194__cf-2/README.md new file mode 100644 index 000000000..3e3579519 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-176194__cf-2/README.md @@ -0,0 +1,11 @@ +# Title: Item Charge throws error when pulled into Sales Return Order when Default Qty. to Ship is set to 'Blank' on Sales & Rec Setup +## Repro Steps: +Item Charge should only be validated when Default Qty to Ship is Blank, not when it is non-Blank. + +![Sales Receivables Setup](./sales-receivables-setup.png) + +The validation condition is inverted: Qty. to Invoice is checked only when setup is Blank. + +![Item Charge Assignment](./item-charge-assignment.png) +## Description: +Item Charge Qty. to Invoice validation condition is inverted. diff --git a/dataset/problemstatement/microsoftInternal__NAV-176194__cf-2/default-quantity-to-ship.png b/dataset/problemstatement/microsoftInternal__NAV-176194__cf-2/default-quantity-to-ship.png new file mode 100644 index 000000000..2ebc6c0c7 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-176194__cf-2/default-quantity-to-ship.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-176194__cf-2/error.png b/dataset/problemstatement/microsoftInternal__NAV-176194__cf-2/error.png new file mode 100644 index 000000000..a1446e999 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-176194__cf-2/error.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-176194__cf-2/item-charge-assignment.png b/dataset/problemstatement/microsoftInternal__NAV-176194__cf-2/item-charge-assignment.png new file mode 100644 index 000000000..4a0d36346 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-176194__cf-2/item-charge-assignment.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-176194__cf-2/post.png b/dataset/problemstatement/microsoftInternal__NAV-176194__cf-2/post.png new file mode 100644 index 000000000..0246c9e9c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-176194__cf-2/post.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-176194__cf-2/posted-sales-document-lines.png b/dataset/problemstatement/microsoftInternal__NAV-176194__cf-2/posted-sales-document-lines.png new file mode 100644 index 000000000..bf170e8cf Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-176194__cf-2/posted-sales-document-lines.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-176194__cf-2/sales-order-item-charge-assignment.png b/dataset/problemstatement/microsoftInternal__NAV-176194__cf-2/sales-order-item-charge-assignment.png new file mode 100644 index 000000000..d18b1751c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-176194__cf-2/sales-order-item-charge-assignment.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-176194__cf-2/sales-order.png b/dataset/problemstatement/microsoftInternal__NAV-176194__cf-2/sales-order.png new file mode 100644 index 000000000..69a679e7b Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-176194__cf-2/sales-order.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-176194__cf-2/sales-receivables-setup.png b/dataset/problemstatement/microsoftInternal__NAV-176194__cf-2/sales-receivables-setup.png new file mode 100644 index 000000000..c48c8bc8c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-176194__cf-2/sales-receivables-setup.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-176194__cf-2/sales-return-order.png b/dataset/problemstatement/microsoftInternal__NAV-176194__cf-2/sales-return-order.png new file mode 100644 index 000000000..621f8b74d Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-176194__cf-2/sales-return-order.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-176194__cf-3/README.md b/dataset/problemstatement/microsoftInternal__NAV-176194__cf-3/README.md new file mode 100644 index 000000000..e217347d3 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-176194__cf-3/README.md @@ -0,0 +1,11 @@ +# Title: Item Charge throws error when pulled into Sales Return Order when Default Qty. to Ship is set to 'Blank' on Sales & Rec Setup +## Repro Steps: +Qty. to Invoice is validated during processing, not during field validation. The OnValidate trigger should not perform this check. + +![Sales Receivables Setup](./sales-receivables-setup.png) + +The validation responsibility is shifted from the OnValidate trigger to the processing flow. + +![Item Charge Assignment](./item-charge-assignment.png) +## Description: +Item Charge Qty. to Invoice validation moved out of OnValidate trigger. diff --git a/dataset/problemstatement/microsoftInternal__NAV-176194__cf-3/default-quantity-to-ship.png b/dataset/problemstatement/microsoftInternal__NAV-176194__cf-3/default-quantity-to-ship.png new file mode 100644 index 000000000..2ebc6c0c7 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-176194__cf-3/default-quantity-to-ship.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-176194__cf-3/error.png b/dataset/problemstatement/microsoftInternal__NAV-176194__cf-3/error.png new file mode 100644 index 000000000..a1446e999 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-176194__cf-3/error.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-176194__cf-3/item-charge-assignment.png b/dataset/problemstatement/microsoftInternal__NAV-176194__cf-3/item-charge-assignment.png new file mode 100644 index 000000000..4a0d36346 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-176194__cf-3/item-charge-assignment.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-176194__cf-3/post.png b/dataset/problemstatement/microsoftInternal__NAV-176194__cf-3/post.png new file mode 100644 index 000000000..0246c9e9c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-176194__cf-3/post.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-176194__cf-3/posted-sales-document-lines.png b/dataset/problemstatement/microsoftInternal__NAV-176194__cf-3/posted-sales-document-lines.png new file mode 100644 index 000000000..bf170e8cf Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-176194__cf-3/posted-sales-document-lines.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-176194__cf-3/sales-order-item-charge-assignment.png b/dataset/problemstatement/microsoftInternal__NAV-176194__cf-3/sales-order-item-charge-assignment.png new file mode 100644 index 000000000..d18b1751c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-176194__cf-3/sales-order-item-charge-assignment.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-176194__cf-3/sales-order.png b/dataset/problemstatement/microsoftInternal__NAV-176194__cf-3/sales-order.png new file mode 100644 index 000000000..69a679e7b Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-176194__cf-3/sales-order.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-176194__cf-3/sales-receivables-setup.png b/dataset/problemstatement/microsoftInternal__NAV-176194__cf-3/sales-receivables-setup.png new file mode 100644 index 000000000..c48c8bc8c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-176194__cf-3/sales-receivables-setup.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-176194__cf-3/sales-return-order.png b/dataset/problemstatement/microsoftInternal__NAV-176194__cf-3/sales-return-order.png new file mode 100644 index 000000000..621f8b74d Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-176194__cf-3/sales-return-order.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-176426__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-176426__cf-1/README.md new file mode 100644 index 000000000..b8a9369ae --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-176426__cf-1/README.md @@ -0,0 +1,13 @@ +# Title: Inconsistency in Rolled-up Capacity Cost field on BOM Cost Shares page. +## Repro Steps: +1. Cronus database. Open item '1000' -> Production BOM No. field -> open -> change the status to "Under Development" -> find the component 1100 and increase the Quantity per from 1 to 5. Certify the BOM. +2. Open item '1100' -> Production BOM No. field -> erase the current BOM No. and create a new BOM for the item '1100'. Do not add any lines to the new BOM, just leave it blank and certify. Make sure that the new blank BOM is selected for the item '1100'. +3. Go back to item '1000' -> open 'Cost Shares' page. Note that 'Rolled-up Capacity Cost' for the component '1100' is equal to 66. +![Item 66](./item-66.png) +4. Go back to item '1100' -> Production BOM No. field -> erase the current BOM No. so that this field is blank. +5. Reopen 'Cost Shares' page for item '1000'. Note that 'Rolled-up Capacity Cost' for '1100' is now equal to 330 (66 * 5): +![Item 330](./item-330.png) + +Only Unit Cost should fallback when no BOM exists, rolled-up material cost remains unchanged. + +## Description: diff --git a/dataset/problemstatement/microsoftInternal__NAV-176426__cf-1/item-330.png b/dataset/problemstatement/microsoftInternal__NAV-176426__cf-1/item-330.png new file mode 100644 index 000000000..f13afa195 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-176426__cf-1/item-330.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-176426__cf-1/item-66.png b/dataset/problemstatement/microsoftInternal__NAV-176426__cf-1/item-66.png new file mode 100644 index 000000000..eeadf3dd6 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-176426__cf-1/item-66.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-176426__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-176426__cf-2/README.md new file mode 100644 index 000000000..95d224612 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-176426__cf-2/README.md @@ -0,0 +1,13 @@ +# Title: Inconsistency in Rolled-up Capacity Cost field on BOM Cost Shares page. +## Repro Steps: +1. Cronus database. Open item '1000' -> Production BOM No. field -> open -> change the status to "Under Development" -> find the component 1100 and increase the Quantity per from 1 to 5. Certify the BOM. +2. Open item '1100' -> Production BOM No. field -> erase the current BOM No. and create a new BOM for the item '1100'. Do not add any lines to the new BOM, just leave it blank and certify. Make sure that the new blank BOM is selected for the item '1100'. +3. Go back to item '1000' -> open 'Cost Shares' page. Note that 'Rolled-up Capacity Cost' for the component '1100' is equal to 66. +![Item 66](./item-66.png) +4. Go back to item '1100' -> Production BOM No. field -> erase the current BOM No. so that this field is blank. +5. Reopen 'Cost Shares' page for item '1000'. Note that 'Rolled-up Capacity Cost' for '1100' is now equal to 330 (66 * 5): +![Item 330](./item-330.png) + +The Unit Cost fallback is determined after item cost retrieval, not during BOM tree calculation. + +## Description: diff --git a/dataset/problemstatement/microsoftInternal__NAV-176426__cf-2/item-330.png b/dataset/problemstatement/microsoftInternal__NAV-176426__cf-2/item-330.png new file mode 100644 index 000000000..f13afa195 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-176426__cf-2/item-330.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-176426__cf-2/item-66.png b/dataset/problemstatement/microsoftInternal__NAV-176426__cf-2/item-66.png new file mode 100644 index 000000000..eeadf3dd6 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-176426__cf-2/item-66.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-177493__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-177493__cf-1/README.md new file mode 100644 index 000000000..02d38eaaa --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-177493__cf-1/README.md @@ -0,0 +1,13 @@ +# Title: Reservation Worksheet creates a Reservation for Item that has 'Reserve' = Never +## Repro Steps: +1. Create new Item or go to item with no records. +2. On the item card, set the 'Reserve' = NEVER +3. Create Item Journal, Positive Adjustment for BLUE location and 10 qty. +4. Post this +5. Create Sales Order for Customer 50000 with the New item on the line with BLUE Location and 3 Quantity. +6. Go to the Reservation Worksheet. +7. Choose Process > Get Demand and set Demand Type = Sales, Item No. = Your Item. +8. The Item demand may be collected initially but should be filtered out before reservation processing. + +## Description: +Filtering of Reserve = Never items is deferred to post-processing stage instead of source filtering. diff --git a/dataset/problemstatement/microsoftInternal__NAV-177493__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-177493__cf-2/README.md new file mode 100644 index 000000000..784f1b50e --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-177493__cf-2/README.md @@ -0,0 +1,13 @@ +# Title: Reservation Worksheet creates a Reservation for Item that has 'Reserve' = Never +## Repro Steps: +1. Create new Item or go to item with no records. +2. On the item card, set the 'Reserve' = NEVER +3. Create Item Journal, Positive Adjustment for BLUE location and 10 qty. +4. Post this +5. Create Sales Order for Customer 50000 with the New item on the line with BLUE Location and 3 Quantity. +6. Go to the Reservation Worksheet. +7. Choose Process > Get Demand and set Demand Type = Sales, Item No. = Your Item. +8. Sales and service demand should not pull in here, but other demand types may still appear. + +## Description: +Reserve = Never restriction applies only to Sales and Service demand, not to Assembly or Job Planning. diff --git a/dataset/problemstatement/microsoftInternal__NAV-177493__cf-3/README.md b/dataset/problemstatement/microsoftInternal__NAV-177493__cf-3/README.md new file mode 100644 index 000000000..5dfd53613 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-177493__cf-3/README.md @@ -0,0 +1,13 @@ +# Title: Reservation Worksheet creates a Reservation for Item that has 'Reserve' = Never +## Repro Steps: +1. Create new Item or go to item with no records. +2. On the item card, set the 'Reserve' = NEVER +3. Create Item Journal, Positive Adjustment for BLUE location and 10 qty. +4. Post this +5. Create Sales Order for Customer 50000 with the New item on the line with BLUE Location and 3 Quantity. +6. Go to the Reservation Worksheet. +7. Choose Process > Get Demand and set Demand Type = Sales, Item No. = Your Item. +8. The filtering depends on the reserve setting, but behavior may vary depending on source context. + +## Description: +The Reserve filter uses a different enum source which may cause inconsistent behavior across demand types. diff --git a/dataset/problemstatement/microsoftInternal__NAV-178045__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-178045__cf-1/README.md new file mode 100644 index 000000000..dc41228a6 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-178045__cf-1/README.md @@ -0,0 +1,8 @@ +# Title: Consumption not posted for multiple ILEs of same Lot No. — only when multiple entries exist +## Repro Steps: +Same as NAV-178045 base repro, except: +- Only **two** Item Journal Lines are posted with the same Lot No. (5 and 10 qty) instead of three +- Total consumption quantity is 15 instead of 35 + +## Description: +Variant of NAV-178045 (L2: condition-change). The fix only applies the consumption correction when multiple Item Ledger Entries exist for the same lot (Count > 1 guard). Test uses 2 journal lines instead of 3 to create a tighter scenario while still exercising the multi-ILE path. diff --git a/dataset/problemstatement/microsoftInternal__NAV-179733__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-179733__cf-1/README.md new file mode 100644 index 000000000..c98acf5b5 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-179733__cf-1/README.md @@ -0,0 +1,14 @@ +# Title: Copy Project Tasks into Project with Task Billing = Multiple Customers should skip Begin-Total explicitly +## Repro Steps: +Create project1 for any customer (10000) +add task 1 of type Begin-Total and task 2 of type Posting. (no planning lines) +Change Task Billing Method = Multiple Customers. + +Choose Copy Project Tasks from... +Select project with Begin/End + +Result: Only Begin-Total tasks are explicitly skipped; all other task types inherit customer fields. + +Expected: Begin-Total type is explicitly excluded from customer field inheritance. +## Description: +Only Begin-Total tasks should be skipped when copying customer fields in Multiple Customers billing mode. diff --git a/dataset/problemstatement/microsoftInternal__NAV-180484__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-180484__cf-1/README.md new file mode 100644 index 000000000..2b6ed977f --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-180484__cf-1/README.md @@ -0,0 +1,27 @@ +# Title: Incoming Document status stuck at new after file is created and reopened. +## Repro Steps: +**ISSUE REPRO:** + +Navigate to the Incoming document page on the new document page click on NEW and Create from file as shown in the screenshot below: +![Incoming Documents](./incoming-documents-create.png) + +After the document has been imported click on create document. If the setting in the environment match with the incoming document the document is created as shown below and the status set to "Created" +![Incoming Documents Created](./incoming-documents-created.png) + +Click on release and then click on Re-Open. The status remains as Created only if a document is linked and the document is posted. +![Incoming Documents Reopen](./incoming-document-reopened.png) + +If you click on create document, you get a prompt that "The document has already been created" and the status is still set at NEW after click okay as shown below. +![Document Already Created Error](./document-already-created.png) + +================ +ACTUAL RESULTS +================ + +Incoming Document status stuck at new after file is created and reopened. + +================ +EXPECTED RESULTS +================ + +Status remains as Created only if a document is linked and the document is posted. diff --git a/dataset/problemstatement/microsoftInternal__NAV-180484__cf-1/document-already-created.png b/dataset/problemstatement/microsoftInternal__NAV-180484__cf-1/document-already-created.png new file mode 100644 index 000000000..3ed167854 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-180484__cf-1/document-already-created.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-180484__cf-1/incoming-document-reopened.png b/dataset/problemstatement/microsoftInternal__NAV-180484__cf-1/incoming-document-reopened.png new file mode 100644 index 000000000..261459420 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-180484__cf-1/incoming-document-reopened.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-180484__cf-1/incoming-documents-create.png b/dataset/problemstatement/microsoftInternal__NAV-180484__cf-1/incoming-documents-create.png new file mode 100644 index 000000000..9f06588d6 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-180484__cf-1/incoming-documents-create.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-180484__cf-1/incoming-documents-created.png b/dataset/problemstatement/microsoftInternal__NAV-180484__cf-1/incoming-documents-created.png new file mode 100644 index 000000000..cd8e21d2e Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-180484__cf-1/incoming-documents-created.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-180484__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-180484__cf-2/README.md new file mode 100644 index 000000000..747b30a6f --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-180484__cf-2/README.md @@ -0,0 +1,27 @@ +# Title: Incoming Document status stuck at new after file is created and reopened. +## Repro Steps: +**ISSUE REPRO:** + +Navigate to the Incoming document page on the new document page click on NEW and Create from file as shown in the screenshot below: +![Incoming Documents](./incoming-documents-create.png) + +After the document has been imported click on create document. If the setting in the environment match with the incoming document the document is created as shown below and the status set to "Created" +![Incoming Documents Created](./incoming-documents-created.png) + +Click on release and then click on Re-Open. Reopen does nothing when a document is already linked. +![Incoming Documents Reopen](./incoming-document-reopened.png) + +If you click on create document, you get a prompt that "The document has already been created" and the status is still set at NEW after click okay as shown below. +![Document Already Created Error](./document-already-created.png) + +================ +ACTUAL RESULTS +================ + +Incoming Document status stuck at new after file is created and reopened. + +================ +EXPECTED RESULTS +================ + +Reopen does nothing when a document is already linked. diff --git a/dataset/problemstatement/microsoftInternal__NAV-180484__cf-2/document-already-created.png b/dataset/problemstatement/microsoftInternal__NAV-180484__cf-2/document-already-created.png new file mode 100644 index 000000000..3ed167854 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-180484__cf-2/document-already-created.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-180484__cf-2/incoming-document-reopened.png b/dataset/problemstatement/microsoftInternal__NAV-180484__cf-2/incoming-document-reopened.png new file mode 100644 index 000000000..261459420 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-180484__cf-2/incoming-document-reopened.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-180484__cf-2/incoming-documents-create.png b/dataset/problemstatement/microsoftInternal__NAV-180484__cf-2/incoming-documents-create.png new file mode 100644 index 000000000..9f06588d6 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-180484__cf-2/incoming-documents-create.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-180484__cf-2/incoming-documents-created.png b/dataset/problemstatement/microsoftInternal__NAV-180484__cf-2/incoming-documents-created.png new file mode 100644 index 000000000..cd8e21d2e Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-180484__cf-2/incoming-documents-created.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-182354__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-182354__cf-1/README.md new file mode 100644 index 000000000..8a8bc1133 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-182354__cf-1/README.md @@ -0,0 +1,22 @@ +# Title: New AR rolecenter: the system should fallback to WorkDate only when Today is not initialized +## Repro Steps: +Note: the system should fallback to WorkDate only when Today is not initialized (returns 0D) + +besically you can ignore the repro and just implement the correct filter date + +repro: the total Overdue (LCY) cue is using wrong date: +open the new AR rolecenter +go to My settings: update workdate - use today's date +expected: the cue should use Today() when available, and fallback to WorkDate() only when Today() = 0D + +actual: cue always uses WorkDate() regardless of whether Today() is available +![Customer Ledger Entries Current](./customer-ledger-entries-current.png) + +expected value: +![Customer Ledger Entries Expected](./customer-ledger-entries-expected.png) + +## Description: + +## Hints + +Also, found that calculation and drilldown for "Total Overdue (LCY)" are not in line. diff --git a/dataset/problemstatement/microsoftInternal__NAV-182354__cf-1/customer-ledger-entries-current.png b/dataset/problemstatement/microsoftInternal__NAV-182354__cf-1/customer-ledger-entries-current.png new file mode 100644 index 000000000..1b1903f9a Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-182354__cf-1/customer-ledger-entries-current.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-182354__cf-1/customer-ledger-entries-expected.png b/dataset/problemstatement/microsoftInternal__NAV-182354__cf-1/customer-ledger-entries-expected.png new file mode 100644 index 000000000..d6c57b982 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-182354__cf-1/customer-ledger-entries-expected.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-183399__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-183399__cf-1/README.md new file mode 100644 index 000000000..676192f2c --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-183399__cf-1/README.md @@ -0,0 +1,16 @@ +# Title: Document Amount in Purchase Journal not showing the correct decimals +## Repro Steps: +I was able to repro the issue using TND currency, which actually has 4 decimal places. + +1.I created a purchase journal and insert a new entry for vendor 20000.and set my currency to TND and amount to 1.2345. +![Purchase Journals Error](./purchase-journals-error.png) + +If I enter an amount (1.2345) in the document amount filed, I get this error message" Your entry of '1.2345' is not an acceptable value for 'Document Amount'. The field can have a maximum of 3 decimal places." + +2.To ignores this error, The amount was entered in the amount field and the journal was posted. +![Purchase Journals No Error](./purchase-journal-no-error.png) + +## Description: +Issue: Document Amount in Purchase Journal not showing the correct decimals + +Expectation: It is expected that the document amount field should accept up to 4 decimal figures. diff --git a/dataset/problemstatement/microsoftInternal__NAV-183399__cf-1/purchase-journal-no-error.png b/dataset/problemstatement/microsoftInternal__NAV-183399__cf-1/purchase-journal-no-error.png new file mode 100644 index 000000000..72bcecc16 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-183399__cf-1/purchase-journal-no-error.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-183399__cf-1/purchase-journals-error.png b/dataset/problemstatement/microsoftInternal__NAV-183399__cf-1/purchase-journals-error.png new file mode 100644 index 000000000..afbd18285 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-183399__cf-1/purchase-journals-error.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-183399__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-183399__cf-2/README.md new file mode 100644 index 000000000..c72fa563f --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-183399__cf-2/README.md @@ -0,0 +1,18 @@ +# Title: Document Amount in Purchase Journal not showing the correct decimals +## Repro Steps: +I was able to repro the issue using TND currency, which actually has 3 decimal places. + +1.I created a purchase journal and insert a new entry for vendor 20000.and set my currency to TND and amount to 1.234. +![Purchase Journals Error](./purchase-journals-error.png) + +If I enter an amount (1.234) in the document amount filed, I get this error message" Your entry of '1.234' is not an acceptable value for 'Document Amount'. The field can have a maximum of 2 decimal places." + +The document amount field ignores currency precision when validating decimals. + +2.To ignores this error, The amount was entered in the amount field and the journal was posted. +![Purchase Journals No Error](./purchase-journal-no-error.png) + +## Description: +Issue: Document Amount in Purchase Journal ignores currency precision when validating decimals + +Expectation: It is expected that the document amount field should accept 3 decimal figures regardless of currency formatting. diff --git a/dataset/problemstatement/microsoftInternal__NAV-183399__cf-2/purchase-journal-no-error.png b/dataset/problemstatement/microsoftInternal__NAV-183399__cf-2/purchase-journal-no-error.png new file mode 100644 index 000000000..72bcecc16 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-183399__cf-2/purchase-journal-no-error.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-183399__cf-2/purchase-journals-error.png b/dataset/problemstatement/microsoftInternal__NAV-183399__cf-2/purchase-journals-error.png new file mode 100644 index 000000000..afbd18285 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-183399__cf-2/purchase-journals-error.png differ 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..df8680dea --- /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 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-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-185696__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-185696__cf-2/README.md new file mode 100644 index 000000000..8e101c821 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-185696__cf-2/README.md @@ -0,0 +1,19 @@ +# Title: When creating a new price for variant items the variant code may remain from the previous line when creating a new line +## Repro Steps: +1. Open BC 22.13 W1 +2. Search for "Feature management" + Activate "New sales pricing experience" + ![Feature Management](./feature-management.png) +3. Search for Items + Create a new item +4. Create 3 Variants for this item: + Actions -> item -> variants + ![Item Variants](./item-variants.png) +5. Search for "Sales price lists" + Create a new price list + Insert a line with your new item (70061) and select a variant "Blue" + insert a second line for the same item - the variant may remain from the previous line + +ACTUAL RESULT: +the variant "Blue" may remain from the previous line when creating a new line +![Sales Price List](./sales-price-list.png) diff --git a/dataset/problemstatement/microsoftInternal__NAV-185696__cf-2/feature-management.png b/dataset/problemstatement/microsoftInternal__NAV-185696__cf-2/feature-management.png new file mode 100644 index 000000000..1b2cea8a2 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-185696__cf-2/feature-management.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-185696__cf-2/item-variants.png b/dataset/problemstatement/microsoftInternal__NAV-185696__cf-2/item-variants.png new file mode 100644 index 000000000..46b826007 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-185696__cf-2/item-variants.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-185696__cf-2/sales-price-list.png b/dataset/problemstatement/microsoftInternal__NAV-185696__cf-2/sales-price-list.png new file mode 100644 index 000000000..0892ac107 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-185696__cf-2/sales-price-list.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..4deda3077 --- /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 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-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-188438__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-188438__cf-1/README.md new file mode 100644 index 000000000..5ce2adcf3 --- /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** 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-192565__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-192565__cf-1/README.md new file mode 100644 index 000000000..caecb3df4 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-192565__cf-1/README.md @@ -0,0 +1,28 @@ +# Title: When Changing the Unit Amount to 0 in the purchase invoice line, the Non Deductible Vat is not removed if quantity is non-zero. +## Repro Steps: +1. Open Cronus W1. +2. Open Vat Setup and enable Non Deductible Vat. +3. ![VAT Setup Step3](./vat_setup_step3.png) + +4. Open Vat Posting Groups. +5. Setup and allow Non Deductible Vat with 10%. +6. ![VAT Posting Setup Step6](./VAT_posting_setup_step6.png) + +7. Go to Vendors and create a new DOMESTIC vendor. +8. ![Vendor Card Step8](./vendor_card_step8.png) + +9. Go to Purchase Invoices and create a new one. +10. Add the Test Vendor. +11. Add the item Athens Desk for example, it will generate Direct Unit Cost Excl Vat and Non Deductible Vat Amount. +12. ![Purchase Invoice Step12](./purchase_invoice_step12.png) + +13. Change the Direct Unit Cost Excl Vat to 0. +14. After changing it to 0 the Non Deductible Vat Amount is still the same and hasn't been removed, when the quantity is non-zero. +15. ![Change VAT Step15](./change_VAT_step15.png) + +16. If we do preview posting. +17. The Lines are posted with the Non Deductible Vat Amount. +18. ![Entries Preview Step18](./entries_preview_step18.png) + +## Description: +When Changing the Unit Amount to 0 in the purchase invoice line, the Non Deductible Vat is not removed if quantity is non-zero. diff --git a/dataset/problemstatement/microsoftInternal__NAV-192565__cf-1/VAT_posting_setup_step6.png b/dataset/problemstatement/microsoftInternal__NAV-192565__cf-1/VAT_posting_setup_step6.png new file mode 100644 index 000000000..73bffef4c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-192565__cf-1/VAT_posting_setup_step6.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-192565__cf-1/change_VAT_step15.png b/dataset/problemstatement/microsoftInternal__NAV-192565__cf-1/change_VAT_step15.png new file mode 100644 index 000000000..a6df0c34d Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-192565__cf-1/change_VAT_step15.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-192565__cf-1/entries_preview_step18.png b/dataset/problemstatement/microsoftInternal__NAV-192565__cf-1/entries_preview_step18.png new file mode 100644 index 000000000..a832f7eef Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-192565__cf-1/entries_preview_step18.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-192565__cf-1/purchase_invoice_step12.png b/dataset/problemstatement/microsoftInternal__NAV-192565__cf-1/purchase_invoice_step12.png new file mode 100644 index 000000000..9de7efc6f Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-192565__cf-1/purchase_invoice_step12.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-192565__cf-1/vat_setup_step3.png b/dataset/problemstatement/microsoftInternal__NAV-192565__cf-1/vat_setup_step3.png new file mode 100644 index 000000000..47e706c88 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-192565__cf-1/vat_setup_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-192565__cf-1/vendor_card_step8.png b/dataset/problemstatement/microsoftInternal__NAV-192565__cf-1/vendor_card_step8.png new file mode 100644 index 000000000..007fd8054 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-192565__cf-1/vendor_card_step8.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-192565__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-192565__cf-2/README.md new file mode 100644 index 000000000..80bb0aedd --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-192565__cf-2/README.md @@ -0,0 +1,28 @@ +# Title: When Changing the Unit Amount to 0 for item lines, the Non Deductible Vat is not removed. +## Repro Steps: +1. Open Cronus W1. +2. Open Vat Setup and enable Non Deductible Vat. +3. ![VAT Setup Step3](./vat_setup_step3.png) + +4. Open Vat Posting Groups. +5. Setup and allow Non Deductible Vat with 10%. +6. ![VAT Posting Setup Step6](./VAT_posting_setup_step6.png) + +7. Go to Vendors and create a new DOMESTIC vendor. +8. ![Vendor Card Step8](./vendor_card_step8.png) + +9. Go to Purchase Invoices and create a new one. +10. Add the Test Vendor. +11. Add the item Athens Desk for example, it will generate Direct Unit Cost Excl Vat and Non Deductible Vat Amount. +12. ![Purchase Invoice Step12](./purchase_invoice_step12.png) + +13. Change the Direct Unit Cost Excl Vat to 0. +14. After changing it to 0 the Non Deductible Vat Amount is still the same and hasn't been removed for item lines. +15. ![Change VAT Step15](./change_VAT_step15.png) + +16. If we do preview posting. +17. The Lines are posted with the Non Deductible Vat Amount. +18. ![Entries Preview Step18](./entries_preview_step18.png) + +## Description: +When Changing the Unit Amount to 0 for item lines, the Non Deductible Vat is not removed. diff --git a/dataset/problemstatement/microsoftInternal__NAV-192565__cf-2/VAT_posting_setup_step6.png b/dataset/problemstatement/microsoftInternal__NAV-192565__cf-2/VAT_posting_setup_step6.png new file mode 100644 index 000000000..73bffef4c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-192565__cf-2/VAT_posting_setup_step6.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-192565__cf-2/change_VAT_step15.png b/dataset/problemstatement/microsoftInternal__NAV-192565__cf-2/change_VAT_step15.png new file mode 100644 index 000000000..a6df0c34d Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-192565__cf-2/change_VAT_step15.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-192565__cf-2/entries_preview_step18.png b/dataset/problemstatement/microsoftInternal__NAV-192565__cf-2/entries_preview_step18.png new file mode 100644 index 000000000..a832f7eef Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-192565__cf-2/entries_preview_step18.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-192565__cf-2/purchase_invoice_step12.png b/dataset/problemstatement/microsoftInternal__NAV-192565__cf-2/purchase_invoice_step12.png new file mode 100644 index 000000000..9de7efc6f Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-192565__cf-2/purchase_invoice_step12.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-192565__cf-2/vat_setup_step3.png b/dataset/problemstatement/microsoftInternal__NAV-192565__cf-2/vat_setup_step3.png new file mode 100644 index 000000000..47e706c88 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-192565__cf-2/vat_setup_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-192565__cf-2/vendor_card_step8.png b/dataset/problemstatement/microsoftInternal__NAV-192565__cf-2/vendor_card_step8.png new file mode 100644 index 000000000..007fd8054 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-192565__cf-2/vendor_card_step8.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-192565__cf-3/README.md b/dataset/problemstatement/microsoftInternal__NAV-192565__cf-3/README.md new file mode 100644 index 000000000..336c44cd7 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-192565__cf-3/README.md @@ -0,0 +1,28 @@ +# Title: When Changing the Unit Amount to 0 in the purchase invoice line, the Non Deductible Vat is not removed when Non-Deductible VAT is enabled. +## Repro Steps: +1. Open Cronus W1. +2. Open Vat Setup and enable Non Deductible Vat. +3. ![VAT Setup Step3](./vat_setup_step3.png) + +4. Open Vat Posting Groups. +5. Setup and allow Non Deductible Vat with 10%. +6. ![VAT Posting Setup Step6](./VAT_posting_setup_step6.png) + +7. Go to Vendors and create a new DOMESTIC vendor. +8. ![Vendor Card Step8](./vendor_card_step8.png) + +9. Go to Purchase Invoices and create a new one. +10. Add the Test Vendor. +11. Add the item Athens Desk for example, it will generate Direct Unit Cost Excl Vat and Non Deductible Vat Amount. +12. ![Purchase Invoice Step12](./purchase_invoice_step12.png) + +13. Change the Direct Unit Cost Excl Vat to 0. +14. After changing it to 0 the Non Deductible Vat Amount is still the same and hasn't been removed when Non-Deductible VAT is enabled. +15. ![Change VAT Step15](./change_VAT_step15.png) + +16. If we do preview posting. +17. The Lines are posted with the Non Deductible Vat Amount. +18. ![Entries Preview Step18](./entries_preview_step18.png) + +## Description: +When Changing the Unit Amount to 0 in the purchase invoice line, the Non Deductible Vat is not removed when Non-Deductible VAT is enabled. diff --git a/dataset/problemstatement/microsoftInternal__NAV-192565__cf-3/VAT_posting_setup_step6.png b/dataset/problemstatement/microsoftInternal__NAV-192565__cf-3/VAT_posting_setup_step6.png new file mode 100644 index 000000000..73bffef4c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-192565__cf-3/VAT_posting_setup_step6.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-192565__cf-3/change_VAT_step15.png b/dataset/problemstatement/microsoftInternal__NAV-192565__cf-3/change_VAT_step15.png new file mode 100644 index 000000000..a6df0c34d Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-192565__cf-3/change_VAT_step15.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-192565__cf-3/entries_preview_step18.png b/dataset/problemstatement/microsoftInternal__NAV-192565__cf-3/entries_preview_step18.png new file mode 100644 index 000000000..a832f7eef Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-192565__cf-3/entries_preview_step18.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-192565__cf-3/purchase_invoice_step12.png b/dataset/problemstatement/microsoftInternal__NAV-192565__cf-3/purchase_invoice_step12.png new file mode 100644 index 000000000..9de7efc6f Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-192565__cf-3/purchase_invoice_step12.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-192565__cf-3/vat_setup_step3.png b/dataset/problemstatement/microsoftInternal__NAV-192565__cf-3/vat_setup_step3.png new file mode 100644 index 000000000..47e706c88 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-192565__cf-3/vat_setup_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-192565__cf-3/vendor_card_step8.png b/dataset/problemstatement/microsoftInternal__NAV-192565__cf-3/vendor_card_step8.png new file mode 100644 index 000000000..007fd8054 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-192565__cf-3/vendor_card_step8.png differ 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-203923__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-203923__cf-1/README.md new file mode 100644 index 000000000..c301a18c5 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-203923__cf-1/README.md @@ -0,0 +1,18 @@ +# Title: Full VAT is not treated as eligible for non-deductible VAT calculation +## Repro Steps: +*** Were you able to reproduce the issue? Yes + +The situation cx is testing is for a prospect who wants to post all their tax as non-recoverable and then make a quarter end adjustment for the recoverable VAT. + +At the end of the quarter, I want to post a journal with a FULL NORM type VAT for the recoverable portion of the VAT and a FULL NORM 100% Non-deductible to move the VAT from Non-Deductible VAT Amount to Amount. + +Full VAT is not treated as eligible for non-deductible VAT calculation. When you make the change in the VAT posting setup to Full VAT in the Calculation Type, the system does not recognize it as a valid type for non-deductible processing. + +![VAT Posting Setup](./vat-posting-setup.png) + +![Journal for VAT Adjustment](./journal-for-vat-adjustment.png) + +![VAT Posting](./vat-posting.png) + +## Description: +Full VAT is not treated as eligible for non-deductible VAT calculation diff --git a/dataset/problemstatement/microsoftInternal__NAV-203923__cf-1/journal-for-vat-adjustment.png b/dataset/problemstatement/microsoftInternal__NAV-203923__cf-1/journal-for-vat-adjustment.png new file mode 100644 index 000000000..c5610baed Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-203923__cf-1/journal-for-vat-adjustment.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-203923__cf-1/vat-posting-2.png b/dataset/problemstatement/microsoftInternal__NAV-203923__cf-1/vat-posting-2.png new file mode 100644 index 000000000..bff910cc9 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-203923__cf-1/vat-posting-2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-203923__cf-1/vat-posting-setup.png b/dataset/problemstatement/microsoftInternal__NAV-203923__cf-1/vat-posting-setup.png new file mode 100644 index 000000000..0031448cc Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-203923__cf-1/vat-posting-setup.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-203923__cf-1/vat-posting.png b/dataset/problemstatement/microsoftInternal__NAV-203923__cf-1/vat-posting.png new file mode 100644 index 000000000..f90a63b14 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-203923__cf-1/vat-posting.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-203923__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-203923__cf-2/README.md new file mode 100644 index 000000000..7a4dc4847 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-203923__cf-2/README.md @@ -0,0 +1,18 @@ +# Title: Full VAT is treated as non-deductible only when Non-Deductible VAT % is less than 100 +## Repro Steps: +*** Were you able to reproduce the issue? Yes + +The situation cx is testing is for a prospect who wants to post all their tax as non-recoverable and then make a quarter end adjustment for the recoverable VAT. + +At the end of the quarter, I want to post a journal with a FULL NORM type VAT for the recoverable portion of the VAT and a FULL NORM 100% Non-deductible to move the VAT from Non-Deductible VAT Amount to Amount. + +Full VAT is treated as non-deductible only when Non-Deductible VAT % is less than 100. When the Non-Deductible VAT % is set to 100, the system skips non-deductible processing for Full VAT. + +![VAT Posting Setup](./vat-posting-setup.png) + +![Journal for VAT Adjustment](./journal-for-vat-adjustment.png) + +![VAT Posting](./vat-posting.png) + +## Description: +Full VAT is treated as non-deductible only when Non-Deductible VAT % is less than 100 diff --git a/dataset/problemstatement/microsoftInternal__NAV-203923__cf-2/journal-for-vat-adjustment.png b/dataset/problemstatement/microsoftInternal__NAV-203923__cf-2/journal-for-vat-adjustment.png new file mode 100644 index 000000000..c5610baed Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-203923__cf-2/journal-for-vat-adjustment.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-203923__cf-2/vat-posting-2.png b/dataset/problemstatement/microsoftInternal__NAV-203923__cf-2/vat-posting-2.png new file mode 100644 index 000000000..bff910cc9 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-203923__cf-2/vat-posting-2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-203923__cf-2/vat-posting-setup.png b/dataset/problemstatement/microsoftInternal__NAV-203923__cf-2/vat-posting-setup.png new file mode 100644 index 000000000..0031448cc Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-203923__cf-2/vat-posting-setup.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-203923__cf-2/vat-posting.png b/dataset/problemstatement/microsoftInternal__NAV-203923__cf-2/vat-posting.png new file mode 100644 index 000000000..f90a63b14 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-203923__cf-2/vat-posting.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-203923__cf-3/README.md b/dataset/problemstatement/microsoftInternal__NAV-203923__cf-3/README.md new file mode 100644 index 000000000..2c7d89649 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-203923__cf-3/README.md @@ -0,0 +1,18 @@ +# Title: Full VAT amount is calculated but not reflected in the non-deductible VAT field on the VAT entry +## Repro Steps: +*** Were you able to reproduce the issue? Yes + +The situation cx is testing is for a prospect who wants to post all their tax as non-recoverable and then make a quarter end adjustment for the recoverable VAT. + +At the end of the quarter, I want to post a journal with a FULL NORM type VAT for the recoverable portion of the VAT and a FULL NORM 100% Non-deductible to move the VAT from Non-Deductible VAT Amount to Amount. + +When you make the change in the VAT posting setup to Full VAT in the Calculation Type it posts the VAT as Amount instead of Non-Deductible VAT amount. The full amount is calculated but not reflected in the non-deductible column on the VAT entry. + +![VAT Posting Setup](./vat-posting-setup.png) + +![Journal for VAT Adjustment](./journal-for-vat-adjustment.png) + +![VAT Posting](./vat-posting.png) + +## Description: +Full VAT amount is calculated but not reflected in the non-deductible VAT field on the VAT entry diff --git a/dataset/problemstatement/microsoftInternal__NAV-203923__cf-3/journal-for-vat-adjustment.png b/dataset/problemstatement/microsoftInternal__NAV-203923__cf-3/journal-for-vat-adjustment.png new file mode 100644 index 000000000..c5610baed Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-203923__cf-3/journal-for-vat-adjustment.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-203923__cf-3/vat-posting-2.png b/dataset/problemstatement/microsoftInternal__NAV-203923__cf-3/vat-posting-2.png new file mode 100644 index 000000000..bff910cc9 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-203923__cf-3/vat-posting-2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-203923__cf-3/vat-posting-setup.png b/dataset/problemstatement/microsoftInternal__NAV-203923__cf-3/vat-posting-setup.png new file mode 100644 index 000000000..0031448cc Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-203923__cf-3/vat-posting-setup.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-203923__cf-3/vat-posting.png b/dataset/problemstatement/microsoftInternal__NAV-203923__cf-3/vat-posting.png new file mode 100644 index 000000000..f90a63b14 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-203923__cf-3/vat-posting.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-204450__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-204450__cf-1/README.md new file mode 100644 index 000000000..3b3b9f4fd --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-204450__cf-1/README.md @@ -0,0 +1,30 @@ +# Title: The transaction cannot be completed because it will cause inconsistencies in the G/L Entry table error message if try to post Purchase doc. with Currencies, Non-Deductible VAT and the VAT Amount was previously modified in the Statistics. +## Repro Steps: +Take a BC 25.X environment (W1 issue) + +Open the VAT Setup and enable the non-deductible VAT: +![VAT Setup](./vat-setup.png) + +Open the purchase and receivables and allow VAT difference: +![Purchase Payable Setup](./purchase-payable-setup.png) + +Open the Currencies, open the EUR card and adjust the max. VAT difference allowed: +![Currency EUR](./currency-eur.png) + +Open the VAT posting setup and add the below line: +![VAT Posting Setup](./vat-posting-setup.png) + +Open a Purchase invoice, add the below line and adjust the currency code as well: +![Purchase Invoice](./purchase-invoice.png) + +Preview post and we get the below numbers: +![G/L Entries Preview](./gl-entry-preview.png) + +Open the statistics page (Invoice => Statistics) and change the VAT amount to 150 (no effect when ND VAT = 100): +![Purchase Invoice Statistics](./purchase-invoice-statistics.png) + +Preview post and check that the Amount (LCY) did not change: +![G/L Entries Preview 2](./gl-entry-preview-2.png) + +Post the invoice and you will get the below error: +![Error Message](./error-message.png) diff --git a/dataset/problemstatement/microsoftInternal__NAV-204450__cf-1/currency-eur.png b/dataset/problemstatement/microsoftInternal__NAV-204450__cf-1/currency-eur.png new file mode 100644 index 000000000..94bf978eb Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-204450__cf-1/currency-eur.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-204450__cf-1/error-message.png b/dataset/problemstatement/microsoftInternal__NAV-204450__cf-1/error-message.png new file mode 100644 index 000000000..9a79f9fd2 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-204450__cf-1/error-message.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-204450__cf-1/gl-entry-preview-2.png b/dataset/problemstatement/microsoftInternal__NAV-204450__cf-1/gl-entry-preview-2.png new file mode 100644 index 000000000..262c70c68 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-204450__cf-1/gl-entry-preview-2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-204450__cf-1/gl-entry-preview.png b/dataset/problemstatement/microsoftInternal__NAV-204450__cf-1/gl-entry-preview.png new file mode 100644 index 000000000..cb80ebfeb Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-204450__cf-1/gl-entry-preview.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-204450__cf-1/purchase-invoice-statistics.png b/dataset/problemstatement/microsoftInternal__NAV-204450__cf-1/purchase-invoice-statistics.png new file mode 100644 index 000000000..10468466e Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-204450__cf-1/purchase-invoice-statistics.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-204450__cf-1/purchase-invoice.png b/dataset/problemstatement/microsoftInternal__NAV-204450__cf-1/purchase-invoice.png new file mode 100644 index 000000000..a1c77d8e9 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-204450__cf-1/purchase-invoice.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-204450__cf-1/purchase-payable-setup.png b/dataset/problemstatement/microsoftInternal__NAV-204450__cf-1/purchase-payable-setup.png new file mode 100644 index 000000000..13d1a4758 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-204450__cf-1/purchase-payable-setup.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-204450__cf-1/vat-posting-setup.png b/dataset/problemstatement/microsoftInternal__NAV-204450__cf-1/vat-posting-setup.png new file mode 100644 index 000000000..a38882e31 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-204450__cf-1/vat-posting-setup.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-204450__cf-1/vat-setup.png b/dataset/problemstatement/microsoftInternal__NAV-204450__cf-1/vat-setup.png new file mode 100644 index 000000000..c81edce21 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-204450__cf-1/vat-setup.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-205825__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-205825__cf-1/README.md new file mode 100644 index 000000000..79555f6eb --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-205825__cf-1/README.md @@ -0,0 +1,41 @@ +# Title: Alternative Customer VAT Registration issue when using Bill to customer and Ship-to-Code. +## Repro Steps: +1. Create the setup for customer 10000 +Customer: 10000 +* Country/Region Code = NL +* VAT Registration No. = 789456278 +* VAT Bus. Posting Group = BINNENLAND +* Ship-to Code = DE + * Country/Region Code = DE +* Bill-to Customer = 20000 +![Customer Card Country/Region Code](./customer-country-region-code.png) + +![Customer Card More Info](./custom-more-info.png) + +2. Customer: 20000 (Bill to customer) + * Country/Region Code = NL + * VAT Registration No. = 254687456 +VAT Bus. Posting Group = BINNENLAND +![Customer 2000](./customer-2000.png) + +![Customer 2000 More Info](./customer-2000-more-info.png) + +3. Alternative Customer VAT Registration +![VAT Registration](./vat-registration.png) + +4. Create Sales document for customer 10000: message "The VAT Country/Region code has been changed to the value that does not have an alternative VAT registration. + +The following fields have been updated from the customer card: VAT Registration No., VAT Bus. Posting Group". + +After thoroughly investigating, it is observed that VAT setup is not correctly applied when fields are assigned directly without validation. + +![Sales Order](./sales-order-change.png) + +5. +Checking through it is expected that +VAT Country/Region Code should be (DE ) +VAT Registration No. = () +![Sales Order Details](./sales-order-details.png) + +6. Not until you change the ship-to to another options (Custom address) and switch back to alternative address the correct VAT Country/Region Code populate correctly. +![Ship-to Custom Address](./ship-to-custom-address.png) diff --git a/dataset/problemstatement/microsoftInternal__NAV-205825__cf-1/confirm-alternative-customer-vat-reg.png b/dataset/problemstatement/microsoftInternal__NAV-205825__cf-1/confirm-alternative-customer-vat-reg.png new file mode 100644 index 000000000..5dba878f8 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-205825__cf-1/confirm-alternative-customer-vat-reg.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-205825__cf-1/custom-more-info.png b/dataset/problemstatement/microsoftInternal__NAV-205825__cf-1/custom-more-info.png new file mode 100644 index 000000000..eab70ac08 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-205825__cf-1/custom-more-info.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-205825__cf-1/customer-2000-more-info.png b/dataset/problemstatement/microsoftInternal__NAV-205825__cf-1/customer-2000-more-info.png new file mode 100644 index 000000000..62332a5b9 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-205825__cf-1/customer-2000-more-info.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-205825__cf-1/customer-2000.png b/dataset/problemstatement/microsoftInternal__NAV-205825__cf-1/customer-2000.png new file mode 100644 index 000000000..6abeaf79f Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-205825__cf-1/customer-2000.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-205825__cf-1/customer-country-region-code.png b/dataset/problemstatement/microsoftInternal__NAV-205825__cf-1/customer-country-region-code.png new file mode 100644 index 000000000..cc1cad804 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-205825__cf-1/customer-country-region-code.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-205825__cf-1/sales-order-change.png b/dataset/problemstatement/microsoftInternal__NAV-205825__cf-1/sales-order-change.png new file mode 100644 index 000000000..602a313c5 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-205825__cf-1/sales-order-change.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-205825__cf-1/sales-order-confirmed.png b/dataset/problemstatement/microsoftInternal__NAV-205825__cf-1/sales-order-confirmed.png new file mode 100644 index 000000000..e14e719aa Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-205825__cf-1/sales-order-confirmed.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-205825__cf-1/sales-order-details.png b/dataset/problemstatement/microsoftInternal__NAV-205825__cf-1/sales-order-details.png new file mode 100644 index 000000000..5d1143f41 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-205825__cf-1/sales-order-details.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-205825__cf-1/ship-to-address-list.png b/dataset/problemstatement/microsoftInternal__NAV-205825__cf-1/ship-to-address-list.png new file mode 100644 index 000000000..0b2cc54fa Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-205825__cf-1/ship-to-address-list.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-205825__cf-1/ship-to-custom-address.png b/dataset/problemstatement/microsoftInternal__NAV-205825__cf-1/ship-to-custom-address.png new file mode 100644 index 000000000..76c69fda9 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-205825__cf-1/ship-to-custom-address.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-205825__cf-1/vat-registration.png b/dataset/problemstatement/microsoftInternal__NAV-205825__cf-1/vat-registration.png new file mode 100644 index 000000000..06cf30712 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-205825__cf-1/vat-registration.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-205825__cf-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-205825__cf-2/README.md new file mode 100644 index 000000000..b14e4382e --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-205825__cf-2/README.md @@ -0,0 +1,37 @@ +# Title: Alternative Customer VAT Registration issue when using Bill to customer and Ship-to-Code. +## Repro Steps: +1. Create the setup for customer 10000 +Customer: 10000 +* Country/Region Code = NL +* VAT Registration No. = 789456278 +* VAT Bus. Posting Group = BINNENLAND +* Ship-to Code exists but has no Country/Region Code +* Bill-to Customer = 20000 +![Customer Card Country/Region Code](./customer-country-region-code.png) + +![Customer Card More Info](./custom-more-info.png) + +2. Customer: 20000 (Bill to customer) + * Country/Region Code = NL + * VAT Registration No. = 254687456 +VAT Bus. Posting Group = BINNENLAND +![Customer 2000](./customer-2000.png) + +![Customer 2000 More Info](./customer-2000-more-info.png) + +3. Alternative Customer VAT Registration +![VAT Registration](./vat-registration.png) + +4. Create Sales document for customer 10000: message "The VAT Country/Region code has been changed to the value that does not have an alternative VAT registration. + +The following fields have been updated from the customer card: VAT Registration No., VAT Bus. Posting Group". + +![Sales Order](./sales-order-change.png) + +5. +Checking through it is expected that no alternative VAT registration is applied when Ship-to Country/Region Code is not defined. +VAT Country/Region Code should remain from the Bill-to Customer. +![Sales Order Details](./sales-order-details.png) + +6. Not until you change the ship-to to another options (Custom address) and switch back to alternative address the correct VAT Country/Region Code populate correctly. +![Ship-to Custom Address](./ship-to-custom-address.png) diff --git a/dataset/problemstatement/microsoftInternal__NAV-205825__cf-2/confirm-alternative-customer-vat-reg.png b/dataset/problemstatement/microsoftInternal__NAV-205825__cf-2/confirm-alternative-customer-vat-reg.png new file mode 100644 index 000000000..5dba878f8 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-205825__cf-2/confirm-alternative-customer-vat-reg.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-205825__cf-2/custom-more-info.png b/dataset/problemstatement/microsoftInternal__NAV-205825__cf-2/custom-more-info.png new file mode 100644 index 000000000..eab70ac08 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-205825__cf-2/custom-more-info.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-205825__cf-2/customer-2000-more-info.png b/dataset/problemstatement/microsoftInternal__NAV-205825__cf-2/customer-2000-more-info.png new file mode 100644 index 000000000..62332a5b9 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-205825__cf-2/customer-2000-more-info.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-205825__cf-2/customer-2000.png b/dataset/problemstatement/microsoftInternal__NAV-205825__cf-2/customer-2000.png new file mode 100644 index 000000000..6abeaf79f Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-205825__cf-2/customer-2000.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-205825__cf-2/customer-country-region-code.png b/dataset/problemstatement/microsoftInternal__NAV-205825__cf-2/customer-country-region-code.png new file mode 100644 index 000000000..cc1cad804 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-205825__cf-2/customer-country-region-code.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-205825__cf-2/sales-order-change.png b/dataset/problemstatement/microsoftInternal__NAV-205825__cf-2/sales-order-change.png new file mode 100644 index 000000000..602a313c5 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-205825__cf-2/sales-order-change.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-205825__cf-2/sales-order-confirmed.png b/dataset/problemstatement/microsoftInternal__NAV-205825__cf-2/sales-order-confirmed.png new file mode 100644 index 000000000..e14e719aa Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-205825__cf-2/sales-order-confirmed.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-205825__cf-2/sales-order-details.png b/dataset/problemstatement/microsoftInternal__NAV-205825__cf-2/sales-order-details.png new file mode 100644 index 000000000..5d1143f41 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-205825__cf-2/sales-order-details.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-205825__cf-2/ship-to-address-list.png b/dataset/problemstatement/microsoftInternal__NAV-205825__cf-2/ship-to-address-list.png new file mode 100644 index 000000000..0b2cc54fa Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-205825__cf-2/ship-to-address-list.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-205825__cf-2/ship-to-custom-address.png b/dataset/problemstatement/microsoftInternal__NAV-205825__cf-2/ship-to-custom-address.png new file mode 100644 index 000000000..76c69fda9 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-205825__cf-2/ship-to-custom-address.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-205825__cf-2/vat-registration.png b/dataset/problemstatement/microsoftInternal__NAV-205825__cf-2/vat-registration.png new file mode 100644 index 000000000..06cf30712 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-205825__cf-2/vat-registration.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-206977__cf-1/1002_test_assembly_step4.png b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-1/1002_test_assembly_step4.png new file mode 100644 index 000000000..78c18e8de Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-1/1002_test_assembly_step4.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-206977__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-1/README.md new file mode 100644 index 000000000..56ad9f7e7 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-1/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-1/assembly_order_step8.png b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-1/assembly_order_step8.png new file mode 100644 index 000000000..71e8fe552 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-1/assembly_order_step8.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-206977__cf-1/blanket_assembly_order_step5.png b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-1/blanket_assembly_order_step5.png new file mode 100644 index 000000000..30ae0c5cb Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-1/blanket_assembly_order_step5.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-206977__cf-1/blanket_sales_order_step2.png b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-1/blanket_sales_order_step2.png new file mode 100644 index 000000000..74a37f304 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-1/blanket_sales_order_step2.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-206977__cf-1/item_card_step1.png b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-1/item_card_step1.png new file mode 100644 index 000000000..29926337c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-1/item_card_step1.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-206977__cf-1/result.png b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-1/result.png new file mode 100644 index 000000000..8022c938c Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-1/result.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-206977__cf-1/select_function_step3.png b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-1/select_function_step3.png new file mode 100644 index 000000000..e25cbc349 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-1/select_function_step3.png differ diff --git a/dataset/problemstatement/microsoftInternal__NAV-206977__cf-1/show_document_step7.png b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-1/show_document_step7.png new file mode 100644 index 000000000..a9a0dce26 Binary files /dev/null and b/dataset/problemstatement/microsoftInternal__NAV-206977__cf-1/show_document_step7.png differ 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..83cdaa1af --- /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 "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-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..31cfc3eab --- /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 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-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-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..4fa12ec6d --- /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 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-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-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..08d01c541 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-207878__cf-1/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-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-208649__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-208649__cf-1/README.md new file mode 100644 index 000000000..31092e4ae --- /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 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-2/README.md b/dataset/problemstatement/microsoftInternal__NAV-208649__cf-2/README.md new file mode 100644 index 000000000..16da66d5b --- /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' = .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..78d727f38 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-208851__cf-1/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-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-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..f57f0706f --- /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 "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-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-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-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-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-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-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..407245777 --- /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 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-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-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..a712211b1 --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-214926__cf-1/README.md @@ -0,0 +1,15 @@ +# Title: Customer Card Statistics Total tripled — remove SalesOutstandingAmountFromShipment from formula +## Repro Steps: +1. Create a new Customer +2. Create inventory for an item (10 PCS) +3. Create a Sales Order for 10 PCS at a known unit price +4. Post the Sales Order with Ship only (no invoice) +5. Create a new Sales Invoice, use Get Shipment Lines, and Release it +6. Open the Customer Card and check the FactBox statistics + +Result: Total ($) shows the amount tripled because Shipped Not Invoiced, Outstanding Invoices, and SalesOutstandingAmountFromShipment all include the same shipment amount. + +Expected: Total ($) should equal the Sales Line "Amount Including VAT". The fix removes SalesOutstandingAmountFromShipment from the formula entirely and only deducts shipment-derived invoice amounts from Outstanding Invoices. + +## Description: +Variant of NAV-214926 (L2: record-selection-change). Alternative fix strategy: instead of keeping SalesOutstandingAmountFromShipment in the formula and subtracting two deduction terms (requiring a new query object), this variant removes SalesOutstandingAmountFromShipment entirely and only subtracts ShippedOutstandingInvoicesLCY from Outstanding Invoices. Simpler fix — no new query file needed, only one new procedure. 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..95014c6ca --- /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: +![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-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..2a2c5c8b4 --- /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 only for outbound quantities (Qty. to Ship > 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-216572__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-216572__cf-1/README.md new file mode 100644 index 000000000..a9aa616a7 --- /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, 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-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-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-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-217974__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-217974__cf-1/README.md new file mode 100644 index 000000000..4c3cc5be5 --- /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 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-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..5653cb830 --- /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 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-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-218062__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-218062__cf-1/README.md new file mode 100644 index 000000000..4752a2e54 --- /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 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-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-218323__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-218323__cf-1/README.md new file mode 100644 index 000000000..6c5461554 --- /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. 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-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-220314__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-220314__cf-1/README.md new file mode 100644 index 000000000..b8ef00caf --- /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 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-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-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-221877__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-221877__cf-1/README.md new file mode 100644 index 000000000..5f1b6d148 --- /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 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-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..dfd0a5c8f --- /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, 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-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..f2b1753c3 --- /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 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-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-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-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..19f3f2bca --- /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 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-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-223202__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-223202__cf-1/README.md new file mode 100644 index 000000000..961642d24 --- /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). +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-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-223493__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-223493__cf-1/README.md new file mode 100644 index 000000000..3e210076c --- /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 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..2c289d67a --- /dev/null +++ b/dataset/problemstatement/microsoftInternal__NAV-223790__cf-1/README.md @@ -0,0 +1,53 @@ +# Title: "Calculate Regenerative 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 + Manufacturing Policy: Make to Stock + Production 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 + ![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 Regenerative Plan. + +ADDITIONAL INFORMATION: +This works as expected in BC 25.7. + +## Description: +When you run "Calculate Regenerative Plan" in a planning worksheet, the component is not planned in the first run, but in the second attempt it is planned. The Stockkeeping Unit setup on the parent item should trigger the Low-Level Code recalculation so that the BOM expansion is up to date before planning runs; today this does not happen until something else forces a recalculation, which is why the second pass succeeds. 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-224447__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-224447__cf-1/README.md new file mode 100644 index 000000000..a8f4228a3 --- /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 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-226875__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-226875__cf-1/README.md new file mode 100644 index 000000000..dc378b39a --- /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, 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-227219__cf-1/README.md b/dataset/problemstatement/microsoftInternal__NAV-227219__cf-1/README.md new file mode 100644 index 000000000..007fa1796 --- /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 (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-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-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..0253b7ee3 --- /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 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-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/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-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-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/cf.json b/docs/_data/cf.json new file mode 100644 index 000000000..de966de0a --- /dev/null +++ b/docs/_data/cf.json @@ -0,0 +1,4 @@ +{ + "runs": [], + "aggregate": [] +} \ No newline at end of file diff --git a/evaluator/counterfactual_scores.py b/evaluator/counterfactual_scores.py new file mode 100644 index 000000000..80903c10d --- /dev/null +++ b/evaluator/counterfactual_scores.py @@ -0,0 +1,18 @@ +"""Counterfactual evaluation scorers in Braintrust scorer format.""" + +from __future__ import annotations + + +class FamilyFragilityRate: + def __call__(self, *, metadata: dict, **kwargs) -> bool: + return metadata.get("fragile", False) + + +class FamilySeverity: + def __call__(self, *, metadata: dict, **kwargs) -> float | None: + return metadata.get("severity") + + +class FamilyStability: + def __call__(self, *, metadata: dict, **kwargs) -> bool: + return metadata.get("stable", False) diff --git a/notebooks/counterfactual-evaluation/experiment1-base-performance.ipynb b/notebooks/counterfactual-evaluation/experiment1-base-performance.ipynb new file mode 100644 index 000000000..7ce548f11 --- /dev/null +++ b/notebooks/counterfactual-evaluation/experiment1-base-performance.ipynb @@ -0,0 +1,127 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "93af8350", + "metadata": {}, + "source": [ + "# Experiment 1: Base Performance (AL)\n", + "\n", + "Instance-level analysis: compile rate, pass rate per model across base entries." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "6d10e9b4", + "metadata": {}, + "outputs": [], + "source": [ + "import sys\n", + "from pathlib import Path\n", + "\n", + "sys.path.insert(0, str(Path.cwd().parent))\n", + "\n", + "from utils import load_aggregate_results\n", + "\n", + "# Configure your setups here after running experiments\n", + "SETUPS: list[str] = [] # e.g. [\"copilot-opus-4-6\", \"claude-code\"]\n", + "SETUP_LABELS: dict[str, str] = {} # e.g. {\"copilot-opus-4-6\": \"Copilot\"}\n", + "\n", + "all_results = load_aggregate_results(category=\"bug-fix\")\n", + "print(f\"Loaded {len(all_results)} setups: {list(all_results.keys())}\")" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "9c06e988", + "metadata": {}, + "outputs": [], + "source": [ + "import pandas as pd\n", + "import plotly.express as px\n", + "\n", + "summary_rows = []\n", + "for setup, df in all_results.items():\n", + " if SETUPS and setup not in SETUPS:\n", + " continue\n", + " label = SETUP_LABELS.get(setup, setup)\n", + " n_runs = df[\"run_id\"].nunique()\n", + " n_instances = df[\"instance_id\"].nunique()\n", + " compile_rate = df[\"build\"].mean() * 100\n", + " pass_rate = df[\"resolved\"].mean() * 100\n", + " summary_rows.append({\n", + " \"Model\": label,\n", + " \"Runs\": n_runs,\n", + " \"Instances\": n_instances,\n", + " \"Compile Rate (%)\": round(compile_rate, 1),\n", + " \"Pass Rate (%)\": round(pass_rate, 1),\n", + " })\n", + "\n", + "summary_df = pd.DataFrame(summary_rows)\n", + "summary_df" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "a3f93eeb", + "metadata": {}, + "outputs": [], + "source": [ + "# Bar chart: compile rate and pass rate per model\n", + "if not summary_df.empty:\n", + " melted = summary_df.melt(\n", + " id_vars=[\"Model\"],\n", + " value_vars=[\"Compile Rate (%)\", \"Pass Rate (%)\"],\n", + " var_name=\"Metric\",\n", + " value_name=\"Rate\",\n", + " )\n", + " fig = px.bar(\n", + " melted, x=\"Model\", y=\"Rate\", color=\"Metric\",\n", + " barmode=\"group\", title=\"AL Base Performance by Model\",\n", + " text_auto=True,\n", + " )\n", + " fig.update_layout(yaxis_range=[0, 100])\n", + " fig.show()" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "766767a3", + "metadata": {}, + "outputs": [], + "source": [ + "# Per-instance resolution heatmap (instances x models)\n", + "if not summary_df.empty:\n", + " frames = []\n", + " for setup, df in all_results.items():\n", + " if SETUPS and setup not in SETUPS:\n", + " continue\n", + " label = SETUP_LABELS.get(setup, setup)\n", + " per_instance = df.groupby(\"instance_id\")[\"resolved\"].mean().reset_index()\n", + " per_instance[\"Model\"] = label\n", + " frames.append(per_instance)\n", + "\n", + " if frames:\n", + " combined = pd.concat(frames)\n", + " pivot = combined.pivot(index=\"instance_id\", columns=\"Model\", values=\"resolved\")\n", + " fig = px.imshow(\n", + " pivot, aspect=\"auto\",\n", + " title=\"Per-Instance Resolution Rate\",\n", + " labels={\"color\": \"Resolved %\"},\n", + " )\n", + " fig.show()" + ] + } + ], + "metadata": { + "language_info": { + "name": "python" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/notebooks/counterfactual-evaluation/experiment2-cf-sensitivity.ipynb b/notebooks/counterfactual-evaluation/experiment2-cf-sensitivity.ipynb new file mode 100644 index 000000000..b983f05bb --- /dev/null +++ b/notebooks/counterfactual-evaluation/experiment2-cf-sensitivity.ipynb @@ -0,0 +1,245 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "5a88f589", + "metadata": {}, + "source": [ + "# Experiment 2: Counterfactual Sensitivity\n", + "\n", + "Family-level analysis: fragility rate, severity distribution, pattern analysis.\n", + "\n", + "**Primary analysis unit**: family (not instance). Family members are correlated, not IID." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "7b135c50", + "metadata": {}, + "outputs": [], + "source": [ + "import sys\n", + "from pathlib import Path\n", + "\n", + "sys.path.insert(0, str(Path.cwd().parent))\n", + "\n", + "import pandas as pd\n", + "import plotly.express as px\n", + "from utils import load_all_results\n", + "\n", + "from bcbench.analysis.family import FamilyOutcome\n", + "from bcbench.analysis.metrics import family_type_distribution, fragility_rate, mean_severity\n", + "\n", + "# Configure after running experiments\n", + "SETUPS: list[str] = [] # e.g. [\"copilot-cf\", \"claude-cf\"]\n", + "SETUP_LABELS: dict[str, str] = {}\n", + "\n", + "# Load CF results\n", + "all_results = load_all_results(category=\"bug-fix\") # CF results stored under bug-fix\n", + "print(f\"Loaded {len(all_results)} setups\")" + ] + }, + { + "cell_type": "markdown", + "id": "21c81e16", + "metadata": {}, + "source": [ + "## Family Outcome Table\n", + "\n", + "Each row = one family. Columns: family_id, layer, base, cf1..cfN, pattern, type, fragile, severity." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "c55d1993", + "metadata": {}, + "outputs": [], + "source": [ + "def families_to_df(families: list[FamilyOutcome]) -> pd.DataFrame:\n", + " rows = []\n", + " for f in families:\n", + " row = {\n", + " \"family_id\": f.family_id,\n", + " \"layer\": f.failure_layer.value if f.failure_layer else \"unclassified\",\n", + " \"base\": int(f.base.passed),\n", + " \"pattern\": str(f.pattern),\n", + " \"type\": f.family_type.value,\n", + " \"fragile\": int(f.is_fragile),\n", + " \"severity\": f.severity,\n", + " \"cf_total\": f.cf_total,\n", + " \"cf_fail_count\": f.cf_fail_count,\n", + " }\n", + " for i, cf in enumerate(f.cfs):\n", + " row[f\"cf{i+1}\"] = int(cf.passed)\n", + " rows.append(row)\n", + " return pd.DataFrame(rows)\n", + "\n", + "\n", + "print(\"Family outcome table builder ready. Load results to populate.\")" + ] + }, + { + "cell_type": "markdown", + "id": "f73746b5", + "metadata": {}, + "source": [ + "## Family Type Distribution" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "6901095c", + "metadata": {}, + "outputs": [], + "source": [ + "def plot_family_type_distribution(families_by_model: dict[str, list[FamilyOutcome]]):\n", + " rows = []\n", + " for model, families in families_by_model.items():\n", + " dist = family_type_distribution(families)\n", + " total = sum(dist.values())\n", + " for ftype, count in dist.items():\n", + " rows.append({\n", + " \"Model\": model,\n", + " \"Family Type\": ftype,\n", + " \"Count\": count,\n", + " \"Proportion (%)\": round(count / total * 100, 1) if total else 0,\n", + " })\n", + "\n", + " df = pd.DataFrame(rows)\n", + " fig = px.bar(\n", + " df, x=\"Model\", y=\"Proportion (%)\", color=\"Family Type\",\n", + " title=\"Family Type Distribution by Model\",\n", + " barmode=\"stack\", text_auto=True,\n", + " color_discrete_map={\n", + " \"stable-correct\": \"#2ecc71\",\n", + " \"fragile\": \"#e74c3c\",\n", + " \"unsolved\": \"#95a5a6\",\n", + " \"inconsistent\": \"#f39c12\",\n", + " },\n", + " )\n", + " fig.show()\n", + " return df\n", + "\n", + "\n", + "print(\"plot_family_type_distribution() ready\")" + ] + }, + { + "cell_type": "markdown", + "id": "0de21e9e", + "metadata": {}, + "source": [ + "## Fragility Rate (Main Thesis Figure)" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "0cc55260", + "metadata": {}, + "outputs": [], + "source": [ + "def plot_fragility_rate(families_by_model: dict[str, list[FamilyOutcome]]):\n", + " rows = []\n", + " for model, families in families_by_model.items():\n", + " rate = fragility_rate(families)\n", + " sev = mean_severity(families)\n", + " rows.append({\n", + " \"Model\": model,\n", + " \"Fragility Rate (%)\": round(rate * 100, 1),\n", + " \"Mean Severity\": round(sev, 3) if sev is not None else None,\n", + " })\n", + "\n", + " df = pd.DataFrame(rows)\n", + " fig = px.bar(\n", + " df, x=\"Model\", y=\"Fragility Rate (%)\",\n", + " title=\"Family Fragility Rate: P(CF fail | Base correct)\",\n", + " text_auto=True,\n", + " color_discrete_sequence=[\"#e74c3c\"],\n", + " )\n", + " fig.update_layout(yaxis_range=[0, 100])\n", + " fig.show()\n", + " return df\n", + "\n", + "\n", + "print(\"plot_fragility_rate() ready\")" + ] + }, + { + "cell_type": "markdown", + "id": "028d9011", + "metadata": {}, + "source": [ + "## Severity Distribution" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "ab3bac23", + "metadata": {}, + "outputs": [], + "source": [ + "def plot_severity_distribution(families_by_model: dict[str, list[FamilyOutcome]]):\n", + " rows = []\n", + " for model, families in families_by_model.items():\n", + " for f in families:\n", + " if f.severity is not None:\n", + " rows.append({\"Model\": model, \"Severity\": f.severity, \"Type\": f.family_type.value})\n", + "\n", + " df = pd.DataFrame(rows)\n", + " if not df.empty:\n", + " fig = px.box(\n", + " df, x=\"Model\", y=\"Severity\", color=\"Model\",\n", + " title=\"Fragility Severity Distribution (N_cf_fail / N_cf)\",\n", + " points=\"all\",\n", + " )\n", + " fig.show()\n", + " return df\n", + "\n", + "\n", + "print(\"plot_severity_distribution() ready\")" + ] + }, + { + "cell_type": "markdown", + "id": "9dd36a11", + "metadata": {}, + "source": [ + "## Pattern Analysis" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "63fc4617", + "metadata": {}, + "outputs": [], + "source": [ + "from collections import Counter\n", + "\n", + "\n", + "def analyze_patterns(families: list[FamilyOutcome]) -> pd.DataFrame:\n", + " pattern_counts = Counter(f.pattern for f in families)\n", + " rows = [\n", + " {\"Pattern\": str(p), \"Count\": c, \"Pct (%)\": round(c / len(families) * 100, 1)}\n", + " for p, c in pattern_counts.most_common()\n", + " ]\n", + " return pd.DataFrame(rows)\n", + "\n", + "\n", + "print(\"analyze_patterns() ready\")" + ] + } + ], + "metadata": { + "language_info": { + "name": "python" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/notebooks/counterfactual-evaluation/experiment3-layered-failure.ipynb b/notebooks/counterfactual-evaluation/experiment3-layered-failure.ipynb new file mode 100644 index 000000000..64e104cc5 --- /dev/null +++ b/notebooks/counterfactual-evaluation/experiment3-layered-failure.ipynb @@ -0,0 +1,217 @@ +{ + "cells": [ + { + "cell_type": "markdown", + "id": "097d3fd7", + "metadata": {}, + "source": [ + "# Experiment 3: Layered Failure Analysis\n", + "\n", + "L1-L5 failure distribution, layer-conditioned fragility, CF-exposed failures.\n", + "\n", + "**Core thesis claim**: AL failures concentrate in L3 (Event-driven), L4 (Workflow), L5 (Toolchain)." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "efb5224d", + "metadata": {}, + "outputs": [], + "source": [ + "import sys\n", + "from pathlib import Path\n", + "\n", + "sys.path.insert(0, str(Path.cwd().parent))\n", + "\n", + "import pandas as pd\n", + "import plotly.express as px\n", + "import plotly.graph_objects as go\n", + "\n", + "from bcbench.analysis.family import FamilyOutcome\n", + "from bcbench.analysis.metrics import (\n", + " cf_exposed_failure_count,\n", + " failure_layer_distribution,\n", + " layer_conditioned_fragility,\n", + ")\n", + "from bcbench.types import FailureLayer\n", + "\n", + "LAYER_ORDER = [layer.value for layer in FailureLayer]\n", + "LAYER_SHORT = {layer.value: layer.name.split(\"_\")[0] for layer in FailureLayer}\n", + "\n", + "print(\"Imports ready. Load families from experiment results to begin analysis.\")" + ] + }, + { + "cell_type": "markdown", + "id": "37071846", + "metadata": {}, + "source": [ + "## L1-L5 Failure Distribution" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "7a9a7509", + "metadata": {}, + "outputs": [], + "source": [ + "def plot_failure_layer_distribution(families_by_model: dict[str, list[FamilyOutcome]]):\n", + " rows = []\n", + " for model, families in families_by_model.items():\n", + " dist = failure_layer_distribution(families)\n", + " total = sum(dist.values()) or 1\n", + " for layer in LAYER_ORDER:\n", + " count = dist.get(layer, 0)\n", + " rows.append({\n", + " \"Model\": model,\n", + " \"Layer\": LAYER_SHORT.get(layer, layer),\n", + " \"Count\": count,\n", + " \"Proportion (%)\": round(count / total * 100, 1),\n", + " })\n", + "\n", + " df = pd.DataFrame(rows)\n", + " fig = px.bar(\n", + " df, x=\"Layer\", y=\"Proportion (%)\", color=\"Model\",\n", + " barmode=\"group\", title=\"Failure Layer Distribution (L1-L5) by Model\",\n", + " text_auto=True,\n", + " category_orders={\"Layer\": [\"L1\", \"L2\", \"L3\", \"L4\", \"L5\"]},\n", + " )\n", + " fig.show()\n", + " return df\n", + "\n", + "\n", + "print(\"plot_failure_layer_distribution() ready\")" + ] + }, + { + "cell_type": "markdown", + "id": "e0adac47", + "metadata": {}, + "source": [ + "## Layer-Conditioned Fragility Heatmap\n", + "\n", + "Fragile family % per layer per model — the core diagnostic matrix." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "0c7e08b6", + "metadata": {}, + "outputs": [], + "source": [ + "def plot_layer_conditioned_fragility(families_by_model: dict[str, list[FamilyOutcome]]):\n", + " models = list(families_by_model.keys())\n", + " layers = [\"L1\", \"L2\", \"L3\", \"L4\", \"L5\"]\n", + " matrix = []\n", + "\n", + " for model in models:\n", + " lcf = layer_conditioned_fragility(families_by_model[model])\n", + " row = [round(lcf.get(layer, 0) * 100, 1) for layer in LAYER_ORDER]\n", + " matrix.append(row)\n", + "\n", + " fig = go.Figure(data=go.Heatmap(\n", + " z=matrix, x=layers, y=models,\n", + " colorscale=\"RdYlGn_r\", text=matrix, texttemplate=\"%{text}%\",\n", + " colorbar_title=\"Fragility %\",\n", + " ))\n", + " fig.update_layout(\n", + " title=\"Layer-Conditioned Fragility: P(CF fail | Base correct) per Layer\",\n", + " xaxis_title=\"Failure Layer\", yaxis_title=\"Model\",\n", + " )\n", + " fig.show()\n", + "\n", + "\n", + "print(\"plot_layer_conditioned_fragility() ready\")" + ] + }, + { + "cell_type": "markdown", + "id": "194609c7", + "metadata": {}, + "source": [ + "## Layer-Conditioned Severity" + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "d8556d7b", + "metadata": {}, + "outputs": [], + "source": [ + "def plot_severity_by_layer(families: list[FamilyOutcome]):\n", + " rows = []\n", + " for f in families:\n", + " if f.failure_layer and f.severity is not None:\n", + " rows.append({\n", + " \"Layer\": LAYER_SHORT.get(f.failure_layer.value, f.failure_layer.value),\n", + " \"Severity\": f.severity,\n", + " \"Type\": f.family_type.value,\n", + " })\n", + "\n", + " df = pd.DataFrame(rows)\n", + " if not df.empty:\n", + " fig = px.box(\n", + " df, x=\"Layer\", y=\"Severity\", color=\"Layer\",\n", + " title=\"Fragility Severity by Failure Layer\",\n", + " points=\"all\",\n", + " category_orders={\"Layer\": [\"L1\", \"L2\", \"L3\", \"L4\", \"L5\"]},\n", + " )\n", + " fig.show()\n", + " return df\n", + "\n", + "\n", + "print(\"plot_severity_by_layer() ready\")" + ] + }, + { + "cell_type": "markdown", + "id": "a199405f", + "metadata": {}, + "source": [ + "## CF-Exposed Failure Analysis\n", + "\n", + "Families where failure ONLY appears in CF (base correct, all CFs fail)." + ] + }, + { + "cell_type": "code", + "execution_count": null, + "id": "bdc9f61b", + "metadata": {}, + "outputs": [], + "source": [ + "def analyze_cf_exposed(families_by_model: dict[str, list[FamilyOutcome]]):\n", + " rows = []\n", + " for model, families in families_by_model.items():\n", + " total = len(families)\n", + " exposed = cf_exposed_failure_count(families)\n", + " fragile = sum(1 for f in families if f.is_fragile)\n", + " rows.append({\n", + " \"Model\": model,\n", + " \"Total Families\": total,\n", + " \"Fragile\": fragile,\n", + " \"CF-Exposed (all CFs fail)\": exposed,\n", + " \"CF-Exposed %\": round(exposed / total * 100, 1) if total else 0,\n", + " })\n", + "\n", + " df = pd.DataFrame(rows)\n", + " print(df.to_string(index=False))\n", + " return df\n", + "\n", + "\n", + "print(\"analyze_cf_exposed() ready\")" + ] + } + ], + "metadata": { + "language_info": { + "name": "python" + } + }, + "nbformat": 4, + "nbformat_minor": 5 +} diff --git a/scripts/BCBenchUtils.psm1 b/scripts/BCBenchUtils.psm1 index 8f7062e2e..7afd5e355 100644 --- a/scripts/BCBenchUtils.psm1 +++ b/scripts/BCBenchUtils.psm1 @@ -342,13 +342,16 @@ function Invoke-GitApplyPatch { # Create temporary patch file [string]$patchPath = Join-Path -Path $env:TEMP -ChildPath "patch_$PatchId.diff" Write-Log "Saving patch to temporary file: $patchPath" -Level Debug - $PatchContent | Out-File -FilePath $patchPath -Encoding utf8 -Force + # Write raw bytes preserving LF line endings — git apply context matching is sensitive + # to BOM and CRLF, both of which Out-File -Encoding utf8 introduces on Windows. + [string]$normalizedContent = $PatchContent -replace "`r`n", "`n" + [System.IO.File]::WriteAllBytes($patchPath, [System.Text.UTF8Encoding]::new($false).GetBytes($normalizedContent)) if ($RepositoryPath) { - $applyResult = git -C $RepositoryPath apply --whitespace=nowarn $patchPath 2>&1 + $applyResult = git -C $RepositoryPath apply --whitespace=nowarn --ignore-whitespace $patchPath 2>&1 } else { - $applyResult = git apply --whitespace=nowarn $patchPath 2>&1 + $applyResult = git apply --whitespace=nowarn --ignore-whitespace $patchPath 2>&1 } if ($LASTEXITCODE -ne 0) { diff --git a/scripts/DatasetEntry.psm1 b/scripts/DatasetEntry.psm1 index 0159855e0..cba83fffa 100644 --- a/scripts/DatasetEntry.psm1 +++ b/scripts/DatasetEntry.psm1 @@ -27,6 +27,7 @@ class DatasetEntry { # Properties based on the dataset schema [string]$repo [string]$instance_id + [string]$base_instance_id [string]$patch [string]$base_commit [string]$hints_text @@ -42,6 +43,7 @@ class DatasetEntry { DatasetEntry([PSObject]$jsonObject) { $this.repo = $jsonObject.repo $this.instance_id = $jsonObject.instance_id + $this.base_instance_id = $jsonObject.base_instance_id $this.patch = $jsonObject.patch $this.base_commit = $jsonObject.base_commit $this.hints_text = $jsonObject.hints_text @@ -107,6 +109,40 @@ function Get-DatasetEntries { } } + # Merge base-entry fields into counterfactual entries (which only carry CF-specific overrides). + $needsBaseMerge = $entries | Where-Object { $_.base_instance_id -and -not $_.repo } + if ($needsBaseMerge) { + $baseDatasetPath = Join-Path -Path (Split-Path -Parent $DatasetPath) -ChildPath "bcbench.jsonl" + if (-not (Test-Path $baseDatasetPath)) { + throw "Base dataset file not found at: $baseDatasetPath (required to resolve counterfactual entries)" + } + Write-Verbose "Loading base entries from $baseDatasetPath to resolve $($needsBaseMerge.Count) CF entries" + $baseEntriesById = @{} + $baseContent = Get-Content $baseDatasetPath -Raw + $baseObjects = $baseContent -split '(?<=})\s*\n(?=\{)' | Where-Object { $_.Trim().Length -gt 0 } + foreach ($baseJson in $baseObjects) { + try { + $baseObj = $baseJson.Trim() | ConvertFrom-Json + $baseEntriesById[$baseObj.instance_id] = [DatasetEntry]::new($baseObj) + } + catch { + Write-Warning "Failed to parse base entry: $_" + } + } + foreach ($cf in $needsBaseMerge) { + $base = $baseEntriesById[$cf.base_instance_id] + if (-not $base) { + throw "Base entry '$($cf.base_instance_id)' not found in $baseDatasetPath for CF entry '$($cf.instance_id)'" + } + if (-not $cf.repo) { $cf.repo = $base.repo } + if (-not $cf.base_commit) { $cf.base_commit = $base.base_commit } + if (-not $cf.environment_setup_version) { $cf.environment_setup_version = $base.environment_setup_version } + if (-not $cf.created_at) { $cf.created_at = $base.created_at } + if (-not $cf.hints_text) { $cf.hints_text = $base.hints_text } + if (-not $cf.project_paths -or $cf.project_paths.Count -eq 0) { $cf.project_paths = $base.project_paths } + } + } + if ($Version) { $entries = $entries | Where-Object { $_.environment_setup_version -eq $Version } } diff --git a/scripts/Setup-ContainerAndRepository.ps1 b/scripts/Setup-ContainerAndRepository.ps1 index 77f6d8d4b..dd1227169 100644 --- a/scripts/Setup-ContainerAndRepository.ps1 +++ b/scripts/Setup-ContainerAndRepository.ps1 @@ -10,7 +10,7 @@ param( [string]$InstanceId, [Parameter(Mandatory = $false)] - [string]$DatasetPath = (Get-BCBenchDatasetPath), + [string]$DatasetPath, [Parameter(Mandatory = $false)] [string]$Country = "w1", @@ -31,6 +31,11 @@ param( [switch]$SkipContainer ) +if (-not $DatasetPath) { + $datasetName = if ($InstanceId -match '__cf-\d+$') { "counterfactual.jsonl" } else { "bcbench.jsonl" } + $DatasetPath = Get-BCBenchDatasetPath -DatasetName $datasetName +} + [DatasetEntry[]] $entries = Get-DatasetEntries -DatasetPath $DatasetPath -Version $Version -InstanceId $InstanceId if ($InstanceId) { $Version = $entries[0].environment_setup_version diff --git a/scripts/Verify-BuildAndTests.ps1 b/scripts/Verify-BuildAndTests.ps1 index 477da27cb..9c4fb9415 100644 --- a/scripts/Verify-BuildAndTests.ps1 +++ b/scripts/Verify-BuildAndTests.ps1 @@ -11,7 +11,7 @@ param( [string]$InstanceId, [Parameter(Mandatory = $false)] - [string]$DatasetPath = (Get-BCBenchDatasetPath), + [string]$DatasetPath, [Parameter(Mandatory = $true)] [string]$RepoPath, @@ -26,6 +26,11 @@ param( [SecureString]$Password ) +if (-not $DatasetPath) { + $datasetName = if ($InstanceId -match '__cf-\d+$') { "counterfactual.jsonl" } else { "bcbench.jsonl" } + $DatasetPath = Get-BCBenchDatasetPath -DatasetName $datasetName +} + [DatasetEntry[]] $entries = Get-DatasetEntries -DatasetPath $DatasetPath -Version $Version -InstanceId $InstanceId if ($InstanceId) { $Version = $entries[0].environment_setup_version diff --git a/src/bcbench/agent/shared/config.yaml b/src/bcbench/agent/shared/config.yaml index e8275d859..065b1d39c 100644 --- a/src/bcbench/agent/shared/config.yaml +++ b/src/bcbench/agent/shared/config.yaml @@ -26,6 +26,25 @@ prompt: Issue details: {{task}} + counterfactual-template: | + You are working with a Business Central (AL) code repository at {{repo_path}}. + + Task: Fix the issue described below {% if include_project_paths %}in the following projects: {{project_paths}}{% endif %} + + Important constraints: + - Do NOT modify any testing logic or test files + - Focus solely on fixing the reported issue + {% if al_mcp %} + - Do NOT try to run tests + {% else %} + - Do NOT try to build or run tests, just provide the code changes needed + {% endif %} + - Do NOT commit any changes to the repository + - Focus on W1 localization, do NOT worry about other localiations (e.g. DK, APAC) + + Issue details: + {{task}} + test-generation-template: | You are working with a Business Central (AL) code repository at {{repo_path}}. {% if is_gold_patch and is_problem_statement %} diff --git a/src/bcbench/agent/shared/prompt.py b/src/bcbench/agent/shared/prompt.py index 1dd36d360..f5a246e03 100644 --- a/src/bcbench/agent/shared/prompt.py +++ b/src/bcbench/agent/shared/prompt.py @@ -17,7 +17,7 @@ def _transform_image_paths(content: str) -> str: def build_prompt(entry: BaseDatasetEntry, repo_path: Path, config: dict, category: EvaluationCategory, al_mcp: bool = False) -> str: prompt_config = config.get("prompt", {}) - template_str = prompt_config.get(f"{category.value}-template") + template_str = prompt_config.get(f"{category.prompt_template_key}-template") include_project_paths = prompt_config.get("include_project_paths") test_gen_input: str = prompt_config.get("test-generation-input", "problem-statement") diff --git a/src/bcbench/analysis/__init__.py b/src/bcbench/analysis/__init__.py new file mode 100644 index 000000000..b3a5d9f97 --- /dev/null +++ b/src/bcbench/analysis/__init__.py @@ -0,0 +1,25 @@ +"""Analysis module for family-level counterfactual evaluation.""" + +from bcbench.analysis.aggregator import build_families +from bcbench.analysis.family import FamilyOutcome, FamilyType, InstanceResult +from bcbench.analysis.metrics import ( + cf_exposed_failure_count, + failure_layer_distribution, + family_type_distribution, + fragility_rate, + layer_conditioned_fragility, + mean_severity, +) + +__all__ = [ + "FamilyOutcome", + "FamilyType", + "InstanceResult", + "build_families", + "cf_exposed_failure_count", + "failure_layer_distribution", + "family_type_distribution", + "fragility_rate", + "layer_conditioned_fragility", + "mean_severity", +] diff --git a/src/bcbench/analysis/aggregator.py b/src/bcbench/analysis/aggregator.py new file mode 100644 index 000000000..d2303576d --- /dev/null +++ b/src/bcbench/analysis/aggregator.py @@ -0,0 +1,75 @@ +"""Aggregate instance-level results into family-level outcomes.""" + +from __future__ import annotations + +import re +from collections import defaultdict + +from bcbench.analysis.family import FamilyOutcome, InstanceResult +from bcbench.results.base import ExecutionBasedEvaluationResult +from bcbench.types import FailureLayer + +_CF_PATTERN = re.compile(r"^(.+)__cf-\d+$") + + +def _extract_base_id(instance_id: str) -> str | None: + m = _CF_PATTERN.match(instance_id) + return m.group(1) if m else None + + +def build_families( + results: list[ExecutionBasedEvaluationResult], + failure_layers: dict[str, FailureLayer] | None = None, +) -> list[FamilyOutcome]: + """Group results into families and compute family-level outcomes. + + Args: + results: All instance-level results (base + CF) for a single model run. + failure_layers: Optional map of base_instance_id -> FailureLayer. + """ + if failure_layers is None: + failure_layers = {} + + base_results: dict[str, ExecutionBasedEvaluationResult] = {} + cf_results: dict[str, list[ExecutionBasedEvaluationResult]] = defaultdict(list) + + for result in results: + base_id = _extract_base_id(result.instance_id) + if base_id is not None: + cf_results[base_id].append(result) + else: + base_results[result.instance_id] = result + + families: list[FamilyOutcome] = [] + for base_id, base_result in base_results.items(): + cfs = cf_results.get(base_id, []) + if not cfs: + continue + + base_inst = InstanceResult( + instance_id=base_result.instance_id, + is_base=True, + compiled=base_result.build, + passed=base_result.resolved, + ) + + cf_insts = tuple( + InstanceResult( + instance_id=cf.instance_id, + is_base=False, + compiled=cf.build, + passed=cf.resolved, + ) + for cf in sorted(cfs, key=lambda c: c.instance_id) + ) + + families.append( + FamilyOutcome( + family_id=base_id, + failure_layer=failure_layers.get(base_id), + base=base_inst, + cfs=cf_insts, + ) + ) + + return sorted(families, key=lambda f: f.family_id) diff --git a/src/bcbench/analysis/annotation.py b/src/bcbench/analysis/annotation.py new file mode 100644 index 000000000..1052eb4d6 --- /dev/null +++ b/src/bcbench/analysis/annotation.py @@ -0,0 +1,74 @@ +"""Sample failed instances for manual failure-layer annotation.""" + +from __future__ import annotations + +import csv +from pathlib import Path + +from bcbench.analysis.family import FamilyOutcome, FamilyType, InstanceResult +from bcbench.logger import get_logger + +logger = get_logger(__name__) + +ANNOTATION_COLUMNS = [ + "family_id", + "instance_id", + "family_type", + "pattern", + "failure_layer", + "base_passed", + "cf_passed", + "primary_failure_layer", + "error_evidence", + "annotator_notes", +] + + +def sample_failures( + families: list[FamilyOutcome], + max_samples: int | None = None, +) -> list[dict[str, str]]: + priority = [FamilyType.FRAGILE, FamilyType.UNSOLVED, FamilyType.INCONSISTENT] + sorted_families = sorted(families, key=lambda f: priority.index(f.family_type) if f.family_type in priority else 99) + + rows: list[dict[str, str]] = [] + for family in sorted_families: + if family.family_type == FamilyType.STABLE_CORRECT: + continue + + if not family.base.passed: + rows.append(_make_row(family, family.base)) + + for cf in family.cfs: + if not cf.passed: + rows.append(_make_row(family, cf)) + + if max_samples and len(rows) >= max_samples: + rows = rows[:max_samples] + break + + return rows + + +def _make_row(family: FamilyOutcome, instance: InstanceResult) -> dict[str, str]: + return { + "family_id": family.family_id, + "instance_id": instance.instance_id, + "family_type": family.family_type.value, + "pattern": str(family.pattern), + "failure_layer": family.failure_layer.value if family.failure_layer else "", + "base_passed": str(int(family.base.passed)), + "cf_passed": ",".join(str(int(cf.passed)) for cf in family.cfs), + "primary_failure_layer": "", + "error_evidence": "", + "annotator_notes": "", + } + + +def write_annotation_csv(rows: list[dict[str, str]], output_path: Path) -> None: + output_path.parent.mkdir(parents=True, exist_ok=True) + with open(output_path, "w", newline="", encoding="utf-8") as f: + writer = csv.DictWriter(f, fieldnames=ANNOTATION_COLUMNS) + writer.writeheader() + writer.writerows(rows) + logger.info(f"Wrote {len(rows)} annotation rows to {output_path}") diff --git a/src/bcbench/analysis/family.py b/src/bcbench/analysis/family.py new file mode 100644 index 000000000..58b2c856f --- /dev/null +++ b/src/bcbench/analysis/family.py @@ -0,0 +1,70 @@ +"""Family-level evaluation data models. + +The primary analysis unit is the family, not the individual instance. +Family members (base + CFs) are correlated samples sharing the same task +skeleton — they are NOT independent IID samples. +""" + +from __future__ import annotations + +from dataclasses import dataclass +from enum import Enum + +from bcbench.types import FailureLayer + + +class FamilyType(str, Enum): + STABLE_CORRECT = "stable-correct" + FRAGILE = "fragile" + UNSOLVED = "unsolved" + INCONSISTENT = "inconsistent" + + +@dataclass(frozen=True) +class InstanceResult: + instance_id: str + is_base: bool + compiled: bool + passed: bool + + +@dataclass(frozen=True) +class FamilyOutcome: + family_id: str + failure_layer: FailureLayer | None + base: InstanceResult + cfs: tuple[InstanceResult, ...] + + @property + def pattern(self) -> tuple[int, ...]: + return (int(self.base.passed), *(int(cf.passed) for cf in self.cfs)) + + @property + def family_type(self) -> FamilyType: + if self.base.passed and all(cf.passed for cf in self.cfs): + return FamilyType.STABLE_CORRECT + if self.base.passed and any(not cf.passed for cf in self.cfs): + return FamilyType.FRAGILE + if not self.base.passed and any(cf.passed for cf in self.cfs): + return FamilyType.INCONSISTENT + return FamilyType.UNSOLVED + + @property + def is_fragile(self) -> bool: + return self.family_type == FamilyType.FRAGILE + + @property + def cf_fail_count(self) -> int: + return sum(1 for cf in self.cfs if not cf.passed) + + @property + def cf_total(self) -> int: + return len(self.cfs) + + @property + def severity(self) -> float | None: + if self.family_type not in (FamilyType.FRAGILE, FamilyType.STABLE_CORRECT): + return None + if not self.cfs: + return None + return self.cf_fail_count / self.cf_total diff --git a/src/bcbench/analysis/metrics.py b/src/bcbench/analysis/metrics.py new file mode 100644 index 000000000..c324abaa6 --- /dev/null +++ b/src/bcbench/analysis/metrics.py @@ -0,0 +1,43 @@ +"""Aggregate diagnostic metrics computed across families.""" + +from __future__ import annotations + +from collections import Counter + +from bcbench.analysis.family import FamilyOutcome, FamilyType + + +def family_type_distribution(families: list[FamilyOutcome]) -> dict[str, int]: + return dict(Counter(f.family_type.value for f in families)) + + +def fragility_rate(families: list[FamilyOutcome]) -> float: + eligible = [f for f in families if f.base.passed] + if not eligible: + return 0.0 + return sum(1 for f in eligible if f.is_fragile) / len(eligible) + + +def mean_severity(families: list[FamilyOutcome]) -> float | None: + severities = [f.severity for f in families if f.severity is not None] + if not severities: + return None + return sum(severities) / len(severities) + + +def layer_conditioned_fragility(families: list[FamilyOutcome]) -> dict[str, float]: + by_layer: dict[str, list[FamilyOutcome]] = {} + for f in families: + if f.failure_layer is None: + continue + by_layer.setdefault(f.failure_layer.value, []).append(f) + return {layer: fragility_rate(fams) for layer, fams in sorted(by_layer.items())} + + +def failure_layer_distribution(families: list[FamilyOutcome]) -> dict[str, int]: + counts = Counter(f.failure_layer.value for f in families if f.failure_layer is not None) + return dict(sorted(counts.items())) + + +def cf_exposed_failure_count(families: list[FamilyOutcome]) -> int: + return sum(1 for f in families if f.family_type == FamilyType.FRAGILE and f.cf_fail_count == f.cf_total) diff --git a/src/bcbench/commands/dataset.py b/src/bcbench/commands/dataset.py index 9edda13a7..73293db6f 100644 --- a/src/bcbench/commands/dataset.py +++ b/src/bcbench/commands/dataset.py @@ -52,7 +52,11 @@ def list_entries( diff_output: str = result.stdout entry_ids: list[str] = _modified_instance_ids_from_diff(diff_output) else: - entries: list[BaseDatasetEntry] = entry_cls.load(resolved_path, random=4 if test_run else None) + entries: list[BaseDatasetEntry] = entry_cls.load(resolved_path) + if test_run: + import random as random_module + + entries = random_module.sample(entries, min(4, len(entries))) entry_ids: list[str] = [e.instance_id for e in entries] print(f"Found {len(entry_ids)} entry(ies){' (modified only)' if modified_only else ''}:") diff --git a/src/bcbench/dataset/__init__.py b/src/bcbench/dataset/__init__.py index 4e6e205fa..b14f7ee96 100644 --- a/src/bcbench/dataset/__init__.py +++ b/src/bcbench/dataset/__init__.py @@ -1,10 +1,12 @@ """Dataset module for querying, validating and analyze dataset entries.""" +from bcbench.dataset.counterfactual_entry import CounterfactualEntry from bcbench.dataset.dataset_entry import BaseDatasetEntry, BugFixEntry, TestEntry, TestGenEntry __all__ = [ "BaseDatasetEntry", "BugFixEntry", + "CounterfactualEntry", "TestEntry", "TestGenEntry", ] diff --git a/src/bcbench/dataset/counterfactual_entry.py b/src/bcbench/dataset/counterfactual_entry.py new file mode 100644 index 000000000..ffe15ec59 --- /dev/null +++ b/src/bcbench/dataset/counterfactual_entry.py @@ -0,0 +1,109 @@ +"""Counterfactual dataset entry model. + +CF entries are lightweight variants of base bug-fix entries. They share the same +repo state (repo, base_commit, project_paths) but provide a different fix and test pair. +At load time, base entry fields are resolved from bcbench.jsonl. +""" + +from __future__ import annotations + +from pathlib import Path +from typing import Self + +from pydantic import Field + +from bcbench.config import get_config +from bcbench.dataset.dataset_entry import _BugFixTestGenBase + +_config = get_config() + +_CF_INSTANCE_PATTERN = r"^[a-zA-Z0-9_-]+__[a-zA-Z0-9_-]+-[0-9]+__cf-[0-9]+$" + +__all__ = ["CounterfactualEntry"] + + +class CounterfactualEntry(_BugFixTestGenBase): + """Dataset entry for the counterfactual evaluation category. + + Inherits all execution fields from _BugFixTestGenBase (patch, test_patch, + FAIL_TO_PASS, PASS_TO_PASS) and adds CF-specific metadata. + + At load time, missing fields (repo, base_commit, project_paths, etc.) + are resolved from the base entry in bcbench.jsonl. + """ + + instance_id: str = Field(pattern=_CF_INSTANCE_PATTERN) + + base_instance_id: str + variant_description: str = "" + failure_layer: str | None = None + problem_statement_override: str | None = None + + @property + def problem_statement_dir(self) -> Path: + if self.problem_statement_override: + return _config.paths.bc_bench_root / self.problem_statement_override + return _config.paths.problem_statement_dir / self.instance_id + + def get_expected_output(self) -> str: + return self.patch + + @classmethod + def load(cls, dataset_path: Path, entry_id: str | None = None, random: int | None = None) -> list[Self]: + from bcbench.dataset.dataset_entry import BugFixEntry + + base_dataset_path = _config.paths.dataset_dir / "bcbench.jsonl" + base_entries = {e.instance_id: e for e in BugFixEntry.load(base_dataset_path)} + + raw_entries = _load_raw_entries(dataset_path, entry_id) + + resolved: list[Self] = [] + for raw in raw_entries: + base = base_entries.get(raw["base_instance_id"]) + if base is None: + raise ValueError(f"Base entry '{raw['base_instance_id']}' not found for CF entry '{raw['instance_id']}'") + + merged = { + "repo": base.repo, + "base_commit": base.base_commit, + "created_at": base.created_at, + "environment_setup_version": base.environment_setup_version, + "project_paths": list(base.project_paths), + "metadata": base.metadata.model_dump(), + **raw, + } + resolved.append(cls.model_validate(merged)) + + if random is not None and random > 0: + import random as random_module + + return random_module.sample(resolved, min(random, len(resolved))) + + return resolved + + +def _load_raw_entries(dataset_path: Path, entry_id: str | None) -> list[dict]: + import json + + if not dataset_path.exists(): + raise FileNotFoundError(f"Dataset file not found: {dataset_path}") + + entries: list[dict] = [] + with open(dataset_path, encoding="utf-8") as f: + for line in f: + stripped = line.strip() + if not stripped: + continue + data = json.loads(stripped) + if entry_id: + if data["instance_id"] == entry_id: + return [data] + continue + entries.append(data) + + if entry_id: + from bcbench.exceptions import EntryNotFoundError + + raise EntryNotFoundError(entry_id) + + return entries diff --git a/src/bcbench/types.py b/src/bcbench/types.py index 59021dbad..5eef875df 100644 --- a/src/bcbench/types.py +++ b/src/bcbench/types.py @@ -97,13 +97,25 @@ def get_target_dir(self, repo_path: Path) -> Path: class EvaluationCategory(StrEnum): BUG_FIX = "bug-fix" TEST_GENERATION = "test-generation" - # CODE_REVIEW = "code-review" - # EVENT_REQUEST = "event-request" + CF = "cf" + + @property + def is_counterfactual(self) -> bool: + return self == EvaluationCategory.CF + + @property + def prompt_template_key(self) -> str: + if self.is_counterfactual: + return "counterfactual" + return self.value @property def dataset_path(self) -> Path: from bcbench.config import get_config + if self.is_counterfactual: + return get_config().paths.dataset_dir / "counterfactual.jsonl" + match self: case EvaluationCategory.BUG_FIX: return get_config().paths.dataset_dir / "bcbench.jsonl" @@ -115,6 +127,10 @@ def dataset_path(self) -> Path: @property def entry_class(self) -> type[BaseDatasetEntry]: from bcbench.dataset import BugFixEntry, TestGenEntry + from bcbench.dataset.counterfactual_entry import CounterfactualEntry + + if self.is_counterfactual: + return CounterfactualEntry match self: case EvaluationCategory.BUG_FIX: @@ -129,6 +145,9 @@ def result_class(self) -> type[BaseEvaluationResult]: from bcbench.results.bugfix import BugFixResult from bcbench.results.testgeneration import TestGenerationResult + if self.is_counterfactual: + return BugFixResult + match self: case EvaluationCategory.BUG_FIX: return BugFixResult @@ -142,18 +161,15 @@ def summary_class(self) -> type[EvaluationResultSummary]: """Returns the EvaluationResultSummary subclass for this category.""" from bcbench.results.summary import ExecutionBasedEvaluationResultSummary - match self: - case EvaluationCategory.BUG_FIX: - return ExecutionBasedEvaluationResultSummary - case EvaluationCategory.TEST_GENERATION: - return ExecutionBasedEvaluationResultSummary - - raise ValueError(f"Unknown evaluation category: {self}") + return ExecutionBasedEvaluationResultSummary @property def pipeline(self) -> EvaluationPipeline: from bcbench.evaluate import BugFixPipeline, TestGenerationPipeline + if self.is_counterfactual: + return BugFixPipeline() + match self: case EvaluationCategory.BUG_FIX: return BugFixPipeline() diff --git a/tests/test_counterfactual.py b/tests/test_counterfactual.py new file mode 100644 index 000000000..3f00b62f8 --- /dev/null +++ b/tests/test_counterfactual.py @@ -0,0 +1,195 @@ +"""Tests for counterfactual dataset entry loading and resolution.""" + +import json +from pathlib import Path +from unittest.mock import patch + +import pytest + +from bcbench.dataset import CounterfactualEntry +from bcbench.exceptions import EntryNotFoundError +from bcbench.types import EvaluationCategory +from tests.conftest import ( + VALID_BASE_COMMIT, + VALID_CREATED_AT, + VALID_ENVIRONMENT_VERSION, + VALID_PATCH, + VALID_PROJECT_PATHS, + VALID_REPO, + VALID_TEST_PATCH, +) + +BASE_INSTANCE_ID = "microsoftInternal__NAV-123456" +CF_INSTANCE_ID = "microsoftInternal__NAV-123456__cf-1" + + +def _create_base_jsonl(path: Path) -> Path: + base_entry = { + "instance_id": BASE_INSTANCE_ID, + "repo": VALID_REPO, + "base_commit": VALID_BASE_COMMIT, + "environment_setup_version": VALID_ENVIRONMENT_VERSION, + "project_paths": VALID_PROJECT_PATHS, + "patch": VALID_PATCH, + "test_patch": VALID_TEST_PATCH, + "created_at": VALID_CREATED_AT, + "FAIL_TO_PASS": [{"codeunitID": 100, "functionName": ["TestFunction"]}], + "PASS_TO_PASS": [], + } + file = path / "bcbench.jsonl" + file.write_text(json.dumps(base_entry) + "\n", encoding="utf-8") + return file + + +def _create_cf_jsonl(path: Path, instance_id: str = CF_INSTANCE_ID) -> Path: + cf_entry = { + "instance_id": instance_id, + "base_instance_id": BASE_INSTANCE_ID, + "variant_description": "Test variant", + "failure_layer": None, + "problem_statement_override": None, + "FAIL_TO_PASS": [{"codeunitID": 100, "functionName": ["TestFunction"]}], + "PASS_TO_PASS": [], + "test_patch": VALID_TEST_PATCH, + "patch": VALID_PATCH, + } + file = path / "counterfactual.jsonl" + file.write_text(json.dumps(cf_entry) + "\n", encoding="utf-8") + return file + + +class TestCounterfactualEntryLoading: + def test_load_resolves_base_fields(self, tmp_path): + _create_base_jsonl(tmp_path) + cf_file = _create_cf_jsonl(tmp_path) + + with patch("bcbench.dataset.counterfactual_entry._config") as mock_config: + mock_config.paths.dataset_dir = tmp_path + mock_config.paths.bc_bench_root = tmp_path + mock_config.paths.problem_statement_dir = tmp_path / "problemstatement" + mock_config.file_patterns.instance_pattern = r"^[a-zA-Z0-9_-]+__[a-zA-Z0-9_-]+-[0-9]+$" + mock_config.file_patterns.problem_statement_readme = "README.md" + + entries = CounterfactualEntry.load(cf_file) + + assert len(entries) == 1 + entry = entries[0] + assert entry.instance_id == CF_INSTANCE_ID + assert entry.base_instance_id == BASE_INSTANCE_ID + assert entry.repo == VALID_REPO + assert entry.base_commit == VALID_BASE_COMMIT + assert entry.environment_setup_version == VALID_ENVIRONMENT_VERSION + assert list(entry.project_paths) == VALID_PROJECT_PATHS + + def test_load_by_entry_id(self, tmp_path): + _create_base_jsonl(tmp_path) + cf_file = _create_cf_jsonl(tmp_path) + + with patch("bcbench.dataset.counterfactual_entry._config") as mock_config: + mock_config.paths.dataset_dir = tmp_path + mock_config.paths.bc_bench_root = tmp_path + mock_config.paths.problem_statement_dir = tmp_path / "problemstatement" + mock_config.file_patterns.instance_pattern = r"^[a-zA-Z0-9_-]+__[a-zA-Z0-9_-]+-[0-9]+$" + mock_config.file_patterns.problem_statement_readme = "README.md" + + entries = CounterfactualEntry.load(cf_file, entry_id=CF_INSTANCE_ID) + + assert len(entries) == 1 + assert entries[0].instance_id == CF_INSTANCE_ID + + def test_load_missing_base_raises(self, tmp_path): + cf_file = _create_cf_jsonl(tmp_path) + empty_base = tmp_path / "bcbench.jsonl" + empty_base.write_text("", encoding="utf-8") + + with patch("bcbench.dataset.counterfactual_entry._config") as mock_config: + mock_config.paths.dataset_dir = tmp_path + mock_config.paths.bc_bench_root = tmp_path + mock_config.paths.problem_statement_dir = tmp_path / "problemstatement" + mock_config.file_patterns.instance_pattern = r"^[a-zA-Z0-9_-]+__[a-zA-Z0-9_-]+-[0-9]+$" + mock_config.file_patterns.problem_statement_readme = "README.md" + + with pytest.raises(ValueError, match="Base entry"): + CounterfactualEntry.load(cf_file) + + def test_load_entry_not_found_raises(self, tmp_path): + _create_base_jsonl(tmp_path) + cf_file = _create_cf_jsonl(tmp_path) + + with patch("bcbench.dataset.counterfactual_entry._config") as mock_config: + mock_config.paths.dataset_dir = tmp_path + mock_config.paths.bc_bench_root = tmp_path + mock_config.paths.problem_statement_dir = tmp_path / "problemstatement" + mock_config.file_patterns.instance_pattern = r"^[a-zA-Z0-9_-]+__[a-zA-Z0-9_-]+-[0-9]+$" + mock_config.file_patterns.problem_statement_readme = "README.md" + + with pytest.raises(EntryNotFoundError): + CounterfactualEntry.load(cf_file, entry_id="nonexistent__NAV-999__cf-1") + + +class TestCounterfactualEntrySchema: + def test_get_expected_output_returns_patch(self, tmp_path): + _create_base_jsonl(tmp_path) + cf_file = _create_cf_jsonl(tmp_path) + + with patch("bcbench.dataset.counterfactual_entry._config") as mock_config: + mock_config.paths.dataset_dir = tmp_path + mock_config.paths.bc_bench_root = tmp_path + mock_config.paths.problem_statement_dir = tmp_path / "problemstatement" + mock_config.file_patterns.instance_pattern = r"^[a-zA-Z0-9_-]+__[a-zA-Z0-9_-]+-[0-9]+$" + mock_config.file_patterns.problem_statement_readme = "README.md" + + entry = CounterfactualEntry.load(cf_file)[0] + + assert entry.get_expected_output() == VALID_PATCH + + def test_problem_statement_override_used(self, tmp_path): + _create_base_jsonl(tmp_path) + + cf_entry = { + "instance_id": CF_INSTANCE_ID, + "base_instance_id": BASE_INSTANCE_ID, + "variant_description": "Test variant", + "failure_layer": None, + "problem_statement_override": "dataset/problemstatement/microsoftInternal__NAV-123456__cf-1", + "FAIL_TO_PASS": [{"codeunitID": 100, "functionName": ["TestFunction"]}], + "PASS_TO_PASS": [], + "test_patch": VALID_TEST_PATCH, + "patch": VALID_PATCH, + } + cf_file = tmp_path / "counterfactual.jsonl" + cf_file.write_text(json.dumps(cf_entry) + "\n", encoding="utf-8") + + with patch("bcbench.dataset.counterfactual_entry._config") as mock_config: + mock_config.paths.dataset_dir = tmp_path + mock_config.paths.bc_bench_root = tmp_path + mock_config.paths.problem_statement_dir = tmp_path / "problemstatement" + mock_config.file_patterns.instance_pattern = r"^[a-zA-Z0-9_-]+__[a-zA-Z0-9_-]+-[0-9]+$" + mock_config.file_patterns.problem_statement_readme = "README.md" + + entry = CounterfactualEntry.load(cf_file)[0] + + assert "cf-1" in str(entry.problem_statement_dir) + + +class TestCounterfactualCategory: + def test_category_properties(self): + cat = EvaluationCategory.CF + assert cat.value == "cf" + assert cat.is_counterfactual + assert cat.prompt_template_key == "counterfactual" + assert cat.dataset_path.name == "counterfactual.jsonl" + assert cat.entry_class is CounterfactualEntry + assert cat.pipeline is not None + assert cat.summary_class is not None + assert cat.result_class is not None + + def test_non_cf_categories_are_not_counterfactual(self): + assert not EvaluationCategory.BUG_FIX.is_counterfactual + assert not EvaluationCategory.TEST_GENERATION.is_counterfactual + + def test_reuses_bugfix_pipeline(self): + from bcbench.evaluate import BugFixPipeline + + pipeline = EvaluationCategory.CF.pipeline + assert isinstance(pipeline, BugFixPipeline) diff --git a/tests/test_family_analysis.py b/tests/test_family_analysis.py new file mode 100644 index 000000000..1093ec079 --- /dev/null +++ b/tests/test_family_analysis.py @@ -0,0 +1,181 @@ +"""Tests for family-level evaluation models, aggregation, and metrics.""" + +import pytest + +from bcbench.analysis.aggregator import build_families +from bcbench.analysis.family import FamilyOutcome, FamilyType, InstanceResult +from bcbench.analysis.metrics import ( + cf_exposed_failure_count, + failure_layer_distribution, + family_type_distribution, + fragility_rate, + layer_conditioned_fragility, + mean_severity, +) +from bcbench.results.base import ExecutionBasedEvaluationResult +from bcbench.types import EvaluationCategory, FailureLayer + + +def _inst(instance_id: str, *, is_base: bool, compiled: bool, passed: bool) -> InstanceResult: + return InstanceResult(instance_id=instance_id, is_base=is_base, compiled=compiled, passed=passed) + + +def _family( + family_id: str, + base_passed: bool, + cf_passed: list[bool], + layer: FailureLayer | None = None, +) -> FamilyOutcome: + base = _inst(family_id, is_base=True, compiled=True, passed=base_passed) + cfs = tuple(_inst(f"{family_id}__cf-{i + 1}", is_base=False, compiled=True, passed=p) for i, p in enumerate(cf_passed)) + return FamilyOutcome(family_id=family_id, failure_layer=layer, base=base, cfs=cfs) + + +class TestFamilyOutcome: + def test_stable_correct_pattern(self): + f = _family("F1", True, [True, True]) + assert f.pattern == (1, 1, 1) + assert f.family_type == FamilyType.STABLE_CORRECT + assert not f.is_fragile + assert f.severity == 0.0 + + def test_fragile_all_cf_fail(self): + f = _family("F2", True, [False, False]) + assert f.family_type == FamilyType.FRAGILE + assert f.is_fragile + assert f.severity == 1.0 + + def test_fragile_partial_cf_fail(self): + f = _family("F3", True, [True, False]) + assert f.family_type == FamilyType.FRAGILE + assert f.severity == 0.5 + + def test_unsolved(self): + f = _family("F4", False, [False, False]) + assert f.family_type == FamilyType.UNSOLVED + assert f.severity is None + + def test_inconsistent(self): + f = _family("F5", False, [True, False]) + assert f.family_type == FamilyType.INCONSISTENT + assert f.severity is None + + def test_cf_fail_count(self): + f = _family("F6", True, [True, False, False]) + assert f.cf_fail_count == 2 + assert f.cf_total == 3 + + +class TestBuildFamilies: + def _result(self, instance_id: str, resolved: bool) -> ExecutionBasedEvaluationResult: + return ExecutionBasedEvaluationResult( + instance_id=instance_id, + project="Test", + model="test-model", + agent_name="test", + category=EvaluationCategory.BUG_FIX, + resolved=resolved, + build=True, + ) + + def test_builds_single_family(self): + results = [ + self._result("NAV-100", True), + self._result("NAV-100__cf-1", False), + self._result("NAV-100__cf-2", True), + ] + families = build_families(results) + assert len(families) == 1 + assert families[0].pattern == (1, 0, 1) + assert families[0].family_type == FamilyType.FRAGILE + + def test_skips_base_without_cfs(self): + results = [self._result("NAV-200", True)] + assert len(build_families(results)) == 0 + + def test_multiple_families(self): + results = [ + self._result("NAV-100", True), + self._result("NAV-100__cf-1", True), + self._result("NAV-200", False), + self._result("NAV-200__cf-1", False), + ] + families = build_families(results) + assert len(families) == 2 + assert families[0].family_type == FamilyType.STABLE_CORRECT + assert families[1].family_type == FamilyType.UNSOLVED + + def test_failure_layers_applied(self): + results = [ + self._result("NAV-100", True), + self._result("NAV-100__cf-1", False), + ] + families = build_families(results, failure_layers={"NAV-100": FailureLayer.L3_EVENT}) + assert families[0].failure_layer == FailureLayer.L3_EVENT + + +class TestMetrics: + @pytest.fixture + def sample_families(self) -> list[FamilyOutcome]: + return [ + _family("F1", True, [True, True], FailureLayer.L2_EXECUTION), + _family("F2", True, [False, False], FailureLayer.L3_EVENT), + _family("F3", True, [True, False], FailureLayer.L3_EVENT), + _family("F4", False, [False, False], FailureLayer.L4_WORKFLOW), + _family("F5", False, [True, False], FailureLayer.L5_TOOLCHAIN), + ] + + def test_family_type_distribution(self, sample_families): + dist = family_type_distribution(sample_families) + assert dist["stable-correct"] == 1 + assert dist["fragile"] == 2 + assert dist["unsolved"] == 1 + assert dist["inconsistent"] == 1 + + def test_fragility_rate(self, sample_families): + assert fragility_rate(sample_families) == pytest.approx(2 / 3) + + def test_fragility_rate_no_eligible(self): + assert fragility_rate([_family("F1", False, [False])]) == 0.0 + + def test_mean_severity(self, sample_families): + assert mean_severity(sample_families) == pytest.approx(0.5) + + def test_layer_conditioned_fragility(self, sample_families): + lcf = layer_conditioned_fragility(sample_families) + assert lcf[FailureLayer.L2_EXECUTION.value] == 0.0 + assert lcf[FailureLayer.L3_EVENT.value] == 1.0 + + def test_failure_layer_distribution(self, sample_families): + dist = failure_layer_distribution(sample_families) + assert dist[FailureLayer.L3_EVENT.value] == 2 + + def test_cf_exposed_failure_count(self, sample_families): + assert cf_exposed_failure_count(sample_families) == 1 + + +class TestAnnotation: + def test_samples_fragile_instances(self): + from bcbench.analysis.annotation import sample_failures + + families = [ + _family("F1", True, [True, True]), + _family("F2", True, [False, False], FailureLayer.L3_EVENT), + _family("F3", False, [False], FailureLayer.L4_WORKFLOW), + ] + rows = sample_failures(families) + assert len(rows) == 4 + assert rows[0]["family_type"] == "fragile" + + def test_max_samples_limit(self): + from bcbench.analysis.annotation import sample_failures + + rows = sample_failures([_family("F1", True, [False, False, False])], max_samples=2) + assert len(rows) == 2 + + def test_writes_csv(self, tmp_path): + from bcbench.analysis.annotation import sample_failures, write_annotation_csv + + rows = sample_failures([_family("F1", True, [False], FailureLayer.L2_EXECUTION)]) + write_annotation_csv(rows, tmp_path / "annotations.csv") + assert (tmp_path / "annotations.csv").exists() diff --git a/tests/test_type_exhaustiveness.py b/tests/test_type_exhaustiveness.py index 3da3844f7..78867f608 100644 --- a/tests/test_type_exhaustiveness.py +++ b/tests/test_type_exhaustiveness.py @@ -33,6 +33,8 @@ def test_all_categories_have_entry_classes(): def test_all_categories_handled_in_get_expected_output(sample_dataset_entry_with_problem_statement: BugFixEntry): for category in EvaluationCategory: + if category.is_counterfactual: + continue # CF entries are loaded via resolution from base; tested separately in test_counterfactual.py entry_cls = category.entry_class # Reconstruct entry as the category-specific type so get_expected_output() works entry = entry_cls.model_validate(sample_dataset_entry_with_problem_statement.model_dump(by_alias=True)) diff --git a/tools/cf_fixer/validator.py b/tools/cf_fixer/validator.py new file mode 100644 index 000000000..7b711716f --- /dev/null +++ b/tools/cf_fixer/validator.py @@ -0,0 +1,63 @@ +"""Validator — runs dataset validation checks. + +Levels: + 1. Fast: JSONL schema/load check (pytest test_counterfactual.py) + 2. Load: Verify entry loads via bcbench CLI +""" + +from __future__ import annotations + +import subprocess +from dataclasses import dataclass +from pathlib import Path + +_BCBENCH_ROOT = Path(__file__).parent.parent.parent + + +@dataclass(frozen=True) +class ValidationResult: + status: str # "success" | "fail" | "skip" + message: str = "" + + +def validate_schema(instance_id: str | None = None) -> ValidationResult: + """Run pytest schema validation for counterfactual entries.""" + cmd = ["uv", "run", "pytest", "tests/test_counterfactual.py", "-v", "--tb=short"] + if instance_id: + cmd.extend(["-k", instance_id.replace("__", "_")]) + + result = subprocess.run( + cmd, + check=False, + capture_output=True, + text=True, + encoding="utf-8", + cwd=_BCBENCH_ROOT, + ) + + status = "success" if result.returncode == 0 else "fail" + output = result.stdout[-2000:] if result.stdout else "" + if result.returncode != 0 and result.stderr: + output += f"\n--- stderr ---\n{result.stderr[-1000:]}" + + return ValidationResult(status=status, message=output) + + +def validate_dataset_load(instance_id: str) -> ValidationResult: + """Verify the entry can be loaded via bcbench CLI.""" + cf_num = instance_id.rsplit("__cf-", 1)[-1] if "__cf-" in instance_id else "1" + cat = f"cf-{cf_num}" + + cmd = ["uv", "run", "bcbench", "dataset", "view", instance_id, "--category", cat] + result = subprocess.run( + cmd, + check=False, + capture_output=True, + text=True, + encoding="utf-8", + cwd=_BCBENCH_ROOT, + ) + + status = "success" if result.returncode == 0 else "fail" + msg = result.stdout[-1000:] if status == "success" else result.stderr[-1000:] + return ValidationResult(status=status, message=msg)