[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:
@@ -47,9 +47,10 @@ class KendoService
|
||||
foreach ($filters as $filt) {
|
||||
$filt = $filt[0];
|
||||
|
||||
$operator = $filt['operator'];
|
||||
$value = $filt['value'];
|
||||
$field = $filt['field'];
|
||||
$operator = (array_key_exists('operator', $filt)) ? $filt['operator'] : "";
|
||||
$field = (array_key_exists('field', $filt)) ? $filt['field'] : "";
|
||||
$value = (array_key_exists('value', $filt)) ? $filt['value'] : "";
|
||||
$val = null;
|
||||
|
||||
switch ($operator) {
|
||||
case 'contains' :
|
||||
@@ -120,5 +121,4 @@ class KendoService
|
||||
|
||||
return $filtered;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,2 +1 @@
|
||||
body{font-size:12px}
|
||||
/*# sourceMappingURL=main.css.map */
|
||||
body{font-size:12px}/*# sourceMappingURL=main.css.map */
|
||||
|
||||
@@ -67,6 +67,8 @@ class ControlloGiacenze
|
||||
'peso_lordo_kg' => ($articolo['peso_lordo_kg']) ?: "",
|
||||
'cod_jfas' => ($articolo['cod_jfas']) ?: "",
|
||||
'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"];
|
||||
$value = $filt["value"];
|
||||
|
||||
$query
|
||||
->where($alias . '.' . $field . ' ' . $op . (isset($val) ? ' \'[' . $field . ']\'' : ''));
|
||||
if ($op === "IS NULL" or $op === "IS NOT NULL") {
|
||||
$query->where('NULLIF(CONVERT(varchar, ' . $alias . '.' . $field . '), \'\') ' . $op);
|
||||
} else {
|
||||
$query->where($alias . '.' . $field . ' ' . $op . (isset($val) ? ' \'[' . $field . ']\'' : null));
|
||||
}
|
||||
|
||||
if (isset($val)) {
|
||||
switch ($field) {
|
||||
@@ -204,36 +209,42 @@ class ControlloGiacenze
|
||||
return array(
|
||||
"cod_mdep" => array(
|
||||
"label" => "Deposito",
|
||||
"type" => "string",
|
||||
"width" => "150",
|
||||
"format" => "",
|
||||
"attributes" => "{style: 'text-align: center;'}"
|
||||
),
|
||||
"cod_mart" => array(
|
||||
"label" => "Codice Articolo",
|
||||
"type" => "string",
|
||||
"width" => "200",
|
||||
"format" => "",
|
||||
"attributes" => "{style: 'text-align: center;'}"
|
||||
),
|
||||
"partita_mag" => array(
|
||||
"label" => "Lotto",
|
||||
"type" => "string",
|
||||
"width" => "150",
|
||||
"format" => "",
|
||||
"attributes" => "{style: 'text-align: center;'}"
|
||||
),
|
||||
"descrizione_estesa" => array(
|
||||
"label" => "Descrizione Articolo",
|
||||
"type" => "string",
|
||||
"width" => "300",
|
||||
"format" => "",
|
||||
"attributes" => "{style: 'text-align: center;'}"
|
||||
),
|
||||
"unt_mis" => array(
|
||||
"label" => "U.M.",
|
||||
"type" => "string",
|
||||
"width" => "150",
|
||||
"format" => "",
|
||||
"attributes" => "{style: 'text-align: center;'}"
|
||||
),
|
||||
"qta_col" => array(
|
||||
"label" => "Quantità",
|
||||
"type" => "string",
|
||||
"width" => "150",
|
||||
"format" => "",
|
||||
"attributes" => "{style: 'text-align: center;'}",
|
||||
@@ -256,84 +267,98 @@ class ControlloGiacenze
|
||||
),
|
||||
"data_collo" => array(
|
||||
"label" => "Data Collo",
|
||||
"type" => "string",
|
||||
"width" => "300",
|
||||
"format" => "{0:d}",
|
||||
"attributes" => "{style: 'text-align: center;'}",
|
||||
),
|
||||
"ser_collo" => array(
|
||||
"label" => "Ser. Collo",
|
||||
"type" => "string",
|
||||
"width" => "150",
|
||||
"format" => "",
|
||||
"attributes" => "{style: 'text-align: center;'}"
|
||||
),
|
||||
"num_collo" => array(
|
||||
"label" => "Num. Collo",
|
||||
"type" => "string",
|
||||
"width" => "150",
|
||||
"format" => "",
|
||||
"attributes" => "{style: 'text-align: center;'}"
|
||||
),
|
||||
"gestione" => array(
|
||||
"label" => "Gestione",
|
||||
"type" => "string",
|
||||
"width" => "150",
|
||||
"format" => "",
|
||||
"attributes" => "{style: 'text-align: center;'}"
|
||||
),
|
||||
"preparato_da" => array(
|
||||
"label" => "Preparato da",
|
||||
"type" => "string",
|
||||
"width" => "150",
|
||||
"format" => "",
|
||||
"attributes" => "{style: 'text-align: center;'}"
|
||||
),
|
||||
"codGruppo" => array(
|
||||
"label" => "Codice Gruppo",
|
||||
"type" => "string",
|
||||
"width" => "150",
|
||||
"format" => "",
|
||||
"attributes" => "{style: 'text-align: center;'}"
|
||||
),
|
||||
"Gruppo" => array(
|
||||
"label" => "Gruppo",
|
||||
"type" => "string",
|
||||
"width" => "150",
|
||||
"format" => "",
|
||||
"attributes" => "{style: 'text-align: center;'}"
|
||||
),
|
||||
"codSgruppo" => array(
|
||||
"label" => "Codice Sottogruppo",
|
||||
"type" => "string",
|
||||
"width" => "150",
|
||||
"format" => "",
|
||||
"attributes" => "{style: 'text-align: center;'}"
|
||||
),
|
||||
"Sottogruppo" => array(
|
||||
"label" => "Sottogruppo",
|
||||
"type" => "string",
|
||||
"width" => "150",
|
||||
"format" => "",
|
||||
"attributes" => "{style: 'text-align: center;'}"
|
||||
),
|
||||
"diacod" => array(
|
||||
"label" => "Diacod",
|
||||
"type" => "string",
|
||||
"width" => "300",
|
||||
"format" => "",
|
||||
"attributes" => "{style: 'text-align: center;'}"
|
||||
),
|
||||
"cod_jcom" => array(
|
||||
"label" => "Codice Commessa",
|
||||
"type" => "string",
|
||||
"width" => "150",
|
||||
"format" => "",
|
||||
"attributes" => "{style: 'text-align: center;'}"
|
||||
),
|
||||
"commessa" => array(
|
||||
"label" => "Commessa",
|
||||
"type" => "string",
|
||||
"width" => "300",
|
||||
"format" => "",
|
||||
"attributes" => "{style: 'text-align: center;'}"
|
||||
),
|
||||
"qta_cnf" => array(
|
||||
"label" => "Quantità per Confezioni",
|
||||
"type" => "string",
|
||||
"width" => "150",
|
||||
"format" => "",
|
||||
"attributes" => "{style: 'text-align: center;'}"
|
||||
),
|
||||
"peso_netto_kg" => array(
|
||||
"label" => "Peso Netto (Kg)",
|
||||
"type" => "string",
|
||||
"width" => "150",
|
||||
"format" => "",
|
||||
"attributes" => "{style: 'text-align: center;'}",
|
||||
@@ -342,6 +367,7 @@ class ControlloGiacenze
|
||||
),
|
||||
"peso_lordo_kg" => array(
|
||||
"label" => "Peso Lordo (Kg)",
|
||||
"type" => "string",
|
||||
"width" => "150",
|
||||
"format" => "",
|
||||
"attributes" => "{style: 'text-align: center;'}",
|
||||
@@ -350,14 +376,30 @@ class ControlloGiacenze
|
||||
),
|
||||
"cod_jfas" => array(
|
||||
"label" => "Codice Fase",
|
||||
"type" => "string",
|
||||
"width" => "150",
|
||||
"format" => "",
|
||||
"attributes" => "{style: 'text-align: center;'}"
|
||||
),
|
||||
"data_ret" => array(
|
||||
"label" => "Data Ultima Rettifica",
|
||||
"type" => "string",
|
||||
"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;'}",
|
||||
),
|
||||
);
|
||||
|
||||
@@ -71,11 +71,13 @@
|
||||
unt_mis: {type: "string"},
|
||||
qta_col: {type: "string"},
|
||||
num_cnf: {type: "string"},
|
||||
qta_cnf: {type: "string"},
|
||||
peso_netto_kg: {type: "string"},
|
||||
qta_cnf: {type: "number"},
|
||||
peso_netto_kg: {type: "number"},
|
||||
peso_lordo_kg: {type: "string"},
|
||||
cod_jfas: {type: "string"},
|
||||
data_ret: {type: "date"},
|
||||
num_ord: {type: "string"},
|
||||
data_ord: {type: "date"},
|
||||
}
|
||||
},
|
||||
total: "total",
|
||||
@@ -93,7 +95,13 @@
|
||||
serverSorting: true,
|
||||
serverAggregates: true,
|
||||
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",
|
||||
filterable: {
|
||||
@@ -107,10 +115,8 @@
|
||||
neq: "Non è uguale a",
|
||||
startswith: "Inizia con",
|
||||
endswith: "Finisce con",
|
||||
isnull: "È null",
|
||||
isnotnull: "Non è null",
|
||||
isempty: "È vuoto",
|
||||
isnotempty: "Non è vuoto",
|
||||
isnull: "È nullo",
|
||||
isnotnull: "Non è nullo",
|
||||
},
|
||||
}
|
||||
},
|
||||
@@ -166,6 +172,7 @@
|
||||
}
|
||||
|
||||
$label = $defaultColonne[$field]["label"];
|
||||
$type = array_key_exists("type", $defaultColonne[$field]) ? $defaultColonne[$field]["type"] : "''";
|
||||
$width = $defaultColonne[$field]["width"];
|
||||
$format = $defaultColonne[$field]["format"];
|
||||
$attributes = $defaultColonne[$field]["attributes"];
|
||||
@@ -174,6 +181,7 @@
|
||||
?>
|
||||
{
|
||||
field: "<?= $field ?>",
|
||||
type: "<?= $type ?>",
|
||||
title: "<?= $label ?>",
|
||||
width: <?= $width ?>,
|
||||
format: "<?= $format ?>",
|
||||
|
||||
@@ -4,7 +4,7 @@ SELECT count(*) as count,
|
||||
SUM(peso_netto_kg) as peso_netto_kg,
|
||||
SUM(peso_lordo_kg) as peso_lordo_kg
|
||||
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
|
||||
INNER JOIN mtb_colt mt
|
||||
ON mt.data_collo = inv.data_collo
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
SELECT *
|
||||
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
|
||||
INNER JOIN mtb_colt mt
|
||||
ON mt.data_collo = inv.data_collo
|
||||
|
||||
Reference in New Issue
Block a user