Skip to content

Commit

Permalink
fix: minor refactor based on test cases
Browse files Browse the repository at this point in the history
  • Loading branch information
Sanket322 committed Jan 27, 2025
1 parent 93fab29 commit 4f6018b
Showing 1 changed file with 11 additions and 7 deletions.
18 changes: 11 additions & 7 deletions erpnext/accounts/report/gross_profit/gross_profit.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,13 +198,17 @@ def get_data_when_grouped_by_invoice(columns, gross_profit_data, filters, group_

total_gross_profit = total_base_amount - total_buying_amount
data.append(
{
"sales_invoice": "Total",
"selling_amount": total_base_amount,
"buying_amount": total_buying_amount,
"gross_profit": total_gross_profit,
"gross_profit_%": flt((total_gross_profit / total_base_amount) * 100.0, 3),
}
frappe._dict(
{
"sales_invoice": "Total",
"selling_amount": total_base_amount,
"buying_amount": total_buying_amount,
"gross_profit": total_gross_profit,
"gross_profit_%": flt((total_gross_profit / total_base_amount) * 100.0, 3)
if total_base_amount
else 0,
}
)
)


Expand Down

0 comments on commit 4f6018b

Please sign in to comment.