Stile del codice
This commit is contained in:
parent
175f6dd642
commit
912c87e218
|
@ -5,31 +5,27 @@ include_once __DIR__.'/../../core.php';
|
|||
switch (post('op')) {
|
||||
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) {
|
||||
$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');
|
||||
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));
|
||||
$tipi = array_column($anagrafica, 'idtipoanagrafica');
|
||||
|
||||
// Se l'anagrafica non è di tipo Azienda
|
||||
if (!in_array($idtipoanagrafica_azienda, $tipi)) {
|
||||
$dbo->query('UPDATE an_anagrafiche SET deleted_at = NOW() WHERE idanagrafica = '.prepare($id).Modules::getAdditionalsQuery($id_module));
|
||||
}
|
||||
}
|
||||
// Se l'anagrafica non è di tipo Azienda
|
||||
if (!in_array($idtipoanagrafica_azienda, $tipi)) {
|
||||
$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;
|
||||
}
|
||||
|
||||
|
||||
if (App::debug()) {
|
||||
$operations = [
|
||||
'delete-bulk' => tr('Elimina selezionati'),
|
||||
];
|
||||
$operations = [
|
||||
'delete-bulk' => tr('Elimina selezionati'),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
return $operations;
|
||||
|
|
|
@ -164,7 +164,7 @@ switch (get('op')) {
|
|||
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>').'
|
||||
<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>';
|
||||
}
|
||||
}
|
||||
|
|
|
@ -116,28 +116,23 @@ switch (post('op')) {
|
|||
|
||||
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) {
|
||||
$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!'));
|
||||
|
||||
flash()->info(tr('Ddt eliminati!'));
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (App::debug()) {
|
||||
|
||||
$operations = [
|
||||
'delete-bulk' => tr('Elimina selezionati'),
|
||||
];
|
||||
|
||||
$operations = [
|
||||
'delete-bulk' => tr('Elimina selezionati'),
|
||||
];
|
||||
}
|
||||
|
||||
|
||||
$operations['crea_fattura'] = [
|
||||
'text' => tr('Crea fattura'),
|
||||
'data' => [
|
||||
|
@ -149,5 +144,4 @@ $operations['crea_fattura'] = [
|
|||
],
|
||||
];
|
||||
|
||||
|
||||
return $operations;
|
||||
|
|
|
@ -51,16 +51,16 @@ switch (post('op')) {
|
|||
break;
|
||||
|
||||
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;
|
||||
|
||||
case 'export-xml-bulk':
|
||||
|
@ -282,11 +282,9 @@ switch (post('op')) {
|
|||
}
|
||||
|
||||
if (App::debug()) {
|
||||
|
||||
$operations = [
|
||||
'delete-bulk' => tr('Elimina selezionati'),
|
||||
];
|
||||
|
||||
$operations = [
|
||||
'delete-bulk' => tr('Elimina selezionati'),
|
||||
];
|
||||
}
|
||||
|
||||
$operations['registra-contabile'] = [
|
||||
|
|
|
@ -6,10 +6,10 @@ use Modules\Anagrafiche\Anagrafica;
|
|||
use Modules\Articoli\Articolo as ArticoloOriginale;
|
||||
use Modules\Interventi\Components\Articolo;
|
||||
use Modules\Interventi\Components\Riga;
|
||||
use Modules\Interventi\Components\Sconto;
|
||||
use Modules\Interventi\Intervento;
|
||||
use Modules\Interventi\Stato;
|
||||
use Modules\Interventi\TipoSessione;
|
||||
use Modules\Interventi\Components\Sconto;
|
||||
|
||||
switch (post('op')) {
|
||||
case 'update':
|
||||
|
@ -205,8 +205,8 @@ switch (post('op')) {
|
|||
|
||||
flash()->info(tr('Aggiunto nuovo impianto!'));
|
||||
|
||||
$database->commitTransaction();
|
||||
header("location: ".$rootdir."/editor.php?id_module=3&id_record=".$id_record."#tab_2");
|
||||
$database->commitTransaction();
|
||||
header('location: '.$rootdir.'/editor.php?id_module=3&id_record='.$id_record.'#tab_2');
|
||||
exit;
|
||||
}
|
||||
|
||||
|
|
|
@ -113,7 +113,7 @@ elseif (!empty($id_intervento)) {
|
|||
$idtipointervento = $rs[0]['idtipointervento'];
|
||||
$data = (null !== filter('data')) ? filter('data') : $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'];
|
||||
$idsede = $rs[0]['idsede'];
|
||||
$idanagrafica = $rs[0]['idanagrafica'];
|
||||
|
|
|
@ -10,7 +10,7 @@ if ($source == 'Attività') {
|
|||
}
|
||||
|
||||
?><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="source" value="<?php echo $source; ?>">
|
||||
|
||||
|
|
|
@ -76,7 +76,7 @@ class Pagamento extends Model
|
|||
'importo' => $da_pagare,
|
||||
];
|
||||
|
||||
$count++;
|
||||
++$count;
|
||||
}
|
||||
|
||||
return $results;
|
||||
|
|
|
@ -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_ricezione' => post('data_ricezione'),
|
||||
'articoli' => post('articoli'),
|
||||
'iva' => post('iva'),
|
||||
'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.
|
||||
// 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'];
|
||||
else
|
||||
$fattura->data_ricezione = $data_ricezione;
|
||||
if (empty($data_ricezione)) {
|
||||
$fattura->data_ricezione = $dati_generali['Data'];
|
||||
} else {
|
||||
$fattura->data_ricezione = $data_ricezione;
|
||||
}
|
||||
|
||||
$stato_documento = StatoFattura::where('descrizione', 'Emessa')->first();
|
||||
$fattura->stato()->associate($stato_documento);
|
||||
|
|
|
@ -24,15 +24,15 @@ class InvoiceHook extends HookManager
|
|||
});
|
||||
|
||||
$link = ROOTDIR.'/controller.php?id_module='.$module->id.'#tab_'.$plugin->id;
|
||||
|
||||
if ($count>0){
|
||||
$message = tr('Ci sono _NUM_ fatture passive da importare', [
|
||||
'_NUM_' => $count,
|
||||
]);
|
||||
}else{
|
||||
$message = tr('Nessuna fattura passiva da importare');
|
||||
}
|
||||
|
||||
|
||||
if ($count > 0) {
|
||||
$message = tr('Ci sono _NUM_ fatture passive da importare', [
|
||||
'_NUM_' => $count,
|
||||
]);
|
||||
} else {
|
||||
$message = tr('Nessuna fattura passiva da importare');
|
||||
}
|
||||
|
||||
return [
|
||||
'icon' => 'fa fa-file-text-o',
|
||||
'link' => $link,
|
||||
|
|
|
@ -24,21 +24,20 @@ class ReceiptHook extends HookManager
|
|||
});
|
||||
|
||||
$link = ROOTDIR.'/controller.php?id_module='.$module->id.'#tab_'.$plugin->id;
|
||||
|
||||
if ($count>0){
|
||||
$message = tr('Ci sono _NUM_ ricevute da importare', [
|
||||
'_NUM_' => $count,
|
||||
]);
|
||||
}else{
|
||||
$message = tr('Nessuna ricevuta da importare');
|
||||
}
|
||||
|
||||
return [
|
||||
'icon' => 'fa fa-ticket',
|
||||
'link' => $link,
|
||||
'message' => $message,
|
||||
'notify' => !empty($count),
|
||||
];
|
||||
|
||||
|
||||
if ($count > 0) {
|
||||
$message = tr('Ci sono _NUM_ ricevute da importare', [
|
||||
'_NUM_' => $count,
|
||||
]);
|
||||
} else {
|
||||
$message = tr('Nessuna ricevuta da importare');
|
||||
}
|
||||
|
||||
return [
|
||||
'icon' => 'fa fa-ticket',
|
||||
'link' => $link,
|
||||
'message' => $message,
|
||||
'notify' => !empty($count),
|
||||
];
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue