From c66c0a06a7f162baf7f831f5536614805a26a956 Mon Sep 17 00:00:00 2001 From: Irka Date: Tue, 29 Jul 2014 12:09:30 +0200 Subject: [PATCH] MT#8353 Give possibility to manage money signs after comma in template. (cherry picked from commit 92706efe775e55494a92e3b384776bcf5539b6d4) --- share/templates/invoice/default/invoice_template_aux.tt | 5 ++++- share/templates/invoice/default/invoice_template_svg.tt | 3 ++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/share/templates/invoice/default/invoice_template_aux.tt b/share/templates/invoice/default/invoice_template_aux.tt index dd26806457..df49a57bba 100644 --- a/share/templates/invoice/default/invoice_template_aux.tt +++ b/share/templates/invoice/default/invoice_template_aux.tt @@ -130,7 +130,10 @@ amount = amount ? amount : 0 ; full = Math.int(amount / 100); cent = Math.int(amount % 100); - cents = String.new(cent); cents = cents.format("%02d"); + cents = String.new(cent); + money_signs = money_signs || '2'; + money_format_string = money_format_string || "%0" _ money_signs _ "d"; + cents = cents.format(money_format_string); aux.val = full _ comma _ cents; END; diff --git a/share/templates/invoice/default/invoice_template_svg.tt b/share/templates/invoice/default/invoice_template_svg.tt index 143e769f93..8f84dac6e0 100644 --- a/share/templates/invoice/default/invoice_template_svg.tt +++ b/share/templates/invoice/default/invoice_template_svg.tt @@ -2,6 +2,8 @@ [% pagewidth = 210; pageheight = 297; + server_process_units = 'none'; + money_signs = 3; PROCESS "invoice/default/invoice_template_aux.tt"; money_format(amount=(billprof.interval_charge * 100), comma='.'); fixfee = aux.val; @@ -12,7 +14,6 @@ cur = billprof.currency; p_start = date_format(thedate=invoice.period_start, format='%Y-%m-%d'); p_end = date_format(thedate=invoice.period_end, format='%Y-%m-%d'); - server_process_units = 'none'; -%] }-->