feat: company wise valuation method

This commit is contained in:
Mihir Kandoi
2025-11-13 11:59:58 +05:30
parent 5dcb766b9f
commit 316b6d6867
12 changed files with 74 additions and 22 deletions

View File

@@ -524,7 +524,7 @@ class SellingController(StockController):
)
if not self.get("return_against") or (
get_valuation_method(d.item_code) == "Moving Average"
get_valuation_method(d.item_code, self.company) == "Moving Average"
and self.get("is_return")
and not item_details.has_serial_no
and not item_details.has_batch_no
@@ -535,7 +535,10 @@ class SellingController(StockController):
if (
not d.incoming_rate
or self.is_internal_transfer()
or (get_valuation_method(d.item_code) == "Moving Average" and self.get("is_return"))
or (
get_valuation_method(d.item_code, self.company) == "Moving Average"
and self.get("is_return")
)
):
d.incoming_rate = get_incoming_rate(
{
@@ -560,7 +563,7 @@ class SellingController(StockController):
not d.incoming_rate
and self.get("return_against")
and self.get("is_return")
and get_valuation_method(d.item_code) == "Moving Average"
and get_valuation_method(d.item_code, self.company) == "Moving Average"
):
d.incoming_rate = get_rate_for_return(
self.doctype, self.name, d.item_code, self.return_against, item_row=d