Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -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;
}
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand Down Expand Up @@ -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)',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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";
Expand All @@ -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";
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -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
Expand All @@ -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;
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand All @@ -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)
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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.";
Expand Down
Loading