Skip to content
Open
Show file tree
Hide file tree
Changes from 6 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
2879ddb
Added dimension setup to fixed assets
Nov 5, 2025
e4c3ea2
Added InsertFixedAsset function that takes FA Posting Group parameter
Nov 5, 2025
122e0f8
Added FA posting group to fixed asset dataset
Nov 5, 2025
b183a44
Added codeunits to generate FA journal lines & posted entries
Nov 5, 2025
63d9a69
Merged PR 38641: Dimension setup & posted entries for Fixed Assets
Nov 7, 2025
1b8a435
Sorted variables and usings
Dec 12, 2025
36102d0
Merge remote-tracking branch 'origin/main' into uptake/fixed-asset-up…
Jan 8, 2026
7cf988d
Updated Fixed Asset object IDs
Jan 8, 2026
1d4ce41
Added GetCashAccountNo function
Jan 8, 2026
a66dec4
Updated FA journal lines creation
Jan 8, 2026
b03351a
Implemented Cash account for fixed asset acquisitions in CZ
Jan 8, 2026
2421faf
Added CreateFAJournalSetups function
Jan 8, 2026
3c9f7c9
Implemented Cash account for fixed asset acquisitions in DK
Jan 8, 2026
8f5845d
Implemented Cash account for fixed asset acquisitions in NL
Jan 8, 2026
6620676
Corrected namespace reference for codeunit "Create NL GL Accounts"
Jan 8, 2026
9e69bb1
Merge remote-tracking branch 'origin/main' into uptake/fixed-asset-up…
Jan 22, 2026
e7b5230
Updated G/L account used to acquire fixed assets in DK
Jan 22, 2026
30f4605
Moved FA journal lines coduenit to Historical folder
Jan 30, 2026
1b2b9f9
Moved InsertFAGenJournalLine function to Contoso FA codeunit
Jan 30, 2026
12b4c58
Merge remote-tracking branch 'origin/main' into uptake/fixed-asset-up…
Jan 30, 2026
83304f1
Replaced GetCashAccountNo by Cash account directly for W1
Jan 30, 2026
68eacee
Removed GetCashAccountNo function & OnBeforeGetCashAccountForFixedAss…
Jan 30, 2026
ef62bbc
Removed OnBeforeGetCashAccountForFixedAssetAcquisition subscriber fro…
Jan 30, 2026
59f2c70
Added OnBeforeInsertGenJournalLineCZ subscriber to populate Cash acco…
Jan 30, 2026
88c2279
Replaced OnBeforeInsertGenJournalLine subscriber to populate Cash acc…
Jan 30, 2026
4f9766c
Replaced OnBeforeInsertGenJournalLine subscriber to populate Cash acc…
Jan 30, 2026
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
@@ -0,0 +1,35 @@
// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------

namespace Microsoft.DemoData.FixedAsset;

using Microsoft.DemoData.Finance;
using Microsoft.DemoTool.Helpers;
using Microsoft.Finance.Dimension;
using Microsoft.FixedAssets.FixedAsset;

codeunit 5212 "Create FA Dimension Value"
{
InherentEntitlements = X;
InherentPermissions = X;

trigger OnRun()
var
ContosoDimension: Codeunit "Contoso Dimension";
CreateDimension: Codeunit "Create Dimension";
CreateDimensionValue: Codeunit "Create Dimension Value";
CreateFixedAsset: Codeunit "Create Fixed Asset";
begin
ContosoDimension.InsertDefaultDimensionValue(Database::"Fixed Asset", CreateFixedAsset.FA000010(), CreateDimension.DepartmentDimension(), CreateDimensionValue.AdministrationDepartment(), Enum::"Default Dimension Value Posting Type"::" ");
ContosoDimension.InsertDefaultDimensionValue(Database::"Fixed Asset", CreateFixedAsset.FA000020(), CreateDimension.DepartmentDimension(), CreateDimensionValue.AdministrationDepartment(), Enum::"Default Dimension Value Posting Type"::" ");
ContosoDimension.InsertDefaultDimensionValue(Database::"Fixed Asset", CreateFixedAsset.FA000030(), CreateDimension.DepartmentDimension(), CreateDimensionValue.ProductionDepartment(), Enum::"Default Dimension Value Posting Type"::" ");
ContosoDimension.InsertDefaultDimensionValue(Database::"Fixed Asset", CreateFixedAsset.FA000040(), CreateDimension.DepartmentDimension(), CreateDimensionValue.ProductionDepartment(), Enum::"Default Dimension Value Posting Type"::" ");
ContosoDimension.InsertDefaultDimensionValue(Database::"Fixed Asset", CreateFixedAsset.FA000050(), CreateDimension.DepartmentDimension(), CreateDimensionValue.ProductionDepartment(), Enum::"Default Dimension Value Posting Type"::" ");
ContosoDimension.InsertDefaultDimensionValue(Database::"Fixed Asset", CreateFixedAsset.FA000060(), CreateDimension.DepartmentDimension(), CreateDimensionValue.ProductionDepartment(), Enum::"Default Dimension Value Posting Type"::" ");
ContosoDimension.InsertDefaultDimensionValue(Database::"Fixed Asset", CreateFixedAsset.FA000070(), CreateDimension.DepartmentDimension(), CreateDimensionValue.ProductionDepartment(), Enum::"Default Dimension Value Posting Type"::" ");
ContosoDimension.InsertDefaultDimensionValue(Database::"Fixed Asset", CreateFixedAsset.FA000080(), CreateDimension.DepartmentDimension(), CreateDimensionValue.ProductionDepartment(), Enum::"Default Dimension Value Posting Type"::" ");
ContosoDimension.InsertDefaultDimensionValue(Database::"Fixed Asset", CreateFixedAsset.FA000090(), CreateDimension.DepartmentDimension(), CreateDimensionValue.AdministrationDepartment(), Enum::"Default Dimension Value Posting Type"::" ");
end;
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

namespace Microsoft.DemoData.FixedAsset;

using Microsoft.DemoTool.Helpers;
using Microsoft.DemoData.Common;
using Microsoft.DemoTool.Helpers;
using Microsoft.FixedAssets.FixedAsset;

codeunit 5118 "Create Fixed Asset"
Expand All @@ -26,24 +26,25 @@ codeunit 5118 "Create Fixed Asset"
FAClass: Codeunit "Create FA Class";
ContosoFixedAsset: Codeunit "Contoso Fixed Asset";
FALocation: Codeunit "Create FA Location";
FAPostingGroup: Codeunit "Create FA Posting Group";
CommonCustomerVendor: Codeunit "Create Common Customer/Vendor";
ContosoUtilities: Codeunit "Contoso Utilities";
DomesticVendor1, DomesticVendor2, DomesticVendor3 : Code[20];
begin
DomesticVendor1 := CommonCustomerVendor.DomesticVendor1();
ContosoFixedAsset.InsertFixedAsset(FA000010(), Vehicle1Lbl, FAClass.TangibleClass(), FAClass.VehiclesSubClass(), FALocation.Administration(), Enum::"FA Component Type"::" ", SerialNoEA12394QLbl, ContosoUtilities.AdjustDate(19030412D), DomesticVendor1, DomesticVendor1);
ContosoFixedAsset.InsertFixedAsset(FA000020(), Vehicle2Lbl, FAClass.TangibleClass(), FAClass.VehiclesSubClass(), FALocation.Sales(), Enum::"FA Component Type"::" ", SerialNoEA12395QLbl, ContosoUtilities.AdjustDate(19030718D), DomesticVendor1, DomesticVendor1);
ContosoFixedAsset.InsertFixedAsset(FA000030(), Truck1Lbl, FAClass.TangibleClass(), FAClass.VehiclesSubClass(), FALocation.Production(), Enum::"FA Component Type"::" ", SerialNoEA15397QLbl, ContosoUtilities.AdjustDate(19030821D), DomesticVendor1, DomesticVendor1);
ContosoFixedAsset.InsertFixedAsset(FA000010(), Vehicle1Lbl, FAClass.TangibleClass(), FAClass.VehiclesSubClass(), FALocation.Administration(), Enum::"FA Component Type"::" ", SerialNoEA12394QLbl, ContosoUtilities.AdjustDate(19030412D), DomesticVendor1, DomesticVendor1, FAPostingGroup.Vehicles());
ContosoFixedAsset.InsertFixedAsset(FA000020(), Vehicle2Lbl, FAClass.TangibleClass(), FAClass.VehiclesSubClass(), FALocation.Sales(), Enum::"FA Component Type"::" ", SerialNoEA12395QLbl, ContosoUtilities.AdjustDate(19030718D), DomesticVendor1, DomesticVendor1, FAPostingGroup.Vehicles());
ContosoFixedAsset.InsertFixedAsset(FA000030(), Truck1Lbl, FAClass.TangibleClass(), FAClass.VehiclesSubClass(), FALocation.Production(), Enum::"FA Component Type"::" ", SerialNoEA15397QLbl, ContosoUtilities.AdjustDate(19030821D), DomesticVendor1, DomesticVendor1, FAPostingGroup.Vehicles());

DomesticVendor2 := CommonCustomerVendor.DomesticVendor2();
ContosoFixedAsset.InsertFixedAsset(FA000040(), ConveyorMainAssetLbl, FAClass.TangibleClass(), FAClass.EquipmentSubClass(), FALocation.Production(), Enum::"FA Component Type"::"Main Asset", SerialNoX23111SW0Lbl, ContosoUtilities.AdjustDate(19030815D), DomesticVendor2, DomesticVendor2);
ContosoFixedAsset.InsertFixedAsset(FA000050(), ConveyorBeltLbl, FAClass.TangibleClass(), FAClass.EquipmentSubClass(), FALocation.Production(), Enum::"FA Component Type"::Component, SerialNoX23111SW1Lbl, ContosoUtilities.AdjustDate(19030815D), DomesticVendor2, DomesticVendor2);
ContosoFixedAsset.InsertFixedAsset(FA000060(), ConveyorComputerLbl, FAClass.TangibleClass(), FAClass.EquipmentSubClass(), FALocation.Production(), Enum::"FA Component Type"::Component, SerialNoX23111SW3Lbl, ContosoUtilities.AdjustDate(19030815D), DomesticVendor2, DomesticVendor2);
ContosoFixedAsset.InsertFixedAsset(FA000040(), ConveyorMainAssetLbl, FAClass.TangibleClass(), FAClass.EquipmentSubClass(), FALocation.Production(), Enum::"FA Component Type"::"Main Asset", SerialNoX23111SW0Lbl, ContosoUtilities.AdjustDate(19030815D), DomesticVendor2, DomesticVendor2, FAPostingGroup.Equipment());
ContosoFixedAsset.InsertFixedAsset(FA000050(), ConveyorBeltLbl, FAClass.TangibleClass(), FAClass.EquipmentSubClass(), FALocation.Production(), Enum::"FA Component Type"::Component, SerialNoX23111SW1Lbl, ContosoUtilities.AdjustDate(19030815D), DomesticVendor2, DomesticVendor2, FAPostingGroup.Equipment());
ContosoFixedAsset.InsertFixedAsset(FA000060(), ConveyorComputerLbl, FAClass.TangibleClass(), FAClass.EquipmentSubClass(), FALocation.Production(), Enum::"FA Component Type"::Component, SerialNoX23111SW3Lbl, ContosoUtilities.AdjustDate(19030815D), DomesticVendor2, DomesticVendor2, FAPostingGroup.Equipment());

DomesticVendor3 := CommonCustomerVendor.DomesticVendor3();
ContosoFixedAsset.InsertFixedAsset(FA000070(), ConveyorLiftLbl, FAClass.TangibleClass(), FAClass.EquipmentSubClass(), FALocation.Production(), Enum::"FA Component Type"::Component, SerialNoX23111SW2Lbl, ContosoUtilities.AdjustDate(19030815D), DomesticVendor3, DomesticVendor3);
ContosoFixedAsset.InsertFixedAsset(FA000080(), CargoLiftLbl, FAClass.TangibleClass(), FAClass.EquipmentSubClass(), FALocation.Production(), Enum::"FA Component Type"::" ", SerialNoAKW2476111Lbl, ContosoUtilities.AdjustDate(19030421D), DomesticVendor3, DomesticVendor3);
ContosoFixedAsset.InsertFixedAsset(FA000090(), SwitchboardLbl, FAClass.TangibleClass(), FAClass.EquipmentSubClass(), FALocation.Administration(), Enum::"FA Component Type"::" ", SerialNoTELE4476ZLbl, ContosoUtilities.AdjustDate(19031212D), DomesticVendor3, DomesticVendor3);
ContosoFixedAsset.InsertFixedAsset(FA000070(), ConveyorLiftLbl, FAClass.TangibleClass(), FAClass.EquipmentSubClass(), FALocation.Production(), Enum::"FA Component Type"::Component, SerialNoX23111SW2Lbl, ContosoUtilities.AdjustDate(19030815D), DomesticVendor3, DomesticVendor3, FAPostingGroup.Equipment());
ContosoFixedAsset.InsertFixedAsset(FA000080(), CargoLiftLbl, FAClass.TangibleClass(), FAClass.EquipmentSubClass(), FALocation.Production(), Enum::"FA Component Type"::" ", SerialNoAKW2476111Lbl, ContosoUtilities.AdjustDate(19030421D), DomesticVendor3, DomesticVendor3, FAPostingGroup.Equipment());
ContosoFixedAsset.InsertFixedAsset(FA000090(), SwitchboardLbl, FAClass.TangibleClass(), FAClass.EquipmentSubClass(), FALocation.Administration(), Enum::"FA Component Type"::" ", SerialNoTELE4476ZLbl, ContosoUtilities.AdjustDate(19031212D), DomesticVendor3, DomesticVendor3, FAPostingGroup.Equipment());
end;

local procedure CreateMainAssetComponents()
Expand All @@ -58,18 +59,19 @@ codeunit 5118 "Create Fixed Asset"
local procedure CreateFADepreciationBookForAssets()
var
ContosoFixedAsset: Codeunit "Contoso Fixed Asset";
CreateFADepreciationBook: Codeunit "Create FA Depreciation Book";
ContosoUtilities: Codeunit "Contoso Utilities";
CreateFADepreciationBook: Codeunit "Create FA Depreciation Book";
CreateFAPostingGroup: Codeunit "Create FA Posting Group";
begin
ContosoFixedAsset.InsertFADepreciationBook(FA000010(), CreateFADepreciationBook.Company(), ContosoUtilities.AdjustDate(19020101D), 5);
ContosoFixedAsset.InsertFADepreciationBook(FA000020(), CreateFADepreciationBook.Company(), ContosoUtilities.AdjustDate(19020501D), 5);
ContosoFixedAsset.InsertFADepreciationBook(FA000030(), CreateFADepreciationBook.Company(), ContosoUtilities.AdjustDate(19020601D), 5);
ContosoFixedAsset.InsertFADepreciationBook(FA000040(), CreateFADepreciationBook.Company(), ContosoUtilities.AdjustDate(19020101D), 0);
ContosoFixedAsset.InsertFADepreciationBook(FA000050(), CreateFADepreciationBook.Company(), ContosoUtilities.AdjustDate(19020101D), 10);
ContosoFixedAsset.InsertFADepreciationBook(FA000060(), CreateFADepreciationBook.Company(), ContosoUtilities.AdjustDate(19020201D), 8);
ContosoFixedAsset.InsertFADepreciationBook(FA000070(), CreateFADepreciationBook.Company(), ContosoUtilities.AdjustDate(19020301D), 4);
ContosoFixedAsset.InsertFADepreciationBook(FA000080(), CreateFADepreciationBook.Company(), ContosoUtilities.AdjustDate(19020401D), 8);
ContosoFixedAsset.InsertFADepreciationBook(FA000090(), CreateFADepreciationBook.Company(), ContosoUtilities.AdjustDate(19020201D), 7);
ContosoFixedAsset.InsertFADepreciationBook(FA000010(), CreateFADepreciationBook.Company(), ContosoUtilities.AdjustDate(19010101D), 5, CreateFAPostingGroup.Vehicles());
ContosoFixedAsset.InsertFADepreciationBook(FA000020(), CreateFADepreciationBook.Company(), ContosoUtilities.AdjustDate(19010501D), 5, CreateFAPostingGroup.Vehicles());
ContosoFixedAsset.InsertFADepreciationBook(FA000030(), CreateFADepreciationBook.Company(), ContosoUtilities.AdjustDate(19010601D), 5, CreateFAPostingGroup.Vehicles());
ContosoFixedAsset.InsertFADepreciationBook(FA000040(), CreateFADepreciationBook.Company(), ContosoUtilities.AdjustDate(19010101D), 0, CreateFAPostingGroup.Equipment());
ContosoFixedAsset.InsertFADepreciationBook(FA000050(), CreateFADepreciationBook.Company(), ContosoUtilities.AdjustDate(19010101D), 10, CreateFAPostingGroup.Equipment());
ContosoFixedAsset.InsertFADepreciationBook(FA000060(), CreateFADepreciationBook.Company(), ContosoUtilities.AdjustDate(19010201D), 8, CreateFAPostingGroup.Equipment());
ContosoFixedAsset.InsertFADepreciationBook(FA000070(), CreateFADepreciationBook.Company(), ContosoUtilities.AdjustDate(19010301D), 4, CreateFAPostingGroup.Equipment());
ContosoFixedAsset.InsertFADepreciationBook(FA000080(), CreateFADepreciationBook.Company(), ContosoUtilities.AdjustDate(19010401D), 8, CreateFAPostingGroup.Equipment());
ContosoFixedAsset.InsertFADepreciationBook(FA000090(), CreateFADepreciationBook.Company(), ContosoUtilities.AdjustDate(19010201D), 7, CreateFAPostingGroup.Equipment());
end;

procedure FA000010(): Text[20]
Expand Down Expand Up @@ -118,22 +120,22 @@ codeunit 5118 "Create Fixed Asset"
end;

var
Vehicle1Lbl: Label 'Vehicle 1', MaxLength = 100;
Vehicle2Lbl: Label 'Vehicle 2', MaxLength = 100;
Truck1Lbl: Label 'Truck 1', MaxLength = 100;
ConveyorMainAssetLbl: Label 'Conveyor, Main Asset', MaxLength = 100;
CargoLiftLbl: Label 'Cargo Lift', MaxLength = 100;
ConveyorBeltLbl: Label 'Conveyor Belt', MaxLength = 100;
ConveyorComputerLbl: Label 'Conveyor Computer', MaxLength = 100;
CargoLiftLbl: Label 'Cargo Lift', MaxLength = 100;
ConveyorLiftLbl: Label 'Conveyor Lift', MaxLength = 100;
SwitchboardLbl: Label 'Switchboard', MaxLength = 100;
ConveyorMainAssetLbl: Label 'Conveyor, Main Asset', MaxLength = 100;
SerialNoAKW2476111Lbl: Label 'AKW2476111', Locked = true;
SerialNoEA12394QLbl: Label 'EA 12 394 Q', Locked = true;
SerialNoEA12395QLbl: Label 'EA 12 395 Q', Locked = true;
SerialNoEA15397QLbl: Label 'EA 15 397 Q', Locked = true;
SerialNoTELE4476ZLbl: Label 'TELE 4476 Z', Locked = true;
SerialNoX23111SW0Lbl: Label '23 111 SW0', Locked = true;
SerialNoX23111SW1Lbl: Label '23 111 SW1', Locked = true;
SerialNoX23111SW2Lbl: Label '23 111 SW2', Locked = true;
SerialNoX23111SW3Lbl: Label '23 111 SW3', Locked = true;
SerialNoAKW2476111Lbl: Label 'AKW2476111', Locked = true;
SerialNoTELE4476ZLbl: Label 'TELE 4476 Z', Locked = true;
SwitchboardLbl: Label 'Switchboard', MaxLength = 100;
Truck1Lbl: Label 'Truck 1', MaxLength = 100;
Vehicle1Lbl: Label 'Vehicle 1', MaxLength = 100;
Vehicle2Lbl: Label 'Vehicle 2', MaxLength = 100;
}
Loading
Loading