mirror of
https://github.com/bitwarden/server.git
synced 2025-02-16 01:51:21 +01:00
proration adjustments for next bill amount
This commit is contained in:
parent
89bb0a05e9
commit
d6d9ceab87
@ -196,7 +196,11 @@ namespace Bit.Core.Models.Business
|
||||
|
||||
public BillingInvoice(Subscription sub)
|
||||
{
|
||||
Amount = sub.NextBillAmount.GetValueOrDefault();
|
||||
Amount = sub.NextBillAmount.GetValueOrDefault() + sub.Balance.GetValueOrDefault();
|
||||
if(Amount < 0)
|
||||
{
|
||||
Amount = 0;
|
||||
}
|
||||
Date = sub.NextBillingDate;
|
||||
}
|
||||
|
||||
|
@ -40,7 +40,8 @@ namespace Bit.Core.Services
|
||||
AddOns = new AddOnsRequest(),
|
||||
Options = new SubscriptionOptionsRequest
|
||||
{
|
||||
ProrateCharges = true
|
||||
ProrateCharges = true,
|
||||
RevertSubscriptionOnProrationFailure = true
|
||||
}
|
||||
};
|
||||
|
||||
@ -64,7 +65,8 @@ namespace Bit.Core.Services
|
||||
new UpdateAddOnRequest
|
||||
{
|
||||
ExistingId = storageItem.Id,
|
||||
Quantity = additionalStorage
|
||||
Quantity = additionalStorage,
|
||||
NeverExpires = true
|
||||
}
|
||||
};
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user