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 @@ -23,7 +23,7 @@ page 8006 "Contract Renewal Selection"
field(AddVendorServicesCtrl; AddVendorServices)
{
CaptionClass = GetAddVendorServicesCaption();
#pragma warning disable AA0219
#pragma warning disable AA0219
ToolTip = 'Selecting this Option will also select and add the related Vendor Subscription Contract Lines.';
#pragma warning restore AA0219
trigger OnValidate()
Expand Down Expand Up @@ -279,10 +279,13 @@ page 8006 "Contract Renewal Selection"

trigger OnAfterGetRecord()
begin
InitializePageVariables();
Rec.GetServiceObject(ServiceObject);
Rec.LoadServiceCommitmentForContractLine(TempServiceCommitment);
RenewalTerm := TempServiceCommitment."Renewal Term";
RenewalTermEnabled := TempServiceCommitment."Subscription Header No." <> '';

LineCheckText := '';
LineFormatStyleExpression := '';
if not CheckContractLine(Rec) then begin
LineCheckText := CopyStr(GetLastErrorText(), 1, MaxStrLen(LineCheckText));
LineFormatStyleExpression := 'Attention';
Expand Down Expand Up @@ -347,17 +350,6 @@ page 8006 "Contract Renewal Selection"
exit(ServiceCommitment."Renewal Term" <> EmptyDateFormula);
end;


local procedure InitializePageVariables()
begin
if not TempServiceCommitment.Get(Rec."Subscription Line Entry No.") then
Clear(TempServiceCommitment);
RenewalTerm := TempServiceCommitment."Renewal Term";
RenewalTermEnabled := TempServiceCommitment."Subscription Header No." <> '';
if not ServiceObject.Get(Rec."Subscription Header No.") then
Clear(ServiceObject);
end;

local procedure AddVendorServicesToBuffer()
var
ServiceCommitmentVend: Record "Subscription Line";
Expand All @@ -368,8 +360,7 @@ page 8006 "Contract Renewal Selection"
repeat
if not TempServiceCommitmentVend.Get(ServiceCommitmentVend."Entry No.") then begin
TempServiceCommitmentVend := ServiceCommitmentVend;
TempServiceCommitmentVend.Insert(false)
;
TempServiceCommitmentVend.Insert(false);
end;
until ServiceCommitmentVend.Next() = 0;
end;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ page 8080 "Closed Cust. Cont. Line Subp."

trigger OnAfterGetRecord()
begin
InitializePageVariables();
Rec.GetServiceObject(ServiceObject);
Rec.LoadServiceCommitmentForContractLine(ServiceCommitment);
LoadQuantityForContractLine();
VariantCode := ServiceObject."Variant Code";
Expand All @@ -346,12 +346,6 @@ page 8080 "Closed Cust. Cont. Line Subp."
ContractLineQty: Decimal;
VariantCode: Code[10];

local procedure InitializePageVariables()
begin
Rec.GetServiceCommitment(ServiceCommitment);
Rec.GetServiceObject(ServiceObject);
end;

local procedure LoadQuantityForContractLine()
begin
ContractLineQty := ServiceObject.Quantity;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,10 @@ page 8068 "Customer Contract Line Subp."

trigger OnValidate()
begin
if not Rec.IsCommentLine() then
if not Rec.IsCommentLine() then begin
Rec.GetServiceObject(ServiceObject);
CurrPage.Update(false);
end;
end;

trigger OnAssistEdit()
Expand All @@ -134,8 +136,10 @@ page 8068 "Customer Contract Line Subp."
ToolTip = 'Specifies the description of the Subscription Line.';
trigger OnValidate()
begin
if not Rec.IsCommentLine() then
if not Rec.IsCommentLine() then begin
Rec.GetServiceCommitment(ServiceCommitment);
CurrPage.Update(false);
end;
end;
}
field("Service Object Quantity"; ContractLineQty)
Expand Down Expand Up @@ -308,6 +312,8 @@ page 8068 "Customer Contract Line Subp."
{
Caption = 'Billing Base Period';
ToolTip = 'Specifies for which period the Amount is valid. If you enter 1M here, a period of one month, or 12M, a period of 1 year, to which Amount refers to.';
Editable = not IsCommentLineEditable;
Enabled = not IsCommentLineEditable;

trigger OnValidate()
begin
Expand Down Expand Up @@ -593,9 +599,9 @@ page 8068 "Customer Contract Line Subp."

trigger OnAfterGetRecord()
begin
InitializePageVariables();
SetNextBillingDateStyle();
Rec.GetServiceObject(ServiceObject);
Rec.LoadServiceCommitmentForContractLine(ServiceCommitment);
SetNextBillingDateStyle();
LoadQuantityForContractLine();
VariantCode := ServiceObject."Variant Code";
end;
Expand Down Expand Up @@ -627,15 +633,10 @@ page 8068 "Customer Contract Line Subp."
ServiceObject: Record "Subscription Header";
ServiceCommitment: Record "Subscription Line";

local procedure InitializePageVariables()
var
begin
Rec.GetServiceCommitment(ServiceCommitment);
Rec.GetServiceObject(ServiceObject);
end;

local procedure UpdateServiceCommitmentOnPage(CalledByFieldNo: Integer)
begin
if Rec.IsCommentLine() then
exit;
ServiceCommitment.UpdateServiceCommitment(CalledByFieldNo);
CurrPage.Update();
end;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,9 @@ page 8075 "Customer Contract Lines"

trigger OnAfterGetRecord()
begin
InitializePageVariables();
SetNextBillingDateStyle();
Rec.GetServiceObject(ServiceObject);
Rec.LoadServiceCommitmentForContractLine(ServiceCommitment);
SetNextBillingDateStyle();
LoadQuantityForContractLine();
end;

Expand All @@ -224,13 +224,6 @@ page 8075 "Customer Contract Lines"
ContractLineQty: Decimal;
VariantCode: Code[10];

local procedure InitializePageVariables()
var
begin
Rec.GetServiceCommitment(ServiceCommitment);
Rec.GetServiceObject(ServiceObject);
end;

local procedure SetNextBillingDateStyle()
begin
if (ServiceCommitment."Next Billing Date" > ServiceCommitment."Subscription Line End Date") and (ServiceCommitment."Subscription Line End Date" <> 0D) then
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,8 @@ page 8091 "Select Cust. Contract Lines"
}
trigger OnAfterGetRecord()
begin
InitializePageVariables();
end;

