diff --git a/netforce_clinic/models/report_cycle_item.py b/netforce_clinic/models/report_cycle_item.py index 0566d07..a2793f3 100644 --- a/netforce_clinic/models/report_cycle_item.py +++ b/netforce_clinic/models/report_cycle_item.py @@ -24,9 +24,10 @@ class ReportCycleItem(Model): def default_get(self,field_names=None,context={},**kw): defaults=context.get("defaults",{}) date=defaults.get('date',time.strftime("%Y-%m-%d")) - year,month=time.strftime("%Y-%m").split("-") - date_from=defaults.get('date_from','%s-%s-01'%(year,month)) - date_to=defaults.get('date_to','%s-%s-01'%(year,month)) + #year,month=time.strftime("%Y-%m").split("-") + datenow=time.strftime("%Y-%m-%d") + date_from=defaults.get('date_from',datenow) + date_to=defaults.get('date_to',datenow) branch_id=defaults.get('branch_id') if branch_id: branch_id=int(branch_id) @@ -63,6 +64,7 @@ class ReportCycleItem(Model): branch_id=defaults.get("branch_id") department_id=defaults.get("department_id") ptype_id=defaults.get("ptype_id") + print('date_from ', date_from) month=date_from.split("-")[1] cycle_id=None if ids: @@ -122,9 +124,14 @@ class ReportCycleItem(Model): dpt=hdcase.department_id dlz_use=hdcase.dlz_use or 0 dlz_drop=False - if dlz_use==hdcase.dlz_max: - dlz_use="%sทิ้ง"%dlz_use - dlz_drop=True + #if dlz_use==hdcase.dlz_max: + #dlz_use="%sทิ้ง"%dlz_use + #dlz_drop=True + for dlz_line in hdcase.dialyzers: + dlz=dlz_line.dialyzer_id + if dlz.state in ('drop','expire'): + dlz_use="%sทิ้ง"%dlz_use + dlz_drop=True cancel=False row_color='' if hdcase.state not in ('paid', 'waiting_payment'): @@ -146,7 +153,7 @@ class ReportCycleItem(Model): 'date': hdcase.date, 'epo': hdcase.epo, 'mdc': hdcase.mdc, - 'mdc_name': hdcase.mdc_name, + 'mdc_name': hdcase.mdc_name or hdcase.epo, 'fee': abs(hdcase.fee), 'dlz_name': hdcase.dlz_name, 'dlz_use': dlz_use, diff --git a/netforce_clinic/models/report_hd_case_summary.py b/netforce_clinic/models/report_hd_case_summary.py index 0bc4396..33e74a0 100644 --- a/netforce_clinic/models/report_hd_case_summary.py +++ b/netforce_clinic/models/report_hd_case_summary.py @@ -4,7 +4,7 @@ import urllib.parse as urllib from datetime import datetime from calendar import monthrange from netforce.model import Model, fields, get_model -from netforce.access import get_active_company +from netforce.access import get_active_company, get_active_user from . import utils @@ -271,7 +271,10 @@ class ReportHDCaseSummary(Model): plines=medicals['plines'] prod_titles=medicals['prod_titles'] date_print=time.strftime("%m/%d/%Y %H:%M:%S") + user_id=get_active_user() + user=get_model('base.user').browse(user_id) data={ + 'user_name': user.name, 'hdcase_type': hdcase_type, 'branch_id': branch_id, 'department_id': department_id, diff --git a/netforce_clinic/reports/report_cycle_item.xlsx b/netforce_clinic/reports/report_cycle_item.xlsx index 47be46a..827ebd2 100644 Binary files a/netforce_clinic/reports/report_cycle_item.xlsx and b/netforce_clinic/reports/report_cycle_item.xlsx differ diff --git a/netforce_clinic/reports/report_hd_case_summary.xlsx b/netforce_clinic/reports/report_hd_case_summary.xlsx index 511bf47..2882d3a 100644 Binary files a/netforce_clinic/reports/report_hd_case_summary.xlsx and b/netforce_clinic/reports/report_hd_case_summary.xlsx differ diff --git a/netforce_clinic/templates/report_cycle_item.hbs b/netforce_clinic/templates/report_cycle_item.hbs index cae8a03..3094f61 100644 --- a/netforce_clinic/templates/report_cycle_item.hbs +++ b/netforce_clinic/templates/report_cycle_item.hbs @@ -1,7 +1,7 @@
ชื่อ-สกุล | แพทย์ | สิทธ์ | -ยาฉีด | DZ | N/U | พยาบาล | - {{#each lines }} @@ -53,9 +49,6 @@{{pname}} | {{dname}} | {{tname}} | -{{mdc_name}} | {{dlz_name}} | {{dlz_use}} |
---|