[Controllo Giacenze]

- Aggiunte colonne Num. Ord. e Data Ord.
- Corretto filtri IS NULL e IS NOT NULL
- Modifiche per evitare errori in determinate operazioni (Is null, not null, ecc)
This commit is contained in:
2021-10-25 18:17:59 +02:00
parent 59b6c6d579
commit ebaf8ed2e5
6 changed files with 67 additions and 18 deletions

View File

@@ -47,9 +47,10 @@ class KendoService
foreach ($filters as $filt) { foreach ($filters as $filt) {
$filt = $filt[0]; $filt = $filt[0];
$operator = $filt['operator']; $operator = (array_key_exists('operator', $filt)) ? $filt['operator'] : "";
$value = $filt['value']; $field = (array_key_exists('field', $filt)) ? $filt['field'] : "";
$field = $filt['field']; $value = (array_key_exists('value', $filt)) ? $filt['value'] : "";
$val = null;
switch ($operator) { switch ($operator) {
case 'contains' : case 'contains' :
@@ -120,5 +121,4 @@ class KendoService
return $filtered; return $filtered;
} }
} }

View File

@@ -1,2 +1 @@
body{font-size:12px} body{font-size:12px}/*# sourceMappingURL=main.css.map */
/*# sourceMappingURL=main.css.map */

View File

