Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,39 @@ codeunit 10875 "Create FA Depreciation Book FR"
DepreciationBook.Validate(Description, DepreciationDesc);
DepreciationBook.Validate("Disposal Calculation Method", DisposalCalc);
DepreciationBook.Validate("Use Rounding in Periodic Depr.", UseRoundingInPerodic);
DepreciationBook.Validate("G/L Integration - Derogatory", GLIntegrationDerogatory);
#if not CLEAN28
if AcceleratedDeprFeature.IsEnabled() then
DepreciationBook.Validate("Integration G/L - Derogatory", GLIntegrationDerogatory)
else
#pragma warning disable AL0432
DepreciationBook.Validate("G/L Integration - Derogatory", GLIntegrationDerogatory);
#pragma warning restore AL0432
#else
DepreciationBook.Validate("Integration G/L - Derogatory", GLIntegrationDerogatory);
#endif
end;

local procedure ValidateFADepreciationBook(var DepreciationBook: Record "Depreciation Book"; DisposalCalc: Option; DerogatoryCalc: Code[10])
begin
DepreciationBook.Validate("Disposal Calculation Method", DisposalCalc);
DepreciationBook.Validate("Derogatory Calculation", DerogatoryCalc);
#if not CLEAN28
if AcceleratedDeprFeature.IsEnabled() then
DepreciationBook.Validate("Derogatory Calc.", DerogatoryCalc)
else
#pragma warning disable AL0432
DepreciationBook.Validate("Derogatory Calculation", DerogatoryCalc);
#pragma warning restore AL0432
#else
DepreciationBook.Validate("Derogatory Calc.", DerogatoryCalc);
#endif
end;

var
#if not CLEAN28
#pragma warning disable AL0432
AcceleratedDeprFeature: Codeunit "Accelerated Depr. Feature";
#pragma warning restore AL0432
#endif
TaxTok: Label 'TAX', MaxLength = 10, Locked = true;
CompanyDescLbl: Label 'Accounting Book', MaxLength = 100;
DerogatoryBookLbl: Label 'Derogatory Book', MaxLength = 100;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
namespace Microsoft.DemoData.FixedAsset;

using Microsoft.DemoData.Finance;
#if not CLEAN28
using Microsoft.FixedAssets.Depreciation;
#endif
using Microsoft.FixedAssets.FixedAsset;

codeunit 10876 "Create FA Posting Grp. FR"
Expand All @@ -29,6 +32,12 @@ codeunit 10876 "Create FA Posting Grp. FR"
end;

local procedure ValidateFAPostingGroup(var FAPostingGroup: Record "FA Posting Group"; AcquisitionCostAccount: Code[20]; AccumDepreciationAccount: Code[20]; AcqCostAccOnDisposal: Code[20]; AccumDeprAccOnDisposal: Code[20]; GainsAccOnDisposal: Code[20]; LossesAccOnDisposal: Code[20]; BookValueGainAcc: Code[20]; SaleAccDisposalGain: Code[20]; MaintenanceExpenseAccount: Code[20]; DepreciationExpenseAcc: Code[20]; AcquisitionCostBalAcc: Code[20]; SalesAccDisposalLoss: Code[20]; BookValueLossAcc: Code[20]; DerogatoryAccount: Code[20]; DerogatoryAccountDecrease: Code[20]; DerogatoryBalDecreaseAcc: Code[20]; DerogatoryExpenseAcc: Code[20])
#if not CLEAN28
var
#pragma warning disable AL0432
AcceleratedDeprFeature: Codeunit "Accelerated Depr. Feature";
#pragma warning restore AL0432
#endif
begin
FAPostingGroup.Validate("Acquisition Cost Account", AcquisitionCostAccount);
FAPostingGroup.Validate("Accum. Depreciation Account", AccumDepreciationAccount);
Expand All @@ -42,10 +51,27 @@ codeunit 10876 "Create FA Posting Grp. FR"
FAPostingGroup.Validate("Book Val. Acc. on Disp. (Gain)", BookValueGainAcc);
FAPostingGroup.Validate("Sales Acc. on Disp. (Loss)", SalesAccDisposalLoss);
FAPostingGroup.Validate("Book Val. Acc. on Disp. (Loss)", BookValueLossAcc);
FAPostingGroup.Validate("Derogatory Account", DerogatoryAccount);
FAPostingGroup.Validate("Derogatory Acc. (Decrease)", DerogatoryAccountDecrease);
FAPostingGroup.Validate("Derog. Bal. Acc. (Decrease)", DerogatoryBalDecreaseAcc);
FAPostingGroup.Validate("Derogatory Expense Account", DerogatoryExpenseAcc);
#if not CLEAN28
if AcceleratedDeprFeature.IsEnabled() then begin
FAPostingGroup.Validate("Derogatory Acc.", DerogatoryAccount);
FAPostingGroup.Validate("Derogatory Account (Decrease)", DerogatoryAccountDecrease);
FAPostingGroup.Validate("Derog. Bal. Account (Decrease)", DerogatoryBalDecreaseAcc);
FAPostingGroup.Validate("Derogatory Expense Acc.", DerogatoryExpenseAcc);
end
else begin
#pragma warning disable AL0432
FAPostingGroup.Validate("Derogatory Account", DerogatoryAccount);
FAPostingGroup.Validate("Derogatory Acc. (Decrease)", DerogatoryAccountDecrease);
FAPostingGroup.Validate("Derog. Bal. Acc. (Decrease)", DerogatoryBalDecreaseAcc);
FAPostingGroup.Validate("Derogatory Expense Account", DerogatoryExpenseAcc);
#pragma warning restore AL0432
end;
#else
FAPostingGroup.Validate("Derogatory Acc.", DerogatoryAccount);
FAPostingGroup.Validate("Derogatory Account (Decrease)", DerogatoryAccountDecrease);
FAPostingGroup.Validate("Derog. Bal. Account (Decrease)", DerogatoryBalDecreaseAcc);
FAPostingGroup.Validate("Derogatory Expense Acc.", DerogatoryExpenseAcc);
#endif
FAPostingGroup.Validate("Acquisition Cost Bal. Acc.", AcquisitionCostBalAcc);
end;
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ codeunit 10803 "FA Reports FR"
ObsoleteTag = '28.0';

