DROP PROCEDURE IF EXISTS `CALCPOINT`;
delimiter ;;
CREATE PROCEDURE `CALCPOINT`()
BEGIN
	DECLARE
		MPOINTRATE DECIMAL ( 10, 2 );
	SELECT 
	VALUE
		/ 100 INTO MPOINTRATE 
	FROM
		AR_CONFIG 
	WHERE
		CONFIG_NAME = 'bsNoPvPointsPercent';
	UPDATE AR_BS_BONUS_103_CALC 
	SET PRODUCT_POINT = PV * MPOINTRATE 
	WHERE
		USER_TYPE10 = 0 
		AND USER_TYPE = 0 
		AND PV > 0;

END
;;