refs #6915 test_master24_8 #2067
|
@ -23,9 +23,6 @@ BEGIN
|
|||
DECLARE vOldPrice DECIMAL(10,2);
|
||||
DECLARE vOption INT DEFAULT NULL;
|
||||
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;
|
||||
|
|
|
@ -1,14 +1,5 @@
|
|||
CREATE OR REPLACE DEFINER=`root`@`localhost` PROCEDURE `vn`.`sale_replaceItem`() BEGIN END;
|
||||
GRANT EXECUTE ON PROCEDURE `vn`.`sale_replaceItem` TO `employee`;
|
||||
|
||||
DELIMITER $$
|
||||
CREATE OR REPLACE DEFINER=`root`@`localhost` FUNCTION `vn`.`worker_isInDepartment`()
|
||||
RETURNS int(11)
|
||||
DETERMINISTIC
|
||||
BEGIN
|
||||
RETURN 1;
|
||||
END$$
|
||||
DELIMITER ;
|
||||
GRANT EXECUTE ON PROCEDURE `vn`.`sale_replaceItem` TO `employee`;
|
||||
|
||||
GRANT EXECUTE ON FUNCTION `vn`.`worker_isInDepartment` TO `employee`;
|
||||
FLUSH PRIVILEGES;
|
||||
|
|
|
@ -0,0 +1,2 @@
|
|||
INSERT IGNORE INTO vn.component (id, name, typeFk, classRate, tax, isRenewable, code, isRequired)
|
||||
VALUES(49, 'sustitución', 4, NULL, NULL, 1, 'substitution', FALSE);
|
Loading…
Reference in New Issue