feat: restricciones AWB para travel y entry refs #6960
gitea/salix/pipeline/pr-master This commit looks good
Details
gitea/salix/pipeline/pr-master This commit looks good
Details
This commit is contained in:
parent
b9e774cea0
commit
292b77d57e
|
@ -9,18 +9,17 @@ BEGIN
|
||||||
|
|
||||||
SET NEW.editorFk = account.myUser_getId();
|
SET NEW.editorFk = account.myUser_getId();
|
||||||
|
|
||||||
IF NOT(NEW.travelFk <=> OLD.travelFk) THEN
|
IF NOT (NEW.travelFk <=> OLD.travelFk) THEN
|
||||||
|
|
||||||
IF NEW.travelFk IS NOT NULL AND NOT travel_hasUniqueAwb(NEW.travelFk) THEN
|
IF NEW.travelFk IS NOT NULL AND NOT travel_hasUniqueAwb(NEW.travelFk) THEN
|
||||||
CALL util.throw('El travel no es correcto, en las entradas asociadas existe un AWB distinto');
|
CALL util.throw('El travel no es correcto, en las entradas asociadas existe un AWB distinto');
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
IF !(NEW.travelFk <=> OLD.travelFk) THEN
|
|
||||||
SELECT COUNT(*) > 0 INTO vIsVirtual
|
SELECT COUNT(*) > 0 INTO vIsVirtual
|
||||||
FROM entryVirtual WHERE entryFk = NEW.id;
|
FROM entryVirtual WHERE entryFk = NEW.id;
|
||||||
|
|
||||||
SELECT !(o.warehouseInFk <=> n.warehouseInFk)
|
SELECT NOT (o.warehouseInFk <=> n.warehouseInFk)
|
||||||
OR !(o.warehouseOutFk <=> n.warehouseOutFk)
|
OR NOT (o.warehouseOutFk <=> n.warehouseOutFk)
|
||||||
INTO vHasDistinctWarehouses
|
INTO vHasDistinctWarehouses
|
||||||
FROM travel o, travel n
|
FROM travel o, travel n
|
||||||
WHERE o.id = OLD.travelFk
|
WHERE o.id = OLD.travelFk
|
||||||
|
@ -49,9 +48,8 @@ BEGIN
|
||||||
SET NEW.currencyFk = entry_getCurrency(NEW.currencyFk, NEW.supplierFk);
|
SET NEW.currencyFk = entry_getCurrency(NEW.currencyFk, NEW.supplierFk);
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
IF NOT (NEW.travelFk <=> OLD.travelFk)
|
IF NOT (NEW.travelFk <=> OLD.travelFk) OR NOT (NEW.currencyFk <=> OLD.currencyFk) THEN
|
||||||
OR NOT (NEW.currencyFk <=> OLD.currencyFk) THEN
|
SET NEW.commission = entry_getCommission(NEW.travelFk, NEW.currencyFk, NEW.supplierFk);
|
||||||
SET NEW.commission = entry_getCommission(NEW.travelFk, NEW.currencyFk,NEW.supplierFk);
|
|
||||||
END IF;
|
END IF;
|
||||||
END$$
|
END$$
|
||||||
DELIMITER ;
|
DELIMITER ;
|
||||||
|
|
Loading…
Reference in New Issue