---
id: change/bcapps/9729
type: change
title: "#9729 [MAIN]-The system throws the error while posting a receipt against a Subcontracting Order."
summary: Fixed subcontracting receipt posting to correctly handle multiple item variants and component lines by improving inventory matching logic and resetting the remaining quantity after successful posting.
tier: official
language: en
tags:
  - fix
  - main
  - bc30
  - codeunit subcontracting post
  - table applied delivery challan
  - table delivery challan line
  - table sub order comp. list vend
system: finance
review:
  state: reviewed
  by: opus
  at: "2026-10-08T02:08:31.905Z"
  flags: []
generated:
  at: "2026-10-08T01:26:53.141Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: eff9f441c8f4f9020aa25ce179951c8b9b091b35
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/pull/9729
    title: "microsoft/BCApps#9729: [MAIN]-The system throws the error while posting a receipt against a Subcontracting Order."
    date: "2026-08-17"
    commit: eff9f441c8f4f9020aa25ce179951c8b9b091b35
    t: null
    quote: Remaining Quantity on Delivery Challan Line was aggregating inventory without enough granularity.
links:
  learn: []
  objects:
    - object/codeunit/18466-in
    - object/table/18466-in
    - object/table/18469-in
    - object/table/18478-in
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
number: 9729
repo: microsoft/BCApps
source_id: bcapps-prs
url: https://github.com/microsoft/BCApps/pull/9729
kind: pr
base_branch: main
major: "30"
merged_at: "2026-08-17T23:25:35Z"
author: v-maheshsharma
author_type: User
community_contribution: false
labels:
  - "Team: Finance"
change_class: code
change_kind: fix
behavior_change: true
breaking: false
files:
  count: 4
  additions: 67
  deletions: 3
  al: 4
apps:
  - INGST
objects_touched:
  - key: codeunit/18466
    page: codeunit/18466-in
    type: codeunit
    id: 18466
    name: Subcontracting Post
    app: INGST
    status: modified
  - key: table/18466
    page: table/18466-in
    type: table
    id: 18466
    name: Applied Delivery Challan
    app: INGST
    status: modified
  - key: table/18469
    page: table/18469-in
    type: table
    id: 18469
    name: Delivery Challan Line
    app: INGST
    status: modified
  - key: table/18478
    page: table/18478-in
    type: table
    id: 18478
    name: Sub Order Comp. List Vend
    app: INGST
    status: modified
objects_unjoined: []
obsoletions: []
backports: []
fixes_issues: []
work_items:
  - 644092
systems:
  - finance
quote: Remaining Quantity on Delivery Challan Line was aggregating inventory without enough granularity.
joined_against:
  major: "30"
  commit: a4406cfa9e57437fedc49c53c327a199a854491e
---

# #9729 [MAIN]-The system throws the error while posting a receipt against a Subcontracting Order.

> Fixed subcontracting receipt posting to correctly handle multiple item variants and component lines by improving inventory matching logic and resetting the remaining quantity after successful posting.

[Pull request](https://github.com/microsoft/BCApps/pull/9729) · merged into `main` (BC30) on 2026-08-17 by v-maheshsharma · 4 files (+67 -3), 4 AL · fix · tier official · reviewed (checked by Opus)

## What changed

- Remaining Quantity flowfield on Delivery Challan Line now separates variants and component lines
- Apply Delivery Challan shows correct remaining quantities when an item has several variants
- ILE application logic matches inventory by variant and component line
- RemQtytoPost is reset after the final successful consumption, so the shortage error only fires for real shortages
- Receipts posted against subcontracting orders no longer fail with a false shortage error
- Behaviour changes for users or extensions.

## AL objects touched

- [Codeunit 18466 "Subcontracting Post"](../../objects/codeunit/18466-in.md), INGST (IN layer): modified
- [Table 18466 "Applied Delivery Challan"](../../objects/table/18466-in.md), INGST (IN layer): modified
- [Table 18469 "Delivery Challan Line"](../../objects/table/18469-in.md), INGST (IN layer): modified
- [Table 18478 "Sub Order Comp. List Vend"](../../objects/table/18478-in.md), INGST (IN layer): modified

## Context

- Work items: AB#644092
- Labels: Team: Finance
- Systems: finance
- From the description: "Remaining Quantity on Delivery Challan Line was aggregating inventory without enough granularity."

Source: metadata of a merged pull request in microsoft/BCApps (bcapps): title, labels, changed paths and counts, with a summary in our words. No source text and no description beyond one short quote (D10, D61).
