From a2de551f1288cf57b4f73818453b2042acdc55ef Mon Sep 17 00:00:00 2001 From: "watcha.h@almacom.co.th" Date: Thu, 23 Jul 2015 08:25:44 +0700 Subject: [PATCH] fix invoice due_date --- netforce_clinic/models/hd_case.py | 2 +- netforce_clinic/models/matching_payment.py | 7 ++----- netforce_clinic/models/matching_payment_line.py | 1 + 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/netforce_clinic/models/hd_case.py b/netforce_clinic/models/hd_case.py index bc57792..5ac0f51 100644 --- a/netforce_clinic/models/hd_case.py +++ b/netforce_clinic/models/hd_case.py @@ -599,7 +599,7 @@ class HDCase(Model): if obj.invoices: for inv in obj.invoices: inv.void() - due_date=obj.date[1:10] # XXX + due_date=obj.date[0:10] # cash, credit is_credit=context.get('is_credit') or False context['type']='out' diff --git a/netforce_clinic/models/matching_payment.py b/netforce_clinic/models/matching_payment.py index ca98446..40878fb 100644 --- a/netforce_clinic/models/matching_payment.py +++ b/netforce_clinic/models/matching_payment.py @@ -175,9 +175,8 @@ class MatchingPayment(Model): if invoice.related_id: hdcase=invoice.related_id patient=hdcase.patient_id - #pname=patient.name_check or "" #XXX pname='%s%s'%(patient.first_name or "",patient.last_name or "") - #XXX + #XXX partner name should be the same patient name if patient_names.get(pname): pname=patient_names[pname] pname2='%s %s'%(patient.first_name or "",patient.last_name or "") @@ -185,7 +184,6 @@ class MatchingPayment(Model): hn=patient.hn_no or "" elif invoice.ref: pname=invoice.ref or '' - #XXX if patient_names.get(pname): pname=patient_names[pname] pname2=pname @@ -278,8 +276,7 @@ class MatchingPayment(Model): 'invoice_id': None, 'state': 'unmatch', } - #if hn=='100794': - #import pdb; pdb.set_trace() + if matches1.get(key1): print("found ", key1) record.update({ diff --git a/netforce_clinic/models/matching_payment_line.py b/netforce_clinic/models/matching_payment_line.py index 80b12a9..b7f1234 100644 --- a/netforce_clinic/models/matching_payment_line.py +++ b/netforce_clinic/models/matching_payment_line.py @@ -11,6 +11,7 @@ class MatchingPaymentLine(Model): 'amount': (obj.fee or 0)+(obj.epo or 0)+(obj.srv or 0), } return res + _fields={ 'match_id': fields.Many2One("clinic.matching.payment","Match",required=True,on_delete="cascade"), 'invoice_id': fields.Many2One("account.invoice","Invoice (Waiting Payment)"),