fix: Gross profit report fix (#16935)

This commit is contained in:
Deepesh Garg 2019-03-17 09:49:24 +05:30 committed by GitHub
parent fd33c55760
commit 2ae7ed4cf0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -125,10 +125,11 @@ class GrossProfitGenerator(object):
# get buying amount
if row.item_code in product_bundles:
row.buying_amount = self.get_buying_amount_from_product_bundle(row,
product_bundles[row.item_code])
row.buying_amount = flt(self.get_buying_amount_from_product_bundle(row,
product_bundles[row.item_code]), self.currency_precision)
else:
row.buying_amount = self.get_buying_amount(row, row.item_code)
row.buying_amount = flt(self.get_buying_amount(row, row.item_code),
self.currency_precision)
# get buying rate
if row.qty:
@ -215,7 +216,7 @@ class GrossProfitGenerator(object):
if packed_item.get("parent_detail_docname")==row.item_row:
buying_amount += self.get_buying_amount(row, packed_item.item_code)
return buying_amount
return flt(buying_amount, self.currency_precision)
def get_buying_amount(self, row, item_code):
# IMP NOTE