From 1738029b1e449c2c87461f628d03b8f317902ea8 Mon Sep 17 00:00:00 2001 From: NicNal Date: Thu, 2 May 2019 10:03:57 +0200 Subject: [PATCH] Miglioria #564 --- modules/contratti/row-list.php | 12 ++--- modules/ddt/row-list.php | 18 +++---- modules/fatture/row-list.php | 16 +++--- modules/interventi/ajax_costi.php | 50 +++++++++---------- modules/ordini/row-list.php | 18 +++---- modules/partitario/edit.php | 24 ++++----- modules/preventivi/row-list.php | 12 ++--- modules/scadenzario/edit.php | 8 +-- src/Prints.php | 3 -- templates/contratti/body.php | 12 ++--- templates/ddt/body.php | 2 +- templates/ddt/footer.php | 6 +-- templates/fatture/body.php | 2 +- templates/fatture/footer.php | 28 +++++------ templates/interventi/body.php | 28 +++++------ templates/ordini/body.php | 22 ++++---- .../pdfgen.partitario_mastrino.php | 32 ++++++------ templates/preventivi/body.php | 22 ++++---- templates/scadenzario/pdfgen.scadenzario.php | 6 +-- 19 files changed, 160 insertions(+), 161 deletions(-) diff --git a/modules/contratti/row-list.php b/modules/contratti/row-list.php index a7d34d0b9..1ecd04bf7 100644 --- a/modules/contratti/row-list.php +++ b/modules/contratti/row-list.php @@ -155,7 +155,7 @@ if (abs($sconto) > 0) { '.tr('Imponibile', [], ['upper' => true]).': - '.moneyFormat($imponibile).' + '.moneyFormat($imponibile, 2).' '; @@ -166,7 +166,7 @@ if (abs($sconto) > 0) { '.tr('Sconto', [], ['upper' => true]).': - '.moneyFormat($sconto).' + '.moneyFormat($sconto, 2).' '; @@ -178,7 +178,7 @@ if (abs($sconto) > 0) { '.tr('Imponibile scontato', [], ['upper' => true]).': - '.moneyFormat($imponibile_scontato).' + '.moneyFormat($imponibile_scontato, 2).' '; @@ -190,7 +190,7 @@ if (abs($sconto) > 0) { '.tr('Imponibile', [], ['upper' => true]).': - '.moneyFormat($imponibile).' + '.moneyFormat($imponibile, 2).' '; @@ -203,7 +203,7 @@ echo ' '.tr('Iva', [], ['upper' => true]).': - '.moneyFormat($iva).' + '.moneyFormat($iva, 2).' '; @@ -215,7 +215,7 @@ echo ' '.tr('Totale', [], ['upper' => true]).': - '.moneyFormat($totale).' + '.moneyFormat($totale, 2).' '; diff --git a/modules/ddt/row-list.php b/modules/ddt/row-list.php index 00f6a0725..9675f8a51 100644 --- a/modules/ddt/row-list.php +++ b/modules/ddt/row-list.php @@ -219,7 +219,7 @@ echo ' - '.moneyFormat($imponibile).' + '.moneyFormat($imponibile, 2).' @@ -234,7 +234,7 @@ if (abs($sconto) > 0) { - '.moneyFormat($sconto).' + '.moneyFormat($sconto, 2).' @@ -248,7 +248,7 @@ if (abs($sconto) > 0) { - '.moneyFormat($imponibile_scontato).' + '.moneyFormat($imponibile_scontato, 2).' @@ -264,7 +264,7 @@ if (abs($record['rivalsainps']) > 0) { - '.moneyFormat($record['rivalsainps']).' + '.moneyFormat($record['rivalsainps'], 2).' @@ -279,7 +279,7 @@ if (abs($totale_iva) > 0) { - '.moneyFormat($totale_iva).' + '.moneyFormat($totale_iva, 2).' @@ -294,7 +294,7 @@ echo ' - '.moneyFormat($totale).' + '.moneyFormat($totale, 2).' @@ -309,7 +309,7 @@ if (abs($record['bollo']) > 0) { - '.moneyFormat($record['bollo']).' + '.moneyFormat($record['bollo'], 2).' @@ -325,7 +325,7 @@ if (abs($record['ritenutaacconto']) > 0) { - '.moneyFormat($record['ritenutaacconto']).' + '.moneyFormat($record['ritenutaacconto'], 2).' @@ -341,7 +341,7 @@ if ($totale != $netto_a_pagare) { - '.moneyFormat($netto_a_pagare).' + '.moneyFormat($netto_a_pagare, 2).' diff --git a/modules/fatture/row-list.php b/modules/fatture/row-list.php index c16fb03df..ce6bf7c63 100644 --- a/modules/fatture/row-list.php +++ b/modules/fatture/row-list.php @@ -296,7 +296,7 @@ echo ' '.tr('Imponibile', [], ['upper' => true]).': - '.moneyFormat($imponibile).' + '.moneyFormat($imponibile, 2).' '; @@ -309,7 +309,7 @@ if (!empty($sconto)) { '.tr('Sconto', [], ['upper' => true]).': - '.moneyFormat($sconto).' + '.moneyFormat($sconto, 2).' '; @@ -321,7 +321,7 @@ if (!empty($sconto)) { '.tr('Imponibile scontato', [], ['upper' => true]).': - '.moneyFormat($imponibile_scontato).' + '.moneyFormat($imponibile_scontato, 2).' '; @@ -342,7 +342,7 @@ if (!empty($fattura->rivalsa_inps)) { '.tr('Rivalsa', [], ['upper' => true]).' : - '.moneyFormat($fattura->rivalsa_inps).' + '.moneyFormat($fattura->rivalsa_inps, 2).' '; @@ -362,7 +362,7 @@ if (!empty($iva)) { echo ' - '.moneyFormat($iva).' + '.moneyFormat($iva, 2).' '; @@ -375,7 +375,7 @@ echo ' '.tr('Totale', [], ['upper' => true]).': - '.moneyFormat($totale).' + '.moneyFormat($totale, 2).' '; @@ -388,7 +388,7 @@ if (!empty($fattura->ritenuta_acconto)) { '.tr("Ritenuta d'acconto", [], ['upper' => true]).': - '.moneyFormat($fattura->ritenuta_acconto).' + '.moneyFormat($fattura->ritenuta_acconto, 2).' '; @@ -416,7 +416,7 @@ if ($totale != $netto_a_pagare) { '.tr('Netto a pagare', [], ['upper' => true]).': - '.moneyFormat($netto_a_pagare).' + '.moneyFormat($netto_a_pagare, 2).' '; diff --git a/modules/interventi/ajax_costi.php b/modules/interventi/ajax_costi.php index e02a2746a..aa9687066 100644 --- a/modules/interventi/ajax_costi.php +++ b/modules/interventi/ajax_costi.php @@ -35,67 +35,67 @@ if ($show_prezzi) { '.tr('Totale manodopera', [], ['upper' => true]).' - '.moneyFormat($costi['manodopera_costo']).' - '.moneyFormat($costi['manodopera_addebito']).' - '.moneyFormat($costi['manodopera_scontato']).' + '.moneyFormat($costi['manodopera_costo'], 2).' + '.moneyFormat($costi['manodopera_addebito'], 2).' + '.moneyFormat($costi['manodopera_scontato'], 2).' '.tr('Totale diritto di chiamata', [], ['upper' => true]).' - '.moneyFormat($costi['dirittochiamata_costo']).' - '.moneyFormat($costi['dirittochiamata_addebito']).' - '.moneyFormat($costi['dirittochiamata_scontato']).' + '.moneyFormat($costi['dirittochiamata_costo'], 2).' + '.moneyFormat($costi['dirittochiamata_addebito'], 2).' + '.moneyFormat($costi['dirittochiamata_scontato'],2 ).' '.tr('Totale viaggio', [], ['upper' => true]).' - '.moneyFormat($costi['viaggio_costo']).' - '.moneyFormat($costi['viaggio_addebito']).' - '.moneyFormat($costi['viaggio_scontato']).' + '.moneyFormat($costi['viaggio_costo'], 2).' + '.moneyFormat($costi['viaggio_addebito'], 2).' + '.moneyFormat($costi['viaggio_scontato'], 2).' '.tr('Totale articoli', [], ['upper' => true]).' - '.moneyFormat($costi['ricambi_costo']).' - '.moneyFormat($costi['ricambi_addebito']).' - '.moneyFormat($costi['ricambi_scontato']).' + '.moneyFormat($costi['ricambi_costo'], 2).' + '.moneyFormat($costi['ricambi_addebito'], 2).' + '.moneyFormat($costi['ricambi_scontato'], 2).' '.tr('Totale altre spese', [], ['upper' => true]).' - '.moneyFormat($costi['altro_costo']).' - '.moneyFormat($costi['altro_addebito']).' - '.moneyFormat($costi['altro_scontato']).' + '.moneyFormat($costi['altro_costo'], 2).' + '.moneyFormat($costi['altro_addebito'], 2).' + '.moneyFormat($costi['altro_scontato'], 2).' '.tr('Sconto incondizionato', [], ['upper' => true]).' - - - '.moneyFormat(-$costi['sconto_globale']).' + '.moneyFormat(-$costi['sconto_globale'], 2).' '.tr('Imponibile', [], ['upper' => true]).' - '.moneyFormat($costi['totale_costo']).' - '.moneyFormat($costi['totale_addebito']).' - '.moneyFormat($costi['totale_scontato']).' + '.moneyFormat($costi['totale_costo'], 2).' + '.moneyFormat($costi['totale_addebito'] ,2).' + '.moneyFormat($costi['totale_scontato'] ,2).' '.tr('IVA', [], ['upper' => true]).' - '.moneyFormat($costi['iva_costo']).' - '.moneyFormat($costi['iva_addebito']).' - '.moneyFormat($costi['iva_totale']).' + '.moneyFormat($costi['iva_costo'], 2).' + '.moneyFormat($costi['iva_addebito'], 2).' + '.moneyFormat($costi['iva_totale'], 2).' '.tr('Totale', [], ['upper' => true]).' - '.moneyFormat($costi['totaleivato_costo']).' - '.moneyFormat($costi['totaleivato_addebito']).' - '.moneyFormat($costi['totale']).' + '.moneyFormat($costi['totaleivato_costo'], 2).' + '.moneyFormat($costi['totaleivato_addebito'], 2).' + '.moneyFormat($costi['totale'], 2).' '; } diff --git a/modules/ordini/row-list.php b/modules/ordini/row-list.php index 5ff5f6a60..9ef0128ec 100644 --- a/modules/ordini/row-list.php +++ b/modules/ordini/row-list.php @@ -213,7 +213,7 @@ echo ' '.tr('Imponibile', [], ['upper' => true]).': - '.moneyFormat($imponibile).' + '.moneyFormat($imponibile, 2).' '; @@ -226,7 +226,7 @@ if (abs($sconto) > 0) { '.tr('Sconto', [], ['upper' => true]).': - '.moneyFormat($sconto).' + '.moneyFormat($sconto, 2).' '; @@ -238,7 +238,7 @@ if (abs($sconto) > 0) { '.tr('Imponibile scontato', [], ['upper' => true]).': - '.moneyFormat($imponibile_scontato).' + '.moneyFormat($imponibile_scontato, 2).' '; @@ -254,7 +254,7 @@ if (abs($record['rivalsainps']) > 0) { '.tr('Rivalsa', [], ['upper' => true]).': - '.moneyFormat($record['rivalsainps']).' + '.moneyFormat($record['rivalsainps'], 2).' '; @@ -268,7 +268,7 @@ if (abs($totale_iva) > 0) { '.tr('Iva', [], ['upper' => true]).': - '.moneyFormat($totale_iva).' + '.moneyFormat($totale_iva, 2).' '; @@ -281,7 +281,7 @@ echo ' '.tr('Totale', [], ['upper' => true]).': - '.moneyFormat($totale).' + '.moneyFormat($totale, 2).' '; @@ -294,7 +294,7 @@ if (abs($record['bollo']) > 0) { '.tr('Marca da bollo', [], ['upper' => true]).': - '.moneyFormat($record['bollo']).' + '.moneyFormat($record['bollo'], 2).' '; @@ -308,7 +308,7 @@ if (abs($record['ritenutaacconto']) > 0) { '.tr("Ritenuta d'acconto", [], ['upper' => true]).': - '.moneyFormat($record['ritenutaacconto']).' + '.moneyFormat($record['ritenutaacconto'], 2).' '; @@ -322,7 +322,7 @@ if ($totale != $netto_a_pagare) { '.tr('Netto a pagare', [], ['upper' => true]).': - '.moneyFormat($netto_a_pagare).' + '.moneyFormat($netto_a_pagare, 2).' '; diff --git a/modules/partitario/edit.php b/modules/partitario/edit.php index 75dbddcbf..fa656983e 100644 --- a/modules/partitario/edit.php +++ b/modules/partitario/edit.php @@ -135,7 +135,7 @@ for ($x = 0; $x < $n1; ++$x) { // Dare if ($rs[$i]['totale'] > 0) { echo " \n"; - echo moneyFormat(abs($rs[$i]['totale']))."\n"; + echo moneyFormat(abs($rs[$i]['totale']), 2)."\n"; echo " \n"; echo " \n"; @@ -149,7 +149,7 @@ for ($x = 0; $x < $n1; ++$x) { // Avere else { echo " \n"; - echo moneyFormat(abs($rs[$i]['totale']))."\n"; + echo moneyFormat(abs($rs[$i]['totale']), 2)."\n"; echo " \n"; if ($rs1[$x]['descrizione'] == 'Patrimoniale') { @@ -181,7 +181,7 @@ for ($x = 0; $x < $n1; ++$x) { echo " \n"; echo " \n"; - echo moneyFormat(sum($totale_conto_liv3))."\n"; + echo moneyFormat(sum($totale_conto_liv3), 2)."\n"; echo " \n"; } // Fine livello3 @@ -215,7 +215,7 @@ for ($x = 0; $x < $n1; ++$x) { echo "\n"; echo "\n"; - echo "

