1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-02-18 04:20:50 +01:00

Aggiornamento elenco righe dei documenti

This commit is contained in:
Thomas Zilio 2020-02-28 11:38:24 +01:00
parent 3b4add5592
commit ec93a1ab62
6 changed files with 207 additions and 244 deletions

View File

@ -66,6 +66,16 @@ abstract class Row extends Description
return ($this->prezzo_unitario_ivato - $this->sconto_unitario_ivato) * $this->qta; return ($this->prezzo_unitario_ivato - $this->sconto_unitario_ivato) * $this->qta;
} }
/**
* Restituisce l'importo (unitario oppure unitario ivato a seconda dell'impostazione 'Utilizza prezzi di vendita con IVA incorporata') per la riga.
*
* @return float
*/
public function getImportoAttribute()
{
return $this->incorporaIVA() ? $this->totale : $this->totale_imponibile;
}
/** /**
* Restituisce la spesa (costo_unitario * qta) relativa all'elemento. * Restituisce la spesa (costo_unitario * qta) relativa all'elemento.
* *

View File

@ -7,11 +7,10 @@ echo '
<thead> <thead>
<tr> <tr>
<th>'.tr('Descrizione').'</th> <th>'.tr('Descrizione').'</th>
<th width="120">'.tr('Q.').' <i title="'.tr('da evadere').' / '.tr('totale').'" class="tip fa fa-question-circle-o"></i></th> <th class="text-center tip" width="150" title="'.tr('da evadere').' / '.tr('totale').'">'.tr('Q.').' <i class="fa fa-question-circle-o"></i></th>
<th width="80">'.tr('U.m.').'</th> <th class="text-center" width="150">'.tr('Prezzo unitario').'</th>
<th width="120">'.tr('Costo unitario').'</th> <th class="text-center" width="150">'.tr('Iva unitaria').'</th>
<th width="120">'.tr('Iva').'</th> <th class="text-center" width="150">'.tr('Importo').'</th>
<th width="120">'.tr('Imponibile').'</th>
<th width="60"></th> <th width="60"></th>
</tr> </tr>
</thead> </thead>
@ -28,6 +27,7 @@ foreach ($righe as $riga) {
if ($riga->isArticolo()) { if ($riga->isArticolo()) {
$descrizione = Modules::link('Articoli', $riga->idarticolo, $riga->articolo->codice.' - '.$descrizione); $descrizione = Modules::link('Articoli', $riga->idarticolo, $riga->articolo->codice.' - '.$descrizione);
} }
echo ' echo '
<td> <td>
'.$descrizione.' '.$descrizione.'
@ -38,48 +38,48 @@ foreach ($righe as $riga) {
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
<td></td>'; <td></td>';
} else { } else {
// Q.tà // Quantità e unità di misura
echo ' echo '
<td class="text-center"> <td class="text-center">
'.Translator::numberToLocale($riga->qta_rimanente, 'qta').' / '.Translator::numberToLocale($riga->qta, 'qta').' '.numberFormat($riga->qta_rimanente, 'qta').' / '.numberFormat($riga->qta, 'qta').' '.$r['um'].'
</td>'; </td>';
// Unità di misura // Prezzi unitari
echo ' echo '
<td class="text-center"> <td class="text-right">
'.$riga->um.' '.moneyFormat($riga->prezzo_unitario_corrente);
</td>';
// Costo unitario if ($dir == 'entrata' && $riga->costo_unitario != 0) {
echo ' echo '
<td class="text-right"> <br><small>
'.moneyFormat($riga->prezzo_unitario); '.tr('Acquisto').': '.moneyFormat($riga->costo_unitario).'
</small>';
}
if (abs($riga->sconto_unitario) > 0) { if (abs($riga->sconto_unitario) > 0) {
$text = discountInfo($riga); $text = discountInfo($riga);
echo ' echo '
<br><small class="label label-danger">'.$text.'</small>'; <br><small class="label label-danger">'.$text.'</small>';
} }
echo'
</td>';
// IVA
echo ' echo '
<td class="text-right"> </td>';
'.moneyFormat($riga->iva).'<br>
<small class="help-block">'.$riga->aliquota->descrizione.(($riga->aliquota->esente) ? ' ('.$riga->aliquota->codice_natura_fe.')' : null).'</small>
</td>';
// Imponibile // Iva
echo ' echo '
<td class="text-right"> <td class="text-right">
'.moneyFormat($riga->totale_imponibile).' '.moneyFormat($riga->iva_unitaria).'
</td>'; <br><small class="'.(($riga->aliquota->deleted_at) ? 'text-red' : '').' help-block">'.$riga->aliquota->descrizione.(($riga->aliquota->esente) ? ' ('.$riga->aliquota->codice_natura_fe.')' : null).'</small>
</td>';
// Importo
echo '
<td class="text-right">
'.moneyFormat($riga->importo).'
</td>';
} }
// Possibilità di rimuovere una riga solo se il preventivo non è stato pagato // Possibilità di rimuovere una riga solo se il preventivo non è stato pagato
@ -140,7 +140,7 @@ $totale = abs($contratto->totale);
// Totale totale imponibile // Totale totale imponibile
echo ' echo '
<tr> <tr>
<td colspan="5" class="text-right"> <td colspan="4" class="text-right">
<b>'.tr('Imponibile', [], ['upper' => true]).':</b> <b>'.tr('Imponibile', [], ['upper' => true]).':</b>
</td> </td>
<td class="text-right"> <td class="text-right">
@ -153,7 +153,7 @@ echo '
if (!empty($sconto)) { if (!empty($sconto)) {
echo ' echo '
<tr> <tr>
<td colspan="5" class="text-right"> <td colspan="4" class="text-right">
<b><span class="tip" title="'.tr('Un importo positivo indica uno sconto, mentre uno negativo indica una maggiorazione').'"> <i class="fa fa-question-circle-o"></i> '.tr('Sconto/maggiorazione', [], ['upper' => true]).':</span></b> <b><span class="tip" title="'.tr('Un importo positivo indica uno sconto, mentre uno negativo indica una maggiorazione').'"> <i class="fa fa-question-circle-o"></i> '.tr('Sconto/maggiorazione', [], ['upper' => true]).':</span></b>
</td> </td>
<td class="text-right"> <td class="text-right">
@ -165,7 +165,7 @@ if (!empty($sconto)) {
// Totale totale imponibile // Totale totale imponibile
echo ' echo '
<tr> <tr>
<td colspan="5" class="text-right"> <td colspan="4" class="text-right">
<b>'.tr('Totale imponibile', [], ['upper' => true]).':</b> <b>'.tr('Totale imponibile', [], ['upper' => true]).':</b>
</td> </td>
<td class="text-right"> <td class="text-right">
@ -178,7 +178,7 @@ if (!empty($sconto)) {
// Totale iva // Totale iva
echo ' echo '
<tr> <tr>
<td colspan="5" class="text-right"> <td colspan="4" class="text-right">
<b>'.tr('Iva', [], ['upper' => true]).':</b> <b>'.tr('Iva', [], ['upper' => true]).':</b>
</td> </td>
<td class="text-right"> <td class="text-right">
@ -190,7 +190,7 @@ echo '
// Totale contratto // Totale contratto
echo ' echo '
<tr> <tr>
<td colspan="5" class="text-right"> <td colspan="4" class="text-right">
<b>'.tr('Totale', [], ['upper' => true]).':</b> <b>'.tr('Totale', [], ['upper' => true]).':</b>
</td> </td>
<td class="text-right"> <td class="text-right">

View File

@ -4,15 +4,16 @@ include_once __DIR__.'/../../core.php';
echo ' echo '
<table class="table table-striped table-hover table-condensed table-bordered"> <table class="table table-striped table-hover table-condensed table-bordered">
<tr> <thead>
<th>'.tr('Descrizione').'</th> <tr>
<th width="120">'.tr('Q.').' <i title="'.tr('da evadere').' / '.tr('totale').'" class="tip fa fa-question-circle-o"></i></th> <th>'.tr('Descrizione').'</th>
<th width="80">'.tr('U.m.').'</th> <th class="text-center tip" width="150" title="'.tr('da evadere').' / '.tr('totale').'">'.tr('Q.').' <i class="fa fa-question-circle-o"></i></th>
<th width="120">'.tr('Costo unitario').'</th> <th class="text-center" width="150">'.tr('Prezzo unitario').'</th>
<th width="120">'.tr('Iva').'</th> <th class="text-center" width="150">'.tr('Iva unitaria').'</th>
<th width="120">'.tr('Imponibile').'</th> <th class="text-center" width="150">'.tr('Importo').'</th>
<th width="60"></th> <th width="60"></th>
</tr> </tr>
</thead>
<tbody class="sortable">'; <tbody class="sortable">';
@ -72,65 +73,54 @@ foreach ($righe as $riga) {
echo ' echo '
</td>'; </td>';
echo ' if ($riga->isDescrizione()) {
<td class="text-center">';
if (empty($r['is_descrizione'])) {
echo ' echo '
<span>'.Translator::numberToLocale($r['qta'] - $r['qta_evasa'], 'qta').' / '.Translator::numberToLocale($r['qta'], 'qta').'</span>'; <td></td>
} <td></td>
echo ' <td></td>
<td></td>';
} else {
// Quantità e unità di misura
echo '
<td class="text-center">
'.numberFormat($riga->qta_rimanente, 'qta').' / '.numberFormat($riga->qta, 'qta').' '.$r['um'].'
</td>'; </td>';
// Unità di misura // Prezzi unitari
echo '
<td class="text-center">';
if (empty($r['is_descrizione'])) {
echo ' echo '
'.$r['um']; <td class="text-right">
} '.moneyFormat($riga->prezzo_unitario_corrente);
echo '
</td>';
// Costo unitario if ($dir == 'entrata' && $riga->costo_unitario != 0) {
echo ' echo '
<td class="text-right">'; <br><small>
if (empty($r['is_descrizione'])) { '.tr('Acquisto').': '.moneyFormat($riga->costo_unitario).'
echo ' </small>';
'.moneyFormat($r['subtotale'] / $r['qta']); }
if (abs($r['sconto_unitario']) > 0) { if (abs($riga->sconto_unitario) > 0) {
$text = $r['sconto_unitario'] > 0 ? tr('sconto _TOT_ _TYPE_') : tr('maggiorazione _TOT_ _TYPE_'); $text = discountInfo($riga);
echo ' echo '
<br><small class="label label-danger">'.replace($text, [ <br><small class="label label-danger">'.$text.'</small>';
'_TOT_' => Translator::numberToLocale(abs($r['sconto_unitario'])),
'_TYPE_' => ($r['tipo_sconto'] == 'PRC' ? '%' : currency()),
]).'</small>';
} }
}
echo ' echo '
</td>'; </td>';
// Iva // Iva
echo '
<td class="text-right">';
if (empty($r['is_descrizione'])) {
echo ' echo '
'.moneyFormat($r['iva']).' <td class="text-right">
<br><small class="help-block">'.$r['desc_iva'].'</small>'; '.moneyFormat($riga->iva_unitaria).'
} <br><small class="'.(($riga->aliquota->deleted_at) ? 'text-red' : '').' help-block">'.$riga->aliquota->descrizione.(($riga->aliquota->esente) ? ' ('.$riga->aliquota->codice_natura_fe.')' : null).'</small>
echo '
</td>'; </td>';
// Imponibile // Importo
echo '
<td class="text-right">';
if (empty($r['is_descrizione'])) {
echo ' echo '
'.moneyFormat($r['subtotale'] - $r['sconto']); <td class="text-right">
} '.moneyFormat($riga->importo).'
echo '
</td>'; </td>';
}
// Possibilità di rimuovere una riga solo se il ddt non è evaso // Possibilità di rimuovere una riga solo se il ddt non è evaso
echo ' echo '
@ -187,7 +177,7 @@ $totale = abs($ddt->totale);
// IMPONIBILE // IMPONIBILE
echo ' echo '
<tr> <tr>
<td colspan="5" class="text-right"> <td colspan="4" class="text-right">
<b>'.tr('Imponibile', [], ['upper' => true]).':</b> <b>'.tr('Imponibile', [], ['upper' => true]).':</b>
</td> </td>
@ -202,7 +192,7 @@ echo '
if (!empty($sconto)) { if (!empty($sconto)) {
echo ' echo '
<tr> <tr>
<td colspan="5" class="text-right"> <td colspan="4" class="text-right">
<b><span class="tip" title="'.tr('Un importo positivo indica uno sconto, mentre uno negativo indica una maggiorazione').'"> <i class="fa fa-question-circle-o"></i> '.tr('Sconto/maggiorazione', [], ['upper' => true]).':</span></b> <b><span class="tip" title="'.tr('Un importo positivo indica uno sconto, mentre uno negativo indica una maggiorazione').'"> <i class="fa fa-question-circle-o"></i> '.tr('Sconto/maggiorazione', [], ['upper' => true]).':</span></b>
</td> </td>
@ -216,7 +206,7 @@ if (!empty($sconto)) {
// TOTALE IMPONIBILE // TOTALE IMPONIBILE
echo ' echo '
<tr> <tr>
<td colspan="5" class="text-right"> <td colspan="4" class="text-right">
<b>'.tr('Totale imponibile', [], ['upper' => true]).':</b> <b>'.tr('Totale imponibile', [], ['upper' => true]).':</b>
</td> </td>
@ -231,7 +221,7 @@ if (!empty($sconto)) {
// IVA // IVA
echo ' echo '
<tr> <tr>
<td colspan="5" class="text-right"> <td colspan="4" class="text-right">
<b>'.tr('IVA', [], ['upper' => true]).':</b> <b>'.tr('IVA', [], ['upper' => true]).':</b>
</td> </td>
@ -245,7 +235,7 @@ echo '
// TOTALE // TOTALE
echo ' echo '
<tr> <tr>
<td colspan="5" class="text-right"> <td colspan="4" class="text-right">
<b>'.tr('Totale', [], ['upper' => true]).':</b> <b>'.tr('Totale', [], ['upper' => true]).':</b>
</td> </td>

View File

@ -7,11 +7,10 @@ echo '
<thead> <thead>
<tr> <tr>
<th>'.tr('Descrizione').'</th> <th>'.tr('Descrizione').'</th>
<th width="120">'.tr('Q.').'</th> <th class="text-center" width="150">'.tr('Q.').'</th>
<th width="80">'.tr('U.m.').'</th> <th class="text-center" width="150">'.tr('Prezzo unitario').'</th>
<th width="120">'.tr('Prezzo unitario').'</th> <th class="text-center" width="150">'.tr('Iva unitaria').'</th>
<th width="120">'.tr('Iva').'</th> <th class="text-center" width="150">'.tr('Importo').'</th>
<th width="120">'.tr('Importo').'</th>
<th width="60"></th> <th width="60"></th>
</tr> </tr>
</thead> </thead>
@ -152,36 +151,23 @@ foreach ($righe as $riga) {
echo ' echo '
</td>'; </td>';
echo ' if ($riga->isDescrizione()) {
<td class="text-center">';
if (!$riga->isDescrizione()) {
echo ' echo '
'.Translator::numberToLocale($r['qta'], 'qta'); <td></td>
} <td></td>
<td></td>
echo ' <td></td>';
} else {
// Quantità e unità di misura
echo '
<td class="text-center">
'.numberFormat($riga->qta, 'qta').' '.$r['um'].'
</td>'; </td>';
// Unità di misura // Prezzi unitari
echo '
<td class="text-center">';
if (!$riga->isDescrizione()) {
echo ' echo '
'.$r['um']; <td class="text-right">
} '.moneyFormat($riga->prezzo_unitario_corrente);
echo '
</td>';
// Prezzi unitari
echo '
<td class="text-right">';
if (!$riga->isDescrizione()) {
echo '
'.moneyFormat($riga->prezzo_unitario);
if ($dir == 'entrata' && $riga->costo_unitario != 0) { if ($dir == 'entrata' && $riga->costo_unitario != 0) {
echo ' echo '
@ -196,34 +182,24 @@ foreach ($righe as $riga) {
echo ' echo '
<br><small class="label label-danger">'.$text.'</small>'; <br><small class="label label-danger">'.$text.'</small>';
} }
}
echo '
</td>';
// Iva
echo '
<td class="text-right">';
if (!$riga->isDescrizione()) {
echo ' echo '
'.moneyFormat($r['iva']).'
<br><small class="'.(($riga->aliquota->deleted_at) ? 'text-red' : '').' help-block">'.$riga->aliquota->descrizione.(($riga->aliquota->esente) ? ' ('.$riga->aliquota->codice_natura_fe.')' : null).'</small>';
}
echo '
</td>'; </td>';
// Importo // Iva
echo '
<td class="text-right">';
if (!$riga->isDescrizione()) {
echo ' echo '
'.moneyFormat($r['totale_imponibile']); <td class="text-right">
} '.moneyFormat($riga->iva_unitaria).'
echo ' <br><small class="'.(($riga->aliquota->deleted_at) ? 'text-red' : '').' help-block">'.$riga->aliquota->descrizione.(($riga->aliquota->esente) ? ' ('.$riga->aliquota->codice_natura_fe.')' : null).'</small>
</td>'; </td>';
// Importo
echo '
<td class="text-right">
'.moneyFormat($riga->importo).'
</td>';
}
// Possibilità di rimuovere una riga solo se la fattura non è pagata // Possibilità di rimuovere una riga solo se la fattura non è pagata
echo ' echo '
<td class="text-center">'; <td class="text-center">';
@ -289,7 +265,7 @@ $netto_a_pagare = abs($fattura->netto);
// IMPONIBILE // IMPONIBILE
echo ' echo '
<tr> <tr>
<td colspan="5" class="text-right"> <td colspan="4" class="text-right">
<b>'.tr('Imponibile', [], ['upper' => true]).':</b> <b>'.tr('Imponibile', [], ['upper' => true]).':</b>
</td> </td>
<td align="right"> <td align="right">
@ -302,7 +278,7 @@ echo '
if (!empty($sconto)) { if (!empty($sconto)) {
echo ' echo '
<tr> <tr>
<td colspan="5" class="text-right"> <td colspan="4" class="text-right">
<b><span class="tip" title="'.tr('Un importo positivo indica uno sconto, mentre uno negativo indica una maggiorazione').'"><i class="fa fa-question-circle-o"></i> '.tr('Sconto/maggiorazione', [], ['upper' => true]).':</span></b> <b><span class="tip" title="'.tr('Un importo positivo indica uno sconto, mentre uno negativo indica una maggiorazione').'"><i class="fa fa-question-circle-o"></i> '.tr('Sconto/maggiorazione', [], ['upper' => true]).':</span></b>
</td> </td>
<td align="right"> <td align="right">
@ -314,7 +290,7 @@ if (!empty($sconto)) {
// TOTALE IMPONIBILE // TOTALE IMPONIBILE
echo ' echo '
<tr> <tr>
<td colspan="5" class="text-right"> <td colspan="4" class="text-right">
<b>'.tr('Totale imponibile', [], ['upper' => true]).':</b> <b>'.tr('Totale imponibile', [], ['upper' => true]).':</b>
</td> </td>
<td align="right"> <td align="right">
@ -328,7 +304,7 @@ if (!empty($sconto)) {
if (!empty($fattura->rivalsa_inps)) { if (!empty($fattura->rivalsa_inps)) {
echo ' echo '
<tr> <tr>
<td colspan="5" class="text-right">'; <td colspan="4" class="text-right">';
if ($dir == 'entrata') { if ($dir == 'entrata') {
echo ' echo '
@ -349,7 +325,7 @@ if (!empty($fattura->rivalsa_inps)) {
if (!empty($iva)) { if (!empty($iva)) {
echo ' echo '
<tr> <tr>
<td colspan="5" class="text-right">'; <td colspan="4" class="text-right">';
if ($records[0]['split_payment']) { if ($records[0]['split_payment']) {
echo '<b>'.tr('Iva a carico del destinatario', [], ['upper' => true]).':</b>'; echo '<b>'.tr('Iva a carico del destinatario', [], ['upper' => true]).':</b>';
@ -368,7 +344,7 @@ if (!empty($iva)) {
// TOTALE // TOTALE
echo ' echo '
<tr> <tr>
<td colspan="5" class="text-right"> <td colspan="4" class="text-right">
<b>'.tr('Totale', [], ['upper' => true]).':</b> <b>'.tr('Totale', [], ['upper' => true]).':</b>
</td> </td>
<td align="right"> <td align="right">
@ -381,7 +357,7 @@ echo '
if (!empty($fattura->ritenuta_acconto)) { if (!empty($fattura->ritenuta_acconto)) {
echo ' echo '
<tr> <tr>
<td colspan="5" class="text-right"> <td colspan="4" class="text-right">
<b>'.tr("Ritenuta d'acconto", [], ['upper' => true]).':</b> <b>'.tr("Ritenuta d'acconto", [], ['upper' => true]).':</b>
</td> </td>
<td align="right"> <td align="right">
@ -395,7 +371,7 @@ if (!empty($fattura->ritenuta_acconto)) {
if (!empty($fattura->totale_ritenuta_contributi)) { if (!empty($fattura->totale_ritenuta_contributi)) {
echo ' echo '
<tr> <tr>
<td colspan="5" class="text-right"> <td colspan="4" class="text-right">
<b>'.tr('Ritenuta contributi', [], ['upper' => true]).':</b> <b>'.tr('Ritenuta contributi', [], ['upper' => true]).':</b>
</td> </td>
<td align="right"> <td align="right">
@ -409,7 +385,7 @@ if (!empty($fattura->totale_ritenuta_contributi)) {
if ($totale != $netto_a_pagare) { if ($totale != $netto_a_pagare) {
echo ' echo '
<tr> <tr>
<td colspan="5" class="text-right"> <td colspan="4" class="text-right">
<b>'.tr('Netto a pagare', [], ['upper' => true]).':</b> <b>'.tr('Netto a pagare', [], ['upper' => true]).':</b>
</td> </td>
<td align="right"> <td align="right">

View File

@ -7,11 +7,10 @@ echo '
<thead> <thead>
<tr> <tr>
<th>'.tr('Descrizione').'</th> <th>'.tr('Descrizione').'</th>
<th width="120">'.tr('Q.').' <i title="'.tr('da evadere').' / '.tr('totale').'" class="tip fa fa-question-circle-o"></i></th> <th class="text-center tip" width="150" title="'.tr('da evadere').' / '.tr('totale').'">'.tr('Q.').' <i class="fa fa-question-circle-o"></i></th>
<th width="80">'.tr('U.m.').'</th> <th class="text-center" width="150">'.tr('Prezzo unitario').'</th>
<th width="120">'.tr('Costo unitario').'</th> <th class="text-center" width="150">'.tr('Iva unitaria').'</th>
<th width="120">'.tr('Iva').'</th> <th class="text-center" width="150">'.tr('Importo').'</th>
<th width="120">'.tr('Imponibile').'</th>
<th width="60"></th> <th width="60"></th>
</tr> </tr>
</thead> </thead>
@ -74,65 +73,54 @@ foreach ($righe as $riga) {
echo ' echo '
</td>'; </td>';
echo ' if ($riga->isDescrizione()) {
<td class="text-center">';
if (empty($r['is_descrizione'])) {
echo ' echo '
<span >'.Translator::numberToLocale($r['qta'] - $r['qta_evasa'], 'qta').' / '.Translator::numberToLocale($r['qta'], 'qta').'</span>'; <td></td>
} <td></td>
echo ' <td></td>
<td></td>';
} else {
// Quantità e unità di misura
echo '
<td class="text-center">
'.numberFormat($riga->qta_rimanente, 'qta').' / '.numberFormat($riga->qta, 'qta').' '.$r['um'].'
</td>'; </td>';
// Unità di misura // Prezzi unitari
echo '
<td class="text-center">';
if (empty($r['is_descrizione'])) {
echo ' echo '
'.$r['um']; <td class="text-right">
} '.moneyFormat($riga->prezzo_unitario_corrente);
echo '
</td>';
// Costo unitario if ($dir == 'entrata' && $riga->costo_unitario != 0) {
echo ' echo '
<td class="text-right">'; <br><small>
if (empty($r['is_descrizione'])) { '.tr('Acquisto').': '.moneyFormat($riga->costo_unitario).'
echo ' </small>';
'.moneyFormat($r['subtotale'] / $r['qta']); }
if (abs($r['sconto_unitario']) > 0) { if (abs($riga->sconto_unitario) > 0) {
$text = $r['sconto_unitario'] > 0 ? tr('sconto _TOT_ _TYPE_') : tr('maggiorazione _TOT_ _TYPE_'); $text = discountInfo($riga);
echo ' echo '
<br><small class="label label-danger">'.replace($text, [ <br><small class="label label-danger">'.$text.'</small>';
'_TOT_' => Translator::numberToLocale(abs($r['sconto_unitario'])),
'_TYPE_' => ($r['tipo_sconto'] == 'PRC' ? '%' : currency()),
]).'</small>';
} }
}
echo ' echo '
</td>'; </td>';
// Iva // Iva
echo '
<td class="text-right">';
if (empty($r['is_descrizione'])) {
echo ' echo '
'.moneyFormat($r['iva']).' <td class="text-right">
<br><small class="help-block">'.$r['desc_iva'].'</small>'; '.moneyFormat($riga->iva_unitaria).'
} <br><small class="'.(($riga->aliquota->deleted_at) ? 'text-red' : '').' help-block">'.$riga->aliquota->descrizione.(($riga->aliquota->esente) ? ' ('.$riga->aliquota->codice_natura_fe.')' : null).'</small>
echo '
</td>'; </td>';
// Imponibile // Importo
echo '
<td class="text-right">';
if (empty($r['is_descrizione'])) {
echo ' echo '
'.moneyFormat($r['subtotale'] - $r['sconto']); <td class="text-right">
} '.moneyFormat($riga->importo).'
echo '
</td>'; </td>';
}
// Possibilità di rimuovere una riga solo se l'ordine non è evaso // Possibilità di rimuovere una riga solo se l'ordine non è evaso
echo ' echo '
@ -188,7 +176,7 @@ $totale = abs($ordine->totale);
// IMPONIBILE // IMPONIBILE
echo ' echo '
<tr> <tr>
<td colspan="5" class="text-right"> <td colspan="4" class="text-right">
<b>'.tr('Imponibile', [], ['upper' => true]).':</b> <b>'.tr('Imponibile', [], ['upper' => true]).':</b>
</td> </td>
<td align="right"> <td align="right">
@ -201,7 +189,7 @@ echo '
if (!empty($sconto)) { if (!empty($sconto)) {
echo ' echo '
<tr> <tr>
<td colspan="5" class="text-right"> <td colspan="4" class="text-right">
<b><span class="tip" title="'.tr('Un importo positivo indica uno sconto, mentre uno negativo indica una maggiorazione').'"> <i class="fa fa-question-circle-o"></i> '.tr('Sconto/maggiorazione', [], ['upper' => true]).':</span></b> <b><span class="tip" title="'.tr('Un importo positivo indica uno sconto, mentre uno negativo indica una maggiorazione').'"> <i class="fa fa-question-circle-o"></i> '.tr('Sconto/maggiorazione', [], ['upper' => true]).':</span></b>
</td> </td>
<td align="right"> <td align="right">
@ -213,7 +201,7 @@ if (!empty($sconto)) {
// TOTALE IMPONIBILE // TOTALE IMPONIBILE
echo ' echo '
<tr> <tr>
<td colspan="5" class="text-right"> <td colspan="4" class="text-right">
<b>'.tr('Totale imponibile', [], ['upper' => true]).':</b> <b>'.tr('Totale imponibile', [], ['upper' => true]).':</b>
</td> </td>
<td align="right"> <td align="right">
@ -226,7 +214,7 @@ if (!empty($sconto)) {
// IVA // IVA
echo ' echo '
<tr> <tr>
<td colspan="5" class="text-right"> <td colspan="4" class="text-right">
<b>'.tr('Iva', [], ['upper' => true]).':</b> <b>'.tr('Iva', [], ['upper' => true]).':</b>
</td> </td>
<td align="right"> <td align="right">
@ -238,7 +226,7 @@ echo '
// TOTALE // TOTALE
echo ' echo '
<tr> <tr>
<td colspan="5" class="text-right"> <td colspan="4" class="text-right">
<b>'.tr('Totale', [], ['upper' => true]).':</b> <b>'.tr('Totale', [], ['upper' => true]).':</b>
</td> </td>
<td align="right"> <td align="right">

View File

@ -7,11 +7,10 @@ echo '
<thead> <thead>
<tr> <tr>
<th>'.tr('Descrizione').'</th> <th>'.tr('Descrizione').'</th>
<th width="120">'.tr('Q.').' <i title="'.tr('da evadere').' / '.tr('totale').'" class="tip fa fa-question-circle-o"></i></th> <th class="text-center tip" width="150" title="'.tr('da evadere').' / '.tr('totale').'">'.tr('Q.').' <i class="fa fa-question-circle-o"></i></th>
<th width="80">'.tr('U.m.').'</th> <th class="text-center" width="150">'.tr('Prezzo unitario').'</th>
<th width="120">'.tr('Costo unitario').'</th> <th class="text-center" width="150">'.tr('Iva unitaria').'</th>
<th width="120">'.tr('Iva').'</th> <th class="text-center" width="150">'.tr('Importo').'</th>
<th width="120">'.tr('Imponibile').'</th>
<th width="60"></th> <th width="60"></th>
</tr> </tr>
</thead> </thead>
@ -38,48 +37,48 @@ foreach ($righe as $riga) {
<td></td> <td></td>
<td></td> <td></td>
<td></td> <td></td>
<td></td>
<td></td>'; <td></td>';
} else { } else {
// Q.tà // Quantità e unità di misura
echo ' echo '
<td class="text-center"> <td class="text-center">
'.Translator::numberToLocale($riga->qta_rimanente, 'qta').' / '.Translator::numberToLocale($riga->qta, 'qta').' '.numberFormat($riga->qta_rimanente, 'qta').' / '.numberFormat($riga->qta, 'qta').' '.$r['um'].'
</td>'; </td>';
// Unità di misura // Prezzi unitari
echo ' echo '
<td class="text-center"> <td class="text-right">
'.$riga->um.' '.moneyFormat($riga->prezzo_unitario_corrente);
</td>';
// Costo unitario if ($dir == 'entrata' && $riga->costo_unitario != 0) {
echo ' echo '
<td class="text-right"> <br><small>
'.moneyFormat($riga->prezzo_unitario); '.tr('Acquisto').': '.moneyFormat($riga->costo_unitario).'
</small>';
}
if (abs($riga->sconto_unitario) > 0) { if (abs($riga->sconto_unitario) > 0) {
$text = discountInfo($riga); $text = discountInfo($riga);
echo ' echo '
<br><small class="label label-danger">'.$text.'</small>'; <br><small class="label label-danger">'.$text.'</small>';
} }
echo'
</td>';
// IVA
echo ' echo '
<td class="text-right"> </td>';
'.moneyFormat($riga->iva).'<br>
<small class="help-block">'.$riga->aliquota->descrizione.(($riga->aliquota->esente) ? ' ('.$riga->aliquota->codice_natura_fe.')' : null).'</small>
</td>';
// Imponibile // Iva
echo ' echo '
<td class="text-right"> <td class="text-right">
'.moneyFormat($riga->totale_imponibile).' '.moneyFormat($riga->iva_unitaria).'
</td>'; <br><small class="'.(($riga->aliquota->deleted_at) ? 'text-red' : '').' help-block">'.$riga->aliquota->descrizione.(($riga->aliquota->esente) ? ' ('.$riga->aliquota->codice_natura_fe.')' : null).'</small>
</td>';
// Importo
echo '
<td class="text-right">
'.moneyFormat($riga->importo).'
</td>';
} }
// Possibilità di rimuovere una riga solo se il preventivo non è stato pagato // Possibilità di rimuovere una riga solo se il preventivo non è stato pagato
@ -140,7 +139,7 @@ $totale = abs($preventivo->totale);
// Totale imponibile scontato // Totale imponibile scontato
echo ' echo '
<tr> <tr>
<td colspan="5" class="text-right"> <td colspan="4" class="text-right">
<b>'.tr('Imponibile', [], ['upper' => true]).':</b> <b>'.tr('Imponibile', [], ['upper' => true]).':</b>
</td> </td>
<td class="text-right"> <td class="text-right">
@ -153,7 +152,7 @@ echo '
if (!empty($sconto)) { if (!empty($sconto)) {
echo ' echo '
<tr> <tr>
<td colspan="5" class="text-right"> <td colspan="4" class="text-right">
<b><span class="tip" title="'.tr('Un importo positivo indica uno sconto, mentre uno negativo indica una maggiorazione').'"> <i class="fa fa-question-circle-o"></i> '.tr('Sconto/maggiorazione', [], ['upper' => true]).':</span></b> <b><span class="tip" title="'.tr('Un importo positivo indica uno sconto, mentre uno negativo indica una maggiorazione').'"> <i class="fa fa-question-circle-o"></i> '.tr('Sconto/maggiorazione', [], ['upper' => true]).':</span></b>
</td> </td>
<td class="text-right"> <td class="text-right">
@ -165,7 +164,7 @@ if (!empty($sconto)) {
// Totale imponibile scontato // Totale imponibile scontato
echo ' echo '
<tr> <tr>
<td colspan="5" class="text-right"> <td colspan="4" class="text-right">
<b>'.tr('Totale imponibile', [], ['upper' => true]).':</b> <b>'.tr('Totale imponibile', [], ['upper' => true]).':</b>
</td> </td>
<td align="right"> <td align="right">
@ -178,7 +177,7 @@ if (!empty($sconto)) {
// Totale iva // Totale iva
echo ' echo '
<tr> <tr>
<td colspan="5" class="text-right"> <td colspan="4" class="text-right">
<b>'.tr('Iva', [], ['upper' => true]).':</b> <b>'.tr('Iva', [], ['upper' => true]).':</b>
</td> </td>
<td class="text-right"> <td class="text-right">
@ -190,7 +189,7 @@ echo '
// Totale // Totale
echo ' echo '
<tr> <tr>
<td colspan="5" class="text-right"> <td colspan="4" class="text-right">
<b>'.tr('Totale', [], ['upper' => true]).':</b> <b>'.tr('Totale', [], ['upper' => true]).':</b>
</td> </td>
<td class="text-right"> <td class="text-right">
@ -205,7 +204,7 @@ $margine_style = ($margine <= 0 and $preventivo->totale > 0) ? 'background-color
echo ' echo '
<tr> <tr>
<td colspan="5" class="text-right"> <td colspan="4" class="text-right">
'.tr('Margine (_PRC_%)', [ '.tr('Margine (_PRC_%)', [
'_PRC_' => numberFormat($preventivo->margine_percentuale), '_PRC_' => numberFormat($preventivo->margine_percentuale),
]).': ]).':