local procedure InitializePageVariables()
var
begin
ServiceObject.Get(Rec."Subscription Header No.");
ServiceCommitment.Get(Rec."Subscription Line Entry No.");
Rec.GetServiceObject(ServiceObject);
Rec.LoadServiceCommitmentForContractLine(ServiceCommitment);
end;

local procedure ErrorIfMoreThanOneLineIsSelected(var CustomerContractLine: Record "Cust. Sub. Contract Line")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -284,18 +284,22 @@ table 8062 "Cust. Sub. Contract Line"

procedure LoadServiceCommitmentForContractLine(var ServiceCommitment: Record "Subscription Line")
var
LocalServiceCommitment: Record "Subscription Line"; //in case the parameter is passed as temporary table
LocalServiceCommitment: Record "Subscription Line";
begin
ServiceCommitment.Init();
if "Subscription Contract No." = '' then
exit;
case "Contract Line Type" of
Enum::"Contract Line Type"::Item,
Enum::"Contract Line Type"::"G/L Account":
if GetServiceCommitment(LocalServiceCommitment) then begin
LocalServiceCommitment.CalcFields(Quantity);
ServiceCommitment.TransferFields(LocalServiceCommitment);
end;
if ServiceCommitment.IsTemporary then begin
if GetServiceCommitment(LocalServiceCommitment) then begin
LocalServiceCommitment.CalcFields(Quantity);
ServiceCommitment.TransferFields(LocalServiceCommitment);
end;
end else
if GetServiceCommitment(ServiceCommitment) then
ServiceCommitment.CalcFields(Quantity);
end;
OnAfterLoadAmountsForContractLine(Rec, ServiceCommitment);
end;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -317,7 +317,7 @@ page 8089 "Closed Vend. Cont. Line Subp."

trigger OnAfterGetRecord()
begin
InitializePageVariables();
Rec.GetServiceObject(ServiceObject);
Rec.LoadServiceCommitmentForContractLine(ServiceCommitment);
end;

Expand All @@ -331,10 +331,4 @@ page 8089 "Closed Vend. Cont. Line Subp."
ServiceCommitment: Record "Subscription Line";
ServiceObject: Record "Subscription Header";
ContractsGeneralMgt: Codeunit "Sub. Contracts General Mgt.";

