mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-05 22:48:27 +00:00
fix: delivered qty in reservation entry
This commit is contained in:
@@ -1336,6 +1336,9 @@ class WorkOrder(Document):
|
|||||||
self.set_available_qty()
|
self.set_available_qty()
|
||||||
|
|
||||||
def update_transferred_qty_for_required_items(self):
|
def update_transferred_qty_for_required_items(self):
|
||||||
|
if self.skip_transfer:
|
||||||
|
return
|
||||||
|
|
||||||
ste = frappe.qb.DocType("Stock Entry")
|
ste = frappe.qb.DocType("Stock Entry")
|
||||||
ste_child = frappe.qb.DocType("Stock Entry Detail")
|
ste_child = frappe.qb.DocType("Stock Entry Detail")
|
||||||
|
|
||||||
|
|||||||
@@ -2106,10 +2106,13 @@ class StockEntry(StockController):
|
|||||||
if not frappe.get_cached_value("Work Order", self.work_order, "reserve_stock"):
|
if not frappe.get_cached_value("Work Order", self.work_order, "reserve_stock"):
|
||||||
return
|
return
|
||||||
|
|
||||||
|
skip_transfer = frappe.get_cached_value("Work Order", self.work_order, "skip_transfer")
|
||||||
|
|
||||||
if (
|
if (
|
||||||
self.purpose not in ["Material Transfer for Manufacture"]
|
self.purpose not in ["Material Transfer for Manufacture"]
|
||||||
and frappe.db.get_single_value("Manufacturing Settings", "backflush_raw_materials_based_on")
|
and frappe.db.get_single_value("Manufacturing Settings", "backflush_raw_materials_based_on")
|
||||||
!= "BOM"
|
!= "BOM"
|
||||||
|
and not skip_transfer
|
||||||
):
|
):
|
||||||
return
|
return
|
||||||
|
|
||||||
@@ -2172,6 +2175,10 @@ class StockEntry(StockController):
|
|||||||
self.append("items", new_row)
|
self.append("items", new_row)
|
||||||
|
|
||||||
sorted_items = sorted(self.items, key=lambda x: x.item_code)
|
sorted_items = sorted(self.items, key=lambda x: x.item_code)
|
||||||
|
if self.purpose == "Manufacture":
|
||||||
|
# ensure finished item at last
|
||||||
|
sorted_items = sorted(sorted_items, key=lambda x: (x.t_warehouse))
|
||||||
|
|
||||||
idx = 0
|
idx = 0
|
||||||
for row in sorted_items:
|
for row in sorted_items:
|
||||||
idx += 1
|
idx += 1
|
||||||
|
|||||||
@@ -613,10 +613,10 @@ class StockReservationEntry(Document):
|
|||||||
data = row_wise_serial_batch[row]
|
data = row_wise_serial_batch[row]
|
||||||
|
|
||||||
if entry.serial_no in data.serial_nos:
|
if entry.serial_no in data.serial_nos:
|
||||||
entry.delivered_qty = 1
|
entry.delivered_qty = flt(1)
|
||||||
|
|
||||||
elif entry.batch_no in data.batch_nos:
|
elif entry.batch_no in data.batch_nos:
|
||||||
entry.delivered_qty = data.batch_nos[entry.batch_no]
|
entry.delivered_qty = flt(data.batch_nos[entry.batch_no])
|
||||||
|
|
||||||
entry.db_update()
|
entry.db_update()
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user