-
Notifications
You must be signed in to change notification settings - Fork 685
Add Analytics demo data module #28860
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
tuan-nguyen-fenwick
wants to merge
16
commits into
microsoft:main
Choose a base branch
from
tuan-nguyen-fenwick:uptake/analytics-demo-module
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 9 commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
9447e7d
Created Analytics module & added data creation for analytics
7d816c6
Added purchase document creation for analytics
9de60c3
Added Analytics Module Setup table & page for relative starting date
82a5fd4
Generate document dates from a starting date instead of hardcoding th…
864d3e6
Merged PR 35992: Added Analytics module for sales analytics data
1a5921c
Updated further changes to Analytics module
e21b5dd
Migrated "Starting Date" setup field from Analytics to Foundation set…
fc1f294
Removed InitStartingDate & updated starting date retrieval
4996825
Removed InitStartingDate usage
14c1fc1
Removed used variables (CodeCop AA0137)
9ddbd94
Added payment method for posted sales invoices in Analytics
745eeee
Unlocked Analytics reference token for translations & updated text le…
3227f30
Set hide validation dialogs during demo data creation in IT
a2e14ac
Added sales & purchase data handlers for Analytics in IT
efd5bd3
Moved sales invoice posting into a function & called purchase order p…
36bbd1b
Updated analytics purchase orders with missing payment method
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
93 changes: 93 additions & 0 deletions
93
...DemoDataset/app/DemoData/Analytics/3.Transactions/CreateExtendedPurchDocument.Codeunit.al
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,93 @@ | ||
| // ------------------------------------------------------------------------------------------------ | ||
| // Copyright (c) Microsoft Corporation. All rights reserved. | ||
| // Licensed under the MIT License. See License.txt in the project root for license information. | ||
| // ------------------------------------------------------------------------------------------------ | ||
|
|
||
| namespace Microsoft.DemoData.Analytics; | ||
|
|
||
| using Microsoft.Purchases.Document; | ||
| using Microsoft.DemoTool.Helpers; | ||
| using Microsoft.DemoData.Foundation; | ||
| using Microsoft.DemoTool; | ||
| using Microsoft.DemoData.Inventory; | ||
| using Microsoft.DemoData.Bank; | ||
| using Microsoft.DemoData.Purchases; | ||
|
|
||
| codeunit 5688 "Create Extended Purch Document" | ||
| { | ||
| InherentEntitlements = X; | ||
| InherentPermissions = X; | ||
|
|
||
| trigger OnRun() | ||
| var | ||
| ContosoCoffeeDemoDataSetup: Record "Contoso Coffee Demo Data Setup"; | ||
| PurchaseHeader: Record "Purchase Header"; | ||
| ContosoPurchase: Codeunit "Contoso Purchase"; | ||
| CreateVendor: Codeunit "Create Vendor"; | ||
| ContosoUtilities: Codeunit "Contoso Utilities"; | ||
| CreatePaymentTerms: Codeunit "Create Payment Terms"; | ||
| CreateItem: Codeunit "Create Item"; | ||
| CreatePaymentMethod: Codeunit "Create Payment Method"; | ||
| CreateLocation: Codeunit "Create Location"; | ||
| DocumentDate: Date; | ||
| StartingDate: Date; | ||
| begin | ||
| ContosoCoffeeDemoDataSetup.Get(); | ||
| StartingDate := ContosoCoffeeDemoDataSetup."Starting Date"; | ||
|
|
||
| DocumentDate := CalcDate('<-6M>', StartingDate); | ||
|
|
||
| PurchaseHeader := ContosoPurchase.InsertPurchaseHeader(Enum::"Purchase Document Type"::Order, CreateVendor.EUGraphicDesign(), AnalyticsReference(), ContosoUtilities.AdjustDate(19020101D), DocumentDate, ContosoUtilities.AdjustDate(19020101D), CreatePaymentTerms.PaymentTermsCM(), '', '', '', DocumentDate, ''); | ||
| ContosoPurchase.InsertPurchaseLineWithItem(PurchaseHeader, CreateItem.AthensDesk(), 60, '', 219.5); | ||
|
|
||
| PurchaseHeader := ContosoPurchase.InsertPurchaseHeader(Enum::"Purchase Document Type"::Order, CreateVendor.DomesticNodPublisher(), AnalyticsReference(), ContosoUtilities.AdjustDate(19020101D), DocumentDate, ContosoUtilities.AdjustDate(19020101D), CreatePaymentTerms.PaymentTermsCOD(), '', '', '', DocumentDate, CreatePaymentMethod.Cash()); | ||
| ContosoPurchase.InsertPurchaseLineWithItem(PurchaseHeader, CreateItem.ParisGuestChairBlack(), 30, '', 97.5); | ||
|
|
||
| PurchaseHeader := ContosoPurchase.InsertPurchaseHeader(Enum::"Purchase Document Type"::Order, CreateVendor.EUGraphicDesign(), AnalyticsReference(), ContosoUtilities.AdjustDate(19020101D), DocumentDate, ContosoUtilities.AdjustDate(19020101D), CreatePaymentTerms.PaymentTermsCOD(), '', '', '', DocumentDate, CreatePaymentMethod.Cash()); | ||
| ContosoPurchase.InsertPurchaseLineWithItem(PurchaseHeader, CreateItem.AthensMobilePedestal(), 25, '', 219.5); | ||
|
|
||
| PurchaseHeader := ContosoPurchase.InsertPurchaseHeader(Enum::"Purchase Document Type"::Order, CreateVendor.DomesticFirstUp(), AnalyticsReference(), ContosoUtilities.AdjustDate(19020101D), DocumentDate, ContosoUtilities.AdjustDate(19020101D), CreatePaymentTerms.PaymentTermsCOD(), '', '', '', DocumentDate, CreatePaymentMethod.Cash()); | ||
| ContosoPurchase.InsertPurchaseLineWithItem(PurchaseHeader, CreateItem.LondonSwivelChairBlue(), 23, '', 96.1); | ||
|
|
||
| PurchaseHeader := ContosoPurchase.InsertPurchaseHeader(Enum::"Purchase Document Type"::Order, CreateVendor.DomesticWorldImporter(), AnalyticsReference(), ContosoUtilities.AdjustDate(19020101D), DocumentDate, ContosoUtilities.AdjustDate(19020101D), CreatePaymentTerms.PaymentTermsCOD(), '', '', '', DocumentDate, CreatePaymentMethod.Cash()); | ||
| ContosoPurchase.InsertPurchaseLineWithItem(PurchaseHeader, CreateItem.AntwerpConferenceTable(), 50, '', 328); | ||
|
|
||
| PurchaseHeader := ContosoPurchase.InsertPurchaseHeader(Enum::"Purchase Document Type"::Order, CreateVendor.EUGraphicDesign(), AnalyticsReference(), ContosoUtilities.AdjustDate(19020101D), DocumentDate, ContosoUtilities.AdjustDate(19020101D), CreatePaymentTerms.PaymentTermsCOD(), '', '', '', DocumentDate, CreatePaymentMethod.Cash()); | ||
| ContosoPurchase.InsertPurchaseLineWithItem(PurchaseHeader, CreateItem.AmsterdamLamp(), 15, '', 27.8); | ||
|
|
||
| PurchaseHeader := ContosoPurchase.InsertPurchaseHeader(Enum::"Purchase Document Type"::Order, CreateVendor.EUGraphicDesign(), AnalyticsReference(), ContosoUtilities.AdjustDate(19020101D), DocumentDate, ContosoUtilities.AdjustDate(19020101D), CreatePaymentTerms.PaymentTermsCOD(), '', '', '', DocumentDate, CreatePaymentMethod.Cash()); | ||
| ContosoPurchase.InsertPurchaseLineWithItem(PurchaseHeader, CreateItem.BerlingGuestChairYellow(), 5, '', 27.8); | ||
|
|
||
| PurchaseHeader := ContosoPurchase.InsertPurchaseHeader(Enum::"Purchase Document Type"::Order, CreateVendor.DomesticFirstUp(), AnalyticsReference(), ContosoUtilities.AdjustDate(19020101D), DocumentDate, ContosoUtilities.AdjustDate(19020101D), CreatePaymentTerms.PaymentTermsCM(), '', '', '', DocumentDate, ''); | ||
| ContosoPurchase.InsertPurchaseLineWithItem(PurchaseHeader, CreateItem.RomeGuestChairGreen(), 39, '', 97.5); | ||
|
|
||
| PurchaseHeader := ContosoPurchase.InsertPurchaseHeader(Enum::"Purchase Document Type"::Order, CreateVendor.DomesticWorldImporter(), AnalyticsReference(), ContosoUtilities.AdjustDate(19020101D), DocumentDate, ContosoUtilities.AdjustDate(19020101D), CreatePaymentTerms.PaymentTermsCOD(), '', '', '', DocumentDate, CreatePaymentMethod.Cash()); | ||
| ContosoPurchase.InsertPurchaseLineWithItem(PurchaseHeader, CreateItem.TokyoGuestChairBlue(), 40, '', 97.5); | ||
|
|
||
| PurchaseHeader := ContosoPurchase.InsertPurchaseHeader(Enum::"Purchase Document Type"::Order, CreateVendor.DomesticFirstUp(), AnalyticsReference(), ContosoUtilities.AdjustDate(19020101D), DocumentDate, ContosoUtilities.AdjustDate(19020101D), CreatePaymentTerms.PaymentTermsCOD(), '', '', '', DocumentDate, CreatePaymentMethod.Cash()); | ||
| ContosoPurchase.InsertPurchaseLineWithItem(PurchaseHeader, CreateItem.MexicoSwivelChairBlack(), 30, '', 96.1); | ||
|
|
||
| PurchaseHeader := ContosoPurchase.InsertPurchaseHeader(Enum::"Purchase Document Type"::Order, CreateVendor.EUGraphicDesign(), AnalyticsReference(), ContosoUtilities.AdjustDate(19020101D), DocumentDate, ContosoUtilities.AdjustDate(19020101D), CreatePaymentTerms.PaymentTermsCOD(), '', '', '', DocumentDate, CreatePaymentMethod.Cash()); | ||
| ContosoPurchase.InsertPurchaseLineWithItem(PurchaseHeader, CreateItem.MunichSwivelChairYellow(), 30, '', 96.1); | ||
|
|
||
| PurchaseHeader := ContosoPurchase.InsertPurchaseHeader(Enum::"Purchase Document Type"::Order, CreateVendor.DomesticNodPublisher(), AnalyticsReference(), ContosoUtilities.AdjustDate(19020101D), DocumentDate, ContosoUtilities.AdjustDate(19020101D), CreatePaymentTerms.PaymentTermsCOD(), '', '', '', DocumentDate, CreatePaymentMethod.Cash()); | ||
| ContosoPurchase.InsertPurchaseLineWithItem(PurchaseHeader, CreateItem.MoscowSwivelChairRed(), 40, '', 96.1); | ||
|
|
||
| PurchaseHeader := ContosoPurchase.InsertPurchaseHeader(Enum::"Purchase Document Type"::Order, CreateVendor.DomesticFirstUp(), AnalyticsReference(), ContosoUtilities.AdjustDate(19020101D), DocumentDate, ContosoUtilities.AdjustDate(19020101D), CreatePaymentTerms.PaymentTermsCOD(), '', '', '', DocumentDate, CreatePaymentMethod.Cash()); | ||
| ContosoPurchase.InsertPurchaseLineWithItem(PurchaseHeader, CreateItem.SeoulGuestChairRed(), 40, '', 97.5); | ||
|
|
||
| PurchaseHeader := ContosoPurchase.InsertPurchaseHeader(Enum::"Purchase Document Type"::Order, CreateVendor.EUGraphicDesign(), AnalyticsReference(), ContosoUtilities.AdjustDate(19020101D), DocumentDate, ContosoUtilities.AdjustDate(19020101D), CreatePaymentTerms.PaymentTermsCOD(), '', '', '', DocumentDate, CreatePaymentMethod.Cash()); | ||
| ContosoPurchase.InsertPurchaseLineWithItem(PurchaseHeader, CreateItem.AtlantAWhiteboardBase(), 20, '', 707.2); | ||
|
|
||
| PurchaseHeader := ContosoPurchase.InsertPurchaseHeader(Enum::"Purchase Document Type"::Order, CreateVendor.EUGraphicDesign(), AnalyticsReference(), ContosoUtilities.AdjustDate(19020101D), DocumentDate, ContosoUtilities.AdjustDate(19020101D), CreatePaymentTerms.PaymentTermsCOD(), '', '', '', DocumentDate, CreatePaymentMethod.Cash()); | ||
| ContosoPurchase.InsertPurchaseLineWithItem(PurchaseHeader, CreateItem.SydneySwivelChairGreen(), 10, '', 96.1); | ||
| end; | ||
|
|
||
| procedure AnalyticsReference(): Text | ||
| begin | ||
| exit(AnalyticsReferenceTok); | ||
| end; | ||
|
|
||
| var | ||
| AnalyticsReferenceTok: Label 'ANALYTICS', Locked = true; | ||
|
||
| } | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.