diff --git a/netforce_clinic/actions/clinic_import_payment.xml b/netforce_clinic/actions/clinic_import_payment.xml
index 22cf382..d9ef1c8 100644
--- a/netforce_clinic/actions/clinic_import_payment.xml
+++ b/netforce_clinic/actions/clinic_import_payment.xml
@@ -2,5 +2,5 @@
Import Payments From Government
multi_view
clinic.import.payment
- clinic_menu
+ account_menu
diff --git a/netforce_clinic/layouts/clinic_import_payment_form.xml b/netforce_clinic/layouts/clinic_import_payment_form.xml
index 74ebac4..24703d9 100644
--- a/netforce_clinic/layouts/clinic_import_payment_form.xml
+++ b/netforce_clinic/layouts/clinic_import_payment_form.xml
@@ -7,6 +7,7 @@
+
diff --git a/netforce_clinic/models/report_hd_monthly.py b/netforce_clinic/models/report_hd_monthly.py
index 5989303..50387f0 100644
--- a/netforce_clinic/models/report_hd_monthly.py
+++ b/netforce_clinic/models/report_hd_monthly.py
@@ -1,6 +1,8 @@
import time
+from datetime import datetime
+from calendar import monthrange
-from netforce.model import Model, fields
+from netforce.model import Model, fields, get_model
class HDReportMonth(Model):
_name="clinic.hd.report.monthly"
@@ -8,7 +10,7 @@ class HDReportMonth(Model):
_transient=True
_fields={
- "date": fields.Date("Month"),
+ "date": fields.Date("Month", required=True),
}
_defaults={
@@ -16,7 +18,33 @@ class HDReportMonth(Model):
}
def get_report_data(self,ids,context={}):
- data={}
+ 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")
+ 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)
+ lines=[]
+ dom=[]
+ dom.append(['state','=','completed'])
+ 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',
+ 'month': month_str,
+ 'amount': len(hd_cases),
+ })
+
+ data={
+ 'lines': lines,
+ }
return data
+
HDReportMonth.register()
diff --git a/netforce_clinic/templates/report_hd_monthly.hbs b/netforce_clinic/templates/report_hd_monthly.hbs
index f72cf03..c8278c7 100644
--- a/netforce_clinic/templates/report_hd_monthly.hbs
+++ b/netforce_clinic/templates/report_hd_monthly.hbs
@@ -9,87 +9,17 @@
-
-
- The number of times the Hemodialysis
-
-
- Current month
-
-
- xxxx times
-
-
-
-
- Many patients come from
-
-
- Previous month
-
-
- xxxx person
-
-
-
-
- Number of new patients
-
-
- Current month
-
-
- xxxx person
-
-
-
-
- Number of patients discharged
-
-
- Current month
-
-
- xxxx person
-
-
-
-
- Number of patients to raise
-
-
- Current month
-
-
- xxxx person
-
-
-
-
- Number of patients withdrawn SSO
-
-
-
-
- xxxx person
-
-
-
-
- Many patients pay themselves
-
-
-
-
- xxxx person
-
-
+ {{#each lines}}
+
+ {{topic}}
+ {{month}}
+ {{amount}}
+
+ {{/each}}
-
-
-
-
diff --git a/netforce_clinic/templates/report_hd_monthly.hbs~ b/netforce_clinic/templates/report_hd_monthly.hbs.old
similarity index 100%
rename from netforce_clinic/templates/report_hd_monthly.hbs~
rename to netforce_clinic/templates/report_hd_monthly.hbs.old