6567-cambiar-articulos #1966

Merged
jgallego merged 5 commits from 6567-cambiar-articulos into dev 2024-02-01 14:47:29 +00:00
1 changed files with 4 additions and 10 deletions

View File

@ -21,11 +21,8 @@ BEGIN
DECLARE vAgencyModeFk INT; DECLARE vAgencyModeFk INT;
DECLARE vNewPrice DECIMAL(10,2); DECLARE vNewPrice DECIMAL(10,2);
DECLARE vOldPrice DECIMAL(10,2); DECLARE vOldPrice DECIMAL(10,2);
DECLARE vOption INT DEFAULT NULL; DECLARE vOption VARCHAR(255);
DECLARE vNewSaleFk INT; DECLARE vNewSaleFk INT;
DECLARE vChangePrice INT DEFAULT 1;
DECLARE vBuyerDiscount INT DEFAULT 4;
DECLARE vManaDiscount INT DEFAULT 3;
DECLARE vForceToGrouping INT DEFAULT 1; DECLARE vForceToGrouping INT DEFAULT 1;
DECLARE vForceToPacking INT DEFAULT 2; DECLARE vForceToPacking INT DEFAULT 2;
DECLARE vFinalPrice DECIMAL(10,2); DECLARE vFinalPrice DECIMAL(10,2);
@ -85,16 +82,13 @@ BEGIN
IF vNewPrice IS NULL THEN IF vNewPrice IS NULL THEN
CALL util.throw('price retrieval failed'); CALL util.throw('price retrieval failed');
END IF; END IF;
IF vNewPrice > vOldPrice THEN IF vNewPrice > vOldPrice THEN
SET vFinalPrice = vOldPrice; SET vFinalPrice = vOldPrice;
IF worker_isInDepartment('vt') THEN SET vOption = 'substitution';
SET vOption = vManaDiscount;
ELSE
SET vOption = vBuyerDiscount;
END IF;
ELSE ELSE
SET vFinalPrice = vNewPrice; SET vFinalPrice = vNewPrice;
SET vOption = vChangePrice; SET vOption = 'renewPrices';
END IF; END IF;
START TRANSACTION; START TRANSACTION;