Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: batch selector for alternate item #29494

Merged
merged 1 commit into from
Jan 29, 2022
Merged

Conversation

ankush
Copy link
Member

@ankush ankush commented Jan 28, 2022

  1. Setup alternate items - A and B (both with batches)
  2. Make A part of some BOM
  3. Create work order and keep "allow alternative item" checked
  4. create stock entry for stock transfer
  5. save stock entry
  6. Select alternate item
  7. open row in stock entry and click on "pick batch no" to select batch no.
  8. nothing shows up.

root cause: #25519 added pending qty section BUT the alternate item's info isn't present the global state from stock entry 馃ゲ

function get_pending_qty_fields(me) {
if (!check_can_calculate_pending_qty(me)) return [];
const { frm: { doc: { fg_completed_qty }}, item: { item_code, stock_qty }} = me;
const { qty_consumed_per_unit } = erpnext.stock.bom.items[item_code];
const total_selected_qty = calc_total_selected_qty(me);
const required_qty = flt(fg_completed_qty) * flt(qty_consumed_per_unit);
const pending_qty = required_qty - (flt(stock_qty) + total_selected_qty);

Solution: disable pending qty computation for alternate items.

ref: ISS-21-22-10622

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

Successfully merging this pull request may close these issues.

None yet

1 participant