feat: refs #6321 updates requested
gitea/salix/pipeline/pr-dev There was a failure building this commit
Details
gitea/salix/pipeline/pr-dev There was a failure building this commit
Details
This commit is contained in:
parent
da90d43f7a
commit
1f6f7b9975
|
@ -4,7 +4,7 @@ CREATE OR REPLACE DEFINER=`vn`@`localhost` PROCEDURE `vn`.`item_getLack`(
|
|||
vForce BOOLEAN,
|
||||
vDays INT,
|
||||
vLongname VARCHAR(255),
|
||||
vSupplierFk VARCHAR(255),
|
||||
vProducerName VARCHAR(255),
|
||||
vColor VARCHAR(255),
|
||||
vSize INT,
|
||||
vOrigen INT,
|
||||
|
@ -60,7 +60,7 @@ BEGIN
|
|||
AND it.code != 'GEN'
|
||||
AND (vSelf IS NULL OR i.id = vSelf)
|
||||
AND (vLongname IS NULL OR i.name = vLongname)
|
||||
AND (vSupplierFk IS NULL OR p.`name` LIKE CONCAT('%', vSupplierFk, '%'))
|
||||
AND (vProducerName IS NULL OR p.`name` LIKE CONCAT('%', vProducerName, '%'))
|
||||
AND (vColor IS NULL OR vColor = i.inkFk)
|
||||
AND (vSize IS NULL OR vSize = i.`size`)
|
||||
AND (vOrigen IS NULL OR vOrigen = w.id)
|
||||
|
|
|
@ -256,5 +256,5 @@
|
|||
"Incorrect delivery order alert on route": "Incorrect delivery order alert on route: {{ route }} zone: {{ zone }}",
|
||||
"Ticket has been delivered out of order": "The ticket {{ticket}} of route {{{fullUrl}}} has been delivered out of order.",
|
||||
"negativeReplaced": "(Negativos) Sustituido el articulo [#{{oldItemId}}]({{{oldItemUrl}}}) {{oldItem}} por [#{{newItemId}}]({{{newItemUrl}}}) {{newItem}} del ticket [{{ticketId}}]({{{ticketUrl}}})",
|
||||
"The tag or priority can't be repeated for an item": "The tag or priority can't be repeated for an item"
|
||||
"The tag and priority can't be repeated": "The tag and priority can't be repeated"
|
||||
}
|
||||
|
|
|
@ -32,9 +32,9 @@ module.exports = Self => {
|
|||
const query = [
|
||||
filter.itemFk,
|
||||
where.warehouseFk,
|
||||
where.date ?? Date.vnNew(),
|
||||
where.showType ?? true,
|
||||
where.scopeDays ?? 2
|
||||
where.date,
|
||||
where.showType,
|
||||
where.scopeDays
|
||||
];
|
||||
const [results] = await Self.rawSql('CALL vn.item_getSimilar(?, ?, ?, ?, ?)', query, myOptions);
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ module.exports = Self => {
|
|||
JOIN hedera.imageConfig ic
|
||||
WHERE e.supplierFk = ?
|
||||
AND i.family IN ('EMB', 'CONT')
|
||||
AND b.created > (util.VN_CURDATE() - INTERVAL bc.monthsAgo MONTH)
|
||||
AND b.created > util.VN_CURDATE() - INTERVAL bc.monthsAgo MONTH)
|
||||
GROUP BY b.itemFk
|
||||
ORDER BY et.quantity DESC, quantityTotal DESC`, [entry, id, id]);
|
||||
};
|
||||
|
|
|
@ -62,7 +62,7 @@ module.exports = Self => {
|
|||
IF(ISNULL(tr.saleFk),0,1) peticionCompra,
|
||||
DATE_FORMAT(IF(HOUR(t.shipped), t.shipped, IF(zc.hour, zc.hour, z.hour)),'%H:%i') minTimed,
|
||||
FALSE isBasket,
|
||||
substitution.hasSubstitution,
|
||||
substitution.hasObservation,
|
||||
IF(d.code = 'spainTeamVip', 1, 0) hasToIgnore
|
||||
FROM sale s
|
||||
LEFT JOIN saleGroupDetail sgd ON sgd.saleFk = s.id
|
||||
|
@ -81,7 +81,7 @@ module.exports = Self => {
|
|||
LEFT JOIN workerDepartment wd ON wd.workerFk = c.salesPersonFk
|
||||
LEFT JOIN department d ON d.id = wd.departmentFk
|
||||
LEFT JOIN (
|
||||
SELECT co.clientFk, IF(COUNT(*) > 0, FALSE, TRUE) hasSubstitution
|
||||
SELECT co.clientFk, IF(COUNT(*) > 0, FALSE, TRUE) hasObservation
|
||||
FROM clientObservation co
|
||||
INNER JOIN observationType ot ON ot.id = co.observationTypeFk
|
||||
WHERE ot.code = 'substitution'
|
||||
|
@ -92,7 +92,7 @@ module.exports = Self => {
|
|||
AND s.quantity <> 0
|
||||
AND t.shipped BETWEEN util.VN_CURDATE() AND DATE_ADD(util.VN_CURDATE(), INTERVAL ? DAY)
|
||||
AND sgd.saleFk IS NULL
|
||||
AND (al.id = ? OR al.id IS NULL)
|
||||
AND (al.code IN (?) OR al.id IS NULL)
|
||||
UNION ALL
|
||||
SELECT r.id,
|
||||
NULL,
|
||||
|
@ -117,7 +117,7 @@ module.exports = Self => {
|
|||
NULL,
|
||||
NULL,
|
||||
TRUE,
|
||||
substitution.hasSubstitution,
|
||||
substitution.hasObservation,
|
||||
IF(d.code = 'spainTeamVip', 1, 0)
|
||||
FROM hedera.orderRow r
|
||||
INNER JOIN hedera.order o ON o.id = r.orderFk
|
||||
|
@ -127,7 +127,7 @@ module.exports = Self => {
|
|||
LEFT JOIN workerDepartment wd ON wd.workerFk = c.salesPersonFk
|
||||
LEFT JOIN department d ON d.id = wd.departmentFk
|
||||
LEFT JOIN (
|
||||
SELECT co.clientFk, IF(COUNT(*) > 0, FALSE, TRUE) hasSubstitution
|
||||
SELECT co.clientFk, IF(COUNT(*) > 0, FALSE, TRUE) hasObservation
|
||||
FROM clientObservation co
|
||||
INNER JOIN observationType ot ON ot.id = co.observationTypeFk
|
||||
WHERE ot.code = 'substitution'
|
||||
|
@ -135,12 +135,20 @@ module.exports = Self => {
|
|||
) substitution ON substitution.clientFk = c.id
|
||||
WHERE r.shipment BETWEEN util.VN_CURDATE() AND DATE_ADD(util.VN_CURDATE(), INTERVAL ? DAY)
|
||||
AND r.warehouseFk = ?
|
||||
AND r.created >= STR_TO_DATE(util.VN_CURDATE(), '%Y-%m-%d %H:%i:%s')
|
||||
AND r.created >= util.VN_CURDATE()
|
||||
AND NOT o.confirmed
|
||||
AND r.itemFk = ?
|
||||
AND r.amount <> 0
|
||||
AND r.amount
|
||||
ORDER BY hasToIgnore, isBasket;`,
|
||||
[filter.where.warehouseFk, itemFk, 2, filter.where.stateFk ?? 0, 2, filter.where.warehouseFk, itemFk]);
|
||||
[
|
||||
filter.where.warehouseFk,
|
||||
itemFk,
|
||||
2,
|
||||
filter.where.alertLevelCode,
|
||||
2,
|
||||
filter.where.warehouseFk,
|
||||
itemFk
|
||||
]);
|
||||
|
||||
const sql = ParameterizedSQL.join([stmt], ';');
|
||||
const result = await conn.executeStmt(sql, myOptions);
|
||||
|
|
Loading…
Reference in New Issue