Compare commits
3 Commits
b4d2fec82b
...
95b0fc5b1a
Author | SHA1 | Date |
---|---|---|
Pek5892 | 95b0fc5b1a | |
Pek5892 | 6809ca0ce3 | |
Pek5892 | 97a3c0ef47 |
|
@ -33,7 +33,7 @@ echo '
|
|||
<input type="hidden" name="backto" value="record-edit">
|
||||
|
||||
<!-- Fix creazione da Anagrafica -->
|
||||
<input type="hidden" name="id_record" value="">
|
||||
<input type="hidden" name="id_record" value="0">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
|
|
|
@ -267,7 +267,7 @@ $operations['crea_fattura'] = [
|
|||
'title' => tr('Fatturare i _TYPE_ selezionati?', ['_TYPE_' => strtolower($module->getTranslation('name'))]),
|
||||
'msg' => '{[ "type": "checkbox", "label": "<small>'.tr('Aggiungere alle fatture di vendita non ancora emesse?').'</small>", "placeholder": "'.tr('Aggiungere alle fatture esistenti non ancora emesse?').'", "name": "accodare" ]}<br>
|
||||
{[ "type": "select", "label": "'.tr('Sezionale').'", "name": "id_segment", "required": 1, "ajax-source": "segmenti", "select-options": '.json_encode(['id_module' => $id_fatture, 'is_sezionale' => 1]).', "value": "'.$id_segment.'", "select-options-escape": true ]}<br>
|
||||
{[ "type": "select", "label": "'.tr('Tipo documento').'", "name": "idtipodocumento", "required": 1, "values": "query=SELECT `co_tipidocumento`.`id`, CONCAT(`codice_tipo_documento_fe`, \' - \', `name`) AS descrizione FROM `co_tipidocumento` LEFT JOIN ` co_tipidocumento_lang` ON (`co_tipidocumento`.`id` = `co_tipidocumento_lang`.`id_record` AND `co_tipidocumento_lang`.`id_lang` = '.prepare(Models\Locale::getDefault()->id).') WHERE `enabled` = 1 AND `dir` =\'entrata\' ORDER BY `codice_tipo_documento_fe`", "value": "'.$idtipodocumento.'" ]}<br>
|
||||
{[ "type": "select", "label": "'.tr('Tipo documento').'", "name": "idtipodocumento", "required": 1, "values": "query=SELECT `co_tipidocumento`.`id`, CONCAT(`codice_tipo_documento_fe`, \' - \', `name`) AS descrizione FROM `co_tipidocumento` LEFT JOIN `co_tipidocumento_lang` ON (`co_tipidocumento`.`id` = `co_tipidocumento_lang`.`id_record` AND `co_tipidocumento_lang`.`id_lang` = '.prepare(Models\Locale::getDefault()->id).') WHERE `enabled` = 1 AND `dir` =\'entrata\' ORDER BY `codice_tipo_documento_fe`", "value": "'.$idtipodocumento.'" ]}<br>
|
||||
{[ "type": "select", "label": "'.tr('Raggruppa per').'", "name": "raggruppamento", "required": 1, "values": "list=\"cliente\":\"Cliente\",\"sede\":\"Sede\"" ]}',
|
||||
'button' => tr('Procedi'),
|
||||
'class' => 'btn btn-lg btn-warning',
|
||||
|
@ -290,7 +290,7 @@ $operations['cambia_stato'] = [
|
|||
'text' => '<span><i class="fa fa-refresh"></i> '.tr('Cambia stato'),
|
||||
'data' => [
|
||||
'title' => tr('Vuoi davvero aggiornare lo stato di questi contratti?'),
|
||||
'msg' => '<br>{[ "type": "select", "label": "'.tr('Stato').'", "name": "id_stato", "required": 1, "values": "query=SELECT `co_staticontratti`.`id`, `name` AS descrizione, `colore` as _bgcolor_ FROM `co_staticontratti` LEFT JOIN `co_staticontratti_lang ON (`co_staticontratti`.`id` = `co_staticontratti_lang`.`id_record` AND `co_staticontratti_lang`.`id_lang` = '.prepare(Models\Locale::getDefault()->id).') ORDER BY `name`" ]}',
|
||||
'msg' => '<br>{[ "type": "select", "label": "'.tr('Stato').'", "name": "id_stato", "required": 1, "values": "query=SELECT `co_staticontratti`.`id`, `name` AS descrizione, `colore` as _bgcolor_ FROM `co_staticontratti` LEFT JOIN `co_staticontratti_lang` ON (`co_staticontratti`.`id` = `co_staticontratti_lang`.`id_record` AND `co_staticontratti_lang`.`id_lang` = '.prepare(Models\Locale::getDefault()->id).') ORDER BY `name`" ]}',
|
||||
'button' => tr('Procedi'),
|
||||
'class' => 'btn btn-lg btn-warning',
|
||||
'blank' => false,
|
||||
|
|
|
@ -21,8 +21,10 @@ include_once __DIR__.'/../../core.php';
|
|||
use Models\Module;
|
||||
|
||||
$block_edit = $record['is_completato'];
|
||||
$data_accettazione = $record['data_accettazione'] ? strtotime($record['data_accettazione']) : '';
|
||||
$data_conclusione = $record['data_conclusione'] ? strtotime($record['data_conclusione']) : '';
|
||||
|
||||
if (strtotime($record['data_conclusione']) < strtotime($record['data_accettazione']) && !empty(strtotime($record['data_accettazione'])) && !empty(strtotime($record['data_conclusione']))) {
|
||||
if ($data_conclusione < $data_accettazione && !empty($data_accettazione) && !empty($data_conclusione)) {
|
||||
echo '
|
||||
<div class="alert alert-warning"><a class="clickable" onclick="$(\'.alert\').hide();"><i class="fa fa-times"></i></a> '.tr('Attenzione! La data di accettazione supera la data di conclusione del contratto. Verificare le informazioni inserite.').'</div>';
|
||||
}
|
||||
|
@ -54,7 +56,7 @@ if (strtotime($record['data_conclusione']) < strtotime($record['data_accettazion
|
|||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
{[ "type": "date", "label": "<?php echo tr('Data conclusione'); ?>", "name": "data_conclusione", "value": "$data_conclusione$", "disabled": "<?php echo $contratto->isDataConclusioneAutomatica() ? '1", "help": "'.tr('La Data di conclusione è calcolata in automatico in base al valore del campo Validità contratto, se definita') : '0'; ?>" ]}
|
||||
{[ "type": "date", "label": "<?php echo tr('Data conclusione'); ?>", "name": "data_conclusione", "value": "$data_conclusione$", "disabled": "<?php echo $contratto ? ($contratto->isDataConclusioneAutomatica() ? '1", "help": "'.tr('La Data di conclusione è calcolata in automatico in base al valore del campo Validità contratto, se definita') : '0') : ''; ?>" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
|
@ -581,7 +583,7 @@ $elementi = $dbo->fetchArray('
|
|||
\'Interventi\'
|
||||
FROM `in_interventi`
|
||||
JOIN `in_righe_interventi` ON `in_righe_interventi`.`idintervento` = `in_interventi`.`id`
|
||||
WHERE (`in_righe_interventi`.`original_document_id` = '.prepare($contratto->id).' AND `in_righe_interventi`.`original_document_type` = '.prepare(get_class($contratto)).')
|
||||
WHERE (`in_righe_interventi`.`original_document_id` = '.prepare($contratto->id).' '.($contratto ? 'AND `in_righe_interventi`.`original_document_type` = '.prepare(get_class($contratto)) : '').')
|
||||
OR `in_interventi`.`id_contratto` = '.prepare($id_record).'
|
||||
|
||||
ORDER BY `data`');
|
||||
|
|
|
@ -21,12 +21,11 @@ include_once __DIR__.'/../../core.php';
|
|||
|
||||
use Modules\Contratti\Contratto;
|
||||
|
||||
if (isset($id_record)) {
|
||||
if (!empty($id_record)) {
|
||||
$contratto = Contratto::find($id_record);
|
||||
|
||||
$record = $dbo->fetchOne('SELECT
|
||||
*,
|
||||
`co_contratti`.`nome` AS nome,
|
||||
`co_contratti`.*,
|
||||
`an_anagrafiche`.`tipo` AS tipo_anagrafica,
|
||||
`co_staticontratti`.`is_fatturabile` AS is_fatturabile,
|
||||
`co_staticontratti`.`is_pianificabile` AS is_pianificabile,
|
||||
|
|
|
@ -48,7 +48,7 @@ $id_anagrafica = !empty(get('idanagrafica')) ? get('idanagrafica') : '';
|
|||
<input type="hidden" name="dir" value="<?php echo $dir; ?>">
|
||||
|
||||
<!-- Fix creazione da Anagrafica -->
|
||||
<input type="hidden" name="id_record" value="">
|
||||
<input type="hidden" name="id_record" value="0">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
|
|
|
@ -42,7 +42,7 @@ $idtipodocumento = Tipo::where('predefined', 1)->where('dir', $dir)->first()->id
|
|||
<input type="hidden" name="dir" value="<?php echo $dir; ?>">
|
||||
|
||||
<!-- Fix creazione da Anagrafica -->
|
||||
<input type="hidden" name="id_record" value="">
|
||||
<input type="hidden" name="id_record" value="0">
|
||||
|
||||
<div class="row">
|
||||
|
||||
|
|
|
@ -144,7 +144,7 @@ echo '
|
|||
<input type="hidden" name="backto" value="record-edit">
|
||||
|
||||
<!-- Fix creazione da Anagrafica -->
|
||||
<input type="hidden" name="id_record" value="">';
|
||||
<input type="hidden" name="id_record" value="0">';
|
||||
|
||||
if (!empty($id_promemoria_contratto)) {
|
||||
echo '<input type="hidden" name="idcontratto_riga" value="'.$id_promemoria_contratto.'">';
|
||||
|
|
|
@ -42,7 +42,7 @@ $id_anagrafica = !empty(get('idanagrafica')) ? get('idanagrafica') : '';
|
|||
<input type="hidden" name="dir" value="<?php echo $dir; ?>">
|
||||
|
||||
<!-- Fix creazione da Anagrafica -->
|
||||
<input type="hidden" name="id_record" value="">
|
||||
<input type="hidden" name="id_record" value="0">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
|
|
|
@ -32,7 +32,7 @@ $stato = (new Stato())->getByField('name', 'Bozza', Models\Locale::getPredefined
|
|||
<input type="hidden" name="backto" value="record-edit">
|
||||
|
||||
<!-- Fix creazione da Anagrafica -->
|
||||
<input type="hidden" name="id_record" value="">
|
||||
<input type="hidden" name="id_record" value="0">
|
||||
|
||||
<div class="row">
|
||||
|
||||
|
|
|
@ -64,7 +64,7 @@ foreach ($gruppi as $modulo => $hooks) {
|
|||
</td>
|
||||
|
||||
<td class="text-center">
|
||||
'.!empty($hook->processing_at) ? Translator::timestampToLocale($hook->processing_at) : ''.'
|
||||
'.(!empty($hook->processing_at) ? Translator::timestampToLocale($hook->processing_at) : '').'
|
||||
</td>
|
||||
|
||||
<td class="text-center">';
|
||||
|
|
|
@ -26,7 +26,7 @@ echo '
|
|||
<input type="hidden" name="op" value="add">
|
||||
|
||||
<!-- Fix creazione da Anagrafica -->
|
||||
<input type="hidden" name="id_record" value="">
|
||||
<input type="hidden" name="id_record" value="0">
|
||||
|
||||
<div class="row">
|
||||
|
||||
|
|
|
@ -56,7 +56,7 @@ echo '
|
|||
<input type="hidden" name="op" value="addpagamento">
|
||||
|
||||
<!-- Fix creazione da Anagrafica -->
|
||||
<input type="hidden" name="id_record" value="">
|
||||
<input type="hidden" name="id_record" value="0">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
|
|
|
@ -27,7 +27,7 @@ echo '
|
|||
<input type="hidden" name="op" value="addprovvigione">
|
||||
|
||||
<!-- Fix creazione da Anagrafica -->
|
||||
<input type="hidden" name="id_record" value="">
|
||||
<input type="hidden" name="id_record" value="0">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
|
|
|
@ -27,7 +27,7 @@ echo '
|
|||
<input type="hidden" name="op" value="addreferente">
|
||||
|
||||
<!-- Fix creazione da Anagrafica -->
|
||||
<input type="hidden" name="id_record" value="">
|
||||
<input type="hidden" name="id_record" value="0">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
|
|
|
@ -28,7 +28,7 @@ echo '
|
|||
<input type="hidden" name="op" value="addsede">
|
||||
|
||||
<!-- Fix creazione da Anagrafica -->
|
||||
<input type="hidden" name="id_record" value="">
|
||||
<input type="hidden" name="id_record" value="0">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
|
|
|
@ -34,8 +34,8 @@ $prezzo_medio = $prezzi['media'];
|
|||
$oscillazione = $prezzo_max['prezzo'] - $prezzo_min['prezzo'];
|
||||
$oscillazione_percentuale = $prezzo_medio ? $oscillazione * 100 / $prezzo_medio : 0;
|
||||
|
||||
$data_min = strtotime($prezzo_min['data']);
|
||||
$data_max = strtotime($prezzo_max['data']);
|
||||
$data_min = $prezzo_min['data'] ? strtotime($prezzo_min['data']) : '';
|
||||
$data_max = $prezzo_max['data'] ? strtotime($prezzo_max['data']) : '';
|
||||
if ($data_min == $data_max) {
|
||||
$andamento = tr('N.D.');
|
||||
} elseif ($data_min < $data_max) {
|
||||
|
|
|
@ -43,13 +43,15 @@ class Filter
|
|||
public static function getValue($property, $method = null, $raw = false)
|
||||
{
|
||||
$value = null;
|
||||
$post = self::post($property, $raw);
|
||||
$get = self::get($property, $raw);
|
||||
|
||||
if (empty($method)) {
|
||||
$value = self::post($property, $raw) ?: self::get($property, $raw);
|
||||
$value = (!empty($post) || $post == '0') ? $post : $get;
|
||||
} elseif (strtolower($method) == 'post') {
|
||||
$value = self::post($property, $raw);
|
||||
$value = $post;
|
||||
} elseif (strtolower($method) == 'get') {
|
||||
$value = self::get($property, $raw);
|
||||
$value = $get;
|
||||
}
|
||||
|
||||
return $value;
|
||||
|
|
|
@ -117,7 +117,7 @@ class HTMLBuilder
|
|||
public static function replace($html, $depth = 0)
|
||||
{
|
||||
// Gestione dei manager generici
|
||||
preg_match_all('/'.preg_quote(self::$open['manager']).'(.+?)'.preg_quote(self::$close['manager']).'/is', $html, $managers);
|
||||
preg_match_all('/'.preg_quote(self::$open['manager']).'(.+?)'.preg_quote(self::$close['manager']).'/is', $html ?: '', $managers);
|
||||
|
||||
foreach ($managers[0] as $value) {
|
||||
$json = self::decode($value, 'manager');
|
||||
|
@ -145,7 +145,7 @@ class HTMLBuilder
|
|||
}
|
||||
|
||||
// Gestione del formato di input HTML semplificato
|
||||
preg_match_all('/'.preg_quote(self::$open['handler']).'(.+?)'.preg_quote(self::$close['handler']).'/is', $html, $handlers);
|
||||
preg_match_all('/'.preg_quote(self::$open['handler']).'(.+?)'.preg_quote(self::$close['handler']).'/is', $html ?: '', $handlers);
|
||||
|
||||
foreach ($handlers[0] as $value) {
|
||||
$json = self::decode($value, 'handler');
|
||||
|
|
Loading…
Reference in New Issue