From 513c2a305993e6f51da82c0de24ae9634094c328 Mon Sep 17 00:00:00 2001 From: "watcha.h" Date: Tue, 17 Feb 2015 23:28:44 +0700 Subject: [PATCH] link report --- .../clinic_report_labor_cost_daily.xml | 8 + .../clinic_report_labor_cost_detail.xml | 8 + .../layouts/clinic_account_menu.xml | 1 + .../clinic_report_labor_cost_daily.xml | 5 + .../clinic_report_labor_cost_detail.xml | 8 + .../clinic_report_labor_cost_summary.xml | 2 +- netforce_clinic/models/__init__.py | 4 +- .../models/report_labor_cost_daily.py | 114 ++++++++++++ .../models/report_labor_cost_detail.py | 175 ++++++++++++++++++ .../models/report_labor_cost_summary.py | 19 +- ...ost.xlsx => report_labor_cost_detail.xlsx} | Bin .../reports/report_labor_cost_summary.xlsx | Bin 0 -> 6677 bytes .../templates/report_labor_cost_daily.hbs | 27 +++ .../templates/report_labor_cost_detail.hbs | 55 ++++++ .../templates/report_labor_cost_summary.hbs | 11 +- 15 files changed, 425 insertions(+), 12 deletions(-) create mode 100644 netforce_clinic/actions/clinic_report_labor_cost_daily.xml create mode 100644 netforce_clinic/actions/clinic_report_labor_cost_detail.xml create mode 100644 netforce_clinic/layouts/clinic_report_labor_cost_daily.xml create mode 100644 netforce_clinic/layouts/clinic_report_labor_cost_detail.xml create mode 100644 netforce_clinic/models/report_labor_cost_daily.py create mode 100644 netforce_clinic/models/report_labor_cost_detail.py rename netforce_clinic/reports/{report_labor_cost.xlsx => report_labor_cost_detail.xlsx} (100%) create mode 100644 netforce_clinic/reports/report_labor_cost_summary.xlsx create mode 100644 netforce_clinic/templates/report_labor_cost_daily.hbs create mode 100644 netforce_clinic/templates/report_labor_cost_detail.hbs diff --git a/netforce_clinic/actions/clinic_report_labor_cost_daily.xml b/netforce_clinic/actions/clinic_report_labor_cost_daily.xml new file mode 100644 index 0000000..6550858 --- /dev/null +++ b/netforce_clinic/actions/clinic_report_labor_cost_daily.xml @@ -0,0 +1,8 @@ + + Report Labor Cost Daily + report + clinic.report.labor.cost.daily + report_labor_cost_daily + report_labor_cost_daily + account_menu + diff --git a/netforce_clinic/actions/clinic_report_labor_cost_detail.xml b/netforce_clinic/actions/clinic_report_labor_cost_detail.xml new file mode 100644 index 0000000..9c54ecf --- /dev/null +++ b/netforce_clinic/actions/clinic_report_labor_cost_detail.xml @@ -0,0 +1,8 @@ + + Report Labor Cost Detail + report + clinic.report.labor.cost.detail + report_labor_cost_detail + report_labor_cost_detail + account_menu + diff --git a/netforce_clinic/layouts/clinic_account_menu.xml b/netforce_clinic/layouts/clinic_account_menu.xml index 48fb75d..7c6c8d6 100644 --- a/netforce_clinic/layouts/clinic_account_menu.xml +++ b/netforce_clinic/layouts/clinic_account_menu.xml @@ -10,6 +10,7 @@
+ diff --git a/netforce_clinic/layouts/clinic_report_labor_cost_daily.xml b/netforce_clinic/layouts/clinic_report_labor_cost_daily.xml new file mode 100644 index 0000000..ac3bb96 --- /dev/null +++ b/netforce_clinic/layouts/clinic_report_labor_cost_daily.xml @@ -0,0 +1,5 @@ +
+ + + + diff --git a/netforce_clinic/layouts/clinic_report_labor_cost_detail.xml b/netforce_clinic/layouts/clinic_report_labor_cost_detail.xml new file mode 100644 index 0000000..1462a97 --- /dev/null +++ b/netforce_clinic/layouts/clinic_report_labor_cost_detail.xml @@ -0,0 +1,8 @@ +
+ + + + + + + diff --git a/netforce_clinic/layouts/clinic_report_labor_cost_summary.xml b/netforce_clinic/layouts/clinic_report_labor_cost_summary.xml index 3b43778..63843f5 100644 --- a/netforce_clinic/layouts/clinic_report_labor_cost_summary.xml +++ b/netforce_clinic/layouts/clinic_report_labor_cost_summary.xml @@ -2,7 +2,7 @@ - + diff --git a/netforce_clinic/models/__init__.py b/netforce_clinic/models/__init__.py index b30808b..e67173d 100644 --- a/netforce_clinic/models/__init__.py +++ b/netforce_clinic/models/__init__.py @@ -76,6 +76,8 @@ from . import report_staff_fee_detail from . import report_staff_fee_sum from . import report_payment_matching from . import report_labor_cost_summary +from . import report_labor_cost_detail +from . import report_labor_cost_daily from . import branch from . import period from . import period_line @@ -100,9 +102,9 @@ from . import make_apt from . import make_apt_line from . import matching_payment from . import matching_hdcase +from . import sale_order from . import shop from . import shop_line -from . import sale_order from . import product from . import base_user from . import select_company diff --git a/netforce_clinic/models/report_labor_cost_daily.py b/netforce_clinic/models/report_labor_cost_daily.py new file mode 100644 index 0000000..e4e6743 --- /dev/null +++ b/netforce_clinic/models/report_labor_cost_daily.py @@ -0,0 +1,114 @@ +import time +from calendar import monthrange + +from netforce.model import Model,fields,get_model +from netforce.access import get_active_company + +class ReportLaborCostDaily(Model): + _name="clinic.report.labor.cost.daily" + _string="Report Labor Cost Daily" + _transient=True + + _fields={ + "date": fields.Date("Date"), + "type": fields.Selection([["doctor","Doctor"],["nurse","Nurse"],["staff","Staff"]],"Type"), + 'staff_id': fields.Many2One("clinic.staff","Staff"), + } + + def _get_date_from(self,context={}): + year,month=time.strftime("%Y-%m").split("-") + return '%s-%s-01'%(year,month) + + def _get_date_to(self,context={}): + year,month,day=time.strftime("%Y-%m-%d").split("-") + weekday, total_day=monthrange(int(year), int(month)) + return "%s-%s-%s"%(year,month,total_day) + + _defaults={ + 'date': lambda *a: time.strftime("%Y-%m-%d"), + } + + def get_report_data(self,ids,context={}): + fmt='%Y-%m-%d' + date=time.strftime(fmt) + company_id=get_active_company() + comp=get_model("company").browse(company_id) + staff_type=None + staff_id=None + dom=[] + if ids: + obj=self.browse(ids)[0] + date=obj.date + staff_id=obj.staff_id.id + staff_type=obj.type + dom.append(['date','>=',date]) + dom.append(['date','<=',date]) + # prevent to load more + if not staff_id: + return {} + if staff_id: + dom.append(['staff_id','=',staff_id]) + if staff_type: + dom.append(['type','=',staff_type]) + lines=[] + no=1 + for line in get_model("clinic.labor.cost.line").search_browse(dom): + lcost=line.labor_cost_id + citem=lcost.cycle_item_id + cycle=citem.cycle_id + staff=line.staff_id + dpt=citem.department_id + amt=line.amount or 0 + if staff_type=='doctor': + for hdcase in citem.hd_cases: + doctor=hdcase.doctor_id + pt_type=hdcase.patient_type_id + pt=hdcase.patient_id + if staff.id==doctor.id: + lines.append({ + 'no': no, + 'hn': pt.number, + 'patient_id': pt.id, + 'patient_name': pt.name or '', + 'patient_type_name': pt_type.name or '', + 'amount': amt, + 'dpt_id': dpt.id, + 'dpt_name': dpt.name or "", + 'cycle_name': cycle.name, + 'cycle_id': cycle.id, + }) + no+=1 + elif staff_type=='nurse': + for hdcase in citem.hd_cases: + doctor=hdcase.doctor_id + pt_type=hdcase.patient_type_id + pt=hdcase.patient_id + lines.append({ + 'no': no, + 'hn': pt.number, + 'patient_id': pt.id, + 'patient_type_name': pt_type.name or '', + 'patient_name': pt.name or '', + 'dpt_id': dpt.id, + 'dpt_name': dpt.name or "", + 'amount': 0, + 'cycle_name': cycle.name, + 'cycle_id': cycle.id, + }) + no+=1 + else: + continue + data={ + 'staff_type': staff_type, + 'date': date, + 'comp_name': comp.name or 0, + 'lines': lines, + } + return data + + def onchange_type(self,context={}): + data=context['data'] + data['staff_id']=None + return data + +ReportLaborCostDaily.register() diff --git a/netforce_clinic/models/report_labor_cost_detail.py b/netforce_clinic/models/report_labor_cost_detail.py new file mode 100644 index 0000000..8177d9b --- /dev/null +++ b/netforce_clinic/models/report_labor_cost_detail.py @@ -0,0 +1,175 @@ +import time +from calendar import monthrange + +from netforce.model import Model,fields,get_model +from netforce.access import get_active_company + +class ReportLaborCostDetail(Model): + _name="clinic.report.labor.cost.detail" + _string="Report Labor Cost Detail" + _transient=True + + _fields={ + "date": fields.Date("Month"), + "date_from": fields.Date("From", required=True), + "date_to": fields.Date("To", required=True), + 'department_id': fields.Many2One("clinic.department","Department"), + 'staff_id': fields.Many2One("clinic.staff","Staff"), + "type": fields.Selection([["doctor","Doctor"],["nurse","Nurse"],["staff","Staff"]],"Type"), + 'department_id': fields.Many2One("clinic.department","Department"), + 'branch_id': fields.Many2One("clinic.branch","Branch"), + } + + def _get_date_from(self,context={}): + year,month=time.strftime("%Y-%m").split("-") + return '%s-%s-01'%(year,month) + + def _get_date_to(self,context={}): + year,month,day=time.strftime("%Y-%m-%d").split("-") + weekday, total_day=monthrange(int(year), int(month)) + return "%s-%s-%s"%(year,month,total_day) + + _defaults={ + 'date': lambda *a: time.strftime("%Y-%m-%d"), + 'date_from': _get_date_from, + 'date_to': _get_date_to, + 'type': 'doctor', + } + + def get_report_data(self,ids,context={}): + fmt='%Y-%m-%d' + date_from=time.strftime(fmt) + date_to=time.strftime(fmt) + company_id=get_active_company() + comp=get_model("company").browse(company_id) + staff_type=None + staff_id=None + department_id=None + defaults=context.get("defaults",{}) + if defaults: + print('get from default ', defaults) + date_from=defaults.get("date_from") + date_to=defaults.get("date_to") + department_id=defaults.get("department_id") + staff_type=defaults.get("staff_type") + staff_id=defaults.get("staff_id") + dom=[] + if ids: + print("get from ids") + obj=self.browse(ids)[0] + date_from=obj.date_from + date_to=obj.date_to + staff_id=obj.staff_id.id + staff_type=obj.type + department_id=obj.department_id.id + dom.append(['date','>=',date_from]) + dom.append(['date','<=',date_to]) + if staff_id: + dom.append(['staff_id','=',staff_id]) + if staff_type: + dom.append(['type','=',staff_type]) + if department_id: + dom.append(['labor_cost_id.cycle_item_id.department_id','=',department_id]) + #prevent to load more data + if not staff_id: + return {} + dates={} + for line in get_model("clinic.labor.cost.line").search_browse(dom): + lcost=line.labor_cost_id + citem=lcost.cycle_item_id + date=citem.date + if not date: + continue + dpt=citem.department_id + amt=line.amount or 0 + qty=len(citem.hd_cases) or 0 # qty of patient + if not dates.get(date): + dates[date]={ + dpt.name: { + 'amt': 0, + 'qty': 0, + }, + } + if not dates[date].get(dpt.name): + dates[date].update({ + dpt.name: { + 'amt': 0, + 'qty': 0, + }}) + dates[date][dpt.name]['amt']+=amt + dates[date][dpt.name]['qty']+=qty + lines=[] + dpts=get_model("clinic.department").search_read([],['name']) + dpts=sorted(dpts, key=lambda b: b['name']) + no=1 + dlines=sorted(dates.keys()) #sort by staff name + for kdate in dlines: + vals=dates[kdate] + lvals={ + 'no': no, + 'date': kdate, + } + total_qty, total_amt=0, 0 + lvals['sub_lines']=[] + for dpt in dpts: + amt,qty=0,0 + dname=dpt['name'] or '' + dpt_vals=vals.get(dname) + if dpt_vals: + amt=dpt_vals.get("amt",0) + qty=dpt_vals.get("qty",0) + lvals['sub_lines'].append({'qty': qty, 'amt': amt}) + total_amt+=amt + total_qty+=qty + lvals['total_qty']=total_qty # total show as right hand side + lvals['total_amt']=total_amt + lines.append(lvals) + no+=1 + # summary as footer + dpt_lines=[{'qty': 0, 'amt': 0} for dpt in dpts] + for line in lines: + i=0 + for sub_line in line['sub_lines']: + dpt_lines[i]['qty']+=sub_line['qty'] or 0 + dpt_lines[i]['amt']+=sub_line['amt'] or 0 + i+=1 + + ## summary as footer (total) + total_qty, total_amt=0, 0 + for tline in dpt_lines: + total_qty+=tline['qty'] or 0 + total_amt+=tline['amt'] or 0 + dpt_lines.append({'amt': total_amt, 'qty': total_qty}) + + for dpt in dpts: + dpt.update({ + 'qty_text': 'คนไข้', + 'amt_text': 'จำนวนเงิน', + }) + comp_span=(len(dpts)*2)+1 + data={ + 'date_from': date_from, + 'date_to': date_to, + 'dpts': dpts, + 'comp_name': comp.name or 0, + 'comp_span': comp_span, #qty, amt + 'lines': lines, + 'dpt_lines': dpt_lines, + } + return data + + def onchange_date(self,context={}): + data=context['data'] + date=data['date'] + year,month,day=date.split("-") + weekday, total_day=monthrange(int(year), int(month)) + data['date_from']="%s-%s-01"%(year,month) + data['date_to']="%s-%s-%s"%(year,month,total_day) + return data + + def onchange_type(self,context={}): + data=context['data'] + data['staff_id']=None + return data + +ReportLaborCostDetail.register() diff --git a/netforce_clinic/models/report_labor_cost_summary.py b/netforce_clinic/models/report_labor_cost_summary.py index a1e76e3..2309ef0 100644 --- a/netforce_clinic/models/report_labor_cost_summary.py +++ b/netforce_clinic/models/report_labor_cost_summary.py @@ -17,7 +17,7 @@ class ReportLaborCostSummary(Model): "type": fields.Selection([["doctor","Doctor"],["nurse","Nurse"],["staff","Staff"]],"Type"), 'department_id': fields.Many2One("clinic.department","Department"), 'branch_id': fields.Many2One("clinic.branch","Branch"), - 'only_value': fields.Boolean("Only Value Exist"), + 'only_value': fields.Boolean("Only Amount"), } def _get_date_from(self,context={}): @@ -37,9 +37,9 @@ class ReportLaborCostSummary(Model): } def get_report_data(self,ids,context={}): - fmt='%Y-%m-%d' - date_from=time.strftime(fmt) - date_to=time.strftime(fmt) + res=get_model("clinic.report.labor.cost.summary").default_get() + date_from=res['date_from'] + date_to=res['date_to'] company_id=get_active_company() comp=get_model("company").browse(company_id) staff_type=None @@ -61,7 +61,6 @@ class ReportLaborCostSummary(Model): dom.append(['type','=',staff_type]) if only_value: dom.append(['amount','!=',0]) - staffs={} for line in get_model("clinic.labor.cost.line").search_browse(dom): lcost=line.labor_cost_id @@ -72,8 +71,8 @@ class ReportLaborCostSummary(Model): if not staffs.get(staff.name): staffs[staff.name]={ 'staff_id': staff.id, + 'staff_type': staff.type, dpt.name: { - 'type': staff.type, 'amt': 0, }, } @@ -82,7 +81,6 @@ class ReportLaborCostSummary(Model): dpt.name: { 'amt': 0, }}) - staffs[staff.name][dpt.name]['amt']+=amt lines=[] dpts=get_model("clinic.department").search_read([],['name']) @@ -96,6 +94,7 @@ class ReportLaborCostSummary(Model): 'no': no, 'staff_name': sname, 'staff_id': vals.get('staff_id'), + 'staff_type': vals.get('staff_type'), } total=0 lvals['sub_lines']=[] @@ -134,6 +133,7 @@ class ReportLaborCostSummary(Model): total+=amt total_lines.append({'amt': total}) + print(date_from, ' ', date_to) data={ 'title': title, 'date_from': date_from, @@ -155,4 +155,9 @@ class ReportLaborCostSummary(Model): data['date_to']="%s-%s-%s"%(year,month,total_day) return data + def onchange_type(self,context={}): + data=context['data'] + data['staff_id']=None + return data + ReportLaborCostSummary.register() diff --git a/netforce_clinic/reports/report_labor_cost.xlsx b/netforce_clinic/reports/report_labor_cost_detail.xlsx similarity index 100% rename from netforce_clinic/reports/report_labor_cost.xlsx rename to netforce_clinic/reports/report_labor_cost_detail.xlsx diff --git a/netforce_clinic/reports/report_labor_cost_summary.xlsx b/netforce_clinic/reports/report_labor_cost_summary.xlsx new file mode 100644 index 0000000000000000000000000000000000000000..ce8adc36a9282c06cd43e02fef3d09d01904295a GIT binary patch literal 6677 zcmeHLWmuHk+9st_x=TuG0Ev-Qx}`%>VCWcHxFzE`i9tFA1?l=`+}}BJ z{Px~I&h`D=&s;O_yw^4BdDptrkblZ<^v1w+Ahz+QykIMB!BAQBci`18ToOm;D$44toDrz>qk*Q#=BRWXh*bPZYkeDvB3RZQfT&^thq1EQUW$&Y$H)x0oQHaqacH9Y3+1C-*wp z@RlIv)Ru|rg%@P8+Tmh7+po$+JgoHgP`p%D_N)o}9{t5F;Y*7g0Hvx4pdg4+)c_a* zV{hCPvs9#%dqgJCiDC^pUm;c%u6>p+RE7ZsX3=I_hQc6<_;)~&`~egUA}0$oGiN8x zpBEk&R_PjwP7_?X%|{P;ferycG+Q+}iu_!HBo@Vd7Oqakis_2{N=+H?)5~3*{vum+ zln@FV%bB_8QwVESt*G_zew#-y@qiVZg@eW_@F29StOcN*^qRDA&OkZ1L>=gN`8sZZBltv2HxKHQGmTrc1;k_v44ozte*7<;J(ZwX@WRour}6 zz=4!(9}c*onYj=3dIdLP?0gvSxHW%W!1)IL)*VRpR&mT!Z)t{nven~*qjbFpeuKo? z*mp__*AN;$>oFCi82w5=KFyDCrE1Z8QDg)4;W5@Dt^+a)r4;voi3F9R#M?_Wke-_t zn+&NaT`%=f6&<3aJFhj+PbSIyTM15Q88G!Y{Zr6i7h=3z6gSjvjXv))lAK&^fwwx9 zUfEvUemo6+Xik}2w+V@CZ z*3sJ!UzYh=WOt*q!X`)3(bIgbRxa3XMO)m9qdcl}FK18TW0nRUDuNymK=M{qkUHD$ zL(0qe!*8x(qEF`g+*@y_xp}DQT6 z@(9RQSN+m2@z%eK9EVuhdTvJUgN7-^f`=#VnP}k-D_xo{11G+ZLUAPnwxUdXqf@#E z%lc)bLEaIm+-L0DtNOyPsgf^6ZpV$>ou1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Xc&_2YksmKExP+AX+LKZvI~?#_Mz+CU>De-(fJl+BE9)T< zF*kFwI!4Uu@;3#m1G>7T-Zfgrb*$AfvOaV4)#{y0{6ng&2RgYLrf)d|x=Mo3v#NC^ zN0_umnsV0lR8>!eCuhZ&7HHNsb6pyPg*~2&xVN&^oxg2Elf@Ea`22RFO9XRwcg~8- zK-86ug_(wVBK14F!8Ohh;DSl8$2TF6EZE47{_uSPJ;;5vxmUIHfIhf~%Kf?7j=P|DR2jHgO%pp;9VOP<|_XRQs|@p+GGAb&t0nsX1e~0 zCs2Zd=J`_#_V+Az&xQY)B_F!zKgsgbWcoeJU(e+h?N77(JW>9h<*uxRspMbr0xB?| zbNN4-`S%QW)e200{t5-`f6wDzV)XaHcex!VXnqAhl+a<1|F^vPedt~GgOUHQkb?H* z?_0s|qwh92j3Ix8AryvxkNy{5{yzL}mBLuyS2Pg*DJQ7NBSY;)I5-UGYY

