Skip to content

Commit c564065

Browse files
committed
feat: aggiunta costi, margine e rincaro anche su contratti
1 parent 13ee855 commit c564065

1 file changed

Lines changed: 37 additions & 0 deletions

File tree

modules/contratti/row-list.php

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,43 @@
409409
</tr>';
410410
}
411411

412+
// Margine
413+
$margine = $contratto->margine;
414+
$margine_class = ($margine <= 0 && $contratto->totale > 0) ? 'danger' : 'success';
415+
$margine_icon = ($margine <= 0 && $contratto->totale > 0) ? 'warning' : 'check';
416+
417+
echo '
418+
<tr>
419+
<td colspan="'.$colspan.'" class="text-right">
420+
'.tr('Costi').':
421+
</td>
422+
<td class="text-right">
423+
'.moneyFormat($contratto->spesa).'
424+
</td>
425+
<td></td>
426+
</tr>';
427+
428+
echo '
429+
<tr>
430+
<td colspan="'.$colspan.'" class="text-right">
431+
'.tr('Margine (_PRC_%)', [
432+
'_PRC_' => numberFormat($contratto->margine_percentuale),
433+
]).':
434+
</td>
435+
<td class="text-right '.$margine_class.'" rowspan="2" style="vertical-align:middle;">
436+
<i class="fa fa-'.$margine_icon.' text-'.$margine_class.'"></i> '.moneyFormat($contratto->margine).'
437+
</td>
438+
<td rowspan="2"></td>
439+
</tr>
440+
441+
<tr>
442+
<td colspan="'.$colspan.'" class="text-right">
443+
'.tr('Ricarico (_PRC_)', [
444+
'_PRC_' => ($contratto->ricarico_percentuale != 0 ? numberFormat($contratto->ricarico_percentuale).'%' : 'N.D.'),
445+
]).':
446+
</td>
447+
</tr>';
448+
412449
echo '
413450
</table>';
414451
if (sizeof($righe) > 0) {

0 commit comments

Comments
 (0)