Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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 @@ -2,8 +2,6 @@ namespace Microsoft.SubscriptionBilling;

codeunit 8010 "Calculation Base By Perc" implements "Contract Price Update"
{
Access = Internal;

var
PriceUpdateTemplate: Record "Price Update Template";
ServiceCommitment: Record "Subscription Line";
Expand Down Expand Up @@ -37,6 +35,7 @@ codeunit 8010 "Calculation Base By Perc" implements "Contract Price Update"
ContractPriceUpdateLine.UpdateFromContract(ServiceCommitment.Partner, ServiceCommitment."Subscription Contract No.");
CalculateNewPrice(PriceUpdateTemplate."Update Value %", ContractPriceUpdateLine);
ContractPriceUpdateLine."Next Price Update" := CalcDate(PriceUpdateTemplate."Price Binding Period", ContractPriceUpdateLine."Perform Update On");
OnAfterCalculateNewPriceForSubscriptionLine(ServiceCommitment, ContractPriceUpdateLine, PriceUpdateTemplate, PerformUpdateOnDate);
if ContractPriceUpdateLine.ShouldContractPriceUpdateLineBeInserted() then
ContractPriceUpdateLine.Insert(false)
else
Expand All @@ -51,4 +50,9 @@ codeunit 8010 "Calculation Base By Perc" implements "Contract Price Update"
NewContractPriceUpdateLine."New Calculation Base" := NewContractPriceUpdateLine."Old Calculation Base";
NewContractPriceUpdateLine.CalculateNewPrice();
end;

[IntegrationEvent(false, false)]
internal procedure OnAfterCalculateNewPriceForSubscriptionLine(SubscriptionLine: Record "Subscription Line"; var SubContrPriceUpdateLine: Record "Sub. Contr. Price Update Line"; PriceUpdateTemplate: Record "Price Update Template"; PerformUpdateOnDate: Date)
begin
end;
}
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,6 @@ using Microsoft.Finance.Currency;

codeunit 8012 "Price By Percent" implements "Contract Price Update"
{
Access = Internal;

var
PriceUpdateTemplate: Record "Price Update Template";
ServiceCommitment: Record "Subscription Line";
Expand Down Expand Up @@ -39,6 +37,7 @@ codeunit 8012 "Price By Percent" implements "Contract Price Update"
ContractPriceUpdateLine.UpdateFromContract(ServiceCommitment.Partner, ServiceCommitment."Subscription Contract No.");
CalculateNewPrice(PriceUpdateTemplate."Update Value %", ContractPriceUpdateLine);
ContractPriceUpdateLine."Next Price Update" := CalcDate(PriceUpdateTemplate."Price Binding Period", ContractPriceUpdateLine."Perform Update On");
OnAfterCalculateNewPriceForSubscriptionLine(ServiceCommitment, ContractPriceUpdateLine, PriceUpdateTemplate, PerformUpdateOnDate);
if ContractPriceUpdateLine.ShouldContractPriceUpdateLineBeInserted() then
ContractPriceUpdateLine.Insert(false)
else
Expand All @@ -60,4 +59,9 @@ codeunit 8012 "Price By Percent" implements "Contract Price Update"
NewContractPriceUpdateLine."New Amount" := NewContractPriceUpdateLine."New Amount" - NewContractPriceUpdateLine."Discount Amount";
NewContractPriceUpdateLine."Additional Amount" := NewContractPriceUpdateLine."New Amount" - NewContractPriceUpdateLine."Old Amount";
end;

[IntegrationEvent(false, false)]
internal procedure OnAfterCalculateNewPriceForSubscriptionLine(SubscriptionLine: Record "Subscription Line"; var SubContrPriceUpdateLine: Record "Sub. Contr. Price Update Line"; PriceUpdateTemplate: Record "Price Update Template"; PerformUpdateOnDate: Date)
begin
end;
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,6 @@ namespace Microsoft.SubscriptionBilling;

codeunit 8011 "Recent Item Price" implements "Contract Price Update"
{
Access = Internal;

var
PriceUpdateTemplate: Record "Price Update Template";
ServiceCommitment: Record "Subscription Line";
Expand Down Expand Up @@ -37,6 +35,7 @@ codeunit 8011 "Recent Item Price" implements "Contract Price Update"
ContractPriceUpdateLine.UpdateFromContract(ServiceCommitment.Partner, ServiceCommitment."Subscription Contract No.");
CalculateNewPrice(PriceUpdateTemplate."Update Value %", ContractPriceUpdateLine);
ContractPriceUpdateLine."Next Price Update" := CalcDate(PriceUpdateTemplate."Price Binding Period", ContractPriceUpdateLine."Perform Update On");
OnAfterCalculateNewPriceForSubscriptionLine(ServiceCommitment, ContractPriceUpdateLine, PriceUpdateTemplate, PerformUpdateOnDate);
if ContractPriceUpdateLine.ShouldContractPriceUpdateLineBeInserted() then
ContractPriceUpdateLine.Insert(false)
else
Expand All @@ -51,4 +50,9 @@ codeunit 8011 "Recent Item Price" implements "Contract Price Update"
NewContractPriceUpdateLine.CalculateNewCalculationBaseAmount();
NewContractPriceUpdateLine.CalculateNewPrice();
end;

[IntegrationEvent(false, false)]
internal procedure OnAfterCalculateNewPriceForSubscriptionLine(SubscriptionLine: Record "Subscription Line"; var SubContrPriceUpdateLine: Record "Sub. Contr. Price Update Line"; PriceUpdateTemplate: Record "Price Update Template"; PerformUpdateOnDate: Date)
begin
end;
}
Original file line number Diff line number Diff line change
Expand Up @@ -1686,6 +1686,7 @@ table 8059 "Subscription Line"
Rec.Modify(true);
Rec.SetSkipArchiving(false);
Rec.CreateServiceCommitmentArchive(ServiceCommitmentArchive, xServiceCommitment, CalcDate('<-1D>', ContractPriceUpdateLine."Perform Update On"), Enum::"Type Of Price Update"::"Price Update");
OnAfterUpdateServiceCommitmentFromContractPriceUpdateLine(Rec, ContractPriceUpdateLine);
end;

internal procedure ServiceCommitmentArchiveExistsForPeriodExists(var ServiceCommitmentArchive: Record "Subscription Line Archive"; RecurringBillingFrom: Date; RecurringBillingTo: Date): Boolean
Expand Down Expand Up @@ -2082,4 +2083,9 @@ table 8059 "Subscription Line"
local procedure OnBeforeCheckServiceDates(ServiceStartDate: Date; ServiceEndDate: Date; NextBillingDate: Date; var IsHandled: Boolean)
begin
end;

[IntegrationEvent(false, false)]
local procedure OnAfterUpdateServiceCommitmentFromContractPriceUpdateLine(var SubscriptionLine: Record "Subscription Line"; SubContractPriceUpdateLine: Record "Sub. Contr. Price Update Line")
begin
end;
}
Loading