Compare commits
5 Commits
be863c1269
...
ad16eddf6b
Author | SHA1 | Date |
---|---|---|
Robert Ferrús | ad16eddf6b | |
Robert Ferrús | c3e3d72182 | |
Robert Ferrús | 8e2770aa56 | |
Robert Ferrús | 3e2e0ccadb | |
Robert Ferrús | dd977fab83 |
|
@ -32,7 +32,7 @@ BEGIN
|
|||
WHERE c.available > 0
|
||||
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;
|
||||
END$$
|
||||
|
|
|
@ -16,7 +16,7 @@ BEGIN
|
|||
ENGINE = MEMORY
|
||||
SELECT vSelf itemFk;
|
||||
|
||||
CALL vn.catalog_calculate(vLanded, vAddressFk, vAgencyModeFk);
|
||||
CALL vn.catalog_calculate(vLanded, vAddressFk, vAgencyModeFk, FALSE);
|
||||
|
||||
SELECT l.warehouseFk, w.name warehouse,
|
||||
p.`grouping`, p.price, p.rate, l.available
|
||||
|
|
|
@ -27,7 +27,7 @@ BEGIN
|
|||
WHERE orderFk = vSelf
|
||||
GROUP BY itemFk;
|
||||
|
||||
CALL vn.catalog_calculate(vDate, vAddress, vAgencyMode);
|
||||
CALL vn.catalog_calculate(vDate, vAddress, vAgencyMode, FALSE);
|
||||
|
||||
DROP TEMPORARY TABLE tmp.item;
|
||||
END$$
|
||||
|
|
|
@ -22,7 +22,7 @@ BEGIN
|
|||
FROM `order`
|
||||
WHERE id = vSelf;
|
||||
|
||||
CALL vn.catalog_calculate(vDate, vAddress, vAgencyMode);
|
||||
CALL vn.catalog_calculate(vDate, vAddress, vAgencyMode, FALSE);
|
||||
|
||||
IF account.myUser_getName() = 'visitor' THEN
|
||||
UPDATE tmp.ticketCalculateItem
|
||||
|
|
|
@ -20,7 +20,7 @@ BEGIN
|
|||
ENGINE = MEMORY
|
||||
SELECT vItemFk itemFk;
|
||||
|
||||
CALL catalog_calculate(vLanded, vAddressFk, vAgencyModeFk);
|
||||
CALL catalog_calculate(vLanded, vAddressFk, vAgencyModeFk, TRUE);
|
||||
DROP TEMPORARY TABLE tmp.item;
|
||||
END$$
|
||||
DELIMITER ;
|
||||
|
|
|
@ -1,5 +1,9 @@
|
|||
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
|
||||
/**
|
||||
* Calcula los articulos disponibles y sus precios
|
||||
|
@ -25,7 +29,7 @@ BEGIN
|
|||
|
||||
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;
|
||||
CREATE TEMPORARY TABLE tmp.ticketLot(
|
||||
|
|
|
@ -77,7 +77,9 @@ BEGIN
|
|||
vNewItemFk);
|
||||
|
||||
SELECT price INTO vNewPrice
|
||||
FROM tmp.ticketCalculateItem;
|
||||
FROM tmp.ticketComponentPrice
|
||||
ORDER BY (vQuantity % `grouping`) ASC
|
||||
LIMIT 1;
|
||||
|
||||
IF vNewPrice IS NULL THEN
|
||||
CALL util.throw('price retrieval failed');
|
||||
|
|
|
@ -11,7 +11,7 @@ BEGIN
|
|||
SELECT id itemFk FROM vn.item
|
||||
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.ticketLot;
|
||||
END$$
|
||||
|
|
|
@ -92,10 +92,11 @@ module.exports = Self => {
|
|||
// Calculate items
|
||||
const order = await Self.findById(orderFk, null, myOptions);
|
||||
stmts.push(new ParameterizedSQL(
|
||||
'CALL vn.catalog_calculate(?, ?, ?)', [
|
||||
'CALL vn.catalog_calculate(?, ?, ?, ?)', [
|
||||
order.landed,
|
||||
order.address_id,
|
||||
order.agency_id,
|
||||
false
|
||||
]
|
||||
));
|
||||
|
||||
|
|
|
@ -64,10 +64,11 @@ module.exports = Self => {
|
|||
stmts.push(stmt);
|
||||
|
||||
stmt = new ParameterizedSQL(
|
||||
'CALL vn.catalog_calculate(?, ?, ?)', [
|
||||
'CALL vn.catalog_calculate(?, ?, ?,?)', [
|
||||
order.landed,
|
||||
order.addressFk,
|
||||
order.agencyModeFk,
|
||||
false
|
||||
]
|
||||
);
|
||||
stmts.push(stmt);
|
||||
|
|
Loading…
Reference in New Issue