Stampa preventivo solo totale

This commit is contained in:
Matteo Baccarin 2020-02-14 12:10:42 +01:00
parent 8593bf0c69
commit 4ed9562772
2 changed files with 15 additions and 12 deletions

View File

@ -174,15 +174,15 @@ $totale = $documento->totale;
$show_sconto = $sconto > 0; $show_sconto = $sconto > 0;
// TOTALE COSTI FINALI // TOTALE COSTI FINALI
if ($options['pricing'] and !isset($options['hide_total'])) { if (($options['pricing'] && !isset($options['hide_total'])) || $options['show_only_total']) {
// Totale imponibile // Totale imponibile
echo ' echo '
<tr> <tr>
<td colspan="3" class="text-right border-top"> <td colspan="'.($options['show_only_total']?1:3).'" class="text-right border-top">
<b>'.tr('Imponibile', [], ['upper' => true]).':</b> <b>'.tr('Imponibile', [], ['upper' => true]).':</b>
</td> </td>
<th colspan="2" class="text-right"> <th colspan="'.($options['show_only_total']?1:2).'" class="text-right">
<b>'.moneyFormat($show_sconto ? $imponibile : $totale_imponibile, 2).'</b> <b>'.moneyFormat($show_sconto ? $imponibile : $totale_imponibile, 2).'</b>
</th> </th>
</tr>'; </tr>';
@ -191,11 +191,11 @@ if ($options['pricing'] and !isset($options['hide_total'])) {
if ($show_sconto) { if ($show_sconto) {
echo ' echo '
<tr> <tr>
<td colspan="3" class="text-right border-top"> <td colspan="'.($options['show_only_total']?1:3).'" class="text-right border-top">
<b>'.tr('Sconto', [], ['upper' => true]).':</b> <b>'.tr('Sconto', [], ['upper' => true]).':</b>
</td> </td>
<th colspan="2" class="text-right"> <th colspan="'.($options['show_only_total']?1:2).'" class="text-right">
<b>'.moneyFormat($sconto, 2).'</b> <b>'.moneyFormat($sconto, 2).'</b>
</th> </th>
</tr>'; </tr>';
@ -203,11 +203,11 @@ if ($options['pricing'] and !isset($options['hide_total'])) {
// Totale imponibile // Totale imponibile
echo ' echo '
<tr> <tr>
<td colspan="3" class="text-right border-top"> <td colspan="'.($options['show_only_total']?1:3).'" class="text-right border-top">
<b>'.tr('Totale imponibile', [], ['upper' => true]).':</b> <b>'.tr('Totale imponibile', [], ['upper' => true]).':</b>
</td> </td>
<th colspan="2" class="text-right"> <th colspan="'.($options['show_only_total']?1:2).'" class="text-right">
<b>'.moneyFormat($totale_imponibile, 2).'</b> <b>'.moneyFormat($totale_imponibile, 2).'</b>
</th> </th>
</tr>'; </tr>';
@ -216,11 +216,11 @@ if ($options['pricing'] and !isset($options['hide_total'])) {
// IVA // IVA
echo ' echo '
<tr> <tr>
<td colspan="3" class="text-right border-top"> <td colspan="'.($options['show_only_total']?1:3).'" class="text-right border-top">
<b>'.tr('Totale IVA', [], ['upper' => true]).':</b> <b>'.tr('Totale IVA', [], ['upper' => true]).':</b>
</td> </td>
<th colspan="2" class="text-right"> <th colspan="'.($options['show_only_total']?1:2).'" class="text-right">
<b>'.moneyFormat($totale_iva, 2).'</b> <b>'.moneyFormat($totale_iva, 2).'</b>
</th> </th>
</tr>'; </tr>';
@ -228,10 +228,10 @@ if ($options['pricing'] and !isset($options['hide_total'])) {
// TOTALE // TOTALE
echo ' echo '
<tr> <tr>
<td colspan="3" class="text-right border-top"> <td colspan="'.($options['show_only_total']?1:3).'" class="text-right border-top">
<b>'.tr('Totale documento', [], ['upper' => true]).':</b> <b>'.tr('Totale documento', [], ['upper' => true]).':</b>
</td> </td>
<th colspan="2" class="text-right"> <th colspan="'.($options['show_only_total']?1:2).'" class="text-right">
<b>'.moneyFormat($totale, 2).'</b> <b>'.moneyFormat($totale, 2).'</b>
</th> </th>
</tr>'; </tr>';

View File

@ -30,4 +30,7 @@ ALTER TABLE `dt_righe_ddt` CHANGE `qta_evasa` `qta_evasa` decimal(14, 6) NOT NUL
ALTER TABLE `co_righe_preventivi` CHANGE `qta_evasa` `qta_evasa` decimal(14, 6) NOT NULL; ALTER TABLE `co_righe_preventivi` CHANGE `qta_evasa` `qta_evasa` decimal(14, 6) NOT NULL;
ALTER TABLE `co_righe_documenti` CHANGE `qta_evasa` `qta_evasa` decimal(14, 6) NOT NULL; ALTER TABLE `co_righe_documenti` CHANGE `qta_evasa` `qta_evasa` decimal(14, 6) NOT NULL;
ALTER TABLE `co_righe_contratti` CHANGE `qta_evasa` `qta_evasa` decimal(14, 6) NOT NULL; ALTER TABLE `co_righe_contratti` CHANGE `qta_evasa` `qta_evasa` decimal(14, 6) NOT NULL;
ALTER TABLE `mg_articoli` CHANGE `threshold_qta` `threshold_qta` decimal(14, 6) NOT NULL; ALTER TABLE `mg_articoli` CHANGE `threshold_qta` `threshold_qta` decimal(14, 6) NOT NULL;
INSERT INTO `zz_prints` (`id`, `id_module`, `is_record`, `name`, `title`, `filename`, `directory`, `previous`, `options`, `icon`, `version`, `compatibility`, `order`, `predefined`, `default`, `enabled`) VALUES
(NULL, (SELECT id FROM zz_modules WHERE `name`='Preventivi'), 1, 'Preventivo (solo totale)', 'Preventivo (solo totale)', 'Preventivo num. {numero} del {data}', 'preventivi', 'idpreventivo', '{\"pricing\":false, \"show_only_total\":true}', 'fa fa-print', '', '', 0, 0, 1, 1);