local procedure InitializePageVariables()
begin
Rec.GetServiceCommitment(ServiceCommitment);
Rec.GetServiceObject(ServiceObject);
end;
}
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,8 @@ page 8092 "Select Vend. Contract Lines"
}
trigger OnAfterGetRecord()
begin
InitializePageVariables();
end;

local procedure InitializePageVariables()
var
begin
ServiceObject.Get(Rec."Subscription Header No.");
ServiceCommitment.Get(Rec."Subscription Line Entry No.");
Rec.GetServiceObject(ServiceObject);
Rec.LoadServiceCommitmentForContractLine(ServiceCommitment);
end;

local procedure ErrorIfMoreThanOneLineIsSelected(var VendorContractLine: Record "Vend. Sub. Contract Line")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,10 @@ page 8078 "Vendor Contract Line Subpage"

trigger OnValidate()
begin
if not Rec.IsCommentLine() then
if not Rec.IsCommentLine() then begin
Rec.GetServiceObject(ServiceObject);
CurrPage.Update(false);
end;
end;

trigger OnAssistEdit()
Expand All @@ -119,8 +121,10 @@ page 8078 "Vendor Contract Line Subpage"
ToolTip = 'Specifies the description of the Subscription Line.';
trigger OnValidate()
begin
if not Rec.IsCommentLine() then
if not Rec.IsCommentLine() then begin
Rec.GetServiceCommitment(ServiceCommitment);
CurrPage.Update(false);
end;
end;
}
field("Service Object Quantity"; ServiceCommitment.Quantity)
Expand Down Expand Up @@ -276,6 +280,8 @@ page 8078 "Vendor Contract Line Subpage"
{
Caption = 'Billing Base Period';
ToolTip = 'Specifies for which period the Amount is valid. If you enter 1M here, a period of one month, or 12M, a period of 1 year, to which Amount refers to.';
Editable = not IsCommentLineEditable;
Enabled = not IsCommentLineEditable;

trigger OnValidate()
begin
Expand Down Expand Up @@ -561,9 +567,9 @@ page 8078 "Vendor Contract Line Subpage"

trigger OnAfterGetRecord()
begin
InitializePageVariables();
SetNextBillingDateStyle();
Rec.GetServiceObject(ServiceObject);
Rec.LoadServiceCommitmentForContractLine(ServiceCommitment);
SetNextBillingDateStyle();
end;

trigger OnAfterGetCurrRecord()
Expand Down Expand Up @@ -591,15 +597,10 @@ page 8078 "Vendor Contract Line Subpage"
ServiceObject: Record "Subscription Header";
ServiceCommitment: Record "Subscription Line";

local procedure InitializePageVariables()
var
begin
Rec.GetServiceCommitment(ServiceCommitment);
Rec.GetServiceObject(ServiceObject);
end;

local procedure UpdateServiceCommitmentOnPage(CalledByFieldNo: Integer)
begin
if Rec.IsCommentLine() then
exit;
ServiceCommitment.UpdateServiceCommitment(CalledByFieldNo);
CurrPage.Update();
end;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -269,20 +269,23 @@ table 8065 "Vend. Sub. Contract Line"

internal procedure LoadServiceCommitmentForContractLine(var ServiceCommitment: Record "Subscription Line")
var
LocalServiceCommitment: Record "Subscription Line"; //in case the parameter is passed as temporary table
LocalServiceCommitment: Record "Subscription Line";
begin
ServiceCommitment.Init();
if "Subscription Contract No." = '' then
exit;
case "Contract Line Type" of
Enum::"Contract Line Type"::Item,
Enum::"Contract Line Type"::"G/L Account":
begin
GetServiceCommitment(LocalServiceCommitment);
LocalServiceCommitment.CalcFields(Quantity);
ServiceCommitment.TransferFields(LocalServiceCommitment);
end;
end
if ServiceCommitment.IsTemporary then begin
if GetServiceCommitment(LocalServiceCommitment) then begin
LocalServiceCommitment.CalcFields(Quantity);
ServiceCommitment.TransferFields(LocalServiceCommitment);
end;
end else
if GetServiceCommitment(ServiceCommitment) then
ServiceCommitment.CalcFields(Quantity);
end;
end;

internal procedure GetServiceCommitment(var ServiceCommitment: Record "Subscription Line"): Boolean
Expand Down
Loading