blob: 4d9181f12050a69de4f6d722d78e4ed9648d92f8 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
|
<?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"/>
<field name="attachment">'QR-bill-' + object.name + '.pdf'</field>
</record>
<template id="assets_common_qr" inherit_id="web.report_assets_common">
<xpath expr="." position="inside">
<link type="text/scss" rel="stylesheet" href="/l10n_ch/static/src/scss/report_swissqr.scss"/>
</xpath>
</template>
<template id="l10n_ch_swissqr_template">
<t t-set="o" t-value="o.with_context(lang=lang)"/>
<t t-call="web.external_layout">
<!-- add class to body tag -->
<script>document.body.className += " l10n_ch_qr";</script>
<!-- add default margin for header (matching A4 European margin) -->
<t t-set="report_header_style">padding-top:6.2mm; padding-left:8.2mm; padding-right:8.2mm;</t>
<t t-set="formated_amount" t-value="'{:,.2f}'.format(o.amount_residual).replace(',','\xa0')"/>
<div class="swissqr_title">
<h1>QR-bill for invoice <t t-esc="o.name"/></h1>
</div>
<div class="swissqr_content">
<div class="swissqr_receipt">
<div id="receipt_title_zone" class="main_title swissqr_column_left">
<span>Receipt</span>
</div>
<div id="receipt_indication_zone" class="swissqr_column_left receipt_indication_zone">
<div class="swissqr_text">
<span class="title">Account / Payable to</span><br/>
<span class="content" t-field="o.partner_bank_id.acc_number"/><br/>
<span class="content" t-field="o.company_id.name"/><br/>
<span class="content" t-field="o.company_id.street"/><br/>
<span class="content" t-field="o.company_id.country_id.code"/>
<span class="content" t-field="o.company_id.zip"/>
<span class="content" t-field="o.company_id.city"/><br/>
</div>
<t t-if="o.partner_bank_id._is_qr_iban()">
<div class="swissqr_text">
<span class="title">Reference</span><br/>
<span class="content" t-esc="o.space_qrr_reference(o.payment_reference)"/><br/>
</div>
</t>
<div class="swissqr_text">
<span class="title">Payable by</span><br/>
<span class="content" t-field="o.partner_id.commercial_partner_id.name"/><br/>
<span class="content" t-field="o.partner_id.street"> </span>
<span class="content" t-field="o.partner_id.street2"/><br/>
<span class="content" t-field="o.partner_id.country_id.code"/>
<span class="content" t-field="o.partner_id.zip"/>
<span class="content" t-field="o.partner_id.city"/><br/>
</div>
</div>
<div id="receipt_amount_zone" class="swissqr_column_left receipt_amount_zone">
<div class="swissqr_text">
<div class="column">
<span class="title">Currency</span><br/>
<span class="content" t-field="o.currency_id.name"/>
</div>
<div class="column">
<span class="title">Amount</span><br/>
<span class="content" t-esc="formated_amount"/>
</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">
<div class="main_title swissqr_column_left">
<span>Payment Part</span>
</div>
<img class="swissqr" t-att-src="qr_code_urls[o.id]"/>
<div id="indications_zone" class="swissqr_column_right indication_zone">
<div class="swissqr_text">
<span class="title">Account / Payable to</span><br/>
<span class="content" t-field="o.partner_bank_id.acc_number"/><br/>
<span class="content" t-field="o.company_id.name"/><br/>
<span class="content" t-field="o.company_id.street"/><br/>
<span class="content" t-field="o.company_id.country_id.code"/>
<span class="content" t-field="o.company_id.zip"/>
<span class="content" t-field="o.company_id.city"/><br/>
</div>
<t t-if="o.partner_bank_id._is_qr_iban()">
<div class="swissqr_text">
<span class="title">Reference</span><br/>
<span class="content" t-esc="o.space_qrr_reference(o.payment_reference)"/><br/>
</div>
</t>
<t t-set="additional_info" t-value="(o.ref or o.name if o.partner_bank_id._is_qr_iban() else o.payment_reference or o.ref or o.name)"/>
<t t-if="additional_info">
<div class="swissqr_text">
<span class="title">Additional information</span><br/>
<span class="content" t-esc="additional_info"/>
</div>
</t>
<div class="swissqr_text">
<span class="title">Payable by</span><br/>
<span class="content" t-field="o.partner_id.commercial_partner_id.name"/><br/>
<span class="content" t-field="o.partner_id.street"> </span>
<span class="content" t-field="o.partner_id.street2"/><br/>
<span class="content" t-field="o.partner_id.country_id.code"/>
<span class="content" t-field="o.partner_id.zip"/>
<span class="content" t-field="o.partner_id.city"/><br/>
</div>
</div>
<div id="amount_zone" class="swissqr_column_left amount_zone">
<div class="swissqr_text">
<div class="column">
<span class="title">Currency</span><br/>
<span class="content" t-field="o.currency_id.name"/>
</div>
<div class="column">
<span class="title">Amount</span><br/>
<span class="content" t-esc="formated_amount"/>
</div>
</div>
</div>
</div>
</div>
</t>
</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>
</data>
</odoo>
|