---
id: change/bcapps/10795
type: change
title: "#10795 [master] Discrepancy in inventory picks when the quantity exceeds the available inventory."
summary: Fixed a calculation error in inventory pick creation that was incorrectly dropping shortage lines when availability exceeded demand with the 'Always Create Pick Line' setting enabled.
tier: official
language: en
tags:
  - fix
  - main
  - bc30
  - codeunit create inventory pick/movement
system: warehouse
review:
  state: reviewed
  by: opus
  at: "2026-10-08T02:06:25.129Z"
  flags: []
generated:
  at: "2026-10-08T01:26:53.141Z"
  pipeline: 0.2.0
  prompts:
    extract-change: 1
  input_hash: e7751a5b00b07fb0c8565675a87ba374b8a5f50d
evidence:
  - kind: code
    url: https://github.com/microsoft/BCApps/pull/10795
    title: "microsoft/BCApps#10795: [master] Discrepancy in inventory picks when the quantity exceeds the available inventory."
    date: "2026-09-03"
    commit: e7751a5b00b07fb0c8565675a87ba374b8a5f50d
    t: null
    quote: Cap availability with Minimum(QtyAvailToPickBase, OriginalRemQtyToPickBase), restoring the shortage line without affecting the normal case.
links:
  learn: []
  objects:
    - object/codeunit/7322
  features: []
  topics: []
  localizations: []
  videos: []
  posts: []
  guidelines: []
  changes: []
number: 10795
repo: microsoft/BCApps
source_id: bcapps-prs
url: https://github.com/microsoft/BCApps/pull/10795
kind: pr
base_branch: main
major: "30"
merged_at: "2026-09-03T06:21:54Z"
author: neeleshsinghal
author_type: User
community_contribution: false
labels:
  - "Team: SCM"
change_class: code
change_kind: fix
behavior_change: true
breaking: false
files:
  count: 2
  additions: 97
  deletions: 1
  al: 1
apps:
  - Base Application
objects_touched:
  - key: codeunit/7322
    page: codeunit/7322
    type: codeunit
    id: 7322
    name: Create Inventory Pick/Movement
    app: Base Application
    status: modified
objects_unjoined: []
obsoletions: []
backports: []
fixes_issues: []
work_items:
  - 648374
systems:
  - warehouse
quote: Cap availability with Minimum(QtyAvailToPickBase, OriginalRemQtyToPickBase), restoring the shortage line without affecting the normal case.
joined_against:
  major: "30"
  commit: ecbc028c25dbe83b61313bc566e6c1d41184bb1c
---

# #10795 [master] Discrepancy in inventory picks when the quantity exceeds the available inventory.

> Fixed a calculation error in inventory pick creation that was incorrectly dropping shortage lines when availability exceeded demand with the 'Always Create Pick Line' setting enabled.

[Pull request](https://github.com/microsoft/BCApps/pull/10795) · merged into `main` (BC30) on 2026-09-03 by neeleshsinghal · 2 files (+97 -1), 1 AL · fix · tier official · reviewed (checked by Opus)

## What changed

- Corrected fallback formula that was subtracting too much, causing blank-bin quantity to become zero or negative
- Applied Minimum() function to cap availability at the original remaining quantity to pick
- Restores missing shortage lines for un-pickable remainders in production inventory picks
- Does not affect normal cases where availability is less than demand
- Added test coverage for the production warehouse handling scenario
- Behaviour changes for users or extensions.

## AL objects touched

- [Codeunit 7322 "Create Inventory Pick/Movement"](../../objects/codeunit/7322.md), Base Application: modified

## Context

- Work items: AB#648374
- Labels: Team: SCM
- Systems: warehouse
- From the description: "Cap availability with Minimum(QtyAvailToPickBase, OriginalRemQtyToPickBase), restoring the shortage line without affecting the normal case."

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).
