rename report
parent
02a953edc3
commit
9803d1799a
|
@ -1,8 +1,8 @@
|
||||||
<action>
|
<action>
|
||||||
<field name="string">Report HD Case</field>
|
<field name="string">HD Report Dialy</field>
|
||||||
<field name="view_cls">report</field>
|
<field name="view_cls">report</field>
|
||||||
<field name="model">clinic.hd.report</field>
|
<field name="model">clinic.hd.report.dialy</field>
|
||||||
<field name="report_template">report_hd_report</field>
|
<field name="report_template">report_hd_report_dialy</field>
|
||||||
<field name="report_template_xls">hd_report</field>
|
<field name="report_template_xls">hd_report_dialy</field>
|
||||||
<field name="menu">clinic_menu</field>
|
<field name="menu">clinic_menu</field>
|
||||||
</action>
|
</action>
|
||||||
|
|
|
@ -20,9 +20,7 @@
|
||||||
<item string="Visits" action="clinic_visit"/>
|
<item string="Visits" action="clinic_visit"/>
|
||||||
<item string="Treatments" action="clinic_hd_case"/>
|
<item string="Treatments" action="clinic_hd_case"/>
|
||||||
<item string="Reports">
|
<item string="Reports">
|
||||||
<header string="Dialyzers"/>
|
<header string="HD CASE"/>
|
||||||
<item string="Dialyzers Drop" action="clinic_dialyzer_report"/>
|
|
||||||
<header string="HD Case"/>
|
|
||||||
<item string="Daily" action="clinic_hd_report"/>
|
<item string="Daily" action="clinic_hd_report"/>
|
||||||
<item string="Monthly" action="clinic_hd_report_monthly"/>
|
<item string="Monthly" action="clinic_hd_report_monthly"/>
|
||||||
</item>
|
</item>
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
<form model="clinic.hd.report">
|
<form model="clinic.hd.report.dialy">
|
||||||
<group>
|
<group>
|
||||||
<field name="date" span="2"/>
|
<field name="date" span="2"/>
|
||||||
<field name="cycle_id" span="2"/>
|
<field name="cycle_id" span="2"/>
|
|
@ -13,7 +13,6 @@ from . import patient_cause_line
|
||||||
from . import patient_comorbidity_line
|
from . import patient_comorbidity_line
|
||||||
from . import patient_morbidity_line
|
from . import patient_morbidity_line
|
||||||
from . import race
|
from . import race
|
||||||
from . import report_hd
|
|
||||||
from . import report_dialyzer_drop
|
from . import report_dialyzer_drop
|
||||||
from . import schedule
|
from . import schedule
|
||||||
from . import setting
|
from . import setting
|
||||||
|
@ -31,6 +30,7 @@ from . import file_sheet
|
||||||
from . import cycle
|
from . import cycle
|
||||||
from . import gen_visit
|
from . import gen_visit
|
||||||
from . import gen_visit_line
|
from . import gen_visit_line
|
||||||
|
from . import report_hd_dialy
|
||||||
from . import report_hd_monthly
|
from . import report_hd_monthly
|
||||||
from . import payment
|
from . import payment
|
||||||
from . import payment_line
|
from . import payment_line
|
||||||
|
|
|
@ -2,9 +2,9 @@ import time
|
||||||
|
|
||||||
from netforce.model import Model, fields, get_model
|
from netforce.model import Model, fields, get_model
|
||||||
|
|
||||||
class HDReport(Model):
|
class HDReportDialy(Model):
|
||||||
_name="clinic.hd.report"
|
_name="clinic.hd.report.dialy"
|
||||||
_string="HD Report"
|
_string="HD Report Dialy"
|
||||||
_transient=True
|
_transient=True
|
||||||
|
|
||||||
_fields={
|
_fields={
|
||||||
|
@ -128,4 +128,4 @@ class HDReport(Model):
|
||||||
}
|
}
|
||||||
return data
|
return data
|
||||||
|
|
||||||
HDReport.register()
|
HDReportDialy.register()
|
|
@ -18,12 +18,13 @@ class HDReportMonth(Model):
|
||||||
}
|
}
|
||||||
|
|
||||||
def get_report_data(self,ids,context={}):
|
def get_report_data(self,ids,context={}):
|
||||||
if not ids:
|
date=datetime.now().strftime("%Y-%m-%d")
|
||||||
return {}
|
if ids:
|
||||||
obj=self.browse(ids)[0]
|
obj=self.browse(ids)[0]
|
||||||
year=int(obj.date[0:3])
|
date=obj.date
|
||||||
month=int(obj.date[5:7])
|
year=int(date[0:4])
|
||||||
month_str=datetime.strptime(obj.date,'%Y-%m-%d').strftime("%B")
|
month=int(date[5:7])
|
||||||
|
month_str=datetime.strptime(date,'%Y-%m-%d').strftime("%B")
|
||||||
weekday, total_day=monthrange(year, month)
|
weekday, total_day=monthrange(year, month)
|
||||||
time_start='2014-%s-01 00:00:00'%(month)
|
time_start='2014-%s-01 00:00:00'%(month)
|
||||||
time_stop='2014-%s-%s 23:59:59'%(month,total_day)
|
time_stop='2014-%s-%s 23:59:59'%(month,total_day)
|
||||||
|
@ -33,7 +34,6 @@ class HDReportMonth(Model):
|
||||||
dom.append(['time_start','>=',time_start])
|
dom.append(['time_start','>=',time_start])
|
||||||
dom.append(['time_stop','<=',time_stop])
|
dom.append(['time_stop','<=',time_stop])
|
||||||
hd_cases=get_model("clinic.hd.case").search_browse(dom)
|
hd_cases=get_model("clinic.hd.case").search_browse(dom)
|
||||||
print("="*50)
|
|
||||||
for hd_case in hd_cases:
|
for hd_case in hd_cases:
|
||||||
lines.append({
|
lines.append({
|
||||||
'topic': 'The number of times the Hemodialysis',
|
'topic': 'The number of times the Hemodialysis',
|
||||||
|
@ -42,6 +42,8 @@ class HDReportMonth(Model):
|
||||||
})
|
})
|
||||||
|
|
||||||
data={
|
data={
|
||||||
|
'month': month_str,
|
||||||
|
'year': year,
|
||||||
'lines': lines,
|
'lines': lines,
|
||||||
}
|
}
|
||||||
return data
|
return data
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
</h2>
|
</h2>
|
||||||
<h3>
|
<h3>
|
||||||
[Ratchawat : Saamsan4]<br/>
|
[Ratchawat : Saamsan4]<br/>
|
||||||
As at October 2014
|
As at {{month}} {{year}}
|
||||||
</h3>
|
</h3>
|
||||||
</center>
|
</center>
|
||||||
<table class="table table-striped">
|
<table class="table table-striped">
|
||||||
|
@ -18,8 +18,7 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td>{{topic}}</td>
|
<td>{{topic}}</td>
|
||||||
<td>{{month}}</td>
|
<td>{{month}}</td>
|
||||||
<!--<td><a href="ui#name=clinic_hd_case&active_id={{contact_id}}&mode=form">{{amount}}</a></td>-->
|
<td><a style="text-decoration: underline" href="ui#name=clinic_hd_case&tab_no=3">{{amount}}</a></td>
|
||||||
<td><a href="ui#name=clinic_hd_case&tab_no=3">{{amount}}</a></td>
|
|
||||||
</tr>
|
</tr>
|
||||||
{{/each}}
|
{{/each}}
|
||||||
</tbody>
|
</tbody>
|
||||||
|
|
Loading…
Reference in New Issue