SPP 2017-11-23 16:58:06 +07:00
parent 75a194178c
commit d86a7c89eb
10 changed files with 172 additions and 46 deletions

View File

@ -1,5 +1,5 @@
<action>
<field name="string">Report Account HD Case Detail</field>
<field name="string">Account HD Case Detail</field>
<field name="view_cls">report</field>
<field name="model">clinic.report.account.hd.case.detail</field>
<field name="report_template">report_account_hd_case_detail</field>

View File

@ -1,5 +1,5 @@
<action>
<field name="string">Report Account HD Case Summary</field>
<field name="string">Account HD Case Summary</field>
<field name="view_cls">report</field>
<field name="model">clinic.report.account.hd.case.summary</field>
<field name="report_template">report_account_hd_case_summary</field>

View File

@ -1,14 +1,19 @@
<inherit inherit="account_menu">
<item string="Settings" position="before">
<item string="Ratchawat">
<header string="Accountant"/>
<divider/>
<item string="Account Product" action="clinic_setting_account_product"/>
<item string="Account Patient" action="clinic_setting_account_patient"/>
<item string="HD Case Expense" action="clinic_report_account_hd_case_summary"/>
<item string="HD Case Expense(2)" action="clinic_report_account_hd_case_detail"/>
<!--<item string="HD Case Expense" action="clinic_report_account_hd_case_summary"/>-->
<!--<item string="HD Case Expense(2)" action="clinic_report_account_hd_case_detail"/>-->
<item string="Account HDCase Summary" action="clinic_report_account_hd_case_summary"/>
<item string="Account HDCase Detail" action="clinic_report_account_hd_case_detail"/>
<item string="RD Shop Expense" action="clinic_report_account_shop"/>
<item string="Payment Matching" action="clinic_matching_payment"/>
<item string="Payment Invoices" action="clinic_invoice_payment"/>
<divider/>
<header string="Doctor/Nurse Cost"/>
<item string="Recompute Cost" action="clinic_compute_labor_cost"/>
<item string="Print Labor Cost" action="clinic_print_labor_cost"/>
<item string="Labor Costs" action="clinic_report_labor_cost"/>
@ -17,7 +22,7 @@
<item string="Labor Cost Sub Detail" action="clinic_report_labor_cost_sub_detail"/>
<item string="Labor Cost Daily" action="clinic_report_labor_cost_daily"/>
<item string="Labor Cost Overtime" action="clinic_report_labor_cost_overtime"/>
<item string="Wizard Labor Cost" action="clinic_report_wizard_labor_cost"/>
<!--<item string="Wizard Labor Cost" action="clinic_report_wizard_labor_cost"/>-->
</item>
<item string="Matching">
<item string="Payment Matching" action="clinic_payment_matching"/>

View File

@ -11,6 +11,6 @@
<field name="reimbursable" span="2"/>
<field name="pay_type" attrs='{"invisible":[["reimbursable","=","yes"]]}' span="2"/>
<foot>
<button string="Create Journal Entry" type="default" icon="arrow-right"/>
<!--<button string="Create Journal Entry" type="default" icon="arrow-right"/>-->
</foot>
</form>

View File

@ -259,6 +259,15 @@ class ReportAccountHDCaseDetail(Model):
'qty': 0,
'color': line['ptype_color'] or "default",
}
######XXX revise for accountant: convert to int
line['fee']=int(line.get('fee',0))
line['srv']=int(line.get('srv',0))
line['epo']=int(line.get('epo',0))
line['mdc']=int(line.get('mdc',0))
line['lab']=int(line.get('lab',0))
line['misc']=int(line.get('misc',0))
######
ptypes[ptype]['qty']+=1
total_fee+=line.get('fee',0)
total_srv+=line.get('srv',0)

View File

