Merge branch 'master' of dev.netforce.com:netforce-customized/clinic
commit
6cb01fd8ef
|
@ -1 +1,3 @@
|
||||||
attr multi_company=True not working
|
1.print report labor cost
|
||||||
|
2.
|
||||||
|
3.
|
||||||
|
|
|
@ -599,7 +599,7 @@ class HDCase(Model):
|
||||||
if obj.invoices:
|
if obj.invoices:
|
||||||
for inv in obj.invoices:
|
for inv in obj.invoices:
|
||||||
inv.void()
|
inv.void()
|
||||||
due_date=obj.date[1:10] # XXX
|
due_date=obj.date[0:10]
|
||||||
# cash, credit
|
# cash, credit
|
||||||
is_credit=context.get('is_credit') or False
|
is_credit=context.get('is_credit') or False
|
||||||
context['type']='out'
|
context['type']='out'
|
||||||
|
|
|
@ -175,9 +175,8 @@ class MatchingPayment(Model):
|
||||||
if invoice.related_id:
|
if invoice.related_id:
|
||||||
hdcase=invoice.related_id
|
hdcase=invoice.related_id
|
||||||
patient=hdcase.patient_id
|
patient=hdcase.patient_id
|
||||||
#pname=patient.name_check or "" #XXX
|
|
||||||
pname='%s%s'%(patient.first_name or "",patient.last_name or "")
|
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):
|
if patient_names.get(pname):
|
||||||
pname=patient_names[pname]
|
pname=patient_names[pname]
|
||||||
pname2='%s %s'%(patient.first_name or "",patient.last_name or "")
|
pname2='%s %s'%(patient.first_name or "",patient.last_name or "")
|
||||||
|
@ -185,7 +184,6 @@ class MatchingPayment(Model):
|
||||||
hn=patient.hn_no or ""
|
hn=patient.hn_no or ""
|
||||||
elif invoice.ref:
|
elif invoice.ref:
|
||||||
pname=invoice.ref or ''
|
pname=invoice.ref or ''
|
||||||
#XXX
|
|
||||||
if patient_names.get(pname):
|
if patient_names.get(pname):
|
||||||
pname=patient_names[pname]
|
pname=patient_names[pname]
|
||||||
pname2=pname
|
pname2=pname
|
||||||
|
@ -278,8 +276,7 @@ class MatchingPayment(Model):
|
||||||
'invoice_id': None,
|
'invoice_id': None,
|
||||||
'state': 'unmatch',
|
'state': 'unmatch',
|
||||||
}
|
}
|
||||||
#if hn=='100794':
|
|
||||||
#import pdb; pdb.set_trace()
|
|
||||||
if matches1.get(key1):
|
if matches1.get(key1):
|
||||||
print("found ", key1)
|
print("found ", key1)
|
||||||
record.update({
|
record.update({
|
||||||
|
|
|
@ -11,6 +11,7 @@ class MatchingPaymentLine(Model):
|
||||||
'amount': (obj.fee or 0)+(obj.epo or 0)+(obj.srv or 0),
|
'amount': (obj.fee or 0)+(obj.epo or 0)+(obj.srv or 0),
|
||||||
}
|
}
|
||||||
return res
|
return res
|
||||||
|
|
||||||
_fields={
|
_fields={
|
||||||
'match_id': fields.Many2One("clinic.matching.payment","Match",required=True,on_delete="cascade"),
|
'match_id': fields.Many2One("clinic.matching.payment","Match",required=True,on_delete="cascade"),
|
||||||
'invoice_id': fields.Many2One("account.invoice","Invoice (Waiting Payment)"),
|
'invoice_id': fields.Many2One("account.invoice","Invoice (Waiting Payment)"),
|
||||||
|
|
|
@ -9,4 +9,25 @@ class Partner(Model):
|
||||||
'is_staff': fields.Boolean("Is Staff"),
|
'is_staff': fields.Boolean("Is Staff"),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def name_get(self,ids,context={}):
|
||||||
|
vals=[]
|
||||||
|
for obj in self.browse(ids):
|
||||||
|
name=obj.name or ""
|
||||||
|
if obj.code:
|
||||||
|
name=" %s (%s)"%(name,obj.code)
|
||||||
|
vals.append((obj.id,name))
|
||||||
|
return vals
|
||||||
|
|
||||||
|
def name_search(self,name,domain=None,condition=[],context={},**kw):
|
||||||
|
dom=[["name","ilike","%"+name+"%"]]
|
||||||
|
if domain:
|
||||||
|
dom=[dom,domain]
|
||||||
|
ids1=self.search(dom)
|
||||||
|
dom=[["code","ilike","%"+name+"%"]]
|
||||||
|
if domain:
|
||||||
|
dom=[dom,domain]
|
||||||
|
ids2=self.search(dom)
|
||||||
|
ids=list(set(ids1+ids2))
|
||||||
|
return self.name_get(ids,context=context)
|
||||||
|
|
||||||
Partner.register()
|
Partner.register()
|
||||||
|
|
|
@ -2,6 +2,7 @@ from netforce.model import Model, fields
|
||||||
|
|
||||||
class Province(Model):
|
class Province(Model):
|
||||||
_inherit="province"
|
_inherit="province"
|
||||||
|
|
||||||
def _get_sort_name(self,ids,context={}):
|
def _get_sort_name(self,ids,context={}):
|
||||||
res={}
|
res={}
|
||||||
for obj in self.browse(ids):
|
for obj in self.browse(ids):
|
||||||
|
|
|
@ -25,19 +25,14 @@ class ReportShop(Model):
|
||||||
weekday, total_day=monthrange(int(year), int(month))
|
weekday, total_day=monthrange(int(year), int(month))
|
||||||
date_from=defaults.get('date_from','%s-%s-01'%(year,month))
|
date_from=defaults.get('date_from','%s-%s-01'%(year,month))
|
||||||
date_to=defaults.get('date_to',"%s-%s-%s"%(year,month,total_day))
|
date_to=defaults.get('date_to',"%s-%s-%s"%(year,month,total_day))
|
||||||
#date_from=defaults.get('date',date)
|
|
||||||
#date_to=defaults.get('date',date)
|
|
||||||
product_id=defaults.get('product_id')
|
product_id=defaults.get('product_id')
|
||||||
|
|
||||||
branch_id=defaults.get('branch_id',None)
|
branch_id=defaults.get('branch_id',None)
|
||||||
print('defaults ', defaults)
|
|
||||||
if branch_id:
|
if branch_id:
|
||||||
branch_id=int(branch_id)
|
branch_id=int(branch_id)
|
||||||
department_id=defaults.get('department_id',None)
|
department_id=defaults.get('department_id',None)
|
||||||
if department_id:
|
if department_id:
|
||||||
department_id=int(department_id)
|
department_id=int(department_id)
|
||||||
select_dpt=get_model('select.company').get_select()
|
select_dpt=get_model('select.company').get_select()
|
||||||
print('select_dpt ', select_dpt)
|
|
||||||
if select_dpt:
|
if select_dpt:
|
||||||
if not branch_id:
|
if not branch_id:
|
||||||
branch_id=select_dpt['branch_id']
|
branch_id=select_dpt['branch_id']
|
||||||
|
|
|
@ -164,9 +164,13 @@ class ClinicSetting(Model):
|
||||||
if user_id !=1:
|
if user_id !=1:
|
||||||
print("Only admin!!")
|
print("Only admin!!")
|
||||||
return
|
return
|
||||||
obj=self.browse(ids)[0]
|
sql=''
|
||||||
obj.merge_staff()
|
for hdcase in get_model("clinic.hd.case").search_browse([]):
|
||||||
print("Done!")
|
for invoice in hdcase.invoices:
|
||||||
|
print(hdcase.date,' ---> ', invoice.due_date)
|
||||||
|
sql+="update account_invoice set due_date='%s' where id=%s;"%(hdcase.date,invoice.id)
|
||||||
|
db=get_connection()
|
||||||
|
db.execute(sql)
|
||||||
|
|
||||||
def merge_staff(self,ids,context={}):
|
def merge_staff(self,ids,context={}):
|
||||||
user_id=get_active_user()
|
user_id=get_active_user()
|
||||||
|
|
Loading…
Reference in New Issue