From 194242a2352bda4e025362fb5e6c26377d1695e0 Mon Sep 17 00:00:00 2001 From: Luca Date: Fri, 19 Feb 2021 19:20:17 +0100 Subject: [PATCH] =?UTF-8?q?Se=20i=20decimali=20per=20la=20quantit=C3=A0=20?= =?UTF-8?q?sono=20<=202=20li=20imposto=20a=202=20che=20=C3=A8=20il=20minim?= =?UTF-8?q?o=20per=20lo=20standard=20della=20fatturazione=20elettronica?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/exportFE/src/Validator.php | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/plugins/exportFE/src/Validator.php b/plugins/exportFE/src/Validator.php index d0821833b..95813714a 100755 --- a/plugins/exportFE/src/Validator.php +++ b/plugins/exportFE/src/Validator.php @@ -610,7 +610,12 @@ class Validator if (in_array($key, ['PrezzoUnitario'])) { $output = number_format($output, 6, '.', ''); } elseif (in_array($key, ['Quantita'])) { - $output = number_format($output, setting('Cifre decimali per quantità'), '.', ''); + //Se i decimali per la quantità sono < 2 li imposto a 2 che è il minimo per lo standard della fatturazione elettronica + if (setting('Cifre decimali per quantità') == 1){ + $output = number_format($output, 2, '.', ''); + }else{ + $output = number_format($output, setting('Cifre decimali per quantità'), '.', ''); + } } else { $output = number_format($output, 2, '.', ''); }