Fix format_number function.

This commit refs #19250


(cherry picked from commit 0b94c12ab1)
This commit is contained in:
José Antonio Díaz Miralles 2021-06-28 12:33:02 +02:00 committed by Sergio Morillo
parent f5566d14bf
commit 24047f2c5c
1 changed files with 1 additions and 1 deletions

View File

@ -1,6 +1,6 @@
{% include ${group._get_confirming_template_paths()['base'] + '/base.txt'} %}\
{% def format_number(value, length_, precision) %}\
${'%s%s' % (str(int(divmod(abs(value), 1)[0]))[:length_].zfill(length_), str(divmod(abs(value), 1)[1])[2:precision + 2].zfill(precision))}\
${'%s%s' % (str(int(divmod(abs(value), 1)[0]))[:length_].zfill(length_), str(divmod(abs(value), 1)[1])[2:precision + 2].ljust(precision, '0'))}\
{% end %}\
{% def invoice_type(payment) %}\
${'credit_note' if payment.line.origin.total_amount < 0 else 'invoice'}\