
SET @companyId = 2;
SET @applicationDate = 20220801;
SET @prevDate = 20220731;

-- Setting master values in variables for downstream usage
SELECT @textAnswerTypeId := id FROM AnswerTypeMaster WHERE name = 'Text';
SELECT @yesNoAnswerTypeId := id FROM AnswerTypeMaster WHERE name = 'Yes/No';
SELECT @listSingleAnswerTypeId := id FROM AnswerTypeMaster WHERE name = 'List - Single Select';
SELECT @listMultipleAnswerTypeId := id FROM AnswerTypeMaster WHERE name = 'List - Multiple Select';
-- 
-- 
--
-- Master table values for User
--
DELETE FROM User;
INSERT INTO User(id, company_id, username, password, name, create_time, last_visit, user_level,is_approved) VALUES
(1, @companyId,  'superuser', '0baea2f0ae20150db78f58cddac442a9', 'SuperUser', UNIX_TIMESTAMP(NOW()), 0, 8,1),
(2, @companyId, 'admin', '21232f297a57a5a743894a0e4a801fc3', 'Administrator', UNIX_TIMESTAMP(NOW()), 0, 6,1),
(3, @companyId,  'migration-user', '0baea2f0ae20150db78f58cddac442a9', 'Migration User', UNIX_TIMESTAMP(NOW()), 0, 9,1),
(4, @companyId,  'system-user', '0baea2f0ae20150db78f58cddac442a9', 'System User', UNIX_TIMESTAMP(NOW()), 0, 9,1);

-- Setting master values in variables for downstream usage
SELECT @superUserId := id FROM User WHERE username = 'superuser';
SELECT @adminUserId := id FROM User WHERE username = 'admin';
SELECT @migrationUserId := id FROM User WHERE username = 'migration-user';
SELECT @systemUserId := id FROM User WHERE username = 'system-user';

-- Setting master values in variables for downstream usage
SELECT @activeStatusId := id FROM StatusMaster WHERE name = 'Active';
SELECT @inactiveStatusId := id FROM StatusMaster WHERE name = 'Inactive';

--
-- Master table values for UserStatus
--
DELETE FROM UserStatus;
INSERT INTO UserStatus(user_id, effective_date, status) VALUES
(@superUserId, '2010-08-01', @activeStatusId),
(@adminUserId, '2010-08-01', @activeStatusId),
(@migrationUserId, '2010-08-01', @activeStatusId),
(@systemUserId, '2010-08-01', @activeStatusId);
--
-- Master table values for AppSetting
--
DELETE FROM AppSetting;
INSERT INTO AppSetting(company_id, category, name, description, value_type_id, value, module) VALUES
(@companyId, 'Application Wide', 'Set Center Code Automatically', '', @yesNoAnswerTypeId, 'No', 'Loan Origination'),
(@companyId, 'Application Wide', 'Set Group Code Automatically', '', @yesNoAnswerTypeId, 'No', 'Loan Origination'),
(@companyId, 'Application Wide', 'Allow Loan Bulk Approval', '', @yesNoAnswerTypeId, 'Yes', 'Loan Approvals'),
(@companyId, 'Application Wide', 'Allow Multiple Logins For Single User', '', @yesNoAnswerTypeId, 'Yes', 'Admin'),
(@companyId, 'Application Wide', 'Set Attendance During Bulk Payments', '', @yesNoAnswerTypeId, 'Yes','Loan Collections'),
(@companyId, 'Application Wide', 'Set Paid By Data During Bulk Payments', '', @yesNoAnswerTypeId, 'Yes','Loan Collections'),
(@companyId, 'Application Wide', 'Enroll Customer During Center Formation', '', @yesNoAnswerTypeId, 'No', 'Customer'),
(@companyId, 'Application Wide', 'Require Loan Pipeline Sanction For Loan Approval', 'Applicable for group loans only. Set this to yes if a pipeline should be explicitly sanctioned prior to approval of any loan in that center.', @yesNoAnswerTypeId, 'No', 'Loan Pipeline'),
(@companyId, 'Application Wide', 'Disable Single Loan Foreclose','Disabling single loan Foreclose and allowing only bulk loan foreclose', @yesNoAnswerTypeId, 'No', 'Loan Collections'),
(@companyId, 'Application Wide', 'Update First Repay Date Before Center Disbursement','When center-wise bulk disbursement is being done, the user will first be taken to a screen to update the first repayment date for all loans in the center and then to the bulk disbursement screen', @yesNoAnswerTypeId, 'No','Loan Disbursements'),
(@companyId, 'Application Wide', 'Pay Fee and Insurance Before Bulk Disbursement','Force the user to pay fee and insurance before bulk disbursement', @yesNoAnswerTypeId, 'No', 'Loan Disbursements'),
(@companyId, 'Application Wide', 'Center Seating Order Mandatory', '', @yesNoAnswerTypeId, 'No', 'Loan Collections'),
(@companyId, 'Application Wide', 'Disallow Loan Approval For Negative Household Savings', '', @yesNoAnswerTypeId, 'No', 'Loan Approvals'),
(@companyId, 'Application Wide', 'Disallow Customer With Insufficient Savings For Installment Payment', '', @yesNoAnswerTypeId, 'No', 'Loan Approvals'),
(@companyId, 'Application Wide', 'Set Pipeline Status Automatically','Set pipeline status during center sanction and center wise disbursements', @yesNoAnswerTypeId, 'No', 'Loan Pipeline'),
(@companyId, 'Application Wide', 'Schedule Disbursement For Current Date', 'Schedule Disbursement For Current Date', @yesNoAnswerTypeId, 'No', 'Loan Disbursements'),
(@companyId, 'Application Wide', 'Allow Female Customer Only', '', @yesNoAnswerTypeId, 'No', 'Customer'),
(@companyId, 'Application Wide', 'Disallow customer with negative savings', '', @yesNoAnswerTypeId, 'No', 'Customer'),
(@companyId, 'Application Wide', 'Allow New Area Creation During Enrollment', 'If areas are not being mapped to office, you can allow new areas to be added during customer enrollment process', @yesNoAnswerTypeId, 'No', 'Customer'),
(@companyId, 'Application Wide', 'Specify Customer Number Manually', 'If set to "No" system will automatically generate a random customer number or as per pre-defined format', @yesNoAnswerTypeId, 'No', 'Customer'),
(@companyId, 'Application Wide', 'Set Center Name Automatically', '', @yesNoAnswerTypeId, 'No', 'Loan Origination'),
(@companyId, 'Application Wide', 'Account Fees and Service Tax Separately', 'Account Fees and Service Tax Separately', @yesNoAnswerTypeId, 'No', 'Finance & Accounting'),
(@companyId, 'Application Wide', 'Area Prefixes To Ignore For Center Name Construction', '', @listMultipleAnswerTypeId, '', 'Loan Origination'),
(@companyId, 'Application Wide', 'Allowed Email Domains For User And Employee', '', @listMultipleAnswerTypeId, '', 'Admin'),
(@companyId, 'Application Wide', 'De-duplication Across Customer Identity and Address Proofs', '', @yesNoAnswerTypeId, 'Yes', 'Customer'),
(@companyId, 'Application Wide', 'Set Sales Officer For A Center', '', @yesNoAnswerTypeId, 'No', 'Loan Origination'),
(@companyId, 'Application Wide', 'Allow Transactions after EOD Checklist Completion', '', @yesNoAnswerTypeId, 'No', 'Admin'),
(@companyId, 'Application Wide', 'Allow Loan Accounts Across Multiple Offices For A Customer', '', @yesNoAnswerTypeId, 'No', 'Loan Origination'),
(@companyId, 'Application Wide', 'Allow Associate Primary Bank Account', '', @yesNoAnswerTypeId, 'No', 'Customer'),
(@companyId, 'Application Wide', 'Face Match Mandatory For Digital Consent', '', @yesNoAnswerTypeId, 'No', 'Customer'),
(@companyId, 'Application Wide', 'Enable Maker-Checker During District Creation', 'Maker Checker For District Creation', @yesNoAnswerTypeId, 'No', 'Admin'),
(@companyId, 'Application Wide', 'Enable Maker-Checker During Block Creation', 'Maker Checker For Block Creation', @yesNoAnswerTypeId, 'No', 'Admin'),
(@companyId, 'Application Wide', 'Enable Maker-Checker During Panchayat Creation', 'Maker Checker For Panchayat Creation', @yesNoAnswerTypeId, 'No', 'Admin'),
(@companyId, 'Application Wide', 'Unapproved Loan Expiry (to Inactive) Days', 'Days after which unapproved loans will be considered inactive', @textAnswerTypeId, 0, 'Admin'),
(@companyId, 'Application Wide', 'Maximum number of mShakti Payments per account in a day','', @textAnswerTypeId, 1, 'Loan Collections'),
(@companyId, 'Application Wide', 'Disallow separate bulk disbursement and fee+insurance posting', 'Disallow separate bulk disbursement and fee+insurance posting', @yesNoAnswerTypeId, 'No', 'Loan Disbursements'),
(@companyId, 'Application Wide', 'Create new users automatically during single sign-on', 'Create new users automatically during single sign-on', @yesNoAnswerTypeId, 'No', 'Admin'),
(@companyId, 'Configure Customer Enrollment', 'Collect Spouse Details', '', @yesNoAnswerTypeId, 'Yes',null),
(@companyId, 'Configure Customer Enrollment', 'Collect Guarantor Details', '', @yesNoAnswerTypeId, 'Yes',null),
(@companyId, 'Configure Customer Enrollment', 'Collect Nominee Details', '', @yesNoAnswerTypeId, 'Yes',null),
(@companyId, 'Configure Customer Enrollment', 'Collect Household Members', '', @yesNoAnswerTypeId, 'Yes',null),
(@companyId, 'Configure Customer Enrollment', 'Collect Household Incomes', '', @yesNoAnswerTypeId, 'Yes',null),
(@companyId, 'Configure Customer Enrollment', 'Collect Household Expenses', '', @yesNoAnswerTypeId, 'Yes',null),
(@companyId, 'Configure Customer Enrollment', 'Collect External Loan Information', '', @yesNoAnswerTypeId, 'Yes',null),
(@companyId, 'Configure Customer Enrollment', 'Collect Identity Proofs', '', @yesNoAnswerTypeId, 'Yes',null),
(@companyId, 'Configure Customer Enrollment', 'Collect Address Proofs', '', @yesNoAnswerTypeId, 'Yes',null),
(@companyId, 'Configure Customer Enrollment', 'Collect Bank Account Information', '', @yesNoAnswerTypeId, 'Yes',null),
(@companyId, 'Configure Customer Enrollment', 'Collect Guarantor Proofs', '', @yesNoAnswerTypeId, 'No',null),
(@companyId, 'Configure Customer Enrollment', 'Collect Household Details', '', @yesNoAnswerTypeId, 'No',null),
(@companyId, 'Configure Customer Enrollment', 'Collect Nominee Proofs', '', @yesNoAnswerTypeId, 'No', null),
(@companyId, 'Configure Customer Enrollment', 'Collect Household Proofs', 'Collect Household Proofs', @yesNoAnswerTypeId, 'No', null),
(@companyId, 'Configure Customer Enrollment', 'Collect Spouse Proofs', 'Collect Spouse Proofs', @yesNoAnswerTypeId, 'No', null),
(@companyId, 'Configure Customer Enrollment', 'Enable Customer Data Quality Check', 'If set "Yes" the customer  kyc details will be validated with the uploaded document manually by the user', @yesNoAnswerTypeId, 'No',null),
(@companyId, 'Configure Customer Enrollment', 'Credit Bureau Enquiry Mandatory Before Full Enrollment', "If set 'Yes' system will force user to do CB for customer before goes to enrolled status.", @yesNoAnswerTypeId, 'No',null),
(@companyId, 'Center Customer Enrollment', 'Minimum Number Of Identity Proofs', '', @textAnswerTypeId, 0,null),
(@companyId, 'Center Customer Enrollment', 'Minimum Number Of Address Proofs', '', @textAnswerTypeId, 0,null),
(@companyId, 'Center Customer Enrollment', 'Minimum Number Of Guarantor Proofs', '', @textAnswerTypeId, 0,null),
(@companyId, 'Center Customer Enrollment', 'Minimum Number Of Spouse Proofs', '', @textAnswerTypeId, 0,null),
(@companyId, 'Customer Enrollment', 'Minimum Number Of Identity Proofs', '', @textAnswerTypeId, 1,null),
(@companyId, 'Customer Enrollment', 'Minimum Number Of Address Proofs', '', @textAnswerTypeId, 1,null),
(@companyId, 'Customer Enrollment', 'Minimum Number Of Household Members', '', @textAnswerTypeId, 0,null),
(@companyId, 'Customer Enrollment', 'Minimum Number Of Household Income', '', @textAnswerTypeId, 0,null),
(@companyId, 'Customer Enrollment', 'Minimum Number Of Household Expense', '', @textAnswerTypeId, 0,null),
(@companyId, 'Customer Enrollment', 'Minimum Number Of Primary Contacts', '', @textAnswerTypeId, 0,null),
(@companyId, 'Customer Enrollment', 'Minimum Age For Customer', '', @textAnswerTypeId, 18,null),
(@companyId, 'Customer Enrollment', 'Maximum Age For Customer', '', @textAnswerTypeId, 100,null),
(@companyId, 'Customer Enrollment', 'Minimum Age For Guarantor', '', @textAnswerTypeId, 18,null),
(@companyId, 'Customer Enrollment', 'Maximum Age For Guarantor', '', @textAnswerTypeId, 100,null),
(@companyId, 'Customer Enrollment', 'Minimum Age For Spouse', '', @textAnswerTypeId, 18,null),
(@companyId, 'Customer Enrollment', 'Maximum Age For Spouse', '', @textAnswerTypeId, 100,null),
(@companyId, 'Customer Enrollment', 'Minimum Age For Nominee', '', @textAnswerTypeId, 18,null),
(@companyId, 'Customer Enrollment', 'Maximum Age For Nominee', '', @textAnswerTypeId, 100,null),
(@companyId, 'Customer Enrollment', 'Household Income/Expense Frequency', '', @listMultipleAnswerTypeId, '',null),
(@companyId, 'Customer Enrollment', 'Minimum Number Of Total Address Proofs And Identity Proofs', '', @textAnswerTypeId, 3,null),
(@companyId, 'Customer Enrollment', 'Minimum Number Of Guarantor Proofs', '', @textAnswerTypeId, 0,null),
(@companyId, 'Customer Enrollment', 'Minimum Number Of Nominee Proofs', '', @textAnswerTypeId, 0, null),
(@companyId, 'Customer Enrollment', 'Minimum Number Of Total Phone Numbers For Customer', '', @textAnswerTypeId, 0,null),
(@companyId, 'Customer Enrollment', 'Minimum Number Of Total Phone Numbers For Spouse', '', @textAnswerTypeId, 0,null),
(@companyId, 'Customer Enrollment', 'Minimum Number Of Total Phone Numbers For Guarantor', '', @textAnswerTypeId, 0,null),
(@companyId, 'Customer Enrollment', 'Minimum Number Of Total Phone Numbers For Nominee', '', @textAnswerTypeId, 0, null),
(@companyId, 'Customer Enrollment', 'Minimum Number Of Total Phone Numbers For Household Members', '', @textAnswerTypeId, 0,null),
(@companyId, 'Customer Enrollment', 'Minimum Number Of Spouse Proofs', '', @textAnswerTypeId, 0,null),
(@companyId, 'Application Wide', 'Loan schedule installment dates should be on center meeting dates', '', @yesNoAnswerTypeId, 'No', 'Loan Collections'),
(@companyId, 'Application Wide', 'Pay Fee and Insurance Before Single Disbursement', 'Force the user to pay fee and insurance before single disbursement', @yesNoAnswerTypeId, 'No', 'Loan Disbursements'),
(@companyId, 'Application Wide', 'Send SMS only for paid by borrower during payments', 'Send SMS only for paid by borrower during payments', @yesNoAnswerTypeId, 'No', 'Loan Collections'),
(@companyId, 'Application Wide', 'Hide Insurance Claim Accounts For Collections', 'Hide Insurance Claim Accounts For Collections', @yesNoAnswerTypeId, 'No', 'Loan Collections'),
(@companyId, 'Application Wide', 'Cash Accounting For Penal Interest Income', 'Use cash accounting and not accrual accounting for penal interest income', @yesNoAnswerTypeId, 'Yes', 'Finance & Accounting'),
(@companyId, 'Mobile App Settings', 'Deletion of enrolled customers data, How many days to retain in mobile database?', '', @textAnswerTypeId, 3,null),
(@companyId, 'Mobile App Settings', 'Deletion of CB enquired customers data, How many days to retain in mobile database?', '', @textAnswerTypeId, 3,null),
(@companyId, 'Mobile App Settings', 'Maximum number of attempts to allow for wrong passcode entry', '', @textAnswerTypeId, 5,null),
(@companyId, 'Mobile App Settings', 'Allow auto-registration of devices for all users/employees', '', @yesNoAnswerTypeId, 'Yes',null),
(@companyId, 'Application Wide', 'Validate Maker-Checker For Loan Approval', '', @yesNoAnswerTypeId, 'No', 'Loan Approvals'),
(@companyId, 'Application Wide', 'Force disburse all accounts in bulk disbursement screens', '', @yesNoAnswerTypeId, 'No', 'Loan Disbursements'),
(@companyId, 'Application Wide', 'Disallow Negative In Cash/Bank Balance', '', @yesNoAnswerTypeId, 'No', 'Finance & Accounting'),
(@companyId, 'Application Wide', 'Set Loan Account Number Automatically', '', @yesNoAnswerTypeId, 'Yes', 'Loan Origination'),
(@companyId, 'Application Wide', 'Automatic ECS Inter-office Transfer Receipt Confirmation', '', @yesNoAnswerTypeId, 'No', 'Finance & Accounting'),
(@companyId, 'Application Wide', 'EOD run on Cash + Bank', '', @yesNoAnswerTypeId, 'No', 'Finance & Accounting'),
(@companyId, 'Application Wide', 'Allow Loan Pipeline Activity By Other Office Employees', '', @yesNoAnswerTypeId, 'No', 'Loan Pipeline'),
(@companyId, 'Application Wide', 'Maker-checker for accounting entries', '', @yesNoAnswerTypeId, 'No', 'Finance & Accounting'),
(@companyId, 'Application Wide', 'Maker-checker for expense entry', '', @yesNoAnswerTypeId, 'No', 'Finance & Accounting'),
(@companyId, 'Application Wide', 'Update Customer Number Manually', 'If set to "No" system will automatically generate a random customer number or as per pre-defined format',@yesNoAnswerTypeId, 'No', 'Customer'),
(@companyId, 'Application Wide', 'Allow Update Of Primary Identity Proof During Origination', '', @yesNoAnswerTypeId, 'No', 'Loan Origination'),
(@companyId, 'Application Wide', 'Center Mandatory For All Unsecured Loans During Opening A Loan', '', @yesNoAnswerTypeId, 'No', 'Loan Origination'),
(@companyId, 'Application Wide', 'Enable Special OD Status', '', @yesNoAnswerTypeId, 'No', 'Loan Collections'),
(@companyId, 'Application Wide', 'Only Bank Payment allowed for Death case Settlement', '', @yesNoAnswerTypeId, 'No', 'Loan Collections'),
(@companyId, 'Application Wide', 'Enable de-duplication of telephone numbers across customers & guarantors', '', @yesNoAnswerTypeId, 'No', 'Customer'), 
(@companyId, 'Application Wide', 'Enable Registered Device Only', '', @yesNoAnswerTypeId, 'No',null),
(@companyId, 'Mobile App Settings', 'Show Equated Moratorium Interest Demand in mShakti', 'Show Equated Moratorium Interest Demand in mShakti', @yesNoAnswerTypeId, 'Yes',null),
(@companyId, 'Application Wide', 'Disallow Loan Approval and Disbursement On Older Product Version', '', @yesNoAnswerTypeId, 'No', 'Loan Approvals'),
(@companyId, 'Application Wide', 'Disallow Negative Differential Interest During Foreclosure', '', @yesNoAnswerTypeId, 'No', 'Loan Collections'),
(@companyId, 'Application Wide', 'Filter third party product accounts in Credit Bureau Submission reports', 'Filter third party product accounts in credit bureau report', @yesNoAnswerTypeId, 'No', 'Credit Bureau'),
(@companyId, 'Application Wide', 'Make Default Payment Amount In Total Field As Empty In Bulk Payments Screen', '', @yesNoAnswerTypeId, 'No', 'Loan Collections'),
(@companyId, 'Application Wide', 'Collect Beneficiary Name For Bank Account', '', @yesNoAnswerTypeId, 'No', 'Customer'),
(@companyId, 'Application Wide', 'Enable Aadhar Verhoeff validation', '', @yesNoAnswerTypeId, 'Yes', 'Customer'),
(@companyId, 'Application Wide', 'Set Attendance as Absent by default in Bulk Payments', '', @yesNoAnswerTypeId, 'Yes', 'Loan Collections'),
(@companyId, 'Application Wide', 'Set Center Customer Contacts Before Loan Orgination', '', @yesNoAnswerTypeId, 'No', 'Customer'),
(@companyId, 'Application Wide', 'Set Group Name Automatically', '', @yesNoAnswerTypeId, 'No', 'Loan Origination'),
(@companyId, 'Application Wide', 'PDC Presentation Date Mandatory', 'If set to "Yes" then system will force the user to set the presentation date for all post-dated cheques.', @yesNoAnswerTypeId, 'No', 'Loan Collections'),
(@companyId, 'Application Wide', 'Enable Maker-checker For mShakti Collections', '', @yesNoAnswerTypeId, 'No', 'Loan Collections'),
(@companyId, 'Application Wide', 'Enable Maker-Checker For Customer Bank Accounts', '', @yesNoAnswerTypeId, 'No', 'Customer'),
(@companyId, 'Application Wide', 'Enable Maker-checker For Disbursements', '', @yesNoAnswerTypeId, 'No', 'Loan Disbursements'),
(@companyId, 'Application Wide', 'Enable Maker-checker For Shakti Collections', '', @yesNoAnswerTypeId, 'No', 'Loan Collections'),
(@companyId, 'Application Wide', 'Credit Bureau data only for Third Party Product', 'Credit Bureau data only for Third Party Product', @yesNoAnswerTypeId, 'No', 'Credit Bureau'),
(@companyId, 'Application Wide', 'Pre-populate and Freeze EOD Checklist numbers', '', @yesNoAnswerTypeId, 'No', 'Finance & Accounting'),
(@companyId, 'Application Wide', 'Loan Pipeline Additional Information is mandatory', 'Loan Pipeline Additional Information is mandatory', @yesNoAnswerTypeId, 'No', 'Loan Pipeline'),
(@companyId, 'Application Wide', 'Enforce One Installment Per Month For Monthly Day-Based Loans In Reschedule', 'Enforce One Installment Per Month For Monthly Day-Based Loans In Reschedule', @yesNoAnswerTypeId, 'No', 'Loan Collections'),
(@companyId, 'Application Wide', 'Run Bene Validation At Customer Level', 'Run Bene Validation At Customer Level', @yesNoAnswerTypeId, 'No', 'Customer'),
(@companyId, 'Application Wide', 'Narration should be mandatory in accounting screens', '', @yesNoAnswerTypeId, 'No', 'Finance & Accounting'),
(@companyId, 'Application Wide', 'Allow Reset Customer Status for customers with active loans', '', @yesNoAnswerTypeId, 'No','Customer'),
(@companyId, 'Application Wide', 'Replace Guarantor label as Nominee', 'Replace the label Guarantor to Nominee in customer enrollment and view', @yesNoAnswerTypeId, 'No','Customer'),
(@companyId, 'Customer Enrollment', 'Minimum Number Of Mobile Numbers For Customer', '', @textAnswerTypeId, 0,null),
(@companyId, 'Customer Enrollment', 'Minimum Number Of Mobile Numbers For Spouse', '', @textAnswerTypeId, 0,null),
(@companyId, 'Customer Enrollment', 'Minimum Number Of Mobile Numbers For Guarantor', '', @textAnswerTypeId, 0,null),
(@companyId, 'Customer Enrollment', 'Minimum Number Of Mobile Numbers For Nominee', '', @textAnswerTypeId, 0,null),
(@companyId, 'Customer Enrollment', 'Minimum Number Of Mobile Numbers For Household Members', '', @textAnswerTypeId, 0,null),
(@companyId, 'Application Wide', 'Maker-checker for user creation', '', @yesNoAnswerTypeId, 'No', 'Admin'),
(@companyId, 'Application Wide', 'Enable maker-checker during area creation', '', @yesNoAnswerTypeId, 'No', 'Admin'),
(@companyId, 'Application Wide', 'Collect associate data at Customer Enrollment', '', @yesNoAnswerTypeId, 'No', 'Admin'),
(@companyId, 'Application Wide', 'Enforce Area Geo-location During Area Approval', '', @yesNoAnswerTypeId, 'No', 'Admin'),
(@companyId, 'Application Wide', 'Disallow Multiple Tenure in a group', 'Warning shown in group for disallow tenure', @yesNoAnswerTypeId, 'No', 'Admin'),
(@companyId, 'Application Wide', 'Use Fixed Land Holding Slabs', '', @yesNoAnswerTypeId, 'No', 'Customer'),
(@companyId, 'Application Wide', 'Allow Attach Customers to Loan Pipeline', '', @yesNoAnswerTypeId, 'No', 'Loan Pipeline'),
(@companyId, 'Application Wide', 'Run Full Enrollment Validation During Update Customer Next Loan Information', '', @yesNoAnswerTypeId, 'No', 'Customer'),
(@companyId, 'Application Wide', 'Apply Round Up on Total Outstanding', '', @yesNoAnswerTypeId, 'No', 'Loan Collections'),
(@companyId, 'Application Wide', 'Collect MI Only In Last Installment', 'Collect MI Only In Last Installment', @yesNoAnswerTypeId, 'No', 'Loan Collections'),
(@companyId, 'Mobile App Settings', 'Store Nearest Location to Branch During mShakti Login', '', @yesNoAnswerTypeId, 'No', 'Admin'),
(@companyId, 'Application Wide', 'Interest Realization Accounting', 'Accounting interest income realized from unrealized gl',
 @yesNoAnswerTypeId, 'No','EOD Process'),
(@companyId, 'Application Wide', 'Allow Cross-category Net-off Loans', 'Allow Group Loan to close Individual Loan And Individual Loan to close Group Loan in Net-off Loans', @yesNoAnswerTypeId, 'No', 'Loan Origination'),
(@companyId, 'Application Wide', 'Document Tagging in Loan Origination (before loan approval)', '', @yesNoAnswerTypeId, 'Yes', 'Loan Origination'),
(@companyId, 'Application Wide', 'Remove De-duplication Contacts', 'Remove De-duplication Contacts', @yesNoAnswerTypeId, 'Yes', 'Customer'),
(@companyId, 'Application Wide', 'Allow Customer Loan Net-off Across Different Branches', 'If set to "No" system will validate both new loan and netting loan should be in the same branch.', @yesNoAnswerTypeId, 'Yes', 'Loan Origination'),
(@companyId, 'Application Wide', 'Enable Maker-Checker For Vendor Creation', 'Maker Checker For Vendor Creation', @yesNoAnswerTypeId, 'No', 'Admin'),
(@companyId, 'Application Wide', 'Allow both Paper and Digital Consents for an account', 'Setting this to be Yes would allow both paper and digital consents from customer to be captured. Setting this to No, would allow any one consent type, ie. whichever is being captured first for a loan account.', @yesNoAnswerTypeId, 'Yes', 'Admin'),
(@companyId, 'Application Wide', "Loan Account Product should be match with Customer\'s Applied Loan Product", "Loan Account Product should be match with Customer\'s Applied Loan Product", @yesNoAnswerTypeId, 'Yes', 'Customer'),
(@companyId, 'Mobile App Settings', 'Generate Internal Employee Number', '', @yesNoAnswerTypeId, 'Yes', 'Admin'),
(@companyId, 'Mobile App Settings', 'Disallow mShakti Cash Collections when loan account has no unpaid demands', 'Setting it to Yes, will disallow mShakti current day cash collection when loan account has no unpaid demands', @yesNoAnswerTypeId, 'No', 'Loan Collections'),
(@companyId, 'Application Wide', 'Enable Geo-tagging Mandatory Before Loan Pipeline activity', 'Setting it to Yes, will loan center geo-tagging is mandatory for pipeline activities', @yesNoAnswerTypeId, 'No', 'Loan Pipeline'),
(@companyId, 'Application Wide', 'Enable Maker-Checker For Employee Creation', 'Enable Maker-Checker For Employee Creation', @yesNoAnswerTypeId, 'No', 'Admin'),
(@companyId, 'Application Wide', 'Automatic Group Creation on Center Creation', 'If enabled, a group  to be created automatically during center creation', @yesNoAnswerTypeId, 'No', 'Loan Origination'),
(@companyId, 'Application Wide', 'Applied Loan Amount Mandatory During CB Enquiry', 'Applied Loan Amount Mandatory During CB Enquiry', @yesNoAnswerTypeId, 'No', 'Credit Bureau'),
(@companyId, 'Application Wide', 'Enable multiple credit-bureau service with same order for one branch', '', @yesNoAnswerTypeId, 'No', 'Credit Bureau'),
(@companyId, 'Application Wide', 'Mandate Transaction Number for ENACH Payments', '', @yesNoAnswerTypeId, 'No', 'Admin'),
(@companyId, 'Application Wide', 'Allow direct closure of existing loan in Net-off Disbursement', 'If it is set as yes, then closure is allowed in the existing loan on the same date of the new loan disbursement date.', @yesNoAnswerTypeId, 'No', 'Loan Collections'),
(@companyId, 'Mobile App Settings', 'Allowed UPI QR code type in mShakti', 'Allow UPI QR code type based on the text from mShakti.', @listSingleAnswerTypeId, 'No', 'Loan Collections'),
(@companyId, 'Application Wide', 'CB enquiry household menbers to be run only if customer CB is Verified', '', @yesNoAnswerTypeId, 'No', 'Credit Bureau'),
(@companyId, 'Application Wide', 'Enforce Finish Enrollment Action to Complete Customer Enrollment', 'Enforce Finish Enrollment Action to Complete Customer Enrollment', @yesNoAnswerTypeId, 'No', 'Admin'),
(@companyId, 'Application Wide', 'Allow Loan Approval and Disbursement only if primary telephone number of customer is verified', 'Allow Loan Approval and Disbursement only if primary telephone number of customer is verified', @yesNoAnswerTypeId, 'No', 'Admin'),
(@companyId, 'Application Wide', 'Enable Customer Multi-Reset', 'Enable Customer Multi-Reset', @yesNoAnswerTypeId, 'No', 'Customer'),
(@companyId, 'Application Wide', 'Capture Entity Geo Location during document upload', 'Capture Entity Geo Location during document upload', @yesNoAnswerTypeId, 'No', 'Admin'),
(@companyId, 'Application Wide', 'Enable Maker-Checker For Entity Geo Location', 'Enable Maker-Checker For Entity Geo Location', @yesNoAnswerTypeId, 'No', 'Admin'),
(@companyId, 'Application Wide', 'Loan & Center Schedules should be same', 'Loan schedule dates should exactly match with subsequent center meeting dates', @yesNoAnswerTypeId, 'No', 'Loan Collections'),
(@companyId, 'Application Wide', 'Accept Masked Aadhaar Number With Validations', 'If set to Yes, system will validate', @yesNoAnswerTypeId, 'No', 'Admin'),
(@companyId, 'Mobile App Settings', 'Collect Virtual Signature at Account Level', 'Collect Virtual Signature at Account Level', @yesNoAnswerTypeId, 'No', 'Loan Origination'),
(@companyId, 'Mobile App Settings', 'Allowed UPI QR code type in mShakti', 'Allow UPI QR code type based on the text from mShakti.', @listSingleAnswerTypeId, 'No', 'Loan Collections'),
(@companyId, 'Application Wide', 'Mandate Center meeting schedule and time during center creation from Mshakti', 'Mandate Center meeting schedule and time during center creation from Mshakti', @yesNoAnswerTypeId, 'No', 'Admin'),
(@companyId, 'Application Wide', 'Set Vendor Code Automatically', 'Set Vendor Code Automatically', @yesNoAnswerTypeId, 'No','Admin');
INSERT INTO AppSetting(company_id, category, name, description, value_type_id, value, is_visible, module) VALUES
(@companyId, 'Application Wide', 'Enable Community Validation', 'Enable Community Validation', @yesNoAnswerTypeId, 'No','0', 'Loan Approvals'),
(@companyId, 'Application Wide', 'Map User To Single Employee', '', @yesNoAnswerTypeId, 'Yes','0', 'Admin'),
(@companyId, 'Application Wide', 'Allow Attach Customers to Loan Pipeline', '', @yesNoAnswerTypeId, 'No', '0', 'Loan Pipeline'),
(@companyId, 'Application Wide', 'Demand Equated Moratorium Interest With Installment', 'Demand Equated Moratorium Interest With Installment', @yesNoAnswerTypeId, 'No', '0', 'EOD Process'),
(@companyId, 'Application Wide', 'Net Broken Period Interest During Disbursement', 'System will force to net the broken period interest with disbursement amount during loan disbursement', @yesNoAnswerTypeId, 'No','0', 'Loan Disbursements'),
(@companyId, 'Application Wide', 'Disable Document Mandatory Validation', 'Disabling document mandatory validation at different levels like Loan opening, Loan approvals, etc. NOTE: This should not be visible to user, It should be done only from the back-end.', @yesNoAnswerTypeId, 'No','0', 'Loan Origination'),
(@companyId, 'Application Wide', 'Run Beneficiary Validation From Non-Own Account', 'Setting it to Yes, run beneficiary validation from non-own account.', @yesNoAnswerTypeId, 'No','0', 'Customer'),
(@companyId, 'Application Wide', 'Enable New Insurance Process', 'Enable New Insurance Process', @yesNoAnswerTypeId, 'No','0', 'Admin'),
(@companyId, 'Application Wide', 'Customer Bank Account mandatory when applied disbursement mode as ECS', 'Customer Bank Account mandatory when applied disbursement mode as ECS', @yesNoAnswerTypeId, 'No','0', 'Customer'),
(@companyId, 'Application Wide', 'Demand Equated Moratorium Interest With Separate Schedule', 'Demand Equated Moratorium Interest  With Separate Schedule', @yesNoAnswerTypeId, 'No','0', 'EOD Process'),
(@companyId, 'Mobile App Settings', 'Allow sending SMS with UPI Payment Link from mShakti', 'When set to Yes, sending out an SMS with the UPI Payment Link is allowed from mShakti.', @yesNoAnswerTypeId, 'No','0', 'Loan Collections'),
(@companyId, 'Application Wide', 'Settings For Restricting User/Device', 'Settings For Restricting User/Device', @listSingleAnswerTypeId, 'Open','1', 'Admin'),
(@companyId, 'Application Wide', 'Demand Slabbed Moratorium Interest With Installment', 'Demand Slabbed Moratorium Interest With Installment', @yesNoAnswerTypeId, 'No','0', 'EOD Process'),
(@companyId, 'Application Wide', 'Round-off Equated Moratorium Interest', 'If it is no, equated moratorium interest will be rounded up', @yesNoAnswerTypeId, 'No','0', 'EOD Process'),
(@companyId, 'Application Wide', 'Demand Equated Moratorium Interest With Last Four Installments', 'Demand Equated Moratorium Interest  With Last Four Installments', @yesNoAnswerTypeId, 'No','0', 'EOD Process'),
(@companyId, 'Application Wide', 'Hide Reversed Transactions in Loan Account Statement', 'Setting it to Yes, will hide all the reversal pairs from the loan account statement', @yesNoAnswerTypeId, 'No','0', 'EOD Process'),
(@companyId, 'Mobile App Settings', 'Allow sending SMS with UPI Payment Link from mShakti', 'When set to Yes, sending out an SMS with the UPI Payment Link is allowed from mShakti.', @yesNoAnswerTypeId, 'No','0', 'Loan Collections'),
(@companyId, 'Mobile App Settings', 'Enable Consent document capture in mShakti for restructured accounts', 'Enable Consent document capture in mShakti for restructured accounts', @yesNoAnswerTypeId, 'No','0', 'Others'),
(@companyId, 'Application Wide', 'Auto-originate Group Loans on Finish Enrollment', 'Setting it to Yes, will originate loan application automatically during finish enrollment action. NOTE: This should not be visible to user, It should be done only from the back-end.', @yesNoAnswerTypeId, 'No','0', 'Loan Origination'),
(@companyId, 'Application Wide', 'Mandating customer primary contact verification for full enrollment', 'Mandating customer primary contact verification for full enrollment', @yesNoAnswerTypeId, 'No', '1','Customer'),
(@companyId, 'Application Wide', 'Perform Bulk Approval and Scheduling Together for Group Loans', 'Setting it to Yes, will generate loan schedules during loan approvals. NOTE: This should not be visible to user, It should be done only from the back-end.', @yesNoAnswerTypeId, 'No', '0','Loan Approvals'),
(@companyId, 'Application Wide', 'CB enquiry customer to be run only if VoterID is verified', 'CB enquiry customer to be run only if VoterID is verified', @yesNoAnswerTypeId, 'No', '0','Customer'),
(@companyId, 'Application Wide', 'CB enquiry customer to be run only if primary mobile number is verified', 'CB enquiry customer to be run only if primary mobile number is verified.', @yesNoAnswerTypeId, 'No', '0','Customer'),
(@companyId, 'Application Wide', 'Settings For Restricting Auto-Approved User/Device', 'Settings for auto approval while register the device', @listSingleAnswerTypeId, 'Disabled','1', 'Admin'),
(@companyId, 'Application Wide', 'Accept Masked Aadhaar Number', 'If set to "Yes" system will not validate aadhar number.', @yesNoAnswerTypeId, 'No', '1','admin'),
(@companyId, 'Application Wide', 'Enable Loan Disbursement to Vehicle Dealer', '', @yesNoAnswerTypeId, 'No', '0','Admin'),
(@companyId, 'Application Wide', 'Collect Household Income Break-up Based on Periodicity', 'Collect Household Income Break-up Based on Periodicity', @listMultipleAnswerTypeId, 'Yes','1', 'Customer'),
(@companyId, 'Application Wide', 'Face match required in login', 'Face match required or not required for login', @listSingleAnswerTypeId, 'Not Required','1', 'Admin'),
(@companyId, 'Application Wide', 'Invalidate the credit bureau report while update the loan amount/product details', 'Invalidate the credit bureau report while update the loan amount/product details', @yesNoAnswerTypeId, 'No','1', 'Credit Bureau'),
(@companyId, 'Application Wide', 'Invalidate the credit bureau report while update the customer primary telephone details', 'Invalidate the credit bureau report while update the customer primary telephone details', @yesNoAnswerTypeId, 'No','1', 'Credit Bureau'),
(@companyId, 'Application Wide', 'Mandate Transaction Number for UPI Payments', 'Mandate Transaction Number for UPI Payments', @yesNoAnswerTypeId, 'No','1', 'Admin'),
(@companyId, 'Application Wide', 'Area Geolocation Mandatory During Area Creation', 'Area Geolocation Mandatory During Area Creation', @yesNoAnswerTypeId, 'Yes','1', 'Admin');
(@companyId, 'Application Wide', 'Enable Maker-Checker During Geo Location Creation', 'Enable Maker-Checker During Geo Location Creation', @yesNoAnswerTypeId, 'Yes','1', 'Admin');
(@companyId, 'Application Wide', 'Loan Pipeline is mandatory for Loan Origination', 'Loan Pipeline is mandatory for Loan Origination', @yesNoAnswerTypeId, 'No','1', 'Loan Pipeline'),
(@companyId, 'Application Wide', 'Enable State Pincode Validation', 'Enable State Pincode Validation', @yesNoAnswerTypeId, 'No','0', 'Admin'),
(@companyId, 'Application Wide', 'Allow only Saving Bank Account type for Customers', 'Allow only Saving Bank Account type for Customers', @yesNoAnswerTypeId, 'No','0', 'Customer'),
(@companyId, 'Application Wide', 'Disable Popup in Bulk Approval', 'Disable Popup in Bulk Approval', @yesNoAnswerTypeId, 'No','0', 'Loan Approvals'),
(@companyId, 'Application Wide', 'Enable Value-Dated Enrollment', 'Enable Value-Dated Enrollment.', @yesNoAnswerTypeId, 'No','0', 'Admin');
(@companyId, 'Application Wide', 'Invalidate the credit bureau report while add/update the KYC details', 'Valid cb report is set as invalid when customer KYC details are added/updated.', @yesNoAnswerTypeId, 'No', '1', 'Credit Bureau'),
(@companyId, 'Application Wide', 'FOIR: Total installment amount calculation method', 'FOIR: Total installment amount calculation has following method: 1.Total Installment Amount From CB, 2.(Total Installment Amount - Excluding own org) From CB, 3.Total Installment Amount From CCR+EE (If CCR+EE service enabled only), 4.Total Installment Amount Based on the Loan Amount or Outstanding Slab', @listSingleAnswerTypeId, '(Total Installment Amount - Excluding own org) From CB',' 1', 'Credit Bureau'),
(@companyId, 'Application Wide', 'Disallow Center Meeting Schedule Updation On Active Centers', 'Disallow Center Meeting Schedule Updation On Active Centers', @yesNoAnswerTypeId, 'No', '1', 'Loan Origination'),
(@companyId, 'Application Wide', 'Customer Mobile OTP Verification setting on add new/set primary mobile number', 'Customer Mobile OTP Verification setting on add new/set primary mobile number.', @listSingleAnswerTypeId, 'Optional in enrollment and Optional in existing customer update', '1', 'Admin'),
(@companyId, 'Application Wide', 'Enabled mShakti RBAC', 'If set to Yes, mShakti RBAC is enabled. Otherwise it is not and mShakti will use the earlier Employee title based authorization model.', @yesNoAnswerTypeId, 'No', '1', 'Admin'),
(@companyId, 'Application Wide', 'Customer Mobile number verification mandatory at GRT Pipeline status completion', 'Customer Mobile number verification mandatory at GRT Pipeline status completion', @yesNoAnswerTypeId, 'No', '1', 'Customer'),
(@companyId, 'Application Wide', 'Allow Credit Bureau Enquiry For Non-Customers', 'Allow Credit Bureau Enquiry For Non-Customers', @yesNoAnswerTypeId, 'Yes', '1', 'Credit Bureau'),
(@companyId, 'Application Wide', 'Generate barcode automatically', 'Allow generate barcode automatically', @yesNoAnswerTypeId, 'Yes', '1', 'Loan Pipeline'),
(@companyId, 'Application Wide', 'Disallow Value-dated Loan Pipeline Status Marking', 'Disallow Value-dated Loan Pipeline Status Marking', @yesNoAnswerTypeId, 'No', '1', 'Loan Pipeline'),
(@companyId, 'Application Wide', 'Enable pipeline status auto-cancellation based on pipeline survey score', 'Enable pipeline status auto-cancellation based on pipeline survey score', @yesNoAnswerTypeId, 'Yes', '1', 'Loan Pipeline'),
(@companyId, 'Application Wide', 'Disallow separate bulk disbursement and fee+insurance postings', 'Disallow separate bulk disbursement and fee+insurance postings', @yesNoAnswerTypeId, 'No', '1', 'Loan Disbursements'),
(@companyId, 'Application Wide', 'Enable CDS Based On Loan Schedule', 'Enable CDS Based On Loan Schedule', @yesNoAnswerTypeId, 'No', '1', 'Loan Collections'),
(@companyId, 'Application Wide', 'Generate Random GL Code', @yesNoAnswerTypeId, 'No', '0', 'Accounting'),
(@companyId, 'Application Wide', 'Allow Individual Loan To Net-off Group Loan', 'Allow Individual Loan To Net-off Group Loan', @yesNoAnswerTypeId, 'No', '1', 'Loan Origination'),
(@companyId, 'Application Wide', 'Allow Direct Closure/Collection of Existing Loan in Net-off Disbursement', 'Allow Direct Closure/Collection of Existing Loan in Net-off Disbursement', @yesNoAnswerTypeId, 'No', '1', 'Loan Collections'),
(@companyId, 'Application Wide', 'Perform Entity Enrollment only after success Aadhar eKYC verification','Perform Entity Enrollment only after success Aadhar eKYC verification', @yesNoAnswerTypeId, 'No', '1', 'Credit Bureau'),
(@companyId, 'Application Wide', 'Enforce Identity Proof Verifications Before Credit Bureau','When set to Yes, CB allowed to place only if all enabled identity proof verifications are successfully passed', @yesNoAnswerTypeId, 'No', '1', 'Credit Bureau'),
(@companyId, 'Application Wide', 'Allow principal holiday during update loan information','Allow principal holiday during update loan information', @yesNoAnswerTypeId, 'No', '1', 'Loan Disbursements');

INSERT INTO AppSetting(company_id, category, name, value_type_id, value, partial_enrollment) VALUES 
(@companyId, 'Customer Enrollment', 'Minimum Number Of Customer Bank Accounts', @textAnswerTypeId, 1, 1),
(@companyId, 'Customer Enrollment', 'Minimum Number Of Mobile Numbers For Customer', @textAnswerTypeId, 0, 0),
(@companyId, 'Customer Enrollment', 'Minimum Number Of Mobile Numbers For Spouse', @textAnswerTypeId, 0, 0),
(@companyId, 'Customer Enrollment', 'Minimum Number Of Mobile Numbers For Guarantor', @textAnswerTypeId, 0, 0),
(@companyId, 'Customer Enrollment', 'Minimum Number Of Mobile Numbers For Household Members', @textAnswerTypeId, 0, 0),
(@companyId, 'Customer Enrollment', 'Minimum Number Of Household Proofs', @textAnswerTypeId, 0, 0),
(@companyId, 'Customer Enrollment', 'Minimum Number Of Mobile Numbers For Household Members', @textAnswerTypeId, 0, 0);

INSERT INTO AppSetting(company_id, category, name, description, value_type_id, value, is_visible, module, applicable_for_all_offices) VALUES
(@companyId, 'Application Wide', 'Allow user login by email', 'If set to true, in addition to login by username, users will also be able to login by email.', @yesNoAnswerTypeId, 'No','1', 'Admin','0'),
(@companyId, 'Application Wide', 'Allow Total Write-off Recovery Amount more than Written Off Amount', 'Setting it to Yes, will allow total Write-off recovery amount more than written off amount', @yesNoAnswerTypeId, 'No','1', 'Loan Collections','1'),
(@companyId, 'Application Wide', 'Capture and Confirm Center Geo-Location During Pipeline Status Change', 'Setting it to Yes, will enable confirm center geo location during pipeline status change', @yesNoAnswerTypeId, 'No', '1','Loan Pipeline','0'),
(@companyId, 'Application Wide', 'Enable Eligible Household Process Flow', 'Value as Yes will enable the new Household processflow', @yesNoAnswerTypeId, 'Yes', '1','Admin','1'),
(@companyId, 'Application Wide', 'Consider Flat 50% Income For FOIR Calculation & Ignore Expense From Calculation', 'Value as Yes will change FOIR functionality', @yesNoAnswerTypeId, 'Yes', '1','Admin','1'),
(@companyId, 'Application Wide', 'Store NACH mandate registration bank account number as entity bank account number', 'Value as Yes for this app setting then bank account will be added from backend', @yesNoAnswerTypeId, 'No', '1','Admin','1'),
(@companyId, 'Application Wide', 'Process Delinquency Based On New NPA Norms', 'When set to Yes, process DPD status based on new NPA norms.', @yesNoAnswerTypeId, 'Yes', '0','EOD Process','1'),
(@companyId, 'Application Wide', 'Stop Interest Accrual On Insurance Claim From Demise Marking Date', 'When set to Yes, stopped interest accrual on insurance claim accounts.', @yesNoAnswerTypeId, 'Yes', '0','EOD Process','1'),
(@companyId, 'Application Wide', 'Allow Auto CB Decision For Non-Customers', 'Set Auto CB Decision For Non-Customers', @yesNoAnswerTypeId, 'No', '1','Credit Bureau','0'),
(@companyId, 'Application Wide', 'Consider Moratorium Demand For DPD Calculation', 'When set to Yes, consider moratorium demand for DPD calculation and upated this dpd number into max od principal days field.', @yesNoAnswerTypeId, 'Yes', '0','EOD Process','1'),
(@companyId, 'Application Wide', 'Enforce New Interest Start Date & Only Cash Disbursement For ECS Failed Accounts', 'Enforce New Interest Start Date & Only Cash Disbursement For ECS Failed Accounts.', @yesNoAnswerTypeId, 'No','0', 'Loan Disbursements', '0'),
(@companyId, 'Application Wide', 'Allow copy paste event in add or update bank account', 'Allow copy paste keyboard or mouse event during add or update bank account', @yesNoAnswerTypeId, 'No', '1','Customer','1'),
(@companyId, 'Application Wide', 'Enable Property Collateral Receive-Release Document', 'Enable Property collateral Receive and release document', @yesNoAnswerTypeId, 'No', '1','Admin','0'),
(@companyId, 'Application Wide', 'Collect Reference Number for Specified Loan Transactions', 'Collect the reference number based on the appsetting values(transactions), it does not support bulk screens and Mshakti', @listMultipleAnswerTypeId, 'Disabled', '1','Loan Collections','0'),
(@companyId, 'Application Wide', 'Mandate the reference number during loan transactions', 'Mandate the reference number during loan transactions, it does not support bulk screens and Mshakti', @yesNoAnswerTypeId, 'No', '1','Loan Collections','0'),
(@companyId, 'Application Wide', 'Distance Rule Failure on Area Creation', 'Distance Rule Failure on Area Creation', @listSingleAnswerTypeId, 'Reject', '1', 'Admin', '0'),
(@companyId, 'Application Wide', 'Distance Rule Failure on Center Creation', 'Distance Rule Failure on Center Creation', @listSingleAnswerTypeId, 'Reject', '1', 'Admin', '0'),
(@companyId, 'Application Wide', 'Enable Insurance Claim Accounting', 'Setting it to Yes, own loans and Advances will be transferred to claim loans and advances.', @yesNoAnswerTypeId, 'No','EOD Process'),
(@companyId, 'Application Wide', 'Enable cross-sell inventory allocation and tracking', 'Enable cross-sell inventory allocation and tracking', @yesNoAnswerTypeId, 'No', '1','Admin','0');

