diff options
| -rw-r--r-- | addons/l10n_ch/report/isr_report.xml | 185 | ||||
| -rw-r--r-- | addons/l10n_ch/static/src/img/background_virgin_isr.png | bin | 0 -> 26347 bytes | |||
| -rw-r--r-- | addons/l10n_ch/static/src/img/background_virgin_isr_bank.png | bin | 0 -> 27889 bytes | |||
| -rw-r--r-- | addons/l10n_ch/static/src/less/report_isr.less | 170 |
4 files changed, 278 insertions, 77 deletions
diff --git a/addons/l10n_ch/report/isr_report.xml b/addons/l10n_ch/report/isr_report.xml index 1b09cfecfde..312f2cbdb68 100644 --- a/addons/l10n_ch/report/isr_report.xml +++ b/addons/l10n_ch/report/isr_report.xml @@ -1,6 +1,20 @@ <?xml version="1.0" encoding="utf-8"?> <odoo> <data> + + <record id="paperformat_euro_no_margin" model="report.paperformat"> + <field name="name">European A4 without borders</field> + <field name="default" eval="False" /> + <field name="format">A4</field> + <field name="orientation">Portrait</field> + <field name="margin_top">0</field> + <field name="margin_bottom">0</field> + <field name="margin_left">0</field> + <field name="margin_right">0</field> + <field name="header_line" eval="False" /> + <field name="header_spacing">0</field> + </record> + <!--Report containing an ISR corrresponding to an invoice.--> <report id="l10n_ch_isr_report" model="account.invoice" @@ -20,8 +34,15 @@ report is only available to be printed for out invoices after 'draft' state, if the fields required by the ISR have been set.--> </field> + <field name="paperformat_id" ref="paperformat_euro_no_margin"/> </record> + <template id="assets_common" name="l10n_ch_isr_report" inherit_id="report.assets_common"> + <xpath expr="." position="inside"> + <link href="/l10n_ch/static/src/less/report_isr.less" rel="stylesheet"/> + </xpath> + </template> + <!--TODO: this template needs to be modified in order to respect the ISR layout given in PostFinance's specifications. @@ -31,98 +52,108 @@ <template id="l10n_ch_isr_report_template"> <t t-call="report.external_layout"> <t t-set="split_total_amount" t-value="invoice.split_total_amount()"/> + <t t-set="invoice_bank_id" t-value="invoice.company_id.l10n_ch_isr_print_bank_location and invoice.partner_bank_id.bank_id"/> <h1>ISR for invoice <t t-esc="invoice.number"/></h1> - <!--Voucher, left part of the ISR.--> - <div id="voucher"> - <h1>Voucher</h1> + <div id="l10n_ch_isr" t-att-class="'isr-print-bank' if invoice_bank_id else None"> + + <!--Voucher, left part of the ISR.--> + <div id="voucher"> + <!--<h1>Voucher</h1>--> - <div id="voucher-for"> - <h2>Einzahlung für/Versement pour/Versamento per</h2> + <!--<h2>Einzahlung für/Versement pour/Versamento per</h2>--> <!--If we use the alternate ISR layout, displaying name and location of the bank.--> - <t t-if="invoice.company_id.l10n_ch_isr_print_bank_location"> - <p t-field="invoice.partner_bank_id.bank_id.name"/> - <p> - <t t-esc="invoice.zip"/> - <t t-esc="invoice.city"/> - </p> - - <h2>Zugunsten von/En faveur de/A favore di</h2> + <t t-if="invoice_bank_id"> + <div id="voucher-for-bank"> + <p> + <t t-esc="invoice_bank_id.name"/><br /> + <t t-esc="invoice_bank_id.zip"/> + <t t-esc="invoice_bank_id.city"/> + </p> + </div> + <!--<h2>Zugunsten von/En faveur de/A favore di</h2>--> </t> - <p id="voucher-for_name" t-field="invoice.company_id.display_name"/> - <p id="voucher-for_address1" t-field="invoice.company_id.street"/> - <p id="voucher-for_address2" t-field="invoice.company_id.street2"/> - <p id="voucher-for_address3"> - <t t-esc="invoice.company_id.zip"/> - <t t-esc="invoice.company_id.city"/> - </p> - </div> - - <div id="voucher-bank"> - <h2>Konto/Compte/Conto</h2> - <p id="voucher-bank_ref" t-field="invoice.l10n_ch_isr_postal_formatted"/> - </div> - - <p id="voucher-currency" t-field="invoice.currency_id.name"/> - <p id="voucher-amount_units" t-esc="split_total_amount[0]"/> - <p id="voucher-amount_cents" t-esc="split_total_amount[1]"/> - - <div id="voucher-by"> - <h2>Einbezahlt von/Versé par/Versato da</h2> - <p id="voucher-by_reference_number" t-field="invoice.l10n_ch_isr_number"/> - <address id="voucher-by_customer_address" t-field="invoice.partner_id" t-options='{"widget": "contact", "fields": ["address","name"], "no_marker": True}' /> + <div id="voucher-for-contact"> + <p id="voucher-for_name" t-field="invoice.company_id.display_name"/> + <p id="voucher-for_address1" t-field="invoice.company_id.street"/> + <p id="voucher-for_address2" t-field="invoice.company_id.street2"/> + <p id="voucher-for_address3"> + <t t-esc="invoice.company_id.zip"/> + <t t-esc="invoice.company_id.city"/> + </p> + </div> + + <div id="voucher-bank"> + <!--<h2>Konto/Compte/Conto</h2>--> + <p id="voucher-bank_ref" t-field="invoice.l10n_ch_isr_postal_formatted"/> + </div> + + <p id="voucher-currency" t-field="invoice.currency_id.name"/> + <p id="voucher-amount_units" t-esc="split_total_amount[0]"/> + <p id="voucher-amount_cents" t-esc="split_total_amount[1]"/> + + <div id="voucher-by"> + <!--<h2>Einbezahlt von/Versé par/Versato da</h2>--> + <p id="voucher-by_reference_number" t-field="invoice.l10n_ch_isr_number"/> + <address id="voucher-by_customer_address" t-field="invoice.partner_id" t-options='{"widget": "contact", "fields": ["address","name"], "no_marker": True}' /> + </div> </div> - </div> - <!--Slip, right part of the ISR.--> - <div id="slip"> - <h1>Slip</h1> + <!--Slip, right part of the ISR.--> + <div id="slip"> + <!--<h1>Slip</h1>--> - <div id="slip-for"> - <h2>Einzahlung für/Versement pour/Versamento per</h2> + <!--<h2>Einzahlung für/Versement pour/Versamento per</h2>--> <!--If we use the alternate ISR layout, displaying name and location of the bank.--> - <t t-if="invoice.company_id.l10n_ch_isr_print_bank_location"> - <p t-field="invoice.partner_bank_id.bank_id.name"/> - <p t-field="invoice.partner_bank_id.bank_id.location_line"/> - <h2>Zugunsten von/En faveur de/A favore di</h2> + <t t-if="invoice_bank_id"> + <div id="slip-for-bank"> + <p> + <t t-esc="invoice_bank_id.name"/><br /> + <t t-esc="invoice_bank_id.zip"/> + <t t-esc="invoice_bank_id.city"/> + </p> + </div> + <!--<h2>Zugunsten von/En faveur de/A favore di</h2>--> </t> - <p id="slip-for_name" t-field="invoice.company_id.display_name"/> - <p id="slip-for_address1" t-field="invoice.company_id.street"/> - <p id="slip-for_address2" t-field="invoice.company_id.street2"/> - <p id="slip-for_address3"> - <t t-esc="invoice.company_id.zip"/> - <t t-esc="invoice.company_id.city"/> - </p> - </div> - - <div id="slip-bank"> - <h2>Konto/Compte/Conto</h2> - <p id="slip-bank_ref" t-field="invoice.l10n_ch_isr_postal_formatted"/> - </div> - - <p id="slip-currency" t-field="invoice.currency_id.name"/> - <p id="slip-amount_units" t-esc="split_total_amount[0]"/> - <p id="slip-amount_cents" t-esc="split_total_amount[1]"/> - - <div id="slip-reference"> - <h2>Referenz-Nr./N°de référence/N°di riferimento</h2> - <p id="slip-reference_number" t-field="invoice.l10n_ch_isr_number_spaced"/> - </div> - - <div id="slip-by"> - <h2>Einbezahlt von/Versé par/Versato da</h2> - <address id="slip-by_customer_address" t-field="invoice.partner_id" t-options='{"widget": "contact", "fields": ["address","name"], "no_marker": True}' /> - </div> - - <div id="slip-optical"> - <h2>Optical reference</h2> - <p id="slip-optical_ref_line" t-field="invoice.l10n_ch_isr_optical_line"/> + <div id="slip-for-contact"> + <p id="slip-for_name" t-field="invoice.company_id.display_name"/> + <p id="slip-for_address1" t-field="invoice.company_id.street"/> + <p id="slip-for_address2" t-field="invoice.company_id.street2"/> + <p id="slip-for_address3"> + <t t-esc="invoice.company_id.zip"/> + <t t-esc="invoice.company_id.city"/> + </p> + </div> + + <div id="slip-bank"> + <!--<h2>Konto/Compte/Conto</h2>--> + <p id="slip-bank_ref" t-field="invoice.l10n_ch_isr_postal_formatted"/> + </div> + + <p id="slip-currency" t-field="invoice.currency_id.name"/> + <p id="slip-amount_units" t-esc="split_total_amount[0]"/> + <p id="slip-amount_cents" t-esc="split_total_amount[1]"/> + + <div id="slip-reference"> + <!--<h2>Referenz-Nr./N°de référence/N°di riferimento</h2>--> + <p id="slip-reference_number" t-field="invoice.l10n_ch_isr_number_spaced"/> + </div> + + <div id="slip-by"> + <!--<h2>Einbezahlt von/Versé par/Versato da</h2>--> + <address id="slip-by_customer_address" t-field="invoice.partner_id" t-options='{"widget": "contact", "fields": ["address","name"], "no_marker": True}' /> + </div> + + <div id="slip-optical"> + <!--<h2>Optical reference</h2>--> + <span id="slip-optical_ref_line" t-field="invoice.l10n_ch_isr_optical_line"/> + </div> </div> </div> </t> @@ -136,4 +167,4 @@ </t> </template> </data> -</odoo>
\ No newline at end of file +</odoo> diff --git a/addons/l10n_ch/static/src/img/background_virgin_isr.png b/addons/l10n_ch/static/src/img/background_virgin_isr.png Binary files differnew file mode 100644 index 00000000000..f1a54d0b34b --- /dev/null +++ b/addons/l10n_ch/static/src/img/background_virgin_isr.png diff --git a/addons/l10n_ch/static/src/img/background_virgin_isr_bank.png b/addons/l10n_ch/static/src/img/background_virgin_isr_bank.png Binary files differnew file mode 100644 index 00000000000..1d03b17ca8c --- /dev/null +++ b/addons/l10n_ch/static/src/img/background_virgin_isr_bank.png diff --git a/addons/l10n_ch/static/src/less/report_isr.less b/addons/l10n_ch/static/src/less/report_isr.less new file mode 100644 index 00000000000..5c7916928ff --- /dev/null +++ b/addons/l10n_ch/static/src/less/report_isr.less @@ -0,0 +1,170 @@ +body.o_in_iframe { + #l10n_ch_isr { + background: url(/l10n_ch/static/src/img/background_virgin_isr.png) bottom no-repeat; + background-size: 100%; + + &.isr-print-bank { + background-image: url(/l10n_ch/static/src/img/background_virgin_isr_bank.png); + } + } +} + +#l10n_ch_isr { + height: 106mm; + width: 210mm; + + position: absolute; + /* position bvr at bottom of page */ + top: 297 - 106mm; + left: 0; + + overflow: hidden; + font-family: "Work Sans", Verdana, Geneva, sans-serif; + font-size: 13px; + + p, address { + line-height: 15px; + } + + #voucher { + height: 4in; + width: 2 + 4/10in; + + position: absolute; + /* header title of BVR section */ + top: 1/6in; + /* right of voucher corresponds to left of slip */ + right: 5 + 9/10in; + } + + #voucher > * { + position: absolute; + /* default left margin for fields content */ + left: 1/10in; + + &#voucher-for-contact { + top: 3/10in; + } + + &#voucher-for-bank { + top: 3/20in; + } + + &#voucher-for-bank + #voucher-for-contact { + top: 4/6in; + } + + &#voucher-bank { + top: 9/6in; + left: 11/10in; + } + + &#voucher-currency { + top: 9/6 + 3/20in; + + font-size: 12px; + font-weight: 600; + } + + &#voucher-amount_units { + width: 15/10in; + top: 11/6in; + + text-align: right; + line-height: 1/6in; + font-weight: 14px; + } + + &#voucher-amount_cents { + width: 4/10in; + top: 11/6in; + left: 19/10in; + + line-height: 1/6in; + font-weight: 14px; + } + + &#voucher-by { + top: 26/12in; + } + } + + #slip { + height: 4in; + width: 5 + 9/10in; + + position: absolute; + /* header title of BVR section */ + top: 1/6in; + /* right of slip corresponds to right of slip */ + right: 0; + } + + #slip > * { + position: absolute; + /* default left margin for fields content */ + left: 1/10in; + + &#slip-for-contact { + top: 3/10in; + } + + &#slip-for-bank { + top: 3/20in; + } + + &#slip-for-bank + #slip-for-contact { + top: 4/6in; + } + + &#slip-bank { + top: 9/6in; + left: 11/10in; + } + + &#slip-currency { + top: 9/6 + 3/20in; + + font-size: 12px; + font-weight: 600; + } + + &#slip-amount_units { + width: 15/10in; + top: 11/6in; + + text-align: right; + line-height: 1/6in; + font-weight: 14px; + } + + &#slip-amount_cents { + width: 4/10in; + top: 11/6in; + left: 19/10in; + + line-height: 1/6in; + font-weight: 14px; + } + + &#slip-reference { + width: 3 + 3/10in; + top: 7/6in; + left: 2 + 5/10in; + text-align: center; + } + + &#slip-by { + top: 11/6in; + left: 2 + 5/10in; + } + + &#slip-optical { + right: 3/10in; + bottom: 4/6in; + + text-align: right; + font-height: 1/6in; + } + } +} |
