I’ve tried to duplicate “Gross Profit” report to calculate the percentage by costing [Markup]. I just edited the code to these but loading the report is giving me this error. Selecting few invoice is showing the report perfectly, but most of the invoice and other filters are showing this error.
# calculate gross profit row.gross_profit = flt(row.base_amount - row.buying_amount, self.currency_precision) if row.base_amount: row.gross_profit_percent = flt((row.gross_profit / row.**[changes base_amount to]**buying_amount) * 100.0, self.currency_precision) else: row.gross_profit_percent = 0.0 **In the "def get_average_rate_based_on_group_by(self):" section** def set_average_rate(self, new_row): new_row.gross_profit = flt(new_row.base_amount - new_row.buying_amount, self.currency_precision) new_row.gross_profit_percent = flt(((new_row.gross_profit / new_row.**[changes base_amount to]**buying_amount) * 100.0), self.currency_precision)
I know I need to make other changes in the report code. Can anyone help me with it?
Thanks in advance.