mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-03-03 18:58:54 +01:00
Miglioria
This commit is contained in:
parent
9fda45c411
commit
72f569659a
@ -4,7 +4,7 @@ Tutti i maggiori cambiamenti di questo progetto saranno documentati in questo fi
|
||||
|
||||
Il formato utilizzato è basato sulle linee guida di [Keep a Changelog](http://keepachangelog.com/), e il progetto segue il [Semantic Versioning](http://semver.org/) per definire le versioni delle release.
|
||||
|
||||
- [2.5 (2024-03-22)](#25-2024-03-22)
|
||||
- [2.5 (2024-03-27)](#25-2024-03-27)
|
||||
- [2.4.54 (2024-02-02)](#2454-2024-02-02)
|
||||
- [2.4.53 (2024-01-05)](#2453-2024-01-05)
|
||||
- [2.4.52 (2023-12-08)](#2452-2023-12-08)
|
||||
@ -66,7 +66,7 @@ Il formato utilizzato è basato sulle linee guida di [Keep a Changelog](http://k
|
||||
- [2.2 (2016-11-10)](#22-2016-11-10)
|
||||
- [2.1 (2015-04-02)](#21-2015-04-02)
|
||||
|
||||
## 2.5 (2024-03-22)
|
||||
## 2.5 (2024-03-27)
|
||||
### Aggiunto (Added)
|
||||
- Aggiunte le tabelle '_lang' per la gestione delle traduzioni dei dati presenti a database
|
||||
- Aggiunta log rimozione sessioni per velocizzare la sincronizzazione dell'app
|
||||
@ -134,6 +134,8 @@ Il formato utilizzato è basato sulle linee guida di [Keep a Changelog](http://k
|
||||
- Corretta la ricerca articoli escludendo gli articoli eliminati
|
||||
- Corretta la visualizzazione della password in impostazione
|
||||
- Corretto l'ordinamento dei promemoria in **Dashboard**
|
||||
- Corretta la versione di pdfjs viewer
|
||||
- Corretta la larghezza automatica delle colonne nelle tabelle
|
||||
|
||||
## 2.4.54 (2024-02-02)
|
||||
### Aggiunto (Added)
|
||||
|
@ -67,7 +67,7 @@ if (filter('op') == 'aggiungi-allegato' || filter('op') == 'rimuovi-allegato') {
|
||||
$upload = Uploads::upload($_FILES['upload'], [
|
||||
'name' => filter('nome_allegato'),
|
||||
'category' => filter('categoria'),
|
||||
'id_module' => (new Module())->getByField('name', 'Gestione documentale', \Models\Locale::where('predefined', true)->first()->id),
|
||||
'id_module' => (new Module())->getByField('name', 'Gestione documentale', \Models\Locale::getPredefined()->id),
|
||||
'id_record' => $id_record,
|
||||
]);
|
||||
|
||||
|
1
core.php
1
core.php
@ -307,6 +307,7 @@ foreach ($list as $file) {
|
||||
if (database()->tableExists('zz_settings') && database()->tableExists('zz_langs')) {
|
||||
$id_lang = setting('Lingua');
|
||||
Models\Locale::setDefault($id_lang);
|
||||
Models\Locale::setPredefined();
|
||||
|
||||
$lang = Models\Locale::find($id_lang)->language_code;
|
||||
$translator->setLocale($lang, $formatter);
|
||||
|
8
cron.php
8
cron.php
@ -61,13 +61,13 @@ $handler->setFormatter($formatter);
|
||||
$logger->pushHandler($handler);
|
||||
|
||||
// Lettura della cache
|
||||
$ultima_esecuzione = Cache::find((new Cache())->getByField('name', 'Ultima esecuzione del cron', \Models\Locale::where('predefined', true)->first()->id));
|
||||
$ultima_esecuzione = Cache::find((new Cache())->getByField('name', 'Ultima esecuzione del cron', \Models\Locale::getPredefined()->id));
|
||||
$data = $ultima_esecuzione->content;
|
||||
|
||||
$in_esecuzione = Cache::find((new Cache())->getByField('name', 'Cron in esecuzione', \Models\Locale::where('predefined', true)->first()->id));
|
||||
$cron_id = Cache::find((new Cache())->getByField('name', 'ID del cron', \Models\Locale::where('predefined', true)->first()->id));
|
||||
$in_esecuzione = Cache::find((new Cache())->getByField('name', 'Cron in esecuzione', \Models\Locale::getPredefined()->id));
|
||||
$cron_id = Cache::find((new Cache())->getByField('name', 'ID del cron', \Models\Locale::getPredefined()->id));
|
||||
|
||||
$disattiva = Cache::find((new Cache())->getByField('name', 'Disabilita cron', \Models\Locale::where('predefined', true)->first()->id));
|
||||
$disattiva = Cache::find((new Cache())->getByField('name', 'Disabilita cron', \Models\Locale::getPredefined()->id));
|
||||
if ($disattiva->content || (in_array($_SERVER['HTTP_HOST'], ['localhost', '127.0.0.1']) && !$forza_cron_localhost)) {
|
||||
return;
|
||||
}
|
||||
|
@ -173,7 +173,7 @@ if (empty($record) || !$has_access) {
|
||||
|
||||
{( "name": "button", "type": "email", "id_module": "'.$id_module.'", "id_plugin": "'.$id_plugin.'", "id_record": "'.$id_record.'" )}';
|
||||
|
||||
if (Module::find((new Module())->getByField('name', 'Account SMS', \Models\Locale::where('predefined', true)->first()->id))) {
|
||||
if (Module::find((new Module())->getByField('name', 'Account SMS', \Models\Locale::getPredefined()->id))) {
|
||||
echo '
|
||||
{( "name": "button", "type": "sms", "id_module": "'.$id_module.'", "id_plugin": "'.$id_plugin.'", "id_record": "'.$id_record.'" )}';
|
||||
}
|
||||
|
@ -93,7 +93,7 @@ if (!empty($options['create_document'])) {
|
||||
|
||||
// Opzioni aggiuntive per le Fatture
|
||||
if (in_array($final_module->getTranslation('name'), ['Fatture di vendita', 'Fatture di acquisto'])) {
|
||||
$stato_predefinito = (new StatoFattura())->getByField('name', 'Bozza', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$stato_predefinito = (new StatoFattura())->getByField('name', 'Bozza', \Models\Locale::getPredefined()->id);
|
||||
|
||||
if (!empty($options['reversed'])) {
|
||||
$idtipodocumento = database()->fetchOne('SELECT `co_tipidocumento`.`id` FROM `co_tipidocumento` 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).') WHERE `name` = "Nota di credito" AND `dir` = \''.$dir.'\'')['id'];
|
||||
@ -131,7 +131,7 @@ if (!empty($options['create_document'])) {
|
||||
|
||||
// Opzioni aggiuntive per i Contratti
|
||||
elseif ($final_module->getTranslation('name') == 'Contratti') {
|
||||
$stato_predefinito = (new StatoContratto())->getByField('name', 'Bozza', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$stato_predefinito = (new StatoContratto())->getByField('name', 'Bozza', \Models\Locale::getPredefined()->id);
|
||||
|
||||
echo '
|
||||
<div class="col-md-6">
|
||||
@ -141,7 +141,7 @@ if (!empty($options['create_document'])) {
|
||||
|
||||
// Opzioni aggiuntive per i DDT
|
||||
elseif (in_array($final_module->getTranslation('name'), ['Ddt di vendita', 'Ddt di acquisto'])) {
|
||||
$stato_predefinito = (new Stato())->getByField('name', 'Bozza', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$stato_predefinito = (new Stato())->getByField('name', 'Bozza', \Models\Locale::getPredefined()->id);
|
||||
|
||||
echo '
|
||||
<div class="col-md-6">
|
||||
@ -149,13 +149,13 @@ if (!empty($options['create_document'])) {
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
{[ "type": "select", "label": "'.tr('Causale trasporto').'", "name": "id_causale_trasporto", "required": 1, "ajax-source": "causali", "icon-after": "add|'.(new Module())->getByField('name', 'Causali', \Models\Locale::where('predefined', true)->first()->id).'", "help": "'.tr('Definisce la causale del trasporto').'" ]}
|
||||
{[ "type": "select", "label": "'.tr('Causale trasporto').'", "name": "id_causale_trasporto", "required": 1, "ajax-source": "causali", "icon-after": "add|'.(new Module())->getByField('name', 'Causali', \Models\Locale::getPredefined()->id).'", "help": "'.tr('Definisce la causale del trasporto').'" ]}
|
||||
</div>';
|
||||
}
|
||||
|
||||
// Opzioni aggiuntive per gli Ordini
|
||||
elseif (in_array($final_module->getTranslation('name'), ['Ordini cliente', 'Ordini fornitore'])) {
|
||||
$stato_predefinito = (new StatoOrdine())->getByField('name', 'Bozza', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$stato_predefinito = (new StatoOrdine())->getByField('name', 'Bozza', \Models\Locale::getPredefined()->id);
|
||||
|
||||
echo '
|
||||
<div class="col-md-6">
|
||||
@ -170,7 +170,7 @@ if (!empty($options['create_document'])) {
|
||||
|
||||
echo '
|
||||
<div class="col-md-6">
|
||||
{[ "type": "select", "label": "'.$tipo_anagrafica.'", "name": "idanagrafica", "required": 1, "ajax-source": "'.$ajax.'", "icon-after": "add|'.(new Module())->getByField('name', 'Anagrafiche', \Models\Locale::where('predefined', true)->first()->id).'|tipoanagrafica='.$tipo_anagrafica.'" ]}
|
||||
{[ "type": "select", "label": "'.$tipo_anagrafica.'", "name": "idanagrafica", "required": 1, "ajax-source": "'.$ajax.'", "icon-after": "add|'.(new Module())->getByField('name', 'Anagrafiche', \Models\Locale::getPredefined()->id).'|tipoanagrafica='.$tipo_anagrafica.'" ]}
|
||||
</div>';
|
||||
}
|
||||
|
||||
|
@ -45,7 +45,7 @@ echo '
|
||||
// Unità di misura
|
||||
echo '
|
||||
<div class="col-md-'.$width.'">
|
||||
{[ "type": "select", "label": "'.tr('Unità di misura').'", "icon-after": "add|'.(new Module())->getByField('name', 'Unità di misura', \Models\Locale::where('predefined', true)->first()->id).'", "name": "um", "value": "'.$result['um'].'", "ajax-source": "misure" ]}
|
||||
{[ "type": "select", "label": "'.tr('Unità di misura').'", "icon-after": "add|'.(new Module())->getByField('name', 'Unità di misura', \Models\Locale::getPredefined()->id).'", "name": "um", "value": "'.$result['um'].'", "ajax-source": "misure" ]}
|
||||
</div>';
|
||||
|
||||
// Unità di misura
|
||||
|
@ -72,7 +72,7 @@ if (post('action') == 'init') {
|
||||
// Azienda predefinita
|
||||
if (!$has_azienda) {
|
||||
Filter::set('post', 'op', 'add');
|
||||
$id_module = (new Module())->getByField('name', 'Anagrafiche', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$id_module = (new Module())->getByField('name', 'Anagrafiche', \Models\Locale::getPredefined()->id);
|
||||
include base_dir().'/modules/anagrafiche/actions.php';
|
||||
|
||||
// Logo stampe
|
||||
@ -172,7 +172,7 @@ if (!$has_azienda) {
|
||||
|
||||
<div class="panel-body" id="bs-popup">';
|
||||
|
||||
$idtipoanagrafica = (new Tipo())->getByField('name', 'Azienda', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$idtipoanagrafica = (new Tipo())->getByField('name', 'Azienda', \Models\Locale::getPredefined()->id);
|
||||
$readonly_tipo = true;
|
||||
|
||||
ob_start();
|
||||
|
@ -54,7 +54,7 @@ $direzione_richiesta = $source->getDocument()->direzione == 'entrata' ? 'uscita'
|
||||
|
||||
// Individuazione DDT disponibili
|
||||
$ddt = DDT::whereHas('stato', function ($query) {
|
||||
$id_stato = (new StatoDDT())->getByField('name', 'Bozza', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$id_stato = (new StatoDDT())->getByField('name', 'Bozza', \Models\Locale::getPredefined()->id);
|
||||
$query->where('id', '!=', $id_stato);
|
||||
})->whereHas('tipo', function ($query) use ($direzione_richiesta) {
|
||||
$query->where('dir', '=', $direzione_richiesta);
|
||||
@ -70,7 +70,7 @@ foreach ($ddt as $elemento) {
|
||||
// Individuazione ordini disponibili
|
||||
$tipo_ordini = $direzione_richiesta == 'entrata' ? 'cliente' : 'fornitore';
|
||||
$ordini = Ordine::whereHas('stato', function ($query) {
|
||||
$id_stato = (new StatoOrdine())->getByField('name', 'Bozza', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$id_stato = (new StatoOrdine())->getByField('name', 'Bozza', \Models\Locale::getPredefined()->id);
|
||||
$query->where('id', '!=', $id_stato);
|
||||
})->whereHas('tipo', function ($query) use ($direzione_richiesta) {
|
||||
$query->where('dir', '=', $direzione_richiesta);
|
||||
|
@ -238,7 +238,7 @@ if (Auth::check()) {
|
||||
{ name: "tools", items : [ "Maximize", "ShowBlocks" ] },
|
||||
{ name: "about", items: [ "About" ] }
|
||||
],
|
||||
order_manager_id: "'.($dbo->isInstalled() ? (new Module())->getByField('name', 'Stato dei servizi', \Models\Locale::where('predefined', true)->first()->id) : '').'",
|
||||
order_manager_id: "'.($dbo->isInstalled() ? (new Module())->getByField('name', 'Stato dei servizi', \Models\Locale::getPredefined()->id) : '').'",
|
||||
dataload_page_buffer: '.setting('Lunghezza in pagine del buffer Datatables').',
|
||||
tempo_attesa_ricerche: '.setting('Tempo di attesa ricerche in secondi').',
|
||||
restrict_summables_to_selected: '.setting('Totali delle tabelle ristretti alla selezione').',
|
||||
|
2
mail.php
2
mail.php
@ -164,7 +164,7 @@ if ($smtp['pec'] == 1 && $module->getTranslation('name') == 'Fatture di vendita'
|
||||
echo '
|
||||
|
||||
<div class="col-md-6">
|
||||
{[ "type": "select", "multiple": "1", "label": "'.tr('Allegati').'", "name": "uploads[]", "value": "'.implode(',', $uploads).'", "help": "'.tr('Allegati del documento o caricati nell\'anagrafica dell\'azienda.').'", "values": "query=SELECT `id`, `name` AS text FROM `zz_files` WHERE `id_module` = '.prepare($id_module).' AND `id_record` = '.prepare($id_record).' UNION SELECT `id`, CONCAT(`name`, \' (Azienda)\') AS text FROM `zz_files` WHERE `id_module` = '.(new Module())->getByField('name', 'Anagrafiche', \Models\Locale::where('predefined', true)->first()->id).' AND `id_record` = (SELECT `valore` FROM `zz_settings` WHERE `name` = \'Azienda predefinita\')", "link": "allegato" ]}
|
||||
{[ "type": "select", "multiple": "1", "label": "'.tr('Allegati').'", "name": "uploads[]", "value": "'.implode(',', $uploads).'", "help": "'.tr('Allegati del documento o caricati nell\'anagrafica dell\'azienda.').'", "values": "query=SELECT `id`, `name` AS text FROM `zz_files` WHERE `id_module` = '.prepare($id_module).' AND `id_record` = '.prepare($id_record).' UNION SELECT `id`, CONCAT(`name`, \' (Azienda)\') AS text FROM `zz_files` WHERE `id_module` = '.(new Module())->getByField('name', 'Anagrafiche', \Models\Locale::getPredefined()->id).' AND `id_record` = (SELECT `valore` FROM `zz_settings` WHERE `name` = \'Azienda predefinita\')", "link": "allegato" ]}
|
||||
</div>
|
||||
</div>';
|
||||
|
||||
|
@ -39,7 +39,7 @@ switch (filter('op')) {
|
||||
}
|
||||
|
||||
// Salvataggio della versione nella cache
|
||||
Cache::find((new Cache())->getByField('name', 'Ultima esecuzione del cron', \Models\Locale::where('predefined', true)->first()->id))->set($versione);
|
||||
Cache::find((new Cache())->getByField('name', 'Ultima esecuzione del cron', \Models\Locale::getPredefined()->id))->set($versione);
|
||||
echo $versione;
|
||||
|
||||
break;
|
||||
|
@ -47,7 +47,7 @@ class UpdateHook extends CachedManager
|
||||
$update = null;
|
||||
}
|
||||
|
||||
$module = Module::find((new Module())->getByField('name', 'Aggiornamenti', \Models\Locale::where('predefined', true)->first()->id));
|
||||
$module = Module::find((new Module())->getByField('name', 'Aggiornamenti', \Models\Locale::getPredefined()->id));
|
||||
$link = base_path().'/controller.php?id_module='.$module->id;
|
||||
|
||||
$message = tr("E' disponibile la versione _VERSION_ del gestionale", [
|
||||
|
@ -21,7 +21,7 @@ use Modules\Anagrafiche\Nazione;
|
||||
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
$id_nazione_italia = (new Nazione())->getByField('name', 'Italia', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$id_nazione_italia = (new Nazione())->getByField('name', 'Italia', \Models\Locale::getPredefined()->id);
|
||||
$tipo = get('tipoanagrafica');
|
||||
if (!empty($tipo)) {
|
||||
$rs = $dbo->fetchArray('SELECT `an_tipianagrafiche`.`id`, `an_tipianagrafiche_lang`.`name` as descrizione FROM `an_tipianagrafiche` LEFT JOIN `an_tipianagrafiche_lang` ON (`an_tipianagrafiche`.`id` = `an_tipianagrafiche_lang`.`id_record` AND `an_tipianagrafiche_lang`.`id_lang` = '.prepare(Models\Locale::getDefault()->id).') WHERE `name`='.prepare($tipo));
|
||||
|
@ -24,7 +24,7 @@ use Models\Module;
|
||||
Anagrafiche
|
||||
*/
|
||||
|
||||
$link_id = (new Module())->getByField('name', 'Anagrafiche', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$link_id = (new Module())->getByField('name', 'Anagrafiche', \Models\Locale::getPredefined()->id);
|
||||
|
||||
$fields = [
|
||||
'Codice' => 'codice',
|
||||
|
@ -32,45 +32,45 @@ if (in_array($id_cliente, $tipi_anagrafica) or in_array($id_fornitore, $tipi_ana
|
||||
// Aggiunta utente per i tecnici
|
||||
if (in_array($id_tecnico, $tipi_anagrafica)) {
|
||||
echo '
|
||||
<li><a data-toggle="modal" data-title="'.tr('Aggiungi utente').'" data-href="modules/utenti/user.php?id_module='.(new Module())->getByField('name', 'Utenti e permessi', \Models\Locale::where('predefined', true)->first()->id)->id_record.'&id_record='.(new Group())->getByField('name', 'Tecnici', \Models\Locale::where('predefined', true)->first()->id).'&idanagrafica='.$record['idanagrafica'].'"><i class="fa fa-user"></i>'.tr('Nuovo utente').'
|
||||
<li><a data-toggle="modal" data-title="'.tr('Aggiungi utente').'" data-href="modules/utenti/user.php?id_module='.(new Module())->getByField('name', 'Utenti e permessi', \Models\Locale::getPredefined()->id)->id_record.'&id_record='.(new Group())->getByField('name', 'Tecnici', \Models\Locale::getPredefined()->id).'&idanagrafica='.$record['idanagrafica'].'"><i class="fa fa-user"></i>'.tr('Nuovo utente').'
|
||||
</a></li>';
|
||||
}
|
||||
|
||||
if (in_array($id_cliente, $tipi_anagrafica)) {
|
||||
echo '
|
||||
<li><a data-toggle="modal" data-title="'.tr('Aggiungi attività').'" data-href="add.php?id_module='.(new Module())->getByField('name', 'Interventi', \Models\Locale::where('predefined', true)->first()->id).'&idanagrafica='.$record['idanagrafica'].'"><i class="fa fa-wrench"></i>'.tr('Nuova attività').'
|
||||
<li><a data-toggle="modal" data-title="'.tr('Aggiungi attività').'" data-href="add.php?id_module='.(new Module())->getByField('name', 'Interventi', \Models\Locale::getPredefined()->id).'&idanagrafica='.$record['idanagrafica'].'"><i class="fa fa-wrench"></i>'.tr('Nuova attività').'
|
||||
</a></li>
|
||||
|
||||
<li><a data-toggle="modal" data-title="'.tr('Aggiungi preventivo').'" data-href="add.php?id_module='.(new Module())->getByField('name', 'Preventivi', \Models\Locale::where('predefined', true)->first()->id).'&idanagrafica='.$record['idanagrafica'].'"><i class="fa fa-file-text"></i>'.tr('Nuovo preventivo').'
|
||||
<li><a data-toggle="modal" data-title="'.tr('Aggiungi preventivo').'" data-href="add.php?id_module='.(new Module())->getByField('name', 'Preventivi', \Models\Locale::getPredefined()->id).'&idanagrafica='.$record['idanagrafica'].'"><i class="fa fa-file-text"></i>'.tr('Nuovo preventivo').'
|
||||
</a></li>
|
||||
|
||||
<li><a data-toggle="modal" data-title="'.tr('Aggiungi contratto').'" data-href="add.php?id_module='.(new Module())->getByField('name', 'Contratti', \Models\Locale::where('predefined', true)->first()->id).'&idanagrafica='.$record['idanagrafica'].'"><i class="fa fa-file-text-o"></i>'.tr('Nuovo contratto').'
|
||||
<li><a data-toggle="modal" data-title="'.tr('Aggiungi contratto').'" data-href="add.php?id_module='.(new Module())->getByField('name', 'Contratti', \Models\Locale::getPredefined()->id).'&idanagrafica='.$record['idanagrafica'].'"><i class="fa fa-file-text-o"></i>'.tr('Nuovo contratto').'
|
||||
</a></li>
|
||||
|
||||
<li><a data-toggle="modal" data-title="'.tr('Aggiungi ordine cliente').'" data-href="add.php?id_module='.(new Module())->getByField('name', 'Ordini cliente', \Models\Locale::where('predefined', true)->first()->id).'&idanagrafica='.$record['idanagrafica'].'"><i class="fa fa-file-o"></i>'.tr('Nuovo ordine cliente').'
|
||||
<li><a data-toggle="modal" data-title="'.tr('Aggiungi ordine cliente').'" data-href="add.php?id_module='.(new Module())->getByField('name', 'Ordini cliente', \Models\Locale::getPredefined()->id).'&idanagrafica='.$record['idanagrafica'].'"><i class="fa fa-file-o"></i>'.tr('Nuovo ordine cliente').'
|
||||
</a></li>
|
||||
|
||||
<li><a data-toggle="modal" data-title="'.tr('Aggiungi ddt uscita').'" data-href="add.php?id_module='.(new Module())->getByField('name', 'Ddt di vendita', \Models\Locale::where('predefined', true)->first()->id).'&idanagrafica='.$record['idanagrafica'].'"><i class="fa fa-truck"></i>'.tr('Nuovo ddt in uscita').'
|
||||
<li><a data-toggle="modal" data-title="'.tr('Aggiungi ddt uscita').'" data-href="add.php?id_module='.(new Module())->getByField('name', 'Ddt di vendita', \Models\Locale::getPredefined()->id).'&idanagrafica='.$record['idanagrafica'].'"><i class="fa fa-truck"></i>'.tr('Nuovo ddt in uscita').'
|
||||
</a></li>
|
||||
|
||||
<li><a data-toggle="modal" data-title="'.tr('Aggiungi fattura di vendita').'" data-href="add.php?id_module='.(new Module())->getByField('name', 'Fatture di vendita', \Models\Locale::where('predefined', true)->first()->id).'&idanagrafica='.$record['idanagrafica'].'"><i class="fa fa-file"></i>'.tr('Nuova fattura di vendita').'
|
||||
<li><a data-toggle="modal" data-title="'.tr('Aggiungi fattura di vendita').'" data-href="add.php?id_module='.(new Module())->getByField('name', 'Fatture di vendita', \Models\Locale::getPredefined()->id).'&idanagrafica='.$record['idanagrafica'].'"><i class="fa fa-file"></i>'.tr('Nuova fattura di vendita').'
|
||||
</a></li>
|
||||
|
||||
<li><a data-toggle="modal" data-title="'.tr('Aggiungi registrazione contabile').'" data-href="add.php?id_module='.(new Module())->getByField('name', 'Prima nota', \Models\Locale::where('predefined', true)->first()->id).'&id_anagrafica='.$record['idanagrafica'].'"><i class="fa fa-euro"></i>'.tr('Nuova registrazione contabile (cliente)').'
|
||||
<li><a data-toggle="modal" data-title="'.tr('Aggiungi registrazione contabile').'" data-href="add.php?id_module='.(new Module())->getByField('name', 'Prima nota', \Models\Locale::getPredefined()->id).'&id_anagrafica='.$record['idanagrafica'].'"><i class="fa fa-euro"></i>'.tr('Nuova registrazione contabile (cliente)').'
|
||||
</a></li>';
|
||||
}
|
||||
|
||||
if (in_array($id_fornitore, $tipi_anagrafica)) {
|
||||
echo '<li><a data-toggle="modal" data-title="'.tr('Aggiungi ordine fornitore').'" data-href="add.php?id_module='.(new Module())->getByField('name', 'Ordini fornitore', \Models\Locale::where('predefined', true)->first()->id).'&idanagrafica='.$record['idanagrafica'].'"><i class="fa fa-file-o fa-flip-horizontal"></i>'.tr('Nuovo ordine fornitore').'
|
||||
echo '<li><a data-toggle="modal" data-title="'.tr('Aggiungi ordine fornitore').'" data-href="add.php?id_module='.(new Module())->getByField('name', 'Ordini fornitore', \Models\Locale::getPredefined()->id).'&idanagrafica='.$record['idanagrafica'].'"><i class="fa fa-file-o fa-flip-horizontal"></i>'.tr('Nuovo ordine fornitore').'
|
||||
</a></li>
|
||||
|
||||
<li><a data-toggle="modal" data-title="'.tr('Aggiungi ddt entrata').'" data-href="add.php?id_module='.(new Module())->getByField('name', 'Ddt di acquisto', \Models\Locale::where('predefined', true)->first()->id).'&idanagrafica='.$record['idanagrafica'].'"><i class="fa fa-truck fa-flip-horizontal"></i>'.tr('Nuovo ddt in entrata').'
|
||||
<li><a data-toggle="modal" data-title="'.tr('Aggiungi ddt entrata').'" data-href="add.php?id_module='.(new Module())->getByField('name', 'Ddt di acquisto', \Models\Locale::getPredefined()->id).'&idanagrafica='.$record['idanagrafica'].'"><i class="fa fa-truck fa-flip-horizontal"></i>'.tr('Nuovo ddt in entrata').'
|
||||
</a></li>
|
||||
|
||||
<li><a data-toggle="modal" data-title="'.tr('Aggiungi fattura di acquisto').'" data-href="add.php?id_module='.(new Module())->getByField('name', 'Fatture di acquisto', \Models\Locale::where('predefined', true)->first()->id).'&idanagrafica='.$record['idanagrafica'].'"><i class="fa fa-file fa-flip-horizontal"></i>'.tr('Nuova fattura di acquisto').'
|
||||
<li><a data-toggle="modal" data-title="'.tr('Aggiungi fattura di acquisto').'" data-href="add.php?id_module='.(new Module())->getByField('name', 'Fatture di acquisto', \Models\Locale::getPredefined()->id).'&idanagrafica='.$record['idanagrafica'].'"><i class="fa fa-file fa-flip-horizontal"></i>'.tr('Nuova fattura di acquisto').'
|
||||
</a></li>
|
||||
|
||||
<li><a data-toggle="modal" data-title="'.tr('Aggiungi registrazione contabile').'" data-href="add.php?id_module='.(new Module())->getByField('name', 'Prima nota', \Models\Locale::where('predefined', true)->first()->id).'&id_anagrafica='.$record['idanagrafica'].'"><i class="fa fa-euro"></i>'.tr('Nuova registrazione contabile (fornitore)').'
|
||||
<li><a data-toggle="modal" data-title="'.tr('Aggiungi registrazione contabile').'" data-href="add.php?id_module='.(new Module())->getByField('name', 'Prima nota', \Models\Locale::getPredefined()->id).'&id_anagrafica='.$record['idanagrafica'].'"><i class="fa fa-euro"></i>'.tr('Nuova registrazione contabile (fornitore)').'
|
||||
</a></li>';
|
||||
}
|
||||
|
||||
|
@ -32,9 +32,9 @@ $is_agente = in_array($id_agente, $tipi_anagrafica);
|
||||
$is_azienda = in_array($id_azienda, $tipi_anagrafica);
|
||||
|
||||
if (!$is_cliente && !$is_fornitore && !$is_azienda && $is_tecnico) {
|
||||
$ignore = Plugin::where('id', '=', (new Plugin())->getByField('name', 'Sedi', \Models\Locale::where('predefined', true)->first()->id))
|
||||
->orWhere('id', '=', (new Plugin())->getByField('name', 'Referenti', \Models\Locale::where('predefined', true)->first()->id))
|
||||
->orWhere('id', '=', (new Plugin())->getByField('name', 'Dichiarazioni d\'intento', \Models\Locale::where('predefined', true)->first()->id))
|
||||
$ignore = Plugin::where('id', '=', (new Plugin())->getByField('name', 'Sedi', \Models\Locale::getPredefined()->id))
|
||||
->orWhere('id', '=', (new Plugin())->getByField('name', 'Referenti', \Models\Locale::getPredefined()->id))
|
||||
->orWhere('id', '=', (new Plugin())->getByField('name', 'Dichiarazioni d\'intento', \Models\Locale::getPredefined()->id))
|
||||
->get();
|
||||
|
||||
foreach ($ignore as $plugin) {
|
||||
@ -46,9 +46,9 @@ if (!$is_cliente && !$is_fornitore && !$is_azienda && $is_tecnico) {
|
||||
}
|
||||
|
||||
if (!$is_cliente) {
|
||||
$ignore = Plugin::where('id', '=', (new Plugin())->getByField('name', 'Impianti del cliente', \Models\Locale::where('predefined', true)->first()->id))
|
||||
->orWhere('id', '=', (new Plugin())->getByField('name', 'Contratti del cliente', \Models\Locale::where('predefined', true)->first()->id))
|
||||
->orWhere('id', '=', (new Plugin())->getByField('name', 'Ddt del cliente', \Models\Locale::where('predefined', true)->first()->id))
|
||||
$ignore = Plugin::where('id', '=', (new Plugin())->getByField('name', 'Impianti del cliente', \Models\Locale::getPredefined()->id))
|
||||
->orWhere('id', '=', (new Plugin())->getByField('name', 'Contratti del cliente', \Models\Locale::getPredefined()->id))
|
||||
->orWhere('id', '=', (new Plugin())->getByField('name', 'Ddt del cliente', \Models\Locale::getPredefined()->id))
|
||||
->get();
|
||||
|
||||
foreach ($ignore as $plugin) {
|
||||
@ -231,7 +231,7 @@ if (in_array($id_azienda, $tipi_anagrafica)) {
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
{[ "type": "select", "label": "<?php echo tr('Zona'); ?>", "name": "idzona", "values": "query=SELECT id, CONCAT_WS( ' - ', nome, descrizione) AS descrizione FROM an_zone ORDER BY descrizione ASC", "value": "$idzona$", "placeholder": "<?php echo tr('Nessuna zona'); ?>", "icon-after": "add|<?php echo (new Module())->getByField('name', 'Zone', \Models\Locale::where('predefined', true)->first()->id); ?>" ]}
|
||||
{[ "type": "select", "label": "<?php echo tr('Zona'); ?>", "name": "idzona", "values": "query=SELECT id, CONCAT_WS( ' - ', nome, descrizione) AS descrizione FROM an_zone ORDER BY descrizione ASC", "value": "$idzona$", "placeholder": "<?php echo tr('Nessuna zona'); ?>", "icon-after": "add|<?php echo (new Module())->getByField('name', 'Zone', \Models\Locale::getPredefined()->id); ?>" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
@ -460,7 +460,7 @@ if ($is_cliente or $is_fornitore or $is_tecnico) {
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
{[ "type": "select", "label": "'.tr('Relazione').'", "name": "idrelazione", "ajax-source": "relazioni", "value": "$idrelazione$", "icon-after": "add|'.(new Module())->getByField('name', 'Relazioni', \Models\Locale::where('predefined', true)->first()->id).'" ]}
|
||||
{[ "type": "select", "label": "'.tr('Relazione').'", "name": "idrelazione", "ajax-source": "relazioni", "value": "$idrelazione$", "icon-after": "add|'.(new Module())->getByField('name', 'Relazioni', \Models\Locale::getPredefined()->id).'" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-9">
|
||||
@ -476,7 +476,7 @@ if ($is_cliente or $is_fornitore or $is_tecnico) {
|
||||
$banca_predefinita = $banche->first(function ($item) {
|
||||
return !empty($item['predefined']);
|
||||
});
|
||||
$modulo_banche = (new Module())->getByField('name', 'Banche', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$modulo_banche = (new Module())->getByField('name', 'Banche', \Models\Locale::getPredefined()->id);
|
||||
if (!$banche->isEmpty()) {
|
||||
echo '
|
||||
<div class="row">
|
||||
@ -505,7 +505,7 @@ if ($is_cliente or $is_fornitore or $is_tecnico) {
|
||||
<div class="tab-pane '.(!$is_cliente ? 'hide' : 'active').'" id="cliente">
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
{[ "type": "select", "label": "'.tr('Provenienza cliente').'", "name": "id_provenienza", "ajax-source": "provenienze", "value": "$id_provenienza$", "icon-after": "add|'.(new Module())->getByField('name', 'Provenienze', \Models\Locale::where('predefined', true)->first()->id).'" ]}
|
||||
{[ "type": "select", "label": "'.tr('Provenienza cliente').'", "name": "id_provenienza", "ajax-source": "provenienze", "value": "$id_provenienza$", "icon-after": "add|'.(new Module())->getByField('name', 'Provenienze', \Models\Locale::getPredefined()->id).'" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
@ -695,7 +695,7 @@ if ($is_cliente or $is_fornitore or $is_tecnico) {
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
{[ "type": "select", "label": "<?php echo tr('Settore merceologico'); ?>", "name": "id_settore", "ajax-source": "settori", "value": "$id_settore$", "icon-after": "add|<?php echo (new Module())->getByField('name', 'Settori', \Models\Locale::where('predefined', true)->first()->id); ?>" ]}
|
||||
{[ "type": "select", "label": "<?php echo tr('Settore merceologico'); ?>", "name": "id_settore", "ajax-source": "settori", "value": "$id_settore$", "icon-after": "add|<?php echo (new Module())->getByField('name', 'Settori', \Models\Locale::getPredefined()->id); ?>" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
|
@ -27,7 +27,7 @@ $id_record = filter('id_record');
|
||||
$dir = filter('dir');
|
||||
$nome_stampa = filter('nome_stampa');
|
||||
$id_print = (new PrintTemplate())->getByField('name', $nome_stampa);
|
||||
$id_module = (new Module())->getByField('name', 'Stampe contabili', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$id_module = (new Module())->getByField('name', 'Stampe contabili', \Models\Locale::getPredefined()->id);
|
||||
|
||||
$year = (new Carbon($_SESSION['period_end']))->format('Y');
|
||||
|
||||
|
@ -60,53 +60,53 @@ if (empty($_GET['visualizza_allegati'])) {
|
||||
}
|
||||
|
||||
// Interventi dell'anagrafica
|
||||
if ($user->is_admin || in_array((new Module())->getByField('name', 'Interventi', \Models\Locale::where('predefined', true)->first()->id), $permessi)) {
|
||||
$interventi = $dbo->fetcharray('SELECT '.prepare((new Module())->getByField('name', 'Interventi', \Models\Locale::where('predefined', true)->first()->id))." AS id_module, `id` AS id_record, CONCAT('Intervento num. ',codice,' del ',DATE_FORMAT(`data_richiesta`,'%d/%m/%Y')) AS descrizione FROM `in_interventi` WHERE `idanagrafica`=".prepare($id_record));
|
||||
if ($user->is_admin || in_array((new Module())->getByField('name', 'Interventi', \Models\Locale::getPredefined()->id), $permessi)) {
|
||||
$interventi = $dbo->fetcharray('SELECT '.prepare((new Module())->getByField('name', 'Interventi', \Models\Locale::getPredefined()->id))." AS id_module, `id` AS id_record, CONCAT('Intervento num. ',codice,' del ',DATE_FORMAT(`data_richiesta`,'%d/%m/%Y')) AS descrizione FROM `in_interventi` WHERE `idanagrafica`=".prepare($id_record));
|
||||
$documenti = array_merge($documenti, $interventi);
|
||||
}
|
||||
|
||||
// Preventivi dell'anagrafica
|
||||
if ($user->is_admin || in_array((new Module())->getByField('name', 'Preventivi', \Models\Locale::where('predefined', true)->first()->id), $permessi)) {
|
||||
$preventivi = $dbo->fetcharray('SELECT '.prepare((new Module())->getByField('name', 'Preventivi', \Models\Locale::where('predefined', true)->first()->id))." AS id_module, id AS id_record, CONCAT('Preventivo num. ',numero,' del ',DATE_FORMAT(data_bozza,'%d/%m/%Y')) AS descrizione FROM co_preventivi WHERE idanagrafica=".prepare($id_record));
|
||||
if ($user->is_admin || in_array((new Module())->getByField('name', 'Preventivi', \Models\Locale::getPredefined()->id), $permessi)) {
|
||||
$preventivi = $dbo->fetcharray('SELECT '.prepare((new Module())->getByField('name', 'Preventivi', \Models\Locale::getPredefined()->id))." AS id_module, id AS id_record, CONCAT('Preventivo num. ',numero,' del ',DATE_FORMAT(data_bozza,'%d/%m/%Y')) AS descrizione FROM co_preventivi WHERE idanagrafica=".prepare($id_record));
|
||||
$documenti = array_merge($documenti, $preventivi);
|
||||
}
|
||||
|
||||
// Contratti dell'anagrafica
|
||||
if ($user->is_admin || in_array((new Module())->getByField('name', 'Contratti', \Models\Locale::where('predefined', true)->first()->id), $permessi)) {
|
||||
$contratti = $dbo->fetcharray('SELECT '.prepare((new Module())->getByField('name', 'Contratti', \Models\Locale::where('predefined', true)->first()->id))." AS id_module, id AS id_record, CONCAT('Preventivo num. ',numero,' del ',DATE_FORMAT(data_bozza,'%d/%m/%Y')) AS descrizione FROM co_contratti WHERE idanagrafica=".prepare($id_record));
|
||||
if ($user->is_admin || in_array((new Module())->getByField('name', 'Contratti', \Models\Locale::getPredefined()->id), $permessi)) {
|
||||
$contratti = $dbo->fetcharray('SELECT '.prepare((new Module())->getByField('name', 'Contratti', \Models\Locale::getPredefined()->id))." AS id_module, id AS id_record, CONCAT('Preventivo num. ',numero,' del ',DATE_FORMAT(data_bozza,'%d/%m/%Y')) AS descrizione FROM co_contratti WHERE idanagrafica=".prepare($id_record));
|
||||
$documenti = array_merge($documenti, $contratti);
|
||||
}
|
||||
|
||||
// DDT dell'anagrafica
|
||||
if ($user->is_admin || in_array((new Module())->getByField('name', 'Ddt di vendita', \Models\Locale::where('predefined', true)->first()->id), $permessi)) {
|
||||
$ddt_vendita = $dbo->fetcharray('SELECT '.prepare((new Module())->getByField('name', 'Ddt di vendita', \Models\Locale::where('predefined', true)->first()->id))." AS id_module, id AS id_record, CONCAT('Ddt di vendita num. ',IFNULL(numero_esterno,numero),' del ',DATE_FORMAT(data,'%d/%m/%Y')) AS descrizione FROM dt_ddt WHERE idanagrafica=".prepare($id_record));
|
||||
if ($user->is_admin || in_array((new Module())->getByField('name', 'Ddt di vendita', \Models\Locale::getPredefined()->id), $permessi)) {
|
||||
$ddt_vendita = $dbo->fetcharray('SELECT '.prepare((new Module())->getByField('name', 'Ddt di vendita', \Models\Locale::getPredefined()->id))." AS id_module, id AS id_record, CONCAT('Ddt di vendita num. ',IFNULL(numero_esterno,numero),' del ',DATE_FORMAT(data,'%d/%m/%Y')) AS descrizione FROM dt_ddt WHERE idanagrafica=".prepare($id_record));
|
||||
$documenti = array_merge($documenti, $ddt_vendita);
|
||||
}
|
||||
|
||||
if ($user->is_admin || in_array((new Module())->getByField('name', 'Ddt di acquisto', \Models\Locale::where('predefined', true)->first()->id), $permessi)) {
|
||||
$ddt_acquisto = $dbo->fetcharray('SELECT '.prepare((new Module())->getByField('name', 'Ddt di acquisto', \Models\Locale::where('predefined', true)->first()->id))." AS id_module, id AS id_record, CONCAT('Ddt di acquisto num. ',IFNULL(numero_esterno,numero),' del ',DATE_FORMAT(data,'%d/%m/%Y')) AS descrizione FROM dt_ddt WHERE idanagrafica=".prepare($id_record));
|
||||
if ($user->is_admin || in_array((new Module())->getByField('name', 'Ddt di acquisto', \Models\Locale::getPredefined()->id), $permessi)) {
|
||||
$ddt_acquisto = $dbo->fetcharray('SELECT '.prepare((new Module())->getByField('name', 'Ddt di acquisto', \Models\Locale::getPredefined()->id))." AS id_module, id AS id_record, CONCAT('Ddt di acquisto num. ',IFNULL(numero_esterno,numero),' del ',DATE_FORMAT(data,'%d/%m/%Y')) AS descrizione FROM dt_ddt WHERE idanagrafica=".prepare($id_record));
|
||||
$documenti = array_merge($documenti, $ddt_acquisto);
|
||||
}
|
||||
|
||||
// Fatture dell'anagrafica
|
||||
if ($user->is_admin || in_array((new Module())->getByField('name', 'Fatture di vendita', \Models\Locale::where('predefined', true)->first()->id), $permessi)) {
|
||||
$fatture_vendita = $dbo->fetcharray('SELECT '.prepare((new Module())->getByField('name', 'Fatture di vendita', \Models\Locale::where('predefined', true)->first()->id))." AS id_module, id AS id_record, CONCAT('Fattura di vendita num. ',IFNULL(numero_esterno,numero),' del ',DATE_FORMAT(data_registrazione,'%d/%m/%Y')) AS descrizione FROM co_documenti WHERE idanagrafica=".prepare($id_record));
|
||||
if ($user->is_admin || in_array((new Module())->getByField('name', 'Fatture di vendita', \Models\Locale::getPredefined()->id), $permessi)) {
|
||||
$fatture_vendita = $dbo->fetcharray('SELECT '.prepare((new Module())->getByField('name', 'Fatture di vendita', \Models\Locale::getPredefined()->id))." AS id_module, id AS id_record, CONCAT('Fattura di vendita num. ',IFNULL(numero_esterno,numero),' del ',DATE_FORMAT(data_registrazione,'%d/%m/%Y')) AS descrizione FROM co_documenti WHERE idanagrafica=".prepare($id_record));
|
||||
$documenti = array_merge($documenti, $fatture_vendita);
|
||||
}
|
||||
|
||||
if ($user->is_admin || in_array((new Module())->getByField('name', 'Fatture di acquisto', \Models\Locale::where('predefined', true)->first()->id), $permessi)) {
|
||||
$fatture_acquisto = $dbo->fetcharray('SELECT '.prepare((new Module())->getByField('name', 'Fatture di acquisto', \Models\Locale::where('predefined', true)->first()->id))." AS id_module, id AS id_record, CONCAT('Fattura di acquisto num. ',IFNULL(numero_esterno,numero),' del ',DATE_FORMAT(data_registrazione,'%d/%m/%Y')) AS descrizione FROM co_documenti WHERE idanagrafica=".prepare($id_record));
|
||||
if ($user->is_admin || in_array((new Module())->getByField('name', 'Fatture di acquisto', \Models\Locale::getPredefined()->id), $permessi)) {
|
||||
$fatture_acquisto = $dbo->fetcharray('SELECT '.prepare((new Module())->getByField('name', 'Fatture di acquisto', \Models\Locale::getPredefined()->id))." AS id_module, id AS id_record, CONCAT('Fattura di acquisto num. ',IFNULL(numero_esterno,numero),' del ',DATE_FORMAT(data_registrazione,'%d/%m/%Y')) AS descrizione FROM co_documenti WHERE idanagrafica=".prepare($id_record));
|
||||
$documenti = array_merge($documenti, $fatture_acquisto);
|
||||
}
|
||||
|
||||
// Ordini dell'anagrafica
|
||||
if ($user->is_admin || in_array((new Module())->getByField('name', 'Ordini cliente', \Models\Locale::where('predefined', true)->first()->id), $permessi)) {
|
||||
$ordini_vendita = $dbo->fetcharray('SELECT '.prepare((new Module())->getByField('name', 'Ordini cliente', \Models\Locale::where('predefined', true)->first()->id))." AS id_module, id AS id_record, CONCAT('Ordine cliente num. ',IFNULL(numero_esterno,numero),' del ',DATE_FORMAT(data,'%d/%m/%Y')) AS descrizione FROM or_ordini WHERE idanagrafica=".prepare($id_record));
|
||||
if ($user->is_admin || in_array((new Module())->getByField('name', 'Ordini cliente', \Models\Locale::getPredefined()->id), $permessi)) {
|
||||
$ordini_vendita = $dbo->fetcharray('SELECT '.prepare((new Module())->getByField('name', 'Ordini cliente', \Models\Locale::getPredefined()->id))." AS id_module, id AS id_record, CONCAT('Ordine cliente num. ',IFNULL(numero_esterno,numero),' del ',DATE_FORMAT(data,'%d/%m/%Y')) AS descrizione FROM or_ordini WHERE idanagrafica=".prepare($id_record));
|
||||
$documenti = array_merge($documenti, $ordini_vendita);
|
||||
}
|
||||
|
||||
if ($user->is_admin || in_array((new Module())->getByField('name', 'Ordini fornitore', \Models\Locale::where('predefined', true)->first()->id), $permessi)) {
|
||||
$ordini_acquisto = $dbo->fetcharray('SELECT '.prepare((new Module())->getByField('name', 'Ordini fornitore', \Models\Locale::where('predefined', true)->first()->id))." AS id_module, id AS id_record, CONCAT('Ordine fornitore num. ',IFNULL(numero_esterno,numero),' del ',DATE_FORMAT(data,'%d/%m/%Y')) AS descrizione FROM or_ordini WHERE idanagrafica=".prepare($id_record));
|
||||
if ($user->is_admin || in_array((new Module())->getByField('name', 'Ordini fornitore', \Models\Locale::getPredefined()->id), $permessi)) {
|
||||
$ordini_acquisto = $dbo->fetcharray('SELECT '.prepare((new Module())->getByField('name', 'Ordini fornitore', \Models\Locale::getPredefined()->id))." AS id_module, id AS id_record, CONCAT('Ordine fornitore num. ',IFNULL(numero_esterno,numero),' del ',DATE_FORMAT(data,'%d/%m/%Y')) AS descrizione FROM or_ordini WHERE idanagrafica=".prepare($id_record));
|
||||
$documenti = array_merge($documenti, $ordini_acquisto);
|
||||
}
|
||||
|
||||
|
@ -156,7 +156,7 @@ class Anagrafica extends Model
|
||||
public function setTipologieAttribute(array $tipologie)
|
||||
{
|
||||
if ($this->isAzienda()) {
|
||||
$tipologie[] = (new TipoAnagrafica())->getByField('name', 'Azienda', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$tipologie[] = (new TipoAnagrafica())->getByField('name', 'Azienda', \Models\Locale::getPredefined()->id);
|
||||
}
|
||||
|
||||
$tipologie = array_clean($tipologie);
|
||||
|
@ -280,7 +280,7 @@ class CSV extends CSVImporter
|
||||
|
||||
// Fix per campi con contenuti derivati da query implicite
|
||||
if (!empty($record['id_nazione'])) {
|
||||
$record['id_nazione'] = (new Nazione())->getByField('name', 'Italia', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$record['id_nazione'] = (new Nazione())->getByField('name', 'Italia', \Models\Locale::getPredefined()->id);
|
||||
} else {
|
||||
unset($record['id_nazione']);
|
||||
}
|
||||
|
@ -46,11 +46,11 @@ $aliquota_predefinita = floatval(Aliquota::find($iva_predefinita)->percentuale);
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
{[ "type": "select", "label": "<?php echo tr('Categoria'); ?>", "name": "categoria", "required": 0, "ajax-source": "categorie", "icon-after": "add|<?php echo (new Module())->getByField('name', 'Categorie articoli', \Models\Locale::where('predefined', true)->first()->id); ?>" ]}
|
||||
{[ "type": "select", "label": "<?php echo tr('Categoria'); ?>", "name": "categoria", "required": 0, "ajax-source": "categorie", "icon-after": "add|<?php echo (new Module())->getByField('name', 'Categorie articoli', \Models\Locale::getPredefined()->id); ?>" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
{[ "type": "select", "label": "<?php echo tr('Sottocategoria'); ?>", "name": "subcategoria", "id": "subcategoria_add", "ajax-source": "sottocategorie", "icon-after": "add|<?php echo (new Module())->getByField('name', 'Categorie articoli', \Models\Locale::where('predefined', true)->first()->id); ?>||hide" ]}
|
||||
{[ "type": "select", "label": "<?php echo tr('Sottocategoria'); ?>", "name": "subcategoria", "id": "subcategoria_add", "ajax-source": "sottocategorie", "icon-after": "add|<?php echo (new Module())->getByField('name', 'Categorie articoli', \Models\Locale::getPredefined()->id); ?>||hide" ]}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -104,7 +104,7 @@ $aliquota_predefinita = floatval(Aliquota::find($iva_predefinita)->percentuale);
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
{[ "type": "select", "label": "<?php echo tr('Unità di misura'); ?>", "name": "um", "value": "", "ajax-source": "misure", "icon-after": "add|<?php echo (new Module())->getByField('name', 'Unità di misura articoli', \Models\Locale::where('predefined', true)->first()->id); ?>" ]}
|
||||
{[ "type": "select", "label": "<?php echo tr('Unità di misura'); ?>", "name": "um", "value": "", "ajax-source": "misure", "icon-after": "add|<?php echo (new Module())->getByField('name', 'Unità di misura articoli', \Models\Locale::getPredefined()->id); ?>" ]}
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
{[ "type": "select", "label": "<?php echo tr('U.m. secondaria'); ?>", "name": "um_secondaria", "value": "", "ajax-source": "misure", "help": "<?php echo tr("Unità di misura da utilizzare nelle stampe di Ordini fornitori in relazione all'articolo"); ?>" ]}
|
||||
|
@ -20,7 +20,7 @@
|
||||
include_once __DIR__.'/../../../core.php';
|
||||
use Models\Module;
|
||||
|
||||
$link_id = (new Module())->getByField('name', 'Articoli', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$link_id = (new Module())->getByField('name', 'Articoli', \Models\Locale::getPredefined()->id);
|
||||
$prezzi_ivati = setting('Utilizza prezzi di vendita comprensivi di IVA');
|
||||
|
||||
$show_prezzi = Auth::user()['gruppo'] != 'Tecnici' || (Auth::user()['gruppo'] == 'Tecnici' && setting('Mostra i prezzi al tecnico'));
|
||||
|
@ -31,7 +31,7 @@ use Plugins\ListinoClienti\DettaglioPrezzo;
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
// Segmenti
|
||||
$id_preventivi = (new Module())->getByField('name', 'Preventivi', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$id_preventivi = (new Module())->getByField('name', 'Preventivi', \Models\Locale::getPredefined()->id);
|
||||
$id_segment = $_SESSION['module_'.$id_preventivi]['id_segment'];
|
||||
|
||||
switch (post('op')) {
|
||||
|
@ -53,11 +53,11 @@ use Modules\Iva\Aliquota;
|
||||
<div class="col-md-6">
|
||||
<?php echo (!empty($record['id_categoria'])) ?
|
||||
Modules::link('Categorie articoli', $record['id_categoria'], null, null, 'class="pull-right"') : ''; ?>
|
||||
{[ "type": "select", "label": "<?php echo tr('Categoria'); ?>", "name": "categoria", "required": 0, "value": "$id_categoria$", "ajax-source": "categorie", "icon-after": "add|<?php echo (new Module())->getByField('name', 'Categorie articoli', \Models\Locale::where('predefined', true)->first()->id); ?>" ]}
|
||||
{[ "type": "select", "label": "<?php echo tr('Categoria'); ?>", "name": "categoria", "required": 0, "value": "$id_categoria$", "ajax-source": "categorie", "icon-after": "add|<?php echo (new Module())->getByField('name', 'Categorie articoli', \Models\Locale::getPredefined()->id); ?>" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
{[ "type": "select", "label": "<?php echo tr('Sottocategoria'); ?>", "name": "subcategoria", "value": "$id_sottocategoria$", "ajax-source": "sottocategorie", "select-options": <?php echo json_encode(['id_categoria' => $record['id_categoria']]); ?>, "icon-after": "add|<?php echo (new Module())->getByField('name', 'Categorie articoli', \Models\Locale::where('predefined', true)->first()->id); ?>|id_original=<?php echo $record['id_categoria']; ?>" ]}
|
||||
{[ "type": "select", "label": "<?php echo tr('Sottocategoria'); ?>", "name": "subcategoria", "value": "$id_sottocategoria$", "ajax-source": "sottocategorie", "select-options": <?php echo json_encode(['id_categoria' => $record['id_categoria']]); ?>, "icon-after": "add|<?php echo (new Module())->getByField('name', 'Categorie articoli', \Models\Locale::getPredefined()->id); ?>|id_original=<?php echo $record['id_categoria']; ?>" ]}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@ -86,7 +86,7 @@ use Modules\Iva\Aliquota;
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
{[ "type": "select", "label": "<?php echo tr('Unità di misura'); ?>", "name": "um", "value": "$um$", "ajax-source": "misure", "icon-after": "add|<?php echo (new Module())->getByField('name', 'Unità di misura', \Models\Locale::where('predefined', true)->first()->id); ?>" ]}
|
||||
{[ "type": "select", "label": "<?php echo tr('Unità di misura'); ?>", "name": "um", "value": "$um$", "ajax-source": "misure", "icon-after": "add|<?php echo (new Module())->getByField('name', 'Unità di misura', \Models\Locale::getPredefined()->id); ?>" ]}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -49,7 +49,7 @@ echo '
|
||||
<div class="pull-right">';
|
||||
|
||||
echo '
|
||||
<a class="btn btn-warning btn-xs" onclick="openModal(\''.tr('Movimenta articolo').'\', \''.base_path().'/modules/articoli/modals/add_movimento.php?id_module='.(new Module())->getByField('name', 'Movimenti', \Models\Locale::where('predefined', true)->first()->id).'&id_articolo='.$id_record.'\');">
|
||||
<a class="btn btn-warning btn-xs" onclick="openModal(\''.tr('Movimenta articolo').'\', \''.base_path().'/modules/articoli/modals/add_movimento.php?id_module='.(new Module())->getByField('name', 'Movimenti', \Models\Locale::getPredefined()->id).'&id_articolo='.$id_record.'\');">
|
||||
<i class="fa fa-truck"></i>
|
||||
'.tr('Movimenta articolo').'
|
||||
</a>';
|
||||
@ -69,7 +69,7 @@ if (empty($_GET['movimentazione_completa'])) {
|
||||
}
|
||||
|
||||
echo '
|
||||
<a class="btn btn-warning btn-xs" href="'.base_path().'/controller.php?id_module='.(new Module())->getByField('name', 'Movimenti', \Models\Locale::where('predefined', true)->first()->id).'&search_Articolo='.($articolo->codice.' - '.$articolo->getTranslation('name')).'">
|
||||
<a class="btn btn-warning btn-xs" href="'.base_path().'/controller.php?id_module='.(new Module())->getByField('name', 'Movimenti', \Models\Locale::getPredefined()->id).'&search_Articolo='.($articolo->codice.' - '.$articolo->getTranslation('name')).'">
|
||||
<i class="fa fa-external-link"></i>
|
||||
'.tr('Visualizza dettagli').'
|
||||
</a>';
|
||||
|
@ -367,7 +367,7 @@ class CSV extends CSVImporter
|
||||
if (!empty($file_content)) {
|
||||
if ($record['import_immagine'] == 2 || $record['import_immagine'] == 4) {
|
||||
\Uploads::deleteLinked([
|
||||
'id_module' => (new Module())->getByField('name', 'Articoli', \Models\Locale::where('predefined', true)->first()->id),
|
||||
'id_module' => (new Module())->getByField('name', 'Articoli', \Models\Locale::getPredefined()->id),
|
||||
'id_record' => $articolo->id,
|
||||
]);
|
||||
|
||||
@ -384,7 +384,7 @@ class CSV extends CSVImporter
|
||||
'name' => 'Immagine',
|
||||
'category' => 'Immagini',
|
||||
'original_name' => $name,
|
||||
'id_module' => (new Module())->getByField('name', 'Articoli', \Models\Locale::where('predefined', true)->first()->id),
|
||||
'id_module' => (new Module())->getByField('name', 'Articoli', \Models\Locale::getPredefined()->id),
|
||||
'id_record' => $articolo->id,
|
||||
], [
|
||||
'thumbnails' => true,
|
||||
|
@ -17,7 +17,7 @@ if (!empty($idarticolo) && !empty($idautomezzo)) {
|
||||
Form di inserimento riga documento
|
||||
*/
|
||||
echo '
|
||||
<form id="link_form" action="'.$rootdir.'/editor.php?id_module='.(new Module())->getByField('name', 'Automezzi', \Models\Locale::where('predefined', true)->first()->id).'&id_record='.$idautomezzo.'" method="post">
|
||||
<form id="link_form" action="'.$rootdir.'/editor.php?id_module='.(new Module())->getByField('name', 'Automezzi', \Models\Locale::getPredefined()->id).'&id_record='.$idautomezzo.'" method="post">
|
||||
<input type="hidden" name="op" value="'.$op.'">
|
||||
<input type="hidden" name="backto" value="record-edit">
|
||||
<input type="hidden" name="id_record" value="'.$idautomezzo.'">';
|
||||
|
@ -7,7 +7,7 @@ $id_record = get('idautomezzo');
|
||||
|
||||
// Form di inserimento responsabili automezzo
|
||||
echo '
|
||||
<form action="'.$rootdir.'/editor.php?id_module='.(new Module())->getByField('name', 'Automezzi', \Models\Locale::where('predefined', true)->first()->id).'&id_record='.$id_record.'" method="post">
|
||||
<form action="'.$rootdir.'/editor.php?id_module='.(new Module())->getByField('name', 'Automezzi', \Models\Locale::getPredefined()->id).'&id_record='.$id_record.'" method="post">
|
||||
<input type="hidden" name="op" value="addtech">
|
||||
<input type="hidden" name="backto" value="record-edit">
|
||||
<input type="hidden" name="id_record" value="'.$id_record.'">
|
||||
|
@ -3,7 +3,7 @@
|
||||
include_once __DIR__.'/../../../core.php';
|
||||
use Models\Module;
|
||||
|
||||
$link_id = (new Module())->getByField('name', 'Automezzi', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$link_id = (new Module())->getByField('name', 'Automezzi', \Models\Locale::getPredefined()->id);
|
||||
|
||||
$fields = [
|
||||
'Nome' => 'nome',
|
||||
|
@ -52,7 +52,7 @@ unset($_SESSION['superselect']['idautomezzo']);
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col-md-12" >
|
||||
<form action="<?php echo $rootdir; ?>/editor.php?id_module=<?php echo (new Module())->getByField('name', 'Automezzi', \Models\Locale::where('predefined', true)->first()->id); ?>&id_record=<?php echo $id_record; ?>" id="updatetech-form" method="post" role="form">
|
||||
<form action="<?php echo $rootdir; ?>/editor.php?id_module=<?php echo (new Module())->getByField('name', 'Automezzi', \Models\Locale::getPredefined()->id); ?>&id_record=<?php echo $id_record; ?>" id="updatetech-form" method="post" role="form">
|
||||
<input type="hidden" name="backto" value="record-edit">
|
||||
<input type="hidden" name="id_record" value="<?php echo $id_record; ?>">
|
||||
<input type="hidden" name="op" value="">
|
||||
|
@ -23,7 +23,7 @@ use Models\Module;
|
||||
use Modules\Checklists\Check;
|
||||
use Modules\Impianti\Categoria;
|
||||
|
||||
$modulo_impianti = (new Module())->getByField('name', 'Impianti', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$modulo_impianti = (new Module())->getByField('name', 'Impianti', \Models\Locale::getPredefined()->id);
|
||||
|
||||
switch (filter('op')) {
|
||||
case 'update':
|
||||
|
@ -22,7 +22,7 @@ include_once __DIR__.'/../../core.php';
|
||||
use Models\Module;
|
||||
use Modules\Checklists\Checklist;
|
||||
|
||||
$checklist_module = Module::find((new Module())->getByField('name', 'Checklists', \Models\Locale::where('predefined', true)->first()->id));
|
||||
$checklist_module = Module::find((new Module())->getByField('name', 'Checklists', \Models\Locale::getPredefined()->id));
|
||||
|
||||
if (isset($id_record)) {
|
||||
$record = Checklist::find($id_record);
|
||||
|
@ -22,7 +22,7 @@ echo '
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
{[ "type": "select", "label": "'.tr('Categoria').'", "name": "id_categoria", "required": 0, "value": "$id_categoria$", "ajax-source": "categorie", "icon-after": "add|'.(new Module())->getByField('name', 'Categorie articoli', \Models\Locale::where('predefined', true)->first()->id).'" ]}
|
||||
{[ "type": "select", "label": "'.tr('Categoria').'", "name": "id_categoria", "required": 0, "value": "$id_categoria$", "ajax-source": "categorie", "icon-after": "add|'.(new Module())->getByField('name', 'Categorie articoli', \Models\Locale::getPredefined()->id).'" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
|
@ -33,7 +33,7 @@ if (!empty($combinazione->id_categoria)) {
|
||||
'.Modules::link('Categorie articoli', $combinazione->id_categoria, null, null, 'class="pull-right"');
|
||||
}
|
||||
echo '
|
||||
{[ "type": "select", "label": "'.tr('Categoria').'", "name": "id_categoria", "required": 0, "value": "$id_categoria$", "ajax-source": "categorie", "icon-after": "add|'.(new Module())->getByField('name', 'Categorie articoli', \Models\Locale::where('predefined', true)->first()->id).'" ]}
|
||||
{[ "type": "select", "label": "'.tr('Categoria').'", "name": "id_categoria", "required": 0, "value": "$id_categoria$", "ajax-source": "categorie", "icon-after": "add|'.(new Module())->getByField('name', 'Categorie articoli', \Models\Locale::getPredefined()->id).'" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
|
@ -146,7 +146,7 @@ switch (post('op')) {
|
||||
$new = $contratto->replicate(['idcontratto_prev']);
|
||||
$new->numero = Contratto::getNextNumero($contratto->data_bozza, $contratto->id_segment);
|
||||
|
||||
$stato = (new Stato())->getByField('name', 'Bozza', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$stato = (new Stato())->getByField('name', 'Bozza', \Models\Locale::getPredefined()->id);
|
||||
$new->stato()->associate($stato);
|
||||
$new->save();
|
||||
|
||||
@ -401,7 +401,7 @@ switch (post('op')) {
|
||||
$new_contratto->data_bozza = Carbon::now();
|
||||
$new_contratto->numero = Contratto::getNextNumero($new_contratto->data_bozza, $new_contratto->id_segment);
|
||||
|
||||
$stato = (new Stato())->getByField('name', 'Bozza', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$stato = (new Stato())->getByField('name', 'Bozza', \Models\Locale::getPredefined()->id);
|
||||
$new_contratto->stato()->associate($stato);
|
||||
|
||||
$new_contratto->save();
|
||||
@ -452,7 +452,7 @@ switch (post('op')) {
|
||||
foreach ($allegati as $allegato) {
|
||||
$allegato->copia([
|
||||
'id_module' => $id_module,
|
||||
'id_plugin' => (new Plugin())->getByField('name', 'Pianificazione interventi', \Models\Locale::where('predefined', true)->first()->id),
|
||||
'id_plugin' => (new Plugin())->getByField('name', 'Pianificazione interventi', \Models\Locale::getPredefined()->id),
|
||||
'id_record' => $id_promemoria,
|
||||
]);
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ $id_anagrafica = !empty(get('idanagrafica')) ? get('idanagrafica') : '';
|
||||
|
||||
$stati = get('pianificabile') ? 'SELECT `co_staticontratti`.`id`, `name` AS descrizione 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).') WHERE `is_pianificabile`=1' : 'SELECT `co_staticontratti`.`id`, `name` AS descrizione 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).')';
|
||||
|
||||
$stato = (new Stato())->getByField('name', 'Bozza', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$stato = (new Stato())->getByField('name', 'Bozza', \Models\Locale::getPredefined()->id);
|
||||
|
||||
echo '
|
||||
<form action="" method="post" id="add-form">
|
||||
@ -41,7 +41,7 @@ echo '
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
{[ "type": "select", "label": "'.tr('Cliente').'", "name": "idanagrafica", "required": 1, "value": "'.$id_anagrafica.'", "ajax-source": "clienti", "icon-after": "add|'.(new Module())->getByField('name', 'Anagrafiche', \Models\Locale::where('predefined', true)->first()->id).'|tipoanagrafica=Cliente&readonly_tipo=1", "readonly": "'.((empty(get('idanagrafica'))) ? 0 : 1).'" ]}
|
||||
{[ "type": "select", "label": "'.tr('Cliente').'", "name": "idanagrafica", "required": 1, "value": "'.$id_anagrafica.'", "ajax-source": "clienti", "icon-after": "add|'.(new Module())->getByField('name', 'Anagrafiche', \Models\Locale::getPredefined()->id).'|tipoanagrafica=Cliente&readonly_tipo=1", "readonly": "'.((empty(get('idanagrafica'))) ? 0 : 1).'" ]}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -31,7 +31,7 @@ use Modules\Fatture\Tipo;
|
||||
use Plugins\PianificazioneInterventi\Promemoria;
|
||||
|
||||
// Segmenti
|
||||
$id_fatture = (new Module())->getByField('name', 'Fatture di vendita', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$id_fatture = (new Module())->getByField('name', 'Fatture di vendita', \Models\Locale::getPredefined()->id);
|
||||
if (!isset($_SESSION['module_'.$id_fatture]['id_segment'])) {
|
||||
$segments = Modules::getSegments($id_fatture);
|
||||
$_SESSION['module_'.$id_fatture]['id_segment'] = isset($segments[0]['id']) ? $segments[0]['id'] : null;
|
||||
@ -52,7 +52,7 @@ switch (post('op')) {
|
||||
// Informazioni della fattura
|
||||
$tipo_documento = Tipo::where('id', post('idtipodocumento'))->first();
|
||||
|
||||
$stato_documenti_accodabili = (new Stato())->getByField('name', 'Bozza', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$stato_documenti_accodabili = (new Stato())->getByField('name', 'Bozza', \Models\Locale::getPredefined()->id);
|
||||
$accodare = post('accodare');
|
||||
|
||||
$data = date('Y-m-d');
|
||||
@ -165,7 +165,7 @@ switch (post('op')) {
|
||||
$new_contratto->data_conclusione = $new_contratto->data_accettazione->copy()->add($diff);
|
||||
$new_contratto->data_bozza = Carbon::now();
|
||||
|
||||
$stato = (new StatoContratto())->getByField('name', 'Bozza', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$stato = (new StatoContratto())->getByField('name', 'Bozza', \Models\Locale::getPredefined()->id);
|
||||
$new_contratto->stato()->associate($stato);
|
||||
|
||||
$new_contratto->save();
|
||||
@ -216,7 +216,7 @@ switch (post('op')) {
|
||||
foreach ($allegati as $allegato) {
|
||||
$allegato->copia([
|
||||
'id_module' => $id_module,
|
||||
'id_plugin' => (new Plugin())->getByField('name', 'Pianificazione interventi', \Models\Locale::where('predefined', true)->first()->id),
|
||||
'id_plugin' => (new Plugin())->getByField('name', 'Pianificazione interventi', \Models\Locale::getPredefined()->id),
|
||||
'id_record' => $id_promemoria,
|
||||
]);
|
||||
}
|
||||
|
@ -113,7 +113,7 @@ echo '
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
{[ "type": "select", "multiple": "1", "label": "<?php echo tr('Impianti'); ?>", "name": "matricolaimpianto[]", "values": "query=SELECT idanagrafica, id AS id, IF(nome = '', matricola, CONCAT(matricola, ' - ', nome)) AS descrizione FROM my_impianti WHERE idanagrafica='$idanagrafica$' ORDER BY descrizione", "value": "$idimpianti$", "icon-after": "add|<?php echo (new Module())->getByField('name', 'Impianti', \Models\Locale::where('predefined', true)->first()->id); ?>|<?php echo 'id_anagrafica='.$record['idanagrafica']; ?>||<?php echo (empty($block_edit)) ? '' : 'disabled'; ?>" ]}
|
||||
{[ "type": "select", "multiple": "1", "label": "<?php echo tr('Impianti'); ?>", "name": "matricolaimpianto[]", "values": "query=SELECT idanagrafica, id AS id, IF(nome = '', matricola, CONCAT(matricola, ' - ', nome)) AS descrizione FROM my_impianti WHERE idanagrafica='$idanagrafica$' ORDER BY descrizione", "value": "$idimpianti$", "icon-after": "add|<?php echo (new Module())->getByField('name', 'Impianti', \Models\Locale::getPredefined()->id); ?>|<?php echo 'id_anagrafica='.$record['idanagrafica']; ?>||<?php echo (empty($block_edit)) ? '' : 'disabled'; ?>" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
@ -347,7 +347,7 @@ if (!$block_edit) {
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
{[ "type": "select", "label": "'.tr('Articolo').'", "name": "id_articolo", "value": "", "ajax-source": "articoli", "select-options": {"permetti_movimento_a_zero": 1}, "icon-after": "add|'.(new Module())->getByField('name', 'Articoli', \Models\Locale::where('predefined', true)->first()->id).'" ]}
|
||||
{[ "type": "select", "label": "'.tr('Articolo').'", "name": "id_articolo", "value": "", "ajax-source": "articoli", "select-options": {"permetti_movimento_a_zero": 1}, "icon-after": "add|'.(new Module())->getByField('name', 'Articoli', \Models\Locale::getPredefined()->id).'" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-3" style="margin-top: 25px">
|
||||
|
@ -619,10 +619,10 @@ function modificaSeriali(button) {
|
||||
}
|
||||
init();';
|
||||
|
||||
if (Plugin::find((new Plugin())->getByField('name', 'Distinta base', \Models\Locale::where('predefined', true)->first()->id))) {
|
||||
if (Plugin::find((new Plugin())->getByField('name', 'Distinta base', \Models\Locale::getPredefined()->id))) {
|
||||
echo '
|
||||
async function viewDistinta(id_articolo) {
|
||||
openModal("'.tr('Distinta base').'", "'.Plugin::find((new Plugin())->getByField('name', 'Distinta base', \Models\Locale::where('predefined', true)->first()->id))->fileurl('view.php').'?id_module=" + globals.id_module + "&id_record=" + globals.id_record + "&id_articolo=" + id_articolo);
|
||||
openModal("'.tr('Distinta base').'", "'.Plugin::find((new Plugin())->getByField('name', 'Distinta base', \Models\Locale::getPredefined()->id))->fileurl('view.php').'?id_module=" + globals.id_module + "&id_record=" + globals.id_record + "&id_articolo=" + id_articolo);
|
||||
}';
|
||||
}
|
||||
echo '
|
||||
|
@ -67,7 +67,7 @@ class Contratto extends Document
|
||||
{
|
||||
$model = new static();
|
||||
|
||||
$stato_documento = (new Stato())->getByField('name', 'Bozza', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$stato_documento = (new Stato())->getByField('name', 'Bozza', \Models\Locale::getPredefined()->id);
|
||||
|
||||
$id_agente = $anagrafica->idagente;
|
||||
$id_segment = $id_segment ?: getSegmentPredefined($model->getModule()->id);
|
||||
|
@ -20,9 +20,9 @@
|
||||
include_once __DIR__.'/../../core.php';
|
||||
use Models\Module;
|
||||
|
||||
$modulo_interventi = Module::find((new Module())->getByField('name', 'Interventi', \Models\Locale::where('predefined', true)->first()->id));
|
||||
$modulo_preventivi = Module::find((new Module())->getByField('name', 'Preventivi', \Models\Locale::where('predefined', true)->first()->id));
|
||||
$modulo_eventi = Module::find((new Module())->getByField('name', 'Eventi', \Models\Locale::where('predefined', true)->first()->id));
|
||||
$modulo_interventi = Module::find((new Module())->getByField('name', 'Interventi', \Models\Locale::getPredefined()->id));
|
||||
$modulo_preventivi = Module::find((new Module())->getByField('name', 'Preventivi', \Models\Locale::getPredefined()->id));
|
||||
$modulo_eventi = Module::find((new Module())->getByField('name', 'Eventi', \Models\Locale::getPredefined()->id));
|
||||
|
||||
if (!isset($user['idanagrafica'])) {
|
||||
$user['idanagrafica'] = '';
|
||||
|
@ -388,7 +388,7 @@ foreach ($days as $key => $day) {
|
||||
}
|
||||
}
|
||||
|
||||
$modulo_interventi = Module::find((new Module())->getByField('name', 'Interventi', \Models\Locale::where('predefined', true)->first()->id));
|
||||
$modulo_interventi = Module::find((new Module())->getByField('name', 'Interventi', \Models\Locale::getPredefined()->id));
|
||||
|
||||
echo '
|
||||
<script type="text/javascript">
|
||||
|
@ -23,7 +23,7 @@ use Carbon\Carbon;
|
||||
use Models\Module;
|
||||
|
||||
// Trovo id_print della stampa
|
||||
$id_print = Prints::getModulePredefinedPrint((new Module())->getByField('name', 'Dashboard', \Models\Locale::where('predefined', true)->first()->id))['id'];
|
||||
$id_print = Prints::getModulePredefinedPrint((new Module())->getByField('name', 'Dashboard', \Models\Locale::getPredefined()->id))['id'];
|
||||
$date = new Carbon($_SESSION['dashboard']['date']);
|
||||
|
||||
echo '
|
||||
|
@ -472,7 +472,7 @@ switch (filter('op')) {
|
||||
*/
|
||||
case 'completa_trasporto':
|
||||
$tipo = Tipo::where('dir', '!=', $ddt->direzione)->first();
|
||||
$stato = (new Stato())->getByField('name', 'Evaso', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$stato = (new Stato())->getByField('name', 'Evaso', \Models\Locale::getPredefined()->id);
|
||||
|
||||
// Duplicazione DDT
|
||||
$id_segment = post('id_segment');
|
||||
@ -520,7 +520,7 @@ switch (filter('op')) {
|
||||
$ddt->save();
|
||||
|
||||
$id_record = $copia->id;
|
||||
$id_module = $ddt->direzione == 'entrata' ? (new Module())->getByField('name', 'Ddt di acquisto', \Models\Locale::where('predefined', true)->first()->id) : (new Module())->getByField('name', 'Ddt di vendita', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$id_module = $ddt->direzione == 'entrata' ? (new Module())->getByField('name', 'Ddt di acquisto', \Models\Locale::getPredefined()->id) : (new Module())->getByField('name', 'Ddt di vendita', \Models\Locale::getPredefined()->id);
|
||||
|
||||
break;
|
||||
|
||||
@ -531,7 +531,7 @@ switch (filter('op')) {
|
||||
$new->numero = DDT::getNextNumero($new->data, $dir, $id_segment);
|
||||
$new->numero_esterno = DDT::getNextNumeroSecondario($new->data, $dir, $new->id_segment);
|
||||
|
||||
$stato = (new Stato())->getByField('name', 'Bozza', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$stato = (new Stato())->getByField('name', 'Bozza', \Models\Locale::getPredefined()->id);
|
||||
$new->stato()->associate($stato);
|
||||
$new->save();
|
||||
|
||||
|
@ -27,14 +27,14 @@ $module = Module::find($id_module);
|
||||
if ($module->getTranslation('name') == 'Ddt di vendita') {
|
||||
$dir = 'entrata';
|
||||
|
||||
$id_tipoddt = (new Tipo())->getByField('name', 'Ddt in uscita', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$id_tipoddt = (new Tipo())->getByField('name', 'Ddt in uscita', \Models\Locale::getPredefined()->id);
|
||||
|
||||
$tipo_anagrafica = tr('Cliente');
|
||||
$label = tr('Destinatario');
|
||||
} else {
|
||||
$dir = 'uscita';
|
||||
|
||||
$id_tipoddt = (new Tipo())->getByField('name', 'Ddt in entrata', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$id_tipoddt = (new Tipo())->getByField('name', 'Ddt in entrata', \Models\Locale::getPredefined()->id);
|
||||
|
||||
$tipo_anagrafica = tr('Fornitore');
|
||||
$label = tr('Mittente');
|
||||
@ -56,7 +56,7 @@ $id_anagrafica = !empty(get('idanagrafica')) ? get('idanagrafica') : '';
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
{[ "type": "select", "label": "<?php echo $label; ?>", "name": "idanagrafica", "id": "idanagrafica_add", "required": 1, "value": "<?php echo $id_anagrafica; ?>", "ajax-source": "clienti_fornitori", "icon-after": "add|<?php echo (new Module())->getByField('name', 'Anagrafiche', \Models\Locale::where('predefined', true)->first()->id); ?>|tipoanagrafica=<?php echo $tipo_anagrafica; ?>" ]}
|
||||
{[ "type": "select", "label": "<?php echo $label; ?>", "name": "idanagrafica", "id": "idanagrafica_add", "required": 1, "value": "<?php echo $id_anagrafica; ?>", "ajax-source": "clienti_fornitori", "icon-after": "add|<?php echo (new Module())->getByField('name', 'Anagrafiche', \Models\Locale::getPredefined()->id); ?>|tipoanagrafica=<?php echo $tipo_anagrafica; ?>" ]}
|
||||
</div>
|
||||
|
||||
<!-- il campo idtipoddt può essere anche rimosso -->
|
||||
@ -67,7 +67,7 @@ $id_anagrafica = !empty(get('idanagrafica')) ? get('idanagrafica') : '';
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
{[ "type": "select", "label": "<?php echo tr('Causale trasporto'); ?>", "name": "idcausalet", "required": 1, "value": "<?php echo $id_causalet; ?>", "ajax-source": "causali", "icon-after": "add|<?php echo (new Module())->getByField('name', 'Causali', \Models\Locale::where('predefined', true)->first()->id); ?>|||" ]}
|
||||
{[ "type": "select", "label": "<?php echo tr('Causale trasporto'); ?>", "name": "idcausalet", "required": 1, "value": "<?php echo $id_causalet; ?>", "ajax-source": "causali", "icon-after": "add|<?php echo (new Module())->getByField('name', 'Causali', \Models\Locale::getPredefined()->id); ?>|||" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
|
@ -55,7 +55,7 @@ switch (post('op')) {
|
||||
// Informazioni della fattura
|
||||
$tipo_documento = Tipo::where('id', post('idtipodocumento'))->first();
|
||||
|
||||
$stato_documenti_accodabili = (new Stato())->getByField('name', 'Bozza', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$stato_documenti_accodabili = (new Stato())->getByField('name', 'Bozza', \Models\Locale::getPredefined()->id);
|
||||
$accodare = post('accodare');
|
||||
|
||||
$data = date('Y-m-d');
|
||||
|
@ -21,7 +21,7 @@ use Models\Module;
|
||||
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
$id_module_collegamento = $ddt->direzione == 'entrata' ? (new Module())->getByField('name', 'Ddt di acquisto', \Models\Locale::where('predefined', true)->first()->id) : (new Module())->getByField('name', 'Ddt di vendita', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$id_module_collegamento = $ddt->direzione == 'entrata' ? (new Module())->getByField('name', 'Ddt di acquisto', \Models\Locale::getPredefined()->id) : (new Module())->getByField('name', 'Ddt di vendita', \Models\Locale::getPredefined()->id);
|
||||
|
||||
// Informazioni sui movimenti interni
|
||||
if (!empty($ddt->id_ddt_trasporto_interno)) {
|
||||
|
@ -159,8 +159,8 @@ echo '
|
||||
|
||||
// Conteggio numero articoli ddt in uscita
|
||||
$articolo = $dbo->fetchArray('SELECT `mg_articoli`.`id` FROM ((`mg_articoli` INNER JOIN `dt_righe_ddt` ON `mg_articoli`.`id`=`dt_righe_ddt`.`idarticolo`) INNER JOIN `dt_ddt` ON `dt_ddt`.`id`=`dt_righe_ddt`.`idddt`) WHERE `dt_ddt`.`id`='.prepare($id_record));
|
||||
$id_modulo_anagrafiche = (new Module())->getByField('name', 'Anagrafiche', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$id_plugin_sedi = (new Plugin())->getByField('name', 'Sedi', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$id_modulo_anagrafiche = (new Module())->getByField('name', 'Anagrafiche', \Models\Locale::getPredefined()->id);
|
||||
$id_plugin_sedi = (new Plugin())->getByField('name', 'Sedi', \Models\Locale::getPredefined()->id);
|
||||
if ($dir == 'entrata') {
|
||||
echo '
|
||||
<div class="col-md-6">
|
||||
@ -340,7 +340,7 @@ echo '
|
||||
<div class="panel-body">
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
{[ "type": "select", "label": "<?php echo tr('Aspetto beni'); ?>", "name": "idaspettobeni", "value": "$idaspettobeni$", "ajax-source": "aspetto-beni", "icon-after": "add|<?php echo (new Module())->getByField('name', 'Aspetto beni', \Models\Locale::where('predefined', true)->first()->id); ?>|||<?php echo $block_edit ? 'disabled' : ''; ?>" ]}
|
||||
{[ "type": "select", "label": "<?php echo tr('Aspetto beni'); ?>", "name": "idaspettobeni", "value": "$idaspettobeni$", "ajax-source": "aspetto-beni", "icon-after": "add|<?php echo (new Module())->getByField('name', 'Aspetto beni', \Models\Locale::getPredefined()->id); ?>|||<?php echo $block_edit ? 'disabled' : ''; ?>" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
@ -349,7 +349,7 @@ echo '
|
||||
echo Modules::link('Causali', $record['idcausalet'], null, null, 'class="pull-right"');
|
||||
}
|
||||
?>
|
||||
{[ "type": "select", "label": "<?php echo tr('Causale trasporto'); ?>", "name": "idcausalet", "required": 1, "value": "$idcausalet$", "ajax-source": "causali", "icon-after": "add|<?php echo (new Module())->getByField('name', 'Causali', \Models\Locale::where('predefined', true)->first()->id); ?>|||<?php echo $block_edit ? 'disabled' : ''; ?>", "help": "<?php echo tr('Definisce la causale del trasporto'); ?>" ]}
|
||||
{[ "type": "select", "label": "<?php echo tr('Causale trasporto'); ?>", "name": "idcausalet", "required": 1, "value": "$idcausalet$", "ajax-source": "causali", "icon-after": "add|<?php echo (new Module())->getByField('name', 'Causali', \Models\Locale::getPredefined()->id); ?>|||<?php echo $block_edit ? 'disabled' : ''; ?>", "help": "<?php echo tr('Definisce la causale del trasporto'); ?>" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
@ -379,7 +379,7 @@ $esterno = $dbo->selectOne('dt_spedizione', 'esterno', [
|
||||
'id' => $record['idspedizione'],
|
||||
])['esterno'];
|
||||
?>
|
||||
{[ "type": "select", "label": "<?php echo tr('Vettore'); ?>", "name": "idvettore", "ajax-source": "vettori", "value": "$idvettore$", "disabled": <?php echo empty($esterno) || (!empty($esterno) && !empty($record['idvettore'])) ? 1 : 0; ?>, "required": <?php echo !empty($esterno) ?: 0; ?>, "icon-after": "add|<?php echo (new Module())->getByField('name', 'Anagrafiche', \Models\Locale::where('predefined', true)->first()->id); ?>|tipoanagrafica=Vettore&readonly_tipo=1|btn_idvettore|<?php echo ($esterno and (intval(!$record['flag_completato']) || empty($record['idvettore']))) ? '' : 'disabled'; ?>", "class": "<?php echo empty($record['idvettore']) ? 'unblockable' : ''; ?>" ]}
|
||||
{[ "type": "select", "label": "<?php echo tr('Vettore'); ?>", "name": "idvettore", "ajax-source": "vettori", "value": "$idvettore$", "disabled": <?php echo empty($esterno) || (!empty($esterno) && !empty($record['idvettore'])) ? 1 : 0; ?>, "required": <?php echo !empty($esterno) ?: 0; ?>, "icon-after": "add|<?php echo (new Module())->getByField('name', 'Anagrafiche', \Models\Locale::getPredefined()->id); ?>|tipoanagrafica=Vettore&readonly_tipo=1|btn_idvettore|<?php echo ($esterno and (intval(!$record['flag_completato']) || empty($record['idvettore']))) ? '' : 'disabled'; ?>", "class": "<?php echo empty($record['idvettore']) ? 'unblockable' : ''; ?>" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
@ -566,7 +566,7 @@ if (!$block_edit) {
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
{[ "type": "select", "label": "'.tr('Articolo').'", "name": "id_articolo", "value": "", "ajax-source": "articoli", "select-options": {"permetti_movimento_a_zero": '.($dir == 'entrata' ? 0 : 1).', "idsede_partenza": '.intval($ddt->idsede_partenza).', "idsede_destinazione": '.intval($ddt->idsede_destinazione).', "idanagrafica": '.$ddt->idanagrafica.', "dir": "'.$dir.'", "idagente": '.$ddt->idagente.'}, "icon-after": "add|'.(new Module())->getByField('name', 'Articoli', \Models\Locale::where('predefined', true)->first()->id).'" ]}
|
||||
{[ "type": "select", "label": "'.tr('Articolo').'", "name": "id_articolo", "value": "", "ajax-source": "articoli", "select-options": {"permetti_movimento_a_zero": '.($dir == 'entrata' ? 0 : 1).', "idsede_partenza": '.intval($ddt->idsede_partenza).', "idsede_destinazione": '.intval($ddt->idsede_destinazione).', "idanagrafica": '.$ddt->idanagrafica.', "dir": "'.$dir.'", "idagente": '.$ddt->idagente.'}, "icon-after": "add|'.(new Module())->getByField('name', 'Articoli', \Models\Locale::getPredefined()->id).'" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-3" style="margin-top: 25px">
|
||||
|
@ -657,10 +657,10 @@ function aggiornaInline(id) {
|
||||
}
|
||||
init();';
|
||||
|
||||
if (Plugin::find((new Plugin())->getByField('name', 'Distinta base', \Models\Locale::where('predefined', true)->first()->id))) {
|
||||
if (Plugin::find((new Plugin())->getByField('name', 'Distinta base', \Models\Locale::getPredefined()->id))) {
|
||||
echo '
|
||||
async function viewDistinta(id_articolo) {
|
||||
openModal("'.tr('Distinta base').'", "'.Plugin::find((new Plugin())->getByField('name', 'Distinta base', \Models\Locale::where('predefined', true)->first()->id))->fileurl('view.php').'?id_module=" + globals.id_module + "&id_record=" + globals.id_record + "&id_articolo=" + id_articolo);
|
||||
openModal("'.tr('Distinta base').'", "'.Plugin::find((new Plugin())->getByField('name', 'Distinta base', \Models\Locale::getPredefined()->id))->fileurl('view.php').'?id_module=" + globals.id_module + "&id_record=" + globals.id_record + "&id_articolo=" + id_articolo);
|
||||
}';
|
||||
}
|
||||
echo '
|
||||
|
@ -60,7 +60,7 @@ class DDT extends Document
|
||||
$model = new static();
|
||||
$user = \Auth::user();
|
||||
|
||||
$stato_documento = (new Stato())->getByField('name', 'Bozza', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$stato_documento = (new Stato())->getByField('name', 'Bozza', \Models\Locale::getPredefined()->id);
|
||||
|
||||
$direzione = $tipo_documento->dir;
|
||||
$id_segment = $id_segment ?: getSegmentPredefined($model->getModule()->id);
|
||||
|
@ -113,7 +113,7 @@ switch ($op) {
|
||||
WHERE
|
||||
`co_statidocumento_lang`.`name` = "Emessa" AND `co_tipidocumento`.`dir` = "entrata" AND `co_documenti`.`id_segment`='.$fattura->id_segment);
|
||||
|
||||
if ((setting('Data emissione fattura automatica') == 1) && ($dir == 'entrata') && ($stato->id == (new Stato())->getByField('name', 'Emessa', \Models\Locale::where('predefined', true)->first()->id)) && Carbon::parse($data)->lessThan(Carbon::parse($data_fattura_precedente['datamax'])) && (!empty($data_fattura_precedente['datamax']))) {
|
||||
if ((setting('Data emissione fattura automatica') == 1) && ($dir == 'entrata') && ($stato->id == (new Stato())->getByField('name', 'Emessa', \Models\Locale::getPredefined()->id)) && Carbon::parse($data)->lessThan(Carbon::parse($data_fattura_precedente['datamax'])) && (!empty($data_fattura_precedente['datamax']))) {
|
||||
$fattura->data = $data_fattura_precedente['datamax'];
|
||||
$fattura->data_competenza = $data_fattura_precedente['datamax'];
|
||||
flash()->info(tr('Data di emissione aggiornata, come da impostazione!'));
|
||||
@ -313,7 +313,7 @@ switch ($op) {
|
||||
// Elenco fatture in stato Bozza per il cliente
|
||||
case 'fatture_bozza':
|
||||
$id_anagrafica = post('id_anagrafica');
|
||||
$stato = (new Stato())->getByField('name', 'Bozza', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$stato = (new Stato())->getByField('name', 'Bozza', \Models\Locale::getPredefined()->id);
|
||||
|
||||
$fatture = Fattura::vendita()
|
||||
->where('idanagrafica', $id_anagrafica)
|
||||
@ -332,8 +332,8 @@ switch ($op) {
|
||||
// Elenco fatture Scadute per il cliente
|
||||
case 'fatture_scadute':
|
||||
$id_anagrafica = post('id_anagrafica');
|
||||
$stato1 = (new Stato())->getByField('name', 'Emessa', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$stato2 = (new Stato())->getByField('name', 'Parzialmente pagato', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$stato1 = (new Stato())->getByField('name', 'Emessa', \Models\Locale::getPredefined()->id);
|
||||
$stato2 = (new Stato())->getByField('name', 'Parzialmente pagato', \Models\Locale::getPredefined()->id);
|
||||
|
||||
$fatture = Fattura::vendita()
|
||||
->select('*', 'co_documenti.id AS id', 'co_documenti.data AS data')
|
||||
@ -406,10 +406,10 @@ switch ($op) {
|
||||
|
||||
case 'reopen':
|
||||
if (!empty($id_record)) {
|
||||
$stato = (new Stato())->getByField('name', 'Bozza', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$stato = (new Stato())->getByField('name', 'Bozza', \Models\Locale::getPredefined()->id);
|
||||
$fattura->stato()->associate($stato);
|
||||
$fattura->save();
|
||||
$stato = (new Stato())->getByField('name', 'Emessa', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$stato = (new Stato())->getByField('name', 'Emessa', \Models\Locale::getPredefined()->id);
|
||||
$fattura->stato()->associate($stato);
|
||||
$fattura->save();
|
||||
flash()->info(tr('Fattura riaperta!'));
|
||||
@ -918,7 +918,7 @@ switch ($op) {
|
||||
|
||||
// Aggiunta tipologia cliente se necessario
|
||||
if (!$anagrafica->isTipo('Cliente')) {
|
||||
$tipo_cliente = (new TipoAnagrafica())->getByField('name', 'Cliente', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$tipo_cliente = (new TipoAnagrafica())->getByField('name', 'Cliente', \Models\Locale::getPredefined()->id);
|
||||
$tipi = $anagrafica->tipi->pluck('id')->toArray();
|
||||
$tipi[] = $tipo_cliente;
|
||||
|
||||
@ -929,7 +929,7 @@ switch ($op) {
|
||||
$fattura->id_autofattura = $autofattura->id;
|
||||
$fattura->save();
|
||||
|
||||
$id_module = (new Module())->getByField('name', 'Fatture di vendita', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$id_module = (new Module())->getByField('name', 'Fatture di vendita', \Models\Locale::getPredefined()->id);
|
||||
$id_record = $autofattura->id;
|
||||
|
||||
break;
|
||||
@ -1045,7 +1045,7 @@ switch ($op) {
|
||||
if (in_array($idtipodocumento, $tipologie)) {
|
||||
// Aggiunta tipologia cliente se necessario
|
||||
if (!$azienda->isTipo('Cliente')) {
|
||||
$tipo_cliente = (new TipoAnagrafica())->getByField('name', 'Cliente', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$tipo_cliente = (new TipoAnagrafica())->getByField('name', 'Cliente', \Models\Locale::getPredefined()->id);
|
||||
$tipi = $azienda->tipi->pluck('id')->toArray();
|
||||
$tipi[] = $tipo_cliente;
|
||||
|
||||
@ -1168,7 +1168,7 @@ switch ($op) {
|
||||
break;
|
||||
|
||||
case 'cambia_stato':
|
||||
$stato = Stato::find((new Stato())->getByField('name', 'Non valida', \Models\Locale::where('predefined', true)->first()->id));
|
||||
$stato = Stato::find((new Stato())->getByField('name', 'Non valida', \Models\Locale::getPredefined()->id));
|
||||
$fattura->stato()->associate($stato);
|
||||
$fattura->save();
|
||||
|
||||
|
@ -63,7 +63,7 @@ $idtipodocumento = Tipo::where('predefined', 1)->where('dir', $dir)->first()->id
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
{[ "type": "select", "label": "<?php echo $tipo_anagrafica; ?>", "name": "idanagrafica", "id": "idanagrafica_add", "required": 1, "ajax-source": "<?php echo $module->getTranslation('name') == 'Fatture di vendita' ? 'clienti' : 'fornitori'; ?>", "value": "<?php echo $id_anagrafica; ?>", "icon-after": "add|<?php echo (new Module())->getByField('name', 'Anagrafiche', \Models\Locale::where('predefined', true)->first()->id); ?>|tipoanagrafica=<?php echo $tipo_anagrafica; ?>" ]}
|
||||
{[ "type": "select", "label": "<?php echo $tipo_anagrafica; ?>", "name": "idanagrafica", "id": "idanagrafica_add", "required": 1, "ajax-source": "<?php echo $module->getTranslation('name') == 'Fatture di vendita' ? 'clienti' : 'fornitori'; ?>", "value": "<?php echo $id_anagrafica; ?>", "icon-after": "add|<?php echo (new Module())->getByField('name', 'Anagrafiche', \Models\Locale::getPredefined()->id); ?>|tipoanagrafica=<?php echo $tipo_anagrafica; ?>" ]}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -23,7 +23,7 @@ use Models\Module;
|
||||
use Modules\Fatture\Fattura;
|
||||
|
||||
$module = Module::find($id_module);
|
||||
$module_interventi = Module::find((new Module())->getByField('name', 'Interventi', \Models\Locale::where('predefined', true)->first()->id));
|
||||
$module_interventi = Module::find((new Module())->getByField('name', 'Interventi', \Models\Locale::getPredefined()->id));
|
||||
|
||||
if ($module->getTranslation('name') == 'Fatture di vendita') {
|
||||
$dir = 'entrata';
|
||||
|
@ -23,7 +23,7 @@ use Models\Module;
|
||||
use Modules\DDT\DDT;
|
||||
|
||||
$module = Module::find($id_module);
|
||||
$id_module_articoli = (new Module())->getByField('name', 'Articoli', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$id_module_articoli = (new Module())->getByField('name', 'Articoli', \Models\Locale::getPredefined()->id);
|
||||
|
||||
// Controllo sulla direzione monetaria
|
||||
$uscite = [
|
||||
@ -195,7 +195,7 @@ if ($dir == 'entrata') {
|
||||
</div>';
|
||||
}
|
||||
|
||||
$module_fatture = (new Module())->getByField('name', 'Fatture di acquisto', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$module_fatture = (new Module())->getByField('name', 'Fatture di acquisto', \Models\Locale::getPredefined()->id);
|
||||
|
||||
echo '
|
||||
<br>
|
||||
|
@ -32,7 +32,7 @@ use Plugins\ReceiptFE\Ricevuta;
|
||||
use Util\Zip;
|
||||
|
||||
$anagrafica_azienda = Anagrafica::find(setting('Azienda predefinita'));
|
||||
$stato_emessa = (new Stato())->getByField('name', 'Emessa', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$stato_emessa = (new Stato())->getByField('name', 'Emessa', \Models\Locale::getPredefined()->id);
|
||||
$is_fiscale = $dbo->selectOne('zz_segments', 'is_fiscale', ['id' => $_SESSION['module_'.$id_module]])['is_fiscale'];
|
||||
|
||||
switch (post('op')) {
|
||||
@ -464,7 +464,7 @@ switch (post('op')) {
|
||||
|
||||
case 'change-stato':
|
||||
$list = [];
|
||||
$new_stato = (new Stato())->getByField('name', 'Emessa', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$new_stato = (new Stato())->getByField('name', 'Emessa', \Models\Locale::getPredefined()->id);
|
||||
$fatture = Fattura::vendita()
|
||||
->whereIn('id', $id_records)
|
||||
->orderBy('data')
|
||||
@ -750,7 +750,7 @@ $operations['registrazione-contabile'] = [
|
||||
'title' => tr('Registrazione contabile'),
|
||||
'type' => 'modal',
|
||||
'origine' => 'fatture',
|
||||
'url' => base_path().'/add.php?id_module='.(new Module())->getByField('name', 'Prima nota', \Models\Locale::where('predefined', true)->first()->id),
|
||||
'url' => base_path().'/add.php?id_module='.(new Module())->getByField('name', 'Prima nota', \Models\Locale::getPredefined()->id),
|
||||
],
|
||||
];
|
||||
|
||||
|
@ -69,7 +69,7 @@ if (empty($record['is_fiscale'])) {
|
||||
</button>';
|
||||
}
|
||||
|
||||
$modulo_prima_nota = (new Module())->getByField('name', 'Prima nota', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$modulo_prima_nota = (new Module())->getByField('name', 'Prima nota', \Models\Locale::getPredefined()->id);
|
||||
$totale_scadenze = $dbo->fetchOne('SELECT SUM(da_pagare - pagato) AS differenza, SUM(da_pagare) AS da_pagare FROM co_scadenziario WHERE iddocumento = '.prepare($id_record));
|
||||
if (!empty($record['is_fiscale'])) {
|
||||
$differenza = isset($totale_scadenze) ? $totale_scadenze['differenza'] : 0;
|
||||
|
@ -52,7 +52,7 @@ if ($module->getTranslation('name') == 'Fatture di vendita' && $services_enable)
|
||||
|
||||
if (in_array($documento->codice_stato_fe, $codici_scarto)) {
|
||||
// In caso di NS verifico che non sia semplicemente un codice 00404 (Fattura duplicata)
|
||||
if ($documento->codice_stato_fe == 'NS' && ($documento->stato != (new Stato())->getByField('name', 'Bozza', \Models\Locale::where('predefined', true)->first()->id)) && ($documento->stato != (new Stato())->getByField('name', 'Non valida', \Models\Locale::where('predefined', true)->first()->id))) {
|
||||
if ($documento->codice_stato_fe == 'NS' && ($documento->stato != (new Stato())->getByField('name', 'Bozza', \Models\Locale::getPredefined()->id)) && ($documento->stato != (new Stato())->getByField('name', 'Non valida', \Models\Locale::getPredefined()->id))) {
|
||||
$ricevuta_principale = $documento->getRicevutaPrincipale();
|
||||
|
||||
if (!empty($ricevuta_principale)) {
|
||||
|
@ -20,7 +20,7 @@
|
||||
include_once __DIR__.'/../../core.php';
|
||||
use Models\Module;
|
||||
|
||||
$id_module_fatture_vendita = (new Module())->getByField('name', 'Fatture di vendita', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$id_module_fatture_vendita = (new Module())->getByField('name', 'Fatture di vendita', \Models\Locale::getPredefined()->id);
|
||||
$id_segment = setting('Sezionale per autofatture di vendita');
|
||||
|
||||
echo '
|
||||
|
@ -356,9 +356,9 @@ echo '
|
||||
if (!empty($record['idreferente'])) {
|
||||
echo Plugins::link('Referenti', $record['idanagrafica'], null, null, 'class="pull-right"');
|
||||
}
|
||||
$id_modulo_anagrafiche = (new Module())->getByField('name', 'Anagrafiche', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$id_modulo_anagrafiche = (new Module())->getByField('name', 'Anagrafiche', \Models\Locale::getPredefined()->id);
|
||||
echo '
|
||||
{[ "type": "select", "label": "'.tr('Referente').'", "name": "idreferente", "value": "$idreferente$", "ajax-source": "referenti", "select-options": {"idanagrafica": '.$record['idanagrafica'].', "idsede_destinazione": '.$record['idsede_destinazione'].'}, "icon-after": "add|'.$id_modulo_anagrafiche.'|id_plugin='.(new Plugin())->getByField('name', 'Referenti', \Models\Locale::where('predefined', true)->first()->id).'&id_parent='.$record['idanagrafica'].'||'.(intval($block_edit) ? 'disabled' : '').'" ]}
|
||||
{[ "type": "select", "label": "'.tr('Referente').'", "name": "idreferente", "value": "$idreferente$", "ajax-source": "referenti", "select-options": {"idanagrafica": '.$record['idanagrafica'].', "idsede_destinazione": '.$record['idsede_destinazione'].'}, "icon-after": "add|'.$id_modulo_anagrafiche.'|id_plugin='.(new Plugin())->getByField('name', 'Referenti', \Models\Locale::getPredefined()->id).'&id_parent='.$record['idanagrafica'].'||'.(intval($block_edit) ? 'disabled' : '').'" ]}
|
||||
</div>';
|
||||
|
||||
echo '
|
||||
@ -366,7 +366,7 @@ echo '
|
||||
<div class="row">';
|
||||
// Conteggio numero articoli fatture
|
||||
$articolo = $dbo->fetchArray('SELECT `mg_articoli`.`id` FROM ((`mg_articoli` INNER JOIN `co_righe_documenti` ON `mg_articoli`.`id`=`co_righe_documenti`.`idarticolo`) INNER JOIN `co_documenti` ON `co_documenti`.`id`=`co_righe_documenti`.`iddocumento`) WHERE `co_documenti`.`id`='.prepare($id_record));
|
||||
$id_plugin_sedi = (new Plugin())->getByField('name', 'Sedi', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$id_plugin_sedi = (new Plugin())->getByField('name', 'Sedi', \Models\Locale::getPredefined()->id);
|
||||
if ($dir == 'entrata') {
|
||||
echo '
|
||||
<div class="col-md-3">
|
||||
@ -408,7 +408,7 @@ if ($dir == 'entrata') {
|
||||
<?php if ($record['id_banca_azienda'] != 0) {
|
||||
echo Modules::link('Banche', $record['id_banca_azienda'], null, null, 'class="pull-right"');
|
||||
}
|
||||
$id_module_banche = (new Module())->getByField('name', 'Banche', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$id_module_banche = (new Module())->getByField('name', 'Banche', \Models\Locale::getPredefined()->id);
|
||||
if ($dir == 'entrata') {
|
||||
echo '
|
||||
{[ "type": "select", "label": "'.tr('Banca accredito').'", "name": "id_banca_azienda", "ajax-source": "banche", "select-options": '.json_encode(['id_anagrafica' => $anagrafica_azienda->id]).', "value": "$id_banca_azienda$", "icon-after": "add|'.$id_module_banche.'|id_anagrafica='.$anagrafica_azienda->id.'", "extra": "'.(intval($block_edit) ? 'disabled' : '').'" ]}
|
||||
@ -532,7 +532,7 @@ if ($dir == 'entrata') {
|
||||
}
|
||||
|
||||
echo '
|
||||
{[ "type": "select", "label": "'.tr("Dichiarazione d'intento").'", "name": "id_dichiarazione_intento", "help": "'.tr('Elenco delle dichiarazioni d\'intento definite all\'interno dell\'anagrafica del cliente').'.", "ajax-source": "dichiarazioni_intento", "select-options": {"idanagrafica": '.$record['idanagrafica'].', "data": "'.$record['data'].'"},"value": "$id_dichiarazione_intento$", "icon-after": "add|'.$id_modulo_anagrafiche.'|id_plugin='.(new Plugin())->getByField('name', 'Dichiarazioni d\'intento', \Models\Locale::where('predefined', true)->first()->id).'&id_parent='.$record['idanagrafica'].'", "extra": "'.((intval($block_edit)) ? 'disabled' : '').'" ]}
|
||||
{[ "type": "select", "label": "'.tr("Dichiarazione d'intento").'", "name": "id_dichiarazione_intento", "help": "'.tr('Elenco delle dichiarazioni d\'intento definite all\'interno dell\'anagrafica del cliente').'.", "ajax-source": "dichiarazioni_intento", "select-options": {"idanagrafica": '.$record['idanagrafica'].', "data": "'.$record['data'].'"},"value": "$id_dichiarazione_intento$", "icon-after": "add|'.$id_modulo_anagrafiche.'|id_plugin='.(new Plugin())->getByField('name', 'Dichiarazioni d\'intento', \Models\Locale::getPredefined()->id).'&id_parent='.$record['idanagrafica'].'", "extra": "'.((intval($block_edit)) ? 'disabled' : '').'" ]}
|
||||
</div>';
|
||||
}
|
||||
echo '
|
||||
@ -581,11 +581,11 @@ if ($record['descrizione_tipo'] == 'Fattura accompagnatoria di vendita') {
|
||||
<div class="box-body">
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
{[ "type": "select", "label": "'.tr('Aspetto beni').'", "name": "idaspettobeni", "placeholder": "", "ajax-source": "aspetto-beni", "value": "$idaspettobeni$", "icon-after": "add|'.(new Module())->getByField('name', 'Aspetto beni', \Models\Locale::where('predefined', true)->first()->id).'||'.(($record['stato'] != 'Bozza') ? 'disabled' : '').'" ]}
|
||||
{[ "type": "select", "label": "'.tr('Aspetto beni').'", "name": "idaspettobeni", "placeholder": "", "ajax-source": "aspetto-beni", "value": "$idaspettobeni$", "icon-after": "add|'.(new Module())->getByField('name', 'Aspetto beni', \Models\Locale::getPredefined()->id).'||'.(($record['stato'] != 'Bozza') ? 'disabled' : '').'" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
{[ "type": "select", "label": "'.tr('Causale trasporto').'", "name": "idcausalet", "placeholder": "", "ajax-source": "causali", "value": "$idcausalet$", "icon-after": "add|'.(new Module())->getByField('name', 'Causali', \Models\Locale::where('predefined', true)->first()->id).'||'.(($record['stato'] != 'Bozza') ? 'disabled' : '').'" ]}
|
||||
{[ "type": "select", "label": "'.tr('Causale trasporto').'", "name": "idcausalet", "placeholder": "", "ajax-source": "causali", "value": "$idcausalet$", "icon-after": "add|'.(new Module())->getByField('name', 'Causali', \Models\Locale::getPredefined()->id).'||'.(($record['stato'] != 'Bozza') ? 'disabled' : '').'" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
@ -854,7 +854,7 @@ if (!$block_edit) {
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
{[ "type": "select", "label": "'.tr('Articolo').'", "name": "id_articolo", "value": "", "ajax-source": "articoli", "select-options": {"permetti_movimento_a_zero": '.($dir == 'entrata' ? 0 : 1).', "idsede_partenza": '.intval($fattura->idsede_partenza).', "idsede_destinazione": '.intval($fattura->idsede_destinazione).', "idanagrafica": '.$fattura->idanagrafica.', "dir": "'.$dir.'", "idagente": '.$fattura->idagente.'}, "icon-after": "add|'.(new Module())->getByField('name', 'Articoli', \Models\Locale::where('predefined', true)->first()->id).'" ]}
|
||||
{[ "type": "select", "label": "'.tr('Articolo').'", "name": "id_articolo", "value": "", "ajax-source": "articoli", "select-options": {"permetti_movimento_a_zero": '.($dir == 'entrata' ? 0 : 1).', "idsede_partenza": '.intval($fattura->idsede_partenza).', "idsede_destinazione": '.intval($fattura->idsede_destinazione).', "idanagrafica": '.$fattura->idanagrafica.', "dir": "'.$dir.'", "idagente": '.$fattura->idagente.'}, "icon-after": "add|'.(new Module())->getByField('name', 'Articoli', \Models\Locale::getPredefined()->id).'" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-3" style="margin-top: 25px">
|
||||
|
@ -781,10 +781,10 @@ function aggiornaInline(id) {
|
||||
}
|
||||
init();';
|
||||
|
||||
if (Plugin::find((new Plugin())->getByField('name', 'Distinta base', \Models\Locale::where('predefined', true)->first()->id))) {
|
||||
if (Plugin::find((new Plugin())->getByField('name', 'Distinta base', \Models\Locale::getPredefined()->id))) {
|
||||
echo '
|
||||
async function viewDistinta(id_articolo) {
|
||||
openModal("'.tr('Distinta base').'", "'.Plugin::find((new Plugin())->getByField('name', 'Distinta base', \Models\Locale::where('predefined', true)->first()->id))->fileurl('view.php').'?id_module=" + globals.id_module + "&id_record=" + globals.id_record + "&id_articolo=" + id_articolo);
|
||||
openModal("'.tr('Distinta base').'", "'.Plugin::find((new Plugin())->getByField('name', 'Distinta base', \Models\Locale::getPredefined()->id))->fileurl('view.php').'?id_module=" + globals.id_module + "&id_record=" + globals.id_record + "&id_articolo=" + id_articolo);
|
||||
}';
|
||||
}
|
||||
echo '
|
||||
|
@ -96,7 +96,7 @@ class Fattura extends Document
|
||||
$database = database();
|
||||
|
||||
// Individuazione dello stato predefinito per il documento
|
||||
$stato_documento = (new Stato())->getByField('name', 'Bozza', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$stato_documento = (new Stato())->getByField('name', 'Bozza', \Models\Locale::getPredefined()->id);
|
||||
$direzione = $tipo_documento->dir;
|
||||
|
||||
// Conto predefinito sulla base del flusso di denaro
|
||||
@ -721,7 +721,7 @@ class Fattura extends Document
|
||||
$new->id_ricevuta_principale = null;
|
||||
|
||||
// Spostamento dello stato
|
||||
$stato = (new Stato())->getByField('name', 'Bozza', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$stato = (new Stato())->getByField('name', 'Bozza', \Models\Locale::getPredefined()->id);
|
||||
$new->stato()->associate($stato);
|
||||
|
||||
return $new;
|
||||
|
@ -31,7 +31,7 @@ use Models\Module;
|
||||
</div>
|
||||
<div class='row'>
|
||||
<div class="col-md-6">
|
||||
{[ "type": "select", "label": "Categoria", "name": "idcategoria", "required": 1, "ajax-source": "categorie_documenti" , "value": "", "extra": "", "icon-after": "add|<?php echo (new Module())->getByField('name', 'Categorie documenti', \Models\Locale::where('predefined', true)->first()->id); ?>" ]}
|
||||
{[ "type": "select", "label": "Categoria", "name": "idcategoria", "required": 1, "ajax-source": "categorie_documenti" , "value": "", "extra": "", "icon-after": "add|<?php echo (new Module())->getByField('name', 'Categorie documenti', \Models\Locale::getPredefined()->id); ?>" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
|
@ -20,6 +20,6 @@
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
if (isset($id_record)) {
|
||||
$id_module = (new Module())->getByField('name', 'Articoli', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$id_module = (new Module())->getByField('name', 'Articoli', \Models\Locale::getPredefined()->id);
|
||||
redirect(base_path().'/editor.php?id_module='.$id_module.'&id_record='.$id_record);
|
||||
}
|
||||
|
@ -24,8 +24,8 @@ use Modules\Checklists\Check;
|
||||
|
||||
$op = post('op');
|
||||
|
||||
$upload_dir = base_dir().'/files/'.Module::find((new Module())->getByField('name', 'Anagrafiche', \Models\Locale::where('predefined', true)->first()->id))->directory;
|
||||
$id_modulo_categorie_impianti = (new Module())->getByField('name', 'Categorie impianti', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$upload_dir = base_dir().'/files/'.Module::find((new Module())->getByField('name', 'Anagrafiche', \Models\Locale::getPredefined()->id))->directory;
|
||||
$id_modulo_categorie_impianti = (new Module())->getByField('name', 'Categorie impianti', \Models\Locale::getPredefined()->id);
|
||||
|
||||
switch ($op) {
|
||||
// Aggiorno informazioni di base impianto
|
||||
|
@ -21,8 +21,8 @@ include_once __DIR__.'/../../core.php';
|
||||
use Models\Module;
|
||||
|
||||
$id_anagrafica = filter('id_anagrafica');
|
||||
$id_modulo_anagrafiche = (new Module())->getByField('name', 'Anagrafiche', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$id_modulo_categorie_impianti = (new Module())->getByField('name', 'Categorie impianti', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$id_modulo_anagrafiche = (new Module())->getByField('name', 'Anagrafiche', \Models\Locale::getPredefined()->id);
|
||||
$id_modulo_categorie_impianti = (new Module())->getByField('name', 'Categorie impianti', \Models\Locale::getPredefined()->id);
|
||||
?><form action="" method="post" id="add-form">
|
||||
<input type="hidden" name="op" value="add">
|
||||
<input type="hidden" name="backto" value="record-edit">
|
||||
|
@ -20,7 +20,7 @@
|
||||
include_once __DIR__.'/../../../core.php';
|
||||
use Models\Module;
|
||||
|
||||
$link_id = (new Module())->getByField('name', 'Impianti', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$link_id = (new Module())->getByField('name', 'Impianti', \Models\Locale::getPredefined()->id);
|
||||
|
||||
$fields = [
|
||||
'Matricola' => 'matricola',
|
||||
|
@ -20,7 +20,7 @@
|
||||
include_once __DIR__.'/../../core.php';
|
||||
use Models\Module;
|
||||
|
||||
$id_modulo_categorie_impianti = (new Module())->getByField('name', 'Categorie Impianti', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$id_modulo_categorie_impianti = (new Module())->getByField('name', 'Categorie Impianti', \Models\Locale::getPredefined()->id);
|
||||
|
||||
$img = null;
|
||||
if (!empty($record['immagine'])) {
|
||||
|
@ -41,8 +41,8 @@ use Plugins\ComponentiImpianti\Componente;
|
||||
use Plugins\ListinoClienti\DettaglioPrezzo;
|
||||
use Plugins\PianificazioneInterventi\Promemoria;
|
||||
|
||||
$id_modulo_impianti = (new Module())->getByField('name', 'Impianti', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$plugin_impianti = (new Plugin())->getByField('name', 'Impianti', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$id_modulo_impianti = (new Module())->getByField('name', 'Impianti', \Models\Locale::getPredefined()->id);
|
||||
$plugin_impianti = (new Plugin())->getByField('name', 'Impianti', \Models\Locale::getPredefined()->id);
|
||||
|
||||
switch (post('op')) {
|
||||
case 'update':
|
||||
@ -95,7 +95,7 @@ switch (post('op')) {
|
||||
if (!in_array($tecnico_presente['id_tecnico'], $tecnici_assegnati)) {
|
||||
$tecnico = Anagrafica::find($tecnico_presente['id_tecnico']);
|
||||
if (!empty($tecnico['email'])) {
|
||||
$template = (new Template())->getByField('name', 'Notifica rimozione intervento', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$template = (new Template())->getByField('name', 'Notifica rimozione intervento', \Models\Locale::getPredefined()->id);
|
||||
|
||||
if (!empty($template)) {
|
||||
$mail = Mail::build(auth()->getUser(), $template, $intervento->id);
|
||||
@ -114,7 +114,7 @@ switch (post('op')) {
|
||||
$tecnico = Anagrafica::find($tecnico_assegnato);
|
||||
|
||||
if (!empty($tecnico['email'])) {
|
||||
$template = (new Template())->getByField('name', 'Notifica intervento', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$template = (new Template())->getByField('name', 'Notifica intervento', \Models\Locale::getPredefined()->id);
|
||||
|
||||
if (!empty($template)) {
|
||||
$mail = Mail::build(auth()->getUser(), $template, $intervento->id);
|
||||
@ -296,7 +296,7 @@ switch (post('op')) {
|
||||
// Notifica al tecnico
|
||||
if (setting('Notifica al tecnico l\'assegnazione all\'attività')) {
|
||||
if (!empty($tecnico['email'])) {
|
||||
$template = (new Template())->getByField('name', 'Notifica intervento', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$template = (new Template())->getByField('name', 'Notifica intervento', \Models\Locale::getPredefined()->id);
|
||||
|
||||
if (!empty($template)) {
|
||||
$mail = Mail::build(auth()->getUser(), $template, $intervento->id);
|
||||
@ -925,7 +925,7 @@ switch (post('op')) {
|
||||
// Notifica rimozione dell' intervento al tecnico
|
||||
if (setting('Notifica al tecnico la rimozione della sessione dall\'attività')) {
|
||||
if (!empty($tecnico['email'])) {
|
||||
$template = (new Template())->getByField('name', 'Notifica rimozione intervento', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$template = (new Template())->getByField('name', 'Notifica rimozione intervento', \Models\Locale::getPredefined()->id);
|
||||
|
||||
if (!empty($template)) {
|
||||
$mail = Mail::build(auth()->getUser(), $template, $id_record);
|
||||
|
@ -30,8 +30,8 @@ $descrizione = filter('descrizione');
|
||||
$id_tipo = filter('id_tipo');
|
||||
|
||||
$origine_dashboard = get('ref') == 'dashboard' ? true : false;
|
||||
$id_modulo_anagrafiche = (new Module())->getByField('name', 'Anagrafiche', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$id_plugin_sedi = (new Plugin())->getByField('name', 'Sedi', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$id_modulo_anagrafiche = (new Module())->getByField('name', 'Anagrafiche', \Models\Locale::getPredefined()->id);
|
||||
$id_plugin_sedi = (new Plugin())->getByField('name', 'Sedi', \Models\Locale::getPredefined()->id);
|
||||
|
||||
// Calcolo dell'orario di inizio e di fine sulla base delle informazioni fornite
|
||||
$orario_inizio = filter('orario_inizio');
|
||||
@ -171,7 +171,7 @@ echo '
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
{[ "type": "select", "label": "'.tr('Impianto').'", "multiple": 1, "name": "idimpianti[]", "value": "'.$impianti_collegati.'", "ajax-source": "impianti-cliente", "select-options": {"idanagrafica": '.($id_anagrafica ?: '""').', "idsede_destinazione": '.($id_sede ?: '""').'}, "icon-after": "add|'.(new Module())->getByField('name', 'Impianti', \Models\Locale::where('predefined', true)->first()->id).'|id_anagrafica='.$id_anagrafica.'" ]}
|
||||
{[ "type": "select", "label": "'.tr('Impianto').'", "multiple": 1, "name": "idimpianti[]", "value": "'.$impianti_collegati.'", "ajax-source": "impianti-cliente", "select-options": {"idanagrafica": '.($id_anagrafica ?: '""').', "idsede_destinazione": '.($id_sede ?: '""').'}, "icon-after": "add|'.(new Module())->getByField('name', 'Impianti', \Models\Locale::getPredefined()->id).'|id_anagrafica='.$id_anagrafica.'" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
@ -189,7 +189,7 @@ echo '
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
{[ "type": "select", "label": "'.tr('Contratto').'", "name": "idcontratto", "value": "'.$id_contratto.'", "ajax-source": "contratti", "readonly": "'.(empty($id_contratto) ? 0 : 1).'", "select-options": '.json_encode(['idanagrafica' => $id_anagrafica]).', "icon-after": "add|'.(new Module())->getByField('name', 'Contratti', \Models\Locale::where('predefined', true)->first()->id).'|pianificabile=1&idanagrafica='.$id_anagrafica.'" ]}
|
||||
{[ "type": "select", "label": "'.tr('Contratto').'", "name": "idcontratto", "value": "'.$id_contratto.'", "ajax-source": "contratti", "readonly": "'.(empty($id_contratto) ? 0 : 1).'", "select-options": '.json_encode(['idanagrafica' => $id_anagrafica]).', "icon-after": "add|'.(new Module())->getByField('name', 'Contratti', \Models\Locale::getPredefined()->id).'|pianificabile=1&idanagrafica='.$id_anagrafica.'" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
@ -289,7 +289,7 @@ echo '
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
{[ "type": "select", "label": "'.tr('Referente').'", "name": "idreferente", "ajax-source": "referenti", "select-options": '.json_encode(['idanagrafica' => $id_anagrafica, 'idclientefinale' => $id_cliente_finale]).', "icon-after": "add|'.(new Module())->getByField('name', 'Anagrafiche', \Models\Locale::where('predefined', true)->first()->id)->id_record.'|id_plugin='.(new Plugin())->getByField('name', 'Referenti', \Models\Locale::where('predefined', true)->first()->id).'&id_parent='.$id_anagrafica.'" ]}
|
||||
{[ "type": "select", "label": "'.tr('Referente').'", "name": "idreferente", "ajax-source": "referenti", "select-options": '.json_encode(['idanagrafica' => $id_anagrafica, 'idclientefinale' => $id_cliente_finale]).', "icon-after": "add|'.(new Module())->getByField('name', 'Anagrafiche', \Models\Locale::getPredefined()->id)->id_record.'|id_plugin='.(new Plugin())->getByField('name', 'Referenti', \Models\Locale::getPredefined()->id).'&id_parent='.$id_anagrafica.'" ]}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -16,7 +16,7 @@ $numero_documenti = 5;
|
||||
switch ($op) {
|
||||
case 'dettagli':
|
||||
// Informazioni sui contratti
|
||||
$modulo_contratti = Module::find((new Module())->getByField('name', 'Contratti', \Models\Locale::where('predefined', true)->first()->id));
|
||||
$modulo_contratti = Module::find((new Module())->getByField('name', 'Contratti', \Models\Locale::getPredefined()->id));
|
||||
if ($modulo_contratti->permission != '-') {
|
||||
// Contratti attivi per l'anagrafica
|
||||
$contratti = Contratto::where('idanagrafica', '=', $id_anagrafica)
|
||||
@ -44,7 +44,7 @@ switch ($op) {
|
||||
}
|
||||
|
||||
// Informazioni sui preventivi
|
||||
$modulo_preventivi = Module::find((new Module())->getByField('name', 'Preventivi', \Models\Locale::where('predefined', true)->first()->id));
|
||||
$modulo_preventivi = Module::find((new Module())->getByField('name', 'Preventivi', \Models\Locale::getPredefined()->id));
|
||||
if ($modulo_preventivi->permission != '-') {
|
||||
// Preventivi attivi
|
||||
$preventivi = Preventivo::where('idanagrafica', '=', $id_anagrafica)
|
||||
@ -70,13 +70,13 @@ switch ($op) {
|
||||
}
|
||||
|
||||
// Informazioni sui preventivi
|
||||
$modulo_fatture_vendita = Module::find((new Module())->getByField('name', 'Fatture di vendita', \Models\Locale::where('predefined', true)->first()->id));
|
||||
$modulo_fatture_vendita = Module::find((new Module())->getByField('name', 'Fatture di vendita', \Models\Locale::getPredefined()->id));
|
||||
if ($modulo_fatture_vendita->permission != '-') {
|
||||
// Fatture attive
|
||||
$fatture = Fattura::where('idanagrafica', '=', $id_anagrafica)
|
||||
->whereHas('stato', function ($query) {
|
||||
$id_bozza = (new Stato())->getByField('name', 'Bozza', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$id_parz_pagato = (new Stato())->getByField('name', 'Parziale pagato', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$id_bozza = (new Stato())->getByField('name', 'Bozza', \Models\Locale::getPredefined()->id);
|
||||
$id_parz_pagato = (new Stato())->getByField('name', 'Parziale pagato', \Models\Locale::getPredefined()->id);
|
||||
$query->whereIn('id', [$id_bozza, $id_parz_pagato]);
|
||||
})
|
||||
->latest()->take($numero_documenti)->get();
|
||||
|
@ -20,7 +20,7 @@
|
||||
include_once __DIR__.'/../../../core.php';
|
||||
use Models\Module;
|
||||
|
||||
$link_id = (new Module())->getByField('name', 'Interventi', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$link_id = (new Module())->getByField('name', 'Interventi', \Models\Locale::getPredefined()->id);
|
||||
|
||||
$fields = [
|
||||
'Codice intervento' => 'codice',
|
||||
|
@ -270,7 +270,7 @@ if (!$is_completato) {
|
||||
</div>
|
||||
|
||||
<div class="col-md-offset-4 col-md-4">
|
||||
{[ "type": "select", "label": "'.tr('Tecnico').'", "name": "nuovo_tecnico", "placeholder": "'.tr('Seleziona un tecnico').'", "ajax-source": "tecnici", "icon-after": "add|'.(new Module())->getByField('name', 'Anagrafiche', \Models\Locale::where('predefined', true)->first()->id).'|tipoanagrafica=Tecnico&readonly_tipo=1" ]}
|
||||
{[ "type": "select", "label": "'.tr('Tecnico').'", "name": "nuovo_tecnico", "placeholder": "'.tr('Seleziona un tecnico').'", "ajax-source": "tecnici", "icon-after": "add|'.(new Module())->getByField('name', 'Anagrafiche', \Models\Locale::getPredefined()->id).'|tipoanagrafica=Tecnico&readonly_tipo=1" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-2">
|
||||
|
@ -31,7 +31,7 @@ use Modules\Interventi\Stato;
|
||||
use Util\Zip;
|
||||
|
||||
// Segmenti
|
||||
$id_fatture = (new Module())->getByField('name', 'Fatture di vendita', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$id_fatture = (new Module())->getByField('name', 'Fatture di vendita', \Models\Locale::getPredefined()->id);
|
||||
if (!isset($_SESSION['module_'.$id_fatture]['id_segment'])) {
|
||||
$segments = Modules::getSegments($id_fatture);
|
||||
$_SESSION['module_'.$id_fatture]['id_segment'] = isset($segments[0]['id']) ? $segments[0]['id'] : null;
|
||||
|
@ -25,7 +25,7 @@ use Modules\Anagrafiche\Sede;
|
||||
include_once __DIR__.'/../../core.php';
|
||||
|
||||
$block_edit = $record['flag_completato'];
|
||||
$id_modulo_anagrafiche = (new Module())->getByField('name', 'Anagrafiche', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$id_modulo_anagrafiche = (new Module())->getByField('name', 'Anagrafiche', \Models\Locale::getPredefined()->id);
|
||||
|
||||
// Verifica aggiuntive sulla sequenzialità dei numeri
|
||||
$numero_previsto = verifica_numero_intervento($intervento);
|
||||
@ -98,7 +98,7 @@ echo '
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
{[ "type": "select", "label": "'.tr('Referente').'", "name": "idreferente", "value": "$idreferente$", "ajax-source": "referenti", "select-options": '.json_encode(['idanagrafica' => $record['idanagrafica'], 'idclientefinale' => $record['idclientefinale'], 'idsede_destinazione' => $record['idsede_destinazione']]).', "readonly": "'.intval($record['flag_completato']).'", "icon-after": "add|'.$id_modulo_anagrafiche.'|id_plugin='.(new Plugin())->getByField('name', 'Referenti', \Models\Locale::where('predefined', true)->first()->id).'&id_parent='.$record['idanagrafica'].'" ]}
|
||||
{[ "type": "select", "label": "'.tr('Referente').'", "name": "idreferente", "value": "$idreferente$", "ajax-source": "referenti", "select-options": '.json_encode(['idanagrafica' => $record['idanagrafica'], 'idclientefinale' => $record['idclientefinale'], 'idsede_destinazione' => $record['idsede_destinazione']]).', "readonly": "'.intval($record['flag_completato']).'", "icon-after": "add|'.$id_modulo_anagrafiche.'|id_plugin='.(new Plugin())->getByField('name', 'Referenti', \Models\Locale::getPredefined()->id).'&id_parent='.$record['idanagrafica'].'" ]}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@ -110,7 +110,7 @@ if (!empty($record['idpreventivo'])) {
|
||||
'.Modules::link('Preventivi', $record['idpreventivo'], null, null, 'class="pull-right"');
|
||||
}
|
||||
echo '
|
||||
{[ "type": "select", "label": "'.tr('Preventivo').'", "name": "idpreventivo", "value": "'.$record['id_preventivo'].'", "ajax-source": "preventivi", "select-options": '.json_encode(['idanagrafica' => $record['idanagrafica']]).', "readonly": "'.$record['flag_completato'].'", "icon-after": "add|'.(new Module())->getByField('name', 'Preventivi', \Models\Locale::where('predefined', true)->first()->id).'|pianificabile=1&idanagrafica='.$record['idanagrafica'].'" ]}
|
||||
{[ "type": "select", "label": "'.tr('Preventivo').'", "name": "idpreventivo", "value": "'.$record['id_preventivo'].'", "ajax-source": "preventivi", "select-options": '.json_encode(['idanagrafica' => $record['idanagrafica']]).', "readonly": "'.$record['flag_completato'].'", "icon-after": "add|'.(new Module())->getByField('name', 'Preventivi', \Models\Locale::getPredefined()->id).'|pianificabile=1&idanagrafica='.$record['idanagrafica'].'" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">';
|
||||
@ -123,7 +123,7 @@ if (!empty($record['idcontratto'])) {
|
||||
}
|
||||
echo '
|
||||
|
||||
{[ "type": "select", "label": "'.tr('Contratto').'", "name": "idcontratto", "value": "'.$record['id_contratto'].'", "ajax-source": "contratti", "select-options": '.json_encode(['idanagrafica' => $record['idanagrafica']]).', "readonly": "'.$record['flag_completato'].'", "icon-after": "add|'.(new Module())->getByField('name', 'Contratti', \Models\Locale::where('predefined', true)->first()->id).'|pianificabile=1&idanagrafica='.$record['idanagrafica'].'" ]}
|
||||
{[ "type": "select", "label": "'.tr('Contratto').'", "name": "idcontratto", "value": "'.$record['id_contratto'].'", "ajax-source": "contratti", "select-options": '.json_encode(['idanagrafica' => $record['idanagrafica']]).', "readonly": "'.$record['flag_completato'].'", "icon-after": "add|'.(new Module())->getByField('name', 'Contratti', \Models\Locale::getPredefined()->id).'|pianificabile=1&idanagrafica='.$record['idanagrafica'].'" ]}
|
||||
|
||||
<input type="hidden" name="idcontratto_riga" value="'.$idcontratto_riga.'">
|
||||
</div>
|
||||
@ -537,7 +537,7 @@ if (!$block_edit) {
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
{[ "type": "select", "label": "'.tr('Articolo').'", "name": "id_articolo", "value": "", "ajax-source": "articoli", "select-options": '.json_encode(['idsede_partenza' => $record['idsede_partenza']]).', "icon-after": "add|'.(new Module())->getByField('name', 'Articoli', \Models\Locale::where('predefined', true)->first()->id).'" ]}
|
||||
{[ "type": "select", "label": "'.tr('Articolo').'", "name": "id_articolo", "value": "", "ajax-source": "articoli", "select-options": '.json_encode(['idsede_partenza' => $record['idsede_partenza']]).', "icon-after": "add|'.(new Module())->getByField('name', 'Articoli', \Models\Locale::getPredefined()->id).'" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-4" style="margin-top: 25px">
|
||||
|
@ -107,7 +107,7 @@ if (!function_exists('add_tecnico')) {
|
||||
// Notifica nuovo intervento al tecnico
|
||||
if (setting('Notifica al tecnico l\'aggiunta della sessione nell\'attività')) {
|
||||
if (!empty($anagrafica['email'])) {
|
||||
$template = (new Template())->getByField('name', 'Notifica intervento', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$template = (new Template())->getByField('name', 'Notifica intervento', \Models\Locale::getPredefined()->id);
|
||||
|
||||
if (!empty($template)) {
|
||||
$mail = Mail::build(auth()->getUser(), $template, $id_intervento);
|
||||
|
@ -523,10 +523,10 @@ function aggiornaInline(id) {
|
||||
}
|
||||
init();';
|
||||
|
||||
if (Plugin::find((new Plugin())->getByField('name', 'Distinta base', \Models\Locale::where('predefined', true)->first()->id))) {
|
||||
if (Plugin::find((new Plugin())->getByField('name', 'Distinta base', \Models\Locale::getPredefined()->id))) {
|
||||
echo '
|
||||
async function viewDistinta(id_articolo) {
|
||||
openModal("'.tr('Distinta base').'", "'.Plugin::find((new Plugin())->getByField('name', 'Distinta base', \Models\Locale::where('predefined', true)->first()->id))->fileurl('view.php').'?id_module=" + globals.id_module + "&id_record=" + globals.id_record + "&id_articolo=" + id_articolo);
|
||||
openModal("'.tr('Distinta base').'", "'.Plugin::find((new Plugin())->getByField('name', 'Distinta base', \Models\Locale::getPredefined()->id))->fileurl('view.php').'?id_module=" + globals.id_module + "&id_record=" + globals.id_record + "&id_articolo=" + id_articolo);
|
||||
}';
|
||||
}
|
||||
echo '
|
||||
|
@ -145,7 +145,7 @@ class Sync extends Resource implements RetrieveInterface, UpdateInterface
|
||||
$idriga = $rs_copie[0]['id'];
|
||||
} else {
|
||||
$idintervento = get_new_idintervento();
|
||||
$stato = (new Stato())->getByField('name', 'Chiamata', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$stato = (new Stato())->getByField('name', 'Chiamata', \Models\Locale::getPredefined()->id);
|
||||
|
||||
$database->insert('in_interventi', [
|
||||
'idintervento' => $idintervento,
|
||||
|
@ -124,7 +124,7 @@ class CSV extends CSVImporter
|
||||
unset($record['tipo']);
|
||||
|
||||
if (empty($record['stato'])) {
|
||||
$stato = Stato::find((new Stato())->getByField('name', 'Completato', \Models\Locale::where('predefined', true)->first()->id));
|
||||
$stato = Stato::find((new Stato())->getByField('name', 'Completato', \Models\Locale::getPredefined()->id));
|
||||
} else {
|
||||
$stato = Stato::find((new Stato())->getByField('name', $record['stato']));
|
||||
}
|
||||
@ -171,7 +171,7 @@ class CSV extends CSVImporter
|
||||
// Verifica il tecnico e inserisce la sessione
|
||||
$anagrafica_t = Anagrafica::where('ragione_sociale', $record['tecnico'])->first();
|
||||
$tipo = $database->fetchOne('SELECT `idtipoanagrafica` FROM `an_tipianagrafiche_anagrafiche` WHERE `idanagrafica` = '.prepare($anagrafica_t['idanagrafica']));
|
||||
$tecnico = (new TipoAnagrafica())->getByField('name', 'Tecnico', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$tecnico = (new TipoAnagrafica())->getByField('name', 'Tecnico', \Models\Locale::getPredefined()->id);
|
||||
|
||||
if ($tipo = $tecnico) {
|
||||
$anagrafica_t['tipo'] = TipoAnagrafica::find($tecnico);
|
||||
|
@ -142,7 +142,7 @@ if ($lista) {
|
||||
<script>
|
||||
globals.newsletter = {
|
||||
senza_consenso: "'.$lista->getNumeroDestinatariSenzaConsenso().'",
|
||||
table_url: "'.Module::find((new Module())->getByField('name', 'Newsletter', \Models\Locale::where('predefined', true)->first()->id))->fileurl('ajax/table.php').'?id_list='.$id_record.'",
|
||||
table_url: "'.Module::find((new Module())->getByField('name', 'Newsletter', \Models\Locale::getPredefined()->id))->fileurl('ajax/table.php').'?id_list='.$id_record.'",
|
||||
};
|
||||
|
||||
$(document).ready(function() {
|
||||
|
@ -170,7 +170,7 @@ echo '
|
||||
processing: true,
|
||||
serverSide: true,
|
||||
ajax: {
|
||||
url: "'.Module::find((new Module())->getByField('name', 'Listini cliente', \Models\Locale::where('predefined', true)->first()->id))->fileurl('ajax/table.php').'?id_listino='.$id_record.'",
|
||||
url: "'.Module::find((new Module())->getByField('name', 'Listini cliente', \Models\Locale::getPredefined()->id))->fileurl('ajax/table.php').'?id_listino='.$id_record.'",
|
||||
type: "GET",
|
||||
dataSrc: "data",
|
||||
},
|
||||
|
@ -45,7 +45,7 @@ switch (get('op')) {
|
||||
$query = 'SELECT *, `in_interventi`.`id` AS idintervento, `an_anagrafiche`.`lat` AS lat_anagrafica, `an_anagrafiche`.`lng` AS lng_anagrafica, `an_anagrafiche`.`indirizzo` AS indirizzo_anagrafica, `an_anagrafiche`.`cap` AS cap_anagrafica, `an_anagrafiche`.`citta` AS citta_anagrafica, `an_anagrafiche`.`provincia` AS provincia_anagrafica, `an_sedi`.`lat` AS lat_sede, `an_sedi`.`lng` AS lng_sede, `an_sedi`.`indirizzo` AS indirizzo_sede, `an_sedi`.`cap` AS cap_sede, `an_sedi`.`citta` AS citta_sede, `an_sedi`.`provincia` AS provincia_sede, `in_statiintervento_lang`.`name` AS stato FROM `in_interventi` INNER JOIN `an_anagrafiche` ON `in_interventi`.`idanagrafica`=`an_anagrafiche`.`idanagrafica` LEFT JOIN `an_sedi` ON `in_interventi`.`idsede_destinazione`=`an_sedi`.`id` INNER JOIN `in_statiintervento` ON `in_interventi`.`idstatointervento`=`in_statiintervento`.`id` LEFT JOIN `in_statiintervento_lang` ON (`in_statiintervento_lang`.`id_record` = `in_interventi`.`id` AND `in_statiintervento_lang`.`id_lang`= '.prepare(Models\Locale::getDefault()->id).') LEFT JOIN `in_interventi_tecnici` ON `in_interventi_tecnici`.`idintervento` = `in_interventi`.`id` '.$add_query;
|
||||
|
||||
$query = Query::replacePlaceholder($query);
|
||||
$query = Modules::replaceAdditionals((new Module())->getByField('name', 'Interventi', \Models\Locale::where('predefined', true)->first()->id), $query);
|
||||
$query = Modules::replaceAdditionals((new Module())->getByField('name', 'Interventi', \Models\Locale::getPredefined()->id), $query);
|
||||
|
||||
$records = $dbo->fetchArray($query);
|
||||
|
||||
@ -74,7 +74,7 @@ switch (get('op')) {
|
||||
if ($lat != '0.00000000' && $lng != '0.00000000') {
|
||||
$descrizione = '';
|
||||
|
||||
$descrizione .= '<i class="fa fa-user"></i> <b>Ragione sociale</b>: <a href="'.$rootdir.'/editor.php?id_module='.(new Module())->getByField('name', 'Anagrafiche', \Models\Locale::where('predefined', true)->first()->id).'&id_record='.$records[$i]['id'].'" target="_blank" > '.$records[$i]['ragione_sociale'].' <i class="fa fa-external-link"></i> </a>'."\n<br>";
|
||||
$descrizione .= '<i class="fa fa-user"></i> <b>Ragione sociale</b>: <a href="'.$rootdir.'/editor.php?id_module='.(new Module())->getByField('name', 'Anagrafiche', \Models\Locale::getPredefined()->id).'&id_record='.$records[$i]['id'].'" target="_blank" > '.$records[$i]['ragione_sociale'].' <i class="fa fa-external-link"></i> </a>'."\n<br>";
|
||||
|
||||
if (!empty($indirizzo)) {
|
||||
$descrizione .= '<i class="fa fa-map-signs"></i> <b>Indirizzo</b>: '.$indirizzo."\n<br>";
|
||||
@ -108,7 +108,7 @@ switch (get('op')) {
|
||||
|
||||
$descrizione .= '<hr>';
|
||||
|
||||
$descrizione .= '<a class="btn btn-info btn-block btn-xs" onclick="window.open(\''.$rootdir.'/editor.php?id_module='.(new Module())->getByField('name', 'Interventi', \Models\Locale::where('predefined', true)->first()->id).'&id_record='.$records[$i]['idintervento'].'\');">
|
||||
$descrizione .= '<a class="btn btn-info btn-block btn-xs" onclick="window.open(\''.$rootdir.'/editor.php?id_module='.(new Module())->getByField('name', 'Interventi', \Models\Locale::getPredefined()->id).'&id_record='.$records[$i]['idintervento'].'\');">
|
||||
<i class="fa fa-external-link"></i> Apri attività
|
||||
</a>';
|
||||
|
||||
|
@ -97,7 +97,7 @@ echo '
|
||||
</table>';
|
||||
|
||||
// Variabili utilizzabili
|
||||
$variables = include Modules::filepath((new Module())->getByField('name', 'Fatture di vendita', \Models\Locale::where('predefined', true)->first()->id), 'variables.php');
|
||||
$variables = include Modules::filepath((new Module())->getByField('name', 'Fatture di vendita', \Models\Locale::getPredefined()->id), 'variables.php');
|
||||
|
||||
echo '
|
||||
<!-- Istruzioni per il contenuto -->
|
||||
|
@ -184,7 +184,7 @@ echo '
|
||||
|
||||
<?php
|
||||
// Variabili utilizzabili
|
||||
$variables = include Modules::filepath((new Module())->getByField('name', 'Fatture di vendita', \Models\Locale::where('predefined', true)->first()->id), 'variables.php');
|
||||
$variables = include Modules::filepath((new Module())->getByField('name', 'Fatture di vendita', \Models\Locale::getPredefined()->id), 'variables.php');
|
||||
|
||||
echo '
|
||||
<!-- Istruzioni per il contenuto -->
|
||||
|
@ -57,7 +57,7 @@ $destinatari_filtrati = (clone $destinatari)
|
||||
->skip($start)->take($length)
|
||||
->get();
|
||||
|
||||
$id_modulo_anagrafiche = (new Module())->getByField('name', 'Anagrafiche', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$id_modulo_anagrafiche = (new Module())->getByField('name', 'Anagrafiche', \Models\Locale::getPredefined()->id);
|
||||
$righe = [];
|
||||
foreach ($destinatari_filtrati as $destinatario) {
|
||||
$origine = $destinatario->getOrigine();
|
||||
|
@ -50,7 +50,7 @@ $id_anagrafica = !empty(get('idanagrafica')) ? get('idanagrafica') : '';
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
{[ "type": "select", "label": "<?php echo $tipo_anagrafica; ?>", "name": "idanagrafica", "required": 1, "value": "<?php echo $id_anagrafica; ?>", "ajax-source": "<?php echo $ajax; ?>", "icon-after": "add|<?php echo (new Module())->getByField('name', 'Anagrafiche', \Models\Locale::where('predefined', true)->first()->id); ?>|tipoanagrafica=<?php echo $tipo_anagrafica; ?>&readonly_tipo=1" ]}
|
||||
{[ "type": "select", "label": "<?php echo $tipo_anagrafica; ?>", "name": "idanagrafica", "required": 1, "value": "<?php echo $id_anagrafica; ?>", "ajax-source": "<?php echo $ajax; ?>", "icon-after": "add|<?php echo (new Module())->getByField('name', 'Anagrafiche', \Models\Locale::getPredefined()->id); ?>|tipoanagrafica=<?php echo $tipo_anagrafica; ?>&readonly_tipo=1" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
|
@ -29,7 +29,7 @@ use Modules\Ordini\Ordine;
|
||||
use Modules\Ordini\Tipo;
|
||||
|
||||
// Segmenti
|
||||
$id_modulo_fatture = (new Module())->getByField('name', 'Fatture di vendita', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$id_modulo_fatture = (new Module())->getByField('name', 'Fatture di vendita', \Models\Locale::getPredefined()->id);
|
||||
if (!isset($_SESSION['module_'.$id_modulo_fatture]['id_segment'])) {
|
||||
$segments = Modules::getSegments($id_modulo_fatture);
|
||||
$_SESSION['module_'.$id_modulo_fatture]['id_segment'] = isset($segments[0]['id']) ? $segments[0]['id'] : null;
|
||||
@ -49,7 +49,7 @@ switch (post('op')) {
|
||||
|
||||
$tipo_documento = TipoFattura::where('id', post('idtipodocumento'))->first();
|
||||
|
||||
$stato_documenti_accodabili = (new Stato())->getByField('name', 'Bozza', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$stato_documenti_accodabili = (new Stato())->getByField('name', 'Bozza', \Models\Locale::getPredefined()->id);
|
||||
$accodare = post('accodare');
|
||||
|
||||
$data = date('Y-m-d');
|
||||
|
@ -262,7 +262,7 @@ if (!$block_edit) {
|
||||
</div>
|
||||
|
||||
<div class="col-md-3">
|
||||
{[ "type": "select", "label": "'.tr('Articolo').'", "name": "id_articolo", "value": "", "ajax-source": "articoli", "select-options": {"permetti_movimento_a_zero": 1}, "icon-after": "add|'.(new Module())->getByField('name', 'Articoli', \Models\Locale::where('predefined', true)->first()->id).'" ]}
|
||||
{[ "type": "select", "label": "'.tr('Articolo').'", "name": "id_articolo", "value": "", "ajax-source": "articoli", "select-options": {"permetti_movimento_a_zero": 1}, "icon-after": "add|'.(new Module())->getByField('name', 'Articoli', \Models\Locale::getPredefined()->id).'" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-4" style="margin-top: 25px">
|
||||
|
@ -122,7 +122,7 @@ foreach ($righe as $riga) {
|
||||
|
||||
echo Modules::link('Articoli', $riga->idarticolo, $articolo_riga->codice.' - '.$riga->descrizione);
|
||||
|
||||
if ($id_module == (new Module())->getByField('name', 'Ordini_fornitore', \Models\Locale::where('predefined', true)->first()->id)) {
|
||||
if ($id_module == (new Module())->getByField('name', 'Ordini_fornitore', \Models\Locale::getPredefined()->id)) {
|
||||
$codice_fornitore = $riga->articolo->dettaglioFornitore($ordine->idanagrafica)->codice_fornitore;
|
||||
if (!empty($codice_fornitore)) {
|
||||
echo '
|
||||
@ -748,10 +748,10 @@ function aggiornaInline(id) {
|
||||
}
|
||||
init();';
|
||||
|
||||
if (Plugin::find((new Plugin())->getByField('name', 'Distinta base', \Models\Locale::where('predefined', true)->first()->id))) {
|
||||
if (Plugin::find((new Plugin())->getByField('name', 'Distinta base', \Models\Locale::getPredefined()->id))) {
|
||||
echo '
|
||||
async function viewDistinta(id_articolo) {
|
||||
openModal("'.tr('Distinta base').'", "'.Plugin::find((new Plugin())->getByField('name', 'Distinta base', \Models\Locale::where('predefined', true)->first()->id))->fileurl('view.php').'?id_module=" + globals.id_module + "&id_record=" + globals.id_record + "&id_articolo=" + id_articolo);
|
||||
openModal("'.tr('Distinta base').'", "'.Plugin::find((new Plugin())->getByField('name', 'Distinta base', \Models\Locale::getPredefined()->id))->fileurl('view.php').'?id_module=" + globals.id_module + "&id_record=" + globals.id_record + "&id_articolo=" + id_articolo);
|
||||
}';
|
||||
}
|
||||
echo '
|
||||
|
@ -56,7 +56,7 @@ class Ordine extends Document
|
||||
{
|
||||
$model = new static();
|
||||
|
||||
$stato_documento = (new Stato())->getByField('name', 'Bozza', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$stato_documento = (new Stato())->getByField('name', 'Bozza', \Models\Locale::getPredefined()->id);
|
||||
|
||||
$direzione = $tipo_documento->dir;
|
||||
$id_segment = $id_segment ?: getSegmentPredefined($model->getModule()->id);
|
||||
|
@ -23,7 +23,7 @@ use Models\Module;
|
||||
$id_conto = get('id');
|
||||
$lvl = get('lvl');
|
||||
|
||||
?><form action="<?php echo base_path(); ?>/editor.php?id_module=<?php echo (new Module())->getByField('name', 'Piano dei conti', \Models\Locale::where('predefined', true)->first()->id); ?>" method="post">
|
||||
?><form action="<?php echo base_path(); ?>/editor.php?id_module=<?php echo (new Module())->getByField('name', 'Piano dei conti', \Models\Locale::getPredefined()->id); ?>" method="post">
|
||||
<input type="hidden" name="op" value="add">
|
||||
<input type="hidden" name="backto" value="record-list">
|
||||
|
||||
|
@ -32,7 +32,7 @@ if ($lvl == 2) {
|
||||
|
||||
$info = $dbo->fetchOne($query);
|
||||
?>
|
||||
<form action="<?php echo base_path(); ?>/editor.php?id_module=<?php echo (new Module())->getByField('name', 'Piano dei conti', \Models\Locale::where('predefined', true)->first()->id); ?>" method="post">
|
||||
<form action="<?php echo base_path(); ?>/editor.php?id_module=<?php echo (new Module())->getByField('name', 'Piano dei conti', \Models\Locale::getPredefined()->id); ?>" method="post">
|
||||
<input type="hidden" name="op" value="edit">
|
||||
<input type="hidden" name="backto" value="record-list">
|
||||
<input type="hidden" name="lvl" value="<?php echo $lvl; ?>">
|
||||
|
@ -111,7 +111,7 @@ switch (post('op')) {
|
||||
$new->numero = Preventivo::getNextNumero(Carbon::now(), $new->id_segment);
|
||||
$new->data_bozza = Carbon::now();
|
||||
|
||||
$stato_preventivo = (new Stato())->getByField('name', 'Bozza', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$stato_preventivo = (new Stato())->getByField('name', 'Bozza', \Models\Locale::getPredefined()->id);
|
||||
$new->stato()->associate($stato_preventivo);
|
||||
|
||||
$new->save();
|
||||
@ -386,7 +386,7 @@ switch (post('op')) {
|
||||
// Copia del preventivo
|
||||
$new = $preventivo->replicate();
|
||||
|
||||
$stato_preventivo = (new Stato())->getByField('name', 'Bozza', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$stato_preventivo = (new Stato())->getByField('name', 'Bozza', \Models\Locale::getPredefined()->id);
|
||||
$new->stato()->associate($stato_preventivo);
|
||||
|
||||
$new->save();
|
||||
|
@ -25,7 +25,7 @@ $id_anagrafica = !empty(get('idanagrafica')) ? get('idanagrafica') : '';
|
||||
|
||||
$stati = get('pianificabile') ? 'SELECT `co_statipreventivi`.`id`, `co_statipreventivi_lang`.`name` as descrizione FROM `co_statipreventivi` LEFT JOIN `co_statipreventivi_lang` ON (`co_statipreventivi`.`id` = `co_statipreventivi_lang`.`id_record` AND `co_statipreventivi_lang`.`id_lang` = '.prepare(Models\Locale::getDefault()->id).') WHERE `is_pianificabile`=1' : 'SELECT `co_statipreventivi`.`id`, `co_statipreventivi_lang`.`name` as descrizione FROM `co_statipreventivi` LEFT JOIN `co_statipreventivi_lang` ON (`co_statipreventivi`.`id` = `co_statipreventivi_lang`.`id_record` AND `co_statipreventivi_lang`.`id_lang` = '.prepare(Models\Locale::getDefault()->id).')';
|
||||
|
||||
$stato = (new Stato())->getByField('name', 'Bozza', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$stato = (new Stato())->getByField('name', 'Bozza', \Models\Locale::getPredefined()->id);
|
||||
|
||||
?><form action="" method="post" id="add-form">
|
||||
<input type="hidden" name="op" value="add">
|
||||
@ -41,7 +41,7 @@ $stato = (new Stato())->getByField('name', 'Bozza', \Models\Locale::where('prede
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
{[ "type": "select", "label": "<?php echo tr('Cliente'); ?>", "name": "idanagrafica", "required": 1, "value": "<?php echo $id_anagrafica; ?>", "ajax-source": "clienti", "icon-after": "add|<?php echo (new Module())->getByField('name', 'Anagrafiche', \Models\Locale::where('predefined', true)->first()->id); ?>|tipoanagrafica=Cliente&readonly_tipo=1", "readonly": "<?php echo (empty(get('idanagrafica'))) ? 0 : 1; ?>" ]}
|
||||
{[ "type": "select", "label": "<?php echo tr('Cliente'); ?>", "name": "idanagrafica", "required": 1, "value": "<?php echo $id_anagrafica; ?>", "ajax-source": "clienti", "icon-after": "add|<?php echo (new Module())->getByField('name', 'Anagrafiche', \Models\Locale::getPredefined()->id); ?>|tipoanagrafica=Cliente&readonly_tipo=1", "readonly": "<?php echo (empty(get('idanagrafica'))) ? 0 : 1; ?>" ]}
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
|
@ -20,7 +20,7 @@
|
||||
include_once __DIR__.'/../../../core.php';
|
||||
use Models\Module;
|
||||
|
||||
$link_id = (new Module())->getByField('name', 'Preventivi', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$link_id = (new Module())->getByField('name', 'Preventivi', \Models\Locale::getPredefined()->id);
|
||||
|
||||
$fields = [
|
||||
'Codice preventivo' => 'numero',
|
||||
|
@ -28,7 +28,7 @@ use Modules\Preventivi\Preventivo;
|
||||
use Modules\Preventivi\Stato as StatoPreventivo;
|
||||
|
||||
// Segmenti
|
||||
$id_fatture = (new Module())->getByField('name', 'Fatture di vendita', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$id_fatture = (new Module())->getByField('name', 'Fatture di vendita', \Models\Locale::getPredefined()->id);
|
||||
if (!isset($_SESSION['module_'.$id_fatture]['id_segment'])) {
|
||||
$segments = Modules::getSegments($id_fatture);
|
||||
$_SESSION['module_'.$id_fatture]['id_segment'] = isset($segments[0]['id']) ? $segments[0]['id'] : null;
|
||||
@ -47,7 +47,7 @@ switch (post('op')) {
|
||||
// Informazioni della fattura
|
||||
$tipo_documento = Tipo::where('id', post('idtipodocumento'))->first();
|
||||
|
||||
$stato_documenti_accodabili = (new StatoFattura())->getByField('name', 'Bozza', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$stato_documenti_accodabili = (new StatoFattura())->getByField('name', 'Bozza', \Models\Locale::getPredefined()->id);
|
||||
$accodare = post('accodare');
|
||||
|
||||
$data = date('Y-m-d');
|
||||
|
@ -257,7 +257,7 @@ if (!$block_edit) {
|
||||
</div>
|
||||
|
||||
<div class="col-md-4">
|
||||
{[ "type": "select", "label": "'.tr('Articolo').'", "name": "id_articolo", "value": "", "ajax-source": "articoli", "select-options": {"permetti_movimento_a_zero": 1}, "icon-after": "add|'.(new Module())->getByField('name', 'Articoli', \Models\Locale::where('predefined', true)->first()->id).'" ]}
|
||||
{[ "type": "select", "label": "'.tr('Articolo').'", "name": "id_articolo", "value": "", "ajax-source": "articoli", "select-options": {"permetti_movimento_a_zero": 1}, "icon-after": "add|'.(new Module())->getByField('name', 'Articoli', \Models\Locale::getPredefined()->id).'" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-3" style="margin-top: 25px">
|
||||
|
@ -698,10 +698,10 @@ function aggiornaInline(id) {
|
||||
}
|
||||
init();';
|
||||
|
||||
if (Plugin::find((new Plugin())->getByField('name', 'Distinta base', \Models\Locale::where('predefined', true)->first()->id))) {
|
||||
if (Plugin::find((new Plugin())->getByField('name', 'Distinta base', \Models\Locale::getPredefined()->id))) {
|
||||
echo '
|
||||
async function viewDistinta(id_articolo) {
|
||||
openModal("'.tr('Distinta base').'", "'.Plugin::find((new Plugin())->getByField('name', 'Distinta base', \Models\Locale::where('predefined', true)->first()->id))->fileurl('view.php').'?id_module=" + globals.id_module + "&id_record=" + globals.id_record + "&id_articolo=" + id_articolo);
|
||||
openModal("'.tr('Distinta base').'", "'.Plugin::find((new Plugin())->getByField('name', 'Distinta base', \Models\Locale::getPredefined()->id))->fileurl('view.php').'?id_module=" + globals.id_module + "&id_record=" + globals.id_record + "&id_articolo=" + id_articolo);
|
||||
}';
|
||||
}
|
||||
echo '
|
||||
|
@ -96,7 +96,7 @@ class CSV extends CSVImporter
|
||||
|
||||
if (empty($anagrafica)) {
|
||||
$anagrafica = Anagrafica::build($record['ragione_sociale']);
|
||||
$tipo_cliente = (new TipoAnagrafica())->getByField('name', 'Cliente', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$tipo_cliente = (new TipoAnagrafica())->getByField('name', 'Cliente', \Models\Locale::getPredefined()->id);
|
||||
$anagrafica->tipologie = [$tipo_cliente];
|
||||
$anagrafica->save();
|
||||
}
|
||||
@ -105,7 +105,7 @@ class CSV extends CSVImporter
|
||||
|
||||
$preventivo = Preventivo::build($anagrafica, $tipo, $record['nome'], new Carbon($record['data_bozza']), 0);
|
||||
$preventivo->numero = $record['numero'];
|
||||
$preventivo->idstato = (new Stato())->getByField('name', 'Bozza', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$preventivo->idstato = (new Stato())->getByField('name', 'Bozza', \Models\Locale::getPredefined()->id);
|
||||
$preventivo->descrizione = $record['descrizione'];
|
||||
$preventivo->save();
|
||||
}
|
||||
|
@ -68,7 +68,7 @@ class Preventivo extends Document
|
||||
{
|
||||
$model = new static();
|
||||
|
||||
$stato_documento = (new Stato())->getByField('name', 'Bozza', \Models\Locale::where('predefined', true)->first()->id);
|
||||
$stato_documento = (new Stato())->getByField('name', 'Bozza', \Models\Locale::getPredefined()->id);
|
||||
|
||||
$id_agente = $anagrafica->idagente;
|
||||
$id_pagamento = $anagrafica->idpagamento_vendite;
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user