Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Event Request] codeunit 80 "Sales-Post" / 90 "Purch.-Post" - ValidatePostingAndDocumentDate - OnValidatePostingAndDocumentDateOnAfterCalcVATDateExists #27661

Open
fvet opened this issue Nov 21, 2024 · 1 comment
Labels
event-request Request for adding an event SCM GitHub request for SCM area

Comments

@fvet
Copy link
Contributor

fvet commented Nov 21, 2024

Describe the request

With the introduction of the 'VAT Date', we would like to read all 'Date' parameters - including the VAT Date parameter - in codeunit 80 "Sales-Post" - ValidatePostingAndDocumentDate via a single publisher.

Please either add the VAT date parameters to OnValidatePostingAndDocumentDateOnAfterCalcPostingDateExists (and move the publishers one line lower), or introduce a new OnValidatePostingAndDocumentDateOnAfterGetParameters publishers will all parameters and obsolete OnValidatePostingAndDocumentDateOnAfterCalcPostingDateExists

OnBeforeValidatePostingAndDocumentDate(SalesHeader, SuppressCommit);

        PostingDateExists :=
          BatchProcessingMgt.GetBooleanParameter(SalesHeader.RecordId, Enum::"Batch Posting Parameter Type"::"Replace Posting Date", ReplacePostingDate) and
          BatchProcessingMgt.GetBooleanParameter(
            SalesHeader.RecordId, Enum::"Batch Posting Parameter Type"::"Replace Document Date", ReplaceDocumentDate) and
          BatchProcessingMgt.GetDateParameter(SalesHeader.RecordId, Enum::"Batch Posting Parameter Type"::"Posting Date", PostingDate);
// OnValidatePostingAndDocumentDateOnAfterCalcPostingDateExists(PostingDateExists, ReplacePostingDate, ReplaceDocumentDate, PostingDate, SalesHeader, ModifyHeader); // Move to include the VAT Date fields

        VATDateExists := BatchProcessingMgt.GetBooleanParameter(SalesHeader.RecordId, Enum::"Batch Posting Parameter Type"::"Replace VAT Date", ReplaceVATDate);
        BatchProcessingMgt.GetDateParameter(SalesHeader.RecordId, Enum::"Batch Posting Parameter Type"::"VAT Date", VATDate);

        OnValidatePostingAndDocumentDateOnAfterGetParameters(PostingDateExists, ReplacePostingDate, ReplaceDocumentDate, PostingDate, VATDateExists, ReplaceVATDate, VATDate, SalesHeader, ModifyHeader); // MOVE AND EXTEND PUBLISHER

        if PostingDateExists and (ReplacePostingDate or (SalesHeader."Posting Date" = 0D)) then begin
            SalesHeader."Posting Date" := PostingDate;
            SalesHeader.SynchronizeAsmHeader();
            SalesHeader.Validate("Currency Code");
            ModifyHeader := true;
        end;
 [IntegrationEvent(false, false)]
    local procedure OnValidatePostingAndDocumentDateOnAfterGetParameters(var PostingDateExists: Boolean; var ReplacePostingDate: Boolean; var ReplaceDocumentDate: Boolean; var PostingDate: Date; var VATDateExists: Boolean; var ReplaceVATDate: Boolean; var VATDate: Date; var SalesHeader: Record "Sales Header"; var ModifyHeader: Boolean)
    begin
    end;

Please provide the same in codeunit 90 "Purch.-Post" as well.

Additional context

x
Internal work item: AB#558144

@JesperSchulz JesperSchulz added event-request Request for adding an event SCM GitHub request for SCM area labels Nov 21, 2024
@nikolakukrika
Copy link
Contributor

We cannot move the event because it is a protentional breaking change. We could introduce a new event.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
event-request Request for adding an event SCM GitHub request for SCM area
Projects
None yet
Development

No branches or pull requests

3 participants