diff --git a/src/Layers/W1/BaseApp/Finance/FinancialReports/FinReportExportNameHandler.Codeunit.al b/src/Layers/W1/BaseApp/Finance/FinancialReports/FinReportExportNameHandler.Codeunit.al new file mode 100644 index 00000000000..9f57d972685 --- /dev/null +++ b/src/Layers/W1/BaseApp/Finance/FinancialReports/FinReportExportNameHandler.Codeunit.al @@ -0,0 +1,33 @@ +// ------------------------------------------------------------------------------------------------ +// 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.FinancialReports; +using Microsoft.Foundation.Reporting; +using System.IO; + +codeunit 8362 FinReportExportNameHandler +{ + Access = Internal; + EventSubscriberInstance = Manual; + + var + OutputFilename: Text; + + procedure Init(NewOutputFilename: Text) + begin + BindSubscription(this); + OutputFilename := NewOutputFilename; + end; + + [EventSubscriber(ObjectType::Codeunit, Codeunit::ReportManagement, OnGetFilename, '', false, false)] + local procedure ReportManagement_OnGetFilename(ReportID: Integer; var Filename: Text; var Success: Boolean) + var + FileMgt: Codeunit "File Management"; + begin + if ReportID = Report::"Account Schedule" then begin + Filename := FileMgt.CreateFileNameWithExtension(OutputFilename, FileMgt.GetExtension(Filename)); + Success := true; + end; + end; +} \ No newline at end of file diff --git a/src/Layers/W1/BaseApp/Finance/FinancialReports/FinancialReportExportJob.Codeunit.al b/src/Layers/W1/BaseApp/Finance/FinancialReports/FinancialReportExportJob.Codeunit.al index 76b2288a621..1431ebd7c72 100644 --- a/src/Layers/W1/BaseApp/Finance/FinancialReports/FinancialReportExportJob.Codeunit.al +++ b/src/Layers/W1/BaseApp/Finance/FinancialReports/FinancialReportExportJob.Codeunit.al @@ -257,6 +257,7 @@ codeunit 8361 "Financial Report Export Job" FinReportPackageReport: Record "Fin. Report Package Report"; FinRepPackageExportLog: Record "Fin. Rep. Package Export Log"; AccountSchedule: Report "Account Schedule"; + FinReportExportNameHandler: Codeunit FinReportExportNameHandler; Email: Codeunit Email; EmailMessage: Codeunit "Email Message"; TempBlob: Codeunit "Temp Blob"; @@ -309,8 +310,10 @@ codeunit 8361 "Financial Report Export Job" AccountSchedule.SetRunForExport(); TempBlob.CreateOutStream(OutStr); OnBeforeSaveAccountSchedule(FinRepPackageSchedule, FinReportPackageReport, AccScheduleParam, AccountSchedule, OutStr, IsHandled); - if not IsHandled then + if not IsHandled then begin + FinReportExportNameHandler.Init(FinRepPackage.Code); AccountSchedule.SaveAs(AccScheduleParam, ReportFormat::PDF, OutStr); + end; TempBlob.CreateInStream(InStr); ReportDescription := StrSubstNo('%1 (%2)', diff --git a/src/Layers/W1/BaseApp/Finance/FinancialReports/FinancialReportMgt.Codeunit.al b/src/Layers/W1/BaseApp/Finance/FinancialReports/FinancialReportMgt.Codeunit.al index 0635243d59e..f404c68ed17 100644 --- a/src/Layers/W1/BaseApp/Finance/FinancialReports/FinancialReportMgt.Codeunit.al +++ b/src/Layers/W1/BaseApp/Finance/FinancialReports/FinancialReportMgt.Codeunit.al @@ -521,11 +521,12 @@ codeunit 18 "Financial Report Mgt." procedure FindGLAccountWhereUsedInAccScheduleLine(GLAccNo: Code[20]; var TempGLAccWhereUsed: Record "G/L Account Where-Used" temporary): Boolean var AccScheduleLine: Record "Acc. Schedule Line"; + AccScheduleName: Record "Acc. Schedule Name"; begin FilterAccScheduleLineByGLAccount(AccScheduleLine, GLAccNo); if AccScheduleLine.FindSet() then begin TempGLAccWhereUsed."Table ID" := Database::"Acc. Schedule Line"; - TempGLAccWhereUsed."Table Name" := CopyStr(AccScheduleLine.TableCaption(), 1, MaxStrLen(TempGLAccWhereUsed."Table Name")); + TempGLAccWhereUsed."Table Name" := CopyStr(AccScheduleName.TableCaption(), 1, MaxStrLen(TempGLAccWhereUsed."Table Name")); TempGLAccWhereUsed."Field Name" := CopyStr(AccScheduleLine.FieldCaption(Totaling), 1, MaxStrLen(TempGLAccWhereUsed."Field Name")); repeat TempGLAccWhereUsed."Key 1" := AccScheduleLine."Schedule Name"; @@ -551,12 +552,13 @@ codeunit 18 "Financial Report Mgt." procedure FindGLAccountWhereUsedInColumnLayout(GLAccNo: Code[20]; var TempGLAccWhereUsed: Record "G/L Account Where-Used" temporary): Boolean var ColumnLayout: Record "Column Layout"; + ColumnLayoutName: Record "Column Layout Name"; begin FilterColumnLayoutByGLAccount(ColumnLayout, GLAccNo); if not ColumnLayout.FindSet() then exit(false); TempGLAccWhereUsed."Table ID" := Database::"Column Layout"; - TempGLAccWhereUsed."Table Name" := CopyStr(ColumnLayout.TableCaption(), 1, MaxStrLen(TempGLAccWhereUsed."Table Name")); + TempGLAccWhereUsed."Table Name" := CopyStr(ColumnLayoutName.TableCaption(), 1, MaxStrLen(TempGLAccWhereUsed."Table Name")); TempGLAccWhereUsed."Field Name" := CopyStr(ColumnLayout.FieldCaption("G/L Account Totaling"), 1, MaxStrLen(TempGLAccWhereUsed."Field Name")); repeat TempGLAccWhereUsed."Key 1" := ColumnLayout."Column Layout Name"; diff --git a/src/Layers/W1/BaseApp/Finance/FinancialReports/FinancialReportPackages.Page.al b/src/Layers/W1/BaseApp/Finance/FinancialReports/FinancialReportPackages.Page.al index ecd3fc1f37e..b339875e8d7 100644 --- a/src/Layers/W1/BaseApp/Finance/FinancialReports/FinancialReportPackages.Page.al +++ b/src/Layers/W1/BaseApp/Finance/FinancialReports/FinancialReportPackages.Page.al @@ -8,6 +8,8 @@ using System.Threading; page 8371 "Financial Report Packages" { + AboutText = 'Financial Report Packages let''s you export and schedule multiple financial reports in a single file. This allows you to easily share a complete financial report package with your stakeholders.'; + AboutTitle = 'About Financial Report Packages'; AnalysisModeEnabled = false; ApplicationArea = Basic, Suite; Caption = 'Financial Report Packages'; @@ -58,6 +60,7 @@ page 8371 "Financial Report Packages" FinReportPackageReport: Record "Fin. Report Package Report"; AccountSchedule: Report "Account Schedule"; FinancialReportExportJob: Codeunit "Financial Report Export Job"; + FinReportExportNameHandler: Codeunit FinReportExportNameHandler; AccScheduleParam: Text; IsHandled: Boolean; begin @@ -70,8 +73,10 @@ page 8371 "Financial Report Packages" AccountSchedule.AddPackageReportToAppend(FinReportPackageReport); until FinReportPackageReport.Next() = 0; OnBeforePrintAccountSchedule(Rec, AccountSchedule, AccScheduleParam, IsHandled); - if not IsHandled then + if not IsHandled then begin + FinReportExportNameHandler.Init(Rec.Code); AccountSchedule.Print(AccScheduleParam); + end end; } } diff --git a/src/Layers/W1/BaseApp/Finance/FinancialReports/FinancialReports.Page.al b/src/Layers/W1/BaseApp/Finance/FinancialReports/FinancialReports.Page.al index 9c2c666aa21..688e68fdc8c 100644 --- a/src/Layers/W1/BaseApp/Finance/FinancialReports/FinancialReports.Page.al +++ b/src/Layers/W1/BaseApp/Finance/FinancialReports/FinancialReports.Page.al @@ -401,10 +401,14 @@ page 108 "Financial Reports" } area(Promoted) { - actionref(ViewFinancialReport_Promoted; ViewFinancialReport) { } - actionref(Print_Promoted; Print) { } - actionref(Packages_Promoted; Packages) { } - + group(RunReport) + { + Caption = 'Run Report'; + actionref(ViewFinancialReport_Promoted; ViewFinancialReport) { } + actionref(Print_Promoted; Print) { } + actionref(Packages_Promoted; Packages) { } + actionref(Schedules_Promoted; Schedules) { } + } group(Category_Edit) { Caption = 'Definitions'; @@ -416,7 +420,6 @@ page 108 "Financial Reports" actionref(ShowAllRowDefinitions_Promoted; ShowAllRowDefinitions) { } actionref(ShowAllColumnDefinitions_Promoted; ShowAllColumnDefinitions) { } actionref(ShowAllCategories_Promoted; ShowAllCategories) { } - actionref(Schedules_Promoted; Schedules) { } } group(CopyExportImport) { diff --git a/src/Layers/W1/BaseApp/Finance/GeneralLedger/Account/GLAccountList.Page.al b/src/Layers/W1/BaseApp/Finance/GeneralLedger/Account/GLAccountList.Page.al index bf93faad2be..df93fda31f4 100644 --- a/src/Layers/W1/BaseApp/Finance/GeneralLedger/Account/GLAccountList.Page.al +++ b/src/Layers/W1/BaseApp/Finance/GeneralLedger/Account/GLAccountList.Page.al @@ -371,6 +371,20 @@ page 18 "G/L Account List" } } + views + { + view(Uncategorized) + { + Caption = 'Uncategorized accounts'; + Filters = where("Account Category" = const(" ")); + } + view(NoSubCategory) + { + Caption = 'Uncategorized accounts (missing sub category)'; + Filters = where("Account Subcategory Entry No." = const(0)); + } + } + trigger OnOpenPage() var PriceCalculationMgt: Codeunit "Price Calculation Mgt.";