ALAppExtensions icon indicating copy to clipboard operation
ALAppExtensions copied to clipboard

[Event Request] Allow skip "No Taxable Entry" in codeunit 10756 "SII Management"

Open jamunoz-pdw opened this issue 4 years ago • 1 comments

Hi,

Currently it's not possible to skip some no taxable entries that must not go to Spanish SII. The event would allow to check or filter the entry previously and check if the setup allows or not to send to Spanish SII.

Thanks in advance

procedure GetNoTaxableSalesAmount(var NoTaxableAmount: Decimal; SourceNo: Code[20]; DocumentType: Option; DocumentNo: Code[20]; PostingDate: Date; IsService: Boolean; UseNoTaxableType: Boolean; IsLocalRule: Boolean): Boolean
    var
        NoTaxableEntry: Record "No Taxable Entry";
    begin
        NoTaxableAmount := 0;

        // START ****
        IsHandled := false;
	OnBeforeNoTaxableEntriesExistSales(NoTaxableEntry, SourceNo, DocumentType, DocumentNo, PostingDate, IsService, 
            UseNoTaxableType, IsLocalRule, NoTaxableAmount, IsHandled)
	if IsHandled then
	    exit(false);
        // END ****
			
        if NoTaxableEntriesExistSales(NoTaxableEntry, SourceNo, DocumentType, DocumentNo, PostingDate, IsService, UseNoTaxableType, IsLocalRule) then begin
            NoTaxableEntry.CalcSums("Amount (LCY)");
            if DoNotReportNegativeLines() then
                case true of
                    (DocumentType = NoTaxableEntry."Document Type"::Invoice) and (NoTaxableEntry."Amount (LCY)" > 0):
                        exit(false);
                    (DocumentType = NoTaxableEntry."Document Type"::"Credit Memo") and (NoTaxableEntry."Amount (LCY)" < 0):
                        exit(false);
                end;
            NoTaxableAmount := -NoTaxableEntry."Amount (LCY)";
            exit(true);
        end;
        exit(false);
    end;
    [IntegrationEvent(false, false)]
    local procedure OnBeforeNoTaxableEntriesExistSales(var NoTaxableEntry: Record "No Taxable Entry"; SourceNo: Code[20]; 
        DocumentType: Option; DocumentNo: Code[20]; PostingDate: Date; IsService: Boolean; UseNoTaxableType: Boolean; IsLocalRule: 
        Boolean, var NoTaxableAmount: Decimal, var IsHandled: Boolean)
    begin
    end;

jamunoz-pdw avatar Jul 11 '22 10:07 jamunoz-pdw

Thanks for reporting this. We agree, and we’ll publish a fix asap, either in an update for the current version or in the next major release. Please do not reply to this, as we do not monitor closed issues. If you have follow-up questions or requests, please create a new issue where you reference this one.

Build ID: 44168.

JesperSchulz avatar Jul 25 '22 17:07 JesperSchulz