diff --git a/netforce_clinic/actions/clinic_report_hd_medical.xml b/netforce_clinic/actions/clinic_report_hd_medical.xml new file mode 100644 index 0000000..09b0345 --- /dev/null +++ b/netforce_clinic/actions/clinic_report_hd_medical.xml @@ -0,0 +1,8 @@ + + Medical Report Summary + report + clinic.report.hd.medical + report_hd_medical + report_hd_medical + clinic_menu + diff --git a/netforce_clinic/actions/clinic_report_hd_payment.xml b/netforce_clinic/actions/clinic_report_hd_payment.xml new file mode 100644 index 0000000..54ad850 --- /dev/null +++ b/netforce_clinic/actions/clinic_report_hd_payment.xml @@ -0,0 +1,8 @@ + + Payment Report Summary + report + clinic.report.hd.payment + report_hd_payment + report_hd_payment + clinic_menu + diff --git a/netforce_clinic/layouts/clinic_menu.xml b/netforce_clinic/layouts/clinic_menu.xml index c95b3dd..70a49bd 100644 --- a/netforce_clinic/layouts/clinic_menu.xml +++ b/netforce_clinic/layouts/clinic_menu.xml @@ -33,8 +33,6 @@
" -
-
diff --git a/netforce_clinic/models/report_hd_detail.py b/netforce_clinic/models/report_hd_detail.py index 1e43cc5..08054e2 100644 --- a/netforce_clinic/models/report_hd_detail.py +++ b/netforce_clinic/models/report_hd_detail.py @@ -82,7 +82,7 @@ class ReportHDDetail(Model): ]) if obj.type_id: dom.append([ - 'type','=',obj.type_id.id, + 'type','=',obj.type_id.name, ]) dom.append(['time_start', ">=", date_from+" 00:00:00"]) @@ -92,17 +92,13 @@ class ReportHDDetail(Model): index=0 no_patient=0 for hd_case in get_model("clinic.hd.case").search_browse(dom,order="cycle_id.sequence"): - #print('='*50) - #for line in hd_case.line: - # dialyzer_id=line.dialyzer_id - # if dialyzer_id: - # dialyzer_number=line.number or "" - # print(dialyzer_number) - - #print('='*50) + + for total in get_model("clinic.hd.case.line").search_browse([]): + total_fee=total.price or "" + + dialyzer_number=hd_case.dlz_id.id or "" patient_type=hd_case.patient_id.type patient_type=PATIENT_TYPE.get(patient_type) - #dialyzer=get_model("clinic.dialyzer").search_browse([]) cycle_name=hd_case.cycle_id.name or "" show_cycle=False if not cycle_name in cycles: @@ -135,10 +131,10 @@ class ReportHDDetail(Model): 'no_patient': 0, 'doctor_id': hd_case.doctor_id.id, 'doctor_name' : hd_case.doctor_id.name, - 'total' : hd_case.total, + 'total' : total_fee, 'hd_case_id' : hd_case.id, 'rc_no' : hd_case.number, - 'dialyzer_number' : 'DZ-XXXX', + 'dialyzer_number' : dialyzer_number, 'nurse_id': hd_case.nurse_id.id, 'nurse_name' : hd_case.nurse_id.name, } diff --git a/netforce_clinic/models/report_hd_medical.py b/netforce_clinic/models/report_hd_medical.py index 77e34a6..777e820 100644 --- a/netforce_clinic/models/report_hd_medical.py +++ b/netforce_clinic/models/report_hd_medical.py @@ -37,141 +37,35 @@ class ReportHDMedical(Model): weekday, total_day=monthrange(year, month) time_start='2014-%s-01 00:00:00'%(month) time_stop='2014-%s-%s 23:59:59'%(month,total_day) - + dom=[] dom.append(['state','=','completed']) dom.append(['time_start','>=',time_start]) dom.append(['time_stop','<=',time_stop]) - for product in get_model("clinic.hd.case.gm.line").search_browse([]): - product_id=product.product_id.Product_id - #product_total=len(product_id) - #print(product_id) - if product_id: - product_name=product.description or "" - #product_id=product.product_id.id or "" - - - lines=[ - { - 'product_id' : 'MD-XXXX', - 'madical' : product_name, - 'mg': '', - 'uc': '437', - 'sc': '', - 'buy' : '4', - 'total' : '441', - }, - { - 'product_id' : 'MD-XXXX', - 'madical' : 'H2', - 'mg': '', - 'uc': '', - 'sc': '', - 'buy' : '', - 'total' : '', - }, - { - 'product_id' : 'MD-XXXX', - 'madical' : 'Epr4', - 'mg': '', - 'uc': '216', - 'sc': '', - 'buy' : '', - 'total' : '216', - }, - { - 'product_id' : 'MD-XXXX', - 'madical' : 'Epr2', - 'mg': '437', - 'uc': '', - 'sc': '', - 'buy' : '', - 'total' : '', - }, - { - 'product_id' : 'MD-XXXX', - 'madical' : 'Epk4', - 'mg': '437', - 'uc': '70', - 'sc': '', - 'buy' : '', - 'total' : '70', - }, - { - 'product_id' : 'MD-XXXX', - 'madical' : 'Epk2', - 'mg': '437', - 'uc': '', - 'sc': '', - 'buy' : '', - 'total' : '', - }, - { - 'product_id' : 'MD-XXXX', - 'madical' : 'Epg4', - 'mg': '437', - 'uc': '98', - 'sc': '', - 'buy' : '', - 'total' : '98', - }, - { - 'product_id' : 'MD-XXXX', - 'madical' : 'Epg2', - 'mg': '437', - 'uc': '', - 'sc': '', - 'buy' : '', - 'total' : '', - }, - { - 'product_id' : 'MD-XXXX', - 'madical' : 'Rng4', - 'mg': '437', - 'uc': '34', - 'sc': '', - 'buy' : '9', - 'total' : '43', - }, - { - 'product_id' : 'MD-XXXX', - 'madical' : 'Rng2', - 'mg': '437', - 'uc': '', - 'sc': '', - 'buy' : '', - 'total' : '', - }, - { - 'product_id' : 'MD-XXXX', - 'madical' : 'Epi4', - 'mg': '437', - 'uc': '264', - 'sc': '', - 'buy' : '9', - 'total' : '43', - }, - { - 'product_id' : 'MD-XXXX', - 'madical' : 'Epi2', - 'mg': '437', - 'uc': '', - 'sc': '', - 'buy' : '', - 'total' : '', - }, - { - 'product_id' : 'MD-XXXX', - 'madical' : 'Vnf', - 'mg': '437', - 'uc': '', - 'sc': '', - 'buy' : '', - 'total' : '', - }, - ] - + lines=[] + index=0 + for product in get_model("product").search_browse(['type','=','stock']): + product_id=product.id or "" + product_code=product.code or "" + product_name=product.name or "" + product_amount=len(str(product_code)) + #total=len(str(product_amount)) + + index+=1 + vals={ + 'product_code' : product_code, + 'medical' : product_name, + 'mg' : '-', + 'uc' : '-', + 'sc' : '-', + 'buy' : '-', + 'amount' : product_amount, + 'product_id': product_id, + } + lines.append(vals) + + data={ 'month': month_str, 'year': year, diff --git a/netforce_clinic/models/report_hd_summary.py b/netforce_clinic/models/report_hd_summary.py index 6d33ac2..64b357e 100644 --- a/netforce_clinic/models/report_hd_summary.py +++ b/netforce_clinic/models/report_hd_summary.py @@ -19,9 +19,6 @@ class ReportHDSummary(Model): } def get_report_data(self,ids,context={}): - # company_id=get_active_company - # company_name=get_model("company").search("name") - # company_name=get_model("company").search_browse() for item in get_model("company").search_browse([]): company_name=item.name @@ -51,10 +48,6 @@ class ReportHDSummary(Model): time_start='2014-%s-01'%(month) # 2014-10-20 time_stop='2014-%s-%s'%(month,total_day) - dom=[] - dom.append(['time_start','>=',time_start]) - dom.append(['time_stop','<=',time_stop]) - dom=[] dom.append(['type','=','mg']) patients_mg=len(get_model("clinic.patient").search(dom)) @@ -66,14 +59,15 @@ class ReportHDSummary(Model): patients_nhso=len(get_model("clinic.patient").search(dom)) dom.append(['type','=','pn']) patients_pn=len(get_model("clinic.patient").search(dom)) - + #New Patients + #dom.append(['type','=','All']) patients=len(get_model("clinic.patient").search_browse(['type','=','All'])) - #new_patients=len(patients) - + dom=[] dom.append(['state','=','completed']) dom.append(['time_start','>=',time_start]) dom.append(['time_stop','<=',time_stop]) + cur_total_case=len(get_model("clinic.hd.case").search(dom)) weekday, prev_total_day=monthrange(year, previous_month) diff --git a/netforce_clinic/reports/report_hd_detail.xlsx b/netforce_clinic/reports/report_hd_detail.xlsx index f8cb902..1e67ae7 100644 Binary files a/netforce_clinic/reports/report_hd_detail.xlsx and b/netforce_clinic/reports/report_hd_detail.xlsx differ diff --git a/netforce_clinic/reports/report_hd_medical.xlsx b/netforce_clinic/reports/report_hd_medical.xlsx new file mode 100644 index 0000000..7e3b942 Binary files /dev/null and b/netforce_clinic/reports/report_hd_medical.xlsx differ diff --git a/netforce_clinic/reports/report_hd_payment.xlsx b/netforce_clinic/reports/report_hd_payment.xlsx new file mode 100644 index 0000000..65c30fd Binary files /dev/null and b/netforce_clinic/reports/report_hd_payment.xlsx differ diff --git a/netforce_clinic/templates/report_hd_detail.hbs b/netforce_clinic/templates/report_hd_detail.hbs index 3579c17..5985b4b 100644 --- a/netforce_clinic/templates/report_hd_detail.hbs +++ b/netforce_clinic/templates/report_hd_detail.hbs @@ -62,7 +62,7 @@ {{total}} {{rc_no}} - {{dialyzer_number}} + {{dialyzer_number}} {{doctor_name}} {{nurse_name}} diff --git a/netforce_clinic/templates/report_hd_madical_old.hbs b/netforce_clinic/templates/report_hd_madical_old.hbs new file mode 100644 index 0000000..43c24b7 --- /dev/null +++ b/netforce_clinic/templates/report_hd_madical_old.hbs @@ -0,0 +1,29 @@ +
+

+ Summary of the Madical +

+

+ [{{company_name}}]
+ As at {{month}} {{year}} +

+
+ + + + + + + + + + {{#each lines}} + + + + + + + + {{/each}} + +
MadicalSocial SecurityucBuyTotal
{{madical}}{{sc}}{{uc}}{{buy}}{{total}}
diff --git a/netforce_clinic/templates/report_hd_medical.hbs b/netforce_clinic/templates/report_hd_medical.hbs new file mode 100644 index 0000000..7a9890f --- /dev/null +++ b/netforce_clinic/templates/report_hd_medical.hbs @@ -0,0 +1,48 @@ +
+

+ Summary of the Medical +

+

+ [{{company_name}}]
+

+

+ As at {{month}} {{year}} +

+
+ + + + + + + + + + + + + + {{#each lines}} + + + + + + + + + + {{/each}} + + + + + + + + + + + + +
Product IDProduct NameMGUCNHSO (30B)PayTotal
{{product_code}}{{medical}}{{mg}}{{uc}}{{sc}}{{buy}}{{amount}}
----32
diff --git a/netforce_clinic/templates/report_hd_payment.hbs b/netforce_clinic/templates/report_hd_payment.hbs new file mode 100644 index 0000000..aaabe16 --- /dev/null +++ b/netforce_clinic/templates/report_hd_payment.hbs @@ -0,0 +1,61 @@ +
+

Detail of the Hemodialysis

+

Payment

+

[{{company_name}}]

+

+ {{#if same_date}} + As at {{fmt_date date_from}} + {{else}} + From {{fmt_date date_from}} to {{fmt_date date_to}} + {{/if}} +

+
+ + + + + + + + + + + + {{#each lines context=context}} + {{#if show_cycle}} + + + + {{/if}} + + + + + + {{#if total}} + + + {{else}} + + {{/if}} + + {{/each}} + + + + + + +
+ Cycle + + RC.No + + Doctor + + Nurce + + HD Fee +
+ {{cycle}} +
{{rc_no}}{{doctor_name}}{{nurse_name}}Total{{total}}{{total}}