[MAIN]-The system throws the error while posting a receipt against a Subcontracting Order. - #9729
Conversation
|
|
The shipped Line mapping was unavailable, so this was posted as an issue comment. 👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.26.4 |
|
The updated "Remaining Quantity" FlowField filters Line mapping was unavailable, so this was posted as an issue comment. 👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.26.4 |
|
In Agent judgement — not directly backed by a BCQuality knowledge article. Line mapping was unavailable, so this was posted as an issue comment. 👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.26.4 |
|
Knowledge: Line mapping was unavailable, so this was posted as an issue comment. 👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.26.4 |
|
Knowledge: Line mapping was unavailable, so this was posted as an issue comment. 👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.26.4 |
|
Knowledge: Line mapping was unavailable, so this was posted as an issue comment. 👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.26.4 |
Agentic PR Review - Round 1Recommendation: Request ChangesWhat this PR doesThis PR makes India GST subcontracting receipt posting choose delivery challan and item ledger entries with more filters, mainly variant and production component information. It also resets The reset of SuggestionsS1 - Add a multi-variant posting regression test S2 - Match the exact component line S3 - Verify the FlowField compatibility impact Risk assessment and necessityRisk: This is high-risk because it changes subcontracting receipt posting, item ledger application, and a FlowField used by delivery challan pages and validation. A wrong match can consume from the wrong variant or component line, and a false shortage can block receipt posting. No BaseApp publisher dependency was found in this diff; the change is local to the IN GST Subcontracting app. Necessity: The customer incident is important, and the work item type is Bug. Without a fix, subcontracting receipt/consume can fail with “Not enough inventory available at vendor location for this order” when variants are mixed. The scope is mostly targeted, but it needs exact component-line matching and a regression test before merge.
|
Pull request was closed
|
The shipped FlowField "Delivery Challan Line"."Remaining Quantity" (field 57) now adds Variant Code, Order No., Order Line No., and Prod. Order Comp. Line No. filters to its CalcFormula, so existing extensions, reports, and pages reading this field will get smaller totals for the same historical records than before this change. Consider preserving the old field semantics and introducing a new field for the narrower calculation, or explicitly documenting/versioning this as a behavioral change for consumers. Line mapping was unavailable, so this was posted as an issue comment. 👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.32.4 |
|
"Delivery Challan Line"."Remaining Quantity" now identifies inventory by Order No., Order Line No., and Prod. Order Comp. Line No., but the repeated Item Ledger Entry lookups in "Applied Delivery Challan" (the OnLookup trigger and the three near-identical helper procedures around lines 282-370) still stop at order line + item + variant, without the component-line filter. When the same item/variant appears on multiple production components within one order line, FindFirst() can persist "Applies-to Entry" from the wrong component, undercounting one challan line while consuming/returning against another. Add the component-line filter consistently to every one of these duplicated lookup blocks, ideally through one shared helper so the FlowField and the manual lookups cannot drift again. Line mapping was unavailable, so this was posted as an issue comment. 👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.32.4 |
…Bug-644092-MAIN-Error-while-posting-a-receipt-in-Subcontracting-Order
|
In the "Applies-to Entry" OnLookup trigger (and the similarly-patterned procedures below it in the same file), the PR adds "Variant Code" as a new Item Ledger Entry filter but the lookup still resolves the entry using only Order No./Order Line No. (the production order and line), not "Prod. Order Comp. Line No." (the specific component within that order line). When a production order line has multiple components sharing the same item and variant, FindFirst can bind "Applies-to Entry" to a transfer entry that actually belongs to a different component of the same order/variant, causing the applied entry to diverge from the one the Delivery Challan Line's Remaining-Quantity FlowField (which the PR now filters by Prod. Order Comp. Line No.) actually represents. Add a "Prod. Order Comp. Line No." filter to the Item Ledger Entry lookups so they use the same discriminator set as the FlowField they support. Agent judgement — not directly backed by a BCQuality knowledge article. Line mapping was unavailable, so this was posted as an issue comment. 👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.33.4 |
|
The changed "Remaining Quantity" FlowField on "Delivery Challan Line" now filters Item Ledger Entry by Variant Code, Order No., Order Line No., and Prod. Order Comp. Line No. in addition to the previous fields, but the source table "Item Ledger Entry" has no matching SIFT key covering these fields with "Remaining Quantity" in SumIndexFields. Each CalcFields on this FlowField (used in validation and lookup paths added in this PR) therefore aggregates matching ledger rows directly instead of using a maintained sum, which is costly on ledger-backed lookup/validation paths that run per document line. Knowledge: Line mapping was unavailable, so this was posted as an issue comment. 👍 useful · ❤️ especially valuable · 👎 wrong - reply with why · AL review agent v1.33.4 |
Bug 644092: Incident 51000001089716 : [BC-IN][28.1]The system throws the error while posting a receipt against a Subcontracting Order.
AB#644092
Issue:
Subcontracting receive/consume was failing with “Not enough inventory available at vendor location for this order” and showing incorrect remaining quantity in Apply Delivery Challan, especially when the same item had multiple variants.
Cause:
Remaining Quantity on Delivery Challan Line was aggregating inventory without enough granularity, so different variants/components were getting mixed. Also, in
PostSubconComp,RemQtytoPostwas not always reset after the last successful posting, which could trigger a false shortage error.Solution:
Tightened the subcontracting inventory matching to be variant- and component-line-aware by refining the Delivery Challan Remaining Quantity flowfield and the ILE application logic. Also reset
RemQtytoPoston final successful consumption so the shortage guard only fires for real shortages.