show detail

conv_bal
watcha.h@almacom.co.th 2015-04-06 16:40:28 +07:00
parent d355abcda4
commit 8fc70bf7ea
3 changed files with 32 additions and 17 deletions

View File

@ -4,4 +4,5 @@
<field name="date_to" required="1" span="2"/>
<field name="branch_id" onchange="onchange_branch" span="2"/>
<field name="department_id" domain='[["branch_id","=",branch_id]]' span="2"/>
<field name="show_detail"/>
</form>

View File

@ -15,6 +15,7 @@ class ReportLaborCost(Model):
"date_to": fields.Date("To", required=True),
"branch_id": fields.Many2One("clinic.branch","Branch"),
"department_id": fields.Many2One("clinic.department","Department"),
'show_detail': fields.Boolean("Show Detail"),
}
def _get_date_from(self,context={}):
@ -35,6 +36,7 @@ class ReportLaborCost(Model):
'date': time.strftime("%Y-%m-%d"),
'date_from': date_from,
'date_to': date_to,
'show_detail': False,
}
return res
@ -46,6 +48,7 @@ class ReportLaborCost(Model):
date_to=defaults['date_to']
branch_id=defaults.get("branch_id")
department_id=defaults.get("department_id")
show_detail=defaults['show_detail']
dom=[]
if ids:
obj=self.browse(ids)[0]
@ -53,6 +56,7 @@ class ReportLaborCost(Model):
date_to=obj.date_to
branch_id=obj.branch_id.id
department_id=obj.department_id.id
show_detail=obj.show_detail
dom.append(['date','>=',date_from])
dom.append(['date','<=',date_to])
if branch_id:
@ -124,6 +128,7 @@ class ReportLaborCost(Model):
'total_hdcase': total_hdcase,
'branch_id': branch_id,
'department_id': department_id,
'show_detail': show_detail,
}
return data

View File

@ -13,6 +13,7 @@
</thead>
<tbody>
{{#each lines }}
{{#if ../show_detail}}
<tr>
<th>
{{name}}
@ -35,6 +36,14 @@
<a href="#name=clinic_report_labor_cost_summary&defaults.date={{../date}}&defaults.date_from={{../date_from}}&defaults.date_to={{../date_to}}&defaults.branch_id={{branch_id}}&defaults.department_id={{department_id}}">{{currency qty}}</a>
</th>
</tr>
{{else}}
<tr>
<td>{{name}}</td>
<td style="text-align:right">
{{view "link" string=qty action="clinic_hd_case" action_options=action_options}}
</td>
</tr>
{{/if}}
{{/each}}
</tbody>
<tfoot>