7773-testToMaster_2430 #2774
|
@ -0,0 +1,12 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `account`.`mailAliasAccount_afterDelete`
|
||||
AFTER DELETE ON `mailAliasAccount`
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
INSERT INTO userLog
|
||||
SET `action` = 'delete',
|
||||
`changedModel` = 'MailAliasAccount',
|
||||
`changedModelId` = OLD.id,
|
||||
`userFk` = account.myUser_getId();
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -0,0 +1,8 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `account`.`mailAliasAccount_beforeInsert`
|
||||
BEFORE INSERT ON `mailAliasAccount`
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
SET NEW.editorFk = account.myUser_getId();
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -0,0 +1,8 @@
|
|||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` TRIGGER `account`.`mailAliasAccount_beforeUpdate`
|
||||
BEFORE UPDATE ON `mailAliasAccount`
|
||||
FOR EACH ROW
|
||||
BEGIN
|
||||
SET NEW.editorFk = account.myUser_getId();
|
||||
END$$
|
||||
DELIMITER ;
|
|
@ -117,7 +117,7 @@ proc: BEGIN
|
|||
)sub
|
||||
GROUP BY sub.itemFk;
|
||||
|
||||
DROP TEMPORARY TABLE tmp.itemCalc, tItemRange;
|
||||
DROP TEMPORARY TABLE tmp.itemCalc, tItemRange, tmp.itemList;
|
||||
CALL cache_calc_end (vCalc);
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
|
@ -121,7 +121,7 @@ proc: BEGIN
|
|||
)sub
|
||||
GROUP BY sub.itemFk;
|
||||
|
||||
DROP TEMPORARY TABLE tmp.itemCalc, itemRange;
|
||||
DROP TEMPORARY TABLE tmp.itemCalc, itemRange, tmp.itemList;
|
||||
CALL cache_calc_end (vCalc);
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
|
@ -30,6 +30,7 @@ BEGIN
|
|||
tmp.ticketComponentPrice,
|
||||
tmp.ticketComponent,
|
||||
tmp.ticketLot,
|
||||
tmp.zoneGetShipped;
|
||||
tmp.zoneGetShipped,
|
||||
tmp.item;
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
|
@ -6,19 +6,6 @@ BEGIN
|
|||
* identificando y notificando los asientos descuadrados
|
||||
* y ajustando los saldos en caso necesario.
|
||||
*/
|
||||
INSERT INTO mail (receiver, subject, body)
|
||||
SELECT 'cau@verdnatura.es',
|
||||
'Asientos descuadrados',
|
||||
GROUP_CONCAT(CONCAT(' Asiento: ', ASIEN, ' - Importe:', recon) SEPARATOR ' | \n')
|
||||
FROM (
|
||||
SELECT ASIEN,
|
||||
SUM(IFNULL(ROUND(Eurodebe, 2), 0)) - SUM(IFNULL(ROUND(EUROHABER, 2), 0)) recon
|
||||
FROM XDiario
|
||||
WHERE NOT enlazado
|
||||
GROUP BY ASIEN
|
||||
HAVING ABS(SUM(IFNULL(ROUND(Eurodebe, 2), 0)) - SUM(IFNULL(ROUND(EUROHABER, 2), 0))) > 0.01
|
||||
) sub
|
||||
HAVING COUNT(*);
|
||||
|
||||
UPDATE XDiario xd
|
||||
JOIN (
|
||||
|
|
|
@ -16,9 +16,9 @@ BEGIN
|
|||
|
||||
SET @order = 0;
|
||||
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp.newSaleList;
|
||||
DROP TEMPORARY TABLE IF EXISTS tNewSaleList;
|
||||
|
||||
CREATE TEMPORARY TABLE tmp.newSaleList
|
||||
CREATE TEMPORARY TABLE tNewSaleList
|
||||
SELECT id as saleFk, @order := @order + 1 as orden
|
||||
FROM vn.sale
|
||||
WHERE ticketFk = vTargetTicketFk
|
||||
|
@ -28,7 +28,8 @@ BEGIN
|
|||
SELECT ns.saleFk, sc.componentFk, sc.value
|
||||
FROM vn.saleComponent sc
|
||||
JOIN tmp.saleList s ON s.saleFk = sc.saleFk
|
||||
JOIN tmp.newSaleList ns ON ns.orden = s.orden;
|
||||
JOIN tNewSaleList ns ON ns.orden = s.orden;
|
||||
|
||||
DROP TEMPORARY TABLE tNewSaleList;
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
|
@ -8,7 +8,6 @@ BEGIN
|
|||
*/
|
||||
DECLARE vTaxRowLimit INT;
|
||||
DECLARE vLines INT;
|
||||
DECLARE vHasDistinctTransactions INT;
|
||||
|
||||
SELECT taxRowLimit INTO vTaxRowLimit FROM invoiceInConfig;
|
||||
|
||||
|
@ -20,17 +19,5 @@ BEGIN
|
|||
IF vLines >= vTaxRowLimit THEN
|
||||
CALL util.throw (CONCAT('The maximum number of lines is ', vTaxRowLimit));
|
||||
END IF;
|
||||
|
||||
SELECT COUNT(DISTINCT transactionTypeSageFk) INTO vHasDistinctTransactions
|
||||
FROM invoiceIn ii
|
||||
JOIN invoiceInTax iit ON iit.invoiceInFk = ii.id
|
||||
JOIN invoiceInSerial iis ON iis.code = ii.serial
|
||||
WHERE ii.id = vInvoiceInFk
|
||||
AND iis.taxAreaFk = 'CEE'
|
||||
AND transactionTypeSageFk;
|
||||
|
||||
IF vHasDistinctTransactions > 1 THEN
|
||||
CALL util.throw ('This invoice does not allow different types of transactions');
|
||||
END IF;
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
|
@ -13,6 +13,19 @@ BEGIN
|
|||
* @param vBookEntry Id de asiento, si es NULL se genera uno nuevo
|
||||
*/
|
||||
DECLARE vFiscalYear INT;
|
||||
DECLARE vHasDistinctTransactions INT;
|
||||
|
||||
SELECT COUNT(DISTINCT transactionTypeSageFk) INTO vHasDistinctTransactions
|
||||
FROM invoiceIn ii
|
||||
JOIN invoiceInTax iit ON iit.invoiceInFk = ii.id
|
||||
JOIN invoiceInSerial iis ON iis.code = ii.serial
|
||||
WHERE ii.id = vSelf
|
||||
AND iis.taxAreaFk = 'CEE'
|
||||
AND transactionTypeSageFk;
|
||||
|
||||
IF vHasDistinctTransactions > 1 THEN
|
||||
CALL util.throw ('This invoice does not allow different types of transactions');
|
||||
END IF;
|
||||
|
||||
CREATE OR REPLACE TEMPORARY TABLE tInvoiceIn
|
||||
ENGINE = MEMORY
|
||||
|
|
|
@ -59,5 +59,7 @@ BEGIN
|
|||
WHERE p.pickingOrder BETWEEN vPickingOrderFrom AND vPickingOrderTo
|
||||
AND p.sectorFk = vSectorFk
|
||||
ORDER BY p.pickingOrder;
|
||||
|
||||
DROP TEMPORARY TABLE tmp.stockMisfit;
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
|
@ -76,5 +76,7 @@ BEGIN
|
|||
i.quantity amount
|
||||
FROM tmp.itemAtp i
|
||||
HAVING amount != 0;
|
||||
|
||||
DROP TEMPORARY TABLE tmp.itemAtp;
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
|
@ -104,5 +104,6 @@ BEGIN
|
|||
) sub;
|
||||
DROP TEMPORARY TABLE tmp.whiteTicket;
|
||||
DROP TEMPORARY TABLE tmp.sectorTypeTicket;
|
||||
DROP TEMPORARY TABLE tmp.productionBuffer;
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
|
@ -3,14 +3,14 @@ CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`ticket_DelayTruck`(
|
|||
BEGIN
|
||||
DECLARE done INT DEFAULT FALSE;
|
||||
DECLARE vTicketFk INT;
|
||||
DECLARE cur1 CURSOR FOR SELECT ticketFk FROM tmp.ticket;
|
||||
DECLARE cur1 CURSOR FOR SELECT ticketFk FROM tTicket;
|
||||
|
||||
DECLARE CONTINUE HANDLER FOR NOT FOUND SET done = TRUE;
|
||||
|
||||
CALL vn.productionControl(vWarehouserFk,0) ;
|
||||
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp.ticket;
|
||||
CREATE TEMPORARY TABLE tmp.ticket
|
||||
DROP TEMPORARY TABLE IF EXISTS tTicket;
|
||||
CREATE TEMPORARY TABLE tTicket
|
||||
SELECT ticketFk
|
||||
FROM tmp.productionBuffer
|
||||
JOIN alertLevel al ON al.code = 'FREE'
|
||||
|
@ -31,5 +31,6 @@ BEGIN
|
|||
END LOOP;
|
||||
|
||||
CLOSE cur1;
|
||||
DROP TEMPORARY TABLE tTicket, tmp.productionBuffer;
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
|
@ -65,6 +65,8 @@ BEGIN
|
|||
IF (vZoneFk IS NULL OR vZoneFk = 0) AND vIsRequiredZone THEN
|
||||
CALL util.throw ('NOT_ZONE_WITH_THIS_PARAMETERS');
|
||||
END IF;
|
||||
|
||||
DROP TEMPORARY TABLE tmp.zoneGetShipped;
|
||||
END IF;
|
||||
|
||||
INSERT INTO ticket (
|
||||
|
|
|
@ -213,6 +213,6 @@ BEGIN
|
|||
END;
|
||||
END LOOP;
|
||||
CLOSE rsTicket;
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp.time;
|
||||
DROP TEMPORARY TABLE IF EXISTS tmp.time, tmp.zoneGetLanded;
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
|
@ -103,6 +103,7 @@ BEGIN
|
|||
DROP TEMPORARY TABLE
|
||||
geoCollision,
|
||||
tmp.zone,
|
||||
tmp.zoneNodes;
|
||||
tmp.zoneNodes,
|
||||
tmp.zoneOption;
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
|
@ -0,0 +1,4 @@
|
|||
ALTER TABLE account.mailAliasAccount
|
||||
ADD editorFk INT(10) UNSIGNED DEFAULT NULL,
|
||||
ADD CONSTRAINT mailAliasAccount_editorFk FOREIGN KEY (editorFk)
|
||||
REFERENCES account.`user`(id);
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"name": "salix-back",
|
||||
"version": "24.28.0",
|
||||
"version": "24.30.0",
|
||||
"author": "Verdnatura Levante SL",
|
||||
"description": "Salix backend",
|
||||
"license": "GPL-3.0",
|
||||
|
|
Loading…
Reference in New Issue