-
-
-
-
-
-
-
-
- {[ "type": "select", "label": "", "name": "idpagamento_acquisti", "values": "query=SELECT id, descrizione FROM co_pagamenti GROUP BY descrizione ORDER BY descrizione ASC", "value": "$idpagamento_acquisti$", "extra": "" ]}
-
-
-
- {[ "type": "select", "label": "", "name": "idbanca_acquisti", "values": "query=SELECT id, nome AS descrizione FROM co_banche ORDER BY nome ASC", "value": "$idbanca_acquisti$", "extra": "", "icon-after": "add||||" ]}
-
-
-
- {[ "type": "select", "label": "", "name": "idiva_acquisti", "values": "query=SELECT id, descrizione FROM co_iva ORDER BY descrizione ASC", "value": "$idiva_acquisti$", "extra": "" ]}
-
-
-
- {[ "type": "select", "label": "", "name": "idlistino_acquisti", "values": "query=SELECT id, nome AS descrizione FROM mg_listini ORDER BY nome ASC", "value": "$idlistino_acquisti$", "extra": "" ]}
-
-
+ if ($cliente || $fornitore) {
+ ?>
+
+
+
+
-
-
-
-
-
-
-
+
-
-
-
-
- {[ "type": "select", "label": "", "name": "idpagamento_vendite", "values": "query=SELECT id, descrizione FROM co_pagamenti GROUP BY descrizione ORDER BY descrizione ASC", "value": "$idpagamento_vendite$", "extra": "" ]}
-
-
-
- {[ "type": "select", "label": "", "name": "idbanca_vendite", "values": "query=SELECT id, nome AS descrizione FROM co_banche ORDER BY nome ASC", "value": "$idbanca_vendite$", "extra": "", "icon-after": "add||||" ]}
-
-
-
- {[ "type": "select", "label": "", "name": "idiva_vendite", "values": "query=SELECT id, descrizione FROM co_iva ORDER BY descrizione ASC", "value": "$idiva_vendite$", "extra": "" ]}
-
-
-
- {[ "type": "select", "label": "", "name": "idlistino_vendite", "values": "query=SELECT id, nome AS descrizione FROM mg_listini ORDER BY nome ASC", "value": "$idlistino_vendite$", "extra": "" ]}
-
-
-
- {[ "type": "select", "label": "", "name": "idsede_fatturazione", "values": "query=SELECT id, IF(citta = '', nomesede, CONCAT_WS(', ', nomesede, citta)) AS descrizione FROM an_sedi WHERE idanagrafica='' UNION SELECT '0' AS id, 'Sede legale' AS descrizione ORDER BY descrizione", "value": "$idsede_fatturazione$" , "extra": "" ]}
-
-
-
- {[ "type": "select", "label": "", "name": "idtipointervento_default", "values": "query=SELECT idtipointervento AS id, descrizione FROM in_tipiintervento ORDER BY descrizione ASC", "value": "$idtipointervento_default$", "extra": "" ]}
-
-
-
- {[ "type": "select", "label": "Agente principale", "name": "idagente", "values": "query=SELECT an_anagrafiche.idanagrafica AS id, IF(deleted=1, CONCAT(ragione_sociale, ' (Eliminato)'), ragione_sociale ) AS descrizione 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 (descrizione='Agente' AND deleted=0)ORDER BY ragione_sociale", "value": "$idagente$", "extra": "" ]}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {[ "type": "text", "label": "", "name": "codiceri", "value": "$codiceri$" ]}
-
-
-
- {[ "type": "text", "label": "('.tr('provincia/C.C.I.A.A.').')'; ?>", "name": "codicerea", "value": "$codicerea$" ]}
-
-
-
- {[ "type": "text", "label": "", "name": "cciaa", "value": "$cciaa$" ]}
-
-
-
- {[ "type": "text", "label": "", "name": "cciaa_citta", "value": "$cciaa_citta$" ]}
-
-
-
-
- {[ "type": "text", "label": "", "name": "iscrizione_tribunale", "value": "$iscrizione_tribunale$" ]}
-
-
-
- {[ "type": "text", "label": "", "name": "n_alboartigiani", "value": "$n_alboartigiani$" ]}
-
-
-
- {[ "type": "text", "label": "", "name": "foro_competenza", "value": "$foro_competenza$" ]}
-
-
-
- {[ "type": "text", "label": "", "name": "capitale_sociale", "value": "$capitale_sociale$" ]}
-
-
-
-
-
-
- {[ "type": "text", "label": "", "name": "appoggiobancario", "value": "$appoggiobancario$" ]}
-
-
-
- {[ "type": "text", "label": "", "name": "filiale", "value": "$filiale$" ]}
-
-
-
- {[ "type": "text", "label": "", "name": "codiceiban", "value": "$codiceiban$" ]}
-
-
-
- {[ "type": "text", "label": "", "name": "bic", "value": "$bic$" ]}
-
-
-
-
-
-
-
- {[ "type": "text", "label": "", "name": "diciturafissafattura", "value": "$diciturafissafattura$" ]}
-
-
-
-
-
- {[ "type": "text", "label": "", "name": "settore", "value": "$settore$" ]}
-
-
-
- {[ "type": "text", "label": "", "name": "marche", "value": "$marche$" ]}
-
-
-
- {[ "type": "number", "label": "", "name": "dipendenti", "decimals": 0, "value": "$dipendenti$" ]}
-
-
-
- {[ "type": "number", "label": "", "name": "macchine", "decimals": 0, "value": "$macchine$" ]}
-
-
-
-
-
-
- {[ "type": "select", "multiple": "1", "label": "", "name": "idtipoanagrafica[]", "values": "query=SELECT idtipoanagrafica AS id, descrizione FROM an_tipianagrafiche WHERE idtipoanagrafica NOT IN (SELECT DISTINCT(x.idtipoanagrafica) FROM an_tipianagrafiche_anagrafiche x INNER JOIN an_tipianagrafiche t ON x.idtipoanagrafica = t.idtipoanagrafica INNER JOIN an_anagrafiche ON an_anagrafiche.idanagrafica = x.idanagrafica WHERE t.descrizione = 'Azienda' AND deleted = 0) ORDER BY descrizione", "value": "$idtipianagrafica$" ]}
- '.tr('Questa anagrafica appartiene alla tipologia "Azienda"').'.';
- }
- ?>
-
-
-
-
-
- {[ "type": "text", "label": "", "name": "colore", "class": "colorpicker text-center", "value": "$colore$", "extra": "maxlength='7'", "icon-after": "
" ]}
-
-
-
+
- {[ "type": "select", "label": "Agenti secondari", "multiple": "1", "name": "idagenti[]", "values": "query=SELECT an_anagrafiche.idanagrafica AS id, IF(deleted=1, CONCAT(ragione_sociale, ' (Eliminato)'), ragione_sociale ) AS descrizione 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 (descrizione='Agente' AND deleted=0 AND an_anagrafiche.idanagrafica NOT IN (SELECT idagente FROM an_anagrafiche WHERE idanagrafica = )) OR (an_anagrafiche.idanagrafica IN (SELECT idagente FROM an_anagrafiche_agenti WHERE idanagrafica = ) ) ORDER BY ragione_sociale", "value": "$idagenti$" ]}
+ {[ "type": "select", "label": "", "name": "idpagamento_acquisti", "values": "query=SELECT id, descrizione FROM co_pagamenti GROUP BY descrizione ORDER BY descrizione ASC", "value": "$idpagamento_acquisti$", "extra": "" ]}
+
+
+
+ {[ "type": "select", "label": "", "name": "idbanca_acquisti", "values": "query=SELECT id, nome AS descrizione FROM co_banche ORDER BY nome ASC", "value": "$idbanca_acquisti$", "extra": "", "icon-after": "add||||" ]}
+
+
+
+ {[ "type": "select", "label": "", "name": "idiva_acquisti", "values": "query=SELECT id, descrizione FROM co_iva ORDER BY descrizione ASC", "value": "$idiva_acquisti$", "extra": "" ]}
+
+
+
+ {[ "type": "select", "label": "", "name": "idlistino_acquisti", "values": "query=SELECT id, nome AS descrizione FROM mg_listini ORDER BY nome ASC", "value": "$idlistino_acquisti$", "extra": "" ]}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {[ "type": "select", "label": "", "name": "idpagamento_vendite", "values": "query=SELECT id, descrizione FROM co_pagamenti GROUP BY descrizione ORDER BY descrizione ASC", "value": "$idpagamento_vendite$", "extra": "" ]}
+
+
+
+ {[ "type": "select", "label": "", "name": "idbanca_vendite", "values": "query=SELECT id, nome AS descrizione FROM co_banche ORDER BY nome ASC", "value": "$idbanca_vendite$", "extra": "", "icon-after": "add||||" ]}
+
+
+
+ {[ "type": "select", "label": "", "name": "idiva_vendite", "values": "query=SELECT id, descrizione FROM co_iva ORDER BY descrizione ASC", "value": "$idiva_vendite$", "extra": "" ]}
+
+
+
+ {[ "type": "select", "label": "", "name": "idlistino_vendite", "values": "query=SELECT id, nome AS descrizione FROM mg_listini ORDER BY nome ASC", "value": "$idlistino_vendite$", "extra": "" ]}
+
+
+
+ {[ "type": "select", "label": "", "name": "idsede_fatturazione", "values": "query=SELECT id, IF(citta = '', nomesede, CONCAT_WS(', ', nomesede, citta)) AS descrizione FROM an_sedi WHERE idanagrafica='' UNION SELECT '0' AS id, 'Sede legale' AS descrizione ORDER BY descrizione", "value": "$idsede_fatturazione$" , "extra": "" ]}
+
+
+
+ {[ "type": "select", "label": "", "name": "idtipointervento_default", "values": "query=SELECT idtipointervento AS id, descrizione FROM in_tipiintervento ORDER BY descrizione ASC", "value": "$idtipointervento_default$", "extra": "" ]}
+
+
+
+ {[ "type": "select", "label": "Agente principale", "name": "idagente", "values": "query=SELECT an_anagrafiche.idanagrafica AS id, IF(deleted=1, CONCAT(ragione_sociale, ' (Eliminato)'), ragione_sociale ) AS descrizione 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 (descrizione='Agente' AND deleted=0)ORDER BY ragione_sociale", "value": "$idagente$", "extra": "" ]}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {[ "type": "text", "label": "", "name": "codiceri", "value": "$codiceri$" ]}
- {[ "type": "select", "label": "", "name": "idrelazione", "values": "query=SELECT id, descrizione, colore AS _bgcolor_ FROM an_relazioni ORDER BY descrizione", "value": "$idrelazione$" ]}
+ {[ "type": "text", "label": "('.tr('provincia/C.C.I.A.A.').')'; ?>", "name": "codicerea", "value": "$codicerea$" ]}
-
-
+
+ {[ "type": "text", "label": "", "name": "cciaa", "value": "$cciaa$" ]}
+
-
-
- {[ "type": "textarea", "label": "", "name": "note", "value": "$note$" ]}
+
+ {[ "type": "text", "label": "", "name": "cciaa_citta", "value": "$cciaa_citta$" ]}
+
+
+
+
+ {[ "type": "text", "label": "", "name": "iscrizione_tribunale", "value": "$iscrizione_tribunale$" ]}
+
+
+
+ {[ "type": "text", "label": "", "name": "n_alboartigiani", "value": "$n_alboartigiani$" ]}
+
+
+
+ {[ "type": "text", "label": "", "name": "foro_competenza", "value": "$foro_competenza$" ]}
+
+
+
+ {[ "type": "text", "label": "", "name": "capitale_sociale", "value": "$capitale_sociale$" ]}
+
+
+
+
+
+
+ {[ "type": "text", "label": "", "name": "appoggiobancario", "value": "$appoggiobancario$" ]}
+
+
+
+ {[ "type": "text", "label": "", "name": "filiale", "value": "$filiale$" ]}
+
+
+
+ {[ "type": "text", "label": "", "name": "codiceiban", "value": "$codiceiban$" ]}
+
+
+
+ {[ "type": "text", "label": "", "name": "bic", "value": "$bic$" ]}
+
+
+
+
+
+
+
+ {[ "type": "text", "label": "", "name": "diciturafissafattura", "value": "$diciturafissafattura$" ]}
+
+
+
+
+
+ {[ "type": "text", "label": "", "name": "settore", "value": "$settore$" ]}
+
+
+
+ {[ "type": "text", "label": "", "name": "marche", "value": "$marche$" ]}
+
+
+
+ {[ "type": "number", "label": "", "name": "dipendenti", "decimals": 0, "value": "$dipendenti$" ]}
+
+
+
+ {[ "type": "number", "label": "", "name": "macchine", "decimals": 0, "value": "$macchine$" ]}
+
+
+
+
+
+
+ {[ "type": "select", "multiple": "1", "label": "", "name": "idtipoanagrafica[]", "values": "query=SELECT idtipoanagrafica AS id, descrizione FROM an_tipianagrafiche WHERE idtipoanagrafica NOT IN (SELECT DISTINCT(x.idtipoanagrafica) FROM an_tipianagrafiche_anagrafiche x INNER JOIN an_tipianagrafiche t ON x.idtipoanagrafica = t.idtipoanagrafica INNER JOIN an_anagrafiche ON an_anagrafiche.idanagrafica = x.idanagrafica WHERE t.descrizione = 'Azienda' AND deleted = 0) ORDER BY descrizione", "value": "$idtipianagrafica$" ]}
+ '.tr('Questa anagrafica appartiene alla tipologia "Azienda"').'.';
+ }
+ ?>
+
+
+
+
+
+ {[ "type": "text", "label": "", "name": "colore", "class": "colorpicker text-center", "value": "$colore$", "extra": "maxlength='7'", "icon-after": "
" ]}
+
+
+
+
+ {[ "type": "select", "label": "Agenti secondari", "multiple": "1", "name": "idagenti[]", "values": "query=SELECT an_anagrafiche.idanagrafica AS id, IF(deleted=1, CONCAT(ragione_sociale, ' (Eliminato)'), ragione_sociale ) AS descrizione 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 (descrizione='Agente' AND deleted=0 AND an_anagrafiche.idanagrafica NOT IN (SELECT idagente FROM an_anagrafiche WHERE idanagrafica = )) OR (an_anagrafiche.idanagrafica IN (SELECT idagente FROM an_anagrafiche_agenti WHERE idanagrafica = ) ) ORDER BY ragione_sociale", "value": "$idagenti$" ]}
+
+
+
+ {[ "type": "select", "label": "", "name": "idrelazione", "values": "query=SELECT id, descrizione, colore AS _bgcolor_ FROM an_relazioni ORDER BY descrizione", "value": "$idrelazione$" ]}
+
+
+
+
+
+
+
+ {[ "type": "textarea", "label": "", "name": "note", "value": "$note$" ]}
+
-
+
-
+
{( "name": "filelist_and_upload", "id_module": "", "id_record": "" )}
fetchArray('SELECT `co_documenti`.`id`, `co_documenti`.`data`, `co_documenti`.`numero`, `co_documenti`.`numero_esterno`, `co_tipidocumento`.`descrizione` AS tipo_documento, `co_tipidocumento`.`dir` FROM `co_documenti` JOIN `co_tipidocumento` ON `co_tipidocumento`.`id` = `co_documenti`.`idtipodocumento` WHERE `co_documenti`.`id` IN (SELECT `iddocumento` FROM `co_righe_documenti` WHERE `idanagrafica` = '.prepare($id_record).')
+if (!$records[0]['deleted']){
+
+ //fatture, ddt, preventivi, contratti, ordini, interventi, utenti collegati a questa anagrafica
+ $elementi = $dbo->fetchArray('SELECT `co_documenti`.`id`, `co_documenti`.`data`, `co_documenti`.`numero`, `co_documenti`.`numero_esterno`, `co_tipidocumento`.`descrizione` AS tipo_documento, `co_tipidocumento`.`dir` FROM `co_documenti` JOIN `co_tipidocumento` ON `co_tipidocumento`.`id` = `co_documenti`.`idtipodocumento` WHERE `co_documenti`.`id` IN (SELECT `iddocumento` FROM `co_righe_documenti` WHERE `idanagrafica` = '.prepare($id_record).')
+
+ UNION
+ SELECT `zz_users`.`id`, `zz_users`.`created_at` AS data, `zz_users`.`username` AS numero, 0 AS `numero_esterno`, "Utente" AS tipo_documento, 0 AS `dir` FROM `zz_users` WHERE `zz_users`.`idanagrafica` = '.prepare($id_record).'
+
+ UNION
+ SELECT `or_ordini`.`id`, `or_ordini`.`data`, `or_ordini`.`numero`, `or_ordini`.`numero_esterno`, `or_tipiordine`.`descrizione` AS tipo_documento, `or_tipiordine`.`dir` FROM `or_ordini` JOIN `or_tipiordine` ON `or_tipiordine`.`id` = `or_ordini`.`idtipoordine` WHERE `or_ordini`.`idanagrafica` = '.prepare($id_record).'
+
+ UNION
+ SELECT `dt_ddt`.`id`, `dt_ddt`.`data`, `dt_ddt`.`numero`, `dt_ddt`.`numero_esterno`, `dt_tipiddt`.`descrizione` AS tipo_documento, `dt_tipiddt`.`dir` FROM `dt_ddt` JOIN `dt_tipiddt` ON `dt_tipiddt`.`id` = `dt_ddt`.`idtipoddt` WHERE `dt_ddt`.`idanagrafica` = '.prepare($id_record).'
UNION
-SELECT `or_ordini`.`id`, `or_ordini`.`data`, `or_ordini`.`numero`, `or_ordini`.`numero_esterno`, `or_tipiordine`.`descrizione` AS tipo_documento, `or_tipiordine`.`dir` FROM `or_ordini` JOIN `or_tipiordine` ON `or_tipiordine`.`id` = `or_ordini`.`idtipoordine` WHERE `or_ordini`.`idanagrafica` = '.prepare($id_record).'
+ SELECT `in_interventi`.`id`, `in_interventi`.`data_richiesta`, `in_interventi`.`codice` AS numero, 0 AS numero_esterno, "Intervento" AS tipo_documento, 0 AS dir FROM `in_interventi` JOIN `in_interventi_tecnici` ON `in_interventi`.`id` = `in_interventi_tecnici`.`idintervento` WHERE `in_interventi`.`id` IN (SELECT `idintervento` FROM `in_interventi_tecnici` WHERE `idtecnico` = '.prepare($id_record).' OR `in_interventi`.`idanagrafica` = '.prepare($id_record).' )
UNION
-SELECT `dt_ddt`.`id`, `dt_ddt`.`data`, `dt_ddt`.`numero`, `dt_ddt`.`numero_esterno`, `dt_tipiddt`.`descrizione` AS tipo_documento, `dt_tipiddt`.`dir` FROM `dt_ddt` JOIN `dt_tipiddt` ON `dt_tipiddt`.`id` = `dt_ddt`.`idtipoddt` WHERE `dt_ddt`.`idanagrafica` = '.prepare($id_record).'
+ SELECT `co_contratti`.`id`, `co_contratti`.`data_bozza`, `co_contratti`.`numero`, 0 AS numero_esterno , "Contratto" AS tipo_documento, 0 AS dir FROM `co_contratti` WHERE `co_contratti`.`id` IN (SELECT `idcontratto` FROM `co_righe_contratti` WHERE `idanagrafica` = '.prepare($id_record).')
-UNION
-SELECT `in_interventi`.`id`, `in_interventi`.`data_richiesta`, `in_interventi`.`codice` AS numero, 0 AS numero_esterno, "Intervento" AS tipo_documento, 0 AS dir FROM `in_interventi` JOIN `in_interventi_tecnici` ON `in_interventi`.`id` = `in_interventi_tecnici`.`idintervento` WHERE `in_interventi`.`id` IN (SELECT `idintervento` FROM `in_interventi_tecnici` WHERE `idtecnico` = '.prepare($id_record).' OR `in_interventi`.`idanagrafica` = '.prepare($id_record).' )
+ UNION
+ SELECT `co_preventivi`.`id`, `co_preventivi`.`data_bozza`, `co_preventivi`.`numero`, 0 AS numero_esterno , "Preventivo" AS tipo_documento, 0 AS dir FROM `co_preventivi` WHERE `co_preventivi`.`id` IN (SELECT `idpreventivo` FROM `co_righe_preventivi` WHERE `idanagrafica` = '.prepare($id_record).') ORDER BY `data`');
-UNION
-SELECT `co_contratti`.`id`, `co_contratti`.`data_bozza`, `co_contratti`.`numero`, 0 AS numero_esterno , "Contratto" AS tipo_documento, 0 AS dir FROM `co_contratti` WHERE `co_contratti`.`id` IN (SELECT `idcontratto` FROM `co_righe_contratti` WHERE `idanagrafica` = '.prepare($id_record).')
+ if (!empty($elementi)) {
+ echo '
+
+
'.tr('_NUM_ altr_I_ document_I_ collegat_I_', [
+ '_NUM_' => count($elementi),
+ '_I_' => (count($elementi) > 1) ? tr('i') : tr('o'),
+ ]).':
+
';
-UNION
-SELECT `co_preventivi`.`id`, `co_preventivi`.`data_bozza`, `co_preventivi`.`numero`, 0 AS numero_esterno , "Preventivo" AS tipo_documento, 0 AS dir FROM `co_preventivi` WHERE `co_preventivi`.`id` IN (SELECT `idpreventivo` FROM `co_righe_preventivi` WHERE `idanagrafica` = '.prepare($id_record).') ORDER BY `data`');
+ foreach ($elementi as $elemento) {
+ $descrizione = tr('_DOC_ _NUM_ del _DATE_', [
+ '_DOC_' => $elemento['tipo_documento'],
+ '_NUM_' => !empty($elemento['numero_esterno']) ? $elemento['numero_esterno'] : $elemento['numero'],
+ '_DATE_' => Translator::dateToLocale($elemento['data']),
+ ]);
-if (!empty($elementi)) {
- echo '
-
-
'.tr('_NUM_ altr_I_ document_I_ collegat_I_', [
- '_NUM_' => count($elementi),
- '_I_' => (count($elementi) > 1) ? tr('i') : tr('o'),
- ]).':
-
';
+ //se non è un preventivo è un ddt o una fattura
+ //se non è un ddt è una fattura.
+ if (in_array($elemento['tipo_documento'], ['Utente'])) {
+ $modulo = 'Utenti e permessi';
+ }
+ elseif (in_array($elemento['tipo_documento'], ['Intervento'])) {
+ $modulo = 'Interventi';
+ }
+ elseif (in_array($elemento['tipo_documento'], ['Preventivo'])) {
+ $modulo = 'Preventivi';
+ }
+ elseif (in_array($elemento['tipo_documento'], ['Contratto'])) {
+ $modulo = 'Contratti';
+ }
+ elseif (in_array($elemento['tipo_documento'], ['Ordine cliente', 'Ordine fornitore'])) {
+ $modulo = ($elemento['dir'] == 'entrata') ? 'Ordini cliente' : 'Ordini fornitore';
+ }
+ elseif (in_array($elemento['tipo_documento'], ['Ddt di vendita', 'Ddt di acquisto'])) {
+ $modulo = ($elemento['dir'] == 'entrata') ? 'Ddt di vendita' : 'Ddt di acquisto';
+ }
+ else {
+ $modulo = ($elemento['dir'] == 'entrata') ? 'Fatture di vendita' : 'Fatture di acquisto';
+ }
- foreach ($elementi as $elemento) {
- $descrizione = tr('_DOC_ num. _NUM_ del _DATE_', [
- '_DOC_' => $elemento['tipo_documento'],
- '_NUM_' => !empty($elemento['numero_esterno']) ? $elemento['numero_esterno'] : $elemento['numero'],
- '_DATE_' => Translator::dateToLocale($elemento['data']),
- ]);
+ $id = $elemento['id'];
- //se non è un preventivo è un ddt o una fattura
- //se non è un ddt è una fattura.
- if (in_array($elemento['tipo_documento'], ['Intervento'])) {
- $modulo = 'Interventi';
- }
- elseif (in_array($elemento['tipo_documento'], ['Preventivo'])) {
- $modulo = 'Preventivi';
- }
- elseif (in_array($elemento['tipo_documento'], ['Contratto'])) {
- $modulo = 'Contratti';
- }
- elseif (in_array($elemento['tipo_documento'], ['Ordine cliente', 'Ordine fornitore'])) {
- $modulo = ($elemento['dir'] == 'entrata') ? 'Ordini cliente' : 'Ordini fornitore';
- }
- elseif (in_array($elemento['tipo_documento'], ['Ddt di vendita', 'Ddt di acquisto'])) {
- $modulo = ($elemento['dir'] == 'entrata') ? 'Ddt di vendita' : 'Ddt di acquisto';
- }
- else {
- $modulo = ($elemento['dir'] == 'entrata') ? 'Fatture di vendita' : 'Fatture di acquisto';
- }
+ echo '
+ - '.Modules::link($modulo, $id, $descrizione).'
';
+ }
- $id = $elemento['id'];
-
- echo '
- - '.Modules::link($modulo, $id, $descrizione).'
';
- }
-
- echo '
-
-
'.tr('Eliminando questo documento si potrebbero verificare problemi nelle altre sezioni del gestionale.').'
-
';
-}
+ echo '
+
+
'.tr('Eliminando questo documento si potrebbero verificare problemi nelle altre sezioni del gestionale.').'
+
';
+ }
-if (!str_contains($records[0]['idtipianagrafica'], $id_azienda)) {
- echo '
-
- '.tr('Elimina').'
-';
+ if (!str_contains($records[0]['idtipianagrafica'], $id_azienda)) {
+ echo '
+
+ '.tr('Elimina').'
+ ';
+ }else{
+
+ echo '
+
'.tr('Questa è l\'anagrafica "Azienda" e non è possibile eliminarla').'.
';
+ }
+
}else{
-
- echo '
-
'.tr('Questa è l\'anagrafica "Azienda" e non è possibile eliminarla').'.
';
+
+ echo '
+
'.tr('Questa anagrafica è stata eliminata').'.
';
+
}
?>
diff --git a/modules/utenti/user.php b/modules/utenti/user.php
index a710d0d23..e4bc2265d 100644
--- a/modules/utenti/user.php
+++ b/modules/utenti/user.php
@@ -17,8 +17,14 @@ if ($self_edit) {
$idgruppo = intval(filter('idgruppo'));
$id_utente = filter('id_utente');
+ //gruppo della selezione
$nome_gruppo = $dbo->fetchArray('SELECT nome FROM zz_groups WHERE id='.prepare($idgruppo))[0]['nome'];
- $nome_gruppo = substr($nome_gruppo, 0, -1).'o';
+ $gruppi = [
+ 'Clienti' => 'Cliente',
+ 'Tecnici' => 'Tecnico',
+ 'Agenti' => 'Agente',
+ ];
+ $nome_gruppo = $gruppi[$nome_gruppo];
}