feat: comprobaciones facturas contabilizadas refs #6932
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
e54d2d1162
commit
bed4faceb7
|
@ -47,5 +47,19 @@ BEGIN
|
||||||
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;
|
||||||
|
|
||||||
|
IF NOT (NEW.invoiceInFk <=> OLD.invoiceInFk)THEN
|
||||||
|
DECLARE vHanAnyInvoiceBooked BOOL;
|
||||||
|
|
||||||
|
SELECT COUNT(*) INTO vHanAnyInvoiceBooked
|
||||||
|
FROM entry e
|
||||||
|
JOIN invoiceIn ii ON ii.id = e.invoiceInFk
|
||||||
|
WHERE e.id = NEW.id
|
||||||
|
AND ii.isBooked;
|
||||||
|
|
||||||
|
IF vHanAnyInvoiceBooked THEN
|
||||||
|
CALL util.throw('The travel has entries with booked invoices')
|
||||||
|
END IF;
|
||||||
|
END IF;
|
||||||
END$$
|
END$$
|
||||||
DELIMITER ;
|
DELIMITER ;
|
||||||
|
|
|
@ -17,5 +17,20 @@ BEGIN
|
||||||
IF NOT (NEW.warehouseInFk <=> OLD.warehouseInFk) THEN
|
IF NOT (NEW.warehouseInFk <=> OLD.warehouseInFk) THEN
|
||||||
CALL travel_checkWarehouseIsFeedStock(NEW.warehouseInFk);
|
CALL travel_checkWarehouseIsFeedStock(NEW.warehouseInFk);
|
||||||
END IF;
|
END IF;
|
||||||
|
|
||||||
|
IF NOT (NEW.awbFk <=> OLD.awbFk)THEN
|
||||||
|
DECLARE vHanAnyInvoiceBooked BOOL;
|
||||||
|
|
||||||
|
SELECT COUNT(*) INTO vHanAnyInvoiceBooked
|
||||||
|
FROM travel t
|
||||||
|
JOIN entry e ON e.travelFk =t.id
|
||||||
|
JOIN invoiceIn ii ON ii.id = e.invoiceInFk
|
||||||
|
WHERE t.id = NEW.id
|
||||||
|
AND ii.isBooked;
|
||||||
|
|
||||||
|
IF vHanAnyInvoiceBooked THEN
|
||||||
|
CALL util.throw('The travel has entries with booked invoices')
|
||||||
|
END IF;
|
||||||
|
END IF;
|
||||||
END$$
|
END$$
|
||||||
DELIMITER ;
|
DELIMITER ;
|
||||||
|
|
Loading…
Reference in New Issue