Skip to content

Commit

Permalink
BAH-3749 | Refactor. Update payment extensions to match module name
Browse files Browse the repository at this point in the history
  • Loading branch information
mohan-13 committed May 3, 2024
1 parent 1379291 commit f6bb6e8
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 32 deletions.
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<template id="report_multi_invoice_recipt">
<data>

<template id="report_payment_invoice">
<t t-call="web.html_container">
<t t-foreach="docs" t-as="o">
<t t-call="web.external_layout">
Expand Down Expand Up @@ -38,7 +38,7 @@
padding-bottom: 5px;
padding-left: 10px;
padding-right: 10px;
}
}
</style>
</head>
<div class="oe_structure"/>
Expand Down Expand Up @@ -81,11 +81,11 @@
<th style="width:5%; height: 30px;">S.No</th>
<th style="width:50%; height: 30px;">Product</th>
<th style="width:15%; height: 30px;">Expiry Date</th>
<th style="width:10%; height: 30px;">Quantity</th>
<th style="width:10%; height: 30px;">Quantity</th>
<th style="width:25%; height: 30px;">Unit Price</th>
<th style="width:25%; height: 30px;">SubTotal</th>
<th style="width:25%; height: 30px;">SubTotal</th>
</tr>
<t t-set="serial" t-value="1"/>
<t t-set="serial" t-value="1"/>
<t t-foreach="o.multi_invoice_search().order_id.order_line.sorted(key=lambda item : item.product_id.name)" t-as="item">
<tr>
<td style="width:10%; height: 20px;padding-top:10px;padding-bottom:5px;padding-left:20px;padding-right: 20px;">
Expand All @@ -111,15 +111,15 @@
<td style="width:10%;height:20px;padding-top:10px;padding-bottom:5px;padding-left:20px;padding-right: 10px;">
<t t-esc="'%.2f'%(item.price_subtotal)"/>
</td>
<t t-set="serial" t-value="serial+1"/>
<t t-set="serial" t-value="serial+1"/>
</tr>
</t>
</table>
</div>
<div style="width: 100%; float: right;margin-bottom: 50px;">
<div style="float:left;margin-bottom: 50px; position: absolute;top: 150px;">
</div>
<div style="float:left;position: relative;top: 50px;">
<div style="float:left;position: relative;top: 50px;">
<p style="margin-bottom: 2px;">This is a computer generated receipt and does not require a signature.</p>
<p style="margin-bottom: 2px;">Bill Created : <span id="out_bal" t-field="o.create_date"></span></p>
<p style="margin-bottom: 2px;">Bill Confirmed : <span id="out_bal" t-field="o.date"></span></p>
Expand All @@ -132,17 +132,17 @@
<label for="net_amt" class="answer"><span style="margin-right: 78px;"> Net Amount</span>:</label>
<span id="net_amt" class="answer" t-esc="'%.2f'%((o.multi_invoice_search().amount_total - o.multi_invoice_search().discount)+o.multi_invoice_search().round_off_amount)"></span><br></br>
<label for="pre_bal"><span style="margin-right: 40px;">Previous Balance</span>:</label>

