. */ include_once __DIR__.'/../../core.php'; use Models\Module; $block_edit = $record['is_completato']; // Mostro un avviso se ci sono più revisioni del preventivo if (count($preventivo->revisioni) > 1) { echo '
'.tr('Questo preventivo presenta _N_ revisioni', [ '_N_' => count($preventivo->revisioni), ]).'
'; } ?>

{[ "type": "text", "label": "", "name": "numero", "required": 1, "class": "text-center", "value": "$numero$", "icon-after": "revisioni) > 1) ? tr('rev.').' '.$preventivo->numero_revision : ''; ?>" ]}
{[ "type": "date", "label": "", "name": "data_bozza","required": 1, "value": "$data_bozza$" ]}
{[ "type": "date", "label": "", "name": "data_accettazione", "value": "$data_accettazione$" ]}
{[ "type": "date", "label": "", "name": "data_conclusione", "value": "$data_conclusione$", "disabled": "isDataConclusioneAutomatica() ? '1", "help": "'.tr('La Data di conclusione è calcolata in automatico in base al valore del campo Validità') : 0; ?>" ]}
{[ "type": "date", "label": "", "name": "data_rifiuto", "value": "$data_rifiuto$" ]}
'.Modules::link('Anagrafiche', $record['idanagrafica'], null, null, 'class="pull-right"').' {[ "type": "select", "label": "'.tr('Cliente').'", "name": "idanagrafica", "required": 1, "value": "$idanagrafica$", "ajax-source": "clienti" ]}
{[ "type": "select", "label": "'.tr('Sede').'", "name": "idsede", "value": "$idsede$", "ajax-source": "sedi", "select-options": {"idanagrafica": '.$record['idanagrafica'].'}, "placeholder": "Sede legale" ]}
'; if (!empty($record['idreferente'])) { echo Plugins::link('Referenti', $record['idanagrafica'], null, null, 'class="pull-right"'); } echo ' {[ "type": "select", "label": "'.tr('Referente').'", "name": "idreferente", "value": "$idreferente$", "ajax-source": "referenti", "select-options": {"idanagrafica": '.$record['idanagrafica'].',"idsede_destinazione": '.$record['idsede'].'} ]}
'; if ($record['idagente'] != 0) { echo Modules::link('Anagrafiche', $record['idagente'], null, null, 'class="pull-right"'); } echo ' {[ "type": "select", "label": "'.tr('Agente').'", "name": "idagente", "ajax-source": "agenti", "select-options": {"idanagrafica": '.$record['idanagrafica'].'}, "value": "$idagente$" ]}
'; ?>
{[ "type": "text", "label": "", "name": "nome", "required": 1, "value": "$nome$" ]}
{[ "type": "select", "label": "", "name": "idpagamento", "values": "query=SELECT `co_pagamenti`.`id`, `name` AS descrizione FROM `co_pagamenti` LEFT JOIN `co_pagamenti_lang` ON (`co_pagamenti`.`id` = `co_pagamenti_lang`.`id_record` AND `co_pagamenti_lang`.`id_lang` = id); ?>) GROUP BY `name` ORDER BY `name`", "value": "$idpagamento$" ]}
{[ "type": "select", "label": "", "name": "idstato", "required": 1, "values": "query=SELECT `co_statipreventivi`.`id`, `co_statipreventivi_lang`.`name` AS descrizione, `colore` AS _bgcolor_ FROM `co_statipreventivi` LEFT JOIN `co_statipreventivi_lang` ON (`co_statipreventivi_lang`.`id_record` = `co_statipreventivi`.`id` AND `co_statipreventivi_lang`.`id_lang` = id); ?>) ORDER BY `name`", "value": "$idstato$", "class": "unblockable" ]}
{[ "type": "number", "label": "", "name": "validita", "decimals": "0", "value": "$validita$", "icon-after": "choice|period|", "help": "" ]}
{[ "type": "select", "label": "", "name": "idtipointervento", "required": 1, "ajax-source": "tipiintervento", "value": "$idtipointervento$" ]}
{[ "type": "text", "label": "", "name": "tempi_consegna", "value": "$tempi_consegna$" ]}
{[ "type": "number", "label": "", "name": "sconto_finale", "value": "sconto_finale_percentuale ?: $preventivo->sconto_finale; ?>", "icon-after": "choice|untprc|sconto_finale) ? 'PRC' : 'UNT'; ?>", "help": "." ]}
{[ "type": "textarea", "label": "", "name": "esclusioni", "class": "autosize", "value": "$esclusioni$" ]}
{[ "type": "textarea", "label": "", "name": "garanzia", "class": "autosize", "value": "$garanzia$" ]}
{[ "type": "textarea", "label": "", "name": "descrizione", "class": "autosize", "value": "$descrizione$" ]}
'ckeditor', 'use_full_ckeditor' => 1, 'label' => tr('Condizioni generali di fornitura'), 'name' => 'condizioni_fornitura', 'value' => $record['condizioni_fornitura'], ]); ?>
gruppo != 'Clienti') { echo '
{[ "type": "textarea", "label": "'.tr('Note interne').'", "name": "informazioniaggiuntive", "class": "autosize", "value": "$informazioniaggiuntive$", "extra": "rows=\'5\'" ]}
'; } ?>

{[ "type": "text", "label": "", "name": "id_documento_fe", "required": 0, "help": "Obbligatorio per valorizzare CIG/CUP. È possible inserire:
  • N. determina
  • RDO
  • Ordine MEPA
'); ?>", "value": "$id_documento_fe$", "maxlength": 20 ]}
{[ "type": "text", "label": "", "name": "num_item", "required": 0, "value": "$num_item$", "maxlength": 15 ]}
{[ "type": "text", "label": "", "name": "codice_cig", "required": 0, "value": "$codice_cig$", "maxlength": 15 ]}
{[ "type": "text", "label": "", "name": "codice_cup", "required": 0, "value": "$codice_cup$", "maxlength": 15 ]}

'.tr('Righe').'

'; if (!$block_edit) { // Form di inserimento riga documento echo ' '; } echo '

{( "name": "filelist_and_upload", "id_module": "$id_module$", "id_record": "$id_record$" )} {( "name": "log_email", "id_module": "$id_module$", "id_record": "$id_record$" )} '; // Fatture, ordini collegate a questo preventivo $elementi = $dbo->fetchArray('SELECT `co_documenti`.`id`, `co_documenti`.`data`, `co_documenti`.`numero`, `co_documenti`.`numero_esterno`, `co_tipidocumento_lang`.`name` AS tipo_documento, IF(`co_tipidocumento`.`dir` = \'entrata\', \'Fatture di vendita\', \'Fatture di acquisto\') AS modulo FROM `co_documenti` INNER JOIN `co_tipidocumento` ON `co_tipidocumento`.`id` = `co_documenti`.`idtipodocumento` LEFT JOIN `co_tipidocumento_lang` ON (`co_tipidocumento_lang`.`id_record` = `co_tipidocumento`.`id` AND `co_tipidocumento_lang`.`id_lang` = '.prepare(Models\Locale::getDefault()->id).') INNER JOIN `co_righe_documenti` ON `co_righe_documenti`.`iddocumento` = `co_documenti`.`id` WHERE `co_righe_documenti`.`idpreventivo` = '.prepare($id_record).') UNION SELECT `or_ordini`.`id`, `or_ordini`.`data`, `or_ordini`.`numero`, `or_ordini`.`numero_esterno`, `or_tipiordine_lang`.`name`, IF(`or_tipiordine`.`dir` = \'entrata\', \'Ordini cliente\', \'Ordini fornitore\') FROM `or_ordini` JOIN `or_righe_ordini` ON `or_righe_ordini`.`idordine` = `or_ordini`.`id` INNER JOIN `or_tipiordine` ON `or_tipiordine`.`id` = `or_ordini`.`idtipoordine` LEFT JOIN `or_tipiordine_lang` ON (`or_tipiordine_lang`.`id_record` = `or_tipiordine`.`id` AND `or_tipiordine_lang`.`id_lang` = '.prepare(Models\Locale::getDefault()->id).') WHERE `or_righe_ordini`.`idpreventivo` = '.prepare($id_record).' UNION SELECT `dt_ddt`.`id`, `dt_ddt`.`data`, `dt_ddt`.`numero`, `dt_ddt`.`numero_esterno`, `dt_tipiddt_lang`.`name`, IF(`dt_tipiddt`.`dir` = \'entrata\', \'Ddt di vendita\', \'Ddt di acquisto\') FROM `dt_ddt` JOIN `dt_righe_ddt` ON `dt_righe_ddt`.`idddt` = `dt_ddt`.`id` INNER JOIN `dt_tipiddt` ON `dt_tipiddt`.`id` = `dt_ddt`.`idtipoddt` LEFT JOIN `dt_tipiddt_lang` ON (`dt_tipiddt_lang`.`id_record` = `dt_tipiddt`.`id` AND `dt_tipiddt_lang`.`id_lang` = '.prepare(Models\Locale::getDefault()->id).') WHERE `dt_righe_ddt`.`original_document_id` = '.prepare($preventivo->id).' AND `dt_righe_ddt`.`original_document_type` = \'Modules\\\\Preventivi\\\\Preventivo\' UNION SELECT `in_interventi`.`id`, `in_interventi`.`data_richiesta`, `in_interventi`.`codice`, NULL, \'Attività\', \'Interventi\' FROM `in_interventi` JOIN `in_righe_interventi` ON `in_righe_interventi`.`idintervento` = `in_interventi`.`id` WHERE (`in_righe_interventi`.`original_document_id` = '.prepare($preventivo->id).' AND `in_righe_interventi`.`original_document_type` = '.prepare(get_class($preventivo)).') OR `in_interventi`.`id_preventivo` = '.prepare($id_record).' ORDER BY `data`'); if (!empty($elementi)) { echo '

'.tr('Documenti collegati: _NUM_', [ '_NUM_' => count($elementi), ]).'

'; } if (!empty($elementi)) { echo '
'.tr('Eliminando questo documento si potrebbero verificare problemi nelle altre sezioni del gestionale').'.
'; } ?>