".moneyFormat($attivita)."

\n"; + echo "

".moneyFormat($attivita, 2)."

\n"; echo "\n"; echo "\n"; @@ -224,7 +224,7 @@ for ($x = 0; $x < $n1; ++$x) { echo "

Passività:

\n"; echo "\n"; echo "\n"; - echo "

".moneyFormat($passivita)."

\n"; + echo "

".moneyFormat($passivita, 2)."

\n"; echo "\n"; // Perdita d'esercizio @@ -233,7 +233,7 @@ for ($x = 0; $x < $n1; ++$x) { echo "

Perdita d'esercizio:

\n"; echo "\n"; echo "\n"; - echo "

".moneyFormat(sum($utile_perdita))."

\n"; + echo "

".moneyFormat(sum($utile_perdita), 2)."

\n"; echo "\n"; echo "\n"; echo "\n"; @@ -242,7 +242,7 @@ for ($x = 0; $x < $n1; ++$x) { echo "

Utile:

\n"; echo "\n"; echo "\n"; - echo "

".moneyFormat(sum($utile_perdita))."

\n"; + echo "

".moneyFormat(sum($utile_perdita), 2)."

\n"; echo "\n"; } @@ -251,7 +251,7 @@ for ($x = 0; $x < $n1; ++$x) { echo "

Totale a pareggio:

\n"; echo "\n"; echo "\n"; - echo "

".moneyFormat(sum($pareggio1))."

\n"; + echo "

".moneyFormat(sum($pareggio1), 2)."

\n"; echo "\n"; echo "\n"; @@ -260,13 +260,13 @@ for ($x = 0; $x < $n1; ++$x) { echo "

Totale a pareggio:

\n"; echo "\n"; echo "\n"; - echo "

".moneyFormat(sum($pareggio2))."

\n"; + echo "

".moneyFormat(sum($pareggio2), 2)."

\n"; echo "\n"; echo ''; } else { - echo "

RICAVI: ".moneyFormat(sum($totale_ricavi))."

\n"; - echo "

COSTI: ".moneyFormat(abs(sum($totale_costi)))."

\n"; - echo "

UTILE/PERDITA: ".moneyFormat(sum($totale_ricavi) - abs(sum($totale_costi)))."

\n"; + echo "

RICAVI: ".moneyFormat(sum($totale_ricavi), 2)."

\n"; + echo "

COSTI: ".moneyFormat(abs(sum($totale_costi)), 2)."

\n"; + echo "

UTILE/PERDITA: ".moneyFormat(sum($totale_ricavi) - abs(sum($totale_costi)), 2)."

\n"; } } diff --git a/modules/preventivi/row-list.php b/modules/preventivi/row-list.php index 7743cb842..f011b0dd1 100644 --- a/modules/preventivi/row-list.php +++ b/modules/preventivi/row-list.php @@ -159,7 +159,7 @@ if (abs($sconto) > 0) { '.tr('Imponibile', [], ['upper' => true]).': - '.moneyFormat($imponibile).' + '.moneyFormat($imponibile, 2).' '; @@ -170,7 +170,7 @@ if (abs($sconto) > 0) { '.tr('Sconto', [], ['upper' => true]).': - '.moneyFormat($sconto).' + '.moneyFormat($sconto, 2).' '; @@ -182,7 +182,7 @@ if (abs($sconto) > 0) { '.tr('Imponibile scontato', [], ['upper' => true]).': - '.moneyFormat($imponibile_scontato).' + '.moneyFormat($imponibile_scontato, 2).' '; @@ -194,7 +194,7 @@ if (abs($sconto) > 0) { '.tr('Imponibile', [], ['upper' => true]).': - '.moneyFormat($imponibile).' + '.moneyFormat($imponibile, 2).' '; @@ -207,7 +207,7 @@ echo ' '.tr('IVA', [], ['upper' => true]).': - '.moneyFormat($iva).' + '.moneyFormat($iva, 2).' '; @@ -219,7 +219,7 @@ echo ' '.tr('Totale', [], ['upper' => true]).': - '.moneyFormat($totale).' + '.moneyFormat($totale, 2).' '; diff --git a/modules/scadenzario/edit.php b/modules/scadenzario/edit.php index 30e68d5b8..bab3c6c53 100644 --- a/modules/scadenzario/edit.php +++ b/modules/scadenzario/edit.php @@ -124,11 +124,11 @@ for ($i = 0; $i < count($rs); ++$i) { - {[ "type": "number", "name": "scadenza['.$rs[$i]['id'].']", "value": "'.Translator::numberToLocale($rs[$i]['da_pagare']).'" ]} + {[ "type": "number", "name": "scadenza['.$rs[$i]['id'].']", "decimals": 2, "value": "'.Translator::numberToLocale($rs[$i]['da_pagare'],2).'" ]} - {[ "type": "number", "name": "pagato['.$rs[$i]['id'].']", "value": "'.Translator::numberToLocale($rs[$i]['pagato']).'" ]} + {[ "type": "number", "name": "pagato['.$rs[$i]['id'].']", "decimals": 2, "value": "'.Translator::numberToLocale($rs[$i]['pagato']).'" ]} '; } @@ -169,7 +169,7 @@ echo ' ]); ?>. - + @@ -191,6 +191,8 @@ if($records[0]['iddocumento']==0){ ?>