Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

GP - Enhancements to Payment Terms creation, visibility of unposted batches, and Migration Log #25831

Merged
merged 7 commits into from
Feb 12, 2024
Merged
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 @@ -118,5 +118,6 @@ permissionset 4031 "HybridGP - Edit"
tabledata "GP PM10200" = IMD,
tabledata "GP PM30300" = IMD,
tabledata "GP RM20201" = IMD,
tabledata "GP RM30201" = IMD;
tabledata "GP RM30201" = IMD,
tabledata "GP Migration Warnings" = IMD;
}
Original file line number Diff line number Diff line change
Expand Up @@ -153,5 +153,8 @@ permissionset 4029 "HybridGP - Objects"
table "GP PM10200" = X,
table "GP PM30300" = X,
table "GP RM20201" = X,
table "GP RM30201" = X;
table "GP RM30201" = X,
table "GP Migration Warnings" = X,
page "GP Migration Warnings" = X,
page "GP Payment Terms" = X;
}
Original file line number Diff line number Diff line change
Expand Up @@ -118,5 +118,6 @@ permissionset 4032 "HybridGP - Read"
tabledata "GP PM10200" = R,
tabledata "GP PM30300" = R,
tabledata "GP RM20201" = R,
tabledata "GP RM30201" = R;
tabledata "GP RM30201" = R,
tabledata "GP Migration Warnings" = R;
}
Original file line number Diff line number Diff line change
Expand Up @@ -110,5 +110,6 @@ permissionsetextension 4028 "INTELLIGENT CLOUD - HGP" extends "INTELLIGENT CLOUD
tabledata "GP PM10200" = RIMD,
tabledata "GP PM30300" = RIMD,
tabledata "GP RM20201" = RIMD,
tabledata "GP RM30201" = RIMD;
tabledata "GP RM30201" = RIMD,
tabledata "GP Migration Warnings" = RIMD;
}
Original file line number Diff line number Diff line change
Expand Up @@ -109,5 +109,6 @@ permissionsetextension 4025 "D365 BASIC - HGP" extends "D365 BASIC"
tabledata "GP PM10200" = RIMD,
tabledata "GP PM30300" = RIMD,
tabledata "GP RM20201" = RIMD,
tabledata "GP RM30201" = RIMD;
tabledata "GP RM30201" = RIMD,
tabledata "GP Migration Warnings" = RIMD;
}
Original file line number Diff line number Diff line change
Expand Up @@ -108,5 +108,6 @@ permissionsetextension 4026 "D365 BASIC ISV - HGP" extends "D365 BASIC ISV"
tabledata "GP PM10200" = RIMD,
tabledata "GP PM30300" = RIMD,
tabledata "GP RM20201" = RIMD,
tabledata "GP RM30201" = RIMD;
tabledata "GP RM30201" = RIMD,
tabledata "GP Migration Warnings" = RIMD;
}
Original file line number Diff line number Diff line change
Expand Up @@ -109,5 +109,6 @@ permissionsetextension 4027 "D365 TEAM MEMBER - HGP" extends "D365 TEAM MEMBER"
tabledata "GP PM10200" = RIMD,
tabledata "GP PM30300" = RIMD,
tabledata "GP RM20201" = RIMD,
tabledata "GP RM30201" = RIMD;
tabledata "GP RM30201" = RIMD,
tabledata "GP Migration Warnings" = RIMD;
}
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ codeunit 4017 "GP Account Migrator"
PostingGroupDescriptionTxt: Label 'Migrated from GP', Locked = true;
DescriptionTrxTxt: Label 'Migrated transaction', Locked = true;
BeginningBalanceTrxTxt: Label 'Beginning Balance', Locked = true;
MigrationLogAreaTxt: Label 'Account', Locked = true;

#if not CLEAN22
#pragma warning disable AA0207
Expand All @@ -28,6 +29,7 @@ codeunit 4017 "GP Account Migrator"
var
GPAccount: Record "GP Account";
GPCompanyAdditionalSettings: Record "GP Company Additional Settings";
GPMigrationWarnings: Record "GP Migration Warnings";
AccountNum: Code[20];
begin
if RecordIdToMigrate.TableNo() <> Database::"GP Account" then
Expand All @@ -39,8 +41,10 @@ codeunit 4017 "GP Account Migrator"
GPAccount.Get(RecordIdToMigrate);

AccountNum := CopyStr(GPAccount.AcctNum.Trim(), 1, 20);
if AccountNum = '' then
if AccountNum = '' then begin
GPMigrationWarnings.InsertWarning(MigrationLogAreaTxt, 'Account Index: ' + Format(GPAccount.AcctIndex), 'Account is skipped because there is no account number.');
exit;
end;

MigrateAccountDetails(GPAccount, Sender);
end;
Expand Down
119 changes: 119 additions & 0 deletions Apps/W1/HybridGP/app/src/Migration/Support/GPPaymentTerms.Page.al
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
namespace Microsoft.DataMigration.GP;

