Skip to content

[Master]-[Drop shipment reversal] Undo Shipment fails with blank Bin Code at bin-mandatory location - #11274

Open
Fixes4BC (neeleshsinghal) wants to merge 2 commits into
mainfrom
bugs/Bug-649618-Drop-Shipment-Undo-Shipment-fails-blank-Bin-Code-bin-mandatory
Open

[Master]-[Drop shipment reversal] Undo Shipment fails with blank Bin Code at bin-mandatory location#11274
Fixes4BC (neeleshsinghal) wants to merge 2 commits into
mainfrom
bugs/Bug-649618-Drop-Shipment-Undo-Shipment-fails-blank-Bin-Code-bin-mandatory

Conversation

@neeleshsinghal

@neeleshsinghal Fixes4BC (neeleshsinghal) commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Fixes AB#649618

@neeleshsinghal
Fixes4BC (neeleshsinghal) requested a review from a team September 9, 2026 14:22
@neeleshsinghal
Fixes4BC (neeleshsinghal) requested a review from a team as a code owner September 9, 2026 14:22
@github-actions github-actions Bot added the Team: SCM GitHub request for SCM area label Sep 9, 2026
@github-actions github-actions Bot added this to the Version 30.0 milestone Sep 9, 2026
ItemJnlLine."Shortcut Dimension 2 Code" := PurchRcptLine."Shortcut Dimension 2 Code";
ItemJnlLine."Dimension Set ID" := PurchRcptLine."Dimension Set ID";
ItemJnlLine.Description := PurchRcptLine.Description;
ItemJnlLine."Drop Shipment" := (PurchRcptLine."Sales Order No." <> '') and (PurchRcptLine."Sales Order Line No." <> 0);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

$\textbf{🟡\ Medium\ Severity\ —\ Agent}$

The new "Drop Shipment" derivation in UndoPurchaseReceiptLine.Codeunit.al uses (PurchRcptLine."Sales Order No." <> '') and (PurchRcptLine."Sales Order Line No." <> 0), but the existing, equivalent derivation elsewhere in the base app (PurchRcptLine.Table.al, InsertInvLineFromRcptLine: if "Sales Order No." = '' then PurchLine."Drop Shipment" := false else PurchLine."Drop Shipment" := true) keys off "Sales Order No." alone. If a drop-shipment receipt line can legitimately have a populated "Sales Order No." with a zero "Sales Order Line No." (e.g. due to partial data migration, an upstream defect, or a not-yet-linked line), the new undo logic would compute "Drop Shipment" = false while the rest of the app would treat the same line as a drop shipment, causing the reversing item journal line to under- or over-report Drop Shipment status inconsistently with sibling logic.

Recommendation:

  • align the condition with the established "Sales Order No." <> '' check used elsewhere, or, if the extra "Sales Order Line No." <> 0 guard is intentionally stricter, add a brief comment explaining why undo processing diverges from the existing convention.

👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.41.6

@alexei-dobriansky

Copy link
Copy Markdown
Contributor

Good Sense Reviewer - Round 1

Recommendation: Request Changes

What this PR does

This change marks the undo item journal line as a drop shipment when reversing linked sales shipments and purchase receipts. That matches the reported scenario where undoing a drop shipment at a bin-mandatory location should not fail only because the posted line has no bin code.

The fix is placed before the warehouse undo and item journal posting calls. This is the right point: Item Jnl.-Check Line skips bin checks for drop shipments, and Item Jnl.-Post Line copies the flag to item ledger and value entries. The W1 sales, W1 purchase, and RU sales paths are aligned, and there is no new event-publisher dependency to verify.

Problem-solution fit

Fit: Strong

The reported problem is a reversal failure for drop-shipment shipment/receipt flows at a bin-mandatory location. The diff sets the missing drop-shipment flag before the code reaches bin validation and ledger posting, so it addresses the full path that caused the failure.

Suggestions

S1 (🔴 High): Missing drop-shipment undo regression test
Please add a regression test that posts a drop shipment at a bin-mandatory location and then runs Undo Shipment or Undo Receipt. This code is in an inventory posting and ledger-entry path, so the test should prove that bin validation does not fail and the reversal entries remain marked as drop shipment.

Risk assessment and necessity

Risk: The code change is small, but it runs in inventory posting and ledger-entry reversal paths. A wrong or incomplete fix could still block reversals, or create item/value ledger entries that do not carry the drop-shipment state needed by later application logic.

Necessity: The change is needed because drop-shipment reversals should not require normal bin validation for a blank bin code. The scope is appropriate because it covers the shared W1 sales and purchase flows plus the RU sales override.


[AI-PR-REVIEW] version=1 promptVersion=4 system=github pr=11274 round=1 by=alexei-dobriansky at=2026-09-09T18:20:09.9090874Z lastSha=b997d85c7afdb03e9917dc5a90fbe367aebf3676 reviewKey=82c5b1f0d46612475d3e4ec530ed2735819010707d53cd99d2c37dd13829fce0 suggestions=S1@830e98b6

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Team: SCM GitHub request for SCM area

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants