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 @@ -248,6 +248,7 @@ codeunit 31215 "Contoso CZ Localization"
Codeunit.Run(Codeunit::"Create FA Posting Group CZ");
Codeunit.Run(Codeunit::"Create FA Setup CZ");
CreateDepreciationBookCZ.DeleteDepreciationBooks();
CreateDepreciationBookCZ.CreateFAJournalSetups();
end;
Enum::"Contoso Demo Data Level"::"Master Data":
begin
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,16 @@ codeunit 31183 "Create Depreciation Book CZ"
ContosoFixedAsset.InsertDepreciationBook(CreateFADepreciationBook.Company(), '', false, false, false, false, false, false, false, false, false, 0);
end;

internal procedure CreateFAJournalSetups()
var
ContosoFixedAsset: Codeunit "Contoso Fixed Asset";
CreateFAJnlTemplate: Codeunit "Create FA Jnl. Template";
CreateFAInsTemplate: Codeunit "Create FA Ins Jnl. Template";
begin
ContosoFixedAsset.InsertFAJournalSetup('', FirstAccount(), CreateFAJnlTemplate.Assets(), CreateFAInsTemplate.Default(), CreateFAJnlTemplate.Assets(), CreateFAInsTemplate.Default(), CreateFAInsTemplate.Insurance(), CreateFAJnlTemplate.Default());
ContosoFixedAsset.InsertFAJournalSetup('', SecondTax(), CreateFAJnlTemplate.Assets(), CreateFAInsTemplate.Default(), CreateFAJnlTemplate.Assets(), CreateFAInsTemplate.Default(), CreateFAInsTemplate.Insurance(), CreateFAJnlTemplate.Default());
end;

var
FirstAccountLbl: Label '1-ACCOUNT', MaxLength = 10;
SecondTaxLbl: Label '2-TAX', MaxLength = 10;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

namespace Microsoft.DemoData.FixedAsset;

using Microsoft.DemoData.Finance;
using Microsoft.FixedAssets.Setup;

codeunit 11715 "Create FA Setup CZ"
Expand Down Expand Up @@ -35,4 +36,12 @@ codeunit 11715 "Create FA Setup CZ"
FASetup.Validate("Automatic Insurance Posting", AutomaticInsurancePosting);
FASetup.Modify(true);
end;

[EventSubscriber(ObjectType::Codeunit, Codeunit::"Create FA GL Account", OnBeforeGetCashAccountForFixedAssetAcquisition, '', false, false)]
local procedure GetCZCashAccountForFixedAssetAcquisition(var GLAccountNo: Code[20])
var
CreateGLAccountCZ: Codeunit "Create G/L Account CZ";
begin
GLAccountNo := CreateGLAccountCZ.CashTransfer();
end;
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

namespace Microsoft.DemoData.FixedAsset;

using Microsoft.DemoData.Finance;
using Microsoft.FixedAssets.Depreciation;

codeunit 13742 "Create FA Depreciation Book DK"
Expand All @@ -29,4 +30,12 @@ codeunit 13742 "Create FA Depreciation Book DK"
begin
DepreciationBook.Validate("Default Final Rounding Amount", DefaultFinalRoundingAmount);
end;

[EventSubscriber(ObjectType::Codeunit, Codeunit::"Create FA GL Account", OnBeforeGetCashAccountForFixedAssetAcquisition, '', false, false)]
local procedure GetDKCashAccountForFixedAssetAcquisition(var GLAccountNo: Code[20])
var
CreateGLAccDK: Codeunit "Create GL Acc. DK";
begin
GLAccountNo := CreateGLAccDK.Cashflowfunds();
end;
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

namespace Microsoft.DemoData.FixedAsset;

using Microsoft.DemoData.Localization;
using Microsoft.FixedAssets.Depreciation;

codeunit 11505 "Create FA Depreciation Book NL"
Expand All @@ -29,4 +30,12 @@ codeunit 11505 "Create FA Depreciation Book NL"
begin
DepreciationBook.Validate("Default Final Rounding Amount", DefaultFinalRoundingAmount);
end;

[EventSubscriber(ObjectType::Codeunit, Codeunit::"Create FA GL Account", OnBeforeGetCashAccountForFixedAssetAcquisition, '', false, false)]
local procedure GetNLCashAccountForFixedAssetAcquisition(var GLAccountNo: Code[20])
var
CreateNLGLAccounts: Codeunit "Create NL GL Accounts";
begin
GLAccountNo := CreateNLGLAccounts.PettyCash();
end;
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@

namespace Microsoft.DemoData.FixedAsset;

using Microsoft.Finance.GeneralLedger.Account;
using Microsoft.DemoData.Finance;
using Microsoft.DemoTool.Helpers;
using Microsoft.Finance.GeneralLedger.Account;

codeunit 4773 "Create FA GL Account"
{
Expand Down Expand Up @@ -45,6 +46,17 @@ codeunit 4773 "Create FA GL Account"
OnAfterAddGLAccountsForLocalization();
end;

procedure GetCashAccountNo() GLAccountNo: Code[20]
var
CreateGLAccount: Codeunit "Create G/L Account";
begin
OnBeforeGetCashAccountForFixedAssetAcquisition(GLAccountNo);
if GLAccountNo <> '' then
exit(GLAccountNo);

exit(CreateGLAccount.Cash());
end;

var
ContosoGLAccount: Codeunit "Contoso GL Account";
DepreciationEquipmentLbl: Label 'Depreciation, Equipment', MaxLength = 100;
Expand Down Expand Up @@ -118,4 +130,9 @@ codeunit 4773 "Create FA GL Account"
local procedure OnAfterAddGLAccountsForLocalization()
begin
end;

[IntegrationEvent(false, false)]
local procedure OnBeforeGetCashAccountForFixedAssetAcquisition(var GLAccountNo: Code[20])
begin
end;
}
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 5614 "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