From 52742b524da9bc3d8ac195695c52e7efcd21a6ef Mon Sep 17 00:00:00 2001 From: "watcha.h" Date: Tue, 25 Aug 2015 08:41:04 +0700 Subject: [PATCH] fix --- netforce_clinic/models/payment_matching.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/netforce_clinic/models/payment_matching.py b/netforce_clinic/models/payment_matching.py index 52de61d..958900d 100644 --- a/netforce_clinic/models/payment_matching.py +++ b/netforce_clinic/models/payment_matching.py @@ -279,6 +279,9 @@ class PaymentMatching(Model): break lines.append(vals) no+=1 + pc=0 + if total_invoice: + pc=(total_match_invoice/total_invoice)*100 data={ 'lines': lines, 'date_from': date_from, @@ -289,7 +292,7 @@ class PaymentMatching(Model): 'total_srv': total_srv, 'total_invoice': total_invoice, 'total_match_invoice': total_match_invoice, - 'total_match_invoice_in_pc': (total_match_invoice/total_invoice)*100, + 'total_match_invoice_in_pc': pc, 'total_unmatch_invoice': total_invoice-total_match_invoice, 'total_amount': total_amount, 'view_type': view_type,