diff --git a/.github/AL-Go-Settings.json b/.github/AL-Go-Settings.json
index 6c757d1bd7..0eb8036227 100644
--- a/.github/AL-Go-Settings.json
+++ b/.github/AL-Go-Settings.json
@@ -5,7 +5,7 @@
"runs-on": "windows-latest",
"cacheImageName": "",
"UsePsSession": false,
- "artifact": "https://bcinsider-fvh2ekdjecfjd6gk.b02.azurefd.net/sandbox/26.0.24098.0/base",
+ "artifact": "https://bcinsider-fvh2ekdjecfjd6gk.b02.azurefd.net/sandbox/26.0.24649.0/base",
"country": "base",
"useProjectDependencies": true,
"repoVersion": "26.0",
diff --git a/Apps/CH/SwissQRBill/app/src/SwissQRBillInstall.Codeunit.al b/Apps/CH/SwissQRBill/app/src/SwissQRBillInstall.Codeunit.al
index 1b4c9162ea..9074c0e444 100644
--- a/Apps/CH/SwissQRBill/app/src/SwissQRBillInstall.Codeunit.al
+++ b/Apps/CH/SwissQRBill/app/src/SwissQRBillInstall.Codeunit.al
@@ -56,9 +56,6 @@ codeunit 11517 "Swiss QR-Bill Install"
with SwissQRBillSetup do
if IsEmpty() then begin
"Address Type" := "Address Type"::Structured;
-#if not CLEAN23
- "Umlaut Chars Encode Mode" := "Umlaut Chars Encode Mode"::Double;
-#endif
if NewDefaultLayoutCode <> '' then
"Default Layout" := NewDefaultLayoutCode;
InitDefaultJournalSetup();
@@ -176,9 +173,6 @@ codeunit 11517 "Swiss QR-Bill Install"
if OldSwissQRBillSetup.Get() then begin
SwissQRBillSetup.Init();
SwissQRBillSetup."Address Type" := MapAddressType(OldSwissQRBillSetup."Address Type");
-#if not CLEAN23
- SwissQRBillSetup."Umlaut Chars Encode Mode" := MapEncodeMode(OldSwissQRBillSetup."Umlaut Chars Encode Mode");
-#endif
SwissQRBillSetup."Default Layout" := OldSwissQRBillSetup."Default Layout";
SwissQRBillSetup."Last Used Reference No." := OldSwissQRBillSetup."Last Used Reference No.";
SwissQRBillSetup."Journal Template" := OldSwissQRBillSetup."Journal Template";
@@ -231,19 +225,6 @@ codeunit 11517 "Swiss QR-Bill Install"
exit(SwissQRBillAddressType::Combined);
end;
end;
-#if not CLEAN23
- local procedure MapEncodeMode(EncodeMode: Option Single,Double,Remove) SwissQRBillUmlautEncoding: Enum "Swiss QR-Bill Umlaut Encoding"
- begin
- case EncodeMode of
- EncodeMode::Single:
- exit(SwissQRBillUmlautEncoding::Single);
- EncodeMode::Double:
- exit(SwissQRBillUmlautEncoding::Double);
- EncodeMode::Remove:
- exit(SwissQRBillUmlautEncoding::Remove);
- end;
- end;
-#endif
local procedure MapIBANType(IBANType: Option IBAN,"QR-IBAN") SwissQRBillIBANType: Enum "Swiss QR-Bill IBAN Type"
begin
diff --git a/Apps/CH/SwissQRBill/app/src/purchases/SwissQRBillPurchases.Codeunit.al b/Apps/CH/SwissQRBill/app/src/purchases/SwissQRBillPurchases.Codeunit.al
index 0f3ded6443..99e80bb9c6 100644
--- a/Apps/CH/SwissQRBill/app/src/purchases/SwissQRBillPurchases.Codeunit.al
+++ b/Apps/CH/SwissQRBill/app/src/purchases/SwissQRBillPurchases.Codeunit.al
@@ -551,35 +551,6 @@ codeunit 11502 "Swiss QR-Bill Purchases"
Message(MessageResult)
end;
-#if not CLEAN23
- [EventSubscriber(ObjectType::Codeunit, Codeunit::"Purch.-Post", 'OnBeforePostVendorEntry', '', false, false)]
- local procedure OnBeforePostVendorEntry(
- var GenJnlLine: Record "Gen. Journal Line";
- var PurchHeader: Record "Purchase Header";
- var TotalPurchLine: Record "Purchase Line";
- var TotalPurchLineLCY: Record "Purchase Line";
- PreviewMode: Boolean;
- CommitIsSupressed: Boolean;
- var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line")
- var
- QRBillCurrencyCode: Code[10];
- ErrText: Text;
- begin
- if PurchHeader."Swiss QR-Bill" and (PurchHeader."Prepayment %" = 0) and (PurchHeader."Swiss QR-Bill Amount" <> 0) then begin
- QRBillCurrencyCode := SwissQRBillIncomingDoc.GetCurrency(PurchHeader."Swiss QR-Bill Currency");
- if PurchHeader."Currency Code" <> QRBillCurrencyCode then begin
- ErrText := StrSubstNo(CurrencyErr, QRBillCurrencyCode, PurchHeader."Currency Code");
- Error(ErrText);
- end;
- if Abs(TotalPurchLine."Amount Including VAT") <> PurchHeader."Swiss QR-Bill Amount" then begin
- ErrText := StrSubstNo(AmountErr, PurchHeader."Swiss QR-Bill Amount", Abs(TotalPurchLine."Amount Including VAT"));
- Error(ErrText);
- end;
- VoidPurchDocQRBill(PurchHeader);
- end;
- end;
-#endif
-
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Purch. Post Invoice Events", 'OnPostLedgerEntryOnBeforeGenJnlPostLine', '', false, false)]
local procedure OnPostLedgerEntryOnBeforeGenJnlPostLine(
var GenJnlLine: Record "Gen. Journal Line";
diff --git a/Apps/CH/SwissQRBill/app/src/setup/SwissQRBillSetup.Page.al b/Apps/CH/SwissQRBill/app/src/setup/SwissQRBillSetup.Page.al
index f15595050a..b55b33510d 100644
--- a/Apps/CH/SwissQRBill/app/src/setup/SwissQRBillSetup.Page.al
+++ b/Apps/CH/SwissQRBill/app/src/setup/SwissQRBillSetup.Page.al
@@ -35,17 +35,6 @@ page 11514 "Swiss QR-Bill Setup"
ApplicationArea = All;
ToolTip = 'Specifies the address type used for all printed QR-bills. Recommended value is Structured.';
}
-#if not CLEAN23
- field(UmlautCharsEncodeMode; "Umlaut Chars Encode Mode")
- {
- ApplicationArea = All;
- ToolTip = 'Specifies the German umlaut characters encoding mode. "Single" mode: "Ä" to "A". "Double" mode: "Ä" to "Ae". The recommended value is Double.';
- Visible = false;
- ObsoleteReason = 'No need to convert umlauts, because encoding was changed to UTF-8.';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
- }
-#endif
field(DefaultQRBillLayout; "Default Layout")
{
ApplicationArea = All;
diff --git a/Apps/CH/SwissQRBill/app/src/setup/SwissQRBillSetup.Table.al b/Apps/CH/SwissQRBill/app/src/setup/SwissQRBillSetup.Table.al
index 825e162425..00e9e465b6 100644
--- a/Apps/CH/SwissQRBill/app/src/setup/SwissQRBillSetup.Table.al
+++ b/Apps/CH/SwissQRBill/app/src/setup/SwissQRBillSetup.Table.al
@@ -29,13 +29,8 @@ table 11512 "Swiss QR-Bill Setup"
{
Caption = 'German Umlaut Chars Encoding Mode';
ObsoleteReason = 'No need to convert umlauts, because encoding was changed to UTF-8.';
-#if CLEAN23
ObsoleteState = Removed;
ObsoleteTag = '26.0';
-#else
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-#endif
}
field(8; "Default Layout"; Code[20])
{
diff --git a/Apps/CH/SwissQRBill/app/src/setup/SwissQRBillSetupWizard.Page.al b/Apps/CH/SwissQRBill/app/src/setup/SwissQRBillSetupWizard.Page.al
index 3f9bbcab67..8446e2c8bd 100644
--- a/Apps/CH/SwissQRBill/app/src/setup/SwissQRBillSetupWizard.Page.al
+++ b/Apps/CH/SwissQRBill/app/src/setup/SwissQRBillSetupWizard.Page.al
@@ -154,18 +154,6 @@ page 11516 "Swiss QR-Bill Setup Wizard"
ShowMandatory = true;
ToolTip = 'Specifies the address type used for all printed QR-Bills. Recommended value is Structured.';
}
-#if not CLEAN23
- field(UmlautCharsEncodeMode; "Umlaut Chars Encode Mode")
- {
- ApplicationArea = All;
- ShowMandatory = true;
- ToolTip = 'Specifies the German umlaut characters encoding mode. "Single" mode: "Ä" to "A". "Double" mode: "Ä" to "Ae". Recommended value is Double.';
- Visible = false;
- ObsoleteReason = 'No need to convert umlauts, because encoding was changed to UTF-8.';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
- }
-#endif
}
}
group(DefaultLayoutStep)
diff --git a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Pages/AdvanceLetterTemplatesCZZ.Page.al b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Pages/AdvanceLetterTemplatesCZZ.Page.al
index be821204ef..d08fa336cd 100644
--- a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Pages/AdvanceLetterTemplatesCZZ.Page.al
+++ b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Pages/AdvanceLetterTemplatesCZZ.Page.al
@@ -72,50 +72,6 @@ page 31179 "Advance Letter Templates CZZ"
{
ApplicationArea = Basic, Suite;
}
-#if not CLEAN23
-#pragma warning disable AL0432,AS0074
- field("Document Report ID"; '')
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies document report ID.';
- Visible = false;
- Enabled = false;
- ObsoleteReason = 'Replaced by standard report selection.';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
- }
- field("Document Report Caption"; '')
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies document report caption.';
- Visible = false;
- Enabled = false;
- ObsoleteReason = 'Replaced by standard report selection.';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
- }
- field("Invoice/Cr. Memo Report ID"; '')
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies invoice/credit memo report ID';
- Visible = false;
- Enabled = false;
- ObsoleteReason = 'Replaced by standard report selection.';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
- }
- field("Invoice/Cr. Memo Rep. Caption"; '')
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies invoice/credit memo report caption.';
- Visible = false;
- Enabled = false;
- ObsoleteReason = 'Replaced by standard report selection.';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
- }
-#pragma warning restore AL0432,AS0074
-#endif
}
}
}
diff --git a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Tables/PurchAdvLetterHeaderCZZ.Table.al b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Tables/PurchAdvLetterHeaderCZZ.Table.al
index 95b874b056..14f8c74268 100644
--- a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Tables/PurchAdvLetterHeaderCZZ.Table.al
+++ b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Tables/PurchAdvLetterHeaderCZZ.Table.al
@@ -19,9 +19,6 @@ using Microsoft.Finance.GeneralLedger.Setup;
using Microsoft.Finance.ReceivablesPayables;
using Microsoft.Finance.VAT.Calculation;
using Microsoft.Finance.VAT.Setup;
-#if not CLEAN23
-using Microsoft.FixedAssets.Journal;
-#endif
using Microsoft.Foundation.Address;
using Microsoft.Foundation.Attachment;
using Microsoft.Foundation.AuditCodes;
@@ -1058,38 +1055,6 @@ table 31008 "Purch. Adv. Letter Header CZZ"
exit((not HasPayToAddress()) and PayToVendor.HasAddress());
end;
-#if not CLEAN23
-#pragma warning disable AL0432
- [Obsolete('Temporary fix to convert Dim Arrays to Dictionary', '23.0')]
- local procedure CreateDefaultDimSourcesFromDimArray(var DefaultDimSource: List of [Dictionary of [Integer, Code[20]]]; TableID: array[10] of Integer; No: array[10] of Code[20])
- var
- DimArrayConversionHelper: Codeunit "Dim. Array Conversion Helper";
- begin
- DimArrayConversionHelper.CreateDefaultDimSourcesFromDimArray(Database::"FA Journal Line", DefaultDimSource, TableID, No);
- end;
-
- [Obsolete('Temporary fix to convert Dim Arrays to Dictionary', '23.0')]
- local procedure CreateDimTableIDs(DefaultDimSource: List of [Dictionary of [Integer, Code[20]]]; var TableID: array[10] of Integer; var No: array[10] of Code[20])
- var
- DimArrayConversionHelper: Codeunit "Dim. Array Conversion Helper";
- begin
- DimArrayConversionHelper.CreateDimTableIDs(Database::"FA Journal Line", DefaultDimSource, TableID, No);
- end;
-
- [Obsolete('Temporary fix to convert Dim Arrays to Dictionary', '23.0')]
- local procedure RunEventOnAfterCreateDimTableIDs(var DefaultDimSource: List of [Dictionary of [Integer, Code[20]]])
- var
- DimArrayConversionHelper: Codeunit "Dim. Array Conversion Helper";
- TableID: array[10] of Integer;
- No: array[10] of Code[20];
- begin
- CreateDimTableIDs(DefaultDimSource, TableID, No);
- OnAfterCreateDimTableIDs(Rec, CurrFieldNo, TableID, No);
- CreateDefaultDimSourcesFromDimArray(DefaultDimSource, TableID, No);
- end;
-#pragma warning restore AL0432
-
-#endif
procedure CreateDimFromDefaultDim(FieldNo: Integer)
var
DefaultDimSource: List of [Dictionary of [Integer, Code[20]]];
@@ -1104,11 +1069,6 @@ table 31008 "Purch. Adv. Letter Header CZZ"
DimensionManagement.AddDimSource(DefaultDimSource, Database::"Salesperson/Purchaser", Rec."Purchaser Code", FieldNo = Rec.FieldNo("Purchaser Code"));
DimensionManagement.AddDimSource(DefaultDimSource, Database::"Responsibility Center", Rec."Responsibility Center", FieldNo = Rec.FieldNo("Responsibility Center"));
-#if not CLEAN23
-#pragma warning disable AL0432
- RunEventOnAfterCreateDimTableIDs(DefaultDimSource);
-#pragma warning restore AL0432
-#endif
OnAfterInitDefaultDimensionSources(Rec, DefaultDimSource);
end;
@@ -1713,16 +1673,6 @@ table 31008 "Purch. Adv. Letter Header CZZ"
begin
end;
-#if not CLEAN23
-#pragma warning disable AL0432
- [Obsolete('Use OnAfterInitDefaultDimensionSources instead.', '23.0')]
- [IntegrationEvent(false, false)]
- local procedure OnAfterCreateDimTableIDs(var PurchAdvLetterHeaderCZZ: Record "Purch. Adv. Letter Header CZZ"; CallingFieldNo: Integer; var TableID: array[10] of Integer; var No: array[10] of Code[20])
- begin
- end;
-#pragma warning restore AL0432
-
-#endif
[IntegrationEvent(false, false)]
local procedure OnAfterUpdatePayToCont(var PurchAdvLetterHeaderCZZ: Record "Purch. Adv. Letter Header CZZ"; Vendor: Record Vendor; Contact: Record Contact)
begin
diff --git a/Apps/CZ/AdvancedLocalizationPack/app/Src/Codeunits/UndoShipmentLineHandlerCZA.Codeunit.al b/Apps/CZ/AdvancedLocalizationPack/app/Src/Codeunits/UndoShipmentLineHandlerCZA.Codeunit.al
index 05335f5df7..ce5a92c9ce 100644
--- a/Apps/CZ/AdvancedLocalizationPack/app/Src/Codeunits/UndoShipmentLineHandlerCZA.Codeunit.al
+++ b/Apps/CZ/AdvancedLocalizationPack/app/Src/Codeunits/UndoShipmentLineHandlerCZA.Codeunit.al
@@ -6,6 +6,7 @@ namespace Microsoft.Sales.History;
using Microsoft.Inventory.Item;
using Microsoft.Inventory.Journal;
+using Microsoft.Inventory.Transfer;
codeunit 31444 "Undo Shipment Line Handler CZA"
{
@@ -19,4 +20,10 @@ codeunit 31444 "Undo Shipment Line Handler CZA"
Item.Get(ItemJournalLine."Item No.");
ItemJournalLine."Unit of Measure Code" := Item."Base Unit of Measure";
end;
+
+ [EventSubscriber(ObjectType::Codeunit, Codeunit::"Undo Transfer Shipment", 'OnAfterCopyItemJnlLineFromTransShpt', '', false, false)]
+ local procedure OnAfterCopyItemJnlLineFromTransShpt(var ItemJournalLine: Record "Item Journal Line"; TransferShipmentLine: Record "Transfer Shipment Line")
+ begin
+ ItemJournalLine."Gen. Bus. Posting Group" := TransferShipmentLine."Gen.Bus.Post.Group Ship CZA";
+ end;
}
diff --git a/Apps/CZ/BankingDocumentsLocalization/app/Src/Codeunits/InstallApplicationCZB.Codeunit.al b/Apps/CZ/BankingDocumentsLocalization/app/Src/Codeunits/InstallApplicationCZB.Codeunit.al
index 74ff556d9e..927ced19b4 100644
--- a/Apps/CZ/BankingDocumentsLocalization/app/Src/Codeunits/InstallApplicationCZB.Codeunit.al
+++ b/Apps/CZ/BankingDocumentsLocalization/app/Src/Codeunits/InstallApplicationCZB.Codeunit.al
@@ -520,8 +520,8 @@ codeunit 31330 "Install Application CZB"
local procedure InitExpLauncherSEPA()
var
BankExportImportSetup: Record "Bank Export/Import Setup";
- SEPACZCodeTok: Label 'SEPACZ', Locked = true;
- SEPACZNameTxt: Label 'SEPA Czech';
+ SEPACZCodeTok: Label 'SEPACZPAIN00100109', Locked = true;
+ SEPACZNameTxt: Label 'SEPA Czech - payment orders pain.001.001.09';
begin
if not BankExportImportSetup.Get(SEPACZCodeTok) then begin
BankExportImportSetup.Init();
@@ -531,7 +531,7 @@ codeunit 31330 "Install Application CZB"
BankExportImportSetup.Name := SEPACZNameTxt;
BankExportImportSetup.Direction := BankExportImportSetup.Direction::Export;
BankExportImportSetup."Processing Codeunit ID" := Codeunit::"Export Launcher SEPA CZB";
- BankExportImportSetup."Processing XMLport ID" := XmlPort::"SEPA CT pain.001.001.03";
+ BankExportImportSetup."Processing XMLport ID" := XmlPort::"SEPA CT pain.001.001.09";
BankExportImportSetup."Check Export Codeunit" := Codeunit::"SEPA CT-Check Line";
BankExportImportSetup."Preserve Non-Latin Characters" := false;
BankExportImportSetup.Modify();
diff --git a/Apps/CZ/BankingDocumentsLocalization/app/Src/Codeunits/MatchBankPaymentCZB.Codeunit.al b/Apps/CZ/BankingDocumentsLocalization/app/Src/Codeunits/MatchBankPaymentCZB.Codeunit.al
index d4433c8f68..d7614056c5 100644
--- a/Apps/CZ/BankingDocumentsLocalization/app/Src/Codeunits/MatchBankPaymentCZB.Codeunit.al
+++ b/Apps/CZ/BankingDocumentsLocalization/app/Src/Codeunits/MatchBankPaymentCZB.Codeunit.al
@@ -469,18 +469,4 @@ codeunit 31362 "Match Bank Payment CZB"
local procedure OnFillMatchBankPaymentBufferEmployeeOnAfterEmployeeLedgerEntrySetFilters(var EmployeeLedgerEntry: Record "Employee Ledger Entry"; SearchRuleLineCZB: Record "Search Rule Line CZB"; var GenJournalLine: Record "Gen. Journal Line")
begin
end;
-#if not CLEAN23
-
- [IntegrationEvent(false, false)]
- [Obsolete('The event is no longer triggered.', '23.0')]
- local procedure OnBeforeFillMatchBankPaymentBufferSalesAdvance(GenJournalLine: Record "Gen. Journal Line"; SearchRuleLineCZB: Record "Search Rule Line CZB"; var TempMatchBankPaymentBufferCZB: Record "Match Bank Payment Buffer CZB"; var IsHandled: Boolean);
- begin
- end;
-
- [IntegrationEvent(false, false)]
- [Obsolete('The event is no longer triggered.', '23.0')]
- local procedure OnBeforeFillMatchBankPaymentBufferPurchaseAdvance(GenJournalLine: Record "Gen. Journal Line"; SearchRuleLineCZB: Record "Search Rule Line CZB"; var TempMatchBankPaymentBufferCZB: Record "Match Bank Payment Buffer CZB"; var IsHandled: Boolean);
- begin
- end;
-#endif
}
diff --git a/Apps/CZ/CashDeskLocalization/app/Src/Tables/CashDocumentLineCZP.Table.al b/Apps/CZ/CashDeskLocalization/app/Src/Tables/CashDocumentLineCZP.Table.al
index 9a69165738..09ce1fae5c 100644
--- a/Apps/CZ/CashDeskLocalization/app/Src/Tables/CashDocumentLineCZP.Table.al
+++ b/Apps/CZ/CashDeskLocalization/app/Src/Tables/CashDocumentLineCZP.Table.al
@@ -220,9 +220,12 @@ table 11733 "Cash Document Line CZP"
end;
"Account Type"::Employee:
begin
- CashDocumentHeaderCZP.TestField("Currency Code", '');
Employee.Get("Account No.");
Description := CopyStr(Employee.FullName(), 1, MaxStrLen(Description));
+ "Posting Group" := Employee."Employee Posting Group";
+ "Gen. Posting Type" := "Gen. Posting Type"::" ";
+ "VAT Bus. Posting Group" := '';
+ "VAT Prod. Posting Group" := '';
end;
end;
diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/CorrectionsPostingMgtCZL.Codeunit.al b/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/CorrectionsPostingMgtCZL.Codeunit.al
index ba5c305448..fd14df8ca1 100644
--- a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/CorrectionsPostingMgtCZL.Codeunit.al
+++ b/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/CorrectionsPostingMgtCZL.Codeunit.al
@@ -380,36 +380,6 @@ codeunit 11796 "Corrections Posting Mgt. CZL"
ServiceLine."Negative CZL" := (ServiceLine.Quantity < 0);
end;
-#if not CLEAN23
-#pragma warning disable AL0432
- [EventSubscriber(ObjectType::Table, Database::"Invoice Post. Buffer", 'OnAfterInvPostBufferPrepareSales', '', false, false)]
- local procedure InvPostBufferSetCorrectionOnAfterInvPostBufferPrepareSales(var SalesLine: Record "Sales Line"; var InvoicePostBuffer: Record "Invoice Post. Buffer")
- var
- SalesHeader: Record "Sales Header";
- begin
- SalesHeader.Get(SalesLine."Document Type", SalesLine."Document No.");
- InvoicePostBuffer."Correction CZL" := SalesHeader.Correction xor SalesLine."Negative CZL";
- end;
-
- [EventSubscriber(ObjectType::Table, Database::"Invoice Post. Buffer", 'OnAfterInvPostBufferPreparePurchase', '', false, false)]
- local procedure InvPostBufferSetCorrectionOnAfterInvPostBufferPreparePurchase(var PurchaseLine: Record "Purchase Line"; var InvoicePostBuffer: Record "Invoice Post. Buffer")
- var
- PurchaseHeader: Record "Purchase Header";
- begin
- PurchaseHeader.Get(PurchaseLine."Document Type", PurchaseLine."Document No.");
- InvoicePostBuffer."Correction CZL" := PurchaseHeader.Correction xor PurchaseLine."Negative CZL";
- end;
-
- [EventSubscriber(ObjectType::Table, Database::"Invoice Post. Buffer", 'OnAfterInvPostBufferPrepareService', '', false, false)]
- local procedure InvPostBufferSetCorrectionOnAfterInvPostBufferPrepareService(var ServiceLine: Record "Service Line"; var InvoicePostBuffer: Record "Invoice Post. Buffer")
- var
- ServiceHeader: Record "Service Header";
- begin
- ServiceHeader.Get(ServiceLine."Document Type", ServiceLine."Document No.");
- InvoicePostBuffer."Correction CZL" := ServiceHeader.Correction xor ServiceLine."Negative CZL";
- end;
-#pragma warning restore AL0432
-#endif
[EventSubscriber(ObjectType::Codeunit, Codeunit::Microsoft.Sales.Posting."Sales Post Invoice Events", 'OnAfterPrepareInvoicePostingBuffer', '', false, false)]
local procedure SetCorrectionOnAfterPrepareSales(var SalesLine: Record "Sales Line"; var InvoicePostingBuffer: Record "Invoice Posting Buffer")
var
diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/DataClassEvalHandlerCZL.Codeunit.al b/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/DataClassEvalHandlerCZL.Codeunit.al
index 77eee976fe..e4de80ac17 100644
--- a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/DataClassEvalHandlerCZL.Codeunit.al
+++ b/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/DataClassEvalHandlerCZL.Codeunit.al
@@ -89,11 +89,6 @@ codeunit 11710 "Data Class. Eval. Handler CZL"
#pragma warning restore AL0432
InventoryPostingSetup: Record "Inventory Posting Setup";
InventorySetup: Record "Inventory Setup";
-#if not CLEAN23
-#pragma warning disable AL0432
- InvoicePostBuffer: Record "Invoice Post. Buffer";
-#pragma warning restore AL0432
-#endif
InvoicePostingBuffer: Record "Invoice Posting Buffer";
InventoryReportEntry: Record "Inventory Report Entry";
IsolatedCertificate: Record "Isolated Certificate";
@@ -261,19 +256,9 @@ codeunit 11710 "Data Class. Eval. Handler CZL"
DataClassificationMgt.SetFieldToNormal(Database::"Company Information", CompanyInformation.FieldNo("Default Bank Account Code CZL"));
DataClassificationMgt.SetFieldToNormal(Database::"Company Information", CompanyInformation.FieldNo("Bank Account Format Check CZL"));
DataClassificationMgt.SetFieldToNormal(Database::"Company Information", CompanyInformation.FieldNo("Tax Registration No. CZL"));
-#if not CLEAN23
-#pragma warning disable AL0432
- DataClassificationMgt.SetFieldToNormal(Database::Contact, Contact.FieldNo("Registration No. CZL"));
-#pragma warning restore AL0432
-#endif
DataClassificationMgt.SetFieldToNormal(Database::Contact, Contact.FieldNo("Tax Registration No. CZL"));
DataClassificationMgt.SetFieldToNormal(Database::"Copy Gen. Journal Parameters", CopyGenJournalParameters.FieldNo("Replace VAT Date CZL"));
DataClassificationMgt.SetFieldToNormal(Database::"Cust. Ledger Entry", CustLedgerEntry.FieldNo("VAT Date CZL"));
-#if not CLEAN23
-#pragma warning disable AL0432
- DataClassificationMgt.SetFieldToNormal(Database::Customer, Customer.FieldNo("Registration No. CZL"));
-#pragma warning restore AL0432
-#endif
DataClassificationMgt.SetFieldToNormal(Database::Customer, Customer.FieldNo("Tax Registration No. CZL"));
DataClassificationMgt.SetFieldToNormal(Database::Customer, Customer.FieldNo("Validate Registration No. CZL"));
DataClassificationMgt.SetFieldToNormal(Database::"Customer Templ.", CustomerTempl.FieldNo("Validate Registration No. CZL"));
@@ -327,15 +312,6 @@ codeunit 11710 "Data Class. Eval. Handler CZL"
DataClassificationMgt.SetFieldToNormal(Database::"Inventory Setup", InventorySetup.FieldNo("Def.Tmpl. for Phys.Neg.Adj CZL"));
DataClassificationMgt.SetFieldToNormal(Database::"Inventory Setup", InventorySetup.FieldNo("Post Exp.Cost Conv.As Corr.CZL"));
DataClassificationMgt.SetFieldToNormal(Database::"Inventory Setup", InventorySetup.FieldNo("Post Neg.Transf. As Corr.CZL"));
-#if not CLEAN23
-#pragma warning disable AL0432
- DataClassificationMgt.SetFieldToNormal(Database::"Invoice Post. Buffer", InvoicePostBuffer.FieldNo("Ext. Amount CZL"));
- DataClassificationMgt.SetFieldToNormal(Database::"Invoice Post. Buffer", InvoicePostBuffer.FieldNo("Ext. Amount Incl. VAT CZL"));
- DataClassificationMgt.SetFieldToNormal(Database::"Invoice Post. Buffer", InvoicePostBuffer.FieldNo("VAT Date CZL"));
- DataClassificationMgt.SetFieldToNormal(Database::"Invoice Post. Buffer", InvoicePostBuffer.FieldNo("Correction CZL"));
- DataClassificationMgt.SetFieldToNormal(Database::"Invoice Post. Buffer", InvoicePostBuffer.FieldNo("Original Doc. VAT Date CZL"));
-#pragma warning restore AL0432
-#endif
#if not CLEAN24
#pragma warning disable AL0432
DataClassificationMgt.SetFieldToNormal(Database::"Invoice Posting Buffer", InvoicePostingBuffer.FieldNo("Ext. Amount CZL"));
@@ -385,11 +361,6 @@ codeunit 11710 "Data Class. Eval. Handler CZL"
DataClassificationMgt.SetFieldToNormal(Database::"Purchase Header", PurchaseHeader.FieldNo("Registration No. CZL"));
DataClassificationMgt.SetFieldToNormal(Database::"Purchase Header", PurchaseHeader.FieldNo("Tax Registration No. CZL"));
DataClassificationMgt.SetFieldToNormal(Database::"Purchase Header", PurchaseHeader.FieldNo("EU 3-Party Intermed. Role CZL"));
-#if not CLEAN23
-#pragma warning disable AL0432
- DataClassificationMgt.SetFieldToNormal(Database::"Purchase Header", PurchaseHeader.FieldNo("EU 3-Party Trade CZL"));
-#pragma warning restore AL0432
-#endif
DataClassificationMgt.SetFieldToNormal(Database::"Purchase Header", PurchaseHeader.FieldNo("Original Doc. VAT Date CZL"));
DataClassificationMgt.SetFieldToNormal(Database::"Purchase Header Archive", PurchaseHeaderArchive.FieldNo("VAT Currency Factor CZL"));
DataClassificationMgt.SetFieldToNormal(Database::"Purchase Header Archive", PurchaseHeaderArchive.FieldNo("VAT Currency Code CZL"));
@@ -410,11 +381,6 @@ codeunit 11710 "Data Class. Eval. Handler CZL"
DataClassificationMgt.SetFieldToNormal(Database::"Purch. Cr. Memo Hdr.", PurchCrMemoHdr.FieldNo("Registration No. CZL"));
DataClassificationMgt.SetFieldToNormal(Database::"Purch. Cr. Memo Hdr.", PurchCrMemoHdr.FieldNo("Tax Registration No. CZL"));
DataClassificationMgt.SetFieldToNormal(Database::"Purch. Cr. Memo Hdr.", PurchCrMemoHdr.FieldNo("EU 3-Party Intermed. Role CZL"));
-#if not CLEAN23
-#pragma warning disable AL0432
- DataClassificationMgt.SetFieldToNormal(Database::"Purch. Cr. Memo Hdr.", PurchCrMemoHdr.FieldNo("EU 3-Party Trade CZL"));
-#pragma warning restore AL0432
-#endif
DataClassificationMgt.SetFieldToNormal(Database::"Purch. Cr. Memo Hdr.", PurchCrMemoHdr.FieldNo("Original Doc. VAT Date CZL"));
DataClassificationMgt.SetFieldToNormal(Database::"Purch. Cr. Memo Line", PurchCrMemoLine.FieldNo("Tariff No. CZL"));
DataClassificationMgt.SetFieldToNormal(Database::"Purch. Inv. Header", PurchInvHeader.FieldNo("VAT Currency Factor CZL"));
@@ -422,11 +388,6 @@ codeunit 11710 "Data Class. Eval. Handler CZL"
DataClassificationMgt.SetFieldToNormal(Database::"Purch. Inv. Header", PurchInvHeader.FieldNo("Registration No. CZL"));
DataClassificationMgt.SetFieldToNormal(Database::"Purch. Inv. Header", PurchInvHeader.FieldNo("Tax Registration No. CZL"));
DataClassificationMgt.SetFieldToNormal(Database::"Purch. Inv. Header", PurchInvHeader.FieldNo("EU 3-Party Intermed. Role CZL"));
-#if not CLEAN23
-#pragma warning disable AL0432
- DataClassificationMgt.SetFieldToNormal(Database::"Purch. Inv. Header", PurchInvHeader.FieldNo("EU 3-Party Trade CZL"));
-#pragma warning restore AL0432
-#endif
DataClassificationMgt.SetFieldToNormal(Database::"Purch. Inv. Header", PurchInvHeader.FieldNo("Original Doc. VAT Date CZL"));
DataClassificationMgt.SetFieldToNormal(Database::"Purch. Inv. Line", PurchInvLine.FieldNo("Tariff No. CZL"));
DataClassificationMgt.SetFieldToNormal(Database::"Purch. Rcpt. Header", PurchRcptHeader.FieldNo("Registration No. CZL"));
@@ -571,22 +532,12 @@ codeunit 11710 "Data Class. Eval. Handler CZL"
DataClassificationMgt.SetFieldToNormal(Database::"VAT Statement Line", VATStatementLine.FieldNo("Gen. Prod. Posting Group CZL"));
DataClassificationMgt.SetFieldToNormal(Database::"VAT Statement Line", VATStatementLine.FieldNo("Show CZL"));
DataClassificationMgt.SetFieldToNormal(Database::"VAT Statement Line", VATStatementLine.FieldNo("EU 3-Party Intermed. Role CZL"));
-#if not CLEAN23
-#pragma warning disable AL0432
- DataClassificationMgt.SetFieldToNormal(Database::"VAT Statement Line", VATStatementLine.FieldNo("EU-3 Party Trade CZL"));
-#pragma warning restore AL0432
-#endif
DataClassificationMgt.SetFieldToNormal(Database::"VAT Statement Line", VATStatementLine.FieldNo("VAT Ctrl. Report Section CZL"));
DataClassificationMgt.SetFieldToNormal(Database::"VAT Statement Line", VATStatementLine.FieldNo("Ignore Simpl. Doc. Limit CZL"));
DataClassificationMgt.SetFieldToNormal(Database::"VAT Statement Name", VATStatementName.FieldNo("Comments CZL"));
DataClassificationMgt.SetFieldToNormal(Database::"VAT Statement Name", VATStatementName.FieldNo("Attachments CZL"));
DataClassificationMgt.SetFieldToNormal(Database::"VAT Statement Template", VATStatementTemplate.FieldNo("XML Format CZL"));
DataClassificationMgt.SetFieldToNormal(Database::"VAT Statement Template", VATStatementTemplate.FieldNo("Allow Comments/Attachments CZL"));
-#if not CLEAN23
-#pragma warning disable AL0432
- DataClassificationMgt.SetFieldToNormal(Database::Vendor, Vendor.FieldNo("Registration No. CZL"));
-#pragma warning restore AL0432
-#endif
DataClassificationMgt.SetFieldToNormal(Database::Vendor, Vendor.FieldNo("Tax Registration No. CZL"));
DataClassificationMgt.SetFieldToNormal(Database::Vendor, Vendor.FieldNo("Validate Registration No. CZL"));
DataClassificationMgt.SetFieldToNormal(Database::Vendor, Vendor.FieldNo("Last Unreliab. Check Date CZL"));
diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/InstallApplicationCZL.Codeunit.al b/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/InstallApplicationCZL.Codeunit.al
index b0a504b302..4f211f640e 100644
--- a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/InstallApplicationCZL.Codeunit.al
+++ b/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/InstallApplicationCZL.Codeunit.al
@@ -463,9 +463,6 @@ codeunit 11748 "Install Application CZL"
CustomerDataTransfer: DataTransfer;
begin
CustomerDataTransfer.SetTables(Database::Customer, Database::Customer);
-#if not CLEAN23
- CustomerDataTransfer.AddFieldValue(Customer.FieldNo("Registration No."), Customer.FieldNo("Registration No. CZL"));
-#endif
CustomerDataTransfer.AddFieldValue(Customer.FieldNo("Registration No."), Customer.FieldNo("Registration Number"));
CustomerDataTransfer.AddFieldValue(Customer.FieldNo("Tax Registration No."), Customer.FieldNo("Tax Registration No. CZL"));
CustomerDataTransfer.AddFieldValue(Customer.FieldNo("Transaction Type"), Customer.FieldNo("Transaction Type CZL"));
@@ -481,9 +478,6 @@ codeunit 11748 "Install Application CZL"
VendorDataTransfer: DataTransfer;
begin
VendorDataTransfer.SetTables(Database::Vendor, Database::Vendor);
-#if not CLEAN23
- VendorDataTransfer.AddFieldValue(Vendor.FieldNo("Registration No."), Vendor.FieldNo("Registration No. CZL"));
-#endif
VendorDataTransfer.AddFieldValue(Vendor.FieldNo("Registration No."), Vendor.FieldNo("Registration Number"));
VendorDataTransfer.AddFieldValue(Vendor.FieldNo("Tax Registration No."), Vendor.FieldNo("Tax Registration No. CZL"));
VendorDataTransfer.AddFieldValue(Vendor.FieldNo("Disable Uncertainty Check"), Vendor.FieldNo("Disable Unreliab. Check CZL"));
@@ -510,9 +504,6 @@ codeunit 11748 "Install Application CZL"
ContactDataTransfer: DataTransfer;
begin
ContactDataTransfer.SetTables(Database::Contact, Database::Contact);
-#if not CLEAN23
- ContactDataTransfer.AddFieldValue(Contact.FieldNo("Registration No."), Contact.FieldNo("Registration No. CZL"));
-#endif
ContactDataTransfer.AddFieldValue(Contact.FieldNo("Registration No."), Contact.FieldNo("Registration Number"));
ContactDataTransfer.AddFieldValue(Contact.FieldNo("Tax Registration No."), Contact.FieldNo("Tax Registration No. CZL"));
ContactDataTransfer.CopyFields();
@@ -1122,9 +1113,6 @@ codeunit 11748 "Install Application CZL"
PurchaseHeaderDataTransfer.AddFieldValue(PurchaseHeader.FieldNo("Physical Transfer"), PurchaseHeader.FieldNo("Physical Transfer CZL"));
PurchaseHeaderDataTransfer.AddFieldValue(PurchaseHeader.FieldNo("Intrastat Exclude"), PurchaseHeader.FieldNo("Intrastat Exclude CZL"));
PurchaseHeaderDataTransfer.AddFieldValue(PurchaseHeader.FieldNo("EU 3-Party Intermediate Role"), PurchaseHeader.FieldNo("EU 3-Party Intermed. Role CZL"));
-#if not CLEAN23
- PurchaseHeaderDataTransfer.AddFieldValue(PurchaseHeader.FieldNo("EU 3-Party Trade"), PurchaseHeader.FieldNo("EU 3-Party Trade CZL"));
-#endif
PurchaseHeaderDataTransfer.AddFieldValue(PurchaseHeader.FieldNo("EU 3-Party Trade"), PurchaseHeader.FieldNo("EU 3 Party Trade"));
PurchaseHeaderDataTransfer.AddFieldValue(PurchaseHeader.FieldNo("Original Document VAT Date"), PurchaseHeader.FieldNo("Original Doc. VAT Date CZL"));
PurchaseHeaderDataTransfer.AddFieldValue(PurchaseHeader.FieldNo("VAT Currency Factor"), PurchaseHeader.FieldNo("VAT Currency Factor CZL"));
@@ -1167,9 +1155,6 @@ codeunit 11748 "Install Application CZL"
PurchInvHeaderDataTransfer.AddFieldValue(PurchInvHeader.FieldNo("Physical Transfer"), PurchInvHeader.FieldNo("Physical Transfer CZL"));
PurchInvHeaderDataTransfer.AddFieldValue(PurchInvHeader.FieldNo("Intrastat Exclude"), PurchInvHeader.FieldNo("Intrastat Exclude CZL"));
PurchInvHeaderDataTransfer.AddFieldValue(PurchInvHeader.FieldNo("EU 3-Party Intermediate Role"), PurchInvHeader.FieldNo("EU 3-Party Intermed. Role CZL"));
-#if not CLEAN23
- PurchInvHeaderDataTransfer.AddFieldValue(PurchInvHeader.FieldNo("EU 3-Party Trade"), PurchInvHeader.FieldNo("EU 3-Party Trade CZL"));
-#endif
PurchInvHeaderDataTransfer.AddFieldValue(PurchInvHeader.FieldNo("EU 3-Party Trade"), PurchInvHeader.FieldNo("EU 3 Party Trade"));
PurchInvHeaderDataTransfer.AddFieldValue(PurchInvHeader.FieldNo("Original Document VAT Date"), PurchInvHeader.FieldNo("Original Doc. VAT Date CZL"));
PurchInvHeaderDataTransfer.AddFieldValue(PurchInvHeader.FieldNo("VAT Currency Factor"), PurchInvHeader.FieldNo("VAT Currency Factor CZL"));
@@ -1197,9 +1182,6 @@ codeunit 11748 "Install Application CZL"
PurchCrMemoHdrDataTransfer.AddFieldValue(PurchCrMemoHdr.FieldNo("Physical Transfer"), PurchCrMemoHdr.FieldNo("Physical Transfer CZL"));
PurchCrMemoHdrDataTransfer.AddFieldValue(PurchCrMemoHdr.FieldNo("Intrastat Exclude"), PurchCrMemoHdr.FieldNo("Intrastat Exclude CZL"));
PurchCrMemoHdrDataTransfer.AddFieldValue(PurchCrMemoHdr.FieldNo("EU 3-Party Intermediate Role"), PurchCrMemoHdr.FieldNo("EU 3-Party Intermed. Role CZL"));
-#if not CLEAN23
- PurchCrMemoHdrDataTransfer.AddFieldValue(PurchCrMemoHdr.FieldNo("EU 3-Party Trade"), PurchCrMemoHdr.FieldNo("EU 3-Party Trade CZL"));
-#endif
PurchCrMemoHdrDataTransfer.AddFieldValue(PurchCrMemoHdr.FieldNo("EU 3-Party Trade"), PurchCrMemoHdr.FieldNo("EU 3 Party Trade"));
PurchCrMemoHdrDataTransfer.AddFieldValue(PurchCrMemoHdr.FieldNo("Original Document VAT Date"), PurchCrMemoHdr.FieldNo("Original Doc. VAT Date CZL"));
PurchCrMemoHdrDataTransfer.AddFieldValue(PurchCrMemoHdr.FieldNo("VAT Currency Factor"), PurchCrMemoHdr.FieldNo("VAT Currency Factor CZL"));
@@ -1658,11 +1640,6 @@ codeunit 11748 "Install Application CZL"
VATStatementLine."Gen. Prod. Posting Group CZL" := VATStatementLine."Gen. Prod. Posting Group";
VATStatementLine."Show CZL" := VATStatementLine.Show;
VATStatementLine."EU 3-Party Intermed. Role CZL" := VATStatementLine."EU 3-Party Intermediate Role";
-#if not CLEAN23
-#pragma warning disable AL0432
- VATStatementLine."EU-3 Party Trade CZL" := VATStatementLine."EU-3 Party Trade";
-#pragma warning restore AL0432
-#endif
case VATStatementLine."EU-3 Party Trade" of
VATStatementLine."EU-3 Party Trade"::" ":
VATStatementLine."EU 3 Party Trade" := VATStatementLine."EU 3 Party Trade"::All;
diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/InvPostBufferHandlerCZL.Codeunit.al b/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/InvPostBufferHandlerCZL.Codeunit.al
index 3126f2c377..d1674d73ad 100644
--- a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/InvPostBufferHandlerCZL.Codeunit.al
+++ b/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/InvPostBufferHandlerCZL.Codeunit.al
@@ -10,16 +10,6 @@ codeunit 31307 "Inv. Post. Buffer Handler CZL"
{
Access = Internal;
-#if not CLEAN23
-#pragma warning disable AL0432
- [EventSubscriber(ObjectType::Table, Database::"Invoice Post. Buffer", 'OnBeforeInvPostBufferModify', '', false, false)]
- local procedure UpdateExtendedAmountsOnBeforeInvPostBufferModify(var InvoicePostBuffer: Record "Invoice Post. Buffer"; FromInvoicePostBuffer: Record "Invoice Post. Buffer")
- begin
- InvoicePostBuffer."Ext. Amount CZL" += FromInvoicePostBuffer."Ext. Amount CZL";
- InvoicePostBuffer."Ext. Amount Incl. VAT CZL" += FromInvoicePostBuffer."Ext. Amount Incl. VAT CZL";
- end;
-#pragma warning restore AL0432
-#endif
#if not CLEAN24
#pragma warning disable AL0432
[EventSubscriber(ObjectType::Table, Database::"Invoice Posting Buffer", 'OnUpdateOnBeforeModify', '', false, false)]
@@ -29,17 +19,6 @@ codeunit 31307 "Inv. Post. Buffer Handler CZL"
InvoicePostingBuffer."Ext. Amount Incl. VAT CZL" += FromInvoicePostingBuffer."Ext. Amount Incl. VAT CZL";
end;
#pragma warning restore AL0432
-#endif
-#if not CLEAN23
-#pragma warning disable AL0432
- [EventSubscriber(ObjectType::Table, Database::"Invoice Post. Buffer", 'OnAfterCopyToGenJnlLine', '', false, false)]
- local procedure CopyFieldsOnAfterCopyToGenJnlLineOld(var GenJnlLine: Record "Gen. Journal Line"; InvoicePostBuffer: Record "Invoice Post. Buffer");
- begin
- GenJnlLine.Correction := InvoicePostBuffer."Correction CZL";
- GenJnlLine."VAT Reporting Date" := InvoicePostBuffer."VAT Date CZL";
- GenJnlLine."Original Doc. VAT Date CZL" := InvoicePostBuffer."Original Doc. VAT Date CZL";
- end;
-#pragma warning restore AL0432
#endif
[EventSubscriber(ObjectType::Table, Database::"Invoice Posting Buffer", 'OnAfterCopyToGenJnlLine', '', false, false)]
diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/PurchasePostingHandlerCZL.Codeunit.al b/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/PurchasePostingHandlerCZL.Codeunit.al
index f141ff35e2..f638384ba7 100644
--- a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/PurchasePostingHandlerCZL.Codeunit.al
+++ b/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/PurchasePostingHandlerCZL.Codeunit.al
@@ -36,155 +36,6 @@ codeunit 31039 "Purchase Posting Handler CZL"
PurchaseAlreadyExistsQst: Label 'Purchase %1 %2 already exists for this vendor.\Do you want to continue?',
Comment = '%1 = Document Type; %2 = External Document No.; e.g. Purchase Invoice 123 already exists...';
-#if not CLEAN23
-#pragma warning disable AL0432
- [EventSubscriber(ObjectType::Codeunit, Codeunit::"Purch.-Post", 'OnAfterPostInvPostBuffer', '', false, false)]
- local procedure PurchasePostVATDelayOnAfterPostInvPostBuffer(var GenJnlLine: Record "Gen. Journal Line"; var InvoicePostBuffer: Record "Invoice Post. Buffer"; PurchHeader: Record "Purchase Header"; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line")
- var
- VATCurrFactor: Decimal;
- begin
- if (PurchHeader."Currency Code" <> '') and (PurchHeader."Currency Factor" <> PurchHeader."VAT Currency Factor CZL") and
- ((InvoicePostBuffer."VAT Calculation Type" = InvoicePostBuffer."VAT Calculation Type"::"Reverse Charge VAT") or
- (InvoicePostBuffer."VAT Calculation Type" = InvoicePostBuffer."VAT Calculation Type"::"Normal VAT"))
- then begin
- VATPostingSetup.Get(InvoicePostBuffer."VAT Bus. Posting Group", InvoicePostBuffer."VAT Prod. Posting Group");
- VATPostingSetup.TestField("Purch. VAT Curr. Exch. Acc CZL");
- SourceCodeSetup.Get();
- SourceCodeSetup.TestField("Purchase VAT Delay CZL");
- GenJnlLineDocType := GenJnlLine."Document Type";
- GenJnlLineDocNo := GenJnlLine."Document No.";
- GenJnlLineExtDocNo := GenJnlLine."External Document No.";
-
- VATCurrFactor := 1;
- if PurchHeader."VAT Currency Factor CZL" <> 0 then
- VATCurrFactor := PurchHeader."Currency Factor" / PurchHeader."VAT Currency Factor CZL";
-
- PostVATDelay(PurchHeader, InvoicePostBuffer, -1, 1, true, GenJnlPostLine);
- PostVATDelay(PurchHeader, InvoicePostBuffer, 1, VATCurrFactor, false, GenJnlPostLine);
- if InvoicePostBuffer."VAT Calculation Type" = InvoicePostBuffer."VAT Calculation Type"::"Normal VAT" then begin
- PostVATDelayDifference(PurchHeader, InvoicePostBuffer, GlobalAmountType::Base, VATCurrFactor, GenJnlPostLine);
- PostVATDelayDifference(PurchHeader, InvoicePostBuffer, GlobalAmountType::VAT, VATCurrFactor, GenJnlPostLine);
- end;
- end;
- end;
-
- local procedure PostVATDelay(PurchaseHeader: Record "Purchase Header"; InvoicePostBuffer: Record "Invoice Post. Buffer"; Sign: Integer; CurrFactor: Decimal; IsCorrection: Boolean; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line")
- var
- GenJournalLine: Record "Gen. Journal Line";
- begin
- GetCurrency(PurchaseHeader."Currency Code");
- if CurrFactor = 0 then
- CurrFactor := 1;
-
- InitGenJournalLine(PurchaseHeader, InvoicePostBuffer, GenJournalLine);
-
- GenJournalLine.Quantity := Sign * GenJournalLine.Quantity;
- GenJournalLine.Amount :=
- Sign * Round(InvoicePostBuffer.Amount * CurrFactor, Currency."Amount Rounding Precision");
- GenJournalLine."VAT Amount" :=
- Sign * Round(InvoicePostBuffer."VAT Amount" * CurrFactor, Currency."Amount Rounding Precision");
- GenJournalLine."VAT Base Amount" := GenJournalLine.Amount;
- GenJournalLine."Source Currency Amount" :=
- Sign * Round(InvoicePostBuffer."Amount (ACY)" * CurrFactor, Currency."Amount Rounding Precision");
- GenJournalLine."Source Curr. VAT Amount" :=
- Sign * Round(InvoicePostBuffer."VAT Amount (ACY)" * CurrFactor, Currency."Amount Rounding Precision");
- GenJournalLine."Source Curr. VAT Base Amount" := GenJournalLine."Source Currency Amount";
- GenJournalLine."VAT Difference" :=
- Sign * Round(InvoicePostBuffer."VAT Difference" * CurrFactor, Currency."Amount Rounding Precision");
-
- GenJournalLine.Correction := InvoicePostBuffer."Correction CZL" xor IsCorrection;
- GenJournalLine."VAT Bus. Posting Group" := InvoicePostBuffer."VAT Bus. Posting Group";
- GenJournalLine."VAT Prod. Posting Group" := InvoicePostBuffer."VAT Prod. Posting Group";
- GenJournalLine."Gen. Bus. Posting Group" := InvoicePostBuffer."Gen. Bus. Posting Group";
- GenJournalLine."Gen. Prod. Posting Group" := InvoicePostBuffer."Gen. Prod. Posting Group";
- if not PurchaseHeader.IsEU3PartyTradeFeatureEnabled() then
- PurchaseHeader."EU 3 Party Trade" := PurchaseHeader."EU 3-Party Trade CZL";
- GenJournalLine."EU 3-Party Trade" := PurchaseHeader."EU 3 Party Trade";
- GenJournalLine."EU 3-Party Intermed. Role CZL" := PurchaseHeader."EU 3-Party Intermed. Role CZL";
-
- GenJnlPostLine.RunWithCheck(GenJournalLine);
- end;
-
- local procedure PostVATDelayDifference(PurchaseHeader: Record "Purchase Header"; InvoicePostBuffer: Record "Invoice Post. Buffer"; AmountType: Option Base,VAT; CurrFactor: Decimal; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line")
- var
- GenJournalLine: Record "Gen. Journal Line";
- Amount: Decimal;
- AccountNo: Code[20];
- begin
- GetCurrency(PurchaseHeader."Currency Code");
- if CurrFactor = 0 then
- CurrFactor := 1;
-
- case AmountType of
- AmountType::Base:
- Amount :=
- InvoicePostBuffer.Amount -
- Round(InvoicePostBuffer.Amount * CurrFactor, Currency."Amount Rounding Precision");
- AmountType::VAT:
- begin
- Amount :=
- InvoicePostBuffer."VAT Amount" -
- Round(InvoicePostBuffer."VAT Amount" * CurrFactor, Currency."Amount Rounding Precision");
- if Amount < 0 then
- AccountNo := Currency."Realized Gains Acc."
- else
- AccountNo := Currency."Realized Losses Acc.";
- end;
- end;
-
- InitGenJournalLine(PurchaseHeader, InvoicePostBuffer, GenJournalLine);
- GenJournalLine."Gen. Posting Type" := GenJournalLine."Gen. Posting Type"::" ";
- if AccountNo <> '' then
- GenJournalLine."Account No." := AccountNo;
- GenJournalLine.Amount := Amount;
-
- GenJnlPostLine.RunWithCheck(GenJournalLine);
- end;
-
- local procedure InitGenJournalLine(PurchaseHeader: Record "Purchase Header"; InvoicePostBuffer: Record "Invoice Post. Buffer"; var GenJournalLine: Record "Gen. Journal Line")
- begin
- GenJournalLine.Init();
- GenJournalLine."Document Type" := GenJnlLineDocType;
- GenJournalLine."Document No." := GenJnlLineDocNo;
- GenJournalLine."External Document No." := GenJnlLineExtDocNo;
- GenJournalLine."Account No." := VATPostingSetup."Purch. VAT Curr. Exch. Acc CZL";
- if InvoicePostBuffer."VAT Calculation Type" = InvoicePostBuffer."VAT Calculation Type"::"Reverse Charge VAT" then
- GenJournalLine."Bal. Account No." := VATPostingSetup."Purch. VAT Curr. Exch. Acc CZL";
- GenJournalLine."Posting Date" := PurchaseHeader."Posting Date";
- GenJournalLine."Document Date" := PurchaseHeader."Document Date";
- GenJournalLine."VAT Reporting Date" := PurchaseHeader."VAT Reporting Date";
- GenJournalLine."Original Doc. VAT Date CZL" := PurchaseHeader."Original Doc. VAT Date CZL";
- GenJournalLine.Description := PurchaseHeader."Posting Description";
- GenJournalLine."Reason Code" := PurchaseHeader."Reason Code";
- GenJournalLine."System-Created Entry" := InvoicePostBuffer."System-Created Entry";
- GenJournalLine."Source Currency Code" := PurchaseHeader."Currency Code";
- GenJournalLine.Correction := InvoicePostBuffer."Correction CZL";
- GenJournalLine."Gen. Posting Type" := GenJournalLine."Gen. Posting Type"::Purchase;
- GenJournalLine."Tax Area Code" := InvoicePostBuffer."Tax Area Code";
- GenJournalLine."Tax Liable" := InvoicePostBuffer."Tax Liable";
- GenJournalLine."Tax Group Code" := InvoicePostBuffer."Tax Group Code";
- GenJournalLine."Use Tax" := InvoicePostBuffer."Use Tax";
- GenJournalLine."VAT Calculation Type" := InvoicePostBuffer."VAT Calculation Type";
- GenJournalLine."VAT Base Discount %" := PurchaseHeader."VAT Base Discount %";
- GenJournalLine."VAT Posting" := GenJournalLine."VAT Posting"::"Manual VAT Entry";
- GenJournalLine."Shortcut Dimension 1 Code" := InvoicePostBuffer."Global Dimension 1 Code";
- GenJournalLine."Shortcut Dimension 2 Code" := InvoicePostBuffer."Global Dimension 2 Code";
- GenJournalLine."Dimension Set ID" := InvoicePostBuffer."Dimension Set ID";
- GenJournalLine."Job No." := InvoicePostBuffer."Job No.";
- GenJournalLine."Source Code" := SourceCodeSetup."Purchase VAT Delay CZL";
- GenJournalLine."Bill-to/Pay-to No." := PurchaseHeader."Pay-to Vendor No.";
- GenJournalLine."Source Type" := GenJournalLine."Source Type"::Vendor;
- GenJournalLine."Source No." := PurchaseHeader."Pay-to Vendor No.";
- GenJournalLine."Posting No. Series" := PurchaseHeader."Posting No. Series";
- GenJournalLine."Country/Region Code" := PurchaseHeader."VAT Country/Region Code";
- GenJournalLine."VAT Registration No." := PurchaseHeader."VAT Registration No.";
- GenJournalLine."Registration No. CZL" := PurchaseHeader."Registration No. CZL";
- GenJournalLine.Quantity := InvoicePostBuffer.Quantity;
- GenJournalLine."VAT Delay CZL" := true;
- end;
-
-#pragma warning restore AL0432
-#endif
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Purch. Post Invoice Events", 'OnPostLinesOnAfterGenJnlLinePost', '', false, false)]
local procedure PurchasePostVATCurrencyFactorOnPostLinesOnAfterGenJnlLinePost(var GenJnlLine: Record "Gen. Journal Line"; TempInvoicePostingBuffer: Record "Invoice Posting Buffer"; PurchHeader: Record "Purchase Header"; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line")
var
@@ -435,26 +286,6 @@ codeunit 31039 "Purchase Posting Handler CZL"
Handled := PersistConfirmResponseCZL.GetPersistentResponse();
end;
-#if not CLEAN23
-#pragma warning disable AL0432
- [EventSubscriber(ObjectType::Codeunit, Codeunit::"Purch.-Post", 'OnBeforePostVendorEntry', '', false, false)]
- local procedure UpdateSymbolsAndBankAccountOnBeforePostVendorEntry(var GenJnlLine: Record "Gen. Journal Line"; var PurchHeader: Record "Purchase Header")
- begin
- GenJnlLine."Specific Symbol CZL" := PurchHeader."Specific Symbol CZL";
- if PurchHeader."Variable Symbol CZL" <> '' then
- GenJnlLine."Variable Symbol CZL" := PurchHeader."Variable Symbol CZL"
- else
- GenJnlLine."Variable Symbol CZL" := BankOperationsFunctionsCZL.CreateVariableSymbol(GenJnlLine."External Document No.");
- GenJnlLine."Constant Symbol CZL" := PurchHeader."Constant Symbol CZL";
- GenJnlLine."Bank Account Code CZL" := PurchHeader."Bank Account Code CZL";
- GenJnlLine."Bank Account No. CZL" := PurchHeader."Bank Account No. CZL";
- GenJnlLine."IBAN CZL" := PurchHeader."IBAN CZL";
- GenJnlLine."SWIFT Code CZL" := PurchHeader."SWIFT Code CZL";
- GenJnlLine."Transit No. CZL" := PurchHeader."Transit No. CZL";
- end;
-
-#pragma warning restore AL0432
-#endif
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Purch. Post Invoice Events", 'OnPostLedgerEntryOnBeforeGenJnlPostLine', '', false, false)]
local procedure UpdateSymbolsAndBankAccountOnPostLedgerEntryOnBeforeGenJnlPostLine(var GenJnlLine: Record "Gen. Journal Line"; var PurchHeader: Record "Purchase Header")
begin
@@ -522,17 +353,6 @@ codeunit 31039 "Purchase Posting Handler CZL"
end;
end;
-#if not CLEAN23
-#pragma warning disable AL0432
- [EventSubscriber(ObjectType::Codeunit, Codeunit::"Purch.-Post", 'OnAfterFillInvoicePostBuffer', '', false, false)]
- local procedure SetExtendedAmountsOnAfterFillInvoicePostBuffer(var InvoicePostBuffer: Record "Invoice Post. Buffer"; PurchLine: Record "Purchase Line")
- begin
- InvoicePostBuffer."Ext. Amount CZL" := PurchLine."Ext. Amount CZL";
- InvoicePostBuffer."Ext. Amount Incl. VAT CZL" := PurchLine."Ext. Amount Incl. VAT CZL";
- end;
-
-#pragma warning restore AL0432
-#endif
#if not CLEAN24
#pragma warning disable AL0432
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Purch. Post Invoice Events", 'OnPrepareLineOnAfterFillInvoicePostingBuffer', '', false, false)]
diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/RegLookupExtDataCZL.Codeunit.al b/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/RegLookupExtDataCZL.Codeunit.al
index 3c09b60bc6..3b32a9a1ff 100644
--- a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/RegLookupExtDataCZL.Codeunit.al
+++ b/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/RegLookupExtDataCZL.Codeunit.al
@@ -4,6 +4,8 @@
// ------------------------------------------------------------------------------------------------
namespace Microsoft.Finance.Registration;
+using System.RestClient;
+
codeunit 11754 "Reg. Lookup Ext. Data CZL"
{
TableNo = "Registration Log CZL";
@@ -25,57 +27,27 @@ codeunit 11754 "Reg. Lookup Ext. Data CZL"
Commit();
end;
- local procedure SendRequest() HttpResponseMessage: HttpResponseMessage
+ local procedure SendRequest() HttpResponseMessage: Codeunit "Http Response Message"
var
RegNoServiceConfigCZL: Record "Reg. No. Service Config CZL";
- HttpClient: HttpClient;
+ RestClient: Codeunit "Rest Client";
RequestURL: Text;
RegNoTok: Label '%1/%2', Locked = true, Comment = '%1 = Registration No. service URL, %2 = Registraton No.';
-#if not CLEAN23
- OldRegNoTok: Label '%1?ico=%2', Locked = true, Comment = '%1 = Registration No. service URL, %2 = Reistraton No.';
-#endif
- ServiceCallErr: Label 'Web service call failed.';
begin
-#if not CLEAN23
- if RegNoServiceConfigCZL.GetRegNoURL() = GetRegistrationNoValidationWebServiceURL() then
- RequestURL := StrSubstNo(RegNoTok, RegNoServiceConfigCZL.GetRegNoURL(), RegistrationLogCZL."Registration No.")
- else
- RequestURL := StrSubstNo(OldRegNoTok, RegNoServiceConfigCZL.GetRegNoURL(), RegistrationLogCZL."Registration No.");
-#else
RequestURL := StrSubstNo(RegNoTok, RegNoServiceConfigCZL.GetRegNoURL(), RegistrationLogCZL."Registration No.");
-#endif
- if not HttpClient.Get(RequestURL, HttpResponseMessage) then
- Error(ServiceCallErr);
+ RestClient.Initialize();
+ HttpResponseMessage := RestClient.Get(RequestURL);
end;
- local procedure InsertLogEntry(HttpResponseMessage: HttpResponseMessage)
+ local procedure InsertLogEntry(HttpResponseMessage: Codeunit "Http Response Message")
var
- ResponseObject: JsonObject;
-#if not CLEAN23
- ResponseXmlDoc: XmlDocument;
-#endif
- HttpResponseText: Text;
-#if not CLEAN23
- NamespaceTok: Label 'http://wwwinfo.mfcr.cz/ares/xml_doc/schemas/ares/ares_datatypes/v_1.0.3', Locked = true;
-#endif
+ ResponseJsonObject: JsonObject;
begin
- HttpResponseMessage.Content().ReadAs(HttpResponseText);
-#if not CLEAN23
- if ResponseObject.ReadFrom(HttpResponseText) then begin
-#endif
- if HttpResponseMessage.IsSuccessStatusCode() then
- RegistrationLogMgtCZL.LogVerification(RegistrationLogCZL, ResponseObject)
- else
- RegistrationLogMgtCZL.LogError(RegistrationLogCZL, ResponseObject);
-#if not CLEAN23
- exit;
- end;
-
- XmlDocument.ReadFrom(HttpResponseText, ResponseXmlDoc);
-#pragma warning disable AL0432
- RegistrationLogMgtCZL.LogVerification(RegistrationLogCZL, ResponseXmlDoc, NamespaceTok);
-#pragma warning restore AL0432
-#endif
+ ResponseJsonObject := HttpResponseMessage.GetContent().AsJson().AsObject();
+ if HttpResponseMessage.GetIsSuccessStatusCode() then
+ RegistrationLogMgtCZL.LogVerification(RegistrationLogCZL, ResponseJsonObject)
+ else
+ RegistrationLogMgtCZL.LogError(RegistrationLogCZL, ResponseJsonObject);
end;
procedure GetRegistrationNoValidationWebServiceURL(): Text[250]
diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/RegistrationLogMgtCZL.Codeunit.al b/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/RegistrationLogMgtCZL.Codeunit.al
index aef49cec45..dd7041ec00 100644
--- a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/RegistrationLogMgtCZL.Codeunit.al
+++ b/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/RegistrationLogMgtCZL.Codeunit.al
@@ -162,70 +162,6 @@ codeunit 11755 "Registration Log Mgt. CZL"
if NewRegistrationLogCZL.LogDetails() then
NewRegistrationLogCZL.Modify();
end;
-#if not CLEAN23
- [Obsolete('Replaced by LogVerification and LogError functions with JsonObject parameter.', '23.0')]
- procedure LogVerification(var NewRegistrationLogCZL: Record "Registration Log CZL"; XmlDoc: XmlDocument; Namespace: Text)
- var
- Address: array[10] of Text;
- AddressText: Text;
- Error: Text;
- begin
- if ExtractValue('//D:VBAS', XmlDoc, Namespace) <> '' then begin
- NewRegistrationLogCZL."Entry No." := 0;
- NewRegistrationLogCZL.Status := NewRegistrationLogCZL.Status::Valid;
- NewRegistrationLogCZL."Verified Date" := CurrentDateTime;
- NewRegistrationLogCZL."User ID" := CopyStr(UserId(), 1, MaxStrLen(NewRegistrationLogCZL."User ID"));
-
- // VAT Registration No.
- NewRegistrationLogCZL."Verified VAT Registration No." :=
- CopyStr(ExtractValue('//D:DIC', XmlDoc, Namespace), 1, MaxStrLen(NewRegistrationLogCZL."Verified VAT Registration No."));
-
- // Name
- NewRegistrationLogCZL."Verified Name" :=
- CopyStr(ExtractValue('//D:OF', XmlDoc, Namespace), 1, MaxStrLen(NewRegistrationLogCZL."Verified Name"));
-
- // Address information
- if ExtractValue('//D:AA', XmlDoc, Namespace) <> '' then begin
- // City
- NewRegistrationLogCZL."Verified City" :=
- CopyStr(ExtractValue('//D:N', XmlDoc, Namespace), 1, MaxStrLen(NewRegistrationLogCZL."Verified City"));
-
- // Post Code
- NewRegistrationLogCZL."Verified Post Code" :=
- CopyStr(ExtractValue('//D:PSC', XmlDoc, Namespace), 1, MaxStrLen(NewRegistrationLogCZL."Verified Post Code"));
-
- Address[1] := ExtractValue('//D:NU', XmlDoc, Namespace); // Street
- Address[2] := ExtractValue('//D:NCO', XmlDoc, Namespace); // Quarter
- Address[3] := ExtractValue('//D:CD', XmlDoc, Namespace); // Descriptive No.
- Address[4] := ExtractValue('//D:CO', XmlDoc, Namespace); // House No.
- AddressText := ExtractValue('//D:AT', XmlDoc, Namespace); // Address Text
- end;
-
- NewRegistrationLogCZL."Verified Address" := CopyStr(FormatAddress(Address), 1, MaxStrLen(NewRegistrationLogCZL."Verified Address"));
- if NewRegistrationLogCZL."Verified Address" = '' then
- NewRegistrationLogCZL."Verified Address" := CopyStr(AddressText, 1, MaxStrLen(NewRegistrationLogCZL."Verified Address"));
- NewRegistrationLogCZL.Insert(true);
-
- if NewRegistrationLogCZL.LogDetails() then
- NewRegistrationLogCZL.Modify();
- end else begin
- if ExtractValue('//D:E', XmlDoc, Namespace) <> '' then
- Error := ExtractValue('//D:ET', XmlDoc, Namespace);
-
- NewRegistrationLogCZL."Entry No." := 0;
- NewRegistrationLogCZL."Verified Date" := CurrentDateTime;
- NewRegistrationLogCZL.Status := NewRegistrationLogCZL.Status::Invalid;
- NewRegistrationLogCZL."User ID" := CopyStr(UserId(), 1, MaxStrLen(NewRegistrationLogCZL."User ID"));
- NewRegistrationLogCZL."Verified Result" := CopyStr(Error, 1, MaxStrLen(NewRegistrationLogCZL."Verified Result"));
- NewRegistrationLogCZL."Verified Name" := '';
- NewRegistrationLogCZL."Verified Address" := '';
- NewRegistrationLogCZL."Verified City" := '';
- NewRegistrationLogCZL."Verified Post Code" := '';
- NewRegistrationLogCZL."Verified VAT Registration No." := '';
- NewRegistrationLogCZL.Insert(true);
- end;
- end;
-#endif
local procedure FormatPostCode(PostCode: Text): Code[20]
var
@@ -371,17 +307,6 @@ codeunit 11755 "Registration Log Mgt. CZL"
exit;
InitServiceSetup();
end;
-#if not CLEAN23
- local procedure ExtractValue(Xpath: Text; XMLDoc: XmlDocument; Namespace: Text): Text
- var
- XMLNamespaceManager: XmlNamespaceManager;
- FoundXMLNode: XmlNode;
- begin
- XmlNamespaceManager.AddNamespace('D', Namespace);
- if XmlDoc.SelectSingleNode(XPath, XmlNamespaceManager, FoundXMLNode) then
- exit(FoundXMLNode.AsXmlElement().InnerText());
- end;
-#endif
local procedure GetValue(JsonObject: JsonObject; JsonKey: Text; var Result: Text): Boolean
var
diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/SalesPostingHandlerCZL.Codeunit.al b/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/SalesPostingHandlerCZL.Codeunit.al
index 272f0601e4..05a6251182 100644
--- a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/SalesPostingHandlerCZL.Codeunit.al
+++ b/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/SalesPostingHandlerCZL.Codeunit.al
@@ -34,151 +34,6 @@ codeunit 31038 "Sales Posting Handler CZL"
GenJnlLineExtDocNo: Code[35];
GlobalAmountType: Option Base,VAT;
-#if not CLEAN23
-#pragma warning disable AL0432
- [EventSubscriber(ObjectType::Codeunit, Codeunit::"Sales-Post", 'OnAfterPostInvPostBuffer', '', false, false)]
- local procedure SalesPostVATDelayOnAfterPostInvPostBuffer(var GenJnlLine: Record "Gen. Journal Line"; var InvoicePostBuffer: Record "Invoice Post. Buffer"; var SalesHeader: Record "Sales Header"; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line")
- var
- VATCurrFactor: Decimal;
- begin
- if (SalesHeader."Currency Code" <> '') and (SalesHeader."Currency Factor" <> SalesHeader."VAT Currency Factor CZL") and
- ((InvoicePostBuffer."VAT Calculation Type" = InvoicePostBuffer."VAT Calculation Type"::"Reverse Charge VAT") or
- (InvoicePostBuffer."VAT Calculation Type" = InvoicePostBuffer."VAT Calculation Type"::"Normal VAT"))
- then begin
- VATPostingSetup.Get(InvoicePostBuffer."VAT Bus. Posting Group", InvoicePostBuffer."VAT Prod. Posting Group");
- VATPostingSetup.TestField("Sales VAT Curr. Exch. Acc CZL");
- SourceCodeSetup.Get();
- SourceCodeSetup.TestField("Sales VAT Delay CZL");
- GenJnlLineDocType := GenJnlLine."Document Type";
- GenJnlLineDocNo := GenJnlLine."Document No.";
- GenJnlLineExtDocNo := GenJnlLine."External Document No.";
-
- VATCurrFactor := 1;
- if SalesHeader."VAT Currency Factor CZL" <> 0 then
- VATCurrFactor := SalesHeader."Currency Factor" / SalesHeader."VAT Currency Factor CZL";
-
- PostVATDelay(SalesHeader, InvoicePostBuffer, -1, 1, true, GenJnlPostLine);
- PostVATDelay(SalesHeader, InvoicePostBuffer, 1, VATCurrFactor, false, GenJnlPostLine);
- if InvoicePostBuffer."VAT Calculation Type" = InvoicePostBuffer."VAT Calculation Type"::"Normal VAT" then begin
- PostVATDelayDifference(SalesHeader, InvoicePostBuffer, GlobalAmountType::Base, VATCurrFactor, GenJnlPostLine);
- PostVATDelayDifference(SalesHeader, InvoicePostBuffer, GlobalAmountType::VAT, VATCurrFactor, GenJnlPostLine);
- end;
- end;
- end;
-
- local procedure PostVATDelay(SalesHeader: Record "Sales Header"; InvoicePostBuffer: Record "Invoice Post. Buffer"; Sign: Integer; CurrFactor: Decimal; IsCorrection: Boolean; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line")
- var
- GenJournalLine: Record "Gen. Journal Line";
- begin
- GetCurrency(SalesHeader."Currency Code");
- if CurrFactor = 0 then
- CurrFactor := 1;
-
- InitGenJournalLine(SalesHeader, InvoicePostBuffer, GenJournalLine);
-
- GenJournalLine.Quantity := Sign * GenJournalLine.Quantity;
- GenJournalLine.Amount :=
- Sign * Round(InvoicePostBuffer.Amount * CurrFactor, Currency."Amount Rounding Precision");
- GenJournalLine."VAT Amount" :=
- Sign * Round(InvoicePostBuffer."VAT Amount" * CurrFactor, Currency."Amount Rounding Precision");
- GenJournalLine."VAT Base Amount" := GenJournalLine.Amount;
- GenJournalLine."Source Currency Amount" :=
- Sign * Round(InvoicePostBuffer."Amount (ACY)" * CurrFactor, Currency."Amount Rounding Precision");
- GenJournalLine."Source Curr. VAT Amount" :=
- Sign * Round(InvoicePostBuffer."VAT Amount (ACY)" * CurrFactor, Currency."Amount Rounding Precision");
- GenJournalLine."Source Curr. VAT Base Amount" := GenJournalLine."Source Currency Amount";
- GenJournalLine."VAT Difference" :=
- Sign * Round(InvoicePostBuffer."VAT Difference" * CurrFactor, Currency."Amount Rounding Precision");
-
- GenJournalLine.Correction := InvoicePostBuffer."Correction CZL" xor IsCorrection;
- GenJournalLine."VAT Bus. Posting Group" := InvoicePostBuffer."VAT Bus. Posting Group";
- GenJournalLine."VAT Prod. Posting Group" := InvoicePostBuffer."VAT Prod. Posting Group";
- GenJournalLine."Gen. Bus. Posting Group" := InvoicePostBuffer."Gen. Bus. Posting Group";
- GenJournalLine."Gen. Prod. Posting Group" := InvoicePostBuffer."Gen. Prod. Posting Group";
-
- GenJnlPostLine.RunWithCheck(GenJournalLine);
- end;
-
- local procedure PostVATDelayDifference(SalesHeader: Record "Sales Header"; InvoicePostBuffer: Record "Invoice Post. Buffer"; AmountType: Option Base,VAT; CurrFactor: Decimal; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line")
- var
- GenJournalLine: Record "Gen. Journal Line";
- Amount: Decimal;
- AccountNo: Code[20];
- begin
- GetCurrency(SalesHeader."Currency Code");
- if CurrFactor = 0 then
- CurrFactor := 1;
-
- case AmountType of
- AmountType::Base:
- Amount :=
- InvoicePostBuffer.Amount -
- Round(InvoicePostBuffer.Amount * CurrFactor, Currency."Amount Rounding Precision");
- AmountType::VAT:
- begin
- Amount :=
- InvoicePostBuffer."VAT Amount" -
- Round(InvoicePostBuffer."VAT Amount" * CurrFactor, Currency."Amount Rounding Precision");
- if Amount < 0 then
- AccountNo := Currency."Realized Gains Acc."
- else
- AccountNo := Currency."Realized Losses Acc.";
- end;
- end;
-
- InitGenJournalLine(SalesHeader, InvoicePostBuffer, GenJournalLine);
- GenJournalLine."Gen. Posting Type" := GenJournalLine."Gen. Posting Type"::" ";
- if AccountNo <> '' then
- GenJournalLine."Account No." := AccountNo;
- GenJournalLine.Amount := Amount;
-
- GenJnlPostLine.RunWithCheck(GenJournalLine);
- end;
-
- local procedure InitGenJournalLine(SalesHeader: Record "Sales Header"; InvoicePostBuffer: Record "Invoice Post. Buffer"; var GenJournalLine: Record "Gen. Journal Line")
- begin
- GenJournalLine.Init();
- GenJournalLine."Document Type" := GenJnlLineDocType;
- GenJournalLine."Document No." := GenJnlLineDocNo;
- GenJournalLine."External Document No." := GenJnlLineExtDocNo;
- GenJournalLine."Account No." := VATPostingSetup."Sales VAT Curr. Exch. Acc CZL";
- if InvoicePostBuffer."VAT Calculation Type" = InvoicePostBuffer."VAT Calculation Type"::"Reverse Charge VAT" then
- GenJournalLine."Bal. Account No." := VATPostingSetup."Sales VAT Curr. Exch. Acc CZL";
- GenJournalLine."Posting Date" := SalesHeader."Posting Date";
- GenJournalLine."Document Date" := SalesHeader."Document Date";
- GenJournalLine."VAT Reporting Date" := SalesHeader."VAT Reporting Date";
- GenJournalLine."Original Doc. VAT Date CZL" := SalesHeader."Original Doc. VAT Date CZL";
- GenJournalLine.Description := SalesHeader."Posting Description";
- GenJournalLine."Reason Code" := SalesHeader."Reason Code";
- GenJournalLine."System-Created Entry" := InvoicePostBuffer."System-Created Entry";
- GenJournalLine."Source Currency Code" := SalesHeader."Currency Code";
- GenJournalLine.Correction := InvoicePostBuffer."Correction CZL";
- GenJournalLine."Gen. Posting Type" := GenJournalLine."Gen. Posting Type"::Sale;
- GenJournalLine."Tax Area Code" := InvoicePostBuffer."Tax Area Code";
- GenJournalLine."Tax Liable" := InvoicePostBuffer."Tax Liable";
- GenJournalLine."Tax Group Code" := InvoicePostBuffer."Tax Group Code";
- GenJournalLine."Use Tax" := InvoicePostBuffer."Use Tax";
- GenJournalLine."VAT Calculation Type" := InvoicePostBuffer."VAT Calculation Type";
- GenJournalLine."VAT Base Discount %" := SalesHeader."VAT Base Discount %";
- GenJournalLine."VAT Posting" := GenJournalLine."VAT Posting"::"Manual VAT Entry";
- GenJournalLine."Shortcut Dimension 1 Code" := InvoicePostBuffer."Global Dimension 1 Code";
- GenJournalLine."Shortcut Dimension 2 Code" := InvoicePostBuffer."Global Dimension 2 Code";
- GenJournalLine."Dimension Set ID" := InvoicePostBuffer."Dimension Set ID";
- GenJournalLine."Job No." := InvoicePostBuffer."Job No.";
- GenJournalLine."Source Code" := SourceCodeSetup."Sales VAT Delay CZL";
- GenJournalLine."Bill-to/Pay-to No." := SalesHeader."Bill-to Customer No.";
- GenJournalLine."Source Type" := GenJournalLine."Source Type"::Customer;
- GenJournalLine."Source No." := SalesHeader."Bill-to Customer No.";
- GenJournalLine."Posting No. Series" := SalesHeader."Posting No. Series";
- GenJournalLine."Country/Region Code" := SalesHeader."VAT Country/Region Code";
- GenJournalLine."VAT Registration No." := SalesHeader."VAT Registration No.";
- GenJournalLine."Registration No. CZL" := SalesHeader."Registration No. CZL";
- GenJournalLine.Quantity := InvoicePostBuffer.Quantity;
- GenJournalLine."VAT Delay CZL" := true;
- end;
-
-#pragma warning restore AL0432
-#endif
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Sales Post Invoice Events", 'OnPostLinesOnAfterGenJnlLinePost', '', false, false)]
local procedure SalesPostVATDelayOnPostLinesOnAfterGenJnlLinePost(var GenJnlLine: Record "Gen. Journal Line"; TempInvoicePostingBuffer: Record "Invoice Posting Buffer"; SalesHeader: Record "Sales Header"; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line")
var
@@ -511,26 +366,6 @@ codeunit 31038 "Sales Posting Handler CZL"
exit(ItemNoText);
end;
-#if not CLEAN23
-#pragma warning disable AL0432
- [EventSubscriber(ObjectType::Codeunit, Codeunit::"Sales-Post", 'OnBeforePostCustomerEntry', '', false, false)]
- local procedure UpdateSymbolsAndBankAccountOnBeforePostCustomerEntry(var GenJnlLine: Record "Gen. Journal Line"; var SalesHeader: Record "Sales Header")
- begin
- GenJnlLine."Specific Symbol CZL" := SalesHeader."Specific Symbol CZL";
- if SalesHeader."Variable Symbol CZL" <> '' then
- GenJnlLine."Variable Symbol CZL" := SalesHeader."Variable Symbol CZL"
- else
- GenJnlLine."Variable Symbol CZL" := BankOperationsFunctionsCZL.CreateVariableSymbol(GenJnlLine."Document No.");
- GenJnlLine."Constant Symbol CZL" := SalesHeader."Constant Symbol CZL";
- GenJnlLine."Bank Account Code CZL" := SalesHeader."Bank Account Code CZL";
- GenJnlLine."Bank Account No. CZL" := SalesHeader."Bank Account No. CZL";
- GenJnlLine."IBAN CZL" := SalesHeader."IBAN CZL";
- GenJnlLine."SWIFT Code CZL" := SalesHeader."SWIFT Code CZL";
- GenJnlLine."Transit No. CZL" := SalesHeader."Transit No. CZL";
- end;
-
-#pragma warning restore AL0432
-#endif
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Sales Post Invoice Events", 'OnPostLedgerEntryOnBeforeGenJnlPostLine', '', false, false)]
local procedure UpdateSymbolsAndBankAccountOnPostLedgerEntryOnBeforeGenJnlPostLine(var GenJnlLine: Record "Gen. Journal Line"; var SalesHeader: Record "Sales Header")
begin
diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/ServicePostingHandlerCZL.Codeunit.al b/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/ServicePostingHandlerCZL.Codeunit.al
index 8c6a728b5d..205ea33ac4 100644
--- a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/ServicePostingHandlerCZL.Codeunit.al
+++ b/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/ServicePostingHandlerCZL.Codeunit.al
@@ -26,101 +26,6 @@ codeunit 31040 "Service Posting Handler CZL"
BankOperationsFunctionsCZL: Codeunit "Bank Operations Functions CZL";
ReverseChargeCheckCZL: Enum "Reverse Charge Check CZL";
-#if not CLEAN23
-#pragma warning disable AL0432
- [EventSubscriber(ObjectType::Codeunit, Codeunit::"Serv-Posting Journals Mgt.", 'OnAfterPostInvoicePostBuffer', '', false, false)]
- local procedure ServPostingVATCurrencyFactorOnAfterPostInvPostBuffer(var GenJournalLine: Record "Gen. Journal Line"; var InvoicePostBuffer: Record "Invoice Post. Buffer"; ServiceHeader: Record "Service Header"; GLEntryNo: Integer; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line")
- var
- VATPostingSetup: Record "VAT Posting Setup";
- VATCurrFactor: Decimal;
- begin
- if ServiceHeader."Currency Factor" <> ServiceHeader."VAT Currency Factor CZL" then begin
- VATPostingSetup.Get(GenJournalLine."VAT Bus. Posting Group", GenJournalLine."VAT Prod. Posting Group");
- VATPostingSetup.TestField("VAT Calculation Type", VATPostingSetup."VAT Calculation Type"::"Reverse Charge VAT");
- VATPostingSetup.TestField("Sales VAT Curr. Exch. Acc CZL");
- SourceCodeSetup.Get();
- SourceCodeSetup.TestField("Sales VAT Delay CZL");
- GLEntry.Get(GLEntryNo);
- PostServiceVATCurrencyFactor(ServiceHeader, InvoicePostBuffer, false, 1, true, VATPostingSetup, GenJnlPostLine);
- if ServiceHeader."VAT Currency Factor CZL" = 0 then
- VATCurrFactor := 1
- else
- VATCurrFactor := ServiceHeader."Currency Factor" / ServiceHeader."VAT Currency Factor CZL";
- if VATCurrFactor = 0 then
- VATCurrFactor := 1;
-
- PostServiceVATCurrencyFactor(ServiceHeader, InvoicePostBuffer, true, VATCurrFactor, false, VATPostingSetup, GenJnlPostLine);
- end;
- end;
-
- local procedure PostServiceVATCurrencyFactor(ServiceHeader: Record "Service Header"; InvoicePostBuffer: Record "Invoice Post. Buffer"; ToPost: Boolean; CurrFactor: Decimal; IsCorrection: Boolean; VATPostingSetup: Record "VAT Posting Setup"; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line")
- var
- GenJournalLine: Record "Gen. Journal Line";
- Sign: Integer;
- begin
- if ToPost then
- Sign := 1
- else
- Sign := -1;
-
- GenJournalLine.Init();
- GenJournalLine."Posting Date" := ServiceHeader."Posting Date";
- GenJournalLine.Validate("VAT Reporting Date", ServiceHeader."VAT Reporting Date");
- GenJournalLine."Document Date" := ServiceHeader."Document Date";
- GenJournalLine.Description := ServiceHeader."Posting Description";
- GenJournalLine."Reason Code" := ServiceHeader."Reason Code";
- GenJournalLine."Document Type" := GLEntry."Document Type";
- GenJournalLine."Document No." := GLEntry."Document No.";
- GenJournalLine."External Document No." := GLEntry."External Document No.";
- GenJournalLine."Account No." := VATPostingSetup."Sales VAT Curr. Exch. Acc CZL";
- GenJournalLine."System-Created Entry" := InvoicePostBuffer."System-Created Entry";
- GenJournalLine."Source Currency Code" := ServiceHeader."Currency Code";
- GetCurrency(ServiceHeader."Currency Code");
- if IsCorrection then
- GenJournalLine.Correction := not InvoicePostBuffer."Correction CZL"
- else
- GenJournalLine.Correction := InvoicePostBuffer."Correction CZL";
- GenJournalLine."Gen. Posting Type" := GenJournalLine."Gen. Posting Type"::Sale;
- GenJournalLine."VAT Bus. Posting Group" := InvoicePostBuffer."VAT Bus. Posting Group";
- GenJournalLine."VAT Prod. Posting Group" := InvoicePostBuffer."VAT Prod. Posting Group";
- GenJournalLine."Tax Area Code" := InvoicePostBuffer."Tax Area Code";
- GenJournalLine."Tax Liable" := InvoicePostBuffer."Tax Liable";
- GenJournalLine."Tax Group Code" := InvoicePostBuffer."Tax Group Code";
- GenJournalLine."Use Tax" := InvoicePostBuffer."Use Tax";
- GenJournalLine."VAT Calculation Type" := InvoicePostBuffer."VAT Calculation Type";
- GenJournalLine."VAT Base Discount %" := ServiceHeader."VAT Base Discount %";
- GenJournalLine."VAT Posting" := GenJournalLine."VAT Posting"::"Manual VAT Entry";
- GenJournalLine."Shortcut Dimension 1 Code" := InvoicePostBuffer."Global Dimension 1 Code";
- GenJournalLine."Shortcut Dimension 2 Code" := InvoicePostBuffer."Global Dimension 2 Code";
- GenJournalLine."Dimension Set ID" := InvoicePostBuffer."Dimension Set ID";
- GenJournalLine."Job No." := InvoicePostBuffer."Job No.";
- GenJournalLine."Source Code" := SourceCodeSetup."Sales VAT Delay CZL";
- GenJournalLine."Bill-to/Pay-to No." := ServiceHeader."Bill-to Customer No.";
- GenJournalLine."Source Type" := GenJournalLine."Source Type"::Customer;
- GenJournalLine."Source No." := ServiceHeader."Bill-to Customer No.";
- GenJournalLine."Posting No. Series" := ServiceHeader."Posting No. Series";
- GenJournalLine."Bal. Account No." := VATPostingSetup."Sales VAT Curr. Exch. Acc CZL";
- GenJournalLine.Quantity := Sign * InvoicePostBuffer.Quantity;
- GenJournalLine.Amount := Round(Sign * InvoicePostBuffer.Amount * CurrFactor, Currency."Amount Rounding Precision");
- GenJournalLine."VAT Amount" := Round(Sign * InvoicePostBuffer."VAT Amount" *
- CurrFactor, Currency."Amount Rounding Precision");
- GenJournalLine."VAT Base Amount" := GenJournalLine.Amount;
- GenJournalLine."Source Currency Amount" := Round(Sign * InvoicePostBuffer."Amount (ACY)" * CurrFactor,
- Currency."Amount Rounding Precision");
- GenJournalLine."Source Curr. VAT Amount" := Round(Sign * InvoicePostBuffer."VAT Amount (ACY)" * CurrFactor,
- Currency."Amount Rounding Precision");
- GenJournalLine."Source Curr. VAT Base Amount" := GenJournalLine."Source Currency Amount" - GenJournalLine."Source Curr. VAT Amount";
- GenJournalLine."VAT Difference" := Round(Sign * InvoicePostBuffer."VAT Difference" * CurrFactor,
- Currency."Amount Rounding Precision");
- GenJournalLine."Gen. Bus. Posting Group" := InvoicePostBuffer."Gen. Bus. Posting Group";
- GenJournalLine."Gen. Prod. Posting Group" := InvoicePostBuffer."Gen. Prod. Posting Group";
- GenJournalLine.Validate("VAT Delay CZL", true);
-
- GenJnlPostLine.RunWithCheck(GenJournalLine);
- end;
-
-#pragma warning restore AL0432
-#endif
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Service Post Invoice Events", 'OnPostLinesOnAfterGenJnlLinePost', '', false, false)]
local procedure ServicePostVATCurrencyFactorOnPostLinesOnAfterGenJnlLinePost(var GenJnlLine: Record "Gen. Journal Line"; TempInvoicePostingBuffer: Record "Invoice Posting Buffer"; ServiceHeader: Record "Service Header"; GLEntryNo: Integer; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line")
var
@@ -263,26 +168,6 @@ codeunit 31040 "Service Posting Handler CZL"
until ServiceLine.Next() = 0;
end;
-#if not CLEAN23
-#pragma warning disable AL0432
- [EventSubscriber(ObjectType::Codeunit, Codeunit::"Serv-Posting Journals Mgt.", 'OnBeforePostCustomerEntry', '', false, false)]
-#pragma warning restore AL0432
- local procedure UpdateSymbolsAndBankAccountOnBeforePostCustomerEntry(var GenJournalLine: Record "Gen. Journal Line"; ServiceHeader: Record "Service Header")
- begin
- GenJournalLine."Specific Symbol CZL" := ServiceHeader."Specific Symbol CZL";
- if ServiceHeader."Variable Symbol CZL" <> '' then
- GenJournalLine."Variable Symbol CZL" := ServiceHeader."Variable Symbol CZL"
- else
- GenJournalLine."Variable Symbol CZL" := BankOperationsFunctionsCZL.CreateVariableSymbol(GenJournalLine."Document No.");
- GenJournalLine."Constant Symbol CZL" := ServiceHeader."Constant Symbol CZL";
- GenJournalLine."Bank Account Code CZL" := ServiceHeader."Bank Account Code CZL";
- GenJournalLine."Bank Account No. CZL" := ServiceHeader."Bank Account No. CZL";
- GenJournalLine."IBAN CZL" := ServiceHeader."IBAN CZL";
- GenJournalLine."SWIFT Code CZL" := ServiceHeader."SWIFT Code CZL";
- GenJournalLine."Transit No. CZL" := ServiceHeader."Transit No. CZL";
- end;
-#endif
-
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Service Post Invoice Events", 'OnPostLedgerEntryOnBeforeGenJnlPostLine', '', false, false)]
local procedure UpdateSymbolsAndBankAccountOnPostLedgerEntryOnBeforeGenJnlPostLine(var GenJournalLine: Record "Gen. Journal Line"; ServiceHeader: Record "Service Header")
begin
diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/SyncDepFldContactCZL.Codeunit.al b/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/SyncDepFldContactCZL.Codeunit.al
deleted file mode 100644
index cabcd85da6..0000000000
--- a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/SyncDepFldContactCZL.Codeunit.al
+++ /dev/null
@@ -1,58 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-#if not CLEAN23
-namespace Microsoft.Utilities;
-
-using Microsoft.CRM.Contact;
-
-#pragma warning disable AL0432
-codeunit 31152 "Sync.Dep.Fld-Contact CZL"
-{
- Access = Internal;
- Permissions = tabledata "Contact" = rimd;
-
- [EventSubscriber(ObjectType::Table, Database::Contact, 'OnBeforeInsertEvent', '', false, false)]
- local procedure SyncOnBeforeInsertContact(var Rec: Record Contact)
- begin
- SyncDeprecatedFields(Rec);
- end;
-
- [EventSubscriber(ObjectType::Table, Database::Contact, 'OnBeforeModifyEvent', '', false, false)]
- local procedure SyncOnBeforeModifyContact(var Rec: Record Contact)
- begin
- SyncDeprecatedFields(Rec);
- end;
-
- local procedure SyncDeprecatedFields(var Rec: Record Contact)
- var
- PreviousRecord: Record Contact;
- SyncDepFldUtilities: Codeunit "Sync.Dep.Fld-Utilities";
- PreviousRecordRef: RecordRef;
- DepFieldTxt, NewFieldTxt : Text;
- begin
- if Rec.IsTemporary() then
- exit;
- if SyncDepFldUtilities.GetPreviousRecord(Rec, PreviousRecordRef) then
- PreviousRecordRef.SetTable(PreviousRecord);
- DepFieldTxt := Rec."Registration No. CZL";
- NewFieldTxt := Rec."Registration Number";
- SyncDepFldUtilities.SyncFields(DepFieldTxt, NewFieldTxt, PreviousRecord."Registration No. CZL", PreviousRecord."Registration Number");
- Rec."Registration No. CZL" := CopyStr(DepFieldTxt, 1, MaxStrLen(Rec."Registration No. CZL"));
- Rec."Registration Number" := CopyStr(NewFieldTxt, 1, MaxStrLen(Rec."Registration Number"));
- end;
-
- [EventSubscriber(ObjectType::Table, Database::Contact, 'OnAfterValidateEvent', 'Registration No. CZL', false, false)]
- local procedure SyncOnAfterValidateRegistrationNoCZL(var Rec: Record Contact)
- begin
- Rec."Registration Number" := Rec."Registration No. CZL";
- end;
-
- [EventSubscriber(ObjectType::Table, Database::Contact, 'OnAfterValidateEvent', 'Registration Number', false, false)]
- local procedure SyncOnAfterValidateVatReportingDate(var Rec: Record Contact)
- begin
- Rec."Registration No. CZL" := Rec.GetRegistrationNoTrimmedCZL();
- end;
-}
-#endif
diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/SyncDepFldCustomerCZL.Codeunit.al b/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/SyncDepFldCustomerCZL.Codeunit.al
deleted file mode 100644
index ff3e6b401d..0000000000
--- a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/SyncDepFldCustomerCZL.Codeunit.al
+++ /dev/null
@@ -1,58 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-#if not CLEAN23
-namespace Microsoft.Utilities;
-
-using Microsoft.Sales.Customer;
-
-#pragma warning disable AL0432
-codeunit 31150 "Sync.Dep.Fld-Customer CZL"
-{
- Access = Internal;
- Permissions = tabledata "Customer" = rimd;
-
- [EventSubscriber(ObjectType::Table, Database::Customer, 'OnBeforeInsertEvent', '', false, false)]
- local procedure SyncOnBeforeInsertCustomer(var Rec: Record Customer)
- begin
- SyncDeprecatedFields(Rec);
- end;
-
- [EventSubscriber(ObjectType::Table, Database::Customer, 'OnBeforeModifyEvent', '', false, false)]
- local procedure SyncOnBeforeModifyCustomer(var Rec: Record Customer)
- begin
- SyncDeprecatedFields(Rec);
- end;
-
- local procedure SyncDeprecatedFields(var Rec: Record Customer)
- var
- PreviousRecord: Record Customer;
- SyncDepFldUtilities: Codeunit "Sync.Dep.Fld-Utilities";
- PreviousRecordRef: RecordRef;
- DepFieldTxt, NewFieldTxt : Text;
- begin
- if Rec.IsTemporary() then
- exit;
- if SyncDepFldUtilities.GetPreviousRecord(Rec, PreviousRecordRef) then
- PreviousRecordRef.SetTable(PreviousRecord);
- DepFieldTxt := Rec."Registration No. CZL";
- NewFieldTxt := Rec."Registration Number";
- SyncDepFldUtilities.SyncFields(DepFieldTxt, NewFieldTxt, PreviousRecord."Registration No. CZL", PreviousRecord."Registration Number");
- Rec."Registration No. CZL" := CopyStr(DepFieldTxt, 1, MaxStrLen(Rec."Registration No. CZL"));
- Rec."Registration Number" := CopyStr(NewFieldTxt, 1, MaxStrLen(Rec."Registration Number"));
- end;
-
- [EventSubscriber(ObjectType::Table, Database::Customer, 'OnAfterValidateEvent', 'Registration No. CZL', false, false)]
- local procedure SyncOnAfterValidateRegistrationNoCZL(var Rec: Record Customer)
- begin
- Rec."Registration Number" := Rec."Registration No. CZL";
- end;
-
- [EventSubscriber(ObjectType::Table, Database::Customer, 'OnAfterValidateEvent', 'Registration Number', false, false)]
- local procedure SyncOnAfterValidateVatReportingDate(var Rec: Record Customer)
- begin
- Rec."Registration No. CZL" := Rec.GetRegistrationNoTrimmedCZL();
- end;
-}
-#endif
diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/SyncDepFldPCrMemoHdrCZL.Codeunit.al b/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/SyncDepFldPCrMemoHdrCZL.Codeunit.al
deleted file mode 100644
index b9c6991960..0000000000
--- a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/SyncDepFldPCrMemoHdrCZL.Codeunit.al
+++ /dev/null
@@ -1,67 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-#if not CLEAN23
-namespace Microsoft.Utilities;
-
-using Microsoft.Finance.EU3PartyTrade;
-using Microsoft.Purchases.History;
-
-#pragma warning disable AL0432
-codeunit 31466 "Sync.Dep.Fld-PCrMemoHdr CZL"
-{
- Access = Internal;
- Permissions = tabledata "Purch. Cr. Memo Hdr." = rimd;
-
- [EventSubscriber(ObjectType::Table, Database::"Purch. Cr. Memo Hdr.", 'OnAfterInsertEvent', '', false, false)]
- local procedure SyncOnAfterInsertPurchCrMemoHdr(var Rec: Record "Purch. Cr. Memo Hdr.")
- begin
- SyncDeprecatedFields(Rec);
- end;
-
- [EventSubscriber(ObjectType::Table, Database::"Purch. Cr. Memo Hdr.", 'OnAfterModifyEvent', '', false, false)]
- local procedure SyncOnAfterModifyPurchCrMemoHdr(var Rec: Record "Purch. Cr. Memo Hdr.")
- begin
- SyncDeprecatedFields(Rec);
- end;
-
- local procedure SyncDeprecatedFields(var Rec: Record "Purch. Cr. Memo Hdr.")
- var
- SyncLoopingHelper: Codeunit "Sync. Looping Helper";
- begin
- if Rec.IsTemporary() then
- exit;
- if SyncLoopingHelper.IsFieldSynchronizationSkipped(Database::"Purch. Cr. Memo Hdr.") then
- exit;
- SyncLoopingHelper.SkipFieldSynchronization(SyncLoopingHelper, Database::"Purch. Cr. Memo Hdr.");
- if not IsEU3PartyTradeFeatureEnabled() then
- Rec."EU 3 Party Trade" := Rec."EU 3-Party Trade CZL"
- else
- Rec."EU 3-Party Trade CZL" := Rec."EU 3 Party Trade";
- Rec.Modify();
- SyncLoopingHelper.RestoreFieldSynchronization(Database::"Purch. Cr. Memo Hdr.");
- end;
-
- local procedure IsEU3PartyTradeFeatureEnabled(): Boolean
- var
- EU3PartyTradeFeatMgt: Codeunit "EU3 Party Trade Feat Mgt. CZL";
- begin
- exit(EU3PartyTradeFeatMgt.IsEnabled());
- end;
-
- [EventSubscriber(ObjectType::Table, Database::"Purch. Cr. Memo Hdr.", 'OnAfterValidateEvent', 'EU 3-Party Trade CZL', false, false)]
- local procedure SyncOnAfterValidateEU3PartyTradeCZL(var Rec: Record "Purch. Cr. Memo Hdr.")
- begin
- if not IsEU3PartyTradeFeatureEnabled() then
- Rec."EU 3 Party Trade" := Rec."EU 3-Party Trade CZL";
- end;
-
- [EventSubscriber(ObjectType::Table, Database::"Purch. Cr. Memo Hdr.", 'OnAfterValidateEvent', 'EU 3 Party Trade', false, false)]
- local procedure SyncOnAfterValidateEU3PartyTrade(var Rec: Record "Purch. Cr. Memo Hdr.")
- begin
- if IsEU3PartyTradeFeatureEnabled() then
- Rec."EU 3-Party Trade CZL" := Rec."EU 3 Party Trade";
- end;
-}
-#endif
diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/SyncDepFldPurchHeaderCZL.Codeunit.al b/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/SyncDepFldPurchHeaderCZL.Codeunit.al
deleted file mode 100644
index ff5384d0b2..0000000000
--- a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/SyncDepFldPurchHeaderCZL.Codeunit.al
+++ /dev/null
@@ -1,59 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-#if not CLEAN23
-namespace Microsoft.Utilities;
-
-using Microsoft.Purchases.Document;
-
-#pragma warning disable AL0432
-codeunit 31159 "Sync.Dep.Fld-PurchHeader CZL"
-{
- Access = Internal;
- Permissions = tabledata "Purchase Header" = rimd;
-
- [EventSubscriber(ObjectType::Table, Database::"Purchase Header", 'OnAfterInsertEvent', '', false, false)]
- local procedure SyncOnAfterInsertPurchaseHeader(var Rec: Record "Purchase Header")
- begin
- SyncDeprecatedFields(Rec);
- end;
-
- [EventSubscriber(ObjectType::Table, Database::"Purchase Header", 'OnAfterModifyEvent', '', false, false)]
- local procedure SyncOnAfterModifyPurchaseHeader(var Rec: Record "Purchase Header")
- begin
- SyncDeprecatedFields(Rec);
- end;
-
- local procedure SyncDeprecatedFields(var Rec: Record "Purchase Header")
- var
- SyncLoopingHelper: Codeunit "Sync. Looping Helper";
- begin
- if Rec.IsTemporary() then
- exit;
- if SyncLoopingHelper.IsFieldSynchronizationSkipped(Database::"Purchase Header") then
- exit;
- SyncLoopingHelper.SkipFieldSynchronization(SyncLoopingHelper, Database::"Purchase Header");
- if not Rec.IsEU3PartyTradeFeatureEnabled() then
- Rec."EU 3 Party Trade" := Rec."EU 3-Party Trade CZL"
- else
- Rec."EU 3-Party Trade CZL" := Rec."EU 3 Party Trade";
- Rec.Modify();
- SyncLoopingHelper.RestoreFieldSynchronization(Database::"Purchase Header");
- end;
-
- [EventSubscriber(ObjectType::Table, Database::"Purchase Header", 'OnAfterValidateEvent', 'EU 3-Party Trade CZL', false, false)]
- local procedure SyncOnAfterValidateEU3PartyTradeCZL(var Rec: Record "Purchase Header")
- begin
- if not Rec.IsEU3PartyTradeFeatureEnabled() then
- Rec."EU 3 Party Trade" := Rec."EU 3-Party Trade CZL";
- end;
-
- [EventSubscriber(ObjectType::Table, Database::"Purchase Header", 'OnAfterValidateEvent', 'EU 3 Party Trade', false, false)]
- local procedure SyncOnAfterValidateEU3PartyTrade(var Rec: Record "Purchase Header")
- begin
- if Rec.IsEU3PartyTradeFeatureEnabled() then
- Rec."EU 3-Party Trade CZL" := Rec."EU 3 Party Trade";
- end;
-}
-#endif
diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/SyncDepFldPurchInvHdrCZL.Codeunit.al b/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/SyncDepFldPurchInvHdrCZL.Codeunit.al
deleted file mode 100644
index d991cab5c7..0000000000
--- a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/SyncDepFldPurchInvHdrCZL.Codeunit.al
+++ /dev/null
@@ -1,67 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-#if not CLEAN23
-namespace Microsoft.Utilities;
-
-using Microsoft.Finance.EU3PartyTrade;
-using Microsoft.Purchases.History;
-
-#pragma warning disable AL0432
-codeunit 31467 "Sync.Dep.Fld-PurchInvHdr CZL"
-{
- Access = Internal;
- Permissions = tabledata "Purch. Inv. Header" = rimd;
-
- [EventSubscriber(ObjectType::Table, Database::"Purch. Inv. Header", 'OnAfterInsertEvent', '', false, false)]
- local procedure SyncOnAfterInsertPurchInvHeader(var Rec: Record "Purch. Inv. Header")
- begin
- SyncDeprecatedFields(Rec);
- end;
-
- [EventSubscriber(ObjectType::Table, Database::"Purch. Inv. Header", 'OnAfterModifyEvent', '', false, false)]
- local procedure SyncOnAfterModifyPurchInvHeader(var Rec: Record "Purch. Inv. Header")
- begin
- SyncDeprecatedFields(Rec);
- end;
-
- local procedure SyncDeprecatedFields(var Rec: Record "Purch. Inv. Header")
- var
- SyncLoopingHelper: Codeunit "Sync. Looping Helper";
- begin
- if Rec.IsTemporary() then
- exit;
- if SyncLoopingHelper.IsFieldSynchronizationSkipped(Database::"Purch. Inv. Header") then
- exit;
- SyncLoopingHelper.SkipFieldSynchronization(SyncLoopingHelper, Database::"Purch. Inv. Header");
- if not IsEU3PartyTradeFeatureEnabled() then
- Rec."EU 3 Party Trade" := Rec."EU 3-Party Trade CZL"
- else
- Rec."EU 3-Party Trade CZL" := Rec."EU 3 Party Trade";
- Rec.Modify();
- SyncLoopingHelper.RestoreFieldSynchronization(Database::"Purch. Inv. Header");
- end;
-
- local procedure IsEU3PartyTradeFeatureEnabled(): Boolean
- var
- EU3PartyTradeFeatMgt: Codeunit "EU3 Party Trade Feat Mgt. CZL";
- begin
- exit(EU3PartyTradeFeatMgt.IsEnabled());
- end;
-
- [EventSubscriber(ObjectType::Table, Database::"Purch. Inv. Header", 'OnAfterValidateEvent', 'EU 3-Party Trade CZL', false, false)]
- local procedure SyncOnAfterValidateEU3PartyTradeCZL(var Rec: Record "Purch. Inv. Header")
- begin
- if not IsEU3PartyTradeFeatureEnabled() then
- Rec."EU 3 Party Trade" := Rec."EU 3-Party Trade CZL";
- end;
-
- [EventSubscriber(ObjectType::Table, Database::"Purch. Inv. Header", 'OnAfterValidateEvent', 'EU 3 Party Trade', false, false)]
- local procedure SyncOnAfterValidateEU3PartyTrade(var Rec: Record "Purch. Inv. Header")
- begin
- if IsEU3PartyTradeFeatureEnabled() then
- Rec."EU 3-Party Trade CZL" := Rec."EU 3 Party Trade";
- end;
-}
-#endif
diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/SyncDepFldVATStmtLineCZL.Codeunit.al b/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/SyncDepFldVATStmtLineCZL.Codeunit.al
deleted file mode 100644
index a166f78e46..0000000000
--- a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/SyncDepFldVATStmtLineCZL.Codeunit.al
+++ /dev/null
@@ -1,67 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-#if not CLEAN23
-namespace Microsoft.Utilities;
-
-using Microsoft.Finance.VAT.Reporting;
-using Microsoft.Finance.EU3PartyTrade;
-
-#pragma warning disable AL0432
-codeunit 31124 "Sync.Dep.Fld-VATStmtLine CZL"
-{
- Access = Internal;
- Permissions = tabledata "VAT Statement Line" = rimd;
-
- [EventSubscriber(ObjectType::Table, Database::"VAT Statement Line", 'OnAfterInsertEvent', '', false, false)]
- local procedure SyncOnAfterInsertVATStatementLine(var Rec: Record "VAT Statement Line")
- begin
- SyncDeprecatedFields(Rec);
- end;
-
- [EventSubscriber(ObjectType::Table, Database::"VAT Statement Line", 'OnAfterModifyEvent', '', false, false)]
- local procedure SyncOnAfterModifyVATStatementLine(var Rec: Record "VAT Statement Line")
- begin
- SyncDeprecatedFields(Rec);
- end;
-
- local procedure SyncDeprecatedFields(var Rec: Record "VAT Statement Line")
- var
- SyncLoopingHelper: Codeunit "Sync. Looping Helper";
- begin
- if Rec.IsTemporary() then
- exit;
- if SyncLoopingHelper.IsFieldSynchronizationSkipped(Database::"VAT Statement Line") then
- exit;
- SyncLoopingHelper.SkipFieldSynchronization(SyncLoopingHelper, Database::"VAT Statement Line");
- if not IsEU3PartyTradeFeatureEnabled() then
- Rec."EU 3 Party Trade" := Rec.ConvertEU3PartyTradeToEnum()
- else
- Rec.ConvertEnumToEU3PartyTrade(Rec."EU 3 Party Trade");
- Rec.Modify();
- SyncLoopingHelper.RestoreFieldSynchronization(Database::"VAT Statement Line");
- end;
-
- local procedure IsEU3PartyTradeFeatureEnabled(): Boolean
- var
- EU3PartyTradeFeatMgt: Codeunit "EU3 Party Trade Feat Mgt. CZL";
- begin
- exit(EU3PartyTradeFeatMgt.IsEnabled());
- end;
-
- [EventSubscriber(ObjectType::Table, Database::"VAT Statement Line", 'OnAfterValidateEvent', 'EU-3 Party Trade CZL', false, false)]
- local procedure SyncOnAfterValidateEU3PartyTradeCZL(var Rec: Record "VAT Statement Line")
- begin
- if not IsEU3PartyTradeFeatureEnabled() then
- Rec."EU 3 Party Trade" := Rec.ConvertEU3PartyTradeToEnum();
- end;
-
- [EventSubscriber(ObjectType::Table, Database::"VAT Statement Line", 'OnAfterValidateEvent', 'EU 3 Party Trade', false, false)]
- local procedure SyncOnAfterValidateEU3PartyTrade(var Rec: Record "VAT Statement Line")
- begin
- if IsEU3PartyTradeFeatureEnabled() then
- Rec.ConvertEnumToEU3PartyTrade(Rec."EU 3 Party Trade");
- end;
-}
-#endif
\ No newline at end of file
diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/SyncDepFldVendorCZL.Codeunit.al b/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/SyncDepFldVendorCZL.Codeunit.al
deleted file mode 100644
index f155dce2b5..0000000000
--- a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/SyncDepFldVendorCZL.Codeunit.al
+++ /dev/null
@@ -1,58 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-#if not CLEAN23
-namespace Microsoft.Utilities;
-
-using Microsoft.Purchases.Vendor;
-
-#pragma warning disable AL0432
-codeunit 31151 "Sync.Dep.Fld-Vendor CZL"
-{
- Access = Internal;
- Permissions = tabledata "Vendor" = rimd;
-
- [EventSubscriber(ObjectType::Table, Database::Vendor, 'OnBeforeInsertEvent', '', false, false)]
- local procedure SyncOnBeforeInsertVendor(var Rec: Record Vendor)
- begin
- SyncDeprecatedFields(Rec);
- end;
-
- [EventSubscriber(ObjectType::Table, Database::Vendor, 'OnBeforeModifyEvent', '', false, false)]
- local procedure SyncOnBeforeModifyVendor(var Rec: Record Vendor)
- begin
- SyncDeprecatedFields(Rec);
- end;
-
- local procedure SyncDeprecatedFields(var Rec: Record Vendor)
- var
- PreviousRecord: Record Vendor;
- SyncDepFldUtilities: Codeunit "Sync.Dep.Fld-Utilities";
- PreviousRecordRef: RecordRef;
- DepFieldTxt, NewFieldTxt : Text;
- begin
- if Rec.IsTemporary() then
- exit;
- if SyncDepFldUtilities.GetPreviousRecord(Rec, PreviousRecordRef) then
- PreviousRecordRef.SetTable(PreviousRecord);
- DepFieldTxt := Rec."Registration No. CZL";
- NewFieldTxt := Rec."Registration Number";
- SyncDepFldUtilities.SyncFields(DepFieldTxt, NewFieldTxt, PreviousRecord."Registration No. CZL", PreviousRecord."Registration Number");
- Rec."Registration No. CZL" := CopyStr(DepFieldTxt, 1, MaxStrLen(Rec."Registration No. CZL"));
- Rec."Registration Number" := CopyStr(NewFieldTxt, 1, MaxStrLen(Rec."Registration Number"));
- end;
-
- [EventSubscriber(ObjectType::Table, Database::Vendor, 'OnAfterValidateEvent', 'Registration No. CZL', false, false)]
- local procedure SyncOnAfterValidateRegistrationNoCZL(var Rec: Record Vendor)
- begin
- Rec."Registration Number" := Rec."Registration No. CZL";
- end;
-
- [EventSubscriber(ObjectType::Table, Database::Vendor, 'OnAfterValidateEvent', 'Registration Number', false, false)]
- local procedure SyncOnAfterValidateVatReportingDate(var Rec: Record Vendor)
- begin
- Rec."Registration No. CZL" := Rec.GetRegistrationNoTrimmedCZL();
- end;
-}
-#endif
diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/VATDateHandlerCZL.Codeunit.al b/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/VATDateHandlerCZL.Codeunit.al
index 14ccf0d0bd..3c19afbaed 100644
--- a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/VATDateHandlerCZL.Codeunit.al
+++ b/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/VATDateHandlerCZL.Codeunit.al
@@ -50,39 +50,6 @@ codeunit 11742 "VAT Date Handler CZL"
GLEntry."VAT Reporting Date" := GenJournalLine."VAT Reporting Date";
end;
-#if not CLEAN23
-#pragma warning disable AL0432
- [EventSubscriber(ObjectType::Table, Database::"Invoice Post. Buffer", 'OnAfterInvPostBufferPrepareSales', '', false, false)]
- local procedure UpdateVatDateInvoicePostBufferFromSalesHeader(var InvoicePostBuffer: Record "Invoice Post. Buffer"; var SalesLine: Record "Sales Line")
- var
- SalesHeader: Record "Sales Header";
- begin
- SalesHeader.Get(SalesLine."Document Type", SalesLine."Document No.");
- InvoicePostBuffer."VAT Date CZL" := SalesHeader."VAT Reporting Date";
- InvoicePostBuffer."Original Doc. VAT Date CZL" := SalesHeader."Original Doc. VAT Date CZL";
- end;
-
- [EventSubscriber(ObjectType::Table, Database::"Invoice Post. Buffer", 'OnAfterInvPostBufferPreparePurchase', '', false, false)]
- local procedure UpdateVatDateInvoicePostBufferFromPurchaseHeader(var InvoicePostBuffer: Record "Invoice Post. Buffer"; var PurchaseLine: Record "Purchase Line")
- var
- PurchaseHeader: Record "Purchase Header";
- begin
- PurchaseHeader.Get(PurchaseLine."Document Type", PurchaseLine."Document No.");
- InvoicePostBuffer."VAT Date CZL" := PurchaseHeader."VAT Reporting Date";
- InvoicePostBuffer."Original Doc. VAT Date CZL" := PurchaseHeader."Original Doc. VAT Date CZL";
- end;
-
- [EventSubscriber(ObjectType::Table, Database::"Invoice Post. Buffer", 'OnAfterInvPostBufferPrepareService', '', false, false)]
- local procedure UpdateVatDateInvoicePostBufferFromServiceHeader(var InvoicePostBuffer: Record "Invoice Post. Buffer"; var ServiceLine: Record "Service Line")
- var
- ServiceHeader: Record "Service Header";
- begin
- ServiceHeader.Get(ServiceLine."Document Type", ServiceLine."Document No.");
- InvoicePostBuffer."VAT Date CZL" := ServiceHeader."VAT Reporting Date";
- end;
-
-#pragma warning restore AL0432
-#endif
[EventSubscriber(ObjectType::Codeunit, Codeunit::Microsoft.Sales.Posting."Sales Post Invoice Events", 'OnAfterPrepareInvoicePostingBuffer', '', false, false)]
local procedure UpdateInvoicePostingBufferOnAfterPrepareSales(var InvoicePostingBuffer: Record "Invoice Posting Buffer"; var SalesLine: Record "Sales Line")
var
diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/ContactCardCZL.PageExt.al b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/ContactCardCZL.PageExt.al
index b70fecfffa..1e8e5cb774 100644
--- a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/ContactCardCZL.PageExt.al
+++ b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/ContactCardCZL.PageExt.al
@@ -23,27 +23,6 @@ pageextension 11703 "Contact Card CZL" extends "Contact Card"
}
addafter("VAT Registration No.")
{
-#if not CLEAN23
- field("Registration No. CZL"; Rec."Registration No. CZL")
- {
- Caption = 'Registration No. (Obsolete)';
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the registration number of contact.';
- Visible = false;
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
- ObsoleteReason = 'Replaced by standard "Registration Number" field.';
-
- trigger OnDrillDown()
- var
- RegistrationLogMgtCZL: Codeunit "Registration Log Mgt. CZL";
- begin
- CurrPage.SaveRecord();
- RegistrationLogMgtCZL.AssistEditContactRegNo(Rec);
- CurrPage.Update(false);
- end;
- }
-#endif
field("Tax Registration No. CZL"; Rec."Tax Registration No. CZL")
{
ApplicationArea = Basic, Suite;
diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/ContactListCZL.PageExt.al b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/ContactListCZL.PageExt.al
index 42d84bbf79..56b69a7a3e 100644
--- a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/ContactListCZL.PageExt.al
+++ b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/ContactListCZL.PageExt.al
@@ -20,18 +20,6 @@ pageextension 31223 "Contact List CZL" extends "Contact List"
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies the registration number of contact.';
}
-#if not CLEAN23
- field("Registration No. CZL"; Rec."Registration No. CZL")
- {
- Caption = 'Registration No. (Obsolete)';
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the registration number of contact.';
- Visible = false;
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
- ObsoleteReason = 'Replaced by standard "Registration Number" field.';
- }
-#endif
}
}
}
diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/CustomerCardCZL.PageExt.al b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/CustomerCardCZL.PageExt.al
index 042e372c2c..90276aead4 100644
--- a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/CustomerCardCZL.PageExt.al
+++ b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/CustomerCardCZL.PageExt.al
@@ -24,27 +24,6 @@ pageextension 11704 "Customer Card CZL" extends "Customer Card"
}
addafter("VAT Registration No.")
{
-#if not CLEAN23
- field("Registration No. CZL"; Rec."Registration No. CZL")
- {
- Caption = 'Registration No. (Obsolete)';
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the registration number of customer.';
- Visible = false;
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
- ObsoleteReason = 'Replaced by standard "Registration Number" field.';
-
- trigger OnDrillDown()
- var
- RegistrationLogMgtCZL: Codeunit "Registration Log Mgt. CZL";
- begin
- CurrPage.SaveRecord();
- RegistrationLogMgtCZL.AssistEditCustomerRegNo(Rec);
- CurrPage.Update(false);
- end;
- }
-#endif
field("Tax Registration No. CZL"; Rec."Tax Registration No. CZL")
{
ApplicationArea = Basic, Suite;
diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/CustomerListCZL.PageExt.al b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/CustomerListCZL.PageExt.al
index aa0440d8a3..73cb4a1463 100644
--- a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/CustomerListCZL.PageExt.al
+++ b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/CustomerListCZL.PageExt.al
@@ -22,18 +22,6 @@ pageextension 11767 "Customer List CZL" extends "Customer List"
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies the registration number of customer.';
}
-#if not CLEAN23
- field("Registration No. CZL"; Rec."Registration No. CZL")
- {
- Caption = 'Registration No. (Obsolete)';
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the registration number of customer.';
- Visible = false;
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
- ObsoleteReason = 'Replaced by standard "Registration Number" field.';
- }
-#endif
}
}
diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/PostedPurchCreditMemoCZL.PageExt.al b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/PostedPurchCreditMemoCZL.PageExt.al
index 4530e9e935..5c2dc78d16 100644
--- a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/PostedPurchCreditMemoCZL.PageExt.al
+++ b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/PostedPurchCreditMemoCZL.PageExt.al
@@ -118,20 +118,9 @@ pageextension 11746 "Posted Purch. Credit Memo CZL" extends "Posted Purchase Cre
}
addafter("Invoice Details")
{
-#if not CLEAN23
-#pragma warning disable AS0011
- group("Foreign Trade")
-#pragma warning restore AS0011
-#else
group("Foreign Trade CZL")
-#endif
{
Caption = 'Foreign Trade';
-#if not CLEAN23
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
- ObsoleteReason = 'The group will be renamed from Foreign Trade to Foreign Trade CZL.';
-#endif
field("Language Code CZL"; Rec."Language Code")
{
ApplicationArea = Basic, Suite;
diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/PostedPurchaseInvoiceCZL.PageExt.al b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/PostedPurchaseInvoiceCZL.PageExt.al
index 57b87b784c..469d1745f9 100644
--- a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/PostedPurchaseInvoiceCZL.PageExt.al
+++ b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/PostedPurchaseInvoiceCZL.PageExt.al
@@ -100,20 +100,9 @@ pageextension 11744 "Posted Purchase Invoice CZL" extends "Posted Purchase Invoi
}
addafter("Invoice Details")
{
-#if not CLEAN23
-#pragma warning disable AS0011
- group("Foreign Trade")
-#pragma warning restore AS0011
-#else
group("Foreign Trade CZL")
-#endif
{
Caption = 'Foreign Trade';
-#if not CLEAN23
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
- ObsoleteReason = 'The group will be renamed from Foreign Trade to Foreign Trade CZL.';
-#endif
field("Language Code CZL"; Rec."Language Code")
{
ApplicationArea = Basic, Suite;
diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/VendorCardCZL.PageExt.al b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/VendorCardCZL.PageExt.al
index 54075364a7..592dcab27e 100644
--- a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/VendorCardCZL.PageExt.al
+++ b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/VendorCardCZL.PageExt.al
@@ -24,27 +24,6 @@ pageextension 11705 "Vendor Card CZL" extends "Vendor Card"
}
addafter("VAT Registration No.")
{
-#if not CLEAN23
- field("Registration No. CZL"; Rec."Registration No. CZL")
- {
- Caption = 'Registration No. (Obsolete)';
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the registration number of vendor.';
- Visible = false;
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
- ObsoleteReason = 'Replaced by standard "Registration Number" field.';
-
- trigger OnDrillDown()
- var
- RegistrationLogMgtCZL: Codeunit "Registration Log Mgt. CZL";
- begin
- CurrPage.SaveRecord();
- RegistrationLogMgtCZL.AssistEditVendorRegNo(Rec);
- CurrPage.Update(false);
- end;
- }
-#endif
field("Tax Registration No. CZL"; Rec."Tax Registration No. CZL")
{
ApplicationArea = Basic, Suite;
diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/VendorListCZL.PageExt.al b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/VendorListCZL.PageExt.al
index 1e12fa5d6f..15f3ce0573 100644
--- a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/VendorListCZL.PageExt.al
+++ b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/VendorListCZL.PageExt.al
@@ -23,18 +23,6 @@ pageextension 11768 "Vendor List CZL" extends "Vendor List"
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies the registration number of vendor.';
}
-#if not CLEAN23
- field("Registration No. CZL"; Rec."Registration No. CZL")
- {
- Caption = 'Registration No. (Obsolete)';
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the registration number of vendor.';
- Visible = false;
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
- ObsoleteReason = 'Replaced by standard "Registration Number" field.';
- }
-#endif
}
}
diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/Pages/NonDeductibleVATSetupCZL.Page.al b/Apps/CZ/CoreLocalizationPack/app/Src/Pages/NonDeductibleVATSetupCZL.Page.al
index 4e35581aba..e44f0839e8 100644
--- a/Apps/CZ/CoreLocalizationPack/app/Src/Pages/NonDeductibleVATSetupCZL.Page.al
+++ b/Apps/CZ/CoreLocalizationPack/app/Src/Pages/NonDeductibleVATSetupCZL.Page.al
@@ -21,10 +21,12 @@ page 31215 "Non-Deductible VAT Setup CZL"
field("From Date"; Rec."From Date")
{
ToolTip = 'Specifies the date from which the VAT coefficient is valid.';
+ ShowMandatory = true;
}
field("To Date"; Rec."To Date")
{
ToolTip = 'Specifies the date to which the VAT coefficient is valid.';
+ ShowMandatory = true;
}
field("Advance Coefficient"; Rec."Advance Coefficient")
{
diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/Pages/RegistrationLogDetailsCZL.Page.al b/Apps/CZ/CoreLocalizationPack/app/Src/Pages/RegistrationLogDetailsCZL.Page.al
index 1c091d13e8..af874c2490 100644
--- a/Apps/CZ/CoreLocalizationPack/app/Src/Pages/RegistrationLogDetailsCZL.Page.al
+++ b/Apps/CZ/CoreLocalizationPack/app/Src/Pages/RegistrationLogDetailsCZL.Page.al
@@ -133,7 +133,7 @@ page 31208 "Registration Log Details CZL"
trigger OnAfterGetCurrRecord()
begin
- AcceptEnabled := (Rec.Status = Rec.Status::"Not Valid") and (Rec.Response <> '');
+ AcceptEnabled := Rec.Status = Rec.Status::"Not Valid";
ResetEnabled := Rec.Status = Rec.Status::Accepted;
end;
@@ -148,7 +148,6 @@ page 31208 "Registration Log Details CZL"
RegistrationLogDetail: Record "Registration Log Detail CZL";
begin
RegistrationLogDetail.Copy(Rec);
- RegistrationLogDetail.SetFilter(Response, '<>%1', '');
RegistrationLogDetail.SetRange(Status, Before);
RegistrationLogDetail.ModifyAll(Status, After);
@@ -160,8 +159,6 @@ page 31208 "Registration Log Details CZL"
RegistrationLogDetail: Record "Registration Log Detail CZL";
begin
RegistrationLogDetail.CopyFilters(Rec);
- RegistrationLogDetail.SetFilter(Response, '<>%1', '');
-
RegistrationLogDetail.SetRange(Status, RegistrationLogDetail.Status::"Not Valid");
AcceptAllEnabled := not RegistrationLogDetail.IsEmpty();
diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/Pages/VATStatementPreviewLineCZL.Page.al b/Apps/CZ/CoreLocalizationPack/app/Src/Pages/VATStatementPreviewLineCZL.Page.al
index ff11c46e60..e6987e656c 100644
--- a/Apps/CZ/CoreLocalizationPack/app/Src/Pages/VATStatementPreviewLineCZL.Page.al
+++ b/Apps/CZ/CoreLocalizationPack/app/Src/Pages/VATStatementPreviewLineCZL.Page.al
@@ -100,9 +100,6 @@ page 31136 "VAT Statement Preview Line CZL"
ApplicationArea = VAT;
ToolTip = 'Specifies whether or not totals for transactions involving EU 3-party trades are displayed in the VAT Statement.';
Visible = false;
-#if not CLEAN23
- Enabled = EU3PartyTradeFeatureEnabled;
-#endif
}
field("EU 3-Party Intermed. Role CZL"; Rec."EU 3-Party Intermed. Role CZL")
{
diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/Reports/CalcandPostVATSettlCZL.Report.al b/Apps/CZ/CoreLocalizationPack/app/Src/Reports/CalcandPostVATSettlCZL.Report.al
index 267e0e5558..9bad529847 100644
--- a/Apps/CZ/CoreLocalizationPack/app/Src/Reports/CalcandPostVATSettlCZL.Report.al
+++ b/Apps/CZ/CoreLocalizationPack/app/Src/Reports/CalcandPostVATSettlCZL.Report.al
@@ -948,16 +948,6 @@ report 11971 "Calc. and Post VAT Settl. CZL"
TaxJurisdiction.TestField("Tax Account (Sales)");
end;
end;
-#if not CLEAN23
- [Obsolete('Replaced by GetVATAccountNo function with TaxJurisdiction parameter.', '23.0')]
- procedure GetVATAccountNo(VATEntry: Record "VAT Entry"; VATPostingSetup: Record "VAT Posting Setup"): Code[20]
- var
- TaxJurisdiction: Record "Tax Jurisdiction";
- begin
- TaxJurisdiction.Get(VATEntry."Tax Jurisdiction Code");
- exit(GetVATAccountNo(VATEntry, VATPostingSetup, TaxJurisdiction));
- end;
-#endif
procedure GetVATAccountNo(VATEntry: Record "VAT Entry"; VATPostingSetup: Record "VAT Posting Setup"; TaxJurisdiction: Record "Tax Jurisdiction"): Code[20]
var
diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/ContactCZL.TableExt.al b/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/ContactCZL.TableExt.al
index ef8731dc39..65f4135bd5 100644
--- a/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/ContactCZL.TableExt.al
+++ b/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/ContactCZL.TableExt.al
@@ -43,43 +43,9 @@ tableextension 11700 "Contact CZL" extends Contact
{
Caption = 'Registration No.';
DataClassification = CustomerContent;
-#if not CLEAN23
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-#else
ObsoleteState = Removed;
ObsoleteTag = '26.0';
-#endif
ObsoleteReason = 'Replaced by standard "Registration Number" field.';
-#if not CLEAN23
-
- trigger OnValidate()
- var
- RegistrationLogCZL: Record "Registration Log CZL";
- RegNoServiceConfigCZL: Record "Reg. No. Service Config CZL";
- ResultRecordRef: RecordRef;
- LogNotVerified: Boolean;
- IsHandled: Boolean;
- begin
- OnBeforeOnValidateRegistrationNoCZL(Rec, xRec, IsHandled);
- if IsHandled then
- exit;
-
- if not RegistrationNoMgtCZL.CheckRegistrationNo("Registration No. CZL", "No.", Database::Contact) then
- exit;
-
- LogNotVerified := true;
- if "Registration No. CZL" <> xRec."Registration No. CZL" then
- if RegNoServiceConfigCZL.RegNoSrvIsEnabled() then begin
- LogNotVerified := false;
- RegistrationLogMgtCZL.ValidateRegNoWithARES(ResultRecordRef, Rec, "No.", RegistrationLogCZL."Account Type"::Contact);
- ResultRecordRef.SetTable(Rec);
- end;
-
- if LogNotVerified then
- RegistrationLogMgtCZL.LogContact(Rec);
- end;
-#endif
}
field(11771; "Tax Registration No. CZL"; Text[20])
{
diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/CustomerCZL.TableExt.al b/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/CustomerCZL.TableExt.al
index 1dd42032ae..f0c5045183 100644
--- a/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/CustomerCZL.TableExt.al
+++ b/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/CustomerCZL.TableExt.al
@@ -46,43 +46,9 @@ tableextension 11701 "Customer CZL" extends Customer
{
Caption = 'Registration No.';
DataClassification = CustomerContent;
-#if not CLEAN23
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-#else
ObsoleteState = Removed;
ObsoleteTag = '26.0';
-#endif
ObsoleteReason = 'Replaced by standard "Registration Number" field.';
-#if not CLEAN23
-
- trigger OnValidate()
- var
- RegistrationLogCZL: Record "Registration Log CZL";
- RegNoServiceConfigCZL: Record "Reg. No. Service Config CZL";
- ResultRecordRef: RecordRef;
- LogNotVerified: Boolean;
- IsHandled: Boolean;
- begin
- OnBeforeOnValidateRegistrationNoCZL(Rec, xRec, IsHandled);
- if IsHandled then
- exit;
-
- if not RegistrationNoMgtCZL.CheckRegistrationNo("Registration No. CZL", "No.", Database::Customer) then
- exit;
-
- LogNotVerified := true;
- if "Registration No. CZL" <> xRec."Registration No. CZL" then
- if RegNoServiceConfigCZL.RegNoSrvIsEnabled() then begin
- LogNotVerified := false;
- RegistrationLogMgtCZL.ValidateRegNoWithARES(ResultRecordRef, Rec, "No.", RegistrationLogCZL."Account Type"::Customer);
- ResultRecordRef.SetTable(Rec);
- end;
-
- if LogNotVerified then
- RegistrationLogMgtCZL.LogCustomer(Rec);
- end;
-#endif
}
field(11771; "Tax Registration No. CZL"; Text[20])
{
@@ -127,17 +93,6 @@ tableextension 11701 "Customer CZL" extends Customer
ObsoleteReason = 'Intrastat related functionalities are moved to Intrastat extensions.';
}
}
-#if not CLEAN23
- keys
- {
- key(Key11700; "Registration No. CZL")
- {
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
- ObsoleteReason = 'Replaced by standard "Registration Number" field.';
- }
- }
-#endif
var
RegistrationLogMgtCZL: Codeunit "Registration Log Mgt. CZL";
diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/PurchaseHeaderCZL.TableExt.al b/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/PurchaseHeaderCZL.TableExt.al
index 05b5eabdf5..a32ec760ed 100644
--- a/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/PurchaseHeaderCZL.TableExt.al
+++ b/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/PurchaseHeaderCZL.TableExt.al
@@ -7,9 +7,6 @@ namespace Microsoft.Purchases.Document;
using Microsoft.Bank.BankAccount;
using Microsoft.Bank.Setup;
using Microsoft.Finance.Currency;
-#if not CLEAN23
-using Microsoft.Finance.EU3PartyTrade;
-#endif
using Microsoft.Finance.GeneralLedger.Setup;
using Microsoft.Finance.VAT.Calculation;
using Microsoft.Finance.VAT.Setup;
@@ -338,11 +335,6 @@ tableextension 11705 "Purchase Header CZL" extends "Purchase Header"
GeneralLedgerSetup: Record "General Ledger Setup";
UnreliablePayerMgtCZL: Codeunit "Unreliable Payer Mgt. CZL";
ConfirmManagement: Codeunit "Confirm Management";
-#if not CLEAN23
-#pragma warning disable AL0432
- EU3PartyTradeFeatMgt: Codeunit "EU3 Party Trade Feat Mgt. CZL";
-#pragma warning restore AL0432
-#endif
GlobalDocumentType: Enum "Purchase Document Type";
GlobalDocumentNo: Code[20];
GlobalIsIntrastatTransaction: Boolean;
@@ -578,6 +570,8 @@ tableextension 11705 "Purchase Header CZL" extends "Purchase Header"
#if not CLEAN24
internal procedure IsEU3PartyTradeFeatureEnabled(): Boolean
+ var
+ EU3PartyTradeFeatMgt: Codeunit Microsoft.Finance.EU3PartyTrade."EU3 Party Trade Feat Mgt. CZL";
begin
exit(EU3PartyTradeFeatMgt.IsEnabled());
end;
diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/VATEntryCZL.TableExt.al b/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/VATEntryCZL.TableExt.al
index 795642c950..0822788984 100644
--- a/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/VATEntryCZL.TableExt.al
+++ b/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/VATEntryCZL.TableExt.al
@@ -4,9 +4,6 @@
// ------------------------------------------------------------------------------------------------
namespace Microsoft.Finance.VAT.Ledger;
-#if not CLEAN23
-using Microsoft.Finance.EU3PartyTrade;
-#endif
using Microsoft.Finance.VAT.Reporting;
tableextension 11737 "VAT Entry CZL" extends "VAT Entry"
@@ -113,12 +110,6 @@ tableextension 11737 "VAT Entry CZL" extends "VAT Entry"
VATStmtReportSelectionNotSupportedErr: Label 'VAT statement report selection %1 is not supported.', Comment = '%1 = VAT Statement Report Selection';
procedure SetVATStatementLineFiltersCZL(VATStatementLine: Record "VAT Statement Line")
-#if not CLEAN23
-#pragma warning disable AL0432
- var
- EU3PartyTradeFeatMgt: Codeunit "EU3 Party Trade Feat Mgt. CZL";
-#pragma warning restore AL0432
-#endif
begin
SetRange(Type, VATStatementLine."Gen. Posting Type");
SetRange("VAT Bus. Posting Group", VATStatementLine."VAT Bus. Posting Group");
@@ -129,19 +120,6 @@ tableextension 11737 "VAT Entry CZL" extends "VAT Entry"
SetRange("Gen. Bus. Posting Group", VATStatementLine."Gen. Bus. Posting Group CZL");
if VATStatementLine."Gen. Prod. Posting Group CZL" <> '' then
SetRange("Gen. Prod. Posting Group", VATStatementLine."Gen. Prod. Posting Group CZL");
-#if not CLEAN23
-#pragma warning disable AL0432
- if not EU3PartyTradeFeatMgt.IsEnabled() then begin
- SetRange("EU 3-Party Trade");
- case VATStatementLine."EU-3 Party Trade CZL" of
- VATStatementLine."EU-3 Party Trade CZL"::Yes:
- SetRange("EU 3-Party Trade", true);
- VATStatementLine."EU-3 Party Trade CZL"::No:
- SetRange("EU 3-Party Trade", false);
- end;
- end else
-#pragma warning restore AL0432
-#endif
case VATStatementLine."EU 3 Party Trade" of
VATStatementLine."EU 3 Party Trade"::EU3:
SetRange("EU 3-Party Trade", true);
diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/VATStatementLineCZL.TableExt.al b/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/VATStatementLineCZL.TableExt.al
index a5ce075524..260618a236 100644
--- a/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/VATStatementLineCZL.TableExt.al
+++ b/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/VATStatementLineCZL.TableExt.al
@@ -4,9 +4,6 @@
// ------------------------------------------------------------------------------------------------
namespace Microsoft.Finance.VAT.Reporting;
-#if not CLEAN23
-using Microsoft.Finance.EU3PartyTrade;
-#endif
using Microsoft.Finance.GeneralLedger.Setup;
tableextension 11739 "VAT Statement Line CZL" extends "VAT Statement Line"
@@ -79,33 +76,4 @@ tableextension 11739 "VAT Statement Line CZL" extends "VAT Statement Line"
DataClassification = CustomerContent;
}
}
-#if not CLEAN23
- internal procedure ConvertEU3PartyTradeToEnum(): Enum "EU3 Party Trade Filter"
- begin
-#pragma warning disable AL0432
- case "EU-3 Party Trade CZL" of
- "EU-3 Party Trade CZL"::" ":
- exit("EU 3 Party Trade"::All);
- "EU-3 Party Trade CZL"::Yes:
- exit("EU 3 Party Trade"::EU3);
- "EU-3 Party Trade CZL"::No:
- exit("EU 3 Party Trade"::"non-EU3");
- end
-#pragma warning restore AL0432
- end;
-
- internal procedure ConvertEnumToEU3PartyTrade(EU3PartyTradeFilter: Enum "EU3 Party Trade Filter")
- begin
-#pragma warning disable AL0432
- case EU3PartyTradeFilter of
- EU3PartyTradeFilter::EU3:
- "EU-3 Party Trade CZL" := "EU-3 Party Trade CZL"::Yes;
- EU3PartyTradeFilter::"non-EU3":
- "EU-3 Party Trade CZL" := "EU-3 Party Trade CZL"::No;
- EU3PartyTradeFilter::All:
- "EU-3 Party Trade CZL" := "EU-3 Party Trade CZL"::" ";
- end;
-#pragma warning restore AL0432
- end;
-#endif
}
diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/VendorCZL.TableExt.al b/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/VendorCZL.TableExt.al
index ce0ec4d892..3d83940a91 100644
--- a/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/VendorCZL.TableExt.al
+++ b/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/VendorCZL.TableExt.al
@@ -47,43 +47,9 @@ tableextension 11702 "Vendor CZL" extends Vendor
{
Caption = 'Registration No.';
DataClassification = CustomerContent;
-#if not CLEAN23
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-#else
ObsoleteState = Removed;
ObsoleteTag = '26.0';
-#endif
ObsoleteReason = 'Replaced by standard "Registration Number" field.';
-#if not CLEAN23
-
- trigger OnValidate()
- var
- RegistrationLogCZL: Record "Registration Log CZL";
- RegNoServiceConfigCZL: Record "Reg. No. Service Config CZL";
- ResultRecordRef: RecordRef;
- LogNotVerified: Boolean;
- IsHandled: Boolean;
- begin
- OnBeforeOnValidateRegistrationNoCZL(Rec, xRec, IsHandled);
- if IsHandled then
- exit;
-
- if not RegistrationNoMgtCZL.CheckRegistrationNo("Registration No. CZL", "No.", Database::Vendor) then
- exit;
-
- LogNotVerified := true;
- if "Registration No. CZL" <> xRec."Registration No. CZL" then
- if RegNoServiceConfigCZL.RegNoSrvIsEnabled() then begin
- LogNotVerified := false;
- RegistrationLogMgtCZL.ValidateRegNoWithARES(ResultRecordRef, Rec, "No.", RegistrationLogCZL."Account Type"::Vendor);
- ResultRecordRef.SetTable(Rec);
- end;
-
- if LogNotVerified then
- RegistrationLogMgtCZL.LogVendor(Rec);
- end;
-#endif
}
field(11771; "Tax Registration No. CZL"; Text[20])
{
@@ -152,17 +118,6 @@ tableextension 11702 "Vendor CZL" extends Vendor
ObsoleteReason = 'Intrastat related functionalities are moved to Intrastat extensions.';
}
}
-#if not CLEAN23
- keys
- {
- key(Key11700; "Registration No. CZL")
- {
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
- ObsoleteReason = 'Replaced by standard "Registration Number" field.';
- }
- }
-#endif
var
UnrelPayerServiceSetupCZL: Record "Unrel. Payer Service Setup CZL";
diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/Tables/NonDeductibleVATSetupCZL.Table.al b/Apps/CZ/CoreLocalizationPack/app/Src/Tables/NonDeductibleVATSetupCZL.Table.al
index cb2f5835c7..965c5f6f4a 100644
--- a/Apps/CZ/CoreLocalizationPack/app/Src/Tables/NonDeductibleVATSetupCZL.Table.al
+++ b/Apps/CZ/CoreLocalizationPack/app/Src/Tables/NonDeductibleVATSetupCZL.Table.al
@@ -27,6 +27,11 @@ table 11713 "Non-Deductible VAT Setup CZL"
DecimalPlaces = 0 : 1;
MinValue = 0;
MaxValue = 100;
+
+ trigger OnValidate()
+ begin
+ TestField("To Date");
+ end;
}
field(4; "Settlement Coefficient"; Decimal)
{
@@ -34,6 +39,11 @@ table 11713 "Non-Deductible VAT Setup CZL"
DecimalPlaces = 0 : 1;
MinValue = 0;
MaxValue = 100;
+
+ trigger OnValidate()
+ begin
+ TestField("To Date");
+ end;
}
}
diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/Tables/RegistrationLogCZL.Table.al b/Apps/CZ/CoreLocalizationPack/app/Src/Tables/RegistrationLogCZL.Table.al
index 35440fdfaa..f048c7ad3a 100644
--- a/Apps/CZ/CoreLocalizationPack/app/Src/Tables/RegistrationLogCZL.Table.al
+++ b/Apps/CZ/CoreLocalizationPack/app/Src/Tables/RegistrationLogCZL.Table.al
@@ -138,30 +138,29 @@ table 11756 "Registration Log CZL"
Contact: Record Contact;
CustContUpdate: Codeunit "CustCont-Update";
VendContUpdate: Codeunit "VendCont-Update";
- CustVendBankUpdate: Codeunit "CustVendBank-Update";
RecordRef: RecordRef;
begin
GetAccountRecordRef(RecordRef);
- if OpenDetailForRecRef(RecordRef) then begin
- RecordRef.Modify();
+ if OpenDetailForRecRef(RecordRef) then
case RecordRef.Number of
Database::Customer:
begin
+ RecordRef.Modify();
RecordRef.SetTable(Customer);
CustContUpdate.OnModify(Customer);
end;
Database::Vendor:
begin
+ RecordRef.Modify();
RecordRef.SetTable(Vendor);
VendContUpdate.OnModify(Vendor);
end;
Database::Contact:
begin
RecordRef.SetTable(Contact);
- CustVendBankUpdate.Run(Contact);
+ Contact.Modify(true);
end;
end;
- end;
end;
procedure OpenDetailForRecRef(var RecordRef: RecordRef): Boolean
@@ -312,9 +311,6 @@ table 11756 "Registration Log CZL"
var
RegistrationLogDetail: Record "Registration Log Detail CZL";
begin
- if ResponseValue = '' then
- exit;
-
InitRegistrationLogDetailFromRec(RegistrationLogDetail, FieldName, CurrentValue);
RegistrationLogDetail.Response := CopyStr(ResponseValue, 1, MaxStrLen(RegistrationLogDetail.Response));
diff --git a/Apps/CZ/FixedAssetLocalization/app/Src/Codeunits/FAAcquisitionHandlerCZF.Codeunit.al b/Apps/CZ/FixedAssetLocalization/app/Src/Codeunits/FAAcquisitionHandlerCZF.Codeunit.al
index 6b5a246790..ce497d720e 100644
--- a/Apps/CZ/FixedAssetLocalization/app/Src/Codeunits/FAAcquisitionHandlerCZF.Codeunit.al
+++ b/Apps/CZ/FixedAssetLocalization/app/Src/Codeunits/FAAcquisitionHandlerCZF.Codeunit.al
@@ -268,19 +268,6 @@ codeunit 31236 "FA Acquisition Handler CZF"
IsHandled := true;
end;
-#if not CLEAN23
-#pragma warning disable AL0432
- [EventSubscriber(ObjectType::Table, Database::"Invoice Post. Buffer", 'OnAfterCopyToGenJnlLineFA', '', false, false)]
- local procedure FAPostingTypeCustom2OnAfterCopyToGenJnlLineFAObsolete(var GenJnlLine: Record "Gen. Journal Line"; InvoicePostBuffer: Record "Invoice Post. Buffer")
- begin
- case InvoicePostBuffer."FA Posting Type" of
- InvoicePostBuffer."FA Posting Type"::"Custom 2 CZF":
- GenJnlLine."FA Posting Type" := GenJnlLine."FA Posting Type"::"Custom 2";
- end;
- end;
-
-#pragma warning restore AL0432
-#endif
[EventSubscriber(ObjectType::Table, Database::"Invoice Posting Buffer", 'OnAfterCopyToGenJnlLineFA', '', false, false)]
local procedure FAPostingTypeCustom2OnAfterCopyToGenJnlLineFA(var GenJnlLine: Record "Gen. Journal Line"; InvoicePostingBuffer: Record "Invoice Posting Buffer")
begin
diff --git a/Apps/CZ/FixedAssetLocalization/app/Src/Codeunits/SuppUpdtSourceHandlerCZF.Codeunit.al b/Apps/CZ/FixedAssetLocalization/app/Src/Codeunits/SuppUpdtSourceHandlerCZF.Codeunit.al
new file mode 100644
index 0000000000..ac77b0aeb2
--- /dev/null
+++ b/Apps/CZ/FixedAssetLocalization/app/Src/Codeunits/SuppUpdtSourceHandlerCZF.Codeunit.al
@@ -0,0 +1,13 @@
+codeunit 31176 "Supp. Updt. Source Handler CZF"
+{
+ Access = Internal;
+ EventSubscriberInstance = Manual;
+
+ [EventSubscriber(ObjectType::Table, Database::"Gen. Journal Line", 'OnBeforeUpdateSource', '', false, false)]
+ local procedure SuppressOnBeforeUpdateSource(var GenJournalLine: Record "Gen. Journal Line"; var IsHandled: Boolean)
+ begin
+ if IsHandled then
+ exit;
+ IsHandled := true;
+ end;
+}
\ No newline at end of file
diff --git a/Apps/CZ/FixedAssetLocalization/app/Src/Reports/CalculateDepreciationCZF.Report.al b/Apps/CZ/FixedAssetLocalization/app/Src/Reports/CalculateDepreciationCZF.Report.al
index 3ffbcb751d..90ac9d0fd4 100644
--- a/Apps/CZ/FixedAssetLocalization/app/Src/Reports/CalculateDepreciationCZF.Report.al
+++ b/Apps/CZ/FixedAssetLocalization/app/Src/Reports/CalculateDepreciationCZF.Report.al
@@ -131,7 +131,7 @@ report 31240 "Calculate Depreciation CZF"
FAJournalLine.Validate(FAJournalLine."FA No.", TempFAJournalLine."FA No.");
FAJournalLine."Document No." := DocumentNo2;
FAJournalLine."Posting No. Series" := NoSeries;
- FAJournalLine.Description := PostingDescription;
+ FAJournalLine.Description := BuildDescription(TempFAJournalLine."FA No.", PostingDate);
FAJournalLine.Validate(FAJournalLine."Depreciation Book Code", DeprBookCode);
FAJournalLine.Validate(FAJournalLine.Amount, TempFAJournalLine.Amount);
FAJournalLine."No. of Depreciation Days" := TempFAJournalLine."No. of Depreciation Days";
@@ -170,7 +170,7 @@ report 31240 "Calculate Depreciation CZF"
GenJournalLine."FA Posting Type" := TempGenJournalLine."FA Posting Type";
GenJournalLine."Account Type" := GenJournalLine."Account Type"::"Fixed Asset";
GenJournalLine.Validate(GenJournalLine."Account No.", TempGenJournalLine."Account No.");
- GenJournalLine.Description := PostingDescription;
+ GenJournalLine.Description := BuildDescription(TempGenJournalLine."Account No.", PostingDate);
GenJournalLine."Document No." := DocumentNo2;
GenJournalLine."Posting No. Series" := NoSeries;
GenJournalLine.Validate(GenJournalLine."Depreciation Book Code", DeprBookCode);
@@ -182,8 +182,11 @@ report 31240 "Calculate Depreciation CZF"
OnBeforeGenJnlLineInsert(TempGenJournalLine, GenJournalLine);
GenJournalLine.Insert(true);
GenJnlLineCreatedCount += 1;
- if BalAccount then
+ if BalAccount then begin
+ BindSubscription(SuppUpdtSourceHandlerCZF);
FAInsertGLAccount.GetBalAcc(GenJournalLine, GenJnlNextLineNo);
+ UnBindSubscription(SuppUpdtSourceHandlerCZF);
+ end;
OnAfterFAInsertGLAccGetBalAcc(GenJournalLine, GenJnlNextLineNo, BalAccount);
until TempGenJournalLine.Next() = 0;
OnAfterPostDataItem();
@@ -367,6 +370,7 @@ report 31240 "Calculate Depreciation CZF"
GeneralLedgerSetup: Record "General Ledger Setup";
CalculateDepreciation: Codeunit "Calculate Depreciation";
FAInsertGLAccount: Codeunit "FA Insert G/L Account";
+ SuppUpdtSourceHandlerCZF: Codeunit "Supp. Updt. Source Handler CZF";
WindowDialog: Dialog;
DeprAmount: Decimal;
Custom1Amount: Decimal;
@@ -413,6 +417,11 @@ report 31240 "Calculate Depreciation CZF"
BalAccount := BalAccountFrom;
end;
+ local procedure BuildDescription(FANo: Code[20]; PeriodDate: Date): Text[100]
+ begin
+ exit(StrSubstNo(PostingDescription, FANo, StrSubstNo('%1/%2', Date2DMY(PeriodDate, 3), Date2DMY(PeriodDate, 2))));
+ end;
+
[IntegrationEvent(false, false)]
local procedure OnAfterCalculateDepreciation(FANo: Code[20]; var TempGenJournalLine: Record "Gen. Journal Line" temporary; var TempFAJournalLine: Record "FA Journal Line" temporary; var DeprAmount: Decimal; var NumberOfDays: Integer; DeprBookCode: Code[10]; DeprUntilDate: Date; EntryAmounts: array[4] of Decimal; DaysInPeriod: Integer)
begin
diff --git a/Apps/CZ/IntrastatCZ/app/src/PageExtensions/IntrastatReportCZ.PageExt.al b/Apps/CZ/IntrastatCZ/app/src/PageExtensions/IntrastatReportCZ.PageExt.al
index 6dc7ce584a..0f0d4baf3f 100644
--- a/Apps/CZ/IntrastatCZ/app/src/PageExtensions/IntrastatReportCZ.PageExt.al
+++ b/Apps/CZ/IntrastatCZ/app/src/PageExtensions/IntrastatReportCZ.PageExt.al
@@ -22,4 +22,26 @@ pageextension 31344 "Intrastat Report CZ" extends "Intrastat Report"
}
}
}
+ actions
+ {
+ addafter(CreateFile)
+ {
+ action("Intrastat - Invoice Check CZ")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Intrastat - Invoice Checklist';
+ Ellipsis = true;
+ Image = PrintChecklistReport;
+ ToolTip = 'Open the report for intrastat - invoice checklist.';
+
+ trigger OnAction()
+ var
+ IntrastatReportLine: Record "Intrastat Report Line";
+ begin
+ IntrastatReportLine.SetRange("Intrastat No.", Rec."No.");
+ Report.Run(Report::"Intrastat - Invoice Check CZ", true, false, IntrastatReportLine);
+ end;
+ }
+ }
+ }
}
\ No newline at end of file
diff --git a/Apps/CZ/IntrastatCZ/app/src/PageExtensions/PostedPurchCreditMemoCZ.PageExt.al b/Apps/CZ/IntrastatCZ/app/src/PageExtensions/PostedPurchCreditMemoCZ.PageExt.al
index 0e0b89fd46..247bebeadf 100644
--- a/Apps/CZ/IntrastatCZ/app/src/PageExtensions/PostedPurchCreditMemoCZ.PageExt.al
+++ b/Apps/CZ/IntrastatCZ/app/src/PageExtensions/PostedPurchCreditMemoCZ.PageExt.al
@@ -10,13 +10,7 @@ pageextension 31349 "Posted Purch. Credit Memo CZ" extends "Posted Purchase Cred
{
layout
{
-#if not CLEAN23
-#pragma warning disable AL0432
- addlast("Foreign Trade")
-#pragma warning restore AL0432
-#else
addlast("Foreign Trade CZL")
-#endif
{
field("Intrastat Exclude CZ"; Rec."Intrastat Exclude CZ")
{
diff --git a/Apps/CZ/IntrastatCZ/app/src/Reports/IntrastatInvoiceCheck.rdl b/Apps/CZ/IntrastatCZ/app/src/Reports/IntrastatInvoiceCheck.rdl
new file mode 100644
index 0000000000..bbcd57b967
--- /dev/null
+++ b/Apps/CZ/IntrastatCZ/app/src/Reports/IntrastatInvoiceCheck.rdl
@@ -0,0 +1,2011 @@
+
+
+ 0
+
+
+
+ SQL
+
+
+ None
+ 315d2af2-c54c-4d81-81ef-66c32b66e8ce
+
+
+
+
+
+
+
+
+
+
+ 1.5cm
+
+
+ 2.5cm
+
+
+ 2cm
+
+
+ 1.5cm
+
+
+ 2cm
+
+
+ 3.5cm
+
+
+ 1.75cm
+
+
+ 1.2cm
+
+
+ 1.5cm
+
+
+ 1.5cm
+
+
+ 1.5cm
+
+
+ 1.5cm
+
+
+ 1.5cm
+
+
+ 2cm
+
+
+ 2cm
+
+
+
+
+ 0.5cm
+
+
+
+
+ true
+ true
+
+
+
+
+ =Parameters!Type_IntrastatReportLineCaption.Value
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ =Parameters!DocumentType_CaptionLbl.Value
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ =Parameters!DocumentNo_CaptionLbl.Value
+
+
+
+
+
+
+ Textbox2
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ =Parameters!Date_CaptionLbl.Value
+
+
+
+
+
+
+ Textbox3
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ =Parameters!ItemNo_IntrastatReportLineCaption.Value
+
+
+
+
+
+
+ Textbox9
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ =Parameters!TariffDescription_IntrastatReportLineCaption.Value
+
+
+
+
+
+
+ Textbox76
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ =Parameters!TariffNo_IntrastatReportLineCaption.Value
+
+
+
+
+
+
+ Textbox77
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ =Parameters!CountryRegionCode_IntrastatReportLineCaption.Value
+
+
+
+
+
+
+ Textbox78
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ =Parameters!TransactionType_IntrastatReportLineCaption.Value
+
+
+
+
+
+
+ Textbox79
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ =Parameters!TransactionSpecification_IntrastatReportLineCaption.Value
+
+
+
+
+
+
+ Textbox80
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ =Parameters!TransportMethod_IntrastatReportLineCaption.Value
+
+
+
+
+
+
+ Textbox81
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ =Parameters!ShipmentMethodCode_IntrastatReportLineCaption.Value
+
+
+
+
+
+
+ Textbox82
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ =Parameters!Quantity_IntrastatReportLineCaption.Value
+
+
+
+
+
+
+ Textbox84
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ =Parameters!TotalWeight_IntrastatReportLineCaption.Value
+
+
+
+
+
+
+ Textbox85
+
+
+
+
+
+
+
+ true
+ true
+
+
+
+
+ =Parameters!Amount_IntrastatReportLineCaption.Value
+
+
+
+
+
+
+ Textbox86
+
+
+
+
+
+
+
+ 0.5cm
+
+
+
+
+ true
+
+
+
+
+ =Fields!Type_IntrastatReportLine.Value
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+
+
+ =Fields!DocumentType_ItemLedgerEntry.Value
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+
+
+ =Fields!DocumentNo_ItemLedgerEntry.Value
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+
+
+ =Fields!PostingDate_ItemLedgerEntry.Value
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+
+
+ =Fields!ItemNo_IntrastatReportLine.Value
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+
+
+ =Fields!TariffDescription_IntrastatReportLine.Value
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+
+
+ =Fields!TariffNo_IntrastatReportLine.Value
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+
+
+ =Fields!CountryRegionCode_IntrastatReportLine.Value
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+
+
+ =Fields!TransactionType_IntrastatReportLine.Value
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+
+
+ =Fields!TransactionSpecification_IntrastatReportLine.Value
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+
+
+ =Fields!TransportMethod_IntrastatReportLine.Value
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+
+
+ =Fields!ShipmentMethodCode_IntrastatReportLine.Value
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+
+
+ =Fields!Quantity_IntrastatReportLine.Value
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+
+
+ =Fields!TotalWeight_IntrastatReportLine.Value
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+
+
+ =Fields!Amount_IntrastatReportLine.Value
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 0.5cm
+
+
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+
+
+ =Fields!DocumentType_TempDocBuffer.Value
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+
+
+ =Fields!DocumentNo_TempDocBuffer.Value
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+
+
+ =Fields!PostingDate_TempDocBuffer.Value
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ true
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ After
+ true
+ true
+
+
+
+
+ =Fields!IntrastatNo_IntrastatReportLine.Value
+ =Fields!LineNo_IntrastatReportLine.Value
+
+
+
+
+ After
+ true
+
+
+
+ Detail
+
+
+
+
+
+ =IIF(Len(Fields!DocumentNo_TempDocBuffer.Value) = 0,True,False)
+
+ Detail_Collection
+ Output
+ true
+
+
+
+
+
+ true
+ DataSet_Result
+ 1.5cm
+ 27.45cm
+
+
+
+ 1.5cm
+
+
+ 27.95cm
+
+
+ 1.96611cm
+ true
+ true
+
+
+ true
+ true
+
+
+
+
+ =User!UserID
+
+
+
+
+
+
+ 1cm
+ 24.3cm
+ 0.5cm
+ 3.15cm
+
+
+
+ true
+
+
+
+
+ =Globals!ExecutionTime
+
+
+
+
+
+
+ 0cm
+ 24.3cm
+ 0.5cm
+ 3.15cm
+ 1
+
+
+
+ true
+
+
+
+
+ =First(Fields!CompanyName.Value, "DataSet_Result")
+
+
+
+
+
+
+ 1cm
+ 0.5cm
+ 11cm
+ 2
+
+
+
+ true
+
+
+
+
+ =Parameters!PageLbl.Value & " " & Globals!PageNumber
+
+
+
+
+
+
+ 0.5cm
+ 24.3cm
+ 0.5cm
+ 3.15cm
+ 3
+
+
+
+ true
+ true
+
+
+
+
+ =Parameters!ReportNameLbl.Value
+
+
+
+
+
+
+ ReportNameLbl
+ 0cm
+ 0cm
+ 1cm
+ 11cm
+ 4
+
+
+ 2pt
+ 2pt
+ 2pt
+ 2pt
+
+
+
+
+
+ 21cm
+ 29.7cm
+ 1cm
+ 1cm
+ 2cm
+ 1cm
+
+
+
+
+
+
+ String
+
+
+ PageLbl
+
+
+ PageLbl
+
+
+ String
+
+
+ ReportNameLbl
+
+
+ ReportNameLbl
+
+
+ String
+
+
+ DocumentType_CaptionLbl
+
+
+ DocumentType_CaptionLbl
+
+
+ String
+
+
+ DocumentNo_CaptionLbl
+
+
+ DocumentNo_CaptionLbl
+
+
+ String
+
+
+ Date_CaptionLbl
+
+
+ Date_CaptionLbl
+
+
+ String
+
+
+ Type_IntrastatReportLineCaption
+
+
+ Type_IntrastatReportLineCaption
+
+
+ String
+
+
+ ItemNo_IntrastatReportLineCaption
+
+
+ ItemNo_IntrastatReportLineCaption
+
+
+ String
+
+
+ TariffDescription_IntrastatReportLineCaption
+
+
+ TariffDescription_IntrastatReportLineCaption
+
+
+ String
+
+
+ TariffNo_IntrastatReportLineCaption
+
+
+ TariffNo_IntrastatReportLineCaption
+
+
+ String
+
+
+ CountryRegionCode_IntrastatReportLineCaption
+
+
+ CountryRegionCode_IntrastatReportLineCaption
+
+
+ String
+
+
+ TransactionType_IntrastatReportLineCaption
+
+
+ TransactionType_IntrastatReportLineCaption
+
+
+ String
+
+
+ TransactionSpecification_IntrastatReportLineCaption
+
+
+ TransactionSpecification_IntrastatReportLineCaption
+
+
+ String
+
+
+ TransportMethod_IntrastatReportLineCaption
+
+
+ TransportMethod_IntrastatReportLineCaption
+
+
+ String
+
+
+ ShipmentMethodCode_IntrastatReportLineCaption
+
+
+ ShipmentMethodCode_IntrastatReportLineCaption
+
+
+ String
+
+
+ Area_IntrastatReportLineCaption
+
+
+ Area_IntrastatReportLineCaption
+
+
+ String
+
+
+ Quantity_IntrastatReportLineCaption
+
+
+ Quantity_IntrastatReportLineCaption
+
+
+ String
+
+
+ TotalWeight_IntrastatReportLineCaption
+
+
+ TotalWeight_IntrastatReportLineCaption
+
+
+ String
+
+
+ Amount_IntrastatReportLineCaption
+
+
+ Amount_IntrastatReportLineCaption
+
+
+
+
+ 1
+ 18
+
+
+ 0
+ 0
+ PageLbl
+
+
+ 0
+ 1
+ ReportNameLbl
+
+
+ 0
+ 2
+ DocumentType_CaptionLbl
+
+
+ 0
+ 3
+ DocumentNo_CaptionLbl
+
+
+ 0
+ 4
+ Date_CaptionLbl
+
+
+ 0
+ 5
+ Type_IntrastatReportLineCaption
+
+
+ 0
+ 6
+ ItemNo_IntrastatReportLineCaption
+
+
+ 0
+ 7
+ TariffDescription_IntrastatReportLineCaption
+
+
+ 0
+ 8
+ TariffNo_IntrastatReportLineCaption
+
+
+ 0
+ 9
+ CountryRegionCode_IntrastatReportLineCaption
+
+
+ 0
+ 10
+ TransactionType_IntrastatReportLineCaption
+
+
+ 0
+ 11
+ TransactionSpecification_IntrastatReportLineCaption
+
+
+ 0
+ 12
+ TransportMethod_IntrastatReportLineCaption
+
+
+ 0
+ 13
+ ShipmentMethodCode_IntrastatReportLineCaption
+
+
+ 0
+ 14
+ Area_IntrastatReportLineCaption
+
+
+ 0
+ 15
+ Quantity_IntrastatReportLineCaption
+
+
+ 0
+ 16
+ TotalWeight_IntrastatReportLineCaption
+
+
+ 0
+ 17
+ Amount_IntrastatReportLineCaption
+
+
+
+
+ Public Function BlankZero(ByVal Value As Decimal)
+ if Value = 0 then
+ Return ""
+ end if
+ Return Value
+End Function
+
+Public Function BlankPos(ByVal Value As Decimal)
+ if Value > 0 then
+ Return ""
+ end if
+ Return Value
+End Function
+
+Public Function BlankZeroAndPos(ByVal Value As Decimal)
+ if Value >= 0 then
+ Return ""
+ end if
+ Return Value
+End Function
+
+Public Function BlankNeg(ByVal Value As Decimal)
+ if Value < 0 then
+ Return ""
+ end if
+ Return Value
+End Function
+
+Public Function BlankNegAndZero(ByVal Value As Decimal)
+ if Value <= 0 then
+ Return ""
+ end if
+ Return Value
+End Function
+
+ =User!Language
+ true
+ Cm
+ cf7cd9ce-af2c-4643-ae07-4053b2864bd3
+
+
+
+
+ CompanyName
+
+
+ Type_IntrastatReportLine
+
+
+ DocumentType_ItemLedgerEntry
+
+
+ DocumentNo_ItemLedgerEntry
+
+
+ PostingDate_ItemLedgerEntry
+
+
+ ItemNo_IntrastatReportLine
+
+
+ TariffDescription_IntrastatReportLine
+
+
+ TariffNo_IntrastatReportLine
+
+
+ CountryRegionCode_IntrastatReportLine
+
+
+ TransactionType_IntrastatReportLine
+
+
+ TransactionSpecification_IntrastatReportLine
+
+
+ TransportMethod_IntrastatReportLine
+
+
+ ShipmentMethodCode_IntrastatReportLine
+
+
+ Area_IntrastatReportLine
+
+
+ Quantity_IntrastatReportLine
+
+
+ Quantity_IntrastatReportLineFormat
+
+
+ TotalWeight_IntrastatReportLine
+
+
+ TotalWeight_IntrastatReportLineFormat
+
+
+ Amount_IntrastatReportLine
+
+
+ Amount_IntrastatReportLineFormat
+
+
+ IntrastatNo_IntrastatReportLine
+
+
+ LineNo_IntrastatReportLine
+
+
+ DocumentType_TempDocBuffer
+
+
+ DocumentNo_TempDocBuffer
+
+
+ PostingDate_TempDocBuffer
+
+
+
+ DataSource
+
+
+
+
+
\ No newline at end of file
diff --git a/Apps/CZ/IntrastatCZ/app/src/Reports/IntrastatInvoiceCheckCZ.Report.al b/Apps/CZ/IntrastatCZ/app/src/Reports/IntrastatInvoiceCheckCZ.Report.al
new file mode 100644
index 0000000000..dad29e1792
--- /dev/null
+++ b/Apps/CZ/IntrastatCZ/app/src/Reports/IntrastatInvoiceCheckCZ.Report.al
@@ -0,0 +1,233 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.Inventory.Intrastat;
+
+using Microsoft.Finance.Currency;
+using Microsoft.Finance.GeneralLedger.Reports;
+using Microsoft.Finance.GeneralLedger.Setup;
+using Microsoft.Inventory.Ledger;
+
+report 31300 "Intrastat - Invoice Check CZ"
+{
+ DefaultLayout = RDLC;
+ RDLCLayout = './Src/Reports/IntrastatInvoiceCheck.rdl';
+ Caption = 'Intrastat - Invoice Checklist';
+
+ dataset
+ {
+ dataitem("Intrastat Report Line"; "Intrastat Report Line")
+ {
+ DataItemTableView = sorting("Intrastat No.", "Line No.");
+ RequestFilterFields = "Intrastat No.";
+
+ column(CompanyName; CompanyProperty.DisplayName())
+ {
+ }
+ column(Type_IntrastatReportLine; Type)
+ {
+ IncludeCaption = true;
+ }
+ column(DocumentType_ItemLedgerEntry; DocTypeText)
+ {
+ }
+ column(DocumentNo_ItemLedgerEntry; ItemLedgerEntry."Document No.")
+ {
+ }
+ column(PostingDate_ItemLedgerEntry; ItemLedgerEntry."Posting Date")
+ {
+ }
+ column(ItemNo_IntrastatReportLine; "Item No.")
+ {
+ IncludeCaption = true;
+ }
+ column(TariffDescription_IntrastatReportLine; "Tariff Description")
+ {
+ IncludeCaption = true;
+ }
+ column(TariffNo_IntrastatReportLine; "Tariff No.")
+ {
+ IncludeCaption = true;
+ }
+ column(CountryRegionCode_IntrastatReportLine; "Country/Region Code")
+ {
+ IncludeCaption = true;
+ }
+ column(TransactionType_IntrastatReportLine; "Transaction Type")
+ {
+ IncludeCaption = true;
+ }
+ column(TransactionSpecification_IntrastatReportLine; "Transaction Specification")
+ {
+ IncludeCaption = true;
+ }
+ column(TransportMethod_IntrastatReportLine; "Transport Method")
+ {
+ IncludeCaption = true;
+ }
+ column(ShipmentMethodCode_IntrastatReportLine; "Shpt. Method Code")
+ {
+ IncludeCaption = true;
+ }
+ column(Area_IntrastatReportLine; Area)
+ {
+ IncludeCaption = true;
+ }
+ column(Quantity_IntrastatReportLine; Quantity)
+ {
+ IncludeCaption = true;
+ }
+ column(TotalWeight_IntrastatReportLine; "Total Weight")
+ {
+ IncludeCaption = true;
+ }
+ column(Amount_IntrastatReportLine; Amount)
+ {
+ IncludeCaption = true;
+ }
+ column(IntrastatNo_IntrastatReportLine; "Intrastat No.")
+ {
+ }
+ column(LineNo_IntrastatReportLine; "Line No.")
+ {
+ }
+ dataitem(TempDocBuffer; "G/L Account Adjust. Buffer CZL")
+ {
+
+ DataItemTableView = sorting("Document No.");
+ UseTemporary = true;
+ column(DocumentType_TempDocBuffer; TempDocBuffer.Description)
+ {
+ }
+ column(DocumentNo_TempDocBuffer; TempDocBuffer."Document No.")
+ {
+ }
+ column(PostingDate_TempDocBuffer; TempDocBuffer."Posting Date")
+ {
+ }
+
+ trigger OnAfterGetRecord()
+ begin
+ if TempDocBuffer."Debit Amount" + TempDocBuffer."Credit Amount" = 0 then
+ CurrReport.Skip();
+ if "Intrastat Report Line".Type = "Intrastat Report Line".Type::Shipment then begin
+ TempDocBuffer."Debit Amount" := -TempDocBuffer."Debit Amount";
+ TempDocBuffer."Credit Amount" := -TempDocBuffer."Credit Amount";
+ end;
+ end;
+ }
+
+ trigger OnAfterGetRecord()
+ var
+ ValueEntry: Record "Value Entry";
+ TotalAmt: Decimal;
+ TotalCostAmt: Decimal;
+ TotalAmtExpected: Decimal;
+ TotalCostAmtExpected: Decimal;
+ EntryNoWithQuantity: Integer;
+ begin
+ TempDocBuffer.DeleteAll();
+ ValueEntry.SetCurrentKey("Item Ledger Entry No.");
+ ValueEntry.SetRange("Item Ledger Entry No.", "Source Entry No.");
+ ValueEntry.SetRange("Posting Date", StartDate, EndDate);
+ ValueEntry.SetRange("Entry Type", ValueEntry."Entry Type"::"Direct Cost");
+ if ValueEntry.FindSet() then
+ repeat
+ if ValueEntry."Item Charge No." = '' then
+ CalcTotalAmounts(ValueEntry, TotalAmt, TotalCostAmt, TotalAmtExpected, TotalCostAmtExpected);
+ if (ValueEntry."Item Ledger Entry Quantity" <> 0) and (ValueEntry."Valued Quantity" = 0) then
+ EntryNoWithQuantity := ValueEntry."Entry No."
+ else
+ AddToBuffer(ValueEntry."Document No.", TotalAmt, TotalCostAmt, ValueEntry."Posting Date", ValueEntry."Document Type");
+ until ValueEntry.Next() = 0;
+
+ if ((TotalAmtExpected <> 0) or (TotalCostAmtExpected <> 0)) and (EntryNoWithQuantity <> 0) then begin
+ ValueEntry.Get(EntryNoWithQuantity);
+ AddToBuffer(ValueEntry."Document No.", TotalAmtExpected, TotalCostAmtExpected, ValueEntry."Posting Date", ValueEntry."Document Type");
+ end;
+ if not ItemLedgerEntry.Get("Source Entry No.") then
+ ItemLedgerEntry.Init();
+ DocTypeText := Format(ItemLedgerEntry."Document Type");
+ end;
+
+ trigger OnPreDataItem()
+ begin
+ if not FindFirst() then
+ CurrReport.Break();
+ GeneralLedgerSetup.Get();
+ IntrastatReportHeader.Get("Intrastat No.");
+ if IntrastatReportHeader."Amounts in Add. Currency" then
+ AddCurrencyFactor := CurrencyExchangeRate.ExchangeRate(WorkDate(), GeneralLedgerSetup."Additional Reporting Currency");
+ StartDate := IntrastatReportHeader.GetStatisticsStartDate();
+ EndDate := CalcDate('', StartDate);
+ end;
+ }
+ }
+
+ labels
+ {
+ PageLbl = 'Page';
+ ReportNameLbl = 'Intrastat - Invoice Checklist';
+ DocumentType_CaptionLbl = 'Document Type';
+ DocumentNo_CaptionLbl = 'Document No.';
+ Date_CaptionLbl = 'Date';
+ }
+
+ var
+ GeneralLedgerSetup: Record "General Ledger Setup";
+ CurrencyExchangeRate: Record "Currency Exchange Rate";
+ IntrastatReportHeader: Record "Intrastat Report Header";
+ ItemLedgerEntry: Record "Item Ledger Entry";
+ DocTypeText: Text;
+ StartDate: Date;
+ EndDate: Date;
+ AddCurrencyFactor: Decimal;
+
+ local procedure CalcTotalAmounts(var ValueEntry: Record "Value Entry"; var TotalAmt: Decimal; var TotalCostAmt: Decimal; var TotalAmtExpected: Decimal; var TotalCostAmtExpected: Decimal)
+ begin
+ if not IntrastatReportHeader."Amounts in Add. Currency" then begin
+ TotalAmt := ValueEntry."Sales Amount (Actual)";
+ TotalCostAmt := ValueEntry."Cost Amount (Actual)";
+ TotalAmtExpected := TotalAmtExpected + ValueEntry."Sales Amount (Expected)";
+ TotalCostAmtExpected := TotalCostAmtExpected + ValueEntry."Cost Amount (Expected)";
+ end else begin
+ TotalCostAmt := ValueEntry."Cost Amount (Actual) (ACY)";
+ TotalCostAmtExpected := TotalCostAmtExpected + ValueEntry."Cost Amount (Expected) (ACY)";
+ if ValueEntry."Cost per Unit" <> 0 then begin
+ TotalAmt :=
+ ValueEntry."Sales Amount (Actual)" * ValueEntry."Cost per Unit (ACY)" / ValueEntry."Cost per Unit";
+ TotalAmtExpected :=
+ TotalAmtExpected +
+ ValueEntry."Sales Amount (Expected)" * ValueEntry."Cost per Unit (ACY)" / ValueEntry."Cost per Unit";
+ end else begin
+ TotalAmt :=
+ CurrencyExchangeRate.ExchangeAmtLCYToFCY(
+ ValueEntry."Posting Date", GeneralLedgerSetup."Additional Reporting Currency",
+ ValueEntry."Sales Amount (Actual)", AddCurrencyFactor);
+ TotalAmtExpected :=
+ TotalAmtExpected +
+ CurrencyExchangeRate.ExchangeAmtLCYToFCY(
+ ValueEntry."Posting Date", GeneralLedgerSetup."Additional Reporting Currency",
+ ValueEntry."Sales Amount (Expected)", AddCurrencyFactor);
+ end;
+ end;
+ end;
+
+ local procedure AddToBuffer(DocumentNo: Code[20]; SalesAmount: Decimal; CostAmount: Decimal; PostingDate: Date; DocumentType: Enum "Item Ledger Document Type")
+ begin
+ if TempDocBuffer.Get(DocumentNo) then begin
+ TempDocBuffer."Debit Amount" := TempDocBuffer."Debit Amount" + SalesAmount;
+ TempDocBuffer."Credit Amount" := TempDocBuffer."Credit Amount" + CostAmount;
+ TempDocBuffer.Modify();
+ end else begin
+ TempDocBuffer.Init();
+ TempDocBuffer."Document No." := DocumentNo;
+ TempDocBuffer."Debit Amount" := SalesAmount;
+ TempDocBuffer."Credit Amount" := CostAmount;
+ TempDocBuffer."Posting Date" := PostingDate;
+ TempDocBuffer.Description := Format(DocumentType);
+ TempDocBuffer.Insert();
+ end;
+ end;
+}
diff --git a/Apps/DE/Elster/app/src/Reports/CreateXMLFileVATAdvNotif.Report.al b/Apps/DE/Elster/app/src/Reports/CreateXMLFileVATAdvNotif.Report.al
index 13e3f50ab7..ac2420f966 100644
--- a/Apps/DE/Elster/app/src/Reports/CreateXMLFileVATAdvNotif.Report.al
+++ b/Apps/DE/Elster/app/src/Reports/CreateXMLFileVATAdvNotif.Report.al
@@ -534,13 +534,5 @@ report 11016 "Create XML-File VAT Adv.Notif."
local procedure OnAfterGetRecordOnAfterVATStmtNameSetFilters(var SalesVATAdvanceNotif: Record "Sales VAT Advance Notif."; var VATStatementName: Record "VAT Statement Name")
begin
end;
-
-#if not CLEAN23
- [Obsolete('Removing with local function.', '23.0')]
- [IntegrationEvent(false, false)]
- local procedure OnGetProductVersion(var ProductVersion: Text)
- begin
- end;
-#endif
}
diff --git a/Apps/DK/C52012DataMigration/app/src/items/C5ItemMigrator.Codeunit.al b/Apps/DK/C52012DataMigration/app/src/items/C5ItemMigrator.Codeunit.al
index 7c61fc5034..022ac4a22b 100644
--- a/Apps/DK/C52012DataMigration/app/src/items/C5ItemMigrator.Codeunit.al
+++ b/Apps/DK/C52012DataMigration/app/src/items/C5ItemMigrator.Codeunit.al
@@ -5,7 +5,7 @@
namespace Microsoft.DataMigration.C5;
-#if not CLEAN23
+#if not CLEAN25
#else
using Microsoft.Pricing.Asset;
using Microsoft.Pricing.Source;
@@ -449,7 +449,7 @@ codeunit 1867 "C5 Item Migrator"
until C5InvenPrice.Next() = 0;
end;
-#if not CLEAN23
+#if not CLEAN25
local procedure CreateSalesLineDiscountIfNeeded(C5InvenCustDisc: Record "C5 InvenCustDisc")
var
SalesTypeToSet: Option Customer,"Customer Disc. Group","All Customers",Campaign;
@@ -559,7 +559,7 @@ codeunit 1867 "C5 Item Migrator"
UninitializedItemDataMigrationFacade.CreateItemDiscGroupIfNeeded(C5DiscountGroupCode, GroupDescription);
end;
-#if not CLEAN23
+#if not CLEAN25
local procedure CreateNavSalesPriceIfNeeded(C5InvenPrice: Record "C5 InvenPrice")
var
SalesType: Option Customer,"Customer Price Group","All Customers",Campaign;
diff --git a/Apps/DK/C52012DataMigration/test/src/C5ItemMigratorTest.Codeunit.al b/Apps/DK/C52012DataMigration/test/src/C5ItemMigratorTest.Codeunit.al
index 9d2a445127..b10dd40353 100644
--- a/Apps/DK/C52012DataMigration/test/src/C5ItemMigratorTest.Codeunit.al
+++ b/Apps/DK/C52012DataMigration/test/src/C5ItemMigratorTest.Codeunit.al
@@ -238,7 +238,7 @@ codeunit 148005 "C5 Item Migrator Test"
DefaultDimension: Record "Default Dimension";
DimensionValue: Record "Dimension Value";
CustomerDiscountGroup: Record "Customer Discount Group";
-#if not CLEAN23
+#if not CLEAN25
SalesLineDiscount: Record "Sales Line Discount";
SalesPrice: Record "Sales Price";
#else
@@ -257,13 +257,13 @@ codeunit 148005 "C5 Item Migrator Test"
CustomerDiscountGroup.DeleteAll();
Vendor.DeleteAll();
TariffNumber.DeleteAll();
-#if not CLEAN23
+#if not CLEAN25
SalesLineDiscount.DeleteAll();
#endif
ItemTrackingCode.DeleteAll();
DefaultDimension.DeleteAll();
DimensionValue.DeleteAll();
-#if not CLEAN23
+#if not CLEAN25
SalesPrice.DeleteAll();
#else
PriceListLine.DeleteAll();
@@ -492,7 +492,7 @@ codeunit 148005 "C5 Item Migrator Test"
ItemTrackingCode: Record "Item Tracking Code";
DefaultDimension: Record "Default Dimension";
CustomerDiscountGroup: Record "Customer Discount Group";
-#if not CLEAN23
+#if not CLEAN25
SalesLineDiscount: Record "Sales Line Discount";
SalesPrice: Record "Sales Price";
#else
@@ -528,7 +528,7 @@ codeunit 148005 "C5 Item Migrator Test"
Assert.AreEqual('Super amazing discount cust', CustomerDiscountGroup.Description, 'CustomerDiscountGroup.Description');
// check inven cust disc
-#if not CLEAN23
+#if not CLEAN25
SalesLineDiscount.SetRange(Type, SalesLineDiscount.Type::Item);
SalesLineDiscount.SetRange(Code, ItemNumTxt);
SalesLineDiscount.SetRange("Sales Type", SalesLineDiscount."Sales Type"::"Customer Disc. Group");
@@ -584,7 +584,7 @@ codeunit 148005 "C5 Item Migrator Test"
Assert.IsTrue(Item.PreventNegativeInventory(), 'PreventNegativeInventory incorrect');
// check price is created
-#if not CLEAN23
+#if not CLEAN25
SalesPrice.SetRange("Sales Code", 'PREMIUM');
SalesPrice.SetRange("Sales Type", SalesPrice."Sales Type"::"Customer Price Group");
SalesPrice.SetRange("Item No.", ItemNumTxt);
diff --git a/Apps/DK/OIOUBL/test/src/OIOUBLERMElecDocumentSales.Codeunit.al b/Apps/DK/OIOUBL/test/src/OIOUBLERMElecDocumentSales.Codeunit.al
index 8d74b30795..9e9eaabe3d 100644
--- a/Apps/DK/OIOUBL/test/src/OIOUBLERMElecDocumentSales.Codeunit.al
+++ b/Apps/DK/OIOUBL/test/src/OIOUBLERMElecDocumentSales.Codeunit.al
@@ -34,7 +34,7 @@ codeunit 148053 "OIOUBL-ERM Elec Document Sales"
WrongAllowanceChargeErr: Label 'Wrong value of "AllowanceCharge".';
DefaultCodeTxt: Label 'DEFAULT', Comment = 'Translate as we translate default term in local languages';
OIOUBLFormatNameTxt: Label 'OIOUBL';
- PEPPOLFormatNameTxt: Label 'PEPPOL 2.1';
+ PEPPOLFormatNameTxt: Label 'PEPPOL BIS 3.0';
WrongInvoiceLineCountErr: Label 'Wrong count of "InvoiceLine".';
BaseQuantityTxt: Label 'cbc:BaseQuantity';
NonExistingDocumentFormatErr: Label 'The electronic document format OIOUBL does not exist for the document type %1.', Comment = '%1 = Sales Invoice';
@@ -471,7 +471,7 @@ codeunit 148053 "OIOUBL-ERM Elec Document Sales"
Initialize();
UpdateCompanySwiftCode();
CreateElectronicDocumentFormat(
- PEPPOLFormatNameTxt, ElectronicDocumentFormat.Usage::"Sales Invoice", CODEUNIT::"Export Sales Inv. - PEPPOL 2.1");
+ PEPPOLFormatNameTxt, ElectronicDocumentFormat.Usage::"Sales Invoice", CODEUNIT::"Exp. Sales Inv. PEPPOL BIS3.0");
// [GIVEN] Document Sending Profile = PEPPOL; Sales Invoice.
CreateSalesDocumentWithItem(SalesLine, SalesHeader."Document Type"::Invoice);
@@ -679,7 +679,7 @@ codeunit 148053 "OIOUBL-ERM Elec Document Sales"
Initialize();
UpdateCompanySwiftCode();
CreateElectronicDocumentFormat(
- PEPPOLFormatNameTxt, ElectronicDocumentFormat.Usage::"Sales Credit Memo", CODEUNIT::"Export Sales Cr.M. - PEPPOL2.1");
+ PEPPOLFormatNameTxt, ElectronicDocumentFormat.Usage::"Sales Credit Memo", CODEUNIT::"Exp. Sales CrM. PEPPOL BIS3.0");
// [GIVEN] Document Sending Profile = PEPPOL; Sales Credit Memo.
CreateSalesDocumentWithItem(SalesLine, SalesHeader."Document Type"::"Credit Memo");
@@ -1679,6 +1679,7 @@ codeunit 148053 "OIOUBL-ERM Elec Document Sales"
SalesHeader.VALIDATE("Bill-to City", PostCode.City);
SalesHeader.Validate("Ship-to Address", LibraryUtility.GenerateGUID());
SalesHeader.Validate("Ship-to City", PostCode.City);
+ SalesHeader.Validate("Your Reference", LibraryUtility.GenerateGUID());
SalesHeader.MODIFY(true);
ClearVATRegistrationForCustomer(SalesHeader."Sell-to Customer No.");
end;
diff --git a/Apps/FR/FECAuditFile/app/src/ExportEngine/AuditExportDocCardFEC.PageExt.al b/Apps/FR/FECAuditFile/app/src/ExportEngine/AuditExportDocCardFEC.PageExt.al
index 3a6206ee02..c241990f8d 100644
--- a/Apps/FR/FECAuditFile/app/src/ExportEngine/AuditExportDocCardFEC.PageExt.al
+++ b/Apps/FR/FECAuditFile/app/src/ExportEngine/AuditExportDocCardFEC.PageExt.al
@@ -36,16 +36,6 @@ pageextension 10826 "Audit Export Doc. Card FEC" extends "Audit File Export Doc.
Rec.SetTableFilter();
end;
}
-#if not CLEAN23
- field(UseTransactionNo; Rec."Use Transaction No.")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies whether the transaction number is used as the progressive number in the audit file. If you select the option, the transaction number is used as the progressive number. If you do not select the option, the general ledger register number is used as the progressive number.';
- ObsoleteReason = 'The transaction number will be used as the progressive number by default. This field is no longer needed.';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
- }
-#endif
}
}
diff --git a/Apps/FR/FECAuditFile/app/src/ExportEngine/AuditFileExportHeaderFEC.TableExt.al b/Apps/FR/FECAuditFile/app/src/ExportEngine/AuditFileExportHeaderFEC.TableExt.al
index 40a1628709..b5ac25593b 100644
--- a/Apps/FR/FECAuditFile/app/src/ExportEngine/AuditFileExportHeaderFEC.TableExt.al
+++ b/Apps/FR/FECAuditFile/app/src/ExportEngine/AuditFileExportHeaderFEC.TableExt.al
@@ -56,13 +56,8 @@ tableextension 10826 "Audit File Export Header FEC" extends "Audit File Export H
field(10830; "Use Transaction No."; Boolean)
{
ObsoleteReason = 'The transaction number will be used as the progressive number by default. This field is no longer needed.';
-#if CLEAN23
ObsoleteState = Removed;
ObsoleteTag = '26.0';
-#else
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-#endif
}
}
diff --git a/Apps/FR/FECAuditFile/app/src/ExportEngine/GenerateFileFEC.Codeunit.al b/Apps/FR/FECAuditFile/app/src/ExportEngine/GenerateFileFEC.Codeunit.al
index 0e4c898198..494e92934c 100644
--- a/Apps/FR/FECAuditFile/app/src/ExportEngine/GenerateFileFEC.Codeunit.al
+++ b/Apps/FR/FECAuditFile/app/src/ExportEngine/GenerateFileFEC.Codeunit.al
@@ -161,19 +161,11 @@ codeunit 10826 "Generate File FEC"
UpdateProgressDialog(1, Format(Round(Counter / CounterTotal * 100, 1)));
if GLEntry."Posting Date" <> ClosingDate(GLEntry."Posting Date") then
-#if not CLEAN23
- ProcessGLEntry(GLEntry, AuditFileExportHeader);
-#else
ProcessGLEntry(GLEntry);
-#endif
until GLEntry.Next() = 0;
end;
-#if not CLEAN23
- local procedure ProcessGLEntry(var GLEntry: Record "G/L Entry"; AuditFileExportHeader: Record "Audit File Export Header")
-#else
local procedure ProcessGLEntry(var GLEntry: Record "G/L Entry")
-#endif
var
BankAccountLedgerEntry: Record "Bank Account Ledger Entry";
GLRegister: Record "G/L Register";
@@ -185,6 +177,7 @@ codeunit 10826 "Generate File FEC"
CurrencyCode: Code[10];
DocNoApplied: Text;
DateApplied: Date;
+ DateCreated: Date;
begin
PartyNo := '';
PartyName := '';
@@ -241,15 +234,15 @@ codeunit 10826 "Generate File FEC"
end;
FindGLRegister(GLRegister, GLEntry."Entry No.");
+ if GLRegister.SystemCreatedAt <> 0DT then
+ DateCreated := DT2Date(GLRegister.SystemCreatedAt)
+ else
+ DateCreated := GLRegister."Creation Date";
WriteGLEntryToFile(
GLEntry,
-#if CLEAN23
GLEntry."Transaction No.",
-#else
- GetProgressiveNo(GLRegister, GLEntry, AuditFileExportHeader),
-#endif
- DT2Date(GLRegister.SystemCreatedAt), PartyNo, PartyName, FCYAmount, CurrencyCode, DocNoApplied, DateApplied);
+ DateCreated, PartyNo, PartyName, FCYAmount, CurrencyCode, DocNoApplied, DateApplied);
end;
local procedure CalcDetailedBalanceBySource(GLAccountNo: Code[20]; SourceType: Enum "Gen. Journal Source Type"; SourceNo: Code[20]) TotalAmt: Decimal
@@ -289,11 +282,7 @@ codeunit 10826 "Generate File FEC"
exit;
end;
-#if not CLEAN24
GLRegister.SetLoadFields("From Entry No.", "To Entry No.", "Creation Date");
-#else
- GLRegister.SetLoadFields("From Entry No.", "To Entry No.");
-#endif
if EntryNo > GLRegisterGlobal."To Entry No." then
GLRegister.SetFilter("No.", '>%1', GLRegisterGlobal."No.");
GLRegister.SetFilter("From Entry No.", '<=%1', EntryNo);
@@ -307,9 +296,7 @@ codeunit 10826 "Generate File FEC"
GLRegisterGlobal."No." := GLRegister."No.";
GLRegisterGlobal."From Entry No." := GLRegister."From Entry No.";
GLRegisterGlobal."To Entry No." := GLRegister."To Entry No.";
-#if not CLEAN24
GLRegisterGlobal."Creation Date" := GLRegister."Creation Date";
-#endif
GLRegisterGlobal.SystemCreatedAt := GLRegister.SystemCreatedAt;
end;
@@ -492,15 +479,6 @@ codeunit 10826 "Generate File FEC"
end;
end;
-#if not CLEAN23
- local procedure GetProgressiveNo(var GLRegister: Record "G/L Register"; var GLEntry: Record "G/L Entry"; AuditFileExportHeader: Record "Audit File Export Header"): Integer
- begin
- if AuditFileExportHeader."Use Transaction No." then
- exit(GLEntry."Transaction No.");
- exit(GLRegister."No.");
- end;
-#endif
-
local procedure GetTransPayRecEntriesCount(TransactionNo: Integer; PayRecAcc: Code[20]): Integer
var
GLEntry: Record "G/L Entry";
diff --git a/Apps/FR/FECAuditFile/test/src/FECAuditFileExportTests.Codeunit.al b/Apps/FR/FECAuditFile/test/src/FECAuditFileExportTests.Codeunit.al
index c765263233..fa2daa921b 100644
--- a/Apps/FR/FECAuditFile/test/src/FECAuditFileExportTests.Codeunit.al
+++ b/Apps/FR/FECAuditFile/test/src/FECAuditFileExportTests.Codeunit.al
@@ -2173,11 +2173,7 @@ codeunit 148017 "FEC Audit File Export Tests"
CreateAndPostBankGenJnlLines(BankAccount, "Gen. Journal Account Type"::"Bank Account", StartingDate);
// [WHEN] Export Tax Audit report with "Use Transaction No." = true
-#if CLEAN23
RunFECExport(AuditFile, '', StartingDate, StartingDate, false);
-#else
- RunFECExport(AuditFile, '', StartingDate, StartingDate, false, true);
-#endif
// [THEN] "Transaction No." of the G/L entry is used in the exported file
GLRegister.FindLast();
@@ -2202,11 +2198,7 @@ codeunit 148017 "FEC Audit File Export Tests"
CreateAndPostCustomGenJnlLines(Customer, "Gen. Journal Account Type"::Customer, StartingDate);
// [WHEN] Export Tax Audit report with "Use Transaction No." = true
-#if CLEAN23
RunFECExport(AuditFile, '', StartingDate, StartingDate, false);
-#else
- RunFECExport(AuditFile, '', StartingDate, StartingDate, false, true);
-#endif
// [THEN] "Transaction No." of the G/L entry is used in the exported file
GLRegister.FindLast();
@@ -2231,11 +2223,7 @@ codeunit 148017 "FEC Audit File Export Tests"
CreateAndPostVendorGenJnlLines(Vendor, "Gen. Journal Document Type"::Invoice, StartingDate);
// [WHEN] Export Tax Audit report with "Use Transaction No." = true
-#if CLEAN23
RunFECExport(AuditFile, '', StartingDate, StartingDate, false);
-#else
- RunFECExport(AuditFile, '', StartingDate, StartingDate, false, true);
-#endif
// [THEN] "Transaction No." of the G/L entry is used in the exported file
GLRegister.FindLast();
@@ -2278,22 +2266,6 @@ codeunit 148017 "FEC Audit File Export Tests"
AuditFileExportHeader.Insert(true);
end;
-#if not CLEAN23
- local procedure CreateAuditFileExportDoc(var AuditFileExportHeader: Record "Audit File Export Header"; StartingDate: Date; EndingDate: Date; IncludeOpeningBalances: Boolean; UseTransactionNo: Boolean; DefaultSourceCode: Code[10]; GLAccountViewString: Text[2048])
- begin
- AuditFileExportHeader.Init();
- AuditFileExportHeader.Validate("Audit File Export Format", "Audit File Export Format"::FEC);
- AuditFileExportHeader.Validate("Starting Date", StartingDate);
- AuditFileExportHeader.Validate("Ending Date", EndingDate);
- AuditFileExportHeader.Validate("Include Opening Balances", IncludeOpeningBalances);
- AuditFileExportHeader.Validate("Use Transaction No.", UseTransactionNo);
- AuditFileExportHeader.Validate("Default Source Code", DefaultSourceCode);
- AuditFileExportHeader.Validate("G/L Account View String", GLAccountViewString);
- AuditFileExportHeader.Validate("Parallel Processing", false);
- AuditFileExportHeader.Insert(true);
- end;
-#endif
-
local procedure CreateReadStream(var FileInStream: InStream; var AuditFile: Record "Audit File")
begin
AuditFile.CalcFields("File Content");
@@ -2314,22 +2286,6 @@ codeunit 148017 "FEC Audit File Export Tests"
AuditFile.FindFirst();
end;
-#if not CLEAN23
- local procedure RunFECExport(var AuditFile: Record "Audit File"; GLAccountNoFilter: Text; StartDate: Date; EndDate: Date; IncludeOpeningBalances: Boolean; UseTransactionNo: Boolean)
- var
- AuditFileExportHeader: Record "Audit File Export Header";
- GLAccount: Record "G/L Account";
- AuditFileExportMgt: Codeunit "Audit File Export Mgt.";
- begin
- GLAccount.SetFilter("No.", GLAccountNoFilter);
- CreateAuditFileExportDoc(
- AuditFileExportHeader, StartDate, EndDate, IncludeOpeningBalances, UseTransactionNo, '', CopyStr(GLAccount.GetView(), 1, 2048));
- AuditFileExportMgt.StartExport(AuditFileExportHeader);
- AuditFile.SetRange("Export ID", AuditFileExportHeader.ID);
- AuditFile.FindFirst();
- end;
-#endif
-
local procedure RunFECExport(GLAccountNoFilter: Text; StartDate: Date; EndDate: Date; IncludeOpeningBalances: Boolean) AuditFileExportHeaderID: Integer
var
AuditFileExportHeader: Record "Audit File Export Header";
diff --git a/Apps/GB/UKMakingTaxDigital/app/src/Connection/MTDOAuth20Mgt.Codeunit.al b/Apps/GB/UKMakingTaxDigital/app/src/Connection/MTDOAuth20Mgt.Codeunit.al
index bcfc91bbe3..fff7412a91 100644
--- a/Apps/GB/UKMakingTaxDigital/app/src/Connection/MTDOAuth20Mgt.Codeunit.al
+++ b/Apps/GB/UKMakingTaxDigital/app/src/Connection/MTDOAuth20Mgt.Codeunit.al
@@ -12,6 +12,8 @@ codeunit 10538 "MTD OAuth 2.0 Mgt"
var
OAuth20Mgt: Codeunit "OAuth 2.0 Mgt.";
+ FeatureTelemetry: Codeunit "Feature Telemetry";
+ EnvironmentInformation: Codeunit "Environment Information";
OAuthPRODSetupLbl: Label 'HMRC VAT', Locked = true;
OAuthSandboxSetupLbl: Label 'HMRC VAT Sandbox', Locked = true;
ServiceURLPRODTxt: Label 'https://api.service.hmrc.gov.uk', Locked = true;
@@ -56,6 +58,21 @@ codeunit 10538 "MTD OAuth 2.0 Mgt"
VendorProductNameTxt: Label 'GOV-VENDOR-PRODUCT-NAME', Locked = true;
VendorPublicIpTxt: Label 'GOV-VENDOR-PUBLIC-IP', Locked = true;
VendorVersionTxt: Label 'GOV-VENDOR-VERSION', Locked = true;
+ AzFunctionClientIdKeyTok: Label 'AppNetProxyFnClientID', Locked = true;
+ AzFuncScopeKeyTok: Label 'AppNetProxyFnScope', Locked = true;
+ AzFuncAuthURLKeyTok: Label 'AppNetProxyFnAuthUrl', Locked = true;
+ AzFuncCertificateNameTok: Label 'ElectronicInvoicingCertificateName', Locked = true;
+ AzFuncEndpointTextKeyTok: Label 'ClientPublicIP-Endpoint', Locked = true;
+ CannotGetAuthorityURLFromKeyVaultErr: Label 'Cannot get Authority URL from Azure Key Vault using key %1', Locked = true;
+ CannotGetClientIdFromKeyVaultErr: Label 'Cannot get Client ID from Azure Key Vault using key %1', Locked = true;
+ CannotGetCertFromKeyVaultErr: Label 'Cannot get certificate from Azure Key Vault using key %1', Locked = true;
+ CannotGetScopeFromKeyVaultErr: Label 'Cannot get Scope from Azure Key Vault using key %1', Locked = true;
+ CannotGetEndpointTextFromKeyVaultErr: Label 'Cannot get Endpoint from Azure Key Vault using key %1 ', Locked = true;
+ GetPublicIPAddressRequestFailedErr: Label 'Getting server public IP address from Azure Function failed.', Locked = true;
+ EmptyPublicIPAddressErr: Label 'Azure Function returned empty server public IP address.', Locked = true;
+ NonEmptyPublicIPAddressTxt: Label 'Non-empty server public IP address was returned by Azure Function', Locked = true;
+ IPv4LoopbackIPAddressTxt: Label '127.0.0.1', Locked = true;
+ IPv6LoopbackIPAddressTxt: Label '::1', Locked = true;
internal procedure GetOAuthPRODSetupCode() Result: Code[20]
begin
@@ -405,10 +422,13 @@ codeunit 10538 "MTD OAuth 2.0 Mgt"
local procedure LogFraudPreventionHeadersValidity(RequestJSON: Text)
var
- FeatureTelemetry: Codeunit "Feature Telemetry";
+ VATReportSetup: Record "VAT Report Setup";
+ CustomDimensions: Dictionary of [Text, Text];
JsonObject: JsonObject;
HeaderJsonToken: JsonToken;
ErrorText: Text;
+ ClientIPAddrErrorText: Text;
+ VendorIPAddrErrorText: Text;
begin
if RequestJSON = '' then begin
FeatureTelemetry.LogError('0000LJE', HMRCFraudPreventHeadersTok, '', JsonTextBlankErr);
@@ -427,11 +447,20 @@ codeunit 10538 "MTD OAuth 2.0 Mgt"
JsonObject := HeaderJsonToken.AsObject();
+ ClientIPAddrErrorText := CheckJsonTokenValidity(JsonObject, ClientPublicIpTxt, '[0-9]{1,3}(\.[0-9]{1,3}){3}|([0-9A-Fa-f]{0,4}:){2,7}([0-9A-Fa-f]{1,4})'); // IPv4 or IPv6
+ VendorIPAddrErrorText := CheckJsonTokenValidity(JsonObject, VendorPublicIpTxt, '[0-9]{1,3}(\.[0-9]{1,3}){3}|([0-9A-Fa-f]{0,4}:){2,7}([0-9A-Fa-f]{1,4})'); // IPv4 or IPv6
+ ErrorText += ClientIPAddrErrorText;
+ ErrorText += VendorIPAddrErrorText;
+ if (ClientIPAddrErrorText <> '') or (VendorIPAddrErrorText <> '') then
+ if VATReportSetup.Get() then
+ CustomDimensions.Add('PublicIPServiceURL', VATReportSetup."MTD FP Public IP Service URL");
+ CustomDimensions.Add('IsClientIPAddressLoopback', Format(IsLoopbackIPAddress(GetJsonTokenValue(JsonObject, ClientPublicIpTxt))));
+ CustomDimensions.Add('IsVendorIPAddressLoopback', Format(IsLoopbackIPAddress(GetJsonTokenValue(JsonObject, VendorPublicIpTxt))));
+
ErrorText += CheckJsonTokenValidity(JsonObject, ClientBrowserDoNotTrackTxt, 'true|false'); // true or false
ErrorText += CheckJsonTokenValidity(JsonObject, ClientBrowserJsUserAgentTxt, '\w+'); // any letter, digit, or underscore
ErrorText += CheckJsonTokenValidity(JsonObject, ClientConnectionMethodTxt, 'WEB_APP_VIA_SERVER'); // WEB_APP_VIA_SERVER
ErrorText += CheckJsonTokenValidity(JsonObject, ClientDeviceIdTxt, '\w+'); // any letter, digit, or underscore
- ErrorText += CheckJsonTokenValidity(JsonObject, ClientPublicIpTxt, '[0-9]{1,3}(\.[0-9]{1,3}){3}|([0-9A-Fa-f]{0,4}:){2,7}([0-9A-Fa-f]{1,4})'); // IPv4 or IPv6
ErrorText += CheckJsonTokenValidity(JsonObject, ClientPublicIpTimestampTxt, '\d+[:\.-]\d+[:\.-]\d+'); // for example 13:00:00
ErrorText += CheckJsonTokenValidity(JsonObject, ClientScreensTxt, '^(?=.*width)(?=.*height).*$'); // width and height must be present in any order
ErrorText += CheckJsonTokenValidity(JsonObject, ClientTimezoneTxt, '[-+]\d{1,2}'); // for example +02
@@ -440,15 +469,88 @@ codeunit 10538 "MTD OAuth 2.0 Mgt"
ErrorText += CheckJsonTokenValidity(JsonObject, VendorForwardedTxt, '[0-9]{1,3}(\.[0-9]{1,3}){3}|([0-9A-Fa-f]{0,4}:){2,7}([0-9A-Fa-f]{1,4})'); // IPv4 or IPv6
ErrorText += CheckJsonTokenValidity(JsonObject, VendorLicenseIdsTxt, 'Business.*Central.*\w+'); // Business Central and any letter, digit, or underscore
ErrorText += CheckJsonTokenValidity(JsonObject, VendorProductNameTxt, 'Business.*Central'); // Business Central
- ErrorText += CheckJsonTokenValidity(JsonObject, VendorPublicIpTxt, '[0-9]{1,3}(\.[0-9]{1,3}){3}|([0-9A-Fa-f]{0,4}:){2,7}([0-9A-Fa-f]{1,4})'); // IPv4 or IPv6
ErrorText += CheckJsonTokenValidity(JsonObject, VendorVersionTxt, 'Business.*Central.*=\d+'); // for example Business Central=23
if ErrorText <> '' then
- FeatureTelemetry.LogError('0000LJH', HMRCFraudPreventHeadersTok, FraudPreventHeadersNotValidTxt, ErrorText)
+ FeatureTelemetry.LogError('0000LJH', HMRCFraudPreventHeadersTok, FraudPreventHeadersNotValidTxt, ErrorText, '', CustomDimensions)
else
FeatureTelemetry.LogUsage('0000LJI', HMRCFraudPreventHeadersTok, FraudPreventHeadersValidTxt);
end;
+ [TryFunction]
+ [NonDebuggable]
+ internal procedure GetServerPublicIPFromAzureFunction(var ServerIPAddress: Text)
+ var
+ AzureFunctions: Codeunit "Azure Functions";
+ AzureFunctionsResponse: Codeunit "Azure Functions Response";
+ AzureFunctionsAuthentication: Codeunit "Azure Functions Authentication";
+ AzureFunctionsAuth: Interface "Azure Functions Authentication";
+ ResultResponseMsg: HttpResponseMessage;
+ ClientID, Scope, AuthURL, Endpoint : Text;
+ CustomDimensions: Dictionary of [Text, Text];
+ QueryDict: Dictionary of [Text, Text];
+ Cert: SecretText;
+ begin
+ if not EnvironmentInformation.IsSaaS() then
+ exit;
+
+ GetAzFunctionSecrets(ClientID, Cert, AuthURL, Scope, Endpoint);
+ AzureFunctionsAuth := AzureFunctionsAuthentication.CreateOAuth2WithCert(Endpoint, '', ClientID, Cert, AuthURL, '', Scope);
+ AzureFunctionsResponse := AzureFunctions.SendGetRequest(AzureFunctionsAuth, QueryDict);
+ if not AzureFunctionsResponse.IsSuccessful() then begin
+ AzureFunctionsResponse.GetHttpResponse(ResultResponseMsg);
+ CustomDimensions.Add('HttpStatusCode', Format(ResultResponseMsg.HttpStatusCode));
+ CustomDimensions.Add('ResponseError', AzureFunctionsResponse.GetError());
+ CustomDimensions.Add('ReasonPhrase', ResultResponseMsg.ReasonPhrase);
+ CustomDimensions.Add('IsBlockedByEnvironment', Format(ResultResponseMsg.IsBlockedByEnvironment));
+ FeatureTelemetry.LogError('0000NRO', HMRCFraudPreventHeadersTok, '', GetPublicIPAddressRequestFailedErr, '', CustomDimensions);
+ end;
+ AzureFunctionsResponse.GetResultAsText(ServerIPAddress);
+ if ServerIPAddress = '' then
+ FeatureTelemetry.LogError('0000NRP', HMRCFraudPreventHeadersTok, '', EmptyPublicIPAddressErr)
+ else
+ FeatureTelemetry.LogUsage('0000NRW', HMRCFraudPreventHeadersTok, NonEmptyPublicIPAddressTxt);
+ end;
+
+ [NonDebuggable]
+ local procedure GetAzFunctionSecrets(var ClientID: Text; var Certificate: SecretText; var AuthURL: Text; var Scope: Text; var Endpoint: Text)
+ var
+ AzureKeyVault: Codeunit "Azure Key Vault";
+ CertificateName: Text;
+ begin
+ if not EnvironmentInformation.IsSaaS() then
+ exit;
+
+ if not AzureKeyVault.GetAzureKeyVaultSecret(AzFunctionClientIdKeyTok, ClientID) then begin
+ FeatureTelemetry.LogError('0000NRQ', HMRCFraudPreventHeadersTok, '', StrSubstNo(CannotGetClientIdFromKeyVaultErr, AzFunctionClientIdKeyTok));
+ exit;
+ end;
+
+ if not AzureKeyVault.GetAzureKeyVaultSecret(AzFuncCertificateNameTok, CertificateName) then begin
+ FeatureTelemetry.LogError('0000NRR', HMRCFraudPreventHeadersTok, '', StrSubstNo(CannotGetCertFromKeyVaultErr, AzFuncCertificateNameTok));
+ exit;
+ end;
+ if not AzureKeyVault.GetAzureKeyVaultCertificate(CertificateName, Certificate) then begin
+ FeatureTelemetry.LogError('0000NRS', HMRCFraudPreventHeadersTok, '', StrSubstNo(CannotGetCertFromKeyVaultErr, AzFuncCertificateNameTok));
+ exit;
+ end;
+
+ if not AzureKeyVault.GetAzureKeyVaultSecret(AzFuncAuthURLKeyTok, AuthURL) then begin
+ FeatureTelemetry.LogError('0000NRT', HMRCFraudPreventHeadersTok, '', StrSubstNo(CannotGetAuthorityURLFromKeyVaultErr, AzFuncAuthURLKeyTok));
+ exit;
+ end;
+
+ if not AzureKeyVault.GetAzureKeyVaultSecret(AzFuncScopeKeyTok, Scope) then begin
+ FeatureTelemetry.LogError('0000NRU', HMRCFraudPreventHeadersTok, '', StrSubstNo(CannotGetScopeFromKeyVaultErr, AzFuncScopeKeyTok));
+ exit;
+ end;
+
+ if not AzureKeyVault.GetAzureKeyVaultSecret(AzFuncEndpointTextKeyTok, Endpoint) then begin
+ FeatureTelemetry.LogError('0000NRV', HMRCFraudPreventHeadersTok, '', StrSubstNo(CannotGetEndpointTextFromKeyVaultErr, AzFuncEndpointTextKeyTok));
+ exit;
+ end;
+ end;
+
local procedure CheckJsonTokenValidity(var JsonObject: JsonObject; TokenKey: Text; ValidationRegExPattern: Text) ErrorText: Text
var
JsonToken: JsonToken;
@@ -478,6 +580,20 @@ codeunit 10538 "MTD OAuth 2.0 Mgt"
end;
end;
+ local procedure GetJsonTokenValue(var JsonObject: JsonObject; TokenKey: Text) TextValue: Text
+ var
+ JsonToken: JsonToken;
+ begin
+ if JsonObject.Get(TokenKey, JsonToken) then
+ if JsonToken.WriteTo(TextValue) then
+ exit(TextValue);
+ end;
+
+ local procedure IsLoopbackIPAddress(IPAddress: Text): Boolean
+ begin
+ exit((IPAddress = IPv4LoopbackIPAddressTxt) or (IPAddress = IPv6LoopbackIPAddressTxt));
+ end;
+
[EventSubscriber(ObjectType::Page, Page::"OAuth 2.0 Setup", 'OnBeforeActionEvent', 'RefreshAccessToken', false, false)]
local procedure OnBeforeRefreshAccessTokenFromPage()
var
diff --git a/Apps/GB/UKMakingTaxDigital/app/src/FraudPrevention/MTDFPHeaders.js b/Apps/GB/UKMakingTaxDigital/app/src/FraudPrevention/MTDFPHeaders.js
index 10757d6f4a..3102ec4342 100644
--- a/Apps/GB/UKMakingTaxDigital/app/src/FraudPrevention/MTDFPHeaders.js
+++ b/Apps/GB/UKMakingTaxDigital/app/src/FraudPrevention/MTDFPHeaders.js
@@ -26,20 +26,20 @@ function Run(publicIPServiceURL) {
publicIP: 'error'
};
- Promise.delay = function(t, val) {
+ Promise.delay = function (t, val) {
return new Promise(resolve => {
setTimeout(resolve.bind(null, val), t);
});
}
- Promise.raceAll = function(promises, timeoutTime, timeoutVal) {
+ Promise.raceAll = function (promises, timeoutTime, timeoutVal) {
return Promise.all(promises.map(p => {
return Promise.race([p, Promise.delay(timeoutTime, timeoutVal)])
}));
}
Promise.raceAll(
- [getPublicIPAsync(publicIPServiceURL)], 10000, 'error') // 10 sec timeout
+ [getPublicIPAsync(publicIPServiceURL)], 10000, '') // 10 sec timeout
.then(
function ([publicIP]) {
headersJson.publicIP = publicIP;
diff --git a/Apps/GB/UKMakingTaxDigital/app/src/FraudPrevention/MTDFraudPreventionMgt.Codeunit.al b/Apps/GB/UKMakingTaxDigital/app/src/FraudPrevention/MTDFraudPreventionMgt.Codeunit.al
index 5375edf2ab..fbb7c61e57 100644
--- a/Apps/GB/UKMakingTaxDigital/app/src/FraudPrevention/MTDFraudPreventionMgt.Codeunit.al
+++ b/Apps/GB/UKMakingTaxDigital/app/src/FraudPrevention/MTDFraudPreventionMgt.Codeunit.al
@@ -32,15 +32,20 @@ codeunit 10541 "MTD Fraud Prevention Mgt."
var
TypeHelper: Codeunit "Type Helper";
+ FeatureTelemetry: Codeunit "Feature Telemetry";
+ MTDOAuth20Mgt: Codeunit "MTD OAuth 2.0 Mgt";
ConnectionMethodWebClientTxt: Label 'WEB_APP_VIA_SERVER', Locked = true;
ProdNameTxt: Label 'Microsoft Dynamics 365 Business Central', Locked = true;
ProdNameOnPremSuffixTxt: Label ' OnPrem', Locked = true;
- DefaultProdVersionTxt: Label '22.0.0.0', Locked = true;
+ DefaultProdVersionTxt: Label '25.0.0.0', Locked = true;
IPAddressErr: Label 'Public IP address lookup failed. Specify a service that will return the public IP address of the current user.';
IPAddressOkTxt: Label 'Public IP address lookup was successful.';
LicenseTxt: Label 'Microsoft_Dynamics_365_Business_Central,AadTenantId=%1,TenantId=%2,Start=%3,End=%4', Locked = true;
ClientScreensTxt: Label 'width=%1&height=%2&scaling-factor=1&colour-depth=%3', Locked = true;
ClientWindowTxt: Label 'width=%1&height=%2', Locked = true;
+ HMRCFraudPreventHeadersTok: label 'HMRC Fraud Prevention Headers', Locked = true;
+ NoFPHeadersFromJSErr: Label 'No FP headers were returned from JS.', Locked = true;
+ GetPublicIPAddressRequestFailedErr: Label 'Getting server public IP address from public service failed.', Locked = true;
internal procedure AddFraudPreventionHeaders(var RequestJSON: Text; ConfirmHeaders: Boolean)
var
@@ -69,6 +74,7 @@ codeunit 10541 "MTD Fraud Prevention Mgt."
MTDWebClientFPHeaders: Page "MTD Web Client FP Headers";
vendorIP: Text;
clientIP: Text;
+ VendorForwarded: Text;
begin
VATReportSetup.Get();
VATReportSetup.TestField("MTD FP Public IP Service URL");
@@ -84,12 +90,13 @@ codeunit 10541 "MTD Fraud Prevention Mgt."
MTDWebClientFPHeaders.RunModal();
if GetVendorIP(vendorIP, VATReportSetup."MTD FP Public IP Service URL") then;
- if MTDSessionFraudPrevHdr.Get('Gov-Client-Public-IP') then
- clientIP := MTDSessionFraudPrevHdr.Value
- else
- clientIP := 'error';
MTDSessionFraudPrevHdr.SafeInsert('Gov-Vendor-Public-IP', vendorIP);
- MTDSessionFraudPrevHdr.SafeInsert('Gov-Vendor-Forwarded', 'by=' + vendorIP + '&for=' + clientIP);
+
+ if MTDSessionFraudPrevHdr.Get('Gov-Client-Public-IP') then
+ clientIP := MTDSessionFraudPrevHdr.Value;
+ if (clientIP <> '') and (vendorIP <> '') then
+ VendorForwarded := 'by=' + vendorIP + '&for=' + clientIP;
+ MTDSessionFraudPrevHdr.SafeInsert('Gov-Vendor-Forwarded', VendorForwarded);
end;
local procedure CopySessionHeaders(var JObject: JsonObject)
@@ -182,6 +189,9 @@ codeunit 10541 "MTD Fraud Prevention Mgt."
var
MTDSessionFraudPrevHdr: Record "MTD Session Fraud Prev. Hdr";
begin
+ if JSHeadersJson.Keys.Count = 0 then
+ FeatureTelemetry.LogError('0000NRM', HMRCFraudPreventHeadersTok, '', NoFPHeadersFromJSErr);
+
MTDSessionFraudPrevHdr.SafeInsert('Gov-Client-Public-IP', GetJsonValue(JSHeadersJson, 'publicIP'));
MTDSessionFraudPrevHdr.SafeInsert('Gov-Client-Public-IP-Timestamp', GetJsonValue(JSHeadersJson, 'timestamp'));
MTDSessionFraudPrevHdr.SafeInsert('Gov-Client-Device-ID', GetJsonValue(JSHeadersJson, 'deviceID'));
@@ -217,11 +227,23 @@ codeunit 10541 "MTD Fraud Prevention Mgt."
Regex: Codeunit Regex;
HttpClient: HttpClient;
HttpResponseMessage: HttpResponseMessage;
+ CustomDimensions: Dictionary of [Text, Text];
Content: Text;
RegExString: Text;
begin
- Result := 'error';
+ Result := '';
+ if MTDOAuth20Mgt.GetServerPublicIPFromAzureFunction(Result) then
+ if Result <> '' then
+ exit;
+
HttpClient.Get(url, HttpResponseMessage);
+ if not HttpResponseMessage.IsSuccessStatusCode() then begin
+ CustomDimensions.Add('url', url);
+ CustomDimensions.Add('HttpStatusCode', Format(HttpResponseMessage.HttpStatusCode()));
+ CustomDimensions.Add('ReasonPhrase', HttpResponseMessage.ReasonPhrase);
+ CustomDimensions.Add('IsBlockedByEnvironment', Format(HttpResponseMessage.IsBlockedByEnvironment()));
+ FeatureTelemetry.LogError('0000NRN', HMRCFraudPreventHeadersTok, '', GetPublicIPAddressRequestFailedErr, '', CustomDimensions);
+ end;
HttpResponseMessage.Content().ReadAs(Content);
RegExString := '([0-9]{1,3}(\.[0-9]{1,3}){3})|(([0-9A-Fa-f]{0,4}:){2,7}([0-9A-Fa-f]{1,4}))';
Regex.Match(Content, RegExString, 0, Matches);
@@ -238,7 +260,7 @@ codeunit 10541 "MTD Fraud Prevention Mgt."
if not GetVendorIP(Result, url) then
Error(IPAddressErr);
- if (Result = '') or (Result = 'error') then
+ if Result = '' then
Error(IPAddressErr);
MTDSessionFraudPrevHdr.DeleteAll();
@@ -248,7 +270,7 @@ codeunit 10541 "MTD Fraud Prevention Mgt."
if not MTDSessionFraudPrevHdr.Get('Gov-Client-Public-IP') then
Error(IPAddressErr);
- if (MTDSessionFraudPrevHdr.Value = '') or (MTDSessionFraudPrevHdr.Value = 'error') then
+ if MTDSessionFraudPrevHdr.Value = '' then
Error(IPAddressErr);
Message(IPAddressOkTxt);
diff --git a/Apps/IN/INGST/app/GSTBase/src/Codeunit/GSTDataSenstivityMgmt.Codeunit.al b/Apps/IN/INGST/app/GSTBase/src/Codeunit/GSTDataSenstivityMgmt.Codeunit.al
index a135d02c62..21a512f538 100644
--- a/Apps/IN/INGST/app/GSTBase/src/Codeunit/GSTDataSenstivityMgmt.Codeunit.al
+++ b/Apps/IN/INGST/app/GSTBase/src/Codeunit/GSTDataSenstivityMgmt.Codeunit.al
@@ -37,7 +37,7 @@ using Microsoft.Sales.Archive;
using Microsoft.Sales.Customer;
using Microsoft.Sales.Document;
using Microsoft.Sales.History;
-#if not CLEAN23
+#if not CLEAN25
using Microsoft.Sales.Pricing;
#endif
using Microsoft.Sales.Receivables;
@@ -65,9 +65,6 @@ codeunit 18020 "GST Data Senstivity Mgmt."
SetTableFieldsToNormal(Database::"Detailed GST Entry Buffer");
SetTableFieldsToNormal(Database::"Detailed GST Ledger Entry");
SetTableFieldsToNormal(Database::"Detailed GST Ledger Entry Info");
-#if not CLEAN23
- SetTableFieldsToNormal(Database::"E-Commerce Merchant");
-#endif
SetTableFieldsToNormal(Database::"E-Comm. Merchant");
SetTableFieldsToNormal(Database::"GST Claim Setoff");
SetTableFieldsToNormal(Database::"GST Group");
@@ -146,7 +143,7 @@ codeunit 18020 "GST Data Senstivity Mgmt."
SetTableFieldsToNormal(Database::"Sales Header");
SetTableFieldsToNormal(Database::"Sales Invoice Line");
SetTableFieldsToNormal(Database::"Sales Line");
-#if not CLEAN23
+#if not CLEAN25
SetTableFieldsToNormal(Database::"Sales Price");
#endif
SetTableFieldsToNormal(Database::"Sales Shipment Header");
@@ -201,9 +198,6 @@ codeunit 18020 "GST Data Senstivity Mgmt."
SetTableFieldsToNormal(Database::"GST Journal Batch");
SetTableFieldsToNormal(Database::"GST Journal Line");
SetTableFieldsToNormal(Database::"GST Adjustment Buffer");
-#if not CLEAN23
- SetTableFieldsToNormal(Database::"Invoice Post. Buffer");
-#endif
SetTableFieldsToNormal(Database::"Invoice Posting Buffer");
end;
diff --git a/Apps/IN/INGST/app/GSTBase/src/TableExtension/GSTGenJournalLineExt.TableExt.al b/Apps/IN/INGST/app/GSTBase/src/TableExtension/GSTGenJournalLineExt.TableExt.al
index 58f319ac8f..4b35078c34 100644
--- a/Apps/IN/INGST/app/GSTBase/src/TableExtension/GSTGenJournalLineExt.TableExt.al
+++ b/Apps/IN/INGST/app/GSTBase/src/TableExtension/GSTGenJournalLineExt.TableExt.al
@@ -453,13 +453,8 @@ tableextension 18004 "GST Gen. Journal Line Ext" extends "Gen. Journal Line"
"Merchant Id" = field("e-Commerce Merchant Id"),
"Customer No." = field("e-Commerce Customer"));
ObsoleteReason = 'New field introduced as E-Comm. Merchant Id';
-#if CLEAN23
ObsoleteState = Removed;
ObsoleteTag = '26.0';
-#else
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-#endif
}
field(18052; "E-Comm. Merchant Id"; Code[30])
diff --git a/Apps/IN/INGST/app/GSTBase/src/table/ECommerceMerchant.table.al b/Apps/IN/INGST/app/GSTBase/src/table/ECommerceMerchant.table.al
index f38fc4a113..83579856f6 100644
--- a/Apps/IN/INGST/app/GSTBase/src/table/ECommerceMerchant.table.al
+++ b/Apps/IN/INGST/app/GSTBase/src/table/ECommerceMerchant.table.al
@@ -11,13 +11,9 @@ table 18015 "E-Commerce Merchant"
Caption = 'E-Commerce Merchant';
DataCaptionFields = "Customer No.", "Merchant Id";
ObsoleteReason = 'New table 18017 introduced as "E-Comm. Merchant" with customer No. field length as 20';
-#if CLEAN23
ObsoleteState = Removed;
ObsoleteTag = '26.0';
-#else
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-#endif
+
fields
{
field(1; "Customer No."; code[10])
diff --git a/Apps/IN/INGST/app/GSTPayments/src/Codeunit/GSTJournalLineSubscribers.Codeunit.al b/Apps/IN/INGST/app/GSTPayments/src/Codeunit/GSTJournalLineSubscribers.Codeunit.al
index aeafd655dc..7cfbbb8c16 100644
--- a/Apps/IN/INGST/app/GSTPayments/src/Codeunit/GSTJournalLineSubscribers.Codeunit.al
+++ b/Apps/IN/INGST/app/GSTPayments/src/Codeunit/GSTJournalLineSubscribers.Codeunit.al
@@ -18,9 +18,6 @@ using Microsoft.FixedAssets.Journal;
using Microsoft.FixedAssets.Ledger;
using Microsoft.Inventory.Location;
using Microsoft.Purchases.Document;
-#if not CLEAN23
-using Microsoft.Purchases.Payables;
-#endif
using Microsoft.Purchases.Posting;
using Microsoft.Purchases.Vendor;
using Microsoft.Sales.Customer;
@@ -282,37 +279,6 @@ codeunit 18243 "GST Journal Line Subscribers"
end;
end;
-#if not CLEAN23
- [EventSubscriber(ObjectType::Codeunit, Codeunit::"Purch.-Post", 'OnBeforePostBalancingEntry', '', false, false)]
- local procedure OnBeforePostBalancingEntry(var GenJnlLine: Record "Gen. Journal Line"; var PurchHeader: Record "Purchase Header"; var TotalPurchLine: Record "Purchase Line"; var TotalPurchLineLCY: Record "Purchase Line"; PreviewMode: Boolean; CommitIsSupressed: Boolean; var VendLedgEntry: Record "Vendor Ledger Entry")
- var
- PaymentMethod: Record "Payment Method";
- GLEntry: Record "G/L Entry";
- begin
- if PurchHeader."GST Vendor Type" <> PurchHeader."GST Vendor Type"::" " then
- if PurchHeader."Payment Method Code" <> '' then
- if PaymentMethod.Get(PurchHeader."Payment Method Code") then
- if PaymentMethod."Bal. Account No." <> '' then begin
- GLEntry.LoadFields("External Document No.", "Document No.", "G/L Account No.", "Document Type", "Credit Amount", "Debit Amount", Amount);
- GLEntry.SetRange("External Document No.", GenJnlLine."External Document No.");
- GLEntry.SetRange("Document No.", GenJnlLine."Document No.");
- GLEntry.SetRange("G/L Account No.", GetVendorAccount(PurchHeader."Buy-from Vendor No."));
- if (GenJnlLine."Document Type" = GenJnlLine."Document Type"::Payment) then begin
- GLEntry.SetRange("Document Type", GenJnlLine."Document Type"::Invoice);
- GLEntry.SetFilter("Credit Amount", '<>%1', 0);
- end
- else
- if (GenJnlLine."Document Type" = GenJnlLine."Document Type"::Refund) then begin
- GLEntry.SetRange("Document Type", GenJnlLine."Document Type"::"Credit Memo");
- GLEntry.SetFilter("Debit Amount", '<>%1', 0);
- end;
-
- if GLEntry.FindFirst() then
- GenJnlLine.Validate(Amount, GLEntry.Amount * -1);
- end;
- end;
-#endif
-
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Purch. Post Invoice Events", 'OnPostBalancingEntryOnBeforeGenJnlPostLine', '', false, false)]
local procedure OnPostBalancingEntryOnBeforeGenJnlPostLine(var GenJnlLine: Record "Gen. Journal Line"; var PurchHeader: Record "Purchase Header"; var TotalPurchLine: Record "Purchase Line"; var TotalPurchLineLCY: Record "Purchase Line"; PreviewMode: Boolean; SuppressCommit: Boolean; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line")
var
@@ -342,37 +308,6 @@ codeunit 18243 "GST Journal Line Subscribers"
end;
end;
-#if not CLEAN23
- [EventSubscriber(ObjectType::Codeunit, Codeunit::"Sales-Post", 'OnBeforePostBalancingEntry', '', false, false)]
- local procedure OnBeforePostBalancingEntryforSales(var GenJnlLine: Record "Gen. Journal Line"; SalesHeader: Record "Sales Header")
- var
- PaymentMethod: Record "Payment Method";
- GLEntry: Record "G/L Entry";
- begin
- if (SalesHeader."GST Customer Type" <> SalesHeader."GST Customer Type"::" ") and (SalesHeader."GST Customer Type" <> SalesHeader."GST Customer Type"::Export) then
- if SalesHeader."Payment Method Code" <> '' then
- if PaymentMethod.Get(SalesHeader."Payment Method Code") then
- if PaymentMethod."Bal. Account No." <> '' then begin
- GLEntry.LoadFields("External Document No.", "Document No.", "G/L Account No.", "Document Type", "Debit Amount", "Credit Amount");
- GLEntry.SetRange("External Document No.", GenJnlLine."External Document No.");
- GLEntry.SetRange("Document No.", GenJnlLine."Document No.");
- GLEntry.SetRange("G/L Account No.", GetCustomerAccount(SalesHeader."Bill-to Customer No."));
- if (GenJnlLine."Document Type" = GenJnlLine."Document Type"::Payment) then begin
- GLEntry.SetRange("Document Type", GenJnlLine."Document Type"::Invoice);
- GLEntry.SetFilter("Debit Amount", '<>%1', 0);
- end
- else
- if (GenJnlLine."Document Type" = GenJnlLine."Document Type"::Refund) then begin
- GLEntry.SetRange("Document Type", GenJnlLine."Document Type"::"Credit Memo");
- GLEntry.SetFilter("Credit Amount", '<>%1', 0);
- end;
-
- if GLEntry.FindFirst() then
- GenJnlLine.Validate(Amount, (GLEntry.Amount * -1));
- end;
- end;
-#endif
-
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Sales Post Invoice Events", 'OnPostBalancingEntryOnBeforeGenJnlPostLine', '', false, false)]
local procedure OnPostBalancingEntryOnBeforeGenJnlPostLineforSales(var GenJnlLine: Record "Gen. Journal Line"; SalesHeader: Record "Sales Header")
var
diff --git a/Apps/IN/INGST/app/GSTPayments/src/Codeunit/GSTPurchCustomDutyAvailment.Codeunit.al b/Apps/IN/INGST/app/GSTPayments/src/Codeunit/GSTPurchCustomDutyAvailment.Codeunit.al
index ec38bcce72..8c98a9ad74 100644
--- a/Apps/IN/INGST/app/GSTPayments/src/Codeunit/GSTPurchCustomDutyAvailment.Codeunit.al
+++ b/Apps/IN/INGST/app/GSTPayments/src/Codeunit/GSTPurchCustomDutyAvailment.Codeunit.al
@@ -80,35 +80,6 @@ codeunit 18253 "GST Purch CustomDuty Availment"
GSTCalculatedAmount(PurchaseLine);
end;
-#if not CLEAN23
- [EventSubscriber(ObjectType::Table, Database::"Invoice Post. Buffer", 'OnAfterInvPostBufferPreparePurchase', '', false, false)]
- local procedure FillInvoicePostingBufferNonAvailmentFA(var InvoicePostBuffer: Record "Invoice Post. Buffer"; var PurchaseLine: Record "Purchase Line")
- var
- QtyFactor: Decimal;
- CustomDutyLoaded: Decimal;
- begin
- if (PurchaseLine.Type = PurchaseLine.Type::"Fixed Asset") and (PurchaseLine."GST Credit" = PurchaseLine."GST Credit"::"Availment") then begin
- QtyFactor := PurchaseLine."Qty. to Invoice" / PurchaseLine.Quantity;
- GSTCalculatedAmount(PurchaseLine);
- CustomDutyLoaded := GSTNonAvailmentSessionMgt.GetCustomDutyAmount();
- InvoicePostBuffer."FA Availment" := true;
- InvoicePostBuffer."FA Custom Duty Amount" := Round(CustomDutyLoaded * QtyFactor);
- end;
- end;
-
- [EventSubscriber(ObjectType::Table, Database::"Invoice Post. Buffer", 'OnAfterInvPostBufferModify', '', false, false)]
- local procedure UpdateInvoicePostingBufferNonAvailmentFA(FromInvoicePostBuffer: Record "Invoice Post. Buffer"; var InvoicePostBuffer: Record "Invoice Post. Buffer")
- begin
- InvoicePostBuffer."FA Custom Duty Amount" += FromInvoicePostBuffer."FA Custom Duty Amount";
- end;
-
- [EventSubscriber(ObjectType::Table, Database::"Invoice Post. Buffer", 'OnAfterCopyToGenJnlLine', '', false, false)]
- local procedure FillGenJournalLineNonAvailmentFA(InvoicePostBuffer: Record "Invoice Post. Buffer"; var GenJnlLine: Record "Gen. Journal Line")
- begin
- GenJnlLine."FA Availment" := InvoicePostBuffer."FA Availment";
- GenJnlLine."FA Custom Duty Amount" := InvoicePostBuffer."FA Custom Duty Amount";
- end;
-#else
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Purch. Post Invoice Events", 'OnAfterPrepareInvoicePostingBuffer', '', false, false)]
local procedure FillInvoicePostingBufferNonAvailmentFA(var InvoicePostingBuffer: Record "Invoice Posting Buffer"; var PurchaseLine: Record "Purchase Line")
var
@@ -136,7 +107,6 @@ codeunit 18253 "GST Purch CustomDuty Availment"
GenJnlLine."FA Availment" := InvoicePostingBuffer."FA Availment";
GenJnlLine."FA Custom Duty Amount" := InvoicePostingBuffer."FA Custom Duty Amount";
end;
-#endif
[EventSubscriber(ObjectType::Codeunit, Codeunit::"FA Jnl.-Post Line", 'OnBeforePostFixedAssetFromGenJnlLine', '', false, false)]
local procedure UpdateFANonAvailmentAmount(var FALedgerEntry: Record "FA Ledger Entry"; var GenJournalLine: Record "Gen. Journal Line")
diff --git a/Apps/IN/INGST/app/GSTPayments/src/Codeunit/GSTPurchaseNonAvailment.Codeunit.al b/Apps/IN/INGST/app/GSTPayments/src/Codeunit/GSTPurchaseNonAvailment.Codeunit.al
index 5a1cb3c1de..915c2fa349 100644
--- a/Apps/IN/INGST/app/GSTPayments/src/Codeunit/GSTPurchaseNonAvailment.Codeunit.al
+++ b/Apps/IN/INGST/app/GSTPayments/src/Codeunit/GSTPurchaseNonAvailment.Codeunit.al
@@ -31,24 +31,6 @@ codeunit 18251 "GST Purchase Non Availment"
GSTNonAvailmentSessionMgt.SetQtyToBeInvoiced(QtyToBeInvoiced);
end;
-#if not CLEAN23
- [EventSubscriber(ObjectType::Table, Database::"Invoice Post. Buffer", 'OnAfterInvPostBufferPreparePurchase', '', false, false)]
- local procedure FillInvoicePostingBufferNonAvailmentFA(var InvoicePostBuffer: Record "Invoice Post. Buffer"; var PurchaseLine: Record "Purchase Line")
- var
- QtyFactor: Decimal;
- CustomDutyLoaded: Decimal;
- begin
- if (PurchaseLine.Type = PurchaseLine.Type::"Fixed Asset") and (PurchaseLine."GST Credit" = PurchaseLine."GST Credit"::"Non-Availment") then begin
- QtyFactor := PurchaseLine."Qty. to Invoice" / PurchaseLine.Quantity;
- InvoicePostBuffer."FA Non-Availment Amount" := Round(GSTCalculatedAmount(PurchaseLine) * QtyFactor);
- CustomDutyLoaded := GSTNonAvailmentSessionMgt.GetCustomDutyAmount();
- InvoicePostBuffer."FA Non-Availment" := true;
-
- if CustomDutyLoaded <> 0 then
- InvoicePostBuffer."FA Non-Availment Amount" += Round(CustomDutyLoaded * QtyFactor);
- end;
- end;
-#else
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Purch. Post Invoice Events", 'OnAfterPrepareInvoicePostingBuffer', '', false, false)]
local procedure FillInvoicePostingBufferNonAvailmentFA(var InvoicePostingBuffer: Record "Invoice Posting Buffer"; var PurchaseLine: Record "Purchase Line")
var
@@ -65,22 +47,7 @@ codeunit 18251 "GST Purchase Non Availment"
InvoicePostingBuffer."FA Non-Availment Amount" += Round(CustomDutyLoaded * QtyFactor);
end;
end;
-#endif
-
-#if not CLEAN23
- [EventSubscriber(ObjectType::Table, Database::"Invoice Post. Buffer", 'OnAfterInvPostBufferModify', '', false, false)]
- local procedure UpdateInvoicePostingBufferNonAvailmentFA(FromInvoicePostBuffer: Record "Invoice Post. Buffer"; var InvoicePostBuffer: Record "Invoice Post. Buffer")
- begin
- InvoicePostBuffer."FA Non-Availment Amount" += FromInvoicePostBuffer."FA Non-Availment Amount";
- end;
- [EventSubscriber(ObjectType::Table, Database::"Invoice Post. Buffer", 'OnAfterCopyToGenJnlLine', '', false, false)]
- local procedure FillGenJournalLineNonAvailmentFA(InvoicePostBuffer: Record "Invoice Post. Buffer"; var GenJnlLine: Record "Gen. Journal Line")
- begin
- GenJnlLine."FA Non-Availment" := InvoicePostBuffer."FA Non-Availment";
- GenJnlLine."FA Non-Availment Amount" := InvoicePostBuffer."FA Non-Availment Amount";
- end;
-#else
[EventSubscriber(ObjectType::Table, Database::"Invoice Posting Buffer", 'OnUpdateOnAfterModify', '', false, false)]
local procedure UpdateInvoicePostingBufferNonAvailmentFA(FromInvoicePostingBuffer: Record "Invoice Posting Buffer"; var InvoicePostingBuffer: Record "Invoice Posting Buffer")
begin
@@ -93,7 +60,6 @@ codeunit 18251 "GST Purchase Non Availment"
GenJnlLine."FA Non-Availment" := InvoicePostingBuffer."FA Non-Availment";
GenJnlLine."FA Non-Availment Amount" := InvoicePostingBuffer."FA Non-Availment Amount";
end;
-#endif
[EventSubscriber(ObjectType::Codeunit, Codeunit::"FA Jnl.-Post Line", 'OnBeforePostFixedAssetFromGenJnlLine', '', false, false)]
local procedure UpdateFANonAvailmentAmount(var FALedgerEntry: Record "FA Ledger Entry"; var GenJournalLine: Record "Gen. Journal Line")
diff --git a/Apps/IN/INGST/app/GSTPurchase/src/Codeunit/GSTVendorLedgerEntry.Codeunit.al b/Apps/IN/INGST/app/GSTPurchase/src/Codeunit/GSTVendorLedgerEntry.Codeunit.al
index 3389b4c161..62a8520e78 100644
--- a/Apps/IN/INGST/app/GSTPurchase/src/Codeunit/GSTVendorLedgerEntry.Codeunit.al
+++ b/Apps/IN/INGST/app/GSTPurchase/src/Codeunit/GSTVendorLedgerEntry.Codeunit.al
@@ -44,37 +44,6 @@ codeunit 18082 "GST Vendor Ledger Entry"
end;
end;
-#if not CLEAN23
- [EventSubscriber(ObjectType::Codeunit, Codeunit::"Purch.-Post", 'OnBeforePostVendorEntry', '', false, false)]
- local procedure CopyInfortoVendorEntry(var PurchHeader: Record "Purchase Header"; var GenJnlLine: Record "Gen. Journal Line")
- var
- PurchaseLine: Record "Purchase Line";
- begin
- GenJnlLine."Location Code" := PurchHeader."Location Code";
- GenJnlLine."GST Input Service Distribution" := PurchHeader."GST Input Service Distribution";
- GenJnlLine."GST Reverse Charge" := IsReverseCharge(PurchHeader);
- GenJnlLine."GST Vendor Type" := PurchHeader."GST Vendor Type";
- GenJnlLine."RCM Exempt" := PurchHeader."RCM Exempt";
- GenJnlLine."Location State Code" := PurchHeader."Location State Code";
- GenJnlLine."Location GST Reg. No." := PurchHeader."Location GST Reg. No.";
- if PurchHeader."Order Address Code" <> '' then begin
- GenJnlLine."Order Address Code" := PurchHeader."Order Address Code";
- GenJnlLine."Order Address State Code" := PurchHeader."GST Order Address State";
- GenJnlLine."Order Address GST Reg. No." := PurchHeader."Order Address GST Reg. No.";
- end else begin
- GenJnlLine."GST Bill-to/BuyFrom State Code" := PurchHeader.State;
- GenJnlLine."Vendor GST Reg. No." := PurchHeader."Vendor GST Reg. No.";
- end;
-
- PurchaseLine.SetRange("Document Type", PurchHeader."Document Type");
- PurchaseLine.SetRange("Document No.", PurchHeader."No.");
- PurchaseLine.SetFilter(Type, '<>%1', PurchaseLine.Type::" ");
- PurchaseLine.SetFilter(Quantity, '<>%1', 0);
- if PurchaseLine.FindFirst() then
- GenJnlLine."GST Jurisdiction Type" := PurchaseLine."GST Jurisdiction Type";
- end;
-#endif
-
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Purch. Post Invoice Events", 'OnPostLedgerEntryOnBeforeGenJnlPostLine', '', false, false)]
local procedure CopyInfortoVendorEntryOnPostLedgerEntryOnBeforeGenJnlPostLine(var PurchHeader: Record "Purchase Header"; var GenJnlLine: Record "Gen. Journal Line")
var
diff --git a/Apps/IN/INGST/app/GSTSales/src/Codeunit/GSTCustLedgerEntry.Codeunit.al b/Apps/IN/INGST/app/GSTSales/src/Codeunit/GSTCustLedgerEntry.Codeunit.al
index b64b92d341..6ebebf5b42 100644
--- a/Apps/IN/INGST/app/GSTSales/src/Codeunit/GSTCustLedgerEntry.Codeunit.al
+++ b/Apps/IN/INGST/app/GSTSales/src/Codeunit/GSTCustLedgerEntry.Codeunit.al
@@ -13,41 +13,6 @@ using Microsoft.Sales.Receivables;
codeunit 18141 "GST Cust. Ledger Entry"
{
-#if not CLEAN23
- [EventSubscriber(ObjectType::Codeunit, Codeunit::"Sales-Post", 'OnBeforePostCustomerEntry', '', false, false)]
- local procedure CopyInfoToCustomerEntry(var GenJnlLine: Record "Gen. Journal Line"; var SalesHeader: Record "Sales Header")
- var
- SalesLine: Record "Sales Line";
- SalesLine2: Record "Sales Line";
- begin
- GenJnlLine."Location Code" := SalesHeader."Location Code";
- GenJnlLine."GST Customer Type" := SalesHeader."GST Customer Type";
- GenJnlLine."Location State Code" := SalesHeader."Location State Code";
- GenJnlLine."Location GST Reg. No." := SalesHeader."Location GST Reg. No.";
- GenJnlLine."GST Bill-to/BuyFrom State Code" := SalesHeader."GST Bill-to State Code";
- GenJnlLine."GST Ship-to State Code" := SalesHeader."GST Ship-to State Code";
- GenJnlLine."Ship-to GST Reg. No." := SalesHeader."Ship-to GST Reg. No.";
- GenJnlLine."Customer GST Reg. No." := SalesHeader."Customer GST Reg. No.";
-
- SalesLine.SetRange("Document Type", SalesHeader."Document Type");
- SalesLine.SetRange("Document No.", SalesHeader."No.");
- SalesLine.SetFilter("GST Place Of Supply", '<>%1', SalesLine."GST Place Of Supply"::" ");
- if SalesLine.FindFirst() then
- GenJnlLine."GST Place of Supply" := SalesLine."GST Place Of Supply";
-
- GenJnlLine."Ship-to Code" := SalesHeader."Ship-to Code";
- SalesLine2.SetRange("Document Type", SalesHeader."Document Type");
- SalesLine2.SetRange("Document No.", SalesHeader."No.");
- SalesLine2.SetFilter(Type, '<>%1', SalesLine2.Type::" ");
- SalesLine2.SetFilter(Quantity, '<>%1', 0);
- if SalesLine2.FindFirst() then
- GenJnlLine."GST Jurisdiction Type" := SalesLine2."GST Jurisdiction Type";
-
- GenJnlLine."GST Without Payment of Duty" := SalesHeader."GST Without Payment of Duty";
- GenJnlLine."Rate Change Applicable" := SalesHeader."Rate Change Applicable";
- end;
-#endif
-
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Sales Post Invoice Events", 'OnPostLedgerEntryOnBeforeGenJnlPostLine', '', false, false)]
local procedure CopyInfoToCustomerEntryOnPostLedgerEntryOnBeforeGenJnlPostLine(var GenJnlLine: Record "Gen. Journal Line"; var SalesHeader: Record "Sales Header")
var
diff --git a/Apps/IN/INGST/app/GSTSales/src/Codeunit/GSTSalesValidation.Codeunit.al b/Apps/IN/INGST/app/GSTSales/src/Codeunit/GSTSalesValidation.Codeunit.al
index c889cac89f..6ae50aafbb 100644
--- a/Apps/IN/INGST/app/GSTSales/src/Codeunit/GSTSalesValidation.Codeunit.al
+++ b/Apps/IN/INGST/app/GSTSales/src/Codeunit/GSTSalesValidation.Codeunit.al
@@ -20,7 +20,7 @@ using Microsoft.Sales.Customer;
using Microsoft.Sales.Document;
using Microsoft.Sales.History;
using Microsoft.Sales.Posting;
-#if not CLEAN23
+#if not CLEAN25
using Microsoft.Sales.Pricing;
#endif
using Microsoft.Sales.Receivables;
@@ -148,7 +148,7 @@ codeunit 18143 "GST Sales Validation"
SalesLine."Total UPIT Amount" := SalesLine."Unit Price Incl. of Tax" * SalesLine.Quantity - SalesLine."Line Discount Amount";
end;
-#if not CLEAN23
+#if not CLEAN25
//AssignPrice Inclusice of Tax
#pragma warning disable AS0072
[Obsolete('Replaced by the new implementation (V16) of price calculation.', '19.0')]
diff --git a/Apps/IN/INGST/app/GSTSales/src/Page/ECommerceMerchantId.page.al b/Apps/IN/INGST/app/GSTSales/src/Page/ECommerceMerchantId.page.al
deleted file mode 100644
index 7c8e16cd13..0000000000
--- a/Apps/IN/INGST/app/GSTSales/src/Page/ECommerceMerchantId.page.al
+++ /dev/null
@@ -1,81 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-#if not CLEAN23
-namespace Microsoft.Finance.GST.Sales;
-
-using Microsoft.Finance.GST.Base;
-using System.Integration.Excel;
-
-page 18141 "E-Commerce Merchant Id"
-{
- PageType = List;
- ApplicationArea = Basic, Suite;
- UsageCategory = Lists;
- SourceTable = "e-Commerce Merchant";
- Caption = 'e-Commerce Merchant';
- ObsoleteReason = 'New page 18146 introduced as "E-Comm. Merchant Id" with customer No. field length as 20';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-
- layout
- {
- area(Content)
- {
- repeater(General)
- {
- field("Customer No."; Rec."Customer No.")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the customer number for which merchant id has to be recorded.';
- }
- field("Merchant Id"; Rec."Merchant Id")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the merchant id provided to customers by their payment processor.';
- }
- field("Company GST Reg. No."; Rec."Company GST Reg. No.")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the company''s GST Reg. number issued by authorized body.';
- }
- }
- }
- }
-
- actions
- {
- area(Processing)
- {
- action(EditInExcel)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Edit in Excel';
- Image = Excel;
- Promoted = true;
- PromotedCategory = Process;
- PromotedIsBig = true;
- PromotedOnly = true;
- ToolTip = 'Send the data in the page to an Excel file for analysis or editing';
-
- trigger OnAction()
- var
- EditinExcel: Codeunit "Edit in Excel";
- begin
- EditinExcel.EditPageInExcel(
- 'e-Commerce Merchant Id',
- Page::"E-Commerce Merchant Id");
- end;
- }
- }
- }
- trigger OnOpenPage()
- begin
- Error(UnusedFieldLbl);
- end;
-
- var
- UnusedFieldLbl: Label 'This Page has been marked as obsolete and will be removed from version 23.0. Instead of this Page use ‘E-Comm. Merchant Id';
-}
-#endif
diff --git a/Apps/IN/INGST/app/GSTSales/src/PageExtension/GSTPostedSalesCrMemoExt.PageExt.al b/Apps/IN/INGST/app/GSTSales/src/PageExtension/GSTPostedSalesCrMemoExt.PageExt.al
index 3a758d6c8f..9aeb8d809f 100644
--- a/Apps/IN/INGST/app/GSTSales/src/PageExtension/GSTPostedSalesCrMemoExt.PageExt.al
+++ b/Apps/IN/INGST/app/GSTSales/src/PageExtension/GSTPostedSalesCrMemoExt.PageExt.al
@@ -90,21 +90,6 @@ pageextension 18143 "GST Posted Sales Cr. Memo Ext" extends "Posted Sales Credit
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies the customer number for which merchant id has to be recorded.';
}
-#if not CLEAN23
- field("e-Commerce Merchant Id"; Rec."e-Commerce Merchant Id")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the merchant ID provided to customers by their payment processor.';
- ObsoleteReason = 'New field introduced as E-Comm. Merchant Id';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-
- trigger OnValidate()
- begin
- Error(UnusedFieldLbl);
- end;
- }
-#endif
field("E-Comm. Merchant Id"; Rec."E-Comm. Merchant Id")
{
ApplicationArea = Basic, Suite;
@@ -266,7 +251,4 @@ pageextension 18143 "GST Posted Sales Cr. Memo Ext" extends "Posted Sales Credit
MakeFieldUneditable: Boolean;
eInvoiceNonGSTTransactionErr: Label 'E-Invoicing is not applicable for Non-GST Transactions.';
eInvoiceNotApplicableCustomerErr: Label 'E-Invoicing is not applicable for Unregistered, Export and Deemed Export Customers.';
-#if not CLEAN23
- UnusedFieldLbl: Label 'This field has been marked as obsolete and will be removed from version 23.0. Instead of this field use ‘E-Comm. Merchant Id';
-#endif
}
diff --git a/Apps/IN/INGST/app/GSTSales/src/PageExtension/GSTPostedSalesInvoiceExt.PageExt.al b/Apps/IN/INGST/app/GSTSales/src/PageExtension/GSTPostedSalesInvoiceExt.PageExt.al
index 52bc309212..fdab4e3e23 100644
--- a/Apps/IN/INGST/app/GSTSales/src/PageExtension/GSTPostedSalesInvoiceExt.PageExt.al
+++ b/Apps/IN/INGST/app/GSTSales/src/PageExtension/GSTPostedSalesInvoiceExt.PageExt.al
@@ -44,22 +44,6 @@ pageextension 18144 "GST Posted Sales Invoice Ext" extends "Posted Sales Invoice
Editable = false;
ToolTip = 'Specifies the customer number for which merchant id has to be recorded.';
}
-#if not CLEAN23
- field("E-Commerce Merchant Id"; Rec."E-Commerce Merchant Id")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- ToolTip = 'Specifies the merchant ID provided to customers by their payment processor.';
- ObsoleteReason = 'New field introduced as E-Comm. Merchant Id';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-
- trigger OnValidate()
- begin
- error(UnusedFieldLbl);
- end;
- }
-#endif
field("E-Comm. Merchant Id"; Rec."E-Comm. Merchant Id")
{
ApplicationArea = Basic, Suite;
@@ -361,9 +345,6 @@ pageextension 18144 "GST Posted Sales Invoice Ext" extends "Posted Sales Invoice
MakeFieldUneditable: Boolean;
eInvoiceNonGSTTransactionErr: Label 'E-Invoicing is not applicable for Non-GST Transactions.';
eInvoiceNotApplicableCustomerErr: Label 'E-Invoicing is not applicable for Unregistered, Export and Deemed Export Customers.';
-#if not CLEAN23
- UnusedFieldLbl: Label 'This field has been marked as obsolete and will be removed from version 23.0. Instead of this field use ‘E-Comm. Merchant Id’';
-#endif
QRCodeAlreadyExistErr: Label 'QR Code for the Invoice no. %1 is already been generated', Comment = '%1 = DocumentNo';
local procedure CheckQrCode(DocumentNo: Text[20]; QRCodeHasValue: Boolean)
diff --git a/Apps/IN/INGST/app/GSTSales/src/PageExtension/GSTPostedSalesShipmentExt.PageExt.al b/Apps/IN/INGST/app/GSTSales/src/PageExtension/GSTPostedSalesShipmentExt.PageExt.al
index 49643602de..b36064c9c7 100644
--- a/Apps/IN/INGST/app/GSTSales/src/PageExtension/GSTPostedSalesShipmentExt.PageExt.al
+++ b/Apps/IN/INGST/app/GSTSales/src/PageExtension/GSTPostedSalesShipmentExt.PageExt.al
@@ -73,22 +73,6 @@ pageextension 18145 "GST Posted Sales Shipment Ext" extends "Posted Sales Shipme
Editable = false;
ToolTip = 'Specifies the customer number for which merchant id has to be recorded.';
}
-#if not CLEAN23
- field("E-Commerce Merchant Id"; Rec."E-Commerce Merchant Id")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- ToolTip = 'Specifies the merchant ID provided to customers by their payment processor.';
- ObsoleteReason = 'New field introduced as E-Comm. Merchant Id';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-
- trigger OnValidate()
- begin
- error(UnusedFieldLbl);
- end;
- }
-#endif
field("E-Comm. Merchant Id"; Rec."E-Comm. Merchant Id")
{
ApplicationArea = Basic, Suite;
@@ -122,7 +106,4 @@ pageextension 18145 "GST Posted Sales Shipment Ext" extends "Posted Sales Shipme
}
var
-#if not CLEAN23
- UnusedFieldLbl: Label 'This field has been marked as obsolete and will be removed from version 23.0. Instead of this field use ‘E-Comm. Merchant Id’';
-#endif
}
diff --git a/Apps/IN/INGST/app/GSTSales/src/PageExtension/GSTSalesCreditMemoExt.PageExt.al b/Apps/IN/INGST/app/GSTSales/src/PageExtension/GSTSalesCreditMemoExt.PageExt.al
index 3d6219ae45..ea9315f106 100644
--- a/Apps/IN/INGST/app/GSTSales/src/PageExtension/GSTSalesCreditMemoExt.PageExt.al
+++ b/Apps/IN/INGST/app/GSTSales/src/PageExtension/GSTSalesCreditMemoExt.PageExt.al
@@ -129,21 +129,6 @@ pageextension 18146 "GST Sales Credit Memo Ext" extends "Sales Credit Memo"
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies the customer number for which merchant id has to be recorded.';
}
-#if not CLEAN23
- field("e-Commerce Merchant Id"; Rec."e-Commerce Merchant Id")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the merchant ID provided to customers by their payment processor.';
- ObsoleteReason = 'New field introduced as E-Comm. Merchant Id';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-
- trigger OnValidate()
- begin
- Error(UnusedFieldLbl);
- end;
- }
-#endif
field("E-Comm. Merchant Id"; Rec."E-Comm. Merchant Id")
{
ApplicationArea = Basic, Suite;
@@ -242,7 +227,4 @@ pageextension 18146 "GST Sales Credit Memo Ext" extends "Sales Credit Memo"
}
var
-#if not CLEAN23
- UnusedFieldLbl: Label 'This field has been marked as obsolete and will be removed from version 23.0. Instead of this field use ‘E-Comm. Merchant Id’';
-#endif
}
diff --git a/Apps/IN/INGST/app/GSTSales/src/PageExtension/GSTSalesInvoiceExt.PageExt.al b/Apps/IN/INGST/app/GSTSales/src/PageExtension/GSTSalesInvoiceExt.PageExt.al
index 64168adaf3..edfddc2606 100644
--- a/Apps/IN/INGST/app/GSTSales/src/PageExtension/GSTSalesInvoiceExt.PageExt.al
+++ b/Apps/IN/INGST/app/GSTSales/src/PageExtension/GSTSalesInvoiceExt.PageExt.al
@@ -108,21 +108,6 @@ pageextension 18148 "GST Sales Invoice Ext" extends "Sales Invoice"
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies the customer number for which merchant id has to be recorded.';
}
-#if not CLEAN23
- field("E-Commerce Merchant Id"; Rec."E-Commerce Merchant Id")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the merchant ID provided to customers by their payment processor.';
- ObsoleteReason = 'New field introduced as E-Comm. Merchant Id';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-
- trigger OnValidate()
- begin
- Error(UnusedFieldLbl);
- end;
- }
-#endif
field("E-Comm. Merchant Id"; Rec."E-Comm. Merchant Id")
{
ApplicationArea = Basic, Suite;
@@ -333,7 +318,4 @@ pageextension 18148 "GST Sales Invoice Ext" extends "Sales Invoice"
}
var
-#if not CLEAN23
- UnusedFieldLbl: Label 'This field has been marked as obsolete and will be removed from version 23.0. Instead of this field use ‘E-Comm. Merchant Id’';
-#endif
}
diff --git a/Apps/IN/INGST/app/GSTSales/src/PageExtension/GSTSalesOrderExt.PageExt.al b/Apps/IN/INGST/app/GSTSales/src/PageExtension/GSTSalesOrderExt.PageExt.al
index 0982ffa74c..9fb622be89 100644
--- a/Apps/IN/INGST/app/GSTSales/src/PageExtension/GSTSalesOrderExt.PageExt.al
+++ b/Apps/IN/INGST/app/GSTSales/src/PageExtension/GSTSalesOrderExt.PageExt.al
@@ -87,21 +87,6 @@ pageextension 18150 "GST Sales Order Ext" extends "Sales Order"
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies the customer number for which merchant id has to be recorded.';
}
-#if not CLEAN23
- field("E-Commerce Merchant Id"; Rec."E-Commerce Merchant Id")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the customer number for which merchant id has to be recorded.';
- ObsoleteReason = 'New field introduced as E-Comm. Merchant Id';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-
- trigger OnValidate()
- begin
- Error(UnusedFieldLbl);
- end;
- }
-#endif
field("E-Comm. Merchant Id"; Rec."E-Comm. Merchant Id")
{
ApplicationArea = Basic, Suite;
@@ -321,7 +306,4 @@ pageextension 18150 "GST Sales Order Ext" extends "Sales Order"
}
var
-#if not CLEAN23
- UnusedFieldLbl: Label 'This field has been marked as obsolete and will be removed from version 23.0. Instead of this field use ‘E-Comm. Merchant Id’';
-#endif
}
diff --git a/Apps/IN/INGST/app/GSTSales/src/PageExtension/GSTSalesPricesExt.PageExt.al b/Apps/IN/INGST/app/GSTSales/src/PageExtension/GSTSalesPricesExt.PageExt.al
index 2500df2ad4..0845af0559 100644
--- a/Apps/IN/INGST/app/GSTSales/src/PageExtension/GSTSalesPricesExt.PageExt.al
+++ b/Apps/IN/INGST/app/GSTSales/src/PageExtension/GSTSalesPricesExt.PageExt.al
@@ -2,7 +2,7 @@
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------
-#if not CLEAN23
+#if not CLEAN25
namespace Microsoft.Sales.Pricing;
pageextension 18152 "GST Sales Prices Ext" extends "Sales Prices"
diff --git a/Apps/IN/INGST/app/GSTSales/src/PageExtension/GSTSalesQuoteExt.PageExt.al b/Apps/IN/INGST/app/GSTSales/src/PageExtension/GSTSalesQuoteExt.PageExt.al
index 2f6be4ae52..0dae2eb0e9 100644
--- a/Apps/IN/INGST/app/GSTSales/src/PageExtension/GSTSalesQuoteExt.PageExt.al
+++ b/Apps/IN/INGST/app/GSTSales/src/PageExtension/GSTSalesQuoteExt.PageExt.al
@@ -76,21 +76,6 @@ pageextension 18153 "GST Sales Quote Ext" extends "Sales Quote"
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies the customer number for which merchant id has to be recorded.';
}
-#if not CLEAN23
- field("E-Commerce Merchant Id"; Rec."E-Commerce Merchant Id")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the merchant ID provided to customers by their payment processor.';
- ObsoleteReason = 'New field introduced as E-Comm. Merchant Id';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-
- trigger OnValidate()
- begin
- Error(UnusedFieldLbl);
- end;
- }
-#endif
field("E-Comm. Merchant Id"; Rec."E-Comm. Merchant Id")
{
ApplicationArea = Basic, Suite;
@@ -159,8 +144,5 @@ pageextension 18153 "GST Sales Quote Ext" extends "Sales Quote"
}
var
-#if not CLEAN23
- UnusedFieldLbl: Label 'This field has been marked as obsolete and will be removed from version 23.0. Instead of this field use ‘E-Comm. Merchant Id’';
-#endif
}
diff --git a/Apps/IN/INGST/app/GSTSales/src/PageExtension/GSTSalesReturnOrderExt.PageExt.al b/Apps/IN/INGST/app/GSTSales/src/PageExtension/GSTSalesReturnOrderExt.PageExt.al
index 2ec399488a..415f142582 100644
--- a/Apps/IN/INGST/app/GSTSales/src/PageExtension/GSTSalesReturnOrderExt.PageExt.al
+++ b/Apps/IN/INGST/app/GSTSales/src/PageExtension/GSTSalesReturnOrderExt.PageExt.al
@@ -111,21 +111,6 @@ pageextension 18155 "GST Sales Return Order Ext" extends "Sales Return Order"
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies the customer number for which merchant id has to be recorded.';
}
-#if not CLEAN23
- field("e-Commerce Merchant Id"; Rec."e-Commerce Merchant Id")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the merchant ID provided to customers by their payment processor.';
- ObsoleteReason = 'New field introduced as E-Comm. Merchant Id';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-
- trigger OnValidate()
- begin
- Error(UnusedFieldLbl);
- end;
- }
-#endif
field("E-Comm. Merchant Id"; Rec."E-Comm. Merchant Id")
{
ApplicationArea = Basic, Suite;
@@ -225,7 +210,4 @@ pageextension 18155 "GST Sales Return Order Ext" extends "Sales Return Order"
}
var
-#if not CLEAN23
- UnusedFieldLbl: Label 'This field has been marked as obsolete and will be removed from version 23.0. Instead of this field use ‘E-Comm. Merchant Id’';
-#endif
}
diff --git a/Apps/IN/INGST/app/GSTSales/src/tableextension/GSTSalesCrMemoHeaderExt.TableExt.al b/Apps/IN/INGST/app/GSTSales/src/tableextension/GSTSalesCrMemoHeaderExt.TableExt.al
index 39f6e8cde5..22d847b553 100644
--- a/Apps/IN/INGST/app/GSTSales/src/tableextension/GSTSalesCrMemoHeaderExt.TableExt.al
+++ b/Apps/IN/INGST/app/GSTSales/src/tableextension/GSTSalesCrMemoHeaderExt.TableExt.al
@@ -64,13 +64,8 @@ tableextension 18144 "GST Sales Cr.Memo Header Ext" extends "Sales Cr.Memo Heade
"Customer No." = field("e-Commerce Customer"));
DataClassification = CustomerContent;
ObsoleteReason = 'New field introduced as E-Comm. Merchant Id';
-#if CLEAN23
ObsoleteState = Removed;
ObsoleteTag = '26.0';
-#else
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-#endif
}
field(18150; "GST Bill-to State Code"; Code[10])
{
diff --git a/Apps/IN/INGST/app/GSTSales/src/tableextension/GSTSalesHeaderArchiveExt.TableExt.al b/Apps/IN/INGST/app/GSTSales/src/tableextension/GSTSalesHeaderArchiveExt.TableExt.al
index dae926982f..628f74420e 100644
--- a/Apps/IN/INGST/app/GSTSales/src/tableextension/GSTSalesHeaderArchiveExt.TableExt.al
+++ b/Apps/IN/INGST/app/GSTSales/src/tableextension/GSTSalesHeaderArchiveExt.TableExt.al
@@ -70,13 +70,8 @@ tableextension 18146 "GST Sales Header Archive Ext" extends "Sales Header Archiv
DataClassification = CustomerContent;
Editable = false;
ObsoleteReason = 'New field introduced as E-Comm. Merchant Id';
-#if CLEAN23
ObsoleteState = Removed;
ObsoleteTag = '26.0';
-#else
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-#endif
}
field(18150; "GST Bill-to State Code"; Code[10])
{
diff --git a/Apps/IN/INGST/app/GSTSales/src/tableextension/GSTSalesHeaderExt.TableExt.al b/Apps/IN/INGST/app/GSTSales/src/tableextension/GSTSalesHeaderExt.TableExt.al
index 047ab489b1..3610e2ffcb 100644
--- a/Apps/IN/INGST/app/GSTSales/src/tableextension/GSTSalesHeaderExt.TableExt.al
+++ b/Apps/IN/INGST/app/GSTSales/src/tableextension/GSTSalesHeaderExt.TableExt.al
@@ -64,13 +64,8 @@ tableextension 18147 "GST Sales Header Ext" extends "Sales Header"
"Customer No." = field("e-Commerce Customer"));
DataClassification = CustomerContent;
ObsoleteReason = 'New field introduced as E-Comm. Merchant Id';
-#if CLEAN23
ObsoleteState = Removed;
ObsoleteTag = '26.0';
-#else
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-#endif
}
field(18150; "GST Bill-to State Code"; Code[10])
{
diff --git a/Apps/IN/INGST/app/GSTSales/src/tableextension/GSTSalesInvoiceHeaderExt.TableExt.al b/Apps/IN/INGST/app/GSTSales/src/tableextension/GSTSalesInvoiceHeaderExt.TableExt.al
index ca238472ff..c198834289 100644
--- a/Apps/IN/INGST/app/GSTSales/src/tableextension/GSTSalesInvoiceHeaderExt.TableExt.al
+++ b/Apps/IN/INGST/app/GSTSales/src/tableextension/GSTSalesInvoiceHeaderExt.TableExt.al
@@ -64,13 +64,8 @@ tableextension 18148 "GST Sales Invoice Header Ext" extends "Sales Invoice Heade
"Customer No." = field("e-Commerce Customer"));
DataClassification = CustomerContent;
ObsoleteReason = 'New field introduced as E-Comm. Merchant Id';
-#if CLEAN23
ObsoleteState = Removed;
ObsoleteTag = '26.0';
-#else
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-#endif
}
field(18150; "GST Bill-to State Code"; Code[10])
{
diff --git a/Apps/IN/INGST/app/GSTSales/src/tableextension/GSTSalesShipmentHeaderExt.TableExt.al b/Apps/IN/INGST/app/GSTSales/src/tableextension/GSTSalesShipmentHeaderExt.TableExt.al
index 93b93b2c42..5fcb7a37e2 100644
--- a/Apps/IN/INGST/app/GSTSales/src/tableextension/GSTSalesShipmentHeaderExt.TableExt.al
+++ b/Apps/IN/INGST/app/GSTSales/src/tableextension/GSTSalesShipmentHeaderExt.TableExt.al
@@ -63,13 +63,8 @@ tableextension 18154 "GST Sales Shipment Header Ext" extends "Sales Shipment Hea
"Customer No." = field("e-Commerce Customer"));
DataClassification = CustomerContent;
ObsoleteReason = 'New field introduced as E-Comm. Merchant Id';
-#if CLEAN23
ObsoleteState = Removed;
ObsoleteTag = '26.0';
-#else
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-#endif
}
field(18150; "GST Bill-to State Code"; Code[10])
{
diff --git a/Apps/IN/INGST/app/GSTService/src/Codeunit/GSTServiceValidations.Codeunit.al b/Apps/IN/INGST/app/GSTService/src/Codeunit/GSTServiceValidations.Codeunit.al
index 56421867e1..09236fcf07 100644
--- a/Apps/IN/INGST/app/GSTService/src/Codeunit/GSTServiceValidations.Codeunit.al
+++ b/Apps/IN/INGST/app/GSTService/src/Codeunit/GSTServiceValidations.Codeunit.al
@@ -126,31 +126,6 @@ codeunit 18440 "GST Service Validations"
Rec."GST Bill-to State Code" := Customer."State Code";
end;
-#if not CLEAN23
- [EventSubscriber(ObjectType::Codeunit, Codeunit::"Serv-Posting Journals Mgt.", 'OnBeforePostCustomerEntry', '', false, false)]
- local procedure FillCustomerEntry(var GenJournalLine: Record "Gen. Journal Line"; ServiceHeader: Record "Service Header")
- var
- ServiceLine: Record "Service Line";
- begin
- GenJournalLine."GST Customer Type" := ServiceHeader."GST Customer Type";
- GenJournalLine."Location State Code" := ServiceHeader."Location State Code";
- GenJournalLine."Location GST Reg. No." := ServiceHeader."Location GST Reg. No.";
- GenJournalLine."GST Bill-to/BuyFrom State Code" := ServiceHeader."GST Bill-to State Code";
- GenJournalLine."Customer GST Reg. No." := ServiceHeader."Customer GST Reg. No.";
- GenJournalLine."GST Place of Supply" := GenJournalLine."GST Place of Supply"::"Bill-to Address";
- GenJournalLine."Ship-to Code" := ServiceHeader."Ship-to Code";
- GenJournalLine."GST Ship-to State Code" := ServiceHeader."GST Ship-to State Code";
- GenJournalLine."Ship-to GST Reg. No." := ServiceHeader."Ship-to GST Reg. No.";
- GenJournalLine."Location Code" := ServiceHeader."Location Code";
-
- ServiceLine.SetRange("Document No.", ServiceHeader."No.");
- ServiceLine.SetRange("Document Type", ServiceHeader."Document Type");
- ServiceLine.SetFilter("Qty. to Invoice", '<>%1', 0);
- if ServiceLine.FindFirst() then
- GenJournalLine."GST Jurisdiction Type" := ServiceLine."GST Jurisdiction Type";
- end;
-#endif
-
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Service Post Invoice Events", 'OnPostLedgerEntryOnBeforeGenJnlPostLine', '', false, false)]
local procedure OnPostLedgerEntryOnBeforeGenJnlPostLine(var GenJournalLine: Record "Gen. Journal Line"; ServiceHeader: Record "Service Header")
var
diff --git a/Apps/IN/INGST/app/GSTSubcontracting/src/Codeunit/SubcontractingPost.Codeunit.al b/Apps/IN/INGST/app/GSTSubcontracting/src/Codeunit/SubcontractingPost.Codeunit.al
index aa6a999f23..1ae7a6c71c 100644
--- a/Apps/IN/INGST/app/GSTSubcontracting/src/Codeunit/SubcontractingPost.Codeunit.al
+++ b/Apps/IN/INGST/app/GSTSubcontracting/src/Codeunit/SubcontractingPost.Codeunit.al
@@ -118,10 +118,6 @@ codeunit 18466 "Subcontracting Post"
QuantitySent: Decimal;
IsHandled: Boolean;
begin
-#if not CLEAN23
- OnBeforeSubcontractComponentSendPost(ItemJnlLine, DeliveryChallanHeader, SubOrderCompList);
-#endif
-
ItemJnlLine.Init();
ItemJnlLine."Posting Date" := DeliveryChallanHeader."Challan Date";
ItemJnlLine."Document Date" := DeliveryChallanHeader."Challan Date";
@@ -2415,17 +2411,6 @@ codeunit 18466 "Subcontracting Post"
end
end;
-#if not CLEAN23
- [Obsolete('Replaced by new integration event OnBeforeSubcontCompSendPost', '23.0')]
- [IntegrationEvent(false, false)]
- local procedure OnBeforeSubcontractComponentSendPost(
- var ItemJrnlLine: Record "Item Journal Line";
- DeliveryChallanHeader: Record "Delivery Challan Header";
- SubOrderCompList: Record "Sub Order Component List")
- begin
- end;
-#endif
-
[IntegrationEvent(false, false)]
local procedure OnAfterSubcontractComponentSendPost(
ItemJrnlLine: Record "Item Journal Line";
diff --git a/Apps/IN/INGST/app/GSTSubcontracting/src/Page/SubcontractingOrderSubform.Page.al b/Apps/IN/INGST/app/GSTSubcontracting/src/Page/SubcontractingOrderSubform.Page.al
index c4a8a78329..b636a20cfc 100644
--- a/Apps/IN/INGST/app/GSTSubcontracting/src/Page/SubcontractingOrderSubform.Page.al
+++ b/Apps/IN/INGST/app/GSTSubcontracting/src/Page/SubcontractingOrderSubform.Page.al
@@ -10,7 +10,7 @@ using Microsoft.Foundation.ExtendedText;
using Microsoft.Foundation.Navigate;
using Microsoft.Inventory.Item.Catalog;
using Microsoft.Purchases.Document;
-#if not CLEAN23
+#if not CLEAN25
using Microsoft.Purchases.Pricing;
#endif
using Microsoft.Sales.Document;
@@ -870,7 +870,7 @@ page 18493 "Subcontracting Order Subform"
end;
var
-#if not CLEAN23
+#if not CLEAN25
PurchHeader: Record "Purchase Header";
PurchPriceCalcMgt: Codeunit "Purch. Price Calc. Mgt.";
#endif
@@ -984,7 +984,7 @@ page 18493 "Subcontracting Order Subform"
exit(true);
end;
-#if not CLEAN23
+#if not CLEAN25
#pragma warning disable AS0072
[Obsolete('Replaced by the new implementation (V16) of price calculation.', '19.0')]
#pragma warning restore AS0072
diff --git a/Apps/IN/INGST/app/Permissions/d365commonaccessindiagst.permissionset.al b/Apps/IN/INGST/app/Permissions/d365commonaccessindiagst.permissionset.al
index e76b9f5920..cbdb2602ca 100644
--- a/Apps/IN/INGST/app/Permissions/d365commonaccessindiagst.permissionset.al
+++ b/Apps/IN/INGST/app/Permissions/d365commonaccessindiagst.permissionset.al
@@ -48,9 +48,6 @@ permissionset 18359 "D365 Common Access - India GST"
tabledata "Detailed GST Ledger Entry" = RIMD,
tabledata "Detailed GST Ledger Entry Info" = RIMD,
tabledata "Dist. Component Amount" = RIMD,
-#if not CLEAN23
- tabledata "E-Commerce Merchant" = RIMD,
-#endif
tabledata "E-Comm. Merchant" = RIMD,
tabledata "GST Application Buffer" = RIMD,
tabledata "GST Claim Setoff" = RIMD,
diff --git a/Apps/IN/INGST/app/Permissions/d365readaccessindiagst.permissionset.al b/Apps/IN/INGST/app/Permissions/d365readaccessindiagst.permissionset.al
index 3a6e7628f5..44047aa303 100644
--- a/Apps/IN/INGST/app/Permissions/d365readaccessindiagst.permissionset.al
+++ b/Apps/IN/INGST/app/Permissions/d365readaccessindiagst.permissionset.al
@@ -35,9 +35,6 @@ permissionset 18360 "D365 Read Access - India GST"
tabledata "Dist. Component Amount" = R,
tabledata "Delivery Challan Header" = R,
tabledata "Delivery Challan Line" = R,
-#if not CLEAN23
- tabledata "E-Commerce Merchant" = R,
-#endif
tabledata "E-Comm. Merchant" = R,
tabledata "GST Application Buffer" = R,
tabledata "GST Claim Setoff" = R,
diff --git a/Apps/IN/INTCS/app/TCSOnSales/src/codeunit/TCSSalesSubscribers.Codeunit.al b/Apps/IN/INTCS/app/TCSOnSales/src/codeunit/TCSSalesSubscribers.Codeunit.al
index ce230036a5..88816d994b 100644
--- a/Apps/IN/INTCS/app/TCSOnSales/src/codeunit/TCSSalesSubscribers.Codeunit.al
+++ b/Apps/IN/INTCS/app/TCSOnSales/src/codeunit/TCSSalesSubscribers.Codeunit.al
@@ -55,34 +55,6 @@ codeunit 18838 "TCS Sales Subscribers"
SalesHeader."Assessee Code" := '';
end;
-#if not CLEAN23
- [EventSubscriber(ObjectType::Codeunit, Codeunit::"Sales-Post", 'OnBeforePostCustomerEntry', '', false, false)]
- local procedure PostCustEntry(
- var GenJnlLine: Record "Gen. Journal Line";
- var SalesHeader: Record "Sales Header";
- var TotalSalesLine: Record "Sales Line";
- var TotalSalesLineLCY: Record "Sales Line")
- var
- SalesLine: Record "Sales Line";
- CompanyInformation: Record "Company Information";
- Location: Record Location;
- begin
- SalesLine.SetRange("Document Type", SalesHeader."Document Type");
- SalesLine.SetRange("Document No.", SalesHeader."No.");
- if SalesLine.FindFirst() then
- GenJnlLine."TCS Nature of Collection" := SalesLine."TCS Nature of Collection";
-
- if GenJnlLine."Location Code" <> '' then begin
- Location.Get(GenJnlLine."Location Code");
- if Location."T.C.A.N. No." <> '' then
- GenJnlLine."T.C.A.N. No." := Location."T.C.A.N. No."
- end else begin
- CompanyInformation.Get();
- GenJnlLine."T.C.A.N. No." := CompanyInformation."T.C.A.N. No.";
- end;
- end;
-#endif
-
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Sales Post Invoice Events", 'OnPostLedgerEntryOnBeforeGenJnlPostLine', '', false, false)]
local procedure OnPostLedgerEntryOnBeforeGenJnlPostLine(
var GenJnlLine: Record "Gen. Journal Line";
diff --git a/Apps/IN/INTDS/app/TDSForCustomer/src/codeunit/TDSForCustomerSubscribers.codeunit.al b/Apps/IN/INTDS/app/TDSForCustomer/src/codeunit/TDSForCustomerSubscribers.codeunit.al
index 450391b9f9..6168e22868 100644
--- a/Apps/IN/INTDS/app/TDSForCustomer/src/codeunit/TDSForCustomerSubscribers.codeunit.al
+++ b/Apps/IN/INTDS/app/TDSForCustomer/src/codeunit/TDSForCustomerSubscribers.codeunit.al
@@ -40,18 +40,6 @@ codeunit 18661 "TDS For Customer Subscribers"
end;
end;
-#if not CLEAN23
- [EventSubscriber(ObjectType::Codeunit, Codeunit::"Sales-Post", 'OnBeforePostCustomerEntry', '', false, false)]
- local procedure PostCustEntry(
- var GenJnlLine: Record "Gen. Journal Line";
- var SalesHeader: Record "Sales Header";
- var TotalSalesLine: Record "Sales Line";
- var TotalSalesLineLCY: Record "Sales Line")
- begin
- GenJnlLine."TDS Certificate Receivable" := SalesHeader."TDS Certificate Receivable";
- end;
-#endif
-
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Sales Post Invoice Events", 'OnPostLedgerEntryOnBeforeGenJnlPostLine', '', false, false)]
local procedure OnPostLedgerEntryOnBeforeGenJnlPostLine(
var GenJnlLine: Record "Gen. Journal Line";
diff --git a/Apps/IN/INTDS/app/TDSOnPayments/src/codeunit/TDSJournalsSubscribers.Codeunit.al b/Apps/IN/INTDS/app/TDSOnPayments/src/codeunit/TDSJournalsSubscribers.Codeunit.al
index 360a192e4a..1c7e9c0160 100644
--- a/Apps/IN/INTDS/app/TDSOnPayments/src/codeunit/TDSJournalsSubscribers.Codeunit.al
+++ b/Apps/IN/INTDS/app/TDSOnPayments/src/codeunit/TDSJournalsSubscribers.Codeunit.al
@@ -110,14 +110,6 @@ codeunit 18767 "TDS Journals Subscribers"
Error(SectionErr, VendorLedgerEntry."Document No.", GenJnlLine."TDS Section Code");
end;
-#if not CLEAN23
- [EventSubscriber(ObjectType::Codeunit, Codeunit::"Purch.-Post", 'OnBeforePostBalancingEntry', '', false, false)]
- local procedure OnBeforePostBalancingEntry(var GenJnlLine: Record "Gen. Journal Line"; var PurchHeader: Record "Purchase Header")
- begin
- PostBalancingEntryForGenJnlLine(GenJnlLine, PurchHeader);
- end;
-#endif
-
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Purch. Post Invoice Events", 'OnPostBalancingEntryOnBeforeGenJnlPostLine', '', false, false)]
local procedure OnPostBalancingEntryOnBeforeGenJnlPostLine(var GenJnlLine: Record "Gen. Journal Line"; var PurchHeader: Record "Purchase Header")
begin
diff --git a/Apps/IN/INTDS/app/TDSOnPurchase/src/codeunit/TDSSubscribers.Codeunit.al b/Apps/IN/INTDS/app/TDSOnPurchase/src/codeunit/TDSSubscribers.Codeunit.al
index c9bb8c99f4..f96b64c775 100644
--- a/Apps/IN/INTDS/app/TDSOnPurchase/src/codeunit/TDSSubscribers.Codeunit.al
+++ b/Apps/IN/INTDS/app/TDSOnPurchase/src/codeunit/TDSSubscribers.Codeunit.al
@@ -43,32 +43,6 @@ codeunit 18716 "TDS Subscribers"
end;
end;
-#if not CLEAN23
- [EventSubscriber(ObjectType::Codeunit, Codeunit::"Purch.-Post", 'OnBeforePostVendorEntry', '', false, false)]
- local procedure InsertTDSSectionCodeGenJnlLine(
- var GenJnlLine: Record "Gen. Journal Line";
- var PurchHeader: Record "Purchase Header")
- var
- PurchaseLine: Record "Purchase Line";
- Location: Record Location;
- CompanyInformation: Record "Company Information";
- begin
- PurchaseLine.SetRange("Document Type", PurchHeader."Document Type");
- PurchaseLine.SetRange("Document No.", PurchHeader."No.");
- if PurchaseLine.FindFirst() then
- GenJnlLine."TDS Section Code" := PurchaseLine."TDS Section Code";
-
- if GenJnlLine."Location Code" <> '' then begin
- Location.Get(GenJnlLine."Location Code");
- if Location."T.A.N. No." <> '' then
- GenJnlLine."T.A.N. No." := Location."T.A.N. No."
- end else begin
- CompanyInformation.Get();
- GenJnlLine."T.A.N. No." := CompanyInformation."T.A.N. No.";
- end
- end;
-#endif
-
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Purch. Post Invoice Events", 'OnPostLedgerEntryOnBeforeGenJnlPostLine', '', false, false)]
local procedure InsertTDSSectionCodeGenJnlLineOnPostLedgerEntryOnBeforeGenJnlPostLine(
var GenJnlLine: Record "Gen. Journal Line";
diff --git a/Apps/IN/INVoucherInterface/app/src/pageextension/PaymentJournalVI.PageExt.al b/Apps/IN/INVoucherInterface/app/src/pageextension/PaymentJournalVI.PageExt.al
index ecf1d76e43..32f42a3e7e 100644
--- a/Apps/IN/INVoucherInterface/app/src/pageextension/PaymentJournalVI.PageExt.al
+++ b/Apps/IN/INVoucherInterface/app/src/pageextension/PaymentJournalVI.PageExt.al
@@ -33,26 +33,6 @@ pageextension 18971 "Payment Journal VI" extends "Payment Journal"
}
addafter("Void Check")
{
-#if not CLEAN23
-#pragma warning disable AL0678
- action(Void_Check)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Void Check';
- ToolTip = 'Void the check if, for example, the check is not cashed by the bank.';
- Image = VoidCheck;
- Visible = false;
- ObsoleteReason = 'Name conflict. Use the action "IN_Void_Check" instead.';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-
- trigger OnAction()
- begin
- VoidCheckVoucher();
- end;
- }
-#pragma warning restore AL0678
-#endif
action("IN_Void_Check")
{
ApplicationArea = Basic, Suite;
diff --git a/Apps/NA/MX_DIOT/app/src/Processing/DIOTSubscribers.Codeunit.al b/Apps/NA/MX_DIOT/app/src/Processing/DIOTSubscribers.Codeunit.al
index 227fd0d8bb..9f28727f58 100644
--- a/Apps/NA/MX_DIOT/app/src/Processing/DIOTSubscribers.Codeunit.al
+++ b/Apps/NA/MX_DIOT/app/src/Processing/DIOTSubscribers.Codeunit.al
@@ -70,15 +70,6 @@ codeunit 27022 "DIOT Subscribers"
VATEntry."DIOT Type of Operation" := GenJournalLine."DIOT Type of Operation";
end;
-#if not CLEAN23
- [Obsolete('Rpelaced by event OnPostLinesOnBeforeGenJnlLinePost in codeunit Purch. Post Invoice Events.', '23.0')]
- [EventSubscriber(ObjectType::Codeunit, Codeunit::"Purch.-Post", 'OnBeforePostInvPostBuffer', '', false, false)]
- local procedure TransferDIOTTypeOfOperationOnBeforePostInvPostBuffer(var GenJnlLine: Record "Gen. Journal Line"; var PurchHeader: Record "Purchase Header");
- begin
- GenJnlLine."DIOT Type of Operation" := PurchHeader."DIOT Type of Operation";
- end;
-#endif
-
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Purch. Post Invoice Events", 'OnPostLinesOnBeforeGenJnlLinePost', '', false, false)]
local procedure TransferDIOTTypeOfOperationOnPostLinesOnBeforeGenJnlLinePost(var GenJnlLine: Record "Gen. Journal Line"; PurchHeader: Record "Purchase Header");
begin
diff --git a/Apps/NO/ElectronicVATSubmission/app/src/Connection/ElecVATConnectionMgt.Codeunit.al b/Apps/NO/ElectronicVATSubmission/app/src/Connection/ElecVATConnectionMgt.Codeunit.al
index 497f86b0bc..de00d722f4 100644
--- a/Apps/NO/ElectronicVATSubmission/app/src/Connection/ElecVATConnectionMgt.Codeunit.al
+++ b/Apps/NO/ElectronicVATSubmission/app/src/Connection/ElecVATConnectionMgt.Codeunit.al
@@ -267,11 +267,7 @@ codeunit 10687 "Elec. VAT Connection Mgt."
ElecVATLoggingMgt.LogValidationRun();
TempVATStatementReportLine := VATStatementReportLine;
TempVATStatementReportLine.Insert();
-#if CLEAN23
Request := ElecVATCreateContent.CreateVATReportLinesNodeContent(TempVATStatementReportLine);
-#else
- Request := ElecVATCreateContent.CreateVATReportLinesContent(TempVATStatementReportLine);
-#endif
ElecVATLoggingMgt.AttachXmlSubmissionTextToVATRepHeader(Request, VATReportHeader, 'mvakode-' + VATStatementReportLine."Box No.");
Commit();
InvokePostRequestWithAccessTokenCheck(Response, ElecVATSetup."Validate VAT Return Url", GetXmlContentType(), Request, ValidateVATReturnTxt, ValidateReturnErr);
diff --git a/Apps/NO/ElectronicVATSubmission/app/src/Setup/ElecVATCodes.PageExt.al b/Apps/NO/ElectronicVATSubmission/app/src/Setup/ElecVATCodes.PageExt.al
deleted file mode 100644
index 4fff0a34d1..0000000000
--- a/Apps/NO/ElectronicVATSubmission/app/src/Setup/ElecVATCodes.PageExt.al
+++ /dev/null
@@ -1,29 +0,0 @@
-#if not CLEAN23
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-namespace Microsoft.Finance.VAT.Reporting;
-
-using Microsoft.Finance.VAT.Setup;
-
-pageextension 10699 "Elec. VAT Codes" extends "VAT Codes"
-{
- layout
- {
- addlast(Control1080000)
- {
- field("VAT Rate For Reporting"; "VAT Rate For Reporting")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the VAT rate to report.';
- }
- field("Report VAT Rate"; "Report VAT Rate")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies whether the VAT rate value must be reported.';
- }
- }
- }
-}
-#endif
diff --git a/Apps/NO/ElectronicVATSubmission/app/src/Setup/ElecVATSubmissionWizard.Page.al b/Apps/NO/ElectronicVATSubmission/app/src/Setup/ElecVATSubmissionWizard.Page.al
index 7feccf5c4e..538cb48efd 100644
--- a/Apps/NO/ElectronicVATSubmission/app/src/Setup/ElecVATSubmissionWizard.Page.al
+++ b/Apps/NO/ElectronicVATSubmission/app/src/Setup/ElecVATSubmissionWizard.Page.al
@@ -5,9 +5,6 @@
namespace Microsoft.Finance.VAT.Reporting;
using Microsoft.Finance.AuditFileExport;
-#if not CLEAN23
-using Microsoft.Finance.VAT.Setup;
-#endif
using System.Environment;
using System.Environment.Configuration;
using System.Security.Authentication;
@@ -131,11 +128,7 @@ page 10696 "Elec. VAT Submission Wizard"
trigger OnDrillDown()
begin
-#if CLEAN23
Page.Run(Page::"VAT Reporting Codes", TempMissingVATReportingCode);
-#else
- Page.Run(Page::"VAT Codes", TempMissingVATCode);
-#endif
end;
}
field(AddMissingCodesControl; AddCodesLbl)
@@ -147,11 +140,7 @@ page 10696 "Elec. VAT Submission Wizard"
trigger OnDrillDown()
begin
-#if CLEAN23
ElecVATDataMgt.AddVATReportingCodes(TempMissingVATReportingCode);
-#else
- ElecVATDataMgt.AddVATCodes(TempMissingVATCode);
-#endif
Message(MissingCodesAddedLbl);
end;
}
@@ -169,11 +158,7 @@ page 10696 "Elec. VAT Submission Wizard"
trigger OnDrillDown()
begin
-#if CLEAN23
Page.Run(Page::"VAT Reporting Codes");
-#else
- Page.Run(Page::"VAT Codes");
-#endif
end;
}
field(UpdateVATCodesControl; UpdateLbl)
@@ -187,11 +172,7 @@ page 10696 "Elec. VAT Submission Wizard"
var
ElecVATDataMgt: Codeunit "Elec. VAT Data Mgt.";
begin
-#if CLEAN23
ElecVATDataMgt.SetVATRatesForReportingOnVATReportingCodes();
-#else
- ElecVATDataMgt.SetVATRatesForReportingForVATCodes();
-#endif
SetVATCodesUpdatedText();
end;
}
@@ -317,11 +298,7 @@ page 10696 "Elec. VAT Submission Wizard"
var
ElecVATSetup: Record "Elec. VAT Setup";
-#if CLEAN23
TempMissingVATReportingCode: Record "VAT Reporting Code" temporary;
-#else
- TempMissingVATCode: Record "VAT Code" temporary;
-#endif
OAuth20Setup: Record "OAuth 2.0 Setup";
MediaRepositoryDone: Record "Media Repository";
MediaRepositoryStandard: Record "Media Repository";
@@ -371,11 +348,7 @@ page 10696 "Elec. VAT Submission Wizard"
ElecVATOAuthMgt.GetOAuthSetup(OAuth20Setup);
UpdateAuthorizationStatus();
ElecVATDataMgt.InsertMissingVATSpecificationsAndNotes();
-#if CLEAN23
MissingVATCodesExist := ElecVATDataMgt.GetMissingVATReportingCodes(TempMissingVATReportingCode);
-#else
- MissingVATCodesExist := ElecVATDataMgt.GetMissingVATCodes(TempMissingVATCode);
-#endif
SetVATCodesUpdatedText();
EnableControls();
end;
@@ -541,7 +514,6 @@ page 10696 "Elec. VAT Submission Wizard"
CurrPage.Update(false);
end;
-#if CLEAN23
local procedure SetVATCodesUpdatedText()
var
VATReportingCode: Record "VAT Reporting Code";
@@ -551,15 +523,4 @@ page 10696 "Elec. VAT Submission Wizard"
VATReportingCode.SetRange("Report VAT Rate", true);
VATCodesUpdatedText := StrSubstNo(PartInfoMsg, VATReportingCode.Count(), TotalCount);
end;
-#else
- local procedure SetVATCodesUpdatedText()
- var
- VATCode: Record "VAT Code";
- TotalCount: Integer;
- begin
- TotalCount := VATCode.Count();
- VATCode.SetRange("Report VAT Rate", true);
- VATCodesUpdatedText := StrSubstNo(PartInfoMsg, VATCode.Count(), TotalCount);
- end;
-#endif
}
diff --git a/Apps/NO/ElectronicVATSubmission/app/src/VAT Return Management/ElecVATCreateContent.Codeunit.al b/Apps/NO/ElectronicVATSubmission/app/src/VAT Return Management/ElecVATCreateContent.Codeunit.al
index 45353f92d0..c07a93de2b 100644
--- a/Apps/NO/ElectronicVATSubmission/app/src/VAT Return Management/ElecVATCreateContent.Codeunit.al
+++ b/Apps/NO/ElectronicVATSubmission/app/src/VAT Return Management/ElecVATCreateContent.Codeunit.al
@@ -39,11 +39,7 @@ codeunit 10684 "Elec. VAT Create Content"
until VATStatementReportLine.Next() = 0;
CLEAR(TempBlob);
TempBlob.CreateOutStream(MessageOutStream, TEXTENCODING::UTF8);
-#if CLEAN23
MessageOutStream.WriteText(CreateVATReportLinesNodeContent(TempVATStatementReportLine));
-#else
- MessageOutStream.WriteText(CreateVATReportLinesContent(TempVATStatementReportLine));
-#endif
if VATReportArchive.Get("VAT Report Config. Code", "No.") then
VATReportArchive.Delete(true);
VATReportArchive.ArchiveSubmissionMessage("VAT Report Config. Code", "No.", TempBlob);
@@ -52,119 +48,6 @@ codeunit 10684 "Elec. VAT Create Content"
Commit();
end;
-#if not CLEAN23
- [Obsolete('Use the procedure CreateVATReportLinesNodeContent instead', '23.0')]
- procedure CreateVATReportLinesContent(var TempVATStatementReportLine: Record "VAT Statement Report Line" temporary): Text
- var
- VATReportHeader: Record "VAT Report Header";
- VATCode: Record "VAT Code";
- VATSpecification: Record "VAT Specification";
- VATNote: Record "VAT Note";
- ElecVATXMLHelper: Codeunit "Elec. VAT XML Helper";
- ElecVATDataMgt: Codeunit "Elec. VAT Data Mgt.";
- OriginalVATCode: Code[10];
- IsReverseCharge: Boolean;
- TotalAmount: Decimal;
- begin
- VATReportHeader.Get(TempVATStatementReportLine."VAT Report Config. Code", TempVATStatementReportLine."VAT Report No.");
- ElecVATXMLHelper.Initialize('mvaMeldingDto');
- ElecVATXMLHelper.AddNewXMLNode('innsending', '');
- ElecVATXMLHelper.AppendXMLNode('regnskapssystemsreferanse', TempVATStatementReportLine."VAT Report No.");
- ElecVATXMLHelper.AddNewXMLNode('regnskapssystem', '');
- ElecVATXMLHelper.AppendXMLNode('systemnavn', 'Microsoft Dynamics 365 Business Central');
- ElecVATXMLHelper.AppendXMLNode('systemversjon', '20.0');
- ElecVATXMLHelper.FinalizeXMLNode();
- ElecVATXMLHelper.FinalizeXMLNode();
-
- ElecVATXMLHelper.AddNewXMLNode('skattegrunnlagOgBeregnetSkatt', '');
- ElecVATXMLHelper.AddNewXMLNode('skattleggingsperiode', '');
- ElecVATXMLHelper.AddNewXMLNode('periode', '');
- ElecVATXMLHelper.AppendXMLNode(GetPeriodTypeInNorwegian(VATReportHeader), GetPeriodTextInNorwegian(VATReportHeader));
- ElecVATXMLHelper.FinalizeXMLNode();
- ElecVATXMLHelper.AppendXMLNode('aar', format(Date2DMY(VATReportHeader."End Date", 3)));
- ElecVATXMLHelper.FinalizeXMLNode();
- TempVATStatementReportLine.FindSet();
- repeat
- GetVATCodeFromVATStatementLine(VATCode, TempVATStatementReportLine);
- if ElecVATDataMgt.IsReverseChargeVATCode(GetVATCodeOriginalNumber(VATCode)) then
- TotalAmount += TempVATStatementReportLine."Non-Deductible Amount"
- else
- if ElecVATDataMgt.IsVATCodeWithDeductiblePart(GetVATCodeOriginalNumber(VATCode)) then
- TotalAmount += TempVATStatementReportLine.Amount
- else
- TotalAmount += TempVATStatementReportLine.Amount + TempVATStatementReportLine."Non-Deductible Amount";
- until TempVATStatementReportLine.Next() = 0;
- ElecVATXMLHelper.AppendXMLNode('fastsattMerverdiavgift', GetAmountTextRounded(TotalAmount));
- TempVATStatementReportLine.FindSet();
- repeat
- GetVATCodeFromVATStatementLine(VATCode, TempVATStatementReportLine);
- OriginalVATCode := GetVATCodeOriginalNumber(VATCode);
- IsReverseCharge := ElecVATDataMgt.IsReverseChargeVATCode(OriginalVATCode);
- ElecVATXMLHelper.AddNewXMLNode('mvaSpesifikasjonslinje', '');
- ElecVATXMLHelper.AppendXMLNode('mvaKode', OriginalVATCode);
- if VATCode."VAT Specification Code" <> '' then begin
- VATSpecification.Get(VATCode."VAT Specification Code");
- ElecVATXMLHelper.AppendXMLNode('spesifikasjon', VATSpecification."VAT Report Value");
- end;
- ElecVATXMLHelper.AppendXMLNode('mvaKodeRegnskapsystem', TempVATStatementReportLine.Description);
- if VATCode."Report VAT Rate" then begin
- ElecVATXMLHelper.AppendXMLNode('grunnlag', GetAmountTextRounded(GetReportingVATBaseFromVATStatementReportLine(TempVATStatementReportLine, VATCode)));
- ElecVATXMLHelper.AppendXMLNode('sats', Format(VATCode."VAT Rate For Reporting", 0, ''));
- end;
- ElecVATXMLHelper.AppendXMLNode('merverdiavgift', GetAmountTextRounded(GetReportingVATAmountFromVATStatementReportLine(TempVATStatementReportLine, VATCode)));
- if (VATCode."VAT Note Code" <> '') or (TempVATStatementReportLine.Note <> '') then begin
- ElecVATXMLHelper.AddNewXMLNode('merknad', '');
- if VATCode."VAT Note Code" = '' then
- ElecVATXMLHelper.AppendXMLNode('beskrivelse', TempVATStatementReportLine.Note)
- else begin
- VATNote.Get(VATCode."VAT Note Code");
- ElecVATXMLHelper.AppendXMLNode('utvalgtMerknad', VATNote."VAT Report Value");
- end;
- ElecVATXMLHelper.FinalizeXMLNode();
- end;
- ElecVATXMLHelper.FinalizeXMLNode();
- if IsReverseCharge then begin
- ElecVATXMLHelper.AddNewXMLNode('mvaSpesifikasjonslinje', '');
- ElecVATXMLHelper.AppendXMLNode('mvaKode', OriginalVATCode);
- if VATCode."VAT Specification Code" <> '' then begin
- VATSpecification.Get(VATCode."VAT Specification Code");
- ElecVATXMLHelper.AppendXMLNode('spesifikasjon', VATSpecification."VAT Report Value");
- end;
- ElecVATXMLHelper.AppendXMLNode('mvaKodeRegnskapsystem', TempVATStatementReportLine.Description);
- ElecVATXMLHelper.AppendXMLNode('merverdiavgift', GetAmountTextRounded(-TempVATStatementReportLine.Amount));
- if VATCode."VAT Note Code" <> '' then begin
- VATNote.Get(VATCode."VAT Note Code");
- ElecVATXMLHelper.AddNewXMLNode('merknad', '');
- ElecVATXMLHelper.AppendXMLNode('utvalgtMerknad', VATNote."VAT Report Value");
- ElecVATXMLHelper.FinalizeXMLNode();
- end;
- ElecVATXMLHelper.FinalizeXMLNode();
- end;
- until TempVATStatementReportLine.Next() = 0;
- ElecVATXMLHelper.FinalizeXMLNode();
- ElecVATXMLHelper.AddNewXMLNode('betalingsinformasjon', '');
- if VATReportHeader.KID <> '' then
- ElecVATXMLHelper.AppendXMLNode('kundeIdentifikasjonsnummer', VATReportHeader.KID);
- ElecVATXMLHelper.FinalizeXMLNode();
- ElecVATXMLHelper.AddNewXMLNode('skattepliktig', '');
- ElecVATXMLHelper.AppendXMLNode('organisasjonsnummer', ElecVATDataMgt.GetDigitVATRegNo());
- ElecVATXMLHelper.FinalizeXMLNode();
- ElecVATXMLHelper.AppendXMLNode('meldingskategori', 'alminnelig');
- exit(ElecVATXMLHelper.GetXMLRequest());
- end;
-
- local procedure GetVATCodeFromVATStatementLine(var VATCode: Record "VAT Code"; VATStatementReportLine: Record "VAT Statement Report Line")
- begin
- VATCode.Get(CopyStr(VATStatementReportLine."Box No.", 1, MaxStrLen(VATCode.Code)));
- end;
-
- local procedure GetVATCodeOriginalNumber(VATCode: Record "VAT Code"): Code[10]
- begin
- if VATCode."SAF-T VAT Code" = '' then
- exit(VATCode.Code);
- exit(VATCode."SAF-T VAT Code");
- end;
-#endif
procedure CreateVATReportLinesNodeContent(var TempVATStatementReportLine: Record "VAT Statement Report Line" temporary): Text
var
VATReportHeader: Record "VAT Report Header";
@@ -412,28 +295,6 @@ codeunit 10684 "Elec. VAT Create Content"
end
end;
-#if not CLEAN23
- [Obsolete('Use the procedure with the VAT Reporting Code parameter instead', '23.0')]
- local procedure GetReportingVATBaseFromVATStatementReportLine(VATStatementReportLine: Record "VAT Statement Report Line"; VATCode: Record "VAT Code"): Decimal
- var
- ElecVATDataMgt: Codeunit "Elec. VAT Data Mgt.";
- begin
- if ElecVATDataMgt.IsVATCodeWithDeductiblePart(GetVATCodeOriginalNumber(VATCode)) then
- exit(VATStatementReportLine.Base);
- exit(VATStatementReportLine.Base + VATStatementReportLine."Non-Deductible Base");
- end;
-
- [Obsolete('Use the procedure with the VAT Reporting Code parameter instead', '23.0')]
- local procedure GetReportingVATAmountFromVATStatementReportLine(VATStatementReportLine: Record "VAT Statement Report Line"; VATCode: Record "VAT Code"): Decimal
- var
- ElecVATDataMgt: Codeunit "Elec. VAT Data Mgt.";
- begin
- if ElecVATDataMgt.IsVATCodeWithDeductiblePart(GetVATCodeOriginalNumber(VATCode)) then
- exit(VATStatementReportLine.Amount);
- exit(VATStatementReportLine.Amount + VATStatementReportLine."Non-Deductible Amount");
- end;
-#endif
-
local procedure GetReportingVATBaseFromVATStatementReportLine(VATStatementReportLine: Record "VAT Statement Report Line"; VATReportingCode: Record "VAT Reporting Code"): Decimal
var
ElecVATDataMgt: Codeunit "Elec. VAT Data Mgt.";
diff --git a/Apps/NO/ElectronicVATSubmission/app/src/VAT Return Management/ElecVATDataMgt.Codeunit.al b/Apps/NO/ElectronicVATSubmission/app/src/VAT Return Management/ElecVATDataMgt.Codeunit.al
index 80df86c9a3..ea1a3f9104 100644
--- a/Apps/NO/ElectronicVATSubmission/app/src/VAT Return Management/ElecVATDataMgt.Codeunit.al
+++ b/Apps/NO/ElectronicVATSubmission/app/src/VAT Return Management/ElecVATDataMgt.Codeunit.al
@@ -54,74 +54,6 @@ codeunit 10683 "Elec. VAT Data Mgt."
until TempVATNote.Next() = 0;
end;
-#if not CLEAN23
- [Obsolete('Use the procedure GetMissingVATReportingCodes instead', '23.0')]
- procedure GetMissingVATCodes(var TempMissingVATCode: Record "VAT Code" temporary) MissedCodesExist: Boolean
- var
- TempRequiredVATCode: Record "VAT Code" temporary;
- TempNewVATCode: Record "VAT Code" temporary;
- VATCode: Record "VAT Code";
- NorwegianVATTools: Codeunit "Norwegian VAT Tools";
- begin
- TempMissingVATCode.Reset();
- TempMissingVATCode.DeleteAll();
- GetRequiredVATCodes(TempRequiredVATCode);
- NorwegianVATTools.GetVATCodes2022(TempNewVATCode);
- if TempNewVATCode.FindSet() then
- repeat
- if TempRequiredVATCode.Get(TempNewVATCode."SAF-T VAT Code") then begin
- TempNewVATCode."Report VAT Rate" := TempRequiredVATCode."Report VAT Rate";
- TempNewVATCode."VAT Rate For Reporting" := TempRequiredVATCode."VAT Rate For Reporting";
- TempRequiredVATCode := TempNewVATCode;
- If TempRequiredVATCode.Insert() then;
- end;
- until TempNewVATCode.Next() = 0;
- TempRequiredVATCode.FindSet();
- repeat
- if not VATCode.Get(TempRequiredVATCode.Code) then begin
- TempMissingVATCode := TempRequiredVATCode;
- TempMissingVATCode.Insert();
- MissedCodesExist := true;
- end;
- until TempRequiredVATCode.Next() = 0;
- exit(MissedCodesExist)
- end;
-
- [Obsolete('Use the procedure AddVATReportingCodes instead', '23.0')]
- procedure AddVATCodes(var TempVATCode: Record "VAT Code" temporary)
- var
- VATCode: Record "VAT Code";
- begin
- if not TempVATCode.FindSet() then
- exit;
-
- repeat
- if not VATCode.Get(TempVATCode.Code) then begin
- VATCode := TempVATCode;
- VATCode.Insert(true);
- end;
- until TempVATCode.Next() = 0;
- end;
-
- [Obsolete('Use the procedure SetVATRatesForReportingOnVATReportingCodes instead', '23.0')]
- procedure SetVATRatesForReportingForVATCodes()
- var
- TempRequiredVATCode: Record "VAT Code" temporary;
- VATCode: Record "VAT Code";
- begin
- GetRequiredVATCodes(TempRequiredVATCode);
- TempRequiredVATCode.FindSet();
- repeat
- if VATCode.Get(TempRequiredVATCode.Code) then begin
- VATCode."VAT Rate For Reporting" := TempRequiredVATCode."VAT Rate For Reporting";
- VATCode."Report VAT Rate" := TempRequiredVATCode."Report VAT Rate";
- VATCode.Modify();
- end;
- until TempRequiredVATCode.Next() = 0;
- if GuiAllowed() then
- Message(VATRatesForReportingHaveBeenSetMsg);
- end;
-#endif
procedure GetMissingVATReportingCodes(var TempMissingVATReportingCode: Record "VAT Reporting Code" temporary) MissedCodesExist: Boolean
var
TempRequiredVATCode: Record "VAT Reporting Code" temporary;
@@ -220,7 +152,6 @@ codeunit 10683 "Elec. VAT Data Mgt."
exit(DelChr(CompanyInformation."VAT Registration No.", '=', DelChr(CompanyInformation."VAT Registration No.", '=', '1234567890')));
end;
-#if CLEAN23
local procedure CreateVATStatementLines(VATStatementName: Record "VAT Statement Name")
var
TempRequiredVATCode: Record "VAT Reporting Code" temporary;
@@ -290,77 +221,6 @@ codeunit 10683 "Elec. VAT Data Mgt."
end;
until TempRequiredVATCode.Next() = 0;
end;
-#else
- local procedure CreateVATStatementLines(VATStatementName: Record "VAT Statement Name")
- var
- TempRequiredVATCode: Record "VAT Code" temporary;
- VATPostingSetup: Record "VAT Posting Setup";
- TempVATPostingSetup: Record "VAT Posting Setup" temporary;
- VATStatementLine: Record "VAT Statement Line";
- AmountRowNo: Integer;
- RowTotalingFilter: Text[50];
- RowNo: Text[10];
- BoxNo: Text[30];
- LineNo: Integer;
- SetupCount: Integer;
- CalculateWith: Option;
- begin
- GetRequiredVATCodes(TempRequiredVATCode);
- TempRequiredVATCode.FindSet();
- repeat
- TempVATPostingSetup.Reset();
- TempVATPostingSetup.DeleteAll();
- VATPostingSetup.Reset();
- VATPostingSetup.SetRange("Sales SAF-T Standard Tax Code", TempRequiredVATCode.Code);
- CopyVATPostingSetupToTempVATPostingSetup(TempVATPostingSetup, VATPostingSetup);
- VATPostingSetup.Reset();
- VATPostingSetup.SetRange("Purch. SAF-T Standard Tax Code", TempRequiredVATCode.Code);
- CopyVATPostingSetupToTempVATPostingSetup(TempVATPostingSetup, VATPostingSetup);
- if TempVATPostingSetup.FindSet() then begin
- AmountRowNo := 0;
- RowTotalingFilter := '';
- SetupCount := TempVATPostingSetup.Count();
- if IsReverseChargeVATCode(TempRequiredVATCode.Code) then
- CalculateWith := VATStatementLine."Calculate with"::Sign
- else
- CalculateWith := VATStatementLine."Calculate with"::"Opposite Sign";
- repeat
- RowNo := TempRequiredVATCode.Code;
- If (SetupCount > 1) or
- ((TempVATPostingSetup."Sales SAF-T Standard Tax Code" = TempRequiredVATCode.Code) and (TempVATPostingSetup."Purch. SAF-T Standard Tax Code" = TempRequiredVATCode.Code))
- then
- BoxNo := ''
- else
- BoxNo := TempRequiredVATCode.Code;
- if TempVATPostingSetup."Sales SAF-T Standard Tax Code" = TempRequiredVATCode.Code then begin
- LineNo += 10000;
- AmountRowNo += 1;
- if BoxNo = '' then
- RowNo += '-' + Format(AmountRowNo);
- CreateVATEntryTotalingLine(
- VATStatementLine, VATStatementName, RowNo, BoxNo, TempRequiredVATCode.Description, TempVATPostingSetup,
- VATStatementLine."Gen. Posting Type"::Sale, LineNo, CalculateWith);
- AddToFilter(RowTotalingFilter, VATStatementLine."Row No.");
- end;
- if TempVATPostingSetup."Purch. SAF-T Standard Tax Code" = TempRequiredVATCode.Code then begin
- LineNo += 10000;
- AmountRowNo += 1;
- if BoxNo = '' then
- RowNo += '-' + Format(AmountRowNo);
- CreateVATEntryTotalingLine(
- VATStatementLine, VATStatementName, RowNo, BoxNo, TempRequiredVATCode.Description, TempVATPostingSetup,
- VATStatementLine."Gen. Posting Type"::Purchase, LineNo, CalculateWith);
- AddToFilter(RowTotalingFilter, VATStatementLine."Row No.");
- end;
- until TempVATPostingSetup.Next() = 0;
- if BoxNo = '' then begin
- LineNo += 10000;
- CreateRowTotalingLine(VATStatementName, TempRequiredVATCode.Code, TempRequiredVATCode.Description, LineNo, RowTotalingFilter);
- end;
- end;
- until TempRequiredVATCode.Next() = 0;
- end;
-#endif
local procedure AddToFilter(var Filter: Text[50]; Value: Text)
begin
@@ -413,61 +273,6 @@ codeunit 10683 "Elec. VAT Data Mgt."
VATStatementLine.Insert(true);
end;
-#if not CLEAN23
- local procedure GetRequiredVATCodes(var TempRequiredVATCode: Record "VAT Code" temporary)
- begin
- InsertTempVATCode(TempRequiredVATCode, '1', InputVATDeductibleDomesticTxt, 0, false);
- InsertTempVATCode(TempRequiredVATCode, '3', OutputVATTxt, 25, true);
- InsertTempVATCode(TempRequiredVATCode, '5', DomesticSalesReverseChargeTxt, 0, true);
- InsertTempVATCode(TempRequiredVATCode, '6', NotLiableToVATTreatmentTxt, 0, true);
- InsertTempVATCode(TempRequiredVATCode, '11', InputVATDeductibleDomesticTxt, 0, false);
- InsertTempVATCode(TempRequiredVATCode, '12', InputVATDeductibleDomesticTxt, 0, false);
- InsertTempVATCode(TempRequiredVATCode, '13', InputVATDeductibleDomesticTxt, 0, false);
- InsertTempVATCode(TempRequiredVATCode, '14', InputVATDeductiblePayedOnImportTxt, 0, false);
- InsertTempVATCode(TempRequiredVATCode, '15', InputVATDeductiblePayedOnImportTxt, 0, false);
- InsertTempVATCode(TempRequiredVATCode, '31', OutputVATTxt, 15, true);
- InsertTempVATCode(TempRequiredVATCode, '32', OutputVATTxt, 11.11, true);
- InsertTempVATCode(TempRequiredVATCode, '33', OutputVATTxt, 12, true);
- InsertTempVATCode(TempRequiredVATCode, '51', DomesticSalesReverseChargeTxt, 0, true);
- InsertTempVATCode(TempRequiredVATCode, '52', ExportOfGoodsAndServicesTxt, 0, true);
- InsertTempVATCode(TempRequiredVATCode, '81', ImportationOfGoodsVATDeductibleTxt, 25, true);
- InsertTempVATCode(TempRequiredVATCode, '82', ImportationOfGoodsWithoutDeductionOfVATTxt, 25, true);
- InsertTempVATCode(TempRequiredVATCode, '83', ImportationOfGoodsVATDeductibleTxt, 15, true);
- InsertTempVATCode(TempRequiredVATCode, '84', ImportationOfGoodsWithoutDeductionOfVATTxt, 15, true);
- InsertTempVATCode(TempRequiredVATCode, '85', ImportationOfGoodsNotApplicableForVATTxt, 0, true);
- InsertTempVATCode(TempRequiredVATCode, '86', ServicesPurchasedFromAbroadVATDeductibleTxt, 25, true);
- InsertTempVATCode(TempRequiredVATCode, '87', ServicesPurchasedFromAbroadWithoutVATDeductionTxt, 25, true);
- InsertTempVATCode(TempRequiredVATCode, '88', ServicesPurchasedFromAbroadVATDeductibleTxt, 12, true);
- InsertTempVATCode(TempRequiredVATCode, '89', ServicesPurchasedFromAbroadWithoutVATDeductionTxt, 12, true);
- InsertTempVATCode(TempRequiredVATCode, '91', PurchaseOfEmissionsTradingOrGoldVATDeductibleTxt, 25, true);
- InsertTempVATCode(TempRequiredVATCode, '92', PurchaseOfEmissionsTradingOrGoldWithoutVATDeductionTxt, 25, true);
- end;
-
- local procedure InsertTempVATCode(var TempVATCode: Record "VAT Code"; Code: Code[10]; Description: Text; VATRateForReporting: Decimal; ReportVATRate: Boolean)
- begin
- TempVATCode.Code := Code;
- TempVATCode.Description := CopyStr(Description, 1, MaxStrLen(TempVATCode.Description));
- TempVATCode."VAT Rate For Reporting" := VATRateForReporting;
- TempVATCode."Report VAT Rate" := ReportVATRate;
- TempVATCode.Insert();
- GetRelatedVATCodes(TempVATCode, TempVATCode.Code);
- end;
-
- local procedure GetRelatedVATCodes(var TempRelatedVATCode: Record "VAT Code" temporary; VATCodeValue: Code[10]): Boolean
- var
- VATCode: Record "VAT Code";
- begin
- VATCode.SetRange("SAF-T VAT Code", VATCodeValue);
- if not VATCode.FindSet() then
- exit(false);
-
- repeat
- TempRelatedVATCode := VATCode;
- TempRelatedVATCode.Insert();
- until VATCode.Next() = 0;
- exit(true);
- end;
-#endif
local procedure GetRequiredVATReportingCodes(var TempRequiredVATCode: Record "VAT Reporting Code" temporary)
begin
InsertTempVATReportingCode(TempRequiredVATCode, '1', InputVATDeductibleDomesticTxt, 0, false);
diff --git a/Apps/NO/ElectronicVATSubmission/app/src/VAT Return Management/ElecVATPostingSetup.TableExt.al b/Apps/NO/ElectronicVATSubmission/app/src/VAT Return Management/ElecVATPostingSetup.TableExt.al
index 360d17e4df..819fb2b3c9 100644
--- a/Apps/NO/ElectronicVATSubmission/app/src/VAT Return Management/ElecVATPostingSetup.TableExt.al
+++ b/Apps/NO/ElectronicVATSubmission/app/src/VAT Return Management/ElecVATPostingSetup.TableExt.al
@@ -25,22 +25,6 @@ tableextension 10689 "Elec. VAT Posting Setup" extends "VAT Posting Setup"
CheckIfVATRateMatch("Purch. VAT Reporting Code");
end;
}
-#if not CLEAN23
- modify("Sales SAF-T Standard Tax Code")
- {
- trigger OnAfterValidate()
- begin
- CheckVATRateMatch("Sales SAF-T Standard Tax Code");
- end;
- }
- modify("Purch. SAF-T Standard Tax Code")
- {
- trigger OnAfterValidate()
- begin
- CheckVATRateMatch("Purch. SAF-T Standard Tax Code");
- end;
- }
-#endif
}
local procedure CheckIfVATRateMatch(VATCodeValue: Code[20])
@@ -57,22 +41,6 @@ tableextension 10689 "Elec. VAT Posting Setup" extends "VAT Posting Setup"
Message(VATRateDoesNotMatchMsg, VATReportingCode."VAT Rate For Reporting", "VAT %");
end;
-#if not CLEAN23
- local procedure CheckVATRateMatch(VATCodeValue: Code[10])
- var
- VATCode: Record "VAT Code";
- begin
- if VATCodeValue = '' then
- exit;
- if not VATCode.Get(VATCodeValue) then
- exit;
- if not VATCode."Report VAT Rate" then
- exit;
- if VATCode."VAT Rate For Reporting" <> "VAT %" then
- Message(VATRateDoesNotMatchMsg, VATCode."VAT Rate For Reporting", "VAT %");
- end;
-#endif
-
var
VATRateDoesNotMatchMsg: Label 'The VAT code you have selected has a VAT rate for reporting (%1 %) that is different than a VAT rate in the VAT posting setup (%2)', Comment = '%1,%2 = VAT rates/numbers';
}
diff --git a/Apps/NO/ElectronicVATSubmission/app/src/VAT Return Management/ElecVATValidateReturn.Codeunit.al b/Apps/NO/ElectronicVATSubmission/app/src/VAT Return Management/ElecVATValidateReturn.Codeunit.al
index c55fc94e24..b74459e8b4 100644
--- a/Apps/NO/ElectronicVATSubmission/app/src/VAT Return Management/ElecVATValidateReturn.Codeunit.al
+++ b/Apps/NO/ElectronicVATSubmission/app/src/VAT Return Management/ElecVATValidateReturn.Codeunit.al
@@ -6,9 +6,6 @@ namespace Microsoft.Finance.VAT.Reporting;
using Microsoft.Foundation.Company;
using System.Utilities;
-#if not CLEAN23
-using Microsoft.Finance.VAT.Setup;
-#endif
codeunit 10686 "Elec. VAT Validate Return"
{
@@ -29,11 +26,7 @@ codeunit 10686 "Elec. VAT Validate Return"
VATStatementReportLine: Record "VAT Statement Report Line";
ErrorMessage: Record "Error Message";
CompanyInformation: Record "Company Information";
-#if CLEAN23
VATReportingCode: Record "VAT Reporting Code";
-#else
- VATCode: Record "VAT Code";
-#endif
VATCodeValue: Code[20];
ExpectedVATAmount: Decimal;
begin
@@ -49,7 +42,6 @@ codeunit 10686 "Elec. VAT Validate Return"
VATStatementReportLine.SetRange("VAT Report No.", VATReportHeader."No.");
VATStatementReportLine.FindSet();
repeat
-#if CLEAN23
VATCodeValue := CopyStr(VATStatementReportLine."Box No.", 1, MaxStrLen(VATCodeValue));
VATReportingCode.Get(VATCodeValue);
if VATReportingCode."Report VAT Rate" and (VATStatementReportLine.Base <> 0) then begin
@@ -57,15 +49,6 @@ codeunit 10686 "Elec. VAT Validate Return"
if Abs(ExpectedVATAmount - VATStatementReportLine.Amount) > 1 then
Error(VATAmountCalcErr, VATStatementReportLine."Box No.");
end;
-#else
- VATCodeValue := CopyStr(VATStatementReportLine."Box No.", 1, MaxStrLen(VATCodeValue));
- VATCode.Get(VATCodeValue);
- if VATCode."Report VAT Rate" and (VATStatementReportLine.Base <> 0) then begin
- ExpectedVATAmount := Round(VATStatementReportLine.Base * VATCode."VAT Rate For Reporting" / 100);
- if abs(ExpectedVATAmount - VATStatementReportLine.Amount) > 1 then
- error(VATAmountCalcErr, VATStatementReportLine."Box No.");
- end;
-#endif
until VATStatementReportLine.Next() = 0;
end;
}
diff --git a/Apps/NO/ElectronicVATSubmission/test/src/ElecVATSubmissionUT.Codeunit.al b/Apps/NO/ElectronicVATSubmission/test/src/ElecVATSubmissionUT.Codeunit.al
index c1cf34b352..0ea2fe7184 100644
--- a/Apps/NO/ElectronicVATSubmission/test/src/ElecVATSubmissionUT.Codeunit.al
+++ b/Apps/NO/ElectronicVATSubmission/test/src/ElecVATSubmissionUT.Codeunit.al
@@ -13,7 +13,6 @@ codeunit 148134 "Elec. VAT Submission UT"
// [FEATURE] [Electronic VAT Submission] [UT]
end;
-#if CLEAN23
[Test]
procedure ValidateVATStatementSignWithVATCodeDependentOnOtherCode()
var
@@ -34,29 +33,6 @@ codeunit 148134 "Elec. VAT Submission UT"
VATStatementReportLine.Modify(true);
Codeunit.Run(Codeunit::"Elec. VAT Validate Return", VATReportHeader);
end;
-#else
- [Test]
- [Scope('OnPrem')]
- procedure ValidateVATStatementSignWithVATCodeDependentOnOtherCode()
- var
- VATReportHeader: Record "VAT Report Header";
- VATStatementReportLine: Record "VAT Statement Report Line";
- VATCode: Record "VAT Code";
- begin
- // [FEATURE] [UI]
- // [SCENARIO 422655] Stan can validate VAT statement with the VAT Code that has "SAF-T Code" specified
-
- Initialize();
- LibraryElecVATSubmission.InsertElecVATReportHeader(VATReportHeader);
- VATCode.Get(LibraryElecVATSubmission.CreateSimpleVATCode());
- VATCode.Validate("SAF-T VAT Code", '1');
- VATCode.Modify(true);
- LibraryElecVATSubmission.InsertVATStatementReportLineWithBoxNo(VATStatementReportLine, VATReportHeader, VATCode.Code);
- VATStatementReportLine.Validate(Amount, -1);
- VATStatementReportLine.Modify(true);
- Codeunit.Run(Codeunit::"Elec. VAT Validate Return", VATReportHeader);
- end;
-#endif
local procedure Initialize()
begin
diff --git a/Apps/NO/ElectronicVATSubmission/test/src/ElecVATSubmissionXMLTests.Codeunit.al b/Apps/NO/ElectronicVATSubmission/test/src/ElecVATSubmissionXMLTests.Codeunit.al
index 7bbf304490..ef0770cd41 100644
--- a/Apps/NO/ElectronicVATSubmission/test/src/ElecVATSubmissionXMLTests.Codeunit.al
+++ b/Apps/NO/ElectronicVATSubmission/test/src/ElecVATSubmissionXMLTests.Codeunit.al
@@ -660,7 +660,6 @@ codeunit 148131 "Elec. VAT Submission XML Tests"
LibraryElecVATSubmission.AssertElementValue(TempXMLBuffer, 'merverdiavgift', LibraryElecVATSubmission.GetAmountTextRounded(Amount));
end;
-#if CLEAN23
local procedure VerifyVATCodeWithSpecAndNoteXmlBlock(var TempXMLBuffer: Record "XML Buffer" temporary; BoxNo: Text; Description: Text; Amount: Decimal)
var
VATReportingCode: Record "VAT Reporting Code";
@@ -691,38 +690,6 @@ codeunit 148131 "Elec. VAT Submission XML Tests"
LibraryElecVATSubmission.AssertElementValue(TempXMLBuffer, 'sats', Format(VATReportingCode."VAT Rate For Reporting", 0, ''));
LibraryElecVATSubmission.AssertElementValue(TempXMLBuffer, 'merverdiavgift', LibraryElecVATSubmission.GetAmountTextRounded(Amount));
end;
-#else
- local procedure VerifyVATCodeWithSpecAndNoteXmlBlock(var TempXMLBuffer: Record "XML Buffer" temporary; BoxNo: Text; Description: Text; Amount: Decimal)
- var
- VATCode: Record "VAT Code";
- VATSpecification: Record "VAT Specification";
- VATNote: Record "VAT Note";
- begin
- VATCode.Get(CopyStr(BoxNo, 1, MaxStrLen(VATCode.Code)));
- LibraryElecVATSubmission.AssertElementName(TempXMLBuffer, 'mvaSpesifikasjonslinje');
- LibraryElecVATSubmission.AssertElementValue(TempXMLBuffer, 'mvaKode', BoxNo);
- VATSpecification.Get(VATCode."VAT Specification Code");
- LibraryElecVATSubmission.AssertElementValue(TempXMLBuffer, 'spesifikasjon', VATSpecification."VAT Report Value");
- LibraryElecVATSubmission.AssertElementValue(TempXMLBuffer, 'mvaKodeRegnskapsystem', Description);
- LibraryElecVATSubmission.AssertElementValue(TempXMLBuffer, 'merverdiavgift', LibraryElecVATSubmission.GetAmountTextRounded(Amount));
- VATNote.Get(VATCode."VAT Note Code");
- LibraryElecVATSubmission.AssertElementName(TempXMLBuffer, 'merknad');
- LibraryElecVATSubmission.AssertElementValue(TempXMLBuffer, 'utvalgtMerknad', VATNote."VAT Report Value");
- end;
-
- local procedure VerifyVATCodeComplexXmlBlock(var TempXMLBuffer: Record "XML Buffer" temporary; BoxNo: Text; Description: Text; Base: Decimal; Amount: Decimal)
- var
- VATCode: Record "VAT Code";
- begin
- LibraryElecVATSubmission.AssertElementName(TempXMLBuffer, 'mvaSpesifikasjonslinje');
- LibraryElecVATSubmission.AssertElementValue(TempXMLBuffer, 'mvaKode', BoxNo);
- LibraryElecVATSubmission.AssertElementValue(TempXMLBuffer, 'mvaKodeRegnskapsystem', Description);
- LibraryElecVATSubmission.AssertElementValue(TempXMLBuffer, 'grunnlag', LibraryElecVATSubmission.GetAmountTextRounded(Base));
- VATCode.Get(CopyStr(BoxNo, 1, MaxStrLen(VATCode.Code)));
- LibraryElecVATSubmission.AssertElementValue(TempXMLBuffer, 'sats', Format(VATCode."VAT Rate For Reporting", 0, ''));
- LibraryElecVATSubmission.AssertElementValue(TempXMLBuffer, 'merverdiavgift', LibraryElecVATSubmission.GetAmountTextRounded(Amount));
- end;
-#endif
local procedure VerifyPeriodXMLNodesInSubmissionMessage(VATReportHeader: Record "VAT Report Header"; PeriodType: Text; PeriodText: Text)
var
diff --git a/Apps/NO/ElectronicVATSubmission/test/src/LibraryElecVATSubmission.Codeunit.al b/Apps/NO/ElectronicVATSubmission/test/src/LibraryElecVATSubmission.Codeunit.al
index 57d3a925e6..a18083561c 100644
--- a/Apps/NO/ElectronicVATSubmission/test/src/LibraryElecVATSubmission.Codeunit.al
+++ b/Apps/NO/ElectronicVATSubmission/test/src/LibraryElecVATSubmission.Codeunit.al
@@ -62,7 +62,6 @@ codeunit 148130 "Library - Elec. VAT Submission"
VATStatementReportLine.Insert();
end;
-#if CLEAN23
procedure CreateSimpleVATCode(): Code[20]
var
VATReportingCode: Record "VAT Reporting Code";
@@ -91,36 +90,6 @@ codeunit 148130 "Library - Elec. VAT Submission"
VATReportingCode.Validate("VAT Rate For Reporting", VATRate);
VATReportingCode.Modify(true);
end;
-#else
- procedure CreateSimpleVATCode(): Code[10]
- var
- VATCode: Record "VAT Code";
- begin
- VATCode.Code := LibraryUtility.GenerateRandomCode(VATCode.FieldNo(Code), Database::"VAT Code");
- VATCode.Insert(true);
- exit(VATCode.Code)
- end;
-
- procedure SetVATSpecificationAndNoteToVATCode(VATCodeValue: Code[10])
- var
- VATCode: Record "VAT Code";
- begin
- VATCode.Get(VATCodeValue);
- VATCode.Validate("VAT Specification Code", CreateVATSpecification());
- VATCode.Validate("VAT Note Code", CreateVATNote());
- VATCode.Modify(true);
- end;
-
- procedure SetVATCodeReportVATRate(VATCodeValue: Code[10]; VATRate: Decimal)
- var
- VATCode: Record "VAT Code";
- begin
- VATCode.Get(VATCodeValue);
- VATCode.Validate("Report VAT Rate", true);
- VATCode.Validate("VAT Rate For Reporting", VATRate);
- VATCode.Modify(true);
- end;
-#endif
procedure SetReportVATNoteInVATReportSetup(NewReportVATNote: Boolean)
var
diff --git a/Apps/NO/NorwegianSAFT/app/src/Export Engine/GenerateSAFTFile.Codeunit.al b/Apps/NO/NorwegianSAFT/app/src/Export Engine/GenerateSAFTFile.Codeunit.al
index 415230aec4..0360ef1b0b 100644
--- a/Apps/NO/NorwegianSAFT/app/src/Export Engine/GenerateSAFTFile.Codeunit.al
+++ b/Apps/NO/NorwegianSAFT/app/src/Export Engine/GenerateSAFTFile.Codeunit.al
@@ -12,9 +12,7 @@ using Microsoft.Finance.GeneralLedger.Account;
using Microsoft.Finance.GeneralLedger.Ledger;
using Microsoft.Finance.GeneralLedger.Setup;
using Microsoft.Finance.VAT.Ledger;
-#if CLEAN23
using Microsoft.Finance.VAT.Reporting;
-#endif
using Microsoft.Finance.VAT.Setup;
using Microsoft.Foundation.Address;
using Microsoft.Foundation.AuditCodes;
@@ -486,7 +484,6 @@ codeunit 10673 "Generate SAF-T File"
SAFTXMLHelper.FinalizeXMLNode();
end;
-#if CLEAN23
local procedure ExportTaxCodeDetails()
var
VATPostingSetup: Record "VAT Posting Setup";
@@ -528,49 +525,6 @@ codeunit 10673 "Generate SAF-T File"
PurchaseCompensation, VATPostingSetup."Proportional Deduction VAT %");
until VATPostingSetup.Next() = 0;
end;
-#else
- local procedure ExportTaxCodeDetails()
- var
- VATPostingSetup: Record "VAT Posting Setup";
- VATCode: Record "VAT Code";
- SAFTExportMgt: Codeunit "SAF-T Export Mgt.";
- NotApplicableVATCode: Code[10];
- SalesCompensation: Boolean;
- PurchaseCompensation: Boolean;
- begin
- if not VATPostingSetup.FindSet() then
- exit;
-
- NotApplicableVATCode := SAFTExportMgt.GetNotApplicationVATCode();
- repeat
- If not VATPostingSetup."Calc. Prop. Deduction VAT" then
- VATPostingSetup."Proportional Deduction VAT %" := 0;
- if VATPostingSetup."Sales SAF-T Standard Tax Code" = '' then
- VATPostingSetup."Sales SAF-T Standard Tax Code" := NotApplicableVATCode
- else begin
- VATCode.Get(VATPostingSetup."Sales SAF-T Standard Tax Code");
- SalesCompensation := VATCode.Compensation;
- end;
- if VATPostingSetup."Purch. SAF-T Standard Tax Code" = '' then
- VATPostingSetup."Purch. SAF-T Standard Tax Code" := NotApplicableVATCode
- else begin
- VATCode.Get(VATPostingSetup."Purch. SAF-T Standard Tax Code");
- PurchaseCompensation := VATCode.Compensation;
- end;
-
- If VATPostingSetup."Sales VAT Account" <> '' then
- ExportTaxCodeDetail(
- VATPostingSetup."Sales SAF-T Tax Code", VATPostingSetup."Sales SAF-T Standard Tax Code",
- VATPostingSetup.Description, VATPostingSetup."VAT %",
- SalesCompensation, VATPostingSetup."Proportional Deduction VAT %");
- If VATPostingSetup."Purchase VAT Account" <> '' then
- ExportTaxCodeDetail(
- VATPostingSetup."Purchase SAF-T Tax Code", VATPostingSetup."Purch. SAF-T Standard Tax Code",
- VATPostingSetup.Description, VATPostingSetup."VAT %",
- PurchaseCompensation, VATPostingSetup."Proportional Deduction VAT %");
- until VATPostingSetup.Next() = 0;
- end;
-#endif
local procedure ExportTaxCodeDetail(SAFTTaxCode: Integer; StandardTaxCode: Code[10]; Description: Text; VATRate: Decimal; Compensation: Boolean; VATDeductionRate: Decimal)
var
diff --git a/Apps/NO/NorwegianSAFT/app/src/Export Engine/SAFTExportMgt.Codeunit.al b/Apps/NO/NorwegianSAFT/app/src/Export Engine/SAFTExportMgt.Codeunit.al
index f1ef00ffbd..5d12068a3b 100644
--- a/Apps/NO/NorwegianSAFT/app/src/Export Engine/SAFTExportMgt.Codeunit.al
+++ b/Apps/NO/NorwegianSAFT/app/src/Export Engine/SAFTExportMgt.Codeunit.al
@@ -8,9 +8,6 @@ using Microsoft.Finance.Currency;
using Microsoft.Finance.GeneralLedger.Ledger;
using Microsoft.Finance.GeneralLedger.Setup;
using Microsoft.Finance.VAT.Reporting;
-#if not CLEAN23
-using Microsoft.Finance.VAT.Setup;
-#endif
using Microsoft.Foundation.Company;
using Microsoft.Utilities;
using System;
@@ -765,17 +762,6 @@ codeunit 10675 "SAF-T Export Mgt."
end;
end;
-#if not CLEAN23
- [Obsolete('Use GetNotApplicableVATCode() instead', '23.0')]
- procedure GetNotApplicationVATCode(): Code[10]
- var
- SAFTSetup: Record "SAF-T Setup";
- VATCode: Record "VAT Code";
- begin
- SAFTSetup.Get();
- exit(copystr(SAFTSetup."Not Applicable VAT Code", 1, MaxStrLen(VATCode.Code)));
- end;
-#endif
procedure GetNotApplicableVATCode(): Code[20]
var
SAFTSetup: Record "SAF-T Setup";
diff --git a/Apps/NO/NorwegianSAFT/app/src/GLAccount Mapping/SAFTMappingHelper.Codeunit.al b/Apps/NO/NorwegianSAFT/app/src/GLAccount Mapping/SAFTMappingHelper.Codeunit.al
index 457370d26e..bbd695cd20 100644
--- a/Apps/NO/NorwegianSAFT/app/src/GLAccount Mapping/SAFTMappingHelper.Codeunit.al
+++ b/Apps/NO/NorwegianSAFT/app/src/GLAccount Mapping/SAFTMappingHelper.Codeunit.al
@@ -36,9 +36,6 @@ codeunit 10672 "SAF-T Mapping Helper"
VATPostingSetupWithoutTaxCodeErr: Label 'One or more VAT posting setup do not have a %1. Open the VAT Posting Setup page and specify %1 for each VAT posting setup combination.';
SourceCodeWithoutSAFTCodeErr: Label 'One or more source codes do not have a SAF-T source code. Open the Source Codes page and specify a SAF-T source code for each source code.';
ChartOfAccountsAlreadyExistsErr: Label 'A chart of accounts must be empty to be created based on SAF-T standard accounts.';
-#if not CLEAN23
- CopyReportingCodesToSAFTCodesQst: Label 'Do you want to copy sales and purchase reporting codes to sales/purchase SAF-T standard tax codes?';
-#endif
AssortedJournalsSourceCodeDescriptionLbl: Label 'Assorted Journals';
GeneralLedgerJournalsSourceCodeDescriptionLbl: Label 'General Ledger Journals';
AccountReceivablesSourceCodeDescriptionLbl: Label 'Account Receivables';
@@ -214,28 +211,6 @@ codeunit 10672 "SAF-T Mapping Helper"
until SAFTGLAccountMapping.Next() = 0;
end;
-#if not CLEAN23
- [Obsolete('The procedure will be removed, no need to copy the fields', '23.0')]
- procedure CopyReportingCodesToSAFTCodes()
- var
- VATPostingSetup: Record "VAT Posting Setup";
- ConfirmManagement: Codeunit "Confirm Management";
- begin
- if not ConfirmManagement.GetResponse(CopyReportingCodesToSAFTCodesQst, false) then
- exit;
-
- if not VATPostingSetup.FindSet(true) then
- exit;
-
- repeat
- if VATPostingSetup."Sales VAT Reporting Code" <> '' then
- VATPostingSetup.Validate("Sales SAF-T Standard Tax Code", VATPostingSetup."Sales VAT Reporting Code");
- if VATPostingSetup."Purchase VAT Reporting Code" <> '' then
- VATPostingSetup.Validate("Purch. SAF-T Standard Tax Code", VATPostingSetup."Purchase VAT Reporting Code");
- VATPostingSetup.Modify(true);
- until VATPostingSetup.Next() = 0;
- end;
-#endif
local procedure GLAccHasEntries(GLAccNo: Code[20]; StartingDate: Date; EndingDate: Date; IncludeIncomingBalance: Boolean): Boolean
var
GLAccount: Record "G/L Account";
@@ -496,11 +471,7 @@ codeunit 10672 "SAF-T Mapping Helper"
TotalCount := VATPostingSetup.Count();
if VATPostingSetup.FindSet() then
repeat
-#if CLEAN23
if (VATPostingSetup."Sale VAT Reporting Code" <> '') or (VATPostingSetup."Purch. VAT Reporting Code" <> '') then
-#else
- if (VATPostingSetup."Sales SAF-T Standard Tax Code" <> '') or (VATPostingSetup."Purch. SAF-T Standard Tax Code" <> '') then
-#endif
Count += 1;
until VATPostingSetup.Next() = 0;
exit(StrSubstNo('%1/%2', Count, TotalCount));
diff --git a/Apps/NO/NorwegianSAFT/app/src/Install and Setup/SAFTSetup.Table.al b/Apps/NO/NorwegianSAFT/app/src/Install and Setup/SAFTSetup.Table.al
index 830d62c9ad..df7e30118a 100644
--- a/Apps/NO/NorwegianSAFT/app/src/Install and Setup/SAFTSetup.Table.al
+++ b/Apps/NO/NorwegianSAFT/app/src/Install and Setup/SAFTSetup.Table.al
@@ -37,13 +37,8 @@ table 10670 "SAF-T Setup"
DataClassification = CustomerContent;
TableRelation = "VAT Code";
ObsoleteReason = 'Use the field "Not Applic. VAT Code" instead';
-#if CLEAN23
ObsoleteState = Removed;
ObsoleteTag = '26.0';
-#else
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-#endif
}
field(5; "Dimension No."; Integer)
{
diff --git a/Apps/NO/NorwegianSAFT/app/src/Install and Setup/SAFTXMLImport.Codeunit.al b/Apps/NO/NorwegianSAFT/app/src/Install and Setup/SAFTXMLImport.Codeunit.al
index 9f1497a1e8..088fe32114 100644
--- a/Apps/NO/NorwegianSAFT/app/src/Install and Setup/SAFTXMLImport.Codeunit.al
+++ b/Apps/NO/NorwegianSAFT/app/src/Install and Setup/SAFTXMLImport.Codeunit.al
@@ -5,9 +5,6 @@
namespace Microsoft.Finance.AuditFileExport;
using Microsoft.Finance.VAT.Reporting;
-#if not CLEAN23
-using Microsoft.Finance.VAT.Setup;
-#endif
using System.Environment;
using System.IO;
using System.Utilities;
@@ -83,10 +80,6 @@ codeunit 10671 "SAF-T XML Import"
ImportStandardAccountsFromXMLBuffer(TempXMLBuffer, GetMappingTypeBySourceType(SAFTMappingSource."Source Type"));
SAFTMappingSource."Source Type"::"Income Statement":
ImportGroupingCodesFromXMLBuffer(TempXMLBuffer);
-#if not CLEAN23
- SAFTMappingSource."Source Type"::"Standard Tax Code":
- ImportStandardVATCodesFromXMLBuffer(TempXMLBuffer);
-#endif
end;
if SAFTMappingSource."Source Type" = SAFTMappingSource."Source Type"::"Standard Tax Code" then
@@ -103,10 +96,6 @@ codeunit 10671 "SAF-T XML Import"
SAFTSetup.Get();
CopyTenantMediaToTempFromMappingSources(TempTenantMedia, SAFTMappingSourceType::"Standard Tax Code", false);
FillXMLBufferFromMediaResource(TempXMLBuffer, TempTenantMedia);
-#if not CLEAN23
- ImportStandardVATCodesFromXMLBuffer(TempXMLBuffer);
- SAFTSetup.Validate("Not Applicable VAT Code", InsertNotApplicableVATCode());
-#endif
ImportStandardVATReportingCodesFromXMLBuffer(TempXMLBuffer);
SAFTSetup.Validate("Not Applic. VAT Code", InsertNotApplicableVATReportingCode());
SAFTSetup.Modify(true);
@@ -122,33 +111,6 @@ codeunit 10671 "SAF-T XML Import"
CopyTenantMediaToTempFromMappingSources(TempTenantMedia, SAFTMappingSourceType::"Standard Tax Code", true));
end;
-#if not CLEAN23
- local procedure ImportStandardVATCodesFromXMLBuffer(var TempXMLBuffer: Record "XML Buffer" temporary)
- var
- TempChildXMLBuffer: Record "XML Buffer" temporary;
- VATCode: Record "VAT Code";
- begin
- if not TempXMLBuffer.FindNodesByXPath(TempXMLBuffer, '/StandardTaxCodes/TaxCode') then
- Error(NotPossibleToParseMappingXMLFileErr, SAFTTaxCodeTxt);
- repeat
- if not TempXMLBuffer.HasChildNodes() then
- Error(NotPossibleToParseMappingXMLFileErr, SAFTTaxCodeTxt);
- TempXMLBuffer.FindChildElements(TempChildXMLBuffer);
- VATCode.Init();
- VATCode.Code := CopyStr(TempChildXMLBuffer.Value, 1, MaxStrLen(VATCode.Code));
- TempChildXMLBuffer.Next();
- VATCode.Description := copystr(TempChildXMLBuffer.Value, 1, MaxStrLen(VATCode.Description));
- TempChildXMLBuffer.Next(); // skip eng description
- TempChildXMLBuffer.Next();
- If TempChildXMLBuffer.Name = 'TaxRate' then
- TempChildXMLBuffer.Next();
- if TempChildXMLBuffer.Name = 'Compensation' then
- Evaluate(VATCode.Compensation, TempChildXMLBuffer.Value);
- if VATCode.insert() then;
- until TempXMLBuffer.Next() = 0;
- end;
-#endif
-
local procedure ImportStandardVATReportingCodesFromXMLBuffer(var TempXMLBuffer: Record "XML Buffer" temporary)
var
TempChildXMLBuffer: Record "XML Buffer" temporary;
@@ -212,18 +174,6 @@ codeunit 10671 "SAF-T XML Import"
if SAFTMapping.Insert() then;
end;
-#if not CLEAN23
- local procedure InsertNotApplicableVATCode(): Code[10]
- var
- VATCode: Record "VAT Code";
- begin
- VATCode.Init();
- VATCode.Code := NATxt;
- VATCode.Description := NotApplicableTxt;
- if not VATCode.Insert() then;
- exit(VATCode.Code)
- end;
-#endif
local procedure InsertNotApplicableVATReportingCode(): Code[20]
var
VATReportingCode: Record "VAT Reporting Code";
diff --git a/Apps/NO/NorwegianSAFT/app/src/Master Data Mapping/SAFTTaxSetup.TableExt.al b/Apps/NO/NorwegianSAFT/app/src/Master Data Mapping/SAFTTaxSetup.TableExt.al
index ffebc4800b..1f08df4e3f 100644
--- a/Apps/NO/NorwegianSAFT/app/src/Master Data Mapping/SAFTTaxSetup.TableExt.al
+++ b/Apps/NO/NorwegianSAFT/app/src/Master Data Mapping/SAFTTaxSetup.TableExt.al
@@ -40,19 +40,8 @@ tableextension 10679 "SAF-T Tax Setup" extends "VAT Posting Setup"
Caption = 'Sales SAF-T Standard Tax Code';
TableRelation = "VAT Code";
ObsoleteReason = 'Use the field "Sale VAT Reporting Code" in BaseApp W1.';
-#if CLEAN23
ObsoleteState = Removed;
ObsoleteTag = '26.0';
-#else
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-
- trigger OnValidate()
- begin
- If "Sales SAF-T Standard Tax Code" <> '' then
- TestField("Sales VAT Account");
- end;
-#endif
}
field(10673; "Purch. SAF-T Standard Tax Code"; Code[10])
{
@@ -60,19 +49,8 @@ tableextension 10679 "SAF-T Tax Setup" extends "VAT Posting Setup"
Caption = 'Purchase SAF-T Standard Tax Code';
TableRelation = "VAT Code";
ObsoleteReason = 'Use the field "Purch. VAT Reporting Code" in BaseApp W1.';
-#if CLEAN23
ObsoleteState = Removed;
ObsoleteTag = '26.0';
-#else
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-
- trigger OnValidate()
- begin
- If "Purch. SAF-T Standard Tax Code" <> '' then
- TestField("Purchase VAT Account");
- end;
-#endif
}
}
diff --git a/Apps/NO/NorwegianSAFT/app/src/Master Data Mapping/SAFTTaxSetupCard.PageExt.al b/Apps/NO/NorwegianSAFT/app/src/Master Data Mapping/SAFTTaxSetupCard.PageExt.al
index 303f45d94c..8159ec4ef8 100644
--- a/Apps/NO/NorwegianSAFT/app/src/Master Data Mapping/SAFTTaxSetupCard.PageExt.al
+++ b/Apps/NO/NorwegianSAFT/app/src/Master Data Mapping/SAFTTaxSetupCard.PageExt.al
@@ -20,24 +20,6 @@ pageextension 10683 "SAF-T Tax Setup Card" extends "VAT Posting Setup Card"
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies the code of the VAT posting setup that will be used for the TaxCode XML node in the SAF-T file for the purchase VAT entries.';
}
-#if not CLEAN23
- field(SalesStandardTaxCode; "Sales SAF-T Standard Tax Code")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the code of the VAT posting setup that will be used for the StandardTaxCode XML node in the SAF-T file for the sales VAT entries.';
- ObsoleteReason = 'Use the field "Sale VAT Reporting Code" in BaseApp W1.';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
- }
- field(PurchaseStandardTaxCode; "Purch. SAF-T Standard Tax Code")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the code of the VAT posting setup that will be used for the StandardTaxCode XML node in the SAF-T file for the purchase VAT entries.';
- ObsoleteReason = 'Use the field "Purch. VAT Reporting Code" in BaseApp W1.';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
- }
-#endif
}
}
}
diff --git a/Apps/NO/NorwegianSAFT/app/src/Master Data Mapping/SAFTTaxSetupList.PageExt.al b/Apps/NO/NorwegianSAFT/app/src/Master Data Mapping/SAFTTaxSetupList.PageExt.al
index 48fe853b19..1803dc6329 100644
--- a/Apps/NO/NorwegianSAFT/app/src/Master Data Mapping/SAFTTaxSetupList.PageExt.al
+++ b/Apps/NO/NorwegianSAFT/app/src/Master Data Mapping/SAFTTaxSetupList.PageExt.al
@@ -20,24 +20,6 @@ pageextension 10682 "SAF-T Tax Setup List" extends "VAT Posting Setup"
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies the code of the VAT posting setup that will be used for the TaxCode XML node in the SAF-T file for the purchase VAT entries.';
}
-#if not CLEAN23
- field(SalesStandardTaxCode; "Sales SAF-T Standard Tax Code")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the code of the VAT posting setup that will be used for the StandardTaxCode XML node in the SAF-T file for the sales VAT entries.';
- ObsoleteReason = 'Use the field "Sale VAT Reporting Code" in BaseApp W1.';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
- }
- field(PurchaseStandardTaxCode; "Purch. SAF-T Standard Tax Code")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the code of the VAT posting setup that will be used for the StandardTaxCode XML node in the SAF-T file for the purchase VAT entries.';
- ObsoleteReason = 'Use the field "Purch. VAT Reporting Code" in BaseApp W1.';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
- }
-#endif
}
}
diff --git a/Apps/NO/NorwegianSAFT/app/src/Master Data Mapping/SAFTVATCode.PageExt.al b/Apps/NO/NorwegianSAFT/app/src/Master Data Mapping/SAFTVATCode.PageExt.al
deleted file mode 100644
index b247d0a3d0..0000000000
--- a/Apps/NO/NorwegianSAFT/app/src/Master Data Mapping/SAFTVATCode.PageExt.al
+++ /dev/null
@@ -1,25 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-#if not CLEAN23
-namespace Microsoft.Finance.AuditFileExport;
-
-using Microsoft.Finance.VAT.Setup;
-
-pageextension 10676 "SAF-T VAT Code" extends "VAT Codes"
-{
- layout
- {
- addlast(Control1080000)
- {
- field(Compensation; Compensation)
- {
- Caption = 'Compensation';
- ApplicationArea = Basic, Suite;
- Tooltip = 'Specifies if the tax code is used for compensation.';
- }
- }
- }
-}
-#endif
diff --git a/Apps/NO/NorwegianSAFT/app/src/Master Data Mapping/SAFTVATPostingSetup.Page.al b/Apps/NO/NorwegianSAFT/app/src/Master Data Mapping/SAFTVATPostingSetup.Page.al
index cd464f0ff3..8a4c269bde 100644
--- a/Apps/NO/NorwegianSAFT/app/src/Master Data Mapping/SAFTVATPostingSetup.Page.al
+++ b/Apps/NO/NorwegianSAFT/app/src/Master Data Mapping/SAFTVATPostingSetup.Page.al
@@ -52,24 +52,6 @@ page 10678 "SAF-T VAT Posting Setup"
ToolTip = 'Specifies a description of the VAT posting setup';
Editable = false;
}
-#if not CLEAN23
- field("Sales VAT Reporting Code"; "Sales VAT Reporting Code")
- {
- ApplicationArea = VAT;
- ToolTip = 'Specifies the VAT code to be used with this VAT posting setup for sales reporting.';
- ObsoleteReason = 'Use the field "Sale VAT Reporting Code" in BaseApp W1.';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
- }
- field("Purchase VAT Reporting Code"; "Purchase VAT Reporting Code")
- {
- ApplicationArea = VAT;
- ToolTip = 'Specifies the VAT code to be used with this VAT posting setup for purchase reporting.';
- ObsoleteReason = 'Use the field "Purch. VAT Reporting Code" in BaseApp W1.';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
- }
-#endif
field("Sale VAT Reporting Code"; Rec."Sale VAT Reporting Code")
{
ApplicationArea = Basic, Suite;
@@ -96,58 +78,12 @@ page 10678 "SAF-T VAT Posting Setup"
ToolTip = 'Specifies the code of the VAT posting setup that will be used for the TaxCode XML node in the SAF-T file for the purchase VAT entries.';
Editable = false;
}
-#if not CLEAN23
- field("Sales SAF-T Standard Tax Code"; "Sales SAF-T Standard Tax Code")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the code of the VAT posting setup that will be used for the StandardTaxCode XML node in the SAF-T file for the sales VAT entries.';
- ShowMandatory = SalesStandardTaxCodeMandatory;
- ObsoleteReason = 'Use the field "Sale VAT Reporting Code" in BaseApp W1.';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
- }
- field("Purch. SAF-T Standard Tax Code"; "Purch. SAF-T Standard Tax Code")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the code of the VAT posting setup that will be used for the StandardTaxCode XML node in the SAF-T file for the purchase VAT entries.';
- ShowMandatory = PurchStandardTaxCodeMandatory;
- ObsoleteReason = 'Use the field "Purch. VAT Reporting Code" in BaseApp W1.';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
- }
-#endif
}
}
}
actions
{
-#if not CLEAN23
- area(Processing)
- {
- action(CopyReportingCodes)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Copy Reporting Codes to SAF-T';
- ToolTip = 'Copy sales and purchase reporting codes to sales/purchase SAF-T standard tax codes.';
- Promoted = true;
- PromotedCategory = Process;
- PromotedIsBig = true;
- PromotedOnly = true;
- Image = Copy;
- ObsoleteReason = 'The action will be removed, no need to copy reporting codes to SAF-T codes';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-
- trigger OnAction()
- var
- SAFTMappingHelper: Codeunit "SAF-T Mapping Helper";
- begin
- SAFTMappingHelper.CopyReportingCodesToSAFTCodes();
- end;
- }
- }
-#endif
}
var
@@ -166,12 +102,7 @@ page 10678 "SAF-T VAT Posting Setup"
local procedure CalcTaxCodeMandatoryStyle()
begin
-#if CLEAN23
SalesStandardTaxCodeMandatory := (Rec."Sales VAT Account" <> '') and (Rec."Sale VAT Reporting Code" = '');
PurchStandardTaxCodeMandatory := (Rec."Purchase VAT Account" <> '') and (Rec."Purch. VAT Reporting Code" = '');
-#else
- SalesStandardTaxCodeMandatory := ("Sales VAT Account" <> '') and ("Sales SAF-T Standard Tax Code" = '');
- PurchStandardTaxCodeMandatory := ("Purchase VAT Account" <> '') and ("Purch. SAF-T Standard Tax Code" = '');
-#endif
end;
}
diff --git a/Apps/NO/NorwegianSAFT/test/src/SAFTTestHelper.Codeunit.al b/Apps/NO/NorwegianSAFT/test/src/SAFTTestHelper.Codeunit.al
index 92b9243746..790039b824 100644
--- a/Apps/NO/NorwegianSAFT/test/src/SAFTTestHelper.Codeunit.al
+++ b/Apps/NO/NorwegianSAFT/test/src/SAFTTestHelper.Codeunit.al
@@ -430,7 +430,6 @@ codeunit 148099 "SAF-T Test Helper"
GeneralLedgerSetup.Modify();
end;
-#if CLEAN23
local procedure SetupVATPostingSetupMapping()
var
VATPostingSetup: Record "VAT Posting Setup";
@@ -440,35 +439,14 @@ codeunit 148099 "SAF-T Test Helper"
VATPostingSetup.Next(); // do not specify any value for Standard Tax Code in order to verify that NA value will be exported in the XML file
VATReportingCode.FindSet();
repeat
-
VATPostingSetup.Validate("Sale VAT Reporting Code", VATReportingCode.Code);
VATPostingSetup.Validate("Purch. VAT Reporting Code", VATReportingCode.Code);
-
VATPostingSetup.Validate("Calc. Prop. Deduction VAT", false);
VATPostingSetup.Modify(true);
VATReportingCode.Next();
until VATPostingSetup.Next() = 0;
VATReportingCode.ModifyAll(Compensation, false);
end;
-#else
- local procedure SetupVATPostingSetupMapping()
- var
- VATPostingSetup: Record "VAT Posting Setup";
- VATCode: Record "VAT Code";
- begin
- VATPostingSetup.FindSet();
- VATPostingSetup.Next(); // do not specify any value for Standard Tax Code in order to verify that NA value will be exported in the XML file
- VATCode.FindSet();
- repeat
- VATPostingSetup.Validate("Sales SAF-T Standard Tax Code", VATCode.Code);
- VATPostingSetup.Validate("Purch. SAF-T Standard Tax Code", VATCode.Code);
- VATPostingSetup.Validate("Calc. Prop. Deduction VAT", false);
- VATPostingSetup.Modify(true);
- VATCode.Next();
- until VATPostingSetup.Next() = 0;
- VATCode.ModifyAll(Compensation, false);
- end;
-#endif
local procedure SetupCompanyBankAccounts()
var
diff --git a/Apps/NO/NorwegianSAFT/test/src/SAFTWizardTests.Codeunit.al b/Apps/NO/NorwegianSAFT/test/src/SAFTWizardTests.Codeunit.al
index bac4944a02..5dcd6c7446 100644
--- a/Apps/NO/NorwegianSAFT/test/src/SAFTWizardTests.Codeunit.al
+++ b/Apps/NO/NorwegianSAFT/test/src/SAFTWizardTests.Codeunit.al
@@ -185,11 +185,7 @@ codeunit 148101 "SAF-T Wizard Tests"
procedure MapVATPostingSetup()
var
SAFTMappingRange: Record "SAF-T Mapping Range";
-#if CLEAN23
VATReportingCode: Record "VAT Reporting Code";
-#else
- VATCode: Record "VAT Code";
-#endif
VATPostingSetup: Record "VAT Posting Setup";
AccountingPeriod: Record "Accounting Period";
SAFTSetupWizard: TestPage "SAF-T Setup Wizard";
@@ -208,21 +204,12 @@ codeunit 148101 "SAF-T Wizard Tests"
SAFTSetupWizard.ActionNext.Invoke();
SAFTSetupWizard.ActionNext.Invoke();
-#if CLEAN23
VATReportingCode.FindSet();
LibraryVariableStorage.Enqueue(VATReportingCode.Code);
VATReportingCode.Next();
LibraryVariableStorage.Enqueue(VATReportingCode.Code);
SAFTSetupWizard.OpenVATMapping.Drilldown();
SAFTSetupWizard.VATMappedInfo.AssertEquals(StrSubstNo('1/%1', VATPostingSetup.Count()));
-#else
- VATCode.FindSet();
- LibraryVariableStorage.Enqueue(VATCode.Code);
- VATCode.Next();
- LibraryVariableStorage.Enqueue(VATCode.Code);
- SAFTSetupWizard.OpenVATMapping.Drilldown();
- SAFTSetupWizard.VATMappedInfo.AssertEquals(StrSubstNo('1/%1', VATPostingSetup.Count()));
-#endif
LibraryVariableStorage.AssertEmpty();
LibraryPermissions.SetTestabilitySoftwareAsAService(false);
@@ -332,13 +319,8 @@ codeunit 148101 "SAF-T Wizard Tests"
[ModalPageHandler]
procedure MapVATPostingSetupModalPageHander(var SAFTVATPostingSetup: TestPage "SAF-T VAT Posting Setup")
begin
-#if CLEAN23
SAFTVATPostingSetup."Sale VAT Reporting Code".SetValue(LibraryVariableStorage.DequeueText());
SAFTVATPostingSetup."Purch. VAT Reporting Code".SetValue(LibraryVariableStorage.DequeueText());
-#else
- SAFTVATPostingSetup."Sales SAF-T Standard Tax Code".SetValue(LibraryVariableStorage.DequeueText());
- SAFTVATPostingSetup."Purch. SAF-T Standard Tax Code".SetValue(LibraryVariableStorage.DequeueText());
-#endif
end;
[ModalPageHandler]
diff --git a/Apps/NO/NorwegianSAFT/test/src/SAFTXMLTests.Codeunit.al b/Apps/NO/NorwegianSAFT/test/src/SAFTXMLTests.Codeunit.al
index 389fbaa530..03b6e73b4a 100644
--- a/Apps/NO/NorwegianSAFT/test/src/SAFTXMLTests.Codeunit.al
+++ b/Apps/NO/NorwegianSAFT/test/src/SAFTXMLTests.Codeunit.al
@@ -1907,11 +1907,7 @@ codeunit 148103 "SAF-T XML Tests"
SAFTTestHelper.AssertElementName(TempXMLBuffer, 'n1:TaxTableEntry');
SAFTTestHelper.AssertElementValue(TempXMLBuffer, 'n1:TaxType', 'MVA');
SAFTTestHelper.AssertElementValue(TempXMLBuffer, 'n1:Description', 'Merverdiavgift');
-#if CLEAN23
NotApplicationVATCode := SAFTExportMgt.GetNotApplicableVATCode();
-#else
- NotApplicationVATCode := SAFTExportMgt.GetNotApplicationVATCode();
-#endif
// Verify first VAT Posting Setup with no standard tax codes
VerifySingleVATPostingSetup(
TempXMLBuffer, VATPostingSetup."Sales SAF-T Tax Code", VATPostingSetup.Description,
@@ -1921,21 +1917,12 @@ codeunit 148103 "SAF-T XML Tests"
VATPostingSetup."VAT %", NotApplicationVATCode, false, 100);
VATPostingSetup.Next();
repeat
-#if CLEAN23
VerifySingleVATPostingSetup(
TempXMLBuffer, VATPostingSetup."Sales SAF-T Tax Code", VATPostingSetup.Description,
VATPostingSetup."VAT %", VATPostingSetup."Sale VAT Reporting Code", false, 100);
VerifySingleVATPostingSetup(
TempXMLBuffer, VATPostingSetup."Purchase SAF-T Tax Code", VATPostingSetup.Description,
VATPostingSetup."VAT %", VATPostingSetup."Purch. VAT Reporting Code", false, 100);
-#else
- VerifySingleVATPostingSetup(
- TempXMLBuffer, VATPostingSetup."Sales SAF-T Tax Code", VATPostingSetup.Description,
- VATPostingSetup."VAT %", VATPostingSetup."Sales SAF-T Standard Tax Code", false, 100);
- VerifySingleVATPostingSetup(
- TempXMLBuffer, VATPostingSetup."Purchase SAF-T Tax Code", VATPostingSetup.Description,
- VATPostingSetup."VAT %", VATPostingSetup."Purch. SAF-T Standard Tax Code", false, 100);
-#endif
until VATPostingSetup.Next() = 0;
end;
diff --git a/Apps/SE/SECore/app/src/Codeunits/InstallSECore.codeunit.al b/Apps/SE/SECore/app/src/Codeunits/InstallSECore.codeunit.al
index 31bb25d18b..daf047aea4 100644
--- a/Apps/SE/SECore/app/src/Codeunits/InstallSECore.codeunit.al
+++ b/Apps/SE/SECore/app/src/Codeunits/InstallSECore.codeunit.al
@@ -24,9 +24,6 @@ codeunit 11295 "Install SE Core"
trigger OnInstallAppPerCompany()
begin
SetDefaultReportLayouts();
-#if not CLEAN23
- UpgradeCompanyInformationTable();
-#endif
end;
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Company-Initialize", 'OnCompanyInitialize', '', false, false)]
@@ -35,36 +32,6 @@ codeunit 11295 "Install SE Core"
SetDefaultReportLayouts();
end;
-#if not CLEAN23
- local procedure UpgradeCompanyInformationTable()
- var
- CompanyInformation: Record "Company Information";
- RecRef: RecordRef;
- TargetFieldRef: FieldRef;
- SourceFieldRef: FieldRef;
- begin
- if not CompanyInformation.Get() then
- exit;
-
- RecRef.Open(Database::"Company Information", false);
- RecRef.GetBySystemId(CompanyInformation.SystemId);
-
- if RecRef.FieldExist(11200) then begin // field 11290 - CompanyInformation."Plus Giro No."
- SourceFieldRef := RecRef.Field(11200);
- TargetFieldRef := RecRef.Field(11290);
- TargetFieldRef.VALUE := SourceFieldRef.VALUE;
- RecRef.Modify(false);
- end;
-
- if RecRef.FieldExist(11201) then begin // field 11291 - CompanyInformation."Registered Office"
- SourceFieldRef := RecRef.Field(11201);
- TargetFieldRef := RecRef.Field(11291);
- TargetFieldRef.VALUE := SourceFieldRef.VALUE;
- RecRef.Modify(false);
- end;
- end;
-#endif
-
internal procedure SetDefaultReportLayouts()
var
ReportLayoutList: Record "Report Layout List";
diff --git a/Apps/SE/SECore/app/src/Codeunits/SyncCompanyInformation.Codeunit.al b/Apps/SE/SECore/app/src/Codeunits/SyncCompanyInformation.Codeunit.al
deleted file mode 100644
index b89faaa578..0000000000
--- a/Apps/SE/SECore/app/src/Codeunits/SyncCompanyInformation.Codeunit.al
+++ /dev/null
@@ -1,120 +0,0 @@
-#if not CLEAN23
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-
-namespace Microsoft.Foundation.Company;
-
-using Microsoft.Utilities;
-
-codeunit 11290 "Sync Company Information"
-{
- Access = Internal;
- InherentEntitlements = X;
- InherentPermissions = X;
- Permissions = tabledata "Company Information" = rm;
-
- [EventSubscriber(ObjectType::Table, Database::"Company Information", 'OnBeforeModifyEvent', '', false, false)]
- local procedure SyncOnBeforeModifyCompanyInformation(var Rec: Record "Company Information")
- var
- SyncDepFldUtilities: Codeunit "Sync.Dep.Fld-Utilities";
- begin
- if Rec.IsTemporary() then
- exit;
-
- if SyncDepFldUtilities.IsFieldSynchronizationDisabled() then
- exit;
-
- SyncPlusGiroOnCompanyInformationTable(Rec);
- SyncRegisteredOfficeOnCompanyInformationTable(Rec);
- end;
-
- [EventSubscriber(ObjectType::Table, Database::"Company Information", 'OnBeforeInsertEvent', '', false, false)]
- local procedure SyncOnBeforeInsertCompanyInformation(var Rec: Record "Company Information")
- var
- SyncDepFldUtilities: Codeunit "Sync.Dep.Fld-Utilities";
- begin
- if Rec.IsTemporary() then
- exit;
-
- if SyncDepFldUtilities.IsFieldSynchronizationDisabled() then
- exit;
-
- SyncPlusGiroOnCompanyInformationTable(Rec);
- SyncRegisteredOfficeOnCompanyInformationTable(Rec);
- end;
-
- local procedure SyncPlusGiroOnCompanyInformationTable(var CompanyInformation: Record "Company Information")
- var
- xCompanyInformation: Record "Company Information";
- SyncDepFldUtilities: Codeunit "Sync.Dep.Fld-Utilities";
- PreviousRecordRef: RecordRef;
- CurrentRecordRef: RecordRef;
- CurrentPlusGiroNo: Text[20];
- PreviousPlusGiroNo: Text[20];
- begin
- CurrentRecordRef.Open(Database::"Company Information", false);
- if not CurrentRecordRef.FieldExist(11200) then // field - 11200 "Plus Giro No."
- exit;
- CurrentPlusGiroNo := CurrentRecordRef.Field(11200).Value;
-
- if SyncDepFldUtilities.GetPreviousRecord(CompanyInformation, PreviousRecordRef) then begin
- PreviousRecordRef.SetTable(xCompanyInformation);
- PreviousPlusGiroNo := PreviousRecordRef.Field(11200).Value;
- SyncFields(CurrentPlusGiroNo, CompanyInformation."Plus Giro Number", PreviousPlusGiroNo, xCompanyInformation."Plus Giro Number");
- end else
- SyncFields(CurrentPlusGiroNo, CompanyInformation."Plus Giro Number");
- end;
-
- local procedure SyncRegisteredOfficeOnCompanyInformationTable(var CompanyInformation: Record "Company Information")
- var
- xCompanyInformation: Record "Company Information";
- SyncDepFldUtilities: Codeunit "Sync.Dep.Fld-Utilities";
- PreviousRecordRef: RecordRef;
- CurrentRecordRef: RecordRef;
- CurrentRegisteredOffice: Text[20];
- PreviousRegisteredOffice: Text[20];
- begin
- CurrentRecordRef.Open(Database::"Company Information", false);
- if not CurrentRecordRef.FieldExist(11201) then //field 11201 - "Registered Office"
- exit;
- CurrentRegisteredOffice := CurrentRecordRef.Field(11201).Value;
-
- if SyncDepFldUtilities.GetPreviousRecord(CompanyInformation, PreviousRecordRef) then begin
- PreviousRecordRef.SetTable(xCompanyInformation);
- PreviousRegisteredOffice := PreviousRecordRef.Field(11201).Value; // field 11201 - "Registered Office"
- SyncFields(CurrentRegisteredOffice, CompanyInformation."Registered Office Info", PreviousRegisteredOffice, xCompanyInformation."Registered Office Info");
- end else
- SyncFields(CurrentRegisteredOffice, CompanyInformation."Registered Office Info");
- end;
-
- procedure SyncFields(var ObsoleteFieldValue: Text[20]; var ValidFieldValue: Text[20]; PrevObsoleteFieldValue: Text[20]; PrevValidFieldValue: Text[20])
- begin
- if ObsoleteFieldValue = ValidFieldValue then
- exit;
-
- if (ObsoleteFieldValue = PrevObsoleteFieldValue) and (ValidFieldValue = PrevValidFieldValue) then
- exit;
-
- if ValidFieldValue <> PrevValidFieldValue then
- ObsoleteFieldValue := ValidFieldValue
- else
- if ObsoleteFieldValue <> PrevObsoleteFieldValue then
- ValidFieldValue := ObsoleteFieldValue
- else
- ObsoleteFieldValue := ValidFieldValue;
- end;
-
- procedure SyncFields(var ObsoleteFieldValue: Text[20]; var ValidFieldValue: Text[20])
- begin
- if ObsoleteFieldValue = ValidFieldValue then
- exit;
-
- if ValidFieldValue <> '' then
- ObsoleteFieldValue := ValidFieldValue;
- if ObsoleteFieldValue <> '' then
- ValidFieldValue := ObsoleteFieldValue;
- end;
-}
-#endif
diff --git a/Apps/US/IRS1096/app/src/Processing/IRS1096FormMgt.Codeunit.al b/Apps/US/IRS1096/app/src/Processing/IRS1096FormMgt.Codeunit.al
index 63d317a26e..ec08c0e045 100644
--- a/Apps/US/IRS1096/app/src/Processing/IRS1096FormMgt.Codeunit.al
+++ b/Apps/US/IRS1096/app/src/Processing/IRS1096FormMgt.Codeunit.al
@@ -21,15 +21,8 @@ codeunit 10016 "IRS 1096 Form Mgt."
var
FeatureTelemetry: Codeunit "Feature Telemetry";
ServDeclFormTok: Label 'Service Declaration', Locked = true;
-#if not CLEAN23
- InstallFeatureNotificationMsg: Label 'There is a new IRS 1096 form feature. An administrator can enable it on the Feature Management page.';
- DontShowAgainTxt: Label 'Do not show again';
-#endif
InstallIRS1096NotificationNameTxt: Label 'IRS 1096 Form - Install feature';
InstallIRS1096NotificationDescriptionTxt: Label 'This notification is used to let users know about the new IRS 1096 feature . It can be used to open the Feature Management and install the 1096 feature.';
-#if not CLEAN23
- FeatureNotEnabledMessageTxt: Label 'The %1 page is part of the new IRS 1096 feature, which is not yet enabled in your Business Central. An administrator can enable the feature on the Feature Management page.', Comment = '%1 - page caption';
-#endif
NoEntriesToCreateFormsMsg: Label 'No entries have been found by filters specified.';
#if not CLEAN25
FormPerPeriodAlreadyExistsQst: Label 'The form %1 for the period from %2 to %3 already exist. If you want to replace it, use the Replace parameter on the request page. Do you want to stop the creation of forms?', Comment = '%1 - code of the form, %2,%3 - starting and ending dates of the period';
@@ -158,26 +151,6 @@ codeunit 10016 "IRS 1096 Form Mgt."
FeatureTelemetry.LogUsage('0000ISC', ServDeclFormTok, 'File created');
end;
-#if not CLEAN23
- [Obsolete('Not used anymore as the feature is installed by default', '23.0')]
- procedure ShowInstallFeatureNotification()
- var
- MyNotifications: Record "My Notifications";
- Install1096FeatureNotification: Notification;
- begin
- if IsFeatureEnabled() then
- exit;
- if not MyNotifications.IsEnabled(GetIRS1096FeatureNotificationId()) then
- exit;
-
- Install1096FeatureNotification.Id := GetIRS1096FeatureNotificationId();
- Install1096FeatureNotification.Recall();
- Install1096FeatureNotification.Message := InstallFeatureNotificationMsg;
- Install1096FeatureNotification.AddAction(DontShowAgainTxt, Codeunit::"IRS 1096 Form Mgt.", 'DontShowAgainDisableAutomaticNotificationAction');
- Install1096FeatureNotification.Send();
- end;
-#endif
-
procedure DontShowAgainDisableAutomaticNotificationAction(var Notification: Notification)
var
MyNotifications: Record "My Notifications";
@@ -186,14 +159,6 @@ codeunit 10016 "IRS 1096 Form Mgt."
MyNotifications.InsertDefault(GetIRS1096FeatureNotificationId(), InstallIRS1096NotificationNameTxt, InstallIRS1096NotificationDescriptionTxt, false);
end;
-#if not CLEAN23
- [Obsolete('Not used anymore as the feature is installed by default', '23.0')]
- procedure ShowNotEnabledMessage(PageCaption: Text)
- begin
- Message(FeatureNotEnabledMessageTxt, PageCaption);
- end;
-#endif
-
procedure ShowRelatedVendorsLedgerEntries(FormNo: Code[20]; FormLineNo: Integer)
var
VendorLedgerEntry: Record "Vendor Ledger Entry";
diff --git a/Apps/W1/AutomaticAccountCodes/app/permissions/AACObjects.permissionset.al b/Apps/W1/AutomaticAccountCodes/app/permissions/AACObjects.permissionset.al
index 364a841806..b72a245b22 100644
--- a/Apps/W1/AutomaticAccountCodes/app/permissions/AACObjects.permissionset.al
+++ b/Apps/W1/AutomaticAccountCodes/app/permissions/AACObjects.permissionset.al
@@ -12,9 +12,6 @@ permissionset 4850 "AAC - Objects"
Permissions = table "Automatic Account Header" = X,
table "Automatic Account Line" = X,
-#if not CLEAN23
- codeunit "Inv. Post. Buff. Subscribers" = X,
-#endif
page "Automatic Account Header" = X,
page "Automatic Account Line" = X,
page "Automatic Account List" = X,
diff --git a/Apps/W1/AutomaticAccountCodes/app/src/Codeunits/InvPostBuffSubscribers.Codeunit.al b/Apps/W1/AutomaticAccountCodes/app/src/Codeunits/InvPostBuffSubscribers.Codeunit.al
deleted file mode 100644
index deaac4fa89..0000000000
--- a/Apps/W1/AutomaticAccountCodes/app/src/Codeunits/InvPostBuffSubscribers.Codeunit.al
+++ /dev/null
@@ -1,41 +0,0 @@
-#if not CLEAN23
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-namespace Microsoft.Finance.AutomaticAccounts;
-
-using Microsoft.Finance.GeneralLedger.Journal;
-using Microsoft.Finance.ReceivablesPayables;
-using Microsoft.Purchases.Document;
-using Microsoft.Sales.Document;
-
-codeunit 4852 "Inv. Post. Buff. Subscribers"
-{
- Access = Internal;
- ObsoleteReason = 'The Invoice Post. Buffer table will be replaced by table Invoice Posting Buffer in new Invoice Posting implementation.';
- ObsoleteState = Pending;
- ObsoleteTag = '20.0';
-
- [EventSubscriber(ObjectType::Table, Database::"Invoice Post. Buffer", 'OnAfterInvPostBufferPrepareSales', '', false, false)]
- local procedure OnAfterInvPostBufferPrepareSales(var SalesLine: Record "Sales Line"; var InvoicePostBuffer: Record "Invoice Post. Buffer")
- begin
- InvoicePostBuffer."Additional Grouping Identifier" += SalesLine."Automatic Account Group";
- InvoicePostBuffer."Automatic Account Group" := SalesLine."Automatic Account Group";
-
- end;
-
- [EventSubscriber(ObjectType::Table, Database::"Invoice Post. Buffer", 'OnAfterInvPostBufferPreparePurchase', '', false, false)]
- local procedure OnAfterInvPostBufferPreparePurchase(var PurchaseLine: Record "Purchase Line"; var InvoicePostBuffer: Record "Invoice Post. Buffer")
- begin
- InvoicePostBuffer."Automatic Account Group" := PurchaseLine."Automatic Account Group";
- InvoicePostBuffer."Additional Grouping Identifier" += PurchaseLine."Automatic Account Group";
- end;
-
- [EventSubscriber(ObjectType::Table, Database::"Invoice Post. Buffer", 'OnAfterCopyToGenJnlLine', '', false, false)]
- local procedure OnAfterCopyToGenJnlLine(var GenJnlLine: Record "Gen. Journal Line"; InvoicePostBuffer: Record "Invoice Post. Buffer");
- begin
- GenJnlLine."Automatic Account Group" := InvoicePostBuffer."Automatic Account Group";
- end;
-}
-#endif
\ No newline at end of file
diff --git a/Apps/W1/AutomaticAccountCodes/app/src/Tables/AutoAccInvoicePostBuffer.TableExt.al b/Apps/W1/AutomaticAccountCodes/app/src/Tables/AutoAccInvoicePostBuffer.TableExt.al
index 431c10b5b6..2669b3660f 100644
--- a/Apps/W1/AutomaticAccountCodes/app/src/Tables/AutoAccInvoicePostBuffer.TableExt.al
+++ b/Apps/W1/AutomaticAccountCodes/app/src/Tables/AutoAccInvoicePostBuffer.TableExt.al
@@ -16,13 +16,8 @@ tableextension 4853 "AutoAcc. Invoice Post. Buffer" extends "Invoice Post. Buffe
DataClassification = SystemMetadata;
TableRelation = "Automatic Account Header";
ObsoleteReason = 'This table will be replaced by table Invoice Posting Buffer in new Invoice Posting implementation.';
-#if CLEAN23
ObsoleteState = Removed;
ObsoleteTag = '26.0';
-#else
- ObsoleteState = Pending;
- ObsoleteTag = '20.0';
-#endif
}
}
}
diff --git a/Apps/W1/BankAccRecWithAI/app/src/BankAccReconciliationExt.PageExt.al b/Apps/W1/BankAccRecWithAI/app/src/BankAccReconciliationExt.PageExt.al
index 6f5e5bde84..7e25215a6f 100644
--- a/Apps/W1/BankAccRecWithAI/app/src/BankAccReconciliationExt.PageExt.al
+++ b/Apps/W1/BankAccRecWithAI/app/src/BankAccReconciliationExt.PageExt.al
@@ -2,7 +2,6 @@ namespace Microsoft.Bank.Reconciliation;
using System.AI;
using Microsoft.Finance.GeneralLedger.Journal;
-using System.Environment;
using System.Telemetry;
pageextension 7253 BankAccReconciliationExt extends "Bank Acc. Reconciliation"
@@ -17,6 +16,7 @@ pageextension 7253 BankAccReconciliationExt extends "Bank Acc. Reconciliation"
Caption = 'Reconcile';
ToolTip = 'Match statement lines with the assistance of Copilot';
Visible = CopilotActionsVisible;
+ Enabled = CopilotActionsVisible;
#pragma warning disable AL0482
Image = SparkleFilled;
#pragma warning restore AL0482
@@ -45,6 +45,7 @@ pageextension 7253 BankAccReconciliationExt extends "Bank Acc. Reconciliation"
Caption = 'Post difference to G/L account';
ToolTip = 'Find suitable G/L Accounts for selected statement lines, post their differences as new payments and reconcile statement lines with the new payments';
Visible = CopilotActionsVisible;
+ Enabled = CopilotActionsVisible;
#pragma warning disable AL0482
Image = SparkleFilled;
#pragma warning restore AL0482
@@ -163,9 +164,9 @@ pageextension 7253 BankAccReconciliationExt extends "Bank Acc. Reconciliation"
trigger OnOpenPage()
var
- EnvironmentInformation: Codeunit "Environment Information";
+ CopilotCapability: Codeunit "Copilot Capability";
begin
- CopilotActionsVisible := EnvironmentInformation.IsSaaSInfrastructure();
+ CopilotActionsVisible := CopilotCapability.IsCapabilityRegistered(Enum::"Copilot Capability"::"Bank Account Reconciliation");
end;
var
diff --git a/Apps/W1/BankAccRecWithAI/app/src/BankAccReconciliationListExt.PageExt.al b/Apps/W1/BankAccRecWithAI/app/src/BankAccReconciliationListExt.PageExt.al
index cf52af64cd..b8c1001a93 100644
--- a/Apps/W1/BankAccRecWithAI/app/src/BankAccReconciliationListExt.PageExt.al
+++ b/Apps/W1/BankAccRecWithAI/app/src/BankAccReconciliationListExt.PageExt.al
@@ -1,7 +1,6 @@
namespace Microsoft.Bank.Reconciliation;
using System.AI;
-using System.Environment;
using System.Telemetry;
pageextension 7254 BankAccReconciliationListExt extends "Bank Acc. Reconciliation List"
@@ -31,6 +30,7 @@ pageextension 7254 BankAccReconciliationListExt extends "Bank Acc. Reconciliatio
#pragma warning restore AL0482
ToolTip = 'Match statement lines with the assistance of Copilot';
Visible = CopilotActionsVisible;
+ Enabled = CopilotActionsVisible;
trigger OnAction()
var
@@ -56,9 +56,9 @@ pageextension 7254 BankAccReconciliationListExt extends "Bank Acc. Reconciliatio
trigger OnOpenPage()
var
- EnvironmentInformation: Codeunit "Environment Information";
+ CopilotCapability: Codeunit "Copilot Capability";
begin
- CopilotActionsVisible := EnvironmentInformation.IsSaaSInfrastructure();
+ CopilotActionsVisible := CopilotCapability.IsCapabilityRegistered(Enum::"Copilot Capability"::"Bank Account Reconciliation");
end;
var
diff --git a/Apps/W1/BankDeposits/app/src/codeunits/UpgradeBankDeposits.Codeunit.al b/Apps/W1/BankDeposits/app/src/codeunits/UpgradeBankDeposits.Codeunit.al
index 356f31ea11..1d693bd849 100644
--- a/Apps/W1/BankDeposits/app/src/codeunits/UpgradeBankDeposits.Codeunit.al
+++ b/Apps/W1/BankDeposits/app/src/codeunits/UpgradeBankDeposits.Codeunit.al
@@ -2,9 +2,6 @@ namespace Microsoft.Bank.Deposit;
using System.Environment;
using System.Upgrade;
-#if not CLEAN23
-using Microsoft.Finance.GeneralLedger.Setup;
-#endif
using Microsoft.Foundation.Reporting;
using System.Reflection;
using Microsoft.Bank.Reconciliation;
@@ -29,12 +26,6 @@ codeunit 1714 "Upgrade Bank Deposits"
exit;
if UpgradeTag.HasUpgradeTag(UpgTagDefBankDeposits.GetNADepositsUpgradeTag()) then
exit;
-#if not CLEAN23
- if FeatureWasAlreadyEnabled() then begin
- UpgradeTag.SetUpgradeTag(UpgTagDefBankDeposits.GetNADepositsUpgradeTag());
- exit;
- end;
-#endif
UpgradeNADepositsIntoBankDeposits();
UpgradeNABankRecWorksheetsIntoBankReconciliations();
#if not CLEAN24
@@ -44,19 +35,6 @@ codeunit 1714 "Upgrade Bank Deposits"
UpgradeTag.SetUpgradeTag(UpgTagDefBankDeposits.GetNADepositsUpgradeTag());
end;
-#if not CLEAN23
- local procedure FeatureWasAlreadyEnabled(): Boolean
- var
- GeneralLedgerSetup: Record "General Ledger Setup";
- RecordRef: RecordRef;
- begin
- if not GeneralLedgerSetup.Get() then
- exit(true);
- RecordRef.GetTable(GeneralLedgerSetup);
- exit(RecordRef.Field(10120).Value); // "Bank Recon. with Auto. Match"
- end;
-#endif
-
local procedure SetReportSelections()
var
ReportSelections: Record "Report Selections";
diff --git a/Apps/W1/BankDeposits/app/src/reports/BankDepositTestReport.Report.al b/Apps/W1/BankDeposits/app/src/reports/BankDepositTestReport.Report.al
index 529640df6d..b91cc310a2 100644
--- a/Apps/W1/BankDeposits/app/src/reports/BankDepositTestReport.Report.al
+++ b/Apps/W1/BankDeposits/app/src/reports/BankDepositTestReport.Report.al
@@ -514,7 +514,7 @@ report 1691 "Bank Deposit Test Report"
AmountApplied := AmountDue;
RemainingAmountToApply := RemainingAmountToApply - AmountPaid;
TotalAmountApplied := TotalAmountApplied + AmountApplied;
- CustomerLedgerEntryBalances.Set("Cust. Ledger Entry"."Entry No.", RemainingAmountToApply);
+ CustomerLedgerEntryBalances.Set("Cust. Ledger Entry"."Entry No.", "Cust. Ledger Entry"."Remaining Amount" - AmountApplied);
end;
trigger OnPreDataItem()
@@ -588,6 +588,15 @@ report 1691 "Bank Deposit Test Report"
trigger OnAfterGetRecord()
begin
+ if RemainingAmountToApply <= 0 then
+ CurrReport.Skip();
+ if VendorLedgerEntryBalances.ContainsKey("Vendor Ledger Entry"."Entry No.") then begin
+ if VendorLedgerEntryBalances.Get("Vendor Ledger Entry"."Entry No.") <= 0 then
+ CurrReport.Skip();
+ end
+ else
+ VendorLedgerEntryBalances.Add("Vendor Ledger Entry"."Entry No.", 0);
+
CalcFields("Remaining Amount");
if "Currency Code" <> Currency.Code then begin
"Remaining Amount" :=
@@ -643,6 +652,7 @@ report 1691 "Bank Deposit Test Report"
AmountApplied := AmountDue;
RemainingAmountToApply := RemainingAmountToApply - AmountPaid;
TotalAmountApplied := TotalAmountApplied + AmountApplied;
+ VendorLedgerEntryBalances.Set("Vendor Ledger Entry"."Entry No.", "Vendor Ledger Entry"."Remaining Amount" - AmountApplied);
end;
trigger OnPreDataItem()
@@ -1042,6 +1052,7 @@ report 1691 "Bank Deposit Test Report"
Dim1Number: Integer;
Dim2Number: Integer;
CustomerLedgerEntryBalances: Dictionary of [Integer, Decimal];
+ VendorLedgerEntryBalances: Dictionary of [Integer, Decimal];
CurrReport_PAGENOCaptionLbl: Label 'Page';
To_Be_Deposited_InCaptionLbl: Label 'To Be Deposited In';
Bank_Deposit_Header___Bank_Account_No__CaptionLbl: Label 'Bank Account No.';
diff --git a/Apps/W1/BankDeposits/test/src/UTReportBankDeposit.Codeunit.al b/Apps/W1/BankDeposits/test/src/UTReportBankDeposit.Codeunit.al
index 68db325755..b9be5c6c8a 100644
--- a/Apps/W1/BankDeposits/test/src/UTReportBankDeposit.Codeunit.al
+++ b/Apps/W1/BankDeposits/test/src/UTReportBankDeposit.Codeunit.al
@@ -15,6 +15,7 @@ codeunit 139767 "UT Report Bank Deposit"
LibraryRandom: Codeunit "Library - Random";
LibraryERM: Codeunit "Library - ERM";
LibrarySales: Codeunit "Library - Sales";
+ LibraryPurchase: Codeunit "Library - Purchase";
LibraryUtility: Codeunit "Library - Utility";
Initialized: Boolean;
InitializeHandled: Boolean;
@@ -546,6 +547,88 @@ codeunit 139767 "UT Report Bank Deposit"
BankDepositHeader.Delete();
end;
+ [Test]
+ [HandlerFunctions('DepositTestReportRequestPageHandler')]
+ procedure ApplyingTwoDepositLinesToTwoOpenCustomerEntriesEachShowInTestReport()
+ var
+ BankDepositHeader: Record "Bank Deposit Header";
+ Customer: Record Customer;
+ CustomerLedgerEntries: array[4] of Record "Cust. Ledger Entry";
+ FirstLine, SecondLine : Record "Gen. Journal Line";
+ begin
+ // [SCENARIO 543664] Applying two deposit lines to two open customer entries each should show the four lines on the Test Report
+ Initialize();
+ LibrarySales.CreateCustomer(Customer);
+ // [GIVEN] A bank deposit with two deposit lines
+ CreateBankDepositHeader(BankDepositHeader);
+ CreateGenJournalLine(FirstLine, BankDepositHeader, FirstLine."Account Type"::Customer, Customer."No.");
+ UpdateApplyToDocGenJournalLine(FirstLine);
+ CreateGenJournalLine(SecondLine, BankDepositHeader, SecondLine."Account Type"::Customer, Customer."No.");
+ UpdateApplyToDocGenJournalLine(SecondLine);
+ // [GIVEN] 4 open customer ledger entries
+ CreateCustomerLedgerEntry(CustomerLedgerEntries[1], 'INV1', Customer."No.");
+ CreateCustomerLedgerEntry(CustomerLedgerEntries[2], 'INV2', Customer."No.");
+ CreateCustomerLedgerEntry(CustomerLedgerEntries[3], 'INV3', Customer."No.");
+ CreateCustomerLedgerEntry(CustomerLedgerEntries[4], 'INV4', Customer."No.");
+ // [GIVEN] Each deposit line applied to two of the customer ledger entries
+ UpdateApplyToDocCustomerLedgerEntry(CustomerLedgerEntries[1], FirstLine);
+ UpdateApplyToDocCustomerLedgerEntry(CustomerLedgerEntries[2], FirstLine);
+ UpdateApplyToDocCustomerLedgerEntry(CustomerLedgerEntries[3], SecondLine);
+ UpdateApplyToDocCustomerLedgerEntry(CustomerLedgerEntries[4], SecondLine);
+ Commit();
+ // [WHEN] Running the test report
+ LibraryVariableStorage.Enqueue(BankDepositHeader."No.");
+ Report.Run(Report::"Bank Deposit Test Report");
+ LibraryReportDataSet.LoadDataSetFile();
+ // [THEN] The 4 invoices should appear in the report
+ LibraryReportDataSet.AssertElementWithValueExists('Cust__Ledger_Entry__Document_No__', 'INV1');
+ LibraryReportDataSet.AssertElementWithValueExists('Cust__Ledger_Entry__Document_No__', 'INV2');
+ LibraryReportDataSet.AssertElementWithValueExists('Cust__Ledger_Entry__Document_No__', 'INV3');
+ LibraryReportDataSet.AssertElementWithValueExists('Cust__Ledger_Entry__Document_No__', 'INV4');
+ BankDepositHeader.Delete();
+ end;
+
+ [Test]
+ [HandlerFunctions('DepositTestReportRequestPageHandler')]
+ procedure ApplyingTwoDepositLinesToTwoOpenVendorEntriesEachShowInTestReport()
+ var
+ BankDepositHeader: Record "Bank Deposit Header";
+ Vendor: Record Vendor;
+ FirstLine, SecondLine : Record "Gen. Journal Line";
+ VendorLedgerEntries: array[4] of Record "Vendor Ledger Entry";
+ begin
+ // [SCENARIO 543664] Applying two deposit lines to two open vendor entries each should show the four lines on the Test Report
+ Initialize();
+ LibraryPurchase.CreateVendor(Vendor);
+ // [GIVEN] A bank deposit with two deposit lines
+ CreateBankDepositHeader(BankDepositHeader);
+ CreateGenJournalLine(FirstLine, BankDepositHeader, FirstLine."Account Type"::Vendor, Vendor."No.");
+ UpdateApplyToDocGenJournalLine(FirstLine);
+ CreateGenJournalLine(SecondLine, BankDepositHeader, SecondLine."Account Type"::Vendor, Vendor."No.");
+ UpdateApplyToDocGenJournalLine(SecondLine);
+ // [GIVEN] 4 open customer ledger entries
+ CreateVendorLedgerEntry(VendorLedgerEntries[1], 'INV1', Vendor."No.");
+ CreateVendorLedgerEntry(VendorLedgerEntries[2], 'INV2', Vendor."No.");
+ CreateVendorLedgerEntry(VendorLedgerEntries[3], 'INV3', Vendor."No.");
+ CreateVendorLedgerEntry(VendorLedgerEntries[4], 'INV4', Vendor."No.");
+ // [GIVEN] Each deposit line applied to two of the customer ledger entries
+ UpdateApplyToDocVendorLedgerEntry(VendorLedgerEntries[1], FirstLine);
+ UpdateApplyToDocVendorLedgerEntry(VendorLedgerEntries[2], FirstLine);
+ UpdateApplyToDocVendorLedgerEntry(VendorLedgerEntries[3], SecondLine);
+ UpdateApplyToDocVendorLedgerEntry(VendorLedgerEntries[4], SecondLine);
+ Commit();
+ // [WHEN] Running the test report
+ LibraryVariableStorage.Enqueue(BankDepositHeader."No.");
+ Report.Run(Report::"Bank Deposit Test Report");
+ LibraryReportDataSet.LoadDataSetFile();
+ // [THEN] The 4 invoices should appear in the report
+ LibraryReportDataSet.AssertElementWithValueExists('Vendor_Ledger_Entry__Document_No__', 'INV1');
+ LibraryReportDataSet.AssertElementWithValueExists('Vendor_Ledger_Entry__Document_No__', 'INV2');
+ LibraryReportDataSet.AssertElementWithValueExists('Vendor_Ledger_Entry__Document_No__', 'INV3');
+ LibraryReportDataSet.AssertElementWithValueExists('Vendor_Ledger_Entry__Document_No__', 'INV4');
+ BankDepositHeader.Delete();
+ end;
+
local procedure Initialize()
begin
LibraryVariableStorage.Clear();
diff --git a/Apps/W1/BasicExperience/app/src/page/SalesRelationshipMgrRCBF.PageExt.al b/Apps/W1/BasicExperience/app/src/page/SalesRelationshipMgrRCBF.PageExt.al
index 1d826b63d2..c4763a0919 100644
--- a/Apps/W1/BasicExperience/app/src/page/SalesRelationshipMgrRCBF.PageExt.al
+++ b/Apps/W1/BasicExperience/app/src/page/SalesRelationshipMgrRCBF.PageExt.al
@@ -68,7 +68,7 @@ pageextension 20654 "Sales Relation ship Mgr RC BF" extends "Sales & Relationshi
{
ApplicationArea = RelationshipMgmt, BFBasic;
}
-#if not CLEAN23
+#if not CLEAN25
modify("Sales &Prices")
{
ApplicationArea = RelationshipMgmt, BFBasic;
diff --git a/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Manufacturing/ManufacturingDemoAccount.Table.al b/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Manufacturing/ManufacturingDemoAccount.Table.al
index d7fb418620..75f3b47d4b 100644
--- a/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Manufacturing/ManufacturingDemoAccount.Table.al
+++ b/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Manufacturing/ManufacturingDemoAccount.Table.al
@@ -2,13 +2,8 @@ table 4761 "Manufacturing Demo Account"
{
TableType = Temporary;
ObsoleteReason = 'This table will be replaced by "Contoso GL Account".';
-#if not CLEAN23
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-#else
ObsoleteState = Removed;
ObsoleteTag = '26.0';
-#endif
fields
{
diff --git a/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Manufacturing/ManufacturingDemoDataSetup.Table.al b/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Manufacturing/ManufacturingDemoDataSetup.Table.al
index 73ae2f832c..bc31a97bf6 100644
--- a/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Manufacturing/ManufacturingDemoDataSetup.Table.al
+++ b/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Manufacturing/ManufacturingDemoDataSetup.Table.al
@@ -3,13 +3,8 @@ table 4760 "Manufacturing Demo Data Setup"
ObsoleteReason = 'The table is moved to "Manufacturing Module Setup" table';
InherentEntitlements = rimdX;
InherentPermissions = rimdX;
-#if not CLEAN23
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-#else
ObsoleteState = Removed;
ObsoleteTag = '26.0';
-#endif
fields
{
diff --git a/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Warehousing/WhseDemoAccount.Table.al b/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Warehousing/WhseDemoAccount.Table.al
index b733c76577..d9db306077 100644
--- a/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Warehousing/WhseDemoAccount.Table.al
+++ b/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Warehousing/WhseDemoAccount.Table.al
@@ -3,13 +3,8 @@ table 4762 "Whse. Demo Account"
TableType = Temporary;
DataClassification = CustomerContent;
ObsoleteReason = 'This table will be replaced by "Contoso GL Account".';
-#if not CLEAN23
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-#else
ObsoleteState = Removed;
ObsoleteTag = '26.0';
-#endif
fields
{
diff --git a/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Warehousing/WhseDemoDataSetup.Table.al b/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Warehousing/WhseDemoDataSetup.Table.al
index 1b4d189a44..882161cf36 100644
--- a/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Warehousing/WhseDemoDataSetup.Table.al
+++ b/Apps/W1/ContosoCoffeeDemoDataset/app/DemoData/Warehousing/WhseDemoDataSetup.Table.al
@@ -4,13 +4,8 @@ table 4763 "Whse Demo Data Setup"
ObsoleteReason = 'The table is moved to "Warehouse Module Setup" table';
InherentEntitlements = rimdX;
InherentPermissions = rimdX;
-#if not CLEAN23
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-#else
ObsoleteState = Removed;
ObsoleteTag = '26.0';
-#endif
fields
{
diff --git a/Apps/W1/CreateProductInformationWithCopilot/app/BaseAppExtensions/ItemSubstitutionEntryExt.PageExt.al b/Apps/W1/CreateProductInformationWithCopilot/app/BaseAppExtensions/ItemSubstitutionEntryExt.PageExt.al
index e44946db3c..7c3fcbe9f2 100644
--- a/Apps/W1/CreateProductInformationWithCopilot/app/BaseAppExtensions/ItemSubstitutionEntryExt.PageExt.al
+++ b/Apps/W1/CreateProductInformationWithCopilot/app/BaseAppExtensions/ItemSubstitutionEntryExt.PageExt.al
@@ -3,7 +3,7 @@
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------
namespace Microsoft.Inventory.Item.Substitution;
-using System.Environment;
+using System.AI;
pageextension 7330 "Item Substitution Entry Ext." extends "Item Substitution Entry"
{
@@ -14,9 +14,11 @@ pageextension 7330 "Item Substitution Entry Ext." extends "Item Substitution Ent
action("Suggest Substitution Prompting")
{
ApplicationArea = All;
- Caption = 'Suggest substitutions';
+ Caption = 'Suggest with Copilot';
Image = SparkleFilled;
ToolTip = 'Get item substitution suggestion from Copilot';
+ Enabled = IsCapabilityRegistered;
+ Visible = IsCapabilityRegistered;
trigger OnAction()
begin
@@ -24,36 +26,17 @@ pageextension 7330 "Item Substitution Entry Ext." extends "Item Substitution Ent
end;
}
}
- addlast(processing)
- {
- action("Suggest Substitution")
- {
- ApplicationArea = All;
- Caption = 'Suggest substitutions';
- Image = SparkleFilled;
- ToolTip = 'Get item substitution suggestion from Copilot';
- Visible = ProcessingActionVisible;
-
- trigger OnAction()
- begin
- ItemSubstSuggestionImpl.GetItemSubstitutionSuggestion(Rec);
- end;
- }
- }
- addlast(Promoted)
- {
- actionref(SuggestSubstitution_Promoted; "Suggest Substitution") { }
- }
}
+ var
+ ItemSubstSuggestionImpl: Codeunit "Item Subst. Suggestion Impl.";
+ IsCapabilityRegistered: Boolean;
+
trigger OnOpenPage()
var
- EnvironmentInformation: Codeunit "Environment Information";
+ CopilotCapability: Codeunit "Copilot Capability";
begin
- ProcessingActionVisible := not EnvironmentInformation.IsSaaSInfrastructure();
+ IsCapabilityRegistered := CopilotCapability.IsCapabilityRegistered(Enum::"Copilot Capability"::"Create Product Information");
end;
- var
- ItemSubstSuggestionImpl: Codeunit "Item Subst. Suggestion Impl.";
- ProcessingActionVisible: Boolean;
}
\ No newline at end of file
diff --git a/Apps/W1/DataSearch/App/DataSearchSetupFieldList.Page.al b/Apps/W1/DataSearch/App/DataSearchSetupFieldList.Page.al
index 3cb7e41049..b35088eda9 100644
--- a/Apps/W1/DataSearch/App/DataSearchSetupFieldList.Page.al
+++ b/Apps/W1/DataSearch/App/DataSearchSetupFieldList.Page.al
@@ -56,7 +56,7 @@ page 2684 "Data Search Setup (Field) List"
field(OptimizeForTextSearch; Rec.OptimizeForTextSearch)
{
ApplicationArea = Basic, Suite;
- Caption = 'Optimized For Text Search';
+ Caption = 'Optimized for text search';
Editable = false;
ToolTip = 'Specifies whether this field is optimized for text search. If this field is optimized for text search, the search can be faster.';
}
diff --git a/Apps/W1/EDocument/app/src/Processing/EDocImport.Codeunit.al b/Apps/W1/EDocument/app/src/Processing/EDocImport.Codeunit.al
index 093637b10a..a7747705d4 100644
--- a/Apps/W1/EDocument/app/src/Processing/EDocImport.Codeunit.al
+++ b/Apps/W1/EDocument/app/src/Processing/EDocImport.Codeunit.al
@@ -24,23 +24,28 @@ codeunit 6140 "E-Doc. Import"
InStr: InStream;
FileName: Text;
begin
- if Page.RunModal(Page::"E-Document Services", EDocumentService) = Action::LookupOK then begin
- UploadIntoStream('', '', '', FileName, InStr);
+ if Page.RunModal(Page::"E-Document Services", EDocumentService) <> Action::LookupOK then
+ exit;
- TempBlob.CreateOutStream(OutStr);
- if CopyStream(OutStr, InStr) then begin
- EDocument.Direction := EDocument.Direction::Incoming;
- EDocument."Document Type" := Enum::"E-Document Type"::None;
- if EDocument."Entry No" = 0 then
- EDocument.Insert(true)
- else
- EDocument.Modify(true);
-
- EDocumentLog.InsertLog(EDocument, EDocumentService, TempBlob, Enum::"E-Document Service Status"::Imported);
- EDocumentProcessing.InsertServiceStatus(EDocument, EDocumentService, Enum::"E-Document Service Status"::Imported);
- EDocumentProcessing.ModifyEDocumentStatus(EDocument, Enum::"E-Document Service Status"::Imported);
- end;
+ if not UploadIntoStream('', '', '', FileName, InStr) then
+ exit;
+
+ TempBlob.CreateOutStream(OutStr);
+ CopyStream(OutStr, InStr);
+
+ EDocument.Direction := EDocument.Direction::Incoming;
+ EDocument."Document Type" := Enum::"E-Document Type"::None;
+
+ if EDocument."Entry No" = 0 then begin
+ EDocument.Insert(true);
+ EDocumentProcessing.InsertServiceStatus(EDocument, EDocumentService, Enum::"E-Document Service Status"::Imported);
+ end else begin
+ EDocument.Modify(true);
+ EDocumentProcessing.ModifyServiceStatus(EDocument, EDocumentService, Enum::"E-Document Service Status"::Imported);
end;
+
+ EDocumentLog.InsertLog(EDocument, EDocumentService, TempBlob, Enum::"E-Document Service Status"::Imported);
+ EDocumentProcessing.ModifyEDocumentStatus(EDocument, Enum::"E-Document Service Status"::Imported);
end;
internal procedure GetBasicInfo(var EDocument: Record "E-Document")
diff --git a/Apps/W1/EDocumentConnectors/Avalara/app/ExtensionLogo.png b/Apps/W1/EDocumentConnectors/Avalara/app/ExtensionLogo.png
new file mode 100644
index 0000000000..4d2c9a626c
Binary files /dev/null and b/Apps/W1/EDocumentConnectors/Avalara/app/ExtensionLogo.png differ
diff --git a/Apps/W1/EDocumentConnectors/Avalara/app/app.json b/Apps/W1/EDocumentConnectors/Avalara/app/app.json
new file mode 100644
index 0000000000..115bee31e0
--- /dev/null
+++ b/Apps/W1/EDocumentConnectors/Avalara/app/app.json
@@ -0,0 +1,55 @@
+{
+ "id": "f35c56a6-7c5f-4dbe-89c4-fef5145d00f4",
+ "name": "E-Document Connector - Avalara",
+ "publisher": "Microsoft",
+ "brief": "E-Document Connector - Avalara",
+ "description": "E-Document Connector - Avalara",
+ "version": "26.0.0.0",
+ "privacyStatement": "https://go.microsoft.com/fwlink/?LinkId=724009",
+ "EULA": "https://go.microsoft.com/fwlink/?linkid=2009120",
+ "help": "https://go.microsoft.com/fwlink/?linkid=2204541",
+ "url": "https://go.microsoft.com/fwlink/?LinkId=724011",
+ "logo": "ExtensionLogo.png",
+ "contextSensitiveHelpUrl": "https://go.microsoft.com/fwlink/?linkid=2206603",
+ "dependencies": [
+ {
+ "id": "e1d97edc-c239-46b4-8d84-6368bdf67c8b",
+ "name": "E-Document Core",
+ "publisher": "Microsoft",
+ "version": "26.0.0.0"
+ },
+ {
+ "id": "d852a468-263e-49e5-bfda-f09e33342b89",
+ "name": "E-Documents Connector with External Endpoints",
+ "publisher": "Microsoft",
+ "version": "26.0.0.0"
+ }
+ ],
+ "internalsVisibleTo": [
+ {
+ "id": "e1d97edc-c239-46b4-8d84-6368bdf67c8e",
+ "name": "E-Document Connector - Avalara Tests",
+ "publisher": "Microsoft"
+ }
+ ],
+ "screenshots": [
+
+ ],
+ "platform": "26.0.0.0",
+ "idRanges": [
+ {
+ "from": 6370,
+ "to": 6379
+ }
+ ],
+ "resourceExposurePolicy": {
+ "allowDebugging": true,
+ "allowDownloadingSource": true,
+ "includeSourceInSymbolFile": true
+ },
+ "application": "26.0.0.0",
+ "target": "OnPrem",
+ "features": [
+ "TranslationFile"
+ ]
+}
\ No newline at end of file
diff --git a/Apps/W1/EDocumentsConnector/app/src/Avalara/Authenticator.Codeunit.al b/Apps/W1/EDocumentConnectors/Avalara/app/src/Authenticator.Codeunit.al
similarity index 100%
rename from Apps/W1/EDocumentsConnector/app/src/Avalara/Authenticator.Codeunit.al
rename to Apps/W1/EDocumentConnectors/Avalara/app/src/Authenticator.Codeunit.al
diff --git a/Apps/W1/EDocumentsConnector/app/src/Avalara/Company.Table.al b/Apps/W1/EDocumentConnectors/Avalara/app/src/Company.Table.al
similarity index 97%
rename from Apps/W1/EDocumentsConnector/app/src/Avalara/Company.Table.al
rename to Apps/W1/EDocumentConnectors/Avalara/app/src/Company.Table.al
index acd185a9f1..8fcf359c64 100644
--- a/Apps/W1/EDocumentsConnector/app/src/Avalara/Company.Table.al
+++ b/Apps/W1/EDocumentConnectors/Avalara/app/src/Company.Table.al
@@ -4,7 +4,7 @@
// ------------------------------------------------------------------------------------------------
namespace Microsoft.EServices.EDocumentConnector.Avalara;
-table 6365 "Company"
+table 6375 "Company"
{
DataClassification = CustomerContent;
TableType = Temporary;
diff --git a/Apps/W1/EDocumentsConnector/app/src/Avalara/CompanyList.Page.al b/Apps/W1/EDocumentConnectors/Avalara/app/src/CompanyList.Page.al
similarity index 98%
rename from Apps/W1/EDocumentsConnector/app/src/Avalara/CompanyList.Page.al
rename to Apps/W1/EDocumentConnectors/Avalara/app/src/CompanyList.Page.al
index c7ddb6c48f..622e7ff36b 100644
--- a/Apps/W1/EDocumentsConnector/app/src/Avalara/CompanyList.Page.al
+++ b/Apps/W1/EDocumentConnectors/Avalara/app/src/CompanyList.Page.al
@@ -4,7 +4,7 @@
// ------------------------------------------------------------------------------------------------
namespace Microsoft.EServices.EDocumentConnector.Avalara;
-page 6363 "Company List"
+page 6373 "Company List"
{
PageType = List;
ApplicationArea = Basic, Suite;
diff --git a/Apps/W1/EDocumentsConnector/app/src/Avalara/ConnectionSetup.Table.al b/Apps/W1/EDocumentConnectors/Avalara/app/src/ConnectionSetup.Table.al
similarity index 98%
rename from Apps/W1/EDocumentsConnector/app/src/Avalara/ConnectionSetup.Table.al
rename to Apps/W1/EDocumentConnectors/Avalara/app/src/ConnectionSetup.Table.al
index d03c7a2f2c..b2f6aa018e 100644
--- a/Apps/W1/EDocumentsConnector/app/src/Avalara/ConnectionSetup.Table.al
+++ b/Apps/W1/EDocumentConnectors/Avalara/app/src/ConnectionSetup.Table.al
@@ -6,7 +6,7 @@ namespace Microsoft.EServices.EDocumentConnector.Avalara;
using Microsoft.EServices.EDocumentConnector;
-table 6362 "Connection Setup"
+table 6372 "Connection Setup"
{
fields
{
diff --git a/Apps/W1/EDocumentsConnector/app/src/Avalara/ConnectionSetupCard.Page.al b/Apps/W1/EDocumentConnectors/Avalara/app/src/ConnectionSetupCard.Page.al
similarity index 99%
rename from Apps/W1/EDocumentsConnector/app/src/Avalara/ConnectionSetupCard.Page.al
rename to Apps/W1/EDocumentConnectors/Avalara/app/src/ConnectionSetupCard.Page.al
index 86aa916407..dcf986f48f 100644
--- a/Apps/W1/EDocumentsConnector/app/src/Avalara/ConnectionSetupCard.Page.al
+++ b/Apps/W1/EDocumentConnectors/Avalara/app/src/ConnectionSetupCard.Page.al
@@ -6,7 +6,7 @@ namespace Microsoft.EServices.EDocumentConnector.Avalara;
using System.Telemetry;
-page 6362 "Connection Setup Card"
+page 6372 "Connection Setup Card"
{
PageType = Card;
SourceTable = "Connection Setup";
diff --git a/Apps/W1/EDocumentsConnector/app/src/Avalara/Extensions/EDocService.PageExt.al b/Apps/W1/EDocumentConnectors/Avalara/app/src/Extensions/EDocService.PageExt.al
similarity index 93%
rename from Apps/W1/EDocumentsConnector/app/src/Avalara/Extensions/EDocService.PageExt.al
rename to Apps/W1/EDocumentConnectors/Avalara/app/src/Extensions/EDocService.PageExt.al
index 51ec04dfec..7d48445ff1 100644
--- a/Apps/W1/EDocumentsConnector/app/src/Avalara/Extensions/EDocService.PageExt.al
+++ b/Apps/W1/EDocumentConnectors/Avalara/app/src/Extensions/EDocService.PageExt.al
@@ -6,7 +6,7 @@ namespace Microsoft.EServices.EDocumentConnector.Avalara;
using Microsoft.eServices.EDocument;
-pageextension 6361 "E-Doc. Service" extends "E-Document Service"
+pageextension 6371 "E-Doc. Service" extends "E-Document Service"
{
layout
{
diff --git a/Apps/W1/EDocumentsConnector/app/src/Avalara/Extensions/EDocService.TableExt.al b/Apps/W1/EDocumentConnectors/Avalara/app/src/Extensions/EDocService.TableExt.al
similarity index 90%
rename from Apps/W1/EDocumentsConnector/app/src/Avalara/Extensions/EDocService.TableExt.al
rename to Apps/W1/EDocumentConnectors/Avalara/app/src/Extensions/EDocService.TableExt.al
index a613383471..ecd0365255 100644
--- a/Apps/W1/EDocumentsConnector/app/src/Avalara/Extensions/EDocService.TableExt.al
+++ b/Apps/W1/EDocumentConnectors/Avalara/app/src/Extensions/EDocService.TableExt.al
@@ -6,7 +6,7 @@ namespace Microsoft.EServices.EDocumentConnector.Avalara;
using Microsoft.eServices.EDocument;
-tableextension 6360 "E-Doc. Service" extends "E-Document Service"
+tableextension 6370 "E-Doc. Service" extends "E-Document Service"
{
fields
{
diff --git a/Apps/W1/EDocumentsConnector/app/src/Avalara/HttpExecutor.Codeunit.al b/Apps/W1/EDocumentConnectors/Avalara/app/src/HttpExecutor.Codeunit.al
similarity index 100%
rename from Apps/W1/EDocumentsConnector/app/src/Avalara/HttpExecutor.Codeunit.al
rename to Apps/W1/EDocumentConnectors/Avalara/app/src/HttpExecutor.Codeunit.al
diff --git a/Apps/W1/EU3PartyTradePurchase/app/src/Enums/FeatureToUpdateEU3PartyTrade.EnumExt.al b/Apps/W1/EDocumentConnectors/Avalara/app/src/Integration.EnumExt.al
similarity index 54%
rename from Apps/W1/EU3PartyTradePurchase/app/src/Enums/FeatureToUpdateEU3PartyTrade.EnumExt.al
rename to Apps/W1/EDocumentConnectors/Avalara/app/src/Integration.EnumExt.al
index 974bf0932c..b964d57e00 100644
--- a/Apps/W1/EU3PartyTradePurchase/app/src/Enums/FeatureToUpdateEU3PartyTrade.EnumExt.al
+++ b/Apps/W1/EDocumentConnectors/Avalara/app/src/Integration.EnumExt.al
@@ -1,17 +1,15 @@
-#if not CLEAN23
// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------
-namespace Microsoft.Finance.EU3PartyTrade;
+namespace Microsoft.EServices.EDocumentConnector.Avalara;
-using System.Environment.Configuration;
+using Microsoft.eServices.EDocument;
-enumextension 4880 "Feature To Update - EU3 Party Trade" extends "Feature To Update"
+enumextension 6370 Integration extends "E-Document Integration"
{
- value(4880; EU3PartyTradePurchase)
+ value(6370; "Avalara")
{
- Implementation = "Feature Data Update" = "EU3 Feature Data Update";
+ Implementation = "E-Document Integration" = "Integration Impl.";
}
-}
-#endif
\ No newline at end of file
+}
\ No newline at end of file
diff --git a/Apps/W1/EDocumentsConnector/app/src/Avalara/IntegrationImpl.Codeunit.al b/Apps/W1/EDocumentConnectors/Avalara/app/src/IntegrationImpl.Codeunit.al
similarity index 100%
rename from Apps/W1/EDocumentsConnector/app/src/Avalara/IntegrationImpl.Codeunit.al
rename to Apps/W1/EDocumentConnectors/Avalara/app/src/IntegrationImpl.Codeunit.al
diff --git a/Apps/W1/EDocumentsConnector/app/src/Avalara/MandateList.Page.al b/Apps/W1/EDocumentConnectors/Avalara/app/src/MandateList.Page.al
similarity index 98%
rename from Apps/W1/EDocumentsConnector/app/src/Avalara/MandateList.Page.al
rename to Apps/W1/EDocumentConnectors/Avalara/app/src/MandateList.Page.al
index 94909c05e1..c0c67dda70 100644
--- a/Apps/W1/EDocumentsConnector/app/src/Avalara/MandateList.Page.al
+++ b/Apps/W1/EDocumentConnectors/Avalara/app/src/MandateList.Page.al
@@ -4,7 +4,7 @@
// ------------------------------------------------------------------------------------------------
namespace Microsoft.EServices.EDocumentConnector.Avalara;
-page 6364 "Mandate List"
+page 6370 "Mandate List"
{
PageType = List;
SourceTable = "Mandate";
diff --git a/Apps/W1/EDocumentsConnector/app/src/Avalara/Models/Mandate.Table.al b/Apps/W1/EDocumentConnectors/Avalara/app/src/Models/Mandate.Table.al
similarity index 98%
rename from Apps/W1/EDocumentsConnector/app/src/Avalara/Models/Mandate.Table.al
rename to Apps/W1/EDocumentConnectors/Avalara/app/src/Models/Mandate.Table.al
index bcf4571090..e846c81f45 100644
--- a/Apps/W1/EDocumentsConnector/app/src/Avalara/Models/Mandate.Table.al
+++ b/Apps/W1/EDocumentConnectors/Avalara/app/src/Models/Mandate.Table.al
@@ -8,7 +8,7 @@ namespace Microsoft.EServices.EDocumentConnector.Avalara;
/// Model of Avalara Mandate
/// https://developer.avalara.com/api-reference/e-invoicing/einvoice/models/Mandate/
///
-table 6363 Mandate
+table 6371 Mandate
{
DataClassification = SystemMetadata;
TableType = Temporary;
diff --git a/Apps/W1/EDocumentsConnector/app/src/Avalara/Models/Metadata.Codeunit.al b/Apps/W1/EDocumentConnectors/Avalara/app/src/Models/Metadata.Codeunit.al
similarity index 100%
rename from Apps/W1/EDocumentsConnector/app/src/Avalara/Models/Metadata.Codeunit.al
rename to Apps/W1/EDocumentConnectors/Avalara/app/src/Models/Metadata.Codeunit.al
diff --git a/Apps/W1/EDocumentConnectors/Avalara/app/src/Permissions/AvlEDocConnectorEdit.PermissionSetExt.al b/Apps/W1/EDocumentConnectors/Avalara/app/src/Permissions/AvlEDocConnectorEdit.PermissionSetExt.al
new file mode 100644
index 0000000000..5851b1d87f
--- /dev/null
+++ b/Apps/W1/EDocumentConnectors/Avalara/app/src/Permissions/AvlEDocConnectorEdit.PermissionSetExt.al
@@ -0,0 +1,12 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.EServices.EDocumentConnector.Avalara;
+
+using Microsoft.EServices.EDocumentConnector;
+
+permissionsetextension 6374 "Avl. EDoc. Connector - Edit" extends "EDocConnector - Edit"
+{
+ IncludedPermissionSets = Edit;
+}
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Avalara/app/src/Permissions/AvlEDocConnectorRead.PermissionSetExt.al b/Apps/W1/EDocumentConnectors/Avalara/app/src/Permissions/AvlEDocConnectorRead.PermissionSetExt.al
new file mode 100644
index 0000000000..afb4ac1a63
--- /dev/null
+++ b/Apps/W1/EDocumentConnectors/Avalara/app/src/Permissions/AvlEDocConnectorRead.PermissionSetExt.al
@@ -0,0 +1,11 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.EServices.EDocumentConnector.Avalara;
+using Microsoft.EServices.EDocumentConnector;
+
+permissionsetextension 6372 "Avl. EDoc. Connector - Read" extends "EDocConnector - Read"
+{
+ IncludedPermissionSets = Read;
+}
\ No newline at end of file
diff --git a/Apps/W1/OnPrem Permissions/app/Permissions/General Ledger/Account Schedules/glaccsched.permissionset.al b/Apps/W1/EDocumentConnectors/Avalara/app/src/Permissions/Edit.PermissionSet.al
similarity index 59%
rename from Apps/W1/OnPrem Permissions/app/Permissions/General Ledger/Account Schedules/glaccsched.permissionset.al
rename to Apps/W1/EDocumentConnectors/Avalara/app/src/Permissions/Edit.PermissionSet.al
index 3cbd11bee8..6a6d740465 100644
--- a/Apps/W1/OnPrem Permissions/app/Permissions/General Ledger/Account Schedules/glaccsched.permissionset.al
+++ b/Apps/W1/EDocumentConnectors/Avalara/app/src/Permissions/Edit.PermissionSet.al
@@ -1,18 +1,15 @@
-#if not CLEAN23
// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------
+namespace Microsoft.EServices.EDocumentConnector.Avalara;
-permissionset 5418 "G/L-ACC SCHED"
+permissionset 6372 Edit
{
Access = Public;
Assignable = true;
- Caption = 'Read account schedules';
- ObsoleteReason = 'Use Account Schedules - View instead.';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
+ IncludedPermissionSets = Read;
+ Caption = 'Avalara E-Document Connector - Edit';
- IncludedPermissionSets = "Account Schedules - View";
-}
-#endif
\ No newline at end of file
+ Permissions = tabledata "Connection Setup" = imd;
+}
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Avalara/app/src/Permissions/Objects.PermissionSet.al b/Apps/W1/EDocumentConnectors/Avalara/app/src/Permissions/Objects.PermissionSet.al
new file mode 100644
index 0000000000..f65114101e
--- /dev/null
+++ b/Apps/W1/EDocumentConnectors/Avalara/app/src/Permissions/Objects.PermissionSet.al
@@ -0,0 +1,26 @@
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.EServices.EDocumentConnector.Avalara;
+
+using Microsoft.EServices.EDocumentConnector.Avalara.Models;
+
+permissionset 6370 Objects
+{
+ Access = Public;
+ Assignable = false;
+ Caption = 'Avalara E-Document Connector - Objects';
+
+ Permissions =
+ table "Connection Setup" = X,
+ page "Mandate List" = X,
+ page "Connection Setup Card" = X,
+ page "Company List" = X,
+ codeunit "Integration Impl." = X,
+ codeunit Processing = X,
+ codeunit Authenticator = X,
+ codeunit Requests = X,
+ codeunit "Http Executor" = X,
+ codeunit Metadata = X;
+}
\ No newline at end of file
diff --git a/Apps/W1/OnPrem Permissions/app/Permissions/General Ledger/Account Schedules/glaccschededit.permissionset.al b/Apps/W1/EDocumentConnectors/Avalara/app/src/Permissions/Read.PermissionSet.al
similarity index 59%
rename from Apps/W1/OnPrem Permissions/app/Permissions/General Ledger/Account Schedules/glaccschededit.permissionset.al
rename to Apps/W1/EDocumentConnectors/Avalara/app/src/Permissions/Read.PermissionSet.al
index 62aaa825c5..efffe86a2c 100644
--- a/Apps/W1/OnPrem Permissions/app/Permissions/General Ledger/Account Schedules/glaccschededit.permissionset.al
+++ b/Apps/W1/EDocumentConnectors/Avalara/app/src/Permissions/Read.PermissionSet.al
@@ -1,18 +1,14 @@
-#if not CLEAN23
// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------
+namespace Microsoft.EServices.EDocumentConnector.Avalara;
-permissionset 3633 "G/L-ACC SCHED, EDIT"
+permissionset 6371 Read
{
Access = Public;
Assignable = true;
- Caption = 'Edit account schedules';
- ObsoleteReason = 'Use Account Schedules - Edit instead.';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
+ Caption = 'Avalara E-Document Connector - Read';
- IncludedPermissionSets = "Account Schedules - Edit";
-}
-#endif
\ No newline at end of file
+ Permissions = tabledata "Connection Setup" = r;
+}
\ No newline at end of file
diff --git a/Apps/W1/EDocumentsConnector/app/src/Avalara/Processing.Codeunit.al b/Apps/W1/EDocumentConnectors/Avalara/app/src/Processing.Codeunit.al
similarity index 100%
rename from Apps/W1/EDocumentsConnector/app/src/Avalara/Processing.Codeunit.al
rename to Apps/W1/EDocumentConnectors/Avalara/app/src/Processing.Codeunit.al
diff --git a/Apps/W1/EDocumentsConnector/app/src/Avalara/Requests.Codeunit.al b/Apps/W1/EDocumentConnectors/Avalara/app/src/Requests.Codeunit.al
similarity index 100%
rename from Apps/W1/EDocumentsConnector/app/src/Avalara/Requests.Codeunit.al
rename to Apps/W1/EDocumentConnectors/Avalara/app/src/Requests.Codeunit.al
diff --git a/Apps/W1/EDocumentConnectors/Avalara/test/ExtensionLogo.png b/Apps/W1/EDocumentConnectors/Avalara/test/ExtensionLogo.png
new file mode 100644
index 0000000000..4d2c9a626c
Binary files /dev/null and b/Apps/W1/EDocumentConnectors/Avalara/test/ExtensionLogo.png differ
diff --git a/Apps/W1/EDocumentConnectors/Avalara/test/app.json b/Apps/W1/EDocumentConnectors/Avalara/test/app.json
new file mode 100644
index 0000000000..18c1bd8fbe
--- /dev/null
+++ b/Apps/W1/EDocumentConnectors/Avalara/test/app.json
@@ -0,0 +1,84 @@
+{
+ "id": "e1d97edc-c239-46b4-8d84-6368bdf67c8e",
+ "name": "E-Document Connector - Avalara Tests",
+ "publisher": "Microsoft",
+ "brief": "E-Document Connector - Avalara Tests",
+ "description": "E-Document Connector - Avalara Tests",
+ "version": "26.0.0.0",
+ "privacyStatement": "https://go.microsoft.com/fwlink/?LinkId=724009",
+ "EULA": "https://go.microsoft.com/fwlink/?linkid=2009120",
+ "help": "https://go.microsoft.com/fwlink/?linkid=2204541",
+ "url": "https://go.microsoft.com/fwlink/?LinkId=724011",
+ "logo": "ExtensionLogo.png",
+ "contextSensitiveHelpUrl": "https://go.microsoft.com/fwlink/?linkid=2206603",
+ "dependencies": [
+ {
+ "id": "e1d97edc-c239-46b4-8d84-6368bdf67c8b",
+ "name": "E-Document Core",
+ "publisher": "Microsoft",
+ "version": "26.0.0.0"
+ },
+ {
+ "id": "f35c56a6-7c5f-4dbe-89c4-fef5145d00f4",
+ "name": "E-Document Connector - Avalara",
+ "publisher": "Microsoft",
+ "version": "26.0.0.0"
+ },
+ {
+ "id": "d852a468-263e-49e5-bfda-f09e33342b89",
+ "name": "E-Documents Connector with External Endpoints",
+ "publisher": "Microsoft",
+ "version": "26.0.0.0"
+ },
+ {
+ "id": "e1d97edc-c239-46b4-8d84-6368bdf67c8c",
+ "name": "E-Document Core Tests",
+ "publisher": "Microsoft",
+ "version": "26.0.0.0"
+ },
+ {
+ "id": "5d86850b-0d76-4eca-bd7b-951ad998e997",
+ "name": "Tests-TestLibraries",
+ "publisher": "Microsoft",
+ "version": "26.0.0.0"
+ },
+ {
+ "id": "9856ae4f-d1a7-46ef-89bb-6ef056398228",
+ "name": "System Application Test Library",
+ "publisher": "Microsoft",
+ "version": "26.0.0.0"
+ },
+ {
+ "id": "5095f467-0a01-4b99-99d1-9ff1237d286f",
+ "publisher": "Microsoft",
+ "name": "Library Variable Storage",
+ "version": "26.0.0.0"
+ },
+ {
+ "id": "40860557-a18d-42ad-aecb-22b7dd80dc80",
+ "name": "Permissions Mock",
+ "publisher": "Microsoft",
+ "version": "26.0.0.0"
+ }
+ ],
+ "screenshots": [
+
+ ],
+ "platform": "26.0.0.0",
+ "idRanges": [
+ {
+ "from": 148191,
+ "to": 148192
+ }
+ ],
+ "resourceExposurePolicy": {
+ "allowDebugging": true,
+ "allowDownloadingSource": true,
+ "includeSourceInSymbolFile": true
+ },
+ "application": "26.0.0.0",
+ "target": "OnPrem",
+ "features": [
+ "TranslationFile"
+ ]
+}
\ No newline at end of file
diff --git a/Apps/W1/EDocumentsConnector/test/src/Avalara/IntegrationTests.Codeunit.al b/Apps/W1/EDocumentConnectors/Avalara/test/src/IntegrationTests.Codeunit.al
similarity index 100%
rename from Apps/W1/EDocumentsConnector/test/src/Avalara/IntegrationTests.Codeunit.al
rename to Apps/W1/EDocumentConnectors/Avalara/test/src/IntegrationTests.Codeunit.al
diff --git a/Apps/W1/EDocumentsConnector/app/app.json b/Apps/W1/EDocumentsConnector/app/app.json
index 301840542b..dc11bcf4af 100644
--- a/Apps/W1/EDocumentsConnector/app/app.json
+++ b/Apps/W1/EDocumentsConnector/app/app.json
@@ -31,7 +31,7 @@
"idRanges": [
{
"from": 6360,
- "to": 6379
+ "to": 6369
}
],
"resourceExposurePolicy": {
@@ -40,5 +40,8 @@
"includeSourceInSymbolFile": true
},
"application": "26.0.0.0",
- "target": "OnPrem"
+ "target": "OnPrem",
+ "features": [
+ "TranslationFile"
+ ]
}
diff --git a/Apps/W1/EDocumentsConnector/app/src/E3Party/EDocExtIntegration.EnumExt.al b/Apps/W1/EDocumentsConnector/app/src/E3Party/EDocExtIntegration.EnumExt.al
index 790b3c4627..59dc7a2dff 100644
--- a/Apps/W1/EDocumentsConnector/app/src/E3Party/EDocExtIntegration.EnumExt.al
+++ b/Apps/W1/EDocumentsConnector/app/src/E3Party/EDocExtIntegration.EnumExt.al
@@ -12,8 +12,4 @@ enumextension 6363 "E-Doc. Ext. Integration" extends "E-Document Integration"
{
Implementation = "E-Document Integration" = "Pagero Integration Impl.";
}
- value(6362; "Avalara")
- {
- Implementation = "E-Document Integration" = Microsoft.EServices.EDocumentConnector.Avalara."Integration Impl.";
- }
}
\ No newline at end of file
diff --git a/Apps/W1/EDocumentsConnector/app/src/Pagero/PageroProcessing.Codeunit.al b/Apps/W1/EDocumentsConnector/app/src/Pagero/PageroProcessing.Codeunit.al
index d0cd7e1cf5..b6d0eb6e1d 100644
--- a/Apps/W1/EDocumentsConnector/app/src/Pagero/PageroProcessing.Codeunit.al
+++ b/Apps/W1/EDocumentsConnector/app/src/Pagero/PageroProcessing.Codeunit.al
@@ -540,9 +540,9 @@ codeunit 6369 "Pagero Processing"
if Value = 'Received' then begin
TempNameValueBuffer.Init();
- TempNameValueBuffer.Name := DocumentId;
- TempNameValueBuffer.Value := DocumentNo;
- TempNameValueBuffer."Value Long" := Status;
+ TempNameValueBuffer.Name := CopyStr(DocumentId, 1, 250);
+ TempNameValueBuffer.Value := CopyStr(DocumentNo, 1, 250);
+ TempNameValueBuffer."Value Long" := CopyStr(Status, 1, 2048);
TempNameValueBuffer.Insert();
end;
end;
diff --git a/Apps/W1/EDocumentsConnector/app/src/Permissions/EDocConnectorEdit.PermissionSet.al b/Apps/W1/EDocumentsConnector/app/src/Permissions/EDocConnectorEdit.PermissionSet.al
index 88f0f656e6..119ada8223 100644
--- a/Apps/W1/EDocumentsConnector/app/src/Permissions/EDocConnectorEdit.PermissionSet.al
+++ b/Apps/W1/EDocumentsConnector/app/src/Permissions/EDocConnectorEdit.PermissionSet.al
@@ -10,6 +10,5 @@ permissionset 6361 "EDocConnector - Edit"
Assignable = true;
IncludedPermissionSets = "EDocConnector - Read";
- Permissions = tabledata "E-Doc. Ext. Connection Setup" = IM,
- tabledata Microsoft.EServices.EDocumentConnector.Avalara."Connection Setup" = imd;
+ Permissions = tabledata "E-Doc. Ext. Connection Setup" = IM;
}
\ No newline at end of file
diff --git a/Apps/W1/EDocumentsConnector/app/src/Permissions/EDocConnectorObjects.PermissionSet.al b/Apps/W1/EDocumentsConnector/app/src/Permissions/EDocConnectorObjects.PermissionSet.al
index f5fb6cb8e0..10100bd37a 100644
--- a/Apps/W1/EDocumentsConnector/app/src/Permissions/EDocConnectorObjects.PermissionSet.al
+++ b/Apps/W1/EDocumentsConnector/app/src/Permissions/EDocConnectorObjects.PermissionSet.al
@@ -16,11 +16,5 @@ permissionset 6363 "EDoc. Connector Objects"
codeunit "Pagero Connection" = X,
codeunit "Pagero Integration Impl." = X,
codeunit "Pagero Processing" = X,
- codeunit "Pagero Application Response" = X,
- codeunit Microsoft.EServices.EDocumentConnector.Avalara."Integration Impl." = X,
- codeunit Microsoft.EServices.EDocumentConnector.Avalara.Processing = X,
- codeunit Microsoft.EServices.EDocumentConnector.Avalara.Authenticator = X,
- codeunit Microsoft.EServices.EDocumentConnector.Avalara.Requests = X,
- codeunit Microsoft.EServices.EDocumentConnector.Avalara."Http Executor" = X,
- codeunit Microsoft.EServices.EDocumentConnector.Avalara.Models.Metadata = X;
+ codeunit "Pagero Application Response" = X;
}
\ No newline at end of file
diff --git a/Apps/W1/EDocumentsConnector/app/src/Permissions/EDocConnectorRead.PermissionSet.al b/Apps/W1/EDocumentsConnector/app/src/Permissions/EDocConnectorRead.PermissionSet.al
index 07be9b89a6..13aa38d033 100644
--- a/Apps/W1/EDocumentsConnector/app/src/Permissions/EDocConnectorRead.PermissionSet.al
+++ b/Apps/W1/EDocumentsConnector/app/src/Permissions/EDocConnectorRead.PermissionSet.al
@@ -10,6 +10,5 @@ permissionset 6362 "EDocConnector - Read"
Assignable = true;
IncludedPermissionSets = "EDoc. Connector Objects";
- Permissions = tabledata "E-Doc. Ext. Connection Setup" = R,
- tabledata Microsoft.EServices.EDocumentConnector.Avalara."Connection Setup" = r;
+ Permissions = tabledata "E-Doc. Ext. Connection Setup" = R;
}
\ No newline at end of file
diff --git a/Apps/W1/EDocumentsConnector/test/app.json b/Apps/W1/EDocumentsConnector/test/app.json
index fc7efb38e9..57a2cdf191 100644
--- a/Apps/W1/EDocumentsConnector/test/app.json
+++ b/Apps/W1/EDocumentsConnector/test/app.json
@@ -71,5 +71,8 @@
"includeSourceInSymbolFile": true
},
"application": "26.0.0.0",
- "target": "OnPrem"
+ "target": "OnPrem",
+ "features": [
+ "TranslationFile"
+ ]
}
\ No newline at end of file
diff --git a/Apps/W1/EU3PartyTradePurchase/app/permissions/EU3PartyTradeObjects.permissionset.al b/Apps/W1/EU3PartyTradePurchase/app/permissions/EU3PartyTradeObjects.permissionset.al
index 748eaa889f..ff8dac5042 100644
--- a/Apps/W1/EU3PartyTradePurchase/app/permissions/EU3PartyTradeObjects.permissionset.al
+++ b/Apps/W1/EU3PartyTradePurchase/app/permissions/EU3PartyTradeObjects.permissionset.al
@@ -13,8 +13,5 @@ permissionset 4880 "EU3PartyTrade - Objects"
codeunit "EU3 Party Trade Feature Mgt." = X,
codeunit "EU3 Purch.-Get Drop Shpt Sbscr" = X,
codeunit "EU3 Req. Wksh. Subscribers" = X,
-#if not CLEAN23
- codeunit "EU3 Feature Data Update" = X,
-#endif
codeunit "EU3 VAT Stat. Subscribers" = X;
}
\ No newline at end of file
diff --git a/Apps/W1/EU3PartyTradePurchase/app/src/Codeunits/EU3FeatureDataUpdate.Codeunit.al b/Apps/W1/EU3PartyTradePurchase/app/src/Codeunits/EU3FeatureDataUpdate.Codeunit.al
deleted file mode 100644
index 7a4baad99d..0000000000
--- a/Apps/W1/EU3PartyTradePurchase/app/src/Codeunits/EU3FeatureDataUpdate.Codeunit.al
+++ /dev/null
@@ -1,177 +0,0 @@
-#if not CLEAN23
-///
-/// EU 3-Party Trade Purchase feature will be moved to a separate app.
-///
-codeunit 4886 "EU3 Feature Data Update" implements "Feature Data Update"
-{
- Access = Internal;
- Permissions = TableData "Feature Data Update Status" = rm,
- TableData "Purchase Header" = rm,
- TableData "Purch. Inv. Header" = rm,
- TableData "Purch. Cr. Memo Hdr." = rm,
- TableData "VAT Setup" = rim;
-
- procedure IsDataUpdateRequired(): Boolean;
- var
- PurchaseHeader: Record "Purchase Header";
- PurchInvHeader: Record "Purch. Inv. Header";
- PurchCrMemoHdr: Record "Purch. Cr. Memo Hdr.";
- VATStatementLine: Record "VAT Statement Line";
- begin
- CountRecords(Database::"Purchase Header", PurchaseHeader.TableCaption, 11200); //PurchaseHeader.FieldNo("EU 3-Party Trade"));
- CountRecords(Database::"Purch. Inv. Header", PurchInvHeader.TableCaption, 11200); //PurchInvHeader.FieldNo("EU 3-Party Trade"));
- CountRecords(Database::"Purch. Cr. Memo Hdr.", PurchCrMemoHdr.TableCaption, 11200); //PurchCrMemoHdr.FieldNo("EU 3-Party Trade"));
- CountRecords(Database::"VAT Statement Line", VATStatementLine.TableCaption, 11200); //VATStatementLine.FieldNo("EU 3-Party Trade"));
- exit(not TempDocumentEntry.IsEmpty());
- end;
-
- procedure ReviewData();
- var
- DataUpgradeOverview: Page "Data Upgrade Overview";
- begin
- Commit();
- Clear(DataUpgradeOverview);
- DataUpgradeOverview.Set(TempDocumentEntry);
- DataUpgradeOverview.RunModal();
- end;
-
- procedure UpdateData(FeatureDataUpdateStatus: Record "Feature Data Update Status");
- var
- StartDateTime: DateTime;
- EndDateTime: DateTime;
- begin
- StartDateTime := CurrentDateTime;
- FeatureDataUpdateMgt.LogTask(FeatureDataUpdateStatus, 'UpgradeEU3PartyTradePurchase', StartDateTime);
- UpgradeEU3PartyTradePurchase();
- EndDateTime := CurrentDateTime;
- FeatureDataUpdateMgt.LogTask(FeatureDataUpdateStatus, 'UpgradeEU3PartyTradePurchase', EndDateTime);
- end;
-
- procedure AfterUpdate(FeatureDataUpdateStatus: Record "Feature Data Update Status");
- begin
- end;
-
- procedure GetTaskDescription() TaskDescription: Text;
- begin
- TaskDescription := GetListOfTables();
- end;
-
- local procedure GetListOfTables() Result: Text;
- begin
- Result := StrSubstNo(DescriptionTxt, PurchaseHdrTxt, PurchaseInvHdrTxt, PurchaseCrMemoHdrTxt, VATStatementLineTxt);
- OnAfterGetListOfTables(Result);
- end;
-
- local procedure UpgradeEU3PartyTradePurchase()
- var
- Company: Record Company;
- PurchaseHeader: Record "Purchase Header";
- PurchInvHeader: Record "Purch. Inv. Header";
- PurchCrMemoHdr: Record "Purch. Cr. Memo Hdr.";
- VATStatementLine: Record "VAT Statement Line";
- begin
- if Company.FindSet() then
- repeat
- UpdateRecords(Database::"Purchase Header", 11200, PurchaseHeader.FieldNo("EU 3 Party Trade"), Company);
- UpdateRecords(Database::"Purch. Inv. Header", 11200, PurchInvHeader.FieldNo("EU 3 Party Trade"), Company);
- UpdateRecords(Database::"Purch. Cr. Memo Hdr.", 11200, PurchCrMemoHdr.FieldNo("EU 3 Party Trade"), Company);
- UpdateRecords(Database::"VAT Statement Line", 11200, VATStatementLine.FieldNo("EU 3 Party Trade"), Company);
- until Company.Next() = 0;
- end;
-
- local procedure CountRecords(SourceTableId: Integer; SourceTableName: Text[30]; SourceFieldId: Integer)
- var
- Company: Record Company;
- SourceRecRef: RecordRef;
- SourceFieldRef: FieldRef;
- RecordCount: Integer;
- begin
- if Company.FindSet() then
- repeat
- SourceRecRef.Open(SourceTableId, false, Company.Name);
- if SourceRecRef.FieldExist(SourceFieldId) then begin
- SourceFieldRef := SourceRecRef.Field(SourceFieldId);
-
- if SourceTableId <> Database::"VAT Statement Line" then
- SourceFieldRef.SetFilter('=%1', true);
- if SourceRecRef.FindSet() then
- RecordCount += SourceRecRef.Count;
- end;
- SourceRecRef.Close();
- until Company.Next() = 0;
-
- InsertDocumentEntry(SourceTableId, SourceTableName, RecordCount);
- end;
-
- local procedure InsertDocumentEntry(TableID: Integer; TableName: Text; RecordCount: Integer)
- begin
- if RecordCount = 0 then
- exit;
-
- TempDocumentEntry.Init();
- TempDocumentEntry."Entry No." += 1;
- TempDocumentEntry."Table ID" := TableID;
- TempDocumentEntry."Table Name" := CopyStr(TableName, 1, MaxStrLen(TempDocumentEntry."Table Name"));
- TempDocumentEntry."No. of Records" := RecordCount;
- TempDocumentEntry.Insert();
- end;
-
- local procedure UpdateRecords(SourceTableId: Integer; SourceFieldId: Integer; TargetFieldId: Integer; var Company: Record Company)
- var
- SourceRecRef: RecordRef;
- TargetFieldRef: FieldRef;
- SourceFieldRef: FieldRef;
- EU3PartyTradeFilter: Enum "EU3 Party Trade Filter";
- begin
- SourceRecRef.Open(SourceTableId, false, Company.Name);
- if SourceRecRef.FieldExist(SourceFieldId) then begin
- SourceRecRef.SetLoadFields(SourceFieldId, TargetFieldId);
- SourceFieldRef := SourceRecRef.Field(SourceFieldId);
- if SourceTableId <> Database::"VAT Statement Line" then
- SourceFieldRef.SetFilter('=%1', true);
-
- if SourceRecRef.FindSet() then
- repeat
- SourceFieldRef := SourceRecRef.Field(SourceFieldId);
- TargetFieldRef := SourceRecRef.Field(TargetFieldId);
- if SourceFieldRef.Value then
- TargetFieldRef.Value := EU3PartyTradeFilter::EU3
- else
- TargetFieldRef.Value := EU3PartyTradeFilter::"non-EU3";
- SourceRecRef.Modify();
- until SourceRecRef.Next() = 0;
- end;
- SourceRecRef.Close();
- end;
-
- [EventSubscriber(ObjectType::Codeunit, Codeunit::"Feature Management Facade", 'OnAfterUpdateData', '', false, false)]
- local procedure HandleOnOnAfterUpdateData(var FeatureDataUpdateStatus: Record "Feature Data Update Status")
- var
- VATSetup: Record "VAT Setup";
- EU3PartyTradeFeatureMgt: Codeunit "EU3 Party Trade Feature Mgt.";
- begin
- if FeatureDataUpdateStatus."Feature Key" <> EU3PartyTradeFeatureMgt.GetFeatureKeyId() then
- exit;
- if not VATSetup.Get() then
- VATSetup.Insert();
- VATSetup."Enable EU 3-Party Purchase" := true;
- VATSetup.Modify(true);
- FeatureDataUpdateStatus."Feature Status" := "Feature Status"::Enabled;
- FeatureDataUpdateStatus.Modify();
- end;
-
- var
- TempDocumentEntry: Record "Document Entry" temporary;
- FeatureDataUpdateMgt: Codeunit "Feature Data Update Mgt.";
- DescriptionTxt: Label 'Records in the %1, %2, %3 and %4 tables will be updated. Please review affected data as the data update can take longer in case of large amount of records. ', Comment = '%1, %2, %3, %4 - table captions';
- PurchaseHdrTxt: Label 'Purchase Header', Locked = true;
- PurchaseInvHdrTxt: Label 'Purch. Inv. Header', Locked = true;
- PurchaseCrMemoHdrTxt: Label 'Purch. Cr. Memo Hdr.', Locked = true;
- VATStatementLineTxt: Label 'VAT Statement Line', Locked = true;
-
- [IntegrationEvent(false, false)]
- local procedure OnAfterGetListOfTables(var Result: Text)
- begin
- end;
-}
-#endif
\ No newline at end of file
diff --git a/Apps/W1/EU3PartyTradePurchase/app/src/Codeunits/EU3GenJnlSubscribers.Codeunit.al b/Apps/W1/EU3PartyTradePurchase/app/src/Codeunits/EU3GenJnlSubscribers.Codeunit.al
index 3c098065fc..0b686c9a5e 100644
--- a/Apps/W1/EU3PartyTradePurchase/app/src/Codeunits/EU3GenJnlSubscribers.Codeunit.al
+++ b/Apps/W1/EU3PartyTradePurchase/app/src/Codeunits/EU3GenJnlSubscribers.Codeunit.al
@@ -17,28 +17,14 @@ codeunit 4883 "EU3 Gen. Jnl. Subscribers"
[EventSubscriber(ObjectType::Table, Database::"Gen. Journal Line", 'OnAfterCopyGenJnlLineFromPurchHeader', '', false, false)]
local procedure OnAfterCopyGenJnlLineFromPurchHeader(PurchaseHeader: Record "Purchase Header"; var GenJournalLine: Record "Gen. Journal Line")
var
-#if not CLEAN23
- EU3PartyTradeFeatureMgt: Codeunit "EU3 Party Trade Feature Mgt.";
-#endif
begin
-#if not CLEAN23
- if not EU3PartyTradeFeatureMgt.IsEnabled() then
- exit;
-#endif
GenJournalLine."EU 3-Party Trade" := PurchaseHeader."EU 3 Party Trade";
end;
[EventSubscriber(ObjectType::Table, Database::"Gen. Journal Line", 'OnAfterCopyGenJnlLineFromPurchHeaderPrepmt', '', false, false)]
local procedure OnAfterCopyGenJnlLineFromPurchHeaderPrepmt(PurchaseHeader: Record "Purchase Header"; var GenJournalLine: Record "Gen. Journal Line")
var
-#if not CLEAN23
- EU3PartyTradeFeatureMgt: Codeunit "EU3 Party Trade Feature Mgt.";
-#endif
begin
-#if not CLEAN23
- if not EU3PartyTradeFeatureMgt.IsEnabled() then
- exit;
-#endif
GenJournalLine."EU 3-Party Trade" := PurchaseHeader."EU 3 Party Trade";
end;
}
diff --git a/Apps/W1/EU3PartyTradePurchase/app/src/Codeunits/EU3PartyTradeFeatureMgt.Codeunit.al b/Apps/W1/EU3PartyTradePurchase/app/src/Codeunits/EU3PartyTradeFeatureMgt.Codeunit.al
index 57aecf49d0..390b0a1db2 100644
--- a/Apps/W1/EU3PartyTradePurchase/app/src/Codeunits/EU3PartyTradeFeatureMgt.Codeunit.al
+++ b/Apps/W1/EU3PartyTradePurchase/app/src/Codeunits/EU3PartyTradeFeatureMgt.Codeunit.al
@@ -15,7 +15,6 @@ codeunit 4881 "EU3 Party Trade Feature Mgt."
InherentPermissions = X;
InherentEntitlements = X;
-#if CLEAN23
procedure IsEnabled(): Boolean
var
VATSetup: Record "VAT Setup";
@@ -26,46 +25,9 @@ codeunit 4881 "EU3 Party Trade Feature Mgt."
exit(false);
exit(VATSetup."Enable EU 3-Party Purchase");
end;
-#else
- [Obsolete('The feature key EU3PartyTradePurchase will be deleted as part of deprecation process', '23.0')]
- procedure IsEnabled(): Boolean
- var
- VATSetup: Record "VAT Setup";
- FeatureManagementFacade: Codeunit "Feature Management Facade";
- begin
- if not VATSetup.ReadPermission() then
- exit(false);
- if not VATSetup.Get() then
- exit(false);
- exit(FeatureManagementFacade.IsEnabled(FeatureKeyIdTok) and VATSetup."Enable EU 3-Party Purchase");
- end;
-#endif
-#if not CLEAN23
- [Obsolete('The feature key EU3PartyTradePurchase will be deleted as part of deprecation process', '23.0')]
- procedure IsFeatureKeyEnabled(): Boolean
- var
- FeatureManagementFacade: Codeunit "Feature Management Facade";
- begin
- exit(FeatureManagementFacade.IsEnabled(FeatureKeyIdTok));
- end;
-#else
procedure IsFeatureKeyEnabled(): Boolean
begin
exit(true);
end;
-#endif
-
-#if not CLEAN23
- [Obsolete('The feature key EU3PartyTradePurchase will be deleted as part of deprecation process', '23.0')]
- procedure GetFeatureKeyId(): Text
- begin
- exit(FeatureKeyIdTok);
- end;
-#endif
-
-#if not CLEAN23
- var
- FeatureKeyIdTok: Label 'EU3PartyTradePurchase', Locked = true;
-#endif
}
\ No newline at end of file
diff --git a/Apps/W1/EU3PartyTradePurchase/app/src/Codeunits/EU3PurchGetDropShptSbscr.Codeunit.al b/Apps/W1/EU3PartyTradePurchase/app/src/Codeunits/EU3PurchGetDropShptSbscr.Codeunit.al
index d5fa300745..5e59e05225 100644
--- a/Apps/W1/EU3PartyTradePurchase/app/src/Codeunits/EU3PurchGetDropShptSbscr.Codeunit.al
+++ b/Apps/W1/EU3PartyTradePurchase/app/src/Codeunits/EU3PurchGetDropShptSbscr.Codeunit.al
@@ -18,15 +18,8 @@ codeunit 4884 "EU3 Purch.-Get Drop Shpt Sbscr"
[EventSubscriber(ObjectType::Codeunit, codeunit::"Purch.-Get Drop Shpt.", 'OnCodeOnBeforeModify', '', false, false)]
local procedure OnCodeOnBeforeModify(var PurchaseHeader: Record "Purchase Header"; SalesHeader: Record "Sales Header")
var
-#if not CLEAN23
- EU3PartyTradeFeatureMgt: Codeunit "EU3 Party Trade Feature Mgt.";
-#endif
ConfirmSameEU3PartyTradeMsg: Label '%1 on %2 %3 is %4.\Do you wish to change %5 on %6 %7 from %8 to %9?', Comment = '%1 = EU 3-Party Trade field caption, %2 = Sales Header table name, %3 = EU 3-Party Trade field value, %4 = Field Caption of EU 3 Party Trade in Purchase Header, %5 = Table caption, %6 = Purchase Header number, %7 = Field value, %8 = Field value';
begin
-#if not CLEAN23
- if not EU3PartyTradeFeatureMgt.IsEnabled() then
- exit;
-#endif
if SalesHeader."EU 3-Party Trade" <> PurchaseHeader."EU 3 Party Trade" then
if Confirm(ConfirmSameEU3PartyTradeMsg, true,
SalesHeader.FieldCaption("EU 3-Party Trade"), SalesHeader.TableCaption(), SalesHeader."No.",
@@ -40,14 +33,7 @@ codeunit 4884 "EU3 Purch.-Get Drop Shpt Sbscr"
local procedure OnAfterInsertPurchOrderHeader(var RequisitionLine: Record "Requisition Line"; var PurchaseOrderHeader: Record "Purchase Header"; CommitIsSuppressed: Boolean; SpecialOrder: Boolean)
var
SalesHeader: Record "Sales Header";
-#if not CLEAN23
- EU3PartyTradeFeatureMgt: Codeunit "EU3 Party Trade Feature Mgt.";
-#endif
begin
-#if not CLEAN23
- if not EU3PartyTradeFeatureMgt.IsEnabled() then
- exit;
-#endif
if (RequisitionLine."Sales Order No." = '') or (RequisitionLine."Sales Order Line No." = 0) or (not RequisitionLine."Drop Shipment") then
exit;
diff --git a/Apps/W1/EU3PartyTradePurchase/app/src/Codeunits/EU3ReqWkshSubscribers.Codeunit.al b/Apps/W1/EU3PartyTradePurchase/app/src/Codeunits/EU3ReqWkshSubscribers.Codeunit.al
index 096201ce5a..ea13da7d01 100644
--- a/Apps/W1/EU3PartyTradePurchase/app/src/Codeunits/EU3ReqWkshSubscribers.Codeunit.al
+++ b/Apps/W1/EU3PartyTradePurchase/app/src/Codeunits/EU3ReqWkshSubscribers.Codeunit.al
@@ -19,14 +19,7 @@ codeunit 4882 "EU3 Req. Wksh. Subscribers"
local procedure OnAfterInsertPurchOrderHeader(var RequisitionLine: Record "Requisition Line"; var PurchaseOrderHeader: Record "Purchase Header"; CommitIsSuppressed: Boolean; SpecialOrder: Boolean)
var
SalesHeader: Record "Sales Header";
-#if not CLEAN23
- EU3PartyTradeFeatureMgt: Codeunit "EU3 Party Trade Feature Mgt.";
-#endif
begin
-#if not CLEAN23
- if not EU3PartyTradeFeatureMgt.IsEnabled() then
- exit;
-#endif
if (RequisitionLine."Sales Order No." = '') or (RequisitionLine."Sales Order Line No." = 0) or (not RequisitionLine."Drop Shipment") then
exit;
diff --git a/Apps/W1/EU3PartyTradePurchase/app/src/Codeunits/EU3VATStatSubscribers.Codeunit.al b/Apps/W1/EU3PartyTradePurchase/app/src/Codeunits/EU3VATStatSubscribers.Codeunit.al
index 13a691ef20..096168d518 100644
--- a/Apps/W1/EU3PartyTradePurchase/app/src/Codeunits/EU3VATStatSubscribers.Codeunit.al
+++ b/Apps/W1/EU3PartyTradePurchase/app/src/Codeunits/EU3VATStatSubscribers.Codeunit.al
@@ -18,14 +18,7 @@ codeunit 4885 "EU3 VAT Stat. Subscribers"
[EventSubscriber(ObjectType::Page, Page::"VAT Statement Preview Line", 'OnBeforeOpenPageVATEntryTotaling', '', false, false)]
local procedure OnBeforeOpenPageVATEntryTotaling(var VATEntry: Record "VAT Entry"; var VATStatementLine: Record "VAT Statement Line"; var GLEntry: Record "G/L Entry")
var
-#if not CLEAN23
- EU3PartyTradeFeatureMgt: Codeunit "EU3 Party Trade Feature Mgt.";
-#endif
begin
-#if not CLEAN23
- if not EU3PartyTradeFeatureMgt.IsEnabled() then
- exit;
-#endif
Case VATStatementLine."EU 3 Party Trade" of
VATStatementLine."EU 3 Party Trade"::EU3:
VATEntry.SetRange("EU 3-Party Trade", true);
@@ -39,14 +32,7 @@ codeunit 4885 "EU3 VAT Stat. Subscribers"
[EventSubscriber(ObjectType::Report, Report::"VAT Statement", 'OnCalcLineTotalOnVATEntryTotalingOnAfterVATEntrySetFilters', '', false, false)]
local procedure OnCalcLineTotalOnVATEntryTotalingOnAfterVATEntrySetFilters(VATStmtLine: Record "VAT Statement Line"; var VATEntry: Record "VAT Entry"; Selection: Enum "VAT Statement Report Selection")
var
-#if not CLEAN23
- EU3PartyTradeFeatureMgt: Codeunit "EU3 Party Trade Feature Mgt.";
-#endif
begin
-#if not CLEAN23
- if not EU3PartyTradeFeatureMgt.IsEnabled() then
- exit;
-#endif
Case VATStmtLine."EU 3 Party Trade" of
VATStmtLine."EU 3 Party Trade"::EU3:
VATEntry.SetRange("EU 3-Party Trade", true);
diff --git a/Apps/W1/EU3PartyTradePurchase/test/src/EU3PartyTest.Codeunit.al b/Apps/W1/EU3PartyTradePurchase/test/src/EU3PartyTest.Codeunit.al
index c01f9e9784..05197357a0 100644
--- a/Apps/W1/EU3PartyTradePurchase/test/src/EU3PartyTest.Codeunit.al
+++ b/Apps/W1/EU3PartyTradePurchase/test/src/EU3PartyTest.Codeunit.al
@@ -116,7 +116,6 @@ codeunit 139614 "EU 3-Party Test"
PurchaseDropShipmentWithEUThirdParty(false, false, false); // EU 3-Party Trade - False on Sales Header, False and False on Purchase Header.
end;
-#if CLEAN23
[Test]
[HandlerFunctions('SalesListModalPageHandler')]
[Scope('OnPrem')]
@@ -125,7 +124,6 @@ codeunit 139614 "EU 3-Party Test"
// Test to verify EU 3-Party Trade on Purchase Order, When EU 3-Party Trade True on Sales Header, True on Purchase Header.
PurchaseDropShipmentWithEUThirdParty(true, true, true); // EU 3-Party Trade - True on Sales Header, True and True on Purchase Header.
end;
-#endif
local procedure Initialize()
begin
@@ -134,10 +132,6 @@ codeunit 139614 "EU 3-Party Test"
if IsInitialized then
exit;
EnableEU3PartyTradePurchase();
-#if not CLEAN23
- EnableEU3PartyOnInitializeFeatureDataUpdateStatus();
- Commit();
-#endif
DisableCheckDocTotalAmount();
IsInitialized := true;
end;
@@ -484,35 +478,6 @@ codeunit 139614 "EU 3-Party Test"
end;
end;
-#if not CLEAN23
- [Obsolete('The EU 3-Party Trade Purhcase feature will be enabled by default.', '23.0')]
- procedure EnableEU3PartyOnInitializeFeatureDataUpdateStatus()
- var
- FeatureKey: Record "Feature Key";
- FeatureDataUpdateStatus: Record "Feature Data Update Status";
- EU3PartyTradeFeatureMgt: Codeunit "EU3 Party Trade Feature Mgt.";
- FeatureKeyId: Text;
- begin
- FeatureKeyId := EU3PartyTradeFeatureMgt.GetFeatureKeyId();
- if not FeatureDataUpdateStatus.Get(FeatureKeyId, CompanyName) then begin
- FeatureDataUpdateStatus.Init();
- FeatureDataUpdateStatus."Feature Key" := FeatureKeyId;
- FeatureDataUpdateStatus."Company Name" := CompanyName;
- FeatureDataUpdateStatus."Data Update Required" := true;
- FeatureDataUpdateStatus.Insert()
- end;
-
- FeatureDataUpdateStatus."Feature Status" := FeatureDataUpdateStatus."Feature Status"::Enabled;
- FeatureDataUpdateStatus.Modify();
-
- if FeatureKey.Get(FeatureDataUpdateStatus."Feature Key") then begin
- FeatureKey.Enabled := FeatureKey.Enabled::"All Users";
- FeatureKey.Modify();
- end;
- Commit();
- end;
-#endif
-
[PageHandler]
[Scope('OnPrem')]
procedure VATStatementPreviewPageHandler(var VATStatementPreview: TestPage "VAT Statement Preview")
diff --git a/Apps/W1/EnforcedDigitalVouchers/app/src/Implementation/DigitalVoucherFeature.Codeunit.al b/Apps/W1/EnforcedDigitalVouchers/app/src/Implementation/DigitalVoucherFeature.Codeunit.al
index 66b04ba602..a6cabc5cd3 100644
--- a/Apps/W1/EnforcedDigitalVouchers/app/src/Implementation/DigitalVoucherFeature.Codeunit.al
+++ b/Apps/W1/EnforcedDigitalVouchers/app/src/Implementation/DigitalVoucherFeature.Codeunit.al
@@ -63,6 +63,7 @@ codeunit 5585 "Digital Voucher Feature"
procedure EnforceDigitalVoucherFunctionality() IsEnabled: Boolean
var
+ Company: Record Company;
EnvironmentInformation: Codeunit "Environment Information";
IsHandled: Boolean;
begin
@@ -71,6 +72,9 @@ codeunit 5585 "Digital Voucher Feature"
exit(IsEnabled);
if (not EnvironmentInformation.IsSaaSInfrastructure()) or (EnvironmentInformation.IsSandbox()) then
exit(false);
+ Company.Get(CompanyName());
+ if Company."Evaluation Company" then
+ exit;
if EnvironmentInformation.GetApplicationFamily() = DKCountryCodeTxt then
exit(Today() >= 20240701D);
end;
diff --git a/Apps/W1/ExcelReports/app/src/Financials/EXRTrialBalanceBuffer.Table.al b/Apps/W1/ExcelReports/app/src/Financials/EXRTrialBalanceBuffer.Table.al
index 00c238ae40..3359f9e948 100644
--- a/Apps/W1/ExcelReports/app/src/Financials/EXRTrialBalanceBuffer.Table.al
+++ b/Apps/W1/ExcelReports/app/src/Financials/EXRTrialBalanceBuffer.Table.al
@@ -44,10 +44,14 @@ table 4402 "EXR Trial Balance Buffer"
trigger OnValidate()
begin
- if ("Net Change" > 0) then
- Validate("Net Change (Debit)", "Net Change")
- else
+ if ("Net Change" > 0) then begin
+ Validate("Net Change (Debit)", "Net Change");
+ Validate("Net Change (Credit)", 0);
+ end
+ else begin
Validate("Net Change (Credit)", -"Net Change");
+ Validate("Net Change (Debit)", 0);
+ end;
end;
}
field(11; "Net Change (Debit)"; Decimal)
@@ -64,10 +68,14 @@ table 4402 "EXR Trial Balance Buffer"
trigger OnValidate()
begin
- if ("Balance" > 0) then
- Validate("Balance (Debit)", "Balance")
- else
+ if ("Balance" > 0) then begin
+ Validate("Balance (Debit)", "Balance");
+ Validate("Balance (Credit)", 0);
+ end
+ else begin
Validate("Balance (Credit)", -"Balance");
+ Validate("Balance (Debit)", 0);
+ end;
end;
}
field(14; "Balance (Debit)"; Decimal)
@@ -100,10 +108,14 @@ table 4402 "EXR Trial Balance Buffer"
trigger OnValidate()
begin
- if ("Last Period Net" > 0) then
- Validate("Last Period Net (Debit)", "Last Period Net")
- else
+ if ("Last Period Net" > 0) then begin
+ Validate("Last Period Net (Debit)", "Last Period Net");
+ Validate("Last Period Net (Credit)", 0);
+ end
+ else begin
Validate("Last Period Net (Credit)", -"Last Period Net");
+ Validate("Last Period Net (Debit)", 0);
+ end;
end;
}
field(51; "Last Period Net (Debit)"; Decimal)
@@ -120,10 +132,14 @@ table 4402 "EXR Trial Balance Buffer"
trigger OnValidate()
begin
- if ("Last Period Bal." > 0) then
- Validate("Last Period Bal. (Debit)", "Last Period Bal.")
- else
+ if ("Last Period Bal." > 0) then begin
+ Validate("Last Period Bal. (Debit)", "Last Period Bal.");
+ Validate("Last Period Bal. (Credit)", 0);
+ end
+ else begin
Validate("Last Period Bal. (Credit)", -"Last Period Bal.");
+ Validate("Last Period Bal. (Debit)", 0);
+ end;
end;
}
field(61; "Last Period Bal. (Debit)"; Decimal)
@@ -156,10 +172,14 @@ table 4402 "EXR Trial Balance Buffer"
trigger OnValidate()
begin
- if ("Net Change" > 0) then
- Validate("Net Change (Debit) (ACY)", "Net Change (ACY)")
- else
+ if ("Net Change" > 0) then begin
+ Validate("Net Change (Debit) (ACY)", "Net Change (ACY)");
+ Validate("Net Change (Credit) (ACY)", 0);
+ end
+ else begin
Validate("Net Change (Credit) (ACY)", -"Net Change (ACY)");
+ Validate("Net Change (Debit) (ACY)", 0);
+ end;
end;
}
field(111; "Net Change (Debit) (ACY)"; Decimal)
@@ -176,10 +196,14 @@ table 4402 "EXR Trial Balance Buffer"
trigger OnValidate()
begin
- if ("Balance" > 0) then
- Validate("Balance (Debit) (ACY)", "Balance (ACY)")
- else
+ if ("Balance" > 0) then begin
+ Validate("Balance (Debit) (ACY)", "Balance (ACY)");
+ Validate("Balance (Credit) (ACY)", 0);
+ end
+ else begin
Validate("Balance (Credit) (ACY)", -"Balance (ACY)");
+ Validate("Balance (Debit) (ACY)", 0);
+ end;
end;
}
field(114; "Balance (Debit) (ACY)"; Decimal)
@@ -196,10 +220,14 @@ table 4402 "EXR Trial Balance Buffer"
trigger OnValidate()
begin
- if ("Last Period Net" > 0) then
- Validate("Last Period Net (Debit) (ACY)", "Last Period Net (ACY)")
- else
+ if ("Last Period Net" > 0) then begin
+ Validate("Last Period Net (Debit) (ACY)", "Last Period Net (ACY)");
+ Validate("Last Period Net (Credit) (ACY)", 0);
+ end
+ else begin
Validate("Last Period Net (Credit) (ACY)", -"Last Period Net (ACY)");
+ Validate("Last Period Net (Debit) (ACY)", 0);
+ end;
end;
}
field(151; "Last Period Net (Debit) (ACY)"; Decimal)
@@ -216,10 +244,14 @@ table 4402 "EXR Trial Balance Buffer"
trigger OnValidate()
begin
- if ("Last Period Bal." > 0) then
- Validate("Last Period Bal. (Debit) (ACY)", "Last Period Bal. (ACY)")
- else
+ if ("Last Period Bal." > 0) then begin
+ Validate("Last Period Bal. (Debit) (ACY)", "Last Period Bal. (ACY)");
+ Validate("Last Period Bal. (Cred.) (ACY)", 0);
+ end
+ else begin
Validate("Last Period Bal. (Cred.) (ACY)", -"Last Period Bal. (ACY)");
+ Validate("Last Period Bal. (Debit) (ACY)", 0);
+ end;
end;
}
field(161; "Last Period Bal. (Debit) (ACY)"; Decimal)
diff --git a/Apps/W1/ExcelReports/app/src/Financials/PageExtensions/FixedAssetList.PageExt.al b/Apps/W1/ExcelReports/app/src/Financials/PageExtensions/FixedAssetList.PageExt.al
index 16fc3c74cf..86fdedc83f 100644
--- a/Apps/W1/ExcelReports/app/src/Financials/PageExtensions/FixedAssetList.PageExt.al
+++ b/Apps/W1/ExcelReports/app/src/Financials/PageExtensions/FixedAssetList.PageExt.al
@@ -32,5 +32,17 @@ pageextension 4407 "Fixed Asset List" extends "Fixed Asset List"
ToolTip = 'View detailed information about the fixed asset ledger entries that have been posted to a specified depreciation book for each fixed asset.';
}
}
+ addlast(Category_Report)
+ {
+ actionref(FAAnalysisExcel_Promoted; "Fixed Asset Analysis - Excel")
+ {
+ }
+ actionref(FAProjectedExcel_Promoted; "Fixed Asset Projected - Excel")
+ {
+ }
+ actionref(FADetailsExcel_Promoted; "Fixed Asset Details - Excel")
+ {
+ }
+ }
}
}
\ No newline at end of file
diff --git a/Apps/W1/ExcelReports/app/src/Financials/TrialBalance.Codeunit.al b/Apps/W1/ExcelReports/app/src/Financials/TrialBalance.Codeunit.al
index 7cf0915e37..2e171cf03e 100644
--- a/Apps/W1/ExcelReports/app/src/Financials/TrialBalance.Codeunit.al
+++ b/Apps/W1/ExcelReports/app/src/Financials/TrialBalance.Codeunit.al
@@ -119,6 +119,7 @@ codeunit 4410 "Trial Balance"
local procedure InsertTrialBalanceDataForGLAccountWithFilters(var GLAccount: Record "G/L Account"; Dimension1ValueCode: Code[20]; Dimension2ValueCode: Code[20]; BusinessUnitCode: Code[20]; var TrialBalanceData: Record "EXR Trial Balance Buffer"; var Dimension1Values: Record "Dimension Value" temporary; var Dimension2Values: Record "Dimension Value" temporary)
begin
+ Clear(TrialBalanceData);
GlAccount.CalcFields("Net Change", "Balance at Date", "Additional-Currency Net Change", "Add.-Currency Balance at Date", "Budgeted Amount", "Budget at Date");
TrialBalanceData."G/L Account No." := GlAccount."No.";
TrialBalanceData."Dimension 1 Code" := Dimension1ValueCode;
diff --git a/Apps/W1/ExcelReports/app/src/RoleCenters/EXRARRoleCenter.PageExt.al b/Apps/W1/ExcelReports/app/src/RoleCenters/EXRARRoleCenter.PageExt.al
index 54dac2311c..15b4c3a7e9 100644
--- a/Apps/W1/ExcelReports/app/src/RoleCenters/EXRARRoleCenter.PageExt.al
+++ b/Apps/W1/ExcelReports/app/src/RoleCenters/EXRARRoleCenter.PageExt.al
@@ -20,7 +20,11 @@ pageextension 4405 EXRARRoleCenter extends "Account Receivables"
action(EXRTrialBalanceExcel)
{
ApplicationArea = Basic, Suite;
+#if not CLEAN25
Caption = 'Trial Balance (Preview)';
+#else
+ Caption = 'Trial Balance';
+#endif
Image = "Report";
RunObject = report "EXR Trial Balance Excel";
ToolTip = 'Open a spreadsheet that shows Trial Balance Excel data.';
@@ -44,7 +48,11 @@ pageextension 4405 EXRARRoleCenter extends "Account Receivables"
action(EXRAgedAccountsRecExcel)
{
ApplicationArea = Basic, Suite;
+#if not CLEAN25
Caption = 'Aged Accounts Receivable (Preview)';
+#else
+ Caption = 'Aged Accounts Receivable';
+#endif
Image = "Report";
RunObject = report "EXR Aged Accounts Rec Excel";
ToolTip = 'Open a spreadsheet that shows the Aged Accounts Receivable data.';
diff --git a/Apps/W1/ExcelReports/app/src/RoleCenters/EXRAccountantRoleCenter.PageExt.al b/Apps/W1/ExcelReports/app/src/RoleCenters/EXRAccountantRoleCenter.PageExt.al
index a2683c3de4..316e7decbb 100644
--- a/Apps/W1/ExcelReports/app/src/RoleCenters/EXRAccountantRoleCenter.PageExt.al
+++ b/Apps/W1/ExcelReports/app/src/RoleCenters/EXRAccountantRoleCenter.PageExt.al
@@ -27,7 +27,11 @@ pageextension 4401 "EXR Accountant Role Center" extends "Accountant Role Center"
action(EXRTrialBalanceExcel)
{
ApplicationArea = Basic, Suite;
+#if not CLEAN25
Caption = 'Trial Balance (Preview)';
+#else
+ Caption = 'Trial Balance';
+#endif
Image = "Report";
RunObject = report "EXR Trial Balance Excel";
ToolTip = 'Open a spreadsheet that shows Trial Balance Excel data.';
@@ -51,7 +55,11 @@ pageextension 4401 "EXR Accountant Role Center" extends "Accountant Role Center"
action(EXRAgedAccountsRecExcel)
{
ApplicationArea = Basic, Suite;
+#if not CLEAN25
Caption = 'Aged Accounts Receivable (Preview)';
+#else
+ Caption = 'Aged Accounts Receivable';
+#endif
Image = "Report";
RunObject = report "EXR Aged Accounts Rec Excel";
ToolTip = 'Open a spreadsheet that shows the Aged Accounts Receivable data.';
@@ -75,7 +83,11 @@ pageextension 4401 "EXR Accountant Role Center" extends "Accountant Role Center"
action(EXRAgedAccPayableExcel)
{
ApplicationArea = Basic, Suite;
+#if not CLEAN25
Caption = 'Aged Accounts Payable (Preview)';
+#else
+ Caption = 'Aged Accounts Payable';
+#endif
Image = "Report";
RunObject = report "EXR Aged Acc Payable Excel";
ToolTip = 'Open a spreadsheet that shows the Aged Accounts Payable data.';
diff --git a/Apps/W1/ExcelReports/app/src/RoleCenters/EXRFinRoleCenter.PageExt.al b/Apps/W1/ExcelReports/app/src/RoleCenters/EXRFinRoleCenter.PageExt.al
index 73a8ee5a06..033df3f24b 100644
--- a/Apps/W1/ExcelReports/app/src/RoleCenters/EXRFinRoleCenter.PageExt.al
+++ b/Apps/W1/ExcelReports/app/src/RoleCenters/EXRFinRoleCenter.PageExt.al
@@ -19,7 +19,11 @@ pageextension 4406 EXRFinRoleCenter extends "Finance Manager Role Center"
action(EXRTrialBalanceExcel)
{
ApplicationArea = Basic, Suite;
+#if not CLEAN25
Caption = 'Trial Balance (Preview)';
+#else
+ Caption = 'Trial Balance';
+#endif
Image = "Report";
RunObject = report "EXR Trial Balance Excel";
ToolTip = 'Open a spreadsheet that shows Trial Balance Excel data.';
@@ -43,7 +47,11 @@ pageextension 4406 EXRFinRoleCenter extends "Finance Manager Role Center"
action(EXRAgedAccountsRecExcel)
{
ApplicationArea = Basic, Suite;
+#if not CLEAN25
Caption = 'Aged Accounts Receivable (Preview)';
+#else
+ Caption = 'Aged Accounts Receivable';
+#endif
Image = "Report";
RunObject = report "EXR Aged Accounts Rec Excel";
ToolTip = 'Open a spreadsheet that shows the Aged Accounts Receivable data.';
@@ -67,7 +75,11 @@ pageextension 4406 EXRFinRoleCenter extends "Finance Manager Role Center"
action(EXRAgedAccPayableExcel)
{
ApplicationArea = Basic, Suite;
+#if not CLEAN25
Caption = 'Aged Accounts Payable (Preview)';
+#else
+ Caption = 'Aged Accounts Payable';
+#endif
Image = "Report";
RunObject = report "EXR Aged Acc Payable Excel";
ToolTip = 'Open a spreadsheet that shows the Aged Accounts Payable data.';
@@ -106,5 +118,33 @@ pageextension 4406 EXRFinRoleCenter extends "Finance Manager Role Center"
}
}
}
+ addlast(Group45)
+ {
+ action(EXRFixedAssetAnalysisExcelG45)
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Fixed Asset Analysis (Excel)';
+ Image = "Report";
+ RunObject = report "EXR Fixed Asset Analysis Excel";
+ ToolTip = 'Open an Excel workbook that shows a comparison of fixed asset values across a date range.';
+ }
+ action(EXRFixedAssetDetailsExcelG45)
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Fixed Asset Details (Excel)';
+ Image = "Report";
+ RunObject = report "EXR Fixed Asset Details Excel";
+ ToolTip = 'Open an Excel workbook that shows fixed asset ledger entries.';
+ }
+ action(EXRFixedAssetProjectedG45)
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Fixed Asset Projected Value (Excel)';
+ Image = "Report";
+ RunObject = report "EXR Fixed Asset Projected";
+ ToolTip = 'Open an Excel workbook that shows posted fixed asset ledger entries and projected fixed asset ledger entries.';
+ }
+
+ }
}
}
diff --git a/Apps/W1/ExcelReports/app/src/RoleCenters/ExtBusManagerRoleCenter.PageExt.al b/Apps/W1/ExcelReports/app/src/RoleCenters/ExtBusManagerRoleCenter.PageExt.al
index 24bfad498e..41f46fe8db 100644
--- a/Apps/W1/ExcelReports/app/src/RoleCenters/ExtBusManagerRoleCenter.PageExt.al
+++ b/Apps/W1/ExcelReports/app/src/RoleCenters/ExtBusManagerRoleCenter.PageExt.al
@@ -27,7 +27,11 @@ pageextension 4402 "EXT Bus. Manager Role Center" extends "Business Manager Role
action(EXRTrialBalanceExcel)
{
ApplicationArea = Basic, Suite;
+#if not CLEAN25
Caption = 'Trial Balance (Preview)';
+#else
+ Caption = 'Trial Balance';
+#endif
Image = "Report";
RunObject = report "EXR Trial Balance Excel";
ToolTip = 'Open a spreadsheet that shows Trial Balance Excel data.';
@@ -51,7 +55,11 @@ pageextension 4402 "EXT Bus. Manager Role Center" extends "Business Manager Role
action(EXRAgedAccountsRecExcel)
{
ApplicationArea = Basic, Suite;
+#if not CLEAN25
Caption = 'Aged Accounts Receivable (Preview)';
+#else
+ Caption = 'Aged Accounts Receivable';
+#endif
Image = "Report";
RunObject = report "EXR Aged Accounts Rec Excel";
ToolTip = 'Open a spreadsheet that shows the Aged Accounts Receivable data.';
@@ -75,11 +83,47 @@ pageextension 4402 "EXT Bus. Manager Role Center" extends "Business Manager Role
action(EXRAgedAccPayableExcel)
{
ApplicationArea = Basic, Suite;
+#if not CLEAN25
Caption = 'Aged Accounts Payable (Preview)';
+#else
+ Caption = 'Aged Accounts Payable';
+#endif
Image = "Report";
RunObject = report "EXR Aged Acc Payable Excel";
ToolTip = 'Open a spreadsheet that shows the Aged Accounts Payable data.';
}
+ action(EXRConsolidatedTrialBalance)
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Consolidated Trial Balance (Preview)';
+ Image = "Report";
+ RunObject = report "EXR Consolidated Trial Balance";
+ ToolTip = 'Open an Excel workbook that shows the G/L entries totals in the different business units.';
+ }
+ action(EXRFixedAssetAnalysisExcel)
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Fixed Asset Analysis (Preview)';
+ Image = "Report";
+ RunObject = report "EXR Fixed Asset Analysis Excel";
+ ToolTip = 'Open an Excel workbook that shows a comparison of fixed asset values across a date range.';
+ }
+ action(EXRFixedAssetDetailsExcel)
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Fixed Asset Details (Preview)';
+ Image = "Report";
+ RunObject = report "EXR Fixed Asset Details Excel";
+ ToolTip = 'Open an Excel workbook that shows fixed asset ledger entries.';
+ }
+ action(EXRFixedAssetProjected)
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Fixed Asset Projected Value (Preview)';
+ Image = "Report";
+ RunObject = report "EXR Fixed Asset Projected";
+ ToolTip = 'Open an Excel workbook that shows posted fixed asset ledger entries and projected fixed asset ledger entries.';
+ }
}
}
}
\ No newline at end of file
diff --git a/Apps/W1/ExcelReports/app/src/RoleCenters/ExtCompanyDetail.PageExt.al b/Apps/W1/ExcelReports/app/src/RoleCenters/ExtCompanyDetail.PageExt.al
index 9c9adcfbde..3dead624cc 100644
--- a/Apps/W1/ExcelReports/app/src/RoleCenters/ExtCompanyDetail.PageExt.al
+++ b/Apps/W1/ExcelReports/app/src/RoleCenters/ExtCompanyDetail.PageExt.al
@@ -27,7 +27,11 @@ pageextension 4403 "EXT Company Detail" extends "Company Detail"
action(EXRTrialBalanceExcel)
{
ApplicationArea = Basic, Suite;
+#if not CLEAN25
Caption = 'Trial Balance (Preview)';
+#else
+ Caption = 'Trial Balance';
+#endif
Image = "Report";
RunObject = report "EXR Trial Balance Excel";
ToolTip = 'Open a spreadsheet that shows Trial Balance Excel data.';
@@ -51,7 +55,11 @@ pageextension 4403 "EXT Company Detail" extends "Company Detail"
action(EXRAgedAccountsRecExcel)
{
ApplicationArea = Basic, Suite;
+#if not CLEAN25
Caption = 'Aged Accounts Receivable (Preview)';
+#else
+ Caption = 'Aged Accounts Receivable';
+#endif
Image = "Report";
RunObject = report "EXR Aged Accounts Rec Excel";
ToolTip = 'Open a spreadsheet that shows the Aged Accounts Receivable data.';
@@ -75,7 +83,11 @@ pageextension 4403 "EXT Company Detail" extends "Company Detail"
action(EXRAgedAccPayableExcel)
{
ApplicationArea = Basic, Suite;
+#if not CLEAN25
Caption = 'Aged Accounts Payable (Preview)';
+#else
+ Caption = 'Aged Accounts Payable';
+#endif
Image = "Report";
RunObject = report "EXR Aged Acc Payable Excel";
ToolTip = 'Open a spreadsheet that shows the Aged Accounts Payable data.';
diff --git a/Apps/W1/ExcelReports/test/src/TrialBalanceExcelReports.Codeunit.al b/Apps/W1/ExcelReports/test/src/TrialBalanceExcelReports.Codeunit.al
index 1a7bf318b2..734e4fdd42 100644
--- a/Apps/W1/ExcelReports/test/src/TrialBalanceExcelReports.Codeunit.al
+++ b/Apps/W1/ExcelReports/test/src/TrialBalanceExcelReports.Codeunit.al
@@ -298,6 +298,56 @@ codeunit 139544 "Trial Balance Excel Reports"
asserterror LibraryReportDataset.RunReportAndLoad(Report::"EXR Consolidated Trial Balance", Variant, RequestPageXml);
end;
+ [Test]
+ procedure TrialBalanceBufferNetChangeSplitsIntoDebitAndCreditWhenCalledSeveralTimes()
+ var
+ EXRTrialBalanceBuffer: Record "EXR Trial Balance Buffer";
+ ValuesToSplitInCreditAndDebit: array[3] of Decimal;
+ begin
+ // [SCENARIO 547558] Trial Balance Buffer data split into Debit and Credit correctly, even if called multiple times.
+ // [GIVEN] Trial Balance Buffer filled with positive Balance/Net Change
+ ValuesToSplitInCreditAndDebit[1] := 837;
+ // [GIVEN] Trial Balance Buffer filled with negative Balance/Net Change
+ ValuesToSplitInCreditAndDebit[2] := -110;
+ // [GIVEN] Trial Balance Buffer filled with positive Balance/Net Change
+ ValuesToSplitInCreditAndDebit[3] := 998;
+ // [WHEN] Trial Balance Buffer entries are inserted
+ EXRTrialBalanceBuffer."G/L Account No." := 'A';
+ EXRTrialBalanceBuffer.Validate("Net Change", ValuesToSplitInCreditAndDebit[1]);
+ EXRTrialBalanceBuffer.Validate(Balance, ValuesToSplitInCreditAndDebit[1]);
+ EXRTrialBalanceBuffer.Validate("Net Change (ACY)", ValuesToSplitInCreditAndDebit[1]);
+ EXRTrialBalanceBuffer.Validate("Balance (ACY)", ValuesToSplitInCreditAndDebit[1]);
+ EXRTrialBalanceBuffer.Insert();
+ EXRTrialBalanceBuffer."G/L Account No." := 'B';
+ EXRTrialBalanceBuffer.Validate("Net Change", ValuesToSplitInCreditAndDebit[2]);
+ EXRTrialBalanceBuffer.Validate(Balance, ValuesToSplitInCreditAndDebit[2]);
+ EXRTrialBalanceBuffer.Validate("Net Change (ACY)", ValuesToSplitInCreditAndDebit[2]);
+ EXRTrialBalanceBuffer.Validate("Balance (ACY)", ValuesToSplitInCreditAndDebit[2]);
+ EXRTrialBalanceBuffer.Insert();
+ EXRTrialBalanceBuffer."G/L Account No." := 'C';
+ EXRTrialBalanceBuffer.Validate("Net Change", ValuesToSplitInCreditAndDebit[3]);
+ EXRTrialBalanceBuffer.Validate(Balance, ValuesToSplitInCreditAndDebit[3]);
+ EXRTrialBalanceBuffer.Validate("Net Change (ACY)", ValuesToSplitInCreditAndDebit[3]);
+ EXRTrialBalanceBuffer.Validate("Balance (ACY)", ValuesToSplitInCreditAndDebit[3]);
+ EXRTrialBalanceBuffer.Insert();
+ // [THEN] All Entries have the right split in Credit and Debit
+ EXRTrialBalanceBuffer.FindSet();
+ Assert.AreEqual(ValuesToSplitInCreditAndDebit[1], Abs(EXRTrialBalanceBuffer."Net Change (Debit)" + EXRTrialBalanceBuffer."Net Change (Credit)"), 'Split in line in credit and debit should be the same as the inserted value.');
+ Assert.AreEqual(ValuesToSplitInCreditAndDebit[1], Abs(EXRTrialBalanceBuffer."Balance (Debit)" + EXRTrialBalanceBuffer."Balance (Credit)"), 'Split in line in credit and debit should be the same as the inserted value.');
+ Assert.AreEqual(ValuesToSplitInCreditAndDebit[1], Abs(EXRTrialBalanceBuffer."Net Change (Debit) (ACY)" + EXRTrialBalanceBuffer."Net Change (Credit) (ACY)"), 'Split in line in credit and debit should be the same as the inserted value.');
+ Assert.AreEqual(ValuesToSplitInCreditAndDebit[1], Abs(EXRTrialBalanceBuffer."Balance (Debit) (ACY)" + EXRTrialBalanceBuffer."Balance (Credit) (ACY)"), 'Split in line in credit and debit should be the same as the inserted value.');
+ EXRTrialBalanceBuffer.Next();
+ Assert.AreEqual(-ValuesToSplitInCreditAndDebit[2], Abs(EXRTrialBalanceBuffer."Net Change (Debit)" + EXRTrialBalanceBuffer."Net Change (Credit)"), 'Split in line in credit and debit should be the same as the inserted value.');
+ Assert.AreEqual(-ValuesToSplitInCreditAndDebit[2], Abs(EXRTrialBalanceBuffer."Balance (Debit)" + EXRTrialBalanceBuffer."Balance (Credit)"), 'Split in line in credit and debit should be the same as the inserted value.');
+ Assert.AreEqual(-ValuesToSplitInCreditAndDebit[2], Abs(EXRTrialBalanceBuffer."Net Change (Debit) (ACY)" + EXRTrialBalanceBuffer."Net Change (Credit) (ACY)"), 'Split in line in credit and debit should be the same as the inserted value.');
+ Assert.AreEqual(-ValuesToSplitInCreditAndDebit[2], Abs(EXRTrialBalanceBuffer."Balance (Debit) (ACY)" + EXRTrialBalanceBuffer."Balance (Credit) (ACY)"), 'Split in line in credit and debit should be the same as the inserted value.');
+ EXRTrialBalanceBuffer.Next();
+ Assert.AreEqual(ValuesToSplitInCreditAndDebit[3], Abs(EXRTrialBalanceBuffer."Net Change (Debit)" + EXRTrialBalanceBuffer."Net Change (Credit)"), 'Split in line in credit and debit should be the same as the inserted value.');
+ Assert.AreEqual(ValuesToSplitInCreditAndDebit[3], Abs(EXRTrialBalanceBuffer."Balance (Debit)" + EXRTrialBalanceBuffer."Balance (Credit)"), 'Split in line in credit and debit should be the same as the inserted value.');
+ Assert.AreEqual(ValuesToSplitInCreditAndDebit[3], Abs(EXRTrialBalanceBuffer."Net Change (Debit) (ACY)" + EXRTrialBalanceBuffer."Net Change (Credit) (ACY)"), 'Split in line in credit and debit should be the same as the inserted value.');
+ Assert.AreEqual(ValuesToSplitInCreditAndDebit[3], Abs(EXRTrialBalanceBuffer."Balance (Debit) (ACY)" + EXRTrialBalanceBuffer."Balance (Credit) (ACY)"), 'Split in line in credit and debit should be the same as the inserted value.');
+ end;
+
local procedure CreateSampleBusinessUnits(HowMany: Integer)
var
BusinessUnit: Record "Business Unit";
diff --git a/Apps/W1/ExternalEvents/app/src/APExternalEvents.Codeunit.al b/Apps/W1/ExternalEvents/app/src/APExternalEvents.Codeunit.al
index fc8946b1ad..bd44ce9bcd 100644
--- a/Apps/W1/ExternalEvents/app/src/APExternalEvents.Codeunit.al
+++ b/Apps/W1/ExternalEvents/app/src/APExternalEvents.Codeunit.al
@@ -30,25 +30,10 @@ codeunit 38503 "AP External Events"
exit;
Url := ExternalEventsHelper.CreateLink(CopyStr(VendorApiUrlTok, 1, 250), Vendor.SystemId);
WebClientUrl := CopyStr(GetUrl(ClientType::Web, CompanyName(), ObjectType::Page, Page::"Vendor Card", Vendor), 1, MaxStrLen(WebClientUrl));
-#if not CLEAN23
- if VendorLedgerEntry."Document Type" = VendorLedgerEntry."Document Type"::Payment then begin
- EventPurchasePaymentPosted(Vendor.SystemId, Url);
- EventPurchasePaymentPosted(Vendor.SystemId, Url, WebClientUrl);
- end;
-#else
if VendorLedgerEntry."Document Type" = VendorLedgerEntry."Document Type"::Payment then
EventPurchasePaymentPosted(Vendor.SystemId, Url, WebClientUrl);
-#endif
end;
-#if not CLEAN23
- [Obsolete('This event is obsolete. Use version 1.0 instead.', '23.0')]
- [ExternalBusinessEvent('PurchasePaymentPosted', 'Purchase payment posted', 'This business event is triggered when a vendor payment is posted as part of the Procure to Pay process.', EventCategory::"Accounts Payable")]
- local procedure EventPurchasePaymentPosted(VendorId: Guid; Url: Text[250])
- begin
- end;
-#endif
-
[ExternalBusinessEvent('PurchasePaymentPosted', 'Purchase payment posted', 'This business event is triggered when a vendor payment is posted as part of the Procure to Pay process.', EventCategory::"Accounts Payable", '1.0')]
local procedure EventPurchasePaymentPosted(VendorId: Guid; Url: Text[250]; WebClientUrl: Text[250])
begin
@@ -77,9 +62,6 @@ codeunit 38503 "AP External Events"
APIId := PurchInvHeader.SystemId;
Url := ExternalEventsHelper.CreateLink(CopyStr(PurchaseInvoiceApiUrlTok, 1, 250), APIId);
WebClientUrl := CopyStr(GetUrl(ClientType::Web, CompanyName(), ObjectType::Page, Page::"Posted Purchase Invoice", PurchInvHeader), 1, MaxStrLen(WebClientUrl));
-#if not CLEAN23
- MyBusinessEventPurchaseInvoicePosted(APIId, Url);
-#endif
PurchaseInvoicePosted(APIId, PurchInvHeader.SystemId, Url, WebClientUrl);
end;
if PurchCrMemoHdr."No." <> '' then begin
@@ -89,41 +71,15 @@ codeunit 38503 "AP External Events"
APIId := PurchCrMemoHdr.SystemId;
Url := ExternalEventsHelper.CreateLink(CopyStr(PurchaseMemoApiUrlTok, 1, 250), APIId);
WebClientUrl := CopyStr(GetUrl(ClientType::Web, CompanyName(), ObjectType::Page, Page::"Posted Purchase Credit Memo", PurchCrMemoHdr), 1, MaxStrLen(WebClientUrl));
-#if not CLEAN23
- EventCreditMemoInvoicePosted(APIId, Url);
-#endif
CreditMemoInvoicePosted(APIId, PurchCrMemoHdr.SystemId, Url, WebClientUrl);
end;
if PurchRcptHeader."No." <> '' then begin
Url := ExternalEventsHelper.CreateLink(CopyStr(PurchaseReceiptsApiUrlTok, 1, 250), PurchRcptHeader.SystemId);
WebClientUrl := CopyStr(GetUrl(ClientType::Web, CompanyName(), ObjectType::Page, Page::"Posted Purchase Receipt", PurchRcptHeader), 1, MaxStrLen(WebClientUrl));
-#if not CLEAN23
- EventPurchaseReceivedPosted(PurchRcptHeader.SystemId, Url);
-#endif
PurchaseReceiptPosted(PurchRcptHeader.SystemId, Url, WebClientUrl);
end;
end;
-#if not CLEAN23
- [Obsolete('This event is obsolete. Use version 1.0 instead.', '23.0')]
- [ExternalBusinessEvent('PurchaseInvoicePosted', 'Purchase invoice posted', 'This business event is triggered when a vendor invoice is posted as part of the Procure to Pay process.', EventCategory::"Accounts Payable")]
- local procedure MyBusinessEventPurchaseInvoicePosted(PurchaseInvoiceId: Guid; Url: Text[250])
- begin
- end;
-
- [Obsolete('This event is obsolete. Use version 1.0 instead.', '23.0')]
- [ExternalBusinessEvent('PurchaseCreditMemoPosted', 'Purchase credit memo posted', 'This business event is triggered when a purchase credit memo is posted.', EventCategory::"Accounts Payable")]
- local procedure EventCreditMemoInvoicePosted(PurchaseInvoiceId: Guid; Url: Text[250])
- begin
- end;
-
- [Obsolete('This event is obsolete. Use version 1.0 instead.', '23.0')]
- [ExternalBusinessEvent('PurchaseReceiptPosted', 'Purchase receipt posted', 'This business event is triggered when goods from a purchase order are received by the internal warehouse/external logistics company. This can trigger Finance Department to post a purchase invoice.', EventCategory::"Accounts Payable")]
- local procedure EventPurchaseReceivedPosted(PurchaseInvoiceId: Guid; Url: Text[250])
- begin
- end;
-#endif
-
[ExternalBusinessEvent('PurchaseInvoicePosted', 'Purchase invoice posted', 'This business event is triggered when a vendor invoice is posted as part of the Procure to Pay process.', EventCategory::"Accounts Payable", '1.0')]
local procedure PurchaseInvoicePosted(PurchaseInvoiceAPIId: Guid; PurchaseInvoiceSystemId: Guid; Url: Text[250]; WebClientUrl: Text[250])
begin
diff --git a/Apps/W1/ExternalEvents/app/src/ARExternalEvents.Codeunit.al b/Apps/W1/ExternalEvents/app/src/ARExternalEvents.Codeunit.al
index b15ae00db6..e6f3ab1f61 100644
--- a/Apps/W1/ExternalEvents/app/src/ARExternalEvents.Codeunit.al
+++ b/Apps/W1/ExternalEvents/app/src/ARExternalEvents.Codeunit.al
@@ -38,9 +38,6 @@ codeunit 38502 "AR External Events"
APIId := SalesInvoiceHeader.SystemId;
Url := ExternalEventsHelper.CreateLink(CopyStr(SalesInvoiceApiUrlTok, 1, 250), APIId);
WebClientUrl := CopyStr(GetUrl(ClientType::Web, CompanyName(), ObjectType::Page, Page::"Posted Sales Invoice", SalesInvoiceHeader), 1, MaxStrLen(WebClientUrl));
-#if not CLEAN23
- SalesInvoicePosted(APIId, Url);
-#endif
SalesInvoicePosted(APIId, SalesInvoiceHeader.SystemId, Url, WebClientUrl);
end;
if SalesCrMemoHeader."No." <> '' then begin
@@ -50,41 +47,15 @@ codeunit 38502 "AR External Events"
APIId := SalesCrMemoHeader.SystemId;
Url := ExternalEventsHelper.CreateLink(CopyStr(SalesCreditMemoApiUrlTok, 1, 250), APIId);
WebClientUrl := CopyStr(GetUrl(ClientType::Web, CompanyName(), ObjectType::Page, Page::"Posted Sales Credit Memo", SalesCrMemoHeader), 1, MaxStrLen(WebClientUrl));
-#if not CLEAN23
- SalesCreditMemoPosted(APIId, Url);
-#endif
SalesCreditMemoPosted(APIId, SalesCrMemoHeader.SystemId, Url, WebClientUrl);
end;
if SalesShipmentHeader."No." <> '' then begin
Url := ExternalEventsHelper.CreateLink(CopyStr(SalesShipmentApiUrlTok, 1, 250), SalesShipmentHeader.SystemId);
WebClientUrl := CopyStr(GetUrl(ClientType::Web, CompanyName(), ObjectType::Page, Page::"Posted Sales Shipment", SalesShipmentHeader), 1, MaxStrLen(WebClientUrl));
-#if not CLEAN23
- SalesShipmentPosted(SalesShipmentHeader.SystemId, Url);
-#endif
SalesShipmentPosted(SalesShipmentHeader.SystemId, Url, WebClientUrl);
end;
end;
-#if not CLEAN23
- [Obsolete('This event is obsolete. Use version 1.0 instead.', '23.0')]
- [ExternalBusinessEvent('SalesInvoicePosted', 'Sales invoice posted ', 'This business event is triggered when a sales invoice is posted as part of the Quote to Cash process.', EventCategory::"Accounts Receivable")]
- procedure SalesInvoicePosted(SalesInvoiceId: Guid; Url: Text[250])
- begin
- end;
-
- [Obsolete('This event is obsolete. Use version 1.0 instead.', '23.0')]
- [ExternalBusinessEvent('SalesCreditMemoPosted', 'Sales credit memo posted', 'This business event is triggered when a sales credit memo is posted.', EventCategory::"Accounts Receivable")]
- procedure SalesCreditMemoPosted(SalesCreditMemoId: Guid; Url: Text[250])
- begin
- end;
-
- [Obsolete('This event is obsolete. Use version 1.0 instead.', '23.0')]
- [ExternalBusinessEvent('SalesShipmentPosted', 'Sales shipment posted', 'This business event is triggered when goods from a sales order are shipped by the internal warehouse/external logistics company. This can trigger Finance Department to post a sales invoice.', EventCategory::"Accounts Receivable")]
- procedure SalesShipmentPosted(SalesShipmentId: Guid; Url: Text[250])
- begin
- end;
-#endif
-
[ExternalBusinessEvent('SalesInvoicePosted', 'Sales invoice posted ', 'This business event is triggered when a sales invoice is posted as part of the Quote to Cash process.', EventCategory::"Accounts Receivable", '1.0')]
procedure SalesInvoicePosted(SalesInvoiceAPIId: Guid; SalesInvoiceSystemId: Guid; Url: Text[250]; WebClientUrl: Text[250])
begin
@@ -111,35 +82,11 @@ codeunit 38502 "AR External Events"
Url := ExternalEventsHelper.CreateLink(CopyStr(CustomerApiUrlTok, 1, 250), Rec.SystemId);
WebClientUrl := CopyStr(GetUrl(ClientType::Web, CompanyName(), ObjectType::Page, Page::"Customer Card", Rec), 1, MaxStrLen(WebClientUrl));
-#if not CLEAN23
- if Rec.Blocked <> Blocked::" " then begin
- CustomerBlocked(Rec.SystemId, Rec.Blocked, Url);
- CustomerBlocked(Rec.SystemId, Rec.Blocked, Url, WebClientUrl);
- end else begin
- CustomerUnBlocked(Rec.SystemId, Rec.Blocked, Url);
- CustomerUnBlocked(Rec.SystemId, Rec.Blocked, Url, WebClientUrl);
- end;
-#else
if Rec.Blocked <> Blocked::" " then
CustomerBlocked(Rec.SystemId, Rec.Blocked, Url, WebClientUrl)
else
CustomerUnBlocked(Rec.SystemId, Rec.Blocked, Url, WebClientUrl);
-#endif
- end;
-
-#if not CLEAN23
- [Obsolete('This event is obsolete. Use version 1.0 instead.', '23.0')]
- [ExternalBusinessEvent('CustomerBlocked', 'Customer blocked', 'This business event is triggered when a customer is blocked for shipping/invoicing.', EventCategory::"Accounts Receivable")]
- local procedure CustomerBlocked(CustomerId: Guid; Blocked: enum "Customer Blocked"; Url: Text[250])
- begin
- end;
-
- [Obsolete('This event is obsolete. Use version 1.0 instead.', '23.0')]
- [ExternalBusinessEvent('CustomerUnBlocked', 'Customer unblocked', 'This business event is triggered when a customer is unblocked for shipping/invoicing.', EventCategory::"Accounts Receivable")]
- local procedure CustomerUnBlocked(CustomerId: Guid; Blocked: enum "Customer Blocked"; Url: Text[250])
- begin
end;
-#endif
[ExternalBusinessEvent('CustomerBlocked', 'Customer blocked', 'This business event is triggered when a customer is blocked for shipping/invoicing.', EventCategory::"Accounts Receivable", '1.0')]
local procedure CustomerBlocked(CustomerId: Guid; Blocked: enum "Customer Blocked"; Url: Text[250]; WebClientUrl: Text[250])
@@ -165,42 +112,14 @@ codeunit 38502 "AR External Events"
exit;
Url := ExternalEventsHelper.CreateLink(CopyStr(CustomerApiUrlTok, 1, 250), Customer.SystemId);
WebClientUrl := CopyStr(GetUrl(ClientType::Web, CompanyName(), ObjectType::Page, Page::"Customer Card", Customer), 1, MaxStrLen(WebClientUrl));
-#if not CLEAN23
- if CustLedgerEntry."Document Type" = CustLedgerEntry."Document Type"::Payment then begin
- EventSalesPaymentPosted(Customer.SystemId, Url);
- EventSalesPaymentPosted(Customer.SystemId, Url, WebClientUrl);
- end;
-#else
if CustLedgerEntry."Document Type" = CustLedgerEntry."Document Type"::Payment then
EventSalesPaymentPosted(Customer.SystemId, Url, WebClientUrl);
-#endif
if Customer."Credit Limit (LCY)" <= 0 then
exit;
Customer.CalcFields("Balance (LCY)");
-#if not CLEAN23
- if Customer."Balance (LCY)" > Customer."Credit Limit (LCY)" then begin
- EventSalesCreditLimitExceeded(Customer.SystemId, Url);
- EventSalesCreditLimitExceeded(Customer.SystemId, Url, WebClientUrl);
- end;
-#else
if Customer."Balance (LCY)" > Customer."Credit Limit (LCY)" then
EventSalesCreditLimitExceeded(Customer.SystemId, Url, WebClientUrl)
-#endif
- end;
-
-#if not CLEAN23
- [Obsolete('This event is obsolete. Use version 1.0 instead.', '23.0')]
- [ExternalBusinessEvent('SalesPaymentPosted', 'Sales payment posted', 'This business event is triggered when a customer payment is posted as part of the Quote to Cash process.', EventCategory::"Accounts Receivable")]
- local procedure EventSalesPaymentPosted(CustomerId: Guid; Url: Text[250])
- begin
- end;
-
- [Obsolete('This event is obsolete. Use version 1.0 instead.', '23.0')]
- [ExternalBusinessEvent('SalesCreditLimitExceeded', 'Sales credit limit exceeded', 'This business event is triggered when the credit limit for a customer is exceeded due to a posted sales invoice/changed credit limit for that customer.', EventCategory::"Accounts Receivable")]
- local procedure EventSalesCreditLimitExceeded(CustomerId: Guid; Url: Text[250])
- begin
end;
-#endif
[ExternalBusinessEvent('SalesPaymentPosted', 'Sales payment posted', 'This business event is triggered when a customer payment is posted as part of the Quote to Cash process.', EventCategory::"Accounts Receivable", '1.0')]
local procedure EventSalesPaymentPosted(CustomerId: Guid; Url: Text[250]; WebClientUrl: Text[250])
diff --git a/Apps/W1/ExternalEvents/app/src/OpportunitiesExternalEvents.Codeunit.al b/Apps/W1/ExternalEvents/app/src/OpportunitiesExternalEvents.Codeunit.al
index 721eb6b82e..b2c5f1cf29 100644
--- a/Apps/W1/ExternalEvents/app/src/OpportunitiesExternalEvents.Codeunit.al
+++ b/Apps/W1/ExternalEvents/app/src/OpportunitiesExternalEvents.Codeunit.al
@@ -19,20 +19,9 @@ codeunit 38506 "Opportunities External Events"
begin
Url := ExternalEventsHelper.CreateLink(CopyStr(OpportunitiesApiUrlTok, 1, 250), Opportunity.SystemId);
WebClientUrl := CopyStr(GetUrl(ClientType::Web, CompanyName(), ObjectType::Page, Page::"Opportunity Card", Opportunity), 1, MaxStrLen(WebClientUrl));
-#if not CLEAN23
- OpportunityQuoted(Opportunity.SystemId, SalesHeader.SystemId, Url);
-#endif
OpportunityQuoted(Opportunity.SystemId, SalesHeader.SystemId, Url, WebClientUrl);
end;
-#if not CLEAN23
- [Obsolete('This event is obsolete. Use version 1.0 instead.', '23.0')]
- [ExternalBusinessEvent('OpportunityQuoted', 'Quote created for opportunity', 'This business event is triggered when a quote is created for an opportunity as part of the Quote to Cash process.', EventCategory::Opportunities)]
- local procedure OpportunityQuoted(OpportunitiesId: Guid; SalesQuoteId: Guid; Url: Text[250])
- begin
- end;
-#endif
-
[ExternalBusinessEvent('OpportunityQuoted', 'Quote created for opportunity', 'This business event is triggered when a quote is created for an opportunity as part of the Quote to Cash process.', EventCategory::Opportunities, '1.0')]
local procedure OpportunityQuoted(OpportunityId: Guid; SalesQuoteId: Guid; Url: Text[250]; WebClientUrl: Text[250])
begin
@@ -49,40 +38,12 @@ codeunit 38506 "Opportunities External Events"
WebClientUrl := CopyStr(GetUrl(ClientType::Web, CompanyName(), ObjectType::Page, Page::"Opportunity Card", Opportunity), 1, MaxStrLen(WebClientUrl));
case Opportunity.Status of
Opportunity.Status::Won:
-#if not CLEAN23
- begin
- OpportunityWon(Opportunity.SystemId, Opportunity.Status, Url);
- OpportunityWon(Opportunity.SystemId, Opportunity.Status, Url, WebClientUrl);
- end;
-#else
OpportunityWon(Opportunity.SystemId, Opportunity.Status, Url, WebClientUrl);
-#endif
Opportunity.Status::Lost:
-#if not CLEAN23
- begin
- OpportunityLost(Opportunity.SystemId, Opportunity.Status, Url);
OpportunityLost(Opportunity.SystemId, Opportunity.Status, Url, WebClientUrl);
- end;
-#else
- OpportunityLost(Opportunity.SystemId, Opportunity.Status, Url, WebClientUrl);
-#endif
end;
end;
-#if not CLEAN23
- [Obsolete('This event is obsolete. Use version 1.0 instead.', '23.0')]
- [ExternalBusinessEvent('OpportunityWon', 'Winning quote converted into sales order', 'This business event is triggered when a winning quote for an opportunity is converted into a sales order as part of the Quote to Cash process.', EventCategory::Opportunities)]
- local procedure OpportunityWon(OpportunitiesId: Guid; Status: Enum "Opportunity Status"; Url: Text[250])
- begin
- end;
-
- [Obsolete('This event is obsolete. Use version 1.0 instead.', '23.0')]
- [ExternalBusinessEvent('OpportunityLost', 'Opportunity closed as lost', 'This business event is triggered when a lost opportunity is closed as part of the Quote to Cash process.', EventCategory::Opportunities)]
- local procedure OpportunityLost(OpportunitiesId: Guid; Status: Enum "Opportunity Status"; Url: Text[250])
- begin
- end;
-#endif
-
[ExternalBusinessEvent('OpportunityWon', 'Winning quote converted into sales order', 'This business event is triggered when a winning quote for an opportunity is converted into a sales order as part of the Quote to Cash process.', EventCategory::Opportunities, '1.0')]
local procedure OpportunityWon(OpportunityId: Guid; Status: Enum "Opportunity Status"; Url: Text[250]; WebClientUrl: Text[250])
begin
@@ -105,20 +66,9 @@ codeunit 38506 "Opportunities External Events"
exit;
Url := ExternalEventsHelper.CreateLink(CopyStr(OpportunitiesApiUrlTok, 1, 250), Opportunity.SystemId);
WebClientUrl := CopyStr(GetUrl(ClientType::Web, CompanyName(), ObjectType::Page, Page::"Opportunity Card", Opportunity), 1, MaxStrLen(WebClientUrl));
-#if not CLEAN23
- OpportunityActivated(Opportunity.SystemId, Url);
-#endif
OpportunityActivated(Opportunity.SystemId, Url, WebClientUrl);
end;
-#if not CLEAN23
- [Obsolete('This event is obsolete. Use version 1.0 instead.', '23.0')]
- [ExternalBusinessEvent('OpportunityActivated', 'Opportunity activated', 'This business event is triggered when an opportunity is activated as part of the Quote to Cash process.', EventCategory::Opportunities)]
- local procedure OpportunityActivated(OpportunitiesId: Guid; Url: Text[250])
- begin
- end;
-#endif
-
[ExternalBusinessEvent('OpportunityActivated', 'Opportunity activated', 'This business event is triggered when an opportunity is activated as part of the Quote to Cash process.', EventCategory::Opportunities, '1.0')]
local procedure OpportunityActivated(OpportunityId: Guid; Url: Text[250]; WebClientUrl: Text[250])
begin
diff --git a/Apps/W1/ExternalEvents/app/src/PurchasesExternalEvents.Codeunit.al b/Apps/W1/ExternalEvents/app/src/PurchasesExternalEvents.Codeunit.al
index 05c07c9b63..7ba2c5e143 100644
--- a/Apps/W1/ExternalEvents/app/src/PurchasesExternalEvents.Codeunit.al
+++ b/Apps/W1/ExternalEvents/app/src/PurchasesExternalEvents.Codeunit.al
@@ -21,21 +21,10 @@ codeunit 38505 "Purchases External Events"
if PurchaseHeader.Status = PurchaseHeader.Status::Released then begin
Url := ExternalEventsHelper.CreateLink(PurchaseOrderApiUrlTok, PurchaseHeader.SystemId);
WebClientUrl := CopyStr(GetUrl(ClientType::Web, CompanyName(), ObjectType::Page, Page::"Purchase Order", PurchaseHeader), 1, MaxStrLen(WebClientUrl));
-#if not CLEAN23
- MyBusinessEventPurchaseOrderReleased(PurchaseHeader.SystemId, Url);
-#endif
MyBusinessEventPurchaseOrderReleased(PurchaseHeader.SystemId, Url, WebClientUrl);
end;
end;
-#if not CLEAN23
- [Obsolete('This event is obsolete. Use version 1.0 instead.', '23.0')]
- [ExternalBusinessEvent('PurchaseOrderReleased', 'Purchase order released', 'This business event is triggered when a purchase order is released to the internal warehouse/external logistics company, so they''re ready to receive goods coming their way. This trigger occurs when the Release button is clicked on Purchase Order page in Business Central.', EventCategory::Purchasing)]
- local procedure MyBusinessEventPurchaseOrderReleased(PurchaseOrderId: Guid; Url: Text[250])
- begin
- end;
-#endif
-
[ExternalBusinessEvent('PurchaseOrderReleased', 'Purchase order released', 'This business event is triggered when a purchase order is released to the internal warehouse/external logistics company, so they''re ready to receive goods coming their way. This trigger occurs when the Release button is clicked on Purchase Order page in Business Central.', EventCategory::Purchasing, '1.0')]
local procedure MyBusinessEventPurchaseOrderReleased(PurchaseOrderId: Guid; Url: Text[250]; WebClientUrl: Text[250])
begin
diff --git a/Apps/W1/ExternalEvents/app/src/SalesExternalEvents.Codeunit.al b/Apps/W1/ExternalEvents/app/src/SalesExternalEvents.Codeunit.al
index 9de69bb259..36509266bf 100644
--- a/Apps/W1/ExternalEvents/app/src/SalesExternalEvents.Codeunit.al
+++ b/Apps/W1/ExternalEvents/app/src/SalesExternalEvents.Codeunit.al
@@ -21,21 +21,10 @@ codeunit 38504 "Sales External Events"
if SalesHeader.Status = SalesHeader.Status::Released then begin
Url := ExternalEventsHelper.CreateLink(SalesOrderApiUrlTok, SalesHeader.SystemId);
WebClientUrl := CopyStr(GetUrl(ClientType::Web, CompanyName(), ObjectType::Page, Page::"Sales Order", SalesHeader), 1, MaxStrLen(WebClientUrl));
-#if not CLEAN23
- SalesOrderReleased(SalesHeader.SystemId, Url);
-#endif
SalesOrderReleased(SalesHeader.SystemId, Url, WebClientUrl);
end;
end;
-#if not CLEAN23
- [Obsolete('This event is obsolete. Use version 1.0 instead.', '23.0')]
- [ExternalBusinessEvent('SalesOrderReleased', 'Sales order released', 'This business event is triggered when a sales order is released to the internal warehouse/external logistics company, so they''re ready to pick and ship goods. This trigger occurs when the Release button is clicked on Sales Order page in Business Central.', EventCategory::Sales)]
- local procedure SalesOrderReleased(SalesOrderId: Guid; Url: Text[250])
- begin
- end;
-#endif
-
[ExternalBusinessEvent('SalesOrderReleased', 'Sales order released', 'This business event is triggered when a sales order is released to the internal warehouse/external logistics company, so they''re ready to pick and ship goods. This trigger occurs when the Release button is clicked on Sales Order page in Business Central.', EventCategory::Sales, '1.0')]
local procedure SalesOrderReleased(SalesOrderId: Guid; Url: Text[250]; WebClientUrl: Text[250])
begin
diff --git a/Apps/W1/FieldServiceIntegration/app/src/Codeunits/FSIntTableSubscriber.Codeunit.al b/Apps/W1/FieldServiceIntegration/app/src/Codeunits/FSIntTableSubscriber.Codeunit.al
index f86e649bd2..e27b4c980d 100644
--- a/Apps/W1/FieldServiceIntegration/app/src/Codeunits/FSIntTableSubscriber.Codeunit.al
+++ b/Apps/W1/FieldServiceIntegration/app/src/Codeunits/FSIntTableSubscriber.Codeunit.al
@@ -406,6 +406,8 @@ codeunit 6610 "FS Int. Table Subscriber"
var
FSConnectionSetup: Record "FS Connection Setup";
IntegrationTableMapping: Record "Integration Table Mapping";
+ IntegrationFieldMapping: Record "Integration Field Mapping";
+ ProjectJournalLine: Record "Job Journal Line";
FSSetupDefaults: Codeunit "FS Setup Defaults";
begin
if not Rec."Location Mandatory" then
@@ -414,10 +416,15 @@ codeunit 6610 "FS Int. Table Subscriber"
if not FSConnectionSetup.IsEnabled() then
exit;
- if IntegrationTableMapping.Get('LOCATION') then
- exit;
+ if not IntegrationTableMapping.Get('LOCATION') then
+ FSSetupDefaults.ResetLocationMapping(FSConnectionSetup, 'LOCATION', true, true);
- FSSetupDefaults.ResetLocationMapping(FSConnectionSetup, 'LOCATION', true, true);
+ IntegrationFieldMapping.SetFilter("Integration Table Mapping Name", 'PJLINE-WORDERPRODUCT');
+ IntegrationFieldMapping.SetRange("Field No.", ProjectJournalLine.FieldNo("Location Code"));
+ if IntegrationFieldMapping.IsEmpty() then begin
+ FSSetupDefaults.SetLocationFieldMapping(true);
+ FSSetupDefaults.ResetProjectJournalLineWOProductMapping(FSConnectionSetup, 'PJLINE-WORDERPRODUCT', true);
+ end;
end;
[EventSubscriber(ObjectType::Codeunit, Codeunit::"CRM Setup Defaults", 'OnResetItemProductMappingOnAfterInsertFieldsMapping', '', false, false)]
@@ -992,6 +999,7 @@ codeunit 6610 "FS Int. Table Subscriber"
JobJournalLine.Validate("Line Type", JobJournalLine."Line Type"::Billable);
// set Item, but for work order products we must keep its Business Central Unit Cost
JobJournalLine.Validate("No.", Item."No.");
+ JobJournalLine.Validate(Description, CopyStr(FSWorkOrderProduct.Name, 1, MaxStrLen(JobJournalLine.Description)));
JobJournalLine.Validate("Unit Cost", Item."Unit Cost");
JobJournalLine.Validate(Quantity, FSQuantity - QuantityCurrentlyConsumed);
JobJournalLine.Validate("Unit Price", Item."Unit Price");
diff --git a/Apps/W1/FieldServiceIntegration/app/src/Codeunits/FSSetupDefaults.Codeunit.al b/Apps/W1/FieldServiceIntegration/app/src/Codeunits/FSSetupDefaults.Codeunit.al
index fce5ed08e9..031c16c5c4 100644
--- a/Apps/W1/FieldServiceIntegration/app/src/Codeunits/FSSetupDefaults.Codeunit.al
+++ b/Apps/W1/FieldServiceIntegration/app/src/Codeunits/FSSetupDefaults.Codeunit.al
@@ -21,6 +21,7 @@ codeunit 6611 "FS Setup Defaults"
{
var
CRMProductName: Codeunit "CRM Product Name";
+ LocationFieldMapping: Boolean;
JobQueueCategoryLbl: Label 'BCI INTEG', Locked = true;
OptionJobQueueCategoryLbl: Label 'BCI OPTION', Locked = true;
CategoryTok: Label 'AL Field Service Integration', Locked = true;
@@ -179,12 +180,13 @@ codeunit 6611 "FS Setup Defaults"
IntegrationFieldMapping.Direction::FromIntegrationTable,
'', true, false);
- InsertIntegrationFieldMapping(
- IntegrationTableMappingName,
- JobJournalLine.FieldNo("Location Code"),
- FSWorkOrderProduct.FieldNo(WarehouseId),
- IntegrationFieldMapping.Direction::FromIntegrationTable,
- '', true, false);
+ if LocationFieldMapping then
+ InsertIntegrationFieldMapping(
+ IntegrationTableMappingName,
+ JobJournalLine.FieldNo("Location Code"),
+ FSWorkOrderProduct.FieldNo(WarehouseId),
+ IntegrationFieldMapping.Direction::FromIntegrationTable,
+ '', true, false);
OnAfterResetProjectJournalLineWOProductMapping(IntegrationTableMappingName);
@@ -559,6 +561,11 @@ codeunit 6611 "FS Setup Defaults"
JobQueueEntry.Insert(true);
end;
+ internal procedure SetLocationFieldMapping(DoFieldMapping: Boolean)
+ begin
+ LocationFieldMapping := DoFieldMapping;
+ end;
+
[EventSubscriber(ObjectType::Codeunit, Codeunit::"CRM Setup Defaults", 'OnGetCDSTableNo', '', false, false)]
local procedure ReturnProxyTableNoOnGetCDSTableNo(BCTableNo: Integer; var CDSTableNo: Integer; var Handled: Boolean)
var
diff --git a/Apps/W1/HybridBCLast/app/src/codeunits/TableAndFieldMoveMappings.Codeunit.al b/Apps/W1/HybridBCLast/app/src/codeunits/TableAndFieldMoveMappings.Codeunit.al
new file mode 100644
index 0000000000..ae3f0253b0
--- /dev/null
+++ b/Apps/W1/HybridBCLast/app/src/codeunits/TableAndFieldMoveMappings.Codeunit.al
@@ -0,0 +1,265 @@
+namespace Microsoft.DataMigration;
+
+using System.Migration;
+using System.Reflection;
+using Microsoft.Foundation.NoSeries;
+using System.Environment;
+using Microsoft.Foundation.AuditCodes;
+
+codeunit 40030 "Table and Field Move Mappings"
+{
+ Access = Internal;
+ InherentPermissions = X;
+ InherentEntitlements = X;
+
+ var
+ BaseAppAppIdLbl: Label '437dbf0e-84ff-417a-965d-ed2bb9650972', Locked = true;
+ BaseApplicationTok: Label 'Base Application', Locked = true;
+ BusinessFoundationAppIdLbl: Label 'f3552374-a1f2-4356-848e-196002525837', Locked = true;
+ BusinessFoundationTok: Label 'Business Foundation', Locked = true;
+ SQLInvalidCharsLbl: Label '.""\/''%][', Locked = true;
+
+ local procedure AddMappings()
+ begin
+ AddNoSeriesMappings();
+ AddAuditCodesMappings();
+ end;
+
+ local procedure AddNoSeriesMappings()
+ var
+ TableNos: List of [Integer];
+ AppliesFromVersion: Version;
+ begin
+ AppliesFromVersion := Version.Create(24, 0);
+ TableNos.Add(Database::"No. Series");
+ TableNos.Add(Database::"No. Series Line");
+ TableNos.Add(Database::"No. Series Relationship");
+ AddTableMappingListFromBaseappToBusinessFoundation(TableNos, AppliesFromVersion, true);
+ AddTableMappingFromBaseappToBusinessFoundation(Database::"No. Series Tenant", AppliesFromVersion, false); // has replicate data = false?
+
+ AddLocalizationNoSeriesMappings();
+ end;
+
+ local procedure AddLocalizationNoSeriesMappings()
+ var
+ EnvironmentInformation: Codeunit "Environment Information";
+ FieldNos: List of [Integer];
+ AppliesFromVersion: Version;
+ begin
+ if EnvironmentInformation.GetApplicationFamily() <> 'IT' then
+ exit;
+ AppliesFromVersion := Version.Create(24, 0);
+
+#if not CLEAN24
+#pragma warning disable AL0432
+ AddTableMappingFromBaseappToBusinessFoundation(Database::"No. Series Line Sales", AppliesFromVersion, true);
+ AddTableMappingFromBaseappToBusinessFoundation(Database::"No. Series Line Purchase", AppliesFromVersion, true);
+#pragma warning Restore AL0432
+#endif
+ FieldNos.AddRange(12100, 12101, 12102, 12103);
+ AddTableFieldMappingListFromBusinessFoundationToBaseApp(Database::"No. Series", FieldNos, AppliesFromVersion, true);
+ end;
+
+ local procedure AddAuditCodesMappings()
+ var
+ TableNos: List of [Integer];
+ FieldNos: List of [Integer];
+ AppliesFromVersion: Version;
+ begin
+ AppliesFromVersion := Version.Create(25, 0);
+ TableNos.AddRange(Database::"Source Code", Database::"Source Code Setup", Database::"Reason Code", Database::"Return Reason");
+ AddTableMappingListFromBaseappToBusinessFoundation(TableNos, AppliesFromVersion, true);
+
+ FieldNos.AddRange(2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 16, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 840, 900, 1000, 1001, 1100, 1102, 1104, 1105, 1700, 1701, 1702, 5400, 5402, 5403, 5404, 5500, 5502, 5600, 5601, 5602, 5603, 5604, 5605, 5700, 5800, 5801, 5850, 5851, 5875, 5900, 7139, 7300, 7302, 7303, 7304, 7305, 7306, 7307);
+ AddTableFieldMappingListFromBusinessFoundationToBaseApp(Database::"Source Code Setup", FieldNos, AppliesFromVersion, true);
+
+ AddTableFieldMappingFromBusinessFoundationToBaseApp(Database::"Return Reason", 3, AppliesFromVersion, true);
+ AddTableFieldMappingFromBusinessFoundationToBaseApp(Database::"Return Reason", 4, AppliesFromVersion, true);
+
+ AddLocalizationAuditCodesMappings();
+ end;
+
+ local procedure AddLocalizationAuditCodesMappings()
+ var
+ EnvironmentInformation: Codeunit "Environment Information";
+ FieldNos: List of [Integer];
+ AppliesFromVersion: Version;
+ begin
+ AppliesFromVersion := Version.Create(25, 0);
+ case EnvironmentInformation.GetApplicationFamily() of
+ 'AU', 'NZ':
+ FieldNos.Add(28040);
+ 'BE':
+ FieldNos.AddRange(11307, 2000020);
+ 'CA', 'US':
+ FieldNos.AddRange(10002, 10003);
+ 'DE', 'AT', 'CH':
+ FieldNos.Add(5005270);
+ 'ES':
+ FieldNos.Add(7000000);
+ 'FI':
+ FieldNos.Add(13400);
+ 'NL':
+ FieldNos.AddRange(11400, 11401);
+ 'RU':
+ FieldNos.AddRange(12400, 12401, 12402, 12403, 12404, 12405, 12406, 12407, 12408, 12409, 12410, 12411, 12470, 12471, 12472, 17301);
+ end;
+ AddTableFieldMappingListFromBusinessFoundationToBaseApp(Database::"Source Code Setup", FieldNos, AppliesFromVersion, true);
+
+ Clear(FieldNos);
+ case EnvironmentInformation.GetApplicationFamily() of
+ 'AU', 'NZ':
+ FieldNos.Add(28160);
+ 'FR':
+ FieldNos.Add(10810);
+ end;
+ AddTableFieldMappingListFromBusinessFoundationToBaseApp(Database::"Source Code", FieldNos, AppliesFromVersion, true);
+ end;
+
+ local procedure AddTableMappingListFromBaseappToBusinessFoundation(TableNos: List of [Integer]; AppliesFromVersion: Version; PerCompany: Boolean)
+ var
+ TableNo: Integer;
+ begin
+ foreach TableNo in TableNos do
+ AddTableMappingFromBaseappToBusinessFoundation(TableNo, AppliesFromVersion, PerCompany);
+ end;
+
+ local procedure AddTableMappingFromBaseappToBusinessFoundation(TableNo: Integer; AppliesFromVersion: Version; PerCompany: Boolean)
+ var
+ RecordRef: RecordRef;
+ CurrModuleInfo: ModuleInfo;
+ begin
+ NavApp.GetCurrentModuleInfo(CurrModuleInfo);
+ RecordRef.Open(TableNo);
+ AddTableMapping(BaseAppAppIdLbl, BaseApplicationTok, RecordRef.Number, CopyStr(RecordRef.Name, 1, 30), false, '', BusinessFoundationAppIdLbl, BusinessFoundationTok, RecordRef.Number, CopyStr(RecordRef.Name, 1, 30), false, '', AppliesFromVersion, CurrModuleInfo.Id, PerCompany);
+ end;
+
+ local procedure AddTableFieldMappingListFromBusinessFoundationToBaseApp(TableNo: Integer; FieldNos: List of [Integer]; AppliesFromVersion: Version; PerCompany: Boolean)
+ var
+ FieldNo: Integer;
+ begin
+ foreach FieldNo in FieldNos do
+ AddTableFieldMappingFromBusinessFoundationToBaseApp(TableNo, FieldNo, AppliesFromVersion, PerCompany);
+ end;
+
+ local procedure AddTableFieldMappingFromBusinessFoundationToBaseApp(TableNo: Integer; FieldNo: Integer; AppliesFromVersion: Version; PerCompany: Boolean)
+ var
+ Field: Record Field;
+ CurrModuleInfo: ModuleInfo;
+ begin
+ NavApp.GetCurrentModuleInfo(CurrModuleInfo);
+ Field.Get(TableNo, FieldNo);
+ AddTableFieldMapping(BusinessFoundationAppIdLbl, BusinessFoundationTok, Field.TableName, Field.FieldName, false, '', BaseAppAppIdLbl, BaseApplicationTok, Field.TableName, true, Field.TableName, Field.FieldName, AppliesFromVersion, CurrModuleInfo.Id, PerCompany);
+ end;
+
+ local procedure AddTableMapping(FromAppID: Guid; FromAppName: Text[150]; FromTableNo: Integer; FromTableName: Text[150]; FromIsExtensionTable: Boolean; FromBaseTableName: Text[150]; ToAppID: Guid; ToAppName: Text[150]; ToTableNo: Integer; ToTableName: Text[150]; ToIsExtensionTable: Boolean; ToBaseTableName: Text[150]; AppliesFromVersion: Version; InserterAppID: Guid; PerCompany: Boolean)
+ var
+ TableMappings: Record "Table Mappings";
+ begin
+ TableMappings.SetRange("To Table SQL Name", ConvertNameToSqlName(ToTableName));
+ TableMappings.SetRange("To App Name", ToAppName);
+ TableMappings.SetRange("To APP ID", ToAppID);
+ TableMappings.SetRange("To Base Table SQL Name", ConvertNameToSqlName(ToBaseTableName));
+ TableMappings.SetRange("Applies From BC Major Release", AppliesFromVersion.Major);
+ TableMappings.SetRange("Applies From BC Minor Release", AppliesFromVersion.Minor);
+ if TableMappings.FindFirst() then
+ exit;
+
+ // TableMappings."ID" // autoincrement
+ TableMappings."From APP ID" := FromAppID;
+ TableMappings."From App Name" := FromAppName;
+ TableMappings."From Table ID" := FromTableNo;
+ TableMappings."From Table Name" := FromTableName;
+ TableMappings."From Table SQL Name" := CopyStr(ConvertNameToSqlName(FromTableName), 1, MaxStrLen(TableMappings."From Table SQL Name"));
+ TableMappings."From Is Extension Table" := FromIsExtensionTable;
+ TableMappings."From Base Table Name" := FromBaseTableName;
+ TableMappings."From Base Table SQL Name" := CopyStr(ConvertNameToSqlName(FromBaseTableName), 1, MaxStrLen(TableMappings."From Base Table SQL Name"));
+ TableMappings."To APP ID" := ToAppID;
+ TableMappings."To App Name" := ToAppName;
+ TableMappings."To Table ID" := ToTableNo;
+ TableMappings."To Table Name" := ToTableName;
+ TableMappings."To Table SQL Name" := CopyStr(ConvertNameToSqlName(ToTableName), 1, MaxStrLen(TableMappings."To Table SQL Name"));
+ TableMappings."To Is Extension Table" := ToIsExtensionTable;
+ TableMappings."To Base Table Name" := ToBaseTableName;
+ TableMappings."To Base Table SQL Name" := CopyStr(ConvertNameToSqlName(ToBaseTableName), 1, MaxStrLen(TableMappings."To Base Table SQL Name"));
+ TableMappings."Inserter App ID" := InserterAppID;
+ TableMappings."Applies From BC Major Release" := AppliesFromVersion.Major;
+ TableMappings."Applies From BC Minor Release" := AppliesFromVersion.Minor;
+ TableMappings."Per Company" := PerCompany;
+ TableMappings.Insert(true);
+ end;
+
+ local procedure AddTableFieldMapping(FromAppID: Guid; FromAppName: Text[150]; FromTableName: Text[150]; FromTableFieldName: Text[150]; FromIsExtensionTable: Boolean; FromBaseTableName: Text[150]; ToAppID: Guid; ToAppName: Text[150]; ToTableName: Text[150]; ToIsExtensionTable: Boolean; ToBaseTableName: Text[150]; ToTableFieldName: Text[150]; AppliesFromVersion: Version; InserterAppID: Guid; PerCompany: Boolean)
+ var
+ TableFieldMappings: Record "Table Field Mappings";
+ begin
+ TableFieldMappings.SetRange("To Table SQL Name", ConvertNameToSqlName(ToTableName));
+ TableFieldMappings.SetRange("To App Name", ToAppName);
+ TableFieldMappings.SetRange("To APP ID", ToAppID);
+ TableFieldMappings.SetRange("To Field SQL Name", ConvertNameToSqlName(ToTableFieldName));
+ TableFieldMappings.SetRange("To Base Table SQL Name", ConvertNameToSqlName(ToBaseTableName));
+ TableFieldMappings.SetRange("Applies From BC Major Release", AppliesFromVersion.Major);
+ TableFieldMappings.SetRange("Applies From BC Minor Release", AppliesFromVersion.Minor);
+ if TableFieldMappings.FindFirst() then
+ exit;
+
+ // TableFieldMappings."ID" // autoincrement
+ TableFieldMappings."From APP ID" := FromAppID;
+ TableFieldMappings."From App Name" := FromAppName;
+ TableFieldMappings."From Table Name" := FromTableName;
+ TableFieldMappings."From Table SQL Name" := CopyStr(ConvertNameToSqlName(FromTableName), 1, MaxStrLen(TableFieldMappings."From Table SQL Name"));
+ TableFieldMappings."From Table Field Name" := FromTableFieldName;
+ TableFieldMappings."From Field SQL Name" := CopyStr(ConvertNameToSqlName(FromTableFieldName), 1, MaxStrLen(TableFieldMappings."From Field SQL Name"));
+ TableFieldMappings."From Is Extension Table" := FromIsExtensionTable;
+ TableFieldMappings."From Base Table Name" := FromBaseTableName;
+ TableFieldMappings."From Base Table SQL Name" := CopyStr(ConvertNameToSqlName(FromBaseTableName), 1, MaxStrLen(TableFieldMappings."From Base Table SQL Name"));
+ TableFieldMappings."To APP ID" := ToAppID;
+ TableFieldMappings."To App Name" := ToAppName;
+ TableFieldMappings."To Table Name" := ToTableName;
+ TableFieldMappings."To Table SQL Name" := CopyStr(ConvertNameToSqlName(ToTableName), 1, MaxStrLen(TableFieldMappings."To Table SQL Name"));
+ TableFieldMappings."To Table Field Name" := ToTableFieldName;
+ TableFieldMappings."To Field SQL Name" := CopyStr(ConvertNameToSqlName(ToTableFieldName), 1, MaxStrLen(TableFieldMappings."To Field SQL Name"));
+ TableFieldMappings."To Is Extension Table" := ToIsExtensionTable;
+ TableFieldMappings."To Base Table Name" := ToBaseTableName;
+ TableFieldMappings."To Base Table SQL Name" := CopyStr(ConvertNameToSqlName(ToBaseTableName), 1, MaxStrLen(TableFieldMappings."To Base Table SQL Name"));
+ TableFieldMappings."Inserter App ID" := InserterAppID;
+ TableFieldMappings."Applies From BC Major Release" := AppliesFromVersion.Major;
+ TableFieldMappings."Applies From BC Minor Release" := AppliesFromVersion.Minor;
+ TableFieldMappings."Per Company" := PerCompany;
+ TableFieldMappings.Insert(true);
+ end;
+
+ local procedure DeleteTableMappings()
+ var
+ TableMappings: Record "Table Mappings";
+ TableFieldMappings: Record "Table Field Mappings";
+ begin
+ if not TableMappings.IsEmpty() then
+ TableMappings.DeleteAll();
+ if not TableFieldMappings.IsEmpty() then
+ TableFieldMappings.DeleteAll();
+ end;
+
+ local procedure ConvertNameToSqlName(Name: Text): Text
+ var
+ ValidChars: Text;
+ begin
+ ValidChars := PadStr('', StrLen(SQLInvalidCharsLbl), '_');
+ exit(ConvertStr(Name, SQLInvalidCharsLbl, ValidChars));
+ end;
+
+ [EventSubscriber(ObjectType::Codeunit, Codeunit::"Hybrid Cloud Management", 'OnInsertDefaultTableMappings', '', false, false)]
+ local procedure OnInsertDefaultTableMappings(DeleteExisting: Boolean; ProductID: Text[250])
+ var
+ HybridBCLastManagement: Codeunit "Hybrid BC Last Management";
+ begin
+ if not HybridBCLastManagement.GetBCLastProductEnabled() then
+ exit;
+
+ if DeleteExisting then
+ DeleteTableMappings();
+
+ // Insert table mappings
+ AddMappings();
+ end;
+}
\ No newline at end of file
diff --git a/Apps/W1/HybridBCLast/app/src/pages/TableFieldMappings.page.al b/Apps/W1/HybridBCLast/app/src/pages/TableFieldMappings.page.al
new file mode 100644
index 0000000000..30be239ccc
--- /dev/null
+++ b/Apps/W1/HybridBCLast/app/src/pages/TableFieldMappings.page.al
@@ -0,0 +1,115 @@
+namespace Microsoft.DataMigration;
+
+using System.Migration;
+
+page 40031 "Table Field Mappings"
+{
+ PageType = List;
+ ApplicationArea = All;
+ UsageCategory = Lists;
+ SourceTable = "Table Field Mappings";
+ InherentPermissions = X;
+ InherentEntitlements = X;
+
+ layout
+ {
+ area(Content)
+ {
+ repeater(Mappings)
+ {
+ field(ID; Rec.ID)
+ {
+ ToolTip = 'Specifies the ID.';
+ }
+ field(FromTableName; Rec."From Table Name")
+ {
+ Tooltip = 'Specifies the From Table Name';
+ }
+ field(FromTableSQLName; Rec."From Table SQL Name")
+ {
+ Tooltip = 'Specifies the From Table SQL Name';
+ }
+ field(FromTableFieldName; Rec."From Table Field Name")
+ {
+ ToolTip = 'Specifies the From Table Field Name';
+ }
+ field(FromFieldSQLName; Rec."From Field SQL Name")
+ {
+ ToolTip = 'Specifies the From Field SQL Name';
+ }
+ field(FromAppID; Rec."From APP ID")
+ {
+ Tooltip = 'Specifies the From APP ID';
+ }
+ field(FromAppName; Rec."From App Name")
+ {
+ Tooltip = 'Specifies the From App Name';
+ }
+ field(FromIsExtensionTable; Rec."From Is Extension Table")
+ {
+ Tooltip = 'Specifies the From Is Extension Table';
+ }
+ field(FromBaseTableName; Rec."From Base Table Name")
+ {
+ Tooltip = 'Specifies the From Base Table Name';
+ }
+ field(FromBaseTableSQLName; Rec."From Base Table SQL Name")
+ {
+ Tooltip = 'Specifies the From Base Table SQL Name';
+ }
+ field(ToTableName; Rec."To Table Name")
+ {
+ Tooltip = 'Specifies the To Table Name';
+ }
+ field(ToTableSQLName; Rec."To Table SQL Name")
+ {
+ Tooltip = 'Specifies the To Table SQL Name';
+ }
+ field(ToTableFieldName; Rec."To Table Field Name")
+ {
+ ToolTip = 'Specifies the To Table Field Name';
+ }
+ field(ToFieldSQLName; Rec."To Field SQL Name")
+ {
+ ToolTip = 'Specifies the To Field SQL Name';
+ }
+ field(ToAppId; Rec."To APP ID")
+ {
+ Tooltip = 'Specifies the To APP ID';
+ }
+ field(ToAppName; Rec."To App Name")
+ {
+ Tooltip = 'Specifies the To App Name';
+ }
+ field(ToIsExtensionTable; Rec."To Is Extension Table")
+ {
+ Tooltip = 'Specifies the To Is Extension Table';
+ }
+ field(ToBaseTableName; Rec."To Base Table Name")
+ {
+ Tooltip = 'Specifies the To Base Table Name';
+ }
+ field(ToBaseTableSQLName; Rec."To Base Table SQL Name")
+ {
+ Tooltip = 'Specifies the To Base Table SQL Name';
+ }
+ field(InserterAppId; Rec."Inserter App ID")
+ {
+ Tooltip = 'Specifies the Inserter App ID';
+ }
+ field(AppliesFromBCMajorRelease; Rec."Applies From BC Major Release")
+ {
+ Tooltip = 'Specifies the Applies From BC Major Release';
+ }
+ field(AppliesFromBCMinorRelease; Rec."Applies From BC Minor Release")
+ {
+ Tooltip = 'Specifies the Applies From BC Minor Release';
+ }
+ field(PerCompany; Rec."Per Company")
+ {
+ Tooltip = 'Specifies the Per Company';
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Apps/W1/HybridBCLast/app/src/pages/TableMappings.page.al b/Apps/W1/HybridBCLast/app/src/pages/TableMappings.page.al
new file mode 100644
index 0000000000..3a17634d2a
--- /dev/null
+++ b/Apps/W1/HybridBCLast/app/src/pages/TableMappings.page.al
@@ -0,0 +1,107 @@
+namespace Microsoft.DataMigration;
+
+using System.Migration;
+
+page 40030 "Table Mappings"
+{
+ PageType = List;
+ ApplicationArea = All;
+ UsageCategory = Lists;
+ SourceTable = "Table Mappings";
+ InherentPermissions = X;
+ InherentEntitlements = X;
+
+ layout
+ {
+ area(Content)
+ {
+ repeater(Mappings)
+ {
+ field(ID; Rec.ID)
+ {
+ ToolTip = 'Specifies the ID.';
+ }
+ field(FromTableName; Rec."From Table Name")
+ {
+ Tooltip = 'Specifies the From Table Name';
+ }
+ field(FromTableSQLName; Rec."From Table SQL Name")
+ {
+ Tooltip = 'Specifies the From Table SQL Name';
+ }
+ field(FromAppID; Rec."From APP ID")
+ {
+ Tooltip = 'Specifies the From APP ID';
+ }
+ field(FromAppName; Rec."From App Name")
+ {
+ Tooltip = 'Specifies the From App Name';
+ }
+ field(FromIsExtensionTable; Rec."From Is Extension Table")
+ {
+ Tooltip = 'Specifies the From Is Extension Table';
+ }
+ field(FromBaseTableName; Rec."From Base Table Name")
+ {
+ Tooltip = 'Specifies the From Base Table Name';
+ }
+ field(FromBaseTableSQLName; Rec."From Base Table SQL Name")
+ {
+ Tooltip = 'Specifies the From Base Table SQL Name';
+ }
+ field(ToTableName; Rec."To Table Name")
+ {
+ Tooltip = 'Specifies the To Table Name';
+ }
+ field(ToTableSQLName; Rec."To Table SQL Name")
+ {
+ Tooltip = 'Specifies the To Table SQL Name';
+ }
+ field(ToAppId; Rec."To APP ID")
+ {
+ Tooltip = 'Specifies the To APP ID';
+ }
+ field(ToAppName; Rec."To App Name")
+ {
+ Tooltip = 'Specifies the To App Name';
+ }
+ field(ToIsExtensionTable; Rec."To Is Extension Table")
+ {
+ Tooltip = 'Specifies the To Is Extension Table';
+ }
+ field(ToBaseTableName; Rec."To Base Table Name")
+ {
+ Tooltip = 'Specifies the To Base Table Name';
+ }
+ field(ToBaseTableSQLName; Rec."To Base Table SQL Name")
+ {
+ Tooltip = 'Specifies the To Base Table SQL Name';
+ }
+ field(InserterAppId; Rec."Inserter App ID")
+ {
+ Tooltip = 'Specifies the Inserter App ID';
+ }
+ field(AppliesFromBCMajorRelease; Rec."Applies From BC Major Release")
+ {
+ Tooltip = 'Specifies the Applies From BC Major Release';
+ }
+ field(AppliesFromBCMinorRelease; Rec."Applies From BC Minor Release")
+ {
+ Tooltip = 'Specifies the Applies From BC Minor Release';
+ }
+ field(PerCompany; Rec."Per Company")
+ {
+ Tooltip = 'Specifies the Per Company';
+ }
+ field(FromTableId; Rec."From Table ID")
+ {
+ Tooltip = 'Specifies the From Table ID';
+ }
+ field(ToTableID; Rec."To Table ID")
+ {
+ Tooltip = 'Specifies the To Table ID';
+ }
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Apps/W1/HybridBaseDeployment/app/src/pages/AccountantRC.PageExt.al b/Apps/W1/HybridBaseDeployment/app/src/pages/AccountantRC.PageExt.al
deleted file mode 100644
index b3a9bddcdf..0000000000
--- a/Apps/W1/HybridBaseDeployment/app/src/pages/AccountantRC.PageExt.al
+++ /dev/null
@@ -1,35 +0,0 @@
-#if not CLEAN23
-namespace Microsoft.DataMigration;
-
-using Microsoft.Finance.RoleCenters;
-
-pageextension 4018 AccountantRC extends "Accountant Role Center"
-{
- ObsoleteReason = 'Intelligent Cloud Insights is discontinued';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-
- actions
- {
- addlast(Sections)
- {
- group("Intelligent Cloud Insights")
- {
- Caption = 'Intelligent Cloud Insights';
- action("Intelligent Cloud Insight")
- {
- Caption = 'Intelligent Cloud Insights';
- ToolTip = 'Launch the Intelligent Cloud Insights page.';
- Visible = false;
- ObsoleteTag = '18.1';
- ObsoleteReason = 'Intelligent Cloud Insights is discontinued.';
- ObsoleteState = Pending;
- ApplicationArea = Basic, Suite;
- Image = CompanyInformation;
- RunObject = page "Intelligent Cloud Insights";
- }
- }
- }
- }
-}
-#endif
\ No newline at end of file
diff --git a/Apps/W1/HybridBaseDeployment/app/src/pages/BusinessManagerRC.PageExt.al b/Apps/W1/HybridBaseDeployment/app/src/pages/BusinessManagerRC.PageExt.al
deleted file mode 100644
index 73e596163a..0000000000
--- a/Apps/W1/HybridBaseDeployment/app/src/pages/BusinessManagerRC.PageExt.al
+++ /dev/null
@@ -1,35 +0,0 @@
-#if not CLEAN23
-namespace Microsoft.DataMigration;
-
-using Microsoft.Finance.RoleCenters;
-
-pageextension 4019 BusinessManagerRC extends "Business Manager Role Center"
-{
- ObsoleteReason = 'Intelligent Cloud Insights is discontinued';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-
- actions
- {
- addlast(Sections)
- {
- group("Intelligent Cloud Insights")
- {
- Caption = 'Intelligent Cloud Insights';
- action("Intelligent Cloud Insight")
- {
- Caption = 'Intelligent Cloud Insights';
- ToolTip = 'Launch the Intelligent Cloud Insights page.';
- Visible = false;
- ObsoleteTag = '18.1';
- ObsoleteReason = 'Intelligent Cloud Insights is discontinued.';
- ObsoleteState = Pending;
- ApplicationArea = Basic, Suite;
- Image = CompanyInformation;
- RunObject = page "Intelligent Cloud Insights";
- }
- }
- }
- }
-}
-#endif
\ No newline at end of file
diff --git a/Apps/W1/HybridBaseDeployment/app/src/pages/HybridCloudSetupWizard.Page.al b/Apps/W1/HybridBaseDeployment/app/src/pages/HybridCloudSetupWizard.Page.al
index 95d5fca3be..6153f78809 100644
--- a/Apps/W1/HybridBaseDeployment/app/src/pages/HybridCloudSetupWizard.Page.al
+++ b/Apps/W1/HybridBaseDeployment/app/src/pages/HybridCloudSetupWizard.Page.al
@@ -372,220 +372,6 @@ page 4000 "Hybrid Cloud Setup Wizard"
}
}
}
-
-#if not CLEAN23
-#pragma warning disable AA0218, AA0225
- group(Step6)
- {
- Caption = '';
- Visible = false;
-
- ObsoleteReason = 'Scheduling is not supported and will be removed';
- ObsoleteState = Pending;
- ObsoleteTag = '19.0';
-
- group("Para6.1")
- {
- Caption = 'Schedule Data Migration';
- ObsoleteReason = 'Scheduling is not supported and will be removed';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-
- group("Para6.1.1")
- {
- Caption = '';
- Visible = ScheduleVisible;
- InstructionalText = 'Specify when to migrate your data to Business Central. To skip this step, select Next. To setup or change your migration schedule in Business Central, search for ''Cloud Migration Management''.';
- ObsoleteReason = 'Scheduling is not supported and will be removed';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-
- field("Replication Enabled"; Rec."Replication Enabled")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Activate Schedule';
- ToolTip = 'Activate Migration Schedule';
- ObsoleteReason = 'Scheduling is not supported and will be removed';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-
- trigger OnValidate()
- begin
- IsChanged := IsChanged or (Rec."Replication Enabled" <> xRec."Replication Enabled");
- end;
- }
- field(Recurrence; Rec.Recurrence)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Recurrence';
- ObsoleteReason = 'Scheduling is not supported and will be removed';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
- }
- group("Para6.1.1.2")
- {
- ShowCaption = false;
- Visible = (Rec.Recurrence = Rec.Recurrence::Weekly);
- ObsoleteReason = 'Scheduling is not supported and will be removed';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
- grid("Days1")
- {
- ShowCaption = false;
- ObsoleteReason = 'Scheduling is not supported and will be removed';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-
- field(Sunday; Rec.Sunday)
- {
- ApplicationArea = Basic, Suite;
- Enabled = Rec.Recurrence = Rec.Recurrence::Weekly;
- ObsoleteReason = 'Scheduling is not supported and will be removed';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-
- trigger OnValidate()
- begin
- IsChanged := IsChanged or (rec.Sunday <> xRec.Sunday);
- end;
- }
- field(Monday; Rec.Monday)
- {
- ApplicationArea = Basic, Suite;
- Enabled = Rec.Recurrence = Rec.Recurrence::Weekly;
- ObsoleteReason = 'Scheduling is not supported and will be removed';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-
- trigger OnValidate()
- begin
- IsChanged := IsChanged or (rec.Monday <> xRec.Monday);
- end;
- }
- field(Tuesday; Rec.Tuesday)
- {
- ApplicationArea = Basic, Suite;
- Enabled = Rec.Recurrence = Rec.Recurrence::Weekly;
- ObsoleteReason = 'Scheduling is not supported and will be removed';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-
- trigger OnValidate()
- begin
- IsChanged := IsChanged or (rec.Tuesday <> xRec.Tuesday);
- end;
- }
- }
- grid("Days2")
- {
- ShowCaption = false;
- ObsoleteReason = 'Scheduling is not supported and will be removed';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
- field(Wednesday; Rec.Wednesday)
- {
- ApplicationArea = Basic, Suite;
- Enabled = Rec.Recurrence = Rec.Recurrence::Weekly;
- ObsoleteReason = 'Scheduling is not supported and will be removed';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-
- trigger OnValidate()
- begin
- IsChanged := IsChanged or (rec.Wednesday <> xRec.Wednesday);
- end;
- }
- field(Thursday; Rec.Thursday)
- {
- ApplicationArea = Basic, Suite;
- Enabled = Rec.Recurrence = Rec.Recurrence::Weekly;
- ObsoleteReason = 'Scheduling is not supported and will be removed';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-
- trigger OnValidate()
- begin
- IsChanged := IsChanged or (rec.Thursday <> xRec.Thursday);
- end;
- }
- field(Friday; Rec.Friday)
- {
- ApplicationArea = Basic, Suite;
- Enabled = Rec.Recurrence = Rec.Recurrence::Weekly;
- ObsoleteReason = 'Scheduling is not supported and will be removed';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-
- trigger OnValidate()
- begin
- IsChanged := IsChanged or (rec.Friday <> xRec.Friday);
- end;
- }
- }
- grid("Days4")
- {
- ShowCaption = false;
- ObsoleteReason = 'Scheduling is not supported and will be removed';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
- field(Saturday; Rec.Saturday)
- {
- ApplicationArea = Basic, Suite;
- Enabled = Rec.Recurrence = Rec.Recurrence::Weekly;
- ObsoleteReason = 'Scheduling is not supported and will be removed';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-
- trigger OnValidate()
- begin
- IsChanged := IsChanged or (rec.Saturday <> xRec.Saturday);
- end;
- }
- field(Empty1; '')
- {
- ApplicationArea = Basic, Suite;
- Caption = '';
- ObsoleteReason = 'Scheduling is not supported and will be removed';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
- }
- field(Empty2; '')
- {
- ApplicationArea = Basic, Suite;
- Caption = '';
- ObsoleteReason = 'Scheduling is not supported and will be removed';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
- }
- }
- }
- }
- group("Para6.2.1")
- {
- Caption = '';
- ObsoleteReason = 'Scheduling is not supported and will be removed';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
- field("Time to Run"; Rec."Time to Run")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Start time';
- ToolTip = 'Specifies the time at which to start the migration.';
- ObsoleteReason = 'Scheduling is not supported and will be removed';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-
- trigger OnValidate()
- begin
- IsChanged := IsChanged or (rec."Time to Run" <> xRec."Time to Run");
- end;
- }
- }
- }
- }
-#pragma warning restore
-#endif
-
group(StepFinish)
{
Caption = '';
diff --git a/Apps/W1/HybridBaseDeployment/app/src/pages/IntelligentCloudInsights.Page.al b/Apps/W1/HybridBaseDeployment/app/src/pages/IntelligentCloudInsights.Page.al
deleted file mode 100644
index 537bd3f83a..0000000000
--- a/Apps/W1/HybridBaseDeployment/app/src/pages/IntelligentCloudInsights.Page.al
+++ /dev/null
@@ -1,71 +0,0 @@
-#if not CLEAN23
-namespace Microsoft.DataMigration;
-
-using Microsoft.CashFlow.Forecast;
-using System.Integration.PowerBI;
-
-page 4013 "Intelligent Cloud Insights"
-{
- PageType = Card;
- Editable = false;
- InsertAllowed = false;
- DeleteAllowed = false;
- ModifyAllowed = false;
- UsageCategory = Tasks;
- ApplicationArea = Basic, Suite;
- ObsoleteReason = 'Intelligent Cloud Insights is discontinued';
- ObsoleteState = Pending;
- ObsoleteTag = '18.0';
- HelpLink = 'https://go.microsoft.com/fwlink/?linkid=2009758 ';
- layout
- {
- area(Content)
- {
- group(KPIs)
- {
- Caption = 'KPIs';
- part(IntelligentEdgeKPIS; "Intelligent Edge KPIs")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'KPIs';
- }
- part(IntelligentEdgeInsights; "Intelligent Edge Insights")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Insights';
- }
-
- }
- group(Insight)
- {
- Caption = 'Power BI';
- part(PowerBIReportSpinnerPart; "Power BI Report Spinner Part")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Power BI Report';
- UpdatePropagation = Both;
- AccessByPermission = tabledata 6304 = I;
- }
- part(PowerBIReportSpinnerPart2; "Power BI Report Spinner Part")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Power BI Report';
- UpdatePropagation = Both;
- AccessByPermission = tabledata 6304 = I;
- }
- }
- group(MachineLearning)
- {
- Caption = 'Azure ML';
- part(CashFlowForecastChart; "Cash Flow Forecast Chart")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Cash Flow Forecast';
- UpdatePropagation = Both;
- AccessByPermission = TableData 110 = R;
- }
- }
- }
- }
-}
-#endif
\ No newline at end of file
diff --git a/Apps/W1/HybridBaseDeployment/app/src/pages/IntelligentCloudManagement.Page.al b/Apps/W1/HybridBaseDeployment/app/src/pages/IntelligentCloudManagement.Page.al
index aa3d958b2b..60fb30afe0 100644
--- a/Apps/W1/HybridBaseDeployment/app/src/pages/IntelligentCloudManagement.Page.al
+++ b/Apps/W1/HybridBaseDeployment/app/src/pages/IntelligentCloudManagement.Page.al
@@ -87,24 +87,6 @@ page 4003 "Intelligent Cloud Management"
{
area(Processing)
{
-#if not CLEAN23
- action(ManageSchedule)
- {
- Enabled = IsSuper and IsSetupComplete;
- Visible = false;
- ApplicationArea = Basic, Suite;
- Caption = 'Manage Schedule';
- ToolTip = 'Manage migration schedule.';
- Promoted = true;
- PromotedCategory = Process;
- RunObject = page "Intelligent Cloud Schedule";
- RunPageMode = Edit;
- Image = CalendarMachine;
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
- ObsoleteReason = 'Scheduling is not supported and will be removed';
- }
-#endif
action(RunReplicationNow)
{
Enabled = IsSuper and IsSetupComplete;
@@ -395,25 +377,6 @@ page 4003 "Intelligent Cloud Management"
Image = TransmitElectronicDoc;
}
-#if not CLEAN23
- action(InsertSetupRecords)
- {
- ApplicationArea = All;
- Caption = 'Create Setup records';
- Promoted = true;
- PromotedCategory = Process;
- PromotedIsBig = true;
- Visible = false;
- ObsoleteReason = 'Action is not needed';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-
- trigger OnAction()
- begin
- Error('');
- end;
- }
-#endif
action(EnableDisableNewUI)
{
Enabled = IsSuper and IsSetupComplete;
diff --git a/Apps/W1/HybridBaseDeployment/app/src/pages/IntelligentCloudSchedule.Page.al b/Apps/W1/HybridBaseDeployment/app/src/pages/IntelligentCloudSchedule.Page.al
deleted file mode 100644
index 650e14daa2..0000000000
--- a/Apps/W1/HybridBaseDeployment/app/src/pages/IntelligentCloudSchedule.Page.al
+++ /dev/null
@@ -1,95 +0,0 @@
-namespace Microsoft.DataMigration;
-
-#if not CLEAN23
-
-page 4001 "Intelligent Cloud Schedule"
-{
- SourceTable = "Intelligent Cloud Setup";
- InsertAllowed = false;
- DeleteAllowed = false;
- Permissions = tabledata 4003 = rimd;
- ObsoleteReason = 'Scheduling is not supported and will be removed';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-
- layout
- {
- area(Content)
- {
- group(Schedule)
- {
- field("Replication Enabled"; Rec."Replication Enabled")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Activate Schedule';
- ToolTip = 'Activate Migration Schedule';
- }
- field(Recurrence; Rec.Recurrence)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Recurrence';
- ToolTip = 'Specifies the recurrence of the migration schedule.';
- }
- group(Days)
- {
- Caption = 'Select Days';
- Visible = (Rec.Recurrence = Rec.Recurrence::Weekly);
- field(Sunday; Rec.Sunday)
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies whether to run on Sundays.';
- }
- field(Monday; Rec.Monday)
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies whether to run on Mondays.';
- }
- field(Tuesday; Rec.Tuesday)
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies whether to run on Tuesdays.';
- }
- field(Wednesday; Rec.Wednesday)
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies whether to run on Wednesdays.';
- }
- field(Thursday; Rec.Thursday)
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies whether to run on Thursdays.';
- }
- field(Friday; Rec.Friday)
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies whether to run on Fridays.';
- }
- field(Saturday; Rec.Saturday)
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies whether to run on Saturdays.';
- }
- }
- field("Time to Run"; Rec."Time to Run")
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Start time';
- ToolTip = 'Specifies the time at which to start the migration.';
- }
- }
- }
- }
-
- trigger OnModifyRecord(): Boolean
- begin
- if Rec."Replication Enabled" and (Format(Rec."Time to Run") = '') then
- Error(NoScheduleTimeMsg);
- Rec.SetReplicationSchedule();
- end;
-
- var
- NoScheduleTimeMsg: Label 'You must set a schedule time to continue.';
-}
-
-
-#endif
\ No newline at end of file
diff --git a/Apps/W1/HybridBaseDeployment/app/src/pages/JobProjectManagerRC.PageExt.al b/Apps/W1/HybridBaseDeployment/app/src/pages/JobProjectManagerRC.PageExt.al
deleted file mode 100644
index a9cdf65054..0000000000
--- a/Apps/W1/HybridBaseDeployment/app/src/pages/JobProjectManagerRC.PageExt.al
+++ /dev/null
@@ -1,35 +0,0 @@
-#if not CLEAN23
-namespace Microsoft.DataMigration;
-
-using Microsoft.Projects.RoleCenters;
-
-pageextension 4017 JobProjectManagerRC extends "Job Project Manager RC"
-{
- ObsoleteReason = 'Intelligent Cloud Insights is discontinued';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-
- actions
- {
- addlast(Sections)
- {
- group("Intelligent Cloud Insights")
- {
- Caption = 'Intelligent Cloud Insights';
- action("Intelligent Cloud Insight")
- {
- Caption = 'Intelligent Cloud Insights';
- ToolTip = 'Launch the Intelligent Cloud Insights page.';
- Visible = false;
- ObsoleteTag = '18.1';
- ObsoleteReason = 'Intelligent Cloud Insights is discontinued.';
- ObsoleteState = Pending;
- ApplicationArea = Basic, Suite;
- Image = CompanyInformation;
- RunObject = page "Intelligent Cloud Insights";
- }
- }
- }
- }
-}
-#endif
\ No newline at end of file
diff --git a/Apps/W1/HybridBaseDeployment/app/src/pages/SalesAndRelationshipManagerRC.PageExt.al b/Apps/W1/HybridBaseDeployment/app/src/pages/SalesAndRelationshipManagerRC.PageExt.al
deleted file mode 100644
index 07ace5625e..0000000000
--- a/Apps/W1/HybridBaseDeployment/app/src/pages/SalesAndRelationshipManagerRC.PageExt.al
+++ /dev/null
@@ -1,35 +0,0 @@
-#if not CLEAN23
-namespace Microsoft.DataMigration;
-
-using Microsoft.CRM.RoleCenters;
-
-pageextension 4020 SalesAndRelationshipManagerRC extends "Sales & Relationship Mgr. RC"
-{
- ObsoleteReason = 'Intelligent Cloud Insights is discontinued';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-
- actions
- {
- addlast(Sections)
- {
- group("Intelligent Cloud Insights")
- {
- Caption = 'Intelligent Cloud Insights';
- action("Intelligent Cloud Insight")
- {
- Caption = 'Intelligent Cloud Insights';
- ToolTip = 'Launch the Intelligent Cloud Insights page.';
- Visible = false;
- ObsoleteTag = '18.1';
- ObsoleteReason = 'Intelligent Cloud Insights is discontinued.';
- ObsoleteState = Pending;
- ApplicationArea = Basic, Suite;
- Image = CompanyInformation;
- RunObject = page "Intelligent Cloud Insights";
- }
- }
- }
- }
-}
-#endif
\ No newline at end of file
diff --git a/Apps/W1/HybridBaseDeployment/app/src/pages/SalesManagerRC.PageExt.al b/Apps/W1/HybridBaseDeployment/app/src/pages/SalesManagerRC.PageExt.al
deleted file mode 100644
index 1d8bc0a5d2..0000000000
--- a/Apps/W1/HybridBaseDeployment/app/src/pages/SalesManagerRC.PageExt.al
+++ /dev/null
@@ -1,35 +0,0 @@
-#if not CLEAN23
-namespace Microsoft.DataMigration;
-
-using Microsoft.Sales.RoleCenters;
-
-pageextension 4021 SalesManagerRC extends "Sales Manager Role Center"
-{
- ObsoleteReason = 'Intelligent Cloud Insights is discontinued';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-
- actions
- {
- addlast(Sections)
- {
- group("Intelligent Cloud Insights")
- {
- Caption = 'Intelligent Cloud Insights';
- action("Intelligent Cloud Insight")
- {
- Caption = 'Intelligent Cloud Insights';
- ToolTip = 'Launch the Intelligent Cloud Insights page.';
- Visible = false;
- ObsoleteTag = '18.1';
- ObsoleteReason = 'Intelligent Cloud Insights is discontinued.';
- ObsoleteState = Pending;
- ApplicationArea = Basic, Suite;
- Image = CompanyInformation;
- RunObject = page "Intelligent Cloud Insights";
- }
- }
- }
- }
-}
-#endif
\ No newline at end of file
diff --git a/Apps/W1/HybridGP/app/src/Migration/Customers/GPCustomerMigrator.codeunit.al b/Apps/W1/HybridGP/app/src/Migration/Customers/GPCustomerMigrator.codeunit.al
index 510e5e974f..3a5cc75abd 100644
--- a/Apps/W1/HybridGP/app/src/Migration/Customers/GPCustomerMigrator.codeunit.al
+++ b/Apps/W1/HybridGP/app/src/Migration/Customers/GPCustomerMigrator.codeunit.al
@@ -545,11 +545,4 @@ codeunit 4018 "GP Customer Migrator"
if ReceivablesAccountNo = '' then
ReceivablesAccountNo := DefaultReceivablesAccountNo;
end;
-
-#if not CLEAN23
- [Obsolete('Updated to use the OnMigrateCustomerPostingGroups event subscriber.', '23.0')]
- procedure MigrateCustomerClasses()
- begin
- end;
-#endif
}
\ No newline at end of file
diff --git a/Apps/W1/HybridGP/app/src/Migration/Vendors/GPVendorMigrator.codeunit.al b/Apps/W1/HybridGP/app/src/Migration/Vendors/GPVendorMigrator.codeunit.al
index dc632e083e..e4c313d14b 100644
--- a/Apps/W1/HybridGP/app/src/Migration/Vendors/GPVendorMigrator.codeunit.al
+++ b/Apps/W1/HybridGP/app/src/Migration/Vendors/GPVendorMigrator.codeunit.al
@@ -890,11 +890,4 @@ codeunit 4022 "GP Vendor Migrator"
if PayablesAccountNo = '' then
PayablesAccountNo := DefaultPayablesAccountNo;
end;
-
-#if not CLEAN23
- [Obsolete('Updated to use the OnMigrateVendorPostingGroups event subscriber.', '23.0')]
- procedure MigrateVendorClasses()
- begin
- end;
-#endif
}
\ No newline at end of file
diff --git a/Apps/W1/HybridGP/app/src/pages/HybridGPErrorsFactbox.page.al b/Apps/W1/HybridGP/app/src/pages/HybridGPErrorsFactbox.page.al
index 27aedb6943..c55c4313ec 100644
--- a/Apps/W1/HybridGP/app/src/pages/HybridGPErrorsFactbox.page.al
+++ b/Apps/W1/HybridGP/app/src/pages/HybridGPErrorsFactbox.page.al
@@ -36,26 +36,6 @@ page 4031 "Hybrid GP Errors Factbox"
DataSyncStatus.RunModal();
end;
}
-
-#if not CLEAN23
- field("Posting Errors"; Rec.PostingErrorCount)
- {
- Caption = 'Posting Errors';
- ApplicationArea = Basic, Suite;
- Style = Unfavorable;
- StyleExpr = (Rec.PostingErrorCount > 0);
- ToolTip = 'Indicates the number of posting errors that occurred during the migration.';
- Visible = false;
- ObsoleteState = Pending;
- ObsoleteReason = 'Removed functionality because of false positives and performance issues.';
- ObsoleteTag = '23.0';
-
- trigger OnDrillDown()
- begin
- Page.RunModal(Page::"Data Sync Status");
- end;
- }
-#endif
}
}
}
diff --git a/Apps/W1/INTaxEngine/app/TaxEngine-PostingHandler/src/PostingManagement/codeunit/TaxSubledgerPostingHandler.Codeunit.al b/Apps/W1/INTaxEngine/app/TaxEngine-PostingHandler/src/PostingManagement/codeunit/TaxSubledgerPostingHandler.Codeunit.al
index fed6e060f4..d3baa2a2d9 100644
--- a/Apps/W1/INTaxEngine/app/TaxEngine-PostingHandler/src/PostingManagement/codeunit/TaxSubledgerPostingHandler.Codeunit.al
+++ b/Apps/W1/INTaxEngine/app/TaxEngine-PostingHandler/src/PostingManagement/codeunit/TaxSubledgerPostingHandler.Codeunit.al
@@ -23,16 +23,6 @@ codeunit 20347 "Tax Subledger Posting Handler"
TaxPostingBufferMgmt.SetSalesPurchLcy(GenJournalLine."Sales/Purch. (LCY)");
end;
-#if not CLEAN23
- [EventSubscriber(ObjectType::Codeunit, Codeunit::"Sales-Post", 'OnBeforePostCustomerEntry', '', false, false)]
- local procedure OnBeforePostCustomerEntry(var TotalSalesLineLCY: Record "Sales Line")
- var
- TaxPostingBufferMgmt: Codeunit "Tax Posting Buffer Mgmt.";
- begin
- TaxPostingBufferMgmt.SetSalesPurchLcy(-TotalSalesLineLCY.Amount);
- end;
-#endif
-
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Sales Post Invoice Events", 'OnPostLedgerEntryOnBeforeGenJnlPostLine', '', false, false)]
local procedure OnPostLedgerEntryOnBeforeGenJnlPostLineSales(var TotalSalesLineLCY: Record "Sales Line")
var
@@ -41,16 +31,6 @@ codeunit 20347 "Tax Subledger Posting Handler"
TaxPostingBufferMgmt.SetSalesPurchLcy(-TotalSalesLineLCY.Amount);
end;
-#if not CLEAN23
- [EventSubscriber(ObjectType::Codeunit, Codeunit::"Purch.-Post", 'OnBeforePostVendorEntry', '', false, false)]
- local procedure OnBeforePostVendorEntry(var TotalPurchLineLCY: Record "Purchase Line")
- var
- TaxPostingBufferMgmt: Codeunit "Tax Posting Buffer Mgmt.";
- begin
- TaxPostingBufferMgmt.SetSalesPurchLcy(-TotalPurchLineLCY.Amount);
- end;
-#endif
-
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Purch. Post Invoice Events", 'OnPostLedgerEntryOnBeforeGenJnlPostLine', '', false, false)]
local procedure OnPostLedgerEntryOnBeforeGenJnlPostLinePurchase(var TotalPurchLineLCY: Record "Purchase Line")
var
diff --git a/Apps/W1/INTaxEngine/app/TaxEngine-PostingHandler/src/StandardPostingSubscribers/PurchPostHandler.Codeunit.al b/Apps/W1/INTaxEngine/app/TaxEngine-PostingHandler/src/StandardPostingSubscribers/PurchPostHandler.Codeunit.al
index 8c7feae38f..6797a62238 100644
--- a/Apps/W1/INTaxEngine/app/TaxEngine-PostingHandler/src/StandardPostingSubscribers/PurchPostHandler.Codeunit.al
+++ b/Apps/W1/INTaxEngine/app/TaxEngine-PostingHandler/src/StandardPostingSubscribers/PurchPostHandler.Codeunit.al
@@ -132,18 +132,6 @@ codeunit 20335 "Purch.-Post Handler"
Currency."Amount Rounding Precision");
end;
-#if not CLEAN23
- [EventSubscriber(ObjectType::Codeunit, Codeunit::"Purch.-Post", 'OnBeforePostVendorEntry', '', false, false)]
- local procedure OnBeforePostVendorEntry(
- var GenJnlLine: Record "Gen. Journal Line";
- var PurchHeader: Record "Purchase Header")
- var
- TaxPostingBufferMgmt: Codeunit "Tax Posting Buffer Mgmt.";
- begin
- GenJnlLine."Tax ID" := TaxPostingBufferMgmt.GetTaxID();
- end;
-#endif
-
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Purch. Post Invoice Events", 'OnPostLedgerEntryOnBeforeGenJnlPostLine', '', false, false)]
local procedure OnPostLedgerEntryOnBeforeGenJnlPostLine(var GenJnlLine: Record "Gen. Journal Line"; var PurchHeader: Record "Purchase Header")
var
diff --git a/Apps/W1/INTaxEngine/app/TaxEngine-PostingHandler/src/StandardPostingSubscribers/SalesPostingSubscribers.Codeunit.al b/Apps/W1/INTaxEngine/app/TaxEngine-PostingHandler/src/StandardPostingSubscribers/SalesPostingSubscribers.Codeunit.al
index aed82d014d..7b359388d0 100644
--- a/Apps/W1/INTaxEngine/app/TaxEngine-PostingHandler/src/StandardPostingSubscribers/SalesPostingSubscribers.Codeunit.al
+++ b/Apps/W1/INTaxEngine/app/TaxEngine-PostingHandler/src/StandardPostingSubscribers/SalesPostingSubscribers.Codeunit.al
@@ -124,16 +124,6 @@ codeunit 20336 "Sales Posting Subscribers"
Currency."Amount Rounding Precision");
end;
-#if not CLEAN23
- [EventSubscriber(ObjectType::Codeunit, Codeunit::"Sales-Post", 'OnBeforePostCustomerEntry', '', false, false)]
- local procedure OnBeforePostCustomerEntry(var GenJnlLine: Record "Gen. Journal Line"; var SalesHeader: Record "Sales Header")
- var
- TaxPostingBufferMgmt: Codeunit "Tax Posting Buffer Mgmt.";
- begin
- GenJnlLine."Tax ID" := TaxPostingBufferMgmt.GetTaxID();
- end;
-#endif
-
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Sales Post Invoice Events", 'OnPostLedgerEntryOnBeforeGenJnlPostLine', '', false, false)]
local procedure OnPostLedgerEntryOnBeforeGenJnlPostLine(var GenJnlLine: Record "Gen. Journal Line"; var SalesHeader: Record "Sales Header")
var
diff --git a/Apps/W1/INTaxEngine/app/TaxEngine-PostingHandler/src/StandardPostingSubscribers/ServicePostingSubscribers.Codeunit.al b/Apps/W1/INTaxEngine/app/TaxEngine-PostingHandler/src/StandardPostingSubscribers/ServicePostingSubscribers.Codeunit.al
index 8c95e06f90..9a3896c156 100644
--- a/Apps/W1/INTaxEngine/app/TaxEngine-PostingHandler/src/StandardPostingSubscribers/ServicePostingSubscribers.Codeunit.al
+++ b/Apps/W1/INTaxEngine/app/TaxEngine-PostingHandler/src/StandardPostingSubscribers/ServicePostingSubscribers.Codeunit.al
@@ -130,16 +130,6 @@ codeunit 20339 "Service Posting Subscribers"
Currency."Amount Rounding Precision");
end;
-#if not CLEAN23
- [EventSubscriber(ObjectType::Codeunit, Codeunit::"Serv-Posting Journals Mgt.", 'OnBeforePostCustomerEntry', '', false, false)]
- local procedure OnBeforePostCustomerEntry(var GenJournalLine: Record "Gen. Journal Line")
- var
- TaxPostingBufferMgmt: Codeunit "Tax Posting Buffer Mgmt.";
- begin
- GenJournalLine."Tax ID" := TaxPostingBufferMgmt.GetTaxID();
- end;
-#endif
-
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Service Post Invoice Events", 'OnPostLedgerEntryOnBeforeGenJnlPostLine', '', false, false)]
local procedure OnPostLedgerEntryOnBeforeGenJnlPostLine(var GenJournalLine: Record "Gen. Journal Line")
var
diff --git a/Apps/W1/ImageAnalysis/app/src/codeunits/ImageAnalyzerExtMgt.Codeunit.al b/Apps/W1/ImageAnalysis/app/src/codeunits/ImageAnalyzerExtMgt.Codeunit.al
index 0ebc391180..3682c82fc8 100644
--- a/Apps/W1/ImageAnalysis/app/src/codeunits/ImageAnalyzerExtMgt.Codeunit.al
+++ b/Apps/W1/ImageAnalysis/app/src/codeunits/ImageAnalyzerExtMgt.Codeunit.al
@@ -3,10 +3,6 @@ namespace Microsoft.Utility.ImageAnalysis;
using System.AI;
using System.Environment.Configuration;
using System.Environment;
-#if not CLEAN23
-using Microsoft.Inventory.Item;
-using Microsoft.CRM.Contact;
-#endif
using Microsoft.Utilities;
using System.Security.User;
using System.Globalization;
@@ -30,10 +26,6 @@ codeunit 2027 "Image Analyzer Ext. Mgt."
SetupNotificationDescriptionTxt: Label 'Notify me that the Image Analyzer extension can suggest attributes detected in imported images.';
ContactQuestionnairePopulatedNameTxt: Label 'Image Analyzer profile questionnaire completed';
ContactQuestionnairePopulatedNotificationDescriptionTxt: Label 'Notify me when Image Analyzer has been used in profile questionnaire to analyze a picture of a contact.';
-#if not CLEAN23
- AnalyzerDisabledMsg: Label 'Looks like the Image Analyzer extension is disabled. Do you want to learn more and enable it?';
- SetupActionTxt: Label 'Enable';
-#endif
GotItTxt: Label 'Got it';
NeverShowAgainTxt: Label 'Don''t tell me again';
ImageAnalysisCategoryLbl: Label 'Image Analysis', Locked = true;
@@ -180,54 +172,6 @@ codeunit 2027 "Image Analyzer Ext. Mgt."
Notification.Send();
end;
-#if not CLEAN23
- [Obsolete('Notifications to enable image analysis have been discontinued.', '23.0')]
- procedure SendEnableNotification(CodeToSet: Code[20]; OnRecord: Option " ",Item,Contact)
- var
- SetupNotification: Notification;
- begin
- SetupNotification.Id := GetEnabledNotificationId();
- SetupNotification.Message := AnalyzerDisabledMsg;
-
- case OnRecord of
- OnRecord::Contact:
- SetupNotification.SetData(GetContactNoForNotificationData(), Format(CodeToSet));
-
- OnRecord::Item:
- SetupNotification.SetData(GetItemNoForNotificationData(), Format(CodeToSet));
- end;
-
- SetupNotification.AddAction(SetupActionTxt, Codeunit::"Image Analyzer Ext. Mgt.", 'OpenSetupWizard');
- SetupNotification.Send();
-
- OnSendEnableNotification();
- end;
-
- [Obsolete('Notifications to enable image analysis have been discontinued.', '23.0')]
- procedure OpenSetupWizard(var SetupNotification: Notification)
- var
- Item: Record Item;
- Contact: Record Contact;
- ImageAnalyzerWizard: Page "Image Analyzer Wizard";
- ItemNoCode: Code[20];
- ContactNoCode: Code[20];
- begin
- if SetupNotification.HasData(GetItemNoForNotificationData()) then begin
- ItemNoCode := CopyStr(SetupNotification.GetData(GetItemNoForNotificationData()), 1, MaxStrLen(ItemNoCode));
- if Item.get(ItemNoCode) then
- ImageAnalyzerWizard.SetItem(item);
- end;
-
- if SetupNotification.HasData(GetContactNoForNotificationData()) then begin
- ContactNoCode := CopyStr(SetupNotification.GetData(GetContactNoForNotificationData()), 1, MaxStrLen(ContactNoCode));
- if Contact.get(ContactNoCode) then
- ImageAnalyzerWizard.SetContact(Contact);
- end;
-
- ImageAnalyzerWizard.RunModal();
- end;
-#endif
-
procedure HandleSetupAndEnable()
var
ImageAnalyzerSetup: Record "Image Analysis Setup";
diff --git a/Apps/W1/Intrastat/app/src/IntrastatReportSetup.Page.al b/Apps/W1/Intrastat/app/src/IntrastatReportSetup.Page.al
index 6c1fdb4fbe..3554177733 100644
--- a/Apps/W1/Intrastat/app/src/IntrastatReportSetup.Page.al
+++ b/Apps/W1/Intrastat/app/src/IntrastatReportSetup.Page.al
@@ -187,4 +187,13 @@ page 4810 "Intrastat Report Setup"
}
}
}
+
+ trigger OnOpenPage()
+ begin
+ Rec.Reset();
+ if not Rec.Get() then begin
+ Rec.Init();
+ Rec.Insert();
+ end;
+ end;
}
\ No newline at end of file
diff --git a/Apps/W1/MasterDataManagement/app/src/codeunits/MasterDataMgtSetupDefault.Codeunit.al b/Apps/W1/MasterDataManagement/app/src/codeunits/MasterDataMgtSetupDefault.Codeunit.al
index 10e347f184..e42a4294c6 100644
--- a/Apps/W1/MasterDataManagement/app/src/codeunits/MasterDataMgtSetupDefault.Codeunit.al
+++ b/Apps/W1/MasterDataManagement/app/src/codeunits/MasterDataMgtSetupDefault.Codeunit.al
@@ -149,11 +149,7 @@ codeunit 7230 "Master Data Mgt. Setup Default"
TableField.SetFilter(RelationFieldNo, '<' + Format(Customer.FieldNo(Customer.SystemId)));
if TableField.FindSet() then
repeat
-#if not CLEAN23
- if not (TableField."No." in [Customer.FieldNo(Customer."Tax Area ID"), Customer.FieldNo(Customer."Contact ID"), Customer.FieldNo(Customer."Contact Graph Id"), Customer.FieldNo(Customer."Search Name"), Customer.FieldNo(Customer.Contact), Customer.FieldNo(Customer."Coupled to CRM"), Customer.FieldNo(Customer."Last Date Modified"), Customer.FieldNo(Customer."Last Modified Date Time")]) then
-#else
if not (TableField."No." in [Customer.FieldNo(Customer."Tax Area ID"), Customer.FieldNo(Customer."Contact ID"), Customer.FieldNo(Customer."Contact Graph Id"), Customer.FieldNo(Customer."Search Name"), Customer.FieldNo(Customer.Contact), Customer.FieldNo(Customer."Last Date Modified"), Customer.FieldNo(Customer."Last Modified Date Time")]) then
-#endif
FieldNumbers.Add(TableField."No.");
until TableField.Next() = 0;
@@ -196,11 +192,7 @@ codeunit 7230 "Master Data Mgt. Setup Default"
TableField.SetFilter(RelationFieldNo, '<' + Format(Vendor.FieldNo(Vendor.SystemId)));
if TableField.FindSet() then
repeat
-#if not CLEAN23
- if not (TableField."No." in [Vendor.FieldNo(Vendor."Search Name"), Vendor.FieldNo(Vendor.Contact), Vendor.FieldNo(Vendor."Coupled to CRM"), Vendor.FieldNo(Vendor."Last Date Modified"), Vendor.FieldNo(Vendor."Last Modified Date Time")]) then
-#else
if not (TableField."No." in [Vendor.FieldNo(Vendor."Search Name"), Vendor.FieldNo(Vendor.Contact), Vendor.FieldNo(Vendor."Last Date Modified"), Vendor.FieldNo(Vendor."Last Modified Date Time")]) then
-#endif
FieldNumbers.Add(TableField."No.");
until TableField.Next() = 0;
@@ -244,11 +236,7 @@ codeunit 7230 "Master Data Mgt. Setup Default"
TableField.SetFilter(RelationFieldNo, '<' + Format(Contact.FieldNo(Contact.SystemId)));
if TableField.FindSet() then
repeat
-#if not CLEAN23
- if not (TableField."No." in [Contact.FieldNo(Contact."Search Name"), Contact.FieldNo(Contact."Search E-Mail"), Contact.FieldNo(Contact."Xrm Id"), Contact.FieldNo(Contact."Last Date Modified"), Contact.FieldNo(Contact."Coupled to CRM"), Contact.FieldNo(Contact."Lookup Contact No.")]) then
-#else
if not (TableField."No." in [Contact.FieldNo(Contact."Search Name"), Contact.FieldNo(Contact."Search E-Mail"), Contact.FieldNo(Contact."Xrm Id"), Contact.FieldNo(Contact."Last Date Modified"), Contact.FieldNo(Contact."Lookup Contact No.")]) then
-#endif
FieldNumbers.Add(TableField."No.");
until TableField.Next() = 0;
@@ -388,11 +376,7 @@ codeunit 7230 "Master Data Mgt. Setup Default"
TableField.SetFilter(RelationFieldNo, '<' + Format(Currency.FieldNo(Currency.SystemId)));
if TableField.FindSet() then
repeat
-#if not CLEAN23
- if not (TableField."No." in [Currency.FieldNo(Currency."Last Date Modified"), Currency.FieldNo(Currency."Last Modified Date Time"), Currency.FieldNo(Currency."Coupled to CRM"), Currency.FieldNo(Currency."Last Date Adjusted")]) then
-#else
if not (TableField."No." in [Currency.FieldNo(Currency."Last Date Modified"), Currency.FieldNo(Currency."Last Modified Date Time"), Currency.FieldNo(Currency."Last Date Adjusted")]) then
-#endif
FieldNumbers.Add(TableField."No.");
until TableField.Next() = 0;
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/AgedPayablesBackDating.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/AgedPayablesBackDating.Page.al
new file mode 100644
index 0000000000..e57565468c
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/AgedPayablesBackDating.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 36994 "Aged Payables (Back Dating)"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Aged Payables (Back Dating)';
+ AboutTitle = 'About Aged Payables (Back Dating)';
+ AboutText = 'The Aged Payables Back Dating report categorizes vendor balances into aging buckets. It offers flexibility with filters for different payment terms, aging dates, and custom aging bucket sizes.';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSection904474b579cc92816425', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Finance Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/AgedReceivablesBackDating.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/AgedReceivablesBackDating.Page.al
new file mode 100644
index 0000000000..64e5abda9a
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/AgedReceivablesBackDating.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 36993 "Aged Receivables (Back Dating)"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Aged Receivables (Back Dating)';
+ AboutTitle = 'About Aged Receivables (Back Dating)';
+ AboutText = 'The Aged Receivable Back Dating report categorizes customer balances into aging buckets. It offers flexibility with filters for different payment terms, aging dates, and custom aging bucket sizes.';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSectionfef66fa3cf79c6d85930', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Finance Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/AllocatedHours.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/AllocatedHours.Page.al
new file mode 100644
index 0000000000..f74a95dc0d
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/AllocatedHours.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 37043 "Allocated Hours"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Allocated Hours';
+ AboutTitle = 'About Allocated Hours';
+ AboutText = 'View the number of hours remaining for production allocated to each Work Centre in a specified period. Allows you to determine if a Work Centre is under or overloaded and requires rescheduling.';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSectionf3f7e4f23b609a9d9cb2', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Manufacturing Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/AverageCollectionPeriod.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/AverageCollectionPeriod.Page.al
new file mode 100644
index 0000000000..c47220a578
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/AverageCollectionPeriod.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 36992 "Average Collection Period"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Average Collection Period';
+ AboutTitle = 'About Average Collection Period';
+ AboutText = 'The Average Collection Period report analyses trends in the average collection period over time. It includes supporting details such as the Number of Days, Accounts Receivable, and Accounts Receivable (Average) to provide context and enhance the analysis.';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSectionb1d1e3d33a031ad3b0ed', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Finance Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/AverageProductionsTimes.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/AverageProductionsTimes.Page.al
new file mode 100644
index 0000000000..ee4c0e29ac
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/AverageProductionsTimes.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 37048 "Average Productions Times"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Average Productions Times';
+ AboutTitle = 'About Average Productions Times';
+ AboutText = 'View the average time spent for Setup, Run and Stop times per unit for each manufactured Item. Expand to see the times for each production order to determine why fluctuations occurred.';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSection13a328ff231fccdc12f7', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Manufacturing Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/BalanceSheetbyMonth.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/BalanceSheetbyMonth.Page.al
new file mode 100644
index 0000000000..9d88081276
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/BalanceSheetbyMonth.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 36986 "Balance Sheet by Month"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Balance Sheet by Month';
+ AboutTitle = 'About Balance Sheet by Month';
+ AboutText = 'The Balance Sheet by Month report provides a month-to-month comparative view of the balance at date for balance sheet accounts. ';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSection6a30609896651f006f0f', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Finance Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/BinContents.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/BinContents.Page.al
new file mode 100644
index 0000000000..2cfe6fcd3f
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/BinContents.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 37031 "Bin Contents"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Bin Contents';
+ AboutTitle = 'About Bin Contents';
+ AboutText = 'The Bin Contents report provides a detailed view of item quantities by bin code and location. It includes additional information such as warehouse quantity, pick and put-away quantities, and both negative and positive adjustments, offering a comprehensive overview of bin movements and inventory management within the warehouse.';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSection12b3ff23621e20c1398d', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Inventory Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/BinContentsbyItemTracking.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/BinContentsbyItemTracking.Page.al
new file mode 100644
index 0000000000..6c135a4445
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/BinContentsbyItemTracking.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 37032 "Bin Contents by Item Tracking"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Bin Contents by Item Tracking';
+ AboutTitle = 'About Bin Contents by Item Tracking';
+ AboutText = 'The Bin Contents by Item Tracking report provides a detailed view of warehouse quantities by Item, Location, Bin Code, Zone Code, Lot number or Serial number. ';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSection7359815290770dd2a490', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Inventory Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/BudgetComparison.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/BudgetComparison.Page.al
new file mode 100644
index 0000000000..500f834943
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/BudgetComparison.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 36987 "Budget Comparison"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Budget Comparison';
+ AboutTitle = 'About Budget Comparison';
+ AboutText = 'The Budget Comparison report presents a month-to-month analysis of Net Change against Budget Amounts for both Balance Sheet and Income Statement accounts. Featuring variance and variance percentage metrics, providing a clear view of how actual performance compares to budgeted targets.';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSection64d670dfa9da1a5b7033', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Finance Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/BusinessManagerRoleCenter.PageExt.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/BusinessManagerRoleCenter.PageExt.al
new file mode 100644
index 0000000000..5106d065e0
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/BusinessManagerRoleCenter.PageExt.al
@@ -0,0 +1,156 @@
+namespace Microsoft.PowerBIReports;
+
+using Microsoft.Finance.RoleCenters;
+
+pageextension 36953 "Business Manager Role Center" extends "Business Manager Role Center"
+{
+ actions
+ {
+ addlast(Reporting)
+ {
+ group("PBI Reports")
+ {
+ Caption = 'Power BI Reports';
+ Image = PowerBI;
+ ToolTip = 'Power BI reports for finance';
+ action("Financial Overview")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Financial Overview';
+ Image = "PowerBI";
+ RunObject = page "Financial Overview";
+ Tooltip = 'Open a Power BI Report that provides a snapshot of the organization''s financial health and performance. This page displays key performance indicators that give stakeholders a clear view of revenue, profitability, and financial stability. ';
+ }
+ action("Income Statement by Month")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Income Statement by Month';
+ Image = "PowerBI";
+ RunObject = page "Income Statement by Month";
+ Tooltip = 'Open a Power BI Report that provides a month-to-month comparative view of the net change for income statement accounts.';
+ }
+ action("Balance Sheet by Month")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Balance Sheet by Month';
+ Image = "PowerBI";
+ RunObject = page "Balance Sheet by Month";
+ Tooltip = 'Open a Power BI Report that provides a month-to-month comparative view of the balance at date for balance sheet accounts. ';
+ }
+ action("Budget Comparison")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Budget Comparison';
+ Image = "PowerBI";
+ RunObject = page "Budget Comparison";
+ Tooltip = 'Open a Power BI Report that presents a month-to-month analysis of Net Change against Budget Amounts for both Balance Sheet and Income Statement accounts. Featuring variance and variance percentage metrics, providing a clear view of how actual performance compares to budgeted targets.';
+ }
+ action("Liquidity KPIs")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Liquidity KPIs';
+ Image = "PowerBI";
+ RunObject = page "Liquidity KPIs";
+ Tooltip = 'Open a Power BI Report that offers insights into three key metrics: Current Ratio, Quick Ratio, and Cash Ratio. Visualizing these metrics over time, the report makes it easy to track trends and assess the company’s liquidity position.';
+ }
+ action("Profitability")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Profitability';
+ Image = "PowerBI";
+ RunObject = page "Profitability";
+ Tooltip = 'Open a Power BI Report that highlights Gross Profit and Net Profit, visualizing these metrics over time. It also provides detailed insights into net margins, gross profit margins, and the underlying revenue, cost and expense figures that drive them.';
+ }
+ action("Liabilities")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Liabilities';
+ Image = "PowerBI";
+ RunObject = page "Liabilities";
+ Tooltip = 'Open a Power BI Report that provides a snapshot of liability account balances as of a specific date. It also highlights key performance metrics influenced by liabilities, such as the Debt Ratio and Debt-to-Equity Ratio.';
+ }
+ action("EBITDA")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'EBITDA';
+ Image = "PowerBI";
+ RunObject = page "EBITDA";
+ Tooltip = 'Open a Power BI Report that focuses on two key profitability metrics: EBITDA and EBIT. These figures are visualized over time to reveal trends, while Operating Revenue and Operating Expenses are also highlighted to provide supporting context for both measures.';
+ }
+ action("Average Collection Period")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Average Collection Period';
+ Image = "PowerBI";
+ RunObject = page "Average Collection Period";
+ Tooltip = 'Open a Power BI Report that analyses trends in the average collection period over time. It includes supporting details such as the Number of Days, Accounts Receivable, and Accounts Receivable (Average) to provide context and enhance the analysis.';
+ }
+ action("Aged Receivables (Back Dating)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Aged Receivables (Back Dating)';
+ Image = "PowerBI";
+ RunObject = page "Aged Receivables (Back Dating)";
+ Tooltip = 'Open a Power BI Report that categorizes customer balances into aging buckets. It offers flexibility with filters for different payment terms, aging dates, and custom aging bucket sizes.';
+ }
+ action("Aged Payables (Back Dating)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Aged Payables (Back Dating)';
+ Image = "PowerBI";
+ RunObject = page "Aged Payables (Back Dating)";
+ Tooltip = 'Open a Power BI Report that categorizes vendor balances into aging buckets. It offers flexibility with filters for different payment terms, aging dates, and custom aging bucket sizes.';
+ }
+ action("General Ledger Entries")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'General Ledger Entries';
+ Image = "PowerBI";
+ RunObject = page "General Ledger Entries";
+ Tooltip = 'Open a Power BI Report that provides granular detail about the entries posted to the general ledger. ';
+ }
+ action("Detailed Vendor Ledger Entries")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Detailed Vendor Ledger Entries';
+ Image = "PowerBI";
+ RunObject = page "Detailed Vendor Ledger Entries";
+ Tooltip = 'Open a Power BI Report that provides granular detail about the entries posted to Vendor Ledger and Detailed Vendor Ledger.';
+ }
+ action("Detailed Cust. Ledger Entries")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Detailed Cust. Ledger Entries';
+ Image = "PowerBI";
+ RunObject = page "Detailed Cust. Ledger Entries";
+ Tooltip = 'Open a Power BI Report that provides granular detail about the entries posted to Customer Ledger and Detailed Customer Sub Ledger.';
+ }
+ action("Inventory Valuation Overview")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Inventory Valuation Overview';
+ Image = "PowerBI";
+ RunObject = page "Inventory Valuation Overview";
+ Tooltip = 'Open a Power BI Report that displays the inventory ending balance against the ending balance posted to the general ledger. Inventory value by location is plotted on a bar chart which is supported by inventory metrics such as increase quantity and decrease quantity. ';
+ }
+ action("Inventory Valuation by Item")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Inventory Valuation by Item';
+ Image = "PowerBI";
+ RunObject = page "Inventory Valuation by Item";
+ Tooltip = 'Open a Power BI Report that features a Treemap that visualizes ending balance quantities by item category. It also includes a table matrix providing a detailed view of ending balances and showing fluctuations in inventory over the specified period.';
+ }
+ action("Inventory Valuation by Location")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Inventory Valuation by Location';
+ Image = "PowerBI";
+ RunObject = page "Inventory Valuation by Loc.";
+ Tooltip = 'Open a Power BI Report that features a Treemap that visualizes ending balance quantities by location. It also includes a table matrix providing a detailed view of ending balances and showing fluctuations in inventory over the specified period.';
+ }
+ }
+ }
+ }
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/CapacityVariance.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/CapacityVariance.Page.al
new file mode 100644
index 0000000000..7582b84a7b
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/CapacityVariance.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 37047 "Capacity Variance"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Capacity Variance';
+ AboutTitle = 'About Capacity Variance';
+ AboutText = 'View your capacity cost variance % viewed over a timeline you can define to see trends. Analyze by each production order and filter by Work Centre to see the detail behind the overall percentages.';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSection6616bf98be16d1636d03', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Manufacturing Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/ConsumptionVariance.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/ConsumptionVariance.Page.al
new file mode 100644
index 0000000000..29988b72e3
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/ConsumptionVariance.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 37046 "Consumption Variance"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Consumption Variance';
+ AboutTitle = 'About Consumption Variance';
+ AboutText = 'View your consumption cost variance % viewed over a timeline you can define to see trends. Analyze by each production order and filter by Work Centre to see the detail behind the overall percentages.';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSectiona9060ee37f667a3d554d', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Manufacturing Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/CurrentUtilization.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/CurrentUtilization.Page.al
new file mode 100644
index 0000000000..5334ca2e08
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/CurrentUtilization.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 37040 "Current Utilization"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Current Utilization';
+ AboutTitle = 'About Current Utilization';
+ AboutText = 'View the current Weeks Utilisation % by comparing Capacity Used to Available Capacity in Hours. View all or some Work Centres to measure throughput and efficiency.';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSection1cb4eb25650060b6dbd0', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Manufacturing Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/DailyPurchases.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/DailyPurchases.Page.al
new file mode 100644
index 0000000000..2520099239
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/DailyPurchases.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 37011 "Daily Purchases"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Daily Purchases';
+ AboutTitle = 'About Daily Purchases';
+ AboutText = 'The Daily Purchases report offers a detailed analysis of purchase amounts by weekday. The tabular report highlights purchasing trends by using conditional formatting to display purchase figures in a gradient from low to high.';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSection02de1de9adad5ee196e0', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Purchases Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/DailySales.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/DailySales.Page.al
new file mode 100644
index 0000000000..86f7f17ed9
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/DailySales.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 36999 "Daily Sales"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Daily Sales';
+ AboutTitle = 'About Daily Sales';
+ AboutText = 'The Daily Sales report offers a detailed analysis of sales amounts by weekday. The tabular report highlights trends by using conditional formatting to display figures in a gradient from low to high.';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSectionb3680fa80c9685297c06', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Sales Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/DetailedCustLedgerEntries.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/DetailedCustLedgerEntries.Page.al
new file mode 100644
index 0000000000..2481a50915
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/DetailedCustLedgerEntries.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 36997 "Detailed Cust. Ledger Entries"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Detailed Cust. Ledger Entries';
+ AboutTitle = 'About Detailed Cust. Ledger Entries';
+ AboutText = 'The Detailed Customer Ledger Entries report provides granular detail about the entries posted to Customer Ledger and Detailed Customer Sub Ledger.';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSection15bface0e851125fb4ea', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Finance Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/DetailedVendorLedgerEntries.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/DetailedVendorLedgerEntries.Page.al
new file mode 100644
index 0000000000..d8b30fb90e
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/DetailedVendorLedgerEntries.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 36996 "Detailed Vendor Ledger Entries"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Detailed Vendor Ledger Entries';
+ AboutTitle = 'About Detailed Vendor Ledger Entries';
+ AboutText = 'The Detailed Vendor Ledger Entries report provides granular detail about the entries posted to Vendor Ledger and Detailed Vendor Ledger.';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSectione72966404f743d39d212', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Finance Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/EBITDA.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/EBITDA.Page.al
new file mode 100644
index 0000000000..94f243f0c8
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/EBITDA.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 36991 "EBITDA"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'EBITDA';
+ AboutTitle = 'About EBITDA';
+ AboutText = 'The EBITDA report focuses on two key profitability metrics: EBITDA and EBIT. These figures are visualized over time to reveal trends, while Operating Revenue and Operating Expenses are also highlighted to provide supporting context for both measures.';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSectionab3743c6203831d31beb', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Finance Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/ExpectedCapacityNeed.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/ExpectedCapacityNeed.Page.al
new file mode 100644
index 0000000000..3a5438c9bc
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/ExpectedCapacityNeed.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 37044 "Expected Capacity Need"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Expected Capacity Need';
+ AboutTitle = 'About Expected Capacity Need';
+ AboutText = 'View the total hours scheduled to be performed for each Work Centre Group and/or Work Centre broken down by production order status and production order to analyze your requirement on factory resources.';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSectiona2c7d37ca03217072470', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Manufacturing Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/FinanceManagerRoleCenter.PageExt.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/FinanceManagerRoleCenter.PageExt.al
new file mode 100644
index 0000000000..944839f76a
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/FinanceManagerRoleCenter.PageExt.al
@@ -0,0 +1,139 @@
+namespace Microsoft.PowerBIReports;
+
+using Microsoft.Finance.RoleCenters;
+
+pageextension 36959 "Finance Manager Role Center" extends "Finance Manager Role Center"
+{
+ actions
+ {
+ addfirst(Sections)
+ {
+ group("PBI Reports")
+ {
+ Caption = 'Power BI Reports';
+ Image = AnalysisView;
+ ToolTip = 'Power BI reports for finance';
+ action("Financial Overview (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Financial Overview (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Financial Overview";
+ }
+ action("Income Statement by Month (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Income Statement by Month (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Income Statement by Month";
+ }
+ action("Balance Sheet by Month (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Balance Sheet by Month (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Balance Sheet by Month";
+ }
+ action("Budget Comparison (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Budget Comparison (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Budget Comparison";
+ }
+ action("Liquidity KPIs (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Liquidity KPIs (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Liquidity KPIs";
+ }
+ action("Profitability (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Profitability (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Profitability";
+ }
+ action("Liabilities (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Liabilities (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Liabilities";
+ }
+ action("EBITDA (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'EBITDA (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "EBITDA";
+ }
+ action("Average Collection Period (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Average Collection Period (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Average Collection Period";
+ }
+ action("Aged Receivables (Back Dating) (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Aged Receivables (Back Dating) (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Aged Receivables (Back Dating)";
+ }
+ action("Aged Payables (Back Dating) (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Aged Payables (Back Dating) (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Aged Payables (Back Dating)";
+ }
+ action("General Ledger Entries (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'General Ledger Entries (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "General Ledger Entries";
+ }
+ action("Detailed Vendor Ledger Entries (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Detailed Vendor Ledger Entries (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Detailed Vendor Ledger Entries";
+ }
+ action("Detailed Cust. Ledger Entries (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Detailed Cust. Ledger Entries (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Detailed Cust. Ledger Entries";
+ }
+ action("Inventory Valuation Overview (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Inventory Valuation Overview (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Inventory Valuation Overview";
+ }
+ action("Inventory Valuation by Item (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Inventory Valuation by Item (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Inventory Valuation by Item";
+ }
+ action("Inventory Valuation by Loc. (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Inventory Valuation by Loc. (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Inventory Valuation by Loc.";
+ }
+ }
+ }
+ }
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/FinancialOverview.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/FinancialOverview.Page.al
new file mode 100644
index 0000000000..7b3968ed52
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/FinancialOverview.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 36984 "Financial Overview"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Financial Overview';
+ AboutTitle = 'About Financial Overview';
+ AboutText = 'The Financial Overview provides a snapshot of the organization''s financial health and performance. This page displays key performance indicators that give stakeholders a clear view of revenue, profitability, and financial stability. ';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label '04fa320747962435bf38', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Finance Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/FinishedProdOrderBreakdown.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/FinishedProdOrderBreakdown.Page.al
new file mode 100644
index 0000000000..548d8aca9d
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/FinishedProdOrderBreakdown.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 37045 "Finished Prod. Order Breakdown"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Finished Prod. Order Breakdown';
+ AboutTitle = 'About Finished Prod. Order Breakdown';
+ AboutText = 'View Expected Quantities and Cost vs Actual Quantities and Costs over time, analyze the detail per item and drill down to the Production Order to track where variances are occurring.';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSectionb4e9630e25c77fccda8a', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Manufacturing Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/GeneralLedgerEntries.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/GeneralLedgerEntries.Page.al
new file mode 100644
index 0000000000..b100822849
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/GeneralLedgerEntries.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 36995 "General Ledger Entries"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'General Ledger Entries';
+ AboutTitle = 'About General Ledger Entries';
+ AboutText = 'The General Ledger Entries report provides granular detail about the entries posted to the general ledger. ';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSectionfdc853c4230265e530cc', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Finance Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/GrossRequirement.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/GrossRequirement.Page.al
new file mode 100644
index 0000000000..60d6113ca7
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/GrossRequirement.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 37027 "Gross Requirement"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Gross Requirement';
+ AboutTitle = 'About Gross Requirement';
+ AboutText = 'The Gross Requirement report visualizes Gross Requirements against Projected Available Balance over time, offering a clear view of inventory demands. A table matrix breaks down this data by item, showcasing key metrics like Gross Requirement, Projected Available Balance, and quantities from demand documents (sales orders and purchase return orders). ';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSection94c932a22e568b021aba', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Inventory Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/HistoricalUtilization.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/HistoricalUtilization.Page.al
new file mode 100644
index 0000000000..6930c5b6d7
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/HistoricalUtilization.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 37041 "Historical Utilization"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Historical Utilization';
+ AboutTitle = 'About Historical Utilization';
+ AboutText = 'View the historical Utilisation % by comparing Capacity Used vs Available Capacity in Hours viewed over a timeline you can define to see trends. View all or some Work Centres.';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSectionf9d212728e1d71a00044', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Manufacturing Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/IncomeStatementbyMonth.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/IncomeStatementbyMonth.Page.al
new file mode 100644
index 0000000000..ddf8424b09
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/IncomeStatementbyMonth.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 36985 "Income Statement by Month"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Income Statement by Month';
+ AboutTitle = 'About Income Statement by Month';
+ AboutText = 'The Income Statement by Month report provides a month-to-month comparative view of the net change for income statement accounts.';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSectionf72eb4d7e5e35db3b283', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Finance Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/InventoryOverview.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/InventoryOverview.Page.al
new file mode 100644
index 0000000000..634931eeed
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/InventoryOverview.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 37022 "Inventory Overview"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Inventory Overview';
+ AboutTitle = 'About Inventory Overview';
+ AboutText = 'The Inventory Overview report offers a dashboard view of inventory, featuring key elements such as inventory by location, a comparison of inventory balance versus projected available balance, and key metrics like scheduled receipt quantities and gross requirements.';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSectione24db7517a44af92f122', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Inventory Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/InventoryValuationOverview.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/InventoryValuationOverview.Page.al
new file mode 100644
index 0000000000..72b9b33e22
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/InventoryValuationOverview.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 37056 "Inventory Valuation Overview"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Inventory Valuation Overview';
+ AboutTitle = 'About Inventory Valuation Overview';
+ AboutText = 'The Inventory Valuation Overview dashboard displays the inventory ending balance against the ending balance posted to the general ledger. Inventory value by location is plotted on a bar chart which is supported by inventory metrics such as increase quantity and decrease quantity. ';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSection41d23fcd2b0c70d16059', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Inventory Val. Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/InventoryValuationbyItem.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/InventoryValuationbyItem.Page.al
new file mode 100644
index 0000000000..f88965b2f5
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/InventoryValuationbyItem.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 37057 "Inventory Valuation by Item"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Inventory Valuation by Item';
+ AboutTitle = 'About Inventory Valuation by Item';
+ AboutText = 'The Inventory Valuation by Item report features a Treemap that visualizes ending balance quantities by item category. It also includes a table matrix providing a detailed view of ending balances and showing fluctuations in inventory over the specified period.';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label '47469f126ce6603a9114', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Inventory Val. Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/InventoryValuationbyLoc.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/InventoryValuationbyLoc.Page.al
new file mode 100644
index 0000000000..59eb6307a1
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/InventoryValuationbyLoc.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 37058 "Inventory Valuation by Loc."
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Inventory Valuation by Location';
+ AboutTitle = 'About Inventory Valuation by Location';
+ AboutText = 'The Inventory Valuation by Location report features a Treemap that visualizes ending balance quantities by location. It also includes a table matrix providing a detailed view of ending balances and showing fluctuations in inventory over the specified period.';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label '6a6852c0d882690a617b', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Inventory Val. Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/InventorybyItem.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/InventorybyItem.Page.al
new file mode 100644
index 0000000000..26537d64a3
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/InventorybyItem.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 37023 "Inventory by Item"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Inventory by Item';
+ AboutTitle = 'About Inventory by Item';
+ AboutText = 'The Inventory by Item report provides inventory quantities by item, offering insights into the sources of supply and demand. Helping organizations understand item-level inventory status, manage stock effectively, and make informed decisions about the state of supply and demand.';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSection8c3ed3c2c96e298a0824', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Inventory Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/InventorybyLocation.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/InventorybyLocation.Page.al
new file mode 100644
index 0000000000..8c4673c5b9
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/InventorybyLocation.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 37024 "Inventory by Location"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Inventory by Location';
+ AboutTitle = 'About Inventory by Location';
+ AboutText = 'The Inventory by Location report shows inventory quantities by item and by location. ';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSection2765ed5a1005d04217d1', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Inventory Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/InventorybyLot.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/InventorybyLot.Page.al
new file mode 100644
index 0000000000..722f2c98a8
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/InventorybyLot.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 37029 "Inventory by Lot"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Inventory by Lot';
+ AboutTitle = 'About Inventory by Lot';
+ AboutText = 'The Inventory by Lot Number report displays inventory quantities categorized by lot number, providing detailed insights into specific batches of stock. A decomposition tree enhances this by allowing users to drill down into inventory data, breaking down lot quantities by various dimensions such as location, item category, or vendor.';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSectionec09da5413c3755982a4', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Inventory Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/InventorybySerialNo.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/InventorybySerialNo.Page.al
new file mode 100644
index 0000000000..f7e31d1760
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/InventorybySerialNo.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 37030 "Inventory by Serial No."
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Inventory by Serial No.';
+ AboutTitle = 'About Inventory by Serial No.';
+ AboutText = 'The Inventory by Serial report displays inventory quantities categorized by serial number. The decomposition tree enhances this report by allowing users to drill down into inventory data, breaking down quantities by various dimensions such as location, item category, or vendor.';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSectiond99a75349d3388ca085c', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Inventory Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/ItemAvailability.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/ItemAvailability.Page.al
new file mode 100644
index 0000000000..07e7613561
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/ItemAvailability.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 37026 "Item Availability"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Item Availability';
+ AboutTitle = 'About Item Availability';
+ AboutText = 'The Item Availability report visualizes Quantity on Hand versus Projected Available Balance over time, helping track inventory trends. A table matrix breaks down this data by item, offering metrics such as Inventory, Projected Available Balance, Gross Requirements, Scheduled Receipts, Planned Order Receipts, and Planned Order Releases. Providing a comprehensive view of item availability, aiding in effective inventory management and planning.';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSection61c190709a57015b0e48', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Inventory Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/JobProjectManagerRC.PageExt.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/JobProjectManagerRC.PageExt.al
new file mode 100644
index 0000000000..b86b67738d
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/JobProjectManagerRC.PageExt.al
@@ -0,0 +1,76 @@
+namespace Microsoft.PowerBIReports;
+
+using Microsoft.Projects.RoleCenters;
+
+pageextension 36957 "Job Project Manager RC" extends "Job Project Manager RC"
+{
+ actions
+ {
+ addlast(Reporting)
+ {
+ group("PBI Reports")
+ {
+ Caption = 'Power BI Reports';
+ Image = PowerBI;
+ ToolTip = 'Power BI reports for projects';
+ action("Projects Overview")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Projects Overview';
+ Image = "PowerBI";
+ RunObject = page "Projects Overview";
+ Tooltip = 'Open a Power BI Report that provides key insights into project performance with metrics like Percent Complete, Percent Invoiced, Realization Percent, Actual Profit, and Actual Profit Margin. It features visuals comparing Actual vs. Budgeted Costs, highlighting Profit per Project, and organizing projects by Project Manager for streamlined project management.';
+ }
+ action("Project Tasks")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Project Tasks';
+ Image = "PowerBI";
+ RunObject = page "Project Tasks";
+ Tooltip = 'Open a Power BI Report that details tasks related to each project, with metrics for each task clearly outlined. It presents tasks in a table matrix in a hierarchical view, making it easy to navigate and analyze project task information.';
+ }
+ action("Project Profitability")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Project Profitability';
+ Image = "PowerBI";
+ RunObject = page "Project Profitability";
+ Tooltip = 'Open a Power BI Report that displays key metrics such as Actuals and Budgeted KPIs, compares actual profit to the initial profit target, and includes a table view of project ledger entries by type.';
+ }
+ action("Project Realization")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Project Realization';
+ Image = "PowerBI";
+ RunObject = page "Project Realization";
+ Tooltip = 'Open a Power BI Report that features key metrics like Billable Invoice Price and Actual Total Price to support Realization percent per project. Enabling organizations to measure actual performance and achievements against planned or budgeted expectations.';
+ }
+ action("Project Performance to Budget")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Project Performance to Budget';
+ Image = "PowerBI";
+ RunObject = page "Project Performance to Budget";
+ Tooltip = 'Open a Power BI Report that highlights key metrics, including Budget Total Cost, Actual Total Cost, and the variance and percentage variance from the budget. It features a table that details these metrics by project, offering a clear view of cost performance and deviations from budgeted targets.';
+ }
+ action("Project Invoiced Sales by Type")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Project Invoiced Sales by Type';
+ Image = "PowerBI";
+ RunObject = page "Project Invoiced Sales by Type";
+ Tooltip = 'Open a Power BI Report that details invoiced sales for a project categorized by line type. It includes key KPIs such as % Invoiced, Billable Invoiced Price, and Billable Total Price, providing a clear overview of project invoicing performance and statistics.';
+ }
+ action("Project Invoiced Sales by Customer")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Project Invoiced Sales by Customer';
+ Image = "PowerBI";
+ RunObject = page "Project Invd. Sales by Cust.";
+ Tooltip = 'Open a Power BI Report that details invoiced sales for a project, broken down by customer. It includes key KPIs such as % Invoiced, Billable Invoiced Price, and Billable Total Price, offering a clear view of project invoicing by customer. ';
+ }
+ }
+ }
+ }
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/Liabilities.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/Liabilities.Page.al
new file mode 100644
index 0000000000..4e5b261d02
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/Liabilities.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 36990 "Liabilities"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Liabilities';
+ AboutTitle = 'About Liabilities';
+ AboutText = 'The Liabilities report provides a snapshot of liability account balances as of a specific date. It also highlights key performance metrics influenced by liabilities, such as the Debt Ratio and Debt-to-Equity Ratio.';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSectioncd819efac970874e83c3', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Finance Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/LiquidityKPIs.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/LiquidityKPIs.Page.al
new file mode 100644
index 0000000000..b7acec9e63
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/LiquidityKPIs.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 36988 "Liquidity KPIs"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Liquidity KPIs';
+ AboutTitle = 'About Liquidity KPIs';
+ AboutText = 'The Liquidity KPIs report offers insights into three key metrics: Current Ratio, Quick Ratio, and Cash Ratio. Visualizing these metrics over time, the report makes it easy to track trends and assess the company’s liquidity position.';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSection6838cf9cda361d088e0a', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Finance Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/ManufacturingManagerRC.PageExt.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/ManufacturingManagerRC.PageExt.al
new file mode 100644
index 0000000000..7bc0e41f2d
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/ManufacturingManagerRC.PageExt.al
@@ -0,0 +1,97 @@
+namespace Microsoft.PowerBIReports;
+
+using Microsoft.Manufacturing.RoleCenters;
+
+pageextension 36964 "Manufacturing Manager RC" extends "Manufacturing Manager RC"
+{
+ actions
+ {
+ addfirst(Sections)
+ {
+ group("PBI Reports")
+ {
+ Caption = 'Power BI Reports';
+ Image = AnalysisView;
+ ToolTip = 'Power BI reports for manufacturing';
+ action("Current Utilization (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Current Utilization (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Current Utilization";
+ }
+ action("Historical Utilization (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Historical Utilization (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Historical Utilization";
+ }
+ action("Work Center Load (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Work Center Load (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Work Center Load";
+ }
+ action("Allocated Hours (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Allocated Hours (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Allocated Hours";
+ }
+ action("Expected Capacity Need (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Expected Capacity Need (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Expected Capacity Need";
+ }
+ action("Finished Prod. Order Breakdown (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Finished Prod. Order Breakdown (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Finished Prod. Order Breakdown";
+ }
+ action("Consumption Variance (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Consumption Variance (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Consumption Variance";
+ }
+ action("Capacity Variance (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Capacity Variance (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Capacity Variance";
+ }
+ action("Average Productions Times (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Average Productions Times (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Average Productions Times";
+ }
+ action("Released Production Orders (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Released Production Orders (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Released Production Orders";
+ }
+ action("Production Scrap (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Production Scrap (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Production Scrap";
+ }
+ }
+ }
+ }
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/OrderProcessorRoleCenter.PageExt.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/OrderProcessorRoleCenter.PageExt.al
new file mode 100644
index 0000000000..512d2867ca
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/OrderProcessorRoleCenter.PageExt.al
@@ -0,0 +1,108 @@
+namespace Microsoft.PowerBIReports;
+
+using Microsoft.Sales.RoleCenters;
+
+pageextension 36954 "Order Processor Role Center" extends "Order Processor Role Center"
+{
+ actions
+ {
+ addlast(Reporting)
+ {
+ group("PBI Reports")
+ {
+ Caption = 'Power BI Reports';
+ Image = PowerBI;
+ ToolTip = 'Power BI reports for sales';
+ action("Sales Overview")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Sales Overview';
+ Image = "PowerBI";
+ RunObject = page "Sales Overview";
+ Tooltip = 'Open a Power BI Report that provides a comprehensive view of sales performance, offering insights into metrics such as Total Sales, Gross Profit Margin, Number of New Customers, and top-performing customers and salespeople.';
+ }
+ action("Daily Sales")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Daily Sales';
+ Image = "PowerBI";
+ RunObject = page "Daily Sales";
+ Tooltip = 'Open a Power BI Report that offers a detailed analysis of sales amounts by weekday. The tabular report highlights trends by using conditional formatting to display figures in a gradient from low to high.';
+ }
+ action("Sales Moving Average")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Sales Moving Average';
+ Image = "PowerBI";
+ RunObject = page "Sales Moving Average";
+ Tooltip = 'Open a Power BI Report that visualizes the 30-day moving average of sales amounts over time. This helps identify trends by smoothing out fluctuations and highlighting overall patterns.';
+ }
+ action("Sales Moving Annual Total")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Sales Moving Annual Total';
+ Image = "PowerBI";
+ RunObject = page "Sales Moving Annual Total";
+ Tooltip = 'Open a Power BI Report that provides a rolling 12-month view of sales figures, tracking the current year to the previous year''s performance. ';
+ }
+ action("Sales Period-Over-Period")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Sales Period-Over-Period';
+ Image = "PowerBI";
+ RunObject = page "Sales Period-Over-Period";
+ Tooltip = 'Open a Power BI Report that compares sales performance across different periods, such as month-over-month or year-over-year.';
+ }
+ action("Sales Month-To-Date")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Sales Month-To-Date';
+ Image = "PowerBI";
+ RunObject = page "Sales Month-To-Date";
+ Tooltip = 'Open a Power BI Report that tracks the accumulation of sales amounts throughout the current month, providing insights into progress and performance up to the present date.';
+ }
+ action("Sales by Item")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Sales by Item';
+ Image = "PowerBI";
+ RunObject = page "Sales by Item";
+ Tooltip = 'Open a Power BI Report that breaks down sales performance by item category, highlighting metrics such as Sales Amount, Gross Profit Margin, and Gross Profit as a Percent of the Grand Total. This report provides detailed insights into which categories and items are driving revenue and profitability.';
+ }
+ action("Sales by Customer")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Sales by Customer';
+ Image = "PowerBI";
+ RunObject = page "Sales by Customer";
+ Tooltip = 'Open a Power BI Report that breaks down sales performance highlighting key metrics such as Sales Amount, Cost Amount, Gross Profit and Gross Profit Margin by customer. This report provides detailed insights into which customer and items driving revenue and profitability.';
+ }
+ action("Sales by Salesperson")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Sales by Salesperson';
+ Image = "PowerBI";
+ RunObject = page "Sales by Salesperson";
+ Tooltip = 'Open a Power BI Report that breaks down salesperson performance by customer and item. Highlighting metrics such as Sales Amount, Sales Quantity, Gross Profit and Gross Profit Margin.';
+ }
+ action("Sales Actual vs. Budget Quantity")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Sales Actual vs. Budget Quantity';
+ Image = "PowerBI";
+ RunObject = page "Sales Actual vs. Budget Qty.";
+ Tooltip = 'Open a Power BI Report that provides a comparative analysis of sales quantity to budget quantity. Featuring variance and variance percentage metrics that provide a clear view of actual performance compared to budgeted targets.';
+ }
+ action("Sales Actual vs. Budget Amount")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Sales Actual vs. Budget Amount';
+ Image = "PowerBI";
+ RunObject = page "Sales Actual vs. Budget Amt.";
+ Tooltip = 'Open a Power BI Report that provides a comparative analysis of sales amounts to budget amount. Featuring variance and variance percentage metrics that provide a clear view of actual performance compared to budgeted targets.';
+ }
+ }
+ }
+ }
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/PowerBIEmbeddedObjects.PermissionSet.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/PowerBIEmbeddedObjects.PermissionSet.al
new file mode 100644
index 0000000000..11c5673420
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/PowerBIEmbeddedObjects.PermissionSet.al
@@ -0,0 +1,79 @@
+namespace Microsoft.PowerBIReports;
+
+permissionset 36955 "Power BI Embedded - Objects"
+{
+ Access = Internal;
+ Assignable = false;
+ Permissions =
+ page "Financial Overview" = X,
+ page "Income Statement by Month" = X,
+ page "Balance Sheet by Month" = X,
+ page "Budget Comparison" = X,
+ page "Liquidity KPIs" = X,
+ page "Profitability" = X,
+ page "Liabilities" = X,
+ page "EBITDA" = X,
+ page "Average Collection Period" = X,
+ page "Aged Receivables (Back Dating)" = X,
+ page "Aged Payables (Back Dating)" = X,
+ page "General Ledger Entries" = X,
+ page "Detailed Vendor Ledger Entries" = X,
+ page "Detailed Cust. Ledger Entries" = X,
+ page "Sales Overview" = X,
+ page "Daily Sales" = X,
+ page "Sales Moving Average" = X,
+ page "Sales Moving Annual Total" = X,
+ page "Sales Period-Over-Period" = X,
+ page "Sales Month-To-Date" = X,
+ page "Sales by Item" = X,
+ page "Sales by Customer" = X,
+ page "Sales by Salesperson" = X,
+ page "Sales Actual vs. Budget Qty." = X,
+ page "Sales Actual vs. Budget Amt." = X,
+ page "Purchases Overview" = X,
+ page "Purchases Decomposition" = X,
+ page "Daily Purchases" = X,
+ page "Purchases Moving Averages" = X,
+ page "Purchases Moving Annual Total" = X,
+ page "Purchases Period-Over-Period" = X,
+ page "Purchases Year-Over-Year" = X,
+ page "Purchases by Item" = X,
+ page "Purchases by Purchaser" = X,
+ page "Purchases by Vendor" = X,
+ page "Purchases by Location" = X,
+ page "Purch. Actual vs. Budget Qty." = X,
+ page "Purch. Actual vs. Budget Amt." = X,
+ page "Inventory Overview" = X,
+ page "Inventory by Item" = X,
+ page "Inventory by Location" = X,
+ page "Purchase and Sales Quantity" = X,
+ page "Item Availability" = X,
+ page "Gross Requirement" = X,
+ page "Scheduled Receipt" = X,
+ page "Inventory by Lot" = X,
+ page "Inventory by Serial No." = X,
+ page "Bin Contents" = X,
+ page "Bin Contents by Item Tracking" = X,
+ page "Projects Overview" = X,
+ page "Project Tasks" = X,
+ page "Project Profitability" = X,
+ page "Project Realization" = X,
+ page "Project Performance to Budget" = X,
+ page "Project Invoiced Sales by Type" = X,
+ page "Project Invd. Sales by Cust." = X,
+ page "Current Utilization" = X,
+ page "Historical Utilization" = X,
+ page "Work Center Load" = X,
+ page "Allocated Hours" = X,
+ page "Expected Capacity Need" = X,
+ page "Finished Prod. Order Breakdown" = X,
+ page "Consumption Variance" = X,
+ page "Capacity Variance" = X,
+ page "Average Productions Times" = X,
+ page "Released Production Orders" = X,
+ page "Production Scrap" = X,
+ page "Inventory Valuation Overview" = X,
+ page "Inventory Valuation by Item" = X,
+ page "Inventory Valuation by Loc." = X;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/ProductionPlannerRoleCenter.PageExt.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/ProductionPlannerRoleCenter.PageExt.al
new file mode 100644
index 0000000000..3d258856c6
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/ProductionPlannerRoleCenter.PageExt.al
@@ -0,0 +1,108 @@
+namespace Microsoft.PowerBIReports;
+
+using Microsoft.Manufacturing.RoleCenters;
+
+pageextension 36958 "Production Planner Role Center" extends "Production Planner Role Center"
+{
+ actions
+ {
+ addlast(Reporting)
+ {
+ group("PBI Reports")
+ {
+ Caption = 'Power BI Reports';
+ Image = PowerBI;
+ ToolTip = 'Power BI reports for manufacturing';
+ action("Current Utilization")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Current Utilization';
+ Image = "PowerBI";
+ RunObject = page "Current Utilization";
+ Tooltip = 'Open a Power BI Report to view the current Weeks Utilization % by comparing Capacity Used to Available Capacity in Hours. View all or some Work Centres to measure throughput and efficiency.';
+ }
+ action("Historical Utilization")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Historical Utilization';
+ Image = "PowerBI";
+ RunObject = page "Historical Utilization";
+ Tooltip = 'Open a Power BI Report to view the historical Utilization % by comparing Capacity Used vs Available Capacity in Hours viewed over a timeline you can define to see trends. View all or some Work Centres.';
+ }
+ action("Work Center Load")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Work Center Load';
+ Image = "PowerBI";
+ RunObject = page "Work Center Load";
+ Tooltip = 'Open a Power BI Report to view the percentage of production order time assigned vs Available Capacity for each Work Centre Group and/or Work Centre in a specified period. Allows you to determine if a Work Centre is overloaded and requires rescheduling.';
+ }
+ action("Allocated Hours")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Allocated Hours';
+ Image = "PowerBI";
+ RunObject = page "Allocated Hours";
+ Tooltip = 'Open a Power BI Report to view the number of hours remaining for production allocated to each Work Centre in a specified period. Allows you to determine if a Work Centre is under or overloaded and requires rescheduling.';
+ }
+ action("Expected Capacity Need")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Expected Capacity Need';
+ Image = "PowerBI";
+ RunObject = page "Expected Capacity Need";
+ Tooltip = 'Open a Power BI Report to view the total hours scheduled to be performed for each Work Centre Group and/or Work Centre broken down by production order status and production order to analyze your requirement on factory resources.';
+ }
+ action("Finished Prod. Order Breakdown")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Finished Prod. Order Breakdown';
+ Image = "PowerBI";
+ RunObject = page "Finished Prod. Order Breakdown";
+ Tooltip = 'Open a Power BI Report to view Expected Quantities and Cost vs Actual Quantities and Costs over time, analyze the detail per item and drill down to the Production Order to track where variances are occurring.';
+ }
+ action("Consumption Variance")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Consumption Variance';
+ Image = "PowerBI";
+ RunObject = page "Consumption Variance";
+ Tooltip = 'Open a Power BI Report to view your consumption cost variance % viewed over a timeline you can define to see trends. Analyze by each production order and filter by Work Centre to see the detail behind the overall percentages.';
+ }
+ action("Capacity Variance")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Capacity Variance';
+ Image = "PowerBI";
+ RunObject = page "Capacity Variance";
+ Tooltip = 'Open a Power BI Report to view your capacity cost variance % viewed over a timeline you can define to see trends. Analyze by each production order and filter by Work Centre to see the detail behind the overall percentages.';
+ }
+ action("Average Productions Times")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Average Productions Times';
+ Image = "PowerBI";
+ RunObject = page "Average Productions Times";
+ Tooltip = 'Open a Power BI Report to view the average time spent for Setup, Run and Stop times per unit for each manufactured Item. Expand to see the times for each production order to determine why fluctuations occurred.';
+ }
+ action("Released Prod. Orders")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Released Production Orders';
+ Image = "PowerBI";
+ RunObject = page "Released Production Orders";
+ Tooltip = 'Open a Power BI Report to view how your released production orders are tracking by comparing Expected Quantity vs Finished Quantity';
+ }
+ action("Production Scrap")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Production Scrap';
+ Image = "PowerBI";
+ RunObject = page "Production Scrap";
+ Tooltip = 'Open a Power BI Report to view your scrap quantities over a timeline you can define to see trends. Analyze further by Scrap Code, Location, Item Categories and by filtering for specific items.';
+ }
+ }
+ }
+ }
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/ProductionScrap.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/ProductionScrap.Page.al
new file mode 100644
index 0000000000..2818056842
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/ProductionScrap.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 37055 "Production Scrap"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Production Scrap';
+ AboutTitle = 'About Production Scrap';
+ AboutText = 'View your scrap quantities over a timeline you can define to see trends. Analyze further by Scrap Code, Location, Item Categories and by filtering for specific items.';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSectionc790f50d90d7b6a6836a', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Manufacturing Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/Profitability.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/Profitability.Page.al
new file mode 100644
index 0000000000..bbd4ad2ab2
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/Profitability.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 36989 "Profitability"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Profitability';
+ AboutTitle = 'About Profitability';
+ AboutText = 'The Profitability report highlights Gross Profit and Net Profit, visualizing these metrics over time. It also provides detailed insights into net margins, gross profit margins, and the underlying revenue, cost and expense figures that drive them.';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSectionbb4917d9edb6d427282c', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Finance Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/ProjectInvdSalesbyCust.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/ProjectInvdSalesbyCust.Page.al
new file mode 100644
index 0000000000..0c434c76e2
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/ProjectInvdSalesbyCust.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 37039 "Project Invd. Sales by Cust."
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Project Invoiced Sales by Customer';
+ AboutTitle = 'About Project Invoiced Sales by Customer';
+ AboutText = 'The Project Invoiced Sales by Customer report details invoiced sales for a project, broken down by customer. It includes key KPIs such as % Invoiced, Billable Invoiced Price, and Billable Total Price, offering a clear view of project invoicing by customer. ';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSectioncd82c6e10e816900e80b', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Projects Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/ProjectInvoicedSalesbyType.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/ProjectInvoicedSalesbyType.Page.al
new file mode 100644
index 0000000000..4150e6940f
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/ProjectInvoicedSalesbyType.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 37038 "Project Invoiced Sales by Type"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Project Invoiced Sales by Type';
+ AboutTitle = 'About Project Invoiced Sales by Type';
+ AboutText = 'The Project Invoiced Sales by Type report details invoiced sales for a project categorized by line type. It includes key KPIs such as % Invoiced, Billable Invoiced Price, and Billable Total Price, providing a clear overview of project invoicing performance and statistics.';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSection355bfd7d0ab99d6a0620', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Projects Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/ProjectManagerRoleCenter.PageExt.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/ProjectManagerRoleCenter.PageExt.al
new file mode 100644
index 0000000000..28fb4284f7
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/ProjectManagerRoleCenter.PageExt.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using Microsoft.Projects.RoleCenters;
+
+pageextension 36963 "Project Manager Role Center" extends "Project Manager Role Center"
+{
+ actions
+ {
+ addfirst(Sections)
+ {
+ group("PBI Reports")
+ {
+ Caption = 'Power BI Reports';
+ Image = AnalysisView;
+ ToolTip = 'Power BI reports for projects';
+ action("Projects Overview (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Projects Overview (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Projects Overview";
+ }
+ action("Project Tasks (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Project Tasks (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Project Tasks";
+ }
+ action("Project Profitability (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Project Profitability (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Project Profitability";
+ }
+ action("Project Realization (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Project Realization (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Project Realization";
+ }
+ action("Project Performance to Budget (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Project Performance to Budget (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Project Performance to Budget";
+ }
+ action("Project Invoiced Sales by Type (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Project Invoiced Sales by Type (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Project Invoiced Sales by Type";
+ }
+ action("Project Invd. Sales by Cust. (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Project Invd. Sales by Cust. (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Project Invd. Sales by Cust.";
+ }
+ }
+ }
+ }
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/ProjectPerformancetoBudget.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/ProjectPerformancetoBudget.Page.al
new file mode 100644
index 0000000000..c2440e8978
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/ProjectPerformancetoBudget.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 37037 "Project Performance to Budget"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Project Performance to Budget';
+ AboutTitle = 'About Project Performance to Budget';
+ AboutText = 'The Project Performance to Budget report highlights key metrics, including Budget Total Cost, Actual Total Cost, and the variance and percentage variance from the budget. It features a table that details these metrics by project, offering a clear view of cost performance and deviations from budgeted targets.';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSection4b100a3a42980b76957c', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Projects Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/ProjectProfitability.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/ProjectProfitability.Page.al
new file mode 100644
index 0000000000..50fa7c8778
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/ProjectProfitability.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 37035 "Project Profitability"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Project Profitability';
+ AboutTitle = 'About Project Profitability';
+ AboutText = 'The Project Profitability report displays key metrics such as Actuals and Budgeted KPIs, compares actual profit to the initial profit target, and includes a table view of project ledger entries by type.';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSection16f4a9483133b8db3e12', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Projects Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/ProjectRealization.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/ProjectRealization.Page.al
new file mode 100644
index 0000000000..9429df2e36
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/ProjectRealization.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 37036 "Project Realization"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Project Realization';
+ AboutTitle = 'About Project Realization';
+ AboutText = 'The Project Realization report features key metrics like Billable Invoice Price and Actual Total Price to support Realization percent per project. Enabling organizations to measure actual performance and achievements against planned or budgeted expectations.';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSection1356fdbebe72ad7283d3', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Projects Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/ProjectTasks.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/ProjectTasks.Page.al
new file mode 100644
index 0000000000..cb02b2c0be
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/ProjectTasks.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 37034 "Project Tasks"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Project Tasks';
+ AboutTitle = 'About Project Tasks';
+ AboutText = 'The Project Task report details tasks related to each project, with metrics for each task clearly outlined. It presents tasks in a table matrix in a hierarchical view, making it easy to navigate and analyze project task information.';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label '89b75bcf2e511c341a05', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Projects Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/ProjectsOverview.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/ProjectsOverview.Page.al
new file mode 100644
index 0000000000..cb81faf21a
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/ProjectsOverview.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 37033 "Projects Overview"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Projects Overview';
+ AboutTitle = 'About Projects Overview';
+ AboutText = 'The Projects Overview dashboard provides key insights into project performance with metrics like Percent Complete, Percent Invoiced, Realization Percent, Actual Profit, and Actual Profit Margin. It features visuals comparing Actual vs. Budgeted Costs, highlighting Profit per Project, and organizing projects by Project Manager for streamlined project management.';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSectionf22cc27c0600033d5e26', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Projects Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/PurchActualvsBudgetAmt.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/PurchActualvsBudgetAmt.Page.al
new file mode 100644
index 0000000000..a98633ae44
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/PurchActualvsBudgetAmt.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 37021 "Purch. Actual vs. Budget Amt."
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Purchases Actual vs. Budget Amount';
+ AboutTitle = 'About Purchases Actual vs. Budget Amount';
+ AboutText = 'The Purchases Actual vs. Budget Amount report offers a comparative analysis of purchase amounts against budgeted amounts. It includes variance and variance percentage metrics to clearly show how actual purchases align with budgeted targets.';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSection412f858e7e32e58ccc22', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Purchases Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/PurchActualvsBudgetQty.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/PurchActualvsBudgetQty.Page.al
new file mode 100644
index 0000000000..7d753e2e53
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/PurchActualvsBudgetQty.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 37020 "Purch. Actual vs. Budget Qty."
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Purchase Actual vs. Budget Quantity';
+ AboutTitle = 'About Purchase Actual vs. Budget Quantity';
+ AboutText = 'The Purchases Actual vs. Budget Quantity report offers a comparative analysis of purchase quantities against budgeted quantities. It includes variance and variance percentage metrics to clearly show how actual purchases align with budgeted targets.';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSection0cb7f30495bc871b8948', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Purchases Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/PurchaseandSalesQuantity.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/PurchaseandSalesQuantity.Page.al
new file mode 100644
index 0000000000..64ee6b6302
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/PurchaseandSalesQuantity.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 37025 "Purchase and Sales Quantity"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Purchase and Sales Quantity';
+ AboutTitle = 'About Purchase and Sales Quantity';
+ AboutText = 'The Purchase and Sales Quantity report offers insight into inventory movements by visualizing Net Quantity Purchased and Net Quantity Sold across time. The table matrix breaks down purchases and sales by item and item category code, targeting insights into supply from purchases and demand from sales. ';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSection956cd619a014201c65e3', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Inventory Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/PurchasesDecomposition.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/PurchasesDecomposition.Page.al
new file mode 100644
index 0000000000..63aea7d2d0
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/PurchasesDecomposition.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 37010 "Purchases Decomposition"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Purchases Decomposition';
+ AboutTitle = 'About Purchases Decomposition';
+ AboutText = 'The Purchases Decomposition report visually breaks down Purchase Amount into its contributing factors, allowing users to explore and analyze data hierarchies in detail.';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSectiond7fdf374ab65b2861937', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Purchases Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/PurchasesMovingAnnualTotal.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/PurchasesMovingAnnualTotal.Page.al
new file mode 100644
index 0000000000..e06c670066
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/PurchasesMovingAnnualTotal.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 37013 "Purchases Moving Annual Total"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Purchases Moving Annual Total';
+ AboutTitle = 'About Purchases Moving Annual Total';
+ AboutText = 'The Purchases Moving Annual Total report provides a rolling 12-month view of procurement figures, tracking current year to the previous year''s performance. ';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSection26e891a305a24bb29884', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Purchases Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/PurchasesMovingAverages.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/PurchasesMovingAverages.Page.al
new file mode 100644
index 0000000000..47581b0f03
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/PurchasesMovingAverages.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 37012 "Purchases Moving Averages"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Purchases Moving Averages';
+ AboutTitle = 'About Purchases Moving Averages';
+ AboutText = 'The Purchases Moving Average report visualizes the 30-day moving average of purchase amounts over time. This helps identify trends by smoothing out fluctuations and highlighting overall patterns.';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSectionc4bf0b0750800ca6b0c6', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Purchases Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/PurchasesOverview.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/PurchasesOverview.Page.al
new file mode 100644
index 0000000000..1285d337c5
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/PurchasesOverview.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 37009 "Purchases Overview"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Purchases Overview';
+ AboutTitle = 'About Purchases Overview';
+ AboutText = 'The Purchase Overview provides high level insights into procurement performance, highlighting metrics such as Outstanding Quantities, Quantity Received not Invoiced and Invoice Quantity. ';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSection8aee09682245793948c4', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Purchases Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/PurchasesPeriodOverPeriod.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/PurchasesPeriodOverPeriod.Page.al
new file mode 100644
index 0000000000..dae4205075
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/PurchasesPeriodOverPeriod.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 37014 "Purchases Period-Over-Period"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Purchases Period-Over-Period';
+ AboutTitle = 'About Purchases Period-Over-Period';
+ AboutText = 'The Purchases Period Over Period report compares procurement performance across different periods, such as month-over-month or year-over-year. Completed up to here';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSection2c5c763cbb0914a4201d', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Purchases Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/PurchasesYearOverYear.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/PurchasesYearOverYear.Page.al
new file mode 100644
index 0000000000..7edf550e03
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/PurchasesYearOverYear.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 37015 "Purchases Year-Over-Year"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Purchases Year-Over-Year';
+ AboutTitle = 'About Purchases Year-Over-Year';
+ AboutText = 'The Purchases Year-Over-Year report compares purchase amounts across multiple years. This report is essential for long-term planning and making informed decisions based on historical purchasing data.';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSection884ee5483252d4c5e096', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Purchases Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/PurchasesbyItem.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/PurchasesbyItem.Page.al
new file mode 100644
index 0000000000..580a769950
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/PurchasesbyItem.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 37016 "Purchases by Item"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Purchases by Item';
+ AboutTitle = 'About Purchases by Item';
+ AboutText = 'The Purchases by Item report breaks down procurement performance by item, highlighting metrics such as Purchase Amount, Purchase Quantity. The Treemap visualizes the relative size and contribution of each item to the whole, making it easy to identify the largest or smallest purchases at a glance.';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSection510c03a74548b078dc31', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Purchases Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/PurchasesbyLocation.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/PurchasesbyLocation.Page.al
new file mode 100644
index 0000000000..c713104a15
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/PurchasesbyLocation.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 37019 "Purchases by Location"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Purchases by Location';
+ AboutTitle = 'About Purchases by Location';
+ AboutText = 'The Purchases by Location report displays purchase amounts and quantities by location. Including a Treemap to highlight item spending contributions and a bar chart to show purchase amounts by item category.';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSection86b19910d517e658b780', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Purchases Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/PurchasesbyPurchaser.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/PurchasesbyPurchaser.Page.al
new file mode 100644
index 0000000000..728dfa397a
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/PurchasesbyPurchaser.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 37017 "Purchases by Purchaser"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Purchases by Purchaser';
+ AboutTitle = 'About Purchases by Purchaser';
+ AboutText = 'The Purchases by Purchaser report breaks down purchase amounts by individual purchasers, using a Treemap to visually compare spending contributions by item. A bar chart complements this, displaying purchase amounts for each purchaser. Making it easy to identify top spenders and track procurement patterns.';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSection2530548032dd85837d8c', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Purchases Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/PurchasesbyVendor.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/PurchasesbyVendor.Page.al
new file mode 100644
index 0000000000..8f15d513e7
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/PurchasesbyVendor.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 37018 "Purchases by Vendor"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Purchases by Vendor';
+ AboutTitle = 'About Purchases by Vendor';
+ AboutText = 'The Purchases by Vendor report shows purchase amounts and quantities by vendor. Featuring a Treemap for item spending contributions and a bar chart for purchase amounts by item category, offering a clear view of vendor performance and spending patterns.';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSectiond03ece9eb5ac094617e2', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Purchases Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/PurchasingAgentRoleCenter.PageExt.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/PurchasingAgentRoleCenter.PageExt.al
new file mode 100644
index 0000000000..cae1e5dd1e
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/PurchasingAgentRoleCenter.PageExt.al
@@ -0,0 +1,124 @@
+namespace Microsoft.PowerBIReports;
+
+using Microsoft.Purchases.RoleCenters;
+
+pageextension 36955 "Purchasing Agent Role Center" extends "Purchasing Agent Role Center"
+{
+ actions
+ {
+ addlast(Reporting)
+ {
+ group("PBI Reports")
+ {
+ Caption = 'Power BI Reports';
+ Image = PowerBI;
+ ToolTip = 'Power BI reports for purchases';
+ action("Purchases Overview")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Purchases Overview';
+ Image = "PowerBI";
+ RunObject = page "Purchases Overview";
+ Tooltip = 'Open a Power BI Report that provides high level insights into procurement performance, highlighting metrics such as Outstanding Quantities, Quantity Received not Invoiced and Invoice Quantity. ';
+ }
+ action("Purchases Decomposition")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Purchases Decomposition';
+ Image = "PowerBI";
+ RunObject = page "Purchases Decomposition";
+ Tooltip = 'Open a Power BI Report that visually breaks down Purchase Amount into its contributing factors, allowing users to explore and analyze data hierarchies in detail.';
+ }
+ action("Daily Purchases")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Daily Purchases';
+ Image = "PowerBI";
+ RunObject = page "Daily Purchases";
+ Tooltip = 'Open a Power BI Report that offers a detailed analysis of purchase amounts by weekday. The tabular report highlights purchasing trends by using conditional formatting to display purchase figures in a gradient from low to high.';
+ }
+ action("Purchases Moving Averages")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Purchases Moving Averages';
+ Image = "PowerBI";
+ RunObject = page "Purchases Moving Averages";
+ Tooltip = 'Open a Power BI Report that visualizes the 30-day moving average of purchase amounts over time. This helps identify trends by smoothing out fluctuations and highlighting overall patterns.';
+ }
+ action("Purchases Moving Annual Total")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Purchases Moving Annual Total';
+ Image = "PowerBI";
+ RunObject = page "Purchases Moving Annual Total";
+ Tooltip = 'Open a Power BI Report that provides a rolling 12-month view of procurement figures, tracking current year to the previous year''s performance. ';
+ }
+ action("Purchases Period-Over-Period")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Purchases Period-Over-Period';
+ Image = "PowerBI";
+ RunObject = page "Purchases Period-Over-Period";
+ Tooltip = 'Open a Power BI Report that compares procurement performance across different periods, such as month-over-month or year-over-year. Completed up to here';
+ }
+ action("Purchases Year-Over-Year")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Purchases Year-Over-Year';
+ Image = "PowerBI";
+ RunObject = page "Purchases Year-Over-Year";
+ Tooltip = 'Open a Power BI Report that compares purchase amounts across multiple years. This report is essential for long-term planning and making informed decisions based on historical purchasing data.';
+ }
+ action("Purchases by Item")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Purchases by Item';
+ Image = "PowerBI";
+ RunObject = page "Purchases by Item";
+ Tooltip = 'Open a Power BI Report that breaks down procurement performance by item, highlighting metrics such as Purchase Amount, Purchase Quantity. The Treemap visualizes the relative size and contribution of each item to the whole, making it easy to identify the largest or smallest purchases at a glance.';
+ }
+ action("Purchases by Purchaser")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Purchases by Purchaser';
+ Image = "PowerBI";
+ RunObject = page "Purchases by Purchaser";
+ Tooltip = 'Open a Power BI Report that breaks down purchase amounts by individual purchasers, using a Treemap to visually compare spending contributions by item. A bar chart complements this, displaying purchase amounts for each purchaser. Making it easy to identify top spenders and track procurement patterns.';
+ }
+ action("Purchases by Vendor")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Purchases by Vendor';
+ Image = "PowerBI";
+ RunObject = page "Purchases by Vendor";
+ Tooltip = 'Open a Power BI Report that shows purchase amounts and quantities by vendor. Featuring a Treemap for item spending contributions and a bar chart for purchase amounts by item category, offering a clear view of vendor performance and spending patterns.';
+ }
+ action("Purchases by Location")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Purchases by Location';
+ Image = "PowerBI";
+ RunObject = page "Purchases by Location";
+ Tooltip = 'Open a Power BI Report that displays purchase amounts and quantities by location. Including a Treemap to highlight item spending contributions and a bar chart to show purchase amounts by item category.';
+ }
+ action("Purchases Actual vs. Budget Quantity")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Purchases Actual vs. Budget Quantity';
+ Image = "PowerBI";
+ RunObject = page "Purch. Actual vs. Budget Qty.";
+ Tooltip = 'Open a Power BI Report that offers a comparative analysis of purchase quantities against budgeted quantities. It includes variance and variance percentage metrics to clearly show how actual purchases align with budgeted targets.';
+ }
+ action("Purchases Actual vs. Budget Amount")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Purchases Actual vs. Budget Amount';
+ Image = "PowerBI";
+ RunObject = page "Purch. Actual vs. Budget Amt.";
+ Tooltip = 'Open a Power BI Report that offers a comparative analysis of purchase amounts against budgeted amounts. It includes variance and variance percentage metrics to clearly show how actual purchases align with budgeted targets.';
+ }
+ }
+ }
+ }
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/PurchasingManagerRoleCenter.PageExt.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/PurchasingManagerRoleCenter.PageExt.al
new file mode 100644
index 0000000000..bc698f4f6d
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/PurchasingManagerRoleCenter.PageExt.al
@@ -0,0 +1,111 @@
+namespace Microsoft.PowerBIReports;
+
+using Microsoft.Purchases.RoleCenters;
+
+pageextension 36961 "Purchasing Manager Role Center" extends "Purchasing Manager Role Center"
+{
+ actions
+ {
+ addfirst(Sections)
+ {
+ group("PBI Reports")
+ {
+ Caption = 'Power BI Reports';
+ Image = AnalysisView;
+ ToolTip = 'Power BI reports for purchases';
+ action("Purchases Overview (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Purchases Overview (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Purchases Overview";
+ }
+ action("Purchases Decomposition (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Purchases Decomposition (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Purchases Decomposition";
+ }
+ action("Daily Purchases (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Daily Purchases (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Daily Purchases";
+ }
+ action("Purchases Moving Averages (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Purchases Moving Averages (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Purchases Moving Averages";
+ }
+ action("Purchases Moving Annual Total (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Purchases Moving Annual Total (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Purchases Moving Annual Total";
+ }
+ action("Purchases Period-Over-Period (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Purchases Period-Over-Period (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Purchases Period-Over-Period";
+ }
+ action("Purchases Year-Over-Year (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Purchases Year-Over-Year (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Purchases Year-Over-Year";
+ }
+ action("Purchases by Item (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Purchases by Item (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Purchases by Item";
+ }
+ action("Purchases by Purchaser (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Purchases by Purchaser (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Purchases by Purchaser";
+ }
+ action("Purchases by Vendor (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Purchases by Vendor (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Purchases by Vendor";
+ }
+ action("Purchases by Location (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Purchases by Location (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Purchases by Location";
+ }
+ action("Purch. Actual vs. Budget Qty. (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Purch. Actual vs. Budget Qty. (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Purch. Actual vs. Budget Qty.";
+ }
+ action("Purch. Actual vs. Budget Amt. (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Purch. Actual vs. Budget Amt. (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Purch. Actual vs. Budget Amt.";
+ }
+ }
+ }
+ }
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/ReleasedProductionOrders.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/ReleasedProductionOrders.Page.al
new file mode 100644
index 0000000000..06f9323a47
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/ReleasedProductionOrders.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 37049 "Released Production Orders"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Released Production Orders';
+ AboutTitle = 'About Released Production Orders';
+ AboutText = 'View how your released production orders are tracking by comparing Expected Quantity vs Finished Quantity';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSectionc2dea8def8e17bcc1d69', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Manufacturing Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/SalesActualvsBudgetAmt.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/SalesActualvsBudgetAmt.Page.al
new file mode 100644
index 0000000000..331140cc1b
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/SalesActualvsBudgetAmt.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 37008 "Sales Actual vs. Budget Amt."
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Sales Actual vs. Budget Amount';
+ AboutTitle = 'About Sales Actual vs. Budget Amount';
+ AboutText = 'The Sales Actual vs. Budget Amount report provides a comparative analysis of sales amounts to budget amount. Featuring variance and variance percentage metrics that provide a clear view of actual performance compared to budgeted targets.';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSectionce3be3bc80c816f2646b', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Sales Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/SalesActualvsBudgetQty.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/SalesActualvsBudgetQty.Page.al
new file mode 100644
index 0000000000..965402b3d3
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/SalesActualvsBudgetQty.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 37007 "Sales Actual vs. Budget Qty."
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Sales Actual vs. Budget Quantity';
+ AboutTitle = 'About Sales Actual vs. Budget Quantity';
+ AboutText = 'The Sales Actual vs. Budget Quantity report provides a comparative analysis of sales quantity to budget quantity. Featuring variance and variance percentage metrics that provide a clear view of actual performance compared to budgeted targets.';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSection05f91a4884be2b5c94ed', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Sales Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/SalesMarketingManagerRC.PageExt.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/SalesMarketingManagerRC.PageExt.al
new file mode 100644
index 0000000000..9d00265f65
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/SalesMarketingManagerRC.PageExt.al
@@ -0,0 +1,97 @@
+namespace Microsoft.PowerBIReports;
+
+using Microsoft.CRM.RoleCenters;
+
+pageextension 36960 "Sales & Marketing Manager RC" extends "Sales & Marketing Manager RC"
+{
+ actions
+ {
+ addfirst(Sections)
+ {
+ group("PBI Reports")
+ {
+ Caption = 'Power BI Reports';
+ Image = AnalysisView;
+ ToolTip = 'Power BI reports for sales';
+ action("Sales Overview (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Sales Overview (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Sales Overview";
+ }
+ action("Daily Sales (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Daily Sales (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Daily Sales";
+ }
+ action("Sales Moving Average (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Sales Moving Average (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Sales Moving Average";
+ }
+ action("Sales Moving Annual Total (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Sales Moving Annual Total (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Sales Moving Annual Total";
+ }
+ action("Sales Period-Over-Period (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Sales Period-Over-Period (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Sales Period-Over-Period";
+ }
+ action("Sales Month-To-Date (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Sales Month-To-Date (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Sales Month-To-Date";
+ }
+ action("Sales by Item (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Sales by Item (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Sales by Item";
+ }
+ action("Sales by Customer (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Sales by Customer (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Sales by Customer";
+ }
+ action("Sales by Salesperson (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Sales by Salesperson (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Sales by Salesperson";
+ }
+ action("Sales Actual vs. Budget Qty. (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Sales Actual vs. Budget Qty. (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Sales Actual vs. Budget Qty.";
+ }
+ action("Sales Actual vs. Budget Amt. (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Sales Actual vs. Budget Amt. (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Sales Actual vs. Budget Amt.";
+ }
+ }
+ }
+ }
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/SalesMonthToDate.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/SalesMonthToDate.Page.al
new file mode 100644
index 0000000000..2741430be3
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/SalesMonthToDate.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 37003 "Sales Month-To-Date"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Sales Month-To-Date';
+ AboutTitle = 'About Sales Month-To-Date';
+ AboutText = 'The Sales Month-to-Date report tracks the accumulation of sales amounts throughout the current month, providing insights into progress and performance up to the present date.';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSection7d903e33b708c20e3be1', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Sales Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/SalesMovingAnnualTotal.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/SalesMovingAnnualTotal.Page.al
new file mode 100644
index 0000000000..e3069c3ce4
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/SalesMovingAnnualTotal.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 37001 "Sales Moving Annual Total"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Sales Moving Annual Total';
+ AboutTitle = 'About Sales Moving Annual Total';
+ AboutText = 'The Sales Moving Annual Total report provides a rolling 12-month view of sales figures, tracking the current year to the previous year''s performance. ';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSection713e48d18640066bc508', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Sales Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/SalesMovingAverage.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/SalesMovingAverage.Page.al
new file mode 100644
index 0000000000..2673839487
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/SalesMovingAverage.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 37000 "Sales Moving Average"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Sales Moving Average';
+ AboutTitle = 'About Sales Moving Average';
+ AboutText = 'The Sales Moving Average report visualizes the 30-day moving average of sales amounts over time. This helps identify trends by smoothing out fluctuations and highlighting overall patterns.';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSectionb41f5981e90364039035', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Sales Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/SalesOverview.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/SalesOverview.Page.al
new file mode 100644
index 0000000000..fc2f520fce
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/SalesOverview.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 36998 "Sales Overview"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Sales Overview';
+ AboutTitle = 'About Sales Overview';
+ AboutText = 'The Sales Overview provides a comprehensive view of sales performance, offering insights into metrics such as Total Sales, Gross Profit Margin, Number of New Customers, and top-performing customers and salespeople.';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSection918285c1bd8f1b7ef96c', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Sales Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/SalesPeriodOverPeriod.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/SalesPeriodOverPeriod.Page.al
new file mode 100644
index 0000000000..55c0f9620b
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/SalesPeriodOverPeriod.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 37002 "Sales Period-Over-Period"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Sales Period-Over-Period';
+ AboutTitle = 'About Sales Period-Over-Period';
+ AboutText = 'The Sales Period Over Period report compares sales performance across different periods, such as month-over-month or year-over-year.';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSection2480499c371d97221c09', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Sales Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/SalesbyCustomer.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/SalesbyCustomer.Page.al
new file mode 100644
index 0000000000..666954f69e
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/SalesbyCustomer.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 37005 "Sales by Customer"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Sales by Customer';
+ AboutTitle = 'About Sales by Customer';
+ AboutText = 'The Sales by Customer report breaks down sales performance highlighting key metrics such as Sales Amount, Cost Amount, Gross Profit and Gross Profit Margin by customer. This report provides detailed insights into which customer and items driving revenue and profitability.';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSection48bbd51044e094b7a9a2', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Sales Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/SalesbyItem.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/SalesbyItem.Page.al
new file mode 100644
index 0000000000..1571a1580d
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/SalesbyItem.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 37004 "Sales by Item"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Sales by Item';
+ AboutTitle = 'About Sales by Item';
+ AboutText = 'The Sales by Item report breaks down sales performance by item category, highlighting metrics such as Sales Amount, Gross Profit Margin, and Gross Profit as a Percent of the Grand Total. This report provides detailed insights into which categories and items are driving revenue and profitability.';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSection913651e69467cecd580d', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Sales Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/SalesbySalesperson.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/SalesbySalesperson.Page.al
new file mode 100644
index 0000000000..d6a4330b78
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/SalesbySalesperson.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 37006 "Sales by Salesperson"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Sales by Salesperson';
+ AboutTitle = 'About Sales by Salesperson';
+ AboutText = 'The Sales by Salesperson report breaks down salesperson performance by customer and item. Highlighting metrics such as Sales Amount, Sales Quantity, Gross Profit and Gross Profit Margin.';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSectiond95fc6aa44e9e612cbc4', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Sales Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/ScheduledReceipt.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/ScheduledReceipt.Page.al
new file mode 100644
index 0000000000..2775337b87
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/ScheduledReceipt.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 37028 "Scheduled Receipt"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Scheduled Receipt';
+ AboutTitle = 'About Scheduled Receipt';
+ AboutText = 'The Scheduled Receipt report visualizes Scheduled Receipt against Projected Available Balance over time, offering a clear view of inventory supply. A table matrix breaks this down by item, showcasing key metrics like Scheduled Receipt Quantity, Projected Available Balance, and quantities from supply documents such as purchase orders, transfer receipts and manufacturing documents.';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSection5aaca347e8eb867da682', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Inventory Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/WarehouseManagerRoleCenter.PageExt.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/WarehouseManagerRoleCenter.PageExt.al
new file mode 100644
index 0000000000..3ffd95ab33
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/WarehouseManagerRoleCenter.PageExt.al
@@ -0,0 +1,97 @@
+namespace Microsoft.PowerBIReports;
+
+using Microsoft.Warehouse.RoleCenters;
+
+pageextension 36962 "Warehouse Manager Role Center" extends "Warehouse Manager Role Center"
+{
+ actions
+ {
+ addfirst(Sections)
+ {
+ group("PBI Reports")
+ {
+ Caption = 'Power BI Reports';
+ Image = AnalysisView;
+ ToolTip = 'Power BI reports for inventory';
+ action("Inventory Overview (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Inventory Overview (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Inventory Overview";
+ }
+ action("Inventory by Item (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Inventory by Item (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Inventory by Item";
+ }
+ action("Inventory by Location (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Inventory by Location (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Inventory by Location";
+ }
+ action("Purchase and Sales Quantity (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Purchase and Sales Quantity (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Purchase and Sales Quantity";
+ }
+ action("Item Availability (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Item Availability (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Item Availability";
+ }
+ action("Gross Requirement (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Gross Requirement (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Gross Requirement";
+ }
+ action("Scheduled Receipt (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Scheduled Receipt (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Scheduled Receipt";
+ }
+ action("Inventory by Lot (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Inventory by Lot (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Inventory by Lot";
+ }
+ action("Inventory by Serial No. (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Inventory by Serial No. (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Inventory by Serial No.";
+ }
+ action("Bin Contents (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Bin Contents (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Bin Contents";
+ }
+ action("Bin Contents by Item Tracking (Power BI)")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Bin Contents by Item Tracking (Power BI)';
+ Image = "PowerBI";
+ RunObject = page "Bin Contents by Item Tracking";
+ }
+ }
+ }
+ }
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/WhseBasicRoleCenter.PageExt.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/WhseBasicRoleCenter.PageExt.al
new file mode 100644
index 0000000000..cbcb22c113
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/WhseBasicRoleCenter.PageExt.al
@@ -0,0 +1,108 @@
+namespace Microsoft.PowerBIReports;
+
+using Microsoft.Warehouse.RoleCenters;
+
+pageextension 36956 "Whse. Basic Role Center" extends "Whse. Basic Role Center"
+{
+ actions
+ {
+ addlast(Reporting)
+ {
+ group("PBI Reports")
+ {
+ Caption = 'Power BI Reports';
+ Image = PowerBI;
+ ToolTip = 'Power BI reports for inventory';
+ action("Inventory Overview")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Inventory Overview';
+ Image = "PowerBI";
+ RunObject = page "Inventory Overview";
+ Tooltip = 'Open a Power BI Report that offers a dashboard view of inventory, featuring key elements such as inventory by location, a comparison of inventory balance versus projected available balance, and key metrics like scheduled receipt quantities and gross requirements.';
+ }
+ action("Inventory by Item")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Inventory by Item';
+ Image = "PowerBI";
+ RunObject = page "Inventory by Item";
+ Tooltip = 'Open a Power BI Report that provides inventory quantities by item, offering insights into the sources of supply and demand. Helping organizations understand item-level inventory status, manage stock effectively, and make informed decisions about the state of supply and demand.';
+ }
+ action("Inventory by Location")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Inventory by Location';
+ Image = "PowerBI";
+ RunObject = page "Inventory by Location";
+ Tooltip = 'Open a Power BI Report that shows inventory quantities by item and by location. ';
+ }
+ action("Purchase and Sales Quantity")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Purchase and Sales Quantity';
+ Image = "PowerBI";
+ RunObject = page "Purchase and Sales Quantity";
+ Tooltip = 'Open a Power BI Report that offers insight into inventory movements by visualizing Net Quantity Purchased and Net Quantity Sold across time. The table matrix breaks down purchases and sales by item and item category code, targeting insights into supply from purchases and demand from sales. ';
+ }
+ action("Item Availability")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Item Availability';
+ Image = "PowerBI";
+ RunObject = page "Item Availability";
+ Tooltip = 'Open a Power BI Report that visualizes Quantity on Hand versus Projected Available Balance over time, helping track inventory trends. A table matrix breaks down this data by item, offering metrics such as Inventory, Projected Available Balance, Gross Requirements, Scheduled Receipts, Planned Order Receipts, and Planned Order Releases. Providing a comprehensive view of item availability, aiding in effective inventory management and planning.';
+ }
+ action("Gross Requirement")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Gross Requirement';
+ Image = "PowerBI";
+ RunObject = page "Gross Requirement";
+ Tooltip = 'Open a Power BI Report that visualizes Gross Requirements against Projected Available Balance over time, offering a clear view of inventory demands. A table matrix breaks down this data by item, showcasing key metrics like Gross Requirement, Projected Available Balance, and quantities from demand documents (sales orders and purchase return orders). ';
+ }
+ action("Scheduled Receipt")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Scheduled Receipt';
+ Image = "PowerBI";
+ RunObject = page "Scheduled Receipt";
+ Tooltip = 'Open a Power BI Report that visualizes Scheduled Receipt against Projected Available Balance over time, offering a clear view of inventory supply. A table matrix breaks this down by item, showcasing key metrics like Scheduled Receipt Quantity, Projected Available Balance, and quantities from supply documents such as purchase orders, transfer receipts and manufacturing documents.';
+ }
+ action("Inventory by Lot")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Inventory by Lot';
+ Image = "PowerBI";
+ RunObject = page "Inventory by Lot";
+ Tooltip = 'Open a Power BI Report that displays inventory quantities categorized by lot number, providing detailed insights into specific batches of stock. A decomposition tree enhances this by allowing users to drill down into inventory data, breaking down lot quantities by various dimensions such as location, item category, or vendor.';
+ }
+ action("Inventory by Serial No.")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Inventory by Serial No.';
+ Image = "PowerBI";
+ RunObject = page "Inventory by Serial No.";
+ Tooltip = 'Open a Power BI Report that displays inventory quantities categorized by serial number. The decomposition tree enhances this report by allowing users to drill down into inventory data, breaking down quantities by various dimensions such as location, item category, or vendor.';
+ }
+ action("Bin Contents")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Bin Contents';
+ Image = "PowerBI";
+ RunObject = page "Bin Contents";
+ Tooltip = 'Open a Power BI Report that provides a detailed view of item quantities by bin code and location. It includes additional information such as warehouse quantity, pick and put-away quantities, and both negative and positive adjustments, offering a comprehensive overview of bin movements and inventory management within the warehouse.';
+ }
+ action("Bin Contents by Item Tracking")
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Bin Contents by Item Tracking';
+ Image = "PowerBI";
+ RunObject = page "Bin Contents by Item Tracking";
+ Tooltip = 'Open a Power BI Report that provides a detailed view of warehouse quantities by Item, Location, Bin Code, Zone Code, Lot number or Serial number. ';
+ }
+ }
+ }
+ }
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Autogenerated/WorkCenterLoad.Page.al b/Apps/W1/PowerBIReports/app/src/Autogenerated/WorkCenterLoad.Page.al
new file mode 100644
index 0000000000..9a9a5d928f
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Autogenerated/WorkCenterLoad.Page.al
@@ -0,0 +1,69 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 37042 "Work Center Load"
+{
+ UsageCategory = ReportsAndAnalysis;
+ Caption = 'Work Center Load';
+ AboutTitle = 'About Work Center Load';
+ AboutText = 'View the percentage of production order time assigned vs Available Capacity for each Work Centre Group and/or Work Centre in a specified period. Allows you to determine if a Work Centre is overloaded and requires rescheduling.';
+ Extensible = false;
+
+ layout
+ {
+ area(Content)
+ {
+ usercontrol(PowerBIAddin; PowerBIManagement)
+ {
+ ApplicationArea = All;
+
+ trigger ControlAddInReady()
+ begin
+ SetupHelper.InitializeEmbeddedAddin(CurrPage.PowerBIAddin, ReportId, ReportPageTok);
+ end;
+
+ trigger ErrorOccurred(Operation: Text; ErrorText: Text)
+ begin
+ SetupHelper.ShowPowerBIErrorNotification(Operation, ErrorText);
+ end;
+ }
+ }
+ }
+
+ actions
+ {
+ area(processing)
+ {
+ action(FullScreen)
+ {
+ ApplicationArea = All;
+ Caption = 'Fullscreen';
+ ToolTip = 'Shows the Power BI element as full screen.';
+ Image = View;
+ Visible = false;
+
+ trigger OnAction()
+ begin
+ CurrPage.PowerBIAddin.FullScreen();
+ end;
+ }
+ }
+ }
+
+ var
+ SetupHelper: Codeunit "Setup Helper";
+ ReportId: Guid;
+#pragma warning disable AA0240
+ ReportPageTok: Label 'ReportSection83a7395d207d5b47b1a4', Locked = true;
+#pragma warning restore AA0240
+
+ trigger OnOpenPage()
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ ReportId := SetupHelper.GetReportIdAndEnsureSetup(CurrPage.Caption(), PowerBIReportsSetup.FieldNo("Manufacturing Report Id"));
+ end;
+}
+
diff --git a/Apps/W1/PowerBIReports/app/src/Core/Codeunits/Initialization.Codeunit.al b/Apps/W1/PowerBIReports/app/src/Core/Codeunits/Initialization.Codeunit.al
index 618486d118..4e3813a3c9 100644
--- a/Apps/W1/PowerBIReports/app/src/Core/Codeunits/Initialization.Codeunit.al
+++ b/Apps/W1/PowerBIReports/app/src/Core/Codeunits/Initialization.Codeunit.al
@@ -32,14 +32,22 @@ codeunit 36951 Initialization
end;
procedure InitialisePBIWorkingDays()
+ var
+ MondayLbl: Label 'Monday';
+ TuesdayLbl: Label 'Tuesday';
+ WednesdayLbl: Label 'Wednesday';
+ ThursdayLbl: Label 'Thursday';
+ FridayLbl: Label 'Friday';
+ SaturdayLbl: Label 'Saturday';
+ SundayLbl: Label 'Sunday';
begin
- InsertWorkingDay(0, 'Sunday', false);
- InsertWorkingDay(1, 'Monday', true);
- InsertWorkingDay(2, 'Tuesday', true);
- InsertWorkingDay(3, 'Wednesday', true);
- InsertWorkingDay(4, 'Thursday', true);
- InsertWorkingDay(5, 'Friday', true);
- InsertWorkingDay(6, 'Saturday', false);
+ InsertWorkingDay(0, SundayLbl, false);
+ InsertWorkingDay(1, MondayLbl, true);
+ InsertWorkingDay(2, TuesdayLbl, true);
+ InsertWorkingDay(3, WednesdayLbl, true);
+ InsertWorkingDay(4, ThursdayLbl, true);
+ InsertWorkingDay(5, FridayLbl, true);
+ InsertWorkingDay(6, SaturdayLbl, false);
end;
local procedure InsertWorkingDay(DayNumber: Integer; DayName: Text[50]; Working: Boolean)
diff --git a/Apps/W1/PowerBIReports/app/src/Core/Codeunits/InstallationHandler.Codeunit.al b/Apps/W1/PowerBIReports/app/src/Core/Codeunits/InstallationHandler.Codeunit.al
index 78eaada6e3..117f22b2f0 100644
--- a/Apps/W1/PowerBIReports/app/src/Core/Codeunits/InstallationHandler.Codeunit.al
+++ b/Apps/W1/PowerBIReports/app/src/Core/Codeunits/InstallationHandler.Codeunit.al
@@ -3,6 +3,7 @@ namespace Microsoft.PowerBIReports;
using System.Environment.Configuration;
using System.Media;
using Microsoft.Foundation.Company;
+using System.DataAdministration;
codeunit 36950 "Installation Handler"
{
@@ -50,4 +51,39 @@ codeunit 36950 "Installation Handler"
PBIMgt.InitialiseJobQueue(Codeunit::"Update Dim. Set Entries", JobQueueDescLbl);
PBIMgt.InitDimSetEntryLastUpdated();
end;
+
+ [EventSubscriber(ObjectType::Codeunit, Codeunit::"Environment Cleanup", 'OnClearCompanyConfig', '', false, false)]
+ local procedure OnClearCompanyConfig(CompanyName: Text)
+ begin
+ ClearCompanySpecificSetup(CompanyName);
+ end;
+
+ [EventSubscriber(ObjectType::Report, Report::"Copy Company", 'OnAfterCreatedNewCompanyByCopyCompany', '', false, false)]
+ local procedure OnAfterCreatedNewCompanyByCopyCompany(NewCompanyName: Text[30])
+ begin
+ ClearCompanySpecificSetup(NewCompanyName);
+ end;
+
+ local procedure ClearCompanySpecificSetup(CompanyName: Text)
+ var
+ PowerBIReportsSetup: Record "PowerBI Reports Setup";
+ begin
+ if CompanyName <> '' then
+ PowerBIReportsSetup.ChangeCompany(CompanyName);
+ if PowerBIReportsSetup.FindFirst() then begin
+ Clear(PowerBIReportsSetup."Finance Report Id");
+ Clear(PowerBIReportsSetup."Finance Report Name");
+ Clear(PowerBIReportsSetup."Sales Report Id");
+ Clear(PowerBIReportsSetup."Sales Report Name");
+ Clear(PowerBIReportsSetup."Purchases Report Id");
+ Clear(PowerBIReportsSetup."Purchases Report Name");
+ Clear(PowerBIReportsSetup."Inventory Report Id");
+ Clear(PowerBIReportsSetup."Inventory Report Name");
+ Clear(PowerBIReportsSetup."Projects Report Id");
+ Clear(PowerBIReportsSetup."Projects Report Name");
+ Clear(PowerBIReportsSetup."Manufacturing Report Id");
+ Clear(PowerBIReportsSetup."Manufacturing Report Name");
+ PowerBIReportsSetup.Modify();
+ end;
+ end;
}
\ No newline at end of file
diff --git a/Apps/W1/PowerBIReports/app/src/Core/Codeunits/SetupHelper.Codeunit.al b/Apps/W1/PowerBIReports/app/src/Core/Codeunits/SetupHelper.Codeunit.al
new file mode 100644
index 0000000000..5ee2f4e33b
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Core/Codeunits/SetupHelper.Codeunit.al
@@ -0,0 +1,127 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+using System.Reflection;
+using System.Environment.Configuration;
+
+codeunit 36961 "Setup Helper"
+{
+ Access = Internal;
+
+ procedure EnsureUserAcceptedPowerBITerms()
+ var
+ PowerBIContextSettings: Record "Power BI Context Settings";
+ PowerBIEmbedSetupWizard: Page "Power BI Embed Setup Wizard";
+ PowerBiNotSetupErr: Label 'Power BI is not set up. You need to set up Power BI in order to continue.';
+ begin
+ PowerBIContextSettings.SetRange(UserSID, UserSecurityId());
+ if PowerBIContextSettings.IsEmpty() then begin
+ PowerBIEmbedSetupWizard.SetContext('');
+ if PowerBIEmbedSetupWizard.RunModal() <> Action::OK then;
+
+ if PowerBIContextSettings.IsEmpty() then
+ Error(PowerBiNotSetupErr);
+ end;
+ end;
+
+ procedure GetReportIdAndEnsureSetup(ReportName: Text; FieldId: Integer): Guid
+ var
+ PowerBiReportsSetup: Record "PowerBI Reports Setup";
+ AssistedSetup: Page "Assisted Setup";
+
+ RecRef: RecordRef;
+ FldRef: FieldRef;
+ FinanceAppNotSetupErr: Label 'Your %1 Report has not been setup in PowerBI Reports Setup. You need to set up this reports in order to view it.', Comment = '%1 = report name';
+ begin
+ if PowerBiReportsSetup.Get() then begin
+ RecRef.Get(PowerBiReportsSetup.RecordId());
+ FldRef := RecRef.Field(FieldId);
+ end;
+ if IsNullGuid(FldRef.Value()) then begin
+ if AssistedSetup.RunModal() = Action::OK then;
+ if PowerBiReportsSetup.Get() then begin
+ RecRef.Get(PowerBiReportsSetup.RecordId());
+ FldRef := RecRef.Field(FieldId);
+ end;
+ if IsNullGuid(FldRef.Value()) then
+ Error(FinanceAppNotSetupErr, ReportName);
+ end;
+ exit(FldRef.Value());
+ end;
+
+ procedure LookupPowerBIReport(var ReportId: Guid; var ReportName: Text[200]): Boolean
+ var
+ WorkspaceId: Guid;
+ WorkspaceName: Text[200];
+ begin
+ if LookupPowerBIWorkspace(WorkspaceId, WorkspaceName) then
+ if LookupPowerBIReport(WorkspaceId, WorkspaceName, ReportId, ReportName) then
+ exit(true);
+ end;
+
+ procedure LookupPowerBIReport(WorkspaceId: Guid; WorkspaceName: Text[200]; var ReportId: Guid; var ReportName: Text[200]): Boolean
+ var
+ TempPowerBISelectionElement: Record "Power BI Selection Element" temporary;
+ PowerBIWorkspaceMgt: Codeunit "Power BI Workspace Mgt.";
+ begin
+ PowerBIWorkspaceMgt.AddReportsForWorkspace(TempPowerBISelectionElement, WorkspaceId, WorkspaceName);
+ TempPowerBISelectionElement.SetRange(Type, TempPowerBISelectionElement.Type::Report);
+ if not IsNullGuid(ReportId) then begin
+ TempPowerBISelectionElement.SetRange(ID, ReportId);
+ if TempPowerBISelectionElement.FindFirst() then;
+ TempPowerBISelectionElement.SetRange(ID);
+ end;
+ if Page.RunModal(Page::"Power BI Selection Lookup", TempPowerBISelectionElement) = Action::LookupOK then begin
+ ReportId := TempPowerBISelectionElement.ID;
+ ReportName := TempPowerBISelectionElement.Name;
+ exit(true);
+ end;
+ end;
+
+ procedure LookupPowerBIWorkspace(var WorkspaceId: Guid; var WorkspaceName: Text[200]): Boolean
+ var
+ TempPowerBISelectionElement: Record "Power BI Selection Element" temporary;
+ PowerBIWorkspaceMgt: Codeunit "Power BI Workspace Mgt.";
+ begin
+ PowerBIWorkspaceMgt.AddSharedWorkspaces(TempPowerBISelectionElement);
+ TempPowerBISelectionElement.SetRange(Type, TempPowerBISelectionElement.Type::Workspace);
+ if not IsNullGuid(WorkspaceId) then begin
+ TempPowerBISelectionElement.SetRange(ID, WorkspaceId);
+ if TempPowerBISelectionElement.FindFirst() then;
+ TempPowerBISelectionElement.SetRange(ID);
+ end;
+ if Page.RunModal(Page::"Power BI Selection Lookup", TempPowerBISelectionElement) = Action::LookupOK then begin
+ WorkspaceId := TempPowerBISelectionElement.ID;
+ WorkspaceName := TempPowerBISelectionElement.Name;
+ exit(true);
+ end;
+ end;
+
+ procedure InitializeEmbeddedAddin(PowerBIManagement: ControlAddIn PowerBIManagement; ReportId: Guid; ReportPageTok: Text)
+ var
+ PowerBIServiceMgt: Codeunit "Power BI Service Mgt.";
+ TypeHelper: Codeunit "Type Helper";
+ PowerBIEmbedReportUrlTemplateTxt: Label 'https://app.powerbi.com/reportEmbed?reportId=%1', Locked = true;
+ begin
+ PowerBiServiceMgt.InitializeAddinToken(PowerBIManagement);
+ PowerBIManagement.SetLocale(TypeHelper.GetCultureName());
+ PowerBIManagement.SetSettings(false, true, false, false, false, false, true);
+ PowerBIManagement.EmbedPowerBIReport(
+ StrSubstNo(PowerBIEmbedReportUrlTemplateTxt, ReportId),
+ ReportId,
+ ReportPageTok);
+ end;
+
+ procedure ShowPowerBIErrorNotification(ErrorCategory: Text; ErrorMessage: Text)
+ var
+ PowerBIContextSettings: Record "Power BI Context Settings";
+ NotificationLifecycleMgt: Codeunit "Notification Lifecycle Mgt.";
+ Notify: Notification;
+ ErrorNotificationMsg: Label 'An error occurred while loading Power BI. Your Power BI embedded content might not work. Here are the error details: "%1: %2"', Comment = '%1: a short error code. %2: a verbose error message in english';
+ begin
+ Notify.Id := CreateGuid();
+ Notify.Message(StrSubstNo(ErrorNotificationMsg, ErrorCategory, ErrorMessage));
+ Notify.Scope := NotificationScope::LocalScope;
+ NotificationLifecycleMgt.SendNotification(Notify, PowerBIContextSettings.RecordId());
+ end;
+}
\ No newline at end of file
diff --git a/Apps/W1/PowerBIReports/app/src/Core/Pages/API/GeneralLedgerSetup.Page.al b/Apps/W1/PowerBIReports/app/src/Core/Pages/API/GeneralLedgerSetup.Page.al
index 790a61941a..7d68d639e7 100644
--- a/Apps/W1/PowerBIReports/app/src/Core/Pages/API/GeneralLedgerSetup.Page.al
+++ b/Apps/W1/PowerBIReports/app/src/Core/Pages/API/GeneralLedgerSetup.Page.al
@@ -55,6 +55,10 @@ page 36956 "General Ledger Setup"
field(shortcutDimension8Code; Rec."Shortcut Dimension 8 Code")
{
+ }
+ field(localCurrencyCode; Rec."LCY Code")
+ {
+
}
}
}
diff --git a/Apps/W1/PowerBIReports/app/src/Core/Pages/AssistedSetup.Page.al b/Apps/W1/PowerBIReports/app/src/Core/Pages/AssistedSetup.Page.al
index e30b76ca42..f056e292bc 100644
--- a/Apps/W1/PowerBIReports/app/src/Core/Pages/AssistedSetup.Page.al
+++ b/Apps/W1/PowerBIReports/app/src/Core/Pages/AssistedSetup.Page.al
@@ -12,8 +12,6 @@ page 36950 "Assisted Setup"
// IMPORTANT: do not change the caption - see slice 546954
Caption = 'Assisted Setup', Comment = 'IMPORTANT: Use the same translation as in System App''s page "Assisted Setup" id: "Page 799089619 - Property 2879900210"';
SourceTable = "PowerBI Reports Setup";
- ApplicationArea = All;
- UsageCategory = Tasks;
Extensible = false;
layout
@@ -212,15 +210,49 @@ page 36950 "Assisted Setup"
group(Step5)
{
Visible = CurrentStep = Steps::Setting;
+#if not CLEAN25
group(Settings)
{
- Caption = 'Connector Settings';
- InstructionalText = 'Configure connector specific settings.';
+ ObsoleteState = Pending;
+ ObsoleteReason = 'This group is no longer used.';
+ ObsoleteTag = '25.0';
+ }
+#endif
+ group(FinanceReportSetup)
+ {
+ Caption = 'Finance';
+ InstructionalText = 'Configure the Power BI Finance App.';
+ field("Finance Report Name"; Rec."Finance Report Name")
+ {
+ Caption = 'Power BI Finance Report';
+ ToolTip = 'Specifies the Power BI Finance Report.';
+ ApplicationArea = All;
+ Editable = false;
- group(FinanceReportSetup)
+ trigger OnAssistEdit()
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ SetupHelper.LookupPowerBIReport(Rec."Finance Report ID", Rec."Finance Report Name");
+ end;
+ }
+ group(FinanceShowMoreGroup)
{
- Caption = 'Finance Connector for Power BI';
- InstructionalText = 'Filter tables used in the Finance Dataset';
+ ShowCaption = false;
+ Visible = not FinanceTabVisible;
+ field(FinanceShowMore; ShowMoreTxt)
+ {
+ ApplicationArea = All;
+ ShowCaption = false;
+ trigger OnDrillDown()
+ begin
+ FinanceTabVisible := not FinanceTabVisible;
+ end;
+ }
+ }
+ group(FinanceFastTab)
+ {
+ ShowCaption = false;
+ Visible = FinanceTabVisible;
group(IncomeStatementFilters)
{
@@ -273,16 +305,57 @@ page 36950 "Assisted Setup"
ToolTip = 'Specifies the end date for the Vendor Ledger Entries filter.';
}
}
+ field(FinanceShowLess; ShowLessTxt)
+ {
+ ApplicationArea = All;
+ ShowCaption = false;
+ trigger OnDrillDown()
+ begin
+ FinanceTabVisible := not FinanceTabVisible;
+ end;
+ }
}
- group(ItemSalesReportSetup)
+ }
+
+ group(ItemSalesReportSetup)
+ {
+ Caption = 'Sales';
+ InstructionalText = 'Configure the Power BI Sales App.';
+ field("Sales Report Name"; Rec."Sales Report Name")
+ {
+ Caption = 'Power BI Sales Report';
+ ToolTip = 'Specifies the Power BI Sales Report.';
+ ApplicationArea = All;
+ Editable = false;
+ trigger OnAssistEdit()
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ SetupHelper.LookupPowerBIReport(Rec."Sales Report ID", Rec."Sales Report Name");
+ end;
+ }
+ group(SalesShowMoreGroup)
{
- Caption = 'Sales Connector for Power BI';
+ ShowCaption = false;
+ Visible = not SalesTabVisible;
+ field(SalesShowMore; ShowMoreTxt)
+ {
+ ApplicationArea = All;
+ ShowCaption = false;
+ trigger OnDrillDown()
+ begin
+ SalesTabVisible := not SalesTabVisible;
+ end;
+ }
+ }
+ group(SalesFastTab)
+ {
+ ShowCaption = false;
+ Visible = SalesTabVisible;
group(SalesDataFiltering)
{
ShowCaption = false;
InstructionalText = 'Configure the volume of data that is sent to your Power BI semantic models (optional).';
-
field(ItmSlsRepLoadDateType; Rec."Item Sales Load Date Type")
{
ApplicationArea = All;
@@ -304,16 +377,56 @@ page 36950 "Assisted Setup"
ToolTip = 'Specifies the date formula for Item Sales report filter.';
}
}
+ field(SalesShowLess; ShowLessTxt)
+ {
+ ApplicationArea = All;
+ ShowCaption = false;
+ trigger OnDrillDown()
+ begin
+ SalesTabVisible := not SalesTabVisible;
+ end;
+ }
}
+ }
- group(ItemPurchReportSetup)
+ group(ItemPurchReportSetup)
+ {
+ Caption = 'Purchases';
+ InstructionalText = 'Configure the Power BI Purchases App.';
+ field("Purchases Report Name"; Rec."Purchases Report Name")
{
- Caption = 'Purchasing Connector for Power BI';
+ Caption = 'Power BI Purchases Report';
+ ToolTip = 'Specifies the Power BI Purchases Report.';
+ ApplicationArea = All;
+ Editable = false;
+ trigger OnAssistEdit()
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ SetupHelper.LookupPowerBIReport(Rec."Purchases Report ID", Rec."Purchases Report Name");
+ end;
+ }
+ group(PurchShowMoreGroup)
+ {
+ ShowCaption = false;
+ Visible = not PurchasesTabVisible;
+ field(PurchShowMore; ShowMoreTxt)
+ {
+ ApplicationArea = All;
+ ShowCaption = false;
+ trigger OnDrillDown()
+ begin
+ PurchasesTabVisible := not PurchasesTabVisible;
+ end;
+ }
+ }
+ group(PurchFastTab)
+ {
+ ShowCaption = false;
+ Visible = PurchasesTabVisible;
group(PurchDataFiltering)
{
ShowCaption = false;
InstructionalText = 'Configure the volume of data that is sent to your Power BI semantic models (optional).';
-
field(ItmPchRepLoadDateType; Rec."Item Purch. Load Date Type")
{
ApplicationArea = All;
@@ -335,13 +448,82 @@ page 36950 "Assisted Setup"
ToolTip = 'Specifies the date formula for Item Purchases report filter.';
}
}
+ field(PurchShowLess; ShowLessTxt)
+ {
+ ApplicationArea = All;
+ ShowCaption = false;
+ trigger OnDrillDown()
+ begin
+ PurchasesTabVisible := not PurchasesTabVisible;
+ end;
+ }
}
+ }
- group(JobsReportSetup)
+ group(InventoryReportSetup)
+ {
+ Caption = 'Inventory';
+ InstructionalText = 'Configure the Power BI Inventory App.';
+ field("Inventory Report Name"; Rec."Inventory Report Name")
{
- Caption = 'Jobs Connector for Power BI';
- InstructionalText = 'Configure the volume of data that is sent to your Power BI semantic models';
+ Caption = 'Power BI Inventory Report';
+ ToolTip = 'Specifies the Power BI Inventory Report.';
+ ApplicationArea = All;
+ Editable = false;
+ trigger OnAssistEdit()
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ SetupHelper.LookupPowerBIReport(Rec."Inventory Report ID", Rec."Inventory Report Name");
+ end;
+ }
+ field("Inventory Val. Report Name"; Rec."Inventory Val. Report Name")
+ {
+ Caption = 'Power BI Inventory Valuation Name';
+ ToolTip = 'Specifies the Power BI Inventory Valuation Report.';
+ ApplicationArea = All;
+ Editable = false;
+ trigger OnAssistEdit()
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ SetupHelper.LookupPowerBIReport(Rec."Inventory Val. Report ID", Rec."Inventory Val. Report Name");
+ end;
+ }
+ }
+ group(JobsReportSetup)
+ {
+ Caption = 'Projects';
+ InstructionalText = 'Configure the Power BI Projects App.';
+ field("Projects Report Name"; Rec."Projects Report Name")
+ {
+ Caption = 'Power BI Projects Report';
+ ToolTip = 'Specifies the Power BI Projects Report.';
+ ApplicationArea = All;
+ Editable = false;
+ trigger OnAssistEdit()
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ SetupHelper.LookupPowerBIReport(Rec."Projects Report Id", Rec."Projects Report Name");
+ end;
+ }
+ group(ProjectsShowMoreGroup)
+ {
+ ShowCaption = false;
+ Visible = not ProjectTabVisible;
+ field(ProjectsShowMore; ShowMoreTxt)
+ {
+ ApplicationArea = All;
+ ShowCaption = false;
+ trigger OnDrillDown()
+ begin
+ ProjectTabVisible := not ProjectTabVisible;
+ end;
+ }
+ }
+ group(ProjectsFastTab)
+ {
+ ShowCaption = false;
+ Visible = ProjectTabVisible;
group(JobLedgerFilters)
{
Caption = 'Job Ledger Entry Filters';
@@ -359,32 +541,85 @@ page 36950 "Assisted Setup"
ToolTip = 'Specifies the end date for Job Ledger Entries Entries filter.';
}
}
- }
-
- group(ManufacturingReportSetup)
- {
- Caption = 'Manufacturing Connector for Power BI';
- InstructionalText = 'Configure the volume of data that is sent to your Power BI semantic models';
-
- field(ManuRepLoadDateType; Rec."Manufacturing Load Date Type")
+ field(ProjectsShowLess; ShowLessTxt)
{
ApplicationArea = All;
- ToolTip = 'Specifies the date type for Manufacturing report filter.';
+ ShowCaption = false;
+ trigger OnDrillDown()
+ begin
+ ProjectTabVisible := not ProjectTabVisible;
+ end;
}
- field(ManuRepStartDate; Rec."Manufacturing Start Date")
+ }
+ }
+
+ group(ManufacturingReportSetup)
+ {
+ Caption = 'Manufacturing';
+ InstructionalText = 'Configure the Power BI Manufacturing App.';
+ field("Manufacturing Report Name"; Rec."Manufacturing Report Name")
+ {
+ Caption = 'Power BI Manufacturing Report';
+ ToolTip = 'Specifies the Power BI Manufacturing Report.';
+ ApplicationArea = All;
+ Editable = false;
+ trigger OnAssistEdit()
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ SetupHelper.LookupPowerBIReport(Rec."Manufacturing Report ID", Rec."Manufacturing Report Name");
+ end;
+ }
+ group(ManuShowMoreGroup)
+ {
+ ShowCaption = false;
+ Visible = not ManufacturingTabVisible;
+ field(ManuShowMore; ShowMoreTxt)
{
ApplicationArea = All;
- ToolTip = 'Specifies the start date for Manufacturing report filter.';
+ ShowCaption = false;
+ trigger OnDrillDown()
+ begin
+ ManufacturingTabVisible := not ManufacturingTabVisible;
+ end;
}
- field(ManuRepEndDate; Rec."Manufacturing End Date")
+ }
+ group(ManuFastTab)
+ {
+ ShowCaption = false;
+ Visible = ManufacturingTabVisible;
+ group(ManufacturingRecordFilters)
{
- ApplicationArea = All;
- ToolTip = 'Specifies the end date for Manufacturing report filter.';
+ Caption = 'Manufacturing Document and Entry Filters';
+ InstructionalText = 'Filters Manufacturing Data';
+ field(ManuRepLoadDateType; Rec."Manufacturing Load Date Type")
+ {
+ ApplicationArea = All;
+ ToolTip = 'Specifies the date type for Manufacturing report filter.';
+ }
+ field(ManuRepStartDate; Rec."Manufacturing Start Date")
+ {
+ ApplicationArea = All;
+ ToolTip = 'Specifies the start date for Manufacturing report filter.';
+ }
+ field(ManuRepEndDate; Rec."Manufacturing End Date")
+ {
+ ApplicationArea = All;
+ ToolTip = 'Specifies the end date for Manufacturing report filter.';
+ }
+ field(ManuRepDateFormula; Rec."Manufacturing Date Formula")
+ {
+ ApplicationArea = All;
+ ToolTip = 'Specifies the date formula for Manufacturing report filter.';
+ }
}
- field(ManuRepDateFormula; Rec."Manufacturing Date Formula")
+ field(ManuShowLess; ShowLessTxt)
{
ApplicationArea = All;
- ToolTip = 'Specifies the date formula for Manufacturing report filter.';
+ ShowCaption = false;
+ trigger OnDrillDown()
+ begin
+ ManufacturingTabVisible := not ManufacturingTabVisible;
+ end;
}
}
}
@@ -493,7 +728,7 @@ page 36950 "Assisted Setup"
GuidedExperience: Codeunit "Guided Experience";
TimeZoneSelection: Codeunit "Time Zone Selection";
EnvironmentInformation: Codeunit "Environment Information";
-
+ SetupHelper: Codeunit "Setup Helper";
Steps: Option Intro,DateTableConfig,UTCOffset,WorkingDays,Setting,Finish;
PrevStep: Option;
CurrentStep: Option;
@@ -507,10 +742,17 @@ page 36950 "Assisted Setup"
AssistedSetupComplete: Boolean;
ViewDeveloperDocLbl: Label 'Power BI Documentation';
DevDocUrlTxt: Label 'https://learn.microsoft.com/en-au/dynamics365/business-central/admin-powerbi#get-ready-to-use-power-bi', Locked = true;
- CalendarType: Option ,Standard,Fiscal,Weekly;
+ CalendarType: Option ,Fiscal,Standard,Weekly;
StandardCalendarVisible: Boolean;
FiscalCalendarVisible: Boolean;
WeeklyCalendarVisible: Boolean;
+ FinanceTabVisible: Boolean;
+ SalesTabVisible: Boolean;
+ PurchasesTabVisible: Boolean;
+ ProjectTabVisible: Boolean;
+ ManufacturingTabVisible: Boolean;
+ ShowMoreTxt: Label 'Show More';
+ ShowLessTxt: Label 'Show Less';
trigger OnOpenPage()
var
@@ -526,6 +768,15 @@ page 36950 "Assisted Setup"
if UserSetup.Get(UserId()) then
TestEmailAddress := UserSetup."E-Mail";
+ case Rec."Calendar Range" of
+ Rec."Calendar Range"::Calendar:
+ CalendarType := CalendarType::Standard;
+ Rec."Calendar Range"::FiscalGregorian:
+ CalendarType := CalendarType::Fiscal;
+ Rec."Calendar Range"::FiscalWeekly:
+ CalendarType := CalendarType::Weekly;
+ end;
+
LoadTopBanners();
TakeStep(0);
end;
@@ -534,7 +785,6 @@ page 36950 "Assisted Setup"
begin
case CurrentStep of
Steps::UTCOffset:
-
Rec.TestField("Time Zone");
end;
@@ -551,7 +801,6 @@ page 36950 "Assisted Setup"
NextEnabled := true;
end;
Steps::DateTableConfig:
-
if CalendarType > 0 then
NextEnabled := true;
Steps::UTCOffset:
@@ -587,10 +836,9 @@ page 36950 "Assisted Setup"
end;
local procedure OnUpdateCalendarSelection()
- var
begin
case CalendarType of
- 1:
+ CalendarType::Standard:
begin
StandardCalendarVisible := true;
FiscalCalendarVisible := false;
@@ -598,7 +846,7 @@ page 36950 "Assisted Setup"
Rec."Calendar Range" := Rec."Calendar Range"::Calendar;
TakeStep(0);
end;
- 2:
+ CalendarType::Fiscal:
begin
FiscalCalendarVisible := true;
StandardCalendarVisible := false;
@@ -606,7 +854,7 @@ page 36950 "Assisted Setup"
Rec."Calendar Range" := Rec."Calendar Range"::FiscalGregorian;
TakeStep(0);
end;
- 3:
+ CalendarType::Weekly:
begin
WeeklyCalendarVisible := true;
FiscalCalendarVisible := false;
diff --git a/Apps/W1/PowerBIReports/app/src/Core/Pages/PowerBIReportsSetup.Page.al b/Apps/W1/PowerBIReports/app/src/Core/Pages/PowerBIReportsSetup.Page.al
index d89d33c7fe..25687999ba 100644
--- a/Apps/W1/PowerBIReports/app/src/Core/Pages/PowerBIReportsSetup.Page.al
+++ b/Apps/W1/PowerBIReports/app/src/Core/Pages/PowerBIReportsSetup.Page.al
@@ -16,180 +16,33 @@ page 36951 "PowerBI Reports Setup"
{
area(Content)
{
- group(FinanceReport)
- {
- Caption = 'Finance Report';
- group(IncomeStatementFilters)
- {
- Caption = 'Income Statement & G/L Budget Entry Filters';
- field("Finance Start Date"; Rec."Finance Start Date")
- {
- Caption = 'Start Date';
- ApplicationArea = All;
- ToolTip = 'Specifies the start date for Income Statement and G/L Budget Entries filter.';
- }
- field("Finance End Date"; Rec."Finance End Date")
- {
- Caption = 'End Date';
- ApplicationArea = All;
- ToolTip = 'Specifies the end date for Income Statement and G/L Budget Entries filter.';
- }
- }
- group(CustomerLedgerFilters)
- {
- Caption = 'Customer Ledger Entry Filters';
-
- field("Cust. Ledger Entry Start Date"; Rec."Cust. Ledger Entry Start Date")
- {
- Caption = 'Start Date';
- ApplicationArea = All;
- ToolTip = 'Specifies the start date for the Customer Ledger Entries filter.';
- }
- field("Cust. Ledger Entry End Date"; Rec."Cust. Ledger Entry End Date")
- {
- Caption = 'End Date';
- ApplicationArea = All;
- ToolTip = 'Specifies the end date for the Customer Ledger Entries filter.';
- }
- }
- group(VendorLedgerFilters)
- {
- Caption = 'Vendor Ledger Entry Filters';
-
- field("Vend. Ledger Entry Start Date"; Rec."Vend. Ledger Entry Start Date")
- {
- Caption = 'Start Date';
- ApplicationArea = All;
- ToolTip = 'Specifies the start date for the Vendor Ledger Entries filter.';
- }
- field("Vend. Ledger Entry End Date"; Rec."Vend. Ledger Entry End Date")
- {
- Caption = 'End Date';
- ApplicationArea = All;
- ToolTip = 'Specifies the end date for the Vendor Ledger Entries filter.';
- }
- }
- }
-
- group(ItemSalesReport)
- {
- Caption = 'Item Sales Report';
- field("Item Sales Load Date Type"; Rec."Item Sales Load Date Type")
- {
- ApplicationArea = All;
- ToolTip = 'Specifies the date type for Item Sales report filter.';
- }
- field("Item Sales Start Date"; Rec."Item Sales Start Date")
- {
- ApplicationArea = All;
- ToolTip = 'Specifies the start date for Item Sales report filter.';
- }
- field("Item Sales End Date"; Rec."Item Sales End Date")
- {
- ApplicationArea = All;
- ToolTip = 'Specifies the end date for Item Sales report filter.';
- }
- field("Item Sales Date Formula"; Rec."Item Sales Date Formula")
- {
- ApplicationArea = All;
- ToolTip = 'Specifies the date formula for Item Sales report filter.';
- }
- }
-
- group(ItemPurchasesReport)
+ group(ConnectionDetails)
{
- Caption = 'Item Purchases Report';
-
- field("Item Purch. Load Date Type"; Rec."Item Purch. Load Date Type")
- {
- ApplicationArea = All;
- ToolTip = 'Specifies the date type for Item Purchases report filter.';
- }
- field("Item Purch. Start Date"; Rec."Item Purch. Start Date")
- {
- ApplicationArea = All;
- ToolTip = 'Specifies the start date for Item Purchases report filter.';
- }
- field("Item Purch. End Date"; Rec."Item Purch. End Date")
- {
- ApplicationArea = All;
- ToolTip = 'Specifies the end date for Item Purchases report filter.';
- }
- field("Item Purch. Date Formula"; Rec."Item Purch. Date Formula")
- {
- ApplicationArea = All;
- ToolTip = 'Specifies the date formula for Item Purchases report filter.';
- }
- }
+ Caption = 'Connection Details';
- group(JobsReport)
- {
- Caption = 'Jobs Report';
- group(JobLedgerEntryFilters)
+ group(EnvironmentDetails)
{
- Caption = 'Job Ledger Entry Filters';
- field("Job Ledger Entry Start Date"; Rec."Job Ledger Entry Start Date")
+ ShowCaption = false;
+ field(Environment; Text.UpperCase(EnvironmentInformation.GetEnvironmentName()))
{
- Caption = 'Start Date';
ApplicationArea = All;
- ToolTip = 'Specifies the start date for Job Ledger Entries filter.';
+ Caption = 'Environment';
+ ToolTip = 'Specifies the environment used to connect Business Central to a Power BI semantic model.';
+ Editable = false;
+ MultiLine = false;
+ Style = Favorable;
}
- field("Job Ledger Entry End Date"; Rec."Job Ledger Entry End Date")
+ field(Company; CompanyName)
{
- Caption = 'End Date';
ApplicationArea = All;
- ToolTip = 'Specifies the end date for Job Ledger Entries filter.';
+ Caption = 'Company Name';
+ ToolTip = 'Specifies the company used to connect Business Central to a Power BI semantic model.';
+ Editable = false;
+ MultiLine = false;
+ Style = Favorable;
}
}
- }
-
- group(ManufacturingReport)
- {
- Caption = 'Manufacturing Report';
- field("Manufacturing Load Date Type"; Rec."Manufacturing Load Date Type")
- {
- ApplicationArea = All;
- ToolTip = 'Specifies the date type for Manufacturing report filter.';
- }
- field("Manufacturing Start Date"; Rec."Manufacturing Start Date")
- {
- ApplicationArea = All;
- ToolTip = 'Specifies the start date for Manufacturing report filter.';
- }
- field("Manufacturing End Date"; Rec."Manufacturing End Date")
- {
- ApplicationArea = All;
- ToolTip = 'Specifies the end date for Manufacturing report filter.';
- }
- field("Manufacturing Date Formula"; Rec."Manufacturing Date Formula")
- {
- ApplicationArea = All;
- ToolTip = 'Specifies the date formula for Manufacturing report filter.';
- }
- }
- group(ConnectionDetails)
- {
- Caption = 'Connection Details';
-
- field(Environment; Text.UpperCase(EnvironmentInformation.GetEnvironmentName()))
- {
- ApplicationArea = All;
- Caption = 'Environment';
- ToolTip = 'Specifies the environment used to connect Business Central to a Power BI semantic model.';
- Editable = false;
- MultiLine = false;
- Style = Favorable;
- }
- field(Company; CompanyName)
- {
- ApplicationArea = All;
- Caption = 'Company Name';
- ToolTip = 'Specifies the company used to connect Business Central to a Power BI semantic model.';
- Editable = false;
- MultiLine = false;
- Style = Favorable;
- }
field(ViewDeveloperDoc; ViewDeveloperDocLbl)
{
ApplicationArea = All;
@@ -202,6 +55,7 @@ page 36951 "PowerBI Reports Setup"
end;
}
}
+
group(DateSetup)
{
Caption = 'Date Table Configuration';
@@ -333,6 +187,271 @@ page 36951 "PowerBI Reports Setup"
}
}
}
+
+ group(FinanceReport)
+ {
+ Caption = 'Finance Report';
+ group(FinanceGeneral)
+ {
+ ShowCaption = false;
+ field("Finance Report Name"; Format(Rec."Finance Report Name"))
+ {
+ ApplicationArea = All;
+ Caption = 'Power BI Finance Report';
+ ToolTip = 'Specifies the Finance Report Name from the Finance App.';
+
+ trigger OnAssistEdit()
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ SetupHelper.LookupPowerBIReport(Rec."Finance Report ID", Rec."Finance Report Name");
+ end;
+ }
+ }
+ group(IncomeStatementFilters)
+ {
+ Caption = 'Income Statement & G/L Budget Entry Filters';
+ field("Finance Start Date"; Rec."Finance Start Date")
+ {
+ Caption = 'Start Date';
+ ApplicationArea = All;
+ ToolTip = 'Specifies the start date for Income Statement and G/L Budget Entries filter.';
+ }
+ field("Finance End Date"; Rec."Finance End Date")
+ {
+ Caption = 'End Date';
+ ApplicationArea = All;
+ ToolTip = 'Specifies the end date for Income Statement and G/L Budget Entries filter.';
+ }
+ }
+ group(CustomerLedgerFilters)
+ {
+ Caption = 'Customer Ledger Entry Filters';
+
+ field("Cust. Ledger Entry Start Date"; Rec."Cust. Ledger Entry Start Date")
+ {
+ Caption = 'Start Date';
+ ApplicationArea = All;
+ ToolTip = 'Specifies the start date for the Customer Ledger Entries filter.';
+ }
+ field("Cust. Ledger Entry End Date"; Rec."Cust. Ledger Entry End Date")
+ {
+ Caption = 'End Date';
+ ApplicationArea = All;
+ ToolTip = 'Specifies the end date for the Customer Ledger Entries filter.';
+ }
+ }
+ group(VendorLedgerFilters)
+ {
+ Caption = 'Vendor Ledger Entry Filters';
+
+ field("Vend. Ledger Entry Start Date"; Rec."Vend. Ledger Entry Start Date")
+ {
+ Caption = 'Start Date';
+ ApplicationArea = All;
+ ToolTip = 'Specifies the start date for the Vendor Ledger Entries filter.';
+ }
+ field("Vend. Ledger Entry End Date"; Rec."Vend. Ledger Entry End Date")
+ {
+ Caption = 'End Date';
+ ApplicationArea = All;
+ ToolTip = 'Specifies the end date for the Vendor Ledger Entries filter.';
+ }
+ }
+ }
+
+ group(ItemSalesReport)
+ {
+ Caption = 'Sales Report';
+ group(SalesGeneral)
+ {
+ ShowCaption = false;
+ field("Sales Report Name"; Format(Rec."Sales Report Name"))
+ {
+ ApplicationArea = All;
+ Caption = 'Power BI Sales';
+ ToolTip = 'Specifies the Sales Report Name from the Sales App.';
+
+ trigger OnAssistEdit()
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ SetupHelper.LookupPowerBIReport(Rec."Sales Report ID", Rec."Sales Report Name");
+ end;
+ }
+ }
+ field("Item Sales Load Date Type"; Rec."Item Sales Load Date Type")
+ {
+ ApplicationArea = All;
+ ToolTip = 'Specifies the date type for Item Sales report filter.';
+ }
+ field("Item Sales Start Date"; Rec."Item Sales Start Date")
+ {
+ ApplicationArea = All;
+ ToolTip = 'Specifies the start date for Item Sales report filter.';
+ }
+ field("Item Sales End Date"; Rec."Item Sales End Date")
+ {
+ ApplicationArea = All;
+ ToolTip = 'Specifies the end date for Item Sales report filter.';
+ }
+ field("Item Sales Date Formula"; Rec."Item Sales Date Formula")
+ {
+ ApplicationArea = All;
+ ToolTip = 'Specifies the date formula for Item Sales report filter.';
+ }
+ }
+
+ group(ItemPurchasesReport)
+ {
+ Caption = 'Purchases Report';
+ group(PurchasesGeneral)
+ {
+ ShowCaption = false;
+ field("Purchases Report Name"; Format(Rec."Purchases Report Name"))
+ {
+ ApplicationArea = All;
+ Caption = 'Power BI Purchases';
+ ToolTip = 'Specifies the Purchases Report Name from the Purchases App.';
+
+ trigger OnAssistEdit()
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ SetupHelper.LookupPowerBIReport(Rec."Purchases Report ID", Rec."Purchases Report Name");
+ end;
+ }
+ }
+ field("Item Purch. Load Date Type"; Rec."Item Purch. Load Date Type")
+ {
+ ApplicationArea = All;
+ ToolTip = 'Specifies the date type for Item Purchases report filter.';
+ }
+ field("Item Purch. Start Date"; Rec."Item Purch. Start Date")
+ {
+ ApplicationArea = All;
+ ToolTip = 'Specifies the start date for Item Purchases report filter.';
+ }
+ field("Item Purch. End Date"; Rec."Item Purch. End Date")
+ {
+ ApplicationArea = All;
+ ToolTip = 'Specifies the end date for Item Purchases report filter.';
+ }
+ field("Item Purch. Date Formula"; Rec."Item Purch. Date Formula")
+ {
+ ApplicationArea = All;
+ ToolTip = 'Specifies the date formula for Item Purchases report filter.';
+ }
+ }
+
+ group(InventoryReport)
+ {
+ Caption = 'Inventory Report';
+ group(InventoryGeneral)
+ {
+ ShowCaption = false;
+ field("Inventory Report Name"; Format(Rec."Inventory Report Name"))
+ {
+ ApplicationArea = All;
+ Caption = 'Power BI Inventory Report';
+ ToolTip = 'Specifies the Inventory Report Name from the Inventory App.';
+
+ trigger OnAssistEdit()
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ SetupHelper.LookupPowerBIReport(Rec."Inventory Report ID", Rec."Inventory Report Name");
+ end;
+ }
+ field("Inventory Val. Report Name"; Format(Rec."Inventory Val. Report Name"))
+ {
+ ApplicationArea = All;
+ Caption = 'Power BI Inventory Valuation Report';
+ ToolTip = 'Specifies the Inventory Report Name from the Inventory Valuation App.';
+
+ trigger OnAssistEdit()
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ SetupHelper.LookupPowerBIReport(Rec."Inventory Val. Report ID", Rec."Inventory Val. Report Name");
+ end;
+ }
+ }
+ }
+
+ group(JobsReport)
+ {
+ Caption = 'Projects Report';
+ group(ProjectsGeneral)
+ {
+ ShowCaption = false;
+ field("Projects Report Name"; Format(Rec."Projects Report Name"))
+ {
+ ApplicationArea = All;
+ Caption = 'Power BI Projects Report';
+ ToolTip = 'Specifies the Projects Report Name from the Projects App.';
+
+ trigger OnAssistEdit()
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ SetupHelper.LookupPowerBIReport(Rec."Projects Report ID", Rec."Projects Report Name");
+ end;
+ }
+ }
+ group(ProjectsLedgerEntryFilters)
+ {
+ Caption = 'Projects Ledger Entry Filters';
+ field("Job Ledger Entry Start Date"; Rec."Job Ledger Entry Start Date")
+ {
+ Caption = 'Start Date';
+ ApplicationArea = All;
+ ToolTip = 'Specifies the start date for Projects Ledger Entries filter.';
+ }
+ field("Job Ledger Entry End Date"; Rec."Job Ledger Entry End Date")
+ {
+ Caption = 'End Date';
+ ApplicationArea = All;
+ ToolTip = 'Specifies the end date for Projects Ledger Entries filter.';
+ }
+ }
+ }
+
+ group(ManufacturingReport)
+ {
+ Caption = 'Manufacturing Report';
+ group(ManufacturingGeneral)
+ {
+ ShowCaption = false;
+ field("Manufacturing Report Name"; Format(Rec."Manufacturing Report Name"))
+ {
+ ApplicationArea = All;
+ Caption = 'Power BI Manufacturing Report';
+ ToolTip = 'Specifies the Manufacturing Report Name from the Manufacturing App.';
+
+ trigger OnAssistEdit()
+ begin
+ SetupHelper.EnsureUserAcceptedPowerBITerms();
+ SetupHelper.LookupPowerBIReport(Rec."Manufacturing Report ID", Rec."Manufacturing Report Name");
+ end;
+ }
+ }
+ field("Manufacturing Load Date Type"; Rec."Manufacturing Load Date Type")
+ {
+ ApplicationArea = All;
+ ToolTip = 'Specifies the date type for Manufacturing report filter.';
+ }
+ field("Manufacturing Start Date"; Rec."Manufacturing Start Date")
+ {
+ ApplicationArea = All;
+ ToolTip = 'Specifies the start date for Manufacturing report filter.';
+ }
+ field("Manufacturing End Date"; Rec."Manufacturing End Date")
+ {
+ ApplicationArea = All;
+ ToolTip = 'Specifies the end date for Manufacturing report filter.';
+ }
+ field("Manufacturing Date Formula"; Rec."Manufacturing Date Formula")
+ {
+ ApplicationArea = All;
+ ToolTip = 'Specifies the date formula for Manufacturing report filter.';
+ }
+ }
+
group(Dimensions)
{
Caption = 'Dimensions';
@@ -352,15 +471,17 @@ page 36951 "PowerBI Reports Setup"
action(InsertJobQueue)
{
ApplicationArea = All;
- Caption = 'Insert Job Queue Entry';
- ToolTip = 'Inserts the required job queue entry for automatically updating Power BI Dimension Set Entries in the background.';
+ Caption = 'Schedule Power BI Dimension Refresh';
+ ToolTip = 'Create a job queue entry that will refresh Power BI Dimension Set Entries in the background. This is required for dimensions to be displayed in Power BI Reports.';
Image = Setup;
trigger OnAction()
var
JobQueueDescLbl: Label 'Update Power BI Dimension Set Entries';
+ JobQueueCreatedMsg: Label 'Job Queue Entry created successfully. You can view or edit this entry on the Job Queue Entries page.';
begin
PBIManagement.InitialiseJobQueue(Codeunit::"Update Dim. Set Entries", JobQueueDescLbl);
+ Message(JobQueueCreatedMsg);
end;
}
action(SetupWorkingDays)
@@ -437,6 +558,7 @@ page 36951 "PowerBI Reports Setup"
EnvironmentInformation: Codeunit "Environment Information";
PBIManagement: Codeunit Initialization;
TimeZoneSelection: Codeunit "Time Zone Selection";
+ SetupHelper: Codeunit "Setup Helper";
ViewDeveloperDocLbl: Label 'Power BI Documentation';
DevDocUrlTxt: Label 'https://learn.microsoft.com/en-au/dynamics365/business-central/admin-powerbi#get-ready-to-use-power-bi', Locked = true;
StandardCalendarVisible: Boolean;
diff --git a/Apps/W1/PowerBIReports/app/src/Core/Pages/PowerBISelectionLookup.Page.al b/Apps/W1/PowerBIReports/app/src/Core/Pages/PowerBISelectionLookup.Page.al
new file mode 100644
index 0000000000..b064c12be4
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Core/Pages/PowerBISelectionLookup.Page.al
@@ -0,0 +1,57 @@
+namespace Microsoft.PowerBIReports;
+
+using System.Integration.PowerBI;
+
+page 36963 "Power BI Selection Lookup"
+{
+ Caption = 'Select Power BI Element';
+ DeleteAllowed = false;
+ InsertAllowed = false;
+ LinksAllowed = false;
+ Editable = false;
+ PageType = List;
+ SourceTable = "Power BI Selection Element";
+ SourceTableTemporary = true;
+ Extensible = false;
+
+ layout
+ {
+ area(content)
+ {
+ repeater(ElementsRepeater)
+ {
+ field(Name; Rec.Name)
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Name';
+ Editable = false;
+ ToolTip = 'Specifies the name of the Power BI report or workspace.';
+ Style = Strong;
+ }
+ field(ID; Rec.ID)
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'ID';
+ Editable = false;
+ ToolTip = 'Specifies the ID of the Power BI report or workspace.';
+ }
+ field(Type; Rec.Type)
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Type';
+ Editable = false;
+ ToolTip = 'Specifies the type of the line (e.g. workspace or report).';
+ }
+ }
+ }
+ }
+
+ trigger OnOpenPage()
+ var
+ PowerBISelectionElement: Record "Power BI Selection Element";
+ SelectTxt: Label 'Select Power BI %1', Comment = '%1 = Type';
+ begin
+ if Evaluate(PowerBISelectionElement.Type, Rec.GetFilter(Type)) then
+ CurrPage.Caption := StrSubstNo(SelectTxt, PowerBISelectionElement.Type);
+ end;
+}
\ No newline at end of file
diff --git a/Apps/W1/PowerBIReports/app/src/Core/PermissionSets/D365BasicPowerBIReports.PermissionsetExt.al b/Apps/W1/PowerBIReports/app/src/Core/PermissionSets/D365BasicPowerBIReports.PermissionsetExt.al
index 6081bee695..3caab699cf 100644
--- a/Apps/W1/PowerBIReports/app/src/Core/PermissionSets/D365BasicPowerBIReports.PermissionsetExt.al
+++ b/Apps/W1/PowerBIReports/app/src/Core/PermissionSets/D365BasicPowerBIReports.PermissionsetExt.al
@@ -3,5 +3,7 @@ using System.Security.AccessControl;
permissionsetextension 36950 "D365 BASIC PowerBI Reports" extends "D365 BASIC"
{
- IncludedPermissionSets = "PowerBi Report Basic";
+ IncludedPermissionSets =
+ "PowerBi Report Basic",
+ "Power BI Embedded - Objects";
}
\ No newline at end of file
diff --git a/Apps/W1/PowerBIReports/app/src/Core/PermissionSets/PowerBiReportBasic.PermissionSet.al b/Apps/W1/PowerBIReports/app/src/Core/PermissionSets/PowerBiReportBasic.PermissionSet.al
index 4b5deb3f8d..0175fb165b 100644
--- a/Apps/W1/PowerBIReports/app/src/Core/PermissionSets/PowerBiReportBasic.PermissionSet.al
+++ b/Apps/W1/PowerBIReports/app/src/Core/PermissionSets/PowerBiReportBasic.PermissionSet.al
@@ -35,6 +35,7 @@ permissionset 36951 "PowerBi Report Basic"
page "Date Setup" = X,
page "General Ledger Setup" = X,
page Locations = X,
+ page "Power BI Selection Lookup" = X,
page "Purchasing Scorecard" = X,
page "Salesperson/Purchasers" = X,
page "PowerBI Reports Setup" = X,
diff --git a/Apps/W1/PowerBIReports/app/src/Core/Tables/PowerBIReportsSetup.Table.al b/Apps/W1/PowerBIReports/app/src/Core/Tables/PowerBIReportsSetup.Table.al
index b322af2d3b..c10ecfc87a 100644
--- a/Apps/W1/PowerBIReports/app/src/Core/Tables/PowerBIReportsSetup.Table.al
+++ b/Apps/W1/PowerBIReports/app/src/Core/Tables/PowerBIReportsSetup.Table.al
@@ -77,7 +77,7 @@ table 36951 "PowerBI Reports Setup"
Caption = 'Calendar Range';
OptionMembers = Calendar,FiscalGregorian,FiscalWeekly;
OptionCaption = 'Standard,Fiscal Calendar,Weekly';
- InitValue = "Calendar";
+ InitValue = FiscalGregorian;
DataClassification = CustomerContent;
// Defines to which type of calendar the year boundaries are applied during table’s generation.
// Using FiscalWeekly the first and last day of the year might not correspond to a first and last day of a month, respectively.
diff --git a/Apps/W1/PowerBIReports/app/src/Finance/Codeunits/FinanceInstallationHandler.Codeunit.al b/Apps/W1/PowerBIReports/app/src/Finance/Codeunits/FinanceInstallationHandler.Codeunit.al
index 1f20379166..93c775686b 100644
--- a/Apps/W1/PowerBIReports/app/src/Finance/Codeunits/FinanceInstallationHandler.Codeunit.al
+++ b/Apps/W1/PowerBIReports/app/src/Finance/Codeunits/FinanceInstallationHandler.Codeunit.al
@@ -1,4 +1,5 @@
namespace Microsoft.Finance.PowerBIReports;
+using Microsoft.Finance.GeneralLedger.Account;
using Microsoft.Foundation.Company;
@@ -6,6 +7,7 @@ codeunit 36953 "Finance Installation Handler"
{
Access = Internal;
Subtype = Install;
+ Permissions = tabledata "G/L Account Category" = r;
trigger OnInstallAppPerCompany()
var
@@ -28,42 +30,87 @@ codeunit 36953 "Finance Installation Handler"
PowerBIAccountCategory: Record "Account Category";
begin
if PowerBIAccountCategory.IsEmpty() then begin
- InsertPowerBIAccountCategory(Enum::"Account Category Type"::L1Assets);
- InsertPowerBIAccountCategory(Enum::"Account Category Type"::L1Liabilities);
- InsertPowerBIAccountCategory(Enum::"Account Category Type"::L1Equity);
- InsertPowerBIAccountCategory(Enum::"Account Category Type"::L1Revenue);
- InsertPowerBIAccountCategory(Enum::"Account Category Type"::L1CostOfGoodsSold);
- InsertPowerBIAccountCategory(Enum::"Account Category Type"::L1Expense);
- InsertPowerBIAccountCategory(Enum::"Account Category Type"::L2CurrentAssets);
- InsertPowerBIAccountCategory(Enum::"Account Category Type"::L2CurrentLiabilities);
- InsertPowerBIAccountCategory(Enum::"Account Category Type"::L2PayrollLiabilities);
- InsertPowerBIAccountCategory(Enum::"Account Category Type"::L2LongTermLiabilities);
- InsertPowerBIAccountCategory(Enum::"Account Category Type"::L2ShareholdersEquity);
- InsertPowerBIAccountCategory(Enum::"Account Category Type"::L3Inventory);
- InsertPowerBIAccountCategory(Enum::"Account Category Type"::L2InterestExpense);
- InsertPowerBIAccountCategory(Enum::"Account Category Type"::L2TaxExpense);
- InsertPowerBIAccountCategory(Enum::"Account Category Type"::L2ExtraordinaryExpense);
- InsertPowerBIAccountCategory(Enum::"Account Category Type"::L3AccountsPayable);
- InsertPowerBIAccountCategory(Enum::"Account Category Type"::L3AccountsReceivable);
- InsertPowerBIAccountCategory(Enum::"Account Category Type"::L3Purchases);
- InsertPowerBIAccountCategory(Enum::"Account Category Type"::L2FXLossesExpense);
- InsertPowerBIAccountCategory(Enum::"Account Category Type"::L2DepreciationAmortizationExpense);
- InsertPowerBIAccountCategory(Enum::"Account Category Type"::L2InterestRevenue);
- InsertPowerBIAccountCategory(Enum::"Account Category Type"::L2FXGainsIncome);
- InsertPowerBIAccountCategory(Enum::"Account Category Type"::L2ExtraordinaryIncome);
- InsertPowerBIAccountCategory(Enum::"Account Category Type"::L3PurchasePrepayments);
- InsertPowerBIAccountCategory(Enum::"Account Category Type"::L3LiquidAssets);
- InsertPowerBIAccountCategory(Enum::"Account Category Type"::L2FixedAssets);
+ InsertL1AccountCategories();
+ InsertL2AccountCategories();
+ InsertL3AccountCategories();
end;
end;
- [InherentPermissions(PermissionObjectType::TableData, Database::"Account Category", 'i')]
- local procedure InsertPowerBIAccountCategory(AccountCategoryType: Enum "Account Category Type")
+ local procedure InsertL1AccountCategories()
+ begin
+ InsertPowerBIAccountCategory(Enum::"Account Category Type"::L1Assets, 1, 0);
+ InsertPowerBIAccountCategory(Enum::"Account Category Type"::L1Liabilities, 10, 0);
+ InsertPowerBIAccountCategory(Enum::"Account Category Type"::L1Equity, 14, 0);
+ InsertPowerBIAccountCategory(Enum::"Account Category Type"::L1Revenue, 18, 0);
+ InsertPowerBIAccountCategory(Enum::"Account Category Type"::L1CostOfGoodsSold, 26, 0);
+ InsertPowerBIAccountCategory(Enum::"Account Category Type"::L1Expense, 31, 0);
+ end;
+
+ local procedure InsertL2AccountCategories()
+ begin
+ InsertPowerBIAccountCategory(Enum::"Account Category Type"::L2CurrentAssets, 2, 1);
+ InsertPowerBIAccountCategory(Enum::"Account Category Type"::L2CurrentLiabilities, 11, 1);
+ InsertPowerBIAccountCategory(Enum::"Account Category Type"::L2PayrollLiabilities, 12, 1);
+ InsertPowerBIAccountCategory(Enum::"Account Category Type"::L2LongTermLiabilities, 13, 1);
+ InsertPowerBIAccountCategory(Enum::"Account Category Type"::L2ShareholdersEquity, 15, 1);
+ InsertPowerBIAccountCategory(Enum::"Account Category Type"::L2InterestExpense, 34, 1);
+ InsertPowerBIAccountCategory(Enum::"Account Category Type"::L2TaxExpense, 43, 1);
+ InsertPowerBIAccountCategory(Enum::"Account Category Type"::L2InterestRevenue, 24, 1);
+ InsertPowerBIAccountCategory(Enum::"Account Category Type"::L2DepreciationAmortizationExpense, 9, 2);
+ InsertPowerBIAccountCategory(Enum::"Account Category Type"::L2FixedAssets, 7, 1);
+ InsertPowerBIAccountCategoryWithoutGLAccCategory(Enum::"Account Category Type"::L2ExtraordinaryExpense, 1);
+ InsertPowerBIAccountCategoryWithoutGLAccCategory(Enum::"Account Category Type"::L2FXLossesExpense, 1);
+ InsertPowerBIAccountCategoryWithoutGLAccCategory(Enum::"Account Category Type"::L2FXGainsIncome, 1);
+ InsertPowerBIAccountCategoryWithoutGLAccCategory(Enum::"Account Category Type"::L2ExtraordinaryIncome, 1);
+ end;
+
+ local procedure InsertL3AccountCategories()
+ begin
+ InsertPowerBIAccountCategory(Enum::"Account Category Type"::L3Inventory, 6, 2);
+ InsertPowerBIAccountCategory(Enum::"Account Category Type"::L3AccountsReceivable, 4, 2);
+ InsertPowerBIAccountCategory(Enum::"Account Category Type"::L3PurchasePrepayments, 5, 2);
+ InsertPowerBIAccountCategory(Enum::"Account Category Type"::L3LiquidAssets, 3, 2);
+ InsertPowerBIAccountCategoryWithoutGLAccCategory(Enum::"Account Category Type"::L3Purchases, 2);
+ InsertPowerBIAccountCategoryWithoutGLAccCategory(Enum::"Account Category Type"::L3AccountsPayable, 2);
+ end;
+
+ local procedure InsertPowerBIAccountCategoryWithoutGLAccCategory(AccountCategoryType: Enum "Account Category Type"; GLAccCatIndentation: Integer)
+ begin
+ InsertPowerBIAccountCategory(AccountCategoryType, 0, GLAccCatIndentation);
+ end;
+
+ [InherentPermissions(PermissionObjectType::TableData, Database::"Account Category", 'im')]
+ local procedure InsertPowerBIAccountCategory(AccountCategoryType: Enum "Account Category Type"; GLAccCatEntryNo: Integer; GLAccCatIndentation: Integer)
var
NewPowerBIAccountCategory: Record "Account Category";
+ GLAccCatParentEntryNo: Integer;
begin
NewPowerBIAccountCategory.Init();
NewPowerBIAccountCategory."Account Category Type" := AccountCategoryType;
NewPowerBIAccountCategory.Insert();
+
+ if ValidateGLAccountCategory(GLAccCatEntryNo, GLAccCatIndentation, GLAccCatParentEntryNo) then begin
+ NewPowerBIAccountCategory."G/L Acc. Category Entry No." := GLAccCatEntryNo;
+
+ if GLAccCatParentEntryNo > 0 then
+ NewPowerBIAccountCategory."Parent Acc. Category Entry No." := GLAccCatParentEntryNo;
+
+ NewPowerBIAccountCategory.Modify();
+ end;
+ end;
+
+ local procedure ValidateGLAccountCategory(EntryNo: Integer; Indentation: Integer; var ParentEntryNo: Integer): Boolean
+ var
+ GLAccountCategory: Record "G/L Account Category";
+ begin
+ if EntryNo = 0 then
+ exit(false);
+
+ GLAccountCategory.SetLoadFields(Indentation, "Parent Entry No.");
+ if GLAccountCategory.Get(EntryNo) then
+ if GLAccountCategory.Indentation = Indentation then begin
+ ParentEntryNo := GLAccountCategory."Parent Entry No.";
+ exit(true);
+ end;
end;
}
\ No newline at end of file
diff --git a/Apps/W1/PowerBIReports/app/src/Finance/TableExtensions/SetupFinance.TableExt.al b/Apps/W1/PowerBIReports/app/src/Finance/TableExtensions/SetupFinance.TableExt.al
index 44e9ed9c2e..4eec004093 100644
--- a/Apps/W1/PowerBIReports/app/src/Finance/TableExtensions/SetupFinance.TableExt.al
+++ b/Apps/W1/PowerBIReports/app/src/Finance/TableExtensions/SetupFinance.TableExt.al
@@ -36,5 +36,15 @@ tableextension 36953 "Setup - Finance" extends "PowerBI Reports Setup"
Caption = 'Vendor Ledger Entry End Date';
DataClassification = CustomerContent;
}
+ field(36950; "Finance Report Id"; Guid)
+ {
+ Caption = 'Finance Report ID';
+ DataClassification = CustomerContent;
+ }
+ field(36951; "Finance Report Name"; Text[200])
+ {
+ Caption = 'Finance Report Name';
+ DataClassification = CustomerContent;
+ }
}
}
\ No newline at end of file
diff --git a/Apps/W1/PowerBIReports/app/src/Inventory/TableExtensions/SetupInventory.TableExt.al b/Apps/W1/PowerBIReports/app/src/Inventory/TableExtensions/SetupInventory.TableExt.al
new file mode 100644
index 0000000000..c339c968a8
--- /dev/null
+++ b/Apps/W1/PowerBIReports/app/src/Inventory/TableExtensions/SetupInventory.TableExt.al
@@ -0,0 +1,30 @@
+namespace Microsoft.Projects.PowerBIReports;
+
+using Microsoft.PowerBIReports;
+
+tableextension 36960 "Setup - Inventory" extends "PowerBI Reports Setup"
+{
+ fields
+ {
+ field(36980; "Inventory Report Id"; Guid)
+ {
+ Caption = 'Inventory Report ID';
+ DataClassification = CustomerContent;
+ }
+ field(36981; "Inventory Report Name"; Text[200])
+ {
+ Caption = 'Inventory Report Name';
+ DataClassification = CustomerContent;
+ }
+ field(36990; "Inventory Val. Report Id"; Guid)
+ {
+ Caption = 'Inventory Valuation Report ID';
+ DataClassification = CustomerContent;
+ }
+ field(36991; "Inventory Val. Report Name"; Text[200])
+ {
+ Caption = 'Inventory Valuation Report Name';
+ DataClassification = CustomerContent;
+ }
+ }
+}
\ No newline at end of file
diff --git a/Apps/W1/PowerBIReports/app/src/Manufacturing/TableExtensions/SetupManufacturing.TableExt.al b/Apps/W1/PowerBIReports/app/src/Manufacturing/TableExtensions/SetupManufacturing.TableExt.al
index f30ea313db..6c9aed03e4 100644
--- a/Apps/W1/PowerBIReports/app/src/Manufacturing/TableExtensions/SetupManufacturing.TableExt.al
+++ b/Apps/W1/PowerBIReports/app/src/Manufacturing/TableExtensions/SetupManufacturing.TableExt.al
@@ -28,5 +28,15 @@ tableextension 36954 "Setup - Manufacturing" extends "PowerBI Reports Setup"
Caption = 'Manufacturing Report Date Formula';
DataClassification = CustomerContent;
}
+ field(36978; "Manufacturing Report Id"; Guid)
+ {
+ Caption = 'Manufacturing Report ID';
+ DataClassification = CustomerContent;
+ }
+ field(36979; "Manufacturing Report Name"; Text[200])
+ {
+ Caption = 'Manufacturing Report Name';
+ DataClassification = CustomerContent;
+ }
}
}
\ No newline at end of file
diff --git a/Apps/W1/PowerBIReports/app/src/Projects/TableExtensions/SetupProjects.TableExt.al b/Apps/W1/PowerBIReports/app/src/Projects/TableExtensions/SetupProjects.TableExt.al
index 8f1cf67f8c..a9aabfaab9 100644
--- a/Apps/W1/PowerBIReports/app/src/Projects/TableExtensions/SetupProjects.TableExt.al
+++ b/Apps/W1/PowerBIReports/app/src/Projects/TableExtensions/SetupProjects.TableExt.al
@@ -16,5 +16,15 @@ tableextension 36955 "Setup - Projects" extends "PowerBI Reports Setup"
Caption = 'Job Ledger Entry End Date';
DataClassification = CustomerContent;
}
+ field(36976; "Projects Report Id"; Guid)
+ {
+ Caption = 'Projects Report ID';
+ DataClassification = CustomerContent;
+ }
+ field(36977; "Projects Report Name"; Text[200])
+ {
+ Caption = 'Projects Report Name';
+ DataClassification = CustomerContent;
+ }
}
}
\ No newline at end of file
diff --git a/Apps/W1/PowerBIReports/app/src/Purchasing/TableExtensions/SetupPurchases.TableExt.al b/Apps/W1/PowerBIReports/app/src/Purchasing/TableExtensions/SetupPurchases.TableExt.al
index 9c52b1c2bd..2e67ee1a7b 100644
--- a/Apps/W1/PowerBIReports/app/src/Purchasing/TableExtensions/SetupPurchases.TableExt.al
+++ b/Apps/W1/PowerBIReports/app/src/Purchasing/TableExtensions/SetupPurchases.TableExt.al
@@ -28,5 +28,15 @@ tableextension 36956 "Setup - Purchases" extends "PowerBI Reports Setup"
Caption = 'Item Purchases Report Date Formula';
DataClassification = CustomerContent;
}
+ field(36974; "Purchases Report Id"; Guid)
+ {
+ Caption = 'Purchases Report ID';
+ DataClassification = CustomerContent;
+ }
+ field(36975; "Purchases Report Name"; Text[200])
+ {
+ Caption = 'Purchases Report Name';
+ DataClassification = CustomerContent;
+ }
}
}
\ No newline at end of file
diff --git a/Apps/W1/PowerBIReports/app/src/Sales/TableExtensions/SetupSales.TableExt.al b/Apps/W1/PowerBIReports/app/src/Sales/TableExtensions/SetupSales.TableExt.al
index e352768e9c..0a48f6f383 100644
--- a/Apps/W1/PowerBIReports/app/src/Sales/TableExtensions/SetupSales.TableExt.al
+++ b/Apps/W1/PowerBIReports/app/src/Sales/TableExtensions/SetupSales.TableExt.al
@@ -28,5 +28,15 @@ tableextension 36958 "Setup - Sales" extends "PowerBI Reports Setup"
Caption = 'Item Sales Report Date Formula';
DataClassification = CustomerContent;
}
+ field(36972; "Sales Report Id"; Guid)
+ {
+ Caption = 'Sales Report ID';
+ DataClassification = CustomerContent;
+ }
+ field(36973; "Sales Report Name"; Text[200])
+ {
+ Caption = 'Sales Report Name';
+ DataClassification = CustomerContent;
+ }
}
}
\ No newline at end of file
diff --git a/Apps/W1/PowerBIReports/test/app.json b/Apps/W1/PowerBIReports/test/app.json
index dc1d51053f..4f0a7b430a 100644
--- a/Apps/W1/PowerBIReports/test/app.json
+++ b/Apps/W1/PowerBIReports/test/app.json
@@ -30,6 +30,12 @@
"name": "Library Variable Storage",
"version": "26.0.0.0"
},
+ {
+ "id": "40860557-a18d-42ad-aecb-22b7dd80dc80",
+ "publisher": "Microsoft",
+ "name": "Permissions Mock",
+ "version": "26.0.0.0"
+ },
{
"id": "e4e86220-cac0-4ec3-b853-7c2fa610399d",
"name": "PowerBI Reports",
diff --git a/Apps/W1/PowerBIReports/test/src/Codeunits/PowerBICoreTest.Codeunit.al b/Apps/W1/PowerBIReports/test/src/Codeunits/PowerBICoreTest.Codeunit.al
index 6ce2659b77..fdae458ce5 100644
--- a/Apps/W1/PowerBIReports/test/src/Codeunits/PowerBICoreTest.Codeunit.al
+++ b/Apps/W1/PowerBIReports/test/src/Codeunits/PowerBICoreTest.Codeunit.al
@@ -11,15 +11,16 @@ using Microsoft.Sales.PowerBIReports;
using Microsoft.Purchases.PowerBIReports;
using Microsoft.Manufacturing.PowerBIReports;
using Microsoft.Finance.PowerBIReports;
+using System.TestLibraries.Security.AccessControl;
codeunit 139875 "PowerBI Core Test"
{
Subtype = Test;
- TestPermissions = Disabled;
Access = Internal;
var
Assert: Codeunit Assert;
+ PermissionsMock: Codeunit "Permissions Mock";
[Test]
procedure TestGenerateItemSalesReportDateFilter_StartEndDate()
@@ -31,6 +32,7 @@ codeunit 139875 "PowerBI Core Test"
begin
// [SCENARIO] Test GenerateItemSalesReportDateFilter
// [GIVEN] Power BI setup record is created with Load Date Type = "Start/End Date"
+ AssignAdminPermissionSet();
RecreatePBISetup();
PBISetup."Item Sales Load Date Type" := PBISetup."Item Sales Load Date Type"::"Start/End Date";
@@ -38,6 +40,7 @@ codeunit 139875 "PowerBI Core Test"
PBISetup."Item Sales Start Date" := Today();
PBISetup."Item Sales End Date" := Today() + 10;
PBISetup.Modify();
+ PermissionsMock.ClearAssignments();
ExpectedFilterTxt := StrSubstNo('%1..%2', Today(), Today() + 10);
@@ -58,12 +61,14 @@ codeunit 139875 "PowerBI Core Test"
begin
// [SCENARIO] Test GenerateItemSalesReportDateFilter
// [GIVEN] Power BI setup record is created with Load Date Type = "Relative Date"
+ AssignAdminPermissionSet();
RecreatePBISetup();
PBISetup."Item Sales Load Date Type" := PBISetup."Item Sales Load Date Type"::"Relative Date";
// [GIVEN] A mock date formula value
Evaluate(PBISetup."Item Sales Date Formula", '30D');
PBISetup.Modify();
+ PermissionsMock.ClearAssignments();
ExpectedFilterTxt := StrSubstNo('%1..', CalcDate(PBISetup."Item Sales Date Formula"));
@@ -83,8 +88,11 @@ codeunit 139875 "PowerBI Core Test"
begin
// [SCENARIO] Test GenerateItemSalesReportDateFilter
// [GIVEN] Power BI setup record is created with Load Date Type = " "
+ AssignAdminPermissionSet();
RecreatePBISetup();
PBISetup."Item Sales Load Date Type" := PBISetup."Item Sales Load Date Type"::" ";
+ PBISetup.Modify();
+ PermissionsMock.ClearAssignments();
// [WHEN] GenerateItemSalesReportDateFilter executes
ActualFilterTxt := PBIMgt.GenerateItemSalesReportDateFilter();
@@ -103,6 +111,7 @@ codeunit 139875 "PowerBI Core Test"
begin
// [SCENARIO] Test GenerateItemPurchasesReportDateFilter
// [GIVEN] Power BI setup record is created with Load Date Type = "Start/End Date"
+ AssignAdminPermissionSet();
RecreatePBISetup();
PBISetup."Item Purch. Load Date Type" := PBISetup."Item Purch. Load Date Type"::"Start/End Date";
@@ -110,6 +119,7 @@ codeunit 139875 "PowerBI Core Test"
PBISetup."Item Purch. Start Date" := Today();
PBISetup."Item Purch. End Date" := Today() + 10;
PBISetup.Modify();
+ PermissionsMock.ClearAssignments();
ExpectedFilterTxt := StrSubstNo('%1..%2', Today(), Today() + 10);
@@ -130,12 +140,14 @@ codeunit 139875 "PowerBI Core Test"
begin
// [SCENARIO] Test GenerateItemPurchasesReportDateFilter
// [GIVEN] Power BI setup record is created with Load Date Type = "Relative Date"
+ AssignAdminPermissionSet();
RecreatePBISetup();
PBISetup."Item Purch. Load Date Type" := PBISetup."Item Purch. Load Date Type"::"Relative Date";
// [GIVEN] A mock date formula value
Evaluate(PBISetup."Item Purch. Date Formula", '30D');
PBISetup.Modify();
+ PermissionsMock.ClearAssignments();
ExpectedFilterTxt := StrSubstNo('%1..', CalcDate(PBISetup."Item Purch. Date Formula"));
@@ -155,8 +167,11 @@ codeunit 139875 "PowerBI Core Test"
begin
// [SCENARIO] Test GenerateItemPurchasesReportDateFilter
// [GIVEN] Power BI setup record is created with Load Date Type = " "
+ AssignAdminPermissionSet();
RecreatePBISetup();
PBISetup."Item Purch. Load Date Type" := PBISetup."Item Purch. Load Date Type"::" ";
+ PBISetup.Modify();
+ PermissionsMock.ClearAssignments();
// [WHEN] GenerateItemPurchasesReportDateFilter executes
ActualFilterTxt := PBIMgt.GenerateItemPurchasesReportDateFilter();
@@ -175,6 +190,7 @@ codeunit 139875 "PowerBI Core Test"
begin
// [SCENARIO] Test GenerateManufacturingReportDateFilter
// [GIVEN] Power BI setup record is created with Load Date Type = "Start/End Date"
+ AssignAdminPermissionSet();
RecreatePBISetup();
PBISetup."Manufacturing Load Date Type" := PBISetup."Manufacturing Load Date Type"::"Start/End Date";
@@ -182,6 +198,7 @@ codeunit 139875 "PowerBI Core Test"
PBISetup."Manufacturing Start Date" := Today();
PBISetup."Manufacturing End Date" := Today() + 10;
PBISetup.Modify();
+ PermissionsMock.ClearAssignments();
ExpectedFilterTxt := StrSubstNo('%1..%2', Today(), Today() + 10);
@@ -202,12 +219,14 @@ codeunit 139875 "PowerBI Core Test"
begin
// [SCENARIO] Test GenerateManufacturingReportDateFilter
// [GIVEN] Power BI setup record is created with Load Date Type = "Relative Date"
+ AssignAdminPermissionSet();
RecreatePBISetup();
PBISetup."Manufacturing Load Date Type" := PBISetup."Manufacturing Load Date Type"::"Relative Date";
// [GIVEN] A mock date formula value
Evaluate(PBISetup."Manufacturing Date Formula", '30D');
PBISetup.Modify();
+ PermissionsMock.ClearAssignments();
ExpectedFilterTxt := StrSubstNo('%1..', CalcDate(PBISetup."Manufacturing Date Formula"));
@@ -227,8 +246,11 @@ codeunit 139875 "PowerBI Core Test"
begin
// [SCENARIO] Test GenerateManufacturingReportDateFilter
// [GIVEN] Power BI setup record is created with Load Date Type = " "
+ AssignAdminPermissionSet();
RecreatePBISetup();
PBISetup."Manufacturing Load Date Type" := PBISetup."Manufacturing Load Date Type"::" ";
+ PBISetup.Modify();
+ PermissionsMock.ClearAssignments();
// [WHEN] GenerateManufacturingReportDateFilter executes
ActualFilterTxt := PBIMgt.GenerateManufacturingReportDateFilter();
@@ -247,6 +269,7 @@ codeunit 139875 "PowerBI Core Test"
begin
// [SCENARIO] Test GenerateManufacturingReportDateTimeFilter
// [GIVEN] Power BI setup record is created with Load Date Type = "Start/End Date"
+ AssignAdminPermissionSet();
RecreatePBISetup();
PBISetup."Manufacturing Load Date Type" := PBISetup."Manufacturing Load Date Type"::"Start/End Date";
@@ -254,6 +277,7 @@ codeunit 139875 "PowerBI Core Test"
PBISetup."Manufacturing Start Date" := Today();
PBISetup."Manufacturing End Date" := Today() + 10;
PBISetup.Modify();
+ PermissionsMock.ClearAssignments();
ExpectedFilterTxt := StrSubstNo('%1..%2', Format(CreateDateTime(Today(), 0T)), Format(CreateDateTime(Today() + 10, 0T)));
@@ -274,12 +298,14 @@ codeunit 139875 "PowerBI Core Test"
begin
// [SCENARIO] Test GenerateManufacturingReportDateTimeFilter
// [GIVEN] Power BI setup record is created with Load Date Type = "Relative Date"
+ AssignAdminPermissionSet();
RecreatePBISetup();
PBISetup."Manufacturing Load Date Type" := PBISetup."Manufacturing Load Date Type"::"Relative Date";
// [GIVEN] A mock date formula value
Evaluate(PBISetup."Manufacturing Date Formula", '30D');
PBISetup.Modify();
+ PermissionsMock.ClearAssignments();
ExpectedFilterTxt := StrSubstNo('%1..', Format(CreateDateTime(CalcDate(PBISetup."Manufacturing Date Formula"), 0T)));
@@ -299,8 +325,11 @@ codeunit 139875 "PowerBI Core Test"
begin
// [SCENARIO] Test GenerateManufacturingReportDateTimeFilter
// [GIVEN] Power BI setup record is created with Load Date Type = " "
+ AssignAdminPermissionSet();
RecreatePBISetup();
PBISetup."Manufacturing Load Date Type" := PBISetup."Manufacturing Load Date Type"::" ";
+ PBISetup.Modify();
+ PermissionsMock.ClearAssignments();
// [WHEN] GenerateManufacturingReportDateTimeFilter executes
ActualFilterTxt := PBIMgt.GenerateManufacturingReportDateTimeFilter();
@@ -319,12 +348,14 @@ codeunit 139875 "PowerBI Core Test"
begin
// [SCENARIO] Test GenerateFinanceReportDateFilter
// [GIVEN] Power BI setup record is created
+ AssignAdminPermissionSet();
RecreatePBISetup();
// [GIVEN] Mock start & end date values are entered
PBISetup."Finance Start Date" := Today();
PBISetup."Finance End Date" := Today() + 10;
PBISetup.Modify();
+ PermissionsMock.ClearAssignments();
ExpectedFilterTxt := StrSubstNo('%1..%2', Today(), Today() + 10);
@@ -343,7 +374,9 @@ codeunit 139875 "PowerBI Core Test"
begin
// [SCENARIO] Test GenerateFinanceReportDateFilter
// [GIVEN] Power BI setup record is created with blank start & end dates
+ AssignAdminPermissionSet();
RecreatePBISetup();
+ PermissionsMock.ClearAssignments();
// [WHEN] GenerateFinanceReportDateFilter executes
ActualFilterTxt := PBIMgt.GenerateFinanceReportDateFilter();
@@ -361,6 +394,11 @@ codeunit 139875 "PowerBI Core Test"
PBISetup.Init();
PBISetup.Insert();
end;
+
+ procedure AssignAdminPermissionSet()
+ begin
+ PermissionsMock.Assign('PowerBI Report Admin');
+ end;
}
#pragma warning restore AA0247
diff --git a/Apps/W1/PowerBIReports/test/src/Codeunits/PowerBIFinanceTest.Codeunit.al b/Apps/W1/PowerBIReports/test/src/Codeunits/PowerBIFinanceTest.Codeunit.al
index 2def310071..d84c7424f8 100644
--- a/Apps/W1/PowerBIReports/test/src/Codeunits/PowerBIFinanceTest.Codeunit.al
+++ b/Apps/W1/PowerBIReports/test/src/Codeunits/PowerBIFinanceTest.Codeunit.al
@@ -21,11 +21,13 @@ using Microsoft.Purchases.History;
using Microsoft.Purchases.Payables;
using Microsoft.Purchases.Document;
using System.TestLibraries.Utilities;
+using Microsoft.Foundation.AuditCodes;
+using Microsoft.Finance.GeneralLedger.Setup;
+using System.TestLibraries.Security.AccessControl;
codeunit 139876 "PowerBI Finance Test"
{
Subtype = Test;
- TestPermissions = Disabled;
Access = Internal;
var
@@ -40,6 +42,8 @@ codeunit 139876 "PowerBI Finance Test"
LibRandom: Codeunit "Library - Random";
LibUtility: Codeunit "Library - Utility";
UriBuilder: Codeunit "Uri Builder";
+ PermissionsMock: Codeunit "Permissions Mock";
+ PowerBICoreTest: Codeunit "PowerBI Core Test";
ResponseEmptyErr: Label 'Response should not be empty.';
[Test]
@@ -385,6 +389,7 @@ codeunit 139876 "PowerBI Finance Test"
Response: Text;
begin
// [GIVEN] General journal lines for income statement account is posted, with one line outside the date range
+ PowerBICoreTest.AssignAdminPermissionSet();
if not PBISetup.Get() then begin
PBISetup.Init();
PBISetup.Insert();
@@ -392,6 +397,7 @@ codeunit 139876 "PowerBI Finance Test"
PBISetup."Finance Start Date" := 0D;
PBISetup."Finance Start Date" := WorkDate();
PBISetup.Modify();
+ PermissionsMock.ClearAssignments();
CreateGeneralJournalBatch(GenJournalBatch, GLAccount);
GLAccount."Income/Balance" := GLAccount."Income/Balance"::"Income Statement";
GLAccount.Modify(true);
@@ -473,11 +479,13 @@ codeunit 139876 "PowerBI Finance Test"
GLAccount."Income/Balance" := GLAccount."Income/Balance"::"Income Statement";
GLAccount.Insert();
+ PermissionsMock.Assign('SUPER');
if GLEntry.FindLast() then;
GLEntry.Init();
GLEntry."Entry No." += 1;
GLEntry."G/L Account No." := GLAccount."No.";
GLEntry.Insert();
+ PermissionsMock.ClearAssignments();
Commit();
@@ -503,6 +511,65 @@ codeunit 139876 "PowerBI Finance Test"
Assert.AreEqual(0, JToken.AsArray().Count(), 'Response contains data outside of the filter.');
end;
+ [Test]
+ [HandlerFunctions('ConfirmHandler,CloseIncomeStatementRequestPageHandler,MessageHandler')]
+ procedure TestClosingGLEntry()
+ var
+ SourceCodeSetup: Record "Source Code Setup";
+ GenJournalBatch: Record "Gen. Journal Batch";
+ GenJnlLine: Record "Gen. Journal Line";
+ GLAccount: Record "G/L Account";
+ BalGLAccount: Record "G/L Account";
+ GLEntry: Record "G/L Entry";
+ Uri: Codeunit Uri;
+ TargetURL: Text;
+ Response: Text;
+ begin
+ // [GIVEN] Income statement is posted and closing G/L entries are created
+ LibFiscalYear.CloseFiscalYear();
+ LibFiscalYear.CreateFiscalYear();
+ CreateGeneralJournalBatch(GenJournalBatch, BalGLAccount);
+ LibERM.CreateGLAccount(GLAccount);
+ CreateGeneralJournalLines(GenJournalBatch, GLAccount, GenJnlLine, LibFiscalYear.GetLastPostingDate(true));
+ LibERM.PostGeneralJnlLine(GenJnlLine);
+ RunCloseIncomeStatement(GenJnlLine, GenJnlLine."Document No.");
+ GenJnlLine.SetRange("Journal Batch Name", GenJnlLine."Journal Batch Name");
+ GenJnlLine.FindLast();
+ LibERM.PostGeneralJnlLine(GenJnlLine);
+ SourceCodeSetup.Get();
+ GLEntry.SetRange("Source Code", SourceCodeSetup."Close Income Statement");
+ GLEntry.SetFilter("G/L Account No.", '%1|%2', GLAccount."No.", BalGLAccount."No.");
+
+ Commit();
+
+ // [WHEN] Get request for income statement G/L entry is made
+ TargetURL := LibGraphMgt.CreateQueryTargetURL(Query::Microsoft.Finance.PowerBIReports."G/L Entries - Closing", '');
+ UriBuilder.Init(TargetURL);
+ UriBuilder.AddQueryParameter('$filter', StrSubstNo('glAccountNo eq ''%1'' or glAccountNo eq ''%2''', GLAccount."No.", BalGLAccount."No."));
+ UriBuilder.GetUri(Uri);
+ LibGraphMgt.GetFromWebService(Response, Uri.GetAbsoluteUri());
+
+ // [THEN] The response contains the income statement G/L entry information
+ Assert.AreNotEqual('', Response, ResponseEmptyErr);
+ GLEntry.FindSet();
+ repeat
+ VerifyPostedGLEntry(Response, GLAccount, GLEntry, true);
+ until GLEntry.Next() = 0;
+ end;
+
+ local procedure CreateGeneralJournalLines(GenJournalBatch: Record "Gen. Journal Batch"; GLAccount: Record "G/L Account"; var GenJournalLine: Record "Gen. Journal Line"; PostingDate: Date)
+ var
+ Counter: Integer;
+ begin
+ for Counter := 1 to LibRandom.RandIntInRange(3, 5) do begin
+ LibERM.CreateGeneralJnlLine(
+ GenJournalLine, GenJournalBatch."Journal Template Name", GenJournalBatch.Name, GenJournalLine."Document Type"::" ",
+ GenJournalLine."Account Type"::"G/L Account", GLAccount."No.", LibRandom.RandInt(1000));
+ GenJournalLine.Validate("Posting Date", PostingDate);
+ GenJournalLine.Modify(true);
+ end;
+ end;
+
local procedure VerifyPostedGLEntry(Response: Text; GLAccount: Record "G/L Account"; GLEntry: Record "G/L Entry"; EntryShouldExist: Boolean)
var
JsonMgt: Codeunit "JSON Management";
@@ -522,12 +589,51 @@ codeunit 139876 "PowerBI Finance Test"
Assert.IsFalse(JsonMgt.SelectTokenFromRoot(StrSubstNo('$..value[?(@.entryNo == %1)]', GLEntry."Entry No.")), 'G/L entry should not be found.');
end;
+ local procedure RunCloseIncomeStatement(GenJournalLine: Record "Gen. Journal Line"; DocumentNo: Code[20])
+ var
+ Date: Record Date;
+ begin
+ // Run the Close Income Statement Batch Job.
+ Date.SetRange("Period Type", Date."Period Type"::Month);
+ Date.SetRange("Period Start", LibFiscalYear.GetLastPostingDate(true));
+ Date.FindFirst();
+
+ RunCloseIncomeStatement(GenJournalLine, NormalDate(Date."Period End"), true, false, DocumentNo);
+ end;
+
+ local procedure RunCloseIncomeStatement(GenJournalLine: Record "Gen. Journal Line"; PostingDate: Date; ClosePerBusinessUnit: Boolean; UseDimensions: Boolean; DocumentNo: Code[20])
+ begin
+ // Enqueue values for CloseIncomeStatementRequestPageHandler.
+ LibVariableStorage.Enqueue(PostingDate);
+ LibVariableStorage.Enqueue(GenJournalLine."Journal Template Name");
+ LibVariableStorage.Enqueue(GenJournalLine."Journal Batch Name");
+ LibVariableStorage.Enqueue(DocumentNo);
+ LibVariableStorage.Enqueue(ClosePerBusinessUnit);
+ LibVariableStorage.Enqueue(UseDimensions);
+
+ Commit(); // commit requires to run report.
+ Report.Run(Report::"Close Income Statement");
+ end;
+
[ConfirmHandler]
procedure ConfirmHandler(Question: Text[1024]; var Reply: Boolean)
begin
Reply := true;
end;
+ [RequestPageHandler]
+ procedure CloseIncomeStatementRequestPageHandler(var CloseIncomeStatement: TestRequestPage "Close Income Statement")
+ begin
+ CloseIncomeStatement.FiscalYearEndingDate.SetValue(LibVariableStorage.DequeueDate()); // Fiscal Year Ending Date
+ CloseIncomeStatement.GenJournalTemplate.SetValue(LibVariableStorage.DequeueText()); // Gen. Journal Template
+ CloseIncomeStatement.GenJournalBatch.SetValue(LibVariableStorage.DequeueText()); // Gen. Journal Batch
+ CloseIncomeStatement.DocumentNo.SetValue(LibVariableStorage.DequeueText()); // Document No.
+ CloseIncomeStatement.ClosePerBusUnit.SetValue(LibVariableStorage.DequeueBoolean()); // Close Business Unit Code
+ if LibVariableStorage.DequeueBoolean() then // get stored flag for usage Dimensions
+ CloseIncomeStatement.Dimensions.AssistEdit(); // Select Dimensions
+ CloseIncomeStatement.OK().Invoke();
+ end;
+
[MessageHandler]
procedure MessageHandler(Message: Text[1024])
begin
@@ -563,12 +669,14 @@ codeunit 139876 "PowerBI Finance Test"
begin
// [SCENARIO] Test GenerateFinanceReportDateFilter
// [GIVEN] Power BI setup record is created
+ PowerBICoreTest.AssignAdminPermissionSet();
RecreatePBISetup();
// [GIVEN] Mock start & end date values are entered
PBISetup."Finance Start Date" := Today();
PBISetup."Finance End Date" := Today() + 10;
PBISetup.Modify();
+ PermissionsMock.ClearAssignments();
ExpectedFilterTxt := StrSubstNo('%1..%2', Today(), Today() + 10);
@@ -587,7 +695,9 @@ codeunit 139876 "PowerBI Finance Test"
begin
// [SCENARIO] Test GenerateFinanceReportDateFilter
// [GIVEN] Power BI setup record is created with blank start & end dates
+ PowerBICoreTest.AssignAdminPermissionSet();
RecreatePBISetup();
+ PermissionsMock.ClearAssignments();
// [WHEN] GenerateFinanceReportDateFilter executes
ActualFilterTxt := PBIMgt.GenerateFinanceReportDateFilter();
diff --git a/Apps/W1/PowerBIReports/test/src/Codeunits/PowerBIInventoryTest.Codeunit.al b/Apps/W1/PowerBIReports/test/src/Codeunits/PowerBIInventoryTest.Codeunit.al
index 61bfe178d2..d62c3287c1 100644
--- a/Apps/W1/PowerBIReports/test/src/Codeunits/PowerBIInventoryTest.Codeunit.al
+++ b/Apps/W1/PowerBIReports/test/src/Codeunits/PowerBIInventoryTest.Codeunit.al
@@ -33,11 +33,11 @@ using Microsoft.Finance.GeneralLedger.Setup;
using Microsoft.Sales.Setup;
using Microsoft.Inventory.PowerBIReports;
using Microsoft.Service.Test;
+using System.TestLibraries.Security.AccessControl;
codeunit 139877 "PowerBI Inventory Test"
{
Subtype = Test;
- TestPermissions = Disabled;
Access = Internal;
var
@@ -55,6 +55,7 @@ codeunit 139877 "PowerBI Inventory Test"
LibRandom: Codeunit "Library - Random";
LibUtility: Codeunit "Library - Utility";
UriBuilder: Codeunit "Uri Builder";
+ PermissionsMock: Codeunit "Permissions Mock";
ResponseEmptyErr: Label 'Response should not be empty.';
[Test]
@@ -1030,12 +1031,14 @@ codeunit 139877 "PowerBI Inventory Test"
Response: Text;
begin
// [GIVEN] Value entry exists outside of the query filter
+ PermissionsMock.Assign('SUPER');
if ValueEntry.FindLast() then;
ValueEntry.Init();
ValueEntry."Entry No." += 1;
ValueEntry."Entry Type" := ValueEntry."Entry Type"::"Direct Cost";
ValueEntry."Item No." := '';
ValueEntry.Insert();
+ PermissionsMock.ClearAssignments();
Commit();
// [WHEN] Get request for the value entry outside of the query filter is made
diff --git a/Apps/W1/PowerBIReports/test/src/Codeunits/PowerBIManufacturingTest.Codeunit.al b/Apps/W1/PowerBIReports/test/src/Codeunits/PowerBIManufacturingTest.Codeunit.al
index 6edf6cecf6..40d3595c0a 100644
--- a/Apps/W1/PowerBIReports/test/src/Codeunits/PowerBIManufacturingTest.Codeunit.al
+++ b/Apps/W1/PowerBIReports/test/src/Codeunits/PowerBIManufacturingTest.Codeunit.al
@@ -21,11 +21,11 @@ using Microsoft.Manufacturing.ProductionBOM;
using Microsoft.Manufacturing.Routing;
using System.Text;
using Microsoft.Inventory.Location;
+using System.TestLibraries.Security.AccessControl;
codeunit 139878 "PowerBI Manufacturing Test"
{
Subtype = Test;
- TestPermissions = Disabled;
Access = Internal;
var
@@ -37,6 +37,8 @@ codeunit 139878 "PowerBI Manufacturing Test"
LibRandom: Codeunit "Library - Random";
LibUtility: Codeunit "Library - Utility";
UriBuilder: Codeunit "Uri Builder";
+ PermissionsMock: Codeunit "Permissions Mock";
+ PowerBICoreTest: Codeunit "PowerBI Core Test";
ResponseEmptyErr: Label 'Response should not be empty.';
[Test]
@@ -205,8 +207,8 @@ codeunit 139878 "PowerBI Manufacturing Test"
// [WHEN] Get request for production order lines is made
TargetURL := LibGraphMgt.CreateQueryTargetURL(Query::"Prod. Order Lines - Manuf.", '');
UriBuilder.Init(TargetURL);
- UriBuilder.GetUri(Uri);
UriBuilder.AddODataQueryParameter('$filter', StrSubstNo('itemNo eq ''%1''', Item."No."));
+ UriBuilder.GetUri(Uri);
LibGraphMgt.GetFromWebService(Response, Uri.GetAbsoluteUri());
// [THEN] The response contains the production order line information
@@ -277,8 +279,8 @@ codeunit 139878 "PowerBI Manufacturing Test"
// [WHEN] Get request for production order component lines is made
TargetURL := LibGraphMgt.CreateQueryTargetURL(Query::"Prod. Order Comp. - Manuf.", '');
UriBuilder.Init(TargetURL);
- UriBuilder.GetUri(Uri);
UriBuilder.AddODataQueryParameter('$filter', StrSubstNo('itemNo eq ''%1''', ItemComp."No."));
+ UriBuilder.GetUri(Uri);
LibGraphMgt.GetFromWebService(Response, Uri.GetAbsoluteUri());
// [THEN] The response contains the production order component line information
@@ -342,8 +344,8 @@ codeunit 139878 "PowerBI Manufacturing Test"
// [WHEN] Get request for production order routing lines is made
TargetURL := LibGraphMgt.CreateQueryTargetURL(Query::"Prod. Order Routing Lines", '');
UriBuilder.Init(TargetURL);
- UriBuilder.GetUri(Uri);
UriBuilder.AddODataQueryParameter('$filter', StrSubstNo('no eq ''%1''', WorkCenter."No."));
+ UriBuilder.GetUri(Uri);
LibGraphMgt.GetFromWebService(Response, Uri.GetAbsoluteUri());
// [THEN] The response contains the production order routing line information
@@ -421,8 +423,8 @@ codeunit 139878 "PowerBI Manufacturing Test"
// [WHEN] Get request for production item ledger entries is made
TargetURL := LibGraphMgt.CreateQueryTargetURL(Query::"Item Ledger Entries - Prod.", '');
UriBuilder.Init(TargetURL);
- UriBuilder.GetUri(Uri);
UriBuilder.AddODataQueryParameter('$filter', StrSubstNo('orderNo eq ''%1''', ProdOrder."No."));
+ UriBuilder.GetUri(Uri);
LibGraphMgt.GetFromWebService(Response, Uri.GetAbsoluteUri());
// [THEN] The response contains the production item ledger entries information
@@ -462,6 +464,7 @@ codeunit 139878 "PowerBI Manufacturing Test"
Response: Text;
begin
// [GIVEN] Item ledger entries exist outside of the query filter
+ PermissionsMock.Assign('SUPER');
if ItemLedgerEntry.FindLast() then;
ItemLedgerEntry.Init();
@@ -477,7 +480,7 @@ codeunit 139878 "PowerBI Manufacturing Test"
ItemLedgerEntry."Entry No." += 1;
ItemLedgerEntry."Entry Type" := ItemLedgerEntry."Entry Type"::"Assembly Consumption";
ItemLedgerEntry.Insert();
-
+ PermissionsMock.ClearAssignments();
Commit();
// [WHEN] Get request for the item ledger entries outside of the query filter is made
@@ -532,8 +535,8 @@ codeunit 139878 "PowerBI Manufacturing Test"
// [WHEN] Get request for production item ledger entries is made
TargetURL := LibGraphMgt.CreateQueryTargetURL(Query::"Capacity Ledger Entries", '');
UriBuilder.Init(TargetURL);
- UriBuilder.GetUri(Uri);
UriBuilder.AddODataQueryParameter('$filter', StrSubstNo('orderNo eq ''%1''', ProdOrder."No."));
+ UriBuilder.GetUri(Uri);
LibGraphMgt.GetFromWebService(Response, Uri.GetAbsoluteUri());
// [THEN] The response contains the production item ledger entries information
@@ -721,6 +724,7 @@ codeunit 139878 "PowerBI Manufacturing Test"
begin
// [SCENARIO] Test GenerateManufacturingReportDateFilter
// [GIVEN] Power BI setup record is created with Load Date Type = "Start/End Date"
+ PowerBICoreTest.AssignAdminPermissionSet();
RecreatePBISetup();
PBISetup."Manufacturing Load Date Type" := PBISetup."Manufacturing Load Date Type"::"Start/End Date";
@@ -728,6 +732,7 @@ codeunit 139878 "PowerBI Manufacturing Test"
PBISetup."Manufacturing Start Date" := Today();
PBISetup."Manufacturing End Date" := Today() + 10;
PBISetup.Modify();
+ PermissionsMock.ClearAssignments();
ExpectedFilterTxt := StrSubstNo('%1..%2', Today(), Today() + 10);
@@ -748,12 +753,14 @@ codeunit 139878 "PowerBI Manufacturing Test"
begin
// [SCENARIO] Test GenerateManufacturingReportDateFilter
// [GIVEN] Power BI setup record is created with Load Date Type = "Relative Date"
+ PowerBICoreTest.AssignAdminPermissionSet();
RecreatePBISetup();
PBISetup."Manufacturing Load Date Type" := PBISetup."Manufacturing Load Date Type"::"Relative Date";
// [GIVEN] A mock date formula value
Evaluate(PBISetup."Manufacturing Date Formula", '30D');
PBISetup.Modify();
+ PermissionsMock.ClearAssignments();
ExpectedFilterTxt := StrSubstNo('%1..', CalcDate(PBISetup."Manufacturing Date Formula"));
@@ -773,8 +780,11 @@ codeunit 139878 "PowerBI Manufacturing Test"
begin
// [SCENARIO] Test GenerateManufacturingReportDateFilter
// [GIVEN] Power BI setup record is created with Load Date Type = " "
+ PowerBICoreTest.AssignAdminPermissionSet();
RecreatePBISetup();
PBISetup."Manufacturing Load Date Type" := PBISetup."Manufacturing Load Date Type"::" ";
+ PBISetup.Modify();
+ PermissionsMock.ClearAssignments();
// [WHEN] GenerateManufacturingReportDateFilter executes
ActualFilterTxt := PBIMgt.GenerateManufacturingReportDateFilter();
@@ -793,6 +803,7 @@ codeunit 139878 "PowerBI Manufacturing Test"
begin
// [SCENARIO] Test GenerateManufacturingReportDateTimeFilter
// [GIVEN] Power BI setup record is created with Load Date Type = "Start/End Date"
+ PowerBICoreTest.AssignAdminPermissionSet();
RecreatePBISetup();
PBISetup."Manufacturing Load Date Type" := PBISetup."Manufacturing Load Date Type"::"Start/End Date";
@@ -800,6 +811,7 @@ codeunit 139878 "PowerBI Manufacturing Test"
PBISetup."Manufacturing Start Date" := Today();
PBISetup."Manufacturing End Date" := Today() + 10;
PBISetup.Modify();
+ PermissionsMock.ClearAssignments();
ExpectedFilterTxt := StrSubstNo('%1..%2', Format(CreateDateTime(Today(), 0T)), Format(CreateDateTime(Today() + 10, 0T)));
@@ -820,12 +832,14 @@ codeunit 139878 "PowerBI Manufacturing Test"
begin
// [SCENARIO] Test GenerateManufacturingReportDateTimeFilter
// [GIVEN] Power BI setup record is created with Load Date Type = "Relative Date"
+ PowerBICoreTest.AssignAdminPermissionSet();
RecreatePBISetup();
PBISetup."Manufacturing Load Date Type" := PBISetup."Manufacturing Load Date Type"::"Relative Date";
// [GIVEN] A mock date formula value
Evaluate(PBISetup."Manufacturing Date Formula", '30D');
PBISetup.Modify();
+ PermissionsMock.ClearAssignments();
ExpectedFilterTxt := StrSubstNo('%1..', Format(CreateDateTime(CalcDate(PBISetup."Manufacturing Date Formula"), 0T)));
@@ -845,8 +859,11 @@ codeunit 139878 "PowerBI Manufacturing Test"
begin
// [SCENARIO] Test GenerateManufacturingReportDateTimeFilter
// [GIVEN] Power BI setup record is created with Load Date Type = " "
+ PowerBICoreTest.AssignAdminPermissionSet();
RecreatePBISetup();
PBISetup."Manufacturing Load Date Type" := PBISetup."Manufacturing Load Date Type"::" ";
+ PBISetup.Modify();
+ PermissionsMock.ClearAssignments();
// [WHEN] GenerateManufacturingReportDateTimeFilter executes
ActualFilterTxt := PBIMgt.GenerateManufacturingReportDateTimeFilter();
diff --git a/Apps/W1/PowerBIReports/test/src/Codeunits/PowerBIProjectTest.Codeunit.al b/Apps/W1/PowerBIReports/test/src/Codeunits/PowerBIProjectTest.Codeunit.al
index 0e7c6c4ef7..0b1a468a94 100644
--- a/Apps/W1/PowerBIReports/test/src/Codeunits/PowerBIProjectTest.Codeunit.al
+++ b/Apps/W1/PowerBIReports/test/src/Codeunits/PowerBIProjectTest.Codeunit.al
@@ -57,8 +57,8 @@ codeunit 139879 "PowerBI Project Test"
// [WHEN] Get request for jobs is made
TargetURL := LibGraphMgt.CreateQueryTargetURL(Query::Jobs, '');
UriBuilder.Init(TargetURL);
- UriBuilder.GetUri(Uri);
UriBuilder.AddODataQueryParameter('$filter', StrSubstNo('no eq ''%1'' or no eq ''%2''', Job."No.", Job2."No."));
+ UriBuilder.GetUri(Uri);
LibGraphMgt.GetFromWebService(Response, Uri.GetAbsoluteUri());
// [THEN] The response contains the job information
@@ -105,14 +105,14 @@ codeunit 139879 "PowerBI Project Test"
LibJob.CreateJob(Job);
LibJob.CreateJobTask(Job, JobTask);
LibJob.CreateJobTask(Job, JobTask2);
- JobTask.SetFilter("Job No.", Job."No.");
+ JobTask.SetRange("Job No.", Job."No.");
Commit();
// [WHEN] Get request for job tasks is made
TargetURL := LibGraphMgt.CreateQueryTargetURL(Query::"Job Tasks", '');
UriBuilder.Init(TargetURL);
- UriBuilder.GetUri(Uri);
UriBuilder.AddODataQueryParameter('$filter', StrSubstNo('jobNo eq ''%1''', Job."No."));
+ UriBuilder.GetUri(Uri);
LibGraphMgt.GetFromWebService(Response, Uri.GetAbsoluteUri());
// [THEN] The response contains the job task information
@@ -161,8 +161,8 @@ codeunit 139879 "PowerBI Project Test"
// [WHEN] Get request for job planning lines is made
TargetURL := LibGraphMgt.CreateQueryTargetURL(Query::"Job Planning Lines", '');
UriBuilder.Init(TargetURL);
- UriBuilder.GetUri(Uri);
UriBuilder.AddODataQueryParameter('$filter', StrSubstNo('jobNo eq ''%1''', Job."No."));
+ UriBuilder.GetUri(Uri);
LibGraphMgt.GetFromWebService(Response, Uri.GetAbsoluteUri());
// [THEN] The response contains the job planning line information
@@ -228,8 +228,8 @@ codeunit 139879 "PowerBI Project Test"
// [WHEN] Get request for job ledger entries is made
TargetURL := LibGraphMgt.CreateQueryTargetURL(Query::Microsoft.Projects.PowerBIReports."Job Ledger Entries", '');
UriBuilder.Init(TargetURL);
- UriBuilder.GetUri(Uri);
UriBuilder.AddODataQueryParameter('$filter', StrSubstNo('jobNo eq ''%1''', Job."No."));
+ UriBuilder.GetUri(Uri);
LibGraphMgt.GetFromWebService(Response, Uri.GetAbsoluteUri());
// [THEN] The response contains the job ledger entry information
@@ -255,11 +255,11 @@ codeunit 139879 "PowerBI Project Test"
Assert.AreEqual(JobLedgerEntry.Description, JsonMgt.GetValue('description'), 'Description did not match.');
Assert.AreEqual(JobLedgerEntry."Location Code", JsonMgt.GetValue('locationCode'), 'Location code did not match.');
Assert.AreEqual(JobLedgerEntry."Unit of Measure Code", JsonMgt.GetValue('unitOfMeasureCode'), 'Unit of measure code did not match.');
- Assert.AreEqual(Format(JobLedgerEntry.Quantity, 0, 9), JsonMgt.GetValue('quantity'), 'Quantity did not match.');
- Assert.AreEqual(Format(JobLedgerEntry."Unit Cost (LCY)", 0, 9), JsonMgt.GetValue('unitCostLCY'), 'Unit cost (LCY) did not match.');
- Assert.AreEqual(Format(JobLedgerEntry."Total Cost (LCY)", 0, 9), JsonMgt.GetValue('totalCostLCY'), 'Total cost (LCY) did not match.');
- Assert.AreEqual(Format(JobLedgerEntry."Unit Price", 0, 9), JsonMgt.GetValue('unitPrice'), 'Unit price did not match.');
- Assert.AreEqual(Format(JobLedgerEntry."Total Price (LCY)", 0, 9), JsonMgt.GetValue('totalPriceLCY'), 'Total price (LCY) did not match.');
+ Assert.AreNearlyEqual(JobLedgerEntry.Quantity, CastToDecimal(JsonMgt.GetValue('quantity')), 0.01, 'Quantity did not match.');
+ Assert.AreNearlyEqual(JobLedgerEntry."Unit Cost (LCY)", CastToDecimal(JsonMgt.GetValue('unitCostLCY')), 0.01, 'Unit cost (LCY) did not match.');
+ Assert.AreNearlyEqual(JobLedgerEntry."Total Cost (LCY)", CastToDecimal(JsonMgt.GetValue('totalCostLCY')), 0.01, 'Total cost (LCY) did not match.');
+ Assert.AreNearlyEqual(JobLedgerEntry."Unit Price", CastToDecimal(JsonMgt.GetValue('unitPrice')), 0.01, 'Unit price did not match.');
+ Assert.AreNearlyEqual(JobLedgerEntry."Total Price (LCY)", CastToDecimal(JsonMgt.GetValue('totalPriceLCY')), 0.01, 'Total price (LCY) did not match.');
Assert.AreEqual(Format(JobLedgerEntry."Dimension Set ID"), JsonMgt.GetValue('dimensionSetID'), 'Dimension set ID did not match.');
end;
@@ -282,8 +282,8 @@ codeunit 139879 "PowerBI Project Test"
// [WHEN] Get request for outstanding PO lines is made
TargetURL := LibGraphMgt.CreateQueryTargetURL(Query::"Purch. Lines - Job Outstanding", '');
UriBuilder.Init(TargetURL);
- UriBuilder.GetUri(Uri);
UriBuilder.AddODataQueryParameter('$filter', StrSubstNo('jobNo eq ''%1''', Job."No."));
+ UriBuilder.GetUri(Uri);
LibGraphMgt.GetFromWebService(Response, Uri.GetAbsoluteUri());
// [THEN] The response contains the outstanding PO line information
@@ -397,8 +397,8 @@ codeunit 139879 "PowerBI Project Test"
// [WHEN] Get request for received not invoiced PO lines is made
TargetURL := LibGraphMgt.CreateQueryTargetURL(Query::"Purch. Lines - Job Received", '');
UriBuilder.Init(TargetURL);
- UriBuilder.GetUri(Uri);
UriBuilder.AddODataQueryParameter('$filter', StrSubstNo('jobNo eq ''%1''', Job."No."));
+ UriBuilder.GetUri(Uri);
LibGraphMgt.GetFromWebService(Response, Uri.GetAbsoluteUri());
// [THEN] The response contains the received not invoiced PO line information
@@ -450,6 +450,14 @@ codeunit 139879 "PowerBI Project Test"
PurchLine.Modify(true);
end;
+ local procedure CastToDecimal(Value: Text) Output: Decimal
+ begin
+ if Value = '' then
+ exit(0);
+ Evaluate(Output, Value);
+ exit(Output);
+ end;
+
[ConfirmHandler]
procedure ConfirmHandler(Question: Text[1024]; var Reply: Boolean)
begin
diff --git a/Apps/W1/PowerBIReports/test/src/Codeunits/PowerBIPurchasesTest.Codeunit.al b/Apps/W1/PowerBIReports/test/src/Codeunits/PowerBIPurchasesTest.Codeunit.al
index 152eaa5d16..f398b71427 100644
--- a/Apps/W1/PowerBIReports/test/src/Codeunits/PowerBIPurchasesTest.Codeunit.al
+++ b/Apps/W1/PowerBIReports/test/src/Codeunits/PowerBIPurchasesTest.Codeunit.al
@@ -14,11 +14,11 @@ using Microsoft.Inventory.Analysis;
using Microsoft.Inventory.Ledger;
using Microsoft.PowerBIReports;
using Microsoft.Purchases.PowerBIReports;
+using System.TestLibraries.Security.AccessControl;
codeunit 139880 "PowerBI Purchases Test"
{
Subtype = Test;
- TestPermissions = Disabled;
Access = Internal;
var
@@ -30,6 +30,8 @@ codeunit 139880 "PowerBI Purchases Test"
LibRandom: Codeunit "Library - Random";
LibUtility: Codeunit "Library - Utility";
UriBuilder: Codeunit "Uri Builder";
+ PermissionsMock: Codeunit "Permissions Mock";
+ PowerBICoreTest: Codeunit "PowerBI Core Test";
ResponseEmptyErr: Label 'Response should not be empty.';
[Test]
@@ -264,11 +266,13 @@ codeunit 139880 "PowerBI Purchases Test"
Response: Text;
begin
// [GIVEN] Value entries exist outside of the query filter
+ PermissionsMock.Assign('SUPER');
if ItemLedgerEntry.FindLast() then;
ItemLedgerEntry.Init();
ItemLedgerEntry."Entry No." += 1;
ItemLedgerEntry."Entry Type" := ItemLedgerEntry."Entry Type"::Sale;
ItemLedgerEntry.Insert();
+ PermissionsMock.ClearAssignments();
if ValueEntry.FindLast() then;
ValueEntry."Entry No." += 1;
@@ -411,6 +415,7 @@ codeunit 139880 "PowerBI Purchases Test"
begin
// [SCENARIO] Test GenerateItemPurchasesReportDateFilter
// [GIVEN] Power BI setup record is created with Load Date Type = "Start/End Date"
+ PowerBICoreTest.AssignAdminPermissionSet();
RecreatePBISetup();
PBISetup."Item Purch. Load Date Type" := PBISetup."Item Purch. Load Date Type"::"Start/End Date";
@@ -418,6 +423,7 @@ codeunit 139880 "PowerBI Purchases Test"
PBISetup."Item Purch. Start Date" := Today();
PBISetup."Item Purch. End Date" := Today() + 10;
PBISetup.Modify();
+ PermissionsMock.ClearAssignments();
ExpectedFilterTxt := StrSubstNo('%1..%2', Today(), Today() + 10);
@@ -438,12 +444,14 @@ codeunit 139880 "PowerBI Purchases Test"
begin
// [SCENARIO] Test GenerateItemPurchasesReportDateFilter
// [GIVEN] Power BI setup record is created with Load Date Type = "Relative Date"
+ PowerBICoreTest.AssignAdminPermissionSet();
RecreatePBISetup();
PBISetup."Item Purch. Load Date Type" := PBISetup."Item Purch. Load Date Type"::"Relative Date";
// [GIVEN] A mock date formula value
Evaluate(PBISetup."Item Purch. Date Formula", '30D');
PBISetup.Modify();
+ PermissionsMock.ClearAssignments();
ExpectedFilterTxt := StrSubstNo('%1..', CalcDate(PBISetup."Item Purch. Date Formula"));
@@ -463,8 +471,11 @@ codeunit 139880 "PowerBI Purchases Test"
begin
// [SCENARIO] Test GenerateItemPurchasesReportDateFilter
// [GIVEN] Power BI setup record is created with Load Date Type = " "
+ PowerBICoreTest.AssignAdminPermissionSet();
RecreatePBISetup();
PBISetup."Item Purch. Load Date Type" := PBISetup."Item Purch. Load Date Type"::" ";
+ PBISetup.Modify();
+ PermissionsMock.ClearAssignments();
// [WHEN] GenerateItemPurchasesReportDateFilter executes
ActualFilterTxt := PBIMgt.GenerateItemPurchasesReportDateFilter();
diff --git a/Apps/W1/PowerBIReports/test/src/Codeunits/PowerBISalesTest.Codeunit.al b/Apps/W1/PowerBIReports/test/src/Codeunits/PowerBISalesTest.Codeunit.al
index 779a4cb25a..34fb710a35 100644
--- a/Apps/W1/PowerBIReports/test/src/Codeunits/PowerBISalesTest.Codeunit.al
+++ b/Apps/W1/PowerBIReports/test/src/Codeunits/PowerBISalesTest.Codeunit.al
@@ -14,11 +14,11 @@ using System.Text;
using Microsoft.Inventory.Item;
using Microsoft.PowerBIReports;
using Microsoft.Sales.PowerBIReports;
+using System.TestLibraries.Security.AccessControl;
codeunit 139881 "PowerBI Sales Test"
{
Subtype = Test;
- TestPermissions = Disabled;
Access = Internal;
var
@@ -29,6 +29,8 @@ codeunit 139881 "PowerBI Sales Test"
LibInv: Codeunit "Library - Inventory";
LibRandom: Codeunit "Library - Random";
UriBuilder: Codeunit "Uri Builder";
+ PermissionsMock: Codeunit "Permissions Mock";
+ PowerBICoreTest: Codeunit "PowerBI Core Test";
IsInitialized: Boolean;
ResponseEmptyErr: Label 'Response should not be empty.';
@@ -307,6 +309,7 @@ codeunit 139881 "PowerBI Sales Test"
begin
// [SCENARIO] Test GenerateItemSalesReportDateFilter
// [GIVEN] Power BI setup record is created with Load Date Type = "Start/End Date"
+ PowerBICoreTest.AssignAdminPermissionSet();
RecreatePBISetup();
PBISetup."Item Sales Load Date Type" := PBISetup."Item Sales Load Date Type"::"Start/End Date";
@@ -314,6 +317,7 @@ codeunit 139881 "PowerBI Sales Test"
PBISetup."Item Sales Start Date" := Today();
PBISetup."Item Sales End Date" := Today() + 10;
PBISetup.Modify();
+ PermissionsMock.ClearAssignments();
ExpectedFilterTxt := StrSubstNo('%1..%2', Today(), Today() + 10);
@@ -334,12 +338,14 @@ codeunit 139881 "PowerBI Sales Test"
begin
// [SCENARIO] Test GenerateItemSalesReportDateFilter
// [GIVEN] Power BI setup record is created with Load Date Type = "Relative Date"
+ PowerBICoreTest.AssignAdminPermissionSet();
RecreatePBISetup();
PBISetup."Item Sales Load Date Type" := PBISetup."Item Sales Load Date Type"::"Relative Date";
// [GIVEN] A mock date formula value
Evaluate(PBISetup."Item Sales Date Formula", '30D');
PBISetup.Modify();
+ PermissionsMock.ClearAssignments();
ExpectedFilterTxt := StrSubstNo('%1..', CalcDate(PBISetup."Item Sales Date Formula"));
@@ -359,8 +365,11 @@ codeunit 139881 "PowerBI Sales Test"
begin
// [SCENARIO] Test GenerateItemSalesReportDateFilter
// [GIVEN] Power BI setup record is created with Load Date Type = " "
+ PowerBICoreTest.AssignAdminPermissionSet();
RecreatePBISetup();
PBISetup."Item Sales Load Date Type" := PBISetup."Item Sales Load Date Type"::" ";
+ PBISetup.Modify();
+ PermissionsMock.ClearAssignments();
// [WHEN] GenerateItemSalesReportDateFilter executes
ActualFilterTxt := PBIMgt.GenerateItemSalesReportDateFilter();
diff --git a/Apps/W1/SAF-T/app/src/SAFTDataMgt.Codeunit.al b/Apps/W1/SAF-T/app/src/SAFTDataMgt.Codeunit.al
index e52d6599ec..eeb64b8e28 100644
--- a/Apps/W1/SAF-T/app/src/SAFTDataMgt.Codeunit.al
+++ b/Apps/W1/SAF-T/app/src/SAFTDataMgt.Codeunit.al
@@ -25,9 +25,6 @@ using Microsoft.Sales.History;
using Microsoft.Sales.Receivables;
using Microsoft.Service.History;
using System.Environment;
-#if not CLEAN23
-using System.Environment.Configuration;
-#endif
codeunit 5280 "SAF-T Data Mgt."
{
@@ -38,9 +35,6 @@ codeunit 5280 "SAF-T Data Mgt."
XMLFileNameSAFTTxt: label 'SAF-T Financial_%1_%2_%3_%4.xml', Comment = '%1 - VAT Reg No., %2 - date + time, %3 - number of file, %4 - total number of files', Locked = true;
ProductTxt: label 'Goods', Locked = true;
ServiceTxt: label 'Service', Locked = true;
-#if not CLEAN23
- FeatureNotEnabledMsg: label 'The %1 page is part of the new SAF-T feature, which is not enabled yet in your Business Central. An administrator can enable the feature on the Feature Management page.', Comment = '%1 - page caption';
-#endif
///
/// Returns the VAT Reporting Code that is used in cases when the VAT Reporting Code is not set in VAT Posting Setup.
@@ -678,31 +672,6 @@ codeunit 5280 "SAF-T Data Mgt."
exit(GLAccNo in [Currency."Unrealized Gains Acc.", Currency."Unrealized Losses Acc.", Currency."Realized Gains Acc.", Currency."Realized Losses Acc."]);
end;
-#if not CLEAN23
- [Obsolete('Feature will be enabled by default', '23.0')]
- internal procedure IsFeatureEnabled() IsEnabled: Boolean
- var
- FeatureMgtFacade: Codeunit "Feature Management Facade";
- begin
- IsEnabled := FeatureMgtFacade.IsEnabled(GetSAFTAuditFileExportFeatureKeyId());
- OnAfterCheckFeatureEnabled(IsEnabled);
- end;
-
- ///
- /// Returns the Feature Key Id for the SAF-T feature.
- ///
- [Obsolete('Feature will be enabled by default', '23.0')]
- procedure GetSAFTAuditFileExportFeatureKeyId(): Text[50]
- begin
- exit('SAFTAuditFileExport');
- end;
-
- [Obsolete('Feature will be enabled by default', '23.0')]
- internal procedure ShowNotEnabledMessage(PageCaption: Text)
- begin
- Message(FeatureNotEnabledMsg, PageCaption);
- end;
-#endif
local procedure InitShipToAddress(var ShipToAddress: Record "Ship-to Address"; Address: Text[100]; Address2: Text[50]; City: Text[30]; PostCode: Code[20]; CountryCode: Code[10])
begin
ShipToAddress.Init();
@@ -730,27 +699,4 @@ codeunit 5280 "SAF-T Data Mgt."
end;
end;
end;
-
-#if not CLEAN23
- [Obsolete('Feature will be enabled by default', '23.0')]
- [EventSubscriber(ObjectType::Codeunit, Codeunit::"Feature Management Facade", 'OnAfterFeatureEnableConfirmed', '', true, true)]
- local procedure OnAfterFeatureEnableConfirmed(var FeatureKey: Record "Feature Key")
- var
- SAFTWizard: Page "SAF-T Wizard";
- begin
- if FeatureKey.ID = GetSAFTAuditFileExportFeatureKeyId() then begin
- Commit();
- SAFTWizard.SetRunFromFeatureMgt();
- if SAFTWizard.RunModal() = Action::OK then
- if not SAFTWizard.IsSetupCompleted() then
- Error('');
- end;
- end;
-
- [Obsolete('Feature will be enabled by default.', '23.0')]
- [IntegrationEvent(true, false)]
- local procedure OnAfterCheckFeatureEnabled(var IsEnabled: Boolean)
- begin
- end;
-#endif
}
diff --git a/Apps/W1/SAF-T/app/src/Setup/SAFTWizard.Page.al b/Apps/W1/SAF-T/app/src/Setup/SAFTWizard.Page.al
index 2ea18344f0..e307d30f03 100644
--- a/Apps/W1/SAF-T/app/src/Setup/SAFTWizard.Page.al
+++ b/Apps/W1/SAF-T/app/src/Setup/SAFTWizard.Page.al
@@ -441,14 +441,6 @@ page 5280 "SAF-T Wizard"
AuditMappingHelper: Codeunit "Audit Mapping Helper";
MappingHelperSAFT: Codeunit "Mapping Helper SAF-T";
begin
-#if not CLEAN23
- if not SAFTDataMgt.IsFeatureEnabled() then
- if not IsRunFromFeatureMgt then begin
- SAFTDataMgt.ShowNotEnabledMessage(CurrPage.Caption());
- Error('');
- end;
-#endif
-
FeatureTelemetry.LogUptake('0000KTC', SAFTExportTok, Enum::"Feature Uptake Status"::Discovered);
Commit();
@@ -502,9 +494,6 @@ page 5280 "SAF-T Wizard"
SetupCompleted: Boolean;
DataUpgradeAgreed: Boolean;
DataUpgradeRequired: Boolean;
-#if not CLEAN23
- IsRunFromFeatureMgt: Boolean;
-#endif
StandardAccTypeNotSpecifiedErr: label 'A standard account type is not specified.';
SetupNotCompletedQst: label 'Set up SAF-T has not been completed.\\Are you sure that you want to exit?';
MappingSourceNotLoadedMsg: label 'A source for mapping was not loaded due to the following error: %1.', Comment = '%1 - error text';
@@ -843,12 +832,4 @@ page 5280 "SAF-T Wizard"
begin
VATStartingDateSetCount := MappingHelperSAFT.GetVATPostingSetupMappedCount();
end;
-
-#if not CLEAN23
- [Obsolete('Feature will be enabled by default.', '23.0')]
- procedure SetRunFromFeatureMgt()
- begin
- IsRunFromFeatureMgt := true;
- end;
-#endif
}
diff --git a/Apps/W1/SAF-T/test/src/SAFTTests.Codeunit.al b/Apps/W1/SAF-T/test/src/SAFTTests.Codeunit.al
index 9d5549419c..c3b8c1c0b8 100644
--- a/Apps/W1/SAF-T/test/src/SAFTTests.Codeunit.al
+++ b/Apps/W1/SAF-T/test/src/SAFTTests.Codeunit.al
@@ -40,6 +40,7 @@ codeunit 139511 "SAF-T Tests"
Initialize();
Customer.DeleteAll();
Vendor.DeleteAll();
+ ClearSourceCode();
// [GIVEN] Audit File Export Format "SAF-T" set up.
@@ -82,6 +83,7 @@ codeunit 139511 "SAF-T Tests"
// [SCENARIO 495176] "TransactionID" xml node contains the concatenated value of the "Posting Date" and "Document No." fields of the G/L Entry
Initialize();
GLEntry.DeleteAll();
+ ClearSourceCode();
// [GIVEN] Audit File Export Format "SAF-T" set up.
@@ -126,6 +128,7 @@ codeunit 139511 "SAF-T Tests"
VendorLedgerEntry.DeleteAll();
SalesInvoiceHeader.DeleteAll();
PurchInvHeader.DeleteAll();
+ ClearSourceCode();
// [GIVEN] Audit File Export Format "SAF-T" set up.
@@ -172,6 +175,7 @@ codeunit 139511 "SAF-T Tests"
Initialize();
GLEntry.DeleteAll();
+ ClearSourceCode();
SAFTTestsHelper.CreateGLAccMappingWithLine(GLAccountMappingLine);
@@ -227,6 +231,7 @@ codeunit 139511 "SAF-T Tests"
Initialize();
Vendor.DeleteAll();
VendLedgEntry.DeleteAll();
+ ClearSourceCode();
// [GIVEN] SAF-T Setup with "Starting Date" = 01.01.2023
SAFTTestsHelper.CreateGLAccMappingWithLine(GLAccountMappingLine);
@@ -275,6 +280,7 @@ codeunit 139511 "SAF-T Tests"
Initialize();
Vendor.DeleteAll();
VendLedgEntry.DeleteAll();
+ ClearSourceCode();
// [GIVEN] SAF-T Setup with "Starting Date" = 01.01.2023
SAFTTestsHelper.CreateGLAccMappingWithLine(GLAccountMappingLine);
@@ -326,6 +332,7 @@ codeunit 139511 "SAF-T Tests"
Initialize();
GLEntry.DeleteAll();
BankAccLedgEntry.DeleteAll();
+ ClearSourceCode();
// [GIVEN] Audit File Export Format "SAF-T" set up.
@@ -588,6 +595,17 @@ codeunit 139511 "SAF-T Tests"
LibraryXPathXMLReader.VerifyNodeValueByXPathWithIndex('/AuditFile/SourceDocuments/Payments/Payment/DocumentTotals/GrossTotal', GetSAFTMonetaryDecimal(GenJournalLineVend.Amount), 1);
end;
+ local procedure ClearSourceCode()
+ var
+ SourceCode: Record "Source Code";
+ begin
+ SourceCode.SetRange("Source Code SAF-T", '');
+ if SourceCode.IsEmpty() then
+ exit;
+
+ SourceCode.DeleteAll();
+ end;
+
[ConfirmHandler]
procedure ConfirmHandlerYes(Question: Text[1024]; var Reply: Boolean)
begin
diff --git a/Apps/W1/SAF-T/test/src/SAFTTestsHelper.Codeunit.al b/Apps/W1/SAF-T/test/src/SAFTTestsHelper.Codeunit.al
index 2bebb822b4..d40684661b 100644
--- a/Apps/W1/SAF-T/test/src/SAFTTestsHelper.Codeunit.al
+++ b/Apps/W1/SAF-T/test/src/SAFTTestsHelper.Codeunit.al
@@ -216,26 +216,4 @@ codeunit 139512 "SAF-T Tests Helper"
DetailedVendorLedgEntry."Amount (LCY)" := AmountLCY;
DetailedVendorLedgEntry.Insert();
end;
-
-#if not CLEAN23
- [EventSubscriber(ObjectType::Codeunit, Codeunit::"Feature Management Facade", 'OnInitializeFeatureDataUpdateStatus', '', false, false)]
- local procedure EnableSIEFeatureOnInitializeFeatureDataUpdateStatus(var FeatureDataUpdateStatus: Record "Feature Data Update Status"; var InitializeHandled: Boolean)
- var
- FeatureKey: Record "Feature Key";
- SAFTDataMgt: Codeunit "SAF-T Data Mgt.";
- begin
- if FeatureDataUpdateStatus."Feature Key" <> SAFTDataMgt.GetSAFTAuditFileExportFeatureKeyId() then
- exit;
-
- if FeatureDataUpdateStatus."Company Name" <> CopyStr(CompanyName(), 1, MaxStrLen(FeatureDataUpdateStatus."Company Name")) then
- exit;
-
- FeatureDataUpdateStatus."Feature Status" := FeatureDataUpdateStatus."Feature Status"::Enabled;
-
- FeatureKey.Get(FeatureDataUpdateStatus."Feature Key");
- FeatureKey.Enabled := FeatureKey.Enabled::"All Users";
- FeatureKey.Modify();
- InitializeHandled := true;
- end;
-#endif
}
diff --git a/Apps/W1/SalesLinesSuggestions/app/BaseAppExtensions/SalesInvoiceSubFormExt.PageExt.al b/Apps/W1/SalesLinesSuggestions/app/BaseAppExtensions/SalesInvoiceSubFormExt.PageExt.al
index d6f0c225d6..3f185be12b 100644
--- a/Apps/W1/SalesLinesSuggestions/app/BaseAppExtensions/SalesInvoiceSubFormExt.PageExt.al
+++ b/Apps/W1/SalesLinesSuggestions/app/BaseAppExtensions/SalesInvoiceSubFormExt.PageExt.al
@@ -5,7 +5,7 @@
namespace Microsoft.Sales.Document;
using Microsoft.Sales.Document.Attachment;
-using System.Environment;
+using System.AI;
pageextension 7277 "Sales Invoice Sub Form Ext" extends "Sales Invoice Subform"
{
@@ -19,6 +19,8 @@ pageextension 7277 "Sales Invoice Sub Form Ext" extends "Sales Invoice Subform"
Caption = 'Suggest sales lines';
Image = SparkleFilled;
ToolTip = 'Get sales lines suggestions from Copilot';
+ Enabled = IsCapabilityRegistered;
+ Visible = IsCapabilityRegistered;
trigger OnAction()
begin
@@ -32,6 +34,8 @@ pageextension 7277 "Sales Invoice Sub Form Ext" extends "Sales Invoice Subform"
Ellipsis = true;
Image = SparkleFilled;
ToolTip = 'Get sales lines from file with Copilot';
+ Enabled = IsCapabilityRegistered;
+ Visible = IsCapabilityRegistered;
trigger OnAction()
begin
@@ -39,52 +43,48 @@ pageextension 7277 "Sales Invoice Sub Form Ext" extends "Sales Invoice Subform"
end;
}
}
+#if not CLEAN25
addlast(processing)
{
group("Copilot")
{
Image = SparkleFilled;
ShowAs = SplitButton;
- Visible = IsOnPrem;
+ Visible = false;
+ ObsoleteReason = 'Replaced by Suggest Sales Line Prompting';
+ ObsoleteState = Pending;
+ ObsoleteTag = '25.0';
action("Suggest Sales Lines")
{
ApplicationArea = All;
Caption = 'Suggest sales lines';
Image = SparkleFilled;
ToolTip = 'Get sales lines suggestions from Copilot';
+ Visible = false;
+ ObsoleteReason = 'Replaced by Suggest Sales Line Prompting';
+ ObsoleteState = Pending;
+ ObsoleteTag = '25.0';
trigger OnAction()
begin
SalesLineAISuggestionImp.GetLinesSuggestions(Rec);
end;
}
- action(Attach)
- {
- ApplicationArea = All;
- Caption = 'Suggest sales lines from file';
- Ellipsis = true;
- Image = SparkleFilled;
- ToolTip = 'Get sales lines from file with Copilot';
-
- trigger OnAction()
- begin
- SalesLineFromAttachment.AttachAndSuggest(Rec);
- end;
- }
}
}
+#endif
}
var
SalesLineAISuggestionImp: Codeunit "Sales Lines Suggestions Impl.";
SalesLineFromAttachment: Codeunit "Sales Line From Attachment";
- IsOnPrem: Boolean;
+ IsCapabilityRegistered: Boolean;
trigger OnOpenPage()
var
- EnvironmentT: Codeunit "Environment Information";
+ CopilotCapability: Codeunit "Copilot Capability";
begin
- IsOnPrem := EnvironmentT.IsOnPrem();
+ IsCapabilityRegistered := CopilotCapability.IsCapabilityRegistered(Enum::"Copilot Capability"::"Sales Lines Suggestions");
end;
}
\ No newline at end of file
diff --git a/Apps/W1/SalesLinesSuggestions/app/BaseAppExtensions/SalesOrderSubFormExt.PageExt.al b/Apps/W1/SalesLinesSuggestions/app/BaseAppExtensions/SalesOrderSubFormExt.PageExt.al
index 9474137720..7eb7751b43 100644
--- a/Apps/W1/SalesLinesSuggestions/app/BaseAppExtensions/SalesOrderSubFormExt.PageExt.al
+++ b/Apps/W1/SalesLinesSuggestions/app/BaseAppExtensions/SalesOrderSubFormExt.PageExt.al
@@ -5,7 +5,7 @@
namespace Microsoft.Sales.Document;
using Microsoft.Sales.Document.Attachment;
-using System.Environment;
+using System.AI;
pageextension 7278 "Sales Order Sub Form Ext" extends "Sales Order Subform"
{
@@ -19,6 +19,8 @@ pageextension 7278 "Sales Order Sub Form Ext" extends "Sales Order Subform"
Caption = 'Suggest sales lines';
Image = SparkleFilled;
ToolTip = 'Get sales lines suggestions from Copilot';
+ Enabled = IsCapabilityRegistered;
+ Visible = IsCapabilityRegistered;
trigger OnAction()
begin
@@ -32,6 +34,8 @@ pageextension 7278 "Sales Order Sub Form Ext" extends "Sales Order Subform"
Ellipsis = true;
Image = SparkleFilled;
ToolTip = 'Get sales lines from file with Copilot';
+ Enabled = IsCapabilityRegistered;
+ Visible = IsCapabilityRegistered;
trigger OnAction()
begin
@@ -39,13 +43,17 @@ pageextension 7278 "Sales Order Sub Form Ext" extends "Sales Order Subform"
end;
}
}
+#if not CLEAN25
addlast(processing)
{
group("Copilot")
{
Image = SparkleFilled;
ShowAs = SplitButton;
- Visible = IsOnPrem;
+ Visible = false;
+ ObsoleteReason = 'Replaced by Suggest Sales Line Prompting';
+ ObsoleteState = Pending;
+ ObsoleteTag = '25.0';
action("Suggest Sales Lines")
{
@@ -53,38 +61,30 @@ pageextension 7278 "Sales Order Sub Form Ext" extends "Sales Order Subform"
Caption = 'Suggest sales lines';
Image = SparkleFilled;
ToolTip = 'Get sales lines suggestions from Copilot';
+ Visible = false;
+ ObsoleteReason = 'Replaced by Suggest Sales Line Prompting';
+ ObsoleteState = Pending;
+ ObsoleteTag = '25.0';
trigger OnAction()
begin
SalesLineAISuggestionImp.GetLinesSuggestions(Rec);
end;
}
- action(Attach)
- {
- ApplicationArea = All;
- Caption = 'Suggest sales lines from file';
- Ellipsis = true;
- Image = SparkleFilled;
- ToolTip = 'Get sales lines from file with Copilot';
-
- trigger OnAction()
- begin
- SalesLineFromAttachment.AttachAndSuggest(Rec);
- end;
- }
}
}
+#endif
}
var
SalesLineAISuggestionImp: Codeunit "Sales Lines Suggestions Impl.";
SalesLineFromAttachment: Codeunit "Sales Line From Attachment";
- IsOnPrem: Boolean;
+ IsCapabilityRegistered: Boolean;
trigger OnOpenPage()
var
- EnvironmentT: Codeunit "Environment Information";
+ CopilotCapability: Codeunit "Copilot Capability";
begin
- IsOnPrem := EnvironmentT.IsOnPrem();
+ IsCapabilityRegistered := CopilotCapability.IsCapabilityRegistered(Enum::"Copilot Capability"::"Sales Lines Suggestions");
end;
}
\ No newline at end of file
diff --git a/Apps/W1/SalesLinesSuggestions/app/BaseAppExtensions/SalesQuoteSubFormExt.PageExt.al b/Apps/W1/SalesLinesSuggestions/app/BaseAppExtensions/SalesQuoteSubFormExt.PageExt.al
index 193c18d09e..95079435b6 100644
--- a/Apps/W1/SalesLinesSuggestions/app/BaseAppExtensions/SalesQuoteSubFormExt.PageExt.al
+++ b/Apps/W1/SalesLinesSuggestions/app/BaseAppExtensions/SalesQuoteSubFormExt.PageExt.al
@@ -5,7 +5,7 @@
namespace Microsoft.Sales.Document;
using Microsoft.Sales.Document.Attachment;
-using System.Environment;
+using System.AI;
pageextension 7279 "Sales Quote Sub Form Ext" extends "Sales Quote Subform"
{
@@ -19,6 +19,8 @@ pageextension 7279 "Sales Quote Sub Form Ext" extends "Sales Quote Subform"
Caption = 'Suggest sales lines';
Image = SparkleFilled;
ToolTip = 'Get sales lines suggestions from Copilot';
+ Enabled = IsCapabilityRegistered;
+ Visible = IsCapabilityRegistered;
trigger OnAction()
begin
@@ -32,6 +34,8 @@ pageextension 7279 "Sales Quote Sub Form Ext" extends "Sales Quote Subform"
Ellipsis = true;
Image = SparkleFilled;
ToolTip = 'Get sales lines from file with Copilot';
+ Enabled = IsCapabilityRegistered;
+ Visible = IsCapabilityRegistered;
trigger OnAction()
begin
@@ -39,52 +43,49 @@ pageextension 7279 "Sales Quote Sub Form Ext" extends "Sales Quote Subform"
end;
}
}
+#if not CLEAN25
addlast(processing)
{
group("Copilot")
{
Image = SparkleFilled;
ShowAs = SplitButton;
- Visible = IsOnPrem;
+ Visible = false;
+ ObsoleteReason = 'Replaced by Suggest Sales Line Prompting';
+ ObsoleteState = Pending;
+ ObsoleteTag = '25.0';
+
action("Suggest Sales Lines")
{
ApplicationArea = All;
Caption = 'Suggest sales lines';
Image = SparkleFilled;
ToolTip = 'Get sales lines suggestions from Copilot';
+ Visible = false;
+ ObsoleteReason = 'Replaced by Suggest Sales Line Prompting';
+ ObsoleteState = Pending;
+ ObsoleteTag = '25.0';
trigger OnAction()
begin
SalesLineAISuggestionImp.GetLinesSuggestions(Rec);
end;
}
- action(Attach)
- {
- ApplicationArea = All;
- Caption = 'Suggest sales lines from file';
- Ellipsis = true;
- Image = SparkleFilled;
- ToolTip = 'Get sales lines from file with Copilot';
-
- trigger OnAction()
- begin
- SalesLineFromAttachment.AttachAndSuggest(Rec);
- end;
- }
}
}
+#endif
}
var
SalesLineAISuggestionImp: Codeunit "Sales Lines Suggestions Impl.";
SalesLineFromAttachment: Codeunit "Sales Line From Attachment";
- IsOnPrem: Boolean;
+ IsCapabilityRegistered: Boolean;
trigger OnOpenPage()
var
- EnvironmentT: Codeunit "Environment Information";
+ CopilotCapability: Codeunit "Copilot Capability";
begin
- IsOnPrem := EnvironmentT.IsOnPrem();
+ IsCapabilityRegistered := CopilotCapability.IsCapabilityRegistered(Enum::"Copilot Capability"::"Sales Lines Suggestions");
end;
}
\ No newline at end of file
diff --git a/Apps/W1/SalesLinesSuggestions/app/SLSPrompts.Codeunit.al b/Apps/W1/SalesLinesSuggestions/app/SLSPrompts.Codeunit.al
index 9d844440dd..72f1c4cfc1 100644
--- a/Apps/W1/SalesLinesSuggestions/app/SLSPrompts.Codeunit.al
+++ b/Apps/W1/SalesLinesSuggestions/app/SLSPrompts.Codeunit.al
@@ -34,15 +34,6 @@ codeunit 7276 "SLS Prompts"
exit(SecretStrSubstNo('%1%2', BCSLSMetaPrompt, AddDateToTaskPrompt(BCSLSTaskPrompt)));
end;
- internal procedure GetSLSDocumentLookupPrompt(): SecretText
- var
- BCSLSDocumentLookupPrompt: SecretText;
- begin
- GetAzureKeyVaultSecret(BCSLSDocumentLookupPrompt, 'BCSLSDocumentLookupPrompt');
-
- exit(BCSLSDocumentLookupPrompt);
- end;
-
internal procedure GetSLSSearchItemsWithFiltersPrompt(): SecretText
var
BCSLSSearchItemsWithFiltersPrompt: SecretText;
@@ -52,15 +43,6 @@ codeunit 7276 "SLS Prompts"
exit(BCSLSSearchItemsWithFiltersPrompt);
end;
- internal procedure GetSLSSearchItemPrompt(): SecretText
- var
- BCSLSSearchItemPrompt: SecretText;
- begin
- GetAzureKeyVaultSecret(BCSLSSearchItemPrompt, 'BCSLSSearchItemPrompt');
-
- exit(BCSLSSearchItemPrompt);
- end;
-
internal procedure GetSLSMagicFunctionPrompt(): SecretText
var
BCSLSMagicFunctionPrompt: SecretText;
@@ -90,15 +72,6 @@ codeunit 7276 "SLS Prompts"
exit(BCSLSParseCsvPrompt);
end;
- internal procedure GetParsingCsvTemplateUserInputPrompt(): SecretText
- var
- BCSLSParseCsvTemplateUserInputPrompt: SecretText;
- begin
- GetAzureKeyVaultSecret(BCSLSParseCsvTemplateUserInputPrompt, 'BCSLSParseCsvTemplateUserInputPrompt');
-
- exit(BCSLSParseCsvTemplateUserInputPrompt);
- end;
-
internal procedure GetProductFromCsvTemplateUserInputPrompt(): SecretText
var
BCSLSGetProductFromCsvTemplateUserInputPrompt: SecretText;
diff --git a/Apps/W1/SalesLinesSuggestions/app/SalesAzureOpenAITools/FunctionsImpl/DocumentLookupFunction.Codeunit.al b/Apps/W1/SalesLinesSuggestions/app/SalesAzureOpenAITools/FunctionsImpl/DocumentLookupFunction.Codeunit.al
deleted file mode 100644
index 4d3aa91a93..0000000000
--- a/Apps/W1/SalesLinesSuggestions/app/SalesAzureOpenAITools/FunctionsImpl/DocumentLookupFunction.Codeunit.al
+++ /dev/null
@@ -1,221 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-namespace Microsoft.Sales.Document;
-
-using System.AI;
-using System.Telemetry;
-using Microsoft.Inventory.Item;
-using System.Text;
-
-codeunit 7283 "Document Lookup Function" implements "AOAI Function"
-{
- Access = Internal;
-
- var
- SourceDocumentRecordId: RecordId;
- SearchQuery: Text;
- SearchStyle: Enum "Search Style";
- FunctionNameLbl: Label 'lookup_from_document', Locked = true;
- DocumentLookUpLbl: Label 'function_call: lookup_from_document', Locked = true;
- SourceDocumentRecordIDLbl: Label 'SourceDocumentRecordID', Locked = true;
-
- [NonDebuggable]
- procedure GetPrompt(): JsonObject
- var
- Prompt: Codeunit "SLS Prompts";
- PromptJson: JsonObject;
- begin
- PromptJson.ReadFrom(Prompt.GetSLSDocumentLookupPrompt().Unwrap());
- exit(PromptJson);
- end;
-
- [NonDebuggable]
- procedure Execute(Arguments: JsonObject): Variant
- var
- TempSalesLineAiSuggestionFromDocLookup: Record "Sales Line AI Suggestions" temporary;
- TempSalesLineAiSuggestionFromItemSearch: Record "Sales Line AI Suggestions" temporary;
- TempSalesLineAiSuggestionFiltered: Record "Sales Line AI Suggestions" temporary;
- Item: Record Item;
- SalesLineAISuggestionImpl: Codeunit "Sales Lines Suggestions Impl.";
- FeatureTelemetry: Codeunit "Feature Telemetry";
- NotificationManager: Codeunit "Notification Manager";
- SearchUtility: Codeunit "Search";
- SelectionFilterManagement: Codeunit SelectionFilterManagement;
- FeatureTelemetryCD: Dictionary of [Text, Text];
- DocLookupType: Enum "Document Lookup Types";
- DocumentLookupSubType: Interface DocumentLookupSubType;
- ItemsResults: JsonToken;
- ItemResultsArray: JsonArray;
- DocumentNo: Text;
- StartDateTxt: Text;
- EndDateTxt: Text;
- ItemNoFilter: Text;
- SearchIntentLbl: Label 'Add products to a sales order.', Locked = true;
- begin
- if Arguments.Get('results', ItemsResults) then begin
- ItemResultsArray := ItemsResults.AsArray();
-
- if not GetDetailsFromUserQuery(DocumentNo, StartDateTxt, EndDateTxt, DocLookupType, ItemResultsArray) then begin
- FeatureTelemetry.LogError('0000MDX', SalesLineAISuggestionImpl.GetFeatureName(), DocumentLookUpLbl, 'Error in retrieving filters from user query', GetLastErrorCallStack());
- NotificationManager.SendNotification(GetLastErrorText());
- exit(TempSalesLineAiSuggestionFromDocLookup);
- end;
-
- DocumentLookupSubType := DocLookupType;
- FeatureTelemetryCD.Add('Document Type', DocLookupType.Names().Get(DocLookupType.Ordinals.IndexOf(DocLookupType.AsInteger())));
-
- if SearchSalesDocument(TempSalesLineAiSuggestionFromDocLookup, DocumentLookupSubType, Format(SourceDocumentRecordId), DocumentNo, StartDateTxt, EndDateTxt) then begin
- FeatureTelemetry.LogUsage('0000ME0', SalesLineAISuggestionImpl.GetFeatureName(), DocumentLookUpLbl, FeatureTelemetryCD);
- if TempSalesLineAiSuggestionFromDocLookup.Count = 0 then
- NotificationManager.SendNotification(SalesLineAISuggestionImpl.GetNoSalesLinesSuggestionsMsg());
- end
- else begin
- FeatureTelemetry.LogError('0000MDZ', SalesLineAISuggestionImpl.GetFeatureName(), DocumentLookUpLbl, 'Document lookup resulted in an error', GetLastErrorCallStack(), FeatureTelemetryCD);
- NotificationManager.SendNotification(GetLastErrorText());
- end;
- end
- else begin
- FeatureTelemetry.LogError('0000MML', SalesLineAISuggestionImpl.GetFeatureName(), 'Process Document Lookup', 'results not found in tools object.');
- NotificationManager.SendNotification(SalesLineAISuggestionImpl.GetChatCompletionResponseErr());
- end;
-
- // Check to see if there is a need to do a item search as well
- if Arguments.Get('search_items', ItemsResults) then begin
- FeatureTelemetry.LogUsage('0000MVF', SalesLineAISuggestionImpl.GetFeatureName(), DocumentLookUpLbl + ' Item Search in document.');
-
- ItemResultsArray := ItemsResults.AsArray();
-
- if not TempSalesLineAiSuggestionFromDocLookup.IsEmpty() then begin
- if TempSalesLineAiSuggestionFromDocLookup.FindSet() then
- repeat
- if Item.Get(TempSalesLineAiSuggestionFromDocLookup."No.") then
- Item.Mark(true);
- until TempSalesLineAiSuggestionFromDocLookup.Next() = 0;
- Item.MarkedOnly(true);
- ItemNoFilter := SelectionFilterManagement.GetSelectionFilterForItem(Item);
- end;
- if SearchUtility.SearchMultiple(ItemResultsArray, SearchStyle, SearchIntentLbl, SearchQuery, 1, 25, false, true, TempSalesLineAiSuggestionFromItemSearch, ItemNoFilter) then begin
- if TempSalesLineAiSuggestionFromItemSearch.Count = 0 then begin
- FeatureTelemetry.LogError('0000MVH', SalesLineAISuggestionImpl.GetFeatureName(), 'Process Document Lookup', 'Item search inside document returned no items.');
- NotificationManager.SendNotification(SalesLineAISuggestionImpl.GetNoSalesLinesSuggestionsMsg());
- exit(TempSalesLineAiSuggestionFromItemSearch);
- end;
- TempSalesLineAiSuggestionFromItemSearch.FindSet();
- repeat
- TempSalesLineAiSuggestionFromDocLookup.SetRange("No.", TempSalesLineAiSuggestionFromItemSearch."No.");
- if TempSalesLineAiSuggestionFromDocLookup.FindSet() then
- repeat
- TempSalesLineAiSuggestionFiltered.Init();
- TempSalesLineAiSuggestionFiltered.Copy(TempSalesLineAiSuggestionFromDocLookup);
- TempSalesLineAiSuggestionFiltered.Quantity := TempSalesLineAiSuggestionFromItemSearch.Quantity;
- TempSalesLineAiSuggestionFiltered.Insert();
- until TempSalesLineAiSuggestionFromDocLookup.Next() = 0;
- until TempSalesLineAiSuggestionFromItemSearch.Next() = 0;
- TempSalesLineAiSuggestionFiltered.Reset();
- FeatureTelemetry.LogUsage('0000MVG', SalesLineAISuggestionImpl.GetFeatureName(), 'Process Document Lookup' + ': Item Search inside document returned items.');
- exit(TempSalesLineAiSuggestionFiltered);
- end
- else begin
- FeatureTelemetry.LogError('0000MVE', SalesLineAISuggestionImpl.GetFeatureName(), 'Process Document Lookup', 'Item search inside document returned no items.');
- NotificationManager.SendNotification(SalesLineAISuggestionImpl.GetChatCompletionResponseErr());
- end;
- end;
-
- exit(TempSalesLineAiSuggestionFromDocLookup);
- end;
-
- procedure GetName(): Text
- begin
- exit(FunctionNameLbl);
- end;
-
- procedure SetSearchQuery(NewSearchQuery: Text)
- begin
- SearchQuery := NewSearchQuery;
- end;
-
- procedure SetSearchStyle(NewSearchStyle: Enum "Search Style")
- begin
- SearchStyle := NewSearchStyle;
- end;
-
- procedure SetSourceDocumentRecordId(NewSourceDocumentRecordId: RecordId)
- begin
- SourceDocumentRecordId := NewSourceDocumentRecordId;
- end;
-
- [TryFunction]
- local procedure SearchSalesDocument(var TempSalesLineAiSuggestion: Record "Sales Line AI Suggestions" temporary; var DocumentLookupSubType: Interface DocumentLookupSubType; SourceDocumentRecordIdText: Text; DocumentNo: Text; StartDateTxt: Text; EndDateTxt: Text)
- begin
- DocumentLookupSubType.SearchSalesDocument(AddParametersToCustomDimension(SourceDocumentRecordIdText, DocumentNo, StartDateTxt, EndDateTxt), TempSalesLineAiSuggestion);
- end;
-
- local procedure AddParametersToCustomDimension(SourceDocumentRecordIdText: Text; DocumentNo: Text; StartDateStr: Text; EndDateStr: Text): Dictionary of [Text, Text]
- var
- CustomDimension: Dictionary of [Text, Text];
- begin
- CustomDimension.Add(SourceDocumentRecordIDLbl, SourceDocumentRecordIdText);
- CustomDimension.Add('DocumentNo', DocumentNo);
- CustomDimension.Add('StartDateStr', StartDateStr);
- CustomDimension.Add('EndDateStr', EndDateStr);
- exit(CustomDimension);
- end;
-
- internal procedure GetParametersFromCustomDimension(CustomDimension: Dictionary of [Text, Text]; var SourceSalesHeader: Record "Sales Header"; var DocumentNo: Text; var StartDateStr: Text; var EndDateStr: Text)
- var
- SourceSalesHeaderRecId: RecordId;
- SourceDocumentRecIdTxt: Text;
- begin
- SourceDocumentRecIdTxt := CustomDimension.Get(SourceDocumentRecordIDLbl);
- if SourceDocumentRecIdTxt <> '' then begin
- SourceSalesHeader.SetLoadFields("No.", "Sell-to Customer No.", "Sell-to Customer Name");
- Evaluate(SourceSalesHeaderRecId, SourceDocumentRecIdTxt);
- if SourceSalesHeaderRecId.TableNo = Database::"Sales Header" then begin
- SourceSalesHeaderRecId.GetRecord().SetTable(SourceSalesHeader);
- SourceSalesHeader.Get(SourceSalesHeader."Document Type", SourceSalesHeader."No.");
- end;
- end;
- DocumentNo := CustomDimension.Get('DocumentNo');
- StartDateStr := CustomDimension.Get('StartDateStr');
- EndDateStr := CustomDimension.Get('EndDateStr');
- end;
-
- [TryFunction]
- local procedure GetDetailsFromUserQuery(var DocumentNo: Text; var StartDate: Text; var EndDate: Text; var DocLookupSubType: Enum "Document Lookup Types"; ItemResultsArray: JsonArray)
- var
- JsonItem: JsonToken;
- DocumentNoToken: JsonToken;
- DocumentTypeToken: JsonToken;
- UnknownDocTypeErr: Label 'Copilot does not support the specified document type. Please rephrase the description';
- NoDocumentFoundErr: Label 'Copilot could not find the document. Please rephrase the description';
- begin
- if ItemResultsArray.Get(0, JsonItem) then
- if JsonItem.AsObject().Get('document_type', DocumentTypeToken) then begin
- case DocumentTypeToken.AsValue().AsText() of
- 'sales_order':
- DocLookupSubType := DocLookupSubType::"Sales Order";
- 'sales_invoice':
- DocLookupSubType := DocLookupSubType::"Posted Sales Invoice";
- 'sales_shipment':
- DocLookupSubType := DocLookupSubType::"Posted Sales Shipment";
- 'sales_quote':
- DocLookupSubType := DocLookupSubType::"Sales Quote";
- else
- Error(UnknownDocTypeErr);
- end;
-
- if JsonItem.AsObject().Get('document_no', DocumentNoToken) then
- DocumentNo := DocumentNoToken.AsValue().AsText();
-
- if JsonItem.AsObject().Get('start_date', DocumentTypeToken) then
- StartDate := DocumentTypeToken.AsValue().AsText();
-
- if JsonItem.AsObject().Get('end_date', DocumentTypeToken) then
- EndDate := DocumentTypeToken.AsValue().AsText();
- end else
- Error(NoDocumentFoundErr);
- end;
-
-}
\ No newline at end of file
diff --git a/Apps/W1/SalesLinesSuggestions/app/SalesAzureOpenAITools/FunctionsImpl/SearchItemsFunction.Codeunit.al b/Apps/W1/SalesLinesSuggestions/app/SalesAzureOpenAITools/FunctionsImpl/SearchItemsFunction.Codeunit.al
deleted file mode 100644
index 6088e37626..0000000000
--- a/Apps/W1/SalesLinesSuggestions/app/SalesAzureOpenAITools/FunctionsImpl/SearchItemsFunction.Codeunit.al
+++ /dev/null
@@ -1,76 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-namespace Microsoft.Sales.Document;
-
-using System.AI;
-using System.Telemetry;
-
-codeunit 7285 "Search Items Function" implements "AOAI Function"
-{
- Access = Internal;
-
- var
- SearchQuery: Text;
- SearchStyle: Enum "Search Style";
- FunctionNameLbl: Label 'search_items', Locked = true;
- SearchItemsLbl: Label 'function_call: search_items', Locked = true;
-
- [NonDebuggable]
- procedure GetPrompt(): JsonObject
- var
- Prompt: Codeunit "SLS Prompts";
- PromptJson: JsonObject;
- begin
- PromptJson.ReadFrom(Prompt.GetSLSSearchItemPrompt().Unwrap());
- exit(PromptJson);
- end;
-
- [NonDebuggable]
- procedure Execute(Arguments: JsonObject): Variant
- var
- TempSalesLineAiSuggestion: Record "Sales Line AI Suggestions" temporary;
- SearchUtility: Codeunit "Search";
- FeatureTelemetry: Codeunit "Feature Telemetry";
- SalesLineAISuggestionImpl: Codeunit "Sales Lines Suggestions Impl.";
- NotificationManager: Codeunit "Notification Manager";
- ItemsResults: JsonToken;
- ItemResultsArray: JsonArray;
- SearchIntentLbl: Label 'Add products to a sales order.', Locked = true;
- begin
- if Arguments.Get('results', ItemsResults) then begin
- ItemResultsArray := ItemsResults.AsArray();
- if SearchUtility.SearchMultiple(ItemResultsArray, SearchStyle, SearchIntentLbl, SearchQuery, 1, 25, false, true, TempSalesLineAiSuggestion, '') then begin
- FeatureTelemetry.LogUsage('0000ME2', SalesLineAISuggestionImpl.GetFeatureName(), SearchItemsLbl);
- if TempSalesLineAiSuggestion.Count = 0 then
- NotificationManager.SendNotification(SalesLineAISuggestionImpl.GetNoSalesLinesSuggestionsMsg());
- end
- else begin
- FeatureTelemetry.LogError('0000ME1', SalesLineAISuggestionImpl.GetFeatureName(), SearchItemsLbl, 'Search API resulted in an error', GetLastErrorCallStack());
- NotificationManager.SendNotification(SalesLineAISuggestionImpl.GetChatCompletionResponseErr());
- end;
- end
- else begin
- FeatureTelemetry.LogError('0000ML5', SalesLineAISuggestionImpl.GetFeatureName(), 'Process Search Item', 'results not found in tools object.');
- NotificationManager.SendNotification(SalesLineAISuggestionImpl.GetChatCompletionResponseErr());
- end;
-
- exit(TempSalesLineAiSuggestion);
- end;
-
- procedure GetName(): Text
- begin
- exit(FunctionNameLbl);
- end;
-
- procedure SetSearchQuery(NewSearchQuery: Text)
- begin
- SearchQuery := NewSearchQuery;
- end;
-
- procedure SetSearchStyle(NewSearchStyle: Enum "Search Style")
- begin
- SearchStyle := NewSearchStyle;
- end;
-}
\ No newline at end of file
diff --git a/Apps/W1/SalesLinesSuggestions/test/AI Tests/MagicFunctionPromptTest.Codeunit.al b/Apps/W1/SalesLinesSuggestions/test/AI Tests/MagicFunctionPromptTest.Codeunit.al
index e4e3aacec8..3f6d97f63c 100644
--- a/Apps/W1/SalesLinesSuggestions/test/AI Tests/MagicFunctionPromptTest.Codeunit.al
+++ b/Apps/W1/SalesLinesSuggestions/test/AI Tests/MagicFunctionPromptTest.Codeunit.al
@@ -33,7 +33,7 @@ codeunit 149800 "Magic Function Prompt Test"
// [WHEN] Sales lines are suggested based on the question from the dataset
SalesLineAISuggestionsPage.Trap();
- SalesOrderPage.SalesLines."Suggest Sales Lines".Invoke();
+ SalesOrderPage.SalesLines."Suggest Sales Lines Prompting".Invoke();
SalesLineAISuggestionsPage.SearchQueryTxt.SetValue(AITestContext.GetQuestion().ValueAsText());
SalesLineAISuggestionsPage.Generate.Invoke(); // AssertErrorNotificationHandler will be called
diff --git a/Apps/W1/ServiceDeclaration/app/src/Processing/ServiceDeclarationMgt.Codeunit.al b/Apps/W1/ServiceDeclaration/app/src/Processing/ServiceDeclarationMgt.Codeunit.al
index 60f5fc6cd6..49521fa22a 100644
--- a/Apps/W1/ServiceDeclaration/app/src/Processing/ServiceDeclarationMgt.Codeunit.al
+++ b/Apps/W1/ServiceDeclaration/app/src/Processing/ServiceDeclarationMgt.Codeunit.al
@@ -35,9 +35,6 @@ codeunit 5012 "Service Declaration Mgt."
var
TransactionTypeCodeNotSpecifiedInLineErr: Label 'A service transaction type code is not specified in the line no. %1 with %2 %3', Comment = '%1 = number of line;%2 = type of the line (item, resource, etc.);%3 = item/resource code';
-#if not CLEAN23
- FeatureNotEnabledMessageTxt: Label 'The %1 page is part of the new Service Declaration feature, which is not yet enabled in your Business Central. An administrator can enable the feature on the Feature Management page.', Comment = '%1 - page caption';
-#endif
ServDeclLbl: Label 'Service Declaration';
AssistedSetupTxt: Label 'Set up a service declaration';
AssistedSetupDescriptionTxt: Label 'The Service Declaration it easy to export the servide declaration in the format that the authorities in your country require.';
@@ -157,14 +154,6 @@ codeunit 5012 "Service Declaration Mgt."
exit(NoSeriesCode);
end;
-#if not CLEAN23
- [Obsolete('This function is not used anymore as the feature is enabled by default', '23.0')]
- procedure ShowNotEnabledMessage(PageCaption: Text)
- begin
- Message(FeatureNotEnabledMessageTxt, PageCaption);
- end;
-#endif
-
local procedure IsSalesDocApplicableForServDecl(SalesHeader: Record "Sales Header"): Boolean
var
ServiceDeclarationSetup: Record "Service Declaration Setup";
diff --git a/Apps/W1/ServiceDeclaration/app/src/Processing/ServiceTransactionTypes.Page.al b/Apps/W1/ServiceDeclaration/app/src/Processing/ServiceTransactionTypes.Page.al
index d4891a3ac1..97cca31035 100644
--- a/Apps/W1/ServiceDeclaration/app/src/Processing/ServiceTransactionTypes.Page.al
+++ b/Apps/W1/ServiceDeclaration/app/src/Processing/ServiceTransactionTypes.Page.al
@@ -32,16 +32,5 @@ page 5011 "Service Transaction Types"
}
var
-#if not CLEAN23
- SetupMode: Boolean;
-#endif
-
-#if not CLEAN23
- [Obsolete('This function is not used anymore', '23.0')]
- procedure SetSetupMode()
- begin
- SetupMode := true;
- end;
-#endif
}
diff --git a/Apps/W1/ServiceDeclaration/app/src/Setup/ServDeclSetupWizard.Page.al b/Apps/W1/ServiceDeclaration/app/src/Setup/ServDeclSetupWizard.Page.al
index 992da33369..1e9a57ea18 100644
--- a/Apps/W1/ServiceDeclaration/app/src/Setup/ServDeclSetupWizard.Page.al
+++ b/Apps/W1/ServiceDeclaration/app/src/Setup/ServDeclSetupWizard.Page.al
@@ -145,9 +145,6 @@ page 5021 "Serv. Decl. Setup Wizard"
var
ServiceTransactionTypesPage: Page "Service Transaction Types";
begin
-#if not CLEAN23
- ServiceTransactionTypesPage.SetSetupMode();
-#endif
ServiceTransactionTypesPage.RunModal();
UpdateServTransTypesCount();
end;
diff --git a/Apps/W1/Shopify/app/src/Base/Pages/ShpfyShopCard.Page.al b/Apps/W1/Shopify/app/src/Base/Pages/ShpfyShopCard.Page.al
index f8cf3e6d6f..38b7633526 100644
--- a/Apps/W1/Shopify/app/src/Base/Pages/ShpfyShopCard.Page.al
+++ b/Apps/W1/Shopify/app/src/Base/Pages/ShpfyShopCard.Page.al
@@ -63,9 +63,6 @@ page 30101 "Shpfy Shop Card"
if not Rec.Enabled then
exit;
Rec.RequestAccessToken();
-#if not CLEAN23
- if BulkOperationMgt.IsBulkOperationFeatureEnabled() then
-#endif
BulkOperationMgt.EnableBulkOperations(Rec);
Rec."B2B Enabled" := Rec.GetB2BEnabled();
Rec."Weight Unit" := Rec.GetShopWeightUnit();
@@ -93,18 +90,6 @@ page 30101 "Shpfy Shop Card"
Importance = Additional;
ToolTip = 'Specifies the language of the Shopify Shop.';
}
-#if not CLEAN23
- field(LogActivated; Rec."Log Enabled")
- {
- ApplicationArea = All;
- Importance = Additional;
- ToolTip = 'Specifies whether the log is activated.';
- Visible = false;
- ObsoleteReason = 'Replaced with field "Logging Mode"';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
- }
-#endif
field(LoggingMode; Rec."Logging Mode")
{
ApplicationArea = All;
diff --git a/Apps/W1/Shopify/app/src/Base/Tables/ShpfyShop.Table.al b/Apps/W1/Shopify/app/src/Base/Tables/ShpfyShop.Table.al
index ef7807eb4a..4efaa1b816 100644
--- a/Apps/W1/Shopify/app/src/Base/Tables/ShpfyShop.Table.al
+++ b/Apps/W1/Shopify/app/src/Base/Tables/ShpfyShop.Table.al
@@ -84,13 +84,8 @@ table 30102 "Shpfy Shop"
Caption = 'Log Enabled';
DataClassification = SystemMetadata;
ObsoleteReason = 'Replaced with field "Logging Mode"';
-#if not CLEAN23
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-#else
ObsoleteState = Removed;
ObsoleteTag = '26.0';
-#endif
}
field(6; "Customer Price Group"; Code[10])
{
diff --git a/Apps/W1/Shopify/app/src/Bulk Operations/Codeunits/ShpfyBulkOperationMgt.Codeunit.al b/Apps/W1/Shopify/app/src/Bulk Operations/Codeunits/ShpfyBulkOperationMgt.Codeunit.al
index 6612b7c6fb..55851d804a 100644
--- a/Apps/W1/Shopify/app/src/Bulk Operations/Codeunits/ShpfyBulkOperationMgt.Codeunit.al
+++ b/Apps/W1/Shopify/app/src/Bulk Operations/Codeunits/ShpfyBulkOperationMgt.Codeunit.al
@@ -1,16 +1,10 @@
namespace Microsoft.Integration.Shopify;
using System.Integration;
-#if not CLEAN23
-using System.Environment.Configuration;
-#endif
codeunit 30270 "Shpfy Bulk Operation Mgt."
{
var
-#if not CLEAN23
- BulkOperationFeatureIdTok: Label 'ShopifyBulkAPI';
-#endif
InvalidUserErr: Label 'You must sign in with a Business Central licensed user to enable the feature.';
CategoryTok: Label 'Shopify Integration', Locked = true;
BulkOperationsDontMatchLbl: Label 'Searched bulk operation (%1, %2, %3) does not match with current one (%4)', Comment = '%1 = Bulk Operation Id, %2 = Shop Code, %3 = Type, %4 = Bulk Operation Id', Locked = true;
@@ -167,44 +161,6 @@ codeunit 30270 "Shpfy Bulk Operation Mgt."
exit(10);
end;
-#if not CLEAN23
- [Obsolete('Feature ShopifyBulkAPI will be enabled by default in version 26.0.', '23.0')]
- procedure IsBulkOperationFeatureEnabled() FeatureEnabled: Boolean;
- var
- FeatureManagementFacade: Codeunit "Feature Management Facade";
- begin
- FeatureEnabled := FeatureManagementFacade.IsEnabled(BulkOperationFeatureIdTok);
- OnIsBulkOperationFeatureEnabled(FeatureEnabled);
- end;
-
- [Obsolete('Feature ShopifyBulkAPI will be enabled by default in version 26.0.', '23.0')]
- procedure GetBulkOperationFeatureKey(): Text[50]
- begin
- exit(BulkOperationFeatureIdTok);
- end;
-
- [EventSubscriber(ObjectType::Codeunit, Codeunit::"Feature Management Facade", 'OnAfterFeatureEnableConfirmed', '', false, false)]
- local procedure HandleOnAfterFeatureEnableConfirmed(var FeatureKey: Record "Feature Key")
- var
- Shop: Record "Shpfy Shop";
- begin
- if FeatureKey.ID = BulkOperationFeatureIdTok then begin
- Shop.SetRange(Enabled, true);
- if Shop.FindSet() then
- repeat
- EnableBulkOperations(Shop);
- until Shop.Next() = 0;
- end;
- end;
-
- [Obsolete('Feature ShopifyBulkAPI will be enabled by default in version 26.0.', '23.0')]
- [InternalEvent(false, false)]
- local procedure OnIsBulkOperationFeatureEnabled(var FeatureEnabled: Boolean)
- begin
- end;
-#endif
-
-
[InternalEvent(false, false)]
local procedure OnInvalidUser(var IsHandled: Boolean)
begin
diff --git a/Apps/W1/Shopify/app/src/Customers/Codeunits/ShpfyCustomerExport.Codeunit.al b/Apps/W1/Shopify/app/src/Customers/Codeunits/ShpfyCustomerExport.Codeunit.al
index 363fe23448..d11fea569e 100644
--- a/Apps/W1/Shopify/app/src/Customers/Codeunits/ShpfyCustomerExport.Codeunit.al
+++ b/Apps/W1/Shopify/app/src/Customers/Codeunits/ShpfyCustomerExport.Codeunit.al
@@ -64,7 +64,7 @@ codeunit 30116 "Shpfy Customer Export"
Metafield.Namespace := 'Microsoft.Dynamics365.BusinessCentral';
Metafield.Validate("Parent Table No.", Database::"Shpfy Customer");
Metafield."Owner Id" := ShopifyCustomer.Id;
- Metafield.Type := Metafield.Type::string;
+ Metafield.Type := Metafield.Type::single_line_text_field;
Metafield.Value := Format(MetadataFieldRef.Value);
end;
end;
diff --git a/Apps/W1/Shopify/app/src/GraphQL/Codeunits/ShpfyGQLVariantById.Codeunit.al b/Apps/W1/Shopify/app/src/GraphQL/Codeunits/ShpfyGQLVariantById.Codeunit.al
index 1b848fb58d..116c4302d5 100644
--- a/Apps/W1/Shopify/app/src/GraphQL/Codeunits/ShpfyGQLVariantById.Codeunit.al
+++ b/Apps/W1/Shopify/app/src/GraphQL/Codeunits/ShpfyGQLVariantById.Codeunit.al
@@ -13,7 +13,7 @@ codeunit 30150 "Shpfy GQL VariantById" implements "Shpfy IGraphQL"
/// Return value of type Text.
internal procedure GetGraphQL(): Text
begin
- exit('{"query":"{productVariant(id: \"gid://shopify/ProductVariant/{{VariantId}}\") {createdAt updatedAt availableForSale barcode compareAtPrice displayName inventoryPolicy position price sku taxCode taxable title product{id}selectedOptions{name value} inventoryItem{countryCodeOfOrigin createdAt id inventoryHistoryUrl legacyResourceId measurement { weight { value }} provinceCodeOfOrigin requiresShipping sku tracked updatedAt unitCost { amount currencyCode }} metafields(first: 50) {edges {node {id namespace ownerType legacyResourceId key value}}}}}"}');
+ exit('{"query":"{productVariant(id: \"gid://shopify/ProductVariant/{{VariantId}}\") {createdAt updatedAt availableForSale barcode compareAtPrice displayName inventoryPolicy position price sku taxCode taxable title product{id}selectedOptions{name value} inventoryItem{countryCodeOfOrigin createdAt id inventoryHistoryUrl legacyResourceId measurement { weight { value }} provinceCodeOfOrigin requiresShipping sku tracked updatedAt unitCost { amount currencyCode }} metafields(first: 50) {edges {node {id namespace type legacyResourceId key value}}}}}"}');
end;
///
diff --git a/Apps/W1/Shopify/app/src/Invoicing/Codeunits/ShpfyPostedInvoiceExport.Codeunit.al b/Apps/W1/Shopify/app/src/Invoicing/Codeunits/ShpfyPostedInvoiceExport.Codeunit.al
index 60fe4f7eab..8de5ceaadb 100644
--- a/Apps/W1/Shopify/app/src/Invoicing/Codeunits/ShpfyPostedInvoiceExport.Codeunit.al
+++ b/Apps/W1/Shopify/app/src/Invoicing/Codeunits/ShpfyPostedInvoiceExport.Codeunit.al
@@ -61,6 +61,10 @@ codeunit 30362 "Shpfy Posted Invoice Export"
MapPostedSalesInvoiceData(SalesInvoiceHeader, TempOrderHeader, TempOrderLine, OrderTaxLines);
DraftOrderId := DraftOrdersAPI.CreateDraftOrder(TempOrderHeader, TempOrderLine, OrderTaxLines);
+ if DraftOrderId = 0 then begin
+ SetSalesInvoiceShopifyOrderInformation(SalesInvoiceHeader, -1, '');
+ exit;
+ end;
JResponse := DraftOrdersAPI.CompleteDraftOrder(DraftOrderId);
if IsSuccess(JResponse) then begin
@@ -169,7 +173,7 @@ codeunit 30362 "Shpfy Posted Invoice Export"
SalesInvoiceHeader.Modify(true);
end;
- local procedure MapPostedSalesInvoiceData(
+ internal procedure MapPostedSalesInvoiceData(
SalesInvoiceHeader: Record "Sales Invoice Header";
var TempOrderHeader: Record "Shpfy Order Header" temporary;
var TempOrderLine: Record "Shpfy Order Line" temporary;
@@ -181,6 +185,7 @@ codeunit 30362 "Shpfy Posted Invoice Export"
MapSalesInvoiceHeader(SalesInvoiceHeader, TempOrderHeader);
InvoiceLine.SetRange("Document No.", SalesInvoiceHeader."No.");
+ InvoiceLine.SetFilter(Quantity, '>%1', 0);
if InvoiceLine.FindSet() then
repeat
MapSalesInvoiceLine(InvoiceLine, TempOrderHeader, TempOrderLine, OrderTaxLines);
diff --git a/Apps/W1/Shopify/app/src/Logs/Pages/ShpfyLogEntries.Page.al b/Apps/W1/Shopify/app/src/Logs/Pages/ShpfyLogEntries.Page.al
index 61d25ab384..6d8bee208f 100644
--- a/Apps/W1/Shopify/app/src/Logs/Pages/ShpfyLogEntries.Page.al
+++ b/Apps/W1/Shopify/app/src/Logs/Pages/ShpfyLogEntries.Page.al
@@ -48,35 +48,6 @@ page 30119 "Shpfy Log Entries"
ApplicationArea = All;
ToolTip = 'Specifies the URL with the data requested from.';
}
-#if not CLEAN23
- field(Method; Rec.Method)
- {
- ApplicationArea = All;
- ToolTip = 'Specifies the used method.';
- Visible = false;
- ObsoleteReason = 'Removed from this page.';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
- }
- field(StatusCode; Rec."Status Code")
- {
- ApplicationArea = All;
- ToolTip = 'Specifies the HTTP result status of the entry in the log.';
- Visible = false;
- ObsoleteReason = 'Removed from this page.';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
- }
- field(StatusDescription; Rec."Status Description")
- {
- ApplicationArea = All;
- ToolTip = 'Specifies the description of the HTTP result status of the entry in the log.';
- Visible = false;
- ObsoleteReason = 'Removed from this page.';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
- }
-#endif
field(RequestPreview; Rec."Request Preview")
{
ApplicationArea = All;
diff --git a/Apps/W1/Shopify/app/src/Metafields/Enums/ShpfyMetafieldOwnerType.Enum.al b/Apps/W1/Shopify/app/src/Metafields/Enums/ShpfyMetafieldOwnerType.Enum.al
index 71d42d21c1..48f187b095 100644
--- a/Apps/W1/Shopify/app/src/Metafields/Enums/ShpfyMetafieldOwnerType.Enum.al
+++ b/Apps/W1/Shopify/app/src/Metafields/Enums/ShpfyMetafieldOwnerType.Enum.al
@@ -2,8 +2,6 @@ namespace Microsoft.Integration.Shopify;
enum 30156 "Shpfy Metafield Owner Type" implements "Shpfy IMetafield Owner Type"
{
- Access = Internal;
-
value(0; Customer)
{
Caption = 'Customer';
diff --git a/Apps/W1/Shopify/app/src/Metafields/Enums/ShpfyMetafieldType.Enum.al b/Apps/W1/Shopify/app/src/Metafields/Enums/ShpfyMetafieldType.Enum.al
index b4c21fb5b4..17f260684c 100644
--- a/Apps/W1/Shopify/app/src/Metafields/Enums/ShpfyMetafieldType.Enum.al
+++ b/Apps/W1/Shopify/app/src/Metafields/Enums/ShpfyMetafieldType.Enum.al
@@ -5,23 +5,28 @@ namespace Microsoft.Integration.Shopify;
///
enum 30159 "Shpfy Metafield Type" implements "Shpfy IMetafield Type"
{
- Access = Internal;
Caption = 'Shopify Metafield Type';
-
Extensible = false;
+#if not CLEAN26
value(0; string)
{
Caption = 'String';
Implementation = "Shpfy IMetafield Type" = "Shpfy Mtfld Type String";
+ ObsoleteReason = 'Use Single line text instead.';
+ ObsoleteTag = '26.0';
+ ObsoleteState = Pending;
}
value(1; integer)
{
- Caption = 'Integer';
+ Caption = 'Legacy Integer';
Implementation = "Shpfy IMetafield Type" = "Shpfy Mtfld Type Integer";
+ ObsoleteReason = 'Use Integer instead.';
+ ObsoleteTag = '26.0';
+ ObsoleteState = Pending;
}
-
+#endif
value(2; json)
{
Caption = 'JSON';
diff --git a/Apps/W1/Shopify/app/src/Metafields/Pages/ShpfyMetafields.Page.al b/Apps/W1/Shopify/app/src/Metafields/Pages/ShpfyMetafields.Page.al
index 2029380a48..fe8979c843 100644
--- a/Apps/W1/Shopify/app/src/Metafields/Pages/ShpfyMetafields.Page.al
+++ b/Apps/W1/Shopify/app/src/Metafields/Pages/ShpfyMetafields.Page.al
@@ -58,6 +58,7 @@ page 30163 "Shpfy Metafields"
Evaluate(Rec."Parent Table No.", Rec.GetFilter("Parent Table No."));
Rec.Validate("Parent Table No.");
Evaluate(Rec."Owner Id", Rec.GetFilter("Owner Id"));
+ Rec.Validate(Type, Rec.Type::single_line_text_field);
end;
trigger OnAfterGetCurrRecord()
diff --git a/Apps/W1/Shopify/app/src/Metafields/Tables/ShpfyMetafield.Table.al b/Apps/W1/Shopify/app/src/Metafields/Tables/ShpfyMetafield.Table.al
index 6e7955daa8..8912e46968 100644
--- a/Apps/W1/Shopify/app/src/Metafields/Tables/ShpfyMetafield.Table.al
+++ b/Apps/W1/Shopify/app/src/Metafields/Tables/ShpfyMetafield.Table.al
@@ -7,7 +7,6 @@ using Microsoft.Finance.GeneralLedger.Setup;
///
table 30101 "Shpfy Metafield"
{
- Access = Internal;
Caption = 'Shopify Metafield';
DataClassification = CustomerContent;
DrillDownPageId = "Shpfy Metafields";
@@ -21,7 +20,6 @@ table 30101 "Shpfy Metafield"
DataClassification = SystemMetadata;
Editable = false;
}
-
#pragma warning disable AS0086 // false positive on extending the field length on internal table
field(2; Namespace; Text[255])
{
@@ -98,6 +96,16 @@ table 30101 "Shpfy Metafield"
{
Caption = 'Type';
DataClassification = CustomerContent;
+
+#if not CLEAN26
+ trigger OnValidate()
+ begin
+ if Type = Type::string then
+ Error(StringTypeErr, Format(Type), Format(Type::single_line_text_field));
+ if Type = Type::integer then
+ Error(StringTypeErr, Format(Type), Format(Type::number_integer));
+ end;
+#endif
}
field(9; "Last Updated by BC"; DateTime)
{
@@ -160,6 +168,11 @@ table 30101 "Shpfy Metafield"
"Last Updated by BC" := CurrentDateTime;
end;
+#if not CLEAN26
+ var
+ StringTypeErr: Label 'The type %1 is obsolete. Use %2 instead.', Comment = '%1 - Type, %2 - Type';
+#endif
+
///
/// Get the owner type based on the resources's owner table number.
///
diff --git a/Apps/W1/Shopify/app/src/Order handling/Codeunits/ShpfyOrderEvents.Codeunit.al b/Apps/W1/Shopify/app/src/Order handling/Codeunits/ShpfyOrderEvents.Codeunit.al
index ada8e63e93..20d9aa9ec3 100644
--- a/Apps/W1/Shopify/app/src/Order handling/Codeunits/ShpfyOrderEvents.Codeunit.al
+++ b/Apps/W1/Shopify/app/src/Order handling/Codeunits/ShpfyOrderEvents.Codeunit.al
@@ -17,29 +17,6 @@ codeunit 30162 "Shpfy Order Events"
begin
end;
-#if not CLEAN23
- [Obsolete('This event is not used.', '23.0')]
- [IntegrationEvent(false, false)]
- ///
- /// Raised After Modify Shopify Order.
- ///
- /// Parameter of type Record "Shopify Order Header".
- /// Parameter of type Record "Shopify Order Header".
- internal procedure OnAfterModifyShopifyOrder(var ShopifyOrderHeader: Record "Shpfy Order Header"; var OldShopifyOrderHeader: Record "Shpfy Order Header")
- begin
- end;
-
- [Obsolete('This event is not used.', '23.0')]
- [IntegrationEvent(false, false)]
- ///
- /// Raised After NewShopify Order.
- ///
- /// Parameter of type Record "Shopify Order Header".
- internal procedure OnAfterNewShopifyOrder(var ShopifyOrderHeader: Record "Shpfy Order Header")
- begin
- end;
-#endif
-
[InternalEvent(false)]
///
/// Description for OnBeforeMapCustomer.
diff --git a/Apps/W1/Shopify/app/src/Products/Codeunits/ShpfyCreateItem.Codeunit.al b/Apps/W1/Shopify/app/src/Products/Codeunits/ShpfyCreateItem.Codeunit.al
index 480c444cee..835f84cd8e 100644
--- a/Apps/W1/Shopify/app/src/Products/Codeunits/ShpfyCreateItem.Codeunit.al
+++ b/Apps/W1/Shopify/app/src/Products/Codeunits/ShpfyCreateItem.Codeunit.al
@@ -244,6 +244,7 @@ codeunit 30171 "Shpfy Create Item"
ItemNo := CopyStr(Code, 1, MaxStrLen(ItemNo));
end;
end;
+ Clear(Item."Item Category Code");
CreateItemFromTemplate(Item, CurrentTemplateCode, ItemNo);
Item.Description := ShopifyProduct.Title;
@@ -383,7 +384,6 @@ codeunit 30171 "Shpfy Create Item"
IsHandled: Boolean;
begin
ProductEvents.OnBeforeFindItemTemplate(Shop, ShopifyProduct, ShopifyVariant, Result, IsHandled);
- if not IsHandled then
if not IsHandled then begin
Shop.TestField("Item Templ. Code");
Result := Shop."Item Templ. Code";
diff --git a/Apps/W1/Shopify/app/src/Products/Codeunits/ShpfyProductAPI.Codeunit.al b/Apps/W1/Shopify/app/src/Products/Codeunits/ShpfyProductAPI.Codeunit.al
index 834aa2ae33..ffe2c76b90 100644
--- a/Apps/W1/Shopify/app/src/Products/Codeunits/ShpfyProductAPI.Codeunit.al
+++ b/Apps/W1/Shopify/app/src/Products/Codeunits/ShpfyProductAPI.Codeunit.al
@@ -205,11 +205,7 @@ codeunit 30176 "Shpfy Product API"
if Item.Picture.Count > 0 then
if CreateImageUploadUrl(Item, Url, ResourceUrl, TenantMedia) then
if UploadImage(TenantMedia, Url) then
-#if not CLEAN23
- if not BulkOperationMgt.IsBulkOperationFeatureEnabled() or (RecordCount < BulkOperationMgt.GetBulkOperationThreshold()) then
-#else
if RecordCount <= BulkOperationMgt.GetBulkOperationThreshold() then
-#endif
exit(UpdateProductImage(Product, ResourceUrl))
else begin
IBulkOperation := BulkOperationType::UpdateProductImage;
diff --git a/Apps/W1/Shopify/app/src/Products/Codeunits/ShpfyVariantAPI.Codeunit.al b/Apps/W1/Shopify/app/src/Products/Codeunits/ShpfyVariantAPI.Codeunit.al
index 1dc1511e4a..7e8e6979d5 100644
--- a/Apps/W1/Shopify/app/src/Products/Codeunits/ShpfyVariantAPI.Codeunit.al
+++ b/Apps/W1/Shopify/app/src/Products/Codeunits/ShpfyVariantAPI.Codeunit.al
@@ -471,11 +471,7 @@ codeunit 30189 "Shpfy Variant API"
Price: Text;
CompareAtPrice: Text;
begin
-#if not CLEAN23
- IsBulkOperationEnabled := BulkOperationMgt.IsBulkOperationFeatureEnabled() and (RecordCount >= BulkOperationMgt.GetBulkOperationThreshold());
-#else
IsBulkOperationEnabled := RecordCount >= BulkOperationMgt.GetBulkOperationThreshold();
-#endif
GraphQuery.Append('{"query":"mutation { productVariantUpdate(input: {id: \"gid://shopify/ProductVariant/');
GraphQuery.Append(Format(ShopifyVariant.Id));
GraphQuery.Append('\"');
diff --git a/Apps/W1/Shopify/app/src/Transactions/Reports/ShpfySuggestPayments.Report.al b/Apps/W1/Shopify/app/src/Transactions/Reports/ShpfySuggestPayments.Report.al
index f496380a35..b11552f5b6 100644
--- a/Apps/W1/Shopify/app/src/Transactions/Reports/ShpfySuggestPayments.Report.al
+++ b/Apps/W1/Shopify/app/src/Transactions/Reports/ShpfySuggestPayments.Report.al
@@ -176,9 +176,13 @@ report 30118 "Shpfy Suggest Payments"
end;
trigger OnPostReport()
+ var
+ GenJnlManagement: Codeunit GenJnlManagement;
begin
- if not IsGenJournalLineSet then
- Page.Run(Page::"Cash Receipt Journal");
+ if not IsGenJournalLineSet then begin
+ GenJournalBatch.Get(GeneralJournalTemplateName, GeneralJournalBatchName);
+ GenJnlManagement.TemplateSelectionFromBatch(GenJournalBatch);
+ end;
end;
internal procedure SetGenJournalLine(NewGenJournalLine: Record "Gen. Journal Line")
@@ -395,8 +399,15 @@ report 30118 "Shpfy Suggest Payments"
begin
if PaymentMethod.Get(PaymentMethodCode) then begin
GenJournalLine.Validate("Payment Method Code", PaymentMethodCode);
- GenJournalLine.Validate("Bal. Account Type", PaymentMethod."Bal. Account Type");
- GenJournalLine.Validate("Bal. Account No.", PaymentMethod."Bal. Account No.");
+ if PaymentMethod."Bal. Account No." <> '' then begin
+ case PaymentMethod."Bal. Account Type" of
+ PaymentMethod."Bal. Account Type"::"Bank Account":
+ GenJournalLine.Validate("Bal. Account Type", GenJournalLine."Bal. Account Type"::"Bank Account");
+ PaymentMethod."Bal. Account Type"::"G/L Account":
+ GenJournalLine.Validate("Bal. Account Type", GenJournalLine."Bal. Account Type"::"G/L Account");
+ end;
+ GenJournalLine.Validate("Bal. Account No.", PaymentMethod."Bal. Account No.");
+ end;
end;
end;
diff --git a/Apps/W1/Shopify/app/src/Webhooks/Codeunits/ShpfyWebhooksMgt.Codeunit.al b/Apps/W1/Shopify/app/src/Webhooks/Codeunits/ShpfyWebhooksMgt.Codeunit.al
index b069e26fdc..26abebfcd7 100644
--- a/Apps/W1/Shopify/app/src/Webhooks/Codeunits/ShpfyWebhooksMgt.Codeunit.al
+++ b/Apps/W1/Shopify/app/src/Webhooks/Codeunits/ShpfyWebhooksMgt.Codeunit.al
@@ -100,18 +100,19 @@ codeunit 30269 "Shpfy Webhooks Mgt."
if WebhookSubscription."Company Name" = CompanyName() then begin // checks if this webhook is also enabled for another company
Company.FindSet();
repeat
- SearchShop.ChangeCompany(Company.Name);
- SearchShop.SetRange("Shopify URL", Shop."Shopify URL");
- if Company.Name = CompanyName() then
- SearchShop.SetFilter(Code, '<>%1', Shop.Code);
-
- if SearchShop.FindSet() then
- repeat
- if SearchShop."Bulk Operation Webhook Id" <> '' then begin
- FoundCompany := Company.Name;
- break;
- end;
- until SearchShop.Next() = 0;
+ if SearchShop.ChangeCompany(Company.Name) then begin
+ SearchShop.SetRange("Shopify URL", Shop."Shopify URL");
+ if Company.Name = CompanyName() then
+ SearchShop.SetFilter(Code, '<>%1', Shop.Code);
+
+ if SearchShop.FindSet() then
+ repeat
+ if SearchShop."Bulk Operation Webhook Id" <> '' then begin
+ FoundCompany := Company.Name;
+ break;
+ end;
+ until SearchShop.Next() = 0;
+ end;
if FoundCompany <> '' then
break;
@@ -154,18 +155,22 @@ codeunit 30269 "Shpfy Webhooks Mgt."
if WebhookSubscription."Company Name" = CompanyName() then begin // checks if this webhook is also enabled for another company
Company.FindSet();
repeat
- SearchShop.ChangeCompany(Company.Name);
- SearchShop.SetRange("Shopify URL", Shop."Shopify URL");
- if Company.Name = CompanyName() then
- SearchShop.SetFilter(Code, '<>%1', Shop.Code);
+ if SearchShop.ChangeCompany(Company.Name) then begin
+ SearchShop.SetRange("Shopify URL", Shop."Shopify URL");
+ if Company.Name = CompanyName() then
+ SearchShop.SetFilter(Code, '<>%1', Shop.Code);
+
+ if SearchShop.FindSet() then
+ repeat
+ if SearchShop."Order Created Webhook Id" <> '' then begin
+ FoundCompany := Company.Name;
+ break;
+ end;
+ until SearchShop.Next() = 0;
+ end;
- if SearchShop.FindSet() then
- repeat
- if SearchShop."Order Created Webhook Id" <> '' then begin
- FoundCompany := Company.Name;
- break;
- end;
- until SearchShop.Next() = 0;
+ if FoundCompany <> '' then
+ break;
until Company.Next() = 0;
if FoundCompany = '' then begin
diff --git a/Apps/W1/Shopify/test/Bulk Operations/Codeunits/ShpfyBulkOpSubscriber.Codeunit.al b/Apps/W1/Shopify/test/Bulk Operations/Codeunits/ShpfyBulkOpSubscriber.Codeunit.al
index 0713ec2e77..e1e7cf519e 100644
--- a/Apps/W1/Shopify/test/Bulk Operations/Codeunits/ShpfyBulkOpSubscriber.Codeunit.al
+++ b/Apps/W1/Shopify/test/Bulk Operations/Codeunits/ShpfyBulkOpSubscriber.Codeunit.al
@@ -9,14 +9,6 @@ codeunit 139615 "Shpfy Bulk Op. Subscriber"
BulkOperationRunning: Boolean;
BulkUploadFail: Boolean;
-#if not CLEAN23
- [EventSubscriber(ObjectType::Codeunit, Codeunit::"Shpfy Bulk Operation Mgt.", 'OnIsBulkOperationFeatureEnabled', '', true, false)]
- local procedure OnGetAccessToken(var FeatureEnabled: Boolean)
- begin
- FeatureEnabled := true;
- end;
-#endif
-
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Shpfy Bulk Operation Mgt.", 'OnInvalidUser', '', true, false)]
local procedure OnInvalidUser(var IsHandled: Boolean)
begin
diff --git a/Apps/W1/Shopify/test/Catalogs/ShpfyCatalogPricesTest.Codeunit.al b/Apps/W1/Shopify/test/Catalogs/ShpfyCatalogPricesTest.Codeunit.al
index a9fd48055e..b903995668 100644
--- a/Apps/W1/Shopify/test/Catalogs/ShpfyCatalogPricesTest.Codeunit.al
+++ b/Apps/W1/Shopify/test/Catalogs/ShpfyCatalogPricesTest.Codeunit.al
@@ -36,7 +36,7 @@ codeunit 139646 "Shpfy Catalog Prices Test"
InitPrice := Any.DecimalInRange(2 * InitUnitCost, 4 * InitUnitCost, 1);
InitDiscountPerc := Any.DecimalInRange(5, 20, 1);
Item := ProductInitTest.CreateItem(Shop."Item Templ. Code", InitUnitCost, InitPrice);
-#if not CLEAN23
+#if not CLEAN25
ProductInitTest.CreateSalesPrice(Shop.Code, Item."No.", InitPrice);
CustomerDiscountGroup := ProductInitTest.CreateSalesLineDiscount(Shop.Code, Item."No.", InitDiscountPerc);
#else
@@ -90,7 +90,7 @@ codeunit 139646 "Shpfy Catalog Prices Test"
ProductPriceCalculation: Codeunit "Shpfy Product Price Calc.";
InitUnitCost: Decimal;
InitPrice: Decimal;
-#if CLEAN23
+#if CLEAN25
InitDiscountPerc: Decimal;
#endif
UnitCost: Decimal;
@@ -118,7 +118,7 @@ codeunit 139646 "Shpfy Catalog Prices Test"
LibraryAssert.AreEqual(InitPrice, Price, 'Initial price should match expected before discount application.');
// [GIVEN] Updating the catalog to apply a universal discount to all customers.
-#if CLEAN23
+#if CLEAN25
InitDiscountPerc := Any.DecimalInRange(5, 20, 1);
ProductInitTest.CreateAllCustomerPriceList(Shop.Code, Item."No.", InitPrice, InitDiscountPerc);
Catalog."Customer No." := Customer."No.";
@@ -142,7 +142,7 @@ codeunit 139646 "Shpfy Catalog Prices Test"
Catalog: Record "Shpfy Catalog";
ShopifyCompany: Record "Shpfy Company";
Item: Record Item;
-#if CLEAN23
+#if CLEAN25
Customer: Record Customer;
LibrarySales: Codeunit "Library - Sales";
#endif
@@ -156,7 +156,7 @@ codeunit 139646 "Shpfy Catalog Prices Test"
UnitCost: Decimal;
Price: Decimal;
ComparePrice: Decimal;
-#if CLEAN23
+#if CLEAN25
CustDiscPerc: Decimal;
#endif
begin
@@ -174,7 +174,7 @@ codeunit 139646 "Shpfy Catalog Prices Test"
ProductPriceCalculation.CalcPrice(Item, '', '', UnitCost, Price, ComparePrice);
LibraryAssert.AreEqual(InitUnitCost, UnitCost, 'Verify initial unit cost matches setup.');
LibraryAssert.AreEqual(InitPrice, Price, 'Verify initial price matches setup before discount.');
-#if CLEAN23
+#if CLEAN25
// Creating a customer entry, though it is generic as discounts apply to all customers.
LibrarySales.CreateCustomer(Customer);
// [GIVEN] Applying customer-specific discounts.
@@ -201,7 +201,7 @@ codeunit 139646 "Shpfy Catalog Prices Test"
Catalog: Record "Shpfy Catalog";
ShopifyCompany: Record "Shpfy Company";
Item: Record Item;
-#if CLEAN23
+#if CLEAN25
Customer: Record Customer;
LibrarySales: Codeunit "Library - Sales";
#endif
@@ -212,7 +212,7 @@ codeunit 139646 "Shpfy Catalog Prices Test"
ProductPriceCalculation: Codeunit "Shpfy Product Price Calc.";
InitUnitCost: Decimal;
InitPrice: Decimal;
-#if CLEAN23
+#if CLEAN25
InitPerc: Decimal;
CustDiscPerc: Decimal;
#endif
@@ -237,7 +237,7 @@ codeunit 139646 "Shpfy Catalog Prices Test"
LibraryAssert.AreEqual(InitUnitCost, UnitCost, 'Initial unit cost should match.');
LibraryAssert.AreEqual(InitPrice, Price, 'Initial price should match before discount.');
-#if CLEAN23
+#if CLEAN25
// Creating a customer entry, though it is generic as discounts apply to all customers.
LibrarySales.CreateCustomer(Customer);
// [GIVEN] Applying a universal discount for all customers.
@@ -265,7 +265,7 @@ codeunit 139646 "Shpfy Catalog Prices Test"
Catalog: Record "Shpfy Catalog";
ShopifyCompany: Record "Shpfy Company";
Item: Record Item;
-#if CLEAN23
+#if CLEAN25
Customer: Record Customer;
CustomerDiscountGroup: Record "Customer Discount Group";
LibrarySales: Codeunit "Library - Sales";
@@ -277,7 +277,7 @@ codeunit 139646 "Shpfy Catalog Prices Test"
ProductPriceCalculation: Codeunit "Shpfy Product Price Calc.";
InitUnitCost: Decimal;
InitPrice: Decimal;
-#if CLEAN23
+#if CLEAN25
InitDiscountPerc: Decimal;
#endif
UnitCost: Decimal;
@@ -300,7 +300,7 @@ codeunit 139646 "Shpfy Catalog Prices Test"
// [THEN] Verifying initial price settings.
LibraryAssert.AreEqual(InitUnitCost, UnitCost, 'Initial unit cost should match setup.');
LibraryAssert.AreEqual(InitPrice, Price, 'Initial price should match setup without discounts.');
-#if CLEAN23
+#if CLEAN25
LibrarySales.CreateCustomer(Customer);
InitDiscountPerc := Any.DecimalInRange(5, 20, 1);
CustomerDiscountGroup := ProductInitTest.CreatePriceList(Shop.Code, Item."No.", InitPrice, InitDiscountPerc);
diff --git a/Apps/W1/Shopify/test/Invoices/ShpfyInvoicesTest.Codeunit.al b/Apps/W1/Shopify/test/Invoices/ShpfyInvoicesTest.Codeunit.al
index 288b4d8039..a53d82c5a5 100644
--- a/Apps/W1/Shopify/test/Invoices/ShpfyInvoicesTest.Codeunit.al
+++ b/Apps/W1/Shopify/test/Invoices/ShpfyInvoicesTest.Codeunit.al
@@ -26,7 +26,7 @@ codeunit 139695 "Shpfy Invoices Test"
OrderId := Any.IntegerInRange(10000, 99999);
LibraryInventory.CreateItem(Item);
LibrarySales.CreateCustomer(Customer);
- InvoiceNo := CreateAndPostSalesInvoice(Item, Customer, 1, OrderId);
+ InvoiceNo := CreateAndPostSalesInvoice(Item, Customer, 1, false, OrderId);
LibrarySales.CreateSalesHeader(SalesHeader, SalesHeader."Document Type"::Invoice, Customer."No.");
// [WHEN] Copy the invoice
@@ -36,6 +36,86 @@ codeunit 139695 "Shpfy Invoices Test"
LibraryAssert.IsTrue(SalesHeader."Shpfy Order Id" = 0, 'Shpfy Order Id is not copied');
end;
+
+ [Test]
+ procedure UnitTestMapPostedSalesInvoice()
+ var
+ Item: Record Item;
+ Customer: Record Customer;
+ SalesInvoiceHeader: Record "Sales Invoice Header";
+ SalesInvoiceLine: Record "Sales Invoice Line";
+ TempOrderHeader: Record "Shpfy Order Header" temporary;
+ TempOrderLine: Record "Shpfy Order Line" temporary;
+ PostedInvoiceExport: Codeunit "Shpfy Posted Invoice Export";
+ InvoiceNo: Code[20];
+ OrderId: BigInteger;
+ OrderTaxLines: Dictionary of [Text, Decimal];
+ begin
+ // [SCENARIO] Header and lines are mapped correctly
+ // [GIVEN] Posted sales invoice
+ Initialize();
+ OrderId := Any.IntegerInRange(10000, 99999);
+ LibraryInventory.CreateItem(Item);
+ LibrarySales.CreateCustomer(Customer);
+ InvoiceNo := CreateAndPostSalesInvoice(Item, Customer, 1, false, OrderId);
+ SalesInvoiceHeader.Get(InvoiceNo);
+ SalesInvoiceLine.SetRange("Document No.", InvoiceNo);
+ SalesInvoiceLine.FindFirst();
+
+ // [WHEN] Map the posted invoice
+ PostedInvoiceExport.MapPostedSalesInvoiceData(SalesInvoiceHeader, TempOrderHeader, TempOrderLine, OrderTaxLines);
+
+ // [THEN] Header is mapped correctly
+ LibraryAssert.AreEqual(TempOrderHeader."Sales Invoice No.", SalesInvoiceHeader."No.", 'Sales Invoice No. is mapped correctly');
+ LibraryAssert.AreEqual(TempOrderHeader."Sales Order No.", SalesInvoiceHeader."Order No.", 'Sales Order No. is mapped correctly');
+ LibraryAssert.AreEqual(TempOrderHeader."Created At", SalesInvoiceHeader.SystemCreatedAt, 'Created At is mapped correctly');
+ LibraryAssert.IsTrue(TempOrderHeader.Confirmed, 'Confirmed is mapped correctly');
+ LibraryAssert.AreEqual(TempOrderHeader."Updated At", SalesInvoiceHeader.SystemModifiedAt, 'Updated At is mapped correctly');
+ LibraryAssert.AreEqual(TempOrderHeader."Document Date", SalesInvoiceHeader."Document Date", 'Document Date is mapped correctly');
+ SalesInvoiceHeader.CalcFields(Amount, "Amount Including VAT", "Invoice Discount Amount");
+ LibraryAssert.AreEqual(TempOrderHeader."VAT Amount", SalesInvoiceHeader."Amount Including VAT" - SalesInvoiceHeader.Amount, 'VAT Amount is mapped correctly');
+ LibraryAssert.AreEqual(TempOrderHeader."Discount Amount", SalesInvoiceHeader."Invoice Discount Amount", 'Discount Amount is mapped correctly');
+ LibraryAssert.AreEqual(TempOrderHeader."Fulfillment Status", Enum::"Shpfy Order Fulfill. Status"::Fulfilled, 'Fulfillment Status is mapped correctly');
+
+ // [THEN] Lines are mapped correctly
+ LibraryAssert.AreEqual(TempOrderLine.Description, SalesInvoiceLine.Description, 'Description is mapped correctly');
+ LibraryAssert.AreEqual(TempOrderLine.Quantity, SalesInvoiceLine.Quantity, 'Quantity is mapped correctly');
+ LibraryAssert.AreEqual(TempOrderLine."Item No.", SalesInvoiceLine."No.", 'Item No. is mapped correctly');
+ LibraryAssert.AreEqual(TempOrderLine."Variant Code", SalesInvoiceLine."Variant Code", 'Variant Code is mapped correctly');
+ LibraryAssert.IsFalse(TempOrderLine."Gift Card", 'Gift Card is mapped correctly');
+ LibraryAssert.IsFalse(TempOrderLine.Taxable, 'Taxable is mapped correctly');
+ LibraryAssert.AreEqual(TempOrderLine."Unit Price", SalesInvoiceLine."Unit Price", 'Unit Price is mapped correctly');
+ end;
+
+ [Test]
+ procedure UnitTestMapZeroQuantityLine()
+ var
+ Item: Record Item;
+ Customer: Record Customer;
+ SalesInvoiceHeader: Record "Sales Invoice Header";
+ TempOrderHeader: Record "Shpfy Order Header" temporary;
+ TempOrderLine: Record "Shpfy Order Line" temporary;
+ PostedInvoiceExport: Codeunit "Shpfy Posted Invoice Export";
+ InvoiceNo: Code[20];
+ OrderId: BigInteger;
+ OrderTaxLines: Dictionary of [Text, Decimal];
+ begin
+ // [SCENARIO] Lines with zero quantity are not mapped
+ // [GIVEN] Posted sales invoice with two lines, one with zero quantity
+ Initialize();
+ OrderId := Any.IntegerInRange(10000, 99999);
+ LibraryInventory.CreateItem(Item);
+ LibrarySales.CreateCustomer(Customer);
+ InvoiceNo := CreateAndPostSalesInvoice(Item, Customer, 1, true, OrderId);
+ SalesInvoiceHeader.Get(InvoiceNo);
+
+ // [WHEN] Map the posted invoice
+ PostedInvoiceExport.MapPostedSalesInvoiceData(SalesInvoiceHeader, TempOrderHeader, TempOrderLine, OrderTaxLines);
+
+ // [THEN] Only one line is mapped
+ LibraryAssert.RecordCount(TempOrderLine, 1);
+ end;
+
local procedure Initialize()
begin
if IsInitialized then
@@ -45,7 +125,7 @@ codeunit 139695 "Shpfy Invoices Test"
LibraryERMCountryData.UpdateGeneralPostingSetup();
end;
- local procedure CreateAndPostSalesInvoice(Item: Record Item; Customer: Record Customer; NumberOfLines: Integer; OrderId: BigInteger): Code[20]
+ local procedure CreateAndPostSalesInvoice(Item: Record Item; Customer: Record Customer; NumberOfLines: Integer; AddComment: Boolean; OrderId: BigInteger): Code[20]
var
SalesHeader: Record "Sales Header";
SalesLine: Record "Sales Line";
@@ -54,6 +134,11 @@ codeunit 139695 "Shpfy Invoices Test"
SalesHeader."Shpfy Order Id" := OrderId;
SalesHeader.Modify();
LibrarySales.CreateSalesLine(SalesLine, SalesHeader, SalesLine.Type::Item, Item."No.", NumberOfLines);
+ if AddComment then begin
+ LibrarySales.CreateSalesLineSimple(SalesLine, SalesHeader);
+ SalesLine."Type" := SalesLine.Type::" ";
+ SalesLine.Description := 'Comment';
+ end;
exit(LibrarySales.PostSalesDocument(SalesHeader, true, true));
end;
diff --git a/Apps/W1/Shopify/test/Products/ShpfyCreateItemTest.Codeunit.al b/Apps/W1/Shopify/test/Products/ShpfyCreateItemTest.Codeunit.al
index 4299c15a49..956c3a75cd 100644
--- a/Apps/W1/Shopify/test/Products/ShpfyCreateItemTest.Codeunit.al
+++ b/Apps/W1/Shopify/test/Products/ShpfyCreateItemTest.Codeunit.al
@@ -48,7 +48,6 @@ codeunit 139567 "Shpfy Create Item Test"
LibraryAssert.AreEqual(ShopifyVariant.Price, Item."Unit Price", 'Unit Price');
end;
- [HandlerFunctions('DeleteAttributeConfirmHandler')]
[Test]
procedure UnitTestCreateItemSKUIsItemNoFromProductWithMultiVariants()
var
@@ -455,10 +454,4 @@ codeunit 139567 "Shpfy Create Item Test"
LibraryAssert.RecordIsNotEmpty(ItemReference);
until ShopifyVariant.Next() = 0;
end;
-
- [ConfirmHandler]
- procedure DeleteAttributeConfirmHandler(Question: Text[1024]; var Reply: Boolean)
- begin
- Reply := true;
- end;
}
\ No newline at end of file
diff --git a/Apps/W1/Shopify/test/Products/ShpfyProductInitTest.Codeunit.al b/Apps/W1/Shopify/test/Products/ShpfyProductInitTest.Codeunit.al
index 11caf9c052..857ba48ef6 100644
--- a/Apps/W1/Shopify/test/Products/ShpfyProductInitTest.Codeunit.al
+++ b/Apps/W1/Shopify/test/Products/ShpfyProductInitTest.Codeunit.al
@@ -177,7 +177,7 @@ codeunit 139603 "Shpfy Product Init Test"
end;
-#if not CLEAN23
+#if not CLEAN25
internal procedure CreateSalesPrice(Code: Code[10]; ItemNo: Code[20]; Price: Decimal)
var
CustomerPriceGroup: Record "Customer Price Group";
diff --git a/Apps/W1/Shopify/test/Products/ShpfyProductPriceCalcTest.Codeunit.al b/Apps/W1/Shopify/test/Products/ShpfyProductPriceCalcTest.Codeunit.al
index 0cde52ba2d..20cc49cfc2 100644
--- a/Apps/W1/Shopify/test/Products/ShpfyProductPriceCalcTest.Codeunit.al
+++ b/Apps/W1/Shopify/test/Products/ShpfyProductPriceCalcTest.Codeunit.al
@@ -32,7 +32,7 @@ codeunit 139605 "Shpfy Product Price Calc. Test"
InitPrice := Any.DecimalInRange(2 * InitUnitCost, 4 * InitUnitCost, 1);
InitDiscountPerc := Any.DecimalInRange(5, 20, 1);
Item := ProductInitTest.CreateItem(Shop."Item Templ. Code", InitUnitCost, InitPrice);
-#if not CLEAN23
+#if not CLEAN25
ProductInitTest.CreateSalesPrice(Shop.Code, Item."No.", InitPrice);
CustomerDiscountGroup := ProductInitTest.CreateSalesLineDiscount(Shop.Code, Item."No.", InitDiscountPerc);
#else
diff --git a/Apps/W1/Shopify/test/Webhooks/ShpfyWebhooksTest.Codeunit.al b/Apps/W1/Shopify/test/Webhooks/ShpfyWebhooksTest.Codeunit.al
index b166e47928..1d057c5d32 100644
--- a/Apps/W1/Shopify/test/Webhooks/ShpfyWebhooksTest.Codeunit.al
+++ b/Apps/W1/Shopify/test/Webhooks/ShpfyWebhooksTest.Codeunit.al
@@ -158,39 +158,6 @@ codeunit 139612 "Shpfy Webhooks Test"
Clear();
end;
-#if not CLEAN23
- [Obsolete('Feature ShopifyBulkAPI will be enabled by default in version 26.0.', '23.0')]
- [HandlerFunctions('EnableFeatureConfirmHandler')]
- [Test]
- procedure TestEnableBulkOperationFeature()
- var
- Shop: Record "Shpfy Shop";
- WebhookSubscription: Record "Webhook Subscription";
- CommunicationMgt: Codeunit "Shpfy Communication Mgt.";
- FeatureManagement: TestPage "Feature Management";
- begin
- // [SCENARIO] Enabling bulk operation feature registers webhook with Shopify and creates a subscription
-
- // [GINVEN] A Shop record
- Initialize();
- WebhooksSubcriber.InitCreateWebhookResponse(CreateShopifyWebhookCreateJson(BulkOperationTopicLbl), CreateShopifyWebhookDeleteJson(), CreateShopifyEmptyWebhookJson());
- BindSubscription(WebhooksSubcriber);
- BindSubscription(BulkOpSubscriber);
-
- // [WHEN] Feature is enabled
- FeatureManagement.OpenEdit();
- FeatureManagement.Filter.SetFilter(ID, 'ShopifyBulkAPI');
- FeatureManagement.EnabledFor.Value('All Users');
-
- // [THEN] Subscription is created and id field is filled
- Shop := CommunicationMgt.GetShopRecord();
- LibraryAssert.AreEqual(Shop."Bulk Operation Webhook Id", SubscriptionId, 'Subscription id should be filled.');
- WebhookSubscription.SetRange(Endpoint, BulkOperationTopicLbl);
- LibraryAssert.RecordCount(WebhookSubscription, 1);
- Clear();
- end;
-#endif
-
[Test]
procedure TestEnableBulkOperationWebhook()
var
@@ -367,13 +334,4 @@ codeunit 139612 "Shpfy Webhooks Test"
begin
exit(ShopUrl.Replace('https://', '').Replace('.myshopify.com', '').TrimEnd('/'));
end;
-
-#if not CLEAN23
- [Obsolete('Feature ShopifyBulkAPI will be enabled by default in version 26.0.', '23.0')]
- [ConfirmHandler]
- procedure EnableFeatureConfirmHandler(Question: Text[1024]; var Reply: Boolean)
- begin
- Reply := true;
- end;
-#endif
}
\ No newline at end of file
diff --git a/Apps/W1/StatisticalAccounts/app/src/StatAccSourceCodeSetup.TableExt.al b/Apps/W1/StatisticalAccounts/app/src/StatAccSourceCodeSetup.TableExt.al
index 13e04064eb..fa1eb01e2a 100644
--- a/Apps/W1/StatisticalAccounts/app/src/StatAccSourceCodeSetup.TableExt.al
+++ b/Apps/W1/StatisticalAccounts/app/src/StatAccSourceCodeSetup.TableExt.al
@@ -13,18 +13,8 @@ tableextension 2630 StatAccSourceCodeSetup extends "Source Code Setup"
Caption = 'Statistical Account Journal';
TableRelation = "Source Code";
ObsoleteReason = 'Moved to new field - Stat. Account Journal';
-#if not CLEAN23
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-
- trigger OnValidate()
- begin
- Rec."Stat. Account Journal" := Rec."Statistical Account Journal";
- end;
-#else
ObsoleteState = Removed;
ObsoleteTag = '26.0';
-#endif
}
#pragma warning restore PTE0022
@@ -44,14 +34,7 @@ tableextension 2630 StatAccSourceCodeSetup extends "Source Code Setup"
if SourceCodeSetup."Stat. Account Journal" <> '' then
exit;
-#if not CLEAN23
- if SourceCodeSetup."Statistical Account Journal" <> '' then
- SourceCodeSetup."Stat. Account Journal" := SourceCodeSetup."Statistical Account Journal"
- else
- SourceCodeSetup."Stat. Account Journal" := StatistAccJnlTok;
-#else
SourceCodeSetup."Stat. Account Journal" := StatistAccJnlTok;
-#endif
SourceCodeSetup.Modify();
InsertSourceCode(SourceCodeSetup."Stat. Account Journal", PageName(PAGE::"Statistical Accounts Journal"));
exit(SourceCodeSetup."Stat. Account Journal");
diff --git a/Apps/W1/SubscriptionBilling/App/Base/Codeunits/SubBillingInstallation.Codeunit.al b/Apps/W1/SubscriptionBilling/App/Base/Codeunits/SubBillingInstallation.Codeunit.al
index 2cbf77367b..668574c236 100644
--- a/Apps/W1/SubscriptionBilling/App/Base/Codeunits/SubBillingInstallation.Codeunit.al
+++ b/Apps/W1/SubscriptionBilling/App/Base/Codeunits/SubBillingInstallation.Codeunit.al
@@ -202,19 +202,19 @@ codeunit 8051 "Sub. Billing Installation"
var
CustomerLbl: Label 'Customer';
CustomerBillingTemplateDescriptionTxt: Label 'Sample template for customer billing';
- CustomerContractCodeLbl: Label 'CUSTCONTR';
+ CustomerContractCodeLbl: Label 'CUSTCONTR', MaxLength = 20;
CustomerContractDescriptionLbl: Label 'Customer Contracts';
- CustomerContractNoSeriesLineLbl: Label 'CUC';
+ CustomerContractNoSeriesLineLbl: Label 'CUC', MaxLength = 14;
VendorLbl: Label 'Vendor';
VendorBillingTemplateDescriptionTxt: Label 'Sample template for vendor billing';
- VendorContractCodeLbl: Label 'VENDCONTR';
+ VendorContractCodeLbl: Label 'VENDCONTR', MaxLength = 20;
VendorContractDescriptionLbl: Label 'Vendor Contracts';
- VendorContractNoSeriesLineLbl: Label 'VEC';
- ServiceObjectCodeLbl: Label 'SERVOBJECT';
+ VendorContractNoSeriesLineLbl: Label 'VEC', MaxLength = 14;
+ ServiceObjectCodeLbl: Label 'SERVOBJECT', MaxLength = 20;
ServiceObjectDescriptionLbl: Label 'Service Objects';
- ServiceObjectNoSeriesLineLbl: Label 'SOBJ';
+ ServiceObjectNoSeriesLineLbl: Label 'SOBJ', MaxLength = 14;
CustContractDimensionCodeLbl: Label 'CUSTOMERCONTRACT';
CustContractDimensionDescriptionLbl: Label 'Customer Contract Dimension';
- ContractDeferralReleaseCodeLbl: Label 'CONTDEFREL';
+ ContractDeferralReleaseCodeLbl: Label 'CONTDEFREL', MaxLength = 10;
ContractDeferralsReleaseDescriptionLbl: Label 'Contract Deferrals Release';
}
\ No newline at end of file
diff --git a/Apps/W1/SubscriptionBilling/App/Billing/Tables/BillingLineArchive.Table.al b/Apps/W1/SubscriptionBilling/App/Billing/Tables/BillingLineArchive.Table.al
index 991b986ff3..519b1b141b 100644
--- a/Apps/W1/SubscriptionBilling/App/Billing/Tables/BillingLineArchive.Table.al
+++ b/Apps/W1/SubscriptionBilling/App/Billing/Tables/BillingLineArchive.Table.al
@@ -26,6 +26,7 @@ table 8064 "Billing Line Archive"
field(2; "User ID"; Code[50])
{
Caption = 'User ID';
+ DataClassification = EndUserIdentifiableInformation;
Editable = false;
TableRelation = User."User Name";
}
diff --git a/Apps/W1/SubscriptionBilling/App/Contract Renewal/Codeunits/ContractRenewalSubcribers.Codeunit.al b/Apps/W1/SubscriptionBilling/App/Contract Renewal/Codeunits/ContractRenewalSubcribers.Codeunit.al
index 1e1a05f579..67a77f2e99 100644
--- a/Apps/W1/SubscriptionBilling/App/Contract Renewal/Codeunits/ContractRenewalSubcribers.Codeunit.al
+++ b/Apps/W1/SubscriptionBilling/App/Contract Renewal/Codeunits/ContractRenewalSubcribers.Codeunit.al
@@ -247,17 +247,8 @@ codeunit 8001 "Contract Renewal Subcribers"
IsHandled := true;
end;
-#if not CLEAN23
- [EventSubscriber(ObjectType::Codeunit, Codeunit::"Sales-Post", OnBeforeFillInvoicePostingBuffer, '', false, false)]
- local procedure OnBeforeFillInvoicePostBuffer(SalesLine: Record "Sales Line"; var IsHandled: Boolean)
- begin
- if SalesLine.IsContractRenewal() then
- IsHandled := true;
- end;
-#endif
-
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Sales Post Invoice Events", 'OnBeforePrepareLine', '', false, false)]
- local procedure OnBeforePrepareLine(SalesLine: Record "Sales Line"; var IsHandled: Boolean)
+ local procedure OnBeforeFillInvoicePostingBuffer(SalesLine: Record "Sales Line"; var IsHandled: Boolean)
begin
if SalesLine.IsContractRenewal() then
IsHandled := true;
@@ -277,19 +268,8 @@ codeunit 8001 "Contract Renewal Subcribers"
IsHandled := true;
end;
-#if not CLEAN23
- [EventSubscriber(ObjectType::Codeunit, Codeunit::"Sales-Post", OnBeforeRunPostCustomerEntry, '', false, false)]
- local procedure OnBeforeRunPostCustomerEntry(var SalesHeader: Record "Sales Header"; var TotalSalesLine2: Record "Sales Line"; var TotalSalesLineLCY2: Record "Sales Line"; CommitIsSuppressed: Boolean; PreviewMode: Boolean; DocType: Enum "Gen. Journal Document Type"; DocNo: Code[20]; ExtDocNo: Code[35]; SourceCode: Code[10]; var GenJnlPostLine: Codeunit "Gen. Jnl.-Post Line"; var IsHandled: Boolean)
- begin
- if not SalesHeader.Ship then
- exit;
- if SalesHeader.HasOnlyContractRenewalLines() then
- IsHandled := true;
- end;
-#endif
-
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Sales Post Invoice Events", 'OnBeforePostLedgerEntry', '', false, false)]
- local procedure OnBeforeRunPostLedgerEntry(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)
+ local procedure OnBeforeRunPostCustomerEntry(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)
begin
if not SalesHeader.Ship then
exit;
diff --git a/Apps/W1/SubscriptionBilling/App/Customer Contracts/Tables/CustomerContract.Table.al b/Apps/W1/SubscriptionBilling/App/Customer Contracts/Tables/CustomerContract.Table.al
index 8c955196d8..51a3cbc9bf 100644
--- a/Apps/W1/SubscriptionBilling/App/Customer Contracts/Tables/CustomerContract.Table.al
+++ b/Apps/W1/SubscriptionBilling/App/Customer Contracts/Tables/CustomerContract.Table.al
@@ -18,6 +18,7 @@ using Microsoft.CRM.Outlook;
using Microsoft.Finance.Dimension;
using Microsoft.Finance.Currency;
using Microsoft.Bank.BankAccount;
+using System.Security.AccessControl;
table 8052 "Customer Contract"
{
@@ -806,7 +807,7 @@ table 8052 "Customer Contract"
{
Caption = 'Assigned User ID';
DataClassification = EndUserIdentifiableInformation;
- TableRelation = "User Setup";
+ TableRelation = User."User Name";
}
field(9500; Active; Boolean)
{
diff --git a/Apps/W1/SubscriptionBilling/App/Deferrals/Codeunits/CustomerDeferralsMngmt.Codeunit.al b/Apps/W1/SubscriptionBilling/App/Deferrals/Codeunits/CustomerDeferralsMngmt.Codeunit.al
index 501aa34eb7..da20e5254f 100644
--- a/Apps/W1/SubscriptionBilling/App/Deferrals/Codeunits/CustomerDeferralsMngmt.Codeunit.al
+++ b/Apps/W1/SubscriptionBilling/App/Deferrals/Codeunits/CustomerDeferralsMngmt.Codeunit.al
@@ -29,31 +29,6 @@ codeunit 8067 "Customer Deferrals Mngmt."
TempCustomerContractDeferral.DeleteAll(false);
end;
-#if not CLEAN23
- [EventSubscriber(ObjectType::Codeunit, Codeunit::"Sales-Post", OnFillInvoicePostingBufferOnBeforeSetAccount, '', false, false)]
- local procedure SetSalesAccountOnAfterSetAmounts(SalesLine: Record "Sales Line"; var SalesAccount: Code[20])
- var
- CustContractHeader: Record "Customer Contract";
- GeneralPostingSetup: Record "General Posting Setup";
- BillingLine: Record "Billing Line";
- begin
- if not SalesLine.IsLineAttachedToBillingLine() then
- exit;
- BillingLine.FilterBillingLineOnDocumentLine(BillingLine.GetBillingDocumentTypeFromSalesDocumentType(SalesLine."Document Type"), SalesLine."Document No.", SalesLine."Line No.");
- BillingLine.FindFirst();
- CustContractHeader.Get(BillingLine."Contract No.");
-
- GeneralPostingSetup.Get(SalesLine."Gen. Bus. Posting Group", SalesLine."Gen. Prod. Posting Group");
- if CustContractHeader."Without Contract Deferrals" then begin
- GeneralPostingSetup.TestField("Customer Contract Account");
- SalesAccount := GeneralPostingSetup."Customer Contract Account";
- end else begin
- GeneralPostingSetup.TestField("Cust. Contr. Deferral Account");
- SalesAccount := GeneralPostingSetup."Cust. Contr. Deferral Account";
- end;
- end;
-#endif
-
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Sales Post Invoice Events", 'OnPrepareLineOnBeforeSetAccount', '', false, false)]
local procedure OnPrepareLineOnBeforeSetAccount(SalesLine: Record "Sales Line"; var SalesAccount: Code[20])
var
@@ -77,17 +52,6 @@ codeunit 8067 "Customer Deferrals Mngmt."
end;
end;
-#if not CLEAN23
- [EventSubscriber(ObjectType::Codeunit, Codeunit::"Sales-Post", OnFillInvoicePostingBufferOnBeforeSetLineDiscAccount, '', false, false)]
- local procedure SetLineDiscountAccountForCustomerContractDeferrals(SalesLine: Record "Sales Line"; GenPostingSetup: Record "General Posting Setup"; var LineDiscAccount: Code[20]; var IsHandled: Boolean)
- begin
- if IsCustomerContractWithDeferrals(SalesLine) then begin
- LineDiscAccount := GenPostingSetup."Cust. Contr. Deferral Account";
- IsHandled := true;
- end;
- end;
-#endif
-
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Sales Post Invoice Events", 'OnPrepareLineOnBeforeSetLineDiscAccount', '', false, false)]
local procedure OnPrepareLineOnBeforeSetLineDiscAccount(SalesLine: Record "Sales Line"; GenPostingSetup: Record "General Posting Setup"; var InvDiscAccount: Code[20]; var IsHandled: Boolean)
begin
diff --git a/Apps/W1/SubscriptionBilling/App/Deferrals/Codeunits/VendorDeferralsMngmt.Codeunit.al b/Apps/W1/SubscriptionBilling/App/Deferrals/Codeunits/VendorDeferralsMngmt.Codeunit.al
index 59a2fbb1ca..1fa5c713b0 100644
--- a/Apps/W1/SubscriptionBilling/App/Deferrals/Codeunits/VendorDeferralsMngmt.Codeunit.al
+++ b/Apps/W1/SubscriptionBilling/App/Deferrals/Codeunits/VendorDeferralsMngmt.Codeunit.al
@@ -30,34 +30,6 @@ codeunit 8068 "Vendor Deferrals Mngmt."
TempVendorContractDeferral.DeleteAll(false);
end;
-#if not CLEAN23
- [EventSubscriber(ObjectType::Codeunit, Codeunit::"Purch.-Post", OnFillInvoicePostingBufferOnBeforeSetAccount, '', false, false)]
- local procedure SetPurchaseAccountOnAfterSetAmounts(PurchaseLine: Record "Purchase Line"; var PurchAccount: Code[20])
- var
- VendContractHeader: Record "Vendor Contract";
- GeneralPostingSetup: Record "General Posting Setup";
- BillingLine: Record "Billing Line";
- begin
- BillingLine.SetRange("Document Type", BillingLine.GetBillingDocumentTypeFromPurchaseDocumentType(PurchaseLine."Document Type"));
- BillingLine.SetRange("Document No.", PurchaseLine."Document No.");
- BillingLine.SetRange("Document Line No.", PurchaseLine."Line No.");
- BillingLine.SetFilter("Billing from", '>=%1', PurchaseLine."Recurring Billing from");
- BillingLine.SetFilter("Billing to", '<=%1', PurchaseLine."Recurring Billing to");
- if not BillingLine.FindFirst() then
- exit;
-
- VendContractHeader.Get(BillingLine."Contract No.");
- GeneralPostingSetup.Get(PurchaseLine."Gen. Bus. Posting Group", PurchaseLine."Gen. Prod. Posting Group");
- if VendContractHeader."Without Contract Deferrals" then begin
- GeneralPostingSetup.TestField("Vendor Contract Account");
- PurchAccount := GeneralPostingSetup."Vendor Contract Account";
- end else begin
- GeneralPostingSetup.TestField("Vend. Contr. Deferral Account");
- PurchAccount := GeneralPostingSetup."Vend. Contr. Deferral Account";
- end;
- end;
-#endif
-
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Purch. Post Invoice Events", 'OnPrepareLineOnBeforeSetAccount', '', false, false)]
local procedure OnPrepareLineOnBeforeSetAccount(PurchLine: Record "Purchase Line"; var SalesAccount: Code[20])
var
@@ -84,19 +56,6 @@ codeunit 8068 "Vendor Deferrals Mngmt."
end;
end;
-#if not CLEAN23
- [EventSubscriber(ObjectType::Codeunit, Codeunit::"Purch.-Post", OnFillInvoicePostBufferOnAfterInitAmounts, '', false, false)]
- local procedure SetVendorContractDeferralLinePostingOld(PurchLine: Record "Purchase Line")
- begin
- VendorContractDeferralLinePosting := false;
- Clear(TempPurchaseLine);
- if IsVendorContractWithDeferrals(PurchLine) then begin
- VendorContractDeferralLinePosting := true;
- TempPurchaseLine := PurchLine;
- end;
- end;
-#endif
-
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Purch. Post Invoice Events", 'OnAfterInitTotalAmounts', '', false, false)]
local procedure SetVendorContractDeferralLinePosting(PurchLine: Record "Purchase Line")
begin
diff --git a/Apps/W1/SubscriptionBilling/App/Import/Tables/ImportedCustomerContract.Table.al b/Apps/W1/SubscriptionBilling/App/Import/Tables/ImportedCustomerContract.Table.al
index 027dc9e661..f1acfab059 100644
--- a/Apps/W1/SubscriptionBilling/App/Import/Tables/ImportedCustomerContract.Table.al
+++ b/Apps/W1/SubscriptionBilling/App/Import/Tables/ImportedCustomerContract.Table.al
@@ -10,6 +10,7 @@ using Microsoft.Foundation.PaymentTerms;
using Microsoft.Bank.BankAccount;
using Microsoft.Finance.Dimension;
using Microsoft.Finance.Currency;
+using System.Security.AccessControl;
table 8010 "Imported Customer Contract"
{
@@ -214,7 +215,10 @@ table 8010 "Imported Customer Contract"
field(102; "Processed by"; Code[50])
{
Caption = 'Processed by';
+ DataClassification = EndUserIdentifiableInformation;
+ TableRelation = User."User Name";
Editable = false;
+ ValidateTableRelation = false;
}
field(103; "Processed at"; DateTime)
{
diff --git a/Apps/W1/SubscriptionBilling/App/Import/Tables/ImportedServiceCommitment.Table.al b/Apps/W1/SubscriptionBilling/App/Import/Tables/ImportedServiceCommitment.Table.al
index cf3b6e3029..53d98d3da3 100644
--- a/Apps/W1/SubscriptionBilling/App/Import/Tables/ImportedServiceCommitment.Table.al
+++ b/Apps/W1/SubscriptionBilling/App/Import/Tables/ImportedServiceCommitment.Table.al
@@ -2,6 +2,7 @@ namespace Microsoft.SubscriptionBilling;
using Microsoft.Inventory.Item;
using Microsoft.Finance.Currency;
+using System.Security.AccessControl;
table 8009 "Imported Service Commitment"
{
@@ -211,7 +212,10 @@ table 8009 "Imported Service Commitment"
field(102; "Processed by"; Code[50])
{
Caption = 'Processed by';
+ DataClassification = EndUserIdentifiableInformation;
+ TableRelation = User."User Name";
Editable = false;
+ ValidateTableRelation = false;
}
field(103; "Processed at"; DateTime)
{
diff --git a/Apps/W1/SubscriptionBilling/App/Import/Tables/ImportedServiceObject.Table.al b/Apps/W1/SubscriptionBilling/App/Import/Tables/ImportedServiceObject.Table.al
index 84bce78b9b..e2b075f145 100644
--- a/Apps/W1/SubscriptionBilling/App/Import/Tables/ImportedServiceObject.Table.al
+++ b/Apps/W1/SubscriptionBilling/App/Import/Tables/ImportedServiceObject.Table.al
@@ -3,6 +3,7 @@ namespace Microsoft.SubscriptionBilling;
using Microsoft.Sales.Customer;
using Microsoft.CRM.Contact;
using Microsoft.Inventory.Item;
+using System.Security.AccessControl;
table 8008 "Imported Service Object"
{
@@ -124,7 +125,10 @@ table 8008 "Imported Service Object"
field(102; "Processed by"; Code[50])
{
Caption = 'Processed by';
+ DataClassification = EndUserIdentifiableInformation;
+ TableRelation = User."User Name";
Editable = false;
+ ValidateTableRelation = false;
}
field(103; "Processed at"; DateTime)
{
diff --git a/Apps/W1/SubscriptionBilling/Test/Billing/RecurringBillingDocsTest.Codeunit.al b/Apps/W1/SubscriptionBilling/Test/Billing/RecurringBillingDocsTest.Codeunit.al
index 84082548f2..41dde0c953 100644
--- a/Apps/W1/SubscriptionBilling/Test/Billing/RecurringBillingDocsTest.Codeunit.al
+++ b/Apps/W1/SubscriptionBilling/Test/Billing/RecurringBillingDocsTest.Codeunit.al
@@ -60,6 +60,8 @@ codeunit 139687 "Recurring Billing Docs Test"
LibraryPurchase: Codeunit "Library - Purchase";
LibraryUtility: Codeunit "Library - Utility";
LibraryERM: Codeunit "Library - ERM";
+ LibraryERMCountryData: Codeunit "Library - ERM Country Data";
+ LibraryTestInitialize: Codeunit "Library - Test Initialize";
BillingProposal: Codeunit "Billing Proposal";
DocChangeMgt: Codeunit "Document Change Management";
LibraryRandom: Codeunit "Library - Random";
@@ -83,159 +85,14 @@ codeunit 139687 "Recurring Billing Docs Test"
EmptyArray: Boolean;
NextBillingToDate: Date;
DialogMsg: Text;
-
- local procedure InitServiceContractSetup()
- var
- ServiceContractSetup: Record "Service Contract Setup";
- begin
- ServiceContractSetup.Get();
- ServiceContractSetup.ContractTextsCreateDefaults();
- ServiceContractSetup.Modify(false);
- end;
-
- local procedure SetupBasicBillingProposal(ServicePartner: Enum "Service Partner")
- begin
- ClearAll();
- case ServicePartner of
- Enum::"Service Partner"::Customer:
- ContractTestLibrary.CreateCustomerContractAndCreateContractLinesAndBillingProposal(CustomerContract, ServiceObject, '', BillingTemplate);
- Enum::"Service Partner"::Vendor:
- ContractTestLibrary.CreateVendorContractAndCreateContractLinesAndBillingProposal(VendorContract, ServiceObject, '', BillingTemplate);
- end;
- ContractTestLibrary.CreateDefaultRecurringBillingTemplateForServicePartner(BillingTemplate2, ServicePartner);
- ContractTestLibrary.CreateBillingProposal(BillingTemplate2, ServicePartner);
- end;
-
- local procedure InitAndCreateBillingDocument(ServicePartner: Enum "Service Partner")
- begin
- SetupBasicBillingProposal(ServicePartner);
- CreateBillingDocuments();
- end;
-
- local procedure CreateBillingDocuments()
- begin
- CreateBillingDocuments(true);
- end;
-
- local procedure CreateBillingDocuments(InitializeTextSetup: Boolean)
- begin
- if InitializeTextSetup then begin
- InitServiceContractSetup();
- // Commit before asserterror to keep data
- Commit();
- end;
- BillingLine.SetRange("Billing Template Code", BillingTemplate.Code);
- BillingLine.SetRange(Partner, BillingTemplate.Partner);
- Codeunit.Run(Codeunit::"Create Billing Documents", BillingLine);
- Commit(); // retain data after asserterror
- end;
-
- local procedure InitAndCreateBillingDocumentsForMultipleContracts()
- begin
- //Contract1, Sell-to Customer1, Bill-to Customer1
- //Contract2, Sell-to Customer2, Bill-to Customer2
- //Contract3, Sell-to Customer2, Bill-to Customer1
- //Contract4, Sell-to Customer3, Bill-to Customer1
- ClearAll();
- ContractTestLibrary.CreateCustomerContractAndCreateContractLines(CustomerContract, ServiceObject, '');
- ContractTestLibrary.CreateCustomer(Customer2);
- ContractTestLibrary.CreateCustomerContractAndCreateContractLines(CustomerContract2, ServiceObject2, Customer2."No.");
- CustomerContract2.Validate("Currency Code", CustomerContract."Currency Code");
- CustomerContract2.Modify(false);
- ContractTestLibrary.CreateCustomerContractAndCreateContractLines(CustomerContract3, ServiceObject3, Customer2."No.");
- CustomerContract3.SetHideValidationDialog(true);
- CustomerContract3.Validate("Bill-to Customer No.", CustomerContract."Bill-to Customer No.");
- CustomerContract3.Validate("Currency Code", CustomerContract."Currency Code");
- CustomerContract3.Modify(false);
- ContractTestLibrary.CreateCustomer(Customer3);
- ContractTestLibrary.CreateCustomerContractAndCreateContractLines(CustomerContract4, ServiceObject4, Customer3."No.");
- CustomerContract4.SetHideValidationDialog(true);
- CustomerContract4.Validate("Bill-to Customer No.", CustomerContract."Bill-to Customer No.");
- CustomerContract4.Validate("Currency Code", CustomerContract."Currency Code");
- CustomerContract4.Modify(false);
- ContractTestLibrary.CreateBillingProposal(BillingTemplate, Enum::"Service Partner"::Customer);
- CreateBillingDocuments();
- end;
-
- local procedure InitAndCreateBillingDocumentsForMultipleVendorContracts()
- begin
- //Contract1, Sell-to Customer1, Bill-to Customer1
- //Contract2, Sell-to Customer2, Bill-to Customer2
- //Contract3, Sell-to Customer2, Bill-to Customer1
- //Contract4, Sell-to Customer3, Bill-to Customer1
- ClearAll();
- ContractTestLibrary.CreateVendorContractAndCreateContractLines(VendorContract, ServiceObject, '');
- ContractTestLibrary.CreateVendor(Vendor2);
- ContractTestLibrary.CreateVendorContractAndCreateContractLines(VendorContract2, ServiceObject2, Vendor2."No.");
- VendorContract2.Validate("Currency Code", VendorContract."Currency Code");
- VendorContract2.Modify(false);
- ContractTestLibrary.CreateVendorContractAndCreateContractLines(VendorContract3, ServiceObject3, Vendor2."No.");
- VendorContract3.SetHideValidationDialog(true);
- VendorContract3.Validate("Currency Code", VendorContract."Currency Code");
- VendorContract3.Validate("Pay-to Vendor No.", VendorContract."Buy-from Vendor No.");
- VendorContract3.Modify(false);
- ContractTestLibrary.CreateVendor(Vendor3);
- ContractTestLibrary.CreateVendorContractAndCreateContractLines(VendorContract4, ServiceObject4, Vendor3."No.");
- VendorContract4.SetHideValidationDialog(true);
- VendorContract4.Validate("Pay-to Vendor No.", VendorContract."Buy-from Vendor No.");
- VendorContract4.Validate("Currency Code", VendorContract."Currency Code");
- VendorContract4.Modify(false);
- ContractTestLibrary.CreateBillingProposal(BillingTemplate, Enum::"Service Partner"::Vendor);
- CreateBillingDocuments();
- end;
-
- local procedure CheckIfSalesDocumentsHaveBeenCreated()
- var
- TempSalesHeader: Record "Sales Header" temporary;
- begin
- if BillingLine.FindSet() then
- repeat
- BillingLine.TestField("Document Type", Enum::"Rec. Billing Document Type"::Invoice);
- BillingLine.TestField("Document No.");
- SalesHeader.Get(Enum::"Sales Document Type"::Invoice, BillingLine."Document No.");
- SalesHeader.TestField("Assigned User ID", UserId());
- FilterSalesLineOnDocumentLine(SalesHeader."Document Type", SalesHeader."No.", BillingLine."Document Line No.");
- AssertThat.AreEqual(1, SalesLine.Count, 'The Sales lines were not created properly.');
- SalesLine.FindFirst();
- BillingLine.CalcFields("Service Object Description");
- SalesLine.TestField(Description, BillingLine."Service Object Description");
- SalesLine.TestField("Description 2", '');
- if not TempSalesHeader.Get(SalesHeader."Document Type", SalesHeader."No.") then begin
- TempSalesHeader.TransferFields(SalesHeader);
- TempSalesHeader.Insert(false);
- DocumentsCount += 1;
- end;
- until BillingLine.Next() = 0;
- end;
-
- local procedure CheckIfPurchaseDocumentsHaveBeenCreated()
- var
- TempPurchaseHeader: Record "Purchase Header" temporary;
- begin
- if BillingLine.FindSet() then
- repeat
- BillingLine.TestField("Document Type", Enum::"Rec. Billing Document Type"::Invoice);
- BillingLine.TestField("Document No.");
- PurchaseHeader.Get(Enum::"Purchase Document Type"::Invoice, BillingLine."Document No.");
- PurchaseHeader.TestField("Assigned User ID", UserId());
- FilterPurchaseLineOnDocumentLine(PurchaseHeader."Document Type", BillingLine."Document No.", BillingLine."Document Line No.");
- AssertThat.AreEqual(1, PurchaseLine.Count, 'The Purchase lines were not created properly.');
- PurchaseLine.FindFirst();
- PurchaseLine.TestField(Description, BillingLine."Service Commitment Description");
- BillingLine.CalcFields("Service Object Description");
- PurchaseLine.TestField("Description 2", BillingLine."Service Object Description");
- if not TempPurchaseHeader.Get(PurchaseHeader."Document Type", PurchaseHeader."No.") then begin
- TempPurchaseHeader.TransferFields(PurchaseHeader);
- TempPurchaseHeader.Insert(false);
- PurchaseDocumentCount += 1;
- end;
- until BillingLine.Next() = 0;
- end;
+ IsInitialized: Boolean;
[Test]
[HandlerFunctions('ExchangeRateSelectionModalPageHandler,MessageHandler')]
procedure ExpectBillingLinesCheckErrorsForCustomer()
begin
+ Initialize();
+
SetupBasicBillingProposal(Enum::"Service Partner"::Customer);
BillingLine.SetFilter("Billing Template Code", '%1|%2', BillingTemplate.Code, BillingTemplate2.Code);
BillingLine.SetRange(Partner, BillingLine.Partner::Customer);
@@ -245,11 +102,12 @@ codeunit 139687 "Recurring Billing Docs Test"
asserterror Codeunit.Run(Codeunit::"Create Billing Documents", BillingLine);
end;
-
[Test]
[HandlerFunctions('ExchangeRateSelectionModalPageHandler,MessageHandler')]
procedure ExpectBillingLinesCheckErrorsForVendor()
begin
+ Initialize();
+
SetupBasicBillingProposal(Enum::"Service Partner"::Vendor);
BillingLine.SetFilter("Billing Template Code", '%1|%2', BillingTemplate.Code, BillingTemplate2.Code);
BillingLine.SetRange(Partner, BillingLine.Partner::Vendor);
@@ -263,6 +121,8 @@ codeunit 139687 "Recurring Billing Docs Test"
[HandlerFunctions('CreateCustomerBillingDocsTestOpenPageHandler,ExchangeRateSelectionModalPageHandler,MessageHandler')]
procedure CheckRequestPageSelectionConfirmedForCustomer()
begin
+ Initialize();
+
InitAndCreateBillingDocument(Enum::"Service Partner"::Customer);
//The Request Page has been cancelled, therefore no Sales Document should have been created
if BillingLine.FindSet() then
@@ -276,6 +136,8 @@ codeunit 139687 "Recurring Billing Docs Test"
[HandlerFunctions('CancelCreateVendorBillingDocsTestOpenPageHandler,ExchangeRateSelectionModalPageHandler,MessageHandler')]
procedure CheckRequestPageSelectionConfirmedForVendor()
begin
+ Initialize();
+
InitAndCreateBillingDocument(Enum::"Service Partner"::Vendor);
//The Request Page has been cancelled, therefore no Purchase Document should have been created
if BillingLine.FindSet() then
@@ -289,6 +151,8 @@ codeunit 139687 "Recurring Billing Docs Test"
[HandlerFunctions('CreateCustomerBillingDocsContractPageHandler,ExchangeRateSelectionModalPageHandler,MessageHandler')]
procedure CreateSalesDocumentsPerContract()
begin
+ Initialize();
+
//Contract1, Sell-to Customer1, Bill-to Customer1
//Contract2, Sell-to Customer2, Bill-to Customer2
//Contract3, Sell-to Customer2, Bill-to Customer1
@@ -306,6 +170,8 @@ codeunit 139687 "Recurring Billing Docs Test"
Item: Record Item;
LastContractLineNo: Integer;
begin
+ Initialize();
+
//ServiceObject
//ServiceObject2
//load ServiceObject2 in Contract
@@ -341,6 +207,8 @@ codeunit 139687 "Recurring Billing Docs Test"
[HandlerFunctions('CreateCustomerBillingDocsContractPageHandler,ExchangeRateSelectionModalPageHandler,MessageHandler')]
procedure CheckSingleContractSalesInvoiceHeaderPostingDescription()
begin
+ Initialize();
+
InitAndCreateBillingDocument(Enum::"Service Partner"::Customer);
BillingLine.FindLast();
SalesHeader.Get(Enum::"Sales Document Type"::Invoice, BillingLine."Document No.");
@@ -353,6 +221,8 @@ codeunit 139687 "Recurring Billing Docs Test"
[HandlerFunctions('CreateCustomerBillingDocsBillToCustomerPageHandler,ExchangeRateSelectionModalPageHandler,MessageHandler')]
procedure CheckMultipleContractsSalesInvoiceHeaderPostingDescription()
begin
+ Initialize();
+
InitAndCreateBillingDocumentsForMultipleContracts();
BillingLine.FindLast();
SalesHeader.Get(Enum::"Sales Document Type"::Invoice, BillingLine."Document No.");
@@ -365,6 +235,8 @@ codeunit 139687 "Recurring Billing Docs Test"
[HandlerFunctions('CreateCustomerBillingDocsSellToCustomerPageHandler,ExchangeRateSelectionModalPageHandler,MessageHandler')]
procedure CreateSalesDocumentsPerSellToCustomer()
begin
+ Initialize();
+
//Contract1, Sell-to Customer1, Bill-to Customer1
//Contract2, Sell-to Customer2, Bill-to Customer2
//Contract3, Sell-to Customer2, Bill-to Customer1
@@ -378,6 +250,8 @@ codeunit 139687 "Recurring Billing Docs Test"
[HandlerFunctions('CreateCustomerBillingDocsBillToCustomerPageHandler,ExchangeRateSelectionModalPageHandler,MessageHandler')]
procedure CreateSalesDocumentsPerBillToCustomer()
begin
+ Initialize();
+
//Contract1, Sell-to Customer1, Bill-to Customer1
//Contract2, Sell-to Customer2, Bill-to Customer2
//Contract3, Sell-to Customer2, Bill-to Customer1
@@ -391,6 +265,8 @@ codeunit 139687 "Recurring Billing Docs Test"
[HandlerFunctions('CreateVendorBillingDocsContractPageHandler,ExchangeRateSelectionModalPageHandler,MessageHandler')]
procedure CreatePurchaseDocumentsPerContract()
begin
+ Initialize();
+
//Contract1, Buy-from Vendor1, Pay-to Vendor1
//Contract2, Buy-from Vendor2, Pay-to Vendor2
//Contract3, Buy-from Vendor2, Bill-to Vendor1
@@ -404,6 +280,8 @@ codeunit 139687 "Recurring Billing Docs Test"
[HandlerFunctions('CreateVendorBillingDocsContractPageHandler,ExchangeRateSelectionModalPageHandler,MessageHandler')]
procedure CheckPurchInvoiceHeaderPostingDescription()
begin
+ Initialize();
+
InitAndCreateBillingDocument(Enum::"Service Partner"::Vendor);
BillingLine.FindLast();
PurchaseHeader.Get(Enum::"Purchase Document Type"::Invoice, BillingLine."Document No.");
@@ -418,6 +296,8 @@ codeunit 139687 "Recurring Billing Docs Test"
[HandlerFunctions('CreateVendorBillingDocsPayToVendorPageHandler,ExchangeRateSelectionModalPageHandler,MessageHandler')]
procedure CheckMultipleContractsPurchaseInvoiceHeaderPostingDescription()
begin
+ Initialize();
+
InitAndCreateBillingDocumentsForMultipleVendorContracts();
BillingLine.FindLast();
PurchaseHeader.Get(Enum::"Purchase Document Type"::Invoice, BillingLine."Document No.");
@@ -432,6 +312,8 @@ codeunit 139687 "Recurring Billing Docs Test"
[HandlerFunctions('CreateVendorBillingDocsBuyFromVendorPageHandler,ExchangeRateSelectionModalPageHandler,MessageHandler')]
procedure CreatePurchaseDocumentsPerBuyFromVendor()
begin
+ Initialize();
+
//Contract1, Buy-from Vendor1, Pay-to Vendor1
//Contract2, Buy-from Vendor2, Pay-to Vendor2
//Contract3, Buy-from Vendor2, Pay-to Vendor1
@@ -445,6 +327,8 @@ codeunit 139687 "Recurring Billing Docs Test"
[HandlerFunctions('CreateVendorBillingDocsPayToVendorPageHandler,ExchangeRateSelectionModalPageHandler,MessageHandler')]
procedure CreatePurchaseDocumentsPerPayToVendor()
begin
+ Initialize();
+
//Contract1, Buy-from Vendor1, Pay-to Vendor1
//Contract2, Buy-from Vendor2, Pay-to Vendor2
//Contract3, Buy-from Vendor2, Pay-to Vendor1
@@ -458,6 +342,8 @@ codeunit 139687 "Recurring Billing Docs Test"
[HandlerFunctions('CreateCustomerBillingDocsContractPageHandler,ExchangeRateSelectionModalPageHandler,MessageHandler')]
procedure PostSalesInvoice()
begin
+ Initialize();
+
InitAndCreateBillingDocument(Enum::"Service Partner"::Customer);
BillingLine.FindLast();
SalesHeader.Get(Enum::"Sales Document Type"::Invoice, BillingLine."Document No.");
@@ -472,6 +358,8 @@ codeunit 139687 "Recurring Billing Docs Test"
[HandlerFunctions('CreateVendorBillingDocsContractPageHandler,ExchangeRateSelectionModalPageHandler,MessageHandler')]
procedure PostPurchaseInvoice()
begin
+ Initialize();
+
InitAndCreateBillingDocument(Enum::"Service Partner"::Vendor);
BillingLine.FindLast();
PurchaseHeader.Get(Enum::"Purchase Document Type"::Invoice, BillingLine."Document No.");
@@ -488,6 +376,8 @@ codeunit 139687 "Recurring Billing Docs Test"
[HandlerFunctions('CreateCustomerBillingDocsContractPageHandler,ExchangeRateSelectionModalPageHandler,MessageHandler')]
procedure DeleteSalesDocument()
begin
+ Initialize();
+
InitAndCreateBillingDocument(Enum::"Service Partner"::Customer);
BillingLine.FindLast();
SalesHeader.Get(Enum::"Sales Document Type"::Invoice, BillingLine."Document No.");
@@ -502,6 +392,8 @@ codeunit 139687 "Recurring Billing Docs Test"
[HandlerFunctions('CreateVendorBillingDocsContractPageHandler,ExchangeRateSelectionModalPageHandler,MessageHandler')]
procedure DeletePurchaseDocument()
begin
+ Initialize();
+
InitAndCreateBillingDocument(Enum::"Service Partner"::Vendor);
BillingLine.FindLast();
PurchaseHeader.Get(Enum::"Purchase Document Type"::Invoice, BillingLine."Document No.");
@@ -516,6 +408,8 @@ codeunit 139687 "Recurring Billing Docs Test"
[HandlerFunctions('CreateCustomerBillingDocsContractPageHandler,ExchangeRateSelectionModalPageHandler,MessageHandler')]
procedure DeleteSalesLine()
begin
+ Initialize();
+
InitAndCreateBillingDocument(Enum::"Service Partner"::Customer);
BillingLine.FindLast();
FilterSalesLineOnDocumentLine(Enum::"Sales Document Type"::Invoice, BillingLine."Document No.", BillingLine."Document Line No.");
@@ -531,6 +425,8 @@ codeunit 139687 "Recurring Billing Docs Test"
[HandlerFunctions('CreateVendorBillingDocsContractPageHandler,ExchangeRateSelectionModalPageHandler,MessageHandler')]
procedure DeletePurchaseLine()
begin
+ Initialize();
+
InitAndCreateBillingDocument(Enum::"Service Partner"::Vendor);
BillingLine.FindLast();
FilterPurchaseLineOnDocumentLine(BillingLine.GetPurchaseDocumentTypeFromBillingDocumentType(), BillingLine."Document No.", BillingLine."Document Line No.");
@@ -546,6 +442,8 @@ codeunit 139687 "Recurring Billing Docs Test"
[HandlerFunctions('CreateCustomerBillingDocsContractPageHandler,ExchangeRateSelectionModalPageHandler,MessageHandler')]
procedure CreateSalesDocumentsPerCurrencyCode()
begin
+ Initialize();
+
ClearAll();
ContractTestLibrary.CreateCustomer(Customer2);
ContractTestLibrary.CreateCustomerContractAndCreateContractLines(CustomerContract2, ServiceObject2, Customer2."No.");
@@ -566,6 +464,8 @@ codeunit 139687 "Recurring Billing Docs Test"
[HandlerFunctions('CreateVendorBillingDocsContractPageHandler,ExchangeRateSelectionModalPageHandler,MessageHandler')]
procedure CreatePurchaseDocumentsPerCurrencyCode()
begin
+ Initialize();
+
ClearAll();
ContractTestLibrary.CreateVendor(Vendor2);
ContractTestLibrary.CreateVendorContractAndCreateContractLines(VendorContract2, ServiceObject2, Vendor2."No.");
@@ -586,6 +486,8 @@ codeunit 139687 "Recurring Billing Docs Test"
[HandlerFunctions('CreateVendorBillingDocsContractPageHandler,ExchangeRateSelectionModalPageHandler,MessageHandler')]
procedure ExpectErrorChangeBillingToDateWhenDocNoExists()
begin
+ Initialize();
+
InitAndCreateBillingDocumentsForMultipleVendorContracts();
BillingLine.SetRange("Billing Template Code", BillingTemplate.Code);
BillingLine.SetRange("Service Object No.", ServiceObject."No.");
@@ -597,6 +499,8 @@ codeunit 139687 "Recurring Billing Docs Test"
[HandlerFunctions('CreateCustomerBillingDocsContractPageHandler,ExchangeRateSelectionModalPageHandler,MessageHandler')]
procedure ExpectErrorOnModifySalesHeader()
begin
+ Initialize();
+
InitAndCreateBillingDocument(Enum::"Service Partner"::Customer);
BillingLine.FindLast();
SalesHeader.Get(Enum::"Sales Document Type"::Invoice, BillingLine."Document No.");
@@ -618,6 +522,8 @@ codeunit 139687 "Recurring Billing Docs Test"
SalesInvoiceSubForm: TestPage "Sales Invoice Subform";
SalesCrMemoSubForm: TestPage "Sales Cr. Memo Subform";
begin
+ Initialize();
+
InitAndCreateBillingDocument(Enum::"Service Partner"::Customer);
BillingLine.FindLast();
SalesHeader.Get(Enum::"Sales Document Type"::Invoice, BillingLine."Document No.");
@@ -651,6 +557,8 @@ codeunit 139687 "Recurring Billing Docs Test"
[HandlerFunctions('CreateVendorBillingDocsContractPageHandler,ExchangeRateSelectionModalPageHandler,MessageHandler')]
procedure ExpectErrorOnModifyPurchaseHeader()
begin
+ Initialize();
+
EmptyArray := false;
InitAndCreateBillingDocument(Enum::"Service Partner"::Vendor);
BillingLine.FindLast();
@@ -675,6 +583,8 @@ codeunit 139687 "Recurring Billing Docs Test"
PurchaseInvoiceSubForm: TestPage "Purch. Invoice Subform";
PurchaseCrMemoSubForm: TestPage "Purch. Cr. Memo Subform";
begin
+ Initialize();
+
InitAndCreateBillingDocument(Enum::"Service Partner"::Vendor);
BillingLine.FindLast();
PurchaseHeader.Get(Enum::"Purchase Document Type"::Invoice, BillingLine."Document No.");
@@ -717,6 +627,8 @@ codeunit 139687 "Recurring Billing Docs Test"
FieldTranslation: Record "Field Translation";
LanguageMgt: Codeunit Language;
begin
+ Initialize();
+
ClearAll();
ContractTestLibrary.CreateContractType(ContractType);
ContractTestLibrary.CreateTranslationForField(FieldTranslation, ContractType, ContractType.FieldNo(Description), LanguageMgt.GetLanguageCode(GlobalLanguage));
@@ -742,232 +654,42 @@ codeunit 139687 "Recurring Billing Docs Test"
AssertThat.AreEqual(1, SalesLine.Count, 'Translated Contract Type Description not found');
end;
- local procedure TestDocumentFields(CalledFromSales: Boolean)
- var
- ValueCode: Text[10];
- ValueInteger: Integer;
- ValueDecimal: Decimal;
+ [Test]
+ [HandlerFunctions('CreateAndPostCustomerBillingDocsContractPageHandler,ExchangeRateSelectionModalPageHandler,MessageHandler')]
+ procedure CreateAndPostSalesDocumentsPerContract()
begin
- i := 1;
- repeat
- FRef := RRef.Field(FieldsArray[i]);
+ Initialize();
- case FRef.Type() of
- FieldType::Decimal:
- begin
- ValueDecimal := FRef.Value;
- FRef.Value(ValueDecimal + 1);
- end;
- FieldType::Integer, FieldType::Option:
- begin
- ValueInteger := FRef.Value;
- FRef.Value(ValueInteger + 1);
- end;
- FieldType::Code, FieldType::Text:
- begin
- ValueCode := CopyStr(LibraryRandom.RandText(10), 1, 10);
- FRef.Value(ValueCode);
- end;
- FieldType::Date:
- FRef.Value(CalcDate('<1D>', FRef.Value));
- FieldType::Boolean:
- FRef.Value(not FRef.Value);
- end;
+ //Contract1, Sell-to Customer1, Bill-to Customer1
+ //Contract2, Sell-to Customer2, Bill-to Customer2
+ //Contract3, Sell-to Customer2, Bill-to Customer1
+ //Contract4, Sell-to Customer3, Bill-to Customer1
+ InitAndCreateBillingDocumentsForMultipleContracts();
+ CheckIfPostedSalesDocumentsHaveBeenCreated();
+ AssertThat.AreEqual(4, DocumentsCount, 'Posted Sales Documents were not created correctly');
+ end;
- asserterror DocChangeMgt.PreventChangeOnDocumentHeaderOrLine(RRef, FieldsArray[i]);
- i += 1;
- if ((i in [20, 40, 43]) and not CalledFromSales) then //skip ID that's not in Purchase Hdr but exists in Sales Hdr
- i += 1;
- if FieldsArray[i] = 0 then
- EmptyArray := true;
- until EmptyArray = true;
+ [Test]
+ [HandlerFunctions('CreateAndPostCustomerBillingDocsSellToCustomerPageHandler,ExchangeRateSelectionModalPageHandler,MessageHandler')]
+ procedure CreateAndPostSalesDocumentsPerSellToCustomer()
+ begin
+ Initialize();
+
+ //Contract1, Sell-to Customer1, Bill-to Customer1
+ //Contract2, Sell-to Customer2, Bill-to Customer2
+ //Contract3, Sell-to Customer2, Bill-to Customer1
+ //Contract4, Sell-to Customer3, Bill-to Customer1
+ InitAndCreateBillingDocumentsForMultipleContracts();
+ CheckIfPostedSalesDocumentsHaveBeenCreated();
+ AssertThat.AreEqual(3, DocumentsCount, 'Posted Sales Documents were not created correctly');
end;
- local procedure PopulateArrayOfFieldsForHeaders(CalledFromSales: Boolean)
+ [Test]
+ [HandlerFunctions('CreateAndPostCustomerBillingDocsBillToCustomerPageHandler,ExchangeRateSelectionModalPageHandler,MessageHandler')]
+ procedure CreateAndPostSalesDocumentsPerBillToCustomer()
begin
- FieldsArray[1] := 2; //Sell-to Customer No. //Buy-from Vendor No. (Buy-from Vendor No.)
- FieldsArray[2] := 4; //Bill-to Customer No. //Pay-to Vendor No. (Pay-to Vendor No.)
- FieldsArray[3] := 5; //Bill-to Name //Pay-to Name (Pay-to Name)
- FieldsArray[4] := 6; //Bill-to Name 2 //Pay-to Name 2 (Pay-to Name 2)
- FieldsArray[5] := 7; //Bill-to Address (Bill-to Address) //Pay-to Address (Pay-to Address)
- FieldsArray[6] := 8; //Bill-to Address 2 (Bill-to Address 2) //Pay-to Address 2 (Pay-to Address 2)
- FieldsArray[7] := 9; //Bill-to City (Bill-to City) //Pay-to City (Pay-to City)
- FieldsArray[8] := 10; //Bill-to Contact (Bill-to Contact) //Pay-to Contact (Pay-to Contact)
- FieldsArray[9] := 12; //Ship-to Code (Ship-to Code) //Ship-to Code (Ship-to Code)
- FieldsArray[10] := 13; //Ship-to Name (Ship-to Name) //Ship-to Name (Ship-to Name)
- FieldsArray[11] := 14; //Ship-to Name 2 (Ship-to Name 2) //Ship-to Name 2 (Ship-to Name 2)
- FieldsArray[12] := 15; //Ship-to Address (Ship-to Address) //Ship-to Address (Ship-to Address)
- FieldsArray[13] := 16; //Ship-to Address 2 (Ship-to Address 2) //Ship-to Address 2 (Ship-to Address 2)
- FieldsArray[14] := 17; //Ship-to City (Ship-to City) //Ship-to City (Ship-to City)
- FieldsArray[15] := 18; //Ship-to Contact (Ship-to Contact) //Ship-to Contact (Ship-to Contact)
- FieldsArray[16] := 29; //Shortcut Dimension 1 Code (Shortcut Dimension 1 Code) //Shortcut Dimension 1 Code (Shortcut Dimension 1 Code)
- FieldsArray[17] := 30; //Shortcut Dimension 2 Code (Shortcut Dimension 2 Code) //Shortcut Dimension 2 Code (Shortcut Dimension 2 Code)
- FieldsArray[18] := 32; //Currency Code (Currency Code) //Currency Code (Currency Code)
- FieldsArray[19] := 35; //Prices Including VAT (Prices Including VAT) //Prices Including VAT (Prices Including VAT)
- FieldsArray[21] := 76; //Transaction Type (Transaction Type) //Transaction Type (Transaction Type)
- FieldsArray[22] := 77; //Transport Method (Transport Method) //Transport Method (Transport Method)
- FieldsArray[23] := 79; //Sell-to Customer Name (Sell-to Customer Name) //Buy-from Vendor Name (Buy-from Vendor Name)
- FieldsArray[24] := 80; //Sell-to Customer Name 2 (Sell-to Customer Name 2) //Buy-from Vendor Name 2 (Buy-from Vendor Name 2)
- FieldsArray[25] := 81; //Sell-to Address (Sell-to Address) //Buy-from Address (Buy-from Address)
- FieldsArray[26] := 82; //Sell-to Address 2 (Sell-to Address 2) //Buy-from Address 2 (Buy-from Address 2)
- FieldsArray[27] := 83; //Sell-to City (Sell-to City) //Buy-from City (Buy-from City)
- FieldsArray[28] := 84; //Sell-to Contact (Sell-to Contact) //Buy-from Contact (Buy-from Contact)
- FieldsArray[29] := 85; //Bill-to Post Code (Bill-to Post Code) //Pay-to Post Code (Pay-to Post Code)
- FieldsArray[30] := 86; //Bill-to County (Bill-to County) //Pay-to County (Pay-to County)
- FieldsArray[31] := 87; //Bill-to Country/Region Code (Bill-to Country/Region Code) //Pay-to Country/Region Code (Pay-to Country/Region Code)
- FieldsArray[32] := 88; //Sell-to Post Code (Sell-to Post Code) //Buy-from Post Code (Buy-from Post Code)
- FieldsArray[33] := 89; //Sell-to County (Sell-to County) //Buy-from County (Buy-from County)
- FieldsArray[34] := 90; //Sell-to Country/Region Code (Sell-to Country/Region Code) //Buy-from Country/Region Code (Buy-from Country/Region Code)
- FieldsArray[35] := 91; //Ship-to Post Code (Ship-to Post Code) //Ship-to Post Code (Ship-to Post Code)
- FieldsArray[36] := 92; //Ship-to County (Ship-to County) //Ship-to County (Ship-to County)
- FieldsArray[37] := 93; //Ship-to Country/Region Code (Ship-to Country/Region Code) //Ship-to Country/Region Code (Ship-to Country/Region Code)
- FieldsArray[38] := 116; //VAT Bus. Posting Group (VAT Bus. Posting Group) //VAT Bus. Posting Group (VAT Bus. Posting Group)
- FieldsArray[39] := 480; //Dimension Set ID (Dimension Set ID) //Dimension Set ID (Dimension Set ID)
- FieldsArray[41] := 5052; //Sell-to Contact No. (Sell-to Contact No.) //Buy-from Contact No. (Buy-from Contact No.)
- FieldsArray[42] := 5053; //Bill-to Contact No. (Bill-to Contact No.) //Pay-to Contact No. (Pay-to Contact No.)
- if CalledFromSales then begin
- FieldsArray[20] := 75; //EU 3-Party Trade (EU 3-Party Trade) //No field in Purchase Header
- FieldsArray[43] := 5057; //Bill-to Customer Templ. Code (Bill-to Customer Templ. Code) //No field in Purchase Header
- FieldsArray[40] := 5056; //Sell-to Customer Templ. Code (Sell-to Customer Templ. Code) //No field in Purchase Header
- end;
- end;
-
- local procedure PopulateArrayOfFieldsForLines()
- begin
- FieldsArray[1] := 5; //Type
- FieldsArray[2] := 6; //No.
- FieldsArray[3] := 15; //Quantity
- FieldsArray[4] := 22; //Unit Price/Cost
- FieldsArray[5] := 27; //Line Discount %
- FieldsArray[6] := 28; //Line Discount Amount
- FieldsArray[7] := 29; //Amount
- FieldsArray[8] := 30; //Amount including VAT
- FieldsArray[9] := 40; //Dim 1
- FieldsArray[10] := 41; // Dim2
- FieldsArray[11] := 480; // Dimension Set ID
- FieldsArray[12] := 8053; //Recurring Billing from
- FieldsArray[13] := 8054; //Recurring Billing to
- end;
-
- local procedure PostAndGetSalesInvoiceHeaderFromRecurringBilling()
- begin
- PostedDocumentNo := LibrarySales.PostSalesDocument(SalesHeader, true, true);
- SalesInvoiceHeader.Get(PostedDocumentNo);
- end;
-
- [MessageHandler]
- procedure MessageHandler(Message: Text[1024])
- begin
- end;
-
- [ModalPageHandler]
- procedure CreateCustomerBillingDocsTestOpenPageHandler(var CreateCustomerBillingDocs: TestPage "Create Customer Billing Docs")
- var
- PagePostingDate: Date;
- PageDocumentDate: Date;
- begin
- Evaluate(PagePostingDate, CreateCustomerBillingDocs.PostingDate.Value);
- Evaluate(PageDocumentDate, CreateCustomerBillingDocs.DocumentDate.Value);
- AssertThat.AreEqual(WorkDate(), PagePostingDate, 'Posting Date is not initialized correctly.');
- AssertThat.AreEqual(WorkDate(), PageDocumentDate, 'Document Date is not initialized correctly.');
- CreateCustomerBillingDocs.Cancel().Invoke();
- end;
-
- [ModalPageHandler]
- procedure CreateCustomerBillingDocsContractPageHandler(var CreateCustomerBillingDocs: TestPage "Create Customer Billing Docs")
- begin
- CreateCustomerBillingDocs.OK().Invoke();
- end;
-
- [ModalPageHandler]
- procedure CreateCustomerBillingDocsSellToCustomerPageHandler(var CreateCustomerBillingDocs: TestPage "Create Customer Billing Docs")
- begin
- CreateCustomerBillingDocs.GroupingType.SetValue(Enum::"Customer Rec. Billing Grouping"::"Sell-to Customer No.");
- CreateCustomerBillingDocs.OK().Invoke();
- end;
-
- [ModalPageHandler]
- procedure CreateCustomerBillingDocsBillToCustomerPageHandler(var CreateCustomerBillingDocs: TestPage "Create Customer Billing Docs")
- begin
- CreateCustomerBillingDocs.GroupingType.SetValue(Enum::"Customer Rec. Billing Grouping"::"Bill-to Customer No.");
- CreateCustomerBillingDocs.OK().Invoke();
- end;
-
- [ModalPageHandler]
- procedure CancelCreateVendorBillingDocsTestOpenPageHandler(var CreateVendorBillingDocs: TestPage "Create Vendor Billing Docs")
- var
- PagePostingDate: Date;
- PageDocumentDate: Date;
- begin
- Evaluate(PagePostingDate, CreateVendorBillingDocs.PostingDate.Value);
- Evaluate(PageDocumentDate, CreateVendorBillingDocs.DocumentDate.Value);
- AssertThat.AreEqual(WorkDate(), PagePostingDate, 'Posting Date is not initialized correctly.');
- AssertThat.AreEqual(WorkDate(), PageDocumentDate, 'Document Date is not initialized correctly.');
- CreateVendorBillingDocs.Cancel().Invoke();
- end;
-
- [ModalPageHandler]
- procedure CreateVendorBillingDocsContractPageHandler(var CreateVendorBillingDocs: TestPage "Create Vendor Billing Docs")
- begin
- CreateVendorBillingDocs.OK().Invoke();
- end;
-
- [ModalPageHandler]
- procedure CreateVendorBillingDocsPayToVendorPageHandler(var CreateVendorBillingDocs: TestPage "Create Vendor Billing Docs")
- begin
- CreateVendorBillingDocs.GroupingType.SetValue(Enum::"Vendor Rec. Billing Grouping"::"Pay-to Vendor No.");
- CreateVendorBillingDocs.OK().Invoke();
- end;
-
- [ModalPageHandler]
- procedure CreateVendorBillingDocsBuyFromVendorPageHandler(var CreateVendorBillingDocs: TestPage "Create Vendor Billing Docs")
- begin
- CreateVendorBillingDocs.GroupingType.SetValue(Enum::"Vendor Rec. Billing Grouping"::"Buy-From Vendor No.");
- CreateVendorBillingDocs.OK().Invoke();
- end;
-
- [ConfirmHandler]
- procedure ConfirmHandler(Question: Text[1024]; var Reply: Boolean)
- begin
- Reply := true;
- end;
-
- [ModalPageHandler]
- procedure ExchangeRateSelectionModalPageHandler(var ExchangeRateSelectionPage: TestPage "Exchange Rate Selection")
- begin
- ExchangeRateSelectionPage.OK().Invoke();
- end;
-
- [Test]
- [HandlerFunctions('CreateAndPostCustomerBillingDocsContractPageHandler,ExchangeRateSelectionModalPageHandler,MessageHandler')]
- procedure CreateAndPostSalesDocumentsPerContract()
- begin
- //Contract1, Sell-to Customer1, Bill-to Customer1
- //Contract2, Sell-to Customer2, Bill-to Customer2
- //Contract3, Sell-to Customer2, Bill-to Customer1
- //Contract4, Sell-to Customer3, Bill-to Customer1
- InitAndCreateBillingDocumentsForMultipleContracts();
- CheckIfPostedSalesDocumentsHaveBeenCreated();
- AssertThat.AreEqual(4, DocumentsCount, 'Posted Sales Documents were not created correctly');
- end;
-
- [Test]
- [HandlerFunctions('CreateAndPostCustomerBillingDocsSellToCustomerPageHandler,ExchangeRateSelectionModalPageHandler,MessageHandler')]
- procedure CreateAndPostSalesDocumentsPerSellToCustomer()
- begin
- //Contract1, Sell-to Customer1, Bill-to Customer1
- //Contract2, Sell-to Customer2, Bill-to Customer2
- //Contract3, Sell-to Customer2, Bill-to Customer1
- //Contract4, Sell-to Customer3, Bill-to Customer1
- InitAndCreateBillingDocumentsForMultipleContracts();
- CheckIfPostedSalesDocumentsHaveBeenCreated();
- AssertThat.AreEqual(3, DocumentsCount, 'Posted Sales Documents were not created correctly');
- end;
+ Initialize();
- [Test]
- [HandlerFunctions('CreateAndPostCustomerBillingDocsBillToCustomerPageHandler,ExchangeRateSelectionModalPageHandler,MessageHandler')]
- procedure CreateAndPostSalesDocumentsPerBillToCustomer()
- begin
//Contract1, Sell-to Customer1, Bill-to Customer1
//Contract2, Sell-to Customer2, Bill-to Customer2
//Contract3, Sell-to Customer2, Bill-to Customer1
@@ -977,61 +699,12 @@ codeunit 139687 "Recurring Billing Docs Test"
AssertThat.AreEqual(2, DocumentsCount, 'Posted Sales Documents were not created correctly');
end;
- local procedure CheckIfPostedSalesDocumentsHaveBeenCreated()
- begin
- TempSalesInvoiceHeader.Reset();
- TempSalesInvoiceHeader.DeleteAll(false);
- GetPostedSalesDocumentsFromContract(CustomerContract);
- GetPostedSalesDocumentsFromContract(CustomerContract2);
- GetPostedSalesDocumentsFromContract(CustomerContract3);
- GetPostedSalesDocumentsFromContract(CustomerContract4);
- end;
-
- local procedure GetPostedSalesDocumentsFromContract(SourceCustomerContract: Record "Customer Contract")
- var
- BillingLineArchive: Record "Billing Line Archive";
- begin
- ContractTestLibrary.FilterBillingLineArchiveOnContractLine(BillingLineArchive, SourceCustomerContract."No.", 0, Enum::"Service Partner"::Customer);
- if BillingLineArchive.FindSet() then
- repeat
- BillingLineArchive.TestField("Document Type", BillingLineArchive."Document Type"::Invoice);
- BillingLineArchive.TestField("Document No.");
- SalesInvoiceHeader.Get(BillingLineArchive."Document No.");
- if not TempSalesInvoiceHeader.Get(BillingLineArchive."Document No.") then begin
- TempSalesInvoiceHeader := SalesInvoiceHeader;
- TempSalesInvoiceHeader.Insert(false);
- DocumentsCount += 1;
- end;
- until BillingLineArchive.Next() = 0;
- end;
-
- local procedure GetCustomerContractServiceCommitment(ContractNo: Code[20])
- begin
- CustomerContractLine.SetRange("Contract No.", ContractNo);
- CustomerContractLine.FindFirst();
- CustomerContractLine.GetServiceCommitment(ServiceCommitment);
- end;
-
- local procedure GetVendorContractServiceCommitment(ContractNo: Code[20])
- begin
- VendorContractLine.SetRange("Contract No.", ContractNo);
- VendorContractLine.FindFirst();
- ServiceCommitment.Get(VendorContractLine."Service Commitment Entry No.")
- end;
-
- local procedure CountBillingArchiveLinesOnDocument(DocumentType: Enum "Rec. Billing Document Type"; DocumentNo: Code[20]; ServicePartner: Enum "Service Partner"; ContractNo: Code[20]; ContractLineNo: Integer): Integer
- var
- BillingArchiveLine: Record "Billing Line Archive";
- begin
- BillingArchiveLine.FilterBillingLineArchiveOnContractLine(ServicePartner, ContractNo, ContractLineNo);
- BillingArchiveLine.FilterBillingLineArchiveOnDocument(DocumentType, DocumentNo);
- exit(BillingArchiveLine.Count());
- end;
-
[Test]
[HandlerFunctions('ExchangeRateSelectionModalPageHandler,MessageHandler')]
procedure ExpectErrorBillingLinesForAllCustomerContractLinesExist()
begin
+ Initialize();
+
SetupBasicBillingProposal("Service Partner"::Customer);
asserterror BillingProposal.CreateBillingProposalFromContract(CustomerContract."No.", CustomerContract.GetFilter("Billing Rhythm Filter"), "Service Partner"::Customer);
end;
@@ -1040,6 +713,8 @@ codeunit 139687 "Recurring Billing Docs Test"
[HandlerFunctions('DialogHandler,ExchangeRateSelectionModalPageHandler,CreateCustomerBillingDocsContractPageHandler,MessageHandler')]
procedure CheckCustomerBillingProposalCanBeCreatedForSalesInvoiceExists()
begin
+ Initialize();
+
//Check if correct dialog opens
//Unposted invoice exists
InitAndCreateBillingDocument("Service Partner"::Customer);
@@ -1051,6 +726,8 @@ codeunit 139687 "Recurring Billing Docs Test"
[HandlerFunctions('DialogHandler,ExchangeRateSelectionModalPageHandler,CreateAndPostCustomerBillingDocsContractPageHandler,MessageHandler')]
procedure CheckCustomerBillingProposalCanBeCreatedForSalesCrMemoExists()
begin
+ Initialize();
+
//Check if correct dialog opens
//Credit Memo exists
InitAndCreateBillingDocument("Service Partner"::Customer);
@@ -1064,6 +741,8 @@ codeunit 139687 "Recurring Billing Docs Test"
[HandlerFunctions('ExchangeRateSelectionModalPageHandler,CreateBillingDocumentPageHandler,MessageHandler')]
procedure ExpectErrorOnCreateSingleSalesDocumentOnPreviousBillingDate()
begin
+ Initialize();
+
ClearAll();
ContractTestLibrary.ResetContractRecords();
ContractTestLibrary.CreateCustomerContractAndCreateContractLines(CustomerContract, ServiceObject, '', false);
@@ -1077,6 +756,8 @@ codeunit 139687 "Recurring Billing Docs Test"
[HandlerFunctions('ExchangeRateSelectionModalPageHandler,MessageHandler,CreateBillingDocumentPageHandler')]
procedure TestBillingLineOnCreateSingleSalesDocument()
begin
+ Initialize();
+
ClearAll();
ContractTestLibrary.ResetContractRecords();
ContractTestLibrary.CreateCustomerContractAndCreateContractLines(CustomerContract, ServiceObject, '', false);
@@ -1095,6 +776,8 @@ codeunit 139687 "Recurring Billing Docs Test"
[HandlerFunctions('ExchangeRateSelectionModalPageHandler,MessageHandler,CreateBillingDocumentPageHandler')]
procedure TestDeleteSingleSalesDocument()
begin
+ Initialize();
+
ClearAll();
ContractTestLibrary.ResetContractRecords();
ContractTestLibrary.CreateCustomerContractAndCreateContractLines(CustomerContract, ServiceObject, '', false);
@@ -1115,6 +798,8 @@ codeunit 139687 "Recurring Billing Docs Test"
[HandlerFunctions('ExchangeRateSelectionModalPageHandler,MessageHandler')]
procedure ExpectErrorBillingLinesForAllVendorContractLinesExist()
begin
+ Initialize();
+
SetupBasicBillingProposal("Service Partner"::Vendor);
asserterror BillingProposal.CreateBillingProposalFromContract(VendorContract."No.", VendorContract.GetFilter("Billing Rhythm Filter"), "Service Partner"::Vendor);
end;
@@ -1125,6 +810,8 @@ codeunit 139687 "Recurring Billing Docs Test"
var
UnpostedPurchaseInvExistsMsg: Label 'Billing line with unposted Purchase Invoice exists. New invoices cannot be created until the current invoice is posted. Do you want to open the invoice?';
begin
+ Initialize();
+
//Check if correct dialog opens
//Unposted invoice exists
InitAndCreateBillingDocument("Service Partner"::Vendor);
@@ -1138,6 +825,8 @@ codeunit 139687 "Recurring Billing Docs Test"
var
BillingLineArchive: Record "Billing Line Archive";
begin
+ Initialize();
+
//Check if correct dialog opens
//Credit Memo exists
PostPurchaseInvoice();
@@ -1153,6 +842,8 @@ codeunit 139687 "Recurring Billing Docs Test"
[HandlerFunctions('ExchangeRateSelectionModalPageHandler,MessageHandler,CreateBillingDocumentPageHandler')]
procedure ExpectErrorOnCreateSinglePurchaseDocumentOnPreviousBillingDate()
begin
+ Initialize();
+
ClearAll();
ContractTestLibrary.ResetContractRecords();
ContractTestLibrary.CreateVendorContractAndCreateContractLines(VendorContract, ServiceObject, '', false);
@@ -1166,6 +857,8 @@ codeunit 139687 "Recurring Billing Docs Test"
[HandlerFunctions('ExchangeRateSelectionModalPageHandler,MessageHandler,CreateBillingDocumentPageHandler')]
procedure TestBillingLineOnCreateSinglePurchaseDocument()
begin
+ Initialize();
+
ClearAll();
ContractTestLibrary.ResetContractRecords();
ContractTestLibrary.CreateVendorContractAndCreateContractLines(VendorContract, ServiceObject, '', false);
@@ -1184,6 +877,8 @@ codeunit 139687 "Recurring Billing Docs Test"
[HandlerFunctions('ExchangeRateSelectionModalPageHandler,MessageHandler,CreateBillingDocumentPageHandler')]
procedure TestDeleteSinglePurchaseDocument()
begin
+ Initialize();
+
ClearAll();
ContractTestLibrary.ResetContractRecords();
ContractTestLibrary.CreateVendorContractAndCreateContractLines(VendorContract, ServiceObject, '', false);
@@ -1206,6 +901,8 @@ codeunit 139687 "Recurring Billing Docs Test"
var
PurchInvLine: Record "Purch. Inv. Line";
begin
+ Initialize();
+
ContractTestLibrary.InitContractsApp();
InitAndCreateBillingDocumentsForMultipleVendorContracts();
BillingLine.Reset();
@@ -1230,6 +927,8 @@ codeunit 139687 "Recurring Billing Docs Test"
var
PurchCrMemoLine: Record "Purch. Cr. Memo Line";
begin
+ Initialize();
+
ContractTestLibrary.InitContractsApp();
InitAndCreateBillingDocumentsForMultipleVendorContracts();
BillingLine.Reset();
@@ -1259,6 +958,8 @@ codeunit 139687 "Recurring Billing Docs Test"
var
SalesInvLine: Record "Sales Invoice Line";
begin
+ Initialize();
+
ContractTestLibrary.InitContractsApp();
InitAndCreateBillingDocumentsForMultipleContracts();
BillingLine.Reset();
@@ -1281,6 +982,8 @@ codeunit 139687 "Recurring Billing Docs Test"
var
SalesCrMemoLine: Record "Sales Cr.Memo Line";
begin
+ Initialize();
+
ContractTestLibrary.InitContractsApp();
InitAndCreateBillingDocumentsForMultipleContracts();
BillingLine.Reset();
@@ -1300,79 +1003,23 @@ codeunit 139687 "Recurring Billing Docs Test"
ContractsGeneralMgt.ShowArchivedBillingLines(SalesCrMemoLine."Contract No.", SalesCrMemoLine."Contract Line No.", "Service Partner"::Customer, "Rec. Billing Document Type"::"Credit Memo", PostedDocumentNo);
end;
- [ModalPageHandler]
- procedure CreateAndPostCustomerBillingDocsContractPageHandler(var CreateCustomerBillingDocs: TestPage "Create Customer Billing Docs")
+ [Test]
+ [HandlerFunctions('CreateCustomerBillingDocsContractPageHandler,ExchangeRateSelectionModalPageHandler,MessageHandler')]
+ procedure ExpectErrorOnServiceObjectDescriptionChangeWhenUnpostedDocumentsExistCustomer()
begin
- CreateCustomerBillingDocs.PostDocuments.SetValue(true);
- CreateCustomerBillingDocs.OK().Invoke();
- end;
+ Initialize();
- [ModalPageHandler]
- procedure CreateAndPostCustomerBillingDocsSellToCustomerPageHandler(var CreateCustomerBillingDocs: TestPage "Create Customer Billing Docs")
- begin
- CreateCustomerBillingDocs.PostDocuments.SetValue(true);
- CreateCustomerBillingDocs.GroupingType.SetValue(Enum::"Customer Rec. Billing Grouping"::"Sell-to Customer No.");
- CreateCustomerBillingDocs.OK().Invoke();
+ InitAndCreateBillingDocument("Service Partner"::Customer);
+ CheckIfSalesDocumentsHaveBeenCreated();
+ asserterror ServiceObject.Validate(Description, LibraryRandom.RandText(MaxStrLen(ServiceObject.Description)));
end;
- [ModalPageHandler]
- procedure CreateAndPostCustomerBillingDocsBillToCustomerPageHandler(var CreateCustomerBillingDocs: TestPage "Create Customer Billing Docs")
+ [Test]
+ [HandlerFunctions('CreateVendorBillingDocsContractPageHandler,ExchangeRateSelectionModalPageHandler,MessageHandler')]
+ procedure ExpectErrorOnServiceObjectDescriptionChangeWhenUnpostedDocumentsExistVendor()
begin
- CreateCustomerBillingDocs.PostDocuments.SetValue(true);
- CreateCustomerBillingDocs.GroupingType.SetValue(Enum::"Customer Rec. Billing Grouping"::"Bill-to Customer No.");
- CreateCustomerBillingDocs.OK().Invoke();
- end;
-
- [ModalPageHandler]
- procedure CreateVendorBillingDocsTestOpenPageHandler(var CreateVendorBillingDocs: TestPage "Create Vendor Billing Docs")
- begin
- CreateVendorBillingDocs.OK().Invoke();
- end;
-
- [ConfirmHandler]
- procedure DialogHandler(Question: Text[1024]; var Reply: Boolean)
- begin
- if not (Question = DialogMsg) then
- Error('No Dialog Question found!');
- Reply := false;
- end;
-
- [ModalPageHandler]
- procedure CreateBillingDocumentPageHandler(var CreateBillingDocument: TestPage "Create Billing Document")
- begin
- CreateBillingDocument.BillingDate.SetValue(NextBillingToDate);
- CreateBillingDocument.BillingTo.SetValue(NextBillingToDate);
- CreateBillingDocument.OpenDocument.SetValue(false);
- CreateBillingDocument.PostDocument.SetValue(false);
- CreateBillingDocument.OK().Invoke()
- end;
-
- [PageHandler]
- procedure BillingLinesArchivePageHandler(var BillingLinesArchive: TestPage "Archived Billing Lines")
- var
- NoOfRecords: Integer;
- begin
- if BillingLinesArchive.First() then
- repeat
- NoOfRecords += 1;
- until not BillingLinesArchive.Next();
- AssertThat.AreEqual(NoOfRecords, ExpectedNoOfArchivedLines, 'Page Billing Lines Archive is not filtered properly.');
- BillingLinesArchive.OK().Invoke();
- end;
-
- [Test]
- [HandlerFunctions('CreateCustomerBillingDocsContractPageHandler,ExchangeRateSelectionModalPageHandler,MessageHandler')]
- procedure ExpectErrorOnServiceObjectDescriptionChangeWhenUnpostedDocumentsExistCustomer()
- begin
- InitAndCreateBillingDocument("Service Partner"::Customer);
- CheckIfSalesDocumentsHaveBeenCreated();
- asserterror ServiceObject.Validate(Description, LibraryRandom.RandText(MaxStrLen(ServiceObject.Description)));
- end;
+ Initialize();
- [Test]
- [HandlerFunctions('CreateVendorBillingDocsContractPageHandler,ExchangeRateSelectionModalPageHandler,MessageHandler')]
- procedure ExpectErrorOnServiceObjectDescriptionChangeWhenUnpostedDocumentsExistVendor()
- begin
InitAndCreateBillingDocument("Service Partner"::Vendor);
CheckIfPurchaseDocumentsHaveBeenCreated();
asserterror ServiceObject.Validate(Description, LibraryRandom.RandText(MaxStrLen(ServiceObject.Description)));
@@ -1384,6 +1031,8 @@ codeunit 139687 "Recurring Billing Docs Test"
var
CustLedgEntry: Record "Cust. Ledger Entry";
begin
+ Initialize();
+
InitAndCreateBillingDocument(Enum::"Service Partner"::Customer);
BillingLine.FindLast();
SalesHeader.Get(Enum::"Sales Document Type"::Invoice, BillingLine."Document No.");
@@ -1400,6 +1049,8 @@ codeunit 139687 "Recurring Billing Docs Test"
var
VendorLedgerEntry: Record "Vendor Ledger Entry";
begin
+ Initialize();
+
InitAndCreateBillingDocument(Enum::"Service Partner"::Vendor);
BillingLine.FindLast();
PurchaseHeader.Get(Enum::"Purchase Document Type"::Invoice, BillingLine."Document No.");
@@ -1421,6 +1072,8 @@ codeunit 139687 "Recurring Billing Docs Test"
Vendor: Record Vendor;
GLAccount: Record "G/L Account";
begin
+ Initialize();
+
//Expect that posting of simple general journal is not affected with Recurring billing field in Vendor Ledger Entries
//Ref. IC230221) Posting of Recurring General Journal fails
LibraryPurchase.CreateVendor(Vendor);
@@ -1444,6 +1097,8 @@ codeunit 139687 "Recurring Billing Docs Test"
Customer: Record Customer;
GLAccount: Record "G/L Account";
begin
+ Initialize();
+
//Expect that posting of simple general journal is not affected with Recurring billing field in Customer Ledger Entries
//Ref. IC230221) Posting of Recurring General Journal fails
LibrarySales.CreateCustomer(Customer);
@@ -1470,6 +1125,8 @@ codeunit 139687 "Recurring Billing Docs Test"
ParentSalesLine: Record "Sales Line";
CustomerNo: Code[20];
begin
+ Initialize();
+
// Test: Sales Invoice Line Description and attached lines are created according to setup
ClearAll();
BillingLine.Reset();
@@ -1542,6 +1199,8 @@ codeunit 139687 "Recurring Billing Docs Test"
var
FieldValueNotExpectedTxt: Label '"%1" should not be present as a description-line', Locked = true;
begin
+ Initialize();
+
// Test: Names are NOT transferred as Description Lines in Sales Document (Create per Contract (see PageHandler), both options off)
ClearAll();
PrepareCustomerContractWithNames();
@@ -1563,6 +1222,8 @@ codeunit 139687 "Recurring Billing Docs Test"
var
FieldValueNotExpectedTxt: Label '"%1" should not be present as a description-line', Locked = true;
begin
+ Initialize();
+
// Test: Names are NOT transferred as Description Lines in Sales Document (Create per bill-to (see PageHandler), both options off)
ClearAll();
PrepareCustomerContractWithNames();
@@ -1584,6 +1245,8 @@ codeunit 139687 "Recurring Billing Docs Test"
var
FieldValueNotExpectedTxt: Label '"%1" should not be present as a description-line', Locked = true;
begin
+ Initialize();
+
// Test: Names are NOT transferred as Description Lines in Sales Document (Create per Contract (see PageHandler), both options on)
ClearAll();
PrepareCustomerContractWithNames();
@@ -1605,6 +1268,8 @@ codeunit 139687 "Recurring Billing Docs Test"
var
FieldValueNotExpectedTxt: Label '"%1" should be present (once) as a description-line', Locked = true;
begin
+ Initialize();
+
// Test: Names are transferred as Description Lines in Sales Document (Create per bill-to (see PageHandler), both options on)
ClearAll();
PrepareCustomerContractWithNames();
@@ -1626,6 +1291,8 @@ codeunit 139687 "Recurring Billing Docs Test"
var
Customer: Record Customer;
begin
+ Initialize();
+
ClearAll();
ContractTestLibrary.ResetContractRecords();
ContractTestLibrary.CreateCustomer(Customer);
@@ -1641,38 +1308,14 @@ codeunit 139687 "Recurring Billing Docs Test"
asserterror BillingLine.FindSet();
end;
- local procedure PrepareCustomerContractWithNames()
- begin
- SetupBasicBillingProposal(Enum::"Service Partner"::Customer);
- InitServiceContractSetup();
-
- CustomerContract."Sell-to Customer Name" := CopyStr(LibraryRandom.RandText(MaxStrLen(CustomerContract."Sell-to Customer Name")), 1, MaxStrLen(CustomerContract."Sell-to Customer Name"));
- CustomerContract."Sell-to Customer Name 2" := CopyStr(LibraryRandom.RandText(MaxStrLen(CustomerContract."Sell-to Customer Name 2")), 1, MaxStrLen(CustomerContract."Sell-to Customer Name 2"));
- CustomerContract."Ship-to Name" := CopyStr(LibraryRandom.RandText(MaxStrLen(CustomerContract."Ship-to Name")), 1, MaxStrLen(CustomerContract."Ship-to Name"));
- CustomerContract."Ship-to Name 2" := CopyStr(LibraryRandom.RandText(MaxStrLen(CustomerContract."Ship-to Name 2")), 1, MaxStrLen(CustomerContract."Ship-to Name 2"));
- CustomerContract.Modify(false);
- end;
-
- local procedure GetNoOfSalesInvoiceLineWithDescription(ExpectedDescriptionText: Text[100]): Integer
- begin
- BillingLine.Reset();
- BillingLine.SetRange("Billing Template Code", BillingTemplate.Code);
- BillingLine.SetRange(Partner, BillingTemplate.Partner);
- BillingLine.FindLast();
-
- SalesLine.Reset();
- SalesLine.SetRange("Document Type", BillingLine.GetSalesDocumentTypeFromBillingDocumentType());
- SalesLine.SetRange("Document No.", BillingLine."Document No.");
- SalesLine.SetRange(Description, ExpectedDescriptionText);
- exit(SalesLine.Count());
- end;
-
[Test]
[HandlerFunctions('ExchangeRateSelectionModalPageHandler,MessageHandler,CreateCustomerBillingDocsContractPageHandler,BillingLinesArchivePageHandler')]
procedure TestShowBillingLineArchiveFromServiceCommitment()
var
BillingLineArchive: Record "Billing Line Archive";
begin
+ Initialize();
+
ContractTestLibrary.InitContractsApp();
InitAndCreateBillingDocumentsForMultipleContracts();
BillingLine.Reset();
@@ -1706,6 +1349,8 @@ codeunit 139687 "Recurring Billing Docs Test"
var
LineNo: Integer;
begin
+ Initialize();
+
ContractTestLibrary.InitContractsApp();
InitAndCreateBillingDocumentsForMultipleContracts();
BillingLine.Reset();
@@ -1749,6 +1394,8 @@ codeunit 139687 "Recurring Billing Docs Test"
var
LineNo: Integer;
begin
+ Initialize();
+
ContractTestLibrary.InitContractsApp();
InitAndCreateBillingDocumentsForMultipleVendorContracts();
BillingLine.Reset();
@@ -1797,6 +1444,8 @@ codeunit 139687 "Recurring Billing Docs Test"
ServiceCommitmentPackage: Record "Service Commitment Package";
ServiceCommPackageLine: Record "Service Comm. Package Line";
begin
+ Initialize();
+
ClearAll();
ContractTestLibrary.CreateItemWithServiceCommitmentOption(Item, Enum::"Item Service Commitment Type"::"Service Commitment Item");
ContractTestLibrary.CreateServiceCommitmentTemplate(ServiceCommitmentTemplate);
@@ -1835,6 +1484,8 @@ codeunit 139687 "Recurring Billing Docs Test"
PreviousNextBillingDate: Date;
InitialNextBillingDate: Date;
begin
+ Initialize();
+
ClearAll();
ContractTestLibrary.CreateItemWithServiceCommitmentOption(Item, Enum::"Item Service Commitment Type"::"Service Commitment Item");
ContractTestLibrary.CreateServiceCommitmentTemplate(ServiceCommitmentTemplate);
@@ -1897,6 +1548,8 @@ codeunit 139687 "Recurring Billing Docs Test"
ServiceCommPackageLine: Record "Service Comm. Package Line";
Assert: Codeunit Assert;
begin
+ Initialize();
+
// Test: When a Credit Memo (created directly from a Contract) is deleted, all linked Billing Lines should also be deleted
Clear(SalesHeader);
Clear(CustomerContract);
@@ -1957,43 +1610,12 @@ codeunit 139687 "Recurring Billing Docs Test"
Assert.AreEqual(0, BillingLine.Count, 'Zero remaining billing lines expected after deleting the credit memo.');
end;
- local procedure CreateAndPostSimpleSalesDocument(ItemNo: Code[20])
- begin
- LibrarySales.CreateSalesHeader(SalesHeader, SalesHeader."Document Type"::Order, '');
- LibrarySales.CreateSalesLine(SalesLine, SalesHeader, Enum::"Sales Line Type"::Item, ItemNo, 1);
- SalesLine.Validate("Unit Price", -50);
- SalesLine.Modify(false);
- LibrarySales.CreateSalesLine(SalesLine, SalesHeader, Enum::"Sales Line Type"::Item, ItemNo, 1);
- SalesLine.Validate("Unit Price", 100);
- SalesLine.Modify(false);
- LibrarySales.PostSalesDocument(SalesHeader, true, false);
- end;
-
- local procedure CreateCustomerContractAndAssignServiceObjects(ItemNo: Code[20])
- var
- TempServiceCommitment: Record "Service Commitment" temporary;
- begin
- ContractTestLibrary.CreateCustomerContract(CustomerContract, SalesHeader."Sell-to Customer No.");
- ServiceObject.Reset();
- ServiceObject.SetRange("Item No.", ItemNo);
- ServiceObject.FindSet();
- repeat
- ContractTestLibrary.FillTempServiceCommitment(TempServiceCommitment, ServiceObject, CustomerContract);
- CustomerContract.CreateCustomerContractLinesFromServiceCommitments(TempServiceCommitment);
- until ServiceObject.Next() = 0;
- CustomerContractLine.SetRange("Contract No.", CustomerContract."No.");
- CustomerContractLine.FindSet();
- repeat
- CustomerContractLine.GetServiceCommitment(ServiceCommitment);
- ServiceCommitment.Validate("Service Start Date", CalcDate('<2M-CM>', WorkDate()));
- ServiceCommitment.Modify(false);
- until CustomerContractLine.Next() = 0;
- end;
-
- [HandlerFunctions('CreateCustomerBillingDocsContractPageHandler,CreateVendorBillingDocsContractPageHandler,ExchangeRateSelectionModalPageHandler,MessageHandler')]
[Test]
+ [HandlerFunctions('CreateCustomerBillingDocsContractPageHandler,CreateVendorBillingDocsContractPageHandler,ExchangeRateSelectionModalPageHandler,MessageHandler')]
procedure CheckBatchDeleteAllContractDocuments()
begin
+ Initialize();
+
// Test: multiple Sales- and Purchase-Contract Documents can be batch-deleted by using the function from the recurring billing page
InitAndCreateBillingDocument(Enum::"Service Partner"::Customer);
InitAndCreateBillingDocument(Enum::"Service Partner"::Customer);
@@ -2011,6 +1633,8 @@ codeunit 139687 "Recurring Billing Docs Test"
[Test]
procedure CheckBatchDeleteSelectedContractDocuments()
begin
+ Initialize();
+
// Test: multiple Sales- and Purchase-Contract Invoices can be batch-deleted depending on the selected document type
// Selection: 2 = "All Sales Invoices"
CreateAndDeleteDummyContractDocuments(2, 0, 2, 2, 2);
@@ -2022,79 +1646,6 @@ codeunit 139687 "Recurring Billing Docs Test"
CreateAndDeleteDummyContractDocuments(5, 2, 2, 2, 0);
end;
- procedure CreateAndDeleteDummyContractDocuments(Selection: Integer; NoOfSalesInvoices: Integer; NoOfSalesCrMemos: Integer; NoOfPurchaseInvoices: Integer; NoOfPurchaseCrMemos: Integer)
- begin
- SalesHeader.Reset();
- SalesHeader.SetFilter("Document Type", '%1|%2', SalesHeader."Document Type"::Invoice, SalesHeader."Document Type"::"Credit Memo");
- if not SalesHeader.IsEmpty() then
- SalesHeader.ModifyAll("Recurring Billing", false, false);
- PurchaseHeader.Reset();
- PurchaseHeader.SetFilter("Document Type", '%1|%2', PurchaseHeader."Document Type"::Invoice, PurchaseHeader."Document Type"::"Credit Memo");
- if not PurchaseHeader.IsEmpty() then
- PurchaseHeader.ModifyAll("Recurring Billing", false, false);
-
- CreateDummyContractDocumentsSales();
- CreateDummyContractDocumentsPurchase();
- BillingProposal.DeleteBillingDocuments(Selection, false);
-
- AssertThat.AreEqual(NoOfSalesInvoices, GetNumberOfContractDocumentsSales(Enum::"Sales Document Type"::Invoice), 'Unexpected No. of Sales Invoices after batch-deletion');
- AssertThat.AreEqual(NoOfSalesCrMemos, GetNumberOfContractDocumentsSales(Enum::"Sales Document Type"::"Credit Memo"), 'Unexpected No. of Sales Credit Memos after batch-deletion');
- AssertThat.AreEqual(NoOfPurchaseInvoices, GetNumberOfContractDocumentsPurchase(Enum::"Purchase Document Type"::Invoice), 'Unexpected No. of Purchase Invoices after batch-deletion');
- AssertThat.AreEqual(NoOfPurchaseCrMemos, GetNumberOfContractDocumentsPurchase(Enum::"Purchase Document Type"::"Credit Memo"), 'Unexpected No. of Purchase Credit Memos after batch-deletion');
- end;
-
- local procedure GetNumberOfContractDocumentsSales(DocumentType: Enum "Sales Document Type"): Integer
- begin
- SalesHeader.Reset();
- SalesHeader.SetRange("Document Type", DocumentType);
- SalesHeader.SetRange("Recurring Billing", true);
- exit(SalesHeader.Count());
- end;
-
- local procedure GetNumberOfContractDocumentsPurchase(DocumentType: Enum "Purchase Document Type"): Integer
- begin
- PurchaseHeader.Reset();
- PurchaseHeader.SetRange("Document Type", DocumentType);
- PurchaseHeader.SetRange("Recurring Billing", true);
- exit(PurchaseHeader.Count());
- end;
-
- local procedure CreateDummyContractDocumentsSales()
- var
- SalesDocumentType: Enum "Sales Document Type";
- begin
- for SalesDocumentType := SalesDocumentType::Invoice to SalesDocumentType::"Credit Memo" do
- for i := 1 to 2 do begin
- Clear(SalesHeader);
- SalesHeader."No." := '';
- SalesHeader."Document Type" := SalesDocumentType;
- SalesHeader."Recurring Billing" := true;
- SalesHeader.Insert(true);
- end;
- end;
-
- local procedure CreateDummyContractDocumentsPurchase()
- var
- PurchaseDocumentType: Enum "Purchase Document Type";
- begin
- for PurchaseDocumentType := PurchaseDocumentType::Invoice to PurchaseDocumentType::"Credit Memo" do
- for i := 1 to 2 do begin
- Clear(PurchaseHeader);
- PurchaseHeader."No." := '';
- PurchaseHeader."Document Type" := PurchaseDocumentType;
- PurchaseHeader."Recurring Billing" := true;
- PurchaseHeader.Insert(true);
- end;
- end;
-
- local procedure CountBillingArchiveLinesOnServiceCommitment(ServiceCommitmentEntryNo: Integer): Integer
- var
- BillingArchiveLine: Record "Billing Line Archive";
- begin
- BillingArchiveLine.FilterBillingLineArchiveOnServiceCommitment(ServiceCommitmentEntryNo);
- exit(BillingArchiveLine.Count());
- end;
-
[Test]
[HandlerFunctions('CreateBillingDocumentPageHandler,MessageHandler,ExchangeRateSelectionModalPageHandler')]
procedure TestVendorContractPurchaseInvoicePricesTakenFromServiceCommitment()
@@ -2107,6 +1658,7 @@ codeunit 139687 "Recurring Billing Docs Test"
PriceListLine: Record "Price List Line";
begin
//[SCENARIO]: Test if Prices in Purchase Invoice (created from Vendor Contract) are taken from service commitments
+ Initialize();
//[GIVEN]:
//Setup service commitment item with purchase price
@@ -2158,6 +1710,7 @@ codeunit 139687 "Recurring Billing Docs Test"
PriceListLine: Record "Price List Line";
begin
//[SCENARIO]: Test if Prices in Sales Invoice (created from Customer Contract) are taken from service commitments
+ Initialize();
//[GIVEN]:
//Setup service commitment item with sales price
@@ -2196,17 +1749,619 @@ codeunit 139687 "Recurring Billing Docs Test"
AssertThat.RecordIsNotEmpty(SalesLine);
end;
- procedure FilterSalesLineOnDocumentLine(SalesDocumentType: Enum "Sales Document Type"; DocumentNo: Code[20]; LineNo: Integer)
+ local procedure Initialize()
+ begin
+ LibraryTestInitialize.OnTestInitialize(Codeunit::"Recurring Billing Docs Test");
+
+ if IsInitialized then
+ exit;
+
+ LibraryTestInitialize.OnBeforeTestSuiteInitialize(Codeunit::"Recurring Billing Docs Test");
+ LibraryERMCountryData.UpdatePurchasesPayablesSetup();
+ LibraryERMCountryData.UpdateSalesReceivablesSetup();
+ LibraryERMCountryData.UpdateGeneralLedgerSetup();
+ LibraryERMCountryData.UpdateJournalTemplMandatory(false);
+ LibraryTestInitialize.OnAfterTestSuiteInitialize(Codeunit::"Recurring Billing Docs Test");
+ end;
+
+ local procedure FilterSalesLineOnDocumentLine(SalesDocumentType: Enum "Sales Document Type"; DocumentNo: Code[20]; LineNo: Integer)
begin
SalesLine.SetRange("Document Type", SalesDocumentType);
SalesLine.SetRange("Document No.", DocumentNo);
SalesLine.SetRange("Line No.", LineNo);
end;
- procedure FilterPurchaseLineOnDocumentLine(PurchaseDocumentType: Enum "Purchase Document Type"; DocumentNo: Code[20]; LineNo: Integer)
+ local procedure FilterPurchaseLineOnDocumentLine(PurchaseDocumentType: Enum "Purchase Document Type"; DocumentNo: Code[20]; LineNo: Integer)
begin
PurchaseLine.SetRange("Document Type", PurchaseDocumentType);
PurchaseLine.SetRange("Document No.", DocumentNo);
PurchaseLine.SetRange("Line No.", LineNo);
end;
+
+ local procedure InitServiceContractSetup()
+ var
+ ServiceContractSetup: Record "Service Contract Setup";
+ begin
+ ServiceContractSetup.Get();
+ ServiceContractSetup.ContractTextsCreateDefaults();
+ ServiceContractSetup.Modify(false);
+ end;
+
+ local procedure SetupBasicBillingProposal(ServicePartner: Enum "Service Partner")
+ begin
+ ClearAll();
+ case ServicePartner of
+ Enum::"Service Partner"::Customer:
+ ContractTestLibrary.CreateCustomerContractAndCreateContractLinesAndBillingProposal(CustomerContract, ServiceObject, '', BillingTemplate);
+ Enum::"Service Partner"::Vendor:
+ ContractTestLibrary.CreateVendorContractAndCreateContractLinesAndBillingProposal(VendorContract, ServiceObject, '', BillingTemplate);
+ end;
+ ContractTestLibrary.CreateDefaultRecurringBillingTemplateForServicePartner(BillingTemplate2, ServicePartner);
+ ContractTestLibrary.CreateBillingProposal(BillingTemplate2, ServicePartner);
+ end;
+
+ local procedure InitAndCreateBillingDocument(ServicePartner: Enum "Service Partner")
+ begin
+ SetupBasicBillingProposal(ServicePartner);
+ CreateBillingDocuments();
+ end;
+
+ local procedure CreateBillingDocuments()
+ begin
+ CreateBillingDocuments(true);
+ end;
+
+ local procedure CreateBillingDocuments(InitializeTextSetup: Boolean)
+ begin
+ if InitializeTextSetup then begin
+ InitServiceContractSetup();
+ // Commit before asserterror to keep data
+ Commit();
+ end;
+ BillingLine.SetRange("Billing Template Code", BillingTemplate.Code);
+ BillingLine.SetRange(Partner, BillingTemplate.Partner);
+ Codeunit.Run(Codeunit::"Create Billing Documents", BillingLine);
+ Commit(); // retain data after asserterror
+ end;
+
+ local procedure InitAndCreateBillingDocumentsForMultipleContracts()
+ begin
+ //Contract1, Sell-to Customer1, Bill-to Customer1
+ //Contract2, Sell-to Customer2, Bill-to Customer2
+ //Contract3, Sell-to Customer2, Bill-to Customer1
+ //Contract4, Sell-to Customer3, Bill-to Customer1
+ ClearAll();
+ ContractTestLibrary.CreateCustomerContractAndCreateContractLines(CustomerContract, ServiceObject, '');
+ ContractTestLibrary.CreateCustomer(Customer2);
+ ContractTestLibrary.CreateCustomerContractAndCreateContractLines(CustomerContract2, ServiceObject2, Customer2."No.");
+ CustomerContract2.Validate("Currency Code", CustomerContract."Currency Code");
+ CustomerContract2.Modify(false);
+ ContractTestLibrary.CreateCustomerContractAndCreateContractLines(CustomerContract3, ServiceObject3, Customer2."No.");
+ CustomerContract3.SetHideValidationDialog(true);
+ CustomerContract3.Validate("Bill-to Customer No.", CustomerContract."Bill-to Customer No.");
+ CustomerContract3.Validate("Currency Code", CustomerContract."Currency Code");
+ CustomerContract3.Modify(false);
+ ContractTestLibrary.CreateCustomer(Customer3);
+ ContractTestLibrary.CreateCustomerContractAndCreateContractLines(CustomerContract4, ServiceObject4, Customer3."No.");
+ CustomerContract4.SetHideValidationDialog(true);
+ CustomerContract4.Validate("Bill-to Customer No.", CustomerContract."Bill-to Customer No.");
+ CustomerContract4.Validate("Currency Code", CustomerContract."Currency Code");
+ CustomerContract4.Modify(false);
+ ContractTestLibrary.CreateBillingProposal(BillingTemplate, Enum::"Service Partner"::Customer);
+ CreateBillingDocuments();
+ end;
+
+ local procedure InitAndCreateBillingDocumentsForMultipleVendorContracts()
+ begin
+ //Contract1, Sell-to Customer1, Bill-to Customer1
+ //Contract2, Sell-to Customer2, Bill-to Customer2
+ //Contract3, Sell-to Customer2, Bill-to Customer1
+ //Contract4, Sell-to Customer3, Bill-to Customer1
+ ClearAll();
+ ContractTestLibrary.CreateVendorContractAndCreateContractLines(VendorContract, ServiceObject, '');
+ ContractTestLibrary.CreateVendor(Vendor2);
+ ContractTestLibrary.CreateVendorContractAndCreateContractLines(VendorContract2, ServiceObject2, Vendor2."No.");
+ VendorContract2.Validate("Currency Code", VendorContract."Currency Code");
+ VendorContract2.Modify(false);
+ ContractTestLibrary.CreateVendorContractAndCreateContractLines(VendorContract3, ServiceObject3, Vendor2."No.");
+ VendorContract3.SetHideValidationDialog(true);
+ VendorContract3.Validate("Currency Code", VendorContract."Currency Code");
+ VendorContract3.Validate("Pay-to Vendor No.", VendorContract."Buy-from Vendor No.");
+ VendorContract3.Modify(false);
+ ContractTestLibrary.CreateVendor(Vendor3);
+ ContractTestLibrary.CreateVendorContractAndCreateContractLines(VendorContract4, ServiceObject4, Vendor3."No.");
+ VendorContract4.SetHideValidationDialog(true);
+ VendorContract4.Validate("Pay-to Vendor No.", VendorContract."Buy-from Vendor No.");
+ VendorContract4.Validate("Currency Code", VendorContract."Currency Code");
+ VendorContract4.Modify(false);
+ ContractTestLibrary.CreateBillingProposal(BillingTemplate, Enum::"Service Partner"::Vendor);
+ CreateBillingDocuments();
+ end;
+
+ local procedure CheckIfSalesDocumentsHaveBeenCreated()
+ var
+ TempSalesHeader: Record "Sales Header" temporary;
+ begin
+ if BillingLine.FindSet() then
+ repeat
+ BillingLine.TestField("Document Type", Enum::"Rec. Billing Document Type"::Invoice);
+ BillingLine.TestField("Document No.");
+ SalesHeader.Get(Enum::"Sales Document Type"::Invoice, BillingLine."Document No.");
+ SalesHeader.TestField("Assigned User ID", UserId());
+ FilterSalesLineOnDocumentLine(SalesHeader."Document Type", SalesHeader."No.", BillingLine."Document Line No.");
+ AssertThat.AreEqual(1, SalesLine.Count, 'The Sales lines were not created properly.');
+ SalesLine.FindFirst();
+ BillingLine.CalcFields("Service Object Description");
+ SalesLine.TestField(Description, BillingLine."Service Object Description");
+ SalesLine.TestField("Description 2", '');
+ if not TempSalesHeader.Get(SalesHeader."Document Type", SalesHeader."No.") then begin
+ TempSalesHeader.TransferFields(SalesHeader);
+ TempSalesHeader.Insert(false);
+ DocumentsCount += 1;
+ end;
+ until BillingLine.Next() = 0;
+ end;
+
+ local procedure CheckIfPurchaseDocumentsHaveBeenCreated()
+ var
+ TempPurchaseHeader: Record "Purchase Header" temporary;
+ begin
+ if BillingLine.FindSet() then
+ repeat
+ BillingLine.TestField("Document Type", Enum::"Rec. Billing Document Type"::Invoice);
+ BillingLine.TestField("Document No.");
+ PurchaseHeader.Get(Enum::"Purchase Document Type"::Invoice, BillingLine."Document No.");
+ PurchaseHeader.TestField("Assigned User ID", UserId());
+ FilterPurchaseLineOnDocumentLine(PurchaseHeader."Document Type", BillingLine."Document No.", BillingLine."Document Line No.");
+ AssertThat.AreEqual(1, PurchaseLine.Count, 'The Purchase lines were not created properly.');
+ PurchaseLine.FindFirst();
+ PurchaseLine.TestField(Description, BillingLine."Service Commitment Description");
+ BillingLine.CalcFields("Service Object Description");
+ PurchaseLine.TestField("Description 2", BillingLine."Service Object Description");
+ if not TempPurchaseHeader.Get(PurchaseHeader."Document Type", PurchaseHeader."No.") then begin
+ TempPurchaseHeader.TransferFields(PurchaseHeader);
+ TempPurchaseHeader.Insert(false);
+ PurchaseDocumentCount += 1;
+ end;
+ until BillingLine.Next() = 0;
+ end;
+
+ local procedure TestDocumentFields(CalledFromSales: Boolean)
+ var
+ ValueCode: Text[10];
+ ValueInteger: Integer;
+ ValueDecimal: Decimal;
+ begin
+ i := 1;
+ repeat
+ FRef := RRef.Field(FieldsArray[i]);
+
+ case FRef.Type() of
+ FieldType::Decimal:
+ begin
+ ValueDecimal := FRef.Value;
+ FRef.Value(ValueDecimal + 1);
+ end;
+ FieldType::Integer, FieldType::Option:
+ begin
+ ValueInteger := FRef.Value;
+ FRef.Value(ValueInteger + 1);
+ end;
+ FieldType::Code, FieldType::Text:
+ begin
+ ValueCode := CopyStr(LibraryRandom.RandText(10), 1, 10);
+ FRef.Value(ValueCode);
+ end;
+ FieldType::Date:
+ FRef.Value(CalcDate('<1D>', FRef.Value));
+ FieldType::Boolean:
+ FRef.Value(not FRef.Value);
+ end;
+
+ asserterror DocChangeMgt.PreventChangeOnDocumentHeaderOrLine(RRef, FieldsArray[i]);
+ i += 1;
+ if ((i in [20, 40, 43]) and not CalledFromSales) then //skip ID that's not in Purchase Hdr but exists in Sales Hdr
+ i += 1;
+ if FieldsArray[i] = 0 then
+ EmptyArray := true;
+ until EmptyArray = true;
+ end;
+
+ local procedure PopulateArrayOfFieldsForHeaders(CalledFromSales: Boolean)
+ begin
+ FieldsArray[1] := 2; //Sell-to Customer No. //Buy-from Vendor No. (Buy-from Vendor No.)
+ FieldsArray[2] := 4; //Bill-to Customer No. //Pay-to Vendor No. (Pay-to Vendor No.)
+ FieldsArray[3] := 5; //Bill-to Name //Pay-to Name (Pay-to Name)
+ FieldsArray[4] := 6; //Bill-to Name 2 //Pay-to Name 2 (Pay-to Name 2)
+ FieldsArray[5] := 7; //Bill-to Address (Bill-to Address) //Pay-to Address (Pay-to Address)
+ FieldsArray[6] := 8; //Bill-to Address 2 (Bill-to Address 2) //Pay-to Address 2 (Pay-to Address 2)
+ FieldsArray[7] := 9; //Bill-to City (Bill-to City) //Pay-to City (Pay-to City)
+ FieldsArray[8] := 10; //Bill-to Contact (Bill-to Contact) //Pay-to Contact (Pay-to Contact)
+ FieldsArray[9] := 12; //Ship-to Code (Ship-to Code) //Ship-to Code (Ship-to Code)
+ FieldsArray[10] := 13; //Ship-to Name (Ship-to Name) //Ship-to Name (Ship-to Name)
+ FieldsArray[11] := 14; //Ship-to Name 2 (Ship-to Name 2) //Ship-to Name 2 (Ship-to Name 2)
+ FieldsArray[12] := 15; //Ship-to Address (Ship-to Address) //Ship-to Address (Ship-to Address)
+ FieldsArray[13] := 16; //Ship-to Address 2 (Ship-to Address 2) //Ship-to Address 2 (Ship-to Address 2)
+ FieldsArray[14] := 17; //Ship-to City (Ship-to City) //Ship-to City (Ship-to City)
+ FieldsArray[15] := 18; //Ship-to Contact (Ship-to Contact) //Ship-to Contact (Ship-to Contact)
+ FieldsArray[16] := 29; //Shortcut Dimension 1 Code (Shortcut Dimension 1 Code) //Shortcut Dimension 1 Code (Shortcut Dimension 1 Code)
+ FieldsArray[17] := 30; //Shortcut Dimension 2 Code (Shortcut Dimension 2 Code) //Shortcut Dimension 2 Code (Shortcut Dimension 2 Code)
+ FieldsArray[18] := 32; //Currency Code (Currency Code) //Currency Code (Currency Code)
+ FieldsArray[19] := 35; //Prices Including VAT (Prices Including VAT) //Prices Including VAT (Prices Including VAT)
+ FieldsArray[21] := 76; //Transaction Type (Transaction Type) //Transaction Type (Transaction Type)
+ FieldsArray[22] := 77; //Transport Method (Transport Method) //Transport Method (Transport Method)
+ FieldsArray[23] := 79; //Sell-to Customer Name (Sell-to Customer Name) //Buy-from Vendor Name (Buy-from Vendor Name)
+ FieldsArray[24] := 80; //Sell-to Customer Name 2 (Sell-to Customer Name 2) //Buy-from Vendor Name 2 (Buy-from Vendor Name 2)
+ FieldsArray[25] := 81; //Sell-to Address (Sell-to Address) //Buy-from Address (Buy-from Address)
+ FieldsArray[26] := 82; //Sell-to Address 2 (Sell-to Address 2) //Buy-from Address 2 (Buy-from Address 2)
+ FieldsArray[27] := 83; //Sell-to City (Sell-to City) //Buy-from City (Buy-from City)
+ FieldsArray[28] := 84; //Sell-to Contact (Sell-to Contact) //Buy-from Contact (Buy-from Contact)
+ FieldsArray[29] := 85; //Bill-to Post Code (Bill-to Post Code) //Pay-to Post Code (Pay-to Post Code)
+ FieldsArray[30] := 86; //Bill-to County (Bill-to County) //Pay-to County (Pay-to County)
+ FieldsArray[31] := 87; //Bill-to Country/Region Code (Bill-to Country/Region Code) //Pay-to Country/Region Code (Pay-to Country/Region Code)
+ FieldsArray[32] := 88; //Sell-to Post Code (Sell-to Post Code) //Buy-from Post Code (Buy-from Post Code)
+ FieldsArray[33] := 89; //Sell-to County (Sell-to County) //Buy-from County (Buy-from County)
+ FieldsArray[34] := 90; //Sell-to Country/Region Code (Sell-to Country/Region Code) //Buy-from Country/Region Code (Buy-from Country/Region Code)
+ FieldsArray[35] := 91; //Ship-to Post Code (Ship-to Post Code) //Ship-to Post Code (Ship-to Post Code)
+ FieldsArray[36] := 92; //Ship-to County (Ship-to County) //Ship-to County (Ship-to County)
+ FieldsArray[37] := 93; //Ship-to Country/Region Code (Ship-to Country/Region Code) //Ship-to Country/Region Code (Ship-to Country/Region Code)
+ FieldsArray[38] := 116; //VAT Bus. Posting Group (VAT Bus. Posting Group) //VAT Bus. Posting Group (VAT Bus. Posting Group)
+ FieldsArray[39] := 480; //Dimension Set ID (Dimension Set ID) //Dimension Set ID (Dimension Set ID)
+ FieldsArray[41] := 5052; //Sell-to Contact No. (Sell-to Contact No.) //Buy-from Contact No. (Buy-from Contact No.)
+ FieldsArray[42] := 5053; //Bill-to Contact No. (Bill-to Contact No.) //Pay-to Contact No. (Pay-to Contact No.)
+ if CalledFromSales then begin
+ FieldsArray[20] := 75; //EU 3-Party Trade (EU 3-Party Trade) //No field in Purchase Header
+ FieldsArray[43] := 5057; //Bill-to Customer Templ. Code (Bill-to Customer Templ. Code) //No field in Purchase Header
+ FieldsArray[40] := 5056; //Sell-to Customer Templ. Code (Sell-to Customer Templ. Code) //No field in Purchase Header
+ end;
+ end;
+
+ local procedure PopulateArrayOfFieldsForLines()
+ begin
+ FieldsArray[1] := 5; //Type
+ FieldsArray[2] := 6; //No.
+ FieldsArray[3] := 15; //Quantity
+ FieldsArray[4] := 22; //Unit Price/Cost
+ FieldsArray[5] := 27; //Line Discount %
+ FieldsArray[6] := 28; //Line Discount Amount
+ FieldsArray[7] := 29; //Amount
+ FieldsArray[8] := 30; //Amount including VAT
+ FieldsArray[9] := 40; //Dim 1
+ FieldsArray[10] := 41; // Dim2
+ FieldsArray[11] := 480; // Dimension Set ID
+ FieldsArray[12] := 8053; //Recurring Billing from
+ FieldsArray[13] := 8054; //Recurring Billing to
+ end;
+
+ local procedure PostAndGetSalesInvoiceHeaderFromRecurringBilling()
+ begin
+ PostedDocumentNo := LibrarySales.PostSalesDocument(SalesHeader, true, true);
+ SalesInvoiceHeader.Get(PostedDocumentNo);
+ end;
+
+ local procedure CheckIfPostedSalesDocumentsHaveBeenCreated()
+ begin
+ TempSalesInvoiceHeader.Reset();
+ TempSalesInvoiceHeader.DeleteAll(false);
+ GetPostedSalesDocumentsFromContract(CustomerContract);
+ GetPostedSalesDocumentsFromContract(CustomerContract2);
+ GetPostedSalesDocumentsFromContract(CustomerContract3);
+ GetPostedSalesDocumentsFromContract(CustomerContract4);
+ end;
+
+ local procedure GetPostedSalesDocumentsFromContract(SourceCustomerContract: Record "Customer Contract")
+ var
+ BillingLineArchive: Record "Billing Line Archive";
+ begin
+ ContractTestLibrary.FilterBillingLineArchiveOnContractLine(BillingLineArchive, SourceCustomerContract."No.", 0, Enum::"Service Partner"::Customer);
+ if BillingLineArchive.FindSet() then
+ repeat
+ BillingLineArchive.TestField("Document Type", BillingLineArchive."Document Type"::Invoice);
+ BillingLineArchive.TestField("Document No.");
+ SalesInvoiceHeader.Get(BillingLineArchive."Document No.");
+ if not TempSalesInvoiceHeader.Get(BillingLineArchive."Document No.") then begin
+ TempSalesInvoiceHeader := SalesInvoiceHeader;
+ TempSalesInvoiceHeader.Insert(false);
+ DocumentsCount += 1;
+ end;
+ until BillingLineArchive.Next() = 0;
+ end;
+
+ local procedure GetCustomerContractServiceCommitment(ContractNo: Code[20])
+ begin
+ CustomerContractLine.SetRange("Contract No.", ContractNo);
+ CustomerContractLine.FindFirst();
+ CustomerContractLine.GetServiceCommitment(ServiceCommitment);
+ end;
+
+ local procedure GetVendorContractServiceCommitment(ContractNo: Code[20])
+ begin
+ VendorContractLine.SetRange("Contract No.", ContractNo);
+ VendorContractLine.FindFirst();
+ ServiceCommitment.Get(VendorContractLine."Service Commitment Entry No.")
+ end;
+
+ local procedure CountBillingArchiveLinesOnDocument(DocumentType: Enum "Rec. Billing Document Type"; DocumentNo: Code[20]; ServicePartner: Enum "Service Partner"; ContractNo: Code[20]; ContractLineNo: Integer): Integer
+ var
+ BillingArchiveLine: Record "Billing Line Archive";
+ begin
+ BillingArchiveLine.FilterBillingLineArchiveOnContractLine(ServicePartner, ContractNo, ContractLineNo);
+ BillingArchiveLine.FilterBillingLineArchiveOnDocument(DocumentType, DocumentNo);
+ exit(BillingArchiveLine.Count());
+ end;
+
+ local procedure PrepareCustomerContractWithNames()
+ begin
+ SetupBasicBillingProposal(Enum::"Service Partner"::Customer);
+ InitServiceContractSetup();
+
+ CustomerContract."Sell-to Customer Name" := CopyStr(LibraryRandom.RandText(MaxStrLen(CustomerContract."Sell-to Customer Name")), 1, MaxStrLen(CustomerContract."Sell-to Customer Name"));
+ CustomerContract."Sell-to Customer Name 2" := CopyStr(LibraryRandom.RandText(MaxStrLen(CustomerContract."Sell-to Customer Name 2")), 1, MaxStrLen(CustomerContract."Sell-to Customer Name 2"));
+ CustomerContract."Ship-to Name" := CopyStr(LibraryRandom.RandText(MaxStrLen(CustomerContract."Ship-to Name")), 1, MaxStrLen(CustomerContract."Ship-to Name"));
+ CustomerContract."Ship-to Name 2" := CopyStr(LibraryRandom.RandText(MaxStrLen(CustomerContract."Ship-to Name 2")), 1, MaxStrLen(CustomerContract."Ship-to Name 2"));
+ CustomerContract.Modify(false);
+ end;
+
+ local procedure GetNoOfSalesInvoiceLineWithDescription(ExpectedDescriptionText: Text[100]): Integer
+ begin
+ BillingLine.Reset();
+ BillingLine.SetRange("Billing Template Code", BillingTemplate.Code);
+ BillingLine.SetRange(Partner, BillingTemplate.Partner);
+ BillingLine.FindLast();
+
+ SalesLine.Reset();
+ SalesLine.SetRange("Document Type", BillingLine.GetSalesDocumentTypeFromBillingDocumentType());
+ SalesLine.SetRange("Document No.", BillingLine."Document No.");
+ SalesLine.SetRange(Description, ExpectedDescriptionText);
+ exit(SalesLine.Count());
+ end;
+
+ local procedure CreateAndPostSimpleSalesDocument(ItemNo: Code[20])
+ begin
+ LibrarySales.CreateSalesHeader(SalesHeader, SalesHeader."Document Type"::Order, '');
+ LibrarySales.CreateSalesLine(SalesLine, SalesHeader, Enum::"Sales Line Type"::Item, ItemNo, 1);
+ SalesLine.Validate("Unit Price", -50);
+ SalesLine.Modify(false);
+ LibrarySales.CreateSalesLine(SalesLine, SalesHeader, Enum::"Sales Line Type"::Item, ItemNo, 1);
+ SalesLine.Validate("Unit Price", 100);
+ SalesLine.Modify(false);
+ LibrarySales.PostSalesDocument(SalesHeader, true, false);
+ end;
+
+ local procedure CreateCustomerContractAndAssignServiceObjects(ItemNo: Code[20])
+ var
+ TempServiceCommitment: Record "Service Commitment" temporary;
+ begin
+ ContractTestLibrary.CreateCustomerContract(CustomerContract, SalesHeader."Sell-to Customer No.");
+ ServiceObject.Reset();
+ ServiceObject.SetRange("Item No.", ItemNo);
+ ServiceObject.FindSet();
+ repeat
+ ContractTestLibrary.FillTempServiceCommitment(TempServiceCommitment, ServiceObject, CustomerContract);
+ CustomerContract.CreateCustomerContractLinesFromServiceCommitments(TempServiceCommitment);
+ until ServiceObject.Next() = 0;
+ CustomerContractLine.SetRange("Contract No.", CustomerContract."No.");
+ CustomerContractLine.FindSet();
+ repeat
+ CustomerContractLine.GetServiceCommitment(ServiceCommitment);
+ ServiceCommitment.Validate("Service Start Date", CalcDate('<2M-CM>', WorkDate()));
+ ServiceCommitment.Modify(false);
+ until CustomerContractLine.Next() = 0;
+ end;
+
+ local procedure CreateAndDeleteDummyContractDocuments(Selection: Integer; NoOfSalesInvoices: Integer; NoOfSalesCrMemos: Integer; NoOfPurchaseInvoices: Integer; NoOfPurchaseCrMemos: Integer)
+ begin
+ SalesHeader.Reset();
+ SalesHeader.SetFilter("Document Type", '%1|%2', SalesHeader."Document Type"::Invoice, SalesHeader."Document Type"::"Credit Memo");
+ if not SalesHeader.IsEmpty() then
+ SalesHeader.ModifyAll("Recurring Billing", false, false);
+ PurchaseHeader.Reset();
+ PurchaseHeader.SetFilter("Document Type", '%1|%2', PurchaseHeader."Document Type"::Invoice, PurchaseHeader."Document Type"::"Credit Memo");
+ if not PurchaseHeader.IsEmpty() then
+ PurchaseHeader.ModifyAll("Recurring Billing", false, false);
+
+ CreateDummyContractDocumentsSales();
+ CreateDummyContractDocumentsPurchase();
+ BillingProposal.DeleteBillingDocuments(Selection, false);
+
+ AssertThat.AreEqual(NoOfSalesInvoices, GetNumberOfContractDocumentsSales(Enum::"Sales Document Type"::Invoice), 'Unexpected No. of Sales Invoices after batch-deletion');
+ AssertThat.AreEqual(NoOfSalesCrMemos, GetNumberOfContractDocumentsSales(Enum::"Sales Document Type"::"Credit Memo"), 'Unexpected No. of Sales Credit Memos after batch-deletion');
+ AssertThat.AreEqual(NoOfPurchaseInvoices, GetNumberOfContractDocumentsPurchase(Enum::"Purchase Document Type"::Invoice), 'Unexpected No. of Purchase Invoices after batch-deletion');
+ AssertThat.AreEqual(NoOfPurchaseCrMemos, GetNumberOfContractDocumentsPurchase(Enum::"Purchase Document Type"::"Credit Memo"), 'Unexpected No. of Purchase Credit Memos after batch-deletion');
+ end;
+
+ local procedure GetNumberOfContractDocumentsSales(DocumentType: Enum "Sales Document Type"): Integer
+ begin
+ SalesHeader.Reset();
+ SalesHeader.SetRange("Document Type", DocumentType);
+ SalesHeader.SetRange("Recurring Billing", true);
+ exit(SalesHeader.Count());
+ end;
+
+ local procedure GetNumberOfContractDocumentsPurchase(DocumentType: Enum "Purchase Document Type"): Integer
+ begin
+ PurchaseHeader.Reset();
+ PurchaseHeader.SetRange("Document Type", DocumentType);
+ PurchaseHeader.SetRange("Recurring Billing", true);
+ exit(PurchaseHeader.Count());
+ end;
+
+ local procedure CreateDummyContractDocumentsSales()
+ var
+ SalesDocumentType: Enum "Sales Document Type";
+ begin
+ for SalesDocumentType := SalesDocumentType::Invoice to SalesDocumentType::"Credit Memo" do
+ for i := 1 to 2 do begin
+ Clear(SalesHeader);
+ SalesHeader."No." := '';
+ SalesHeader."Document Type" := SalesDocumentType;
+ SalesHeader."Recurring Billing" := true;
+ SalesHeader.Insert(true);
+ end;
+ end;
+
+ local procedure CreateDummyContractDocumentsPurchase()
+ var
+ PurchaseDocumentType: Enum "Purchase Document Type";
+ begin
+ for PurchaseDocumentType := PurchaseDocumentType::Invoice to PurchaseDocumentType::"Credit Memo" do
+ for i := 1 to 2 do begin
+ Clear(PurchaseHeader);
+ PurchaseHeader."No." := '';
+ PurchaseHeader."Document Type" := PurchaseDocumentType;
+ PurchaseHeader."Recurring Billing" := true;
+ PurchaseHeader.Insert(true);
+ end;
+ end;
+
+ local procedure CountBillingArchiveLinesOnServiceCommitment(ServiceCommitmentEntryNo: Integer): Integer
+ var
+ BillingArchiveLine: Record "Billing Line Archive";
+ begin
+ BillingArchiveLine.FilterBillingLineArchiveOnServiceCommitment(ServiceCommitmentEntryNo);
+ exit(BillingArchiveLine.Count());
+ end;
+
+ [ConfirmHandler]
+ procedure DialogHandler(Question: Text[1024]; var Reply: Boolean)
+ begin
+ if not (Question = DialogMsg) then
+ Error('No Dialog Question found!');
+ Reply := false;
+ end;
+
+ [ConfirmHandler]
+ procedure ConfirmHandler(Question: Text[1024]; var Reply: Boolean)
+ begin
+ Reply := true;
+ end;
+
+ [MessageHandler]
+ procedure MessageHandler(Message: Text[1024])
+ begin
+ end;
+
+ [ModalPageHandler]
+ procedure CreateCustomerBillingDocsTestOpenPageHandler(var CreateCustomerBillingDocs: TestPage "Create Customer Billing Docs")
+ var
+ PagePostingDate: Date;
+ PageDocumentDate: Date;
+ begin
+ Evaluate(PagePostingDate, CreateCustomerBillingDocs.PostingDate.Value);
+ Evaluate(PageDocumentDate, CreateCustomerBillingDocs.DocumentDate.Value);
+ AssertThat.AreEqual(WorkDate(), PagePostingDate, 'Posting Date is not initialized correctly.');
+ AssertThat.AreEqual(WorkDate(), PageDocumentDate, 'Document Date is not initialized correctly.');
+ CreateCustomerBillingDocs.Cancel().Invoke();
+ end;
+
+ [ModalPageHandler]
+ procedure CreateCustomerBillingDocsContractPageHandler(var CreateCustomerBillingDocs: TestPage "Create Customer Billing Docs")
+ begin
+ CreateCustomerBillingDocs.OK().Invoke();
+ end;
+
+ [ModalPageHandler]
+ procedure CreateCustomerBillingDocsSellToCustomerPageHandler(var CreateCustomerBillingDocs: TestPage "Create Customer Billing Docs")
+ begin
+ CreateCustomerBillingDocs.GroupingType.SetValue(Enum::"Customer Rec. Billing Grouping"::"Sell-to Customer No.");
+ CreateCustomerBillingDocs.OK().Invoke();
+ end;
+
+ [ModalPageHandler]
+ procedure CreateCustomerBillingDocsBillToCustomerPageHandler(var CreateCustomerBillingDocs: TestPage "Create Customer Billing Docs")
+ begin
+ CreateCustomerBillingDocs.GroupingType.SetValue(Enum::"Customer Rec. Billing Grouping"::"Bill-to Customer No.");
+ CreateCustomerBillingDocs.OK().Invoke();
+ end;
+
+ [ModalPageHandler]
+ procedure CancelCreateVendorBillingDocsTestOpenPageHandler(var CreateVendorBillingDocs: TestPage "Create Vendor Billing Docs")
+ var
+ PagePostingDate: Date;
+ PageDocumentDate: Date;
+ begin
+ Evaluate(PagePostingDate, CreateVendorBillingDocs.PostingDate.Value);
+ Evaluate(PageDocumentDate, CreateVendorBillingDocs.DocumentDate.Value);
+ AssertThat.AreEqual(WorkDate(), PagePostingDate, 'Posting Date is not initialized correctly.');
+ AssertThat.AreEqual(WorkDate(), PageDocumentDate, 'Document Date is not initialized correctly.');
+ CreateVendorBillingDocs.Cancel().Invoke();
+ end;
+
+ [ModalPageHandler]
+ procedure CreateVendorBillingDocsContractPageHandler(var CreateVendorBillingDocs: TestPage "Create Vendor Billing Docs")
+ begin
+ CreateVendorBillingDocs.OK().Invoke();
+ end;
+
+ [ModalPageHandler]
+ procedure CreateVendorBillingDocsPayToVendorPageHandler(var CreateVendorBillingDocs: TestPage "Create Vendor Billing Docs")
+ begin
+ CreateVendorBillingDocs.GroupingType.SetValue(Enum::"Vendor Rec. Billing Grouping"::"Pay-to Vendor No.");
+ CreateVendorBillingDocs.OK().Invoke();
+ end;
+
+ [ModalPageHandler]
+ procedure CreateVendorBillingDocsBuyFromVendorPageHandler(var CreateVendorBillingDocs: TestPage "Create Vendor Billing Docs")
+ begin
+ CreateVendorBillingDocs.GroupingType.SetValue(Enum::"Vendor Rec. Billing Grouping"::"Buy-From Vendor No.");
+ CreateVendorBillingDocs.OK().Invoke();
+ end;
+
+ [ModalPageHandler]
+ procedure ExchangeRateSelectionModalPageHandler(var ExchangeRateSelectionPage: TestPage "Exchange Rate Selection")
+ begin
+ ExchangeRateSelectionPage.OK().Invoke();
+ end;
+
+ [ModalPageHandler]
+ procedure CreateAndPostCustomerBillingDocsContractPageHandler(var CreateCustomerBillingDocs: TestPage "Create Customer Billing Docs")
+ begin
+ CreateCustomerBillingDocs.PostDocuments.SetValue(true);
+ CreateCustomerBillingDocs.OK().Invoke();
+ end;
+
+ [ModalPageHandler]
+ procedure CreateAndPostCustomerBillingDocsSellToCustomerPageHandler(var CreateCustomerBillingDocs: TestPage "Create Customer Billing Docs")
+ begin
+ CreateCustomerBillingDocs.PostDocuments.SetValue(true);
+ CreateCustomerBillingDocs.GroupingType.SetValue(Enum::"Customer Rec. Billing Grouping"::"Sell-to Customer No.");
+ CreateCustomerBillingDocs.OK().Invoke();
+ end;
+
+ [ModalPageHandler]
+ procedure CreateAndPostCustomerBillingDocsBillToCustomerPageHandler(var CreateCustomerBillingDocs: TestPage "Create Customer Billing Docs")
+ begin
+ CreateCustomerBillingDocs.PostDocuments.SetValue(true);
+ CreateCustomerBillingDocs.GroupingType.SetValue(Enum::"Customer Rec. Billing Grouping"::"Bill-to Customer No.");
+ CreateCustomerBillingDocs.OK().Invoke();
+ end;
+
+ [ModalPageHandler]
+ procedure CreateVendorBillingDocsTestOpenPageHandler(var CreateVendorBillingDocs: TestPage "Create Vendor Billing Docs")
+ begin
+ CreateVendorBillingDocs.OK().Invoke();
+ end;
+
+ [ModalPageHandler]
+ procedure CreateBillingDocumentPageHandler(var CreateBillingDocument: TestPage "Create Billing Document")
+ begin
+ CreateBillingDocument.BillingDate.SetValue(NextBillingToDate);
+ CreateBillingDocument.BillingTo.SetValue(NextBillingToDate);
+ CreateBillingDocument.OpenDocument.SetValue(false);
+ CreateBillingDocument.PostDocument.SetValue(false);
+ CreateBillingDocument.OK().Invoke()
+ end;
+
+ [PageHandler]
+ procedure BillingLinesArchivePageHandler(var BillingLinesArchive: TestPage "Archived Billing Lines")
+ var
+ NoOfRecords: Integer;
+ begin
+ if BillingLinesArchive.First() then
+ repeat
+ NoOfRecords += 1;
+ until not BillingLinesArchive.Next();
+ AssertThat.AreEqual(NoOfRecords, ExpectedNoOfArchivedLines, 'Page Billing Lines Archive is not filtered properly.');
+ BillingLinesArchive.OK().Invoke();
+ end;
}
\ No newline at end of file
diff --git a/Apps/W1/SubscriptionBilling/Test/Contract Price Update/ContractPriceProposalTest.Codeunit.al b/Apps/W1/SubscriptionBilling/Test/Contract Price Update/ContractPriceProposalTest.Codeunit.al
index 5ba7ec167c..8235c6d734 100644
--- a/Apps/W1/SubscriptionBilling/Test/Contract Price Update/ContractPriceProposalTest.Codeunit.al
+++ b/Apps/W1/SubscriptionBilling/Test/Contract Price Update/ContractPriceProposalTest.Codeunit.al
@@ -15,9 +15,41 @@ codeunit 139690 "Contract Price Proposal Test"
TestPermissions = Disabled;
Access = Internal;
+ var
+ Customer: Record Customer;
+ Customer2: Record Customer;
+ Vendor: Record Vendor;
+ Vendor2: Record Vendor;
+ Item: Record Item;
+ ServiceCommitmentTemplate: Record "Service Commitment Template";
+ ServiceCommitmentPackage: Record "Service Commitment Package";
+ ServiceCommPackageLine: Record "Service Comm. Package Line";
+ Currency: Record Currency;
+ TempContractPriceUpdateLine: Record "Contract Price Update Line" temporary;
+ PriceUpdateTemplateCustomer: Record "Price Update Template";
+ PriceUpdateTemplateVendor: Record "Price Update Template";
+ ContractPriceUpdateLine: Record "Contract Price Update Line";
+ BillingTemplate: Record "Billing Template";
+ BillingLine: Record "Billing Line";
+ ServiceObject: Record "Service Object";
+ ServiceCommitment: Record "Service Commitment";
+ ContractTestLibrary: Codeunit "Contract Test Library";
+ LibraryRandom: Codeunit "Library - Random";
+ LibraryERMCountryData: Codeunit "Library - ERM Country Data";
+ LibraryTestInitialize: Codeunit "Library - Test Initialize";
+ PriceUpdateManagement: Codeunit "Price Update Management";
+ Assert: Codeunit Assert;
+ LibrarySales: Codeunit "Library - Sales";
+ LibraryPurchase: Codeunit "Library - Purchase";
+ LibraryUtility: Codeunit "Library - Utility";
+ StrMenuHandlerStep: Integer;
+ IsInitialized: Boolean;
+
[Test]
procedure TestCreateContractPriceUpdateProposal()
begin
+ Initialize();
+
CreateContractPriceUpdateProposalForCustomerServiceCommitments("Price Update Method"::"Calculation Base by %", WorkDate(), '<12M>', '<1M>', LibraryRandom.RandDec(100, 2), '<12M>', '<12M>', '<12M>');
ContractPriceUpdateLine.SetRange("Price Update Template Code", PriceUpdateTemplateCustomer.Code);
Assert.RecordIsNotEmpty(ContractPriceUpdateLine);
@@ -27,6 +59,8 @@ codeunit 139690 "Contract Price Proposal Test"
[HandlerFunctions('StrMenuHandlerDeleteProposal')]
procedure TestDeleteContractPriceUpdateProposal()
begin
+ Initialize();
+
CreateContractPriceUpdateProposalForCustomerServiceCommitments("Price Update Method"::"Calculation Base by %", WorkDate(), '<12M>', '<1M>', LibraryRandom.RandDec(100, 2), '<12M>', '<12M>', '<12M>');
StrMenuHandlerStep := 1;
@@ -45,6 +79,8 @@ codeunit 139690 "Contract Price Proposal Test"
[Test]
procedure TestCreateContractPriceUpdateProposalCalculationBaseByPerc()
begin
+ Initialize();
+
CreateContractPriceUpdateProposalForCustomerServiceCommitments("Price Update Method"::"Calculation Base by %", WorkDate(), '<12M>', '<1M>', LibraryRandom.RandDec(100, 2), '<12M>', '<12M>', '<12M>');
ContractPriceUpdateLine.SetRange("Price Update Template Code", PriceUpdateTemplateCustomer.Code);
@@ -68,6 +104,8 @@ codeunit 139690 "Contract Price Proposal Test"
[Test]
procedure TestCreateContractPriceUpdateProposalPriceByPerc()
begin
+ Initialize();
+
CreateContractPriceUpdateProposalForCustomerServiceCommitments("Price Update Method"::"Price by %", WorkDate(), '<12M>', '<1M>', LibraryRandom.RandDec(100, 2), '<12M>', '<12M>', '<12M>');
Currency.InitRoundingPrecision();
ContractPriceUpdateLine.SetRange("Price Update Template Code", PriceUpdateTemplateCustomer.Code);
@@ -91,6 +129,8 @@ codeunit 139690 "Contract Price Proposal Test"
[Test]
procedure TestCreateContractPriceUpdateProposalRecentItemPrices()
begin
+ Initialize();
+
CreateContractPriceUpdateProposalForCustomerServiceCommitments("Price Update Method"::"Recent Item Prices", WorkDate(), '<12M>', '<1M>', 0, '<12M>', '<12M>', '<12M>');
ContractPriceUpdateLine.SetRange("Price Update Template Code", PriceUpdateTemplateCustomer.Code);
@@ -117,6 +157,8 @@ codeunit 139690 "Contract Price Proposal Test"
CustomerContract: Record "Customer Contract";
CustomerContract2: Record "Customer Contract";
begin
+ Initialize();
+
CreateCustomerContractPriceUpdateFromMultipleContracts(CustomerContract, CustomerContract2);
PriceUpdateManagement.InitTempTable(TempContractPriceUpdateLine, Enum::"Contract Billing Grouping"::None);
TempContractPriceUpdateLine.SetRange(Indent, 0);
@@ -151,6 +193,8 @@ codeunit 139690 "Contract Price Proposal Test"
VendorContract: Record "Vendor Contract";
VendorContract2: Record "Vendor Contract";
begin
+ Initialize();
+
CreateVendorContractPriceUpdateFromMultipleContracts(VendorContract, VendorContract2);
PriceUpdateManagement.InitTempTable(TempContractPriceUpdateLine, Enum::"Contract Billing Grouping"::None);
TempContractPriceUpdateLine.SetRange(Indent, 0);
@@ -189,6 +233,8 @@ codeunit 139690 "Contract Price Proposal Test"
TempContractPriceUpdateLine2: Record "Contract Price Update Line" temporary;
TempServiceCommitment: Record "Service Commitment" temporary;
begin
+ Initialize();
+
CreateContractPriceUpdateProposalForCustomerServiceCommitments("Price Update Method"::"Calculation Base by %", WorkDate(), '<12M>', '<12M>', LibraryRandom.RandDec(100, 2), '<1M>', '<1M>', '<1M>');
//Make sure that the service commitment is fully invoice until date of next price update
ContractTestLibrary.CreateCustomerContractAndCreateContractLines(CustomerContract, ServiceObject, ServiceObject."End-User Customer No.");
@@ -221,6 +267,8 @@ codeunit 139690 "Contract Price Proposal Test"
PlannedServiceCommitment: Record "Planned Service Commitment";
TempContractPriceUpdateLine2: Record "Contract Price Update Line" temporary;
begin
+ Initialize();
+
CreateContractPriceUpdateProposalForCustomerServiceCommitments("Price Update Method"::"Recent Item Prices", CalcDate('<1M>', WorkDate()), '<12M>', '<12M>', 0, '<12M>', '<24M>', '<12M>');
ContractPriceUpdateLine.SetRange("Price Update Template Code", PriceUpdateTemplateCustomer.Code);
@@ -242,6 +290,8 @@ codeunit 139690 "Contract Price Proposal Test"
[Test]
procedure TestIfContractPriceUpdateLinesAreDeletedAfterPerformPriceUpdate()
begin
+ Initialize();
+
CreateContractPriceUpdateProposalForCustomerServiceCommitments("Price Update Method"::"Recent Item Prices", CalcDate('<1M>', WorkDate()), '<12M>', '<12M>', 0, '<12M>', '<24M>', '<12M>');
PerformPriceUpdate();
@@ -258,6 +308,8 @@ codeunit 139690 "Contract Price Proposal Test"
CustomerContract: Record "Customer Contract";
SalesInvoiceHeader: Record "Sales Invoice Header";
begin
+ Initialize();
+
CreateContractPriceUpdateProposalForCustomerServiceCommitments("Price Update Method"::"Recent Item Prices", CalcDate('<1M>', WorkDate()), '<12M>', '<12M>', 0, '<12M>', '<24M>', '<12M>');
ContractPriceUpdateLine.Reset();
ContractPriceUpdateLine.FindLast();
@@ -289,6 +341,8 @@ codeunit 139690 "Contract Price Proposal Test"
PurchaseHeader: Record "Purchase Header";
PurchInvHeader: Record "Purch. Inv. Header";
begin
+ Initialize();
+
CreateContractPriceUpdateProposalForVendorServiceCommitments("Price Update Method"::"Recent Item Prices", CalcDate('<1M>', WorkDate()), 0, '<12M>', '<24M>', '<12M>');
ContractPriceUpdateLine.Reset();
ContractPriceUpdateLine.FindLast();
@@ -322,6 +376,8 @@ codeunit 139690 "Contract Price Proposal Test"
ServiceCommitmentArchive: Record "Service Commitment Archive";
CorrectPostedSalesInvoice: Codeunit "Correct Posted Sales Invoice";
begin
+ Initialize();
+
CreateContractPriceUpdateProposalForCustomerServiceCommitments("Price Update Method"::"Calculation Base by %", CalcDate('<1M>', WorkDate()), '<12M>', '<12M>', 50, '<12M>', '<24M>', '<12M>');
ContractPriceUpdateLine.Reset();
@@ -364,6 +420,8 @@ codeunit 139690 "Contract Price Proposal Test"
ServiceCommitmentArchive: Record "Service Commitment Archive";
CorrectPostedPurchInvoice: Codeunit "Correct Posted Purch. Invoice";
begin
+ Initialize();
+
CreateContractPriceUpdateProposalForVendorServiceCommitments("Price Update Method"::"Recent Item Prices", CalcDate('<1M>', WorkDate()), 0, '<12M>', '<24M>', '<12M>');
ContractPriceUpdateLine.Reset();
ContractPriceUpdateLine.FindLast();
@@ -398,6 +456,8 @@ codeunit 139690 "Contract Price Proposal Test"
[Test]
procedure TestIfServiceCommitmentWithoutNextPriceUpdateIsIncludedInContractPriceUpdateProposal()
begin
+ Initialize();
+
InitTest();
ContractTestLibrary.CreatePriceUpdateTemplate(PriceUpdateTemplateCustomer, "Service Partner"::Customer, Enum::"Price Update Method"::"Calculation Base by %", LibraryRandom.RandDec(100, 2), '<12M>', '<12M>', '<12M>');
ContractTestLibrary.CreateMultipleServiceObjectsWithItemSetup(Customer, ServiceObject, Item, 2);
@@ -419,29 +479,27 @@ codeunit 139690 "Contract Price Proposal Test"
Assert.RecordIsNotEmpty(ContractPriceUpdateLine);
end;
- local procedure CreateBillingDocuments()
+ local procedure Initialize()
begin
- BillingLine.SetRange("Billing Template Code", BillingTemplate.Code);
- BillingLine.SetRange(Partner, BillingTemplate.Partner);
- Codeunit.Run(Codeunit::"Create Billing Documents", BillingLine);
- Commit(); // retain data after asserterror
- end;
+ LibraryTestInitialize.OnTestInitialize(Codeunit::"Contract Price Proposal Test");
- [MessageHandler]
- procedure MessageHandler(Message: Text[1024])
- begin
- end;
+ if IsInitialized then
+ exit;
- [ModalPageHandler]
- procedure CreateCustomerBillingDocsContractPageHandler(var CreateCustomerBillingDocs: TestPage "Create Customer Billing Docs")
- begin
- CreateCustomerBillingDocs.OK().Invoke();
+ LibraryTestInitialize.OnBeforeTestSuiteInitialize(Codeunit::"Contract Price Proposal Test");
+ LibraryERMCountryData.UpdatePurchasesPayablesSetup();
+ LibraryERMCountryData.UpdateSalesReceivablesSetup();
+ LibraryERMCountryData.UpdateGeneralLedgerSetup();
+ LibraryERMCountryData.UpdateJournalTemplMandatory(false);
+ LibraryTestInitialize.OnAfterTestSuiteInitialize(Codeunit::"Contract Price Proposal Test");
end;
- [ModalPageHandler]
- procedure CreateVendorBillingDocsContractPageHandler(var CreateVendorBillingDocs: TestPage "Create Vendor Billing Docs")
+ local procedure CreateBillingDocuments()
begin
- CreateVendorBillingDocs.OK().Invoke();
+ BillingLine.SetRange("Billing Template Code", BillingTemplate.Code);
+ BillingLine.SetRange(Partner, BillingTemplate.Partner);
+ Codeunit.Run(Codeunit::"Create Billing Documents", BillingLine);
+ Commit(); // retain data after asserterror
end;
local procedure InitTest()
@@ -491,25 +549,6 @@ codeunit 139690 "Contract Price Proposal Test"
Item.Modify(false);
end;
- [ModalPageHandler]
- procedure ExchangeRateSelectionModalPageHandler(var ExchangeRateSelectionPage: TestPage "Exchange Rate Selection")
- begin
- ExchangeRateSelectionPage.OK().Invoke();
- end;
-
- [StrMenuHandler]
- procedure StrMenuHandlerDeleteProposal(Option: Text[1024]; var Choice: Integer; Instruction: Text[1024])
- begin
- case StrMenuHandlerStep of
- 1:
- Choice := 1;
- 2:
- Choice := 2;
- else
- Choice := 0;
- end;
- end;
-
local procedure TestIfArchivedServiceCommitmentIsCreated(TempServiceCommitment: Record "Service Commitment" temporary)
var
ServiceCommitmentArchive: Record "Service Commitment Archive";
@@ -596,30 +635,39 @@ codeunit 139690 "Contract Price Proposal Test"
Commit(); // Commit after processing
end;
- var
- Customer: Record Customer;
- Customer2: Record Customer;
- Vendor: Record Vendor;
- Vendor2: Record Vendor;
- Item: Record Item;
- ServiceCommitmentTemplate: Record "Service Commitment Template";
- ServiceCommitmentPackage: Record "Service Commitment Package";
- ServiceCommPackageLine: Record "Service Comm. Package Line";
- Currency: Record Currency;
- TempContractPriceUpdateLine: Record "Contract Price Update Line" temporary;
- PriceUpdateTemplateCustomer: Record "Price Update Template";
- PriceUpdateTemplateVendor: Record "Price Update Template";
- ContractPriceUpdateLine: Record "Contract Price Update Line";
- BillingTemplate: Record "Billing Template";
- BillingLine: Record "Billing Line";
- ServiceObject: Record "Service Object";
- ServiceCommitment: Record "Service Commitment";
- ContractTestLibrary: Codeunit "Contract Test Library";
- LibraryRandom: Codeunit "Library - Random";
- PriceUpdateManagement: Codeunit "Price Update Management";
- Assert: Codeunit Assert;
- LibrarySales: Codeunit "Library - Sales";
- LibraryPurchase: Codeunit "Library - Purchase";
- LibraryUtility: Codeunit "Library - Utility";
- StrMenuHandlerStep: Integer;
+ [MessageHandler]
+ procedure MessageHandler(Message: Text[1024])
+ begin
+ end;
+
+ [ModalPageHandler]
+ procedure CreateCustomerBillingDocsContractPageHandler(var CreateCustomerBillingDocs: TestPage "Create Customer Billing Docs")
+ begin
+ CreateCustomerBillingDocs.OK().Invoke();
+ end;
+
+ [ModalPageHandler]
+ procedure CreateVendorBillingDocsContractPageHandler(var CreateVendorBillingDocs: TestPage "Create Vendor Billing Docs")
+ begin
+ CreateVendorBillingDocs.OK().Invoke();
+ end;
+
+ [ModalPageHandler]
+ procedure ExchangeRateSelectionModalPageHandler(var ExchangeRateSelectionPage: TestPage "Exchange Rate Selection")
+ begin
+ ExchangeRateSelectionPage.OK().Invoke();
+ end;
+
+ [StrMenuHandler]
+ procedure StrMenuHandlerDeleteProposal(Option: Text[1024]; var Choice: Integer; Instruction: Text[1024])
+ begin
+ case StrMenuHandlerStep of
+ 1:
+ Choice := 1;
+ 2:
+ Choice := 2;
+ else
+ Choice := 0;
+ end;
+ end;
}
diff --git a/Apps/W1/SubscriptionBilling/Test/Customer Contracts/ContractsTest.Codeunit.al b/Apps/W1/SubscriptionBilling/Test/Customer Contracts/ContractsTest.Codeunit.al
index ce214cc470..edd8f8e878 100644
--- a/Apps/W1/SubscriptionBilling/Test/Customer Contracts/ContractsTest.Codeunit.al
+++ b/Apps/W1/SubscriptionBilling/Test/Customer Contracts/ContractsTest.Codeunit.al
@@ -1564,6 +1564,8 @@ codeunit 148155 "Contracts Test"
BillingBasePeriodArray: Array[4] of Text;
ExpectedResultArray: Array[4] of Decimal;
AmountArray: Array[4] of Decimal;
+ RoundedExpectedResult: Decimal;
+ RoundedResult: Decimal;
i: Integer;
begin
//[SCENARIO]: Try to create Contract Analysis Entry and test the values
@@ -1597,14 +1599,20 @@ codeunit 148155 "Contracts Test"
Report.Run(Report::"Create Contract Analysis");
//THEN
+ Currency.InitRoundingPrecision();
ContractAnalysisEntry.SetRange("Service Object No.", ServiceObject."No.");
AssertThat.RecordIsNotEmpty(ContractAnalysisEntry);
- if ContractAnalysisEntry.FindFirst() then
- for i := 1 to 4 do begin
- ContractAnalysisEntry.TestField("Monthly Recurr. Revenue (LCY)", ExpectedResultArray[i] * (CalcDate('', ContractAnalysisEntry."Analysis Date") - CalcDate('<-CM>', ContractAnalysisEntry."Analysis Date")));
- ContractAnalysisEntry.TestField("Monthly Recurring Cost (LCY)", ExpectedResultArray[i] * (CalcDate('', ContractAnalysisEntry."Analysis Date") - CalcDate('<-CM>', ContractAnalysisEntry."Analysis Date")));
- ContractAnalysisEntry.Next();
- end;
+ ContractAnalysisEntry.FindFirst();
+ for i := 1 to 4 do begin
+ RoundedResult := Round(ContractAnalysisEntry."Monthly Recurr. Revenue (LCY)", Currency."Amount Rounding Precision");
+ RoundedExpectedResult := Round(ExpectedResultArray[i] * (CalcDate('', ContractAnalysisEntry."Analysis Date") - CalcDate('<-CM>', ContractAnalysisEntry."Analysis Date")), Currency."Amount Rounding Precision");
+ AssertThat.AreEqual(RoundedExpectedResult, RoundedResult, 'Monthly Recurr. Revenue (LCY) was not calculated correctly');
+
+ RoundedResult := Round(ContractAnalysisEntry."Monthly Recurring Cost (LCY)", Currency."Amount Rounding Precision");
+ RoundedExpectedResult := Round(ExpectedResultArray[i] * (CalcDate('', ContractAnalysisEntry."Analysis Date") - CalcDate('<-CM>', ContractAnalysisEntry."Analysis Date")), Currency."Amount Rounding Precision");
+ AssertThat.AreEqual(RoundedExpectedResult, RoundedResult, 'Monthly Recurring Cost (LCY) was not calculated correctly');
+ ContractAnalysisEntry.Next();
+ end;
// Test Vendor Service Commitment in Contract Analysis Entry
ContractAnalysisEntry.TestField("Monthly Recurr. Revenue (LCY)", 0);
ContractAnalysisEntry.TestField("Monthly Recurring Cost (LCY)", ExpectedResultArray[i] * (CalcDate('', ContractAnalysisEntry."Analysis Date") - CalcDate('<-CM>', ContractAnalysisEntry."Analysis Date")));
diff --git a/Apps/W1/SubscriptionBilling/Test/Service Commitments/ServiceCommDimensions.Codeunit.al b/Apps/W1/SubscriptionBilling/Test/Service Commitments/ServiceCommDimensions.Codeunit.al
index 8b9f7ed555..263ad8247a 100644
--- a/Apps/W1/SubscriptionBilling/Test/Service Commitments/ServiceCommDimensions.Codeunit.al
+++ b/Apps/W1/SubscriptionBilling/Test/Service Commitments/ServiceCommDimensions.Codeunit.al
@@ -9,7 +9,7 @@ using Microsoft.Projects.Project.Job;
using Microsoft.Finance.GeneralLedger.Setup;
using Microsoft.Finance.Dimension;
-codeunit 139882 "Service Comm. Dimensions"
+codeunit 148160 "Service Comm. Dimensions"
{
Subtype = Test;
TestPermissions = Disabled;
diff --git a/Apps/W1/SubscriptionBilling/Test/Service Commitments/ServiceCommitmentTest.Codeunit.al b/Apps/W1/SubscriptionBilling/Test/Service Commitments/ServiceCommitmentTest.Codeunit.al
index 361079bf39..fbe3b63cb7 100644
--- a/Apps/W1/SubscriptionBilling/Test/Service Commitments/ServiceCommitmentTest.Codeunit.al
+++ b/Apps/W1/SubscriptionBilling/Test/Service Commitments/ServiceCommitmentTest.Codeunit.al
@@ -2,7 +2,7 @@ namespace Microsoft.SubscriptionBilling;
using Microsoft.Inventory.Item;
-codeunit 139883 "Service Commitment Test"
+codeunit 148156 "Service Commitment Test"
{
Subtype = Test;
Access = Internal;
diff --git a/Apps/W1/SubscriptionBilling/Test/UBB/LinkSubscriptionToSOTest.Codeunit.al b/Apps/W1/SubscriptionBilling/Test/UBB/LinkSubscriptionToSOTest.Codeunit.al
index f48f4d8991..a38a5cd5e2 100644
--- a/Apps/W1/SubscriptionBilling/Test/UBB/LinkSubscriptionToSOTest.Codeunit.al
+++ b/Apps/W1/SubscriptionBilling/Test/UBB/LinkSubscriptionToSOTest.Codeunit.al
@@ -4,7 +4,7 @@ using System.IO;
using Microsoft.Inventory.Item;
using Microsoft.Sales.Customer;
-codeunit 139890 "Link Subscription To SO Test"
+codeunit 148158 "Link Subscription To SO Test"
{
Subtype = Test;
TestPermissions = Disabled;
diff --git a/Apps/W1/SubscriptionBilling/Test/UBB/UsageBasedExtendContrTest.Codeunit.al b/Apps/W1/SubscriptionBilling/Test/UBB/UsageBasedExtendContrTest.Codeunit.al
index 4e40a0e3f0..017312f3cc 100644
--- a/Apps/W1/SubscriptionBilling/Test/UBB/UsageBasedExtendContrTest.Codeunit.al
+++ b/Apps/W1/SubscriptionBilling/Test/UBB/UsageBasedExtendContrTest.Codeunit.al
@@ -5,7 +5,7 @@ using Microsoft.Inventory.Item;
using Microsoft.Sales.Customer;
using Microsoft.Purchases.Vendor;
-codeunit 139894 "Usage Based Extend Contr. Test"
+codeunit 148159 "Usage Based Extend Contr. Test"
{
Subtype = Test;
TestPermissions = Disabled;
diff --git a/Apps/W1/Sustainability/app/src/Posting/SustainabilityJnlCheck.Codeunit.al b/Apps/W1/Sustainability/app/src/Posting/SustainabilityJnlCheck.Codeunit.al
index d77dccbe45..a97343534d 100644
--- a/Apps/W1/Sustainability/app/src/Posting/SustainabilityJnlCheck.Codeunit.al
+++ b/Apps/W1/Sustainability/app/src/Posting/SustainabilityJnlCheck.Codeunit.al
@@ -81,7 +81,7 @@ codeunit 6216 "Sustainability Jnl.-Check"
SustainabilityCalcMgt: Codeunit "Sustainability Calc. Mgt.";
EmissionCO2, EmissionCH4, EmissionN2O : Decimal;
begin
- if (SustainabilityJnlLine."Emission CO2" = 0) and (SustainabilityJnlLine."Emission CH4" = 0) and (SustainabilityJnlLine."Emission N2O" = 0) then
+ if AllEmissionsZeroCheck(SustainabilityJnlLine) then
Error(ErrorInfo.Create(AllEmissionsZeroErr, true, SustainabilityJnlLine));
EmissionCO2 := SustainabilityJnlLine."Emission CO2";
@@ -94,6 +94,25 @@ codeunit 6216 "Sustainability Jnl.-Check"
Error(ErrorInfo.Create(EmissionCalculationErr, true, SustainabilityJnlLine));
end;
+ local procedure AllEmissionsZeroCheck(SustainabilityJnlLine: Record "Sustainability Jnl. Line"): Boolean
+ begin
+ if IsRenewableEnergyCheck(SustainabilityJnlLine) then
+ exit(false);
+
+ if (SustainabilityJnlLine."Emission CO2" = 0) and (SustainabilityJnlLine."Emission CH4" = 0) and (SustainabilityJnlLine."Emission N2O" = 0) then
+ exit(true);
+
+ exit(false);
+ end;
+
+ local procedure IsRenewableEnergyCheck(SustainabilityJnlLine: Record "Sustainability Jnl. Line"): Boolean
+ var
+ SustainAccountSubcategory: Record "Sustain. Account Subcategory";
+ begin
+ if SustainAccountSubcategory.Get(SustainabilityJnlLine."Account Category", SustainabilityJnlLine."Account Subcategory") then
+ exit(SustainAccountSubcategory."Renewable Energy");
+ end;
+
local procedure TestRequiredFieldsFromSetupForJnlLine(SustainabilityJnlLine: Record "Sustainability Jnl. Line")
var
SustainabilitySetup: Record "Sustainability Setup";
diff --git a/Apps/W1/Sustainability/test/src/SustainabilityPostingTest.Codeunit.al b/Apps/W1/Sustainability/test/src/SustainabilityPostingTest.Codeunit.al
index e610f6e570..e8772d4f8a 100644
--- a/Apps/W1/Sustainability/test/src/SustainabilityPostingTest.Codeunit.al
+++ b/Apps/W1/Sustainability/test/src/SustainabilityPostingTest.Codeunit.al
@@ -1977,6 +1977,62 @@ codeunit 148184 "Sustainability Posting Test"
StrSubstNo(ValueMustBeEqualErr, SustainabilityLedgerEntry.FieldCaption("Carbon Fee"), ExpectedCarbonFee, SustainabilityLedgerEntry.TableCaption()));
end;
+ [Test]
+ [HandlerFunctions('ConfirmHandler,MessageHandler')]
+ procedure TestSustainabilityJournalPostedWithZeroEmissionWhenRenewableEnergyEnabled()
+ var
+ SustainabilityJnlBatch: Record "Sustainability Jnl. Batch";
+ NoSeries: Record "No. Series";
+ SustainabilityAccount: Record "Sustainability Account";
+ SustainAccountSubcategory: Record "Sustain. Account Subcategory";
+ SustainabilityJournalLine: Record "Sustainability Jnl. Line";
+ SustainabilityLedgerEntry: Record "Sustainability Ledger Entry";
+ SustainabilityJournalMgt: Codeunit "Sustainability Journal Mgt.";
+ SustainabilityJournal: TestPage "Sustainability Journal";
+ begin
+ // [SCENARIO 541991] Impossible to post an emission records in the Sustainability Ledger Entry with Emissions that are equal to zero even with the flag "Renewable Energy" set to true
+ LibrarySustainability.CleanUpBeforeTesting();
+
+ // [GIVEN] A Sustainability Journal Batch and update No. Series so Manual No. allowed while posting the Sustainability Journal
+ SustainabilityJnlBatch := SustainabilityJournalMgt.GetASustainabilityJournalBatch(false);
+ NoSeries.Get(SustainabilityJnlBatch."No Series");
+ NoSeries.Validate("Manual Nos.", true);
+ NoSeries.Modify(true);
+
+ // [GIVEN] Create a Sustainability Account that's ready to Post
+ SustainabilityAccount := GetAReadyToPostSustainabilityAccount(
+ Enum::"Emission Scope"::"Scope 2",
+ Enum::"Calculation Foundation"::"Fuel/Electricity",
+ true, false, false, '', false, 0, 0, 0, true);
+
+ // [GIVEN] A Sustainability Journal Line is created and all fields are filled out
+ SustainabilityJournalLine := LibrarySustainability.InsertSustainabilityJournalLine(SustainabilityJnlBatch, SustainabilityAccount, 1000);
+ SustainabilityJournalLine."Unit of Measure" := 'kg';
+ SustainabilityJournalLine.Validate("Fuel/Electricity", 123);
+ SustainabilityJournalLine.Modify(true);
+
+ // [WHEN] Post Sustainability Journal without any Error
+ SustainabilityJournal.OpenEdit();
+ SustainabilityJournal.GoToRecord(SustainabilityJournalLine);
+ SustainabilityJournal.Post.Invoke();
+
+ // [THEN] Verify Renewable Energy is true and Emissions are zero on posted Sustainability Ledger Entry
+ SustainabilityLedgerEntry.FindFirst();
+ SustainAccountSubcategory.Get(SustainabilityAccount.Category, SustainabilityAccount.Subcategory);
+ Assert.AreEqual(
+ SustainAccountSubcategory."Renewable Energy", SustainabilityLedgerEntry."Renewable Energy",
+ StrSubstNo(InformationTakenToLedgerEntryLbl, SustainabilityLedgerEntry.FieldCaption("Renewable Energy"), SustainAccountSubcategory.TableCaption()));
+ Assert.AreEqual(
+ SustainAccountSubcategory."Emission Factor CO2", SustainabilityLedgerEntry."Emission Factor CO2",
+ StrSubstNo(InformationTakenToLedgerEntryLbl, SustainabilityLedgerEntry.FieldCaption("Emission Factor CO2"), SustainAccountSubcategory.TableCaption()));
+ Assert.AreEqual(
+ SustainAccountSubcategory."Emission Factor CH4", SustainabilityLedgerEntry."Emission Factor CH4",
+ StrSubstNo(InformationTakenToLedgerEntryLbl, SustainabilityLedgerEntry.FieldCaption("Emission Factor CH4"), SustainAccountSubcategory.TableCaption()));
+ Assert.AreEqual(
+ SustainAccountSubcategory."Emission Factor N2O", SustainabilityLedgerEntry."Emission Factor N2O",
+ StrSubstNo(InformationTakenToLedgerEntryLbl, SustainabilityLedgerEntry.FieldCaption("Emission Factor N2O"), SustainAccountSubcategory.TableCaption()));
+ end;
+
local procedure CreateUserSetup(var UserSetup: Record "User Setup"; UserID: Code[50])
begin
UserSetup.Init();
@@ -2181,6 +2237,24 @@ codeunit 148184 "Sustainability Posting Test"
exit(true);
end;
+ procedure GetAReadyToPostSustainabilityAccount(
+ Scope: Enum "Emission Scope";
+ CalcFoundation: Enum "Calculation Foundation";
+ CO2: Boolean; CH4: Boolean; N2O: Boolean;
+ CustomValue: Text[100]; CalcFromGL: Boolean;
+ EFCO2: Decimal; EFCH4: Decimal; EFN2O: Decimal; RenewableEnergy: Boolean) Account: Record "Sustainability Account"
+ var
+ CategoryTok, SubcategoryTok, AccountTok : Code[20];
+ begin
+ CategoryTok := LibraryRandom.RandText(20);
+ SubcategoryTok := LibraryRandom.RandText(20);
+ AccountTok := Format(LibraryRandom.RandIntInRange(10000, 20000));
+ LibrarySustainability.InsertAccountCategory(CategoryTok, '', Scope, CalcFoundation, CO2, CH4, N2O, CustomValue, CalcFromGL);
+ LibrarySustainability.InsertAccountSubcategory(CategoryTok, SubcategoryTok, '', EFCO2, EFCH4, EFN2O, RenewableEnergy);
+ Account := LibrarySustainability.InsertSustainabilityAccount(
+ AccountTok, LibraryRandom.RandText(20), CategoryTok, SubcategoryTok, Enum::"Sustainability Account Type"::Posting, '', true);
+ end;
+
[ModalPageHandler]
[Scope('OnPrem')]
procedure PurchaseOrderStatisticsPageHandler(var PurchaseOrderStatisticsPage: TestPage "Purchase Order Statistics")
diff --git a/Apps/W1/TransactionStorage/app/src/TransStorageErrorHandler.Codeunit.al b/Apps/W1/TransactionStorage/app/src/TransStorageErrorHandler.Codeunit.al
index 1f68ee223d..2bae4c43f1 100644
--- a/Apps/W1/TransactionStorage/app/src/TransStorageErrorHandler.Codeunit.al
+++ b/Apps/W1/TransactionStorage/app/src/TransStorageErrorHandler.Codeunit.al
@@ -1,6 +1,7 @@
namespace System.DataAdministration;
using System.Telemetry;
+using System.IO;
codeunit 6204 "Trans. Storage Error Handler"
{
@@ -13,30 +14,45 @@ codeunit 6204 "Trans. Storage Error Handler"
tabledata "Trans. Storage Export Data" = RD;
var
+ FeatureTelemetry: Codeunit "Feature Telemetry";
TransactionStorageTok: Label 'Transaction Storage', Locked = true;
TaskFailedErr: Label 'Export task failed', Locked = true;
TaskFailedMultipleTimesErr: Label 'Export task failed 4 times', Locked = true;
TaskFailedMultipleDaysErr: Label 'Export task failed %1 days in a row', Locked = true;
+ TaskTimedOutErr: Label 'Task will not be rescheduled because it timed out. Time deadline: %1 hours. Task time: %2 hours.', Comment = '%1, %2 - number of hours', Locked = true;
trigger OnRun()
var
TransactStorageExportState: Record "Transact. Storage Export State";
TransStorageExportData: Record "Trans. Storage Export Data";
TransStorageScheduleTask: Codeunit "Trans. Storage Schedule Task";
- FeatureTelemetry: Codeunit "Feature Telemetry";
+ TransactStorageExport: Codeunit "Transact. Storage Export";
+ TranslationHelper: Codeunit "Translation Helper";
+ TaskRunTimeHours: Decimal;
+ MaxExpectedRunTimeHours: Integer;
ExportDateTime: DateTime;
ErrorText: Text;
begin
+ TranslationHelper.SetGlobalLanguageToDefault();
ErrorText := GetLastErrorText();
+ TranslationHelper.RestoreGlobalLanguage();
FeatureTelemetry.LogError('0000LK2', TransactionStorageTok, TaskFailedErr, ErrorText);
Rec.SetStatusFailed(ErrorText, GetLastErrorCallStack());
+ // do not reschedule task if it already failed 4 times
TransactStorageExportState.Get();
if TransactStorageExportState."Number Of Attempts" = 0 then begin
FeatureTelemetry.LogError('0000LNA', TransactionStorageTok, '', TaskFailedMultipleTimesErr);
CheckMultipleTaskFailures();
exit;
end;
+
+ // do not schedule new task if current task timed out
+ if TransactStorageExport.IsTaskTimedOut(Rec."Starting Date/Time", TaskRunTimeHours, MaxExpectedRunTimeHours) then begin
+ TransactStorageExport.LogWarning('0000NU8', StrSubstNo(TaskTimedOutErr, MaxExpectedRunTimeHours, TaskRunTimeHours));
+ exit;
+ end;
+
ExportDateTime := CurrentDateTime() + Random(3) * 5 * 60 * 1000; // 5 - 15 minutes
TransStorageScheduleTask.CreateTaskToExport(ExportDateTime, false);
TransactStorageExportState."Number Of Attempts" -= 1;
@@ -47,7 +63,6 @@ codeunit 6204 "Trans. Storage Error Handler"
local procedure CheckMultipleTaskFailures()
var
TransactStorageTaskEntry: Record "Transact. Storage Task Entry";
- FeatureTelemetry: Codeunit "Feature Telemetry";
MaxNumberFailureDays: Integer;
begin
MaxNumberFailureDays := 7;
diff --git a/Apps/W1/TransactionStorage/app/src/TransactStorageExport.Codeunit.al b/Apps/W1/TransactionStorage/app/src/TransactStorageExport.Codeunit.al
index 99e7605c5d..cc0017a352 100644
--- a/Apps/W1/TransactionStorage/app/src/TransactStorageExport.Codeunit.al
+++ b/Apps/W1/TransactionStorage/app/src/TransactStorageExport.Codeunit.al
@@ -23,7 +23,7 @@ codeunit 6203 "Transact. Storage Export"
TransactionStorageTok: Label 'Transaction Storage', Locked = true;
ExportStartedTxt: Label 'Export started', Locked = true;
ExportEndedTxt: Label 'Export ended', Locked = true;
- TimeDeadlineExceededErr: Label 'Export task timed out. Time deadline: %1 hours. Task time: %2 hours.', Comment = '%1, %2 - number of hours', Locked = true;
+ TaskTimedOutErr: Label 'Export task timed out. Time deadline: %1 hours. Task time: %2 hours.', Comment = '%1, %2 - number of hours', Locked = true;
trigger OnRun()
var
@@ -40,19 +40,25 @@ codeunit 6203 "Transact. Storage Export"
FeatureTelemetry.LogUsage('0000LK4', TransactionStorageTok, ExportEndedTxt);
end;
- procedure CheckTimeDeadline(TaskStartingDateTime: DateTime)
+ procedure IsTaskTimedOut(TaskStartingDateTime: DateTime; var TaskRunTimeHours: Decimal; var MaxExpectedRunTimeHours: Integer): Boolean
var
TransactionStorageSetup: Record "Transaction Storage Setup";
- TaskTimeHours: Decimal;
begin
if not TransactionStorageSetup.Get() then
TransactionStorageSetup.Insert(true);
- if (CurrentDateTime() - TaskStartingDateTime) >= (TransactionStorageSetup."Max. Number of Hours" * 60 * 60 * 1000) then begin
- TaskTimeHours := Round((CurrentDateTime() - TaskStartingDateTime) / (60 * 60 * 1000), 0.1);
- FeatureTelemetry.LogError(
- '0000LNB', TransactionStorageTok, '', StrSubstNo(TimeDeadlineExceededErr, TransactionStorageSetup."Max. Number of Hours", TaskTimeHours));
- Error('');
- end;
+ MaxExpectedRunTimeHours := TransactionStorageSetup."Max. Number of Hours";
+ TaskRunTimeHours := Round((CurrentDateTime() - TaskStartingDateTime) / (60 * 60 * 1000), 0.1);
+
+ exit(TaskRunTimeHours > MaxExpectedRunTimeHours);
+ end;
+
+ procedure CheckTaskTimedOut(TaskStartingDateTime: DateTime)
+ var
+ TaskRunTimeHours: Decimal;
+ MaxExpectedRunTimeHours: Integer;
+ begin
+ if IsTaskTimedOut(TaskStartingDateTime, TaskRunTimeHours, MaxExpectedRunTimeHours) then
+ LogWarning('0000LNB', StrSubstNo(TaskTimedOutErr, MaxExpectedRunTimeHours, TaskRunTimeHours));
end;
procedure GetRecordExportData(var TransactStorageTableEntry: Record "Transact. Storage Table Entry"; var RecRef: RecordRef)
@@ -145,4 +151,19 @@ codeunit 6203 "Transact. Storage Export"
ContainerName := TransactionStorageABS.GetContainerName();
TransactionStorageABS.VerifyContainerNameLength(ContainerName);
end;
+
+ procedure LogWarning(EventId: Text; WarningText: Text)
+ var
+ Telemetry: Codeunit Telemetry;
+ begin
+ Telemetry.LogMessage(EventId, WarningText, Verbosity::Warning, DataClassification::SystemMetadata);
+ end;
+
+ procedure LogWarning(EventId: Text; WarningText: Text; CustomDimensions: Dictionary of [Text, Text])
+ var
+ Telemetry: Codeunit Telemetry;
+ begin
+ Telemetry.LogMessage(
+ EventId, WarningText, Verbosity::Warning, DataClassification::SystemMetadata, TelemetryScope::ExtensionPublisher, CustomDimensions);
+ end;
}
\ No newline at end of file
diff --git a/Apps/W1/TransactionStorage/app/src/TransactStorageExportData.Codeunit.al b/Apps/W1/TransactionStorage/app/src/TransactStorageExportData.Codeunit.al
index a933f8489e..7368358f20 100644
--- a/Apps/W1/TransactionStorage/app/src/TransactStorageExportData.Codeunit.al
+++ b/Apps/W1/TransactionStorage/app/src/TransactStorageExportData.Codeunit.al
@@ -24,6 +24,7 @@ using Microsoft.Sales.Reminder;
using Microsoft.Service.History;
using System.Reflection;
using System.Telemetry;
+using System.IO;
codeunit 6202 "Transact. Storage Export Data"
{
@@ -75,6 +76,7 @@ codeunit 6202 "Transact. Storage Export Data"
FeatureTelemetry: Codeunit "Feature Telemetry";
TransactStorageExport: Codeunit "Transact. Storage Export";
TransactionStorageTok: Label 'Transaction Storage', Locked = true;
+ NoOfRecordsToCollectTxt: Label 'Number of records to collect', Locked = true;
NoOfCollectedRecordTxt: Label 'Number of collected records', Locked = true;
NoOfCollectedPartsTxt: Label 'Parts', Locked = true;
DocumentNoFieldNameTxt: Label 'Document No.', Locked = true;
@@ -95,15 +97,17 @@ codeunit 6202 "Transact. Storage Export Data"
TransStorageExportData.DeleteAll(true);
TablesToExport := GetTablesToExport();
FilterRecToDateTime := GetFilterRecToDateTime(TablesToExport, TaskStartingDateTime);
+ LogNumberOfRecordsToCollect(TablesToExport, FilterRecToDateTime);
foreach TableID in TablesToExport do
- CollectDataFromTable(HandledIncomingDocs, TempFieldList, MasterData, TaskStartingDateTime, FilterRecToDateTime, TableID);
+ CollectDataFromTable(HandledIncomingDocs, TempFieldList, MasterData, FilterRecToDateTime, TableID);
+ TransactStorageExport.CheckTaskTimedOut(TaskStartingDateTime);
LogNumberOfCollectedRecords(TablesToExport);
CollectMasterData(MasterData);
if (not TransStorageExportData.IsEmpty()) or (HandledIncomingDocs.Count() <> 0) then
TransactionStorageABS.ArchiveTransactionsToABS(HandledIncomingDocs);
end;
- local procedure CollectDataFromTable(var HandledIncomingDocs: Dictionary of [Text, Integer]; var TempFieldList: Record Field temporary; var MasterData: Dictionary of [Integer, List of [Code[50]]]; TaskStartingDateTime: DateTime; FilterRecordTo: DateTime; TableID: Integer)
+ local procedure CollectDataFromTable(var HandledIncomingDocs: Dictionary of [Text, Integer]; var TempFieldList: Record Field temporary; var MasterData: Dictionary of [Integer, List of [Code[50]]]; FilterRecordTo: DateTime; TableID: Integer)
var
TransactStorageTableEntry: Record "Transact. Storage Table Entry";
RecRef: RecordRef;
@@ -137,8 +141,7 @@ codeunit 6202 "Transact. Storage Export Data"
AddJsonArrayToTransStorageExportData(Part, TableJsonArray, RecordsHandled, 0, RecRef.Number());
end else
TransactStorageExport.SetTableEntryProcessed(TransactStorageTableEntry, TransactStorageTableEntry."Filter Record To DT", false, '');
- TransactStorageExport.CheckTimeDeadline(TaskStartingDateTime);
- TransactStorageTableEntry."Record Filters" := CopyStr(RecRef.GetFilters(), 1, MaxStrLen(TransactStorageTableEntry."Record Filters"));
+ TransactStorageTableEntry."Record Filters" := CopyStr(GetRecordFilters(RecRef), 1, MaxStrLen(TransactStorageTableEntry."Record Filters"));
TransactStorageTableEntry.Modify();
RecRef.Close();
end;
@@ -212,6 +215,15 @@ codeunit 6202 "Transact. Storage Export Data"
TransactStorageTableEntry."Filter Record To DT" := FilterRecTo;
end;
+ local procedure GetRecordFilters(var RecRef: RecordRef) Filters: Text
+ var
+ TranslationHelper: Codeunit "Translation Helper";
+ begin
+ TranslationHelper.SetGlobalLanguageToDefault();
+ Filters := RecRef.GetFilters();
+ TranslationHelper.RestoreGlobalLanguage();
+ end;
+
local procedure GetFilterRecToDateTime(TablesToExport: List of [Integer]; TaskStartingDateTime: DateTime): DateTime
var
RecRef: RecordRef;
@@ -242,6 +254,7 @@ codeunit 6202 "Transact. Storage Export Data"
FilterRecToDate: Date;
FilterRecToTime: Time;
MaxExportPeriodDays: Integer;
+ RecordCount: Integer;
MaxRecordCount: Integer;
CustomDimensions: Dictionary of [Text, Text];
begin
@@ -258,7 +271,7 @@ codeunit 6202 "Transact. Storage Export Data"
MaxRecordCount := GetMaxRecordCount();
SystemModifiedAtFieldRef := RecRef.Field(RecRef.SystemModifiedAtNo());
SystemModifiedAtFieldRef.SetRange(FilterRecFrom, FilterRecTo);
- if RecRef.Count() < MaxRecordCount then
+ if RecRef.CountApprox() < MaxRecordCount then
exit;
// limit the export period to 10 days
@@ -274,18 +287,22 @@ codeunit 6202 "Transact. Storage Export Data"
SystemModifiedAtFieldRef.SetRange(FilterRecFrom, FilterRecTo);
FilterRecToDate -= 1;
until (RecRef.CountApprox() < MaxRecordCount) or (FilterRecToDate - FilterRecFromDate < 1);
+ if RecRef.CountApprox() < MaxRecordCount then
+ exit;
// limit the number of records to export using Entry No. field
- if RecRef.Count() > MaxRecordCount then begin
- CalcFilterRecToDateTimeByEntryNo(RecRef, FilterRecFrom, FilterRecTo);
+ CalcFilterRecToDateTimeByEntryNo(RecRef, FilterRecFrom, FilterRecTo);
+ // log warning if after all the limitations the number of records to export still exceeds the limit
+ RecordCount := RecRef.Count();
+ if RecordCount > MaxRecordCount then begin
SystemModifiedAtFieldRef.SetRange(FilterRecFrom, FilterRecTo);
CustomDimensions.Add('TableName', RecRef.Name);
- CustomDimensions.Add('RecordCount', Format(RecRef.Count()));
+ CustomDimensions.Add('RecordCount', Format(RecordCount));
CustomDimensions.Add('MaxRecordCount', Format(MaxRecordCount));
CustomDimensions.Add('FilterRecFrom', Format(FilterRecFrom));
CustomDimensions.Add('FilterRecordTo', Format(FilterRecTo));
- FeatureTelemetry.LogError('0000NBO', TransactionStorageTok, '', ExportRecCountExceedsLimitErr, '', CustomDimensions);
+ TransactStorageExport.LogWarning('0000NBO', ExportRecCountExceedsLimitErr, CustomDimensions);
end;
end;
@@ -377,19 +394,69 @@ codeunit 6202 "Transact. Storage Export Data"
UpdateTempFieldList(TempFieldList, TableID, FieldID);
end;
+ local procedure LogNumberOfRecordsToCollect(TablesToExport: List of [Integer]; FilterRecTo: DateTime)
+ var
+ TransactStorageTableEntry: Record "Transact. Storage Table Entry";
+ TableMetadata: Record "Table Metadata";
+ RecRef: RecordRef;
+ SystemModifiedAtFieldRef: FieldRef;
+ TableID: Integer;
+ FilterRecFrom: DateTime;
+ RecordCountApprox: Integer;
+ CustomDimensions: Dictionary of [Text, Text];
+ RecordLogJson: JsonObject;
+ RecordLogTxt: Text;
+ begin
+ foreach TableID in TablesToExport do begin
+ RecRef.Open(TableID);
+ if RecRef.ReadPermission() then begin
+ TransactStorageExport.GetRecordExportData(TransactStorageTableEntry, RecRef);
+ FilterRecFrom := TransactStorageTableEntry."Last Handled Date/Time" + 10;
+ SystemModifiedAtFieldRef := RecRef.Field(RecRef.SystemModifiedAtNo());
+ SystemModifiedAtFieldRef.SetRange(FilterRecFrom, FilterRecTo);
+ RecordCountApprox := RecRef.CountApprox();
+ end;
+ RecRef.Close();
+
+ TableMetadata.Get(TableID);
+ Clear(RecordLogJson);
+ RecordLogJson.Add('CountApprox', RecordCountApprox);
+ RecordLogJson.Add('FilterFrom', FormatDateTimeForLog(FilterRecFrom));
+ RecordLogJson.Add('FilterTo', FormatDateTimeForLog(FilterRecTo));
+ RecordLogJson.WriteTo(RecordLogTxt);
+ CustomDimensions.Add(TableMetadata.Name, RecordLogTxt);
+ end;
+ FeatureTelemetry.LogUsage('0000NU9', TransactionStorageTok, NoOfRecordsToCollectTxt, CustomDimensions);
+ end;
+
+ local procedure FormatDateTimeForLog(InputValue: DateTime): Text
+ begin
+ exit(Format(InputValue, 0, '-- ::'));
+ end;
+
local procedure LogNumberOfCollectedRecords(TablesToExport: List of [Integer])
var
TransStorageExportData: Record "Trans. Storage Export Data";
+ TransactStorageTableEntry: Record "Transact. Storage Table Entry";
TableMetadata: Record "Table Metadata";
RecordsCustomDimensions: Dictionary of [Text, Text];
PartsCustomDimensions: Dictionary of [Text, Text];
TableID: Integer;
+ RecordLogJson: JsonObject;
+ RecordLogTxt: Text;
begin
foreach TableID in TablesToExport do begin
TableMetadata.Get(TableID);
TransStorageExportData.SetRange("Table ID", TableID);
TransStorageExportData.CalcSums("Record Count");
- RecordsCustomDimensions.Add(TableMetadata.Name, Format(TransStorageExportData."Record Count"));
+
+ Clear(RecordLogJson);
+ RecordLogJson.Add('Count', Format(TransStorageExportData."Record Count"));
+ if TransactStorageTableEntry.Get(TableID) then
+ RecordLogJson.Add('Filters', TransactStorageTableEntry."Record Filters");
+ RecordLogJson.WriteTo(RecordLogTxt);
+
+ RecordsCustomDimensions.Add(TableMetadata.Name, RecordLogTxt);
PartsCustomDimensions.Add(TableMetadata.Name, Format(TransStorageExportData.Count()));
end;
FeatureTelemetry.LogUsage('0000LK7', TransactionStorageTok, NoOfCollectedRecordTxt, RecordsCustomDimensions);
diff --git a/Apps/W1/TransactionStorage/app/src/TransactionStorageABS.Codeunit.al b/Apps/W1/TransactionStorage/app/src/TransactionStorageABS.Codeunit.al
index 891e45164d..d54088af02 100644
--- a/Apps/W1/TransactionStorage/app/src/TransactionStorageABS.Codeunit.al
+++ b/Apps/W1/TransactionStorage/app/src/TransactionStorageABS.Codeunit.al
@@ -154,6 +154,7 @@ codeunit 6205 "Transaction Storage ABS"
local procedure WriteIncomingDocumentsToABS(IncomingDocs: Dictionary of [Text, Integer]; AzureFunctionsAuth: Interface "Azure Functions Authentication"; CurrentDate: Date; var ExportLog: JsonObject)
var
IncomingDocAttachment: Record "Incoming Document Attachment";
+ TransactStorageExport: Codeunit "Transact. Storage Export";
AzureFunctionsResponse: Codeunit "Azure Functions Response";
TempBlob: Codeunit "Temp Blob";
IncomingDocKey: Text;
@@ -202,7 +203,7 @@ codeunit 6205 "Transaction Storage ABS"
end;
ExportLog.Add(IncomingDocAttachment.TableName, ExportedDocCount);
if LargeFileCount > 0 then
- FeatureTelemetry.LogError('0000M7H', TransactionStorageTok, '', StrSubstNo(LargeFileFoundErr, LargeFileCount));
+ TransactStorageExport.LogWarning('0000M7H', StrSubstNo(LargeFileFoundErr, LargeFileCount));
CustomDimensions.Add(CollectedDocsCountTxt, Format(IncomingDocAttachment.Count()));
CustomDimensions.Add(ExportedDocsCountTxt, Format(ExportedDocCount));
FeatureTelemetry.LogUsage('0000LT3', TransactionStorageTok, IncomingDocsExportedTxt, CustomDimensions);
diff --git a/Apps/W1/TransactionStorage/app/src/TransactionStorageSetup.Page.al b/Apps/W1/TransactionStorage/app/src/TransactionStorageSetup.Page.al
index 653d478495..d7ac9999e6 100644
--- a/Apps/W1/TransactionStorage/app/src/TransactionStorageSetup.Page.al
+++ b/Apps/W1/TransactionStorage/app/src/TransactionStorageSetup.Page.al
@@ -25,6 +25,7 @@ page 6200 "Transaction Storage Setup"
{
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies the maximum number of hours for the scheduled task to be executed. The specified value must not be less than 3 hours.';
+ Visible = false;
}
}
}
diff --git a/Apps/W1/WorldPayPaymentsStandard/app/src/MSWorldPayCreateDemoData.Codeunit.al b/Apps/W1/WorldPayPaymentsStandard/app/src/MSWorldPayCreateDemoData.Codeunit.al
deleted file mode 100644
index 06abf6c752..0000000000
--- a/Apps/W1/WorldPayPaymentsStandard/app/src/MSWorldPayCreateDemoData.Codeunit.al
+++ /dev/null
@@ -1,107 +0,0 @@
-#if not CLEAN23
-codeunit 1362 "MS - WorldPay Create Demo Data"
-{
- Subtype = Install;
- ObsoleteReason = 'WorldPay Payments Standard extension is discontinued';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-
- trigger OnInstallAppPerCompany()
- begin
- CompanyInitialize();
- end;
-
- [EventSubscriber(ObjectType::Codeunit, Codeunit::"Company-Initialize", 'OnCompanyInitialize', '', false, false)]
- local procedure CompanyInitialize()
- begin
- InsertDemoDataAndUpgradeBurntIn();
- ApplyEvaluationClassificationsForPrivacy();
- end;
-
- local procedure ApplyEvaluationClassificationsForPrivacy()
- var
- MSWorldPayStandardAccount: Record "MS - WorldPay Standard Account";
- MSWorldPayStdTemplate: Record "MS - WorldPay Std. Template";
- MSWorldPayTransaction: Record "MS - WorldPay Transaction";
- Company: Record Company;
- DataClassificationMgt: Codeunit "Data Classification Mgt.";
- begin
- Company.Get(CompanyName());
- if not Company."Evaluation Company" then
- exit;
-
- DataClassificationMgt.SetTableFieldsToNormal(DataBase::"MS - WorldPay Standard Account");
- DataClassificationMgt.SetFieldToPersonal(Database::"MS - WorldPay Standard Account", MSWorldPayStandardAccount.FieldNo(Name));
- DataClassificationMgt.SetFieldToPersonal(Database::"MS - WorldPay Standard Account", MSWorldPayStandardAccount.FieldNo(Description));
- DataClassificationMgt.SetFieldToPersonal(Database::"MS - WorldPay Standard Account", MSWorldPayStandardAccount.FieldNo("Account ID"));
- DataClassificationMgt.SetFieldToPersonal(Database::"MS - WorldPay Standard Account", MSWorldPayStandardAccount.FieldNo("Target URL"));
-
- DataClassificationMgt.SetTableFieldsToNormal(DataBase::"MS - WorldPay Std. Template");
- DataClassificationMgt.SetFieldToPersonal(Database::"MS - WorldPay Std. Template", MSWorldPayStdTemplate.FieldNo(Name));
- DataClassificationMgt.SetFieldToPersonal(Database::"MS - WorldPay Std. Template", MSWorldPayStdTemplate.FieldNo(Description));
- DataClassificationMgt.SetFieldToPersonal(Database::"MS - WorldPay Std. Template", MSWorldPayStdTemplate.FieldNo(Logo));
- DataClassificationMgt.SetFieldToPersonal(Database::"MS - WorldPay Std. Template", MSWorldPayStdTemplate.FieldNo("Target URL"));
- DataClassificationMgt.SetFieldToPersonal(Database::"MS - WorldPay Std. Template", MSWorldPayStdTemplate.FieldNo("Logo URL"));
-
- DataClassificationMgt.SetTableFieldsToNormal(DataBase::"MS - WorldPay Transaction");
- DataClassificationMgt.SetFieldToPersonal(Database::"MS - WorldPay Transaction", MSWorldPayTransaction.FieldNo("Payer E-mail"));
- DataClassificationMgt.SetFieldToPersonal(Database::"MS - WorldPay Transaction", MSWorldPayTransaction.FieldNo("Payer Name"));
- DataClassificationMgt.SetFieldToPersonal(Database::"MS - WorldPay Transaction", MSWorldPayTransaction.FieldNo("Payer Address"));
- DataClassificationMgt.SetFieldToPersonal(Database::"MS - WorldPay Transaction", MSWorldPayTransaction.FieldNo(Note));
- DataClassificationMgt.SetFieldToPersonal(Database::"MS - WorldPay Transaction", MSWorldPayTransaction.FieldNo(Custom));
- DataClassificationMgt.SetFieldToPersonal(Database::"MS - WorldPay Transaction", MSWorldPayTransaction.FieldNo(Details));
- end;
-
- procedure InsertDemoDataAndUpgradeBurntIn();
- var
- CompanyInformationMgt: Codeunit "Company Information Mgt.";
- begin
- if CompanyInformationMgt.IsDemoCompany() then begin
- InsertSandboxWorldPayTemplate();
- InsertDemoWorldPayAccount();
- end;
- end;
-
- var
- DemoAccountPrefixTxt: Label 'Demo Sandbox Account - ';
- DemoAccountIDTxt: Label '1182302', Locked = true;
-
- local procedure InsertSandboxWorldPayTemplate()
- var
- MSWorldPayStdTemplate: Record "MS - WorldPay Std. Template";
- MSWorldPayStandardMgt: Codeunit "MS - WorldPay Standard Mgt.";
- begin
- IF MSWorldPayStdTemplate.GET() THEN
- EXIT;
-
- MSWorldPayStdTemplate.INIT();
- MSWorldPayStdTemplate.INSERT();
-
- MSWorldPayStandardMgt.TemplateAssignDefaultValues(MSWorldPayStdTemplate);
- MSWorldPayStdTemplate.SetTargetURL(MSWorldPayStandardMgt.GetSandboxURL());
- end;
-
- local procedure InsertDemoWorldPayAccount()
- var
- MSWorldPayStdTemplate: Record "MS - WorldPay Std. Template";
- MSWorldPayStandardAccount: Record "MS - WorldPay Standard Account";
- MSWorldPayStandardMgt: Codeunit "MS - WorldPay Standard Mgt.";
- begin
- MSWorldPayStandardAccount.SETRANGE("Always Include on Documents", TRUE);
- IF MSWorldPayStandardAccount.FINDFIRST() THEN
- EXIT;
-
- MSWorldPayStandardMgt.GetTemplate(MSWorldPayStdTemplate);
- MSWorldPayStandardAccount.TRANSFERFIELDS(MSWorldPayStdTemplate, FALSE);
- MSWorldPayStandardAccount.Name := CopyStr(DemoAccountPrefixTxt + MSWorldPayStandardAccount.Name, 1, MaxStrLen(MSWorldPayStandardAccount.Name));
- MSWorldPayStandardAccount.Description := CopyStr(DemoAccountPrefixTxt + MSWorldPayStandardAccount.Description, 1, MaxStrLen(MSWorldPayStandardAccount.Description));
- MSWorldPayStandardAccount."Account ID" := DemoAccountIDTxt;
- MSWorldPayStandardAccount.INSERT(TRUE);
-
- MSWorldPayStandardAccount.Enabled := TRUE;
- MSWorldPayStandardAccount."Always Include on Documents" := TRUE;
- MSWorldPayStandardAccount.MODIFY(TRUE);
- end;
-}
-
-#endif
\ No newline at end of file
diff --git a/Apps/W1/WorldPayPaymentsStandard/app/src/MSWorldPayStandardAccount.Table.al b/Apps/W1/WorldPayPaymentsStandard/app/src/MSWorldPayStandardAccount.Table.al
index 81e4005ba7..93b4e1920d 100644
--- a/Apps/W1/WorldPayPaymentsStandard/app/src/MSWorldPayStandardAccount.Table.al
+++ b/Apps/W1/WorldPayPaymentsStandard/app/src/MSWorldPayStandardAccount.Table.al
@@ -3,15 +3,8 @@ table 1360 "MS - WorldPay Standard Account"
Caption = 'WorldPay Payments Standard Account';
ReplicateData = false;
ObsoleteReason = 'WorldPay Payments Standard extension is discontinued';
-#if not CLEAN23
- DrillDownPageID = 1360;
- LookupPageID = 1360;
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-#else
ObsoleteState = Removed;
ObsoleteTag = '26.0';
-#endif
fields
{
@@ -29,40 +22,9 @@ table 1360 "MS - WorldPay Standard Account"
}
field(4; Enabled; Boolean)
{
-#if not CLEAN23
- trigger OnValidate()
- begin
- VerifyAccountID();
- end;
-#endif
}
field(5; "Always Include on Documents"; Boolean)
{
-#if not CLEAN23
- trigger OnValidate()
- var
- MSWorldPayStandardAccount: Record "MS - WorldPay Standard Account";
- SalesHeader: Record "Sales Header";
- begin
- IF NOT "Always Include on Documents" THEN
- EXIT;
-
- MSWorldPayStandardAccount.SETRANGE("Always Include on Documents", TRUE);
- MSWorldPayStandardAccount.SETFILTER("Primary Key", '<>%1', "Primary Key");
- MSWorldPayStandardAccount.MODIFYALL("Always Include on Documents", FALSE, TRUE);
-
- IF NOT GUIALLOWED() THEN
- EXIT;
-
- SalesHeader.SETFILTER("Document Type", '%1|%2|%3',
- SalesHeader."Document Type"::Invoice,
- SalesHeader."Document Type"::Order,
- SalesHeader."Document Type"::Quote);
-
- IF NOT SalesHeader.IsEmpty() AND NOT HideDialogs THEN
- MESSAGE(UpdateOpenInvoicesManuallyMsg);
- end;
-#endif
}
field(8; "Terms of Service"; Text[250])
{
@@ -70,12 +32,6 @@ table 1360 "MS - WorldPay Standard Account"
}
field(10; "Account ID"; Text[250])
{
-#if not CLEAN23
- trigger OnValidate()
- begin
- VerifyAccountID();
- end;
-#endif
}
field(12; "Target URL"; BLOB)
{
@@ -96,54 +52,5 @@ table 1360 "MS - WorldPay Standard Account"
fieldgroups
{
}
-#if not CLEAN23
- var
- AccountIDCannotBeBlankErr: Label 'You must specify an account ID for this payment service.';
- UpdateOpenInvoicesManuallyMsg: Label 'A link for the WorldPay payment service will be included for new sales documents. To add it to existing sales documents, you must manually select it in the Payment Service field on the sales document.';
- HideDialogs: Boolean;
-
- procedure GetTargetURL(): Text
- var
- InStream: InStream;
- TargetURL: Text;
- begin
- TargetURL := '';
- CALCFIELDS("Target URL");
- IF "Target URL".HASVALUE() THEN BEGIN
- "Target URL".CREATEINSTREAM(InStream);
- InStream.READ(TargetURL);
- END;
- EXIT(TargetURL);
- end;
-
- procedure SetTargetURL(TargetURL: Text)
- var
- WebRequestHelper: Codeunit "Web Request Helper";
- OutStream: OutStream;
- begin
- WebRequestHelper.IsValidUri(TargetURL);
- WebRequestHelper.IsHttpUrl(TargetURL);
- WebRequestHelper.IsSecureHttpUrl(TargetURL);
-
- "Target URL".CREATEOUTSTREAM(OutStream);
- OutStream.WRITE(TargetURL);
- MODIFY();
- end;
-
- local procedure VerifyAccountID()
- begin
- IF Enabled THEN
- IF "Account ID" = '' THEN
- IF HideDialogs THEN
- "Account ID" := ''
- ELSE
- ERROR(AccountIDCannotBeBlankErr);
- end;
-
- procedure HideAllDialogs()
- begin
- HideDialogs := TRUE;
- end;
-#endif
}
diff --git a/Apps/W1/WorldPayPaymentsStandard/app/src/MSWorldPayStandardMgt.Codeunit.al b/Apps/W1/WorldPayPaymentsStandard/app/src/MSWorldPayStandardMgt.Codeunit.al
deleted file mode 100644
index fa147df288..0000000000
--- a/Apps/W1/WorldPayPaymentsStandard/app/src/MSWorldPayStandardMgt.Codeunit.al
+++ /dev/null
@@ -1,331 +0,0 @@
-#if not CLEAN23
-codeunit 1360 "MS - WorldPay Standard Mgt."
-{
- TableNo = "Payment Reporting Argument";
- ObsoleteReason = 'WorldPay Payments Standard extension is discontinued';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-
- trigger OnRun()
- begin
- if not GenerateHyperlink(Rec) then begin
- Session.LogMessage('0000802', WorldPayNoLinkTelemetryTxt, Verbosity::Warning, DataClassification::SystemMetadata, TelemetryScope::ExtensionPublisher, 'Category', WorldPayTelemetryCategoryTok);
- if not GuiAllowed() then
- Error(WorldPayNoLinkErr);
- if Confirm(WorldPayNoLinkQst) then
- exit;
- Error('');
- end;
- SetCaptionBasedOnLanguage(Rec);
- Session.LogMessage('00001TJ', WorldPayHyperlinkIncludedTxt, Verbosity::Normal, DataClassification::CustomerContent, TelemetryScope::ExtensionPublisher, 'Category', WorldPayTelemetryCategoryTok);
- end;
-
- var
- InvoiceTxt: Label 'Invoice %1', Comment = '%1 Invoice No.';
- NotSupportedTypeErr: Label 'This function is not supported for the %1 table.', Comment = '%1 Caption of the table';
- WorldPayCaptionURLTxt: Label 'Pay with WorldPay';
- DemoLinkCaptionTxt: Label 'Note: You''re in an evaluation company, and this isn''t a real invoice. You can''t actually pay it.', Comment = 'Will be shown next to the Pay with WorldPay link.';
- WorldPayStandardNameTxt: Label 'WorldPay Payments Standard';
- WorldPayStandardShortNameTxt: Label 'WorldPay Setup';
- WorldPayStandardDescriptionTxt: Label 'Use the WorldPay Payments Standard service';
- WorldPayStandardBusinessSetupDescriptionTxt: Label 'Set up and enable the WorldPay Payments Standard service.';
- YourReferenceTxt: Label 'Your Ref.', Comment = 'Ref. is short for reference from Your Reference field. After Ref there will be a number';
- TermsOfServiceURLTxt: Label 'https://go.microsoft.com/fwlink/?linkid=844662', Locked = true;
- LogoURLTxt: Label 'https://bc-cdn.dynamics.com/common/images/extensionslogos/worldpay_colour_v1.png', Locked = true;
- WorldPayBaseURLTok: Label 'https://secure-test.worldpay.com/wcc/purchase?testMode=100', Locked = true;
- WorldPayMandatoryParametersTok: Label 'instId=%1&cartId=%2&amount=%3¤cy=%4&desc=%5', Locked = true;
- TargetURLCannotBeChangedInDemoCompanyErr: Label 'You cannot change the target URL in the demonstration company.';
- SandboxWorldPayBaseURLTok: Label 'https://secure-test.worldpay.com/wcc/purchase?testMode=100', Locked = true;
- WorldPayHomepageLinkTxt: Label 'https://go.microsoft.com/fwlink/?linkid=844661', Locked = true;
- WorldPayBusinessSetupKeywordsTxt: Label 'Finance,WorldPay,Payment';
- WorldPayPaymentMethodCodeTok: Label 'WorldPay', Locked = true;
- WorldPayPaymentMethodDescTok: Label 'WorldPay payment';
- WorldPayTelemetryCategoryTok: Label 'AL WorldPay', Locked = true;
- WorldPayHyperlinkIncludedTxt: Label 'WorldPay hyperlink included on sales document.', Locked = true;
- WorldPayHyperlinkGeneratedTxt: Label 'WorldPay hyperlink generated for sales document.', Locked = true;
- WorldPayNoLinkTelemetryTxt: Label 'An error occured while creating the WorldPay payment link.', Locked = true;
- WorldPayNoLinkErr: Label 'An error occured while creating the WorldPay payment link.';
- WorldPayNoLinkQst: Label 'An error occured while creating the WorldPay payment link.\\Do you want to continue to create the document without the link?';
- WorldPayTargetURLIsEmptyTxt: Label 'WorldPay target URL is empty.', Locked = true;
- WorldPayTargetURLIsInvalidTxt: Label 'WorldPay target URL is invalid.', Locked = true;
- WorldPayInvoiceNoTok: Label '%1 (%2 %3)', Locked = true;
- WorldPayTargetURLTok: Label '%1&%2', Locked = true;
- WorldPayUrlTok: Label '%1 (%2)', Locked = true;
-
- local procedure GenerateHyperlink(var PaymentReportingArgument: Record 1062): Boolean;
- var
- SalesInvoiceHeader: Record "Sales Invoice Header";
- MsWorldPayStandardAccount: Record "MS - WorldPay Standard Account";
- MSWorldPayStdTemplate: Record "MS - WorldPay Std. Template";
- DataTypeManagement: Codeunit "Data Type Management";
- DocumentRecordRef: RecordRef;
- BaseURL: Text;
- TargetURL: Text;
- QueryString: Text;
- InvoiceNo: Text;
- begin
- DataTypeManagement.GetRecordRef(PaymentReportingArgument."Document Record ID", DocumentRecordRef);
-
- CASE DocumentRecordRef.NUMBER() OF
- DATABASE::"Sales Invoice Header":
- BEGIN
- GetTemplate(MSWorldPayStdTemplate);
- MSWorldPayStdTemplate.RefreshLogoIfNeeded();
- MsWorldPayStandardAccount.SETAUTOCALCFIELDS("Target URL");
- MsWorldPayStandardAccount.GET(PaymentReportingArgument."Setup Record ID");
- DocumentRecordRef.SETTABLE(SalesInvoiceHeader);
- SalesInvoiceHeader.CALCFIELDS("Amount Including VAT");
-
- InvoiceNo := SalesInvoiceHeader."No.";
- IF SalesInvoiceHeader."Your Reference" <> '' THEN
- InvoiceNo := STRSUBSTNO(WorldPayInvoiceNoTok, InvoiceNo, YourReferenceTxt, SalesInvoiceHeader."Your Reference");
-
- QueryString := STRSUBSTNO(WorldPayMandatoryParametersTok,
- UriEscapeDataString(MsWorldPayStandardAccount."Account ID"),
- UriEscapeDataString(SalesInvoiceHeader."No."),
- UriEscapeDataString(FORMAT(SalesInvoiceHeader."Amount Including VAT", 0, 9)),
- UriEscapeDataString(PaymentReportingArgument.GetCurrencyCode(SalesInvoiceHeader."Currency Code")),
- UriEscapeDataString(STRSUBSTNO(InvoiceTxt, InvoiceNo)));
- BaseURL := MsWorldPayStandardAccount.GetTargetURL();
- if BaseURL = '' then begin
- Session.LogMessage('0000803', WorldPayTargetURLIsEmptyTxt, Verbosity::Warning, DataClassification::SystemMetadata, TelemetryScope::ExtensionPublisher, 'Category', WorldPayTelemetryCategoryTok);
- exit(false);
- end;
-
- TargetURL := STRSUBSTNO(WorldPayTargetURLTok, BaseURL, QueryString);
- if not PaymentReportingArgument.TrySetTargetURL(TargetURL) then begin
- Session.LogMessage('0000804', WorldPayTargetURLIsInvalidTxt, Verbosity::Warning, DataClassification::SystemMetadata, TelemetryScope::ExtensionPublisher, 'Category', WorldPayTelemetryCategoryTok);
- exit(false);
- end;
-
- PaymentReportingArgument.Logo := MSWorldPayStdTemplate.Logo;
- PaymentReportingArgument."Payment Service ID" := PaymentReportingArgument.GetWorldPayServiceID();
- PaymentReportingArgument.MODIFY(TRUE);
-
- IF SalesInvoiceHeader."No. Printed" = 1 then
- Session.LogMessage('00001ZT', WorldPayHyperlinkGeneratedTxt, Verbosity::Normal, DataClassification::SystemMetadata, TelemetryScope::ExtensionPublisher, 'Category', WorldPayTelemetryCategoryTok);
-
- exit(true);
- END;
- DATABASE::"Sales Header":
- BEGIN
- GetTemplate(MSWorldPayStdTemplate);
- MSWorldPayStdTemplate.RefreshLogoIfNeeded();
-
- PaymentReportingArgument.SetTargetURL(WorldPayHomepageLinkTxt);
- PaymentReportingArgument.Logo := MSWorldPayStdTemplate.Logo;
- PaymentReportingArgument."Payment Service ID" := PaymentReportingArgument.GetWorldPayServiceID();
- PaymentReportingArgument.MODIFY(TRUE);
- exit(true);
- END;
- ELSE
- ERROR(NotSupportedTypeErr, DocumentRecordRef.CAPTION());
- END;
- end;
-
- local procedure UriEscapeDataString(Uri: Text): Text;
- var
- TypeHelper: Codeunit "Type Helper";
- begin
- exit(TypeHelper.UriEscapeDataString(Uri));
- end;
-
- local procedure SetCaptionBasedOnLanguage(var PaymentReportingArgument: Record 1062)
- var
- Language: Record "Language";
- CurrentLanguage: Integer;
- begin
- CurrentLanguage := GLOBALLANGUAGE();
- IF Language.GET(PaymentReportingArgument."Language Code") THEN
- GLOBALLANGUAGE(Language."Windows Language ID");
-
- PaymentReportingArgument.VALIDATE("URL Caption", WorldPayCaptionURLTxt);
- IF STRPOS(PaymentReportingArgument.GetTargetURL(), GetSandboxURL()) > 0 THEN
- PaymentReportingArgument.VALIDATE("URL Caption", STRSUBSTNO(WorldPayUrlTok, WorldPayCaptionURLTxt, DemoLinkCaptionTxt));
- PaymentReportingArgument.MODIFY(TRUE);
-
- IF GLOBALLANGUAGE() <> CurrentLanguage THEN
- GLOBALLANGUAGE(CurrentLanguage);
- end;
-
- procedure GetTemplate(var TempMSWorldPayStdTemplate: Record "MS - WorldPay Std. Template" temporary)
- var
- MSWorldPayStdTemplate: Record "MS - WorldPay Std. Template";
- begin
- IF MSWorldPayStdTemplate.GET() THEN BEGIN
- MSWorldPayStdTemplate.CALCFIELDS(Logo, "Target URL");
- TempMSWorldPayStdTemplate.TRANSFERFIELDS(MSWorldPayStdTemplate, TRUE);
- EXIT;
- END;
-
- TempMSWorldPayStdTemplate.INIT();
- TempMSWorldPayStdTemplate.INSERT();
- TemplateAssignDefaultValues(TempMSWorldPayStdTemplate);
- end;
-
- procedure TemplateAssignDefaultValues(var MSWorldPayStdTemplate: Record "MS - WorldPay Std. Template")
- begin
- MSWorldPayStdTemplate.VALIDATE(Name, WorldPayStandardNameTxt);
- MSWorldPayStdTemplate.VALIDATE(Description, WorldPayStandardDescriptionTxt);
- MSWorldPayStdTemplate.VALIDATE("Terms of Service", TermsOfServiceURLTxt);
- MSWorldPayStdTemplate.VALIDATE("Logo Update Frequency", 7 * 24 * 3600 * 1000);
- MSWorldPayStdTemplate.MODIFY(TRUE);
- MSWorldPayStdTemplate.SetTargetURL(GetTargetURL());
- MSWorldPayStdTemplate.SetLogoURL(LogoURLTxt);
- end;
-
- procedure GetWorldPayPaymentMethod(var PaymentMethod: Record "Payment Method")
- begin
- RegisterWorldPayPaymentMethod(PaymentMethod);
- end;
-
- local procedure RegisterWorldPayPaymentMethod(var PaymentMethod: Record "Payment Method")
- begin
- IF PaymentMethod.GET(WorldPayPaymentMethodCodeTok) THEN
- EXIT;
- PaymentMethod.INIT();
- PaymentMethod.Code := WorldPayPaymentMethodCodeTok;
- PaymentMethod.Description := WorldPayPaymentMethodDescTok;
- PaymentMethod."Bal. Account Type" := PaymentMethod."Bal. Account Type"::"G/L Account";
- IF PaymentMethod.INSERT() THEN;
- end;
-
- [EventSubscriber(ObjectType::Table, Database::"MS - WorldPay Standard Account", 'OnAfterInsertEvent', '', false, false)]
- local procedure OnInsertWorldPayStandardAccount(var Rec: Record "MS - WorldPay Standard Account"; RunTrigger: Boolean)
- var
- PaymentMethod: Record "Payment Method";
- begin
- if Rec.IsTemporary() then
- exit;
-
- RegisterWorldPayPaymentMethod(PaymentMethod);
- end;
-
- [EventSubscriber(ObjectType::Table, Database::"Payment Service Setup", 'OnRegisterPaymentServices', '', false, false)]
- local procedure RegisterWorldPayStandardAccounts(var PaymentServiceSetup: Record 1060)
- var
- MSWorldPayStandardAccount: Record "MS - WorldPay Standard Account";
- begin
- IF NOT MSWorldPayStandardAccount.FINDSET() THEN
- EXIT;
-
- REPEAT
- CLEAR(PaymentServiceSetup);
- PaymentServiceSetup.TRANSFERFIELDS(MSWorldPayStandardAccount, FALSE);
- PaymentServiceSetup."Setup Record ID" := MSWorldPayStandardAccount.RECORDID();
- PaymentServiceSetup.AssignPrimaryKey(PaymentServiceSetup);
- PaymentServiceSetup."Management Codeunit ID" := CODEUNIT::"MS - WorldPay Standard Mgt.";
- PaymentServiceSetup.INSERT(TRUE);
- UNTIL MSWorldPayStandardAccount.NEXT() = 0;
- end;
-
- [EventSubscriber(ObjectType::Table, Database::"Payment Service Setup", 'OnRegisterPaymentServiceProviders', '', false, false)]
- local procedure RegisterWorldPayStandardTemplateSubscriber(var PaymentServiceSetup: Record 1060)
- begin
- RegisterWorldPayStandardTemplate(PaymentServiceSetup);
- end;
-
- procedure RegisterWorldPayStandardTemplate(var PaymentServiceSetup: Record 1060)
- var
- TempMSWorldPayStdTemplate: Record "MS - WorldPay Std. Template" temporary;
- begin
- GetTemplate(TempMSWorldPayStdTemplate);
-
- CLEAR(PaymentServiceSetup);
-
- PaymentServiceSetup.Name := TempMSWorldPayStdTemplate.Name;
- PaymentServiceSetup.Description := TempMSWorldPayStdTemplate.Description;
- PaymentServiceSetup."Setup Record ID" := TempMSWorldPayStdTemplate.RECORDID();
- PaymentServiceSetup."Management Codeunit ID" := CODEUNIT::"MS - WorldPay Standard Mgt.";
- PaymentServiceSetup.AssignPrimaryKey(PaymentServiceSetup);
- PaymentServiceSetup.INSERT(TRUE);
- end;
-
- [EventSubscriber(ObjectType::Table, Database::"Payment Service Setup", 'OnCreatePaymentService', '', false, false)]
- local procedure NewPaymentAccount(var PaymentServiceSetup: Record 1060)
- var
- MSWorldPayStdTemplate: Record "MS - WorldPay Std. Template";
- MSWorldPayStandardAccount: Record "MS - WorldPay Standard Account";
- begin
- IF PaymentServiceSetup."Management Codeunit ID" <> CODEUNIT::"MS - WorldPay Standard Mgt." THEN
- EXIT;
-
- GetTemplate(MSWorldPayStdTemplate);
- MSWorldPayStandardAccount.TRANSFERFIELDS(MSWorldPayStdTemplate, FALSE);
- MSWorldPayStandardAccount.INSERT(TRUE);
- COMMIT();
- PAGE.RUNMODAL(PAGE::"MS - WorldPay Standard Setup", MSWorldPayStandardAccount);
- end;
-
- [EventSubscriber(ObjectType::Table, Database::"Service Connection", 'OnRegisterServiceConnection', '', false, false)]
- local procedure RegisterServiceConnection(var ServiceConnection: Record 1400)
- var
- MSWorldPayStandardAccount: Record "MS - WorldPay Standard Account";
- MSWorldPayStdTemplate: Record "MS - WorldPay Std. Template";
- RecRef: RecordRef;
- TargetURL: Text;
- begin
- IF NOT MSWorldPayStandardAccount.FINDSET() THEN BEGIN
- GetTemplate(MSWorldPayStdTemplate);
- MSWorldPayStandardAccount.TRANSFERFIELDS(MSWorldPayStdTemplate, FALSE);
- MSWorldPayStandardAccount.INSERT(TRUE);
- END;
-
- REPEAT
- RecRef.GETTABLE(MSWorldPayStandardAccount);
-
- IF MSWorldPayStandardAccount.Enabled THEN
- ServiceConnection.Status := ServiceConnection.Status::Enabled
- ELSE
- ServiceConnection.Status := ServiceConnection.Status::Disabled;
-
- TargetURL := MSWorldPayStandardAccount.GetTargetURL();
- ServiceConnection.InsertServiceConnection(
- ServiceConnection, RecRef.RECORDID(), MSWorldPayStandardAccount.Description,
- COPYSTR(TargetURL, 1, MAXSTRLEN(ServiceConnection."Host Name")), PAGE::"MS - WorldPay Standard Setup");
- UNTIL MSWorldPayStandardAccount.NEXT() = 0
- end;
-
- [EventSubscriber(ObjectType::Codeunit, Codeunit::"Guided Experience", 'OnRegisterManualSetup', '', false, false)]
- local procedure RegisterBusinessSetup()
- var
- MSWorldPayStandardAccount: Record "MS - WorldPay Standard Account";
- MSWorldPayStdTemplate: Record "MS - WorldPay Std. Template";
- GuidedExperience: Codeunit "Guided Experience";
- begin
- if not MSWorldPayStandardAccount.FindFirst() then begin
- GetTemplate(MSWorldPayStdTemplate);
- MSWorldPayStandardAccount.Transferfields(MSWorldPayStdTemplate, false);
- MSWorldPayStandardAccount.Insert(true);
- end;
-
- GuidedExperience.InsertManualSetup(WorldPayStandardNameTxt, CopyStr(WorldPayStandardShortNameTxt, 1, 50), WorldPayStandardBusinessSetupDescriptionTxt, 3, ObjectType::Page, Page::"MS - WorldPay Standard Setup", "Manual Setup Category"::Service, WorldPayBusinessSetupKeywordsTxt, true);
- end;
-
- procedure ValidateChangeTargetURL()
- var
- CompanyInformationMgt: Codeunit "Company Information Mgt.";
- EnvironmentInformation: Codeunit "Environment Information";
- begin
- IF CompanyInformationMgt.IsDemoCompany() AND EnvironmentInformation.IsSaaS() THEN
- ERROR(TargetURLCannotBeChangedInDemoCompanyErr);
- end;
-
- procedure GetTargetURL(): Text
- var
- CompanyInformationMgt: Codeunit "Company Information Mgt.";
- begin
- IF CompanyInformationMgt.IsDemoCompany() THEN
- EXIT(GetSandboxURL());
-
- EXIT(WorldPayBaseURLTok);
- end;
-
- procedure GetSandboxURL(): Text
- begin
- EXIT(SandboxWorldPayBaseURLTok);
- end;
-
-}
-
-#endif
\ No newline at end of file
diff --git a/Apps/W1/WorldPayPaymentsStandard/app/src/MSWorldPayStandardSetup.Page.al b/Apps/W1/WorldPayPaymentsStandard/app/src/MSWorldPayStandardSetup.Page.al
deleted file mode 100644
index 470b606753..0000000000
--- a/Apps/W1/WorldPayPaymentsStandard/app/src/MSWorldPayStandardSetup.Page.al
+++ /dev/null
@@ -1,180 +0,0 @@
-#if not CLEAN23
-page 1360 "MS - WorldPay Standard Setup"
-{
- Caption = 'WorldPay Payments Standard Setup';
- DataCaptionExpression = '';
- InsertAllowed = false;
- UsageCategory = Administration;
- ApplicationArea = Basic, Suite;
- PageType = Card;
- SourceTable = "MS - WorldPay Standard Account";
- ObsoleteReason = 'WorldPay Payments Standard extension is discontinued';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-
- layout
- {
- area(content)
- {
- group(General)
- {
- Caption = 'General';
- group(Nested)
- {
- field(Name; Name)
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the name of the WorldPay account.';
- }
- field(Description; Description)
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies a description of what this WorldPay account is used for.';
- }
- field("Account ID"; "Account ID")
- {
- ApplicationArea = Basic, Suite;
- ShowMandatory = true;
- ToolTip = 'Specifies the email or the merchant account ID of the WorldPay account.';
-
- trigger OnValidate()
- begin
- VALIDATE("Account ID", DELCHR("Account ID", '<>'));
- end;
- }
- field(Enabled; Enabled)
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies if the payment service is enabled.';
-
- trigger OnValidate()
- begin
- FeatureTelemetry.LogUptake('0000H7W', 'WorldPay Payments Standard', Enum::"Feature Uptake Status"::"Set up");
- // If we transition from disabled to enabled state
- // show 3rd party notice message
- IF NOT xRec.Enabled AND Enabled THEN
- MESSAGE(ThirdPartyNoticeMsg);
- end;
- }
- field("Always Include on Documents"; "Always Include on Documents")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies whether to make this WorldPay account available on all documents.';
- }
- }
- field(Logo; MSWorldPayStdTemplate.Logo)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Logo';
- Editable = false;
- ToolTip = 'Specifies the logo to include for this account on all invoices.';
- }
- field(TargetURL; TargetURL)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Target URL';
- Importance = Additional;
- MultiLine = true;
- ToolTip = 'Specifies the address of the web page that opens when the customer chooses the link on the invoice.';
-
- trigger OnValidate()
- var
- MSWorldPayStandardMgt: Codeunit "MS - WorldPay Standard Mgt.";
- begin
- MSWorldPayStandardMgt.ValidateChangeTargetURL();
- SetTargetURL(TargetURL);
- end;
- }
- field("Terms of Service"; "Terms of Service")
- {
- ApplicationArea = Basic, Suite;
- Editable = TermsOfServiceEditable;
- ToolTip = 'Specifies WorldPay terms of service.';
-
- trigger OnAssistEdit()
- begin
- TermsOfServiceEditable := NOT TermsOfServiceEditable;
- end;
-
- trigger OnDrillDown()
- begin
- HYPERLINK("Terms of Service");
- end;
- }
- }
- }
- }
-
- actions
- {
- area(creation)
- {
- action(SetupTemplate)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Setup Template';
- Image = Setup;
- RunObject = Page "MS - WorldPay Std. Template";
- RunPageOnRec = false;
- ToolTip = 'Opens Template Setup for all WorldPay accounts.';
- }
- action(ActivityLog)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Activity Log';
- Image = Log;
- ToolTip = 'Log listing events for this WorldPay account.';
-
- trigger OnAction()
- var
- MSWorldPayStdTemplate: Record "MS - WorldPay Std. Template";
- ActivityLog: Record "Activity Log";
- MSWorldPayStandardMgt: Codeunit "MS - WorldPay Standard Mgt.";
- begin
- MSWorldPayStandardMgt.GetTemplate(MSWorldPayStdTemplate);
- ActivityLog.ShowEntries(MSWorldPayStdTemplate);
- end;
- }
- }
- }
-
- trigger OnAfterGetCurrRecord()
- begin
- TargetURL := GetTargetURL();
- end;
-
- trigger OnOpenPage()
- var
- MSWorldPayStandardMgt: Codeunit "MS - WorldPay Standard Mgt.";
- DeprecationNotification: Notification;
- DeprecationMsg: Label 'WorldPay Payments Standard extension will be discontinued.';
- begin
- FeatureTelemetry.LogUptake('0000H7X', 'WorldPay Payments Standard', Enum::"Feature Uptake Status"::Discovered);
- MSWorldPayStandardMgt.GetTemplate(MSWorldPayStdTemplate);
- MSWorldPayStdTemplate.RefreshLogoIfNeeded();
-
- DeprecationNotification.Message := DeprecationMsg;
- DeprecationNotification.Scope := NotificationScope::LocalScope;
- DeprecationNotification.Send();
- end;
-
- trigger OnQueryClosePage(CloseAction: Action): Boolean
- begin
- IF NOT Enabled THEN
- IF NOT CONFIRM(STRSUBSTNO(EnableServiceQst, CurrPage.CAPTION()), TRUE) THEN
- EXIT(FALSE);
-
- IF CloseAction = ACTION::Cancel THEN
- EXIT(TRUE);
- end;
-
- var
- MSWorldPayStdTemplate: Record "MS - WorldPay Std. Template";
- FeatureTelemetry: Codeunit "Feature Telemetry";
- TargetURL: Text;
- TermsOfServiceEditable: Boolean;
- EnableServiceQst: Label 'The %1 is not enabled. Are you sure you want to exit?', Comment = '%1 = pagecaption (WorldPay Payments Standard Setup)';
- ThirdPartyNoticeMsg: Label 'This extension uses the WorldPay, a third-party provider. By enabling this extension, you will be subject to the applicable terms, conditions, and privacy policies that WorldPay may make available.\\When you establish a connection through the WorldPay Payments Standard extension, customer data from the invoice, such as invoice number, due date, amount, and currency, as well as your WorldPay account ID, will be inserted into the WorldPay payment link on invoices and sent to WorldPay when the customer chooses the link to pay. This data is used to ensure that the link contains enough information for your customers to pay the invoice, as well as for WorldPay to identify you as the recipient of a payment using the link.\\By installing this solution, you agree for this limited set of data to be sent to the WorldPay. Note that you can disable or uninstall the WorldPay Payments Standard extension at any time to discontinue the functionality.';
-}
-
-#endif
\ No newline at end of file
diff --git a/Apps/W1/WorldPayPaymentsStandard/app/src/MSWorldPayStandardUpgrade.Codeunit.al b/Apps/W1/WorldPayPaymentsStandard/app/src/MSWorldPayStandardUpgrade.Codeunit.al
deleted file mode 100644
index 305790779f..0000000000
--- a/Apps/W1/WorldPayPaymentsStandard/app/src/MSWorldPayStandardUpgrade.Codeunit.al
+++ /dev/null
@@ -1,8 +0,0 @@
-#if not CLEAN23
-codeunit 1361 "MS - WorldPay Standard Upgrade"
-{
- ObsoleteReason = 'WorldPay Payments Standard extension is discontinued';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-}
-#endif
\ No newline at end of file
diff --git a/Apps/W1/WorldPayPaymentsStandard/app/src/MSWorldPayStdSettings.Page.al b/Apps/W1/WorldPayPaymentsStandard/app/src/MSWorldPayStdSettings.Page.al
deleted file mode 100644
index 0f927298c2..0000000000
--- a/Apps/W1/WorldPayPaymentsStandard/app/src/MSWorldPayStdSettings.Page.al
+++ /dev/null
@@ -1,124 +0,0 @@
-#if not CLEAN23
-page 1364 "MS - WorldPay Std. Settings"
-{
- Caption = 'WorldPay Email';
- DeleteAllowed = false;
- InsertAllowed = false;
- LinksAllowed = false;
- ModifyAllowed = false;
- PageType = Card;
- ShowFilter = false;
- SourceTable = "MS - WorldPay Standard Account";
- ObsoleteReason = 'WorldPay Payments Standard extension is discontinued';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-
- layout
- {
- area(content)
- {
- group("WorldPay Information")
- {
- Caption = 'WorldPay Information';
- field(AccountID; AccountID)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'WorldPay Email';
- ToolTip = 'Specify the Account';
-
- trigger OnValidate()
- var
- MSWorldPayStandardMgt: Codeunit "MS - WorldPay Standard Mgt.";
- begin
- HideAllDialogs();
- VALIDATE("Account ID", AccountID);
-
- IF STRPOS(AccountID, SandboxPrefixTok) = 1 THEN
- IF CONFIRM(WorldPaySandBoxModeQst) THEN BEGIN
- SetTargetURL(MSWorldPayStandardMgt.GetSandboxURL());
- EXIT;
- END;
-
- SetTargetURL(MSWorldPayStandardMgt.GetTargetURL());
- end;
- }
- field("Terms of Service"; "Terms of Service")
- {
- ApplicationArea = Basic, Suite;
- Editable = false;
- ShowCaption = false;
-
- trigger OnDrillDown()
- begin
- HYPERLINK("Terms of Service");
- end;
- }
- }
- }
- }
-
- actions
- {
- }
-
- trigger OnAfterGetCurrRecord()
- begin
- AccountID := "Account ID";
- end;
-
- trigger OnOpenPage()
- var
- TempPaymentServiceSetup: Record 1060 temporary;
- MSWorldPayStandardMgt: Codeunit "MS - WorldPay Standard Mgt.";
- begin
- IF ISEMPTY() THEN BEGIN
- MSWorldPayStandardMgt.RegisterWorldPayStandardTemplate(TempPaymentServiceSetup);
-
- MSWorldPayStandardMgt.GetTemplate(MSWorldPayStdTemplate);
- MSWorldPayStdTemplate.RefreshLogoIfNeeded();
- TRANSFERFIELDS(MSWorldPayStdTemplate, FALSE);
- INSERT(TRUE);
-
- COMMIT();
- END;
- end;
-
- trigger OnQueryClosePage(CloseAction: Action): Boolean
- var
- SalesHeader: Record "Sales Header";
- begin
- IF CloseAction = ACTION::Cancel THEN
- EXIT(TRUE);
-
- // If we transition from disabled to enabled state
- // show 3rd party notice message
- IF NOT xRec.Enabled AND Enabled THEN
- MESSAGE(ThirdPartyNoticeMsg);
-
- HideAllDialogs();
- IF "Account ID" <> '' THEN BEGIN
- VALIDATE(Enabled, TRUE);
- VALIDATE("Always Include on Documents", TRUE);
- MODIFY(TRUE);
- END ELSE BEGIN
- VALIDATE(Enabled, FALSE);
- MODIFY(TRUE);
- END;
-
- SalesHeader.SETRANGE("Document Type", SalesHeader."Document Type"::Invoice);
- IF SalesHeader.FINDSET(TRUE, FALSE) THEN
- REPEAT
- SalesHeader.SetDefaultPaymentServices();
- SalesHeader.MODIFY()
- UNTIL SalesHeader.NEXT() = 0;
- end;
-
- var
- MSWorldPayStdTemplate: Record "MS - WorldPay Std. Template";
- AccountID: Text[250];
- SandboxPrefixTok: Label 'sandbox.', Locked = true;
- WorldPaySandBoxModeQst: Label 'Do you want to enable WorldPay Sandbox setup?';
- ThirdPartyNoticeMsg: Label 'You are accessing a third-party website and service. You should review the third-party''''s terms and privacy policy.';
-}
-
-#endif
\ No newline at end of file
diff --git a/Apps/W1/WorldPayPaymentsStandard/app/src/MSWorldPayStdTemplate.Page.al b/Apps/W1/WorldPayPaymentsStandard/app/src/MSWorldPayStdTemplate.Page.al
deleted file mode 100644
index 2a18cfb214..0000000000
--- a/Apps/W1/WorldPayPaymentsStandard/app/src/MSWorldPayStdTemplate.Page.al
+++ /dev/null
@@ -1,127 +0,0 @@
-#if not CLEAN23
-page 1361 "MS - WorldPay Std. Template"
-{
- Caption = 'WorldPay Payments Standard Template';
- DeleteAllowed = false;
- InsertAllowed = false;
- PageType = Card;
- ShowFilter = false;
- SourceTable = "MS - WorldPay Std. Template";
- ObsoleteReason = 'WorldPay Payments Standard extension is discontinued';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-
- layout
- {
- area(content)
- {
- group(General)
- {
- Caption = 'General';
- field(Name; Name)
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the default name for the WorldPay payment service.';
- }
- field(Description; Description)
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the default description for the WorldPay payment service.';
- }
- field(Logo; Logo)
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the default logo for the WorldPay payment service.';
- }
- field(TargetURL; TargetURL)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Target URL';
- MultiLine = true;
- ToolTip = 'Specifies the default target URL that will be used for the WorldPay payment services.';
-
- trigger OnValidate()
- var
- MSWorldPayStandardMgt: Codeunit "MS - WorldPay Standard Mgt.";
- begin
- MSWorldPayStandardMgt.ValidateChangeTargetURL();
- SetTargetURL(TargetURL);
- end;
- }
- field("Terms of Service"; "Terms of Service")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the terms of use for the WorldPay payment service.';
- }
- field(LogoURL; LogoURL)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Logo URL';
- MultiLine = true;
- ToolTip = 'Specifies the URL from which the logo will be refreshed regularly.';
-
- trigger OnValidate()
- begin
- SetLogoURL(LogoURL);
- end;
- }
- field("Logo Update Frequency"; "Logo Update Frequency")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the frequency with which the logo is updated.';
- }
- }
- }
- }
-
- actions
- {
- area(processing)
- {
- action(ResetToDefault)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Reset To Default';
- Image = Restore;
- Promoted = true;
- PromotedCategory = Process;
- PromotedIsBig = true;
- PromotedOnly = true;
- ToolTip = 'Resets values to default.';
-
- trigger OnAction()
- var
- MSWorldPayStandardMgt: Codeunit "MS - WorldPay Standard Mgt.";
- begin
- MSWorldPayStandardMgt.TemplateAssignDefaultValues(Rec);
- MESSAGE(SetToDefaultMsg);
- end;
- }
- }
- }
-
- trigger OnAfterGetCurrRecord()
- begin
- LogoURL := GetLogoURL();
- TargetURL := GetTargetURL();
- end;
-
- trigger OnOpenPage()
- var
- TempMSWorldPayStdTemplate: Record 1361 temporary;
- MSWorldPayStandardMgt: Codeunit "MS - WorldPay Standard Mgt.";
- begin
- IF NOT GET() THEN BEGIN
- MSWorldPayStandardMgt.GetTemplate(TempMSWorldPayStdTemplate);
- TRANSFERFIELDS(TempMSWorldPayStdTemplate);
- INSERT();
- END;
- end;
-
- var
- LogoURL: Text;
- TargetURL: Text;
- SetToDefaultMsg: Label 'Settings have been set to default.';
-}
-
-#endif
\ No newline at end of file
diff --git a/Apps/W1/WorldPayPaymentsStandard/app/src/MSWorldPayStdTemplate.Table.al b/Apps/W1/WorldPayPaymentsStandard/app/src/MSWorldPayStdTemplate.Table.al
index 4a43d6977b..58d423e8de 100644
--- a/Apps/W1/WorldPayPaymentsStandard/app/src/MSWorldPayStdTemplate.Table.al
+++ b/Apps/W1/WorldPayPaymentsStandard/app/src/MSWorldPayStdTemplate.Table.al
@@ -3,15 +3,8 @@ table 1361 "MS - WorldPay Std. Template"
Caption = 'WorldPay Payments Standard Account Template';
ReplicateData = false;
ObsoleteReason = 'WorldPay Payments Standard extension is discontinued';
-#if not CLEAN23
- DrillDownPageID = 1361;
- LookupPageID = 1361;
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-#else
ObsoleteState = Removed;
ObsoleteTag = '26.0';
-#endif
fields
{
@@ -53,111 +46,5 @@ table 1361 "MS - WorldPay Std. Template"
{
fieldgroup(Description; Description) { }
}
-#if not CLEAN23
- var
- UpdatingWorldPayLogoFailedTxt: Label 'Cannot update the WorldPay logo.';
- WorldPayContextTxt: Label 'WorldPay Standard';
-
- procedure GetTargetURL(): Text
- var
- InStream: InStream;
- TargetURL: Text;
- begin
- TargetURL := '';
- CALCFIELDS("Target URL");
- IF "Target URL".HASVALUE() THEN BEGIN
- "Target URL".CREATEINSTREAM(InStream);
- InStream.READ(TargetURL);
- END;
- EXIT(TargetURL);
- end;
-
- procedure SetTargetURL(TargetURL: Text)
- var
- WebRequestHelper: Codeunit "Web Request Helper";
- OutStream: OutStream;
- begin
- WebRequestHelper.IsValidUri(TargetURL);
- WebRequestHelper.IsHttpUrl(TargetURL);
- WebRequestHelper.IsSecureHttpUrl(TargetURL);
-
- "Target URL".CREATEOUTSTREAM(OutStream);
- OutStream.WRITE(TargetURL);
- MODIFY();
- end;
-
- procedure GetLogoURL(): Text
- var
- InStream: InStream;
- LogoURL: Text;
- begin
- LogoURL := '';
- CALCFIELDS("Logo URL");
- IF "Logo URL".HASVALUE() THEN BEGIN
- "Logo URL".CREATEINSTREAM(InStream);
- InStream.READ(LogoURL);
- END;
- EXIT(LogoURL);
- end;
-
- procedure SetLogoURL(LogoURL: Text)
- var
- WebRequestHelper: Codeunit "Web Request Helper";
- OutStream: OutStream;
- begin
- WebRequestHelper.IsValidUri(LogoURL);
- WebRequestHelper.IsHttpUrl(LogoURL);
- WebRequestHelper.IsSecureHttpUrl(LogoURL);
-
- "Logo URL".CREATEOUTSTREAM(OutStream);
- OutStream.WRITE(LogoURL);
- MODIFY();
- end;
-
- procedure RefreshLogoIfNeeded()
- begin
- IF ("Logo Last Update DateTime" <= (CURRENTDATETIME() - "Logo Update Frequency")) AND ("Logo Update Frequency" <> 0) THEN
- IF UpdateLogoFromURL(GetLogoURL()) THEN
- EXIT;
-
- CALCFIELDS(Logo);
- end;
-
- procedure UpdateLogoFromURL(LogoURL: Text): Boolean
- var
- ActivityLog: Record "Activity Log";
- begin
- IF LogoURL = '' THEN
- EXIT(FALSE);
-
- IF NOT DownloadLogo(LogoURL) THEN BEGIN
- ActivityLog.LogActivity(Rec, ActivityLog.Status::Failed, WorldPayContextTxt, UpdatingWorldPayLogoFailedTxt, GETLASTERRORTEXT());
- EXIT(FALSE);
- END;
- "Logo Last Update DateTime" := CURRENTDATETIME();
- MODIFY(TRUE);
- EXIT(TRUE);
- end;
-
- local procedure DownloadLogo(LogoURL: Text): Boolean
- var
- TempBlob: Codeunit "Temp Blob";
- LogoHttpClient: HttpClient;
- ResponseHttpResponseMessage: HttpResponseMessage;
- ResponseInStream: InStream;
- LogoOutStream: OutStream;
- begin
- if not LogoHttpClient.Get(LogoURL, ResponseHttpResponseMessage) then
- exit(FALSE);
- if not ResponseHttpResponseMessage.IsSuccessStatusCode() then
- exit(FALSE);
-
- TempBlob.CreateInStream(ResponseInStream);
-
- ResponseHttpResponseMessage.Content().ReadAs(ResponseInStream);
- Logo.CREATEOUTSTREAM(LogoOutStream);
- exit(COPYSTREAM(LogoOutStream, ResponseInStream));
- end;
-#endif
}
diff --git a/Apps/W1/WorldPayPaymentsStandard/app/src/MSWorldPayTransaction.Table.al b/Apps/W1/WorldPayPaymentsStandard/app/src/MSWorldPayTransaction.Table.al
index 8cb3ac8840..7015281450 100644
--- a/Apps/W1/WorldPayPaymentsStandard/app/src/MSWorldPayTransaction.Table.al
+++ b/Apps/W1/WorldPayPaymentsStandard/app/src/MSWorldPayTransaction.Table.al
@@ -2,13 +2,8 @@ table 1367 "MS - WorldPay Transaction"
{
ReplicateData = false;
ObsoleteReason = 'WorldPay Payments Standard extension is discontinued';
-#if not CLEAN23
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-#else
ObsoleteState = Removed;
ObsoleteTag = '26.0';
-#endif
fields
{
@@ -41,34 +36,5 @@ table 1367 "MS - WorldPay Transaction"
fieldgroups
{
}
-#if not CLEAN23
- procedure SetDetails(DetailsText: Text)
- var
- OutStream: OutStream;
- begin
- CLEAR(Details);
- Details.CREATEOUTSTREAM(OutStream);
- OutStream.WRITETEXT(DetailsText);
- end;
-
- procedure GetDetails(): Text
- var
- InStream: InStream;
- DetailsText: Text;
- begin
- CALCFIELDS(Details);
- Details.CREATEINSTREAM(InStream);
- InStream.READTEXT(DetailsText);
- EXIT(DetailsText);
- end;
-
- trigger OnInsert()
- var
- FeatureTelemetry: Codeunit "Feature Telemetry";
- begin
- FeatureTelemetry.LogUptake('0000H7U', 'WorldPay Payments Standard', Enum::"Feature Uptake Status"::Used);
- FeatureTelemetry.LogUsage('0000H7V', 'WorldPay Payments Standard', 'Transaction details set');
- end;
-#endif
}
diff --git a/Apps/W1/WorldPayPaymentsStandard/app/src/Permissions/D365BASICISVWorldPayPaymentsStandard.PermissionSetExt.al b/Apps/W1/WorldPayPaymentsStandard/app/src/Permissions/D365BASICISVWorldPayPaymentsStandard.PermissionSetExt.al
deleted file mode 100644
index 434e17bd54..0000000000
--- a/Apps/W1/WorldPayPaymentsStandard/app/src/Permissions/D365BASICISVWorldPayPaymentsStandard.PermissionSetExt.al
+++ /dev/null
@@ -1,8 +0,0 @@
-#if not CLEAN23
-permissionsetextension 30537 "D365 BASIC ISVWorldPay Payments Standard" extends "D365 BASIC ISV"
-{
- Permissions = tabledata "MS - WorldPay Standard Account" = RIMD,
- tabledata "MS - WorldPay Std. Template" = RIMD,
- tabledata "MS - WorldPay Transaction" = RIMD;
-}
-#endif
\ No newline at end of file
diff --git a/Apps/W1/WorldPayPaymentsStandard/app/src/Permissions/D365BASICWorldPayPaymentsStandard.PermissionSetExt.al b/Apps/W1/WorldPayPaymentsStandard/app/src/Permissions/D365BASICWorldPayPaymentsStandard.PermissionSetExt.al
deleted file mode 100644
index 0820000173..0000000000
--- a/Apps/W1/WorldPayPaymentsStandard/app/src/Permissions/D365BASICWorldPayPaymentsStandard.PermissionSetExt.al
+++ /dev/null
@@ -1,8 +0,0 @@
-#if not CLEAN23
-permissionsetextension 2160 "D365 BASICWorldPay Payments Standard" extends "D365 BASIC"
-{
- Permissions = tabledata "MS - WorldPay Standard Account" = RIMD,
- tabledata "MS - WorldPay Std. Template" = RIMD,
- tabledata "MS - WorldPay Transaction" = RIMD;
-}
-#endif
\ No newline at end of file
diff --git a/Apps/W1/WorldPayPaymentsStandard/app/src/Permissions/D365BUSFULLACCESSWorldPayPaymentsStandard.PermissionSetExt.al b/Apps/W1/WorldPayPaymentsStandard/app/src/Permissions/D365BUSFULLACCESSWorldPayPaymentsStandard.PermissionSetExt.al
deleted file mode 100644
index ca33c6ad89..0000000000
--- a/Apps/W1/WorldPayPaymentsStandard/app/src/Permissions/D365BUSFULLACCESSWorldPayPaymentsStandard.PermissionSetExt.al
+++ /dev/null
@@ -1,8 +0,0 @@
-#if not CLEAN23
-permissionsetextension 27130 "D365 BUS FULL ACCESSWorldPay Payments Standard" extends "D365 BUS FULL ACCESS"
-{
- Permissions = tabledata "MS - WorldPay Standard Account" = RIMD,
- tabledata "MS - WorldPay Std. Template" = RIMD,
- tabledata "MS - WorldPay Transaction" = RIMD;
-}
-#endif
\ No newline at end of file
diff --git a/Apps/W1/WorldPayPaymentsStandard/app/src/Permissions/D365BUSPREMIUMWorldPayPaymentsStandard.PermissionSetExt.al b/Apps/W1/WorldPayPaymentsStandard/app/src/Permissions/D365BUSPREMIUMWorldPayPaymentsStandard.PermissionSetExt.al
deleted file mode 100644
index 9e384c544c..0000000000
--- a/Apps/W1/WorldPayPaymentsStandard/app/src/Permissions/D365BUSPREMIUMWorldPayPaymentsStandard.PermissionSetExt.al
+++ /dev/null
@@ -1,8 +0,0 @@
-#if not CLEAN23
-permissionsetextension 46556 "D365 BUS PREMIUMWorldPay Payments Standard" extends "D365 BUS PREMIUM"
-{
- Permissions = tabledata "MS - WorldPay Standard Account" = RIMD,
- tabledata "MS - WorldPay Std. Template" = RIMD,
- tabledata "MS - WorldPay Transaction" = RIMD;
-}
-#endif
\ No newline at end of file
diff --git a/Apps/W1/WorldPayPaymentsStandard/app/src/Permissions/D365FULLACCESSWorldPayPaymentsStandard.PermissionSetExt.al b/Apps/W1/WorldPayPaymentsStandard/app/src/Permissions/D365FULLACCESSWorldPayPaymentsStandard.PermissionSetExt.al
deleted file mode 100644
index ea9a775dd5..0000000000
--- a/Apps/W1/WorldPayPaymentsStandard/app/src/Permissions/D365FULLACCESSWorldPayPaymentsStandard.PermissionSetExt.al
+++ /dev/null
@@ -1,8 +0,0 @@
-#if not CLEAN23
-permissionsetextension 59 "D365 FULL ACCESSWorldPay Payments Standard" extends "D365 FULL ACCESS"
-{
- Permissions = tabledata "MS - WorldPay Standard Account" = RIMD,
- tabledata "MS - WorldPay Std. Template" = RIMD,
- tabledata "MS - WorldPay Transaction" = RIMD;
-}
-#endif
\ No newline at end of file
diff --git a/Apps/W1/WorldPayPaymentsStandard/app/src/Permissions/D365READWorldPayPaymentsStandard.PermissionSetExt.al b/Apps/W1/WorldPayPaymentsStandard/app/src/Permissions/D365READWorldPayPaymentsStandard.PermissionSetExt.al
deleted file mode 100644
index ae54144f07..0000000000
--- a/Apps/W1/WorldPayPaymentsStandard/app/src/Permissions/D365READWorldPayPaymentsStandard.PermissionSetExt.al
+++ /dev/null
@@ -1,8 +0,0 @@
-#if not CLEAN23
-permissionsetextension 29920 "D365 READWorldPay Payments Standard" extends "D365 READ"
-{
- Permissions = tabledata "MS - WorldPay Standard Account" = R,
- tabledata "MS - WorldPay Std. Template" = R,
- tabledata "MS - WorldPay Transaction" = R;
-}
-#endif
\ No newline at end of file
diff --git a/Apps/W1/WorldPayPaymentsStandard/app/src/Permissions/D365TEAMMEMBERWorldPayPaymentsStandard.PermissionSetExt.al b/Apps/W1/WorldPayPaymentsStandard/app/src/Permissions/D365TEAMMEMBERWorldPayPaymentsStandard.PermissionSetExt.al
deleted file mode 100644
index 5c3a513cfe..0000000000
--- a/Apps/W1/WorldPayPaymentsStandard/app/src/Permissions/D365TEAMMEMBERWorldPayPaymentsStandard.PermissionSetExt.al
+++ /dev/null
@@ -1,8 +0,0 @@
-#if not CLEAN23
-permissionsetextension 23189 "D365 TEAM MEMBERWorldPay Payments Standard" extends "D365 TEAM MEMBER"
-{
- Permissions = tabledata "MS - WorldPay Standard Account" = RIMD,
- tabledata "MS - WorldPay Std. Template" = RIMD,
- tabledata "MS - WorldPay Transaction" = RIMD;
-}
-#endif
\ No newline at end of file
diff --git a/Apps/W1/WorldPayPaymentsStandard/app/src/Permissions/INTELLIGENTCLOUDWorldPayPaymentsStandard.PermissionSetExt.al b/Apps/W1/WorldPayPaymentsStandard/app/src/Permissions/INTELLIGENTCLOUDWorldPayPaymentsStandard.PermissionSetExt.al
deleted file mode 100644
index d3e8777cce..0000000000
--- a/Apps/W1/WorldPayPaymentsStandard/app/src/Permissions/INTELLIGENTCLOUDWorldPayPaymentsStandard.PermissionSetExt.al
+++ /dev/null
@@ -1,8 +0,0 @@
-#if not CLEAN23
-permissionsetextension 29510 "INTELLIGENT CLOUDWorldPay Payments Standard" extends "INTELLIGENT CLOUD"
-{
- Permissions = tabledata "MS - WorldPay Standard Account" = RIMD,
- tabledata "MS - WorldPay Std. Template" = RIMD,
- tabledata "MS - WorldPay Transaction" = RIMD;
-}
-#endif
\ No newline at end of file
diff --git a/Apps/W1/WorldPayPaymentsStandard/app/src/Permissions/WorldPayEdit.PermissionSet.al b/Apps/W1/WorldPayPaymentsStandard/app/src/Permissions/WorldPayEdit.PermissionSet.al
deleted file mode 100644
index b78ed5cb13..0000000000
--- a/Apps/W1/WorldPayPaymentsStandard/app/src/Permissions/WorldPayEdit.PermissionSet.al
+++ /dev/null
@@ -1,17 +0,0 @@
-#if not CLEAN23
-permissionset 29512 "WorldPay - Edit"
-{
- Assignable = false;
- Access = Public;
- Caption = 'WorldPayPaymentsStandard - Edit';
- ObsoleteReason = 'WorldPay Payments Standard extension is discontinued';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-
- IncludedPermissionSets = "WorldPay - Read";
-
- Permissions = tabledata "MS - WorldPay Standard Account" = IMD,
- tabledata "MS - WorldPay Std. Template" = IMD,
- tabledata "MS - WorldPay Transaction" = IMD;
-}
-#endif
\ No newline at end of file
diff --git a/Apps/W1/WorldPayPaymentsStandard/app/src/Permissions/WorldPayObjects.PermissionSet.al b/Apps/W1/WorldPayPaymentsStandard/app/src/Permissions/WorldPayObjects.PermissionSet.al
deleted file mode 100644
index b93f001f18..0000000000
--- a/Apps/W1/WorldPayPaymentsStandard/app/src/Permissions/WorldPayObjects.PermissionSet.al
+++ /dev/null
@@ -1,21 +0,0 @@
-#if not CLEAN23
-permissionset 29513 "WorldPay - Objects"
-{
- Assignable = false;
- Access = Public;
- Caption = 'WorldPayPaymentsStandard - Objects';
- ObsoleteReason = 'WorldPay Payments Standard extension is discontinued';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-
- Permissions = codeunit "MS - WorldPay Create Demo Data" = X,
- table "MS - WorldPay Standard Account" = X,
- codeunit "MS - WorldPay Standard Mgt." = X,
- page "MS - WorldPay Standard Setup" = X,
- codeunit "MS - WorldPay Standard Upgrade" = X,
- page "MS - WorldPay Std. Settings" = X,
- page "MS - WorldPay Std. Template" = X,
- table "MS - WorldPay Std. Template" = X,
- table "MS - WorldPay Transaction" = X;
-}
-#endif
\ No newline at end of file
diff --git a/Apps/W1/WorldPayPaymentsStandard/app/src/Permissions/WorldPayRead.PermissionSet.al b/Apps/W1/WorldPayPaymentsStandard/app/src/Permissions/WorldPayRead.PermissionSet.al
deleted file mode 100644
index 8944641ad6..0000000000
--- a/Apps/W1/WorldPayPaymentsStandard/app/src/Permissions/WorldPayRead.PermissionSet.al
+++ /dev/null
@@ -1,17 +0,0 @@
-#if not CLEAN23
-permissionset 29514 "WorldPay - Read"
-{
- Assignable = false;
- Access = Public;
- Caption = 'WorldPayPaymentsStandard - Read';
- ObsoleteReason = 'WorldPay Payments Standard extension is discontinued';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-
- IncludedPermissionSets = "WorldPay - Objects";
-
- Permissions = tabledata "MS - WorldPay Standard Account" = R,
- tabledata "MS - WorldPay Std. Template" = R,
- tabledata "MS - WorldPay Transaction" = R;
-}
-#endif
\ No newline at end of file
diff --git a/Apps/W1/WorldPayPaymentsStandard/test/src/MSWorldPayStandardTests.Codeunit.al b/Apps/W1/WorldPayPaymentsStandard/test/src/MSWorldPayStandardTests.Codeunit.al
deleted file mode 100644
index 9ee70cd356..0000000000
--- a/Apps/W1/WorldPayPaymentsStandard/test/src/MSWorldPayStandardTests.Codeunit.al
+++ /dev/null
@@ -1,1091 +0,0 @@
-#if not CLEAN23
-codeunit 139505 "MS - WorldPay Standard Tests"
-{
- // version Test,ERM,W1,AT,AU,BE,CA,CH,DE,DK,ES,FI,FR,GB,IS,IT,MX,NL,NO,NZ,SE,US
-
- Subtype = Test;
- TestPermissions = Disabled;
- ObsoleteReason = 'WorldPay Payments Standard extension is discontinued';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-
- trigger OnRun()
- begin
- end;
-
- var
- Assert: Codeunit "Assert";
- LibraryUtility: Codeunit "Library - Utility";
- LibraryVariableStorage: Codeunit "Library - Variable Storage";
- LibrarySales: Codeunit "Library - Sales";
- LibraryInventory: Codeunit "Library - Inventory";
- LibraryERM: Codeunit "Library - ERM";
- LibraryRandom: Codeunit "Library - Random";
- EnvironmentInfoTestLibrary: Codeunit "Environment Info Test Library";
- ActiveDirectoryMockEvents: Codeunit "Active Directory Mock Events";
- MSWorldPayStdMockEvents: Codeunit "MS - WorldPay Std Mock Events";
- Initialized: Boolean;
- UpdateOpenInvoicesManuallyTxt: Label 'A link for the WorldPay payment service will be included for new sales documents. To add it to existing sales documents, you must manually select it in the Payment Service field on the sales document.';
- ServiceNotSetupErr: Label 'You must specify an account ID for this payment service.';
- WorldPayStandardNameTxt: Label 'WorldPay Payments Standard';
- WorldPayStandardDescriptionTxt: Label 'Use the WorldPay Payments Standard service';
- NewTargetURLTxt: Label 'https://localhost:999/test?', Locked = true;
- NewLogoURLTxt: Label 'https://localhost:999/logo', Locked = true;
- SetToDefaultMsg: Label 'Settings have been set to default.';
- WorldPayAccountPrefixTxt: Label 'WorldPay';
- ThirdPartyNoticeMsg: Label 'This extension uses the WorldPay, a third-party provider.';
-
- local procedure Initialize()
- var
- CompanyInformation: Record "Company Information";
- MSWorldPayStandardAccount: Record "MS - WorldPay Standard Account";
- MSWorldPayTransaction: Record "MS - WorldPay Transaction";
- DummySalesHeader: Record "Sales Header";
- DummyPaymentMethod: Record "Payment Method";
- begin
- BindActiveDirectoryMockEvents();
-
- CompanyInformation.GET();
- CompanyInformation."Allow Blank Payment Info." := TRUE;
- CompanyInformation.MODIFY();
- CLEAR(LibraryVariableStorage);
-
- MSWorldPayStandardAccount.DELETEALL();
- MSWorldPayTransaction.DELETEALL();
- CreateDefaultTemplate();
-
- EnvironmentInfoTestLibrary.SetTestabilitySoftwareAsAService(FALSE);
-
- IF Initialized THEN
- EXIT;
-
- CreateSalesInvoice(DummySalesHeader, DummyPaymentMethod);
- SetupReportSelections();
- COMMIT();
-
- BINDSUBSCRIPTION(MSWorldPayStdMockEvents);
-
- Initialized := TRUE;
- end;
-
- [Test]
- [HandlerFunctions('AccountSetupPageModalPageHandler,ConfirmHandler,SelectPaymentServiceTypeHandler')]
- procedure TestCreateNewPaymentService()
- var
- ExpectedPaymentServiceSetup: Record "Payment Service Setup";
- PaymentServices: TestPage "Payment Services";
- ChangeValuesOnSetupPage: Boolean;
- Enabled: Boolean;
- AlwaysInclude: Boolean;
- EnableServiceWhenClosingCard: Boolean;
- begin
- // Setup
- Initialize();
-
- // Execute
- PaymentServices.OPENEDIT();
-
- ChangeValuesOnSetupPage := FALSE;
- Enabled := FALSE;
- AlwaysInclude := FALSE;
- EnableServiceWhenClosingCard := FALSE;
- LibraryVariableStorage.Enqueue(WorldPayStandardNameTxt);
- SetParametersToUpdateSetupPage(ChangeValuesOnSetupPage, '', '', Enabled, AlwaysInclude, '', '');
- LibraryVariableStorage.Enqueue(EnableServiceWhenClosingCard);
-
- PaymentServices.NewAction.INVOKE();
-
- // Verify
- ExpectedPaymentServiceSetup.INIT();
- ExpectedPaymentServiceSetup.Name := WorldPayStandardNameTxt;
- ExpectedPaymentServiceSetup.Description := WorldPayStandardDescriptionTxt;
- ExpectedPaymentServiceSetup.Enabled := Enabled;
- ExpectedPaymentServiceSetup."Always Include on Documents" := AlwaysInclude;
-
- PaymentServices.Filter.SetFilter(Name, ExpectedPaymentServiceSetup.Name);
- PaymentServices.First();
-
- VerifyPaymentServicePage(PaymentServices, ExpectedPaymentServiceSetup);
- end;
-
- [Test]
- procedure TestExistingPaymentServicesAreShownInTheList()
- var
- MSWorldPayStandardAccount: Record "MS - WorldPay Standard Account";
- ExpectedPaymentServiceSetup: Record "Payment Service Setup";
- PaymentServices: TestPage "Payment Services";
- begin
- // Setup
- Initialize();
- CreateWorldPayStandardAccount(MSWorldPayStandardAccount);
-
- // Execute
- PaymentServices.OPENEDIT();
-
- // Verify
- ExpectedPaymentServiceSetup.INIT();
- ExpectedPaymentServiceSetup.Name := MSWorldPayStandardAccount.Name;
- ExpectedPaymentServiceSetup.Description := MSWorldPayStandardAccount.Description;
- ExpectedPaymentServiceSetup.Enabled := FALSE;
- ExpectedPaymentServiceSetup."Always Include on Documents" := FALSE;
-
- PaymentServices.FILTER.SETFILTER(Name, ExpectedPaymentServiceSetup.Name);
- PaymentServices.FIRST();
-
- VerifyPaymentServicePage(PaymentServices, ExpectedPaymentServiceSetup);
- end;
-
- [Test]
- [HandlerFunctions('AccountSetupPageModalPageHandler,MessageHandler')]
- procedure TestSetupPaymentService()
- var
- MSWorldPayStandardAccount: Record "MS - WorldPay Standard Account";
- ExpectedMSWorldPayStandardAccount: Record "MS - WorldPay Standard Account";
- PaymentServices: TestPage "Payment Services";
- ChangeValuesOnSetupPage: Boolean;
- begin
- // Setup
- Initialize();
- CreateWorldPayStandardAccount(MSWorldPayStandardAccount);
-
- // Execute
- PaymentServices.OPENEDIT();
- PaymentServices.FILTER.SETFILTER(Name, WorldPayAccountPrefixTxt + '*');
- ChangeValuesOnSetupPage := TRUE;
- ExpectedMSWorldPayStandardAccount.COPY(MSWorldPayStandardAccount);
- ExpectedMSWorldPayStandardAccount.Enabled := TRUE;
- ExpectedMSWorldPayStandardAccount."Always Include on Documents" := TRUE;
- ExpectedMSWorldPayStandardAccount.Name := COPYSTR(LibraryUtility.GenerateRandomAlphabeticText(20, 0),
- 1, MAXSTRLEN(ExpectedMSWorldPayStandardAccount.Name));
- ExpectedMSWorldPayStandardAccount.Description :=
- COPYSTR(LibraryUtility.GenerateRandomText(MAXSTRLEN(MSWorldPayStandardAccount.Description)),
- 1, MAXSTRLEN(ExpectedMSWorldPayStandardAccount.Name));
- ExpectedMSWorldPayStandardAccount."Account ID" := COPYSTR(LibraryUtility.GenerateRandomAlphabeticText(20, 0),
- 1, MAXSTRLEN(ExpectedMSWorldPayStandardAccount."Account ID"));
- ExpectedMSWorldPayStandardAccount.SetTargetURL(NewTargetURLTxt);
-
- SetParametersToUpdateSetupPage(ChangeValuesOnSetupPage, ExpectedMSWorldPayStandardAccount.Name,
- ExpectedMSWorldPayStandardAccount.Description, ExpectedMSWorldPayStandardAccount.Enabled,
- ExpectedMSWorldPayStandardAccount."Always Include on Documents",
- ExpectedMSWorldPayStandardAccount."Account ID", NewTargetURLTxt);
- PaymentServices.Setup.INVOKE();
-
- // Verify
- MSWorldPayStandardAccount.GET(MSWorldPayStandardAccount."Primary Key");
- VerifyWorldPayAccountRecord(MSWorldPayStandardAccount, ExpectedMSWorldPayStandardAccount);
- end;
-
- [Test]
- [HandlerFunctions('AccountSetupPageModalPageHandler,ConfirmHandler')]
- procedure TestEnablingWhenClosingSetupPage()
- var
- MSWorldPayStandardAccount: Record "MS - WorldPay Standard Account";
- ExpectedMSWorldPayStandardAccount: Record "MS - WorldPay Standard Account";
- PaymentServices: TestPage "Payment Services";
- ChangeValuesOnSetupPage: Boolean;
- EnableServiceWhenClosingCard: Boolean;
- begin
- // Setup
- Initialize();
- CreateWorldPayStandardAccount(MSWorldPayStandardAccount);
-
- // Execute
- PaymentServices.OPENEDIT();
- PaymentServices.FILTER.SETFILTER(Name, WorldPayAccountPrefixTxt + '*');
- ChangeValuesOnSetupPage := TRUE;
- EnableServiceWhenClosingCard := TRUE;
-
- ExpectedMSWorldPayStandardAccount.INIT();
- ExpectedMSWorldPayStandardAccount.COPY(MSWorldPayStandardAccount);
- ExpectedMSWorldPayStandardAccount.Enabled := FALSE;
- ExpectedMSWorldPayStandardAccount."Account ID" := COPYSTR(LibraryUtility.GenerateRandomAlphabeticText(20, 0),
- 1, MAXSTRLEN(ExpectedMSWorldPayStandardAccount."Account ID"));
-
- SetParametersToUpdateSetupPage(ChangeValuesOnSetupPage, ExpectedMSWorldPayStandardAccount.Name,
- ExpectedMSWorldPayStandardAccount.Description, ExpectedMSWorldPayStandardAccount.Enabled,
- ExpectedMSWorldPayStandardAccount."Always Include on Documents",
- ExpectedMSWorldPayStandardAccount."Account ID", NewTargetURLTxt);
-
- LibraryVariableStorage.Enqueue(EnableServiceWhenClosingCard);
-
- PaymentServices.Setup.INVOKE();
-
- // Verify
- ExpectedMSWorldPayStandardAccount.Enabled := FALSE;
- MSWorldPayStandardAccount.GET(MSWorldPayStandardAccount."Primary Key");
- VerifyWorldPayAccountRecord(MSWorldPayStandardAccount, ExpectedMSWorldPayStandardAccount);
- end;
-
- [Test]
- procedure TestCannotEnableWithoutAccountID()
- var
- MSWorldPayStandardAccount: Record "MS - WorldPay Standard Account";
- begin
- // Setup
- Initialize();
- CreateWorldPayStandardAccount(MSWorldPayStandardAccount);
- MSWorldPayStandardAccount."Account ID" := '';
-
- // Verify
- ASSERTERROR MSWorldPayStandardAccount.VALIDATE(Enabled, TRUE);
- Assert.ExpectedError(ServiceNotSetupErr);
- end;
-
- [Test]
- procedure TestCannotBlankAccountIDWhenEnabled()
- var
- MSWorldPayStandardAccount: Record "MS - WorldPay Standard Account";
- begin
- // Setup
- Initialize();
- CreateWorldPayStandardAccount(MSWorldPayStandardAccount);
- EnableWorldPayStandardAccount(MSWorldPayStandardAccount);
-
- // Verify
- ASSERTERROR MSWorldPayStandardAccount.VALIDATE("Account ID", '');
- Assert.ExpectedError(ServiceNotSetupErr);
- end;
-
- [Test]
- [HandlerFunctions('AccountSetupPageModalPageHandler,ConfirmHandler,SelectPaymentServiceTypeHandler')]
- procedure TestEditWorldPayTemplate()
- var
- MSWorldPayStdTemplate: Record "MS - WorldPay Std. Template";
- ExpectedPaymentServiceSetup: Record "Payment Service Setup";
- MSWorldPayStandardMgt: Codeunit "MS - WorldPay Standard Mgt.";
- PaymentServices: TestPage "Payment Services";
- ChangeValuesOnSetupPage: Boolean;
- Enabled: Boolean;
- AlwaysInclude: Boolean;
- EnableServiceWhenClosingCard: Boolean;
- NewName: Text;
- NewDescription: Text;
- begin
- // Setup
- Initialize();
-
- // Execute
- ModifyWorldPayTemplate(NewName, NewDescription);
-
- MSWorldPayStandardMgt.GetTemplate(MSWorldPayStdTemplate);
-
- // Verify new template
- VerifyWorldPayTemplate(MSWorldPayStdTemplate, NewName, NewDescription, NewTargetURLTxt, NewLogoURLTxt);
-
- // Verify template gets applied
- ChangeValuesOnSetupPage := FALSE;
- AlwaysInclude := FALSE;
- Enabled := FALSE;
- EnableServiceWhenClosingCard := true;
- LibraryVariableStorage.Enqueue(NewName);
- SetParametersToUpdateSetupPage(ChangeValuesOnSetupPage, '', '', Enabled, AlwaysInclude, '', '');
- LibraryVariableStorage.Enqueue(EnableServiceWhenClosingCard);
-
- PaymentServices.OPENEDIT();
- PaymentServices.NewAction.INVOKE();
- PaymentServices.FILTER.SETFILTER(Name, NewName + '*');
-
- // Verify
- ExpectedPaymentServiceSetup.INIT();
- ExpectedPaymentServiceSetup.Name := MSWorldPayStdTemplate.Name;
- ExpectedPaymentServiceSetup.Enabled := Enabled;
- ExpectedPaymentServiceSetup.Description := MSWorldPayStdTemplate.Description;
- ExpectedPaymentServiceSetup."Always Include on Documents" := AlwaysInclude;
-
- VerifyPaymentServicePage(PaymentServices, ExpectedPaymentServiceSetup);
- end;
-
- [Test]
- [HandlerFunctions('MessageHandler,ConfirmHandler')]
- procedure TestResetToDefaultWorldPayTemplate()
- var
- MSWorldPayStdTemplate: Record "MS - WorldPay Std. Template";
- NewMSWorldPayStdTemplate: Record "MS - WorldPay Std. Template";
- MSWorldPayStandardMgt: Codeunit "MS - WorldPay Standard Mgt.";
- MSWorldPayStdTemplateSetupPage: TestPage "MS - WorldPay Std. Template";
- NewName: Text;
- NewDescription: Text;
- ExpectedTargetURL: Text;
- ExpectedLogoURL: Text;
- begin
- // Setup
- Initialize();
- MSWorldPayStandardMgt.GetTemplate(MSWorldPayStdTemplate);
- ModifyWorldPayTemplate(NewName, NewDescription);
-
- // Execute
- MSWorldPayStdTemplateSetupPage.OPENEDIT();
- LibraryVariableStorage.Enqueue(SetToDefaultMsg);
- MSWorldPayStdTemplateSetupPage.ResetToDefault.INVOKE();
-
- // Verify new template
- MSWorldPayStandardMgt.GetTemplate(NewMSWorldPayStdTemplate);
- ExpectedTargetURL := MSWorldPayStdTemplate.GetTargetURL();
- ExpectedLogoURL := MSWorldPayStdTemplate.GetLogoURL();
- VerifyWorldPayTemplate(
- NewMSWorldPayStdTemplate, MSWorldPayStdTemplate.Name, MSWorldPayStdTemplate.Description,
- ExpectedTargetURL, ExpectedLogoURL);
- end;
-
- [Test]
- [HandlerFunctions('MessageHandler,ConfirmHandler')]
- procedure TestResetToDefaultWorldPayTemplateInDemoCompany()
- var
- MSWorldPayStdTemplate: Record "MS - WorldPay Std. Template";
- NewMSWorldPayStdTemplate: Record "MS - WorldPay Std. Template";
- CompanyInformation: Record "Company Information";
- MSWorldPayStandardMgt: Codeunit "MS - WorldPay Standard Mgt.";
- MSWorldPayStdTemplateSetupPage: TestPage "MS - WorldPay Std. Template";
- NewName: Text;
- NewDescription: Text;
- ExpectedTargetURL: Text;
- ExpectedLogoURL: Text;
- begin
- // Setup
- Initialize();
-
- MSWorldPayStandardMgt.GetTemplate(MSWorldPayStdTemplate);
- ModifyWorldPayTemplate(NewName, NewDescription);
-
- CompanyInformation.GET();
- CompanyInformation."Demo Company" := TRUE;
- CompanyInformation.MODIFY();
-
- EnvironmentInfoTestLibrary.SetTestabilitySoftwareAsAService(TRUE);
-
- // Execute
- MSWorldPayStdTemplateSetupPage.OPENEDIT();
- LibraryVariableStorage.Enqueue(SetToDefaultMsg);
- MSWorldPayStdTemplateSetupPage.ResetToDefault.INVOKE();
-
- // Verify new template
- MSWorldPayStandardMgt.GetTemplate(NewMSWorldPayStdTemplate);
- ExpectedTargetURL := MSWorldPayStdTemplate.GetTargetURL();
- ExpectedLogoURL := MSWorldPayStdTemplate.GetLogoURL();
-
- Assert.AreEqual(1, STRPOS(ExpectedTargetURL, MSWorldPayStandardMgt.GetSandboxURL()), 'Wrong position for the target URL');
- VerifyWorldPayTemplate(
- NewMSWorldPayStdTemplate, MSWorldPayStdTemplate.Name, MSWorldPayStdTemplate.Description,
- ExpectedTargetURL, ExpectedLogoURL);
- end;
-
- [Test]
- procedure TestServiceConnectionListShowsDisabledPaymentServices()
- var
- MSWorldPayStandardAccount: Record "MS - WorldPay Standard Account";
- ServiceConnections: TestPage "Service Connections";
- begin
- Initialize();
-
- // Setup
- CreateWorldPayStandardAccount(MSWorldPayStandardAccount);
-
- // Execute
- ServiceConnections.OPENEDIT();
-
- // Verify
- VerifyPaymentServiceIsShownOnServiceConnectionsPage(ServiceConnections, MSWorldPayStandardAccount);
- end;
-
- [Test]
- procedure TestServiceConnectionListShowsEnabledPaymentServices()
- var
- MSWorldPayStandardAccount: Record "MS - WorldPay Standard Account";
- ServiceConnections: TestPage "Service Connections";
- begin
- Initialize();
-
- // Setup
- CreateWorldPayStandardAccount(MSWorldPayStandardAccount);
- EnableWorldPayStandardAccount(MSWorldPayStandardAccount);
-
- // Execute
- ServiceConnections.OPENEDIT();
-
- // Verify
- VerifyPaymentServiceIsShownOnServiceConnectionsPage(ServiceConnections, MSWorldPayStandardAccount);
- end;
-
- [Test]
- [HandlerFunctions('AccountSetupPageModalPageHandler,MessageHandler')]
- procedure TestServiceConnectionListOpensPaymentServicesSetupCard()
- var
- MSWorldPayStandardAccount: Record "MS - WorldPay Standard Account";
- ServiceConnections: TestPage "Service Connections";
- begin
- Initialize();
-
- // Setup
- CreateWorldPayStandardAccount(MSWorldPayStandardAccount);
- ServiceConnections.OPENEDIT();
- ServiceConnections.FILTER.SETFILTER(Name, MSWorldPayStandardAccount.Description);
- SetParametersToUpdateSetupPage(
- TRUE, MSWorldPayStandardAccount.Name, MSWorldPayStandardAccount.Description, TRUE, TRUE, MSWorldPayStandardAccount."Account ID",
- NewTargetURLTxt);
-
- // Execute
- ServiceConnections.Setup.INVOKE();
-
- // Verify
- MSWorldPayStandardAccount.Enabled := TRUE;
- MSWorldPayStandardAccount."Always Include on Documents" := TRUE;
- VerifyPaymentServiceIsShownOnServiceConnectionsPage(ServiceConnections, MSWorldPayStandardAccount);
- end;
-
- [Test]
- [HandlerFunctions('SelectPaymentServiceModalPageHandler')]
- procedure TestSelectingStandardWorldPayService()
- var
- MSWorldPayStandardAccount: Record "MS - WorldPay Standard Account";
- SalesHeader: Record "Sales Header";
- DummyPaymentMethod: Record "Payment Method";
- SalesInvoice: TestPage "Sales Invoice";
- NewAvailable: Boolean;
- begin
- // Setup
- Initialize();
- CreateWorldPayStandardAccount(MSWorldPayStandardAccount);
- EnableWorldPayStandardAccount(MSWorldPayStandardAccount);
-
- CreateSalesInvoice(SalesHeader, DummyPaymentMethod);
-
- // Execute
- SalesInvoice.OPENEDIT();
- SalesInvoice.GOTORECORD(SalesHeader);
-
- NewAvailable := TRUE;
- SetParametersToSelectPaymentService(
- FALSE, MSWorldPayStandardAccount.Name, MSWorldPayStandardAccount."Always Include on Documents", NewAvailable);
- SalesInvoice.SelectedPayments.ASSISTEDIT();
-
- // Verify
- Assert.AreEqual(MSWorldPayStandardAccount.Name, SalesInvoice.SelectedPayments.VALUE(), 'Wrong value was set');
- end;
-
- [Test]
- [HandlerFunctions('MessageHandler')]
- procedure TestOnlyOneAlwaysIncludedStandardWorldPayService()
- var
- MSWorldPayStandardAccount1: Record "MS - WorldPay Standard Account";
- MSWorldPayStandardAccount2: Record "MS - WorldPay Standard Account";
- MSWorldPayStandardAccount: Record "MS - WorldPay Standard Account";
- begin
- // Setup
- Initialize();
- CreateWorldPayStandardAccount(MSWorldPayStandardAccount1);
- EnableWorldPayStandardAccount(MSWorldPayStandardAccount1);
-
- CreateWorldPayStandardAccount(MSWorldPayStandardAccount2);
- EnableWorldPayStandardAccount(MSWorldPayStandardAccount2);
-
- // Execute
- LibraryVariableStorage.Enqueue(UpdateOpenInvoicesManuallyTxt);
- MSWorldPayStandardAccount1.VALIDATE("Always Include on Documents", TRUE);
- MSWorldPayStandardAccount1.MODIFY(TRUE);
-
- // Verify this is the one
- LibraryVariableStorage.Enqueue(UpdateOpenInvoicesManuallyTxt);
-#pragma warning disable AA0210
- MSWorldPayStandardAccount.SETRANGE("Always Include on Documents", TRUE);
-#pragma warning restore
- MSWorldPayStandardAccount.FINDFIRST();
- Assert.AreEqual(1, MSWorldPayStandardAccount.COUNT(), '');
-
- if MSWorldPayStandardAccount2.Get(MSWorldPayStandardAccount2."Primary Key") then;
- if MSWorldPayStandardAccount1.Get(MSWorldPayStandardAccount1."Primary Key") then;
- Assert.IsFalse(MSWorldPayStandardAccount2."Always Include on Documents", 'First Verify');
- Assert.IsTrue(MSWorldPayStandardAccount1."Always Include on Documents", 'First Verify');
-
- // Execute
- MSWorldPayStandardAccount2.VALIDATE("Always Include on Documents", TRUE);
- MSWorldPayStandardAccount2.MODIFY(TRUE);
-
- // Verify 2 is now the only one
- MSWorldPayStandardAccount.SETRANGE("Always Include on Documents", TRUE);
- MSWorldPayStandardAccount.FINDFIRST();
- Assert.AreEqual(1, MSWorldPayStandardAccount.COUNT(), '');
-
- if MSWorldPayStandardAccount2.Get(MSWorldPayStandardAccount2."Primary Key") then;
- if MSWorldPayStandardAccount1.Get(MSWorldPayStandardAccount1."Primary Key") then;
- Assert.IsTrue(MSWorldPayStandardAccount2."Always Include on Documents", 'Final Verify');
- Assert.IsFalse(MSWorldPayStandardAccount1."Always Include on Documents", 'Final Verify');
- end;
-
- [Test]
- [HandlerFunctions('EmailEditorHandler,MessageHandler,CloseEmailEditorHandler')]
- procedure TestCoverLetterPaymentLink();
- begin
- TestCoverLetterPaymentLinkInternal();
- end;
-
- procedure TestCoverLetterPaymentLinkInternal()
- var
- TempPaymentServiceSetup: Record "Payment Service Setup" temporary;
- MSWorldPayStandardAccount: Record "MS - WorldPay Standard Account";
- DummyPaymentMethod: Record "Payment Method";
- SalesInvoiceHeader: Record "Sales Invoice Header";
- TempPaymentReportingArgument: Record "Payment Reporting Argument" temporary;
- LibraryWorkflow: Codeunit "Library - Workflow";
- PostedSalesInvoice: TestPage "Posted Sales Invoice";
- begin
- Initialize();
-
- // Setup
- CreateDefaultWorldPayStandardAccount(MSWorldPayStandardAccount);
- MSWorldPayStandardAccount.SetTargetURL(NewTargetURLTxt);
- CreatePaymentMethod(DummyPaymentMethod, FALSE);
- CreateAndPostSalesInvoice(SalesInvoiceHeader, DummyPaymentMethod);
- TempPaymentServiceSetup.CreateReportingArgs(TempPaymentReportingArgument, SalesInvoiceHeader);
-
- TempPaymentReportingArgument.SetRange("Payment Service ID", TempPaymentReportingArgument.GetWorldPayServiceID());
- Assert.RecordIsNotEmpty(TempPaymentReportingArgument);
-
- PostedSalesInvoice.OPENEDIT();
- PostedSalesInvoice.GOTORECORD(SalesInvoiceHeader);
-
- LibraryWorkflow.SetUpEmailAccount();
-
- // Exercise
- PostedSalesInvoice.Email.INVOKE();
-
- // Verify
- VerifyBodyText(MSWorldPayStandardAccount, SalesInvoiceHeader);
- end;
-
- [Test]
- [HandlerFunctions('MessageHandler')]
- procedure TestYourReferenceIsIncludedInTheLink()
- var
- TempPaymentServiceSetup: Record "Payment Service Setup" temporary;
- MSWorldPayStandardAccount: Record "MS - WorldPay Standard Account";
- DummyPaymentMethod: Record "Payment Method";
- SalesInvoiceHeader: Record "Sales Invoice Header";
- SalesHeader: Record "Sales Header";
- TempPaymentReportingArgument: Record "Payment Reporting Argument" temporary;
- YourReference: Text[20];
- TargetURL: Text;
- begin
- Initialize();
-
- // Setup
- CreateDefaultWorldPayStandardAccount(MSWorldPayStandardAccount);
- CreatePaymentMethod(DummyPaymentMethod, FALSE);
- CreateSalesInvoice(SalesHeader, DummyPaymentMethod);
- YourReference := COPYSTR(LibraryUtility.GenerateRandomAlphabeticText(10, 1), 1, 10);
- SalesHeader.VALIDATE("Your Reference", YourReference);
- SalesHeader.MODIFY();
- PostSalesInvoice(SalesHeader, SalesInvoiceHeader);
-
- // Exercise
- TempPaymentServiceSetup.CreateReportingArgs(TempPaymentReportingArgument, SalesInvoiceHeader);
-
- // Verify
- TargetURL := TempPaymentReportingArgument.GetTargetURL();
- Assert.IsTrue(STRPOS(TargetURL, YourReference) > 0, 'Could not find the Your reference in the Target URL');
- end;
-
- [Test]
- [HandlerFunctions('AccountSetupPageModalPageHandler,ConfirmHandler,SelectPaymentServiceTypeHandler')]
- procedure TestTermsOfService()
- var
- MSWorldPayStdTemplate: Record "MS - WorldPay Std. Template";
- PaymentServices: TestPage "Payment Services";
- EnableServiceWhenClosingCard: Boolean;
- begin
- // Setup
- Initialize();
-
- // Execute
- PaymentServices.OPENEDIT();
- LibraryVariableStorage.Enqueue(WorldPayStandardNameTxt);
-
- SetParametersToUpdateSetupPage(FALSE, '', '', FALSE, FALSE, '', '');
- EnableServiceWhenClosingCard := FALSE;
- LibraryVariableStorage.Enqueue(EnableServiceWhenClosingCard);
-
- PaymentServices.NewAction.INVOKE();
- PaymentServices.FILTER.SETFILTER(Name, WorldPayAccountPrefixTxt + '*');
-
- // Verify
- MSWorldPayStdTemplate.FINDFIRST();
- Assert.AreNotEqual('', MSWorldPayStdTemplate."Terms of Service", 'Terms of service are not set on the template');
- Assert.AreEqual(
- MSWorldPayStdTemplate."Terms of Service", PaymentServices."Terms of Service".VALUE(),
- 'Terms of service are not set on the page');
- end;
-
- [Test]
- procedure TestInsertDemoWorldPayAccount()
- var
- MSWorldPayStdTemplate: Record "MS - WorldPay Std. Template";
- MSWorldPayStandardAccount: Record "MS - WorldPay Standard Account";
- CompanyInformation: Record "Company Information";
- MSWorldPayCreateDemoData: Codeunit "MS - WorldPay Create Demo Data";
- begin
- // Setup
- Initialize();
- MSWorldPayStdTemplate.DELETEALL();
-
- CompanyInformation.GET();
- CompanyInformation."Demo Company" := true;
- CompanyInformation.MODIFY();
-
- // Execute
- MSWorldPayCreateDemoData.InsertDemoDataAndUpgradeBurntIn();
-
- // Verify
- MSWorldPayStdTemplate.GET();
- MSWorldPayStdTemplate.CALCFIELDS("Target URL");
- Assert.IsTrue(
- STRPOS(LOWERCASE(MSWorldPayStdTemplate.GetTargetURL()), 'secure-test') > 0, 'URL should be pointing to SandBox account');
-
- Assert.AreEqual(1, MSWorldPayStandardAccount.COUNT(), 'There should be one account present');
- MSWorldPayStandardAccount.FINDFIRST();
- Assert.IsTrue(STRPOS(LOWERCASE(MSWorldPayStandardAccount.Name), 'sandbox') > 0, 'Name should contain SandBox in the name');
- Assert.AreEqual(TRUE, MSWorldPayStandardAccount."Always Include on Documents",
- 'Always include on documents should be set to true');
- end;
-
- [Test]
- [HandlerFunctions('MessageHandler')]
- procedure TestInsertDemoWorldPayAccountDoesNothingIfTheAccountExist()
- var
- MSWorldPayStdTemplate: Record "MS - WorldPay Std. Template";
- MSWorldPayStandardAccount: Record "MS - WorldPay Standard Account";
- CompanyInformation: Record "Company Information";
- begin
- Initialize();
-
- CompanyInformation.GET();
- CompanyInformation."Demo Company" := FALSE;
- CompanyInformation.MODIFY();
-
- // Setup
- CreateDefaultTemplate();
- CreateDefaultWorldPayStandardAccount(MSWorldPayStandardAccount);
-
- // Execute
- CODEUNIT.RUN(CODEUNIT::"MS - WorldPay Create Demo Data");
-
- // Verify
- MSWorldPayStdTemplate.GET();
- MSWorldPayStdTemplate.CALCFIELDS("Target URL");
- Assert.AreEqual(1, MSWorldPayStandardAccount.COUNT(), 'There should be one account present');
- Assert.IsTrue(
- STRPOS(LOWERCASE(MSWorldPayStdTemplate.GetTargetURL()), 'sandbox') = 0, 'URL should not be pointing to SandBox account');
-
- MSWorldPayStandardAccount.FINDFIRST();
- Assert.IsTrue(STRPOS(LOWERCASE(MSWorldPayStandardAccount.Name), 'sandbox') = 0, 'Name should not contain SandBox in the name');
- end;
-
- local procedure ModifyWorldPayTemplate(var NewName: Text; var NewDescription: Text)
- var
- MSWorldPayStandardSetup: TestPage "MS - WorldPay Standard Setup";
- MSWorldPayStdTemplate: TestPage "MS - WorldPay Std. Template";
- EnableServiceWhenClosingCard: Boolean;
- begin
-
- MSWorldPayStandardSetup.OPENEDIT();
- MSWorldPayStdTemplate.TRAP();
- MSWorldPayStandardSetup.SetupTemplate.INVOKE();
- EnableServiceWhenClosingCard := true;
- LibraryVariableStorage.Enqueue(EnableServiceWhenClosingCard);
-
- NewName := LibraryUtility.GenerateRandomAlphabeticText(20, 0);
- NewDescription := LibraryUtility.GenerateRandomAlphabeticText(20, 0);
-
- MSWorldPayStdTemplate.Name.SETVALUE(NewName);
- MSWorldPayStdTemplate.Description.SETVALUE(NewDescription);
- MSWorldPayStdTemplate.TargetURL.SETVALUE(NewTargetURLTxt);
- MSWorldPayStdTemplate.LogoURL.SETVALUE(NewLogoURLTxt);
- MSWorldPayStdTemplate.OK().INVOKE();
-
- MSWorldPayStandardSetup.CLOSE();
- end;
-
- local procedure SetParametersToUpdateSetupPage(UpdatePage: Boolean; NewName: Text; NewDescription: Text; Enabled: Boolean; AlwaysIncludeOnDocument: Boolean; AccountID: Text; TargetURL: Text)
- begin
- LibraryVariableStorage.Enqueue(UpdatePage);
-
- IF NOT UpdatePage THEN
- EXIT;
-
- LibraryVariableStorage.Enqueue(NewName);
- LibraryVariableStorage.Enqueue(NewDescription);
- LibraryVariableStorage.Enqueue(Enabled);
- LibraryVariableStorage.Enqueue(AlwaysIncludeOnDocument);
- LibraryVariableStorage.Enqueue(AccountID);
- LibraryVariableStorage.Enqueue(TargetURL);
-
- IF AlwaysIncludeOnDocument THEN
- LibraryVariableStorage.Enqueue(UpdateOpenInvoicesManuallyTxt);
-
- IF Enabled THEN
- LibraryVariableStorage.Enqueue(ThirdPartyNoticeMsg);
- end;
-
- local procedure SetParametersToSelectPaymentService(CancelDialog: Boolean; PaymentServiceName: Text; Available: Boolean; NewAvailable: Boolean)
- begin
- LibraryVariableStorage.Enqueue(CancelDialog);
- IF CancelDialog THEN
- EXIT;
-
- LibraryVariableStorage.Enqueue(PaymentServiceName);
- LibraryVariableStorage.Enqueue(Available);
- LibraryVariableStorage.Enqueue(NewAvailable);
- end;
-
- local procedure CreateWorldPayStandardAccount(var MSWorldPayStandardAccount: Record "MS - WorldPay Standard Account")
- var
- MSWorldPayStdTemplate: Record "MS - WorldPay Std. Template";
- MSWorldPayStandardMgt: Codeunit "MS - WorldPay Standard Mgt.";
- begin
- MSWorldPayStandardMgt.GetTemplate(MSWorldPayStdTemplate);
- MSWorldPayStandardAccount.INIT();
- MSWorldPayStandardAccount.TRANSFERFIELDS(MSWorldPayStdTemplate, FALSE);
- MSWorldPayStandardAccount.Name := COPYSTR(WorldPayAccountPrefixTxt + LibraryUtility.GenerateRandomAlphabeticText(30, 1),
- 1, MAXSTRLEN(MSWorldPayStandardAccount.Name));
- MSWorldPayStandardAccount.Description := COPYSTR(LibraryUtility.GenerateRandomAlphabeticText(30, 0),
- 1, MAXSTRLEN(MSWorldPayStandardAccount.Description));
- MSWorldPayStandardAccount."Account ID" := COPYSTR(LibraryUtility.GenerateRandomAlphabeticText(30, 0),
- 1, MAXSTRLEN(MSWorldPayStandardAccount."Account ID"));
- MSWorldPayStandardAccount.INSERT();
- end;
-
- local procedure EnableWorldPayStandardAccount(var MSWorldPayStandardAccount: Record "MS - WorldPay Standard Account")
- begin
- MSWorldPayStandardAccount.VALIDATE(Enabled, TRUE);
- MSWorldPayStandardAccount.MODIFY(TRUE);
- end;
-
- local procedure CreateDefaultWorldPayStandardAccount(var DefaultMSWorldPayStandardAccount: Record "MS - WorldPay Standard Account")
- begin
- CreateWorldPayStandardAccount(DefaultMSWorldPayStandardAccount);
- EnableWorldPayStandardAccount(DefaultMSWorldPayStandardAccount);
- LibraryVariableStorage.Enqueue(UpdateOpenInvoicesManuallyTxt);
- DefaultMSWorldPayStandardAccount.VALIDATE("Always Include on Documents", TRUE);
- DefaultMSWorldPayStandardAccount.MODIFY(TRUE);
- end;
-
- local procedure CreateAndPostSalesInvoice(var SalesInvoiceHeader: Record "Sales Invoice Header"; PaymentMethod: Record "Payment Method")
- var
- SalesHeader: Record "Sales Header";
- begin
- CreateSalesInvoice(SalesHeader, PaymentMethod);
- PostSalesInvoice(SalesHeader, SalesInvoiceHeader);
- end;
-
- local procedure PostSalesInvoice(var SalesHeader: Record "Sales Header"; var SalesInvoiceHeader: Record "Sales Invoice Header")
- begin
- SalesInvoiceHeader.SETAUTOCALCFIELDS(Closed);
- SalesInvoiceHeader.GET(LibrarySales.PostSalesDocument(SalesHeader, TRUE, TRUE));
- end;
-
- local procedure SetupReportSelections()
- var
- ReportLayoutList: Record "Report Layout List";
- ReportSelections: Record "Report Selections";
- begin
- ReportSelections.DELETEALL();
- CreateDefaultReportSelection();
-
- GetEmailBodyLayout(ReportLayoutList);
-
- ReportSelections.Reset();
- ReportSelections.SetRange(Usage, ReportSelections.Usage::"S.Invoice");
- ReportSelections.FINDFIRST();
- ReportSelections.VALIDATE("Use for Email Attachment", TRUE);
- ReportSelections.VALIDATE("Use for Email Body", TRUE);
- ReportSelections.VALIDATE("Email Body Layout Name", ReportLayoutList.Name);
- ReportSelections.MODIFY();
- end;
-
- local procedure CreateDefaultReportSelection()
- var
- ReportSelections: Record "Report Selections";
- begin
- ReportSelections.INIT();
- ReportSelections.Usage := ReportSelections.Usage::"S.Invoice";
- ReportSelections.Sequence := '1';
- ReportSelections."Report ID" := REPORT::"Standard Sales - Invoice";
- ReportSelections.INSERT();
- end;
-
- local procedure GetReportID(): Integer
- begin
- EXIT(REPORT::"Standard Sales - Invoice");
- end;
-
- local procedure GetEmailBodyLayout(var ReportLayoutList: Record "Report Layout List")
- begin
- ReportLayoutList.SETRANGE("Report ID", GetReportID());
- ReportLayoutList.SETRANGE("Layout Format", ReportLayoutList."Layout Format"::Word);
- ReportLayoutList.SETFILTER(Name, '''@*Email*''');
- ReportLayoutList.FINDLAST();
- end;
-
- local procedure CreateSalesInvoice(var SalesHeader: Record "Sales Header"; PaymentMethod: Record "Payment Method")
- var
- SalesLine: Record "Sales Line";
- VATPostingSetup: Record "VAT Posting Setup";
- begin
- LibraryERM.FindVATPostingSetup(VATPostingSetup, VATPostingSetup."VAT Calculation Type"::"Normal VAT");
- LibrarySales.CreateSalesHeader(
- SalesHeader, SalesHeader."Document Type"::Invoice, CreateCustomer(VATPostingSetup."VAT Bus. Posting Group"));
- SalesHeader.VALIDATE("Payment Method Code", PaymentMethod.Code);
- SalesHeader.SetDefaultPaymentServices();
- SalesHeader.MODIFY(TRUE);
-
- LibrarySales.CreateSalesLine(
- SalesLine,
- SalesHeader, SalesLine.Type::Item,
- CreateItem(VATPostingSetup."VAT Prod. Posting Group"),
- 1);
- end;
-
- local procedure CreateCustomer(VATBusPostingGroup: Code[20]): Code[20]
- var
- Customer: Record "Customer";
- begin
- LibrarySales.CreateCustomer(Customer);
- Customer.VALIDATE("VAT Bus. Posting Group", VATBusPostingGroup);
- Customer.MODIFY(TRUE);
- EXIT(Customer."No.");
- end;
-
- local procedure CreateItem(VATProdPostingGroup: Code[20]): Code[20]
- var
- Item: Record "Item";
- begin
- LibraryInventory.CreateItem(Item);
- Item.VALIDATE("VAT Prod. Posting Group", VATProdPostingGroup);
- Item.VALIDATE("Unit Price", 1000 + LibraryRandom.RandDec(100, 2));
- Item.VALIDATE("Last Direct Cost", Item."Unit Price");
- Item.MODIFY(TRUE);
- EXIT(Item."No.");
- end;
-
- local procedure CreatePaymentMethod(var PaymentMethod: Record "Payment Method"; SetBalancingAccount: Boolean)
- begin
- LibraryERM.CreatePaymentMethod(PaymentMethod);
- IF SetBalancingAccount THEN BEGIN
- PaymentMethod."Bal. Account Type" := PaymentMethod."Bal. Account Type"::"G/L Account";
- PaymentMethod."Bal. Account No." := LibraryERM.CreateGLAccountNo();
- PaymentMethod.MODIFY(TRUE);
- END;
- end;
-
- local procedure CreateDefaultTemplate()
- var
- MSWorldPayStdTemplate: Record "MS - WorldPay Std. Template";
- MSWorldPayStandardMgt: Codeunit "MS - WorldPay Standard Mgt.";
- begin
- MSWorldPayStdTemplate.DELETEALL();
-
- MSWorldPayStdTemplate.INIT();
- MSWorldPayStdTemplate.INSERT();
- MSWorldPayStandardMgt.TemplateAssignDefaultValues(MSWorldPayStdTemplate);
- CLEAR(MSWorldPayStdTemplate."Logo URL");
- MSWorldPayStdTemplate.MODIFY();
- end;
-
- local procedure VerifyPaymentServicePage(PaymentServices: TestPage "Payment Services"; ExpectedPaymentServiceSetup: Record "Payment Service Setup")
- begin
- Assert.AreEqual(ExpectedPaymentServiceSetup.Name, PaymentServices.Name.VALUE(), 'Wrong value set for Name');
- Assert.AreEqual(ExpectedPaymentServiceSetup.Description, PaymentServices.Description.VALUE(), 'Wrong value set for Description');
- Assert.AreEqual(ExpectedPaymentServiceSetup.Enabled, PaymentServices.Enabled.ASBOOLEAN(), 'Wrong value set for Enabled');
- Assert.AreEqual(
- ExpectedPaymentServiceSetup."Always Include on Documents", PaymentServices."Always Include on Documents".ASBOOLEAN(),
- 'Wrong value set for Always Include on Documents');
- end;
-
- local procedure VerifyWorldPayAccountRecord(MSWorldPayStandardAccount: Record "MS - WorldPay Standard Account"; ExpectedMSWorldPayStandardAccount: Record "MS - WorldPay Standard Account")
- var
- ExpectedTargetURL: Text;
- ActualTargetURL: Text;
- begin
- Assert.AreEqual(ExpectedMSWorldPayStandardAccount.Name, MSWorldPayStandardAccount.Name, 'Wrong value set for Name');
- Assert.AreEqual(
- ExpectedMSWorldPayStandardAccount.Description, MSWorldPayStandardAccount.Description, 'Wrong value set for Description');
- Assert.AreEqual(ExpectedMSWorldPayStandardAccount.Enabled, MSWorldPayStandardAccount.Enabled, 'Wrong value set for Enabled');
- Assert.AreEqual(
- ExpectedMSWorldPayStandardAccount."Always Include on Documents", MSWorldPayStandardAccount."Always Include on Documents",
- 'Wrong value set for Always Include on Documents');
- Assert.AreEqual(
- ExpectedMSWorldPayStandardAccount."Account ID", MSWorldPayStandardAccount."Account ID", 'Wrong value set for Account ID');
-
- ExpectedTargetURL := ExpectedMSWorldPayStandardAccount.GetTargetURL();
- ActualTargetURL := MSWorldPayStandardAccount.GetTargetURL();
- Assert.AreEqual(ExpectedTargetURL, ActualTargetURL, 'Wrong value set for Always Include on Documents');
- end;
-
- local procedure VerifyWorldPayTemplate(MSWorldPayStdTemplate: Record "MS - WorldPay Std. Template"; NewName: Text; NewDescription: Text; ExpectedTargetURL: Text; ExpectedLogoURL: Text)
- var
- ActualTargetURL: Text;
- ActualLogoURL: Text;
- begin
- Assert.AreEqual(NewName, MSWorldPayStdTemplate.Name, 'Wrong value set for Name');
- Assert.AreEqual(NewDescription, MSWorldPayStdTemplate.Description, 'Wrong value set for Description');
-
- ActualTargetURL := MSWorldPayStdTemplate.GetTargetURL();
- Assert.AreEqual(ExpectedTargetURL, ActualTargetURL, 'Wrong value set for target URL');
-
- ActualLogoURL := MSWorldPayStdTemplate.GetLogoURL();
- Assert.AreEqual(ExpectedLogoURL, ActualLogoURL, 'Wrong value set for Logo URL Txt');
- end;
-
- local procedure VerifyPaymentServiceIsShownOnServiceConnectionsPage(var ServiceConnections: TestPage "Service Connections"; MSWorldPayStandardAccount: Record "MS - WorldPay Standard Account")
- var
- ServiceConnection: Record "Service Connection";
- begin
- ServiceConnections.FILTER.SETFILTER(Name, MSWorldPayStandardAccount.Description);
-
- Assert.AreEqual(
- MSWorldPayStandardAccount.Description, ServiceConnections.Name.VALUE(),
- 'Description was not set correctly on Service Connections page');
-
- IF MSWorldPayStandardAccount.Enabled THEN
- Assert.AreEqual(
- FORMAT(ServiceConnection.Status::Enabled), ServiceConnections.Status.VALUE(),
- 'Status was not set correctly on Service Connections page')
- ELSE
- Assert.AreEqual(
- FORMAT(ServiceConnection.Status::Disabled), ServiceConnections.Status.VALUE(),
- 'Status was not set correctly on Service Connections page');
- end;
-
- local procedure VerifyBodyText(MSWorldPayStandardAccount: Record "MS - WorldPay Standard Account"; SalesInvoiceHeader: Record "Sales Invoice Header")
- var
- GeneralLedgerSetup: Record "General Ledger Setup";
- BaseURL: Text;
- BodyHTMLText: Text;
- begin
- BaseURL := MSWorldPayStandardAccount.GetTargetURL();
- SalesInvoiceHeader.CALCFIELDS("Amount Including VAT");
- BodyHTMLText := LibraryVariableStorage.DequeueText();
- Assert.IsTrue(STRPOS(BodyHTMLText, BaseURL) > 0, 'Base url was not set correctly');
- Assert.IsTrue(STRPOS(BodyHTMLText, SalesInvoiceHeader."No.") > 0, 'Document No. was not set correctly');
- Assert.IsTrue(STRPOS(BodyHTMLText, MSWorldPayStandardAccount."Account ID") > 0, 'Account ID was not set correctly');
- Assert.IsTrue(
- STRPOS(BodyHTMLText, FORMAT(SalesInvoiceHeader."Amount Including VAT", 0, 9)) > 0, 'Total amount was not set correctly');
-
- GeneralLedgerSetup.GET();
- Assert.IsTrue(
- STRPOS(BodyHTMLText, GeneralLedgerSetup.GetCurrencyCode(SalesInvoiceHeader."Currency Code")) > 0,
- 'Currency Code was not set correctly');
- end;
-
- [ModalPageHandler]
- procedure AccountSetupPageModalPageHandler(var MSWorldPayStandardSetup: TestPage "MS - WorldPay Standard Setup")
- var
- NewName: Text;
- NewDescription: Text;
- AccountID: Text;
- TargetURL: Text;
- Enabled: Boolean;
- AlwaysIncludeOnDocument: Boolean;
- UpdatePage: Boolean;
- begin
- UpdatePage := LibraryVariableStorage.DequeueBoolean();
-
- IF NOT UpdatePage THEN
- EXIT;
-
- NewName := LibraryVariableStorage.DequeueText();
- NewDescription := LibraryVariableStorage.DequeueText();
- Enabled := LibraryVariableStorage.DequeueBoolean();
- AlwaysIncludeOnDocument := LibraryVariableStorage.DequeueBoolean();
- AccountID := LibraryVariableStorage.DequeueText();
- TargetURL := LibraryVariableStorage.DequeueText();
-
- MSWorldPayStandardSetup.Name.SETVALUE(NewName);
- MSWorldPayStandardSetup.Description.SETVALUE(NewDescription);
- MSWorldPayStandardSetup."Account ID".SETVALUE(AccountID);
- MSWorldPayStandardSetup."Always Include on Documents".SETVALUE(AlwaysIncludeOnDocument);
- MSWorldPayStandardSetup.Enabled.SETVALUE(Enabled);
- MSWorldPayStandardSetup.TargetURL.SETVALUE(TargetURL);
- MSWorldPayStandardSetup.OK().INVOKE();
- end;
-
- [ModalPageHandler]
- procedure SelectPaymentServiceModalPageHandler(var SelectPaymentService: TestPage 1061)
- var
- CancelDialog: Boolean;
- RowFound: Boolean;
- PaymentServiceName: Text;
- ExpectedAvailable: Boolean;
- NewAvailable: Boolean;
- begin
- CancelDialog := LibraryVariableStorage.DequeueBoolean();
-
- IF CancelDialog THEN BEGIN
- SelectPaymentService.Cancel().INVOKE();
- EXIT;
- END;
-
- PaymentServiceName := LibraryVariableStorage.DequeueText();
- ExpectedAvailable := LibraryVariableStorage.DequeueBoolean();
- NewAvailable := LibraryVariableStorage.DequeueBoolean();
-
- SelectPaymentService.First();
- RowFound := FALSE;
-
- REPEAT
- IF SelectPaymentService.Name.VALUE() = PaymentServiceName THEN BEGIN
- RowFound := TRUE;
- Assert.AreEqual(ExpectedAvailable, SelectPaymentService.Available.ASBOOLEAN(), 'Available was not set correctly');
- SelectPaymentService.Available.SETVALUE(NewAvailable);
- END ELSE
- SelectPaymentService.Available.SETVALUE(NOT NewAvailable);
- UNTIL (NOT SelectPaymentService.Next() OR RowFound);
-
- Assert.IsTrue(RowFound, 'Row was not found on the page');
-
- SelectPaymentService.OK().INVOKE();
- end;
-
- [ConfirmHandler]
- procedure ConfirmHandler(Question: Text[1024]; var Reply: Boolean)
- begin
- Reply := LibraryVariableStorage.DequeueBoolean();
- end;
-
- [MessageHandler]
- procedure MessageHandler(Message: Text[1024])
- begin
- Assert.ExpectedMessage(LibraryVariableStorage.DequeueText(), Message);
- end;
-
- [ModalPageHandler]
- procedure EmailEditorHandler(var EmailEditor: TestPage "Email Editor");
- begin
- LibraryVariableStorage.Enqueue(EmailEditor.BodyField.Value());
- end;
-
- [StrMenuHandler]
- procedure CloseEmailEditorHandler(Options: Text[1024]; var Choice: Integer; Instruction: Text[1024])
- begin
- Choice := 1;
- end;
-
- [ModalPageHandler]
- procedure SelectPaymentServiceTypeHandler(var SelectPaymentServiceType: TestPage 1062)
- var
- ServiceName: Text;
- begin
- ServiceName := LibraryVariableStorage.DequeueText();
- SelectPaymentServiceType.FILTER.SETFILTER(Name, ServiceName);
- SelectPaymentServiceType.FIRST();
- SelectPaymentServiceType.OK().INVOKE();
- end;
-
- local procedure BindActiveDirectoryMockEvents()
- begin
- IF ActiveDirectoryMockEvents.Enabled() THEN
- EXIT;
- BINDSUBSCRIPTION(ActiveDirectoryMockEvents);
- ActiveDirectoryMockEvents.Enable();
- end;
-}
-
-#endif
\ No newline at end of file
diff --git a/Apps/W1/WorldPayPaymentsStandard/test/src/MSWorldPayStdMockEvents.Codeunit.al b/Apps/W1/WorldPayPaymentsStandard/test/src/MSWorldPayStdMockEvents.Codeunit.al
deleted file mode 100644
index c8eda3e6a8..0000000000
--- a/Apps/W1/WorldPayPaymentsStandard/test/src/MSWorldPayStdMockEvents.Codeunit.al
+++ /dev/null
@@ -1,25 +0,0 @@
-#if not CLEAN23
-codeunit 139506 "MS - WorldPay Std Mock Events"
-{
- // version Test,ERM,W1,AT,AU,BE,CA,CH,DE,DK,ES,FI,FR,GB,IS,IT,MX,NL,NO,NZ,SE,US
-
- EventSubscriberInstance = Manual;
- ObsoleteReason = 'WorldPay Payments Standard extension is discontinued';
- ObsoleteState = Pending;
- ObsoleteTag = '23.0';
-
- var
- LibraryUtility: Codeunit "Library - Utility";
-
- [EventSubscriber(ObjectType::Table, Database::"Payment Service Setup", 'OnRegisterPaymentServiceProviders', '', false, false)]
- local procedure RegisterDummyPaymentServiceProvider(var PaymentServiceSetup: Record 1060);
- begin
- CLEAR(PaymentServiceSetup);
-
- PaymentServiceSetup.Name := COPYSTR(LibraryUtility.GenerateRandomAlphabeticText(20, 0),
- 1, MAXSTRLEN(PaymentServiceSetup.Name));
- PaymentServiceSetup.AssignPrimaryKey(PaymentServiceSetup);
- PaymentServiceSetup.INSERT(TRUE);
- end;
-}
-#endif
diff --git a/Build/Packages.json b/Build/Packages.json
index 04ef9e52ab..ff39f1731a 100644
--- a/Build/Packages.json
+++ b/Build/Packages.json
@@ -4,7 +4,7 @@
"Source": "NuGet.org"
},
"AppBaselines-BCArtifacts": {
- "Version": "25.0.23364.23971",
+ "Version": "25.1.24079",
"Source": "BCArtifacts",
"_comment": "Used to fetch app baselines from BC artifacts"
}
diff --git a/Build/projects/1st Party Apps (W1)/.AL-Go/settings.json b/Build/projects/1st Party Apps (W1)/.AL-Go/settings.json
index af792f7ccf..5003063be8 100644
--- a/Build/projects/1st Party Apps (W1)/.AL-Go/settings.json
+++ b/Build/projects/1st Party Apps (W1)/.AL-Go/settings.json
@@ -2,6 +2,7 @@
"projectName": "1st Party Apps (W1)",
"appFolders": [
"..\\..\\..\\Apps\\W1\\*\\app",
+ "..\\..\\..\\Apps\\W1\\*\\*\\app",
"..\\..\\..\\Apps\\W1\\ClientAddIns",
"..\\..\\..\\Apps\\W1\\MicrosoftUniversalPrint",
"..\\..\\..\\Apps\\W1\\SendToEmailPrinter",
diff --git a/Build/projects/1st Party Apps Tests (W1)/.AL-Go/settings.json b/Build/projects/1st Party Apps Tests (W1)/.AL-Go/settings.json
index c881920bd0..634b19ade0 100644
--- a/Build/projects/1st Party Apps Tests (W1)/.AL-Go/settings.json
+++ b/Build/projects/1st Party Apps Tests (W1)/.AL-Go/settings.json
@@ -2,6 +2,8 @@
"projectName": "1st Party Apps Tests (W1)",
"testFolders": [
"..\\..\\..\\Apps\\W1\\*\\test",
- "..\\..\\..\\Apps\\W1\\*\\test library"
+ "..\\..\\..\\Apps\\W1\\*\\test library",
+ "..\\..\\..\\Apps\\W1\\*\\*\\test",
+ "..\\..\\..\\Apps\\W1\\*\\*\\test library"
]
}