diff --git a/netforce_clinic/layouts/clinic_report_nurse_fee_sum.xml b/netforce_clinic/layouts/clinic_report_nurse_fee_sum.xml
index 6d752a7..9196150 100644
--- a/netforce_clinic/layouts/clinic_report_nurse_fee_sum.xml
+++ b/netforce_clinic/layouts/clinic_report_nurse_fee_sum.xml
@@ -2,4 +2,5 @@
+
diff --git a/netforce_clinic/models/report_nurse_fee_detail.py b/netforce_clinic/models/report_nurse_fee_detail.py
index bd484d0..042df6f 100644
--- a/netforce_clinic/models/report_nurse_fee_detail.py
+++ b/netforce_clinic/models/report_nurse_fee_detail.py
@@ -75,6 +75,7 @@ class ReportNurseFeeDetail(Model):
if key not in all_vals.keys():
all_vals[key]={
'qty': 0,
+ 'personal_type': utils.PERSONAL_TYPE.get(personal.type,''),
'personal_name': personal.name or "",
'amount': 0,
}
@@ -89,9 +90,11 @@ class ReportNurseFeeDetail(Model):
qty=vals['qty'] or 0
amount=vals['amount'] or 0
_personal_name=vals['personal_name'] or ''
+ personal_type=vals['personal_type']
lines.append({
'date': date,
'qty': qty,
+ 'personal_type': personal_type,
'personal_name': _personal_name,
'amount': amount or 0.0,
})
diff --git a/netforce_clinic/models/report_nurse_fee_sum.py b/netforce_clinic/models/report_nurse_fee_sum.py
index e1ab047..9c2903c 100644
--- a/netforce_clinic/models/report_nurse_fee_sum.py
+++ b/netforce_clinic/models/report_nurse_fee_sum.py
@@ -17,6 +17,7 @@ class ReportNurseFeeSum(Model):
"date": fields.Date("Month"),
"date_from": fields.Date("From", required=True),
"date_to": fields.Date("To", required=True),
+ "nurse_id": fields.Many2One("clinic.personal","Nurse", domain=[['type','=','nurse']]),
}
def _get_date_from(self,context={}):
@@ -47,8 +48,10 @@ class ReportNurseFeeSum(Model):
year,month,day=defaults['date'].split("-")
time_start='%s-%s-01'%(year,str(month).zfill(2))
time_stop='%s-%s-%s'%(year,str(month).zfill(2),total_day)
+ nurse_id=None
if ids:
obj=self.browse(ids)[0]
+ nurse_id=obj.nurse_id.id
month=obj.date_from.split("-")[1]
time_start=obj.date_from
time_stop=obj.date_to
@@ -70,7 +73,12 @@ class ReportNurseFeeSum(Model):
lines=[]
total_all={}
total_sum=0.0
- for nurse in get_model("clinic.personal").search_browse([['type','=','nurse']]):
+ dom=[]
+ dom.append(['type','=','nurse'])
+ for nurse in get_model("clinic.personal").search_browse(dom):
+ if nurse_id:
+ if nurse_id!=nurse.id:
+ continue
line={
'nurse_id': nurse.id,
'nurse_name': nurse.name or '',
@@ -111,7 +119,7 @@ class ReportNurseFeeSum(Model):
'amt': total_all[date],
})
total_lines.append({
- 'amt': total_sum,
+ 'amt': round(total_sum,2),
})
month_str=utils.MONTHS['th_TH'][int(month)]
diff --git a/netforce_clinic/models/utils.py b/netforce_clinic/models/utils.py
index 77bb040..c0a3067 100644
--- a/netforce_clinic/models/utils.py
+++ b/netforce_clinic/models/utils.py
@@ -14,6 +14,12 @@ PATIENT_TYPE={
"others": "อื่นๆ",
}
+PERSONAL_TYPE={
+ 'doctor': 'Doctor',
+ 'nurse': 'Nurse',
+ 'personal': 'Personal',
+}
+
TOPICS={
'topic1': {'name': 'จำนวนครั้งการทำ Hemodialysis', 'unit': 'ครั้ง'},
'topic2': {'name': 'จำนวนผู้ป่วยยกมาจากเดือน', 'unit': 'คน'},
diff --git a/netforce_clinic/templates/report_nurse_fee_detail.hbs b/netforce_clinic/templates/report_nurse_fee_detail.hbs
index 0c93acc..59a5c94 100644
--- a/netforce_clinic/templates/report_nurse_fee_detail.hbs
+++ b/netforce_clinic/templates/report_nurse_fee_detail.hbs
@@ -15,11 +15,12 @@
{{#if lines}}
-
+
วันที่ |
{{#unless ../personal_name}}
- บุคลากร |
+ บุคลากร |
+ ประเภท |
{{/unless}}
จำนวนคนไข้ |
จำนวนเงิน |
@@ -30,6 +31,7 @@
{{date}} |
{{#unless ../personal_name}}
{{personal_name}} |
+ {{personal_type}} |
{{/unless}}
{{qty}} |
{{currency amount}} |
@@ -39,6 +41,7 @@
{{#unless ../personal_name}}
|
+ |
{{/unless}}
รวม |
{{total_qty}} |
diff --git a/netforce_clinic/templates/report_nurse_fee_sum.hbs b/netforce_clinic/templates/report_nurse_fee_sum.hbs
index 8ff6677..8dd07c4 100644
--- a/netforce_clinic/templates/report_nurse_fee_sum.hbs
+++ b/netforce_clinic/templates/report_nurse_fee_sum.hbs
@@ -12,9 +12,9 @@
{{#if lines}}
-
+
- พยาบาล |
+ พยาบาล |
{{#each cols}}
{{name}} |
{{/each}}
@@ -23,7 +23,7 @@
{{#each lines}}
- {{nurse_name}} |
+ {{nurse_name}} |
{{#each sub_lines}}
{{#if last}}
{{amt}} |