rename report

conv_bal
watcha.h 2014-10-15 22:55:38 +07:00
parent 9803d1799a
commit eb83fcfc51
8 changed files with 48 additions and 40 deletions

View File

@ -1,8 +1,8 @@
<action>
<field name="string">HD Report Dialy</field>
<field name="string">Report HD Dialy</field>
<field name="view_cls">report</field>
<field name="model">clinic.hd.report.dialy</field>
<field name="report_template">report_hd_report_dialy</field>
<field name="report_template_xls">hd_report_dialy</field>
<field name="model">clinic.report.hd.dialy</field>
<field name="report_template">report_hd_dialy</field>
<field name="report_template_xls">report_hd_dialy</field>
<field name="menu">clinic_menu</field>
</action>

View File

@ -1,8 +1,8 @@
<action>
<field name="string">Summary of the Hemodialysis</field>
<field name="string">Report HD Monthly</field>
<field name="view_cls">report</field>
<field name="model">clinic.hd.report.monthly</field>
<field name="model">clinic.report.hd.monthly</field>
<field name="report_template">report_hd_monthly</field>
<field name="report_template_xls">hd_report_monthly</field>
<field name="report_template_xls">report_hd_monthly</field>
<field name="menu">clinic_menu</field>
</action>

View File

@ -21,8 +21,8 @@
<item string="Treatments" action="clinic_hd_case"/>
<item string="Reports">
<header string="HD CASE"/>
<item string="Daily" action="clinic_hd_report"/>
<item string="Monthly" action="clinic_hd_report_monthly"/>
<item string="Daily" action="clinic_report_hd_dialy"/>
<item string="Monthly" action="clinic_report_hd_monthly"/>
</item>
<item string="Settings">
<item string="Departments" action="clinic_department"/>

View File

@ -1,6 +1,7 @@
<form model="clinic.hd.report.dialy">
<form model="clinic.report.hd.dialy">
<group>
<field name="date" span="2"/>
<field name="date_from" span="2"/>
<field name="date_to" span="2"/>
<field name="cycle_id" span="2"/>
<field name="patient_id" span="2"/>
<field name="nurse_id" span="2"/>

View File

@ -1,3 +1,3 @@
<form model="clinic.hd.report.monthly">
<form model="clinic.report.hd.monthly">
<field name="date" mode="month" span="2"/>
</form>

View File

@ -2,25 +2,23 @@ import time
from netforce.model import Model, fields, get_model
class HDReportDialy(Model):
_name="clinic.hd.report.dialy"
_string="HD Report Dialy"
class ReportHDDialy(Model):
_name="clinic.report.hd.dialy"
_string="Report HD Dialy"
_transient=True
_fields={
"date": fields.Date("Start-Date"),
"patient_id" : fields.Many2One("clinic.patient","Patient"),
"doctor_id" : fields.Many2One("clinic.doctor","Doctor"),
"nurse_id" : fields.Many2One("clinic.nurse","Nurse"),
#"time_start": fields.DateTime("Time start",required=False,search=True),
#"time_stop": fields.DateTime("Time stop",required=False,search=True),
"date_from": fields.Date("From"),
"date_to": fields.Date("To"),
"cycle_id": fields.Many2One("clinic.cycle","Cycle"),
}
_defaults={
'date': lambda *a: time.strftime("%Y-%m-%d"),
#'time_start': lambda *a: time.strftime("%Y-%m-%d"),
#'time_stop': lambda *a: time.strftime("%Y-%m-%d"),
'date_from': lambda *a: time.strftime("%Y-%m-%d"),
'date_to': lambda *a: time.strftime("%Y-%m-%d"),
}
_order="cycle_id desc"
@ -34,15 +32,18 @@ class HDReportDialy(Model):
"personal": "Personal",
"others": "Others",
}
#time_start=time.strftime("%Y-%m-%d")
#time_stop=time.strftime("%Y-%m-%d")
date=time.strftime("%Y-%m-%d")
date_from=time.strftime("%Y-%m-%d")
date_to=time.strftime("%Y-%m-%d")
dom=[]
dom.append(['state','=','completed'])
if ids:
obj=self.browse(ids)[0]
if obj.date:
date=obj.date
if obj.date_from:
date_from=obj.date_from
if obj.date_to:
date_to=obj.date_to
if obj.cycle_id:
dom.append([
'cycle_id','=',obj.cycle_id.id,
@ -55,8 +56,8 @@ class HDReportDialy(Model):
dom.append([
'doctor_id','=',obj.doctor_id.id,
])
dom.append(['time_start', ">=", date+" 00:00:00"])
dom.append(['time_stop',"<=", date+" 23:59:59"])
dom.append(['time_start', ">=", date_from+" 00:00:00"])
dom.append(['time_stop',"<=", date_to+" 23:59:59"])
lines=[]
cycles=[]
@ -72,7 +73,6 @@ class HDReportDialy(Model):
if not cycle_name in cycles:
cycles.append(cycle_name)
show_cycle=True
print("OK")
vals={
'color': 'success',
'show_cycle': False,
@ -125,7 +125,10 @@ class HDReportDialy(Model):
del lines[0]
data={
'lines': lines,
'same_date': date_from==date_to,
'date_from': date_from,
'date_to': date_to,
}
return data
HDReportDialy.register()
ReportHDDialy.register()

View File

@ -4,9 +4,9 @@ from calendar import monthrange
from netforce.model import Model, fields, get_model
class HDReportMonth(Model):
_name="clinic.hd.report.monthly"
_string="Summary of the Hemodialysis"
class ReportHDMonthly(Model):
_name="clinic.report.hd.monthly"
_string="Report HD Monthly"
_transient=True
_fields={
@ -49,4 +49,4 @@ class HDReportMonth(Model):
return data
HDReportMonth.register()
ReportHDMonthly.register()

View File

@ -1,9 +1,13 @@
<center>
<h2>HD Case Report </h2>
<h3>
Clinic [Ratchawat]<br/>
As at {{fmt_date date}}
</h3>
<h2>Summary of the Hemodialysis</h2>
<h3>Clinic [Ratchawat]</h3>
<h4>
{{#if same_date}}
As at {{fmt_date date_from}}
{{else}}
From {{fmt_date date_from}} to {{fmt_date date_to}}
{{/if}}
</h4>
</center>
<table class="table table-striped">
<thead class="scroll-header">
@ -45,7 +49,7 @@
{{/if}}
<tr class="{{color}}">
{{#if no_patient}}
<td>Total</td>
<td><b>TOTAL</b></td>
<td>{{no_patient}}</td>
{{else}}
<td></td>