INSERT INTO tbloptions_static (name, value, autoload) VALUES('invoice_default_deposit_config', '{"is_default_deposit_configured":"0","request_deposit_is_percent":"1","request_deposit_percent":"0","request_deposit_total":"0","request_deposit_is_date_specific":"1"}', 1);
INSERT INTO tbloptions_static (name, value, autoload) VALUES('estimate_default_deposit_config', '{"is_default_deposit_configured":"0","request_deposit_is_percent":"1","request_deposit_percent":"0","request_deposit_total":"0","request_deposit_is_date_specific":"1"}', 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 in('invoice_default_deposit_config','estimate_default_deposit_config');


INSERT INTO `tblplan_features` (`name`, `codename`, `description`, `type`, `added_on`) VALUES ('Allowed Default Deposit', 'allowed_default_deposit', 'Default Deposit', 'restrict', NOW());
SET @allowed_default_deposit  = LAST_INSERT_ID();
INSERT INTO `tblplan_features_value` (`plans_id`, `plans_features_id`, `value`, `other_data`, `added_on`) VALUES ('9', @allowed_default_deposit , '0','{"outside_message":"Default Deposit is a PRO feature, In order to use it Upgrade to PRO","inside_message":"Default Deposit is a PRO feature, In order to use it Upgrade to PRO","tag_color":"#eb0e0e","tag_title":"UPGRADE","link":"https:\/\/my.contractorplus.app\/","count":"0"}', UTC_TIMESTAMP());
INSERT INTO `tblplan_features_value` (`plans_id`, `plans_features_id`, `value`, `added_on`) VALUES ('10', @allowed_default_deposit , '1', UTC_TIMESTAMP());
INSERT INTO `tblplan_features_value` (`plans_id`, `plans_features_id`, `value`, `added_on`) VALUES ('11', @allowed_default_deposit , '1', UTC_TIMESTAMP());
INSERT INTO `tblplan_features_value` (`plans_id`, `plans_features_id`, `value`, `added_on`) VALUES ('12', @allowed_default_deposit , '1', UTC_TIMESTAMP());
INSERT INTO `tblplan_features_value` (`plans_id`, `plans_features_id`, `value`, `other_data`, `added_on`) VALUES ('13', @allowed_default_deposit , '0','{"outside_message":"Default Deposit is a PRO feature, In order to use it Upgrade to PRO","inside_message":"Default Deposit is a PRO feature, In order to use it Upgrade to PRO","tag_color":"#eb0e0e","tag_title":"UPGRADE","link":"https:\/\/my.contractorplus.app\/","count":"0"}', UTC_TIMESTAMP());
INSERT INTO `tblplan_features_value` (`plans_id`, `plans_features_id`, `value`, `added_on`) VALUES ('14', @allowed_default_deposit , '1', UTC_TIMESTAMP());
INSERT INTO `tblplan_features_value` (`plans_id`, `plans_features_id`, `value`, `added_on`) VALUES ('15', @allowed_default_deposit , '1', UTC_TIMESTAMP());



UPDATE tblstaff SET refresh_permissions = 1;