Aggiunto plugin consuntivo negli ordini cliente

This commit is contained in:
Matteo 2021-03-01 15:01:02 +01:00
parent fc9a2cc9df
commit ed4502ed10
12 changed files with 583 additions and 6 deletions

View File

@ -60,6 +60,7 @@ switch (post('op')) {
$intervento->idsede_destinazione = post('idsede_destinazione');
$intervento->id_preventivo = post('idpreventivo');
$intervento->id_contratto = $idcontratto;
$intervento->id_ordine = post('idordine');
$intervento->id_documento_fe = post('id_documento_fe');
$intervento->num_item = post('num_item');
@ -152,6 +153,7 @@ switch (post('op')) {
$intervento->id_preventivo = post('idpreventivo');
$intervento->id_contratto = post('idcontratto');
$intervento->id_ordine = post('idordine');
$intervento->richiesta = post('richiesta_add');
$intervento->idsede_destinazione = $idsede_destinazione;
$intervento->data_scadenza = $data_scadenza;

View File

@ -175,6 +175,10 @@ echo '
</div>
<div class="row">
<div class="col-md-4">
{[ "type": "select", "label": "'.tr('Ordine').'", "name": "idordine", "ajax-source": "ordini" ]}
</div>
<div class="col-md-4">
{[ "type": "timestamp", "label": "'.tr('Data/ora richiesta').'", "name": "data_richiesta", "required": 1, "value": "'.($data_richiesta ?: '-now-').'" ]}
</div>
@ -182,14 +186,14 @@ echo '
<div class="col-md-4">
{[ "type": "select", "label": "'.tr('Tipo').'", "name": "idtipointervento", "required": 1, "values": "query=SELECT idtipointervento AS id, descrizione FROM in_tipiintervento ORDER BY descrizione ASC", "value": "'.$id_tipo.'", "ajax-source": "tipiintervento" ]}
</div>
<div class="col-md-4">
{[ "type": "select", "label": "'.tr('Stato').'", "name": "idstatointervento", "required": 1, "values": "query=SELECT idstatointervento AS id, descrizione, colore AS _bgcolor_ FROM in_statiintervento WHERE deleted_at IS NULL", "value": "'.$id_stato.'" ]}
</div>
</div>
<div class="row">
<div class="col-md-12">
<div class="col-md-4">
{[ "type": "select", "label": "'.tr('Stato').'", "name": "idstatointervento", "required": 1, "values": "query=SELECT idstatointervento AS id, descrizione, colore AS _bgcolor_ FROM in_statiintervento WHERE deleted_at IS NULL", "value": "'.$id_stato.'" ]}
</div>
<div class="col-md-8">
{[ "type": "ckeditor", "label": "'.tr('Richiesta').'", "name": "richiesta_add", "required": 1, "value": "'.$richiesta.'", "extra": "style=\'max-height:80px;\'" ]}
</div>
</div>';

View File

@ -103,6 +103,24 @@ echo '
<input type="hidden" name="idcontratto_riga" value="'.$idcontratto_riga.'">
</div>
</div>
<div class="row">
<div class="col-md-6">';
$idcontratto_riga = $dbo->fetchOne('SELECT id FROM co_promemoria WHERE idintervento='.prepare($id_record))['id'];
if (!empty($record['idordine'])) {
echo '
'.Modules::link('Ordini cliente', $record['idordine'], null, null, 'class="pull-right"');
}
echo '
{[ "type": "select", "label": "'.tr('Ordine').'", "name": "idordine", "value": "'.$record['id_ordine'].'", "ajax-source": "ordini", "select-options": '.json_encode(['idanagrafica' => $record['idanagrafica']]).', "readonly": "'.$record['flag_completato'].'" ]}
<input type="hidden" name="idcontratto_riga" value="'.$idcontratto_riga.'">
</div>
</div>
</div>
</div>
</div>';

View File

@ -30,6 +30,7 @@ if (isset($id_record)) {
IF((in_interventi.idsede_destinazione = 0), (SELECT idzona FROM an_anagrafiche WHERE idanagrafica = in_interventi.idanagrafica), (SELECT idzona FROM an_sedi WHERE id = in_interventi.idsede_destinazione)) AS idzona,
(SELECT colore FROM in_statiintervento WHERE idstatointervento=in_interventi.idstatointervento) AS colore,
in_interventi.id_preventivo as idpreventivo,
in_interventi.id_contratto as idcontratto
in_interventi.id_contratto as idcontratto,
in_interventi.id_ordine as idordine
FROM in_interventi WHERE id='.prepare($id_record));
}

View File

@ -0,0 +1,48 @@
<?php
/*
* OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
* Copyright (C) DevCode s.n.c.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
include_once __DIR__.'/../../../core.php';
switch ($resource) {
/*
* Opzioni utilizzate:
* - idanagrafica
*/
case 'ordini':
if (isset($superselect['idanagrafica'])) {
$query = 'SELECT or_ordini.id AS id, or_ordini.idanagrafica, CONCAT("Ordine ", numero, " del ", DATE_FORMAT(data, "%d/%m/%Y"), " [", (SELECT `descrizione` FROM `or_statiordine` WHERE `or_statiordine`.`id` = `idstatoordine`) , "]") AS descrizione, (SELECT SUM(subtotale) FROM or_righe_ordini WHERE idordine=or_ordini.id GROUP BY idordine) AS totale, (SELECT SUM(sconto) FROM or_righe_ordini WHERE idordine=or_ordini.id GROUP BY idordine) AS sconto FROM or_ordini INNER JOIN an_anagrafiche ON or_ordini.idanagrafica=an_anagrafiche.idanagrafica |where| ORDER BY id';
foreach ($elements as $element) {
$filter[] = 'id='.prepare($element);
}
if (empty($elements)) {
$where[] = 'an_anagrafiche.idanagrafica='.prepare($superselect['idanagrafica']);
$stato = !empty($superselect['stato']) ? $superselect['stato'] : 'completato';
$where[] = 'idstatoordine IN (SELECT `id` FROM `or_statiordine` WHERE '.$stato.' = 1)';
}
if (!empty($search)) {
$search_fields[] = 'nome LIKE '.prepare('%'.$search.'%');
}
}
break;
}

View File

@ -0,0 +1,288 @@
<?php
/*
* OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
* Copyright (C) DevCode s.n.c.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
include_once __DIR__.'/../../../core.php';
use Modules\Interventi\Intervento;
// CONSUNTIVO
// Tabella con riepilogo interventi
$interventi = Intervento::where('id_ordine', $id_record)->get();
if (!empty($interventi)) {
echo '
<table class="table table-bordered table-condensed">
<tr>
<th>'.tr('Attività').'</th>
<th width="100">'.tr('Ore').'</th>
<th width="100">'.tr('Km').'</th>
<th width="120">'.tr('Costo').'</th>
<th width="120">'.tr('Addebito').'</th>
<th width="120">'.tr('Tot. scontato').'</th>
</tr>';
// Tabella con i dati
foreach ($interventi as $intervento) {
// Riga per il singolo intervento
echo '
<tr style="background:'.$intervento->stato->colore.';">
<td>
<a href="javascript:;" class="btn btn-primary btn-xs" onclick="$(\'#dettagli_'.$intervento->id.'\').toggleClass(\'hide\'); $(this).find(\'i\').toggleClass(\'fa-plus\').toggleClass(\'fa-minus\');"><i class="fa fa-plus"></i></a>
'.Modules::link('Interventi', $intervento->id, tr('Intervento num. _NUM_ del _DATE_', [
'_NUM_' => $intervento->codice,
'_DATE_' => Translator::dateToLocale($intervento->inizio),
])).'
</td>
<td class="text-right">
'.numberFormat($intervento->ore_totali).'
</td>
<td class="text-right">
'.numberFormat($intervento->km_totali).'
</td>
<td class="text-right">
'.moneyFormat($intervento->spesa).'
</td>
<td class="text-right">
'.moneyFormat($intervento->imponibile).'
</td>
<td class="text-right">
'.moneyFormat($intervento->totale_imponibile).'
</td>
</tr>';
// Riga con dettagli
echo '
<tr class="hide" id="dettagli_'.$intervento->id.'">
<td colspan="6">';
// Lettura sessioni di lavoro
$sessioni = $intervento->sessioni;
if (!empty($sessioni)) {
echo '
<table class="table table-striped table-condensed table-bordered">
<tr>
<th>'.tr('Tecnico').'</th>
<th width="230">'.tr('Tipo attività').'</th>
<th width="120">'.tr('Ore').'</th>
<th width="120">'.tr('Km').'</th>
<th width="120">'.tr('Costo ore').'</th>
<th width="120">'.tr('Costo km').'</th>
<th width="120">'.tr('Diritto ch.').'</th>
<th width="120">'.tr('Prezzo ore').'</th>
<th width="120">'.tr('Prezzo km').'</th>
<th width="120">'.tr('Diritto ch.').'</th>
</tr>';
foreach ($sessioni as $sessione) {
// Visualizzo lo sconto su ore o km se c'è
$sconto_ore = !empty($sessione->sconto_totale_manodopera) ? '<br><span class="label label-danger">'.moneyFormat(-$sessione->sconto_totale_manodopera).'</span>' : '';
$sconto_km = !empty($sessione->sconto_totale_viaggio) ? '<br><span class="label label-danger">'.moneyFormat(-$sessione->sconto_totale_viaggio).'</span>' : '';
echo '
<tr>
<td>'.$sessione->anagrafica->ragione_sociale.'</td>
<td>'.$sessione->tipo->descrizione.'</td>
<td class="text-right">'.numberFormat($sessione->ore).'</td>
<td class="text-right">'.numberFormat($sessione->km).'</td>
<td class="text-right danger">'.moneyFormat($sessione->costo_manodopera).'</td>
<td class="text-right danger">'.moneyFormat($sessione->costo_viaggio).'</td>
<td class="text-right danger">'.moneyFormat($sessione->costo_diritto_chiamata).'</td>
<td class="text-right success">'.moneyFormat($sessione->prezzo_manodopera).$sconto_ore.'</td>
<td class="text-right success">'.moneyFormat($sessione->prezzo_viaggio).$sconto_km.'</td>
<td class="text-right success">'.moneyFormat($sessione->prezzo_diritto_chiamata).'</td>
</tr>';
}
echo '
</table>';
}
// Lettura articoli utilizzati
$articoli = $intervento->articoli;
if (!$articoli->isEmpty()) {
echo '
<table class="table table-striped table-condensed table-bordered">
<tr>
<th>'.tr('Materiale').'</th>
<th width="120">'.tr('Q.').'</th>
<th width="150">'.tr('Prezzo di acquisto').'</th>
<th width="150">'.tr('Prezzo di vendita').'</th>
</tr>';
foreach ($articoli as $articolo) {
$sconto = !empty($articolo->sconto) ? '<br><span class="label label-danger">'.moneyFormat(-$articolo->sconto).'</span>' : '';
echo '
<tr>
<td>
'.Modules::link('Articoli', $articolo->idarticolo, $articolo->descrizione).'
</td>
<td class="text-right">'.numberFormat($articolo->qta, 'qta').'</td>
<td class="text-right danger">'.moneyFormat($articolo->spesa).'</td>
<td class="text-right success">'.moneyFormat($articolo->imponibile).$sconto.'</td>
</tr>';
}
echo '
</table>';
}
// Lettura spese aggiuntive
$righe = $intervento->righe;
if (!$righe->isEmpty()) {
echo '
<table class="table table-striped table-condensed table-bordered">
<tr>
<th>'.tr('Altre spese').'</th>
<th width="120">'.tr('Q.').'</th>
<th width="150">'.tr('Prezzo di acquisto').'</th>
<th width="150">'.tr('Prezzo di vendita').'</th>
</tr>';
foreach ($righe as $riga) {
$sconto = !empty($riga->sconto) ? '<br><span class="label label-danger">'.moneyFormat(-$riga->sconto).'</span>' : '';
echo '
<tr>
<td>
'.$riga->descrizione.'
</td>
<td class="text-right">'.numberFormat($riga->qta, 'qta').'</td>
<td class="text-right danger">'.moneyFormat($riga->spesa).'</td>
<td class="text-right success">'.moneyFormat($riga->imponibile).$sconto.'</td>
</tr>';
}
echo '
</table>';
}
echo '
</td>
</tr>';
}
$array_interventi = $interventi->toArray();
$totale_ore = sum(array_column($array_interventi, 'ore_totali'));
$totale_km = sum(array_column($array_interventi, 'km_totali'));
$totale_costo = sum(array_column($array_interventi, 'spesa'));
$totale_addebito = sum(array_column($array_interventi, 'imponibile'));
$totale = sum(array_column($array_interventi, 'totale_imponibile'));
// Totali
echo '
<tr>
<td class="text-right">
<b><big>'.tr('Totale').'</big></b>
</td>';
echo '
<td class="text-right">
<big><b>'.numberFormat($totale_ore).'</b></big>
</td>';
echo '
<td class="text-right">
<big><b>'.numberFormat($totale_km).'</b></big>
</td>';
echo '
<td class="text-right">
<big><b>'.moneyFormat($totale_costo).'</b></big>
</td>';
echo '
<td class="text-right">
<big><b>'.moneyFormat($totale_addebito).'</b></big>
</td>';
echo '
<td class="text-right">
<big><b>'.moneyFormat($totale).'</b></big>
</td>
</tr>';
$stati = $interventi->groupBy('idstatointervento');
if (count($stati) > 0) {
// Totali per stato
echo '
<tr>
<td colspan="6">
<br><b>'.tr('Totale interventi per stato', [], ['upper' => true]).'</b>
</td>
</tr>';
foreach ($stati as $interventi_collegati) {
$stato = $interventi_collegati->first()->stato;
$totale_stato = sum(array_column($interventi_collegati->toArray(), 'totale_imponibile'));
echo '
<tr>
<td colspan="3"></td>
<td class="text-right" colspan="2" style="background:'.$stato->colore.';">
<big><b>'.$stato->descrizione.':</b></big>
</td>
<td class="text-right">
<big><b>'.moneyFormat($totale_stato).'</b></big>
</td>
</tr>';
}
}
echo '
</table>';
}
// Bilancio del preventivo
$budget = $ordine->totale_imponibile;
$diff = sum($budget, -$totale);
echo '
<div class="well text-center">
<br><span><big>
<b>'.tr('Rapporto budget/spesa').':<br>';
if ($diff > 0) {
echo '
<span class="text-success"><big>+'.moneyFormat($diff).'</big></span>';
} elseif ($diff < 0) {
echo '
<span class="text-danger"><big>'.moneyFormat($diff).'</big></span>';
} else {
echo '
<span><big>'.moneyFormat($diff).'</big></span>';
}
echo '
</b></big></span>
<br><br>
</div>';
/*
Stampa consuntivo
*/
echo '
<div class="text-center">
'.Prints::getLink('Consuntivo ordine', $id_record, 'btn-primary', tr('Stampa consuntivo')).'
</div>';

View File

@ -26,6 +26,7 @@ use Modules\DDT\DDT;
use Traits\RecordTrait;
use Traits\ReferenceTrait;
use Util\Generator;
use Modules\Interventi\Intervento;
class Ordine extends Document
{
@ -148,6 +149,11 @@ class Ordine extends Document
return $this->hasMany(Components\Descrizione::class, 'idordine');
}
public function interventi()
{
return $this->hasMany(Intervento::class, 'id_ordine');
}
/**
* Effettua un controllo sui campi del documento.
* Viene richiamato dalle modifiche alle righe del documento.

View File

@ -0,0 +1,66 @@
<?php
/*
* OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
* Copyright (C) DevCode s.n.c.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
include_once __DIR__.'/../riepilogo_interventi/bottom.php';
$budget = get_imponibile_ordine($id_record);
$rapporto = floatval($budget) - floatval($somma_totale_imponibile);
if ($pricing && empty($options['dir'])) {
// Totale imponibile
echo '
<table class="table table-bordered">';
// TOTALE
echo '
<tr>
<td colspan="3" class="text-right border-top">
<b>'.tr('Totale consuntivo (no iva)', [], ['upper' => true]).':</b>
</td>
<th colspan="2" class="text-center">
<b>'.moneyFormat($somma_totale_imponibile).'</b>
</th>
</tr>';
// BUDGET
echo '
<tr>
<td colspan="3" class="text-right border-top">
<b>'.tr('Budget (no IVA)', [], ['upper' => true]).':</b>
</td>
<th colspan="2" class="text-center">
<b>'.moneyFormat($budget).'</b>
</th>
</tr>';
// RAPPORTO
echo '
<tr>
<td colspan="3" class="text-right border-top">
<b>'.tr('Rapporto budget/spesa (no IVA)', [], ['upper' => true]).':</b>
</td>
<th colspan="2" class="text-center">
<b>'.moneyFormat($rapporto).'</b>
</th>
</tr>';
echo '
</table>';
}

View File

@ -0,0 +1,30 @@
<?php
/*
* OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
* Copyright (C) DevCode s.n.c.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
include_once __DIR__.'/../../core.php';
use Modules\Ordini\Ordine;
$documento = Ordine::find($id_record);
$records = $documento->interventi;
$id_cliente = $documento['idanagrafica'];
$id_sede = $documento['idsede'];
$pricing = $options['pricing'];

View File

@ -0,0 +1,20 @@
<?php
/*
* OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
* Copyright (C) DevCode s.n.c.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
include __DIR__.'/../riepilogo_interventi/piece.php';

View File

@ -0,0 +1,83 @@
<?php
/*
* OpenSTAManager: il software gestionale open source per l'assistenza tecnica e la fatturazione
* Copyright (C) DevCode s.n.c.
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <https://www.gnu.org/licenses/>.
*/
include_once __DIR__.'/../../core.php';
echo '
<div class="row">
<div class="col-xs-6">
<div class="text-center">
<h4 class="text-bold">'.tr('Consuntivo', [], ['upper' => true]).'</h4>
<b>'.tr('Ordine num. _NUM_ del _DATE_', [
'_NUM_' => (!empty($documento['numero_esterno'])?$documento['numero_esterno']:$documento['numero']),
'_DATE_' => Translator::dateToLocale($documento['data']),
], ['upper' => true]).'</b>
</div>
</div>
<div class="col-xs-5 col-xs-offset-1">
<table class="table" style="width:100%;margin-top:5mm;">
<tr>
<td colspan=2 class="border-full" style="height:16mm;">
<p class="small-bold">'.tr('Spett.le', [], ['upper' => true]).'</p>
<p>$c_ragionesociale$</p>
<p>$c_indirizzo$ $c_citta_full$</p>
</td>
</tr>
<tr>
<td class="border-bottom border-left">
<p class="small-bold">'.tr('Partita IVA', [], ['upper' => true]).'</p>
</td>
<td class="border-right border-bottom text-right">
<small>$c_piva$</small>
</td>
</tr>
<tr>
<td class="border-bottom border-left">
<p class="small-bold">'.tr('Codice fiscale', [], ['upper' => true]).'</p>
</td>
<td class="border-right border-bottom text-right">
<small>$c_codicefiscale$</small>
</td>
</tr>
</table>
</div>
</div>';
// Descrizione
if (!empty($documento['descrizione'])) {
echo '
<p>'.nl2br($documento['descrizione']).'</p>
<br>';
}
echo '
<table class="table table-bordered">
<thead>
<tr>
<th colspan="2">'.tr('Documento', [], ['upper' => true]).'</th>
<th class="text-center">'.tr('Imponibile', [], ['upper' => true]).'</th>
<th class="text-center">'.tr('Sconto', [], ['upper' => true]).'</th>
<th class="text-center">'.tr('Totale imponibile', [], ['upper' => true]).'</th>
</tr>
</thead>
<tbody>';

