Skip to content

[DE] [Event Request] E-Documents for Germany - Export XRechnung - OnAfterFormatDecimal, OnAfterFormatFourDecimal #29717

@pri-kise

Description

@pri-kise

Why do you need this change?

ome recipients and downstream systems require a stable text representation for numeric amounts (for example, always two decimal places such as "58.00" instead of "58"). Although the current internal formatting may be formally correct, customers report interoperability issues.

Describe the request

    procedure FormatDecimal(VarDecimal: Decimal): Text[30]
    var
        FormattedValue: Text[30];
    begin
        //>Change
        //-exit(Format(Round(VarDecimal, 0.01), 0, 9));
        FormattedValue := Format(Round(VarDecimal, 0.01), 0, 9);
        OnAfterFormatDecimal(VarDecimal, FormattedValue);
        exit(FormattedValue);
        //>Change
    end;

    procedure FormatFourDecimal(VarDecimal: Decimal): Text[30]
    var
        FormattedValue: Text[30];
    begin
        //>Change
        //-exit(Format(Round(VarDecimal, 0.0001), 0, 9));
        FormattedValue := Format(Round(VarDecimal, 0.0001), 0, 9);
        OnAfterFormatFourDecimal(VarDecimal, FormattedValue);
        exit(FormattedValue);
        //>Change
    end;

    procedure FormatFiveDecimal(VarDecimal: Decimal): Text[30]
    var
        FormattedValue: Text[30];
    begin
        //>Change
        //-exit(Format(Round(VarDecimal, 0.00001), 0, 9));
        FormattedValue := Format(Round(VarDecimal, 0.00001), 0, 9);
        OnAfterFormatFiveDecimal(VarDecimal, FormattedValue);
        exit(FormattedValue);
        //>Change
    end;
[IntegrationEvent(false, false)]
local procedure OnAfterFormatDecimal(Value: Decimal; var FormattedValue: Text)
begin
end;

[IntegrationEvent(false, false)]
local procedure OnAfterFormatFourDecimal(Value: Decimal; var FormattedValue: Text)
begin
end;

[IntegrationEvent(false, false)]
local procedure OnAfterFormatFiveDecimal(Value: Decimal; var FormattedValue: Text)
begin
end;

Additional Information

If this issue is approved then I can add the events via Pull Request by myself.
Internal work item: AB#622436

Metadata

Metadata

Assignees

No one assigned

    Labels

    IntegrationGitHub request for Integration areaevent-requestRequest for adding an event

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions