Fix vari
This commit is contained in:
parent
680540ab57
commit
3131f7d8f3
|
@ -71,63 +71,6 @@ if (Auth::check()) {
|
|||
});
|
||||
});
|
||||
|
||||
function executeHook(hook, length){
|
||||
$("#hooks").append(\'<li id="hook-loader-\' + hook.id + \'"><a href="#">'.tr('Hook "_NAME_" in esecuzione', [
|
||||
'_NAME_' => '\' + hook.name + \'',
|
||||
]).'</a></li>\');
|
||||
|
||||
$.ajax({
|
||||
url: globals.rootdir + "/ajax.php",
|
||||
type: "get",
|
||||
data: {
|
||||
op: "hook",
|
||||
id: hook.id,
|
||||
},
|
||||
success: function(data) {
|
||||
result = JSON.parse(data);
|
||||
|
||||
$("#hook-loader-" + hook.id).remove();
|
||||
|
||||
|
||||
|
||||
notification = \'<li class="hook-element"><a href="\' + (result.link ? result.link : "#") + \'"><i class="\' + result.icon + \'"></i><span class="small" > \' + result.message + \'</span></a></li>\';
|
||||
|
||||
// Inserimento della notifica
|
||||
if(result.notify) {
|
||||
hooks_count = $("#hooks-count");
|
||||
number = parseInt(hooks_count.text());
|
||||
number = isNaN(number) ? 0 : number;
|
||||
|
||||
hooks_count.text(parseInt(number) + 1);
|
||||
|
||||
$("#hooks").prepend(notification);
|
||||
} else {
|
||||
$("#hooks").append(notification);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Rimozione eventuale della rotella di caricamento
|
||||
if($(".hook-element").length == hooks.length) {
|
||||
|
||||
$(".notifications-menu .dropdown-toggle").attr(\'data-toggle\',\'dropdown\');
|
||||
$(".notifications-menu .dropdown-toggle").removeClass(\'disabled\');
|
||||
|
||||
$("#hooks-loading").hide();
|
||||
|
||||
if (hooks.length>0){
|
||||
$("#hooks-header").append(\'<span class="small" >'.tr('Hai _NUM_ notific_END_', [
|
||||
'_NUM_' => '\' + (parseInt(number) + 1) + \'',
|
||||
'_END_' => '\' + ((parseInt(number) === 0) ? \''.tr('a').'\' : \''.tr('he').'\') + \'',
|
||||
]).'</small>\');
|
||||
}else{
|
||||
$("#hooks-header").append(\'<span class="small" >'.tr('Nessuna notifica').'</small>\');
|
||||
}
|
||||
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
</script>';
|
||||
}
|
||||
|
||||
|
|
|
@ -84,6 +84,10 @@ if (Auth::check()) {
|
|||
'details' => tr('Dettagli'),
|
||||
'waiting' => tr('Impossibile procedere'),
|
||||
'waiting_msg' => tr('Prima di proseguire devi selezionare alcuni elementi!'),
|
||||
'hookExecuting' => tr('Hook "_NAME_" in esecuzione'),
|
||||
'hookMultiple' => tr('Hai _NUM_ notifiche'),
|
||||
'hookSingle' => tr('Hai 1 notifica'),
|
||||
'hookNone' => tr('Nessuna notifica'),
|
||||
];
|
||||
foreach ($translations as $key => $value) {
|
||||
echo '
|
||||
|
@ -229,7 +233,7 @@ if (Auth::check()) {
|
|||
<div class="navbar-custom-menu">
|
||||
<ul class="nav navbar-nav">
|
||||
<li class="dropdown notifications-menu" >
|
||||
<a href="#" class="dropdown-toggle btn-github disabled">
|
||||
<a href="#" class="dropdown-toggle btn-github" data-toggle="dropdown">
|
||||
<i class="fa fa-bell-o"></i>
|
||||
<span class="label label-warning">
|
||||
<span id="hooks-loading"><i class="fa fa-spinner fa-spin"></i></span>
|
||||
|
|
|
@ -1518,3 +1518,54 @@ function searchFieldName(field) {
|
|||
function searchTable(module_id, field, value) {
|
||||
session_set('module_' + module_id + ',' + 'search_' + searchFieldName(field), value, 0);
|
||||
}
|
||||
|
||||
|
||||
function executeHook(hook, length){
|
||||
$("#hooks").append('<li id="hook-loader-' + hook.id + '"><a href="#">' + globals.translations.hookExecuting.replace('_NAME_', hook.name) + '</a></li>');
|
||||
|
||||
$.ajax({
|
||||
url: globals.rootdir + "/ajax.php",
|
||||
type: "get",
|
||||
data: {
|
||||
op: "hook",
|
||||
id: hook.id,
|
||||
},
|
||||
success: function(data) {
|
||||
result = JSON.parse(data);
|
||||
|
||||
$("#hook-loader-" + hook.id).remove();
|
||||
|
||||
notification = '<li class="hook-element"><a href="' + (result.link ? result.link : "#") + '"><i class="' + result.icon + '"></i><span class="small" > ' + result.message + '</span></a></li>';
|
||||
|
||||
// Inserimento della notifica
|
||||
hooks_count = $("#hooks-count");
|
||||
number = parseInt(hooks_count.text());
|
||||
number = isNaN(number) ? 0 : number;
|
||||
|
||||
if(result.notify) {
|
||||
number++;
|
||||
|
||||
$("#hooks").prepend(notification);
|
||||
} else {
|
||||
$("#hooks").append(notification);
|
||||
}
|
||||
|
||||
hooks_count.text(number);
|
||||
|
||||
// Rimozione eventuale della rotella di caricamento
|
||||
if($(".hook-element").length == hooks.length) {
|
||||
$("#hooks-loading").hide();
|
||||
|
||||
if (number > 1){
|
||||
hookMessage = globals.translations.hookMultiple.replace('_NUM_', number);
|
||||
}else if(number == 1){
|
||||
hookMessage = globals.translations.hookSingle;
|
||||
}else {
|
||||
hookMessage = globals.translations.hookNone;
|
||||
}
|
||||
|
||||
$("#hooks-header").append('<span class="small">' + hookMessage + '</small>');
|
||||
}
|
||||
},
|
||||
});
|
||||
}
|
||||
|
|
|
@ -4,18 +4,17 @@ include_once __DIR__.'/../../core.php';
|
|||
|
||||
unset($_SESSION['superselect']['id_categoria']);
|
||||
|
||||
|
||||
?><form action="" method="post" id="add-form">
|
||||
<input type="hidden" name="op" value="add">
|
||||
<input type="hidden" name="backto" value="record-edit">
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
{[ "type": "text", "label": "<?php echo tr('Inserisci il codice:'); ?>", "name": "codice", "required": 1, "value": "<?php echo (htmlentities(filter('codice')) ? : ''); ?>" ]}
|
||||
{[ "type": "text", "label": "<?php echo tr('Inserisci il codice:'); ?>", "name": "codice", "required": 1, "value": "<?php echo htmlentities(filter('codice')) ?: ''; ?>" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
{[ "type": "text", "label": "<?php echo tr('Inserisci la descrizione:'); ?>", "name": "descrizione", "required": 1, "value": "<?php echo (htmlentities(filter('descrizione')) ? : ''); ?>" ]}
|
||||
{[ "type": "text", "label": "<?php echo tr('Inserisci la descrizione:'); ?>", "name": "descrizione", "required": 1, "value": "<?php echo htmlentities(filter('descrizione')) ?: ''; ?>" ]}
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
|
|
|
@ -41,7 +41,9 @@ switch (post('op')) {
|
|||
case 'update':
|
||||
if (post('id_record') !== null) {
|
||||
$fattura->data = post('data');
|
||||
$fattura->data_ricezione = post('data_ricezione');
|
||||
$fattura->data_registrazione = post('data_registrazione');
|
||||
$fattura->data_competenza = post('data_competenza');
|
||||
|
||||
$fattura->numero_esterno = post('numero_esterno');
|
||||
$fattura->note = post('note');
|
||||
$fattura->note_aggiuntive = post('note_aggiuntive');
|
||||
|
|
|
@ -146,7 +146,7 @@ if (empty($record['is_fiscale'])) {
|
|||
?>
|
||||
|
||||
<div class="col-md-3">
|
||||
{[ "type": "date", "label": "<?php echo tr('Data ricezione'); ?>", "name": "data_ricezione", "required": 0, "value": "$data_ricezione$" ]}
|
||||
{[ "type": "date", "label": "<?php echo tr('Data ricezione'); ?>", "name": "data_registrazione", "required": 0, "value": "$data_registrazione$" ]}
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
|
|
@ -255,9 +255,8 @@ if (!empty($rs2)) {
|
|||
echo '
|
||||
<div class="col-md-12">
|
||||
<a class="btn btn-danger ask" data-backto="record-edit" data-op="unlinkcomponente" data-id="'.$rs2[$j]['id'].'"><i class="fa fa-trash"></i> '.tr('Elimina').'</a>';
|
||||
|
||||
|
||||
// Sostituisci componente con un altro dello stesso tipo, posso sostituire solo i componenti installati
|
||||
|
||||
// Sostituisci componente con un altro dello stesso tipo, posso sostituire solo i componenti installati
|
||||
if (empty($rs2[$j]['data_sostituzione'])) {
|
||||
echo "
|
||||
<button class=\"btn btn-warning\" onclick=\"if(confirm('".tr('Vuoi sostituire questo componente con un altro dello stesso tipo?')."')){ location.href='".$rootdir.'/editor.php?id_module='.$id_module.'&id_record='.$id_record.'&op=sostituiscicomponente&backto=record-edit&filename='.$filename.'&id='.$rs2[$j]['id']."'; }else{ return false} \"><i class='fa fa-refresh'></i> ".tr('Sostituisci questo componente').'</button>';
|
||||
|
@ -265,8 +264,8 @@ if (!empty($rs2)) {
|
|||
echo '
|
||||
<button class="btn btn-warning disabled" disabled>'.tr('Componente già sostituito').'</button>';
|
||||
}
|
||||
|
||||
echo '
|
||||
|
||||
echo '
|
||||
<button type="submit" class="btn btn-success pull-right"><i class="fa fa-check"></i> '.tr('Salva modifiche').'</button>';
|
||||
|
||||
echo '
|
||||
|
|
|
@ -187,4 +187,4 @@ echo '
|
|||
|
||||
echo '
|
||||
</div>
|
||||
</div>';
|
||||
</div>';
|
||||
|
|
|
@ -52,7 +52,7 @@ switch (filter('op')) {
|
|||
'id_pagamento' => post('pagamento'),
|
||||
'id_segment' => post('id_segment'),
|
||||
'id_tipo' => post('id_tipo'),
|
||||
'data_ricezione' => post('data_ricezione'),
|
||||
'data_registrazione' => post('data_registrazione'),
|
||||
'articoli' => post('articoli'),
|
||||
'iva' => post('iva'),
|
||||
'conto' => post('conto'),
|
||||
|
|
|
@ -37,7 +37,7 @@ if (!empty($list)) {
|
|||
}
|
||||
|
||||
echo '
|
||||
<button type="button" class="btn btn-warning" '.((!extension_loaded('openssl') AND substr(strtolower($element), -4) == '.p7m') ? 'disabled' : '').' onclick="download(this, \''.$element.'\')">
|
||||
<button type="button" class="btn btn-warning" '.((!extension_loaded('openssl') and substr(strtolower($element), -4) == '.p7m') ? 'disabled' : '').' onclick="download(this, \''.$element.'\')">
|
||||
<i class="fa fa-download"></i> '.tr('Importa').'
|
||||
</button>
|
||||
</td>
|
||||
|
|
|
@ -86,7 +86,7 @@ echo '
|
|||
echo '
|
||||
<div class="row" >
|
||||
<div class="col-md-6">
|
||||
{[ "type": "date", "label": "'.tr('Data ricezione').'", "name": "data_ricezione", "required": 0, "value": "" ]}
|
||||
{[ "type": "date", "label": "'.tr('Data ricezione').'", "name": "data_registrazione", "required": 0, "value": "" ]}
|
||||
</div>
|
||||
</div>';
|
||||
|
||||
|
|
|
@ -266,7 +266,7 @@ class FatturaElettronica
|
|||
*
|
||||
* @return Fattura
|
||||
*/
|
||||
public function saveFattura($id_pagamento, $id_sezionale, $id_tipo, $data_ricezione)
|
||||
public function saveFattura($id_pagamento, $id_sezionale, $id_tipo, $data_registrazione)
|
||||
{
|
||||
$anagrafica = $this->saveAnagrafica();
|
||||
|
||||
|
@ -287,11 +287,12 @@ class FatturaElettronica
|
|||
|
||||
// Per il destinatario, la data di ricezione della fattura assume grande rilievo ai fini IVA, poiché determina la decorrenza dei termini per poter esercitare il diritto alla detrazione.
|
||||
// La data di ricezione della fattura è contenuta all’interno della “ricevuta di consegna” visibile al trasmittente della stessa.
|
||||
if (empty($data_ricezione)) {
|
||||
$fattura->data_ricezione = $dati_generali['Data'];
|
||||
if (empty($data_registrazione)) {
|
||||
$fattura->data_registrazione = $dati_generali['Data'];
|
||||
} else {
|
||||
$fattura->data_ricezione = $data_ricezione;
|
||||
$fattura->data_registrazione = $data_registrazione;
|
||||
}
|
||||
$fattura->data_competenza = $fattura->data_registrazione;
|
||||
|
||||
$stato_documento = StatoFattura::where('descrizione', 'Emessa')->first();
|
||||
$fattura->stato()->associate($stato_documento);
|
||||
|
@ -332,7 +333,7 @@ class FatturaElettronica
|
|||
|
||||
public function save($info = [])
|
||||
{
|
||||
$this->saveFattura($info['id_pagamento'], $info['id_segment'], $info['id_tipo'], $info['data_ricezione']);
|
||||
$this->saveFattura($info['id_pagamento'], $info['id_segment'], $info['id_tipo'], $info['data_registrazione']);
|
||||
|
||||
$this->saveRighe($info['articoli'], $info['iva'], $info['conto'], $info['movimentazione']);
|
||||
|
||||
|
|
|
@ -24,20 +24,21 @@ class InvoiceHook extends HookManager
|
|||
});
|
||||
|
||||
$link = ROOTDIR.'/controller.php?id_module='.$module->id.'#tab_'.$plugin->id;
|
||||
$icon = 'fa fa-file-text-o';
|
||||
|
||||
if ($count > 0) {
|
||||
$message = tr('Ci sono _NUM_ fatture passive da importare', [
|
||||
'_NUM_' => $count,
|
||||
]);
|
||||
$icon = 'fa fa-file-text-o text-yellow';
|
||||
$icon_color = 'text-yellow';
|
||||
} else {
|
||||
$message = tr('Nessuna fattura passiva da importare');
|
||||
$icon = 'fa fa-file-text-o text-green';
|
||||
$link = '#';
|
||||
$icon_color = 'text-green';
|
||||
$link = '#';
|
||||
}
|
||||
|
||||
return [
|
||||
'icon' => $icon,
|
||||
'icon' => $icon.' '.$icon_color,
|
||||
'link' => $link,
|
||||
'message' => $message,
|
||||
'notify' => !empty($count),
|
||||
|
|
|
@ -24,20 +24,21 @@ class ReceiptHook extends HookManager
|
|||
});
|
||||
|
||||
$link = ROOTDIR.'/controller.php?id_module='.$module->id.'#tab_'.$plugin->id;
|
||||
$icon = 'fa fa-ticket';
|
||||
|
||||
if ($count > 0) {
|
||||
$message = tr('Ci sono _NUM_ ricevute da importare', [
|
||||
'_NUM_' => $count,
|
||||
]);
|
||||
$icon = 'fa fa-ticket text-yellow';
|
||||
$icon_color = 'fa fa-ticket text-yellow';
|
||||
} else {
|
||||
$message = tr('Nessuna ricevuta da importare');
|
||||
$icon = 'fa fa-ticket text-green';
|
||||
$link = '#';
|
||||
$icon_color = 'fa fa-ticket text-green';
|
||||
$link = '#';
|
||||
}
|
||||
|
||||
return [
|
||||
'icon' => $icon,
|
||||
'icon' => $icon.' '.$icon_color,
|
||||
'link' => $link,
|
||||
'message' => $message,
|
||||
'notify' => !empty($count),
|
||||
|
|
|
@ -9,8 +9,8 @@ INSERT INTO `zz_views` (`id`, `id_module`, `name`, `query`, `order`, `search`, `
|
|||
-- Stato FE (Notifica esito)
|
||||
INSERT INTO `fe_stati_documento` (`codice`, `descrizione`, `icon`) VALUES ('NE', 'Notifica esito', 'fa fa-check text-warning');
|
||||
|
||||
-- Aggiunta data ricezione, utile per le fatture di acquisto
|
||||
ALTER TABLE `co_documenti` ADD `data_ricezione` DATE NULL AFTER `data`;
|
||||
-- Aggiunta data di registrazione, utile per le fatture di acquisto
|
||||
ALTER TABLE `co_documenti` ADD `data_registrazione` DATE NULL AFTER `data`, ADD `data_competenza` DATE NULL AFTER `data`;
|
||||
|
||||
-- Importo marca da bollo a 2 (https://www.fiscoetasse.com/approfondimenti/12090-applicazione-della-marca-da-bollo-sulle-fatture.html)
|
||||
UPDATE `zz_settings` SET `valore` = '2' WHERE `zz_settings`.`nome` = 'Importo marca da bollo';
|
||||
|
@ -255,8 +255,9 @@ UPDATE `zz_settings` SET `help` = NULL WHERE `help` = '';
|
|||
|
||||
ALTER TABLE `co_documenti` CHANGE `bollo` `bollo` decimal(12,4), CHANGE `data_stato_fe` `data_stato_fe` TIMESTAMP NULL, ADD `addebita_bollo` BOOLEAN NOT NULL DEFAULT TRUE, ADD `id_riga_bollo` int(11), ADD FOREIGN KEY (`id_riga_bollo`) REFERENCES `co_righe_documenti`(`id`) ON DELETE SET NULL;
|
||||
UPDATE `co_documenti` SET `bollo` = NULL;
|
||||
UPDATE `co_documenti` SET `data_ricezione` = NULL WHERE `data_ricezione` = 0000-00-00;
|
||||
UPDATE `co_documenti` SET `data_ricezione` = `data` WHERE `data_ricezione` IS NULL AND idtipodocumento IN (SELECT id FROM co_tipidocumento WHERE dir = 'uscita');
|
||||
UPDATE `co_documenti` SET `data_registrazione` = NULL WHERE `data_registrazione` = 0000-00-00;
|
||||
UPDATE `co_documenti` SET `data_registrazione` = `data` WHERE `data_registrazione` IS NULL AND idtipodocumento IN (SELECT id FROM co_tipidocumento WHERE dir = 'uscita');
|
||||
UPDATE `co_documenti` SET `data_competenza` = `data_registrazione`;
|
||||
UPDATE `co_documenti` SET `data_stato_fe` = NULL WHERE `data_stato_fe` = '0000-00-00 00:00:00';
|
||||
|
||||
-- Rimozione tasto di stampa scadenzario totale da dentro la scadenza
|
||||
|
|
Loading…
Reference in New Issue