1
0
mirror of https://github.com/devcode-it/openstamanager.git synced 2024-12-25 06:55:05 +01:00

Fix minori

This commit is contained in:
Pek5892 2024-03-01 15:07:42 +01:00
parent 132579719c
commit 87529dd442
2 changed files with 11 additions and 12 deletions

View File

@ -39,7 +39,7 @@ switch ($resource) {
$query = "SELECT
DISTINCT `mg_articoli`.`id`,
IF(`categoria`.`nome` IS NOT NULL, CONCAT(`categoria`.`nome`, IF(`sottocategoria`.`nome` IS NOT NULL, CONCAT(' (', `sottocategoria`.`nome`, ')'), '-')), '<i>".tr('Nessuna categoria')."</i>') AS optgroup,
IF(`categoria_lang`.`name` IS NOT NULL, CONCAT(`categoria_lang`.`name`, IF(`sottocategoria_lang`.`name` IS NOT NULL, CONCAT(' (', `sottocategoria_lang`.`name`, ')'), '-')), '<i>".tr('Nessuna categoria')."</i>') AS optgroup,
`mg_articoli`.`barcode`,
`mg_articoli`.".($prezzi_ivati ? '`prezzo_vendita_ivato`' : '`prezzo_vendita`').' AS prezzo_vendita,
`mg_articoli`.`prezzo_vendita_ivato` AS prezzo_vendita_ivato,
@ -91,8 +91,8 @@ switch ($resource) {
`mg_articoli`.`abilita_serial`,
`mg_articoli`.`idconto_vendita`,
`mg_articoli`.`idconto_acquisto`,
`categoria`.`nome` AS categoria,
`sottocategoria`.`nome` AS sottocategoria,
`categoria_lang`.`name` AS categoria,
`sottocategoria_lang`.`name` AS sottocategoria,
`righe`.`media_ponderata`,
CONCAT(`conto_vendita_categoria` .`numero`, '.', `conto_vendita_sottocategoria`.`numero`, ' ', `conto_vendita_sottocategoria`.`descrizione`) AS idconto_vendita_title,
CONCAT(`conto_acquisto_categoria` .`numero`, '.', `conto_acquisto_sottocategoria`.`numero`, ' ', `conto_acquisto_sottocategoria`.`descrizione`) AS idconto_acquisto_title
@ -111,7 +111,7 @@ switch ($resource) {
ON `righe`.`id`=`mg_articoli`.`id`
LEFT JOIN `co_iva` AS iva_articolo ON `iva_articolo`.`id` = `mg_articoli`.`idiva_vendita`
LEFT JOIN `co_iva_lang` AS iva_articolo_lang on (`iva_articolo`.`id` = `iva_articolo_lang`.`id_record` AND `iva_articolo_lang`.`id_lang` = ".prepare(setting('Lingua')).")
LEFT JOIN `co_iva` AS `iva_predefinita` ON `iva_predefinita`.`id` = (SELECT `valore` FROM `zz_settings` WHERE `nome` = 'Iva predefinita')
LEFT JOIN `co_iva` AS `iva_predefinita` ON `iva_predefinita`.`id` = (SELECT `valore` FROM `zz_settings` WHERE `zz_settings`.`nome` = 'Iva predefinita')
LEFT JOIN `co_iva_lang` AS iva_predefinita_lang on (`iva_predefinita`.`id` = `iva_predefinita_lang`.`id_record` AND `iva_predefinita_lang`.`id_lang` = ".prepare(setting('Lingua')).')';
if ($usare_iva_anagrafica) {
@ -178,8 +178,8 @@ switch ($resource) {
$search_fields[] = '`mg_articoli_lang`.`name` LIKE '.prepare('%'.$search.'%');
$search_fields[] = '`mg_articoli`.`codice` LIKE '.prepare('%'.$search.'%');
$search_fields[] = '`mg_articoli`.`barcode` LIKE '.prepare('%'.$search.'%');
$search_fields[] = '`categoria`.`nome` LIKE '.prepare('%'.$search.'%');
$search_fields[] = '`sottocategoria`.`nome` LIKE '.prepare('%'.$search.'%');
$search_fields[] = '`categoria_lang`.`name` LIKE '.prepare('%'.$search.'%');
$search_fields[] = '`sottocategoria_lang`.`name` LIKE '.prepare('%'.$search.'%');
if ($usare_dettaglio_fornitore) {
$search_fields[] = '`mg_fornitore_articolo`.`descrizione` LIKE '.prepare('%'.$search.'%');

View File

@ -22,7 +22,7 @@ include_once __DIR__.'/../../../core.php';
$impegnato = 0;
$ordinato = 0;
$query = 'SELECT
$query = "SELECT
`or_ordini`.`id` AS id,
`or_ordini`.`numero`,
`or_ordini`.`numero_esterno`,
@ -34,15 +34,13 @@ $query = 'SELECT
`or_ordini`
INNER JOIN `or_righe_ordini` ON `or_ordini`.`id` = `or_righe_ordini`.`idordine`
INNER JOIN `or_statiordine` ON `or_ordini`.`idstatoordine`=`or_statiordine`.`id`
INNER JOIN `or_tipiordine` ON `or_ordini`.`idtipiordine`=`or_tipiordine`.`id`
INNER JOIN `or_tipiordine` ON `or_ordini`.`idtipoordine`=`or_tipiordine`.`id`
WHERE
`idarticolo` = '.prepare($articolo->id)."
`idarticolo` = ".prepare($articolo->id)."
AND `or_tipiordine`.`dir`= '|dir|'
AND (`or_righe_ordini`.`qta` - `or_righe_ordini`.`qta_evasa`) > 0
AND `or_righe_ordini`.`confermato` = 1
AND `or_statiordine`.`impegnato` = 1
GROUP BY
`or_ordini`.`id`
HAVING
`qta_ordinata` > 0";
@ -146,8 +144,9 @@ echo '
<div class="panel-body" style="min-height:98px;">';
$ordini = $dbo->fetchArray(str_replace('|dir|', 'uscita', $query));
$ordinato = sum(array_column($ordini, 'qta_ordinata'));
if (!empty($ordini)) {
$ordinato = sum(array_column($ordini, 'qta_ordinata'));
echo '
<table class="table table-bordered table-condensed table-striped">
<thead>