This commit is contained in:
Thomas Zilio 2019-06-29 11:12:43 +02:00
parent 8839e00653
commit 6238bc5f94
3 changed files with 26 additions and 12 deletions

View File

@ -17,13 +17,20 @@ class InvoiceHook extends HookManager
public function response($results)
{
$count = count($results);
$notify = false;
$module = Modules::get('Fatture di acquisto');
$plugin = $module->plugins->first(function ($value, $key) {
return $value->name == 'Fatturazione Elettronica';
});
$plugins = $module->plugins;
$link = ROOTDIR.'/controller.php?id_module='.$module->id.'#tab_'.$plugin->id;
if (!empty($plugins)) {
$notify = !empty($count);
$plugin = $plugins->first(function ($value, $key) {
return $value->name == 'Fatturazione Elettronica';
});
$link = ROOTDIR.'/controller.php?id_module='.$module->id.'#tab_'.$plugin->id;
}
$message = tr('Ci sono _NUM_ fatture passive da importare', [
'_NUM_' => $count,
@ -33,7 +40,7 @@ class InvoiceHook extends HookManager
'icon' => 'fa fa-file-text-o text-yellow',
'link' => $link,
'message' => $message,
'notify' => !empty($count),
'notify' => $notify,
];
}
}

View File

@ -17,13 +17,20 @@ class ReceiptHook extends HookManager
public function response($results)
{
$count = count($results);
$notify = false;
$module = Modules::get('Fatture di vendita');
$plugin = $module->plugins->first(function ($value, $key) {
return $value->name == 'Ricevute FE';
});
$plugins = $module->plugins;
$link = ROOTDIR.'/controller.php?id_module='.$module->id.'#tab_'.$plugin->id;
if (!empty($plugins)) {
$notify = !empty($count);
$plugin = $plugins->first(function ($value, $key) {
return $value->name == 'Ricevute FE';
});
$link = ROOTDIR.'/controller.php?id_module='.$module->id.'#tab_'.$plugin->id;
}
$message = tr('Ci sono _NUM_ ricevute da importare', [
'_NUM_' => $count,
@ -33,7 +40,7 @@ class ReceiptHook extends HookManager
'icon' => 'fa fa-ticket text-yellow',
'link' => $link,
'message' => $message,
'notify' => !empty($count),
'notify' => $notify,
];
}
}

View File

@ -110,7 +110,7 @@ UPDATE `zz_views` SET `query` = 'CONCAT_WS(co_movimenti_modelli.nome, co_movimen
UPDATE `co_movimenti_modelli` SET `nome` = `descrizione` WHERE `nome` = '';
-- Rimuovo le interruzioni di riga per descrizioni vuote
--UPDATE `in_interventi` SET `descrizione` = REPLACE(`descrizione`, '\n', '') where `descrizione` LIKE '%\n';
-- UPDATE `in_interventi` SET `descrizione` = REPLACE(`descrizione`, '\n', '') where `descrizione` LIKE '%\n';
-- Aggiunto tabella co_tipi_scadenze
CREATE TABLE `co_tipi_scadenze` (
@ -134,4 +134,4 @@ INSERT INTO `zz_views` (`id_module`, `name`, `query`, `order`, `search`, `slow`,
((SELECT `id` FROM `zz_modules` WHERE `name` = 'Tipi scadenze'), 'id', 'id', 1, 1, 0, 0, 0);
-- Aggiungo possibilità di vedere la descrizione per le scadenze generiche
UPDATE `zz_views` SET `query` = 'IF(an_anagrafiche.ragione_sociale IS NULL, co_scadenziario.descrizione, an_anagrafiche.ragione_sociale)' WHERE `zz_views`.`name` = 'Anagrafica' AND `zz_views`.`id_module` = (SELECT `id` FROM `zz_modules` WHERE `name` = 'Scadenzario') ;
UPDATE `zz_views` SET `query` = 'IF(an_anagrafiche.ragione_sociale IS NULL, co_scadenziario.descrizione, an_anagrafiche.ragione_sociale)' WHERE `zz_views`.`name` = 'Anagrafica' AND `zz_views`.`id_module` = (SELECT `id` FROM `zz_modules` WHERE `name` = 'Scadenzario');