Stile del codice
This commit is contained in:
parent
6666acf32a
commit
3ee73011f3
|
@ -17,8 +17,8 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
use Modules\Anagrafiche\Anagrafica;
|
|
||||||
use Models\Upload;
|
use Models\Upload;
|
||||||
|
use Modules\Anagrafiche\Anagrafica;
|
||||||
|
|
||||||
include_once __DIR__.'/../../../core.php';
|
include_once __DIR__.'/../../../core.php';
|
||||||
|
|
||||||
|
@ -37,52 +37,52 @@ $documenti[] = [
|
||||||
|
|
||||||
//Interventi dell'anagrafica
|
//Interventi dell'anagrafica
|
||||||
if ($user->is_admin || in_array(Modules::get('Interventi')['id'], $permessi)) {
|
if ($user->is_admin || in_array(Modules::get('Interventi')['id'], $permessi)) {
|
||||||
$interventi = $dbo->fetcharray("SELECT ".prepare(Modules::get('Interventi')['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));
|
$interventi = $dbo->fetcharray('SELECT '.prepare(Modules::get('Interventi')['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);
|
$documenti = array_merge($documenti, $interventi);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Preventivi dell'anagrafica
|
//Preventivi dell'anagrafica
|
||||||
if ($user->is_admin || in_array(Modules::get('Preventivi')['id'], $permessi)) {
|
if ($user->is_admin || in_array(Modules::get('Preventivi')['id'], $permessi)) {
|
||||||
$preventivi = $dbo->fetcharray("SELECT ".prepare(Modules::get('Preventivi')['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));
|
$preventivi = $dbo->fetcharray('SELECT '.prepare(Modules::get('Preventivi')['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);
|
$documenti = array_merge($documenti, $preventivi);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Contratti dell'anagrafica
|
//Contratti dell'anagrafica
|
||||||
if ($user->is_admin || in_array(Modules::get('Contratti')['id'], $permessi)) {
|
if ($user->is_admin || in_array(Modules::get('Contratti')['id'], $permessi)) {
|
||||||
$contratti = $dbo->fetcharray("SELECT ".prepare(Modules::get('Contratti')['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));
|
$contratti = $dbo->fetcharray('SELECT '.prepare(Modules::get('Contratti')['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);
|
$documenti = array_merge($documenti, $contratti);
|
||||||
}
|
}
|
||||||
|
|
||||||
//DDT dell'anagrafica
|
//DDT dell'anagrafica
|
||||||
if ($user->is_admin || in_array(Modules::get('Ddt di vendita')['id'], $permessi)) {
|
if ($user->is_admin || in_array(Modules::get('Ddt di vendita')['id'], $permessi)) {
|
||||||
$ddt_vendita = $dbo->fetcharray("SELECT ".prepare(Modules::get('Ddt di vendita')['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));
|
$ddt_vendita = $dbo->fetcharray('SELECT '.prepare(Modules::get('Ddt di vendita')['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);
|
$documenti = array_merge($documenti, $ddt_vendita);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($user->is_admin || in_array(Modules::get('Ddt di acquisto')['id'], $permessi)) {
|
if ($user->is_admin || in_array(Modules::get('Ddt di acquisto')['id'], $permessi)) {
|
||||||
$ddt_acquisto = $dbo->fetcharray("SELECT ".prepare(Modules::get('Ddt di acquisto')['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));
|
$ddt_acquisto = $dbo->fetcharray('SELECT '.prepare(Modules::get('Ddt di acquisto')['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);
|
$documenti = array_merge($documenti, $ddt_acquisto);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Fatture dell'anagrafica
|
//Fatture dell'anagrafica
|
||||||
if ($user->is_admin || in_array(Modules::get('Fatture di vendita')['id'], $permessi)) {
|
if ($user->is_admin || in_array(Modules::get('Fatture di vendita')['id'], $permessi)) {
|
||||||
$fatture_vendita = $dbo->fetcharray("SELECT ".prepare(Modules::get('Fatture di vendita')['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));
|
$fatture_vendita = $dbo->fetcharray('SELECT '.prepare(Modules::get('Fatture di vendita')['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);
|
$documenti = array_merge($documenti, $fatture_vendita);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($user->is_admin || in_array(Modules::get('Fatture di acquisto')['id'], $permessi)) {
|
if ($user->is_admin || in_array(Modules::get('Fatture di acquisto')['id'], $permessi)) {
|
||||||
$fatture_acquisto = $dbo->fetcharray("SELECT ".prepare(Modules::get('Fatture di acquisto')['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));
|
$fatture_acquisto = $dbo->fetcharray('SELECT '.prepare(Modules::get('Fatture di acquisto')['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);
|
$documenti = array_merge($documenti, $fatture_acquisto);
|
||||||
}
|
}
|
||||||
|
|
||||||
//Ordini dell'anagrafica
|
//Ordini dell'anagrafica
|
||||||
if ($user->is_admin || in_array(Modules::get('Ordini cliente')['id'], $permessi)) {
|
if ($user->is_admin || in_array(Modules::get('Ordini cliente')['id'], $permessi)) {
|
||||||
$ordini_vendita = $dbo->fetcharray("SELECT ".prepare(Modules::get('Ordini cliente')['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));
|
$ordini_vendita = $dbo->fetcharray('SELECT '.prepare(Modules::get('Ordini cliente')['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);
|
$documenti = array_merge($documenti, $ordini_vendita);
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($user->is_admin || in_array(Modules::get('Ordini fornitore')['id'], $permessi)) {
|
if ($user->is_admin || in_array(Modules::get('Ordini fornitore')['id'], $permessi)) {
|
||||||
$ordini_acquisto = $dbo->fetcharray("SELECT ".prepare(Modules::get('Ordini fornitore')['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));
|
$ordini_acquisto = $dbo->fetcharray('SELECT '.prepare(Modules::get('Ordini fornitore')['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);
|
$documenti = array_merge($documenti, $ordini_acquisto);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -105,7 +105,7 @@ echo '
|
||||||
</tr>';
|
</tr>';
|
||||||
|
|
||||||
foreach ($documenti as $documento) {
|
foreach ($documenti as $documento) {
|
||||||
$allegati = $dbo->fetchArray("SELECT * FROM zz_files WHERE id_module=".prepare($documento['id_module'])." AND id_record=".prepare($documento['id_record']));
|
$allegati = $dbo->fetchArray('SELECT * FROM zz_files WHERE id_module='.prepare($documento['id_module']).' AND id_record='.prepare($documento['id_record']));
|
||||||
|
|
||||||
foreach ($allegati as $allegato) {
|
foreach ($allegati as $allegato) {
|
||||||
$file = Upload::find($allegato['id']);
|
$file = Upload::find($allegato['id']);
|
||||||
|
|
|
@ -19,11 +19,11 @@
|
||||||
|
|
||||||
include_once __DIR__.'/../../core.php';
|
include_once __DIR__.'/../../core.php';
|
||||||
|
|
||||||
|
use Modules\Articoli\Articolo as ArticoloOriginale;
|
||||||
use Modules\Contratti\Contratto;
|
use Modules\Contratti\Contratto;
|
||||||
use Modules\Fatture\Fattura;
|
use Modules\Fatture\Fattura;
|
||||||
use Modules\Fatture\Stato;
|
use Modules\Fatture\Stato;
|
||||||
use Modules\Fatture\Tipo;
|
use Modules\Fatture\Tipo;
|
||||||
use Modules\Articoli\Articolo as ArticoloOriginale;
|
|
||||||
|
|
||||||
$module_fatture = 'Fatture di vendita';
|
$module_fatture = 'Fatture di vendita';
|
||||||
|
|
||||||
|
|
|
@ -110,8 +110,7 @@ switch (filter('op')) {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (setting('Visualizza informazioni aggiuntive sul calendario')) {
|
if (setting('Visualizza informazioni aggiuntive sul calendario')) {
|
||||||
|
//# Box allDay
|
||||||
## Box allDay
|
|
||||||
$query = 'SELECT
|
$query = 'SELECT
|
||||||
co_preventivi.id,
|
co_preventivi.id,
|
||||||
co_preventivi.nome,
|
co_preventivi.nome,
|
||||||
|
@ -138,14 +137,14 @@ switch (filter('op')) {
|
||||||
$results[] = [
|
$results[] = [
|
||||||
'id' => 'A_'.$modulo_preventivi->id.'_'.$preventivo['id'],
|
'id' => 'A_'.$modulo_preventivi->id.'_'.$preventivo['id'],
|
||||||
'idintervento' => $preventivo['id'],
|
'idintervento' => $preventivo['id'],
|
||||||
'idtecnico' => "",
|
'idtecnico' => '',
|
||||||
'title' => '<div style=\'position:absolute; top:7%; right:3%;\' > '.(($preventivo['is_completato']) ? '<i class="fa fa-lock" aria-hidden="true"></i>' : '').' '.(($preventivo['have_attachments']) ? '<i class="fa fa-paperclip" aria-hidden="true"></i>' : '').'</div>'.'<b>Accettazione prev. '.$preventivo['numero'].'</b> '.$preventivo['nome'].'<br><b>'.tr('Cliente').':</b> '.$preventivo['cliente'],
|
'title' => '<div style=\'position:absolute; top:7%; right:3%;\' > '.(($preventivo['is_completato']) ? '<i class="fa fa-lock" aria-hidden="true"></i>' : '').' '.(($preventivo['have_attachments']) ? '<i class="fa fa-paperclip" aria-hidden="true"></i>' : '').'</div>'.'<b>Accettazione prev. '.$preventivo['numero'].'</b> '.$preventivo['nome'].'<br><b>'.tr('Cliente').':</b> '.$preventivo['cliente'],
|
||||||
'start' => $preventivo['data_accettazione'],
|
'start' => $preventivo['data_accettazione'],
|
||||||
'end' => $preventivo['data_accettazione'],
|
'end' => $preventivo['data_accettazione'],
|
||||||
'url' => base_path().'/editor.php?id_module='.$modulo_preventivi->id.'&id_record='.$preventivo['id'],
|
'url' => base_path().'/editor.php?id_module='.$modulo_preventivi->id.'&id_record='.$preventivo['id'],
|
||||||
'backgroundColor' => "#ff7f50",
|
'backgroundColor' => '#ff7f50',
|
||||||
'textColor' => color_inverse("#ff7f50"),
|
'textColor' => color_inverse('#ff7f50'),
|
||||||
'borderColor' => "#ff7f50",
|
'borderColor' => '#ff7f50',
|
||||||
'allDay' => true,
|
'allDay' => true,
|
||||||
'eventStartEditable' => false,
|
'eventStartEditable' => false,
|
||||||
];
|
];
|
||||||
|
@ -155,14 +154,14 @@ switch (filter('op')) {
|
||||||
$results[] = [
|
$results[] = [
|
||||||
'id' => 'B_'.$modulo_preventivi->id.'_'.$preventivo['id'],
|
'id' => 'B_'.$modulo_preventivi->id.'_'.$preventivo['id'],
|
||||||
'idintervento' => $preventivo['id'],
|
'idintervento' => $preventivo['id'],
|
||||||
'idtecnico' => "",
|
'idtecnico' => '',
|
||||||
'title' => '<div style=\'position:absolute; top:7%; right:3%;\' > '.(($preventivo['is_completato']) ? '<i class="fa fa-lock" aria-hidden="true"></i>' : '').' '.(($preventivo['have_attachments']) ? '<i class="fa fa-paperclip" aria-hidden="true"></i>' : '').'</div>'.'<b>Conclusione prev. '.$preventivo['numero'].'</b> '.$preventivo['nome'].'<br><b>'.tr('Cliente').':</b> '.$preventivo['cliente'],
|
'title' => '<div style=\'position:absolute; top:7%; right:3%;\' > '.(($preventivo['is_completato']) ? '<i class="fa fa-lock" aria-hidden="true"></i>' : '').' '.(($preventivo['have_attachments']) ? '<i class="fa fa-paperclip" aria-hidden="true"></i>' : '').'</div>'.'<b>Conclusione prev. '.$preventivo['numero'].'</b> '.$preventivo['nome'].'<br><b>'.tr('Cliente').':</b> '.$preventivo['cliente'],
|
||||||
'start' => $preventivo['data_conclusione'],
|
'start' => $preventivo['data_conclusione'],
|
||||||
'end' => $preventivo['data_conclusione'],
|
'end' => $preventivo['data_conclusione'],
|
||||||
'url' => base_path().'/editor.php?id_module='.$modulo_preventivi->id.'&id_record='.$preventivo['id'],
|
'url' => base_path().'/editor.php?id_module='.$modulo_preventivi->id.'&id_record='.$preventivo['id'],
|
||||||
'backgroundColor' => "#ff7f50",
|
'backgroundColor' => '#ff7f50',
|
||||||
'textColor' => color_inverse("#ff7f50"),
|
'textColor' => color_inverse('#ff7f50'),
|
||||||
'borderColor' => "#ff7f50",
|
'borderColor' => '#ff7f50',
|
||||||
'allDay' => true,
|
'allDay' => true,
|
||||||
'eventStartEditable' => false,
|
'eventStartEditable' => false,
|
||||||
];
|
];
|
||||||
|
@ -262,7 +261,6 @@ switch (filter('op')) {
|
||||||
$tooltip .= '<b>'.tr('Informazioni aggiuntive').'</b>: '.nl2br($rs[0]['informazioniaggiuntive']).'<br/>';
|
$tooltip .= '<b>'.tr('Informazioni aggiuntive').'</b>: '.nl2br($rs[0]['informazioniaggiuntive']).'<br/>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$tooltip .= '<b>'.tr('Ragione sociale').'</b>: '.nl2br($rs[0]['ragione_sociale']).'<br/>';
|
$tooltip .= '<b>'.tr('Ragione sociale').'</b>: '.nl2br($rs[0]['ragione_sociale']).'<br/>';
|
||||||
|
|
||||||
if (!empty($rs[0]['telefono'])) {
|
if (!empty($rs[0]['telefono'])) {
|
||||||
|
@ -280,9 +278,7 @@ switch (filter('op')) {
|
||||||
if (!empty($rs[0]['note_anagrafica'])) {
|
if (!empty($rs[0]['note_anagrafica'])) {
|
||||||
$tooltip .= '<b>'.tr('Note anagrafica').'</b>: '.nl2br($rs[0]['note_anagrafica']).'<br/>';
|
$tooltip .= '<b>'.tr('Note anagrafica').'</b>: '.nl2br($rs[0]['note_anagrafica']).'<br/>';
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
$query = 'SELECT
|
$query = 'SELECT
|
||||||
co_preventivi.nome,
|
co_preventivi.nome,
|
||||||
co_preventivi.numero,
|
co_preventivi.numero,
|
||||||
|
@ -294,16 +290,11 @@ switch (filter('op')) {
|
||||||
LEFT JOIN co_statipreventivi ON co_preventivi.idstato = co_statipreventivi.id
|
LEFT JOIN co_statipreventivi ON co_preventivi.idstato = co_statipreventivi.id
|
||||||
WHERE co_preventivi.id='.prepare($id);
|
WHERE co_preventivi.id='.prepare($id);
|
||||||
|
|
||||||
|
|
||||||
$rs = $dbo->fetchArray($query);
|
$rs = $dbo->fetchArray($query);
|
||||||
|
|
||||||
|
|
||||||
$tooltip = '<b>Prev. '.$rs[0]['numero'].'</b> '.$rs[0]['nome'].''.(($rs[0]['have_attachments']) ? ' <i class="fa fa-paperclip" aria-hidden="true"></i>' : '').'<br><b>'.tr('Cliente').':</b> '.$rs[0]['cliente'];
|
$tooltip = '<b>Prev. '.$rs[0]['numero'].'</b> '.$rs[0]['nome'].''.(($rs[0]['have_attachments']) ? ' <i class="fa fa-paperclip" aria-hidden="true"></i>' : '').'<br><b>'.tr('Cliente').':</b> '.$rs[0]['cliente'];
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$tooltip .= '
|
$tooltip .= '
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(".shorten").shorten({
|
$(".shorten").shorten({
|
||||||
|
@ -313,7 +304,6 @@ switch (filter('op')) {
|
||||||
});
|
});
|
||||||
</script>';
|
</script>';
|
||||||
|
|
||||||
|
|
||||||
echo $tooltip;
|
echo $tooltip;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
|
@ -19,11 +19,11 @@
|
||||||
|
|
||||||
include_once __DIR__.'/../../core.php';
|
include_once __DIR__.'/../../core.php';
|
||||||
|
|
||||||
|
use Modules\Articoli\Articolo as ArticoloOriginale;
|
||||||
use Modules\DDT\DDT;
|
use Modules\DDT\DDT;
|
||||||
use Modules\Fatture\Fattura;
|
use Modules\Fatture\Fattura;
|
||||||
use Modules\Fatture\Stato;
|
use Modules\Fatture\Stato;
|
||||||
use Modules\Fatture\Tipo;
|
use Modules\Fatture\Tipo;
|
||||||
use Modules\Articoli\Articolo as ArticoloOriginale;
|
|
||||||
|
|
||||||
if ($module['name'] == 'Ddt di vendita') {
|
if ($module['name'] == 'Ddt di vendita') {
|
||||||
$dir = 'entrata';
|
$dir = 'entrata';
|
||||||
|
|
|
@ -287,7 +287,6 @@ switch (post('op')) {
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
// Elenco fatture Scadute per il cliente
|
// Elenco fatture Scadute per il cliente
|
||||||
case 'fatture_scadute':
|
case 'fatture_scadute':
|
||||||
$id_anagrafica = post('id_anagrafica');
|
$id_anagrafica = post('id_anagrafica');
|
||||||
|
@ -313,7 +312,6 @@ switch (post('op')) {
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
// eliminazione documento
|
// eliminazione documento
|
||||||
case 'delete':
|
case 'delete':
|
||||||
try {
|
try {
|
||||||
|
|
|
@ -17,11 +17,11 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
use Carbon\Carbon;
|
||||||
use Modules\Anagrafiche\Anagrafica;
|
use Modules\Anagrafiche\Anagrafica;
|
||||||
use Modules\Fatture\Gestori\Bollo;
|
use Modules\Fatture\Gestori\Bollo;
|
||||||
use Modules\Iva\Aliquota;
|
|
||||||
use Modules\Interventi\Intervento;
|
use Modules\Interventi\Intervento;
|
||||||
use Carbon\Carbon;
|
use Modules\Iva\Aliquota;
|
||||||
|
|
||||||
include_once __DIR__.'/../../core.php';
|
include_once __DIR__.'/../../core.php';
|
||||||
|
|
||||||
|
@ -93,7 +93,7 @@ if ($dir == 'entrata') {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Verifica la data dell'intervento rispetto alla data della fattura
|
// Verifica la data dell'intervento rispetto alla data della fattura
|
||||||
$righe_interventi = $fattura->getRighe()->where('idintervento', '!=', NULL);
|
$righe_interventi = $fattura->getRighe()->where('idintervento', '!=', null);
|
||||||
if (!empty($righe_interventi)) {
|
if (!empty($righe_interventi)) {
|
||||||
foreach ($righe_interventi as $riga_intervento) {
|
foreach ($righe_interventi as $riga_intervento) {
|
||||||
$intervento = Intervento::find($riga_intervento->idintervento);
|
$intervento = Intervento::find($riga_intervento->idintervento);
|
||||||
|
@ -182,7 +182,7 @@ if ($dir == 'entrata') {
|
||||||
{[ "type": "hidden", "label": "Segmento", "name": "id_segment", "class": "text-center", "value": "$id_segment$" ]}
|
{[ "type": "hidden", "label": "Segmento", "name": "id_segment", "class": "text-center", "value": "$id_segment$" ]}
|
||||||
|
|
||||||
<div class="col-md-<?php echo $size; ?>">
|
<div class="col-md-<?php echo $size; ?>">
|
||||||
{[ "type": "text", "label": "<?php echo $label; ?>", "required": "<?php echo (($dir=='uscita')? 1 : 0); ?>", "name": "numero_esterno", "class": "text-center", "value": "$numero_esterno$", "help": "<?php echo (empty($record['numero_esterno']) and $dir == 'entrata') ? tr('Il numero della fattura sarà generato automaticamente in fase di emissione.') : ''; ?>" ]}
|
{[ "type": "text", "label": "<?php echo $label; ?>", "required": "<?php echo ($dir == 'uscita') ? 1 : 0; ?>", "name": "numero_esterno", "class": "text-center", "value": "$numero_esterno$", "help": "<?php echo (empty($record['numero_esterno']) and $dir == 'entrata') ? tr('Il numero della fattura sarà generato automaticamente in fase di emissione.') : ''; ?>" ]}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-2">
|
<div class="col-md-2">
|
||||||
|
@ -305,7 +305,7 @@ elseif ($record['stato'] == 'Bozza') {
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<?php echo (!empty($record['idpagamento']) ? Modules::link('Pagamenti', $record['idpagamento'], null, null, 'class="pull-right"') : ''); ?>
|
<?php echo !empty($record['idpagamento']) ? Modules::link('Pagamenti', $record['idpagamento'], null, null, 'class="pull-right"') : ''; ?>
|
||||||
|
|
||||||
{[ "type": "select", "label": "<?php echo tr('Pagamento'); ?>", "name": "idpagamento", "required": 1, "ajax-source": "pagamenti", "value": "$idpagamento$", "extra": "onchange=\"$('#id_banca_azienda').selectSetNew( $(this).selectData().id_banca_<?php echo $conto; ?>, $(this).selectData().descrizione_banca_<?php echo $conto; ?> ).change(); \" " ]}
|
{[ "type": "select", "label": "<?php echo tr('Pagamento'); ?>", "name": "idpagamento", "required": 1, "ajax-source": "pagamenti", "value": "$idpagamento$", "extra": "onchange=\"$('#id_banca_azienda').selectSetNew( $(this).selectData().id_banca_<?php echo $conto; ?>, $(this).selectData().descrizione_banca_<?php echo $conto; ?> ).change(); \" " ]}
|
||||||
</div>
|
</div>
|
||||||
|
@ -391,7 +391,7 @@ elseif ($record['stato'] == 'Bozza') {
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
<?php echo (!empty($record['id_ritenuta_contributi']) ? Modules::link('Ritenute contributi', $record['id_ritenuta_contributi'], null, null, 'class="pull-right"') : ''); ?>
|
<?php echo !empty($record['id_ritenuta_contributi']) ? Modules::link('Ritenute contributi', $record['id_ritenuta_contributi'], null, null, 'class="pull-right"') : ''; ?>
|
||||||
{[ "type": "select", "label": "<?php echo tr('Ritenuta contributi'); ?>", "name": "id_ritenuta_contributi", "value": "$id_ritenuta_contributi$", "values": "query=SELECT *, CONCAT(descrizione,(IF(percentuale>0, CONCAT(\" - \", percentuale, \"% sul \", percentuale_imponibile, \"% imponibile\"), \"\"))) AS descrizione FROM co_ritenuta_contributi", "help": "<?php echo tr('Ritenuta contributi da applicare alle righe della fattura.'); ?>" ]}
|
{[ "type": "select", "label": "<?php echo tr('Ritenuta contributi'); ?>", "name": "id_ritenuta_contributi", "value": "$id_ritenuta_contributi$", "values": "query=SELECT *, CONCAT(descrizione,(IF(percentuale>0, CONCAT(\" - \", percentuale, \"% sul \", percentuale_imponibile, \"% imponibile\"), \"\"))) AS descrizione FROM co_ritenuta_contributi", "help": "<?php echo tr('Ritenuta contributi da applicare alle righe della fattura.'); ?>" ]}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
|
@ -38,8 +38,8 @@ use Plugins\DichiarazioniIntento\Dichiarazione;
|
||||||
use Plugins\ExportFE\FatturaElettronica;
|
use Plugins\ExportFE\FatturaElettronica;
|
||||||
use Traits\RecordTrait;
|
use Traits\RecordTrait;
|
||||||
use Traits\ReferenceTrait;
|
use Traits\ReferenceTrait;
|
||||||
use Util\Generator;
|
|
||||||
use Translator;
|
use Translator;
|
||||||
|
use Util\Generator;
|
||||||
|
|
||||||
class Fattura extends Document
|
class Fattura extends Document
|
||||||
{
|
{
|
||||||
|
|
|
@ -6,8 +6,7 @@ $id_anagrafica = get('id_anagrafica');
|
||||||
$op = get('op');
|
$op = get('op');
|
||||||
|
|
||||||
switch ($op) {
|
switch ($op) {
|
||||||
case "dettagli":
|
case 'dettagli':
|
||||||
|
|
||||||
echo "
|
echo "
|
||||||
<div class='row'>";
|
<div class='row'>";
|
||||||
|
|
||||||
|
@ -18,17 +17,17 @@ switch($op){
|
||||||
<div class='col-md-4'>
|
<div class='col-md-4'>
|
||||||
<b>CONTRATTI:</b><hr style='margin-top:5px;margin-bottom:15px;'>";
|
<b>CONTRATTI:</b><hr style='margin-top:5px;margin-bottom:15px;'>";
|
||||||
if (sizeof($rs_contratti) > 0) {
|
if (sizeof($rs_contratti) > 0) {
|
||||||
foreach($rs_contratti AS $contratto){
|
foreach ($rs_contratti as $contratto) {
|
||||||
echo "
|
echo "
|
||||||
<div class='alert alert-info' style='margin-bottom: 10px;'>
|
<div class='alert alert-info' style='margin-bottom: 10px;'>
|
||||||
".$contratto['descrizione']."
|
".$contratto['descrizione'].'
|
||||||
</div>";
|
</div>';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
echo "Nessun contratto per questo cliente...";
|
echo 'Nessun contratto per questo cliente...';
|
||||||
}
|
}
|
||||||
echo "
|
echo '
|
||||||
</div>";
|
</div>';
|
||||||
|
|
||||||
//Fatture emesse o parzialnente pagate
|
//Fatture emesse o parzialnente pagate
|
||||||
$rs_documenti = $dbo->fetchArray("SELECT co_documenti.id AS id, CONCAT('Fattura ', numero_esterno, ' del ', DATE_FORMAT(data, '%d/%m/%Y')) AS descrizione FROM co_documenti WHERE idstatodocumento IN(SELECT id FROM co_statidocumento WHERE descrizione IN('Emessa', 'Parzialmente pagato')) AND idanagrafica=".prepare($id_anagrafica));
|
$rs_documenti = $dbo->fetchArray("SELECT co_documenti.id AS id, CONCAT('Fattura ', numero_esterno, ' del ', DATE_FORMAT(data, '%d/%m/%Y')) AS descrizione FROM co_documenti WHERE idstatodocumento IN(SELECT id FROM co_statidocumento WHERE descrizione IN('Emessa', 'Parzialmente pagato')) AND idanagrafica=".prepare($id_anagrafica));
|
||||||
|
@ -37,42 +36,39 @@ switch($op){
|
||||||
<div class='col-md-4'>
|
<div class='col-md-4'>
|
||||||
<b>Fatture:</b><hr style='margin-top:5px;margin-bottom:15px;'>";
|
<b>Fatture:</b><hr style='margin-top:5px;margin-bottom:15px;'>";
|
||||||
if (sizeof($rs_documenti) > 0) {
|
if (sizeof($rs_documenti) > 0) {
|
||||||
foreach($rs_documenti AS $documento){
|
foreach ($rs_documenti as $documento) {
|
||||||
|
$rs_scadenze = $dbo->fetchArray('SELECT * FROM co_scadenziario WHERE iddocumento='.prepare($documento['id']));
|
||||||
$rs_scadenze = $dbo->fetchArray("SELECT * FROM co_scadenziario WHERE iddocumento=".prepare($documento['id']));
|
|
||||||
|
|
||||||
echo "
|
echo "
|
||||||
<div class='alert alert-info' style='margin-bottom: 10px;'>
|
<div class='alert alert-info' style='margin-bottom: 10px;'>
|
||||||
".$documento['descrizione']."<br>";
|
".$documento['descrizione'].'<br>';
|
||||||
foreach($rs_scadenze AS $scadenza){
|
foreach ($rs_scadenze as $scadenza) {
|
||||||
echo Translator::dateToLocale($scadenza['scadenza'])." - ".Translator::numberToLocale($scadenza['da_pagare'])." €<br>";
|
echo Translator::dateToLocale($scadenza['scadenza']).' - '.Translator::numberToLocale($scadenza['da_pagare']).' €<br>';
|
||||||
}
|
}
|
||||||
echo "
|
echo '
|
||||||
</div>";
|
</div>';
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
echo "Nessuna fattura per questo cliente...";
|
echo 'Nessuna fattura per questo cliente...';
|
||||||
}
|
}
|
||||||
echo "
|
echo '
|
||||||
</div>";
|
</div>';
|
||||||
|
|
||||||
//Note dell'anagrafica
|
//Note dell'anagrafica
|
||||||
$rs_anagrafica = $dbo->fetchOne("SELECT note FROM an_anagrafiche WHERE idanagrafica=".prepare($id_anagrafica));
|
$rs_anagrafica = $dbo->fetchOne('SELECT note FROM an_anagrafiche WHERE idanagrafica='.prepare($id_anagrafica));
|
||||||
|
|
||||||
if ($rs_anagrafica['note'] != '') {
|
if ($rs_anagrafica['note'] != '') {
|
||||||
echo "
|
echo "
|
||||||
<div class='col-md-4'>
|
<div class='col-md-4'>
|
||||||
<b>NOTE CLIENTE:</b><hr style='margin-top:5px;margin-bottom:15px;'>
|
<b>NOTE CLIENTE:</b><hr style='margin-top:5px;margin-bottom:15px;'>
|
||||||
<div class='alert alert-info' style='margin-bottom: 10px;'>".$rs_anagrafica['note']."</div>
|
<div class='alert alert-info' style='margin-bottom: 10px;'>".$rs_anagrafica['note'].'</div>
|
||||||
</div>";
|
</div>';
|
||||||
} else {
|
} else {
|
||||||
echo "Nessuna nota per questo cliente...";
|
echo 'Nessuna nota per questo cliente...';
|
||||||
}
|
}
|
||||||
|
|
||||||
echo "
|
echo '
|
||||||
</div>";
|
</div>';
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
|
|
@ -121,7 +121,6 @@ switch (filter('op')) {
|
||||||
|
|
||||||
//Controllo indirizzo e-mail aggiunto
|
//Controllo indirizzo e-mail aggiunto
|
||||||
foreach ($newsletter->anagrafiche as $anagrafica) {
|
foreach ($newsletter->anagrafiche as $anagrafica) {
|
||||||
|
|
||||||
if (!empty($anagrafica['email'])) {
|
if (!empty($anagrafica['email'])) {
|
||||||
$check = Validate::isValidEmail($anagrafica['email']);
|
$check = Validate::isValidEmail($anagrafica['email']);
|
||||||
|
|
||||||
|
@ -133,7 +132,6 @@ switch (filter('op')) {
|
||||||
'_EMAIL_' => $anagrafica['ragione_sociale'],
|
'_EMAIL_' => $anagrafica['ragione_sociale'],
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($errors)) {
|
if (!empty($errors)) {
|
||||||
|
@ -169,20 +167,15 @@ switch (filter('op')) {
|
||||||
$anagrafiche = $newsletter->anagrafiche;
|
$anagrafiche = $newsletter->anagrafiche;
|
||||||
|
|
||||||
foreach ($anagrafiche as $anagrafica) {
|
foreach ($anagrafiche as $anagrafica) {
|
||||||
|
|
||||||
$newsletter->anagrafiche()->detach($anagrafica->id);
|
$newsletter->anagrafiche()->detach($anagrafica->id);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
flash()->info(tr('Tutti i destinatari sono stati rimossi dalla newsletter!'));
|
flash()->info(tr('Tutti i destinatari sono stati rimossi dalla newsletter!'));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
// Duplica newsletter
|
// Duplica newsletter
|
||||||
case 'copy':
|
case 'copy':
|
||||||
|
|
||||||
$new = $newsletter->replicate();
|
$new = $newsletter->replicate();
|
||||||
$new->state = 'DEV';
|
$new->state = 'DEV';
|
||||||
$new->completed_at = null;
|
$new->completed_at = null;
|
||||||
|
@ -190,10 +183,7 @@ switch (filter('op')) {
|
||||||
|
|
||||||
$id_record = $new->id;
|
$id_record = $new->id;
|
||||||
|
|
||||||
|
|
||||||
flash()->info(tr('Newsletter duplicata correttamente!'));
|
flash()->info(tr('Newsletter duplicata correttamente!'));
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,8 +17,6 @@
|
||||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if ($newsletter->state == 'DEV') {
|
if ($newsletter->state == 'DEV') {
|
||||||
echo '
|
echo '
|
||||||
<button type="button" class="btn btn-primary ask" data-msg="'.tr('Procedere ad inviare la newsletter?').'" data-op="send" data-button="'.tr('Invia').'" data-class="btn btn-lg btn-warning">
|
<button type="button" class="btn btn-primary ask" data-msg="'.tr('Procedere ad inviare la newsletter?').'" data-op="send" data-button="'.tr('Invia').'" data-class="btn btn-lg btn-warning">
|
||||||
|
|
|
@ -23,12 +23,9 @@ $name = filter('name');
|
||||||
$value = filter('value');
|
$value = filter('value');
|
||||||
|
|
||||||
switch ($name) {
|
switch ($name) {
|
||||||
|
|
||||||
case 'email':
|
case 'email':
|
||||||
|
|
||||||
$check = Validate::isValidEmail($value);
|
$check = Validate::isValidEmail($value);
|
||||||
|
|
||||||
|
|
||||||
if (empty($check['valid-format'])) {
|
if (empty($check['valid-format'])) {
|
||||||
$result = false;
|
$result = false;
|
||||||
$errors[] = tr("L'email inserita non possiede un formato valido");
|
$errors[] = tr("L'email inserita non possiede un formato valido");
|
||||||
|
@ -41,8 +38,6 @@ switch ($name) {
|
||||||
$errors[] = tr("Impossibile verificare l'origine dell'email");
|
$errors[] = tr("Impossibile verificare l'origine dell'email");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (!empty($errors)) {
|
if (!empty($errors)) {
|
||||||
$message = tr('Attenzione').':<ul>';
|
$message = tr('Attenzione').':<ul>';
|
||||||
foreach ($errors as $error) {
|
foreach ($errors as $error) {
|
||||||
|
@ -51,7 +46,6 @@ switch ($name) {
|
||||||
$message .= '</ul>';
|
$message .= '</ul>';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
$response = [
|
$response = [
|
||||||
'result' => $result,
|
'result' => $result,
|
||||||
'message' => $message,
|
'message' => $message,
|
||||||
|
|
|
@ -19,11 +19,11 @@
|
||||||
|
|
||||||
include_once __DIR__.'/../../core.php';
|
include_once __DIR__.'/../../core.php';
|
||||||
|
|
||||||
|
use Modules\Articoli\Articolo as ArticoloOriginale;
|
||||||
use Modules\Fatture\Fattura;
|
use Modules\Fatture\Fattura;
|
||||||
use Modules\Fatture\Stato;
|
use Modules\Fatture\Stato;
|
||||||
use Modules\Fatture\Tipo;
|
use Modules\Fatture\Tipo;
|
||||||
use Modules\Ordini\Ordine;
|
use Modules\Ordini\Ordine;
|
||||||
use Modules\Articoli\Articolo as ArticoloOriginale;
|
|
||||||
|
|
||||||
$module_fatture = 'Fatture di vendita';
|
$module_fatture = 'Fatture di vendita';
|
||||||
|
|
||||||
|
|
|
@ -20,8 +20,7 @@
|
||||||
include_once __DIR__.'/../../core.php';
|
include_once __DIR__.'/../../core.php';
|
||||||
|
|
||||||
$id_conto = get('id');
|
$id_conto = get('id');
|
||||||
$lvl = get('lvl')
|
$lvl = get('lvl');
|
||||||
|
|
||||||
|
|
||||||
?><form action="<?php echo base_path(); ?>/editor.php?id_module=<?php echo Modules::get('Piano dei conti')['id']; ?>" method="post">
|
?><form action="<?php echo base_path(); ?>/editor.php?id_module=<?php echo Modules::get('Piano dei conti')['id']; ?>" method="post">
|
||||||
<input type="hidden" name="op" value="add">
|
<input type="hidden" name="op" value="add">
|
||||||
|
|
|
@ -19,11 +19,11 @@
|
||||||
|
|
||||||
include_once __DIR__.'/../../core.php';
|
include_once __DIR__.'/../../core.php';
|
||||||
|
|
||||||
|
use Modules\Articoli\Articolo as ArticoloOriginale;
|
||||||
use Modules\Fatture\Fattura;
|
use Modules\Fatture\Fattura;
|
||||||
use Modules\Fatture\Stato;
|
use Modules\Fatture\Stato;
|
||||||
use Modules\Fatture\Tipo;
|
use Modules\Fatture\Tipo;
|
||||||
use Modules\Preventivi\Preventivo;
|
use Modules\Preventivi\Preventivo;
|
||||||
use Modules\Articoli\Articolo as ArticoloOriginale;
|
|
||||||
|
|
||||||
$module_fatture = 'Fatture di vendita';
|
$module_fatture = 'Fatture di vendita';
|
||||||
|
|
||||||
|
|
|
@ -24,9 +24,8 @@ use Carbon\CarbonInterval;
|
||||||
use Common\Components\Component;
|
use Common\Components\Component;
|
||||||
use Common\Document;
|
use Common\Document;
|
||||||
use Modules\Anagrafiche\Anagrafica;
|
use Modules\Anagrafiche\Anagrafica;
|
||||||
use Modules\Interventi\Intervento;
|
|
||||||
use Modules\Ordini\Ordine;
|
|
||||||
use Modules\Fatture\Fattura;
|
use Modules\Fatture\Fattura;
|
||||||
|
use Modules\Interventi\Intervento;
|
||||||
use Modules\TipiIntervento\Tipo as TipoSessione;
|
use Modules\TipiIntervento\Tipo as TipoSessione;
|
||||||
use Traits\RecordTrait;
|
use Traits\RecordTrait;
|
||||||
use Traits\ReferenceTrait;
|
use Traits\ReferenceTrait;
|
||||||
|
|
|
@ -21,7 +21,6 @@ include_once __DIR__.'/../../core.php';
|
||||||
|
|
||||||
switch (post('op')) {
|
switch (post('op')) {
|
||||||
case 'update':
|
case 'update':
|
||||||
|
|
||||||
if (!empty(intval(post('predefined'))) && !empty(post('module'))) {
|
if (!empty(intval(post('predefined'))) && !empty(post('module'))) {
|
||||||
$dbo->query('UPDATE zz_prints SET predefined = 0 WHERE zz_prints.id != '.prepare($id_record).' AND id_module = '.post('module'));
|
$dbo->query('UPDATE zz_prints SET predefined = 0 WHERE zz_prints.id != '.prepare($id_record).' AND id_module = '.post('module'));
|
||||||
}
|
}
|
||||||
|
@ -34,7 +33,6 @@ switch (post('op')) {
|
||||||
$print->order = post('order');
|
$print->order = post('order');
|
||||||
$print->predefined = intval(post('predefined'));
|
$print->predefined = intval(post('predefined'));
|
||||||
|
|
||||||
|
|
||||||
$print->save();
|
$print->save();
|
||||||
|
|
||||||
flash()->info(tr('Modifiche salvate correttamente'));
|
flash()->info(tr('Modifiche salvate correttamente'));
|
||||||
|
|
|
@ -68,7 +68,7 @@ use Models\PrintTemplate;
|
||||||
?>
|
?>
|
||||||
|
|
||||||
<div class="col-md-3">
|
<div class="col-md-3">
|
||||||
{[ "type": "checkbox", "label": "<?php echo tr('Predefinita'); ?>", "help" : "<?php echo tr("Attiva per impostare questa stampa come predefinita. Attualmente la stampa predefinita per questo modulo è: ".$stampa_predefinita->name); ?>", "name": "predefined", "value": "$predefined$", "disabled": "<?php echo intval($record['predefined']); ?>" ]}
|
{[ "type": "checkbox", "label": "<?php echo tr('Predefinita'); ?>", "help" : "<?php echo tr('Attiva per impostare questa stampa come predefinita. Attualmente la stampa predefinita per questo modulo è: '.$stampa_predefinita->name); ?>", "name": "predefined", "value": "$predefined$", "disabled": "<?php echo intval($record['predefined']); ?>" ]}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
|
@ -70,7 +70,6 @@ switch ($operazione) {
|
||||||
$old = $dbo->selectOne('my_componenti_articoli', '*', ['id' => $old_id]);
|
$old = $dbo->selectOne('my_componenti_articoli', '*', ['id' => $old_id]);
|
||||||
|
|
||||||
if (!empty($old['id_articolo'])) {
|
if (!empty($old['id_articolo'])) {
|
||||||
|
|
||||||
if (empty($old['data_disinstallazione'])) {
|
if (empty($old['data_disinstallazione'])) {
|
||||||
$data = Carbon::now();
|
$data = Carbon::now();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -45,7 +45,7 @@ foreach($componenti as $componente){
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<hr>';
|
<hr>';
|
||||||
$disinstallati++;
|
++$disinstallati;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
$id_articolo = $componente['id_articolo'];
|
$id_articolo = $componente['id_articolo'];
|
||||||
|
@ -65,7 +65,7 @@ foreach($componenti as $componente){
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<hr>';
|
<hr>';
|
||||||
$installati++;
|
++$installati;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -26,7 +26,7 @@ namespace Plugins\DettagliArticolo;
|
||||||
*/
|
*/
|
||||||
class METEL
|
class METEL
|
||||||
{
|
{
|
||||||
const HEADER = [
|
public const HEADER = [
|
||||||
1 => 'Identificazione tracciato',
|
1 => 'Identificazione tracciato',
|
||||||
21 => 'Sigla Azienda',
|
21 => 'Sigla Azienda',
|
||||||
24 => 'Partita IVA',
|
24 => 'Partita IVA',
|
||||||
|
@ -41,7 +41,7 @@ class METEL
|
||||||
153 => 'Filler (spazi)',
|
153 => 'Filler (spazi)',
|
||||||
];
|
];
|
||||||
|
|
||||||
const ROW = [
|
public const ROW = [
|
||||||
1 => 'Sigla Marchio',
|
1 => 'Sigla Marchio',
|
||||||
4 => 'Codice Prodotto Azienda',
|
4 => 'Codice Prodotto Azienda',
|
||||||
20 => 'Codice EAN',
|
20 => 'Codice EAN',
|
||||||
|
|
|
@ -1027,7 +1027,6 @@ class FatturaElettronica
|
||||||
|
|
||||||
// Se imposto il vettore deve essere indicata anche la p.iva nella sua anagrafica
|
// Se imposto il vettore deve essere indicata anche la p.iva nella sua anagrafica
|
||||||
if ($documento->tipo->descrizione == 'Fattura accompagnatoria di vendita') {
|
if ($documento->tipo->descrizione == 'Fattura accompagnatoria di vendita') {
|
||||||
|
|
||||||
if ($documento['idvettore']) {
|
if ($documento['idvettore']) {
|
||||||
$vettore = Anagrafica::find($documento['idvettore']);
|
$vettore = Anagrafica::find($documento['idvettore']);
|
||||||
$result['DatiAnagraficiVettore'] = static::getDatiAnagrafici($vettore);
|
$result['DatiAnagraficiVettore'] = static::getDatiAnagrafici($vettore);
|
||||||
|
@ -1051,7 +1050,6 @@ class FatturaElettronica
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($documento['idsede_destinazione'])) {
|
if (!empty($documento['idsede_destinazione'])) {
|
||||||
|
|
||||||
$sede = $database->fetchOne('SELECT * FROM an_sedi WHERE id='.prepare($documento['idsede_destinazione']));
|
$sede = $database->fetchOne('SELECT * FROM an_sedi WHERE id='.prepare($documento['idsede_destinazione']));
|
||||||
|
|
||||||
if (!empty($sede['indirizzo'])) {
|
if (!empty($sede['indirizzo'])) {
|
||||||
|
|
|
@ -24,7 +24,7 @@ use API\Resource;
|
||||||
|
|
||||||
class Revisione extends Resource implements RetrieveInterface
|
class Revisione extends Resource implements RetrieveInterface
|
||||||
{
|
{
|
||||||
const REVISION = '1';
|
public const REVISION = '1';
|
||||||
|
|
||||||
public function retrieve($request)
|
public function retrieve($request)
|
||||||
{
|
{
|
||||||
|
|
|
@ -29,7 +29,7 @@ use Util\Zip;
|
||||||
class Backup
|
class Backup
|
||||||
{
|
{
|
||||||
/** @var string Pattern per i nomi dei backup */
|
/** @var string Pattern per i nomi dei backup */
|
||||||
const PATTERN = 'OSM backup YYYY-m-d H_i_s';
|
public const PATTERN = 'OSM backup YYYY-m-d H_i_s';
|
||||||
|
|
||||||
/** @var array Elenco delle variabili che identificano i backup giornalieri */
|
/** @var array Elenco delle variabili che identificano i backup giornalieri */
|
||||||
protected static $daily_replaces = [
|
protected static $daily_replaces = [
|
||||||
|
|
|
@ -183,7 +183,7 @@ abstract class Component extends Model
|
||||||
*
|
*
|
||||||
* @param Document $document Documento di destinazione
|
* @param Document $document Documento di destinazione
|
||||||
* @param float|null $qta Quantità da riportare
|
* @param float|null $qta Quantità da riportare
|
||||||
* @param boolean $evadi_qta_parent Definisce se evadere la quantità di provenienza
|
* @param bool $evadi_qta_parent Definisce se evadere la quantità di provenienza
|
||||||
*
|
*
|
||||||
* @return self
|
* @return self
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -105,7 +105,7 @@ class Settings
|
||||||
public static function setValue($setting, $value)
|
public static function setValue($setting, $value)
|
||||||
{
|
{
|
||||||
$setting = self::get($setting);
|
$setting = self::get($setting);
|
||||||
$value = (is_array($value) ? implode(",",$value) : $value);
|
$value = (is_array($value) ? implode(',', $value) : $value);
|
||||||
|
|
||||||
// Trasformazioni
|
// Trasformazioni
|
||||||
// Boolean (checkbox)
|
// Boolean (checkbox)
|
||||||
|
|
|
@ -301,6 +301,26 @@ class Translator extends Util\Singleton
|
||||||
return self::getFormatter()->formatTimestamp($string);
|
return self::getFormatter()->formatTimestamp($string);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Converte il numero in ore.
|
||||||
|
*
|
||||||
|
* @param string $string
|
||||||
|
*
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
|
public static function numberToHours($string)
|
||||||
|
{
|
||||||
|
$string = !isset($string) ? 0 : $string;
|
||||||
|
|
||||||
|
$ore = number_format($string, 2);
|
||||||
|
$splitted_hour = explode('.', $ore);
|
||||||
|
$hour = $splitted_hour[0];
|
||||||
|
$minutes = ($splitted_hour[1] / 100) * 60;
|
||||||
|
$time = $hour.':'.sprintf('%02d', $minutes);
|
||||||
|
|
||||||
|
return $time;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Aggiunge i contenuti della cartella specificata alle traduzioni disponibili.
|
* Aggiunge i contenuti della cartella specificata alle traduzioni disponibili.
|
||||||
*
|
*
|
||||||
|
@ -359,24 +379,4 @@ class Translator extends Util\Singleton
|
||||||
|
|
||||||
self::$formatter->setPrecision(auth()->check() ? setting('Cifre decimali per importi') : 2);
|
self::$formatter->setPrecision(auth()->check() ? setting('Cifre decimali per importi') : 2);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Converte il numero in ore.
|
|
||||||
*
|
|
||||||
* @param string $string
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public static function numberToHours($string)
|
|
||||||
{
|
|
||||||
$string = !isset($string) ? 0 : $string;
|
|
||||||
|
|
||||||
$ore = number_format($string, 2);
|
|
||||||
$splitted_hour = explode('.', $ore);
|
|
||||||
$hour = $splitted_hour[0];
|
|
||||||
$minutes = ($splitted_hour[1]/100)*60;
|
|
||||||
$time = $hour.":".sprintf("%02d", $minutes);
|
|
||||||
|
|
||||||
return $time;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
4
view.php
4
view.php
|
@ -32,8 +32,8 @@ $link = base_path().'/'.$file->filepath;
|
||||||
// Force download of the file
|
// Force download of the file
|
||||||
if (get('force') == '1') {
|
if (get('force') == '1') {
|
||||||
header('Content-Type: application/octet-stream');
|
header('Content-Type: application/octet-stream');
|
||||||
header("Content-Transfer-Encoding: Binary");
|
header('Content-Transfer-Encoding: Binary');
|
||||||
header("Content-disposition: attachment; filename=\"" . basename($file->original_name) . "\"");
|
header('Content-disposition: attachment; filename="'.basename($file->original_name).'"');
|
||||||
readfile($docroot.'/'.$file->filepath);
|
readfile($docroot.'/'.$file->filepath);
|
||||||
exit();
|
exit();
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue