Skip to content

Commit ed8bfdd

Browse files
authored
Finish feature/OP-454
OP-454: Add Usage field to the tblIMISDefaultsPhone to explain the fields
2 parents 91ddde1 + 5851edf commit ed8bfdd

2 files changed

Lines changed: 29 additions & 4 deletions

File tree

Empty databases/openIMIS_ONLINE.sql

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2616,7 +2616,8 @@ SET QUOTED_IDENTIFIER ON
26162616
GO
26172617
CREATE TABLE [dbo].[tblIMISDefaultsPhone](
26182618
[RuleName] [nvarchar](100) NULL,
2619-
[RuleValue] [bit] NULL
2619+
[RuleValue] [bit] NULL,
2620+
[Usage] [nvarchar](200) NULL
26202621
) ON [PRIMARY]
26212622
GO
26222623

@@ -4982,9 +4983,10 @@ SET IDENTITY_INSERT [dbo].[tblIMISDefaults] ON
49824983

49834984
INSERT [dbo].[tblIMISDefaults] ([DefaultID], [PolicyRenewalInterval], [FTPHost], [FTPUser], [FTPPassword], [FTPPort], [FTPEnrollmentFolder], [AssociatedPhotoFolder], [FTPClaimFolder], [FTPFeedbackFolder], [FTPPolicyRenewalFolder], [FTPPhoneExtractFolder], [FTPOffLineExtractFolder], [AppVersionBackEnd], [AppVersionEnquire], [AppVersionEnroll], [AppVersionRenewal], [AppVersionFeedback], [AppVersionClaim], [OffLineHF], [WinRarFolder], [DatabaseBackupFolder], [OfflineCHF], [SMSLink], [SMSIP], [SMSUserName], [SMSPassword], [SMSSource], [SMSDlr], [SMSType], [AppVersionFeedbackRenewal], [AppVersionImis]) VALUES (1, 14, N'', N'', N'', 0, N'/Images/Submitted', N'/Images/Updated', N'', N'', N'', N'', N'', CAST(1.2 AS Decimal(3, 1)), CAST(0.0 AS Decimal(3, 1)), CAST(0.0 AS Decimal(3, 1)), CAST(0.0 AS Decimal(3, 1)), CAST(0.0 AS Decimal(3, 1)), CAST(0.0 AS Decimal(3, 1)), 0, N'C:\Program Files (x86)\WinRAR\', N'', 0, N'', N'', N'', N'', N'', 1, 1, CAST(1.2 AS Decimal(3, 1)), CAST(0.0 AS Decimal(3, 1)))
49844985
SET IDENTITY_INSERT [dbo].[tblIMISDefaults] OFF
4985-
INSERT [dbo].[tblIMISDefaultsPhone] ([RuleName], [RuleValue]) VALUES (N'AllowInsureeWithoutPhoto', 0)
4986-
INSERT [dbo].[tblIMISDefaultsPhone] ([RuleName], [RuleValue]) VALUES (N'AllowFamilyWithoutPolicy', 0)
4987-
INSERT [dbo].[tblIMISDefaultsPhone] ([RuleName], [RuleValue]) VALUES (N'AllowPolicyWithoutPremium', 0)
4986+
INSERT [dbo].[tblIMISDefaultsPhone] ([RuleName], [RuleValue], [Usage]) VALUES (N'AllowInsureeWithoutPhoto', 0, 'Allow synchronization of Insurees without a Photo.')
4987+
INSERT [dbo].[tblIMISDefaultsPhone] ([RuleName], [RuleValue], [Usage]) VALUES (N'AllowFamilyWithoutPolicy', 0, 'Allow synchronization of Families without a Policy.')
4988+
INSERT [dbo].[tblIMISDefaultsPhone] ([RuleName], [RuleValue], [Usage]) VALUES (N'AllowPolicyWithoutPremium', 0, 'Allow synchronization of Policies without a Contribution. If ShowPaymentOption is false, this rule value is read as true.')
4989+
INSERT [dbo].[tblIMISDefaultsPhone] ([RuleName], [RuleValue], [Usage]) VALUES (N'ShowPaymentOption', 1, 'Show or hide the Payment option to allow or not to add a Contribution for a Policy. ')
49884990
INSERT [dbo].[tblLanguages] ([LanguageCode], [LanguageName], [SortOrder]) VALUES (N'en', N'English', 1) -- By default english is set as primary language, required by SMS
49894991
INSERT [dbo].[tblLanguages] ([LanguageCode], [LanguageName], [SortOrder]) VALUES (N'fr', N'Français', 2)
49904992
INSERT [dbo].[tblLegalForms] ([LegalFormCode], [LegalForms], [SortOrder], [AltLanguage]) VALUES (N'C', N'Charity', NULL, N'Charité')

Migration script/openIMIS migration latest.sql

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8612,3 +8612,26 @@ GO
86128612
IF COL_LENGTH(N'tblItems', N'Quantity') IS NULL
86138613
ALTER TABLE tblItems ADD Quantity DECIMAL(18, 2) NULL
86148614
GO
8615+
8616+
IF NOT EXISTS(SELECT RuleName from tblIMISDefaultsPhone WHERE RuleName='ShowPaymentOption')
8617+
INSERT INTO tblIMISDefaultsPhone(RuleName, RuleValue) VALUES('ShowPaymentOption', 1)
8618+
GO
8619+
8620+
IF COL_LENGTH(N'dbo.tblIMISDefaultsPhone', N'Usage') IS NULL
8621+
ALTER TABLE [dbo].[tblIMISDefaultsPhone] ADD [Usage] [nvarchar](200) NULL
8622+
GO
8623+
8624+
IF EXISTS (SELECT [RuleName] FROM [dbo].[tblIMISDefaultsPhone]
8625+
WHERE [RuleName] in ('AllowInsureeWithoutPhoto', 'AllowFamilyWithoutPolicy', 'AllowPolicyWithoutPremium', 'ShowPaymentOption')
8626+
and [Usage] IS NULL)
8627+
BEGIN
8628+
UPDATE [dbo].[tblIMISDefaultsPhone]
8629+
SET [Usage] = CASE
8630+
WHEN [RuleName] = 'AllowInsureeWithoutPhoto' THEN 'Allow synchronization of Insurees without a Photo.'
8631+
WHEN [RuleName] = 'AllowFamilyWithoutPolicy' THEN 'Allow synchronization of Families without a Policy.'
8632+
WHEN [RuleName] = 'AllowPolicyWithoutPremium' THEN 'Allow synchronization of Policies without a Contribution. If ShowPaymentOption is false, this rule value is read as true.'
8633+
WHEN [RuleName] = 'ShowPaymentOption' THEN 'Show or hide the Payment option to allow or not to add a Contribution for a Policy.'
8634+
END
8635+
WHERE [RuleName] in ('AllowInsureeWithoutPhoto', 'AllowFamilyWithoutPolicy', 'AllowPolicyWithoutPremium', 'ShowPaymentOption')
8636+
END
8637+
GO

0 commit comments

Comments
 (0)