Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 7283-itemSectionsMigration
gitea/salix/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Jorge Penadés 2024-08-07 10:16:53 +02:00
commit 4b8b7e3a18
4 changed files with 23 additions and 10 deletions

View File

@ -32,7 +32,7 @@ BEGIN
JOIN duaEntry de ON de.entryFk = e.id JOIN duaEntry de ON de.entryFk = e.id
JOIN invoiceInConfig iic JOIN invoiceInConfig iic
WHERE de.duaFk = vDuaFk WHERE de.duaFk = vDuaFk
AND iidd.dueDated <= util.VN_CURDATE() + INTERVAL iic.dueDateMarginDays DAY; AND iidd.dueDated < util.VN_CURDATE() + INTERVAL iic.dueDateMarginDays DAY;
IF vIncorrectInvoiceInDueDay THEN IF vIncorrectInvoiceInDueDay THEN
CALL util.throw(CONCAT('Incorrect due date, invoice: ', vIncorrectInvoiceInDueDay)); CALL util.throw(CONCAT('Incorrect due date, invoice: ', vIncorrectInvoiceInDueDay));

View File

@ -1,11 +1,18 @@
DELIMITER $$ DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`expeditionScan_Put`(vPalletFk INT, vExpeditionFk INT) CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`expeditionScan_Put`(
vPalletFk INT,
vExpeditionFk INT
)
BEGIN BEGIN
IF NOT (SELECT TRUE FROM expedition WHERE id = vExpeditionFk LIMIT 1) THEN
REPLACE vn.expeditionScan(expeditionFk, palletFk) CALL util.throw('Expedition not exists');
VALUES(vExpeditionFk, vPalletFk); END IF;
SELECT LAST_INSERT_ID() INTO vPalletFk; IF NOT (SELECT TRUE FROM expeditionPallet WHERE id = vPalletFk LIMIT 1) THEN
CALL util.throw('Pallet not exists');
END IF;
REPLACE expeditionScan(expeditionFk, palletFk)
VALUES(vExpeditionFk, vPalletFk);
END$$ END$$
DELIMITER ; DELIMITER ;

View File

@ -8,7 +8,13 @@ BEGIN
SET NEW.editorFk = account.myUser_getId(); SET NEW.editorFk = account.myUser_getId();
IF NOT (NEW.routeFk <=> OLD.routeFk) THEN IF NOT (NEW.routeFk <=> OLD.routeFk) THEN
IF NEW.isSigned THEN IF NEW.isSigned AND NOT (
SELECT (COUNT(s.id) = COUNT(cb.saleFk)
AND SUM(s.quantity) = SUM(cb.quantity))
FROM sale s
LEFT JOIN claimBeginning cb ON cb.saleFk = s.id
WHERE s.ticketFk = NEW.id
) THEN
CALL util.throw('A signed ticket cannot be rerouted'); CALL util.throw('A signed ticket cannot be rerouted');
END IF; END IF;
INSERT IGNORE INTO routeRecalc(routeFk) INSERT IGNORE INTO routeRecalc(routeFk)

View File

@ -90,7 +90,7 @@ module.exports = Self => {
stmt.merge(conn.makeWhere(filter.where)); stmt.merge(conn.makeWhere(filter.where));
stmt.merge(conn.makeGroupBy('t.id')); stmt.merge(conn.makeGroupBy('t.id'));
stmt.merge(conn.makePagination(filter)); stmt.merge(conn.makeOrderBy(filter.order));
return conn.executeStmt(stmt, myOptions); return conn.executeStmt(stmt, myOptions);
}; };