Skip to content

Commit 42f2abf

Browse files
authored
Merge pull request #51655 from aerele/project-gross-margin-credit-note
fix: include credit notes in project gross margin calculation
2 parents dbbeca6 + a378fee commit 42f2abf

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

erpnext/projects/doctype/project/project.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,8 @@ def calculate_gross_margin(self):
308308
self.gross_margin = flt(self.total_billed_amount) - expense_amount
309309
if self.total_billed_amount:
310310
self.per_gross_margin = (self.gross_margin / flt(self.total_billed_amount)) * 100
311+
else:
312+
self.per_gross_margin = 0
311313

312314
def update_purchase_costing(self):
313315
total_purchase_cost = calculate_total_purchase_cost(self.name)

0 commit comments

Comments
 (0)