123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252 |
- <?xml version="1.0" encoding="utf-8"?>
- <odoo>
- <data>
- <record id="l10n_ch_qr_report" model="ir.actions.report">
- <field name="name">QR-bill</field>
- <field name="model">account.move</field>
- <field name="report_type">qweb-pdf</field>
- <field name="report_name">l10n_ch.qr_report_main</field>
- <field name="report_file">l10n_ch.qr_report_main</field>
- <field name="print_report_name">'QR-bill-%s' % object.name</field>
- <field name="paperformat_id" ref="l10n_ch.paperformat_euro_no_margin"/>
- </record>
- <record id="l10n_ch_qr_header" model="ir.actions.report">
- <field name="name">QR-bill Header</field>
- <field name="model">account.move</field>
- <field name="report_type">qweb-pdf</field>
- <field name="report_name">l10n_ch.qr_report_header</field>
- <field name="report_file">l10n_ch.qr_report_header</field>
- </record>
- <template id="l10n_ch_header_template">
- <t t-call="web.external_layout">
- <!--The following elements are necessary for the header to be displayed correctly.-->
- <br/>
- <p>&nbsp;</p>
- </t>
- </template>
- <template id="l10n_ch_swissqr_template">
- <div class="article" t-att-data-oe-model="o._name" t-att-data-oe-id="o.id">
- <t t-set="o" t-value="o.with_context(lang=lang)"/>
- <t t-set="company" t-value="o.company_id"/>
- <t t-set="formated_amount" t-value="'{:,.2f}'.format(o.amount_residual).replace(',','\xa0')"/>
- <t t-set="is_qrr" t-value="o.partner_bank_id.l10n_ch_qr_iban"/>
- <t t-set="is_scor" t-value="o.partner_bank_id._is_iso11649_reference(o.payment_reference)"/>
- <div class="swissqr_content_v2">
- <div class="swissqr_receipt">
- <img src="/l10n_ch/static/src/img/scissors_h.png" class="scissors horizontal_scissors"/>
- <div id="receipt_title_zone" class="swissqr_section_title">
- <span>Receipt</span>
- </div>
- <div id="receipt_indication_zone" class="receipt_indication_zone">
- <div class="swissqr_text title">
- <span>Account / Payable to</span>
- </div>
- <div class="swissqr_text content">
- <span t-field="o.partner_bank_id.acc_number" t-if="not o.partner_bank_id.l10n_ch_qr_iban"/>
- <span t-field="o.partner_bank_id.l10n_ch_qr_iban" t-if="o.partner_bank_id.l10n_ch_qr_iban"/>
- <br/>
- <span t-esc="o.partner_bank_id.acc_holder_name or o.company_id.name"/><br/>
- <span t-field="o.company_id.street"/><br/>
- <span t-field="o.company_id.country_id.code"/>
- <span t-field="o.company_id.zip"/>
- <span t-field="o.company_id.city"/><br/>
- <br/>
- </div>
- <t t-if="is_qrr or is_scor">
- <div class="swissqr_text title">
- <span>Reference</span>
- </div>
- </t>
- <t t-if="is_qrr">
- <div class="swissqr_text content">
- <span t-esc="o.space_qrr_reference(o.payment_reference)"/><br/>
- <br/>
- </div>
- </t>
- <t t-if="is_scor">
- <div class="swissqr_text content">
- <span t-esc="o.space_scor_reference(o.payment_reference)"/><br/>
- <br/>
- </div>
- </t>
- <div class="swissqr_text title">
- <span>Payable by</span>
- </div>
- <div class="swissqr_text content">
- <span t-field="o.partner_id.commercial_partner_id.name"/><br/>
- <span t-field="o.partner_id.street"/>
- <span t-field="o.partner_id.street2"/><br/>
- <span t-field="o.partner_id.country_id.code"/>
- <span t-field="o.partner_id.zip"/>
- <span t-field="o.partner_id.city"/>
- </div>
- </div>
- <div id="receipt_amount_zone" class="swissqr_column_left receipt_amount_zone">
- <div class="swissqr_text">
- <div class="column">
- <div class="title">
- <span>Currency</span>
- </div>
- <div class="content">
- <span t-field="o.currency_id.name"/>
- </div>
- </div>
- <div class="column">
- <div class="title">
- <span>Amount</span>
- </div>
- <div class="content">
- <span t-esc="formated_amount"/>
- </div>
- </div>
- </div>
- </div>
- <div id="receipt_acceptance_point_zone" class="receipt_acceptance_point_zone">
- <div class="swissqr_text content">
- <span class="title">Acceptance point</span>
- </div>
- </div>
- </div>
- <div class="swissqr_body">
- <img src="/l10n_ch/static/src/img/scissors_v.png" class="scissors vertical_scissors"/>
- <div class="swissqr_column_left">
- <div class="swissqr_section_title">
- <span>Payment part</span>
- </div>
- <img class="swissqr" t-att-src="qr_code_urls[o.id]"/>
- <div id="amount_zone" class="amount_zone">
- <div class="swissqr_text">
- <div class="column">
- <div class="title">
- <span>Currency</span>
- </div>
- <div class="content">
- <span t-field="o.currency_id.name"/>
- </div>
- </div>
- <div class="column">
- <div class="title">
- <span>Amount</span><br/>
- </div>
- <div class="content">
- <span t-esc="formated_amount"/>
- </div>
- </div>
- </div>
- </div>
- </div>
- <div id="indications_zone" class="swissqr_column_right">
- <div class="swissqr_text title">
- <span>Account / Payable to</span><br/>
- </div>
- <div class="swissqr_text content">
- <span t-field="o.partner_bank_id.acc_number" t-if="not o.partner_bank_id.l10n_ch_qr_iban"/>
- <span t-field="o.partner_bank_id.l10n_ch_qr_iban" t-if="o.partner_bank_id.l10n_ch_qr_iban"/>
- <br/>
- <span t-esc="o.partner_bank_id.acc_holder_name or o.company_id.name"/><br/>
- <span t-field="o.company_id.street"/><br/>
- <span t-field="o.company_id.country_id.code"/>
- <span t-field="o.company_id.zip"/>
- <span t-field="o.company_id.city"/><br/>
- <br/>
- </div>
- <t t-if="is_qrr or is_scor">
- <div class="swissqr_text title">
- <span class="title">Reference</span>
- </div>
- </t>
- <t t-if="is_qrr">
- <div class="swissqr_text content">
- <span t-esc="o.space_qrr_reference(o.payment_reference)"/><br/>
- <br/>
- </div>
- </t>
- <t t-if="is_scor">
- <div class="swissqr_text content">
- <span t-esc="o.space_scor_reference(o.payment_reference)"/><br/>
- <br/>
- </div>
- </t>
- <t t-set="additional_info" t-value="(o.ref or o.name if is_qrr or is_scor else o.payment_reference or o.ref or o.name)"/>
- <t t-if="additional_info">
- <div class="swissqr_text title">
- <span>Additional information</span>
- </div>
- <div class="swissqr_text content">
- <span t-esc="additional_info"/><br/>
- <br/>
- </div>
- </t>
- <div class="swissqr_text title">
- <span>Payable by</span>
- </div>
- <div class="swissqr_text content">
- <span t-field="o.partner_id.commercial_partner_id.name"/><br/>
- <span t-field="o.partner_id.street"> </span>
- <span t-field="o.partner_id.street2"/><br/>
- <span t-field="o.partner_id.country_id.code"/>
- <span t-field="o.partner_id.zip"/>
- <span t-field="o.partner_id.city"/><br/>
- <br/>
- </div>
- </div>
- </div>
- </div>
- </div>
- </template>
- <template id="l10n_ch.qr_report_main">
- <t t-call="web.html_container">
- <t t-foreach="docs" t-as="o">
- <t t-set="lang" t-value="o.partner_id.lang"/>
- <t t-call="l10n_ch.l10n_ch_swissqr_template" t-lang="lang"/>
- </t>
- </t>
- </template>
- <template id="l10n_ch.qr_report_header">
- <t t-call="web.html_container">
- <t t-foreach="docs" t-as="invoice">
- <t t-set="o" t-value="invoice"/>
- <t t-set="lang" t-value="o.partner_id.lang"/>
- <t t-call="l10n_ch.l10n_ch_header_template" t-lang="lang"/>
- </t>
- </t>
- </template>
- <template id="minimal_layout_with_report_attribute" inherit_id="web.minimal_layout">
- <body position="attributes">
- <attribute name="t-att-data-report-id">report_xml_id</attribute>
- </body>
- </template>
- </data>
- </odoo>
|