mirror of
https://github.com/devcode-it/openstamanager.git
synced 2025-02-02 00:46:44 +01:00
Ulteriore rimozione warnings
Rimozione warnings completa per le funzionalità principali.
This commit is contained in:
parent
625b9eb5a4
commit
52fb10a456
@ -75,7 +75,7 @@ switch ($resource) {
|
||||
$idagente_default = 0;
|
||||
}
|
||||
|
||||
$ids = array_column($results, $id);
|
||||
$ids = array_column($results, 'idanagrafica');
|
||||
$pos = array_search($idagente_default, $ids);
|
||||
if ($pos !== false) {
|
||||
$results[$pos]['_bgcolor_'] = '#ff0';
|
||||
@ -84,7 +84,7 @@ switch ($resource) {
|
||||
|
||||
case 'tecnici':
|
||||
$query = "SELECT an_anagrafiche.idanagrafica AS id, CONCAT(ragione_sociale, IF(citta IS NULL OR citta = '', '', CONCAT(' (', citta, ')'))) AS descrizione, idtipointervento_default FROM an_anagrafiche INNER JOIN (an_tipianagrafiche_anagrafiche INNER JOIN an_tipianagrafiche ON an_tipianagrafiche_anagrafiche.idtipoanagrafica=an_tipianagrafiche.idtipoanagrafica) ON an_anagrafiche.idanagrafica=an_tipianagrafiche_anagrafiche.idanagrafica |where| ORDER BY ragione_sociale";
|
||||
|
||||
|
||||
foreach ($elements as $element) {
|
||||
$filter[] = 'an_anagrafiche.idanagrafica='.prepare($element);
|
||||
}
|
||||
@ -92,13 +92,13 @@ switch ($resource) {
|
||||
if (empty($filter)) {
|
||||
$where[] = "descrizione='Tecnico'";
|
||||
$where[] = 'deleted=0';
|
||||
|
||||
|
||||
//come tecnico posso aprire attività solo a mio nome
|
||||
$user = Auth::user();
|
||||
if ($user['gruppo'] == 'Tecnici' AND !empty($user['idanagrafica']) ) {
|
||||
$where[] = 'an_anagrafiche.idanagrafica='.$user['idanagrafica'];
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
if (!empty($search)) {
|
||||
|
@ -5,6 +5,7 @@ include_once __DIR__.'/../../../core.php';
|
||||
include_once Modules::filepath('Preventivi', 'modutil.php');
|
||||
|
||||
// Interventi
|
||||
$rsi = [];
|
||||
if (in_array('Cliente', explode(',', $records[0]['tipianagrafica']))) {
|
||||
//Clienti
|
||||
$rsi = $dbo->fetchArray('SELECT ragione_sociale, (SELECT MIN(orario_inizio) FROM in_interventi_tecnici WHERE idintervento=in_interventi.id) AS data, (SELECT SUM(prezzo_ore_consuntivo+prezzo_km_consuntivo+prezzo_dirittochiamata) FROM in_interventi_tecnici WHERE idintervento=in_interventi.id) AS totale FROM in_interventi INNER JOIN an_anagrafiche ON in_interventi.idanagrafica=an_anagrafiche.idanagrafica WHERE in_interventi.idanagrafica='.prepare($id_record));
|
||||
|
@ -31,10 +31,10 @@ switch (post('op')) {
|
||||
// Tipo di pagamento predefinito dall'anagrafica
|
||||
$query = 'SELECT id FROM co_pagamenti WHERE id=(SELECT '.$campo.' AS pagamento FROM an_anagrafiche WHERE idanagrafica='.prepare($idanagrafica).')';
|
||||
$rs = $dbo->fetchArray($query);
|
||||
$idpagamento = $rs[0]['id'];
|
||||
$idpagamento = isset($rs[0]) ? $rs[0]['id'] : null;
|
||||
|
||||
// Se il ddt è un ddt cliente e non è stato associato un pagamento predefinito al cliente leggo il pagamento dalle impostazioni
|
||||
if ($dir == 'entrata' && $idpagamento == '') {
|
||||
if ($dir == 'entrata' && empty($idpagamento)) {
|
||||
$idpagamento = get_var('Tipo di pagamento predefinito');
|
||||
}
|
||||
|
||||
|
@ -215,7 +215,7 @@ $totale = sum([
|
||||
|
||||
$netto_a_pagare = sum([
|
||||
$totale,
|
||||
$marca_da_bollo,
|
||||
//$marca_da_bollo, // Variabile non inizializzata!
|
||||
-$records[0]['ritenutaacconto'],
|
||||
]);
|
||||
|
||||
|
@ -8,6 +8,6 @@ FROM dt_ddt WHERE id='.prepare($id_record));
|
||||
return [
|
||||
'email' => $r['email'],
|
||||
'numero' => empty($r['numero_esterno']) ? $r['numero'] : $r['numero_esterno'],
|
||||
'descrizione' => $r['descrizione'],
|
||||
'note' => $r['note'],
|
||||
'data' => Translator::dateToLocale($r['data']),
|
||||
];
|
||||
|
@ -24,7 +24,7 @@ if ($module['name'] == 'Fatture di vendita') {
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
{[ "type": "select", "label": "<?php echo $tipo_anagrafica; ?>", "name": "idanagrafica", "required": 1, "values": "query=SELECT an_anagrafiche.idanagrafica AS id, ragione_sociale AS descrizione FROM an_anagrafiche INNER JOIN (an_tipianagrafiche_anagrafiche INNER JOIN an_tipianagrafiche ON an_tipianagrafiche_anagrafiche.idtipoanagrafica=an_tipianagrafiche.idtipoanagrafica) ON an_anagrafiche.idanagrafica=an_tipianagrafiche_anagrafiche.idanagrafica WHERE descrizione='<?php echo $tipo_anagrafica; ?>' AND deleted=0 ORDER BY ragione_sociale", "value": "<?php echo $idanagrafica; ?>", "icon-after": "add|<?php echo Modules::get('Anagrafiche')['id']; ?>|tipoanagrafica=<?php echo $tipo_anagrafica; ?>" ]}
|
||||
{[ "type": "select", "label": "<?php echo $tipo_anagrafica; ?>", "name": "idanagrafica", "required": 1, "values": "query=SELECT an_anagrafiche.idanagrafica AS id, ragione_sociale AS descrizione FROM an_anagrafiche INNER JOIN (an_tipianagrafiche_anagrafiche INNER JOIN an_tipianagrafiche ON an_tipianagrafiche_anagrafiche.idtipoanagrafica=an_tipianagrafiche.idtipoanagrafica) ON an_anagrafiche.idanagrafica=an_tipianagrafiche_anagrafiche.idanagrafica WHERE descrizione='<?php echo $tipo_anagrafica; ?>' AND deleted=0 ORDER BY ragione_sociale", "value": "<?php echo $user['idanagrafica']; ?>", "icon-after": "add|<?php echo Modules::get('Anagrafiche')['id']; ?>|tipoanagrafica=<?php echo $tipo_anagrafica; ?>" ]}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
@ -9,11 +9,10 @@ $tipodoc = $rs[0]['descrizione'];
|
||||
$_SESSION['superselect']['idanagrafica'] = $records[0]['idanagrafica'];
|
||||
$_SESSION['superselect']['ddt'] = $dir;
|
||||
|
||||
|
||||
if ($dir == 'entrata') {
|
||||
$conto = 'vendite';
|
||||
$conto = 'vendite';
|
||||
} else {
|
||||
$conto = 'acquisti';
|
||||
$conto = 'acquisti';
|
||||
}
|
||||
|
||||
?>
|
||||
@ -69,10 +68,10 @@ if ($dir == 'entrata') {
|
||||
$label = tr('Numero fattura');
|
||||
}
|
||||
?>
|
||||
|
||||
|
||||
<!-- id_segment -->
|
||||
{[ "type": "hidden", "label": "Segmento", "name": "id_segment", "class": "text-center", "value": "$id_segment$" ]}
|
||||
|
||||
|
||||
<div class="col-md-3">
|
||||
{[ "type": "text", "label": "<?php echo $label; ?>", "name": "numero_esterno", "class": "alphanumeric-mask text-center", "value": "$numero_esterno$" ]}
|
||||
</div>
|
||||
@ -143,7 +142,7 @@ if ($dir == 'entrata') {
|
||||
<div class="col-md-3">
|
||||
{[ "type": "select", "label": "<?php echo tr('Pagamento'); ?>", "name": "idpagamento", "required": 1, "values": "query=SELECT id, descrizione, (SELECT id FROM co_banche WHERE id_pianodeiconti3 = co_pagamenti.idconto_<?php echo $conto; ?> ) AS idbanca FROM co_pagamenti GROUP BY descrizione ORDER BY descrizione ASC", "value": "$idpagamento$", "extra": "onchange=\"$('#idbanca').val( $(this).find('option:selected').data('idbanca') ).change(); \" " ]}
|
||||
</div>
|
||||
|
||||
|
||||
<div class="col-md-3">
|
||||
{[ "type": "select", "label": "<?php echo tr('Banca'); ?>", "name": "idbanca", "required": 0, "values": "query=SELECT id, CONCAT (nome, ' - ' , iban) AS descrizione FROM co_banche WHERE deleted = 0 ORDER BY nome ASC", "value": "$idbanca$" ]}
|
||||
</div>
|
||||
@ -153,7 +152,7 @@ if ($dir == 'entrata') {
|
||||
|
||||
<?php
|
||||
if ($tipodoc == 'Fattura accompagnatoria di vendita') {
|
||||
?>
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="col-md-3">
|
||||
{[ "type": "select", "label": "<?php echo tr('Aspetto beni'); ?>", "name": "idaspettobeni", "placeholder": "-", "values": "query=SELECT id, descrizione FROM dt_aspettobeni ORDER BY descrizione ASC", "value": "$idaspettobeni$" ]}
|
||||
@ -183,7 +182,7 @@ if ($tipodoc == 'Fattura accompagnatoria di vendita') {
|
||||
</div>
|
||||
|
||||
<?php
|
||||
}
|
||||
}
|
||||
|
||||
if ($dir == 'uscita') {
|
||||
?>
|
||||
@ -202,13 +201,11 @@ if ($dir == 'uscita') {
|
||||
<div class="pull-right">
|
||||
<?php
|
||||
// Aggiunta prima nota solo se non c'è già, se non si è in bozza o se il pagamento non è completo
|
||||
$query2 = 'SELECT id FROM co_movimenti WHERE iddocumento='.$id_record.' AND primanota=1';
|
||||
$n2 = $dbo->fetchNum($query2);
|
||||
$n2 = $dbo->fetchNum('SELECT id FROM co_movimenti WHERE iddocumento='.prepare($id_record).' AND primanota=1');
|
||||
|
||||
$query3 = 'SELECT SUM(da_pagare-pagato) AS differenza, SUM(da_pagare) FROM co_scadenziario GROUP BY iddocumento HAVING iddocumento='.$id_record;
|
||||
$rs3 = $dbo->fetchArray($query3);
|
||||
$differenza = $rs3[0]['differenza'];
|
||||
$da_pagare = $rs3[0]['da_pagare'];
|
||||
$rs3 = $dbo->fetchArray('SELECT SUM(da_pagare-pagato) AS differenza, SUM(da_pagare) FROM co_scadenziario GROUP BY iddocumento HAVING iddocumento='.prepare($id_record));
|
||||
$differenza = isset($rs3[0]) ? $rs3[0]['differenza'] : null;
|
||||
$da_pagare = isset($rs3[0]) ? $rs3[0]['da_pagare'] : null;
|
||||
|
||||
if (($n2 <= 0 && $records[0]['stato'] == 'Emessa') || $differenza != 0) {
|
||||
?>
|
||||
@ -306,11 +303,11 @@ if ($records[0]['stato'] != 'Pagato' && $records[0]['stato'] != 'Emessa') {
|
||||
<i class="fa fa-plus"></i> Ddt
|
||||
</a>';
|
||||
}
|
||||
|
||||
// Lettura ordini
|
||||
$ordini_query = 'SELECT COUNT(*) AS tot FROM or_ordini WHERE idanagrafica='.prepare($records[0]['idanagrafica']).' AND idstatoordine IN (SELECT id FROM or_statiordine WHERE descrizione IN(\'Bozza\', \'Evaso\', \'Parzialmente evaso\', \'Parzialmente fatturato\')) AND idtipoordine=(SELECT id FROM or_tipiordine WHERE dir='.prepare($dir).') AND or_ordini.id IN (SELECT idordine FROM or_righe_ordini WHERE or_righe_ordini.idordine = or_ordini.id AND (qta - qta_evasa) > 0)';
|
||||
$ordini = $dbo->fetchArray($ordini_query)[0]['tot'];
|
||||
echo '
|
||||
|
||||
// Lettura ordini
|
||||
$ordini_query = 'SELECT COUNT(*) AS tot FROM or_ordini WHERE idanagrafica='.prepare($records[0]['idanagrafica']).' AND idstatoordine IN (SELECT id FROM or_statiordine WHERE descrizione IN(\'Bozza\', \'Evaso\', \'Parzialmente evaso\', \'Parzialmente fatturato\')) AND idtipoordine=(SELECT id FROM or_tipiordine WHERE dir='.prepare($dir).') AND or_ordini.id IN (SELECT idordine FROM or_righe_ordini WHERE or_righe_ordini.idordine = or_ordini.id AND (qta - qta_evasa) > 0)';
|
||||
$ordini = $dbo->fetchArray($ordini_query)[0]['tot'];
|
||||
echo '
|
||||
<a class="btn btn-sm btn-primary'.(!empty($ordini) ? '' : ' disabled').'" data-href="'.$rootdir.'/modules/fatture/add_ordine.php?id_module='.$id_module.'&id_record='.$id_record.'" data-toggle="modal" data-title="Aggiungi ordine" data-target="#bs-popup">
|
||||
<i class="fa fa-plus"></i> Ordine
|
||||
</a>';
|
||||
|
@ -8,6 +8,6 @@ FROM co_documenti WHERE id='.prepare($id_record));
|
||||
return [
|
||||
'email' => $r['email'],
|
||||
'numero' => empty($r['numero_esterno']) ? $r['numero'] : $r['numero_esterno'],
|
||||
'descrizione' => $r['descrizione'],
|
||||
'note' => $r['note'],
|
||||
'data' => Translator::dateToLocale($r['data']),
|
||||
];
|
||||
|
@ -219,6 +219,7 @@ switch (post('op')) {
|
||||
$idsede = post('idsede');
|
||||
$data_richiesta = post('data_richiesta');
|
||||
$richiesta = post('richiesta');
|
||||
$idautomezzo = null;
|
||||
|
||||
if (!empty($codice) && !empty($post['idanagrafica']) && !empty($post['idtipointervento'])) {
|
||||
// Salvataggio modifiche intervento
|
||||
|
@ -2,7 +2,7 @@
|
||||
|
||||
include_once __DIR__.'/../../../core.php';
|
||||
|
||||
$matricole = (array) $post['matricole'];
|
||||
$matricole = (array) post('matricole');
|
||||
|
||||
// Salvo gli impianti selezionati
|
||||
if (filter('op') == 'link_myimpianti') {
|
||||
|
@ -34,12 +34,11 @@ switch (post('op')) {
|
||||
$campo = ($dir == 'entrata') ? 'idpagamento_vendite' : 'idpagamento_acquisti';
|
||||
|
||||
// Tipo di pagamento predefinito dall'anagrafica
|
||||
$query = 'SELECT id FROM co_pagamenti WHERE id=(SELECT '.$campo.' AS pagamento FROM an_anagrafiche WHERE idanagrafica='.prepare($idanagrafica).')';
|
||||
$rs = $dbo->fetchArray($query);
|
||||
$idpagamento = $rs[0]['id'];
|
||||
$rs = $dbo->fetchArray('SELECT id FROM co_pagamenti WHERE id=(SELECT '.$campo.' AS pagamento FROM an_anagrafiche WHERE idanagrafica='.prepare($idanagrafica).')');
|
||||
$idpagamento = isset($rs[0]) ? $rs[0]['id'] : null;
|
||||
|
||||
// Se l'ordine è un ordine cliente e non è stato associato un pagamento predefinito al cliente leggo il pagamento dalle impostazioni
|
||||
if ($dir == 'entrata' && $idpagamento == '') {
|
||||
if ($dir == 'entrata' && empty($idpagamento)) {
|
||||
$idpagamento = get_var('Tipo di pagamento predefinito');
|
||||
}
|
||||
|
||||
@ -377,10 +376,10 @@ switch (post('op')) {
|
||||
// Tipo di pagamento predefinito dall'anagrafica
|
||||
$query = 'SELECT id FROM co_pagamenti WHERE id=(SELECT '.$campo.' AS pagamento FROM an_anagrafiche WHERE idanagrafica='.prepare($idanagrafica).')';
|
||||
$rs = $dbo->fetchArray($query);
|
||||
$idpagamento = $rs[0]['id'];
|
||||
$idpagamento = isset($rs[0]) ? $rs[0]['id'] : null;
|
||||
|
||||
// Se l'ordine è un ordine cliente e non è stato associato un pagamento predefinito al cliente leggo il pagamento dalle impostazioni
|
||||
if ($dir == 'entrata' && $idpagamento == '') {
|
||||
if ($dir == 'entrata' && empty($idpagamento)) {
|
||||
$idpagamento = get_var('Tipo di pagamento predefinito');
|
||||
}
|
||||
|
||||
|
@ -210,7 +210,7 @@ $totale = sum([
|
||||
|
||||
$netto_a_pagare = sum([
|
||||
$totale,
|
||||
$marca_da_bollo,
|
||||
//$marca_da_bollo, // Variabile non inizializzata!
|
||||
-$records[0]['ritenutaacconto'],
|
||||
]);
|
||||
|
||||
|
@ -8,6 +8,6 @@ FROM or_ordini WHERE id='.prepare($id_record));
|
||||
return [
|
||||
'email' => $r['email'],
|
||||
'numero' => empty($r['numero_esterno']) ? $r['numero'] : $r['numero_esterno'],
|
||||
'descrizione' => $r['descrizione'],
|
||||
'note' => $r['note'],
|
||||
'data' => Translator::dateToLocale($r['data']),
|
||||
];
|
||||
|
@ -103,6 +103,7 @@ class DefaultHandler implements HandlerInterface
|
||||
$values['type'] = $original['type'];
|
||||
$values['value'] = $original['value'];
|
||||
$values['name'] = $original['name'];
|
||||
$values['id'] = $original['id'];
|
||||
$values['class'] = [];
|
||||
|
||||
// Delega al metodo "text", per la generazione del codice HTML
|
||||
|
@ -244,6 +244,7 @@ class Prints
|
||||
}
|
||||
|
||||
// Impostazioni personalizzate della stampa
|
||||
$custom = [];
|
||||
if (file_exists($infos['full_directory'].'/custom/settings.php')) {
|
||||
$custom = include $infos['full_directory'].'/custom/settings.php';
|
||||
} elseif (file_exists($infos['full_directory'].'/settings.php')) {
|
||||
|
@ -14,12 +14,12 @@ if (empty($id_sede) || $id_sede == '-1') {
|
||||
$rsc = $dbo->fetchArray($queryc);
|
||||
|
||||
// Lettura dati aziendali
|
||||
$rsf = $dbo->fetchArray("SELECT *, (SELECT iban FROM co_banche WHERE id IN (SELECT idbanca FROM co_documenti WHERE id = ".prepare($id_record)." ) ) AS codiceiban, (SELECT nome FROM co_banche WHERE id IN (SELECT idbanca FROM co_documenti WHERE id = ".prepare($id_record)." ) ) AS appoggiobancario, (SELECT bic FROM co_banche WHERE id IN (SELECT idbanca FROM co_documenti WHERE id = ".prepare($id_record)." ) ) AS bic FROM an_anagrafiche WHERE idanagrafica = (SELECT valore FROM zz_settings WHERE nome='Azienda predefinita')");
|
||||
$rsf = $dbo->fetchArray('SELECT *, (SELECT iban FROM co_banche WHERE id IN (SELECT idbanca FROM co_documenti WHERE id = '.prepare($id_record).' ) ) AS codiceiban, (SELECT nome FROM co_banche WHERE id IN (SELECT idbanca FROM co_documenti WHERE id = '.prepare($id_record).' ) ) AS appoggiobancario, (SELECT bic FROM co_banche WHERE id IN (SELECT idbanca FROM co_documenti WHERE id = '.prepare($id_record)." ) ) AS bic FROM an_anagrafiche WHERE idanagrafica = (SELECT valore FROM zz_settings WHERE nome='Azienda predefinita')");
|
||||
|
||||
// Prefissi e contenuti del replace
|
||||
$replace = [
|
||||
'c_' => $rsc[0],
|
||||
'f_' => $rsf[0],
|
||||
'c_' => isset($rsc[0]) ? $rsc[0] : [],
|
||||
'f_' => isset($rsf[0]) ? $rsf[0] : [],
|
||||
];
|
||||
|
||||
// Rinominazione di particolari campi all'interno delle informazioni su anagrafica e azienda
|
||||
@ -37,7 +37,13 @@ foreach ($replace as $prefix => $values) {
|
||||
|
||||
// Rinominazione dei campi
|
||||
foreach ($rename as $key => $value) {
|
||||
$values[$value] = $values[$key];
|
||||
$val = null;
|
||||
|
||||
if (isset($values[$key])) {
|
||||
$val = $values[$key];
|
||||
}
|
||||
|
||||
$values[$value] = $val;
|
||||
unset($values[$key]);
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user