Merge branch 'dev' of https://gitea.verdnatura.es/verdnatura/salix into 7283-itemSectionsMigration
gitea/salix/pipeline/pr-dev This commit looks good
Details
gitea/salix/pipeline/pr-dev This commit looks good
Details
This commit is contained in:
commit
4b8b7e3a18
|
@ -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));
|
||||||
|
|
|
@ -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 ;
|
||||||
|
|
|
@ -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)
|
||||||
|
|
|
@ -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);
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue