Stile del codice
This commit is contained in:
parent
175f6dd642
commit
912c87e218
|
@ -5,31 +5,27 @@ include_once __DIR__.'/../../core.php';
|
||||||
switch (post('op')) {
|
switch (post('op')) {
|
||||||
case 'delete-bulk':
|
case 'delete-bulk':
|
||||||
|
|
||||||
|
$idtipoanagrafica_azienda = $dbo->fetchArray("SELECT idtipoanagrafica FROM an_tipianagrafiche WHERE descrizione='Azienda'")[0]['idtipoanagrafica'];
|
||||||
$idtipoanagrafica_azienda = $dbo->fetchArray("SELECT idtipoanagrafica FROM an_tipianagrafiche WHERE descrizione='Azienda'")[0]['idtipoanagrafica'];
|
|
||||||
|
|
||||||
foreach ($id_records as $id) {
|
foreach ($id_records as $id) {
|
||||||
$anagrafica = $dbo->fetchArray('SELECT an_tipianagrafiche.idtipoanagrafica FROM an_tipianagrafiche INNER JOIN an_tipianagrafiche_anagrafiche ON an_tipianagrafiche.idtipoanagrafica=an_tipianagrafiche_anagrafiche.idtipoanagrafica WHERE idanagrafica='.prepare($id));
|
$anagrafica = $dbo->fetchArray('SELECT an_tipianagrafiche.idtipoanagrafica FROM an_tipianagrafiche INNER JOIN an_tipianagrafiche_anagrafiche ON an_tipianagrafiche.idtipoanagrafica=an_tipianagrafiche_anagrafiche.idtipoanagrafica WHERE idanagrafica='.prepare($id));
|
||||||
$tipi = array_column($anagrafica, 'idtipoanagrafica');
|
$tipi = array_column($anagrafica, 'idtipoanagrafica');
|
||||||
|
|
||||||
// Se l'anagrafica non è di tipo Azienda
|
// Se l'anagrafica non è di tipo Azienda
|
||||||
if (!in_array($idtipoanagrafica_azienda, $tipi)) {
|
if (!in_array($idtipoanagrafica_azienda, $tipi)) {
|
||||||
$dbo->query('UPDATE an_anagrafiche SET deleted_at = NOW() WHERE idanagrafica = '.prepare($id).Modules::getAdditionalsQuery($id_module));
|
$dbo->query('UPDATE an_anagrafiche SET deleted_at = NOW() WHERE idanagrafica = '.prepare($id).Modules::getAdditionalsQuery($id_module));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
flash()->info(tr('Anagrafiche eliminate!'));
|
flash()->info(tr('Anagrafiche eliminate!'));
|
||||||
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (App::debug()) {
|
if (App::debug()) {
|
||||||
$operations = [
|
$operations = [
|
||||||
'delete-bulk' => tr('Elimina selezionati'),
|
'delete-bulk' => tr('Elimina selezionati'),
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
return $operations;
|
return $operations;
|
||||||
|
|
|
@ -164,7 +164,7 @@ switch (get('op')) {
|
||||||
echo '
|
echo '
|
||||||
<div class="fc-event '.$class.'" data-id="'.$r['id'].'" data-idcontratto="'.$r['idcontratto'].'" data-ref="'.$r['ref'].'">'.(($r['ref'] == 'intervento') ? '<i class=\'fa fa-wrench pull-right\'></i>' : '<i class=\'fa fa-file-text-o pull-right\'></i>').'
|
<div class="fc-event '.$class.'" data-id="'.$r['id'].'" data-idcontratto="'.$r['idcontratto'].'" data-ref="'.$r['ref'].'">'.(($r['ref'] == 'intervento') ? '<i class=\'fa fa-wrench pull-right\'></i>' : '<i class=\'fa fa-file-text-o pull-right\'></i>').'
|
||||||
<b>'.$r['ragione_sociale'].'</b><br>'.Translator::dateToLocale($r['data_richiesta']).' ('.$r['tipointervento'].')'.(!empty($r['richiesta']) ? ' - '.$r['richiesta'] : '').
|
<b>'.$r['ragione_sociale'].'</b><br>'.Translator::dateToLocale($r['data_richiesta']).' ('.$r['tipointervento'].')'.(!empty($r['richiesta']) ? ' - '.$r['richiesta'] : '').
|
||||||
(!empty($r['data_scadenza'] AND $r['data_scadenza'] != '0000-00-00 00:00:00') ? '<br><small>'.tr('entro il: ').''.Translator::dateToLocale($r['data_scadenza']).'</small>' : '').'
|
(!empty($r['data_scadenza'] and $r['data_scadenza'] != '0000-00-00 00:00:00') ? '<br><small>'.tr('entro il: ').''.Translator::dateToLocale($r['data_scadenza']).'</small>' : '').'
|
||||||
</div>';
|
</div>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -116,28 +116,23 @@ switch (post('op')) {
|
||||||
|
|
||||||
case 'delete-bulk':
|
case 'delete-bulk':
|
||||||
|
|
||||||
|
foreach ($id_records as $id) {
|
||||||
|
$dbo->query('DELETE FROM dt_ddt WHERE id = '.prepare($id).Modules::getAdditionalsQuery($id_module));
|
||||||
|
$dbo->query('DELETE FROM dt_righe_ddt WHERE idddt='.prepare($id).Modules::getAdditionalsQuery($id_module));
|
||||||
|
$dbo->query('DELETE FROM mg_movimenti WHERE idddt='.prepare($id).Modules::getAdditionalsQuery($id_module));
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($id_records as $id) {
|
flash()->info(tr('Ddt eliminati!'));
|
||||||
$dbo->query('DELETE FROM dt_ddt WHERE id = '.prepare($id).Modules::getAdditionalsQuery($id_module));
|
|
||||||
$dbo->query('DELETE FROM dt_righe_ddt WHERE idddt='.prepare($id).Modules::getAdditionalsQuery($id_module));
|
|
||||||
$dbo->query('DELETE FROM mg_movimenti WHERE idddt='.prepare($id).Modules::getAdditionalsQuery($id_module));
|
|
||||||
}
|
|
||||||
|
|
||||||
flash()->info(tr('Ddt eliminati!'));
|
|
||||||
|
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
if (App::debug()) {
|
if (App::debug()) {
|
||||||
|
$operations = [
|
||||||
$operations = [
|
'delete-bulk' => tr('Elimina selezionati'),
|
||||||
'delete-bulk' => tr('Elimina selezionati'),
|
];
|
||||||
];
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$operations['crea_fattura'] = [
|
$operations['crea_fattura'] = [
|
||||||
'text' => tr('Crea fattura'),
|
'text' => tr('Crea fattura'),
|
||||||
'data' => [
|
'data' => [
|
||||||
|
@ -149,5 +144,4 @@ $operations['crea_fattura'] = [
|
||||||
],
|
],
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|
||||||
return $operations;
|
return $operations;
|
||||||
|
|
|
@ -51,16 +51,16 @@ switch (post('op')) {
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'delete-bulk':
|
case 'delete-bulk':
|
||||||
|
|
||||||
foreach ($id_records as $id) {
|
|
||||||
$dbo->query('DELETE FROM co_documenti WHERE id = '.prepare($id).Modules::getAdditionalsQuery($id_module));
|
|
||||||
$dbo->query('DELETE FROM co_righe_documenti WHERE iddocumento='.prepare($id).Modules::getAdditionalsQuery($id_module));
|
|
||||||
$dbo->query('DELETE FROM co_scadenziario WHERE iddocumento='.prepare($id).Modules::getAdditionalsQuery($id_module));
|
|
||||||
$dbo->query('DELETE FROM mg_movimenti WHERE iddocumento='.prepare($id).Modules::getAdditionalsQuery($id_module));
|
|
||||||
}
|
|
||||||
|
|
||||||
flash()->info(tr('Fatture eliminate!'));
|
foreach ($id_records as $id) {
|
||||||
|
$dbo->query('DELETE FROM co_documenti WHERE id = '.prepare($id).Modules::getAdditionalsQuery($id_module));
|
||||||
|
$dbo->query('DELETE FROM co_righe_documenti WHERE iddocumento='.prepare($id).Modules::getAdditionalsQuery($id_module));
|
||||||
|
$dbo->query('DELETE FROM co_scadenziario WHERE iddocumento='.prepare($id).Modules::getAdditionalsQuery($id_module));
|
||||||
|
$dbo->query('DELETE FROM mg_movimenti WHERE iddocumento='.prepare($id).Modules::getAdditionalsQuery($id_module));
|
||||||
|
}
|
||||||
|
|
||||||
|
flash()->info(tr('Fatture eliminate!'));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case 'export-xml-bulk':
|
case 'export-xml-bulk':
|
||||||
|
@ -282,11 +282,9 @@ switch (post('op')) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (App::debug()) {
|
if (App::debug()) {
|
||||||
|
$operations = [
|
||||||
$operations = [
|
'delete-bulk' => tr('Elimina selezionati'),
|
||||||
'delete-bulk' => tr('Elimina selezionati'),
|
];
|
||||||
];
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
$operations['registra-contabile'] = [
|
$operations['registra-contabile'] = [
|
||||||
|
|
|
@ -6,10 +6,10 @@ use Modules\Anagrafiche\Anagrafica;
|
||||||
use Modules\Articoli\Articolo as ArticoloOriginale;
|
use Modules\Articoli\Articolo as ArticoloOriginale;
|
||||||
use Modules\Interventi\Components\Articolo;
|
use Modules\Interventi\Components\Articolo;
|
||||||
use Modules\Interventi\Components\Riga;
|
use Modules\Interventi\Components\Riga;
|
||||||
|
use Modules\Interventi\Components\Sconto;
|
||||||
use Modules\Interventi\Intervento;
|
use Modules\Interventi\Intervento;
|
||||||
use Modules\Interventi\Stato;
|
use Modules\Interventi\Stato;
|
||||||
use Modules\Interventi\TipoSessione;
|
use Modules\Interventi\TipoSessione;
|
||||||
use Modules\Interventi\Components\Sconto;
|
|
||||||
|
|
||||||
switch (post('op')) {
|
switch (post('op')) {
|
||||||
case 'update':
|
case 'update':
|
||||||
|
@ -205,8 +205,8 @@ switch (post('op')) {
|
||||||
|
|
||||||
flash()->info(tr('Aggiunto nuovo impianto!'));
|
flash()->info(tr('Aggiunto nuovo impianto!'));
|
||||||
|
|
||||||
$database->commitTransaction();
|
$database->commitTransaction();
|
||||||
header("location: ".$rootdir."/editor.php?id_module=3&id_record=".$id_record."#tab_2");
|
header('location: '.$rootdir.'/editor.php?id_module=3&id_record='.$id_record.'#tab_2');
|
||||||
exit;
|
exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -113,7 +113,7 @@ elseif (!empty($id_intervento)) {
|
||||||
$idtipointervento = $rs[0]['idtipointervento'];
|
$idtipointervento = $rs[0]['idtipointervento'];
|
||||||
$data = (null !== filter('data')) ? filter('data') : $rs[0]['data_richiesta'];
|
$data = (null !== filter('data')) ? filter('data') : $rs[0]['data_richiesta'];
|
||||||
$data_richiesta = $rs[0]['data_richiesta'];
|
$data_richiesta = $rs[0]['data_richiesta'];
|
||||||
$data_scadenza = $rs[0]['data_scadenza'];
|
$data_scadenza = $rs[0]['data_scadenza'];
|
||||||
$richiesta = $rs[0]['richiesta'];
|
$richiesta = $rs[0]['richiesta'];
|
||||||
$idsede = $rs[0]['idsede'];
|
$idsede = $rs[0]['idsede'];
|
||||||
$idanagrafica = $rs[0]['idanagrafica'];
|
$idanagrafica = $rs[0]['idanagrafica'];
|
||||||
|
|
|
@ -10,7 +10,7 @@ if ($source == 'Attività') {
|
||||||
}
|
}
|
||||||
|
|
||||||
?><form action="" method="post" id="add-form">
|
?><form action="" method="post" id="add-form">
|
||||||
<input type="hidden" name="op" value="<?php echo (get('plugin')==1 ? 'add_impianto' : 'add');?>">
|
<input type="hidden" name="op" value="<?php echo get('plugin') == 1 ? 'add_impianto' : 'add'; ?>">
|
||||||
<input type="hidden" name="backto" value="record-edit">
|
<input type="hidden" name="backto" value="record-edit">
|
||||||
<input type="hidden" name="source" value="<?php echo $source; ?>">
|
<input type="hidden" name="source" value="<?php echo $source; ?>">
|
||||||
|
|
||||||
|
|
|
@ -76,7 +76,7 @@ class Pagamento extends Model
|
||||||
'importo' => $da_pagare,
|
'importo' => $da_pagare,
|
||||||
];
|
];
|
||||||
|
|
||||||
$count++;
|
++$count;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $results;
|
return $results;
|
||||||
|
|
|
@ -52,7 +52,7 @@ switch (filter('op')) {
|
||||||
'id_pagamento' => post('pagamento'),
|
'id_pagamento' => post('pagamento'),
|
||||||
'id_segment' => post('id_segment'),
|
'id_segment' => post('id_segment'),
|
||||||
'id_tipo' => post('id_tipo'),
|
'id_tipo' => post('id_tipo'),
|
||||||
'data_ricezione' => post('data_ricezione'),
|
'data_ricezione' => post('data_ricezione'),
|
||||||
'articoli' => post('articoli'),
|
'articoli' => post('articoli'),
|
||||||
'iva' => post('iva'),
|
'iva' => post('iva'),
|
||||||
'conto' => post('conto'),
|
'conto' => post('conto'),
|
||||||
|
|
|
@ -287,10 +287,11 @@ 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.
|
// 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.
|
// La data di ricezione della fattura è contenuta all’interno della “ricevuta di consegna” visibile al trasmittente della stessa.
|
||||||
if (empty($data_ricezione))
|
if (empty($data_ricezione)) {
|
||||||
$fattura->data_ricezione = $dati_generali['Data'];
|
$fattura->data_ricezione = $dati_generali['Data'];
|
||||||
else
|
} else {
|
||||||
$fattura->data_ricezione = $data_ricezione;
|
$fattura->data_ricezione = $data_ricezione;
|
||||||
|
}
|
||||||
|
|
||||||
$stato_documento = StatoFattura::where('descrizione', 'Emessa')->first();
|
$stato_documento = StatoFattura::where('descrizione', 'Emessa')->first();
|
||||||
$fattura->stato()->associate($stato_documento);
|
$fattura->stato()->associate($stato_documento);
|
||||||
|
|
|
@ -24,15 +24,15 @@ class InvoiceHook extends HookManager
|
||||||
});
|
});
|
||||||
|
|
||||||
$link = ROOTDIR.'/controller.php?id_module='.$module->id.'#tab_'.$plugin->id;
|
$link = ROOTDIR.'/controller.php?id_module='.$module->id.'#tab_'.$plugin->id;
|
||||||
|
|
||||||
if ($count>0){
|
if ($count > 0) {
|
||||||
$message = tr('Ci sono _NUM_ fatture passive da importare', [
|
$message = tr('Ci sono _NUM_ fatture passive da importare', [
|
||||||
'_NUM_' => $count,
|
'_NUM_' => $count,
|
||||||
]);
|
]);
|
||||||
}else{
|
} else {
|
||||||
$message = tr('Nessuna fattura passiva da importare');
|
$message = tr('Nessuna fattura passiva da importare');
|
||||||
}
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'icon' => 'fa fa-file-text-o',
|
'icon' => 'fa fa-file-text-o',
|
||||||
'link' => $link,
|
'link' => $link,
|
||||||
|
|
|
@ -24,21 +24,20 @@ class ReceiptHook extends HookManager
|
||||||
});
|
});
|
||||||
|
|
||||||
$link = ROOTDIR.'/controller.php?id_module='.$module->id.'#tab_'.$plugin->id;
|
$link = ROOTDIR.'/controller.php?id_module='.$module->id.'#tab_'.$plugin->id;
|
||||||
|
|
||||||
if ($count>0){
|
if ($count > 0) {
|
||||||
$message = tr('Ci sono _NUM_ ricevute da importare', [
|
$message = tr('Ci sono _NUM_ ricevute da importare', [
|
||||||
'_NUM_' => $count,
|
'_NUM_' => $count,
|
||||||
]);
|
]);
|
||||||
}else{
|
} else {
|
||||||
$message = tr('Nessuna ricevuta da importare');
|
$message = tr('Nessuna ricevuta da importare');
|
||||||
}
|
}
|
||||||
|
|
||||||
return [
|
return [
|
||||||
'icon' => 'fa fa-ticket',
|
'icon' => 'fa fa-ticket',
|
||||||
'link' => $link,
|
'link' => $link,
|
||||||
'message' => $message,
|
'message' => $message,
|
||||||
'notify' => !empty($count),
|
'notify' => !empty($count),
|
||||||
];
|
];
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue