receipt pdf

conv_bal
watcha.h 2015-03-04 11:54:55 +07:00
parent 7d48d0b10d
commit bce643eec6
6 changed files with 52 additions and 28 deletions

View File

@ -2,7 +2,8 @@
<head>
<field name="state"/>
<button string="Print" dropdown="1" icon="print">
<item string="Reciept" method="print_receipt"/>
<!--<item string="Reciept" method="print_receipt"/>-->
<item string="Reciept" action="report_clinic_payment_form" action_options="convert=pdf"/>
</button>
<button string="Options" dropdown="1">
<item string="New Dialyzer" action="clinic_hd_case_dlz" states="draft,in_progress,waiting_treatment"/>

View File

@ -1,7 +1,9 @@
<form model="clinic.shop" attrs='{"readonly":[["state","in",["cancelled","paid","waiting_payment"]]]}' show_company="1">
<head>
<field name="state"/>
<button string="Print" icon="print" action="clinic_cust_print" action_options="convert=pdf"/>
<button string="Print" dropdown="1" icon="print">
<item string="Receipt" action="clinic_cust_print" action_options="convert=pdf"/>
</button>
<button string="Options" dropdown="1">
<item string="To Draft" method="to_draft" states="paid"/>
</button>

View File

@ -1019,6 +1019,8 @@ class HDCase(Model):
settings=get_model('settings').browse(1)
pages=[]
for obj in self.browse(ids):
if not obj.payments:
raise Exception("Receipt not found!")
for payment in obj.payments:
context['payment_id']=payment.id
data=self.get_report_payment_data(context=context)
@ -1372,19 +1374,4 @@ class HDCase(Model):
}
}
def print_receipt(self,ids,context={}):
obj=self.browse(ids)[0]
payment_id=None
for payment in obj.payments:
payment_id=payment.id
if not payment_id:
raise Exception("Receipt not found!")
return {
'next': {
'name': 'report_clinic_payment_form',
'refer_id': obj.id,
'payment_id': payment_id,
},
}
HDCase.register()

View File

@ -122,6 +122,42 @@ class ClinicSetting(Model):
return
def run_script(self,ids,context={}):
user_id=get_active_user()
if user_id !=1:
print("Only admin!!")
return
print("Done!")
return
def update_staff_department(self,ids,context={}):
user_id=get_active_user()
if user_id !=1:
print("Only admin!!")
return
b={}
for dpt in get_model("clinic.department").search_browse([]):
branch=dpt.branch_id
if not branch.id in b:
b[branch.id]=[]
b[branch.id].append(dpt.id)
for staff in get_model("clinic.staff").search_browse([]):
if not staff.departments:
dpt=staff.department_id
branch=staff.branch_id
dpt_ids=[]
if dpt:
dpt_ids.append(dpt.id)
elif branch:
dpt_ids=b.get(branch.id)
staff.write({
'departments': [('set',dpt_ids)],
})
print(staff.name)
print("Done!")
return
def udpate_staff_level(self,ids,context={}):
user_id=get_active_user()
if user_id !=1:
print("Only admin!!")

View File

@ -482,7 +482,7 @@ class Shop(Model):
},
}
def get_bill(self,context={}):
def get_page(self,context={}):
if not context.get('refer_id'):
return {}
shop_id=int(context['refer_id'])
@ -569,7 +569,7 @@ class Shop(Model):
pages=[]
for obj in get_model('clinic.shop').browse(ids):
context['refer_id']=obj.id
data=get_model('clinic.shop').get_bill(context=context)
data=get_model('clinic.shop').get_page(context=context)
pages.append(data)
if pages:
pages[-1]["is_last_page"]=True
@ -578,14 +578,6 @@ class Shop(Model):
"logo": get_file_path(settings.logo),
}
def print_bill(self,ids,context={}):
return {
'next': {
'refer_id': ids[0],
'name': 'clinic_cust_print',
}
}
def pay(self,ids,context={}):
res={}
obj=self.browse(ids)[0]

View File

@ -1,10 +1,16 @@
todo:
- report k. boy (sub detail) -> ok
- need to update level of nurse (Chanon)
- staff rotation
- update level for staff
- add script to
- multi department access
- multi department access ***
- merge staff same name but different department
- doctor นายแพทย์ ทวีชัย
- ** udpate server (run click me)
- ** update accounting
- bug
- wht (david)
===============================
- compute labor cost