Merge pull request '6567-cambiar-articulos' (!1966) from 6567-cambiar-articulos into dev
gitea/salix/pipeline/head This commit looks good Details

Reviewed-on: #1966
Reviewed-by: Carlos Andrés <carlosap@verdnatura.es>
This commit is contained in:
Javi Gallego 2024-02-01 14:47:28 +00:00
commit d020086255
1 changed files with 4 additions and 10 deletions

View File

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