summaryrefslogtreecommitdiff
path: root/addons/l10n_ch/report
diff options
context:
space:
mode:
authorsed-odoo <sed@odoo.com>2018-09-04 08:34:41 +0200
committersed-odoo <sed@odoo.com>2018-09-20 09:41:06 +0200
commit3a883e67287cbf0c93a746bc2080b897f2c87bfa (patch)
tree86924a931dc0045143646cc0c1d0e198dc09339b /addons/l10n_ch/report
parentc59d6d2329494705a5f9dd5ef6a1b0e2c43f8e38 (diff)
[IMP] l10n_ch,account,website_sale: Add SwissQR Code on invoice and improve the SEPA QR Code usability
Purpose ======= - Add the SwissQR Code on the invoice in aim to replace the actual ISR - Improve the settings of the SEPA QR Code to make it more user friendly Specifications ============== - ln_ch: - Add a SwissQR Code on the invoice to fit the Switzerland QR-Bill Format - Use the "partner_bank_id" field to generate the QR Code - Add function to get the address number out of the field "street" and "street2" - account: - Remove the SEPA QR Code's journal settings from the general setting - Display the "partner_bank_id" field on the invoice "Other info" page - Use the "partner_bank_id" field to generate the QR Code - website_sale: - Add a check box on the payment acquirers to use the SEPA QR Code on the e-commerce - Use the payment acquirer "journal_id" field to generate the SEPA QR Code
Diffstat (limited to 'addons/l10n_ch/report')
-rw-r--r--addons/l10n_ch/report/swissqr_report.xml88
1 files changed, 88 insertions, 0 deletions
diff --git a/addons/l10n_ch/report/swissqr_report.xml b/addons/l10n_ch/report/swissqr_report.xml
new file mode 100644
index 00000000000..37dc2b0f6b4
--- /dev/null
+++ b/addons/l10n_ch/report/swissqr_report.xml
@@ -0,0 +1,88 @@
+<?xml version="1.0" encoding="utf-8"?>
+<odoo>
+ <data>
+ <template id="l10n_ch_swissqr_template" inherit_id="account.report_invoice_document">
+ <xpath expr="//div[@id='qrcode']" position="after">
+ <link type="text/css" rel="stylesheet" href="/l10n_ch/static/src/scss/report_swissqr.css"/>
+ <div class="swissqr_content" t-if="o.partner_id.country_id.code == 'CH'">
+ <div class="swissqr_body" t-if="o.partner_bank_id.validate_swiss_code_arguments(o.partner_bank_id.currency_id, o.partner_id) and ((o.currency_id.name == 'EUR') or (o.currency_id.name == 'CHF'))">
+ <div id="title_zone" class="swissqr_column_left title_zone">
+ <span class="swissqr_text title title_zone">QR-bill payment part</span><br/>
+ </div>
+
+ <div id="procedure_zone" class="swissqr_column_left procedure_zone">
+ <span class="swissqr_text title">Supports</span><br/>
+ <span class="swissqr_text content">Credit transfer</span>
+ </div>
+
+ <img class="swissqr" t-att-src="o.partner_bank_id.build_swiss_code_url(o.residual, o.currency_id.name, o.date_due, o.partner_id, 'QRR',
+ (o.partner_bank_id.bank_id.l10n_ch_postal_eur) if (o.partner_bank_id.currency_id.name == 'EUR') else o.partner_bank_id.bank_id.l10n_ch_postal_chf,
+ (o.reference) if (o.reference) else o.number)"/>
+ <img class="ch_cross" src="/l10n_ch/static/src/img/CH-Cross_7mm.png"/>
+
+ <div id="indications_zone" class="swissqr_column_right indication_zone">
+ <span class="swissqr_text title">Account</span><br/>
+ <span class="swissqr_text content" t-field="o.partner_bank_id.acc_number"/><br/>
+
+ <span class="swissqr_text title">Creditor</span><br/>
+ <span class="swissqr_text content" t-field="o.company_id.name"/><br/>
+ <span class="swissqr_text content" t-field="o.company_id.street"/><br/>
+ <span class="swissqr_text content" t-field="o.company_id.country_id.code"/>
+ <span class="swissqr_text content" t-field="o.company_id.zip"/>
+ <span class="swissqr_text content" t-field="o.company_id.city"/><br/>
+
+ <span class="swissqr_text title">Reference number</span><br/>
+ <t t-if="o.partner_bank_id.currency_id.name == 'EUR'">
+ <span class="swissqr_text content" t-field="o.partner_bank_id.bank_id.l10n_ch_postal_eur"/><br/>
+ </t>
+ <t t-if="o.partner_bank_id.currency_id.name == 'CHF'">
+ <span class="swissqr_text content" t-field="o.partner_bank_id.bank_id.l10n_ch_postal_chf"/><br/>
+ </t>
+
+ <span class="swissqr_text title">Additional information</span><br/>
+ <span class="swissqr_text content" t-field="o.reference"/><br/>
+
+ <span class="swissqr_text title">Debtor</span><br/>
+ <span class="swissqr_text content" t-field="o.partner_id.name"/><br/>
+ <span class="swissqr_text content" t-field="o.partner_id.street"> </span>
+ <span class="swissqr_text content" t-field="o.partner_id.street2"/><br/>
+ <span class="swissqr_text content" t-field="o.partner_id.country_id.code"/>
+ <span class="swissqr_text content" t-field="o.partner_id.zip"/>
+ <span class="swissqr_text content" t-field="o.partner_id.city"/><br/>
+
+ <span class="swissqr_text title">Due date</span><br/>
+ <span class="swissqr_text content" t-field="o.date_due"/><br/>
+ </div>
+
+ <div id="amount_zone" class="swissqr_column_left amount_zone">
+ <span class="swissqr_text title">Currency</span><br/>
+ <span class="swissqr_text content" t-field="o.currency_id.name"/>
+ </div>
+
+ <div class="amount_zone amount">
+ <span class="swissqr_text title">Amount</span><br/>
+ <t t-set="formated_amount" t-value="('%.2f' % (o.residual)).split(' ')[0].replace(',',' ')"/>
+ <span class="swissqr_text content" t-esc="formated_amount"/>
+ </div>
+ </div>
+ <div class="swissqr_body" t-if="(o.partner_bank_id.validate_swiss_code_arguments(o.partner_bank_id.currency_id, o.partner_id) == False) and ((o.currency_id.name == 'EUR') or (o.currency_id.name == 'CHF'))">
+ <div class="swissqr_column_left procedure_zone">
+ <span>Some of this informations are not set corrrectly to display the Swiss QR Code.<br/>
+ -Bank > CHF ISR reference<br/>
+ -Bank > EUR ISR reference<br/>
+ -Your company > Street with number<br/>
+ -Your company > City<br/>
+ -Your company > Zip<br/>
+ -Your company > Country<br/>
+ -Debtor > Street with number<br/>
+ -Debtor > City<br/>
+ -Debtor > Zip<br/>
+ -Debtor > Country
+ </span>
+ </div>
+ </div>
+ </div>
+ </xpath>
+ </template>
+ </data>
+</odoo>