diff --git a/netforce_clinic/actions/clinic_hd_report.xml b/netforce_clinic/actions/clinic_hd_report.xml index 80a78f2..1983996 100644 --- a/netforce_clinic/actions/clinic_hd_report.xml +++ b/netforce_clinic/actions/clinic_hd_report.xml @@ -1,8 +1,8 @@ - Report HD Case + HD Report Dialy report - clinic.hd.report - report_hd_report - hd_report + clinic.hd.report.dialy + report_hd_report_dialy + hd_report_dialy clinic_menu diff --git a/netforce_clinic/layouts/clinic_menu.xml b/netforce_clinic/layouts/clinic_menu.xml index 774260a..8979fd2 100644 --- a/netforce_clinic/layouts/clinic_menu.xml +++ b/netforce_clinic/layouts/clinic_menu.xml @@ -20,9 +20,7 @@ -
- -
+
diff --git a/netforce_clinic/layouts/clinic_hd_report.xml b/netforce_clinic/layouts/clinic_report_hd_dialy.xml similarity index 86% rename from netforce_clinic/layouts/clinic_hd_report.xml rename to netforce_clinic/layouts/clinic_report_hd_dialy.xml index 39eabc5..f19a9e3 100644 --- a/netforce_clinic/layouts/clinic_hd_report.xml +++ b/netforce_clinic/layouts/clinic_report_hd_dialy.xml @@ -1,4 +1,4 @@ -
+ diff --git a/netforce_clinic/layouts/clinic_hd_report_monthly.xml b/netforce_clinic/layouts/clinic_report_hd_monthly.xml similarity index 100% rename from netforce_clinic/layouts/clinic_hd_report_monthly.xml rename to netforce_clinic/layouts/clinic_report_hd_monthly.xml diff --git a/netforce_clinic/models/__init__.py b/netforce_clinic/models/__init__.py index b7fe733..a58cdde 100644 --- a/netforce_clinic/models/__init__.py +++ b/netforce_clinic/models/__init__.py @@ -13,7 +13,6 @@ from . import patient_cause_line from . import patient_comorbidity_line from . import patient_morbidity_line from . import race -from . import report_hd from . import report_dialyzer_drop from . import schedule from . import setting @@ -31,6 +30,7 @@ from . import file_sheet from . import cycle from . import gen_visit from . import gen_visit_line +from . import report_hd_dialy from . import report_hd_monthly from . import payment from . import payment_line diff --git a/netforce_clinic/models/report_hd.py b/netforce_clinic/models/report_hd_dialy.py similarity index 97% rename from netforce_clinic/models/report_hd.py rename to netforce_clinic/models/report_hd_dialy.py index b2ec68d..41fae4c 100644 --- a/netforce_clinic/models/report_hd.py +++ b/netforce_clinic/models/report_hd_dialy.py @@ -2,9 +2,9 @@ import time from netforce.model import Model, fields, get_model -class HDReport(Model): - _name="clinic.hd.report" - _string="HD Report" +class HDReportDialy(Model): + _name="clinic.hd.report.dialy" + _string="HD Report Dialy" _transient=True _fields={ @@ -128,4 +128,4 @@ class HDReport(Model): } return data -HDReport.register() +HDReportDialy.register() diff --git a/netforce_clinic/models/report_hd_monthly.py b/netforce_clinic/models/report_hd_monthly.py index 50387f0..00553cf 100644 --- a/netforce_clinic/models/report_hd_monthly.py +++ b/netforce_clinic/models/report_hd_monthly.py @@ -18,12 +18,13 @@ class HDReportMonth(Model): } def get_report_data(self,ids,context={}): - if not ids: - return {} - obj=self.browse(ids)[0] - year=int(obj.date[0:3]) - month=int(obj.date[5:7]) - month_str=datetime.strptime(obj.date,'%Y-%m-%d').strftime("%B") + date=datetime.now().strftime("%Y-%m-%d") + if ids: + obj=self.browse(ids)[0] + date=obj.date + year=int(date[0:4]) + month=int(date[5:7]) + month_str=datetime.strptime(date,'%Y-%m-%d').strftime("%B") 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) @@ -33,7 +34,6 @@ class HDReportMonth(Model): dom.append(['time_start','>=',time_start]) dom.append(['time_stop','<=',time_stop]) hd_cases=get_model("clinic.hd.case").search_browse(dom) - print("="*50) for hd_case in hd_cases: lines.append({ 'topic': 'The number of times the Hemodialysis', @@ -42,6 +42,8 @@ class HDReportMonth(Model): }) data={ + 'month': month_str, + 'year': year, 'lines': lines, } return data diff --git a/netforce_clinic/reports/hd_report.xlsx b/netforce_clinic/reports/hd_report_dialy.xlsx similarity index 100% rename from netforce_clinic/reports/hd_report.xlsx rename to netforce_clinic/reports/hd_report_dialy.xlsx diff --git a/netforce_clinic/templates/report_hd_monthly.hbs b/netforce_clinic/templates/report_hd_monthly.hbs index f6e0f40..078950f 100644 --- a/netforce_clinic/templates/report_hd_monthly.hbs +++ b/netforce_clinic/templates/report_hd_monthly.hbs @@ -4,7 +4,7 @@

[Ratchawat : Saamsan4]
- As at October 2014 + As at {{month}} {{year}}

@@ -18,8 +18,7 @@ - - + {{/each}} diff --git a/netforce_clinic/templates/report_hd_report.hbs b/netforce_clinic/templates/report_hd_report_dialy.hbs similarity index 100% rename from netforce_clinic/templates/report_hd_report.hbs rename to netforce_clinic/templates/report_hd_report_dialy.hbs
{{topic}} {{month}}{{amount}}{{amount}}