Skip to content

Fix reserved-lot re-picking after warehouse reclassification - #11669

Draft
attilatoury wants to merge 1 commit into
mainfrom
private/attilatoury/fix-icm1729728-repick
Draft

attilatoury wants to merge 1 commit into
mainfrom
private/attilatoury/fix-icm1729728-repick

Conversation

@attilatoury

@attilatoury attilatoury commented Sep 21, 2026

Copy link
Copy Markdown
Contributor

What & why

A sales line cannot re-pick its reserved lot after the original pick is registered, the unposted warehouse shipment is deleted, and a warehouse reclassification returns the stock from shipment to a pick bin. Historical pick quantity still consumes the own-line reservation allowance even though the global reservation calculation has cleared its pick/shipment credit. The result is Nothing to handle despite intact stock and reservation.

  • In Warehouse Availability Mgt.CalcLineReservedQtyOnInvt, apply the existing shipment-bin guard to registered quantity before adding the unchanged outstanding-pick calculation.
  • Keep the guard item-wide: lot validation also adds item-wide global credit; narrowing only this new guard to the selected lot could duplicate that credit.
  • Preserve reservations, public raw-pick helpers, signed temporary outstanding offsets and existing competitor protections.
  • Add seven focused tests, including a complete re-pick/lot-validation/registration flow and protective controls.

Linked work

AB#650788Reserved lot cannot be re-picked after warehouse reclassification and shipment deletion

How I validated this

  • I read the full diff and it contains only changes I intended.
  • I built the affected app(s) locally with no new analyzer warnings.
  • I ran the change in Business Central and confirmed it behaves as expected.
  • I added or updated tests for the new behavior, or explained below why none are needed.

What I tested and the outcome

Same final test package Original application Patched application
Two bug reproductions Both fail at the intended Create Pick / own-line allowance checks Both pass
Five protective controls 5 pass 5 pass
Eleven existing warehouse regressions 11 pass 11 pass
  • Local W1 application 30.0.54539.0, platform 29.0.54249.0; separate disposable companies and runner 130450 with Codeunit isolation. 18/18 targeted tests pass after the fix, no skipped tests. This is not a full-suite run.
  • The end-to-end test receives/puts away and reserves a lot, registers its pick, deletes the unposted shipment, returns the same lot using a Warehouse Reclassification Journal, and re-picks the same sales line. It validates the lot on persisted Take/Place lines, registers the second pick, and verifies the original reservation/supply and final bin stock. It does not post a sales shipment.
  • Controls cover competing demand, outstanding picks, stock still in shipment bins, nondefault shipment bins, and preventing duplicate own-line/item-wide credit. Existing coverage includes assembly, non-directed locations, surplus/nonspecific reservations, FEFO and shipment deletion.
  • Three fixture/assertion issues found in the first run were corrected before the final same-package red/green comparison. Existing test methods were not changed.
  • Local deployable packages used fresh exact-installed sources plus only the accepted deltas, preserving unrelated local fixes. Installed sources, full metadata, schemas and assets were verified; original reproduction records remained unchanged. Backup and rollback packages retained.
  • git diff --check, scoped Miapp and W1 GDL-view checks passed.
  • Build qualification: exact-installed-source BaseApp compiler packaging succeeded; CodeCop has 14 identical pre-existing AA0448 errors and no introduced findings. Warehouse tests compile with 1,000 unchanged warnings and no new findings. The exact repository target-platform build remains blocked locally by missing System 30 symbols, so the build checkbox remains unchecked. Required target-platform CI is still needed.

Risk & compatibility

  • No schema, data migration, reservation cancellation or public API changes.
  • The existing guard applies only under its established Sales/Require Shipment/Bin Mandatory/configured shipment-bin conditions and clears history only when aggregate applicable shipment-bin stock is zero.
  • Partial returns, general multi-lot reconciliation, and a separate mixed-order report are not claimed fixed. The mixed-lot test protects existing arithmetic rather than proving every mixed-lot re-pick flow.
  • Adds the existing shipment-bin availability check to the own-line calculation; assess hot-path query cost in required CI/review.
  • No released servicing build or delivery date is claimed. Keep draft pending target-platform CI and review.

Normalize registered picks against the existing item-wide shipment-bin guard before deducting outstanding picks. Add seven reservation-preserving re-pick and protective regression tests.

AB#650788
@github-actions github-actions Bot added the Team: SCM GitHub request for SCM area label Sep 21, 2026
@github-actions github-actions Bot added this to the Version 30.0 milestone Sep 21, 2026
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.

1 participant