[Inventario]
- Adesso è possibile modificare solamente gli inventari sparati nel giorno (data_ora_inv === oggi) - Pulizia delle query (Sostituite da tempo dai servizi) - Pulizia codice
This commit is contained in:
@@ -47,6 +47,7 @@
|
||||
foreach ($arr_rows as $row) {
|
||||
$idInventario = array_get($row, "idInventario");
|
||||
$dataInventario = array_get($row, "dataInventario");
|
||||
$dataOraInv = array_get($row, "dataOraInv");
|
||||
$filtro = array_get($row, "filtro");
|
||||
$codMdep = array_get($row, "codMdep");
|
||||
$numRighe = array_get($row, "numRighe");
|
||||
@@ -55,6 +56,7 @@
|
||||
<tr data-idInventario="<?= $idInventario ?>"
|
||||
data-codMdep="<?= $codMdep ?>"
|
||||
data-dataInventario="<?= $dataInventario ?>"
|
||||
data-dataOraInv="<?= $dataOraInv ?>"
|
||||
data-profileDb="<?= $profileDb ?>"
|
||||
class="<?= ($focusedRow == $idInventario) ? "focus_fade" : "" ?>">
|
||||
<?php if (!$isPuntoVendita) { ?>
|
||||
|
||||
@@ -40,12 +40,14 @@ $(function () {
|
||||
const idInventario = $tr.getAttr("data-idInventario");
|
||||
const codMdep = $tr.getAttr("data-codMdep");
|
||||
const dataInventario = $tr.getAttr("data-dataInventario");
|
||||
const dataOraInv = $tr.getAttr("data-dataOraInv");
|
||||
const profileDb = $tr.getAttr("data-profileDb");
|
||||
|
||||
const key = {
|
||||
idInventario,
|
||||
codMdep,
|
||||
dataInventario,
|
||||
dataOraInv,
|
||||
profileDb,
|
||||
}
|
||||
|
||||
@@ -176,9 +178,11 @@ const _inventario = {
|
||||
const idInventario = key.idInventario;
|
||||
const codMdep = key.codMdep;
|
||||
const today = moment().startOf("day").unix();
|
||||
const unixDataInv = moment(key.dataInventario, "DD/MM/YYYY").unix();
|
||||
const unixDataInv = key?.dataOraInv ? moment(key.dataOraInv, "DD/MM/YYYY").unix() : null;
|
||||
|
||||
key.isInventarioGiorno = today === unixDataInv;
|
||||
if (unixDataInv) {
|
||||
key.isInventarioGiorno = today === unixDataInv;
|
||||
}
|
||||
|
||||
ajax.get("popup-invenr")
|
||||
.data(key)
|
||||
@@ -193,8 +197,7 @@ const _inventario = {
|
||||
const modalBoxPopup = new ModalBox();
|
||||
|
||||
if (_USER.is_puntoVendita() || !key.isInventarioGiorno) {
|
||||
modalBoxPopup
|
||||
.closeOnly()
|
||||
modalBoxPopup.closeOnly();
|
||||
} else {
|
||||
modalBoxPopup
|
||||
.okClose()
|
||||
@@ -209,7 +212,6 @@ const _inventario = {
|
||||
modalBoxPopup.close();
|
||||
modalBoxWait.close();
|
||||
});
|
||||
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
SELECT mtb_invenr.cod_mart,
|
||||
CASE
|
||||
WHEN mtb_invenr.cod_mart IS NULL THEN 'ARTICOLO NON RICONOSCIUTO ' + scan_cod_barre
|
||||
ELSE descrizione END AS descrizione,
|
||||
qta_inv,
|
||||
unt_mis,
|
||||
id_riga,
|
||||
data_ora_inv,
|
||||
cod_tagl,
|
||||
cod_col,
|
||||
ISNULL(id_disp, '[np_value]') AS id_disp,
|
||||
ISNULL(zona, '[np_value]') AS zona
|
||||
FROM mtb_invenr
|
||||
LEFT OUTER JOIN mtb_aart ON mtb_invenr.cod_mart = mtb_aart.cod_mart
|
||||
WHERE id_inventario = [id_inventario]
|
||||
AND cod_mdep = '[cod_mdep]'
|
||||
ORDER BY zona, id_disp + 0, data_ora_inv, id_riga
|
||||
@@ -1,10 +0,0 @@
|
||||
SELECT id_inventario,
|
||||
data_inventario,
|
||||
filtro,
|
||||
cod_mdep,
|
||||
(SELECT COUNT(*)
|
||||
FROM mtb_invenr
|
||||
WHERE mtb_invent.id_inventario = mtb_invenr.id_inventario
|
||||
AND mtb_invent.cod_mdep = mtb_invenr.cod_mdep) AS num_righe
|
||||
FROM mtb_invent
|
||||
WHERE data_inventario >= DATEADD(YEAR, -5, GETDATE())
|
||||
@@ -374,10 +374,12 @@ const _ordiniARiassClie_filtroArticoli = {
|
||||
},
|
||||
|
||||
getLineeCambioMerce: function () {
|
||||
var self = this;
|
||||
const self = this;
|
||||
|
||||
if (_ordiniARiassClie.righeOrdine.length > 0) {
|
||||
var codLine = _ordiniARiassClie.righeOrdine[0].cod_line;
|
||||
var linea = self.getLinea(codLine);
|
||||
const codLine = _ordiniARiassClie.righeOrdine[0].cod_line;
|
||||
const linea = self.getLinea(codLine);
|
||||
|
||||
if (is_null(linea)) {
|
||||
new ModalBox()
|
||||
.message("La linea <b>" + codLine + "</b> non è valida.<br/>Contattare l'azienda per le opportune verifiche.")
|
||||
@@ -385,11 +387,13 @@ const _ordiniARiassClie_filtroArticoli = {
|
||||
_URL.replace(_URL.current.removeParameter("k")).reload();
|
||||
})
|
||||
.danger().show();
|
||||
|
||||
return;
|
||||
}
|
||||
|
||||
return (!is_null(linea.linee_cambio_merce) && !_.isEmpty(linea.linee_cambio_merce.trim())) ? linea.linee_cambio_merce.trim().split("|") : [];
|
||||
}
|
||||
|
||||
return [];
|
||||
},
|
||||
|
||||
@@ -416,10 +420,11 @@ const _ordiniARiassClie_filtroArticoli = {
|
||||
},
|
||||
|
||||
getLinea: function (codLine) {
|
||||
var self = this;
|
||||
var result = Enumerable.From(self.listLinee).Where(function (x) {
|
||||
return x.cod_line == codLine;
|
||||
const self = this;
|
||||
const result = Enumerable.From(self.listLinee).Where(function (x) {
|
||||
return x.cod_line === codLine;
|
||||
}).ToArray();
|
||||
|
||||
return result.length > 0 ? result[0] : null;
|
||||
},
|
||||
|
||||
@@ -514,16 +519,18 @@ const _ordiniARiassClie_filtroArticoli = {
|
||||
},
|
||||
|
||||
refreshArticoli: function () {
|
||||
var self = this;
|
||||
const self = this;
|
||||
const filter = {};
|
||||
|
||||
var filter = {};
|
||||
$("#flt-articoli input, #flt-articoli select").each(function () {
|
||||
var $input = $(this);
|
||||
var key = $input.attr("id");
|
||||
var value = $input.getValue();
|
||||
const $input = $(this);
|
||||
const key = $input.attr("id");
|
||||
let value = $input.getValue();
|
||||
|
||||
if ($input.is_inputCheckbox()) {
|
||||
value = $input.prop("checked");
|
||||
}
|
||||
|
||||
filter[key] = value;
|
||||
});
|
||||
|
||||
|
||||
@@ -1063,7 +1063,6 @@ ModalArtTagCol.prototype._setRowPrices = function () {
|
||||
return x.cod_tagl === codTagl;
|
||||
})
|
||||
.Select(function (x) {
|
||||
console.log(x.price);
|
||||
if (x.perc_sco1 > 0 || x.perc_sco2 > 0) {
|
||||
return `<s>€${x.price.toFixed(2)}</s> <strong class="text-danger">€${((x.price * (100 - (x.perc_sco1 || 0)) / 100) * ((100 - (x.perc_sco2 || 0)) / 100)).toFixed(2)}</strong>`
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user