Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -591,6 +591,7 @@ private void UpdateOrganization(Organization organization, OrganizationEditModel
organization.Gateway = model.Gateway;
organization.GatewayCustomerId = model.GatewayCustomerId;
organization.GatewaySubscriptionId = model.GatewaySubscriptionId;
organization.ExemptFromBillingAutomation = model.ExemptFromBillingAutomation;
}
}

Expand Down
4 changes: 4 additions & 0 deletions src/Admin/AdminConsole/Models/OrganizationEditModel.cs
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,7 @@ public OrganizationEditModel(
UseDisableSmAdsForUsers = org.UseDisableSmAdsForUsers;
UsePhishingBlocker = org.UsePhishingBlocker;
UseMyItems = org.UseMyItems;
ExemptFromBillingAutomation = org.ExemptFromBillingAutomation;

_plans = plans;
}
Expand Down Expand Up @@ -205,6 +206,8 @@ public OrganizationEditModel(
public bool UseAutomaticUserConfirmation { get; set; }
[Display(Name = "Create My Items for organization ownership")]
public bool UseMyItems { get; set; }
[Display(Name = "Exempt From Billing Automation")]
public bool ExemptFromBillingAutomation { get; set; }
/**
* Creates a Plan[] object for use in Javascript
* This is mapped manually below to provide some type safety in case the plan objects change
Expand Down Expand Up @@ -340,6 +343,7 @@ public Organization ToOrganization(Organization existingOrganization)
existingOrganization.UseDisableSmAdsForUsers = UseDisableSmAdsForUsers;
existingOrganization.UsePhishingBlocker = UsePhishingBlocker;
existingOrganization.UseMyItems = UseMyItems;
existingOrganization.ExemptFromBillingAutomation = ExemptFromBillingAutomation;
return existingOrganization;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -338,5 +338,13 @@
</div>
</div>
</div>
<div class="row">
<div class="col-sm">
<div class="form-check mb-3">
<input type="checkbox" class="form-check-input" asp-for="ExemptFromBillingAutomation" disabled="@(!canEditBilling)">
<label class="form-check-label" asp-for="ExemptFromBillingAutomation"></label>
</div>
</div>
</div>
}
</form>
6 changes: 6 additions & 0 deletions src/Core/AdminConsole/Entities/Organization.cs
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,12 @@ public class Organization : ITableObject<Guid>, IStorableSubscriber, IRevisable
/// </summary>
public bool UseMyItems { get; set; }

/// <summary>
/// When set to <see langword="true"/>, the organization is excluded from automated billing
/// lifecycle operations such as subscription cancellation and disabling for non-payment.
/// </summary>
public bool ExemptFromBillingAutomation { get; set; }

public void SetNewId()
{
if (Id == default(Guid))
Expand Down
9 changes: 6 additions & 3 deletions src/Sql/dbo/Stored Procedures/Organization_Create.sql
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ CREATE PROCEDURE [dbo].[Organization_Create]
@UseAutomaticUserConfirmation BIT = 0,
@UsePhishingBlocker BIT = 0,
@UseDisableSmAdsForUsers BIT = 0,
@UseMyItems BIT = 0
@UseMyItems BIT = 0,
@ExemptFromBillingAutomation BIT = 0
AS
BEGIN
SET NOCOUNT ON
Expand Down Expand Up @@ -133,7 +134,8 @@ BEGIN
[UsePhishingBlocker],
[MaxStorageGbIncreased],
[UseDisableSmAdsForUsers],
[UseMyItems]
[UseMyItems],
[ExemptFromBillingAutomation]
)
VALUES
(
Expand Down Expand Up @@ -201,6 +203,7 @@ BEGIN
@UsePhishingBlocker,
@MaxStorageGb,
@UseDisableSmAdsForUsers,
@UseMyItems
@UseMyItems,
@ExemptFromBillingAutomation
);
END
6 changes: 4 additions & 2 deletions src/Sql/dbo/Stored Procedures/Organization_Update.sql
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,8 @@ CREATE PROCEDURE [dbo].[Organization_Update]
@UseAutomaticUserConfirmation BIT = 0,
@UsePhishingBlocker BIT = 0,
@UseDisableSmAdsForUsers BIT = 0,
@UseMyItems BIT = 0
@UseMyItems BIT = 0,
@ExemptFromBillingAutomation BIT = 0
AS
BEGIN
SET NOCOUNT ON
Expand Down Expand Up @@ -133,7 +134,8 @@ BEGIN
[UsePhishingBlocker] = @UsePhishingBlocker,
[MaxStorageGbIncreased] = @MaxStorageGb,
[UseDisableSmAdsForUsers] = @UseDisableSmAdsForUsers,
[UseMyItems] = @UseMyItems
[UseMyItems] = @UseMyItems,
[ExemptFromBillingAutomation] = @ExemptFromBillingAutomation
WHERE
[Id] = @Id;
END
1 change: 1 addition & 0 deletions src/Sql/dbo/Tables/Organization.sql
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ CREATE TABLE [dbo].[Organization] (
[UsePhishingBlocker] BIT NOT NULL CONSTRAINT [DF_Organization_UsePhishingBlocker] DEFAULT (0),
[UseDisableSmAdsForUsers] BIT NOT NULL CONSTRAINT [DF_Organization_UseDisableSmAdsForUsers] DEFAULT (0),
[UseMyItems] BIT NOT NULL CONSTRAINT [DF_Organization_UseMyItems] DEFAULT (0),
[ExemptFromBillingAutomation] BIT NOT NULL CONSTRAINT [DF_Organization_ExemptFromBillingAutomation] DEFAULT (0),
CONSTRAINT [PK_Organization] PRIMARY KEY CLUSTERED ([Id] ASC)
);

Expand Down
3 changes: 2 additions & 1 deletion src/Sql/dbo/Views/OrganizationView.sql
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ SELECT
[UseAutomaticUserConfirmation],
[UsePhishingBlocker],
[UseDisableSmAdsForUsers],
[UseMyItems]
[UseMyItems],
[ExemptFromBillingAutomation]
FROM
[dbo].[Organization]
Loading
Loading