fix invoice due_date
parent
0fec2f8db2
commit
a2de551f12
|
@ -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'
|
||||
|
|
|
@ -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({
|
||||
|
|
|
@ -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)"),
|
||||
|
|
Loading…
Reference in New Issue