Fix format_number function.

This commit refs #19250
This commit is contained in:
José Antonio Díaz Miralles 2021-06-28 12:33:02 +02:00
parent 4d727ce8bc
commit 0b94c12ab1
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'}\