7167-testToMaster_2414 #2244

Merged
alexm merged 643 commits from 7167-testToMaster_2414 into master 2024-04-04 05:32:41 +00:00
14 changed files with 24 additions and 20 deletions
Showing only changes of commit f1931fce69 - Show all commits

View File

@ -1,5 +0,0 @@
DELETE FROM salix.ACL
WHERE model = 'MailAliasAccount'
AND property = 'canEditAlias'
AND principalType = 'ROLE'
AND principalId = 'marketingBoss';

View File

@ -32,7 +32,7 @@ BEGIN
WHERE c.available > 0 WHERE c.available > 0
GROUP BY c.item_id; GROUP BY c.item_id;
CALL vn.catalog_calculate(vDelivery, vAddress, vAgencyMode); CALL vn.catalog_calculate(vDelivery, vAddress, vAgencyMode, FALSE);
DROP TEMPORARY TABLE tmp.item; DROP TEMPORARY TABLE tmp.item;
END$$ END$$

View File

@ -16,7 +16,7 @@ BEGIN
ENGINE = MEMORY ENGINE = MEMORY
SELECT vSelf itemFk; SELECT vSelf itemFk;
CALL vn.catalog_calculate(vLanded, vAddressFk, vAgencyModeFk); CALL vn.catalog_calculate(vLanded, vAddressFk, vAgencyModeFk, FALSE);
SELECT l.warehouseFk, w.name warehouse, SELECT l.warehouseFk, w.name warehouse,
p.`grouping`, p.price, p.rate, l.available p.`grouping`, p.price, p.rate, l.available

View File

@ -27,7 +27,7 @@ BEGIN
WHERE orderFk = vSelf WHERE orderFk = vSelf
GROUP BY itemFk; GROUP BY itemFk;
CALL vn.catalog_calculate(vDate, vAddress, vAgencyMode); CALL vn.catalog_calculate(vDate, vAddress, vAgencyMode, FALSE);
DROP TEMPORARY TABLE tmp.item; DROP TEMPORARY TABLE tmp.item;
END$$ END$$

View File

@ -22,7 +22,7 @@ BEGIN
FROM `order` FROM `order`
WHERE id = vSelf; WHERE id = vSelf;
CALL vn.catalog_calculate(vDate, vAddress, vAgencyMode); CALL vn.catalog_calculate(vDate, vAddress, vAgencyMode, FALSE);
IF account.myUser_getName() = 'visitor' THEN IF account.myUser_getName() = 'visitor' THEN
UPDATE tmp.ticketCalculateItem UPDATE tmp.ticketCalculateItem

View File

@ -20,6 +20,7 @@ BEGIN
CALL vn.addressTaxArea(); CALL vn.addressTaxArea();
SELECT areaFk INTO vTaxArea FROM tmp.addressTaxArea; SELECT areaFk INTO vTaxArea FROM tmp.addressTaxArea;
DROP TEMPORARY TABLE DROP TEMPORARY TABLE
tmp.addressCompany, tmp.addressCompany,
tmp.addressTaxArea; tmp.addressTaxArea;

View File

@ -20,7 +20,7 @@ BEGIN
ENGINE = MEMORY ENGINE = MEMORY
SELECT vItemFk itemFk; SELECT vItemFk itemFk;
CALL catalog_calculate(vLanded, vAddressFk, vAgencyModeFk); CALL catalog_calculate(vLanded, vAddressFk, vAgencyModeFk, TRUE);
DROP TEMPORARY TABLE tmp.item; DROP TEMPORARY TABLE tmp.item;
END$$ END$$
DELIMITER ; DELIMITER ;

View File

@ -1,5 +1,9 @@
DELIMITER $$ DELIMITER $$
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`catalog_calculate`(vLanded DATE, vAddressFk INT, vAgencyModeFk INT) CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`catalog_calculate`(
vLanded DATE,
vAddressFk INT,
vAgencyModeFk INT,
vShowExpiredZones BOOLEAN)
BEGIN BEGIN
/** /**
* Calcula los articulos disponibles y sus precios * Calcula los articulos disponibles y sus precios
@ -25,7 +29,7 @@ BEGIN
DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE; DECLARE CONTINUE HANDLER FOR NOT FOUND SET vDone = TRUE;
CALL vn.zone_getShipped (vLanded, vAddressFk, vAgencyModeFk, FALSE); CALL vn.zone_getShipped (vLanded, vAddressFk, vAgencyModeFk, vShowExpiredZones);
DROP TEMPORARY TABLE IF EXISTS tmp.ticketLot; DROP TEMPORARY TABLE IF EXISTS tmp.ticketLot;
CREATE TEMPORARY TABLE tmp.ticketLot( CREATE TEMPORARY TABLE tmp.ticketLot(

View File

@ -77,7 +77,9 @@ BEGIN
vNewItemFk); vNewItemFk);
SELECT price INTO vNewPrice SELECT price INTO vNewPrice
FROM tmp.ticketCalculateItem; FROM tmp.ticketComponentPrice
ORDER BY (vQuantity % `grouping`) ASC
LIMIT 1;
IF vNewPrice IS NULL THEN IF vNewPrice IS NULL THEN
CALL util.throw('price retrieval failed'); CALL util.throw('price retrieval failed');

View File

@ -11,7 +11,7 @@ BEGIN
SELECT id itemFk FROM vn.item SELECT id itemFk FROM vn.item
WHERE typeFk = vTypeFk; WHERE typeFk = vTypeFk;
CALL catalog_calculate(vLanded, vAddressFk, vAgencyModeFk); CALL catalog_calculate(vLanded, vAddressFk, vAgencyModeFk, FALSE);
DROP TEMPORARY TABLE tmp.item; DROP TEMPORARY TABLE tmp.item;
DROP TEMPORARY TABLE tmp.ticketLot; DROP TEMPORARY TABLE tmp.ticketLot;
END$$ END$$

View File

@ -23,9 +23,5 @@ BEGIN
CALL buy_checkItem(); CALL buy_checkItem();
END IF; END IF;
END IF; END IF;
IF (NOT(NEW.awbFk <=> OLD.awbFk)) AND NEW.awbFk IS NOT NULL AND NOT travel_hasUniqueAwb(NEW.id) THEN
CALL util.throw('The AWB is incorrect, there is a different AWB in the associated entries');
END IF;
END$$ END$$
DELIMITER ; DELIMITER ;

View File

@ -32,5 +32,9 @@ BEGIN
CALL util.throw('The travel has entries with booked invoices'); CALL util.throw('The travel has entries with booked invoices');
END IF; END IF;
END IF; END IF;
IF (NOT(NEW.awbFk <=> OLD.awbFk)) AND NEW.awbFk IS NOT NULL AND NOT travel_hasUniqueAwb(NEW.id) THEN
CALL util.throw('The AWB is incorrect, there is a different AWB in the associated entries');
END IF;
END$$ END$$
DELIMITER ; DELIMITER ;

View File

@ -92,10 +92,11 @@ module.exports = Self => {
// Calculate items // Calculate items
const order = await Self.findById(orderFk, null, myOptions); const order = await Self.findById(orderFk, null, myOptions);
stmts.push(new ParameterizedSQL( stmts.push(new ParameterizedSQL(
'CALL vn.catalog_calculate(?, ?, ?)', [ 'CALL vn.catalog_calculate(?, ?, ?, ?)', [
order.landed, order.landed,
order.address_id, order.address_id,
order.agency_id, order.agency_id,
false
] ]
)); ));

View File

@ -64,10 +64,11 @@ module.exports = Self => {
stmts.push(stmt); stmts.push(stmt);
stmt = new ParameterizedSQL( stmt = new ParameterizedSQL(
'CALL vn.catalog_calculate(?, ?, ?)', [ 'CALL vn.catalog_calculate(?, ?, ?,?)', [
order.landed, order.landed,
order.addressFk, order.addressFk,
order.agencyModeFk, order.agencyModeFk,
false
] ]
); );
stmts.push(stmt); stmts.push(stmt);