Codeunit 743 VAT Report Export

App
Base Application
Namespace
Microsoft.Finance.VAT.Reporting
Versions
17-28

Procedures, 1

Versions171819202122232425262728

Source29

Source in 29

src/Layers/W1/BaseApp/Finance/VAT/Reporting/VATReportExport.Codeunit.al61 lines, Copyright (c) Microsoft Corporation. MIT

// ------------------------------------------------------------------------------------------------
// 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.VAT.Reporting;

/// <summary>
/// Provides export functionality for VAT reports with automatic release capability.
/// Handles export operations based on report status and ensures proper workflow progression.
/// </summary>
codeunit 743 "VAT Report Export"
{

    trigger OnRun()
    begin
    end;

    var
        VATReportReleaseReopen: Codeunit "VAT Report Release/Reopen";
#pragma warning disable AA0074
        Text001: Label 'This action will also mark the report as released. Are you sure you want to continue?';
#pragma warning restore AA0074

    /// <summary>
    /// Exports VAT report based on current status with automatic release if needed.
    /// Routes to appropriate export method based on report status.
    /// </summary>
    /// <param name="VATReportHeader">VAT report to export</param>
    procedure Export(VATReportHeader: Record "VAT Report Header")
    begin
        case VATReportHeader.Status of
            VATReportHeader.Status::Open:
                ExportOpen(VATReportHeader);
            VATReportHeader.Status::Released:
                ExportReleased();
            VATReportHeader.Status::Submitted:
                ExportReleased();
        end;
    end;

    local procedure ExportOpen(var VATReportHeader: Record "VAT Report Header")
    begin
        VATReportHeader.TestField(Status, VATReportHeader.Status::Open);

        if Confirm(Text001, true) then begin
            VATReportReleaseReopen.Release(VATReportHeader);
            ExportReleased();
        end;
    end;

    local procedure ExportReleased()
    begin
        ExportReport();
    end;

    local procedure ExportReport()
    begin
    end;
}