page 40134 "GP Payment Terms"
{
ApplicationArea = All;
Caption = 'GP Payment Terms';
PageType = Worksheet;
SourceTable = "GP Payment Terms";
UsageCategory = Lists;
InsertAllowed = false;
DeleteAllowed = false;
Editable = true;

layout
{
area(content)
{
repeater(General)
{
field(DateFormulaIsValid; DateFormulaIsValid)
{
Caption = 'Valid Date Formula';
ToolTip = 'Indicates if the resulting date formula is valid.';
Editable = false;
}
field(CalculatedDateFormula; CalculatedDateFormulaTxt)
{
Caption = 'Calculated Date Formula';
ToolTip = 'Calculated Date Formula';
Editable = false;
Style = Unfavorable;
StyleExpr = not DateFormulaIsValid;
}
field(PYMTRMID; Rec.PYMTRMID)
{
ToolTip = 'Specifies the value of the Payment Terms ID field.';
}
field(DUETYPE; Rec.DUETYPE)
{
ToolTip = 'Specifies the value of the Due Type field.';
}
field(DUEDTDS; Rec.DUEDTDS)
{
ToolTip = 'Specifies the value of the Due Date/Days field.';
}
field(DISCTYPE; Rec.DISCTYPE)
{
ToolTip = 'Specifies the value of the Discount Type field.';
}
field(DISCDTDS; Rec.DISCDTDS)
{
ToolTip = 'Specifies the value of the Discount Date/Days field.';
}
field(DSCLCTYP; Rec.DSCLCTYP)
{
ToolTip = 'Specifies the value of the Discount Calculate Type field.';
}
field(DSCPCTAM; Rec.DSCPCTAM)
{
ToolTip = 'Specifies the value of the Discount Percent Amount field.';
}
field(TAX; Rec.TAX)
{
ToolTip = 'Specifies the value of the Tax field.';
}
field(CBUVATMD; Rec.CBUVATMD)
{
ToolTip = 'Specifies the value of the CB_Use_VAT_Mode field.';
}
field(USEGRPER; Rec.USEGRPER)
{
ToolTip = 'Specifies the value of the Use Grace Periods field.';
}
field(CalculateDateFrom; Rec.CalculateDateFrom)
{
ToolTip = 'Specifies the value of the Calculate Date From field.';
}
field(CalculateDateFromDays; Rec.CalculateDateFromDays)
{
ToolTip = 'Specifies the value of the Calculate Date From Days field.';
}
field(DueMonth; Rec.DueMonth)
{
ToolTip = 'Specifies the value of the Due Month field.';
}
field(DiscountMonth; Rec.DiscountMonth)
{
ToolTip = 'Specifies the value of the Discount Month field.';
}
}
}
}

trigger OnAfterGetRecord()
jaymckinney-enavate marked this conversation as resolved.
Show resolved Hide resolved
begin
UpdateRecordStatus();
end;


trigger OnAfterGetCurrRecord()
begin
UpdateRecordStatus();
end;

trigger OnModifyRecord(): Boolean
begin
UpdateRecordStatus();
exit(true);
end;

local procedure UpdateRecordStatus()
begin
DateFormulaIsValid := Rec.GetCalculatedDateForumla(CalculatedDateFormulaTxt);
end;

var
CalculatedDateFormulaTxt: Text[50];
DateFormulaIsValid: Boolean;
}
Original file line number Diff line number Diff line change
Expand Up @@ -97,5 +97,33 @@ table 4026 "GP Payment Terms"
Clustered = true;
}
}

internal procedure GetCalculatedDateForumla(var CalculatedDateFormulaTxt: Text[50]): Boolean
var
HelperFunctions: Codeunit "Helper Functions";
DueDateCalculation: DateFormula;
DiscountDateCalculation: DateFormula;
DueDateCalculationText: Text[50];
DiscountDateCalculationText: Text[50];
DateFormulaIsValid: Boolean;
begin
DateFormulaIsValid := false;
DiscountDateCalculationText := HelperFunctions.CalculateDiscountDateFormula(Rec);
CalculatedDateFormulaTxt := DiscountDateCalculationText;
if Evaluate(DiscountDateCalculation, DiscountDateCalculationText) then begin
if Rec.CalculateDateFrom = Rec.CalculateDateFrom::"Transaction Date" then begin
DueDateCalculationText := HelperFunctions.CalculateDueDateFormula(Rec, false, '');
CalculatedDateFormulaTxt := DueDateCalculationText;
end else begin
DueDateCalculationText := HelperFunctions.CalculateDueDateFormula(Rec, true, CopyStr(DiscountDateCalculationText, 1, 32));
CalculatedDateFormulaTxt := DueDateCalculationText;
end;

if Evaluate(DueDateCalculation, DueDateCalculationText) then
DateFormulaIsValid := true;
end;

exit(DateFormulaIsValid);
end;
}

Loading
Loading