mirror of
https://github.com/OCA/bank-payment.git
synced 2025-02-02 10:37:31 +02:00
@@ -23,7 +23,7 @@ Account Payment Order
|
||||
:target: https://runbot.odoo-community.org/runbot/173/13.0
|
||||
:alt: Try me on Runbot
|
||||
|
||||
|badge1| |badge2| |badge3| |badge4| |badge5|
|
||||
|badge1| |badge2| |badge3| |badge4| |badge5|
|
||||
|
||||
This module adds support for payment orders and debit orders.
|
||||
|
||||
@@ -103,6 +103,7 @@ Contributors
|
||||
|
||||
* Raf Ven <raf.ven@dynapps.be>
|
||||
* Andrea Stirpe <a.stirpe@onestein.nl>
|
||||
* Guillem Casassas <guillem.casassas@forgeflow.com>
|
||||
|
||||
Maintainers
|
||||
~~~~~~~~~~~
|
||||
|
||||
@@ -35,6 +35,8 @@
|
||||
"data/payment_seq.xml",
|
||||
"report/print_account_payment_order.xml",
|
||||
"report/account_payment_order.xml",
|
||||
"report/print_bank_payment_line.xml",
|
||||
"report/bank_payment_line.xml",
|
||||
],
|
||||
"demo": ["demo/payment_demo.xml"],
|
||||
"installable": True,
|
||||
|
||||
@@ -1 +1,2 @@
|
||||
from . import account_payment_order
|
||||
from . import bank_payment_line
|
||||
|
||||
46
account_payment_order/report/bank_payment_line.py
Normal file
46
account_payment_order/report/bank_payment_line.py
Normal file
@@ -0,0 +1,46 @@
|
||||
# © 2017 Acsone SA/NV (<https://www.acsone.eu>)
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html).
|
||||
|
||||
from odoo import api, models
|
||||
from odoo.tools.misc import formatLang
|
||||
|
||||
|
||||
class AccountPaymentOrderReport(models.AbstractModel):
|
||||
_name = "report.account_payment_order.print_bank_payment_line_main"
|
||||
_description = "Technical model for printing Bank Payment Line"
|
||||
|
||||
@api.model
|
||||
def _get_report_values(self, docids, data=None):
|
||||
AccountPaymentOrderObj = self.env["account.payment.order"]
|
||||
docs = AccountPaymentOrderObj.browse(docids)
|
||||
|
||||
return {
|
||||
"doc_ids": docids,
|
||||
"doc_model": "account.payment.order",
|
||||
"docs": docs,
|
||||
"data": data,
|
||||
"env": self.env,
|
||||
"get_bank_account_name": self.get_bank_account_name,
|
||||
"formatLang": formatLang,
|
||||
}
|
||||
|
||||
@api.model
|
||||
def get_bank_account_name(self, partner_bank):
|
||||
"""
|
||||
|
||||
:param partner_bank:
|
||||
:return:
|
||||
"""
|
||||
if partner_bank:
|
||||
name = ""
|
||||
if partner_bank.bank_name:
|
||||
name = "%s: " % partner_bank.bank_id.name
|
||||
if partner_bank.acc_number:
|
||||
name = "{} {}".format(name, partner_bank.acc_number)
|
||||
if partner_bank.bank_bic:
|
||||
name = "%s - " % (name)
|
||||
if partner_bank.bank_bic:
|
||||
name = "{} BIC {}".format(name, partner_bank.bank_bic)
|
||||
return name
|
||||
else:
|
||||
return False
|
||||
153
account_payment_order/report/bank_payment_line.xml
Normal file
153
account_payment_order/report/bank_payment_line.xml
Normal file
@@ -0,0 +1,153 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!-- 2022 Copyright ForgeFlow, S.L. (https://www.forgeflow.com)
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). -->
|
||||
<odoo>
|
||||
<template id="print_bank_payment_line_document">
|
||||
<t
|
||||
t-set="doc"
|
||||
t-value="doc.with_context({'lang': doc.generated_user_id and doc.generated_user_id.lang or user.lang})"
|
||||
/>
|
||||
<t t-call="web.external_layout">
|
||||
<div class="page">
|
||||
<div class="oe_structure" />
|
||||
<div class="row">
|
||||
<div class="col-4 offset-8">
|
||||
<span
|
||||
t-raw="'%s <br>' % doc.journal_id.bank_id.name if doc.journal_id.bank_id.name else ''"
|
||||
/>
|
||||
<span
|
||||
t-raw="'%s <br>' % doc.journal_id.bank_id.street if doc.journal_id.bank_id.street else ''"
|
||||
/>
|
||||
<span
|
||||
t-raw="'%s <br>' % doc.journal_id.bank_id.street2 if doc.journal_id.bank_id.street2 else ''"
|
||||
/>
|
||||
<span
|
||||
t-raw="'%s <br>' % doc.journal_id.bank_id.zip if doc.journal_id.bank_id.zip else ''"
|
||||
/>
|
||||
<span
|
||||
t-raw="'%s <br>' % doc.journal_id.bank_id.city if doc.journal_id.bank_id.city else ''"
|
||||
/>
|
||||
<span
|
||||
t-raw="'%s <br>' % doc.journal_id.bank_id.state.name if doc.journal_id.bank_id.state.name else ''"
|
||||
/>
|
||||
<span
|
||||
t-raw="'%s <br>' % doc.journal_id.bank_id.country.name if doc.journal_id.bank_id.country.name else ''"
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
<t>
|
||||
<h2>Bank Payment Lines</h2>
|
||||
</t>
|
||||
<div class="row mt32 mb32">
|
||||
<div t-if="doc.payment_mode_id.name" class="col-2">
|
||||
<strong>Payment Type:</strong>
|
||||
<p t-field="doc.payment_mode_id.name" />
|
||||
</div>
|
||||
<div t-if="doc.name" class="col-2">
|
||||
<strong>Reference</strong>
|
||||
<p t-field="doc.name" />
|
||||
</div>
|
||||
<div t-if="doc.company_partner_bank_id.bank_id.id" class="col-2">
|
||||
<strong>Used Account:</strong>
|
||||
<p>
|
||||
<span
|
||||
t-esc="get_bank_account_name(doc.company_partner_bank_id)"
|
||||
/>
|
||||
</p>
|
||||
</div>
|
||||
<div t-if="doc.date_prefered" class="col-2">
|
||||
<strong>Execution:</strong>
|
||||
<p t-field="doc.date_prefered" />
|
||||
</div>
|
||||
<div t-if="doc.company_id.currency_id.name" class="col-2">
|
||||
<strong>Company Currency:</strong>
|
||||
<p t-field="doc.company_id.currency_id.name" />
|
||||
</div>
|
||||
</div>
|
||||
<table class="table table-condensed">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Partner</th>
|
||||
<th class="text-center">Bank Account</th>
|
||||
<th class="text-center">Invoice Ref</th>
|
||||
<th class="text-center">Payment Date</th>
|
||||
<th class="text-right">Amount</th>
|
||||
<th class="text-right">Currency</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<t t-set="total_amount" t-value="0" />
|
||||
<tr t-foreach="doc.bank_line_ids" t-as="line">
|
||||
<!-- compute total amount -->
|
||||
<t
|
||||
t-set="total_amount"
|
||||
t-value="total_amount+line.amount_currency"
|
||||
/>
|
||||
<td>
|
||||
<span t-field="line.partner_id.name" />
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<span
|
||||
t-esc="get_bank_account_name(line.partner_bank_id)"
|
||||
/>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<span
|
||||
t-field="line.communication"
|
||||
style="
|
||||
display:inline-block;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
max-width: 125px;"
|
||||
/>
|
||||
</td>
|
||||
<td class="text-center">
|
||||
<span t-field="line.date" />
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<span t-field="line.amount_currency" />
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<span t-field="line.amount_company_currency" />
|
||||
</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
<div class="row pull-right">
|
||||
<div class="col-4">
|
||||
<table class="table table-condensed">
|
||||
<tr class="border-black">
|
||||
<td>
|
||||
<strong>Total</strong>
|
||||
</td>
|
||||
<td class="text-right">
|
||||
<span
|
||||
t-esc="formatLang(env, total_amount, currency_obj=doc.company_currency_id)"
|
||||
/>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Total (Currency)</td>
|
||||
<td class="text-right">
|
||||
<span t-field="doc.total_company_currency" />
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
<div class="oe_structure" />
|
||||
</div>
|
||||
</t>
|
||||
</template>
|
||||
<template id="print_bank_payment_line_main">
|
||||
<t t-call="web.html_container">
|
||||
<t t-foreach="docs" t-as="doc">
|
||||
<t
|
||||
t-call="account_payment_order.print_bank_payment_line_document"
|
||||
t-lang="doc.generated_user_id.lang"
|
||||
/>
|
||||
</t>
|
||||
</t>
|
||||
</template>
|
||||
</odoo>
|
||||
14
account_payment_order/report/print_bank_payment_line.xml
Normal file
14
account_payment_order/report/print_bank_payment_line.xml
Normal file
@@ -0,0 +1,14 @@
|
||||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<!-- 2022 Copyright ForgeFlow, S.L. (https://www.forgeflow.com)
|
||||
# License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). -->
|
||||
<odoo>
|
||||
<!-- QWeb Report -->
|
||||
<report
|
||||
id="action_print_bank_payment_line"
|
||||
model="account.payment.order"
|
||||
string="Bank Payment Lines"
|
||||
report_type="qweb-pdf"
|
||||
name="account_payment_order.print_bank_payment_line_main"
|
||||
file="account_payment_order.print_bank_payment_line_main"
|
||||
/>
|
||||
</odoo>
|
||||
Reference in New Issue
Block a user