refactor: refs #7937 improve transaction handling in report_print procedure and enhance claimEnd filter
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
25ad28d019
commit
5eb981165e
|
@ -28,13 +28,11 @@ BEGIN
|
||||||
DECLARE vPrinterSize VARCHAR(255);
|
DECLARE vPrinterSize VARCHAR(255);
|
||||||
DECLARE vPriorityFk INT;
|
DECLARE vPriorityFk INT;
|
||||||
DECLARE vReportFk INT;
|
DECLARE vReportFk INT;
|
||||||
DECLARE vTx BOOLEAN DEFAULT @@in_transaction;
|
DECLARE vTx BOOLEAN DEFAULT NOT @@in_transaction;
|
||||||
|
|
||||||
DECLARE EXIT HANDLER FOR SQLEXCEPTION
|
DECLARE EXIT HANDLER FOR SQLEXCEPTION
|
||||||
BEGIN
|
BEGIN
|
||||||
IF NOT vTx THEN
|
CALL util.tx_rollback(vTx);
|
||||||
ROLLBACK;
|
|
||||||
END IF;
|
|
||||||
RESIGNAL;
|
RESIGNAL;
|
||||||
END;
|
END;
|
||||||
|
|
||||||
|
@ -62,10 +60,7 @@ BEGIN
|
||||||
IF vReportSize <> vPrinterSize THEN
|
IF vReportSize <> vPrinterSize THEN
|
||||||
CALL util.throw('incorrectSize');
|
CALL util.throw('incorrectSize');
|
||||||
END IF;
|
END IF;
|
||||||
|
CALL util.tx_start(vTx);
|
||||||
IF NOT vTx THEN
|
|
||||||
START TRANSACTION;
|
|
||||||
END IF;
|
|
||||||
INSERT INTO printQueue
|
INSERT INTO printQueue
|
||||||
SET printerFk = vPrinterFk,
|
SET printerFk = vPrinterFk,
|
||||||
priorityFk = vPriorityFk,
|
priorityFk = vPriorityFk,
|
||||||
|
@ -86,8 +81,6 @@ BEGIN
|
||||||
SET vI = vI + 1;
|
SET vI = vI + 1;
|
||||||
END WHILE;
|
END WHILE;
|
||||||
|
|
||||||
IF NOT vTx THEN
|
CALL util.tx_commit(vTx);
|
||||||
COMMIT;
|
|
||||||
END IF;
|
|
||||||
END$$
|
END$$
|
||||||
DELIMITER ;
|
DELIMITER ;
|
||||||
|
|
|
@ -0,0 +1,8 @@
|
||||||
|
UPDATE vn.claimDestination cd
|
||||||
|
SET cd.addressFk = NULL
|
||||||
|
WHERE code IN ('garbage/loss','manufacturing','supplierClaim','corrected');
|
||||||
|
|
||||||
|
UPDATE vn.claimDestination cd
|
||||||
|
JOIN vn.addressWaste aw ON aw.`type` = 'fault'
|
||||||
|
SET cd.addressFk = aw.addressFk
|
||||||
|
WHERE code IN ('good');
|
|
@ -52,10 +52,12 @@ module.exports = Self => {
|
||||||
s.price,
|
s.price,
|
||||||
s.discount,
|
s.discount,
|
||||||
s.quantity * s.price * ((100 - s.discount) / 100) total,
|
s.quantity * s.price * ((100 - s.discount) / 100) total,
|
||||||
ce.shelvingFk
|
ce.shelvingFk,
|
||||||
|
sh.code shelvingCode
|
||||||
FROM vn.claimEnd ce
|
FROM vn.claimEnd ce
|
||||||
LEFT JOIN vn.sale s ON s.id = ce.saleFk
|
LEFT JOIN vn.sale s ON s.id = ce.saleFk
|
||||||
LEFT JOIN vn.ticket t ON t.id = s.ticketFk
|
LEFT JOIN vn.ticket t ON t.id = s.ticketFk
|
||||||
|
LEFT JOIN vn.shelving sh ON sh.id = ce.shelvingFk
|
||||||
) ce`
|
) ce`
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue