Skip to content

[Subcontracting] Create TO to Subcontractor honors reduced open WIP line (Bug 639382)#8854

Open
ChethanT wants to merge 4 commits into
mainfrom
bugs/Subcontracting/bugs/639382-CreateTOError
Open

[Subcontracting] Create TO to Subcontractor honors reduced open WIP line (Bug 639382)#8854
ChethanT wants to merge 4 commits into
mainfrom
bugs/Subcontracting/bugs/639382-CreateTOError

Conversation

@ChethanT

@ChethanT ChethanT commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Fixes ADO bug 639382.

Problem

'Create Transfer Order to Subcontractor' failed with Nothing to create. No components or WIP to transfer after a WIP transfer line was reduced (e.g. qty 5 -> 3), instead of creating the remaining qty 2.

Root cause

CheckCreateWIPTransfer had an early IsEmpty() short-circuit: if any open WIP transfer line existed it returned false. Coverage was measured only against posted WIP ledger entries, never against open transfer-line quantities, so a reduced (not deleted) line blocked all further creation.

Fix

  • Removed the IsEmpty() short-circuit.
  • Added GetOpenWIPTransferLineQtyBase summing open (unposted, non-return) WIP transfer-line base qty.
  • CheckCreateWIPTransfer returns true when posted + open < expected. HandleWIPTransferForPurchLine cap subtracts posted and open qty, inserting only the remainder.

Test

WIPTransferRemainderCreatedWhenOpenLineQuantityReduced reproduces the scenario.

Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com

Fixes AB#639382

CheckCreateWIPTransfer used an IsEmpty short-circuit that returned false whenever any open WIP transfer line existed, so reducing an unposted line and re-running errored. Now sums posted + open WIP qty and creates the remainder. Added regression test.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@ChethanT ChethanT requested a review from a team June 29, 2026 08:04
@github-actions github-actions Bot added the AL: Apps (W1) Add-on apps for W1 label Jun 29, 2026
Comment thread src/Apps/W1/Subcontracting/Test/Tests/SubcWIPTransCreateTest.Codeunit.al Outdated
@github-actions

github-actions Bot commented Jun 29, 2026

Copy link
Copy Markdown
Contributor

Copilot PR Review

Iteration 3 · Outcome: completed

Knowledge source: https://github.com/microsoft/BCQuality@822cae1b2771ac25f665f73369f69093bd4fd630

Orchestrator pre-filter (13 file(s) excluded)

  • layer-disabled (knowledge) : 13 file(s)

Findings produced by the Copilot CLI agent against BCQuality at 822cae1b2771ac25f665f73369f69093bd4fd630. Reply 👎 on any inline comment to flag false positives.

ChethanT and others added 2 commits June 29, 2026 10:22
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@github-actions github-actions Bot added this to the Version 29.0 milestone Jun 29, 2026
attilatoury
attilatoury previously approved these changes Jun 29, 2026
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@ChethanT ChethanT dismissed stale reviews from attilatoury and AleksandricMarko via 1d77245 June 29, 2026 17:39
@ChethanT ChethanT enabled auto-merge June 29, 2026 17:40
@ChethanT ChethanT added the Subcontracting Subcontracting related activities label Jun 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

AL: Apps (W1) Add-on apps for W1 Subcontracting Subcontracting related activities

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants