SELECT @plan_feature_id := id FROM `tblplan_features` WHERE codename = 'send_sms_updates';
UPDATE tblplan_features_value SET value = 1 ,other_data = NULL WHERE plans_features_id = @plan_feature_id  AND plans_id IN (10,11,12,14,15);
UPDATE tblplan_features_value SET value = 0 ,other_data = '{"outside_message":"Sending SMS is an PRO Feature. In order to enable this, Upgrade to PRO.","inside_message":"Sending SMS is an PRO Feature. In order to enable this, Upgrade to PRO","tag_color":"#eb0e0e","tag_title":"UPGRADE","link":"https://my.contractorplus.app/","count":"0"}' 
WHERE plans_features_id = @plan_feature_id  AND plans_id IN (9,13);

INSERT INTO tblplan_features (name, codename, description,TYPE,added_on) 
VALUES('Send On My Way Text', 'send_on_my_way_text', 'Allow to Send On My Way Text','restrict',UTC_TIMESTAMP());
SET @new_plan_feature_id = LAST_INSERT_ID();
INSERT INTO tblplan_features_value (plans_id, plans_features_id, value,other_data,added_on) 
VALUES(9, @new_plan_feature_id, 0,'{"outside_message":"Send On My Way Text is an PRO Feature. In order to enable this, Upgrade to PRO.","inside_message":"Send On My Way Text is an PRO Feature. In order to enable this, Upgrade to PRO","tag_color":"#eb0e0e","tag_title":"UPGRADE","link":"https://my.contractorplus.app/","count":"0"}',UTC_TIMESTAMP()),
(10, @new_plan_feature_id, 1,NULL,UTC_TIMESTAMP()),
(11, @new_plan_feature_id, 1,NULL,UTC_TIMESTAMP()),
(12, @new_plan_feature_id, 1,NULL,UTC_TIMESTAMP()),
(13, @new_plan_feature_id, 0,'{"outside_message":"Send On My Way Text is an PRO Feature. In order to enable this, Upgrade to PRO.","inside_message":"Send On My Way Text is an PRO Feature. In order to enable this, Upgrade to PRO","tag_color":"#eb0e0e","tag_title":"UPGRADE","link":"https://my.contractorplus.app/","count":"0"}',UTC_TIMESTAMP()),
(14, @new_plan_feature_id, 1,NULL,UTC_TIMESTAMP()),
(15, @new_plan_feature_id, 1,NULL,UTC_TIMESTAMP());

INSERT INTO `tblapad_options`
  VALUES (NULL, 'send_on_my_way_text_sms', 'send_on_my_way_text', 'Hello, this is {company_name}. We will arrive approximately in {time}. If you have any questions please call {staff_name} {staff_phone_number}. Do not respond, this number cannot receive replies.', 1),
  (NULL, 'send_on_my_way_text_sms', 'send_on_my_way_text_late', 'Hello, this is {company_name}. We will be late by {time}. If you have any questions please call {staff_name} {staff_phone_number}. Do not respond, this number cannot receive replies.', 1);

UPDATE tblstaff SET refresh_permissions = 1;