<t id="description" t-if="(o.prev_outstanding_balance - ((o.multi_invoice_search().amount_total - o.multi_invoice_search().discount)+o.multi_invoice_search().round_off_amount)) &lt;= 0 ">
<span id="pre_bal" t-esc="'%.2f'%(0.00)"></span><br></br>
</t>
<t id="description" t-if="(o.prev_outstanding_balance - ((o.multi_invoice_search().amount_total - o.multi_invoice_search().discount)+o.multi_invoice_search().round_off_amount)) &gt; 0 ">
<span id="pre_bal" t-esc="'%.2f'%(o.prev_outstanding_balance - ((o.multi_invoice_search().amount_total - o.multi_invoice_search().discount)+o.multi_invoice_search().round_off_amount))"></span><br></br>
</t>
<label for="bill_amt" class="answer"><span style="margin-right: 78px;"> Bill Amount</span>:</label>
<span id="bill_amt" class="answer" t-esc="'%.2f'%(o.prev_outstanding_balance)"></span><br></br>
<span id="bill_amt" class="answer" t-esc="'%.2f'%(o.prev_outstanding_balance)"></span><br></br>
<label for="paid_amt" class="answer"><span style="margin-right: 68px;">Paid Amount</span>: </label>
<span id="paid_amt" class="answer" t-esc="'%.2f'%(o.amount)"></span><br></br><br></br>
<span id="paid_amt" class="answer" t-esc="'%.2f'%(o.amount)"></span><br></br><br></br>
<label for="out_bal"><span style="margin-right: 10px;">Outstanding Balance </span>:</label>
<span id="out_bal" t-esc="'%.2f'%(o.total_receivable())"></span>
</div>
Expand All @@ -151,9 +151,9 @@
</t>
</t>
</template>
<template id="report_invoice_multi_summarized_recipt">


<template id="report_payment_summary">
<t t-call="web.html_container">
<t t-foreach="docs" t-as="o">
<t t-call="web.external_layout">
Expand Down Expand Up @@ -241,24 +241,24 @@
<label for="net_amt" class="answer"><span style="margin-right: 78px;"> Net Amount</span>:</label>
<span id="net_amt" class="answer" t-esc="'%.2f'%((o.multi_invoice_search().amount_total - o.multi_invoice_search().discount)+o.multi_invoice_search().round_off_amount)"></span><br></br>
<label for="pre_bal"><span style="margin-right: 40px;">Previous Balance</span>:</label>

<t id="description" t-if="(o.prev_outstanding_balance - ((o.multi_invoice_search().amount_total - o.multi_invoice_search().discount)+o.multi_invoice_search().round_off_amount)) &lt;= 0 ">
<span id="pre_bal" t-esc="'%.2f'%(0.00)"></span><br></br>
</t>
<t id="description" t-if="(o.prev_outstanding_balance - ((o.multi_invoice_search().amount_total - o.multi_invoice_search().discount)+o.multi_invoice_search().round_off_amount)) &gt; 0 ">
<span id="pre_bal" t-esc="'%.2f'%(o.prev_outstanding_balance - ((o.multi_invoice_search().amount_total - o.multi_invoice_search().discount)+o.multi_invoice_search().round_off_amount))"></span><br></br>
</t>
<label for="bill_amt" class="answer"><span style="margin-right: 78px;"> Bill Amount</span>:</label>
<span id="bill_amt" class="answer" t-esc="'%.2f'%(o.prev_outstanding_balance)"></span><br></br>
<span id="bill_amt" class="answer" t-esc="'%.2f'%(o.prev_outstanding_balance)"></span><br></br>
<label for="paid_amt" class="answer"><span style="margin-right: 68px;">Paid Amount</span>: </label>
<span id="paid_amt" class="answer" t-esc="'%.2f'%(o.amount)"></span><br></br><br></br>
<span id="paid_amt" class="answer" t-esc="'%.2f'%(o.amount)"></span><br></br><br></br>
<label for="out_bal"><span style="margin-right: 10px;">Outstanding Balance </span>:</label>
<span id="out_bal" t-esc="'%.2f'%(o.total_receivable())"></span><br></br><br></br>
</div>
</div>
<br></br>
<br></br>
<div style="width: 100%; float:left; margin-bottom: 125px;">
<p style="margin-bottom: 2px;"><span id="out_bal" t-esc="(o.cashier_name())"></span></p><br></br>
<p style="margin-bottom: 2px;"><span id="out_bal" t-esc="(o.cashier_name())"></span></p><br></br>
<p style="margin-bottom: 2px;">This is a computer generated receipt and does not require a signature.</p>
<p style="margin-bottom: 2px;">Created : <span id="out_bal" t-field="o.create_date"></span></p>
<p style="margin-bottom: 2px;">Confirmed : <span id="out_bal" t-field="o.date"></span></p>
Expand All @@ -267,7 +267,7 @@
</t>
</t>
</template>


