fix: incorrect buying amount in Gross Profit rpt

This commit is contained in:
ruthra kumar 2022-08-16 09:27:42 +05:30
parent 17b9bfd249
commit 967dd398e7

View File

@ -616,7 +616,7 @@ class GrossProfitGenerator(object):
previous_stock_value = len(my_sle) > i + 1 and flt(my_sle[i + 1].stock_value) or 0.0
if previous_stock_value:
return (previous_stock_value - flt(sle.stock_value)) * flt(row.qty) / abs(flt(sle.qty))
return abs(previous_stock_value - flt(sle.stock_value)) * flt(row.qty) / abs(flt(sle.qty))
else:
return flt(row.qty) * self.get_average_buying_rate(row, item_code)
else: