From 3fd009a7a7c413a492bde07307ae6471dbc59105 Mon Sep 17 00:00:00 2001 From: Nicolas Lempereur Date: Fri, 23 Nov 2018 16:17:06 +0000 Subject: [PATCH] [FIX] l10n_ch: style imp and add 0 on account isr It has been reported that it would be nice to have font OCRB all over the report and number in boxes (for the ISR version of amount with boxes). This commit do some tweaks and adapt positions and font-size to do this. Also a shortcut for an account number can be used in switzerland (see d9448d73892), but in the ISR scanline the account number must be fully printed so this commit do the zero padding (on the middle part of the account number). opw-1903608 closes #29000 --- addons/l10n_ch/models/account_invoice.py | 6 +- .../l10n_ch/static/src/scss/report_isr.scss | 77 ++++++++----------- 2 files changed, 36 insertions(+), 47 deletions(-) diff --git a/addons/l10n_ch/models/account_invoice.py b/addons/l10n_ch/models/account_invoice.py index 8b402d14e99..01c8b747329 100644 --- a/addons/l10n_ch/models/account_invoice.py +++ b/addons/l10n_ch/models/account_invoice.py @@ -39,6 +39,10 @@ class AccountInvoice(models.Model): middle_part = re.sub('^0*', '', middle_part) return currency_code + '-' + middle_part + '-' + trailing_cipher + def _format_isr_postal_scanline(isr_postal): + # format the isr for scanline + return isr_postal[:2] + isr_postal[2:-1].rjust(6, '0') + isr_postal[-1:] + for record in self: if record.partner_bank_id and record.partner_bank_id.bank_id: isr_postal = False @@ -51,7 +55,7 @@ class AccountInvoice(models.Model): continue if isr_postal: - record.l10n_ch_isr_postal = isr_postal + record.l10n_ch_isr_postal = _format_isr_postal_scanline(isr_postal) record.l10n_ch_isr_postal_formatted = _format_isr_postal(isr_postal) @api.depends('number', 'partner_bank_id.l10n_ch_postal') diff --git a/addons/l10n_ch/static/src/scss/report_isr.scss b/addons/l10n_ch/static/src/scss/report_isr.scss index 9f651c8abd6..364c085af5c 100644 --- a/addons/l10n_ch/static/src/scss/report_isr.scss +++ b/addons/l10n_ch/static/src/scss/report_isr.scss @@ -43,12 +43,12 @@ body.l10n_ch_isr #isr { left: 0; overflow: hidden; - font-family: "Work Sans", Verdana, Geneva, sans-serif; - line-height: 1; - font-size: 13px; + font-family: OCRB, Courier, monospace; + line-height: 0.16in; + font-size: 10pt; - p, address { - line-height: 15px; + p { + margin-bottom: 0; } #voucher { @@ -84,32 +84,33 @@ body.l10n_ch_isr #isr { left: 1.1in; } - /* TODO: remove in master */ - &#voucher-currency { - top: 1.65in; - - font-size: 12px; - font-weight: 600; - } - &#voucher-amount_units { - width: 1.5in; - top: 1.84in; + width: 1.62in; + top: 1.87in; text-align: right; font-size: 14px; + letter-spacing: 0.095in; } &#voucher-amount_cents { width: 0.4in; - top: 1.84in; - left: 2in; + top: 1.87in; + left: 1.96in; font-size: 14px; + letter-spacing: 0.095in; } &#voucher-by { - top: 2.18in; + top: 2.22in; + font-size: 9pt; + max-width: 2in; + + #voucher-by_reference_number { + font-size: 7.5pt; + margin-bottom: 0.05in; + } } } @@ -131,6 +132,10 @@ body.l10n_ch_isr #isr { &#slip-for-contact { top: 0.25in; + + p { + margin-bottom: 0; + } } &#slip-for-bank { @@ -146,33 +151,27 @@ body.l10n_ch_isr #isr { left: 1.1in; } - /* TODO: remove in master */ - &#slip-currency { - top: 1.65in; - - font-size: 12px; - font-weight: 600; - } - &#slip-amount_units { - width: 1.5in; - top: 1.84in; + width: 1.62in; + top: 1.87in; text-align: right; font-size: 14px; + letter-spacing: 0.095in; } &#slip-amount_cents { width: 0.4in; - top: 1.84in; - left: 2in; + top: 1.87in; + left: 1.96in; font-size: 14px; + letter-spacing: 0.095in; } &#slip-reference { width: 3.3in; - top: 1.17in; + top: 1.2in; left: 2.5in; text-align: center; } @@ -183,7 +182,7 @@ body.l10n_ch_isr #isr { } &#slip-optical-line { - right: 0.3in; + right: 0.32in; bottom: 0.667in; /* Positioning is set for OCRB of Tsukurimashou Font Family */ @@ -200,19 +199,5 @@ body.l10n_ch_isr #isr { } } } - - /* TODO: remove in master */ - &#slip-optical { - right: 0.3in; - bottom: 0.667in; - - text-align: right; - - /* Letter spacing is set for OCRB of Tsukurimashou Font Family */ - font-family: OCRB, Courier, monospace; - line-height: 0.1in; - font-size: 10pt; - letter-spacing: -0.3px; - } } }