diff --git a/include/configuration.php b/include/configuration.php index 8c11f3b07..abf381b7b 100644 --- a/include/configuration.php +++ b/include/configuration.php @@ -288,8 +288,8 @@ if (empty($creation) && (!file_exists('config.inc.php') || !$valid_config)) {
-

'.tr('Un benvenuto da OpenSTAManager!').'

-

'.tr("Prima di procedere alla configurazione e all'installazione del software, sono necessari alcuni accorgimenti per garantire il corretto funzionamento del gestionale").'.

+

'.tr('Benvenuto in OpenSTAManager!').'

+

'.tr("Prima di procedere alla configurazione e all'installazione del software, sono necessari alcuni accorgimenti per garantire il corretto funzionamento del gestionale. Stai utilizzando la versione PHP ".phpversion()."").'.


'; // Estensioni di PHP @@ -483,7 +483,7 @@ if (empty($creation) && (!file_exists('config.inc.php') || !$valid_config)) { // db_host echo '
- {[ "type": "text", "label": "'.tr('Host del database').'", "name": "db_host", "placeholder": "'.tr("Indirizzo dell'host del database").'", "value": "'.$host.'", "help": "'.tr('Esempio').': localhost", "show-help": 1, "required": 1 ]} + {[ "type": "text", "label": "'.tr('Host del database').'", "name": "db_host", "placeholder": "'.tr("Indirizzo dell'host del database").'", "value": "'.$host.'", "help": "'.tr('Esempio').': localhost", "show-help": 1, "required": 1 ]}
@@ -492,19 +492,19 @@ if (empty($creation) && (!file_exists('config.inc.php') || !$valid_config)) { // db_username echo '
- {[ "type": "text", "label": "'.tr("Username dell'utente MySQL").'", "name": "db_username", "placeholder": "'.tr("Username dell'utente MySQL").'", "value": "'.$username.'", "help": "'.tr('Esempio').': root", "show-help": 1, "required": 1 ]} + {[ "type": "text", "label": "'.tr("Username dell'utente MySQL").'", "name": "db_username", "placeholder": "'.tr("Username dell'utente MySQL").'", "value": "'.$username.'", "help": "'.tr('Esempio').': root", "show-help": 1, "required": 1 ]}
'; // db_password echo '
- {[ "type": "password", "label": "'.tr("Password dell'utente MySQL").'", "name": "db_password", "placeholder": "'.tr("Password dell'utente MySQL").'", "value": "'.$password.'", "help": "'.tr('Esempio').': mysql", "show-help": 1 ]} + {[ "type": "password", "label": "'.tr("Password dell'utente MySQL").'", "name": "db_password", "placeholder": "'.tr("Password dell'utente MySQL").'", "value": "'.$password.'", "help": "'.tr('Esempio').': mysql", "show-help": 1 ]}
'; // db_name echo '
- {[ "type": "text", "label": "'.tr('Nome del database').'", "name": "db_name", "placeholder": "'.tr('Nome del database').'", "value": "'.$name.'", "help": "'.tr('Esempio').': openstamanager", "show-help": 1, "required": 1 ]} + {[ "type": "text", "label": "'.tr('Nome del database').'", "name": "db_name", "placeholder": "'.tr('Nome del database').'", "value": "'.$name.'", "help": "'.tr('Esempio').': openstamanager", "show-help": 1, "required": 1 ]}
@@ -513,7 +513,7 @@ if (empty($creation) && (!file_exists('config.inc.php') || !$valid_config)) { // Password utente admin echo '
- {[ "type": "password", "label": "'.tr("Password dell'amministratore").'", "name": "osm_password", "placeholder": "'.tr('Scegli la password di amministratore').'", "value": "'.$osm_password.'", "help": "'.tr('Valore di default').': admin", "show-help": 1 ]} + {[ "type": "password", "label": "'.tr("Password dell'amministratore").'", "name": "osm_password", "placeholder": "'.tr('Scegli la password di amministratore').'", "value": "'.$osm_password.'", "help": "'.tr('Valore di default').': admin", "show-help": 1 ]}
'; // Email utente admin diff --git a/include/manager.php b/include/manager.php index cfd9f4175..2be8bab47 100644 --- a/include/manager.php +++ b/include/manager.php @@ -113,14 +113,6 @@ if (!empty($module_options) && $module_options != 'menu' && $module_options != ' '; - $bulk = null; - if (file_exists($docroot.$directory.'/custom/bulk.php')) { - $bulk = include $docroot.$directory.'/custom/bulk.php'; - } elseif (file_exists($docroot.$directory.'/bulk.php')) { - $bulk = include $docroot.$directory.'/bulk.php'; - } - $bulk = (array) $bulk; - echo '
diff --git a/include/update.php b/include/update.php index b72aec8a9..f7d926782 100644 --- a/include/update.php +++ b/include/update.php @@ -46,7 +46,7 @@ if (filter('action') == 'do_update') { $rate = $scriptValue; } - // Aumento della percentuale di completameno totale + // Aumento della percentuale di completamento totale if (!empty($rate)) { echo ' diff --git a/modules/interventi/init.php b/modules/interventi/init.php index bd32a320f..da2e94d5f 100644 --- a/modules/interventi/init.php +++ b/modules/interventi/init.php @@ -3,7 +3,7 @@ include_once __DIR__.'/../../core.php'; if (isset($id_record)) { - $records = $dbo->fetchArray('SELECT *, (SELECT colore FROM in_statiintervento WHERE idstatointervento=in_interventi.idstatointervento) AS colore, (SELECT idpreventivo FROM co_preventivi_interventi WHERE idintervento=in_interventi.id LIMIT 0,1) AS idpreventivo FROM in_interventi WHERE id='.prepare($id_record).Modules::getAdditionalsQuery($id_module)); + $records = $dbo->fetchArray('SELECT *, IF((in_interventi.idsede = 0), (SELECT idzona FROM an_anagrafiche WHERE idanagrafica = in_interventi.idanagrafica), (SELECT idzona FROM an_sedi WHERE id = in_interventi.idsede)) AS idzona, (SELECT colore FROM in_statiintervento WHERE idstatointervento=in_interventi.idstatointervento) AS colore, (SELECT idpreventivo FROM co_preventivi_interventi WHERE idintervento=in_interventi.id LIMIT 0,1) AS idpreventivo FROM in_interventi WHERE id='.prepare($id_record).Modules::getAdditionalsQuery($id_module)); } $jscript_modules[] = $rootdir.'/modules/interventi/js/interventi_helperjs.js'; diff --git a/modules/primanota/actions.php b/modules/primanota/actions.php index dc5f39ec9..cf249c250 100644 --- a/modules/primanota/actions.php +++ b/modules/primanota/actions.php @@ -193,7 +193,13 @@ switch (post('op')) { $rs = $dbo->fetchArray($query); // Aggiorno lo stato della fattura - $dbo->query("UPDATE co_documenti SET idstatodocumento=(SELECT id FROM co_statidocumento WHERE descrizione='Pagato') WHERE id=".prepare($iddocumento)); + if( $rs[0]['tot_pagato'] == $rs[0]['tot_da_pagare'] ){ + $stato = 'Pagato'; + } else { + $stato = 'Parzialmente pagato'; + } + + $dbo->query("UPDATE co_documenti SET idstatodocumento=(SELECT id FROM co_statidocumento WHERE descrizione=".prepare($stato).") WHERE id=".prepare($iddocumento)); // Aggiorno lo stato dei preventivi collegati alla fattura se ce ne sono $query2 = 'SELECT idpreventivo FROM co_righe_documenti WHERE iddocumento='.prepare($iddocumento).' AND NOT idpreventivo=0 AND idpreventivo IS NOT NULL'; diff --git a/templates/ddt/body.php b/templates/ddt/body.php index cfb0b0e2b..c47959744 100644 --- a/templates/ddt/body.php +++ b/templates/ddt/body.php @@ -38,7 +38,13 @@ if ($options['pricing']) { '; // Righe -$rs_gen = $dbo->fetchArray('SELECT *, (SELECT percentuale FROM co_iva WHERE id=idiva) AS perc_iva, IFNULL((SELECT peso_lordo FROM mg_articoli WHERE id=idarticolo),0) * qta AS peso_lordo, IFNULL((SELECT volume FROM mg_articoli WHERE id=idarticolo),0) * qta AS volume FROM `dt_righe_ddt` WHERE idddt='.prepare($id_record)); +$rs_gen = $dbo->fetchArray("SELECT *, + IFNULL((SELECT `codice` FROM `mg_articoli` WHERE `id` = `dt_righe_ddt`.`idarticolo`), '') AS codice_articolo, + (SELECT GROUP_CONCAT(`serial` SEPARATOR ', ') FROM `mg_prodotti` WHERE `id_riga_ddt` = `dt_righe_ddt`.`id`) AS seriali, + (SELECT `percentuale` FROM `co_iva` WHERE `id` = `dt_righe_ddt`.`idiva`) AS perc_iva, + IFNULL((SELECT peso_lordo FROM mg_articoli WHERE id=idarticolo),0) * qta AS peso_lordo, + IFNULL((SELECT volume FROM mg_articoli WHERE id=idarticolo),0) * qta AS volume +FROM `dt_righe_ddt` WHERE idddt=".prepare($id_record)); foreach ($rs_gen as $r) { $count = 0; $count += ceil(strlen($r['descrizione']) / $autofill['words']); @@ -49,6 +55,28 @@ foreach ($rs_gen as $r) { '.nl2br($r['descrizione']); + // Codice articolo + if (!empty($r['codice_articolo'])) { + echo ' +
'.tr('COD. _COD_', [ + '_COD_' => $r['codice_articolo'], + ]).''; + + if ($count <= 1) { + $count += 0.4; + } + } + + // Seriali + if (!empty($r['seriali'])) { + echo ' +
'.tr('SN').': '.$r['seriali'].''; + + if ($count <= 1) { + $count += 0.4; + } + } + // Aggiunta riferimento a ordine if (!empty($r['idordine'])) { $rso = $dbo->fetchArray('SELECT numero, numero_esterno, data FROM or_ordini WHERE id='.prepare($r['idordine'])); @@ -71,8 +99,8 @@ foreach ($rs_gen as $r) { echo ' '; if (empty($r['is_descrizione'])) { - echo - Translator::numberToLocale($r['qta']).' '.$r['um']; + echo ' + '.Translator::numberToLocale($r['qta']).' '.$r['um']; } echo ' '; @@ -92,18 +120,18 @@ foreach ($rs_gen as $r) { echo " "; if (empty($r['is_descrizione'])) { - echo - Translator::numberToLocale($r['subtotale']).' €'; + echo ' + '.Translator::numberToLocale($r['subtotale']).' €'; if ($r['sconto'] > 0) { if ($count <= 1) { $count += 0.4; } echo ' -
- '.tr('sconto _TOT_ _TYPE_', [ - '_TOT_' => Translator::numberToLocale($r['sconto_unitario']), - '_TYPE_' => ($r['tipo_sconto'] == 'PRC' ? '%' : '€'), - ]).''; +
- '.tr('sconto _TOT_ _TYPE_', [ + '_TOT_' => Translator::numberToLocale($r['sconto_unitario']), + '_TYPE_' => ($r['tipo_sconto'] == 'PRC' ? '%' : '€'), + ]).''; } } echo ' @@ -113,8 +141,8 @@ foreach ($rs_gen as $r) { echo " "; if (empty($r['is_descrizione'])) { - echo - Translator::numberToLocale($r['perc_iva']); + echo ' + '.Translator::numberToLocale($r['perc_iva']); } echo ' '; diff --git a/templates/fatture/body.php b/templates/fatture/body.php index 409ca4836..9c40ff7bd 100644 --- a/templates/fatture/body.php +++ b/templates/fatture/body.php @@ -35,7 +35,11 @@ echo " '; // RIGHE FATTURA CON ORDINAMENTO UNICO -$righe = $dbo->fetchArray("SELECT *, IFNULL((SELECT codice FROM mg_articoli WHERE id=idarticolo),'') AS codice_articolo, (SELECT percentuale FROM co_iva WHERE id=idiva) AS perc_iva FROM `co_righe_documenti` WHERE iddocumento=".prepare($id_record).' ORDER BY `order`'); +$righe = $dbo->fetchArray("SELECT *, + IFNULL((SELECT `codice` FROM `mg_articoli` WHERE `id` = `co_righe_documenti`.`idarticolo`), '') AS codice_articolo, + (SELECT GROUP_CONCAT(`serial` SEPARATOR ', ') FROM `mg_prodotti` WHERE `id_riga_documento` = `co_righe_documenti`.`id`) AS seriali, + (SELECT `percentuale` FROM `co_iva` WHERE `id` = `co_righe_documenti`.`idiva`) AS perc_iva +FROM `co_righe_documenti` WHERE `iddocumento` = ".prepare($id_record).' ORDER BY `order`'); foreach ($righe as $r) { $count = 0; $count += ceil(strlen($r['descrizione']) / $autofill['words']); @@ -46,6 +50,7 @@ foreach ($righe as $r) { '.nl2br($r['descrizione']); + // Codice articolo if (!empty($r['codice_articolo'])) { echo '
'.tr('COD. _COD_', [ @@ -57,6 +62,16 @@ foreach ($righe as $r) { } } + // Seriali + if (!empty($r['seriali'])) { + echo ' +
'.tr('SN').': '.$r['seriali'].''; + + if ($count <= 1) { + $count += 0.4; + } + } + // Aggiunta dei riferimenti ai documenti $ref_modulo = null; $ref_id = null; @@ -124,45 +139,7 @@ foreach ($righe as $r) { } } - // Aggiunta riferimento a ordine - if (!empty($r['idordine'])) { - $rso = $dbo->fetchArray('SELECT numero, numero_esterno, data FROM or_ordini WHERE id='.prepare($r['idordine'])); - $numero = !empty($rso[0]['numero_esterno']) ? $rso[0]['numero_esterno'] : $rso[0]['numero']; - - if (!empty($rso)) { - $descrizione = tr('Rif. ordine num. _NUM_ del _DATE_', [ - '_NUM_' => $numero, - '_DATE_' => Translator::dateToLocale($rso[0]['data']), - ]); - } - } - - // Aggiunta riferimento a ddt - elseif (!empty($r['idddt'])) { - $rso = $dbo->fetchArray('SELECT numero, numero_esterno, data FROM dt_ddt WHERE id='.prepare($r['idddt'])); - $numero = !empty($rso[0]['numero_esterno']) ? $rso[0]['numero_esterno'] : $rso[0]['numero']; - - if (!empty($rso)) { - $descrizione = tr('Rif. ddt num. _NUM_ del _DATE_', [ - '_NUM_' => $numero, - '_DATE_' => Translator::dateToLocale($rso[0]['data']), - ]); - } - } - - // Aggiunta riferimento al preventivo - elseif (!empty($r['idpreventivo'])) { - $rso = $dbo->fetchArray('SELECT numero, data_bozza FROM co_preventivi WHERE id='.prepare($r['idpreventivo'])); - - if (!empty($rso)) { - $descrizione = tr('Rif. preventivo num. _NUM_ del _DATE_', [ - '_NUM_' => $rso[0]['numero'], - '_DATE_' => Translator::dateToLocale($rso[0]['data_bozza']), - ]); - } - } - - // Aumento del conteggio + // Stampa dei riferimenti if (!empty($descrizione)) { echo '
'.$descrizione.''; @@ -177,8 +154,8 @@ foreach ($righe as $r) { echo ' '; if (empty($r['is_descrizione'])) { - echo - Translator::numberToLocale($r['qta']).' '.$r['um']; + echo ' + '.Translator::numberToLocale($r['qta']).' '.$r['um']; } echo ' '; @@ -187,14 +164,15 @@ foreach ($righe as $r) { echo " "; if (empty($r['is_descrizione'])) { - echo(empty($r['qta']) || empty($r['subtotale']) ? '' : Translator::numberToLocale($r['subtotale'] / $r['qta'])).' €'; + echo ' + '.(empty($r['qta']) || empty($r['subtotale']) ? '' : Translator::numberToLocale($r['subtotale'] / $r['qta'])).' €'; if ($r['sconto'] > 0) { echo " -
- ".tr('sconto _TOT_ _TYPE_', [ - '_TOT_' => Translator::numberToLocale($r['sconto_unitario']), - '_TYPE_' => ($r['tipo_sconto'] == 'PRC' ? '%' : '€'), - ]).''; +
- ".tr('sconto _TOT_ _TYPE_', [ + '_TOT_' => Translator::numberToLocale($r['sconto_unitario']), + '_TYPE_' => ($r['tipo_sconto'] == 'PRC' ? '%' : '€'), + ]).''; if ($count <= 1) { $count += 0.4; @@ -209,14 +187,15 @@ foreach ($righe as $r) { echo " "; if (empty($r['is_descrizione'])) { - echo(empty($r['subtotale']) ? '' : Translator::numberToLocale($r['subtotale'] - $r['sconto'])).' €'; + echo ' + '.(empty($r['subtotale']) ? '' : Translator::numberToLocale($r['subtotale'] - $r['sconto'])).' €'; if ($r['sconto'] > 0) { echo " -
".tr('sconto di _TOT_ _TYPE_', [ - '_TOT_' => Translator::numberToLocale($r['sconto']), - '_TYPE_' => '€', - ]).''; +
".tr('sconto di _TOT_ _TYPE_', [ + '_TOT_' => Translator::numberToLocale($r['sconto']), + '_TYPE_' => '€', + ]).''; if ($count <= 1) { $count += 0.4; @@ -230,8 +209,8 @@ foreach ($righe as $r) { echo ' '; if (empty($r['is_descrizione'])) { - echo - Translator::numberToLocale($r['perc_iva']); + echo ' + '.Translator::numberToLocale($r['perc_iva']); } echo ' diff --git a/templates/ordini/body.php b/templates/ordini/body.php index b16f43c1f..0ebcfab57 100644 --- a/templates/ordini/body.php +++ b/templates/ordini/body.php @@ -32,7 +32,11 @@ echo " '; // RIGHE PREVENTIVO CON ORDINAMENTO UNICO -$righe = $dbo->fetchArray("SELECT *, IFNULL((SELECT codice FROM mg_articoli WHERE id=idarticolo),'') AS codice_articolo, (SELECT percentuale FROM co_iva WHERE id=idiva) AS perc_iva FROM `or_righe_ordini` WHERE idordine=".prepare($id_record).' ORDER BY `order`'); +$righe = $dbo->fetchArray("SELECT *, + IFNULL((SELECT `codice` FROM `mg_articoli` WHERE `id` = `or_righe_ordini`.`idarticolo`), '') AS codice_articolo, + (SELECT GROUP_CONCAT(`serial` SEPARATOR ', ') FROM `mg_prodotti` WHERE `id_riga_ordine` = `or_righe_ordini`.`id`) AS seriali, + (SELECT `percentuale` FROM `co_iva` WHERE `id` = `or_righe_ordini`.`idiva`) AS perc_iva +FROM `or_righe_ordini` WHERE idordine=".prepare($id_record).' ORDER BY `order`'); foreach ($righe as $r) { $count = 0; $count += ceil(strlen($r['descrizione']) / $autofill['words']); @@ -43,6 +47,7 @@ foreach ($righe as $r) { '.nl2br($r['descrizione']); + // Codice articolo if (!empty($r['codice_articolo'])) { echo '
'.tr('COD. _COD_', [ @@ -54,14 +59,24 @@ foreach ($righe as $r) { } } + // Seriali + if (!empty($r['seriali'])) { + echo ' +
'.tr('SN').': '.$r['seriali'].''; + + if ($count <= 1) { + $count += 0.4; + } + } + echo ' '; echo " "; - if($r['is_descrizione']==0){ - echo - (empty($r['qta']) ? '' : Translator::numberToLocale($r['qta'])).' '.$r['um']; + if (empty($r['is_descrizione'])) { + echo ' + '.(empty($r['qta']) ? '' : Translator::numberToLocale($r['qta'])).' '.$r['um']; } echo ' '; @@ -70,16 +85,16 @@ foreach ($righe as $r) { // Prezzo unitario echo " "; - if($r['is_descrizione']==0){ - echo - (empty($r['qta']) || empty($r['subtotale']) ? '' : Translator::numberToLocale($r['subtotale'] / $r['qta'])).' €'; + if (empty($r['is_descrizione'])) { + echo ' + '.(empty($r['qta']) || empty($r['subtotale']) ? '' : Translator::numberToLocale($r['subtotale'] / $r['qta'])).' €'; if ($r['sconto'] > 0) { echo " -
- ".tr('sconto _TOT_ _TYPE_', [ - '_TOT_' => Translator::numberToLocale($r['sconto_unitario']), - '_TYPE_' => ($r['tipo_sconto'] == 'PRC' ? '%' : '€'), - ]).''; +
- ".tr('sconto _TOT_ _TYPE_', [ + '_TOT_' => Translator::numberToLocale($r['sconto_unitario']), + '_TYPE_' => ($r['tipo_sconto'] == 'PRC' ? '%' : '€'), + ]).''; if ($count <= 1) { $count += 0.4; @@ -92,16 +107,16 @@ foreach ($righe as $r) { // Imponibile echo " "; - if($r['is_descrizione']==0){ - echo - (empty($r['subtotale']) ? '' : Translator::numberToLocale($r['subtotale'])).' €'; + if (empty($r['is_descrizione'])) { + echo ' + '.(empty($r['subtotale']) ? '' : Translator::numberToLocale($r['subtotale'])).' €'; if ($r['sconto'] > 0) { echo " -
- ".tr('sconto _TOT_ _TYPE_', [ - '_TOT_' => Translator::numberToLocale($r['sconto']), - '_TYPE_' => '€', - ]).''; +
- ".tr('sconto _TOT_ _TYPE_', [ + '_TOT_' => Translator::numberToLocale($r['sconto']), + '_TYPE_' => '€', + ]).''; if ($count <= 1) { $count += 0.4; @@ -119,9 +134,9 @@ foreach ($righe as $r) { // Iva echo ' '; - if($r['is_descrizione']==0){ - echo - Translator::numberToLocale($r['perc_iva']); + if (empty($r['is_descrizione'])) { + echo ' + '.Translator::numberToLocale($r['perc_iva']); } echo ' @@ -210,7 +225,7 @@ if ($options['pricing']) { '; } -echo' +echo ' '; if (!empty($records[0]['note'])) { diff --git a/update/2_1.php b/update/2_1.php index d4c317142..d736f799a 100644 --- a/update/2_1.php +++ b/update/2_1.php @@ -1,7 +1,7 @@ fetchArray('SELECT idanagrafica, ragione_sociale, (SELECT GROUP_CONCAT(an_tipianagrafiche.descrizione) FROM an_tipianagrafiche INNER JOIN an_tipianagrafiche_anagrafiche ON an_tipianagrafiche.idtipoanagrafica=an_tipianagrafiche_anagrafiche.idtipoanagrafica WHERE idanagrafica=an_anagrafiche.idanagrafica) AS idtipianagrafica FROM an_anagrafiche WHERE idconto_cliente=0 OR idconto_fornitore=0'); for ($i = 0; $i < sizeof($rs); ++$i) { @@ -88,8 +88,8 @@ for ($i = 0; $i < sizeof($rs); ++$i) { // Eliminazione vecchi file $files = [ - $docroot.'/share/themes/default/css/font-awesome.css', - $docroot.'/modules/preventivi/js/' + DOCROOT.'/share/themes/default/css/font-awesome.css', + DOCROOT.'/modules/preventivi/js/', ]; delete($files); diff --git a/update/2_3.php b/update/2_3.php index bf417a246..8e61a4234 100644 --- a/update/2_3.php +++ b/update/2_3.php @@ -56,114 +56,5 @@ $database->query('UPDATE `zz_files` SET `created_at` = `data`'); $database->query('ALTER TABLE `zz_files` DROP `data`'); /* -* Rimozione file e cartelle deprecati +* Rimozione file e cartelle deprecati [in 2.3.1 per risolvere un problema sui percorsi] */ - -// File e cartelle deprecate -$files = [ - 'lib/jscripts', - 'lib/html2pdf', - 'widgets', - 'share', - 'lib/class.phpmailer.php', - 'lib/class.pop3.php', - 'lib/class.smtp.php', - 'lib/PHPMailerAutoload.php', - 'lib/dbo.class.php', - 'lib/html-helpers.class.php', - 'lib/photo.class.php', - 'lib/widgets.class.php', - 'modules/anagrafiche/plugins/sedi.php', - 'modules/anagrafiche/plugins/referenti.php', - 'modules/ddt/plugins/ddt.anagrafiche.php', - 'modules/my_impianti/plugins/my_impianti.anagrafiche.php', - 'templates/pdfgen.php', - 'templates/interventi/intervento_body.html', - 'templates/interventi/intervento.html', - 'templates/interventi/pdfgen.interventiphp', - 'templates/ddt/ddt_body.html', - 'templates/ddt/ddt.html', - 'templates/ddt/pdfgen.ddt', - 'templates/ordini/ordini_body.html', - 'templates/ordini/ordini.html', - 'templates/ordini/pdfgen.ordini', - 'templates/fatture/fatture_body.html', - 'templates/fatture/fatture.html', - 'templates/fatture/pdfgen.fatture.php', - 'templates/contratti/contratti_body.html', - 'templates/contratti/contratti.html', - 'templates/contratti/pdfgen.contratti.php', - 'templates/preventivi/preventivi_body.html', - 'templates/preventivi/preventivi.html', - 'templates/preventivi/pdfgen.preventivi.php', - 'templates/preventivi_cons/preventivo_body.html', - 'templates/preventivi_cons/preventivo.html', - 'templates/preventivi_cons/pdfgen.preventivi_cons.php', - 'templates/contratti_cons/contratto_body.html', - 'templates/contratti_cons/contratto.html', - 'templates/contratti_cons/pdfgen.contratti_cons.php', - 'update/install_2.0.sql', - 'update/update_2.1.sql', - 'update/update_2.1.php', - 'update/update_2.2.sql', - 'update/update_2.2.php', - 'update/update_checker.php', - 'permissions.php', - 'settings.php', - 'addgroup.php', - 'adduser.php', - 'change_pwd.php', - 'README', -]; - -foreach ($files as $key => $value) { - $files[$key] = realpath($docroot.'/'.$value); -} - -delete($files); - -// File .html dei moduli di default -// Per un problema sulla lunghezza massima del path su glob è necessario dividere le cartelle dei moduli di default da pulire -$dirs = [ - 'aggiornamenti', - 'anagrafiche', - 'articoli', - 'automezzi', - 'backup', - 'beni', - 'categorie', - 'causali', - 'contratti', - 'dashboard', - 'ddt', - 'fatture', - 'gestione_componenti', - 'interventi', - 'iva', - 'listini', - 'misure', - 'my_impianti', - 'opzioni', - 'ordini', - 'pagamenti', - 'partitario', - 'porti', - 'preventivi', - 'primanota', - 'scadenzario', - 'stati_intervento', - 'tecnici_tariffe', - 'tipi_anagrafiche', - 'tipi_intervento', - 'utenti', - 'viste', - 'voci_servizio', - 'zone', -]; - -$pieces = array_chunk($dirs, 5); - -foreach ($pieces as $piece) { - $files = glob($docroot.'/modules/{'.implode(',', $piece).'}/*.html', GLOB_BRACE); - delete($files); -} diff --git a/update/2_3_1.php b/update/2_3_1.php new file mode 100644 index 000000000..ffbe36af0 --- /dev/null +++ b/update/2_3_1.php @@ -0,0 +1,130 @@ + $value) { + $files[$key] = realpath(DOCROOT.'/'.$value); +} + +delete($files); + +// File .html dei moduli di default +// Per un problema sulla lunghezza massima del path su glob è necessario dividere le cartelle dei moduli di default da pulire +$dirs = [ + 'aggiornamenti', + 'anagrafiche', + 'articoli', + 'automezzi', + 'backup', + 'beni', + 'categorie', + 'causali', + 'contratti', + 'dashboard', + 'ddt', + 'fatture', + 'gestione_componenti', + 'interventi', + 'iva', + 'listini', + 'misure', + 'my_impianti', + 'opzioni', + 'ordini', + 'pagamenti', + 'partitario', + 'porti', + 'preventivi', + 'primanota', + 'scadenzario', + 'stati_intervento', + 'tecnici_tariffe', + 'tipi_anagrafiche', + 'tipi_intervento', + 'utenti', + 'viste', + 'voci_servizio', + 'zone', +]; + +$pieces = array_chunk($dirs, 5); + +foreach ($pieces as $piece) { + $files = glob(DOCROOT.'/modules/{'.implode(',', $piece).'}/*.html', GLOB_BRACE); + delete($files); +} + +/* +* Rimozione file e cartelle deprecati [2.3.1] +*/ + +// File e cartelle deprecate +$files = [ + 'templates/interventi/pdfgen.interventi.php', + 'templates/ddt/pdfgen.ddt.php', + 'templates/ordini/pdfgen.ordini.php', + 'templates/fatture/fattura_body.html', + 'templates/fatture/fattura.html', + 'templates/contratti/contratto_body.html', + 'templates/contratti/contratto.html', + 'templates/preventivo/preventivo_body.html', + 'templates/preventivo/preventivo.html', + 'locale/it/it.po', + 'locale/it/it.mo', +]; + +foreach ($files as $key => $value) { + $files[$key] = realpath(DOCROOT.'/'.$value); +} + +delete($files); diff --git a/update/2_3_1.sql b/update/2_3_1.sql index 48075dbe8..8551617e1 100644 --- a/update/2_3_1.sql +++ b/update/2_3_1.sql @@ -17,3 +17,13 @@ UPDATE `zz_views` SET `order_by` = 'CAST(numero AS UNSIGNED)' WHERE `name` = 'Nu -- Query per ignorare i punti nella ricerca in Ragione sociale -- UPDATE `zz_views` SET `search_inside` = CONCAT('REPLACE(', `query`, ', ''.'', '''') LIKE |search|') WHERE `name` = 'Ragione sociale'; + +-- Aggiornate le viste standard, separando i simboli < e > per non dare errore nell'aggiornamento +UPDATE `zz_views` SET `query` = 'IF(scadenza < NOW(), \'#ff7777\', \'\')' WHERE `id_module` = (SELECT `id` FROM `zz_modules` WHERE `name` = 'Scadenzario') AND `name` = '_bg_'; +UPDATE `zz_views` SET `query` = 'CONCAT(co_tipidocumento.descrizione, CONCAT(\' numero \', IF(numero_esterno <> \'\', numero_esterno, numero)))' WHERE `id_module` = (SELECT `id` FROM `zz_modules` WHERE `name` = 'Scadenzario') AND `name` = 'Data emissione'; +UPDATE `zz_views` SET `query` = 'GROUP_CONCAT(CASE WHEN totale > 0 THEN co_pianodeiconti3.descrizione ELSE NULL END)' WHERE `id_module` = (SELECT `id` FROM `zz_modules` WHERE `name` = 'Prima nota') AND `name` = 'Conto avere'; +UPDATE `zz_views` SET `query` = 'GROUP_CONCAT(CASE WHEN totale < 0 THEN co_pianodeiconti3.descrizione ELSE NULL END)' WHERE `id_module` = (SELECT `id` FROM `zz_modules` WHERE `name` = 'Prima nota') AND `name` = 'Conto dare'; + + +-- Aggiungo 1=1 nel WHERE per il widget clienti in anagrafica +UPDATE `zz_widgets` SET `query` = 'SELECT COUNT(an_anagrafiche.idanagrafica) AS dato FROM an_anagrafiche INNER JOIN (an_tipianagrafiche_anagrafiche INNER JOIN an_tipianagrafiche ON an_tipianagrafiche_anagrafiche.idtipoanagrafica=an_tipianagrafiche.idtipoanagrafica) ON an_anagrafiche.idanagrafica=an_tipianagrafiche_anagrafiche.idanagrafica WHERE 1=1 AND descrizione="Cliente" AND deleted=0' WHERE `zz_widgets`.`name` = 'Numero di clienti'; \ No newline at end of file