fix: incorrect valuation rate for PI based revaluation
(cherry picked from commit14ce2337df) (cherry picked from commitf7e3854641)
This commit is contained in:
committed by
Mergify
parent
625ff4b276
commit
23b846ef39
@@ -1039,7 +1039,7 @@ class update_entries_after:
|
|||||||
|
|
||||||
def get_dynamic_incoming_outgoing_rate(self, sle):
|
def get_dynamic_incoming_outgoing_rate(self, sle):
|
||||||
# Get updated incoming/outgoing rate from transaction
|
# Get updated incoming/outgoing rate from transaction
|
||||||
if sle.recalculate_rate:
|
if sle.recalculate_rate or self.has_landed_cost_based_on_pi(sle):
|
||||||
rate = self.get_incoming_outgoing_rate_from_transaction(sle)
|
rate = self.get_incoming_outgoing_rate_from_transaction(sle)
|
||||||
|
|
||||||
if flt(sle.actual_qty) >= 0:
|
if flt(sle.actual_qty) >= 0:
|
||||||
@@ -1047,6 +1047,14 @@ class update_entries_after:
|
|||||||
else:
|
else:
|
||||||
sle.outgoing_rate = rate
|
sle.outgoing_rate = rate
|
||||||
|
|
||||||
|
def has_landed_cost_based_on_pi(self, sle):
|
||||||
|
if sle.voucher_type == "Purchase Receipt" and frappe.db.get_single_value(
|
||||||
|
"Buying Settings", "set_landed_cost_based_on_purchase_invoice_rate"
|
||||||
|
):
|
||||||
|
return True
|
||||||
|
|
||||||
|
return False
|
||||||
|
|
||||||
def get_incoming_outgoing_rate_from_transaction(self, sle):
|
def get_incoming_outgoing_rate_from_transaction(self, sle):
|
||||||
rate = 0
|
rate = 0
|
||||||
# Material Transfer, Repack, Manufacturing
|
# Material Transfer, Repack, Manufacturing
|
||||||
|
|||||||
Reference in New Issue
Block a user