+ + + + + + + + + + + + + {{#each lines }} + + + + + + + + + {{/each}} + + + +
#HNPatientTypeCycleDepartment
{{no}}{{hn}}{{patient_name}}{{patient_type_name}}{{cycle_name}}{{dpt_name}}
diff --git a/netforce_clinic/templates/report_labor_cost_detail.hbs b/netforce_clinic/templates/report_labor_cost_detail.hbs new file mode 100644 index 0000000..05875f4 --- /dev/null +++ b/netforce_clinic/templates/report_labor_cost_detail.hbs @@ -0,0 +1,55 @@ +

+ + + + + + + + + + + + + {{#each dpts}} + + {{/each}} + + + + + + + {{#each dpts}} + + + {{/each}} + + + + + + {{#each lines }} + + + {{#each sub_lines}} + + + {{/each}} + + {{/each}} + + + + + {{#each dpt_lines}} + + + {{/each}} + +
{{comp_name}}
#วันที่{{name}}รวม
{{qty_text}}{{amt_text}}คนไข้จำนวนเงิน
{{no}} + + {{date}} + {{qty}}{{currency amt zero=""}}{{currency total_qty zero=""}} + {{currency total_amt zero=""}} +
รวม{{qty}}{{currency amt zero=""}}
diff --git a/netforce_clinic/templates/report_labor_cost_summary.hbs b/netforce_clinic/templates/report_labor_cost_summary.hbs index b006c68..91425de 100644 --- a/netforce_clinic/templates/report_labor_cost_summary.hbs +++ b/netforce_clinic/templates/report_labor_cost_summary.hbs @@ -1,3 +1,4 @@ +

@@ -13,7 +14,7 @@ {{/each}} - + @@ -24,14 +25,18 @@ {{view "link" string=staff_name action="clinic_staff" action_options="mode=form" active_id=staff_id}} {{#each sub_lines}} - + {{/each}} {{/each}} - + {{#each total_lines}}
{{name}}Totalรวม
{{currency amt zero=""}} + + {{currency amt zero=""}} + + {{currency total zero=""}}
รวม {{currency amt zero=""}}