</data>
</odoo>
Original file line number Diff line number Diff line change
Expand Up @@ -79,4 +79,39 @@
</field>
</record>

<record id="inherit_view_account_payment_tree_bahmni" model="ir.ui.view">
<field name="name">Payment View Changes</field>
<field name="model">account.payment</field>
<field name="inherit_id" ref="account.view_account_payment_tree"/>
<field name="arch" type="xml">
<xpath expr="//field[@name='partner_id']" position="after">
<field name="create_uid" string="Cashier"/>
</xpath>
</field>
</record>

<record id="inherit_view_account_payment_search_bahmni" model="ir.ui.view">
<field name="name">Payment Search View Changes</field>
<field name="model">account.payment</field>
<field name="inherit_id" ref="account.view_account_payment_search"/>
<field name="arch" type="xml">
<search string="Payments">
<field name="create_uid" string="Cashier"/>
<filter string="Cashier" name="create_uid" domain="[]" context="{'group_by': 'create_uid'}"/>
</search>
</field>
</record>

<record id="inherit_view_account_payment_form" model="ir.ui.view">
<field name="name">account.payment.form</field>
<field name="model">account.payment</field>
<field name="inherit_id" ref="account.view_account_payment_form"/>
<field name="arch" type="xml">
<xpath expr="//header" position="inside">
<button name="generate_report_action" string="Summarized Bill(ALT+Z)" type="object" data-hotkey="z"
class="btn btn-secondary"/>
</xpath>
</field>
</record>

</odoo>
20 changes: 10 additions & 10 deletions bahmni_auto_payment_reconciliation/views/account_report.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,25 @@
<odoo>
<data>
<!-- QWeb Reports -->
<record id="account_multi_receipt_invoices_payment" model="ir.actions.report">
<field name="name">Multi Receipt</field>
<record id="account_payment_invoices_receipt" model="ir.actions.report">
<field name="name">Receipt</field>
<field name="model">account.payment</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">bahmni_multi_payment.report_multi_invoice_recipt</field>
<field name="report_file">bahmni_multi_payment.report_multi_invoice_recipt</field>
<field name="report_name">bahmni_auto_payment_reconciliation.report_payment_invoice</field>
<field name="report_file">bahmni_auto_payment_reconciliation.report_payment_invoice</field>
<field name="print_report_name">(object.move_id._get_report_base_filename())</field>
<field name="attachment">(object.state == 'posted') and ((object.name or 'INV').replace('/','_')+'.pdf')</field>
<field name="binding_model_id" ref="model_account_payment"/>
<field name="binding_type">report</field>
</record>
<record id="account_summarized_multi_invoices_payment" model="ir.actions.report">
<field name="name">Multi Receipt Summary</field>


<record id="account_payment_summary_receipt" model="ir.actions.report">
<field name="name">Receipt Summary</field>
<field name="model">account.payment</field>
<field name="report_type">qweb-pdf</field>
<field name="report_name">bahmni_multi_payment.report_invoice_multi_summarized_recipt</field>
<field name="report_file">bahmni_multi_payment.report_invoice_multi_summarized_recipt</field>
<field name="report_name">bahmni_auto_payment_reconciliation.report_payment_summary</field>
<field name="report_file">bahmni_auto_payment_reconciliation.report_payment_summary</field>
<field name="print_report_name">(object.move_id._get_report_base_filename())</field>
<field name="attachment">(object.state == 'posted') and ((object.name or 'INV').replace('/','_')+'.pdf')</field>
<field name="binding_model_id" ref="model_account_payment"/>
Expand Down

0 comments on commit f6bb6e8

Please sign in to comment.