microsoft / ALAppExtensions

Repository for collaboration on Microsoft AL application add-on and localization extensions for Microsoft Dynamics 365 Business Central.
MIT License
770 stars 610 forks source link

[Event Request] Codeunit 1012 "Job Jnl.-Post Line" - OnAfterUpdateJobJnlLineTotalAmounts #27041

Closed 1languste closed 3 weeks ago

1languste commented 1 month ago

Describe the request

I want to calculate the Total Cost & Price (LCY) on the AmtRoundingPrecision and not the GLSetup."Amount Rounding Precision". Therefore, I request the following event:

local procedure UpdateJobJnlLineTotalAmounts(var JobJnlLineToUpdate: Record "Job Journal Line"; AmtRoundingPrecision: Decimal)
begin
    JobJnlLineToUpdate."Total Cost" := Round(JobJnlLineToUpdate."Unit Cost" * JobJnlLineToUpdate.Quantity, AmtRoundingPrecision);
    JobJnlLineToUpdate."Total Cost (LCY)" := Round(JobJnlLineToUpdate."Unit Cost (LCY)" * JobJnlLineToUpdate.Quantity, GLSetup."Amount Rounding Precision");
    JobJnlLineToUpdate."Total Price" := Round(JobJnlLineToUpdate."Unit Price" * JobJnlLineToUpdate.Quantity, AmtRoundingPrecision);
    JobJnlLineToUpdate."Total Price (LCY)" := Round(JobJnlLineToUpdate."Unit Price (LCY)" * JobJnlLineToUpdate.Quantity, GLSetup."Amount Rounding Precision");
    //NEW BEGIN
    OnAfterUpdateJobJnlLineTotalAmounts(JobJnlLineToUpdate, AmtRoundingPrecision, GLSetup."Amount Rounding Precision");
    //NEW END
end;

[IntegrationEvent(false, false)]
local procedure OnAfterUpdateJobJnlLineTotalAmounts(var JobJnlLineToUpdate: Record "Job Journal Line"; AmtRoundingPrecision: Decimal; GLAmtRoundingPrecision: Decimal)
begin
end;

Additional context

I want to calculate the Total Cost & Price (LCY) on the AmtRoundingPrecision and not the GLSetup."Amount Rounding Precision". Internal work item: AB#544565

JesperSchulz commented 3 weeks ago

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