@ -259,6 +259,16 @@ class ReportAccountHDCaseSummary(Model):
'qty': 0,
'color': line['ptype_color'] or "default",
}
######XXX revise for accountant: convert to int
line['fee']=int(line.get('fee',0))
line['srv']=int(line.get('srv',0))
line['epo']=int(line.get('epo',0))
line['mdc']=int(line.get('mdc',0))
line['lab']=int(line.get('lab',0))
line['misc']=int(line.get('misc',0))
######
ptypes[ptype]['qty']+=1
total_fee+=line.get('fee',0)
total_srv+=line.get('srv',0)
@ -314,6 +324,7 @@ class ReportAccountHDCaseSummary(Model):
'is_reim': reimbursable=='yes' and True or False,
'ptype_id': ptype_id,
}
if not reimbursable:
data['title']=''
elif reimbursable=='yes':
@ -329,13 +340,16 @@ class ReportAccountHDCaseSummary(Model):
hdcase=get_model("clinic.hd.case").browse(hdcase_id)
for line2 in hdcase.lines:
prod=line2.product_id
if not prod:
print("missing product hdcase.line.id: ", line2.id)
continue
categ=line2.product_categ_id
if categ.code=='EPO':
categs.setdefault(prod.description, 0)
categs[prod.description]+=line2.qty or 0
data['categ_lines']=[]
for categ, qty in categs.items():
for categ in sorted(categs.keys()):
qty=categs[categ]
data['categ_lines'].append({
'name': categ,
'qty': qty,

View File

@ -1,3 +1,24 @@
<style>
#myBtn {
display: none;
position: fixed;
bottom: 20px;
right: 30px;
z-index: 99;
border: none;
outline: none;
background-color: red;
color: white;
cursor: pointer;
padding: 15px;
border-radius: 10px;
}
#myBtn:hover {
background-color: #555;
}
</style>
<center>
<h2>
{{title}}
@ -13,9 +34,9 @@
<thead class="scroll-header">
<tr>
{{#ifeq reimbursable "no"}}
<th colspan="16" style="text-align:center">
{{else}}
<th colspan="14" style="text-align:center">
{{else}}
<th colspan="12" style="text-align:center">
{{/ifeq}}
{{#if ptype_id}}
<span >Total: {{total_qty}}</span>
@ -42,7 +63,9 @@
<th style="text-align:right">Misc.</th>
<th style="text-align:right">Dlz</th>
<th>Ref.Inv#</th>
<!--
<th>Picking#</th>
-->
{{else}}
<th>Cycle#</th>
<th>HD Case#</th>
@ -53,7 +76,9 @@
<th style="text-align:right">ค่ายา</th>
<th style="text-align:right">ค่าบริการฉีดยา</th>
<th>Inv#</th>
<!--
<th>Picking#</th>
-->
{{/ifeq}}
</tr>
</thead>
@ -78,21 +103,23 @@
{{/if}}
</td>
<td>{{epo_name}}</td>
<td style="text-align:right">{{currency fee zero=""}}</td>
<td style="text-align:right">{{currency mdc zero=""}}</td>
<td style="text-align:right">{{currency lab zero=""}}</td>
<td style="text-align:right">{{currency misc zero=""}}</td>
<td style="text-align:right">{{currency dlz_price zero=""}}</td>
<td style="text-align:right">{{fee}}</td>
<td style="text-align:right">{{mdc}}</td>
<td style="text-align:right">{{lab}}</td>
<td style="text-align:right">{{misc}}</td>
<td style="text-align:right">{{dlz_price}}</td>
<td>
{{#if inv_id}}
{{view "link" string=inv_ref action="cust_invoice" action_options="form_view_xml&cust_invoice_form&mode=form" active_id=inv_id}}
{{/if}}
</td>
<!--
<td>
{{#if pick_id}}
{{view "link" string=pick_ref action="pick_out" action_options="mode=form" active_id=pick_id}}
{{/if}}
</td>
-->
{{else}}
<td style="width:6%">{{cycle}}</td>
<td style="width:15%">
@ -101,9 +128,9 @@
<td style="width:20%">{{pname}}</td>
<td>{{ptype}}</td>
<td>{{epo_name}}</td>
<td style="text-align:right">{{currency fee zero=""}}</td>
<td style="text-align:right">{{currency mdc zero=""}}</td>
<td style="text-align:right">{{currency srv zero=""}}</td>
<td style="text-align:right">{{fee}}</td>
<td style="text-align:right">{{mdc}}</td>
<td style="text-align:right">{{srv}}</td>
{{#if inv_id}}
<td>
{{view "link" string=inv_number action="cust_invoice" action_options="form_view_xml&cust_invoice_form&mode=form" active_id=inv_id}}
@ -112,6 +139,7 @@
<td>
</td>
{{/if}}
<!--
<td>
{{#if pick_id}}
{{view "link" string=pick_ref action="pick_out" action_options="mode=form" active_id=pick_id}}
@ -119,6 +147,7 @@
-
{{/if}}
</td>
-->
{{/ifeq}}
</tr>
{{/each}}
@ -132,24 +161,42 @@
<th></th>
<th></th>
<th></th>
<th style="text-align:right">{{currency total_fee zero=""}}</th>
<th style="text-align:right">{{currency total_mdc zero=""}}</th>
<th style="text-align:right">{{currency total_lab zero=""}}</th>
<th style="text-align:right">{{currency total_misc zero=""}}</th>
<th style="text-align:right">{{currency total_dlz zero=""}}</th>
<th></th>
<th style="text-align:right">{{total_fee}}</th>
<th style="text-align:right">{{total_mdc}}</th>
<th style="text-align:right">{{total_lab}}</th>
<th style="text-align:right">{{total_misc}}</th>
<th style="text-align:right">{{total_dlz}}</th>
{{else}}
<th></th>
<th></th>
<th></th>
<th></th>
<th></th>
<th style="text-align:right">{{currency total_fee zero=""}}</th>
<th style="text-align:right">{{currency total_mdc zero=""}}</th>
<th style="text-align:right">{{currency total_srv zero=""}}</th>
<th></th>
<th style="text-align:right">{{total_fee}}</th>
<th style="text-align:right">{{total_mdc}}</th>
<th style="text-align:right">{{total_srv}}</th>
<th></th>
{{/ifeq}}
</tfoot>
</table>
<button onclick="topFunction()" id="myBtn" title="Go to top">Top</button>
<script>
// When the user scrolls down 20px from the top of the document, show the button
window.onscroll = function() {scrollFunction()};
function scrollFunction() {
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
document.getElementById("myBtn").style.display = "block";
} else {
document.getElementById("myBtn").style.display = "none";
}
}
// When the user clicks on the button, scroll to the top of the document
function topFunction() {
document.body.scrollTop = 0;
document.documentElement.scrollTop = 0;
}
</script>

View File

@ -1,3 +1,24 @@
<style>
#myBtn {
display: none;
position: fixed;
bottom: 20px;
right: 30px;
z-index: 99;
border: none;
outline: none;
background-color: red;
color: white;
cursor: pointer;
padding: 15px;
border-radius: 10px;
}
#myBtn:hover {
background-color: #555;
}
</style>
<center>
<h2>
{{title}}
@ -21,9 +42,9 @@
<thead class="scroll-header">
<tr>
{{#ifeq reimbursable "no"}}
<th colspan="16" style="text-align:center">
<th colspan="17" style="text-align:center">
{{else}}
<th colspan="14" style="text-align:center">
<th colspan="15" style="text-align:center">
{{/ifeq}}
{{#if ptype_id}}
<span class="label label-default">Total: {{total_qty}}</span>
@ -53,7 +74,9 @@
<th>Misc.</th>
<th>Dlz</th>
<th>Ref.Inv#</th>
<!--
<th>Picking#</th>
-->
{{else}}
<th>Date</th>
<th>Cycle#</th>
@ -68,7 +91,9 @@
<th>ค่ายา</th>
<th>ค่าบริการฉีดยา</th>
<th>Inv#</th>
<!--
<th>Picking#</th>
-->
<th>แพทย์</th>
<th>พยาบาล</th>
{{/ifeq}}
@ -98,21 +123,23 @@
{{/if}}
</td>
<td>{{epo_name}}</td>
<td>{{currency fee zero=""}}</td>
<td>{{currency mdc zero=""}}</td>
<td>{{currency lab zero=""}}</td>
<td>{{currency misc zero=""}}</td>
<td>{{currency dlz_price zero=""}}</td>
<td>{{fee}}</td>
<td>{{mdc}}</td>
<td>{{lab}}</td>
<td>{{misc}}</td>
<td>{{dlz_price}}</td>
<td>
{{#if inv_id}}
{{view "link" string=inv_ref action="cust_invoice" action_options="form_view_xml&cust_invoice_form&mode=form" active_id=inv_id}}
{{/if}}
</td>
<!--
<td>
{{#if pick_id}}
{{view "link" string=pick_ref action="pick_out" action_options="mode=form" active_id=pick_id}}
{{/if}}
</td>
-->
{{else}}
<td style="width:10%">{{date}}</td>
<td style="width:6%">{{cycle}}</td>
@ -125,9 +152,9 @@
<td>{{ptype}}</td>
<td>{{hct}}</td>
<td>{{epo_name}}</td>
<td>{{currency fee zero=""}}</td>
<td>{{currency mdc zero=""}}</td>
<td>{{currency srv zero=""}}</td>
<td>{{fee}}</td>
<td>{{mdc}}</td>
<td>{{srv}}</td>
{{#if inv_id}}
<td>
{{view "link" string=inv_number action="cust_invoice" action_options="form_view_xml&cust_invoice_form&mode=form" active_id=inv_id}}
@ -136,6 +163,7 @@
<td>
</td>
{{/if}}
<!--
<td>
{{#if pick_id}}
{{view "link" string=pick_ref action="pick_out" action_options="mode=form" active_id=pick_id}}
@ -143,6 +171,7 @@
-
{{/if}}
</td>
-->
<td>{{dname}}</td>
<td>
{{view "link" string="View" action="clinic_cycle_item" action_options="mode=form" active_id=cycle_item_id}}
@ -163,11 +192,12 @@
<th></th>
<th></th>
<th></th>
<th>{{currency total_fee zero=""}}</th>
<th>{{currency total_mdc zero=""}}</th>
<th>{{currency total_lab zero=""}}</th>
<th>{{currency total_misc zero=""}}</th>
<th>{{currency total_dlz zero=""}}</th>
<th>{{total_fee}}</th>
<th>{{total_mdc}}</th>
<th>{{total_lab}}</th>
<th>{{total_misc}}</th>
<th>{{total_dlz}}</th>
<th></th>
<th></th>
{{else}}
<th></th>
@ -179,12 +209,33 @@
<th></th>
<th></th>
<th></th>
<th>{{currency total_fee zero=""}}</th>
<th>{{currency total_mdc zero=""}}</th>
<th>{{currency total_srv zero=""}}</th>
<th>{{total_fee}}</th>
<th>{{total_mdc}}</th>
<th>{{total_srv}}</th>
<th></th>
<th></th>
<th></th>
{{/ifeq}}
</tfoot>
</table>
<button onclick="topFunction()" id="myBtn" title="Go to top">Top</button>
<script>
// When the user scrolls down 20px from the top of the document, show the button
window.onscroll = function() {scrollFunction()};
function scrollFunction() {
if (document.body.scrollTop > 20 || document.documentElement.scrollTop > 20) {
document.getElementById("myBtn").style.display = "block";
} else {
document.getElementById("myBtn").style.display = "none";
}
}
// When the user clicks on the button, scroll to the top of the document
function topFunction() {
document.body.scrollTop = 0;
document.documentElement.scrollTop = 0;
}
</script>