This commit is contained in:
NicNal 2019-05-02 10:03:57 +02:00
parent ab676e8bae
commit 1738029b1e
19 changed files with 160 additions and 161 deletions

View File

@ -155,7 +155,7 @@ if (abs($sconto) > 0) {
<b>'.tr('Imponibile', [], ['upper' => true]).':</b>
</td>
<td class="text-right">
<span id="budget">'.moneyFormat($imponibile).'</span>
<span id="budget">'.moneyFormat($imponibile, 2).'</span>
</td>
<td></td>
</tr>';
@ -166,7 +166,7 @@ if (abs($sconto) > 0) {
<b>'.tr('Sconto', [], ['upper' => true]).':</b>
</td>
<td class="text-right">
'.moneyFormat($sconto).'
'.moneyFormat($sconto, 2).'
</td>
<td></td>
</tr>';
@ -178,7 +178,7 @@ if (abs($sconto) > 0) {
<b>'.tr('Imponibile scontato', [], ['upper' => true]).':</b>
</td>
<td class="text-right">
'.moneyFormat($imponibile_scontato).'
'.moneyFormat($imponibile_scontato, 2).'
</td>
<td></td>
</tr>';
@ -190,7 +190,7 @@ if (abs($sconto) > 0) {
<b>'.tr('Imponibile', [], ['upper' => true]).':</b>
</td>
<td class="text-right">
<span id="budget">'.moneyFormat($imponibile).'</span>
<span id="budget">'.moneyFormat($imponibile, 2).'</span>
</td>
<td></td>
</tr>';
@ -203,7 +203,7 @@ echo '
<b>'.tr('Iva', [], ['upper' => true]).':</b>
</td>
<td class="text-right">
'.moneyFormat($iva).'
'.moneyFormat($iva, 2).'
</td>
<td></td>
</tr>';
@ -215,7 +215,7 @@ echo '
<b>'.tr('Totale', [], ['upper' => true]).':</b>
</td>
<td class="text-right">
'.moneyFormat($totale).'
'.moneyFormat($totale, 2).'
</td>
<td></td>
</tr>';

View File

@ -219,7 +219,7 @@ echo '
</td>
<td align="right">
'.moneyFormat($imponibile).'
'.moneyFormat($imponibile, 2).'
</td>
<td></td>
@ -234,7 +234,7 @@ if (abs($sconto) > 0) {
</td>
<td align="right">
'.moneyFormat($sconto).'
'.moneyFormat($sconto, 2).'
</td>
<td></td>
@ -248,7 +248,7 @@ if (abs($sconto) > 0) {
</td>
<td align="right">
'.moneyFormat($imponibile_scontato).'
'.moneyFormat($imponibile_scontato, 2).'
</td>
<td></td>
@ -264,7 +264,7 @@ if (abs($record['rivalsainps']) > 0) {
</td>
<td align="right">
'.moneyFormat($record['rivalsainps']).'
'.moneyFormat($record['rivalsainps'], 2).'
</td>
<td></td>
@ -279,7 +279,7 @@ if (abs($totale_iva) > 0) {
</td>
<td align="right">
'.moneyFormat($totale_iva).'
'.moneyFormat($totale_iva, 2).'
</td>
<td></td>
@ -294,7 +294,7 @@ echo '
</td>
<td align="right">
'.moneyFormat($totale).'
'.moneyFormat($totale, 2).'
</td>
<td></td>
@ -309,7 +309,7 @@ if (abs($record['bollo']) > 0) {
</td>
<td align="right">
'.moneyFormat($record['bollo']).'
'.moneyFormat($record['bollo'], 2).'
</td>
<td></td>
@ -325,7 +325,7 @@ if (abs($record['ritenutaacconto']) > 0) {
</td>
<td align="right">
'.moneyFormat($record['ritenutaacconto']).'
'.moneyFormat($record['ritenutaacconto'], 2).'
</td>
<td></td>
@ -341,7 +341,7 @@ if ($totale != $netto_a_pagare) {
</td>
<td align="right">
'.moneyFormat($netto_a_pagare).'
'.moneyFormat($netto_a_pagare, 2).'
</td>
<td></td>

View File

@ -296,7 +296,7 @@ echo '
<b>'.tr('Imponibile', [], ['upper' => true]).':</b>
</td>
<td align="right">
'.moneyFormat($imponibile).'
'.moneyFormat($imponibile, 2).'
</td>
<td></td>
</tr>';
@ -309,7 +309,7 @@ if (!empty($sconto)) {
<b>'.tr('Sconto', [], ['upper' => true]).':</b>
</td>
<td align="right">
'.moneyFormat($sconto).'
'.moneyFormat($sconto, 2).'
</td>
<td></td>
</tr>';
@ -321,7 +321,7 @@ if (!empty($sconto)) {
<b>'.tr('Imponibile scontato', [], ['upper' => true]).':</b>
</td>
<td align="right">
'.moneyFormat($imponibile_scontato).'
'.moneyFormat($imponibile_scontato, 2).'
</td>
<td></td>
</tr>';
@ -342,7 +342,7 @@ if (!empty($fattura->rivalsa_inps)) {
<b>'.tr('Rivalsa', [], ['upper' => true]).' :</b>
</td>
<td align="right">
'.moneyFormat($fattura->rivalsa_inps).'
'.moneyFormat($fattura->rivalsa_inps, 2).'
</td>
<td></td>
</tr>';
@ -362,7 +362,7 @@ if (!empty($iva)) {
echo '
</td>
<td align="right">
'.moneyFormat($iva).'
'.moneyFormat($iva, 2).'
</td>
<td></td>
</tr>';
@ -375,7 +375,7 @@ echo '
<b>'.tr('Totale', [], ['upper' => true]).':</b>
</td>
<td align="right">
'.moneyFormat($totale).'
'.moneyFormat($totale, 2).'
</td>
<td></td>
</tr>';
@ -388,7 +388,7 @@ if (!empty($fattura->ritenuta_acconto)) {
<b>'.tr("Ritenuta d'acconto", [], ['upper' => true]).':</b>
</td>
<td align="right">
'.moneyFormat($fattura->ritenuta_acconto).'
'.moneyFormat($fattura->ritenuta_acconto, 2).'
</td>
<td></td>
</tr>';
@ -416,7 +416,7 @@ if ($totale != $netto_a_pagare) {
<b>'.tr('Netto a pagare', [], ['upper' => true]).':</b>
</td>
<td align="right">
'.moneyFormat($netto_a_pagare).'
'.moneyFormat($netto_a_pagare, 2).'
</td>
<td></td>
</tr>';

View File

@ -35,67 +35,67 @@ if ($show_prezzi) {
<tr>
<th>'.tr('Totale manodopera', [], ['upper' => true]).'</th>
<td class="text-right">'.moneyFormat($costi['manodopera_costo']).'</td>
<td class="text-right">'.moneyFormat($costi['manodopera_addebito']).'</td>
<td class="text-right">'.moneyFormat($costi['manodopera_scontato']).'</td>
<td class="text-right">'.moneyFormat($costi['manodopera_costo'], 2).'</td>
<td class="text-right">'.moneyFormat($costi['manodopera_addebito'], 2).'</td>
<td class="text-right">'.moneyFormat($costi['manodopera_scontato'], 2).'</td>
</tr>
<tr>
<th>'.tr('Totale diritto di chiamata', [], ['upper' => true]).'</th>
<td class="text-right">'.moneyFormat($costi['dirittochiamata_costo']).'</td>
<td class="text-right">'.moneyFormat($costi['dirittochiamata_addebito']).'</td>
<td class="text-right">'.moneyFormat($costi['dirittochiamata_scontato']).'</td>
<td class="text-right">'.moneyFormat($costi['dirittochiamata_costo'], 2).'</td>
<td class="text-right">'.moneyFormat($costi['dirittochiamata_addebito'], 2).'</td>
<td class="text-right">'.moneyFormat($costi['dirittochiamata_scontato'],2 ).'</td>
</tr>
<tr>
<th>'.tr('Totale viaggio', [], ['upper' => true]).'</th>
<td class="text-right">'.moneyFormat($costi['viaggio_costo']).'</td>
<td class="text-right">'.moneyFormat($costi['viaggio_addebito']).'</td>
<td class="text-right">'.moneyFormat($costi['viaggio_scontato']).'</td>
<td class="text-right">'.moneyFormat($costi['viaggio_costo'], 2).'</td>
<td class="text-right">'.moneyFormat($costi['viaggio_addebito'], 2).'</td>
<td class="text-right">'.moneyFormat($costi['viaggio_scontato'], 2).'</td>
</tr>
<tr>
<th>'.tr('Totale articoli', [], ['upper' => true]).'</th>
<td class="text-right">'.moneyFormat($costi['ricambi_costo']).'</td>
<td class="text-right">'.moneyFormat($costi['ricambi_addebito']).'</td>
<td class="text-right">'.moneyFormat($costi['ricambi_scontato']).'</td>
<td class="text-right">'.moneyFormat($costi['ricambi_costo'], 2).'</td>
<td class="text-right">'.moneyFormat($costi['ricambi_addebito'], 2).'</td>
<td class="text-right">'.moneyFormat($costi['ricambi_scontato'], 2).'</td>
</tr>
<tr>
<th>'.tr('Totale altre spese', [], ['upper' => true]).'</th>
<td class="text-right">'.moneyFormat($costi['altro_costo']).'</td>
<td class="text-right">'.moneyFormat($costi['altro_addebito']).'</td>
<td class="text-right">'.moneyFormat($costi['altro_scontato']).'</td>
<td class="text-right">'.moneyFormat($costi['altro_costo'], 2).'</td>
<td class="text-right">'.moneyFormat($costi['altro_addebito'], 2).'</td>
<td class="text-right">'.moneyFormat($costi['altro_scontato'], 2).'</td>
</tr>
<tr>
<th>'.tr('Sconto incondizionato', [], ['upper' => true]).'</th>
<td class="text-right">-</td>
<td class="text-right">-</td>
<td class="text-right">'.moneyFormat(-$costi['sconto_globale']).'</td>
<td class="text-right">'.moneyFormat(-$costi['sconto_globale'], 2).'</td>
</tr>
<tr class='.$hide.' >
<th>'.tr('Imponibile', [], ['upper' => true]).'</th>
<td class="text-right">'.moneyFormat($costi['totale_costo']).'</td>
<td class="text-right">'.moneyFormat($costi['totale_addebito']).'</td>
<td class="text-right">'.moneyFormat($costi['totale_scontato']).'</td>
<td class="text-right">'.moneyFormat($costi['totale_costo'], 2).'</td>
<td class="text-right">'.moneyFormat($costi['totale_addebito'] ,2).'</td>
<td class="text-right">'.moneyFormat($costi['totale_scontato'] ,2).'</td>
</tr>
<tr class='.$hide.' >
<th>'.tr('IVA', [], ['upper' => true]).'</th>
<td class="text-right">'.moneyFormat($costi['iva_costo']).'</td>
<td class="text-right">'.moneyFormat($costi['iva_addebito']).'</td>
<td class="text-right">'.moneyFormat($costi['iva_totale']).'</td>
<td class="text-right">'.moneyFormat($costi['iva_costo'], 2).'</td>
<td class="text-right">'.moneyFormat($costi['iva_addebito'], 2).'</td>
<td class="text-right">'.moneyFormat($costi['iva_totale'], 2).'</td>
</tr>
<tr>
<th>'.tr('Totale', [], ['upper' => true]).'</th>
<th class="text-right">'.moneyFormat($costi['totaleivato_costo']).'</th>
<th class="text-right">'.moneyFormat($costi['totaleivato_addebito']).'</th>
<th class="text-right">'.moneyFormat($costi['totale']).'</th>
<th class="text-right">'.moneyFormat($costi['totaleivato_costo'], 2).'</th>
<th class="text-right">'.moneyFormat($costi['totaleivato_addebito'], 2).'</th>
<th class="text-right">'.moneyFormat($costi['totale'], 2).'</th>
</tr>
</table>';
}

View File

@ -213,7 +213,7 @@ echo '
<b>'.tr('Imponibile', [], ['upper' => true]).':</b>
</td>
<td align="right">
'.moneyFormat($imponibile).'
'.moneyFormat($imponibile, 2).'
</td>
<td></td>
</tr>';
@ -226,7 +226,7 @@ if (abs($sconto) > 0) {
<b>'.tr('Sconto', [], ['upper' => true]).':</b>
</td>
<td align="right">
'.moneyFormat($sconto).'
'.moneyFormat($sconto, 2).'
</td>
<td></td>
</tr>';
@ -238,7 +238,7 @@ if (abs($sconto) > 0) {
<b>'.tr('Imponibile scontato', [], ['upper' => true]).':</b>
</td>
<td align="right">
'.moneyFormat($imponibile_scontato).'
'.moneyFormat($imponibile_scontato, 2).'
</td>
<td></td>
</tr>';
@ -254,7 +254,7 @@ if (abs($record['rivalsainps']) > 0) {
<b>'.tr('Rivalsa', [], ['upper' => true]).':</b>
</td>
<td align="right">
'.moneyFormat($record['rivalsainps']).'
'.moneyFormat($record['rivalsainps'], 2).'
</td>
<td></td>
</tr>';
@ -268,7 +268,7 @@ if (abs($totale_iva) > 0) {
<b>'.tr('Iva', [], ['upper' => true]).':</b>
</td>
<td align="right">
'.moneyFormat($totale_iva).'
'.moneyFormat($totale_iva, 2).'
</td>
<td></td>
</tr>';
@ -281,7 +281,7 @@ echo '
<b>'.tr('Totale', [], ['upper' => true]).':</b>
</td>
<td align="right">
'.moneyFormat($totale).'
'.moneyFormat($totale, 2).'
</td>
<td></td>
</tr>';
@ -294,7 +294,7 @@ if (abs($record['bollo']) > 0) {
<b>'.tr('Marca da bollo', [], ['upper' => true]).':</b>
</td>
<td align="right">
'.moneyFormat($record['bollo']).'
'.moneyFormat($record['bollo'], 2).'
</td>
<td></td>
</tr>';
@ -308,7 +308,7 @@ if (abs($record['ritenutaacconto']) > 0) {
<b>'.tr("Ritenuta d'acconto", [], ['upper' => true]).':</b>
</td>
<td align="right">
'.moneyFormat($record['ritenutaacconto']).'
'.moneyFormat($record['ritenutaacconto'], 2).'
</td>
<td></td>
</tr>';
@ -322,7 +322,7 @@ if ($totale != $netto_a_pagare) {
<b>'.tr('Netto a pagare', [], ['upper' => true]).':</b>
</td>
<td align="right">
'.moneyFormat($netto_a_pagare).'
'.moneyFormat($netto_a_pagare, 2).'
</td>
<td></td>
</tr>';

View File

@ -135,7 +135,7 @@ for ($x = 0; $x < $n1; ++$x) {
// Dare
if ($rs[$i]['totale'] > 0) {
echo " <td align='right'>\n";
echo moneyFormat(abs($rs[$i]['totale']))."\n";
echo moneyFormat(abs($rs[$i]['totale']), 2)."\n";
echo " </td>\n";
echo " <td></td></tr>\n";
@ -149,7 +149,7 @@ for ($x = 0; $x < $n1; ++$x) {
// Avere
else {
echo " <td></td><td align='right'>\n";
echo moneyFormat(abs($rs[$i]['totale']))."\n";
echo moneyFormat(abs($rs[$i]['totale']), 2)."\n";
echo " </td>\n";
if ($rs1[$x]['descrizione'] == 'Patrimoniale') {
@ -181,7 +181,7 @@ for ($x = 0; $x < $n1; ++$x) {
echo " </td>\n";
echo " <td width='100' align='right' valign='top'>\n";
echo moneyFormat(sum($totale_conto_liv3))."\n";
echo moneyFormat(sum($totale_conto_liv3), 2)."\n";
echo " </td></tr>\n";
} // Fine livello3
@ -215,7 +215,7 @@ for ($x = 0; $x < $n1; ++$x) {
echo "</th>\n";
echo "<td width='150' align='right'>\n";
echo " <p align='right'><big>".moneyFormat($attivita)."</big></p>\n";
echo " <p align='right'><big>".moneyFormat($attivita, 2)."</big></p>\n";
echo "</td>\n";
echo "<td width='50'></td>\n";
@ -224,7 +224,7 @@ for ($x = 0; $x < $n1; ++$x) {
echo " <p align='right'><big>Passività:</big></p>\n";
echo "</th>\n";
echo "<td width='150' align='right'>\n";
echo " <p align='right'><big>".moneyFormat($passivita)."</big></p>\n";
echo " <p align='right'><big>".moneyFormat($passivita, 2)."</big></p>\n";
echo "</td></tr>\n";
// Perdita d'esercizio
@ -233,7 +233,7 @@ for ($x = 0; $x < $n1; ++$x) {
echo " <p align='right'><big>Perdita d'esercizio:</big></p>\n";
echo "</th>\n";
echo "<td align='right'>\n";
echo " <p align='right'><big>".moneyFormat(sum($utile_perdita))."</big></p>\n";
echo " <p align='right'><big>".moneyFormat(sum($utile_perdita), 2)."</big></p>\n";
echo "</td>\n";
echo "<td></td>\n";
echo "<td></td><td></td></tr>\n";
@ -242,7 +242,7 @@ for ($x = 0; $x < $n1; ++$x) {
echo " <p align='right'><big>Utile:</big></p>\n";
echo "</th>\n";
echo "<td align='right'>\n";
echo " <p align='right'><big>".moneyFormat(sum($utile_perdita))."</big></p>\n";
echo " <p align='right'><big>".moneyFormat(sum($utile_perdita), 2)."</big></p>\n";
echo "</td></tr>\n";
}
@ -251,7 +251,7 @@ for ($x = 0; $x < $n1; ++$x) {
echo " <p align='right'><big>Totale a pareggio:</big></p>\n";
echo "</th>\n";
echo "<td align='right'>\n";
echo " <p align='right'><big>".moneyFormat(sum($pareggio1))."</big></p>\n";
echo " <p align='right'><big>".moneyFormat(sum($pareggio1), 2)."</big></p>\n";
echo "</td>\n";
echo "<td></td>\n";
@ -260,13 +260,13 @@ for ($x = 0; $x < $n1; ++$x) {
echo " <p align='right'><big>Totale a pareggio:</big></p>\n";
echo "</th>\n";
echo "<td align='right'>\n";
echo " <p align='right'><big>".moneyFormat(sum($pareggio2))."</big></p>\n";
echo " <p align='right'><big>".moneyFormat(sum($pareggio2), 2)."</big></p>\n";
echo "</td></tr>\n";
echo '</table>';
} else {
echo "<p align='right'><big><b>RICAVI:</b> ".moneyFormat(sum($totale_ricavi))."</big></p>\n";
echo "<p align='right'><big><b>COSTI:</b> ".moneyFormat(abs(sum($totale_costi)))."</big></p>\n";
echo "<p align='right'><big><b>UTILE/PERDITA:</b> ".moneyFormat(sum($totale_ricavi) - abs(sum($totale_costi)))."</big></p>\n";
echo "<p align='right'><big><b>RICAVI:</b> ".moneyFormat(sum($totale_ricavi), 2)."</big></p>\n";
echo "<p align='right'><big><b>COSTI:</b> ".moneyFormat(abs(sum($totale_costi)), 2)."</big></p>\n";
echo "<p align='right'><big><b>UTILE/PERDITA:</b> ".moneyFormat(sum($totale_ricavi) - abs(sum($totale_costi)), 2)."</big></p>\n";
}
}

View File

@ -159,7 +159,7 @@ if (abs($sconto) > 0) {
<b>'.tr('Imponibile', [], ['upper' => true]).':</b>
</td>
<td align="right">
'.moneyFormat($imponibile).'
'.moneyFormat($imponibile, 2).'
</td>
<td></td>
</tr>';
@ -170,7 +170,7 @@ if (abs($sconto) > 0) {
<b>'.tr('Sconto', [], ['upper' => true]).':</b>
</td>
<td align="right">
'.moneyFormat($sconto).'
'.moneyFormat($sconto, 2).'
</td>
<td></td>
</tr>';
@ -182,7 +182,7 @@ if (abs($sconto) > 0) {
<b>'.tr('Imponibile scontato', [], ['upper' => true]).':</b>
</td>
<td align="right">
'.moneyFormat($imponibile_scontato).'
'.moneyFormat($imponibile_scontato, 2).'
</td>
<td></td>
</tr>';
@ -194,7 +194,7 @@ if (abs($sconto) > 0) {
<b>'.tr('Imponibile', [], ['upper' => true]).':</b>
</td>
<td align="right">
'.moneyFormat($imponibile).'
'.moneyFormat($imponibile, 2).'
</td>
<td></td>
</tr>';
@ -207,7 +207,7 @@ echo '
<b>'.tr('IVA', [], ['upper' => true]).':</b>
</td>
<td align="right">
'.moneyFormat($iva).'
'.moneyFormat($iva, 2).'
</td>
<td></td>
</tr>';
@ -219,7 +219,7 @@ echo '
<b>'.tr('Totale', [], ['upper' => true]).':</b>
</td>
<td align="right">
'.moneyFormat($totale).'
'.moneyFormat($totale, 2).'
</td>
<td></td>
</tr>';

View File

@ -124,11 +124,11 @@ for ($i = 0; $i < count($rs); ++$i) {
</td>
<td align="right">
{[ "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).'" ]}
</td>
<td align="right">
{[ "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']).'" ]}
</td>
</tr>';
}
@ -169,7 +169,7 @@ echo '
]); ?>.
</div>
<input type="hidden" id="totale_da_pagare" value="<?php echo Translator::numberToLocale($totale_da_pagare); ?>">
<input type="hidden" id="totale_da_pagare" value="<?php echo Translator::numberToLocale($totale_da_pagare, 2); ?>">
</div>
</div>
</div>
@ -191,6 +191,8 @@ if($records[0]['iddocumento']==0){
?>
<script>
globals.cifre_decimali = 2;
$(document).ready( function(){
totale_ok();

View File

@ -130,9 +130,6 @@ class Prints
return false;
}
// Impostazione automatica della precisione a 2 numeri decimali
formatter()->setPrecision(2);
// Individuazione della configurazione
$directory = dirname($filename);
if (!empty($filename) && !directory($directory)) {

View File

@ -197,8 +197,8 @@ if ($options['pricing']) {
<b>'.tr('Imponibile', [], ['upper' => true]).':</b>
</td>
<th class="text-center">
<b>'.moneyFormat($imponibile).'</b>
<th class="text-right">
<b>'.moneyFormat($imponibile, 2).'</b>
</th>
</tr>';
@ -208,8 +208,8 @@ if ($options['pricing']) {
<b>'.tr('Sconto', [], ['upper' => true]).':</b>
</td>
<th class="text-center">
<b>-'.moneyFormat($sconto).'</b>
<th class="text-right">
<b>-'.moneyFormat($sconto, 2).'</b>
</th>
</tr>';
}
@ -220,8 +220,8 @@ if ($options['pricing']) {
<td colspan="3" class="text-right border-top">
<b>'.tr('Quotazione totale', [], ['upper' => true]).':</b>
</td>
<th class="text-center">
<b>'.moneyFormat($totale).'</b>
<th class="text-right">
<b>'.moneyFormat($totale, 2).'</b>
</th>
</tr>';
}

View File

@ -139,7 +139,7 @@ foreach ($rs_gen as $r) {
<td class='text-center'>";
if (empty($r['is_descrizione'])) {
echo '
'.Translator::numberToLocale($r['perc_iva']);
'.Translator::numberToLocale($r['perc_iva'], 0);
}
echo '
</td>';

View File

@ -21,7 +21,7 @@ if ($options['pricing']) {
echo "
<tr>
<td class='cell-padded text-right'>
".moneyFormat($imponibile).'
".moneyFormat($imponibile, 2).'
</td>
</tr>';
@ -35,7 +35,7 @@ if ($options['pricing']) {
<tr>
<td class='cell-padded text-right'>
".moneyFormat($iva).'
".moneyFormat($iva, 2).'
</td>
</tr>';
@ -49,7 +49,7 @@ if ($options['pricing']) {
<tr>
<td class='cell-padded text-right'>
".moneyFormat($totale).'
".moneyFormat($totale, 2).'
</td>
</tr>';
} else {

View File

@ -195,7 +195,7 @@ foreach ($righe as $r) {
<td class="text-center">';
if (empty($r['is_descrizione']) && empty($r['sconto_globale'])) {
echo '
'.Translator::numberToLocale($r['perc_iva']);
'.Translator::numberToLocale($r['perc_iva'], 0);
}
echo '
</td>

View File

@ -31,7 +31,7 @@ if (!empty($rs2)) {
<small>".Translator::dateToLocale($rs2[$i]['scadenza'])."</small>
</td>
<td style='width:50%;' class='text-right'>
<small>".moneyFormat($rs2[$i]['da_pagare']).'</small>
<small>".moneyFormat($rs2[$i]['da_pagare'], 2).'</small>
</td>
</tr>';
}
@ -75,11 +75,11 @@ if (!empty($v_iva)) {
</td>
<td class='text-right'>
<small>".moneyFormat($v_totale[$desc_iva])."</small>
<small>".moneyFormat($v_totale[$desc_iva], 2)."</small>
</td>
<td class='text-right'>
<small>".moneyFormat($v_iva[$desc_iva]).'</small>
<small>".moneyFormat($v_iva[$desc_iva], 2).'</small>
</td>
</tr>';
}
@ -132,28 +132,28 @@ echo "
<tr>
<td class='cell-padded text-center'>
".moneyFormat($imponibile).'
".moneyFormat($imponibile, 2).'
</td>';
if (!empty($sconto)) {
echo "
<td class='cell-padded text-center'>
".moneyFormat($sconto)."
".moneyFormat($sconto, 2)."
</td>
<td class='cell-padded text-center'>
".moneyFormat($imponibile - $sconto).'
".moneyFormat($imponibile - $sconto, 2).'
</td>';
}
echo "
<td class='cell-padded text-center'>
".moneyFormat($totale_iva)."
".moneyFormat($totale_iva, 2)."
</td>
<td class='cell-padded text-center'>
".moneyFormat($totale).'
".moneyFormat($totale, 2).'
</td>
</tr>';
@ -186,13 +186,13 @@ if (!empty($record['rivalsainps'])) {
<tr>
<td class="cell-padded text-center" colspan="'.$first_colspan.'">
'.moneyFormat($record['rivalsainps']).'
'.moneyFormat($record['rivalsainps'], 2).'
</td>';
echo '
<td class="cell-padded text-center" colspan="'.$second_colspan.'">
'.moneyFormat($totale).'
'.moneyFormat($totale, 2).'
</td>
</tr>';
}
@ -242,13 +242,13 @@ if (!empty($record['ritenutaacconto']) || !empty($fattura->totale_ritenuta_contr
<tr>
<td class="cell-padded text-center" colspan="'.$first_colspan.'">
'.moneyFormat($record['ritenutaacconto'] + $fattura->totale_ritenuta_contributi).'
'.moneyFormat($record['ritenutaacconto'] + $fattura->totale_ritenuta_contributi, 2).'
</td>';
echo '
<td class="cell-padded text-center" colspan="'.$second_colspan.'">
'.moneyFormat($totale - $record['ritenutaacconto'] - $fattura->totale_ritenuta_contributi).'
'.moneyFormat($totale - $record['ritenutaacconto'] - $fattura->totale_ritenuta_contributi, 2).'
</td>
</tr>';
}
@ -272,11 +272,11 @@ if (!empty($record['split_payment'])) {
echo '
<tr>
<td class="cell-padded text-center" colspan="'.$first_colspan.'">
'.moneyFormat($totale_iva).'
'.moneyFormat($totale_iva, 2).'
</td>
<td class="cell-padded text-center" colspan="'.$second_colspan.'">
'.moneyFormat($totale - $totale_iva - $record['ritenutaacconto'] - $fattura->totale_ritenuta_contributi).'
'.moneyFormat($totale - $totale_iva - $record['ritenutaacconto'] - $fattura->totale_ritenuta_contributi, 2).'
</td>
</tr>';
}

View File

@ -112,7 +112,7 @@ echo '
$totale = [];
// MATERIALE UTILIZZATO
// MATERIALE UTILIzZZATO
$rs2 = $dbo->fetchArray("SELECT *,
(SELECT codice FROM mg_articoli WHERE id=idarticolo) AS codice_art,
(SELECT GROUP_CONCAT(`serial` SEPARATOR ', ') FROM `mg_prodotti` WHERE `id_riga_intervento` = `mg_articoli_interventi`.`idintervento`) AS seriali
@ -182,7 +182,7 @@ if (!empty($rs2)) {
$netto = $r['prezzo_vendita'] * $r['qta'] - $r['sconto'];
echo '
<td class="text-center">
'.($options['pricing'] ? Translator::numberToLocale($netto) : '-').'
'.($options['pricing'] ? moneyFormat($netto) : '-').'
</td>
</tr>';
}
@ -199,7 +199,7 @@ if (!empty($rs2)) {
</td>
<th colspan="2" class="text-center">
<b>'.moneyFormat($costi_intervento['ricambi_scontato']).'</b>
<b>'.moneyFormat($costi_intervento['ricambi_scontato'], 2).'</b>
</th>
</tr>';
}
@ -293,7 +293,7 @@ if (!empty($rs2)) {
</td>
<th class="text-center">
<b>'.moneyFormat($costi_intervento['altro_scontato']).'</b>
<b>'.moneyFormat($costi_intervento['altro_scontato'], 2).'</b>
</th>
</tr>';
}
@ -390,14 +390,14 @@ $ore = get_ore_intervento($id_record);
echo '
<tr>
<td class="text-center">
<small>'.tr('Ore lavorate').':</small><br/><b>'.Translator::numberToLocale($ore).'</b>
<small>'.tr('Ore lavorate').':</small><br/><b>'.Translator::numberToLocale($ore, 2).'</b>
</td>';
// Costo totale manodopera
if ($options['pricing']) {
echo '
<td colspan="3" class="text-center">
<small>'.tr('Totale manodopera').':</small><br/><b>'.moneyFormat($costi_intervento['manodopera_addebito']).'</b>
<small>'.tr('Totale manodopera').':</small><br/><b>'.moneyFormat($costi_intervento['manodopera_addebito'], 2).'</b>
</td>';
} else {
echo '
@ -417,14 +417,14 @@ echo '
echo '
<tr>
<td class="text-center">
<small>'.tr('Km percorsi').':</small><br/><b>'.Translator::numberToLocale($records[0]['tot_km']).'</b>
<small>'.tr('Km percorsi').':</small><br/><b>'.Translator::numberToLocale($records[0]['tot_km'], 2).'</b>
</td>';
// Costo trasferta
if ($options['pricing']) {
echo '
<td class="text-center">
<small>'.tr('Costi di trasferta').':</small><br/><b>'.moneyFormat($records[0]['tot_km_consuntivo']).'</b>
<small>'.tr('Costi di trasferta').':</small><br/><b>'.moneyFormat($records[0]['tot_km_consuntivo'], 2).'</b>
</td>';
} else {
echo '
@ -435,7 +435,7 @@ if ($options['pricing']) {
if ($options['pricing']) {
echo '
<td class="text-center" colspan="2">
<small>'.tr('Diritto di chiamata').':</small><br/><b>'.moneyFormat($records[0]['tot_dirittochiamata']).'</b>
<small>'.tr('Diritto di chiamata').':</small><br/><b>'.moneyFormat($records[0]['tot_dirittochiamata'], 2).'</b>
</td>';
} else {
echo '
@ -453,7 +453,7 @@ if ($options['pricing']) {
</td>
<th class="text-center">
<b>'.moneyFormat($costi_intervento['totale_addebito']).'</b>
<b>'.moneyFormat($costi_intervento['totale_addebito'], 2).'</b>
</th>
</tr>';
@ -468,7 +468,7 @@ if ($options['pricing']) {
</td>
<th class="text-center">
<b>-'.moneyFormat($totale_sconto).'</b>
<b>-'.moneyFormat($totale_sconto, 2).'</b>
</th>
</tr>';
@ -480,7 +480,7 @@ if ($options['pricing']) {
</td>
<th class="text-center">
<b>'.moneyFormat($costi_intervento['totale_scontato']).'</b>
<b>'.moneyFormat($costi_intervento['totale_scontato'], 2).'</b>
</th>
</tr>';
}
@ -494,7 +494,7 @@ if ($options['pricing']) {
</td>
<th class="text-center">
<b>'.moneyFormat($costi_intervento['iva_totale']).'</b>
<b>'.moneyFormat($costi_intervento['iva_totale'], 2).'</b>
</th>
</tr>';
@ -505,7 +505,7 @@ if ($options['pricing']) {
<b>'.tr('Totale intervento', [], ['upper' => true]).':</b>
</td>
<th class="text-center">
<b>'.moneyFormat($costi_intervento['totale']).'</b>
<b>'.moneyFormat($costi_intervento['totale'], 2).'</b>
</th>
</tr>';
}

View File

@ -180,7 +180,7 @@ foreach ($righe as $r) {
<td class="text-center">';
if (empty($r['is_descrizione'])) {
echo '
'.Translator::numberToLocale($r['perc_iva']);
'.Translator::numberToLocale($r['perc_iva'], 0);
}
echo '
</td>
@ -212,8 +212,8 @@ if ($options['pricing']) {
<b>'.tr('Imponibile', [], ['upper' => true]).':</b>
</td>
<th colspan="2" class="text-center">
<b>'.moneyFormat($imponibile).'</b>
<th colspan="2" class="text-right">
<b>'.moneyFormat($imponibile, 2).'</b>
</th>
</tr>';
@ -225,8 +225,8 @@ if ($options['pricing']) {
<b>'.tr('Sconto', [], ['upper' => true]).':</b>
</td>
<th colspan="2" class="text-center">
<b>-'.moneyFormat($sconto).'</b>
<th colspan="2" class="text-right">
<b>-'.moneyFormat($sconto, 2).'</b>
</th>
</tr>';
@ -237,8 +237,8 @@ if ($options['pricing']) {
<b>'.tr('Imponibile scontato', [], ['upper' => true]).':</b>
</td>
<th colspan="2" class="text-center">
<b>'.moneyFormat($totale).'</b>
<th colspan="2" class="text-right">
<b>'.moneyFormat($totale, 2).'</b>
</th>
</tr>';
}
@ -250,8 +250,8 @@ if ($options['pricing']) {
<b>'.tr('Totale IVA', [], ['upper' => true]).':</b>
</td>
<th colspan="2" class="text-center">
<b>'.moneyFormat($iva).'</b>
<th colspan="2" class="text-right">
<b>'.moneyFormat($iva, 2).'</b>
</th>
</tr>';
@ -263,8 +263,8 @@ if ($options['pricing']) {
<td colspan="'.(($has_image) ? 4 : 3).'" class="text-right border-top">
<b>'.tr('Quotazione totale', [], ['upper' => true]).':</b>
</td>
<th colspan="2" class="text-center">
<b>'.moneyFormat($totale).'</b>
<th colspan="2" class="text-right">
<b>'.moneyFormat($totale, 2).'</b>
</th>
</tr>';
}

View File

@ -70,18 +70,18 @@ if ($_GET['lev'] == '3') {
$avere = '';
}
$body .= " <tr><td class='br bb padded'></td><td class='br bb padded'><b>SALDO INIZIALE</b></td><td class='br bb padded text-right'><b>".Translator::numberToLocale(abs($dare))."</b></td><td class='bb padded text-right'><b>".Translator::numberToLocale(abs($avere))."</b></td></tr>\n";
$body .= " <tr><td class='br bb padded'></td><td class='br bb padded'><b>SALDO INIZIALE</b></td><td class='br bb padded text-right'><b>".moneyFormat(abs($dare), 2)."</b></td><td class='bb padded text-right'><b>".moneyFormat(abs($avere), 2)."</b></td></tr>\n";
$rs = $dbo->fetchArray('SELECT * FROM co_movimenti WHERE idconto="'.$idconto.'" AND data >= "'.$date_start.'" AND data <= "'.$date_end.'" ORDER BY data ASC');
// Inizializzo saldo finale
$saldo_finale2 = [];
for ($i = 0; $i < sizeof($rs); ++$i) {
if ($rs[$i]['totale'] >= 0) {
$dare = Translator::numberToLocale(abs($rs[$i]['totale']));
$dare = moneyFormat(abs($rs[$i]['totale']), 2);
$avere = '';
} else {
$dare = '';
$avere = Translator::numberToLocale(abs($rs[$i]['totale']));
$avere = moneyFormat(abs($rs[$i]['totale']), 2);
}
$body .= " <tr><td class='br bb padded text-center'>".Translator::dateToLocale($rs[$i]['data'])."</td><td class='br bb padded'>".$rs[$i]['descrizione']."</td><td class='br bb padded text-right'>".$dare."</td><td class='bb padded text-right'>".$avere."</td></tr>\n";
@ -98,7 +98,7 @@ if ($_GET['lev'] == '3') {
}
// Mostro il saldo finale
$body .= " <tr><td class='br bb padded'></td><td class='br bb padded'><b>SALDO FINALE</b></td><td class='br bb padded text-right'><b>".Translator::numberToLocale(abs(sum($dare)))."</b></td><td class='bb padded text-right'><b>".Translator::numberToLocale(abs(sum($avere)))."</b></td></tr>\n";
$body .= " <tr><td class='br bb padded'></td><td class='br bb padded'><b>SALDO FINALE</b></td><td class='br bb padded text-right'><b>".moneyFormat(abs(sum($dare)), 2)."</b></td><td class='bb padded text-right'><b>".moneyFormat(abs(sum($avere)), 2)."</b></td></tr>\n";
$body .= " </tbody>
</table>\n";
@ -144,11 +144,11 @@ elseif ($_GET['lev'] == '2') {
$totale = sum($v_dare) - sum($v_avere);
if ($totale >= 0) {
$dare = Translator::numberToLocale(abs($totale));
$dare = moneyFormat(abs($totale), 2);
$avere = '';
} else {
$dare = '';
$avere = Translator::numberToLocale(abs($totale));
$avere = moneyFormat(abs($totale), 2);
}
// Mostro il saldo finale del conto di livello 3
@ -212,16 +212,16 @@ elseif (get('lev') == '1') {
}
// Mostro il saldo finale del conto di livello 3
$body .= " <tr><td class='br bb padded'></td><td class='br bb padded'>".$rs3[$z]['numero'].' '.$rs3[$z]['descrizione']."</td><td class='br bb padded text-right'>".Translator::numberToLocale(abs($dare))."</td><td class='bb padded text-right'>".Translator::numberToLocale(abs($avere))."</td></tr>\n";
$body .= " <tr><td class='br bb padded'></td><td class='br bb padded'>".$rs3[$z]['numero'].' '.$rs3[$z]['descrizione']."</td><td class='br bb padded text-right'>".moneyFormat(abs($dare),2)."</td><td class='bb padded text-right'>".moneyFormat(abs($avere), 2)."</td></tr>\n";
}
}
}
// Stampa "Costi/Ricavi" se conto economico
if ($rs1[0]['descrizione'] == 'Economico') {
$body .= " <tr><th colspan='3' class='br bb padded'>RICAVI</th><th align='right' class='bb padded'>".Translator::numberToLocale(sum($ricavi))."</th></tr>\n";
$body .= " <tr><th colspan='3' class='br bb padded'>COSTI</th><th align='right' class='bb padded'>".Translator::numberToLocale(sum($costi))."</th></tr>\n";
$body .= " <tr><th colspan='3' class='br padded'>UTILE</th><th class='padded' align='right'>".Translator::numberToLocale(sum($ricavi) - sum($costi))."</th></tr>\n";
$body .= " <tr><th colspan='3' class='br bb padded'>RICAVI</th><th align='right' class='bb padded'>".moneyFormat(sum($ricavi), 2)."</th></tr>\n";
$body .= " <tr><th colspan='3' class='br bb padded'>COSTI</th><th align='right' class='bb padded'>".moneyFormat(sum($costi),2)."</th></tr>\n";
$body .= " <tr><th colspan='3' class='br padded'>UTILE</th><th class='padded' align='right'>".moneyFormat(sum($ricavi) - sum($costi),2)."</th></tr>\n";
}
// Stampa "Attività/Passività" se stato patrimoniale
@ -291,14 +291,14 @@ elseif (get('lev') == '1') {
<tbody>\n";
// Attività
$body .= " <tr><th class='br bb padded'>TOTALE ATTIVIT&Agrave;</th><th align='right' class='bb br padded'>".Translator::numberToLocale($totale_attivita)."</th>\n";
$body .= " <tr><th class='br bb padded'>TOTALE ATTIVIT&Agrave;</th><th align='right' class='bb br padded'>".moneyFormat($totale_attivita, 2)."</th>\n";
// Passività
$body .= " <th class='br bb padded'>PASSIVIT&Agrave;</th><th align='right' class='bb padded'>".Translator::numberToLocale($totale_passivita)."</th></tr>\n";
$body .= " <th class='br bb padded'>PASSIVIT&Agrave;</th><th align='right' class='bb padded'>".moneyFormat($totale_passivita, 2)."</th></tr>\n";
if ($utile_perdita < 0) {
// Perdita d'esercizio
$body .= " <tr><th class='br bb padded'>PERDITA D'ESERCIZIO</th><th align='right' class='bb br padded'>".Translator::numberToLocale(abs($utile_perdita))."</th>\n";
$body .= " <tr><th class='br bb padded'>PERDITA D'ESERCIZIO</th><th align='right' class='bb br padded'>".moneyFormat(abs($utile_perdita), 2)."</th>\n";
// Utile
$body .= " <th class='br bb padded'>&nbsp;</th><th align='right' class='bb padded'>&nbsp;</th></tr>\n";
@ -307,14 +307,14 @@ elseif (get('lev') == '1') {
$body .= " <tr><th class='br bb padded'>&nbsp;</th><th align='right' class='bb br padded'>&nbsp;</th>\n";
// Utile
$body .= " <th class='br bb padded'>UTILE</th><th align='right' class='bb padded'>".Translator::numberToLocale(abs($utile_perdita))."</th></tr>\n";
$body .= " <th class='br bb padded'>UTILE</th><th align='right' class='bb padded'>" .moneyFormat(abs($utile_perdita), 2)."</th></tr>\n";
}
// PAREGGIO 1
$body .= " <tr><th class='br padded'>TOTALE A PAREGGIO</th><th align='right' class='br padded'>".Translator::numberToLocale($pareggio1)."</th>\n";
$body .= " <tr><th class='br padded'>TOTALE A PAREGGIO</th><th align='right' class='br padded'>".moneyFormat($pareggio1, 2)."</th>\n";
// PAREGGIO 2
$body .= " <th class='br padded'>TOTALE A PAREGGIO</th><th align='right' class='padded'>".Translator::numberToLocale($pareggio2)."</th></tr>\n";
$body .= " <th class='br padded'>TOTALE A PAREGGIO</th><th align='right' class='padded'>".moneyFormat($pareggio2, 2)."</th></tr>\n";
}
$body .= " </tbody>

View File

@ -171,7 +171,7 @@ foreach ($righe as $r) {
<td class="text-center">';
if (empty($r['is_descrizione'])) {
echo '
'.Translator::numberToLocale($r['perc_iva']);
'.Translator::numberToLocale($r['perc_iva'], 0);
}
echo '
</td>
@ -203,8 +203,8 @@ if ($options['pricing'] and !isset($options['hide_total'])) {
<b>'.tr('Imponibile', [], ['upper' => true]).':</b>
</td>
<th colspan="2" class="text-center">
<b>'.moneyFormat($imponibile).'</b>
<th colspan="2" class="text-right">
<b>'.moneyFormat($imponibile, 2).'</b>
</th>
</tr>';
@ -216,8 +216,8 @@ if ($options['pricing'] and !isset($options['hide_total'])) {
<b>'.tr('Sconto', [], ['upper' => true]).':</b>
</td>
<th colspan="2" class="text-center">
<b>-'.moneyFormat($sconto).'</b>
<th colspan="2" class="text-right">
<b>-'.moneyFormat($sconto, 2).'</b>
</th>
</tr>';
@ -228,8 +228,8 @@ if ($options['pricing'] and !isset($options['hide_total'])) {
<b>'.tr('Imponibile scontato', [], ['upper' => true]).':</b>
</td>
<th colspan="2" class="text-center">
<b>'.moneyFormat($totale).'</b>
<th colspan="2" class="text-right">
<b>'.moneyFormat($totale, 2).'</b>
</th>
</tr>';
}
@ -241,8 +241,8 @@ if ($options['pricing'] and !isset($options['hide_total'])) {
<b>'.tr('Totale IVA', [], ['upper' => true]).':</b>
</td>
<th colspan="2" class="text-center">
<b>'.moneyFormat($iva).'</b>
<th colspan="2" class="text-right">
<b>'.moneyFormat($iva, 2).'</b>
</th>
</tr>';
@ -254,8 +254,8 @@ if ($options['pricing'] and !isset($options['hide_total'])) {
<td colspan="3" class="text-right border-top">
<b>'.tr('Quotazione totale', [], ['upper' => true]).':</b>
</td>
<th colspan="2" class="text-center">
<b>'.moneyFormat($totale).'</b>
<th colspan="2" class="text-right">
<b>'.moneyFormat($totale, 2).'</b>
</th>
</tr>';
}

View File

@ -49,8 +49,8 @@ for ($i = 0; $i < sizeof($rs); ++$i) {
$body .= ' <td>'.$rs[$i]['Anagrafica']."</td>\n";
$body .= ' <td>'.$rs[$i]['Tipo di pagamento']."</td>\n";
$body .= " <td align='center'>".$rs[$i]['Data scadenza']."</td>\n";
$body .= " <td align='right'>".Translator::numberToLocale($rs[$i]['Importo'])."</td>\n";
$body .= " <td align='right'>".Translator::numberToLocale($rs[$i]['Pagato'])."</td>\n";
$body .= " <td align='right'>".moneyFormat($rs[$i]['Importo'], 2)."</td>\n";
$body .= " <td align='right'>".moneyFormat($rs[$i]['Pagato'], 2)."</td>\n";
$body .= " </tr>\n";
$totale_da_pagare += $rs[$i]['Importo'];
@ -58,7 +58,7 @@ for ($i = 0; $i < sizeof($rs); ++$i) {
}
$body .= " <tr>\n";
$body .= " <td colspan='4' align='right'><b>TOTALE:</b></td><td align='right'>".Translator::numberToLocale($totale_da_pagare)."</td><td align='right'>".Translator::numberToLocale($totale_pagato)."</td>\n";
$body .= " <td colspan='4' align='right'><b>TOTALE:</b></td><td align='right'>".moneyFormat($totale_da_pagare, 2)."</td><td align='right'>".moneyFormat($totale_pagato, 2)."</td>\n";
$body .= " </tr>\n";
$body .= "</tbody>\n";