fix: FIFO valuation in case of multi-item entries
This commit is contained in:
parent
b3b7cdfb49
commit
ccd2ce56b1
@ -448,8 +448,8 @@ class update_entries_after(object):
|
|||||||
return
|
return
|
||||||
|
|
||||||
# Get dynamic incoming/outgoing rate
|
# Get dynamic incoming/outgoing rate
|
||||||
if not self.args.get("sle_id"):
|
# XXX: performance regression
|
||||||
self.get_dynamic_incoming_outgoing_rate(sle)
|
self.get_dynamic_incoming_outgoing_rate(sle)
|
||||||
|
|
||||||
if get_serial_nos(sle.serial_no):
|
if get_serial_nos(sle.serial_no):
|
||||||
self.get_serialized_values(sle)
|
self.get_serialized_values(sle)
|
||||||
@ -492,8 +492,8 @@ class update_entries_after(object):
|
|||||||
sle.doctype="Stock Ledger Entry"
|
sle.doctype="Stock Ledger Entry"
|
||||||
frappe.get_doc(sle).db_update()
|
frappe.get_doc(sle).db_update()
|
||||||
|
|
||||||
if not self.args.get("sle_id"):
|
# XXX: performance regression
|
||||||
self.update_outgoing_rate_on_transaction(sle)
|
self.update_outgoing_rate_on_transaction(sle)
|
||||||
|
|
||||||
|
|
||||||
def validate_negative_stock(self, sle):
|
def validate_negative_stock(self, sle):
|
||||||
@ -576,9 +576,8 @@ class update_entries_after(object):
|
|||||||
def update_rate_on_stock_entry(self, sle, outgoing_rate):
|
def update_rate_on_stock_entry(self, sle, outgoing_rate):
|
||||||
frappe.db.set_value("Stock Entry Detail", sle.voucher_detail_no, "basic_rate", outgoing_rate)
|
frappe.db.set_value("Stock Entry Detail", sle.voucher_detail_no, "basic_rate", outgoing_rate)
|
||||||
|
|
||||||
# Update outgoing item's rate, recalculate FG Item's rate and total incoming/outgoing amount
|
# XXX: performance regression
|
||||||
if not sle.dependant_sle_voucher_detail_no:
|
self.recalculate_amounts_in_stock_entry(sle.voucher_no)
|
||||||
self.recalculate_amounts_in_stock_entry(sle.voucher_no)
|
|
||||||
|
|
||||||
def recalculate_amounts_in_stock_entry(self, voucher_no):
|
def recalculate_amounts_in_stock_entry(self, voucher_no):
|
||||||
stock_entry = frappe.get_doc("Stock Entry", voucher_no, for_update=True)
|
stock_entry = frappe.get_doc("Stock Entry", voucher_no, for_update=True)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user