diff --git a/netforce_clinic/layouts/clinic_labor_cost_form.xml b/netforce_clinic/layouts/clinic_labor_cost_form.xml
index 19bebbc..32a33ac 100644
--- a/netforce_clinic/layouts/clinic_labor_cost_form.xml
+++ b/netforce_clinic/layouts/clinic_labor_cost_form.xml
@@ -79,6 +79,7 @@
+
diff --git a/netforce_clinic/layouts/clinic_labor_cost_list.xml b/netforce_clinic/layouts/clinic_labor_cost_list.xml
index cb1fa6b..1f43dfa 100644
--- a/netforce_clinic/layouts/clinic_labor_cost_list.xml
+++ b/netforce_clinic/layouts/clinic_labor_cost_list.xml
@@ -2,6 +2,6 @@
-
+
diff --git a/netforce_clinic/models/labor_cost_entry_line.py b/netforce_clinic/models/labor_cost_entry_line.py
index 62f0165..ee52e88 100644
--- a/netforce_clinic/models/labor_cost_entry_line.py
+++ b/netforce_clinic/models/labor_cost_entry_line.py
@@ -13,7 +13,7 @@ class LaborCostEntryLine(Model):
'entry_id': fields.Many2One("clinic.labor.cost.entry","Entry",required=True),
'staff_id': fields.Many2One("clinic.staff","Staff",required=True),
'date': fields.Date("Date"),
- 'qty': fields.Integer("No.HD"),
+ 'qty': fields.Integer("#HDCase"),
'rate': fields.Float("Rate Avg."),
'amount': fields.Float("Amount"),
'company_id': fields.Many2One("company","Company"),
diff --git a/netforce_clinic/models/labor_cost_line.py b/netforce_clinic/models/labor_cost_line.py
index 636bfbb..caea815 100644
--- a/netforce_clinic/models/labor_cost_line.py
+++ b/netforce_clinic/models/labor_cost_line.py
@@ -12,7 +12,7 @@ class LaborCostLine(Model):
'staff_id': fields.Many2One("clinic.staff", "Staff",search=True),
'level_id': fields.Many2One("clinic.staff.level", "Level",search=True),
'cycle_id': fields.Many2One("clinic.cycle", "Cycle",search=True),
- 'qty': fields.Integer("Qty"),
+ 'qty': fields.Integer("#HDCase"),
'rate': fields.Float("Rate",scale=2),
'amount': fields.Float("Amount",scale=2),
'date': fields.Date("Date",search=True),
diff --git a/netforce_clinic/models/report_staff_fee_detail.py b/netforce_clinic/models/report_staff_fee_detail.py
index 4bfd536..63eeb13 100644
--- a/netforce_clinic/models/report_staff_fee_detail.py
+++ b/netforce_clinic/models/report_staff_fee_detail.py
@@ -84,29 +84,29 @@ class ReportStaffFeeDetail(Model):
cycle=item.cycle_id
branch=item.branch_id
dpt=item.department_id
- for dt in lc.doctor_lines:
- staff=dt.staff_id
- lines.append({
+ items=[]
+ for dline in lc.doctor_lines:
+ staff=dline.staff_id
+ amount=dline.amount or 0
+ rate=dline.rate or 0
+ items.append({
'staff_id': staff.id,
- 'staff_name': staff.name or '',
- 'staff_type': staff.type or '',
- 'date': date,
- 'cycle_id': cycle.id,
- 'branch_id': branch.id,
- 'department_id': dpt.id,
+ 'type': 'doctor',
+ 'rate': rate,
+ 'amount': amount,
})
- for nr in lc.nurse_lines:
- staff=dt.staff_id
- lines.append({
+ for nline in lc.nurse_lines:
+ staff=nline.staff_id
+ rate=dline.rate or 0
+ items.append({
'staff_id': staff.id,
- 'staff_name': staff.name or '',
- 'staff_type': staff.type or '',
- 'date': date,
- 'cycle_id': cycle.id,
- 'branch_id': branch.id,
- 'department_id': dpt.id,
+ 'type': 'nurse',
+ 'rate': rate,
+ 'amount': amount,
})
-
+ for item in items:
+ print(item)
+
month_str=utils.MONTHS['th_TH'][int(month)]
start=int(time_start[8:10])
stop=int(time_stop[8:10])
diff --git a/netforce_clinic/models/report_staff_fee_sum.py b/netforce_clinic/models/report_staff_fee_sum.py
index bb91dbd..af1824b 100644
--- a/netforce_clinic/models/report_staff_fee_sum.py
+++ b/netforce_clinic/models/report_staff_fee_sum.py
@@ -54,8 +54,8 @@ class ReportStaffFeeSum(Model):
time_stop='%s-%s-%s'%(year,str(month).zfill(2),total_day)
staff_id=None
staff_type="nurse"
- department_id=None
- branch_id=None
+ department=None
+ branch=None
if ids:
obj=self.browse(ids)[0]
staff_type=obj.type
@@ -63,8 +63,8 @@ class ReportStaffFeeSum(Model):
month=obj.date_from.split("-")[1]
time_start=obj.date_from
time_stop=obj.date_to
- department_id=obj.department_id.id
- branch_id=obj.branch_id.id
+ department=obj.department_id
+ branch=obj.branch_id
# generate list of date
fmt='%Y-%m-%d'
@@ -85,10 +85,10 @@ class ReportStaffFeeSum(Model):
total_sum=0.0
dom=[]
dom.append(['type','=',staff_type])
- if department_id:
- dom.append(['department_id','=',department_id])
- if branch_id:
- dom.append(['branch_id','=',branch_id])
+ if department:
+ dom.append(['department_id','=',department.id])
+ if branch:
+ dom.append(['branch_id','=',branch.id])
for staff in get_model("clinic.staff").search_browse(dom):
if staff_id:
if staff_id!=staff.id:
@@ -149,10 +149,16 @@ class ReportStaffFeeSum(Model):
'is_duration': diff+1 < total_day,
'year': year,
}
- if obj.branch_id:
- data['branch_name']='(%s)'%obj.branch_id.name or ''
- if obj.department_id:
- data['branch_name']='(%s)'%obj.department_id.name or ''
+ data['title']='สรุปค่าธรรมเนียมพยาบาล'
+ if staff_type=='doctor':
+ data['title']='สรุปค่าธรรมเนียมแพทย์'
+ elif staff_type=='staff':
+ data['title']='สรุปค่าธรรมเนียมเจ้าหน้าที่'
+
+ if branch:
+ data['branch_name']='(%s)'%branch.name or ''
+ if department:
+ data['branch_name']='(%s)'%department.name or ''
return data
def onchange_date(self,context={}):
diff --git a/netforce_clinic/templates/report_staff_fee_sum.hbs b/netforce_clinic/templates/report_staff_fee_sum.hbs
index c8e686a..78ee6b2 100644
--- a/netforce_clinic/templates/report_staff_fee_sum.hbs
+++ b/netforce_clinic/templates/report_staff_fee_sum.hbs
@@ -1,5 +1,5 @@
- สรุปค่าธรรมเนียมพยาบาล
+ {{title}}
{{parent_company_name}} {{company_name}} {{branch_name}}