', Locked = true;
+ begin
+ exit(RemoveHistory(Value, RemoveFromLbl));
+ end;
+
+ local procedure RemoveGmailHistory(Value: Text): Text
+ var
+ RemoveFromLbl: Label '
', Locked = true;
+ begin
+ exit(RemoveHistory(Value, RemoveFromLbl));
+ end;
+
+ local procedure RemoveYahooHistory(Value: Text): Text
+ var
+ RemoveFromLbl: Label '
'' then
- EXTTopCustomerBalance.SetFilter(EXTTopCustomerBalance.InitialEntryGlobalDim1Code, EXRTopReportBuffer.GetFilter("Global Dimension 1 Filter"));
-
- if EXRTopReportBuffer.GetFilter("Global Dimension 2 Filter") <> '' then
- EXTTopCustomerBalance.SetFilter(EXTTopCustomerBalance.InitialEntryGlobalDim2Code, EXRTopReportBuffer.GetFilter("Global Dimension 2 Filter"));
-
- if EXRTopReportBuffer.GetFilter("Currency Code") <> '' then
- EXTTopCustomerBalance.SetFilter(EXTTopCustomerBalance.Currency_Code, EXRTopReportBuffer.GetFilter("Currency Code"));
-
- if EXRTopReportBuffer.GetFilter("Customer Posting Group") <> '' then
- EXTTopCustomerBalance.SetFilter(EXTTopCustomerBalance.CustomerPostingGroup, EXRTopReportBuffer.GetFilter("Customer Posting Group"));
-
- if EXRTopReportBuffer.GetFilter("Date Filter") <> '' then
- EXTTopCustomerBalance.SetFilter(EXTTopCustomerBalance.Posting_Date, EXRTopReportBuffer.GetFilter("Date Filter"));
- end;
-
- local procedure TransferFilters(var EXTTopCustomerSale: Query "EXR Top Customer Sales"; var EXRTopReportBuffer: Record "EXR Top Customer Report Buffer")
- begin
- EXTTopCustomerSale.TopNumberOfRows := NoOfRecordsToPrint;
- if EXRTopReportBuffer.GetFilter("Global Dimension 1 Filter") <> '' then
- EXTTopCustomerSale.SetFilter(EXTTopCustomerSale.GlobalDimension1Code, EXRTopReportBuffer.GetFilter("Global Dimension 1 Filter"));
-
- if EXRTopReportBuffer.GetFilter("Global Dimension 2 Filter") <> '' then
- EXTTopCustomerSale.SetFilter(EXTTopCustomerSale.GlobalDimension2Code, EXRTopReportBuffer.GetFilter("Global Dimension 2 Filter"));
-
- if EXRTopReportBuffer.GetFilter("Currency Code") <> '' then
- EXTTopCustomerSale.SetFilter(EXTTopCustomerSale.Currency_Code, EXRTopReportBuffer.GetFilter("Currency Code"));
-
- if EXRTopReportBuffer.GetFilter("Customer Posting Group") <> '' then
- EXTTopCustomerSale.SetFilter(EXTTopCustomerSale.CustomerPostingGroup, EXRTopReportBuffer.GetFilter("Customer Posting Group"));
-
- if EXRTopReportBuffer.GetFilter("Date Filter") <> '' then
- EXTTopCustomerSale.SetFilter(EXTTopCustomerSale.Posting_Date, EXRTopReportBuffer.GetFilter("Date Filter"));
- end;
-}
diff --git a/Apps/W1/ExcelReports/app/src/Customer/EXRTopCustomerBalance.Query.al b/Apps/W1/ExcelReports/app/src/Customer/EXRTopCustomerBalance.Query.al
deleted file mode 100644
index 3560552528..0000000000
--- a/Apps/W1/ExcelReports/app/src/Customer/EXRTopCustomerBalance.Query.al
+++ /dev/null
@@ -1,44 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-
-namespace Microsoft.Sales.ExcelReports;
-
-using Microsoft.Sales.Receivables;
-
-query 4403 "EXR Top Customer Balance"
-{
- Caption = 'Top Customer Balance';
- OrderBy = descending(Balance_LCY);
-
- elements
- {
- dataitem(Detailed_Customer_Ledger_Entry; "Detailed Cust. Ledg. Entry")
- {
- column(Customer_No; "Customer No.")
- {
- }
- column(Balance_LCY; "Amount (LCY)")
- {
- Method = Sum;
- }
-
- filter(Posting_Date; "Posting Date")
- {
- }
- filter(InitialEntryGlobalDim1Code; "Initial Entry Global Dim. 1")
- {
- }
- filter(InitialEntryGlobalDim2Code; "Initial Entry Global Dim. 2")
- {
- }
- filter(Currency_Code; "Currency Code")
- {
- }
- filter(CustomerPostingGroup; "Posting Group")
- {
- }
- }
- }
-}
diff --git a/Apps/W1/ExcelReports/app/src/Customer/EXRTopCustomerReportBuffer.Table.al b/Apps/W1/ExcelReports/app/src/Customer/EXRTopCustomerReportBuffer.Table.al
deleted file mode 100644
index 2030baa07a..0000000000
--- a/Apps/W1/ExcelReports/app/src/Customer/EXRTopCustomerReportBuffer.Table.al
+++ /dev/null
@@ -1,128 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-
-namespace Microsoft.Sales.ExcelReports;
-
-using Microsoft.Sales.Customer;
-using Microsoft.Finance.Currency;
-using Microsoft.Finance.Dimension;
-
-table 4405 "EXR Top Customer Report Buffer"
-{
- Access = Internal;
- Caption = 'Top Customer Data';
- DataClassification = CustomerContent;
- TableType = Temporary;
- ReplicateData = false;
-
- fields
- {
- field(1; "Customer No."; Code[20])
- {
- Caption = 'Customer No.';
- TableRelation = "Customer";
- }
- field(2; "Customer Name"; Text[200])
- {
- Caption = 'Name';
- }
- field(10; "Amount (LCY)"; Decimal)
- {
- Caption = 'Amount (LCY)';
- CaptionClass = '3,' + GetAmount1Caption();
- }
- field(12; "Amount 2 (LCY)"; Decimal)
- {
- Caption = 'Amount 2 (LCY)';
- CaptionClass = '3,' + GetAmount2Caption();
- }
- field(13; "Ranking Based On"; Option)
- {
- Caption = 'Ranking Based On';
- OptionCaption = 'Sales (LCY), Balance (LCY)';
- OptionMembers = "Sales (LCY)","Balance (LCY)";
- }
- field(44; "Customer Posting Group"; Code[20])
- {
- Caption = 'Customer Posting Group';
- TableRelation = "Customer Posting Group";
- FieldClass = FlowFilter;
- }
- field(45; "Currency Code"; Code[10])
- {
- Caption = 'Currency Code';
- TableRelation = Currency;
- FieldClass = FlowFilter;
- }
- field(46; "Period Start Date"; Date)
- {
- Caption = 'Period Start Date';
- }
- field(100; "Date Filter"; Date)
- {
- Caption = 'Date Filter';
- FieldClass = FlowFilter;
- }
- field(101; "Global Dimension 1 Filter"; Code[20])
- {
- CaptionClass = '1,3,1';
- Caption = 'Global Dimension 1 Filter';
- FieldClass = FlowFilter;
- TableRelation = "Dimension Value".Code where("Global Dimension No." = const(1));
- }
- field(102; "Global Dimension 2 Filter"; Code[20])
- {
- CaptionClass = '1,3,2';
- Caption = 'Global Dimension 2 Filter';
- FieldClass = FlowFilter;
- TableRelation = "Dimension Value".Code where("Global Dimension No." = const(2));
- }
- }
- keys
- {
- key(PK; "Customer No.", "Period Start Date", "Amount (LCY)")
- {
- Clustered = true;
- }
- }
-
- local procedure GetAmount1Caption(): Text
- var
- NewCaption: Text;
- Handled: Boolean;
- begin
- OnGetAmount1Caption(Handled, NewCaption);
- if not Handled then
- exit(AmountLCYTok);
-
- exit(NewCaption);
- end;
-
- local procedure GetAmount2Caption(): Text
- var
- NewCaption: Text;
- Handled: Boolean;
- begin
- OnGetAmount2Caption(Handled, NewCaption);
- if not Handled then
- exit(Amount2LCYTok);
-
- exit(NewCaption);
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnGetAmount1Caption(var Handled: Boolean; var NewCaption: Text)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnGetAmount2Caption(var Handled: Boolean; var NewCaption: Text)
- begin
- end;
-
- var
- AmountLCYTok: Label 'Amount (LCY)';
- Amount2LCYTok: Label 'Amount 2 (LCY)';
-}
diff --git a/Apps/W1/ExcelReports/app/src/Customer/EXRTopCustomerSales.Query.al b/Apps/W1/ExcelReports/app/src/Customer/EXRTopCustomerSales.Query.al
deleted file mode 100644
index b2d8983b05..0000000000
--- a/Apps/W1/ExcelReports/app/src/Customer/EXRTopCustomerSales.Query.al
+++ /dev/null
@@ -1,43 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-
-namespace Microsoft.Sales.ExcelReports;
-
-using Microsoft.Sales.Receivables;
-
-query 4404 "EXR Top Customer Sales"
-{
- Caption = 'Top Customer Sale';
- OrderBy = descending(Sum_Purch_LCY);
-
- elements
- {
- dataitem(Customer_Ledger_Entry; "Cust. Ledger Entry")
- {
- column(Customer_No; "Customer No.")
- {
- }
- column(Sum_Purch_LCY; "Sales (LCY)")
- {
- Method = Sum;
- }
- filter(GlobalDimension1Code; "Global Dimension 1 Code")
- {
- }
- filter(GlobalDimension2Code; "Global Dimension 2 Code")
- {
- }
- filter(Currency_Code; "Currency Code")
- {
- }
- filter(CustomerPostingGroup; "Customer Posting Group")
- {
- }
- filter(Posting_Date; "Posting Date")
- {
- }
- }
- }
-}
diff --git a/Apps/W1/ExcelReports/app/src/Customer/ExtTopCustCaptionHandler.Codeunit.al b/Apps/W1/ExcelReports/app/src/Customer/ExtTopCustCaptionHandler.Codeunit.al
deleted file mode 100644
index 1b99263a59..0000000000
--- a/Apps/W1/ExcelReports/app/src/Customer/ExtTopCustCaptionHandler.Codeunit.al
+++ /dev/null
@@ -1,49 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-
-namespace Microsoft.Sales.ExcelReports;
-
-codeunit 4405 "EXT Top Cust. Caption Handler"
-{
- EventSubscriberInstance = Manual;
- Access = Internal;
-
- [EventSubscriber(ObjectType::Table, Database::"EXR Top Customer Report Buffer", 'OnGetAmount1Caption', '', false, false)]
- local procedure GetAmount1Caption(var NewCaption: Text; var Handled: Boolean)
- begin
- if (EXTTopReportBuffer."Ranking Based On" = EXTTopReportBuffer."Ranking Based On"::"Balance (LCY)") then begin
- NewCaption := BalanceLCYTok;
- Handled := true;
- exit;
- end;
-
- NewCaption := SalesLCYTok;
- Handled := true;
- end;
-
- [EventSubscriber(ObjectType::Table, Database::"EXR Top Customer Report Buffer", 'OnGetAmount2Caption', '', false, false)]
- local procedure GetAmount2Caption(var NewCaption: Text; var Handled: Boolean)
- begin
- if EXTTopReportBuffer."Ranking Based On" <> EXTTopReportBuffer."Ranking Based On"::"Balance (LCY)" then begin
- NewCaption := BalanceLCYTok;
- Handled := true;
- exit;
- end;
-
- NewCaption := SalesLCYTok;
- Handled := true;
- end;
-
- internal procedure SetRankingBasedOn(NewRankingBasedOn: Option)
- begin
- EXTTopReportBuffer."Ranking Based On" := NewRankingBasedOn;
- end;
-
- var
- EXTTopReportBuffer: Record "EXR Top Customer Report Buffer";
- BalanceLCYTok: Label 'Balance (LCY)';
- SalesLCYTok: Label 'Sales (LCY)';
-
-}
\ No newline at end of file
diff --git a/Apps/W1/ExcelReports/app/src/ExcelReportsTelemetry.Codeunit.al b/Apps/W1/ExcelReports/app/src/ExcelReportsTelemetry.Codeunit.al
deleted file mode 100644
index 2a9b262927..0000000000
--- a/Apps/W1/ExcelReports/app/src/ExcelReportsTelemetry.Codeunit.al
+++ /dev/null
@@ -1,31 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-
-namespace Microsoft.ExcelReports;
-using System.Telemetry;
-
-codeunit 4412 "Excel Reports Telemetry"
-{
- Access = Internal;
- InherentEntitlements = X;
- InherentPermissions = X;
-
- var
- FeatureNameLbl: Label '1st Party Excel Layout Reports', Locked = true;
-
- internal procedure GetFeatureTelemetryName(): Text
- begin
- exit(FeatureNameLbl);
- end;
-
- internal procedure LogReportUsage(ReportId: Integer)
- var
- FeatureTelemetry: Codeunit "Feature Telemetry";
- CustomDimensions: Dictionary of [Text, Text];
- begin
- CustomDimensions.Add('ReportId', Format(ReportId));
- FeatureTelemetry.LogUsage('0000NWG', GetFeatureTelemetryName(), 'Running report', CustomDimensions);
- end;
-}
\ No newline at end of file
diff --git a/Apps/W1/ExcelReports/app/src/Financials/EXRAgedAccPayableExcel.Report.al b/Apps/W1/ExcelReports/app/src/Financials/EXRAgedAccPayableExcel.Report.al
deleted file mode 100644
index 4edcf53fd2..0000000000
--- a/Apps/W1/ExcelReports/app/src/Financials/EXRAgedAccPayableExcel.Report.al
+++ /dev/null
@@ -1,368 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-
-namespace Microsoft.Finance.ExcelReports;
-
-using Microsoft.Purchases.Vendor;
-using Microsoft.Purchases.Payables;
-using Microsoft.Finance.Dimension;
-using Microsoft.Finance.GeneralLedger.Setup;
-using Microsoft.ExcelReports;
-
-report 4403 "EXR Aged Acc Payable Excel"
-{
- ApplicationArea = All;
- Caption = 'Aged Accounts Payable Excel (Preview)';
- DataAccessIntent = ReadOnly;
- DefaultRenderingLayout = AgedAccountsPayableExcel;
- ExcelLayoutMultipleDataSheets = true;
- PreviewMode = PrintLayout;
- UsageCategory = ReportsAndAnalysis;
- MaximumDatasetSize = 1000000;
-
- dataset
- {
- dataitem(VendorAgingData; Vendor)
- {
- DataItemTableView = sorting("No.");
- RequestFilterFields = "No.", "Vendor Posting Group", "Currency Code";
- PrintOnlyIfDetail = true;
-
- column(VendorNumber; VendorAgingData."No.")
- {
- IncludeCaption = true;
- }
- column(VendorName; VendorAgingData.Name)
- {
- IncludeCaption = true;
- }
- dataitem(AgingData; "EXR Aging Report Buffer")
- {
- DataItemTableView = sorting("Vendor Source No.");
- DataItemLink = "Vendor Source No." = field("No.");
-
- column(PeriodStart;
- "Period Start Date")
- {
- IncludeCaption = true;
- }
- column(PeriodEnd; "Period End Date")
- {
- IncludeCaption = true;
- }
- column(RemainingAmount; "Remaining Amount")
- {
- IncludeCaption = true;
- }
- column(OriginalAmount; "Original Amount")
- {
- IncludeCaption = true;
- }
- column(RemainingAmountLCY; "Remaining Amount (LCY)")
- {
- IncludeCaption = true;
- }
- column(OriginalAmountLCY; "Original Amount (LCY)")
- {
- IncludeCaption = true;
- }
- column(Dimension1Code; "Dimension 1 Code")
- {
- IncludeCaption = true;
- }
- column(Dimension2Code; "Dimension 2 Code")
- {
- IncludeCaption = true;
- }
- column(CurrencyCode; CurrencyCodeDisplayCode)
- {
- }
- column(PostingDate; "Posting Date")
- {
- IncludeCaption = true;
- }
- column(DocumentDate; "Document Date")
- {
- IncludeCaption = true;
- }
- column(DueDate; "Due Date")
- {
- IncludeCaption = true;
- }
- column(ReportingDate; "Reporting Date")
- {
- IncludeCaption = true;
- }
- column(ReportingDate_Month; "Reporting Date Month")
- {
- IncludeCaption = true;
- }
- column(ReportingDate_Quarter; "Reporting Date Quarter")
- {
- IncludeCaption = true;
- }
- column(ReportingDate_Year; "Reporting Date Year")
- {
- IncludeCaption = true;
- }
- column(EntryNo; "Entry No.")
- {
- IncludeCaption = true;
- }
- }
-
- trigger OnAfterGetRecord()
- begin
- Clear(AgingData);
- AgingData.DeleteAll();
- InsertAgingData(VendorAgingData);
-
- if AgingData."Currency Code" = '' then
- CurrencyCodeDisplayCode := GeneralLedgerSetup.GetCurrencyCode('')
- else
- CurrencyCodeDisplayCode := AgingData."Currency Code";
- end;
- }
-
- dataitem(Dimension1; "Dimension Value")
- {
- DataItemTableView = sorting("Code") where("Global Dimension No." = const(1));
-
- column(Dim1Code; Dimension1."Code")
- {
- IncludeCaption = true;
- }
- column(Dim1Name; Dimension1.Name)
- {
- IncludeCaption = true;
- }
-
- trigger OnPreDataItem()
- begin
- VendorAgingData.CopyFilter("Global Dimension 1 Filter", Dimension1.Code);
- end;
- }
- dataitem(Dimension2; "Dimension Value")
- {
- DataItemTableView = sorting("Code") where("Global Dimension No." = const(2));
-
- column(Dim2Code; Dimension2."Code")
- {
- IncludeCaption = true;
- }
- column(Dim2Name; Dimension2.Name)
- {
- IncludeCaption = true;
- }
-
- trigger OnPreDataItem()
- begin
- VendorAgingData.CopyFilter("Global Dimension 2 Filter", Dimension2.Code);
- end;
- }
- }
- requestpage
- {
- SaveValues = true;
- AboutTitle = 'Aged Accounts Payable Excel';
- AboutText = 'This report contains aggregated aging data based on vendor ledger entries. The data is aggregated and bucketed according to the ‘Aged as of'' and ‘period length'' parameters in the reports request page. The aggregated data is summarized per the 2 global dimensions.';
-
- layout
- {
- area(content)
- {
- group(Options)
- {
- Caption = 'Options';
- field(AgedAsOfOption; EndingDate)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Aged As Of';
- ToolTip = 'Specifies the date that you want the aging calculated for.';
- }
- field(AgingbyOption; TempEXRAgingReportBuffer."Aged By")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Aging by';
- OptionCaption = 'Due Date,Posting Date,Document Date';
- ToolTip = 'Specifies if the aging will be calculated from the due date, the posting date, or the document date.';
-
- trigger OnValidate()
- begin
- GlobalEXTAgedAccCaptionHandler.SetGlobalEXRAgingReportBuffer(TempEXRAgingReportBuffer);
- end;
- }
- field(PeriodLengthOption; PeriodLength)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Period Length';
- ToolTip = 'Specifies the period for which data is sent to the report. For example, enter "-1M" for one month, "-30D" for thirty days, "-3Q" for three quarters, or "-5Y" for five years.';
- }
- field(PeriodCountOption; PeriodCount)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Period Count';
- ToolTip = 'Specifies the number of periods for which data is sent to the report.';
- }
- field("Skip Zero Balance Vendors"; SkipZeroBalanceVendors)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Skip Vendors with Zero Balance';
- ToolTip = 'Specifies if you want to skip Vendors with a zero balance in the report.';
- }
- }
- }
- }
-
- trigger OnOpenPage()
- begin
- if EndingDate = 0D then
- EndingDate := WorkDate();
- if Format(PeriodLength) = '' then
- Evaluate(PeriodLength, '<-1M>');
-
- if not GeneralLedgerSetup.Get() then
-#pragma warning disable AA0205
- GeneralLedgerSetup.Insert();
-#pragma warning restore AA0205
- end;
- }
-
- rendering
- {
- layout(AgedAccountsPayableExcel)
- {
- Type = Excel;
- LayoutFile = './ReportLayouts/Excel/Purchase/AgedAccountsPayableExcel.xlsx';
- Caption = 'Aged Accounts Payable Excel';
- Summary = 'Built in layout for Aged Account Payable. Pivot tables can be used to view the data per LCY and FCY and analyse amounts due by currency. Report uses Query connections.';
- }
- }
- labels
- {
- ByPeriodLCY = 'By period (LCY)';
- BalanceLCY = 'Balance (LCY)';
- AgedAccountsPayableByPeriodLCY = 'Aged Accounts Payable by Period (LCY)';
- OpenAmountsInLCY = 'Open amounts in LCY';
- ByPeriodFCY = 'By Period (FCY)';
- BalanceFCY = 'Balance (FCY)';
- AgedAccountsPayableByPeriodFCY = 'Aged Accounts Payable by Period (FCY)';
- OpenAmountsInFCY = 'Open amounts in FCY';
- AgedAccountsPayableDueByCurrencyFCY = 'Aged Accounts Payable due by Currency (FCY)';
- DueDateMonth = 'Due Date (Month)';
- DueDateQuarter = 'Due Date (Quarter)';
- DueDateYear = 'Due Date (Year)';
- PostingDateYear = 'Posting Date (Year)';
- PostingDateMonth = 'Posting Date (Month)';
- PostingDateQuarter = 'Posting Date (Quarter)';
- DocumentDateMonth = 'Document Date (Month)';
- DocumentDateQuarter = 'Document Date (Quarter)';
- DocumentDateYear = 'Document Date (Year)';
- DueByCurrencies = 'Due by Currencies';
- OpenByFCY = 'Open by (FCY)';
- DataRetrieved = 'Data retrieved:';
- CurrencyCodeDisplay = 'Currency Code';
- }
-
- var
- ExcelReportsTelemetry: Codeunit "Excel Reports Telemetry";
-
- protected var
- TempEXRAgingReportBuffer: Record "EXR Aging Report Buffer" temporary;
- GeneralLedgerSetup: Record "General Ledger Setup";
- GlobalEXTAgedAccCaptionHandler: Codeunit "EXT Aged Acc. Caption Handler";
- PeriodLength: DateFormula;
- SkipZeroBalanceVendors: Boolean;
- EndingDate: Date;
- PeriodCount: Integer;
- PeriodEnds: List of [Date];
- PeriodStarts: List of [Date];
- CurrencyCodeDisplayCode: Code[20];
-#if not CLEAN25
-#pragma warning disable AA0137
- [Obsolete('Will be deleted', '25.0')]
- AgingBy: Option "Due Date","Posting Date","Document Date";
-#pragma warning restore AA0137
-#endif
-
- trigger OnPreReport()
- begin
- ExcelReportsTelemetry.LogReportUsage(Report::"EXR Aged Acc Payable Excel");
- InitReport();
- BindSubscription(GlobalEXTAgedAccCaptionHandler);
- GlobalEXTAgedAccCaptionHandler.SetGlobalEXRAgingReportBuffer(TempEXRAgingReportBuffer);
- end;
-
- local procedure InitReport()
- var
- FirstStartDate: Date;
- WorkingEndDate: Date;
- WorkingStartDate: Date;
- i: Integer;
- begin
- if Format(PeriodLength) = '' then
- Evaluate(PeriodLength, '<-1M>');
-
- if PeriodCount = 0 then
- PeriodCount := 5;
-
- WorkingEndDate := EndingDate;
- WorkingStartDate := CalcDate(PeriodLength, WorkingEndDate);
- repeat
- i += 1;
- PeriodStarts.Add(WorkingStartDate);
- PeriodEnds.Add(WorkingEndDate);
-
- WorkingStartDate := CalcDate(PeriodLength, WorkingStartDate);
- WorkingEndDate := CalcDate(PeriodLength, WorkingEndDate);
- until i >= PeriodCount;
- FirstStartDate := WorkingStartDate;
-
- VendorAgingData.SetAutoCalcFields("Net Change (LCY)");
- VendorAgingData.SetRange("Date Filter", FirstStartDate, EndingDate);
- if SkipZeroBalanceVendors then
- VendorAgingData.SetFilter("Net Change (LCY)", '<>0');
- end;
-
- local procedure InsertAgingData(var Vendor: Record "Vendor")
- var
- VendorLedgerEntry: Record "Vendor Ledger Entry";
- begin
- VendorLedgerEntry.SetCurrentKey("Vendor No.", Open, Positive, "Due Date", "Currency Code");
- VendorLedgerEntry.SetRange("Vendor No.", Vendor."No.");
- VendorLedgerEntry.SetRange("Posting Date", 0D, EndingDate);
- VendorLedgerEntry.SetRange("Date Filter", 0D, EndingDate);
- VendorLedgerEntry.SetAutoCalcFields("Remaining Amt. (LCY)", "Remaining Amount", "Original Amount", "Original Amt. (LCY)");
- VendorLedgerEntry.SetFilter("Remaining Amt. (LCY)", '<>0');
- if VendorLedgerEntry.FindSet() then
- repeat
- AddVendorLedgerEntryToBuffer(VendorLedgerEntry);
- until VendorLedgerEntry.Next() = 0;
- end;
-
- local procedure AddVendorLedgerEntryToBuffer(var VendorLedgerEntry: Record "Vendor Ledger Entry")
- begin
- Clear(AgingData);
- AgingData."Entry No." := VendorLedgerEntry."Entry No.";
- AgingData."Vendor Source No." := VendorLedgerEntry."Vendor No.";
- AgingData."Source Name" := VendorLedgerEntry."Vendor Name";
- AgingData."Document No." := VendorLedgerEntry."Document No.";
- AgingData."Dimension 1 Code" := VendorLedgerEntry."Global Dimension 1 Code";
- AgingData."Dimension 2 Code" := VendorLedgerEntry."Global Dimension 2 Code";
- AgingData."Currency Code" := VendorLedgerEntry."Currency Code";
- AgingData."Posting Date" := VendorLedgerEntry."Posting Date";
- AgingData."Document Date" := VendorLedgerEntry."Document Date";
- AgingData."Due Date" := VendorLedgerEntry."Due Date";
- AgingData."Aged By" := TempEXRAgingReportBuffer."Aged By";
- AgingData.SetPeriodStartAndEndDate(PeriodStarts, PeriodEnds);
- AgingData.SetReportingDate();
- AgingData."Remaining Amount (LCY)" := VendorLedgerEntry."Remaining Amt. (LCY)";
- AgingData."Remaining Amount" := VendorLedgerEntry."Remaining Amount";
- AgingData."Original Amount (LCY)" := VendorLedgerEntry."Original Amt. (LCY)";
- AgingData."Original Amount" := VendorLedgerEntry."Original Amount";
- AgingData.Insert(true);
- end;
-}
-
diff --git a/Apps/W1/ExcelReports/app/src/Financials/EXRAgedAccountsRecExcel.Report.al b/Apps/W1/ExcelReports/app/src/Financials/EXRAgedAccountsRecExcel.Report.al
deleted file mode 100644
index 4827a79168..0000000000
--- a/Apps/W1/ExcelReports/app/src/Financials/EXRAgedAccountsRecExcel.Report.al
+++ /dev/null
@@ -1,368 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-
-namespace Microsoft.Finance.ExcelReports;
-
-using Microsoft.Sales.Customer;
-using Microsoft.Finance.Dimension;
-using Microsoft.Sales.Receivables;
-using Microsoft.Finance.GeneralLedger.Setup;
-using Microsoft.ExcelReports;
-
-report 4402 "EXR Aged Accounts Rec Excel"
-{
- ApplicationArea = All;
- Caption = 'Aged Accounts Receivable Excel (Preview)';
- DataAccessIntent = ReadOnly;
- DefaultRenderingLayout = AgedAccountsReceivableExcel;
- ExcelLayoutMultipleDataSheets = true;
- PreviewMode = PrintLayout;
- UsageCategory = ReportsAndAnalysis;
- MaximumDatasetSize = 1000000;
-
- dataset
- {
- dataitem(CustomerAgingData; Customer)
- {
- DataItemTableView = sorting("No.");
- RequestFilterFields = "No.", "Customer Posting Group", "Currency Code";
- PrintOnlyIfDetail = true;
-
- column(CustomerNumber; CustomerAgingData."No.")
- {
- IncludeCaption = true;
- }
- column(CustomerName; CustomerAgingData.Name)
- {
- IncludeCaption = true;
- }
- dataitem(AgingData; "EXR Aging Report Buffer")
- {
- DataItemTableView = sorting("Vendor Source No.");
- DataItemLink = "Vendor Source No." = field("No.");
-
- column(PeriodStart;
- "Period Start Date")
- {
- IncludeCaption = true;
- }
- column(PeriodEnd; "Period End Date")
- {
- IncludeCaption = true;
- }
- column(RemainingAmount; "Remaining Amount")
- {
- IncludeCaption = true;
- }
- column(OriginalAmount; "Original Amount")
- {
- IncludeCaption = true;
- }
- column(RemainingAmountLCY; "Remaining Amount (LCY)")
- {
- IncludeCaption = true;
- }
- column(OriginalAmountLCY; "Original Amount (LCY)")
- {
- IncludeCaption = true;
- }
- column(Dimension1Code; "Dimension 1 Code")
- {
- IncludeCaption = true;
- }
- column(Dimension2Code; "Dimension 2 Code")
- {
- IncludeCaption = true;
- }
- column(CurrencyCode; CurrencyCodeDisplayCode)
- {
- }
- column(PostingDate; "Posting Date")
- {
- IncludeCaption = true;
- }
- column(DocumentDate; "Document Date")
- {
- IncludeCaption = true;
- }
- column(DueDate; "Due Date")
- {
- IncludeCaption = true;
- }
- column(ReportingDate; "Reporting Date")
- {
- IncludeCaption = true;
- }
- column(ReportingDate_Month; "Reporting Date Month")
- {
- IncludeCaption = true;
- }
- column(ReportingDate_Quarter; "Reporting Date Quarter")
- {
- IncludeCaption = true;
- }
- column(ReportingDate_Year; "Reporting Date Year")
- {
- IncludeCaption = true;
- }
- column(EntryNo; "Entry No.")
- {
- IncludeCaption = true;
- }
- }
-
- trigger OnAfterGetRecord()
- begin
- Clear(AgingData);
- AgingData.DeleteAll();
- InsertAgingData(CustomerAgingData);
-
- if AgingData."Currency Code" = '' then
- CurrencyCodeDisplayCode := GeneralLedgerSetup.GetCurrencyCode('')
- else
- CurrencyCodeDisplayCode := AgingData."Currency Code";
- end;
- }
-
- dataitem(Dimension1; "Dimension Value")
- {
- DataItemTableView = sorting("Code") where("Global Dimension No." = const(1));
-
- column(Dim1Code; Dimension1."Code")
- {
- IncludeCaption = true;
- }
- column(Dim1Name; Dimension1.Name)
- {
- IncludeCaption = true;
- }
-
- trigger OnPreDataItem()
- begin
- CustomerAgingData.CopyFilter("Global Dimension 1 Filter", Dimension1.Code);
- end;
- }
- dataitem(Dimension2; "Dimension Value")
- {
- DataItemTableView = sorting("Code") where("Global Dimension No." = const(2));
-
- column(Dim2Code; Dimension2."Code")
- {
- IncludeCaption = true;
- }
- column(Dim2Name; Dimension2.Name)
- {
- IncludeCaption = true;
- }
-
- trigger OnPreDataItem()
- begin
- CustomerAgingData.CopyFilter("Global Dimension 2 Filter", Dimension2.Code);
- end;
- }
- }
- requestpage
- {
- SaveValues = true;
- AboutTitle = 'Aged Accounts Receivable Excel';
- AboutText = 'This report contains aggregated aging data based on customer ledger entries. The data is aggregated and bucketed according to the ‘Aged as of'' and ‘period length'' parameters in the reports request page. The aggregated data is summarized per the 2 global dimensions.';
-
- layout
- {
- area(content)
- {
- group(Options)
- {
- Caption = 'Options';
- field(AgedAsOfOption; EndingDate)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Aged As Of';
- ToolTip = 'Specifies the date that you want the aging calculated for.';
- }
- field(AgingbyOption; TempEXRAgingReportBuffer."Aged By")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Aging by';
- OptionCaption = 'Due Date,Posting Date,Document Date';
- ToolTip = 'Specifies if the aging will be calculated from the due date, the posting date, or the document date.';
-
- trigger OnValidate()
- begin
- GlobalEXTAgedAccCaptionHandler.SetGlobalEXRAgingReportBuffer(TempEXRAgingReportBuffer);
- end;
- }
- field(PeriodLengthOption; PeriodLength)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Period Length';
- ToolTip = 'Specifies the period for which data is sent to the report. For example, enter "-1M" for one month, "-30D" for thirty days, "-3Q" for three quarters, or "-5Y" for five years.';
- }
- field(PeriodCountOption; PeriodCount)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Period Count';
- ToolTip = 'Specifies the number of periods for which data is sent to the report.';
- }
- field("Skip Zero Balance Customers"; SkipZeroBalanceCustomers)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Skip Customers with Zero Balance';
- ToolTip = 'Specifies if you want to skip customers with a zero balance in the report.';
- }
- }
- }
- }
-
- trigger OnOpenPage()
- begin
- if EndingDate = 0D then
- EndingDate := WorkDate();
- if Format(PeriodLength) = '' then
- Evaluate(PeriodLength, '<-1M>');
-
- if not GeneralLedgerSetup.Get() then
-#pragma warning disable AA0205
- GeneralLedgerSetup.Insert();
-#pragma warning restore AA0205
- end;
- }
-
- rendering
- {
- layout(AgedAccountsReceivableExcel)
- {
- Type = Excel;
- LayoutFile = './ReportLayouts/Excel/Sales/AgedAccountsReceivableExcel.xlsx';
- Caption = 'Aged Accounts Receivable Excel';
- Summary = 'Built in layout for Aged Account Receivable. Pivot tables can be used to view the data per LCY and FCY and analyse amounts due by currency. Report uses Query connections.';
- }
- }
- labels
- {
- ByPeriodLCY = 'By period (LCY)';
- BalanceLCY = 'Balance (LCY)';
- AgedAccountsReceivableByPeriodLCY = 'Aged Accounts Receivable by Period (LCY)';
- OpenAmountsInLCY = 'Open amounts in LCY';
- ByPeriodFCY = 'By Period (FCY)';
- BalanceFCY = 'Balance (FCY)';
- AgedAccountsReceivableByPeriodFCY = 'Aged Accounts Receivable by Period (FCY)';
- OpenAmountsInFCY = 'Open amounts in FCY';
- AgedAccountsReceivableDueByCurrencyFCY = 'Aged Accounts Receivable due by Currency (FCY)';
- DueDateMonth = 'Due Date (Month)';
- DueDateQuarter = 'Due Date (Quarter)';
- DueDateYear = 'Due Date (Year)';
- PostingDateYear = 'Posting Date (Year)';
- PostingDateMonth = 'Posting Date (Month)';
- PostingDateQuarter = 'Posting Date (Quarter)';
- DocumentDateMonth = 'Document Date (Month)';
- DocumentDateQuarter = 'Document Date (Quarter)';
- DocumentDateYear = 'Document Date (Year)';
- DueByCurrencies = 'Due by Currencies';
- OpenByFCY = 'Open by (FCY)';
- DataRetrieved = 'Data retrieved:';
- CurrencyCodeDisplay = 'Currency Code';
- }
-
- var
- ExcelReportsTelemetry: Codeunit "Excel Reports Telemetry";
-
- protected var
- TempEXRAgingReportBuffer: Record "EXR Aging Report Buffer" temporary;
- GeneralLedgerSetup: Record "General Ledger Setup";
- GlobalEXTAgedAccCaptionHandler: Codeunit "EXT Aged Acc. Caption Handler";
- PeriodLength: DateFormula;
- SkipZeroBalanceCustomers: Boolean;
- EndingDate: Date;
- PeriodCount: Integer;
- PeriodEnds: List of [Date];
- PeriodStarts: List of [Date];
- CurrencyCodeDisplayCode: Code[20];
-#if not CLEAN25
-#pragma warning disable AA0137
- [Obsolete('Will be deleted', '25.0')]
- AgingBy: Option "Due Date","Posting Date","Document Date";
-#pragma warning restore AA0137
-#endif
-
- trigger OnPreReport()
- begin
- ExcelReportsTelemetry.LogReportUsage(Report::"EXR Aged Accounts Rec Excel");
- InitReport();
- BindSubscription(GlobalEXTAgedAccCaptionHandler);
- GlobalEXTAgedAccCaptionHandler.SetGlobalEXRAgingReportBuffer(TempEXRAgingReportBuffer);
- end;
-
- local procedure InitReport()
- var
- FirstStartDate: Date;
- WorkingEndDate: Date;
- WorkingStartDate: Date;
- i: Integer;
- begin
- if Format(PeriodLength) = '' then
- Evaluate(PeriodLength, '<-1M>');
-
- if PeriodCount = 0 then
- PeriodCount := 5;
-
- WorkingEndDate := EndingDate;
- WorkingStartDate := CalcDate(PeriodLength, WorkingEndDate);
- repeat
- i += 1;
- PeriodStarts.Add(WorkingStartDate);
- PeriodEnds.Add(WorkingEndDate);
-
- WorkingStartDate := CalcDate(PeriodLength, WorkingStartDate);
- WorkingEndDate := CalcDate(PeriodLength, WorkingEndDate);
- until i >= PeriodCount;
- FirstStartDate := WorkingStartDate;
-
- CustomerAgingData.SetAutoCalcFields("Net Change (LCY)");
- CustomerAgingData.SetRange("Date Filter", FirstStartDate, EndingDate);
- if SkipZeroBalanceCustomers then
- CustomerAgingData.SetFilter("Net Change (LCY)", '<>0');
- end;
-
- local procedure InsertAgingData(var Customer: Record Customer)
- var
- CustLedgerEntry: Record "Cust. Ledger Entry";
- begin
- CustLedgerEntry.SetCurrentKey("Customer No.", Open, Positive, "Due Date", "Currency Code");
- CustLedgerEntry.SetRange("Customer No.", Customer."No.");
- CustLedgerEntry.SetRange("Posting Date", 0D, EndingDate);
- CustLedgerEntry.SetRange("Date Filter", 0D, EndingDate);
- CustLedgerEntry.SetAutoCalcFields("Remaining Amt. (LCY)", "Remaining Amount", "Original Amount", "Original Amt. (LCY)");
- CustLedgerEntry.SetFilter("Remaining Amt. (LCY)", '<>0');
- if CustLedgerEntry.FindSet() then
- repeat
- AddCustLedgerEntryToBuffer(CustLedgerEntry);
- until CustLedgerEntry.Next() = 0;
- end;
-
- local procedure AddCustLedgerEntryToBuffer(var CustLedgerEntry: Record "Cust. Ledger Entry")
- begin
- Clear(AgingData);
- AgingData."Entry No." := CustLedgerEntry."Entry No.";
- AgingData."Vendor Source No." := CustLedgerEntry."Customer No.";
- AgingData."Source Name" := CustLedgerEntry."Customer Name";
- AgingData."Document No." := CustLedgerEntry."Document No.";
- AgingData."Dimension 1 Code" := CustLedgerEntry."Global Dimension 1 Code";
- AgingData."Dimension 2 Code" := CustLedgerEntry."Global Dimension 2 Code";
- AgingData."Currency Code" := CustLedgerEntry."Currency Code";
- AgingData."Posting Date" := CustLedgerEntry."Posting Date";
- AgingData."Document Date" := CustLedgerEntry."Document Date";
- AgingData."Due Date" := CustLedgerEntry."Due Date";
- AgingData."Aged By" := TempEXRAgingReportBuffer."Aged By";
- AgingData.SetPeriodStartAndEndDate(PeriodStarts, PeriodEnds);
- AgingData.SetReportingDate();
- AgingData."Remaining Amount (LCY)" := CustLedgerEntry."Remaining Amt. (LCY)";
- AgingData."Remaining Amount" := CustLedgerEntry."Remaining Amount";
- AgingData."Original Amount (LCY)" := CustLedgerEntry."Original Amt. (LCY)";
- AgingData."Original Amount" := CustLedgerEntry."Original Amount";
- AgingData.Insert();
- end;
-}
-
diff --git a/Apps/W1/ExcelReports/app/src/Financials/EXRAgingReportBuffer.Table.al b/Apps/W1/ExcelReports/app/src/Financials/EXRAgingReportBuffer.Table.al
deleted file mode 100644
index 6950906990..0000000000
--- a/Apps/W1/ExcelReports/app/src/Financials/EXRAgingReportBuffer.Table.al
+++ /dev/null
@@ -1,222 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-
-namespace Microsoft.Finance.ExcelReports;
-
-table 4401 "EXR Aging Report Buffer"
-{
- Caption = 'Aging Report Buffer';
- DataClassification = CustomerContent;
- TableType = Temporary;
- ReplicateData = false;
-
- fields
- {
- field(1; "Entry No."; Integer)
- {
- Caption = 'Entry No.';
- }
- field(2; "Period Start Date"; Date)
- {
- Caption = 'Period Start Date';
- }
- field(3; "Period End Date"; Date)
- {
- Caption = 'Period End Date';
- }
- field(4; "Vendor Source No."; Code[20])
- {
- Caption = 'Source No.';
- }
- field(10; "Document No."; Code[20])
- {
- Caption = 'Document No.';
- }
- field(11; "Posting Date"; Date)
- {
- Caption = 'Posting Date';
- }
- field(12; "Currency Code"; Code[20])
- {
- Caption = 'Currency Code';
- }
- field(13; "Remaining Amount"; Decimal)
- {
- Caption = 'Remaining Amount';
- }
- field(14; "Remaining Amount (LCY)"; Decimal)
- {
- Caption = 'Remaining Amount (LCY)';
- }
- field(15; "Dimension 1 Code"; Code[20])
- {
- CaptionClass = '1,2,1';
- Caption = 'Dimension 1 Code';
- }
- field(16; "Dimension 2 Code"; Code[20])
- {
- CaptionClass = '1,2,2';
- Caption = 'Dimension 2 Code';
- }
- field(20; "Original Amount"; Decimal)
- {
- Caption = 'Original Amount';
- }
- field(21; "Original Amount (LCY)"; Decimal)
- {
- Caption = 'Original Amount (LCY)';
- }
- field(22; "Due Date"; Date)
- {
- Caption = 'Due Date';
- }
- field(23; "Document Date"; Date)
- {
- Caption = 'Document Date';
- }
- field(25; "Source Name"; Text[100])
- {
- Caption = 'Source Name';
- }
- field(26; "Aged By"; Option)
- {
- Caption = 'Aged By';
- OptionMembers = "Due Date","Posting Date","Document Date";
- OptionCaption = 'Due Date, Posting Date, Document Date';
- }
- field(27; "Reporting Date"; Date)
- {
- Caption = 'Reporting Date';
- CaptionClass = '3,' + GetReportingDateCaption();
- }
- field(28; "Reporting Date Month"; Integer)
- {
- Caption = 'Reporting Date (Month)';
- CaptionClass = '3,' + GetReportingDateMonthCaption();
- }
- field(29; "Reporting Date Quarter"; Integer)
- {
- Caption = 'Reporting Date (Quarter)';
- CaptionClass = '3,' + GetReportingDateQuarterCaption();
- }
- field(30; "Reporting Date Year"; Integer)
- {
- Caption = 'Reporting Date (Year)';
- CaptionClass = '3,' + GetReportingDateYearCaption();
- }
- }
- keys
- {
- key(PK; "Entry No.")
- {
- Clustered = true;
- }
- key(Key1; "Vendor Source No.")
- {
- }
- }
-
- local procedure GetReportingDateCaption(): Text
- begin
- OnOverrideAgedBy(Rec);
- case Rec."Aged By" of
- Rec."Aged By"::"Document Date":
- exit(FieldCaption("Document Date"));
- Rec."Aged By"::"Due Date":
- exit(FieldCaption("Due Date"));
- Rec."Aged By"::"Posting Date":
- exit(FieldCaption("Posting Date"));
- end;
- end;
-
- local procedure GetReportingDateMonthCaption(): Text
- begin
- exit(StrSubstNo(MonthLbl, GetReportingDateCaption()));
- end;
-
- local procedure GetReportingDateQuarterCaption(): Text
- begin
- exit(StrSubstNo(QuarterLbl, GetReportingDateCaption()));
- end;
-
- local procedure GetReportingDateYearCaption(): Text
- begin
- exit(StrSubstNo(YearLbl, GetReportingDateCaption()));
- end;
-
- internal procedure SetReportingDate()
- begin
- case Rec."Aged By" of
- Rec."Aged By"::"Due Date":
- Rec."Reporting Date" := Rec."Due Date";
- Rec."Aged By"::"Posting Date":
- Rec."Reporting Date" := Rec."Posting Date";
- Rec."Aged By"::"Document Date":
- Rec."Reporting Date" := Rec."Document Date";
- end;
-
- Rec."Reporting Date Month" := Date2DMY(Rec."Reporting Date", 2);
- Rec."Reporting Date Year" := Date2DMY(Rec."Reporting Date", 3);
- Rec."Reporting Date Quarter" := GetQuarterIndex(Rec."Reporting Date");
- end;
-
- local procedure GetQuarterIndex(Date: Date): Integer
- begin
- exit((Date2DMY(Date, 2) - 1) div 3 + 1);
- end;
-
- internal procedure SetPeriodStartAndEndDate(PeriodStarts: List of [Date]; PeriodEnds: List of [Date])
- begin
- case Rec."Aged By" of
- Rec."Aged By"::"Due Date":
- begin
- Rec."Period Start Date" := FindPeriodStart(Rec."Due Date", PeriodStarts);
- Rec."Period End Date" := FindPeriodEnd(Rec."Due Date", PeriodEnds);
- end;
- Rec."Aged By"::"Posting Date":
- begin
- Rec."Period Start Date" := FindPeriodStart(Rec."Posting Date", PeriodStarts);
- Rec."Period End Date" := FindPeriodEnd(Rec."Posting Date", PeriodEnds);
- end;
- Rec."Aged By"::"Document Date":
- begin
- Rec."Period Start Date" := FindPeriodStart(Rec."Document Date", PeriodStarts);
- Rec."Period End Date" := FindPeriodEnd(Rec."Document Date", PeriodEnds);
- end;
- end;
- end;
-
- local procedure FindPeriodStart(WhatDate: Date; PeriodStarts: List of [Date]): Date
- var
- PossibleDate: Date;
- begin
- foreach PossibleDate in PeriodStarts do
- if WhatDate >= PossibleDate then
- exit(PossibleDate);
-
- exit(PossibleDate);
- end;
-
- local procedure FindPeriodEnd(WhatDate: Date; PeriodEnds: List of [Date]): Date
- var
- PossibleDate: Date;
- begin
- foreach PossibleDate in PeriodEnds do
- if WhatDate < PossibleDate then
- exit(PossibleDate);
-
- exit(PossibleDate);
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnOverrideAgedBy(var EXRAgingReportBuffer: Record "EXR Aging Report Buffer")
- begin
- end;
-
- var
- MonthLbl: Label '%1 (Month)', Comment = '%1 is Document Date, Due Date or Posting Date';
- QuarterLbl: Label '%1 (Quarter)', Comment = '%1 is Document Date, Due Date or Posting Date';
- YearLbl: Label '%1 (Year)', Comment = '%1 is Document Date, Due Date or Posting Date';
-}
diff --git a/Apps/W1/ExcelReports/app/src/Financials/EXRConsolidatedTrialBalance.Report.al b/Apps/W1/ExcelReports/app/src/Financials/EXRConsolidatedTrialBalance.Report.al
deleted file mode 100644
index 46b3efd2bb..0000000000
--- a/Apps/W1/ExcelReports/app/src/Financials/EXRConsolidatedTrialBalance.Report.al
+++ /dev/null
@@ -1,148 +0,0 @@
-namespace Microsoft.Finance.ExcelReports;
-
-using Microsoft.Finance.GeneralLedger.Account;
-using Microsoft.Finance.Dimension;
-using Microsoft.Finance.Consolidation;
-using Microsoft.ExcelReports;
-
-report 4410 "EXR Consolidated Trial Balance"
-{
- ApplicationArea = All;
- Caption = 'Consolidated Trial Balance Excel (Preview)';
- DataAccessIntent = ReadOnly;
- DefaultRenderingLayout = ConsolidatedTrialBalanceExcel;
- ExcelLayoutMultipleDataSheets = true;
- PreviewMode = PrintLayout;
- UsageCategory = ReportsAndAnalysis;
- MaximumDatasetSize = 1000000;
-
- dataset
- {
- dataitem(GLAccounts; "G/L Account")
- {
- DataItemTableView = sorting("No.");
- RequestFilterFields = "No.";
- column(AccountNumber; "No.") { IncludeCaption = true; }
- column(AccountName; Name) { IncludeCaption = true; }
- column(IncomeBalance; "Income/Balance") { IncludeCaption = true; }
- column(AccountCategory; "Account Category") { IncludeCaption = true; }
- column(AccountSubcategory; "Account Subcategory Descript.") { IncludeCaption = true; }
- column(AccountType; "Account Type") { IncludeCaption = true; }
- column(Indentation; Indentation) { IncludeCaption = true; }
- column(IndentedAccountName; IndentedAccountName) { }
-
- trigger OnAfterGetRecord()
- begin
- IndentedAccountName := PadStr('', GLAccounts.Indentation * 2, ' ') + GLAccounts.Name;
- end;
- }
- dataitem(Dimension1; "Dimension Value")
- {
- DataItemTableView = sorting("Code");
- UseTemporary = true;
-
- column(Dim1Code; Dimension1."Code") { IncludeCaption = true; }
- column(Dim1Name; Dimension1.Name) { IncludeCaption = true; }
- }
- dataitem(Dimension2; "Dimension Value")
- {
- DataItemTableView = sorting("Code");
- UseTemporary = true;
-
- column(Dim2Code; Dimension2."Code") { IncludeCaption = true; }
- column(Dim2Name; Dimension2.Name) { IncludeCaption = true; }
- }
- dataitem(BusinessUnits; "Business Unit")
- {
- DataItemTableView = sorting("Code");
- column(Code; Code) { IncludeCaption = true; }
- column(Name; Name) { IncludeCaption = true; }
- }
- dataitem(TrialBalanceData; "EXR Trial Balance Buffer")
- {
- RequestFilterFields = "Business Unit Code", "Net Change", Balance;
- column(Account; "G/L Account No.") { IncludeCaption = true; }
- column(Dimension1Code; "Dimension 1 Code") { IncludeCaption = true; }
- column(Dimension2Code; "Dimension 2 Code") { IncludeCaption = true; }
- column(NetChange; "Net Change") { IncludeCaption = true; }
- column(Balance; Balance) { IncludeCaption = true; }
- column(NetChangeACY; "Net Change (ACY)") { IncludeCaption = true; }
- column(BalanceACY; "Balance (ACY)") { IncludeCaption = true; }
- column(BusinessUnitCode; "Business Unit Code") { IncludeCaption = true; }
- }
- }
- requestpage
- {
- SaveValues = true;
- AboutTitle = 'Consolidated Trial Balance Excel';
- AboutText = 'This report contains Net Change or Balance of the different G/L Accounts for the selected period, aggregated per business unit.';
- layout
- {
- area(Content)
- {
- field(StartingDateField; StartingDate)
- {
- ApplicationArea = All;
- Caption = 'Starting Date';
- ClosingDates = true;
- ToolTip = 'Specifies the starting date of the period for which the report is generated.';
- }
- field(EndingDateField; EndingDate)
- {
- ApplicationArea = All;
- Caption = 'Ending Date';
- ClosingDates = true;
- ShowMandatory = true;
- ToolTip = 'Specifies the ending date of the period for which the report is generated.';
- }
- }
- }
- }
- rendering
- {
- layout(ConsolidatedTrialBalanceExcel)
- {
- Type = Excel;
- LayoutFile = './ReportLayouts/Excel/GeneralLedger/ConsolidatedTrialBalanceExcel.xlsx';
- Caption = 'Consolidated Trial Balance Excel';
- Summary = 'Built in layout for Consolidated Trial Balance.';
- }
- }
- labels
- {
- DataRetrieved = 'Data retrieved:';
- TrialBalanceLCY = 'Trial Balance (LCY)', Comment = 'Worksheet name, shouldn''t exceed 31 characters';
- TrialBalanceACY = 'Trial Balance (ACY)', Comment = 'Worksheet name, shouldn''t exceed 31 characters';
- TrialBalanceLCYByBusinessUnit = 'Trial Balance by Business Unit (LCY)';
- TrialBalanceACYByBusinessUnit = 'Trial Balance by Business Unit (ACY)';
- BlankBU = '(Blank)';
- Period = 'Period:';
- UntilDate = 'Until:';
- ByBusinessUnitLCY = 'By Business Unit (LCY)', Comment = 'Worksheet name, shouldn''t exceed 31 characters';
- ByBusinessUnitACY = 'By Business Unit (ACY)', Comment = 'Worksheet name, shouldn''t exceed 31 characters';
- }
-
- trigger OnPreReport()
- var
- BusinessUnit: Record "Business Unit";
- TrialBalance: Codeunit "Trial Balance";
- begin
- if EndingDate = 0D then
- Error(EnterAnEndingDateErr);
- if BusinessUnit.IsEmpty() then
- Error(NoBusinessUnitsErr);
-
- ExcelReportsTelemetry.LogReportUsage(Report::"EXR Consolidated Trial Balance");
- GLAccounts.SetRange("Date Filter", StartingDate, EndingDate);
-
- TrialBalance.ConfigureTrialBalance(true, true);
- TrialBalance.InsertTrialBalanceReportData(GLAccounts, Dimension1, Dimension2, TrialBalanceData);
- end;
-
- var
- ExcelReportsTelemetry: Codeunit "Excel Reports Telemetry";
- IndentedAccountName: Text;
- StartingDate, EndingDate : Date;
- EnterAnEndingDateErr: Label 'Please enter an ending date.';
- NoBusinessUnitsErr: Label 'There are no business units configured for the current company. Please run this report from the consolidation company.';
-}
\ No newline at end of file
diff --git a/Apps/W1/ExcelReports/app/src/Financials/EXRFixedAssetAnalysisExcel.Report.al b/Apps/W1/ExcelReports/app/src/Financials/EXRFixedAssetAnalysisExcel.Report.al
deleted file mode 100644
index d8048be54b..0000000000
--- a/Apps/W1/ExcelReports/app/src/Financials/EXRFixedAssetAnalysisExcel.Report.al
+++ /dev/null
@@ -1,246 +0,0 @@
-namespace Microsoft.Finance.ExcelReports;
-
-using Microsoft.FixedAssets.FixedAsset;
-using Microsoft.FixedAssets.Depreciation;
-using Microsoft.FixedAssets.Setup;
-using Microsoft.FixedAssets.Posting;
-using Microsoft.ExcelReports;
-
-report 4412 "EXR Fixed Asset Analysis Excel"
-{
- ApplicationArea = All;
- AdditionalSearchTerms = 'FA Analysis Excel,FA Analysis';
- Caption = 'Fixed Asset Analysis Excel (Preview)';
- DataAccessIntent = ReadOnly;
- DefaultRenderingLayout = FixedAssetAnalysisExcel;
- ExcelLayoutMultipleDataSheets = true;
- PreviewMode = PrintLayout;
- UsageCategory = ReportsAndAnalysis;
- MaximumDatasetSize = 1000000;
- dataset
- {
- dataitem(FixedAssetData; "Fixed Asset")
- {
- DataItemTableView = sorting("No.");
- RequestFilterFields = "No.", "FA Class Code", "FA Subclass Code";
- column(AssetNumber; "No.") { IncludeCaption = true; }
- column(AssetDescription; Description) { IncludeCaption = true; }
- column(FixedAssetClassCode; "FA Class Code") { IncludeCaption = true; }
- column(FixedAssetSubclassCode; "FA Subclass Code") { IncludeCaption = true; }
- column(FixedAssetLocationCode; "FA Location Code") { IncludeCaption = true; }
- column(BudgetedAsset; "Budgeted Asset") { IncludeCaption = true; }
- column(AcquisitionDateField; AcquisitionDate) { }
- column(DisposalDateField; DisposalDate) { }
- column(GlobalDimension1Code; "Global Dimension 1 Code") { IncludeCaption = true; }
- column(GlobalDimension2Code; "Global Dimension 2 Code") { IncludeCaption = true; }
- dataitem(FAPostingType; "FA Posting Type")
- {
- DataItemTableView = where("FA Entry" = const(true));
- column(FixedAssetPostingTypeNumber; "FA Posting Type No.") { IncludeCaption = true; }
- column(FixedAssetPostingTypeName; "FA Posting Type Name") { IncludeCaption = true; }
- column(BeforeStartingDate; BeforeStartingDate) { }
- column(AtEndingDate; AtEndingDate) { }
- column(NetChange; NetChange) { }
- trigger OnAfterGetRecord()
- var
- FADepreciationBook: Record "FA Depreciation Book";
- FAGeneralReport: Codeunit "FA General Report";
- BudgetDepreciation: Codeunit "Budget Depreciation";
- BeforeAmount, EndingAmount : Decimal;
- begin
- FADepreciationBook.Get(FixedAssetData."No.", DepreciationBookCode);
- AcquisitionDate := FADepreciationBook."Acquisition Date";
- DisposalDate := FADepreciationBook."Disposal Date";
- if BudgetReport then
- BudgetDepreciation.Calculate(FixedAssetData."No.", StartingDate - 1, EndingDate, DepreciationBookCode, BeforeAmount, EndingAmount);
-
- Period := Period::"Before Starting Date";
- BeforeStartingDate := GetFixedAssetPostedAmount(BeforeAmount, EndingAmount);
- BeforeStartingDate := FAGeneralReport.CalcFAPostedAmount(FixedAssetData."No.", FAPostingType."FA Posting Type No.", Period, StartingDate, EndingDate, DepreciationBookCode, BeforeAmount, EndingAmount, false, false);
- Period := Period::"At Ending Date";
- AtEndingDate := FAGeneralReport.CalcFAPostedAmount(FixedAssetData."No.", FAPostingType."FA Posting Type No.", Period, StartingDate, EndingDate, DepreciationBookCode, BeforeAmount, EndingAmount, false, false);
- Period := Period::"Net Change";
- NetChange := FAGeneralReport.CalcFAPostedAmount(FixedAssetData."No.", FAPostingType."FA Posting Type No.", Period, StartingDate, EndingDate, DepreciationBookCode, BeforeAmount, EndingAmount, false, false);
- end;
-
- trigger OnPreDataItem()
- begin
- AcquisitionDate := 0D;
- DisposalDate := 0D;
- end;
- }
- trigger OnAfterGetRecord()
- begin
- if ShouldSkipRecord() then
- CurrReport.Skip();
- end;
- }
- }
- requestpage
- {
- SaveValues = true;
- AboutTitle = 'Fixed Asset Analysis Excel';
- AboutText = 'This report shows different fixed asset details in the given time periods, such as book value, depreciation, and acquisitions. You can specify the starting and ending dates for the report, and whether you want to include only sold assets or include inactive fixed assets.';
- layout
- {
- area(Content)
- {
- group(Options)
- {
- Caption = 'Options';
- field(DepreciationBookCodeField; DepreciationBookCode)
- {
- ApplicationArea = All;
- Caption = 'Depreciation Book';
- TableRelation = "Depreciation Book";
- ToolTip = 'Specifies the code for the depreciation book to be included in the report or batch job.';
- ShowMandatory = true;
- }
- field(StartingDateField; StartingDate)
- {
- ApplicationArea = FixedAssets;
- Caption = 'Starting Date';
- ToolTip = 'Specifies the date when you want the report to start.';
- ShowMandatory = true;
- }
- field(EndingDateField; EndingDate)
- {
- ApplicationArea = FixedAssets;
- Caption = 'Ending Date';
- ToolTip = 'Specifies the date when you want the report to end.';
- ShowMandatory = true;
- }
- field(SalesReportField; SalesReport)
- {
- ApplicationArea = FixedAssets;
- Caption = 'Only Sold Assets';
- ToolTip = 'Specifies if you want the report to show information only for sold fixed assets.';
- }
- field(BudgetReportField; BudgetReport)
- {
- ApplicationArea = Suite;
- Caption = 'Budget Report';
- ToolTip = 'Specifies if you want the report to consider future depreciation and book value.';
- }
- field(IncludeInactiveField; IncludeInactive)
- {
- ApplicationArea = All;
- Caption = 'Include Inactive Fixed Assets';
- ToolTip = 'Specifies if you want to include inactive fixed assets in the report.';
- }
- }
- }
- }
- trigger OnOpenPage()
- var
- DepreciationBook: Record "Depreciation Book";
- FixedAssetPostingType: Record "FA Posting Type";
- FASetup: Record "FA Setup";
- begin
- EndingDate := WorkDate();
- StartingDate := CalcDate('<-1M>', EndingDate);
- if DepreciationBookCode = '' then begin
- if DepreciationBook.FindFirst() then
- DepreciationBookCode := DepreciationBook.Code;
- if FASetup.Get() then
- if FASetup."Default Depr. Book" <> '' then
- DepreciationBookCode := FASetup."Default Depr. Book";
- end;
- FixedAssetPostingType.CreateTypes();
- end;
- }
- rendering
- {
- layout(FixedAssetAnalysisExcel)
- {
- Type = Excel;
- LayoutFile = './ReportLayouts/Excel/FixedAsset/FixedAssetAnalysisExcel.xlsx';
- Caption = 'Fixed Asset Analysis Excel';
- Summary = 'Built in layout for Fixed Asset Analysis.';
- }
- }
- labels
- {
- DataRetrieved = 'Data retrieved:';
- FixedAssetAnalysis = 'Fixed Asset Analysis';
- BeforeStartingDateLabel = 'Before Starting Date';
- AtEndingDateLabel = 'At Ending Date';
- NetChangeLabel = 'Net Change';
- DepreciationBook = 'Depreciation Book';
- Period = 'Period:';
- BookValue = 'Book Value';
- AcquisitionDateLabel = 'Acquisition Date';
- DisposalDateLabel = 'Disposal Date';
- BookValueAnalysis = 'Book Value Analysis';
- AcquisitionCostAfter = 'Acquisition Cost After';
- AcquisitionCostBefore = 'Acquisition Cost Before';
- AcquisitionCostNetChange = 'Addition in Period';
- ProceedsOnDisposalNetChange = 'Disposal in Period';
- DepreciationNetChange = 'Depreciation in Period';
- DepreciationAfter = 'Depreciation After';
- DepreciationBefore = 'Depreciation Before';
- BookValueAfter = 'Book Value After';
- BookValueBefore = 'Book Value Before';
- }
-
- trigger OnPreReport()
- var
- DepreciationBook: Record "Depreciation Book";
- begin
- DepreciationBook.Get(DepreciationBookCode);
- if (StartingDate = 0D) or (EndingDate = 0D) then
- Error(SpecifyStartingAndEndingDatesErr);
- if StartingDate > EndingDate then
- Error(SpecifyStartingAndEndingDatesErr);
- ExcelReportsTelemetry.LogReportUsage(Report::"EXR Fixed Asset Analysis Excel");
- end;
-
- var
- ExcelReportsTelemetry: Codeunit "Excel Reports Telemetry";
- DepreciationBookCode: Code[10];
- StartingDate, EndingDate, AcquisitionDate, DisposalDate : Date;
- BeforeStartingDate, AtEndingDate, NetChange : Decimal;
- Period: Option "Before Starting Date","Net Change","At Ending Date";
- SalesReport, BudgetReport, IncludeInactive : Boolean;
- SpecifyStartingAndEndingDatesErr: Label 'Please specify valid starting and ending dates.';
-
- local procedure ShouldSkipRecord(): Boolean
- var
- FADepreciationBook: Record "FA Depreciation Book";
- begin
- if not FADepreciationBook.Get(FixedAssetData."No.", DepreciationBookCode) then
- exit(true);
- if FixedAssetData.Inactive and (not IncludeInactive) then
- exit(true);
- if FADepreciationBook."Acquisition Date" = 0D then
- exit(true);
- if FADepreciationBook."Acquisition Date" > EndingDate then
- exit(true);
- if SalesReport and ((FADepreciationBook."Disposal Date" > EndingDate) or (FADepreciationBook."Disposal Date" < StartingDate)) then
- exit(true);
- if (not SalesReport) and (FADepreciationBook."Disposal Date" > 0D) and (FADepreciationBook."Disposal Date" < StartingDate) then
- exit(true);
- exit(false);
- end;
-
- local procedure GetFixedAssetPostedAmount(BeforeAmount: Decimal; EndingAmount: Decimal): Decimal
- var
- FADepreciationBook: Record "FA Depreciation Book";
- FAGeneralReport: Codeunit "FA General Report";
- begin
- if FAPostingType."FA Posting Type No." = FADepreciationBook.FieldNo("Proceeds on Disposal") then
- exit(0);
- FADepreciationBook.Get(FixedAssetData."No.", DepreciationBookCode);
- if not SalesReport and (Period = Period::"at Ending Date") and SoldBeforeEndingDate(FADepreciationBook."Disposal Date") then
- exit(0);
- exit(FAGeneralReport.CalcFAPostedAmount(FixedAssetData."No.", FAPostingType."FA Posting Type No.", Period, StartingDate, EndingDate, DepreciationBookCode, BeforeAmount, EndingAmount, false, false));
- end;
-
- local procedure SoldBeforeEndingDate(DisposalDate: Date): Boolean
- begin
- if DisposalDate = 0D then
- exit(false);
- exit(DisposalDate <= EndingDate);
- end;
-
-}
\ No newline at end of file
diff --git a/Apps/W1/ExcelReports/app/src/Financials/EXRFixedAssetDetailsExcel.Report.al b/Apps/W1/ExcelReports/app/src/Financials/EXRFixedAssetDetailsExcel.Report.al
deleted file mode 100644
index 7c2cbbbe70..0000000000
--- a/Apps/W1/ExcelReports/app/src/Financials/EXRFixedAssetDetailsExcel.Report.al
+++ /dev/null
@@ -1,140 +0,0 @@
-namespace Microsoft.Finance.ExcelReports;
-
-using Microsoft.FixedAssets.FixedAsset;
-using Microsoft.FixedAssets.Depreciation;
-using Microsoft.FixedAssets.Setup;
-using Microsoft.FixedAssets.Ledger;
-using Microsoft.ExcelReports;
-
-report 4411 "EXR Fixed Asset Details Excel"
-{
- ApplicationArea = All;
- AdditionalSearchTerms = 'FA Details Excel,FA Details';
- Caption = 'Fixed Asset Details Excel (Preview)';
- DataAccessIntent = ReadOnly;
- DefaultRenderingLayout = FixedAssetDetailsExcel;
- ExcelLayoutMultipleDataSheets = true;
- PreviewMode = PrintLayout;
- UsageCategory = ReportsAndAnalysis;
- MaximumDatasetSize = 1000000;
-
- dataset
- {
- dataitem(FixedAssetData; "Fixed Asset")
- {
- DataItemTableView = sorting("No.");
- PrintOnlyIfDetail = true;
- RequestFilterFields = "No.", "FA Class Code", "FA Subclass Code", "Budgeted Asset", "FA Posting Date Filter";
- column(AssetNumber; "No.") { IncludeCaption = true; }
- column(AssetDescription; Description) { }
- column(FixedAssetClassCode; "FA Class Code") { IncludeCaption = true; }
- column(FixedAssetSubclassCode; "FA Subclass Code") { IncludeCaption = true; }
- column(FixedAssetLocation; "FA Location Code") { IncludeCaption = true; }
- column(BudgetedAsset; "Budgeted Asset") { IncludeCaption = true; }
- column(GlobalDimension1Code; "Global Dimension 1 Code") { IncludeCaption = true; }
- column(GlobalDimension2Code; "Global Dimension 2 Code") { IncludeCaption = true; }
- dataitem(FixedAssetLedgerEntry; "FA Ledger Entry")
- {
- DataItemTableView = sorting("FA No.", "Depreciation Book Code", "FA Posting Date");
- DataItemLink = "FA No." = field("No.");
- column(DocumentType; "Document Type") { IncludeCaption = true; }
- column(DocumentNumber; "Document No.") { IncludeCaption = true; }
- column(Description; Description) { IncludeCaption = true; }
- column(Amount; Amount) { IncludeCaption = true; }
- column(EntryNumber; "Entry No.") { IncludeCaption = true; }
- column(FixedAssetPostingType; "FA Posting Type") { IncludeCaption = true; }
- column(DepreciationDays; "No. of Depreciation Days") { IncludeCaption = true; }
- column(UserID; "User ID") { IncludeCaption = true; }
- column(PostingDate; "Posting Date") { IncludeCaption = true; }
- column(GLEntryNumber; "G/L Entry No.") { IncludeCaption = true; }
- column(FixedAssetPostingCategory; "FA Posting Category") { IncludeCaption = true; }
- column(DepreciationBookCode; "Depreciation Book Code") { IncludeCaption = true; }
- trigger OnPreDataItem()
- begin
- if DepreciationBookCode <> '' then
- FixedAssetLedgerEntry.SetRange("Depreciation Book Code", DepreciationBookCode);
- FixedAssetLedgerEntry.SetFilter("FA Posting Date", FixedAssetData.GetFilter("FA Posting Date Filter"));
- if not PrintReversedEntries then
- FixedAssetLedgerEntry.SetRange("Reversed", false);
- end;
- }
- trigger OnAfterGetRecord()
- begin
- if (not IncludeInactive) and FixedAssetData.Inactive then
- CurrReport.Skip();
- end;
- }
- }
- requestpage
- {
- SaveValues = true;
- AboutTitle = 'Fixed Asset Details Excel';
- AboutText = 'This report shows ledger entries for one or more fixed assets.';
- layout
- {
- area(content)
- {
- group(Options)
- {
- Caption = 'Options';
- field(DepreciationBook; DepreciationBookCode)
- {
- ApplicationArea = All;
- Caption = 'Depreciation Book';
- TableRelation = "Depreciation Book";
- ToolTip = 'Specifies the code for the depreciation book to be included in the report or batch job.';
- }
- field(IncludeReversedEntries; PrintReversedEntries)
- {
- ApplicationArea = All;
- Caption = 'Include Reversed Entries';
- ToolTip = 'Specifies if you want to include reversed fixed asset entries in the report.';
- }
- field(SkipInactive; IncludeInactive)
- {
- ApplicationArea = All;
- Caption = 'Include Inactive Fixed Assets';
- ToolTip = 'Specifies if you want to include inactive fixed assets in the report.';
- }
- }
- }
- }
-
- trigger OnOpenPage()
- var
- FASetup: Record "FA Setup";
- begin
- if not FASetup.Get() then
- exit;
- DepreciationBookCode := FASetup."Default Depr. Book";
- end;
-
- }
- rendering
- {
- layout(FixedAssetDetailsExcel)
- {
- Type = Excel;
- LayoutFile = './ReportLayouts/Excel/FixedAsset/FixedAssetDetailsExcel.xlsx';
- Caption = 'Fixed Asset Details Excel';
- Summary = 'Built in layout for Fixed Asset Details.';
- }
- }
- labels
- {
- DataRetrieved = 'Data retrieved:';
- FixedAssetDetails = 'Fixed Asset Details', Comment = 'Max length: 31. Excel worksheet name.';
- AssetDescriptionLabel = 'Asset Description';
- }
-
- var
- ExcelReportsTelemetry: Codeunit "Excel Reports Telemetry";
- DepreciationBookCode: Code[20];
- PrintReversedEntries, IncludeInactive : Boolean;
-
- trigger OnPreReport()
- begin
- ExcelReportsTelemetry.LogReportUsage(Report::"EXR Fixed Asset Details Excel");
- end;
-
-}
\ No newline at end of file
diff --git a/Apps/W1/ExcelReports/app/src/Financials/EXRFixedAssetProjected.Report.al b/Apps/W1/ExcelReports/app/src/Financials/EXRFixedAssetProjected.Report.al
deleted file mode 100644
index 8711b327a8..0000000000
--- a/Apps/W1/ExcelReports/app/src/Financials/EXRFixedAssetProjected.Report.al
+++ /dev/null
@@ -1,538 +0,0 @@
-namespace Microsoft.Finance.ExcelReports;
-
-using Microsoft.FixedAssets.FixedAsset;
-using Microsoft.FixedAssets.Depreciation;
-using Microsoft.FixedAssets.Setup;
-using Microsoft.Foundation.Period;
-using Microsoft.FixedAssets.Ledger;
-using Microsoft.ExcelReports;
-
-report 4413 "EXR Fixed Asset Projected"
-{
- ApplicationArea = All;
- AdditionalSearchTerms = 'FA Projected Value, FA Projected Value Excel';
- Caption = 'Fixed Asset Projected Value Excel (Preview)';
- DataAccessIntent = ReadOnly;
- DefaultRenderingLayout = FixedAssetProjectedValueExcel;
- ExcelLayoutMultipleDataSheets = true;
- PreviewMode = PrintLayout;
- UsageCategory = ReportsAndAnalysis;
- MaximumDatasetSize = 1000000;
- dataset
- {
- dataitem(FixedAssetData; "Fixed Asset")
- {
- DataItemTableView = sorting("No.");
- RequestFilterFields = "No.", "FA Class Code", "FA Subclass Code";
- PrintOnlyIfDetail = true;
- column(AssetNumber; "No.") { IncludeCaption = true; }
- column(AssetDescription; Description) { IncludeCaption = true; }
- column(FixedAssetClassCode; "FA Class Code") { IncludeCaption = true; }
- column(FixedAssetSubclassCode; "FA Subclass Code") { IncludeCaption = true; }
- column(FixedAssetLocationCode; "FA Location Code") { IncludeCaption = true; }
- column(GlobalDimension1Code; "Global Dimension 1 Code") { IncludeCaption = true; }
- column(GlobalDimension2Code; "Global Dimension 2 Code") { IncludeCaption = true; }
- dataitem(FixedAssetLedgerEntries; "FA Ledger Entry")
- {
- DataItemLink = "FA No." = field("No.");
- UseTemporary = true;
- column(FixedAssetPostingDate; "FA Posting Date") { IncludeCaption = true; }
- column(FixedAssetPostingType; "FA Posting Type") { IncludeCaption = true; }
- column(Amount; Amount) { IncludeCaption = true; }
- column(BookValue; BookValue) { }
- column(ProjectedEntry; ProjectedEntry) { }
- column(NumberOfDepreciationDays; "No. of Depreciation Days") { IncludeCaption = true; }
-
- trigger OnAfterGetRecord()
- var
- FADepreciationBook: Record "FA Depreciation Book";
- begin
- ProjectedEntry := FixedAssetLedgerEntries."Reason Code" = ProjectionTok;
-
- if FirstFixedAssetLedgerEntry then begin
- FADepreciationBook.SetFilter("FA Posting Date Filter", '<%1', FixedAssetLedgerEntries."FA Posting Date");
- FADepreciationBook.SetAutoCalcFields("Book Value");
- FADepreciationBook.Get(FixedAssetData."No.", SelectedDepreciationBookCode);
- BookValue := FADepreciationBook."Book Value";
- end;
- FirstFixedAssetLedgerEntry := false;
- BookValue += FixedAssetLedgerEntries.Amount;
- end;
- }
- trigger OnAfterGetRecord()
- begin
- Clear(GlobalFADepreciationBook);
- GlobalFADepreciationBook.SetAutoCalcFields("Book Value", "Custom 1");
- if not GlobalFADepreciationBook.Get(FixedAssetData."No.", GlobalDepreciationBook.Code) then;
-
- if ShouldFixedAssetBeSkipped(FixedAssetData) then
- CurrReport.Skip();
-
- InsertPostedAndProjectedEntries(FixedAssetData."No.", FixedAssetLedgerEntries);
- FirstFixedAssetLedgerEntry := true;
- end;
- }
- }
- requestpage
- {
- SaveValues = true;
- AboutTitle = 'Fixed Asset Projected Value Excel';
- AboutText = 'This report shows how Fixed Asset Ledger entries would look if depreciated in the given dates.';
- layout
- {
- area(Content)
- {
- group(Options)
- {
- Caption = 'Options';
- field(DepreciationBookCodeField; SelectedDepreciationBookCode)
- {
- ApplicationArea = All;
- Caption = 'Depreciation Book';
- TableRelation = "Depreciation Book";
- ToolTip = 'Specifies the code for the depreciation book to be included in the report or batch job.';
- ShowMandatory = true;
- }
- field(FirstDepreciationDateField; StartDateProjection)
- {
- ApplicationArea = All;
- Caption = 'First Depreciation Date';
- ToolTip = 'Specifies the date to be used as the first date in the period for which you want to calculate projected depreciation.';
- ShowMandatory = true;
- }
- field(SecondDepreciationDateField; EndDateProjection)
- {
- ApplicationArea = All;
- Caption = 'Last Depreciation Date';
- ToolTip = 'Specifies the Fixed Asset posting date of the last posted depreciation.';
- ShowMandatory = true;
- }
- field(PeriodLengthField; GlobalPeriodLength)
- {
- ApplicationArea = All;
- BlankZero = true;
- Caption = 'Number of Days';
- MinValue = 0;
- ToolTip = 'Specifies the length of the periods between the first depreciation date and the last depreciation date. The program then calculates depreciation for each period. If you leave this field blank, the program automatically sets the contents of this field to equal the number of days in a fiscal year, normally 360.';
-
- trigger OnValidate()
- begin
- if GlobalPeriodLength > 0 then
- GlobalUseAccountingPeriod := false;
- end;
- }
- field(DaysInFirstPeriodField; GlobalDaysInFirstPeriod)
- {
- ApplicationArea = All;
- BlankZero = true;
- Caption = 'No. of Days in First Period';
- MinValue = 0;
- ToolTip = 'Specifies the number of days that must be used for calculating the depreciation as of the first depreciation date, regardless of the actual number of days from the last depreciation entry. The number you enter in this field does not affect the total number of days from the starting date to the ending date.';
- }
- field(IncludePostedFromField; IncludePostedFrom)
- {
- ApplicationArea = All;
- Caption = 'Posted Entries From';
- ToolTip = 'Specifies the fixed asset posting date from which the report includes all types of posted entries.';
- }
- field(ProjectedDisposalField; GlobalProjectDisposal)
- {
- ApplicationArea = All;
- Caption = 'Projected Disposal';
- ToolTip = 'Specifies if you want the report to include projected disposals: the contents of the Projected Proceeds on Disposal field and the Projected Disposal Date field on the FA depreciation book.';
- }
- field(UseAccountingPeriodField; GlobalUseAccountingPeriod)
- {
- ApplicationArea = All;
- Caption = 'Use Accounting Period';
- ToolTip = 'Specifies if you want the periods between the starting date and the ending date to correspond to the accounting periods you have specified in the Accounting Period table. When you select this field, the Number of Days field is cleared.';
-
- trigger OnValidate()
- begin
- if GlobalUseAccountingPeriod then
- GlobalPeriodLength := 0;
- end;
- }
- }
- }
- }
-
- trigger OnOpenPage()
- var
- FASetup: Record "FA Setup";
- begin
- if not FASetup.Get() then
- exit;
- SelectedDepreciationBookCode := FASetup."Default Depr. Book";
- end;
-
- }
- rendering
- {
- layout(FixedAssetProjectedValueExcel)
- {
- Type = Excel;
- LayoutFile = './ReportLayouts/Excel/FixedAsset/FixedAssetProjectedValueExcel.xlsx';
- Caption = 'Fixed Asset Projected Value Excel';
- Summary = 'Built in layout for Fixed Asset Projected Value.';
- }
- }
- labels
- {
- DataRetrieved = 'Data retrieved:';
- FixedAssetProjectedValue = 'Fixed Asset Projected Value';
- ProjectedValue = 'Projected Value';
- BookValueCaption = 'Book Value';
- ProjectedEntryCaption = 'Projected entry';
- }
- trigger OnPreReport()
- begin
- GlobalDepreciationBook.Get(SelectedDepreciationBookCode);
- if (StartDateProjection = 0D) or (EndDateProjection = 0D) then
- Error(SpecifyStartingAndEndingDatesErr);
- if StartDateProjection > EndDateProjection then
- Error(SpecifyStartingAndEndingDatesErr);
- ExcelReportsTelemetry.LogReportUsage(Report::"EXR Fixed Asset Projected");
- end;
-
- var
- GlobalDepreciationBook: Record "Depreciation Book";
- GlobalFADepreciationBook: Record "FA Depreciation Book";
- ExcelReportsTelemetry: Codeunit "Excel Reports Telemetry";
- CalculateDepreciation: Codeunit "Calculate Depreciation";
- DepreciationCalculation: Codeunit "Depreciation Calculation";
- FADateCalculation: Codeunit "FA Date Calculation";
- CalculateDisposal: Codeunit "Calculate Disposal";
- TableDeprCalculation: Codeunit "Table Depr. Calculation";
- ProjectionTok: Label 'PROJECTED', Locked = true;
- SelectedDepreciationBookCode: Code[10];
- StartDateProjection, EndDateProjection : Date;
- BookValue: Decimal;
- GlobalPeriodLength: Integer;
- GlobalDaysInFirstPeriod: Integer;
- IncludePostedFrom: Date;
- GlobalProjectDisposal: Boolean;
- GlobalUseAccountingPeriod: Boolean;
- ProjectedEntry: Boolean;
- FirstFixedAssetLedgerEntry: Boolean;
- ConfigureAccountingPeriodsErr: Label 'There is no accounting period configured after %1. These accounting periods are required when using a fiscal year of 365 days and the setting ''Use Accounting Periods'' is enabled.', Comment = '%1 is a date';
- SpecifyStartingAndEndingDatesErr: Label 'Please specify valid starting and ending dates.';
- PeriodLengthErr: Label 'The period length must be greater than %1 and at most %2.', Comment = '%1, %2 - number of days';
-
- local procedure ShouldFixedAssetBeSkipped(FixedAsset: Record "Fixed Asset"): Boolean
- begin
- if GlobalDepreciationBook.Code = '' then
- exit(true);
- if FixedAsset.Inactive then
- exit(true);
- if (GlobalFADepreciationBook."Acquisition Date" = 0D) or (GlobalFADepreciationBook."Acquisition Date" > EndDateProjection) then
- exit(true);
- if GlobalFADepreciationBook."Last Depreciation Date" > EndDateProjection then
- exit(true);
- exit(GlobalFADepreciationBook."Disposal Date" > 0D);
- end;
-
- local procedure InsertPostedAndProjectedEntries(FixedAssetNo: Code[20]; var TempFixedAssetLedgerEntry: Record "FA Ledger Entry" temporary)
- var
- ProjectionsStart, ProjectionsEnd : Date;
- LastPostingDateOfPostedEntries: Date;
- EndCurrentFiscalYear: Date;
- DaysInFiscalYear, PeriodLength : Integer;
- BiggestPostedEntryNo: Integer;
- ProjectDisposal: Boolean;
- begin
- DaysInFiscalYear := GetDaysInFiscalYear(GlobalDepreciationBook);
- if GlobalPeriodLength = 0 then
- PeriodLength := DaysInFiscalYear
- else
- PeriodLength := GlobalPeriodLength;
- if not IsPeriodLengthWithinLimits(PeriodLength, GlobalDepreciationBook) then
- Error(PeriodLengthErr, MinPeriodLength(), GetDaysInFiscalYear(GlobalDepreciationBook));
-
- ProjectDisposal := ShouldProjectDisposal(GlobalProjectDisposal, EndDateProjection, GlobalFADepreciationBook);
- ProjectionsStart := StartDateProjection;
- ProjectionsEnd := EndDateProjection;
- if ProjectDisposal then
- ProjectionsEnd := GlobalFADepreciationBook."Projected Disposal Date";
- if ProjectionsStart > ProjectionsEnd then
- ProjectionsStart := ProjectionsEnd;
-
- TempFixedAssetLedgerEntry.DeleteAll();
- BiggestPostedEntryNo := InsertPostedEntries(FixedAssetNo, IncludePostedFrom, SelectedDepreciationBookCode, TempFixedAssetLedgerEntry);
- TempFixedAssetLedgerEntry."Entry No." := BiggestPostedEntryNo;
- LastPostingDateOfPostedEntries := TempFixedAssetLedgerEntry."Posting Date";
- if ProjectionsStart < LastPostingDateOfPostedEntries then begin
- InitializeFiscalYearEndDate(GlobalDepreciationBook, ProjectionsStart, EndCurrentFiscalYear);
- ProjectionsStart := GetNextProjectionDate(LastPostingDateOfPostedEntries, GlobalUseAccountingPeriod, PeriodLength, EndCurrentFiscalYear, ProjectionsEnd, GlobalDepreciationBook, GlobalFADepreciationBook);
- end;
- InsertProjectedEntries(ProjectionsStart, ProjectionsEnd, GlobalDaysInFirstPeriod, PeriodLength, GlobalUseAccountingPeriod, ProjectDisposal, GlobalDepreciationBook, GlobalFADepreciationBook, TempFixedAssetLedgerEntry);
- end;
-
- local procedure ShouldProjectDisposal(ProjectDisposalSetting: Boolean; EndProjectionsDate: Date; FADepreciationBook: Record "FA Depreciation Book"): Boolean
- begin
- if not ProjectDisposalSetting then
- exit(false);
- if FADepreciationBook."Projected Disposal Date" = 0D then
- exit(false);
- exit(FADepreciationBook."Projected Disposal Date" <= EndProjectionsDate);
- end;
-
- local procedure CalculatedDepreciationIsZero(LastDepreciationAmount: Decimal; LastCustom1Amount: Decimal): Boolean
- begin
- exit((LastDepreciationAmount = 0) and (LastCustom1Amount = 0));
- end;
-
- local procedure InsertProjectedEntries(ProjectionsStart: Date; ProjectionsEnd: Date; DaysInFirstPeriod: Integer; PeriodLength: Integer; UseAccountingPeriods: Boolean; ProjectDisposal: Boolean; DepreciationBook: Record "Depreciation Book"; FADepreciationBook: Record "FA Depreciation Book"; var TempFixedAssetLedgerEntry: Record "FA Ledger Entry" temporary)
- var
- FixedAssetNo: Code[20];
- DepreciationBookCode: Code[10];
- ProjectionDate: Date;
- DepreciationAmount, Custom1Amount : Decimal;
- EntryAmounts: array[4] of Decimal;
- NumberOfDays, Custom1NumberOfDays, DaysInPeriod : Integer;
- PreviousProjectionDate: Date;
- DateFromProjection: Date;
- EndCurrentFiscalYear: Date;
- FiscalYear365Days: Boolean;
- ProjectingFromPostedValues: Boolean;
- AssetWasDepreciated: Boolean;
- LastProjectionInserted: Boolean;
- begin
- FixedAssetNo := FADepreciationBook."FA No.";
- DepreciationBookCode := FADepreciationBook."Depreciation Book Code";
- FiscalYear365Days := DepreciationBook."Fiscal Year 365 Days";
- DateFromProjection := 0D;
- ProjectionDate := ProjectionsStart;
- DaysInPeriod := DaysInFirstPeriod;
- ProjectingFromPostedValues := true;
- InitializeProjectionEntryAmounts(ProjectionsStart, DepreciationBook, FADepreciationBook, EntryAmounts);
- InitializeFiscalYearEndDate(DepreciationBook, ProjectionsStart, EndCurrentFiscalYear);
- while not LastProjectionInserted do begin
- if not ProjectingFromPostedValues then
- DateFromProjection := DepreciationCalculation.ToMorrow(PreviousProjectionDate, FiscalYear365Days);
-
- CalculateDepreciation.Calculate(DepreciationAmount, Custom1Amount, NumberOfDays, Custom1NumberOfDays, FixedAssetNo, DepreciationBookCode, ProjectionDate, EntryAmounts, DateFromProjection, DaysInPeriod);
- AssetWasDepreciated := HasAssetBeenDepreciated(ProjectingFromPostedValues, DepreciationAmount, Custom1Amount, DateFromProjection, ProjectionDate, FADepreciationBook);
-
- if ProjectingFromPostedValues and AssetWasDepreciated then begin
- ProjectingFromPostedValues := false;
- InitializeDepreciationInFiscalYear(ProjectionDate, FADepreciationBook, EntryAmounts);
- DaysInPeriod := 0;
- end;
-
- if ProjectionDate = EndCurrentFiscalYear then begin
- EntryAmounts[3] := 0;
- UpdateToNextFiscalYearEndDate(DepreciationBook, EndCurrentFiscalYear);
- end;
-
- if AssetWasDepreciated then begin
- AccumulateProjectionEntryAmounts(DepreciationAmount, Custom1Amount, EntryAmounts);
- if ProjectDisposal then
- CalculateDisposal.CalcGainLoss(FixedAssetNo, DepreciationBookCode, EntryAmounts);
- end;
-
- InsertProjectedFixedAssetLedgerEntry(ProjectionDate, FixedAssetNo, DepreciationAmount, NumberOfDays, TempFixedAssetLedgerEntry);
- LastProjectionInserted := ProjectionDate >= ProjectionsEnd;
-
- PreviousProjectionDate := ProjectionDate;
- ProjectionDate := GetNextProjectionDate(ProjectionDate, UseAccountingPeriods, PeriodLength, EndCurrentFiscalYear, ProjectionsEnd, DepreciationBook, FADepreciationBook);
- PeriodLength := GetPeriodLengthBetweenNextProjections(PreviousProjectionDate, ProjectionDate, DepreciationBook);
- end;
- end;
-
- local procedure HasAssetBeenDepreciated(ProjectingFromPostedValues: Boolean; DepreciationAmount: Decimal; Custom1Amount: Decimal; LastDateFromProjection: Date; ProjectionDate: Date; FADepreciationBook: Record "FA Depreciation Book"): Boolean
- begin
- if ProjectingFromPostedValues then
- exit(not CalculatedDepreciationIsZero(DepreciationAmount, Custom1Amount));
- if not CalculatedDepreciationIsZero(DepreciationAmount, Custom1Amount) then
- exit(true);
- if FADepreciationBook."Depreciation Method" <> FADepreciationBook."Depreciation Method"::"User-Defined" then
- exit(false);
- exit(TableDeprCalculation.GetTablePercent(FADepreciationBook."Depreciation Book Code", FADepreciationBook."Depreciation Table Code", FADepreciationBook."First User-Defined Depr. Date", LastDateFromProjection, ProjectionDate) = 0)
- end;
-
- local procedure AccumulateProjectionEntryAmounts(DepreciationAmount: Decimal; Custom1Amount: Decimal; var EntryAmounts: array[4] of Decimal)
- begin
- EntryAmounts[1] += DepreciationAmount + Custom1Amount;
- EntryAmounts[2] += Custom1Amount;
- EntryAmounts[3] += DepreciationAmount + Custom1Amount;
- end;
-
- local procedure InitializeProjectionEntryAmounts(ProjectionsStart: Date; DepreciationBook: Record "Depreciation Book"; FADepreciationBook: Record "FA Depreciation Book"; var EntryAmounts: array[4] of Decimal)
- begin
- EntryAmounts[1] := FADepreciationBook."Book Value";
- EntryAmounts[2] := FADepreciationBook."Custom 1";
- InitializeDepreciationInFiscalYear(ProjectionsStart, FADepreciationBook, EntryAmounts);
- if DepreciationBook."Use Custom 1 Depreciation" then
- EntryAmounts[4] := GetDepreciationBasis(DepreciationBook, FADepreciationBook);
- end;
-
- local procedure InitializeDepreciationInFiscalYear(ReferenceDate: Date; FADepreciationBook: Record "FA Depreciation Book"; var EntryAmounts: array[4] of Decimal)
- begin
- EntryAmounts[3] := DepreciationCalculation.DeprInFiscalYear(FADepreciationBook."FA No.", FADepreciationBook."Depreciation Book Code", ReferenceDate);
- end;
-
- local procedure GetDepreciationBasis(DepreciationBook: Record "Depreciation Book"; FADepreciationBook: Record "FA Depreciation Book"): Decimal
- var
- FALedgerEntry: Record "FA Ledger Entry";
- begin
- FALedgerEntry.ReadIsolation := IsolationLevel::ReadUncommitted;
- FALedgerEntry.SetCurrentKey("FA No.", "Depreciation Book Code", "Part of Book Value", "FA Posting Date");
- FALedgerEntry.SetRange("FA No.", FADepreciationBook."FA No.");
- FALedgerEntry.SetRange("Depreciation Book Code", DepreciationBook.Code);
- FALedgerEntry.SetRange("Part of Book Value", true);
- FALedgerEntry.SetRange("FA Posting Date", 0D, FADepreciationBook."Depr. Ending Date (Custom 1)");
- FALedgerEntry.CalcSums(Amount);
- exit(FALedgerEntry.Amount);
- end;
-
- local procedure InsertProjectedFixedAssetLedgerEntry(PostingDate: Date; FixedAssetNo: Code[20]; Amount: Decimal; NumberOfDepreciationDays: Integer; var TempFixedAssetLedgerEntry: Record "FA Ledger Entry" temporary)
- begin
- TempFixedAssetLedgerEntry."FA No." := FixedAssetNo;
- TempFixedAssetLedgerEntry."FA Posting Date" := PostingDate;
- TempFixedAssetLedgerEntry."FA Posting Type" := TempFixedAssetLedgerEntry."FA Posting Type"::Depreciation;
- TempFixedAssetLedgerEntry.Amount := Amount;
- TempFixedAssetLedgerEntry."No. of Depreciation Days" := NumberOfDepreciationDays;
- TempFixedAssetLedgerEntry."Entry No." += 1;
- TempFixedAssetLedgerEntry."Reason Code" := ProjectionTok;
- TempFixedAssetLedgerEntry.Insert();
- end;
-
- local procedure GetNextProjectionDate(Previous: Date; UseAccountingPeriods: Boolean; PeriodLength: Integer; EndCurrentFiscalYear: Date; ProjectionsEnd: Date; DepreciationBook: Record "Depreciation Book"; FADepreciationBook: Record "FA Depreciation Book"): Date
- var
- Next: Date;
- FiscalYear365Days: Boolean;
- begin
- FiscalYear365Days := DepreciationBook."Fiscal Year 365 Days";
-
- if UseAccountingPeriods then
- Next := GetNextProjectionDateFromAccountingPeriods(Previous, PeriodLength, FiscalYear365Days)
- else
- Next := GetNextProjectionDateAsNextPeriod(Previous, PeriodLength, FiscalYear365Days);
- if ShouldNextProjectionDateBeCustomDepreciationDate(Previous, Next, DepreciationBook, FADepreciationBook) then
- Next := FADepreciationBook."Depr. Ending Date (Custom 1)";
- if PeriodIncludesDate(Previous, Next, FADepreciationBook."Temp. Ending Date") then
- Next := FADepreciationBook."Temp. Ending Date";
- if PeriodIncludesDate(Previous, Next, EndCurrentFiscalYear) then
- Next := EndCurrentFiscalYear;
- if Next > ProjectionsEnd then
- Next := ProjectionsEnd;
- exit(Next);
- end;
-
- local procedure GetNextProjectionDateFromAccountingPeriods(Previous: Date; PeriodLength: Integer; FiscalYear365Days: Boolean): Date
- var
- AccountingPeriod: Record "Accounting Period";
- NextAccountingPeriodMinDate: Date;
- begin
- NextAccountingPeriodMinDate := DepreciationCalculation.ToMorrow(Previous, FiscalYear365Days) + 1;
- AccountingPeriod.SetFilter("Starting Date", '>= %1', NextAccountingPeriodMinDate);
- if not AccountingPeriod.FindFirst() then begin
- if FiscalYear365Days then
- Error(ConfigureAccountingPeriodsErr, NextAccountingPeriodMinDate);
- exit(GetNextProjectionDateAsNextPeriod(Previous, PeriodLength, FiscalYear365Days));
- end;
- if Date2DMY(AccountingPeriod."Starting Date", 1) <> 31 then
- exit(DepreciationCalculation.Yesterday(AccountingPeriod."Starting Date", FiscalYear365Days));
- exit(AccountingPeriod."Starting Date" - 1);
- end;
-
- local procedure GetNextProjectionDateAsNextPeriod(Previous: Date; PeriodLength: Integer; FiscalYear365Days: Boolean): Date
- begin
- exit(FADateCalculation.CalculateDate(Previous, PeriodLength, FiscalYear365Days));
- end;
-
- local procedure GetPeriodLengthBetweenNextProjections(Previous: Date; Next: Date; DepreciationBook: Record "Depreciation Book"): Integer
- var
- DayAfterPrevious: Date;
- FiscalYear365Days: Boolean;
- DepreciationDaysBetween: Integer;
- begin
- FiscalYear365Days := DepreciationBook."Fiscal Year 365 Days";
- DayAfterPrevious := DepreciationCalculation.ToMorrow(Previous, FiscalYear365Days);
- DepreciationDaysBetween := DepreciationCalculation.DeprDays(DayAfterPrevious, Next, FiscalYear365Days);
- if IsPeriodLengthWithinLimits(DepreciationDaysBetween, DepreciationBook) then
- exit(DepreciationDaysBetween);
- exit(GetDaysInFiscalYear(DepreciationBook));
- end;
-
- local procedure InitializeFiscalYearEndDate(DepreciationBook: Record "Depreciation Book"; ReferenceDate: Date; var EndFiscalYear: Date)
- var
- StartFiscalYear: Date;
- DaysInFiscalYear: Integer;
- FiscalYear365Days: Boolean;
- begin
- FiscalYear365Days := DepreciationBook."Fiscal Year 365 Days";
- DaysInFiscalYear := GetDaysInFiscalYear(DepreciationBook);
- StartFiscalYear := FADateCalculation.GetFiscalYear(DepreciationBook.Code, ReferenceDate);
- EndFiscalYear := FADateCalculation.CalculateDate(DepreciationCalculation.Yesterday(StartFiscalYear, FiscalYear365Days), DaysInFiscalYear, FiscalYear365Days);
- end;
-
- local procedure UpdateToNextFiscalYearEndDate(DepreciationBook: Record "Depreciation Book"; var EndFiscalYear: Date)
- var
- DaysInFiscalYear: Integer;
- FiscalYear365Days: Boolean;
- begin
- FiscalYear365Days := DepreciationBook."Fiscal Year 365 Days";
- DaysInFiscalYear := GetDaysInFiscalYear(DepreciationBook);
- EndFiscalYear := FADateCalculation.CalculateDate(EndFiscalYear, DaysInFiscalYear, FiscalYear365Days);
- end;
-
- local procedure GetDaysInFiscalYear(DepreciationBook: Record "Depreciation Book"): Integer
- begin
- if DepreciationBook."No. of Days in Fiscal Year" > 0 then
- exit(DepreciationBook."No. of Days in Fiscal Year");
- if DepreciationBook."Fiscal Year 365 Days" then
- exit(365);
- exit(360);
- end;
-
- local procedure ShouldNextProjectionDateBeCustomDepreciationDate(Previous: Date; Next: Date; DepreciationBook: Record "Depreciation Book"; FADepreciationBook: Record "FA Depreciation Book"): Boolean
- begin
- if not DepreciationBook."Use Custom 1 Depreciation" then
- exit(false);
- exit(PeriodIncludesDate(Previous, Next, FADepreciationBook."Depr. Ending Date (Custom 1)"));
- end;
-
- local procedure PeriodIncludesDate(PeriodStart: Date; PeriodEnd: Date; DateToCheck: Date): Boolean
- begin
- exit((PeriodStart < DateToCheck) and (PeriodEnd > DateToCheck));
- end;
-
- local procedure IsPeriodLengthWithinLimits(PeriodLength: Integer; DepreciationBook: Record "Depreciation Book"): Boolean
- begin
- exit((PeriodLength > MinPeriodLength()) and (PeriodLength <= GetDaysInFiscalYear(DepreciationBook)));
- end;
-
- local procedure MinPeriodLength(): Integer
- begin
- exit(5);
- end;
-
- local procedure InsertPostedEntries(FixedAssetNo: Code[20]; MinFAPostingDate: Date; FixedAssetDepreciationBookCode: Code[10]; var TempFixedAssetLedgerEntry: Record "FA Ledger Entry" temporary): Integer
- var
- FixedAssetLedgerEntry: Record "FA Ledger Entry";
- BiggestEntryNo: Integer;
- begin
- BiggestEntryNo := 0;
- if MinFAPostingDate = 0D then
- exit(BiggestEntryNo);
- FixedAssetLedgerEntry.SetCurrentKey("FA No.", "Depreciation Book Code", "Posting Date");
- FixedAssetLedgerEntry.SetAscending("Posting Date", true);
- FixedAssetLedgerEntry.SetRange("FA No.", FixedAssetNo);
- FixedAssetLedgerEntry.SetRange("Depreciation Book Code", FixedAssetDepreciationBookCode);
- FixedAssetLedgerEntry.SetFilter("FA Posting Date", '>=%1', MinFAPostingDate);
- if FixedAssetLedgerEntry.IsEmpty() then
- exit(BiggestEntryNo);
- FixedAssetLedgerEntry.FindSet();
- repeat
- TempFixedAssetLedgerEntry.Copy(FixedAssetLedgerEntry);
- Clear(TempFixedAssetLedgerEntry."Reason Code");
- TempFixedAssetLedgerEntry.Insert();
- if BiggestEntryNo < TempFixedAssetLedgerEntry."Entry No." then
- BiggestEntryNo := TempFixedAssetLedgerEntry."Entry No.";
- until FixedAssetLedgerEntry.Next() = 0;
- exit(BiggestEntryNo);
- end;
-
-}
\ No newline at end of file
diff --git a/Apps/W1/ExcelReports/app/src/Financials/EXRTrialBalPrevYearExcel.Report.al b/Apps/W1/ExcelReports/app/src/Financials/EXRTrialBalPrevYearExcel.Report.al
deleted file mode 100644
index 1dd51faa94..0000000000
--- a/Apps/W1/ExcelReports/app/src/Financials/EXRTrialBalPrevYearExcel.Report.al
+++ /dev/null
@@ -1,201 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-
-namespace Microsoft.Finance.ExcelReports;
-
-using Microsoft.Finance.GeneralLedger.Account;
-using Microsoft.Finance.Dimension;
-using Microsoft.Foundation.Company;
-using Microsoft.ExcelReports;
-
-report 4407 "EXR Trial Bal. Prev Year Excel"
-{
- ApplicationArea = All;
- Caption = 'Trial Balance/Previous Year Excel (Preview)';
- DataAccessIntent = ReadOnly;
- DefaultRenderingLayout = TrialBalancePrevYearExcelLayout;
- ExcelLayoutMultipleDataSheets = true;
- UsageCategory = ReportsAndAnalysis;
- MaximumDatasetSize = 1000000;
-
- dataset
- {
- dataitem(TrialBalancePreviousYearData; "G/L Account")
- {
- DataItemTableView = sorting("No.");
- RequestFilterFields = "No.", "Account Type", "Date Filter";
-
- column(AccountNumber; "No.") { IncludeCaption = true; }
- column(AccountName; Name) { IncludeCaption = true; }
- column(IncomeBalance; "Income/Balance") { IncludeCaption = true; }
- column(AccountCategory; "Account Category") { IncludeCaption = true; }
- column(AccountSubcategory; "Account Subcategory Descript.") { IncludeCaption = true; }
- column(AccountType; "Account Type") { IncludeCaption = true; }
- column(Indentation; Indentation) { IncludeCaption = true; }
- column(IndentedAccountName; IndentedAccountName) { }
-
- dataitem(EXRTrialBalanceBuffer; "EXR Trial Balance Buffer")
- {
- DataItemLink = "G/L Account No." = field("No.");
- RequestFilterFields = Balance, "Net Change";
- column(Account; "G/L Account No.") { IncludeCaption = true; }
- column(Dimension1Code; "Dimension 1 Code") { IncludeCaption = true; }
- column(Dimension2Code; "Dimension 2 Code") { IncludeCaption = true; }
- column(NetChangeDebit; "Net Change (Debit)") { IncludeCaption = true; }
- column(NetChangeCredit; "Net Change (Credit)") { IncludeCaption = true; }
- column(BalanceDebit; "Balance (Debit)") { IncludeCaption = true; }
- column(BalanceCredit; "Balance (Credit)") { IncludeCaption = true; }
- column(LastPeriodNet; "Last Period Net") { IncludeCaption = true; }
- column(LastPeriodBalance; "Last Period Bal.") { IncludeCaption = true; }
- column(NetVariance; "Net Variance") { IncludeCaption = true; }
- column(NetPercentVariance; "% of Net Variance") { IncludeCaption = true; }
- column(BalanceVariance; "Bal. Variance") { IncludeCaption = true; }
- column(BalancePercentVariance; "% of Bal. Variance") { IncludeCaption = true; }
- column(NetChangeDebitACY; "Net Change (Debit) (ACY)") { IncludeCaption = true; }
- column(NetChangeCreditACY; "Net Change (Credit) (ACY)") { IncludeCaption = true; }
- column(BalanceDebitACY; "Balance (Debit) (ACY)") { IncludeCaption = true; }
- column(BalanceCreditACY; "Balance (Credit) (ACY)") { IncludeCaption = true; }
- column(LastPeriodNetACY; "Last Period Net (ACY)") { IncludeCaption = true; }
- column(LastPeriodBalanceACY; "Last Period Bal. (ACY)") { IncludeCaption = true; }
- column(NetVarianceACY; "Net Variance (ACY)") { IncludeCaption = true; }
- column(NetPercentVarianceACY; "% of Net Variance (ACY)") { IncludeCaption = true; }
- column(BalanceVarianceACY; "Bal. Variance (ACY)") { IncludeCaption = true; }
- column(BalancePercentVarianceACY; "% of Bal. Variance (ACY)") { IncludeCaption = true; }
- }
-
- trigger OnAfterGetRecord()
- begin
- Clear(EXRTrialBalanceBuffer);
- EXRTrialBalanceBuffer.DeleteAll();
- IndentedAccountName := PadStr('', TrialBalancePreviousYearData.Indentation * 2, ' ') + TrialBalancePreviousYearData.Name;
-
- BuildDataset(TrialBalancePreviousYearData);
- end;
- }
- dataitem(Dimension1; "Dimension Value")
- {
- DataItemTableView = sorting("Code") where("Global Dimension No." = const(1));
-
- column(Dim1Code; Dimension1."Code") { IncludeCaption = true; }
- column(Dim1Name; Dimension1.Name) { IncludeCaption = true; }
- }
- dataitem(Dimension2; "Dimension Value")
- {
- DataItemTableView = sorting("Code") where("Global Dimension No." = const(2));
-
- column(Dim2Code; Dimension2."Code") { IncludeCaption = true; }
- column(Dim2Name; Dimension2.Name) { IncludeCaption = true; }
- }
- }
- requestpage
- {
- SaveValues = true;
- AboutTitle = 'Trial Balance/Previous Year Excel';
- AboutText = 'This report contains aggregated general ledger data for the trial balance with debit/credit columns for net change and balance. A report is shown for both local currency (LCY) and additional reporting currency (ACY, the latter only showing data if Additional Reporting Currency is in use. In addition to debit/credit for net change and balance the report shows the net debit/credit amount for both net change and balance for comparison. The aggregation is for the period specified in the report''s request page''s Datefilter parameter and summarized per the 2 global dimensions per g/l account category.';
- }
- rendering
- {
- layout(TrialBalancePrevYearExcelLayout)
- {
- Type = Excel;
- LayoutFile = './ReportLayouts/Excel/GeneralLedger/TrialBalancePrevYearExcel.xlsx';
- Caption = 'Trial Balance/Previous Year Excel';
- Summary = 'Built in layout for the Trial Balance/Previous Year Excel report.This report contains aggregated general ledger data for the trial balance with debit/credit columns for net change and balance. Report uses Query connections.';
- }
- }
- labels
- {
- DataRetrieved = 'Data retrieved:';
- TrialBalanceLCY = 'Trial Balance (LCY)';
- TrialBalanceACY = 'Trial Balance (ACY)';
- TrialBalancevsLastPeriodACY = 'Trial Balance vs. Last Period (Additional Reporting Currency)';
- TrialBalancevsLastPeriod = 'Trial Balance vs. Last Period';
- }
- trigger OnPreReport()
- begin
- TrialBalancePreviousYearData.SecurityFiltering(SecurityFilter::Filtered);
- CompanyInformation.Get();
- ExcelReportsTelemetry.LogReportUsage(Report::"EXR Trial Bal. Prev Year Excel");
-
- FromDate := TrialBalancePreviousYearData.GetRangeMin("Date Filter");
- ToDate := TrialBalancePreviousYearData.GetRangeMax("Date Filter");
- PriorFromDate := CalcDate('<-1Y>', FromDate + 1) - 1;
- PriorToDate := CalcDate('<-1Y>', ToDate + 1) - 1;
- end;
-
- var
- ExcelReportsTelemetry: Codeunit "Excel Reports Telemetry";
-
- protected var
- CompanyInformation: Record "Company Information";
- FromDate: Date;
- PriorFromDate: Date;
- PriorToDate: Date;
- ToDate: Date;
- IndentedAccountName: Text;
-
- local procedure BuildDataset(var GLAccount: Record "G/L Account")
- var
- DimensionValue1: Record "Dimension Value";
- DimensionValue2: Record "Dimension Value";
- begin
- DimensionValue1.SetRange("Global Dimension No.", 1);
- DimensionValue2.SetRange("Global Dimension No.", 2);
-
- InsertGLAccountData(GLAccount, DimensionValue1, DimensionValue2);
- end;
-
- local procedure InsertGLAccountData(var GLAccount: Record "G/L Account"; var DimensionValue1: Record "Dimension Value"; var DimensionValue2: Record "Dimension Value")
- begin
- AddGLToDataset(GLAccount, '', '');
-
- if DimensionValue1.FindSet() then
- repeat
- AddGLToDataset(GLAccount, DimensionValue1."Code", '');
- if DimensionValue2.FindSet() then
- repeat
- AddGLToDataset(GLAccount, DimensionValue1."Code", DimensionValue2."Code");
- until DimensionValue2.Next() = 0;
- until DimensionValue1.Next() = 0;
-
- if DimensionValue2.FindSet() then
- repeat
- AddGLToDataset(GLAccount, '', DimensionValue2."Code");
- until DimensionValue2.Next() = 0;
- end;
-
- local procedure AddGLToDataset(var GLAccount: Record "G/L Account"; Dimension1Code: Code[20]; Dimension2Code: Code[20])
- var
- LocalGLAccount: Record "G/L Account";
- LocalGLAccountLastPeriod: Record "G/L Account";
- begin
- LocalGLAccount.Copy(GLAccount);
- LocalGLAccount.SetRange("Global Dimension 1 Filter", Dimension1Code);
- LocalGLAccount.SetRange("Global Dimension 2 Filter", Dimension2Code);
-
- LocalGLAccount.CalcFields("Net Change", "Balance at Date", "Additional-Currency Net Change", "Add.-Currency Balance at Date");
- LocalGLAccountLastPeriod.Copy(LocalGLAccount);
- LocalGLAccountLastPeriod.SetRange("Date Filter", PriorFromDate, PriorToDate);
- LocalGLAccountLastPeriod.CalcFields("Net Change", "Balance at Date", "Additional-Currency Net Change", "Add.-Currency Balance at Date");
-
- Clear(EXRTrialBalanceBuffer);
- EXRTrialBalanceBuffer."G/L Account No." := LocalGLAccount."No.";
- EXRTrialBalanceBuffer."Dimension 1 Code" := Dimension1Code;
- EXRTrialBalanceBuffer."Dimension 2 Code" := Dimension2Code;
-
- EXRTrialBalanceBuffer.Validate("Net Change", LocalGLAccount."Net Change");
- EXRTrialBalanceBuffer.Validate("Balance", LocalGLAccount."Balance at Date");
- EXRTrialBalanceBuffer.Validate("Last Period Net", LocalGLAccountLastPeriod."Net Change");
- EXRTrialBalanceBuffer.Validate("Last Period Bal.", LocalGLAccountLastPeriod."Balance at Date");
-
- EXRTrialBalanceBuffer.Validate("Net Change (ACY)", LocalGLAccount."Additional-Currency Net Change");
- EXRTrialBalanceBuffer.Validate("Balance (ACY)", LocalGLAccount."Add.-Currency Balance at Date");
- EXRTrialBalanceBuffer.Validate("Last Period Net (ACY)", LocalGLAccountLastPeriod."Additional-Currency Net Change");
- EXRTrialBalanceBuffer.Validate("Last Period Bal. (ACY)", LocalGLAccountLastPeriod."Add.-Currency Balance at Date");
- EXRTrialBalanceBuffer.CalculateVariances();
- EXRTrialBalanceBuffer.Insert(true);
- end;
-}
-
diff --git a/Apps/W1/ExcelReports/app/src/Financials/EXRTrialBalanceBudgetExcel.Report.al b/Apps/W1/ExcelReports/app/src/Financials/EXRTrialBalanceBudgetExcel.Report.al
deleted file mode 100644
index 5dd2263a7f..0000000000
--- a/Apps/W1/ExcelReports/app/src/Financials/EXRTrialBalanceBudgetExcel.Report.al
+++ /dev/null
@@ -1,115 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-
-namespace Microsoft.Finance.ExcelReports;
-
-using Microsoft.Finance.GeneralLedger.Account;
-using Microsoft.Finance.Dimension;
-using Microsoft.Foundation.Company;
-using Microsoft.ExcelReports;
-
-report 4406 "EXR Trial BalanceBudgetExcel"
-{
- ApplicationArea = All;
- Caption = 'Trial Balance/Budget Excel (Preview)';
- DataAccessIntent = ReadOnly;
- DefaultRenderingLayout = TrialBalanceBudgetExcelLayout;
- ExcelLayoutMultipleDataSheets = true;
- UsageCategory = ReportsAndAnalysis;
- MaximumDatasetSize = 1000000;
-
- dataset
- {
- dataitem(GLAccounts; "G/L Account")
- {
- DataItemTableView = sorting("No.");
- RequestFilterFields = "No.", "Account Type", "Date Filter", "Budget Filter";
- column(AccountNumber; "No.") { IncludeCaption = true; }
- column(AccountName; Name) { IncludeCaption = true; }
- column(IncomeBalance; "Income/Balance") { IncludeCaption = true; }
- column(AccountCategory; "Account Category") { IncludeCaption = true; }
- column(AccountSubcategory; "Account Subcategory Descript.") { IncludeCaption = true; }
- column(AccountType; "Account Type") { IncludeCaption = true; }
- column(Indentation; Indentation) { IncludeCaption = true; }
- column(IndentedAccountName; IndentedAccountName) { }
-
- trigger OnAfterGetRecord()
- begin
- IndentedAccountName := PadStr('', GLAccounts.Indentation * 2, ' ') + GLAccounts.Name;
- end;
- }
- dataitem(Dimension1; "Dimension Value")
- {
- DataItemTableView = sorting("Code");
- UseTemporary = true;
-
- column(Dim1Code; Dimension1."Code") { IncludeCaption = true; }
- column(Dim1Name; Dimension1.Name) { IncludeCaption = true; }
- }
- dataitem(Dimension2; "Dimension Value")
- {
- DataItemTableView = sorting("Code");
- UseTemporary = true;
-
- column(Dim2Code; Dimension2."Code") { IncludeCaption = true; }
- column(Dim2Name; Dimension2.Name) { IncludeCaption = true; }
- }
- dataitem(TrialBalanceBudgetData; "EXR Trial Balance Buffer")
- {
- RequestFilterFields = Balance, "Net Change";
- column(Account; "G/L Account No.") { IncludeCaption = true; }
- column(Dimension1Code; "Dimension 1 Code") { IncludeCaption = true; }
- column(Dimension2Code; "Dimension 2 Code") { IncludeCaption = true; }
- column(NetChange; "Net Change") { IncludeCaption = true; }
- column(Balance; Balance) { IncludeCaption = true; }
- column(NetBudget; "Budget (Net)") { IncludeCaption = true; }
- column(BalanceBudget; "Budget (Bal. at Date)") { IncludeCaption = true; }
- column(BudgetNetPct; "% of Budget Net") { IncludeCaption = true; }
- column(BudgetBalPct; "% of Budget Bal.") { IncludeCaption = true; }
- }
- }
- requestpage
- {
- SaveValues = true;
- AboutTitle = 'Trial Balance/Budget Excel';
- AboutText = 'This report contains aggregated general ledger data for the trial balance with debit/credit columns for net change and balance. A report is shown for both local currency (LCY) and additional reporting currency (ACY, the latter only showing data if Additional Reporting Currency is in use. In addition to debit/credit for net change and balance the report shows the net debit/credit amount for both net change and balance for comparison. The aggregation is for the period specified in the report''s request page''s Datefilter parameter and summarized per the 2 global dimensions per g/l account category.';
- }
- rendering
- {
- layout(TrialBalanceBudgetExcelLayout)
- {
- Type = Excel;
- LayoutFile = './ReportLayouts/Excel/GeneralLedger/TrialBalanceBudgetExcel.xlsx';
- Caption = 'Trial Balance/Budget Excel';
- Summary = 'Built in layout for Trial Balance/Budget Excel. Customer facing sheet contains a pivot table that shows the account balance in local currency and additional reporting currencies. Report uses Query connections.';
- }
- }
-
- labels
- {
- DataRetrieved = 'Data retrieved:';
- NetBudgetLabel = 'Net Budget';
- BalanceBudgetLabel = 'Budget Balance';
- TrialBalancevsBudget = 'Trial Balance vs. Budget';
- }
- trigger OnPreReport()
- var
- TrialBalance: Codeunit "Trial Balance";
- begin
- TrialBalanceBudgetData.SecurityFiltering(SecurityFilter::Filtered);
- CompanyInformation.Get();
- ExcelReportsTelemetry.LogReportUsage(Report::"EXR Trial BalanceBudgetExcel");
- TrialBalance.ConfigureTrialBalance(true, false);
- TrialBalance.InsertTrialBalanceReportData(GLAccounts, Dimension1, Dimension2, TrialBalanceBudgetData);
- end;
-
- var
- ExcelReportsTelemetry: Codeunit "Excel Reports Telemetry";
-
- protected var
- CompanyInformation: Record "Company Information";
- IndentedAccountName: Text;
-
-}
\ No newline at end of file
diff --git a/Apps/W1/ExcelReports/app/src/Financials/EXRTrialBalanceBuffer.Table.al b/Apps/W1/ExcelReports/app/src/Financials/EXRTrialBalanceBuffer.Table.al
deleted file mode 100644
index 3359f9e948..0000000000
--- a/Apps/W1/ExcelReports/app/src/Financials/EXRTrialBalanceBuffer.Table.al
+++ /dev/null
@@ -1,375 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-
-namespace Microsoft.Finance.ExcelReports;
-
-using Microsoft.Finance.GeneralLedger.Account;
-using Microsoft.Finance.Consolidation;
-
-table 4402 "EXR Trial Balance Buffer"
-{
- Caption = 'Trial Balance Buffer';
- DataClassification = CustomerContent;
- TableType = Temporary;
-
- fields
- {
- field(1; "G/L Account No."; Code[20])
- {
- Caption = 'G/L Account No.';
- }
- field(2; "Dimension 1 Code"; Code[20])
- {
- CaptionClass = '1,2,1';
- Caption = 'Dimension 1 Code';
- }
- field(3; "Dimension 2 Code"; Code[20])
- {
- CaptionClass = '1,2,2';
- Caption = 'Dimension 2 Code';
- }
- field(4; "Period Start"; Date)
- {
- Caption = 'Period Start';
- }
- field(5; "Period End"; Date)
- {
- Caption = 'Period End';
- }
- field(10; "Net Change"; Decimal)
- {
- Caption = 'Net Change';
-
- trigger OnValidate()
- begin
- if ("Net Change" > 0) then begin
- Validate("Net Change (Debit)", "Net Change");
- Validate("Net Change (Credit)", 0);
- end
- else begin
- Validate("Net Change (Credit)", -"Net Change");
- Validate("Net Change (Debit)", 0);
- end;
- end;
- }
- field(11; "Net Change (Debit)"; Decimal)
- {
- Caption = 'Net Change (Debit)';
- }
- field(12; "Net Change (Credit)"; Decimal)
- {
- Caption = 'Net Change (Credit)';
- }
- field(13; Balance; Decimal)
- {
- Caption = 'Balance';
-
- trigger OnValidate()
- begin
- if ("Balance" > 0) then begin
- Validate("Balance (Debit)", "Balance");
- Validate("Balance (Credit)", 0);
- end
- else begin
- Validate("Balance (Credit)", -"Balance");
- Validate("Balance (Debit)", 0);
- end;
- end;
- }
- field(14; "Balance (Debit)"; Decimal)
- {
- Caption = 'Balance (Debit)';
- }
- field(15; "Balance (Credit)"; Decimal)
- {
- Caption = 'Balance (Credit)';
- }
- field(20; "Budget (Net)"; Decimal)
- {
- Caption = 'Budget';
- }
- field(21; "% of Budget Net"; Decimal)
- {
- Caption = '% of Budget Net';
- }
- field(22; "Budget (Bal. at Date)"; Decimal)
- {
- Caption = 'Budget (Bal. at Date)';
- }
- field(23; "% of Budget Bal."; Decimal)
- {
- Caption = '% of Budget Bal.';
- }
- field(50; "Last Period Net"; Decimal)
- {
- Caption = 'Last Period Net';
-
- trigger OnValidate()
- begin
- if ("Last Period Net" > 0) then begin
- Validate("Last Period Net (Debit)", "Last Period Net");
- Validate("Last Period Net (Credit)", 0);
- end
- else begin
- Validate("Last Period Net (Credit)", -"Last Period Net");
- Validate("Last Period Net (Debit)", 0);
- end;
- end;
- }
- field(51; "Last Period Net (Debit)"; Decimal)
- {
- Caption = 'Last Period Net (Debit)';
- }
- field(52; "Last Period Net (Credit)"; Decimal)
- {
- Caption = 'Last Period Net (Credit)';
- }
- field(60; "Last Period Bal."; Decimal)
- {
- Caption = 'Last Period Bal.';
-
- trigger OnValidate()
- begin
- if ("Last Period Bal." > 0) then begin
- Validate("Last Period Bal. (Debit)", "Last Period Bal.");
- Validate("Last Period Bal. (Credit)", 0);
- end
- else begin
- Validate("Last Period Bal. (Credit)", -"Last Period Bal.");
- Validate("Last Period Bal. (Debit)", 0);
- end;
- end;
- }
- field(61; "Last Period Bal. (Debit)"; Decimal)
- {
- Caption = 'Last Period Bal. (Debit)';
- }
- field(62; "Last Period Bal. (Credit)"; Decimal)
- {
- Caption = 'Last Period Bal. (Credit)';
- }
- field(70; "Net Variance"; Decimal)
- {
- Caption = 'Net Variance';
- }
- field(71; "% of Net Variance"; Decimal)
- {
- Caption = '% of Net Variance';
- }
- field(80; "Bal. Variance"; Decimal)
- {
- Caption = 'Bal. Variance';
- }
- field(81; "% of Bal. Variance"; Decimal)
- {
- Caption = '% of Bal. Variance';
- }
- field(110; "Net Change (ACY)"; Decimal)
- {
- Caption = 'Net Change';
-
- trigger OnValidate()
- begin
- if ("Net Change" > 0) then begin
- Validate("Net Change (Debit) (ACY)", "Net Change (ACY)");
- Validate("Net Change (Credit) (ACY)", 0);
- end
- else begin
- Validate("Net Change (Credit) (ACY)", -"Net Change (ACY)");
- Validate("Net Change (Debit) (ACY)", 0);
- end;
- end;
- }
- field(111; "Net Change (Debit) (ACY)"; Decimal)
- {
- Caption = 'Net Change (Debit)';
- }
- field(112; "Net Change (Credit) (ACY)"; Decimal)
- {
- Caption = 'Net Change (Credit)';
- }
- field(113; "Balance (ACY)"; Decimal)
- {
- Caption = 'Balance';
-
- trigger OnValidate()
- begin
- if ("Balance" > 0) then begin
- Validate("Balance (Debit) (ACY)", "Balance (ACY)");
- Validate("Balance (Credit) (ACY)", 0);
- end
- else begin
- Validate("Balance (Credit) (ACY)", -"Balance (ACY)");
- Validate("Balance (Debit) (ACY)", 0);
- end;
- end;
- }
- field(114; "Balance (Debit) (ACY)"; Decimal)
- {
- Caption = 'Balance (Debit)';
- }
- field(115; "Balance (Credit) (ACY)"; Decimal)
- {
- Caption = 'Balance (Credit)';
- }
- field(150; "Last Period Net (ACY)"; Decimal)
- {
- Caption = 'Last Period Net';
-
- trigger OnValidate()
- begin
- if ("Last Period Net" > 0) then begin
- Validate("Last Period Net (Debit) (ACY)", "Last Period Net (ACY)");
- Validate("Last Period Net (Credit) (ACY)", 0);
- end
- else begin
- Validate("Last Period Net (Credit) (ACY)", -"Last Period Net (ACY)");
- Validate("Last Period Net (Debit) (ACY)", 0);
- end;
- end;
- }
- field(151; "Last Period Net (Debit) (ACY)"; Decimal)
- {
- Caption = 'Last Period Net (Debit)';
- }
- field(152; "Last Period Net (Credit) (ACY)"; Decimal)
- {
- Caption = 'Last Period Net (Credit)';
- }
- field(160; "Last Period Bal. (ACY)"; Decimal)
- {
- Caption = 'Last Period Bal.';
-
- trigger OnValidate()
- begin
- if ("Last Period Bal." > 0) then begin
- Validate("Last Period Bal. (Debit) (ACY)", "Last Period Bal. (ACY)");
- Validate("Last Period Bal. (Cred.) (ACY)", 0);
- end
- else begin
- Validate("Last Period Bal. (Cred.) (ACY)", -"Last Period Bal. (ACY)");
- Validate("Last Period Bal. (Debit) (ACY)", 0);
- end;
- end;
- }
- field(161; "Last Period Bal. (Debit) (ACY)"; Decimal)
- {
- Caption = 'Last Period Bal. (Debit)';
- }
- field(162; "Last Period Bal. (Cred.) (ACY)"; Decimal)
- {
- Caption = 'Last Period Bal. (Credit)';
- }
- field(170; "Net Variance (ACY)"; Decimal)
- {
- Caption = 'Net Variance';
- }
- field(171; "% of Net Variance (ACY)"; Decimal)
- {
- Caption = '% of Net Variance';
- }
- field(180; "Bal. Variance (ACY)"; Decimal)
- {
- Caption = 'Bal. Variance';
- }
- field(181; "% of Bal. Variance (ACY)"; Decimal)
- {
- Caption = '% of Bal. Variance';
- }
- field(200; "All Zero"; Boolean)
- {
- Caption = 'All Zero';
- }
- field(201; "Business Unit Code"; Code[20])
- {
- Caption = 'Business Unit Code';
- TableRelation = "Business Unit";
- ValidateTableRelation = false;
- }
- field(1000; "Account Type"; Enum "G/L Account Type")
- {
- CalcFormula = lookup("G/L Account"."Account Type" where("No." = field("G/L Account No.")));
- Caption = 'Account Type';
- Editable = false;
- FieldClass = FlowField;
- }
- }
- keys
- {
- key(PK; "G/L Account No.", "Dimension 1 Code", "Dimension 2 Code", "Business Unit Code", "Period Start")
- {
- Clustered = true;
- }
- }
-
- trigger OnInsert()
- begin
- CheckAllZero();
- end;
-
- trigger OnModify()
- begin
- CheckAllZero();
- end;
-
- internal procedure CalculateVariances()
- begin
- if ("Net Change" <> 0) and ("Last Period Net" <> 0) then begin
- "Net Variance" := "Net Change" - "Last Period Net";
- "% of Net Variance" := "Net Variance" / "Last Period Net";
- end;
- if ("Balance" <> 0) and ("Last Period Bal." <> 0) then begin
- "Bal. Variance" := "Balance" - "Last Period Bal.";
- "% of Bal. Variance" := "Bal. Variance" / "Last Period Bal.";
- end;
- if ("Net Change (ACY)" <> 0) and ("Last Period Net (ACY)" <> 0) then begin
- "Net Variance (ACY)" := "Net Change (ACY)" - "Last Period Net (ACY)";
- "% of Net Variance (ACY)" := "Net Variance (ACY)" / "Last Period Net (ACY)";
- end;
- if ("Balance (ACY)" <> 0) and ("Last Period Bal. (ACY)" <> 0) then begin
- "Bal. Variance (ACY)" := "Balance (ACY)" - "Last Period Bal. (ACY)";
- "% of Bal. Variance (ACY)" := "Bal. Variance (ACY)" / "Last Period Bal. (ACY)";
- end;
- end;
-
- internal procedure CalculateBudgetComparisons()
- begin
- // and budget % comparison
- if ("Budget (Net)" <> 0) and ("Net Change" <> 0) then
- "% of Budget Net" := "Net Change" / "Budget (Net)";
- if ("Budget (Bal. at Date)" <> 0) and ("Balance" <> 0) then
- "% of Budget Bal." := "Balance" / "Budget (Bal. at Date)";
- end;
-
- internal procedure CalculatePriorComparisons()
- begin
- if ("Net Change" <> 0) and ("Last Period Net" <> 0) then
- "% of Net Variance" := "Net Change" / "Last Period Net";
- if ("Balance" <> 0) and ("Last Period Bal." <> 0) then
- "% of Bal. Variance" := "Balance" / "Last Period Bal.";
- if ("Net Change (ACY)" <> 0) and ("Last Period Net (ACY)" <> 0) then
- "% of Net Variance (ACY)" := "Net Change (ACY)" / "Last Period Net (ACY)";
- if ("Balance (ACY)" <> 0) and ("Last Period Bal. (ACY)" <> 0) then
- "% of Bal. Variance (ACY)" := "Balance (ACY)" / "Last Period Bal. (ACY)";
- end;
-
- internal procedure CheckAllZero()
- begin
- // if all the key values are zero, then set the All Zero field to true
- "All Zero" := ("Net Change" = 0) and
- ("Balance" = 0) and
- ("Budget (Net)" = 0) and
- ("Last Period Net" = 0) and
- ("Last Period Bal." = 0) and
- ("Net Variance" = 0) and
- ("Bal. Variance" = 0) and
- ("Net Change (ACY)" = 0) and
- ("Balance (ACY)" = 0) and
- ("Last Period Net (ACY)" = 0) and
- ("Last Period Bal. (ACY)" = 0) and
- ("Net Variance (ACY)" = 0) and
- ("Bal. Variance (ACY)" = 0);
- end;
-}
diff --git a/Apps/W1/ExcelReports/app/src/Financials/EXRTrialBalanceExcel.Report.al b/Apps/W1/ExcelReports/app/src/Financials/EXRTrialBalanceExcel.Report.al
deleted file mode 100644
index fc733bde72..0000000000
--- a/Apps/W1/ExcelReports/app/src/Financials/EXRTrialBalanceExcel.Report.al
+++ /dev/null
@@ -1,122 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-
-namespace Microsoft.Finance.ExcelReports;
-
-using Microsoft.Finance.GeneralLedger.Account;
-using Microsoft.Finance.Dimension;
-using Microsoft.Foundation.Company;
-using Microsoft.ExcelReports;
-
-report 4405 "EXR Trial Balance Excel"
-{
- AdditionalSearchTerms = 'year closing,close accounting period,close fiscal year';
- ApplicationArea = All;
- Caption = 'Trial Balance Excel (Preview)';
- DataAccessIntent = ReadOnly;
- DefaultRenderingLayout = TrialBalanceExcelLayout;
- ExcelLayoutMultipleDataSheets = true;
- UsageCategory = ReportsAndAnalysis;
- MaximumDatasetSize = 1000000;
-
- dataset
- {
- dataitem(GLAccounts; "G/L Account")
- {
- DataItemTableView = sorting("No.");
- RequestFilterFields = "No.", "Account Type", "Date Filter", "Budget Filter";
- column(AccountNumber; "No.") { IncludeCaption = true; }
- column(AccountName; Name) { IncludeCaption = true; }
- column(IncomeBalance; "Income/Balance") { IncludeCaption = true; }
- column(AccountCategory; "Account Category") { IncludeCaption = true; }
- column(AccountSubcategory; "Account Subcategory Descript.") { IncludeCaption = true; }
- column(AccountType; "Account Type") { IncludeCaption = true; }
- column(Indentation; Indentation) { IncludeCaption = true; }
- column(IndentedAccountName; IndentedAccountName) { }
-
- trigger OnAfterGetRecord()
- begin
- IndentedAccountName := PadStr('', GLAccounts.Indentation * 2, ' ') + GLAccounts.Name;
- end;
- }
- dataitem(Dimension1; "Dimension Value")
- {
- DataItemTableView = sorting("Code");
- UseTemporary = true;
-
- column(Dim1Code; Dimension1."Code") { IncludeCaption = true; }
- column(Dim1Name; Dimension1.Name) { IncludeCaption = true; }
- }
- dataitem(Dimension2; "Dimension Value")
- {
- DataItemTableView = sorting("Code");
- UseTemporary = true;
-
- column(Dim2Code; Dimension2."Code") { IncludeCaption = true; }
- column(Dim2Name; Dimension2.Name) { IncludeCaption = true; }
- }
- dataitem(TrialBalanceData; "EXR Trial Balance Buffer")
- {
- RequestFilterFields = "Net Change", Balance;
- column(Account; "G/L Account No.") { IncludeCaption = true; }
- column(Dimension1Code; "Dimension 1 Code") { IncludeCaption = true; }
- column(Dimension2Code; "Dimension 2 Code") { IncludeCaption = true; }
- column(NetChange; "Net Change") { IncludeCaption = true; }
- column(NetChangeDebit; "Net Change (Debit)") { IncludeCaption = true; }
- column(NetChangeCredit; "Net Change (Credit)") { IncludeCaption = true; }
- column(Balance; Balance) { IncludeCaption = true; }
- column(BalanceDebit; "Balance (Debit)") { IncludeCaption = true; }
- column(BalanceCredit; "Balance (Credit)") { IncludeCaption = true; }
- column(NetChangeACY; "Net Change (ACY)") { IncludeCaption = true; }
- column(NetChangeDebitACY; "Net Change (Debit) (ACY)") { IncludeCaption = true; }
- column(NetChangeCreditACY; "Net Change (Credit) (ACY)") { IncludeCaption = true; }
- column(BalanceACY; "Balance (ACY)") { IncludeCaption = true; }
- column(BalanceDebitACY; "Balance (Debit) (ACY)") { IncludeCaption = true; }
- column(BalanceCreditACY; "Balance (Credit) (ACY)") { IncludeCaption = true; }
- }
- }
- requestpage
- {
- SaveValues = true;
- AboutTitle = 'Trial Balance Excel';
- AboutText = 'This report contains aggregated general ledger data for the trial balance with debit/credit columns for net change and balance. A report is shown for both local currency (LCY) and additional reporting currency (ACY), the latter only showing data if Additional Reporting Currency is in use. The aggregation is for the period specified in the report''s request page''s Datefilter parameter and summarized per the 2 global dimensions per g/l account category.';
- }
- rendering
- {
- layout(TrialBalanceExcelLayout)
- {
- Type = Excel;
- LayoutFile = './ReportLayouts/Excel/GeneralLedger/TrialBalanceExcel.xlsx';
- Caption = 'Trial Balance Excel';
- Summary = 'Built in layout for Trial Balance Excel. This report contains aggregated general ledger data for the trial balance with debit/credit columns for net change and balance. Report uses Query connections.';
- }
- }
- labels
- {
- TrialBalanceLCY = 'Trial Balance (LCY)';
- TrialBalanceACYSheet = 'Trial Balance (ACY)';
- TrialBalanceACY = 'Trial Balance (Additional Reporting Currency)';
- DataRetrieved = 'Data retrieved:';
- }
-
- trigger OnPreReport()
- var
- TrialBalance: Codeunit "Trial Balance";
- begin
- TrialBalanceData.SecurityFiltering(SecurityFilter::Filtered);
- CompanyInformation.Get();
- ExcelReportsTelemetry.LogReportUsage(Report::"EXR Trial Balance Excel");
- TrialBalance.ConfigureTrialBalance(true, false);
- TrialBalance.InsertTrialBalanceReportData(GLAccounts, Dimension1, Dimension2, TrialBalanceData);
- end;
-
- var
- ExcelReportsTelemetry: Codeunit "Excel Reports Telemetry";
-
- protected var
- CompanyInformation: Record "Company Information";
- IndentedAccountName: Text;
-
-}
\ No newline at end of file
diff --git a/Apps/W1/ExcelReports/app/src/Financials/EXRTrialBalbyPeriodExcel.Report.al b/Apps/W1/ExcelReports/app/src/Financials/EXRTrialBalbyPeriodExcel.Report.al
deleted file mode 100644
index b6e3c1209f..0000000000
--- a/Apps/W1/ExcelReports/app/src/Financials/EXRTrialBalbyPeriodExcel.Report.al
+++ /dev/null
@@ -1,200 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-
-namespace Microsoft.Finance.ExcelReports;
-
-using Microsoft.Finance.GeneralLedger.Account;
-using Microsoft.Finance.Dimension;
-using Microsoft.Foundation.Company;
-using Microsoft.ExcelReports;
-
-report 4408 "EXR Trial Bal by Period Excel"
-{
- ApplicationArea = All;
- Caption = 'Trial Balance by Period Excel (Preview)';
- DataAccessIntent = ReadOnly;
- DefaultRenderingLayout = TrialBalancebyPeriodExcelLayout;
- ExcelLayoutMultipleDataSheets = true;
- UsageCategory = ReportsAndAnalysis;
- MaximumDatasetSize = 1000000;
-
- dataset
- {
- dataitem(TrialBalanceByPeriod; "G/L Account")
- {
- DataItemTableView = sorting("No.");
- RequestFilterFields = "No.", "Account Type", "Date Filter";
- column(AccountNumber; "No.") { IncludeCaption = true; }
- column(AccountName; Name) { IncludeCaption = true; }
- column(IncomeBalance; "Income/Balance") { IncludeCaption = true; }
- column(AccountCategory; "Account Category") { IncludeCaption = true; }
- column(AccountSubcategory; "Account Subcategory Descript.") { IncludeCaption = true; }
- column(AccountType; "Account Type") { IncludeCaption = true; }
- column(Indentation; Indentation) { IncludeCaption = true; }
- column(IndentedAccountName; IndentedAccountName) { }
-
- dataitem(EXRTrialBalanceBuffer; "EXR Trial Balance Buffer")
- {
- DataItemLink = "G/L Account No." = field("No.");
- RequestFilterFields = Balance, "Net Change";
- column(Account; "G/L Account No.") { IncludeCaption = true; }
- column(Dimension1Code; "Dimension 1 Code") { IncludeCaption = true; }
- column(Dimension2Code; "Dimension 2 Code") { IncludeCaption = true; }
- column(NetChange; "Net Change") { IncludeCaption = true; }
- column(PeriodStart; "Period Start") { IncludeCaption = true; }
- column(PeriodEnd; "Period End") { IncludeCaption = true; }
- }
-
- trigger OnAfterGetRecord()
- begin
- Clear(EXRTrialBalanceBuffer);
- EXRTrialBalanceBuffer.DeleteAll();
- IndentedAccountName := PadStr('', TrialBalanceByPeriod.Indentation * 2, ' ') + TrialBalanceByPeriod.Name;
-
- BuildDataset(TrialBalanceByPeriod);
- end;
- }
- dataitem(Dimension1; "Dimension Value")
- {
- DataItemTableView = sorting("Code") where("Global Dimension No." = const(1));
-
- column(Dim1Code; Dimension1."Code") { IncludeCaption = true; }
- column(Dim1Name; Dimension1.Name) { IncludeCaption = true; }
- }
- dataitem(Dimension2; "Dimension Value")
- {
- DataItemTableView = sorting("Code") where("Global Dimension No." = const(2));
-
- column(Dim2Code; Dimension2."Code") { IncludeCaption = true; }
- column(Dim2Name; Dimension2.Name) { IncludeCaption = true; }
- }
- }
-
- requestpage
- {
- SaveValues = true;
- AboutTitle = 'Trial Balance by Period Excel';
- AboutText = 'This report contains aggregated general ledger data per accounting period for the trial balance with a net debit/credit net change column for each period. The periods covered are specified in the report''s request page''s Datefilter parameter and summarized per the 2 global dimensions per g/l account category.';
-
- layout
- {
- area(content)
- {
- group(Options)
- {
- Caption = 'Options';
- field(PeriodLengthField; PeriodLength)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Period Length';
- ToolTip = 'Specifies the period for which data is shown in the report. For example, enter "1M" for one month, "30D" for thirty days, "3Q" for three quarters, or "5Y" for five years.';
- }
- }
- }
- }
-
- trigger OnOpenPage()
- begin
- Evaluate(PeriodLength, '<1M>');
- end;
- }
-
- rendering
- {
- layout(TrialBalancebyPeriodExcelLayout)
- {
- Type = Excel;
- LayoutFile = './ReportLayouts/Excel/GeneralLedger/TrialBalancebyPeriodExcel.xlsx';
- Caption = 'Trial Balance by Period Excel';
- Summary = 'Built in layout for the Trial Balance by Period report. This report contains aggregated general ledger data per accounting period for the trial balance with a net debit/credit net change column for each period. Report uses Query connections.';
- }
- }
- labels
- {
- DataRetrieved = 'Data retrieved:';
- TrialBalanceByPeriod = 'Trial Balance by Period';
- YearPeriodStart = 'Year';
- }
- trigger OnPreReport()
- var
- ThisReportingStartDate: Date;
- begin
- TrialBalanceByPeriod.SecurityFiltering(SecurityFilter::Filtered);
- CompanyInformation.Get();
- ExcelReportsTelemetry.LogReportUsage(Report::"EXR Trial Bal by Period Excel");
-
- ReportingPeriodStartDate.Add(TrialBalanceByPeriod.GetRangeMin("Date Filter"));
- ThisReportingStartDate := TrialBalanceByPeriod.GetRangeMin("Date Filter");
- repeat
- ThisReportingStartDate := CalcDate(PeriodLength, ThisReportingStartDate);
- ReportingPeriodEndDate.Add(CalcDate('<-1D>', ThisReportingStartDate));
- ReportingPeriodStartDate.Add(ThisReportingStartDate);
- until ThisReportingStartDate >= TrialBalanceByPeriod.GetRangeMax("Date Filter");
- ReportingPeriodEndDate.Add(CalcDate('<-1D>', ThisReportingStartDate));
- end;
-
- var
- ExcelReportsTelemetry: Codeunit "Excel Reports Telemetry";
-
- protected var
- CompanyInformation: Record "Company Information";
- PeriodLength: DateFormula;
- IndentedAccountName: Text;
- ReportingPeriodEndDate: List of [Date];
- ReportingPeriodStartDate: List of [Date];
-
- local procedure BuildDataset(var GLAccount: Record "G/L Account")
- var
- DimensionValue1: Record "Dimension Value";
- DimensionValue2: Record "Dimension Value";
- ThisReportingEndDate: Date;
- ThisReportingStartDate: Date;
- i: Integer;
- begin
- DimensionValue1.SetRange("Global Dimension No.", 1);
- DimensionValue2.SetRange("Global Dimension No.", 2);
-
- for i := 1 to ReportingPeriodStartDate.Count() do begin
- ThisReportingStartDate := ReportingPeriodStartDate.Get(i);
- ThisReportingEndDate := ReportingPeriodEndDate.Get(i);
- GLAccount.SetRange("Date Filter", ThisReportingStartDate, ThisReportingEndDate);
-
- AddGLToDataset(GLAccount, ThisReportingStartDate, ThisReportingEndDate, '', '');
- if DimensionValue1.FindSet() then
- repeat
- AddGLToDataset(GLAccount, ThisReportingStartDate, ThisReportingEndDate, DimensionValue1."Code", '');
- if DimensionValue2.FindSet() then
- repeat
- AddGLToDataset(GLAccount, ThisReportingStartDate, ThisReportingEndDate, DimensionValue1."Code", DimensionValue2."Code");
- until DimensionValue2.Next() = 0;
- until DimensionValue1.Next() = 0;
-
- if DimensionValue2.FindSet() then
- repeat
- AddGLToDataset(GLAccount, ThisReportingStartDate, ThisReportingEndDate, '', DimensionValue2."Code");
- until DimensionValue2.Next() = 0;
- end;
- end;
-
- local procedure AddGLToDataset(var GLAccount: Record "G/L Account"; PeriodStartDate: Date; PeriodEndDate: Date; Dimension1Code: Code[20]; Dimension2Code: Code[20])
- var
- LocalGLAccount: Record "G/L Account";
- begin
- LocalGLAccount.Copy(GLAccount);
- LocalGLAccount.SetFilter("Global Dimension 1 Filter", Dimension1Code);
- LocalGLAccount.SetFilter("Global Dimension 2 Filter", Dimension2Code);
-
- LocalGLAccount.CalcFields("Net Change", "Balance at Date");
- Clear(EXRTrialBalanceBuffer);
- EXRTrialBalanceBuffer."G/L Account No." := LocalGLAccount."No.";
- EXRTrialBalanceBuffer."Period Start" := PeriodStartDate;
- EXRTrialBalanceBuffer."Period End" := PeriodEndDate;
- EXRTrialBalanceBuffer."Dimension 1 Code" := Dimension1Code;
- EXRTrialBalanceBuffer."Dimension 2 Code" := Dimension2Code;
- EXRTrialBalanceBuffer.Validate("Net Change", LocalGLAccount."Net Change");
- EXRTrialBalanceBuffer.Validate("Balance", LocalGLAccount."Balance at Date");
- EXRTrialBalanceBuffer.Insert(true);
- end;
-}
\ No newline at end of file
diff --git a/Apps/W1/ExcelReports/app/src/Financials/EXTAgedAccCaptionHandler.Codeunit.al b/Apps/W1/ExcelReports/app/src/Financials/EXTAgedAccCaptionHandler.Codeunit.al
deleted file mode 100644
index 2ad3835c04..0000000000
--- a/Apps/W1/ExcelReports/app/src/Financials/EXTAgedAccCaptionHandler.Codeunit.al
+++ /dev/null
@@ -1,26 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-
-namespace Microsoft.Finance.ExcelReports;
-
-codeunit 4406 "EXT Aged Acc. Caption Handler"
-{
- Access = Internal;
- EventSubscriberInstance = Manual;
-
- [EventSubscriber(ObjectType::Table, Database::"EXR Aging Report Buffer", 'OnOverrideAgedBy', '', false, false)]
- local procedure HandleOverrideAgedBy(var EXRAgingReportBuffer: Record "EXR Aging Report Buffer" temporary)
- begin
- EXRAgingReportBuffer."Aged By" := GlobalEXRAgingReportBuffer."Aged By";
- end;
-
- internal procedure SetGlobalEXRAgingReportBuffer(var EXRAgingReportBuffer: Record "EXR Aging Report Buffer" temporary)
- begin
- GlobalEXRAgingReportBuffer.Copy(EXRAgingReportBuffer);
- end;
-
- var
- GlobalEXRAgingReportBuffer: Record "EXR Aging Report Buffer";
-}
\ No newline at end of file
diff --git a/Apps/W1/ExcelReports/app/src/Financials/PageExtensions/BusinessUnitList.PageExt.al b/Apps/W1/ExcelReports/app/src/Financials/PageExtensions/BusinessUnitList.PageExt.al
deleted file mode 100644
index e268427f7a..0000000000
--- a/Apps/W1/ExcelReports/app/src/Financials/PageExtensions/BusinessUnitList.PageExt.al
+++ /dev/null
@@ -1,20 +0,0 @@
-namespace Microsoft.Finance.ExcelReports;
-using Microsoft.Finance.Consolidation;
-
-pageextension 4408 "Business Unit List" extends "Business Unit List"
-{
- actions
- {
- addlast("&Reports")
- {
- action("Consolidation - Excel")
- {
- ApplicationArea = All;
- Caption = 'Consolidation reports (Excel)';
- Image = "Report";
- RunObject = report "EXR Consolidated Trial Balance";
- ToolTip = 'View and compare general ledger balances across the different business units.';
- }
- }
- }
-}
\ No newline at end of file
diff --git a/Apps/W1/ExcelReports/app/src/Financials/PageExtensions/FixedAssetList.PageExt.al b/Apps/W1/ExcelReports/app/src/Financials/PageExtensions/FixedAssetList.PageExt.al
deleted file mode 100644
index 86fdedc83f..0000000000
--- a/Apps/W1/ExcelReports/app/src/Financials/PageExtensions/FixedAssetList.PageExt.al
+++ /dev/null
@@ -1,48 +0,0 @@
-namespace Microsoft.Finance.ExcelReports;
-using Microsoft.FixedAssets.FixedAsset;
-
-pageextension 4407 "Fixed Asset List" extends "Fixed Asset List"
-{
- actions
- {
- addlast(reporting)
- {
- action("Fixed Asset Analysis - Excel")
- {
- ApplicationArea = All;
- Caption = 'Analysis (Excel)';
- Image = "Report";
- RunObject = report "EXR Fixed Asset Analysis Excel";
- ToolTip = 'View an analysis of your fixed assets with various types of data for both individual assets and groups of fixed assets.';
- }
- action("Fixed Asset Projected - Excel")
- {
- ApplicationArea = All;
- Caption = 'Projected Value (Excel)';
- Image = "Report";
- RunObject = report "EXR Fixed Asset Projected";
- ToolTip = 'View the calculated future depreciation and book value.';
- }
- action("Fixed Asset Details - Excel")
- {
- ApplicationArea = All;
- Caption = 'Details (Excel)';
- Image = View;
- RunObject = report "EXR Fixed Asset Details Excel";
- ToolTip = 'View detailed information about the fixed asset ledger entries that have been posted to a specified depreciation book for each fixed asset.';
- }
- }
- addlast(Category_Report)
- {
- actionref(FAAnalysisExcel_Promoted; "Fixed Asset Analysis - Excel")
- {
- }
- actionref(FAProjectedExcel_Promoted; "Fixed Asset Projected - Excel")
- {
- }
- actionref(FADetailsExcel_Promoted; "Fixed Asset Details - Excel")
- {
- }
- }
- }
-}
\ No newline at end of file
diff --git a/Apps/W1/ExcelReports/app/src/Financials/TrialBalance.Codeunit.al b/Apps/W1/ExcelReports/app/src/Financials/TrialBalance.Codeunit.al
deleted file mode 100644
index db5481274f..0000000000
--- a/Apps/W1/ExcelReports/app/src/Financials/TrialBalance.Codeunit.al
+++ /dev/null
@@ -1,177 +0,0 @@
-namespace Microsoft.Finance.ExcelReports;
-using Microsoft.Finance.GeneralLedger.Account;
-using Microsoft.Finance.Consolidation;
-using Microsoft.Finance.Dimension;
-
-codeunit 4410 "Trial Balance"
-{
- var
- GlobalBreakdownByDimension: Boolean;
- GlobalBreakdownByBusinessUnit: Boolean;
- BlankLbl: Label '(BLANK)';
-
- internal procedure ConfigureTrialBalance(BreakdownByDimension: Boolean; BreakdownByBusinessUnit: Boolean)
- begin
- GlobalBreakdownByDimension := BreakdownByDimension;
- GlobalBreakdownByBusinessUnit := BreakdownByBusinessUnit;
- end;
-
- internal procedure InsertTrialBalanceReportData(var GLAccount: Record "G/L Account"; var Dimension1Values: Record "Dimension Value" temporary; var Dimension2Values: Record "Dimension Value" temporary; var TrialBalanceData: Record "EXR Trial Balance Buffer")
- var
- DimensionValue: Record "Dimension Value";
- BusinessUnitFilters, Dimension1Filters, Dimension2Filters : List of [Code[20]];
- begin
- if not GLAccount.FindSet() then
- exit;
-
- if GlobalBreakdownByDimension then begin
- DimensionValue.SetRange("Global Dimension No.", 1);
- InsertDimensionFiltersFromDimensionValues(DimensionValue, Dimension1Filters);
- DimensionValue.SetRange("Global Dimension No.", 2);
- InsertDimensionFiltersFromDimensionValues(DimensionValue, Dimension2Filters);
- end;
- if GlobalBreakdownByBusinessUnit then
- InsertBusinessUnitFilters(BusinessUnitFilters);
-
- Clear(TrialBalanceData);
- TrialBalanceData.DeleteAll();
- repeat
- InsertBreakdownForGLAccount(GLAccount, Dimension1Filters, Dimension2Filters, BusinessUnitFilters, TrialBalanceData, Dimension1Values, Dimension2Values);
- until GLAccount.Next() = 0;
- end;
-
- local procedure InsertBusinessUnitFilters(var BusinessUnitFilters: List of [Code[20]])
- var
- BusinessUnit: Record "Business Unit";
- begin
- BusinessUnitFilters.Add('');
- if not BusinessUnit.FindSet() then
- exit;
- repeat
- BusinessUnitFilters.Add(BusinessUnit.Code);
- until BusinessUnit.Next() = 0;
- end;
-
- local procedure InsertDimensionFiltersFromDimensionValues(var DimensionValue: Record "Dimension Value"; var DimensionFilters: List of [Code[20]])
- var
- IsHandled: Boolean;
- begin
- IsHandled := false;
- OnBeforeInsertDimensionFiltersFromDimensionValues(DimensionValue, DimensionFilters, IsHandled);
- if IsHandled then
- exit;
- DimensionFilters.Add('');
- if not DimensionValue.FindSet() then
- exit;
- repeat
- DimensionFilters.Add(DimensionValue.Code);
- until DimensionValue.Next() = 0;
- end;
-
- local procedure InsertBreakdownForGLAccount(var GLAccount: Record "G/L Account"; Dimension1Filters: List of [Code[20]]; Dimension2Filters: List of [Code[20]]; BusinessUnitCodeFilters: List of [Code[20]]; var TrialBalanceData: Record "EXR Trial Balance Buffer"; var Dimension1Values: Record "Dimension Value" temporary; var Dimension2Values: Record "Dimension Value" temporary)
- var
- i, j, k : Integer;
- begin
- if GlobalBreakdownByDimension then
- for i := 1 to Dimension1Filters.Count do
- for j := 1 to Dimension2Filters.Count do
- if GlobalBreakdownByBusinessUnit then
- for k := 1 to BusinessUnitCodeFilters.Count do
- InsertGLAccountTotalsForFilters(Dimension1Filters.Get(i), Dimension2Filters.Get(j), BusinessUnitCodeFilters.Get(k), GLAccount, TrialBalanceData, Dimension1Values, Dimension2Values)
- else
- InsertGLAccountTotalsForFilters(Dimension1Filters.Get(i), Dimension2Filters.Get(j), GLAccount, TrialBalanceData, Dimension1Values, Dimension2Values)
- else
- if GlobalBreakdownByBusinessUnit then
- for i := 1 to BusinessUnitCodeFilters.Count do
- InsertGLAccountTotalsForFilters(BusinessUnitCodeFilters.Get(i), GLAccount, TrialBalanceData)
- else
- InsertGLAccountTotalsForFilters(GLAccount, TrialBalanceData);
- end;
-
- local procedure InsertGLAccountTotalsForFilters(var GLAccount: Record "G/L Account"; var TrialBalanceData: Record "EXR Trial Balance Buffer")
- var
- TempDimension1Values: Record "Dimension Value" temporary;
- TempDimension2Values: Record "Dimension Value" temporary;
- begin
- InsertGLAccountTotalsForFilters('', '', '', GLAccount, TrialBalanceData, TempDimension1Values, TempDimension2Values);
- end;
-
- local procedure InsertGLAccountTotalsForFilters(BusinessUnitCode: Code[20]; var GLAccount: Record "G/L Account"; var TrialBalanceData: Record "EXR Trial Balance Buffer")
- var
- TempDimension1Values: Record "Dimension Value" temporary;
- TempDimension2Values: Record "Dimension Value" temporary;
- begin
- InsertGLAccountTotalsForFilters('', '', BusinessUnitCode, GLAccount, TrialBalanceData, TempDimension1Values, TempDimension2Values);
- end;
-
- local procedure InsertGLAccountTotalsForFilters(Dimension1ValueCode: Code[20]; Dimension2ValueCode: Code[20]; var GLAccount: Record "G/L Account"; var TrialBalanceData: Record "EXR Trial Balance Buffer"; var Dimension1Values: Record "Dimension Value" temporary; var Dimension2Values: Record "Dimension Value" temporary)
- begin
- InsertGLAccountTotalsForFilters(Dimension1ValueCode, Dimension2ValueCode, '', GLAccount, TrialBalanceData, Dimension1Values, Dimension2Values);
- end;
-
- local procedure InsertGLAccountTotalsForFilters(Dimension1ValueCode: Code[20]; Dimension2ValueCode: Code[20]; BusinessUnitCode: Code[20]; var GLAccount: Record "G/L Account"; var TrialBalanceData: Record "EXR Trial Balance Buffer"; var Dimension1Values: Record "Dimension Value" temporary; var Dimension2Values: Record "Dimension Value" temporary)
- var
- LocalGlAccount: Record "G/L Account";
- begin
- LocalGlAccount.Copy(GLAccount);
- if GlobalBreakdownByDimension then begin
- LocalGLAccount.SetFilter("Global Dimension 1 Filter", '= ''%1''', Dimension1ValueCode);
- LocalGLAccount.SetFilter("Global Dimension 2 Filter", '= ''%1''', Dimension2ValueCode);
- end;
- if GlobalBreakdownByBusinessUnit then
- LocalGLAccount.SetFilter("Business Unit Filter", '= %1', BusinessUnitCode);
- InsertTrialBalanceDataForGLAccountWithFilters(LocalGlAccount, Dimension1ValueCode, Dimension2ValueCode, BusinessUnitCode, TrialBalanceData, Dimension1Values, Dimension2Values);
- end;
-
- local procedure InsertTrialBalanceDataForGLAccountWithFilters(var GLAccount: Record "G/L Account"; Dimension1ValueCode: Code[20]; Dimension2ValueCode: Code[20]; BusinessUnitCode: Code[20]; var TrialBalanceData: Record "EXR Trial Balance Buffer"; var Dimension1Values: Record "Dimension Value" temporary; var Dimension2Values: Record "Dimension Value" temporary)
- begin
- Clear(TrialBalanceData);
- GlAccount.CalcFields("Net Change", "Balance at Date", "Additional-Currency Net Change", "Add.-Currency Balance at Date", "Budgeted Amount", "Budget at Date");
- TrialBalanceData."G/L Account No." := GlAccount."No.";
- TrialBalanceData."Dimension 1 Code" := Dimension1ValueCode;
- TrialBalanceData."Dimension 2 Code" := Dimension2ValueCode;
- TrialBalanceData."Business Unit Code" := BusinessUnitCode;
- TrialBalanceData.Validate("Net Change", GLAccount."Net Change");
- TrialBalanceData.Validate(Balance, GLAccount."Balance at Date");
- TrialBalanceData.Validate("Net Change (ACY)", GLAccount."Additional-Currency Net Change");
- TrialBalanceData.Validate("Balance (ACY)", GLAccount."Add.-Currency Balance at Date");
- TrialBalanceData.Validate("Budget (Net)", GLAccount."Budgeted Amount");
- TrialBalanceData.Validate("Budget (Bal. at Date)", GLAccount."Budget at Date");
- TrialBalanceData.CalculateBudgetComparisons();
- TrialBalanceData.CheckAllZero();
- if not TrialBalanceData."All Zero" then begin
- TrialBalanceData.Insert(true);
- if GlobalBreakdownByDimension then begin
- InsertUsedDimensionValue(1, TrialBalanceData."Dimension 1 Code", Dimension1Values);
- InsertUsedDimensionValue(2, TrialBalanceData."Dimension 2 Code", Dimension2Values);
- end;
- end;
- end;
-
- local procedure InsertUsedDimensionValue(GlobalDimensionNo: Integer; DimensionCode: Code[20]; var InsertedDimensionValues: Record "Dimension Value" temporary)
- var
- DimensionValue: Record "Dimension Value";
- begin
- Clear(InsertedDimensionValues);
- if DimensionCode <> '' then
- InsertedDimensionValues.SetRange("Global Dimension No.", GlobalDimensionNo);
- InsertedDimensionValues.SetRange(Code, DimensionCode);
- if not InsertedDimensionValues.IsEmpty() then
- exit;
- if DimensionCode = '' then begin
- InsertedDimensionValues."Dimension Code" := DimensionCode;
- InsertedDimensionValues.Name := BlankLbl;
- InsertedDimensionValues.Insert();
- exit;
- end;
- DimensionValue.CopyFilters(InsertedDimensionValues);
- DimensionValue.FindFirst();
- InsertedDimensionValues.Copy(DimensionValue);
- InsertedDimensionValues.Insert();
- end;
-
- [IntegrationEvent(true, false)]
- local procedure OnBeforeInsertDimensionFiltersFromDimensionValues(var DimensionValue: Record "Dimension Value"; var DimensionFilters: List of [Code[20]]; var IsHandled: Boolean)
- begin
- end;
-}
\ No newline at end of file
diff --git a/Apps/W1/ExcelReports/app/src/RoleCenters/EXRARRoleCenter.PageExt.al b/Apps/W1/ExcelReports/app/src/RoleCenters/EXRARRoleCenter.PageExt.al
deleted file mode 100644
index 15b4c3a7e9..0000000000
--- a/Apps/W1/ExcelReports/app/src/RoleCenters/EXRARRoleCenter.PageExt.al
+++ /dev/null
@@ -1,71 +0,0 @@
-pageextension 4405 EXRARRoleCenter extends "Account Receivables"
-{
- actions
- {
- addlast(Reporting)
- {
- group("Excel Reports")
- {
- Caption = 'Excel Reports';
- Image = Excel;
-
- action(EXRTrialBalanceBudgetExcel)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Trial Balance/Budget (Preview)';
- Image = "Report";
- RunObject = report "EXR Trial BalanceBudgetExcel";
- ToolTip = 'Open a spreadsheet that shows Trial Balance/Budget data.';
- }
- action(EXRTrialBalanceExcel)
- {
- ApplicationArea = Basic, Suite;
-#if not CLEAN25
- Caption = 'Trial Balance (Preview)';
-#else
- Caption = 'Trial Balance';
-#endif
- Image = "Report";
- RunObject = report "EXR Trial Balance Excel";
- ToolTip = 'Open a spreadsheet that shows Trial Balance Excel data.';
- }
- action(EXRTrialBalbyPeriodExcel)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Trial Balance by Period (Preview)';
- Image = "Report";
- RunObject = report "EXR Trial Bal by Period Excel";
- ToolTip = 'Open a spreadsheet that shows Trial Balance by Period data.';
- }
- action(EXRTrialBalPrevYearExcel)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Trial Balance/Previous Year (Preview)';
- Image = "Report";
- RunObject = report "EXR Trial Bal. Prev Year Excel";
- ToolTip = 'Open a spreadsheet that shows Trial Balance/Previous Year data';
- }
- action(EXRAgedAccountsRecExcel)
- {
- ApplicationArea = Basic, Suite;
-#if not CLEAN25
- Caption = 'Aged Accounts Receivable (Preview)';
-#else
- Caption = 'Aged Accounts Receivable';
-#endif
- Image = "Report";
- RunObject = report "EXR Aged Accounts Rec Excel";
- ToolTip = 'Open a spreadsheet that shows the Aged Accounts Receivable data.';
- }
- action(EXRCustomerTopListExcel)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Customer - Top List (Preview)';
- Image = "Report";
- RunObject = report "EXR Customer Top List";
- ToolTip = 'Open a spreadsheet that shows a list of top customers.';
- }
- }
- }
- }
-}
diff --git a/Apps/W1/ExcelReports/app/src/RoleCenters/EXRAccountantRoleCenter.PageExt.al b/Apps/W1/ExcelReports/app/src/RoleCenters/EXRAccountantRoleCenter.PageExt.al
deleted file mode 100644
index 316e7decbb..0000000000
--- a/Apps/W1/ExcelReports/app/src/RoleCenters/EXRAccountantRoleCenter.PageExt.al
+++ /dev/null
@@ -1,129 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-
-namespace Microsoft.ExcelReports;
-
-using Microsoft.Finance.RoleCenters;
-using Microsoft.Sales.ExcelReports;
-using Microsoft.Purchases.ExcelReports;
-using Microsoft.Finance.ExcelReports;
-
-pageextension 4401 "EXR Accountant Role Center" extends "Accountant Role Center"
-{
- actions
- {
- addlast("Excel Reports")
- {
- action(EXRTrialBalanceBudgetExcel)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Trial Balance/Budget (Preview)';
- Image = "Report";
- RunObject = report "EXR Trial BalanceBudgetExcel";
- ToolTip = 'Open a spreadsheet that shows Trial Balance/Budget data.';
- }
- action(EXRTrialBalanceExcel)
- {
- ApplicationArea = Basic, Suite;
-#if not CLEAN25
- Caption = 'Trial Balance (Preview)';
-#else
- Caption = 'Trial Balance';
-#endif
- Image = "Report";
- RunObject = report "EXR Trial Balance Excel";
- ToolTip = 'Open a spreadsheet that shows Trial Balance Excel data.';
- }
- action(EXRTrialBalbyPeriodExcel)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Trial Balance by Period (Preview)';
- Image = "Report";
- RunObject = report "EXR Trial Bal by Period Excel";
- ToolTip = 'Open a spreadsheet that shows Trial Balance by Period data.';
- }
- action(EXRTrialBalPrevYearExcel)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Trial Balance/Previous Year (Preview)';
- Image = "Report";
- RunObject = report "EXR Trial Bal. Prev Year Excel";
- ToolTip = 'Open a spreadsheet that shows Trial Balance/Previous Year data';
- }
- action(EXRAgedAccountsRecExcel)
- {
- ApplicationArea = Basic, Suite;
-#if not CLEAN25
- Caption = 'Aged Accounts Receivable (Preview)';
-#else
- Caption = 'Aged Accounts Receivable';
-#endif
- Image = "Report";
- RunObject = report "EXR Aged Accounts Rec Excel";
- ToolTip = 'Open a spreadsheet that shows the Aged Accounts Receivable data.';
- }
- action(EXRCustomerTopListExcel)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Customer - Top List (Preview)';
- Image = "Report";
- RunObject = report "EXR Customer Top List";
- ToolTip = 'Open a spreadsheet that shows a list of top customers.';
- }
- action(EXRVendorTopList)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Vendor - Top List (Preview)';
- Image = "Report";
- RunObject = report "EXR Vendor Top List";
- ToolTip = 'Open a spreadsheet that shows a list of top vendors.';
- }
- action(EXRAgedAccPayableExcel)
- {
- ApplicationArea = Basic, Suite;
-#if not CLEAN25
- Caption = 'Aged Accounts Payable (Preview)';
-#else
- Caption = 'Aged Accounts Payable';
-#endif
- Image = "Report";
- RunObject = report "EXR Aged Acc Payable Excel";
- ToolTip = 'Open a spreadsheet that shows the Aged Accounts Payable data.';
- }
- action(EXRConsolidatedTrialBalance)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Consolidated Trial Balance (Preview)';
- Image = "Report";
- RunObject = report "EXR Consolidated Trial Balance";
- ToolTip = 'Open an Excel workbook that shows the G/L entries totals in the different business units.';
- }
- action(EXRFixedAssetAnalysisExcel)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Fixed Asset Analysis (Preview)';
- Image = "Report";
- RunObject = report "EXR Fixed Asset Analysis Excel";
- ToolTip = 'Open an Excel workbook that shows a comparison of fixed asset values across a date range.';
- }
- action(EXRFixedAssetDetailsExcel)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Fixed Asset Details (Preview)';
- Image = "Report";
- RunObject = report "EXR Fixed Asset Details Excel";
- ToolTip = 'Open an Excel workbook that shows fixed asset ledger entries.';
- }
- action(EXRFixedAssetProjected)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Fixed Asset Projected Value (Preview)';
- Image = "Report";
- RunObject = report "EXR Fixed Asset Projected";
- ToolTip = 'Open an Excel workbook that shows posted fixed asset ledger entries and projected fixed asset ledger entries.';
- }
- }
- }
-}
\ No newline at end of file
diff --git a/Apps/W1/ExcelReports/app/src/RoleCenters/EXRFinRoleCenter.PageExt.al b/Apps/W1/ExcelReports/app/src/RoleCenters/EXRFinRoleCenter.PageExt.al
deleted file mode 100644
index 033df3f24b..0000000000
--- a/Apps/W1/ExcelReports/app/src/RoleCenters/EXRFinRoleCenter.PageExt.al
+++ /dev/null
@@ -1,150 +0,0 @@
-pageextension 4406 EXRFinRoleCenter extends "Finance Manager Role Center"
-{
- actions
- {
- addafter(Group11)
- {
- group("Excel Reports")
- {
- Caption = 'Excel Reports';
-
- action(EXRTrialBalanceBudgetExcel)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Trial Balance/Budget (Preview)';
- Image = "Report";
- RunObject = report "EXR Trial BalanceBudgetExcel";
- ToolTip = 'Open a spreadsheet that shows Trial Balance/Budget data.';
- }
- action(EXRTrialBalanceExcel)
- {
- ApplicationArea = Basic, Suite;
-#if not CLEAN25
- Caption = 'Trial Balance (Preview)';
-#else
- Caption = 'Trial Balance';
-#endif
- Image = "Report";
- RunObject = report "EXR Trial Balance Excel";
- ToolTip = 'Open a spreadsheet that shows Trial Balance Excel data.';
- }
- action(EXRTrialBalbyPeriodExcel)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Trial Balance by Period (Preview)';
- Image = "Report";
- RunObject = report "EXR Trial Bal by Period Excel";
- ToolTip = 'Open a spreadsheet that shows Trial Balance by Period data.';
- }
- action(EXRTrialBalPrevYearExcel)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Trial Balance/Previous Year (Preview)';
- Image = "Report";
- RunObject = report "EXR Trial Bal. Prev Year Excel";
- ToolTip = 'Open a spreadsheet that shows Trial Balance/Previous Year data';
- }
- action(EXRAgedAccountsRecExcel)
- {
- ApplicationArea = Basic, Suite;
-#if not CLEAN25
- Caption = 'Aged Accounts Receivable (Preview)';
-#else
- Caption = 'Aged Accounts Receivable';
-#endif
- Image = "Report";
- RunObject = report "EXR Aged Accounts Rec Excel";
- ToolTip = 'Open a spreadsheet that shows the Aged Accounts Receivable data.';
- }
- action(EXRCustomerTopListExcel)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Customer - Top List (Preview)';
- Image = "Report";
- RunObject = report "EXR Customer Top List";
- ToolTip = 'Open a spreadsheet that shows a list of top customers.';
- }
- action(EXRVendorTopList)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Vendor - Top List (Preview)';
- Image = "Report";
- RunObject = report "EXR Vendor Top List";
- ToolTip = 'Open a spreadsheet that shows a list of top vendors.';
- }
- action(EXRAgedAccPayableExcel)
- {
- ApplicationArea = Basic, Suite;
-#if not CLEAN25
- Caption = 'Aged Accounts Payable (Preview)';
-#else
- Caption = 'Aged Accounts Payable';
-#endif
- Image = "Report";
- RunObject = report "EXR Aged Acc Payable Excel";
- ToolTip = 'Open a spreadsheet that shows the Aged Accounts Payable data.';
- }
- action(EXRConsolidatedTrialBalance)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Consolidated Trial Balance (Preview)';
- Image = "Report";
- RunObject = report "EXR Consolidated Trial Balance";
- ToolTip = 'Open an Excel workbook that shows the G/L entries totals in the different business units.';
- }
- action(EXRFixedAssetAnalysisExcel)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Fixed Asset Analysis (Preview)';
- Image = "Report";
- RunObject = report "EXR Fixed Asset Analysis Excel";
- ToolTip = 'Open an Excel workbook that shows a comparison of fixed asset values across a date range.';
- }
- action(EXRFixedAssetDetailsExcel)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Fixed Asset Details (Preview)';
- Image = "Report";
- RunObject = report "EXR Fixed Asset Details Excel";
- ToolTip = 'Open an Excel workbook that shows fixed asset ledger entries.';
- }
- action(EXRFixedAssetProjected)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Fixed Asset Projected Value (Preview)';
- Image = "Report";
- RunObject = report "EXR Fixed Asset Projected";
- ToolTip = 'Open an Excel workbook that shows posted fixed asset ledger entries and projected fixed asset ledger entries.';
- }
- }
- }
- addlast(Group45)
- {
- action(EXRFixedAssetAnalysisExcelG45)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Fixed Asset Analysis (Excel)';
- Image = "Report";
- RunObject = report "EXR Fixed Asset Analysis Excel";
- ToolTip = 'Open an Excel workbook that shows a comparison of fixed asset values across a date range.';
- }
- action(EXRFixedAssetDetailsExcelG45)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Fixed Asset Details (Excel)';
- Image = "Report";
- RunObject = report "EXR Fixed Asset Details Excel";
- ToolTip = 'Open an Excel workbook that shows fixed asset ledger entries.';
- }
- action(EXRFixedAssetProjectedG45)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Fixed Asset Projected Value (Excel)';
- Image = "Report";
- RunObject = report "EXR Fixed Asset Projected";
- ToolTip = 'Open an Excel workbook that shows posted fixed asset ledger entries and projected fixed asset ledger entries.';
- }
-
- }
- }
-}
diff --git a/Apps/W1/ExcelReports/app/src/RoleCenters/ExtBusManagerRoleCenter.PageExt.al b/Apps/W1/ExcelReports/app/src/RoleCenters/ExtBusManagerRoleCenter.PageExt.al
deleted file mode 100644
index 41f46fe8db..0000000000
--- a/Apps/W1/ExcelReports/app/src/RoleCenters/ExtBusManagerRoleCenter.PageExt.al
+++ /dev/null
@@ -1,129 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-
-namespace Microsoft.ExcelReports;
-
-using Microsoft.Finance.RoleCenters;
-using Microsoft.Sales.ExcelReports;
-using Microsoft.Purchases.ExcelReports;
-using Microsoft.Finance.ExcelReports;
-
-pageextension 4402 "EXT Bus. Manager Role Center" extends "Business Manager Role Center"
-{
- actions
- {
- addlast("Excel Reports")
- {
- action(EXRTrialBalanceBudgetExcel)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Trial Balance/Budget (Preview)';
- Image = "Report";
- RunObject = report "EXR Trial BalanceBudgetExcel";
- ToolTip = 'Open a spreadsheet that shows Trial Balance/Budget data.';
- }
- action(EXRTrialBalanceExcel)
- {
- ApplicationArea = Basic, Suite;
-#if not CLEAN25
- Caption = 'Trial Balance (Preview)';
-#else
- Caption = 'Trial Balance';
-#endif
- Image = "Report";
- RunObject = report "EXR Trial Balance Excel";
- ToolTip = 'Open a spreadsheet that shows Trial Balance Excel data.';
- }
- action(EXRTrialBalbyPeriodExcel)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Trial Balance by Period (Preview)';
- Image = "Report";
- RunObject = report "EXR Trial Bal by Period Excel";
- ToolTip = 'Open a spreadsheet that shows Trial Balance by Period data.';
- }
- action(EXRTrialBalPrevYearExcel)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Trial Balance/Previous Year (Preview)';
- Image = "Report";
- RunObject = report "EXR Trial Bal. Prev Year Excel";
- ToolTip = 'Open a spreadsheet that shows Trial Balance/Previous Year data';
- }
- action(EXRAgedAccountsRecExcel)
- {
- ApplicationArea = Basic, Suite;
-#if not CLEAN25
- Caption = 'Aged Accounts Receivable (Preview)';
-#else
- Caption = 'Aged Accounts Receivable';
-#endif
- Image = "Report";
- RunObject = report "EXR Aged Accounts Rec Excel";
- ToolTip = 'Open a spreadsheet that shows the Aged Accounts Receivable data.';
- }
- action(EXRCustomerTopListExcel)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Customer - Top List (Preview)';
- Image = "Report";
- RunObject = report "EXR Customer Top List";
- ToolTip = 'Open a spreadsheet that shows a list of top customers.';
- }
- action(EXRVendorTopList)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Vendor - Top List (Preview)';
- Image = "Report";
- RunObject = report "EXR Vendor Top List";
- ToolTip = 'Open a spreadsheet that shows a list of top vendors.';
- }
- action(EXRAgedAccPayableExcel)
- {
- ApplicationArea = Basic, Suite;
-#if not CLEAN25
- Caption = 'Aged Accounts Payable (Preview)';
-#else
- Caption = 'Aged Accounts Payable';
-#endif
- Image = "Report";
- RunObject = report "EXR Aged Acc Payable Excel";
- ToolTip = 'Open a spreadsheet that shows the Aged Accounts Payable data.';
- }
- action(EXRConsolidatedTrialBalance)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Consolidated Trial Balance (Preview)';
- Image = "Report";
- RunObject = report "EXR Consolidated Trial Balance";
- ToolTip = 'Open an Excel workbook that shows the G/L entries totals in the different business units.';
- }
- action(EXRFixedAssetAnalysisExcel)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Fixed Asset Analysis (Preview)';
- Image = "Report";
- RunObject = report "EXR Fixed Asset Analysis Excel";
- ToolTip = 'Open an Excel workbook that shows a comparison of fixed asset values across a date range.';
- }
- action(EXRFixedAssetDetailsExcel)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Fixed Asset Details (Preview)';
- Image = "Report";
- RunObject = report "EXR Fixed Asset Details Excel";
- ToolTip = 'Open an Excel workbook that shows fixed asset ledger entries.';
- }
- action(EXRFixedAssetProjected)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Fixed Asset Projected Value (Preview)';
- Image = "Report";
- RunObject = report "EXR Fixed Asset Projected";
- ToolTip = 'Open an Excel workbook that shows posted fixed asset ledger entries and projected fixed asset ledger entries.';
- }
- }
- }
-}
\ No newline at end of file
diff --git a/Apps/W1/ExcelReports/app/src/RoleCenters/ExtCompanyDetail.PageExt.al b/Apps/W1/ExcelReports/app/src/RoleCenters/ExtCompanyDetail.PageExt.al
deleted file mode 100644
index 3dead624cc..0000000000
--- a/Apps/W1/ExcelReports/app/src/RoleCenters/ExtCompanyDetail.PageExt.al
+++ /dev/null
@@ -1,97 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-
-namespace Microsoft.ExcelReports;
-
-using Microsoft.Sales.ExcelReports;
-using Microsoft.Purchases.ExcelReports;
-using Microsoft.Finance.ExcelReports;
-using Microsoft.Utilities;
-
-pageextension 4403 "EXT Company Detail" extends "Company Detail"
-{
- actions
- {
- addlast("Excel Reports")
- {
- action(EXRTrialBalanceBudgetExcel)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Trial Balance/Budget (Preview)';
- Image = "Report";
- RunObject = report "EXR Trial BalanceBudgetExcel";
- ToolTip = 'Open a spreadsheet that shows Trial Balance/Budget data.';
- }
- action(EXRTrialBalanceExcel)
- {
- ApplicationArea = Basic, Suite;
-#if not CLEAN25
- Caption = 'Trial Balance (Preview)';
-#else
- Caption = 'Trial Balance';
-#endif
- Image = "Report";
- RunObject = report "EXR Trial Balance Excel";
- ToolTip = 'Open a spreadsheet that shows Trial Balance Excel data.';
- }
- action(EXRTrialBalbyPeriodExcel)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Trial Balance by Period (Preview)';
- Image = "Report";
- RunObject = report "EXR Trial Bal by Period Excel";
- ToolTip = 'Open a spreadsheet that shows Trial Balance by Period data.';
- }
- action(EXRTrialBalPrevYearExcel)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Trial Balance/Previous Year (Preview)';
- Image = "Report";
- RunObject = report "EXR Trial Bal. Prev Year Excel";
- ToolTip = 'Open a spreadsheet that shows Trial Balance/Previous Year data';
- }
- action(EXRAgedAccountsRecExcel)
- {
- ApplicationArea = Basic, Suite;
-#if not CLEAN25
- Caption = 'Aged Accounts Receivable (Preview)';
-#else
- Caption = 'Aged Accounts Receivable';
-#endif
- Image = "Report";
- RunObject = report "EXR Aged Accounts Rec Excel";
- ToolTip = 'Open a spreadsheet that shows the Aged Accounts Receivable data.';
- }
- action(EXRCustomerTopListExcel)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Customer - Top List (Preview)';
- Image = "Report";
- RunObject = report "EXR Customer Top List";
- ToolTip = 'Open a spreadsheet that shows a list of top customers.';
- }
- action(EXRVendorTopList)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Vendor - Top List (Preview)';
- Image = "Report";
- RunObject = report "EXR Vendor Top List";
- ToolTip = 'Open a spreadsheet that shows a list of top vendors.';
- }
- action(EXRAgedAccPayableExcel)
- {
- ApplicationArea = Basic, Suite;
-#if not CLEAN25
- Caption = 'Aged Accounts Payable (Preview)';
-#else
- Caption = 'Aged Accounts Payable';
-#endif
- Image = "Report";
- RunObject = report "EXR Aged Acc Payable Excel";
- ToolTip = 'Open a spreadsheet that shows the Aged Accounts Payable data.';
- }
- }
- }
-}
\ No newline at end of file
diff --git a/Apps/W1/ExcelReports/app/src/Vendor/EXRTopVendorBalance.Query.al b/Apps/W1/ExcelReports/app/src/Vendor/EXRTopVendorBalance.Query.al
deleted file mode 100644
index 1fadd89d09..0000000000
--- a/Apps/W1/ExcelReports/app/src/Vendor/EXRTopVendorBalance.Query.al
+++ /dev/null
@@ -1,45 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-
-namespace Microsoft.Purchases.ExcelReports;
-
-using Microsoft.Purchases.Payables;
-
-query 4401 "EXR Top Vendor Balance"
-{
- Caption = 'Top Vendor Balance';
- OrderBy = descending(Balance_LCY);
-
- elements
- {
- dataitem(Detailed_Vendor_Ledger_Entry; "Detailed Vendor Ledg. Entry")
- {
- column(Vendor_No; "Vendor No.")
- {
- }
- column(Balance_LCY; "Amount (LCY)")
- {
- Method = Sum;
- ReverseSign = true;
- }
-
- filter(Posting_Date; "Posting Date")
- {
- }
- filter(InitialEntryGlobalDim1Code; "Initial Entry Global Dim. 1")
- {
- }
- filter(InitialEntryGlobalDim2Code; "Initial Entry Global Dim. 2")
- {
- }
- filter(Currency_Code; "Currency Code")
- {
- }
- filter(VendorPostingGroup; "Posting Group")
- {
- }
- }
- }
-}
diff --git a/Apps/W1/ExcelReports/app/src/Vendor/EXRTopVendorPurchase.Query.al b/Apps/W1/ExcelReports/app/src/Vendor/EXRTopVendorPurchase.Query.al
deleted file mode 100644
index 03569d4547..0000000000
--- a/Apps/W1/ExcelReports/app/src/Vendor/EXRTopVendorPurchase.Query.al
+++ /dev/null
@@ -1,44 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-
-namespace Microsoft.Purchases.ExcelReports;
-
-using Microsoft.Purchases.Payables;
-
-query 4402 "EXR Top Vendor Purchase"
-{
- Caption = 'Top Vendor Purchase';
- OrderBy = descending(Sum_Purch_LCY);
-
- elements
- {
- dataitem(Vendor_Ledger_Entry; "Vendor Ledger Entry")
- {
- column(Vendor_No; "Vendor No.")
- {
- }
- column(Sum_Purch_LCY; "Purchase (LCY)")
- {
- Method = Sum;
- ReverseSign = true;
- }
- filter(GlobalDimension1Code; "Global Dimension 1 Code")
- {
- }
- filter(GlobalDimension2Code; "Global Dimension 2 Code")
- {
- }
- filter(Currency_Code; "Currency Code")
- {
- }
- filter(VendorPostingGroup; "Vendor Posting Group")
- {
- }
- filter(Posting_Date; "Posting Date")
- {
- }
- }
- }
-}
diff --git a/Apps/W1/ExcelReports/app/src/Vendor/EXRTopVendorReportBuffer.Table.al b/Apps/W1/ExcelReports/app/src/Vendor/EXRTopVendorReportBuffer.Table.al
deleted file mode 100644
index c9e33751d2..0000000000
--- a/Apps/W1/ExcelReports/app/src/Vendor/EXRTopVendorReportBuffer.Table.al
+++ /dev/null
@@ -1,128 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-
-namespace Microsoft.Purchases.ExcelReports;
-
-using Microsoft.Purchases.Vendor;
-using Microsoft.Finance.Currency;
-using Microsoft.Finance.Dimension;
-
-table 4404 "EXR Top Vendor Report Buffer"
-{
- Access = Internal;
- Caption = 'Top Vendor Data';
- DataClassification = CustomerContent;
- TableType = Temporary;
- ReplicateData = false;
-
- fields
- {
- field(1; "Vendor No."; Code[20])
- {
- Caption = 'Vendor No.';
- TableRelation = "Vendor";
- }
- field(2; "Vendor Name"; Text[200])
- {
- Caption = 'Name';
- }
- field(10; "Amount (LCY)"; Decimal)
- {
- Caption = 'Amount (LCY)';
- CaptionClass = '3,' + GetAmount1Caption();
- }
- field(12; "Amount 2 (LCY)"; Decimal)
- {
- Caption = 'Amount 2 (LCY)';
- CaptionClass = '3,' + GetAmount2Caption();
- }
- field(13; "Ranking Based On"; Option)
- {
- Caption = 'Ranking Based On';
- OptionCaption = 'Purchases (LCY), Balance (LCY)';
- OptionMembers = "Purchases (LCY)","Balance (LCY)";
- }
- field(44; "Vendor Posting Group"; Code[20])
- {
- Caption = 'Vendor Posting Group';
- TableRelation = "Vendor Posting Group";
- FieldClass = FlowFilter;
- }
- field(45; "Currency Code"; Code[10])
- {
- Caption = 'Currency Code';
- TableRelation = Currency;
- FieldClass = FlowFilter;
- }
- field(46; "Period Start Date"; Date)
- {
- Caption = 'Period Start Date';
- }
- field(100; "Date Filter"; Date)
- {
- Caption = 'Date Filter';
- FieldClass = FlowFilter;
- }
- field(101; "Global Dimension 1 Filter"; Code[20])
- {
- CaptionClass = '1,3,1';
- Caption = 'Global Dimension 1 Filter';
- FieldClass = FlowFilter;
- TableRelation = "Dimension Value".Code where("Global Dimension No." = const(1));
- }
- field(102; "Global Dimension 2 Filter"; Code[20])
- {
- CaptionClass = '1,3,2';
- Caption = 'Global Dimension 2 Filter';
- FieldClass = FlowFilter;
- TableRelation = "Dimension Value".Code where("Global Dimension No." = const(2));
- }
- }
- keys
- {
- key(PK; "Vendor No.", "Period Start Date", "Amount (LCY)")
- {
- Clustered = true;
- }
- }
-
- local procedure GetAmount1Caption(): Text
- var
- NewCaption: Text;
- Handled: Boolean;
- begin
- OnGetAmount1Caption(Handled, NewCaption);
- if not Handled then
- exit(AmountLCYTok);
-
- exit(NewCaption);
- end;
-
- local procedure GetAmount2Caption(): Text
- var
- NewCaption: Text;
- Handled: Boolean;
- begin
- OnGetAmount2Caption(Handled, NewCaption);
- if not Handled then
- exit(Amount2LCYTok);
-
- exit(NewCaption);
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnGetAmount1Caption(var Handled: Boolean; var NewCaption: Text)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnGetAmount2Caption(var Handled: Boolean; var NewCaption: Text)
- begin
- end;
-
- var
- AmountLCYTok: Label 'Amount (LCY)';
- Amount2LCYTok: Label 'Amount 2 (LCY)';
-}
diff --git a/Apps/W1/ExcelReports/app/src/Vendor/EXRVendorTopList.Report.al b/Apps/W1/ExcelReports/app/src/Vendor/EXRVendorTopList.Report.al
deleted file mode 100644
index 7699fe752b..0000000000
--- a/Apps/W1/ExcelReports/app/src/Vendor/EXRVendorTopList.Report.al
+++ /dev/null
@@ -1,268 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-
-namespace Microsoft.Purchases.ExcelReports;
-
-using Microsoft.Purchases.Vendor;
-using Microsoft.ExcelReports;
-
-report 4404 "EXR Vendor Top List"
-{
- ApplicationArea = All;
- Caption = 'Vendor - Top List Excel (Preview)';
- DataAccessIntent = ReadOnly;
- DefaultRenderingLayout = VendorTopTrendExcel;
- ExcelLayoutMultipleDataSheets = true;
- UsageCategory = ReportsAndAnalysis;
- MaximumDatasetSize = 1000000;
-
- dataset
- {
- dataitem(TopVendorData; "EXR Top Vendor Report Buffer")
- {
- RequestFilterHeading = 'Top vendor filters';
- RequestFilterFields = "Vendor No.", "Vendor Posting Group", "Currency Code", "Date Filter";
- DataItemTableView = sorting("Amount (LCY)", "Vendor No.");
- column(VendorNo; TopVendorData."Vendor No.")
- {
- IncludeCaption = true;
- }
- column(VendorName; TopVendorData."Vendor Name")
- {
- IncludeCaption = true;
- }
- column(AmountLCY; TopVendorData."Amount (LCY)")
- {
- IncludeCaption = true;
- }
- column(Amount2LCY; TopVendorData."Amount 2 (LCY)")
- {
- IncludeCaption = true;
- }
- }
- }
-
- requestpage
- {
- AboutText = 'This report contains aggregated purchase (LCY) and balance (LCY) data for the top number of vendors selected. The data is aggregated for the period specified in the request page''s Datefilter parameter.';
- AboutTitle = 'Vendor - Top Trends';
- SaveValues = true;
- layout
- {
- area(content)
- {
- group(Options)
- {
- Caption = 'Options';
-
- field(Show; GlobalExtTopVendorReportBuffer."Ranking Based On")
- {
- ApplicationArea = Suite;
- Caption = 'Show';
- OptionCaption = 'Purchases (LCY),Balance (LCY)';
- ToolTip = 'Specifies how the report will sort the vendors: Purchases, to sort by purchase volume; or balance. In either case, the vendors with the largest amounts will be shown first.';
-
- trigger OnValidate()
- begin
- ChangeShowType(GlobalExtTopVendorReportBuffer."Ranking Based On");
- end;
- }
- field(Quantity; NoOfRecordsToPrint)
- {
- ApplicationArea = Suite;
- Caption = 'Quantity';
- ToolTip = 'Specifies the number of vendors that will be included in the report.';
- }
- }
- }
- }
-
- trigger OnOpenPage()
- begin
- NoOfRecordsToPrint := 10;
- ChangeShowType(GlobalExtTopVendorReportBuffer."Ranking Based On"::"Purchases (LCY)");
- end;
- }
- rendering
- {
- layout(VendorTopTrendExcel)
- {
- Type = Excel;
- Caption = 'Vendor - Top Trends Excel';
- LayoutFile = './ReportLayouts/Excel/Vendor/VendorTopListExcel.xlsx';
- Summary = 'Built in layout for the Vendor - Top Trends excel report. This report contains aggregated purchase (LCY) and balance (LCY) data for the top number of vendors selected. Report uses Query connections.';
- }
- }
- labels
- {
- DataRetrieved = 'Data retrieved:';
- RankAccordingTo = 'Rank according to:';
- TopVendorListLabel = 'Top Vendor List';
- }
-
- var
- ExcelReportsTelemetry: Codeunit "Excel Reports Telemetry";
-
- protected var
- GlobalExtTopVendorReportBuffer: Record "EXR Top Vendor Report Buffer";
- EXTTopVendorCaptionHandler: Codeunit "EXT Top Vendor Caption Handler";
- NoOfRecordsToPrint: Integer;
-
- trigger OnPreReport()
- begin
- ExcelReportsTelemetry.LogReportUsage(Report::"EXR Vendor Top List");
- BindSubscription(EXTTopVendorCaptionHandler);
- BuildDataSet();
- end;
-
- local procedure BuildDataSet()
- var
- VendorFilter: Text;
- begin
- if GlobalExtTopVendorReportBuffer."Ranking Based On" = GlobalExtTopVendorReportBuffer."Ranking Based On"::"Purchases (LCY)" then begin
- VendorFilter := GetEntriesForTopVendorsBasedOnPurchases();
- FillDataForTopVendorsBasedOnPurchases(VendorFilter);
- exit;
- end;
-
- if GlobalExtTopVendorReportBuffer."Ranking Based On" = GlobalExtTopVendorReportBuffer."Ranking Based On"::"Balance (LCY)" then begin
- VendorFilter := GetEntriesForTopVendorsBasedOnBalance();
- FillDataForTopVendorsBasedOnBalance(VendorFilter);
- exit;
- end;
- end;
-
- local procedure GetEntriesForTopVendorsBasedOnPurchases(): Text
- var
- EXTTopVendorPurchase: Query "EXR Top Vendor Purchase";
- VendorFilter: Text;
- begin
- EXTTopVendorPurchase.TopNumberOfRows := NoOfRecordsToPrint;
- TransferFilters(EXTTopVendorPurchase, TopVendorData);
- EXTTopVendorPurchase.Open();
- if EXTTopVendorPurchase.Read() then
- repeat
- InsertAggregatedPurchases(EXTTopVendorPurchase.Vendor_No, EXTTopVendorPurchase.Sum_Purch_LCY);
- VendorFilter += EscapeVendorNoFilter(EXTTopVendorPurchase.Vendor_No) + '|';
- until (not EXTTopVendorPurchase.Read());
-
- exit(VendorFilter.TrimEnd('|'));
- end;
-
- local procedure GetEntriesForTopVendorsBasedOnBalance(): Text
- var
- EXTTopVendorBalance: Query "EXR Top Vendor Balance";
- VendorFilter: Text;
- begin
- EXTTopVendorBalance.TopNumberOfRows := NoOfRecordsToPrint;
- TransferFilters(EXTTopVendorBalance, TopVendorData);
- EXTTopVendorBalance.Open();
- if EXTTopVendorBalance.Read() then
- repeat
- InsertAggregatedPurchases(EXTTopVendorBalance.Vendor_No, EXTTopVendorBalance.Balance_LCY);
- VendorFilter += EscapeVendorNoFilter(EXTTopVendorBalance.Vendor_No) + '|';
- until (not EXTTopVendorBalance.Read());
-
- exit(VendorFilter.TrimEnd('|'));
- end;
-
- local procedure EscapeVendorNoFilter(VendorNo: Code[20]): Text
- begin
- exit('''' + VendorNo + '''');
- end;
-
- local procedure ChangeShowType(NewShowType: Option)
- begin
- GlobalExtTopVendorReportBuffer."Ranking Based On" := NewShowType;
- EXTTopVendorCaptionHandler.SetRankingBasedOn(GlobalExtTopVendorReportBuffer."Ranking Based On");
- end;
-
- local procedure FillDataForTopVendorsBasedOnBalance(VendorFilter: Text)
- var
- Vendor: Record Vendor;
- EXTTopVendorPurchase: Query "EXR Top Vendor Purchase";
- begin
- TransferFilters(EXTTopVendorPurchase, TopVendorData);
- EXTTopVendorPurchase.SetFilter(EXTTopVendorPurchase.Vendor_No, VendorFilter);
- EXTTopVendorPurchase.Open();
- if EXTTopVendorPurchase.Read() then
- repeat
- TopVendorData.SetFilter(TopVendorData."Vendor No.", EscapeVendorNoFilter(EXTTopVendorPurchase.Vendor_No));
- if TopVendorData.FindFirst() then begin
- TopVendorData."Amount 2 (LCY)" := EXTTopVendorPurchase.Sum_Purch_LCY;
- if Vendor.Get(TopVendorData."Vendor No.") then
- TopVendorData."Vendor Name" := Vendor.Name;
- TopVendorData.Modify();
- end;
- until (not EXTTopVendorPurchase.Read());
- end;
-
- local procedure FillDataForTopVendorsBasedOnPurchases(VendorFilter: Text)
- var
- Vendor: Record Vendor;
- EXTTopVendorBalance: Query "EXR Top Vendor Balance";
- begin
- TransferFilters(EXTTopVendorBalance, TopVendorData);
- EXTTopVendorBalance.SetFilter(EXTTopVendorBalance.Vendor_No, VendorFilter);
- EXTTopVendorBalance.Open();
- if EXTTopVendorBalance.Read() then
- repeat
- TopVendorData.SetFilter(TopVendorData."Vendor No.", EXTTopVendorBalance.Vendor_No);
- if TopVendorData.FindFirst() then begin
- TopVendorData."Amount 2 (LCY)" := EXTTopVendorBalance.Balance_LCY;
- if Vendor.Get(TopVendorData."Vendor No.") then
- TopVendorData."Vendor Name" := Vendor.Name;
- TopVendorData.Modify();
- end;
- until (not EXTTopVendorBalance.Read());
- end;
-
- local procedure InsertAggregatedPurchases(VendorNo: Code[20]; AmountLCY: Decimal)
- begin
- Clear(TopVendorData);
- TopVendorData."Vendor No." := VendorNo;
- TopVendorData."Amount (LCY)" := AmountLCY;
- TopVendorData."Ranking Based On" := GlobalExtTopVendorReportBuffer."Ranking Based On";
- TopVendorData.Insert();
- end;
-
- local procedure TransferFilters(var EXTTopVendorBalance: Query "EXR Top Vendor Balance"; var EXRTopReportBuffer: Record "EXR Top Vendor Report Buffer")
- begin
- EXTTopVendorBalance.TopNumberOfRows := NoOfRecordsToPrint;
- if EXRTopReportBuffer.GetFilter("Global Dimension 1 Filter") <> '' then
- EXTTopVendorBalance.SetFilter(EXTTopVendorBalance.InitialEntryGlobalDim1Code, EXRTopReportBuffer.GetFilter("Global Dimension 1 Filter"));
-
- if EXRTopReportBuffer.GetFilter("Global Dimension 2 Filter") <> '' then
- EXTTopVendorBalance.SetFilter(EXTTopVendorBalance.InitialEntryGlobalDim2Code, EXRTopReportBuffer.GetFilter("Global Dimension 2 Filter"));
-
- if EXRTopReportBuffer.GetFilter("Currency Code") <> '' then
- EXTTopVendorBalance.SetFilter(EXTTopVendorBalance.Currency_Code, EXRTopReportBuffer.GetFilter("Currency Code"));
-
- if EXRTopReportBuffer.GetFilter("Vendor Posting Group") <> '' then
- EXTTopVendorBalance.SetFilter(EXTTopVendorBalance.VendorPostingGroup, EXRTopReportBuffer.GetFilter("Vendor Posting Group"));
-
- if EXRTopReportBuffer.GetFilter("Date Filter") <> '' then
- EXTTopVendorBalance.SetFilter(EXTTopVendorBalance.Posting_Date, EXRTopReportBuffer.GetFilter("Date Filter"));
- end;
-
- local procedure TransferFilters(var EXTTopVendorPurchase: Query "EXR Top Vendor Purchase"; var EXRTopReportBuffer: Record "EXR Top Vendor Report Buffer")
- begin
- EXTTopVendorPurchase.TopNumberOfRows := NoOfRecordsToPrint;
- if EXRTopReportBuffer.GetFilter("Global Dimension 1 Filter") <> '' then
- EXTTopVendorPurchase.SetFilter(EXTTopVendorPurchase.GlobalDimension1Code, EXRTopReportBuffer.GetFilter("Global Dimension 1 Filter"));
-
- if EXRTopReportBuffer.GetFilter("Global Dimension 2 Filter") <> '' then
- EXTTopVendorPurchase.SetFilter(EXTTopVendorPurchase.GlobalDimension2Code, EXRTopReportBuffer.GetFilter("Global Dimension 2 Filter"));
-
- if EXRTopReportBuffer.GetFilter("Currency Code") <> '' then
- EXTTopVendorPurchase.SetFilter(EXTTopVendorPurchase.Currency_Code, EXRTopReportBuffer.GetFilter("Currency Code"));
-
- if EXRTopReportBuffer.GetFilter("Vendor Posting Group") <> '' then
- EXTTopVendorPurchase.SetFilter(EXTTopVendorPurchase.VendorPostingGroup, EXRTopReportBuffer.GetFilter("Vendor Posting Group"));
-
- if EXRTopReportBuffer.GetFilter("Date Filter") <> '' then
- EXTTopVendorPurchase.SetFilter(EXTTopVendorPurchase.Posting_Date, EXRTopReportBuffer.GetFilter("Date Filter"));
- end;
-}
diff --git a/Apps/W1/ExcelReports/app/src/Vendor/ExtTopVendorCaptionHandler.Codeunit.al b/Apps/W1/ExcelReports/app/src/Vendor/ExtTopVendorCaptionHandler.Codeunit.al
deleted file mode 100644
index 94e3bb1142..0000000000
--- a/Apps/W1/ExcelReports/app/src/Vendor/ExtTopVendorCaptionHandler.Codeunit.al
+++ /dev/null
@@ -1,49 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-
-namespace Microsoft.Purchases.ExcelReports;
-
-codeunit 4404 "EXT Top Vendor Caption Handler"
-{
- EventSubscriberInstance = Manual;
- Access = Internal;
-
- [EventSubscriber(ObjectType::Table, Database::"EXR Top Vendor Report Buffer", 'OnGetAmount1Caption', '', false, false)]
- local procedure GetAmount1Caption(var NewCaption: Text; var Handled: Boolean)
- begin
- if (EXTTopReportBuffer."Ranking Based On" = EXTTopReportBuffer."Ranking Based On"::"Balance (LCY)") then begin
- NewCaption := BalanceLCYTok;
- Handled := true;
- exit;
- end;
-
- NewCaption := PurchasesLCYTok;
- Handled := true;
- end;
-
- [EventSubscriber(ObjectType::Table, Database::"EXR Top Vendor Report Buffer", 'OnGetAmount2Caption', '', false, false)]
- local procedure GetAmount2Caption(var NewCaption: Text; var Handled: Boolean)
- begin
- if EXTTopReportBuffer."Ranking Based On" <> EXTTopReportBuffer."Ranking Based On"::"Balance (LCY)" then begin
- NewCaption := BalanceLCYTok;
- Handled := true;
- exit;
- end;
-
- NewCaption := PurchasesLCYTok;
- Handled := true;
- end;
-
- internal procedure SetRankingBasedOn(NewRankingBasedOn: Option)
- begin
- EXTTopReportBuffer."Ranking Based On" := NewRankingBasedOn;
- end;
-
- var
- EXTTopReportBuffer: Record "EXR Top Vendor Report Buffer";
- BalanceLCYTok: Label 'Balance (LCY)';
- PurchasesLCYTok: Label 'Purchases (LCY)';
-
-}
\ No newline at end of file
diff --git a/Apps/W1/ExcelReports/app/src/permissions/D365BASICISVFEReports.PermissionSetExt.al b/Apps/W1/ExcelReports/app/src/permissions/D365BASICISVFEReports.PermissionSetExt.al
deleted file mode 100644
index 8c350ef9f7..0000000000
--- a/Apps/W1/ExcelReports/app/src/permissions/D365BASICISVFEReports.PermissionSetExt.al
+++ /dev/null
@@ -1,13 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-
-namespace Microsoft.ExcelReports;
-
-using System.Security.AccessControl;
-
-permissionsetextension 4400 "D365 BASIC ISV - FE Reports" extends "D365 BASIC ISV"
-{
- IncludedPermissionSets = "Excel Reports - Objects";
-}
diff --git a/Apps/W1/ExcelReports/app/src/permissions/D365BUSFULLACCESSFEReports.PermissionSetExt.al b/Apps/W1/ExcelReports/app/src/permissions/D365BUSFULLACCESSFEReports.PermissionSetExt.al
deleted file mode 100644
index 1d346586fc..0000000000
--- a/Apps/W1/ExcelReports/app/src/permissions/D365BUSFULLACCESSFEReports.PermissionSetExt.al
+++ /dev/null
@@ -1,8 +0,0 @@
-namespace Microsoft.ExcelReports;
-
-using System.Security.AccessControl;
-
-permissionsetextension 4401 "D365 BUS FULL ACCESS - FE Reports" extends "D365 BUS FULL ACCESS"
-{
- IncludedPermissionSets = "Excel Reports - Objects";
-}
diff --git a/Apps/W1/ExcelReports/app/src/permissions/D365BUSPREMIUMFEReports.PermissionSetExt.al b/Apps/W1/ExcelReports/app/src/permissions/D365BUSPREMIUMFEReports.PermissionSetExt.al
deleted file mode 100644
index f44ca8a43f..0000000000
--- a/Apps/W1/ExcelReports/app/src/permissions/D365BUSPREMIUMFEReports.PermissionSetExt.al
+++ /dev/null
@@ -1,13 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-
-namespace Microsoft.ExcelReports;
-
-using System.Security.AccessControl;
-
-permissionsetextension 4402 "D365 BUS PREMIUM - FE Reports" extends "D365 BUS PREMIUM"
-{
- IncludedPermissionSets = "Excel Reports - Objects";
-}
diff --git a/Apps/W1/ExcelReports/app/src/permissions/D365READFEReports.PermissionSetExt.al b/Apps/W1/ExcelReports/app/src/permissions/D365READFEReports.PermissionSetExt.al
deleted file mode 100644
index 840ae5a951..0000000000
--- a/Apps/W1/ExcelReports/app/src/permissions/D365READFEReports.PermissionSetExt.al
+++ /dev/null
@@ -1,13 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-
-namespace Microsoft.ExcelReports;
-
-using System.Security.AccessControl;
-
-permissionsetextension 4404 "D365 READ - FE Reports" extends "D365 READ"
-{
- IncludedPermissionSets = "Excel Reports - Objects";
-}
diff --git a/Apps/W1/ExcelReports/app/src/permissions/ExcelReportsObjects.PermissionSet.al b/Apps/W1/ExcelReports/app/src/permissions/ExcelReportsObjects.PermissionSet.al
deleted file mode 100644
index c3999ad2f9..0000000000
--- a/Apps/W1/ExcelReports/app/src/permissions/ExcelReportsObjects.PermissionSet.al
+++ /dev/null
@@ -1,35 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-
-namespace Microsoft.ExcelReports;
-
-using Microsoft.Finance.ExcelReports;
-using Microsoft.Sales.ExcelReports;
-using Microsoft.Purchases.ExcelReports;
-
-permissionset 4401 "Excel Reports - Objects"
-{
- Assignable = false;
- Access = Internal;
-
- Permissions = table "EXR Aging Report Buffer" = X,
- table "EXR Top Customer Report Buffer" = X,
- table "EXR Top Vendor Report Buffer" = X,
- table "EXR Trial Balance Buffer" = X,
- report "EXR Aged Acc Payable Excel" = X,
- report "EXR Aged Accounts Rec Excel" = X,
- report "EXR Customer Top List" = X,
- report "EXR Trial Bal by Period Excel" = X,
- report "EXR Trial Bal. Prev Year Excel" = X,
- report "EXR Trial Balance Excel" = X,
- report "EXR Trial BalanceBudgetExcel" = X,
- report "EXR Vendor Top List" = X,
- codeunit "EXT Top Cust. Caption Handler" = X,
- codeunit "EXT Top Vendor Caption Handler" = X,
- query "EXR Top Customer Balance" = X,
- query "EXR Top Customer Sales" = X,
- query "EXR Top Vendor Balance" = X,
- query "EXR Top Vendor Purchase" = X;
-}
\ No newline at end of file
diff --git a/Apps/W1/ExcelReports/test/ExtensionLogo.png b/Apps/W1/ExcelReports/test/ExtensionLogo.png
deleted file mode 100644
index 4d2c9a626c..0000000000
Binary files a/Apps/W1/ExcelReports/test/ExtensionLogo.png and /dev/null differ
diff --git a/Apps/W1/ExcelReports/test/src/FixedAssetExcelReports.Codeunit.al b/Apps/W1/ExcelReports/test/src/FixedAssetExcelReports.Codeunit.al
deleted file mode 100644
index 17840bb90a..0000000000
--- a/Apps/W1/ExcelReports/test/src/FixedAssetExcelReports.Codeunit.al
+++ /dev/null
@@ -1,97 +0,0 @@
-namespace Microsoft.Finance.ExcelReports.Test;
-using Microsoft.FixedAssets.Posting;
-using Microsoft.FixedAssets.FixedAsset;
-using Microsoft.FixedAssets.Depreciation;
-using System.TestLibraries.Utilities;
-using Microsoft.Finance.ExcelReports;
-
-codeunit 139545 "Fixed Asset Excel Reports"
-{
- Subtype = Test;
- TestPermissions = Disabled;
-
- var
- LibraryFixedAsset: Codeunit "Library - Fixed Asset";
- LibraryReportDataset: Codeunit "Library - Report Dataset";
- LibraryVariableStorage: Codeunit "Library - Variable Storage";
- Assert: Codeunit Assert;
-
- [Test]
- [HandlerFunctions('EXRFixedAssetAnalysisExcelHandler')]
- procedure FirstTimeOpeningRequestPageOfFixedAssetAnalysisShouldInsertPostingTypes()
- var
- RequestPageXml: Text;
- begin
- // [SCENARIO 544231] First time opening the Fixed Asset Analysis Excel report requestpage should insert the FixedAssetTypes required by the report
- // [GIVEN] There is no FA Posting Type
- CleanupFixedAssetData();
- Commit();
- Assert.TableIsEmpty(Database::"FA Posting Type");
- // [WHEN] Opening the requestpage of the Fixed Asset Analysis report
- RequestPageXml := Report.RunRequestPage(Report::"EXR Fixed Asset Analysis Excel", RequestPageXml);
- // [THEN] The default FA Posting Type's are inserted
- Assert.TableIsNotEmpty(Database::"FA Posting Type");
- end;
-
- [Test]
- [HandlerFunctions('EXRFixedAssetAnalysisExcelHandler')]
- procedure FixedAssetAnalysisShouldntExportFixedAssetWithoutEntries()
- var
- FixedAsset: Record "Fixed Asset";
- DepreciationBook: Record "Depreciation Book";
- FADepreciationBook: Record "FA Depreciation Book";
- Variant: Variant;
- VariantText: Text;
- ReportAcquisitionDate: Date;
- RequestPageXml: Text;
- begin
- // [SCENARIO 546182] Fixed Asset Analysis report should report the correct acquisition date and not export fixed assets if they have no entries.
- CleanupFixedAssetData();
- LibraryFixedAsset.CreateDepreciationBook(DepreciationBook);
- // [GIVEN] An acquired fixed asset
- FixedAsset."No." := 'FA01';
- LibraryFixedAsset.CreateFixedAsset(FixedAsset);
- LibraryFixedAsset.CreateFADepreciationBook(FADepreciationBook, FixedAsset."No.", DepreciationBook.Code);
- FADepreciationBook."Acquisition Date" := WorkDate();
- FADepreciationBook.Modify();
- // [GIVEN] An unacquired fixed asset (no entries)
- FixedAsset."No." := 'FA02';
- LibraryFixedAsset.CreateFixedAsset(FixedAsset);
- Commit();
- // [WHEN] Running the fixed asset analysis excel report
- LibraryVariableStorage.Enqueue(DepreciationBook.Code);
- RequestPageXml := Report.RunRequestPage(Report::"EXR Fixed Asset Analysis Excel", RequestPageXml);
- LibraryReportDataset.RunReportAndLoad(report::"EXR Fixed Asset Analysis Excel", Variant, RequestPageXml);
- // [THEN] The dataset contains both fixed assets
- LibraryReportDataset.SetXmlNodeList('DataItem[@name="FixedAssetData"]');
- Assert.AreEqual(1, LibraryReportDataset.RowCount(), 'Just the acquired fixed asset should be exported on the report');
- // [THEN] Only the first fixed asset has defined AcquisitionDate
- LibraryReportDataset.GetNextRow();
- LibraryReportDataset.FindCurrentRowValue('AcquisitionDateField', Variant);
- VariantText := Variant;
- Evaluate(ReportAcquisitionDate, VariantText);
- Assert.AreEqual(FADepreciationBook."Acquisition Date", ReportAcquisitionDate, 'Acquisition date of first fixed asset should match the one in the depreciation book');
- end;
-
- local procedure CleanupFixedAssetData()
- var
- FAPostingType: Record "FA Posting Type";
- FixedAsset: Record "Fixed Asset";
- begin
- FAPostingType.DeleteAll();
- FixedAsset.DeleteAll();
- end;
-
- [RequestPageHandler]
- procedure EXRFixedAssetAnalysisExcelHandler(var EXRFixedAssetAnalysisExcel: TestRequestPage "EXR Fixed Asset Analysis Excel")
- var
- DepreciationBookCode: Code[10];
- begin
- if LibraryVariableStorage.Length() = 1 then begin
- DepreciationBookCode := CopyStr(LibraryVariableStorage.DequeueText(), 1, 10);
- EXRFixedAssetAnalysisExcel.DepreciationBookCodeField.SetValue(DepreciationBookCode);
- end;
- EXRFixedAssetAnalysisExcel.OK().Invoke();
- end;
-
-}
\ No newline at end of file
diff --git a/Apps/W1/ExcelReports/test/src/TrialBalanceExcelReports.Codeunit.al b/Apps/W1/ExcelReports/test/src/TrialBalanceExcelReports.Codeunit.al
deleted file mode 100644
index 734e4fdd42..0000000000
--- a/Apps/W1/ExcelReports/test/src/TrialBalanceExcelReports.Codeunit.al
+++ /dev/null
@@ -1,461 +0,0 @@
-namespace Microsoft.Finance.ExcelReports.Test;
-
-using Microsoft.Finance.GeneralLedger.Account;
-using Microsoft.Finance.GeneralLedger.Ledger;
-using Microsoft.Finance.ExcelReports;
-using Microsoft.Finance.Dimension;
-using Microsoft.Finance.Consolidation;
-
-codeunit 139544 "Trial Balance Excel Reports"
-{
- Subtype = Test;
- TestPermissions = Disabled;
-
- var
- LibraryERM: Codeunit "Library - ERM";
- LibraryReportDataset: Codeunit "Library - Report Dataset";
- Assert: Codeunit Assert;
-
- [Test]
- [HandlerFunctions('EXRTrialBalanceExcelHandler')]
- procedure TrialBalanceExportsAsManyItemsAsGLAccounts()
- var
- Variant: Variant;
- RequestPageXml: Text;
- begin
- // [SCENARIO] An empty report should export all GL Accounts regardless
- // [GIVEN] An empty trial balance
- CleanUpTrialBalanceData();
- // [GIVEN] 5 G/L Accounts
- CreateSampleGLAccounts(5);
- Commit();
- // [WHEN] Running the report
- RequestPageXml := Report.RunRequestPage(Report::"EXR Trial Balance Excel", RequestPageXml);
- LibraryReportDataset.RunReportAndLoad(Report::"EXR Trial Balance Excel", Variant, RequestPageXml);
- // [THEN] 5 rows of type GLAccount should be exported
- Assert.AreEqual(5, LibraryReportDataset.RowCount(), 'Only the GLAccounts should be exported');
- LibraryReportDataset.SetXmlNodeList('DataItem[@name="GLAccounts"]');
- Assert.AreEqual(5, LibraryReportDataset.RowCount(), 'The exported items should be GLAccounts');
- end;
-
- [Test]
- [HandlerFunctions('EXRTrialBalanceBudgetExcelHandler')]
- procedure TrialBalanceBudgetExportsAsManyItemsAsGLAccounts()
- var
- Variant: Variant;
- RequestPageXml: Text;
- begin
- // [SCENARIO] An empty report should export all GL Accounts regardless
- // [GIVEN] An empty trial balance
- CleanUpTrialBalanceData();
- // [GIVEN] 7 G/L Accounts
- CreateSampleGLAccounts(7);
- Commit();
- // [WHEN] Running the report
- RequestPageXml := Report.RunRequestPage(Report::"EXR Trial BalanceBudgetExcel", RequestPageXml);
- LibraryReportDataset.RunReportAndLoad(Report::"EXR Trial BalanceBudgetExcel", Variant, RequestPageXml);
- // [THEN] 7 rows of type GLAccount should be exported
- Assert.AreEqual(7, LibraryReportDataset.RowCount(), 'Only the GLAccounts should be exported');
- LibraryReportDataset.SetXmlNodeList('DataItem[@name="GLAccounts"]');
- Assert.AreEqual(7, LibraryReportDataset.RowCount(), 'The exported items should be GLAccounts');
- end;
-
-
- [Test]
- [HandlerFunctions('EXRConsolidatedTrialBalanceHandler')]
- procedure ConsolidatedTrialBalanceExportsAsManyItemsAsGLAccountsAndBusinessUnits()
- var
- Variant: Variant;
- RequestPageXml: Text;
- begin
- // [SCENARIO] An empty Consolidation report should export all GL Accounts regardless and all Business Units
- // [GIVEN] An empty trial balance
- CleanUpTrialBalanceData();
- // [GIVEN] 9 G/L Accounts
- CreateSampleGLAccounts(9);
- // [GIVEN] 3 Business units
- CreateSampleBusinessUnits(3);
- Commit();
- // [WHEN] Running the report
- RequestPageXml := Report.RunRequestPage(Report::"EXR Consolidated Trial Balance", RequestPageXml);
- LibraryReportDataset.RunReportAndLoad(Report::"EXR Consolidated Trial Balance", Variant, RequestPageXml);
- // [THEN] The 9 GLAccount rows and 3 Business Unit rows should be exported
- Assert.AreEqual(9 + 3, LibraryReportDataset.RowCount(), 'Only GL Accounts and Business Units should be exported');
- LibraryReportDataset.SetXmlNodeList('DataItem[@name="GLAccounts"]');
- Assert.AreEqual(9, LibraryReportDataset.RowCount(), 'Created GL Accounts should be exported');
- LibraryReportDataset.SetXmlNodeList('DataItem[@name="BusinessUnits"]');
- Assert.AreEqual(3, LibraryReportDataset.RowCount(), 'Created BusinessUnits should be exported');
- end;
-
- [Test]
- [HandlerFunctions('EXRTrialBalanceExcelHandler')]
- procedure TrialBalanceDoesntExportDimensionValuesIfUnused()
- var
- Variant: Variant;
- RequestPageXml: Text;
- begin
- // [SCENARIO] An empty report should only export GL Accounts, even if there are dimensions
- // [GIVEN] An empty trial balance
- CleanUpTrialBalanceData();
- // [GIVEN] 3 GL Accounts
- CreateSampleGLAccounts(3);
- // [GIVEN] 2 Global Dimensions, with Dimension Values
- CreateSampleGlobalDimensionAndDimensionValues();
- Commit();
- // [WHEN] Running the report
- RequestPageXml := Report.RunRequestPage(Report::"EXR Trial Balance Excel", RequestPageXml);
- LibraryReportDataset.RunReportAndLoad(Report::"EXR Trial Balance Excel", Variant, RequestPageXml);
- // [THEN] Only the GL Accounts should be exported
- Assert.AreEqual(3, LibraryReportDataset.RowCount(), 'Only the GLAccounts should be exported');
- LibraryReportDataset.SetXmlNodeList('DataItem[@name="GLAccounts"]');
- Assert.AreEqual(3, LibraryReportDataset.RowCount(), 'The exported items should be GLAccounts');
- end;
-
- [Test]
- [HandlerFunctions('EXRTrialBalanceBudgetExcelHandler')]
- procedure TrialBalanceBudgetDoesntExportDimensionValuesIfUnused()
- var
- Variant: Variant;
- RequestPageXml: Text;
- begin
- // [SCENARIO] An empty report should only export GL Accounts, even if there are dimensions
- // [GIVEN] An empty trial balance
- CleanUpTrialBalanceData();
- // [GIVEN] 6 GL Accounts
- CreateSampleGLAccounts(6);
- // [GIVEN] 2 Global Dimensions, with Dimension Values
- CreateSampleGlobalDimensionAndDimensionValues();
- Commit();
- // [WHEN] Running the report
- RequestPageXml := Report.RunRequestPage(Report::"EXR Trial BalanceBudgetExcel", RequestPageXml);
- LibraryReportDataset.RunReportAndLoad(Report::"EXR Trial BalanceBudgetExcel", Variant, RequestPageXml);
- // [THEN] Only the GL Accounts should be exported
- Assert.AreEqual(6, LibraryReportDataset.RowCount(), 'Only the GLAccounts should be exported');
- LibraryReportDataset.SetXmlNodeList('DataItem[@name="GLAccounts"]');
- Assert.AreEqual(6, LibraryReportDataset.RowCount(), 'The exported items should be GLAccounts');
- end;
-
- [Test]
- [HandlerFunctions('EXRConsolidatedTrialBalanceHandler')]
- procedure ConsolidatedTrialBalanceDoesntExportDimensionValuesIfUnused()
- var
- Variant: Variant;
- RequestPageXml: Text;
- begin
- // [SCENARIO] An empty report should only export GL Accounts, even if there are dimensions
- // [GIVEN] An empty trial balance
- CleanUpTrialBalanceData();
- // [GIVEN] 2 Business Units
- CreateSampleBusinessUnits(2);
- // [GIVEN] 6 GL Accounts
- CreateSampleGLAccounts(6);
- // [GIVEN] 2 Global Dimensions, with Dimension Values
- CreateSampleGlobalDimensionAndDimensionValues();
- Commit();
- // [WHEN] Running the report
- RequestPageXml := Report.RunRequestPage(Report::"EXR Consolidated Trial Balance", RequestPageXml);
- LibraryReportDataset.RunReportAndLoad(Report::"EXR Consolidated Trial Balance", Variant, RequestPageXml);
- // [THEN] Only the GL Accounts should be exported
- Assert.AreEqual(6 + 2, LibraryReportDataset.RowCount(), 'Only GL Accounts and Business Units should be exported');
- LibraryReportDataset.SetXmlNodeList('DataItem[@name="GLAccounts"]');
- Assert.AreEqual(6, LibraryReportDataset.RowCount(), 'Created GL Accounts should be exported');
- end;
-
- [Test]
- [HandlerFunctions('EXRTrialBalanceExcelHandler')]
- procedure TrialBalanceExportsOnlyTheUsedDimensionValues()
- var
- GLAccount: Record "G/L Account";
- Dimension: Record Dimension;
- DimensionValue: Record "Dimension Value";
- Variant: Variant;
- ReportValue, RequestPageXml : Text;
- begin
- // [SCENARIO] The report should only export the Dimension Values for which it has a total
- // [GIVEN] A trial balance for an entry with Global Dimension 2 value defined
- CleanUpTrialBalanceData();
- CreateSampleGLAccounts(10, GLAccount);
- CreateSampleGlobalDimensionAndDimensionValues(Dimension, DimensionValue);
- CreateGLEntry(GLAccount."No.", DimensionValue.Code);
- Commit();
- // [WHEN] Running the report
- RequestPageXml := Report.RunRequestPage(Report::"EXR Trial Balance Excel", RequestPageXml);
- LibraryReportDataset.RunReportAndLoad(Report::"EXR Trial Balance Excel", Variant, RequestPageXml);
- // [THEN] All the GLAccounts should be exported
- LibraryReportDataset.SetXmlNodeList('DataItem[@name="GLAccounts"]');
- Assert.AreEqual(10, LibraryReportDataset.RowCount(), 'Created GL Accounts should be exported');
- // [THEN] The only Dimension1 exported is the one of the entry (blank)
- LibraryReportDataset.SetXmlNodeList('DataItem[@name="Dimension1"]');
- Assert.AreEqual(1, LibraryReportDataset.RowCount(), 'There should be 1 "Global dimension 1" exported, the blank dimension');
- LibraryReportDataset.GetNextRow();
- LibraryReportDataset.FindCurrentRowValue('Dim1Code', Variant);
- ReportValue := Variant;
- Assert.AreEqual('', ReportValue, 'The exported dimension should be the blank dimension');
- // [THEN] The only Dimension2 exported is the one defined on the entry
- LibraryReportDataset.SetXmlNodeList('DataItem[@name="Dimension2"]');
- Assert.AreEqual(1, LibraryReportDataset.RowCount(), 'There should be 1 "Global dimension 2" exported');
- LibraryReportDataset.GetNextRow();
- LibraryReportDataset.FindCurrentRowValue('Dim2Code', Variant);
- ReportValue := Variant;
- Assert.AreEqual(DimensionValue.Code, ReportValue, 'The exported dimension should be the dimension in the GLEntry');
- end;
-
- [Test]
- [HandlerFunctions('EXRTrialBalanceBudgetExcelHandler')]
- procedure TrialBalanceBudgetExportsOnlyTheUsedDimensionValues()
- var
- GLAccount: Record "G/L Account";
- Dimension: Record Dimension;
- DimensionValue: Record "Dimension Value";
- Variant: Variant;
- ReportValue, RequestPageXml : Text;
- begin
- // [SCENARIO] The report should only export the Dimension Values for which it has a total
- // [GIVEN] A trial balance for an entry with Global Dimension 2 value defined
- CleanUpTrialBalanceData();
- CreateSampleGLAccounts(10, GLAccount);
- CreateSampleGlobalDimensionAndDimensionValues(Dimension, DimensionValue);
- CreateGLEntry(GLAccount."No.", DimensionValue.Code);
- Commit();
- // [WHEN] Running the report
- RequestPageXml := Report.RunRequestPage(Report::"EXR Trial BalanceBudgetExcel", RequestPageXml);
- LibraryReportDataset.RunReportAndLoad(Report::"EXR Trial BalanceBudgetExcel", Variant, RequestPageXml);
- // [THEN] All the GLAccounts should be exported
- LibraryReportDataset.SetXmlNodeList('DataItem[@name="GLAccounts"]');
- Assert.AreEqual(10, LibraryReportDataset.RowCount(), 'Created GL Accounts should be exported');
- // [THEN] The only Dimension1 exported is the one of the entry (blank)
- LibraryReportDataset.SetXmlNodeList('DataItem[@name="Dimension1"]');
- Assert.AreEqual(1, LibraryReportDataset.RowCount(), 'There should be 1 "Global dimension 1" exported, the blank dimension');
- LibraryReportDataset.GetNextRow();
- LibraryReportDataset.FindCurrentRowValue('Dim1Code', Variant);
- ReportValue := Variant;
- Assert.AreEqual('', ReportValue, 'The exported dimension should be the blank dimension');
- // [THEN] The only Dimension2 exported is the one defined on the entry
- LibraryReportDataset.SetXmlNodeList('DataItem[@name="Dimension2"]');
- Assert.AreEqual(1, LibraryReportDataset.RowCount(), 'There should be 1 "Global dimension 2" exported');
- LibraryReportDataset.GetNextRow();
- LibraryReportDataset.FindCurrentRowValue('Dim2Code', Variant);
- ReportValue := Variant;
- Assert.AreEqual(DimensionValue.Code, ReportValue, 'The exported dimension should be the dimension in the GLEntry');
- end;
-
- [Test]
- [HandlerFunctions('EXRConsolidatedTrialBalanceHandler')]
- procedure ConsolidatedTrialBalanceExportsOnlyTheUsedDimensionValues()
- var
- GLAccount: Record "G/L Account";
- Dimension: Record Dimension;
- DimensionValue: Record "Dimension Value";
- Variant: Variant;
- ReportValue, RequestPageXml : Text;
- begin
- // [SCENARIO] The report should only export the Dimension Values for which it has a total
- // [GIVEN] A trial balance for an entry with Global Dimension 2 value defined
- CleanUpTrialBalanceData();
- CreateSampleGLAccounts(10, GLAccount);
- CreateSampleBusinessUnits(1);
- CreateSampleGlobalDimensionAndDimensionValues(Dimension, DimensionValue);
- CreateGLEntry(GLAccount."No.", DimensionValue.Code);
- Commit();
- // [WHEN] Running the report
- RequestPageXml := Report.RunRequestPage(Report::"EXR Consolidated Trial Balance", RequestPageXml);
- LibraryReportDataset.RunReportAndLoad(Report::"EXR Consolidated Trial Balance", Variant, RequestPageXml);
- // [THEN] All the GLAccounts should be exported
- LibraryReportDataset.SetXmlNodeList('DataItem[@name="GLAccounts"]');
- Assert.AreEqual(10, LibraryReportDataset.RowCount(), 'Created GL Accounts should be exported');
- // [THEN] The only Dimension1 exported is the one of the entry (blank)
- LibraryReportDataset.SetXmlNodeList('DataItem[@name="Dimension1"]');
- Assert.AreEqual(1, LibraryReportDataset.RowCount(), 'There should be 1 "Global dimension 1" exported, the blank dimension');
- LibraryReportDataset.GetNextRow();
- LibraryReportDataset.FindCurrentRowValue('Dim1Code', Variant);
- ReportValue := Variant;
- Assert.AreEqual('', ReportValue, 'The exported dimension should be the blank dimension');
- // [THEN] The only Dimension2 exported is the one defined on the entry
- LibraryReportDataset.SetXmlNodeList('DataItem[@name="Dimension2"]');
- Assert.AreEqual(1, LibraryReportDataset.RowCount(), 'There should be 1 "Global dimension 2" exported');
- LibraryReportDataset.GetNextRow();
- LibraryReportDataset.FindCurrentRowValue('Dim2Code', Variant);
- ReportValue := Variant;
- Assert.AreEqual(DimensionValue.Code, ReportValue, 'The exported dimension should be the dimension in the GLEntry');
- end;
-
- [Test]
- [HandlerFunctions('EXRConsolidatedTrialBalanceHandler')]
- procedure ConsolidatedTrialBalanceShouldErrorWithNoBusinessUnits()
- var
- GLAccount: Record "G/L Account";
- Variant: Variant;
- RequestPageXml: Text;
- begin
- // [SCENARIO 544098] Running Consolidation Trial Balance should fail when there are no business units configured.
- // [GIVEN] A company without business units
- CleanUpTrialBalanceData();
- CreateSampleGLAccounts(10, GLAccount);
- Commit();
- // [WHEN] Running the Consolidation Trial Balance report
- RequestPageXml := Report.RunRequestPage(Report::"EXR Consolidated Trial Balance", RequestPageXml);
- // [THEN] It should fail and not produce a corrupt Excel file.
- asserterror LibraryReportDataset.RunReportAndLoad(Report::"EXR Consolidated Trial Balance", Variant, RequestPageXml);
- end;
-
- [Test]
- procedure TrialBalanceBufferNetChangeSplitsIntoDebitAndCreditWhenCalledSeveralTimes()
- var
- EXRTrialBalanceBuffer: Record "EXR Trial Balance Buffer";
- ValuesToSplitInCreditAndDebit: array[3] of Decimal;
- begin
- // [SCENARIO 547558] Trial Balance Buffer data split into Debit and Credit correctly, even if called multiple times.
- // [GIVEN] Trial Balance Buffer filled with positive Balance/Net Change
- ValuesToSplitInCreditAndDebit[1] := 837;
- // [GIVEN] Trial Balance Buffer filled with negative Balance/Net Change
- ValuesToSplitInCreditAndDebit[2] := -110;
- // [GIVEN] Trial Balance Buffer filled with positive Balance/Net Change
- ValuesToSplitInCreditAndDebit[3] := 998;
- // [WHEN] Trial Balance Buffer entries are inserted
- EXRTrialBalanceBuffer."G/L Account No." := 'A';
- EXRTrialBalanceBuffer.Validate("Net Change", ValuesToSplitInCreditAndDebit[1]);
- EXRTrialBalanceBuffer.Validate(Balance, ValuesToSplitInCreditAndDebit[1]);
- EXRTrialBalanceBuffer.Validate("Net Change (ACY)", ValuesToSplitInCreditAndDebit[1]);
- EXRTrialBalanceBuffer.Validate("Balance (ACY)", ValuesToSplitInCreditAndDebit[1]);
- EXRTrialBalanceBuffer.Insert();
- EXRTrialBalanceBuffer."G/L Account No." := 'B';
- EXRTrialBalanceBuffer.Validate("Net Change", ValuesToSplitInCreditAndDebit[2]);
- EXRTrialBalanceBuffer.Validate(Balance, ValuesToSplitInCreditAndDebit[2]);
- EXRTrialBalanceBuffer.Validate("Net Change (ACY)", ValuesToSplitInCreditAndDebit[2]);
- EXRTrialBalanceBuffer.Validate("Balance (ACY)", ValuesToSplitInCreditAndDebit[2]);
- EXRTrialBalanceBuffer.Insert();
- EXRTrialBalanceBuffer."G/L Account No." := 'C';
- EXRTrialBalanceBuffer.Validate("Net Change", ValuesToSplitInCreditAndDebit[3]);
- EXRTrialBalanceBuffer.Validate(Balance, ValuesToSplitInCreditAndDebit[3]);
- EXRTrialBalanceBuffer.Validate("Net Change (ACY)", ValuesToSplitInCreditAndDebit[3]);
- EXRTrialBalanceBuffer.Validate("Balance (ACY)", ValuesToSplitInCreditAndDebit[3]);
- EXRTrialBalanceBuffer.Insert();
- // [THEN] All Entries have the right split in Credit and Debit
- EXRTrialBalanceBuffer.FindSet();
- Assert.AreEqual(ValuesToSplitInCreditAndDebit[1], Abs(EXRTrialBalanceBuffer."Net Change (Debit)" + EXRTrialBalanceBuffer."Net Change (Credit)"), 'Split in line in credit and debit should be the same as the inserted value.');
- Assert.AreEqual(ValuesToSplitInCreditAndDebit[1], Abs(EXRTrialBalanceBuffer."Balance (Debit)" + EXRTrialBalanceBuffer."Balance (Credit)"), 'Split in line in credit and debit should be the same as the inserted value.');
- Assert.AreEqual(ValuesToSplitInCreditAndDebit[1], Abs(EXRTrialBalanceBuffer."Net Change (Debit) (ACY)" + EXRTrialBalanceBuffer."Net Change (Credit) (ACY)"), 'Split in line in credit and debit should be the same as the inserted value.');
- Assert.AreEqual(ValuesToSplitInCreditAndDebit[1], Abs(EXRTrialBalanceBuffer."Balance (Debit) (ACY)" + EXRTrialBalanceBuffer."Balance (Credit) (ACY)"), 'Split in line in credit and debit should be the same as the inserted value.');
- EXRTrialBalanceBuffer.Next();
- Assert.AreEqual(-ValuesToSplitInCreditAndDebit[2], Abs(EXRTrialBalanceBuffer."Net Change (Debit)" + EXRTrialBalanceBuffer."Net Change (Credit)"), 'Split in line in credit and debit should be the same as the inserted value.');
- Assert.AreEqual(-ValuesToSplitInCreditAndDebit[2], Abs(EXRTrialBalanceBuffer."Balance (Debit)" + EXRTrialBalanceBuffer."Balance (Credit)"), 'Split in line in credit and debit should be the same as the inserted value.');
- Assert.AreEqual(-ValuesToSplitInCreditAndDebit[2], Abs(EXRTrialBalanceBuffer."Net Change (Debit) (ACY)" + EXRTrialBalanceBuffer."Net Change (Credit) (ACY)"), 'Split in line in credit and debit should be the same as the inserted value.');
- Assert.AreEqual(-ValuesToSplitInCreditAndDebit[2], Abs(EXRTrialBalanceBuffer."Balance (Debit) (ACY)" + EXRTrialBalanceBuffer."Balance (Credit) (ACY)"), 'Split in line in credit and debit should be the same as the inserted value.');
- EXRTrialBalanceBuffer.Next();
- Assert.AreEqual(ValuesToSplitInCreditAndDebit[3], Abs(EXRTrialBalanceBuffer."Net Change (Debit)" + EXRTrialBalanceBuffer."Net Change (Credit)"), 'Split in line in credit and debit should be the same as the inserted value.');
- Assert.AreEqual(ValuesToSplitInCreditAndDebit[3], Abs(EXRTrialBalanceBuffer."Balance (Debit)" + EXRTrialBalanceBuffer."Balance (Credit)"), 'Split in line in credit and debit should be the same as the inserted value.');
- Assert.AreEqual(ValuesToSplitInCreditAndDebit[3], Abs(EXRTrialBalanceBuffer."Net Change (Debit) (ACY)" + EXRTrialBalanceBuffer."Net Change (Credit) (ACY)"), 'Split in line in credit and debit should be the same as the inserted value.');
- Assert.AreEqual(ValuesToSplitInCreditAndDebit[3], Abs(EXRTrialBalanceBuffer."Balance (Debit) (ACY)" + EXRTrialBalanceBuffer."Balance (Credit) (ACY)"), 'Split in line in credit and debit should be the same as the inserted value.');
- end;
-
- local procedure CreateSampleBusinessUnits(HowMany: Integer)
- var
- BusinessUnit: Record "Business Unit";
- begin
- CreateSampleBusinessUnits(HowMany, BusinessUnit);
- end;
-
- local procedure CreateSampleBusinessUnits(HowMany: Integer; var BusinessUnit: Record "Business Unit")
- var
- i: Integer;
- begin
- for i := 1 to HowMany do
- LibraryERM.CreateBusinessUnit(BusinessUnit);
- end;
-
- local procedure CreateSampleGLAccounts(HowMany: Integer)
- var
- GLAccount: Record "G/L Account";
- begin
- CreateSampleGLAccounts(HowMany, GLAccount);
- end;
-
- local procedure CreateSampleGLAccounts(HowMany: Integer; var GLAccount: Record "G/L Account")
- var
- i: Integer;
- begin
- for i := 1 to HowMany do
- LibraryERM.CreateGLAccount(GLAccount);
- end;
-
- local procedure CleanUpTrialBalanceData()
- var
- GLAccount: Record "G/L Account";
- GLEntry: Record "G/L Entry";
- Dimension: Record Dimension;
- DimensionValue: Record "Dimension Value";
- BusinessUnit: Record "Business Unit";
- begin
- DimensionValue.DeleteAll();
- Dimension.DeleteAll();
- GLAccount.DeleteAll();
- BusinessUnit.DeleteAll();
- GLEntry.DeleteAll();
- end;
-
- local procedure CreateSampleGlobalDimensionAndDimensionValues()
- var
- Dimension: Record Dimension;
- DimensionValue: Record "Dimension Value";
- begin
- CreateSampleGlobalDimensionAndDimensionValues(Dimension, DimensionValue);
- end;
-
- local procedure CreateSampleGlobalDimensionAndDimensionValues(var Dimension: Record Dimension; var DimensionValue: Record "Dimension Value")
- begin
- LibraryERM.CreateDimension(Dimension);
- LibraryERM.CreateDimensionValue(DimensionValue, Dimension.Code);
- DimensionValue."Global Dimension No." := 1;
- DimensionValue.Modify();
- LibraryERM.CreateDimensionValue(DimensionValue, Dimension.Code);
- DimensionValue."Global Dimension No." := 1;
- DimensionValue.Modify();
- LibraryERM.CreateDimension(Dimension);
- LibraryERM.CreateDimensionValue(DimensionValue, Dimension.Code);
- DimensionValue."Global Dimension No." := 2;
- DimensionValue.Modify();
- LibraryERM.CreateDimensionValue(DimensionValue, Dimension.Code);
- DimensionValue."Global Dimension No." := 2;
- DimensionValue.Modify();
- LibraryERM.CreateDimensionValue(DimensionValue, Dimension.Code);
- DimensionValue."Global Dimension No." := 2;
- DimensionValue.Modify();
- end;
-
- local procedure CreateGLEntry(GLAccountNo: Code[20]; DimensionValue2Code: Code[20])
- var
- GLEntry: Record "G/L Entry";
- EntryNo: Integer;
- begin
- if GLEntry.FindLast() then;
- EntryNo := GLEntry."Entry No." + 1;
- Clear(GLEntry);
- GLEntry."Entry No." := EntryNo;
- GLEntry."G/L Account No." := GLAccountNo;
- GLEntry."Global Dimension 2 Code" := DimensionValue2Code;
- GLEntry.Amount := 1337;
- GLEntry."Debit Amount" := GLEntry.Amount;
- GLEntry."Posting Date" := WorkDate();
- GLEntry.Insert();
- end;
-
- [RequestPageHandler]
- procedure EXRTrialBalanceExcelHandler(var EXRTrialBalanceExcel: TestRequestPage "EXR Trial Balance Excel")
- begin
- EXRTrialBalanceExcel.OK().Invoke();
- end;
-
- [RequestPageHandler]
- procedure EXRTrialBalanceBudgetExcelHandler(var EXRTrialBalanceBudgetExcel: TestRequestPage "EXR Trial BalanceBudgetExcel")
- begin
- EXRTrialBalanceBudgetExcel.OK().Invoke();
- end;
-
- [RequestPageHandler]
- procedure EXRConsolidatedTrialBalanceHandler(var EXRConsolidatedTrialBalance: TestRequestPage "EXR Consolidated Trial Balance")
- begin
- EXRConsolidatedTrialBalance.EndingDateField.Value := Format(20261231D);
- EXRConsolidatedTrialBalance.OK().Invoke();
- end;
-
-}
\ No newline at end of file
diff --git a/Apps/W1/FieldServiceIntegration/app/src/Codeunits/FSSetupDefaults.Codeunit.al b/Apps/W1/FieldServiceIntegration/app/src/Codeunits/FSSetupDefaults.Codeunit.al
index 031c16c5c4..53b0fa574d 100644
--- a/Apps/W1/FieldServiceIntegration/app/src/Codeunits/FSSetupDefaults.Codeunit.al
+++ b/Apps/W1/FieldServiceIntegration/app/src/Codeunits/FSSetupDefaults.Codeunit.al
@@ -432,8 +432,6 @@ codeunit 6611 "FS Setup Defaults"
IntegrationTableMapping.SetTableFilter(
GetTableFilterFromView(Database::Location, Location.TableCaption(), Location.GetView()));
- IntegrationTableMapping."Synch. After Bulk Coupling" := true;
- IntegrationTableMapping."Create New in Case of No Match" := true;
IntegrationTableMapping.Modify();
InsertIntegrationFieldMapping(
@@ -450,11 +448,6 @@ codeunit 6611 "FS Setup Defaults"
IntegrationFieldMapping.Direction::ToIntegrationTable,
'', true, false);
- IntegrationFieldMapping.SetRange("Integration Table Mapping Name", IntegrationTableMappingName);
- IntegrationFieldMapping.FindFirst();
- IntegrationFieldMapping."Use For Match-Based Coupling" := true;
- IntegrationFieldMapping.Modify();
-
RecreateJobQueueEntryFromIntTableMapping(IntegrationTableMapping, 1, ShouldRecreateJobQueueEntry, 5);
end;
diff --git a/Apps/W1/PayPalPaymentsStandard/app/src/codeunits/MSPayPalStandardMgt.Codeunit.al b/Apps/W1/PayPalPaymentsStandard/app/src/codeunits/MSPayPalStandardMgt.Codeunit.al
index 5311dce3e5..0454321918 100644
--- a/Apps/W1/PayPalPaymentsStandard/app/src/codeunits/MSPayPalStandardMgt.Codeunit.al
+++ b/Apps/W1/PayPalPaymentsStandard/app/src/codeunits/MSPayPalStandardMgt.Codeunit.al
@@ -524,8 +524,6 @@ codeunit 1070 "MS - PayPal Standard Mgt."
begin
MSPayPalStandardAccount.HideAllDialogs();
- Account := LowerCase(Account);
-
if not MSPayPalStandardAccount.FindFirst() then begin
RegisterPayPalStandardTemplate(TempPaymentServiceSetup);
GetTemplate(MSPayPalStandardTemplate);
diff --git a/Apps/W1/PayPalPaymentsStandard/app/src/codeunits/MSPayPalTransactionsMgt.Codeunit.al b/Apps/W1/PayPalPaymentsStandard/app/src/codeunits/MSPayPalTransactionsMgt.Codeunit.al
index adb620d347..38109824d9 100644
--- a/Apps/W1/PayPalPaymentsStandard/app/src/codeunits/MSPayPalTransactionsMgt.Codeunit.al
+++ b/Apps/W1/PayPalPaymentsStandard/app/src/codeunits/MSPayPalTransactionsMgt.Codeunit.al
@@ -189,7 +189,6 @@ codeunit 1075 "MS - PayPal Transactions Mgt."
Session.LogMessage('00008H1', GetTransactionDetailsTxt, Verbosity::Normal, DataClassification::SystemMetadata, TelemetryScope::ExtensionPublisher, 'Category', PayPalTelemetryCategoryTok);
JObject.ReadFrom(JsonString);
GetPropertyValueFromJObject(JObject, 'receiver_email', AccountID);
- AccountID := LOWERCASE(AccountID);
GetPropertyValueFromJObject(JObject, 'txn_id', TransactionID);
GetPropertyValueFromJObject(JObject, 'txn_type', PayPalTransactiontype);
GetPropertyValueFromJObject(JObject, 'payment_date', TransactionDateStr);
diff --git a/Apps/W1/PayPalPaymentsStandard/app/src/codeunits/MSPayPalWebhookManagement.Codeunit.al b/Apps/W1/PayPalPaymentsStandard/app/src/codeunits/MSPayPalWebhookManagement.Codeunit.al
index b843991887..de4efbdf44 100644
--- a/Apps/W1/PayPalPaymentsStandard/app/src/codeunits/MSPayPalWebhookManagement.Codeunit.al
+++ b/Apps/W1/PayPalPaymentsStandard/app/src/codeunits/MSPayPalWebhookManagement.Codeunit.al
@@ -56,7 +56,7 @@ codeunit 1073 "MS - PayPal Webhook Management"
Session.LogMessage('00008IP', ProcessingWebhookNotificationTxt, Verbosity::Normal, DataClassification::SystemMetadata, TelemetryScope::ExtensionPublisher, 'Category', PayPalTelemetryCategoryTok);
FeatureTelemetry.LogUsage('0000LHW', MSPayPalStandardMgt.GetFeatureTelemetryName(), ProcessingWebhookNotificationTxt);
- AccountID := LOWERCASE(Rec."Subscription ID");
+ AccountID := Rec."Subscription ID";
WebhookSubscription.SetRange("Subscription ID", AccountID);
WebhookSubscription.SetFilter("Created By", GetCreatedByFilterForWebhooks());
if WebhookSubscription.IsEmpty() then begin
diff --git a/Apps/W1/PayPalPaymentsStandard/app/src/tables/MSPayPalStandardAccount.Table.al b/Apps/W1/PayPalPaymentsStandard/app/src/tables/MSPayPalStandardAccount.Table.al
index 4d6ccae4f8..6a04c11bb2 100644
--- a/Apps/W1/PayPalPaymentsStandard/app/src/tables/MSPayPalStandardAccount.Table.al
+++ b/Apps/W1/PayPalPaymentsStandard/app/src/tables/MSPayPalStandardAccount.Table.al
@@ -87,7 +87,6 @@ table 1070 "MS - PayPal Standard Account"
trigger OnValidate();
begin
VerifyAccountID();
- "Account ID" := LOWERCASE("Account ID");
end;
}
field(12; "Target URL"; BLOB)
@@ -237,7 +236,7 @@ table 1070 "MS - PayPal Standard Account"
ERROR(AccountIDTooLongForWebhooksErr, MaxStrLen(SubscriptionId));
end;
- SubscriptionId := CopyStr(LowerCase("Account ID"), 1, MaxStrLen(SubscriptionId));
+ SubscriptionId := CopyStr("Account ID", 1, MaxStrLen(SubscriptionId));
WebhookSubscription.SETRANGE("Subscription ID", SubscriptionId);
WebhookSubscription.SetFilter("Created By", MSPayPalWebhookManagement.GetCreatedByFilterForWebhooks());
WebhooksAdapterUri := LOWERCASE(WebhookManagement.GetNotificationUrl());
@@ -264,7 +263,7 @@ table 1070 "MS - PayPal Standard Account"
WebhookSubscription: Record "Webhook Subscription";
SubscriptionId: Text[150];
begin
- SubscriptionId := CopyStr(LowerCase(AccountId), 1, MaxStrLen(SubscriptionId));
+ SubscriptionId := CopyStr(AccountId, 1, MaxStrLen(SubscriptionId));
WebhookSubscription.SETRANGE("Subscription ID", SubscriptionId);
WebhookSubscription.SetFilter("Created By", MSPayPalWebhookManagement.GetCreatedByFilterForWebhooks());
if not WebhookSubscription.IsEmpty() then begin
diff --git a/Apps/W1/PayPalPaymentsStandard/test/src/MSPayPalStandardTests.Codeunit.al b/Apps/W1/PayPalPaymentsStandard/test/src/MSPayPalStandardTests.Codeunit.al
index d95f5325b0..35fa11846c 100644
--- a/Apps/W1/PayPalPaymentsStandard/test/src/MSPayPalStandardTests.Codeunit.al
+++ b/Apps/W1/PayPalPaymentsStandard/test/src/MSPayPalStandardTests.Codeunit.al
@@ -1290,8 +1290,8 @@ codeunit 139500 "MS - PayPal Standard Tests"
ExpectedMSPayPalStandardAccount."Always Include on Documents", MSPayPalStandardAccount."Always Include on Documents",
'Wrong value set for Always Include on Documents');
Assert.AreEqual(
- LOWERCASE(ExpectedMSPayPalStandardAccount."Account ID"), LOWERCASE(MSPayPalStandardAccount."Account ID"),
- 'Wrong value set for Account ID');
+ ExpectedMSPayPalStandardAccount."Account ID", MSPayPalStandardAccount."Account ID",
+ 'Wrong value set for Account ID');
ExpectedTargetURL := ExpectedMSPayPalStandardAccount.GetTargetURL();
ActualTargetURL := MSPayPalStandardAccount.GetTargetURL();
diff --git a/Apps/W1/Shopify/app/src/Base/Codeunits/ShpfyInstaller.Codeunit.al b/Apps/W1/Shopify/app/src/Base/Codeunits/ShpfyInstaller.Codeunit.al
index b6a9d55ba2..62fd21cfb1 100644
--- a/Apps/W1/Shopify/app/src/Base/Codeunits/ShpfyInstaller.Codeunit.al
+++ b/Apps/W1/Shopify/app/src/Base/Codeunits/ShpfyInstaller.Codeunit.al
@@ -172,25 +172,27 @@ codeunit 30273 "Shpfy Installer"
[EventSubscriber(ObjectType::Report, Report::"Copy Company", 'OnAfterCreatedNewCompanyByCopyCompany', '', false, false)]
local procedure ShpfyOnAfterCreatedNewCompanyByCopyCompany(NewCompanyName: Text[30])
var
- ShpfyShop: Record "Shpfy Shop";
+ Shop: Record "Shpfy Shop";
begin
- ShpfyShop.ChangeCompany(NewCompanyName);
- if ShpfyShop.FindSet() then
- repeat
- ShpfyShop.Validate(Enabled, false);
- ShpfyShop.Modify();
- until ShpfyShop.Next() = 0;
+ Shop.ChangeCompany(NewCompanyName);
+ Shop.ModifyAll(Enabled, false);
+ end;
+
+
+ [EventSubscriber(ObjectType::Report, Report::"Copy Company", 'OnAfterCreatedNewCompanyByCopyCompany', '', false, false)]
+ local procedure HandleOnAfterCreatedNewCompanyByCopyCompany(NewCompanyName: Text[30])
+ var
+ Shop: Record "Shpfy Shop";
+ begin
+ Shop.ChangeCompany(NewCompanyName);
+ Shop.ModifyAll(Enabled, false);
end;
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Environment Cleanup", 'OnClearCompanyConfig', '', false, false)]
local procedure ShpfyOnClearCompanyConfiguration(CompanyName: Text; SourceEnv: Enum "Environment Type"; DestinationEnv: Enum "Environment Type")
var
- ShpfyShop: Record "Shpfy Shop";
+ Shop: Record "Shpfy Shop";
begin
- if ShpfyShop.FindSet() then
- repeat
- ShpfyShop.Validate(Enabled, false);
- ShpfyShop.Modify();
- until ShpfyShop.Next() = 0;
+ Shop.ModifyAll(Enabled, false);
end;
}
diff --git a/Apps/W1/Shopify/app/src/Base/Codeunits/ShpfyShopMgt.Codeunit.al b/Apps/W1/Shopify/app/src/Base/Codeunits/ShpfyShopMgt.Codeunit.al
index 85d3997415..289da0da78 100644
--- a/Apps/W1/Shopify/app/src/Base/Codeunits/ShpfyShopMgt.Codeunit.al
+++ b/Apps/W1/Shopify/app/src/Base/Codeunits/ShpfyShopMgt.Codeunit.al
@@ -26,15 +26,6 @@ codeunit 30211 "Shpfy Shop Mgt."
exit(not Shop.IsEmpty());
end;
- [EventSubscriber(ObjectType::Report, Report::"Copy Company", 'OnAfterCreatedNewCompanyByCopyCompany', '', false, false)]
- local procedure HandleOnAfterCreatedNewCompanyByCopyCompany(NewCompanyName: Text[30])
- var
- Shop: Record "Shpfy Shop";
- begin
- Shop.ChangeCompany(NewCompanyName);
- Shop.ModifyAll(Enabled, false);
- end;
-
internal procedure SendExpirationNotification(ExpiryDate: Date)
var
MyNotifications: Record "My Notifications";
diff --git a/Apps/W1/Shopify/app/src/Base/Pages/ShpfyShopCard.Page.al b/Apps/W1/Shopify/app/src/Base/Pages/ShpfyShopCard.Page.al
index 8001773a4f..94ed90cc14 100644
--- a/Apps/W1/Shopify/app/src/Base/Pages/ShpfyShopCard.Page.al
+++ b/Apps/W1/Shopify/app/src/Base/Pages/ShpfyShopCard.Page.al
@@ -518,6 +518,11 @@ page 30101 "Shpfy Shop Card"
ApplicationArea = All;
ToolTip = 'Specifies whether the customer is notified when the shipment is synchronized to Shopify.';
}
+ field("Order Attributes To Shopify"; Rec."Order Attributes To Shopify")
+ {
+ ApplicationArea = All;
+ ToolTip = 'Specifies if Business Central document no. is synchronized to Shopify as order attribute.';
+ }
#if not CLEAN24
field(ReplaceOrderAttributeValue; Rec."Replace Order Attribute Value")
{
diff --git a/Apps/W1/Shopify/app/src/Base/Tables/ShpfyShop.Table.al b/Apps/W1/Shopify/app/src/Base/Tables/ShpfyShop.Table.al
index 526d926453..59938d65d6 100644
--- a/Apps/W1/Shopify/app/src/Base/Tables/ShpfyShop.Table.al
+++ b/Apps/W1/Shopify/app/src/Base/Tables/ShpfyShop.Table.al
@@ -769,6 +769,12 @@ table 30102 "Shpfy Shop"
DataClassification = SystemMetadata;
InitValue = true;
}
+ field(133; "Order Attributes To Shopify"; Boolean)
+ {
+ Caption = 'Add Business Central Doc. No. as Attribute';
+ DataClassification = SystemMetadata;
+ InitValue = true;
+ }
field(200; "Shop Id"; Integer)
{
DataClassification = SystemMetadata;
diff --git a/Apps/W1/Shopify/app/src/Companies/Reports/ShpfyAddCompanyToShopify.Report.al b/Apps/W1/Shopify/app/src/Companies/Reports/ShpfyAddCompanyToShopify.Report.al
index e97800477c..e65681076a 100644
--- a/Apps/W1/Shopify/app/src/Companies/Reports/ShpfyAddCompanyToShopify.Report.al
+++ b/Apps/W1/Shopify/app/src/Companies/Reports/ShpfyAddCompanyToShopify.Report.al
@@ -34,13 +34,16 @@ report 30113 "Shpfy Add Company to Shopify"
end;
trigger OnAfterGetRecord()
+ var
+ SyncCustomer: Record Customer;
begin
if GuiAllowed then begin
CurrCustomerNo := Customer."No.";
ProcessDialog.Update();
end;
- CompanyExport.Run(Customer);
+ SyncCustomer.SetRange("No.", Customer."No.");
+ CompanyExport.Run(SyncCustomer);
end;
trigger OnPostDataItem()
diff --git a/Apps/W1/Shopify/app/src/Customers/Reports/ShpfyAddCustomerToShopify.Report.al b/Apps/W1/Shopify/app/src/Customers/Reports/ShpfyAddCustomerToShopify.Report.al
index 1ae067de53..2e09f6a1ec 100644
--- a/Apps/W1/Shopify/app/src/Customers/Reports/ShpfyAddCustomerToShopify.Report.al
+++ b/Apps/W1/Shopify/app/src/Customers/Reports/ShpfyAddCustomerToShopify.Report.al
@@ -34,13 +34,16 @@ report 30112 "Shpfy Add Customer to Shopify"
end;
trigger OnAfterGetRecord()
+ var
+ SyncCustomer: Record Customer;
begin
if GuiAllowed then begin
CurrCustomerNo := Customer."No.";
ProcessDialog.Update();
end;
- CustomerExport.Run(Customer);
+ SyncCustomer.SetRange("No.", Customer."No.");
+ CustomerExport.Run(SyncCustomer);
end;
trigger OnPostDataItem()
diff --git a/Apps/W1/Shopify/app/src/GraphQL/Codeunits/ShpfyGQLNextOpenOrdToImport.Codeunit.al b/Apps/W1/Shopify/app/src/GraphQL/Codeunits/ShpfyGQLNextOpenOrdToImport.Codeunit.al
index 633bb0d945..4c17e259bf 100644
--- a/Apps/W1/Shopify/app/src/GraphQL/Codeunits/ShpfyGQLNextOpenOrdToImport.Codeunit.al
+++ b/Apps/W1/Shopify/app/src/GraphQL/Codeunits/ShpfyGQLNextOpenOrdToImport.Codeunit.al
@@ -6,7 +6,7 @@ codeunit 30206 "Shpfy GQL NextOpenOrdToImport" implements "Shpfy IGraphQL"
internal procedure GetGraphQL(): Text
begin
- exit('{"query": "{orders(first:150, after:\"{{After}}\", query: \"status:open updated_at:>''{{Time}}''\"){pageInfo{hasNextPage} edges{cursor node{legacyResourceId name createdAt updatedAt test fullyPaid unpaid displayFinancialStatus displayFulfillmentStatus subtotalLineItemsQuantity totalPriceSet{shopMoney{amount currencyCode}} customAttributes{key value} tags purchasingEntity { ... on PurchasingCompany { company { id }}}}}}}"}');
+ exit('{"query": "{orders(first:150, after:\"{{After}}\", query: \"status:open updated_at:>''{{Time}}''\"){pageInfo{hasNextPage} edges{cursor node{legacyResourceId name createdAt updatedAt test fullyPaid unpaid displayFinancialStatus displayFulfillmentStatus subtotalLineItemsQuantity totalPriceSet{shopMoney{amount currencyCode}} customAttributes{key value} tags risk { assessments { riskLevel }} purchasingEntity { ... on PurchasingCompany { company { id }}}}}}}"}');
end;
internal procedure GetExpectedCost(): Integer
diff --git a/Apps/W1/Shopify/app/src/GraphQL/Codeunits/ShpfyGQLNextOrdersToImport.Codeunit.al b/Apps/W1/Shopify/app/src/GraphQL/Codeunits/ShpfyGQLNextOrdersToImport.Codeunit.al
index bcb378274b..87121cac66 100644
--- a/Apps/W1/Shopify/app/src/GraphQL/Codeunits/ShpfyGQLNextOrdersToImport.Codeunit.al
+++ b/Apps/W1/Shopify/app/src/GraphQL/Codeunits/ShpfyGQLNextOrdersToImport.Codeunit.al
@@ -13,7 +13,7 @@ codeunit 30138 "Shpfy GQL NextOrdersToImport" implements "Shpfy IGraphQL"
/// Return value of type Text.
internal procedure GetGraphQL(): Text
begin
- exit('{"query": "{orders(first:25, after:\"{{After}}\", query: \"updated_at:>''{{Time}}''\"){ pageInfo { hasNextPage } edges { cursor node { legacyResourceId name createdAt updatedAt channel { name } test fullyPaid unpaid closed displayFinancialStatus displayFulfillmentStatus subtotalLineItemsQuantity totalPriceSet { shopMoney { amount currencyCode } } customAttributes { key value } tags purchasingEntity { ... on PurchasingCompany { company { id }}}}}}}"}');
+ exit('{"query": "{orders(first:25, after:\"{{After}}\", query: \"updated_at:>''{{Time}}''\"){ pageInfo { hasNextPage } edges { cursor node { legacyResourceId name createdAt updatedAt channel { name } test fullyPaid unpaid closed displayFinancialStatus displayFulfillmentStatus subtotalLineItemsQuantity totalPriceSet { shopMoney { amount currencyCode } } customAttributes { key value } tags risk { assessments { riskLevel }} purchasingEntity { ... on PurchasingCompany { company { id }}}}}}}"}');
end;
///
diff --git a/Apps/W1/Shopify/app/src/GraphQL/Codeunits/ShpfyGQLOpenOrdersToImport.Codeunit.al b/Apps/W1/Shopify/app/src/GraphQL/Codeunits/ShpfyGQLOpenOrdersToImport.Codeunit.al
index e28690ffc8..ab4d2ef6c5 100644
--- a/Apps/W1/Shopify/app/src/GraphQL/Codeunits/ShpfyGQLOpenOrdersToImport.Codeunit.al
+++ b/Apps/W1/Shopify/app/src/GraphQL/Codeunits/ShpfyGQLOpenOrdersToImport.Codeunit.al
@@ -6,7 +6,7 @@ codeunit 30205 "Shpfy GQL OpenOrdersToImport" implements "Shpfy IGraphQL"
internal procedure GetGraphQL(): Text
begin
- exit('{"query": "{orders(first:25, query: \"status:open updated_at:>''{{Time}}''\"){ pageInfo { hasNextPage } edges { cursor node { legacyResourceId name createdAt updatedAt channel { name } test fullyPaid unpaid displayFinancialStatus displayFulfillmentStatus subtotalLineItemsQuantity totalPriceSet { shopMoney { amount currencyCode } } customAttributes { key value } tags purchasingEntity { ... on PurchasingCompany { company { id }}}}}}}"}');
+ exit('{"query": "{orders(first:25, query: \"status:open updated_at:>''{{Time}}''\"){ pageInfo { hasNextPage } edges { cursor node { legacyResourceId name createdAt updatedAt channel { name } test fullyPaid unpaid displayFinancialStatus displayFulfillmentStatus subtotalLineItemsQuantity totalPriceSet { shopMoney { amount currencyCode } } customAttributes { key value } tags risk { assessments { riskLevel }} purchasingEntity { ... on PurchasingCompany { company { id }}}}}}}"}');
end;
internal procedure GetExpectedCost(): Integer
diff --git a/Apps/W1/Shopify/app/src/GraphQL/Codeunits/ShpfyGQLOrdersToImport.Codeunit.al b/Apps/W1/Shopify/app/src/GraphQL/Codeunits/ShpfyGQLOrdersToImport.Codeunit.al
index 566bf4dad9..a19263151b 100644
--- a/Apps/W1/Shopify/app/src/GraphQL/Codeunits/ShpfyGQLOrdersToImport.Codeunit.al
+++ b/Apps/W1/Shopify/app/src/GraphQL/Codeunits/ShpfyGQLOrdersToImport.Codeunit.al
@@ -13,7 +13,7 @@ codeunit 30145 "Shpfy GQL OrdersToImport" implements "Shpfy IGraphQL"
/// Return value of type Text.
internal procedure GetGraphQL(): Text
begin
- exit('{"query": "{orders(first:25, query: \"updated_at:>''{{Time}}''\"){pageInfo{hasNextPage} edges{cursor node{legacyResourceId name createdAt updatedAt channel { name } test fullyPaid unpaid closed displayFinancialStatus displayFulfillmentStatus subtotalLineItemsQuantity totalPriceSet{shopMoney{amount currencyCode}} customAttributes{key value} tags purchasingEntity { ... on PurchasingCompany { company { id }}}}}}}"}');
+ exit('{"query": "{orders(first:25, query: \"updated_at:>''{{Time}}''\"){pageInfo{hasNextPage} edges{cursor node{legacyResourceId name createdAt updatedAt channel { name } test fullyPaid unpaid closed displayFinancialStatus displayFulfillmentStatus subtotalLineItemsQuantity totalPriceSet{shopMoney{amount currencyCode}} customAttributes{key value} tags risk { assessments { riskLevel }} purchasingEntity { ... on PurchasingCompany { company { id }}}}}}}"}');
end;
///
diff --git a/Apps/W1/Shopify/app/src/Logs/Codeunits/ShpfySkippedRecord.Codeunit.al b/Apps/W1/Shopify/app/src/Logs/Codeunits/ShpfySkippedRecord.Codeunit.al
index 732a6210f7..77fb292073 100644
--- a/Apps/W1/Shopify/app/src/Logs/Codeunits/ShpfySkippedRecord.Codeunit.al
+++ b/Apps/W1/Shopify/app/src/Logs/Codeunits/ShpfySkippedRecord.Codeunit.al
@@ -8,6 +8,11 @@ codeunit 30313 "Shpfy Skipped Record"
Access = Internal;
Permissions = tabledata "Shpfy Skipped Record" = rimd;
+ var
+ NotificationSent: Boolean;
+ SkippedRecordsLbl: Label 'Some records were skipped during the synchronization.';
+ ViewSkippedRecordsLbl: Label 'View Skipped Records';
+
///
/// Creates log entry for skipped record.
///
@@ -28,6 +33,8 @@ codeunit 30313 "Shpfy Skipped Record"
SkippedRecord.Validate("Record ID", RecordId);
SkippedRecord.Validate("Skipped Reason", SkippedReason);
SkippedRecord.Insert(true);
+
+ SendSkippedNotification();
end;
///
@@ -41,4 +48,27 @@ codeunit 30313 "Shpfy Skipped Record"
LogSkippedRecord(0, RecordId, SkippedReason, Shop);
end;
+ local procedure SendSkippedNotification()
+ var
+ SkippedNotification: Notification;
+ begin
+ if not GuiAllowed then
+ exit;
+
+ if NotificationSent then
+ exit;
+
+ SkippedNotification.Id := CreateGuid();
+ SkippedNotification.Message := SkippedRecordsLbl;
+ SkippedNotification.Scope := NotificationScope::LocalScope;
+ SkippedNotification.AddAction(ViewSkippedRecordsLbl, Codeunit::"Shpfy Skipped Record", 'ViewSkippedRecords');
+ SkippedNotification.Send();
+
+ NotificationSent := true;
+ end;
+
+ internal procedure ViewSkippedRecords(SkippedNotification: Notification)
+ begin
+ Page.Run(Page::"Shpfy Skipped Records");
+ end;
}
diff --git a/Apps/W1/Shopify/app/src/Metafields/Codeunits/ShpfyMetafieldAPI.Codeunit.al b/Apps/W1/Shopify/app/src/Metafields/Codeunits/ShpfyMetafieldAPI.Codeunit.al
index dc0f656fb1..ed0d023560 100644
--- a/Apps/W1/Shopify/app/src/Metafields/Codeunits/ShpfyMetafieldAPI.Codeunit.al
+++ b/Apps/W1/Shopify/app/src/Metafields/Codeunits/ShpfyMetafieldAPI.Codeunit.al
@@ -81,6 +81,7 @@ codeunit 30316 "Shpfy Metafield API"
begin
Metafield.SetRange("Parent Table No.", ParentTableId);
Metafield.SetRange("Owner Id", OwnerId);
+ Metafield.SetFilter(Type, '<>%1&<>%2', Metafield.Type::string, Metafield.Type::integer);
Metafield.SetFilter(Value, '<>%1', '');
if Metafield.FindSet() then
repeat
diff --git a/Apps/W1/Shopify/app/src/Metafields/Enums/ShpfyMetafieldType.Enum.al b/Apps/W1/Shopify/app/src/Metafields/Enums/ShpfyMetafieldType.Enum.al
index a13641fb04..e978427198 100644
--- a/Apps/W1/Shopify/app/src/Metafields/Enums/ShpfyMetafieldType.Enum.al
+++ b/Apps/W1/Shopify/app/src/Metafields/Enums/ShpfyMetafieldType.Enum.al
@@ -8,25 +8,18 @@ enum 30159 "Shpfy Metafield Type" implements "Shpfy IMetafield Type"
Caption = 'Shopify Metafield Type';
Extensible = false;
-#if not CLEAN26
value(0; string)
{
Caption = 'String';
Implementation = "Shpfy IMetafield Type" = "Shpfy Mtfld Type String";
- ObsoleteReason = 'Use Single line text instead.';
- ObsoleteTag = '26.0';
- ObsoleteState = Pending;
}
value(1; integer)
{
Caption = 'Legacy Integer';
Implementation = "Shpfy IMetafield Type" = "Shpfy Mtfld Type Integer";
- ObsoleteReason = 'Use Integer instead.';
- ObsoleteTag = '26.0';
- ObsoleteState = Pending;
}
-#endif
+
value(2; json)
{
Caption = 'JSON';
diff --git a/Apps/W1/Shopify/app/src/Metafields/Tables/ShpfyMetafield.Table.al b/Apps/W1/Shopify/app/src/Metafields/Tables/ShpfyMetafield.Table.al
index d69d2e1d78..5efd74fbea 100644
--- a/Apps/W1/Shopify/app/src/Metafields/Tables/ShpfyMetafield.Table.al
+++ b/Apps/W1/Shopify/app/src/Metafields/Tables/ShpfyMetafield.Table.al
@@ -114,7 +114,6 @@ table 30101 "Shpfy Metafield"
Caption = 'Type';
DataClassification = CustomerContent;
-#if not CLEAN26
trigger OnValidate()
begin
if Type = Type::string then
@@ -122,7 +121,6 @@ table 30101 "Shpfy Metafield"
if Type = Type::integer then
Error(StringTypeErr, Format(Type), Format(Type::number_integer));
end;
-#endif
}
field(9; "Last Updated by BC"; DateTime)
{
@@ -185,10 +183,8 @@ table 30101 "Shpfy Metafield"
"Last Updated by BC" := CurrentDateTime;
end;
-#if not CLEAN26
var
StringTypeErr: Label 'The type %1 is obsolete. Use %2 instead.', Comment = '%1 - Type, %2 - Type';
-#endif
///
/// Get the owner type based on the resources's owner table number.
diff --git a/Apps/W1/Shopify/app/src/Order Risks/Codeunits/ShpfyOrderRisks.Codeunit.al b/Apps/W1/Shopify/app/src/Order Risks/Codeunits/ShpfyOrderRisks.Codeunit.al
index 5e7f334c58..0b581bc7bc 100644
--- a/Apps/W1/Shopify/app/src/Order Risks/Codeunits/ShpfyOrderRisks.Codeunit.al
+++ b/Apps/W1/Shopify/app/src/Order Risks/Codeunits/ShpfyOrderRisks.Codeunit.al
@@ -85,7 +85,7 @@ codeunit 30170 "Shpfy Order Risks"
end;
end;
- local procedure ConvertToRiskLevel(Value: Text): Enum "Shpfy Risk Level"
+ internal procedure ConvertToRiskLevel(Value: Text): Enum "Shpfy Risk Level"
begin
Value := CommunicationMgt.ConvertToCleanOptionValue(Value);
if Enum::"Shpfy Risk Level".Names().Contains(Value) then
diff --git a/Apps/W1/Shopify/app/src/Order handling/Codeunits/ShpfyImportOrder.Codeunit.al b/Apps/W1/Shopify/app/src/Order handling/Codeunits/ShpfyImportOrder.Codeunit.al
index 0012936275..db81b93c0d 100644
--- a/Apps/W1/Shopify/app/src/Order handling/Codeunits/ShpfyImportOrder.Codeunit.al
+++ b/Apps/W1/Shopify/app/src/Order handling/Codeunits/ShpfyImportOrder.Codeunit.al
@@ -628,6 +628,7 @@ codeunit 30161 "Shpfy Import Order"
OrderAttribute.SetRange("Order Id", ShopifyOrderId);
if not OrderAttribute.IsEmpty() then
OrderAttribute.DeleteAll();
+
foreach JToken in JCustomAttributtes do begin
Clear(OrderAttribute);
OrderAttribute."Order Id" := ShopifyOrderId;
@@ -638,7 +639,9 @@ codeunit 30161 "Shpfy Import Order"
else
#endif
OrderAttribute."Attribute Value" := CopyStr(JsonHelper.GetValueAsText(JToken, 'value', MaxStrLen(OrderAttribute."Attribute Value")), 1, MaxStrLen(OrderAttribute."Attribute Value"));
- OrderAttribute.Insert();
+
+ if not OrderAttribute.Insert() then
+ OrderAttribute.Modify();
end;
end;
diff --git a/Apps/W1/Shopify/app/src/Order handling/Codeunits/ShpfyOrdersAPI.Codeunit.al b/Apps/W1/Shopify/app/src/Order handling/Codeunits/ShpfyOrdersAPI.Codeunit.al
index 53b128e30e..0fdbf43571 100644
--- a/Apps/W1/Shopify/app/src/Order handling/Codeunits/ShpfyOrdersAPI.Codeunit.al
+++ b/Apps/W1/Shopify/app/src/Order handling/Codeunits/ShpfyOrdersAPI.Codeunit.al
@@ -98,7 +98,9 @@ codeunit 30165 "Shpfy Orders API"
else
#endif
OrderAttribute."Attribute Value" := CopyStr(JsonHelper.GetValueAsText(JItem, 'value').Replace('\\', '\').Replace('\"', '"'), 1, MaxStrLen(OrderAttribute."Attribute Value"));
- OrderAttribute.Insert();
+
+ if not OrderAttribute.Insert() then
+ OrderAttribute.Modify();
end;
end;
@@ -260,6 +262,7 @@ codeunit 30165 "Shpfy Orders API"
end;
OrdersToImport.Tags := CopyStr(Tags.ToText(), 2, MaxStrLen(OrdersToImport.Tags));
end;
+ OrdersToImport."High Risk" := IsHighRiskOrder(JNode);
OrderHeader.SetRange("Shopify Order Id", Id);
if OrderHeader.IsEmpty then
OrdersToImport."Import Action" := OrdersToImport."Import Action"::New
@@ -308,4 +311,19 @@ codeunit 30165 "Shpfy Orders API"
JResponse := CommunicationMgt.ExecuteGraphQL(GraphQLType, Parameters);
exit(JsonHelper.GetJsonArray(JResponse, 'data.orderCancel.orderCancelUserErrors').Count() = 0);
end;
+
+ local procedure IsHighRiskOrder(JOrder: JsonObject): Boolean
+ var
+ OrderRisks: Codeunit "Shpfy Order Risks";
+ RiskLevel: Enum "Shpfy Risk Level";
+ JRiskAssessments: JsonArray;
+ JRiskAssessment: JsonToken;
+ begin
+ if JsonHelper.GetJsonArray(JOrder, JRiskAssessments, 'risk.assessments') then
+ foreach JRiskAssessment in JRiskAssessments do begin
+ RiskLevel := OrderRisks.ConvertToRiskLevel(JsonHelper.GetValueAsText(JRiskAssessment, 'riskLevel'));
+ if RiskLevel = RiskLevel::High then
+ exit(true);
+ end;
+ end;
}
\ No newline at end of file
diff --git a/Apps/W1/Shopify/app/src/Order handling/Codeunits/ShpfyProcessOrder.Codeunit.al b/Apps/W1/Shopify/app/src/Order handling/Codeunits/ShpfyProcessOrder.Codeunit.al
index 32a14f1cf0..b07140a894 100644
--- a/Apps/W1/Shopify/app/src/Order handling/Codeunits/ShpfyProcessOrder.Codeunit.al
+++ b/Apps/W1/Shopify/app/src/Order handling/Codeunits/ShpfyProcessOrder.Codeunit.al
@@ -140,7 +140,8 @@ codeunit 30166 "Shpfy Process Order"
if ShopifyOrderHeader."Work Description".HasValue then
SalesHeader.SetWorkDescription(ShopifyOrderHeader.GetWorkDescription());
end;
- OrdersAPI.AddOrderAttribute(ShopifyOrderHeader, 'BC Doc. No.', SalesHeader."No.", ShopifyShop);
+ if ShopifyShop."Order Attributes To Shopify" then
+ OrdersAPI.AddOrderAttribute(ShopifyOrderHeader, 'BC Doc. No.', SalesHeader."No.", ShopifyShop);
DocLinkToBCDoc.Init();
DocLinkToBCDoc."Shopify Document Type" := "Shpfy Shop Document Type"::"Shopify Shop Order";
DocLinkToBCDoc."Shopify Document Id" := ShopifyOrderHeader."Shopify Order Id";
diff --git a/Apps/W1/Shopify/app/src/Order handling/Pages/ShpfyOrder.Page.al b/Apps/W1/Shopify/app/src/Order handling/Pages/ShpfyOrder.Page.al
index 6654398025..4a2e42857b 100644
--- a/Apps/W1/Shopify/app/src/Order handling/Pages/ShpfyOrder.Page.al
+++ b/Apps/W1/Shopify/app/src/Order handling/Pages/ShpfyOrder.Page.al
@@ -49,6 +49,12 @@ page 30113 "Shpfy Order"
ObsoleteTag = '25.0';
}
#endif
+ field("High Risk"; Rec."High Risk")
+ {
+ ApplicationArea = All;
+ Editable = false;
+ ToolTip = 'Specifies if the order is considered high risk.';
+ }
field(TemplCodeField; Rec."Customer Templ. Code")
{
ApplicationArea = All;
diff --git a/Apps/W1/Shopify/app/src/Order handling/Pages/ShpfyOrders.Page.al b/Apps/W1/Shopify/app/src/Order handling/Pages/ShpfyOrders.Page.al
index 01a9167285..c4deb40165 100644
--- a/Apps/W1/Shopify/app/src/Order handling/Pages/ShpfyOrders.Page.al
+++ b/Apps/W1/Shopify/app/src/Order handling/Pages/ShpfyOrders.Page.al
@@ -47,6 +47,11 @@ page 30115 "Shpfy Orders"
ObsoleteTag = '25.0';
}
#endif
+ field("High Risk"; Rec."High Risk")
+ {
+ ApplicationArea = All;
+ ToolTip = 'Specifies if the order is considered high risk.';
+ }
field(Closed; Rec.Closed)
{
ApplicationArea = All;
diff --git a/Apps/W1/Shopify/app/src/Order handling/Reports/ShpfySyncOrdersfromShopify.Report.al b/Apps/W1/Shopify/app/src/Order handling/Reports/ShpfySyncOrdersfromShopify.Report.al
index 3ab12a09d9..8aa7acd18e 100644
--- a/Apps/W1/Shopify/app/src/Order handling/Reports/ShpfySyncOrdersfromShopify.Report.al
+++ b/Apps/W1/Shopify/app/src/Order handling/Reports/ShpfySyncOrdersfromShopify.Report.al
@@ -21,7 +21,7 @@ report 30104 "Shpfy Sync Orders from Shopify"
{
DataItemLink = "Shop Code" = field(Code);
DataItemLinkReference = Shop;
- RequestFilterFields = "Fully Paid", "Financial Status", "Fulfillment Status", Confirmed, "Import Action", "Attribute Key Filter", "Attribute Key Exists", "Channel Name", "Order No.";
+ RequestFilterFields = "Fully Paid", "Financial Status", "Fulfillment Status", Confirmed, "Import Action", "Attribute Key Filter", "Attribute Key Exists", "Channel Name", "Order No.", "High Risk";
trigger OnPreDataItem()
var
diff --git a/Apps/W1/Shopify/app/src/Order handling/Tables/ShpfyOrderHeader.Table.al b/Apps/W1/Shopify/app/src/Order handling/Tables/ShpfyOrderHeader.Table.al
index 7957cfdae2..19fa2545f8 100644
--- a/Apps/W1/Shopify/app/src/Order handling/Tables/ShpfyOrderHeader.Table.al
+++ b/Apps/W1/Shopify/app/src/Order handling/Tables/ShpfyOrderHeader.Table.al
@@ -137,7 +137,7 @@ table 30118 "Shpfy Order Header"
Caption = 'Risk Level';
DataClassification = SystemMetadata;
Editable = false;
- ObsoleteReason = 'This field is not imported.';
+ ObsoleteReason = 'This field is not imported. Use field "High Risk" field.';
#if not CLEAN25
ObsoleteState = Pending;
ObsoleteTag = '25.0';
@@ -605,6 +605,12 @@ table 30118 "Shpfy Order Header"
Caption = 'Company Location Id';
DataClassification = SystemMetadata;
}
+ field(128; "High Risk"; Boolean)
+ {
+ Caption = 'High Risk';
+ FieldClass = FlowField;
+ CalcFormula = exist("Shpfy Order Risk" where("Order Id" = field("Shopify Order Id"), Level = const(High)));
+ }
field(500; "Shop Code"; Code[20])
{
Caption = 'Shop Code';
diff --git a/Apps/W1/Shopify/app/src/Order handling/Tables/ShpfyOrdersToImport.Table.al b/Apps/W1/Shopify/app/src/Order handling/Tables/ShpfyOrdersToImport.Table.al
index 18e1a3d1ae..57442b7b2c 100644
--- a/Apps/W1/Shopify/app/src/Order handling/Tables/ShpfyOrdersToImport.Table.al
+++ b/Apps/W1/Shopify/app/src/Order handling/Tables/ShpfyOrdersToImport.Table.al
@@ -92,7 +92,7 @@ table 30121 "Shpfy Orders to Import"
Caption = 'Risk Level';
DataClassification = CustomerContent;
Editable = false;
- ObsoleteReason = 'This field is not imported.';
+ ObsoleteReason = 'This field is not imported. Use field ';
#if not CLEAN25
ObsoleteState = Pending;
ObsoleteTag = '25.0';
@@ -173,6 +173,12 @@ table 30121 "Shpfy Orders to Import"
DataClassification = CustomerContent;
Editable = false;
}
+ field(24; "High Risk"; Boolean)
+ {
+ Caption = 'High Risk';
+ DataClassification = SystemMetadata;
+ Editable = false;
+ }
field(100; "Import Action"; enum "Shpfy Import Action")
{
Caption = 'Import Action';
diff --git a/Apps/W1/Shopify/app/src/Products/Codeunits/ShpfyProductAPI.Codeunit.al b/Apps/W1/Shopify/app/src/Products/Codeunits/ShpfyProductAPI.Codeunit.al
index d5c10083f4..510fd6bc9d 100644
--- a/Apps/W1/Shopify/app/src/Products/Codeunits/ShpfyProductAPI.Codeunit.al
+++ b/Apps/W1/Shopify/app/src/Products/Codeunits/ShpfyProductAPI.Codeunit.al
@@ -88,7 +88,7 @@ codeunit 30176 "Shpfy Product API"
end;
GraphQuery.Append(']');
end;
- GraphQuery.Append(', published: true}) ');
+ GraphQuery.Append('}) ');
GraphQuery.Append('{product {legacyResourceId, onlineStoreUrl, onlineStorePreviewUrl, createdAt, updatedAt, tags, variants(first: 1) {edges {node {legacyResourceId, createdAt, updatedAt}}}}, userErrors {field, message}}');
GraphQuery.Append('}"}');
@@ -603,9 +603,6 @@ codeunit 30176 "Shpfy Product API"
GraphQuery: Text;
JResponse: JsonToken;
begin
- if ShopifyProduct.Status <> Enum::"Shpfy Product Status"::Active then
- exit;
-
if not FilterSalesChannelsToPublishTo(SalesChannel, ShopifyProduct."Shop Code") then
exit;
diff --git a/Apps/W1/Shopify/test/Metafields/ShpfyMetafieldsHelper.Codeunit.al b/Apps/W1/Shopify/test/Metafields/ShpfyMetafieldsHelper.Codeunit.al
index 963311de64..9de0af5787 100644
--- a/Apps/W1/Shopify/test/Metafields/ShpfyMetafieldsHelper.Codeunit.al
+++ b/Apps/W1/Shopify/test/Metafields/ShpfyMetafieldsHelper.Codeunit.al
@@ -31,6 +31,7 @@ codeunit 139549 "Shpfy Metafields Helper"
ShpfyMetafield.Namespace := Namespace;
ShpfyMetafield.Name := Name;
ShpfyMetafield.Value := Value;
+ ShpfyMetafield.Type := ShpfyMetafield.Type::single_line_text_field;
ShpfyMetafield.Insert(true);
exit(ShpfyMetafield.Id);
end;
diff --git a/Apps/W1/Shopify/test/Order Handling/ShpfyOrderHandlingHelper.Codeunit.al b/Apps/W1/Shopify/test/Order Handling/ShpfyOrderHandlingHelper.Codeunit.al
index 33b4202a25..778b17fa9c 100644
--- a/Apps/W1/Shopify/test/Order Handling/ShpfyOrderHandlingHelper.Codeunit.al
+++ b/Apps/W1/Shopify/test/Order Handling/ShpfyOrderHandlingHelper.Codeunit.al
@@ -19,7 +19,7 @@ codeunit 139607 "Shpfy Order Handling Helper"
Any.SetDefaultSeed();
OrdersToImport := Any.IntegerInRange(1, 5);
JPageInfo.Add('hasNextPage', false);
- JOrders.Add('pageInf', JPageInfo);
+ JOrders.Add('pageInfo', JPageInfo);
for Index := 1 to OrdersToImport do
JEdges.Add(OrderToImport(B2B));
JOrders.Add('edges', JEdges);
@@ -55,7 +55,7 @@ codeunit 139607 "Shpfy Order Handling Helper"
JNode.Add('test', true);
JNode.Add('fullyPaid', false);
JNode.Add('unpaid', false);
- JNode.Add('riskLevel', 'LOW');
+ JNode.Add('risk', GetRiskLevels());
JNode.Add('displayFinancialStatus', 'PENDING');
JNode.Add('displayFulfillmentStatus', 'UNFULFILLED');
JNode.Add('subtotalLineItemsQuantity', 1);
@@ -82,7 +82,6 @@ codeunit 139607 "Shpfy Order Handling Helper"
exit(JOrders.Count);
end;
-
internal procedure CreateShopifyOrderAsJson(Shop: Record "Shpfy Shop"; var OrdersToImport: Record "Shpfy Orders to Import"; var JShopifyLineItems: JsonArray; B2B: Boolean) JOrder: JsonObject
var
Customer: Record Customer;
@@ -155,7 +154,6 @@ codeunit 139607 "Shpfy Order Handling Helper"
JOrder.Add('displayFulfillmentStatus', Format(OrdersToImport."Fulfillment Status").ToUpper());
JOrder.Add('total_weight', Any.IntegerInRange(0, 1000));
JOrder.Add('refundable', false);
- JOrder.Add('risks', GetRiskLevels());
JOrder.Add('tags', OrdersToImport.Tags);
JOrder.Add('paymentGatewayNames', GetPaymentGatewayNames());
JOrder.Add('processedAt', OrdersToImport."Created At");
@@ -311,19 +309,20 @@ codeunit 139607 "Shpfy Order Handling Helper"
exit(InitializeTest.GetDummyCustomer());
end;
- local procedure GetRiskLevels() JRisks: JsonArray
+ local procedure GetRiskLevels() JRisk: JsonObject
var
Index: Integer;
+ JAssessments: JsonArray;
begin
for Index := 1 to Any.IntegerInRange(5, 10) do
- JRisks.Add(GetRiskLevel());
+ JAssessments.Add(GetRiskLevel());
+
+ JRisk.Add('assessments', JAssessments);
end;
- local procedure GetRiskLevel() JRisk: JsonObject
+ local procedure GetRiskLevel() JAssessment: JsonObject
begin
- JRisk.Add('level', "Shpfy Risk Level".Names().Get(Any.IntegerInRange(1, "Shpfy Risk Level".Names().Count)).ToUpper());
- JRisk.Add('display', Any.Boolean());
- JRisk.Add('message', Any.AlphabeticText(100));
+ JAssessment.Add('riskLevel', "Shpfy Risk Level".Names().Get(Any.IntegerInRange(1, "Shpfy Risk Level".Names().Count)).ToUpper());
end;
local procedure CreateAddress(Customer: Record Customer; AddressId: BigInteger; IncludeFullName: Boolean; IncludeGeoCodes: Boolean) JAddress: JsonObject
diff --git a/Apps/W1/Shopify/test/Order Handling/ShpfyOrdersAPITest.Codeunit.al b/Apps/W1/Shopify/test/Order Handling/ShpfyOrdersAPITest.Codeunit.al
index a04c674bf6..2198cc8ce1 100644
--- a/Apps/W1/Shopify/test/Order Handling/ShpfyOrdersAPITest.Codeunit.al
+++ b/Apps/W1/Shopify/test/Order Handling/ShpfyOrdersAPITest.Codeunit.al
@@ -509,6 +509,156 @@ codeunit 139608 "Shpfy Orders API Test"
LibraryAssert.AreNotEqual(SalesLine."Reserved Quantity", 0, 'Order line is reserved');
end;
+ [Test]
+ procedure UnitTestImportShopifyOrderHighRisk()
+ var
+ Shop: Record "Shpfy Shop";
+ OrderHeader: Record "Shpfy Order Header";
+ OrdersToImport: Record "Shpfy Orders to Import";
+ CommunicationMgt: Codeunit "Shpfy Communication Mgt.";
+ ImportOrder: Codeunit "Shpfy Import Order";
+ OrderHandlingHelper: Codeunit "Shpfy Order Handling Helper";
+ RiskLevel: Enum "Shpfy Risk Level";
+ JShopifyOrder: JsonObject;
+ JShopifyLineItems: JsonArray;
+ begin
+ // [SCENARIO] Import a high risk Shopify order from the "Shpfy Orders to Import" record
+ Initialize();
+
+ // [GIVEN] Shopify Shop
+ Shop := CommunicationMgt.GetShopRecord();
+ Shop."Customer Mapping Type" := "Shpfy Customer Mapping"::"By EMail/Phone";
+ if not Shop.Modify() then
+ Shop.Insert();
+ ImportOrder.SetShop(Shop.Code);
+
+ // [GIVEN] the order to import as a json structure.
+ JShopifyOrder := OrderHandlingHelper.CreateShopifyOrderAsJson(Shop, OrdersToImport, JShopifyLineItems, false);
+
+ // [WHEN] ShpfyImportOrder.ImportOrder
+ ImportShopifyOrder(Shop, OrderHeader, OrdersToImport, ImportOrder, JShopifyOrder, JShopifyLineItems);
+ CreateOrderRisk(OrderHeader."Shopify Order Id", RiskLevel::High);
+
+ // [THEN] Order is high risk
+ OrderHeader.CalcFields("High Risk");
+ LibraryAssert.IsTrue(OrderHeader."High Risk", 'Order is high risk');
+ end;
+
+ [Test]
+ procedure UnitTestImportShopifyOrderLowRisk()
+ var
+ Shop: Record "Shpfy Shop";
+ OrderHeader: Record "Shpfy Order Header";
+ OrdersToImport: Record "Shpfy Orders to Import";
+ CommunicationMgt: Codeunit "Shpfy Communication Mgt.";
+ ImportOrder: Codeunit "Shpfy Import Order";
+ OrderHandlingHelper: Codeunit "Shpfy Order Handling Helper";
+ RiskLevel: Enum "Shpfy Risk Level";
+ JShopifyOrder: JsonObject;
+ JShopifyLineItems: JsonArray;
+ begin
+ // [SCENARIO] Import a low risk Shopify order from the "Shpfy Orders to Import" record
+ Initialize();
+
+ // [GIVEN] Shopify Shop
+ Shop := CommunicationMgt.GetShopRecord();
+ Shop."Customer Mapping Type" := "Shpfy Customer Mapping"::"By EMail/Phone";
+ if not Shop.Modify() then
+ Shop.Insert();
+ ImportOrder.SetShop(Shop.Code);
+
+ // [GIVEN] the order to import as a json structure.
+ JShopifyOrder := OrderHandlingHelper.CreateShopifyOrderAsJson(Shop, OrdersToImport, JShopifyLineItems, false);
+
+ // [WHEN] ShpfyImportOrder.ImportOrder
+ ImportShopifyOrder(Shop, OrderHeader, OrdersToImport, ImportOrder, JShopifyOrder, JShopifyLineItems);
+ CreateOrderRisk(OrderHeader."Shopify Order Id", RiskLevel::Low);
+
+ // [THEN] Order is high risk
+ OrderHeader.CalcFields("High Risk");
+ LibraryAssert.IsFalse(OrderHeader."High Risk", 'Order is not high risk');
+ end;
+
+ [Test]
+ procedure UnitTestExtractShopifyOrdersToImportHighRisk()
+ var
+ Shop: Record "Shpfy Shop";
+ OrdersToImport: Record "Shpfy Orders to Import";
+ CommunicationMgt: Codeunit "Shpfy Communication Mgt.";
+ OrderHandlingHelper: Codeunit "Shpfy Order Handling Helper";
+ OrdersAPI: Codeunit "Shpfy Orders API";
+ Cursor: Text;
+ JOrdersToImport: JsonObject;
+ JOrder: JsonToken;
+ JOrders: JsonArray;
+ JAssessments: JsonArray;
+ JAssessment: JsonToken;
+ begin
+ // [SCENARIO] Create a random expected Json structure for the OrdersToImport with high risk
+ Initialize();
+ Clear(OrdersToImport);
+ if not OrdersToImport.IsEmpty then
+ OrdersToImport.DeleteAll();
+
+ // [GIVEN] Shopify Shop
+ Shop := CommunicationMgt.GetShopRecord();
+ // [GIVEN] the orders to import as a json structure.
+ JOrdersToImport := OrderHandlingHelper.GetOrdersToImport(false);
+ JOrdersToImport.GetObject('data').GetObject('orders').GetArray('edges').Get(0, JOrder);
+ JAssessments := JOrder.AsObject().GetObject('node').GetObject('risk').GetArray('assessments');
+ foreach JAssessment in JAssessments do
+ JAssessment.AsObject().Replace('riskLevel', 'HIGH');
+ JOrders.Add(JOrder);
+ JOrdersToImport.GetObject('data').GetObject('orders').Replace('edges', JOrders);
+
+ // [WHEN] Execute ShpfyOrdersAPI.ExtractShopifyOrdersToImport
+ OrdersAPI.ExtractShopifyOrdersToImport(Shop, JOrdersToImport, Cursor);
+
+ // [THEN] Order is high risk
+ OrdersToImport.FindLast();
+ LibraryAssert.IsTrue(OrdersToImport."High Risk", 'Order is high risk');
+ end;
+
+ [Test]
+ procedure UnitTestExtractShopifyOrdersToImportLowRisk()
+ var
+ Shop: Record "Shpfy Shop";
+ OrdersToImport: Record "Shpfy Orders to Import";
+ CommunicationMgt: Codeunit "Shpfy Communication Mgt.";
+ OrderHandlingHelper: Codeunit "Shpfy Order Handling Helper";
+ OrdersAPI: Codeunit "Shpfy Orders API";
+ Cursor: Text;
+ JOrdersToImport: JsonObject;
+ JOrder: JsonToken;
+ JOrders: JsonArray;
+ JAssessments: JsonArray;
+ JAssessment: JsonToken;
+ begin
+ // [SCENARIO] Create a random expected Json structure for the OrdersToImport with low risk
+ Initialize();
+ Clear(OrdersToImport);
+ if not OrdersToImport.IsEmpty then
+ OrdersToImport.DeleteAll();
+
+ // [GIVEN] Shopify Shop
+ Shop := CommunicationMgt.GetShopRecord();
+ // [GIVEN] the orders to import as a json structure.
+ JOrdersToImport := OrderHandlingHelper.GetOrdersToImport(false);
+ JOrdersToImport.GetObject('data').GetObject('orders').GetArray('edges').Get(0, JOrder);
+ JAssessments := JOrder.AsObject().GetObject('node').GetObject('risk').GetArray('assessments');
+ foreach JAssessment in JAssessments do
+ JAssessment.AsObject().Replace('riskLevel', 'LOW');
+ JOrders.Add(JOrder);
+ JOrdersToImport.GetObject('data').GetObject('orders').Replace('edges', JOrders);
+
+ // [WHEN] Execute ShpfyOrdersAPI.ExtractShopifyOrdersToImport
+ OrdersAPI.ExtractShopifyOrdersToImport(Shop, JOrdersToImport, Cursor);
+
+ // [THEN] Order is high risk
+ OrdersToImport.FindLast();
+ LibraryAssert.IsFalse(OrdersToImport."High Risk", 'Order is not high risk');
+ end;
+
local procedure CreateTaxArea(var TaxArea: Record "Tax Area"; var ShopifyTaxArea: Record "Shpfy Tax Area"; Shop: Record "Shpfy Shop")
var
ShopifyCustomerTemplate: Record "Shpfy Customer Template";
@@ -553,6 +703,23 @@ codeunit 139608 "Shpfy Orders API Test"
ImportShopifyOrder(Shop, OrderHeader, OrdersToImport, ImportOrder, JShopifyOrder, JShopifyLineItems);
end;
+ local procedure CreateOrderRisk(ShopifyOrderId: BigInteger; RiskLevel: Enum "Shpfy Risk Level")
+ var
+ OrderRisk: Record "Shpfy Order Risk";
+ LineNo: Integer;
+ begin
+ if OrderRisk.FindLast() then
+ LineNo := OrderRisk."Line No." + 1
+ else
+ LineNo := 1;
+
+ Clear(OrderRisk);
+ OrderRisk."Order Id" := ShopifyOrderId;
+ OrderRisk."Line No." := LineNo;
+ OrderRisk.Level := RiskLevel;
+ OrderRisk.Insert();
+ end;
+
local procedure Initialize()
var
OrdersAPISubscriber: Codeunit "Shpfy Orders API Subscriber";
diff --git a/Apps/W1/Shopify/test/Products/ShpfySalesChannelTest.Codeunit.al b/Apps/W1/Shopify/test/Products/ShpfySalesChannelTest.Codeunit.al
index f31b382973..d9c9a7c64d 100644
--- a/Apps/W1/Shopify/test/Products/ShpfySalesChannelTest.Codeunit.al
+++ b/Apps/W1/Shopify/test/Products/ShpfySalesChannelTest.Codeunit.al
@@ -75,12 +75,17 @@ codeunit 139698 "Shpfy Sales Channel Test"
ShopifyProductAPI: Codeunit "Shpfy Product API";
SalesChannelSubs: Codeunit "Shpfy Sales Channel Subs.";
GraphQueryTxt: Text;
+ OnlineShopId, POSId : BigInteger;
begin
// [SCENARIO] Publishing not active product to Shopify Sales Channel.
Initialize();
// [GIVEN] Product with archived status.
CreateProductWithStatus(ShopifyProduct, Enum::"Shpfy Product Status"::Archived, Any.IntegerInRange(10000, 99999));
+ // [GIVEN] Default sales channels.
+ OnlineShopId := Any.IntegerInRange(10000, 99999);
+ POSId := OnlineShopId + 1;
+ CreateDefaultSalesChannels(OnlineShopId, POSId);
// [WHEN] Invoking the procedure: ShopifyProductAPI.PublishProduct(ShopifyProduct)
BindSubscription(SalesChannelSubs);
@@ -88,8 +93,9 @@ codeunit 139698 "Shpfy Sales Channel Test"
UnbindSubscription(SalesChannelSubs);
GraphQueryTxt := SalesChannelSubs.GetGraphQueryTxt();
- // [THEN] Procedure exits without publishing the product.
- LibraryAssert.AreEqual('', GraphQueryTxt, 'Query for publishing the product is generated');
+ // [THEN] Query for publishing the product is generated.
+ LibraryAssert.IsTrue(GraphQueryTxt.Contains(StrSubstNo('id: \"gid://shopify/Product/%1\"', ShopifyProduct.Id)), 'Product Id is not in the query');
+ LibraryAssert.IsTrue(GraphQueryTxt.Contains(StrSubstNo('publicationId: \"gid://shopify/Publication/%1\"', OnlineShopId)), 'Publication Id for Online Shop is not in the query');
end;
[Test]
@@ -99,6 +105,7 @@ codeunit 139698 "Shpfy Sales Channel Test"
ShopifyProductAPI: Codeunit "Shpfy Product API";
SalesChannelSubs: Codeunit "Shpfy Sales Channel Subs.";
GraphQueryTxt: Text;
+ OnlineShopId, POSId : BigInteger;
begin
// [SCENARIO] Publishing draft product to Shopify Sales Channel.
Initialize();
@@ -106,7 +113,9 @@ codeunit 139698 "Shpfy Sales Channel Test"
// [GIVEN] Product with draft status.
CreateProductWithStatus(ShopifyProduct, Enum::"Shpfy Product Status"::Draft, Any.IntegerInRange(10000, 99999));
// [GIVEN] Default sales channels.
- CreateDefaultSalesChannels(Any.IntegerInRange(10000, 99999), Any.IntegerInRange(10000, 99999));
+ OnlineShopId := Any.IntegerInRange(10000, 99999);
+ POSId := OnlineShopId + 1;
+ CreateDefaultSalesChannels(OnlineShopId, POSId);
// [WHEN] Invoking the procedure: ShopifyProductAPI.PublishProduct(ShopifyProduct)
BindSubscription(SalesChannelSubs);
@@ -114,8 +123,9 @@ codeunit 139698 "Shpfy Sales Channel Test"
UnbindSubscription(SalesChannelSubs);
GraphQueryTxt := SalesChannelSubs.GetGraphQueryTxt();
- // [THEN] Procedure exits without publishing the product.
- LibraryAssert.AreEqual('', GraphQueryTxt, 'Query for publishing the product is generated');
+ // [THEN] Query for publishing the product is generated.
+ LibraryAssert.IsTrue(GraphQueryTxt.Contains(StrSubstNo('id: \"gid://shopify/Product/%1\"', ShopifyProduct.Id)), 'Product Id is not in the query');
+ LibraryAssert.IsTrue(GraphQueryTxt.Contains(StrSubstNo('publicationId: \"gid://shopify/Publication/%1\"', OnlineShopId)), 'Publication Id for Online Shop is not in the query');
end;
[Test]
diff --git a/Apps/W1/SubscriptionBilling/App/Customer Contracts/Codeunits/ExtendContractMgt.Codeunit.al b/Apps/W1/SubscriptionBilling/App/Customer Contracts/Codeunits/ExtendContractMgt.Codeunit.al
index 8acfa52f80..dee6e82a0d 100644
--- a/Apps/W1/SubscriptionBilling/App/Customer Contracts/Codeunits/ExtendContractMgt.Codeunit.al
+++ b/Apps/W1/SubscriptionBilling/App/Customer Contracts/Codeunits/ExtendContractMgt.Codeunit.al
@@ -44,15 +44,18 @@ codeunit 8075 "Extend Contract Mgt."
local procedure UpdateUsageDataSubscriptionWithServiceCommitment(ServiceCommitment: Record "Service Commitment")
var
UsageDataSubscription: Record "Usage Data Subscription";
+ UsageDataSubscription2: Record "Usage Data Subscription";
begin
UsageDataSubscription.SetRange("Supplier Reference Entry No.", ServiceCommitment."Supplier Reference Entry No.");
UsageDataSubscription.SetFilter("Service Object No.", '');
UsageDataSubscription.SetRange("Service Commitment Entry No.", 0);
- if UsageDataSubscription.FindSet() then
+ if UsageDataSubscription.FindSet(true) then
repeat
- UsageDataSubscription."Service Object No." := ServiceCommitment."Service Object No.";
- UsageDataSubscription."Service Commitment Entry No." := ServiceCommitment."Entry No.";
- UsageDataSubscription.Modify(false);
+ UsageDataSubscription2 := UsageDataSubscription;
+ UsageDataSubscription2."Service Object No." := ServiceCommitment."Service Object No.";
+ UsageDataSubscription2."Service Commitment Entry No." := ServiceCommitment."Entry No.";
+ UsageDataSubscription2.Modify(false);
+ UsageDataSubscription2.UpdateServiceObjectNoForUsageDataGenericImport();
until UsageDataSubscription.Next() = 0;
end;
diff --git a/Apps/W1/SubscriptionBilling/App/Customer Contracts/Page Extensions/CustomerCard.PageExt.al b/Apps/W1/SubscriptionBilling/App/Customer Contracts/Page Extensions/CustomerCard.PageExt.al
index f32852bee0..bdbbe8757a 100644
--- a/Apps/W1/SubscriptionBilling/App/Customer Contracts/Page Extensions/CustomerCard.PageExt.al
+++ b/Apps/W1/SubscriptionBilling/App/Customer Contracts/Page Extensions/CustomerCard.PageExt.al
@@ -26,6 +26,38 @@ pageextension 8051 "Customer Card" extends "Customer Card"
{
}
}
+ addlast("&Customer")
+ {
+ action(Contracts)
+ {
+ AccessByPermission = tabledata "Customer Contract" = R;
+ ApplicationArea = Basic, Suite;
+ Caption = 'Contracts';
+ Image = FileContract;
+ RunObject = page "Customer Contracts";
+ RunPageLink = "Sell-to Customer No." = field("No.");
+ ToolTip = 'View a list of ongoing customer contracts.';
+ }
+ action(ServiceObjects)
+ {
+ AccessByPermission = tabledata "Service Object" = R;
+ ApplicationArea = Basic, Suite;
+ Caption = 'Service Objects';
+ Image = ServiceItem;
+ RunObject = page "Service Object";
+ RunPageLink = "End-User Customer No." = field("No.");
+ ToolTip = 'View a list of service objects for the customer.';
+ }
+ }
+ addlast(Category_Category9)
+ {
+ actionref(Contracts_Promoted; Contracts)
+ {
+ }
+ actionref(ServiceObjects_Promoted; ServiceObjects)
+ {
+ }
+ }
addlast(reporting)
{
action(OverviewOfContractComponents)
diff --git a/Apps/W1/SubscriptionBilling/App/Customer Contracts/Page Extensions/CustomerList.PageExt.al b/Apps/W1/SubscriptionBilling/App/Customer Contracts/Page Extensions/CustomerList.PageExt.al
index dc2d161586..5d68b801e0 100644
--- a/Apps/W1/SubscriptionBilling/App/Customer Contracts/Page Extensions/CustomerList.PageExt.al
+++ b/Apps/W1/SubscriptionBilling/App/Customer Contracts/Page Extensions/CustomerList.PageExt.al
@@ -26,6 +26,38 @@ pageextension 8052 "Customer List" extends "Customer List"
{
}
}
+ addlast("&Customer")
+ {
+ action(Contracts)
+ {
+ AccessByPermission = tabledata "Customer Contract" = R;
+ ApplicationArea = Basic, Suite;
+ Caption = 'Contracts';
+ Image = FileContract;
+ RunObject = page "Customer Contracts";
+ RunPageLink = "Sell-to Customer No." = field("No.");
+ ToolTip = 'View a list of ongoing customer contracts.';
+ }
+ action(ServiceObjects)
+ {
+ AccessByPermission = tabledata "Service Object" = R;
+ ApplicationArea = Basic, Suite;
+ Caption = 'Service Objects';
+ Image = ServiceItem;
+ RunObject = page "Service Object";
+ RunPageLink = "End-User Customer No." = field("No.");
+ ToolTip = 'View a list of service objects for the customer.';
+ }
+ }
+ addlast(Category_Category7)
+ {
+ actionref(Contracts_Promoted; Contracts)
+ {
+ }
+ actionref(ServiceObjects_Promoted; ServiceObjects)
+ {
+ }
+ }
addlast(reporting)
{
action(OverviewOfContractComponents)
diff --git a/Apps/W1/SubscriptionBilling/App/Usage Based Billing/Codeunits/GenericUsageDataImport.Codeunit.al b/Apps/W1/SubscriptionBilling/App/Usage Based Billing/Codeunits/GenericUsageDataImport.Codeunit.al
index e9b1b32fd9..e2f24c67dd 100644
--- a/Apps/W1/SubscriptionBilling/App/Usage Based Billing/Codeunits/GenericUsageDataImport.Codeunit.al
+++ b/Apps/W1/SubscriptionBilling/App/Usage Based Billing/Codeunits/GenericUsageDataImport.Codeunit.al
@@ -1,6 +1,7 @@
namespace Microsoft.SubscriptionBilling;
using System.IO;
+using Microsoft.Inventory.Item.Catalog;
codeunit 8025 "Generic Usage Data Import"
{
@@ -98,6 +99,7 @@ codeunit 8025 "Generic Usage Data Import"
ErrorCount += 1
else
UsageDataGenericImport."Processing Status" := Enum::"Processing Status"::Ok;
+ UpdateServiceObjectConnectionStatus(UsageDataImport, UsageDataGenericImport);
UsageDataGenericImport.Modify(false);
until UsageDataGenericImport.Next() = 0
else begin
@@ -131,9 +133,7 @@ codeunit 8025 "Generic Usage Data Import"
var
UsageDataSubscription: Record "Usage Data Subscription";
begin
- UsageDataSubscription.SetRange("Supplier No.", SupplierNo);
- UsageDataSubscription.SetRange("Supplier Reference", UsageDataGenericImport."Subscription ID");
- if UsageDataSubscription.IsEmpty() then begin
+ if not UsageDataSubscription.FindForSupplierReference(SupplierNo, UsageDataGenericImport."Subscription ID") then begin
UsageDataSubscription.Init();
UsageDataSubscription."Entry No." := 0;
UsageDataSubscription.Validate("Supplier No.", SupplierNo);
@@ -206,6 +206,35 @@ codeunit 8025 "Generic Usage Data Import"
end;
end;
+ local procedure UpdateServiceObjectConnectionStatus(var UsageDataImport: Record "Usage Data Import"; var UsageDataGenericImport: Record "Usage Data Generic Import")
+ var
+ UsageDataSubscription: Record "Usage Data Subscription";
+ UsageDataSupplier: Record "Usage Data Supplier";
+ UsageDataSupplierReference: Record "Usage Data Supplier Reference";
+ ItemReference: Record "Item Reference";
+ begin
+ UsageDataGenericImport."Service Object Availability" := UsageDataGenericImport."Service Object Availability"::"Not Available";
+
+ if UsageDataGenericImport."Service Object No." <> '' then begin
+ UsageDataGenericImport."Service Object Availability" := UsageDataGenericImport."Service Object Availability"::Connected;
+ exit;
+ end;
+
+ if not UsageDataSupplier.Get(UsageDataImport."Supplier No.") then
+ exit;
+
+ if not UsageDataSubscription.FindForSupplierReference(UsageDataImport."Supplier No.", UsageDataGenericImport."Subscription ID") then
+ exit;
+
+ if not UsageDataSupplierReference.FindSupplierReference(UsageDataImport."Supplier No.", UsageDataSubscription."Product ID", Enum::"Usage Data Reference Type"::Product) then
+ exit;
+
+ if not ItemReference.FindForVendorAndSupplierReference(UsageDataSupplier."Vendor No.", UsageDataSupplierReference."Entry No.") then
+ exit;
+
+ UsageDataGenericImport."Service Object Availability" := UsageDataGenericImport."Service Object Availability"::Available;
+ end;
+
local procedure SetErrorIfServiceCommitmentDoesNotExist(var UsageDataGenericImport: Record "Usage Data Generic Import"; ServiceCommitment: Record "Service Commitment")
begin
UsageDataGenericImport."Processing Status" := UsageDataGenericImport."Processing Status"::Error;
diff --git a/Apps/W1/SubscriptionBilling/App/Usage Based Billing/Codeunits/UsageBasedBillingMgmt.Codeunit.al b/Apps/W1/SubscriptionBilling/App/Usage Based Billing/Codeunits/UsageBasedBillingMgmt.Codeunit.al
index 1487dd1dbf..99c1726fbe 100644
--- a/Apps/W1/SubscriptionBilling/App/Usage Based Billing/Codeunits/UsageBasedBillingMgmt.Codeunit.al
+++ b/Apps/W1/SubscriptionBilling/App/Usage Based Billing/Codeunits/UsageBasedBillingMgmt.Codeunit.al
@@ -23,6 +23,7 @@ codeunit 8029 "Usage Based Billing Mgmt."
internal procedure ConnectSubscriptionsToServiceObjects(var UsageDataSubscription: Record "Usage Data Subscription")
var
+ UsageDataSubscription2: Record "Usage Data Subscription";
ServiceObject: Record "Service Object";
i: Integer;
ProgressBox: Dialog;
@@ -31,6 +32,7 @@ codeunit 8029 "Usage Based Billing Mgmt."
UsageDataSubscription.SetRange("Service Commitment Entry No.", 0);
UsageDataSubscription.SetFilter("Connect to SO Method", '<>%1', "Connect To SO Method"::None);
if UsageDataSubscription.FindSet(true) then begin
+ i := 0;
TotalCount := UsageDataSubscription.Count;
ProgressBox.Open(ProgressLbl);
ProgressBox.Update(1, UsageDataSubscription.TableCaption);
@@ -38,22 +40,24 @@ codeunit 8029 "Usage Based Billing Mgmt."
if i mod 10 = 0 then
ProgressBox.Update(2, Round(i / TotalCount * 10000, 1));
- TestUsageDataSubscription(UsageDataSubscription);
- if UsageDataSubscription."Processing Status" <> "Processing Status"::Error then begin
- AskToProceedIfServiceObjectIsAssignedToMultipleSubscriptions(UsageDataSubscription);
- ServiceObject.Get(UsageDataSubscription."Connect to Service Object No.");
- ErrorIfServiceObjectItemIsBlocked(ServiceObject, UsageDataSubscription);
+ UsageDataSubscription2 := UsageDataSubscription;
+ TestUsageDataSubscription(UsageDataSubscription2);
+ if UsageDataSubscription2."Processing Status" <> "Processing Status"::Error then begin
+ AskToProceedIfServiceObjectIsAssignedToMultipleSubscriptions(UsageDataSubscription2);
+ ServiceObject.Get(UsageDataSubscription2."Connect to Service Object No.");
+ ErrorIfServiceObjectItemIsBlocked(ServiceObject, UsageDataSubscription2);
end;
- if UsageDataSubscription."Processing Status" <> "Processing Status"::Error then
- case UsageDataSubscription."Connect to SO Method" of
+ if UsageDataSubscription2."Processing Status" <> "Processing Status"::Error then
+ case UsageDataSubscription2."Connect to SO Method" of
"Connect To SO Method"::"New Service Commitments":
- ConnectSubscriptionToServiceObjectWithNewServiceCommitments(UsageDataSubscription);
+ ConnectSubscriptionToServiceObjectWithNewServiceCommitments(UsageDataSubscription2);
"Connect To SO Method"::"Existing Service Commitments":
- ConnectSubscriptionToServiceObjectWithExistingServiceCommitments(UsageDataSubscription);
+ ConnectSubscriptionToServiceObjectWithExistingServiceCommitments(UsageDataSubscription2);
end;
i += 1;
- UsageDataSubscription.Modify(false);
+ UsageDataSubscription2.Modify(false);
+ UsageDataSubscription2.UpdateServiceObjectNoForUsageDataGenericImport();
until UsageDataSubscription.Next() = 0;
ProgressBox.Close();
end;
diff --git a/Apps/W1/SubscriptionBilling/App/Usage Based Billing/Enums/ServiceObjectAvailability.Enum.al b/Apps/W1/SubscriptionBilling/App/Usage Based Billing/Enums/ServiceObjectAvailability.Enum.al
new file mode 100644
index 0000000000..27345c6a04
--- /dev/null
+++ b/Apps/W1/SubscriptionBilling/App/Usage Based Billing/Enums/ServiceObjectAvailability.Enum.al
@@ -0,0 +1,23 @@
+namespace Microsoft.SubscriptionBilling;
+
+enum 8018 "Service Object Availability"
+{
+ Extensible = false;
+
+ value(0; None)
+ {
+ Caption = ' ', Locked = true;
+ }
+ value(1; Connected)
+ {
+ Caption = 'Connected';
+ }
+ value(2; Available)
+ {
+ Caption = 'Available';
+ }
+ value(3; "Not Available")
+ {
+ Caption = 'Not Available';
+ }
+}
diff --git a/Apps/W1/SubscriptionBilling/App/Usage Based Billing/Pages/UsageDataGenericImport.Page.al b/Apps/W1/SubscriptionBilling/App/Usage Based Billing/Pages/UsageDataGenericImport.Page.al
index 1ab6dda7f7..0ffe803ecf 100644
--- a/Apps/W1/SubscriptionBilling/App/Usage Based Billing/Pages/UsageDataGenericImport.Page.al
+++ b/Apps/W1/SubscriptionBilling/App/Usage Based Billing/Pages/UsageDataGenericImport.Page.al
@@ -29,6 +29,10 @@ page 8038 "Usage Data Generic Import"
Rec.ShowReason();
end;
}
+ field("Service Object"; Rec."Service Object Availability")
+ {
+ ToolTip = 'Specifies whether a Service Object is available to be connected with the subscription or if the connection has been established already.';
+ }
field("Service Object No."; Rec."Service Object No.")
{
ToolTip = 'Specifices to which Service Object the usage data refers.';
@@ -179,6 +183,14 @@ page 8038 "Usage Data Generic Import"
CurrPage.Update();
end;
}
+ action(ConnectSubscriptionToServiceObject)
+ {
+ Caption = 'Connect Subscription to Service Object';
+ ToolTip = 'Opens the page for connecting subscriptions to Service Objects, filtered to the currently selected subscription.';
+ Image = AddAction;
+ RunObject = page "Connect Subscription To SO";
+ RunPageLink = "Supplier Reference" = field("Subscription ID");
+ }
}
area(navigation)
{
@@ -210,6 +222,9 @@ page 8038 "Usage Data Generic Import"
actionref(ExtendContract_Promoted; ExtendContract)
{
}
+ actionref(ConnectSubscriptionToServiceObject_Promoted; ConnectSubscriptionToServiceObject)
+ {
+ }
actionref("Usage Data Customers_Promoted"; "Usage Data Customers")
{
}
diff --git a/Apps/W1/SubscriptionBilling/App/Usage Based Billing/TableExtensions/UsageBasedItemReference.TableExt.al b/Apps/W1/SubscriptionBilling/App/Usage Based Billing/TableExtensions/UsageBasedItemReference.TableExt.al
index fc325b2f51..020d2aa6ac 100644
--- a/Apps/W1/SubscriptionBilling/App/Usage Based Billing/TableExtensions/UsageBasedItemReference.TableExt.al
+++ b/Apps/W1/SubscriptionBilling/App/Usage Based Billing/TableExtensions/UsageBasedItemReference.TableExt.al
@@ -28,4 +28,11 @@ tableextension 8008 "Usage Based Item Reference" extends "Item Reference"
var
NotServiceCommitmentItemErr: Label 'Usage Data Supplier Ref. Entry No. can only be entered for Service Commitment Items (see "Service Commitment Option in the Item).';
+ internal procedure FindForVendorAndSupplierReference(VendorNo: Code[20]; SupplierReferenceEntryNo: Integer): Boolean
+ begin
+ Rec.SetRange("Reference Type", Enum::"Item Reference Type"::Vendor);
+ Rec.SetRange("Reference Type No.", VendorNo);
+ Rec.SetRange("Supplier Ref. Entry No.", SupplierReferenceEntryNo);
+ exit(Rec.FindFirst());
+ end;
}
diff --git a/Apps/W1/SubscriptionBilling/App/Usage Based Billing/Tables/UsageDataGenericImport.Table.al b/Apps/W1/SubscriptionBilling/App/Usage Based Billing/Tables/UsageDataGenericImport.Table.al
index 73128a552f..30458e0719 100644
--- a/Apps/W1/SubscriptionBilling/App/Usage Based Billing/Tables/UsageDataGenericImport.Table.al
+++ b/Apps/W1/SubscriptionBilling/App/Usage Based Billing/Tables/UsageDataGenericImport.Table.al
@@ -53,6 +53,7 @@ table 8018 "Usage Data Generic Import"
{
Caption = 'Service Object No.';
TableRelation = "Service Object";
+ Editable = false;
}
field(7; "Customer ID"; Text[80])
{
@@ -151,10 +152,8 @@ table 8018 "Usage Data Generic Import"
if "Subscription ID" = '' then
exit;
- if UsageDataImport.Get("Usage Data Import Entry No.") then begin
- UsageDataSubscription.SetRange("Supplier No.", UsageDataImport."Supplier No.");
- UsageDataSubscription.SetRange("Supplier Reference", "Subscription ID");
- if UsageDataSubscription.FindFirst() then begin
+ if UsageDataImport.Get("Usage Data Import Entry No.") then
+ if UsageDataSubscription.FindForSupplierReference(UsageDataImport."Supplier No.", "Subscription ID") then begin
if Rec."Subscription Name" = '' then
Rec."Subscription Name" := UsageDataSubscription."Customer Name";
if Rec."Product ID" = '' then
@@ -164,7 +163,6 @@ table 8018 "Usage Data Generic Import"
if (Rec.Quantity = 0) and (CurrFieldNo <> 0) then
Rec.Quantity := UsageDataSubscription.Quantity;
end;
- end;
end;
}
field(11; "Subscription Name"; Text[250])
@@ -253,7 +251,11 @@ table 8018 "Usage Data Generic Import"
AutoFormatType = 2;
Caption = 'Cost Amount';
}
-
+ field(30; "Service Object Availability"; Enum "Service Object Availability")
+ {
+ Caption = 'Service Object Availability';
+ Editable = false;
+ }
field(50; Text1; Text[80])
{
Caption = 'Text1';
diff --git a/Apps/W1/SubscriptionBilling/App/Usage Based Billing/Tables/UsageDataSubscription.Table.al b/Apps/W1/SubscriptionBilling/App/Usage Based Billing/Tables/UsageDataSubscription.Table.al
index 9e31f5fc71..d45a2ea8e7 100644
--- a/Apps/W1/SubscriptionBilling/App/Usage Based Billing/Tables/UsageDataSubscription.Table.al
+++ b/Apps/W1/SubscriptionBilling/App/Usage Based Billing/Tables/UsageDataSubscription.Table.al
@@ -298,4 +298,21 @@ table 8016 "Usage Data Subscription"
Rec.Validate("Service Commitment Entry No.", 0);
Rec.Modify(true);
end;
+
+ internal procedure FindForSupplierReference(SupplierNo: Code[20]; SupplierReference: Text[80]): Boolean
+ begin
+ Rec.SetRange("Supplier No.", SupplierNo);
+ Rec.SetRange("Supplier Reference", SupplierReference);
+ exit(Rec.FindFirst());
+ end;
+
+ internal procedure UpdateServiceObjectNoForUsageDataGenericImport()
+ var
+ UsageDataGenericImport: Record "Usage Data Generic Import";
+ begin
+ UsageDataGenericImport.SetFilter("Processing Status", '<>%1', "Processing Status"::Ok);
+ UsageDataGenericImport.SetRange("Subscription ID", Rec."Supplier Reference");
+ UsageDataGenericImport.ModifyAll("Service Object No.", Rec."Service Object No.");
+ UsageDataGenericImport.ModifyAll("Service Object Availability", UsageDataGenericImport."Service Object Availability"::Connected);
+ end;
}
diff --git a/Apps/W1/SubscriptionBilling/App/Vendor Contracts/Page Extensions/VendorCard.PageExt.al b/Apps/W1/SubscriptionBilling/App/Vendor Contracts/Page Extensions/VendorCard.PageExt.al
index 87fada9dbc..f9ccb1b7c5 100644
--- a/Apps/W1/SubscriptionBilling/App/Vendor Contracts/Page Extensions/VendorCard.PageExt.al
+++ b/Apps/W1/SubscriptionBilling/App/Vendor Contracts/Page Extensions/VendorCard.PageExt.al
@@ -26,5 +26,24 @@ pageextension 8056 "Vendor Card" extends "Vendor Card"
{
}
}
+ addlast("Ven&dor")
+ {
+ action(Contracts)
+ {
+ AccessByPermission = tabledata "Vendor Contract" = R;
+ ApplicationArea = Basic, Suite;
+ Caption = 'Contracts';
+ Image = FileContract;
+ RunObject = page "Vendor Contracts";
+ RunPageLink = "Buy-from Vendor No." = field("No.");
+ ToolTip = 'View a list of ongoing vendor contracts.';
+ }
+ }
+ addlast(Category_Category9)
+ {
+ actionref(Contracts_Promoted; Contracts)
+ {
+ }
+ }
}
}
\ No newline at end of file
diff --git a/Apps/W1/SubscriptionBilling/App/Vendor Contracts/Page Extensions/VendorList.PageExt.al b/Apps/W1/SubscriptionBilling/App/Vendor Contracts/Page Extensions/VendorList.PageExt.al
index 25fb61c90b..07095289dd 100644
--- a/Apps/W1/SubscriptionBilling/App/Vendor Contracts/Page Extensions/VendorList.PageExt.al
+++ b/Apps/W1/SubscriptionBilling/App/Vendor Contracts/Page Extensions/VendorList.PageExt.al
@@ -26,5 +26,24 @@ pageextension 8057 "Vendor List" extends "Vendor List"
{
}
}
+ addlast("Ven&dor")
+ {
+ action(Contracts)
+ {
+ AccessByPermission = tabledata "Vendor Contract" = R;
+ ApplicationArea = Basic, Suite;
+ Caption = 'Contracts';
+ Image = FileContract;
+ RunObject = page "Vendor Contracts";
+ RunPageLink = "Buy-from Vendor No." = field("No.");
+ ToolTip = 'View a list of ongoing vendor contracts.';
+ }
+ }
+ addlast(Category_Category5)
+ {
+ actionref(Contracts_Promoted; Contracts)
+ {
+ }
+ }
}
}
\ No newline at end of file
diff --git a/Apps/W1/SubscriptionBilling/App/app.json b/Apps/W1/SubscriptionBilling/App/app.json
index 58fd96c9ba..761454e9da 100644
--- a/Apps/W1/SubscriptionBilling/App/app.json
+++ b/Apps/W1/SubscriptionBilling/App/app.json
@@ -18,86 +18,6 @@
"id": "2ac317ef-11a5-4753-92f4-31c84b520c7b",
"name": "Subscription & Recurring Billing Test",
"publisher": "Microsoft"
- },
- {
- "id": "b6bdb244-0e09-4313-b975-24e6343d00df",
- "name": "Subscription & Recurring Billing Plus",
- "publisher": "Singhammer IT Consulting AG"
- },
- {
- "id": "d4ccd4d9-ea68-4efe-802a-423348ec8d5a",
- "name": "DYCE Essentials",
- "publisher": "Singhammer IT Consulting AG"
- },
- {
- "id": "c12f11e8-b5a0-4450-a3f5-110b6cd46d1e",
- "name": "DYCE Subscription & Recurring Billing",
- "publisher": "Singhammer IT Consulting AG"
- },
- {
- "id": "882b7b1e-2a19-4e1a-988d-b8a7cd3254fd",
- "name": "DYCE Usage Based Billing",
- "publisher": "Singhammer IT Consulting AG"
- },
- {
- "id": "f8e0afc1-75ca-4cc4-ae67-6a567d2668ae",
- "name": "DYCE Easy Bundle Seller",
- "publisher": "Singhammer IT Consulting AG"
- },
- {
- "id": "7afd8f0f-c178-4272-bb3c-c260c7a4cb71",
- "name": "DYCE Managed Service Providers",
- "publisher": "Singhammer IT Consulting AG"
- },
- {
- "id": "3860f895-5025-4856-b272-ecb4918bfb22",
- "name": "DYCE Recurring Prepaid Services",
- "publisher": "Singhammer IT Consulting AG"
- },
- {
- "id": "6be55868-7c39-4363-8df2-b709d0805e73",
- "name": "DYCE Happy Texts",
- "publisher": "Singhammer IT Consulting AG"
- },
- {
- "id": "018ff6a2-4cf8-4945-b60f-2b40878ef5c4",
- "name": "Subscription & Recurring Billing Plus Test",
- "publisher": "Singhammer IT Consulting AG"
- },
- {
- "id": "41bf6cc7-7891-4a8c-827c-fe23266c5a98",
- "name": "DYCE Essentials Test",
- "publisher": "Singhammer IT Consulting AG"
- },
- {
- "id": "eb59fb9f-b1b0-47ba-963d-80f38ad130b4",
- "name": "DYCE Subscription & Recurring Billing Test",
- "publisher": "Singhammer IT Consulting AG"
- },
- {
- "id": "d8d8a26c-5f2b-41a0-9e06-2b351aee1767",
- "name": "DYCE Usage Based Billing Test",
- "publisher": "Singhammer IT Consulting AG"
- },
- {
- "id": "ab5fc040-94a7-4428-9280-66342c6ab703",
- "name": "DYCE Easy Bundle Seller Test",
- "publisher": "Singhammer IT Consulting AG"
- },
- {
- "id": "e953ddb9-6c2f-46ce-9c93-e4004244ca28",
- "name": "DYCE Managed Service Providers Test",
- "publisher": "Singhammer IT Consulting AG"
- },
- {
- "id": "945dc7a5-c8e5-4206-b82a-16da146c026e",
- "name": "DYCE Recurring Prepaid Services Test",
- "publisher": "Singhammer IT Consulting AG"
- },
- {
- "id": "6f4cbb6d-236a-4715-a95c-f04e167a85e6",
- "name": "DYCE Happy Texts Test",
- "publisher": "Singhammer IT Consulting AG"
}
],
"platform": "26.0.0.0",
diff --git a/Apps/W1/SubscriptionBilling/Test/UBB/LinkSubscriptionToSOTest.Codeunit.al b/Apps/W1/SubscriptionBilling/Test/UBB/LinkSubscriptionToSOTest.Codeunit.al
index a38a5cd5e2..314ee74c6c 100644
--- a/Apps/W1/SubscriptionBilling/Test/UBB/LinkSubscriptionToSOTest.Codeunit.al
+++ b/Apps/W1/SubscriptionBilling/Test/UBB/LinkSubscriptionToSOTest.Codeunit.al
@@ -26,6 +26,7 @@ codeunit 148158 "Link Subscription To SO Test"
ValidateUsageDataSubscriptionConnectToServiceObject(Enum::"Connect To SO Method"::"Existing Service Commitments");
FilterUsageDataSubscriptionOnSupplier(UsageDataSubscription, UsageDataImport."Supplier No.");
UsageBasedBillingMgmt.ConnectSubscriptionsToServiceObjects(UsageDataSubscription);
+ FindUsageDataGenericImportUpdated();
FilterServiceCommOnServiceObjectAndPartner(ServiceObject."No.", "Service Partner"::Customer);
ServiceCommitment.SetRange("Supplier Reference Entry No.", 0);
@@ -63,6 +64,7 @@ codeunit 148158 "Link Subscription To SO Test"
ValidateUsageDataSubscriptionConnectToServiceObject(Enum::"Connect To SO Method"::"New Service Commitments");
UsageBasedBillingMgmt.ConnectSubscriptionToServiceObjectWithNewServiceCommitments(UsageDataSubscription);
+ FindUsageDataGenericImportUpdated();
Assert.AreEqual(PreviousNoOfContractLines, GetNumberOfCustomerContractLines(true), 'Contract Lines were not closed properly.');
Assert.AreEqual(PreviousNoOfStandardContractLines, GetNumberOfCustomerContractLines(false), 'Contract Lines were not extended properly.');
@@ -202,6 +204,8 @@ codeunit 148158 "Link Subscription To SO Test"
end;
procedure SetupUsageDataForProcessingToGenericImport()
+ var
+ UsageDataGenericImport: Record "Usage Data Generic Import";
begin
UsageBasedBTestLibrary.ResetUsageBasedRecords();
UsageBasedBTestLibrary.CreateUsageDataSupplier(UsageDataSupplier, Enum::"Usage Data Supplier Type"::Generic, true, Enum::"Vendor Invoice Per"::Import);
@@ -301,6 +305,16 @@ codeunit 148158 "Link Subscription To SO Test"
SourceUsageDataSubscription.SetRange("Supplier No.", SupplierNo);
end;
+ local procedure FindUsageDataGenericImportUpdated()
+ var
+ UsageDataGenericImport: Record "Usage Data Generic Import";
+ begin
+ UsageDataGenericImport.SetRange("Subscription ID", UsageDataSubscription."Supplier Reference");
+ UsageDataGenericImport.SetRange("Service Object No.", ServiceCommitment."Service Object No.");
+ UsageDataGenericImport.SetRange("Service Object Availability", UsageDataGenericImport."Service Object Availability"::Connected);
+ UsageDataGenericImport.FindFirst();
+ end;
+
local procedure TestUsageDataSubscriptionProcessingStatus(SupplierNo: Code[20]; NewProcessingStatus: Enum "Processing Status")
begin
FilterUsageDataSubscriptionOnSupplier(UsageDataSubscription, SupplierNo);
@@ -394,7 +408,6 @@ codeunit 148158 "Link Subscription To SO Test"
GenericImportSettings: Record "Generic Import Settings";
UsageDataImport: Record "Usage Data Import";
UsageDataBlob: Record "Usage Data Blob";
- UsageDataGenericImport: Record "Usage Data Generic Import";
ServiceObject: Record "Service Object";
ServiceCommitment: Record "Service Commitment";
Item: Record Item;
diff --git a/Apps/W1/SubscriptionBilling/Test/UBB/UsageBasedBillingTest.Codeunit.al b/Apps/W1/SubscriptionBilling/Test/UBB/UsageBasedBillingTest.Codeunit.al
index c20922e345..21dd2611b4 100644
--- a/Apps/W1/SubscriptionBilling/Test/UBB/UsageBasedBillingTest.Codeunit.al
+++ b/Apps/W1/SubscriptionBilling/Test/UBB/UsageBasedBillingTest.Codeunit.al
@@ -12,6 +12,7 @@ using Microsoft.Purchases.Vendor;
using Microsoft.Purchases.Document;
using Microsoft.Purchases.History;
using Microsoft.Finance.Currency;
+using Microsoft.Inventory.Item.Catalog;
codeunit 148153 "Usage Based Billing Test"
{
@@ -80,6 +81,58 @@ codeunit 148153 "Usage Based Billing Test"
CheckIfProductSupplierReferencesAreIsCreated();
end;
+ [Test]
+ [HandlerFunctions('ExchangeRateSelectionModalPageHandler,MessageHandler')]
+ procedure UpdatingServiceObjectAvailabilityDuringProcessing()
+ var
+ ItemReference: Record "Item Reference";
+ begin
+ // [SCENARIO]: The Service Object Availability should be properly updated after processing imported lines
+ // When there is no available Service Object to be connected to the imported line status should be "Not Available"
+ // When there is available Service Object to be connected to the imported line status should be "Available"
+ // When a Service Object is connected to the imported line status should be "Connected"
+
+ // [GIVEN]: Setup Generic Connector and import lines from a file
+ Initialize();
+ SetupUsageDataForProcessingToGenericImport();
+ ContractTestLibrary.CreateVendor(Vendor);
+ UsageDataSupplier.Validate("Vendor No.", Vendor."No.");
+ UsageDataSupplier.Modify(false);
+ SetupDataExchangeDefinition();
+ UsageBasedBTestLibrary.ConnectDataExchDefinitionToUsageDataGenericSettings(DataExchDef.Code, GenericImportSettings);
+ SetupServiceObjectAndContracts(WorkDate());
+ ProcessUsageDataImport(Enum::"Processing Step"::"Create Imported Lines");
+
+ // [WHEN]: process imported lines
+ ProcessUsageDataImport(Enum::"Processing Step"::"Process Imported Lines");
+
+ // [THEN]: Test if Service Object Availability is set to "Not Available"
+ ValidateUsageDataGenericImportAvailability(UsageDataImport."Entry No.", "Service Object Availability"::"Not Available", '');
+
+ // [WHEN]: insert an item reference to a usage data supplier reference
+ UsageDataSubscription.FindForSupplierReference(UsageDataImport."Supplier No.", UsageDataGenericImport."Subscription ID");
+ UsageDataSupplierReference.FindSupplierReference(UsageDataImport."Supplier No.", UsageDataSubscription."Product ID", Enum::"Usage Data Reference Type"::Product);
+ LibraryItemReference.CreateItemReference(ItemReference, Item."No.", "Item Reference Type"::Vendor, UsageDataSupplier."Vendor No.");
+ ItemReference."Supplier Ref. Entry No." := UsageDataSupplierReference."Entry No.";
+ ItemReference.Modify(false);
+ ProcessUsageDataImport(Enum::"Processing Step"::"Process Imported Lines");
+
+ // [THEN]: Test if Service Object Availability is set to "Available"
+ ValidateUsageDataGenericImportAvailability(UsageDataImport."Entry No.", "Service Object Availability"::Available, '');
+
+ // [WHEN]: insert an subscription reference is set for Service Commitment
+ UsageDataSupplierReference.FindSupplierReference(UsageDataImport."Supplier No.", UsageDataGenericImport."Subscription ID", Enum::"Usage Data Reference Type"::Subscription);
+ ServiceCommitment.SetRange("Service Object No.", ServiceObject."No.");
+ ServiceCommitment.SetRange(Partner, Enum::"Service Partner"::Vendor);
+ ServiceCommitment.FindFirst();
+ ServiceCommitment."Supplier Reference Entry No." := UsageDataSupplierReference."Entry No.";
+ ServiceCommitment.Modify(false);
+ ProcessUsageDataImport(Enum::"Processing Step"::"Process Imported Lines");
+
+ // [THEN]: Test if Service Object Availability is set to "Connected"
+ ValidateUsageDataGenericImportAvailability(UsageDataImport."Entry No.", "Service Object Availability"::Connected, ServiceObject."No.");
+ end;
+
[Test]
[HandlerFunctions('ExchangeRateSelectionModalPageHandler,MessageHandler')]
procedure TestCreateUsageDataBilling()
@@ -1232,9 +1285,7 @@ codeunit 148153 "Usage Based Billing Test"
local procedure CheckIfUsageDataSubscriptionIsCreated()
begin
- UsageDataSubscription.SetRange("Supplier No.", UsageDataImport."Supplier No.");
- UsageDataSubscription.SetRange("Supplier Reference", UsageDataGenericImport."Subscription ID");
- UsageDataSubscription.FindFirst();
+ UsageDataSubscription.FindForSupplierReference(UsageDataImport."Supplier No.", UsageDataGenericImport."Subscription ID");
UsageDataSubscription.TestField("Customer ID", UsageDataGenericImport."Customer ID");
UsageDataSubscription.TestField("Product ID", UsageDataGenericImport."Product ID");
UsageDataSubscription.TestField("Product Name", UsageDataGenericImport."Product Name");
@@ -1557,6 +1608,14 @@ codeunit 148153 "Usage Based Billing Test"
until ServiceCommitment.Next() = 0;
end;
+ local procedure ValidateUsageDataGenericImportAvailability(UsageDataImportEntryNo: Integer; ExpectedServiceObjectAvailability: Enum "Service Object Availability"; ExpectedServiceObjectNo: Code[20])
+ begin
+ UsageDataGenericImport.SetRange("Usage Data Import Entry No.", UsageDataImportEntryNo);
+ UsageDataGenericImport.FindFirst();
+ Assert.AreEqual(ExpectedServiceObjectAvailability, UsageDataGenericImport."Service Object Availability", 'Service Object Availability is not set to expected value in Usage Data Generic Import.');
+ Assert.AreEqual(ExpectedServiceObjectNo, UsageDataGenericImport."Service Object No.", 'Service Object No. is not set to expected value in Usage Data Generic Import.');
+ end;
+
[ModalPageHandler]
procedure ExchangeRateSelectionModalPageHandler(var ExchangeRateSelectionPage: TestPage "Exchange Rate Selection")
begin
@@ -1627,6 +1686,7 @@ codeunit 148153 "Usage Based Billing Test"
UsageBasedBTestLibrary: Codeunit "Usage Based B. Test Library";
LibraryUtility: Codeunit "Library - Utility";
LibraryERMCountryData: Codeunit "Library - ERM Country Data";
+ LibraryItemReference: Codeunit "Library - Item Reference";
CorrectPostedPurchaseInvoice: Codeunit "Correct Posted Purch. Invoice";
CorrectPostedSalesInvoice: Codeunit "Correct Posted Sales Invoice";
AssertThat: Codeunit Assert;
diff --git a/Apps/W1/SubscriptionBilling/Test/UBB/UsageBasedExtendContrTest.Codeunit.al b/Apps/W1/SubscriptionBilling/Test/UBB/UsageBasedExtendContrTest.Codeunit.al
index 017312f3cc..0663db0aaf 100644
--- a/Apps/W1/SubscriptionBilling/Test/UBB/UsageBasedExtendContrTest.Codeunit.al
+++ b/Apps/W1/SubscriptionBilling/Test/UBB/UsageBasedExtendContrTest.Codeunit.al
@@ -29,6 +29,7 @@ codeunit 148159 "Usage Based Extend Contr. Test"
repeat
TestIsServiceCommitmentUpdated();
TestIsUsageDataSubscriptionUpdated();
+ FindUsageDataGenericImportUpdated();
until UsageDataSupplierReference.Next() = 0;
end;
@@ -54,6 +55,8 @@ codeunit 148159 "Usage Based Extend Contr. Test"
end;
procedure SetupUsageDataForProcessingToGenericImport()
+ var
+ UsageDataGenericImport: Record "Usage Data Generic Import";
begin
UsageBasedBTestLibrary.ResetUsageBasedRecords();
UsageBasedBTestLibrary.CreateUsageDataSupplier(UsageDataSupplier, Enum::"Usage Data Supplier Type"::Generic, true, Enum::"Vendor Invoice Per"::Import);
@@ -118,6 +121,16 @@ codeunit 148159 "Usage Based Extend Contr. Test"
UsageDataSubscription.FindFirst();
end;
+ local procedure FindUsageDataGenericImportUpdated()
+ var
+ UsageDataGenericImport: Record "Usage Data Generic Import";
+ begin
+ UsageDataGenericImport.SetRange("Subscription ID", UsageDataSupplierReference."Supplier Reference");
+ UsageDataGenericImport.SetRange("Service Object No.", ServiceCommitment."Service Object No.");
+ UsageDataGenericImport.SetRange("Service Object Availability", UsageDataGenericImport."Service Object Availability"::Connected);
+ UsageDataGenericImport.FindFirst();
+ end;
+
local procedure CreateMultipleUsageDataBlobFiles()
begin
for i := 1 to 5 do begin
@@ -335,7 +348,6 @@ codeunit 148159 "Usage Based Extend Contr. Test"
GenericImportSettings: Record "Generic Import Settings";
UsageDataImport: Record "Usage Data Import";
UsageDataBlob: Record "Usage Data Blob";
- UsageDataGenericImport: Record "Usage Data Generic Import";
ServiceObject: Record "Service Object";
ServiceCommitment: Record "Service Commitment";
Item: Record Item;
diff --git a/Apps/W1/SubscriptionBilling/Test/app.json b/Apps/W1/SubscriptionBilling/Test/app.json
index 80ca1c2a94..e71f323707 100644
--- a/Apps/W1/SubscriptionBilling/Test/app.json
+++ b/Apps/W1/SubscriptionBilling/Test/app.json
@@ -31,48 +31,6 @@
"version": "26.0.0.0"
}
],
- "internalsVisibleTo": [
- {
- "id": "018ff6a2-4cf8-4945-b60f-2b40878ef5c4",
- "name": "Subscription & Recurring Billing Plus Test",
- "publisher": "Singhammer IT Consulting AG"
- },
- {
- "id": "41bf6cc7-7891-4a8c-827c-fe23266c5a98",
- "name": "DYCE Essentials Test",
- "publisher": "Singhammer IT Consulting AG"
- },
- {
- "id": "eb59fb9f-b1b0-47ba-963d-80f38ad130b4",
- "name": "DYCE Subscription & Recurring Billing Test",
- "publisher": "Singhammer IT Consulting AG"
- },
- {
- "id": "d8d8a26c-5f2b-41a0-9e06-2b351aee1767",
- "name": "DYCE Usage Based Billing Test",
- "publisher": "Singhammer IT Consulting AG"
- },
- {
- "id": "ab5fc040-94a7-4428-9280-66342c6ab703",
- "name": "DYCE Easy Bundle Seller Test",
- "publisher": "Singhammer IT Consulting AG"
- },
- {
- "id": "e953ddb9-6c2f-46ce-9c93-e4004244ca28",
- "name": "DYCE Managed Service Providers Test",
- "publisher": "Singhammer IT Consulting AG"
- },
- {
- "id": "945dc7a5-c8e5-4206-b82a-16da146c026e",
- "name": "DYCE Recurring Prepaid Services Test",
- "publisher": "Singhammer IT Consulting AG"
- },
- {
- "id": "6f4cbb6d-236a-4715-a95c-f04e167a85e6",
- "name": "DYCE Happy Texts Test",
- "publisher": "Singhammer IT Consulting AG"
- }
- ],
"screenshots": [],
"platform": "26.0.0.0",
"application": "26.0.0.0",
diff --git a/Apps/W1/Sustainability/app/src/Posting/SustPreviewPostingHandler.Codeunit.al b/Apps/W1/Sustainability/app/src/Posting/SustPreviewPostingHandler.Codeunit.al
index ae20c154d7..5572baf6b1 100644
--- a/Apps/W1/Sustainability/app/src/Posting/SustPreviewPostingHandler.Codeunit.al
+++ b/Apps/W1/Sustainability/app/src/Posting/SustPreviewPostingHandler.Codeunit.al
@@ -22,4 +22,14 @@ codeunit 6228 "Sust. Preview Posting Handler"
begin
SustPreviewPostInstance.InsertSustValueEntry(Rec, RunTrigger);
end;
+
+ procedure TryBindPostingPreviewHandler(): Boolean
+ begin
+ exit(BindSubscription(this));
+ end;
+
+ procedure TryUnbindPostingPreviewHandler(): Boolean
+ begin
+ exit(UnbindSubscription(this));
+ end;
}
\ No newline at end of file
diff --git a/Apps/W1/Sustainability/app/src/Purchase/SustPurchaseSubscriber.Codeunit.al b/Apps/W1/Sustainability/app/src/Purchase/SustPurchaseSubscriber.Codeunit.al
index 40ea4cec60..a1986e3a1e 100644
--- a/Apps/W1/Sustainability/app/src/Purchase/SustPurchaseSubscriber.Codeunit.al
+++ b/Apps/W1/Sustainability/app/src/Purchase/SustPurchaseSubscriber.Codeunit.al
@@ -289,14 +289,14 @@ codeunit 6225 "Sust. Purchase Subscriber"
SustPreviewPostInstance: Codeunit "Sust. Preview Post Instance";
begin
SustPreviewPostInstance.Initialize();
- exit(BindSubscription(SustPreviewPostingHandler));
+ exit(SustPreviewPostingHandler.TryBindPostingPreviewHandler());
end;
local procedure TryUnbindPostingPreviewHandler(): Boolean
var
SustPreviewPostingHandler: Codeunit "Sust. Preview Posting Handler";
begin
- exit(UnbindSubscription(SustPreviewPostingHandler));
+ exit(SustPreviewPostingHandler.TryUnbindPostingPreviewHandler());
end;
var
diff --git a/Apps/W1/TransactionStorage/app/src/TransactStorageExportData.Codeunit.al b/Apps/W1/TransactionStorage/app/src/TransactStorageExportData.Codeunit.al
index 15aa79dbec..823dcaeb88 100644
--- a/Apps/W1/TransactionStorage/app/src/TransactStorageExportData.Codeunit.al
+++ b/Apps/W1/TransactionStorage/app/src/TransactStorageExportData.Codeunit.al
@@ -83,6 +83,7 @@ codeunit 6202 "Transact. Storage Export Data"
DocumentNoFieldNameTxt: Label 'Document No.', Locked = true;
NoPermissionsForTableErr: Label 'User does not have permissions to read the table %1', Comment = '%1 = table name', Locked = true;
ExportRecCountExceedsLimitErr: Label 'The number of records to export exceeds the limit. See Custom Dimensions.', Locked = true;
+ FilterRecToDateTimeErr: Label 'FilterRecTo datetime is 0DT', Locked = true;
procedure ExportData(TaskStartingDateTime: DateTime)
var
@@ -242,6 +243,8 @@ codeunit 6202 "Transact. Storage Export Data"
end;
RecRef.Close();
end;
+ if MinFilterRecTo = 0DT then
+ MinFilterRecTo := TaskStartingDateTime;
exit(MinFilterRecTo);
end;
@@ -280,6 +283,11 @@ codeunit 6202 "Transact. Storage Export Data"
SystemModifiedAtFieldRef.SetRange(FilterRecFrom, FilterRecTo);
FilterRecToDate := FilterRecFromDate + (FilterRecToDate - FilterRecFromDate) div 2;
until (RecRef.CountApprox() <= MaxRecordCount) or (FilterRecToDate - FilterRecFromDate < 1);
+ if FilterRecTo = 0DT then begin
+ CustomDimensions := GetCustomDimForZeroFilterRecToLog(RecRef.Number, FilterRecFrom, TaskStartingDateTime);
+ CustomDimensions.Add('FilterRecToDate', Format(FilterRecToDate));
+ TransactStorageExport.LogWarning('0000OHJ', FilterRecToDateTimeErr, CustomDimensions);
+ end;
if RecRef.CountApprox() <= MaxRecordCount then
exit;
@@ -298,6 +306,11 @@ codeunit 6202 "Transact. Storage Export Data"
SystemModifiedAtFieldRef.SetRange(FilterRecFrom, FilterRecTo);
end;
end;
+ if FilterRecTo = 0DT then begin
+ CustomDimensions := GetCustomDimForZeroFilterRecToLog(RecRef.Number, FilterRecFrom, TaskStartingDateTime);
+ CustomDimensions.Add('PeriodDelta', Format(PeriodDelta));
+ TransactStorageExport.LogWarning('0000OHK', FilterRecToDateTimeErr, CustomDimensions);
+ end;
// try to export all entries for the last document
if GetDocumentNoField(RecRef, DocumentNoFieldRef) then begin
@@ -310,6 +323,10 @@ codeunit 6202 "Transact. Storage Export Data"
RecRef.Reset();
end;
end;
+ if FilterRecTo = 0DT then begin
+ CustomDimensions := GetCustomDimForZeroFilterRecToLog(RecRef.Number, FilterRecFrom, TaskStartingDateTime);
+ TransactStorageExport.LogWarning('0000OHL', FilterRecToDateTimeErr, CustomDimensions);
+ end;
// log warning if after all the limitations the number of records to export still exceeds the limit
SystemModifiedAtFieldRef.SetRange(FilterRecFrom, FilterRecTo);
@@ -324,6 +341,22 @@ codeunit 6202 "Transact. Storage Export Data"
end;
end;
+ local procedure GetCustomDimForZeroFilterRecToLog(TableID: Integer; FilterRecFrom: DateTime; TaskStartingDateTime: DateTime) CustomDimensions: Dictionary of [Text, Text]
+ var
+ RecRef: RecordRef;
+ SystemModifiedAtFieldRef: FieldRef;
+ begin
+ RecRef.Open(TableID);
+ SystemModifiedAtFieldRef := RecRef.Field(RecRef.SystemModifiedAtNo());
+ SystemModifiedAtFieldRef.SetRange(FilterRecFrom, TaskStartingDateTime);
+ CustomDimensions.Add('TableName', RecRef.Name);
+ CustomDimensions.Add('RecordCountApprox', Format(RecRef.CountApprox()));
+ CustomDimensions.Add('MaxRecordCount', Format(GetMaxRecordCount()));
+ CustomDimensions.Add('FilterRecFrom', Format(FilterRecFrom));
+ CustomDimensions.Add('TaskStartingDateTime', Format(TaskStartingDateTime));
+ RecRef.Close();
+ end;
+
local procedure GetDocumentNoField(RecRef: RecordRef; var DocumentNoFieldRef: FieldRef): Boolean
var
DataTypeManagement: Codeunit "Data Type Management";
diff --git a/Build/Packages.json b/Build/Packages.json
index 5ba44f2094..616655b645 100644
--- a/Build/Packages.json
+++ b/Build/Packages.json
@@ -1,11 +1,11 @@
{
- "Microsoft.Dynamics.BusinessCentral.Translations": {
- "Version": "25.0.20240311.6",
- "Source": "NuGet.org"
- },
- "AppBaselines-BCArtifacts": {
- "Version": "25.2.27075.0",
- "Source": "BCArtifacts",
- "_comment": "Used to fetch app baselines from BC artifacts"
- }
+ "Microsoft.Dynamics.BusinessCentral.Translations": {
+ "Version": "25.0.20240311.6",
+ "Source": "NuGet.org"
+ },
+ "AppBaselines-BCArtifacts": {
+ "Version": "25.3.28375",
+ "Source": "BCArtifacts",
+ "_comment": "Used to fetch app baselines from BC artifacts"
+ }
}
diff --git a/Build/Scripts/NewBcContainer.ps1 b/Build/Scripts/NewBcContainer.ps1
index 1fc2c5ee35..d55cbdca67 100644
--- a/Build/Scripts/NewBcContainer.ps1
+++ b/Build/Scripts/NewBcContainer.ps1
@@ -10,9 +10,10 @@ if ("$env:GITHUB_RUN_ID" -eq "") {
$parameters.shortcuts = "none"
}
+Write-Host "Creating container"
New-BcContainer @parameters
-$installedApps = Get-BcContainerAppInfo -containerName $containerName -tenantSpecificProperties -sort DependenciesLast
+$installedApps = Get-BcContainerAppInfo -containerName $parameters.ContainerName -tenantSpecificProperties -sort DependenciesLast
$installedApps | ForEach-Object {
Write-Host "Removing $($_.Name)"
if ($_.Name -notin @("System Application", "Business Foundation", "Base Application", "Application", "Test Runner", "AI Test Toolkit")) {
diff --git a/Build/projects/1st Party Apps (W1)/.AL-Go/NewBcContainer.ps1 b/Build/projects/1st Party Apps (W1)/.AL-Go/NewBcContainer.ps1
index 0515756e27..8497a3deb8 100644
--- a/Build/projects/1st Party Apps (W1)/.AL-Go/NewBcContainer.ps1
+++ b/Build/projects/1st Party Apps (W1)/.AL-Go/NewBcContainer.ps1
@@ -1,8 +1,5 @@
Param(
[Hashtable]$parameters
)
-
-if ("$env:GITHUB_RUN_ID" -eq "") {
- $script = Join-Path $PSScriptRoot "../../../scripts/NewBcContainer.ps1" -Resolve
- . $script -parameters $parameters
-}
\ No newline at end of file
+$script = Join-Path $PSScriptRoot "../../../scripts/NewBcContainer.ps1" -Resolve
+. $script -parameters $parameters
diff --git a/Build/projects/1st Party Apps (W1)/.AL-Go/settings.json b/Build/projects/1st Party Apps (W1)/.AL-Go/settings.json
index 5003063be8..2f27eef555 100644
--- a/Build/projects/1st Party Apps (W1)/.AL-Go/settings.json
+++ b/Build/projects/1st Party Apps (W1)/.AL-Go/settings.json
@@ -10,6 +10,6 @@
"..\\..\\..\\Apps\\W1\\SyncBase"
],
"doNotRunTests": true,
- "useCompilerFolder": true,
- "doNotPublishApps": true
+ "useCompilerFolder": false,
+ "doNotPublishApps": false
}
diff --git a/Build/rulesets/ruleset.json b/Build/rulesets/ruleset.json
index d708f74a8d..e339787964 100644
--- a/Build/rulesets/ruleset.json
+++ b/Build/rulesets/ruleset.json
@@ -114,6 +114,11 @@
"action": "None",
"justification": "Entitlements cannot be defined in an extension."
},
+ {
+ "id": "PTE0024",
+ "action": "None",
+ "justification": "We allow moved symbols for Microsoft apps because we run PTECop on the entire codebase which includes global apps."
+ },
{
"id": "AW0006",
"action": "None",