@@ -67,6 +67,8 @@ class ControlloGiacenze
'peso_lordo_kg' => ($articolo['peso_lordo_kg']) ?: "", 'peso_lordo_kg' => ($articolo['peso_lordo_kg']) ?: "",
'cod_jfas' => ($articolo['cod_jfas']) ?: "", 'cod_jfas' => ($articolo['cod_jfas']) ?: "",
'data_ret' => (Utility\Date::format($articolo['data_ret'], Format::strftimeDMYY)) ?: "", 'data_ret' => (Utility\Date::format($articolo['data_ret'], Format::strftimeDMYY)) ?: "",
'num_ord' => ($articolo['num_ord']) ?: "",
'data_ord' => (Utility\Date::format($articolo['data_ord'], Format::strftimeDMYY)) ?: "",
); );
} }
@@ -94,8 +96,11 @@ class ControlloGiacenze
$val = $filt["val"]; $val = $filt["val"];
$value = $filt["value"]; $value = $filt["value"];
$query if ($op === "IS NULL" or $op === "IS NOT NULL") {
->where($alias . '.' . $field . ' ' . $op . (isset($val) ? ' \'[' . $field . ']\'' : '')); $query->where('NULLIF(CONVERT(varchar, ' . $alias . '.' . $field . '), \'\') ' . $op);
} else {
$query->where($alias . '.' . $field . ' ' . $op . (isset($val) ? ' \'[' . $field . ']\'' : null));
}
if (isset($val)) { if (isset($val)) {
switch ($field) { switch ($field) {
@@ -204,36 +209,42 @@ class ControlloGiacenze
return array( return array(
"cod_mdep" => array( "cod_mdep" => array(
"label" => "Deposito", "label" => "Deposito",
"type" => "string",
"width" => "150", "width" => "150",
"format" => "", "format" => "",
"attributes" => "{style: 'text-align: center;'}" "attributes" => "{style: 'text-align: center;'}"
), ),
"cod_mart" => array( "cod_mart" => array(
"label" => "Codice Articolo", "label" => "Codice Articolo",
"type" => "string",
"width" => "200", "width" => "200",
"format" => "", "format" => "",
"attributes" => "{style: 'text-align: center;'}" "attributes" => "{style: 'text-align: center;'}"
), ),
"partita_mag" => array( "partita_mag" => array(
"label" => "Lotto", "label" => "Lotto",
"type" => "string",
"width" => "150", "width" => "150",
"format" => "", "format" => "",
"attributes" => "{style: 'text-align: center;'}" "attributes" => "{style: 'text-align: center;'}"
), ),
"descrizione_estesa" => array( "descrizione_estesa" => array(
"label" => "Descrizione Articolo", "label" => "Descrizione Articolo",
"type" => "string",
"width" => "300", "width" => "300",
"format" => "", "format" => "",
"attributes" => "{style: 'text-align: center;'}" "attributes" => "{style: 'text-align: center;'}"
), ),
"unt_mis" => array( "unt_mis" => array(
"label" => "U.M.", "label" => "U.M.",
"type" => "string",
"width" => "150", "width" => "150",
"format" => "", "format" => "",
"attributes" => "{style: 'text-align: center;'}" "attributes" => "{style: 'text-align: center;'}"
), ),
"qta_col" => array( "qta_col" => array(
"label" => "Quantità", "label" => "Quantità",
"type" => "string",
"width" => "150", "width" => "150",
"format" => "", "format" => "",
"attributes" => "{style: 'text-align: center;'}", "attributes" => "{style: 'text-align: center;'}",
@@ -256,84 +267,98 @@ class ControlloGiacenze
), ),
"data_collo" => array( "data_collo" => array(
"label" => "Data Collo", "label" => "Data Collo",
"type" => "string",
"width" => "300", "width" => "300",
"format" => "{0:d}", "format" => "{0:d}",
"attributes" => "{style: 'text-align: center;'}", "attributes" => "{style: 'text-align: center;'}",
), ),
"ser_collo" => array( "ser_collo" => array(
"label" => "Ser. Collo", "label" => "Ser. Collo",
"type" => "string",
"width" => "150", "width" => "150",
"format" => "", "format" => "",
"attributes" => "{style: 'text-align: center;'}" "attributes" => "{style: 'text-align: center;'}"
), ),
"num_collo" => array( "num_collo" => array(
"label" => "Num. Collo", "label" => "Num. Collo",
"type" => "string",
"width" => "150", "width" => "150",
"format" => "", "format" => "",
"attributes" => "{style: 'text-align: center;'}" "attributes" => "{style: 'text-align: center;'}"
), ),
"gestione" => array( "gestione" => array(
"label" => "Gestione", "label" => "Gestione",
"type" => "string",
"width" => "150", "width" => "150",
"format" => "", "format" => "",
"attributes" => "{style: 'text-align: center;'}" "attributes" => "{style: 'text-align: center;'}"
), ),
"preparato_da" => array( "preparato_da" => array(
"label" => "Preparato da", "label" => "Preparato da",
"type" => "string",
"width" => "150", "width" => "150",
"format" => "", "format" => "",
"attributes" => "{style: 'text-align: center;'}" "attributes" => "{style: 'text-align: center;'}"
), ),
"codGruppo" => array( "codGruppo" => array(
"label" => "Codice Gruppo", "label" => "Codice Gruppo",
"type" => "string",
"width" => "150", "width" => "150",
"format" => "", "format" => "",
"attributes" => "{style: 'text-align: center;'}" "attributes" => "{style: 'text-align: center;'}"
), ),
"Gruppo" => array( "Gruppo" => array(
"label" => "Gruppo", "label" => "Gruppo",
"type" => "string",
"width" => "150", "width" => "150",
"format" => "", "format" => "",
"attributes" => "{style: 'text-align: center;'}" "attributes" => "{style: 'text-align: center;'}"
), ),
"codSgruppo" => array( "codSgruppo" => array(
"label" => "Codice Sottogruppo", "label" => "Codice Sottogruppo",
"type" => "string",
"width" => "150", "width" => "150",
"format" => "", "format" => "",
"attributes" => "{style: 'text-align: center;'}" "attributes" => "{style: 'text-align: center;'}"
), ),
"Sottogruppo" => array( "Sottogruppo" => array(
"label" => "Sottogruppo", "label" => "Sottogruppo",
"type" => "string",
"width" => "150", "width" => "150",
"format" => "", "format" => "",
"attributes" => "{style: 'text-align: center;'}" "attributes" => "{style: 'text-align: center;'}"
), ),
"diacod" => array( "diacod" => array(
"label" => "Diacod", "label" => "Diacod",
"type" => "string",
"width" => "300", "width" => "300",
"format" => "", "format" => "",
"attributes" => "{style: 'text-align: center;'}" "attributes" => "{style: 'text-align: center;'}"
), ),
"cod_jcom" => array( "cod_jcom" => array(
"label" => "Codice Commessa", "label" => "Codice Commessa",
"type" => "string",
"width" => "150", "width" => "150",
"format" => "", "format" => "",
"attributes" => "{style: 'text-align: center;'}" "attributes" => "{style: 'text-align: center;'}"
), ),
"commessa" => array( "commessa" => array(
"label" => "Commessa", "label" => "Commessa",
"type" => "string",
"width" => "300", "width" => "300",
"format" => "", "format" => "",
"attributes" => "{style: 'text-align: center;'}" "attributes" => "{style: 'text-align: center;'}"
), ),
"qta_cnf" => array( "qta_cnf" => array(
"label" => "Quantità per Confezioni", "label" => "Quantità per Confezioni",
"type" => "string",
"width" => "150", "width" => "150",
"format" => "", "format" => "",
"attributes" => "{style: 'text-align: center;'}" "attributes" => "{style: 'text-align: center;'}"
), ),
"peso_netto_kg" => array( "peso_netto_kg" => array(
"label" => "Peso Netto (Kg)", "label" => "Peso Netto (Kg)",
"type" => "string",
"width" => "150", "width" => "150",
"format" => "", "format" => "",
"attributes" => "{style: 'text-align: center;'}", "attributes" => "{style: 'text-align: center;'}",
@@ -342,6 +367,7 @@ class ControlloGiacenze
), ),
"peso_lordo_kg" => array( "peso_lordo_kg" => array(
"label" => "Peso Lordo (Kg)", "label" => "Peso Lordo (Kg)",
"type" => "string",
"width" => "150", "width" => "150",
"format" => "", "format" => "",
"attributes" => "{style: 'text-align: center;'}", "attributes" => "{style: 'text-align: center;'}",
@@ -350,14 +376,30 @@ class ControlloGiacenze
), ),
"cod_jfas" => array( "cod_jfas" => array(
"label" => "Codice Fase", "label" => "Codice Fase",
"type" => "string",
"width" => "150", "width" => "150",
"format" => "", "format" => "",
"attributes" => "{style: 'text-align: center;'}" "attributes" => "{style: 'text-align: center;'}"
), ),
"data_ret" => array( "data_ret" => array(
"label" => "Data Ultima Rettifica", "label" => "Data Ultima Rettifica",
"type" => "string",
"width" => "150", "width" => "150",
"format" => "{0:s}", "format" => "{0:d}",
"attributes" => "{style: 'text-align: center;'}",
),
"num_ord" => array(
"label" => "Numero Ordine",
"type" => "string",
"width" => "150",
"format" => "",
"attributes" => "{style: 'text-align: center;'}"
),
"data_ord" => array(
"label" => "Data Ordine",
"type" => "string",
"width" => "150",
"format" => "{0:d}",
"attributes" => "{style: 'text-align: center;'}", "attributes" => "{style: 'text-align: center;'}",
), ),
); );

View File

@@ -71,11 +71,13 @@
unt_mis: {type: "string"}, unt_mis: {type: "string"},
qta_col: {type: "string"}, qta_col: {type: "string"},
num_cnf: {type: "string"}, num_cnf: {type: "string"},
qta_cnf: {type: "string"}, qta_cnf: {type: "number"},
peso_netto_kg: {type: "string"}, peso_netto_kg: {type: "number"},
peso_lordo_kg: {type: "string"}, peso_lordo_kg: {type: "string"},
cod_jfas: {type: "string"}, cod_jfas: {type: "string"},
data_ret: {type: "date"}, data_ret: {type: "date"},
num_ord: {type: "string"},
data_ord: {type: "date"},
} }
}, },
total: "total", total: "total",
@@ -93,7 +95,13 @@
serverSorting: true, serverSorting: true,
serverAggregates: true, serverAggregates: true,
sort: {field: "data_collo", dir: "desc"}, sort: {field: "data_collo", dir: "desc"},
filter: { field: "cod_mdep", operator: "equals", value: "<?php print User::get_current_userDepo() ?>" }, <?php if (User::get_current_userDepo()) { ?>
filter: {
field: "cod_mdep",
operator: "equals",
value: "<?= User::get_current_userDepo() ?>"
},
<?php } ?>
}, },
height: "85vh", height: "85vh",
filterable: { filterable: {
@@ -107,10 +115,8 @@
neq: "Non è uguale a", neq: "Non è uguale a",
startswith: "Inizia con", startswith: "Inizia con",
endswith: "Finisce con", endswith: "Finisce con",
isnull: "È null", isnull: "È nullo",
isnotnull: "Non è null", isnotnull: "Non è nullo",
isempty: "È vuoto",
isnotempty: "Non è vuoto",
}, },
} }
}, },
@@ -166,6 +172,7 @@
} }
$label = $defaultColonne[$field]["label"]; $label = $defaultColonne[$field]["label"];
$type = array_key_exists("type", $defaultColonne[$field]) ? $defaultColonne[$field]["type"] : "''";
$width = $defaultColonne[$field]["width"]; $width = $defaultColonne[$field]["width"];
$format = $defaultColonne[$field]["format"]; $format = $defaultColonne[$field]["format"];
$attributes = $defaultColonne[$field]["attributes"]; $attributes = $defaultColonne[$field]["attributes"];
@@ -174,6 +181,7 @@
?> ?>
{ {
field: "<?= $field ?>", field: "<?= $field ?>",
type: "<?= $type ?>",
title: "<?= $label ?>", title: "<?= $label ?>",
width: <?= $width ?>, width: <?= $width ?>,
format: "<?= $format ?>", format: "<?= $format ?>",

View File

@@ -4,7 +4,7 @@ SELECT count(*) as count,
SUM(peso_netto_kg) as peso_netto_kg, SUM(peso_netto_kg) as peso_netto_kg,
SUM(peso_lordo_kg) as peso_lordo_kg SUM(peso_lordo_kg) as peso_lordo_kg
FROM ( FROM (
SELECT mt.preparato_da, inv.*, data_ret SELECT mt.preparato_da, mt.num_ord, mt.data_ord, inv.*, data_ret
FROM mvw_sitart_udc_det_inventario inv FROM mvw_sitart_udc_det_inventario inv
INNER JOIN mtb_colt mt INNER JOIN mtb_colt mt
ON mt.data_collo = inv.data_collo ON mt.data_collo = inv.data_collo

View File

@@ -1,6 +1,6 @@
SELECT * SELECT *
FROM ( FROM (
SELECT mt.preparato_da, inv.*, data_ret SELECT mt.preparato_da, mt.num_ord, mt.data_ord, inv.*, data_ret
FROM mvw_sitart_udc_det_inventario inv FROM mvw_sitart_udc_det_inventario inv
INNER JOIN mtb_colt mt INNER JOIN mtb_colt mt
ON mt.data_collo = inv.data_collo ON mt.data_collo = inv.data_collo