1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2025-02-23 14:57:46 +01:00

Fix stato dei Preventivi selezionabili

This commit is contained in:
Thomas Zilio 2020-07-27 16:29:40 +02:00
parent 9882a7348e
commit eeca4811d9
3 changed files with 13 additions and 24 deletions

View File

@ -27,6 +27,7 @@ if (!empty($id_documento)) {
$id_anagrafica = $documento_finale->idanagrafica;
$_SESSION['superselect']['idanagrafica'] = $id_anagrafica;
$_SESSION['superselect']['stato'] = 'is_fatturabile';
echo '
<div class="row">

View File

@ -28,6 +28,7 @@ if (!empty($id_documento)) {
$id_anagrafica = $documento_finale->idanagrafica;
$_SESSION['superselect']['idanagrafica'] = $id_anagrafica;
$_SESSION['superselect']['stato'] = 'is_fatturabile';
echo '
<div class="row">

View File

@ -15,7 +15,7 @@ switch ($resource) {
$where[] = 'an_anagrafiche.idanagrafica='.prepare($superselect['idanagrafica']);
$where[] = 'co_preventivi.default_revision=1';
$stato = !empty($superselect['stato']) ? $superselect['stato'] : 'is_fatturabile';
$stato = !empty($superselect['stato']) ? $superselect['stato'] : 'is_pianificabile';
$where[] = 'idstato IN (SELECT `id` FROM `co_statipreventivi` WHERE '.$stato.' = 1)';
}
@ -30,18 +30,5 @@ switch ($resource) {
$custom['sconto'] = 'sconto';
}
break;
case 'preventivi_aperti':
$query = 'SELECT co_preventivi.id AS id, CONCAT(numero, " ", co_preventivi.nome, " (", ragione_sociale, ")") AS descrizione FROM co_preventivi INNER JOIN an_anagrafiche ON co_preventivi.idanagrafica=an_anagrafiche.idanagrafica |where| ORDER BY id';
foreach ($elements as $element) {
$filter[] = 'idpreventivo='.prepare($element);
}
$where[] = 'idstato IN (1)';
if (!empty($search)) {
$search_fields[] = 'nome LIKE '.prepare('%'.$search.'%');
}
break;
}