View File

@ -304,3 +304,14 @@ UPDATE `zz_views` SET `query` = '(righe.totale + `co_documenti`.`rivalsainps` +
UPDATE `zz_views` SET `order` = 5, `name`='Conto avere_new' WHERE `name`='Conto dare';
UPDATE `zz_views` SET `order` = 8, `name`='Conto dare' WHERE `name`='Conto avere';
UPDATE `zz_views` SET `name`='Conto avere' WHERE `name`='Conto avere_new';
-- Aggiunta campo per scelta ordine in intervento
ALTER TABLE `in_interventi` ADD `id_ordine` INT NOT NULL AFTER `id_contratto`;
-- Aggiunta plugin consuntivo per ordini
INSERT INTO `zz_plugins` (`id`, `name`, `title`, `idmodule_from`, `idmodule_to`, `position`, `script`, `enabled`, `default`, `order`, `compatibility`, `version`, `options2`, `options`, `directory`, `help`) VALUES
(NULL, 'Consuntivo', 'Consuntivo', (SELECT `id` FROM `zz_modules` WHERE name='Ordini cliente'), (SELECT `id` FROM `zz_modules` WHERE name='Ordini cliente'), 'tab', 'ordini.consuntivo.php', 1, 0, 0, '', '', NULL, NULL, '', '');
-- Stampa consuntivo ordini
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='Ordini cliente'), 1, 'Consuntivo ordine', 'Consuntivo ordine', 'Consuntivo ordine num. {numero} del {data}', 'ordini_cons', 'idordine', '{\"pricing\":true}', 'fa fa-print', '', '', 0, 0, 1, 1);