diff --git a/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Sustainability/1.Setup Data/CreateSustainJnlSetup.Codeunit.al b/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Sustainability/1.Setup Data/CreateSustainJnlSetup.Codeunit.al deleted file mode 100644 index 2407882544..0000000000 --- a/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Sustainability/1.Setup Data/CreateSustainJnlSetup.Codeunit.al +++ /dev/null @@ -1,109 +0,0 @@ -codeunit 5217 "Create Sustain. Jnl. Setup" -{ - InherentEntitlements = X; - InherentPermissions = X; - - trigger OnRun() - begin - CreateJournalTemplate(); - CreateJournalBatch(); - end; - - local procedure CreateJournalTemplate() - var - ContosoSustainability: Codeunit "Contoso Sustainability"; - begin - ContosoSustainability.InsertSustainabilityJournalTemplate(GeneralTemplate(), GeneralTemplateDescriptionLbl, false); - ContosoSustainability.InsertSustainabilityJournalTemplate(RecurringTemplate(), RecurringTemplateDescriptionLbl, true); - end; - - local procedure CreateJournalBatch() - var - ContosoSustainability: Codeunit "Contoso Sustainability"; - SustainabilitySetup: Codeunit "Create Sustainability Setup"; - SustainabilityNoSeries: Codeunit "Create Sustain. No Series"; - begin - ContosoSustainability.InsertSustainabilityJournalBatch(GeneralTemplate(), DefaultBatch(), DefaultBatchDescriptionLbl, SustainabilityNoSeries.JournalNoSeries(), Enum::"Emission Scope"::" ", SustainabilitySetup.SustainabilitySourceCode()); - ContosoSustainability.InsertSustainabilityJournalBatch(RecurringTemplate(), RecurringDefaultBatch(), RecurringDefaultBatchDescriptionLbl, SustainabilityNoSeries.RecurringJournalNoSeries(), Enum::"Emission Scope"::" ", SustainabilitySetup.SustainabilitySourceCode()); - - ContosoSustainability.InsertSustainabilityJournalBatch(GeneralTemplate(), Scope1Batch(), Scope1BatchDescriptionLbl, SustainabilityNoSeries.JournalNoSeries(), Enum::"Emission Scope"::"Scope 1", SustainabilitySetup.SustainabilitySourceCode()); - ContosoSustainability.InsertSustainabilityJournalBatch(GeneralTemplate(), Scope2Batch(), Scope2BatchDescriptionLbl, SustainabilityNoSeries.JournalNoSeries(), Enum::"Emission Scope"::"Scope 2", SustainabilitySetup.SustainabilitySourceCode()); - ContosoSustainability.InsertSustainabilityJournalBatch(GeneralTemplate(), Scope3Batch(), Scope3BatchDescriptionLbl, SustainabilityNoSeries.JournalNoSeries(), Enum::"Emission Scope"::"Scope 3", SustainabilitySetup.SustainabilitySourceCode()); - - ContosoSustainability.InsertSustainabilityJournalBatch(RecurringTemplate(), Scope1RecurringBatch(), Scope1RecurringBatchDescriptionLbl, SustainabilityNoSeries.RecurringJournalNoSeries(), Enum::"Emission Scope"::"Scope 1", SustainabilitySetup.SustainabilitySourceCode()); - ContosoSustainability.InsertSustainabilityJournalBatch(RecurringTemplate(), Scope2RecurringBatch(), Scope2RecurringBatchDescriptionLbl, SustainabilityNoSeries.RecurringJournalNoSeries(), Enum::"Emission Scope"::"Scope 2", SustainabilitySetup.SustainabilitySourceCode()); - ContosoSustainability.InsertSustainabilityJournalBatch(RecurringTemplate(), Scope3RecurringBatch(), Scope3RecurringBatchDescriptionLbl, SustainabilityNoSeries.RecurringJournalNoSeries(), Enum::"Emission Scope"::"Scope 3", SustainabilitySetup.SustainabilitySourceCode()); - end; - - procedure GeneralTemplate(): Code[10] - begin - exit(GeneralTemplateTok); - end; - - procedure RecurringTemplate(): Code[10] - begin - exit(RecurringTemplateTok); - end; - - procedure DefaultBatch(): Code[10] - begin - exit(DefaultBatchTok); - end; - - procedure RecurringDefaultBatch(): Code[10] - begin - exit(RecurringDefaultBatchTok); - end; - - procedure Scope1Batch(): Code[10] - begin - exit(Scope1BatchTok); - end; - - procedure Scope2Batch(): Code[10] - begin - exit(Scope2BatchTok); - end; - - procedure Scope3Batch(): Code[10] - begin - exit(Scope3BatchTok); - end; - - procedure Scope1RecurringBatch(): Code[10] - begin - exit(Scope1RecurringBatchTok); - end; - - procedure Scope2RecurringBatch(): Code[10] - begin - exit(Scope2RecurringBatchTok); - end; - - procedure Scope3RecurringBatch(): Code[10] - begin - exit(Scope3RecurringBatchTok); - end; - - var - GeneralTemplateTok: Label 'GENERAL', MaxLength = 10; - GeneralTemplateDescriptionLbl: Label 'General Emission', MaxLength = 80; - RecurringTemplateTok: Label 'RECURRING', MaxLength = 10; - RecurringTemplateDescriptionLbl: Label 'Recurring Emission', MaxLength = 80; - DefaultBatchTok: Label 'DEFAULT', MaxLength = 10; - DefaultBatchDescriptionLbl: Label 'Default Sustainability Journal Batch', MaxLength = 100; - RecurringDefaultBatchTok: Label 'DEFAULT-RC', MaxLength = 10; - RecurringDefaultBatchDescriptionLbl: Label 'Default Recurring Sustainability Journal Batch', MaxLength = 100; - Scope1BatchTok: Label 'SCOPE1', MaxLength = 10; - Scope1BatchDescriptionLbl: Label 'Scope 1 Sustainability Journal Batch', MaxLength = 100; - Scope2BatchTok: Label 'SCOPE2', MaxLength = 10; - Scope2BatchDescriptionLbl: Label 'Scope 2 Sustainability Journal Batch', MaxLength = 100; - Scope3BatchTok: Label 'SCOPE3', MaxLength = 10; - Scope3BatchDescriptionLbl: Label 'Scope 3 Sustainability Journal Batch', MaxLength = 100; - Scope1RecurringBatchTok: Label 'SCOPE1-RC', MaxLength = 10; - Scope1RecurringBatchDescriptionLbl: Label 'Scope 1 Recurring Sustainability Journal Batch', MaxLength = 100; - Scope2RecurringBatchTok: Label 'SCOPE2-RC', MaxLength = 10; - Scope2RecurringBatchDescriptionLbl: Label 'Scope 2 Recurring Sustainability Journal Batch', MaxLength = 100; - Scope3RecurringBatchTok: Label 'SCOPE3-RC', MaxLength = 10; - Scope3RecurringBatchDescriptionLbl: Label 'Scope 3 Recurring Sustainability Journal Batch', MaxLength = 100; -} \ No newline at end of file diff --git a/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Sustainability/1.Setup Data/CreateSustainNoSeries.Codeunit.al b/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Sustainability/1.Setup Data/CreateSustainNoSeries.Codeunit.al deleted file mode 100644 index eddcbb107d..0000000000 --- a/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Sustainability/1.Setup Data/CreateSustainNoSeries.Codeunit.al +++ /dev/null @@ -1,33 +0,0 @@ -codeunit 5220 "Create Sustain. No Series" -{ - InherentEntitlements = X; - InherentPermissions = X; - - trigger OnRun() - var - ContosoNoSeries: Codeunit "Contoso No Series"; - begin - ContosoNoSeries.InsertNoSeries(JournalNoSeries(), SustainabilityJournalNoSeriesDescriptionTok, JournalStartingNoLbl, JournalEndingNoLbl, '', '', 1, Enum::"No. Series Implementation"::Normal, true); - ContosoNoSeries.InsertNoSeries(RecurringJournalNoSeries(), RecurringJournalNoSeriesDescriptionTok, RecurringJournalStartingNoLbl, RecurringJournalEndingNoLbl, '', '', 1, Enum::"No. Series Implementation"::Normal, true); - end; - - procedure JournalNoSeries(): Code[20] - begin - exit(SustainabilityJournalNoSeriesTok); - end; - - procedure RecurringJournalNoSeries(): Code[20] - begin - exit(RecurringJournalNoSeriesTok); - end; - - var - SustainabilityJournalNoSeriesTok: Label 'SUSTAIN-JNL', MaxLength = 20; - SustainabilityJournalNoSeriesDescriptionTok: Label 'Sustainability Journals', MaxLength = 100; - JournalStartingNoLbl: Label 'SJ00001', MaxLength = 20; - JournalEndingNoLbl: Label 'SJ99999', MaxLength = 20; - RecurringJournalNoSeriesTok: Label 'SUSTAIN-RCJNL', MaxLength = 20; - RecurringJournalNoSeriesDescriptionTok: Label 'Recurring Sustainability Journals', MaxLength = 100; - RecurringJournalStartingNoLbl: Label 'SRJ00001', MaxLength = 20; - RecurringJournalEndingNoLbl: Label 'SRJ99999', MaxLength = 20; -} \ No newline at end of file diff --git a/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Sustainability/1.Setup Data/CreateSustainSubcategory.Codeunit.al b/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Sustainability/1.Setup Data/CreateSustainSubcategory.Codeunit.al deleted file mode 100644 index 285f574310..0000000000 --- a/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Sustainability/1.Setup Data/CreateSustainSubcategory.Codeunit.al +++ /dev/null @@ -1,389 +0,0 @@ -codeunit 5214 "Create Sustain. Subcategory" -{ - InherentEntitlements = X; - InherentPermissions = X; - - trigger OnRun() - var - SustainabilityCategory: Codeunit "Create Sustainability Category"; - ContosoSustainability: Codeunit "Contoso Sustainability"; - begin - ContosoSustainability.InsertAccountSubcategory(SustainabilityCategory.CompanyCar(), CompanyCarMedium(), CompanyCarMediumLbl, 0.128, 0, 0, false); - ContosoSustainability.InsertAccountSubcategory(SustainabilityCategory.CompanyCar(), CompanyCarLarge(), CompanyCarLargeLbl, 0.149, 0, 0, false); - ContosoSustainability.InsertAccountSubcategory(SustainabilityCategory.CompanyCar(), CompanyCarPremium(), CompanyCarPremiumLbl, 0.177, 0, 0, false); - - ContosoSustainability.InsertAccountSubcategory(SustainabilityCategory.Fugitive(), Refrigerator(), RefrigeratorLbl, 0.24388, 0, 0, false); - ContosoSustainability.InsertAccountSubcategory(SustainabilityCategory.Fugitive(), AirConditionerSmall(), AirConditionerSmallLbl, 0.8452, 0, 0, false); - ContosoSustainability.InsertAccountSubcategory(SustainabilityCategory.Fugitive(), AirConditionerLarge(), AirConditionerLargeLbl, 1.3217, 0, 0, false); - - ContosoSustainability.InsertAccountSubcategory(SustainabilityCategory.Hotel(), Hotel3Star(), Hotel3StarLbl, 15.6, 0, 0, false); - ContosoSustainability.InsertAccountSubcategory(SustainabilityCategory.Hotel(), Hotel4Star(), Hotel4StarLbl, 24.22, 0, 0, false); - ContosoSustainability.InsertAccountSubcategory(SustainabilityCategory.Hotel(), Hotel4StarPlus(), Hotel4StarPlusLbl, 40.21, 0, 0, false); - - ContosoSustainability.InsertAccountSubcategory(SustainabilityCategory.MobileDistance(), UrbanTruck(), UrbanTruckLbl, 0.307, 0.00039, 0, false); - ContosoSustainability.InsertAccountSubcategory(SustainabilityCategory.MobileDistance(), LongHaulTruck(), LongHaulTruckLbl, 0.057, 0.00007, 0, false); - ContosoSustainability.InsertAccountSubcategory(SustainabilityCategory.MobileDistance(), Bus(), BusLbl, 1.3, 0.00166, 0, false); - ContosoSustainability.InsertAccountSubcategory(SustainabilityCategory.MobileDistance(), Rail(), RailLbl, 0.035, 0.00004, 0, false); - ContosoSustainability.InsertAccountSubcategory(SustainabilityCategory.MobileDistance(), AirContinentalEconomy(), AirContinentalEconomyLbl, 0.30038, 0.00037, 0, false); - ContosoSustainability.InsertAccountSubcategory(SustainabilityCategory.MobileDistance(), AirContinentalBusiness(), AirContinentalBusinessLbl, 0.44639, 0.00055, 0, false); - ContosoSustainability.InsertAccountSubcategory(SustainabilityCategory.MobileDistance(), AirIntercontinentalEconomy(), AirIntercontinentalEconomyLbl, 0.21872, 0.00027, 0, false); - ContosoSustainability.InsertAccountSubcategory(SustainabilityCategory.MobileDistance(), AirIntercontinentalPremiumEconomy(), AirIntercontinentalPremiumEconomyLbl, 0.32808, 0.0004, 0, false); - ContosoSustainability.InsertAccountSubcategory(SustainabilityCategory.MobileDistance(), AirIntercontinentalBusiness(), AirIntercontinentalBusinessLbl, 0.88856, 0.00109, 0, false); - - ContosoSustainability.InsertAccountSubcategory(SustainabilityCategory.MobileFuel(), Tractor(), TractorLbl, 2.6, 0.0032, 0, false); - ContosoSustainability.InsertAccountSubcategory(SustainabilityCategory.MobileFuel(), Forklift(), ForkliftLbl, 2.64, 0.0032, 0, false); - ContosoSustainability.InsertAccountSubcategory(SustainabilityCategory.MobileFuel(), Backhoe(), BackhoeLbl, 2.6391, 0.0032, 0, false); - - ContosoSustainability.InsertAccountSubcategory(SustainabilityCategory.PurchaseGoodsGL(), PurchasedGoodsPlastic(), PurchasedGoodsPlasticLbl, 0.3, 0, 0, false); - ContosoSustainability.InsertAccountSubcategory(SustainabilityCategory.PurchaseGoodsGL(), PurchasedGoodsAluminum(), PurchasedGoodsAluminumLbl, 0.5, 0, 0, false); - ContosoSustainability.InsertAccountSubcategory(SustainabilityCategory.PurchaseGoodsGL(), PurchasedGoodsSteel(), PurchasedGoodsSteelLbl, 0.2, 0, 0, false); - ContosoSustainability.InsertAccountSubcategory(SustainabilityCategory.PurchaseGoodsGL(), PurchasedGoodsGlass(), PurchasedGoodsGlassLbl, 0.4, 0, 0, false); - ContosoSustainability.InsertAccountSubcategory(SustainabilityCategory.PurchaseGoodsGL(), PurchasedServices(), PurchasedServicesLbl, 0.15, 0, 0, false); - - ContosoSustainability.InsertAccountSubcategory(SustainabilityCategory.RentalCar(), RentalCarMedium(), RentalCarMediumLbl, 0.197, 0, 0, false); - - ContosoSustainability.InsertAccountSubcategory(SustainabilityCategory.SoldProductEnd(), SoldProductEnd(), SoldProductEndLbl, 0.25, 0, 0, false); - ContosoSustainability.InsertAccountSubcategory(SustainabilityCategory.SoldProductProcess(), SoldProductProcess(), SoldProductProcessLbl, 0.28, 0, 0, false); - ContosoSustainability.InsertAccountSubcategory(SustainabilityCategory.SoldProductUse(), SoldProductUse(), SoldProductUseLbl, 0.31, 0, 0, false); - - ContosoSustainability.InsertAccountSubcategory(SustainabilityCategory.Stationary(), Boiler(), BoilerLbl, 7.21616, 0.136, 0.0136, false); - ContosoSustainability.InsertAccountSubcategory(SustainabilityCategory.Stationary(), HeaterSmall(), HeaterSmallLbl, 3.99675, 0.4499, 0.06544, false); - ContosoSustainability.InsertAccountSubcategory(SustainabilityCategory.Stationary(), HeaterMedium(), HeaterMediumLbl, 7.9935, 0.8998, 0.13088, false); - ContosoSustainability.InsertAccountSubcategory(SustainabilityCategory.Stationary(), HeaterLarge(), HeaterLargeLbl, 11.903, 1.3497, 0.19632, false); - ContosoSustainability.InsertAccountSubcategory(SustainabilityCategory.Stationary(), Thermal(), ThermalLbl, 0.17704, 0.01088, 0.00021, true); - - ContosoSustainability.InsertAccountSubcategory(SustainabilityCategory.ExternalTransportDistance(), ExternalTransportDistance(), ExternalTransportDistanceLbl, 1.425, 0.00036, 0.00014, false); - - ContosoSustainability.InsertAccountSubcategory(SustainabilityCategory.InternalTransportDistance(), InternalTransportDistance(), InternalTransportDistanceLbl, 0.986, 0.00031, 0.00011, false); - - ContosoSustainability.InsertAccountSubcategory(SustainabilityCategory.UtilityElectric(), ElectricityNuclear(), ElectricityNuclearLbl, 0.087, 0, 0, false); - ContosoSustainability.InsertAccountSubcategory(SustainabilityCategory.UtilityElectric(), ElectricityCoal(), ElectricityCoalLbl, 0.3834, 0, 0, false); - ContosoSustainability.InsertAccountSubcategory(SustainabilityCategory.UtilityElectric(), ElectricityGreen(), ElectricityGreenLbl, 0, 0, 0, true); - - ContosoSustainability.InsertAccountSubcategory(SustainabilityCategory.UtilityHeat(), Heat(), HeatLbl, 296.85635, 0, 0, false); - - ContosoSustainability.InsertAccountSubcategory(SustainabilityCategory.UtilitySteam(), SteamSupplier(), SteamSupplierLbl, 2488, 0, 0, false); - - ContosoSustainability.InsertAccountSubcategory(SustainabilityCategory.Waste(), WasteLandFillOrganic(), WasteLandfillOrganicLbl, 0.47681, 0.05002, 0, false); - ContosoSustainability.InsertAccountSubcategory(SustainabilityCategory.Waste(), WasteLandFillPlastic(), WasteLandfillPlasticLbl, 1.80842, 0.07126, 0, false); - ContosoSustainability.InsertAccountSubcategory(SustainabilityCategory.Waste(), WasteRecycled(), WasteRecycledLbl, 0.28906, 0.02209, 0, false); - end; - - procedure CompanyCarMedium(): Code[20] - begin - exit(CompanyCarMediumTok); - end; - - procedure CompanyCarLarge(): Code[20] - begin - exit(CompanyCarLargeTok); - end; - - procedure CompanyCarPremium(): Code[20] - begin - exit(CompanyCarPremiumTok); - end; - - procedure Refrigerator(): Code[20] - begin - exit(RefrigeratorTok); - end; - - procedure AirConditionerSmall(): Code[20] - begin - exit(AirConditionerSmallTok); - end; - - procedure AirConditionerLarge(): Code[20] - begin - exit(AirConditionerLargeTok); - end; - - procedure Hotel3Star(): Code[20] - begin - exit(Hotel3StarTok); - end; - - procedure Hotel4Star(): Code[20] - begin - exit(Hotel4StarTok); - end; - - procedure Hotel4StarPlus(): Code[20] - begin - exit(Hotel4StarPlusTok); - end; - - procedure UrbanTruck(): Code[20] - begin - exit(UrbanTruckTok); - end; - - procedure LongHaulTruck(): Code[20] - begin - exit(LongHaulTruckTok); - end; - - procedure Bus(): Code[20] - begin - exit(BusTok); - end; - - procedure Rail(): Code[20] - begin - exit(RailTok); - end; - - procedure AirContinentalEconomy(): Code[20] - begin - exit(AirContinentalEconomyTok); - end; - - procedure AirContinentalBusiness(): Code[20] - begin - exit(AirContinentalBusinessTok); - end; - - procedure AirIntercontinentalEconomy(): Code[20] - begin - exit(AirIntercontinentalEconomyTok); - end; - - procedure AirIntercontinentalPremiumEconomy(): Code[20] - begin - exit(AirIntercontinentalPremiumEconomyTok); - end; - - procedure AirIntercontinentalBusiness(): Code[20] - begin - exit(AirIntercontinentalBusinessTok); - end; - - procedure Tractor(): Code[20] - begin - exit(TractorTok); - end; - - procedure Forklift(): Code[20] - begin - exit(ForkliftTok); - end; - - procedure Backhoe(): Code[20] - begin - exit(BackhoeTok); - end; - - procedure PurchasedGoodsPlastic(): Code[20] - begin - exit(PurchasedGoodsPlasticTok); - end; - - procedure PurchasedGoodsAluminum(): Code[20] - begin - exit(PurchasedGoodsAluminumTok); - end; - - procedure PurchasedGoodsSteel(): Code[20] - begin - exit(PurchasedGoodsSteelTok); - end; - - procedure PurchasedGoodsGlass(): Code[20] - begin - exit(PurchasedGoodsGlassTok); - end; - - procedure PurchasedServices(): Code[20] - begin - exit(PurchasedServicesTok); - end; - - procedure RentalCarMedium(): Code[20] - begin - exit(RentalCarMediumTok); - end; - - procedure SoldProductEnd(): Code[20] - begin - exit(SoldProductEndTok); - end; - - procedure SoldProductProcess(): Code[20] - begin - exit(SoldProductProcessTok); - end; - - procedure SoldProductUse(): Code[20] - begin - exit(SoldProductUseTok); - end; - - procedure Boiler(): Code[20] - begin - exit(BoilerTok); - end; - - procedure HeaterSmall(): Code[20] - begin - exit(HeaterSmallTok); - end; - - procedure HeaterMedium(): Code[20] - begin - exit(HeaterMediumTok); - end; - - procedure HeaterLarge(): Code[20] - begin - exit(HeaterLargeTok); - end; - - procedure Thermal(): Code[20] - begin - exit(ThermalTok); - end; - - procedure ExternalTransportDistance(): Code[20] - begin - exit(ExternalTransportDistanceTok); - end; - - procedure InternalTransportDistance(): Code[20] - begin - exit(InternalTransportDistanceTok); - end; - - procedure ElectricityNuclear(): Code[20] - begin - exit(ElectricityNuclearTok); - end; - - procedure ElectricityCoal(): Code[20] - begin - exit(ElectricityCoalTok); - end; - - procedure ElectricityGreen(): Code[20] - begin - exit(ElectricityGreenTok); - end; - - procedure Heat(): Code[20] - begin - exit(HeatTok); - end; - - procedure SteamSupplier(): Code[20] - begin - exit(SteamSupplierTok); - end; - - - procedure WasteLandFillOrganic(): Code[20] - begin - exit(WasteLandfillOrganicTok); - end; - - procedure WasteLandFillPlastic(): Code[20] - begin - exit(WasteLandfillPlasticTok); - end; - - procedure WasteRecycled(): Code[20] - begin - exit(WasteRecycledTok); - end; - - var - CompanyCarMediumTok: Label 'COMPCAR-M', MaxLength = 20; - CompanyCarMediumLbl: Label 'Company Car - Medium', MaxLength = 100; - CompanyCarLargeTok: Label 'COMPCAR-L', MaxLength = 20; - CompanyCarLargeLbl: Label 'Company Car - Large', MaxLength = 100; - CompanyCarPremiumTok: Label 'COMPCAR-P', MaxLength = 20; - CompanyCarPremiumLbl: Label 'Company Car - Premium', MaxLength = 100; - RefrigeratorTok: Label 'REFRIG', MaxLength = 20; - RefrigeratorLbl: Label 'Refrigerators', MaxLength = 100; - AirConditionerSmallTok: Label 'AIRCS', MaxLength = 20; - AirConditionerSmallLbl: Label 'Airconditioner 24000BTU/Day', MaxLength = 100; - AirConditionerLargeTok: Label 'AIRCL', MaxLength = 20; - AirConditionerLargeLbl: Label 'Airconditioner 36000BTU/Day', MaxLength = 100; - Hotel3StarTok: Label 'HOTEL3STAR', MaxLength = 20; - Hotel3StarLbl: Label 'Hotel Stay 3 stars/Day', MaxLength = 100; - Hotel4StarTok: Label 'HOTEL4STAR', MaxLength = 20; - Hotel4StarLbl: Label 'Hotel Stay 4 stars/Day', MaxLength = 100; - Hotel4StarPlusTok: Label 'HOTEL4STAR+', MaxLength = 20; - Hotel4StarPlusLbl: Label 'Hotel Stay 4 stars Suite/Day', MaxLength = 100; - UrbanTruckTok: Label 'TRUCK-U', MaxLength = 20; - UrbanTruckLbl: Label 'Truck Urban /KM/T', MaxLength = 100; - LongHaulTruckTok: Label 'TRUCK-LH', MaxLength = 20; - LongHaulTruckLbl: Label 'Truck Long-haul trailer /KM/T', MaxLength = 100; - BusTok: Label 'BUS', MaxLength = 20; - BusLbl: Label 'Buses', MaxLength = 100; - RailTok: Label 'RAIL', MaxLength = 20; - RailLbl: Label 'Rail', MaxLength = 100; - AirContinentalEconomyTok: Label 'AIR-CONT-EC', MaxLength = 20; - AirContinentalEconomyLbl: Label 'Air Continental - Economy Class /KM', MaxLength = 100; - AirContinentalBusinessTok: Label 'AIR-CONT-BUS', MaxLength = 20; - AirContinentalBusinessLbl: Label 'Air Continental - Business Class /KM', MaxLength = 100; - AirIntercontinentalEconomyTok: Label 'AIR-INT-EC', MaxLength = 20; - AirIntercontinentalEconomyLbl: Label 'Air Intercontinental - Economy Class /KM', MaxLength = 100; - AirIntercontinentalPremiumEconomyTok: Label 'AIR-INT-PREM', MaxLength = 20; - AirIntercontinentalPremiumEconomyLbl: Label 'Air Intercontinental - Premium Economy /KM', MaxLength = 100; - AirIntercontinentalBusinessTok: Label 'AIR-INT-BUS', MaxLength = 20; - AirIntercontinentalBusinessLbl: Label 'Air Intercontinental - Business Class /KM', MaxLength = 100; - TractorTok: Label 'TRACTOR', MaxLength = 20; - TractorLbl: Label 'Tractors /L', MaxLength = 100; - ForkliftTok: Label 'FORKLIFT', MaxLength = 20; - ForkliftLbl: Label 'Forklifts /L', MaxLength = 100; - BackhoeTok: Label 'BACKHOE', MaxLength = 20; - BackhoeLbl: Label 'Backhoes /L', MaxLength = 100; - PurchasedGoodsPlasticTok: Label 'PURCHGDS-PL', MaxLength = 20; - PurchasedGoodsPlasticLbl: Label 'Purchased Goods - Plastic', MaxLength = 100; - PurchasedGoodsAluminumTok: Label 'PURCHGDS-AL', MaxLength = 20; - PurchasedGoodsAluminumLbl: Label 'Purchased Goods - Aluminum', MaxLength = 100; - PurchasedGoodsSteelTok: Label 'PURCHGDS-ST', MaxLength = 20; - PurchasedGoodsSteelLbl: Label 'Purchased Goods - Steel', MaxLength = 100; - PurchasedGoodsGlassTok: Label 'PURCHGDS-GL', MaxLength = 20; - PurchasedGoodsGlassLbl: Label 'Purchased Goods - Glass', MaxLength = 100; - PurchasedServicesTok: Label 'PURCHSERVC', MaxLength = 20; - PurchasedServicesLbl: Label 'Purchased Services', MaxLength = 100; - RentalCarMediumTok: Label 'RENTALCAR-M', MaxLength = 20; - RentalCarMediumLbl: Label 'Contoso Rental Car - Medium Car', MaxLength = 100; - SoldProductEndTok: Label 'SOLDPRODEND', MaxLength = 20; - SoldProductEndLbl: Label 'End of Life Treatment of Sold Products', MaxLength = 100; - SoldProductProcessTok: Label 'SOLDPRODPROC', MaxLength = 20; - SoldProductProcessLbl: Label 'Processing of Sold Products', MaxLength = 100; - SoldProductUseTok: Label 'SOLDPRODUSE', MaxLength = 20; - SoldProductUseLbl: Label 'Use of Sold Products', MaxLength = 100; - BoilerTok: Label 'BOILER', MaxLength = 20; - BoilerLbl: Label 'Boilers', MaxLength = 100; - HeaterSmallTok: Label 'HEATER12', MaxLength = 20; - HeaterSmallLbl: Label 'Heaters 12kW', MaxLength = 100; - HeaterMediumTok: Label 'HEATER24', MaxLength = 20; - HeaterMediumLbl: Label 'Heaters 24kW', MaxLength = 100; - HeaterLargeTok: Label 'HEATER36', MaxLength = 20; - HeaterLargeLbl: Label 'Heaters 36kW', MaxLength = 100; - ThermalTok: Label 'THERMAL', MaxLength = 20; - ThermalLbl: Label 'Thermal', MaxLength = 100; - ExternalTransportDistanceTok: Label 'TRANSP-EXT-DIST', MaxLength = 20; - ExternalTransportDistanceLbl: Label 'External Transport /KM', MaxLength = 100; - InternalTransportDistanceTok: Label 'TRANSP-INT-DIST', MaxLength = 20; - InternalTransportDistanceLbl: Label 'Inrnal Transport /KM', MaxLength = 100; - ElectricityNuclearTok: Label 'ELECTRIC-NUCL', MaxLength = 20; - ElectricityNuclearLbl: Label 'Electricity supplier - nuclear', MaxLength = 100; - ElectricityCoalTok: Label 'ELECTRIC-COAL', MaxLength = 20; - ElectricityCoalLbl: Label 'Electricity supplier - coal', MaxLength = 100; - ElectricityGreenTok: Label 'ELECTRIC-GREEN', MaxLength = 20; - ElectricityGreenLbl: Label 'Electricity supplier - solar/wind', MaxLength = 100; - HeatTok: Label 'HEAT', MaxLength = 20; - HeatLbl: Label 'Heat suppliers', MaxLength = 100; - SteamSupplierTok: Label 'STEAM', MaxLength = 20; - SteamSupplierLbl: Label 'Steam suppliers', MaxLength = 100; - WasteLandfillOrganicTok: Label 'WASTE-LFORG', MaxLength = 20; - WasteLandfillOrganicLbl: Label 'Landfill Organic Waste', MaxLength = 100; - WasteLandfillPlasticTok: Label 'WASTE-LFPLA', MaxLength = 20; - WasteLandfillPlasticLbl: Label 'Landfill Plastic Waste', MaxLength = 100; - WasteRecycledTok: Label 'WASTE-RC', MaxLength = 20; - WasteRecycledLbl: Label 'Recycled Waste', MaxLength = 100; -} \ No newline at end of file diff --git a/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Sustainability/1.Setup Data/CreateSustainabilityAccount.Codeunit.al b/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Sustainability/1.Setup Data/CreateSustainabilityAccount.Codeunit.al deleted file mode 100644 index 990e5c8c46..0000000000 --- a/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Sustainability/1.Setup Data/CreateSustainabilityAccount.Codeunit.al +++ /dev/null @@ -1,506 +0,0 @@ -codeunit 5215 "Create Sustainability Account" -{ - InherentEntitlements = X; - InherentPermissions = X; - - trigger OnRun() - var - SustainCategory: Codeunit "Create Sustainability Category"; - SustainSubcategory: Codeunit "Create Sustain. Subcategory"; - ContosoSustainability: Codeunit "Contoso Sustainability"; - SustainabilityAccountMgt: Codeunit "Sustainability Account Mgt."; - begin - ContosoSustainability.InsertSustainabilityAccount(GasEmissions(), GasEmissionsLbl, '', '', Enum::"Sustainability Account Type"::"Begin-Total", '', false); - ContosoSustainability.InsertSustainabilityAccount(Scope1(), Scope1BeginTotalLbl, '', '', Enum::"Sustainability Account Type"::"Begin-Total", '', false); - ContosoSustainability.InsertSustainabilityAccount(StationaryCombustion(), StationaryCombustionLbl, '', '', Enum::"Sustainability Account Type"::"Begin-Total", '', false); - ContosoSustainability.InsertSustainabilityAccount(Boilers(), BoilersLbl, SustainCategory.Stationary(), SustainSubcategory.Boiler(), Enum::"Sustainability Account Type"::Posting, '', true); - ContosoSustainability.InsertSustainabilityAccount(HeatersSmall(), HeatersSmallLbl, SustainCategory.Stationary(), SustainSubcategory.HeaterSmall(), Enum::"Sustainability Account Type"::Posting, '', true); - ContosoSustainability.InsertSustainabilityAccount(HeatersMedium(), HeatersMediumLbl, SustainCategory.Stationary(), SustainSubcategory.HeaterMedium(), Enum::"Sustainability Account Type"::Posting, '', true); - ContosoSustainability.InsertSustainabilityAccount(HeatersLarge(), HeatersLargeLbl, SustainCategory.Stationary(), SustainSubcategory.HeaterLarge(), Enum::"Sustainability Account Type"::Posting, '', true); - ContosoSustainability.InsertSustainabilityAccount(ThermalOxidizers(), ThermalOxidizersLbl, SustainCategory.Stationary(), SustainSubcategory.Thermal(), Enum::"Sustainability Account Type"::Posting, '', true); - ContosoSustainability.InsertSustainabilityAccount(TotalStationaryCombustion(), TotalStationaryCombustionLbl, '', '', Enum::"Sustainability Account Type"::"End-Total", StationaryCombustion() + '..' + TotalStationaryCombustion(), false); - - ContosoSustainability.InsertSustainabilityAccount(MobileCombustion(), MobileCombustionLbl, '', '', Enum::"Sustainability Account Type"::"Begin-Total", '', false); - ContosoSustainability.InsertSustainabilityAccount(OnRoadVehicleUrbanTrucks(), OnRoadVehiclesUrbanLbl, SustainCategory.MobileDistance(), SustainSubcategory.UrbanTruck(), Enum::"Sustainability Account Type"::Posting, '', true); - ContosoSustainability.InsertSustainabilityAccount(OnRoadVehiclesLongHaulTrucks(), OnRoadVehiclesLongHaulLbl, SustainCategory.MobileDistance(), SustainSubcategory.LongHaulTruck(), Enum::"Sustainability Account Type"::Posting, '', true); - ContosoSustainability.InsertSustainabilityAccount(OnRoadVehiclesBuses(), OnRoadVehiclesBusesLbl, SustainCategory.MobileDistance(), SustainSubcategory.Bus(), Enum::"Sustainability Account Type"::Posting, '', true); - ContosoSustainability.InsertSustainabilityAccount(NonRoadVehiclesTractors(), NonRoadVehiclesTractorsLbl, SustainCategory.MobileFuel(), SustainSubcategory.Tractor(), Enum::"Sustainability Account Type"::Posting, '', true); - ContosoSustainability.InsertSustainabilityAccount(NonRoadVehiclesForklifts(), NonRoadVehiclesForkliftsLbl, SustainCategory.MobileFuel(), SustainSubcategory.Forklift(), Enum::"Sustainability Account Type"::Posting, '', true); - ContosoSustainability.InsertSustainabilityAccount(NonRoadVehiclesBackhoes(), NonRoadVehiclesBackhoesLbl, SustainCategory.MobileFuel(), SustainSubcategory.Backhoe(), Enum::"Sustainability Account Type"::Posting, '', true); - ContosoSustainability.InsertSustainabilityAccount(Rail(), RailLbl, SustainCategory.MobileDistance(), SustainSubcategory.Rail(), Enum::"Sustainability Account Type"::Posting, '', true); - ContosoSustainability.InsertSustainabilityAccount(AirContinentalEconomy(), AirContinentalEconomyLbl, SustainCategory.MobileDistance(), SustainSubcategory.AirContinentalEconomy(), Enum::"Sustainability Account Type"::Posting, '', true); - ContosoSustainability.InsertSustainabilityAccount(AirContinentalBusiness(), AirContinentalBusinessLbl, SustainCategory.MobileDistance(), SustainSubcategory.AirContinentalBusiness(), Enum::"Sustainability Account Type"::Posting, '', true); - ContosoSustainability.InsertSustainabilityAccount(AirIntercontinentalEconomy(), AirIntercontinentalEconomyLbl, SustainCategory.MobileDistance(), SustainSubcategory.AirIntercontinentalEconomy(), Enum::"Sustainability Account Type"::Posting, '', true); - ContosoSustainability.InsertSustainabilityAccount(AirIntercontinentalPremiumEconomy(), AirIntercontinentalPremiumEconomyLbl, SustainCategory.MobileDistance(), SustainSubcategory.AirIntercontinentalPremiumEconomy(), Enum::"Sustainability Account Type"::Posting, '', true); - ContosoSustainability.InsertSustainabilityAccount(AirIntercontinentalBusiness(), AirIntercontinentalBusinessLbl, SustainCategory.MobileDistance(), SustainSubcategory.AirIntercontinentalBusiness(), Enum::"Sustainability Account Type"::Posting, '', true); - ContosoSustainability.InsertSustainabilityAccount(TotalMobileCombustion(), TotalMobileCombustionLbl, '', '', Enum::"Sustainability Account Type"::"End-Total", MobileCombustion() + '..' + TotalMobileCombustion(), false); - - ContosoSustainability.InsertSustainabilityAccount(FugitiveEmission(), FugitiveEmissionsLbl, '', '', Enum::"Sustainability Account Type"::"Begin-Total", '', false); - ContosoSustainability.InsertSustainabilityAccount(Refrigerators(), RefrigeratorsLbl, SustainCategory.Fugitive(), SustainSubcategory.Refrigerator(), Enum::"Sustainability Account Type"::Posting, '', true); - ContosoSustainability.InsertSustainabilityAccount(AirConditionEquipments24kW(), AirConditionEquipments24kWLbl, SustainCategory.Fugitive(), SustainSubcategory.AirConditionerSmall(), Enum::"Sustainability Account Type"::Posting, '', true); - ContosoSustainability.InsertSustainabilityAccount(AirConditionEquipments36kW(), AirConditionEquipments36kWLbl, SustainCategory.Fugitive(), SustainSubcategory.AirConditionerLarge(), Enum::"Sustainability Account Type"::Posting, '', true); - ContosoSustainability.InsertSustainabilityAccount(TotalFugitiveEmissions(), TotalFugitiveEmissionsLbl, '', '', Enum::"Sustainability Account Type"::"End-Total", FugitiveEmission() + '..' + TotalFugitiveEmissions(), false); - - ContosoSustainability.InsertSustainabilityAccount(TotalScope1(), TotalScope1DirectEmissionLbl, '', '', Enum::"Sustainability Account Type"::"End-Total", Scope1() + '..' + TotalScope1(), false); - - ContosoSustainability.InsertSustainabilityAccount(Scope2(), Scope2BeginTotalLbl, '', '', Enum::"Sustainability Account Type"::"Begin-Total", '', false); - ContosoSustainability.InsertSustainabilityAccount(UpstreamActivityScope2(), UpstreamActivitiesLbl, '', '', Enum::"Sustainability Account Type"::"Begin-Total", '', false); - ContosoSustainability.InsertSustainabilityAccount(PurchasedElectricityContosoPowerPlant(), PurchasedElectricityContosoPowerPlantLbl, SustainCategory.UtilityElectric(), SustainSubcategory.ElectricityNuclear(), Enum::"Sustainability Account Type"::Posting, '', true); - ContosoSustainability.InsertSustainabilityAccount(PurchasedElectricityWideWorldImporters(), PurchasedElectricityWideWorldImportersLbl, SustainCategory.UtilityElectric(), SustainSubcategory.ElectricityCoal(), Enum::"Sustainability Account Type"::Posting, '', true); - ContosoSustainability.InsertSustainabilityAccount(PurchasedElectricityGreenTariffEnergy(), PurchasedElectricityGreenTariffEnergyLbl, SustainCategory.UtilityElectric(), SustainSubcategory.ElectricityGreen(), Enum::"Sustainability Account Type"::Posting, '', true); - ContosoSustainability.InsertSustainabilityAccount(SteamFabrikamInc(), SteamFabrikamIncLbl, SustainCategory.UtilitySteam(), SustainSubcategory.SteamSupplier(), Enum::"Sustainability Account Type"::Posting, '', true); - ContosoSustainability.InsertSustainabilityAccount(HeatingFabrikamInc(), HeatingFabrikamIncLbl, SustainCategory.UtilityHeat(), SustainSubcategory.Heat(), Enum::"Sustainability Account Type"::Posting, '', true); - ContosoSustainability.InsertSustainabilityAccount(TotalUpStreamActivityScope2(), TotalUpStreamActivitiesLbl, '', '', Enum::"Sustainability Account Type"::"End-Total", UpstreamActivityScope2() + '..' + TotalUpStreamActivityScope2(), false); - ContosoSustainability.InsertSustainabilityAccount(TotalScope2(), TotalScope2IndirectEmissionLbl, '', '', Enum::"Sustainability Account Type"::"End-Total", Scope2() + '..' + TotalScope2(), false); - - ContosoSustainability.InsertSustainabilityAccount(Scope3(), Scope3BeginTotalLbl, '', '', Enum::"Sustainability Account Type"::"Begin-Total", '', false); - ContosoSustainability.InsertSustainabilityAccount(UpstreamActivityScope3(), UpstreamActivitiesLbl, '', '', Enum::"Sustainability Account Type"::"Begin-Total", '', false); - ContosoSustainability.InsertSustainabilityAccount(PurchasedGoodsPlastic(), PurchasedGoodsPlasticLbl, SustainCategory.PurchaseGoodsGL(), SustainSubcategory.PurchasedGoodsPlastic(), Enum::"Sustainability Account Type"::Posting, '', true); - ContosoSustainability.InsertSustainabilityAccount(PurchasedGoodsAluminum(), PurchasedGoodsAluminumLbl, SustainCategory.PurchaseGoodsGL(), SustainSubcategory.PurchasedGoodsAluminum(), Enum::"Sustainability Account Type"::Posting, '', true); - ContosoSustainability.InsertSustainabilityAccount(PurchasedGoodsSteel(), PurchasedGoodsSteelLbl, SustainCategory.PurchaseGoodsGL(), SustainSubcategory.PurchasedGoodsSteel(), Enum::"Sustainability Account Type"::Posting, '', true); - ContosoSustainability.InsertSustainabilityAccount(PurchasedGoodsGlass(), PurchasedGoodsGlassLbl, SustainCategory.PurchaseGoodsGL(), SustainSubcategory.PurchasedGoodsGlass(), Enum::"Sustainability Account Type"::Posting, '', true); - ContosoSustainability.InsertSustainabilityAccount(PurchasedServices(), PurchasedServicesLbl, SustainCategory.PurchaseGoodsGL(), SustainSubcategory.PurchasedServices(), Enum::"Sustainability Account Type"::Posting, '', true); - - ContosoSustainability.InsertSustainabilityAccount(ExternalTransportation(), ExternalTransportationLbl, SustainCategory.ExternalTransportDistance(), SustainSubcategory.ExternalTransportDistance(), Enum::"Sustainability Account Type"::Posting, '', true); - ContosoSustainability.InsertSustainabilityAccount(TransportationWithOwnTrucks(), TransportationWithOwnTrucksLbl, SustainCategory.InternalTransportDistance(), SustainSubcategory.InternalTransportDistance(), Enum::"Sustainability Account Type"::Posting, '', true); - - ContosoSustainability.InsertSustainabilityAccount(WastePlasticGeneratedInOperation(), WastePlasticGeneratedInOperationLbl, SustainCategory.Waste(), SustainSubcategory.WasteLandFillOrganic(), Enum::"Sustainability Account Type"::Posting, '', true); - ContosoSustainability.InsertSustainabilityAccount(WasteOrganicGeneratedInOperation(), WasteOrganicGeneratedInOperationLbl, SustainCategory.Waste(), SustainSubcategory.WasteLandFillPlastic(), Enum::"Sustainability Account Type"::Posting, '', true); - ContosoSustainability.InsertSustainabilityAccount(RecycledWasteGeneratedInOperation(), RecycledWasteGeneratedInOperationLbl, SustainCategory.Waste(), SustainSubcategory.WasteRecycled(), Enum::"Sustainability Account Type"::Posting, '', true); - ContosoSustainability.InsertSustainabilityAccount(TotalUpstreamActivityScope3(), TotalUpstreamActivitiesLbl, '', '', Enum::"Sustainability Account Type"::"End-Total", UpstreamActivityScope3() + '..' + TotalUpstreamActivityScope3(), false); - - ContosoSustainability.InsertSustainabilityAccount(DownstreamActivityScope3(), DownStreamActivitiesLbl, '', '', Enum::"Sustainability Account Type"::"Begin-Total", '', false); - ContosoSustainability.InsertSustainabilityAccount(ProcessingOfSoldProducts(), ProcessingOfSoldProductsLbl, SustainCategory.SoldProductProcess(), SustainSubcategory.SoldProductProcess(), Enum::"Sustainability Account Type"::Posting, '', true); - ContosoSustainability.InsertSustainabilityAccount(UseOfSoldProducts(), UseOfSoldProductsLbl, SustainCategory.SoldProductUse(), SustainSubcategory.SoldProductUse(), Enum::"Sustainability Account Type"::Posting, '', true); - ContosoSustainability.InsertSustainabilityAccount(EndOfLifeTreatmentOfSoldProducts(), EndOfLifeTreatmentOfSoldProductsLbl, SustainCategory.SoldProductEnd(), SustainSubcategory.SoldProductEnd(), Enum::"Sustainability Account Type"::Posting, '', true); - ContosoSustainability.InsertSustainabilityAccount(ExternalTransportationScope3(), ExternalTransportationLbl, SustainCategory.ExternalTransportDistance(), SustainSubcategory.ExternalTransportDistance(), Enum::"Sustainability Account Type"::Posting, '', true); - ContosoSustainability.InsertSustainabilityAccount(TransportationWithOwnTrucksScope3(), TransportationWithOwnTrucksLbl, SustainCategory.InternalTransportDistance(), SustainSubcategory.InternalTransportDistance(), Enum::"Sustainability Account Type"::Posting, '', true); - ContosoSustainability.InsertSustainabilityAccount(TotalDownstreamActivityScope3(), TotalDownstreamActivitiesLbl, '', '', Enum::"Sustainability Account Type"::"End-Total", DownstreamActivityScope3() + '..' + TotalDownstreamActivityScope3(), false); - - ContosoSustainability.InsertSustainabilityAccount(BusinessTravelAndEmployeeCommuting(), BusinessTravelAndEmployeeCommutingLbl, '', '', Enum::"Sustainability Account Type"::"Begin-Total", '', false); - ContosoSustainability.InsertSustainabilityAccount(ContosoHotel3Stars(), ContosoHotel3StarsLbl, SustainCategory.Hotel(), SustainSubcategory.Hotel3Star(), Enum::"Sustainability Account Type"::Posting, '', true); - ContosoSustainability.InsertSustainabilityAccount(ContosoHotel4Stars(), ContosoHotel4StarsLbl, SustainCategory.Hotel(), SustainSubcategory.Hotel4Star(), Enum::"Sustainability Account Type"::Posting, '', true); - ContosoSustainability.InsertSustainabilityAccount(ContosoHotel4StarsJuniorSuite(), ContosoHotel4StarsJuniorSuiteLbl, SustainCategory.Hotel(), SustainSubcategory.Hotel4StarPlus(), Enum::"Sustainability Account Type"::Posting, '', true); - ContosoSustainability.InsertSustainabilityAccount(ContosoRentalCar(), ContosoRentalCarLbl, SustainCategory.RentalCar(), SustainSubcategory.RentalCarMedium(), Enum::"Sustainability Account Type"::Posting, '', true); - ContosoSustainability.InsertSustainabilityAccount(CompanyCarMediumSize(), CompanyCarMediumSizeLbl, SustainCategory.CompanyCar(), SustainSubcategory.CompanyCarMedium(), Enum::"Sustainability Account Type"::Posting, '', true); - ContosoSustainability.InsertSustainabilityAccount(CompanyCarLargeSize(), CompanyCarLargeSizeLbl, SustainCategory.CompanyCar(), SustainSubcategory.CompanyCarLarge(), Enum::"Sustainability Account Type"::Posting, '', true); - ContosoSustainability.InsertSustainabilityAccount(CompanyCarPremiumSize(), CompanyCarPremiumSizeLbl, SustainCategory.CompanyCar(), SustainSubcategory.CompanyCarPremium(), Enum::"Sustainability Account Type"::Posting, '', true); - ContosoSustainability.InsertSustainabilityAccount(TotalBusinessTravelAndEmployeeCommuting(), TotalBusinessTravelAndEmployeeCommutingLbl, '', '', Enum::"Sustainability Account Type"::"End-Total", BusinessTravelAndEmployeeCommuting() + '..' + TotalBusinessTravelAndEmployeeCommuting(), false); - ContosoSustainability.InsertSustainabilityAccount(TotalScope3(), TotalScope3IndirectEmissionLbl, '', '', Enum::"Sustainability Account Type"::"End-Total", Scope3() + '..' + TotalScope3(), false); - ContosoSustainability.InsertSustainabilityAccount(TotalGasEmissions(), TotalGasEmissionsLbl, '', '', Enum::"Sustainability Account Type"::"End-Total", GasEmissions() + '..' + TotalGasEmissions(), false); - - SustainabilityAccountMgt.IndentChartOfSustainabilityAccounts(true); - end; - - procedure GasEmissions(): Code[20] - begin - exit('10000'); - end; - - procedure Scope1(): Code[20] - begin - exit('11000'); - end; - - procedure StationaryCombustion(): Code[20] - begin - exit('11100'); - end; - - procedure Boilers(): Code[20] - begin - exit('11101'); - end; - - procedure HeatersSmall(): Code[20] - begin - exit('11102'); - end; - - procedure HeatersMedium(): Code[20] - begin - exit('11103'); - end; - - procedure HeatersLarge(): Code[20] - begin - exit('11104'); - end; - - procedure ThermalOxidizers(): Code[20] - begin - exit('11105'); - end; - - procedure TotalStationaryCombustion(): Code[20] - begin - exit('11199'); - end; - - procedure MobileCombustion(): Code[20] - begin - exit('11200'); - end; - - procedure OnRoadVehicleUrbanTrucks(): Code[20] - begin - exit('11201'); - end; - - procedure OnRoadVehiclesLongHaulTrucks(): Code[20] - begin - exit('11202'); - end; - - procedure OnRoadVehiclesBuses(): Code[20] - begin - exit('11203'); - end; - - procedure NonRoadVehiclesTractors(): Code[20] - begin - exit('11204'); - end; - - procedure NonRoadVehiclesForklifts(): Code[20] - begin - exit('11205'); - end; - - procedure NonRoadVehiclesBackhoes(): Code[20] - begin - exit('11206'); - end; - - procedure Rail(): Code[20] - begin - exit('11207'); - end; - - procedure AirContinentalEconomy(): Code[20] - begin - exit('11210'); - end; - - procedure AirContinentalBusiness(): Code[20] - begin - exit('11211'); - end; - - procedure AirIntercontinentalEconomy(): Code[20] - begin - exit('11212'); - end; - - procedure AirIntercontinentalPremiumEconomy(): Code[20] - begin - exit('11213'); - end; - - procedure AirIntercontinentalBusiness(): Code[20] - begin - exit('11214'); - end; - - procedure TotalMobileCombustion(): Code[20] - begin - exit('11299'); - end; - - procedure FugitiveEmission(): Code[20] - begin - exit('11300'); - end; - - procedure Refrigerators(): Code[20] - begin - exit('11301'); - end; - - procedure AirConditionEquipments24kW(): Code[20] - begin - exit('11302'); - end; - - procedure AirConditionEquipments36kW(): Code[20] - begin - exit('11303'); - end; - - procedure TotalFugitiveEmissions(): Code[20] - begin - exit('11399'); - end; - - procedure TotalScope1(): Code[20] - begin - exit('11999'); - end; - - procedure Scope2(): Code[20] - begin - exit('12000'); - end; - - procedure UpstreamActivityScope2(): Code[20] - begin - exit('12100'); - end; - - procedure PurchasedElectricityContosoPowerPlant(): Code[20] - begin - exit('12101'); - end; - - procedure PurchasedElectricityWideWorldImporters(): Code[20] - begin - exit('12102'); - end; - - procedure PurchasedElectricityGreenTariffEnergy(): Code[20] - begin - exit('12103'); - end; - - procedure SteamFabrikamInc(): Code[20] - begin - exit('12104'); - end; - - procedure HeatingFabrikamInc(): Code[20] - begin - exit('12105'); - end; - - procedure TotalUpStreamActivityScope2(): Code[20] - begin - exit('12199'); - end; - - procedure TotalScope2(): Code[20] - begin - exit('12999'); - end; - - procedure Scope3(): Code[20] - begin - exit('13000'); - end; - - procedure UpstreamActivityScope3(): Code[20] - begin - exit('13100'); - end; - - procedure PurchasedGoodsPlastic(): Code[20] - begin - exit('13101'); - end; - - procedure PurchasedGoodsAluminum(): Code[20] - begin - exit('13102'); - end; - - procedure PurchasedGoodsSteel(): Code[20] - begin - exit('13103'); - end; - - procedure PurchasedGoodsGlass(): Code[20] - begin - exit('13104'); - end; - - procedure PurchasedServices(): Code[20] - begin - exit('13151'); - end; - - procedure ExternalTransportation(): Code[20] - begin - exit('13171'); - end; - - procedure TransportationWithOwnTrucks(): Code[20] - begin - exit('13172'); - end; - - procedure WastePlasticGeneratedInOperation(): Code[20] - begin - exit('13181'); - end; - - procedure WasteOrganicGeneratedInOperation(): Code[20] - begin - exit('13182'); - end; - - procedure RecycledWasteGeneratedInOperation(): Code[20] - begin - exit('13183'); - end; - - procedure TotalUpstreamActivityScope3(): Code[20] - begin - exit('13199'); - end; - - procedure DownstreamActivityScope3(): Code[20] - begin - exit('13200'); - end; - - procedure ProcessingOfSoldProducts(): Code[20] - begin - exit('13201'); - end; - - procedure UseOfSoldProducts(): Code[20] - begin - exit('13202'); - end; - - procedure EndOfLifeTreatmentOfSoldProducts(): Code[20] - begin - exit('13203'); - end; - - procedure ExternalTransportationScope3(): Code[20] - begin - exit('13211'); - end; - - procedure TransportationWithOwnTrucksScope3(): Code[20] - begin - exit('13212'); - end; - - procedure TotalDownstreamActivityScope3(): Code[20] - begin - exit('13299'); - end; - - procedure BusinessTravelAndEmployeeCommuting(): Code[20] - begin - exit('13300'); - end; - - procedure ContosoHotel3Stars(): Code[20] - begin - exit('13301'); - end; - - procedure ContosoHotel4Stars(): Code[20] - begin - exit('13302'); - end; - - procedure ContosoHotel4StarsJuniorSuite(): Code[20] - begin - exit('13303'); - end; - - procedure ContosoRentalCar(): Code[20] - begin - exit('13311'); - end; - - procedure CompanyCarMediumSize(): Code[20] - begin - exit('13321'); - end; - - procedure CompanyCarLargeSize(): Code[20] - begin - exit('13322'); - end; - - procedure CompanyCarPremiumSize(): Code[20] - begin - exit('13323'); - end; - - procedure TotalBusinessTravelAndEmployeeCommuting(): Code[20] - begin - exit('13399'); - end; - - procedure TotalScope3(): Code[20] - begin - exit('13999'); - end; - - procedure TotalGasEmissions(): Code[20] - begin - exit('19999'); - end; - - var - GasEmissionsLbl: Label 'Gas Emissions', MaxLength = 100; - Scope1BeginTotalLbl: Label 'Scope 1 - Direct Emission', MaxLength = 100; - StationaryCombustionLbl: Label 'Stationary Combustion', MaxLength = 100; - BoilersLbl: Label 'Boilers', MaxLength = 100; - HeatersSmallLbl: Label 'Heaters 12kW', MaxLength = 100; - HeatersMediumLbl: Label 'Heaters 24kW', MaxLength = 100; - HeatersLargeLbl: Label 'Heaters 36kW', MaxLength = 100; - ThermalOxidizersLbl: Label 'Thermal Oxidizers', MaxLength = 100; - TotalStationaryCombustionLbl: Label 'Total, Stationary Combustion', MaxLength = 100; - MobileCombustionLbl: Label 'Mobile Combustion', MaxLength = 100; - OnRoadVehiclesUrbanLbl: Label 'OnRoad Vehicles (Trucks: urban)', MaxLength = 100; - OnRoadVehiclesLongHaulLbl: Label 'OnRoad Vehicles (Trucks: long-haul trailer)', MaxLength = 100; - OnRoadVehiclesBusesLbl: Label 'OnRoad Vehicles (Buses)', MaxLength = 100; - NonRoadVehiclesTractorsLbl: Label 'NonRoad Vehicles (Tractors)', MaxLength = 100; - NonRoadVehiclesForkliftsLbl: Label 'NonRoad Vehicles (Forklifts)', MaxLength = 100; - NonRoadVehiclesBackhoesLbl: Label 'NonRoad Vehicles (Backhoes)', MaxLength = 100; - RailLbl: Label 'Rail', MaxLength = 100; - AirContinentalEconomyLbl: Label 'Air Continental - Economy Class', MaxLength = 100; - AirContinentalBusinessLbl: Label 'Air Continental - Business Class', MaxLength = 100; - AirIntercontinentalEconomyLbl: Label 'Air Intercontinental - Economy Class', MaxLength = 100; - AirIntercontinentalPremiumEconomyLbl: Label 'Air Intercontinental - Premium Economy', MaxLength = 100; - AirIntercontinentalBusinessLbl: Label 'Air Intercontinental - Business Class', MaxLength = 100; - TotalMobileCombustionLbl: Label 'Total, Mobile Combustion', MaxLength = 100; - FugitiveEmissionsLbl: Label 'Fugitive Emissions', MaxLength = 100; - RefrigeratorsLbl: Label 'Refrigerators', MaxLength = 100; - AirConditionEquipments24kWLbl: Label 'Air-Condition Equipments 24,000 BTU', MaxLength = 100; - AirConditionEquipments36kWLbl: Label 'Air-Condition Equipments 36,000 BTU', MaxLength = 100; - TotalFugitiveEmissionsLbl: Label 'Total, Fugitive Emissions', MaxLength = 100; - TotalScope1DirectEmissionLbl: Label 'TOTAL SCOPE 1 - DIRECT EMISSION', MaxLength = 100; - Scope2BeginTotalLbl: Label 'Scope 2 - Indirect Emission', MaxLength = 100; - UpstreamActivitiesLbl: Label 'Upstream Activities', MaxLength = 100; - PurchasedElectricityContosoPowerPlantLbl: Label 'Purchased electricity - Contoso PowerPlant', MaxLength = 100; - PurchasedElectricityWideWorldImportersLbl: Label 'Purchased electricity - Wide World Importers', MaxLength = 100; - PurchasedElectricityGreenTariffEnergyLbl: Label 'Purchased electricity - Green Tariff Energy', MaxLength = 100; - SteamFabrikamIncLbl: Label 'Steam - Fabrikam, Inc.', MaxLength = 100; - HeatingFabrikamIncLbl: Label 'Heating - Fabrikam, Inc.', MaxLength = 100; - TotalScope2IndirectEmissionLbl: Label 'TOTAL SCOPE 2 - INDIRECT EMISSION', MaxLength = 100; - Scope3BeginTotalLbl: Label 'Scope 3 - Indirect Emission', MaxLength = 100; - PurchasedGoodsPlasticLbl: Label 'Purchased Goods - Plastic', MaxLength = 100; - PurchasedGoodsAluminumLbl: Label 'Purchased Goods - Aluminum', MaxLength = 100; - PurchasedGoodsSteelLbl: Label 'Purchased Goods - Steel', MaxLength = 100; - PurchasedGoodsGlassLbl: Label 'Purchased Goods - Glass', MaxLength = 100; - PurchasedServicesLbl: Label 'Purchased Services', MaxLength = 100; - ExternalTransportationLbl: Label 'External Transportation', MaxLength = 100; - TransportationWithOwnTrucksLbl: Label 'Transportation with Own Trucks', MaxLength = 100; - WastePlasticGeneratedInOperationLbl: Label 'Waste (plastic) Generated in Operation', MaxLength = 100; - WasteOrganicGeneratedInOperationLbl: Label 'Waste (organic) Generated in Operation', MaxLength = 100; - RecycledWasteGeneratedInOperationLbl: Label 'Recycled Waste Generated in Operation', MaxLength = 100; - TotalUpstreamActivitiesLbl: Label 'Total, Upstream Activities', MaxLength = 100; - DownStreamActivitiesLbl: Label 'DownStream Activities', MaxLength = 100; - ProcessingOfSoldProductsLbl: Label 'Processing of Sold Products', MaxLength = 100; - UseOfSoldProductsLbl: Label 'Use of Sold Products', MaxLength = 100; - EndOfLifeTreatmentOfSoldProductsLbl: Label 'End of Life Treatment of Sold Products', MaxLength = 100; - TotalDownstreamActivitiesLbl: Label 'Total, Downstream Activities', MaxLength = 100; - BusinessTravelAndEmployeeCommutingLbl: Label 'Business Travel and Employee Commuting', MaxLength = 100; - ContosoHotel3StarsLbl: Label 'Contoso Hotel - 3 stars', MaxLength = 100; - ContosoHotel4StarsLbl: Label 'Contoso Hotel - 4 stars', MaxLength = 100; - ContosoHotel4StarsJuniorSuiteLbl: Label 'Contoso Hotel - 4 stars Junior Suite', MaxLength = 100; - ContosoRentalCarLbl: Label 'Contoso Rental Car', MaxLength = 100; - CompanyCarMediumSizeLbl: Label 'Company Car - Medium size', MaxLength = 100; - CompanyCarLargeSizeLbl: Label 'Company Car - Large size', MaxLength = 100; - CompanyCarPremiumSizeLbl: Label 'Company Car - Premium size', MaxLength = 100; - TotalBusinessTravelAndEmployeeCommutingLbl: Label 'Total, Business Travel and Employee Commuting', MaxLength = 100; - TotalScope3IndirectEmissionLbl: Label 'TOTAL SCOPE 3 - INDIRECT EMISSION', MaxLength = 100; - TotalGasEmissionsLbl: Label 'TOTAL GAS EMISSIONS', MaxLength = 100; -} \ No newline at end of file diff --git a/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Sustainability/1.Setup Data/CreateSustainabilityCategory.Codeunit.al b/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Sustainability/1.Setup Data/CreateSustainabilityCategory.Codeunit.al deleted file mode 100644 index 744e0bd789..0000000000 --- a/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Sustainability/1.Setup Data/CreateSustainabilityCategory.Codeunit.al +++ /dev/null @@ -1,150 +0,0 @@ -codeunit 5213 "Create Sustainability Category" -{ - InherentEntitlements = X; - InherentPermissions = X; - - trigger OnRun() - var - ContosoSustainability: Codeunit "Contoso Sustainability"; - begin - ContosoSustainability.InsertAccountCategory(CompanyCar(), CompanyCarLbl, Enum::"Emission Scope"::"Scope 3", Enum::"Calculation Foundation"::Distance, true, false, false, '', false); - ContosoSustainability.InsertAccountCategory(Fugitive(), FugitiveLbl, Enum::"Emission Scope"::"Scope 1", Enum::"Calculation Foundation"::Installations, true, false, false, '', false); - ContosoSustainability.InsertAccountCategory(Hotel(), HotelLbl, Enum::"Emission Scope"::"Scope 3", Enum::"Calculation Foundation"::Custom, true, false, false, 'NIGHT', false); - ContosoSustainability.InsertAccountCategory(MobileDistance(), MobileDistanceLbl, Enum::"Emission Scope"::"Scope 1", Enum::"Calculation Foundation"::Distance, true, true, false, '', false); - ContosoSustainability.InsertAccountCategory(MobileFuel(), MobileFuelLbl, Enum::"Emission Scope"::"Scope 1", Enum::"Calculation Foundation"::"Fuel/Electricity", true, true, false, '', false); - ContosoSustainability.InsertAccountCategory(PurchaseGoodsGL(), PurchaseGoodsGLLbl, Enum::"Emission Scope"::"Scope 3", Enum::"Calculation Foundation"::Custom, true, false, false, 'GL', true); - ContosoSustainability.InsertAccountCategory(RentalCar(), RentalCarLbl, Enum::"Emission Scope"::"Scope 3", Enum::"Calculation Foundation"::"Fuel/Electricity", true, false, false, '', false); - ContosoSustainability.InsertAccountCategory(SoldProductEnd(), SoldProductEndOfLifeTreatmentLbl, Enum::"Emission Scope"::"Scope 3", Enum::"Calculation Foundation"::Custom, true, false, false, 'GL', true); - ContosoSustainability.InsertAccountCategory(SoldProductProcess(), SoldProductProccessingLbl, Enum::"Emission Scope"::"Scope 3", Enum::"Calculation Foundation"::Custom, true, false, false, 'GL', true); - ContosoSustainability.InsertAccountCategory(SoldProductUse(), SoldProductUseLbl, Enum::"Emission Scope"::"Scope 3", Enum::"Calculation Foundation"::Custom, true, false, false, 'GL', true); - ContosoSustainability.InsertAccountCategory(Stationary(), StationaryLbl, Enum::"Emission Scope"::"Scope 1", Enum::"Calculation Foundation"::"Fuel/Electricity", true, true, true, '', false); - ContosoSustainability.InsertAccountCategory(ExternalTransportDistance(), ExternalTransportDistanceLbl, Enum::"Emission Scope"::"Scope 3", Enum::"Calculation Foundation"::Distance, true, false, false, '', false); - ContosoSustainability.InsertAccountCategory(InternalTransportDistance(), InternalTransportDistanceLbl, Enum::"Emission Scope"::"Scope 3", Enum::"Calculation Foundation"::Distance, true, false, false, '', false); - ContosoSustainability.InsertAccountCategory(UtilityElectric(), UtilityElectricLbl, Enum::"Emission Scope"::"Scope 2", Enum::"Calculation Foundation"::"Fuel/Electricity", true, false, false, '', false); - ContosoSustainability.InsertAccountCategory(UtilityHeat(), UtilityHeatLbl, Enum::"Emission Scope"::"Scope 2", Enum::"Calculation Foundation"::Custom, true, false, false, 'THERMAL UNIT', false); - ContosoSustainability.InsertAccountCategory(UtilitySteam(), UtilitySteamLbl, Enum::"Emission Scope"::"Scope 2", Enum::"Calculation Foundation"::Custom, true, false, false, 'TON/HOUR', false); - ContosoSustainability.InsertAccountCategory(Waste(), WasteLbl, Enum::"Emission Scope"::"Scope 3", Enum::"Calculation Foundation"::Custom, true, true, false, 'WASTE TON', false); - end; - - procedure CompanyCar(): Code[20] - begin - exit(CompanyCarTok); - end; - - procedure Fugitive(): Code[20] - begin - exit(FugitiveTok); - end; - - procedure Hotel(): Code[20] - begin - exit(HotelTok); - end; - - procedure MobileDistance(): Code[20] - begin - exit(MobileDistanceTok); - end; - - procedure MobileFuel(): Code[20] - begin - exit(MobileFuelTok); - end; - - procedure PurchaseGoodsGL(): Code[20] - begin - exit(PurchaseGoodsGLTok); - end; - - procedure RentalCar(): Code[20] - begin - exit(RentalCarTok); - end; - - procedure SoldProductEnd(): Code[20] - begin - exit(SoldProductEndOfLifeTreatmentTok); - end; - - procedure SoldProductProcess(): Code[20] - begin - exit(SoldProductProcessingTok); - end; - - procedure SoldProductUse(): Code[20] - begin - exit(SoldProductUseTok); - end; - - procedure Stationary(): Code[20] - begin - exit(StationaryTok); - end; - - procedure ExternalTransportDistance(): Code[20] - begin - exit(ExternalTransportDistanceTok); - end; - - procedure InternalTransportDistance(): Code[20] - begin - exit(InternalTransportDistanceTok); - end; - - - procedure UtilityElectric(): Code[20] - begin - exit(UtilityElectricTok); - end; - - procedure UtilityHeat(): Code[20] - begin - exit(UtilityHeatTok); - end; - - procedure UtilitySteam(): Code[20] - begin - exit(UtilitySteamTok); - end; - - procedure Waste(): Code[20] - begin - exit(WasteTok); - end; - - var - CompanyCarTok: Label 'COMPCAR', MaxLength = 20; - CompanyCarLbl: Label 'Company Cars', MaxLength = 100; - FugitiveTok: Label 'FUGITIVE', MaxLength = 20; - FugitiveLbl: Label 'Fugitive Emissions', MaxLength = 100; - HotelTok: Label 'HOTEL', MaxLength = 20; - HotelLbl: Label 'Hotel Night Stays', MaxLength = 100; - MobileDistanceTok: Label 'MOBILE-DISTANCE', MaxLength = 20; - MobileDistanceLbl: Label 'Mobile Combustion - Distance Calculation', MaxLength = 100; - MobileFuelTok: Label 'MOBILE-FUEL', MaxLength = 20; - MobileFuelLbl: Label 'Mobile Combustion - Fuel Calculation', MaxLength = 100; - PurchaseGoodsGLTok: Label 'PURCHGOODS-GL', MaxLength = 20; - PurchaseGoodsGLLbl: Label 'Purchased Goods - GL Based Calculation', MaxLength = 100; - RentalCarTok: Label 'RENTALCAR', MaxLength = 20; - RentalCarLbl: Label 'Rental Car Usage', MaxLength = 100; - SoldProductEndOfLifeTreatmentTok: Label 'SOLDPRODEND-GL', MaxLength = 20; - SoldProductEndOfLifeTreatmentLbl: Label 'End of Life Treatment of Sold Products', MaxLength = 100; - SoldProductProcessingTok: Label 'SOLDPRODPROC-GL', MaxLength = 20; - SoldProductProccessingLbl: Label 'Processing of Sold Products', MaxLength = 100; - SoldProductUseTok: Label 'SOLDPRODUSE-GL', MaxLength = 20; - SoldProductUseLbl: Label 'Use of Sold Products', MaxLength = 100; - StationaryTok: Label 'STATIONARY', MaxLength = 20; - StationaryLbl: Label 'Stationary Combustion', MaxLength = 100; - ExternalTransportDistanceTok: Label 'TRANSP-EXT-DIST', MaxLength = 20; - ExternalTransportDistanceLbl: Label 'External Transport - Distance Calculation', MaxLength = 100; - InternalTransportDistanceTok: Label 'TRANSP-INT-DIST', MaxLength = 20; - InternalTransportDistanceLbl: Label 'Internal Transport - Distance Calculation', MaxLength = 100; - UtilityElectricTok: Label 'UTILITY-ELECTRIC', MaxLength = 20; - UtilityElectricLbl: Label 'Utility Providers - Electricity', MaxLength = 100; - UtilityHeatTok: Label 'UTILITY-HEAT', MaxLength = 20; - UtilityHeatLbl: Label 'Utility Providers - Heating', MaxLength = 100; - UtilitySteamTok: Label 'UTILITY-STEAM', MaxLength = 20; - UtilitySteamLbl: Label 'Utility Providers - Steam', MaxLength = 100; - WasteTok: Label 'WASTE', MaxLength = 20; - WasteLbl: Label 'Waste Generated', MaxLength = 100; -} \ No newline at end of file diff --git a/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Sustainability/1.Setup Data/CreateSustainabilitySetup.Codeunit.al b/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Sustainability/1.Setup Data/CreateSustainabilitySetup.Codeunit.al deleted file mode 100644 index a342f14f2c..0000000000 --- a/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Sustainability/1.Setup Data/CreateSustainabilitySetup.Codeunit.al +++ /dev/null @@ -1,44 +0,0 @@ -codeunit 5212 "Create Sustainability Setup" -{ - InherentEntitlements = X; - InherentPermissions = X; - - trigger OnRun() - begin - CreateSetupTable(); - CreateSourceCode(); - end; - - local procedure CreateSetupTable() - var - SustainabilitySetup: Record "Sustainability Setup"; - CommonUoM: Codeunit "Create Common Unit Of Measure"; - begin - SustainabilitySetup.Get(); - - SustainabilitySetup.Validate("Emission Unit of Measure Code", CommonUoM.KG()); - SustainabilitySetup.Validate("Emission Decimal Places", '3:5'); - - SustainabilitySetup.Validate("Fuel/El. Decimal Places", '2:5'); - SustainabilitySetup.Validate("Distance Decimal Places", '1:3'); - SustainabilitySetup.Validate("Custom Amt. Decimal Places", '2:5'); - - SustainabilitySetup.Modify(true); - end; - - local procedure CreateSourceCode() - var - ContosoAuditCode: Codeunit "Contoso Audit Code"; - begin - ContosoAuditCode.InsertSourceCode(SustainabilitySourceCode(), SustainabilityDescriptionTok); - end; - - procedure SustainabilitySourceCode(): Code[10] - begin - exit(SustainabilityTok); - end; - - var - SustainabilityTok: Label 'SUSTAIN', MaxLength = 10; - SustainabilityDescriptionTok: Label 'Sustainability Emissions', MaxLength = 100; -} \ No newline at end of file diff --git a/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Sustainability/3. Transactions/CreateSustainabilityJournal.Codeunit.al b/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Sustainability/3. Transactions/CreateSustainabilityJournal.Codeunit.al deleted file mode 100644 index fa524ba035..0000000000 --- a/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Sustainability/3. Transactions/CreateSustainabilityJournal.Codeunit.al +++ /dev/null @@ -1,69 +0,0 @@ -codeunit 5221 "Create Sustainability Journal" -{ - InherentEntitlements = X; - InherentPermissions = X; - - trigger OnRun() - var - SustainJnlSetup: Codeunit "Create Sustain. Jnl. Setup"; - ContosoUtility: Codeunit "Contoso Utilities"; - begin - CreateLinesForDefaultBatch(SustainJnlSetup.GeneralTemplate(), SustainJnlSetup.DefaultBatch(), ContosoUtility.AdjustDate(20240531D)); - CreateLinesForScope1Batch(SustainJnlSetup.GeneralTemplate(), SustainJnlSetup.Scope1Batch(), ContosoUtility.AdjustDate(20240531D)); - CreateLinesForScope2Batch(SustainJnlSetup.GeneralTemplate(), SustainJnlSetup.Scope2Batch(), ContosoUtility.AdjustDate(20240531D)); - CreateLinesForScope3Batch(SustainJnlSetup.GeneralTemplate(), SustainJnlSetup.Scope3Batch(), ContosoUtility.AdjustDate(20240531D)); - end; - - local procedure CreateLinesForDefaultBatch(TemplateName: Code[10]; BatchName: Code[10]; DefaultDate: Date) - var - ContosoSustainability: Codeunit "Contoso Sustainability"; - Account: Codeunit "Create Sustainability Account"; - CommonUoM: Codeunit "Create Common Unit Of Measure"; - begin - ContosoSustainability.InsertSustainabilityJournalLine(TemplateName, BatchName, DefaultDate, 'SJ00018', Account.CompanyCarLargeSize(), CommonUoM.KM(), 0, 385, 0, 1, 0, '', ''); - ContosoSustainability.InsertSustainabilityJournalLine(TemplateName, BatchName, DefaultDate, 'SJ00018', Account.CompanyCarMediumSize(), CommonUoM.KM(), 0, 1820, 0, 1, 0, '', ''); - ContosoSustainability.InsertSustainabilityJournalLine(TemplateName, BatchName, DefaultDate, 'SJ00018', Account.CompanyCarPremiumSize(), CommonUoM.KM(), 0, 268, 0, 1, 0, '', ''); - - ContosoSustainability.InsertSustainabilityJournalLine(TemplateName, BatchName, DefaultDate, 'SJ00018', Account.AirContinentalEconomy(), CommonUoM.KM(), 0, 4120, 0, 1, 0, '', ''); - ContosoSustainability.InsertSustainabilityJournalLine(TemplateName, BatchName, DefaultDate, 'SJ00018', Account.AirIntercontinentalBusiness(), CommonUoM.KM(), 0, 9860, 0, 1, 0, '', ''); - - ContosoSustainability.InsertSustainabilityJournalLine(TemplateName, BatchName, DefaultDate, 'SJ00018', Account.ContosoHotel3Stars(), CommonUoM.Day(), 0, 0, 2, 1, 0, '', ''); - ContosoSustainability.InsertSustainabilityJournalLine(TemplateName, BatchName, DefaultDate, 'SJ00018', Account.ContosoHotel4Stars(), CommonUoM.Day(), 0, 0, 6, 1, 0, '', ''); - ContosoSustainability.InsertSustainabilityJournalLine(TemplateName, BatchName, DefaultDate, 'SJ00018', Account.ContosoHotel4StarsJuniorSuite(), CommonUoM.Day(), 0, 0, 3, 1, 0, '', ''); - - ContosoSustainability.InsertSustainabilityJournalLine(TemplateName, BatchName, DefaultDate, 'SJ00018', Account.ContosoRentalCar(), CommonUoM.KM(), 0, 120, 0, 1, 0, '', ''); - ContosoSustainability.InsertSustainabilityJournalLine(TemplateName, BatchName, DefaultDate, 'SJ00018', Account.Rail(), CommonUoM.KM(), 0, 0, 0, 1, 0, '', ''); - - ContosoSustainability.InsertSustainabilityJournalLine(TemplateName, BatchName, DefaultDate, 'SJ00018', Account.PurchasedServices(), 0, 0, 0, '', ''); - end; - - local procedure CreateLinesForScope1Batch(TemplateName: Code[10]; BatchName: Code[10]; DefaultDate: Date) - var - ContosoSustainability: Codeunit "Contoso Sustainability"; - Account: Codeunit "Create Sustainability Account"; - CommonUoM: Codeunit "Create Common Unit Of Measure"; - begin - ContosoSustainability.InsertSustainabilityJournalLine(TemplateName, BatchName, DefaultDate, 'EMIS1-0001', Account.OnRoadVehicleUrbanTrucks(), CommonUoM.KM(), 0, 1010, 0, 1, 0, '', ''); - ContosoSustainability.InsertSustainabilityJournalLine(TemplateName, BatchName, DefaultDate, 'EMIS1-0001', Account.NonRoadVehiclesTractors(), CommonUoM.L(), 225, 0, 0, 1, 0, '', ''); - ContosoSustainability.InsertSustainabilityJournalLine(TemplateName, BatchName, DefaultDate, 'EMIS1-0001', Account.NonRoadVehiclesBackhoes(), CommonUoM.L(), 180, 0, 0, 1, 0, '', ''); - end; - - local procedure CreateLinesForScope2Batch(TemplateName: Code[10]; BatchName: Code[10]; DefaultDate: Date) - var - ContosoSustainability: Codeunit "Contoso Sustainability"; - Account: Codeunit "Create Sustainability Account"; - begin - ContosoSustainability.InsertSustainabilityJournalLine(TemplateName, BatchName, DefaultDate, 'EMIS1-0002', Account.SteamFabrikamInc(), '', 0, 0, 0, 1, 0, '', ''); - end; - - local procedure CreateLinesForScope3Batch(TemplateName: Code[10]; BatchName: Code[10]; DefaultDate: Date) - var - ContosoSustainability: Codeunit "Contoso Sustainability"; - Account: Codeunit "Create Sustainability Account"; - CommonUoM: Codeunit "Create Common Unit Of Measure"; - begin - ContosoSustainability.InsertSustainabilityJournalLine(TemplateName, BatchName, DefaultDate, 'EMIS1-0003', Account.WastePlasticGeneratedInOperation(), CommonUoM.Ton(), 0, 0, 0.41, 1, 0, '', ''); - ContosoSustainability.InsertSustainabilityJournalLine(TemplateName, BatchName, DefaultDate, 'EMIS1-0003', Account.WasteOrganicGeneratedInOperation(), CommonUoM.Ton(), 0, 0, 0.63, 1, 0, '', ''); - ContosoSustainability.InsertSustainabilityJournalLine(TemplateName, BatchName, DefaultDate, 'EMIS1-0003', Account.RecycledWasteGeneratedInOperation(), CommonUoM.Ton(), 0, 0, 0.82, 1, 0, '', ''); - end; -} \ No newline at end of file diff --git a/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Sustainability/4. Historical/CreateSustainabilityEntry.Codeunit.al b/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Sustainability/4. Historical/CreateSustainabilityEntry.Codeunit.al deleted file mode 100644 index a374f471e9..0000000000 --- a/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Sustainability/4. Historical/CreateSustainabilityEntry.Codeunit.al +++ /dev/null @@ -1,71 +0,0 @@ -codeunit 5222 "Create Sustainability Entry" -{ - InherentEntitlements = X; - InherentPermissions = X; - Permissions = tabledata "Sustainability Jnl. Line" = r; - - trigger OnRun() - var - SustainabilityJnlLine: Record "Sustainability Jnl. Line"; - SustainJnlSetup: Codeunit "Create Sustain. Jnl. Setup"; - LastLineNo: Integer; - begin - SustainabilityJnlLine.SetRange("Journal Template Name", SustainJnlSetup.GeneralTemplate()); - SustainabilityJnlLine.SetRange("Journal Batch Name", SustainJnlSetup.DefaultBatch()); - SustainabilityJnlLine.FindLast(); - LastLineNo := SustainabilityJnlLine."Line No."; - - CreateLinesToPost(SustainJnlSetup.GeneralTemplate(), SustainJnlSetup.DefaultBatch()); - - PostCreatedEntries(LastLineNo, SustainJnlSetup.GeneralTemplate(), SustainJnlSetup.DefaultBatch()); - end; - - local procedure CreateLinesToPost(TemplateName: Code[10]; BatchName: Code[10]) - var - ContosoUtility: Codeunit "Contoso Utilities"; - ContosoSustainability: Codeunit "Contoso Sustainability"; - Account: Codeunit "Create Sustainability Account"; - CommonUoM: Codeunit "Create Common Unit Of Measure"; - begin - ContosoSustainability.InsertSustainabilityJournalLine(TemplateName, BatchName, ContosoUtility.AdjustDate(20240131D), 'SJ00001', Account.Refrigerators(), CommonUoM.Piece(), 0, 0, 15, 3, 0.8, 'US', ''); - ContosoSustainability.InsertSustainabilityJournalLine(TemplateName, BatchName, ContosoUtility.AdjustDate(20240131D), 'SJ00001', Account.PurchasedElectricityContosoPowerPlant(), CommonUoM.KWH(), 4682, 0, 0, 1, 0, 'US', ''); - ContosoSustainability.InsertSustainabilityJournalLine(TemplateName, BatchName, ContosoUtility.AdjustDate(20240131D), 'SJ00003', Account.CompanyCarLargeSize(), CommonUoM.KM(), 0, 860, 0, 1, 0, 'US', ''); - ContosoSustainability.InsertSustainabilityJournalLine(TemplateName, BatchName, ContosoUtility.AdjustDate(20240131D), 'SJ00003', Account.ContosoHotel3Stars(), CommonUoM.Day(), 0, 0, 4, 1, 0, 'US', ''); - ContosoSustainability.InsertSustainabilityJournalLine(TemplateName, BatchName, ContosoUtility.AdjustDate(20240131D), 'SJ00003', Account.ContosoRentalCar(), CommonUoM.L(), 16, 0, 0, 1, 0, 'US', ''); - - ContosoSustainability.InsertSustainabilityJournalLine(TemplateName, BatchName, ContosoUtility.AdjustDate(20240228D), 'SJ00004', Account.Refrigerators(), CommonUoM.Piece(), 0, 0, 15, 3, 0.8, 'US', ''); - ContosoSustainability.InsertSustainabilityJournalLine(TemplateName, BatchName, ContosoUtility.AdjustDate(20240228D), 'SJ00004', Account.PurchasedElectricityContosoPowerPlant(), CommonUoM.KWH(), 5011, 0, 0, 1, 0, 'US', ''); - ContosoSustainability.InsertSustainabilityJournalLine(TemplateName, BatchName, ContosoUtility.AdjustDate(20240228D), 'SJ00006', Account.CompanyCarLargeSize(), CommonUoM.KM(), 0, 652, 0, 1, 0, 'US', ''); - - ContosoSustainability.InsertSustainabilityJournalLine(TemplateName, BatchName, ContosoUtility.AdjustDate(20240331D), 'SJ00007', Account.Refrigerators(), CommonUoM.Piece(), 0, 0, 15, 3, 0.8, 'US', ''); - ContosoSustainability.InsertSustainabilityJournalLine(TemplateName, BatchName, ContosoUtility.AdjustDate(20240331D), 'SJ00007', Account.PurchasedElectricityContosoPowerPlant(), CommonUoM.KWH(), 4998, 0, 0, 1, 0, 'US', ''); - ContosoSustainability.InsertSustainabilityJournalLine(TemplateName, BatchName, ContosoUtility.AdjustDate(20240331D), 'SJ00009', Account.CompanyCarLargeSize(), CommonUoM.KM(), 0, 860, 0, 1, 0, 'US', ''); - ContosoSustainability.InsertSustainabilityJournalLine(TemplateName, BatchName, ContosoUtility.AdjustDate(20240331D), 'SJ00009', Account.ContosoHotel4StarsJuniorSuite(), CommonUoM.Day(), 0, 0, 6, 1, 0, 'US', ''); - ContosoSustainability.InsertSustainabilityJournalLine(TemplateName, BatchName, ContosoUtility.AdjustDate(20240331D), 'SJ00009', Account.ContosoRentalCar(), CommonUoM.L(), 16, 0, 0, 1, 0, 'US', ''); - - ContosoSustainability.InsertSustainabilityJournalLine(TemplateName, BatchName, ContosoUtility.AdjustDate(20240430D), 'SJ00012', Account.Refrigerators(), CommonUoM.Piece(), 0, 0, 15, 3, 0.8, 'US', ''); - ContosoSustainability.InsertSustainabilityJournalLine(TemplateName, BatchName, ContosoUtility.AdjustDate(20240430D), 'SJ00012', Account.PurchasedElectricityContosoPowerPlant(), CommonUoM.KWH(), 4456, 0, 0, 1, 0, 'US', ''); - ContosoSustainability.InsertSustainabilityJournalLine(TemplateName, BatchName, ContosoUtility.AdjustDate(20240430D), 'SJ00014', Account.CompanyCarLargeSize(), CommonUoM.KM(), 0, 564, 0, 1, 0, 'US', ''); - ContosoSustainability.InsertSustainabilityJournalLine(TemplateName, BatchName, ContosoUtility.AdjustDate(20240430D), 'SJ00014', Account.CompanyCarPremiumSize(), CommonUoM.KM(), 0, 226, 0, 1, 0, 'US', ''); - ContosoSustainability.InsertSustainabilityJournalLine(TemplateName, BatchName, ContosoUtility.AdjustDate(20240430D), 'SJ00014', Account.ContosoHotel4StarsJuniorSuite(), CommonUoM.Day(), 0, 0, 5, 1, 0, 'US', ''); - ContosoSustainability.InsertSustainabilityJournalLine(TemplateName, BatchName, ContosoUtility.AdjustDate(20240430D), 'SJ00014', Account.ContosoHotel3Stars(), CommonUoM.Day(), 0, 0, 4, 1, 0, 'US', ''); - ContosoSustainability.InsertSustainabilityJournalLine(TemplateName, BatchName, ContosoUtility.AdjustDate(20240430D), 'SJ00014', Account.ContosoRentalCar(), CommonUoM.L(), 16, 0, 0, 1, 0, 'US', ''); - ContosoSustainability.InsertSustainabilityJournalLine(TemplateName, BatchName, ContosoUtility.AdjustDate(20240430D), 'SJ00016', Account.AirConditionEquipments24kW(), CommonUoM.Piece(), 0, 0, 5, 44, 0.25, 'US', ''); - - ContosoSustainability.InsertSustainabilityJournalLine(TemplateName, BatchName, ContosoUtility.AdjustDate(20240531D), 'SJ00017', Account.AirConditionEquipments24kW(), CommonUoM.Piece(), 0, 0, 5, 56, 0.4, 'US', ''); - ContosoSustainability.InsertSustainabilityJournalLine(TemplateName, BatchName, ContosoUtility.AdjustDate(20240531D), 'SJ00017', Account.Refrigerators(), CommonUoM.Piece(), 0, 0, 18, 3, 0.85, 'US', ''); - ContosoSustainability.InsertSustainabilityJournalLine(TemplateName, BatchName, ContosoUtility.AdjustDate(20240531D), 'SJ00017', Account.PurchasedElectricityContosoPowerPlant(), CommonUoM.KWH(), 5827, 0, 0, 1, 0, 'US', ''); - end; - - local procedure PostCreatedEntries(LastLineNo: Integer; TemplateName: Code[10]; BatchName: Code[10]) - var - SustainabilityJnlLine: Record "Sustainability Jnl. Line"; - begin - SustainabilityJnlLine.SetRange("Journal Template Name", TemplateName); - SustainabilityJnlLine.SetRange("Journal Batch Name", BatchName); - SustainabilityJnlLine.SetFilter("Line No.", '>%1', LastLineNo); - SustainabilityJnlLine.FindSet(); - - Codeunit.Run(Codeunit::"Sustainability Jnl.-Post", SustainabilityJnlLine); - end; -} \ No newline at end of file diff --git a/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Sustainability/SustainabilityModule.Codeunit.al b/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Sustainability/SustainabilityModule.Codeunit.al deleted file mode 100644 index 85d941c6bd..0000000000 --- a/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Sustainability/SustainabilityModule.Codeunit.al +++ /dev/null @@ -1,39 +0,0 @@ -codeunit 5218 "Sustainability Module" implements "Contoso Demo Data Module" -{ - InherentEntitlements = X; - InherentPermissions = X; - - procedure RunConfigurationPage() - begin - exit; - end; - - procedure GetDependencies() Dependencies: List of [enum "Contoso Demo Data Module"] - begin - Dependencies.Add(Enum::"Contoso Demo Data Module"::"Common Module"); - end; - - procedure CreateSetupData() - begin - Codeunit.Run(Codeunit::"Create Sustainability Setup"); - Codeunit.Run(Codeunit::"Create Sustain. No Series"); - Codeunit.Run(Codeunit::"Create Sustainability Category"); - Codeunit.Run(Codeunit::"Create Sustain. Subcategory"); - Codeunit.Run(Codeunit::"Create Sustainability Account"); - Codeunit.Run(Codeunit::"Create Sustain. Jnl. Setup"); - end; - - procedure CreateMasterData() - begin - end; - - procedure CreateTransactionalData() - begin - Codeunit.Run(Codeunit::"Create Sustainability Journal"); - end; - - procedure CreateHistoricalData() - begin - Codeunit.Run(Codeunit::"Create Sustainability Entry"); - end; -} \ No newline at end of file diff --git a/Apps/W1/ContosoCoffeeDemoDataset/app/DemoTool/Contoso Helpers/ContosoSustainability.Codeunit.al b/Apps/W1/ContosoCoffeeDemoDataset/app/DemoTool/Contoso Helpers/ContosoSustainability.Codeunit.al deleted file mode 100644 index 9b4801f616..0000000000 --- a/Apps/W1/ContosoCoffeeDemoDataset/app/DemoTool/Contoso Helpers/ContosoSustainability.Codeunit.al +++ /dev/null @@ -1,201 +0,0 @@ -codeunit 5216 "Contoso Sustainability" -{ - InherentPermissions = X; - InherentEntitlements = X; - Permissions = - tabledata "Sustain. Account Category" = rim, - tabledata "Sustain. Account Subcategory" = rim, - tabledata "Sustainability Account" = rim, - tabledata "Sustainability Jnl. Template" = rim, - tabledata "Sustainability Jnl. Batch" = rim, - tabledata "Sustainability Jnl. Line" = rim; - - var - OverwriteData: Boolean; - - procedure SetOverwriteData(Overwrite: Boolean) - begin - OverwriteData := Overwrite; - end; - - procedure InsertAccountCategory(Code: Code[20]; Description: Text[100]; Scope: Enum "Emission Scope"; CalcFoundation: Enum "Calculation Foundation"; CO2: Boolean; CH4: Boolean; N2O: Boolean; CustomValue: Text[100]; CalcFromGL: Boolean) - var - SustainAccountCategory: Record "Sustain. Account Category"; - Exists: Boolean; - begin - if SustainAccountCategory.Get(Code) then begin - Exists := true; - - if not OverwriteData then - exit; - end; - - SustainAccountCategory.Validate(Code, Code); - SustainAccountCategory.Validate(Description, Description); - SustainAccountCategory.Validate("Emission Scope", Scope); - SustainAccountCategory.Validate("Calculation Foundation", CalcFoundation); - SustainAccountCategory.Validate(CO2, CO2); - SustainAccountCategory.Validate(CH4, CH4); - SustainAccountCategory.Validate(N2O, N2O); - SustainAccountCategory.Validate("Custom Value", CustomValue); - SustainAccountCategory.Validate("Calculate from General Ledger", CalcFromGL); - - if Exists then - SustainAccountCategory.Modify(true) - else - SustainAccountCategory.Insert(true); - end; - - procedure InsertAccountSubcategory(CategoryCode: Code[20]; SubcategoryCode: Code[20]; Description: Text[100]; EFCO2: Decimal; EFCH4: Decimal; EFN2O: Decimal; RenewableEnergy: Boolean) - var - SustainAccountSubcategory: Record "Sustain. Account Subcategory"; - Exists: Boolean; - begin - if SustainAccountSubcategory.Get(CategoryCode, SubcategoryCode) then begin - Exists := true; - - if not OverwriteData then - exit; - end; - - SustainAccountSubcategory.Validate("Category Code", CategoryCode); - SustainAccountSubcategory.Validate(Code, SubcategoryCode); - SustainAccountSubcategory.Validate(Description, Description); - SustainAccountSubcategory.Validate("Emission Factor CO2", EFCO2); - SustainAccountSubcategory.Validate("Emission Factor CH4", EFCH4); - SustainAccountSubcategory.Validate("Emission Factor N2O", EFN2O); - SustainAccountSubcategory.Validate("Renewable Energy", RenewableEnergy); - - if Exists then - SustainAccountSubcategory.Modify(true) - else - SustainAccountSubcategory.Insert(true); - end; - - procedure InsertSustainabilityAccount(AccountNo: Code[20]; Name: Text[100]; CategoryCode: Code[20]; SubcategoryCode: Code[20]; AccountType: Enum "Sustainability Account Type"; Totaling: Text[250]; DirectPosting: Boolean) - var - SustainabilityAccount: Record "Sustainability Account"; - Exists: Boolean; - begin - if SustainabilityAccount.Get(AccountNo) then begin - Exists := true; - - if not OverwriteData then - exit; - end; - - SustainabilityAccount.Validate("No.", AccountNo); - SustainabilityAccount.Validate(Name, Name); - SustainabilityAccount.Validate(Category, CategoryCode); - SustainabilityAccount.Validate(Subcategory, SubcategoryCode); - SustainabilityAccount.Validate("Account Type", AccountType); - SustainabilityAccount.Validate(Totaling, Totaling); - SustainabilityAccount.Validate("Direct Posting", DirectPosting); - - if Exists then - SustainabilityAccount.Modify(true) - else - SustainabilityAccount.Insert(true); - end; - - procedure InsertSustainabilityJournalTemplate(Name: Code[10]; Description: Text[80]; Recurring: Boolean) - var - SustainabilityJnlTemplate: Record "Sustainability Jnl. Template"; - Exists: Boolean; - begin - if SustainabilityJnlTemplate.Get(Name) then begin - Exists := true; - - if not OverwriteData then - exit; - end; - - SustainabilityJnlTemplate.Validate(Name, Name); - SustainabilityJnlTemplate.Validate(Description, Description); - SustainabilityJnlTemplate.Validate(Recurring, Recurring); - - if Exists then - SustainabilityJnlTemplate.Modify(true) - else - SustainabilityJnlTemplate.Insert(true); - end; - - procedure InsertSustainabilityJournalBatch(TemplateName: Code[10]; BatchName: Code[10]; Description: Text[100]; NoSeries: Code[20]; EmissionScope: Enum "Emission Scope"; SourceCode: Code[10]) - var - SustainabilityJnlBatch: Record "Sustainability Jnl. Batch"; - Exists: Boolean; - begin - if SustainabilityJnlBatch.Get(TemplateName, BatchName) then begin - Exists := true; - - if not OverwriteData then - exit; - end; - - SustainabilityJnlBatch.Validate("Journal Template Name", TemplateName); - SustainabilityJnlBatch.Validate(Name, BatchName); - SustainabilityJnlBatch.Validate(Description, Description); - SustainabilityJnlBatch.Validate("No Series", NoSeries); - SustainabilityJnlBatch.Validate("Emission Scope", EmissionScope); - SustainabilityJnlBatch.Validate("Source Code", SourceCode); - - if Exists then - SustainabilityJnlBatch.Modify(true) - else - SustainabilityJnlBatch.Insert(true); - end; - - procedure InsertSustainabilityJournalLine(TemplateName: Code[10]; BatchName: Code[10]; PostingDate: Date; DocumentNo: Code[20]; AccountNo: Code[20]; ManualInput: Boolean; UoM: Code[10]; FuelElectricity: Decimal; Distance: Decimal; CustomAmount: Decimal; Installation: Decimal; TimeFactor: Decimal; EmissionCO2: Decimal; EmissionCH4: Decimal; EmissionN2O: Decimal; CountryOrRegion: Code[10]; ResponsibilityCenter: Code[10]) - var - SustainabilityJnlLine: Record "Sustainability Jnl. Line"; - begin - SustainabilityJnlLine.Validate("Journal Template Name", TemplateName); - SustainabilityJnlLine.Validate("Journal Batch Name", BatchName); - SustainabilityJnlLine.Validate("Line No.", GetNextSustainabilityJournalLineNo(TemplateName, BatchName)); - SustainabilityJnlLine.Validate("Posting Date", PostingDate); - SustainabilityJnlLine.Validate("Document No.", DocumentNo); - SustainabilityJnlLine.Validate("Account No.", AccountNo); - SustainabilityJnlLine.Validate("Manual Input", ManualInput); - SustainabilityJnlLine.Validate("Country/Region Code", CountryOrRegion); - SustainabilityJnlLine.Validate("Responsibility Center", ResponsibilityCenter); - - if ManualInput then begin - SustainabilityJnlLine.Validate("Emission CO2", EmissionCO2); - SustainabilityJnlLine.Validate("Emission CH4", EmissionCH4); - SustainabilityJnlLine.Validate("Emission N2O", EmissionN2O); - end else begin - SustainabilityJnlLine.Validate("Unit of Measure", UoM); - SustainabilityJnlLine.Validate("Fuel/Electricity", FuelElectricity); - SustainabilityJnlLine.Validate(Distance, Distance); - SustainabilityJnlLine.Validate("Custom Amount", CustomAmount); - SustainabilityJnlLine.Validate("Installation Multiplier", Installation); - SustainabilityJnlLine.Validate("Time Factor", TimeFactor); - end; - - SustainabilityJnlLine.Insert(true); - end; - - procedure InsertSustainabilityJournalLine(TemplateName: Code[10]; BatchName: Code[10]; PostingDate: Date; DocumentNo: Code[20]; AccountNo: Code[20]; UoM: Code[10]; FuelElectricity: Decimal; Distance: Decimal; CustomAmount: Decimal; Installation: Decimal; TimeFactor: Decimal; CountryOrRegion: Code[10]; ResponsibilityCenter: Code[10]) - begin - InsertSustainabilityJournalLine(TemplateName, BatchName, PostingDate, DocumentNo, AccountNo, false, UoM, FuelElectricity, Distance, CustomAmount, Installation, TimeFactor, 0, 0, 0, CountryOrRegion, ResponsibilityCenter); - end; - - procedure InsertSustainabilityJournalLine(TemplateName: Code[10]; BatchName: Code[10]; PostingDate: Date; DocumentNo: Code[20]; AccountNo: Code[20]; EmissionCO2: Decimal; EmissionCH4: Decimal; EmissionN2O: Decimal; CountryOrRegion: Code[10]; ResponsibilityCenter: Code[10]) - begin - InsertSustainabilityJournalLine(TemplateName, BatchName, PostingDate, DocumentNo, AccountNo, true, '', 0, 0, 0, 1, 0, EmissionCO2, EmissionCH4, EmissionN2O, CountryOrRegion, ResponsibilityCenter); - end; - - local procedure GetNextSustainabilityJournalLineNo(TemplateName: Code[10]; BatchName: Code[10]): Integer - var - SustainabilityJnlLine: Record "Sustainability Jnl. Line"; - begin - SustainabilityJnlLine.SetRange("Journal Template Name", TemplateName); - SustainabilityJnlLine.SetRange("Journal Batch Name", BatchName); - SustainabilityJnlLine.SetCurrentKey("Line No."); - - if SustainabilityJnlLine.FindLast() then - exit(SustainabilityJnlLine."Line No." + 10000) - else - exit(10000); - end; -} \ No newline at end of file diff --git a/Apps/W1/Shopify/app/src/Order handling/Pages/ShpfyResolveOrderConflicts.Page.al b/Apps/W1/Shopify/app/src/Order handling/Pages/ShpfyResolveOrderConflicts.Page.al deleted file mode 100644 index 7bd96846eb..0000000000 --- a/Apps/W1/Shopify/app/src/Order handling/Pages/ShpfyResolveOrderConflicts.Page.al +++ /dev/null @@ -1,161 +0,0 @@ -namespace Microsoft.Integration.Shopify; - -page 30161 "Shpfy Resolve Order Conflicts" -{ - SourceTable = "Shpfy Order Header"; - InsertAllowed = false; - Editable = false; - PageType = Document; - UsageCategory = None; - - layout - { - area(Content) - { - group(General) - { - field(ShopCode; Rec."Shop Code") - { - ApplicationArea = All; - Editable = false; - ToolTip = 'Specifies the Shopify Shop from which the order originated.'; - } - field(ShopifyOrderNo; Rec."Shopify Order No.") - { - ApplicationArea = All; - Editable = false; - ToolTip = 'Specifies the order number from Shopify.'; - } - } - group(CurrentValues) - { - Caption = 'Current order in Business Central'; - field(Closed; Rec.Closed) - { - ApplicationArea = All; - Editable = false; - ToolTip = 'Specifies whether the order has been closed in Shopify.'; - } - field(Unpaid; Rec.Unpaid) - { - ApplicationArea = All; - Editable = false; - ToolTip = 'Specifies whether the order has been paid in Shopify.'; - } - field("Subtotal Amount"; Rec."Subtotal Amount") - { - ApplicationArea = All; - Editable = false; - ToolTip = 'Specifies the subtotal amount of the order in Shopify.'; - } - field("Total Amount"; Rec."Total Amount") - { - ApplicationArea = All; - Editable = false; - ToolTip = 'Specifies the total amount of the order in Shopify.'; - } - field("Presentment Total Amount"; Rec."Presentment Total Amount") - { - ApplicationArea = All; - Editable = false; - ToolTip = 'Specifies the total presentment amount of the order in Shopify.'; - } - } - part(ShopifyOrderLines; "Shpfy Order Subform") - { - ApplicationArea = All; - SubPageLink = "Shopify Order Id" = field("Shopify Order Id"); - Editable = false; - } - group(IncomingValues) - { - Caption = 'Retrieved order from Shopify'; - field(IncomingClosed; TempRetrievedOrderHeader.Closed) - { - ApplicationArea = All; - Caption = 'Closed'; - Editable = false; - ToolTip = 'Specifies whether the order has been closed in Shopify.'; - } - field(IncomingUnpaid; TempRetrievedOrderHeader.Unpaid) - { - ApplicationArea = All; - Caption = 'Unpaid'; - Editable = false; - ToolTip = 'Specifies whether the order has been paid in Shopify.'; - } - field("Incoming Subtotal Amount"; TempRetrievedOrderHeader."Subtotal Amount") - { - ApplicationArea = All; - Caption = 'Subtotal Amount'; - Editable = false; - ToolTip = 'Specifies the subtotal amount of the order in Shopify.'; - } - field("Incoming Total Amount"; TempRetrievedOrderHeader."Total Amount") - { - ApplicationArea = All; - Caption = 'Total Amount'; - Editable = false; - ToolTip = 'Specifies the total amount of the order in Shopify.'; - } - field("Incoming Presentment Total Amount"; TempRetrievedOrderHeader."Presentment Total Amount") - { - ApplicationArea = All; - Caption = 'Presentment Total Amount'; - Editable = false; - ToolTip = 'Specifies the total presentment amount of the order in Shopify.'; - } - } - part(ShopifyLatestRetrievedLines; "Shpfy Retrieved Lines Subform") - { - ApplicationArea = All; - Caption = 'Latest Retrieved Order Lines'; - Editable = false; - } - } - } - - actions - { - area(Processing) - { - action(MarkedAsResolved) - { - ApplicationArea = All; - Image = TaskList; - Caption = 'Marked as Resolved'; - ToolTip = 'If you have updated appropriately the processed Business Central documents, you can mark this conflict as resolved and update you Shopify Order with the data from Shopify.'; - - trigger OnAction() - begin - ImportOrder.MarkOrderConflictAsResolvedAndReimport(Rec); - CurrPage.Close(); - end; - } - } - area(Promoted) - { - actionref(MarkedAsResolved_Promoted; MarkedAsResolved) - { - } - } - } - trigger OnOpenPage() - var - begin - RefreshRetrievedOrder(); - end; - - var - TempRetrievedOrderHeader: Record "Shpfy Order Header" temporary; - TempRetrievedOrderLine: Record "Shpfy Order Line" temporary; - ImportOrder: Codeunit "Shpfy Import Order"; - - local procedure RefreshRetrievedOrder() - begin - ImportOrder.SetShop(Rec."Shop Code"); - ImportOrder.RetrieveOrderAndOrderLines(Rec."Shopify Order Id", TempRetrievedOrderHeader, TempRetrievedOrderLine); - CurrPage.ShopifyLatestRetrievedLines.Page.SetRetrievedLines(TempRetrievedOrderLine); - end; - -} \ No newline at end of file diff --git a/Apps/W1/Shopify/app/src/Order handling/Pages/ShpfyRetrievedLinesSubform.Page.al b/Apps/W1/Shopify/app/src/Order handling/Pages/ShpfyRetrievedLinesSubform.Page.al deleted file mode 100644 index dd41fe8340..0000000000 --- a/Apps/W1/Shopify/app/src/Order handling/Pages/ShpfyRetrievedLinesSubform.Page.al +++ /dev/null @@ -1,100 +0,0 @@ -namespace Microsoft.Integration.Shopify; - -page 30162 "Shpfy Retrieved Lines Subform" -{ - Caption = 'Shopify Order Lines'; - DeleteAllowed = false; - InsertAllowed = false; - Editable = false; - PageType = ListPart; - SourceTable = "Shpfy Order Line"; - SourceTableTemporary = true; - - layout - { - area(content) - { - repeater(RetrievedOrders) - { - field(ShopifyProductId; Rec."Shopify Product Id") - { - ApplicationArea = All; - Editable = false; - Visible = false; - ToolTip = 'Specifies a unique identifier for the product.'; - } - field(ShopifyVariantId; Rec."Shopify Variant Id") - { - ApplicationArea = All; - Editable = false; - Visible = false; - ToolTip = 'Specifies a unique identifier for the variant.'; - } - field(ItemNo; Rec."Item No.") - { - ApplicationArea = All; - ShowMandatory = true; - ToolTip = 'Specifies the item number.'; - } - field(UnitOfMeasureCode; Rec."Unit of Measure Code") - { - ApplicationArea = All; - ShowMandatory = true; - ToolTip = 'Specifies how each unit of the item is measured.'; - } - field(VariantCode; Rec."Variant Code") - { - ApplicationArea = All; - ToolTip = 'Specifies the variant of the item on the line.'; - } - field(Description; Rec.Description) - { - ApplicationArea = All; - Editable = false; - ToolTip = 'Specifies the description of the product to be sold.'; - } - field(VariantDescription; Rec."Variant Description") - { - ApplicationArea = All; - Editable = false; - ToolTip = 'Specifies the description of the variant to be sold.'; - } - field(Quantity; Rec.Quantity) - { - ApplicationArea = All; - Editable = false; - ToolTip = 'Specifies how many units are being sold.'; - } - field(UnitPrice; Rec."Unit Price") - { - ApplicationArea = All; - Editable = false; - ToolTip = 'Specifies the prices for one unit on the line.'; - } - field(DiscountAmount; Rec."Discount Amount") - { - ApplicationArea = All; - Editable = false; - ToolTip = 'Specifies the discount amount that is granted for the item on the line.'; - } - field(FullfillableQuantity; Rec."Fulfillable Quantity") - { - ApplicationArea = All; - Editable = false; - ToolTip = 'Specifies the quantity available to fulfill.'; - } - } - } - } - - internal procedure SetRetrievedLines(var OrderLine: Record "Shpfy Order Line" temporary) - begin - if not OrderLine.FindSet() then - exit; - repeat - Rec.Copy(OrderLine); - Rec.Insert(); - until OrderLine.Next() = 0; - end; - -} \ No newline at end of file diff --git a/Apps/W1/TransactionStorage/app/src/TransactionStorageImpl.Codeunit.al b/Apps/W1/TransactionStorage/app/src/TransactionStorageImpl.Codeunit.al deleted file mode 100644 index 6a0500a9db..0000000000 --- a/Apps/W1/TransactionStorage/app/src/TransactionStorageImpl.Codeunit.al +++ /dev/null @@ -1,224 +0,0 @@ -namespace System.DataAdministration; - -using Microsoft.EServices.EDocument; -using Microsoft.Finance.GeneralLedger.Ledger; -using Microsoft.Finance.GeneralLedger.Posting; -using Microsoft.Finance.GeneralLedger.Journal; -using Microsoft.Foundation.Company; -#if not CLEAN24 -using System.Azure.KeyVault; -#endif -using System.Environment; -using System.Telemetry; - -codeunit 6203 "Transaction Storage Impl." -{ - Access = Internal; - TableNo = "Transact. Storage Task Entry"; - InherentEntitlements = X; - InherentPermissions = X; - Permissions = tabledata "Transact. Storage Export State" = RIM, - tabledata "Transact. Storage Task Entry" = RIM, - tabledata "Transaction Storage Setup" = RI, - tabledata "G/L Entry" = r, - tabledata "Incoming Document" = r, - tabledata Company = r, - tabledata "Scheduled Task" = r; - - var - FeatureTelemetry: Codeunit "Feature Telemetry"; - TransactionStorageTok: Label 'Transaction Storage', Locked = true; -#if not CLEAN24 - TransactionStorageFeatureEnabledKeyTok: Label 'TransactionStorage-Enabled', Locked = true; - CannotGetStorageNameFromKeyVaultErr: Label 'Cannot get storage account name from Azure Key Vault using key %1', Locked = true; -#endif - TimeDeadlineExceededErr: Label 'A time deadline of %1 hours for the export has been exceeded. The export has been stopped.', Comment = '%1 = number of hours'; - - trigger OnRun() - var - TransactStorageExportData: Codeunit "Transact. Storage Export Data"; - begin - FeatureTelemetry.LogUsage('0000LK3', TransactionStorageTok, 'Export started'); - Rec.SetStatusStarted(); - Commit(); - - TransactStorageExportData.ExportData(Rec); - - Rec.SetStatusCompleted(); - FeatureTelemetry.LogUsage('0000LK4', TransactionStorageTok, 'Export ended'); - end; - - internal procedure ScheduleTaskToExport() - var - TransactionStorageSetup: Record "Transaction Storage Setup"; - TransactStorageExportState: Record "Transact. Storage Export State"; - TaskDateTime: DateTime; - TaskDate: Date; - begin -#if not CLEAN24 - if not IsFeatureEnabled() then - exit; -#endif - if not IsSaaSProductionCompany() then - exit; - - if IsValidTaskExist() then - exit; - - TransactStorageExportState.ResetSetup(); - if not TransactionStorageSetup.Get() then - TransactionStorageSetup.Insert(); - TaskDate := GetTaskDate(TransactionStorageSetup."Earliest Start Time"); - TaskDateTime := CreateDateTime(TaskDate, TransactionStorageSetup."Earliest Start Time"); - CreateTaskToExport(TaskDateTime, true); - end; - - internal procedure CreateTaskToExport(TaskDateTime: DateTime; IsFirstAttempt: Boolean) - var - TransactStorageTaskEntry: Record "Transact. Storage Task Entry"; - begin - TransactStorageTaskEntry.Init(); - TransactStorageTaskEntry.Insert(); - TransactStorageTaskEntry."Task ID" := - TaskScheduler.CreateTask( - Codeunit::"Transaction Storage Impl.", Codeunit::"Trans. Storage Error Handler", true, CompanyName(), - TaskDateTime, TransactStorageTaskEntry.RecordId); - TransactStorageTaskEntry.Status := TransactStorageTaskEntry.Status::Scheduled; - TransactStorageTaskEntry."Scheduled Date/Time" := TaskDateTime; - TransactStorageTaskEntry."Is First Attempt" := IsFirstAttempt; - TransactStorageTaskEntry.Modify(); - FeatureTelemetry.LogUsage('0000LNC', TransactionStorageTok, 'A new task has been scheduled to export data.'); - end; - - local procedure GetTaskDate(EarliestStartTime: Time) TaskDate: Date - var - TransactStorageTaskEntry: Record "Transact. Storage Task Entry"; - begin - TaskDate := Today(); - if Time > EarliestStartTime then - TaskDate += 1; - TransactStorageTaskEntry.SetFilter(Status, '<>%1', Enum::"Trans. Storage Export Status"::Failed); - if TransactStorageTaskEntry.FindLast() then - if DT2Date(TransactStorageTaskEntry."Starting Date/Time") + 1 > TaskDate then - TaskDate := DT2Date(TransactStorageTaskEntry."Starting Date/Time") + 1; - end; - - procedure CheckTimeDeadline(TransactStorageTaskEntry: Record "Transact. Storage Task Entry") - var - TransactionStorageSetup: Record "Transaction Storage Setup"; - begin - if not TransactionStorageSetup.Get() then - TransactionStorageSetup.Insert(); - if (CurrentDateTime() - TransactStorageTaskEntry."Starting Date/Time") >= (TransactionStorageSetup."Max. Number of Hours" * 60 * 60 * 1000) then begin - FeatureTelemetry.LogError('0000LNB', TransactionStorageTok, StrSubstNo(TimeDeadlineExceededErr, TransactionStorageSetup."Max. Number of Hours"), ''); - Error(''); - end; - end; - - local procedure IsSaaSProductionCompany(): Boolean - var - Company: Record Company; - EnvironmentInformation: Codeunit "Environment Information"; - CompanyInformationMgt: Codeunit "Company Information Mgt."; - begin - if not EnvironmentInformation.IsProduction() then - exit(false); - - if not EnvironmentInformation.IsSaaSInfrastructure() then - exit(false); - - Company.Get(CompanyName()); - if Company."Evaluation Company" then - exit(false); - - if CompanyInformationMgt.IsDemoCompany() then - exit(false); - - exit(true); - end; - - local procedure IsValidTaskExist(): Boolean - var - ScheduledTask: Record "Scheduled Task"; - OutdatedTaskScheduledDate: Date; - IsTaskOutdated: Boolean; - begin - ScheduledTask.SetRange("Run Codeunit", Codeunit::"Transaction Storage Impl."); - if not ScheduledTask.FindFirst() then - exit(false); - - OutdatedTaskScheduledDate := Today() - 7; - IsTaskOutdated := ScheduledTask."Not Before" < CreateDateTime(OutdatedTaskScheduledDate, 0T); - if (not ScheduledTask."Is Ready") or IsTaskOutdated then begin - TaskScheduler.CancelTask(ScheduledTask.ID); - exit(false); - end; - - exit(true); - end; - - procedure GetExportDataTrack(var TransactStorageTableEntry: Record "Transact. Storage Table Entry"; var RecRef: RecordRef) - var - TransactStorageExportState: Record "Transact. Storage Export State"; - begin - TransactStorageTableEntry."Table ID" := RecRef.Number; - if TransactStorageTableEntry.Find() then - exit; - TransactStorageExportState.Get(); - TransactStorageTableEntry."Last Handled Date/Time" := CreateDateTime(TransactStorageExportState."First Run Date", 0T); - TransactStorageTableEntry.Insert(); - end; - - procedure HandleIncomingDocuments(var HandledIncomingDocs: Dictionary of [Text, Integer]; var RecRef: RecordRef) - var - GLEntry: Record "G/L Entry"; - IncomingDocument: Record "Incoming Document"; - FieldRef: FieldRef; - IncDocKey: Text; - begin - if RecRef.Number = Database::"G/L Entry" then begin - FieldRef := RecRef.Field(GLEntry.FieldNo("Posting Date")); - IncDocKey := Format(FieldRef.Value, 0, ''); - FieldRef := RecRef.Field(GLEntry.FieldNo("Document No.")); - IncDocKey += '-' + Format(FieldRef.Value); - if not HandledIncomingDocs.ContainsKey(IncDocKey) then - if GetIncomingDocumentRecordFromRecordRef(IncomingDocument, RecRef) then - HandledIncomingDocs.Add(IncDocKey, IncomingDocument."Entry No."); - end; - end; - - local procedure GetIncomingDocumentRecordFromRecordRef(var IncomingDocument: Record "Incoming Document"; MainRecordRef: RecordRef): Boolean - begin - IncomingDocument.SetLoadFields(Description, "Document No.", "Document Type", "Posting Date", Posted); - if IncomingDocument.FindFromIncomingDocumentEntryNo(MainRecordRef, IncomingDocument) then - exit(true); - if IncomingDocument.FindByDocumentNoAndPostingDate(MainRecordRef, IncomingDocument) then - exit(true); - exit(false); - end; - -#if not CLEAN24 - [NonDebuggable] - local procedure IsFeatureEnabled(): Boolean - var - AzureKeyVault: Codeunit "Azure Key Vault"; - FeatureEnabledValue: Text; - begin - if not AzureKeyVault.GetAzureKeyVaultSecret(TransactionStorageFeatureEnabledKeyTok, FeatureEnabledValue) then begin - FeatureTelemetry.LogError('0000LZM', TransactionStorageTok, '', StrSubstNo(CannotGetStorageNameFromKeyVaultErr, TransactionStorageFeatureEnabledKeyTok)); - exit(false); - end; - exit(FeatureEnabledValue = 'True'); - end; -#endif - [InternalEvent(false)] - internal procedure OnBeforeCheckFeatureEnableDate(var FeatureEnableDatePassed: Boolean; var IsHandled: Boolean) - begin - end; - - [EventSubscriber(ObjectType::Codeunit, Codeunit::"Gen. Jnl.-Post Line", 'OnAfterGLFinishPosting', '', false, false)] - local procedure ScheduleTaskToExportOnOnAfterGLFinishPosting(GLEntry: Record "G/L Entry"; var GenJnlLine: Record "Gen. Journal Line"; var IsTransactionConsistent: Boolean; FirstTransactionNo: Integer; var GLRegister: Record "G/L Register"; var TempGLEntryBuf: Record "G/L Entry" temporary; var NextEntryNo: Integer; var NextTransactionNo: Integer) - begin - ScheduleTaskToExport(); - end; -} \ No newline at end of file