reports
parent
a4683ca610
commit
f007db5ecf
|
@ -2,4 +2,5 @@
|
|||
<field name="date" span="3" mode="month" onchange="onchange_date"/>
|
||||
<field name="date_from" span="3"/>
|
||||
<field name="date_to" span="3"/>
|
||||
<field name="nurse_id" span="3"/>
|
||||
</form>
|
||||
|
|
|
@ -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,
|
||||
})
|
||||
|
|
|
@ -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)]
|
||||
|
|
|
@ -14,6 +14,12 @@ PATIENT_TYPE={
|
|||
"others": "อื่นๆ",
|
||||
}
|
||||
|
||||
PERSONAL_TYPE={
|
||||
'doctor': 'Doctor',
|
||||
'nurse': 'Nurse',
|
||||
'personal': 'Personal',
|
||||
}
|
||||
|
||||
TOPICS={
|
||||
'topic1': {'name': 'จำนวนครั้งการทำ Hemodialysis', 'unit': 'ครั้ง'},
|
||||
'topic2': {'name': 'จำนวนผู้ป่วยยกมาจากเดือน', 'unit': 'คน'},
|
||||
|
|
|
@ -15,11 +15,12 @@
|
|||
</h4>
|
||||
</center>
|
||||
{{#if lines}}
|
||||
<table class="table">
|
||||
<table class="table table-condensed table-striped">
|
||||
<thead>
|
||||
<th>วันที่</th>
|
||||
{{#unless ../personal_name}}
|
||||
<th>บุคลากร</th>
|
||||
<th>บุคลากร</th>
|
||||
<th>ประเภท</th>
|
||||
{{/unless}}
|
||||
<th style="text-align:right">จำนวนคนไข้</th>
|
||||
<th style="text-align:right">จำนวนเงิน</th>
|
||||
|
@ -30,6 +31,7 @@
|
|||
<td>{{date}}</td>
|
||||
{{#unless ../personal_name}}
|
||||
<td>{{personal_name}}</td>
|
||||
<td>{{personal_type}}</td>
|
||||
{{/unless}}
|
||||
<td style="text-align:right">{{qty}}</td>
|
||||
<td style="text-align:right">{{currency amount}}</td>
|
||||
|
@ -39,6 +41,7 @@
|
|||
<tfoot>
|
||||
{{#unless ../personal_name}}
|
||||
<th></th>
|
||||
<th></th>
|
||||
{{/unless}}
|
||||
<th>รวม</th>
|
||||
<th style="text-align:right">{{total_qty}}</th>
|
||||
|
|
|
@ -12,9 +12,9 @@
|
|||
</h4>
|
||||
</center>
|
||||
{{#if lines}}
|
||||
<table class="table">
|
||||
<table class="table table-condensed table-striped">
|
||||
<thead>
|
||||
<th style="text-align:left;">พยาบาล</th>
|
||||
<th style="text-align:left;" class="col-sm-3">พยาบาล</th>
|
||||
{{#each cols}}
|
||||
<th style="text-align:right;">{{name}}</th>
|
||||
{{/each}}
|
||||
|
@ -23,7 +23,7 @@
|
|||
<tbody>
|
||||
{{#each lines}}
|
||||
<tr>
|
||||
<td style="text-align:left;">{{nurse_name}}</td>
|
||||
<td style="text-align:left;" class="col-sm-3">{{nurse_name}}</td>
|
||||
{{#each sub_lines}}
|
||||
{{#if last}}
|
||||
<td style="text-align:right"><b>{{amt}}</b></td>
|
||||
|
|
Loading…
Reference in New Issue