mirror of
https://github.com/frappe/erpnext.git
synced 2026-06-01 11:19:09 +00:00
* fix: serial and batch bundle for POS Invoice (#41491)
(cherry picked from commit e5dfc5e545)
# Conflicts:
# erpnext/accounts/doctype/pos_invoice_item/pos_invoice_item.json
* chore: fix conflicts
---------
Co-authored-by: rohitwaghchaure <rohitw1991@gmail.com>
This commit is contained in:
@@ -583,6 +583,7 @@ erpnext.PointOfSale.Controller = class {
|
||||
new_item["serial_no"] = serial_no;
|
||||
}
|
||||
|
||||
new_item["use_serial_batch_fields"] = 1;
|
||||
if (field === "serial_no") new_item["qty"] = value.split(`\n`).length || 0;
|
||||
|
||||
item_row = this.frm.add_child("items", new_item);
|
||||
|
||||
@@ -101,7 +101,8 @@ erpnext.PointOfSale.ItemDetails = class {
|
||||
|
||||
const serialized = item_row.has_serial_no;
|
||||
const batched = item_row.has_batch_no;
|
||||
const no_bundle_selected = !item_row.serial_and_batch_bundle;
|
||||
const no_bundle_selected =
|
||||
!item_row.serial_and_batch_bundle && !item_row.serial_no && !item_row.batch_no;
|
||||
|
||||
if ((serialized && no_bundle_selected) || (batched && no_bundle_selected)) {
|
||||
frappe.show_alert({
|
||||
@@ -403,6 +404,7 @@ erpnext.PointOfSale.ItemDetails = class {
|
||||
frappe.model.set_value(item_row.doctype, item_row.name, {
|
||||
serial_and_batch_bundle: r.name,
|
||||
qty: Math.abs(r.total_qty),
|
||||
use_serial_batch_fields: 0,
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user