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] Add the event OnAfterCreateCorrPurchaseInvoice in codeunit "Correct Posted Purch. Invoice" similar to the already existing one for sales in codeunit "Correct Posted Sales Invoice" #26702

Closed
diogoviegas2855 opened this issue Jun 19, 2024 · 1 comment
Labels
event-request Request for adding an event SCM GitHub request for SCM area ships-in-future-update Fix ships in a future update

Comments

@diogoviegas2855
Copy link

diogoviegas2855 commented Jun 19, 2024

Describe the request

Hi
Can you please add the event OnAfterCreateCorrPurchaseInvoice in codeunit "Correct Posted Purch. Invoice" similar to the already existing one for sales in codeunit "Correct Posted Sales Invoice"

Actual Code:

procedure CancelPostedInvoiceStartNewInvoice(var PurchInvHeader: Record "Purch. Inv. Header"; var PurchaseHeader: Record "Purchase Header")
begin
    CancellingOnly := false;

    if CreateCreditMemo(PurchInvHeader) then begin
        CreateCopyDocument(PurchInvHeader, PurchaseHeader, PurchaseHeader."Document Type"::Invoice, true);
        Commit();
    end;
end;

Suggestion Code:

procedure CancelPostedInvoiceStartNewInvoice(var PurchInvHeader: Record "Purch. Inv. Header"; var PurchaseHeader: Record "Purchase Header")
begin
    CancellingOnly := false;

    if CreateCreditMemo(PurchInvHeader) then begin
        CreateCopyDocument(PurchInvHeader, PurchaseHeader, PurchaseHeader."Document Type"::Invoice, true);
        OnAfterCreateCorrPurchaseInvoice(PurchaseHeader, PurchInvHeader);
        Commit();
    end;
end;

[IntegrationEvent(false, false)]
    local procedure OnAfterCreateCorrPurchaseInvoice(var PurchaseHeader: Record "Purchase Header"; var PurchInvHeader: Record "Purch. Inv. Header")
begin
end;

Additional context

Need this event to control what happens after the creation of the corrective purchase invoice
Internal work item: AB#539216

@JesperSchulz JesperSchulz added event-request Request for adding an event SCM GitHub request for SCM area labels Jun 24, 2024
@JesperSchulz JesperSchulz added the ships-in-future-update Fix ships in a future update label Jul 2, 2024
@JesperSchulz
Copy link
Contributor

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: 21509.

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 ships-in-future-update Fix ships in a future update
Projects
None yet
Development

No branches or pull requests

2 participants