var
FeatureKeyIdTok: Label 'FAReportsGB', Locked = true;
FeatureKeyIdTok: Label 'FAReportsFR', Locked = true;

procedure IsEnabled() Enabled: Boolean
var
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -218,7 +218,16 @@ report 10817 "FA-Proj. Value (Derogatory) FR"
begin
SetRange("FA No.", "Fixed Asset"."No.");
SetRange("Depreciation Book Code", DeprBookCode);
SetRange("Exclude Derogatory", false);
#if not CLEAN28
if AcceleratedDeprFeature.IsEnabled() then
SetRange("Derogatory Excluded", false)
else
#pragma warning disable AL0432
SetRange("Exclude Derogatory", false);
#pragma warning restore AL0432
#else
SetRange("Derogatory Excluded", false);
#endif
BookValue := 0;
FALedgerEntryDerogBookValue := 0;
if (IncludePostedFromFilter = 0D) or not PrintDetails then
Expand Down Expand Up @@ -769,6 +778,11 @@ report 10817 "FA-Proj. Value (Derogatory) FR"
CalculateDepr: Codeunit "Calculate Depreciation";
FADateCalculation: Codeunit "FA Date Calculation";
DepreciationCalculation: Codeunit "Depreciation Calculation";
#if not CLEAN28
#pragma warning disable AL0432
AcceleratedDeprFeature: Codeunit "Accelerated Depr. Feature";
#pragma warning restore AL0432
#endif
DeprBookCode: Code[10];
DerogDeprBookCode: Code[10];
FAFilter: Text;
Expand Down Expand Up @@ -881,13 +895,34 @@ report 10817 "FA-Proj. Value (Derogatory) FR"
local procedure TransferValues()
begin
// set base amount for the standard depreciation calculation (without Derogatory)
FADeprBook.CalcFields("Book Value", Depreciation, "Custom 1", Derogatory);
#if not CLEAN28
if AcceleratedDeprFeature.IsEnabled() then
FADeprBook.CalcFields("Book Value", Depreciation, "Custom 1", "Derogatory Amount")
else
#pragma warning disable AL0432
FADeprBook.CalcFields("Book Value", Depreciation, "Custom 1", Derogatory);
#pragma warning restore AL0432
#else
FADeprBook.CalcFields("Book Value", Depreciation, "Custom 1", "Derogatory Amount");
#endif
DateFromProjection := 0D;
// if the asset has depreciations already, derogatory must be substracted from book value to avoid wrong derogatory calculation
// no problem for standard assets because derogatory is then zero
EntryAmounts[1] := FADeprBook."Book Value";
if HasDerogatorySetup then
EntryAmounts[1] -= FADeprBook.Derogatory;
#if not CLEAN28
if AcceleratedDeprFeature.IsEnabled() then begin
if HasDerogatorySetup then
EntryAmounts[1] -= FADeprBook."Derogatory Amount";
end
else
if HasDerogatorySetup then
#pragma warning disable AL0432
EntryAmounts[1] -= FADeprBook.Derogatory;
#pragma warning restore AL0432
#else
if HasDerogatorySetup then
EntryAmounts[1] -= FADeprBook."Derogatory Amount";
#endif
EntryAmounts[2] := FADeprBook."Custom 1";
EntryAmounts[3] := DepreciationCalculation.DeprInFiscalYear("Fixed Asset"."No.", DeprBookCode, StartingDate);
TotalBookValue[1] := TotalBookValue[1] + FADeprBook."Book Value";
Expand Down Expand Up @@ -1326,7 +1361,16 @@ report 10817 "FA-Proj. Value (Derogatory) FR"
begin
TotalDerogAssetsIncluded := false;
DerogDepreciationBookCode := '';
DerogDepreciationBook.SetRange("Derogatory Calculation", DepreciationBookCode);
#if not CLEAN28
if AcceleratedDeprFeature.IsEnabled() then
DerogDepreciationBook.SetRange("Derogatory Calc.", DepreciationBookCode)
else
#pragma warning disable AL0432
DerogDepreciationBook.SetRange("Derogatory Calculation", DepreciationBookCode);
#pragma warning restore AL0432
#else
DerogDepreciationBook.SetRange("Derogatory Calc.", DepreciationBookCode);
#endif
if DerogDepreciationBook.FindFirst() then
DerogDepreciationBookCode := DerogDepreciationBook.Code;
end;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -109,11 +109,25 @@ codeunit 148000 "ERM FA Derogatory Depreciation"
local procedure CreateDepreciationBook(): Code[10]
var
DepreciationBook: Record "Depreciation Book";
#if not CLEAN28
#pragma warning disable AL0432
AcceleratedDeprFeature: Codeunit "Accelerated Depr. Feature";
#pragma warning restore AL0432
#endif
begin
LibraryFixedAsset.CreateDepreciationBook(DepreciationBook);
DepreciationBook.Validate("G/L Integration - Acq. Cost", true);
DepreciationBook.Validate("G/L Integration - Depreciation", true);
DepreciationBook.Validate("G/L Integration - Derogatory", true);
#if not CLEAN28
if AcceleratedDeprFeature.IsEnabled() then
DepreciationBook.Validate("Integration G/L - Derogatory", true)
else
#pragma warning disable AL0432
DepreciationBook.Validate("G/L Integration - Derogatory", true);
#pragma warning restore AL0432
#else
DepreciationBook.Validate("Integration G/L - Derogatory", true);
#endif
DepreciationBook.Modify(true);
exit(DepreciationBook.Code);
end;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,11 @@ codeunit 148001 "ERM Fixed Assets - Local"
LibraryReportDataset: Codeunit "Library - Report Dataset";
LibraryRandom: Codeunit "Library - Random";
Assert: Codeunit Assert;
#if not CLEAN28
#pragma warning disable AL0432
AcceleratedDeprFeature: Codeunit "Accelerated Depr. Feature";
#pragma warning restore AL0432
#endif
CompletionStatsTok: Label 'The depreciation has been calculated.';

