[Fix] Wrong avg. buying rate in the Gross Profit report (#10110)

This commit is contained in:
rohitwaghchaure 2017-07-27 11:37:30 +05:30 committed by Nabin Hait
parent 4c28fa77bd
commit 059f99e621

View File

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