Describe the request
Please add a new integration event OnBeforeSetHalfYearConventionMethod() with parameter FADeprBook, DeprMethod, Year365Days, FirstDeprDate, NewYearDate, Result and IsHandled in the Codeunit 5611 "Calculate Normal Depreciation"
Example:
local procedure SetHalfYearConventionMethod(): Boolean
var
AccountingPeriod: Record "Accounting Period";
Result: Boolean;
IsHandled: Boolean;
begin
IsHandled := false;
OnBeforeSetHalfYearConventionMethod(FADeprBook, DeprMethod, Year365Days, FirstDeprDate, NewYearDate, Result, IsHandled);
if IsHandled then
exit(Result);
if not FADeprBook."Use Half-Year Convention" then
exit(false);
if FADeprBook."Depreciation Method" = FADeprBook."Depreciation Method"::Manual then
exit(false);
if DeprMethod = DeprMethod::"Below Zero" then
exit(false);
if AccountingPeriod.IsEmpty() then
exit(false);
AccountingPeriod.SetRange("New Fiscal Year", true);
AccountingPeriod.SetFilter(
"Starting Date", '>=%1',
DepreciationCalc.ToMorrow(FADeprBook."Depreciation Starting Date", Year365Days));
AccountingPeriod.FindFirst();
NewYearDate := AccountingPeriod."Starting Date";
if FirstDeprDate >= NewYearDate then
exit(false);
if DeprBook."No. of Days in Fiscal Year" <> 0 then
DeprBook.TestField("No. of Days in Fiscal Year", 360);
if DeprMethod in
[DeprMethod::"Declining-Balance 2",
DeprMethod::"DB2/SL",
DeprMethod::"User-Defined"]
then
Error(
Text004,
FADeprBook.FieldCaption("Depreciation Method"),
FADeprBook."Depreciation Method",
GetFAName());
exit(true);
end;
[IntegrationEvent(false, false)]
local procedure OnBeforeSetHalfYearConventionMethod(FADeprBook: Record "FA Depreciation Book"; DeprMethod: Enum "FA Depr. Method Internal"; Year365Days: Boolean; FirstDeprDate: Date; NewYearDate: Date; var Result: Boolean; var IsHandled: Boolean)
begin
end;
Additional context
Set the global variable UseHalfYearConvention in this codeunit by custom logic.
Internal work item: AB#565246
Describe the request
Please add a new integration event
OnBeforeSetHalfYearConventionMethod()with parameterFADeprBook,DeprMethod,Year365Days,FirstDeprDate,NewYearDate,ResultandIsHandledin theCodeunit 5611 "Calculate Normal Depreciation"Example:
Additional context
Set the global variable
UseHalfYearConventionin this codeunit by custom logic.Internal work item: AB#565246