[Test]
Expand Down Expand Up @@ -310,7 +315,16 @@ codeunit 148001 "ERM Fixed Assets - Local"
begin
CreateAndSetupDeprBook(DeprBook);
DeprBook.Validate("Use Same FA+G/L Posting Dates", false);
DeprBook.Validate("Derogatory Calculation", DerogDeprBookCode);
#if not CLEAN28
if AcceleratedDeprFeature.IsEnabled() then
DeprBook.Validate("Derogatory Calc.", DerogDeprBookCode)
else
#pragma warning disable AL0432
DeprBook.Validate("Derogatory Calculation", DerogDeprBookCode);
#pragma warning restore AL0432
#else
DeprBook.Validate("Derogatory Calc.", DerogDeprBookCode);
#endif
DeprBook.Modify(true);
exit(DeprBook.Code);
end;
Expand Down Expand Up @@ -375,7 +389,16 @@ codeunit 148001 "ERM Fixed Assets - Local"
DeprBook.Get(DeprBookCode);
DeprBook.Validate("G/L Integration - Acq. Cost", Value);
DeprBook.Validate("G/L Integration - Depreciation", Value);
DeprBook.Validate("G/L Integration - Derogatory", Value);
#if not CLEAN28
if AcceleratedDeprFeature.IsEnabled() then
DeprBook.Validate("Integration G/L - Derogatory", Value)
else
#pragma warning disable AL0432
DeprBook.Validate("G/L Integration - Derogatory", Value);
#pragma warning restore AL0432
#else
DeprBook.Validate("Integration G/L - Derogatory", Value);
#endif
DeprBook.Modify(true);
end;

Expand Down Expand Up @@ -690,4 +713,4 @@ codeunit 148001 "ERM Fixed Assets - Local"
else
Reply := true;
end;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ codeunit 5135 "Create Common GL Account"

trigger OnRun()
var
GLAccountIndent: Codeunit "G/L Account-Indent";
GLAccountIndent: Codeunit "W1 G/L Account Indent";
begin
AddGLAccountsForLocalization();

Expand All @@ -42,6 +42,7 @@ codeunit 5135 "Create Common GL Account"
GLAccountIndent.Indent();
end;


local procedure AddGLAccountsForLocalization()
var
InventorySetup: Record "Inventory Setup";
Expand Down
Loading
Loading