Merge pull request 'hotfix: Throw msg and entry_updateComission start transaction' (!2352) from ticket176792-hotfix into master
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
Reviewed-on: #2352 Reviewed-by: Javi Gallego <jgallego@verdnatura.es>
This commit is contained in:
commit
8f6303e851
|
@ -19,10 +19,10 @@ BEGIN
|
|||
AND a.hasWeightVolumetric
|
||||
LIMIT 1;
|
||||
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp.buysToCheck;
|
||||
DROP TEMPORARY TABLE tmp.buysToCheck;
|
||||
|
||||
IF hasVolumetricAgency THEN
|
||||
CALL util.throw('Some purchase line has an item without size or weight per stem in the volumetric agency.');
|
||||
IF hasVolumetricAgency THEN
|
||||
CALL util.throw('Item lacks size/weight in purchase line at agency');
|
||||
END IF;
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -9,6 +9,14 @@ BEGIN
|
|||
DECLARE vCurrencyName VARCHAR(25);
|
||||
DECLARE vComission INT;
|
||||
|
||||
DECLARE EXIT HANDLER FOR SQLEXCEPTION
|
||||
BEGIN
|
||||
ROLLBACK;
|
||||
RESIGNAL;
|
||||
END;
|
||||
|
||||
START TRANSACTION;
|
||||
|
||||
CREATE OR REPLACE TEMPORARY TABLE tmp.recalcEntryCommision
|
||||
SELECT e.id
|
||||
FROM vn.entry e
|
||||
|
@ -28,12 +36,15 @@ BEGIN
|
|||
WHERE id = vCurrency;
|
||||
|
||||
CALL entry_recalc();
|
||||
|
||||
COMMIT;
|
||||
|
||||
SELECT util.notification_send(
|
||||
'entry-update-comission',
|
||||
JSON_OBJECT('currencyName', vCurrencyName, 'referenceCurrent', vComission),
|
||||
NULL
|
||||
);
|
||||
|
||||
DROP TEMPORARY TABLE tmp.recalcEntryCommision;
|
||||
DROP TEMPORARY TABLE tmp.recalcEntryCommision;
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
Loading…
Reference in New Issue