diff --git a/netforce_clinic/actions/clinic_report_account_hd_case_summary.xml b/netforce_clinic/actions/clinic_report_account_hd_case_summary.xml index e220d99..67fa412 100644 --- a/netforce_clinic/actions/clinic_report_account_hd_case_summary.xml +++ b/netforce_clinic/actions/clinic_report_account_hd_case_summary.xml @@ -1,5 +1,5 @@ - Report Claim/No Claim + Report Claim Expense report clinic.report.account.hd.case.summary report_account_hd_case_summary diff --git a/netforce_clinic/actions/clinic_report_claim.xml b/netforce_clinic/actions/clinic_report_claim.xml index d758ea4..be5c742 100644 --- a/netforce_clinic/actions/clinic_report_claim.xml +++ b/netforce_clinic/actions/clinic_report_claim.xml @@ -1,5 +1,5 @@ - Report Claim/No Claim + Report Claim Expense report clinic.report.account.hd.case.summary report_account_hd_case_summary diff --git a/netforce_clinic/layouts/clinic_account_menu.xml b/netforce_clinic/layouts/clinic_account_menu.xml index 92d7df7..2521b41 100644 --- a/netforce_clinic/layouts/clinic_account_menu.xml +++ b/netforce_clinic/layouts/clinic_account_menu.xml @@ -7,7 +7,7 @@
- + diff --git a/netforce_clinic/layouts/clinic_menu.xml b/netforce_clinic/layouts/clinic_menu.xml index 05e6bba..7db8d58 100644 --- a/netforce_clinic/layouts/clinic_menu.xml +++ b/netforce_clinic/layouts/clinic_menu.xml @@ -46,7 +46,7 @@ - + diff --git a/netforce_clinic/layouts/clinic_setting.xml b/netforce_clinic/layouts/clinic_setting.xml index 9660d2a..2325576 100644 --- a/netforce_clinic/layouts/clinic_setting.xml +++ b/netforce_clinic/layouts/clinic_setting.xml @@ -1,7 +1,7 @@
diff --git a/netforce_clinic/models/report_account_hd_case_summary.py b/netforce_clinic/models/report_account_hd_case_summary.py index a9c6f16..4307af2 100644 --- a/netforce_clinic/models/report_account_hd_case_summary.py +++ b/netforce_clinic/models/report_account_hd_case_summary.py @@ -105,14 +105,17 @@ class ReportAccountHDCaseSummary(Model): items[code].append({ 'amount': amt, }) - pm_number='' - for pm in hdcase.payments: - pm_number+=pm.number or "" + pm_number=','.join([pm.number for pm in hdcase.payments if pm.number]) inv_number="" inv_ref="" for inv in hdcase.invoices: inv_number+=inv.number or "" inv_ref+=inv.ref or "" + pick_ref="" + pick_id=None + for pick in hdcase.pickings: + pick_ref=pick.number or "" + pick_id=pick.id patient=hdcase.patient_id ptype=hdcase.patient_type_id cycle=hdcase.cycle_id @@ -146,6 +149,8 @@ class ReportAccountHDCaseSummary(Model): 'lab': hdcase.lab, 'misc': hdcase.misc, 'inv_ref': inv_ref and inv_ref or "-", + 'pick_ref': pick_ref and pick_ref or "-", + 'pick_id': pick_id, } for code, item in items.items(): vals.update({ diff --git a/netforce_clinic/models/setting.py b/netforce_clinic/models/setting.py index 82e93d8..bf1ac48 100644 --- a/netforce_clinic/models/setting.py +++ b/netforce_clinic/models/setting.py @@ -152,65 +152,19 @@ class ClinicSetting(Model): if user_id !=1: print("Only admin!!") return - - dom=[ - ['type','=','doctor'], - ] - for st in get_model("clinic.staff").search_browse(dom): - dpt_ids=[] - for b in get_model("clinic.branch").browse([]): - for dpt in b.departments: - dpt_ids.append(dpt.id) - st.write({ - 'departments': [('set',dpt_ids)], - }) - print('dpt_ids ', dpt_ids) - print("Done!") - return - - files=['Patients_Data_LS1.csv','Patients_Data_LS2.csv','Patients_Data_LS3.csv'] - self.update_patient_file(files) - print("Done!") - return + for pt in get_model("clinic.patient").browse([1267]): + print(pt.name or "") + cycles={} + for vs in pt.visits: + date=vs.visit_date + wd=datetime.strptime(date,"%Y-%m-%d").weekday() + key='%s-%s-%s'%(vs.cycle_id.id, wd, vs.department_id.id) + cycles[key]=key + for k, v in cycles.items(): + print(k) ###TODO remove douplicate patient ###TODO remove douplicate staff ###TODO remove douplicate visit - visits={} - for visit in get_model("clinic.visit").search_browse([]): - key='%s-%s'%(visit.visit_date, visit.patient_id.id) - if not key in visits.keys(): - visits[key]=[] - hd_ids=[] - for hdcase in visit.hd_cases: - hd_ids.append(hdcase.id) - visits[key].append({ - 'id': visit.id, - 'date': visit.visit_date, - 'patient_id': visit.patient_id.id, - 'state': visit.state, - 'hd_ids': hd_ids, - }) - for k, vs in visits.items(): - if len(vs) > 1: - vids=[] - for v in vs: - if v['state']=='pending': - visit=get_model("clinic.visit").browse(v['id']) - for hdcase in visit.hd_cases: - hdcase.delete() - visit.delete() - print('deleted id ', v['id'], v['patient_id'], v['date']) - elif len(v['hd_ids']) < 1: - visit=get_model("clinic.visit").browse(v['id']) - if visit: - for hdcase in visit.hd_cases: - hdcase.delete() - visit.to_draft() - visit.delete() - print('deleted id ', v['id'], v['patient_id'], v['date']) - elif v['state'] in ('confirmed', 'cancelled'): - vids.append(v['id']) - print('need to delete id ', vids, vids[0]) print("Done!") def multi_department(self,ids,context={}): diff --git a/netforce_clinic/reports/report_account_hd_case_summary.xlsx b/netforce_clinic/reports/report_account_hd_case_summary.xlsx index 11e745e..f8c89cc 100644 Binary files a/netforce_clinic/reports/report_account_hd_case_summary.xlsx and b/netforce_clinic/reports/report_account_hd_case_summary.xlsx differ diff --git a/netforce_clinic/templates/report_account_hd_case_summary.hbs b/netforce_clinic/templates/report_account_hd_case_summary.hbs index 872faa2..892710f 100644 --- a/netforce_clinic/templates/report_account_hd_case_summary.hbs +++ b/netforce_clinic/templates/report_account_hd_case_summary.hbs @@ -45,6 +45,7 @@ Misc. Dlz Ref.Inv# + Picking# {{else}} Date Cycle# @@ -58,6 +59,7 @@ ค่าฟอก ค่ายา ค่าบริการฉีดยา + Picking# แพทย์ พยาบาล {{/ifeq}} @@ -85,6 +87,13 @@ {{currency misc zero=""}} {{dlz_name}} {{inv_ref}} + + {{#if pick_id}} + {{view "link" string=pick_ref action="pick_out" action_options="mode=form" active_id=pick_id}} + {{else}} + - + {{/if}} + {{else}} {{date}} {{cycle}} @@ -100,6 +109,13 @@ {{currency fee zero=""}} {{currency epo zero=""}} {{currency srv zero=""}} + + {{#if pick_id}} + {{view "link" string=pick_ref action="pick_out" action_options="mode=form" active_id=pick_id}} + {{else}} + - + {{/if}} + {{dname}} {{view "link" string="View" action="clinic_cycle_item" action_options="mode=form" active_id=cycle_item_id}} diff --git a/netforce_clinic/todo.txt b/netforce_clinic/todo.txt index e69de29..d28e542 100644 --- a/netforce_clinic/todo.txt +++ b/netforce_clinic/todo.txt @@ -0,0 +1,8 @@ + report cycle item + - remove minus from fee amount + - summary amount +report medical + - see detail of amount (department, patient, cycle, hdcase#) + +report claim expense: + - add good issue columns