From 14ff6bfc3246d337a88ecb475e4ba15a1a6a3f32 Mon Sep 17 00:00:00 2001 From: deepeshgarg007 Date: Thu, 21 Feb 2019 12:08:32 +0530 Subject: [PATCH] fix: Decimal point issue in gross profit print --- erpnext/accounts/report/gross_profit/gross_profit.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/erpnext/accounts/report/gross_profit/gross_profit.py b/erpnext/accounts/report/gross_profit/gross_profit.py index 01211a976f3..67105e58dea 100644 --- a/erpnext/accounts/report/gross_profit/gross_profit.py +++ b/erpnext/accounts/report/gross_profit/gross_profit.py @@ -135,9 +135,9 @@ class GrossProfitGenerator(object): row.buying_rate, row.base_rate = 0.0, 0.0 # calculate gross profit - row.gross_profit = row.base_amount - row.buying_amount + row.gross_profit = flt(row.base_amount - row.buying_amount, 3) if row.base_amount: - row.gross_profit_percent = (row.gross_profit / row.base_amount) * 100.0 + row.gross_profit_percent = flt((row.gross_profit / row.base_amount) * 100.0, 3) else: row.gross_profit_percent = 0.0 @@ -174,8 +174,8 @@ class GrossProfitGenerator(object): self.grouped_data.append(row) def set_average_rate(self, new_row): - new_row.gross_profit = new_row.base_amount - new_row.buying_amount - new_row.gross_profit_percent = ((new_row.gross_profit / new_row.base_amount) * 100.0) \ + new_row.gross_profit = flt(new_row.base_amount - new_row.buying_amount,3) + new_row.gross_profit_percent = flt(((new_row.gross_profit / new_row.base_amount) * 100.0),3) \ if new_row.base_amount else 0 new_row.buying_rate = (new_row.buying_amount / new_row.qty) if new_row.qty else 0 new_row.base_rate = (new_row.base_amount / new_row.qty) if new_row.qty else 0