/* EOD process related app setting */
INSERT INTO AppSetting(company_id, category, name, description, value_type_id, value, is_visible, module, applicable_for_all_offices) VALUES
(@companyId, 'Application Wide', 'NPA Accounting on asset side', 'If set as Yes, process the npa accounting for asset side.', @yesNoAnswerTypeId, 'No', '1','EOD Process','0'),
(@companyId, 'Application Wide', 'Process account level advance payment instead of office level', 'If set as Yes, process advance payment at account level.', @yesNoAnswerTypeId, 'No', '1','EOD Process','0'),
(@companyId, 'Application Wide', 'Process customer delinquency based on accounts', 'If set as Yes, process the customer delinquency based on accounts.', @yesNoAnswerTypeId, 'No', '1','EOD Process','0'),
(@companyId, 'Application Wide', 'Calculate Fixed Schedule IRR for Fact Sheet', 'Setting it to Yes, will calculate fixed schedule IRR for fact-sheet. NOTE: This should be applicate for Weekly, Fortnightly and Once Every Four Weeks repayment frequencies.', @yesNoAnswerTypeId, 'No', '1','Loan Disbursements','1');
(@companyId, 'Application Wide', 'Allow copy paste event in add or update bank account', 'Allow copy paste keyboard or mouse event during add or update bank account', @yesNoAnswerTypeId, 'No', '1','Customer','1'),
(@companyId, 'Application Wide', 'Allow enrolled customers during customer center transfer', 'Allow enrolled customers during customer center transfer', @yesNoAnswerTypeId, 'Yes', '1','Customer','0'),
(@companyId, 'Application Wide', 'Calculate Fixed Schedule IRR for Fact Sheet', 'Setting it to Yes, will calculate fixed schedule IRR for fact-sheet. NOTE: This should be applicate for Weekly, Fortnightly and Once Every Four Weeks repayment frequencies.', @yesNoAnswerTypeId, 'No', '1','Loan Disbursements','1'),
(@companyId, 'Application Wide', 'Include External Loan Details to FOIR Calculation', 'Setting it to Yes, will include customer external loan details in the FOIR calculation.', @yesNoAnswerTypeId, 'No', '1','Admin','1'),
(@companyId, 'Application Wide', 'Allow enrolled customers during customer center transfer', 'Allow enrolled customers during customer center transfer', @yesNoAnswerTypeId, 'Yes', '1','Customer','0'),
(@companyId, 'Application Wide', 'Allow cancel pipeline during pipeline having enrolled customers', 'When set to Yes, Pipeline cancelation is allowed even pipeline contains customers in Enrolled status', @yesNoAnswerTypeId, 'yes', '1','Loan Pipeline','0'),
(@companyId, 'Application Wide', 'CB enquiry household members to be run only if customer CB is Verified', 'CB enquiry household members to be run only if customer CB is Verified.', @yesNoAnswerTypeId, 'No', '1','Credit Bureau','1'),
(@companyId, 'Application Wide', 'Allow Duplicate Contact Number For Employee', 'Allow Duplicate Customer Contact Number For Employee', @yesNoAnswerTypeId, 'No', '0','Customer','1'),
(@companyId, 'Application Wide', "Validate Customer\'s Applied Loan Product Class during Attach Customers to Pipeline", "Run validation of pipeline product class against customer\'s applied loan product class while attaching customers to pipeline. Customer\'s applied loan product details mandatory and cannot be empty when attaching customer to pipeline.", @yesNoAnswerTypeId, 'yes', '1','Loan Pipeline','0'),
(@companyId, 'Application Wide', 'Enable CB Consent OTP before CB Enquiry', 'Enable CB Consent OTP before CB Enquiry', @yesNoAnswerTypeId, 'No', '1','Credit Bureau','1'),
(@companyId, 'Application Wide', 'Allow Duplicate Contact Number within the Household', 'Allow Duplicate Contact Number within the Household', @yesNoAnswerTypeId, 'No', '1','Customer','1'),
(@companyId, 'Application Wide', 'Allow Only Numeric in Customer & Entity Bank Accounts', 'Restrict to Only Numbers', @yesNoAnswerTypeId, 'No', '1','Customer','1'),
(@companyId, 'Application Wide', 'New Loan Amount should be same as the existing outstanding loan for a Flexi Loan Net-Off', 'New Loan Amount should be same as the outstanding balance of the existing loan for a Flexi Loan Net-Off', @yesNoAnswerTypeId, 'No', '1','Loan Origination','1'),
(@companyId, 'Application Wide', 'Fee GST proportionally appropriation', 'If set as Yes, the system appropriate the payment amount proportionally to fee and GST', @yesNoAnswerTypeId, 'No', '1','EOD Process','0'),
(@companyId, 'Application Wide', 'Stop Interest Accrual On Insurance Claim From Application Date', 'When set to Yes, stopped interest accrual on insurance claim accounts.', @yesNoAnswerTypeId, 'No', '0','EOD Process','1'),
(@companyId, 'Application Wide', 'Center Leader Mandatory on Pipeline Creation', 'Atleast one center leader name is mandatory on Pipeline Creation', @yesNoAnswerTypeId, 'No', '1','Loan Pipeline','1'),
(@companyId, 'Application Wide', 'Disallow Active Customer Transfer to Different Center', 'Disallow Active Customer Transfer to Different Center', @yesNoAnswerTypeId, 'No', '1','Customer','1'),
(@companyId, 'Application Wide', 'Allow ForeClosure UPI Payments', 'Allow ForeClosure UPI Payments', @yesNoAnswerTypeId, 'No', '1','Admin','0'),
(@companyId, 'Mobile App Settings', 'PAR/PTP reasons mandatory for missed collections', 'If set to "Yes,"PAR/PTP reasons are mandatory for missed collections from mshakti', @yesNoAnswerTypeId, 'No', '0','Loan Collections','1'),
(@companyId, 'Application Wide', 'Enable loan obligation calculation to treat installment frequency Other as Monthly', 'When set to Yes, To treat the installment frequency Other as Monthly in the loan obligation calculation.', @yesNoAnswerTypeId, 'No', '1','Credit Bureau','1'),
(@companyId, 'Application Wide', 'Disallow Loan Opening if customer has active loan in different center', 'Loan origination is not allowed if the customer has an active loan at another center and Net-off loans will be skipped.', @yesNoAnswerTypeId, 'No', '1','Loan Origination','1'),
(@companyId, 'Application Wide', 'Mandate center at customer full enrollment', 'Mandate center at customer full enrollment', @yesNoAnswerTypeId, 'No', '1','Customer','1'),
(@companyId, 'Application Wide', 'Enable same center for all deposit account', 'Enable same center for all deposit account', @yesNoAnswerTypeId, 'No', '1','Loan Origination','1'),
(@companyId, 'Application Wide', 'Enable Mandatory KYC Check before CB enquiry', 'Enable Mandatory KYC Check before CB enquiry', @yesNoAnswerTypeId, 'No', '1','Customer','1'),
(@companyId, 'Application Wide', 'Allow SMS to be sent to unverified primary contact numbers', 'When set to "Yes", SMS can be sent to unverified primary contact numbers.', @yesNoAnswerTypeId, 'No', '1','Admin','1'),
(@companyId, 'Application Wide', 'Allow Multiple Occupation & Income Per Entity', 'When set to Yes, the system will allow to provide the multiple incomes per entity.', @yesNoAnswerTypeId, 'No', '1','Customer','1'),
(@companyId, 'Application Wide', 'Enable Settlement for Written-off loans', "Settlement can be done for Written-off loans by posting an amount from mShakti (API) or Web action.Typically, Loan status will move to 'Settled Post Write-Off' , but when the full outstanding amount is posted, status will move to 'Post Write-Off Closed'", @yesNoAnswerTypeId, 'No', '1','Loan Collections','1');

INSERT INTO AppSetting(company_id, category, name, description, value_type_id, value, is_visible, module, applicable_for_all_offices) VALUES(
    (@companyId, 'Application Wide', 'Collect Collateral Data at Customer Level', 'Setting it to Yes, will allow to collect collateral data at customer level instead of account level', @yesNoAnswerTypeId, 'No','1', 'Admin','1'),
    (@companyId, 'Application Wide', 'Collect Income Details For Associates', 'Setting it to Yes, will allow to collect income details for associates', @yesNoAnswerTypeId, 'No','1', 'Admin','1'),
    (@companyId, 'Application Wide', 'Enable NBFC FOIR Processflow', 'Setting it to Yes, will enable the NBFC FOIR calculatiion and processflow', @yesNoAnswerTypeId, 'No','1', 'Admin','1')
);
--
-- Values for OrgSetting, Depends on the enforced id in shakti-master.sql
--

INSERT INTO OrgSetting(id,type_id,company_id,effective_date,end_date,value,enforcement_level) VALUES (1,1,@companyId,'2008-01-01',NULL,'India',1),
(2,2,@companyId,'2008-01-01',NULL,'ABC Finance Limited',1),
(3,3,@companyId,'2008-01-01',NULL,'|1|2|3|4|5|6|',1),
(6,6,@companyId,'2008-01-01',NULL,'0',1),
(7,7,@companyId,'2008-01-01',NULL,'1',1),
(8,8,@companyId,'2008-01-01',NULL,'50000000',1),
(9,9,@companyId,'2008-01-01',NULL,'0',1),
(10,10,@companyId,'2008-01-01',NULL,'0',1),
(13,13,@companyId,'2008-01-01',NULL,'0',1),
(14,14,@companyId,'2008-01-01',NULL,'0',1),
(15,15,@companyId,'2008-01-01',NULL,'50',1),
(17,17,@companyId,'2008-01-01',NULL,'120',1),
(18,18,@companyId,'2008-01-01',NULL,'50',1),
(19,19,@companyId,'2008-01-01',NULL,'1000',1),
(21,21,@companyId,'2008-01-01',NULL,'30',1),
(28,22,@companyId,'2008-01-01',NULL,'1',1),
(30,25,@companyId,'2008-01-01',NULL,'0',1),
(31,26,@companyId,'2008-01-01',NULL,'1',1),
(32,27,@companyId,'2008-01-01',NULL,'0.1',1),
(33,28,@companyId,'2008-01-01',NULL,'0',1),
(34,29,@companyId,'2008-01-01',NULL,'0',1),
(35,30,@companyId,'2008-01-01',NULL,'100000',1),
(42,31,@companyId,'2008-01-01',NULL,'0',1),
(43,32,@companyId,'2008-01-01',NULL,'00:00',1),
(44,33,@companyId,'2008-01-01',NULL,'0',1),
(47,34,@companyId,'2008-01-01',NULL,'0',1),
(51,35,@companyId,'2008-01-01',NULL,'',1),
(57,36,@companyId,'2008-01-01',NULL,'0',0),
(61,37,@companyId,'2008-01-01',NULL,'1.2.033-20180810',1),
(62,38,@companyId,'2008-01-01',NULL,'1.2.033-20180810',1),
(65,39,@companyId,'2008-01-01',NULL,'0',1),
(74,40,@companyId,'2008-01-01',NULL,'365',1),
(75,41,@companyId,'2008-01-01',NULL,'60',1),
(76,42,@companyId,'2008-01-01',NULL,'0',0),
(77,43,@companyId,'2008-01-01',NULL,'0',0),
(78,44,@companyId,'2008-01-01',NULL,'270',1),
(79,46,@companyId,'2008-01-01',NULL,'00:00:00',1),
(80,47,@companyId,'2008-01-01',NULL,'23:59:59',1),
(81,45,@companyId,'2008-01-01',NULL,'|Fortnightly|Once Every Four Weeks|',1),
(82,48,@companyId,'2008-01-01',NULL,'0',1),
(83,49,@companyId,'2008-01-01',NULL,'100000',1),
(84,50,@companyId,'2008-01-01',NULL,'100000',1),
(85,51,@companyId,'2008-01-01',NULL,'25000',1),
(86,52,@companyId,'2008-01-01',NULL,'25000',1),
(87,53,@companyId,'2008-01-01',NULL,'0',1),
(88,54,@companyId,'2008-01-01',NULL,'0',1),
(89,55,@companyId,'2008-01-01',NULL,'0',0),
(90,56,@companyId,'2008-01-01',NULL,'One',0),
(91,57,@companyId,'2008-01-01',NULL,'|1|2|3|4|5|',1),
(89,55,@companyId,'2008-01-01',NULL,'0',0),
(90,56,@companyId,'2008-01-01',NULL,'One',0),
(91,57,@companyId,'2008-01-01',NULL,'|1|2|3|4|5|',1),
(90,58,@companyId,'2008-01-01',NULL,'1',0),
(92,59,@companyId,'2008-01-01',NULL,'1',0),
(93,60,@companyId,'2008-01-01',NULL,'0',0),
(94,61,@companyId,'2008-01-01',NULL,'0',0),
(95,62,@companyId,'2008-01-01',NULL,'0',0);
--
-- Values for OfficeType
--
INSERT INTO OfficeType VALUES(1,"Head Office","HO");
