INSERT INTO `tbloptions_static` (`name`, `value`,`autoload`) VALUES ('modify_gratuity_settings', '0',1);

INSERT INTO tbloptions (tenant_id, name,value,autoload )
SELECT t.id,s.name,s.value,s.autoload
FROM tbltenants t
JOIN tbloptions_static s ON 1 = 1 AND s.name ='modify_gratuity_settings';

INSERT INTO `tblplan_features` (`name`, `codename`, `description`, `type`, `added_on`) VALUES ('Give Customer to Add Tip', 'modify_gratuity_settings', 'Give Customer to Add Tip', 'restrict', NOW());
SET @modify_gratuity_settings = LAST_INSERT_ID();
INSERT INTO `tblplan_features_value` (`plans_id`, `plans_features_id`, `value`, `added_on`) VALUES ('9', @modify_gratuity_settings, '0', UTC_TIMESTAMP());
INSERT INTO `tblplan_features_value` (`plans_id`, `plans_features_id`, `value`, `added_on`) VALUES ('10', @modify_gratuity_settings, '1', UTC_TIMESTAMP());
INSERT INTO `tblplan_features_value` (`plans_id`, `plans_features_id`, `value`, `added_on`) VALUES ('11', @modify_gratuity_settings, '1', UTC_TIMESTAMP());
INSERT INTO `tblplan_features_value` (`plans_id`, `plans_features_id`, `value`, `added_on`) VALUES ('12', @modify_gratuity_settings, '1', UTC_TIMESTAMP());
INSERT INTO `tblplan_features_value` (`plans_id`, `plans_features_id`, `value`, `added_on`) VALUES ('13', @modify_gratuity_settings, '0', UTC_TIMESTAMP());
INSERT INTO `tblplan_features_value` (`plans_id`, `plans_features_id`, `value`, `added_on`) VALUES ('14', @modify_gratuity_settings, '1', UTC_TIMESTAMP());
INSERT INTO `tblplan_features_value` (`plans_id`, `plans_features_id`, `value`, `added_on`) VALUES ('15', @modify_gratuity_settings, '1', UTC_TIMESTAMP());

UPDATE tblstaff SET refresh_permissions = 1;