diff --git a/.github/AL-Go-Settings.json b/.github/AL-Go-Settings.json
index d2c8583a56..39243608df 100644
--- a/.github/AL-Go-Settings.json
+++ b/.github/AL-Go-Settings.json
@@ -6,7 +6,7 @@
"runs-on": "windows-latest",
"cacheImageName": "",
"UsePsSession": false,
- "artifact": "https://bcinsider-fvh2ekdjecfjd6gk.b02.azurefd.net/sandbox/28.0.43307.0/base",
+ "artifact": "https://bcinsider-fvh2ekdjecfjd6gk.b02.azurefd.net/sandbox/28.0.43704.0/base",
"country": "base",
"useProjectDependencies": true,
"repoVersion": "28.0",
diff --git a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/AltCustVATRegImplCZZ.Codeunit.al b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/AltCustVATRegImplCZZ.Codeunit.al
index f409706100..c5b2fbfe94 100644
--- a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/AltCustVATRegImplCZZ.Codeunit.al
+++ b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/AltCustVATRegImplCZZ.Codeunit.al
@@ -32,6 +32,9 @@ codeunit 11732 "Alt. Cust. VAT Reg. Impl. CZZ" implements "Alt. Cust. VAT Reg. A
DontShowMsg: Label 'Don''t show';
AddAltCustVATRegNotificationNameTok: Label 'Suggest an alternative customer VAT registration from sales advance letter';
AddAltCustVATRegNotificationDescTok: Label 'Suggest the user to add an alternative customer VAT registration when choosing a VAT country different from the customer''s';
+ DiffVATRegNoMsg: Label 'The VAT Registration No. in the sales advance letter is different than the one in the document.';
+ DiffVATRegNoNotificationNameTxt: Label 'Different VAT Registration No. in sales advance letter';
+ DiffVATRegNoNotificationDescriptionTxt: Label 'Warn if VAT Registration No. in sales advance letter is different than in the document.';
procedure Init(var SalesAdvLetterHeaderCZZ: Record "Sales Adv. Letter Header CZZ"; xSalesAdvLetterHeaderCZZ: Record "Sales Adv. Letter Header CZZ")
begin
@@ -276,6 +279,32 @@ codeunit 11732 "Alt. Cust. VAT Reg. Impl. CZZ" implements "Alt. Cust. VAT Reg. A
exit('34c4fa1d-07b6-450b-b524-0d367b1e6221')
end;
+ procedure ThrowDiffVATRegNoNotification()
+ var
+ MyNotifications: Record "My Notifications";
+ Notification: Notification;
+ begin
+ if not MyNotifications.IsEnabled(DiffVATRegNoNotificationId()) then
+ exit;
+ Notification.Id(DiffVATRegNoNotificationId());
+ Notification.Message(DiffVATRegNoMsg);
+ Notification.AddAction(DontShowMsg, Codeunit::"Alt. Cust. VAT Reg. Impl. CZZ", 'DisableDiffVATRegNoNotification');
+ Notification.Send();
+ end;
+
+ procedure DisableDiffVATRegNoNotification(Notification: Notification)
+ var
+ MyNotifications: Record "My Notifications";
+ begin
+ if not MyNotifications.Disable(Notification.Id()) then
+ MyNotifications.InsertDefault(Notification.Id(), DiffVATRegNoNotificationNameTxt, DiffVATRegNoNotificationDescriptionTxt, false);
+ end;
+
+ local procedure DiffVATRegNoNotificationId(): Text
+ begin
+ exit('150bf347-91ac-4e52-8520-e8024bf08e4c');
+ end;
+
[IntegrationEvent(false, false)]
local procedure OnAfterBuildFieldChangeBuffer(var TempChangeLogEntry: Record "Change Log Entry" temporary; SalesAdvLetterHeaderCZZ: Record "Sales Adv. Letter Header CZZ");
begin
diff --git a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/InstallApplicationCZZ.Codeunit.al b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/InstallApplicationCZZ.Codeunit.al
index f1d101c035..ec14f09600 100644
--- a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/InstallApplicationCZZ.Codeunit.al
+++ b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/InstallApplicationCZZ.Codeunit.al
@@ -11,11 +11,13 @@ using Microsoft.CashFlow.Forecast;
using Microsoft.CashFlow.Setup;
using Microsoft.CashFlow.Worksheet;
using Microsoft.EServices.EDocument;
+using Microsoft.Finance.CashDesk;
using Microsoft.Finance.FinancialReports;
using Microsoft.Finance.GeneralLedger.Journal;
using Microsoft.Finance.VAT.Ledger;
using Microsoft.Finance.VAT.Reporting;
using Microsoft.Finance.VAT.Setup;
+using Microsoft.Foundation.AuditCodes;
using Microsoft.Foundation.Company;
using Microsoft.Foundation.Reporting;
using Microsoft.Purchases.History;
@@ -23,7 +25,6 @@ using Microsoft.Purchases.Payables;
using Microsoft.Sales.History;
using Microsoft.Sales.Receivables;
using System.Upgrade;
-using Microsoft.Finance.CashDesk;
#pragma warning disable AL0432
codeunit 31087 "Install Application CZZ"
@@ -57,6 +58,8 @@ codeunit 31087 "Install Application CZZ"
var
InstallApplicationsMgtCZL: Codeunit "Install Applications Mgt. CZL";
AppInfo: ModuleInfo;
+ CloseAdvanceSourceCodeTxt: Label 'CLADVANCE', MaxLength = 10;
+ CloseAdvanceSourceCodeDescriptionTxt: Label 'Close Advance Letter', MaxLength = 100;
trigger OnInstallAppPerCompany()
begin
@@ -80,6 +83,7 @@ codeunit 31087 "Install Application CZZ"
CopyVendorLedgerEntries();
MoveIncomingDocument();
ModifyReportSelections();
+ InitSourceCodeSetup();
end;
local procedure CopyCustomerLedgerEntries()
@@ -203,6 +207,7 @@ codeunit 31087 "Install Application CZZ"
begin
InitAdvancePaymentsReportSelections();
ModifyReportSelections();
+ CreateSourceCodeSetup();
DataClassEvalHandlerCZZ.ApplyEvaluationClassificationsForPrivacy();
UpgradeTag.SetAllUpgradeTags();
@@ -217,4 +222,48 @@ codeunit 31087 "Install Application CZZ"
ReportSelectionHandlerCZZ.InsertRepSelection(Enum::"Report Selection Usage"::"Sales Advance Letter CZZ", '1', Report::"Sales - Advance Letter CZZ");
ReportSelectionHandlerCZZ.InsertRepSelection(Enum::"Report Selection Usage"::"Sales Advance VAT Document CZZ", '1', Report::"Sales - Advance VAT Doc. CZZ");
end;
+
+ local procedure CreateSourceCodeSetup()
+ var
+ SourceCodeSetup: Record "Source Code Setup";
+ PrevSourceCodeSetup: Record "Source Code Setup";
+ begin
+ if not SourceCodeSetup.Get() then
+ exit;
+ PrevSourceCodeSetup := SourceCodeSetup;
+ if SourceCodeSetup."Close Advance Letter CZZ" = '' then
+ InsertSourceCode(SourceCodeSetup."Close Advance Letter CZZ", CloseAdvanceSourceCodeTxt, CloseAdvanceSourceCodeDescriptionTxt);
+
+ if SourceCodeSetup."Close Advance Letter CZZ" <> PrevSourceCodeSetup."Close Advance Letter CZZ" then
+ SourceCodeSetup.Modify();
+ end;
+
+ local procedure InitSourceCodeSetup()
+ var
+ SourceCodeSetup: Record "Source Code Setup";
+ PrevSourceCodeSetup: Record "Source Code Setup";
+ begin
+ if not SourceCodeSetup.Get() then begin
+ SourceCodeSetup.Init();
+ SourceCodeSetup.Insert();
+ end;
+ PrevSourceCodeSetup := SourceCodeSetup;
+ InsertSourceCode(SourceCodeSetup."Close Advance Letter CZZ", CloseAdvanceSourceCodeTxt, CloseAdvanceSourceCodeDescriptionTxt);
+
+ if SourceCodeSetup."Close Advance Letter CZZ" <> PrevSourceCodeSetup."Close Advance Letter CZZ" then
+ SourceCodeSetup.Modify();
+ end;
+
+ local procedure InsertSourceCode(var SourceCodeDefCode: Code[10]; "Code": Code[10]; Description: Text[100])
+ var
+ SourceCode: Record "Source Code";
+ begin
+ SourceCodeDefCode := Code;
+ if SourceCode.Get(Code) then
+ exit;
+ SourceCode.Init();
+ SourceCode.Code := Code;
+ SourceCode.Description := Description;
+ SourceCode.Insert();
+ end;
}
diff --git a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/PurchAdvLetterPostCZZ.Codeunit.al b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/PurchAdvLetterPostCZZ.Codeunit.al
index f6c279848a..a1dd5fccc8 100644
--- a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/PurchAdvLetterPostCZZ.Codeunit.al
+++ b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/PurchAdvLetterPostCZZ.Codeunit.al
@@ -1156,6 +1156,7 @@ codeunit 31142 "Purch. Adv. Letter-Post CZZ"
AdvanceLetterApplicationCZZ: Record "Advance Letter Application CZZ";
AdvanceLetterTemplateCZZ: Record "Advance Letter Template CZZ";
PurchAdvLetterEntryCZZ: Record "Purch. Adv. Letter Entry CZZ";
+ SourceCodeSetup: Record "Source Code Setup";
NoSeriesBatch: Codeunit "No. Series - Batch";
NextEntryNo: Integer;
GetDocNoFromNoSeries: Boolean;
@@ -1185,6 +1186,11 @@ codeunit 31142 "Purch. Adv. Letter-Post CZZ"
NextEntryNo := GenJnlPostLine.GetNextEntryNo();
end;
+ if AdvancePostingParametersCZZ."Source Code" = '' then begin
+ SourceCodeSetup.Get();
+ AdvancePostingParametersCZZ."Source Code" := SourceCodeSetup."Close Advance Letter CZZ";
+ end;
+
PurchAdvLetterEntryCZZ.SetRange("Purch. Adv. Letter No.", PurchAdvLetterHeaderCZZ."No.");
PurchAdvLetterEntryCZZ.SetRange("Entry Type", PurchAdvLetterEntryCZZ."Entry Type"::Payment);
PurchAdvLetterEntryCZZ.SetRange(Cancelled, false);
@@ -1247,6 +1253,7 @@ codeunit 31142 "Purch. Adv. Letter-Post CZZ"
GenJournalLine."Document Date" := AdvancePostingParametersCZZ."Document Date";
GenJournalLine."VAT Reporting Date" := AdvancePostingParametersCZZ."VAT Date";
GenJournalLine."Original Doc. VAT Date CZL" := AdvancePostingParametersCZZ."Original Document VAT Date";
+ GenJournalLine."Source Code" := AdvancePostingParametersCZZ."Source Code";
GenJournalLine."Adv. Letter No. (Entry) CZZ" := PurchAdvLetterEntryCZZ."Purch. Adv. Letter No.";
GenJournalLine."Use Advance G/L Account CZZ" := true;
GenJournalLine.SetCurrencyFactor(
@@ -1298,6 +1305,7 @@ codeunit 31142 "Purch. Adv. Letter-Post CZZ"
GenJournalLine."Document Date" := AdvancePostingParametersCZZ."Document Date";
GenJournalLine."VAT Reporting Date" := AdvancePostingParametersCZZ."VAT Date";
GenJournalLine."Original Doc. VAT Date CZL" := AdvancePostingParametersCZZ."Original Document VAT Date";
+ GenJournalLine."Source Code" := AdvancePostingParametersCZZ."Source Code";
GenJournalLine.SetCurrencyFactor(
AdvancePostingParametersCZZ."Currency Code", AdvancePostingParametersCZZ."Currency Factor");
GenJournalLine.Amount := RemainingAmount;
diff --git a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/SalesAdvLetterPostCZZ.Codeunit.al b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/SalesAdvLetterPostCZZ.Codeunit.al
index 09ccd3225e..32cededc8e 100644
--- a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/SalesAdvLetterPostCZZ.Codeunit.al
+++ b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/SalesAdvLetterPostCZZ.Codeunit.al
@@ -1004,6 +1004,7 @@ codeunit 31143 "Sales Adv. Letter-Post CZZ"
AdvanceLetterApplicationCZZ: Record "Advance Letter Application CZZ";
AdvanceLetterTemplateCZZ: Record "Advance Letter Template CZZ";
SalesAdvLetterEntryCZZ: Record "Sales Adv. Letter Entry CZZ";
+ SourceCodeSetup: Record "Source Code Setup";
NoSeriesBatch: Codeunit "No. Series - Batch";
NextEntryNo: Integer;
GetDocNoFromNoSeries: Boolean;
@@ -1033,6 +1034,11 @@ codeunit 31143 "Sales Adv. Letter-Post CZZ"
NextEntryNo := GenJnlPostLine.GetNextEntryNo();
end;
+ if AdvancePostingParametersCZZ."Source Code" = '' then begin
+ SourceCodeSetup.Get();
+ AdvancePostingParametersCZZ."Source Code" := SourceCodeSetup."Close Advance Letter CZZ";
+ end;
+
SalesAdvLetterEntryCZZ.SetRange("Sales Adv. Letter No.", SalesAdvLetterHeaderCZZ."No.");
SalesAdvLetterEntryCZZ.SetRange("Entry Type", SalesAdvLetterEntryCZZ."Entry Type"::Payment);
SalesAdvLetterEntryCZZ.SetRange(Cancelled, false);
@@ -1095,6 +1101,7 @@ codeunit 31143 "Sales Adv. Letter-Post CZZ"
GenJournalLine."Document Date" := AdvancePostingParametersCZZ."Document Date";
GenJournalLine."VAT Reporting Date" := AdvancePostingParametersCZZ."VAT Date";
GenJournalLine."Original Doc. VAT Date CZL" := AdvancePostingParametersCZZ."Original Document VAT Date";
+ GenJournalLine."Source Code" := AdvancePostingParametersCZZ."Source Code";
GenJournalLine."Adv. Letter No. (Entry) CZZ" := SalesAdvLetterEntryCZZ."Sales Adv. Letter No.";
GenJournalLine."Use Advance G/L Account CZZ" := true;
GenJournalLine.SetCurrencyFactor(
@@ -1146,6 +1153,7 @@ codeunit 31143 "Sales Adv. Letter-Post CZZ"
GenJournalLine."Document Date" := AdvancePostingParametersCZZ."Document Date";
GenJournalLine."VAT Reporting Date" := AdvancePostingParametersCZZ."VAT Date";
GenJournalLine."Original Doc. VAT Date CZL" := AdvancePostingParametersCZZ."Original Document VAT Date";
+ GenJournalLine."Source Code" := AdvancePostingParametersCZZ."Source Code";
GenJournalLine.SetCurrencyFactor(
AdvancePostingParametersCZZ."Currency Code", AdvancePostingParametersCZZ."Currency Factor");
GenJournalLine.Amount := -RemainingAmount;
diff --git a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/VATRepDateMgtHandlerCZZ.Codeunit.al b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/VATRepDateMgtHandlerCZZ.Codeunit.al
index db297ecfaf..36993f19d1 100644
--- a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/VATRepDateMgtHandlerCZZ.Codeunit.al
+++ b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Codeunits/VATRepDateMgtHandlerCZZ.Codeunit.al
@@ -66,6 +66,21 @@ codeunit 31127 "VAT Rep. Date Mgt. Handler CZZ"
UpdateRelatedGLEntries(VATEntry);
end;
+ [EventSubscriber(ObjectType::Codeunit, Codeunit::"VAT Orig.Doc.VAT Date Mgt. CZL", 'OnAfterUpdateOrigDocVATDate', '', false, false)]
+ local procedure UpdateAdvanceLedgerEntriesOnAfterUpdateOrigDocVATDate(VATEntry: Record "VAT Entry")
+ var
+ PurchAdvLetterEntry: Record "Purch. Adv. Letter Entry CZZ";
+ begin
+ if VATEntry.Type <> VATEntry.Type::Purchase then
+ exit;
+
+ PurchAdvLetterEntry.SetCurrentKey("Document No.", "Posting Date");
+ PurchAdvLetterEntry.SetRange("Document No.", VATEntry."Document No.");
+ PurchAdvLetterEntry.SetRange("Posting Date", VATEntry."Posting Date");
+ PurchAdvLetterEntry.SetFilter("Original Document VAT Date", '<>%1', 0D);
+ PurchAdvLetterEntry.ModifyAll("Original Document VAT Date", VATEntry."Original Doc. VAT Date CZL");
+ end;
+
local procedure FilterRelatedVATEntries(VATEntry: Record "VAT Entry"; var RelatedVATEntry: Record "VAT Entry")
begin
RelatedVATEntry.SetFilter("Entry No.", '<>%1', VATEntry."Entry No.");
diff --git a/Apps/CZ/AdvancePaymentsLocalization/app/Src/PageExtensions/SourceCodeSetupCZZ.PageExt.al b/Apps/CZ/AdvancePaymentsLocalization/app/Src/PageExtensions/SourceCodeSetupCZZ.PageExt.al
new file mode 100644
index 0000000000..e4da0be841
--- /dev/null
+++ b/Apps/CZ/AdvancePaymentsLocalization/app/Src/PageExtensions/SourceCodeSetupCZZ.PageExt.al
@@ -0,0 +1,13 @@
+pageextension 31279 "Source Code Setup CZZ" extends "Source Code Setup"
+{
+ layout
+ {
+ addlast(General)
+ {
+ field("Close Advance Letter CZZ"; Rec."Close Advance Letter CZZ")
+ {
+ ApplicationArea = Basic, Suite;
+ }
+ }
+ }
+}
\ No newline at end of file
diff --git a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Pages/AdvanceLetterApplEditCZZ.Page.al b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Pages/AdvanceLetterApplEditCZZ.Page.al
index c14835cbc2..1e850a1457 100644
--- a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Pages/AdvanceLetterApplEditCZZ.Page.al
+++ b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Pages/AdvanceLetterApplEditCZZ.Page.al
@@ -30,7 +30,8 @@ page 31175 "Advance Letter Appl. Edit CZZ"
if Rec."Advance Letter No." <> '' then begin
TempAdvanceLetterApplication.Get(Rec."Advance Letter Type", Rec."Advance Letter No.", Rec."Document Type", Rec."Document No.");
Rec.CopyFrom(TempAdvanceLetterApplication);
- end
+ Rec.CheckVATRegistrationNoDifference();
+ end;
end;
trigger OnLookup(var Text: Text): Boolean
@@ -39,6 +40,7 @@ page 31175 "Advance Letter Appl. Edit CZZ"
if Page.RunModal(Page::"Advance Letter Application CZZ", TempAdvanceLetterApplication) = Action::LookupOK then begin
Rec.CopyFrom(TempAdvanceLetterApplication);
+ Rec.CheckVATRegistrationNoDifference();
OnAfterOnLookupAdvanceLetterNo(Rec);
end;
end;
diff --git a/Apps/CZ/AdvancePaymentsLocalization/app/Src/TableExtensions/SourceCodeSetupCZZ.TableExt.al b/Apps/CZ/AdvancePaymentsLocalization/app/Src/TableExtensions/SourceCodeSetupCZZ.TableExt.al
new file mode 100644
index 0000000000..6464372133
--- /dev/null
+++ b/Apps/CZ/AdvancePaymentsLocalization/app/Src/TableExtensions/SourceCodeSetupCZZ.TableExt.al
@@ -0,0 +1,13 @@
+tableextension 31076 "Source Code Setup CZZ" extends "Source Code Setup"
+{
+ fields
+ {
+ field(11760; "Close Advance Letter CZZ"; Code[10])
+ {
+ Caption = 'Close Advance Letter';
+ DataClassification = CustomerContent;
+ TableRelation = "Source Code";
+ ToolTip = 'Specifies the source code for closing sales and purchase advance letters.';
+ }
+ }
+}
\ No newline at end of file
diff --git a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Tables/AdvanceLetterApplicationCZZ.Table.al b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Tables/AdvanceLetterApplicationCZZ.Table.al
index 2dec4f9d8f..a40e2e1c54 100644
--- a/Apps/CZ/AdvancePaymentsLocalization/app/Src/Tables/AdvanceLetterApplicationCZZ.Table.al
+++ b/Apps/CZ/AdvancePaymentsLocalization/app/Src/Tables/AdvanceLetterApplicationCZZ.Table.al
@@ -503,6 +503,29 @@ table 31007 "Advance Letter Application CZZ"
end;
end;
+ procedure CheckVATRegistrationNoDifference()
+ var
+ SalesAdvLetterHeaderCZZ: Record "Sales Adv. Letter Header CZZ";
+ SalesHeader: Record "Sales Header";
+ AltCustVATRegImplCZZ: Codeunit "Alt. Cust. VAT Reg. Impl. CZZ";
+ begin
+ if "Advance Letter Type" <> "Advance Letter Type"::Sales then
+ exit;
+
+ SalesAdvLetterHeaderCZZ.Get("Advance Letter No.");
+ case "Document Type" of
+ "Adv. Letter Usage Doc.Type CZZ"::"Sales Order":
+ SalesHeader.Get(SalesHeader."Document Type"::Order, "Document No.");
+ "Adv. Letter Usage Doc.Type CZZ"::"Sales Invoice":
+ SalesHeader.Get(SalesHeader."Document Type"::Invoice, "Document No.");
+ else
+ exit;
+ end;
+
+ if SalesAdvLetterHeaderCZZ."VAT Registration No." <> SalesHeader."VAT Registration No." then
+ AltCustVATRegImplCZZ.ThrowDiffVATRegNoNotification();
+ end;
+
[IntegrationEvent(false, false)]
local procedure OnGetPossiblePurchAdvanceOnBeforeInsertNewAdvanceLetterApplication(var NewAdvanceLetterApplicationCZZ: Record "Advance Letter Application CZZ"; AdvanceLetterApplicationCZZ: Record "Advance Letter Application CZZ")
begin
diff --git a/Apps/CZ/AdvancedLocalizationPack/app/Src/Codeunits/GenJnlPostLineHandlerCZA.Codeunit.al b/Apps/CZ/AdvancedLocalizationPack/app/Src/Codeunits/GenJnlPostLineHandlerCZA.Codeunit.al
index 11b4025751..3d6d0c7bfb 100644
--- a/Apps/CZ/AdvancedLocalizationPack/app/Src/Codeunits/GenJnlPostLineHandlerCZA.Codeunit.al
+++ b/Apps/CZ/AdvancedLocalizationPack/app/Src/Codeunits/GenJnlPostLineHandlerCZA.Codeunit.al
@@ -33,4 +33,14 @@ codeunit 31373 "Gen. Jnl.Post Line Handler CZA"
begin
GLEntryPostApplicationCZA.AutomatedGLEntryApplication(GenJournalLine, GLEntry);
end;
+
+ [EventSubscriber(ObjectType::Codeunit, Codeunit::"Gen. Jnl.-Post Line", 'OnAfterInitGLEntry', '', false, false)]
+ local procedure CloseZeroEntryOnAfterInitGLEntry(var GLEntry: Record "G/L Entry")
+ begin
+ if GLEntry.Amount <> 0 then
+ exit;
+
+ GLEntry."Closed CZA" := true;
+ GLEntry."Closed at Date CZA" := GLEntry."Posting Date";
+ end;
}
diff --git a/Apps/CZ/BankingDocumentsLocalization/app/Src/Codeunits/MatchBankPaymentCZB.Codeunit.al b/Apps/CZ/BankingDocumentsLocalization/app/Src/Codeunits/MatchBankPaymentCZB.Codeunit.al
index 28ad56de7b..14be78046d 100644
--- a/Apps/CZ/BankingDocumentsLocalization/app/Src/Codeunits/MatchBankPaymentCZB.Codeunit.al
+++ b/Apps/CZ/BankingDocumentsLocalization/app/Src/Codeunits/MatchBankPaymentCZB.Codeunit.al
@@ -146,10 +146,18 @@ codeunit 31362 "Match Bank Payment CZB"
TempMatchBankPaymentBufferCZB.Reset();
if TempMatchBankPaymentBufferCZB.IsEmpty() then
- if SearchRuleLineCZB.IsPossibleToMatchWithPartnerBankAccount() then begin
- FillMatchBankPaymentBufferCustomerBankAccount();
- FillMatchBankPaymentBufferVendorBankAccount();
- end;
+ if SearchRuleLineCZB.IsPossibleToMatchWithPartnerBankAccount() then
+ case SearchRuleLineCZB."Search Scope" of
+ SearchRuleLineCZB."Search Scope"::Balance:
+ begin
+ FillMatchBankPaymentBufferCustomerBankAccount();
+ FillMatchBankPaymentBufferVendorBankAccount();
+ end;
+ SearchRuleLineCZB."Search Scope"::Customer:
+ FillMatchBankPaymentBufferCustomerBankAccount();
+ SearchRuleLineCZB."Search Scope"::Vendor:
+ FillMatchBankPaymentBufferVendorBankAccount();
+ end;
OnAfterExtraFillMatchBankPaymentBuffer(TempMatchBankPaymentBufferCZB, SearchRuleLineCZB, GenJournalLine, MinAmount, MaxAmount);
@@ -234,6 +242,7 @@ codeunit 31362 "Match Bank Payment CZB"
var
CustomerBankAccount: Record "Customer Bank Account";
UsePaymentDiscounts: Boolean;
+ RemainingAmount: Decimal;
begin
CustLedgerEntry.Reset();
CustLedgerEntry.SetCurrentKey("Customer No.", Open);
@@ -263,11 +272,6 @@ codeunit 31362 "Match Bank Payment CZB"
CustLedgerEntry.SetRange("Customer No.", CustomerBankAccount."Customer No.");
end;
CustLedgerEntry.SetRange(Open, true);
- if SearchRuleLineCZB.Amount then
- if GenJournalLine.IsLocalCurrencyCZB() then
- CustLedgerEntry.SetRange("Remaining Amt. (LCY)", MinAmount, MaxAmount)
- else
- CustLedgerEntry.SetRange("Remaining Amount", MinAmount, MaxAmount);
if SearchRuleLineCZB."Variable Symbol" then begin
if GenJournalLine.GetVariableSymbolCZB() = '' then
exit;
@@ -290,8 +294,14 @@ codeunit 31362 "Match Bank Payment CZB"
CustLedgerEntry.SetRange(Positive, false);
end;
OnFillMatchBankPaymentBufferCustomerOnAfterCustLedgerEntrySetFilters(CustLedgerEntry, SearchRuleLineCZB, GenJournalLine);
+ CustLedgerEntry.SetAutoCalcFields("Remaining Amount", "Remaining Amt. (LCY)");
if CustLedgerEntry.FindSet() then
repeat
+ if SearchRuleLineCZB.Amount then begin
+ RemainingAmount := CustLedgerEntry.GetRemainingAmountInclPmtDiscToDate(GenJournalLine."Posting Date", GenJournalLine.IsLocalCurrencyCZB());
+ if (RemainingAmount < MinAmount) or (RemainingAmount > MaxAmount) then
+ continue;
+ end;
TempMatchBankPaymentBufferCZB.InsertFromCustomerLedgerEntry(CustLedgerEntry, true, UsePaymentDiscounts);
until CustLedgerEntry.Next() = 0;
end;
@@ -300,6 +310,7 @@ codeunit 31362 "Match Bank Payment CZB"
var
VendorBankAccount: Record "Vendor Bank Account";
UsePaymentDiscounts: Boolean;
+ RemainingAmount: Decimal;
begin
VendorLedgerEntry.Reset();
VendorLedgerEntry.SetCurrentKey("Vendor No.", Open);
@@ -329,11 +340,6 @@ codeunit 31362 "Match Bank Payment CZB"
VendorLedgerEntry.SetRange("Vendor No.", VendorBankAccount."Vendor No.");
end;
VendorLedgerEntry.SetRange(Open, true);
- if SearchRuleLineCZB.Amount then
- if GenJournalLine.IsLocalCurrencyCZB() then
- VendorLedgerEntry.SetRange("Remaining Amt. (LCY)", MinAmount, MaxAmount)
- else
- VendorLedgerEntry.SetRange("Remaining Amount", MinAmount, MaxAmount);
if SearchRuleLineCZB."Variable Symbol" then begin
if GenJournalLine.GetVariableSymbolCZB() = '' then
exit;
@@ -356,8 +362,14 @@ codeunit 31362 "Match Bank Payment CZB"
VendorLedgerEntry.SetRange(Positive, false);
end;
OnFillMatchBankPaymentBufferVendorOnAfterVendorLedgerEntrySetFilters(VendorLedgerEntry, SearchRuleLineCZB, GenJournalLine);
+ VendorLedgerEntry.SetAutoCalcFields("Remaining Amount", "Remaining Amt. (LCY)");
if VendorLedgerEntry.FindSet() then
repeat
+ if SearchRuleLineCZB.Amount then begin
+ RemainingAmount := VendorLedgerEntry.GetRemainingAmountInclPmtDiscToDate(GenJournalLine."Posting Date", GenJournalLine.IsLocalCurrencyCZB());
+ if (RemainingAmount < MinAmount) or (RemainingAmount > MaxAmount) then
+ continue;
+ end;
TempMatchBankPaymentBufferCZB.InsertFromVendorLedgerEntry(VendorLedgerEntry, true, UsePaymentDiscounts);
until VendorLedgerEntry.Next() = 0;
end;
diff --git a/Apps/CZ/BankingDocumentsLocalization/app/Src/Codeunits/UpgradeApplicationCZB.Codeunit.al b/Apps/CZ/BankingDocumentsLocalization/app/Src/Codeunits/UpgradeApplicationCZB.Codeunit.al
index ed67854832..0d845a5930 100644
--- a/Apps/CZ/BankingDocumentsLocalization/app/Src/Codeunits/UpgradeApplicationCZB.Codeunit.al
+++ b/Apps/CZ/BankingDocumentsLocalization/app/Src/Codeunits/UpgradeApplicationCZB.Codeunit.al
@@ -33,6 +33,7 @@ codeunit 31332 "Upgrade Application CZB"
local procedure UpgradeData()
begin
UpgradeBankAccount();
+ UpgradeBankAccountKeepDescription();
end;
local procedure UpgradeBankAccount();
@@ -49,6 +50,21 @@ codeunit 31332 "Upgrade Application CZB"
BankaccountDataTransfer.CopyFields();
end;
+ local procedure UpgradeBankAccountKeepDescription()
+ var
+ BankAccount: Record "Bank Account";
+ BankaccountDataTransfer: DataTransfer;
+ begin
+ if UpgradeTag.HasUpgradeTag(UpgradeTagDefinitionsCZB.GetBankAccountKeepDescriptionUpgradeTag()) then
+ exit;
+
+ BankaccountDataTransfer.SetTables(Database::"Bank Account", Database::"Bank Account");
+ BankaccountDataTransfer.AddConstantValue(true, BankAccount.FieldNo("Keep Description CZB"));
+ BankaccountDataTransfer.CopyFields();
+
+ UpgradeTag.SetUpgradeTag(UpgradeTagDefinitionsCZB.GetBankAccountKeepDescriptionUpgradeTag());
+ end;
+
local procedure SetDatabaseUpgradeTags();
begin
if not UpgradeTag.HasUpgradeTag(UpgradeTagDefinitionsCZB.GetDataVersion190PerDatabaseUpgradeTag()) then
diff --git a/Apps/CZ/BankingDocumentsLocalization/app/Src/Codeunits/UpgradeTagDefinitionsCZB.Codeunit.al b/Apps/CZ/BankingDocumentsLocalization/app/Src/Codeunits/UpgradeTagDefinitionsCZB.Codeunit.al
index 144d8d565f..d911cc8478 100644
--- a/Apps/CZ/BankingDocumentsLocalization/app/Src/Codeunits/UpgradeTagDefinitionsCZB.Codeunit.al
+++ b/Apps/CZ/BankingDocumentsLocalization/app/Src/Codeunits/UpgradeTagDefinitionsCZB.Codeunit.al
@@ -20,6 +20,7 @@ codeunit 31333 "Upgrade Tag Definitions CZB"
begin
PerCompanyUpgradeTags.Add(GetDataVersion190PerCompanyUpgradeTag());
PerCompanyUpgradeTags.Add(GetDataVersion221PerCompanyUpgradeTag());
+ PerCompanyUpgradeTags.Add(GetBankAccountKeepDescriptionUpgradeTag());
end;
procedure GetDataVersion190PerDatabaseUpgradeTag(): Code[250]
@@ -41,4 +42,9 @@ codeunit 31333 "Upgrade Tag Definitions CZB"
begin
exit('CZB-UpgradeBankingDocumentsLocalizationForCzech-PerCompany-22.1');
end;
+
+ procedure GetBankAccountKeepDescriptionUpgradeTag(): Code[250]
+ begin
+ exit('CZB-616353-BankAccountKeepDescriptionUpgradeTag-20251214');
+ end;
}
diff --git a/Apps/CZ/BankingDocumentsLocalization/app/Src/PageExtensions/BankAccountCardCZB.PageExt.al b/Apps/CZ/BankingDocumentsLocalization/app/Src/PageExtensions/BankAccountCardCZB.PageExt.al
index 0a93514aa1..46a0dffb68 100644
--- a/Apps/CZ/BankingDocumentsLocalization/app/Src/PageExtensions/BankAccountCardCZB.PageExt.al
+++ b/Apps/CZ/BankingDocumentsLocalization/app/Src/PageExtensions/BankAccountCardCZB.PageExt.al
@@ -78,6 +78,10 @@ pageextension 31287 "Bank Account Card CZB" extends "Bank Account Card"
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies copying variable symbol of the payment to the external document number field in payment journal.';
}
+ field("Keep Description CZB"; Rec."Keep Description CZB")
+ {
+ ApplicationArea = Basic, Suite;
+ }
field("Dimension from Apply Entry CZB"; Rec."Dimension from Apply Entry CZB")
{
ApplicationArea = Basic, Suite;
diff --git a/Apps/CZ/BankingDocumentsLocalization/app/Src/PageExtensions/UserSetupCZB.PageExt.al b/Apps/CZ/BankingDocumentsLocalization/app/Src/PageExtensions/UserSetupCZB.PageExt.al
index cb5800aa2e..430907bb42 100644
--- a/Apps/CZ/BankingDocumentsLocalization/app/Src/PageExtensions/UserSetupCZB.PageExt.al
+++ b/Apps/CZ/BankingDocumentsLocalization/app/Src/PageExtensions/UserSetupCZB.PageExt.al
@@ -5,6 +5,7 @@
namespace Microsoft.Bank.Documents;
using System.Security.User;
+using Microsoft.Finance.GeneralLedger.Setup;
pageextension 31283 "User Setup CZB" extends "User Setup"
{
@@ -16,12 +17,24 @@ pageextension 31283 "User Setup CZB" extends "User Setup"
{
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies whether the payment order processing is allowed only for bank accounts setted up in the lines.';
+ Visible = IsUserChecksAllowed;
}
field("Check Bank Statements CZB"; Rec."Check Bank Statements CZB")
{
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies whether the bank statements processing is allowed only for bank accounts setted up in the lines.';
+ Visible = IsUserChecksAllowed;
}
}
}
+
+ var
+ GeneralLedgerSetup: Record "General Ledger Setup";
+ IsUserChecksAllowed: Boolean;
+
+ trigger OnOpenPage()
+ begin
+ GeneralLedgerSetup.Get();
+ IsUserChecksAllowed := GeneralLedgerSetup."User Checks Allowed CZL";
+ end;
}
diff --git a/Apps/CZ/BankingDocumentsLocalization/app/Src/Reports/CreateGeneralJournalCZB.Report.al b/Apps/CZ/BankingDocumentsLocalization/app/Src/Reports/CreateGeneralJournalCZB.Report.al
index ca1bd74fe6..53f774e591 100644
--- a/Apps/CZ/BankingDocumentsLocalization/app/Src/Reports/CreateGeneralJournalCZB.Report.al
+++ b/Apps/CZ/BankingDocumentsLocalization/app/Src/Reports/CreateGeneralJournalCZB.Report.al
@@ -110,6 +110,12 @@ report 31287 "Create General Journal CZB"
Caption = 'Variable S. to External Doc. No.';
ToolTip = 'Specifies if variable symbol will be transferred to external document no.';
}
+ field(KeepDescription; KeepDescription)
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'Keep Description';
+ ToolTip = 'Specifies that when the Account No. on a payment journal line is changed, the line Description remains unchanged.';
+ }
}
}
}
@@ -128,7 +134,7 @@ report 31287 "Create General Journal CZB"
var
BankAccount: Record "Bank Account";
WindowDialog: Dialog;
- VariableSymbolToDescription, VariableSymbolToVariableSymbol, VariableSymbolToExtDocNo, VarJournalCreated : Boolean;
+ VariableSymbolToDescription, VariableSymbolToVariableSymbol, VariableSymbolToExtDocNo, VarJournalCreated, KeepDescription : Boolean;
CreatingLinesMsg: Label 'Creating payment journal lines...\\Line No. #1##########', Comment = '%1 = Progress bar';
ApplyingLinesMsg: Label 'Applying payment journal lines...\\Line No. #1##########', Comment = '%1 = Progress bar';
SuccessCreatedMsg: Label 'Payment journal lines were successfully created.';
@@ -163,6 +169,7 @@ report 31287 "Create General Journal CZB"
VariableSymbolToDescription := BankAccount."Variable S. to Description CZB";
VariableSymbolToVariableSymbol := BankAccount."Variable S. to Variable S. CZB";
VariableSymbolToExtDocNo := BankAccount."Variable S. to Ext.Doc.No. CZB";
+ KeepDescription := BankAccount."Keep Description CZB";
end;
local procedure GetBankAccount(IssBankStatementHeaderCZB: Record "Iss. Bank Statement Header CZB")
@@ -246,7 +253,7 @@ report 31287 "Create General Journal CZB"
GenJournalLine."Bank Account Code CZL" := IssBankStatementLineCZB."Cust./Vendor Bank Account Code";
GenJournalLine."IBAN CZL" := IssBankStatementLineCZB.IBAN;
GenJournalLine.Description := IssBankStatementLineCZB.Description;
- GenJournalLine."Keep Description" := true;
+ GenJournalLine."Keep Description" := KeepDescription;
GenJournalLine.SetVariableSymbolCZB(
IssBankStatementLineCZB."Variable Symbol", VariableSymbolToDescription, VariableSymbolToVariableSymbol, VariableSymbolToExtDocNo);
GenJournalLine."Specific Symbol CZL" := IssBankStatementLineCZB."Specific Symbol";
diff --git a/Apps/CZ/BankingDocumentsLocalization/app/Src/TableExtensions/BankAccountCZB.TableExt.al b/Apps/CZ/BankingDocumentsLocalization/app/Src/TableExtensions/BankAccountCZB.TableExt.al
index 893cff8a5f..7128552295 100644
--- a/Apps/CZ/BankingDocumentsLocalization/app/Src/TableExtensions/BankAccountCZB.TableExt.al
+++ b/Apps/CZ/BankingDocumentsLocalization/app/Src/TableExtensions/BankAccountCZB.TableExt.al
@@ -85,6 +85,13 @@ tableextension 31286 "Bank Account CZB" extends "Bank Account"
InitValue = true;
DataClassification = CustomerContent;
}
+ field(11760; "Keep Description CZB"; Boolean)
+ {
+ Caption = 'Keep Description';
+ InitValue = true;
+ DataClassification = CustomerContent;
+ ToolTip = 'Specifies that when the Account No. on a payment journal line is changed, the line Description remains unchanged.';
+ }
field(11071; "Payment Partial Suggestion CZB"; Boolean)
{
Caption = 'Payment Partial Suggestion';
diff --git a/Apps/CZ/BankingDocumentsLocalization/app/Src/TableExtensions/CustLedgerEntryCZB.TableExt.al b/Apps/CZ/BankingDocumentsLocalization/app/Src/TableExtensions/CustLedgerEntryCZB.TableExt.al
index cd804e33c2..4824cea6c5 100644
--- a/Apps/CZ/BankingDocumentsLocalization/app/Src/TableExtensions/CustLedgerEntryCZB.TableExt.al
+++ b/Apps/CZ/BankingDocumentsLocalization/app/Src/TableExtensions/CustLedgerEntryCZB.TableExt.al
@@ -20,4 +20,30 @@ tableextension 31280 "Cust. Ledger Entry CZB" extends "Cust. Ledger Entry"
}
#pragma warning restore
}
+
+ internal procedure GetRemainingAmountInclPmtDiscToDate(ReferenceDate: Date; UseLCY: Boolean): Decimal
+ begin
+ exit(GetRemainingAmount(UseLCY) - GetRemainingPmtDiscPossibleToDate(ReferenceDate, UseLCY));
+ end;
+
+ internal procedure GetRemainingAmount(UseLCY: Boolean): Decimal
+ begin
+ exit(UseLCY ? "Remaining Amt. (LCY)" : "Remaining Amount");
+ end;
+
+ internal procedure GetRemainingPmtDiscPossibleToDate(ReferenceDate: Date; UseLCY: Boolean): Decimal
+ begin
+ if ReferenceDate > GetPmtDiscountDate() then
+ exit(0);
+ exit(UseLCY ? Round("Remaining Pmt. Disc. Possible" / "Adjusted Currency Factor") : "Remaining Pmt. Disc. Possible");
+ end;
+
+ internal procedure GetPmtDiscountDate(): Date
+ begin
+ if "Remaining Pmt. Disc. Possible" = 0 then
+ exit(0D);
+ if "Pmt. Disc. Tolerance Date" >= "Pmt. Discount Date" then
+ exit("Pmt. Disc. Tolerance Date");
+ exit("Pmt. Discount Date");
+ end;
}
diff --git a/Apps/CZ/BankingDocumentsLocalization/app/Src/TableExtensions/VendorLedgerEntryCZB.TableExt.al b/Apps/CZ/BankingDocumentsLocalization/app/Src/TableExtensions/VendorLedgerEntryCZB.TableExt.al
index 1895d38bf8..425c838f23 100644
--- a/Apps/CZ/BankingDocumentsLocalization/app/Src/TableExtensions/VendorLedgerEntryCZB.TableExt.al
+++ b/Apps/CZ/BankingDocumentsLocalization/app/Src/TableExtensions/VendorLedgerEntryCZB.TableExt.al
@@ -20,4 +20,30 @@ tableextension 31281 "Vendor Ledger Entry CZB" extends "Vendor Ledger Entry"
}
#pragma warning restore
}
+
+ internal procedure GetRemainingAmountInclPmtDiscToDate(ReferenceDate: Date; UseLCY: Boolean): Decimal
+ begin
+ exit(GetRemainingAmount(UseLCY) - GetRemainingPmtDiscPossibleToDate(ReferenceDate, UseLCY));
+ end;
+
+ internal procedure GetRemainingAmount(UseLCY: Boolean): Decimal
+ begin
+ exit(UseLCY ? "Remaining Amt. (LCY)" : "Remaining Amount");
+ end;
+
+ internal procedure GetRemainingPmtDiscPossibleToDate(ReferenceDate: Date; UseLCY: Boolean): Decimal
+ begin
+ if ReferenceDate > GetPmtDiscountDate() then
+ exit(0);
+ exit(UseLCY ? Round("Remaining Pmt. Disc. Possible" / "Adjusted Currency Factor") : "Remaining Pmt. Disc. Possible");
+ end;
+
+ internal procedure GetPmtDiscountDate(): Date
+ begin
+ if "Remaining Pmt. Disc. Possible" = 0 then
+ exit(0D);
+ if "Pmt. Disc. Tolerance Date" >= "Pmt. Discount Date" then
+ exit("Pmt. Disc. Tolerance Date");
+ exit("Pmt. Discount Date");
+ end;
}
diff --git a/Apps/CZ/BankingDocumentsLocalization/app/Src/Tables/MatchBankPaymentBufferCZB.Table.al b/Apps/CZ/BankingDocumentsLocalization/app/Src/Tables/MatchBankPaymentBufferCZB.Table.al
index 202108f136..d160fae577 100644
--- a/Apps/CZ/BankingDocumentsLocalization/app/Src/Tables/MatchBankPaymentBufferCZB.Table.al
+++ b/Apps/CZ/BankingDocumentsLocalization/app/Src/Tables/MatchBankPaymentBufferCZB.Table.al
@@ -130,20 +130,10 @@ table 31260 "Match Bank Payment Buffer CZB"
"Specific Symbol" := CustLedgerEntry."Specific Symbol CZL";
"Variable Symbol" := CustLedgerEntry."Variable Symbol CZL";
"Constant Symbol" := CustLedgerEntry."Constant Symbol CZL";
- if UseLCYAmounts then
- "Remaining Amount" := CustLedgerEntry."Remaining Amt. (LCY)"
- else
- "Remaining Amount" := CustLedgerEntry."Remaining Amount";
- "Pmt. Discount Due Date" := GetCustomerLedgerEntryDiscountDueDate(CustLedgerEntry);
- "Remaining Amt. Incl. Discount" := "Remaining Amount";
- if "Pmt. Discount Due Date" > 0D then begin
- if UseLCYAmounts then
- "Remaining Amt. Incl. Discount" -=
- Round(CustLedgerEntry."Remaining Pmt. Disc. Possible" / CustLedgerEntry."Adjusted Currency Factor")
- else
- "Remaining Amt. Incl. Discount" -= CustLedgerEntry."Remaining Pmt. Disc. Possible";
- UsePaymentDiscounts := true;
- end;
+ "Remaining Amount" := CustLedgerEntry.GetRemainingAmount(UseLCYAmounts);
+ "Pmt. Discount Due Date" := CustLedgerEntry.GetPmtDiscountDate();
+ "Remaining Amt. Incl. Discount" := CustLedgerEntry.GetRemainingAmountInclPmtDiscToDate(0D, UseLCYAmounts);
+ UsePaymentDiscounts := "Remaining Amount" <> "Remaining Amt. Incl. Discount";
"Dimension Set ID" := CustLedgerEntry."Dimension Set ID";
OnBeforeInsertFromCustomerLedgerEntry(Rec, CustLedgerEntry);
Insert(true);
@@ -161,20 +151,10 @@ table 31260 "Match Bank Payment Buffer CZB"
"Specific Symbol" := VendorLedgerEntry."Specific Symbol CZL";
"Variable Symbol" := VendorLedgerEntry."Variable Symbol CZL";
"Constant Symbol" := VendorLedgerEntry."Constant Symbol CZL";
- if UseLCYAmounts then
- "Remaining Amount" := VendorLedgerEntry."Remaining Amt. (LCY)"
- else
- "Remaining Amount" := VendorLedgerEntry."Remaining Amount";
- "Pmt. Discount Due Date" := GetVendorLedgerEntryDiscountDueDate(VendorLedgerEntry);
- "Remaining Amt. Incl. Discount" := "Remaining Amount";
- if "Pmt. Discount Due Date" > 0D then begin
- if UseLCYAmounts then
- "Remaining Amt. Incl. Discount" -=
- Round(VendorLedgerEntry."Remaining Pmt. Disc. Possible" / VendorLedgerEntry."Adjusted Currency Factor")
- else
- "Remaining Amt. Incl. Discount" -= VendorLedgerEntry."Remaining Pmt. Disc. Possible";
- UsePaymentDiscounts := true;
- end;
+ "Remaining Amount" := VendorLedgerEntry.GetRemainingAmount(UseLCYAmounts);
+ "Pmt. Discount Due Date" := VendorLedgerEntry.GetPmtDiscountDate();
+ "Remaining Amt. Incl. Discount" := VendorLedgerEntry.GetRemainingAmountInclPmtDiscToDate(0D, UseLCYAmounts);
+ UsePaymentDiscounts := "Remaining Amount" <> "Remaining Amt. Incl. Discount";
"Dimension Set ID" := VendorLedgerEntry."Dimension Set ID";
OnBeforeInsertFromVendorLedgerEntry(Rec, VendorLedgerEntry);
Insert(true);
@@ -213,24 +193,6 @@ table 31260 "Match Bank Payment Buffer CZB"
Insert(true);
end;
- local procedure GetCustomerLedgerEntryDiscountDueDate(CustLedgerEntry: Record "Cust. Ledger Entry"): Date
- begin
- if CustLedgerEntry."Remaining Pmt. Disc. Possible" = 0 then
- exit(0D);
- if CustLedgerEntry."Pmt. Disc. Tolerance Date" >= CustLedgerEntry."Pmt. Discount Date" then
- exit(CustLedgerEntry."Pmt. Disc. Tolerance Date");
- exit(CustLedgerEntry."Pmt. Discount Date");
- end;
-
- local procedure GetVendorLedgerEntryDiscountDueDate(VendorLedgerEntry: Record "Vendor Ledger Entry"): Date
- begin
- if VendorLedgerEntry."Remaining Pmt. Disc. Possible" = 0 then
- exit(0D);
- if VendorLedgerEntry."Pmt. Disc. Tolerance Date" >= VendorLedgerEntry."Pmt. Discount Date" then
- exit(VendorLedgerEntry."Pmt. Disc. Tolerance Date");
- exit(VendorLedgerEntry."Pmt. Discount Date");
- end;
-
[IntegrationEvent(false, false)]
local procedure OnBeforeInsertFromCustomerLedgerEntry(var MatchBankPaymentBufferCZB: Record "Match Bank Payment Buffer CZB"; CustLedgerEntry: Record "Cust. Ledger Entry")
begin
diff --git a/Apps/CZ/BankingDocumentsLocalization/demo data/src/DemoData/Bank/2. Master Data/CreateBankAccountCZB.Codeunit.al b/Apps/CZ/BankingDocumentsLocalization/demo data/src/DemoData/Bank/2. Master Data/CreateBankAccountCZB.Codeunit.al
index cf903208cd..62f8ba3b7f 100644
--- a/Apps/CZ/BankingDocumentsLocalization/demo data/src/DemoData/Bank/2. Master Data/CreateBankAccountCZB.Codeunit.al
+++ b/Apps/CZ/BankingDocumentsLocalization/demo data/src/DemoData/Bank/2. Master Data/CreateBankAccountCZB.Codeunit.al
@@ -32,16 +32,16 @@ codeunit 31449 "Create Bank Account CZB"
CreateSearchRuleCZB: Codeunit "Create Search Rule CZB";
begin
if BankAccount.Get(CreateBankAccountCZ.NBL()) then begin
- ValidateBankAccount(BankAccount, CreateGenJournalTemplateCZ.Banks(), CreateGenJnlBatchCZ.NBL(), CreateGenJournalTemplateCZ.Banks(), CreateGenJnlBatchCZ.NBL(), Report::"Iss. Payment Order CZB", Report::"Iss. Payment Order CZB", true, true, true, true, CreateSearchRuleCZB.Default(), CreateGLAccountCZ.Cashtransfer(), true, CreateNoSeriesCZ.PaymentOrder(), CreateNoSeriesCZ.IssuedPaymentOrder(), CreateNoSeriesCZ.BankStatement(), CreateNoSeriesCZ.IssuedBankStatement());
+ ValidateBankAccount(BankAccount, CreateGenJournalTemplateCZ.Banks(), CreateGenJnlBatchCZ.NBL(), CreateGenJournalTemplateCZ.Banks(), CreateGenJnlBatchCZ.NBL(), Report::"Iss. Payment Order CZB", Report::"Iss. Payment Order CZB", true, true, true, true, true, CreateSearchRuleCZB.Default(), CreateGLAccountCZ.Cashtransfer(), true, CreateNoSeriesCZ.PaymentOrder(), CreateNoSeriesCZ.IssuedPaymentOrder(), CreateNoSeriesCZ.BankStatement(), CreateNoSeriesCZ.IssuedBankStatement());
BankAccount.Modify(true);
end;
if BankAccount.Get(CreateBankAccountCZ.WWBEUR()) then begin
- ValidateBankAccount(BankAccount, CreateGenJournalTemplateCZ.Banks(), CreateGenJnlBatchCZ.WWBEUR(), CreateGenJournalTemplateCZ.Banks(), CreateGenJnlBatchCZ.WWBEUR(), Report::"Iss. Payment Order CZB", Report::"Iss. Payment Order CZB", true, true, true, true, CreateSearchRuleCZB.Default(), CreateGLAccountCZ.Cashtransfer(), true, CreateNoSeriesCZ.PaymentOrder(), CreateNoSeriesCZ.IssuedPaymentOrder(), CreateNoSeriesCZ.BankStatement(), CreateNoSeriesCZ.IssuedBankStatement());
+ ValidateBankAccount(BankAccount, CreateGenJournalTemplateCZ.Banks(), CreateGenJnlBatchCZ.WWBEUR(), CreateGenJournalTemplateCZ.Banks(), CreateGenJnlBatchCZ.WWBEUR(), Report::"Iss. Payment Order CZB", Report::"Iss. Payment Order CZB", true, true, true, true, true, CreateSearchRuleCZB.Default(), CreateGLAccountCZ.Cashtransfer(), true, CreateNoSeriesCZ.PaymentOrder(), CreateNoSeriesCZ.IssuedPaymentOrder(), CreateNoSeriesCZ.BankStatement(), CreateNoSeriesCZ.IssuedBankStatement());
BankAccount.Modify(true);
end;
end;
- local procedure ValidateBankAccount(var BankAccount: Record "Bank Account"; PaymentJnlTemplateName: Code[10]; PaymentJnlBatchName: Code[10]; PmtJnlTemplNameOrder: Code[10]; PmtJnlBatchNameOrder: Code[10]; DomesticPaymentOrderID: Integer; ForeignPaymentOrderID: Integer; VariableStoDescription: Boolean; VariableStoVariableS: Boolean; VariableStoExtDocNo: Boolean; DimensionfromApplyEntry: Boolean; SearchRuleCode: Code[10]; NonAssocPaymentAccount: Code[20]; CheckExtNoCurrYear: Boolean; PaymentOrderNos: Code[20]; IssuedPaymentOrderNos: Code[20]; BankStatementNos: Code[20]; IssuedBankStatementNos: Code[20])
+ local procedure ValidateBankAccount(var BankAccount: Record "Bank Account"; PaymentJnlTemplateName: Code[10]; PaymentJnlBatchName: Code[10]; PmtJnlTemplNameOrder: Code[10]; PmtJnlBatchNameOrder: Code[10]; DomesticPaymentOrderID: Integer; ForeignPaymentOrderID: Integer; VariableStoDescription: Boolean; VariableStoVariableS: Boolean; VariableStoExtDocNo: Boolean; KeepDescription: Boolean; DimensionfromApplyEntry: Boolean; SearchRuleCode: Code[10]; NonAssocPaymentAccount: Code[20]; CheckExtNoCurrYear: Boolean; PaymentOrderNos: Code[20]; IssuedPaymentOrderNos: Code[20]; BankStatementNos: Code[20]; IssuedBankStatementNos: Code[20])
begin
BankAccount.Validate("Payment Jnl. Template Name CZB", PaymentJnlTemplateName);
BankAccount.Validate("Payment Jnl. Batch Name CZB", PaymentJnlBatchName);
@@ -52,6 +52,7 @@ codeunit 31449 "Create Bank Account CZB"
BankAccount.Validate("Variable S. to Description CZB", VariableStoDescription);
BankAccount.Validate("Variable S. to Variable S. CZB", VariableStoVariableS);
BankAccount.Validate("Variable S. to Ext.Doc.No. CZB", VariableStoExtDocNo);
+ BankAccount.Validate("Keep Description CZB", KeepDescription);
BankAccount.Validate("Dimension from Apply Entry CZB", DimensionfromApplyEntry);
BankAccount.Validate("Search Rule Code CZB", SearchRuleCode);
BankAccount.Validate("Non Assoc. Payment Account CZB", NonAssocPaymentAccount);
diff --git a/Apps/CZ/CompensationLocalization/app/Src/Reports/PostedCompensation.rdl b/Apps/CZ/CompensationLocalization/app/Src/Reports/PostedCompensation.rdl
index 5ec48f8e99..b53335b857 100644
--- a/Apps/CZ/CompensationLocalization/app/Src/Reports/PostedCompensation.rdl
+++ b/Apps/CZ/CompensationLocalization/app/Src/Reports/PostedCompensation.rdl
@@ -1048,12 +1048,6 @@ Cstr(Fields!RegistrationNoLbl.Value)
7pt
-
- 3333333333333333333333333333333333333
-
-
@@ -1086,12 +1080,6 @@ Cstr(Fields!RegistrationNoLbl.Value)
7pt
-
- 3
-
-
@@ -2353,7 +2341,6 @@ Cstr(Fields!RegistrationNoLbl.Value)
DataSet_Result
- 0in
0.03cm
14.30505cm
18cm
diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/DataClassEvalHandlerCZL.Codeunit.al b/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/DataClassEvalHandlerCZL.Codeunit.al
index 45fc051e95..c5210460f9 100644
--- a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/DataClassEvalHandlerCZL.Codeunit.al
+++ b/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/DataClassEvalHandlerCZL.Codeunit.al
@@ -500,6 +500,7 @@ codeunit 11710 "Data Class. Eval. Handler CZL"
DataClassificationMgt.SetFieldToNormal(Database::"User Setup", UserSetup.FieldNo("Check Release LocationCode CZL"));
DataClassificationMgt.SetFieldToNormal(Database::"User Setup", UserSetup.FieldNo("Check Invt. Movement Temp. CZL"));
DataClassificationMgt.SetFieldToNormal(Database::"User Setup", UserSetup.FieldNo("Allow VAT Date Changing CZL"));
+ DataClassificationMgt.SetFieldToNormal(Database::"User Setup", UserSetup.FieldNo("Allow Orig Doc VAT Date Ch CZL"));
DataClassificationMgt.SetFieldToNormal(Database::"Value Entry", ValueEntry.FieldNo("G/L Correction CZL"));
DataClassificationMgt.SetFieldToNormal(Database::"VAT Amount Line", VATAmountLine.FieldNo("VAT Base (LCY) CZL"));
DataClassificationMgt.SetFieldToNormal(Database::"VAT Amount Line", VATAmountLine.FieldNo("VAT Amount (LCY) CZL"));
diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/InstallApplicationCZL.Codeunit.al b/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/InstallApplicationCZL.Codeunit.al
index 6dd7de1d10..ce86040593 100644
--- a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/InstallApplicationCZL.Codeunit.al
+++ b/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/InstallApplicationCZL.Codeunit.al
@@ -201,6 +201,18 @@ codeunit 11748 "Install Application CZL"
var
InstallApplicationsMgtCZL: Codeunit "Install Applications Mgt. CZL";
AppInfo: ModuleInfo;
+ PurchaseVATDelaySourceCodeTxt: Label 'VATPD', MaxLength = 10;
+ PurchaseVATDelaySourceCodeDescriptionTxt: Label 'Purchase VAT Delay', MaxLength = 100;
+ SalesVATDelaySourceCodeTxt: Label 'VATSD', MaxLength = 10;
+ SalesVATDelaySourceCodeDescriptionTxt: Label 'Sales VAT Delay', MaxLength = 100;
+ VATLCYCorrectionSourceCodeTxt: Label 'VATCORR', MaxLength = 10;
+ VATLCYCorrectionSourceCodeDescriptionTxt: Label 'VAT Correction in LCY', MaxLength = 100;
+ OpenBalanceSheetSourceCodeTxt: Label 'OPBALANCE', MaxLength = 10;
+ OpenBalanceSheetSourceCodeDescriptionTxt: Label 'Open Balance Sheet', MaxLength = 100;
+ CloseBalanceSheetSourceCodeTxt: Label 'CLBALANCE', MaxLength = 10;
+ CloseBalanceSheetSourceCodeDescriptionTxt: Label 'Close Balance Sheet', MaxLength = 100;
+ VATCoeffCorrectionSourceCodeTxt: Label 'VATCOEFF', MaxLength = 10;
+ VATCoeffCorrectionSourceCodeDescriptionTxt: Label 'VAT Coefficient Correction', MaxLength = 100;
trigger OnInstallAppPerCompany()
begin
@@ -766,16 +778,6 @@ codeunit 11748 "Install Application CZL"
var
SourceCodeSetup: Record "Source Code Setup";
PrevSourceCodeSetup: Record "Source Code Setup";
- PurchaseVATDelaySourceCodeTxt: Label 'VATPD', MaxLength = 10;
- PurchaseVATDelaySourceCodeDescriptionTxt: Label 'Purchase VAT Delay', MaxLength = 100;
- SalesVATDelaySourceCodeTxt: Label 'VATSD', MaxLength = 10;
- SalesVATDelaySourceCodeDescriptionTxt: Label 'Sales VAT Delay', MaxLength = 100;
- VATLCYCorrectionSourceCodeTxt: Label 'VATCORR', MaxLength = 10;
- VATLCYCorrectionSourceCodeDescriptionTxt: Label 'VAT Correction in LCY', MaxLength = 100;
- OpenBalanceSheetSourceCodeTxt: Label 'OPBALANCE', MaxLength = 10;
- OpenBalanceSheetSourceCodeDescriptionTxt: Label 'Open Balance Sheet', MaxLength = 100;
- CloseBalanceSheetSourceCodeTxt: Label 'CLBALANCE', MaxLength = 10;
- CloseBalanceSheetSourceCodeDescriptionTxt: Label 'Close Balance Sheet', MaxLength = 100;
begin
if not SourceCodeSetup.Get() then
exit;
@@ -790,12 +792,15 @@ codeunit 11748 "Install Application CZL"
InsertSourceCode(SourceCodeSetup."Open Balance Sheet CZL", OpenBalanceSheetSourceCodeTxt, OpenBalanceSheetSourceCodeDescriptionTxt);
if SourceCodeSetup."Close Balance Sheet CZL" = '' then
InsertSourceCode(SourceCodeSetup."Close Balance Sheet CZL", CloseBalanceSheetSourceCodeTxt, CloseBalanceSheetSourceCodeDescriptionTxt);
+ if SourceCodeSetup."VAT Coeff. Correction CZL" = '' then
+ InsertSourceCode(SourceCodeSetup."VAT Coeff. Correction CZL", VATCoeffCorrectionSourceCodeTxt, VATCoeffCorrectionSourceCodeDescriptionTxt);
if (SourceCodeSetup."Purchase VAT Delay CZL" <> PrevSourceCodeSetup."Purchase VAT Delay CZL") or
(SourceCodeSetup."Sales VAT Delay CZL" <> PrevSourceCodeSetup."Sales VAT Delay CZL") or
(SourceCodeSetup."VAT LCY Correction CZL" <> PrevSourceCodeSetup."VAT LCY Correction CZL") or
(SourceCodeSetup."Open Balance Sheet CZL" <> PrevSourceCodeSetup."Open Balance Sheet CZL") or
- (SourceCodeSetup."Close Balance Sheet CZL" <> PrevSourceCodeSetup."Close Balance Sheet CZL")
+ (SourceCodeSetup."Close Balance Sheet CZL" <> PrevSourceCodeSetup."Close Balance Sheet CZL") or
+ (SourceCodeSetup."VAT Coeff. Correction CZL" <> PrevSourceCodeSetup."VAT Coeff. Correction CZL")
then
SourceCodeSetup.Modify();
end;
@@ -804,16 +809,6 @@ codeunit 11748 "Install Application CZL"
var
SourceCodeSetup: Record "Source Code Setup";
PrevSourceCodeSetup: Record "Source Code Setup";
- PurchaseVATDelaySourceCodeTxt: Label 'VATPD', MaxLength = 10;
- PurchaseVATDelaySourceCodeDescriptionTxt: Label 'Purchase VAT Delay', MaxLength = 100;
- SalesVATDelaySourceCodeTxt: Label 'VATSD', MaxLength = 10;
- SalesVATDelaySourceCodeDescriptionTxt: Label 'Sales VAT Delay', MaxLength = 100;
- VATLCYCorrectionSourceCodeTxt: Label 'VATCORR', MaxLength = 10;
- VATLCYCorrectionSourceCodeDescriptionTxt: Label 'VAT Correction in LCY', MaxLength = 100;
- OpenBalanceSheetSourceCodeTxt: Label 'OPBALANCE', MaxLength = 10;
- OpenBalanceSheetSourceCodeDescriptionTxt: Label 'Open Balance Sheet', MaxLength = 100;
- CloseBalanceSheetSourceCodeTxt: Label 'CLBALANCE', MaxLength = 10;
- CloseBalanceSheetSourceCodeDescriptionTxt: Label 'Close Balance Sheet', MaxLength = 100;
begin
if not SourceCodeSetup.Get() then begin
SourceCodeSetup.Init();
@@ -825,12 +820,14 @@ codeunit 11748 "Install Application CZL"
InsertSourceCode(SourceCodeSetup."VAT LCY Correction CZL", VATLCYCorrectionSourceCodeTxt, VATLCYCorrectionSourceCodeDescriptionTxt);
InsertSourceCode(SourceCodeSetup."Open Balance Sheet CZL", OpenBalanceSheetSourceCodeTxt, OpenBalanceSheetSourceCodeDescriptionTxt);
InsertSourceCode(SourceCodeSetup."Close Balance Sheet CZL", CloseBalanceSheetSourceCodeTxt, CloseBalanceSheetSourceCodeDescriptionTxt);
+ InsertSourceCode(SourceCodeSetup."VAT Coeff. Correction CZL", VATCoeffCorrectionSourceCodeTxt, VATCoeffCorrectionSourceCodeDescriptionTxt);
if (SourceCodeSetup."Purchase VAT Delay CZL" <> PrevSourceCodeSetup."Purchase VAT Delay CZL") or
(SourceCodeSetup."Sales VAT Delay CZL" <> PrevSourceCodeSetup."Sales VAT Delay CZL") or
(SourceCodeSetup."VAT LCY Correction CZL" <> PrevSourceCodeSetup."VAT LCY Correction CZL") or
(SourceCodeSetup."Open Balance Sheet CZL" <> PrevSourceCodeSetup."Open Balance Sheet CZL") or
- (SourceCodeSetup."Close Balance Sheet CZL" <> PrevSourceCodeSetup."Close Balance Sheet CZL")
+ (SourceCodeSetup."Close Balance Sheet CZL" <> PrevSourceCodeSetup."Close Balance Sheet CZL") or
+ (SourceCodeSetup."VAT Coeff. Correction CZL" <> PrevSourceCodeSetup."VAT Coeff. Correction CZL")
then
SourceCodeSetup.Modify();
end;
diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/UserSetupAdvManagementCZL.Codeunit.al b/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/UserSetupAdvManagementCZL.Codeunit.al
index 0ca6ec69d0..bfdc2d5f39 100644
--- a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/UserSetupAdvManagementCZL.Codeunit.al
+++ b/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/UserSetupAdvManagementCZL.Codeunit.al
@@ -420,4 +420,10 @@ codeunit 31072 "User Setup Adv. Management CZL"
GetUserSetup();
UserSetup.TestField("Allow VAT Date Changing CZL");
end;
+
+ procedure CheckOrigDocVATDateChanging()
+ begin
+ GetUserSetup();
+ UserSetup.TestField("Allow Orig Doc VAT Date Ch CZL");
+ end;
}
diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/VATCorrNotifHandlerCZL.Codeunit.al b/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/VATCorrNotifHandlerCZL.Codeunit.al
index a6be51b300..67d7b781fa 100644
--- a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/VATCorrNotifHandlerCZL.Codeunit.al
+++ b/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/VATCorrNotifHandlerCZL.Codeunit.al
@@ -8,10 +8,16 @@ using Microsoft.CRM.Outlook;
using Microsoft.Foundation.Enums;
using Microsoft.Purchases.Document;
using Microsoft.Purchases.History;
+using Microsoft.Sales.Document;
+using Microsoft.Sales.History;
using Microsoft.Utilities;
codeunit 31029 "VAT Corr. Notif. Handler CZL"
{
+ var
+ OpenInvoiceVATLCYCorrectionQst: Label 'The invoice has been posted in a foreign currency, please check the conversion of the VAT amount to local currency.\\Do you want to open the posted invoice %1 and check now?', Comment = '%1 = posted document number';
+ OpenCrMemoVATLCYCorrectionQst: Label 'The credit memo has been posted in a foreign currency, please check the conversion of the VAT amount to local currency.\\Do you want to open the posted credit memo %1 and check now?', Comment = '%1 = posted document number';
+
[EventSubscriber(ObjectType::Page, Page::"Purchase Invoice", 'OnPostDocumentBeforeNavigateAfterPosting', '', false, false)]
local procedure ShowVATLCYCorrectionAfterPostingPurchaseInvoice(var PurchaseHeader: Record "Purchase Header"; var PostingCodeunitID: Integer; var Navigate: Enum "Navigate After Posting"; DocumentIsPosted: Boolean; var IsHandled: Boolean)
var
@@ -20,7 +26,6 @@ codeunit 31029 "VAT Corr. Notif. Handler CZL"
InstructionMgtCZL: Codeunit "Instruction Mgt. CZL";
OfficeManagement: Codeunit "Office Management";
PostedPurchaseInvoice: Page "Posted Purchase Invoice";
- OpenVATLCYCorrectionQst: Label 'The invoice has been posted in a foreign currency, please check the conversion of the VAT amount to local currency.\\Do you want to open the posted invoice %1 and check now?', Comment = '%1 = posted document number';
PopUpVATLCYCorrectionCZL: Boolean;
begin
if IsHandled then
@@ -36,7 +41,7 @@ codeunit 31029 "VAT Corr. Notif. Handler CZL"
PopUpVATLCYCorrectionCZL := true
else
if InstructionMgt.IsEnabled(InstructionMgtCZL.ShowVATLCYCorrectionConfirmationMessageCode()) then
- if InstructionMgt.ShowConfirm(StrSubstNo(OpenVATLCYCorrectionQst, PurchInvHeader."No."), InstructionMgtCZL.ShowVATLCYCorrectionConfirmationMessageCode()) then
+ if InstructionMgt.ShowConfirm(StrSubstNo(OpenInvoiceVATLCYCorrectionQst, PurchInvHeader."No."), InstructionMgtCZL.ShowVATLCYCorrectionConfirmationMessageCode()) then
PopUpVATLCYCorrectionCZL := true;
if not PopUpVATLCYCorrectionCZL then
@@ -66,7 +71,6 @@ codeunit 31029 "VAT Corr. Notif. Handler CZL"
InstructionMgtCZL: Codeunit "Instruction Mgt. CZL";
OfficeManagement: Codeunit "Office Management";
PostedPurchaseCreditMemo: Page "Posted Purchase Credit Memo";
- OpenVATLCYCorrectionQst: Label 'The credit memo has been posted in a foreign currency, please check the conversion of the VAT amount to local currency.\\Do you want to open the posted credit memo %1 and check now?', Comment = '%1 = posted document number';
PopUpVATLCYCorrectionCZL: Boolean;
begin
if IsHandled then
@@ -81,7 +85,7 @@ codeunit 31029 "VAT Corr. Notif. Handler CZL"
PopUpVATLCYCorrectionCZL := true
else
if InstructionMgt.IsEnabled(InstructionMgtCZL.ShowVATLCYCorrectionConfirmationMessageCode()) then
- if InstructionMgt.ShowConfirm(StrSubstNo(OpenVATLCYCorrectionQst, PurchCrMemoHdr."No."), InstructionMgtCZL.ShowVATLCYCorrectionConfirmationMessageCode()) then
+ if InstructionMgt.ShowConfirm(StrSubstNo(OpenCrMemoVATLCYCorrectionQst, PurchCrMemoHdr."No."), InstructionMgtCZL.ShowVATLCYCorrectionConfirmationMessageCode()) then
PopUpVATLCYCorrectionCZL := true;
if not PopUpVATLCYCorrectionCZL then
@@ -102,4 +106,93 @@ codeunit 31029 "VAT Corr. Notif. Handler CZL"
Rec.SetPopUpVATLCYCorrectionCZL(false);
Rec.MakeVATLCYCorrectionCZL();
end;
+
+ [EventSubscriber(ObjectType::Page, Page::"Sales Invoice", 'OnPostDocumentBeforeNavigateAfterPosting', '', false, false)]
+ local procedure ShowVATLCYCorrectionAfterPostingSalesInvoice(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)
+ var
+ SalesInvoiceHeader: Record "Sales Invoice Header";
+ InstructionMgt: Codeunit "Instruction Mgt.";
+ InstructionMgtCZL: Codeunit "Instruction Mgt. CZL";
+ OfficeManagement: Codeunit "Office Management";
+ PostedSalesInvoice: Page "Posted Sales Invoice";
+ PopUpVATLCYCorrectionCZL: Boolean;
+ begin
+ if IsHandled then
+ exit;
+ SalesInvoiceHeader.SetRange("Pre-Assigned No.", SalesHeader."No.");
+ SalesInvoiceHeader.SetRange("Order No.", '');
+ if not SalesInvoiceHeader.FindFirst() then
+ exit;
+ if not SalesInvoiceHeader.IsVATLCYCorrectionAllowedCZL() then
+ exit;
+
+ if OfficeManagement.IsAvailable() then
+ PopUpVATLCYCorrectionCZL := true
+ else
+ if InstructionMgt.IsEnabled(InstructionMgtCZL.ShowVATLCYCorrectionConfirmationMessageCode()) then
+ if InstructionMgt.ShowConfirm(StrSubstNo(OpenInvoiceVATLCYCorrectionQst, SalesInvoiceHeader."No."), InstructionMgtCZL.ShowVATLCYCorrectionConfirmationMessageCode()) then
+ PopUpVATLCYCorrectionCZL := true;
+
+ if not PopUpVATLCYCorrectionCZL then
+ exit;
+
+ IsHandled := true;
+ PostedSalesInvoice.SetTableView(SalesInvoiceHeader);
+ PostedSalesInvoice.SetRecord(SalesInvoiceHeader);
+ PostedSalesInvoice.SetRecPopUpVATLCYCorrectionCZL(true);
+ PostedSalesInvoice.Run();
+ end;
+
+ [EventSubscriber(ObjectType::Page, Page::"Posted Sales Invoice", 'OnAfterGetCurrRecordEvent', '', false, false)]
+ local procedure PopUpVATLCYCorrectionCZLOnOpenPostedSalesInvoice(var Rec: Record "Sales Invoice Header")
+ begin
+ if not Rec.GetPopUpVATLCYCorrectionCZL() then
+ exit;
+ Rec.SetPopUpVATLCYCorrectionCZL(false);
+ Rec.MakeVATLCYCorrectionCZL();
+ end;
+
+ [EventSubscriber(ObjectType::Page, Page::"Sales Credit Memo", 'OnPostDocumentBeforeNavigateAfterPosting', '', false, false)]
+ local procedure ShowVATLCYCorrectionAfterPostingSalesCreditMemo(var SalesHeader: Record "Sales Header"; var IsHandled: Boolean)
+ var
+ SalesCrMemoHeader: Record "Sales Cr.Memo Header";
+ InstructionMgt: Codeunit "Instruction Mgt.";
+ InstructionMgtCZL: Codeunit "Instruction Mgt. CZL";
+ OfficeManagement: Codeunit "Office Management";
+ PostedSalesCreditMemo: Page "Posted Sales Credit Memo";
+ PopUpVATLCYCorrectionCZL: Boolean;
+ begin
+ if IsHandled then
+ exit;
+ SalesCrMemoHeader.SetRange("Pre-Assigned No.", SalesHeader."No.");
+ if not SalesCrMemoHeader.FindFirst() then
+ exit;
+ if not SalesCrMemoHeader.IsVATLCYCorrectionAllowedCZL() then
+ exit;
+
+ if OfficeManagement.IsAvailable() then
+ PopUpVATLCYCorrectionCZL := true
+ else
+ if InstructionMgt.IsEnabled(InstructionMgtCZL.ShowVATLCYCorrectionConfirmationMessageCode()) then
+ if InstructionMgt.ShowConfirm(StrSubstNo(OpenCrMemoVATLCYCorrectionQst, SalesCrMemoHeader."No."), InstructionMgtCZL.ShowVATLCYCorrectionConfirmationMessageCode()) then
+ PopUpVATLCYCorrectionCZL := true;
+
+ if not PopUpVATLCYCorrectionCZL then
+ exit;
+
+ IsHandled := true;
+ PostedSalesCreditMemo.SetTableView(SalesCrMemoHeader);
+ PostedSalesCreditMemo.SetRecord(SalesCrMemoHeader);
+ PostedSalesCreditMemo.SetRecPopUpVATLCYCorrectionCZL(true);
+ PostedSalesCreditMemo.Run();
+ end;
+
+ [EventSubscriber(ObjectType::Page, Page::"Posted Sales Credit Memo", 'OnAfterGetCurrRecordEvent', '', false, false)]
+ local procedure PopUpVATLCYCorrectionCZLOnOpenPostedSalesCreditMemo(var Rec: Record "Sales Cr.Memo Header")
+ begin
+ if not Rec.GetPopUpVATLCYCorrectionCZL() then
+ exit;
+ Rec.SetPopUpVATLCYCorrectionCZL(false);
+ Rec.MakeVATLCYCorrectionCZL();
+ end;
}
diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/VATEntryHandlerCZL.Codeunit.al b/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/VATEntryHandlerCZL.Codeunit.al
index b2a8eb84de..57130a3d5a 100644
--- a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/VATEntryHandlerCZL.Codeunit.al
+++ b/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/VATEntryHandlerCZL.Codeunit.al
@@ -41,5 +41,6 @@ codeunit 11741 "VAT Entry Handler CZL"
begin
VATEntry."EU 3-Party Intermed. Role CZL" := FromVATEntry."EU 3-Party Intermed. Role CZL";
VATEntry."External Document No." := FromVATEntry."External Document No.";
+ VATEntry."Original Doc. VAT Date CZL" := FromVATEntry."Original Doc. VAT Date CZL";
end;
}
diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/VATLCYCorrectionPostCZL.Codeunit.al b/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/VATLCYCorrectionPostCZL.Codeunit.al
index 6a6a1e802a..1327e834e5 100644
--- a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/VATLCYCorrectionPostCZL.Codeunit.al
+++ b/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/VATLCYCorrectionPostCZL.Codeunit.al
@@ -91,7 +91,7 @@ codeunit 31013 "VAT LCY Correction-Post CZL"
local procedure PostCorrectionAmount(var VATLCYCorrectionBufferCZL: Record "VAT LCY Correction Buffer CZL")
var
- PurchVATAccount: Code[20];
+ VATAccountNo: Code[20];
VATLCYCorrRoundingAccNo: Code[20];
begin
if VATLCYCorrectionBufferCZL."VAT Correction Amount" = 0 then
@@ -102,13 +102,24 @@ codeunit 31013 "VAT LCY Correction-Post CZL"
CheckVATDateCZL(VATLCYCorrectionBufferCZL);
VATEntry.Get(VATLCYCorrectionBufferCZL."Entry No.");
- VATEntry.TestField(Type, VATEntry.Type::Purchase);
+ if not (VATEntry.Type in [VATEntry.Type::Sale, VATEntry.Type::Purchase]) then
+ VATEntry.FieldError(Type);
VATPostingSetup.Get(VATLCYCorrectionBufferCZL."VAT Bus. Posting Group", VATLCYCorrectionBufferCZL."VAT Prod. Posting Group");
- PurchVATAccount := VATPostingSetup.GetPurchAccount(false);
- VATLCYCorrRoundingAccNo := VATPostingSetup.GetLCYCorrRoundingAccCZL();
+ case VATEntry.Type of
+ VATEntry.Type::Purchase:
+ begin
+ VATAccountNo := VATPostingSetup.GetPurchAccount(false);
+ VATLCYCorrRoundingAccNo := VATPostingSetup.GetPurchaseLCYCorrRoundingAccCZL();
+ end;
+ VATEntry.Type::Sale:
+ begin
+ VATAccountNo := VATPostingSetup.GetSalesAccount(false);
+ VATLCYCorrRoundingAccNo := VATPostingSetup.GetSalesLCYCorrRoundingAccCZL();
+ end;
+ end;
- // Post to Purchase VAT Account
- SetGenJournalLine(GenJournalLine, VATLCYCorrectionBufferCZL, PurchVATAccount, VATLCYCorrectionBufferCZL."VAT Correction Amount", true);
+ // Post to VAT Account
+ SetGenJournalLine(GenJournalLine, VATLCYCorrectionBufferCZL, VATAccountNo, VATLCYCorrectionBufferCZL."VAT Correction Amount", true);
CopyFromVATEntry(GenJournalLine, VATEntry);
SetDefaultDimensions(GenJournalLine);
OnPostCorrectionAmountOnBeforePostVATAccountLine(GenJournalLine);
diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/VATOrigDocVATDateMgtCZL.Codeunit.al b/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/VATOrigDocVATDateMgtCZL.Codeunit.al
new file mode 100644
index 0000000000..c37b10b9a5
--- /dev/null
+++ b/Apps/CZ/CoreLocalizationPack/app/Src/Codeunits/VATOrigDocVATDateMgtCZL.Codeunit.al
@@ -0,0 +1,197 @@
+// ------------------------------------------------------------------------------------------------
+// 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;
+
+using Microsoft.Finance.VAT.Reporting;
+using Microsoft.Finance.VAT.Ledger;
+using Microsoft.Purchases.History;
+using System.Security.User;
+
+codeunit 11733 "VAT Orig.Doc.VAT Date Mgt. CZL"
+{
+ Permissions = TableData "VAT Ctrl. Report Header CZL" = r,
+ TableData "VAT Ctrl. Report Line CZL" = rm,
+ TableData "Purch. Inv. Header" = rm,
+ TableData "Purch. Cr. Memo Hdr." = rm,
+ TableData "VAT Entry" = rm;
+
+ trigger OnRun()
+ begin
+
+ end;
+
+ var
+ MustBeLessOrEqualErr: Label 'must be less or equal to %1', Comment = '%1 = fieldcaption of VAT Reporting Date';
+ VATControlReportClosedErr: Label 'The VAT Entry is suggested in the released or closed VAT Control Report %1.\The Original Document VAT Date cannot be changed.', Comment = '%1 = VAT Control Report No.';
+
+ procedure UpdateOrigDocVATDate(VATEntry: Record "VAT Entry")
+ var
+ UserSetupAdvManagementCZL: Codeunit "User Setup Adv. Management CZL";
+ begin
+ UserSetupAdvManagementCZL.CheckOrigDocVATDateChanging();
+ CheckVATEntry(VATEntry);
+ CheckVATCtrlReport(VATEntry);
+
+ if not ConfirmAffectedVATEntries(VATEntry) then
+ Error('');
+
+ UpdateVATEntries(VATEntry);
+ UpdatePostedDocuments(VATEntry);
+ UpdateVATCtrlReportLines(VATEntry);
+
+ OnAfterUpdateOrigDocVATDate(VATEntry);
+ end;
+
+ local procedure CheckVATEntry(VATEntry: Record "VAT Entry")
+ begin
+ VATEntry.TestField(Closed, false);
+ if VATEntry.Type = VATEntry.Type::Purchase then
+ if VATEntry."Original Doc. VAT Date CZL" > VATEntry."VAT Reporting Date" then
+ VATEntry.FieldError("Original Doc. VAT Date CZL", StrSubstNo(MustBeLessOrEqualErr, VATEntry.FieldCaption(VATEntry."VAT Reporting Date")));
+ end;
+
+ local procedure CheckVATCtrlReport(VATEntry: Record "VAT Entry")
+ var
+ VATCtrlReportHeaderCZL: Record "VAT Ctrl. Report Header CZL";
+ VATCtrlReportLineCZL: Record "VAT Ctrl. Report Line CZL";
+ begin
+ VATEntry.CalcFields("VAT Ctrl. Report No. CZL");
+ if VATEntry."VAT Ctrl. Report No. CZL" = '' then
+ exit;
+
+ VATCtrlReportHeaderCZL.Get(VATEntry."VAT Ctrl. Report No. CZL");
+ VATCtrlReportHeaderCZL.TestField(Status, VATCtrlReportHeaderCZL.Status::Open);
+ FilterRelatedVATCtrlReportLine(VATEntry, VATCtrlReportLineCZL);
+ VATCtrlReportLineCZL.SetFilter("Closed by Document No.", '<>%1', '');
+ if not VATCtrlReportLineCZL.IsEmpty() then
+ Error(VATControlReportClosedErr, VATCtrlReportHeaderCZL."No.");
+ end;
+
+ local procedure ConfirmAffectedVATEntries(VATEntry: Record "VAT Entry"): Boolean
+ var
+ TempRelatedVATEntry: Record "VAT Entry" temporary;
+ ConfVATEntUpdateMgtCZL: Codeunit "Conf. VAT Ent. Update Mgt. CZL";
+ begin
+ GetRelatedVATEntries(VATEntry, TempRelatedVATEntry);
+ if TempRelatedVATEntry.IsEmpty() then
+ exit(true);
+ exit(ConfVATEntUpdateMgtCZL.GetResponseOrDefault(TempRelatedVATEntry, true));
+ end;
+
+ local procedure GetRelatedVATEntries(VATEntry: Record "VAT Entry"; var TempRelatedVATEntry: Record "VAT Entry" temporary)
+ var
+ RelatedVATEntry: Record "VAT Entry";
+ begin
+ FilterRelatedVATEntries(VATEntry, RelatedVATEntry);
+ if RelatedVATEntry.FindSet() then
+ repeat
+ AddToBuffer(RelatedVATEntry, TempRelatedVATEntry);
+ until RelatedVATEntry.Next() = 0;
+
+ FilterRelatedVATEntriesByVATCtrlReport(VATEntry, RelatedVATEntry);
+ if RelatedVATEntry.FindSet() then
+ repeat
+ AddToBuffer(RelatedVATEntry, TempRelatedVATEntry);
+ until RelatedVATEntry.Next() = 0;
+ end;
+
+ local procedure AddToBuffer(VATEntry: Record "VAT Entry"; var TempVATEntry: Record "VAT Entry")
+ begin
+ if TempVATEntry.Get(VATEntry."Entry No.") then
+ exit;
+ TempVATEntry := VATEntry;
+ TempVATEntry.Insert();
+ end;
+
+ local procedure UpdateVATEntries(VATEntry: Record "VAT Entry")
+ var
+ RelatedVATEntry: Record "VAT Entry";
+ begin
+ FilterRelatedVATEntries(VATEntry, RelatedVATEntry);
+ RelatedVATEntry.ModifyAll("Original Doc. VAT Date CZL", VATEntry."Original Doc. VAT Date CZL");
+ FilterRelatedVATEntriesByVATCtrlReport(VATEntry, RelatedVATEntry);
+ RelatedVATEntry.ModifyAll("Original Doc. VAT Date CZL", VATEntry."Original Doc. VAT Date CZL");
+ end;
+
+ local procedure UpdatePostedDocuments(VATEntry: Record "VAT Entry")
+ var
+ PurchInvHeader: Record "Purch. Inv. Header";
+ PurchCrMemoHeader: Record "Purch. Cr. Memo Hdr.";
+ begin
+ if VATEntry.Type = VATEntry.Type::Purchase then
+ exit;
+
+ case VATEntry."Document Type" of
+ VATEntry."Document Type"::Invoice:
+ begin
+ FilterPurchInvoiceHeader(VATEntry, PurchInvHeader);
+ PurchInvHeader.ModifyAll("Original Doc. VAT Date CZL", VATEntry."Original Doc. VAT Date CZL");
+ end;
+ VATEntry."Document Type"::"Credit Memo":
+ begin
+ FilterPurchCrMemoHeader(VATEntry, PurchCrMemoHeader);
+ PurchCrMemoHeader.ModifyAll("Original Doc. VAT Date CZL", VATEntry."Original Doc. VAT Date CZL");
+ end;
+ end;
+ end;
+
+ local procedure UpdateVATCtrlReportLines(VATEntry: Record "VAT Entry")
+ var
+ RelatedVATCtrlReportLineCZL: Record "VAT Ctrl. Report Line CZL";
+ begin
+ VATEntry.CalcFields("VAT Ctrl. Report No. CZL");
+ if VATEntry."VAT Ctrl. Report No. CZL" = '' then
+ exit;
+
+ FilterRelatedVATCtrlReportLine(VATEntry, RelatedVATCtrlReportLineCZL);
+ RelatedVATCtrlReportLineCZL.ModifyAll("Original Document VAT Date", VATEntry."Original Doc. VAT Date CZL");
+ end;
+
+ local procedure FilterRelatedVATCtrlReportLine(VATEntry: Record "VAT Entry"; var RelatedVATCtrlReportLineCZL: Record "VAT Ctrl. Report Line CZL")
+ begin
+ RelatedVATCtrlReportLineCZL.Reset();
+ RelatedVATCtrlReportLineCZL.SetRange("VAT Ctrl. Report No.", VATEntry."VAT Ctrl. Report No. CZL");
+ RelatedVATCtrlReportLineCZL.SetRange("Document No.", VATEntry."Document No.");
+ RelatedVATCtrlReportLineCZL.SetRange("Posting Date", VATEntry."Posting Date");
+ end;
+
+ local procedure FilterRelatedVATEntries(VATEntry: Record "VAT Entry"; var RelatedVATEntry: Record "VAT Entry")
+ begin
+ RelatedVATEntry.Reset();
+ RelatedVATEntry.SetFilter("Entry No.", '<>%1', VATEntry."Entry No.");
+ RelatedVATEntry.SetRange(Type, VATEntry.Type);
+ RelatedVATEntry.SetRange("Document No.", VATEntry."Document No.");
+ RelatedVATEntry.SetRange("Posting Date", VATEntry."Posting Date");
+ end;
+
+ local procedure FilterRelatedVATEntriesByVATCtrlReport(VATEntry: Record "VAT Entry"; var RelatedVATEntry: Record "VAT Entry")
+ begin
+ RelatedVATEntry.Reset();
+ RelatedVATEntry.SetFilter("Entry No.", '<>%1', VATEntry."Entry No.");
+ RelatedVATEntry.SetFilter("Original Doc. VAT Date CZL", '<>%1', VATEntry."Original Doc. VAT Date CZL");
+ RelatedVATEntry.SetRange("VAT Ctrl. Report No. CZL", VATEntry."VAT Ctrl. Report No. CZL");
+ RelatedVATEntry.SetRange("VAT Ctrl. Report Line No. CZL", VATEntry."VAT Ctrl. Report Line No. CZL");
+ end;
+
+ local procedure FilterPurchInvoiceHeader(VATEntry: Record "VAT Entry"; var PurchInvoiceHeader: Record "Purch. Inv. Header")
+ begin
+ PurchInvoiceHeader.Reset();
+ PurchInvoiceHeader.SetRange("No.", VATEntry."Document No.");
+ PurchInvoiceHeader.SetRange("Posting Date", VATEntry."Posting Date");
+ PurchInvoiceHeader.SetRange("Vendor Invoice No.", VATEntry."External Document No.");
+ end;
+
+ local procedure FilterPurchCrMemoHeader(VATEntry: Record "VAT Entry"; var PurchCrMemoHeader: Record "Purch. Cr. Memo Hdr.")
+ begin
+ PurchCrMemoHeader.Reset();
+ PurchCrMemoHeader.SetRange("No.", VATEntry."Document No.");
+ PurchCrMemoHeader.SetRange("Posting Date", VATEntry."Posting Date");
+ end;
+
+ [IntegrationEvent(false, false)]
+ local procedure OnAfterUpdateOrigDocVATDate(VATEntry: Record "VAT Entry")
+ begin
+ end;
+}
\ No newline at end of file
diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/PostedSalesCreditMemoCZL.PageExt.al b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/PostedSalesCreditMemoCZL.PageExt.al
index 508a5618ca..c1a84f6c80 100644
--- a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/PostedSalesCreditMemoCZL.PageExt.al
+++ b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/PostedSalesCreditMemoCZL.PageExt.al
@@ -242,13 +242,44 @@ pageextension 11735 "Posted Sales Credit Memo CZL" extends "Posted Sales Credit
}
}
+ actions
+ {
+ addlast(Processing)
+ {
+ action(VATLCYCorrectionCZL)
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'VAT LCY Correction';
+ Image = AdjustEntries;
+ ToolTip = 'Allows you to adjust the VAT amount in LCY for sales documents charged in a foreign currency.';
+ Visible = VATLCYCorrectionCZLVisible;
+
+ trigger OnAction()
+ begin
+ Rec.MakeVATLCYCorrectionCZL();
+ end;
+ }
+ }
+ }
+
trigger OnOpenPage()
begin
AddCurrencyVisible := GeneralLedgerSetup.IsAdditionalCurrencyEnabledCZL();
end;
+ trigger OnAfterGetCurrRecord()
+ begin
+ VATLCYCorrectionCZLVisible := Rec.IsVATLCYCorrectionAllowedCZL();
+ end;
+
var
GeneralLedgerSetup: Record "General Ledger Setup";
ChangeExchangeRate: Page "Change Exchange Rate";
+ VATLCYCorrectionCZLVisible: Boolean;
AddCurrencyVisible: Boolean;
+
+ procedure SetRecPopUpVATLCYCorrectionCZL(NewPopUpVATLCYCorrection: Boolean)
+ begin
+ Rec.SetPopUpVATLCYCorrectionCZL(NewPopUpVATLCYCorrection);
+ end;
}
diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/PostedSalesInvoiceCZL.PageExt.al b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/PostedSalesInvoiceCZL.PageExt.al
index f454bed89c..0ba41debc8 100644
--- a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/PostedSalesInvoiceCZL.PageExt.al
+++ b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/PostedSalesInvoiceCZL.PageExt.al
@@ -208,13 +208,44 @@ pageextension 11733 "Posted Sales Invoice CZL" extends "Posted Sales Invoice"
}
}
+ actions
+ {
+ addlast(Processing)
+ {
+ action(VATLCYCorrectionCZL)
+ {
+ ApplicationArea = Basic, Suite;
+ Caption = 'VAT LCY Correction';
+ Image = AdjustEntries;
+ ToolTip = 'Allows you to adjust the VAT amount in LCY for sales documents charged in a foreign currency.';
+ Visible = VATLCYCorrectionCZLVisible;
+
+ trigger OnAction()
+ begin
+ Rec.MakeVATLCYCorrectionCZL();
+ end;
+ }
+ }
+ }
+
trigger OnOpenPage()
begin
AddCurrencyVisible := GeneralLedgerSetup.IsAdditionalCurrencyEnabledCZL();
end;
+ trigger OnAfterGetCurrRecord()
+ begin
+ VATLCYCorrectionCZLVisible := Rec.IsVATLCYCorrectionAllowedCZL();
+ end;
+
var
GeneralLedgerSetup: Record "General Ledger Setup";
ChangeExchangeRate: Page "Change Exchange Rate";
+ VATLCYCorrectionCZLVisible: Boolean;
AddCurrencyVisible: Boolean;
+
+ procedure SetRecPopUpVATLCYCorrectionCZL(NewPopUpVATLCYCorrection: Boolean)
+ begin
+ Rec.SetPopUpVATLCYCorrectionCZL(NewPopUpVATLCYCorrection);
+ end;
}
diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/UserSetupCZL.PageExt.al b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/UserSetupCZL.PageExt.al
index c29f10f9ef..f2970e286e 100644
--- a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/UserSetupCZL.PageExt.al
+++ b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/UserSetupCZL.PageExt.al
@@ -4,68 +4,81 @@
// ------------------------------------------------------------------------------------------------
namespace System.Security.User;
+using Microsoft.Finance.GeneralLedger.Setup;
+
pageextension 11721 "User Setup CZL" extends "User Setup"
{
layout
{
- addlast(Control1)
+ addbefore(Email)
{
field("Employee No. CZL"; Rec."Employee No. CZL")
{
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies the connectivity between User ID and employee number.';
- Visible = false;
}
+ }
+ addlast(Control1)
+ {
field("Allow Item Unapply CZL"; Rec."Allow Item Unapply CZL")
{
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies the possibillity to allow or not allow item apply.';
- Visible = false;
+ Visible = IsUserChecksAllowed;
}
field("Check Doc. Date(work date) CZL"; Rec."Check Doc. Date(work date) CZL")
{
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies check document date (work date) allowed for posting (set in lines).';
+ Visible = IsUserChecksAllowed;
}
field("Check Doc. Date(sys. date) CZL"; Rec."Check Doc. Date(sys. date) CZL")
{
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies check document date (system date) allowed for posting (set in lines).';
+ Visible = IsUserChecksAllowed;
}
field("Check Post.Date(work date) CZL"; Rec."Check Post.Date(work date) CZL")
{
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies check posting date (work date) allowed for posting (set in lines).';
+ Visible = IsUserChecksAllowed;
}
field("Check Post.Date(sys. date) CZL"; Rec."Check Post.Date(sys. date) CZL")
{
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies check posting date (system date) allowed for posting (set in lines).';
+ Visible = IsUserChecksAllowed;
}
field("Check Bank Accounts CZL"; Rec."Check Bank Accounts CZL")
{
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies check Bank Accounts allowed for posting (set in lines) for selected user.';
+ Visible = IsUserChecksAllowed;
}
field("Check Journal Templates CZL"; Rec."Check Journal Templates CZL")
{
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies check journal templates allowed for posting (set in lines) for selected user.';
+ Visible = IsUserChecksAllowed;
}
field("Check Dimension Values CZL"; Rec."Check Dimension Values CZL")
{
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies check Dimension Values allowed for posting (set in lines).';
+ Visible = IsUserChecksAllowed;
}
field("Allow Post.toClosed Period CZL"; Rec."Allow Post.toClosed Period CZL")
{
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies the possibillity to allow or not allow posting to closed period.';
+ Visible = IsUserChecksAllowed;
}
field("Allow Complete Job CZL"; Rec."Allow Complete Job CZL")
{
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies the possibillity to allow or not allow complete job.';
+ Visible = IsUserChecksAllowed;
}
field("User Name CZL"; Rec."User Name CZL")
{
@@ -76,16 +89,19 @@ pageextension 11721 "User Setup CZL" extends "User Setup"
{
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies check location code allowed for posting (set in lines) for selected user.';
+ Visible = IsUserChecksAllowed;
}
field("Check Release LocationCode CZL"; Rec."Check Release LocationCode CZL")
{
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies check release location code allowed for posting (set in lines) for selected user.';
+ Visible = IsUserChecksAllowed;
}
field("Check Invt. Movement Temp. CZL"; Rec."Check Invt. Movement Temp. CZL")
{
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies check Invt. Movement Templates allowed for posting (set in lines) for selected user.';
+ Visible = IsUserChecksAllowed;
}
}
}
@@ -96,6 +112,7 @@ pageextension 11721 "User Setup CZL" extends "User Setup"
group("User Check CZL")
{
Caption = 'User Check';
+
action("Card CZL")
{
ApplicationArea = Basic, Suite;
@@ -105,6 +122,7 @@ pageextension 11721 "User Setup CZL" extends "User Setup"
RunPageLink = "User ID" = field("User ID");
ShortcutKey = 'Shift+F7';
ToolTip = 'Specifies the user setup card.';
+ Visible = IsUserChecksAllowed;
}
action("Lines CZL")
{
@@ -114,6 +132,7 @@ pageextension 11721 "User Setup CZL" extends "User Setup"
RunObject = page "User Setup Lines CZL";
RunPageLink = "User ID" = field("User ID");
ToolTip = 'Specifies the lines for another user setup.';
+ Visible = IsUserChecksAllowed;
}
action("Dimensions CZL")
{
@@ -122,6 +141,7 @@ pageextension 11721 "User Setup CZL" extends "User Setup"
Image = Dimensions;
ShortcutKey = 'Shift+Ctrl+D';
ToolTip = 'Specifies the dimensions related to the user.';
+ Visible = IsUserChecksAllowed;
trigger OnAction()
var
@@ -135,6 +155,7 @@ pageextension 11721 "User Setup CZL" extends "User Setup"
group("Functions CZL")
{
Caption = 'Functions';
+
action("Copy User Setup CZL")
{
ApplicationArea = Basic, Suite;
@@ -142,6 +163,7 @@ pageextension 11721 "User Setup CZL" extends "User Setup"
Ellipsis = true;
Image = Copy;
ToolTip = 'Allows to copy user setup from user to another user.';
+ Visible = IsUserChecksAllowed;
trigger OnAction()
var
@@ -164,6 +186,7 @@ pageextension 11721 "User Setup CZL" extends "User Setup"
Ellipsis = true;
Image = Print;
ToolTip = 'Open the report for user setup.';
+ Visible = IsUserChecksAllowed;
trigger OnAction()
var
@@ -177,11 +200,38 @@ pageextension 11721 "User Setup CZL" extends "User Setup"
}
}
}
- addlast(Category_Process)
+ addlast(Promoted)
{
- actionref("Print CZL_Promoted"; "Print CZL")
+ group(UserCheckPromotedCZL)
{
+ Caption = 'User Check';
+
+ actionref(CardCZL_Promoted; "Card CZL")
+ {
+ }
+ actionref(LinesCZL_Promoted; "Lines CZL")
+ {
+ }
+ actionref(DimensionsCZL_Promoted; "Dimensions CZL")
+ {
+ }
+ actionref(CopyUserSetupCZL_Promoted; "Copy User Setup CZL")
+ {
+ }
+ actionref("Print CZL_Promoted"; "Print CZL")
+ {
+ }
}
}
}
+
+ var
+ GeneralLedgerSetup: Record "General Ledger Setup";
+ IsUserChecksAllowed: Boolean;
+
+ trigger OnOpenPage()
+ begin
+ GeneralLedgerSetup.Get();
+ IsUserChecksAllowed := GeneralLedgerSetup."User Checks Allowed CZL";
+ end;
}
\ No newline at end of file
diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/VATEntriesCZL.PageExt.al b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/VATEntriesCZL.PageExt.al
index 513201e409..3140905ea3 100644
--- a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/VATEntriesCZL.PageExt.al
+++ b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/VATEntriesCZL.PageExt.al
@@ -16,6 +16,7 @@ pageextension 11755 "VAT Entries CZL" extends "VAT Entries"
{
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies the VAT entry''s Original Document VAT Date.';
+ Editable = IsVATDateEditable;
}
}
addafter("Posting Date")
@@ -110,11 +111,15 @@ pageextension 11755 "VAT Entries CZL" extends "VAT Entries"
}
}
trigger OnOpenPage()
+ var
+ VATReportingDateMgt: Codeunit "VAT Reporting Date Mgt";
begin
NonDeductibleVATVisible := NonDeductibleVATCZL.IsNonDeductibleVATEnabled();
+ IsVATDateEditable := VATReportingDateMgt.IsVATDateModifiable();
end;
var
NonDeductibleVATCZL: Codeunit "Non-Deductible VAT CZL";
+ IsVATDateEditable: Boolean;
NonDeductibleVATVisible: Boolean;
}
diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/VATPostingSetupCZL.PageExt.al b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/VATPostingSetupCZL.PageExt.al
index be0446ac82..907599c882 100644
--- a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/VATPostingSetupCZL.PageExt.al
+++ b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/VATPostingSetupCZL.PageExt.al
@@ -50,7 +50,13 @@ pageextension 11756 "VAT Posting Setup CZL" extends "VAT Posting Setup"
field("VAT LCY Corr. Rounding Acc.CZL"; Rec."VAT LCY Corr. Rounding Acc.CZL")
{
ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the account to which the VAT correction in LCY will be posted on documents in foreign currency, eg use an account for document rounding';
+ ToolTip = 'Specifies the account to which the VAT correction in LCY will be posted on purchase documents in foreign currency, eg use an account for document rounding';
+ Visible = false;
+ }
+ field("VAT LCY Corr. Rnd. Acc. S. CZL"; Rec."VAT LCY Corr. Rnd. Acc. S. CZL")
+ {
+ ApplicationArea = Basic, Suite;
+ ToolTip = 'Specifies the account to which the VAT correction in LCY will be posted on sales documents in foreign currency, eg use an account for document rounding';
Visible = false;
}
field("VIES Sales CZL"; Rec."VIES Sales CZL")
diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/VATPostingSetupCardCZL.PageExt.al b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/VATPostingSetupCardCZL.PageExt.al
index 937e3fa5b7..24dbf70c96 100644
--- a/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/VATPostingSetupCardCZL.PageExt.al
+++ b/Apps/CZ/CoreLocalizationPack/app/Src/PageExtensions/VATPostingSetupCardCZL.PageExt.al
@@ -85,6 +85,12 @@ pageextension 11757 "VAT Posting Setup Card CZL" extends "VAT Posting Setup Card
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies the option to include this posting setup in sales VIES declarations.';
}
+ field("VAT LCY Corr. Rnd. Acc. S. CZL"; Rec."VAT LCY Corr. Rnd. Acc. S. CZL")
+ {
+ Caption = 'VAT LCY Corr. Rounding Account';
+ ApplicationArea = Basic, Suite;
+ ToolTip = 'Specifies the account to which the VAT correction in LCY will be posted on documents in foreign currency, eg use an account for document rounding';
+ }
}
addlast(Purchases)
{
@@ -95,6 +101,7 @@ pageextension 11757 "VAT Posting Setup Card CZL" extends "VAT Posting Setup Card
}
field("VAT LCY Corr. Rounding Acc.CZL"; Rec."VAT LCY Corr. Rounding Acc.CZL")
{
+ Caption = 'VAT LCY Corr. Rounding Account';
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies the account to which the VAT correction in LCY will be posted on documents in foreign currency, eg use an account for document rounding';
}
diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/Pages/ConfirmVATEntriesUpdateCZL.Page.al b/Apps/CZ/CoreLocalizationPack/app/Src/Pages/ConfirmVATEntriesUpdateCZL.Page.al
index 3e5c69d1d6..facfd05f65 100644
--- a/Apps/CZ/CoreLocalizationPack/app/Src/Pages/ConfirmVATEntriesUpdateCZL.Page.al
+++ b/Apps/CZ/CoreLocalizationPack/app/Src/Pages/ConfirmVATEntriesUpdateCZL.Page.al
@@ -72,6 +72,12 @@ page 31214 "Confirm VAT Entries Update CZL"
ToolTip = 'Specifies the VAT date on the VAT entry. This is either the date that the document was created or posted, depending on your setting on the General Ledger Setup page.';
Visible = VATDateEnabled;
}
+ field("Original Doc. VAT Date CZL"; Rec."Original Doc. VAT Date CZL")
+ {
+ ApplicationArea = Basic, Suite;
+ ToolTip = 'Specifies the Original Document VAT date on the VAT entry.';
+ Visible = VATDateEnabled;
+ }
field("Document No."; Rec."Document No.")
{
ApplicationArea = Basic, Suite;
diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/Pages/UserSetupCardCZL.Page.al b/Apps/CZ/CoreLocalizationPack/app/Src/Pages/UserSetupCardCZL.Page.al
index d8c747da38..724b73cb94 100644
--- a/Apps/CZ/CoreLocalizationPack/app/Src/Pages/UserSetupCardCZL.Page.al
+++ b/Apps/CZ/CoreLocalizationPack/app/Src/Pages/UserSetupCardCZL.Page.al
@@ -61,6 +61,11 @@ page 31198 "User Setup Card CZL"
ApplicationArea = Basic, Suite;
ToolTip = 'Specifies whether is allowed to change the VAT Date.';
}
+ field("Allow Orig Doc VAT Date Ch CZL"; Rec."Allow Orig Doc VAT Date Ch CZL")
+ {
+ ApplicationArea = Basic, Suite;
+ ToolTip = 'Specifies whether is allowed to change the Original Document VAT Date.';
+ }
}
group(Posting)
{
@@ -178,11 +183,14 @@ page 31198 "User Setup Card CZL"
}
area(Promoted)
{
- group(Category_Process)
+ actionref(Lines_Promoted; Lines)
+ {
+ }
+ actionref(Dimensions_Promoted; Dimensions)
+ {
+ }
+ actionref("Print_Promoted"; Print)
{
- actionref(Print_Promoted; Print)
- {
- }
}
}
}
diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/Pages/VATLCYCorrectionCZL.Page.al b/Apps/CZ/CoreLocalizationPack/app/Src/Pages/VATLCYCorrectionCZL.Page.al
index 3eda44379b..f5b5f1300d 100644
--- a/Apps/CZ/CoreLocalizationPack/app/Src/Pages/VATLCYCorrectionCZL.Page.al
+++ b/Apps/CZ/CoreLocalizationPack/app/Src/Pages/VATLCYCorrectionCZL.Page.al
@@ -4,11 +4,13 @@
// ------------------------------------------------------------------------------------------------
namespace Microsoft.Finance.VAT.Calculation;
+using Microsoft.Sales.Receivables;
using Microsoft.Finance.VAT.Ledger;
using Microsoft.Finance.VAT.Setup;
using Microsoft.Foundation.AuditCodes;
using Microsoft.Purchases.History;
using Microsoft.Purchases.Payables;
+using Microsoft.Sales.History;
page 31025 "VAT LCY Correction CZL"
{
@@ -295,8 +297,11 @@ page 31025 "VAT LCY Correction CZL"
procedure InitGlobals(Variant: Variant)
var
+ CustLedgerEntry: Record "Cust. Ledger Entry";
PurchInvHeader: Record "Purch. Inv. Header";
PurchCrMemoHdr: Record "Purch. Cr. Memo Hdr.";
+ SalesInvoiceHeader: Record "Sales Invoice Header";
+ SalesCrMemoHeader: Record "Sales Cr.Memo Header";
VendorLedgerEntry: Record "Vendor Ledger Entry";
DocRecordRef: RecordRef;
IsHandled: Boolean;
@@ -324,6 +329,26 @@ page 31025 "VAT LCY Correction CZL"
VendorLedgerEntry.GetTransactionNoCZL(PurchCrMemoHdr."Vendor Ledger Entry No."),
PurchCrMemoHdr."Dimension Set ID");
end;
+ Database::"Sales Invoice Header":
+ begin
+ DocRecordRef.SetTable(SalesInvoiceHeader);
+ if not SalesInvoiceHeader.IsVATLCYCorrectionAllowedCZL() then
+ Error(NotAllowedCorrectErr, SalesInvoiceHeader.TableCaption(), SalesInvoiceHeader."No.");
+ SetDocumentGlobals(SalesInvoiceHeader."No.",
+ SalesInvoiceHeader."Posting Date",
+ CustLedgerEntry.GetTransactionNoCZL(SalesInvoiceHeader."Cust. Ledger Entry No."),
+ SalesInvoiceHeader."Dimension Set ID");
+ end;
+ Database::"Sales Cr.Memo Header":
+ begin
+ DocRecordRef.SetTable(SalesCrMemoHeader);
+ if not SalesCrMemoHeader.IsVATLCYCorrectionAllowedCZL() then
+ Error(NotAllowedCorrectErr, SalesCrMemoHeader.TableCaption(), SalesCrMemoHeader."No.");
+ SetDocumentGlobals(SalesCrMemoHeader."No.",
+ SalesCrMemoHeader."Posting Date",
+ CustLedgerEntry.GetTransactionNoCZL(SalesCrMemoHeader."Cust. Ledger Entry No."),
+ SalesCrMemoHeader."Dimension Set ID");
+ end;
else begin
IsHandled := false;
OnInitGlobals(DocRecordRef, DocumentNo, PostingDate, TransactionNo, IsHandled);
diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/Permissions/CZCorePackObjectsCZL.PermissionSet.al b/Apps/CZ/CoreLocalizationPack/app/Src/Permissions/CZCorePackObjectsCZL.PermissionSet.al
index cb306c3b2a..750e5778b3 100644
--- a/Apps/CZ/CoreLocalizationPack/app/Src/Permissions/CZCorePackObjectsCZL.PermissionSet.al
+++ b/Apps/CZ/CoreLocalizationPack/app/Src/Permissions/CZCorePackObjectsCZL.PermissionSet.al
@@ -125,6 +125,7 @@ permissionset 11732 "CZ Core Pack - Objects CZL"
codeunit "VAT Entry Handler CZL" = X,
codeunit "VAT LCY Correction-Post CZL" = X,
codeunit "VAT LCY Corr.-Post(Yes/No) CZL" = X,
+ codeunit "VAT Orig.Doc.VAT Date Mgt. CZL" = X,
codeunit "VAT Reg. Log Suppression CZL" = X,
codeunit "VAT Report Archive Mgt CZL" = X,
codeunit "VAT Report Export CZL" = X,
diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/ReportExtensions/CopyVATPostingSetupCZL.ReportExt.al b/Apps/CZ/CoreLocalizationPack/app/Src/ReportExtensions/CopyVATPostingSetupCZL.ReportExt.al
index 3b0441db67..82990b8904 100644
--- a/Apps/CZ/CoreLocalizationPack/app/Src/ReportExtensions/CopyVATPostingSetupCZL.ReportExt.al
+++ b/Apps/CZ/CoreLocalizationPack/app/Src/ReportExtensions/CopyVATPostingSetupCZL.ReportExt.al
@@ -22,6 +22,7 @@ reportextension 11700 "Copy - VAT Posting Setup CZL" extends "Copy - VAT Posting
"Ratio Coefficient CZL" := VATPostingSetup."Ratio Coefficient CZL";
"Corrections Bad Receivable CZL" := VATPostingSetup."Corrections Bad Receivable CZL";
"VAT LCY Corr. Rounding Acc.CZL" := VATPostingSetup."VAT LCY Corr. Rounding Acc.CZL";
+ "VAT LCY Corr. Rnd. Acc. S. CZL" := VATPostingSetup."VAT LCY Corr. Rnd. Acc. S. CZL";
end;
if Sales then
"Sales VAT Curr. Exch. Acc CZL" := VATPostingSetup."Sales VAT Curr. Exch. Acc CZL";
diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/Reports/CalcAndPostVATSett.rdl b/Apps/CZ/CoreLocalizationPack/app/Src/Reports/CalcAndPostVATSett.rdl
index 3646f8dfe7..ec6ee5ae8d 100644
--- a/Apps/CZ/CoreLocalizationPack/app/Src/Reports/CalcAndPostVATSett.rdl
+++ b/Apps/CZ/CoreLocalizationPack/app/Src/Reports/CalcAndPostVATSett.rdl
@@ -1673,7 +1673,6 @@
@@ -1683,6 +1682,9 @@
textbox60
61
+
Middle
0.075cm
0.075cm
@@ -1705,7 +1707,6 @@
@@ -1715,6 +1716,9 @@
textbox61
60
+
Middle
0.075cm
0.075cm
@@ -2049,7 +2053,6 @@
@@ -2059,6 +2062,9 @@
textbox70
49
+
Middle
0.075cm
0.075cm
@@ -2081,7 +2087,6 @@
@@ -2091,6 +2096,9 @@
textbox71
48
+
Middle
0.075cm
0.075cm
@@ -2424,7 +2432,6 @@
@@ -2434,6 +2441,9 @@
textbox83
37
+
Middle
0.075cm
0.075cm
@@ -2456,7 +2466,6 @@
@@ -2466,6 +2475,9 @@
textbox84
36
+
Middle
0.075cm
0.075cm
@@ -2496,6 +2508,9 @@
textbox85
35
+
Middle
0.075cm
0.075cm
@@ -2796,7 +2811,6 @@
@@ -2806,6 +2820,9 @@
textbox99
5
+
Middle
0.075cm
0.075cm
@@ -2828,7 +2845,6 @@
@@ -2838,6 +2854,9 @@
textbox100
4
+
Middle
0.075cm
0.075cm
@@ -3102,7 +3121,6 @@
@@ -3112,6 +3130,9 @@
textbox6
17
+
Middle
0.075cm
0.075cm
@@ -3139,6 +3160,9 @@
textbox4
16
+
2pt
2pt
2pt
@@ -3387,7 +3411,6 @@
@@ -3397,6 +3420,9 @@
textbox8
27
+
Middle
0.075cm
0.075cm
diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/SalesCrMemoHeaderCZL.TableExt.al b/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/SalesCrMemoHeaderCZL.TableExt.al
index edadc2cc04..e24d7c9560 100644
--- a/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/SalesCrMemoHeaderCZL.TableExt.al
+++ b/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/SalesCrMemoHeaderCZL.TableExt.al
@@ -6,6 +6,7 @@ namespace Microsoft.Sales.History;
using Microsoft.Bank.Setup;
using Microsoft.Finance.Currency;
+using Microsoft.Finance.VAT.Calculation;
using Microsoft.Sales.Customer;
using Microsoft.Sales.Document;
@@ -164,4 +165,31 @@ tableextension 11727 "Sales Cr.Memo Header CZL" extends "Sales Cr.Memo Header"
DataClassification = CustomerContent;
}
}
+
+ var
+ PopUpVATLCYCorrection: Boolean;
+
+ procedure SetPopUpVATLCYCorrectionCZL(NewPopUpVATLCYCorrection: Boolean)
+ begin
+ PopUpVATLCYCorrection := NewPopUpVATLCYCorrection;
+ end;
+
+ procedure GetPopUpVATLCYCorrectionCZL(): Boolean
+ begin
+ exit(PopUpVATLCYCorrection);
+ end;
+
+ procedure MakeVATLCYCorrectionCZL()
+ var
+ VATLCYCorrectionCZL: Page "VAT LCY Correction CZL";
+ begin
+ VATLCYCorrectionCZL.InitGlobals(Rec);
+ VATLCYCorrectionCZL.Run();
+ end;
+
+ procedure IsVATLCYCorrectionAllowedCZL(): Boolean
+ begin
+ Rec.CalcFields("Amount Including VAT", "Amount");
+ exit((Rec."Currency Code" <> '') and ((Rec."Amount Including VAT" - Rec."Amount") <> 0));
+ end;
}
diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/SalesInvoiceHeaderCZL.TableExt.al b/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/SalesInvoiceHeaderCZL.TableExt.al
index f59b04a090..7160916e92 100644
--- a/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/SalesInvoiceHeaderCZL.TableExt.al
+++ b/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/SalesInvoiceHeaderCZL.TableExt.al
@@ -8,6 +8,7 @@ using Microsoft.Bank.BankAccount;
using Microsoft.Bank.Setup;
using Microsoft.Finance.Currency;
using Microsoft.Finance.GeneralLedger.Setup;
+using Microsoft.Finance.VAT.Calculation;
using Microsoft.Foundation.Company;
tableextension 11726 "Sales Invoice Header CZL" extends "Sales Invoice Header"
@@ -179,6 +180,33 @@ tableextension 11726 "Sales Invoice Header CZL" extends "Sales Invoice Header"
}
}
+ var
+ PopUpVATLCYCorrection: Boolean;
+
+ procedure SetPopUpVATLCYCorrectionCZL(NewPopUpVATLCYCorrection: Boolean)
+ begin
+ PopUpVATLCYCorrection := NewPopUpVATLCYCorrection;
+ end;
+
+ procedure GetPopUpVATLCYCorrectionCZL(): Boolean
+ begin
+ exit(PopUpVATLCYCorrection);
+ end;
+
+ procedure MakeVATLCYCorrectionCZL()
+ var
+ VATLCYCorrectionCZL: Page "VAT LCY Correction CZL";
+ begin
+ VATLCYCorrectionCZL.InitGlobals(Rec);
+ VATLCYCorrectionCZL.Run();
+ end;
+
+ procedure IsVATLCYCorrectionAllowedCZL(): Boolean
+ begin
+ Rec.CalcFields("Amount Including VAT", "Amount");
+ exit((Rec."Currency Code" <> '') and ((Rec."Amount Including VAT" - Rec."Amount") <> 0));
+ end;
+
procedure UpdateBankInfoCZL(BankAccountCode: Code[20]; BankAccountNo: Text[30]; BankBranchNo: Text[20]; BankName: Text[100]; TransitNo: Text[20]; IBANCode: Code[50]; SWIFTCode: Code[20])
begin
"Bank Account Code CZL" := BankAccountCode;
diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/UserSetupCZL.TableExt.al b/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/UserSetupCZL.TableExt.al
index e208e8a8bb..b22582fdea 100644
--- a/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/UserSetupCZL.TableExt.al
+++ b/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/UserSetupCZL.TableExt.al
@@ -110,6 +110,11 @@ tableextension 11717 "User Setup CZL" extends "User Setup"
Caption = 'Allow VAT Date Changing';
DataClassification = CustomerContent;
}
+ field(11788; "Allow Orig Doc VAT Date Ch CZL"; Boolean)
+ {
+ Caption = 'Allow Orig. Doc. VAT Date Changing';
+ DataClassification = CustomerContent;
+ }
}
trigger OnDelete()
diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/VATEntryCZL.TableExt.al b/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/VATEntryCZL.TableExt.al
index 754b5e4f59..f611c9fe21 100644
--- a/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/VATEntryCZL.TableExt.al
+++ b/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/VATEntryCZL.TableExt.al
@@ -5,6 +5,7 @@
namespace Microsoft.Finance.VAT.Ledger;
using Microsoft.Finance.VAT.Calculation;
+using Microsoft.Finance.VAT;
using Microsoft.Finance.VAT.Reporting;
tableextension 11737 "VAT Entry CZL" extends "VAT Entry"
@@ -98,6 +99,24 @@ tableextension 11737 "VAT Entry CZL" extends "VAT Entry"
Caption = 'Original Document VAT Date';
Editable = false;
DataClassification = CustomerContent;
+
+ trigger OnValidate()
+ var
+ VATReportingDateMgt: Codeunit "VAT Reporting Date Mgt";
+ VATOrigDocVATDateMgtCZL: Codeunit "VAT Orig.Doc.VAT Date Mgt. CZL";
+ begin
+ if (Rec."Original Doc. VAT Date CZL" = xRec."Original Doc. VAT Date CZL") and (CurrFieldNo <> 0) then
+ exit;
+ // if type settlement then we error
+ Validate(Type);
+ if not VATReportingDateMgt.IsVATDateModifiable() then
+ Error(VATDateNotModifiableErr);
+
+ if Closed then
+ Error(VATDateModifiableClosedErr);
+
+ VATOrigDocVATDateMgtCZL.UpdateOrigDocVATDate(Rec);
+ end;
}
}
@@ -111,6 +130,8 @@ tableextension 11737 "VAT Entry CZL" extends "VAT Entry"
var
VATStmtPeriodSelectionNotSupportedErr: Label 'VAT statement report period selection %1 is not supported.', Comment = '%1 = VAT Statement Report Period Selection';
VATStmtReportSelectionNotSupportedErr: Label 'VAT statement report selection %1 is not supported.', Comment = '%1 = VAT Statement Report Selection';
+ VATDateNotModifiableErr: Label 'Modification of the VAT Date on the VAT Entry is restricted by the current setting for VAT Reporting Date Usage in the General Ledger Setup.';
+ VATDateModifiableClosedErr: Label 'The VAT Entry is marked as closed, modification of the VAT Date is therefore not allowed.';
internal procedure SetVATStmtCalcFilters(VATStatementLine: Record "VAT Statement Line"; VATStmtCalcParametersCZL: Record "VAT Stmt. Calc. Parameters CZL")
var
@@ -222,6 +243,9 @@ tableextension 11737 "VAT Entry CZL" extends "VAT Entry"
procedure ToTemporaryCZL(var TempVATEntry: Record "VAT Entry" temporary)
begin
+ if not TempVATEntry.IsTemporary() then
+ exit;
+
if FindSet() then
repeat
TempVATEntry := Rec;
diff --git a/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/VATPostingSetupCZL.TableExt.al b/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/VATPostingSetupCZL.TableExt.al
index 04c0e47c6e..1ad427ce10 100644
--- a/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/VATPostingSetupCZL.TableExt.al
+++ b/Apps/CZ/CoreLocalizationPack/app/Src/TableExtensions/VATPostingSetupCZL.TableExt.al
@@ -103,7 +103,13 @@ tableextension 11738 "VAT Posting Setup CZL" extends "VAT Posting Setup"
}
field(31115; "VAT LCY Corr. Rounding Acc.CZL"; Code[20])
{
- Caption = 'VAT LCY Correction Rounding Account';
+ Caption = 'Purch. VAT LCY Corr. Rounding Account';
+ TableRelation = "G/L Account"."No." where("Account Type" = const(Posting));
+ DataClassification = CustomerContent;
+ }
+ field(31116; "VAT LCY Corr. Rnd. Acc. S. CZL"; Code[20])
+ {
+ Caption = 'Sales VAT LCY Corr. Rounding Account';
TableRelation = "G/L Account"."No." where("Account Type" = const(Posting));
DataClassification = CustomerContent;
}
@@ -122,14 +128,24 @@ tableextension 11738 "VAT Posting Setup CZL" extends "VAT Posting Setup"
begin
AssertThatNonDeductibleVATPctIsNotUsed();
end;
-
+#if not CLEAN28
+ [Obsolete('Use GetPurchaseLCYCorrRoundingAccCZL function instead.', '28.0')]
procedure GetLCYCorrRoundingAccCZL(): Code[20]
+ begin
+ exit(GetPurchaseLCYCorrRoundingAccCZL());
+ end;
+#endif
+
+ procedure GetPurchaseLCYCorrRoundingAccCZL(): Code[20]
var
PostingSetupManagement: Codeunit PostingSetupManagement;
VATLCYCorrRoundingAccNo: Code[20];
IsHandled: Boolean;
begin
+#if not CLEAN28
OnBeforeGetLCYCorrRoundingAccCZL(Rec, VATLCYCorrRoundingAccNo, IsHandled);
+#endif
+ OnBeforeGetPurchaseLCYCorrRoundingAccCZL(Rec, VATLCYCorrRoundingAccNo, IsHandled);
if IsHandled then
exit(VATLCYCorrRoundingAccNo);
@@ -139,6 +155,22 @@ tableextension 11738 "VAT Posting Setup CZL" extends "VAT Posting Setup"
exit("VAT LCY Corr. Rounding Acc.CZL");
end;
+ procedure GetSalesLCYCorrRoundingAccCZL(): Code[20]
+ var
+ PostingSetupManagement: Codeunit PostingSetupManagement;
+ VATLCYCorrRoundingAccNo: Code[20];
+ IsHandled: Boolean;
+ begin
+ OnBeforeGetSalesLCYCorrRoundingAccCZL(Rec, VATLCYCorrRoundingAccNo, IsHandled);
+ if IsHandled then
+ exit(VATLCYCorrRoundingAccNo);
+
+ if "VAT LCY Corr. Rnd. Acc. S. CZL" = '' then
+ PostingSetupManagement.SendVATPostingSetupNotification(Rec, FieldCaption("VAT LCY Corr. Rnd. Acc. S. CZL"));
+ TestField("VAT LCY Corr. Rnd. Acc. S. CZL");
+ exit("VAT LCY Corr. Rnd. Acc. S. CZL");
+ end;
+
local procedure AssertThatNonDeductibleVATPctIsNotUsed()
var
IsHandled: Boolean;
@@ -166,14 +198,26 @@ tableextension 11738 "VAT Posting Setup CZL" extends "VAT Posting Setup"
"Allow Non-Deductible VAT" := "Allow Non-Deductible VAT"::"Allow";
end;
end;
-
+#if not CLEAN28
+ [Obsolete('Use OnBeforeGetPurchaseLCYCorrRoundingAccCZL integration event instead.', '28.0')]
[IntegrationEvent(false, false)]
local procedure OnBeforeGetLCYCorrRoundingAccCZL(var VATPostingSetup: Record "VAT Posting Setup"; var VATLCYCorrRoundingAccNo: Code[20]; var IsHandled: Boolean)
begin
end;
+#endif
[IntegrationEvent(false, false)]
local procedure OnBeforeAssertThatNonDeductibleVATPctIsNotUsedCZL(var VATPostingSetup: Record "VAT Posting Setup"; var IsHandled: Boolean)
begin
end;
+
+ [IntegrationEvent(false, false)]
+ local procedure OnBeforeGetPurchaseLCYCorrRoundingAccCZL(var VATPostingSetup: Record "VAT Posting Setup"; var VATLCYCorrRoundingAccNo: Code[20]; var IsHandled: Boolean)
+ begin
+ end;
+
+ [IntegrationEvent(false, false)]
+ local procedure OnBeforeGetSalesLCYCorrRoundingAccCZL(var VATPostingSetup: Record "VAT Posting Setup"; var VATLCYCorrRoundingAccNo: Code[20]; var IsHandled: Boolean)
+ begin
+ end;
}
diff --git a/Apps/DE/EDocumentDE/app/src/XRechnung/ImportXRechnungDocument.Codeunit.al b/Apps/DE/EDocumentDE/app/src/XRechnung/ImportXRechnungDocument.Codeunit.al
index f236223202..3ad2982208 100644
--- a/Apps/DE/EDocumentDE/app/src/XRechnung/ImportXRechnungDocument.Codeunit.al
+++ b/Apps/DE/EDocumentDE/app/src/XRechnung/ImportXRechnungDocument.Codeunit.al
@@ -400,7 +400,7 @@ codeunit 13915 "Import XRechnung Document"
'/' + DocumentType + '/cac:AdditionalDocumentReference/cac:Attachment/cbc:EmbeddedDocumentBinaryObject/@filename':
DocumentAttachment."File Name" := CopyStr(TempXMLBuffer.Value.Split('.').Get(1), 1, MaxStrLen(DocumentAttachment."File Name"));
end;
- OnAfterParseInvoice(EDocument, PurchaseHeader, PurchaseLine, DocumentAttachment, DocumentAttachmentData, TempXMLBuffer);
+ OnAfterParseInvoice(EDocument, PurchaseHeader, PurchaseLine, DocumentAttachment, DocumentAttachmentData, TempXMLBuffer, DocumentType);
end;
#endregion
@@ -537,17 +537,17 @@ codeunit 13915 "Import XRechnung Document"
'/' + DocumentType + '/cac:AdditionalDocumentReference/cac:Attachment/cbc:EmbeddedDocumentBinaryObject/@filename':
DocumentAttachment."File Name" := CopyStr(TempXMLBuffer.Value.Split('.').Get(1), 1, MaxStrLen(DocumentAttachment."File Name"));
end;
- OnAfterParseCreditMemo(EDocument, PurchaseHeader, PurchaseLine, DocumentAttachment, DocumentAttachmentData, TempXMLBuffer);
+ OnAfterParseCreditMemo(EDocument, PurchaseHeader, PurchaseLine, DocumentAttachment, DocumentAttachmentData, TempXMLBuffer, DocumentType);
end;
#endregion
[IntegrationEvent(false, false)]
- internal procedure OnAfterParseInvoice(EDocument: Record "E-Document"; var PurchaseHeader: Record "Purchase Header" temporary; var PurchaseLine: Record "Purchase Line" temporary; DocumentAttachment: Record "Document Attachment"; DocumentAttachmentData: Codeunit "Temp Blob"; TempXMLBuffer: Record "XML Buffer" temporary)
+ internal procedure OnAfterParseInvoice(EDocument: Record "E-Document"; var PurchaseHeader: Record "Purchase Header" temporary; var PurchaseLine: Record "Purchase Line" temporary; DocumentAttachment: Record "Document Attachment"; DocumentAttachmentData: Codeunit "Temp Blob"; TempXMLBuffer: Record "XML Buffer" temporary; DocumentType: Text)
begin
end;
[IntegrationEvent(false, false)]
- internal procedure OnAfterParseCreditMemo(EDocument: Record "E-Document"; var PurchaseHeader: Record "Purchase Header" temporary; var PurchaseLine: Record "Purchase Line" temporary; DocumentAttachment: Record "Document Attachment"; DocumentAttachmentData: Codeunit "Temp Blob"; TempXMLBuffer: Record "XML Buffer" temporary)
+ internal procedure OnAfterParseCreditMemo(EDocument: Record "E-Document"; var PurchaseHeader: Record "Purchase Header" temporary; var PurchaseLine: Record "Purchase Line" temporary; DocumentAttachment: Record "Document Attachment"; DocumentAttachmentData: Codeunit "Temp Blob"; TempXMLBuffer: Record "XML Buffer" temporary; DocumentType: Text)
begin
end;
}
\ No newline at end of file
diff --git a/Apps/DE/EDocumentDE/app/src/ZUGFeRD/ExportZUGFeRDDocument.Codeunit.al b/Apps/DE/EDocumentDE/app/src/ZUGFeRD/ExportZUGFeRDDocument.Codeunit.al
index 5b7ab06e6e..d4c39ccdf1 100644
--- a/Apps/DE/EDocumentDE/app/src/ZUGFeRD/ExportZUGFeRDDocument.Codeunit.al
+++ b/Apps/DE/EDocumentDE/app/src/ZUGFeRD/ExportZUGFeRDDocument.Codeunit.al
@@ -315,7 +315,7 @@ codeunit 13917 "Export ZUGFeRD Document"
SellerEmailAddress: Text;
SellerPhoneNumber: Text;
SellerPostalZone: Text;
- SellerCountryCode: Code[2];
+ SellerCountryCode: Code[10];
RespCentrCode: Code[10];
begin
if not DataTypeManagement.GetRecordRef(RecordVariant, HeaderRecordRef) then
diff --git a/Apps/DE/EDocumentDE/app/src/ZUGFeRD/ZUGFeRDFormat.Codeunit.al b/Apps/DE/EDocumentDE/app/src/ZUGFeRD/ZUGFeRDFormat.Codeunit.al
index c158b075b0..f119141395 100644
--- a/Apps/DE/EDocumentDE/app/src/ZUGFeRD/ZUGFeRDFormat.Codeunit.al
+++ b/Apps/DE/EDocumentDE/app/src/ZUGFeRD/ZUGFeRDFormat.Codeunit.al
@@ -115,7 +115,18 @@ codeunit 13920 "ZUGFeRD Format" implements "E-Document"
exit;
FileName := StrSubstNo(EDOCLogFileTxt, EDocumentLog."E-Doc. Entry No");
- FileName += '.pdf';
+ FileName += EDocumentService.GetDefaultFileExtension();
+ end;
+
+ [EventSubscriber(ObjectType::Table, Database::"E-Document Service", OnAfterGetDefaultFileExtension, '', false, false)]
+ local procedure HandleOnAfterGetDefaultFileExtension(EDocumentService: Record "E-Document Service"; var FileExtension: Text)
+ var
+ PDFFileTypeTok: Label '.pdf', Locked = true;
+ begin
+ if EDocumentService."Document Format" <> EDocumentService."Document Format"::ZUGFeRD then
+ exit;
+
+ FileExtension := PDFFileTypeTok;
end;
local procedure CheckCompanyInfoMandatory()
diff --git a/Apps/DE/EDocumentDE/test/src/XRechnungXMLDocumentTests.Codeunit.al b/Apps/DE/EDocumentDE/test/src/XRechnungXMLDocumentTests.Codeunit.al
index e56b46833e..83748b79bf 100644
--- a/Apps/DE/EDocumentDE/test/src/XRechnungXMLDocumentTests.Codeunit.al
+++ b/Apps/DE/EDocumentDE/test/src/XRechnungXMLDocumentTests.Codeunit.al
@@ -971,15 +971,11 @@ codeunit 13918 "XRechnung XML Document Tests"
end;
local procedure VerifyAccountingSupplierParty(var TempXMLBuffer: Record "XML Buffer" temporary; DocumentTok: Text)
- var
- Path: Text;
begin
VerifyAccountingSupplierParty(TempXMLBuffer, DocumentTok, CompanyInformation.Address, CompanyInformation."Post Code", CompanyInformation.City);
end;
local procedure VerifyAccountingSupplierParty(var TempXMLBuffer: Record "XML Buffer" temporary; DocumentTok: Text; ResponsibilityCenter: Record "Responsibility Center")
- var
- Path: Text;
begin
VerifyAccountingSupplierParty(TempXMLBuffer, DocumentTok, ResponsibilityCenter.Address, ResponsibilityCenter."Post Code", ResponsibilityCenter.City);
end;
diff --git a/Apps/DK/SAFTModificationDK/app/app.json b/Apps/DK/SAFTModificationDK/app/app.json
index 77647c9c8e..52823cc573 100644
--- a/Apps/DK/SAFTModificationDK/app/app.json
+++ b/Apps/DK/SAFTModificationDK/app/app.json
@@ -34,7 +34,7 @@
"to": 13689
},
{
- "from": 13695,
+ "from": 13694,
"to": 13698
}
],
@@ -43,5 +43,12 @@
"allowDownloadingSource": true,
"includeSourceInSymbolFile": true
},
+ "internalsVisibleTo": [
+ {
+ "id": "b7fc717e-b79c-4548-b6dc-e27f895171f1",
+ "name": "SAF-T Modification DK Tests",
+ "publisher": "Microsoft"
+ }
+ ],
"target": "Cloud"
}
diff --git a/Apps/DK/SAFTModificationDK/app/src/AuditFileExportDocsDK.PageExt.al b/Apps/DK/SAFTModificationDK/app/src/AuditFileExportDocsDK.PageExt.al
new file mode 100644
index 0000000000..a1ccd4b422
--- /dev/null
+++ b/Apps/DK/SAFTModificationDK/app/src/AuditFileExportDocsDK.PageExt.al
@@ -0,0 +1,47 @@
+// ------------------------------------------------------------------------------------------------
+// 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.AuditFileExport;
+
+using System.Environment.Configuration;
+
+pageextension 13687 "Audit File Export Docs. DK" extends "Audit File Export Documents"
+{
+ trigger OnOpenPage()
+ begin
+ SendStandardAccount2025Notification();
+ end;
+
+ internal procedure SendStandardAccount2025Notification()
+ var
+ AuditFileExportSetup: Record "Audit File Export Setup";
+ MyNotifications: Record "My Notifications";
+ StandardAccount2025Notification: Notification;
+ begin
+ if not AuditFileExportSetup.Get() then
+ exit;
+
+ if AuditFileExportSetup."Standard Account Type" = AuditFileExportSetup."Standard Account Type"::"Standard Account 2025" then
+ exit;
+
+ if not MyNotifications.IsEnabled(GetStandardAccount2025NotificationId()) then
+ exit;
+
+ StandardAccount2025Notification.Id(GetStandardAccount2025NotificationId());
+ StandardAccount2025Notification.Message(StandardAccount2025AvailableMsg);
+ StandardAccount2025Notification.AddAction(OpenSAFTSetupGuideTxt, Codeunit::"SAF-T Notification Mgt. DK", 'OpenSAFTSetupPage');
+ StandardAccount2025Notification.AddAction(DontShowAgainTxt, Codeunit::"SAF-T Notification Mgt. DK", 'DisableStandardAccount2025Notification');
+ StandardAccount2025Notification.Send();
+ end;
+
+ local procedure GetStandardAccount2025NotificationId(): Guid
+ begin
+ exit('a1b0c3e4-d5f6-4a7b-8c9d-0e1f2a3b4c5d');
+ end;
+
+ var
+ StandardAccount2025AvailableMsg: Label 'New standard account type is available for year 2025.';
+ OpenSAFTSetupGuideTxt: Label 'Open SAF-T Setup Guide';
+ DontShowAgainTxt: Label 'Don''t show this again';
+}
diff --git a/Apps/DK/SAFTModificationDK/app/src/CreateStandardDataSAFTDK.Codeunit.al b/Apps/DK/SAFTModificationDK/app/src/CreateStandardDataSAFTDK.Codeunit.al
index a10789db11..d632c94469 100644
--- a/Apps/DK/SAFTModificationDK/app/src/CreateStandardDataSAFTDK.Codeunit.al
+++ b/Apps/DK/SAFTModificationDK/app/src/CreateStandardDataSAFTDK.Codeunit.al
@@ -20,7 +20,7 @@ codeunit 13687 "Create Standard Data SAF-T DK" implements CreateStandardDataSAFT
CSVFieldSeparator: Text[1];
begin
CSVFieldSeparator := ';';
- CSVDocContent := StandardAccountDK.GetStandardAccountsCSV();
+ CSVDocContent := StandardAccountDK.GetStandardAccountsCSV(StandardAccountType);
if CSVDocContent = '' then
exit(false);
ImportAuditDataMgt.LoadStandardAccountsFromCSVTextToCSVBuffer(TempCSVBuffer, CSVDocContent, CSVFieldSeparator);
@@ -34,6 +34,7 @@ codeunit 13687 "Create Standard Data SAF-T DK" implements CreateStandardDataSAFT
procedure LoadStandardTaxCodes() Result: Boolean
var
+ AuditFileExportSetup: Record "Audit File Export Setup";
TempCSVBuffer: Record "CSV Buffer" temporary;
StandardTaxCodeDK: Codeunit "Standard Tax Code DK";
ImportAuditDataMgt: Codeunit "Import Audit Data Mgt.";
@@ -41,7 +42,17 @@ codeunit 13687 "Create Standard Data SAF-T DK" implements CreateStandardDataSAFT
CSVFieldSeparator: Text[1];
begin
CSVFieldSeparator := ';';
- CSVDocContent := StandardTaxCodeDK.GetStandardTaxCodesCSV();
+ if not AuditFileExportSetup.Get() then
+ exit(false);
+
+ case AuditFileExportSetup."Standard Account Type" of
+ Enum::"Standard Account Type"::"Four Digit Standard Account":
+ CSVDocContent := StandardTaxCodeDK.GetStandardTaxCodesBefore2025CSV();
+ Enum::"Standard Account Type"::"Standard Account 2025":
+ CSVDocContent := StandardTaxCodeDK.GetStandardTaxCodes2025CSV();
+ else
+ CSVDocContent := StandardTaxCodeDK.GetStandardTaxCodesBefore2025CSV();
+ end;
if CSVDocContent = '' then
exit(false);
ImportAuditDataMgt.LoadStandardAccountsFromCSVTextToCSVBuffer(TempCSVBuffer, CSVDocContent, CSVFieldSeparator);
diff --git a/Apps/DK/SAFTModificationDK/app/src/Permissions/SAFTObjectsDK.PermissionSet.al b/Apps/DK/SAFTModificationDK/app/src/Permissions/SAFTObjectsDK.PermissionSet.al
index 6d2c12224f..716c2d86e8 100644
--- a/Apps/DK/SAFTModificationDK/app/src/Permissions/SAFTObjectsDK.PermissionSet.al
+++ b/Apps/DK/SAFTModificationDK/app/src/Permissions/SAFTObjectsDK.PermissionSet.al
@@ -14,6 +14,7 @@ permissionset 13687 "SAF-T Objects DK"
codeunit "Create Standard Data SAF-T DK" = X,
codeunit "Data Check SAF-T DK" = X,
codeunit "Install SAF-T DK" = X,
+ codeunit "SAF-T Notification Mgt. DK" = X,
codeunit "Standard Account DK" = X,
codeunit "Standard Tax Code DK" = X,
codeunit "Xml Data Handling SAF-T DK" = X;
diff --git a/Apps/DK/SAFTModificationDK/app/src/SAFTNotificationMgtDK.Codeunit.al b/Apps/DK/SAFTModificationDK/app/src/SAFTNotificationMgtDK.Codeunit.al
new file mode 100644
index 0000000000..e9a6cb8154
--- /dev/null
+++ b/Apps/DK/SAFTModificationDK/app/src/SAFTNotificationMgtDK.Codeunit.al
@@ -0,0 +1,40 @@
+// ------------------------------------------------------------------------------------------------
+// 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.AuditFileExport;
+
+using System.Environment.Configuration;
+
+codeunit 13694 "SAF-T Notification Mgt. DK"
+{
+ Access = Internal;
+
+ procedure OpenSAFTSetupPage(Notification: Notification)
+ begin
+ Page.RunModal(Page::"SAF-T Wizard");
+ DisableNotificationInternal();
+ end;
+
+ procedure DisableStandardAccount2025Notification(Notification: Notification)
+ begin
+ DisableNotificationInternal();
+ end;
+
+ local procedure DisableNotificationInternal()
+ var
+ MyNotifications: Record "My Notifications";
+ begin
+ if not MyNotifications.Disable(GetStandardAccount2025NotificationId()) then
+ MyNotifications.InsertDefault(GetStandardAccount2025NotificationId(), StandardAccount2025NotificationNameTxt, StandardAccount2025NotificationDescriptionTxt, false);
+ end;
+
+ local procedure GetStandardAccount2025NotificationId(): Guid
+ begin
+ exit('a1b0c3e4-d5f6-4a7b-8c9d-0e1f2a3b4c5d');
+ end;
+
+ var
+ StandardAccount2025NotificationNameTxt: Label 'SAF-T Standard Account 2025 Available';
+ StandardAccount2025NotificationDescriptionTxt: Label 'Show notification when standard accounts for 2025 are available but not configured.';
+}
diff --git a/Apps/DK/SAFTModificationDK/app/src/StandardAccountTypeSAFTDK.EnumExt.al b/Apps/DK/SAFTModificationDK/app/src/StandardAccountTypeSAFTDK.EnumExt.al
index 33734fff46..ce9d3c9a91 100644
--- a/Apps/DK/SAFTModificationDK/app/src/StandardAccountTypeSAFTDK.EnumExt.al
+++ b/Apps/DK/SAFTModificationDK/app/src/StandardAccountTypeSAFTDK.EnumExt.al
@@ -6,5 +6,6 @@ namespace Microsoft.Finance.AuditFileExport;
enumextension 13695 "Standard Account Type SAF-T DK" extends "Standard Account Type"
{
+ value(13689; "Standard Account 2025") { }
value(13695; "Four Digit Standard Account") { }
}
diff --git a/Apps/DK/SAFTModificationDK/app/src/StandardAccounts/StandardAccountDK.Codeunit.al b/Apps/DK/SAFTModificationDK/app/src/StandardAccounts/StandardAccountDK.Codeunit.al
index e134cfdbe2..99caa6a1f7 100644
--- a/Apps/DK/SAFTModificationDK/app/src/StandardAccounts/StandardAccountDK.Codeunit.al
+++ b/Apps/DK/SAFTModificationDK/app/src/StandardAccounts/StandardAccountDK.Codeunit.al
@@ -10,7 +10,633 @@ codeunit 13695 "Standard Account DK"
{
Access = Internal;
- procedure GetStandardAccountsCSV(): Text
+ procedure GetStandardAccountsCSV(StandardAccountType: Enum "Standard Account Type"): Text
+ begin
+ case StandardAccountType of
+ StandardAccountType::"Four Digit Standard Account":
+ exit(GetStandardAccountsCSV());
+ StandardAccountType::"Standard Account 2025":
+ exit(GetStandardAccountsDec2025CSV());
+ else
+ exit(GetStandardAccountsCSV());
+ end;
+ end;
+
+ local procedure GetStandardAccountsDec2025CSV(): Text
+ var
+ TypeHelper: Codeunit "Type Helper";
+ CRLF: Text[2];
+ begin
+ CRLF := TypeHelper.CRLFSeparator();
+
+ exit(
+ '1010;Salg af varer og ydelser' + CRLF +
+ '1050;Salg af varer udland, EU' + CRLF +
+ '1100;Salg af varer udland, ikke-EU' + CRLF +
+ '1150;Salg af ydelser udland, EU' + CRLF +
+ '1200;Salg af ydelser udland, ikke-EU' + CRLF +
+ '1210;Salgsrabatter' + CRLF +
+ '1250;Salgsfragt' + CRLF +
+ '1300;Regulering igangværende arbejder' + CRLF +
+ '1390;Nettoomsætning' + CRLF +
+ '1410;Varelagerregulering på lagre af færdigvarer og varer under fremstilling' + CRLF +
+ '1430;Nedskrivning på lagre af færdigvarer og varer under fremstilling' + CRLF +
+ '1450;Andel af nedskrivning på lagre af færdigvarer og varer under fremstilling (ej fradragsberettiget skattemæssigt)' + CRLF +
+ '1460;Øvrige ændringer på lagre af færdigvarer og varer under fremstilling' + CRLF +
+ '1490;Ændring i lagre af færdigvarer og varer under fremstilling' + CRLF +
+ '1496;Arbejde udført for egen regning og opført under aktiver' + CRLF +
+ '1497;Arbejde udført for egen regning og opført under aktiver' + CRLF +
+ '1510;Gevinst ved salg af immaterielle anlægsaktiver' + CRLF +
+ '1530;Gevinst ved salg af materielle anlægsaktiver' + CRLF +
+ '1545;Offentlige tilskud' + CRLF +
+ '1550;Øvrige andre driftsindtægter' + CRLF +
+ '1590;Andre driftsindtægter' + CRLF +
+ '1610;Varekøb' + CRLF +
+ '1630;Varekøb udland, EU' + CRLF +
+ '1650;Varekøb udland, ikke-EU' + CRLF +
+ '1660;Ydelseskøb' + CRLF +
+ '1710;Ydelseskøb udland, EU' + CRLF +
+ '1740;Ydelseskøb, udland, ikke-EU' + CRLF +
+ '1745;Underleverandører (varer/ydelser leveret til kunder)' + CRLF +
+ '1760;Fragtomkostninger' + CRLF +
+ '1770;Varelagerregulering på lagre af råvarer og hjælpematerialer' + CRLF +
+ '1800;Nedskrivning på varelager' + CRLF +
+ '1801;Øvrige produktionsomkostninger' + CRLF +
+ '1805;Andel af nedskrivning på varelager (ej fradragsberettiget skattemæssigt)' + CRLF +
+ '1807;Værdi af eget vareforbrug (kun klasse A)' + CRLF +
+ '1810;Omkostninger til råvarer og hjælpematerialer' + CRLF +
+ '1850;Annoncering og reklame' + CRLF +
+ '1870;Udstillinger og dekoration' + CRLF +
+ '1910;Repræsentationsomkostninger, skattemæssigt begrænset fradrag' + CRLF +
+ '1930;Repræsentationsomkostninger, fuld fradragsret skattemæssigt' + CRLF +
+ '1950;Andre salgsomkostninger' + CRLF +
+ '1990;Gaver og blomster' + CRLF +
+ '2000;Rejseomkostninger (salgsomkostning)' + CRLF +
+ '2010;Salgsomkostninger' + CRLF +
+ '2030;Husleje' + CRLF +
+ '2050;El' + CRLF +
+ '2060;Elafgift' + CRLF +
+ '2070;Vand' + CRLF +
+ '2080;Varme' + CRLF +
+ '2085;Privat andel el, vand og varme (kun klasse A)' + CRLF +
+ '2090;Vandafgift' + CRLF +
+ '2100;Olie- og flaskegasafgift' + CRLF +
+ '2110;Kulafgift' + CRLF +
+ '2120;Naturgas- og bygasafgift' + CRLF +
+ '2130;Co2-afgift' + CRLF +
+ '2140;Øvrige afgifter' + CRLF +
+ '2150;Rengøring og renovation (affaldshåndtering)' + CRLF +
+ '2160;Reparation og vedligeholdelse' + CRLF +
+ '2170;Reparation og vedligeholdelse, ejendom skattemæssigt afskrivningsberettiget, bygning 1' + CRLF +
+ '2180;Forsikringer til lokaler og bygninger' + CRLF +
+ '2190;Ejendomsskatter' + CRLF +
+ '2200;Andre lokaleomkostninger' + CRLF +
+ '2210;Lokaleomkostninger' + CRLF +
+ '2230;Småanskaffelser under skattemæssig grænse for småaktiver' + CRLF +
+ '2240;Småanskaffelser over skattemæssig grænse for småaktiver' + CRLF +
+ '2255;Forskningsomkostninger' + CRLF +
+ '2260;Udviklingsomkostninger' + CRLF +
+ '2265;Andel af forskningsomkostninger (berettiget til forhøjet skattemæssigt fradrag)' + CRLF +
+ '2266;Andel af udviklingsomkostninger (berettiget til forhøjet skattemæssigt fradrag)' + CRLF +
+ '2280;Tab på tilgodehavender fra salg og tjenesteydelser' + CRLF +
+ '2290;Regulering af nedskrivning på tilgodehavender fra salg og tjenesteydelser' + CRLF +
+ '2295;Andel af regulering af nedskrivning på tilgodehavender fra salg og tjenesteydelser (ej fradragsberettiget skattemæssigt)' + CRLF +
+ '2310;It-udstyr (hardware, software inkl. licenser og abonnementer)' + CRLF +
+ '2350;Kantineomkostninger' + CRLF +
+ '2370;Kontingenter' + CRLF +
+ '2375;Aviser og blade' + CRLF +
+ '2380;Faglitteratur' + CRLF +
+ '2390;Porto og gebyrer' + CRLF +
+ '2410;Telefon og internet mv. (kun virksomhed)' + CRLF +
+ '2430;Privat andel / fri-telefon (kun klasse A)' + CRLF +
+ '2450;Kontorartikler' + CRLF +
+ '2460;Leje og operationelle leasingydelser (ekskl. husleje)' + CRLF +
+ '2470;Rejseomkostninger (administrationsomkostning)' + CRLF +
+ '2480;Vikarassistance' + CRLF +
+ '2510;Konsulentydelser' + CRLF +
+ '2530;Leasingomkostninger, personbiler' + CRLF +
+ '2540;Driftsomkostninger, personbiler' + CRLF +
+ '2548;Leasingomkostninger, blandet benyttet personbil (kun klasse A)' + CRLF +
+ '2550;Privat andel af biludgifter (kun klasse A)' + CRLF +
+ '2560;Driftsomkostninger, varebiler' + CRLF +
+ '2567;Leasingomkostninger, blandet benyttet varebil (kun klasse A)' + CRLF +
+ '2569;Leasingomkostninger, varebiler' + CRLF +
+ '2580;Privat andel af blandet benyttet varebil (kun klasse A)' + CRLF +
+ '2620;Parkeringsomkostninger' + CRLF +
+ '2650;Øvrige forsikringer' + CRLF +
+ '2660;Offentlige gebyrer og bøder (ej fradragsberettiget skattemæssigt)' + CRLF +
+ '2670;Revision og regnskabsmæssig assistance' + CRLF +
+ '2680;Advokatmæssig assistance' + CRLF +
+ '2690;Øvrige rådgivningshonorarer' + CRLF +
+ '2700;Ej skattemæssigt fradragsberettigede rådgivningshonorarer' + CRLF +
+ '2710;Administrationsvederlag/management fee' + CRLF +
+ '2720;Øreafrunding/kassedifferencer' + CRLF +
+ '2810;Andre eksterne omkostninger' + CRLF +
+ '2830;Administrationsomkostninger' + CRLF +
+ '2831;Andre eksterne omkostninger' + CRLF +
+ '2832;Eksterne omkostninger' + CRLF +
+ '2840;Bruttofortjeneste/Bruttotab' + CRLF +
+ '2845;AM Bidragspligtig A-Indkomst' + CRLF +
+ '2846;AM Bidragsfri A-Indkomst' + CRLF +
+ '2847;B-honorar' + CRLF +
+ '2860;Feriepenge og SH-tillæg' + CRLF +
+ '2865;Ferietillæg' + CRLF +
+ '2866;Feriepengeforpligtelse, regulering' + CRLF +
+ '2870;Jubilæumsgratiale og fratrædelsesgodtgørelse' + CRLF +
+ '2880;Bestyrelseshonorar' + CRLF +
+ '2885;Lønrefusioner' + CRLF +
+ '2887;Personalegoder' + CRLF +
+ '2888;Fri bil' + CRLF +
+ '2895;Skattefri rejse- og befordringsgodtgørelse' + CRLF +
+ '2896;Kursusudgifter' + CRLF +
+ '2897;ATP, medarbejder' + CRLF +
+ '2898;ATP, arbejdsgiver' + CRLF +
+ '2905;Lønninger' + CRLF +
+ '2910;Pensioner, arbejdsgiver' + CRLF +
+ '2920;Vederlag til afløsning af pensionstilsagn' + CRLF +
+ '2925;Øvrige pensionsomkostninger' + CRLF +
+ '2926;Pensioner' + CRLF +
+ '2930;Øvrige omkostninger til social sikring' + CRLF +
+ '2946;Lønsumsafgift' + CRLF +
+ '2947;Arbejdsskadeforsikringer' + CRLF +
+ '2948;Andre omkostninger til social sikring' + CRLF +
+ '2990;Personaleomkostninger' + CRLF +
+ '3000;Af- og nedskrivninger af erhvervede immaterielle anlægsaktiver' + CRLF +
+ '3010;Af- og nedskrivninger af goodwill' + CRLF +
+ '3020;Af- og nedskrivninger af grunde og bygninger' + CRLF +
+ '3030;Af- og nedskrivninger af produktionsanlæg og maskiner' + CRLF +
+ '3040;Af- og nedskrivninger af indretning af lejede lokaler' + CRLF +
+ '3050;Af- og nedskrivninger af andre anlæg, driftsmateriel og inventar' + CRLF +
+ '3060;Af- og nedskrivninger af software' + CRLF +
+ '3070;Af- og nedskrivninger af finansielt leasede grunde og bygninger' + CRLF +
+ '3080;Af- og nedskrivninger af finansielt leasede produktionsanlæg og maskiner' + CRLF +
+ '3090;Af- og nedskrivninger af finansielt leasede andre anlæg, driftsmateriel og inventar' + CRLF +
+ '3095;Privat andel af af- og nedskrivninger (kun klasse A)' + CRLF +
+ '3097;Gevinst ved salg af andre anlæg, driftsmateriel og inventar blandet benyttet (kun klasse A)' + CRLF +
+ '3099;Tab ved salg af andre anlæg, driftsmateriel og inventar blandet benyttet (kun klasse A)' + CRLF +
+ '3100;Af- og nedskrivninger af materielle og immaterielle anlægsaktiver' + CRLF +
+ '3130;Nedskrivning af omsætningsaktiver, som overstiger normale nedskrivninger' + CRLF +
+ '3140;Nedskrivning af omsætningsaktiver, som overstiger normale nedskrivninger' + CRLF +
+ '3160;Tab ved salg af immaterielle anlægsaktiver' + CRLF +
+ '3165;Tab ved salg af materielle anlægsaktiver' + CRLF +
+ '3170;Øvrige andre driftsomkostninger' + CRLF +
+ '3175;Andre driftsomkostninger' + CRLF +
+ '3185;Værdireguleringer af investeringsejendomme' + CRLF +
+ '3190;Dagsværdiregulering af investeringsejendomme' + CRLF +
+ '3193;Modtagne udbytter fra tilknyttede virksomheder' + CRLF +
+ '3194;Gevinst ved afhændelse af kapitalandele i tilknyttede virksomheder' + CRLF +
+ '3196;Tab ved afhændelse af kapitalandele i tilknyttede virksomheder' + CRLF +
+ '3197;Nedskrivning af kapitalandele i tilknyttede virksomheder' + CRLF +
+ '3198;Tilbageførsel af nedskrivning af kapitalandele i tilknyttede virksomheder' + CRLF +
+ '3200;Øvrige indtægter af kapitalandele i tilknyttede virksomheder' + CRLF +
+ '3205;Indtægter af kapitalandele i tilknyttede virksomheder' + CRLF +
+ '3211;Modtagne udbytter fra associerede virksomheder' + CRLF +
+ '3212;Gevinst ved afhændelse af kapitalandele i associerede virksomheder' + CRLF +
+ '3214;Tab ved afhændelse af kapitalandele i associerede virksomheder' + CRLF +
+ '3215;Nedskrivning af kapitalandele i associerede virksomheder' + CRLF +
+ '3216;Tilbageførsel af nedskrivning af kapitalandele i associerede virksomheder' + CRLF +
+ '3217;Øvrige indtægter af kapitalandele i associerede virksomheder' + CRLF +
+ '3219;Indtægter af kapitalandele i associerede virksomheder' + CRLF +
+ '3221;Modtagne udbytter fra kapitalinteresser' + CRLF +
+ '3222;Gevinst ved afhændelse af kapitalinteresser' + CRLF +
+ '3224;Tab ved afhændelse af kapitalinteresser' + CRLF +
+ '3225;Nedskrivning af kapitalinteresser' + CRLF +
+ '3226;Tilbageførsel af nedskrivning af kapitalinteresser' + CRLF +
+ '3230;Øvrige indtægter af kapitalinteresser' + CRLF +
+ '3240;Indtægter af kapitalinteresser' + CRLF +
+ '3250;Indtægter af kapitalandele i tilknyttede og associerede virksomheder' + CRLF +
+ '3252;Resultatandele, der hidrører fra tilknyttede virksomheder' + CRLF +
+ '3260;Resultatandele, der hidrører fra tilknyttede virksomheder' + CRLF +
+ '3262;Resultatandele, der hidrører fra associerede virksomheder' + CRLF +
+ '3270;Resultatandele, der hidrører fra associerede virksomheder' + CRLF +
+ '3272;Resultatandele, der hidrører fra kapitalinteresser' + CRLF +
+ '3280;Resultatandele, der hidrører fra kapitalinteresser' + CRLF +
+ '3380;Udbytte fra unoterede porteføljeaktier (bruttoudbytte)' + CRLF +
+ '3385;Kursgevinster af andre kapitalandele, værdipapirer og tilgodehavender, der er anlægsaktiver' + CRLF +
+ '3390;Renteindtægter af andre kapitalandele, værdipapirer og tilgodehavender, der er anlægsaktiver' + CRLF +
+ '3395;Værdiregulering af andre kapitalandele og værdipaprer, der er anlægsaktiver' + CRLF +
+ '3400;Øvrige indtægter af andre kapitalandele, værdipapirer og tilgodehavender, der er anlægsaktiver' + CRLF +
+ '3410;Indtægter af andre kapitalandele, værdipapirer og tilgodehavender, der er anlægsaktiver' + CRLF +
+ '3440;Andre finansielle indtægter fra tilknyttede virksomheder' + CRLF +
+ '3445;Renteindtægter fra tilknyttede virksomheder' + CRLF +
+ '3450;Andre finansielle indtægter fra tilknyttede virksomheder' + CRLF +
+ '3470;Renter fra banker' + CRLF +
+ '3490;Renter vedr. tilgodehavende fra salg af varer og tjenesteydelser' + CRLF +
+ '3510;Rentetillæg mv. fra det offentlige (ej skattepligtig)' + CRLF +
+ '3530;Øvrige finansielle indtægter' + CRLF +
+ '3535;Valutakursregulering (gevinst)' + CRLF +
+ '3536;Værdiregulering af børsnoterede værdipapirer, der er omsætningsaktiver' + CRLF +
+ '3537;Værdiregulering af andre kapitalandele og værdipaprer, der er omsætningsaktiver' + CRLF +
+ '3540;Andre finansielle indtægter' + CRLF +
+ '3560;Nedskrivning af finansielle anlægs- og omsætningsaktiver' + CRLF +
+ '3570;Nedskrivning af finansielle aktiver' + CRLF +
+ '3590;Finansielle omkostninger, der hidrører fra tilknyttede virksomheder' + CRLF +
+ '3596;Valutakursreguleringer, udenlandske dattervirksomheder' + CRLF +
+ '3600;Finansielle omkostninger, der hidrører fra tilknyttede virksomheder' + CRLF +
+ '3610;Valutakursregulering (tab)' + CRLF +
+ '3630;Kurstab på likvider, bankgæld og prioritetsgæld' + CRLF +
+ '3640;Renter på finansiel leasinggæld' + CRLF +
+ '3650;Renter vedr. leverandører af varer og tjenesteydelser' + CRLF +
+ '3670;Renter til banker og realkreditinstitutter' + CRLF +
+ '3675;Renter til det offentlige (ej fradragsberettiget skattemæssigt)' + CRLF +
+ '3690;Øvrige finansielle omkostninger' + CRLF +
+ '3700;Andre finansielle omkostninger' + CRLF +
+ '3701;Øvrige finansielle omkostninger' + CRLF +
+ '3702;Resultat før skat' + CRLF +
+ '3740;Årets skat (skat af årets skattepligtige indkomst)' + CRLF +
+ '3760;Årets regulering af udskudt skat' + CRLF +
+ '3780;Regulering af skat vedrørende tidligere år' + CRLF +
+ '3790;Skat af årets resultat' + CRLF +
+ '3810;Andre skatter' + CRLF +
+ '3820;Andre skatter' + CRLF +
+ '4999;Årets resultat' + CRLF +
+ '5010;Færdiggjort udviklingsprojekter, herunder patenter og lignende rettigheder, der stammer fra udviklingsprojekter, Kostpris primo' + CRLF +
+ '5011;Færdiggjort udviklingsprojekter, herunder patenter og lignende rettigheder, der stammer fra udviklingsprojekter, Årets tilgange' + CRLF +
+ '5012;Færdiggjort udviklingsprojekter, herunder patenter og lignende rettigheder, der stammer fra udviklingsprojekter, Årets afgange' + CRLF +
+ '5015;Færdiggjort udviklingsprojekter, herunder patenter og lignende rettigheder, der stammer fra udviklingsprojekter, Intern overførsel til/fra andre poster' + CRLF +
+ '5020;Færdiggjort udviklingsprojekter, herunder patenter og lignende rettigheder, der stammer fra udviklingsprojekter, opskrivninger primo' + CRLF +
+ '5021;Færdiggjort udviklingsprojekter, herunder patenter og lignende rettigheder, der stammer fra udviklingsprojekter, Årets opskrivninger' + CRLF +
+ '5022;Færdiggjort udviklingsprojekter, herunder patenter og lignende rettigheder, der stammer fra udviklingsprojekter, årets tilbageførsler af tidligere års opskrivninger' + CRLF +
+ '5030;Færdiggjort udviklingsprojekter, herunder patenter og lignende rettigheder, der stammer fra udviklingsprojekter, Af- og nedskrivninger primo' + CRLF +
+ '5031;Færdiggjort udviklingsprojekter, herunder patenter og lignende rettigheder, der stammer fra udviklingsprojekter, Årets af- og nedskrivninger' + CRLF +
+ '5032;Færdiggjort udviklingsprojekter, herunder patenter og lignende rettigheder, der stammer fra udviklingsprojekter, Tilbageførte af- og nedskrivninger' + CRLF +
+ '5040;Færdiggjort udviklingsprojekter, herunder patenter og lignende rettigheder, der stammer fra udviklingsprojekter' + CRLF +
+ '5042;Erhvervede immaterielle anlægsaktiver, kostpris primo' + CRLF +
+ '5043;Erhvervede immaterielle anlægsaktiver, årets tilgange' + CRLF +
+ '5044;Erhvervede immaterielle anlægsaktiver, årets afgange' + CRLF +
+ '5050;Erhvervede immaterielle anlægsaktiver, Opskrivninger primo' + CRLF +
+ '5051;Erhvervede immaterielle anlægsaktiver, Årets opskrivninger' + CRLF +
+ '5052;Erhvervede immaterielle anlægsaktiver, Tilbageførte opskrivninger fra tidligere år' + CRLF +
+ '5055;Erhvervede immaterielle anlægsaktiver, Af- og nedskrivninger primo' + CRLF +
+ '5056;Erhvervede immaterielle anlægsaktiver, årets af- og nedskrivninger' + CRLF +
+ '5057;Erhvervede immaterielle anlægsaktiver, tilbageførte af- og nedskrivninger' + CRLF +
+ '5060;Erhvervede immaterielle anlægsaktiver' + CRLF +
+ '5062;Goodwill, kostpris primo' + CRLF +
+ '5063;Goodwill, årets tilgange' + CRLF +
+ '5064;Goodwill, årets afgange' + CRLF +
+ '5075;Goodwill, af- og nedskrivninger primo' + CRLF +
+ '5076;Goodwill, årets af- og nedskrivninger' + CRLF +
+ '5077;Goodwill, tilbageførte afskrivninger' + CRLF +
+ '5079;Goodwill' + CRLF +
+ '5085;Udviklingsprojekter under udførelse og forudbetalinger for immaterielle anlægsaktiver, Kostpris primo' + CRLF +
+ '5090;Udviklingsprojekter under udførelse og forudbetalinger for immaterielle anlægsaktiver, Årets tilgange' + CRLF +
+ '5095;Udviklingsprojekter under udførelse og forudbetalinger for immaterielle anlægsaktiver, Årets afgange' + CRLF +
+ '5100;Udviklingsprojekter under udførelse og forudbetalinger for immaterielle anlægsaktiver, Intern overførsel til/fra andre poster' + CRLF +
+ '5110;Udviklingsprojekter under udførelse og forudbetalinger for immaterielle anlægsaktiver, Af- og nedskrivninger primo' + CRLF +
+ '5111;Udviklingsprojekter under udførelse og forudbetalinger for immaterielle anlægsaktiver, Årets af- og nedskrivninger' + CRLF +
+ '5112;Udviklingsprojekter under udførelse og forudbetalinger for immaterielle anlægsaktiver, Tilbageførte af- og nedskrivninger' + CRLF +
+ '5120;Udviklingsprojekter under udførelse og forudbetalinger for immaterielle anlægsaktiver' + CRLF +
+ '5141;Immaterielle anlægsaktiver' + CRLF +
+ '5160;Investeringsejendomme, kostpris primo' + CRLF +
+ '5170;Investeringsejendomme, årets tilgange' + CRLF +
+ '5180;Investeringsejendomme, årets afgange' + CRLF +
+ '5185;Investeringsejendomme, intern overførsel til/fra andre poster' + CRLF +
+ '5190;Investeringsejendomme, årets forbedringer' + CRLF +
+ '5200;Investeringsejendomme, værdireguleringer primo' + CRLF +
+ '5201;Investeringsejendomme, årets værdireguleringer' + CRLF +
+ '5205;Investeringsejendomme, Af- og nedskrivninger primo' + CRLF +
+ '5210;Investeringsejendomme, årets af- og nedskrivninger' + CRLF +
+ '5220;Investeringsejendomme, tilbageførte af- og nedskrivninger' + CRLF +
+ '5230;Investeringsejendomme' + CRLF +
+ '5240;Investeringsejendomme under opførelse, kostpris primo' + CRLF +
+ '5250;Investeringsejendomme under opførelse, årets tilgange' + CRLF +
+ '5260;Investeringsejendomme under opførelse, årets afgange' + CRLF +
+ '5265;Investeringsejendomme, intern overførsel til/fra andre poster' + CRLF +
+ '5280;Investeringsejendomme under opførelse, øvrige værdireguleringer primo' + CRLF +
+ '5281;Investeringsejendomme under opførelse, årets værdireguleringer' + CRLF +
+ '5282;Investeringsejendomme under opførelse, nedskrivninger, primo' + CRLF +
+ '5290;Investeringsejendomme under opførelse, årets nedskrivninger' + CRLF +
+ '5300;Investeringsejendomme under opførelse, tilbageførte nedskrivninger' + CRLF +
+ '5310;Investeringsejendomme under opførelse' + CRLF +
+ '5320;Grunde og bygninger, kostpris primo' + CRLF +
+ '5330;Grunde og bygninger, årets tilgange' + CRLF +
+ '5340;Grunde og bygninger, årets afgange' + CRLF +
+ '5350;Grunde og bygninger, årets forbedringer' + CRLF +
+ '5370;Grunde og bygninger, værdireguleringer primo' + CRLF +
+ '5371;Grunde og bygninger, årets værdireguleringer' + CRLF +
+ '5372;Grunde og bygninger, Af- og nedskrivninger primo' + CRLF +
+ '5390;Grunde og bygninger, årets af- og nedskrivninger' + CRLF +
+ '5400;Grunde og bygninger, tilbageførte af- og nedskrivninger' + CRLF +
+ '5410;Grunde og bygninger' + CRLF +
+ '5420;Produktionsanlæg og maskiner, kostpris primo' + CRLF +
+ '5430;Produktionsanlæg og maskiner, årets tilgange' + CRLF +
+ '5440;Produktionsanlæg og maskiner, årets afgange' + CRLF +
+ '5450;Produktionsanlæg og maskiner, Værdireguleringer primo' + CRLF +
+ '5451;Produktionsanlæg og maskiner, Årets værdireguleringer' + CRLF +
+ '5452;Produktionsanlæg og maskiner, Af- og nedskrivninger primo' + CRLF +
+ '5470;Produktionsanlæg og maskiner, årets af- og nedskrivninger' + CRLF +
+ '5480;Produktionsanlæg og maskiner, tilbageførte af- og nedskrivninger' + CRLF +
+ '5490;Produktionsanlæg og maskiner' + CRLF +
+ '5500;Indretning af lejede lokaler, kostpris primo' + CRLF +
+ '5510;Indretning af lejede lokaler, årets tilgange' + CRLF +
+ '5520;Indretning af lejede lokaler, årets afgange' + CRLF +
+ '5530;Indretning af lejede lokaler, Værdireguleringer primo' + CRLF +
+ '5531;Indretning af lejede lokaler, Årets værdireguleringer' + CRLF +
+ '5532;Indretning af lejede lokaler, Af- og nedskrivninger primo' + CRLF +
+ '5540;Indretning af lejede lokaler, årets af- og nedskrivninger' + CRLF +
+ '5550;Indretning af lejede lokaler, tilbageførte af- og nedskrivninger' + CRLF +
+ '5560;Indretning af lejede lokaler' + CRLF +
+ '5570;Andre anlæg, driftsmateriel og inventar, kostpris primo' + CRLF +
+ '5580;Andre anlæg, driftsmateriel og inventar, årets tilgange' + CRLF +
+ '5590;Andre anlæg, driftsmateriel og inventar, årets afgange' + CRLF +
+ '5600;Andre anlæg, driftsmateriel og inventar, Værdireguleringer primo' + CRLF +
+ '5601;Andre anlæg, driftsmateriel og inventar, Årets værdireguleringer' + CRLF +
+ '5602;Andre anlæg, driftsmateriel og inventar, Af- og nedskrivninger primo' + CRLF +
+ '5610;Andre anlæg, driftsmateriel og inventar, årets af- og nedskrivninger' + CRLF +
+ '5620;Andre anlæg, driftsmateriel og inventar, tilbageførte af- og nedskrivninger' + CRLF +
+ '5630;Andre anlæg, driftsmateriel og inventar' + CRLF +
+ '5640;Materielle anlægsaktiver under udførelse og forudbetalinger for materielle anlægsaktiver, kostpris primo' + CRLF +
+ '5650;Materielle anlægsaktiver under udførelse og forudbetalinger for materielle anlægsaktiver, årets tilgange' + CRLF +
+ '5660;Materielle anlægsaktiver under udførelse og forudbetalinger for materielle anlægsaktiver, årets afgange' + CRLF +
+ '5670;Materielle anlægsaktiver under udførelse og forudbetalinger for materielle anlægsaktiver, værdireguleringer primo' + CRLF +
+ '5671;Materielle anlægsaktiver under udførelse og forudbetalinger for materielle anlægsaktiver, årets værdireguleringer' + CRLF +
+ '5675;Materielle anlægsaktiver under udførelse og forudbetalinger for materielle anlægsaktiver, nedskrivninger primo' + CRLF +
+ '5676;Materielle anlægsaktiver under udførelse og forudbetalinger for materielle anlægsaktiver, årets nedskrivninger' + CRLF +
+ '5677;Materielle anlægsaktiver under udførelse og forudbetalinger for materielle anlægsaktiver, tilbageførte nedskrivninger' + CRLF +
+ '5680;Materielle anlægsaktiver under udførelse og forudbetalinger for materielle anlægsaktiver' + CRLF +
+ '5682;Andre anlæg, driftsmateriel og inventar blandet benyttet, kostpris primo (kun klasse A)' + CRLF +
+ '5683;Andre anlæg, driftsmateriel og inventar blandet benyttet, Årets tilgange (kun klasse A)' + CRLF +
+ '5684;Andre anlæg, driftsmateriel og inventar blandet benyttet, Årets afgange (kun klasse A)' + CRLF +
+ '5685;Andre anlæg, driftsmateriel og inventar blandet benyttet, Værdireguleringer primo (kun klasse A)' + CRLF +
+ '5686;Andre anlæg, driftsmateriel og inventar blandet benyttet, Årets værdireguleringer (kun klasse A)' + CRLF +
+ '5687;Andre anlæg, driftsmateriel og inventar blandet benyttet, Af- og nedskrivninger primo (kun klasse A)' + CRLF +
+ '5688;Andre anlæg, driftsmateriel og inventar blandet benyttet, Årets af- og nedskrivninger (kun klasse A)' + CRLF +
+ '5689;Andre anlæg, driftsmateriel og inventar blandet benyttet, tilbageførte af- og nedskrivninger (kun klasse A)' + CRLF +
+ '5690;Andre anlæg, driftsmateriel og inventar blandet benyttet, Gevinst og tab (kun klasse A)' + CRLF +
+ '5695;Andre anlæg, driftsmateriel og inventar blandet benyttet (kun klasse A)' + CRLF +
+ '5710;Finansielt leasede aktiver, Kostpris primo' + CRLF +
+ '5720;Finansielt leasede aktiver, årets tilgange' + CRLF +
+ '5730;Finansielt leasede aktiver, årets afgange' + CRLF +
+ '5740;Finansielt leasede aktiver, værdireguleringer primo' + CRLF +
+ '5741;Finansielt leasede aktiver, årets værdireguleringer' + CRLF +
+ '5745;Finansielt leasede aktiver, af- og nedskrivninger primo' + CRLF +
+ '5750;Finansielt leasede aktiver, årets af- og nedskrivninger' + CRLF +
+ '5760;Finansielt leasede aktiver, tilbageførte af- og nedskrivninger' + CRLF +
+ '5770;Finansielt leasede aktiver' + CRLF +
+ '5771;Materielle anlægsaktiver' + CRLF +
+ '5800;Kapitalandele i tilknyttede virksomheder, kostpris primo' + CRLF +
+ '5810;Kapitalandele i tilknyttede virksomheder, årets tilgange' + CRLF +
+ '5820;Kapitalandele i tilknyttede virksomheder, årets afgange' + CRLF +
+ '5825;Kapitalandele i tilknyttede virksomheder, intern overførsel til/fra andre poster' + CRLF +
+ '5829;Kapitalandele i tilknyttede virksomheder, opskrivninger primo' + CRLF +
+ '5830;Kapitalandele i tilknyttede virksomheder, årets opskrivninger' + CRLF +
+ '5831;Kapitalandele i tilknyttede virksomheder, årets tilbageførsler af tidligere års opskrivninger' + CRLF +
+ '5835;Kapitalandele i tilknyttede virksomheder, nedskrivninger primo' + CRLF +
+ '5836;Kapitalandele i tilknyttede virksomheder, årets nedskrivninger' + CRLF +
+ '5837;Kapitalandele i tilknyttede virksomheder, årets tilbageførsler af tidligere års nedskrivninger' + CRLF +
+ '5840;Kapitalandele i tilknyttede virksomheder' + CRLF +
+ '5842;Tilgodehavender hos tilknyttede virksomheder (anlægsaktiv)' + CRLF +
+ '5843;Tilgodehavender hos tilknyttede virksomheder, nedskrivninger primo (anlægsaktiv)' + CRLF +
+ '5844;Tilgodehavender hos tilknyttede virksomheder, nedskrivninger i årets løb (anlægsaktiv)' + CRLF +
+ '5845;Tilgodehavender hos tilknyttede virksomheder, tilbageførsel af tidligere års nedskrivninger (anlægsaktiv)' + CRLF +
+ '5850;Tilgodehavender hos tilknyttede virksomheder (anlægsaktiv)' + CRLF +
+ '5852;Kapitalandele i associerede virksomheder, kostpris primo' + CRLF +
+ '5853;Kapitalandele i associerede virksomheder, årets tilgange' + CRLF +
+ '5854;Kapitalandele i associerede virksomheder, årets afgange' + CRLF +
+ '5855;Kapitalandele i associerede virksomheder, intern overførsel til/fra andre poster' + CRLF +
+ '5860;Kapitalandele i associerede virksomheder, opskrivninger primo' + CRLF +
+ '5861;Kapitalandele i associerede virksomheder, årets opskrivninger' + CRLF +
+ '5862;Kapitalandele i associerede virksomheder, årets tilbageførsler af tidligere års opskrivninger' + CRLF +
+ '5870;Kapitalandele i associerede virksomheder, nedskrivninger primo' + CRLF +
+ '5871;Kapitalandele i associerede virksomheder, årets nedskrivninger' + CRLF +
+ '5872;Kapitalandele i associerede virksomheder, årets tilbageførsler af tidligere års nedskrivninger' + CRLF +
+ '5880;Kapitalandele i associerede virksomheder' + CRLF +
+ '5882;Tilgodehavender hos associerede virksomheder (anlægsaktiv)' + CRLF +
+ '5883;Tilgodehavender hos associerede virksomheder, nedskrivninger primo (anlægsaktiv)' + CRLF +
+ '5884;Tilgodehavender hos associerede virksomheder, nedskrivninger i årets løb (anlægsaktiv)' + CRLF +
+ '5885;Tilgodehavender hos associerede virksomheder, tilbageførsel af tidligere års nedskrivninger (anlægsaktiv)' + CRLF +
+ '5890;Tilgodehavender hos associerede virksomheder (anlægsaktiv)' + CRLF +
+ '5900;Kapitalinteresser, kostpris primo' + CRLF +
+ '5910;Kapitalinteresser, årets tilgange' + CRLF +
+ '5920;Kapitalinteresser, årets afgange' + CRLF +
+ '5925;Kapitalinteresser, intern overførsel til/fra andre poster' + CRLF +
+ '5929;Kapitalinteresser, opskrivninger primo' + CRLF +
+ '5930;Kapitalinteresser, årets opskrivninger' + CRLF +
+ '5931;Kapitalinteresser, årets tilbageførsler af tidligere års opskrivninger' + CRLF +
+ '5935;Kapitalinteresser, nedskrivninger primo' + CRLF +
+ '5940;Kapitalinteresser, årets nedskrivninger' + CRLF +
+ '5950;Kapitalinteresser, årets tilbageførsler af tidligere års nedskrivninger' + CRLF +
+ '5960;Kapitalinteresser' + CRLF +
+ '5970;Tilgodehavender hos kapitalinteresser (anlægsaktiv)' + CRLF +
+ '5980;Tilgodehavender hos kapitalinteresser, nedskrivninger primo (anlægsaktiv)' + CRLF +
+ '5984;Tilgodehavender hos kapitalinteresser, nedskrivninger i årets løb (anlægsaktiv)' + CRLF +
+ '5985;Tilgodehavender hos kapitalinteresser, tilbageførsel af tidligere års nedskrivninger (anlægsaktiv)' + CRLF +
+ '5990;Tilgodehavender hos kapitalinteresser (anlægsaktiv)' + CRLF +
+ '6000;Andre værdipapirer og kapitalandele' + CRLF +
+ '6010;Andre værdipapirer og kapitalandele' + CRLF +
+ '6020;Udskudte skatteaktiver (anlægsaktiv)' + CRLF +
+ '6030;Øvrige tilgodehavender (anlægsaktiv)' + CRLF +
+ '6040;Deposita (anlægsaktiv)' + CRLF +
+ '6050;Andre tilgodehavender (anlægsaktiv)' + CRLF +
+ '6061;Tilgodehavender hos direktionen (anlægsaktiv)' + CRLF +
+ '6062;Tilgodehavender hos bestyrelsen (anlægsaktiv)' + CRLF +
+ '6063;Tilgodehavender hos tilsynsråd (anlægsaktiv)' + CRLF +
+ '6064;Tilgodehavender hos repræsentantskab (anlægsaktiv)' + CRLF +
+ '6070;Tilgodehavender hos virksomhedsdeltagere og ledelse (anlægsaktiv)' + CRLF +
+ '6071;Finansielle anlægsaktiver' + CRLF +
+ '6072;Anlægsaktiver i alt' + CRLF +
+ '6080;Råvarer og hjælpematerialer, kostpris primo' + CRLF +
+ '6081;Råvarer og hjælpematerialer, årets tilgange' + CRLF +
+ '6082;Råvarer og hjælpematerialer, årets afgange' + CRLF +
+ '6083;Råvarer og hjælpematerialer, intern overførsel til/fra andre poster' + CRLF +
+ '6085;Råvarer og hjælpematerialer, nedskrivninger primo' + CRLF +
+ '6090;Råvarer og hjælpematerialer, årets nedskrivning' + CRLF +
+ '6091;Råvarer og hjælpematerialer, tilbageførsel af tidligere års nedskrivninger' + CRLF +
+ '6100;Råvarer og hjælpematerialer' + CRLF +
+ '6110;Varer under fremstilling, kostpris primo' + CRLF +
+ '6111;Varer under fremstilling, årets tilgange' + CRLF +
+ '6112;Varer under fremstilling, årets afgange' + CRLF +
+ '6113;Varer under fremstilling, intern overførsel til/fra andre poster' + CRLF +
+ '6115;Varer under fremstilling, nedskrivninger primo' + CRLF +
+ '6120;Varer under fremstilling, årets nedskrivning' + CRLF +
+ '6121;Varer under fremstilling, tilbageførsel af tidligere års nedskrivninger' + CRLF +
+ '6130;Varer under fremstilling' + CRLF +
+ '6140;Fremstillede varer og handelsvarer, kostpris primo' + CRLF +
+ '6141;Fremstillede varer og handelsvarer, årets tilgange' + CRLF +
+ '6142;Fremstillede varer og handelsvarer, årets afgange' + CRLF +
+ '6143;Fremstillede varer og handelsvarer, intern overførsel til/fra andre poster' + CRLF +
+ '6145;Fremstillede varer og handelsvarer, nedskrivninger primo' + CRLF +
+ '6150;Fremstillede varer og handelsvarer, årets nedskrivning' + CRLF +
+ '6151;Fremstillede varer og handelsvarer, tilbageførsel af tidligere års nedskrivninger' + CRLF +
+ '6160;Fremstillede varer og handelsvarer' + CRLF +
+ '6170;Forudbetalinger for varer' + CRLF +
+ '6180;Forudbetalinger for varer' + CRLF +
+ '6181;Varebeholdninger' + CRLF +
+ '6190;Tilgodehavender fra salg og tjenesteydelser' + CRLF +
+ '6200;Tilgodehavender fra salg og tjenesteydelser, nedskrivninger primo' + CRLF +
+ '6201;Nedskrivninger i årets løb' + CRLF +
+ '6202;Tilbageførsel af tidligere års nedskrivninger' + CRLF +
+ '6210;Tilgodehavender fra salg og tjenesteydelser' + CRLF +
+ '6240;Igangværende arbejder for fremmed regning' + CRLF +
+ '6250;Igangværende arbejder for fremmed regning' + CRLF +
+ '6252;Tilgodehavender hos tilknyttede virksomheder (omsætningsaktiv)' + CRLF +
+ '6255;Tilgodehavender hos tilknyttede virksomheder, nedskrivninger primo (omsætningsaktiv)' + CRLF +
+ '6256;Tilgodehavender hos tilknyttede virksomheder, nedskrivninger i årets løb' + CRLF +
+ '6257;Tilgodehavender hos tilknyttede virksomheder, tilbageførsel af tidligere års nedskrivninger (omsætningsaktiv)' + CRLF +
+ '6260;Tilgodehavender hos tilknyttede virksomheder (omsætningsaktiv)' + CRLF +
+ '6262;Tilgodehavender hos associerede virksomheder (omsætningsaktiv)' + CRLF +
+ '6265;Tilgodehavender hos associerede virksomheder, nedskrivninger primo (omsætningsaktiv)' + CRLF +
+ '6266;Tilgodehavender hos associerede virksomheder, nedskrivninger i årets løb (omsætningsaktiv)' + CRLF +
+ '6267;Tilgodehavender hos associerede virksomheder, tilbageførsel af tidligere års nedskrivninger (omsætningsaktiv)' + CRLF +
+ '6270;Tilgodehavender hos associerede virksomheder (omsætningsaktiv)' + CRLF +
+ '6282;Tilgodehavender hos kapitalinteresser (omsætningsaktiv)' + CRLF +
+ '6285;Tilgodehavender hos kapitalinteresser, nedskrivninger primo (omsætningsaktiv)' + CRLF +
+ '6286;Tilgodehavender hos kapitalinteresser, nedskrivninger i årets løb (omsætningsaktiv)' + CRLF +
+ '6287;Tilgodehavender hos kapitalinteresser, tilbageførsel af tidligere års nedskrivninger (omsætningsaktiv)' + CRLF +
+ '6290;Tilgodehavender hos kapitalinteresser (omsætningsaktiv)' + CRLF +
+ '6305;Udskudte skatteaktiver (omsætningsaktiv)' + CRLF +
+ '6310;Tilgodehavende kildeskat (omsætningsaktiv)' + CRLF +
+ '6315;Tilgodehavende selskabsskat (omsætningsaktiv)' + CRLF +
+ '6320;Tilgodehavende moms (kortfristede)' + CRLF +
+ '6330;Øvrige tilgodehavender (kortfristede)' + CRLF +
+ '6340;Andre tilgodehavender (kortfristede)' + CRLF +
+ '6350;Krav på indbetaling af virksomhedskapital og overkurs' + CRLF +
+ '6360;Krav på indbetaling af virksomhedskapital og overkurs' + CRLF +
+ '6365;Tilgodehavender hos direktionen (omsætningsaktiv)' + CRLF +
+ '6370;Tilgodehavender hos bestyrelsens (omsætningsaktiv)' + CRLF +
+ '6375;Tilgodehavender hos tilsynsråd (omsætningsaktiv)' + CRLF +
+ '6376;Tilgodehavender hos repræsentantskab (omsætningsaktiv)' + CRLF +
+ '6380;Tilgodehavender hos virksomhedsdeltagere og ledelse (omsætningsaktiv)' + CRLF +
+ '6390;Periodeafgrænsningsposter, der kan opretholdes skattemæssigt' + CRLF +
+ '6400;Periodeafgrænsningsposter, der ikke kan opretholdes skattemæssigt' + CRLF +
+ '6410;Periodeafgrænsningsposter' + CRLF +
+ '6411;Tilgodehavender' + CRLF +
+ '6420;Kapitalandele i tilknyttede virksomheder som ikke er bestemt til vedvarende eje' + CRLF +
+ '6430;Kapitalandele i tilknyttede virksomheder' + CRLF +
+ '6450;Andre værdipapirer og kapitalandele som ikke er bestemt til vedvarende eje' + CRLF +
+ '6460;Andre værdipapirer og kapitalandele' + CRLF +
+ '6461;Værdipapirer og kapitalandele' + CRLF +
+ '6470;Likvide beholdninger' + CRLF +
+ '6480;Bankkonto' + CRLF +
+ '6490;Likvide beholdninger' + CRLF +
+ '6491;Omsætningsaktiver i alt' + CRLF +
+ '6499;AKTIVER I ALT' + CRLF +
+ '6510;Registreret kapital mv.' + CRLF +
+ '6520;Indbetalt registreret kapital mv.' + CRLF +
+ '6525;Ikke indbetalt registreret kapital mv.' + CRLF +
+ '6530;Virksomhedskapital' + CRLF +
+ '6540;Overkurs ved emission' + CRLF +
+ '6550;Overkurs ved emission' + CRLF +
+ '6560;Reserve for opskrivninger' + CRLF +
+ '6570;Reserve for opskrivninger' + CRLF +
+ '6800;Reserve for nettoopskrivning efter den indre værdis metode' + CRLF +
+ '6810;Reserve for udlån og sikkerhedsstillelse' + CRLF +
+ '6830;Reserve for ikke indbetalt virksomhedskapital og overkurs' + CRLF +
+ '6840;Reserve for udviklingsomkostninger' + CRLF +
+ '6870;Øvrige lovpligtige reserver' + CRLF +
+ '6890;Vedtægtsmæssige reserver' + CRLF +
+ '6910;Øvrige reserver' + CRLF +
+ '6914;Reserve for iværksætterselskaber' + CRLF +
+ '6915;Egenkapital primo (kun klasse A)' + CRLF +
+ '6916;Årets resultat (kun klasse A)' + CRLF +
+ '6917;Fri bil (kun klasse A)' + CRLF +
+ '6918;Rejse og befordringsgodtgørelse (kun klasse A)' + CRLF +
+ '6919;Fri telefon (Kun klasse A)' + CRLF +
+ '6920;Private andele (Kun klasse A)' + CRLF +
+ '6921;Private afskrivninger (Kun klasse A)' + CRLF +
+ '6922;Driftsudgifter uden fradrag (Kun klasse A)' + CRLF +
+ '6923;Privat hævet (kun klasse A)' + CRLF +
+ '6924;Privat indskud (kun klasse A)' + CRLF +
+ '6930;Andre reserver' + CRLF +
+ '6935;Overført resultat, primo' + CRLF +
+ '6940;Overført resultat, jf. resultatdisponering' + CRLF +
+ '6950;Overført resultat' + CRLF +
+ '6955;Foreslået udbytte, primo' + CRLF +
+ '6956;Udloddet udbytte' + CRLF +
+ '6960;Foreslået udbytte jf. resultatdisponeringen' + CRLF +
+ '6970;Foreslået udbytte indregnet under egenkapitalen' + CRLF +
+ '6971;Egenkapital i alt' + CRLF +
+ '6985;Hensættelser til pensioner og lignende forpligtelser' + CRLF +
+ '6990;Hensættelser til pensioner og lignende forpligtelser' + CRLF +
+ '7010;Hensættelser til udskudt skat' + CRLF +
+ '7030;Hensættelse til udskudt skat' + CRLF +
+ '7040;Andre hensatte forpligtelser' + CRLF +
+ '7050;Andre hensatte forpligtelser' + CRLF +
+ '7051;Hensatte forpligtelser' + CRLF +
+ '7055;Gæld, der er optaget ved udstedelse af obligationer (langfristet)' + CRLF +
+ '7060;Gæld, der er optaget ved udstedelse af obligationer (langfristet)' + CRLF +
+ '7065;Konvertible og udbyttegivende gældsbreve (langfristet)' + CRLF +
+ '7070;Konvertible og udbyttegivende gældsbreve (langfristet)' + CRLF +
+ '7110;Gæld til kredit- og realkreditinstitutter (langfristet)' + CRLF +
+ '7120;Gæld til banker (langfristet)' + CRLF +
+ '7125;Leasingforpligtelser (langfristet)' + CRLF +
+ '7126;Øvrig langfristet gæld' + CRLF +
+ '7130;Gæld til kreditinstitutter (langfristet)' + CRLF +
+ '7145;Modtagne forudbetalinger fra kunder (langfristet)' + CRLF +
+ '7150;Modtagne forudbetalinger fra kunder (langfristet)' + CRLF +
+ '7155;Leverandører af varer og tjenesteydelser (langfristet)' + CRLF +
+ '7160;Leverandører af varer og tjenesteydelser (langfristet)' + CRLF +
+ '7165;Vekselgæld (langfristet)' + CRLF +
+ '7170;Vekselgæld (langfristet)' + CRLF +
+ '7175;Gæld til tilknyttede virksomheder (langfristet)' + CRLF +
+ '7180;Gæld til tilknyttede virksomheder (langfristet)' + CRLF +
+ '7185;Gæld til kapitalinteresser (langfristet)' + CRLF +
+ '7190;Gæld til kapitalinteresser (langfristet)' + CRLF +
+ '7195;Anden gæld (langfristet)' + CRLF +
+ '7210;Gæld til virksomhedssdeltagere og ledelse (langfristet)' + CRLF +
+ '7230;Deposita (langfristet)' + CRLF +
+ '7240;Leasingforpligtelse (langfristet)' + CRLF +
+ '7250;Skyldig selskabsskat (langfristet)' + CRLF +
+ '7260;Anden gæld, herunder skyldige skatter og skyldige bidrag til social sikring (langfristet)' + CRLF +
+ '7265;Periodeafgrænsningsposter (langfristet)' + CRLF +
+ '7270;Periodeafgrænsningsposter (langfristet)' + CRLF +
+ '7271;Langfristede gældsforpligtelser' + CRLF +
+ '7285;Gæld, der er optaget ved udstedelse af obligationer (kortfristet)' + CRLF +
+ '7290;Gæld, der er optaget ved udstedelse af obligationer (kortfristet)' + CRLF +
+ '7295;Konvertible og udbyttegivende gældsbreve (kortfristet)' + CRLF +
+ '7300;Konvertible og udbyttegivende gældsbreve (kortfristet)' + CRLF +
+ '7310;Gæld til kredit- og realkreditinstitutter (kortfristet)' + CRLF +
+ '7330;Gæld til banker (kortfristet)' + CRLF +
+ '7345;Leasingforpligtelser (kortfristet)' + CRLF +
+ '7350;Øvrig kortfristet gæld' + CRLF +
+ '7360;Gæld til kreditinstitutter (kortfristet)' + CRLF +
+ '7410;Modtagne forudbetalinger fra kunder (kortfristet)' + CRLF +
+ '7420;Modtagne forudbetalinger fra kunder (kortfristet)' + CRLF +
+ '7440;Leverandører af varer og tjenesteydelser (kortfristet)' + CRLF +
+ '7450;Leverandører af varer og tjenesteydelser (kortfristet)' + CRLF +
+ '7455;Igangværende arbejder for fremmed regning (kortfristet gæld)' + CRLF +
+ '7456;Modtagne acontobetalinger (kortfristet gæld)' + CRLF +
+ '7460;Igangværende arbejder for fremmed regning (kortfristet gæld)' + CRLF +
+ '7465;Vekselgæld (kortfristet)' + CRLF +
+ '7470;Vekselgæld (kortfristet)' + CRLF +
+ '7510;Gæld til tilknyttede virksomheder (kortfristet)' + CRLF +
+ '7530;Gæld til tilknyttede virksomheder (kortfristet)' + CRLF +
+ '7535;Gæld til kapitalinteresser (kortfristet)' + CRLF +
+ '7540;Gæld til kapitalinteresser (kortfristet)' + CRLF +
+ '7590;Gæld til virksomhedsdeltagere og ledelse (kortfristet)' + CRLF +
+ '7610;Deposita (kortfristet)' + CRLF +
+ '7680;Salgsmoms' + CRLF +
+ '7700;Moms af varekøb udland, EU og ikke-EU' + CRLF +
+ '7720;Moms af ydelseskøb udland, EU og ikke-EU' + CRLF +
+ '7740;Købsmoms' + CRLF +
+ '7760;Olie- og flaskegasafgift' + CRLF +
+ '7780;Elafgift' + CRLF +
+ '7800;Naturgas- og bygasafgift' + CRLF +
+ '7810;Kulafgift' + CRLF +
+ '7820;Vandafgift' + CRLF +
+ '7830;Co2-afgift' + CRLF +
+ '7840;Skyldig moms' + CRLF +
+ '7860;Skyldig løn og gager' + CRLF +
+ '7880;Skyldig bonus og tantieme' + CRLF +
+ '7900;Skyldige feriepenge' + CRLF +
+ '7920;Skyldig A-skat' + CRLF +
+ '7940;Skyldigt AM-bidrag' + CRLF +
+ '7960;Skyldigt ATP-bidrag' + CRLF +
+ '7980;Skyldigt AMP-bidrag' + CRLF +
+ '8000;Anden skyldig pension' + CRLF +
+ '8010;Skyldig arbejdsgiverbidrag (samlet betaling)' + CRLF +
+ '8030;Skyldig feriepengeforpligtigelse' + CRLF +
+ '8035;Skyldigt ferietillæg' + CRLF +
+ '8040;Øvrig anden gæld' + CRLF +
+ '8045;Modtagne offentlige tilskud til senere beskatning' + CRLF +
+ '8050;Anden gæld, herunder skyldige skatter og skyldige bidrag til social sikring' + CRLF +
+ '8070;Periodeafgrænsningsposter (kortfristet)' + CRLF +
+ '8080;Periodeafgrænsningsposter (kortfristet)' + CRLF +
+ '9950;Kortfristede gældsforpligtelser' + CRLF +
+ '9999;PASSIVER I ALT');
+ end;
+
+ local procedure GetStandardAccountsCSV(): Text
var
TypeHelper: Codeunit "Type Helper";
CRLF: Text[2];
@@ -18,340 +644,340 @@ codeunit 13695 "Standard Account DK"
CRLF := TypeHelper.CRLFSeparator();
exit(
- '1010;Salg af varer og ydelser;' + CRLF +
- '1050;Salg af varer udland, EU;' + CRLF +
- '1100;Salg af varer udland, ikke-EU;' + CRLF +
- '1150;Salg af ydelser udland, EU;' + CRLF +
- '1200;Salg af ydelser udland, ikke-EU;' + CRLF +
- '1300;Regulering igangværende arbejder;' + CRLF +
- '1350;Værdireguleringer af investeringsejendomme;' + CRLF +
- '1410;Varelagerregulering på lagre af færdigvarer og varer under fremstilling;' + CRLF +
- '1430;Nedskrivning på lagre af færdigvarer og varer under fremstilling;' + CRLF +
- '1460;Øvrige ændringer på lagre af færdigvarer og varer under fremstilling;' + CRLF +
- '1510;Gevinst ved salg af immaterielle anlægsaktiver;' + CRLF +
- '1530;Gevinst ved salg af materielle anlægsaktiver;' + CRLF +
- '1540;Gevinst ved salg af finansielle anlægsaktiver;' + CRLF +
- '1550;Øvrige andre driftsindtægter;' + CRLF +
- '1610;Varekøb;' + CRLF +
- '1630;Varekøb udland, EU;' + CRLF +
- '1650;Varekøb udland, ikke-EU;' + CRLF +
- '1660;Ydelseskøb;' + CRLF +
- '1710;Ydelseskøb udland, EU;' + CRLF +
- '1740;Ydelseskøb, udland, ikke-EU;' + CRLF +
- '1770;Varelagerregulering på lagre af råvarer og hjælpematerialer;' + CRLF +
- '1800;Nedskrivning på varelager;' + CRLF +
- '1820;Andre eksterne omkostninger;' + CRLF +
- '1830;Fragtomkostninger;' + CRLF +
- '1850;Annoncering og reklame;' + CRLF +
- '1870;Udstillinger og dekoration;' + CRLF +
- '1890;Restaurationsbesøg;' + CRLF +
- '1910;Repræsentationsomkostninger, skattemæssigt begrænset fradrag;' + CRLF +
- '1930;Repræsentationsomkostninger, fuld fradragsret skattemæssigt;' + CRLF +
- '1950;Andre salgsomkostninger;' + CRLF +
- '1970;Aviser og blade;' + CRLF +
- '1990;Gaver og blomster;' + CRLF +
- '2030;Husleje, ekskl. el, vand og varme;' + CRLF +
- '2050;El;' + CRLF +
- '2060;Elafgift;' + CRLF +
- '2070;Vand;' + CRLF +
- '2080;Varme;' + CRLF +
- '2090;Vandafgift;' + CRLF +
- '2100;Olie- og flaskegasafgift;' + CRLF +
- '2110;Kulafgift;' + CRLF +
- '2120;Naturgas- og bygasafgift;' + CRLF +
- '2130;Co2-afgift;' + CRLF +
- '2140;Øvrige afgifter;' + CRLF +
- '2150;Rengøring og renovation (affaldshåndtering);' + CRLF +
- '2160;Reparation og vedligeholdelse;' + CRLF +
- '2170;Reparation og vedligeholdelse, ejendom skattemæssigt afskrivningsberettiget, bygning 1;' + CRLF +
- '2180;Forsikringer;' + CRLF +
- '2190;Ejendomsskatter;' + CRLF +
- '2200;Andre lokaleomkostninger;' + CRLF +
- '2230;Småanskaffelser under skattemæssig grænse for småaktiver;' + CRLF +
- '2240;Småanskaffelser over skattemæssig grænse for småaktiver;' + CRLF +
- '2250;Underleverandører;' + CRLF +
- '2260;Forsknings- og udviklingsomkostninger;' + CRLF +
- '2270;Øvrige produktionsomkostninger;' + CRLF +
- '2280;Konstaterede tab på tilgodehavender fra salg og tjenesteydelser;' + CRLF +
- '2290;Regulering af nedskrivning på tilgodehavender fra salg og tjenesteydelser;' + CRLF +
- '2300;Regulering af tilgodehavender fra tilknyttede virksomheder og associerede virksomheder;' + CRLF +
- '2310;It-udstyr mv.;' + CRLF +
- '2330;Skattefri rejse- og befordringsgodtgørelse;' + CRLF +
- '2350;Kantineudgifter;' + CRLF +
- '2370;Kontingenter;' + CRLF +
- '2380;Faglitteratur;' + CRLF +
- '2390;Porto og gebyrer;' + CRLF +
- '2410;Telefon og internet mv. (kun virksomhed);' + CRLF +
- '2420;Telefon og internet mv. (delvist privat);' + CRLF +
- '2450;Kontorartikler;' + CRLF +
- '2460;Leje og operationelle leasingydelser (ekskl. husleje);' + CRLF +
- '2470;Rejseudgifter;' + CRLF +
- '2480;Vikarassistance;' + CRLF +
- '2510;Konsulentydelser;' + CRLF +
- '2520;Kursusudgifter;' + CRLF +
- '2530;Leasingomkostninger, personbiler;' + CRLF +
- '2540;Driftsomkostninger, personbiler;' + CRLF +
- '2560;Driftsomkostninger, varebiler;' + CRLF +
- '2620;Parkeringsudgifter;' + CRLF +
- '2630;Biludgifter efter statens takster;' + CRLF +
- '2640;Fri bil;' + CRLF +
- '2650;Arbejdsskadeforsikring;' + CRLF +
- '2660;Offentlige gebyrer og bøder (ej fradragsberettiget skattemæssigt);' + CRLF +
- '2670;Revision og regnskabsmæssig assistance;' + CRLF +
- '2680;Advokatmæssig assistance;' + CRLF +
- '2690;Øvrige rådgivningshonorarer;' + CRLF +
- '2700;Ej skattemæssigt fradragsberettigede rådgivningshonorarer;' + CRLF +
- '2710;Administrationsvederlag/management fee;' + CRLF +
- '2720;Øreafrunding/kassedifferencer;' + CRLF +
- '2810;Andre eksterne omkostninger;' + CRLF +
- '2850;Lønninger;' + CRLF +
- '2860;Feriepengeforpligtelse;' + CRLF +
- '2870;Jubilæumsgratiale og fratrædelsesgodtgørelse;' + CRLF +
- '2880;Bestyrelseshonorar;' + CRLF +
- '2890;AM Bidragspligtig A-Indkomst;' + CRLF +
- '2900;AM Bidragsfri A-Indkomst;' + CRLF +
- '2910;Pensioner;' + CRLF +
- '2920;Vederlag til afløsning af pensionstilsagn;' + CRLF +
- '2930;Omkostninger til social sikring;' + CRLF +
- '2940;AER/ AUB;' + CRLF +
- '2950;ATP;' + CRLF +
- '2960;Andre personaleomkostninger;' + CRLF +
- '2965;Personalegoder;' + CRLF +
- '2968;Lønrefusioner;' + CRLF +
- '2970;Udbetalte skattefrie godtgørelser i form af kørepenge og diæter;' + CRLF +
- '2980;Lønsumsafgift;' + CRLF +
- '3000;Af- og nedskrivninger af erhvervede immaterielle anlægsaktiver;' + CRLF +
- '3010;Af- og nedskrivninger af goodwill;' + CRLF +
- '3020;Af- og nedskrivninger af grunde og bygninger;' + CRLF +
- '3030;Af- og nedskrivninger af produktionsanlæg og maskiner;' + CRLF +
- '3040;Af- og nedskrivninger af indretning af lejede lokaler;' + CRLF +
- '3050;Af- og nedskrivninger af andre anlæg, driftsmateriel og inventar;' + CRLF +
- '3060;Af- og nedskrivninger af software;' + CRLF +
- '3070;Af- og nedskrivninger af finansielt leasede grunde og bygninger;' + CRLF +
- '3080;Af- og nedskrivninger af finansielt leasede produktionsanlæg og maskiner;' + CRLF +
- '3090;Af- og nedskrivninger af finansielt leasede andre anlæg, driftsmateriel og inventar;' + CRLF +
- '3130;Nedskrivninger af omsætningsaktiver, som overstiger normale nedskrivninger;' + CRLF +
- '3160;Tab ved salg af immaterielle anlægsaktiver;' + CRLF +
- '3170;Tab ved salg af materielle anlægsaktiver;' + CRLF +
- '3180;Øvrige andre driftsomkostninger;' + CRLF +
- '3200;Indtægter af kapitalandele i tilknyttede virksomheder;' + CRLF +
- '3230;Indtægter af kapitalandele i kapitalinteresser;' + CRLF +
- '3380;Udbytte fra unoterede porteføljeaktier (bruttoudbytte);' + CRLF +
- '3400;Øvrige indtægter af andre kapitalandele, værdipapirer og tilgodehavender, der er anlægsaktiver;' + CRLF +
- '3440;Andre finansielle indtægter fra tilknyttede virksomheder;' + CRLF +
- '3470;Renter fra banker;' + CRLF +
- '3490;Renter vedr. tilgodehavende fra salg af varer og tjenesteydelser;' + CRLF +
- '3510;Rentetillæg mv. fra det offentlige (ej skattepligtig);' + CRLF +
- '3530;Øvrige finansielle indtægter;' + CRLF +
- '3560;Nedskrivning af finansielle aktiver;' + CRLF +
- '3590;Finansielle omkostninger, der hidrører fra tilknyttede virksomheder;' + CRLF +
- '3610;Valutakursreguleringer;' + CRLF +
- '3620;Valutakursreguleringer, udenlandske dattervirksomheder;' + CRLF +
- '3630;Kurstab på likvider, bankgæld og prioritetsgæld;' + CRLF +
- '3640;Renter på finansiel leasinggæld;' + CRLF +
- '3650;Renter vedr. leverandører af varer og tjenesteydelser;' + CRLF +
- '3670;Renter til banker og realkreditinstitutter;' + CRLF +
- '3675;Renter til det offentlige (ej fradragsberettiget skattemæssigt);' + CRLF +
- '3680;Værdireguleringer af investeringsejendomme;' + CRLF +
- '3690;Andre finansielle omkostninger;' + CRLF +
- '3740;Aktuel skat;' + CRLF +
- '3760;Ændring af udskudt skat;' + CRLF +
- '3780;Regulering vedrørende tidligere år;' + CRLF +
- '3810;Andre skatter;' + CRLF +
- '5010;Goodwill, bogført værdi primo;' + CRLF +
- '5020;Goodwill, årets tilgange;' + CRLF +
- '5030;Goodwill, årets afgange;' + CRLF +
- '5040;Goodwill, øvrige værdireguleringer;' + CRLF +
- '5050;Goodwill, årets af- og nedskrivninger;' + CRLF +
- '5060;Goodwill, tilbageførte af- og nedskrivninger;' + CRLF +
- '5080;Erhvervede immaterielle anlægsaktiver, bogført værdi primo;' + CRLF +
- '5090;Erhvervede immaterielle anlægsaktiver, årets tilgange;' + CRLF +
- '5100;Erhvervede immaterielle anlægsaktiver, årets afgange;' + CRLF +
- '5110;Erhvervede immaterielle anlægsaktiver, øvrige værdireguleringer;' + CRLF +
- '5120;Erhvervede immaterielle anlægsaktiver, årets af- og nedskrivninger;' + CRLF +
- '5130;Erhvervede immaterielle anlægsaktiver, tilbageførte af- og nedskrivninger;' + CRLF +
- '5160;Investeringsejendomme, bogført værdi primo;' + CRLF +
- '5170;Investeringsejendomme, årets tilgange;' + CRLF +
- '5180;Investeringsejendomme, årets afgange;' + CRLF +
- '5190;Investeringsejendomme, årets forbedringer;' + CRLF +
- '5200;Investeringsejendomme, øvrige værdireguleringer;' + CRLF +
- '5210;Investeringsejendomme, årets af- og nedskrivninger;' + CRLF +
- '5220;Investeringsejendomme, tilbageførte af- og nedskrivninger;' + CRLF +
- '5240;Investeringsejendomme under opførelse, bogført værdi primo;' + CRLF +
- '5250;Investeringsejendomme under opførelse, årets tilgange;' + CRLF +
- '5260;Investeringsejendomme under opførelse, årets afgange;' + CRLF +
- '5270;Investeringsejendomme under opførelse, årets forbedringer;' + CRLF +
- '5280;Investeringsejendomme under opførelse, øvrige værdireguleringer;' + CRLF +
- '5290;Investeringsejendomme under opførelse, årets nedskrivninger;' + CRLF +
- '5300;Investeringsejendomme under opførelse, tilbageførte nedskrivninger;' + CRLF +
- '5320;Grunde og bygninger, bogført værdi primo;' + CRLF +
- '5330;Grunde og bygninger, årets tilgange;' + CRLF +
- '5340;Grunde og bygninger, årets afgange;' + CRLF +
- '5350;Grunde og bygninger, årets forbedringer;' + CRLF +
- '5370;Grunde og bygninger, øvrige værdireguleringer;' + CRLF +
- '5390;Grunde og bygninger, årets af- og nedskrivninger;' + CRLF +
- '5400;Grunde og bygninger, tilbageførte af- og nedskrivninger;' + CRLF +
- '5420;Produktionsanlæg og maskiner, bogført værdi primo;' + CRLF +
- '5430;Produktionsanlæg og maskiner, årets tilgange;' + CRLF +
- '5440;Produktionsanlæg og maskiner, årets afgange;' + CRLF +
- '5450;Produktionsanlæg og maskiner, øvrige værdireguleringer;' + CRLF +
- '5470;Produktionsanlæg og maskiner, årets af- og nedskrivninger;' + CRLF +
- '5480;Produktionsanlæg og maskiner, tilbageførte af- og nedskrivninger;' + CRLF +
- '5500;Indretning af lejede lokaler, bogført værdi primo;' + CRLF +
- '5510;Indretning af lejede lokaler, årets tilgange;' + CRLF +
- '5520;Indretning af lejede lokaler, årets afgange;' + CRLF +
- '5530;Indretning af lejede lokaler, øvrige værdireguleringer;' + CRLF +
- '5540;Indretning af lejede lokaler, årets af- og nedskrivninger;' + CRLF +
- '5550;Indretning af lejede lokaler, tilbageførte af- og nedskrivninger;' + CRLF +
- '5570;Andre anlæg, driftsmateriel og inventar, bogført værdi primo;' + CRLF +
- '5580;Andre anlæg, driftsmateriel og inventar, årets tilgange;' + CRLF +
- '5590;Andre anlæg, driftsmateriel og inventar, årets afgange;' + CRLF +
- '5600;Andre anlæg, driftsmateriel og inventar, øvrige værdireguleringer;' + CRLF +
- '5610;Andre anlæg, driftsmateriel og inventar, årets af- og nedskrivninger;' + CRLF +
- '5620;Andre anlæg, driftsmateriel og inventar, tilbageførte af- og nedskrivninger;' + CRLF +
- '5640;Materielle anlægsaktiver under udførelse og forudbetalinger for materielle anlægsaktiver, bogført værdi primo;' + CRLF +
- '5650;Materielle anlægsaktiver under udførelse og forudbetalinger for materielle anlægsaktiver, årets tilgange;' + CRLF +
- '5660;Materielle anlægsaktiver under udførelse og forudbetalinger for materielle anlægsaktiver, årets afgange;' + CRLF +
- '5670;Materielle anlægsaktiver under udførelse og forudbetalinger for materielle anlægsaktiver, øvrige værdireguleringer;' + CRLF +
- '5680;Materielle anlægsaktiver under udførelse og forudbetalinger for materielle anlægsaktiver, årets nedskrivninger;' + CRLF +
- '5690;Materielle anlægsaktiver under udførelse og forudbetalinger for materielle anlægsaktiver, tilbageførte nedskrivninger;' + CRLF +
- '5710;Finansielt leasede aktiver, bogført værdi primo;' + CRLF +
- '5720;Finansielt leasede aktiver, årets tilgange;' + CRLF +
- '5730;Finansielt leasede aktiver, årets afgange;' + CRLF +
- '5740;Finansielt leasede aktiver, øvrige værdireguleringer;' + CRLF +
- '5750;Finansielt leasede aktiver, årets af- og nedskrivninger;' + CRLF +
- '5760;Finansielt leasede aktiver, tilbageførte af- og nedskrivninger;' + CRLF +
- '5800;Kapitalandele i tilknyttede virksomheder, bogført værdi primo;' + CRLF +
- '5810;Kapitalandele i tilknyttede virksomheder, årets tilgange;' + CRLF +
- '5820;Kapitalandele i tilknyttede virksomheder, årets afgange;' + CRLF +
- '5830;Kapitalandele i tilknyttede virksomheder, øvrige værdireguleringer;' + CRLF +
- '5840;Kapitalandele i tilknyttede virksomheder, årets nedskrivninger;' + CRLF +
- '5850;Kapitalandele i tilknyttede virksomheder, tilbageførte nedskrivninger;' + CRLF +
- '5870;Langfristede tilgodehavender hos tilknyttede virksomheder;' + CRLF +
- '5880;Nedskrivning på langfristede tilgodehavender hos tilknyttede virksomheder;' + CRLF +
- '5900;Kapitalandele i kapitalinteresser, bogført værdi primo;' + CRLF +
- '5910;Kapitalandele i kapitalinteresser, årets tilgange;' + CRLF +
- '5920;Kapitalandele i kapitalinteresser, årets afgange;' + CRLF +
- '5930;Kapitalandele i kapitalinteresser, øvrige værdireguleringer;' + CRLF +
- '5940;Kapitalandele i kapitalinteresser, årets nedskrivninger;' + CRLF +
- '5950;Kapitalandele i kapitalinteresser, bogført værdi primo, tilbageførte nedskrivninger;' + CRLF +
- '5970;Langfristede tilgodehavender hos kapitalinteresser;' + CRLF +
- '5980;Nedskrivning på langfristede tilgodehavender hos kapitalinteresser;' + CRLF +
- '6000;Andre værdipapirer og kapitalandele;' + CRLF +
- '6020;Udskudte skatteaktiver;' + CRLF +
- '6030;Øvrige (langfristede) tilgodehavender;' + CRLF +
- '6040;Deposita;' + CRLF +
- '6060;Tilgodehavender hos virksomhedsdeltagere og ledelse;' + CRLF +
- '6080;Råvarer og hjælpematerialer;' + CRLF +
- '6090;Nedskrivning på råvarer og hjælpematerialer;' + CRLF +
- '6110;Varer under fremstilling;' + CRLF +
- '6120;Nedskrivning på varer under fremstilling;' + CRLF +
- '6140;Fremstillede varer og handelsvarer;' + CRLF +
- '6150;Nedskrivning på fremstillede varer og handelsvarer;' + CRLF +
- '6170;Forudbetalinger for varer;' + CRLF +
- '6190;Tilgodehavender fra salg og tjenesteydelser;' + CRLF +
- '6200;Akkumulerede nedskrivninger til tab på tilgodehavender fra salg og tjenesteydelser;' + CRLF +
- '6220;Kortfristede tilgodehavender hos tilknyttede virksomheder;' + CRLF +
- '6230;Akkumulerede nedskrivninger til tab på tilgodehavender fra tilknyttede virksomheder;' + CRLF +
- '6240;Kortfristede tilgodehavender hos kapitalinteresser;' + CRLF +
- '6250;Akkumulerede nedskrivninger til tab på tilgodehavender fra kapitalinteresser;' + CRLF +
- '6260;Kortfristede tilgodehavender hos tilknyttede virksomheder;' + CRLF +
- '6270;Igangværende arbejder for fremmed regning;' + CRLF +
- '6280;Igangværende arbejder for fremmed regning;' + CRLF +
- '6290;Udskudte skatteaktiver;' + CRLF +
- '6300;Tilgodehavende selskabsskat (kortfristet);' + CRLF +
- '6310;Tilgodehavende kildeskat;' + CRLF +
- '6320;Tilgodehavende moms (kortfristet);' + CRLF +
- '6330;Øvrige tilgodehavender (kortfristede);' + CRLF +
- '6340;Andre tilgodehavender (kortfristede);' + CRLF +
- '6350;Krav på indbetaling af virksomhedskapital og overkurs;' + CRLF +
- '6360;Krav på indbetaling af virksomhedskapital og overkurs;' + CRLF +
- '6370;Kortfristede tilgodehavender hos virksomhedsdeltagere og ledelse;' + CRLF +
- '6380;Kortfristede tilgodehavender hos virksomhedsdeltagere og ledelse;' + CRLF +
- '6390;Periodeafgrænsningsposter, der kan opretholdes skattemæssigt;' + CRLF +
- '6400;Periodeafgrænsningsposter, der ikke kan opretholdes skattemæssigt;' + CRLF +
- '6410;Periodeafgrænsningsposter;' + CRLF +
- '6411;Tilgodehavender;' + CRLF +
- '6420;Kapitalandele i tilknyttede virksomheder;' + CRLF +
- '6430;Kapitalandele i tilknyttede virksomheder;' + CRLF +
- '6450;Andre værdipapirer og kapitalandele;' + CRLF +
- '6460;Andre værdipapirer og kapitalandele;' + CRLF +
- '6461;Værdipapirer og kapitalandele;' + CRLF +
- '6470;Likvide beholdninger;' + CRLF +
- '6480;Bankkonto;' + CRLF +
- '6490;Likvide beholdninger;' + CRLF +
- '6510;Registreret kapital mv.;' + CRLF +
- '6520;Indbetalt registreret kapital mv.;' + CRLF +
- '6530;Virksomhedskapital;' + CRLF +
- '6540;Overkurs ved emission;' + CRLF +
- '6550;Overkurs ved emission;' + CRLF +
- '6560;Reserve for opskrivninger;' + CRLF +
- '6570;Reserve for opskrivninger;' + CRLF +
- '6580;Reserve for nettoopskrivning efter den indre værdis metode;' + CRLF +
- '6590;Reserve for nettoopskrivning efter den indre værdis metode;' + CRLF +
- '6810;Reserve for udlån og sikkerhedsstillelse;' + CRLF +
- '6830;Reserve for ikke indbetalt virksomhedskapital og overkurs;' + CRLF +
- '6870;Øvrige lovpligtige reserver;' + CRLF +
- '6890;Vedtægtsmæssige reserver;' + CRLF +
- '6910;Øvrige reserver;' + CRLF +
- '6930;Andre reserver;' + CRLF +
- '6940;Overført resultat;' + CRLF +
- '6950;Overført resultat;' + CRLF +
- '6960;Foreslået udbytte indregnet under egenkapitalen;' + CRLF +
- '6970;Foreslået udbytte indregnet under egenkapitalen;' + CRLF +
- '7010;Hensættelser til udskudt skat;' + CRLF +
- '7020;Hensættelser til pensioner og lignende forpligtelser;' + CRLF +
- '7030;Hensættelse til udskudt skat;' + CRLF +
- '7040;Andre hensatte forpligtelser;' + CRLF +
- '7050;Andre hensatte forpligtelser;' + CRLF +
- '7110;Gæld til kreditinstitutter - langfristet gæld;' + CRLF +
- '7120;Gæld til banker - langfristet gæld;' + CRLF +
- '7130;Gæld til kreditinstitutter;' + CRLF +
- '7160;Gæld til tilknyttede virksomheder - langfristet gæld;' + CRLF +
- '7170;Gæld til kapitalinteresser - langfristet gæld;' + CRLF +
- '7180;Gæld til tilknyttede virksomheder - langfristet gæld;' + CRLF +
- '7190;Anden gæld - langfristet;' + CRLF +
- '7210;Gæld til selskabsdeltagere og ledelse - langfristet gæld;' + CRLF +
- '7230;Deposita - langfristet gæld;' + CRLF +
- '7240;Leasingforpligtelse - langfristet gæld;' + CRLF +
- '7250;Selskabsskat - langfristet gæld;' + CRLF +
- '7260;Anden gæld, herunder skyldige skatter og skyldige bidrag til social sikring;' + CRLF +
- '7310;Gæld til kreditinstitutter - kortfristet gæld;' + CRLF +
- '7330;Gæld til banker - kortfristet gæld;' + CRLF +
- '7350;Kreditinstitutter i øvrigt;' + CRLF +
- '7360;Gæld til kreditinstitutter - kortfristet gæld;' + CRLF +
- '7410;Modtagne forudbetalinger fra kunder;' + CRLF +
- '7420;Modtagne forudbetalinger fra kunder;' + CRLF +
- '7440;Leverandører af varer og tjenesteydelser;' + CRLF +
- '7450;Leverandører af varer og tjenesteydelser;' + CRLF +
- '7510;Gæld til tilknyttede virksomheder - kortfristet gæld;' + CRLF +
- '7520;Gæld til kapitalinteresser - kortfristet gæld;' + CRLF +
- '7530;Gæld til tilknyttede virksomheder - kortfristet gæld;' + CRLF +
- '7590;Gæld til selskabsdeltagere og ledelse - kortfristet gæld;' + CRLF +
- '7610;Deposita - kortfristet gæld;' + CRLF +
- '7630;Leasingforpligtelse - kortfristet;' + CRLF +
- '7680;Salgsmoms;' + CRLF +
- '7700;Moms af varekøb udland, EU og ikke-EU;' + CRLF +
- '7720;Moms af ydelseskøb udland, EU og ikke-EU;' + CRLF +
- '7740;Købsmoms;' + CRLF +
- '7760;Olie- og flaskegasafgift;' + CRLF +
- '7780;Elafgift;' + CRLF +
- '7800;Naturgas- og bygasafgift;' + CRLF +
- '7810;Kulafgift;' + CRLF +
- '7820;Vandafgift;' + CRLF +
- '7830;Co2-afgift;' + CRLF +
- '7840;Skyldig moms;' + CRLF +
- '7860;Skyldig løn og gager;' + CRLF +
- '7880;Skyldig bonus og tantieme;' + CRLF +
- '7900;Skyldige feriepenge;' + CRLF +
- '7920;Skyldig A-skat;' + CRLF +
- '7940;Skyldigt AM-bidrag;' + CRLF +
- '7960;Skyldigt ATP-bidrag;' + CRLF +
- '7980;Skyldigt AMP-bidrag;' + CRLF +
- '8000;Anden skyldig pension;' + CRLF +
- '8040;Øvrig anden gæld;' + CRLF +
- '8050;Anden gæld (kortfristet gæld);' + CRLF +
- '8070;Periodeafgrænsningsposter;' + CRLF +
- '8080;Periodeafgrænsningsposter;');
+ '1010;Salg af varer og ydelser' + CRLF +
+ '1050;Salg af varer udland, EU' + CRLF +
+ '1100;Salg af varer udland, ikke-EU' + CRLF +
+ '1150;Salg af ydelser udland, EU' + CRLF +
+ '1200;Salg af ydelser udland, ikke-EU' + CRLF +
+ '1300;Regulering igangværende arbejder' + CRLF +
+ '1350;Værdireguleringer af investeringsejendomme' + CRLF +
+ '1410;Varelagerregulering på lagre af færdigvarer og varer under fremstilling' + CRLF +
+ '1430;Nedskrivning på lagre af færdigvarer og varer under fremstilling' + CRLF +
+ '1460;Øvrige ændringer på lagre af færdigvarer og varer under fremstilling' + CRLF +
+ '1510;Gevinst ved salg af immaterielle anlægsaktiver' + CRLF +
+ '1530;Gevinst ved salg af materielle anlægsaktiver' + CRLF +
+ '1540;Gevinst ved salg af finansielle anlægsaktiver' + CRLF +
+ '1550;Øvrige andre driftsindtægter' + CRLF +
+ '1610;Varekøb' + CRLF +
+ '1630;Varekøb udland, EU' + CRLF +
+ '1650;Varekøb udland, ikke-EU' + CRLF +
+ '1660;Ydelseskøb' + CRLF +
+ '1710;Ydelseskøb udland, EU' + CRLF +
+ '1740;Ydelseskøb, udland, ikke-EU' + CRLF +
+ '1770;Varelagerregulering på lagre af råvarer og hjælpematerialer' + CRLF +
+ '1800;Nedskrivning på varelager' + CRLF +
+ '1820;Andre eksterne omkostninger' + CRLF +
+ '1830;Fragtomkostninger' + CRLF +
+ '1850;Annoncering og reklame' + CRLF +
+ '1870;Udstillinger og dekoration' + CRLF +
+ '1890;Restaurationsbesøg' + CRLF +
+ '1910;Repræsentationsomkostninger, skattemæssigt begrænset fradrag' + CRLF +
+ '1930;Repræsentationsomkostninger, fuld fradragsret skattemæssigt' + CRLF +
+ '1950;Andre salgsomkostninger' + CRLF +
+ '1970;Aviser og blade' + CRLF +
+ '1990;Gaver og blomster' + CRLF +
+ '2030;Husleje, ekskl. el, vand og varme' + CRLF +
+ '2050;El' + CRLF +
+ '2060;Elafgift' + CRLF +
+ '2070;Vand' + CRLF +
+ '2080;Varme' + CRLF +
+ '2090;Vandafgift' + CRLF +
+ '2100;Olie- og flaskegasafgift' + CRLF +
+ '2110;Kulafgift' + CRLF +
+ '2120;Naturgas- og bygasafgift' + CRLF +
+ '2130;Co2-afgift' + CRLF +
+ '2140;Øvrige afgifter' + CRLF +
+ '2150;Rengøring og renovation (affaldshåndtering)' + CRLF +
+ '2160;Reparation og vedligeholdelse' + CRLF +
+ '2170;Reparation og vedligeholdelse, ejendom skattemæssigt afskrivningsberettiget, bygning 1' + CRLF +
+ '2180;Forsikringer' + CRLF +
+ '2190;Ejendomsskatter' + CRLF +
+ '2200;Andre lokaleomkostninger' + CRLF +
+ '2230;Småanskaffelser under skattemæssig grænse for småaktiver' + CRLF +
+ '2240;Småanskaffelser over skattemæssig grænse for småaktiver' + CRLF +
+ '2250;Underleverandører' + CRLF +
+ '2260;Forsknings- og udviklingsomkostninger' + CRLF +
+ '2270;Øvrige produktionsomkostninger' + CRLF +
+ '2280;Konstaterede tab på tilgodehavender fra salg og tjenesteydelser' + CRLF +
+ '2290;Regulering af nedskrivning på tilgodehavender fra salg og tjenesteydelser' + CRLF +
+ '2300;Regulering af tilgodehavender fra tilknyttede virksomheder og associerede virksomheder' + CRLF +
+ '2310;It-udstyr mv.' + CRLF +
+ '2330;Skattefri rejse- og befordringsgodtgørelse' + CRLF +
+ '2350;Kantineudgifter' + CRLF +
+ '2370;Kontingenter' + CRLF +
+ '2380;Faglitteratur' + CRLF +
+ '2390;Porto og gebyrer' + CRLF +
+ '2410;Telefon og internet mv. (kun virksomhed)' + CRLF +
+ '2420;Telefon og internet mv. (delvist privat)' + CRLF +
+ '2450;Kontorartikler' + CRLF +
+ '2460;Leje og operationelle leasingydelser (ekskl. husleje)' + CRLF +
+ '2470;Rejseudgifter' + CRLF +
+ '2480;Vikarassistance' + CRLF +
+ '2510;Konsulentydelser' + CRLF +
+ '2520;Kursusudgifter' + CRLF +
+ '2530;Leasingomkostninger, personbiler' + CRLF +
+ '2540;Driftsomkostninger, personbiler' + CRLF +
+ '2560;Driftsomkostninger, varebiler' + CRLF +
+ '2620;Parkeringsudgifter' + CRLF +
+ '2630;Biludgifter efter statens takster' + CRLF +
+ '2640;Fri bil' + CRLF +
+ '2650;Arbejdsskadeforsikring' + CRLF +
+ '2660;Offentlige gebyrer og bøder (ej fradragsberettiget skattemæssigt)' + CRLF +
+ '2670;Revision og regnskabsmæssig assistance' + CRLF +
+ '2680;Advokatmæssig assistance' + CRLF +
+ '2690;Øvrige rådgivningshonorarer' + CRLF +
+ '2700;Ej skattemæssigt fradragsberettigede rådgivningshonorarer' + CRLF +
+ '2710;Administrationsvederlag/management fee' + CRLF +
+ '2720;Øreafrunding/kassedifferencer' + CRLF +
+ '2810;Andre eksterne omkostninger' + CRLF +
+ '2850;Lønninger' + CRLF +
+ '2860;Feriepengeforpligtelse' + CRLF +
+ '2870;Jubilæumsgratiale og fratrædelsesgodtgørelse' + CRLF +
+ '2880;Bestyrelseshonorar' + CRLF +
+ '2890;AM Bidragspligtig A-Indkomst' + CRLF +
+ '2900;AM Bidragsfri A-Indkomst' + CRLF +
+ '2910;Pensioner' + CRLF +
+ '2920;Vederlag til afløsning af pensionstilsagn' + CRLF +
+ '2930;Omkostninger til social sikring' + CRLF +
+ '2940;AER/ AUB' + CRLF +
+ '2950;ATP' + CRLF +
+ '2960;Andre personaleomkostninger' + CRLF +
+ '2965;Personalegoder' + CRLF +
+ '2968;Lønrefusioner' + CRLF +
+ '2970;Udbetalte skattefrie godtgørelser i form af kørepenge og diæter' + CRLF +
+ '2980;Lønsumsafgift' + CRLF +
+ '3000;Af- og nedskrivninger af erhvervede immaterielle anlægsaktiver' + CRLF +
+ '3010;Af- og nedskrivninger af goodwill' + CRLF +
+ '3020;Af- og nedskrivninger af grunde og bygninger' + CRLF +
+ '3030;Af- og nedskrivninger af produktionsanlæg og maskiner' + CRLF +
+ '3040;Af- og nedskrivninger af indretning af lejede lokaler' + CRLF +
+ '3050;Af- og nedskrivninger af andre anlæg, driftsmateriel og inventar' + CRLF +
+ '3060;Af- og nedskrivninger af software' + CRLF +
+ '3070;Af- og nedskrivninger af finansielt leasede grunde og bygninger' + CRLF +
+ '3080;Af- og nedskrivninger af finansielt leasede produktionsanlæg og maskiner' + CRLF +
+ '3090;Af- og nedskrivninger af finansielt leasede andre anlæg, driftsmateriel og inventar' + CRLF +
+ '3130;Nedskrivninger af omsætningsaktiver, som overstiger normale nedskrivninger' + CRLF +
+ '3160;Tab ved salg af immaterielle anlægsaktiver' + CRLF +
+ '3170;Tab ved salg af materielle anlægsaktiver' + CRLF +
+ '3180;Øvrige andre driftsomkostninger' + CRLF +
+ '3200;Indtægter af kapitalandele i tilknyttede virksomheder' + CRLF +
+ '3230;Indtægter af kapitalandele i kapitalinteresser' + CRLF +
+ '3380;Udbytte fra unoterede porteføljeaktier (bruttoudbytte)' + CRLF +
+ '3400;Øvrige indtægter af andre kapitalandele, værdipapirer og tilgodehavender, der er anlægsaktiver' + CRLF +
+ '3440;Andre finansielle indtægter fra tilknyttede virksomheder' + CRLF +
+ '3470;Renter fra banker' + CRLF +
+ '3490;Renter vedr. tilgodehavende fra salg af varer og tjenesteydelser' + CRLF +
+ '3510;Rentetillæg mv. fra det offentlige (ej skattepligtig)' + CRLF +
+ '3530;Øvrige finansielle indtægter' + CRLF +
+ '3560;Nedskrivning af finansielle aktiver' + CRLF +
+ '3590;Finansielle omkostninger, der hidrører fra tilknyttede virksomheder' + CRLF +
+ '3610;Valutakursreguleringer' + CRLF +
+ '3620;Valutakursreguleringer, udenlandske dattervirksomheder' + CRLF +
+ '3630;Kurstab på likvider, bankgæld og prioritetsgæld' + CRLF +
+ '3640;Renter på finansiel leasinggæld' + CRLF +
+ '3650;Renter vedr. leverandører af varer og tjenesteydelser' + CRLF +
+ '3670;Renter til banker og realkreditinstitutter' + CRLF +
+ '3675;Renter til det offentlige (ej fradragsberettiget skattemæssigt)' + CRLF +
+ '3680;Værdireguleringer af investeringsejendomme' + CRLF +
+ '3690;Andre finansielle omkostninger' + CRLF +
+ '3740;Aktuel skat' + CRLF +
+ '3760;Ændring af udskudt skat' + CRLF +
+ '3780;Regulering vedrørende tidligere år' + CRLF +
+ '3810;Andre skatter' + CRLF +
+ '5010;Goodwill, bogført værdi primo' + CRLF +
+ '5020;Goodwill, årets tilgange' + CRLF +
+ '5030;Goodwill, årets afgange' + CRLF +
+ '5040;Goodwill, øvrige værdireguleringer' + CRLF +
+ '5050;Goodwill, årets af- og nedskrivninger' + CRLF +
+ '5060;Goodwill, tilbageførte af- og nedskrivninger' + CRLF +
+ '5080;Erhvervede immaterielle anlægsaktiver, bogført værdi primo' + CRLF +
+ '5090;Erhvervede immaterielle anlægsaktiver, årets tilgange' + CRLF +
+ '5100;Erhvervede immaterielle anlægsaktiver, årets afgange' + CRLF +
+ '5110;Erhvervede immaterielle anlægsaktiver, øvrige værdireguleringer' + CRLF +
+ '5120;Erhvervede immaterielle anlægsaktiver, årets af- og nedskrivninger' + CRLF +
+ '5130;Erhvervede immaterielle anlægsaktiver, tilbageførte af- og nedskrivninger' + CRLF +
+ '5160;Investeringsejendomme, bogført værdi primo' + CRLF +
+ '5170;Investeringsejendomme, årets tilgange' + CRLF +
+ '5180;Investeringsejendomme, årets afgange' + CRLF +
+ '5190;Investeringsejendomme, årets forbedringer' + CRLF +
+ '5200;Investeringsejendomme, øvrige værdireguleringer' + CRLF +
+ '5210;Investeringsejendomme, årets af- og nedskrivninger' + CRLF +
+ '5220;Investeringsejendomme, tilbageførte af- og nedskrivninger' + CRLF +
+ '5240;Investeringsejendomme under opførelse, bogført værdi primo' + CRLF +
+ '5250;Investeringsejendomme under opførelse, årets tilgange' + CRLF +
+ '5260;Investeringsejendomme under opførelse, årets afgange' + CRLF +
+ '5270;Investeringsejendomme under opførelse, årets forbedringer' + CRLF +
+ '5280;Investeringsejendomme under opførelse, øvrige værdireguleringer' + CRLF +
+ '5290;Investeringsejendomme under opførelse, årets nedskrivninger' + CRLF +
+ '5300;Investeringsejendomme under opførelse, tilbageførte nedskrivninger' + CRLF +
+ '5320;Grunde og bygninger, bogført værdi primo' + CRLF +
+ '5330;Grunde og bygninger, årets tilgange' + CRLF +
+ '5340;Grunde og bygninger, årets afgange' + CRLF +
+ '5350;Grunde og bygninger, årets forbedringer' + CRLF +
+ '5370;Grunde og bygninger, øvrige værdireguleringer' + CRLF +
+ '5390;Grunde og bygninger, årets af- og nedskrivninger' + CRLF +
+ '5400;Grunde og bygninger, tilbageførte af- og nedskrivninger' + CRLF +
+ '5420;Produktionsanlæg og maskiner, bogført værdi primo' + CRLF +
+ '5430;Produktionsanlæg og maskiner, årets tilgange' + CRLF +
+ '5440;Produktionsanlæg og maskiner, årets afgange' + CRLF +
+ '5450;Produktionsanlæg og maskiner, øvrige værdireguleringer' + CRLF +
+ '5470;Produktionsanlæg og maskiner, årets af- og nedskrivninger' + CRLF +
+ '5480;Produktionsanlæg og maskiner, tilbageførte af- og nedskrivninger' + CRLF +
+ '5500;Indretning af lejede lokaler, bogført værdi primo' + CRLF +
+ '5510;Indretning af lejede lokaler, årets tilgange' + CRLF +
+ '5520;Indretning af lejede lokaler, årets afgange' + CRLF +
+ '5530;Indretning af lejede lokaler, øvrige værdireguleringer' + CRLF +
+ '5540;Indretning af lejede lokaler, årets af- og nedskrivninger' + CRLF +
+ '5550;Indretning af lejede lokaler, tilbageførte af- og nedskrivninger' + CRLF +
+ '5570;Andre anlæg, driftsmateriel og inventar, bogført værdi primo' + CRLF +
+ '5580;Andre anlæg, driftsmateriel og inventar, årets tilgange' + CRLF +
+ '5590;Andre anlæg, driftsmateriel og inventar, årets afgange' + CRLF +
+ '5600;Andre anlæg, driftsmateriel og inventar, øvrige værdireguleringer' + CRLF +
+ '5610;Andre anlæg, driftsmateriel og inventar, årets af- og nedskrivninger' + CRLF +
+ '5620;Andre anlæg, driftsmateriel og inventar, tilbageførte af- og nedskrivninger' + CRLF +
+ '5640;Materielle anlægsaktiver under udførelse og forudbetalinger for materielle anlægsaktiver, bogført værdi primo' + CRLF +
+ '5650;Materielle anlægsaktiver under udførelse og forudbetalinger for materielle anlægsaktiver, årets tilgange' + CRLF +
+ '5660;Materielle anlægsaktiver under udførelse og forudbetalinger for materielle anlægsaktiver, årets afgange' + CRLF +
+ '5670;Materielle anlægsaktiver under udførelse og forudbetalinger for materielle anlægsaktiver, øvrige værdireguleringer' + CRLF +
+ '5680;Materielle anlægsaktiver under udførelse og forudbetalinger for materielle anlægsaktiver, årets nedskrivninger' + CRLF +
+ '5690;Materielle anlægsaktiver under udførelse og forudbetalinger for materielle anlægsaktiver, tilbageførte nedskrivninger' + CRLF +
+ '5710;Finansielt leasede aktiver, bogført værdi primo' + CRLF +
+ '5720;Finansielt leasede aktiver, årets tilgange' + CRLF +
+ '5730;Finansielt leasede aktiver, årets afgange' + CRLF +
+ '5740;Finansielt leasede aktiver, øvrige værdireguleringer' + CRLF +
+ '5750;Finansielt leasede aktiver, årets af- og nedskrivninger' + CRLF +
+ '5760;Finansielt leasede aktiver, tilbageførte af- og nedskrivninger' + CRLF +
+ '5800;Kapitalandele i tilknyttede virksomheder, bogført værdi primo' + CRLF +
+ '5810;Kapitalandele i tilknyttede virksomheder, årets tilgange' + CRLF +
+ '5820;Kapitalandele i tilknyttede virksomheder, årets afgange' + CRLF +
+ '5830;Kapitalandele i tilknyttede virksomheder, øvrige værdireguleringer' + CRLF +
+ '5840;Kapitalandele i tilknyttede virksomheder, årets nedskrivninger' + CRLF +
+ '5850;Kapitalandele i tilknyttede virksomheder, tilbageførte nedskrivninger' + CRLF +
+ '5870;Langfristede tilgodehavender hos tilknyttede virksomheder' + CRLF +
+ '5880;Nedskrivning på langfristede tilgodehavender hos tilknyttede virksomheder' + CRLF +
+ '5900;Kapitalandele i kapitalinteresser, bogført værdi primo' + CRLF +
+ '5910;Kapitalandele i kapitalinteresser, årets tilgange' + CRLF +
+ '5920;Kapitalandele i kapitalinteresser, årets afgange' + CRLF +
+ '5930;Kapitalandele i kapitalinteresser, øvrige værdireguleringer' + CRLF +
+ '5940;Kapitalandele i kapitalinteresser, årets nedskrivninger' + CRLF +
+ '5950;Kapitalandele i kapitalinteresser, bogført værdi primo, tilbageførte nedskrivninger' + CRLF +
+ '5970;Langfristede tilgodehavender hos kapitalinteresser' + CRLF +
+ '5980;Nedskrivning på langfristede tilgodehavender hos kapitalinteresser' + CRLF +
+ '6000;Andre værdipapirer og kapitalandele' + CRLF +
+ '6020;Udskudte skatteaktiver' + CRLF +
+ '6030;Øvrige (langfristede) tilgodehavender' + CRLF +
+ '6040;Deposita' + CRLF +
+ '6060;Tilgodehavender hos virksomhedsdeltagere og ledelse' + CRLF +
+ '6080;Råvarer og hjælpematerialer' + CRLF +
+ '6090;Nedskrivning på råvarer og hjælpematerialer' + CRLF +
+ '6110;Varer under fremstilling' + CRLF +
+ '6120;Nedskrivning på varer under fremstilling' + CRLF +
+ '6140;Fremstillede varer og handelsvarer' + CRLF +
+ '6150;Nedskrivning på fremstillede varer og handelsvarer' + CRLF +
+ '6170;Forudbetalinger for varer' + CRLF +
+ '6190;Tilgodehavender fra salg og tjenesteydelser' + CRLF +
+ '6200;Akkumulerede nedskrivninger til tab på tilgodehavender fra salg og tjenesteydelser' + CRLF +
+ '6220;Kortfristede tilgodehavender hos tilknyttede virksomheder' + CRLF +
+ '6230;Akkumulerede nedskrivninger til tab på tilgodehavender fra tilknyttede virksomheder' + CRLF +
+ '6240;Kortfristede tilgodehavender hos kapitalinteresser' + CRLF +
+ '6250;Akkumulerede nedskrivninger til tab på tilgodehavender fra kapitalinteresser' + CRLF +
+ '6260;Kortfristede tilgodehavender hos tilknyttede virksomheder' + CRLF +
+ '6270;Igangværende arbejder for fremmed regning' + CRLF +
+ '6280;Igangværende arbejder for fremmed regning' + CRLF +
+ '6290;Udskudte skatteaktiver' + CRLF +
+ '6300;Tilgodehavende selskabsskat (kortfristet)' + CRLF +
+ '6310;Tilgodehavende kildeskat' + CRLF +
+ '6320;Tilgodehavende moms (kortfristet)' + CRLF +
+ '6330;Øvrige tilgodehavender (kortfristede)' + CRLF +
+ '6340;Andre tilgodehavender (kortfristede)' + CRLF +
+ '6350;Krav på indbetaling af virksomhedskapital og overkurs' + CRLF +
+ '6360;Krav på indbetaling af virksomhedskapital og overkurs' + CRLF +
+ '6370;Kortfristede tilgodehavender hos virksomhedsdeltagere og ledelse' + CRLF +
+ '6380;Kortfristede tilgodehavender hos virksomhedsdeltagere og ledelse' + CRLF +
+ '6390;Periodeafgrænsningsposter, der kan opretholdes skattemæssigt' + CRLF +
+ '6400;Periodeafgrænsningsposter, der ikke kan opretholdes skattemæssigt' + CRLF +
+ '6410;Periodeafgrænsningsposter' + CRLF +
+ '6411;Tilgodehavender' + CRLF +
+ '6420;Kapitalandele i tilknyttede virksomheder' + CRLF +
+ '6430;Kapitalandele i tilknyttede virksomheder' + CRLF +
+ '6450;Andre værdipapirer og kapitalandele' + CRLF +
+ '6460;Andre værdipapirer og kapitalandele' + CRLF +
+ '6461;Værdipapirer og kapitalandele' + CRLF +
+ '6470;Likvide beholdninger' + CRLF +
+ '6480;Bankkonto' + CRLF +
+ '6490;Likvide beholdninger' + CRLF +
+ '6510;Registreret kapital mv.' + CRLF +
+ '6520;Indbetalt registreret kapital mv.' + CRLF +
+ '6530;Virksomhedskapital' + CRLF +
+ '6540;Overkurs ved emission' + CRLF +
+ '6550;Overkurs ved emission' + CRLF +
+ '6560;Reserve for opskrivninger' + CRLF +
+ '6570;Reserve for opskrivninger' + CRLF +
+ '6580;Reserve for nettoopskrivning efter den indre værdis metode' + CRLF +
+ '6590;Reserve for nettoopskrivning efter den indre værdis metode' + CRLF +
+ '6810;Reserve for udlån og sikkerhedsstillelse' + CRLF +
+ '6830;Reserve for ikke indbetalt virksomhedskapital og overkurs' + CRLF +
+ '6870;Øvrige lovpligtige reserver' + CRLF +
+ '6890;Vedtægtsmæssige reserver' + CRLF +
+ '6910;Øvrige reserver' + CRLF +
+ '6930;Andre reserver' + CRLF +
+ '6940;Overført resultat' + CRLF +
+ '6950;Overført resultat' + CRLF +
+ '6960;Foreslået udbytte indregnet under egenkapitalen' + CRLF +
+ '6970;Foreslået udbytte indregnet under egenkapitalen' + CRLF +
+ '7010;Hensættelser til udskudt skat' + CRLF +
+ '7020;Hensættelser til pensioner og lignende forpligtelser' + CRLF +
+ '7030;Hensættelse til udskudt skat' + CRLF +
+ '7040;Andre hensatte forpligtelser' + CRLF +
+ '7050;Andre hensatte forpligtelser' + CRLF +
+ '7110;Gæld til kreditinstitutter - langfristet gæld' + CRLF +
+ '7120;Gæld til banker - langfristet gæld' + CRLF +
+ '7130;Gæld til kreditinstitutter' + CRLF +
+ '7160;Gæld til tilknyttede virksomheder - langfristet gæld' + CRLF +
+ '7170;Gæld til kapitalinteresser - langfristet gæld' + CRLF +
+ '7180;Gæld til tilknyttede virksomheder - langfristet gæld' + CRLF +
+ '7190;Anden gæld - langfristet' + CRLF +
+ '7210;Gæld til selskabsdeltagere og ledelse - langfristet gæld' + CRLF +
+ '7230;Deposita - langfristet gæld' + CRLF +
+ '7240;Leasingforpligtelse - langfristet gæld' + CRLF +
+ '7250;Selskabsskat - langfristet gæld' + CRLF +
+ '7260;Anden gæld, herunder skyldige skatter og skyldige bidrag til social sikring' + CRLF +
+ '7310;Gæld til kreditinstitutter - kortfristet gæld' + CRLF +
+ '7330;Gæld til banker - kortfristet gæld' + CRLF +
+ '7350;Kreditinstitutter i øvrigt' + CRLF +
+ '7360;Gæld til kreditinstitutter - kortfristet gæld' + CRLF +
+ '7410;Modtagne forudbetalinger fra kunder' + CRLF +
+ '7420;Modtagne forudbetalinger fra kunder' + CRLF +
+ '7440;Leverandører af varer og tjenesteydelser' + CRLF +
+ '7450;Leverandører af varer og tjenesteydelser' + CRLF +
+ '7510;Gæld til tilknyttede virksomheder - kortfristet gæld' + CRLF +
+ '7520;Gæld til kapitalinteresser - kortfristet gæld' + CRLF +
+ '7530;Gæld til tilknyttede virksomheder - kortfristet gæld' + CRLF +
+ '7590;Gæld til selskabsdeltagere og ledelse - kortfristet gæld' + CRLF +
+ '7610;Deposita - kortfristet gæld' + CRLF +
+ '7630;Leasingforpligtelse - kortfristet' + CRLF +
+ '7680;Salgsmoms' + CRLF +
+ '7700;Moms af varekøb udland, EU og ikke-EU' + CRLF +
+ '7720;Moms af ydelseskøb udland, EU og ikke-EU' + CRLF +
+ '7740;Købsmoms' + CRLF +
+ '7760;Olie- og flaskegasafgift' + CRLF +
+ '7780;Elafgift' + CRLF +
+ '7800;Naturgas- og bygasafgift' + CRLF +
+ '7810;Kulafgift' + CRLF +
+ '7820;Vandafgift' + CRLF +
+ '7830;Co2-afgift' + CRLF +
+ '7840;Skyldig moms' + CRLF +
+ '7860;Skyldig løn og gager' + CRLF +
+ '7880;Skyldig bonus og tantieme' + CRLF +
+ '7900;Skyldige feriepenge' + CRLF +
+ '7920;Skyldig A-skat' + CRLF +
+ '7940;Skyldigt AM-bidrag' + CRLF +
+ '7960;Skyldigt ATP-bidrag' + CRLF +
+ '7980;Skyldigt AMP-bidrag' + CRLF +
+ '8000;Anden skyldig pension' + CRLF +
+ '8040;Øvrig anden gæld' + CRLF +
+ '8050;Anden gæld (kortfristet gæld)' + CRLF +
+ '8070;Periodeafgrænsningsposter' + CRLF +
+ '8080;Periodeafgrænsningsposter');
end;
}
diff --git a/Apps/DK/SAFTModificationDK/app/src/StandardAccounts/StandardTaxCodeDK.Codeunit.al b/Apps/DK/SAFTModificationDK/app/src/StandardAccounts/StandardTaxCodeDK.Codeunit.al
index 3552b1ad6b..5a632afe78 100644
--- a/Apps/DK/SAFTModificationDK/app/src/StandardAccounts/StandardTaxCodeDK.Codeunit.al
+++ b/Apps/DK/SAFTModificationDK/app/src/StandardAccounts/StandardTaxCodeDK.Codeunit.al
@@ -10,7 +10,7 @@ codeunit 13696 "Standard Tax Code DK"
{
Access = Internal;
- procedure GetStandardTaxCodesCSV(): Text
+ procedure GetStandardTaxCodesBefore2025CSV(): Text
var
TypeHelper: Codeunit "Type Helper";
CRLF: Text[2];
@@ -29,7 +29,7 @@ codeunit 13696 "Standard Tax Code DK"
'Skunstnere;Salgsmoms (udgående moms)' + CRLF +
'Slokal;Skal ikke medtages i angivelsen' + CRLF +
'S2;Rubrik B - varer ' + CRLF +
- 'S7;Rubrik B - oplysninger, der ikke skal indberettes til ”EU-salg uden moms”' + CRLF +
+ 'S7;Rubrik B - oplysninger, der ikke skal indberettes til "EU-salg uden moms"' + CRLF +
'S3;Rubrik B - ydelser' + CRLF +
'SMFEU;Skal ikke medtages i angivelsen' + CRLF +
'S4;Rubrik C - eksport udenfor EU' + CRLF +
@@ -88,4 +88,87 @@ codeunit 13696 "Standard Tax Code DK"
'K-%EU-Y-2;Moms af ydelseskøb i udlandet med omvendt betalingspligt og Købsmoms (indgående moms - omsætningsfordeling)' + CRLF +
'K-%EU-Y-4;Moms af ydelseskøb i udlandet med omvendt betalingspligt og Købsmoms (indgående moms - forholdsmæssig andel)');
end;
+
+ procedure GetStandardTaxCodes2025CSV(): Text
+ var
+ TypeHelper: Codeunit "Type Helper";
+ CRLF: Text[2];
+ begin
+ CRLF := TypeHelper.CRLFSeparator();
+
+ exit(
+ 'S01;Salgsmoms (udgående moms)' + CRLF +
+ 'S02;Skal som udgangspunkt medtages i rubrik C, hvis feks. skibe i udenrigsfart, salg af aviser' + CRLF +
+ 'S81;Skal ikke medtages i angivelsen' + CRLF +
+ 'S82;Skal ikke medtages i angivelsen' + CRLF +
+ 'S83;Salgsmoms (udgående moms)' + CRLF +
+ 'S84;Salgsmoms (udgående moms)' + CRLF +
+ 'S85;Salgsmoms (udgående moms)' + CRLF +
+ 'S86;Salgsmoms (udgående moms)' + CRLF +
+ 'S87;Salgsmoms (udgående moms)' + CRLF +
+ 'S88;Skal ikke medtages i angivelsen' + CRLF +
+ 'S21;Rubrik B - varer ' + CRLF +
+ 'S22;Rubrik B - oplysninger, der ikke skal indberettes til "EU-salg uden moms"' + CRLF +
+ 'S23;Rubrik B - ydelser' + CRLF +
+ 'S24;Skal ikke medtages i angivelsen' + CRLF +
+ 'S24;Skal ikke medtages i angivelsen' + CRLF +
+ 'S25;Skal ikke medtages på momsangivelsen, men som trekantshandel på EU-salgsangivelsen' + CRLF +
+ 'S41;Rubrik C - eksport udenfor EU.' + CRLF +
+ 'S42;Rubrik C - eksport udenfor EU.' + CRLF +
+ 'S43;Skal ikke medtages i angivelsen' + CRLF +
+ 'S61;OSS angivelsen + momsangivelsens rubrik C' + CRLF +
+ 'S62;OSS angivelsen + Rubrik B - oplysninger der ikke skal indberettes til "EU-salg uden moms"' + CRLF +
+ 'S63;OSS angivelsen + Rubrik C' + CRLF +
+ 'S64;OSS angivelsen (skal ikke angives på momsangivelsen)' + CRLF +
+ 'S65;OSS angivelsen + rubrik A - varer' + CRLF +
+ 'K010;Købsmoms (indgående moms)' + CRLF +
+ 'K020;Købsmoms (indgående moms - skønsmæssig andel)' + CRLF +
+ 'K030;Skal ikke medtages i angivelsen' + CRLF +
+ 'K610;Købsmoms (indgående moms 66,6%)' + CRLF +
+ 'K040;Købsmoms (indgående moms 50%)' + CRLF +
+ 'K050;Købsmoms (indgående moms 50% af "pro rata")' + CRLF +
+ 'K060;Købsmoms (indgående moms 33,3%)' + CRLF +
+ 'K070;Købsmoms (indgående moms 25%)' + CRLF +
+ 'K080;Købsmoms (indgående moms 25% af "pro rata")' + CRLF +
+ 'K090;Købsmoms (indgående moms - faktura fradrag)' + CRLF +
+ 'K100;Købsmoms (indgående moms - faktura pro rata fradrag)' + CRLF +
+ 'K110;Købsmoms (indgående moms - omsætningsfordeling)' + CRLF +
+ 'K120;Købsmoms (indgående moms - omsætningsfordeling i sektoren)' + CRLF +
+ 'K130;Købsmoms (indgående moms - forholdsmæssig andel)' + CRLF +
+ 'K620;Indgår i særligt beregningsgrundlag' + CRLF +
+ 'K630;Indgår i særligt beregningsgrundlag' + CRLF +
+ 'K640;Indgår i særligt beregningsgrundlag' + CRLF +
+ 'K650;Indgår i særligt beregningsgrundlag' + CRLF +
+ 'K660;Salgsmoms (udgående) og købsmoms (indgående moms)' + CRLF +
+ 'K670;Salgsmoms og købsmoms ( indgående moms omsætningsfordeling)' + CRLF +
+ 'K680;Salgsmoms og købsmoms (indgående moms skønsmæssig andel)' + CRLF +
+ 'K690;Salgsmoms (udgående moms)' + CRLF +
+ 'K700;Salgsmoms og købsmoms ( indgående moms arealfordeling)' + CRLF +
+ 'K710;Tilbagesøgning efter refusionsordningsreglerne' + CRLF +
+ 'K720;Angives ikke på momsangivelsen - indgår i opgørelsen ved refusionsordning' + CRLF +
+ 'K210;Varer + Moms af varekøb i udlandet (både EU og lande uden for EU) og Købsmoms (indgående moms)' + CRLF +
+ 'K220;Varer + Moms af varekøb i udlandet (både EU og lande uden for EU) og Købsmoms (indgående moms)' + CRLF +
+ 'K230;Varer + Moms af varekøb i udlandet (både EU og lande uden for EU)' + CRLF +
+ 'K240;Varer + Moms af varekøb i udlandet (både EU og lande uden for EU) og Købsmoms (indgående moms)' + CRLF +
+ 'K250;Varer + Moms af varekøb i udlandet (både EU og lande uden for EU) samt Købsmoms (indgående moms)' + CRLF +
+ 'K260;Ydelser + Moms af ydelseskøb i udlandet med omvendt betalingspligt og Købsmoms (indgående moms)' + CRLF +
+ 'K270;Ydelser + Moms af ydelseskøb i udlandet med omvendt betalingspligt og Købsmoms (indgående moms)' + CRLF +
+ 'K280;Ydelser + Moms af ydelseskøb i udlandet med omvendt betalingspligt ' + CRLF +
+ 'K290;Ydelser + Moms af ydelseskøb i udlandet med omvendt betalingspligt og Købsmoms (indgående moms - omsætningsfordeling)' + CRLF +
+ 'K300;Ydelser + Moms af ydelseskøb i udlandet med omvendt betalingspligt og Købsmoms (indgående moms - forholdsmæssig andel)' + CRLF +
+ 'K310;Ydelser + Moms af ydelseskøb i udlandet med omvendt betalingspligt og Købsmoms (indgående moms)' + CRLF +
+ 'K320;Ydelser + Moms af ydelseskøb i udlandet med omvendt betalingspligt og Købsmoms (indgående moms)' + CRLF +
+ 'K330;Ydelser + Moms af ydelseskøb i udlandet med omvendt betalingspligt samt Købsmoms (indgående moms 33,3%)' + CRLF +
+ 'K340;Skal ikke medtages i angivelsen' + CRLF +
+ 'K410;Moms af varekøb i udlandet (både EU og lande uden for EU) og Købsmoms (indgående moms)' + CRLF +
+ 'K420;Moms af varekøb i udlandet (både EU og lande uden for EU) og Købsmoms (indgående moms - skønsmæssig andel)' + CRLF +
+ 'K430;Moms af varekøb i udlandet (både EU og lande uden for EU)' + CRLF +
+ 'K440;Moms af varekøb i udlandet (både EU og lande uden for EU) og Købsmoms (indgående moms - omsætningsfordeling)' + CRLF +
+ 'K450;Moms af varekøb i udlandet (både EU og lande uden for EU) og Købsmoms (indgående moms - forholdsmæssig andel)' + CRLF +
+ 'K460;Moms af ydelseskøb i udlandet med omvendt betalingspligt og Købsmoms (indgående moms)' + CRLF +
+ 'K470;Moms af ydelseskøb i udlandet med omvendt betalingspligt og Købsmoms (indgående moms - skønsmæssig andel)' + CRLF +
+ 'K480;Moms af ydelseskøb i udlandet med omvendt betalingspligt' + CRLF +
+ 'K490;Moms af ydelseskøb i udlandet med omvendt betalingspligt og Købsmoms (indgående moms - omsætningsfordeling)' + CRLF +
+ 'K500;Moms af ydelseskøb i udlandet med omvendt betalingspligt og Købsmoms (indgående moms - forholdsmæssig andel)');
+ end;
}
diff --git a/Apps/DK/SAFTModificationDK/test/src/SAFTModificationDKTests.Codeunit.al b/Apps/DK/SAFTModificationDK/test/src/SAFTModificationDKTests.Codeunit.al
index ba94b10d6c..329556dfa5 100644
--- a/Apps/DK/SAFTModificationDK/test/src/SAFTModificationDKTests.Codeunit.al
+++ b/Apps/DK/SAFTModificationDK/test/src/SAFTModificationDKTests.Codeunit.al
@@ -1,7 +1,458 @@
codeunit 148057 "SAF-T Modification DK Tests"
{
+ Subtype = Test;
+
trigger OnRun()
begin
// [FEATURE] [Audit File Export] [SAF-T] [SAF-T Modification DK]
end;
+
+ [Test]
+ procedure TestGetStandardAccountsCSVForFourDigitStandardAccount()
+ var
+ StandardAccount: Record "Standard Account";
+ AuditFileExportSetup: Record "Audit File Export Setup";
+ CreateStandardDataSAFTDK: Codeunit "Create Standard Data SAF-T DK";
+ Assert: Codeunit "Assert";
+ StandardAccountType: Enum "Standard Account Type";
+ ExpectedAccounts: Dictionary of [Text, Text];
+ Result: Boolean;
+ AccountNo: Text;
+ begin
+ // [FEATURE] [AI test]
+ // [FEATURE] [RegF][DK] New Standard Chart of Accounts 2025
+ // [SCENARIO] LoadStandardAccounts loads correct standard accounts for Four Digit Standard Account
+
+ // [GIVEN] Standard Account Type is "Four Digit Standard Account"
+ StandardAccountType := StandardAccountType::"Four Digit Standard Account";
+ StandardAccount.DeleteAll();
+ AuditFileExportSetup.DeleteAll();
+ AuditFileExportSetup.Init();
+ AuditFileExportSetup."Standard Account Type" := StandardAccountType;
+ AuditFileExportSetup.Insert();
+
+ // [GIVEN] Expected standard accounts (sample from beginning, middle, and end)
+ ExpectedAccounts.Add('1010', 'Salg af varer og ydelser');
+ ExpectedAccounts.Add('1050', 'Salg af varer udland, EU');
+ ExpectedAccounts.Add('1100', 'Salg af varer udland, ikke-EU');
+ ExpectedAccounts.Add('2850', 'Lønninger');
+ ExpectedAccounts.Add('3000', 'Af- og nedskrivninger af erhvervede immaterielle anlægsaktiver');
+ ExpectedAccounts.Add('5010', 'Goodwill, bogført værdi primo');
+ ExpectedAccounts.Add('6000', 'Andre værdipapirer og kapitalandele');
+ ExpectedAccounts.Add('7010', 'Hensættelser til udskudt skat');
+ ExpectedAccounts.Add('8040', 'Øvrig anden gæld');
+ ExpectedAccounts.Add('8070', 'Periodeafgrænsningsposter');
+ ExpectedAccounts.Add('8080', 'Periodeafgrænsningsposter');
+
+ // [WHEN] LoadStandardAccounts is called
+ Result := CreateStandardDataSAFTDK.LoadStandardAccounts(StandardAccountType);
+
+ // [THEN] The method returns true
+ Assert.IsTrue(Result, 'LoadStandardAccounts should return true.');
+
+ // [THEN] Standard Accounts are loaded correctly
+ StandardAccount.SetRange(Type, StandardAccountType);
+ Assert.RecordCount(StandardAccount, 335);
+ Assert.RecordIsNotEmpty(StandardAccount);
+ foreach AccountNo in ExpectedAccounts.Keys do begin
+ StandardAccount.Get(StandardAccountType, '', AccountNo);
+ Assert.AreEqual(ExpectedAccounts.Get(AccountNo), StandardAccount.Description, 'Account ' + AccountNo + ' description is incorrect.');
+ end;
+ end;
+
+ [Test]
+ procedure TestGetStandardAccountsCSVForStandardAccountsDecember2025()
+ var
+ StandardAccount: Record "Standard Account";
+ AuditFileExportSetup: Record "Audit File Export Setup";
+ CreateStandardDataSAFTDK: Codeunit "Create Standard Data SAF-T DK";
+ Assert: Codeunit "Assert";
+ StandardAccountType: Enum "Standard Account Type";
+ ExpectedAccounts: Dictionary of [Text, Text];
+ Result: Boolean;
+ AccountNo: Text;
+ begin
+ // [FEATURE] [AI test]
+ // [FEATURE] [RegF][DK] New Standard Chart of Accounts 2025
+ // [SCENARIO] LoadStandardAccounts loads correct standard accounts for Standard Account 2025
+
+ // [GIVEN] Standard Account Type is "Standard Account 2025"
+ StandardAccountType := StandardAccountType::"Standard Account 2025";
+ StandardAccount.DeleteAll();
+ AuditFileExportSetup.DeleteAll();
+ AuditFileExportSetup.Init();
+ AuditFileExportSetup."Standard Account Type" := StandardAccountType;
+ AuditFileExportSetup.Insert();
+
+ // [GIVEN] Expected standard accounts (sample from beginning, middle, and end)
+ ExpectedAccounts.Add('1010', 'Salg af varer og ydelser');
+ ExpectedAccounts.Add('1050', 'Salg af varer udland, EU');
+ ExpectedAccounts.Add('1100', 'Salg af varer udland, ikke-EU');
+ ExpectedAccounts.Add('1210', 'Salgsrabatter');
+ ExpectedAccounts.Add('2845', 'AM Bidragspligtig A-Indkomst');
+ ExpectedAccounts.Add('3000', 'Af- og nedskrivninger af erhvervede immaterielle anlægsaktiver');
+ ExpectedAccounts.Add('5010', 'Færdiggjort udviklingsprojekter, herunder patenter og lignende rettigheder, der stammer fra udviklingsprojekter, Kostpris primo');
+ ExpectedAccounts.Add('6000', 'Andre værdipapirer og kapitalandele');
+ ExpectedAccounts.Add('7010', 'Hensættelser til udskudt skat');
+ ExpectedAccounts.Add('8040', 'Øvrig anden gæld');
+ ExpectedAccounts.Add('9999', 'PASSIVER I ALT');
+
+ // [WHEN] LoadStandardAccounts is called
+ Result := CreateStandardDataSAFTDK.LoadStandardAccounts(StandardAccountType);
+
+ // [THEN] The method returns true
+ Assert.IsTrue(Result, 'LoadStandardAccounts should return true.');
+
+ // [THEN] Standard Accounts are loaded correctly
+ StandardAccount.SetRange(Type, StandardAccountType);
+ Assert.RecordCount(StandardAccount, 604);
+ Assert.RecordIsNotEmpty(StandardAccount);
+ foreach AccountNo in ExpectedAccounts.Keys do begin
+ StandardAccount.Get(StandardAccountType, '', AccountNo);
+ Assert.AreEqual(ExpectedAccounts.Get(AccountNo), StandardAccount.Description, 'Account ' + AccountNo + ' description is incorrect.');
+ end;
+ end;
+
+ [Test]
+ procedure TestLoadStandardTaxCodesForFourDigitStandardAccount()
+ var
+ AuditFileExportSetup: Record "Audit File Export Setup";
+ VATReportingCode: Record "VAT Reporting Code";
+ CreateStandardDataSAFTDK: Codeunit "Create Standard Data SAF-T DK";
+ Assert: Codeunit Assert;
+ StandardAccountType: Enum "Standard Account Type";
+ ExpectedTaxCodes: Dictionary of [Text, Text];
+ Result: Boolean;
+ TaxCode: Text;
+ begin
+ // [FEATURE] [AI test]
+ // [FEATURE] [RegF][DK] New Standard Chart of Accounts 2025
+ // [SCENARIO] LoadStandardTaxCodes loads correct tax codes for Four Digit Standard Account
+
+ // [GIVEN] Audit File Export Setup with "Four Digit Standard Account"
+ AuditFileExportSetup.DeleteAll();
+ VATReportingCode.DeleteAll();
+ AuditFileExportSetup.Init();
+ AuditFileExportSetup."Standard Account Type" := StandardAccountType::"Four Digit Standard Account";
+ AuditFileExportSetup.Insert();
+
+ // [GIVEN] Expected tax codes and descriptions
+ ExpectedTaxCodes.Add('S1', 'Salgsmoms (udgående moms)');
+ ExpectedTaxCodes.Add('S0', 'Skal som udgangspunkt medtages i rubrik C, hvis feks. skibe i udenrigsfart, salg af aviser');
+ ExpectedTaxCodes.Add('S%', 'Skal ikke medtages i angivelsen');
+ ExpectedTaxCodes.Add('SMF', 'Skal ikke medtages i angivelsen');
+ ExpectedTaxCodes.Add('Sbrugt', 'Salgsmoms (udgående moms)');
+ ExpectedTaxCodes.Add('Smargin', 'Salgsmoms (udgående moms)');
+ ExpectedTaxCodes.Add('Smotor', 'Salgsmoms (udgående moms)');
+ ExpectedTaxCodes.Add('Sleasing', 'Salgsmoms (udgående moms)');
+ ExpectedTaxCodes.Add('Skunstnere', 'Salgsmoms (udgående moms)');
+ ExpectedTaxCodes.Add('Slokal', 'Skal ikke medtages i angivelsen');
+ ExpectedTaxCodes.Add('S2', 'Rubrik B - varer');
+ ExpectedTaxCodes.Add('S7', 'Rubrik B - oplysninger, der ikke skal indberettes til "EU-salg uden moms"');
+ ExpectedTaxCodes.Add('S3', 'Rubrik B - ydelser');
+ ExpectedTaxCodes.Add('SMFEU', 'Skal ikke medtages i angivelsen');
+ ExpectedTaxCodes.Add('S4', 'Rubrik C - eksport udenfor EU');
+ ExpectedTaxCodes.Add('S5', 'Rubrik C - eksport udenfor EU');
+ ExpectedTaxCodes.Add('S6', 'Skal ikke medtages i angivelsen');
+ ExpectedTaxCodes.Add('K1', 'Købsmoms (indgående moms)');
+ ExpectedTaxCodes.Add('K3', 'Købsmoms (indgående moms - skønsmæssig andel)');
+ ExpectedTaxCodes.Add('K0', 'Skal ikke medtages i angivelsen');
+ ExpectedTaxCodes.Add('K7', 'Købsmoms (indgående moms 66,6%)');
+ ExpectedTaxCodes.Add('K5A', 'Købsmoms (indgående moms 50%)');
+ ExpectedTaxCodes.Add('K5B', 'Købsmoms (indgående moms 50% af "pro rata")');
+ ExpectedTaxCodes.Add('KL1', 'Købsmoms (indgående moms 33,3%)');
+ ExpectedTaxCodes.Add('K25A', 'Købsmoms (indgående moms 25%)');
+ ExpectedTaxCodes.Add('K25B', 'Købsmoms (indgående moms 25% af "pro rata")');
+ ExpectedTaxCodes.Add('KL2', 'Købsmoms (indgående moms - faktura fradrag)');
+ ExpectedTaxCodes.Add('KL3', 'Købsmoms (indgående moms - faktura pro rata fradrag)');
+ ExpectedTaxCodes.Add('K2', 'Købsmoms (indgående moms - omsætningsfordeling)');
+ ExpectedTaxCodes.Add('K6', 'Købsmoms (indgående moms - omsætningsfordeling i sektoren)');
+ ExpectedTaxCodes.Add('K4', 'Købsmoms (indgående moms - forholdsmæssig andel)');
+ ExpectedTaxCodes.Add('K-brugtmoms', 'Indgår i særligt beregningsgrundlag');
+ ExpectedTaxCodes.Add('K-marginmoms', 'Indgår i særligt beregningsgrundlag');
+ ExpectedTaxCodes.Add('K-brugtbil', 'Indgår i særligt beregningsgrundlag');
+ ExpectedTaxCodes.Add('K-leasingbil', 'Indgår i særligt beregningsgrundlag');
+ ExpectedTaxCodes.Add('K-DK0-1', 'Salgsmoms (udgående) og købsmoms (indgående moms)');
+ ExpectedTaxCodes.Add('K-DKO-2', 'Salgsmoms og købsmoms ( indgående moms omsætningsfordeling)');
+ ExpectedTaxCodes.Add('K-DKO-3', 'Salgsmoms og købsmoms (indgående moms skønsmæssig andel)');
+ ExpectedTaxCodes.Add('K-DKO-0', 'Salgsmoms (udgående moms)');
+ ExpectedTaxCodes.Add('K-DKO-4', 'Salgsmoms og købsmoms ( indgående moms arealfordeling)');
+ ExpectedTaxCodes.Add('K-LokalMoms', 'Tilbagesøgning efter refusionsordningsreglerne');
+ ExpectedTaxCodes.Add('K-DKO-I', 'Refusionsordning');
+ ExpectedTaxCodes.Add('K-EU-V-1', 'Moms af varekøb i udlandet (både EU og lande uden for EU) og Købsmoms (indgående moms)');
+ ExpectedTaxCodes.Add('K-EU-V-3', 'Moms af varekøb i udlandet (både EU og lande uden for EU) og Købsmoms (indgående moms - skønsmæssig andel)');
+ ExpectedTaxCodes.Add('K-EU-V-0', 'Moms af varekøb i udlandet (både EU og lande uden for EU)');
+ ExpectedTaxCodes.Add('K-EU-V-2', 'Moms af varekøb i udlandet (både EU og lande uden for EU) og Købsmoms (indgående moms - omsætningsfordeling)');
+ ExpectedTaxCodes.Add('K-EU-V-4', 'Moms af varekøb i udlandet (både EU og lande uden for EU) samt Købsmoms (indgående moms - forholdsmæssig andel)');
+ ExpectedTaxCodes.Add('K-EU-Y-1', 'Moms af ydelseskøb i udlandet med omvendt betalingspligt og Købsmoms (indgående moms)');
+ ExpectedTaxCodes.Add('K-EU-Y-3', 'Moms af ydelseskøb i udlandet med omvendt betalingspligt og Købsmoms (indgående moms - skønsmæssig andel)');
+ ExpectedTaxCodes.Add('K-EU-Y-0', 'Moms af ydelseskøb i udlandet med omvendt betalingspligt');
+ ExpectedTaxCodes.Add('K-EU-Y-2', 'Moms af ydelseskøb i udlandet med omvendt betalingspligt og Købsmoms (indgående moms - omsætningsfordeling)');
+ ExpectedTaxCodes.Add('K-EU-Y-4', 'Moms af ydelseskøb i udlandet med omvendt betalingspligt og Købsmoms (indgående moms - forholdsmæssig andel)');
+ ExpectedTaxCodes.Add('KL-EU-2', 'Købsmoms (indgående moms - faktura fradrag)');
+ ExpectedTaxCodes.Add('KL-EU-3', 'Købsmoms (indgående moms - faktura pro rata fradrag)');
+ ExpectedTaxCodes.Add('K-EU-Y-L1', 'Moms af ydelseskøb i udlandet med omvendt betalingspligt samt Købsmoms (indgående moms 33,3%)');
+ ExpectedTaxCodes.Add('K-EU-MF', 'Skal ikke medtages i angivelsen');
+ ExpectedTaxCodes.Add('K-%EU-V-1', 'Moms af varekøb i udlandet (både EU og lande uden for EU) og Købsmoms (indgående moms)');
+ ExpectedTaxCodes.Add('K-%EU-V-3', 'Moms af varekøb i udlandet (både EU og lande uden for EU) og Købsmoms (indgående moms - skønsmæssig andel)');
+ ExpectedTaxCodes.Add('K-%EU-V-0', 'Moms af varekøb i udlandet (både EU og lande uden for EU)');
+ ExpectedTaxCodes.Add('K-%EU-V-2', 'Moms af varekøb i udlandet (både EU og lande uden for EU) og Købsmoms (indgående moms - omsætningsfordeling)');
+ ExpectedTaxCodes.Add('K-%EU-V-4', 'Moms af varekøb i udlandet (både EU og lande uden for EU) og Købsmoms (indgående moms - forholdsmæssig andel)');
+ ExpectedTaxCodes.Add('K-%EU-Y-1', 'Moms af ydelseskøb i udlandet med omvendt betalingspligt og Købsmoms (indgående moms)');
+ ExpectedTaxCodes.Add('K-%EU-Y-3', 'Moms af ydelseskøb i udlandet med omvendt betalingspligt og Købsmoms (indgående moms - skønsmæssig andel)');
+ ExpectedTaxCodes.Add('K-%EU-Y-0', 'Moms af ydelseskøb i udlandet med omvendt betalingspligt');
+ ExpectedTaxCodes.Add('K-%EU-Y-2', 'Moms af ydelseskøb i udlandet med omvendt betalingspligt og Købsmoms (indgående moms - omsætningsfordeling)');
+ ExpectedTaxCodes.Add('K-%EU-Y-4', 'Moms af ydelseskøb i udlandet med omvendt betalingspligt og Købsmoms (indgående moms - forholdsmæssig andel)');
+
+ // [WHEN] LoadStandardTaxCodes is called
+ Result := CreateStandardDataSAFTDK.LoadStandardTaxCodes();
+
+ // [THEN] The method returns true
+ Assert.IsTrue(Result, 'LoadStandardTaxCodes should return true.');
+
+ // [THEN] VAT Reporting Codes are loaded correctly
+ foreach TaxCode in ExpectedTaxCodes.Keys do begin
+ VATReportingCode.Get(TaxCode);
+ Assert.AreEqual(ExpectedTaxCodes.Get(TaxCode), VATReportingCode.Description, 'Tax code ' + TaxCode + ' description is incorrect.');
+ end;
+ end;
+
+ [Test]
+ procedure TestLoadStandardTaxCodesForStandardAccount2025()
+ var
+ AuditFileExportSetup: Record "Audit File Export Setup";
+ VATReportingCode: Record "VAT Reporting Code";
+ CreateStandardDataSAFTDK: Codeunit "Create Standard Data SAF-T DK";
+ Assert: Codeunit Assert;
+ StandardAccountType: Enum "Standard Account Type";
+ ExpectedTaxCodes: Dictionary of [Text, Text];
+ Result: Boolean;
+ TaxCode: Text;
+ begin
+ // [FEATURE] [AI test]
+ // [FEATURE] [RegF][DK] New Standard Chart of Accounts 2025
+ // [SCENARIO] LoadStandardTaxCodes loads correct tax codes for Standard Account 2025
+
+ // [GIVEN] Audit File Export Setup with "Standard Account 2025"
+ AuditFileExportSetup.DeleteAll();
+ VATReportingCode.DeleteAll();
+ AuditFileExportSetup.Init();
+ AuditFileExportSetup."Standard Account Type" := StandardAccountType::"Standard Account 2025";
+ AuditFileExportSetup.Insert();
+
+ // [GIVEN] Expected tax codes and descriptions for 2025
+ ExpectedTaxCodes.Add('S01', 'Salgsmoms (udgående moms)');
+ ExpectedTaxCodes.Add('S02', 'Skal som udgangspunkt medtages i rubrik C, hvis feks. skibe i udenrigsfart, salg af aviser');
+ ExpectedTaxCodes.Add('S81', 'Skal ikke medtages i angivelsen');
+ ExpectedTaxCodes.Add('S82', 'Skal ikke medtages i angivelsen');
+ ExpectedTaxCodes.Add('S83', 'Salgsmoms (udgående moms)');
+ ExpectedTaxCodes.Add('S84', 'Salgsmoms (udgående moms)');
+ ExpectedTaxCodes.Add('S85', 'Salgsmoms (udgående moms)');
+ ExpectedTaxCodes.Add('S86', 'Salgsmoms (udgående moms)');
+ ExpectedTaxCodes.Add('S87', 'Salgsmoms (udgående moms)');
+ ExpectedTaxCodes.Add('S88', 'Skal ikke medtages i angivelsen');
+ ExpectedTaxCodes.Add('S21', 'Rubrik B - varer');
+ ExpectedTaxCodes.Add('S22', 'Rubrik B - oplysninger, der ikke skal indberettes til "EU-salg uden moms"');
+ ExpectedTaxCodes.Add('S23', 'Rubrik B - ydelser');
+ ExpectedTaxCodes.Add('S24', 'Skal ikke medtages i angivelsen');
+ ExpectedTaxCodes.Add('S25', 'Skal ikke medtages på momsangivelsen, men som trekantshandel på EU-salgsangivelsen');
+ ExpectedTaxCodes.Add('S41', 'Rubrik C - eksport udenfor EU.');
+ ExpectedTaxCodes.Add('S42', 'Rubrik C - eksport udenfor EU.');
+ ExpectedTaxCodes.Add('S43', 'Skal ikke medtages i angivelsen');
+ ExpectedTaxCodes.Add('S61', 'OSS angivelsen + momsangivelsens rubrik C');
+ ExpectedTaxCodes.Add('S62', 'OSS angivelsen + Rubrik B - oplysninger der ikke skal indberettes til "EU-salg uden moms"');
+ ExpectedTaxCodes.Add('S63', 'OSS angivelsen + Rubrik C');
+ ExpectedTaxCodes.Add('S64', 'OSS angivelsen (skal ikke angives på momsangivelsen)');
+ ExpectedTaxCodes.Add('S65', 'OSS angivelsen + rubrik A - varer');
+ ExpectedTaxCodes.Add('K010', 'Købsmoms (indgående moms)');
+ ExpectedTaxCodes.Add('K020', 'Købsmoms (indgående moms - skønsmæssig andel)');
+ ExpectedTaxCodes.Add('K030', 'Skal ikke medtages i angivelsen');
+ ExpectedTaxCodes.Add('K610', 'Købsmoms (indgående moms 66,6%)');
+ ExpectedTaxCodes.Add('K040', 'Købsmoms (indgående moms 50%)');
+ ExpectedTaxCodes.Add('K050', 'Købsmoms (indgående moms 50% af "pro rata")');
+ ExpectedTaxCodes.Add('K060', 'Købsmoms (indgående moms 33,3%)');
+ ExpectedTaxCodes.Add('K070', 'Købsmoms (indgående moms 25%)');
+ ExpectedTaxCodes.Add('K080', 'Købsmoms (indgående moms 25% af "pro rata")');
+ ExpectedTaxCodes.Add('K090', 'Købsmoms (indgående moms - faktura fradrag)');
+ ExpectedTaxCodes.Add('K100', 'Købsmoms (indgående moms - faktura pro rata fradrag)');
+ ExpectedTaxCodes.Add('K110', 'Købsmoms (indgående moms - omsætningsfordeling)');
+ ExpectedTaxCodes.Add('K120', 'Købsmoms (indgående moms - omsætningsfordeling i sektoren)');
+ ExpectedTaxCodes.Add('K130', 'Købsmoms (indgående moms - forholdsmæssig andel)');
+ ExpectedTaxCodes.Add('K620', 'Indgår i særligt beregningsgrundlag');
+ ExpectedTaxCodes.Add('K630', 'Indgår i særligt beregningsgrundlag');
+ ExpectedTaxCodes.Add('K640', 'Indgår i særligt beregningsgrundlag');
+ ExpectedTaxCodes.Add('K650', 'Indgår i særligt beregningsgrundlag');
+ ExpectedTaxCodes.Add('K660', 'Salgsmoms (udgående) og købsmoms (indgående moms)');
+ ExpectedTaxCodes.Add('K670', 'Salgsmoms og købsmoms ( indgående moms omsætningsfordeling)');
+ ExpectedTaxCodes.Add('K680', 'Salgsmoms og købsmoms (indgående moms skønsmæssig andel)');
+ ExpectedTaxCodes.Add('K690', 'Salgsmoms (udgående moms)');
+ ExpectedTaxCodes.Add('K700', 'Salgsmoms og købsmoms ( indgående moms arealfordeling)');
+ ExpectedTaxCodes.Add('K710', 'Tilbagesøgning efter refusionsordningsreglerne');
+ ExpectedTaxCodes.Add('K720', 'Angives ikke på momsangivelsen - indgår i opgørelsen ved refusionsordning');
+ ExpectedTaxCodes.Add('K210', 'Varer + Moms af varekøb i udlandet (både EU og lande uden for EU) og Købsmoms (indgående moms)');
+ ExpectedTaxCodes.Add('K220', 'Varer + Moms af varekøb i udlandet (både EU og lande uden for EU) og Købsmoms (indgående moms)');
+ ExpectedTaxCodes.Add('K230', 'Varer + Moms af varekøb i udlandet (både EU og lande uden for EU)');
+ ExpectedTaxCodes.Add('K240', 'Varer + Moms af varekøb i udlandet (både EU og lande uden for EU) og Købsmoms (indgående moms)');
+ ExpectedTaxCodes.Add('K250', 'Varer + Moms af varekøb i udlandet (både EU og lande uden for EU) samt Købsmoms (indgående moms)');
+ ExpectedTaxCodes.Add('K260', 'Ydelser + Moms af ydelseskøb i udlandet med omvendt betalingspligt og Købsmoms (indgående moms)');
+ ExpectedTaxCodes.Add('K270', 'Ydelser + Moms af ydelseskøb i udlandet med omvendt betalingspligt og Købsmoms (indgående moms)');
+ ExpectedTaxCodes.Add('K280', 'Ydelser + Moms af ydelseskøb i udlandet med omvendt betalingspligt');
+ ExpectedTaxCodes.Add('K290', 'Ydelser + Moms af ydelseskøb i udlandet med omvendt betalingspligt og Købsmoms (indgående moms - omsætningsfordeling)');
+ ExpectedTaxCodes.Add('K300', 'Ydelser + Moms af ydelseskøb i udlandet med omvendt betalingspligt og Købsmoms (indgående moms - forholdsmæssig andel)');
+ ExpectedTaxCodes.Add('K310', 'Ydelser + Moms af ydelseskøb i udlandet med omvendt betalingspligt og Købsmoms (indgående moms)');
+ ExpectedTaxCodes.Add('K320', 'Ydelser + Moms af ydelseskøb i udlandet med omvendt betalingspligt og Købsmoms (indgående moms)');
+ ExpectedTaxCodes.Add('K330', 'Ydelser + Moms af ydelseskøb i udlandet med omvendt betalingspligt samt Købsmoms (indgående moms 33,3%)');
+ ExpectedTaxCodes.Add('K340', 'Skal ikke medtages i angivelsen');
+ ExpectedTaxCodes.Add('K410', 'Moms af varekøb i udlandet (både EU og lande uden for EU) og Købsmoms (indgående moms)');
+ ExpectedTaxCodes.Add('K420', 'Moms af varekøb i udlandet (både EU og lande uden for EU) og Købsmoms (indgående moms - skønsmæssig andel)');
+ ExpectedTaxCodes.Add('K430', 'Moms af varekøb i udlandet (både EU og lande uden for EU)');
+ ExpectedTaxCodes.Add('K440', 'Moms af varekøb i udlandet (både EU og lande uden for EU) og Købsmoms (indgående moms - omsætningsfordeling)');
+ ExpectedTaxCodes.Add('K450', 'Moms af varekøb i udlandet (både EU og lande uden for EU) og Købsmoms (indgående moms - forholdsmæssig andel)');
+ ExpectedTaxCodes.Add('K460', 'Moms af ydelseskøb i udlandet med omvendt betalingspligt og Købsmoms (indgående moms)');
+ ExpectedTaxCodes.Add('K470', 'Moms af ydelseskøb i udlandet med omvendt betalingspligt og Købsmoms (indgående moms - skønsmæssig andel)');
+ ExpectedTaxCodes.Add('K480', 'Moms af ydelseskøb i udlandet med omvendt betalingspligt');
+ ExpectedTaxCodes.Add('K490', 'Moms af ydelseskøb i udlandet med omvendt betalingspligt og Købsmoms (indgående moms - omsætningsfordeling)');
+ ExpectedTaxCodes.Add('K500', 'Moms af ydelseskøb i udlandet med omvendt betalingspligt og Købsmoms (indgående moms - forholdsmæssig andel)');
+
+ // [WHEN] LoadStandardTaxCodes is called
+ Result := CreateStandardDataSAFTDK.LoadStandardTaxCodes();
+
+ // [THEN] The method returns true
+ Assert.IsTrue(Result, 'LoadStandardTaxCodes should return true.');
+
+ // [THEN] VAT Reporting Codes are loaded correctly
+ foreach TaxCode in ExpectedTaxCodes.Keys do begin
+ VATReportingCode.Get(TaxCode);
+ Assert.AreEqual(ExpectedTaxCodes.Get(TaxCode), VATReportingCode.Description, 'Tax code ' + TaxCode + ' description is incorrect.');
+ end;
+ end;
+
+ [Test]
+ [HandlerFunctions('SendNotificationHandler')]
+ procedure NotificationShownForFourDigitStandardAccount()
+ var
+ AuditFileExportSetup: Record "Audit File Export Setup";
+ MyNotifications: Record "My Notifications";
+ AuditFileExportDocuments: TestPage "Audit File Export Documents";
+ begin
+ // [FEATURE] [AI test]
+ // [FEATURE] [RegF][DK] New Standard Chart of Accounts 2025
+ // [SCENARIO] Notification is shown when Audit File Export Setup has "Four Digit Standard Account"
+
+ // [GIVEN] Audit File Export Setup with Standard Account Type "Four Digit Standard Account", notification not disabled
+ AuditFileExportSetup.DeleteAll();
+ AuditFileExportSetup.Init();
+ AuditFileExportSetup."Standard Account Type" := AuditFileExportSetup."Standard Account Type"::"Four Digit Standard Account";
+ AuditFileExportSetup.Insert();
+
+ MyNotifications.SetRange("Notification Id", GetStandardAccount2025NotificationId());
+ MyNotifications.DeleteAll();
+
+ LibraryVariableStorage.Clear();
+ LibraryVariableStorage.Enqueue(StandardAccount2025AvailableMsg);
+
+ // [WHEN] User opens "Audit File Export Documents" page
+ AuditFileExportDocuments.OpenView();
+
+ // [THEN] Notification with message 'New standard account type is available for year 2025.' is sent
+ // Verified in SendNotificationHandler
+ AuditFileExportDocuments.Close();
+ LibraryVariableStorage.AssertEmpty();
+ end;
+
+ [Test]
+ procedure NotificationNotShownWhenSetupNotExists()
+ var
+ AuditFileExportSetup: Record "Audit File Export Setup";
+ AuditFileExportDocuments: TestPage "Audit File Export Documents";
+ begin
+ // [FEATURE] [AI test]
+ // [FEATURE] [RegF][DK] New Standard Chart of Accounts 2025
+ // [SCENARIO] Notification is not shown when Audit File Export Setup does not exist
+
+ // [GIVEN] No Audit File Export Setup record exists
+ AuditFileExportSetup.DeleteAll();
+
+ // [WHEN] User opens "Audit File Export Documents" page
+ AuditFileExportDocuments.OpenView();
+
+ // [THEN] No notification is sent (page opens without error)
+ AuditFileExportDocuments.Close();
+ end;
+
+ [Test]
+ procedure NotificationNotShownWhenStandardAccount2025Configured()
+ var
+ AuditFileExportSetup: Record "Audit File Export Setup";
+ AuditFileExportDocuments: TestPage "Audit File Export Documents";
+ begin
+ // [FEATURE] [AI test]
+ // [FEATURE] [RegF][DK] New Standard Chart of Accounts 2025
+ // [SCENARIO] Notification is not shown when Audit File Export Setup already has "Standard Account 2025"
+
+ // [GIVEN] Audit File Export Setup with Standard Account Type "Standard Account 2025"
+ AuditFileExportSetup.DeleteAll();
+ AuditFileExportSetup.Init();
+ AuditFileExportSetup."Standard Account Type" := AuditFileExportSetup."Standard Account Type"::"Standard Account 2025";
+ AuditFileExportSetup.Insert();
+
+ // [WHEN] User opens "Audit File Export Documents" page
+ AuditFileExportDocuments.OpenView();
+
+ // [THEN] No notification is sent
+ AuditFileExportDocuments.Close();
+ end;
+
+ [Test]
+ procedure NotificationNotShownWhenUserDisabledNotification()
+ var
+ AuditFileExportSetup: Record "Audit File Export Setup";
+ MyNotifications: Record "My Notifications";
+ AuditFileExportDocuments: TestPage "Audit File Export Documents";
+ begin
+ // [FEATURE] [AI test]
+ // [FEATURE] [RegF][DK] New Standard Chart of Accounts 2025
+ // [SCENARIO] Notification is not shown when user has disabled the notification
+
+ // [GIVEN] Audit File Export Setup with Standard Account Type "Four Digit Standard Account"
+ AuditFileExportSetup.DeleteAll();
+ AuditFileExportSetup.Init();
+ AuditFileExportSetup."Standard Account Type" := AuditFileExportSetup."Standard Account Type"::"Four Digit Standard Account";
+ AuditFileExportSetup.Insert();
+
+ // [GIVEN] My Notifications record for current user with notification ID disabled
+ MyNotifications.SetRange("Notification Id", GetStandardAccount2025NotificationId());
+ MyNotifications.DeleteAll();
+ MyNotifications.Init();
+ MyNotifications."User Id" := CopyStr(UserId(), 1, MaxStrLen(MyNotifications."User Id"));
+ MyNotifications."Notification Id" := GetStandardAccount2025NotificationId();
+ MyNotifications.Enabled := false;
+ MyNotifications.Insert();
+
+ // [WHEN] User opens "Audit File Export Documents" page
+ AuditFileExportDocuments.OpenView();
+
+ // [THEN] No notification is sent
+ AuditFileExportDocuments.Close();
+ end;
+
+ [SendNotificationHandler]
+ procedure SendNotificationHandler(var Notification: Notification): Boolean
+ var
+ Assert: Codeunit Assert;
+ ExpectedMessage: Text;
+ begin
+ ExpectedMessage := LibraryVariableStorage.DequeueText();
+ Assert.AreEqual(ExpectedMessage, Notification.Message(), 'Notification message is incorrect.');
+ exit(true);
+ end;
+
+ local procedure GetStandardAccount2025NotificationId(): Guid
+ begin
+ exit('a1b0c3e4-d5f6-4a7b-8c9d-0e1f2a3b4c5d');
+ end;
+
+ var
+ LibraryVariableStorage: Codeunit "Library - Variable Storage";
+ StandardAccount2025AvailableMsg: Label 'New standard account type is available for year 2025.';
}
\ No newline at end of file
diff --git a/Apps/GB/ReportsGB/app/src/Codeunits/FormatReportGB.Codeunit.al b/Apps/GB/ReportsGB/app/src/Codeunits/FormatReportGB.Codeunit.al
new file mode 100644
index 0000000000..fce0b76824
--- /dev/null
+++ b/Apps/GB/ReportsGB/app/src/Codeunits/FormatReportGB.Codeunit.al
@@ -0,0 +1,62 @@
+#if CLEAN28
+// ------------------------------------------------------------------------------------------------
+// Copyright (c) Microsoft Corporation. All rights reserved.
+// Licensed under the MIT License. See License.txt in the project root for license information.
+// ------------------------------------------------------------------------------------------------
+namespace Microsoft.Utilities;
+
+using Microsoft.Sales.Document;
+using Microsoft.Sales.History;
+using Microsoft.Finance.VAT.Setup;
+
+codeunit 10591 "Format Report GB"
+{
+
+ trigger OnRun()
+ begin
+ end;
+
+ [EventSubscriber(ObjectType::Report, Report::"Standard Sales - Draft Invoice", 'OnBeforeFormatLineValues', '', false, false)]
+ local procedure OnBeforeFormatLineValuesInStandardSalesDraftInvoiceReport(SalesLine: Record "Sales Line"; var FormattedQuantity: Text; var FormattedUnitPrice: Text; var FormattedVATPercentage: Text; var FormattedLineAmount: Text; var IsHandled: Boolean)
+ var
+ VATPostingSetup: Record "VAT Posting Setup";
+ FormatDocument: Codeunit "Format Document";
+ begin
+ if VATPostingSetup.Get(SalesLine."VAT Bus. Posting Group", SalesLine."VAT Prod. Posting Group") then
+ if VATPostingSetup."VAT Calculation Type" = VATPostingSetup."VAT Calculation Type"::"Reverse Charge VAT" then
+ SalesLine."VAT %" := VATPostingSetup."VAT %";
+ FormatDocument.SetSalesLine(
+ SalesLine, FormattedQuantity, FormattedUnitPrice, FormattedVATPercentage, FormattedLineAmount);
+ IsHandled := true;
+ end;
+
+ [EventSubscriber(ObjectType::Report, Report::"Standard Sales - Invoice", 'OnBeforeFormatLineValues', '', false, false)]
+ local procedure OnBeforeFormatLineValuesInStandardSalesInvoiceReport(SalesInvoiceLine: Record "Sales Invoice Line"; var FormattedQuantity: Text; var FormattedUnitPrice: Text; var FormattedVATPercentage: Text; var FormattedLineAmount: Text; var IsHandled: Boolean)
+ var
+ VATPostingSetup: Record "VAT Posting Setup";
+ FormatDocument: Codeunit "Format Document";
+ begin
+ if VATPostingSetup.Get(SalesInvoiceLine."VAT Bus. Posting Group", SalesInvoiceLine."VAT Prod. Posting Group") then
+ if VATPostingSetup."VAT Calculation Type" = VATPostingSetup."VAT Calculation Type"::"Reverse Charge VAT" then
+ SalesInvoiceLine."VAT %" := VATPostingSetup."VAT %";
+ FormatDocument.SetSalesInvoiceLine(
+ SalesInvoiceLine, FormattedQuantity, FormattedUnitPrice, FormattedVATPercentage, FormattedLineAmount);
+ IsHandled := true;
+ end;
+
+ [EventSubscriber(ObjectType::Report, Report::"Standard Sales - Credit Memo", 'OnBeforeFormatLineValues', '', false, false)]
+ local procedure OnBeforeFormatLineValuesInStandardSalesCrMemoReport(SalesCrMemoLine: Record "Sales Cr.Memo Line"; var FormattedQuantity: Text; var FormattedUnitPrice: Text; var FormattedVATPercentage: Text; var FormattedLineAmount: Text; var IsHandled: Boolean)
+ var
+ VATPostingSetup: Record "VAT Posting Setup";
+ FormatDocument: Codeunit "Format Document";
+ begin
+ if VATPostingSetup.Get(SalesCrMemoLine."VAT Bus. Posting Group", SalesCrMemoLine."VAT Prod. Posting Group") then
+ if VATPostingSetup."VAT Calculation Type" = VATPostingSetup."VAT Calculation Type"::"Reverse Charge VAT" then
+ SalesCrMemoLine."VAT %" := VATPostingSetup."VAT %";
+ FormatDocument.SetSalesCrMemoLine(
+ SalesCrMemoLine, FormattedQuantity, FormattedUnitPrice, FormattedVATPercentage, FormattedLineAmount);
+ IsHandled := true;
+ end;
+}
+#endif
+
diff --git a/Apps/GB/ReverseChargeVAT/app/src/Codeunits/ReverseChargeVATSubscribers.Codeunit.al b/Apps/GB/ReverseChargeVAT/app/src/Codeunits/ReverseChargeVATSubscribers.Codeunit.al
index b9346d6097..3f25f6151d 100644
--- a/Apps/GB/ReverseChargeVAT/app/src/Codeunits/ReverseChargeVATSubscribers.Codeunit.al
+++ b/Apps/GB/ReverseChargeVAT/app/src/Codeunits/ReverseChargeVATSubscribers.Codeunit.al
@@ -24,6 +24,9 @@ codeunit 10552 "Reverse Charge VAT Subscribers"
Access = Internal;
var
+#if not CLEAN28
+ VATReverseCharge: Codeunit "Reverse Charge VAT GB";
+#endif
FeatureTelemetry: Codeunit "Feature Telemetry";
Text1041000Msg: Label 'Warning: You have selected an item that is subject to Reverse Charge VAT. Please check that the VAT Code %1 in the %2 field is correct. If necessary, update this field before posting. ', Comment = '%1 = field value; %2 = field caption';
Text1041001Msg: Label 'cannot be %1. %2 %3 is not subjected to Reverse Charge', Comment = '%1, %2, %3 = field values';
@@ -35,6 +38,11 @@ codeunit 10552 "Reverse Charge VAT Subscribers"
[EventSubscriber(ObjectType::Table, Database::"Purchase Line", OnAfterAssignHeaderValues, '', false, false)]
local procedure OnAfterAssignHeaderValues(var PurchLine: Record "Purchase Line"; PurchHeader: Record "Purchase Header")
begin
+#if not CLEAN28
+ if not VATReverseCharge.IsEnabled() then
+ exit;
+#endif
+
PurchLine."Reverse Charge Item GB" := false;
end;
@@ -44,6 +52,11 @@ codeunit 10552 "Reverse Charge VAT Subscribers"
PurchSetup: Record "Purchases & Payables Setup";
PurchHeader: Record "Purchase Header";
begin
+#if not CLEAN28
+ if not VATReverseCharge.IsEnabled() then
+ exit;
+#endif
+
PurchSetup.Get();
if PurchHeader.Get(PurchaseLine."Document Type", PurchaseLine."Document No.") then;
@@ -61,18 +74,33 @@ codeunit 10552 "Reverse Charge VAT Subscribers"
[EventSubscriber(ObjectType::Table, Database::"Purchase Line", OnInsertOnAfterLockTable, '', false, false)]
local procedure OnInsertOnAfterLockTable(var PurchaseLine: Record "Purchase Line"; CurrFieldNo: Integer)
begin
+#if not CLEAN28
+ if not VATReverseCharge.IsEnabled() then
+ exit;
+#endif
+
DomesticVendorWarning(PurchaseLine, CurrFieldNo);
end;
[EventSubscriber(ObjectType::Table, Database::"Purchase Line", OnAfterModifyOnAfterVerifyChange, '', false, false)]
local procedure OnAfterModifyOnAfterVerifyChange(var PurchaseLine: Record "Purchase Line"; CurrFieldNo: Integer)
begin
+#if not CLEAN28
+ if not VATReverseCharge.IsEnabled() then
+ exit;
+#endif
+
DomesticVendorWarning(PurchaseLine, CurrFieldNo);
end;
[EventSubscriber(ObjectType::Table, Database::"Purchase Line", OnCopyFromItemOnAfterCheck, '', false, false)]
local procedure OnCopyFromItemOnAfterCheck(var PurchaseLine: Record "Purchase Line"; Item: Record Item; CallingFieldNo: Integer)
begin
+#if not CLEAN28
+ if not VATReverseCharge.IsEnabled() then
+ exit;
+#endif
+
PurchaseLine."Reverse Charge Item GB" := Item."Reverse Charge Applies GB";
end;
@@ -98,6 +126,11 @@ codeunit 10552 "Reverse Charge VAT Subscribers"
[EventSubscriber(ObjectType::Table, Database::"Sales Line", OnAfterAssignHeaderValues, '', false, false)]
local procedure OnAfterAssignHeaderValues2(var SalesLine: Record "Sales Line"; SalesHeader: Record "Sales Header")
begin
+#if not CLEAN28
+ if not VATReverseCharge.IsEnabled() then
+ exit;
+#endif
+
SalesLine."Reverse Charge Item GB" := false;
end;
@@ -106,6 +139,11 @@ codeunit 10552 "Reverse Charge VAT Subscribers"
var
SalesSetup: Record "Sales & Receivables Setup";
begin
+#if not CLEAN28
+ if not VATReverseCharge.IsEnabled() then
+ exit;
+#endif
+
SalesSetup.Get();
if (SalesLine."VAT Bus. Posting Group" = SalesSetup."Reverse Charge VAT Post. Gr.") and not SalesLine."Reverse Charge Item GB" then
SalesLine.FieldError("VAT Bus. Posting Group", StrSubstNo(Text1041001Msg, SalesLine."VAT Bus. Posting Group", SalesLine.Type, SalesLine."No."));
@@ -124,18 +162,33 @@ codeunit 10552 "Reverse Charge VAT Subscribers"
[EventSubscriber(ObjectType::Table, Database::"Sales Line", OnAfterInsertOnAfterUpdateDeferralAmounts, '', false, false)]
local procedure OnAfterInsertOnAfterUpdateDeferralAmounts(var SalesLine: Record "Sales Line"; CurrFieldNo: Integer)
begin
+#if not CLEAN28
+ if not VATReverseCharge.IsEnabled() then
+ exit;
+#endif
+
DomesticCustomerWarning(SalesLine, CurrFieldNo);
end;
[EventSubscriber(ObjectType::Table, Database::"Sales Line", OnAfterModifyOnAfterVerifyChangeForSalesLineReserve, '', false, false)]
local procedure OnAfterModifyOnAfterVerifyChangeForSalesLineReserve(var SalesLine: Record "Sales Line"; CurrFieldNo: Integer)
begin
+#if not CLEAN28
+ if not VATReverseCharge.IsEnabled() then
+ exit;
+#endif
+
DomesticCustomerWarning(SalesLine, CurrFieldNo);
end;
[EventSubscriber(ObjectType::Table, Database::"Sales Line", OnCopyFromItemOnAfterCheck, '', false, false)]
local procedure OnCopyFromItemOnAfterCheck2(var SalesLine: Record "Sales Line"; Item: Record Item)
begin
+#if not CLEAN28
+ if not VATReverseCharge.IsEnabled() then
+ exit;
+#endif
+
SalesLine."Reverse Charge Item GB" := Item."Reverse Charge Applies GB";
end;
@@ -144,6 +197,11 @@ codeunit 10552 "Reverse Charge VAT Subscribers"
var
SalesSetup: Record "Sales & Receivables Setup";
begin
+#if not CLEAN28
+ if not VATReverseCharge.IsEnabled() then
+ exit;
+#endif
+
if SalesLine.GetReverseChargeApplies() and SalesLine."Reverse Charge Item GB" then begin
SalesLine."Reverse Charge GB" := SalesLine."Amount Including VAT" - SalesLine.Amount;
SalesLine.SuspendStatusCheck(true);
@@ -157,6 +215,11 @@ codeunit 10552 "Reverse Charge VAT Subscribers"
var
SalesSetup: Record "Sales & Receivables Setup";
begin
+#if not CLEAN28
+ if not VATReverseCharge.IsEnabled() then
+ exit;
+#endif
+
if SalesLine.GetReverseChargeApplies() and SalesLine."Reverse Charge Item GB" then begin
SalesLine."Reverse Charge GB" := SalesLine."Amount Including VAT" - SalesLine.Amount;
SalesLine.SuspendStatusCheck(true);
@@ -168,6 +231,11 @@ codeunit 10552 "Reverse Charge VAT Subscribers"
[EventSubscriber(ObjectType::Table, Database::"Sales Line", OnInsertVATAmountOnBeforeInsert, '', false, false)]
local procedure OnInsertVATAmountOnBeforeInsert(var SalesLine: Record "Sales Line"; var VATAmountLine: Record "VAT Amount Line")
begin
+#if not CLEAN28
+ if not VATReverseCharge.IsEnabled() then
+ exit;
+#endif
+
VATAmountLine."Reverse Charge GB" := SalesLine."Reverse Charge GB";
end;
@@ -195,6 +263,11 @@ codeunit 10552 "Reverse Charge VAT Subscribers"
PurchHeader: Record "Purchase Header";
Currency: Record Currency;
begin
+#if not CLEAN28
+ if not VATReverseCharge.IsEnabled() then
+ exit;
+#endif
+
if not PurchaseLine."Reverse Charge Item GB" then
exit;
PurchSetup.Get();
@@ -219,6 +292,11 @@ codeunit 10552 "Reverse Charge VAT Subscribers"
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Sales-Post", OnRunOnBeforeCalcVATAmountLines, '', false, false)]
local procedure OnRunOnBeforeCalcVATAmountLines(var TempSalesLineGlobal: Record "Sales Line" temporary; var SalesHeader: Record "Sales Header"; var TempVATAmountLine: Record "VAT Amount Line" temporary; var IsHandled: Boolean)
begin
+#if not CLEAN28
+ if not VATReverseCharge.IsEnabled() then
+ exit;
+#endif
+
if SalesHeader.GetReverseChargeApplies() then
TempSalesLineGlobal.SetReverseChargeAppliesGB();
end;
@@ -229,6 +307,11 @@ codeunit 10552 "Reverse Charge VAT Subscribers"
SalesSetup: Record "Sales & Receivables Setup";
Currency: Record Currency;
begin
+#if not CLEAN28
+ if not VATReverseCharge.IsEnabled() then
+ exit;
+#endif
+
if not (SalesLine.Quantity = 0) then
exit;
@@ -249,6 +332,11 @@ codeunit 10552 "Reverse Charge VAT Subscribers"
var
ReverseChargeVATProcedures: Codeunit "Reverse Charge VAT Procedures";
begin
+#if not CLEAN28
+ if not VATReverseCharge.IsEnabled() then
+ exit;
+#endif
+
if ShouldInsertInvoiceHeader then
SalesHeader.SetReverseChargeApplies(ReverseChargeVATProcedures.CheckIfReverseChargeApplies(SalesHeader));
end;
diff --git a/Apps/GB/UKPostcodeGetAddressIO/app/src/PostcodeConfigurationPageGB.Page.al b/Apps/GB/UKPostcodeGetAddressIO/app/src/PostcodeConfigurationPageGB.Page.al
index 4c8c3840f3..7b22dbd769 100644
--- a/Apps/GB/UKPostcodeGetAddressIO/app/src/PostcodeConfigurationPageGB.Page.al
+++ b/Apps/GB/UKPostcodeGetAddressIO/app/src/PostcodeConfigurationPageGB.Page.al
@@ -36,7 +36,7 @@ page 10503 "Postcode Configuration Page GB"
var
TempNameValueBuffer: Record "Name/Value Buffer" temporary;
begin
- if PAGE.RunModal(PAGE::"Postcode Service Lookup GB", TempNameValueBuffer) = ACTION::LookupOK then
+ if PAGE.RunModal(PAGE::"Postcode Service Lookup W1", TempNameValueBuffer) = ACTION::LookupOK then
ServiceKeyText := TempNameValueBuffer.Name;
end;
@@ -44,7 +44,7 @@ page 10503 "Postcode Configuration Page GB"
var
TempNameValueBuffer: Record "Name/Value Buffer" temporary;
begin
- if PAGE.RunModal(PAGE::"Postcode Service Lookup GB", TempNameValueBuffer) = ACTION::LookupOK then
+ if PAGE.RunModal(PAGE::"Postcode Service Lookup W1", TempNameValueBuffer) = ACTION::LookupOK then
ServiceKeyText := TempNameValueBuffer.Name;
end;
diff --git a/Apps/GB/UKPostcodeGetAddressIO/app/src/PostcodeServiceLookupGB.Page.al b/Apps/GB/UKPostcodeGetAddressIO/app/src/PostcodeServiceLookupGB.Page.al
index dcec910cac..a3bec6153f 100644
--- a/Apps/GB/UKPostcodeGetAddressIO/app/src/PostcodeServiceLookupGB.Page.al
+++ b/Apps/GB/UKPostcodeGetAddressIO/app/src/PostcodeServiceLookupGB.Page.al
@@ -1,3 +1,4 @@
+#if not CLEAN28
// ------------------------------------------------------------------------------------------------
// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License. See License.txt in the project root for license information.
@@ -17,6 +18,10 @@ page 10506 "Postcode Service Lookup GB"
ShowFilter = false;
SourceTable = "Name/Value Buffer";
SourceTableTemporary = true;
+ UsageCategory = None;
+ ObsoleteReason = 'Page has been moved to W1 BaseApp.';
+ ObsoleteState = Pending;
+ ObsoleteTag = '28.0';
layout
{
@@ -70,3 +75,4 @@ page 10506 "Postcode Service Lookup GB"
PostcodeServiceManager: Codeunit "Postcode Service Manager";
DisabledLbl: Label 'Disabled';
}
+#endif
\ No newline at end of file
diff --git a/Apps/GB/UKPostcodeGetAddressIO/test/src/TestUKPostcodeConfig.Codeunit.al b/Apps/GB/UKPostcodeGetAddressIO/test/src/TestUKPostcodeConfig.Codeunit.al
index d4328f4d03..85ba29bc12 100644
--- a/Apps/GB/UKPostcodeGetAddressIO/test/src/TestUKPostcodeConfig.Codeunit.al
+++ b/Apps/GB/UKPostcodeGetAddressIO/test/src/TestUKPostcodeConfig.Codeunit.al
@@ -137,7 +137,7 @@ codeunit 148000 "Test UK Postcode Config"
[ModalPageHandler]
[Scope('OnPrem')]
- procedure ServiceLookupHandler(var PostcodeServiceLookup: TestPage "Postcode Service Lookup GB")
+ procedure ServiceLookupHandler(var PostcodeServiceLookup: TestPage "Postcode Service Lookup W1")
var
"Action": Text;
begin
diff --git a/Apps/IN/INGST/app/GSTDistribution/src/Codeunit/GSTDistribution.Codeunit.al b/Apps/IN/INGST/app/GSTDistribution/src/Codeunit/GSTDistribution.Codeunit.al
index 98325e9272..f63f154870 100644
--- a/Apps/IN/INGST/app/GSTDistribution/src/Codeunit/GSTDistribution.Codeunit.al
+++ b/Apps/IN/INGST/app/GSTDistribution/src/Codeunit/GSTDistribution.Codeunit.al
@@ -3,15 +3,14 @@
// Licensed under the MIT License. See License.txt in the project root for license information.
// ------------------------------------------------------------------------------------------------
namespace Microsoft.Finance.GST.Distribution;
-
using Microsoft.Finance.GeneralLedger.Journal;
using Microsoft.Finance.GeneralLedger.Posting;
-using Microsoft.Inventory.Item;
using Microsoft.Finance.GeneralLedger.Setup;
using Microsoft.Finance.GST.Base;
using Microsoft.Finance.TaxEngine.TaxTypeHandler;
using Microsoft.Foundation.AuditCodes;
using Microsoft.Foundation.NoSeries;
+using Microsoft.Inventory.Item;
using Microsoft.Inventory.Location;
using Microsoft.Purchases.History;
using Microsoft.Purchases.Payables;
@@ -29,6 +28,7 @@ codeunit 18200 "GST Distribution"
DistributeErr: Label 'Sum of %1 must be 100 for Distribution Lines.', Comment = '%1 = Distribution %';
RcptCreditTypeErr: Label '%1 must be Non-Availment as %2 is blank in Line No: %3.', Comment = '%1 = Rcpt. Credit Type , %2 = To GSTIN No. , %3 = Line No.';
SameToLocationErr: Label 'You cannot have same To Location Code: %1 and Rcpt. Credit Type: %2 combination in multiple lines.', Comment = '%1 = To Location Code, %2 =Rcpt. Credit Type';
+ SameFromLocationErr: Label 'You cannot have same From Location Code: %1 and Rcpt. Credit Type: %2 combination in multiple lines.', Comment = '%1 = From Location Code, %2 =Rcpt. Credit Type';
PostDistributionQst: Label 'Do you want to post Distribution?';
PostDistributionReversalQst: Label 'Do you want to post Distribution Reversal?';
DistRevPostDateErr: Label 'You cannot post Reversal before Reversal Invoice No. %1 Posting Date: %2. Current Posting Date is: %3.', Comment = '%1 = Reversal Invoice No , %2 = Posting Date , %3 = Posting Date';
@@ -175,7 +175,11 @@ codeunit 18200 "GST Distribution"
DistComponentAmount.Init();
DistComponentAmount."Distribution No." := DistributionNo;
if GSTDistributionLine."Rcpt. Credit Type" = GSTDistributionLine."Rcpt. Credit Type"::Availment then begin
- Location.Get(GSTDistributionLine."To Location Code");
+ if GSTDistributionHeader."ISD Document Type" = GSTDistributionHeader."ISD Document Type"::"Credit Memo" then
+ Location.Get(GSTDistributionLine."From Location Code")
+ else
+ Location.Get(GSTDistributionLine."To Location Code");
+
Location.TestField("State Code");
GSTPostingSetup.Get(
Location."State Code",
@@ -184,7 +188,12 @@ codeunit 18200 "GST Distribution"
GSTDistributionLine."Distribution Jurisdiction"));
GSTPostingSetup.TestField("Receivable Account");
DistComponentAmount."GST Component Code" := DetailedGSTLedgerEntry."GST Component Code";
- DistComponentAmount."To Location Code" := GSTDistributionLine."To Location Code";
+
+ if GSTDistributionHeader."ISD Document Type" = GSTDistributionHeader."ISD Document Type"::"Credit Memo" then
+ DistComponentAmount."To Location Code" := GSTDistributionLine."From Location Code"
+ else
+ DistComponentAmount."To Location Code" := GSTDistributionLine."To Location Code";
+
DistComponentAmount.Type := DistComponentAmount.Type::"G/L Account";
DistComponentAmount."No." := GSTPostingSetup."Receivable Account";
end else begin
@@ -401,6 +410,7 @@ codeunit 18200 "GST Distribution"
local procedure CheckDistributionValidations(DistributionNo: Code[20])
var
GSTDistributionLine: Record "GST Distribution Line";
+ GSTDistributionHeader: Record "GST Distribution Header";
GSTDistributionLine2: Record "GST Distribution Line";
begin
GSTDistributionLine.Reset();
@@ -423,17 +433,28 @@ codeunit 18200 "GST Distribution"
GSTDistributionLine.FieldCaption("To GSTIN No."),
GSTDistributionLine."Line No.");
- GSTDistributionLine2.Reset();
- GSTDistributionLine2.SetRange("Distribution No.", DistributionNo);
- GSTDistributionLine2.SetRange("To Location Code", GSTDistributionLine."To Location Code");
- GSTDistributionLine2.SetRange("Rcpt. Credit Type", GSTDistributionLine."Rcpt. Credit Type");
- if GSTDistributionLine2.Count() > 1 then
- Error(SameToLocationErr, GSTDistributionLine."To Location Code", GSTDistributionLine."Rcpt. Credit Type");
-
+ GSTDistributionHeader.Get(GSTDistributionLine."Distribution No.");
+ if GSTDistributionHeader."ISD Document Type" = GSTDistributionHeader."ISD Document Type"::Invoice then begin
+ GSTDistributionLine2.Reset();
+ GSTDistributionLine2.SetRange("Distribution No.", DistributionNo);
+ GSTDistributionLine2.SetRange("To Location Code", GSTDistributionLine."To Location Code");
+ GSTDistributionLine2.SetRange("Rcpt. Credit Type", GSTDistributionLine."Rcpt. Credit Type");
+ if GSTDistributionLine2.Count() > 1 then
+ Error(SameToLocationErr, GSTDistributionLine."To Location Code", GSTDistributionLine."Rcpt. Credit Type");
+ end
+ else begin
+ GSTDistributionLine2.Reset();
+ GSTDistributionLine2.SetRange("Distribution No.", DistributionNo);
+ GSTDistributionLine2.SetRange("From Location Code", GSTDistributionLine."From Location Code");
+ GSTDistributionLine2.SetRange("Rcpt. Credit Type", GSTDistributionLine."Rcpt. Credit Type");
+ if GSTDistributionLine2.Count() > 1 then
+ Error(SameFromLocationErr, GSTDistributionLine."From Location Code", GSTDistributionLine."Rcpt. Credit Type");
+ end;
until GSTDistributionLine.Next() = 0;
end;
- local procedure InsertDetGSTDistEntries(DistributionNo: Code[20]; PostedDistributionNo: Code[20])
+ local procedure InsertDetGSTDistEntries(DistributionNo: Code[20];
+ PostedDistributionNo: Code[20])
var
DetailedGSTLedgerEntry: Record "Detailed GST Ledger Entry";
GSTDistributionHeader: Record "GST Distribution Header";
@@ -479,7 +500,18 @@ codeunit 18200 "GST Distribution"
DetailedGSTDistEntry.Init();
DetailedGSTDistEntry."Entry No." := 0;
DetailedGSTDistEntry."Detailed GST Ledger Entry No." := DetailedGSTLedgerEntry."Entry No.";
- DetailedGSTDistEntry."Dist. Location Code" := GSTDistributionLine."From Location Code";
+
+ if GSTDistributionHeader."ISD Document Type" = GSTDistributionHeader."ISD Document Type"::"Credit Memo" then begin
+ DetailedGSTDistEntry."Dist. Location Code" := GSTDistributionLine."To Location Code";
+ DetailedGSTDistEntry."Rcpt. Location Code" := GSTDistributionLine."From Location Code";
+ DetailedGSTDistEntry."Rcpt. GST Reg. No." := GSTDistributionLine."From GSTIN No.";
+ end
+ else begin
+ DetailedGSTDistEntry."Dist. Location Code" := GSTDistributionLine."From Location Code";
+ DetailedGSTDistEntry."Rcpt. Location Code" := GSTDistributionLine."To Location Code";
+ DetailedGSTDistEntry."Rcpt. GST Reg. No." := GSTDistributionLine."To GSTIN No.";
+ end;
+
DetailedGSTDistEntry."Dist. Location State Code" := DetailedGSTLedgerEntryInfo."Location State Code";
DetailedGSTDistEntry."Dist. GST Regn. No." := DetailedGSTLedgerEntry."Location Reg. No.";
DetailedGSTDistEntry."Dist. GST Credit" := DetailedGSTLedgerEntry."GST credit";
@@ -500,9 +532,7 @@ codeunit 18200 "GST Distribution"
DetailedGSTDistEntry."GST Group Code" := DetailedGSTLedgerEntry."GST Group Code";
DetailedGSTDistEntry."GST %" := DetailedGSTLedgerEntry."GST %";
DetailedGSTDistEntry."GST Amount" := Sign * DetailedGSTLedgerEntry."GST Amount";
- DetailedGSTDistEntry."Rcpt. Location Code" := GSTDistributionLine."To Location Code";
DetailedGSTDistEntry."Location ISD document No." := PostedLocationDistNo;
- DetailedGSTDistEntry."Rcpt. GST Reg. No." := GSTDistributionLine."To GSTIN No.";
DetailedGSTDistEntry."Rcpt. Location State Code" := Location."State Code";
DetailedGSTDistEntry."Rcpt. GST Credit" := GSTDistributionLine."Rcpt. Credit Type";
if DetailedGSTLedgerEntry."GST Jurisdiction Type" = DetailedGSTLedgerEntry."GST Jurisdiction Type"::Interstate then
@@ -559,9 +589,9 @@ codeunit 18200 "GST Distribution"
GSTComponentCode: Code[30];
TransactionType: Enum "Detail Ledger Transaction Type";
Type: Enum "Distribution Type";
- GSTCredit: Enum "GST Credit";
- ISD: Boolean;
- ReceivableApplicable: Boolean): Code[20]
+ GSTCredit: Enum "GST Credit";
+ ISD: Boolean;
+ ReceivableApplicable: Boolean): Code[20]
var
GSTPostingSetup: Record "GST Posting Setup";
GLAcc: Code[20];
@@ -672,13 +702,13 @@ codeunit 18200 "GST Distribution"
local procedure PostGenJournalLine(
var GenJournalLine: Record "Gen. Journal Line";
DocumentType: Enum "Adjustment Document Type";
- DocumentNo: Code[20];
- PostingDate: Date;
- AccountNo: Code[20];
- Amt: Decimal;
- ShortcutDim1: Code[20];
- ShortcutDim2: Code[20];
- DimSetID: Integer)
+ DocumentNo: Code[20];
+ PostingDate: Date;
+ AccountNo: Code[20];
+ Amt: Decimal;
+ ShortcutDim1: Code[20];
+ ShortcutDim2: Code[20];
+ DimSetID: Integer)
begin
SourceCodeSetup.Get();
SourceCodeSetup.TestField("GST Distribution");
@@ -743,13 +773,19 @@ codeunit 18200 "GST Distribution"
GSTDistributionLine: Record "GST Distribution Line";
DetailedGSTLedgerEntry: Record "Detailed GST Ledger Entry";
DistributionNo: Code[20])
+ var
+ GSTDistributionHeader: Record "GST Distribution Header";
begin
DistComponentAmount.Reset();
DistComponentAmount.SetRange("Distribution No.", DistributionNo);
DistComponentAmount.SetRange("GST Credit", GSTDistributionLine."Rcpt. Credit Type");
if GSTDistributionLine."Rcpt. Credit Type" = GSTDistributionLine."Rcpt. Credit Type"::Availment then begin
DistComponentAmount.SetRange("GST Component Code", DetailedGSTLedgerEntry."GST Component Code");
- DistComponentAmount.SetRange("To Location Code", GSTDistributionLine."To Location Code");
+ GSTDistributionHeader.Get(GSTDistributionLine."Distribution No.");
+ if GSTDistributionHeader."ISD Document Type" = GSTDistributionHeader."ISD Document Type"::"Credit Memo" then
+ DistComponentAmount.SetRange("To Location Code", GSTDistributionLine."From Location Code")
+ else
+ DistComponentAmount.SetRange("To Location Code", GSTDistributionLine."To Location Code");
DistComponentAmount.SetRange(Type);
DistComponentAmount.SetRange("No.");
end else begin
diff --git a/Apps/IN/INGST/app/GSTDistribution/src/Codeunit/GSTDistributionSubcsribers.codeunit.al b/Apps/IN/INGST/app/GSTDistribution/src/Codeunit/GSTDistributionSubcsribers.codeunit.al
index 23be5df101..20608f0e88 100644
--- a/Apps/IN/INGST/app/GSTDistribution/src/Codeunit/GSTDistributionSubcsribers.codeunit.al
+++ b/Apps/IN/INGST/app/GSTDistribution/src/Codeunit/GSTDistributionSubcsribers.codeunit.al
@@ -310,6 +310,14 @@ codeunit 18201 "GST Distribution Subcsribers"
repeat
GSTDistributionLine.Init();
GSTDistributionLine.TransferFields(PostedGSTDistributionLine);
+
+ if GSTDistributionHeader."ISD Document Type" = GSTDistributionHeader."ISD Document Type"::"Credit Memo" then begin
+ GSTDistributionLine."From Location Code" := GSTDistributionLine."To Location Code";
+ GSTDistributionLine."From GSTIN No." := GSTDistributionLine."To GSTIN No.";
+ GSTDistributionLine."To Location Code" := GSTDistributionHeader."From Location Code";
+ GSTDistributionLine."To GSTIN No." := GSTDistributionHeader."From GSTIN No.";
+ end;
+
GSTDistributionLine."Distribution No." := GSTDistributionHeader."No.";
GSTDistributionLine."Posting Date" := GSTDistributionHeader2."Posting Date";
GSTDistributionLine."Distribution Amount" := 0;
diff --git a/Apps/IN/INGST/test/GSTPurchase/src/GSTOnPurchaseTests.Codeunit.al b/Apps/IN/INGST/test/GSTPurchase/src/GSTOnPurchaseTests.Codeunit.al
index 09de0d69d4..ba34021dca 100644
--- a/Apps/IN/INGST/test/GSTPurchase/src/GSTOnPurchaseTests.Codeunit.al
+++ b/Apps/IN/INGST/test/GSTPurchase/src/GSTOnPurchaseTests.Codeunit.al
@@ -1279,6 +1279,39 @@ codeunit 18131 "GST On Purchase Tests"
CreateAndPostDistributionDocumentNo(DocType::Invoice, DistGSTCredit::Availment, RcptGSTCredit::Availment, false);
end;
+ [Test]
+ [HandlerFunctions('TaxRatePageHandler,ReferenceInvoiceNoPageHandler,ApplyDistributionEntries,ConfirmationHandler,DimensionHandler,NoSeriesHandler')]
+ procedure PostInterStateCrMemoDistributionITCToITCFromLocAsToLocforReverse()
+ var
+ PurchaseHeader: Record "Purchase Header";
+ PurchaseLine: Record "Purchase Line";
+ LineType: Enum "Purchase Line Type";
+ GSTGroupType: Enum "GST Group Type";
+ DocumentType: Enum "Document Type Enum";
+ GSTVendorType: Enum "GST Vendor Type";
+ DocType: Enum "BankCharges DocumentType";
+ DistGSTCredit: Enum "GST Credit";
+ RcptGSTCredit: Enum "GST Credit";
+ begin
+ // [Scenario] Check if the system is handling Interstate Distribution of Credit Memo with Input Tax Credit to Recipient location as Input Tax Credit is available
+ // [FEATURE] [Inter-State Services, Purchase Credit Memo] [ITC, Registered Vendor]
+
+ // [GIVEN] Created GST Setup and tax rates for registered Vendor where input tax credit is available with GST Group Code type is Service
+ CreateGSTSetup(GSTVendorType::Registered, GSTGroupType::Service, false, false);
+ InitializeShareStep(true, false, false);
+ UpdateInputServiceDistributer(true);
+ Storage.Set(NoOfLineLbl, '1');
+
+ // [WHEN] Create and Post Purchase Order with GST and Line Type as Services for Interstate Transactions.
+ CreateAndPostPurchaseDocument(PurchaseHeader, PurchaseLine, LineType::"G/L Account", DocumentType::Order);
+
+ // [THEN] Create and Post Distribution Document with Document type Inoivce and Distribution GST Credit is Availment and Receipt GST Credit is Availment
+ CreateAndPostDistributionDocumentNo(DocType::Invoice, DistGSTCredit::Availment, RcptGSTCredit::Availment, false);
+
+ // [THEN] Create and Post Distribution Document with Document type Inoivce and Distribution GST Credit is Availment and Receipt GST Credit is Availment
+ CreateAndPostDistributionDocument(DocType::"Credit Memo", DistGSTCredit::Availment, RcptGSTCredit::Availment, true);
+ end;
+
local procedure VerifyTaxTransactionValueExist(DocumentType: Enum "Purchase Document Type"; DocumentNo: Code[20])
var
PurchaseLineArchive: Record "Purchase Line Archive";
@@ -1961,21 +1994,23 @@ codeunit 18131 "GST On Purchase Tests"
local procedure CreateToLocation(): Code[20]
var
- State: Record State;
+ CompanyInformation: Record "Company information";
+ //State: Record State;
TaxComponent: Record "Tax Component";
LocationGSTRegNo: Code[15];
LocPANNo: Code[20];
LocationCode: Code[10];
+ StateCode: Code[10];
begin
- LocPANNo := LibraryGST.CreatePANNos();
- LibraryGST.CreateState(State);
- LocationGSTRegNo := LibraryGST.CreateGSTRegistrationNos(State.Code, LocPANNo);
- LocationCode := LibraryGST.CreateLocationSetup(State.Code, LocationGSTRegNo, false);
-
+ CompanyInformation.Get();
+ LocPANNo := CompanyInformation."P.A.N. No.";
+ StateCode := LibraryGST.CreateGSTStateCode();
+ LocationGSTRegNo := LibraryGST.CreateGSTRegistrationNos(StateCode, LocPANNo);
+ LocationCode := LibraryGST.CreateLocationSetup(StateCode, LocationGSTRegNo, false);
TaxComponent.SetFilter(Name, '%1|%2|%3', CGSTLbl, SGSTLbl, IGSTLbl);
if TaxComponent.FindSet() then
repeat
- LibraryGST.CreateGSTPostingSetup(TaxComponent, State.Code)
+ LibraryGST.CreateGSTPostingSetup(TaxComponent, StateCode)
until TaxComponent.Next() = 0;
exit(LocationCode);
diff --git a/Apps/IT/IntrastatIT/app/src/IntrastatReportManagementIT.Codeunit.al b/Apps/IT/IntrastatIT/app/src/IntrastatReportManagementIT.Codeunit.al
index 606506cd0e..c69e399d8c 100644
--- a/Apps/IT/IntrastatIT/app/src/IntrastatReportManagementIT.Codeunit.al
+++ b/Apps/IT/IntrastatIT/app/src/IntrastatReportManagementIT.Codeunit.al
@@ -30,7 +30,6 @@ using System.Utilities;
codeunit 148121 "Intrastat Report Management IT"
{
- Access = Internal;
SingleInstance = true;
[EventSubscriber(ObjectType::Codeunit, Codeunit::IntrastatReportManagement, 'OnBeforeInitSetup', '', true, true)]
diff --git a/Apps/W1/EDocumentConnectors/Continia/app/ExtensionLogo.png b/Apps/W1/EDocumentConnectors/Continia/app/ExtensionLogo.png
deleted file mode 100644
index 79a3aa399d..0000000000
Binary files a/Apps/W1/EDocumentConnectors/Continia/app/ExtensionLogo.png and /dev/null differ
diff --git a/Apps/W1/EDocumentConnectors/Continia/app/app.json b/Apps/W1/EDocumentConnectors/Continia/app/app.json
deleted file mode 100644
index 3889e8ba9e..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/app/app.json
+++ /dev/null
@@ -1,47 +0,0 @@
-{
- "id": "31ef535a-1182-4354-98e8-e0e66a587055",
- "name": "E-Document Connector - Continia",
- "publisher": "Microsoft",
- "brief": "E-Document Connector - Continia",
- "description": "E-Document Connector - Continia",
- "version": "28.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",
- "contextSensitiveHelpUrl": "https://go.microsoft.com/fwlink/?linkid=2206603",
- "dependencies": [
- {
- "id": "e1d97edc-c239-46b4-8d84-6368bdf67c8b",
- "name": "E-Document Core",
- "publisher": "Microsoft",
- "version": "28.0.0.0"
- }
- ],
- "internalsVisibleTo": [
- {
- "id": "769158cc-9498-42cf-b3a3-e5be4333f8b7",
- "name": "E-Document Connector - Continia Tests",
- "publisher": "Microsoft"
- }
- ],
- "screenshots": [],
- "platform": "28.0.0.0",
- "idRanges": [
- {
- "from": 6380,
- "to": 6399
- }
- ],
- "resourceExposurePolicy": {
- "allowDebugging": true,
- "allowDownloadingSource": true,
- "includeSourceInSymbolFile": true
- },
- "application": "28.0.0.0",
- "target": "OnPrem",
- "features": [
- "TranslationFile"
- ],
- "logo": "ExtensionLogo.png"
-}
diff --git a/Apps/W1/EDocumentConnectors/Continia/app/src/API Requests/ContiniaAPIRequests.Codeunit.al b/Apps/W1/EDocumentConnectors/Continia/app/src/API Requests/ContiniaAPIRequests.Codeunit.al
deleted file mode 100644
index 906d7ae5f9..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/app/src/API Requests/ContiniaAPIRequests.Codeunit.al
+++ /dev/null
@@ -1,1126 +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.EServices.EDocumentConnector.Continia;
-
-using Microsoft.eServices.EDocument;
-using System.Utilities;
-using System.Text;
-using Microsoft.eServices.EDocument.Integration.Send;
-using Microsoft.Foundation.Address;
-using Microsoft.Foundation.Company;
-using Microsoft.eServices.EDocument.Integration.Receive;
-
-codeunit 6393 "Continia Api Requests"
-{
- Access = Internal;
-
- Permissions = tabledata "Continia Network Profile" = rimd,
- tabledata "Continia Network Identifier" = rimd,
- tabledata "Continia Participation" = rimd,
- tabledata "Continia Activated Net. Prof." = rimd,
- tabledata "E-Document" = m;
-
- #region Get Network Profiles from Continia Delivery Network Api
- internal procedure GetNetworkProfiles(Network: Enum "Continia E-Delivery Network")
- var
- ApiUrlMgt: Codeunit "Continia Api Url";
- HttpResponse: HttpResponseMessage;
- CurrPage: Integer;
- PageSize: Integer;
- TotalCount: Integer;
- HandledRecordsCount: Integer;
- PageRecordsCount: Integer;
- begin
- TotalCount := 0;
- HandledRecordsCount := 0;
- CurrPage := 0;
- PageSize := 100;
- repeat
- CurrPage += 1;
- if ExecuteRequest('GET', ApiUrlMgt.NetworkProfilesUrl(Network, CurrPage, PageSize), HttpResponse) then begin
- if TotalCount = 0 then
- TotalCount := GetRecordsCount(HttpResponse);
- PageRecordsCount := HandleNetworkProfileResponse(HttpResponse, Network);
- HandledRecordsCount += PageRecordsCount;
- end;
- until (HandledRecordsCount >= TotalCount) or (PageRecordsCount = 0);
- end;
-
- local procedure HandleNetworkProfileResponse(var HttpResponse: HttpResponseMessage; NetworkName: Enum "Continia E-Delivery Network") HandledRecordsCount: Integer
- var
- NetworkProfile: Record "Continia Network Profile";
- Insert: Boolean;
- NetworkProfileId: Guid;
- i: Integer;
- ResponseBody: Text;
- ResponseXmlDoc: XmlDocument;
- TempXMLNode: XmlNode;
- TempXMLNode2: XmlNode;
- XMLNodeList: XmlNodeList;
- begin
- HttpResponse.Content.ReadAs(ResponseBody);
- if ResponseBody = '' then
- exit;
- XmlDocument.ReadFrom(ResponseBody, ResponseXmlDoc);
- if not ResponseXmlDoc.SelectNodes('/network_profiles/network_profile', XMLNodeList) then
- exit;
-
- HandledRecordsCount := XMLNodeList.Count;
- for i := 1 to XMLNodeList.Count do begin
- XMLNodeList.Get(i, TempXMLNode);
-
- TempXMLNode.SelectSingleNode('network_profile_id', TempXMLNode2);
-
- NetworkProfileId := StrSubstNo('{%1}', TempXMLNode2.AsXmlElement().InnerText);
-
- if NetworkProfile.Get(NetworkProfileId) then
- Insert := false
- else begin
- NetworkProfile.Init();
- NetworkProfile.Id := NetworkProfileId;
- Insert := true;
- end;
-
- NetworkProfile.Network := NetworkName;
-
- if TempXMLNode.SelectSingleNode('description', TempXMLNode2) then
- NetworkProfile.Description := CopyStr(TempXMLNode2.AsXmlElement().InnerText, 1, MaxStrLen(NetworkProfile.Description));
-
- if TempXMLNode.SelectSingleNode('document_identifier', TempXMLNode2) then
- NetworkProfile."Document Identifier" := CopyStr(TempXMLNode2.AsXmlElement().InnerText, 1, MaxStrLen(NetworkProfile."Document Identifier"));
-
- if TempXMLNode.SelectSingleNode('mandatory', TempXMLNode2) then
- NetworkProfile.Mandatory := TempXMLNode2.AsXmlElement().InnerText = 'true';
-
- if TempXMLNode.SelectSingleNode('mandatory_in_country_iso3166', TempXMLNode2) then
- NetworkProfile."Mandatory for Country" := CopyStr(TempXMLNode2.AsXmlElement().InnerText, 1, MaxStrLen(NetworkProfile."Mandatory for Country"));
-
- if TempXMLNode.SelectSingleNode('process_identifier', TempXMLNode2) then
- NetworkProfile."Process Identifier" := CopyStr(TempXMLNode2.AsXmlElement().InnerText, 1, MaxStrLen(NetworkProfile."Process Identifier"));
-
- if TempXMLNode.SelectSingleNode('enabled', TempXMLNode2) then
- NetworkProfile.Enabled := TempXMLNode2.AsXmlElement().InnerText = 'true'
- else
- NetworkProfile.Enabled := true;
-
- if Insert then
- NetworkProfile.Insert()
- else
- NetworkProfile.Modify();
- end;
- end;
- #endregion
-
- #region Get Network Id Types from Continia Delivery Network Api
- internal procedure GetNetworkIdTypes(Network: Enum "Continia E-Delivery Network")
- var
- ApiUrlMgt: Codeunit "Continia Api Url";
- HttpResponse: HttpResponseMessage;
- CurrPage: Integer;
- PageSize: Integer;
- TotalCount: Integer;
- HandledRecordsCount: Integer;
- PageRecordsCount: Integer;
- begin
- TotalCount := 0;
- HandledRecordsCount := 0;
- CurrPage := 0;
- PageSize := 100;
- repeat
- CurrPage += 1;
- if ExecuteRequest('GET', ApiUrlMgt.NetworkIdentifiersUrl(Network, CurrPage, PageSize), HttpResponse) then begin
- if TotalCount = 0 then
- TotalCount := GetRecordsCount(HttpResponse);
- PageRecordsCount := HandleNetworkIdTypeResponse(HttpResponse, Network);
- HandledRecordsCount += PageRecordsCount;
- end;
- until (HandledRecordsCount >= TotalCount) or (PageRecordsCount = 0);
- end;
-
- local procedure HandleNetworkIdTypeResponse(var HttpResponse: HttpResponseMessage; NetworkName: Enum "Continia E-Delivery Network") HandleRecordsCount: Integer
- var
- NetworkIdentifier: Record "Continia Network Identifier";
- Insert: Boolean;
- NetworkIdentifierId: Guid;
- i: Integer;
- ResponseBody: Text;
- ResponseXmlDoc: XmlDocument;
- TempXMLNode: XmlNode;
- TempXMLNode2: XmlNode;
- XMLNodeList: XmlNodeList;
- begin
- HttpResponse.Content.ReadAs(ResponseBody);
- if ResponseBody = '' then
- exit;
- XmlDocument.ReadFrom(ResponseBody, ResponseXmlDoc);
- if not ResponseXmlDoc.SelectNodes('/network_id_types/network_id_type', XMLNodeList) then
- exit;
-
- HandleRecordsCount := XMLNodeList.Count;
- for i := 1 to XMLNodeList.Count do begin
- XMLNodeList.Get(i, TempXMLNode);
-
- TempXMLNode.SelectSingleNode('network_id_type_id', TempXMLNode2);
-
- NetworkIdentifierId := StrSubstNo('{%1}', TempXMLNode2.AsXmlElement().InnerText);
-
- if NetworkIdentifier.Get(NetworkIdentifierId) then
- Insert := false
- else begin
- NetworkIdentifier.Init();
- NetworkIdentifier.Id := NetworkIdentifierId;
- Insert := true;
- end;
-
- NetworkIdentifier.Network := NetworkName;
-
- if TempXMLNode.SelectSingleNode('code_iso6523-1', TempXMLNode2) then
- NetworkIdentifier."Identifier Type Id" := CopyStr(TempXMLNode2.AsXmlElement().InnerText, 1, MaxStrLen(NetworkIdentifier."Identifier Type Id"));
-
- if TempXMLNode.SelectSingleNode('default_in_country_iso3166', TempXMLNode2) then
- NetworkIdentifier."Default in Country" := CopyStr(TempXMLNode2.AsXmlElement().InnerText, 1, MaxStrLen(NetworkIdentifier."Default in Country"));
-
- if TempXMLNode.SelectSingleNode('description', TempXMLNode2) then
- NetworkIdentifier.Description := CopyStr(TempXMLNode2.AsXmlElement().InnerText, 1, MaxStrLen(NetworkIdentifier.Description));
-
- if TempXMLNode.SelectSingleNode('icd_code', TempXMLNode2) then
- NetworkIdentifier."ICD Code" := TempXMLNode2.AsXmlElement().InnerText = 'true';
-
- if TempXMLNode.SelectSingleNode('network_id_type_id', TempXMLNode2) then
- NetworkIdentifier.Id := TempXMLNode2.AsXmlElement().InnerText;
-
- if TempXMLNode.SelectSingleNode('scheme_id', TempXMLNode2) then
- NetworkIdentifier."Scheme Id" := CopyStr(TempXMLNode2.AsXmlElement().InnerText, 1, MaxStrLen(NetworkIdentifier."Scheme Id"));
-
- if TempXMLNode.SelectSingleNode('vat_in_country_iso3166', TempXMLNode2) then
- NetworkIdentifier."VAT in Country" := CopyStr(TempXMLNode2.AsXmlElement().InnerText, 1, MaxStrLen(NetworkIdentifier."VAT in Country"));
-
- if TempXMLNode.SelectSingleNode('validation_rule', TempXMLNode2) then
- NetworkIdentifier."Validation Rule" := CopyStr(TempXMLNode2.AsXmlElement().InnerText, 1, MaxStrLen(NetworkIdentifier."Validation Rule"));
-
- if TempXMLNode.SelectSingleNode('enabled', TempXMLNode2) then
- NetworkIdentifier.Enabled := TempXMLNode2.AsXmlElement().InnerText = 'true'
- else
- NetworkIdentifier.Enabled := true;
-
- if NetworkIdentifier."Default in Country" <> '' then
- if NetworkIdentifier."Default in Country" = GetCurrentCountryCode() then
- NetworkIdentifier.Default := true;
-
- if Insert then
- NetworkIdentifier.Insert()
- else
- NetworkIdentifier.Modify();
- end;
- end;
- #endregion
-
- #region Participation endpoints in Continia Delivery Network
- internal procedure GetParticipation(var Participation: Record "Continia Participation")
- var
- ApiUrlMgt: Codeunit "Continia Api Url";
- HttpResponse: HttpResponseMessage;
- begin
- if ExecuteRequest('GET', ApiUrlMgt.SingleParticipationUrl(Participation.Network, Participation.Id), HttpResponse) then
- HandleParticipationResponse(HttpResponse, Participation);
- end;
-
- internal procedure PostParticipation(var TempParticipation: Record "Continia Participation" temporary) ParticipationGuid: Guid;
- var
- Participation: Record "Continia Participation";
- ApiUrlMgt: Codeunit "Continia Api Url";
- HttpResponse: HttpResponseMessage;
- HttpContentData: Text;
- begin
- HttpContentData := GetParticipationRequest(TempParticipation, false);
-
- if ExecuteRequest('POST', ApiUrlMgt.ParticipationUrl(TempParticipation.Network), HttpContentData, HttpResponse) then begin
- Participation := TempParticipation;
- Participation.Insert();
- HandleParticipationResponse(HttpResponse, Participation);
- exit(Participation.Id);
- end;
- end;
-
- internal procedure PatchParticipation(var TempParticipation: Record "Continia Participation" temporary)
- var
- Participation: Record "Continia Participation";
- ApiUrlMgt: Codeunit "Continia Api Url";
- HttpResponse: HttpResponseMessage;
- HttpContentData: Text;
- begin
- HttpContentData := GetParticipationRequest(TempParticipation, true);
-
- if ExecuteRequest('PATCH', ApiUrlMgt.SingleParticipationUrl(TempParticipation.Network, TempParticipation.Id), HttpContentData, HttpResponse) then begin
- Participation.Get(TempParticipation.RecordId);
- HandleParticipationResponse(HttpResponse, Participation);
- end;
- end;
-
- internal procedure DeleteParticipation(var Participation: Record "Continia Participation")
- var
- ApiUrlMgt: Codeunit "Continia Api Url";
- HttpResponse: HttpResponseMessage;
- begin
- if ExecuteRequest('DELETE', ApiUrlMgt.SingleParticipationUrl(Participation.Network, Participation.Id), HttpResponse) then
- case HttpResponse.HttpStatusCode of
- 200:
- Participation.Delete(true);
- 202:
- begin
- Participation."Registration Status" := Participation."Registration Status"::Disabled;
- Participation.Modify();
- end;
- end;
- end;
-
- local procedure GetParticipationRequest(Participation: Record "Continia Participation"; IncludeTimestamp: Boolean) RequestBody: Text
- var
- CredentialManagement: Codeunit "Continia Credential Management";
- AddressNode: XmlElement;
- CompanyIdNode: XmlElement;
- CompanyNameNode: XmlElement;
- ContactEmailNode: XmlElement;
- ContactNameNode: XmlElement;
- ContactPhoneNode: XmlElement;
- CountryCodeNode: XmlElement;
- NetworkIdTypeNode: XmlElement;
- NetworkIdValueNode: XmlElement;
- PostCodeNode: XmlElement;
- PublishInRegistryNode: XmlElement;
- RegistrantNameNode: XmlElement;
- RootNode: XmlElement;
- StatusNode: XmlElement;
- TimestampNode: XmlElement;
- VatRegistrationNoNode: XmlElement;
- ParticipationTypeNode: XmlElement;
- ParticipationTypeEnumLbl: Label 'MicrosoftConnector', Locked = true;
- begin
- RootNode := XmlElement.Create('participation');
-
- AddressNode := XmlElement.Create('address');
- AddressNode.Add(XmlText.Create(Participation.Address));
- RootNode.Add(AddressNode);
-
- CompanyIdNode := XmlElement.Create('business_central_company_code');
- CompanyIdNode.Add(XmlText.Create(GetGuidAsText(CredentialManagement.GetCompanyId())));
- RootNode.Add(CompanyIdNode);
-
- CompanyNameNode := XmlElement.Create('company_name');
- CompanyNameNode.Add(XmlText.Create(Participation."Company Name"));
- RootNode.Add(CompanyNameNode);
-
- ContactEmailNode := XmlElement.Create('contact_email');
- ContactEmailNode.Add(XmlText.Create(Participation."Signatory Email"));
- RootNode.Add(ContactEmailNode);
-
- ContactNameNode := XmlElement.Create('contact_name');
- ContactNameNode.Add(XmlText.Create(Participation."Signatory Name"));
- RootNode.Add(ContactNameNode);
-
- ContactPhoneNode := XmlElement.Create('contact_phone');
- ContactPhoneNode.Add(XmlText.Create(Participation."Contact Phone No."));
- RootNode.Add(ContactPhoneNode);
-
- CountryCodeNode := XmlElement.Create('country_code_iso3166');
- CountryCodeNode.Add(XmlText.Create(Participation."Country/Region Code"));
- RootNode.Add(CountryCodeNode);
-
- NetworkIdTypeNode := XmlElement.Create('network_id_type_id');
- NetworkIdTypeNode.Add(XmlText.Create(Participation."Identifier Type Id"));
- RootNode.Add(NetworkIdTypeNode);
-
- NetworkIdValueNode := XmlElement.Create('network_id_value');
- NetworkIdValueNode.Add(XmlText.Create(Participation."Identifier Value"));
- RootNode.Add(NetworkIdValueNode);
-
- if not IsNullGuid(Participation.Id) then begin
- NetworkIdTypeNode := XmlElement.Create('participation_id');
- NetworkIdTypeNode.Add(XmlText.Create(GetGuidAsText(Participation.Id)));
- RootNode.Add(NetworkIdTypeNode);
- end;
-
- ParticipationTypeNode := XmlElement.Create('participation_type');
- ParticipationTypeNode.Add(XmlText.Create(ParticipationTypeEnumLbl));
- RootNode.Add(ParticipationTypeNode);
-
- PostCodeNode := XmlElement.Create('post_code');
- PostCodeNode.Add(XmlText.Create(Participation."Post Code"));
- RootNode.Add(PostCodeNode);
-
- PublishInRegistryNode := XmlElement.Create('publish_in_registry');
- if Participation."Publish in Registry" then
- PublishInRegistryNode.Add(XmlText.Create('true'))
- else
- PublishInRegistryNode.Add(XmlText.Create('false'));
-
- RootNode.Add(PublishInRegistryNode);
-
- RegistrantNameNode := XmlElement.Create('registrant_name');
- RegistrantNameNode.Add(XmlText.Create(Participation."Your Name"));
- RootNode.Add(RegistrantNameNode);
-
- StatusNode := XmlElement.Create('status');
- StatusNode.Add(XmlText.Create(Participation.GetParticipApiStatusEnumValue(false)));
- RootNode.Add(StatusNode);
-
- if IncludeTimestamp then begin
- TimestampNode := XmlElement.Create('timestamp');
- TimestampNode.Add(XmlText.Create(Participation."Cdn Timestamp"));
- RootNode.Add(TimestampNode);
- end;
-
- VatRegistrationNoNode := XmlElement.Create('vat_registration_no');
- VatRegistrationNoNode.Add(XmlText.Create(Participation."VAT Registration No."));
- RootNode.Add(VatRegistrationNoNode);
-
- RootNode.WriteTo(RequestBody);
- end;
-
- local procedure HandleParticipationResponse(var HttpResponse: HttpResponseMessage; var Participation: Record "Continia Participation")
- var
- ResponseBody: Text;
- ResponseXmlDoc: XmlDocument;
- AddressNode: XmlNode;
- CompanyNameNode: XmlNode;
- ContactEmailNode: XmlNode;
- ContactNameNode: XmlNode;
- ContactPhoneNode: XmlNode;
- CountryCodeNode: XmlNode;
- CreatedNode: XmlNode;
- ParicipationIdNode: XmlNode;
- PostCodeNode: XmlNode;
- PublishInRegistryNode: XmlNode;
- RegistrantNameNode: XmlNode;
- StatusNode: XmlNode;
- TimestampNode: XmlNode;
- UpdatedNode: XmlNode;
- VatRegistrationNoNode: XmlNode;
- begin
- HttpResponse.Content.ReadAs(ResponseBody);
- if ResponseBody = '' then
- exit;
-
- XmlDocument.ReadFrom(ResponseBody, ResponseXmlDoc);
-
- ResponseXmlDoc.SelectSingleNode('/participation/company_name', CompanyNameNode);
- Participation."Company Name" := CopyStr(CompanyNameNode.AsXmlElement().InnerText, 1, MaxStrLen(Participation."Company Name"));
-
- ResponseXmlDoc.SelectSingleNode('/participation/vat_registration_no', VatRegistrationNoNode);
- Participation."VAT Registration No." := CopyStr(VatRegistrationNoNode.AsXmlElement().InnerText, 1, MaxStrLen(Participation."VAT Registration No."));
-
- ResponseXmlDoc.SelectSingleNode('/participation/address', AddressNode);
- Participation.Address := CopyStr(AddressNode.AsXmlElement().InnerText, 1, MaxStrLen(Participation.Address));
-
- ResponseXmlDoc.SelectSingleNode('/participation/post_code', PostCodeNode);
- Participation."Post Code" := CopyStr(PostCodeNode.AsXmlElement().InnerText, 1, MaxStrLen(Participation."Post Code"));
-
- ResponseXmlDoc.SelectSingleNode('/participation/country_code_iso3166', CountryCodeNode);
- Participation."Country/Region Code" := CopyStr(CountryCodeNode.AsXmlElement().InnerText, 1, MaxStrLen(Participation."Country/Region Code"));
-
- ResponseXmlDoc.SelectSingleNode('/participation/registrant_name', RegistrantNameNode);
- Participation."Your Name" := CopyStr(RegistrantNameNode.AsXmlElement().InnerText, 1, MaxStrLen(Participation."Your Name"));
-
- ResponseXmlDoc.SelectSingleNode('/participation/contact_name', ContactNameNode);
- Participation."Signatory Name" := CopyStr(ContactNameNode.AsXmlElement().InnerText, 1, MaxStrLen(Participation."Signatory Name"));
-
- ResponseXmlDoc.SelectSingleNode('/participation/contact_phone', ContactPhoneNode);
- Participation."Contact Phone No." := CopyStr(ContactPhoneNode.AsXmlElement().InnerText, 1, MaxStrLen(Participation."Contact Phone No."));
-
- ResponseXmlDoc.SelectSingleNode('/participation/contact_email', ContactEmailNode);
- Participation."Signatory Email" := CopyStr(ContactEmailNode.AsXmlElement().InnerText, 1, MaxStrLen(Participation."Signatory Email"));
-
- ResponseXmlDoc.SelectSingleNode('/participation/publish_in_registry', PublishInRegistryNode);
- if LowerCase(PublishInRegistryNode.AsXmlElement().InnerText) = 'true' then
- Participation."Publish in Registry" := true
- else
- Participation."Publish in Registry" := false;
-
- ResponseXmlDoc.SelectSingleNode('/participation/publish_in_registry', PublishInRegistryNode);
- if LowerCase(PublishInRegistryNode.AsXmlElement().InnerText) = 'true' then
- Participation."Publish in Registry" := true
- else
- Participation."Publish in Registry" := false;
-
- ResponseXmlDoc.SelectSingleNode('/participation/participation_id', ParicipationIdNode);
- Evaluate(Participation.Id, ParicipationIdNode.AsXmlElement().InnerText);
-
- ResponseXmlDoc.SelectSingleNode('/participation/status', StatusNode);
- Participation.ValidateCdnStatus(StatusNode.AsXmlElement().InnerText);
-
- ResponseXmlDoc.SelectSingleNode('/participation/created_utc', CreatedNode);
- Evaluate(Participation.Created, CreatedNode.AsXmlElement().InnerText, 9);
-
- ResponseXmlDoc.SelectSingleNode('/participation/updated_utc', UpdatedNode);
- Evaluate(Participation.Updated, UpdatedNode.AsXmlElement().InnerText, 9);
-
- ResponseXmlDoc.SelectSingleNode('/participation/timestamp', TimestampNode);
- Participation."Cdn Timestamp" := CopyStr(TimestampNode.AsXmlElement().InnerText, 1, MaxStrLen(Participation."Cdn Timestamp"));
-
- Participation.Modify();
- end;
- #endregion
-
- #region Participation Profiles endpoints in Continia Delivery Network
- internal procedure PostParticipationProfile(var TempActivatedNetworkProfile: Record "Continia Activated Net. Prof." temporary; ParticipationGuid: Guid) ActivatedNetworkProfileGuid: Guid
- var
- ActivatedNetProf: Record "Continia Activated Net. Prof.";
- ApiUrlMgt: Codeunit "Continia Api Url";
- HttpResponse: HttpResponseMessage;
- HttpContentData: Text;
- begin
- HttpContentData := GetParticipationProfilesRequest(TempActivatedNetworkProfile);
-
- if ExecuteRequest('POST', ApiUrlMgt.ParticipationProfilesUrl(TempActivatedNetworkProfile.Network, ParticipationGuid), HttpContentData, HttpResponse) then begin
- ActivatedNetProf := TempActivatedNetworkProfile;
- ActivatedNetProf.Insert();
- UpdateParticipationProfile(HttpResponse, ActivatedNetProf);
- exit(ActivatedNetProf.Id);
- end;
- end;
-
- internal procedure PatchParticipationProfile(var TempActivatedNetworkProfile: Record "Continia Activated Net. Prof." temporary; ParticipationGuid: Guid)
- var
- ActivatedNetProf: Record "Continia Activated Net. Prof.";
- ApiUrlMgt: Codeunit "Continia Api Url";
- HttpResponse: HttpResponseMessage;
- HttpContentData: Text;
- begin
- HttpContentData := GetParticipationProfilesRequest(TempActivatedNetworkProfile);
-
- if ExecuteRequest('PATCH', ApiUrlMgt.SingleParticipationProfileUrl(TempActivatedNetworkProfile.Network, ParticipationGuid, TempActivatedNetworkProfile.Id), HttpContentData, HttpResponse) then begin
- ActivatedNetProf.Get(TempActivatedNetworkProfile.RecordId);
- UpdateParticipationProfile(HttpResponse, ActivatedNetProf);
- end;
- end;
-
- internal procedure DeleteParticipationProfile(var ActivatedNetworkProfile: Record "Continia Activated Net. Prof."; ParticipationGuid: Guid)
- var
- ApiUrlMgt: Codeunit "Continia Api Url";
- HttpResponse: HttpResponseMessage;
- begin
- if ExecuteRequest('DELETE', ApiUrlMgt.SingleParticipationProfileUrl(ActivatedNetworkProfile.Network, ParticipationGuid, ActivatedNetworkProfile.Id), HttpResponse) then begin
- ActivatedNetworkProfile.Validate(Disabled, CreateDateTime(Today, Time));
- ActivatedNetworkProfile.Modify();
- end;
- end;
-
- internal procedure GetAllParticipationProfiles(Participation: Record "Continia Participation")
- var
- ApiUrlMgt: Codeunit "Continia Api Url";
- HttpResponse: HttpResponseMessage;
- CurrPage: Integer;
- PageSize: Integer;
- TotalCount: Integer;
- PageRecordsCount: Integer;
- HandledRecordsCount: Integer;
- begin
- TotalCount := 0;
- HandledRecordsCount := 0;
- CurrPage := 0;
- PageSize := 100;
- repeat
- CurrPage += 1;
- if ExecuteRequest('GET', ApiUrlMgt.ParticipationProfilesUrl(Participation.Network, Participation.Id, CurrPage, PageSize), HttpResponse) then begin
- if TotalCount = 0 then
- TotalCount := GetRecordsCount(HttpResponse);
- HandleApiError(HttpResponse);
- PageRecordsCount := ReadParticipationProfilesResponse(HttpResponse, Participation);
- HandledRecordsCount += PageRecordsCount;
- end;
- until (HandledRecordsCount >= TotalCount) or (PageRecordsCount = 0);
- end;
-
- local procedure ReadParticipationProfilesResponse(var HttpResponse: HttpResponseMessage; Participation: Record "Continia Participation") HandledRecordsCount: Integer
- var
- i: Integer;
- ResponseBody: Text;
- ResponseXmlDoc: XmlDocument;
- Node: XmlNode;
- NodeList: XmlNodeList;
- begin
- HttpResponse.Content.ReadAs(ResponseBody);
- if ResponseBody = '' then
- exit;
-
- XmlDocument.ReadFrom(ResponseBody, ResponseXmlDoc);
- if not ResponseXmlDoc.SelectNodes('/participation_profiles/participation_profile', NodeList) then
- exit;
-
- HandledRecordsCount := NodeList.Count;
-
- for i := 1 to NodeList.Count do begin
- NodeList.Get(i, Node);
- CreateOrUpdateParticipProfiles(Participation, Node);
- end;
- end;
-
- local procedure GetParticipationProfilesRequest(ActivatedNetworkProfile: Record "Continia Activated Net. Prof.") RequestBody: Text
- var
- ParticipationProfileNode: XmlElement;
- ProfileDirectionNode: XmlElement;
- ProfileIdNode: XmlElement;
- begin
- ParticipationProfileNode := XmlElement.Create('participation_profile');
-
- ProfileDirectionNode := XmlElement.Create('direction');
- ProfileDirectionNode.Add(XmlText.Create(ActivatedNetworkProfile.GetParticipApiDirectionEnum()));
- ParticipationProfileNode.Add(ProfileDirectionNode);
-
- ProfileIdNode := XmlElement.Create('network_profile_id');
- ProfileIdNode.Add(XmlText.Create(GetGuidAsText(ActivatedNetworkProfile."Network Profile Id")));
- ParticipationProfileNode.Add(ProfileIdNode);
-
- ParticipationProfileNode.WriteTo(RequestBody);
- end;
-
- local procedure CreateOrUpdateParticipProfiles(Participation: Record "Continia Participation"; ProfilesNode: XmlNode)
- var
- ActivatedNetworkProfile: Record "Continia Activated Net. Prof.";
- ProfileGuid: Guid;
- CreatedNode: XmlNode;
- DirectionNode: XmlNode;
- DisabledNode: XmlNode;
- ParticipationProfileIdNode: XmlNode;
- ProfileIdNode: XmlNode;
- UpdatedNode: XmlNode;
- begin
- ProfilesNode.SelectSingleNode('network_profile_id', ProfileIdNode);
- Evaluate(ProfileGuid, ProfileIdNode.AsXmlElement().InnerText);
- if not ActivatedNetworkProfile.Get(Participation.Network, Participation."Identifier Type Id", Participation."Identifier Value", ProfileGuid) then begin
- ActivatedNetworkProfile.Init();
- ActivatedNetworkProfile.Network := Participation.Network;
- ActivatedNetworkProfile."Identifier Type Id" := Participation."Identifier Type Id";
- ActivatedNetworkProfile."Identifier Value" := Participation."Identifier Value";
- ActivatedNetworkProfile."Network Profile Id" := ProfileGuid;
- ActivatedNetworkProfile.Insert();
- end;
-
- ProfilesNode.SelectSingleNode('participation_profile_id', ParticipationProfileIdNode);
- Evaluate(ActivatedNetworkProfile.Id, ParticipationProfileIdNode.AsXmlElement().InnerText);
-
- ProfilesNode.SelectSingleNode('direction', DirectionNode);
- ActivatedNetworkProfile.ValidateApiDirection(DirectionNode.AsXmlElement().InnerText);
-
- ProfilesNode.SelectSingleNode('created_utc', CreatedNode);
- Evaluate(ActivatedNetworkProfile.Created, CreatedNode.AsXmlElement().InnerText, 9);
-
- ProfilesNode.SelectSingleNode('updated_utc', UpdatedNode);
- Evaluate(ActivatedNetworkProfile.Updated, UpdatedNode.AsXmlElement().InnerText, 9);
-
- if ProfilesNode.SelectSingleNode('disabled_utc', DisabledNode) then
- Evaluate(ActivatedNetworkProfile.Disabled, DisabledNode.AsXmlElement().InnerText, 9)
- else
- Clear(ActivatedNetworkProfile.Disabled);
-
- ActivatedNetworkProfile.Modify();
- end;
-
- local procedure UpdateParticipationProfile(var HttpResponse: HttpResponseMessage; var ActivatedNetworkProfile: Record "Continia Activated Net. Prof.")
- var
- ResponseBody: Text;
- ResponseXmlDoc: XmlDocument;
- CreatedNode: XmlNode;
- DirectionNode: XmlNode;
- DisabledNode: XmlNode;
- ProfileIdNode: XmlNode;
- UpdatedNode: XmlNode;
- begin
- HttpResponse.Content.ReadAs(ResponseBody);
- if ResponseBody = '' then
- exit;
-
- XmlDocument.ReadFrom(ResponseBody, ResponseXmlDoc);
- ResponseXmlDoc.SelectSingleNode('/participation_profile/participation_profile_id', ProfileIdNode);
- Evaluate(ActivatedNetworkProfile.Id, ProfileIdNode.AsXmlElement().InnerText);
-
- ResponseXmlDoc.SelectSingleNode('/participation_profile/direction', DirectionNode);
- ActivatedNetworkProfile.ValidateApiDirection(DirectionNode.AsXmlElement().InnerText);
-
- ResponseXmlDoc.SelectSingleNode('/participation_profile/created_utc', CreatedNode);
- Evaluate(ActivatedNetworkProfile.Created, CreatedNode.AsXmlElement().InnerText, 9);
-
- ResponseXmlDoc.SelectSingleNode('/participation_profile/updated_utc', UpdatedNode);
- Evaluate(ActivatedNetworkProfile.Updated, UpdatedNode.AsXmlElement().InnerText, 9);
-
- if ResponseXmlDoc.SelectSingleNode('/participation_profile/disabled_utc', DisabledNode) then
- Evaluate(ActivatedNetworkProfile.Disabled, DisabledNode.AsXmlElement().InnerText)
- else
- Clear(ActivatedNetworkProfile.Disabled);
-
- ActivatedNetworkProfile.Modify();
- end;
- #endregion
-
- #region Participation Profiles Lookup endpoints in Continia Delivery Network
- internal procedure CheckProfilesNotRegistered(var TempParticipation: Record "Continia Participation" temporary)
- var
- NetworkIdentifier: Record "Continia Network Identifier";
- ApiUrlMgt: Codeunit "Continia Api Url";
- HttpResponse: HttpResponseMessage;
- begin
- NetworkIdentifier := TempParticipation.GetNetworkIdentifier();
-
- if ExecuteRequest('GET', ApiUrlMgt.ParticipationLookupUrl(TempParticipation.Network, NetworkIdentifier."Identifier Type Id", TempParticipation."Identifier Value"), HttpResponse) then
- HandleProfilesLookupResponse(HttpResponse, TempParticipation);
- end;
-
- local procedure HandleProfilesLookupResponse(var HttpResponse: HttpResponseMessage; var TempParticipation: Record "Continia Participation" temporary)
- var
- ErrorInfo: ErrorInfo;
- ProfileGuid: Guid;
- i: Integer;
- j: Integer;
- AccessPointEmail: Text;
- AccessPointErrText: Text;
- AccessPointName: Text;
- DetailedErrText: Text;
- RegisteredProfilesErrText: Text;
- ResponseBody: Text;
- ResponseXmlDoc: XmlDocument;
- AccessPointNode: XmlNode;
- APEmailNode: XmlNode;
- APNameNode: XmlNode;
- ProfileId: XmlNode;
- ProfileNode: XmlNode;
- ProfileDescriptionNode: XmlNode;
- AccessPointNodeList: XmlNodeList;
- ProfilesNodeList: XmlNodeList;
- begin
- HttpResponse.Content.ReadAs(ResponseBody);
- if ResponseBody = '' then
- exit;
-
- XmlDocument.ReadFrom(ResponseBody, ResponseXmlDoc);
- ResponseXmlDoc.SelectNodes('/participation_lookups/participation_lookup/external_access_points/access_point', AccessPointNodeList);
- for i := 1 to AccessPointNodeList.Count do begin
- AccessPointNodeList.Get(i, AccessPointNode);
- AccessPointNode.SelectNodes('supported_profiles/network_profile', ProfilesNodeList);
- for j := 1 to ProfilesNodeList.Count do begin
- ProfilesNodeList.Get(j, ProfileNode);
- if ProfileNode.SelectSingleNode('network_profile_id', ProfileId) then begin
- Evaluate(ProfileGuid, ProfileId.AsXmlElement().InnerText);
- ProfileNode.SelectSingleNode('description', ProfileDescriptionNode);
- AccessPointNode.SelectSingleNode('name', APNameNode);
- AccessPointNode.SelectSingleNode('email', APEmailNode);
- AccessPointName := APNameNode.AsXmlElement().InnerText;
- AccessPointEmail := APEmailNode.AsXmlElement().InnerText;
-
- RegisteredProfilesErrText += StrSubstNo('%1 //', ProfileDescriptionNode.AsXmlElement().InnerText);
- end;
- end;
-
- if RegisteredProfilesErrText <> '' then begin
- AccessPointErrText := StrSubstNo(AccessPointDetailedErr, AccessPointName, AccessPointEmail, RegisteredProfilesErrText);
- DetailedErrText += StrSubstNo('%1 // //', AccessPointErrText);
- end
- end;
-
- if RegisteredProfilesErrText <> '' then begin
- ErrorInfo.Title := ParticipationAlreadyRegisteredTitleErr;
- ErrorInfo.Message := StrSubstNo(ParticipationAlreadyRegisteredErr, TempParticipation.Network, TempParticipation."Identifier Type Id", TempParticipation."Identifier Value");
- ErrorInfo.DetailedMessage(DetailedErrText);
- Error(ErrorInfo);
- end
- end;
- #endregion
-
- #region Get Documents for E-Document service
- internal procedure GetDocuments(ActivatedNetworkProfile: Record "Continia Activated Net. Prof."; ReceiveContext: Codeunit ReceiveContext): Boolean
- var
- Participation: Record "Continia Participation";
- ApiUrlMgt: Codeunit "Continia Api Url";
- HttpRequest: HttpRequestMessage;
- HttpResponse: HttpResponseMessage;
- CurrPage: Integer;
- PageSize: Integer;
- Success: Boolean;
- begin
- CurrPage := 1;
- PageSize := 100; // only get 100 documents at a time.
-
- Participation.Get(ActivatedNetworkProfile.Network, ActivatedNetworkProfile."Identifier Type Id", ActivatedNetworkProfile."Identifier Value");
-
- Success := ExecuteRequest(
- 'GET',
- ApiUrlMgt.DocumentsFoParticipationProfile(
- ActivatedNetworkProfile.Network,
- Participation.Id,
- ActivatedNetworkProfile.Id,
- CurrPage,
- PageSize,
- true),
- HttpRequest,
- HttpResponse);
- ReceiveContext.Http().SetHttpRequestMessage(HttpRequest);
- ReceiveContext.Http().SetHttpResponseMessage(HttpResponse);
- exit(Success);
- end;
- #endregion
-
- #region Send Documents
- internal procedure SendDocument(EDocument: Record "E-Document"; SendContext: Codeunit SendContext): Boolean
- var
- ConnectionSetup: Record "Continia Connection Setup";
- CredentialManagement: Codeunit "Continia Credential Management";
- Base64Convert: Codeunit "Base64 Convert";
- ApiUrlMgt: Codeunit "Continia Api Url";
- TempBlob: Codeunit "Temp Blob";
- HttpResponse: HttpResponseMessage;
- HttpRequest: HttpRequestMessage;
- ReadStream: InStream;
- HttpContentData: Text;
- DocumentBase64Node: XmlElement;
- RootNode: XmlElement;
- Success: Boolean;
- begin
- ConnectionSetup.Get();
-
- TempBlob := SendContext.GetTempBlob();
-
- RootNode := XmlElement.Create('unprocessed_document_request');
- DocumentBase64Node := XmlElement.Create('base64_data');
- TempBlob.CreateInStream(ReadStream);
- DocumentBase64Node.Add(XmlText.Create(Base64Convert.ToBase64(ReadStream)));
- RootNode.Add(DocumentBase64Node);
-
- RootNode.WriteTo(HttpContentData);
-
- Success := ExecuteRequest('POST', ApiUrlMgt.PostDocumentsUrl(CredentialManagement.GetCompanyId()), HttpContentData, HttpRequest, HttpResponse);
- SendContext.Http().SetHttpRequestMessage(HttpRequest);
- SendContext.Http().SetHttpResponseMessage(HttpResponse);
-
- if Success then begin
- SetEDocumentGuid(EDocument."Entry No", GetDocumentGuid(HttpResponse));
- exit(true);
- end;
- end;
-
- local procedure SetEDocumentGuid(EDocEntryNo: Integer; DocumentId: Guid)
- var
- EDocument: Record "E-Document";
- begin
- if IsNullGuid(DocumentId) then
- exit;
- if not EDocument.Get(EDocEntryNo) then
- exit;
- EDocument."Continia Document Id" := DocumentId;
- EDocument.Modify();
- end;
-
- local procedure GetDocumentGuid(var HttpResponse: HttpResponseMessage) DocumentGuid: Guid
- var
- ResponseBody: Text;
- ResponseXmlDoc: XmlDocument;
- DocumentGuidNode: XmlNode;
- begin
- HttpResponse.Content.ReadAs(ResponseBody);
- if ResponseBody = '' then
- exit;
-
- XmlDocument.ReadFrom(ResponseBody, ResponseXmlDoc);
- ResponseXmlDoc.SelectSingleNode('/id_result/id', DocumentGuidNode);
- Evaluate(DocumentGuid, DocumentGuidNode.AsXmlElement().InnerText);
- exit(DocumentGuid);
- end;
- #endregion
-
- #region Get Technical response
- internal procedure GetTechnicalResponse(var EDocument: Record "E-Document"; SendContext: Codeunit SendContext): Boolean
- var
- ApiUrlMgt: Codeunit "Continia Api Url";
- EDocumentErrorHelper: Codeunit "E-Document Error Helper";
- SuccessfulStatusTok: Label 'SuccessEnum', Locked = true;
- ErrorStatusTok: Label 'ErrorEnum', Locked = true;
- DocumentStatus: Text;
- EDocumentDescription: Text;
- ResponseBody: Text;
- ResponseXmlDoc: XmlDocument;
- DocumentStatusNode: XmlNode;
- ErrorCodeNode: XmlNode;
- ErrorMessageNode: XmlNode;
- TechnicalResponseNode: XmlNode;
- HttpRequest: HttpRequestMessage;
- HttpResponse: HttpResponseMessage;
- Success: Boolean;
- begin
- Success := ExecuteRequest('GET', ApiUrlMgt.TechnicalResponseUrl(EDocument."Continia Document Id"), HttpRequest, HttpResponse);
- SendContext.Http().SetHttpRequestMessage(HttpRequest);
- SendContext.Http().SetHttpResponseMessage(HttpResponse);
- if Success then begin
- HttpResponse.Content.ReadAs(ResponseBody);
- if ResponseBody = '' then
- exit(false);
-
- XmlDocument.ReadFrom(ResponseBody, ResponseXmlDoc);
- ResponseXmlDoc.SelectSingleNode('/technical_response', TechnicalResponseNode);
-
- if not TechnicalResponseNode.SelectSingleNode('document_status', DocumentStatusNode) then
- exit(false);
-
- DocumentStatus := DocumentStatusNode.AsXmlElement().InnerText;
- case DocumentStatus of
- SuccessfulStatusTok:
- begin
- MarkDocumentAsProcessed(EDocument."Continia Document Id");
- exit(true);
- end;
- ErrorStatusTok:
- begin
- if TechnicalResponseNode.SelectSingleNode('error_code', ErrorCodeNode) and TechnicalResponseNode.SelectSingleNode('error_message', ErrorMessageNode) then
- EDocumentDescription := StrSubstNo('%1 - %2', ErrorCodeNode.AsXmlElement().InnerText, ErrorMessageNode.AsXmlElement().InnerText);
- EDocumentErrorHelper.LogSimpleErrorMessage(EDocument, EDocumentDescription);
- MarkDocumentAsProcessed(EDocument."Continia Document Id");
- exit(false);
- end;
- end;
- exit(false);
- end;
- end;
- #endregion;
-
- #region Get Document Business Responses
- internal procedure GetBusinessResponses(DocumentGuid: Guid; ActionContext: Codeunit ActionContext): Boolean
- var
- ApiUrlMgt: Codeunit "Continia Api Url";
- HttpRequest: HttpRequestMessage;
- HttpResponse: HttpResponseMessage;
- Success: Boolean;
- begin
- Success := ExecuteRequest('GET', ApiUrlMgt.BusinessResponseUrl(DocumentGuid), HttpRequest, HttpResponse);
- ActionContext.Http().SetHttpRequestMessage(HttpRequest);
- ActionContext.Http().SetHttpResponseMessage(HttpResponse);
- exit(Success);
- end;
- #endregion
-
- #region Perform actions on document
- // Cancel document
- internal procedure CancelDocument(DocumentGuid: Guid; ActionContext: Codeunit ActionContext): Boolean
- var
- HttpRequest: HttpRequestMessage;
- HttpResponse: HttpResponseMessage;
- Success: Boolean;
- begin
- Success := PerformActionOnDocument(DocumentGuid, 'CancelEnum', HttpRequest, HttpResponse);
- if Success then
- ActionContext.Status().SetStatus(Enum::"E-Document Service Status"::Canceled);
-
- ActionContext.Http().SetHttpRequestMessage(HttpRequest);
- ActionContext.Http().SetHttpResponseMessage(HttpResponse);
- exit(Success);
- end;
-
- // Mark document as processed
- internal procedure MarkDocumentAsProcessed(DocumentGuid: Guid): Boolean
- var
- ReceiveContext: Codeunit ReceiveContext;
- begin
- exit(MarkDocumentAsProcessed(DocumentGuid, ReceiveContext));
- end;
-
- internal procedure MarkDocumentAsProcessed(DocumentGuid: Guid; ReceiveContext: Codeunit ReceiveContext): Boolean
- var
- HttpRequest: HttpRequestMessage;
- HttpResponse: HttpResponseMessage;
- Success: Boolean;
- begin
- Success := PerformActionOnDocument(DocumentGuid, 'MarkAsProcessedEnum', HttpRequest, HttpResponse);
- ReceiveContext.Http().SetHttpRequestMessage(HttpRequest);
- ReceiveContext.Http().SetHttpResponseMessage(HttpResponse);
- exit(Success);
- end;
-
- internal procedure PerformActionOnDocument(DocumentGuid: Guid; Action: Text; var HttpRequest: HttpRequestMessage; var HttpResponse: HttpResponseMessage): Boolean
- var
- ApiUrlMgt: Codeunit "Continia Api Url";
- HttpContentData: Text;
- ActionNode: XmlElement;
- RootNode: XmlElement;
- begin
- RootNode := XmlElement.Create('document_action_request');
-
- ActionNode := XmlElement.Create('action');
- ActionNode.Add(XmlText.Create(Action));
- RootNode.Add(ActionNode);
-
- RootNode.WriteTo(HttpContentData);
-
- exit(ExecuteRequest('POST', ApiUrlMgt.DocumentActionUrl(DocumentGuid), HttpContentData, HttpRequest, HttpResponse));
- end;
- #endregion
-
- #region Helper functions
- internal procedure DownloadFileFromUrl(Url: Text; ReceiveContext: Codeunit ReceiveContext)
- var
- HttpClient: HttpClient;
- ReadStream: InStream;
- WriteStream: OutStream;
- HttpRequest: HttpRequestMessage;
- HttpResponse: HttpResponseMessage;
- Success: Boolean;
- begin
- Success := HttpClient.Get(Url, HttpResponse);
- ReceiveContext.Http().SetHttpRequestMessage(HttpRequest);
- ReceiveContext.Http().SetHttpResponseMessage(HttpResponse);
- if not Success then
- exit;
- ReceiveContext.GetTempBlob().CreateOutStream(WriteStream);
- HttpResponse.Content.ReadAs(ReadStream);
- CopyStream(WriteStream, ReadStream);
- end;
-
- local procedure ExecuteRequest(Method: Text; Url: Text; var HttpRequest: HttpRequestMessage; var HttpResponse: HttpResponseMessage): Boolean
- var
- HttpContentData: Text;
- begin
- exit(ExecuteRequest(Method, Url, HttpContentData, HttpRequest, HttpResponse));
- end;
-
- local procedure ExecuteRequest(Method: Text; Url: Text; var HttpResponse: HttpResponseMessage): Boolean
- var
- HttpRequest: HttpRequestMessage;
- HttpContentData: Text;
- begin
- exit(ExecuteRequest(Method, Url, HttpContentData, HttpRequest, HttpResponse));
- end;
-
- local procedure ExecuteRequest(Method: Text; Url: Text; HttpContentData: Text; var HttpResponse: HttpResponseMessage): Boolean
- var
- HttpRequest: HttpRequestMessage;
- begin
- exit(ExecuteRequest(Method, Url, HttpContentData, HttpRequest, HttpResponse));
- end;
-
- local procedure ExecuteRequest(Method: Text; Url: Text; HttpContentData: Text; var HttpRequest: HttpRequestMessage; var HttpResponse: HttpResponseMessage): Boolean
- var
- SessionManager: Codeunit "Continia Session Manager";
- HttpClient: HttpClient;
- HttpContent: HttpContent;
- HttpContentHeaders: HttpHeaders;
- HttpHeaders: HttpHeaders;
- AccessTokenValue: SecretText;
- begin
- HttpRequest.GetHeaders(HttpHeaders);
- AccessTokenValue := SecretStrSubstNo('Bearer %1', SessionManager.GetAccessToken());
-
- HttpHeaders.Add('Authorization', AccessTokenValue);
- HttpHeaders.Add('Accept', 'application/xml;charset=utf-8');
- HttpRequest.Method(Method);
- HttpRequest.SetRequestUri(Url);
-
- if HttpContentData <> '' then begin
- HttpContent.WriteFrom(HttpContentData);
- HttpContent.GetHeaders(HttpContentHeaders);
- if HttpContentHeaders.Contains('Content-Type') then
- HttpContentHeaders.Remove('Content-Type');
- HttpContentHeaders.Add('Content-Type', 'application/xml');
- HttpRequest.Content := HttpContent;
- end;
-
- if HttpClient.Send(HttpRequest, HttpResponse) then
- exit(HandleApiError(HttpResponse));
- end;
-
- local procedure GetRecordsCount(var HttpResponse: HttpResponseMessage) Count: Integer
- var
- ResponseHeaders: HttpHeaders;
- HeaderValues: List of [Text];
- begin
- ResponseHeaders := HttpResponse.Headers();
- if not ResponseHeaders.Contains('X-Total-Count') then
- exit;
-
- ResponseHeaders.GetValues('X-Total-Count', HeaderValues);
- Evaluate(Count, HeaderValues.Get(1));
- end;
-
- internal procedure HandleApiError(var HttpResponse: HttpResponseMessage): Boolean
- var
- HttpStatusCode: Integer;
- ResponseBody: Text;
- ResponseBodyXML: XmlDocument;
- begin
- HttpStatusCode := HttpResponse.HttpStatusCode;
- if HttpStatusCode in [200, 201, 202] then
- exit(true);
-
- HttpResponse.Content().ReadAs(ResponseBody);
- if ResponseBody <> '' then
- if not XmlDocument.ReadFrom(ResponseBody, ResponseBodyXML) then
- exit(ThrowError(UnexpectedApiErr));
-
- ReadErrorResponse(ResponseBodyXML, HttpStatusCode);
- end;
-
- internal procedure ReadErrorResponse(var ResponseXML: XmlDocument; HttpStatusCode: Integer): Boolean
- var
- ApiErrorCode: Text;
- ApiErrorMessage: Text;
- ErrorCodeNode: XmlNode;
- ErrorMessageNode: XmlNode;
- begin
- if not ResponseXML.SelectSingleNode('/error/code', ErrorCodeNode) then
- exit(ThrowError(UnexpectedApiErr));
-
- if not ResponseXML.SelectSingleNode('/error/message', ErrorMessageNode) then
- exit(ThrowError(UnexpectedApiErr));
-
- ApiErrorCode := ErrorCodeNode.AsXmlElement().InnerText;
- ApiErrorMessage := ErrorMessageNode.AsXmlElement().InnerText;
-
- case HttpStatusCode of
- 500, 501:
- exit(ThrowError(StrSubstNo(Error500Err, ApiErrorCode, ApiErrorMessage)));
- 400, 401, 402, 404, 409, 422:
- exit(ThrowError(StrSubstNo(ApiErr, ApiErrorCode, ApiErrorMessage)));
- else
- exit(ThrowError(UnexpectedApiErr));
- end;
- end;
-
- local procedure ThrowError(ErrorMsg: Text): Boolean
- begin
- if SuppressError then
- exit;
-
- Error(ErrorMsg);
- end;
-
- local procedure GetCurrentCountryCode(): Code[10]
- var
- CompanyInformation: Record "Company Information";
- CountryRegion: Record "Country/Region";
- begin
- CompanyInformation.Get();
- if CompanyInformation."Country/Region Code" = '' then
- exit('');
-
- if CountryRegion.Get(CompanyInformation."Country/Region Code") then
- exit(CountryRegion."ISO Code");
- end;
-
- internal procedure GetGuidAsText(Value: Guid): Text[36]
- begin
- exit(CopyStr(Format(Value, 0, 4), 1, 36))
- end;
-
- internal procedure SetSuppressError(NewSuppressError: Boolean)
- begin
- SuppressError := NewSuppressError;
- end;
- #endregion
-
- var
- SuppressError: Boolean;
- AccessPointDetailedErr: Label 'Access Point: %1// Contact Email: %2// Registered Profiles://%3', Comment = '%1 = Access Point Name, %2 = Access Point Email, %3 = Registered Profiles';
- ApiErr: Label 'The Continia Delivery Network API returned the following error: Error Code %1 - %2', Comment = '%1 = Continia Delivery Network Error Code, %2 = Error Message';
- Error500Err: Label 'The Continia Delivery Network API returned the following system error: Error Code %1 - %2', Comment = '%1 = Continia Delivery Network Error Code, %2 = Error Message';
- ParticipationAlreadyRegisteredErr: Label 'There is already a registration in %1 network with the identifier type %2 and value %3.', Comment = '%1 = Network Name, %2 = Identifier Type, %3 = Identifier Value';
- ParticipationAlreadyRegisteredTitleErr: Label 'Registration Already Exists';
- UnexpectedApiErr: Label 'There was an unexpected error while communicating with the Continia Delivery Network API.';
-
-
-}
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/app/src/API Requests/ContiniaApiUrl.Codeunit.al b/Apps/W1/EDocumentConnectors/Continia/app/src/API Requests/ContiniaApiUrl.Codeunit.al
deleted file mode 100644
index ceeadad542..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/app/src/API Requests/ContiniaApiUrl.Codeunit.al
+++ /dev/null
@@ -1,241 +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.EServices.EDocumentConnector.Continia;
-
-using System.Environment;
-
-codeunit 6392 "Continia Api Url"
-{
- Access = Internal;
-
- internal procedure NetworkProfilesUrl(Network: Enum "Continia E-Delivery Network"; Page: Integer; PageSize: Integer): Text
- var
- ProfilesUrlLbl: Label '%1/networks/%2/profiles.xml?page=%3&page_size=%4', Locked = true;
- begin
- exit(StrSubstNo(ProfilesUrlLbl, CdnBaseUrl(), GetNetworkNameAsText(Network), Page, PageSize));
- end;
-
- internal procedure NetworkIdentifiersUrl(Network: Enum "Continia E-Delivery Network"; Page: Integer; PageSize: Integer): Text
- var
- IdentifiersUrlLbl: Label '%1/networks/%2/id_types.xml?page=%3&page_size=%4', Locked = true;
- begin
- exit(StrSubstNo(IdentifiersUrlLbl, CdnBaseUrl(), GetNetworkNameAsText(Network), Page, PageSize));
- end;
-
- internal procedure ParticipationUrl(Network: Enum "Continia E-Delivery Network"): Text
- var
- ParticipationUrlLbl: Label '%1/networks/%2/participations.xml', Locked = true;
- begin
- exit(StrSubstNo(ParticipationUrlLbl, CdnBaseUrl(), GetNetworkNameAsText(Network)))
- end;
-
- internal procedure SingleParticipationUrl(Network: Enum "Continia E-Delivery Network"; ParticipationGuid: Guid): Text
- var
- SingleParticipationUrlLbl: Label '%1/networks/%2/participations/%3.xml', Locked = true;
- begin
- exit(StrSubstNo(SingleParticipationUrlLbl, CdnBaseUrl(), GetNetworkNameAsText(Network), GetGuidAsText(ParticipationGuid)))
- end;
-
- internal procedure ParticipationProfilesUrl(Network: Enum "Continia E-Delivery Network"; ParticipationGuid: Guid): Text
- var
- ParticipationProfilesUrlLbl: Label '%1/networks/%2/participations/%3/profiles.xml', Locked = true;
- begin
- exit(StrSubstNo(ParticipationProfilesUrlLbl, CdnBaseUrl(), GetNetworkNameAsText(Network), GetGuidAsText(ParticipationGuid)))
- end;
-
- internal procedure ParticipationProfilesUrl(Network: Enum "Continia E-Delivery Network"; ParticipationGuid: Guid; Page: Integer; PageSize: Integer): Text
- var
- ParticipationProfilesUrlPagesLbl: Label '%1/networks/%2/participations/%3/profiles.xml?page=%4&page_size=%5', Locked = true;
- begin
- exit(StrSubstNo(ParticipationProfilesUrlPagesLbl, CdnBaseUrl(), GetNetworkNameAsText(Network), GetGuidAsText(ParticipationGuid), Page, PageSize))
- end;
-
- internal procedure SingleParticipationProfileUrl(Network: Enum "Continia E-Delivery Network"; ParticipationGuid: Guid; ProfileGuid: Guid): Text
- var
- SingleParticipationProfileUrlLbl: Label '%1/networks/%2/participations/%3/profiles/%4.xml', Locked = true;
- begin
- exit(StrSubstNo(SingleParticipationProfileUrlLbl, CdnBaseUrl(), GetNetworkNameAsText(Network), GetGuidAsText(ParticipationGuid), GetGuidAsText(ProfileGuid)))
- end;
-
- internal procedure ParticipationLookupUrl(Network: Enum "Continia E-Delivery Network"; IdType: Text[4]; IdValue: Text[50]): Text
- var
- ParticipationLookupUrlLbl: Label '%1/networks/%2/participation_lookups.xml?id_type=%3&id_value=%4', Locked = true;
- begin
- exit(StrSubstNo(ParticipationLookupUrlLbl, CdnBaseUrl(), GetNetworkNameAsText(Network), IdType, IdValue))
- end;
-
- internal procedure DocumentsFoParticipationProfile(Network: Enum "Continia E-Delivery Network"; ParticipationGuid: Guid; ProfileGuid: Guid; Page: Integer; PageSize: Integer; Incoming: Boolean): Text
- var
- DirectionQueryTxt: Text;
- DocumentsForParticipationProfileUrlLbl: Label '%1/networks/%2/participations/%3/profiles/%4/documents.xml?page=%5&page_size=%6&direction=%7', Locked = true;
- begin
- if Incoming then
- DirectionQueryTxt := 'IncomingEnum'
- else
- DirectionQueryTxt := 'OutgoingEnum';
- exit(StrSubstNo(
- DocumentsForParticipationProfileUrlLbl,
- CdnBaseUrl(),
- Network,
- GetGuidAsText(ParticipationGuid),
- GetGuidAsText(ProfileGuid),
- Page,
- PageSize,
- DirectionQueryTxt));
- end;
-
- internal procedure DocumentActionUrl(DocumentGuid: Guid): Text
- var
- DocumentActionUrlLbl: Label '%1/documents/%2/action.xml', Locked = true;
- begin
- exit(StrSubstNo(DocumentActionUrlLbl, CdnBaseUrl(), GetGuidAsText(DocumentGuid)))
- end;
-
- internal procedure PostDocumentsUrl(CompanyGuid: Guid): Text
- var
- PostDocumentsUrlLbl: Label '%1/documents.xml?business_central_company_code=%2', Locked = true;
- begin
- exit(StrSubstNo(PostDocumentsUrlLbl, CdnBaseUrl(), GetGuidAsText(CompanyGuid)))
- end;
-
- internal procedure TechnicalResponseUrl(DocumentGuid: Guid): Text
- var
- TechnicalResponseUrlLbl: Label '%1/documents/%2/technical_response.xml', Locked = true;
- begin
- exit(StrSubstNo(TechnicalResponseUrlLbl, CdnBaseUrl(), GetGuidAsText(DocumentGuid)))
- end;
-
- internal procedure BusinessResponseUrl(DocumentGuid: Guid): Text
- var
- BusinessResponseUrlLbl: Label '%1/documents/%2/business_responses.xml', Locked = true;
- begin
- exit(StrSubstNo(BusinessResponseUrlLbl, CdnBaseUrl(), GetGuidAsText(DocumentGuid)))
- end;
-
- internal procedure PartnerAccessTokenUrl(): Text
- var
- PartnerAccessTokenUrlLbl: Label '%1/partner/PartnerZoneLogin', Locked = true;
- begin
- exit(StrSubstNo(PartnerAccessTokenUrlLbl, COBaseUrl()));
- end;
-
- internal procedure PartnerZoneUrl(): Text
- var
- PartnerAccessTokenUrlLbl: Label '%1/partner/PartnerZoneConnect', Locked = true;
- begin
- exit(StrSubstNo(PartnerAccessTokenUrlLbl, COBaseUrl()));
- end;
-
- internal procedure ClientAccessTokenUrl(): Text
- var
- ClientAccessTokenUrlLbl: Label '%1/oauth/token/', Locked = true;
- begin
- exit(StrSubstNo(ClientAccessTokenUrlLbl, COBaseUrl()));
- end;
-
- internal procedure ClientEnvironmentInitializeUrl(): Text
- var
- ClientEnvironmentInitializeUrlLbl: Label '%1/core/initializeV3', Locked = true;
- begin
- exit(StrSubstNo(ClientEnvironmentInitializeUrlLbl, COBaseUrl()));
- end;
-
- internal procedure UpdateSubscriptionUrl(): Text
- var
- UpdateSubscriptionUrlLbl: Label '%1/core/UpdateSubscription', Locked = true;
- begin
- exit(StrSubstNo(UpdateSubscriptionUrlLbl, COBaseUrl()));
- end;
-
- internal procedure GetSubscriptionUrl(): Text
- var
- GetSubscriptionUrlLbl: Label '%1/core/GetSubscriptions', Locked = true;
- begin
- exit(StrSubstNo(GetSubscriptionUrlLbl, COBaseUrl()));
- end;
-
- internal procedure GetAcceptCompanyLicenseUrl(): Text
- var
- GetAcceptCompanyLicenseUrlLbl: Label '%1/core/AcceptCompanyLicense', Locked = true;
- begin
- exit(StrSubstNo(GetAcceptCompanyLicenseUrlLbl, COBaseUrl()));
- end;
-
- internal procedure GetUpdateCompanyInfoUrl(): Text
- var
- GetUpdateCompanyInfoUrlLbl: Label '%1/core/UpdateInvoicingInformation', Locked = true;
- begin
- exit(StrSubstNo(GetUpdateCompanyInfoUrlLbl, COBaseUrl()));
- end;
-
- local procedure COBaseUrl() Url: Text
- var
- Handled: Boolean;
- begin
- OnGetCOBaseUrl(Url, Handled);
- if Handled then
- exit(Url);
-
- exit('https://auth.continiaonline.com/api/v1');
- end;
-
-
- internal procedure CdnBaseUrl() Url: Text
- var
- EnvironmentInformation: Codeunit "Environment Information";
- Handled: Boolean;
- LocalizedBaseUrl: Text;
- begin
- OnGetCdnBaseUrl(Url, Handled);
- if Handled then
- exit(Url);
-
- LocalizedBaseUrl := GetBaseUrlForLocalization(EnvironmentInformation.GetApplicationFamily());
- if LocalizedBaseUrl <> '' then
- exit(LocalizedBaseUrl)
- else
- exit('https://cdnapi.continiaonline.com/api/v1.0');
-
- end;
-
- local procedure GetBaseUrlForLocalization(Localization: Text): Text
- begin
- OnBeforeGetBaseUrlForLocalization(Localization);
-
- case Localization of
- 'NZ', 'AU':
- exit('https://aue-cdnapi.continiaonline.com/api/v1.0/');
- 'NL':
- exit('https://weu-cdnapi.continiaonline.com/api/v1.0/');
- end;
- end;
-
- internal procedure GetNetworkNameAsText(NetworkName: Enum "Continia E-Delivery Network"): Text
- begin
- exit(NetworkName.Names.Get(NetworkName.Ordinals.IndexOf(NetworkName.AsInteger())).ToLower());
- end;
-
- internal procedure GetGuidAsText(Value: Guid): Text[36]
- begin
- exit(CopyStr(DelChr(Value, '<>', '{}'), 1, 36))
- end;
-
-
- [IntegrationEvent(false, false)]
- local procedure OnGetCOBaseUrl(var ReturnUrl: Text; var Handled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnGetCdnBaseUrl(var ReturnUrl: Text; var Handled: Boolean)
- begin
- end;
-
- [IntegrationEvent(false, false)]
- local procedure OnBeforeGetBaseUrlForLocalization(var Localization: Text)
- begin
- end;
-
-}
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/app/src/ContiniaIntegration.EnumExt.al b/Apps/W1/EDocumentConnectors/Continia/app/src/ContiniaIntegration.EnumExt.al
deleted file mode 100644
index bb88f757df..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/app/src/ContiniaIntegration.EnumExt.al
+++ /dev/null
@@ -1,16 +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.EServices.EDocumentConnector.Continia;
-
-using Microsoft.eServices.EDocument.Integration;
-using Microsoft.eServices.EDocument.Integration.Interfaces;
-
-enumextension 6390 "Continia Integration" extends "Service Integration"
-{
- value(6390; Continia)
- {
- Implementation = IDocumentSender = "Continia Integration Impl.", IDocumentReceiver = "Continia Integration Impl.";
- }
-}
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/app/src/Implementation/ContiniaConnectionSetup.Table.al b/Apps/W1/EDocumentConnectors/Continia/app/src/Implementation/ContiniaConnectionSetup.Table.al
deleted file mode 100644
index e09f2e0ecb..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/app/src/Implementation/ContiniaConnectionSetup.Table.al
+++ /dev/null
@@ -1,193 +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.EServices.EDocumentConnector.Continia;
-
-table 6390 "Continia Connection Setup"
-{
- Access = Internal;
- DataClassification = CustomerContent;
- DataPerCompany = false;
- Extensible = false;
-
- fields
- {
- field(1; PK; Code[10])
- {
- Caption = 'Primary Key';
- }
- field(3; "Client Id"; Guid)
- {
- Caption = 'Client Id';
- DataClassification = EndUserIdentifiableInformation;
- }
- field(4; "Client Secret"; Guid)
- {
- Caption = 'Client Secret';
- DataClassification = EndUserIdentifiableInformation;
- }
- field(5; "Local Client Identifier"; Code[50])
- {
- Caption = 'Local Client Identifier';
- DataClassification = EndUserIdentifiableInformation;
- Editable = false;
- }
- field(6; "Access Token"; Guid)
- {
- Caption = 'Access Token';
- }
- field(7; "Token Timestamp"; DateTime)
- {
- Caption = 'Token Timestamp';
- }
- field(8; "Expires In (ms)"; Integer)
- {
- Caption = 'Expires In (ms)';
- }
- field(9; "Subscription Status"; Enum "Continia Subscription Status")
- {
- Caption = 'Subscription Status';
- ToolTip = 'Specifies the status of the Continia subscription.';
- }
- field(10; "No. Of Participations"; Integer)
- {
- CalcFormula = count("Continia Participation");
- Caption = 'No. Of Participations';
- Editable = false;
- FieldClass = FlowField;
- ToolTip = 'Specifies the number of participations for the current company in the Continia Delivery Network.';
- }
- }
-
- keys
- {
- key(Key1; PK)
- {
- Clustered = true;
- }
- }
-
- internal procedure GetClientId(): SecretText
- var
- CredentialManagement: Codeunit "Continia Credential Management";
- begin
- exit(CredentialManagement.GetIsolatedStorageValue("Client Id", DataScope::Module));
- end;
-
- internal procedure GetClientSecret(): SecretText
- var
- CredentialManagement: Codeunit "Continia Credential Management";
- begin
- exit(CredentialManagement.GetIsolatedStorageValue("Client Secret", DataScope::Module));
- end;
-
- internal procedure SetClientId(Value: SecretText) UsedNewKey: Boolean
- var
- CredentialManagement: Codeunit "Continia Credential Management";
- begin
- exit(CredentialManagement.SetIsolatedStorageValue("Client Id", Value, DataScope::Module));
- end;
-
- internal procedure SetClientSecret(Value: SecretText) UsedNewKey: Boolean
- var
- CredentialManagement: Codeunit "Continia Credential Management";
- begin
- exit(CredentialManagement.SetIsolatedStorageValue("Client Secret", Value, DataScope::Module));
- end;
-
- internal procedure GetAccessTokenValue(): SecretText
- var
- CredentialManagement: Codeunit "Continia Credential Management";
- begin
- exit(CredentialManagement.GetIsolatedStorageValue("Access Token", DataScope::Module));
- end;
-
- local procedure AccessTokenHasValue(): Boolean
- var
- CredentialManagement: Codeunit "Continia Credential Management";
- begin
- exit(CredentialManagement.HasIsolatedStorageValue("Access Token", DataScope::Module));
- end;
-
- internal procedure SetAccessTokenValue(Value: SecretText) UsedNewKey: Boolean
- var
- CredentialManagement: Codeunit "Continia Credential Management";
- begin
- exit(CredentialManagement.SetIsolatedStorageValue("Access Token", Value, DataScope::Module));
- end;
-
- internal procedure DeleteAccessTokenValue(): Boolean
- var
- CredentialManagement: Codeunit "Continia Credential Management";
- begin
- "Token Timestamp" := 0DT;
- "Expires In (ms)" := 0;
- Modify();
- exit(CredentialManagement.DeleteIsolatedStorageValue("Access Token", DataScope::Module));
- end;
-
- internal procedure ClearToken()
- begin
- if Get() then
- DeleteAccessTokenValue();
- end;
-
- internal procedure AcquireTokenFromCache(var NewAccessTokenValue: SecretText; var NewTokenTimestamp: DateTime; var NewExpiresIn: Integer; var NewNextUpdateInMs: Integer; Refresh: Boolean): Boolean
- var
- TokenExpiresIn: Integer;
- begin
- Clear(NewTokenTimestamp);
- Clear(NewAccessTokenValue);
-
- if Get() then
- if AccessTokenHasValue() then
- if "Token Timestamp" <> 0DT then begin
- if Refresh then
- TokenExpiresIn := GetTokenRefreshRateInMs("Expires In (ms)")
- else
- TokenExpiresIn := GetTokenExpiresInMs("Expires In (ms)");
-
- if ((CurrentDateTime - "Token Timestamp") < TokenExpiresIn) then begin
- NewAccessTokenValue := GetAccessTokenValue();
- NewTokenTimestamp := "Token Timestamp";
- NewExpiresIn := "Expires In (ms)";
- NewNextUpdateInMs := GetTokenRefreshRateInMs("Expires In (ms)");
- exit(true);
- end;
- end;
- end;
-
- internal procedure SetAccessToken(Token: SecretText; ExpiresIn: Integer)
- var
- HasData: Boolean;
- begin
- ReadIsolation := IsolationLevel::UpdLock;
- HasData := Get();
-
- "Token Timestamp" := CurrentDateTime;
- "Expires In (ms)" := GetTokenExpiresInMs(ExpiresIn);
- SetAccessTokenValue(Token);
-
- if HasData then
- Modify()
- else
- Insert();
- end;
-
- local procedure GetTokenRefreshRateInMs(ExpiresIn: Integer): Integer
- var
- RefreshRate: Decimal;
- begin
- RefreshRate := 0.25;
- exit(Round((ExpiresIn * RefreshRate), 100, '='));
- end;
-
- internal procedure GetTokenExpiresInMs(ExpiresIn: Integer): Integer
- var
- RefreshRate: Decimal;
- begin
- RefreshRate := 0.95;
- exit(Round((ExpiresIn * RefreshRate), 100, '='));
- end;
-}
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/app/src/Implementation/ContiniaEDocument.TableExt.al b/Apps/W1/EDocumentConnectors/Continia/app/src/Implementation/ContiniaEDocument.TableExt.al
deleted file mode 100644
index e02cb2156f..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/app/src/Implementation/ContiniaEDocument.TableExt.al
+++ /dev/null
@@ -1,21 +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.EServices.EDocumentConnector.Continia;
-
-using Microsoft.eServices.EDocument;
-
-tableextension 6391 "Continia E-Document" extends "E-Document"
-{
- fields
- {
- field(6391; "Continia Document Id"; Guid)
- {
- DataClassification = CustomerContent;
- Caption = 'Continia Document Id';
- ToolTip = 'Specifies the unique identifier in the Continia Delivery Network.';
- }
- }
-
-}
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/app/src/Implementation/ContiniaEDocumentProcessing.Codeunit.al b/Apps/W1/EDocumentConnectors/Continia/app/src/Implementation/ContiniaEDocumentProcessing.Codeunit.al
deleted file mode 100644
index feffa1565c..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/app/src/Implementation/ContiniaEDocumentProcessing.Codeunit.al
+++ /dev/null
@@ -1,265 +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.EServices.EDocumentConnector.Continia;
-
-using Microsoft.eServices.EDocument;
-using Microsoft.eServices.EDocument.Integration.Receive;
-using Microsoft.eServices.EDocument.Integration.Send;
-using System.Telemetry;
-using System.Utilities;
-
-codeunit 6391 "Continia EDocument Processing"
-{
- Access = Internal;
-
- internal procedure SendEDocument(var EDocument: Record "E-Document"; var EDocumentService: Record "E-Document Service"; SendContext: Codeunit SendContext)
- var
- EDocumentServiceStatus: Record "E-Document Service Status";
- ApiRequests: Codeunit "Continia Api Requests";
- FeatureTelemetry: Codeunit "Feature Telemetry";
- begin
- EDocumentServiceStatus.Get(EDocument."Entry No", EDocumentService.Code);
-
- case EDocumentServiceStatus.Status of
- EDocumentServiceStatus.Status::Exported:
- ApiRequests.SendDocument(EDocument, SendContext);
- EDocumentServiceStatus.Status::"Sending Error":
- if IsNullGuid(EDocument."Continia Document Id") then
- ApiRequests.SendDocument(EDocument, SendContext);
- end;
-
- FeatureTelemetry.LogUptake('0000PCW', ExternalServiceTok, Enum::"Feature Uptake Status"::Used);
- end;
-
- internal procedure GetTechnicalResponse(var EDocument: Record "E-Document"; SendContext: Codeunit SendContext): Boolean
- var
- ApiRequests: Codeunit "Continia Api Requests";
- begin
- ApiRequests.SetSuppressError(true);
-
- exit(ApiRequests.GetTechnicalResponse(EDocument, SendContext));
- end;
-
- internal procedure GetLastDocumentBusinessResponses(var EDocument: Record "E-Document"; ActionContext: Codeunit ActionContext) Updated: Boolean
- var
- ApiRequests: Codeunit "Continia Api Requests";
- EDocumentErrorHelper: Codeunit "E-Document Error Helper";
- Success: Boolean;
- StatusDescription: Text;
- begin
- ApiRequests.SetSuppressError(true);
- Success := ApiRequests.GetBusinessResponses(EDocument."Continia Document Id", ActionContext);
- if not Success then
- exit(false);
-
- if IsDocumentApproved(ActionContext.Http().GetHttpResponseMessage()) then begin
- ActionContext.Status().SetStatus(Enum::"E-Document Service Status"::Approved);
- exit(true);
- end;
-
- if IsDocumentRejected(ActionContext.Http().GetHttpResponseMessage(), StatusDescription) then begin
- ActionContext.Status().SetStatus(Enum::"E-Document Service Status"::Rejected);
- if StatusDescription <> '' then
- EDocumentErrorHelper.LogWarningMessage(EDocument, EDocument, EDocument."Entry No", StatusDescription);
- exit(true);
- end;
- end;
-
- local procedure IsDocumentApproved(HttpResponse: HttpResponseMessage): Boolean
- var
- ResponseCode: Text;
- StatusDescription: Text;
- BusinessResponses: XmlNodeList;
- BusinessResponseNode: XmlNode;
- i: Integer;
- IsApproved: Boolean;
- begin
- if not GetBusinessResponses(HttpResponse, BusinessResponses) then
- exit(false);
-
- for i := 1 to BusinessResponses.Count do begin
- BusinessResponses.Get(i, BusinessResponseNode);
- ResponseCode := GetResponseCodeFromBusinessResponse(BusinessResponseNode, StatusDescription);
- if IsResponseCodeRejected(ResponseCode) then
- exit(false);
-
- if IsResponseCodeApproved(ResponseCode) then
- IsApproved := true;
- end;
-
- exit(IsApproved);
- end;
-
- local procedure IsDocumentRejected(HttpResponse: HttpResponseMessage; var StatusDescription: Text): Boolean
- var
- BusinessResponses: XmlNodeList;
- BusinessResponseNode: XmlNode;
- ResponseCode: Text;
- i: Integer;
- begin
- if not GetBusinessResponses(HttpResponse, BusinessResponses) then
- exit(false);
-
- for i := 1 to BusinessResponses.Count do begin
- BusinessResponses.Get(i, BusinessResponseNode);
- ResponseCode := GetResponseCodeFromBusinessResponse(BusinessResponseNode, StatusDescription);
- if IsResponseCodeRejected(ResponseCode) then
- exit(true);
- end;
- end;
-
- local procedure GetResponseCodeFromBusinessResponse(BusinessResponseNode: XmlNode; var StatusDescription: Text) ResponseCode: Text
- var
- TempNode: XmlNode;
- Reason: Text;
- ReasonCode: Text;
- begin
- if BusinessResponseNode.SelectSingleNode('response_code', TempNode) then
- ResponseCode := TempNode.AsXmlElement().InnerText;
-
- if BusinessResponseNode.SelectSingleNode('reason_code', TempNode) then
- ReasonCode := TempNode.AsXmlElement().InnerText;
-
- if BusinessResponseNode.SelectSingleNode('reason', TempNode) then
- Reason := TempNode.AsXmlElement().InnerText;
-
- if (ReasonCode = '') and (Reason = '') then begin
- if IsResponseCodeRejected(ResponseCode) then
- StatusDescription := UnknownRejectionReasonErr
- end else
- StatusDescription := StrSubstNo(ReasonLbl, ReasonCode, Reason);
- end;
-
- local procedure GetBusinessResponses(HttpResponse: HttpResponseMessage; var BusinessResponses: XmlNodeList): Boolean
- var
- ResponseBody: Text;
- ResponseXmlDoc: XmlDocument;
- begin
- HttpResponse.Content.ReadAs(ResponseBody);
- if ResponseBody = '' then
- exit(false);
-
- XmlDocument.ReadFrom(ResponseBody, ResponseXmlDoc);
-
- if not ResponseXmlDoc.SelectNodes('/document_business_responses/document_business_response', BusinessResponses) then
- exit(false);
-
- exit(BusinessResponses.Count > 0)
- end;
-
- local procedure IsResponseCodeApproved(ResponseCode: Text): Boolean
- begin
- exit(ResponseCode in ['AP', 'CA', 'PD', 'BusinessAccept']);
- end;
-
- local procedure IsResponseCodeRejected(ResponseCode: Text): Boolean
- begin
- exit(ResponseCode in ['RE', 'BusinessReject']);
- end;
-
- internal procedure ReceiveDocuments(var EDocumentService: Record "E-Document Service"; ReceivedEDocuments: Codeunit "Temp Blob List"; ReceiveContext: Codeunit ReceiveContext)
- var
- ActivatedNetworkProfile: Record "Continia Activated Net. Prof.";
- begin
- ActivatedNetworkProfile.SetRange("E-Document Service Code", EDocumentService.Code);
- if not ActivatedNetworkProfile.FindSet() then
- exit;
- repeat
- ReceiveNetworkProfileDocuments(ActivatedNetworkProfile, ReceivedEDocuments, ReceiveContext);
- until ActivatedNetworkProfile.Next() = 0;
- end;
-
- local procedure ReceiveNetworkProfileDocuments(ActivatedNetworkProfile: Record "Continia Activated Net. Prof."; ReceivedEDocuments: Codeunit "Temp Blob List"; ReceiveContext: Codeunit ReceiveContext)
- var
- ApiRequests: Codeunit "Continia Api Requests";
- TempBlob: Codeunit "Temp Blob";
- OutStream: OutStream;
- ContentData: Text;
- DocumentResponse: XmlDocument;
- DocumentNodeList: XmlNodeList;
- DocumentNode: XmlNode;
- i: Integer;
- begin
- if not ApiRequests.GetDocuments(ActivatedNetworkProfile, ReceiveContext) then
- exit;
-
- ReceiveContext.Http().GetHttpResponseMessage().Content.ReadAs(ContentData);
-
- if not XmlDocument.ReadFrom(ContentData, DocumentResponse) then
- exit;
-
- if not DocumentResponse.SelectNodes('/documents/document', DocumentNodeList) then
- exit;
-
- for i := 1 to DocumentNodeList.Count do begin
- DocumentNodeList.Get(i, DocumentNode);
- Clear(TempBlob);
- TempBlob.CreateOutStream(OutStream, TextEncoding::UTF8);
- DocumentNode.WriteTo(OutStream);
- ReceivedEDocuments.Add(TempBlob);
- end;
- end;
-
- internal procedure DownloadDocument(var EDocument: Record "E-Document"; var EDocumentService: Record "E-Document Service"; DocumentMetadata: Codeunit "Temp Blob"; ReceiveContext: Codeunit ReceiveContext)
- var
- ApiRequests: Codeunit "Continia Api Requests";
- XMLFileToken: Text;
- XmlDocNode: XmlNode;
- XMLFileTokenNode: XmlNode;
- XMLDocumentIdNode: XmlNode;
- InStream: InStream;
- DocumentInfoXml: XmlDocument;
- CurrentEDocumentNode: XmlNode;
- begin
- DocumentMetadata.CreateInStream(InStream, TextEncoding::UTF8);
- XmlDocument.ReadFrom(InStream, DocumentInfoXml);
- DocumentInfoXml.SelectSingleNode('document', CurrentEDocumentNode);
-
- CurrentEDocumentNode.SelectSingleNode('document_id', XMLDocumentIdNode);
- Evaluate(EDocument."Continia Document Id", XMLDocumentIdNode.AsXmlElement().InnerText);
- EDocument.Modify();
-
- CurrentEDocumentNode.SelectSingleNode('xml_document', XmlDocNode);
- XmlDocNode.SelectSingleNode('file_token', XMLFileTokenNode);
- XMLFileToken := XMLFileTokenNode.AsXmlElement().InnerText;
-
- // Download XML file from XMLFileToken and save to TempBlob
- ApiRequests.DownloadFileFromUrl(XMLFileToken, ReceiveContext);
- end;
-
- internal procedure MarkFetched(var EDocument: Record "E-Document"; var EDocumentService: Record "E-Document Service"; var DocumentBlob: Codeunit "Temp Blob"; ReceiveContext: Codeunit ReceiveContext)
- var
- ApiRequests: Codeunit "Continia Api Requests";
- begin
- // Mark document as processed in Continia Online
- ApiRequests.MarkDocumentAsProcessed(EDocument."Continia Document Id", ReceiveContext);
- end;
-
- internal procedure GetCancellationStatus(var EDocument: Record "E-Document"; var EDocumentService: Record "E-Document Service"; ActionContext: Codeunit ActionContext) Success: Boolean
- var
- ApiRequests: Codeunit "Continia Api Requests";
- begin
- exit(ApiRequests.CancelDocument(EDocument."Continia Document Id", ActionContext));
- end;
-
- [EventSubscriber(ObjectType::Page, Page::"E-Document Service", OnAfterValidateEvent, "Service Integration V2", true, true)]
- local procedure OnAfterValidateServiceIntegration(var Rec: Record "E-Document Service")
- begin
- if Rec."Service Integration V2" <> Rec."Service Integration V2"::Continia then
- exit;
- end;
-
- [EventSubscriber(ObjectType::Page, Page::"E-Document Service", OnAfterValidateEvent, "Export Format", true, true)]
- local procedure OnAfterValidateDocumentFormat(var Rec: Record "E-Document Service")
- begin
- if Rec."Service Integration V2" <> Rec."Service Integration V2"::Continia then
- exit;
- end;
-
- var
- ExternalServiceTok: Label 'ExternalServiceConnector', Locked = true;
- UnknownRejectionReasonErr: Label 'Unknown rejection reason';
- ReasonLbl: Label 'Reason: %1 - %2', Comment = '%1 - Reason code, %2 - Reason description';
-}
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/app/src/Implementation/ContiniaEnvCleanupSubscr.Codeunit.al b/Apps/W1/EDocumentConnectors/Continia/app/src/Implementation/ContiniaEnvCleanupSubscr.Codeunit.al
deleted file mode 100644
index 7fda2de999..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/app/src/Implementation/ContiniaEnvCleanupSubscr.Codeunit.al
+++ /dev/null
@@ -1,37 +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.EServices.EDocumentConnector.Continia;
-
-using System.DataAdministration;
-using System.Environment;
-
-codeunit 6398 "Continia Env. Cleanup Subscr."
-{
- Access = Internal;
-
- [EventSubscriber(ObjectType::Codeunit, Codeunit::"Environment Cleanup", OnClearCompanyConfig, '', false, false)]
- local procedure CleanupCompanyConfiguration(CompanyName: Text; SourceEnv: Enum "Environment Type"; DestinationEnv: Enum "Environment Type")
- var
- ConnectionSetup: Record "Continia Connection Setup";
- Participation: Record "Continia Participation";
- ParticipationProfiles: Record "Continia Activated Net. Prof.";
- EnvironmentInformation: Codeunit "Environment Information";
- begin
- if not EnvironmentInformation.IsSaaSInfrastructure() then
- exit;
-
- if CompanyName = '' then
- exit;
-
- ConnectionSetup.ChangeCompany(CompanyName);
- ConnectionSetup.DeleteAll();
-
- Participation.ChangeCompany(CompanyName);
- Participation.DeleteAll();
-
- ParticipationProfiles.ChangeCompany(CompanyName);
- ParticipationProfiles.DeleteAll();
- end;
-}
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/app/src/Implementation/ContiniaExtConnectionSetup.Page.al b/Apps/W1/EDocumentConnectors/Continia/app/src/Implementation/ContiniaExtConnectionSetup.Page.al
deleted file mode 100644
index 1ed162928e..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/app/src/Implementation/ContiniaExtConnectionSetup.Page.al
+++ /dev/null
@@ -1,163 +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.EServices.EDocumentConnector.Continia;
-
-using System.Environment;
-
-page 6390 "Continia Ext. Connection Setup"
-{
- ApplicationArea = Basic, Suite;
- Caption = 'Continia E-Document External Connection Setup';
- DeleteAllowed = false;
- Editable = false;
- Extensible = false;
- InsertAllowed = false;
- ModifyAllowed = false;
- PageType = Card;
- SourceTable = "Continia Connection Setup";
- UsageCategory = None;
-
- layout
- {
- area(Content)
- {
- group(General)
- {
- field(SubscriptionStatus; Rec."Subscription Status")
- {
- Editable = false;
- ShowMandatory = true;
- }
- field(NoOfParticipations; Rec."No. Of Participations")
- {
- ShowMandatory = true;
-
- trigger OnDrillDown()
- var
- Participation: Record "Continia Participation";
- ApiRequests: Codeunit "Continia Api Requests";
- Participations: Page "Continia Participations";
- ProgressWindow: Dialog;
- begin
- ProgressWindow.Open(ProcessingWindowMsg);
- if Participation.FindSet() then
- repeat
- ApiRequests.GetParticipation(Participation);
- ApiRequests.GetAllParticipationProfiles(Participation);
- until Participation.Next() = 0;
-
- ProgressWindow.Close();
- Participations.Run();
- end;
- }
- }
- }
- }
-
- actions
- {
- area(Promoted)
- {
- actionref(RegisterNewActionRef; RegisterNewParticipation) { }
- group(SubscriptionGroup)
- {
- Caption = 'Subscription';
- actionref(EditCompanyInformationActionRef; EditCompanyInformation) { }
- actionref(CancelSubscriptionActionRef; CancelSubscription) { }
- }
- }
- area(Processing)
- {
- action(RegisterNewParticipation)
- {
- Caption = 'Register new participation';
- Enabled = CanEditParticipation;
- Image = New;
- ToolTip = 'Register a new participation in the Continia Delivery Network.';
-
- trigger OnAction()
- var
- OnboardingGuide: Page "Continia Onboarding Guide";
- begin
- OnboardingGuide.Run();
- CurrPage.Update(false);
- end;
- }
- action(EditCompanyInformation)
- {
- Caption = 'Edit Company Information';
- Enabled = ActionsEnabled and CanEditParticipation;
- Image = Company;
- ToolTip = 'Edit the company information for the Continia subscription.';
-
- trigger OnAction()
- var
- ActivationMgt: Codeunit "Continia Subscription Mgt.";
- OnboardingGuide: Page "Continia Onboarding Guide";
- RunScenario: Enum "Continia Wizard Scenario";
- begin
- if ActivationMgt.HasOtherAppsInSubscription() then
- Message(UseContiniaSolutionMgtMsg)
- else begin
- OnboardingGuide.SetRunScenario(RunScenario::EditSubscriptionInfo);
- OnboardingGuide.Run();
- end;
- end;
- }
- action(CancelSubscription)
- {
- Caption = 'Cancel Subscription';
- Enabled = ActionsEnabled and CanEditParticipation;
- Image = Cancel;
- Ellipsis = true;
- ToolTip = 'Cancels the Continia subscription. You will not be able to send or receive e-documents using the Continia Delivery Network anymore.';
-
- trigger OnAction()
- var
- Participation: Record "Continia Participation";
- ApiRequests: Codeunit "Continia Api Requests";
- ActivationMgt: Codeunit "Continia Subscription Mgt.";
- begin
- if Confirm(UnsubscribeQst) then begin
- if Participation.FindSet() then
- repeat
- ApiRequests.DeleteParticipation(Participation);
- until Participation.Next() = 0;
-
- ActivationMgt.Unsubscribe(true);
- CurrPage.Update(false);
- end
- end;
- }
- }
- }
-
- trigger OnOpenPage()
- var
- OnboardingHelper: Codeunit "Continia Onboarding Helper";
- EnvironmentInformation: Codeunit "Environment Information";
- begin
- if not EnvironmentInformation.IsSaaSInfrastructure() then
- Error(NotSupportedOnPremisesErr);
-
- CanEditParticipation := OnboardingHelper.HasModifyPermissionOnParticipation();
- if not Rec.Get() then begin
- Rec.Init();
- Rec.Insert()
- end;
- end;
-
- trigger OnAfterGetRecord()
- begin
- ActionsEnabled := true;
- end;
-
- var
- ActionsEnabled, CanEditParticipation : Boolean;
- UnsubscribeQst: Label 'Are you sure you want to cancel the subscription? You will not be able to send or receive e-documents using the Continia Delivery Network anymore.';
- UseContiniaSolutionMgtMsg: Label 'There are other Continia apps in this subscription. In these cases you can only change the company information from the Continia Solution Management page.';
- ProcessingWindowMsg: Label 'Updating data from Continia Online';
- NotSupportedOnPremisesErr: Label 'The Continia E-Document Service is not supported in on-premises environments.';
-}
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/app/src/Implementation/ContiniaIntegrationImpl.Codeunit.al b/Apps/W1/EDocumentConnectors/Continia/app/src/Implementation/ContiniaIntegrationImpl.Codeunit.al
deleted file mode 100644
index d99512ba6d..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/app/src/Implementation/ContiniaIntegrationImpl.Codeunit.al
+++ /dev/null
@@ -1,93 +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.EServices.EDocumentConnector.Continia;
-
-using System.Utilities;
-using Microsoft.EServices.EDocument;
-using Microsoft.eServices.EDocument.Integration.Receive;
-using Microsoft.eServices.EDocument.Integration.Send;
-using Microsoft.eServices.EDocument.Integration.Interfaces;
-
-codeunit 6390 "Continia Integration Impl." implements IDocumentSender, IDocumentResponseHandler, IDocumentReceiver, ISentDocumentActions, IReceivedDocumentMarker
-{
- Access = Internal;
-
- #region IDocumentSender
-
- procedure Send(var EDocument: Record "E-Document"; var EDocumentService: Record "E-Document Service"; SendContext: Codeunit SendContext)
- var
- EDocumentProcessing: Codeunit "Continia EDocument Processing";
- begin
- EDocumentProcessing.SendEDocument(EDocument, EDocumentService, SendContext);
- end;
-
- procedure GetResponse(var EDocument: Record "E-Document"; var EDocumentService: Record "E-Document Service"; SendContext: Codeunit SendContext): Boolean
- var
- EDocumentProcessing: Codeunit "Continia EDocument Processing";
- begin
- exit(EDocumentProcessing.GetTechnicalResponse(EDocument, SendContext));
- end;
-
- #endregion
-
- #region IDocumentReceiver
-
- procedure ReceiveDocuments(var EDocumentService: Record "E-Document Service"; DocumentsMetadata: Codeunit "Temp Blob List"; ReceiveContext: Codeunit ReceiveContext)
- var
- EDocumentProcessing: Codeunit "Continia EDocument Processing";
- begin
- EDocumentProcessing.ReceiveDocuments(EDocumentService, DocumentsMetadata, ReceiveContext);
- end;
-
- procedure DownloadDocument(var EDocument: Record "E-Document"; var EDocumentService: Record "E-Document Service"; DocumentMetadata: Codeunit "Temp Blob"; ReceiveContext: Codeunit ReceiveContext)
- var
- EDocumentProcessing: Codeunit "Continia EDocument Processing";
- begin
- EDocumentProcessing.DownloadDocument(EDocument, EDocumentService, DocumentMetadata, ReceiveContext);
- end;
-
- #endregion
-
- #region IReceivedDocumentMarker
-
- procedure MarkFetched(var EDocument: Record "E-Document"; var EDocumentService: Record "E-Document Service"; var DocumentBlob: Codeunit "Temp Blob"; ReceiveContext: Codeunit ReceiveContext)
- var
- EDocumentProcessing: Codeunit "Continia EDocument Processing";
- begin
- EDocumentProcessing.MarkFetched(EDocument, EDocumentService, DocumentBlob, ReceiveContext);
- end;
-
- #endregion
-
- #region ISentDocumentActions
-
- procedure GetApprovalStatus(var EDocument: Record "E-Document"; var EDocumentService: Record "E-Document Service"; ActionContext: Codeunit ActionContext): Boolean
- var
- EDocumentProcessing: Codeunit "Continia EDocument Processing";
- begin
- exit(EDocumentProcessing.GetLastDocumentBusinessResponses(EDocument, ActionContext));
- end;
-
- procedure GetCancellationStatus(var EDocument: Record "E-Document"; var EDocumentService: Record "E-Document Service"; ActionContext: Codeunit ActionContext): Boolean
- var
- EDocumentProcessing: Codeunit "Continia EDocument Processing";
- begin
- exit(EDocumentProcessing.GetCancellationStatus(EDocument, EDocumentService, ActionContext));
- end;
-
- #endregion
-
- [EventSubscriber(ObjectType::Page, Page::"E-Document Service", OnBeforeOpenServiceIntegrationSetupPage, '', false, false)]
- local procedure OnBeforeOpenServiceIntegrationSetupPage(EDocumentService: Record "E-Document Service"; var IsServiceIntegrationSetupRun: Boolean)
- var
- ExtConnectionSetup: Page "Continia Ext. Connection Setup";
- begin
- if EDocumentService."Service Integration V2" <> EDocumentService."Service Integration V2"::Continia then
- exit;
-
- ExtConnectionSetup.Run();
- IsServiceIntegrationSetupRun := true;
- end;
-}
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/app/src/Metadata/ContiniaEDeliveryNetwork.Enum.al b/Apps/W1/EDocumentConnectors/Continia/app/src/Metadata/ContiniaEDeliveryNetwork.Enum.al
deleted file mode 100644
index 686ed1cf1f..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/app/src/Metadata/ContiniaEDeliveryNetwork.Enum.al
+++ /dev/null
@@ -1,20 +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.EServices.EDocumentConnector.Continia;
-
-enum 6390 "Continia E-Delivery Network"
-{
- Access = Internal;
- Extensible = false;
-
- value(0; Peppol)
- {
- Caption = 'Peppol';
- }
- value(1; Nemhandel)
- {
- Caption = 'NemHandel';
- }
-}
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/app/src/Metadata/ContiniaNetworkIdList.Page.al b/Apps/W1/EDocumentConnectors/Continia/app/src/Metadata/ContiniaNetworkIdList.Page.al
deleted file mode 100644
index 191eb61abd..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/app/src/Metadata/ContiniaNetworkIdList.Page.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.
-// ------------------------------------------------------------------------------------------------
-namespace Microsoft.EServices.EDocumentConnector.Continia;
-
-page 6395 "Continia Network Id. List"
-{
- ApplicationArea = All;
- Caption = 'Network Identifier List';
- DeleteAllowed = false;
- Editable = false;
- Extensible = false;
- InsertAllowed = false;
- LinksAllowed = false;
- ModifyAllowed = false;
- PageType = List;
- ShowFilter = false;
- SourceTable = "Continia Network Identifier";
- SourceTableView = sorting("Scheme Id") order(ascending);
- UsageCategory = None;
-
- layout
- {
- area(Content)
- {
- repeater(Group)
- {
- field("Network Name"; Rec.Network) { }
- field("Scheme Id"; Rec."Scheme Id") { }
- field(Description; Rec.Description) { }
- field("Identifier Type Id"; Rec."Identifier Type Id") { }
- }
- }
- }
-
- actions
- {
- area(Processing)
- {
- action(GetContiniaNetworkIdTypes)
- {
- Caption = 'Import Network ID Types';
- Image = Import;
- ToolTip = 'Imports all the Network ID Types from Continia API.';
-
- trigger OnAction()
- var
- ApiRequests: Codeunit "Continia Api Requests";
- begin
- ApiRequests.GetNetworkIdTypes(Enum::"Continia E-Delivery Network"::Peppol);
- ApiRequests.GetNetworkIdTypes(Enum::"Continia E-Delivery Network"::Nemhandel);
- end;
- }
- }
-
- }
-}
-
diff --git a/Apps/W1/EDocumentConnectors/Continia/app/src/Metadata/ContiniaNetworkIdentifier.Table.al b/Apps/W1/EDocumentConnectors/Continia/app/src/Metadata/ContiniaNetworkIdentifier.Table.al
deleted file mode 100644
index a66220c133..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/app/src/Metadata/ContiniaNetworkIdentifier.Table.al
+++ /dev/null
@@ -1,74 +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.EServices.EDocumentConnector.Continia;
-
-table 6393 "Continia Network Identifier"
-{
- Access = Internal;
- Caption = 'Network Identifier';
- DataClassification = SystemMetadata;
- DrillDownPageId = "Continia Network Id. List";
-
- fields
- {
- field(1; Id; Guid)
- {
- Caption = 'ID';
- }
- field(2; Network; Enum "Continia E-Delivery Network")
- {
- Caption = 'Network';
- ToolTip = 'Specifies the Network Name of the Network Identifier.';
- }
- field(3; "Identifier Type Id"; Text[4])
- {
- Caption = 'Identifier Type Id';
- ToolTip = 'Specifies the EAS code of the identifier type.';
- }
- field(4; Description; Text[250])
- {
- Caption = 'Description';
- ToolTip = 'Specifies the description of the identifier type.';
- }
- field(5; "Scheme Id"; Text[50])
- {
- Caption = 'Scheme Id';
- ToolTip = 'Specifies the scheme Id of the identifier type.';
- }
- field(10; Default; Boolean)
- {
- Caption = 'Default';
- }
- field(11; "Default in Country"; Code[10])
- {
- Caption = 'Default in Country';
- }
- field(12; "VAT in Country"; Code[10])
- {
- Caption = 'VAT Identification in Country';
- }
- field(13; "ICD Code"; Boolean)
- {
- Caption = 'ICD Code';
- }
- field(14; "Validation Rule"; Text[50])
- {
- Caption = 'Validation Rule';
- }
- field(21; Enabled; Boolean)
- {
- Caption = 'Enabled';
- }
- }
-
- keys
- {
- key(Key1; Id)
- {
- Clustered = true;
- }
- key(Key2; "Scheme Id") { }
- }
-}
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/app/src/Metadata/ContiniaNetworkProfile.Table.al b/Apps/W1/EDocumentConnectors/Continia/app/src/Metadata/ContiniaNetworkProfile.Table.al
deleted file mode 100644
index dd71ea9f60..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/app/src/Metadata/ContiniaNetworkProfile.Table.al
+++ /dev/null
@@ -1,65 +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.EServices.EDocumentConnector.Continia;
-
-table 6394 "Continia Network Profile"
-{
- Access = Internal;
- Caption = 'Network Profile';
- DataClassification = SystemMetadata;
- DrillDownPageId = "Continia Network Profile List";
-
- fields
- {
- field(1; Id; Guid)
- {
- Caption = 'ID';
- }
- field(2; Network; Enum "Continia E-Delivery Network")
- {
- Caption = 'Network Name';
- ToolTip = 'Specifies the network name of the profile.';
- }
- field(3; "Process Identifier"; Text[250])
- {
- Caption = 'Process Identifier';
- ToolTip = 'Specifies the process identifier value of the profile.';
- }
- field(4; "Document Identifier"; Text[250])
- {
- Caption = 'Document Identifier';
- ToolTip = 'Specifies the document identifier value of the profile.';
- }
- field(5; Description; Text[250])
- {
- Caption = 'Description';
- ToolTip = 'Specifies the description of the network profile.';
- }
- field(6; "Customization Id"; Text[250])
- {
- Caption = 'Customization Id';
- }
- field(10; Enabled; Boolean)
- {
- Caption = 'Enabled';
- }
- field(13; Mandatory; Boolean)
- {
- Caption = 'Mandatory';
- }
- field(14; "Mandatory for Country"; Code[50])
- {
- Caption = 'Mandatory for Country';
- }
- }
-
- keys
- {
- key(Key1; Id)
- {
- Clustered = true;
- }
- }
-}
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/app/src/Metadata/ContiniaNetworkProfileList.Page.al b/Apps/W1/EDocumentConnectors/Continia/app/src/Metadata/ContiniaNetworkProfileList.Page.al
deleted file mode 100644
index a8404a0a3d..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/app/src/Metadata/ContiniaNetworkProfileList.Page.al
+++ /dev/null
@@ -1,57 +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.EServices.EDocumentConnector.Continia;
-
-page 6396 "Continia Network Profile List"
-{
- ApplicationArea = All;
- Caption = 'Network Profiles';
- DeleteAllowed = false;
- Editable = false;
- Extensible = false;
- InsertAllowed = false;
- LinksAllowed = false;
- ModifyAllowed = false;
- PageType = List;
- SourceTable = "Continia Network Profile";
- UsageCategory = None;
-
- layout
- {
- area(Content)
- {
- repeater(Group)
- {
- field(Network; Rec.Network) { }
- field(Description; Rec.Description) { }
- field("Process Identifier"; Rec."Process Identifier") { }
- field("Document Identifier"; Rec."Document Identifier") { }
- }
- }
- }
-
- actions
- {
- area(Processing)
- {
- action(GetNetworkProfiles)
- {
- Caption = 'Import Network Profiles';
- Image = Import;
- ToolTip = 'Imports all the Network Profiles from Continia API.';
-
- trigger OnAction()
- var
- ApiRequests: Codeunit "Continia Api Requests";
- begin
- ApiRequests.GetNetworkProfiles(Enum::"Continia E-Delivery Network"::Peppol);
- ApiRequests.GetNetworkProfiles(Enum::"Continia E-Delivery Network"::Nemhandel);
- end;
- }
- }
-
- }
-}
-
diff --git a/Apps/W1/EDocumentConnectors/Continia/app/src/Metadata/ContiniaProfileDirection.Enum.al b/Apps/W1/EDocumentConnectors/Continia/app/src/Metadata/ContiniaProfileDirection.Enum.al
deleted file mode 100644
index 94aab852ce..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/app/src/Metadata/ContiniaProfileDirection.Enum.al
+++ /dev/null
@@ -1,24 +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.EServices.EDocumentConnector.Continia;
-
-enum 6391 "Continia Profile Direction"
-{
- Access = Internal;
- Extensible = false;
-
- value(0; Outbound)
- {
- Caption = 'Outbound';
- }
- value(1; Inbound)
- {
- Caption = 'Inbound';
- }
- value(2; Both)
- {
- Caption = 'Both';
- }
-}
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/app/src/Onboarding/ConEDoCServProfSel.Table.al b/Apps/W1/EDocumentConnectors/Continia/app/src/Onboarding/ConEDoCServProfSel.Table.al
deleted file mode 100644
index 1a2654a6b6..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/app/src/Onboarding/ConEDoCServProfSel.Table.al
+++ /dev/null
@@ -1,144 +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.EServices.EDocumentConnector.Continia;
-
-table 6395 "Con. E-Doc. Serv. Prof. Sel."
-{
- Access = Internal;
- Caption = 'E-Document Service Network Profile Selection';
- DataClassification = CustomerContent;
- TableType = Temporary;
-
- fields
- {
- field(1; Network; Enum "Continia E-Delivery Network")
- {
- Caption = 'Network';
- ToolTip = 'Specifies E-Document Network.';
- }
- field(2; "Identifier Type Id"; Guid)
- {
- Caption = 'Identifier Type Id';
- TableRelation = "Continia Network Identifier".Id where(Network = field(Network));
- ToolTip = 'Specifies ID of E-Document Identifier Type.';
- }
- field(3; "Identifier Value"; Code[50])
- {
- Caption = 'Identifier Value';
- ToolTip = 'Specifies E-Document Identifier Value.';
- }
- field(4; "Network Profile Id"; Guid)
- {
- Caption = 'Network Profile Id';
- TableRelation = "Continia Network Profile".Id where(Network = field(Network));
- ToolTip = 'Specifies ID of E-Document INetwork Profile.';
- }
- field(5; Indent; Integer)
- {
- Caption = 'Indent';
- ToolTip = 'Specifies tree view indentation.';
- }
- field(6; "Participation Description"; Text[100])
- {
- Caption = 'Participation';
- ToolTip = 'Specifies a description of Participation';
- }
- field(7; Description; Text[250])
- {
- Caption = 'Description';
- ToolTip = 'Specifies a description of Network Profile.';
- }
- field(8; "Network Name"; Text[100])
- {
- Caption = 'Network';
- ToolTip = 'Specifies E-Document Network Name';
- }
- field(9; "Profile Direction"; Text[100])
- {
- Caption = 'Profile Direction';
- ToolTip = 'Specifies the direction of the profile.';
- }
- field(10; "E-Document Service Code"; Code[20])
- {
- Caption = 'E-Document Service Code';
- ToolTip = 'Specifies the E-Document Service that would be linked to selected Network Profile.';
- }
- field(11; "Is Profile"; Boolean)
- {
- Caption = 'Is Profile';
- ToolTip = 'Specifies if the record represents Network Profile.';
- }
- }
- keys
- {
- key(PK; Network, "Identifier Type Id", "Identifier Value", "Network Profile Id")
- {
- Clustered = true;
- }
- }
-
- internal procedure FillNetwork(ActivatedNetProf: Record "Continia Activated Net. Prof.")
- var
- EmptyGuid: Guid;
- begin
- Init();
- Network := ActivatedNetProf.Network;
- "Identifier Type Id" := EmptyGuid;
- "Identifier Value" := '';
- "Network Profile Id" := EmptyGuid;
- "Network Name" := Format(ActivatedNetProf.Network);
- Indent := 0;
- InsertIfPossible();
- end;
-
- internal procedure FillParticipation(ActivatedNetProf: Record "Continia Activated Net. Prof.")
- var
- Participation: Record "Continia Participation";
- EmptyGuid: Guid;
- begin
- if not Participation.Get(ActivatedNetProf.Network, ActivatedNetProf."Identifier Type Id", ActivatedNetProf."Identifier Value") then
- exit;
- Init();
- Network := Participation.Network;
- "Identifier Type Id" := Participation."Identifier Type Id";
- "Identifier Value" := Participation."Identifier Value";
- "Network Profile Id" := EmptyGuid;
- "Participation Description" := GetParticipationDescription(Participation);
- Indent := 1;
- InsertIfPossible();
- end;
-
- internal procedure FillNetworkProfile(ActivatedNetProf: Record "Continia Activated Net. Prof.")
- begin
- ActivatedNetProf.CalcFields("Network Profile Description");
- Init();
- Network := ActivatedNetProf.Network;
- "Identifier Type Id" := ActivatedNetProf."Identifier Type Id";
- "Identifier Value" := ActivatedNetProf."Identifier Value";
- "Network Profile Id" := ActivatedNetProf."Network Profile Id";
- "Profile Direction" := Format(ActivatedNetProf."Profile Direction");
- "E-Document Service Code" := ActivatedNetProf."E-Document Service Code";
- Description := ActivatedNetProf."Network Profile Description";
- Indent := 2;
- "Is Profile" := true;
- Insert(false);
- end;
-
- local procedure GetParticipationDescription(Participation: Record "Continia Participation"): Text[100]
- var
- NetworkIdentifier: Record "Continia Network Identifier";
- ParticipationDescriptionPatternTxt: Label '%1 %2', Comment = '%1 - Scheme Id, %2 - Identifier Value';
- begin
- NetworkIdentifier := Participation.GetNetworkIdentifier();
- exit(StrSubstNo(ParticipationDescriptionPatternTxt, NetworkIdentifier."Scheme Id", Participation."Identifier Value"));
- end;
-
- local procedure InsertIfPossible()
- begin
- if Find() then
- exit;
- Insert(false);
- end;
-}
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/app/src/Onboarding/ConEDocServNetProfiles.Page.al b/Apps/W1/EDocumentConnectors/Continia/app/src/Onboarding/ConEDocServNetProfiles.Page.al
deleted file mode 100644
index 3da5ec43ce..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/app/src/Onboarding/ConEDocServNetProfiles.Page.al
+++ /dev/null
@@ -1,185 +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.EServices.EDocumentConnector.Continia;
-
-using System.Utilities;
-
-page 6397 "Con. E-Doc. Serv. Net.Profiles"
-{
- ApplicationArea = All;
- Caption = 'E-Document Service Network Profiles';
- Editable = false;
- Extensible = false;
- PageType = List;
- Permissions = tabledata "Continia Activated Net. Prof." = RIMD;
- SourceTable = "Continia Activated Net. Prof.";
- UsageCategory = None;
-
- layout
- {
- area(Content)
- {
- repeater(Group)
- {
- field(Network; NetworkName)
- {
- Caption = 'Network';
- ToolTip = 'Specifies Network name of the Network Profile.';
- }
- field(Participation; ParticipationInfo)
- {
- Caption = 'Participation';
- ToolTip = 'Specifies information about the Participation of the Network Profile.';
- }
- field("Network Profile Description"; Rec."Network Profile Description") { }
- field("Profile Direction"; Rec."Profile Direction") { }
- }
- }
- }
-
- actions
- {
- area(Promoted)
- {
- actionref(AddCreation; Add) { }
- actionref(RemoveProcessing; Remove) { }
- }
- area(Creation)
- {
- action(Add)
- {
- Caption = 'Add';
- Image = Add;
- Scope = Repeater;
- ToolTip = 'Adds network profiles to the E-Document Service.';
-
- trigger OnAction()
- begin
- AddNetworkProfile();
- end;
- }
- }
- area(Processing)
- {
- action(Remove)
- {
- Caption = 'Remove';
- Image = Delete;
- Scope = Repeater;
- ToolTip = 'Removes selected network profiles from E-Document Service.';
-
- trigger OnAction()
- begin
- RemoveNetworkProfiles();
- end;
- }
- }
- }
-
- trigger OnAfterGetRecord()
- var
- NetworkIdentifier: Record "Continia Network Identifier";
- ParticipationInfoPatternTxt: Label '%1 %2', Comment = '%1 - Scheme Id, %2 - Identifier Value';
- TemporaryParticipationInfo: Text;
- begin
- ResetPreviousRecordParticipationInfo();
- Clear(ParticipationInfo);
- Clear(NetworkName);
- if NetworkIdentifier.Get(Rec."Identifier Type Id") then
- TemporaryParticipationInfo := StrSubstNo(ParticipationInfoPatternTxt, NetworkIdentifier."Scheme Id", Rec."Identifier Value");
-
- if PreviousRecordParticipationInfo = TemporaryParticipationInfo then
- exit;
- PreviousRecordParticipationInfo := TemporaryParticipationInfo;
- ParticipationInfo := TemporaryParticipationInfo;
- NetworkName := Format(Rec.Network);
- end;
-
- internal procedure SetEDocumentServiceCode(PassedEDocumentServiceCode: Code[20])
- begin
- EDocumentServiceCode := PassedEDocumentServiceCode;
- end;
-
- local procedure AddNetworkProfile()
- var
- ActivatedNetProf: Record "Continia Activated Net. Prof.";
- EDocServiceNetProfSel: Page "Con. E-Doc. Serv. Prof. Sel.";
- SelectedNetworkNames: List of [Text];
- begin
- EDocServiceNetProfSel.SetEDocumentServiceCode(EDocumentServiceCode);
- EDocServiceNetProfSel.FillRecords();
- EDocServiceNetProfSel.LookupMode(true);
- if EDocServiceNetProfSel.RunModal() <> Action::LookupOK then
- exit;
-
- EDocServiceNetProfSel.GetSelectedProfilesAndNetworks(ActivatedNetProf, SelectedNetworkNames);
- if HandleMultipleNetworkNames(SelectedNetworkNames) then
- UpdateNetworkProfilesBySelection(ActivatedNetProf);
- CurrPage.Update();
- end;
-
- local procedure RemoveNetworkProfiles()
- var
- ActivatedNetProf: Record "Continia Activated Net. Prof.";
- begin
- CurrPage.SetSelectionFilter(ActivatedNetProf);
- ActivatedNetProf.ModifyAll("E-Document Service Code", '', true);
- CurrPage.Update();
- end;
-
- local procedure UpdateNetworkProfilesBySelection(var ActivatedNetProf: Record "Continia Activated Net. Prof.")
- begin
- if ActivatedNetProf.FindSet() then
- repeat
- ActivatedNetProf.Validate("E-Document Service Code", EDocumentServiceCode);
- ActivatedNetProf.Modify(true);
- until ActivatedNetProf.Next() = 0;
- end;
-
- local procedure HandleMultipleNetworkNames(var SelectedNetworkNames: List of [Text]): Boolean
- var
- ActivatedNetProf: Record "Continia Activated Net. Prof.";
- ConfirmManagement: Codeunit "Confirm Management";
- LinkedNetworkNames: List of [Text];
- SelectedNetworkName: Text;
- InitialCountOfLinkedNetworks: Integer;
- DifferentLinkedAndSelectedNetworkNamesQst: Label 'You have selected Network Profile(s) that belong to different Networks than those already linked to the E-Document Service. Are you sure you want to proceed?';
- MultipleNetworksSelectedQst: Label 'You have selected Network Profiles from %1 different Networks. Are you sure you want to proceed?', Comment = '%1 - Number of selected Networks';
- begin
- LinkedNetworkNames := ActivatedNetProf.GetEDocServiceNetworkNames(EDocumentServiceCode);
- InitialCountOfLinkedNetworks := LinkedNetworkNames.Count();
-
- foreach SelectedNetworkName in SelectedNetworkNames do
- if not LinkedNetworkNames.Contains(SelectedNetworkName) then
- LinkedNetworkNames.Add(SelectedNetworkName);
-
- if (LinkedNetworkNames.Count() > InitialCountOfLinkedNetworks) and (InitialCountOfLinkedNetworks > 0) then
- if not ConfirmManagement.GetResponse(DifferentLinkedAndSelectedNetworkNamesQst) then
- exit;
-
- if SelectedNetworkNames.Count() > 1 then
- if not ConfirmManagement.GetResponse(StrSubstNo(MultipleNetworksSelectedQst, SelectedNetworkNames.Count())) then
- exit;
- exit(true);
- end;
-
- local procedure ResetPreviousRecordParticipationInfo()
- var
- ActivatedNetProf: Record "Continia Activated Net. Prof.";
- begin
- ActivatedNetProf.SetView(Rec.GetView());
- if not ActivatedNetProf.FindFirst() then
- exit;
- if Rec.RecordId() = ActivatedNetProf.RecordId() then
- Clear(PreviousRecordParticipationInfo);
- end;
-
- var
- EDocumentServiceCode: Code[20];
- ParticipationInfo: Text;
- PreviousRecordParticipationInfo: Text;
- NetworkName: Text;
-
-}
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/app/src/Onboarding/ConEDocServProfSel.Page.al b/Apps/W1/EDocumentConnectors/Continia/app/src/Onboarding/ConEDocServProfSel.Page.al
deleted file mode 100644
index 76ffe4eeb8..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/app/src/Onboarding/ConEDocServProfSel.Page.al
+++ /dev/null
@@ -1,74 +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.EServices.EDocumentConnector.Continia;
-
-page 6398 "Con. E-Doc. Serv. Prof. Sel."
-{
- ApplicationArea = All;
- Caption = 'E-Document Service Network Profile Selection';
- Editable = false;
- Extensible = false;
- PageType = List;
- SourceTable = "Con. E-Doc. Serv. Prof. Sel.";
- SourceTableTemporary = true;
- UsageCategory = None;
-
- layout
- {
- area(Content)
- {
- repeater(Group)
- {
- IndentationColumn = Rec.Indent;
- ShowAsTree = true;
-
- field(Network; Rec."Network Name") { }
- field("Participation Description"; Rec."Participation Description") { }
- field(Description; Rec.Description) { }
- field("Profile Direction"; Rec."Profile Direction") { }
- field("E-Document Service Code"; Rec."E-Document Service Code") { }
- }
- }
- }
-
- internal procedure FillRecords(): Boolean
- var
- ActivatedNetProf: Record "Continia Activated Net. Prof.";
- begin
- ActivatedNetProf.SetFilter("E-Document Service Code", '<>%1', EDocumentServiceCode);
- if ActivatedNetProf.FindSet() then
- repeat
- Rec.FillNetworkProfile(ActivatedNetProf);
- Rec.FillParticipation(ActivatedNetProf);
- Rec.FillNetwork(ActivatedNetProf);
- until ActivatedNetProf.Next() = 0;
- end;
-
- internal procedure GetSelectedProfilesAndNetworks(var ActivatedNetProf: Record "Continia Activated Net. Prof."; var SelectedNetworkNames: List of [Text])
- begin
- ActivatedNetProf.Reset();
- Clear(SelectedNetworkNames);
-
- CurrPage.SetSelectionFilter(Rec);
- if Rec.FindSet() then
- repeat
- if Rec."Is Profile" then begin
- if ActivatedNetProf.Get(Rec.Network, Rec."Identifier Type Id", Rec."Identifier Value", Rec."Network Profile Id") then
- ActivatedNetProf.Mark(true);
- if not SelectedNetworkNames.Contains(Format(Rec.Network)) then
- SelectedNetworkNames.Add(Format(Rec.Network));
- end;
- until Rec.Next() = 0;
- ActivatedNetProf.MarkedOnly(true);
- end;
-
- internal procedure SetEDocumentServiceCode(PassedEDocumentServiceCode: Code[20])
- begin
- EDocumentServiceCode := PassedEDocumentServiceCode;
- end;
-
- var
- EDocumentServiceCode: Code[20];
-}
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/app/src/Onboarding/ContiniaEDocumentService.PageExt.al b/Apps/W1/EDocumentConnectors/Continia/app/src/Onboarding/ContiniaEDocumentService.PageExt.al
deleted file mode 100644
index 4133c2ec84..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/app/src/Onboarding/ContiniaEDocumentService.PageExt.al
+++ /dev/null
@@ -1,46 +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.EServices.EDocumentConnector.Continia;
-
-using Microsoft.eServices.EDocument;
-using Microsoft.eServices.EDocument.Integration;
-
-pageextension 6390 "Continia E-Document Service" extends "E-Document Service"
-{
- layout
- {
- addlast(General)
- {
- group(NetworkProfiles)
- {
- ShowCaption = false;
- Visible = Rec."Service Integration V2" = Enum::"Service Integration"::Continia;
-
- field("No. Of Network Profiles"; Rec."No. Of Network Profiles")
- {
- ApplicationArea = Basic, Suite;
- ToolTip = 'Specifies the number of Continia network profiles associated with the E-Document Service.';
-
- trigger OnDrillDown()
- begin
- OpenNetworkProfiles();
- CurrPage.Update();
- end;
- }
- }
- }
- }
-
- local procedure OpenNetworkProfiles()
- var
- ActivatedNetProf: Record "Continia Activated Net. Prof.";
- EDocServiceNetProfiles: Page "Con. E-Doc. Serv. Net.Profiles";
- begin
- ActivatedNetProf.SetRange("E-Document Service Code", Rec.Code);
- EDocServiceNetProfiles.SetTableView(ActivatedNetProf);
- EDocServiceNetProfiles.SetEDocumentServiceCode(Rec.Code);
- EDocServiceNetProfiles.RunModal();
- end;
-}
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/app/src/Onboarding/ContiniaEDocumentService.TableExt.al b/Apps/W1/EDocumentConnectors/Continia/app/src/Onboarding/ContiniaEDocumentService.TableExt.al
deleted file mode 100644
index 26adf0f767..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/app/src/Onboarding/ContiniaEDocumentService.TableExt.al
+++ /dev/null
@@ -1,21 +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.EServices.EDocumentConnector.Continia;
-
-using Microsoft.eServices.EDocument;
-
-tableextension 6390 "Continia E-Document Service" extends "E-Document Service"
-{
- fields
- {
- field(6390; "No. Of Network Profiles"; Integer)
- {
- CalcFormula = count("Continia Activated Net. Prof." where("E-Document Service Code" = field(Code)));
- Caption = 'No. Of Network Profiles';
- Editable = false;
- FieldClass = FlowField;
- }
- }
-}
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/app/src/Onboarding/ContiniaOnboardingGuide.Page.al b/Apps/W1/EDocumentConnectors/Continia/app/src/Onboarding/ContiniaOnboardingGuide.Page.al
deleted file mode 100644
index 353842bb95..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/app/src/Onboarding/ContiniaOnboardingGuide.Page.al
+++ /dev/null
@@ -1,1148 +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.EServices.EDocumentConnector.Continia;
-
-using System.Email;
-using Microsoft.Foundation.Address;
-
-page 6393 "Continia Onboarding Guide"
-{
- ApplicationArea = All;
- Caption = 'Continia Delivery Network Onboarding';
- DeleteAllowed = false;
- Extensible = false;
- InsertAllowed = false;
- PageType = NavigatePage;
-
- layout
- {
- area(Content)
- {
- group(FirstPage)
- {
- Caption = '';
- Visible = FirstStepVisible;
- group(IntroductionGroup)
- {
- Caption = 'Welcome to the Continia Delivery Network onboarding guide.';
- Visible = FirstStepVisible;
- group(Start1)
- {
- InstructionalText = 'Continia Delivery Network integrates seamlessly with various electronic data exchange networks, such as the PEPPOL eDelivery Network. This allows you to send and receive documents directly from Business Central if your vendors and customers are also connected to these networks.';
- ShowCaption = false;
- }
- group(Start2)
- {
- InstructionalText = 'This guide will help you register your company as a participant in the Continia Delivery Network.';
- ShowCaption = false;
- }
- }
- group(IntroductionGroup2)
- {
- Caption = 'Let''s go!';
- group(Start3)
- {
- Caption = '';
- InstructionalText = 'Choose Next to get started.';
- }
- }
- }
- group(PartnerDetailsPage)
- {
- Caption = '';
- Visible = PartnerDetailsStepVisible;
- group(PartnerDetails)
- {
- Caption = 'Partner details';
- Visible = PartnerDetailsStepVisible;
- group(PartnerDetails1)
- {
- InstructionalText = 'To continue, you will need the assistance of your partner. Please have your partner enter their Continia PartnerZone credentials:';
- ShowCaption = false;
- }
- }
- field(PartnerUserName; PartnerUserName)
- {
- Caption = 'PartnerZone Username';
- ShowMandatory = true;
- ToolTip = 'Specifies the email used when logging in to Continia PartnerZone.';
-
- trigger OnValidate()
- var
- MailManagement: Codeunit "Mail Management";
- begin
- if PartnerUserName <> '' then
- MailManagement.CheckValidEmailAddress(PartnerUserName);
- end;
- }
- field(PartnerPassword; PartnerPassword)
- {
- Caption = 'PartnerZone Password';
- ExtendedDatatype = Masked;
- ShowMandatory = true;
- ToolTip = 'Specifies the password used when logging in to Continia PartnerZone. If you do not have a PartnerZone login, please contact Continia.';
-
- trigger OnValidate()
- begin
- if PartnerPassword = '' then
- Error(NoPasswordErr);
- end;
- }
- field(PartnerPwdLinkLabel; PartnerReqPwdTxt)
- {
- Editable = false;
- ShowCaption = false;
-
- trigger OnDrillDown()
- begin
- Hyperlink('https://partnerzone.continia.com/request-reset-password');
- end;
- }
- field(PartnerNewRegLabel; PartnerRegAsNewTxt)
- {
- Editable = false;
- ShowCaption = false;
-
- trigger OnDrillDown()
- begin
- Hyperlink('https://pz.continia.com/partner-application-form/');
- end;
- }
- }
- group(LegalCompanyInformationPage)
- {
- Caption = '';
- Visible = LegalCompanyInformationStepVisible;
- group(LegalCompanyInformation)
- {
- Caption = 'Legal company information';
- Visible = LegalCompanyInformationStepVisible;
- group(LegalCompanyInformation1)
- {
- InstructionalText = 'Please provide the legal information of the company you want to register in the network.';
- ShowCaption = false;
- field("Company Name"; TempParticipation."Company Name")
- {
- Caption = 'Company Name';
- ShowMandatory = true;
- ToolTip = 'Specifies the legal name of the company that you want to join to the network.';
-
- trigger OnValidate()
- begin
- NextActionEnabled := LicenseTermsAccepted and OnboardingHelper.IsParticipationInfoValid(TempParticipation);
- end;
- }
- field("VAT Registration No."; TempParticipation."VAT Registration No.")
- {
- Caption = 'VAT Registration No.';
- ShowMandatory = true;
- ToolTip = 'Specifies the VAT registration number of the company that you want to join to the network.';
-
- trigger OnValidate()
- begin
- NextActionEnabled := LicenseTermsAccepted and OnboardingHelper.IsParticipationInfoValid(TempParticipation);
- end;
- }
- field(Address; TempParticipation.Address)
- {
- Caption = 'Address';
- ShowMandatory = true;
- ToolTip = 'Specifies the legal address of the company that you want to join to the network.';
-
- trigger OnValidate()
- begin
- NextActionEnabled := LicenseTermsAccepted and OnboardingHelper.IsParticipationInfoValid(TempParticipation);
- end;
- }
- field("Post Code"; TempParticipation."Post Code")
- {
- Caption = 'Post Code';
- ShowMandatory = true;
- ToolTip = 'Specifies the legal post code of the company that you want to join to the network.';
-
- trigger OnValidate()
- begin
- NextActionEnabled := LicenseTermsAccepted and OnboardingHelper.IsParticipationInfoValid(TempParticipation);
- end;
- }
- group(CountyGroup)
- {
- ShowCaption = false;
- Visible = CountyVisible;
- field(County; TempParticipation.County)
- {
- Caption = 'County';
- CaptionClass = '5,1,' + TempParticipation."Country/Region Code";
- ToolTip = 'Specifies the legal county of the company that you want to join to the network.';
- }
- }
- field("Country/Region Code"; TempParticipation."Country/Region Code")
- {
- Caption = 'Country/Region Code';
- ShowMandatory = true;
- ToolTip = 'Specifies the legal country code of the company that you want to join to the network. Must be stated in the ISO 3166-1 format.';
-
- trigger OnValidate()
- var
- FormatAddress: Codeunit "Format Address";
- begin
- CountyVisible := FormatAddress.UseCounty(TempParticipation."Country/Region Code");
- NextActionEnabled := LicenseTermsAccepted and OnboardingHelper.IsParticipationInfoValid(TempParticipation);
- end;
- }
- group(CompanySignatory)
- {
- Caption = 'Company Signatory (e.g. CEO)';
- field("Signatory Name"; TempParticipation."Signatory Name")
- {
- Caption = 'Signatory Name';
- ShowMandatory = true;
- ToolTip = 'Specifies the name of the company signatory.';
-
- trigger OnValidate()
- begin
- NextActionEnabled := LicenseTermsAccepted and OnboardingHelper.IsParticipationInfoValid(TempParticipation);
- end;
- }
- field("Signatory Email"; TempParticipation."Signatory Email")
- {
- Caption = 'Email Address';
- ShowMandatory = true;
- ToolTip = 'Specifies the email of the company signatory.';
-
- trigger OnValidate()
- begin
- NextActionEnabled := LicenseTermsAccepted and OnboardingHelper.IsParticipationInfoValid(TempParticipation);
- end;
- }
- }
- }
- group(LegalCompanyInformation2)
- {
- InstructionalText = 'Please verify that all the company details you provided are accurate. This information is essential for Continia to meet its legal obligations, perform its KYC processes and data processing requirements. Inaccurate or insufficient information can delay our verification processes or result in account suspension. If any details change, update the information promptly to avoid service disruptions.';
- ShowCaption = false;
- }
- group(LegalCompanyInformation3)
- {
- InstructionalText = 'By continuing, you confirm the accuracy of the above information and accept Continia Software License Terms and Terms of Service.';
- ShowCaption = false;
-
- field(LicenseTerms; LicenseTermsAccepted)
- {
- Caption = 'I confirm';
- ToolTip = 'Specifies your confirmation to the license terms.';
-
- trigger OnValidate()
- begin
- NextActionEnabled := LicenseTermsAccepted and OnboardingHelper.IsParticipationInfoValid(TempParticipation);
- end;
- }
- }
- }
- }
- group(CompanyContactInformationPage)
- {
- Caption = '';
- Visible = CompanyContactInformationStepVisible;
- group(CompanyContactInformation)
- {
- Caption = 'Company contact information';
- Visible = CompanyContactInformationStepVisible;
- group(CompanyContactInformation1)
- {
- InstructionalText = 'Please provide the company contact information.';
- ShowCaption = false;
- field(CompanyContactName; TempCompanyContact."Company Name")
- {
- Caption = 'Company Name';
- ShowMandatory = true;
- ToolTip = 'Specifies the legal name of the company that you want to join to the network.';
-
- trigger OnValidate()
- begin
- SetButtonBehaviourCompanyContactInformation();
- end;
- }
- field(CompanyContactVAT; TempCompanyContact."VAT Registration No.")
- {
- Caption = 'VAT Registration No.';
- ShowMandatory = true;
- ToolTip = 'Specifies the VAT registration number of the company that you want to join to the network.';
-
- trigger OnValidate()
- begin
- TempCompanyContact.Validate("VAT Registration No.");
- SetButtonBehaviourCompanyContactInformation();
- end;
- }
- field(CompanyContactAddress; TempCompanyContact.Address)
- {
- Caption = 'Address';
- ShowMandatory = true;
- ToolTip = 'Specifies the legal address of the company that you want to join to the network.';
-
- trigger OnValidate()
- begin
- SetButtonBehaviourCompanyContactInformation();
- end;
- }
- field(CompanyContactPostCode; TempCompanyContact."Post Code")
- {
- Caption = 'Post Code';
- ShowMandatory = true;
- ToolTip = 'Specifies the legal post code of the company that you want to join to the network.';
-
- trigger OnValidate()
- begin
- SetButtonBehaviourCompanyContactInformation();
- end;
- }
- group(CompanyContactCountyGroup)
- {
- ShowCaption = false;
- Visible = ContactCountyVisible;
- field(CompanyContactCounty; TempCompanyContact.County)
- {
- Caption = 'County';
- CaptionClass = '5,1,' + TempCompanyContact."Country/Region Code";
- ToolTip = 'Specifies the legal county of the company that you want to join to the network.';
- }
- }
- field(CompanyContactCountryRegion; TempCompanyContact."Country/Region Code")
- {
- Caption = 'Country/Region Code';
- ShowMandatory = true;
- ToolTip = 'Specifies the legal country code of the company that you want to join to the network. Must be stated in the ISO 3166-1 format.';
-
- trigger OnLookup(var Text: Text): Boolean
- var
- FormatAddress: Codeunit "Format Address";
- begin
- TempCompanyContact.LookupCountryRegion();
- TempCompanyContact.Validate("Country/Region Code");
- ContactCountyVisible := FormatAddress.UseCounty(TempCompanyContact."Country/Region Code");
- end;
-
- trigger OnValidate()
- var
- FormatAddress: Codeunit "Format Address";
- begin
- TempCompanyContact.Validate("Country/Region Code");
- ContactCountyVisible := FormatAddress.UseCounty(TempCompanyContact."Country/Region Code");
- SetButtonBehaviourCompanyContactInformation();
- end;
- }
- group(CompanyContactPerson)
- {
- Caption = 'Company Contact Person';
- field(CompanyContactPersonName; TempCompanyContact."Contact Name")
- {
- Caption = 'Name';
- ShowMandatory = true;
- ToolTip = 'Specifies the name of the contact person in the company.';
-
- trigger OnValidate()
- begin
- SetButtonBehaviourCompanyContactInformation();
- end;
- }
- field(CompanyContactPersonEmail; TempCompanyContact."Contact Email")
- {
- Caption = 'Email Address';
- ExtendedDatatype = EMail;
- ShowMandatory = true;
- ToolTip = 'Specifies the email address of the contact person in the company.';
-
- trigger OnValidate()
- begin
- TempCompanyContact.Validate("Contact Email");
- SetButtonBehaviourCompanyContactInformation();
- end;
- }
- field(CompanyContactPersonPhoneNo; TempCompanyContact."Contact Phone No.")
- {
- Caption = 'Phone No.';
- ExtendedDatatype = PhoneNo;
- ShowMandatory = true;
- ToolTip = 'Specifies the telephone number of the contact person in the company.';
-
- trigger OnValidate()
- begin
- TempCompanyContact.Validate("Contact Phone No.");
- SetButtonBehaviourCompanyContactInformation();
- end;
- }
- }
- }
- }
- }
- group(NetworkDetailsPage)
- {
- Caption = '';
- Visible = NetworkDetailsStepVisible;
- group(NetworkDetails)
- {
- Caption = 'To register the company in an electronic document network, please provide the following information:';
- Visible = NetworkDetailsStepVisible;
- group(NetworkDetails1)
- {
- InstructionalText = 'Specify the network you want to be registered as a participant in.';
- ShowCaption = false;
- }
- field(Network; TempParticipation.Network)
- {
- Caption = 'Network';
- ToolTip = 'Specifies the network name where the participation is in.';
-
- trigger OnValidate()
- begin
- OnboardingHelper.SetDefaultIdentifierData(TempParticipation, IdentifierTypeDesc);
- end;
- }
- group(NetworkDetails2)
- {
- InstructionalText = 'Specify how the company should be identified in the network.';
- ShowCaption = false;
- }
- field(IdentifierTypeDesc; IdentifierTypeDesc)
- {
- Caption = 'Identifier Type';
- ShowMandatory = true;
- ToolTip = 'Specifies the type of identifier used to identify the company in the network.';
-
- trigger OnValidate()
- begin
- OnboardingHelper.ValidateIdentifierType(TempParticipation, IdentifierTypeDesc);
- end;
-
- trigger OnLookup(var Text: Text): Boolean
- begin
- exit(OnboardingHelper.LookupIdentifierType(TempParticipation, Text));
- end;
- }
- field(CompanyIdentifierValue; TempParticipation."Identifier Value")
- {
- Caption = 'Identifier Value';
- ShowMandatory = true;
- ToolTip = 'Specifies the value of the identifier used to identify the company in the network.';
-
- trigger OnValidate()
- begin
- OnboardingHelper.ValidateIdentifierValue(TempParticipation);
- end;
- }
- }
- group(NextDocumentTypes)
- {
- InstructionalText = 'Choose Next to set up the document types you would like to exchange within the network.';
- ShowCaption = false;
- Visible = NetworkDetailsStepVisible;
- }
- }
- group(DocumentTypesPage)
- {
- Caption = '';
- Visible = DocumentTypesStepVisible;
- group(DocumentTypes)
- {
- Caption = 'What types of documents would you like to exchange within the network?';
- Visible = DocumentTypesStepVisible;
- group(SalesServiceDocuments)
- {
- Caption = 'Sales/Service Documents';
- field(SendInvoiceCreditMemo; SendInvoiceCreditMemo)
- {
- Caption = 'Send Invoice / Credit Memo';
- ToolTip = 'Specifies whether the company can send invoices and credit memos to other companies in the network.';
- }
- field(ReceiveInvoiceResponse; ReceiveInvoiceResponse)
- {
- Caption = 'Receive Invoice Response';
- ToolTip = 'Specifies whether the company can receive invoice responses from other companies in the network.';
- }
- field(ReceiveOrder; ReceiveOrder)
- {
- Caption = 'Receive Order';
- ToolTip = 'Specifies whether the company can receive orders from other companies in the network.';
- }
- field(SendOrderResponse; SendOrderResponse)
- {
- Caption = 'Send Order Response';
- ToolTip = 'Specifies whether the company can send order responses to other companies in the network.';
- }
- }
- group(PurchaseDocuments)
- {
- Caption = 'Purchase Documents';
- field(ReceiveInvoiceCreditMemo; ReceiveInvoiceCreditMemo)
- {
- Caption = 'Receive Invoice / Credit Memo';
- ToolTip = 'Specifies whether the company can receive invoices and credit memos from other companies in the network.';
- }
- field(SendInvoiceResponse; SendInvoiceResponse)
- {
- Caption = 'Send Invoice Response';
- ToolTip = 'Specifies whether the company can send invoice responses to other companies in the network.';
- }
- field(SendOrder; SendOrder)
- {
- Caption = 'Send Order';
- ToolTip = 'Specifies whether the company can send orders to other companies in the network.';
- }
- field(ReceiveOrderResponse; ReceiveOrderResponse)
- {
- Caption = 'Receive Order Response';
- ToolTip = 'Specifies whether the company can receive order responses from other companies in the network.';
- }
- }
-
- }
- }
- group(AdvancedSetupPage)
- {
- Caption = '';
- Visible = AdvancedSetupStepVisible;
- group(AdvancedSetup)
- {
- Caption = 'Advanced Setup';
- Visible = AdvancedSetupStepVisible;
- group(AdvancedSetup1)
- {
- InstructionalText = 'Use the list below to configure the network profiles you want to register.';
- ShowCaption = false;
- }
- part(SelectProfilesPeppol; "Continia Profile Selection") { }
- }
- }
- group(FinalPage)
- {
- Caption = '';
- Visible = FinalStepVisible;
- group("That's it!")
- {
- Caption = 'That''s it!';
- Visible = FinalStepVisible and (RunScenario = RunScenario::General);
- group(FinalPage1)
- {
- InstructionalText = 'Choose Finish to submit your registration to join the Continia Delivery Network.';
- ShowCaption = false;
- }
- group(FinalPage2)
- {
- InstructionalText = 'Continia will validate the information you have provided and notify you once your registration has been approved. Please note that this is a manual process, which may take 1–2 working days to complete.';
- ShowCaption = false;
- }
- group(FinalPage3)
- {
- InstructionalText = 'You can always check the status of your registration on the E-Document External Connection Setup page.';
- ShowCaption = false;
- }
- }
- group(ThatsItEdit)
- {
- Caption = 'That''s it!';
- Visible = FinalStepVisible and (RunScenario = RunScenario::EditParticipation);
- group(EditFinalPage1)
- {
- InstructionalText = 'Choose Finish to send the new registration information to Continia Delivery Network.';
- ShowCaption = false;
- }
- group(EditFinalPage2)
- {
- InstructionalText = 'You can always check the status of your registration on the E-Document External Connection Setup page.';
- ShowCaption = false;
- }
- }
- }
- }
- }
-
- actions
- {
- area(Processing)
- {
- action(ActionBack)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Back';
- Enabled = BackActionEnabled;
- Image = PreviousRecord;
- InFooterBar = true;
- ToolTip = 'Go back to the previous page.';
- Visible = BackActionVisible;
-
- trigger OnAction()
- begin
- MoveBack(false);
- end;
- }
- action(ActionNext)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Next';
- Enabled = NextActionEnabled;
- Image = NextRecord;
- InFooterBar = true;
- ToolTip = 'Go to the next page.';
- Visible = NextActionVisible;
-
- trigger OnAction()
- begin
- MoveNext(false);
- end;
- }
- action(ActionAdvancedSetup)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Advanced Setup';
- Enabled = AdvancedSetupActionEnabled;
- Image = NextRecord;
- InFooterBar = true;
- ToolTip = 'Open the list of network profiles to register.';
- Visible = AdvancedSetupActionEnabled;
-
- trigger OnAction()
- begin
- MoveStep(false, 1, false);
- end;
- }
- action(ActionFinish)
- {
- ApplicationArea = Basic, Suite;
- Caption = 'Finish';
- Enabled = FinishActionEnabled;
- Image = Approve;
- InFooterBar = true;
- ToolTip = 'Complete the onboarding.';
-
- trigger OnAction()
- begin
- FinishAction();
- end;
- }
- }
- }
-
- trigger OnOpenPage()
- begin
- if not OnboardingHelper.HasModifyPermissionOnParticipation() then
- Error(MissingSetupPermissionErr);
-
- case RunScenario of
- RunScenario::General:
- OnboardingHelper.InitializeGeneralScenario(TempCompanyContact, TempParticipation, CountyVisible, ContactCountyVisible, SkipCompanyInformation, IdentifierTypeDesc);
- RunScenario::EditSubscriptionInfo:
- begin
- OnboardingHelper.GetContactInformation(TempCompanyContact, true);
- Step := Step::CompanyContactInformation;
- CurrPage.Caption := EditSubscriptionPageCaptionLbl;
- end;
- RunScenario::EditParticipation:
- begin
- SetActivatedProfiles();
- Step := Step::LegalCompanyInformation;
- end;
- else
- Step := Step::Start;
- end;
- EnableControls();
- end;
-
- local procedure FinishAction()
- begin
- case RunScenario of
- RunScenario::EditSubscriptionInfo:
- if OnboardingHelper.IsCompanyInfoValid(TempCompanyContact) then begin
- OnboardingHelper.UpdateSubscriptionInfo(TempCompanyContact);
- CurrPage.Close();
- end;
- RunScenario::EditParticipation:
- begin
- if not OnboardingHelper.IsSubscribed() then
- OnboardingHelper.CreateSubscription(TempCompanyContact);
-
- OnboardingHelper.UpdateParticipation(TempParticipation);
- UpdateProfiles();
- CurrPage.Close();
- end;
- RunScenario::General:
- begin
- if not SkipCompanyInformation then begin
- if TempCompanyContact."Partner Id" = '' then
- TempCompanyContact."Partner Id" := PartnerId;
- OnboardingHelper.CreateSubscription(TempCompanyContact);
- end;
- RegisterParticipation();
- CurrPage.Close();
- end;
- else
- CurrPage.Close();
- end;
- end;
-
- local procedure MoveNext(CurrentStepSkipped: Boolean)
- begin
- case RunScenario of
- RunScenario::EditParticipation:
- case Step of
- Step::LegalCompanyInformation:
- if not OnboardingHelper.IsSubscribed() then
- MoveStep(true, 1, CurrentStepSkipped)
- else
- MoveStep(false, 4, CurrentStepSkipped);
- Step::CompanyContactInformation:
- if not OnboardingHelper.IsSubscribed() then
- MoveStep(true, 2, CurrentStepSkipped)
- else
- MoveStep(false, 3, CurrentStepSkipped);
- else
- if (Step = Step::DocumentTypes) and not CurrentStepSkipped then
- MoveStep(false, 2, CurrentStepSkipped)
- else
- MoveStep(false, 1, CurrentStepSkipped);
- end;
- else
- if (Step = Step::DocumentTypes) and not CurrentStepSkipped then
- MoveStep(false, 2, CurrentStepSkipped)
- else
- MoveStep(false, 1, CurrentStepSkipped);
- end;
- end;
-
- local procedure MoveBack(CurrentStepSkipped: Boolean)
- begin
- case RunScenario of
- RunScenario::EditParticipation:
- case Step of
- Step::LegalCompanyInformation:
- exit;
- Step::AdvancedSetup:
- if not OnboardingHelper.IsSubscribed() then
- MoveStep(true, 2, CurrentStepSkipped)
- else
- MoveStep(true, 4, CurrentStepSkipped);
- else
- MoveStep(true, 1, CurrentStepSkipped);
- end;
- else
- MoveStep(true, LastStepsForward, CurrentStepSkipped);
- end;
- end;
-
- local procedure MoveStep(Backwards: Boolean; Steps: Integer; CurrentStepSkipped: Boolean)
- begin
- OnBeforeMoveStep(Backwards, Steps, CurrentStepSkipped);
- if Backwards then begin
- LastStepsForward := 1;
- Step -= Steps;
- end else begin
- LastStepsForward := Steps;
- Step += Steps;
- end;
-
- EnableControls();
- OnAfterMoveStep(Backwards);
- end;
-
- local procedure OnBeforeMoveStep(Backwards: Boolean; Steps: Integer; CurrentStepSkipped: Boolean)
- begin
- if (Step = Step::PartnerDetails) and not Backwards and not CurrentStepSkipped then
- PartnerId := OnboardingHelper.InitializeClient(PartnerUserName, PartnerPassword);
-
- if (Step = Step::NetworkDetails) then
- if not Backwards and not CurrentStepSkipped then begin
- ValidateIdentifierData();
- InitializeNetworkProfiles();
- end;
-
- if (Step = Step::AdvancedSetup) and not Backwards and not CurrentStepSkipped then
- ValidateParticipationProfiles();
- if (Step = Step::DocumentTypes) and not Backwards and (Steps = 2) then
- ValidateParticipationProfiles();
- if (Step = Step::DocumentTypes) and (not Backwards) and (not CurrentStepSkipped) then
- PopulateNetworkProfilesByUserSelection();
- end;
-
- local procedure OnAfterMoveStep(Backwards: Boolean)
- begin
- if Step = Step::PartnerDetails then begin
- if not OnboardingHelper.AreClientCredentialsValid() then
- exit;
- // Skip Step
- if Backwards then
- MoveBack(true)
- else
- MoveNext(true);
- end;
-
- if Step = Step::NetworkDetails then begin
- ParticipationNetwork := TempParticipation.Network;
- ParticipationIdentifierValue := TempParticipation."Identifier Value";
- if IsNullGuid(TempParticipation."Identifier Type Id") then
- OnboardingHelper.SetDefaultIdentifierData(TempParticipation, IdentifierTypeDesc);
- end;
-
- if (Step = Step::LegalCompanyInformation) then
- OnboardingHelper.GetNetworkMetadata(true);
-
- if (Step = Step::CompanyContactInformation) then begin
- if not SkipCompanyInformation then
- exit;
-
- if Backwards then
- MoveBack(true)
- else
- MoveNext(true);
- end;
- end;
-
- local procedure EnableControls()
- begin
- ResetControls();
-
- case Step of
- Step::Start:
- ShowStartStep();
- Step::PartnerDetails:
- ShowPartnerDetailsStep();
- Step::LegalCompanyInformation:
- ShowLegalCompanyInformationStep();
- Step::CompanyContactInformation:
- ShowCompanyContactInformationStep();
- Step::NetworkDetails:
- ShowNetworkDetailsStep();
- Step::DocumentTypes:
- ShowDocumentTypesStep();
- Step::AdvancedSetup:
- ShowAdvancedSetupStep();
- Step::Finish:
- ShowFinalStep();
- end;
- end;
-
- local procedure ShowStartStep()
- begin
- FirstStepVisible := true;
- PartnerDetailsStepVisible := false;
- LegalCompanyInformationStepVisible := false;
- CompanyContactInformationStepVisible := false;
- NetworkDetailsStepVisible := false;
- DocumentTypesStepVisible := false;
- AdvancedSetupStepVisible := false;
- FinalStepVisible := false;
-
- BackActionEnabled := false;
- NextActionEnabled := true;
- FinishActionEnabled := false;
- AdvancedSetupActionEnabled := false;
- end;
-
- local procedure ShowPartnerDetailsStep()
- begin
- FirstStepVisible := false;
- PartnerDetailsStepVisible := true;
- LegalCompanyInformationStepVisible := false;
- CompanyContactInformationStepVisible := false;
- NetworkDetailsStepVisible := false;
- DocumentTypesStepVisible := false;
- AdvancedSetupStepVisible := false;
- FinalStepVisible := false;
-
- BackActionEnabled := true;
- NextActionEnabled := true;
- FinishActionEnabled := false;
- AdvancedSetupActionEnabled := false;
- end;
-
- local procedure ShowLegalCompanyInformationStep()
- begin
- FirstStepVisible := false;
- PartnerDetailsStepVisible := false;
- LegalCompanyInformationStepVisible := true;
- CompanyContactInformationStepVisible := false;
- NetworkDetailsStepVisible := false;
- DocumentTypesStepVisible := false;
- AdvancedSetupStepVisible := false;
- FinalStepVisible := false;
-
- BackActionEnabled := RunScenario <> RunScenario::EditParticipation;
- NextActionEnabled := LicenseTermsAccepted and OnboardingHelper.IsParticipationInfoValid(TempParticipation);
- FinishActionEnabled := false;
- AdvancedSetupActionEnabled := false;
- end;
-
- local procedure ShowCompanyContactInformationStep()
- begin
- FirstStepVisible := false;
- PartnerDetailsStepVisible := false;
- LegalCompanyInformationStepVisible := false;
- CompanyContactInformationStepVisible := true;
- NetworkDetailsStepVisible := false;
- DocumentTypesStepVisible := false;
- AdvancedSetupStepVisible := false;
- FinalStepVisible := false;
- BackActionEnabled := true;
- NextActionEnabled := OnboardingHelper.IsCompanyInfoValid(TempCompanyContact);
- FinishActionEnabled := false;
- AdvancedSetupActionEnabled := false;
-
- if RunScenario = RunScenario::EditSubscriptionInfo then begin
- BackActionVisible := false;
- NextActionVisible := false;
- FinishActionEnabled := OnboardingHelper.IsCompanyInfoValid(TempCompanyContact);
- end
- end;
-
- local procedure ShowNetworkDetailsStep()
- begin
- FirstStepVisible := false;
- PartnerDetailsStepVisible := false;
- LegalCompanyInformationStepVisible := false;
- CompanyContactInformationStepVisible := false;
- NetworkDetailsStepVisible := true;
- DocumentTypesStepVisible := false;
- AdvancedSetupStepVisible := false;
- FinalStepVisible := false;
-
- BackActionEnabled := true;
- NextActionEnabled := true;
- FinishActionEnabled := false;
- AdvancedSetupActionEnabled := false;
- end;
-
- local procedure ShowDocumentTypesStep()
- begin
- FirstStepVisible := false;
- PartnerDetailsStepVisible := false;
- LegalCompanyInformationStepVisible := false;
- CompanyContactInformationStepVisible := false;
- NetworkDetailsStepVisible := false;
- DocumentTypesStepVisible := true;
- AdvancedSetupStepVisible := false;
- FinalStepVisible := false;
-
- BackActionEnabled := true;
- NextActionEnabled := true;
- FinishActionEnabled := false;
- AdvancedSetupActionEnabled := true;
- end;
-
- local procedure ShowAdvancedSetupStep()
- begin
- FirstStepVisible := false;
- PartnerDetailsStepVisible := false;
- LegalCompanyInformationStepVisible := false;
- CompanyContactInformationStepVisible := false;
- NetworkDetailsStepVisible := false;
- DocumentTypesStepVisible := false;
- AdvancedSetupStepVisible := true;
- FinalStepVisible := false;
-
- BackActionEnabled := true;
- NextActionEnabled := true;
- FinishActionEnabled := false;
- AdvancedSetupActionEnabled := false;
- end;
-
- local procedure ShowFinalStep()
- begin
- FirstStepVisible := false;
- PartnerDetailsStepVisible := false;
- LegalCompanyInformationStepVisible := false;
- CompanyContactInformationStepVisible := false;
- NetworkDetailsStepVisible := false;
- DocumentTypesStepVisible := false;
- AdvancedSetupStepVisible := false;
- FinalStepVisible := true;
-
- BackActionEnabled := true;
- NextActionEnabled := false;
- FinishActionEnabled := true;
- AdvancedSetupActionEnabled := false;
- end;
-
- local procedure ResetControls()
- begin
- BackActionEnabled := true;
- NextActionEnabled := true;
- BackActionVisible := true;
- NextActionVisible := true;
- AdvancedSetupActionEnabled := false;
-
- FirstStepVisible := false;
- PartnerDetailsStepVisible := false;
- LegalCompanyInformationStepVisible := false;
- CompanyContactInformationStepVisible := false;
- NetworkDetailsStepVisible := false;
- DocumentTypesStepVisible := false;
- AdvancedSetupStepVisible := false;
- FinalStepVisible := false;
- end;
-
- local procedure UpdateProfiles()
- var
- TempActivatedProfiles: Record "Continia Activated Net. Prof." temporary;
- begin
- CurrPage.SelectProfilesPeppol.Page.GetProfileSelection(TempActivatedProfiles);
- OnboardingHelper.UpdateProfiles(TempParticipation, TempActivatedProfiles);
- end;
-
- local procedure RegisterParticipation()
- var
- TempActivatedProfiles: Record "Continia Activated Net. Prof." temporary;
- begin
- CurrPage.SelectProfilesPeppol.Page.GetProfileSelection(TempActivatedProfiles);
- OnboardingHelper.RegisterParticipation(TempParticipation, TempActivatedProfiles);
- end;
-
- local procedure InitializeNetworkProfiles()
- var
- TempActivatedProfiles: Record "Continia Activated Net. Prof." temporary;
- begin
- OnboardingHelper.InitializeNetworkProfiles(TempParticipation, TempActivatedProfiles);
-
- CurrPage.SelectProfilesPeppol.Page.ClearProfileSelections();
- CurrPage.SelectProfilesPeppol.Page.SetProfileSelection(TempActivatedProfiles);
- end;
-
- local procedure SetActivatedProfiles()
- var
- TempActivatedProfiles: Record "Continia Activated Net. Prof." temporary;
- begin
- OnboardingHelper.GetCurrentActivatedProfiles(TempParticipation, TempActivatedProfiles);
-
- CurrPage.SelectProfilesPeppol.Page.ClearProfileSelections();
- CurrPage.SelectProfilesPeppol.Page.SetCurrentNetwork(TempParticipation.Network);
- CurrPage.SelectProfilesPeppol.Page.SetProfileSelection(TempActivatedProfiles);
- end;
-
- local procedure ValidateIdentifierData()
- begin
- TempParticipation.TestField("Identifier Type Id");
- TempParticipation.TestField("Identifier Value");
- OnboardingHelper.ValidateIdentifierValue(TempParticipation);
- end;
-
- local procedure ValidateParticipationProfiles()
- var
- TempActivatedProfiles: Record "Continia Activated Net. Prof." temporary;
- ApiRequests: Codeunit "Continia Api Requests";
- begin
- CurrPage.SelectProfilesPeppol.Page.GetProfileSelection(TempActivatedProfiles);
-
- if TempActivatedProfiles.Count = 0 then
- Error(MustChooseAProfileErr);
-
- // Check if the profiles are not already registered, the function will thrown an error if any profiles are already registered
- ApiRequests.CheckProfilesNotRegistered(TempParticipation);
- end;
-
- internal procedure SetRunScenario(ParamRunScenario: Enum "Continia Wizard Scenario")
- begin
- RunScenario := ParamRunScenario;
- end;
-
- internal procedure SetParticipation(ParamParticipation: Record "Continia Participation")
- begin
- TempParticipation := ParamParticipation;
- if TempParticipation."Registration Status" in [TempParticipation."Registration Status"::Disabled, TempParticipation."Registration Status"::Rejected, TempParticipation."Registration Status"::Draft] then
- TempParticipation."Registration Status" := TempParticipation."Registration Status"::InProcess; // Reactivate the participation
- TempParticipation.Insert();
- end;
-
- local procedure SetButtonBehaviourCompanyContactInformation()
- begin
- if RunScenario = RunScenario::EditSubscriptionInfo then begin
- NextActionVisible := false;
- BackActionVisible := false;
- FinishActionEnabled := OnboardingHelper.IsCompanyInfoValid(TempCompanyContact);
- end else
- NextActionEnabled := OnboardingHelper.IsCompanyInfoValid(TempCompanyContact);
- end;
-
- local procedure PopulateNetworkProfilesByUserSelection()
- var
- TempActivatedProfiles: Record "Continia Activated Net. Prof." temporary;
- begin
- TempActivatedProfiles.DeleteAll();
-
- GetSelectedNetworksProfiles(TempActivatedProfiles);
- CurrPage.SelectProfilesPeppol.Page.SetCurrentNetwork(TempParticipation.Network);
- CurrPage.SelectProfilesPeppol.Page.ClearProfileSelections();
- CurrPage.SelectProfilesPeppol.Page.SetProfileSelection(TempActivatedProfiles);
- end;
-
- local procedure GetSelectedNetworksProfiles(var ActivatedProfiles: Record "Continia Activated Net. Prof." temporary)
- var
- ProfileDirection: Enum "Continia Profile Direction";
- begin
- if SendInvoiceCreditMemo or ReceiveInvoiceCreditMemo then
- OnboardingHelper.AddInvoiceCreditMemoProfiles(TempParticipation, GetNetworkProfileDirection(SendInvoiceCreditMemo, ReceiveInvoiceCreditMemo), ActivatedProfiles);
-
- if SendInvoiceResponse or ReceiveInvoiceResponse then begin
- case TempParticipation.Network of
- TempParticipation.Network::Peppol:
- ProfileDirection := GetNetworkProfileDirection(SendInvoiceResponse, ReceiveInvoiceResponse);
- TempParticipation.Network::Nemhandel:
- ProfileDirection := GetNetworkProfileDirection(SendInvoiceCreditMemo, ReceiveInvoiceCreditMemo);
- end;
- OnboardingHelper.AddInvoiceResponseProfiles(TempParticipation, ProfileDirection, ActivatedProfiles);
- end;
-
- if (SendOrder or ReceiveOrder) and (not (SendOrderResponse or ReceiveOrderResponse)) then
- OnboardingHelper.AddOrderOnlyProfiles(TempParticipation, GetNetworkProfileDirection(SendOrder, ReceiveOrder), ActivatedProfiles);
-
- if (SendOrder or ReceiveOrder) and (SendOrderResponse or ReceiveInvoiceResponse) then
- OnboardingHelper.AddOrderProfiles(TempParticipation, GetNetworkProfileDirection(SendOrder, ReceiveOrder), ActivatedProfiles);
-
- if SendOrderResponse or ReceiveOrderResponse then
- OnboardingHelper.AddOrderResponseProfiles(TempParticipation, GetNetworkProfileDirection(SendOrderResponse, ReceiveOrderResponse), ActivatedProfiles);
-
- if (SendInvoiceCreditMemo or ReceiveInvoiceCreditMemo) and (SendOrder or ReceiveOrder) then
- OnboardingHelper.AddInvoiceAndOrderProfiles(TempParticipation, GetNetworkProfileDirection(SendInvoiceCreditMemo or SendOrder, ReceiveInvoiceCreditMemo or ReceiveOrder), ActivatedProfiles);
- end;
-
- local procedure GetNetworkProfileDirection(Send: Boolean; Receive: Boolean): Enum "Continia Profile Direction"
- begin
- case true of
- Receive and Send:
- exit("Continia Profile Direction"::Both);
- Receive and (not Send):
- exit("Continia Profile Direction"::Inbound);
- Send and (not Receive):
- exit("Continia Profile Direction"::Outbound);
- end;
- end;
-
- var
- TempCompanyContact: Record "Continia Participation" temporary;
- TempParticipation: Record "Continia Participation" temporary;
- OnboardingHelper: Codeunit "Continia Onboarding Helper";
- AdvancedSetupActionEnabled, BackActionEnabled, FinishActionEnabled, NextActionEnabled : Boolean;
- AdvancedSetupStepVisible, BackActionVisible, CompanyContactInformationStepVisible, DocumentTypesStepVisible, FinalStepVisible, FirstStepVisible, LegalCompanyInformationStepVisible, NetworkDetailsStepVisible, NextActionVisible, PartnerDetailsStepVisible : Boolean;
- ContactCountyVisible, CountyVisible : Boolean;
- LicenseTermsAccepted: Boolean;
- ReceiveInvoiceCreditMemo, ReceiveInvoiceResponse, ReceiveOrder, ReceiveOrderResponse, SendInvoiceCreditMemo, SendInvoiceResponse, SendOrder, SendOrderResponse : Boolean;
- SkipCompanyInformation: Boolean;
- ParticipationNetwork: Enum "Continia E-Delivery Network";
- RunScenario: Enum "Continia Wizard Scenario";
- LastStepsForward: Integer;
- EditSubscriptionPageCaptionLbl: Label 'Company Contact Information';
- MustChooseAProfileErr: Label 'You must select one or more network profiles.';
- NoPasswordErr: Label 'Please enter a password.';
- PartnerRegAsNewTxt: Label 'Not a partner?';
- PartnerReqPwdTxt: Label 'Forgot the password?';
- MissingSetupPermissionErr: Label 'You do not have permissions to modify or create a participation';
- Step: Option Start,PartnerDetails,LegalCompanyInformation,CompanyContactInformation,NetworkDetails,DocumentTypes,AdvancedSetup,Finish;
- IdentifierTypeDesc: Text;
- ParticipationIdentifierValue: Text;
- [NonDebuggable]
- PartnerPassword: Text;
- [NonDebuggable]
- PartnerUserName: Text;
- [NonDebuggable]
- PartnerId: Code[20];
-
-}
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/app/src/Onboarding/ContiniaOnboardingHelper.Codeunit.al b/Apps/W1/EDocumentConnectors/Continia/app/src/Onboarding/ContiniaOnboardingHelper.Codeunit.al
deleted file mode 100644
index c6c49dd8bd..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/app/src/Onboarding/ContiniaOnboardingHelper.Codeunit.al
+++ /dev/null
@@ -1,634 +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.EServices.EDocumentConnector.Continia;
-
-using Microsoft.Foundation.Address;
-using Microsoft.Foundation.Company;
-using Microsoft.eServices.EDocument;
-using System.Utilities;
-
-codeunit 6394 "Continia Onboarding Helper"
-{
- Access = Internal;
- Permissions = tabledata "Continia Network Profile" = rimd,
- tabledata "Continia Network Identifier" = rimd,
- tabledata "Continia Participation" = rimd,
- tabledata "Continia Activated Net. Prof." = rimd;
-
- internal procedure InitializeGeneralScenario(var TempCompanyContact: Record "Continia Participation" temporary; var TempParticipation: Record "Continia Participation" temporary; var ParticipationCountyVisible: Boolean; var ContactInfoCountyVisible: Boolean; var SkipCompanyInformation: Boolean; var IdentifierTypeDesc: Text)
- var
- ConnectionSetup: Record "Continia Connection Setup";
- FormatAddress: Codeunit "Format Address";
- begin
- TempCompanyContact.Init();
- TempCompanyContact.Insert();
-
- ParticipationCountyVisible := FormatAddress.UseCounty(TempParticipation."Country/Region Code");
- ContactInfoCountyVisible := FormatAddress.UseCounty(TempCompanyContact."Country/Region Code");
-
- if AreClientCredentialsValid() then begin
- ShowProgressWindow(UpdatingDataProgressMsg);
- GetNetworkMetadata(false);
- GetContactInformation(TempCompanyContact, false);
- CloseProgressWindow();
- end;
-
- FillParticipationWithCompanyInfo(TempParticipation, IdentifierTypeDesc);
-
- if ConnectionSetup.Get() then
- if (TempCompanyContact."Company Name" <> '') and (ConnectionSetup."Subscription Status" = ConnectionSetup."Subscription Status"::Subscription) then
- SkipCompanyInformation := true;
- end;
-
- internal procedure GetContactInformation(var TempParticipationCompanyContact: Record "Continia Participation" temporary; ShowProgress: Boolean)
- var
- ActivationMgt: Codeunit "Continia Subscription Mgt.";
- begin
- if ShowProgress then
- ShowProgressWindow(UpdatingDataProgressMsg);
-
- ActivationMgt.GetClientInfoApp(TempParticipationCompanyContact, true);
- if ShowProgress then
- CloseProgressWindow();
- end;
-
- internal procedure AreClientCredentialsValid(): Boolean
- var
- CredentialManagement: Codeunit "Continia Credential Management";
- begin
- exit(CredentialManagement.IsClientCredentialsValid());
- end;
-
- internal procedure InitializeClient(PartnerUserName: Text; PartnerPassword: SecretText) PartnerId: Code[20]
- var
- ActivationMgt: Codeunit "Continia Subscription Mgt.";
- begin
- ShowProgressWindow(SendingDataProgressMsg);
- ActivationMgt.InitializeContiniaClient(PartnerUserName, PartnerPassword, PartnerId);
- AreClientCredentialsValid();
- CloseProgressWindow();
- end;
-
- internal procedure GetNetworkMetadata(ShowProgress: Boolean)
- var
- ApiRequests: Codeunit "Continia Api Requests";
- begin
- if MetaDataLoaded then
- exit;
-
- if ShowProgress then
- ShowProgressWindow(UpdatingDataProgressMsg);
-
- ApiRequests.GetNetworkIdTypes(Enum::"Continia E-Delivery Network"::Peppol);
- ApiRequests.GetNetworkIdTypes(Enum::"Continia E-Delivery Network"::Nemhandel);
-
- ApiRequests.GetNetworkProfiles(Enum::"Continia E-Delivery Network"::Peppol);
- ApiRequests.GetNetworkProfiles(Enum::"Continia E-Delivery Network"::Nemhandel);
-
- if ShowProgress then
- CloseProgressWindow();
-
- MetaDataLoaded := true;
- end;
-
- internal procedure FillParticipationWithCompanyInfo(var TempParticipation: Record "Continia Participation" temporary; var IdentifierTypeDesc: Text)
- var
- CompanyInfo: Record "Company Information";
- CountryRegion: Record "Country/Region";
- begin
- CompanyInfo.Get();
- TempParticipation.Init();
- if MetaDataLoaded then
- SetDefaultIdentifierData(TempParticipation, IdentifierTypeDesc);
-
- TempParticipation."Company Name" := CompanyInfo.Name;
- TempParticipation."VAT Registration No." := CompanyInfo."VAT Registration No.";
- TempParticipation.Address := CompanyInfo.Address;
- TempParticipation."Post Code" := CompanyInfo."Post Code";
- TempParticipation."Country/Region Code" := CompanyInfo."Country/Region Code";
- if CountryRegion.Get(CompanyInfo."Country/Region Code") then begin
- TempParticipation."Country/Region Code" := CountryRegion."ISO Code";
- TempParticipation.County := CompanyInfo.County;
- end;
-
- TempParticipation."Your Name" := 'N/A';
- TempParticipation."Contact Email" := 'N/A';
- TempParticipation."Contact Name" := 'N/A';
- TempParticipation."Contact Phone No." := 'N/A';
- end;
-
- internal procedure SetDefaultIdentifierData(var TempParticipation: Record "Continia Participation" temporary; var IdentifierTypeDesc: Text)
- var
- CompanyInformation: Record "Company Information";
- NetworkIdentifier: Record "Continia Network Identifier";
- EmptyGuid: Guid;
- begin
- CompanyInformation.Get();
-
- Clear(NetworkIdentifier);
- NetworkIdentifier.SetRange(Network, TempParticipation.Network);
- if TempParticipation."Country/Region Code" <> '' then
- NetworkIdentifier.SetRange("Default in Country", TempParticipation."Country/Region Code")
- else
- NetworkIdentifier.SetRange(Default, true);
-
- if NetworkIdentifier.FindFirst() then begin
- TempParticipation."Identifier Type Id" := NetworkIdentifier.Id;
- TempParticipation."Identifier Value" := CompanyInformation."VAT Registration No.";
- IdentifierTypeDesc := NetworkIdentifier."Scheme Id";
- end else begin
- TempParticipation."Identifier Type Id" := EmptyGuid;
- TempParticipation."Identifier Value" := '';
- IdentifierTypeDesc := '';
- end;
- end;
-
- internal procedure ValidateIdentifierType(var TempParticipation: Record "Continia Participation" temporary; var IdentifierTypeDesc: Text)
- var
- NetworkIdentifier: Record "Continia Network Identifier";
- begin
- if IdentifierTypeDesc <> '' then begin
- NetworkIdentifier.SetRange(Network, TempParticipation.Network);
- NetworkIdentifier.SetRange(Enabled, true);
- NetworkIdentifier.SetRange("Scheme Id", IdentifierTypeDesc);
- NetworkIdentifier.FindFirst();
- TempParticipation."Identifier Type Id" := NetworkIdentifier.Id;
- IdentifierTypeDesc := NetworkIdentifier."Scheme Id";
- end;
- end;
-
- internal procedure LookupIdentifierType(var TempParticipation: Record "Continia Participation" temporary; var IdentifierTypeDesc: Text): Boolean
- var
- NetworkIdentifier: Record "Continia Network Identifier";
- NetworkIdentifierList: Page "Continia Network Id. List";
- begin
- Clear(NetworkIdentifier);
- NetworkIdentifier.SetRange(Network, TempParticipation.Network);
- NetworkIdentifier.SetRange(Enabled, true);
- NetworkIdentifierList.SetTableView(NetworkIdentifier);
- NetworkIdentifierList.LookupMode(true);
-
- if NetworkIdentifierList.RunModal() = Action::LookupOK then begin
- NetworkIdentifierList.GetRecord(NetworkIdentifier);
- IdentifierTypeDesc := NetworkIdentifier."Scheme Id";
- TempParticipation."Identifier Type Id" := NetworkIdentifier.Id;
- exit(true);
- end;
- end;
-
- internal procedure ValidateIdentifierValue(var TempParticipation: Record "Continia Participation" temporary)
- var
- NetworkIdentifier: Record "Continia Network Identifier";
- RegEx: Codeunit Regex;
- begin
- if NetworkIdentifier.Get(TempParticipation."Identifier Type Id") then
- if not RegEx.IsMatch(TempParticipation."Identifier Value", NetworkIdentifier."Validation Rule") then
- Error(InvalidIdentifierValueErr, TempParticipation."Identifier Value", NetworkIdentifier."Validation Rule");
- end;
-
- internal procedure GetCurrentActivatedProfiles(var TempParticipation: Record "Continia Participation" temporary; var TempActivatedProfiles: Record "Continia Activated Net. Prof." temporary)
- var
- ActivatedProfiles: Record "Continia Activated Net. Prof.";
- begin
- ActivatedProfiles.SetRange(Network, TempParticipation.Network);
- ActivatedProfiles.SetRange("Identifier Type Id", TempParticipation."Identifier Type Id");
- ActivatedProfiles.SetRange("Identifier Value", TempParticipation."Identifier Value");
- if ActivatedProfiles.FindSet() then
- repeat
- TempActivatedProfiles.Init();
- TempActivatedProfiles := ActivatedProfiles;
- TempActivatedProfiles.Insert();
- until ActivatedProfiles.Next() = 0;
- end;
-
- internal procedure InitializeNetworkProfiles(var TempParticipation: Record "Continia Participation" temporary; var TempActivatedProfiles: Record "Continia Activated Net. Prof." temporary)
- var
- NetworkProfile: Record "Continia Network Profile";
- begin
- NetworkProfile.SetRange(Network, TempParticipation.Network);
- NetworkProfile.SetRange(Mandatory, true);
- NetworkProfile.SetFilter("Mandatory for Country", '%1|%2', '', TempParticipation."Country/Region Code");
- NetworkProfile.SetRange(Enabled, true);
- if NetworkProfile.FindSet() then
- repeat
- TempActivatedProfiles.Init();
- TempActivatedProfiles."Network Profile Id" := NetworkProfile.Id;
- TempActivatedProfiles.Insert();
- until NetworkProfile.Next() = 0;
- end;
-
- internal procedure IsCompanyInfoValid(var TempCompanyContact: Record "Continia Participation" temporary): Boolean
- begin
- if TempCompanyContact."Company Name" = '' then
- exit(false);
-
- if TempCompanyContact."VAT Registration No." = '' then
- exit(false);
-
- if TempCompanyContact.Address = '' then
- exit(false);
-
- if TempCompanyContact."Post Code" = '' then
- exit(false);
-
- if TempCompanyContact."Country/Region Code" = '' then
- exit(false);
-
- if TempCompanyContact."Contact Name" = '' then
- exit(false);
-
- if TempCompanyContact."Contact Email" = '' then
- exit(false);
-
- if TempCompanyContact."Contact Phone No." = '' then
- exit(false);
-
- exit(true);
- end;
-
- internal procedure IsParticipationInfoValid(var TempParticipation: Record "Continia Participation" temporary): Boolean
- begin
- if TempParticipation."Company Name" = '' then
- exit(false);
-
- if TempParticipation."VAT Registration No." = '' then
- exit(false);
-
- if TempParticipation.Address = '' then
- exit(false);
-
- if TempParticipation."Post Code" = '' then
- exit(false);
-
- if TempParticipation."Country/Region Code" = '' then
- exit(false);
-
- if TempParticipation."Signatory Name" = '' then
- exit(false);
-
- if TempParticipation."Signatory Email" = '' then
- exit(false);
-
- exit(true);
- end;
-
- internal procedure UpdateParticipation(var TempParticipation: Record "Continia Participation" temporary)
- var
- ApiRequests: Codeunit "Continia Api Requests";
- begin
- if IsParticipationChanged(TempParticipation) then begin
- ShowProgressWindow(SendingDataProgressMsg);
- ApiRequests.PatchParticipation(TempParticipation);
- CloseProgressWindow();
- end;
- end;
-
- internal procedure UpdateProfiles(var TempParticipation: Record "Continia Participation" temporary; var TempActivatedProfiles: Record "Continia Activated Net. Prof." temporary)
- var
- ActivatedProfiles: Record "Continia Activated Net. Prof.";
- ApiRequests: Codeunit "Continia Api Requests";
- begin
- ShowProgressWindow(SendingDataProgressMsg);
- if TempActivatedProfiles.FindSet() then
- repeat
- if IsNullGuid(TempActivatedProfiles."Identifier Type Id") and (TempActivatedProfiles."Identifier Value" = '') then
- TempActivatedProfiles.Rename(TempParticipation.Network, TempParticipation."Identifier Type Id", TempParticipation."Identifier Value", TempActivatedProfiles."Network Profile Id");
- if ActivatedProfiles.Get(TempActivatedProfiles.RecordId) then begin
- if (TempActivatedProfiles."Profile Direction" <> ActivatedProfiles."Profile Direction") or (TempActivatedProfiles.Disabled <> ActivatedProfiles.Disabled) then
- ApiRequests.PatchParticipationProfile(TempActivatedProfiles, TempParticipation.Id);
- if TempActivatedProfiles."E-Document Service Code" <> ActivatedProfiles."E-Document Service Code" then begin
- ActivatedProfiles."E-Document Service Code" := TempActivatedProfiles."E-Document Service Code";
- ActivatedProfiles.Modify(true);
- end;
- end else
- ApiRequests.PostParticipationProfile(TempActivatedProfiles, TempParticipation.Id);
- until TempActivatedProfiles.Next() = 0;
-
- ActivatedProfiles.SetRange("Identifier Type Id", TempParticipation."Identifier Type Id");
- ActivatedProfiles.SetRange("Identifier Value", TempParticipation."Identifier Value");
- ActivatedProfiles.SetRange(Network, TempParticipation.Network);
- if ActivatedProfiles.FindSet() then
- repeat
- if not TempActivatedProfiles.Get(ActivatedProfiles.RecordId) then
- ApiRequests.DeleteParticipationProfile(ActivatedProfiles, TempParticipation.Id);
- until ActivatedProfiles.Next() = 0;
-
- CloseProgressWindow();
- end;
-
- internal procedure RegisterParticipation(var TempParticipation: Record "Continia Participation" temporary; var TempActivatedProfiles: Record "Continia Activated Net. Prof." temporary)
- var
- CompanyInfo: Record "Company Information";
- Participation: Record "Continia Participation";
- ApiRequests: Codeunit "Continia Api Requests";
- ParticipationGuid: Guid;
- begin
- ShowProgressWindow(SendingDataProgressMsg);
- ParticipationGuid := ApiRequests.PostParticipation(TempParticipation);
- Participation.SetRange(Id, ParticipationGuid);
- Participation.FindFirst();
-
- TempActivatedProfiles.FindSet();
- repeat
- ApiRequests.PostParticipationProfile(TempActivatedProfiles, ParticipationGuid);
- until TempActivatedProfiles.Next() = 0;
-
- Participation.Validate("Registration Status", Participation."Registration Status"::InProcess);
- Participation.Modify();
-
- ApiRequests.PatchParticipation(Participation);
-
- if Participation.Network = Participation.Network::Nemhandel then begin
- CompanyInfo.Get();
- if CompanyInfo."Registration No." = '' then begin
- CompanyInfo."Registration No." := CopyStr(Participation."Identifier Value", 1, 20);
- CompanyInfo.Modify();
- end;
- end;
- CloseProgressWindow();
- end;
-
- internal procedure IsParticipationChanged(var TempParticipation: Record "Continia Participation" temporary): Boolean
- var
- Participation: Record "Continia Participation";
- begin
- if not Participation.Get(TempParticipation.Network, TempParticipation."Identifier Type Id", TempParticipation."Identifier Value") then
- exit(true);
-
- if TempParticipation.Address <> Participation.Address then
- exit(true);
-
- if TempParticipation."Company Name" <> Participation."Company Name" then
- exit(true);
-
- if TempParticipation."VAT Registration No." <> Participation."VAT Registration No." then
- exit(true);
-
- if TempParticipation."Country/Region Code" <> Participation."Country/Region Code" then
- exit(true);
-
- if TempParticipation."Post Code" <> Participation."Post Code" then
- exit(true);
-
- if TempParticipation.County <> Participation.County then
- exit(true);
-
- if TempParticipation."Signatory Email" <> Participation."Signatory Email" then
- exit(true);
-
- if TempParticipation."Signatory Name" <> Participation."Signatory Name" then
- exit(true);
-
- if TempParticipation."Registration Status" <> Participation."Registration Status" then
- exit(true);
- end;
-
- internal procedure CreateSubscription(var TempCompanyContact: Record "Continia Participation" temporary)
- var
- ConnectionSetup: Record "Continia Connection Setup";
- SubscriptionMgt: Codeunit "Continia Subscription Mgt.";
- SubscriptionState: Enum "Continia Subscription Status";
- begin
- ShowProgressWindow(SendingDataProgressMsg);
- SubscriptionState := SubscriptionState::Subscription;
- if SubscriptionMgt.UpdateSubscription(SubscriptionState, TempCompanyContact, true) then begin
- SubscriptionMgt.AcceptCompanyLicense(CompanyName);
- ConnectionSetup.Get();
- ConnectionSetup."Subscription Status" := SubscriptionState;
- ConnectionSetup.Modify();
- end;
- CloseProgressWindow();
- end;
-
- internal procedure UpdateSubscriptionInfo(var TempCompanyContact: Record "Continia Participation" temporary)
- var
- SubscriptionMgt: Codeunit "Continia Subscription Mgt.";
- begin
- ShowProgressWindow(SendingDataProgressMsg);
- if not IsSubscribed() then
- CreateSubscription(TempCompanyContact)
- else
- SubscriptionMgt.UpdateClientInformation(TempCompanyContact);
- CloseProgressWindow();
- end;
-
- internal procedure IsSubscribed(): Boolean
- var
- ConnectionSetup: Record "Continia Connection Setup";
- begin
- ConnectionSetup.Get();
- exit(ConnectionSetup."Subscription Status" = ConnectionSetup."Subscription Status"::Subscription);
- end;
-
- #region Simple User Choice functions
- internal procedure AddInvoiceCreditMemoProfiles(var TempParticipation: Record "Continia Participation" temporary; ProfileDirection: Enum "Continia Profile Direction"; var ActivatedProfiles: Record "Continia Activated Net. Prof." temporary)
- begin
- case TempParticipation.Network of
- "Continia E-Delivery Network"::Peppol:
- AddPeppolInvoiceCreditMemoProfiles(TempParticipation, ActivatedProfiles, ProfileDirection);
- "Continia E-Delivery Network"::Nemhandel:
- AddNetworkProfileByIdentifiers(TempParticipation, ActivatedProfiles, ProfileDirection,
- 'urn:www.nesubl.eu:profiles:profile5:ver2.0', '');
- end;
- end;
-
- local procedure AddPeppolInvoiceCreditMemoProfiles(var TempParticipation: Record "Continia Participation" temporary; var ActivatedProfiles: Record "Continia Activated Net. Prof."; ProfileDirection: Enum "Continia Profile Direction")
- begin
- case TempParticipation."Country/Region Code" of
- 'DE':
- PopulateDEInvoiceCreditMemoProfiles(TempParticipation, ActivatedProfiles, ProfileDirection);
- 'NL':
- PopulateNLInvoiceCreditMemoProfiles(TempParticipation, ActivatedProfiles, ProfileDirection);
- end;
-
- //PEPPOL Credit Note (BIS 3.0)
- AddNetworkProfileByIdentifiers(TempParticipation, ActivatedProfiles, ProfileDirection,
- 'urn:fdc:peppol.eu:2017:poacc:billing:01:1.0',
- 'urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2::CreditNote##urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0::2.1');
- //PEPPOL Cross Industry Invoice (BIS 3.0)
- AddNetworkProfileByIdentifiers(TempParticipation, ActivatedProfiles, ProfileDirection,
- 'urn:fdc:peppol.eu:2017:poacc:billing:01:1.0',
- 'urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100::CrossIndustryInvoice##urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0::D16B');
- //PEPPOL Invoice (BIS 3.0)
- AddNetworkProfileByIdentifiers(TempParticipation, ActivatedProfiles, ProfileDirection,
- 'urn:fdc:peppol.eu:2017:poacc:billing:01:1.0',
- 'urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0::2.1');
- end;
-
- local procedure PopulateDEInvoiceCreditMemoProfiles(var TempParticipation: Record "Continia Participation" temporary; var ActivatedProfiles: Record "Continia Activated Net. Prof."; ProfileDirection: Enum "Continia Profile Direction")
- var
- NetworkProfile: Record "Continia Network Profile";
- begin
- NetworkProfile.SetRange(Network, TempParticipation.Network);
- NetworkProfile.SetRange("Mandatory for Country", 'DE');
- if NetworkProfile.FindSet() then
- repeat
- AddNetworkProfileByIdentifiers(TempParticipation, ActivatedProfiles, ProfileDirection, NetworkProfile."Process Identifier", NetworkProfile."Document Identifier");
- until NetworkProfile.Next() = 0;
- end;
-
- local procedure PopulateNLInvoiceCreditMemoProfiles(var TempParticipation: Record "Continia Participation" temporary; var ActivatedProfiles: Record "Continia Activated Net. Prof."; ProfileDirection: Enum "Continia Profile Direction")
- begin
- //SI-UBL 2.0 Credit Note
- AddNetworkProfileByIdentifiers(TempParticipation, ActivatedProfiles, ProfileDirection,
- 'urn:fdc:peppol.eu:2017:poacc:billing:01:1.0',
- 'urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2::CreditNote##urn:cen.eu:en16931:2017#compliant#urn:fdc:nen.nl:nlcius:v1.0::2.1');
- //SI-UBL 2.0 Invoice
- AddNetworkProfileByIdentifiers(TempParticipation, ActivatedProfiles, ProfileDirection,
- 'urn:fdc:peppol.eu:2017:poacc:billing:01:1.0',
- 'urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##urn:cen.eu:en16931:2017#compliant#urn:fdc:nen.nl:nlcius:v1.0::2.1');
- end;
-
- internal procedure AddInvoiceResponseProfiles(var TempParticipation: Record "Continia Participation" temporary; ProfileDirection: Enum "Continia Profile Direction"; var ActivatedProfiles: Record "Continia Activated Net. Prof.")
- begin
- case TempParticipation.Network of
- "Continia E-Delivery Network"::Peppol:
- PopulatePeppolInvoiceResponseProfiles(TempParticipation, ActivatedProfiles, ProfileDirection);
- "Continia E-Delivery Network"::Nemhandel:
- AddNetworkProfileByIdentifiers(TempParticipation, ActivatedProfiles, ProfileDirection,
- 'Procurement-BilSim-1.0', '');
- end;
- end;
-
- local procedure PopulatePeppolInvoiceResponseProfiles(var TempParticipation: Record "Continia Participation" temporary; var ActivatedProfiles: Record "Continia Activated Net. Prof."; ProfileDirection: Enum "Continia Profile Direction")
- begin
- //PEPPOL Invoice Response (BIS 3.0)
- AddNetworkProfileByIdentifiers(TempParticipation, ActivatedProfiles, ProfileDirection,
- 'urn:fdc:peppol.eu:poacc:bis:invoice_response:3',
- 'urn:oasis:names:specification:ubl:schema:xsd:ApplicationResponse-2::ApplicationResponse##urn:fdc:peppol.eu:poacc:trns:invoice_response:3::2.1');
- end;
-
- internal procedure AddOrderOnlyProfiles(var TempParticipation: Record "Continia Participation" temporary; ProfileDirection: Enum "Continia Profile Direction"; var ActivatedProfiles: Record "Continia Activated Net. Prof.")
- begin
- case TempParticipation.Network of
- "Continia E-Delivery Network"::Peppol:
- PopulatePeppolOrderOnlyProfiles(TempParticipation, ActivatedProfiles, ProfileDirection);
- "Continia E-Delivery Network"::Nemhandel:
- AddNetworkProfileByIdentifiers(TempParticipation, ActivatedProfiles, ProfileDirection,
- 'urn:www.nesubl.eu:profiles:profile3:ver2.0', '');
- end;
- end;
-
- local procedure PopulatePeppolOrderOnlyProfiles(var TempParticipation: Record "Continia Participation" temporary; var ActivatedProfiles: Record "Continia Activated Net. Prof."; ProfileDirection: Enum "Continia Profile Direction")
- begin
- case TempParticipation."Country/Region Code" of
- 'NO':
- //EHF Advanced Order Initiation 3.0
- AddNetworkProfileByIdentifiers(TempParticipation, ActivatedProfiles, ProfileDirection,
- 'urn:fdc:anskaffelser.no:2019:ehf:postaward:g3:02:1.0',
- 'urn:oasis:names:specification:ubl:schema:xsd:Order-2::Order##urn:fdc:peppol.eu:poacc:trns:order:3:extended:urn:fdc:anskaffelser.no:2019:ehf:spec:3.0::2.2');
- end;
-
- //PEPPOL Order Only (BIS 3.0)
- AddNetworkProfileByIdentifiers(TempParticipation, ActivatedProfiles, ProfileDirection,
- 'urn:fdc:peppol.eu:poacc:bis:order_only:3',
- 'urn:oasis:names:specification:ubl:schema:xsd:Order-2::Order##urn:fdc:peppol.eu:poacc:trns:order:3::2.1');
- end;
-
- internal procedure AddOrderProfiles(var TempParticipation: Record "Continia Participation" temporary; ProfileDirection: Enum "Continia Profile Direction"; var ActivatedProfiles: Record "Continia Activated Net. Prof.")
- begin
- case TempParticipation.Network of
- "Continia E-Delivery Network"::Peppol:
- PopulatePeppolOrderProfiles(TempParticipation, ActivatedProfiles, ProfileDirection);
- "Continia E-Delivery Network"::Nemhandel:
- AddNetworkProfileByIdentifiers(TempParticipation, ActivatedProfiles, ProfileDirection,
- 'Procurement-OrdSim-1.0', '');
- end;
- end;
-
- local procedure PopulatePeppolOrderProfiles(var TempParticipation: Record "Continia Participation" temporary; var ActivatedProfiles: Record "Continia Activated Net. Prof."; ProfileDirection: Enum "Continia Profile Direction")
- begin
- case TempParticipation."Country/Region Code" of
- 'NO':
- //EHF Advanced Order Initiation 3.0
- AddNetworkProfileByIdentifiers(TempParticipation, ActivatedProfiles, ProfileDirection,
- 'urn:fdc:anskaffelser.no:2019:ehf:postaward:g3:02:1.0',
- 'urn:oasis:names:specification:ubl:schema:xsd:Order-2::Order##urn:fdc:peppol.eu:poacc:trns:order:3:extended:urn:fdc:anskaffelser.no:2019:ehf:spec:3.0::2.2');
- end;
-
- //PEPPOL Order (BIS 3.0)
- AddNetworkProfileByIdentifiers(TempParticipation, ActivatedProfiles, ProfileDirection,
- 'urn:fdc:peppol.eu:poacc:bis:ordering:3',
- 'urn:oasis:names:specification:ubl:schema:xsd:Order-2::Order##urn:fdc:peppol.eu:poacc:trns:order:3::2.1');
- end;
-
- internal procedure AddOrderResponseProfiles(var TempParticipation: Record "Continia Participation" temporary; ProfileDirection: Enum "Continia Profile Direction"; var ActivatedProfiles: Record "Continia Activated Net. Prof.")
- begin
- if TempParticipation.Network = "Continia E-Delivery Network"::Peppol then
- PopulatePeppolOrderResponseProfiles(TempParticipation, ActivatedProfiles, ProfileDirection);
- end;
-
- local procedure PopulatePeppolOrderResponseProfiles(var TempParticipation: Record "Continia Participation" temporary; var ActivatedProfiles: Record "Continia Activated Net. Prof."; ProfileDirection: Enum "Continia Profile Direction")
- begin
- case TempParticipation."Country/Region Code" of
- 'NO':
- //EHF Advanced Order Response 3.0
- AddNetworkProfileByIdentifiers(TempParticipation, ActivatedProfiles, ProfileDirection,
- 'urn:fdc:anskaffelser.no:2019:ehf:postaward:g3:02:1.0',
- 'urn:oasis:names:specification:ubl:schema:xsd:OrderResponse-2::OrderResponse##urn:fdc:peppol.eu:poacc:trns:order_response:3:extended:urn:fdc:anskaffelser.no:2019:ehf:spec:3.0::2.2');
- end;
-
- //PEPPOL Order Response (BIS 3.0)
- AddNetworkProfileByIdentifiers(TempParticipation, ActivatedProfiles, ProfileDirection,
- 'urn:fdc:peppol.eu:poacc:bis:ordering:3',
- 'urn:oasis:names:specification:ubl:schema:xsd:OrderResponse-2::OrderResponse##urn:fdc:peppol.eu:poacc:trns:order_response:3::2.1');
- end;
-
- internal procedure AddInvoiceAndOrderProfiles(var TempParticipation: Record "Continia Participation" temporary; ProfileDirection: Enum "Continia Profile Direction"; var ActivatedProfiles: Record "Continia Activated Net. Prof.")
- begin
- if TempParticipation.Network = "Continia E-Delivery Network"::Nemhandel then
- AddNetworkProfileByIdentifiers(TempParticipation, ActivatedProfiles, ProfileDirection,
- 'Procurement-OrdSim-BilSim-1.0', '');
- end;
-
- local procedure AddNetworkProfileByIdentifiers(var TempParticipation: Record "Continia Participation" temporary; var ActivatedProfiles: Record "Continia Activated Net. Prof."; ProfileDirection: Enum "Continia Profile Direction"; ProcessIdentifier: Text;
- DocumentIdentifier: Text)
- var
- NetworkProfile: Record "Continia Network Profile";
- begin
- NetworkProfile.SetRange(Network, TempParticipation.Network);
- NetworkProfile.SetRange("Process Identifier", ProcessIdentifier);
- if DocumentIdentifier <> '' then
- NetworkProfile.SetRange("Document Identifier", DocumentIdentifier);
-
- if NetworkProfile.FindFirst() then begin
- ActivatedProfiles.Init();
- ActivatedProfiles.Network := NetworkProfile.Network;
- ActivatedProfiles."Identifier Type Id" := TempParticipation."Identifier Type Id";
- ActivatedProfiles."Identifier Value" := TempParticipation."Identifier Value";
- ActivatedProfiles."Network Profile Id" := NetworkProfile.Id;
- ActivatedProfiles."Profile Direction" := ProfileDirection;
- ActivatedProfiles.Insert();
- end;
- end;
-
- #endregion
-
- local procedure ShowProgressWindow(ProgressMsg: Text)
- begin
- ProgressDialogWindow.Open(ProgressMsg);
- end;
-
- procedure HasModifyPermissionOnParticipation(): Boolean
- var
- EDocService: Record "E-Document Service";
- begin
- exit(EDocService.WritePermission);
- end;
-
- local procedure CloseProgressWindow()
- begin
- ProgressDialogWindow.Close();
- end;
-
- var
-
- ProgressDialogWindow: Dialog;
- MetaDataLoaded: Boolean;
- SendingDataProgressMsg: Label 'Sending data to Continia Online';
- UpdatingDataProgressMsg: Label 'Updating data from Continia Online';
- InvalidIdentifierValueErr: Label 'The %1 of the participation is invalid (Rule: ''%2'').', Comment = '%1 = The current identifier value of the participation, %2 = The regular expression rule that the identifier value must match';
-
-}
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/app/src/Onboarding/ContiniaParticipation.Table.al b/Apps/W1/EDocumentConnectors/Continia/app/src/Onboarding/ContiniaParticipation.Table.al
deleted file mode 100644
index b1b8561b00..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/app/src/Onboarding/ContiniaParticipation.Table.al
+++ /dev/null
@@ -1,290 +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.EServices.EDocumentConnector.Continia;
-
-using System.Email;
-using Microsoft.Finance.VAT.Registration;
-using Microsoft.Foundation.Address;
-
-table 6391 "Continia Participation"
-{
- Access = Internal;
- Caption = 'Participation';
- DataClassification = CustomerContent;
- LookupPageId = "Continia Participations";
- Permissions = tabledata "Continia Activated Net. Prof." = rimd;
-
- fields
- {
- field(1; Network; Enum "Continia E-Delivery Network")
- {
- Caption = 'Network';
- ToolTip = 'Specifies the network name where the participation is in.';
- }
- field(2; "Identifier Type Id"; Guid)
- {
- Caption = 'Identifier Type';
- TableRelation = "Continia Network Identifier".Id where(Network = field(Network));
- }
- field(3; "Identifier Value"; Code[50])
- {
- Caption = 'Identifier Value';
- ToolTip = 'Specifies the value of the identifier used to identify the company in the network.';
- }
- field(10; "Company Name"; Text[100])
- {
- Caption = 'Company Name';
- ToolTip = 'Specifies the legal name of the company that you want to join to the network.';
- }
- field(11; "VAT Registration No."; Text[20])
- {
- Caption = 'VAT Registration No.';
- ToolTip = 'Specifies the VAT registration number of the company that you want to join to the network.';
-
- trigger OnValidate()
- var
- VATRegNoFormat: Record "VAT Registration No. Format";
- begin
- "VAT Registration No." := UpperCase("VAT Registration No.");
- if "VAT Registration No." = xRec."VAT Registration No." then
- exit;
- if not VATRegNoFormat.Test("VAT Registration No.", "Country/Region Code", '', Database::"Continia Participation") then
- exit;
- end;
- }
- field(12; Address; Text[100])
- {
- Caption = 'Address';
- ToolTip = 'Specifies the legal address of the company that you want to join to the network.';
- }
- field(13; "Post Code"; Code[20])
- {
- Caption = 'Post Code';
- ToolTip = 'Specifies the legal post code of the company that you want to join to the network.';
- }
- field(14; "Country/Region Code"; Code[10])
- {
- Caption = 'Country/Region Code';
- ToolTip = 'Specifies the legal country code of the company that you want to join to the network. Must be stated in the ISO 3166-1 format.';
-
- trigger OnLookup()
- begin
- LookupCountryRegion();
- ValidateCountryRegion();
- Validate("VAT Registration No.");
- end;
-
- trigger OnValidate()
- begin
- ValidateCountryRegion();
- Validate("VAT Registration No.");
- end;
- }
- field(15; County; Text[30])
- {
- Caption = 'County';
- CaptionClass = '5,1,' + "Country/Region Code";
- ToolTip = 'Specifies the legal county of the company that you want to join to the network.';
- }
- field(16; "Your Name"; Text[100])
- {
- Caption = 'Your Name';
- }
- field(17; "Contact Name"; Text[100])
- {
- Caption = 'Name';
- ToolTip = 'Specifies the name of the contact person in the company.';
- }
- field(18; "Contact Phone No."; Text[30])
- {
- Caption = 'Phone No.';
- ExtendedDatatype = PhoneNo;
- ToolTip = 'Specifies the telephone number of the contact person in the company.';
-
- trigger OnValidate()
- var
- PhoneNumber: Text[30];
- begin
- PhoneNumber := DelChr("Contact Phone No.", '=', '0123456789+');
- if PhoneNumber <> '' then
- Error(InvalidPhoneNoErr, "Contact Phone No.");
- end;
- }
- field(19; "Contact Email"; Text[80])
- {
- Caption = 'Email Address';
- ExtendedDatatype = EMail;
- ToolTip = 'Specifies the email address of the contact person in the company.';
-
- trigger OnValidate()
- var
- MailManagement: Codeunit "Mail Management";
- begin
- if "Contact Email" <> '' then
- MailManagement.CheckValidEmailAddress("Contact Email");
- end;
- }
- field(20; "Publish in Registry"; Boolean)
- {
- Caption = 'Publish data in Registry';
- }
- field(21; "Registration Status"; Enum "Continia Registration Status")
- {
- Caption = 'Registration Status';
- ToolTip = 'Specifies the registration status of the participation.';
- }
- field(22; "Signatory Name"; Text[100])
- {
- Caption = 'Signatory Name';
- ToolTip = 'Specifies the name of the company signatory.';
- }
- field(23; "Signatory Email"; Text[80])
- {
- Caption = 'Email Address';
- ToolTip = 'Specifies the email of the company signatory.';
-
- trigger OnValidate()
- var
- MailManagement: Codeunit "Mail Management";
- begin
- if "Signatory Email" <> '' then
- MailManagement.CheckValidEmailAddress("Signatory Email");
- end;
- }
- field(30; Id; Guid)
- {
- Caption = 'ID';
- DataClassification = SystemMetadata;
- ToolTip = 'Specifies the unique identifier of the participation in the Continia Delivery Network.';
- }
- field(31; Created; DateTime)
- {
- Caption = 'Created Date-Time';
- DataClassification = SystemMetadata;
- ToolTip = 'Specifies the date and time when the participation was created.';
- }
- field(32; Updated; DateTime)
- {
- Caption = 'Updated Date-Time';
- DataClassification = SystemMetadata;
- ToolTip = 'Specifies the date and time when the participation was last updated.';
- }
- field(33; "Cdn Timestamp"; Text[250])
- {
- Caption = 'CDN Timestamp';
- DataClassification = SystemMetadata;
- }
- field(34; "Published in Registry"; Boolean)
- {
- Caption = 'Published in Registry';
- DataClassification = SystemMetadata;
- }
- field(40; "Identifier Scheme Id"; Text[50])
- {
- CalcFormula = lookup("Continia Network Identifier"."Scheme Id" where(Id = field("Identifier Type Id")));
- Caption = 'Identifier Type';
- Editable = false;
- FieldClass = FlowField;
- ToolTip = 'Specifies the type of identifier used for the participation.';
- }
- field(50; "Partner Id"; Code[20])
- {
- Caption = 'Partner Id';
- Editable = false;
- ExtendedDatatype = Masked;
- }
- }
-
- keys
- {
- key(Key1; Network, "Identifier Type Id", "Identifier Value")
- {
- Clustered = true;
- }
- key(Key2; Id) { }
- }
-
- internal procedure LookupCountryRegion()
- var
- CountryRegion: Record "Country/Region";
- CountriesRegions: Page "Countries/Regions";
- begin
- CountriesRegions.LookupMode := true;
- if CountriesRegions.RunModal() = Action::LookupOK then begin
- CountriesRegions.GetRecord(CountryRegion);
- "Country/Region Code" := CountryRegion."ISO Code";
- end;
- end;
-
- internal procedure ValidateCountryRegion()
- var
- CountryRegion: Record "Country/Region";
- begin
- if "Country/Region Code" = '' then
- exit;
-
-#pragma warning disable AA0210
- CountryRegion.SetRange("ISO Code", "Country/Region Code");
-#pragma warning restore AA0210
-#pragma warning disable AA0175
- CountryRegion.FindFirst(); // Throws the standard error if not found.
-#pragma warning restore AA0175
- end;
-
- internal procedure ValidateCdnStatus(Status: Text)
- begin
- case Status of
- 'DraftEnum':
- Validate("Registration Status", "Registration Status"::Draft);
- 'InProcessEnum', 'ApprovedEnum', 'SuspendedEnum', 'ErrorEnum':
- Validate("Registration Status", "Registration Status"::InProcess);
- 'ConnectedEnum':
- Validate("Registration Status", "Registration Status"::Connected);
- 'RejectedEnum':
- Validate("Registration Status", "Registration Status"::Rejected);
- 'DisabledEnum':
- Validate("Registration Status", "Registration Status"::Disabled);
- end;
- end;
-
- internal procedure GetParticipApiStatusEnumValue(Suspended: Boolean): Text
- begin
- if Suspended then
- exit('SuspendedEnum');
-
- case "Registration Status" of
- "Registration Status"::Draft:
- exit('DraftEnum');
- "Registration Status"::InProcess:
- exit('InProcessEnum');
- "Registration Status"::Connected:
- exit('ConnectedEnum');
- "Registration Status"::Rejected:
- exit('RejectedEnum');
- "Registration Status"::Disabled:
- exit('DisabledEnum');
- end;
- end;
-
- internal procedure GetNetworkIdentifier() NetworkIdentifier: Record "Continia Network Identifier"
- begin
- NetworkIdentifier.SetRange(Id, "Identifier Type Id");
- NetworkIdentifier.FindFirst();
- exit(NetworkIdentifier);
- end;
-
- trigger OnDelete()
- var
- ActivatedProfiles: Record "Continia Activated Net. Prof.";
- begin
- ActivatedProfiles.SetRange(Network, Rec.Network);
- ActivatedProfiles.SetRange("Identifier Type Id", Rec."Identifier Type Id");
- ActivatedProfiles.SetRange("Identifier Value", Rec."Identifier Value");
- ActivatedProfiles.DeleteAll();
- end;
-
- var
- InvalidPhoneNoErr: Label 'The phone number "%1" is not valid', Comment = '%1 - Telephone number';
-}
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/app/src/Onboarding/ContiniaProfileSelection.Page.al b/Apps/W1/EDocumentConnectors/Continia/app/src/Onboarding/ContiniaProfileSelection.Page.al
deleted file mode 100644
index 07a5e44ac3..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/app/src/Onboarding/ContiniaProfileSelection.Page.al
+++ /dev/null
@@ -1,154 +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.EServices.EDocumentConnector.Continia;
-
-page 6394 "Continia Profile Selection"
-{
- ApplicationArea = All;
- Caption = 'Network Profile Selection';
- DelayedInsert = true;
- PageType = ListPart;
- SourceTable = "Continia Activated Net. Prof.";
- SourceTableTemporary = true;
-
- layout
- {
- area(Content)
- {
- repeater(Group)
- {
- field("Profile Name"; ProfileName)
- {
- Caption = 'Profile Name';
- Lookup = true;
- ToolTip = 'Specifies the name of the profile.';
- Width = 20;
-
- trigger OnLookup(var Text: Text): Boolean
- var
- NetworkProfile: Record "Continia Network Profile";
- NetworkProfileList: Page "Continia Network Profile List";
- begin
- NetworkProfile.FilterGroup(2);
- NetworkProfile.SetRange(Network, CurrentNetwork);
- NetworkProfile.FilterGroup(0);
- NetworkProfileList.LookupMode(true);
-
- if not IsNullGuid(Rec."Network Profile Id") then
- NetworkProfile.Get(Rec."Network Profile Id")
- else
- if Text <> '' then
- NetworkProfile.SetFilter(Description, StrSubstNo('@*%1*', Text));
-
- NetworkProfileList.SetTableView(NetworkProfile);
- NetworkProfileList.SetRecord(NetworkProfile);
- if NetworkProfileList.RunModal() = Action::LookupOK then begin
- NetworkProfileList.GetRecord(NetworkProfile);
- Rec."Network Profile Id" := NetworkProfile.Id;
- ProfileName := NetworkProfile.Description;
- Text := NetworkProfile.Description;
- exit(true);
- end;
- end;
- }
- field("Profile Direction"; Rec."Profile Direction")
- {
- trigger OnValidate()
- begin
- ValidateProfileDirection();
- end;
- }
- field("E-Document Service Code"; Rec."E-Document Service Code") { }
- }
- }
- }
-
- var
- ParticipConnected: Boolean;
- EditRemoveNetworkProfileErr: Label 'The following network profiles are about to be unregistered: %1.\\Do you want to continue?', Comment = '%1 - Profile Name';
- ValueChangedInfoMsg: Label 'Please be aware that when changing %1 your participation must go through the approval process with Continia before you can send or receive network documents.\\This can take up to 2 days.', Comment = '%1 - Participation description';
- ProfileName: Text;
-
- trigger OnAfterGetRecord()
- begin
- if not IsNullGuid(Rec."Network Profile Id") then begin
- Rec.CalcFields("Network Profile Description");
- ProfileName := Rec."Network Profile Description";
- end else
- ProfileName := '';
- end;
-
- trigger OnNewRecord(BelowxRec: Boolean)
- begin
- ProfileName := '';
- end;
-
- local procedure ValidateProfileDirection()
- begin
- if not ParticipConnected then
- exit;
-
- if (xRec."Profile Direction" = xRec."Profile Direction"::Outbound) and
- (Rec."Profile Direction" in [Rec."Profile Direction"::Both, Rec."Profile Direction"::Inbound])
- then
- if not Confirm(StrSubstNo(ValueChangedInfoMsg, StrSubstNo(Rec.FieldCaption("Profile Direction"),
- xRec."Profile Direction", Rec."Profile Direction")))
- then
- Error('');
-
- if ((xRec."Profile Direction" in [xRec."Profile Direction"::Both, xRec."Profile Direction"::Inbound])) and
- (Rec."Profile Direction" = Rec."Profile Direction"::Outbound)
- then
- if not Confirm(StrSubstNo(EditRemoveNetworkProfileErr, ProfileName)) then
- Error('');
- end;
-
- internal procedure ClearProfileSelections()
- begin
- Rec.Reset();
- Rec.DeleteAll();
- end;
-
- internal procedure GetProfileSelection(var ActivatedNetworkProfiles: Record "Continia Activated Net. Prof." temporary)
- begin
- Clear(ActivatedNetworkProfiles);
-
- if Rec.FindSet() then
- repeat
- ActivatedNetworkProfiles.Init();
- ActivatedNetworkProfiles.TransferFields(Rec, true);
- ActivatedNetworkProfiles.Insert();
- until Rec.Next() = 0;
- if not ActivatedNetworkProfiles.IsEmpty() then
- ActivatedNetworkProfiles.FindFirst();
- end;
-
- internal procedure SetProfileSelection(var ActivatedNetworkProfiles: Record "Continia Activated Net. Prof." temporary)
- var
- Original: Record "Continia Activated Net. Prof.";
- begin
- Original := ActivatedNetworkProfiles;
- ActivatedNetworkProfiles.SetFilter(Disabled, '=%1', 0DT);
- if ActivatedNetworkProfiles.FindSet() then
- repeat
- Rec.Init();
- Rec.TransferFields(ActivatedNetworkProfiles, true);
- Rec.Insert();
- until ActivatedNetworkProfiles.Next() = 0;
- ActivatedNetworkProfiles.SetRange(Disabled);
- CurrPage.Update(false);
-
- ActivatedNetworkProfiles := Original;
- end;
-
- internal procedure SetCurrentNetwork(NewCurrentNetwork: Enum "Continia E-Delivery Network")
- begin
- CurrentNetwork := NewCurrentNetwork;
- end;
-
- var
- CurrentNetwork: Enum "Continia E-Delivery Network";
-}
-
diff --git a/Apps/W1/EDocumentConnectors/Continia/app/src/Onboarding/ContiniaWizardScenario.Enum.al b/Apps/W1/EDocumentConnectors/Continia/app/src/Onboarding/ContiniaWizardScenario.Enum.al
deleted file mode 100644
index be7dd224d4..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/app/src/Onboarding/ContiniaWizardScenario.Enum.al
+++ /dev/null
@@ -1,24 +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.EServices.EDocumentConnector.Continia;
-
-enum 6392 "Continia Wizard Scenario"
-{
- Access = Internal;
- Extensible = false;
-
- value(0; General)
- {
- Caption = 'General';
- }
- value(1; EditSubscriptionInfo)
- {
- Caption = 'Edit Company Contact Information';
- }
- value(2; EditParticipation)
- {
- Caption = 'Edit Participation and Profiles';
- }
-}
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/app/src/Participation Setup/ContiniaActivatedNetProf.Table.al b/Apps/W1/EDocumentConnectors/Continia/app/src/Participation Setup/ContiniaActivatedNetProf.Table.al
deleted file mode 100644
index 82b4d6fa58..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/app/src/Participation Setup/ContiniaActivatedNetProf.Table.al
+++ /dev/null
@@ -1,132 +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.EServices.EDocumentConnector.Continia;
-
-using Microsoft.eServices.EDocument;
-
-table 6392 "Continia Activated Net. Prof."
-{
- Access = Internal;
- Caption = 'Activated Network Profile';
- DataClassification = CustomerContent;
-
- fields
- {
- field(1; Network; Enum "Continia E-Delivery Network")
- {
- Caption = 'Network';
- ToolTip = 'Specifies E-Document Network.';
- }
- field(2; "Identifier Type Id"; Guid)
- {
- Caption = 'Identifier Type Id';
- TableRelation = "Continia Network Identifier".Id where(Network = field(Network));
- }
- field(3; "Identifier Value"; Code[50])
- {
- Caption = 'Identifier Value';
- }
- field(4; "Network Profile Id"; Guid)
- {
- Caption = 'Network Profile Id';
- TableRelation = "Continia Network Profile".Id where(Network = field(Network));
- }
- field(5; "Profile Direction"; Enum "Continia Profile Direction")
- {
- Caption = 'Profile Direction';
- ToolTip = 'Specifies the direction of the profile.';
- }
- field(6; Id; Guid)
- {
- Caption = 'ID';
- DataClassification = SystemMetadata;
- }
- field(7; Created; DateTime)
- {
- Caption = 'Created Date-Time';
- DataClassification = SystemMetadata;
- }
- field(8; Updated; DateTime)
- {
- Caption = 'Updated Date-Time';
- DataClassification = SystemMetadata;
- }
- field(9; Disabled; DateTime)
- {
- Caption = 'Disabled Date-Time';
- DataClassification = SystemMetadata;
- }
- field(10; "Network Profile Description"; Text[250])
- {
- CalcFormula = lookup("Continia Network Profile".Description where(Id = field("Network Profile Id")));
- Caption = 'Profile Description';
- Editable = false;
- FieldClass = FlowField;
- ToolTip = 'Specifies the description of the profile.';
- }
- field(11; "E-Document Service Code"; Code[20])
- {
- Caption = 'E-Document Service Code';
- TableRelation = "E-Document Service";
- ToolTip = 'Specifies the E-Document Service that would be linked to selected Network Profile.';
- }
- }
-
- keys
- {
- key(PK; Network, "Identifier Type Id", "Identifier Value", "Network Profile Id")
- {
- Clustered = true;
- }
- key(Key2; Id) { }
- }
-
- internal procedure ValidateApiDirection(Direction: Text)
- begin
- case Direction of
- 'BothEnum':
- Validate("Profile Direction", "Profile Direction"::Both);
- 'InboundEnum':
- Validate("Profile Direction", "Profile Direction"::Inbound);
- 'OutboundEnum':
- Validate("Profile Direction", "Profile Direction"::Outbound);
- end;
- end;
-
- internal procedure GetParticipApiDirectionEnum(): Text
- begin
- case "Profile Direction" of
- "Profile Direction"::Both:
- exit('BothEnum');
- "Profile Direction"::Inbound:
- exit('InboundEnum');
- "Profile Direction"::Outbound:
- exit('OutboundEnum');
- end;
- end;
-
- internal procedure GetNetworkProfile(var NetworkProfile: Record "Continia Network Profile"): Boolean
- begin
- if not IsNullGuid("Network Profile Id") then
- exit(NetworkProfile.Get("Network Profile Id"));
- end;
-
- internal procedure FilterByParticipation(Participation: Record "Continia Participation")
- begin
- SetRange(Network, Participation.Network);
- SetRange("Identifier Type Id", Participation."Identifier Type Id");
- SetRange("Identifier Value", Participation."Identifier Value");
- end;
-
- internal procedure GetEDocServiceNetworkNames(EDocServiceNames: Text) NetworkNames: List of [Text]
- begin
- SetRange("E-Document Service Code", EDocServiceNames);
- if FindSet() then
- repeat
- if not NetworkNames.Contains(Format(Network)) then
- NetworkNames.Add(Format(Network));
- until Next() = 0;
- end;
-}
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/app/src/Participation Setup/ContiniaActiveProfiles.Page.al b/Apps/W1/EDocumentConnectors/Continia/app/src/Participation Setup/ContiniaActiveProfiles.Page.al
deleted file mode 100644
index 18ef04dcf5..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/app/src/Participation Setup/ContiniaActiveProfiles.Page.al
+++ /dev/null
@@ -1,33 +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.EServices.EDocumentConnector.Continia;
-
-page 6392 "Continia Active Profiles"
-{
- ApplicationArea = All;
- Caption = 'Active Network Profile';
- Extensible = false;
- PageType = ListPart;
- SourceTable = "Continia Activated Net. Prof.";
- SourceTableView = where(Disabled = filter(0DT));
-
- layout
- {
- area(Content)
- {
- repeater(Group)
- {
- field("Network Profile Description"; Rec."Network Profile Description")
- {
- Editable = false;
- Width = 20;
- }
- field("Profile Direction"; Rec."Profile Direction") { }
- }
- }
- }
-
-}
-
diff --git a/Apps/W1/EDocumentConnectors/Continia/app/src/Participation Setup/ContiniaParticipations.Page.al b/Apps/W1/EDocumentConnectors/Continia/app/src/Participation Setup/ContiniaParticipations.Page.al
deleted file mode 100644
index 897019c094..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/app/src/Participation Setup/ContiniaParticipations.Page.al
+++ /dev/null
@@ -1,119 +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.EServices.EDocumentConnector.Continia;
-
-page 6391 "Continia Participations"
-{
- ApplicationArea = Basic, Suite;
- Caption = 'Continia Participations';
- Editable = false;
- Extensible = false;
- PageType = List;
- SourceTable = "Continia Participation";
- UsageCategory = None;
-
- layout
- {
- area(Content)
- {
- repeater(ParticipationsGroup)
- {
- field(RegistrationStatus; Rec."Registration Status") { }
- field(Network; Rec.Network) { }
- field(IdentifierType; Rec."Identifier Scheme Id") { }
- field(IdentifierValue; Rec."Identifier Value") { }
- field(Created; Rec.Created) { }
- field(Updated; Rec.Updated) { }
- field(Id; Rec.Id) { }
- }
- }
- area(FactBoxes)
- {
- part(ActiveProfiles; "Continia Active Profiles")
- {
- SubPageLink = Network = field(Network), "Identifier Type Id" = field("Identifier Type Id"), "Identifier Value" = field("Identifier Value");
- }
- }
- }
-
- actions
- {
- area(Promoted)
- {
- actionref(RegisterNewActionRef; RegisterNewParticipation) { }
- actionref(EditActioNRef; EditParticipation) { }
- actionref(DeleteActioNRef; DeleteParticipation) { }
- }
- area(Processing)
- {
- action(RegisterNewParticipation)
- {
- Caption = 'Register';
- Enabled = CanEditParticipation;
- Image = New;
- ToolTip = 'Register a new participation in the Continia Delivery Network.';
-
- trigger OnAction()
- var
- OnboardingGuide: Page "Continia Onboarding Guide";
- begin
- OnboardingGuide.Run();
- end;
- }
- action(EditParticipation)
- {
- Caption = 'Edit';
- Enabled = ActionsEnabled and CanEditParticipation;
- Image = Edit;
- ToolTip = 'Edit the participation in the Continia Delivery Network.';
-
- trigger OnAction()
- var
- OnboardingGuide: Page "Continia Onboarding Guide";
- RunScenario: Enum "Continia Wizard Scenario";
- begin
- OnboardingGuide.SetRunScenario(RunScenario::EditParticipation); //Update Participation and profiles
- OnboardingGuide.SetParticipation(Rec);
- OnboardingGuide.Run();
- CurrPage.Update(false);
- end;
-
- }
- action(DeleteParticipation)
- {
- Caption = 'Unregister';
- Enabled = ActionsEnabled and CanEditParticipation;
- Image = Delete;
- ToolTip = 'Unregister the participation in the Continia Delivery Network.';
-
- trigger OnAction()
- var
- ApiRequests: Codeunit "Continia Api Requests";
- begin
- if Rec."Registration Status" = Rec."Registration Status"::Draft then
- Rec.Delete()
- else
- ApiRequests.DeleteParticipation(Rec);
- end;
- }
- }
- }
-
- var
- ActionsEnabled: Boolean;
- CanEditParticipation: Boolean;
-
- trigger OnOpenPage()
- var
- OnboardingHelper: Codeunit "Continia Onboarding Helper";
- begin
- CanEditParticipation := OnboardingHelper.HasModifyPermissionOnParticipation();
- end;
-
- trigger OnAfterGetRecord()
- begin
- ActionsEnabled := true;
- end;
-}
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/app/src/Participation Setup/ContiniaRegistrationStatus.Enum.al b/Apps/W1/EDocumentConnectors/Continia/app/src/Participation Setup/ContiniaRegistrationStatus.Enum.al
deleted file mode 100644
index 1fda946276..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/app/src/Participation Setup/ContiniaRegistrationStatus.Enum.al
+++ /dev/null
@@ -1,32 +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.EServices.EDocumentConnector.Continia;
-
-enum 6394 "Continia Registration Status"
-{
- Access = Internal;
- Extensible = false;
-
- value(0; Draft)
- {
- Caption = 'Draft';
- }
- value(1; InProcess)
- {
- Caption = 'Pending approval';
- }
- value(2; Connected)
- {
- Caption = 'Connected';
- }
- value(3; Rejected)
- {
- Caption = 'Rejected';
- }
- value(4; Disabled)
- {
- Caption = 'Disabled';
- }
-}
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/app/src/Permissions/ContEDocConnEdit.PermissionSet.al b/Apps/W1/EDocumentConnectors/Continia/app/src/Permissions/ContEDocConnEdit.PermissionSet.al
deleted file mode 100644
index 22141b35c7..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/app/src/Permissions/ContEDocConnEdit.PermissionSet.al
+++ /dev/null
@@ -1,20 +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.EServices.EDocumentConnector.Continia;
-
-permissionset 6392 ContEDocConnEdit
-{
- Access = Public;
- Assignable = true;
- Caption = 'Continia E-Document Connector - Edit';
- IncludedPermissionSets = ContEDocConnRead;
-
- Permissions = tabledata "Continia Connection Setup" = IM,
- tabledata "Continia Participation" = imd,
- tabledata "Continia Activated Net. Prof." = imd,
- tabledata "Continia Network Identifier" = imd,
- tabledata "Continia Network Profile" = imd,
- tabledata "Con. E-Doc. Serv. Prof. Sel." = imd;
-}
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/app/src/Permissions/ContEDocConnObjects.PermissionSet.al b/Apps/W1/EDocumentConnectors/Continia/app/src/Permissions/ContEDocConnObjects.PermissionSet.al
deleted file mode 100644
index 78553824d5..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/app/src/Permissions/ContEDocConnObjects.PermissionSet.al
+++ /dev/null
@@ -1,23 +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.EServices.EDocumentConnector.Continia;
-
-permissionset 6390 ContEDocConnObjects
-{
- Access = Public;
- Assignable = false;
- Caption = 'Continia E-Document Connector - Objects';
-
- Permissions = table "Continia Connection Setup" = X,
- page "Continia Ext. Connection Setup" = X,
- codeunit "Continia Integration Impl." = X,
- codeunit "Continia EDocument Processing" = X,
- codeunit "Continia Api Url" = X,
- codeunit "Continia Api Requests" = X,
- codeunit "Continia Onboarding Helper" = X,
- codeunit "Continia Credential Management" = X,
- codeunit "Continia Session Manager" = X,
- codeunit "Continia Subscription Mgt." = X;
-}
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/app/src/Permissions/ContEDocConnRead.PermissionSet.al b/Apps/W1/EDocumentConnectors/Continia/app/src/Permissions/ContEDocConnRead.PermissionSet.al
deleted file mode 100644
index 42cbe666ff..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/app/src/Permissions/ContEDocConnRead.PermissionSet.al
+++ /dev/null
@@ -1,20 +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.EServices.EDocumentConnector.Continia;
-
-permissionset 6391 ContEDocConnRead
-{
- Access = Public;
- Assignable = true;
- Caption = 'Continia E-Document Connector - Read';
- IncludedPermissionSets = ContEDocConnObjects;
-
- Permissions = tabledata "Continia Connection Setup" = R,
- tabledata "Continia Participation" = R,
- tabledata "Continia Activated Net. Prof." = R,
- tabledata "Continia Network Identifier" = R,
- tabledata "Continia Network Profile" = R,
- tabledata "Con. E-Doc. Serv. Prof. Sel." = R;
-}
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/app/src/Permissions/ContEDocConnectorEdit.PermissionSetExt.al b/Apps/W1/EDocumentConnectors/Continia/app/src/Permissions/ContEDocConnectorEdit.PermissionSetExt.al
deleted file mode 100644
index 683bb85ed9..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/app/src/Permissions/ContEDocConnectorEdit.PermissionSetExt.al
+++ /dev/null
@@ -1,12 +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.EServices.EDocumentConnector.Continia;
-
-using System.Security.AccessControl;
-
-permissionsetextension 6391 "Cont. EDoc. Connector - Edit" extends "D365 BASIC"
-{
- IncludedPermissionSets = ContEDocConnEdit;
-}
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/app/src/Permissions/ContEDocConnectorRead.PermissionSetExt.al b/Apps/W1/EDocumentConnectors/Continia/app/src/Permissions/ContEDocConnectorRead.PermissionSetExt.al
deleted file mode 100644
index ce44c15b94..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/app/src/Permissions/ContEDocConnectorRead.PermissionSetExt.al
+++ /dev/null
@@ -1,12 +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.EServices.EDocumentConnector.Continia;
-
-using System.Security.AccessControl;
-
-permissionsetextension 6390 "Cont. EDoc. Connector - Read" extends "D365 READ"
-{
- IncludedPermissionSets = ContEDocConnRead;
-}
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/app/src/Permissions/ContEDocConnectorUser.PermissionSetExt.al b/Apps/W1/EDocumentConnectors/Continia/app/src/Permissions/ContEDocConnectorUser.PermissionSetExt.al
deleted file mode 100644
index 17462695fd..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/app/src/Permissions/ContEDocConnectorUser.PermissionSetExt.al
+++ /dev/null
@@ -1,12 +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.EServices.EDocumentConnector.Continia;
-
-using Microsoft.eServices.EDocument;
-
-permissionsetextension 6392 "Cont. EDoc. Connector - User" extends "E-Doc. Core - User"
-{
- IncludedPermissionSets = ContEDocConnEdit;
-}
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/app/src/Subscription and Access/ContiniaCredentialManagement.Codeunit.al b/Apps/W1/EDocumentConnectors/Continia/app/src/Subscription and Access/ContiniaCredentialManagement.Codeunit.al
deleted file mode 100644
index b1a1bcc869..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/app/src/Subscription and Access/ContiniaCredentialManagement.Codeunit.al
+++ /dev/null
@@ -1,116 +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.EServices.EDocumentConnector.Continia;
-
-using System.Environment;
-
-codeunit 6395 "Continia Credential Management"
-{
- Access = Internal;
-
- internal procedure IsClientCredentialsValid(): Boolean
- var
- ConnectionSetup: Record "Continia Connection Setup";
- begin
- if ConnectionSetup.Get() then
- exit((not ConnectionSetup.GetClientId().IsEmpty()) and (not ConnectionSetup.GetClientSecret().IsEmpty()));
- end;
-
- [NonDebuggable]
- internal procedure GetClientCredentialsApiBodyString(): Text
- var
- ConnectionSetup: Record "Continia Connection Setup";
- CredentialsStringPlaceholderTok: Label 'grant_type=password&username=%1&password=%2', Comment = '%1 - Client Id, %2 - Client Secret', Locked = true;
- begin
- if IsClientCredentialsValid() then begin
- ConnectionSetup.Get();
- exit(StrSubstNo(CredentialsStringPlaceholderTok, ConnectionSetup.GetClientId().Unwrap(), ConnectionSetup.GetClientSecret().Unwrap()));
- end;
- end;
-
- internal procedure InsertClientCredentials(ClientId: SecretText; ClientSecret: SecretText; TenantSubscriptionId: Code[50])
- var
- ConnectionSetup: Record "Continia Connection Setup";
- SessionManager: Codeunit "Continia Session Manager";
- begin
- if not ConnectionSetup.Get() then
- ConnectionSetup.Insert();
-
- ConnectionSetup.SetClientId(ClientId);
- ConnectionSetup.SetClientSecret(ClientSecret);
- ConnectionSetup."Local Client Identifier" := TenantSubscriptionId;
- ConnectionSetup.Modify();
- SessionManager.ClearAccessToken();
- SessionManager.RefreshClientIdentifier();
- end;
-
- internal procedure GetIsolatedStorageValue(ValueKey: Text; DataScope: DataScope) Value: SecretText
- begin
- if not HasIsolatedStorageValue(ValueKey, DataScope) then
- exit;
-
- IsolatedStorage.Get(ValueKey, DataScope, Value);
- end;
-
- [NonDebuggable]
- internal procedure HasIsolatedStorageValue(ValueKey: Text; DataScope: DataScope): Boolean
- begin
- exit(IsolatedStorage.Contains(ValueKey, DataScope));
- end;
-
- internal procedure SetIsolatedStorageValue(var ValueKey: Guid; Value: SecretText; DataScope: DataScope) NewKey: Boolean
- begin
- if IsNullGuid(ValueKey) then
- NewKey := true;
- if NewKey then
- ValueKey := CreateGuid();
-
- IsolatedStorage.Set(ValueKey, Value, DataScope);
- end;
-
- internal procedure DeleteIsolatedStorageValue(var ValueKey: Guid; DataScope: DataScope): Boolean
- begin
- if IsNullGuid(ValueKey) then
- exit;
- exit(IsolatedStorage.Delete(ValueKey, DataScope));
- end;
-
- internal procedure GetCompanyGuidAsText(): Text[36]
- begin
- exit(CopyStr(LowerCase(Format(GetCompanyId())), 2, 36));
- end;
-
- internal procedure GetCompanyId(): Guid
- var
- Company: Record Company;
- begin
- Company.Get(CompanyName);
- exit(Company.Id);
- end;
-
- internal procedure GetAppCode(): Text[10]
- begin
- exit('COMSEDOC')
- end;
-
- internal procedure GetAppVersion(): Text[10]
- var
- ModInfo: ModuleInfo;
- AppVer: Version;
- MajorMinorVersion: Text;
- Version: Integer;
- begin
- NavApp.GetCurrentModuleInfo(ModInfo);
- AppVer := ModInfo.AppVersion;
- MajorMinorVersion := Format(AppVer.Major) + Format(AppVer.Minor);
- Evaluate(Version, PadStr(MajorMinorVersion, 6, '0'));
- exit(Format(Version));
- end;
-
- internal procedure GetAppFullName(): Text[80]
- begin
- exit('Continia Microsoft E-Document Connector')
- end;
-}
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/app/src/Subscription and Access/ContiniaSessionManager.Codeunit.al b/Apps/W1/EDocumentConnectors/Continia/app/src/Subscription and Access/ContiniaSessionManager.Codeunit.al
deleted file mode 100644
index ea79d77e5c..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/app/src/Subscription and Access/ContiniaSessionManager.Codeunit.al
+++ /dev/null
@@ -1,122 +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.EServices.EDocumentConnector.Continia;
-
-codeunit 6396 "Continia Session Manager"
-{
- Access = Internal;
- SingleInstance = true;
-
- var
- ClientCredentialLoaded: Boolean;
- IsAccessTokenLoaded: Boolean;
- AccessTokenRequested: DateTime;
- AccessTokenExpiresInMs: Integer;
- NextAccessTokenUpdateInMs: Integer;
- CachedAccessToken: SecretText;
- ClientIdentifier: SecretText;
-
- internal procedure ClearAccessToken()
- var
- ConnectionSetup: Record "Continia Connection Setup";
- begin
- Clear(CachedAccessToken);
- AccessTokenRequested := 0DT;
- IsAccessTokenLoaded := false;
- if CurrentClientType <> ClientType::ChildSession then
- ConnectionSetup.ClearToken();
- end;
-
- internal procedure RefreshClientIdentifier()
- begin
- ClientCredentialLoaded := false;
- GetClientIdentifier();
- end;
-
- internal procedure GetClientIdentifier(): SecretText
- var
- ConnectionSetup: Record "Continia Connection Setup";
- begin
- if ClientCredentialLoaded then
- exit(ClientIdentifier);
-
- Clear(ClientIdentifier);
- if ConnectionSetup.Get() then
- ClientIdentifier := ConnectionSetup.GetClientId();
-
- ClientCredentialLoaded := true;
- exit(ClientIdentifier);
- end;
-
- [NonDebuggable]
- internal procedure GetAccessToken() AccessTokenValue: SecretText
- var
- ConnectionSetup: Record "Continia Connection Setup";
- begin
- // Get token from Cache if possible
- if IsAccessTokenLoaded then
- if AccessTokenRequested > CreateDateTime(Today, Time) - NextAccessTokenUpdateInMs then
- exit(CachedAccessToken);
-
- if ConnectionSetup.AcquireTokenFromCache(CachedAccessToken, AccessTokenRequested, AccessTokenExpiresInMs, NextAccessTokenUpdateInMs, true) then begin
- IsAccessTokenLoaded := true;
- exit(CachedAccessToken);
- end;
- // Not found in cache - make new request to Online
- if AcquireToken(false) then
- exit(CachedAccessToken);
-
- // Fallback code Allow the access token to live for 23 hours
- if ConnectionSetup.AcquireTokenFromCache(CachedAccessToken, AccessTokenRequested, AccessTokenExpiresInMs, NextAccessTokenUpdateInMs, false) then begin
- IsAccessTokenLoaded := true;
- exit(CachedAccessToken);
- end else
- if AcquireToken(true) then
- exit(CachedAccessToken);
- end;
-
- local procedure AcquireToken(ShowError: Boolean): Boolean
- var
- ConnectionSetup: Record "Continia Connection Setup";
- ActivationMgt: Codeunit "Continia Subscription Mgt.";
- ExpiresIn: Integer;
- AccessTokenValue: Text;
- begin
- ClearLastError();
- if not ActivationMgt.TryAcquireClientToken(AccessTokenValue, ExpiresIn) then
- if ShowError then
- Error(GetLastErrorText())
- else
- exit(false);
-
- if ShouldSaveToken() then
- ConnectionSetup.SetAccessToken(AccessTokenValue, ExpiresIn);
-
- Clear(CachedAccessToken);
- AccessTokenRequested := 0DT;
-
- // Add to cache
- CachedAccessToken := AccessTokenValue;
- AccessTokenExpiresInMs := ExpiresIn;
- if ShouldSaveToken() then
- AccessTokenRequested := ConnectionSetup."Token Timestamp"
- else
- AccessTokenRequested := CurrentDateTime;
-
- IsAccessTokenLoaded := true;
- exit(true);
- end;
-
- local procedure ShouldSaveToken(): Boolean
- begin
- if CurrentClientType = ClientType::ChildSession then
- exit(false);
-
- if GetCurrentModuleExecutionContext() <> ExecutionContext::Normal then
- exit(false);
-
- exit(true);
- end;
-}
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/app/src/Subscription and Access/ContiniaSubscriptionMgt.Codeunit.al b/Apps/W1/EDocumentConnectors/Continia/app/src/Subscription and Access/ContiniaSubscriptionMgt.Codeunit.al
deleted file mode 100644
index 44287375fb..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/app/src/Subscription and Access/ContiniaSubscriptionMgt.Codeunit.al
+++ /dev/null
@@ -1,842 +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.EServices.EDocumentConnector.Continia;
-
-using System.Environment;
-using System.Azure.Identity;
-using Microsoft.Foundation.Company;
-using System.Security.AccessControl;
-using Microsoft.CRM.Team;
-using System.Email;
-using System.Security.User;
-
-codeunit 6397 "Continia Subscription Mgt."
-{
- Access = Internal;
-
- var
- ApiUrlMgt: Codeunit "Continia Api Url";
- ClientCredentialsMissingErr: Label 'Client credentials missing.';
- CreateClientErrTitleErr: Label 'Failed to create client credentials';
- ExpectedStatusOKErr: Label 'Could not connect to Continia Online.\Invalid response, expected Status = OK';
- InvalidClientCredErr: Label 'Client credentials for Continia Online are invalid or missing.';
- InvalidPartnerCredErr: Label 'Partner credentials for Continia PartnerZone are invalid or missing.';
- RequestFailedErr: Label 'Request sent to Continia Online failed: %1', Comment = '%1 - Error Message from Continia Online';
-
- [NonDebuggable]
- internal procedure GetClientAccessToken(): SecretText
- var
- SessionManager: Codeunit "Continia Session Manager";
- begin
- exit(SessionManager.GetAccessToken());
- end;
-
- [NonDebuggable]
- internal procedure InitializeContiniaClient(PartnerUserName: Text; PartnerPassword: SecretText; var PartnerId: Code[20]) Updated: Boolean
- var
- HttpClient: HttpClient;
- HttpContent: HttpContent;
- HttpHeaders: HttpHeaders;
- HttpRequest: HttpRequestMessage;
- HttpResponse: HttpResponseMessage;
- PartnerAccessToken: SecretText;
- ResponseBody: Text;
- ResponseXmlDoc: XmlDocument;
- begin
- // Validate input
- if (PartnerUserName = '') or (PartnerPassword.Unwrap() = '') then
- Error(InvalidPartnerCredErr);
-
- HttpRequest.GetHeaders(HttpHeaders);
- HttpHeaders.Add('Accept', 'application/xml;charset=utf-8');
- HttpRequest.Method('POST');
- HttpRequest.SetRequestUri(ApiUrlMgt.PartnerAccessTokenUrl());
- HttpContent.WriteFrom(GetPartnerZoneConnectRequestBody(PartnerUserName, PartnerPassword));
- HttpContent.GetHeaders(HttpHeaders);
- if HttpHeaders.Contains('Content-Type') then
- HttpHeaders.Remove('Content-Type');
- HttpHeaders.Add('Content-Type', 'application/xml');
-
- HttpRequest.Content := HttpContent;
- HttpClient.Send(HttpRequest, HttpResponse);
- if HttpResponse.IsSuccessStatusCode then begin
- HttpResponse.Content.ReadAs(ResponseBody);
- if ResponseBody <> '' then
- XmlDocument.ReadFrom(ResponseBody, ResponseXmlDoc);
- end;
- PartnerAccessToken := HandlePartnerZoneAccessTokenResponse(ResponseXmlDoc);
-
- if InitializeContiniaClient(PartnerAccessToken) then
- exit(CheckPartnerAndGetPartnerId(PartnerUserName, PartnerPassword, PartnerId));
- end;
-
- [NonDebuggable]
- internal procedure CheckPartnerAndGetPartnerId(PartnerUserName: Text; PartnerPassword: SecretText; var PartnerId: Code[20]): Boolean
- var
- SessionManager: Codeunit "Continia Session Manager";
- HttpClient: HttpClient;
- HttpContent: HttpContent;
- HttpHeaders: HttpHeaders;
- HttpRequest: HttpRequestMessage;
- HttpResponse: HttpResponseMessage;
- ResponseBody: Text;
- ResponseXmlDoc: XmlDocument;
- PartnerIdNode: XmlNode;
- ErrorNode: XmlNode;
- begin
- // Validate input
- if (PartnerUserName = '') or (PartnerPassword.Unwrap() = '') then
- Error(InvalidPartnerCredErr);
-
- HttpRequest.GetHeaders(HttpHeaders);
- HttpHeaders.Add('Accept', 'application/xml;charset=utf-8');
- HttpRequest.Method('POST');
- HttpRequest.SetRequestUri(ApiUrlMgt.PartnerZoneUrl());
- HttpContent.WriteFrom(GetPartnerZoneConnectRequestBody(PartnerUserName, PartnerPassword));
-
- HttpHeaders.Add('Authorization', SecretStrSubstNo('Bearer %1', SessionManager.GetAccessToken()));
-
- HttpContent.GetHeaders(HttpHeaders);
- if HttpHeaders.Contains('Content-Type') then
- HttpHeaders.Remove('Content-Type');
- HttpHeaders.Add('Content-Type', 'application/xml');
-
- HttpRequest.Content := HttpContent;
- HttpClient.Send(HttpRequest, HttpResponse);
- if HttpResponse.IsSuccessStatusCode then begin
- HttpResponse.Content.ReadAs(ResponseBody);
- if ResponseBody <> '' then
- XmlDocument.ReadFrom(ResponseBody, ResponseXmlDoc);
- end;
-
- if ResponseXmlDoc.SelectSingleNode('Error/@Message', ErrorNode) then
- if ErrorNode.AsXmlAttribute().Value <> '' then
- Error(InvalidPartnerCredErr);
-
- if ResponseXmlDoc.SelectSingleNode('PartnerZoneConnectResponse/@Msid', PartnerIdNode) then begin
- PartnerId := CopyStr(PartnerIdNode.AsXmlAttribute().Value, 1, MaxStrLen(PartnerId));
- exit(true);
- end;
- end;
-
- [NonDebuggable]
- local procedure InitializeContiniaClient(PartnerAccessToken: SecretText): Boolean
- var
- AzureADTenant: Codeunit "Azure AD Tenant";
- CredentialManagement: Codeunit "Continia Credential Management";
- SessionManager: Codeunit "Continia Session Manager";
- EnvironmentInformation: Codeunit "Environment Information";
- HttpClient: HttpClient;
- HttpContent: HttpContent;
- HttpHeaders: HttpHeaders;
- HttpRequest: HttpRequestMessage;
- HttpResponse: HttpResponseMessage;
- ClientId: SecretText;
- ClientSecret: SecretText;
- ResponseBody: Text;
- ResponseXmlDoc: XmlDocument;
- begin
- if CredentialManagement.IsClientCredentialsValid() then
- exit(false);
-
- SessionManager.ClearAccessToken();
- SessionManager.RefreshClientIdentifier();
-
- HttpRequest.GetHeaders(HttpHeaders);
- HttpHeaders.Add('Accept', 'application/xml;charset=utf-8');
- HttpHeaders.Add('PartnerZone', PartnerAccessToken);
- if EnvironmentInformation.IsSaaSInfrastructure() then
- HttpHeaders.Add('x-AzureTenantId', AzureADTenant.GetAadTenantId());
- HttpRequest.Method('POST');
- HttpRequest.SetRequestUri(ApiUrlMgt.ClientEnvironmentInitializeUrl());
- HttpContent.WriteFrom(GetInitializeCredentialRequestBody());
- HttpContent.GetHeaders(HttpHeaders);
- if HttpHeaders.Contains('Content-Type') then
- HttpHeaders.Remove('Content-Type');
- HttpHeaders.Add('Content-Type', 'application/xml');
-
- HttpRequest.Content := HttpContent;
- HttpClient.Send(HttpRequest, HttpResponse);
- if HttpResponse.IsSuccessStatusCode then begin
- HttpResponse.Content.ReadAs(ResponseBody);
- if ResponseBody <> '' then
- XmlDocument.ReadFrom(ResponseBody, ResponseXmlDoc);
- end;
- HandleInitializeCredentialResponse(ResponseXmlDoc, ClientId, ClientSecret);
- CredentialManagement.InsertClientCredentials(ClientId, ClientSecret, GetTenantSubscriptionId());
- Commit(); // Requires commit to store the credentials
- SessionManager.RefreshClientIdentifier();
- exit(true);
- end;
-
- [NonDebuggable]
- local procedure HandlePartnerZoneAccessTokenResponse(ResponseXmlDoc: XmlDocument): Text
- var
- TempXmlNode: XmlNode;
- begin
- if ResponseXmlDoc.SelectSingleNode('Error/@Message', TempXmlNode) then
- if TempXmlNode.AsXmlAttribute().Value <> '' then
- Error(InvalidPartnerCredErr);
- if not ResponseXmlDoc.SelectSingleNode('PartnerZoneToken/@Value', TempXmlNode) then
- Error(InvalidPartnerCredErr);
- exit(TempXmlNode.AsXmlAttribute().Value);
- end;
-
- [NonDebuggable]
- local procedure GetPartnerZoneConnectRequestBody(PartnerUserName: Text; PartnerPassword: SecretText) RequestBody: Text
- var
- PartnerRequestElement: XmlElement;
- begin
- PartnerRequestElement := XmlElement.Create('PartnerZoneConnectRequest');
- PartnerRequestElement.SetAttribute('Email', PartnerUserName);
- PartnerRequestElement.SetAttribute('Password', PartnerPassword.Unwrap());
- PartnerRequestElement.WriteTo(RequestBody);
- end;
-
- [NonDebuggable]
- local procedure GetInitializeCredentialRequestBody() RequestBody: Text
- var
- CompanyInfo: Record "Company Information";
- AzureADTenant: Codeunit "Azure AD Tenant";
- EnvironmentInformation: Codeunit "Environment Information";
- TenantSubscriptionId: Code[50];
- ClientName: Text;
- EnvironmentName: Text;
- OwnerAzureId: Text;
- InitializeCredentialsElement: XmlElement;
- begin
- TenantSubscriptionId := GetTenantSubscriptionId();
-
- CompanyInfo.Get();
- CompanyInfo.TestField(Name);
- ClientName := CompanyInfo.Name;
-
- OwnerAzureId := AzureADTenant.GetAadTenantId();
-
- EnvironmentName := EnvironmentInformation.GetEnvironmentName();
-
- InitializeCredentialsElement := XmlElement.Create('InitializeCredentialsV3');
- InitializeCredentialsElement.SetAttribute('AzureId', TenantSubscriptionId);
- InitializeCredentialsElement.SetAttribute('OwnerAzureId', OwnerAzureId);
- InitializeCredentialsElement.SetAttribute('Name', ClientName);
- InitializeCredentialsElement.SetAttribute('UserName', UserId());
- InitializeCredentialsElement.SetAttribute('EnvironmentName', EnvironmentName);
- InitializeCredentialsElement.WriteTo(RequestBody);
- end;
-
- [NonDebuggable]
- internal procedure GetClientInfoApp(var ClientInfo: Record "Continia Participation" temporary; ShowError: Boolean) Success: Boolean
- var
- CredentialMgt: Codeunit "Continia Credential Management";
- ContactPerson: XmlNode;
- SubscriptionNode: XmlNode;
- SubscriptionResponse: XmlNode;
- TempXMLNode: XmlNode;
- InvoiceDetailsXMLPathLbl: Label 'Subscriptions/Subscription[@AppCode=''%1'']/InvoicingDetails', Locked = true, Comment = '%1 - App Code';
- ContactPersonXMLPathLbl: Label 'Subscriptions/Subscription[@AppCode=''%1'']/ContactPerson', Locked = true, Comment = '%1 - App Code';
- SubscriptionDetailsXMLPathLbl: Label 'Subscriptions/Subscription[@AppCode=''%1'']', Locked = true, Comment = '%1 - App Code';
- begin
- GetSubscription(SubscriptionResponse, ShowError);
-
- if SubscriptionResponse.SelectSingleNode(StrSubstNo(SubscriptionDetailsXMLPathLbl, CredentialMgt.GetAppCode()), SubscriptionNode) then begin
- SubscriptionNode.SelectSingleNode('@PartnerId', TempXMLNode);
- ClientInfo."Partner Id" := CopyStr(TempXMLNode.AsXmlAttribute().Value, 1, MaxStrLen(ClientInfo."Partner Id"));
-
- if SubscriptionResponse.SelectSingleNode(StrSubstNo(InvoiceDetailsXMLPathLbl, CredentialMgt.GetAppCode()), SubscriptionNode) then begin
-
- SubscriptionNode.SelectSingleNode('@CompanyName', TempXMLNode);
- ClientInfo."Company Name" := CopyStr(TempXMLNode.AsXmlAttribute().Value, 1, MaxStrLen(ClientInfo."Company Name"));
-
- SubscriptionNode.SelectSingleNode('@CompanyAddress', TempXMLNode);
- ClientInfo.Address := CopyStr(TempXMLNode.AsXmlAttribute().Value, 1, MaxStrLen(ClientInfo.Address));
-
- SubscriptionNode.SelectSingleNode('@PostalCode', TempXMLNode);
- ClientInfo."Post Code" := CopyStr(TempXMLNode.AsXmlAttribute().Value, 1, MaxStrLen(ClientInfo."Post Code"));
-
- SubscriptionNode.SelectSingleNode('@Country', TempXMLNode);
- ClientInfo.County := CopyStr(TempXMLNode.AsXmlAttribute().Value, 1, MaxStrLen(ClientInfo.County));
-
- SubscriptionNode.SelectSingleNode('@CountryIsoCode', TempXMLNode);
- ClientInfo."Country/Region Code" := CopyStr(TempXMLNode.AsXmlAttribute().Value, 1, MaxStrLen(ClientInfo."Country/Region Code"));
-
- SubscriptionNode.SelectSingleNode('@VatRegNo', TempXMLNode);
- ClientInfo."VAT Registration No." := CopyStr(TempXMLNode.AsXmlAttribute().Value, 1, MaxStrLen(ClientInfo."VAT Registration No."));
-
- SubscriptionNode.SelectSingleNode('@Email', TempXMLNode);
- ClientInfo."Contact Email" := CopyStr(TempXMLNode.AsXmlAttribute().Value, 1, MaxStrLen(ClientInfo."Contact Email"));
-
- SubscriptionNode.SelectSingleNode('@PhoneNo', TempXMLNode);
- ClientInfo."Contact Phone No." := CopyStr(TempXMLNode.AsXmlAttribute().Value, 1, MaxStrLen(ClientInfo."Contact Phone No."));
-
-
-
- end;
- if SubscriptionResponse.SelectSingleNode(StrSubstNo(ContactPersonXMLPathLbl, CredentialMgt.GetAppCode()), ContactPerson) then begin
- ContactPerson.SelectSingleNode('@Name', TempXMLNode);
- ClientInfo."Contact Name" := CopyStr(TempXMLNode.AsXmlAttribute().Value, 1, MaxStrLen(ClientInfo."Contact Name"));
-
- ContactPerson.SelectSingleNode('@Email', TempXMLNode);
- ClientInfo."Contact Email" := CopyStr(TempXMLNode.AsXmlAttribute().Value, 1, MaxStrLen(ClientInfo."Contact Email"));
- end;
- if not ClientInfo.Modify() then
- ClientInfo.Insert();
-
- Success := true;
- end;
- end;
-
-
- [NonDebuggable]
- internal procedure HasOtherAppsInSubscription(): Boolean
- var
- CredentialMgt: Codeunit "Continia Credential Management";
- SubscriptionNode: XmlNode;
- SubscriptionResponse: XmlNode;
- AppCodeSubscriptionXMLPathLbl: Label 'Subscriptions/Subscription[@AppCode!=''%1'']', Locked = true, Comment = '%1 - App Code';
- begin
- GetSubscription(SubscriptionResponse, true);
-
- exit(SubscriptionResponse.SelectSingleNode(StrSubstNo(AppCodeSubscriptionXMLPathLbl, CredentialMgt.GetAppCode()), SubscriptionNode));
- end;
-
- [NonDebuggable]
- internal procedure GetSubscription(var SubscriptionResponse: XmlNode; ShowError: Boolean) Success: Boolean
- var
- AzureADTenant: Codeunit "Azure AD Tenant";
- CredentialMgt: Codeunit "Continia Credential Management";
- SessionManager: Codeunit "Continia Session Manager";
- EnvironmentInformation: Codeunit "Environment Information";
- HttpClient: HttpClient;
- HttpHeaders: HttpHeaders;
- HttpRequest: HttpRequestMessage;
- HttpResponse: HttpResponseMessage;
- ResponseBody: Text;
- ResponseXmlDoc: XmlDocument;
- begin
- if not CredentialMgt.IsClientCredentialsValid() then
- exit(false);
-
- HttpRequest.GetHeaders(HttpHeaders);
- HttpHeaders.Add('Accept', 'application/xml;charset=utf-8');
- HttpHeaders.Add('Authorization', SecretStrSubstNo('Bearer %1', SessionManager.GetAccessToken()));
- HttpHeaders.Add('x-continia-companyguid', CredentialMgt.GetCompanyGuidAsText());
- HttpHeaders.Add('x-continia-version', '1500');
- if EnvironmentInformation.IsSaaSInfrastructure() then
- HttpHeaders.Add('x-AzureTenantId', AzureADTenant.GetAadTenantId());
-
- HttpRequest.Method('GET');
- HttpRequest.SetRequestUri(ApiUrlMgt.GetSubscriptionUrl());
-
- HttpClient.Timeout := 6000;
- HttpClient.Send(HttpRequest, HttpResponse);
- if HttpResponse.IsSuccessStatusCode then begin
- HttpResponse.Content.ReadAs(ResponseBody);
- if ResponseBody <> '' then
- XmlDocument.ReadFrom(ResponseBody, ResponseXmlDoc);
-
- if ResponseXmlDoc.SelectSingleNode('/SubscriptionResponse', SubscriptionResponse) then
- exit(true);
- end;
-
- exit(VerifyResponse(ResponseXmlDoc, ShowError));
- end;
-
- [NonDebuggable]
- internal procedure Unsubscribe(ShowError: Boolean) Success: Boolean
- var
- ConnectionSetup: Record "Continia Connection Setup";
- TempCompanyInfo: Record "Continia Participation" temporary;
- SubscriptionStatus: Enum "Continia Subscription Status";
- begin
- SubscriptionStatus := SubscriptionStatus::Unsubscribed;
- if not GetClientInfoApp(TempCompanyInfo, ShowError) then
- exit;
- if not UpdateSubscription(SubscriptionStatus, TempCompanyInfo, ShowError) then
- exit;
-
- ConnectionSetup.Get();
- ConnectionSetup."Subscription Status" := SubscriptionStatus;
- ConnectionSetup.Modify();
- end;
-
- [NonDebuggable]
- internal procedure UpdateSubscription(SubscriptionState: Enum "Continia Subscription Status"; var ClientInfo: Record "Continia Participation" temporary; ShowError: Boolean) Success: Boolean
- var
- AzureADTenant: Codeunit "Azure AD Tenant";
- CredentialManagement: Codeunit "Continia Credential Management";
- SessionManager: Codeunit "Continia Session Manager";
- EnvironmentInformation: Codeunit "Environment Information";
- HttpClient: HttpClient;
- HttpContent: HttpContent;
- HttpHeaders: HttpHeaders;
- HttpRequest: HttpRequestMessage;
- HttpResponse: HttpResponseMessage;
- ResponseBody: Text;
- ResponseXmlDoc: XmlDocument;
- begin
- if not CredentialManagement.IsClientCredentialsValid() then
- exit(false);
-
- HttpRequest.GetHeaders(HttpHeaders);
- HttpHeaders.Add('Accept', 'application/xml;charset=utf-8');
- HttpHeaders.Add('Authorization', SecretStrSubstNo('Bearer %1', SessionManager.GetAccessToken()));
- HttpHeaders.Add('x-continia-companyguid', CredentialManagement.GetCompanyGuidAsText());
- HttpHeaders.Add('x-continia-version', '1500');
- if EnvironmentInformation.IsSaaSInfrastructure() then
- HttpHeaders.Add('x-AzureTenantId', AzureADTenant.GetAadTenantId());
-
- HttpRequest.Method('POST');
- HttpRequest.SetRequestUri(ApiUrlMgt.UpdateSubscriptionUrl());
- HttpContent.WriteFrom(GetUpdateSubscriptionBody(SubscriptionState, ClientInfo));
- HttpContent.GetHeaders(HttpHeaders);
- if HttpHeaders.Contains('Content-Type') then
- HttpHeaders.Remove('Content-Type');
- HttpHeaders.Add('Content-Type', 'application/xml');
-
- HttpRequest.Content := HttpContent;
-
-
- HttpClient.Timeout := 6000;
- HttpClient.Send(HttpRequest, HttpResponse);
- if HttpResponse.IsSuccessStatusCode then begin
- HttpResponse.Content.ReadAs(ResponseBody);
- if ResponseBody <> '' then
- XmlDocument.ReadFrom(ResponseBody, ResponseXmlDoc);
- end;
-
- exit(VerifyResponse(ResponseXmlDoc, ShowError));
- end;
-
- [NonDebuggable]
- local procedure VerifyResponse(ResponseXmlDoc: XmlDocument; ShowError: Boolean): Boolean
- var
- ErrorMessage: Text;
- ResponseStatus: Text;
- ErrorMessageAttr: XmlAttribute;
- ResponseStatusAttr: XmlAttribute;
- EmptyResponseNode: XmlNode;
- ErrorNode: XmlNode;
- begin
- if ResponseXmlDoc.SelectSingleNode('EmptyResponse', EmptyResponseNode) then
- if EmptyResponseNode.AsXmlElement().Attributes().Get('Status', ResponseStatusAttr) then
- ResponseStatus := ResponseStatusAttr.Value;
-
- if ResponseXmlDoc.SelectSingleNode('Error', ErrorNode) then
- if ErrorNode.AsXmlElement().Attributes().Get('Message', ErrorMessageAttr) then
- ErrorMessage := ErrorMessageAttr.Value;
-
- if ErrorMessage <> '' then
- if ShowError then
- Error(ErrorMessage)
- else
- exit(false);
-
- if ResponseStatus <> 'OK' then
- if ShowError then
- Error(ExpectedStatusOKErr)
- else
- exit(false);
-
- exit(true);
- end;
-
-
- [NonDebuggable]
- local procedure GetUpdateSubscriptionBody(SubscriptionState: Enum "Continia Subscription Status"; var ClientInfo: Record "Continia Participation" temporary) RequestBody: Text
- var
- AppMgt: Codeunit "Application System Constants";
- CredentialMgt: Codeunit "Continia Credential Management";
- ContactPerson: XmlElement;
- InvoicingDetails: XmlElement;
- Module: XmlElement;
- Modules: XmlElement;
- UpdateSubscriptionRequest: XmlElement;
- begin
- UpdateSubscriptionRequest := XmlElement.Create('UpdateSubscriptionRequest');
- UpdateSubscriptionRequest.SetAttribute('AppCode', CredentialMgt.GetAppCode());
- UpdateSubscriptionRequest.SetAttribute('AppVersion', CredentialMgt.GetAppVersion());
- UpdateSubscriptionRequest.SetAttribute('AppVersionText', CredentialMgt.GetAppFullName());
- UpdateSubscriptionRequest.SetAttribute('CoreVersion', CredentialMgt.GetAppVersion());
- UpdateSubscriptionRequest.SetAttribute('CoreVersionText', CredentialMgt.GetAppFullName());
- UpdateSubscriptionRequest.SetAttribute('NavVersion', GetTenantApplicationVersion());
- UpdateSubscriptionRequest.SetAttribute('NavVersionText', AppMgt.ApplicationVersion());
- UpdateSubscriptionRequest.SetAttribute('State', Format(MapOnlineSubscriptionState(SubscriptionState)));
- UpdateSubscriptionRequest.SetAttribute('UserId', UserId);
- UpdateSubscriptionRequest.SetAttribute('UserEmail', GetUserNotificationEmail());
- UpdateSubscriptionRequest.SetAttribute('PartnerId', ClientInfo."Partner Id");
-
- if ClientInfo."Company Name" <> '' then begin
- InvoicingDetails := XmlElement.Create('InvoicingDetails');
- InvoicingDetails.SetAttribute('CompanyName', ClientInfo."Company Name");
- InvoicingDetails.SetAttribute('CompanyAddress', ClientInfo.Address);
- InvoicingDetails.SetAttribute('PostalCode', ClientInfo."Post Code");
- InvoicingDetails.SetAttribute('Country', ClientInfo.County);
- InvoicingDetails.SetAttribute('CountryIsoCode', ClientInfo."Country/Region Code");
- InvoicingDetails.SetAttribute('VatRegNo', ClientInfo."VAT Registration No.");
- InvoicingDetails.SetAttribute('Email', ClientInfo."Contact Email");
- InvoicingDetails.SetAttribute('PhoneNo', ClientInfo."Contact Phone No.");
- UpdateSubscriptionRequest.Add(InvoicingDetails);
-
- ContactPerson := XmlElement.Create('ContactPerson');
- ContactPerson.SetAttribute('Name', ClientInfo."Contact Name");
- ContactPerson.SetAttribute('Email', ClientInfo."Contact Email");
- UpdateSubscriptionRequest.Add(ContactPerson);
- end;
-
- Modules := XmlElement.Create('Modules');
- Module := XmlElement.Create('Module');
- Module.SetAttribute('Code', 'ESSENTIAL');
- Module.SetAttribute('State', '1');
- Modules.Add(Module);
- UpdateSubscriptionRequest.Add(Modules);
-
- UpdateSubscriptionRequest.WriteTo(RequestBody);
- end;
-
- [NonDebuggable]
- internal procedure AcceptCompanyLicense(CompanyName: Text): Boolean
- var
- CredentialManagement: Codeunit "Continia Credential Management";
- SessionManager: Codeunit "Continia Session Manager";
- HttpClient: HttpClient;
- HttpContent: HttpContent;
- HttpHeaders: HttpHeaders;
- HttpRequest: HttpRequestMessage;
- HttpResponse: HttpResponseMessage;
- ResponseBody: Text;
- ResponseXmlDoc: XmlDocument;
- begin
- if not CredentialManagement.IsClientCredentialsValid() then
- exit(false);
-
- HttpRequest.GetHeaders(HttpHeaders);
- HttpHeaders.Add('Accept', 'application/xml;charset=utf-8');
- HttpHeaders.Add('Authorization', SecretStrSubstNo('Bearer %1', SessionManager.GetAccessToken()));
- HttpHeaders.Add('x-continia-companyguid', CredentialManagement.GetCompanyGuidAsText());
-
- HttpRequest.Method('POST');
- HttpRequest.SetRequestUri(ApiUrlMgt.GetAcceptCompanyLicenseUrl());
- HttpContent.WriteFrom(GetAcceptCompanyLicenseBody(CompanyName));
- HttpContent.GetHeaders(HttpHeaders);
- if HttpHeaders.Contains('Content-Type') then
- HttpHeaders.Remove('Content-Type');
- HttpHeaders.Add('Content-Type', 'application/xml');
-
- HttpRequest.Content := HttpContent;
-
- HttpClient.Timeout := 6000;
- HttpClient.Send(HttpRequest, HttpResponse);
- if HttpResponse.IsSuccessStatusCode then begin
- HttpResponse.Content.ReadAs(ResponseBody);
- if ResponseBody <> '' then
- XmlDocument.ReadFrom(ResponseBody, ResponseXmlDoc);
- end;
-
- exit(VerifyResponse(ResponseXmlDoc, true));
- end;
-
- [NonDebuggable]
- local procedure GetAcceptCompanyLicenseBody(CompanyName: Text) RequestBody: Text
- var
- CredentialMgt: Codeunit "Continia Credential Management";
- AcceptCompanyLicenseRequest: XmlElement;
- begin
- AcceptCompanyLicenseRequest := XmlElement.Create('AcceptCompanyLicenseRequest');
- AcceptCompanyLicenseRequest.SetAttribute('CompanyName', CompanyName);
- AcceptCompanyLicenseRequest.SetAttribute('AppCode', CredentialMgt.GetAppCode());
- AcceptCompanyLicenseRequest.WriteTo(RequestBody);
- end;
-
- [NonDebuggable]
- internal procedure UpdateClientInformation(var ClientInfo: Record "Continia Participation" temporary): Boolean
- var
- CredentialManagement: Codeunit "Continia Credential Management";
- SessionManager: Codeunit "Continia Session Manager";
- AzureADTenant: Codeunit "Azure AD Tenant";
- EnvironmentInformation: Codeunit "Environment Information";
- HttpClient: HttpClient;
- HttpContent: HttpContent;
- HttpHeaders: HttpHeaders;
- HttpRequest: HttpRequestMessage;
- HttpResponse: HttpResponseMessage;
- ResponseBody: Text;
- ResponseXmlDoc: XmlDocument;
- begin
- if not CredentialManagement.IsClientCredentialsValid() then
- exit(false);
-
- HttpRequest.GetHeaders(HttpHeaders);
- HttpHeaders.Add('Accept', 'application/xml;charset=utf-8');
- HttpHeaders.Add('Authorization', SecretStrSubstNo('Bearer %1', SessionManager.GetAccessToken()));
- HttpHeaders.Add('x-continia-companyguid', CredentialManagement.GetCompanyGuidAsText());
- HttpHeaders.Add('x-continia-version', '1500');
- if EnvironmentInformation.IsSaaSInfrastructure() then
- HttpHeaders.Add('x-AzureTenantId', AzureADTenant.GetAadTenantId());
-
- HttpRequest.Method('POST');
- HttpRequest.SetRequestUri(ApiUrlMgt.GetUpdateCompanyInfoUrl());
- HttpContent.WriteFrom(GetClientInfoUpdateRequest(ClientInfo));
- HttpContent.GetHeaders(HttpHeaders);
- if HttpHeaders.Contains('Content-Type') then
- HttpHeaders.Remove('Content-Type');
- HttpHeaders.Add('Content-Type', 'application/xml');
-
- HttpRequest.Content := HttpContent;
-
- HttpClient.Timeout := 6000;
- HttpClient.Send(HttpRequest, HttpResponse);
- if HttpResponse.IsSuccessStatusCode then begin
- HttpResponse.Content.ReadAs(ResponseBody);
- if ResponseBody <> '' then
- XmlDocument.ReadFrom(ResponseBody, ResponseXmlDoc);
- end;
-
- exit(VerifyResponse(ResponseXmlDoc, true));
- end;
-
- [NonDebuggable]
- local procedure GetClientInfoUpdateRequest(var ClientInfo: Record "Continia Participation" temporary) RequestBody: Text
- var
- CompanyInfoRequest: XmlElement;
- CompanyInfo: XmlElement;
- ContactPerson: XmlElement;
- begin
- CompanyInfoRequest := XmlElement.Create('InvoicingInformationRequest');
- CompanyInfo := XmlElement.Create('InvoicingDetails');
- CompanyInfo.SetAttribute('CompanyName', ClientInfo."Company Name");
- CompanyInfo.SetAttribute('CompanyAddress', ClientInfo.Address);
- CompanyInfo.SetAttribute('PostalCode', ClientInfo."Post Code");
- CompanyInfo.SetAttribute('Country', ClientInfo.County);
- CompanyInfo.SetAttribute('CountryIsoCode', ClientInfo."Country/Region Code");
- CompanyInfo.SetAttribute('VatRegNo', ClientInfo."VAT Registration No.");
- CompanyInfo.SetAttribute('Email', ClientInfo."Contact Email");
- CompanyInfo.SetAttribute('PhoneNo', ClientInfo."Contact Phone No.");
- CompanyInfo.SetAttribute('UserId', UserId);
- CompanyInfoRequest.Add(CompanyInfo);
-
- ContactPerson := XmlElement.Create('ContactPerson');
- ContactPerson.SetAttribute('Name', ClientInfo."Contact Name");
- ContactPerson.SetAttribute('Email', ClientInfo."Contact Email");
- CompanyInfoRequest.Add(ContactPerson);
-
- CompanyInfoRequest.WriteTo(RequestBody);
- end;
-
- [NonDebuggable]
- internal procedure GetUserNotificationEmail(): Text[250]
- var
- SalespersonPurchaser: Record "Salesperson/Purchaser";
- User: Record User;
- UserSetup: Record "User Setup";
- MailManagement: Codeunit "Mail Management";
- begin
- User.SetCurrentKey("User Name");
- User.SetRange("User Name", UserId);
- if User.FindFirst() then begin
- if MailManagement.CheckValidEmailAddress(User."Authentication Email") then
- exit(User."Authentication Email");
- if UserSetup.Get(User."User Name") then begin
- if MailManagement.CheckValidEmailAddress(UserSetup."E-Mail") then
- exit(UserSetup."E-Mail");
- if SalespersonPurchaser.Get(UserSetup."Salespers./Purch. Code") then
- if MailManagement.CheckValidEmailAddress(SalespersonPurchaser."E-Mail") then
- exit(SalespersonPurchaser."E-Mail");
- end;
- end;
- end;
-
- [NonDebuggable]
- local procedure GetTenantSubscriptionId(): Code[50]
- var
- AzureADTenant: Codeunit "Azure AD Tenant";
- EnvironmentInformation: Codeunit "Environment Information";
- AadTenantId: Text;
- begin
- if EnvironmentInformation.IsSaaSInfrastructure() then
- if EnvironmentInformation.IsProduction() then begin
- AadTenantId := AzureADTenant.GetAadTenantId();
- if (AadTenantId <> '') and (AadTenantId.ToLower() = 'common') then
- exit(CopyStr(AadTenantId, 1, 50));
- end;
- exit(CopyStr(LowerCase(CopyStr(Format(CreateGuid()), 2, 36)), 1, 50))
- end;
-
- [NonDebuggable]
- local procedure HandleInitializeCredentialResponse(ResponseXmlDoc: XmlDocument; var ClientId: SecretText; var ClientSecret: SecretText)
- var
- CredentialsAreMissing: Boolean;
- CreateCredentialErrorInfo: ErrorInfo;
- ErrorMessage: Text;
- TempXmlNode: XmlNode;
- begin
- CreateCredentialErrorInfo.Title := CreateClientErrTitleErr;
- CreateCredentialErrorInfo.Verbosity := Verbosity::Error;
- CreateCredentialErrorInfo.DataClassification := DataClassification::SystemMetadata;
-
- if ResponseXmlDoc.SelectSingleNode('Error/@Message', TempXmlNode) then
- ErrorMessage := TempXmlNode.AsXmlAttribute().Value;
- if ErrorMessage <> '' then begin
- CreateCredentialErrorInfo.Message := StrSubstNo(RequestFailedErr, ErrorMessage);
- Error(CreateCredentialErrorInfo);
- end;
-
- if ResponseXmlDoc.SelectSingleNode('InitializeCredentialsResponse/@ClientId', TempXmlNode) then
- ClientId := TempXmlNode.AsXmlAttribute().Value
- else
- CredentialsAreMissing := true;
-
- if ResponseXmlDoc.SelectSingleNode('InitializeCredentialsResponse/@ClientPassword', TempXmlNode) then
- ClientSecret := TempXmlNode.AsXmlAttribute().Value
- else
- CredentialsAreMissing := true;
-
- if CredentialsAreMissing then begin
- CreateCredentialErrorInfo.Message := ClientCredentialsMissingErr;
- Error(CreateCredentialErrorInfo);
- end;
- end;
-
- [TryFunction]
- [NonDebuggable]
- internal procedure TryAcquireClientToken(var AccessTokenValue: Text; var ExpiresInMs: Integer)
- var
- CredentialManagement: Codeunit "Continia Credential Management";
- HttpClient: HttpClient;
- HttpContent: HttpContent;
- HttpHeaders: HttpHeaders;
- HttpRequest: HttpRequestMessage;
- HttpResponse: HttpResponseMessage;
- ExpiresIn: Integer;
- Credentials: Text;
- ResponseBody: Text;
- ResponseXmlDoc: XmlDocument;
- begin
- HttpRequest.GetHeaders(HttpHeaders);
- HttpHeaders.Add('Accept', 'application/xml;charset=utf-8');
- HttpHeaders.Add('x-continia-check', 'true');
- Credentials := CredentialManagement.GetClientCredentialsApiBodyString();
- HttpRequest.Method('POST');
- HttpRequest.SetRequestUri(ApiUrlMgt.ClientAccessTokenUrl());
- HttpContent.WriteFrom(Credentials);
- HttpRequest.Content := HttpContent;
- HttpClient.Send(HttpRequest, HttpResponse);
- if HttpResponse.IsSuccessStatusCode then begin
- HttpResponse.Content.ReadAs(ResponseBody);
- if ResponseBody <> '' then
- XmlDocument.ReadFrom(ResponseBody, ResponseXmlDoc);
- end;
- HandleClientAccessTokenResponse(ResponseXmlDoc, AccessTokenValue, ExpiresIn);
- ExpiresInMs := ExpiresIn * 1000;
- end;
-
- [NonDebuggable]
- local procedure HandleClientAccessTokenResponse(ResponseXmlDoc: XmlDocument; var AccessTokenValue: Text; var ExpiresIn: Integer): Text
- var
- CredentialsAreMissing: Boolean;
- CreateCredentialErrorInfo: ErrorInfo;
- ErrorMessage: Text;
- TempXmlNode: XmlNode;
- begin
- if ResponseXmlDoc.SelectSingleNode('Error/@Message', TempXmlNode) then
- ErrorMessage := TempXmlNode.AsXmlAttribute().Value;
- if ErrorMessage <> '' then begin
- CreateCredentialErrorInfo.Message := StrSubstNo(RequestFailedErr, ErrorMessage);
- Error(CreateCredentialErrorInfo);
- end;
-
- if ResponseXmlDoc.SelectSingleNode('Token/@AccessToken', TempXmlNode) then
- AccessTokenValue := TempXmlNode.AsXmlAttribute().Value
- else
- CredentialsAreMissing := true;
-
- if ResponseXmlDoc.SelectSingleNode('Token/@ExpiresIn', TempXmlNode) then
- Evaluate(ExpiresIn, TempXmlNode.AsXmlAttribute().Value);
-
- if CredentialsAreMissing then begin
- CreateCredentialErrorInfo.Message := InvalidClientCredErr;
- Error(CreateCredentialErrorInfo);
- end;
- end;
-
- [NonDebuggable]
- local procedure MapOnlineSubscriptionState(SubscriptionStatus: Enum "Continia Subscription Status"): Integer
- begin
- case SubscriptionStatus of
- SubscriptionStatus::Subscription:
- exit(1);
- SubscriptionStatus::Unsubscribed:
- exit(2);
- end;
- end;
-
- [NonDebuggable]
- internal procedure GetTenantApplicationVersion(): Text
- var
- MajorMinorVersion: Code[100];
- Version: Integer;
- begin
- MajorMinorVersion := GetTenantMajorApplicationVersion() + GetTenantMinorApplicationVersion();
- Evaluate(Version, PadStr(MajorMinorVersion, 6, '0'));
- exit(Format(Version));
- end;
-
- [NonDebuggable]
- internal procedure GetTenantMajorApplicationVersion(): Code[50]
- var
- thisModule: ModuleInfo;
- BaseAppId: Text;
- completeVersion: Version;
- begin
- BaseAppId := '437dbf0e-84ff-417a-965d-ed2bb9650972';
- // First try to get Microsoft Base App
- if NavApp.GetModuleInfo(BaseAppId, thisModule) then begin
- completeVersion := thisModule.AppVersion;
- exit(Format(completeVersion.Major));
- end;
-
- // Second try to get Application App
- if GetApplicationModuleInfo(thisModule) then begin
- completeVersion := thisModule.AppVersion;
- exit(Format(completeVersion.Major));
- end;
- end;
-
- [NonDebuggable]
- internal procedure GetTenantMinorApplicationVersion(): Code[50]
- var
- thisModule: ModuleInfo;
- BaseAppId: Text;
- completeVersion: Version;
- begin
- BaseAppId := '437dbf0e-84ff-417a-965d-ed2bb9650972';
- // First try to get Microsoft Base App
- if NavApp.GetModuleInfo(BaseAppId, thisModule) then begin
- completeVersion := thisModule.AppVersion;
- exit(Format(completeVersion.Minor));
- end;
-
- // Second try to get Application App
- if GetApplicationModuleInfo(thisModule) then begin
- completeVersion := thisModule.AppVersion;
- exit(Format(completeVersion.Minor));
- end;
- end;
-
- [NonDebuggable]
- local procedure GetApplicationModuleInfo(var ApplicationModuleInfo: ModuleInfo): Boolean
- var
- AppDependencies: List of [ModuleDependencyInfo];
- AppDependency: ModuleDependencyInfo;
- CurrentModule: ModuleInfo;
- begin
- NavApp.GetCurrentModuleInfo(CurrentModule);
- AppDependencies := CurrentModule.Dependencies;
- foreach AppDependency in AppDependencies do
- if (AppDependency.Name = 'Application') then
- if NavApp.GetModuleInfo(AppDependency.Id, ApplicationModuleInfo) then
- exit(true);
- end;
-
-}
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/app/src/Subscription and Access/ContiniaSubscriptionStatus.Enum.al b/Apps/W1/EDocumentConnectors/Continia/app/src/Subscription and Access/ContiniaSubscriptionStatus.Enum.al
deleted file mode 100644
index 4868a5ff7d..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/app/src/Subscription and Access/ContiniaSubscriptionStatus.Enum.al
+++ /dev/null
@@ -1,24 +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.EServices.EDocumentConnector.Continia;
-
-enum 6395 "Continia Subscription Status"
-{
- Access = Internal;
- Extensible = false;
-
- value(0; NotSubscribed)
- {
- Caption = 'Not Subscribed';
- }
- value(1; Subscription)
- {
- Caption = 'Subscription';
- }
- value(2; Unsubscribed)
- {
- Caption = 'Unsubscribed';
- }
-}
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/test/ExtensionLogo.png b/Apps/W1/EDocumentConnectors/Continia/test/ExtensionLogo.png
deleted file mode 100644
index 79a3aa399d..0000000000
Binary files a/Apps/W1/EDocumentConnectors/Continia/test/ExtensionLogo.png and /dev/null differ
diff --git a/Apps/W1/EDocumentConnectors/Continia/test/Resources/AcceptCompanyLicense200.txt b/Apps/W1/EDocumentConnectors/Continia/test/Resources/AcceptCompanyLicense200.txt
deleted file mode 100644
index c21aa73e8f..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/test/Resources/AcceptCompanyLicense200.txt
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/test/Resources/AcceptCompanyLicenseError200.txt b/Apps/W1/EDocumentConnectors/Continia/test/Resources/AcceptCompanyLicenseError200.txt
deleted file mode 100644
index 7c8d89d87b..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/test/Resources/AcceptCompanyLicenseError200.txt
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/test/Resources/BusinessResponse200-multiple-accepted.txt b/Apps/W1/EDocumentConnectors/Continia/test/Resources/BusinessResponse200-multiple-accepted.txt
deleted file mode 100644
index 87c410411a..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/test/Resources/BusinessResponse200-multiple-accepted.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
- 53395377-9da3-444d-8ca6-c3fa4a7fd232
- 2024-10-03T15:26:04.577
-
- IP
-
- http://testcompany.com/application-response-IP.xml
-
-
-
-
- b4c00a73-ec0c-456e-9a4f-f26671dfcf69
- 2024-10-04T15:30:04.597
-
- AP
-
- http://testcompany.com/application-response-AP.xml
-
-
-
-
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/test/Resources/BusinessResponse200-multiple-rejected.txt b/Apps/W1/EDocumentConnectors/Continia/test/Resources/BusinessResponse200-multiple-rejected.txt
deleted file mode 100644
index d52e26d378..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/test/Resources/BusinessResponse200-multiple-rejected.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
- 53395377-9da3-444d-8ca6-c3fa4a7fd232
- 2024-10-03T15:26:04.577
- PRI
- Prices incorrect
- RE
-
- http://testcompany.com/application-response-RE.xml
-
-
-
-
- b4c00a73-ec0c-456e-9a4f-f26671dfcf69
- 2024-10-04T15:30:04.597
-
- AP
-
- http://testcompany.com/application-response-AP.xml
-
-
-
-
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/test/Resources/BusinessResponse200-multiple-statusinfo.txt b/Apps/W1/EDocumentConnectors/Continia/test/Resources/BusinessResponse200-multiple-statusinfo.txt
deleted file mode 100644
index 58ea246df2..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/test/Resources/BusinessResponse200-multiple-statusinfo.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
- 53395377-9da3-444d-8ca6-c3fa4a7fd232
- 2024-10-03T15:26:04.577
-
- IP
-
- http://testcompany.com/application-response-IP.xml
-
-
-
-
- b4c00a73-ec0c-456e-9a4f-f26671dfcf69
- 2024-10-04T15:30:04.597
-
- UQ
-
- http://testcompany.com/application-response-UQ.xml
-
-
-
-
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/test/Resources/BusinessResponse200-noresponse.txt b/Apps/W1/EDocumentConnectors/Continia/test/Resources/BusinessResponse200-noresponse.txt
deleted file mode 100644
index 195080b43a..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/test/Resources/BusinessResponse200-noresponse.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-
-
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/test/Resources/Common400.txt b/Apps/W1/EDocumentConnectors/Continia/test/Resources/Common400.txt
deleted file mode 100644
index 90c0bfc1cb..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/test/Resources/Common400.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-
- Bad Request
- Missing parameter
-
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/test/Resources/Common401.txt b/Apps/W1/EDocumentConnectors/Continia/test/Resources/Common401.txt
deleted file mode 100644
index 3af75f78d4..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/test/Resources/Common401.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-
- Not Authenticated
- Login failed
-
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/test/Resources/Common404.txt b/Apps/W1/EDocumentConnectors/Continia/test/Resources/Common404.txt
deleted file mode 100644
index 3eb77a1b1a..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/test/Resources/Common404.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-
- Not Found
- Not Found
-
diff --git a/Apps/W1/EDocumentConnectors/Continia/test/Resources/Common409.txt b/Apps/W1/EDocumentConnectors/Continia/test/Resources/Common409.txt
deleted file mode 100644
index 0765d99bd4..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/test/Resources/Common409.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-
- Conflict
- Conflict
-
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/test/Resources/Common422.txt b/Apps/W1/EDocumentConnectors/Continia/test/Resources/Common422.txt
deleted file mode 100644
index c4d278fa24..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/test/Resources/Common422.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
- string
- string
-
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/test/Resources/Common500.txt b/Apps/W1/EDocumentConnectors/Continia/test/Resources/Common500.txt
deleted file mode 100644
index 847ec96392..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/test/Resources/Common500.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-
- Internal Server
- Unhandled system error
-
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/test/Resources/InitializeClient200.txt b/Apps/W1/EDocumentConnectors/Continia/test/Resources/InitializeClient200.txt
deleted file mode 100644
index 051e87cd93..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/test/Resources/InitializeClient200.txt
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/test/Resources/InitializeClient200Incorrect.txt b/Apps/W1/EDocumentConnectors/Continia/test/Resources/InitializeClient200Incorrect.txt
deleted file mode 100644
index 9781d1ac6a..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/test/Resources/InitializeClient200Incorrect.txt
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/test/Resources/NemhandelNetworkIdTypes200.txt b/Apps/W1/EDocumentConnectors/Continia/test/Resources/NemhandelNetworkIdTypes200.txt
deleted file mode 100644
index b24f96b70b..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/test/Resources/NemhandelNetworkIdTypes200.txt
+++ /dev/null
@@ -1,53 +0,0 @@
-
-
- 0002
- DK
- CVR
- false
- 01babc72-e56c-4b46-ad7b-cdc020a65951
- DK:CVR
- DK
-
-
- 0003
- SE
- false
- 74d3483a-5781-4a2a-a01e-ec7c85aae8a4
- DK:SE
-
-
- 0004
- VANS
- false
- cc377c50-b890-47f5-b365-df6fff8f7b9f
- DK:VANS
-
-
- 0005
- P-nummer
- false
- 71a6b9e2-6c16-47d1-a974-5fb4f26e75cc
- DK:P
-
-
- 0006
- IBAN
- false
- df7a57ac-c5af-4392-93cf-0b6ae0094fd3
- IBAN
-
-
- 0007
- DUNS
- false
- 1918a26f-01ea-4ae8-b57f-bd6a1f709d9f
- DUNS
-
-
- 0088
- EAN/GLN
- false
- 727080e3-2c45-4b27-a4ee-df6a70e66912
- GLN
-
-
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/test/Resources/NemhandelNetworkProfiles200.txt b/Apps/W1/EDocumentConnectors/Continia/test/Resources/NemhandelNetworkProfiles200.txt
deleted file mode 100644
index 1392a7c0bd..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/test/Resources/NemhandelNetworkProfiles200.txt
+++ /dev/null
@@ -1,180 +0,0 @@
-
-
- Simpel Fakturaproces - Procurement-BilSim-1.0
-
- urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##OIOUBL-2.02::2.0
- Simpel Fakturaproces
-
- BILSIM
- true
- DK
- 48c21be4-5e96-4541-a60e-3491c6a06346
- Procurement-BilSim-1.0
-
-
- Fakturabekræftelse - Procurement-BilSimR-1.0
- urn:oasis:names:specification:ubl:schema:xsd:ApplicationResponse-2::ApplicationResponse##OIOUBL-2.02::2.0
- 3680b59b-3713-4d23-b20d-8512ecde8b88
- Procurement-BilSimR-1.0
-
-
- Procurement-BilSimReminderOnly
-
- a5f1de22-c0f3-4b26-99a5-f46ca57401cb
- Procurement-BilSimReminderOnly
-
-
- Procurement-OrdAdv-BilSim-1.0
-
- 8754c52d-b3d6-47a1-bead-00558935f5af
- Procurement-OrdAdv-BilSim-1.0
-
-
- Procurement-OrdAdv-BilSim-1.0
-
- 020395e4-946e-404e-bfe8-3c0135b71799
- Procurement-OrdAdv-BilSimR-1.0
-
-
- Procurement-OrdAdv-BilSim-1.0
-
- cf1de5f3-b4a8-4b4c-beb4-1523f7f4f0ba
- Procurement-OrdAdvR-BilSim-1.0
-
-
- Procurement-OrdAdv-BilSim-1.0
-
- edd27514-5313-42d8-a9cb-2cc3d40c7d12
- Procurement-OrdAdvR-BilSimR-1.0
-
-
- Procurement-OrdRes-1.0
-
- d7527254-541e-4c50-9525-ee50d5373171
- Procurement-OrdRes-1.0
-
-
- Procurement-OrdSel-BilSim-1.0
-
- 66ccd864-ccc7-4dde-8765-ae0f0aa44596
- Procurement-OrdSel-BilSim-1.0
-
-
- Procurement-OrdSel-BilSim-1.0
-
- 7b45a341-7119-491a-be95-1bc207e88c3b
- Procurement-OrdSel-BilSimR-1.0
-
-
- Simpel Ordreproces - Procurement-OrdSim-1.0
- urn:oasis:names:specification:ubl:schema:xsd:Order-2::Order##OIOUBL-2.02::2.0
- 09436b54-c4fc-4227-bc55-7a359d804d1f
- Procurement-OrdSim-1.0
-
-
- Simpel Ordre til Simpel Fakturasproces
-
- 93267abe-72ef-4cf3-b911-8d2398c2f32d
- Procurement-OrdSim-BilSim-1.0
-
-
- Procurement-OrdSim-BilSimR-1.0
-
- adccf54b-939a-4abb-aea4-2bd6d66b8c41
- Procurement-OrdSim-BilSimR-1.0
-
-
- Simpel Ordrebekræftelse - Procurement-OrdSimR-1.0
- urn:oasis:names:specification:ubl:schema:xsd:OrderResponseSimple-2::OrderResponseSimple##OIOUBL-2.02::2.0
- 6a7d52f4-1cb8-4817-9ff8-f5dab2ee0deb
- Procurement-OrdSimR-1.0
-
-
- Procurement-OrdSimR-BilSim-1.0
-
- 0ff94e31-7383-41c1-abba-92d11aa2e0d6
- Procurement-OrdSimR-BilSim-1.0
-
-
- Procurement-OrdSimR-BilSimR-1.0
-
- 710a60cf-3081-48b6-8e0e-edd37252aaec
- Procurement-OrdSimR-BilSimR-1.0
-
-
- Procurement-PayBas-1.0
-
- 838ad4c4-1fd0-44bf-b219-ee1ed1646e93
- Procurement-PayBas-1.0
-
-
- Procurement-PayBas-1.0
-
- 00470c20-06f0-4f3f-a888-90d41fa0d7cf
- Procurement-PayBasR-1.0
-
-
- Procurement-TecRes-1.0
-
- 822b5f8a-caf2-4377-aaca-6f6802d144c4
- Procurement-TecRes-1.0
-
-
- Reference Utility - OIOUTS
- urn:oasis:names:specification:ubl:schema:xsd:UtilityStatement-2::UtilityStatement##OIOUBL-2.1::2.1
- Simpel Fakturaproces
-
- BILSIM
- true
- DK
- 8cd2c16a-80c0-4ddb-9bfd-86718093cbe0
- Reference-Utility-1.0
-
-
- Reference-UtilityR-1.0
-
- d5240ea0-e195-4dea-8d4c-ea18c2fec974
- Reference-UtilityR-1.0
-
-
- urn:www.nesubl.eu:profiles:profile1:ver2.0
-
- 8d0e8868-499d-4a66-a6ac-87a8225e653b
- urn:www.nesubl.eu:profiles:profile1:ver2.0
-
-
- urn:www.nesubl.eu:profiles:profile2:ver2.0
-
- 6fb3889c-5b4a-45e6-9cc2-a355252709b4
- urn:www.nesubl.eu:profiles:profile2:ver2.0
-
-
- urn:www.nesubl.eu:profiles:profile3:ver2.0
-
- 0013e8f5-ebe6-4103-b6c6-e418209fd1fe
- urn:www.nesubl.eu:profiles:profile3:ver2.0
-
-
- NES5
- urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##OIOUBL-2.02::2.0
- Simpel Fakturaproces
-
- BILSIM
- true
- DK
- 9dea826b-8857-4b48-8cc7-e151e10cd427
- urn:www.nesubl.eu:profiles:profile5:ver2.0
-
-
- urn:www.nesubl.eu:profiles:profile7:ver2.0
-
- 5665b6e9-27e3-4525-a3c8-3ecee87667a1
- urn:www.nesubl.eu:profiles:profile7:ver2.0
-
-
- urn:www.nesubl.eu:profiles:profile8:ver2.0
-
- 23233193-06e7-47d3-ae43-5f75edcdecbd
- urn:www.nesubl.eu:profiles:profile8:ver2.0
-
-
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/test/Resources/NotFound.txt b/Apps/W1/EDocumentConnectors/Continia/test/Resources/NotFound.txt
deleted file mode 100644
index 19ad4031c7..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/test/Resources/NotFound.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-
- Not Found
-
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/test/Resources/OauthToken200.txt b/Apps/W1/EDocumentConnectors/Continia/test/Resources/OauthToken200.txt
deleted file mode 100644
index 97d13c60e4..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/test/Resources/OauthToken200.txt
+++ /dev/null
@@ -1,2 +0,0 @@
-
-
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/test/Resources/Participation200-Connected.txt b/Apps/W1/EDocumentConnectors/Continia/test/Resources/Participation200-Connected.txt
deleted file mode 100644
index 9474b01707..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/test/Resources/Participation200-Connected.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
- 568c29e7-c2c8-49bb-b135-9199d5b791d1
- 111222333
- London Postmaster
- 111222333
- 10 North Lake Avenue
- N12 5XY
- string
- string
- Carol Philips
- 004412345678
- cp@londonpostmaster.com
- true
- ConnectedEnum
- 0de4aedc-f84a-41bc-b511-387aaf96263e
- 2024-10-23T15:12:21.355Z
- 2024-10-23T15:12:21.355Z
- 0
- true
- Continia
- 28266ea9-84eb-49a4-948b-6c8b7790605a
-
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/test/Resources/Participation200-Disabled.txt b/Apps/W1/EDocumentConnectors/Continia/test/Resources/Participation200-Disabled.txt
deleted file mode 100644
index c041ee4ad9..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/test/Resources/Participation200-Disabled.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
- 568c29e7-c2c8-49bb-b135-9199d5b791d1
- 111222333
- London Postmaster
- 111222333
- 10 North Lake Avenue
- N12 5XY
- string
- string
- Carol Philips
- 004412345678
- cp@londonpostmaster.com
- true
- DisabledEnum
- 0de4aedc-f84a-41bc-b511-387aaf96263e
- 2024-10-23T15:12:21.355Z
- 2024-10-23T15:12:21.355Z
- 0
- true
- Continia
- 28266ea9-84eb-49a4-948b-6c8b7790605a
-
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/test/Resources/Participation200-Draft.txt b/Apps/W1/EDocumentConnectors/Continia/test/Resources/Participation200-Draft.txt
deleted file mode 100644
index 3c294de16f..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/test/Resources/Participation200-Draft.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
- 568c29e7-c2c8-49bb-b135-9199d5b791d1
- 111222333
- London Postmaster
- 111222333
- 10 North Lake Avenue
- N12 5XY
- string
- string
- Carol Philips
- 004412345678
- cp@londonpostmaster.com
- true
- DraftEnum
- 0de4aedc-f84a-41bc-b511-387aaf96263e
- 2024-10-23T15:12:21.355Z
- 2024-10-23T15:12:21.355Z
- 0
- true
- Continia
- 28266ea9-84eb-49a4-948b-6c8b7790605a
-
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/test/Resources/Participation200-InProcess.txt b/Apps/W1/EDocumentConnectors/Continia/test/Resources/Participation200-InProcess.txt
deleted file mode 100644
index fe93eda759..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/test/Resources/Participation200-InProcess.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
- 568c29e7-c2c8-49bb-b135-9199d5b791d1
- 111222333
- London Postmaster
- 111222333
- 10 North Lake Avenue
- N12 5XY
- string
- string
- Carol Philips
- 004412345678
- cp@londonpostmaster.com
- true
- InProcessEnum
- 0de4aedc-f84a-41bc-b511-387aaf96263e
- 2024-10-23T15:12:21.355Z
- 2024-10-23T15:12:21.355Z
- 0
- true
- Continia
- 28266ea9-84eb-49a4-948b-6c8b7790605a
-
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/test/Resources/Participation200-Suspended.txt b/Apps/W1/EDocumentConnectors/Continia/test/Resources/Participation200-Suspended.txt
deleted file mode 100644
index 269a220a36..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/test/Resources/Participation200-Suspended.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
- 568c29e7-c2c8-49bb-b135-9199d5b791d1
- 111222333
- London Postmaster
- 111222333
- 10 North Lake Avenue
- N12 5XY
- string
- string
- Carol Philips
- 004412345678
- cp@londonpostmaster.com
- true
- SuspendedEnum
- 0de4aedc-f84a-41bc-b511-387aaf96263e
- 2024-10-23T15:12:21.355Z
- 2024-10-23T15:12:21.355Z
- 0
- true
- Continia
- 28266ea9-84eb-49a4-948b-6c8b7790605a
-
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/test/Resources/Participation201-Draft.txt b/Apps/W1/EDocumentConnectors/Continia/test/Resources/Participation201-Draft.txt
deleted file mode 100644
index 3c294de16f..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/test/Resources/Participation201-Draft.txt
+++ /dev/null
@@ -1,23 +0,0 @@
-
-
- 568c29e7-c2c8-49bb-b135-9199d5b791d1
- 111222333
- London Postmaster
- 111222333
- 10 North Lake Avenue
- N12 5XY
- string
- string
- Carol Philips
- 004412345678
- cp@londonpostmaster.com
- true
- DraftEnum
- 0de4aedc-f84a-41bc-b511-387aaf96263e
- 2024-10-23T15:12:21.355Z
- 2024-10-23T15:12:21.355Z
- 0
- true
- Continia
- 28266ea9-84eb-49a4-948b-6c8b7790605a
-
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/test/Resources/ParticipationLookup200-external.txt b/Apps/W1/EDocumentConnectors/Continia/test/Resources/ParticipationLookup200-external.txt
deleted file mode 100644
index 131a1db234..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/test/Resources/ParticipationLookup200-external.txt
+++ /dev/null
@@ -1,101 +0,0 @@
-
-
- 9930
-
-
-
- peppol@storecove.com
- Storecove Document Service TEST
-
-
- PEPPOL Invoice Response (BIS 3.0)
- urn:oasis:names:specification:ubl:schema:xsd:ApplicationResponse-2::ApplicationResponse##urn:fdc:peppol.eu:poacc:trns:invoice_response:3::2.1
- 4f333069-936c-4f2d-af71-0f4d261ad4a4
- urn:fdc:peppol.eu:poacc:bis:invoice_response:3
-
-
- PEPPOL Message Level Response (BIS 3.0)
- urn:oasis:names:specification:ubl:schema:xsd:ApplicationResponse-2::ApplicationResponse##urn:fdc:peppol.eu:poacc:trns:mlr:3::2.1
- 64bb189a-3f65-4c28-a2e2-a257dba5c04b
- urn:fdc:peppol.eu:poacc:bis:mlr:3
-
-
- PEPPOL Credit Note (BIS 3.0)
- urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2::CreditNote##urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0::2.1
- PEPPOL BIS3 (Invoice, Credit Note, CII)
- PEPPOL BIS3.0
- dd2af6bc-a05a-4fd4-a577-0216a56bea84
- urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
-
-
- XRechnung UBL CreditNote V3.0
- urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2::CreditNote##urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0::2.1
- XRechnung v3.0 (Invoice, Credit Note, CII)
- XRECHNUNG V3.0
- d5e10b17-3070-437e-9277-c2144d160b1b
- urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
-
-
- XRechnung UBL CreditNote V2.3
- urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2::CreditNote##urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_2.3::2.1
- XRechnung v2.3 (Invoice, Credit Note, CII)
- XRECHNUNG V2.3
- ee8cd57b-6817-4e6f-8c33-6c83e078b43a
- urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
-
-
- PEPPOL Invoice (BIS 3.0)
- urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0::2.1
- PEPPOL BIS3 (Invoice, Credit Note, CII)
- PEPPOL BIS3.0
- 8f9ab973-c6f0-4dfb-9936-19b56c5a588b
- urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
-
-
- XRechnung UBL Invoice V3.0
- urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0::2.1
- XRechnung v3.0 (Invoice, Credit Note, CII)
- XRECHNUNG V3.0
- 09f2bd71-d019-439f-8fff-e68ce01fe105
- urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
-
-
- XRechnung UBL Invoice V2.3
- urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_2.3::2.1
- XRechnung v2.3 (Invoice, Credit Note, CII)
- XRECHNUNG V2.3
- 86427376-2b53-4e60-a34c-23fb1c78808e
- urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
-
-
- PEPPOL Cross Industry Invoice (BIS 3.0)
- urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100::CrossIndustryInvoice##urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0::D16B
- PEPPOL BIS3 (Invoice, Credit Note, CII)
- PEPPOL BIS3.0
- 24498487-81a8-4f46-9104-bb3915a6eee0
- urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
-
-
- XRechnung CII Invoice V3.0
- urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100::CrossIndustryInvoice##urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0::D16B
- XRechnung v3.0 (Invoice, Credit Note, CII)
- XRECHNUNG V3.0
- d80fc971-7a72-48d7-8617-69132f97781f
- urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
-
-
- XRechnung CII Invoice V2.3
- urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100::CrossIndustryInvoice##urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_2.3::D16B
- XRechnung v2.3 (Invoice, Credit Note, CII)
- XRECHNUNG V2.3
- 410ef408-c418-4e23-9952-b86e32b86d63
- urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
-
-
- peppol-transport-as4-v2_0
- https://www.storecove.com/docs
-
-
- DE111111111
-
-
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/test/Resources/ParticipationLookup200.txt b/Apps/W1/EDocumentConnectors/Continia/test/Resources/ParticipationLookup200.txt
deleted file mode 100644
index 21f1306c76..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/test/Resources/ParticipationLookup200.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/test/Resources/ParticipationProfile-outgoing.txt b/Apps/W1/EDocumentConnectors/Continia/test/Resources/ParticipationProfile-outgoing.txt
deleted file mode 100644
index 18ce6cd47b..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/test/Resources/ParticipationProfile-outgoing.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-
- 2024-10-23T12:00:00
- OutboundEnum
- dd2af6bc-a05a-4fd4-a577-0216a56bea84
- {participationProfileId.ToLower}
- 2024-10-23T13:00:00
-
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/test/Resources/ParticipationProfile200-peppolInvoice.txt b/Apps/W1/EDocumentConnectors/Continia/test/Resources/ParticipationProfile200-peppolInvoice.txt
deleted file mode 100644
index 01484d7640..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/test/Resources/ParticipationProfile200-peppolInvoice.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-
- 2024-10-23T12:00:00
- BothEnum
- 8f9ab973-c6f0-4dfb-9936-19b56c5a588b
- {participationProfileId.ToLower}
- 2024-10-23T13:00:00
-
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/test/Resources/ParticipationProfile200-randomId.txt b/Apps/W1/EDocumentConnectors/Continia/test/Resources/ParticipationProfile200-randomId.txt
deleted file mode 100644
index e51b6c5fa6..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/test/Resources/ParticipationProfile200-randomId.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-
- 2024-10-23T12:00:00
- BothEnum
- dd2af6bc-a05a-4fd4-a577-0216a56bea84
- {random.guid}
- 2024-10-23T13:00:00
-
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/test/Resources/ParticipationProfile200.txt b/Apps/W1/EDocumentConnectors/Continia/test/Resources/ParticipationProfile200.txt
deleted file mode 100644
index 15875ceb5f..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/test/Resources/ParticipationProfile200.txt
+++ /dev/null
@@ -1,7 +0,0 @@
-
- 2024-10-23T12:00:00
- BothEnum
- dd2af6bc-a05a-4fd4-a577-0216a56bea84
- {participationProfileId.ToLower}
- 2024-10-23T13:00:00
-
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/test/Resources/PartnerZoneConnect200.txt b/Apps/W1/EDocumentConnectors/Continia/test/Resources/PartnerZoneConnect200.txt
deleted file mode 100644
index 65bb7d826f..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/test/Resources/PartnerZoneConnect200.txt
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/test/Resources/PartnerZoneLogin200.txt b/Apps/W1/EDocumentConnectors/Continia/test/Resources/PartnerZoneLogin200.txt
deleted file mode 100644
index 9e1fafed7d..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/test/Resources/PartnerZoneLogin200.txt
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/test/Resources/PartnerZoneLogin200Incorrect.txt b/Apps/W1/EDocumentConnectors/Continia/test/Resources/PartnerZoneLogin200Incorrect.txt
deleted file mode 100644
index be1a4aefcf..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/test/Resources/PartnerZoneLogin200Incorrect.txt
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/test/Resources/PeppolNetworkIdTypes200.txt b/Apps/W1/EDocumentConnectors/Continia/test/Resources/PeppolNetworkIdTypes200.txt
deleted file mode 100644
index 4ec7ead9d1..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/test/Resources/PeppolNetworkIdTypes200.txt
+++ /dev/null
@@ -1,756 +0,0 @@
-
-
- 0002
-
- INSEE: National Institute for statistics and Economic studies
- true
- b79093d7-cada-415f-a6cd-b3b46b83528a
- FR:SIRENE
-
-
-
- 0007
- SE
- The Swedish National Tax Board
- true
- 780ec397-daaa-4ee8-bfcc-e4711b245b5e
- SE:ORGNR
- SE
-
-
- 0009
- FR
- DU PONT DE NEMOURS
- true
- d361dfeb-18a8-4c25-a627-f1a06be9cc83
- FR:SIRET
-
-
-
- 0037
- FI
- Finnish tax board
- true
- bf97384d-456c-437c-8d1e-7662c0520fe8
- FI:OVT
- FI
-
-
- 0060
-
- Dun and Bradstreet Ltd
- true
- d868eac3-8622-4c71-827e-9cc614a796fb
- DUNS
-
-
-
- 0088
- NZ
- GS1
- true
- 8419e851-11be-4f85-967d-9aa717856b49
- GLN
- NZ
-
-
- 0096
-
- The Danish Commerce and Companies Agency
- true
- a4afdd8e-b55a-4ace-9d32-1d59c5af9c90
- DK:P
-
-
-
- 0097
-
- Ediforum Italia
- true
- 052693c4-089a-4604-89ef-ca4a3597c1a0
- IT:FTI
-
-
-
- 0106
-
- Vereniging van Kamers van Koophandel en Fabrieken in Nederland
- true
- b9915287-5a79-4fc9-b909-72d65aa3de84
- NL:KVK
-
-
-
- 0130
-
- Directorates of the European Commission
- true
- 46ed3758-4660-4b1d-bd5c-160843b84616
- EU:NAL
-
-
-
- 0135
-
- Società Interbancaria per l Automazione
- true
- 37d8adca-4ffb-4f7b-a6f7-e55caeb6060e
- IT:SIA
-
-
-
- 0142
-
- Servizi Centralizzati SECETI
- true
- b5430f75-2bd4-4f1b-897a-79f486e187d2
- IT:SECETI
-
-
-
- 0151
- AU
- Australian Business Number (ABN) Scheme
- true
- c31c91fd-d8c4-4333-b207-de91bedbcac8
- AU:ABN
- AU
-
-
- 0183
- CH
- Swiss Unique Business Identification Number
- true
- 2a385d10-9cd9-4eb3-bc4f-39f033c8e57a
- CH:UIDB
- CH
-
-
- 0184
- DK
- DIGSTORG
- true
- 71e79c72-e470-4f32-90c2-dff4095b8632
- DK:DIGST
- DK
-
-
- 0190
-
- Organisatie Indentificatie Nummer
- true
- de8b2bc7-2e35-48ee-bfff-1535f18546e5
- NL:OINO
-
-
-
- 0191
-
- Estonia company code
- true
- 9229c644-b25f-4ac5-ad1a-36e086b93e00
- EE:CC
-
-
-
- 0192
- NO
- The Brønnøysund Register Centre
- true
- eafbc3d8-0e6c-46d9-9398-06728a6e045a
- NO:ORG
- NO
-
-
- 0193
-
- UBL.BE
- true
- 5559bc3d-fc35-4d26-8225-b68d979c6e5a
- UBLBE
-
-
-
- 0195
- SG
- Singapore Nationwide elnvoice Framework
- true
- de823404-5df4-48a9-a7fb-91d47daf5a91
- SG:UEN
-
-
-
- 0196
- IS
- Icelandic National Registry
- true
- 43377426-aa8e-41a2-867f-4fdbddc3b60f
- IS:KTNR
- IS
-
-
- 0198
-
- The Danish Business Authority
- true
- 423efc62-b6f6-43c7-abf0-4f109f7397e5
- DK:ERST
-
-
-
- 0199
-
- Legal Entity Identifier
- true
- 35cc83fa-ba61-4400-93f9-affdda6f0c3e
- LEI
-
-
-
- 0200
-
- State Enterprise Centre of Registers
- true
- 619523ad-544e-4257-a1b8-4e74049e4667
- LT:LEC
-
-
-
- 0201
-
- Codice Univoco Unità Organizzativa iPA
- true
- 42f4a083-59a3-4127-a7f2-9bf33af53cd3
- IT:CUUO
-
-
-
- 0204
-
- Koordinierungsstelle für IT-Standards (KoSIT)
- true
- 172d13f3-8b2c-4428-b149-b9dd182c3773
- DE:LWID
-
-
-
- 0208
- BE
- Numero entreprise / ondernemingsnummer / Unternehmensnummer
- true
- c7cd4c68-2cc7-488f-b718-368f9e517a68
- BE:EN
- BE
-
-
- 0216
- Finnish OVT code
- true
- 88701712-0852-4538-9347-57f1f1a34245
- FI:OVT2
-
-
- 9901
-
- Danish Ministry of the Interior and Health
- false
- 3f51d306-65de-4596-89cc-933543b0cb43
- DK:CPR
-
-
-
- 9902
-
- The Danish Commerce and Companies Agency
- false
- 43057922-16b4-4c11-b865-192717504d53
- DK:CVR
-
-
-
- 9904
-
- Danish Ministry of Taxation, Central Customs and Tax Administration
- false
- a2a3fc90-6aa2-4154-91dc-5ae96a0d40a4
- DK:SE
-
-
-
- 9905
-
- Danish VANS providers
- false
- 226fb9db-4304-4b1d-8cbc-dac765d0f5ae
- DK:VANS
-
-
-
- 9906
- IT
- Ufficio responsabile gestione partite IVA
- false
- c50e16a8-f170-4c4d-85eb-a4c3c4b4df6f
- IT:VAT
- IT
-
-
- 9907
-
- TAX Authority
- false
- 85a0ab8e-538f-4b63-aef4-80e7530fd6b3
- IT:CF
-
-
-
- 9908
-
- Enhetsregisteret ved Brønnøysundregistrene
- false
- bdda76fd-0d59-488f-a953-a651f4560005
- NO:ORGNR
-
-
-
- 9909
-
- Enhetsregisteret ved Brønnøysundregistrene
- false
- 82bfd4dc-3964-4bcc-8f2f-d734bb461f5d
- NO:VAT
-
-
-
- 9910
- HU
- Hungarian Tax Board
- false
- 14529f9c-fed4-4207-acdd-259394545eb6
- HU:VAT
- HU
-
-
- 9912
-
- National ministries of Economy
- false
- 215639e8-5f88-49fc-bd1e-05e0b6ab91be
- EU:VAT
-
-
-
- 9913
-
- Business Registers Network
- false
- ef0febfa-154d-49ae-9b65-7c259ad831d8
- EU:REID
-
-
-
- 9914
- AT
- Österreichische Umsatzsteuer-Identifikationsnummer
- false
- 6aff0db7-4bda-4758-8457-f2f577de97d7
- AT:VAT
- AT
-
-
- 9915
-
- Österreichisches Verwaltungs bzw. Organisationskennzeichen
- false
- fd2bb7cf-bd41-45ed-8f43-e80343d0a32a
- AT:GOV
-
-
-
- 9917
-
- Icelandic National Registry
- false
- 796b2288-b9cf-4fc9-a269-1e7efb8b744e
- IS:KT
-
-
-
- 9918
-
- S.W.I.F.T. Society for Worldwide Interbank Financial Telecommunications s.c.
- false
- 9fd493dc-2dd0-414f-a2e4-c8211d37971c
- IBAN
-
-
-
- 9919
-
- Kennziffer des Unternehmensregisters
- false
- bb0b52f3-d73b-40d4-84c8-4522d745bbb7
- AT:KUR
-
-
-
- 9920
- ES
- Agencia Española de Administración Tributaria
- false
- cb9ace3a-f4ad-4a4a-bb0e-c4ee0dd9f28e
- ES:VAT
- ES
-
-
- 9921
-
- Indice delle Pubbliche Amministrazioni
- false
- 1d3025ef-0dd1-4646-b57e-ac5c33b12b7e
- IT:IPA
-
-
-
- 9922
- AD
- Andorra VAT number
- false
- d3741495-000e-4ca8-8c8f-2a430855942a
- AD:VAT
- AD
-
-
- 9923
- AL
- Albania VAT number
- false
- 39d021bb-2de2-4b5e-b089-6a8a58410e4d
- AL:VAT
- AL
-
-
- 9924
- BA
- Bosnia and Herzegovina VAT number
- false
- 65c36225-c262-46a8-991d-56c295391fa2
- BA:VAT
- BA
-
-
- 9925
-
- Belgium VAT number
- false
- e4698d5e-d383-4355-8d9f-c068af7382f7
- BE:VAT
-
-
-
- 9926
- BG
- Bulgaria VAT number
- false
- 55c6f86c-a66b-4183-bac0-9560ffaf96f4
- BG:VAT
- BG
-
-
- 9927
-
- Switzerland VAT number
- false
- 4a75bbc5-b04d-4caa-9a65-6a25ef2e59d6
- CH:VAT
-
-
-
- 9928
- CY
- Cyprus VAT number
- false
- 6320f37d-90f9-446c-bbb7-e6a94b16ec83
- CY:VAT
- CY
-
-
- 9929
- CZ
- Czech Republic VAT number
- false
- 89c378a7-5a70-44b8-8ff0-3894180adc4b
- CZ:VAT
- CZ
-
-
- 9930
- DE
- Germany VAT number
- false
- 5649fa22-eec2-46aa-bc5a-c1cdaa545ce8
- DE:VAT
- DE
-
-
- 9931
- EE
- Estonia VAT number
- false
- 6f456455-868a-424c-98df-27a4d19f11ed
- EE:VAT
- EE
-
-
- 9932
- GB
- United Kingdom VAT number
- false
- 568c29e7-c2c8-49bb-b135-9199d5b791d1
- GB:VAT
- GB
-
-
- 9933
- EL
- Greece VAT number
- false
- 8b1a902f-fae9-493b-b819-e4cb76090e08
- GR:VAT
- EL
-
-
- 9934
- HR
- Croatia VAT number
- false
- d6c04f97-5c99-4df3-b13f-93fe648c21d9
- HR:VAT
- HR
-
-
- 9935
- IE
- Ireland VAT number
- false
- 28af06c1-1d77-4e37-a6d7-69bade0f9538
- IE:VAT
- IE
-
-
- 9936
- LI
- Liechtenstein VAT number
- false
- 0f352343-81d1-4cf2-8790-6e840c99ce90
- LI:VAT
- LI
-
-
- 9937
- LT
- Lithuania VAT number
- false
- 78423983-2d2d-47df-806d-f791e023eac6
- LT:VAT
- LT
-
-
- 9938
- LU
- Luxemburg VAT number
- false
- f115e641-e450-470c-a297-c6b0fc697578
- LU:VAT
- LU
-
-
- 9939
- LV
- Latvia VAT number
- false
- 6ca660b7-dd32-4c22-80e0-631645589d2c
- LV:VAT
- LV
-
-
- 9940
- MC
- Monaco VAT number
- false
- afcb2d07-21f9-4fac-9bce-be0be031e8e0
- MC:VAT
- MC
-
-
- 9941
- ME
- Montenegro VAT number
- false
- 1a0d34ca-ed0d-4281-b0a0-2596c1223275
- ME:VAT
- ME
-
-
- 9942
- MK
- Macedonia, the former Yugoslav Republic of VAT number
- false
- 5057f795-caa9-46ad-bc29-819b634ddc79
- MK:VAT
- MK
-
-
- 9943
- MT
- Malta VAT number
- false
- eb80d76f-9dbb-4968-becd-ae8f0c39a6fe
- MT:VAT
- MT
-
-
- 9944
- NL
- Netherlands VAT number
- false
- ab776d27-39c5-4862-abc2-72f2207539ba
- NL:VAT
- NL
-
-
- 9945
- PL
- Poland VAT number
- false
- db6b318d-5ef5-4adb-9db5-35047bb70259
- PL:VAT
- PL
-
-
- 9946
- PT
- Portugal VAT number
- false
- 325537ca-138f-4f39-8fd3-94248ee907eb
- PT:VAT
- PT
-
-
- 9947
- RO
- Romania VAT number
- false
- ed5e9ba9-f43b-4a47-8f14-e58b612a80fd
- RO:VAT
- RO
-
-
- 9948
- RS
- Serbia VAT number
- false
- 01f159b0-af5c-4c9c-88c7-a3862f7e2f7d
- RS:VAT
- RS
-
-
- 9949
- SI
- Slovenia VAT number
- false
- 3f51c8a4-a751-4a33-b14d-207e29400288
- SI:VAT
- SI
-
-
- 9950
- SK
- Slovakia VAT number
- false
- f71c7539-c5d8-4cb7-90a5-752820242d25
- SK:VAT
- SK
-
-
- 9951
- SM
- San Marino VAT number
- false
- e8be5fa5-8660-4b9d-a05b-c3b8ec4db342
- SM:VAT
- SM
-
-
- 9952
- TR
- Turkey VAT number
- false
- f689b509-b799-47ce-8c46-b4ac4bb849f4
- TR:VAT
- TR
-
-
- 9953
- VA
- Holy See (Vatican City State) VAT number
- false
- 343fc230-a23c-4030-b71e-6884001dabec
- VA:VAT
- VA
-
-
- 9954
-
- Dutch Originator's Identification Number
- false
- b9f84d6a-55ed-4318-9dc4-964627c28d4a
- NL:OIN
-
-
-
- 9954
-
- Dutch OverheidsIdentificatieNummer
- false
- f590b0a1-2495-4e70-bc13-9a4f11f0bb8a
- NL:OIN
-
-
-
- 9955
-
- Swedish VAT number
- false
- bed3edf2-5342-4354-bc0e-95a899fe8578
- SE:VAT
-
-
-
- 9956
-
- Belgian Crossroad Bank of Enterprises
- false
- 627d455d-34bc-41e3-a773-f0828b8483ee
- BE:CBE
-
-
-
- 9957
-
- France VAT number
- false
- 4038e8fa-d334-4e4a-b981-6056ce50bf30
- FR:VAT
- FR
-
-
- 9958
-
- German Leitweg ID
- false
- d3291252-4161-4468-8188-b02125b5b62a
- DE:LID
-
-
-
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/test/Resources/PeppolNetworkProfiles200.txt b/Apps/W1/EDocumentConnectors/Continia/test/Resources/PeppolNetworkProfiles200.txt
deleted file mode 100644
index 5d9c651653..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/test/Resources/PeppolNetworkProfiles200.txt
+++ /dev/null
@@ -1,626 +0,0 @@
-
-
- EHF Advanced Order Initiation 3.0
- urn:oasis:names:specification:ubl:schema:xsd:Order-2::Order##urn:fdc:peppol.eu:poacc:trns:order:3:extended:urn:fdc:anskaffelser.no:2019:ehf:spec:3.0::2.2
- 3692d1e1-2c15-4a2a-b097-5d9c6ecc271a
- urn:fdc:anskaffelser.no:2019:ehf:postaward:g3:02:1.0
-
-
- EHF Advanced Order Response 3.0
- urn:oasis:names:specification:ubl:schema:xsd:OrderResponse-2::OrderResponse##urn:fdc:peppol.eu:poacc:trns:order_response:3:extended:urn:fdc:anskaffelser.no:2019:ehf:spec:3.0::2.2
- 2782a870-a968-43aa-918d-2baafd96bd47
- urn:fdc:anskaffelser.no:2019:ehf:postaward:g3:02:1.0
-
-
- Xrechnung 2.2 Invoice (w. extension)
- urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_2.2#conformant#urn:xoev-de:kosit:extension:xrechnung_2.2::2.1
- XRechnung v2.2 (Invoice, Credit Note, CII)
- XRECHNUNG V2.2
- true
- DE
- 72ee5de2-0ed3-4b30-b848-37dd3726bf87
- urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
-
-
- XRechnung UBL Invoice V2.3
- urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_2.3::2.1
- XRechnung v2.3 (Invoice, Credit Note, CII)
- XRECHNUNG V2.3
- 86427376-2b53-4e60-a34c-23fb1c78808e
- urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
-
-
- PEPPOL Credit Note (BIS 3.0)
- urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2::CreditNote##urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0::2.1
- PEPPOL BIS3 (Invoice, Credit Note, CII)
- PEPPOL BIS3.0
- true
- dd2af6bc-a05a-4fd4-a577-0216a56bea84
- urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
-
-
- Xrechnung 2.0 Invoice
- urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_2.0::2.1
- f533f6d9-815b-4d5b-b55e-1822c60d71ae
- urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
-
-
- Xrechnung 2.0 CrossIndustryInvoice (w. extension) for Continia (Freshdesk Ticket #7787) - document id version upgraded at 2021-04-23
- urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100::CrossIndustryInvoice##urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_2.0#conformant#urn:xoev-de:kosit:extension:xrechnung_2.0::16B
- a9fac71d-8024-4509-af9f-18405a39ca74
- urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
-
-
- Xrechnung 2.0 Invoice (w. extension)
- urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_2.0#conformant#urn:xoev-de:kosit:extension:xrechnung_2.0::2.1
- XRechnung v2 (Invoice, Credit Note, CII)
- XRECHNUNG V2
- true
- DE
- 11d205a6-0e77-4aac-a8dc-18fc4bd1eee8
- urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
-
-
- PEPPOL Invoice (BIS 3.0)
- urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0::2.1
- PEPPOL BIS3 (Invoice, Credit Note, CII)
- PEPPOL BIS3.0
- true
- 8f9ab973-c6f0-4dfb-9936-19b56c5a588b
- urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
-
-
- Xrechnung 2.2 CrossIndustryInvoice (w. extension)
- urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100::CrossIndustryInvoice##urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_2.2#conformant#urn:xoev-de:kosit:extension:xrechnung_2.2::D16B
- XRechnung v2.2 (Invoice, Credit Note, CII)
- XRECHNUNG V2.2
- 80c9993b-27c7-4999-9c51-11ae6b3bd1ea
- urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
-
-
- Xrechnung 2.2 Invoice
- urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_2.2::2.1
- 668f126f-06d0-44fb-8e37-0bb64a23a3c9
- urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
-
-
- Xrechnung 1.3 Invoice
- urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_1.3#conformant#urn:xoev-de:kosit:extension:xrechnung_1.3::2.1
- 3ba4a204-0c9d-433d-ae0f-0e7aa763eece
- urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
-
-
- XRechnung CII Invoice V3.0 Extension
- urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100::CrossIndustryInvoice##urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0#conformant#urn:xeinkauf.de:kosit:extension:xrechnung_3.0::D16B
- 8da41879-e1e5-4c94-9200-5fed43cff8f7
- urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
-
-
- XRechnung UBL Invoice V3.0 Extension
- urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0#conformant#urn:xeinkauf.de:kosit:extension:xrechnung_3.0::2.1
- f33fe036-73d0-47b9-b5ae-57da988856cf
- urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
-
-
- SG PEPPOL Invoice (BIS 3.0)
- urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##urn:cen.eu:en16931:2017#conformant#urn:fdc:peppol.eu:2017:poacc:billing:international:sg:3.0::2.1
- SG PEPPOL BIS3 (Invoice, Credit Note)
- SG PEPPOL BIS3
- ff1c8f4d-f467-48d8-8c6f-46fad815802f
- urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
-
-
- XRechnung Invoice v1.2
- urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_1.2::2.1
- XRechnung v1 (Invoice, Credit Note, CII)
- XRECHNUNG V1
- 7063e792-d4b0-4654-a5a0-46fd0659bff8
- urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
-
-
- XRechnung UBL CreditNote V3.0 Extension
- urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2::CreditNote##urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0#conformant#urn:xeinkauf.de:kosit:extension:xrechnung_3.0::2.1
- fff93ede-42cb-4098-8da5-4a70375442d0
- urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
-
-
- Xrechnung 2.0 CrossIndustryInvoice (w. extension)
- urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100::CrossIndustryInvoice##urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_2.0#conformant#urn:xoev-de:kosit:extension:xrechnung_2.0::D16B
- XRechnung v2 (Invoice, Credit Note, CII)
- XRECHNUNG V2
- 94b2b716-7f62-4266-b103-856231dfec36
- urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
-
-
- Xrechnung 2.2 CreditNote
- urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2::CreditNote##urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_2.2::2.1
- a5abcfce-a6be-4bc1-a7b1-65692166c1b4
- urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
-
-
- XRechnung UBL CreditNote V2.3 Extension
- urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2::CreditNote##urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_2.3#conformant#urn:xoev-de:kosit:extension:xrechnung_2.3::2.1
- ec07f4e6-20c1-4d6c-849e-70432571cb83
- urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
-
-
- SG PEPPOL Credit Note (BIS 3.0)
- urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2::CreditNote##urn:cen.eu:en16931:2017#conformant#urn:fdc:peppol.eu:2017:poacc:billing:international:sg:3.0::2.1
- SG PEPPOL BIS3 (Invoice, Credit Note)
- SG PEPPOL BIS3
- 3ff9a216-0f44-47ab-ac9a-68af8795d9d0
- urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
-
-
- Xrechnung 1.3 CreditNote
- urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2::CreditNote##urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_1.3#conformant#urn:xoev-de:kosit:extension:xrechnung_1.3::2.1
- 9825dd2d-94b7-4fcd-ae24-68dc4432c335
- urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
-
-
- XRechnung CII Invoice V3.0
- urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100::CrossIndustryInvoice##urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0::D16B
- XRechnung v3.0 (Invoice, Credit Note, CII)
- XRECHNUNG V3.0
- d80fc971-7a72-48d7-8617-69132f97781f
- urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
-
-
- XRechnung UBL CreditNote V2.3
- urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2::CreditNote##urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_2.3::2.1
- XRechnung v2.3 (Invoice, Credit Note, CII)
- XRECHNUNG V2.3
- ee8cd57b-6817-4e6f-8c33-6c83e078b43a
- urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
-
-
- XRechnung Cross Industry Invoice v1.2
- urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100::CrossIndustryInvoice##urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_1.2::D16B
- XRechnung v1 (Invoice, Credit Note, CII)
- XRECHNUNG V1
- 48f96989-0367-46c6-89f0-ec31ff0f178d
- urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
-
-
- XRechnung UBL Invoice V3.0
- urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0::2.1
- XRechnung v3.0 (Invoice, Credit Note, CII)
- XRECHNUNG V3.0
- 09f2bd71-d019-439f-8fff-e68ce01fe105
- urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
-
-
- XRechnung CII Invoice V2.3 Extension
- urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100::CrossIndustryInvoice##urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_2.3#conformant#urn:xoev-de:kosit:extension:xrechnung_2.3::D16B
- 23baf699-f30c-4f7e-9b60-e7da553a6e48
- urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
-
-
- Xrechnung 2.2 CrossIndustryInvoice
- urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100::CrossIndustryInvoice##urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_2.2::D16B
- bce0f939-d4b7-47e8-8345-fc363019b875
- urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
-
-
- Xrechnung 2.2 CreditNote (w. extension)
- urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2::CreditNote##urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_2.2#conformant#urn:xoev-de:kosit:extension:xrechnung_2.2::2.1
- XRechnung v2.2 (Invoice, Credit Note, CII)
- XRECHNUNG V2.2
- true
- DE
- e7f15d5f-35a7-47e3-abbf-ffb7fbb55785
- urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
-
-
- XRechnung UBL CreditNote V3.0
- urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2::CreditNote##urn:cen.eu:en16931:2017#compliant#urn:xeinkauf.de:kosit:xrechnung_3.0::2.1
- XRechnung v3.0 (Invoice, Credit Note, CII)
- XRECHNUNG V3.0
- d5e10b17-3070-437e-9277-c2144d160b1b
- urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
-
-
- AU/NZ PEPPOL Credit Note (BIS 3.0)
- urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2::CreditNote##urn:cen.eu:en16931:2017#conformant#urn:fdc:peppol.eu:2017:poacc:billing:international:aunz:3.0::2.1
- AU-NZ PEPPOL BIS3 (Invoice, Credit Note)
- PEPPOL AU-NZ BIS3
- f688e5a3-a387-4abf-bf05-c4847820e6fa
- urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
-
-
- XRechnung UBL Invoice V2.3 Extension
- urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_2.3#conformant#urn:xoev-de:kosit:extension:xrechnung_2.3::2.1
- c0ef92e8-0633-4018-a603-c7fbae53503e
- urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
-
-
- Xrechnung 2.0 CreditNote
- urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2::CreditNote##urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_2.0::2.1
- 9446a757-8cb3-4ad6-82d6-ca206a09fb16
- urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
-
-
- SI-UBL 2.0 Invoice
- urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##urn:cen.eu:en16931:2017#compliant#urn:fdc:nen.nl:nlcius:v1.0::2.1
- 2c43d76d-15f4-4e79-a831-daa6868f9b81
- urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
-
-
- XRechnung Credit Note v1.2
- urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2::CreditNote##urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_1.2::2.1
- XRechnung v1 (Invoice, Credit Note, CII)
- XRECHNUNG V1
- 13a2bd12-b46f-4ae5-9316-a60c2a8ebc34
- urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
-
-
- AU/NZ PEPPOL Invoice (BIS 3.0)
- urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##urn:cen.eu:en16931:2017#conformant#urn:fdc:peppol.eu:2017:poacc:billing:international:aunz:3.0::2.1
- AU-NZ PEPPOL BIS3 (Invoice, Credit Note)
- PEPPOL AU-NZ BIS3
- 1fcad749-bb5e-432c-8d23-96bcbda4b875
- urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
-
-
- SI-UBL 2.0 Credit Note
- urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2::CreditNote##urn:cen.eu:en16931:2017#compliant#urn:fdc:nen.nl:nlcius:v1.0::2.1
- 1d292f60-a6b5-419d-a0d0-97acd9cdb5fc
- urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
-
-
- Xrechnung 1.3 CrossIndustryInvoice
- urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100::CrossIndustryInvoice##urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_1.3#conformant#urn:xoev-de:kosit:extension:xrechnung_1.3::16B
- f9087999-af28-4897-9eaf-87ed9151d887
- urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
-
-
- Xrechnung 2.0 CreditNote (w. extension)
- urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2::CreditNote##urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_2.0#conformant#urn:xoev-de:kosit:extension:xrechnung_2.0::2.1
- XRechnung v2 (Invoice, Credit Note, CII)
- XRECHNUNG V2
- true
- DE
- 890ecf6a-d9f1-4c79-9175-ab55e3e193cc
- urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
-
-
- XRechnung CII Invoice V2.3
- urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100::CrossIndustryInvoice##urn:cen.eu:en16931:2017#compliant#urn:xoev-de:kosit:standard:xrechnung_2.3::D16B
- XRechnung v2.3 (Invoice, Credit Note, CII)
- XRECHNUNG V2.3
- 410ef408-c418-4e23-9952-b86e32b86d63
- urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
-
-
- PEPPOL Cross Industry Invoice (BIS 3.0)
- urn:un:unece:uncefact:data:standard:CrossIndustryInvoice:100::CrossIndustryInvoice##urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0::D16B
- PEPPOL BIS3 (Invoice, Credit Note, CII)
- PEPPOL BIS3.0
- 24498487-81a8-4f46-9104-bb3915a6eee0
- urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
-
-
- AU/NZ PEPPOL Self-Billing Credit Note (BIS 3.0)
- urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2::CreditNote##urn:cen.eu:en16931:2017#conformant#urn:fdc:peppol.eu:2017:poacc:selfbilling:international:aunz:3.0::2.1
- AU-NZ PEPPOL Self-Billing BIS3 (Invoice, Credit Note)
- PEPPOL AU-NZ SBIS3
- 43aafd3d-2de0-46c9-bad2-b4e7608f88ca
- urn:fdc:peppol.eu:2017:poacc:selfbilling:01:1.0
-
-
- AU/NZ PEPPOL Self-Billing Invoice (BIS 3.0)
- urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##urn:cen.eu:en16931:2017#conformant#urn:fdc:peppol.eu:2017:poacc:selfbilling:international:aunz:3.0::2.1
- AU-NZ PEPPOL Self-Billing BIS3 (Invoice, Credit Note)
- PEPPOL AU-NZ SBIS3
- 34df4209-079c-4d01-b58e-5fe6c42d2008
- urn:fdc:peppol.eu:2017:poacc:selfbilling:01:1.0
-
-
- Peppol Advanced Order (BIS 3.0)
- urn:oasis:names:specification:ubl:schema:xsd:Order-2::Order##urn:fdc:peppol.eu:poacc:trns:order:3::2.1
- 9357d973-e4a3-49e8-a054-9fad3dcdb171
- urn:fdc:peppol.eu:poacc:bis:advanced_ordering:3
-
-
- Peppol Order Change (BIS 3.0)
- urn:oasis:names:specification:ubl:schema:xsd:OrderChange-2::OrderChange##urn:fdc:peppol.eu:poacc:trns:order_change:3::2.3
- f6d47008-04c6-47c7-9f31-e21445b204d5
- urn:fdc:peppol.eu:poacc:bis:advanced_ordering:3
-
-
- Peppol Order Response Advanced (BIS 3.0)
- urn:oasis:names:specification:ubl:schema:xsd:OrderResponse-2::OrderResponse##urn:fdc:peppol.eu:poacc:trns:order_response_advanced:3::2.3
- 4dd648a6-7cae-4e8b-ba25-c82eb6edf4b6
- urn:fdc:peppol.eu:poacc:bis:advanced_ordering:3
-
-
- Peppol Order Cancellation (BIS 3.0)
- urn:oasis:names:specification:ubl:schema:xsd:OrderCancellation-2::OrderCancellation##urn:fdc:peppol.eu:poacc:trns:order_cancellation:3::2.3
- 3592ed68-d63d-4d26-8c9b-22b5be8d6dd9
- urn:fdc:peppol.eu:poacc:bis:advanced_ordering:3
-
-
- PEPPOL Despatch Advice (BIS 3.0)
- urn:oasis:names:specification:ubl:schema:xsd:DespatchAdvice-2::DespatchAdvice##urn:fdc:peppol.eu:poacc:trns:despatch_advice:3::2.1
- 88e08943-2863-43e5-b5b4-aca6f411dbfb
- urn:fdc:peppol.eu:poacc:bis:despatch_advice:3
-
-
- PEPPOL Invoice Response (BIS 3.0)
- urn:oasis:names:specification:ubl:schema:xsd:ApplicationResponse-2::ApplicationResponse##urn:fdc:peppol.eu:poacc:trns:invoice_response:3::2.1
- 4f333069-936c-4f2d-af71-0f4d261ad4a4
- urn:fdc:peppol.eu:poacc:bis:invoice_response:3
-
-
- PEPPOL Message Level Response (BIS 3.0)
- urn:oasis:names:specification:ubl:schema:xsd:ApplicationResponse-2::ApplicationResponse##urn:fdc:peppol.eu:poacc:trns:mlr:3::2.1
- 64bb189a-3f65-4c28-a2e2-a257dba5c04b
- urn:fdc:peppol.eu:poacc:bis:mlr:3
-
-
- PEPPOL Order Agreement (BIS 3.0)
- urn:oasis:names:specification:ubl:schema:xsd:OrderResponse-2::OrderResponse##urn:fdc:peppol.eu:poacc:trns:order_agreement:3::2.1
- 454f32e9-c413-41d6-8ccf-576e76ea6020
- urn:fdc:peppol.eu:poacc:bis:order_agreement:3
-
-
- PEPPOL Order Only (BIS 3.0)
- urn:oasis:names:specification:ubl:schema:xsd:Order-2::Order##urn:fdc:peppol.eu:poacc:trns:order:3::2.1
- 3824b968-c417-4be8-bb09-b6217cbfc50b
- urn:fdc:peppol.eu:poacc:bis:order_only:3
-
-
- PEPPOL Order Response (BIS 3.0)
- urn:oasis:names:specification:ubl:schema:xsd:OrderResponse-2::OrderResponse##urn:fdc:peppol.eu:poacc:trns:order_response:3::2.1
- PEPPOL BIS Ordering 3 (Order, Order Response)
- PEPPOL EORDERING
- 5784790c-3ee1-4511-bbd2-b34260cad657
- urn:fdc:peppol.eu:poacc:bis:ordering:3
-
-
- PEPPOL Order (BIS 3.0)
- urn:oasis:names:specification:ubl:schema:xsd:Order-2::Order##urn:fdc:peppol.eu:poacc:trns:order:3::2.1
- PEPPOL BIS Ordering 3 (Order, Order Response)
- PEPPOL EORDERING
- 8002d670-23e6-4d8a-b813-749abd3aadb0
- urn:fdc:peppol.eu:poacc:bis:ordering:3
-
-
- PEPPOL Punch Out (BIS 3.0)
- urn:oasis:names:specification:ubl:schema:xsd:Catalogue-2::Catalogue##urn:fdc:peppol.eu:poacc:trns:punch_out:3::2.1
- 8211f941-a7ea-4143-ac10-1c551649369b
- urn:fdc:peppol.eu:poacc:bis:punch_out:3
-
-
- JP PINT Invoice 1.0* (wildcard)
- urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##urn:peppol:pint:billing-1@jp-1*::2.1
- 7915c00a-4f28-4255-b108-169a02b29e7d
- urn:peppol:bis:billing
-
-
- A-NZ PINT Credit Note v1.0* (wildcard)
- urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2::CreditNote##urn:peppol:pint:billing-1@aunz-1*::2.1
- 02b22d34-b1a2-44e6-b568-74f07130a8dd
- urn:peppol:bis:billing
-
-
- Peppol PINT Invoice v1.0* (wildcard)
- urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##urn:peppol:pint:billing-1*::2.1
- 43306d19-935f-4f1b-bae0-830cb62857d2
- urn:peppol:bis:billing
-
-
- JP PINT Invoice 1.0 (busdox)
- urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##urn:peppol:pint:billing-1@jp-1::2.1
- 1d9fd652-cbe9-4665-b4c0-d01461292d65
- urn:peppol:bis:billing
-
-
- Peppol PINT CreditNote v1.0* (wildcard)
- urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2::CreditNote##urn:peppol:pint:billing-1*::2.1
- 3bc1506d-ef9b-4925-9500-f22b74a98f45
- urn:peppol:bis:billing
-
-
- A-NZ PINT Invoice v1.0* (wildcard)
- urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##urn:peppol:pint:billing-1@aunz-1*::2.1
- 88bf3985-acdb-4e4c-8778-f3415a3cad1c
- urn:peppol:bis:billing
-
-
- A-NZ PINT Self-Billing Credit Note v1.0* (wildcard)
- urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2::CreditNote##urn:peppol:pint:selfbilling-1@aunz-1*::2.1
- 137f47f9-8a4f-4c58-a00d-f398f224c5cb
- urn:peppol:bis:selfbilling
-
-
- A-NZ PINT Self-Billing Invoice v1.0* (wildcard)
- urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##urn:peppol:pint:selfbilling-1@aunz-1*::2.1
- b6aa6023-25be-4d8f-8b7e-a72e82042d96
- urn:peppol:bis:selfbilling
-
-
- SFTI Svefaktura v1 w/ attachment
- urn:sfti:documents:StandardBusinessDocumentHeader::Invoice##urn:sfti:documents:BasicInvoice:1:0:#BasicInvoice_ObjectEnvelope::1.0
- Svefaktura simple and with attachment
- SVEFAKTURA V1
- e7073408-aaee-4706-aa4d-c919e46c5523
- urn:sfti:services:documentprocessing:BasicInvoice:1:0
-
-
- SFTI Svefaktura v1
- urn:sfti:documents:BasicInvoice:1:0::Invoice##urn:sfti:documents:BasicInvoice:1:0::1.0
- Svefaktura simple and with attachment
- SVEFAKTURA V1
- 66f94162-96ad-444d-9278-2a0b208d8df8
- urn:sfti:services:documentprocessing:BasicInvoice:1:0
-
-
- EHF Catalogue v2
- urn:oasis:names:specification:ubl:schema:xsd:Catalogue-2::Catalogue##urn:www.cenbii.eu:transaction:biitrns019:ver2.0:extended:urn:www.peppol.eu:bis:peppol1a:ver2.0:extended:urn:www.difi.no:ehf:katalog:ver1.0::2.1
- 85ac7894-851e-47fb-ac08-d683d479bbfb
- urn:www.cenbii.eu:profile:bii01:ver2.0
-
-
- SFTI Svekatalog (BIS 2.0)
- urn:oasis:names:specification:ubl:schema:xsd:Catalogue-2::Catalogue##urn:www.cenbii.eu:transaction:biitrns019:ver2.0:extended:urn:www.sfti.se:svekatalog:ver2.0::2.1
- 241602cd-6ab1-47c1-9c16-465dc8d3825a
- urn:www.cenbii.eu:profile:bii01:ver2.0#urn:www.sfti.se:svekatalog:ver2.0
-
-
- SFTI Sveorder v1
- urn:oasis:names:specification:ubl:schema:xsd:Order-2::Order##urn:www.cenbii.eu:transaction:biicoretrdm001:ver1.0::2.0
- c41e3243-4a2d-4caa-9b94-abd79028e43f
- urn:www.cenbii.eu:profile:bii03:ver1.0
-
-
- PEPPOL Order 3a (BIS 2.0)
- urn:oasis:names:specification:ubl:schema:xsd:Order-2::Order##urn:www.cenbii.eu:transaction:biitrns001:ver2.0:extended:urn:www.peppol.eu:bis:peppol3a:ver2.0:extended:urn:www.ubl-italia.org:spec:ordine:ver2.1::2.1
- eb255817-235d-424d-9678-d591ebf2c69d
- urn:www.cenbii.eu:profile:bii03:ver2.0
-
-
- PEPPOL Order (BIS 2.0)
- urn:oasis:names:specification:ubl:schema:xsd:Order-2::Order##urn:www.cenbii.eu:transaction:biitrns001:ver2.0:extended:urn:www.peppol.eu:bis:peppol3a:ver2.0::2.1
- 9d953397-2a5c-41c5-bf4a-67d3efddb707
- urn:www.cenbii.eu:profile:bii03:ver2.0
-
-
- SimplerInvoicing Invoice v1.1
- urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##urn:www.cenbii.eu:transaction:biitrns010:ver2.0:extended:urn:www.peppol.eu:bis:peppol4a:ver2.0:extended:urn:www.simplerinvoicing.org:si:si-ubl:ver1.1.x::2.1
- 2f299842-3d95-4f33-89ef-f7bc8819680c
- urn:www.cenbii.eu:profile:bii04:ver1.0
-
-
- PEPPOL Invoice (BIS 2.0)
- urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##urn:www.cenbii.eu:transaction:biitrns010:ver2.0:extended:urn:www.peppol.eu:bis:peppol4a:ver2.0::2.1
- a43e5c64-7766-4afa-93bc-b61743888005
- urn:www.cenbii.eu:profile:bii04:ver1.0
-
-
- PEPPOL Invoice (BIS 2.0)
- urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##urn:www.cenbii.eu:transaction:biitrns010:ver2.0:extended:urn:www.peppol.eu:bis:peppol4a:ver2.0::2.1
- 752be514-ada7-4674-8dbd-56d632934f4d
- urn:www.cenbii.eu:profile:bii04:ver2.0
-
-
- EHF Invoice v2
- urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##urn:www.cenbii.eu:transaction:biitrns010:ver2.0:extended:urn:www.peppol.eu:bis:peppol4a:ver2.0:extended:urn:www.difi.no:ehf:faktura:ver2.0::2.1
- EHF v2
- EHF V2
- eaf45a75-f04a-4d09-a360-56f2a98c8b02
- urn:www.cenbii.eu:profile:bii04:ver2.0
-
-
- ATGOV Invoice 5a (BIS 2.0)
- urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##urn:www.cenbii.eu:transaction:biitrns010:ver2.0:extended:urn:www.peppol.eu:bis:peppol4a:ver2.0:extended:urn:www.erechnung.gv.at:ver1.0::2.1
- 2ea82b29-73fc-4a07-b7f6-3ed775695b80
- urn:www.cenbii.eu:profile:bii04:ver2.0
-
-
- PEPPOL Invoice (BIS 2.0)
- urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##urn:www.cenbii.eu:transaction:biitrns010:ver2.0:extended:urn:www.peppol.eu:bis:peppol5a:ver2.0::2.1
- b1b72cf1-78b5-4678-a688-507e4de9b17c
- urn:www.cenbii.eu:profile:bii05:ver2.0
-
-
- ATGOV Credit Note 5a (BIS 2.0)
- urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2::CreditNote##urn:www.cenbii.eu:transaction:biitrns014:ver2.0:extended:urn:www.peppol.eu:bis:peppol5a:ver2.0:extended:urn:www.erechnung.gv.at:ver1.0::2.1
- aa1b11de-58d3-4b3c-b7ce-24bdc651bf17
- urn:www.cenbii.eu:profile:bii05:ver2.0
-
-
- UBL Italia Fattura (BIS 2.0)
- urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##urn:www.cenbii.eu:transaction:biitrns010:ver2.0:extended:urn:www.peppol.eu:bis:peppol5a:ver2.0:extended:urn:www.ubl-italia.org:spec:fatturapa:ver2.0::2.1
- UBL Italia (Fattura,Nota Di Credito)
- UBL ITALIA BIS2
- 2b324310-9be5-4b5a-91e1-2ccf38908469
- urn:www.cenbii.eu:profile:bii05:ver2.0
-
-
- EHF Credit Note v2
- urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2::CreditNote##urn:www.cenbii.eu:transaction:biitrns014:ver2.0:extended:urn:www.peppol.eu:bis:peppol5a:ver2.0:extended:urn:www.difi.no:ehf:kreditnota:ver2.0::2.1
- EHF v2
- EHF V2
- 7ebf777b-2443-49cd-b63f-14f27a2520f1
- urn:www.cenbii.eu:profile:bii05:ver2.0
-
-
- ATGOV Invoice 4a (BIS 2.0)
- urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##urn:www.cenbii.eu:transaction:biitrns010:ver2.0:extended:urn:www.peppol.eu:bis:peppol5a:ver2.0:extended:urn:www.erechnung.gv.at:ver1.0::2.1
- 76e3b177-b402-471c-a021-00cea16e0054
- urn:www.cenbii.eu:profile:bii05:ver2.0
-
-
- PEPPOL Credit Note (BIS 2.0)
- urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2::CreditNote##urn:www.cenbii.eu:transaction:biitrns014:ver2.0:extended:urn:www.peppol.eu:bis:peppol5a:ver2.0::2.1
- 6ad21574-b81e-4b99-a6ab-c1586e9da727
- urn:www.cenbii.eu:profile:bii05:ver2.0
-
-
- UBL Italia Nota Di Credito (BIS 2.0)
- urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2::CreditNote##urn:www.cenbii.eu:transaction:biitrns014:ver2.0:extended:urn:www.peppol.eu:bis:peppol5a:ver2.0:extended:urn:www.ubl-italia.org:spec:fatturapa:ver2.0::2.1
- UBL Italia (Fattura,Nota Di Credito)
- UBL ITALIA BIS2
- 49cca1f6-46ee-49b1-a06a-a235c2fe9292
- urn:www.cenbii.eu:profile:bii05:ver2.0
-
-
- PEPPOL Order Response (BIS 1.0)
- urn:oasis:names:specification:ubl:schema:xsd:OrderResponse-2::OrderResponse##urn:www.cenbii.eu:transaction:biitrns076:ver2.0:extended:urn:www.peppol.eu:bis:peppol28a:ver1.0::2.1
- 82fe8d10-79f1-465a-8d95-c1cbde43a4bd
- urn:www.cenbii.eu:profile:bii28:ver2.0
-
-
- PEPPOL Order 28a (BIS 2.0)
- urn:oasis:names:specification:ubl:schema:xsd:Order-2::Order##urn:www.cenbii.eu:transaction:biitrns001:ver2.0:extended:urn:www.peppol.eu:bis:peppol28a:ver1.0::2.1
- 60b08aa7-5021-40a9-b02d-c2105e554218
- urn:www.cenbii.eu:profile:bii28:ver2.0
-
-
- EHF Order Response v2
- urn:oasis:names:specification:ubl:schema:xsd:OrderResponse-2::OrderResponse##urn:www.cenbii.eu:transaction:biitrns076:ver2.0:extended:urn:www.peppol.eu:bis:peppol28a:ver1.0:extended:urn:www.difi.no:ehf:ordrebekreftelse:ver1.0::2.1
- b4d86c60-7eb6-4fd4-9abf-b59a83141b4d
- urn:www.cenbii.eu:profile:bii28:ver2.0
-
-
- PEPPOL Despatch Advice 30a (BIS 2.0)
- urn:oasis:names:specification:ubl:schema:xsd:DespatchAdvice-2::DespatchAdvice##urn:www.cenbii.eu:transaction:biitrns016:ver1.0:extended:urn:www.peppol.eu:bis:peppol30a:ver1.0::2.1
- 6002dbc9-4c0a-411c-977b-d6aa60eaabe9
- urn:www.cenbii.eu:profile:bii30:ver2.0
-
-
- UBL Italia Despatch Advice (BIS 2.0)
- urn:oasis:names:specification:ubl:schema:xsd:DespatchAdvice-2::DespatchAdvice##urn:www.cenbii.eu:transaction:biitrns016:ver1.0:extended:urn:www.peppol.eu:bis:peppol30a:ver1.0:extended:urn:www.ubl-italia.org:spec:ddt:ver2.1::2.1
- dc0f7dfc-446f-4f85-93be-24a0f6d61ae2
- urn:www.cenbii.eu:profile:bii30:ver2.0
-
-
- PEPPOL Order Agreement (BIS 2.0)
- urn:oasis:names:specification:ubl:schema:xsd:OrderResponse-2::OrderResponse##urn:www.cenbii.eu:transaction:biitrns110:ver1.0:extended:urn:www.peppol.eu:bis:peppol42a:ver1.0::2.1
- a0c3063c-a4cc-4d76-91ac-11a07b46dc9d
- urn:www.cenbii.eu:profile:bii42:ver1.0
-
-
- EHF Credit Note v2
- urn:oasis:names:specification:ubl:schema:xsd:CreditNote-2::CreditNote##urn:www.cenbii.eu:transaction:biitrns014:ver2.0:extended:urn:www.cenbii.eu:profile:biixx:ver2.0:extended:urn:www.difi.no:ehf:kreditnota:ver2.0::2.1
- EHF v2
- EHF V2
- 0ebb2ea6-cfc6-46e8-a322-57d4d6c9f6d1
- urn:www.cenbii.eu:profile:biixx:ver2.0
-
-
- NES UBL Invoice
- urn:oasis:names:specification:ubl:schema:xsd:Invoice-2::Invoice##NESUBL-2.0::2.0
- NESUBL
- NESUBL V2
- 710fec3d-a170-4b5d-a28f-8860c5d9851f
- urn:www.nesubl.eu:profiles:profile4:ver2.0
-
-
- PPPOL Invoice Response v1.0
- urn:oasis:names:specification:ubl:schema:xsd:ApplicationResponse-2::ApplicationResponse##urn:www.peppol.eu:transaction:biitrns111:ver1.0::2.1
- 6dd1ab70-bf54-4bc3-92a8-298191a3f893
- urn:www.peppol.eu:profile:bis63a:ver1.0
-
-
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/test/Resources/ReceiveDocuments-multiple-services.txt b/Apps/W1/EDocumentConnectors/Continia/test/Resources/ReceiveDocuments-multiple-services.txt
deleted file mode 100644
index cc0cfe29ed..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/test/Resources/ReceiveDocuments-multiple-services.txt
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
- 2024-10-05T09:11:23.223
- IncomingEnum
- 65dd7456-7a49-4382-9f76-1211fa8ad0bf
- bef5048c-985e-4674-8b95-66e1e05fc91b
- 1f4111a0-cd49-45e1-9f1e-ed14e71e3438
- 568c29e7-c2c8-49bb-b135-9199d5b791d1
- 452845225
- 568c29e7-c2c8-49bb-b135-9199d5b791d1
- 855475824
- CreatedEnum
- 467014
- 2024-10-05T09:11:23.223
-
- {fileDownloadUrl}/peppol
-
-
- {envelopeDownloadUrl}
-
-
-
- 2024-10-05T09:11:23.223
- IncomingEnum
- bb88c953-4cdd-4e77-bf8e-24c7594e4c8a
- bb3dc544-e227-4894-8d5d-89eb7e473c40
- 0c383d92-a04d-47af-a8e9-f50d2cb813f3
- 01babc72-e56c-4b46-ad7b-cdc020a65951
- DK45284522
- 01babc72-e56c-4b46-ad7b-cdc020a65951
- DK85622541
- CreatedEnum
- 467014
- 2024-10-05T09:11:23.223
-
- {fileDownloadUrl}/oioubl
-
-
- {envelopeDownloadUrl}
-
-
-
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/test/Resources/ReceiveDocuments.txt b/Apps/W1/EDocumentConnectors/Continia/test/Resources/ReceiveDocuments.txt
deleted file mode 100644
index 959fd3c5ad..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/test/Resources/ReceiveDocuments.txt
+++ /dev/null
@@ -1,22 +0,0 @@
-
-
- 2024-10-05T09:11:23.223
- IncomingEnum
- 65dd7456-7a49-4382-9f76-1211fa8ad0bf
- bef5048c-985e-4674-8b95-66e1e05fc91b
- {participationProfileId.ToLower}
- 568c29e7-c2c8-49bb-b135-9199d5b791d1
- 452845225
- 568c29e7-c2c8-49bb-b135-9199d5b791d1
- 855475824
- CreatedEnum
- 467014
- 2024-10-05T09:11:23.223
-
- {fileDownloadUrl}/peppol
-
-
- {envelopeDownloadUrl}
-
-
-
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/test/Resources/ReceiveOioublInvoiceDocument200.txt b/Apps/W1/EDocumentConnectors/Continia/test/Resources/ReceiveOioublInvoiceDocument200.txt
deleted file mode 100644
index 7e757cc674..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/test/Resources/ReceiveOioublInvoiceDocument200.txt
+++ /dev/null
@@ -1,188 +0,0 @@
-
-
- 2.0
- OIOUBL-2.02
- Procurement-OrdSimR-BilSim-1.0
- 683f9400-0cc3-4a0d-9da1-27a1edc60c42
- true
- 2024-04-08
- 380
- DKK
-
-
- VWERAFS
- 102231
- 2024-04-08
-
-
-
-
- DK85622541
-
- DK85622541
-
-
- eVendor
-
-
- StructuredLax
- Ringen 5
- Westminster
- Kugleby
- 9900
-
- DK
-
-
-
- DK85622541
-
- 63
- Moms
-
-
-
- eVendor
- DK85622541
-
-
- LB
- Lasse Bertramsen
-
-
- LB@contoso.com
-
-
-
-
-
- 5798009811639
-
- DK45284522
-
-
- demo
-
-
- StructuredLax
- Parkvej 44
-
- Atlanta
- 4300
-
- DK
-
-
-
- Helen Ray
- Helen Ray
-
-
- helen.ray@contoso.com
-
-
-
-
- 2024-04-08
-
-
- StructuredLax
- Parkvej 44
-
- Atlanta
- 4300
-
- DK
-
-
-
-
-
- 1
- 42
- 2024-04-22
- DK:BANK
-
- 9999888
-
- 9999
-
- TEST
- Konto Banken
-
-
-
-
-
- 1
- 1
- 14 dage netto
- 0.00
- 352091.25
-
- 2024-04-08
-
-
- 2024-04-22
-
-
-
- 70418.25
-
- 281673.00
- 70418.25
-
- StandardRated
- 25.00
-
- 63
- Moms
-
-
-
-
-
- 281673.00
- 70418.25
- 352091.25
- 352091.25
-
-
- 10000
- 263.00
- 281673.00
-
-
- 10000
-
- VWERAFS
-
-
-
- 70418.25
-
- 281673.00
- 70418.25
-
- StandardRated
- 25.00
-
- 63
- Moms
-
-
-
-
-
- SEOUL Gestestol, rod
- SEOUL Gestestol, rod
-
- 1988-S
-
-
-
- 1071.00
- 1
-
-
-
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/test/Resources/ReceivePeppolInvoiceDocument200.txt b/Apps/W1/EDocumentConnectors/Continia/test/Resources/ReceivePeppolInvoiceDocument200.txt
deleted file mode 100644
index e6ccae95e8..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/test/Resources/ReceivePeppolInvoiceDocument200.txt
+++ /dev/null
@@ -1,149 +0,0 @@
-
-
- urn:cen.eu:en16931:2017#compliant#urn:fdc:peppol.eu:2017:poacc:billing:3.0
- urn:fdc:peppol.eu:2017:poacc:billing:01:1.0
- {random.guid}
- 2024-04-08
- 2024-05-08
- 380
- XYZ
- swergfrew
-
- SDRDFEW
-
-
- 103215
-
-
-
- 777777772
-
- eVendor
-
-
- 7122 South Ashford Street
- Westminster
- London
- W2 8HG
-
- GB
-
-
-
- GB777777772
-
- VAT
-
-
-
- eVendor
- 777777772
-
-
- Jim Olive
- JO@contoso.com
-
-
-
-
-
- 777777771
-
- eCustomer
-
-
- Station Road, 21
- Cambridge
- CB1 2FB
-
- GB
-
-
-
- GB777777771
-
- VAT
-
-
-
- eCustomer
- 777777771
-
-
- Robert Townes
- robert.townes@contoso.com
-
-
-
-
- 2024-04-08
-
-
- Station Road, 21
- Cambridge
- CB1 2FB
-
- GB
-
-
-
-
-
- 31
-
- GB12CPBK08929965044991
-
- BG99999
-
-
-
-
- 1 Month/2% 8 days
-
-
- 1183.68
-
- 5918.4
- 1183.68
-
- S
- 20
-
- VAT
-
-
-
-
-
- 5918.4
- 5918.4
- 7102.08
- 0
- 0.00
- 0
- 7102.08
-
-
- 10000
- Item
- 48
- 5918.4
-
- LONDON Swivel Chair, blue
-
- Item1
-
-
- S
- 20
-
- VAT
-
-
-
-
- 123.30
- 1
-
-
-
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/test/Resources/SubmitDocument200.txt b/Apps/W1/EDocumentConnectors/Continia/test/Resources/SubmitDocument200.txt
deleted file mode 100644
index 3abc36c97b..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/test/Resources/SubmitDocument200.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
- 3fa85f64-5717-4562-b3fc-2c963f66afa6
-
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/test/Resources/SubmitDocument201.txt b/Apps/W1/EDocumentConnectors/Continia/test/Resources/SubmitDocument201.txt
deleted file mode 100644
index 3abc36c97b..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/test/Resources/SubmitDocument201.txt
+++ /dev/null
@@ -1,4 +0,0 @@
-
-
- 3fa85f64-5717-4562-b3fc-2c963f66afa6
-
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/test/Resources/TechnicalResponse200-Error.txt b/Apps/W1/EDocumentConnectors/Continia/test/Resources/TechnicalResponse200-Error.txt
deleted file mode 100644
index 352a80187d..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/test/Resources/TechnicalResponse200-Error.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-
- ErrorEnum
- ReceiverNotRegistered
- The recipient of the document is not registered to receive this type of document.
-
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/test/Resources/TechnicalResponse200-Pending.txt b/Apps/W1/EDocumentConnectors/Continia/test/Resources/TechnicalResponse200-Pending.txt
deleted file mode 100644
index 0ab7acbbeb..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/test/Resources/TechnicalResponse200-Pending.txt
+++ /dev/null
@@ -1,3 +0,0 @@
-
-
-
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/test/Resources/TechnicalResponse200-Success.txt b/Apps/W1/EDocumentConnectors/Continia/test/Resources/TechnicalResponse200-Success.txt
deleted file mode 100644
index 54d276cbda..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/test/Resources/TechnicalResponse200-Success.txt
+++ /dev/null
@@ -1,5 +0,0 @@
-
-
- 1842e99d-5f91-4479-aa18-8c73c52fbef0
- SuccessEnum
-
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/test/Resources/UpdateSubscription200.txt b/Apps/W1/EDocumentConnectors/Continia/test/Resources/UpdateSubscription200.txt
deleted file mode 100644
index c21aa73e8f..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/test/Resources/UpdateSubscription200.txt
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/test/Resources/UpdateSubscriptionError200.txt b/Apps/W1/EDocumentConnectors/Continia/test/Resources/UpdateSubscriptionError200.txt
deleted file mode 100644
index 7c8d89d87b..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/test/Resources/UpdateSubscriptionError200.txt
+++ /dev/null
@@ -1 +0,0 @@
-
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/test/app.json b/Apps/W1/EDocumentConnectors/Continia/test/app.json
deleted file mode 100644
index 630403a71d..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/test/app.json
+++ /dev/null
@@ -1,73 +0,0 @@
-{
- "id": "769158cc-9498-42cf-b3a3-e5be4333f8b7",
- "name": "E-Document Connector - Continia Tests",
- "publisher": "Microsoft",
- "brief": "E-Document Connector - Continia Tests",
- "description": "E-Document Connector - Continia Tests",
- "version": "28.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",
- "contextSensitiveHelpUrl": "https://go.microsoft.com/fwlink/?linkid=2206603",
- "dependencies": [
- {
- "id": "e1d97edc-c239-46b4-8d84-6368bdf67c8b",
- "name": "E-Document Core",
- "publisher": "Microsoft",
- "version": "28.0.0.0"
- },
- {
- "id": "31ef535a-1182-4354-98e8-e0e66a587055",
- "name": "E-Document Connector - Continia",
- "publisher": "Microsoft",
- "version": "28.0.0.0"
- },
- {
- "id": "e1d97edc-c239-46b4-8d84-6368bdf67c8c",
- "name": "E-Document Core Tests",
- "publisher": "Microsoft",
- "version": "28.0.0.0"
- },
- {
- "id": "5d86850b-0d76-4eca-bd7b-951ad998e997",
- "name": "Tests-TestLibraries",
- "publisher": "Microsoft",
- "version": "28.0.0.0"
- },
- {
- "id": "9856ae4f-d1a7-46ef-89bb-6ef056398228",
- "name": "System Application Test Library",
- "publisher": "Microsoft",
- "version": "28.0.0.0"
- },
- {
- "id": "40860557-a18d-42ad-aecb-22b7dd80dc80",
- "name": "Permissions Mock",
- "publisher": "Microsoft",
- "version": "28.0.0.0"
- }
- ],
- "screenshots": [],
- "platform": "28.0.0.0",
- "idRanges": [
- {
- "from": 148200,
- "to": 148205
- }
- ],
- "resourceExposurePolicy": {
- "allowDebugging": true,
- "allowDownloadingSource": true,
- "includeSourceInSymbolFile": true
- },
- "application": "28.0.0.0",
- "resourceFolders": [
- "Resources"
- ],
- "target": "OnPrem",
- "logo": "ExtensionLogo.png",
- "features": [
- "TranslationFile"
- ]
-}
diff --git a/Apps/W1/EDocumentConnectors/Continia/test/src/ContiniaApiCommUnitTests.Codeunit.al b/Apps/W1/EDocumentConnectors/Continia/test/src/ContiniaApiCommUnitTests.Codeunit.al
deleted file mode 100644
index 97c32ff873..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/test/src/ContiniaApiCommUnitTests.Codeunit.al
+++ /dev/null
@@ -1,1272 +0,0 @@
-namespace Microsoft.EServices.EDocumentConnector.Continia;
-
-codeunit 148205 "Continia Api Comm. Unit Tests"
-{
- Subtype = Test;
- RequiredTestIsolation = Disabled;
- TestHttpRequestPolicy = AllowOutboundFromHandler;
- Access = Internal;
-
- [Test]
- [HandlerFunctions('HttpClientHandler')]
- procedure GetParticipation200()
- var
- Participation: Record "Continia Participation";
- ApiRequests: Codeunit "Continia Api Requests";
- begin
- Initialize();
- ContiniaMockHttpHandler.AddResponse(200, GetMockResponseContent('Participation200-InProcess.txt'));
-
- // [Given] a Connected Participation
- ConnectorLibrary.PrepareParticipation(Participation);
-
- // [When] Get Participation
- ApiRequests.GetParticipation(Participation);
-
- // [Then] Make sure Participation values returned correct
- Assert.AreEqual(ConnectorLibrary.ParticipationId(true), Participation.Id, IncorrectValueErr);
- Assert.AreEqual(Enum::"Continia Registration Status"::InProcess, Participation."Registration Status", IncorrectValueErr);
- end;
-
- [Test]
- [HandlerFunctions('HttpClientHandler')]
- procedure GetParticipation400()
- var
- Participation: Record "Continia Participation";
- ApiRequests: Codeunit "Continia Api Requests";
- begin
- Initialize();
- ContiniaMockHttpHandler.AddResponse(400, GetMockResponseContent('Common400.txt'));
-
- // [Given] a Connected Participation
- ConnectorLibrary.PrepareParticipation(Participation);
-
- // [When] Get Participation
- asserterror ApiRequests.GetParticipation(Participation);
-
- // [Then] make sure error is correct
- Assert.ExpectedError(Response400ErrorMessageLbl);
- end;
-
- [Test]
- [HandlerFunctions('HttpClientHandler')]
- procedure GetParticipation401()
- var
- Participation: Record "Continia Participation";
- ApiRequests: Codeunit "Continia Api Requests";
- begin
- Initialize();
- ContiniaMockHttpHandler.AddResponse(401, GetMockResponseContent('Common401.txt'));
-
- // [Given] a Connected Participation
- ConnectorLibrary.PrepareParticipation(Participation);
-
- // [When] Get Participation
- asserterror ApiRequests.GetParticipation(Participation);
-
- // [Then] make sure error is correct
- Assert.ExpectedError(Response401ErrorMessageLbl);
- end;
-
- [Test]
- [HandlerFunctions('HttpClientHandler')]
- procedure GetParticipation404()
- var
- Participation: Record "Continia Participation";
- ApiRequests: Codeunit "Continia Api Requests";
- begin
- Initialize();
- ContiniaMockHttpHandler.AddResponse(404, GetMockResponseContent('Common404.txt'));
-
- // [Given] a Connected Participation
- ConnectorLibrary.PrepareParticipation(Participation);
-
- // [When] Get Participation
- asserterror ApiRequests.GetParticipation(Participation);
-
- // [Then] make sure error is correct
- Assert.ExpectedError(Response404ErrorMessageLbl);
- end;
-
- [Test]
- [HandlerFunctions('HttpClientHandler')]
- procedure GetParticipation500()
- var
- Participation: Record "Continia Participation";
- ApiRequests: Codeunit "Continia Api Requests";
- begin
- Initialize();
- ContiniaMockHttpHandler.AddResponse(500, GetMockResponseContent('Common500.txt'));
-
- // [Given] a Connected Participation
- ConnectorLibrary.PrepareParticipation(Participation);
-
- // [When] Get Participation
- asserterror ApiRequests.GetParticipation(Participation);
-
- // [Then] make sure error is correct
- Assert.ExpectedError(Response500ErrorMessageLbl);
- end;
-
- [Test]
- [HandlerFunctions('HttpClientHandler')]
- procedure PostParticipation200()
- var
- TempParticipation: Record "Continia Participation" temporary;
- Participation: Record "Continia Participation";
- ApiRequests: Codeunit "Continia Api Requests";
- begin
- Initialize();
- ContiniaMockHttpHandler.AddResponse(200, GetMockResponseContent('Participation200-Draft.txt'));
-
- // [Given] Filled in Participation info
- ConnectorLibrary.PrepareParticipation(TempParticipation);
-
- // [When] Post Participation
- ApiRequests.PostParticipation(TempParticipation);
-
- // [Then] Make sure Participation values returned correct
- ConnectorLibrary.GetParticipation(Participation);
- Assert.AreEqual(ConnectorLibrary.ParticipationId(true), Participation.Id, IncorrectValueErr);
- Assert.AreEqual(Enum::"Continia Registration Status"::Draft, Participation."Registration Status", IncorrectValueErr);
- end;
-
- [Test]
- [HandlerFunctions('HttpClientHandler')]
- procedure PostParticipation201()
- var
- TempParticipation: Record "Continia Participation" temporary;
- Participation: Record "Continia Participation";
- ApiRequests: Codeunit "Continia Api Requests";
- begin
- Initialize();
- ContiniaMockHttpHandler.AddResponse(201, GetMockResponseContent('Participation201-Draft.txt'));
-
- // [Given] Filled in Participation info
- ConnectorLibrary.PrepareParticipation(TempParticipation);
-
- // [When] Post Participation
- ApiRequests.PostParticipation(TempParticipation);
-
- // [Then] Make sure Participation values returned correct
- ConnectorLibrary.GetParticipation(Participation);
- Assert.AreEqual(ConnectorLibrary.ParticipationId(true), Participation.Id, IncorrectValueErr);
- Assert.AreEqual(Enum::"Continia Registration Status"::Draft, Participation."Registration Status", IncorrectValueErr);
- end;
-
- [Test]
- [HandlerFunctions('HttpClientHandler')]
- procedure PostParticipation400()
- var
- TempParticipation: Record "Continia Participation" temporary;
- ApiRequests: Codeunit "Continia Api Requests";
- begin
- Initialize();
- ContiniaMockHttpHandler.AddResponse(400, GetMockResponseContent('Common400.txt'));
-
- // [Given] Filled in Participation info
- ConnectorLibrary.PrepareParticipation(TempParticipation);
-
- // [When] Post Participation
- asserterror ApiRequests.PostParticipation(TempParticipation);
-
- // [Then] make sure error is correct
- Assert.ExpectedError(Response400ErrorMessageLbl);
- end;
-
- [Test]
- [HandlerFunctions('HttpClientHandler')]
- procedure PostParticipation401()
- var
- TempParticipation: Record "Continia Participation" temporary;
- ApiRequests: Codeunit "Continia Api Requests";
- begin
- Initialize();
- ContiniaMockHttpHandler.AddResponse(401, GetMockResponseContent('Common401.txt'));
-
- // [Given] Filled in Participation info
- ConnectorLibrary.PrepareParticipation(TempParticipation);
-
- // [When] Post Participation
- asserterror ApiRequests.PostParticipation(TempParticipation);
-
- // [Then] make sure error is correct
- Assert.ExpectedError(Response401ErrorMessageLbl);
- end;
-
- [Test]
- [HandlerFunctions('HttpClientHandler')]
- procedure PostParticipation404()
- var
- TempParticipation: Record "Continia Participation" temporary;
- ApiRequests: Codeunit "Continia Api Requests";
- begin
- Initialize();
- ContiniaMockHttpHandler.AddResponse(404, GetMockResponseContent('Common404.txt'));
-
- // [Given] Filled in Participation info
- ConnectorLibrary.PrepareParticipation(TempParticipation);
-
- // [When] Post Participation
- asserterror ApiRequests.PostParticipation(TempParticipation);
-
- // [Then] make sure error is correct
- Assert.ExpectedError(Response404ErrorMessageLbl);
- end;
-
- [Test]
- [HandlerFunctions('HttpClientHandler')]
- procedure PostParticipation422()
- var
- TempParticipation: Record "Continia Participation" temporary;
- ApiRequests: Codeunit "Continia Api Requests";
- begin
- Initialize();
- ContiniaMockHttpHandler.AddResponse(422, GetMockResponseContent('Common422.txt'));
-
- // [Given] Filled in Participation info
- ConnectorLibrary.PrepareParticipation(TempParticipation);
-
- // [When] Post Participation
- asserterror ApiRequests.PostParticipation(TempParticipation);
-
- // [Then] make sure error is correct
- Assert.ExpectedError(Response422ErrorMessageLbl);
- end;
-
- [Test]
- [HandlerFunctions('HttpClientHandler')]
- procedure PostParticipation500()
- var
- TempParticipation: Record "Continia Participation" temporary;
- ApiRequests: Codeunit "Continia Api Requests";
- begin
- Initialize();
- ContiniaMockHttpHandler.AddResponse(500, GetMockResponseContent('Common500.txt'));
-
- // [Given] Filled in Participation info
- ConnectorLibrary.PrepareParticipation(TempParticipation);
-
- // [When] Post Participation
- asserterror ApiRequests.PostParticipation(TempParticipation);
-
- // [Then] make sure error is correct
- Assert.ExpectedError(Response500ErrorMessageLbl);
- end;
-
- [Test]
- [HandlerFunctions('HttpClientHandler')]
- procedure PatchParticipation200()
- var
- TempParticipation: Record "Continia Participation" temporary;
- Participation: Record "Continia Participation";
- ApiRequests: Codeunit "Continia Api Requests";
- begin
- Initialize();
- ContiniaMockHttpHandler.AddResponse(200, GetMockResponseContent('Participation200-InProcess.txt'));
-
- // [Given] a Connected Participation
- ConnectorLibrary.PrepareParticipation(Participation);
-
- // [When] Patch Participation
- TempParticipation := Participation;
- ApiRequests.PatchParticipation(TempParticipation);
-
- // [Then] Make sure Participation values returned correct
- ConnectorLibrary.GetParticipation(Participation);
- Assert.AreEqual(ConnectorLibrary.ParticipationId(true), Participation.Id, IncorrectValueErr);
- Assert.AreEqual(Enum::"Continia Registration Status"::InProcess, Participation."Registration Status", IncorrectValueErr);
- end;
-
- [Test]
- [HandlerFunctions('HttpClientHandler')]
- procedure PatchParticipation400()
- var
- TempParticipation: Record "Continia Participation" temporary;
- Participation: Record "Continia Participation";
- ApiRequests: Codeunit "Continia Api Requests";
- begin
- Initialize();
- ContiniaMockHttpHandler.AddResponse(400, GetMockResponseContent('Common400.txt'));
-
- // [Given] a Connected Participation
- ConnectorLibrary.PrepareParticipation(Participation);
-
- // [When] Patch Participation
- TempParticipation := Participation;
- asserterror ApiRequests.PatchParticipation(TempParticipation);
-
- // [Then] make sure error is correct
- Assert.ExpectedError(Response400ErrorMessageLbl);
- end;
-
- [Test]
- [HandlerFunctions('HttpClientHandler')]
- procedure PatchParticipation401()
- var
- TempParticipation: Record "Continia Participation" temporary;
- Participation: Record "Continia Participation";
- ApiRequests: Codeunit "Continia Api Requests";
- begin
- Initialize();
- ContiniaMockHttpHandler.AddResponse(401, GetMockResponseContent('Common401.txt'));
-
- // [Given] a Connected Participation
- ConnectorLibrary.PrepareParticipation(Participation);
-
- // [When] Patch Participation
- TempParticipation := Participation;
- asserterror ApiRequests.PatchParticipation(TempParticipation);
-
- // [Then] make sure error is correct
- Assert.ExpectedError(Response401ErrorMessageLbl);
- end;
-
- [Test]
- [HandlerFunctions('HttpClientHandler')]
- procedure PatchParticipation404()
- var
- TempParticipation: Record "Continia Participation" temporary;
- Participation: Record "Continia Participation";
- ApiRequests: Codeunit "Continia Api Requests";
- begin
- Initialize();
- ContiniaMockHttpHandler.AddResponse(404, GetMockResponseContent('Common404.txt'));
-
- // [Given] a Connected Participation
- ConnectorLibrary.PrepareParticipation(Participation);
-
- // [When] Patch Participation
- TempParticipation := Participation;
- asserterror ApiRequests.PatchParticipation(TempParticipation);
-
- // [Then] make sure error is correct
- Assert.ExpectedError(Response404ErrorMessageLbl);
- end;
-
- [Test]
- [HandlerFunctions('HttpClientHandler')]
- procedure PatchParticipation409()
- var
- TempParticipation: Record "Continia Participation" temporary;
- Participation: Record "Continia Participation";
- ApiRequests: Codeunit "Continia Api Requests";
- begin
- Initialize();
- ContiniaMockHttpHandler.AddResponse(409, GetMockResponseContent('Common409.txt'));
-
- // [Given] a Connected Participation
- ConnectorLibrary.PrepareParticipation(Participation);
-
- // [When] Patch Participation
- TempParticipation := Participation;
- asserterror ApiRequests.PatchParticipation(TempParticipation);
-
- // [Then] make sure error is correct
- Assert.ExpectedError(Response409ErrorMessageLbl);
- end;
-
- [Test]
- [HandlerFunctions('HttpClientHandler')]
- procedure PatchParticipation422()
- var
- TempParticipation: Record "Continia Participation" temporary;
- Participation: Record "Continia Participation";
- ApiRequests: Codeunit "Continia Api Requests";
- begin
- Initialize();
- ContiniaMockHttpHandler.AddResponse(422, GetMockResponseContent('Common422.txt'));
-
- // [Given] a Connected Participation
- ConnectorLibrary.PrepareParticipation(Participation);
-
- // [When] Patch Participation
- TempParticipation := Participation;
- asserterror ApiRequests.PatchParticipation(TempParticipation);
-
- // [Then] make sure error is correct
- Assert.ExpectedError(Response422ErrorMessageLbl);
- end;
-
- [Test]
- [HandlerFunctions('HttpClientHandler')]
- procedure PatchParticipation500()
- var
- TempParticipation: Record "Continia Participation" temporary;
- Participation: Record "Continia Participation";
- ApiRequests: Codeunit "Continia Api Requests";
- begin
- Initialize();
- ContiniaMockHttpHandler.AddResponse(500, GetMockResponseContent('Common500.txt'));
-
- // [Given] a Connected Participation
- ConnectorLibrary.PrepareParticipation(Participation);
-
- // [When] Patch Participation
- TempParticipation := Participation;
- asserterror ApiRequests.PatchParticipation(TempParticipation);
-
- // [Then] make sure error is correct
- Assert.ExpectedError(Response500ErrorMessageLbl);
- end;
-
- [Test]
- [HandlerFunctions('HttpClientHandler')]
- procedure DeleteParticipation200()
- var
- Participation: Record "Continia Participation";
- ApiRequests: Codeunit "Continia Api Requests";
- begin
- Initialize();
- ContiniaMockHttpHandler.AddResponse(200, '');
-
- // [Given] a Connected Participation
- ConnectorLibrary.PrepareParticipation(Participation);
-
- // [When] Delete Participation
- ApiRequests.DeleteParticipation(Participation);
-
- // [Then] Make sure Participation does not exist
- Assert.AreEqual(true, Participation.IsEmpty, 'Participation should not exist');
- end;
-
- [Test]
- [HandlerFunctions('HttpClientHandler')]
- procedure DeleteParticipation202()
- var
- Participation: Record "Continia Participation";
- ApiRequests: Codeunit "Continia Api Requests";
- begin
- Initialize();
- ContiniaMockHttpHandler.AddResponse(202, '');
-
- // [Given] a Connected Participation
- ConnectorLibrary.PrepareParticipation(Participation);
-
- // [When] Delete Participation
- ApiRequests.DeleteParticipation(Participation);
-
- // [Then] Make sure Participation does not exist
- ConnectorLibrary.GetParticipation(Participation);
- Assert.AreEqual(ConnectorLibrary.ParticipationId(true), Participation.Id, IncorrectValueErr);
- Assert.AreEqual(Enum::"Continia Registration Status"::Disabled, Participation."Registration Status", IncorrectValueErr);
- end;
-
- [Test]
- [HandlerFunctions('HttpClientHandler')]
- procedure DeleteParticipation400()
- var
- Participation: Record "Continia Participation";
- ApiRequests: Codeunit "Continia Api Requests";
- begin
- Initialize();
- ContiniaMockHttpHandler.AddResponse(400, GetMockResponseContent('Common400.txt'));
-
- // [Given] a Connected Participation
- ConnectorLibrary.PrepareParticipation(Participation);
-
- // [When] Delete Participation
- asserterror ApiRequests.DeleteParticipation(Participation);
-
- // [Then] make sure error is correct
- Assert.ExpectedError(Response400ErrorMessageLbl);
- end;
-
- [Test]
- [HandlerFunctions('HttpClientHandler')]
- procedure DeleteParticipation401()
- var
- Participation: Record "Continia Participation";
- ApiRequests: Codeunit "Continia Api Requests";
- begin
- Initialize();
- ContiniaMockHttpHandler.AddResponse(401, GetMockResponseContent('Common401.txt'));
-
- // [Given] a Connected Participation
- ConnectorLibrary.PrepareParticipation(Participation);
-
- // [When] Delete Participation
- asserterror ApiRequests.DeleteParticipation(Participation);
-
- // [Then] make sure error is correct
- Assert.ExpectedError(Response401ErrorMessageLbl);
- end;
-
- [Test]
- [HandlerFunctions('HttpClientHandler')]
- procedure DeleteParticipation404()
- var
- Participation: Record "Continia Participation";
- ApiRequests: Codeunit "Continia Api Requests";
- begin
- Initialize();
- ContiniaMockHttpHandler.AddResponse(404, GetMockResponseContent('Common404.txt'));
-
- // [Given] a Connected Participation
- ConnectorLibrary.PrepareParticipation(Participation);
-
- // [When] Delete Participation
- asserterror ApiRequests.DeleteParticipation(Participation);
-
- // [Then] make sure error is correct
- Assert.ExpectedError(Response404ErrorMessageLbl);
- end;
-
- [Test]
- [HandlerFunctions('HttpClientHandler')]
- procedure DeleteParticipation422()
- var
- Participation: Record "Continia Participation";
- ApiRequests: Codeunit "Continia Api Requests";
- begin
- Initialize();
- ContiniaMockHttpHandler.AddResponse(422, GetMockResponseContent('Common422.txt'));
-
- // [Given] a Connected Participation
- ConnectorLibrary.PrepareParticipation(Participation);
-
- // [When] Delete Participation
- asserterror ApiRequests.DeleteParticipation(Participation);
-
- // [Then] make sure error is correct
- Assert.ExpectedError(Response422ErrorMessageLbl);
- end;
-
- [Test]
- [HandlerFunctions('HttpClientHandler')]
- procedure DeleteParticipation500()
- var
- Participation: Record "Continia Participation";
- ApiRequests: Codeunit "Continia Api Requests";
- begin
- Initialize();
- ContiniaMockHttpHandler.AddResponse(500, GetMockResponseContent('Common500.txt'));
-
- // [Given] a Connected Participation
- ConnectorLibrary.PrepareParticipation(Participation);
-
- // [When] Delete Participation
- asserterror ApiRequests.DeleteParticipation(Participation);
-
- // [Then] make sure error is correct
- Assert.ExpectedError(Response500ErrorMessageLbl);
- end;
-
- [Test]
- [HandlerFunctions('HttpClientHandler')]
- procedure PostParticipationProfile200()
- var
- Participation: Record "Continia Participation";
- TempActivatedNetProf: Record "Continia Activated Net. Prof." temporary;
- ActivatedNetProf: Record "Continia Activated Net. Prof.";
- ApiRequests: Codeunit "Continia Api Requests";
- begin
- Initialize();
- ContiniaMockHttpHandler.AddResponse(200, GetMockResponseContent('ParticipationProfile200-randomId.txt'));
-
- // [Given] a Connected Participation without Activated Network Profile
- ConnectorLibrary.PrepareParticipation(Participation, TempActivatedNetProf);
-
- // [When] Post Participation Profile
- ApiRequests.PostParticipationProfile(TempActivatedNetProf, Participation.Id);
-
- // [Then] Make sure Activated Network Profile exists
- Assert.AreEqual(true, ConnectorLibrary.GetActivatedNetworkProfile(ActivatedNetProf), 'Activated Network Profile must exist');
- end;
-
- [Test]
- [HandlerFunctions('HttpClientHandler')]
- procedure PostParticipationProfile400()
- var
- Participation: Record "Continia Participation";
- TempActivatedNetProf: Record "Continia Activated Net. Prof." temporary;
- ApiRequests: Codeunit "Continia Api Requests";
- begin
- Initialize();
- ContiniaMockHttpHandler.AddResponse(400, GetMockResponseContent('Common400.txt'));
-
- // [Given] a Connected Participation without Activated Network Profile
- ConnectorLibrary.PrepareParticipation(Participation, TempActivatedNetProf);
-
- // [When] Post Participation Profile
- asserterror ApiRequests.PostParticipationProfile(TempActivatedNetProf, Participation.Id);
-
- // [Then] make sure error is correct
- Assert.ExpectedError(Response400ErrorMessageLbl);
- end;
-
- [Test]
- [HandlerFunctions('HttpClientHandler')]
- procedure PostParticipationProfile401()
- var
- Participation: Record "Continia Participation";
- TempActivatedNetProf: Record "Continia Activated Net. Prof." temporary;
- ApiRequests: Codeunit "Continia Api Requests";
- begin
- Initialize();
- ContiniaMockHttpHandler.AddResponse(401, GetMockResponseContent('Common401.txt'));
-
- // [Given] a Connected Participation without Activated Network Profile
- ConnectorLibrary.PrepareParticipation(Participation, TempActivatedNetProf);
-
- // [When] Post Participation Profile
- asserterror ApiRequests.PostParticipationProfile(TempActivatedNetProf, Participation.Id);
-
- // [Then] make sure error is correct
- Assert.ExpectedError(Response401ErrorMessageLbl);
- end;
-
- [Test]
- [HandlerFunctions('HttpClientHandler')]
- procedure PostParticipationProfile404()
- var
- Participation: Record "Continia Participation";
- TempActivatedNetProf: Record "Continia Activated Net. Prof." temporary;
- ApiRequests: Codeunit "Continia Api Requests";
- begin
- Initialize();
- ContiniaMockHttpHandler.AddResponse(404, GetMockResponseContent('Common404.txt'));
-
- // [Given] a Connected Participation without Activated Network Profile
- ConnectorLibrary.PrepareParticipation(Participation, TempActivatedNetProf);
-
- // [When] Post Participation Profile
- asserterror ApiRequests.PostParticipationProfile(TempActivatedNetProf, Participation.Id);
-
- // [Then] make sure error is correct
- Assert.ExpectedError(Response404ErrorMessageLbl);
- end;
-
- [Test]
- [HandlerFunctions('HttpClientHandler')]
- procedure PostParticipationProfile422()
- var
- Participation: Record "Continia Participation";
- TempActivatedNetProf: Record "Continia Activated Net. Prof." temporary;
- ApiRequests: Codeunit "Continia Api Requests";
- begin
- Initialize();
- ContiniaMockHttpHandler.AddResponse(422, GetMockResponseContent('Common422.txt'));
-
- // [Given] a Connected Participation without Activated Network Profile
- ConnectorLibrary.PrepareParticipation(Participation, TempActivatedNetProf);
-
- // [When] Post Participation Profile
- asserterror ApiRequests.PostParticipationProfile(TempActivatedNetProf, Participation.Id);
-
- // [Then] make sure error is correct
- Assert.ExpectedError(Response422ErrorMessageLbl);
- end;
-
- [Test]
- [HandlerFunctions('HttpClientHandler')]
- procedure PostParticipationProfile500()
- var
- Participation: Record "Continia Participation";
- TempActivatedNetProf: Record "Continia Activated Net. Prof." temporary;
- ApiRequests: Codeunit "Continia Api Requests";
- begin
- Initialize();
- ContiniaMockHttpHandler.AddResponse(500, GetMockResponseContent('Common500.txt'));
-
- // [Given] a Connected Participation without Activated Network Profile
- ConnectorLibrary.PrepareParticipation(Participation, TempActivatedNetProf);
-
- // [When] Post Participation Profile
- asserterror ApiRequests.PostParticipationProfile(TempActivatedNetProf, Participation.Id);
-
- // [Then] make sure error is correct
- Assert.ExpectedError(Response500ErrorMessageLbl);
- end;
-
- [Test]
- [HandlerFunctions('HttpClientHandler')]
- procedure PatchParticipationProfile200()
- var
- Participation: Record "Continia Participation";
- TempActivatedNetProf: Record "Continia Activated Net. Prof." temporary;
- ActivatedNetProf: Record "Continia Activated Net. Prof.";
- ApiRequests: Codeunit "Continia Api Requests";
- begin
- Initialize();
- // [Given] a Connected Participation with Outbound Activated Network Profile
- ConnectorLibrary.PrepareParticipation(Participation, ActivatedNetProf);
- ActivatedNetProf."Profile Direction" := ActivatedNetProf."Profile Direction"::Outbound;
- ActivatedNetProf.Modify();
-
- ContiniaMockHttpHandler.AddResponse(200, GetMockResponseContent('ParticipationProfile200.txt'));
-
- // [When] Patch Participation Profile
- TempActivatedNetProf := ActivatedNetProf;
- ApiRequests.PatchParticipationProfile(TempActivatedNetProf, Participation.Id);
-
- // [Then] Make sure Activated Network Profile values returned correct
- ConnectorLibrary.GetActivatedNetworkProfile(ActivatedNetProf);
- Assert.AreEqual(ConnectorLibrary.ActiveNetworkProfileId(true), ActivatedNetProf.Id, IncorrectValueErr);
- Assert.AreEqual(Enum::"Continia Profile Direction"::Both, ActivatedNetProf."Profile Direction", IncorrectValueErr);
- end;
-
- [Test]
- [HandlerFunctions('HttpClientHandler')]
- procedure PatchParticipationProfile400()
- var
- Participation: Record "Continia Participation";
- TempActivatedNetProf: Record "Continia Activated Net. Prof." temporary;
- ActivatedNetProf: Record "Continia Activated Net. Prof.";
- ApiRequests: Codeunit "Continia Api Requests";
- begin
- Initialize();
- ContiniaMockHttpHandler.AddResponse(400, GetMockResponseContent('Common400.txt'));
-
- // [Given] a Connected Participation with Outbound Activated Network Profile
- ConnectorLibrary.PrepareParticipation(Participation, ActivatedNetProf);
- ActivatedNetProf."Profile Direction" := ActivatedNetProf."Profile Direction"::Outbound;
- ActivatedNetProf.Modify();
-
- // [When] Patch Participation Profile
- TempActivatedNetProf := ActivatedNetProf;
- asserterror ApiRequests.PatchParticipationProfile(TempActivatedNetProf, Participation.Id);
-
- // [Then] make sure error is correct
- Assert.ExpectedError(Response400ErrorMessageLbl);
- end;
-
- [Test]
- [HandlerFunctions('HttpClientHandler')]
- procedure PatchParticipationProfile401()
- var
- Participation: Record "Continia Participation";
- TempActivatedNetProf: Record "Continia Activated Net. Prof." temporary;
- ActivatedNetProf: Record "Continia Activated Net. Prof.";
- ApiRequests: Codeunit "Continia Api Requests";
- begin
- Initialize();
- ContiniaMockHttpHandler.AddResponse(401, GetMockResponseContent('Common401.txt'));
-
- // [Given] a Connected Participation with Outbound Activated Network Profile
- ConnectorLibrary.PrepareParticipation(Participation, ActivatedNetProf);
- ActivatedNetProf."Profile Direction" := ActivatedNetProf."Profile Direction"::Outbound;
- ActivatedNetProf.Modify();
-
- // [When] Patch Participation Profile
- TempActivatedNetProf := ActivatedNetProf;
- asserterror ApiRequests.PatchParticipationProfile(TempActivatedNetProf, Participation.Id);
-
- // [Then] make sure error is correct
- Assert.ExpectedError(Response401ErrorMessageLbl);
- end;
-
- [Test]
- [HandlerFunctions('HttpClientHandler')]
- procedure PatchParticipationProfile404()
- var
- Participation: Record "Continia Participation";
- TempActivatedNetProf: Record "Continia Activated Net. Prof." temporary;
- ActivatedNetProf: Record "Continia Activated Net. Prof.";
- ApiRequests: Codeunit "Continia Api Requests";
- begin
- Initialize();
- ContiniaMockHttpHandler.AddResponse(404, GetMockResponseContent('Common404.txt'));
-
- // [Given] a Connected Participation with Outbound Activated Network Profile
- ConnectorLibrary.PrepareParticipation(Participation, ActivatedNetProf);
- ActivatedNetProf."Profile Direction" := ActivatedNetProf."Profile Direction"::Outbound;
- ActivatedNetProf.Modify();
-
- // [When] Patch Participation Profile
- TempActivatedNetProf := ActivatedNetProf;
- asserterror ApiRequests.PatchParticipationProfile(TempActivatedNetProf, Participation.Id);
-
- // [Then] make sure error is correct
- Assert.ExpectedError(Response404ErrorMessageLbl);
- end;
-
- [Test]
- [HandlerFunctions('HttpClientHandler')]
- procedure PatchParticipationProfile422()
- var
- Participation: Record "Continia Participation";
- TempActivatedNetProf: Record "Continia Activated Net. Prof." temporary;
- ActivatedNetProf: Record "Continia Activated Net. Prof.";
- ApiRequests: Codeunit "Continia Api Requests";
- begin
- Initialize();
- ContiniaMockHttpHandler.AddResponse(422, GetMockResponseContent('Common422.txt'));
-
- // [Given] a Connected Participation with Outbound Activated Network Profile
- ConnectorLibrary.PrepareParticipation(Participation, ActivatedNetProf);
- ActivatedNetProf."Profile Direction" := ActivatedNetProf."Profile Direction"::Outbound;
- ActivatedNetProf.Modify();
-
- // [When] Patch Participation Profile
- TempActivatedNetProf := ActivatedNetProf;
- asserterror ApiRequests.PatchParticipationProfile(TempActivatedNetProf, Participation.Id);
-
- // [Then] make sure error is correct
- Assert.ExpectedError(Response422ErrorMessageLbl);
- end;
-
- [Test]
- [HandlerFunctions('HttpClientHandler')]
- procedure PatchParticipationProfile500()
- var
- Participation: Record "Continia Participation";
- TempActivatedNetProf: Record "Continia Activated Net. Prof." temporary;
- ActivatedNetProf: Record "Continia Activated Net. Prof.";
- ApiRequests: Codeunit "Continia Api Requests";
- begin
- Initialize();
- ContiniaMockHttpHandler.AddResponse(500, GetMockResponseContent('Common500.txt'));
-
- // [Given] a Connected Participation with Outbound Activated Network Profile
- ConnectorLibrary.PrepareParticipation(Participation, ActivatedNetProf);
- ActivatedNetProf."Profile Direction" := ActivatedNetProf."Profile Direction"::Outbound;
- ActivatedNetProf.Modify();
-
- // [When] Patch Participation Profile
- TempActivatedNetProf := ActivatedNetProf;
- asserterror ApiRequests.PatchParticipationProfile(TempActivatedNetProf, Participation.Id);
-
- // [Then] make sure error is correct
- Assert.ExpectedError(Response500ErrorMessageLbl);
- end;
-
- [Test]
- [HandlerFunctions('HttpClientHandler')]
- procedure DeleteParticipationProfile200()
- var
- Participation: Record "Continia Participation";
- ActivatedNetProf: Record "Continia Activated Net. Prof.";
- ApiRequests: Codeunit "Continia Api Requests";
- begin
- Initialize();
- ContiniaMockHttpHandler.AddResponse(200, '');
-
- // [Given] a Connected Participation with Activated Network Profile
- ConnectorLibrary.PrepareParticipation(Participation, ActivatedNetProf);
-
- // [When] Delete Participation Profile
- ApiRequests.DeleteParticipationProfile(ActivatedNetProf, Participation.Id);
-
- // [Then] Make sure Activated Network Profile values returned correct
- ConnectorLibrary.GetActivatedNetworkProfile(ActivatedNetProf);
- Assert.AreEqual(ConnectorLibrary.ActiveNetworkProfileId(true), ActivatedNetProf.Id, IncorrectValueErr);
- Assert.AreNotEqual(0DT, ActivatedNetProf.Disabled, 'Network Profile should be disabled');
- end;
-
- [Test]
- [HandlerFunctions('HttpClientHandler')]
- procedure DeleteParticipationProfile400()
- var
- Participation: Record "Continia Participation";
- ActivatedNetProf: Record "Continia Activated Net. Prof.";
- ApiRequests: Codeunit "Continia Api Requests";
- begin
- Initialize();
- ContiniaMockHttpHandler.AddResponse(400, GetMockResponseContent('Common400.txt'));
-
- // [Given] a Connected Participation with Activated Network Profile
- ConnectorLibrary.PrepareParticipation(Participation, ActivatedNetProf);
-
- // [When] Delete Participation Profile
- asserterror ApiRequests.DeleteParticipationProfile(ActivatedNetProf, Participation.Id);
-
- // [Then] make sure error is correct
- Assert.ExpectedError(Response400ErrorMessageLbl);
- end;
-
- [Test]
- [HandlerFunctions('HttpClientHandler')]
- procedure DeleteParticipationProfile401()
- var
- Participation: Record "Continia Participation";
- ActivatedNetProf: Record "Continia Activated Net. Prof.";
- ApiRequests: Codeunit "Continia Api Requests";
- begin
- Initialize();
- ContiniaMockHttpHandler.AddResponse(401, GetMockResponseContent('Common401.txt'));
-
- // [Given] a Connected Participation with Activated Network Profile
- ConnectorLibrary.PrepareParticipation(Participation, ActivatedNetProf);
-
- // [When] Delete Participation Profile
- asserterror ApiRequests.DeleteParticipationProfile(ActivatedNetProf, Participation.Id);
-
- // [Then] make sure error is correct
- Assert.ExpectedError(Response401ErrorMessageLbl);
- end;
-
- [Test]
- [HandlerFunctions('HttpClientHandler')]
- procedure DeleteParticipationProfile404()
- var
- Participation: Record "Continia Participation";
- ActivatedNetProf: Record "Continia Activated Net. Prof.";
- ApiRequests: Codeunit "Continia Api Requests";
- begin
- Initialize();
- ContiniaMockHttpHandler.AddResponse(404, GetMockResponseContent('Common404.txt'));
-
- // [Given] a Connected Participation with Activated Network Profile
- ConnectorLibrary.PrepareParticipation(Participation, ActivatedNetProf);
-
- // [When] Delete Participation Profile
- asserterror ApiRequests.DeleteParticipationProfile(ActivatedNetProf, Participation.Id);
-
- // [Then] make sure error is correct
- Assert.ExpectedError(Response404ErrorMessageLbl);
- end;
-
- [Test]
- [HandlerFunctions('HttpClientHandler')]
- procedure DeleteParticipationProfile500()
- var
- Participation: Record "Continia Participation";
- ActivatedNetProf: Record "Continia Activated Net. Prof.";
- ApiRequests: Codeunit "Continia Api Requests";
- begin
- Initialize();
- ContiniaMockHttpHandler.AddResponse(500, GetMockResponseContent('Common500.txt'));
-
- // [Given] a Connected Participation with Activated Network Profile
- ConnectorLibrary.PrepareParticipation(Participation, ActivatedNetProf);
-
- // [When] Delete Participation Profile
- asserterror ApiRequests.DeleteParticipationProfile(ActivatedNetProf, Participation.Id);
-
- // [Then] make sure error is correct
- Assert.ExpectedError(Response500ErrorMessageLbl);
- end;
-
- [Test]
- [HandlerFunctions('HttpClientHandlerWithParameters')]
- procedure GetnetworkProfilesMultiplePages()
- var
- ContiniaNetworkProfile: Record "Continia Network Profile";
- ApiRequests: Codeunit "Continia Api Requests";
- LibraryRandom: Codeunit "Library - Random";
- ContiniaApiUrlMgt: Codeunit "Continia Api Url";
- NumberOfRecords: Integer;
- LeftRecordsCount: Integer;
- ResponseHeader: Dictionary of [Text, Text];
- PageSize: Integer;
- PageNumber: Integer;
- Url: Text;
- UrlPatternTok: Label '%1/networks/peppol/profiles.xml?page=%2&page_size=%3', Comment = '%1 - Base URL, %2 - page number, %3 - page size', Locked = true;
- begin
- Initialize();
- if not ContiniaNetworkProfile.IsEmpty() then
- ContiniaNetworkProfile.DeleteAll();
-
- // [Given] Prepare mock response
- LibraryRandom.Init();
- PageSize := 100;
- PageNumber := 0;
- NumberOfRecords := LibraryRandom.RandIntInRange(200, 300);
- ResponseHeader.Add('X-Total-Count', Format(NumberOfRecords));
-
- LeftRecordsCount := NumberOfRecords;
- while LeftRecordsCount > 0 do begin
- PageNumber += 1;
- if LeftRecordsCount < PageSize then
- PageSize := LeftRecordsCount;
- Url := StrSubstNo(UrlPatternTok, ContiniaApiUrlMgt.CdnBaseUrl(), PageNumber, 100);
- ContiniaMockHttpHandler.AddResponseWithParameters(HttpRequestType::Get, Url, 200, GenerateNetworkProfilesResponse(PageSize), ResponseHeader);
- LeftRecordsCount := LeftRecordsCount - PageSize;
- end;
-
- // [When] Get Network Profiles
- ApiRequests.GetNetworkProfiles(Enum::"Continia E-Delivery Network"::Peppol);
- // [Then] Make sure Network Profiles exist
- Assert.AreEqual(NumberOfRecords, ContiniaNetworkProfile.Count(), 'Incorrect number of Network Profiles');
- end;
-
- [Test]
- [HandlerFunctions('HttpClientHandlerWithParameters')]
- procedure GetnetworkIdentifiersMultiplePages()
- var
- ContiniaNetworkIdentifier: Record "Continia Network Identifier";
- ApiRequests: Codeunit "Continia Api Requests";
- LibraryRandom: Codeunit "Library - Random";
- ContiniaApiUrlMgt: Codeunit "Continia Api Url";
- NumberOfRecords: Integer;
- LeftRecordsCount: Integer;
- ResponseHeader: Dictionary of [Text, Text];
- PageSize: Integer;
- PageNumber: Integer;
- Url: Text;
- UrlPatternTok: Label '%1/networks/peppol/id_types.xml?page=%2&page_size=%3', Comment = '%1 - Base URL, %2 - page number, %3 - page size', Locked = true;
- begin
- Initialize();
- if not ContiniaNetworkIdentifier.IsEmpty() then
- ContiniaNetworkIdentifier.DeleteAll();
-
- // [Given] Prepare mock response
- LibraryRandom.Init();
- PageSize := 100;
- PageNumber := 0;
- NumberOfRecords := LibraryRandom.RandIntInRange(200, 300);
- ResponseHeader.Add('X-Total-Count', Format(NumberOfRecords));
-
- LeftRecordsCount := NumberOfRecords;
- while LeftRecordsCount > 0 do begin
- PageNumber += 1;
- if LeftRecordsCount < PageSize then
- PageSize := LeftRecordsCount;
- Url := StrSubstNo(UrlPatternTok, ContiniaApiUrlMgt.CdnBaseUrl(), PageNumber, 100);
- ContiniaMockHttpHandler.AddResponseWithParameters(HttpRequestType::Get, Url, 200, GenerateIdentifiersResponse(PageSize), ResponseHeader);
- LeftRecordsCount := LeftRecordsCount - PageSize;
- end;
-
- // [When] Get Network Profiles
- ApiRequests.GetNetworkIdTypes(Enum::"Continia E-Delivery Network"::Peppol);
- // [Then] Make sure Network Profiles exist
- Assert.AreEqual(NumberOfRecords, ContiniaNetworkIdentifier.Count(), 'Incorrect number of Network Identifiers');
- end;
-
- [Test]
- [HandlerFunctions('HttpClientHandlerWithParameters')]
- procedure GetParticipationProfilesMultiplePages()
- var
- ContiniaParticipationProfile: Record "Continia Activated Net. Prof.";
- ContiniaNetworkProfile: Record "Continia Network Profile";
- Participation: Record "Continia Participation";
- ApiRequests: Codeunit "Continia Api Requests";
- LibraryRandom: Codeunit "Library - Random";
- ContiniaApiUrlMgt: Codeunit "Continia Api Url";
- NumberOfRecords: Integer;
- LeftRecordsCount: Integer;
- ResponseHeader: Dictionary of [Text, Text];
- PageSize: Integer;
- PageNumber: Integer;
- Url: Text;
- UrlPatternTok: Label '%1/networks/peppol/participations/%2/profiles.xml?page=%3&page_size=%4', Comment = '%1 - Base URL, %2 - Participation Id, %3 - page number, %4 - page size', Locked = true;
- begin
- Initialize();
- if not ContiniaParticipationProfile.IsEmpty() then
- ContiniaParticipationProfile.DeleteAll();
- if not ContiniaNetworkProfile.IsEmpty() then
- ContiniaNetworkProfile.DeleteAll();
-
- // [Given] Prepare Participation
- ConnectorLibrary.PrepareParticipation(Participation);
-
- // [Given] Prepare mock response
- LibraryRandom.Init();
- PageSize := 100;
- PageNumber := 0;
- NumberOfRecords := LibraryRandom.RandIntInRange(200, 300);
- ResponseHeader.Add('X-Total-Count', Format(NumberOfRecords));
-
- LeftRecordsCount := NumberOfRecords;
- while LeftRecordsCount > 0 do begin
- PageNumber += 1;
- if LeftRecordsCount < PageSize then
- PageSize := LeftRecordsCount;
- Url := StrSubstNo(UrlPatternTok, ContiniaApiUrlMgt.CdnBaseUrl(), Format(Participation.Id, 0, 4), PageNumber, 100);
- ContiniaMockHttpHandler.AddResponseWithParameters(HttpRequestType::Get, Url, 200, GenerateParticpationProfilesResponse(PageSize), ResponseHeader);
- LeftRecordsCount := LeftRecordsCount - PageSize;
- end;
-
- // [When] Get Network Profiles
- ApiRequests.GetAllParticipationProfiles(Participation);
- // [Then] Make sure Network Profiles exist
- Assert.AreEqual(NumberOfRecords, ContiniaParticipationProfile.Count(), 'Incorrect number of Participation Profiles');
- end;
-
- local procedure Initialize()
- begin
- LibraryPermission.SetOutsideO365Scope();
- ConnectorLibrary.CleanParticipations();
- ContiniaMockHttpHandler.ClearHandler();
-
- if IsInitialized then
- exit;
-
- IsInitialized := true;
- end;
-
- local procedure GenerateNetworkProfilesResponse(NumberOfProfiles: Integer) ResponseText: Text;
- var
- LibraryRandom: Codeunit "Library - Random";
- XMLDoc: XmlDocument;
- RootElement: XmlElement;
- NetworkProfileElement: XmlElement;
- DescriptionElement: XmlElement;
- DocumentIdentifierElement: XmlElement;
- NetworkProfileIdElement: XmlElement;
- ProcessIdentifierElement: XmlElement;
- i: Integer;
- begin
- XMLDoc := XMLDocument.Create();
- RootElement := XmlElement.Create('network_profiles');
- for i := 1 to NumberOfProfiles do begin
- NetworkProfileElement := XmlElement.Create('network_profile');
-
- DescriptionElement := XmlElement.Create('description');
- DescriptionElement.Add(LibraryRandom.RandText(50));
- NetworkProfileElement.Add(DescriptionElement);
-
- DocumentIdentifierElement := XmlElement.Create('document_identifier');
- DocumentIdentifierElement.Add(LibraryRandom.RandText(50));
- NetworkProfileElement.Add(DocumentIdentifierElement);
-
- NetworkProfileIdElement := XmlElement.Create('network_profile_id');
- NetworkProfileIdElement.Add(Format(CreateGuid(), 0, 4));
- NetworkProfileElement.Add(NetworkProfileIdElement);
-
- ProcessIdentifierElement := XmlElement.Create('process_identifier');
- ProcessIdentifierElement.Add(LibraryRandom.RandText(50));
- NetworkProfileElement.Add(ProcessIdentifierElement);
- RootElement.Add(NetworkProfileElement);
- end;
- XMLDoc.Add(RootElement);
- XMLDoc.WriteTo(ResponseText);
- end;
-
- local procedure GenerateIdentifiersResponse(NumberOfIdentifiers: Integer) ResponseText: Text;
- var
- LibraryRandom: Codeunit "Library - Random";
- XMLDoc: XmlDocument;
- RootElement: XmlElement;
- NetworkIdTypeElement: XmlElement;
- CodeElement: XmlElement;
- DefaultInCountryElement: XmlElement;
- IcdCodeElement: XmlElement;
- NetworkIdTypeIdElement: XmlElement;
- DescriptionElement: XmlElement;
- SchemeIdElement: XmlElement;
- i: Integer;
- begin
- XMLDoc := XMLDocument.Create();
- RootElement := XmlElement.Create('network_id_types');
- for i := 1 to NumberOfIdentifiers do begin
- NetworkIdTypeElement := XmlElement.Create('network_id_type');
-
- CodeElement := XmlElement.Create('code_iso6523-1');
- CodeElement.Add(Format(LibraryRandom.RandIntInRange(1000, 9999)));
- NetworkIdTypeElement.Add(CodeElement);
-
- DefaultInCountryElement := XmlElement.Create('default_in_country_iso3166');
- DefaultInCountryElement.Add(GetRandomCountryCode());
- NetworkIdTypeElement.Add(DefaultInCountryElement);
-
- IcdCodeElement := XmlElement.Create('icd_code');
- IcdCodeElement.Add(Format(true));
- NetworkIdTypeElement.Add(IcdCodeElement);
-
- DescriptionElement := XmlElement.Create('description');
- DescriptionElement.Add(LibraryRandom.RandText(50));
- NetworkIdTypeElement.Add(DescriptionElement);
-
- NetworkIdTypeIdElement := XmlElement.Create('network_id_type_id');
- NetworkIdTypeIdElement.Add(Format(CreateGuid(), 0, 4));
- NetworkIdTypeElement.Add(NetworkIdTypeIdElement);
-
- SchemeIdElement := XmlElement.Create('scheme_id');
- SchemeIdElement.Add(LibraryRandom.RandText(10));
- NetworkIdTypeElement.Add(SchemeIdElement);
-
- RootElement.Add(NetworkIdTypeElement);
- end;
- XMLDoc.Add(RootElement);
- XMLDoc.WriteTo(ResponseText);
- end;
-
- local procedure GenerateParticpationProfilesResponse(NumberOfProfiles: Integer) ResponseText: Text
- var
- XMLDoc: XmlDocument;
- RootElement: XmlElement;
- NetworkProfileElement: XmlElement;
- NetworkProfileIdElement: XmlElement;
- DirectionElement: XmlElement;
- ParticipationProfileIdElement: XmlElement;
- CreatedUtcElement: XmlElement;
- UpdatedUtcElement: XmlElement;
- i: Integer;
- begin
- XMLDoc := XMLDocument.Create();
- RootElement := XmlElement.Create('participation_profiles');
- for i := 1 to NumberOfProfiles do begin
- NetworkProfileElement := XmlElement.Create('participation_profile');
-
- NetworkProfileIdElement := XmlElement.Create('network_profile_id');
- NetworkProfileIdElement.Add(Format(CreateNetworkProfile().Id, 0, 4));
- NetworkProfileElement.Add(NetworkProfileIdElement);
-
- ParticipationProfileIdElement := XmlElement.Create('participation_profile_id');
- ParticipationProfileIdElement.Add(Format(CreateGuid(), 0, 4));
- NetworkProfileElement.Add(ParticipationProfileIdElement);
-
- DirectionElement := XmlElement.Create('direction');
- DirectionElement.Add('BothEnum');
- NetworkProfileElement.Add(DirectionElement);
-
- CreatedUtcElement := XmlElement.Create('created_utc');
- CreatedUtcElement.Add(Format(CurrentDateTime(), 0, 9));
- NetworkProfileElement.Add(CreatedUtcElement);
-
- UpdatedUtcElement := XmlElement.Create('updated_utc');
- UpdatedUtcElement.Add(Format(CurrentDateTime(), 0, 9));
- NetworkProfileElement.Add(UpdatedUtcElement);
- RootElement.Add(NetworkProfileElement);
- end;
- XMLDoc.Add(RootElement);
- XMLDoc.WriteTo(ResponseText);
- end;
-
- local procedure GetRandomCountryCode() CountryCode: Text
- var
- LibraryRandom: Codeunit "Library - Random";
- CountryCodeList: List of [Text];
- CountryCodesTok: Label 'AU,BE,CA,DE,DK,EE,FI,FR,GB,IE,IT,NZ,NL,NO,PL,RU,SE,SG', Comment = 'List of country codes', Locked = true;
- begin
- LibraryRandom.Init();
- CountryCodeList := CountryCodesTok.Split(',');
- CountryCode := CountryCodeList.Get(LibraryRandom.RandIntInRange(1, CountryCodeList.Count()));
- end;
-
- local procedure CreateNetworkProfile() NetworkProfile: Record "Continia Network Profile";
- begin
- NetworkProfile.Init();
- NetworkProfile.Id := CreateGuid();
- NetworkProfile.Insert()
- end;
-
- local procedure GetMockResponseContent(FileName: Text) ContentText: Text
- begin
- ContentText := NavApp.GetResourceAsText(FileName, TextEncoding::UTF8);
- end;
-
- [HttpClientHandler]
- internal procedure HttpClientHandler(Request: TestHttpRequestMessage; var Response: TestHttpResponseMessage): Boolean
- begin
- if ContiniaMockHttpHandler.HandleAuthorization(Request, Response) then
- exit;
-
- Response := ContiniaMockHttpHandler.GetResponse(Request);
- end;
-
- [HttpClientHandler]
- internal procedure HttpClientHandlerWithParameters(Request: TestHttpRequestMessage; var Response: TestHttpResponseMessage): Boolean
- begin
- if ContiniaMockHttpHandler.HandleAuthorization(Request, Response) then
- exit;
-
- Response := ContiniaMockHttpHandler.GetResponseWithParameters(Request);
- end;
-
- var
- LibraryPermission: Codeunit "Library - Lower Permissions";
- Assert: Codeunit Assert;
- ConnectorLibrary: Codeunit "Continia Connector Library";
- ContiniaMockHttpHandler: Codeunit "Continia Mock Http Handler";
- IsInitialized: Boolean;
- IncorrectValueErr: Label 'Wrong value';
- Response400ErrorMessageLbl: Label 'The Continia Delivery Network API returned the following error: Error Code Bad Request - Missing parameter';
- Response401ErrorMessageLbl: Label 'The Continia Delivery Network API returned the following error: Error Code Not Authenticated - Login failed';
- Response404ErrorMessageLbl: Label 'The Continia Delivery Network API returned the following error: Error Code Not Found - Not Found';
- Response409ErrorMessageLbl: Label 'The Continia Delivery Network API returned the following error: Error Code Conflict - Conflict';
- Response422ErrorMessageLbl: Label 'The Continia Delivery Network API returned the following error: Error Code string - string';
- Response500ErrorMessageLbl: Label 'The Continia Delivery Network API returned the following system error: Error Code Internal Server - Unhandled system error';
-}
diff --git a/Apps/W1/EDocumentConnectors/Continia/test/src/ContiniaConnectorLibrary.Codeunit.al b/Apps/W1/EDocumentConnectors/Continia/test/src/ContiniaConnectorLibrary.Codeunit.al
deleted file mode 100644
index ebbcc6cb1c..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/test/src/ContiniaConnectorLibrary.Codeunit.al
+++ /dev/null
@@ -1,211 +0,0 @@
-namespace Microsoft.EServices.EDocumentConnector.Continia;
-
-using Microsoft.eServices.EDocument;
-using Microsoft.eServices.EDocument.Integration;
-
-codeunit 148202 "Continia Connector Library"
-{
- Access = Internal;
-
- internal procedure ParticipationId(): Text
- begin
- exit(ParticipationIdLbl);
- end;
-
- internal procedure ParticipationId(AsGuid: Boolean): Guid
- begin
- exit(ConvertToGuid(ParticipationId()));
- end;
-
- internal procedure ActiveNetworkProfileId(): Text
- begin
- exit(ActivatedNetworkProfileIdLbl);
- end;
-
- internal procedure ActiveNetworkProfileId(AsGuid: Boolean): Guid
- begin
- exit(ConvertToGuid(ActiveNetworkProfileId()));
- end;
-
- internal procedure DefaultNetworkProfileId(): Text
- begin
- exit(DefaultNetworkProfileIdLbl);
- end;
-
- internal procedure DefaultNetworkProfileId(AsGuid: Boolean): Guid
- begin
- exit(ConvertToGuid(DefaultNetworkProfileId()));
- end;
-
- internal procedure NetworkProfileIdPeppolBis3Invoice(): Text
- begin
- exit(NetworkProfileIdPeppolBis3InvoiceLbl);
- end;
-
- internal procedure NetworkProfileIdPeppolBis3Invoice(AsGuid: Boolean): Guid
- begin
- exit(ConvertToGuid(NetworkProfileIdPeppolBis3Invoice()));
- end;
-
- local procedure ConvertToGuid(GuidText: Text) GuidValue: Guid
- begin
- Evaluate(GuidValue, GuidText);
- end;
-
- internal procedure InitiateClientCredentials()
- var
- ConnectionSetup: Record "Continia Connection Setup";
- begin
- if not ConnectionSetup.Get() then
- ConnectionSetup.Insert();
-
- ConnectionSetup.SetClientId(LibraryRandom.RandText(20));
- ConnectionSetup.SetClientSecret(LibraryRandom.RandText(20));
- ConnectionSetup."Local Client Identifier" := CopyStr(LibraryRandom.RandText(MaxStrLen(ConnectionSetup."Local Client Identifier")), 1, MaxStrLen(ConnectionSetup."Local Client Identifier"));
- ConnectionSetup."Subscription Status" := ConnectionSetup."Subscription Status"::Subscription;
- ConnectionSetup.Modify();
- end;
-
- internal procedure ClearClientCredentials()
- var
- ConnectionSetup: Record "Continia Connection Setup";
- begin
- if ConnectionSetup.Get() then
- ConnectionSetup.Delete();
- end;
-
- internal procedure PrepareParticipation(EDocumentService: Record "E-Document Service")
- var
- Participation: Record "Continia Participation";
- ActivatedNetProf: Record "Continia Activated Net. Prof.";
- begin
- // Create a participation with profile
- PrepareParticipation(Participation, ActivatedNetProf, EDocumentService)
- end;
-
- internal procedure PrepareParticipation(var Participation: Record "Continia Participation")
- var
- NetworkIdentifier: Record "Continia Network Identifier";
- begin
- NetworkIdentifier.Init();
- NetworkIdentifier.Id := IdentifierTypeIdLbl;
- NetworkIdentifier.Insert();
-
- // Create a participation without profile
- Participation.Init();
- Participation.Network := Participation.Network::Peppol;
- Participation."Identifier Type Id" := IdentifierTypeIdLbl;
- Participation."Identifier Value" := IdentifierValueLbl;
- if Participation.IsTemporary then begin
- Participation.Insert();
- exit;
- end;
- Participation.Id := ParticipationIdLbl;
- Participation."Registration Status" := Participation."Registration Status"::Connected;
- Participation.Insert();
- end;
-
- internal procedure PrepareParticipation(var Participation: Record "Continia Participation"; var ActivatedNetProf: Record "Continia Activated Net. Prof.")
- var
- LibraryEDocument: Codeunit "Library - E-Document";
- EDocServiceCode: Code[20];
- begin
- // Create a participation with profile
- PrepareParticipation(Participation);
-
- CreateNetworkProfiles();
-
- EDocServiceCode := LibraryEDocument.CreateService(Enum::"Service Integration"::Continia);
- AddActivatedNetworkProfile(Participation, ActivatedNetProf, EDocServiceCode);
- end;
-
- internal procedure PrepareParticipation(var Participation: Record "Continia Participation"; var ActivatedNetProf: Record "Continia Activated Net. Prof."; EDocumentService: Record "E-Document Service")
- begin
- // Create a participation with profile
- PrepareParticipation(Participation);
-
- CreateNetworkProfiles();
-
- AddActivatedNetworkProfile(Participation, ActivatedNetProf, EDocumentService.Code);
- end;
-
- internal procedure AddActivatedNetworkProfile(var Participation: Record "Continia Participation"; var ActivatedNetProf: Record "Continia Activated Net. Prof."; EDocServiceCode: Code[20])
- begin
- AddActivatedNetworkProfile(Participation, DefaultNetworkProfileIdLbl, ActivatedNetworkProfileIdLbl, ActivatedNetProf, EDocServiceCode);
- end;
-
- internal procedure AddActivatedNetworkProfile(var Participation: Record "Continia Participation"; NetworkPrifileId: Guid; ActivatedNetworkPrifileId: Guid; var ActivatedNetProf: Record "Continia Activated Net. Prof."; EDocServiceCode: Code[20])
- begin
- ActivatedNetProf.Init();
- ActivatedNetProf.Network := Participation.Network;
- ActivatedNetProf."Identifier Type Id" := Participation."Identifier Type Id";
- ActivatedNetProf."Identifier Value" := Participation."Identifier Value";
- ActivatedNetProf."Network Profile Id" := NetworkPrifileId;
- ActivatedNetProf."Profile Direction" := ActivatedNetProf."Profile Direction"::Both;
- ActivatedNetProf."E-Document Service Code" := EDocServiceCode;
- if ActivatedNetProf.IsTemporary then begin
- ActivatedNetProf.Insert();
- exit;
- end;
- ActivatedNetProf.Id := ActivatedNetworkPrifileId;
- ActivatedNetProf.Insert();
- end;
-
- local procedure CreateNetworkProfiles()
- var
- NetworkProfile: Record "Continia Network Profile";
- begin
- NetworkProfile.Init();
- NetworkProfile.Id := DefaultNetworkProfileIdLbl;
- NetworkProfile.Insert();
-
- NetworkProfile.Init();
- NetworkProfile.Id := NetworkProfileIdPeppolBis3InvoiceLbl;
- NetworkProfile.Insert();
- end;
-
- [TryFunction]
- internal procedure GetParticipation(var Participation: Record "Continia Participation")
- begin
- Participation.Get(Participation.Network::Peppol, IdentifierTypeIdLbl, IdentifierValueLbl);
- end;
-
- [TryFunction]
- internal procedure GetActivatedNetworkProfile(var ActivatedNetProf: Record "Continia Activated Net. Prof.")
- begin
- ActivatedNetProf.Get(ActivatedNetProf.Network::Peppol, IdentifierTypeIdLbl, IdentifierValueLbl, DefaultNetworkProfileIdLbl);
- end;
-
- [TryFunction]
- internal procedure GetActivatedNetworkProfile(NetworkProfileId: Guid; var ActivatedNetProf: Record "Continia Activated Net. Prof.")
- begin
- ActivatedNetProf.Get(ActivatedNetProf.Network::Peppol, IdentifierTypeIdLbl, IdentifierValueLbl, NetworkProfileId);
- end;
-
- internal procedure CleanParticipations()
- var
- Participation: Record "Continia Participation";
- NetworkIdentifier: Record "Continia Network Identifier";
- NetworkProfile: Record "Continia Network Profile";
- ActivatedNetProf: Record "Continia Activated Net. Prof.";
- begin
- if not Participation.IsEmpty then
- Participation.DeleteAll();
- if not NetworkIdentifier.IsEmpty then
- NetworkIdentifier.DeleteAll();
- if not NetworkProfile.IsEmpty then
- NetworkProfile.DeleteAll();
- if not ActivatedNetProf.IsEmpty then
- ActivatedNetProf.DeleteAll();
- end;
-
- var
- LibraryRandom: Codeunit "Library - Random";
- ParticipationIdLbl: Label '0de4aedc-f84a-41bc-b511-387aaf96263e', Locked = true;
- ActivatedNetworkProfileIdLbl: Label '1f4111a0-cd49-45e1-9f1e-ed14e71e3438', Locked = true;
- DefaultNetworkProfileIdLbl: Label 'dd2af6bc-a05a-4fd4-a577-0216a56bea84', Locked = true; //Peppol Credit Note profile used as default
- NetworkProfileIdPeppolBis3InvoiceLbl: Label '8f9ab973-c6f0-4dfb-9936-19b56c5a588b', Locked = true;
- IdentifierTypeIdLbl: Label '568c29e7-c2c8-49bb-b135-9199d5b791d1', Locked = true;
- IdentifierValueLbl: Label '111222333', Locked = true;
-
-}
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/test/src/ContiniaDocIntegrTests.Codeunit.al b/Apps/W1/EDocumentConnectors/Continia/test/src/ContiniaDocIntegrTests.Codeunit.al
deleted file mode 100644
index 204017d204..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/test/src/ContiniaDocIntegrTests.Codeunit.al
+++ /dev/null
@@ -1,1279 +0,0 @@
-namespace Microsoft.EServices.EDocumentConnector.Continia;
-
-using Microsoft.eServices.EDocument;
-using Microsoft.Sales.Customer;
-using Microsoft.Inventory.Item;
-using Microsoft.Foundation.UOM;
-using Microsoft.Inventory.Item.Catalog;
-using Microsoft.Purchases.Vendor;
-using Microsoft.Foundation.Company;
-using System.TestLibraries.Environment;
-using Microsoft.Purchases.Document;
-using System.Threading;
-using Microsoft.eServices.EDocument.Integration;
-using Microsoft.Finance.VAT.Setup;
-using Microsoft.Finance.Currency;
-
-codeunit 148203 "Continia Doc. Integr. Tests"
-{
- Subtype = Test;
- TestType = Uncategorized;
- TestHttpRequestPolicy = AllowOutboundFromHandler;
- Access = Internal;
-
- ///
- /// SubmitDocument - Tests successful document submission.
- /// This test verifies that a document is created, assigned a valid Document ID, and transitions through
- /// the expected statuses ("In Progress" -> "Processed") as the Continia API processes it. Additionally,
- /// it validates that the e-Document logs contain the correct status entries.
- ///
-
- [Test]
- [HandlerFunctions('HttpClientHandler')]
- procedure SubmitDocument()
- var
- EDocument: Record "E-Document";
- EDocLogList: List of [Enum "E-Document Service Status"];
- begin
- // Steps:
- // Pending response -> Sent
- Initialize();
-
- // [Given] Team Member
- LibraryPermission.SetTeamMember();
-
- // [When] Posting invoice and EDocument is created
- LibraryEDocument.PostInvoice(Customer);
- EDocument.FindLast();
-
- ContiniaMockHttpHandler.ClearHandler();
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Post,
- StrSubstNo(DocumentUriPatternTok, ContiniaApiUrlMgt.CdnBaseUrl()),
- 200,
- GetMockResponseContent('SubmitDocument200.txt'));
- LibraryEDocument.RunEDocumentJobQueue(EDocument);
-
- // [When] EDocument is fetched after running Continia SubmitDocument
- EDocument.FindLast();
-
- // [Then] Document Id has been correctly set on E-Document, parsed from Integration response
- Assert.AreEqual(MockDocumentId(), EDocument."Continia Document Id", 'Continia integration failed to set Document Id on E-Document');
- // [Then] E-Document is "In Progress"
- Assert.AreEqual(Enum::"E-Document Status"::"In Progress", EDocument.Status, 'E-Document should be set to in progress');
-
- // [Then] eDocument Service Status has "Pending Response" and has correct logs
- Clear(EDocLogList);
- EDocLogList.Add(Enum::"E-Document Service Status"::Exported);
- EDocLogList.Add(Enum::"E-Document Service Status"::"Pending Response");
- TestEDocumentPage(EDocument, Enum::"E-Document Status"::"In Progress", Enum::"E-Document Service Status"::"Pending Response", EDocLogList, '', '');
-
- // [WHEN] Executing Get Response successfully
- ContiniaMockHttpHandler.ClearHandler();
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Get,
- ContiniaApiUrlMgt.TechnicalResponseUrl(MockDocumentId()),
- 200,
- GetMockResponseContent('TechnicalResponse200-Success.txt'));
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Post,
- ContiniaApiUrlMgt.DocumentActionUrl(MockDocumentId()),
- 200);
- RunGetResponseJob();
-
- // [When] EDocument is fetched after running Continia GetResponse
- EDocument.FindLast();
-
- // [Then] E-Document is considered processed
- Assert.AreEqual(Enum::"E-Document Status"::Processed, EDocument.Status, 'E-Document should be set to processed');
-
- // [Then] eDocument Service Status has Sent and has correct logs
- Clear(EDocLogList);
- EDocLogList.Add(Enum::"E-Document Service Status"::Exported);
- EDocLogList.Add(Enum::"E-Document Service Status"::"Pending Response");
- EDocLogList.Add(Enum::"E-Document Service Status"::Sent);
- TestEDocumentPage(EDocument, Enum::"E-Document Status"::Processed, Enum::"E-Document Service Status"::Sent, EDocLogList, '', '');
- end;
-
- ///
- /// SubmitDocumentCdnServiceDown - Tests error handling when the Continia service is down.
- /// This test ensures that when the Continia API returns a 500 error, the document moves to an "Error"
- /// status. It verifies that the Document ID is not set and that the error is logged correctly.
- ///
- [Test]
- [HandlerFunctions('HttpClientHandler')]
- procedure SubmitDocumentCdnServiceDown()
- var
- EDocument: Record "E-Document";
- EDocLogList: List of [Enum "E-Document Service Status"];
- begin
- Initialize();
-
- // [Given] Team member
- LibraryPermission.SetTeamMember();
-
- // [When] Posting invoice and EDocument is created
- LibraryEDocument.PostInvoice(Customer);
- EDocument.FindLast();
- ContiniaMockHttpHandler.ClearHandler();
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Post,
- StrSubstNo(DocumentUriPatternTok, ContiniaApiUrlMgt.CdnBaseUrl()),
- 500,
- GetMockResponseContent('Common500.txt'));
- LibraryEDocument.RunEDocumentJobQueue(EDocument);
-
- // [When] EDocument is fetched after running Continia SubmitDocument
- EDocument.FindLast();
-
- // [Then] E-Document is in Error
- Assert.AreEqual(Enum::"E-Document Status"::Error, EDocument.Status, 'E-Document should be set to error state when service is down.');
- // [Then] Document Id has not been set
- Assert.IsTrue(IsNullGuid(EDocument."Continia Document Id"), 'Document Id on E-Document should not be set.');
-
- // [Then] eDocument Service Status has "Sending Error" and has correct logs
- Clear(EDocLogList);
- EDocLogList.Add(Enum::"E-Document Service Status"::Exported);
- EDocLogList.Add(Enum::"E-Document Service Status"::"Sending Error");
- TestEDocumentPage(EDocument, Enum::"E-Document Status"::Error, Enum::"E-Document Service Status"::"Sending Error", EDocLogList, 'Error', 'The Continia Delivery Network API returned the following system error: Error Code Internal Server - Unhandled system error');
- end;
-
- ///
- /// SubmitDocument_ResponseServerDown_Sent - Tests response retrieval during server down scenario.
- /// This test simulates a scenario where the Continia API is temporarily down while retrieving responses.
- /// It verifies that the document status remains "In Progress" and is successfully updated to "Sent" once
- /// the service is back online.
- ///
- [Test]
- [HandlerFunctions('HttpClientHandler')]
- procedure SubmitDocument_ResponseServerDown_Sent()
- var
- EDocument: Record "E-Document";
- EDocLogList: List of [Enum "E-Document Service Status"];
- begin
- // Steps:
- // Pending response -> Pending response -> Pending Response (ResponseServerDown) -> Sent
- Initialize();
-
- // [Given] Team Member
- LibraryPermission.SetTeamMember();
-
- // [When] Posting invoice and EDocument is created
- LibraryEDocument.PostInvoice(Customer);
- EDocument.FindLast();
- ContiniaMockHttpHandler.ClearHandler();
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Post,
- StrSubstNo(DocumentUriPatternTok, ContiniaApiUrlMgt.CdnBaseUrl()),
- 200,
- GetMockResponseContent('SubmitDocument200.txt'));
- LibraryEDocument.RunEDocumentJobQueue(EDocument);
-
- // [When] EDocument is fetched after running Continia SubmitDocument
- EDocument.FindLast();
-
- // [Then] Document Id has been correctly set on E-Document, parsed from Integration response
- Assert.AreEqual(MockDocumentId(), EDocument."Continia Document Id", 'Continia integration failed to set Document Id on E-Document');
-
- // [Then] E-Document is "In Progress"
- Assert.AreEqual(Enum::"E-Document Status"::"In Progress", EDocument.Status, 'E-Document should be set to in progress');
-
- // [Then] eDocument Service Status has "Pending Response" and has correct logs
- Clear(EDocLogList);
- EDocLogList.Add(Enum::"E-Document Service Status"::Exported);
- EDocLogList.Add(Enum::"E-Document Service Status"::"Pending Response");
- TestEDocumentPage(EDocument, Enum::"E-Document Status"::"In Progress", Enum::"E-Document Service Status"::"Pending Response", EDocLogList, '', '');
-
- // [When] Service is down
- ContiniaMockHttpHandler.ClearHandler();
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Get,
- ContiniaApiUrlMgt.TechnicalResponseUrl(MockDocumentId()),
- 500,
- GetMockResponseContent('Common500.txt'));
- RunGetResponseJob();
-
- // [When] EDocument is fetched after running Continia GetResponse
- EDocument.FindLast();
-
- // [Then] E-Document is "In Progress"
- Assert.AreEqual(EDocument.Status::"In Progress", EDocument.Status, 'Continia integration failed to set Document Status on E-Document');
-
- // [Then] eDocument Service Status has "Pending Response" and has correct logs
- Clear(EDocLogList);
- EDocLogList.Add(Enum::"E-Document Service Status"::Exported);
- EDocLogList.Add(Enum::"E-Document Service Status"::"Pending Response");
- EDocLogList.Add(Enum::"E-Document Service Status"::"Pending Response");
- TestEDocumentPage(EDocument, Enum::"E-Document Status"::"In Progress", Enum::"E-Document Service Status"::"Pending Response", EDocLogList, '', '');
-
- // [When] Service is up again
- ContiniaMockHttpHandler.ClearHandler();
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Get,
- ContiniaApiUrlMgt.TechnicalResponseUrl(MockDocumentId()),
- 200,
- GetMockResponseContent('TechnicalResponse200-Success.txt'));
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Post,
- ContiniaApiUrlMgt.DocumentActionUrl(MockDocumentId()),
- 200);
- RunGetResponseJob();
-
- // [When] EDocument is fetched after running Continia GetResponse
- EDocument.FindLast();
-
- // [Then] E-Document is Processed
- Assert.AreEqual(EDocument.Status::Processed, EDocument.Status, 'Continia integration failed to set Document Status on E-Document');
-
- // [Then] eDocument Service Status has Sent and has correct logs
- Clear(EDocLogList);
- EDocLogList.Add(Enum::"E-Document Service Status"::Exported);
- EDocLogList.Add(Enum::"E-Document Service Status"::"Pending Response");
- EDocLogList.Add(Enum::"E-Document Service Status"::"Pending Response");
- EDocLogList.Add(Enum::"E-Document Service Status"::Sent);
- TestEDocumentPage(EDocument, Enum::"E-Document Status"::Processed, Enum::"E-Document Service Status"::Sent, EDocLogList, '', '');
- end;
-
- ///
- /// SubmitDocument_Pending_Sent - Tests handling of pending responses before successful document sending.
- /// This test checks that the document moves to "In Progress" and remains in this status until the API
- /// confirms it is processed, transitioning it to "Sent."
- ///
- [Test]
- [HandlerFunctions('HttpClientHandler')]
- procedure SubmitDocument_Pending_Sent()
- var
- EDocument: Record "E-Document";
- EDocLogList: List of [Enum "E-Document Service Status"];
- begin
- // Steps:
- // Pending response -> Pending response -> Sent
- Initialize();
-
- // [Given] Team Member
- LibraryPermission.SetTeamMember();
-
- // [When] Posting invoice and EDocument is created
- LibraryEDocument.PostInvoice(Customer);
- EDocument.FindLast();
- ContiniaMockHttpHandler.ClearHandler();
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Post,
- StrSubstNo(DocumentUriPatternTok, ContiniaApiUrlMgt.CdnBaseUrl()),
- 200,
- GetMockResponseContent('SubmitDocument200.txt'));
- LibraryEDocument.RunEDocumentJobQueue(EDocument);
-
- // [When] EDocument is fetched after running Continia SubmitDocument
- EDocument.FindLast();
-
- // [Then] Document Id has been correctly set on E-Document, parsed from Integration response
- Assert.AreEqual(MockDocumentId(), EDocument."Continia Document Id", 'Continia integration failed to set Document Id on E-Document');
-
- // [Then] E-Document is "In Progress"
- Assert.AreEqual(Enum::"E-Document Status"::"In Progress", EDocument.Status, 'E-Document should be set to in progress');
-
- // [Then] eDocument Service Status has "Pending Response" and has correct logs
- Clear(EDocLogList);
- EDocLogList.Add(Enum::"E-Document Service Status"::Exported);
- EDocLogList.Add(Enum::"E-Document Service Status"::"Pending Response");
- TestEDocumentPage(EDocument, Enum::"E-Document Status"::"In Progress", Enum::"E-Document Service Status"::"Pending Response", EDocLogList, '', '');
-
- // [When] Executing Get Response successfully (pending)
- ContiniaMockHttpHandler.ClearHandler();
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Get,
- ContiniaApiUrlMgt.TechnicalResponseUrl(MockDocumentId()),
- 200,
- GetMockResponseContent('TechnicalResponse200-Pending.txt'));
- RunGetResponseJob();
-
- // [When] EDocument is fetched after running Continia GetResponse
- EDocument.FindLast();
-
- // [Then] E-Document is "In Progress"
- Assert.AreEqual(EDocument.Status::"In Progress", EDocument.Status, 'Continia integration failed to set Document Status on E-Document');
-
- // [Then] eDocument Service Status has "Pending Response" and has correct logs
- Clear(EDocLogList);
- EDocLogList.Add(Enum::"E-Document Service Status"::Exported);
- EDocLogList.Add(Enum::"E-Document Service Status"::"Pending Response");
- EDocLogList.Add(Enum::"E-Document Service Status"::"Pending Response");
- TestEDocumentPage(EDocument, Enum::"E-Document Status"::"In Progress", Enum::"E-Document Service Status"::"Pending Response", EDocLogList, '', '');
-
- // [When] Executing Get Response successfully (Success)
- ContiniaMockHttpHandler.ClearHandler();
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Get,
- ContiniaApiUrlMgt.TechnicalResponseUrl(MockDocumentId()),
- 200,
- GetMockResponseContent('TechnicalResponse200-Success.txt'));
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Post,
- ContiniaApiUrlMgt.DocumentActionUrl(MockDocumentId()),
- 200);
- RunGetResponseJob();
-
- // [When] EDocument is fetched after running Continia GetResponse
- EDocument.FindLast();
-
- // [Then] E-Document is Processed
- Assert.AreEqual(EDocument.Status::Processed, EDocument.Status, 'Continia integration failed to set Document Status on E-Document');
-
- // [Then] eDocument Service Status has Sent and has correct logs
- Clear(EDocLogList);
- EDocLogList.Add(Enum::"E-Document Service Status"::Exported);
- EDocLogList.Add(Enum::"E-Document Service Status"::"Pending Response");
- EDocLogList.Add(Enum::"E-Document Service Status"::"Pending Response");
- EDocLogList.Add(Enum::"E-Document Service Status"::Sent);
- TestEDocumentPage(EDocument, Enum::"E-Document Status"::Processed, Enum::"E-Document Service Status"::Sent, EDocLogList, '', '');
- end;
-
- ///
- /// SubmitDocument_Error_Sent - Tests handling of submission errors, like unregistered recipients.
- /// This test ensures that when the API response indicates an error (e.g., recipient not registered), the
- /// document moves to "Error" status, and the error is properly logged. It also verifies successful resubmission
- /// after the issue is resolved.
- ///
- [Test]
- [HandlerFunctions('EDocServicesPageHandler,HttpClientHandler')]
- procedure SubmitDocument_Error_Sent()
- var
- EDocument: Record "E-Document";
- EDocumentPage: TestPage "E-Document";
- EDocLogList: List of [Enum "E-Document Service Status"];
- begin
- // Steps:
- // Pending response -> Error -> Pending response -> Sent
- Initialize();
-
- // [Given] Team Member
- LibraryPermission.SetTeamMember();
-
- // [When] Posting invoice and EDocument is created
- LibraryEDocument.PostInvoice(Customer);
- EDocument.FindLast();
- ContiniaMockHttpHandler.ClearHandler();
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Post,
- StrSubstNo(DocumentUriPatternTok, ContiniaApiUrlMgt.CdnBaseUrl()),
- 200,
- GetMockResponseContent('SubmitDocument200.txt'));
- LibraryEDocument.RunEDocumentJobQueue(EDocument);
-
- // [When] EDocument is fetched after running Continia SubmitDocument
- EDocument.FindLast();
-
- // [Then] Document Id has been correctly set on E-Document, parsed from Integration response
- Assert.AreEqual(MockDocumentId(), EDocument."Continia Document Id", 'Continia integration failed to set Document Id on E-Document');
-
- // [Then] E-Document is "In Progress"
- Assert.AreEqual(Enum::"E-Document Status"::"In Progress", EDocument.Status, 'E-Document should be set to in progress');
-
- // [Then] eDocument Service Status has "Pending Response" and has correct logs
- Clear(EDocLogList);
- EDocLogList.Add(Enum::"E-Document Service Status"::Exported);
- EDocLogList.Add(Enum::"E-Document Service Status"::"Pending Response");
- TestEDocumentPage(EDocument, Enum::"E-Document Status"::"In Progress", Enum::"E-Document Service Status"::"Pending Response", EDocLogList, '', '');
-
- // [When] Executing Get Response successfully (error)
- ContiniaMockHttpHandler.ClearHandler();
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Get,
- ContiniaApiUrlMgt.TechnicalResponseUrl(MockDocumentId()),
- 200,
- GetMockResponseContent('TechnicalResponse200-Error.txt'));
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Post,
- ContiniaApiUrlMgt.DocumentActionUrl(MockDocumentId()),
- 200);
- RunGetResponseJob();
-
- // [When] EDocument is fetched after running Continia GetResponse
- EDocument.FindLast();
-
- // [Then] E-Document is Error
- Assert.AreEqual(EDocument.Status::Error, EDocument.Status, 'Continia integration failed to set Document Status on E-Document');
-
- // [Then] eDocument Service Status has "Sending Error" and has correct logs
- Clear(EDocLogList);
- EDocLogList.Add(Enum::"E-Document Service Status"::Exported);
- EDocLogList.Add(Enum::"E-Document Service Status"::"Pending Response");
- EDocLogList.Add(Enum::"E-Document Service Status"::"Sending Error");
- TestEDocumentPage(EDocument, Enum::"E-Document Status"::Error, Enum::"E-Document Service Status"::"Sending Error", EDocLogList, 'Error', 'ReceiverNotRegistered - The recipient of the document is not registered to receive this type of document.');
-
- // Then user manually send
- ContiniaMockHttpHandler.ClearHandler();
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Post,
- StrSubstNo(DocumentUriPatternTok, ContiniaApiUrlMgt.CdnBaseUrl()),
- 200,
- GetMockResponseContent('SubmitDocument200.txt'));
- EDocument.FindLast();
-
- // [THEN] Open E-Document page and resend
- EDocumentPage.OpenView();
- EDocumentPage.GoToRecord(EDocument);
- EDocumentPage.Send_Promoted.Invoke();
- // EDocServicesPageHandler
- EDocumentPage.Close();
-
- // [When] EDocument is fetched after running Continia Send Document
- EDocument.FindLast();
-
- // [Then] E-Document is "In Progress"
- Assert.AreEqual(Enum::"E-Document Status"::"In Progress", EDocument.Status, 'E-Document should be set to in progress');
-
- // [Then] eDocument Service Status has "Pending Response" and has correct logs
- Clear(EDocLogList);
- EDocLogList.Add(Enum::"E-Document Service Status"::Exported);
- EDocLogList.Add(Enum::"E-Document Service Status"::"Pending Response");
- EDocLogList.Add(Enum::"E-Document Service Status"::"Sending Error");
- EDocLogList.Add(Enum::"E-Document Service Status"::"Pending Response");
- TestEDocumentPage(EDocument, Enum::"E-Document Status"::"In Progress", Enum::"E-Document Service Status"::"Pending Response", EDocLogList, '', '');
-
- // [When] Executing Get Response successfully (Success)
- ContiniaMockHttpHandler.ClearHandler();
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Get,
- ContiniaApiUrlMgt.TechnicalResponseUrl(MockDocumentId()),
- 200,
- GetMockResponseContent('TechnicalResponse200-Success.txt'));
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Post,
- ContiniaApiUrlMgt.DocumentActionUrl(MockDocumentId()),
- 200);
- RunGetResponseJob();
-
- // [When] EDocument is fetched after running Continia GetResponse
- EDocument.FindLast();
-
- // [Then] E-Document is Processed
- Assert.AreEqual(EDocument.Status::Processed, EDocument.Status, 'Continia integration failed to set Document Status on E-Document');
-
- // [Then] eDocument Service Status has Sent and has correct logs
- Clear(EDocLogList);
- EDocLogList.Add(Enum::"E-Document Service Status"::Exported);
- EDocLogList.Add(Enum::"E-Document Service Status"::"Pending Response");
- EDocLogList.Add(Enum::"E-Document Service Status"::"Sending Error");
- EDocLogList.Add(Enum::"E-Document Service Status"::"Pending Response");
- EDocLogList.Add(Enum::"E-Document Service Status"::Sent);
- TestEDocumentPage(EDocument, Enum::"E-Document Status"::Processed, Enum::"E-Document Service Status"::Sent, EDocLogList, '', '');
- end;
-
- ///
- /// SubmitDocument_NoApproval - Tests handling when no approval is returned for document processing.
- /// This test ensures that if no approval is returned, the document remains in the "Sent" state
- /// without transitioning to "Approved" or other statuses. It validates that the document stays
- /// in "Sent" when approval is not received.
- ///
- [Test]
- [HandlerFunctions('EDocServicesPageHandler,HttpClientHandler')]
- procedure SubmitDocument_NoApproval()
- var
- EDocument: Record "E-Document";
- EDocumentPage: TestPage "E-Document";
- EDocLogList: List of [Enum "E-Document Service Status"];
- begin
- // Steps:
- // Pending response -> Sent -> Sent (No Approval)
- Initialize();
-
- // [Given] Team Member
- LibraryPermission.SetTeamMember();
-
- // [When] Posting invoice and EDocument is created
- LibraryEDocument.PostInvoice(Customer);
- EDocument.FindLast();
- ContiniaMockHttpHandler.ClearHandler();
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Post,
- StrSubstNo(DocumentUriPatternTok, ContiniaApiUrlMgt.CdnBaseUrl()),
- 200,
- GetMockResponseContent('SubmitDocument200.txt'));
- LibraryEDocument.RunEDocumentJobQueue(EDocument);
-
- // [When] EDocument is fetched after running Continia SubmitDocument
- EDocument.FindLast();
-
- // [Then] Document Id has been correctly set on E-Document, parsed from Integration response
- Assert.AreEqual(MockDocumentId(), EDocument."Continia Document Id", 'Continia integration failed to set Document Id on E-Document');
- // [Then] E-Document is "In Progress"
- Assert.AreEqual(Enum::"E-Document Status"::"In Progress", EDocument.Status, 'E-Document should be set to in progress');
-
- // [Then] eDocument Service Status has "Pending Response" and has correct logs
- Clear(EDocLogList);
- EDocLogList.Add(Enum::"E-Document Service Status"::Exported);
- EDocLogList.Add(Enum::"E-Document Service Status"::"Pending Response");
- TestEDocumentPage(EDocument, Enum::"E-Document Status"::"In Progress", Enum::"E-Document Service Status"::"Pending Response", EDocLogList, '', '');
-
- // [WHEN] Executing Get Response successfully
- ContiniaMockHttpHandler.ClearHandler();
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Get,
- ContiniaApiUrlMgt.TechnicalResponseUrl(MockDocumentId()),
- 200,
- GetMockResponseContent('TechnicalResponse200-Success.txt'));
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Post,
- ContiniaApiUrlMgt.DocumentActionUrl(MockDocumentId()),
- 200);
- RunGetResponseJob();
-
- // [When] EDocument is fetched after running Continia GetResponse
- EDocument.FindLast();
-
- // [Then] E-Document is considered processed
- Assert.AreEqual(Enum::"E-Document Status"::Processed, EDocument.Status, 'E-Document should be set to processed');
-
- // [Then] eDocument Service Status has Sent and has correct logs
- Clear(EDocLogList);
- EDocLogList.Add(Enum::"E-Document Service Status"::Exported);
- EDocLogList.Add(Enum::"E-Document Service Status"::"Pending Response");
- EDocLogList.Add(Enum::"E-Document Service Status"::Sent);
- TestEDocumentPage(EDocument, Enum::"E-Document Status"::Processed, Enum::"E-Document Service Status"::Sent, EDocLogList, '', '');
-
-
- // [Then] Open E-Document page and Get Approval
- ContiniaMockHttpHandler.ClearHandler();
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Get,
- ContiniaApiUrlMgt.BusinessResponseUrl(MockDocumentId()),
- 200,
- GetMockResponseContent('BusinessResponse200-noresponse.txt'));
- EDocumentPage.OpenView();
- EDocumentPage.GoToRecord(EDocument);
- EDocumentPage.GetApproval.Invoke();
- // EDocServicesPageHandler
- EDocumentPage.Close();
-
- // [When] EDocument is fetched after running Continia Send Document
- EDocument.FindLast();
-
- // [Then] E-Document is considered processed
- Assert.AreEqual(Enum::"E-Document Status"::Processed, EDocument.Status, 'E-Document should be set to processed');
-
- // [Then] eDocument Service Status has Sent and has correct logs
- Clear(EDocLogList);
- EDocLogList.Add(Enum::"E-Document Service Status"::Exported);
- EDocLogList.Add(Enum::"E-Document Service Status"::"Pending Response");
- EDocLogList.Add(Enum::"E-Document Service Status"::Sent);
- TestEDocumentPage(EDocument, Enum::"E-Document Status"::Processed, Enum::"E-Document Service Status"::Sent, EDocLogList, '', '');
- end;
-
- ///
- /// SubmitDocument_StatusInfo - Tests handling of responses without approval.
- /// This test ensures that if responses are received without any approval indication,
- /// the document is treated as though no approval has been received and remains in the "Sent" state.
- /// It validates that the system does not move the document to an "Approved" status
- /// without an explicit approval response.
- ///
- [Test]
- [HandlerFunctions('EDocServicesPageHandler,HttpClientHandler')]
- procedure SubmitDocument_StatusInfo()
- var
- EDocument: Record "E-Document";
- EDocumentPage: TestPage "E-Document";
- EDocLogList: List of [Enum "E-Document Service Status"];
- begin
- // Steps:
- // Pending response -> Sent -> Sent (StatusInfo)
- Initialize();
-
- // [Given] Team Member
- LibraryPermission.SetTeamMember();
-
- // [When] Posting invoice and EDocument is created
- LibraryEDocument.PostInvoice(Customer);
- EDocument.FindLast();
- ContiniaMockHttpHandler.ClearHandler();
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Post,
- StrSubstNo(DocumentUriPatternTok, ContiniaApiUrlMgt.CdnBaseUrl()),
- 200,
- GetMockResponseContent('SubmitDocument200.txt'));
- LibraryEDocument.RunEDocumentJobQueue(EDocument);
-
- // [When] EDocument is fetched after running Continia SubmitDocument
- EDocument.FindLast();
-
- // [Then] Document Id has been correctly set on E-Document, parsed from Integration response
- Assert.AreEqual(MockDocumentId(), EDocument."Continia Document Id", 'Continia integration failed to set Document Id on E-Document');
- // [Then] E-Document is "In Progress"
- Assert.AreEqual(Enum::"E-Document Status"::"In Progress", EDocument.Status, 'E-Document should be set to in progress');
-
- // [Then] eDocument Service Status has "Pending Response" and has correct logs
- Clear(EDocLogList);
- EDocLogList.Add(Enum::"E-Document Service Status"::Exported);
- EDocLogList.Add(Enum::"E-Document Service Status"::"Pending Response");
- TestEDocumentPage(EDocument, Enum::"E-Document Status"::"In Progress", Enum::"E-Document Service Status"::"Pending Response", EDocLogList, '', '');
-
- // [WHEN] Executing Get Response successfully
- ContiniaMockHttpHandler.ClearHandler();
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Get,
- ContiniaApiUrlMgt.TechnicalResponseUrl(MockDocumentId()),
- 200,
- GetMockResponseContent('TechnicalResponse200-Success.txt'));
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Post,
- ContiniaApiUrlMgt.DocumentActionUrl(MockDocumentId()),
- 200);
- RunGetResponseJob();
-
- // [When] EDocument is fetched after running Continia GetResponse
- EDocument.FindLast();
-
- // [Then] E-Document is considered processed
- Assert.AreEqual(Enum::"E-Document Status"::Processed, EDocument.Status, 'E-Document should be set to processed');
-
- // [Then] eDocument Service Status has Sent and has correct logs
- Clear(EDocLogList);
- EDocLogList.Add(Enum::"E-Document Service Status"::Exported);
- EDocLogList.Add(Enum::"E-Document Service Status"::"Pending Response");
- EDocLogList.Add(Enum::"E-Document Service Status"::Sent);
- TestEDocumentPage(EDocument, Enum::"E-Document Status"::Processed, Enum::"E-Document Service Status"::Sent, EDocLogList, '', '');
-
-
- // [Then] Open E-Document page and Get Approval
- ContiniaMockHttpHandler.ClearHandler();
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Get,
- ContiniaApiUrlMgt.BusinessResponseUrl(MockDocumentId()),
- 200,
- GetMockResponseContent('BusinessResponse200-multiple-statusinfo.txt'));
- EDocumentPage.OpenView();
- EDocumentPage.GoToRecord(EDocument);
- EDocumentPage.GetApproval.Invoke();
- // EDocServicesPageHandler
- EDocumentPage.Close();
-
- // [When] EDocument is fetched after running Continia Send Document
- EDocument.FindLast();
-
- // [Then] E-Document is considered processed
- Assert.AreEqual(Enum::"E-Document Status"::Processed, EDocument.Status, 'E-Document should be set to processed');
-
- // [Then] eDocument Service Status has Sent and has correct logs
- Clear(EDocLogList);
- EDocLogList.Add(Enum::"E-Document Service Status"::Exported);
- EDocLogList.Add(Enum::"E-Document Service Status"::"Pending Response");
- EDocLogList.Add(Enum::"E-Document Service Status"::Sent);
- TestEDocumentPage(EDocument, Enum::"E-Document Status"::Processed, Enum::"E-Document Service Status"::Sent, EDocLogList, '', '');
- end;
-
- ///
- /// SubmitDocument_Approved - Tests document status update upon approval.
- /// This test ensures that when an approved response is received, the document status is updated
- /// from "Sent" to "Approved," validating proper handling and logging of approvals.
- ///
- [Test]
- [HandlerFunctions('EDocServicesPageHandler,HttpClientHandler')]
- procedure SubmitDocument_Approved()
- var
- EDocument: Record "E-Document";
- EDocumentPage: TestPage "E-Document";
- EDocLogList: List of [Enum "E-Document Service Status"];
- begin
- // Steps:
- // Pending response -> Sent -> Approved
- Initialize();
-
- // [Given] Team Member
- LibraryPermission.SetTeamMember();
-
- // [When] Posting invoice and EDocument is created
- LibraryEDocument.PostInvoice(Customer);
- EDocument.FindLast();
- ContiniaMockHttpHandler.ClearHandler();
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Post,
- StrSubstNo(DocumentUriPatternTok, ContiniaApiUrlMgt.CdnBaseUrl()),
- 200,
- GetMockResponseContent('SubmitDocument200.txt'));
- LibraryEDocument.RunEDocumentJobQueue(EDocument);
-
- // [When] EDocument is fetched after running Continia SubmitDocument
- EDocument.FindLast();
-
- // [Then] Document Id has been correctly set on E-Document, parsed from Integration response
- Assert.AreEqual(MockDocumentId(), EDocument."Continia Document Id", 'Continia integration failed to set Document Id on E-Document');
- // [Then] E-Document is "In Progress"
- Assert.AreEqual(Enum::"E-Document Status"::"In Progress", EDocument.Status, 'E-Document should be set to in progress');
-
- // [Then] eDocument Service Status has "Pending Response" and has correct logs
- Clear(EDocLogList);
- EDocLogList.Add(Enum::"E-Document Service Status"::Exported);
- EDocLogList.Add(Enum::"E-Document Service Status"::"Pending Response");
- TestEDocumentPage(EDocument, Enum::"E-Document Status"::"In Progress", Enum::"E-Document Service Status"::"Pending Response", EDocLogList, '', '');
-
- // [WHEN] Executing Get Response successfully
- ContiniaMockHttpHandler.ClearHandler();
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Get,
- ContiniaApiUrlMgt.TechnicalResponseUrl(MockDocumentId()),
- 200,
- GetMockResponseContent('TechnicalResponse200-Success.txt'));
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Post,
- ContiniaApiUrlMgt.DocumentActionUrl(MockDocumentId()),
- 200);
- RunGetResponseJob();
-
- // [When] EDocument is fetched after running Continia GetResponse
- EDocument.FindLast();
-
- // [Then] E-Document is considered processed
- Assert.AreEqual(Enum::"E-Document Status"::Processed, EDocument.Status, 'E-Document should be set to processed');
-
- // [Then] eDocument Service Status has Sent and has correct logs
- Clear(EDocLogList);
- EDocLogList.Add(Enum::"E-Document Service Status"::Exported);
- EDocLogList.Add(Enum::"E-Document Service Status"::"Pending Response");
- EDocLogList.Add(Enum::"E-Document Service Status"::Sent);
- TestEDocumentPage(EDocument, Enum::"E-Document Status"::Processed, Enum::"E-Document Service Status"::Sent, EDocLogList, '', '');
-
- // [Then] Open E-Document page and Get Approval
- ContiniaMockHttpHandler.ClearHandler();
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Get,
- ContiniaApiUrlMgt.BusinessResponseUrl(MockDocumentId()),
- 200,
- GetMockResponseContent('BusinessResponse200-multiple-accepted.txt'));
- EDocumentPage.OpenView();
- EDocumentPage.GoToRecord(EDocument);
- EDocumentPage.GetApproval.Invoke();
- // EDocServicesPageHandler
- EDocumentPage.Close();
-
- // [When] EDocument is fetched after running Continia Send Document
- EDocument.FindLast();
-
- // [Then] E-Document is considered processed
- Assert.AreEqual(Enum::"E-Document Status"::Processed, EDocument.Status, 'E-Document should be set to processed');
-
- // [Then] eDocument Service Status has Approved and has correct logs
- Clear(EDocLogList);
- EDocLogList.Add(Enum::"E-Document Service Status"::Exported);
- EDocLogList.Add(Enum::"E-Document Service Status"::"Pending Response");
- EDocLogList.Add(Enum::"E-Document Service Status"::Sent);
- EDocLogList.Add(Enum::"E-Document Service Status"::Approved);
- TestEDocumentPage(EDocument, Enum::"E-Document Status"::Processed, Enum::"E-Document Service Status"::Approved, EDocLogList, '', '');
- end;
-
- ///
- /// SubmitDocument_Rejected - Tests error handling for rejected documents with rejection reasons.
- /// This test validates that when the document is rejected by the API, it moves to an "Error" status
- /// with the rejection reason logged, ensuring accurate status updates for failed submissions.
- ///
- [Test]
- [HandlerFunctions('EDocServicesPageHandler,HttpClientHandler')]
- procedure SubmitDocument_Rejected()
- var
- EDocument: Record "E-Document";
- EDocumentPage: TestPage "E-Document";
- EDocLogList: List of [Enum "E-Document Service Status"];
- begin
- // Steps:
- // Pending response -> Sent -> Error (Rejected)
- Initialize();
-
- // [Given] Team Member
- LibraryPermission.SetTeamMember();
-
- // [When] Posting invoice and EDocument is created
- LibraryEDocument.PostInvoice(Customer);
- EDocument.FindLast();
- ContiniaMockHttpHandler.ClearHandler();
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Post,
- StrSubstNo(DocumentUriPatternTok, ContiniaApiUrlMgt.CdnBaseUrl()),
- 200,
- GetMockResponseContent('SubmitDocument200.txt'));
- LibraryEDocument.RunEDocumentJobQueue(EDocument);
-
- // [When] EDocument is fetched after running Continia SubmitDocument
- EDocument.FindLast();
-
- // [Then] Document Id has been correctly set on E-Document, parsed from Integration response
- Assert.AreEqual(MockDocumentId(), EDocument."Continia Document Id", 'Continia integration failed to set Document Id on E-Document');
- // [Then] E-Document is "In Progress"
- Assert.AreEqual(Enum::"E-Document Status"::"In Progress", EDocument.Status, 'E-Document should be set to in progress');
-
- // [Then] eDocument Service Status has "Pending Response" and has correct logs
- Clear(EDocLogList);
- EDocLogList.Add(Enum::"E-Document Service Status"::Exported);
- EDocLogList.Add(Enum::"E-Document Service Status"::"Pending Response");
- TestEDocumentPage(EDocument, Enum::"E-Document Status"::"In Progress", Enum::"E-Document Service Status"::"Pending Response", EDocLogList, '', '');
-
- // [WHEN] Executing Get Response successfully
- ContiniaMockHttpHandler.ClearHandler();
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Get,
- ContiniaApiUrlMgt.TechnicalResponseUrl(MockDocumentId()),
- 200,
- GetMockResponseContent('TechnicalResponse200-Success.txt'));
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Post,
- ContiniaApiUrlMgt.DocumentActionUrl(MockDocumentId()),
- 200);
- RunGetResponseJob();
-
- // [When] EDocument is fetched after running Continia GetResponse
- EDocument.FindLast();
-
- // [Then] E-Document is considered processed
- Assert.AreEqual(Enum::"E-Document Status"::Processed, EDocument.Status, 'E-Document should be set to processed');
-
- // [Then] eDocument Service Status has Sent and has correct logs
- Clear(EDocLogList);
- EDocLogList.Add(Enum::"E-Document Service Status"::Exported);
- EDocLogList.Add(Enum::"E-Document Service Status"::"Pending Response");
- EDocLogList.Add(Enum::"E-Document Service Status"::Sent);
- TestEDocumentPage(EDocument, Enum::"E-Document Status"::Processed, Enum::"E-Document Service Status"::Sent, EDocLogList, '', '');
-
-
- // [Then] Open E-Document page and Get Approval
- ContiniaMockHttpHandler.ClearHandler();
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Get,
- ContiniaApiUrlMgt.BusinessResponseUrl(MockDocumentId()),
- 200,
- GetMockResponseContent('BusinessResponse200-multiple-rejected.txt'));
- EDocumentPage.OpenView();
- EDocumentPage.GoToRecord(EDocument);
- EDocumentPage.GetApproval.Invoke();
- // EDocServicesPageHandler
- EDocumentPage.Close();
-
- // [When] EDocument is fetched after running Continia Send Document
- EDocument.FindLast();
-
- // [Then] E-Document is considered processed
- Assert.AreEqual(Enum::"E-Document Status"::Processed, EDocument.Status, 'E-Document should be set to processed');
-
- // [Then] eDocument Service Status is Processed and has correct logs
- Clear(EDocLogList);
- EDocLogList.Add(Enum::"E-Document Service Status"::Exported);
- EDocLogList.Add(Enum::"E-Document Service Status"::"Pending Response");
- EDocLogList.Add(Enum::"E-Document Service Status"::Sent);
- EDocLogList.Add(Enum::"E-Document Service Status"::Rejected);
- TestEDocumentPage(EDocument, Enum::"E-Document Status"::Processed, Enum::"E-Document Service Status"::Rejected, EDocLogList, 'Warning', 'Reason: PRI - Prices incorrect');
- end;
-
- ///
- /// SubmitDocument_GetApprovalServiceDown - Tests handling of approval retrieval when the service is down.
- /// This test simulates a scenario where the approval API is temporarily down, verifying that the document
- /// can be processed as "Sent" and retries approval retrieval once the service is available.
- ///
- [Test]
- [HandlerFunctions('EDocServicesPageHandler,HttpClientHandler')]
- procedure SubmitDocument_GetApprovalServiceDown()
- var
- EDocument: Record "E-Document";
- EDocumentPage: TestPage "E-Document";
- EDocLogList: List of [Enum "E-Document Service Status"];
- begin
- // Steps:
- // Pending response -> Sent -> Sent (Service Down)
- Initialize();
-
- // [Given] Team Member
- LibraryPermission.SetTeamMember();
-
- // [When] Posting invoice and EDocument is created
- LibraryEDocument.PostInvoice(Customer);
- EDocument.FindLast();
- ContiniaMockHttpHandler.ClearHandler();
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Post,
- StrSubstNo(DocumentUriPatternTok, ContiniaApiUrlMgt.CdnBaseUrl()),
- 200,
- GetMockResponseContent('SubmitDocument200.txt'));
- LibraryEDocument.RunEDocumentJobQueue(EDocument);
-
- // [When] EDocument is fetched after running Continia SubmitDocument
- EDocument.FindLast();
-
- // [Then] Document Id has been correctly set on E-Document, parsed from Integration response
- Assert.AreEqual(MockDocumentId(), EDocument."Continia Document Id", 'Continia integration failed to set Document Id on E-Document');
- // [Then] E-Document is "In Progress"
- Assert.AreEqual(Enum::"E-Document Status"::"In Progress", EDocument.Status, 'E-Document should be set to in progress');
-
- // [Then] eDocument Service Status has "Pending Response" and has correct logs
- Clear(EDocLogList);
- EDocLogList.Add(Enum::"E-Document Service Status"::Exported);
- EDocLogList.Add(Enum::"E-Document Service Status"::"Pending Response");
- TestEDocumentPage(EDocument, Enum::"E-Document Status"::"In Progress", Enum::"E-Document Service Status"::"Pending Response", EDocLogList, '', '');
-
- // [WHEN] Executing Get Response successfully
- ContiniaMockHttpHandler.ClearHandler();
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Get,
- ContiniaApiUrlMgt.TechnicalResponseUrl(MockDocumentId()),
- 200,
- GetMockResponseContent('TechnicalResponse200-Success.txt'));
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Post,
- ContiniaApiUrlMgt.DocumentActionUrl(MockDocumentId()),
- 200);
- RunGetResponseJob();
-
- // [When] EDocument is fetched after running Continia GetResponse
- EDocument.FindLast();
-
- // [Then] E-Document is considered processed
- Assert.AreEqual(Enum::"E-Document Status"::Processed, EDocument.Status, 'E-Document should be set to processed');
-
- // [Then] eDocument Service Status has Sent and has correct logs
- Clear(EDocLogList);
- EDocLogList.Add(Enum::"E-Document Service Status"::Exported);
- EDocLogList.Add(Enum::"E-Document Service Status"::"Pending Response");
- EDocLogList.Add(Enum::"E-Document Service Status"::Sent);
- TestEDocumentPage(EDocument, Enum::"E-Document Status"::Processed, Enum::"E-Document Service Status"::Sent, EDocLogList, '', '');
-
-
- // [Then] Open E-Document page and Get Approval
- ContiniaMockHttpHandler.ClearHandler();
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Get,
- ContiniaApiUrlMgt.BusinessResponseUrl(MockDocumentId()),
- 500,
- GetMockResponseContent('Common500.txt'));
- EDocumentPage.OpenView();
- EDocumentPage.GoToRecord(EDocument);
- EDocumentPage.GetApproval.Invoke();
- // EDocServicesPageHandler
- EDocumentPage.Close();
-
- // [When] EDocument is fetched after running Continia Send Document
- EDocument.FindLast();
-
- // [Then] E-Document is considered Processed
- Assert.AreEqual(Enum::"E-Document Status"::Processed, EDocument.Status, 'E-Document should be set to processed');
-
- // [Then] eDocument Service Status has Sent and has correct logs
- Clear(EDocLogList);
- EDocLogList.Add(Enum::"E-Document Service Status"::Exported);
- EDocLogList.Add(Enum::"E-Document Service Status"::"Pending Response");
- EDocLogList.Add(Enum::"E-Document Service Status"::Sent);
- TestEDocumentPage(EDocument, Enum::"E-Document Status"::Processed, Enum::"E-Document Service Status"::Sent, EDocLogList, '', '');
- end;
-
- ///
- /// ReceiveDocuments_SingleDocument - Tests receiving a single document and creating a Purchase Invoice.
- /// This test verifies that a single document is correctly received from the API and that a Purchase
- /// Invoice is created, linking the document to the correct vendor.
- ///
- [Test]
- [HandlerFunctions('HttpClientHandler')]
- procedure ReceiveDocuments_SingleDocument()
- var
- EDocument: Record "E-Document";
- PurchaseHeader: Record "Purchase Header";
- EDocServicePage: TestPage "E-Document Service";
- ReceiveDocumentsUri: Text;
- begin
- Initialize();
- // [Given] Empty E-Document table
- EDocument.DeleteAll();
-
- // [Given] Auto import job. Open and close E-Doc page creates auto import job due to setting
- EDocServicePage.OpenView();
- EDocServicePage.GoToRecord(EDocumentService);
- EDocServicePage."Resolve Unit Of Measure".SetValue(true);
- EDocServicePage."Lookup Item Reference".SetValue(true);
- EDocServicePage."Lookup Item GTIN".SetValue(false);
- EDocServicePage."Lookup Account Mapping".SetValue(false);
- EDocServicePage."Validate Line Discount".SetValue(false);
- EDocServicePage.Close();
-
- // [When] Manually fire job queue job to import Documents
- ContiniaMockHttpHandler.ClearHandler();
- ReceiveDocumentsUri :=
- StrSubstNo(
- ParticipationProfileDocumentsUriPatternTok,
- ContiniaApiUrlMgt.CdnBaseUrl(),
- Enum::"Continia E-Delivery Network"::Peppol,
- ConnectorLibrary.ParticipationId(),
- ConnectorLibrary.ActiveNetworkProfileId());
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Get,
- ReceiveDocumentsUri,
- 200,
- GetMockResponseContent('ReceiveDocuments.txt'));
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Get,
- StrSubstNo(DownloadUriPatternTok, ReceiveDocumentsUri),
- 200,
- GetMockResponseContent('ReceivePeppolInvoiceDocument200.txt'));
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Post,
- ContiniaApiUrlMgt.DocumentActionUrl('65DD7456-7A49-4382-9F76-1211FA8AD0BF'),
- 200);
-
- LibraryEDocument.RunImportJob();
-
- // Assert that we have Purchase Invoice created
-#pragma warning disable AA0210
- EDocument.SetRange("Document Type", EDocument."Document Type"::"Purchase Invoice");
- EDocument.SetRange("Bill-to/Pay-to No.", Vendor."No.");
-#pragma warning restore AA0210
- EDocument.FindLast();
- PurchaseHeader.Get(EDocument."Document Record ID");
- Assert.AreEqual(Vendor."No.", PurchaseHeader."Buy-from Vendor No.", 'Wrong Vendor');
- end;
-
- ///
- /// ReceiveDocuments_Peppol_MultipleEdocServices - Tests handling documents from multiple network profiles.
- /// This test ensures that only documents associated with the specified network profiles are imported.
- ///
- [Test]
- [HandlerFunctions('HttpClientHandler')]
- procedure ReceiveDocuments_Peppol_MultipleEdocServices()
- var
- ActivatedNetProf: Record "Continia Activated Net. Prof.";
- EDocument: Record "E-Document";
- Participation: Record "Continia Participation";
- EDocServicePage: TestPage "E-Document Service";
- ReceiveDocumentsUri, ActivatedNetProfIdText : Text;
- begin
- // Receive documents from multiple network profiles
- Initialize();
- ConnectorLibrary.CleanParticipations();
- ConnectorLibrary.PrepareParticipation(Participation, ActivatedNetProf, EDocumentService);
- ConnectorLibrary.AddActivatedNetworkProfile(Participation, ConnectorLibrary.NetworkProfileIdPeppolBis3Invoice(), CreateGuid(), ActivatedNetProf, EDocumentService.Code);
- // [Given] Empty E-Document table
- EDocument.DeleteAll();
-
- // [Given] Auto import job. Open and close E-Doc page creates auto import job due to setting
- EDocServicePage.OpenView();
- EDocServicePage.GoToRecord(EDocumentService);
- EDocServicePage."Resolve Unit Of Measure".SetValue(true);
- EDocServicePage."Lookup Item Reference".SetValue(true);
- EDocServicePage."Lookup Item GTIN".SetValue(false);
- EDocServicePage."Lookup Account Mapping".SetValue(false);
- EDocServicePage."Validate Line Discount".SetValue(false);
- EDocServicePage.Close();
-
- // [When] Manually fire job queue job to import Documents
- ContiniaMockHttpHandler.ClearHandler();
- ReceiveDocumentsUri :=
- StrSubstNo(
- ParticipationProfileDocumentsUriPatternTok,
- ContiniaApiUrlMgt.CdnBaseUrl(),
- Enum::"Continia E-Delivery Network"::Peppol,
- ConnectorLibrary.ParticipationId(),
- ConnectorLibrary.ActiveNetworkProfileId());
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Get,
- ReceiveDocumentsUri,
- 200,
- GetMockResponseContent('ReceiveDocuments.txt'));
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Get,
- StrSubstNo(DownloadUriPatternTok, ReceiveDocumentsUri),
- 200,
- GetMockResponseContent('ReceivePeppolInvoiceDocument200.txt'));
- ActivatedNetProfIdText := ActivatedNetProf.Id;
- ActivatedNetProfIdText := ActivatedNetProfIdText.TrimStart('{');
- ActivatedNetProfIdText := ActivatedNetProfIdText.TrimEnd('}');
- ReceiveDocumentsUri :=
- StrSubstNo(
- ParticipationProfileDocumentsUriPatternTok,
- ContiniaApiUrlMgt.CdnBaseUrl(),
- Enum::"Continia E-Delivery Network"::Peppol,
- ConnectorLibrary.ParticipationId(),
- ActivatedNetProfIdText);
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Get,
- ReceiveDocumentsUri,
- 200,
- GetMockResponseContent('ReceiveDocuments.txt'));
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Get,
- StrSubstNo(DownloadUriPatternTok, ReceiveDocumentsUri),
- 200,
- GetMockResponseContent('ReceivePeppolInvoiceDocument200.txt'));
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Post,
- ContiniaApiUrlMgt.DocumentActionUrl('65DD7456-7A49-4382-9F76-1211FA8AD0BF'),
- 200);
- LibraryEDocument.RunImportJob();
-
- // Assert that we have only 2 documents imported
- EDocument.FindLast();
- Assert.AreEqual(2, EDocument.Count, 'Wrong number of documents imported');
- end;
-
- local procedure Initialize()
- var
- CompanyInformation: Record "Company Information";
- ContiniaConnectionSetup: Record "Continia Connection Setup";
- PurchaseHeader: Record "Purchase Header";
- Currency: Record Currency;
- EnvironmentInfoTestLibrary: Codeunit "Environment Info Test Library";
- begin
- LibraryPermission.SetOutsideO365Scope();
- EnvironmentInfoTestLibrary.SetTestabilitySoftwareAsAService(true);
-
- ContiniaConnectionSetup.DeleteAll();
- ContiniaConnectionSetup.Init();
- ContiniaConnectionSetup.Insert(true);
-
- PurchaseHeader.DeleteAll();
-
- if IsInitialized then
- exit;
- LibraryEDocument.SetupStandardVAT();
- LibraryEDocument.SetupStandardSalesScenario(Customer, EDocumentService, Enum::"E-Document Format"::"PEPPOL BIS 3.0", Enum::"Service Integration"::Continia);
-
- LibraryEDocument.SetupStandardPurchaseScenario(Vendor, EDocumentService, Enum::"E-Document Format"::"PEPPOL BIS 3.0", Enum::"Service Integration"::Continia);
- CreateTestItem();
-
- EDocumentService.Validate("Auto Import", true);
- EDocumentService."Import Minutes between runs" := 10;
- EDocumentService."Import Start Time" := Time();
- EDocumentService.Modify();
-
- CompanyInformation.Get();
- CompanyInformation."VAT Registration No." := 'GB777777771';
- CompanyInformation.Modify();
-
- Vendor."VAT Registration No." := 'GB777777772';
- Vendor."Receive E-Document To" := Enum::"E-Document Type"::"Purchase Invoice";
- Vendor.Modify();
-
- // Use date and currency exchange rate in document that is loaded
- Currency.Init();
- Currency.Validate(Code, 'XYZ');
- if Currency.Insert(true) then
- LibraryERM.CreateExchangeRate('XYZ', DMY2Date(8, 4, 2024), 1, 1);
-
- ConnectorLibrary.PrepareParticipation(EDocumentService);
-
- IsInitialized := true;
- end;
-
- local procedure CreateTestItem()
- var
- Item: Record Item;
- ItemReference: Record "Item Reference";
- UnitofMeasure: Record "Unit of Measure";
- VATPostingSetup: Record "VAT Posting Setup";
- ItemNoTok: Label 'Item1', Locked = true;
- begin
- // Create a test item
- if Item.Get(ItemNoTok) then
- Item.Delete();
- LibraryEDocument.CreateGenericItem(Item);
- Item.Rename(ItemNoTok);
- Item.Description := 'LONDON Swivel Chair, blue';
-#pragma warning disable AA0210
- UnitofMeasure.SetRange("International Standard Code", TestItemIsoUomTok);
-#pragma warning restore AA0210
- UnitofMeasure.FindFirst();
- Item.Validate("Base Unit of Measure", UnitofMeasure.Code);
- Item.Modify(true);
- LibraryItemReference.CreateItemReferenceWithNo(ItemReference, ItemNoTok, Item."No.", Enum::"Item Reference Type"::Vendor, Vendor."No.");
- if not VATPostingSetup.GET(Vendor."VAT Bus. Posting Group", Item."VAT Prod. Posting Group") then begin
- VATPostingSetup.Init();
- VATPostingSetup."VAT Bus. Posting Group" := Vendor."VAT Bus. Posting Group";
- VATPostingSetup."VAT Prod. Posting Group" := Item."VAT Prod. Posting Group";
- VATPostingSetup."VAT %" := 20;
- VATPostingSetup."Tax Category" := 'S';
- VATPostingSetup.Insert();
- end;
- end;
-
- local procedure TestEDocumentPage(EDocument: Record "E-Document"; EDocumentStatus: Enum "E-Document Status"; EDocServiceStatus: Enum "E-Document Service Status"; EDocLogList: List of [Enum "E-Document Service Status"]; ErrorMessageType: Text; ErrorMessage: Text)
- var
- EDocumentPage: TestPage "E-Document";
- begin
- // [Then] Open E-Document page
- EDocumentPage.OpenView();
- EDocumentPage.GoToRecord(EDocument);
- Assert.AreEqual(Format(EDocumentStatus), EDocumentPage."Electronic Document Status".Value(), IncorrectValueErr);
- Assert.AreEqual(Format(EDocument.Direction::Outgoing), EDocumentPage.Direction.Value(), IncorrectValueErr);
- Assert.AreEqual(EDocument."Document No.", EDocumentPage."Document No.".Value(), IncorrectValueErr);
-
- // [Then] E-Document Service Status is correct
- Assert.AreEqual(EDocumentService.Code, EDocumentPage."Outbound E-Doc. Factbox"."E-Document Service Code".Value(), IncorrectValueErr);
- Assert.AreEqual(Format(EDocServiceStatus), EDocumentPage."Outbound E-Doc. Factbox".Status.Value(), IncorrectValueErr);
- Assert.AreEqual(Format(EDocLogList.Count), EDocumentPage."Outbound E-Doc. Factbox".Log.Value(), IncorrectValueErr);
-
- LibraryEDocument.AssertEDocumentLogs(EDocument, EDocumentService, EDocLogList);
-
- if (ErrorMessageType = '') and (ErrorMessage = '') then
- // [Then] E-Document Has no Errors or Warnings
- Assert.AreEqual(0, GetEDocumentErrorOrWarningsCount(EDocument), IncorrectValueErr)
- else begin
- // [Then] E-Document Errors and Warnings has correct status
- Assert.AreEqual(ErrorMessageType, EDocumentPage.ErrorMessagesPart."Message Type".Value(), IncorrectValueErr);
- Assert.AreEqual(ErrorMessage, EDocumentPage.ErrorMessagesPart.Description.Value(), IncorrectValueErr);
- end;
- EDocumentPage.Close();
- end;
-
- local procedure GetEDocumentErrorOrWarningsCount(EDocument: Record "E-Document"): Integer
- var
- EDocumentErrorHelper: Codeunit "E-Document Error Helper";
- begin
- exit(EDocumentErrorHelper.ErrorMessageCount(EDocument) + EDocumentErrorHelper.WarningMessageCount(EDocument))
- end;
-
- local procedure RunGetResponseJob()
- var
- JobQueueEntry: Record "Job Queue Entry";
- begin
- JobQueueEntry.FindJobQueueEntry(JobQueueEntry."Object Type to Run"::Codeunit, Codeunit::"E-Document Get Response");
- Codeunit.Run(Codeunit::"Job Queue Dispatcher", JobQueueEntry);
- LibraryJobQueue.RunJobQueueDispatcher(JobQueueEntry);
- end;
-
- local procedure MockDocumentId() DocumentId: Guid
- begin
- Evaluate(DocumentId, '{3fa85f64-5717-4562-b3fc-2c963f66afa6}');
- end;
-
- [ModalPageHandler]
- internal procedure EDocServicesPageHandler(var EDocServicesPage: TestPage "E-Document Services")
- begin
- EDocServicesPage.Filter.SetFilter(Code, EDocumentService.Code);
- EDocServicesPage.OK().Invoke();
- end;
-
- local procedure GetMockResponseContent(ResourceFileName: Text): Text
- begin
- exit(NavApp.GetResourceAsText(ResourceFileName, TextEncoding::UTF8));
- end;
-
- [HttpClientHandler]
- internal procedure HttpClientHandler(Request: TestHttpRequestMessage; var Response: TestHttpResponseMessage): Boolean
- begin
- if ContiniaMockHttpHandler.HandleAuthorization(Request, Response) then
- exit;
-
- Response := ContiniaMockHttpHandler.GetResponse(Request);
- end;
-
- var
- Customer: Record Customer;
- Vendor: Record Vendor;
- EDocumentService: Record "E-Document Service";
- LibraryEDocument: Codeunit "Library - E-Document";
- LibraryPermission: Codeunit "Library - Lower Permissions";
- LibraryJobQueue: Codeunit "Library - Job Queue";
- LibraryERM: Codeunit "Library - ERM";
- Assert: Codeunit Assert;
- LibraryItemReference: Codeunit "Library - Item Reference";
- ConnectorLibrary: Codeunit "Continia Connector Library";
- ContiniaMockHttpHandler: Codeunit "Continia Mock Http Handler";
- ContiniaApiUrlMgt: Codeunit "Continia Api Url";
- IsInitialized: Boolean;
- IncorrectValueErr: Label 'Wrong value';
- TestItemIsoUomTok: Label 'EA', Locked = true;
- DocumentUriPatternTok: Label '%1/documents.xml', Comment = '%1 - Base URL', Locked = true;
- ParticipationProfileDocumentsUriPatternTok: Label '%1/networks/%2/participations/%3/profiles/%4/documents.xml', Comment = '%1 - Base URL, %2- Participation Id, %3 - Profile Id', Locked = true;
- DownloadUriPatternTok: Label '%1/download/peppol', Comment = '%1 - Receive documents URI', Locked = true;
-}
diff --git a/Apps/W1/EDocumentConnectors/Continia/test/src/ContiniaMockHttpHandler.Codeunit.al b/Apps/W1/EDocumentConnectors/Continia/test/src/ContiniaMockHttpHandler.Codeunit.al
deleted file mode 100644
index ac5cf5e9d7..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/test/src/ContiniaMockHttpHandler.Codeunit.al
+++ /dev/null
@@ -1,164 +0,0 @@
-namespace Microsoft.EServices.EDocumentConnector.Continia;
-
-using System.Utilities;
-
-codeunit 148201 "Continia Mock Http Handler"
-{
- Access = Internal;
-
- var
- ResponseStatusCodes: Dictionary of [Text, Integer];
- ResponseContents: Dictionary of [Text, Text];
- ResponseHeaders: Dictionary of [Text, Dictionary of [Text, Text]];
- DefaultRequest: Boolean;
-
- internal procedure AddResponse(Method: HttpRequestType; RequestPath: Text; StatusCode: Integer; ResponseContent: Text; Headers: Dictionary of [Text, Text])
- begin
- if StrPos(RequestPath, '?') > 0 then
- RequestPath := CopyStr(RequestPath, 1, StrPos(RequestPath, '?') - 1);
-
- IncludeResponse(Method, RequestPath, StatusCode, ResponseContent, Headers);
- end;
-
- internal procedure AddResponseWithParameters(Method: HttpRequestType; RequestPath: Text; StatusCode: Integer; ResponseContent: Text; Headers: Dictionary of [Text, Text])
- begin
- IncludeResponse(Method, RequestPath, StatusCode, ResponseContent, Headers);
- end;
-
- internal procedure AddResponse(Method: HttpRequestType; RequestPath: Text; StatusCode: Integer; ResponseContent: Text)
- var
- Headers: Dictionary of [Text, Text];
- begin
- AddResponse(Method, RequestPath, StatusCode, ResponseContent, Headers);
- end;
-
- internal procedure AddResponse(Method: HttpRequestType; RequestPath: Text; StatusCode: Integer)
- begin
- AddResponse(Method, RequestPath, StatusCode, '');
- end;
-
- internal procedure AddResponse(StatusCode: Integer; ResponseContent: Text)
- begin
- AddResponse(HttpRequestType::Unknown, '', StatusCode, ResponseContent);
- end;
-
- internal procedure GetResponse(Request: TestHttpRequestMessage) HttpResponseMessage: TestHttpResponseMessage
- var
- DictionaryKey: Text;
- begin
- if DefaultRequest then
- DictionaryKey := ''
- else
- DictionaryKey := GetDictionaryKey(Request.Path, Request.RequestType);
- HttpResponseMessage := GetResponse(Request, DictionaryKey);
- end;
-
- internal procedure GetResponseWithParameters(Request: TestHttpRequestMessage) HttpResponseMessage: TestHttpResponseMessage
- var
- DictionaryKey: Text;
- begin
- if DefaultRequest then
- DictionaryKey := ''
- else
- DictionaryKey := GetDictionaryKeyWithParameters(Request);
- HttpResponseMessage := GetResponse(Request, DictionaryKey);
- end;
-
- internal procedure HandleAuthorization(Request: TestHttpRequestMessage; var HttpResponseMessage: TestHttpResponseMessage): Boolean
- var
- ContiniaApiUrlMgt: Codeunit "Continia Api Url";
- begin
- if Request.Path = ContiniaApiUrlMgt.ClientAccessTokenUrl() then begin
- HttpResponseMessage.HttpStatusCode := 200;
- HttpResponseMessage.Content.WriteFrom(NavApp.GetResourceAsText('OauthToken200.txt', TextEncoding::UTF8));
- exit(true);
- end;
- end;
-
- internal procedure ClearHandler();
- begin
- Clear(ResponseStatusCodes);
- Clear(ResponseContents);
- end;
-
- local procedure ReplaceContentPlaceholders(OriginalContent: Text; Uri: Text): Text
- var
- Regex: Codeunit Regex;
- UriSegments: List of [Text];
- ParticipationProfileId: Text;
- DownloadUriPatternTok: Label '%1/download', Comment = '%1 = Uri', Locked = true;
- begin
- if OriginalContent.Contains('{random.guid}') then
- OriginalContent := Regex.Replace(OriginalContent, '{random.guid}', Format(CreateGuid(), 0, 9));
-
- if OriginalContent.Contains('{fileDownloadUrl}') then
- OriginalContent := Regex.Replace(OriginalContent, '{fileDownloadUrl}', StrSubstNo(DownloadUriPatternTok, Uri));
-
- if OriginalContent.Contains('{participationProfileId.ToLower}') then begin
- UriSegments := Uri.Split('/');
- ParticipationProfileId := UriSegments.Get(UriSegments.IndexOf('profiles') + 1);
- if ParticipationProfileId.EndsWith('.xml') then
- ParticipationProfileId := ParticipationProfileId.Substring(1, StrLen(ParticipationProfileId) - 4);
- OriginalContent := Regex.Replace(OriginalContent, '{participationProfileId.ToLower}', ParticipationProfileId.ToLower());
- end;
- exit(OriginalContent);
- end;
-
- local procedure GetDictionaryKey(RequestPath: Text; Method: HttpRequestType) returnValue: Text
- var
- KeyPatternTok: Label '%1;%2', Comment = '%1 = Method, %2 = RequestPath', Locked = true;
- begin
- returnValue := StrSubstNo(KeyPatternTok, Format(Method), RequestPath).ToLower();
- end;
-
- local procedure GetDictionaryKeyWithParameters(Request: TestHttpRequestMessage) returnValue: Text
- var
- KeyPatternTok: Label '%1;%2?%3', Comment = '%1 = Method, %2 = RequestPath, %3 = Parameters', Locked = true;
- Parameters: Dictionary of [Text, Text];
- Parameter: Text;
- QueryParameters: TextBuilder;
- begin
- Parameters := Request.QueryParameters();
- foreach Parameter in Parameters.Keys() do begin
- if QueryParameters.Length() > 0 then
- QueryParameters.Append('&');
- if Parameters.Get(Parameter) = '' then
- QueryParameters.Append(Parameter)
- else
- QueryParameters.Append(Parameter + '=' + Parameters.Get(Parameter));
- end;
- returnValue := StrSubstNo(KeyPatternTok, Format(Request.RequestType), Request.Path, QueryParameters.ToText()).ToLower();
- end;
-
- local procedure IncludeResponse(Method: HttpRequestType; RequestPath: Text; StatusCode: Integer; ResponseContent: Text; Headers: Dictionary of [Text, Text])
- var
- DictionaryKey: Text;
- begin
- if (Method = Method::Unknown) and (RequestPath = '') then begin
- DefaultRequest := true;
- DictionaryKey := '';
- end else
- DictionaryKey := GetDictionaryKey(RequestPath, Method);
-
- ResponseStatusCodes.Add(DictionaryKey, StatusCode);
- ResponseContents.Add(DictionaryKey, ResponseContent);
- if Headers.Count() > 0 then
- ResponseHeaders.Add(DictionaryKey, Headers);
- end;
-
- local procedure GetResponse(var Request: TestHttpRequestMessage; DictionaryKey: Text) HttpResponseMessage: TestHttpResponseMessage
- var
- Headers: Dictionary of [Text, Text];
- HeaderName: Text;
- begin
- HttpResponseMessage.HttpStatusCode := ResponseStatusCodes.Get(DictionaryKey);
- HttpResponseMessage.Content().WriteFrom(ReplaceContentPlaceholders(ResponseContents.Get(DictionaryKey), Request.Path));
-
- if ResponseHeaders.ContainsKey(DictionaryKey) then begin
- Headers := ResponseHeaders.Get(DictionaryKey);
- foreach HeaderName in Headers.Keys() do
- HttpResponseMessage.Headers.Add(HeaderName, Headers.Get(HeaderName));
- end;
- Clear(DefaultRequest);
- end;
-}
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/test/src/ContiniaProfileSelection.PageExt.al b/Apps/W1/EDocumentConnectors/Continia/test/src/ContiniaProfileSelection.PageExt.al
deleted file mode 100644
index c89c17f35e..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/test/src/ContiniaProfileSelection.PageExt.al
+++ /dev/null
@@ -1,22 +0,0 @@
-namespace Microsoft.EServices.EDocumentConnector.Continia;
-
-pageextension 148200 "Continia Profile Selection" extends "Continia Profile Selection"
-{
-
- actions
- {
- addlast(Processing)
- {
- action(DeleteProfile)
- {
- Image = Delete;
- ToolTip = 'Delete Profile. Used for automated testing only';
- ApplicationArea = All;
- trigger OnAction()
- begin
- Rec.Delete();
- end;
- }
- }
- }
-}
\ No newline at end of file
diff --git a/Apps/W1/EDocumentConnectors/Continia/test/src/ContiniaRegIntegrTests.Codeunit.al b/Apps/W1/EDocumentConnectors/Continia/test/src/ContiniaRegIntegrTests.Codeunit.al
deleted file mode 100644
index 36177db85d..0000000000
--- a/Apps/W1/EDocumentConnectors/Continia/test/src/ContiniaRegIntegrTests.Codeunit.al
+++ /dev/null
@@ -1,1079 +0,0 @@
-namespace Microsoft.EServices.EDocumentConnector.Continia;
-
-using Microsoft.eServices.EDocument;
-using System.TestLibraries.Environment;
-using Microsoft.Sales.Customer;
-using Microsoft.eServices.EDocument.Integration;
-using Microsoft.Foundation.Company;
-
-codeunit 148204 "Continia Reg. Integr. Tests"
-{
- Subtype = Test;
- TestType = Uncategorized;
- TestHttpRequestPolicy = AllowOutboundFromHandler;
- Access = Internal;
-
- ///
- /// Scenario: This test verifies the complete advanced registration flow in the e-Document service.
- /// It ensures that the onboarding wizard navigates through all steps, validates mandatory fields,
- /// handles invalid credentials, and successfully registers a new participation with various document types.
- /// Additionally, it checks for the correct handling of external errors such as duplicate registrations in
- /// the Peppol network.
- ///
- [Test]
- [HandlerFunctions('HttpClientHandler')]
- procedure Registration_AdvancedFlow()
- var
- EDocServicePage: TestPage "E-Document Service";
- OnboardingGuide: TestPage "Continia Onboarding Guide";
- ExtConnectionSetup: TestPage "Continia Ext. Connection Setup";
- Participations: TestPage "Continia Participations";
- ParticipationAlreadyRegisteredPeppolErr: Label 'There is already a registration in Peppol network with the identifier type';
- begin
- Initialize();
-
- // [Given] Team Member + 'E-Doc. Core - Edit' permissions
- LibraryPermission.SetTeamMember();
- LibraryPermission.AddPermissionSet('E-Doc. Core - Edit');
-
- // [When] Open eDocument Service
- EDocServicePage.OpenView();
- EDocServicePage.GoToRecord(EDocumentService);
-
- // [When] Open Setup Service Integration
- ExtConnectionSetup.Trap();
- EDocServicePage.SetupServiceIntegration.Invoke();
-
- // [Then] Validate No Of Participations is 0
- Assert.AreEqual('0', ExtConnectionSetup.NoOfParticipations.Value, IncorrectValueErr);
-
- // [When] Click on Register New Participation and on CDN Onboarding Click Next
- OnboardingGuide.Trap();
- ExtConnectionSetup.RegisterNewParticipation.Invoke();
- OnboardingGuide.ActionNext.Invoke();
- Commit();
-
- // [Then] not set credentials and try click Next
- asserterror OnboardingGuide.ActionNext.Invoke();
- Assert.ExpectedError('Partner credentials for Continia PartnerZone are invalid or missing.');
-
- // [When] set Credential Click Next and expect Credentials are not correct
- OnboardingGuide.PartnerUserName.SetValue('PartnerUserName@contoso.com');
- OnboardingGuide.PartnerPassword.SetValue('PartnerPassword');
- ContiniaMockHttpHandler.ClearHandler();
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Post,
- ContiniaApiUrlMgt.PartnerAccessTokenUrl(),
- 200,
- GetMockResponseContent('PartnerZoneLogin200Incorrect.txt')
- );
- asserterror OnboardingGuide.ActionNext.Invoke();
-
- // [Then] check the error exists
- Assert.ExpectedError('Partner credentials for Continia PartnerZone are invalid or missing.');
-
- // [When] Click Next and expect Credentials are correct
- ContiniaMockHttpHandler.ClearHandler();
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Post,
- ContiniaApiUrlMgt.PartnerAccessTokenUrl(),
- 200,
- GetMockResponseContent('PartnerZoneLogin200.txt')
- );
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Post,
- ContiniaApiUrlMgt.ClientEnvironmentInitializeUrl(),
- 200,
- GetMockResponseContent('InitializeClient200.txt')
- );
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Post,
- ContiniaApiUrlMgt.PartnerZoneUrl(),
- 200,
- GetMockResponseContent('PartnerZoneConnect200.txt')
- );
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Get,
- ContiniaApiUrlMgt.NetworkIdentifiersUrl(Enum::"Continia E-Delivery Network"::Peppol, 1, 100),
- 200,
- GetMockResponseContent('PeppolNetworkIdTypes200.txt')
- );
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Get,
- ContiniaApiUrlMgt.NetworkIdentifiersUrl(Enum::"Continia E-Delivery Network"::Nemhandel, 1, 100),
- 200,
- GetMockResponseContent('NemhandelNetworkIdTypes200.txt')
- );
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Get,
- ContiniaApiUrlMgt.NetworkProfilesUrl(Enum::"Continia E-Delivery Network"::Peppol, 1, 100),
- 200,
- GetMockResponseContent('PeppolNetworkProfiles200.txt')
- );
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Get,
- ContiniaApiUrlMgt.NetworkProfilesUrl(Enum::"Continia E-Delivery Network"::Nemhandel, 1, 100),
- 200,
- GetMockResponseContent('NemhandelNetworkProfiles200.txt')
- );
-
- OnboardingGuide.ActionNext.Invoke();
- Commit();
-
- // [Then] Legal company information step opens and values are filled in correctly
- Assert.AreEqual(true, OnboardingGuide."Company Name".Visible(), 'Legal company information should be visible');
- Assert.AreEqual(CompanyInformation.Name, OnboardingGuide."Company Name".Value, IncorrectValueErr);
- Assert.AreEqual(CompanyInformation."VAT Registration No.", OnboardingGuide."VAT Registration No.".Value, IncorrectValueErr);
- Assert.AreEqual(CompanyInformation.Address, OnboardingGuide.Address.Value, IncorrectValueErr);
- Assert.AreEqual(CompanyInformation."Post Code", OnboardingGuide."Post Code".Value, IncorrectValueErr);
- Assert.AreEqual(CompanyInformation."Country/Region Code", OnboardingGuide."Country/Region Code".Value, IncorrectValueErr);
- Assert.AreEqual(false, OnboardingGuide.ActionNext.Enabled(), 'Next should be disabled');
-
- // [When] fill mandatory information
- OnboardingGuide."Signatory Name".SetValue('Signatory Name');
- OnboardingGuide."Signatory Email".SetValue('signatory@email.address');
- OnboardingGuide.LicenseTerms.SetValue(true);
-
- // [Then] Next is enabled
- Assert.AreEqual(true, OnboardingGuide.ActionNext.Enabled(), 'Next should be enabled');
-
- // [When] click Next
- OnboardingGuide.ActionNext.Invoke();
- Commit();
-
- // [Then] Company contact information step opens and Next is disabled
- Assert.AreEqual(false, OnboardingGuide."Company Name".Visible(), 'Legal company information should not be visible');
- Assert.AreEqual(true, OnboardingGuide.CompanyContactName.Visible(), 'Company company information should be visible');
- Assert.AreEqual(false, OnboardingGuide.ActionNext.Enabled(), 'Next should be disabled');
-
- // [When] fill mandatory information
- OnboardingGuide.CompanyContactName.SetValue('Company Contact Name');
- OnboardingGuide.CompanyContactVAT.SetValue('123456789');
- OnboardingGuide.CompanyContactAddress.SetValue('CompanyContact Address');
- OnboardingGuide.CompanyContactPostCode.SetValue('111222');
- OnboardingGuide.CompanyContactCounty.SetValue('Company Contact County');
- OnboardingGuide.CompanyContactCountryRegion.SetValue(CompanyInformation."Country/Region Code");
- OnboardingGuide.CompanyContactPersonName.SetValue('Contact Name');
- OnboardingGuide.CompanyContactPersonEmail.SetValue('contact@email.address');
- OnboardingGuide.CompanyContactPersonPhoneNo.SetValue('999888777');
-
- // [Then] Next is enabled
- Assert.AreEqual(true, OnboardingGuide.ActionNext.Enabled(), 'Next should be enabled');
-
- // [When] click Next
- OnboardingGuide.ActionNext.Invoke();
- Commit();
-
- // [Then] Participation Network registration details step opens
- Assert.AreEqual(false, OnboardingGuide.CompanyContactName.Visible(), 'Company company information should not be visible');
- Assert.AreEqual(true, OnboardingGuide.Network.Visible(), 'Participation Network registration details should be visible');
-
- // [When] click Next
- OnboardingGuide.ActionNext.Invoke();
- Commit();
-
- // [Then] Document Types selection step opens
- Assert.AreEqual(false, OnboardingGuide.Network.Visible(), 'Participation Network registration details should not be visible');
- Assert.AreEqual(true, OnboardingGuide.SendInvoiceCreditMemo.Visible(), 'Document Types selection should be visible');
-
- // [When] Select Document Types and Expect Participation registered externally and click Next
- OnboardingGuide.SendInvoiceCreditMemo.SetValue(true);
- OnboardingGuide.ReceiveInvoiceResponse.SetValue(true);
- OnboardingGuide.ReceiveOrder.SetValue(true);
- OnboardingGuide.SendOrderResponse.SetValue(true);
- OnboardingGuide.ReceiveInvoiceCreditMemo.SetValue(true);
- OnboardingGuide.SendInvoiceResponse.SetValue(true);
- OnboardingGuide.SendOrder.SetValue(true);
- OnboardingGuide.ReceiveOrderResponse.SetValue(true);
- ContiniaMockHttpHandler.ClearHandler();
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Get,
- ContiniaApiUrlMgt.ParticipationLookupUrl(
- Enum::"Continia E-Delivery Network"::Peppol,
- CopyStr(OnboardingGuide.IdentifierTypeDesc.Value, 1, 4),
- CopyStr(OnboardingGuide.CompanyIdentifierValue.Value, 1, 50)),
- 200,
- GetMockResponseContent('ParticipationLookup200-external.txt'));
-
- asserterror OnboardingGuide.ActionNext.Invoke();
-
- // [Then] check the error thrown
- Assert.ExpectedError(ParticipationAlreadyRegisteredPeppolErr);
-
- // [When] click Advanced Setup
- OnboardingGuide.ActionAdvancedSetup.Invoke();
- Commit();
-
- // [Then] Advanced Setup step opens
- Assert.AreEqual(false, OnboardingGuide.SendInvoiceCreditMemo.Visible(), 'Document Types selection should not be visible');
- Assert.AreEqual(true, OnboardingGuide.SelectProfilesPeppol."Profile Name".Visible(), 'Advanced Setup should be visible');
-
- // [When] assign E-Document Service Code on each record
- OnboardingGuide.SelectProfilesPeppol.First();
- repeat
- if OnboardingGuide.SelectProfilesPeppol."Profile Name".Value <> '' then
- OnboardingGuide.SelectProfilesPeppol."E-Document Service Code".SetValue(EDocumentService.Code);
- until not OnboardingGuide.SelectProfilesPeppol.Next();
-
- // [When] Participation registered externally and click Next
- asserterror OnboardingGuide.ActionNext.Invoke();
-
- // [Then] check the error thrown
- Assert.ExpectedError(ParticipationAlreadyRegisteredPeppolErr);
-
- // [When] Participation is not registered externally and click Next
- ContiniaMockHttpHandler.ClearHandler();
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Get,
- ContiniaApiUrlMgt.ParticipationLookupUrl(
- Enum::"Continia E-Delivery Network"::Peppol,
- CopyStr(OnboardingGuide.IdentifierTypeDesc.Value, 1, 4),
- CopyStr(OnboardingGuide.CompanyIdentifierValue.Value, 1, 50)),
- 200,
- GetMockResponseContent('ParticipationLookup200.txt'));
- OnboardingGuide.ActionNext.Invoke();
-
- // [Then] Last step opens
- Assert.AreEqual(false, OnboardingGuide.SelectProfilesPeppol."Profile Name".Visible(), 'Advanced Setup should not be visible');
- Assert.AreEqual(false, OnboardingGuide.ActionNext.Enabled(), 'Next must be disabled');
- Assert.AreEqual(true, OnboardingGuide.ActionFinish.Enabled(), 'Finish must be enabled');
-
- // [When] click Finish
- ContiniaMockHttpHandler.ClearHandler();
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Post,
- ContiniaApiUrlMgt.UpdateSubscriptionUrl(),
- 200,
- GetMockResponseContent('UpdateSubscription200.txt'));
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Post,
- ContiniaApiUrlMgt.GetAcceptCompanyLicenseUrl(),
- 200,
- GetMockResponseContent('AcceptCompanyLicense200.txt'));
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Post,
- ContiniaApiUrlMgt.ParticipationUrl(Enum::"Continia E-Delivery Network"::Peppol),
- 200,
- GetMockResponseContent('Participation200-Draft.txt'));
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Post,
- ContiniaApiUrlMgt.ParticipationProfilesUrl(Enum::"Continia E-Delivery Network"::Peppol, ConnectorLibrary.ParticipationId(true)),
- 200,
- GetMockResponseContent('ParticipationProfile200-randomId.txt'));
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Patch,
- ContiniaApiUrlMgt.SingleParticipationUrl(Enum::"Continia E-Delivery Network"::Peppol, ConnectorLibrary.ParticipationId(true)),
- 200,
- GetMockResponseContent('Participation200-InProcess.txt'));
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Get,
- ContiniaApiUrlMgt.SingleParticipationUrl(Enum::"Continia E-Delivery Network"::Peppol, ConnectorLibrary.ParticipationId(true)),
- 200,
- GetMockResponseContent('Participation200-InProcess.txt'));
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Get,
- ContiniaApiUrlMgt.ParticipationProfilesUrl(Enum::"Continia E-Delivery Network"::Peppol, ConnectorLibrary.ParticipationId(true), 1, 100),
- 200,
- GetMockResponseContent('ParticipationProfile200-randomId.txt'));
- OnboardingGuide.ActionFinish.Invoke();
- Commit();
-
- // [Then] Participation is created in pending state
- Assert.AreEqual('1', ExtConnectionSetup.NoOfParticipations.Value, IncorrectValueErr);
- Participations.Trap();
- ExtConnectionSetup.NoOfParticipations.Drilldown();
- Participations.First();
- Assert.AreEqual(Format(ConnectorLibrary.ParticipationId(true)).ToLower(), Participations.Id.Value, IncorrectValueErr);
- Assert.AreEqual(Format(Enum::"Continia Registration Status"::InProcess), Participations.RegistrationStatus.Value, IncorrectValueErr);
-
- // [Then] Activated network profiles created
- ValidateActivatedNetworkProfiles();
-
- ExtConnectionSetup.Close();
- EDocServicePage.Close();
- end;
-
- ///
- /// Scenario: This test confirms the correct process for unregistering a connected participation.
- /// It starts with a configured, connected participation and verifies the status change to "Disabled"
- /// upon successful unregistration, ensuring that the process is completed without errors.
- ///
- [Test]
- [HandlerFunctions('HttpClientHandler')]
- procedure Unregister_Connected()
- var
- Participation: Record "Continia Participation";
- EDocServicePage: TestPage "E-Document Service";
- ExtConnectionSetup: TestPage "Continia Ext. Connection Setup";
- Participations: TestPage "Continia Participations";
- begin
- Initialize();
-
- // [Given] Connected Participation
- ConnectorLibrary.PrepareParticipation(Participation);
- // [Given] Team Member + 'E-Doc. Core - Edit' permissions
- LibraryPermission.SetTeamMember();
- LibraryPermission.AddPermissionSet('E-Doc. Core - Edit');
-
- // [When] Open eDocument Service
- EDocServicePage.OpenView();
- EDocServicePage.GoToRecord(EDocumentService);
-
- // [When] Open Setup Service Integration
- ExtConnectionSetup.Trap();
- EDocServicePage.SetupServiceIntegration.Invoke();
- Commit();
-
- // [Then] Validate No Of Participations is 1
- Assert.AreEqual('1', ExtConnectionSetup.NoOfParticipations.Value, IncorrectValueErr);
-
- // [When] DrillDown on No of Participations
- Participations.Trap();
- ContiniaMockHttpHandler.ClearHandler();
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Get,
- ContiniaApiUrlMgt.SingleParticipationUrl(Enum::"Continia E-Delivery Network"::Peppol, Participation.Id),
- 200,
- GetMockResponseContent('Participation200-Connected.txt'));
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Get,
- ContiniaApiUrlMgt.ParticipationProfilesUrl(Enum::"Continia E-Delivery Network"::Peppol, Participation.Id, 1, 100),
- 200,
- GetMockResponseContent('ParticipationProfile200-randomId.txt'));
- ExtConnectionSetup.NoOfParticipations.Drilldown();
- Commit();
-
- // [Then] Participations Page opens with Connected participation
- Participations.First();
- Assert.AreEqual(Format(Enum::"Continia Registration Status"::Connected), Participations.RegistrationStatus.Value, IncorrectValueErr);
-
- // [When] click Unregister
- ContiniaMockHttpHandler.ClearHandler();
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Delete,
- ContiniaApiUrlMgt.SingleParticipationUrl(Enum::"Continia E-Delivery Network"::Peppol, Participation.Id),
- 202);
- Participations.DeleteParticipation.Invoke();
-
- // [Then] Participation status is Disabled
- Participations.First();
- Assert.AreEqual(Format(Enum::"Continia Registration Status"::Disabled), Participations.RegistrationStatus.Value, IncorrectValueErr);
-
- Participations.Close();
- ExtConnectionSetup.Close();
- EDocServicePage.Close();
- end;
-
- ///
- /// Scenario: This test case validates the behavior of unregistering a participation with the status "InProcess."
- /// The test confirms that the participation is properly deleted upon completion of the unregistering action,
- /// verifying that no residual records are left in the system.
- ///
- [Test]
- [HandlerFunctions('HttpClientHandler')]
- procedure Unregister_InProcess()
- var
- Participation: Record "Continia Participation";
- EDocServicePage: TestPage "E-Document Service";
- ExtConnectionSetup: TestPage "Continia Ext. Connection Setup";
- Participations: TestPage "Continia Participations";
- begin
- Initialize();
-
- // [Given] Connected Participation
- ConnectorLibrary.PrepareParticipation(Participation);
-
- // [Given] Team Member + 'E-Doc. Core - Edit' permissions
- LibraryPermission.SetTeamMember();
- LibraryPermission.AddPermissionSet('E-Doc. Core - Edit');
-
- // [When] Open eDocument Service
- EDocServicePage.OpenView();
- EDocServicePage.GoToRecord(EDocumentService);
-
- // [When] Open Setup Service Integration
- ExtConnectionSetup.Trap();
- EDocServicePage.SetupServiceIntegration.Invoke();
- Commit();
-
- // [Then] Validate No Of Participations is 1
- Assert.AreEqual('1', ExtConnectionSetup.NoOfParticipations.Value, IncorrectValueErr);
-
- // [When] DrillDown on No of Participations
- Participations.Trap();
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Get,
- ContiniaApiUrlMgt.SingleParticipationUrl(Enum::"Continia E-Delivery Network"::Peppol, Participation.Id),
- 200,
- GetMockResponseContent('Participation200-InProcess.txt'));
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Get,
- ContiniaApiUrlMgt.ParticipationProfilesUrl(Enum::"Continia E-Delivery Network"::Peppol, Participation.Id, 1, 100),
- 200,
- GetMockResponseContent('ParticipationProfile200-randomId.txt'));
- ExtConnectionSetup.NoOfParticipations.Drilldown();
- Commit();
-
- // [Then] Participations Page opens with InProcess participation
- Participations.First();
- Assert.AreEqual(Format(Enum::"Continia Registration Status"::InProcess), Participations.RegistrationStatus.Value, IncorrectValueErr);
-
- // [When] click Unregister
- ContiniaMockHttpHandler.ClearHandler();
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Delete,
- ContiniaApiUrlMgt.SingleParticipationUrl(Enum::"Continia E-Delivery Network"::Peppol, Participation.Id),
- 200);
- Participations.DeleteParticipation.Invoke();
-
- // [Then] Participation must be deleted
- Assert.AreEqual(false, Participations.First(), 'Participation must not be found');
-
- Participations.Close();
- ExtConnectionSetup.Close();
- EDocServicePage.Close();
- end;
-
- ///
- /// Scenario: This test evaluates the process of editing an existing participation to modify its profile direction.
- /// It ensures that changes are successfully applied and that the onboarding wizard navigates through the necessary steps,
- /// ending with a status verification of the updated profile direction.
- ///
- [Test]
- [HandlerFunctions('HttpClientHandler')]
- procedure EditParticipation_ChangeProfileDirection()
- var
- Participation: Record "Continia Participation";
- ActivatedNetProf: Record "Continia Activated Net. Prof.";
- EDocServicePage: TestPage "E-Document Service";
- ExtConnectionSetup: TestPage "Continia Ext. Connection Setup";
- Participations: TestPage "Continia Participations";
- OnboardingGuide: TestPage "Continia Onboarding Guide";
- begin
- Initialize();
-
- // [Given] Connected Participation with a profile
- ConnectorLibrary.PrepareParticipation(Participation, ActivatedNetProf, EDocumentService);
-
- // [Given] Configured Client Credentials
- ConnectorLibrary.InitiateClientCredentials();
-
- // [Given] Team Member + 'E-Doc. Core - Edit' permissions
- LibraryPermission.SetTeamMember();
- LibraryPermission.AddPermissionSet('E-Doc. Core - Edit');
-
- // [When] Open eDocument Service
- EDocServicePage.OpenView();
- EDocServicePage.GoToRecord(EDocumentService);
-
- // [When] Open Setup Service Integration
- ExtConnectionSetup.Trap();
- EDocServicePage.SetupServiceIntegration.Invoke();
- Commit();
-
- // [Then] Validate No Of Participations is 1
- Assert.AreEqual('1', ExtConnectionSetup.NoOfParticipations.Value, IncorrectValueErr);
-
- // [When] DrillDown on No of Participations
- Participations.Trap();
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Get,
- ContiniaApiUrlMgt.SingleParticipationUrl(Enum::"Continia E-Delivery Network"::Peppol, Participation.Id),
- 200,
- GetMockResponseContent('Participation200-Connected.txt'));
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Get,
- ContiniaApiUrlMgt.ParticipationProfilesUrl(Enum::"Continia E-Delivery Network"::Peppol, Participation.Id, 1, 100),
- 200,
- GetMockResponseContent('ParticipationProfile200-randomId.txt'));
- ExtConnectionSetup.NoOfParticipations.Drilldown();
- Commit();
-
- // [Then] Participations Page opens with Connected participation
- Participations.First();
- Assert.AreEqual(Format(Enum::"Continia Registration Status"::Connected), Participations.RegistrationStatus.Value, IncorrectValueErr);
-
- // [When] click Edit Participation
- OnboardingGuide.Trap();
- Participations.EditParticipation.Invoke();
-
- // [Then] Onboarding Wizard Legal company information step opens and values are filled in correctly
- Assert.AreEqual(true, OnboardingGuide."Company Name".Visible(), 'Legal company information should be visible');
- Assert.AreNotEqual('', OnboardingGuide."Company Name".Value, IncorrectValueErr);
- Assert.AreNotEqual('', OnboardingGuide."VAT Registration No.".Value, IncorrectValueErr);
- Assert.AreNotEqual('', OnboardingGuide.Address.Value, IncorrectValueErr);
- Assert.AreNotEqual('', OnboardingGuide."Post Code".Value, IncorrectValueErr);
- Assert.AreNotEqual('', OnboardingGuide."Country/Region Code".Value, IncorrectValueErr);
- Assert.AreNotEqual('', OnboardingGuide."Signatory Name".Value, IncorrectValueErr);
- Assert.AreNotEqual('', OnboardingGuide."Signatory Email".Value, IncorrectValueErr);
- Assert.AreEqual(false, OnboardingGuide.ActionNext.Enabled(), 'Next should be disabled');
-
- // [When] fill mandatory information
- OnboardingGuide.LicenseTerms.SetValue(true);
-
- // [Then] Next is enabled
- Assert.AreEqual(true, OnboardingGuide.ActionNext.Enabled(), 'Next should be enabled');
-
- // [When] click Next
- OnboardingGuide.ActionNext.Invoke();
- Commit();
-
- // [Then] Onboarding Wizard Advanced Setup step opens
- Assert.AreEqual(false, OnboardingGuide.PartnerUserName.Visible(), 'Partner Details should not be visible');
- Assert.AreEqual(true, OnboardingGuide.SelectProfilesPeppol."Profile Name".Visible(), 'Advanced Setup should be visible');
-
- // [When] Set participation profile direction to Outgoing and click Next
- OnboardingGuide.SelectProfilesPeppol.First();
- OnboardingGuide.SelectProfilesPeppol."Profile Direction".SetValue(Enum::"Continia Profile Direction"::Outbound);
-
- ContiniaMockHttpHandler.ClearHandler();
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Get,
- ContiniaApiUrlMgt.ParticipationLookupUrl(
- Enum::"Continia E-Delivery Network"::Peppol,
- CopyStr(OnboardingGuide.IdentifierTypeDesc.Value, 1, 4),
- CopyStr(OnboardingGuide.CompanyIdentifierValue.Value, 1, 50)),
- 200,
- GetMockResponseContent('ParticipationLookup200.txt'));
- OnboardingGuide.ActionNext.Invoke();
- Commit();
-
- // [Then] Last step opens
- Assert.AreEqual(false, OnboardingGuide.SelectProfilesPeppol."Profile Name".Visible(), 'Advanced Setup should not be visible');
- Assert.AreEqual(false, OnboardingGuide.ActionNext.Enabled(), 'Next must be disabled');
- Assert.AreEqual(true, OnboardingGuide.ActionFinish.Enabled(), 'Finish must be enabled');
-
- // [When] click Finish
- ContiniaMockHttpHandler.ClearHandler();
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Patch,
- ContiniaApiUrlMgt.UpdateSubscriptionUrl(),
- 200,
- GetMockResponseContent('Participation200-InProcess.txt'));
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Patch,
- ContiniaApiUrlMgt.SingleParticipationProfileUrl(Enum::"Continia E-Delivery Network"::Peppol, Participation.Id, ActivatedNetProf.Id),
- 200,
- GetMockResponseContent('ParticipationProfile-outgoing.txt'));
- OnboardingGuide.ActionFinish.Invoke();
- Commit();
-
- // [Then] Profile Direction is Outgoing
- ConnectorLibrary.GetActivatedNetworkProfile(ActivatedNetProf);
- Assert.AreEqual(Enum::"Continia Profile Direction"::Outbound, ActivatedNetProf."Profile Direction", IncorrectValueErr);
-
- Participations.Close();
- ExtConnectionSetup.Close();
- EDocServicePage.Close();
- end;
-
- ///
- /// Scenario: This test checks the functionality of adding an additional network profile to an existing participation.
- /// It confirms that the onboarding wizard proceeds through each step and that the newly added profile is correctly
- /// registered in the system, verifying that both activated and required profiles are present after completion.
- ///
- [Test]
- [HandlerFunctions('HandlePeppolInvoiceProfileSelection,HttpClientHandler')]
- procedure EditParticipation_AddProfile()
- var
- Participation: Record "Continia Participation";
- ActivatedNetProf: Record "Continia Activated Net. Prof.";
- EDocServicePage: TestPage "E-Document Service";
- ExtConnectionSetup: TestPage "Continia Ext. Connection Setup";
- Participations: TestPage "Continia Participations";
- OnboardingGuide: TestPage "Continia Onboarding Guide";
- NetworkProfileIds: List of [Guid];
- begin
- Initialize();
-
- // [Given] Connected Participation with a profile
- ConnectorLibrary.PrepareParticipation(Participation, ActivatedNetProf, EDocumentService);
-
- // [Given] Configured Client Credentials
- ConnectorLibrary.InitiateClientCredentials();
-
- // [Given] Team Member + 'E-Doc. Core - Edit' permissions
- LibraryPermission.SetTeamMember();
- LibraryPermission.AddPermissionSet('E-Doc. Core - Edit');
-
- // [When] Open eDocument Service
- EDocServicePage.OpenView();
- EDocServicePage.GoToRecord(EDocumentService);
-
- // [When] Open Setup Service Integration
- ExtConnectionSetup.Trap();
- EDocServicePage.SetupServiceIntegration.Invoke();
- Commit();
-
- // [Then] Validate No Of Participations is 1
- Assert.AreEqual('1', ExtConnectionSetup.NoOfParticipations.Value, IncorrectValueErr);
-
- // [When] DrillDown on No of Participations
- Participations.Trap();
- ContiniaMockHttpHandler.ClearHandler();
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Get,
- ContiniaApiUrlMgt.SingleParticipationUrl(Enum::"Continia E-Delivery Network"::Peppol, Participation.Id),
- 200,
- GetMockResponseContent('Participation200-Connected.txt'));
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Get,
- ContiniaApiUrlMgt.ParticipationProfilesUrl(Enum::"Continia E-Delivery Network"::Peppol, Participation.Id, 1, 100),
- 200,
- GetMockResponseContent('ParticipationProfile200-randomId.txt'));
- ExtConnectionSetup.NoOfParticipations.Drilldown();
- Commit();
-
- // [Then] Participations Page opens with Connected participation
- Participations.First();
- Assert.AreEqual(Format(Enum::"Continia Registration Status"::Connected), Participations.RegistrationStatus.Value, IncorrectValueErr);
-
- // [When] click Edit Participation
- OnboardingGuide.Trap();
- Participations.EditParticipation.Invoke();
-
- // [Then] Onboarding Wizard Legal company information step opens and values are filled in correctly
- Assert.AreEqual(true, OnboardingGuide."Company Name".Visible(), 'Legal company information should be visible');
- Assert.AreNotEqual('', OnboardingGuide."Company Name".Value, IncorrectValueErr);
- Assert.AreNotEqual('', OnboardingGuide."VAT Registration No.".Value, IncorrectValueErr);
- Assert.AreNotEqual('', OnboardingGuide.Address.Value, IncorrectValueErr);
- Assert.AreNotEqual('', OnboardingGuide."Post Code".Value, IncorrectValueErr);
- Assert.AreNotEqual('', OnboardingGuide."Country/Region Code".Value, IncorrectValueErr);
- Assert.AreNotEqual('', OnboardingGuide."Signatory Name".Value, IncorrectValueErr);
- Assert.AreNotEqual('', OnboardingGuide."Signatory Email".Value, IncorrectValueErr);
- Assert.AreEqual(false, OnboardingGuide.ActionNext.Enabled(), 'Next should be disabled');
-
- // [When] fill mandatory information
- OnboardingGuide.LicenseTerms.SetValue(true);
-
- // [Then] Next is enabled
- Assert.AreEqual(true, OnboardingGuide.ActionNext.Enabled(), 'Next should be enabled');
-
- // [When] click Next
- OnboardingGuide.ActionNext.Invoke();
- Commit();
-
- // [Then] Onboarding Wizard Advanced Setup step opens
- Assert.AreEqual(false, OnboardingGuide.PartnerUserName.Visible(), 'Partner Details should not be visible');
- Assert.AreEqual(true, OnboardingGuide.SelectProfilesPeppol."Profile Name".Visible(), 'Advanced Setup should be visible');
-
- // [When] Add participation profile and click Next
- ContiniaMockHttpHandler.ClearHandler();
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Get,
- ContiniaApiUrlMgt.ParticipationLookupUrl(
- Enum::"Continia E-Delivery Network"::Peppol,
- CopyStr(OnboardingGuide.IdentifierTypeDesc.Value, 1, 4),
- CopyStr(OnboardingGuide.CompanyIdentifierValue.Value, 1, 50)),
- 200,
- GetMockResponseContent('ParticipationLookup200.txt'));
- OnboardingGuide.SelectProfilesPeppol.New();
- OnboardingGuide.SelectProfilesPeppol."Profile Name".Lookup();
- // HandlePeppolInvoiceProfileSelection()
- OnboardingGuide.SelectProfilesPeppol."Profile Direction".SetValue(Enum::"Continia Profile Direction"::Both);
- OnboardingGuide.SelectProfilesPeppol."E-Document Service Code".SetValue(EDocumentService.Code);
- OnboardingGuide.ActionNext.Invoke();
- Commit();
-
- // [Then] Last step opens
- Assert.AreEqual(false, OnboardingGuide.SelectProfilesPeppol."Profile Name".Visible(), 'Advanced Setup should not be visible');
- Assert.AreEqual(false, OnboardingGuide.ActionNext.Enabled(), 'Next must be disabled');
- Assert.AreEqual(true, OnboardingGuide.ActionFinish.Enabled(), 'Finish must be enabled');
-
- // [When] click Finish
- ContiniaMockHttpHandler.ClearHandler();
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Post,
- ContiniaApiUrlMgt.ParticipationProfilesUrl(Enum::"Continia E-Delivery Network"::Peppol, Participation.Id),
- 200,
- GetMockResponseContent('ParticipationProfile200-randomId.txt'));
- OnboardingGuide.ActionFinish.Invoke();
- Commit();
-
- // [Then] Make sure all needed activated profiles exist
- NetworkProfileIds.Add(ConnectorLibrary.DefaultNetworkProfileId(true));
- NetworkProfileIds.Add(ConnectorLibrary.NetworkProfileIdPeppolBis3Invoice(true));
- TestActivatedNetworkProfiles(Participation, NetworkProfileIds, false);
-
- Participations.Close();
- ExtConnectionSetup.Close();
- EDocServicePage.Close();
- end;
-
- ///
- /// Scenario: This test verifies the process of removing a network profile from a participation.
- /// It checks that the onboarding wizard accurately reflects the deletion of the profile and that remaining
- /// active and required profiles are correctly identified, with no errors upon completion.
- ///
- [Test]
- [HandlerFunctions('HttpClientHandler')]
- procedure EditParticipation_RemoveProfile()
- var
- Participation: Record "Continia Participation";
- ActivatedNetProf: Record "Continia Activated Net. Prof.";
- EDocServicePage: TestPage "E-Document Service";
- ExtConnectionSetup: TestPage "Continia Ext. Connection Setup";
- Participations: TestPage "Continia Participations";
- OnboardingGuide: TestPage "Continia Onboarding Guide";
- NetworkProfileIds: List of [Guid];
- begin
- Initialize();
-
- // [Given] Connected Participation with 2 network profiles
- ConnectorLibrary.PrepareParticipation(Participation, ActivatedNetProf, EDocumentService);
- ConnectorLibrary.AddActivatedNetworkProfile(Participation, ConnectorLibrary.NetworkProfileIdPeppolBis3Invoice(), CreateGuid(), ActivatedNetProf, EDocumentService.Code);
-
- // [Given] Configured Client Credentials
- ConnectorLibrary.InitiateClientCredentials();
-
- // [Given] Team Member + 'E-Doc. Core - Edit' permissions
- LibraryPermission.SetTeamMember();
- LibraryPermission.AddPermissionSet('E-Doc. Core - Edit');
-
- // [When] Open eDocument Service
- EDocServicePage.OpenView();
- EDocServicePage.GoToRecord(EDocumentService);
-
- // [When] Open Setup Service Integration
- ExtConnectionSetup.Trap();
- EDocServicePage.SetupServiceIntegration.Invoke();
- Commit();
-
- // [Then] Validate No Of Participations is 1
- Assert.AreEqual('1', ExtConnectionSetup.NoOfParticipations.Value, IncorrectValueErr);
-
- // [When] DrillDown on No of Participations
- Participations.Trap();
- ContiniaMockHttpHandler.ClearHandler();
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Get,
- ContiniaApiUrlMgt.SingleParticipationUrl(Enum::"Continia E-Delivery Network"::Peppol, Participation.Id),
- 200,
- GetMockResponseContent('Participation200-Connected.txt'));
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Get,
- ContiniaApiUrlMgt.ParticipationProfilesUrl(Enum::"Continia E-Delivery Network"::Peppol, Participation.Id, 1, 100),
- 200,
- GetMockResponseContent('ParticipationProfile200-randomId.txt'));
- ExtConnectionSetup.NoOfParticipations.Drilldown();
- Commit();
-
- // [Then] Participations Page opens with Connected participation
- Participations.First();
- Assert.AreEqual(Format(Enum::"Continia Registration Status"::Connected), Participations.RegistrationStatus.Value, IncorrectValueErr);
-
- // [When] click Edit Participation
- OnboardingGuide.Trap();
- Participations.EditParticipation.Invoke();
-
- // [Then] Onboarding Wizard Legal company information step opens and values are filled in correctly
- Assert.AreEqual(true, OnboardingGuide."Company Name".Visible(), 'Legal company information should be visible');
- Assert.AreNotEqual('', OnboardingGuide."Company Name".Value, IncorrectValueErr);
- Assert.AreNotEqual('', OnboardingGuide."VAT Registration No.".Value, IncorrectValueErr);
- Assert.AreNotEqual('', OnboardingGuide.Address.Value, IncorrectValueErr);
- Assert.AreNotEqual('', OnboardingGuide."Post Code".Value, IncorrectValueErr);
- Assert.AreNotEqual('', OnboardingGuide."Country/Region Code".Value, IncorrectValueErr);
- Assert.AreNotEqual('', OnboardingGuide."Signatory Name".Value, IncorrectValueErr);
- Assert.AreNotEqual('', OnboardingGuide."Signatory Email".Value, IncorrectValueErr);
- Assert.AreEqual(false, OnboardingGuide.ActionNext.Enabled(), 'Next should be disabled');
-
- // [When] fill mandatory information
- OnboardingGuide.LicenseTerms.SetValue(true);
-
- // [Then] Next is enabled
- Assert.AreEqual(true, OnboardingGuide.ActionNext.Enabled(), 'Next should be enabled');
-
- // [When] click Next
- OnboardingGuide.ActionNext.Invoke();
- Commit();
-
- // [Then] Onboarding Wizard Advanced Setup step opens
- Assert.AreEqual(false, OnboardingGuide.PartnerUserName.Visible(), 'Partner Details should not be visible');
- Assert.AreEqual(true, OnboardingGuide.SelectProfilesPeppol."Profile Name".Visible(), 'Advanced Setup should be visible');
-
- // [When] Delete invoice participation profile and click Next
- ContiniaMockHttpHandler.ClearHandler();
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Get,
- ContiniaApiUrlMgt.ParticipationLookupUrl(
- Enum::"Continia E-Delivery Network"::Peppol,
- CopyStr(OnboardingGuide.IdentifierTypeDesc.Value, 1, 4),
- CopyStr(OnboardingGuide.CompanyIdentifierValue.Value, 1, 50)),
- 200,
- GetMockResponseContent('ParticipationLookup200.txt'));
- ConnectorLibrary.GetActivatedNetworkProfile(ConnectorLibrary.NetworkProfileIdPeppolBis3Invoice(), ActivatedNetProf);
- OnboardingGuide.SelectProfilesPeppol.GoToRecord(ActivatedNetProf);
- OnboardingGuide.SelectProfilesPeppol.DeleteProfile.Invoke();
- OnboardingGuide.ActionNext.Invoke();
- Commit();
-
- // [Then] Last step opens
- Assert.AreEqual(false, OnboardingGuide.SelectProfilesPeppol."Profile Name".Visible(), 'Advanced Setup should not be visible');
- Assert.AreEqual(false, OnboardingGuide.ActionNext.Enabled(), 'Next must be disabled');
- Assert.AreEqual(true, OnboardingGuide.ActionFinish.Enabled(), 'Finish must be enabled');
-
- // [When] click Finish
- ContiniaMockHttpHandler.ClearHandler();
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Delete,
- ContiniaApiUrlMgt.SingleParticipationProfileUrl(Enum::"Continia E-Delivery Network"::Peppol, Participation.Id, ActivatedNetProf.Id),
- 200);
- OnboardingGuide.ActionFinish.Invoke();
- Commit();
-
- // [Then] Make sure activated and disabled profiles exist
- NetworkProfileIds.Add(ConnectorLibrary.DefaultNetworkProfileId(true));
- TestActivatedNetworkProfiles(Participation, NetworkProfileIds, false);
- Clear(NetworkProfileIds);
- NetworkProfileIds.Add(ConnectorLibrary.NetworkProfileIdPeppolBis3Invoice(true));
- TestActivatedNetworkProfiles(Participation, NetworkProfileIds, true);
-
- Participations.Close();
- ExtConnectionSetup.Close();
- EDocServicePage.Close();
- end;
-
- ///
- /// Scenario: This test assesses the process of updating the VAT number for a registered participation.
- /// It verifies that the VAT change triggers the correct flow through the onboarding wizard and that the
- /// participation status is accurately updated to "In Process." Additionally, it checks for error handling
- /// when a participation is suspended.
- ///
- [Test]
- [HandlerFunctions('HttpClientHandler')]
- procedure EditParticipation_ChangeVat()
- var
- Participation: Record "Continia Participation";
- ActivatedNetProf: Record "Continia Activated Net. Prof.";
- EDocServicePage: TestPage "E-Document Service";
- ExtConnectionSetup: TestPage "Continia Ext. Connection Setup";
- Participations: TestPage "Continia Participations";
- OnboardingGuide: TestPage "Continia Onboarding Guide";
- begin
- Initialize();
-
- // [Given] Connected Participation with a profile
- ConnectorLibrary.PrepareParticipation(Participation, ActivatedNetProf, EDocumentService);
-
- // [Given] Configured Client Credentials
- ConnectorLibrary.InitiateClientCredentials();
-
- // [Given] Team Member + 'E-Doc. Core - Edit' permissions
- LibraryPermission.SetTeamMember();
- LibraryPermission.AddPermissionSet('E-Doc. Core - Edit');
-
- // [When] Open eDocument Service
- EDocServicePage.OpenView();
- EDocServicePage.GoToRecord(EDocumentService);
-
- // [When] Open Setup Service Integration
- ExtConnectionSetup.Trap();
- EDocServicePage.SetupServiceIntegration.Invoke();
- Commit();
-
- // [Then] Validate No Of Participations is 1
- Assert.AreEqual('1', ExtConnectionSetup.NoOfParticipations.Value, IncorrectValueErr);
-
- // [When] DrillDown on No of Participations
- Participations.Trap();
- ContiniaMockHttpHandler.ClearHandler();
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Get,
- ContiniaApiUrlMgt.SingleParticipationUrl(Enum::"Continia E-Delivery Network"::Peppol, Participation.Id),
- 200,
- GetMockResponseContent('Participation200-Connected.txt'));
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Get,
- ContiniaApiUrlMgt.ParticipationProfilesUrl(Enum::"Continia E-Delivery Network"::Peppol, Participation.Id, 1, 100),
- 200,
- GetMockResponseContent('ParticipationProfile200-randomId.txt'));
- ExtConnectionSetup.NoOfParticipations.Drilldown();
- Commit();
-
- // [Then] Participations Page opens with Connected participation
- Participations.First();
- Assert.AreEqual(Format(Enum::"Continia Registration Status"::Connected), Participations.RegistrationStatus.Value, IncorrectValueErr);
-
- // [When] click Edit Participation
- OnboardingGuide.Trap();
- Participations.EditParticipation.Invoke();
-
- // [Then] Onboarding Wizard Legal company information step opens and values are filled in correctly
- Assert.AreEqual(true, OnboardingGuide."Company Name".Visible(), 'Legal company information should be visible');
- Assert.AreNotEqual('', OnboardingGuide."Company Name".Value, IncorrectValueErr);
- Assert.AreNotEqual('', OnboardingGuide."VAT Registration No.".Value, IncorrectValueErr);
- Assert.AreNotEqual('', OnboardingGuide.Address.Value, IncorrectValueErr);
- Assert.AreNotEqual('', OnboardingGuide."Post Code".Value, IncorrectValueErr);
- Assert.AreNotEqual('', OnboardingGuide."Country/Region Code".Value, IncorrectValueErr);
- Assert.AreNotEqual('', OnboardingGuide."Signatory Name".Value, IncorrectValueErr);
- Assert.AreNotEqual('', OnboardingGuide."Signatory Email".Value, IncorrectValueErr);
- Assert.AreEqual(false, OnboardingGuide.ActionNext.Enabled(), 'Next should be disabled');
-
- // [When] Change VAT number and Accept License terms
- OnboardingGuide."VAT Registration No.".SetValue('111222334');
- OnboardingGuide.LicenseTerms.SetValue(true);
-
- // [Then] Next is enabled
- Assert.AreEqual(true, OnboardingGuide.ActionNext.Enabled(), 'Next should be enabled');
-
- // [When] click Next
- OnboardingGuide.ActionNext.Invoke();
- Commit();
-
- // [Then] Onboarding Wizard Advanced Setup step opens
- Assert.AreEqual(false, OnboardingGuide.PartnerUserName.Visible(), 'Partner Details should not be visible');
- Assert.AreEqual(true, OnboardingGuide.SelectProfilesPeppol."Profile Name".Visible(), 'Advanced Setup should be visible');
-
- // [When] click Next
- ContiniaMockHttpHandler.ClearHandler();
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Get,
- ContiniaApiUrlMgt.ParticipationLookupUrl(
- Enum::"Continia E-Delivery Network"::Peppol,
- CopyStr(OnboardingGuide.IdentifierTypeDesc.Value, 1, 4),
- CopyStr(OnboardingGuide.CompanyIdentifierValue.Value, 1, 50)),
- 200,
- GetMockResponseContent('ParticipationLookup200.txt'));
- OnboardingGuide.ActionNext.Invoke();
- Commit();
-
- // [Then] Last step opens
- Assert.AreEqual(false, OnboardingGuide.SelectProfilesPeppol."Profile Name".Visible(), 'Advanced Setup should not be visible');
- Assert.AreEqual(false, OnboardingGuide.ActionNext.Enabled(), 'Next must be disabled');
- Assert.AreEqual(true, OnboardingGuide.ActionFinish.Enabled(), 'Finish must be enabled');
-
- // [When] click Finish
- ContiniaMockHttpHandler.ClearHandler();
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Patch,
- ContiniaApiUrlMgt.SingleParticipationUrl(Enum::"Continia E-Delivery Network"::Peppol, Participation.Id),
- 200,
- GetMockResponseContent('Participation200-Suspended.txt'));
- OnboardingGuide.ActionFinish.Invoke();
- Commit();
-
- // [Then] Participation registration status is In Process
- ConnectorLibrary.GetParticipation(Participation);
- Assert.AreEqual(Enum::"Continia Registration Status"::InProcess, Participation."Registration Status", IncorrectValueErr);
-
- // [When] Participations Page close and open again
- Participations.Close();
- ContiniaMockHttpHandler.ClearHandler();
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Get,
- ContiniaApiUrlMgt.SingleParticipationUrl(Enum::"Continia E-Delivery Network"::Peppol, Participation.Id),
- 200,
- GetMockResponseContent('Participation200-Suspended.txt'));
- ContiniaMockHttpHandler.AddResponse(
- HttpRequestType::Get,
- ContiniaApiUrlMgt.ParticipationProfilesUrl(Enum::"Continia E-Delivery Network"::Peppol, Participation.Id, 1, 100),
- 404,
- GetMockResponseContent('Common404.txt'));
- asserterror ExtConnectionSetup.NoOfParticipations.Drilldown();
-
- // [Then] Error appears, since Participation is not found
- Assert.ExpectedError(Response404ErrorMessageLbl);
-
- ExtConnectionSetup.Close();
- EDocServicePage.Close();
- end;
-
- local procedure TestActivatedNetworkProfiles(Participation: Record "Continia Participation"; NetworkProfileIds: List of [Guid]; Disabled: Boolean)
- var
- ActivatedNetProf: Record "Continia Activated Net. Prof.";
- UnexpectedProfileFoundErr: Label 'Unexpected Activated Network Profile %1 was found', Comment = '%1 - Network Profile Id';
- begin
- ActivatedNetProf.SetRange(Network, Participation.Network);
- ActivatedNetProf.SetRange("Identifier Type Id", Participation."Identifier Type Id");
- ActivatedNetProf.SetRange("Identifier Value", Participation."Identifier Value");
- if Disabled then
- ActivatedNetProf.SetFilter(Disabled, '<>%1', 0DT)
- else
- ActivatedNetProf.SetRange(Disabled, 0DT);
- Assert.AreEqual(NetworkProfileIds.Count, ActivatedNetProf.Count, IncorrectValueErr);
- if ActivatedNetProf.IsEmpty then
- exit;
- ActivatedNetProf.FindSet();
- repeat
- Assert.AreEqual(true, NetworkProfileIds.Contains(ActivatedNetProf."Network Profile Id"), StrSubstNo(UnexpectedProfileFoundErr, ActivatedNetProf."Network Profile Id"));
- until ActivatedNetProf.Next() = 0;
- end;
-
- [ModalPageHandler]
- internal procedure HandlePeppolInvoiceProfileSelection(var NetworkProfileList: TestPage "Continia Network Profile List")
- var
- NetworkProfile: Record "Continia Network Profile";
- begin
- NetworkProfile.Get(ConnectorLibrary.NetworkProfileIdPeppolBis3Invoice());
- NetworkProfileList.GoToRecord(NetworkProfile);
- NetworkProfileList.OK().Invoke();
- end;
-
- local procedure Initialize()
- begin
- LibraryPermission.SetOutsideO365Scope();
-
- ConnectorLibrary.ClearClientCredentials();
- ConnectorLibrary.CleanParticipations();
-
- if IsInitialized then
- exit;
- EnvironmentInfoTestLibrary.SetTestabilitySoftwareAsAService(true);
-
- LibraryEDocument.SetupStandardVAT();
- LibraryEDocument.SetupStandardSalesScenario(Customer, EDocumentService, Enum::"E-Document Format"::"PEPPOL BIS 3.0", Enum::"Service Integration"::Continia);
- CompanyInformation.Get();
- CompanyInformation."Country/Region Code" := 'GB';
- CompanyInformation.Modify(false);
-
- IsInitialized := true;
- end;
-
- local procedure ValidateActivatedNetworkProfiles()
- var
- Participation: Record "Continia Participation";
- ActivatedNetProf: Record "Continia Activated Net. Prof.";
- NetworkProfile: Record "Continia Network Profile";
- begin
- Participation.FindFirst();
- ActivatedNetProf.FindSet();
- repeat
- Assert.AreEqual(Participation.Network, ActivatedNetProf.Network, 'Activated Network Profile Network field value is incorrect');
- Assert.AreEqual(Participation."Identifier Type Id", ActivatedNetProf."Identifier Type Id", 'Activated Network Profile "Identifier Type Id" field value is incorrect');
- Assert.AreEqual(Participation."Identifier Value", ActivatedNetProf."Identifier Value", 'Activated Network Profile "Identifier Value" field value is incorrect');
- Assert.AreEqual(Enum::"Continia Profile Direction"::Both, ActivatedNetProf."Profile Direction", 'Activated Network Profile "Profile Direction" field value is incorrect');
- ActivatedNetProf.TestField(Created);
- ActivatedNetProf.TestField(Updated);
- NetworkProfile.Get(ActivatedNetProf."Network Profile Id");
- until ActivatedNetProf.Next() = 0;
- end;
-
- local procedure GetMockResponseContent(ResourceFileName: Text): Text
- begin
- exit(NavApp.GetResourceAsText(ResourceFileName, TextEncoding::UTF8));
- end;
-
- [HttpClientHandler]
- internal procedure HttpClientHandler(Request: TestHttpRequestMessage; var Response: TestHttpResponseMessage): Boolean
- begin
- if ContiniaMockHttpHandler.HandleAuthorization(Request, Response) then
- exit;
-
- Response := ContiniaMockHttpHandler.GetResponse(Request);
- end;
-
- var
- CompanyInformation: Record "Company Information";
- Customer: Record Customer;
- EDocumentService: Record "E-Document Service";
- LibraryEDocument: Codeunit "Library - E-Document";
- LibraryPermission: Codeunit "Library - Lower Permissions";
- Assert: Codeunit Assert;
- ContiniaMockHttpHandler: Codeunit "Continia Mock Http Handler";
- ContiniaApiUrlMgt: Codeunit "Continia Api Url";
- EnvironmentInfoTestLibrary: Codeunit "Environment Info Test Library";
- ConnectorLibrary: Codeunit "Continia Connector Library";
- IsInitialized: Boolean;
- IncorrectValueErr: Label 'Wrong value';
- Response404ErrorMessageLbl: Label 'The Continia Delivery Network API returned the following error: Error Code Not Found - Not Found';
-}
diff --git a/Apps/W1/MasterDataManagement/app/src/codeunits/MasterDataMgtSubscribers.Codeunit.al b/Apps/W1/MasterDataManagement/app/src/codeunits/MasterDataMgtSubscribers.Codeunit.al
index 7b80fde7da..481e3a3c22 100644
--- a/Apps/W1/MasterDataManagement/app/src/codeunits/MasterDataMgtSubscribers.Codeunit.al
+++ b/Apps/W1/MasterDataManagement/app/src/codeunits/MasterDataMgtSubscribers.Codeunit.al
@@ -83,7 +83,6 @@ codeunit 7237 "Master Data Mgt. Subscribers"
end else
JobQueueEntry.Status := JobQueueEntry.Status::Ready;
FeatureTelemetry.LogUptake('0000OUA', MasterDataManagement.GetFeatureName(), Enum::"Feature Uptake Status"::Used);
- FeatureTelemetry.LogUsage('0000JIR', MasterDataManagement.GetFeatureName(), 'Synch job finished');
if IntegrationTableMapping.IsFullSynch() then begin
Session.LogMessage('0000JIS', StrSubstNo(RunningFullSynchTelemetryTxt, IntegrationTableMapping.Name), Verbosity::Normal, DataClassification::SystemMetadata, TelemetryScope::ExtensionPublisher, 'Category', MasterDataManagement.GetTelemetryCategory());
OriginalIntegrationTableMapping.SetRange(Status, IntegrationTableMapping.Status::Enabled);
@@ -301,9 +300,6 @@ codeunit 7237 "Master Data Mgt. Subscribers"
if IntegrationFieldMapping."Overwrite Local Change" or IntegrationTableMapping."Overwrite Local Change" or (IntegrationFieldMapping.Status = IntegrationFieldMapping.Status::Disabled) then
ThrowError := false;
end;
-
- Session.LogMessage('0000JIT', DestinationRecordRef.Caption(), Verbosity::Normal, DataClassification::SystemMetadata, TelemetryScope::ExtensionPublisher, 'Category', MasterDataManagement.GetTelemetryCategory());
- Session.LogMessage('0000JIU', DestinationRecordRef.Caption() + '.' + DestinationFieldRef.Caption(), Verbosity::Normal, DataClassification::SystemMetadata, TelemetryScope::ExtensionPublisher, 'Category', MasterDataManagement.GetTelemetryCategory());
end;
if ThrowError then
Error(ValueWillBeOverwrittenErr, DestinationFieldRef.Caption(), Format(DestinationFieldRef.Record().RecordId()), Format(SourceFieldRef.Value()), Format(DestinationFieldRef.Record().Caption()));
diff --git a/Apps/W1/ReviewGLEntries/app/src/codeunits/ReviewGLEntry.Codeunit.al b/Apps/W1/ReviewGLEntries/app/src/codeunits/ReviewGLEntry.Codeunit.al
index 30cf18bb21..17f8df1be3 100644
--- a/Apps/W1/ReviewGLEntries/app/src/codeunits/ReviewGLEntry.Codeunit.al
+++ b/Apps/W1/ReviewGLEntries/app/src/codeunits/ReviewGLEntry.Codeunit.al
@@ -44,7 +44,10 @@ codeunit 22200 "Review G/L Entry" implements "G/L Entry Reviewer"
GLEntryReviewLog."G/L Entry No." := GLEntry."Entry No.";
GLEntryReviewLog."Reviewed Identifier" := Identifier;
GLEntryReviewLog."Reviewed By" := UserName;
- GLEntryReviewLog."Reviewed Amount" := GLEntry."Amount to Review";
+ if GLEntry."Amount to Review" = 0 then
+ GLEntryReviewLog."Reviewed Amount" := GLEntry.Amount
+ else
+ GLEntryReviewLog."Reviewed Amount" := GLEntry."Amount to Review";
GLEntryReviewLog."G/L Account No." := GLEntry."G/L Account No.";
GLEntryReviewLog.Insert(true);
@@ -117,14 +120,17 @@ codeunit 22200 "Review G/L Entry" implements "G/L Entry Reviewer"
var
Balance: Decimal;
begin
- if not GLEntry.IsEmpty() and (GLEntry."Amount to Review" = 0) then begin
- GLEntry.CalcSums("Debit Amount", "Credit Amount");
- Balance := GLEntry."Credit Amount" - GLEntry."Debit Amount";
- end else
- repeat
- Balance := Balance + GLEntry."Amount to Review";
- until GLEntry.Next() = 0;
-
+ GLEntry.SetLoadFields("Amount to Review", "Debit Amount", "Credit Amount");
+ if GLEntry.IsEmpty() then
+ exit(true);
+
+ GLEntry.SetRange("Amount to Review", 0);
+ GLEntry.CalcSums("Debit Amount", "Credit Amount");
+ Balance := GLEntry."Credit Amount" - GLEntry."Debit Amount";
+ GLEntry.SetFilter("Amount to Review", '<>0');
+ GLEntry.CalcSums("Amount to Review");
+ Balance += GLEntry."Amount to Review";
+ GLEntry.SetRange("Amount to Review");
exit(Balance = 0);
end;
diff --git a/Apps/W1/ReviewGLEntries/app/src/codeunits/Upgrade.Codeunit.al b/Apps/W1/ReviewGLEntries/app/src/codeunits/Upgrade.Codeunit.al
index 1b97f5409c..7ae53dda5b 100644
--- a/Apps/W1/ReviewGLEntries/app/src/codeunits/Upgrade.Codeunit.al
+++ b/Apps/W1/ReviewGLEntries/app/src/codeunits/Upgrade.Codeunit.al
@@ -6,10 +6,37 @@ codeunit 22201 "Upgrade"
{
Access = Internal;
Subtype = Upgrade;
+ Permissions = TableData "G/L Entry" = rimd;
trigger OnUpgradePerCompany()
begin
MovetoGLEntryReviewLog();
+ FixGLEntryReviewLogWithReviewAmountZero();
+ end;
+
+ local procedure FixGLEntryReviewLogWithReviewAmountZero()
+ var
+
+ GLEntryReviewLog: Record "G/L Entry Review Log";
+ GlEntry: Record "G/L Entry";
+ UpgradeTag: Codeunit "Upgrade Tag";
+ begin
+ if UpgradeTag.HasUpgradeTag(UpgradeFixGLEntryReviewLogWithReviewedAmountZeroTag()) then exit;
+
+ GLEntryReviewLog.SetCurrentKey("Reviewed Amount");
+ GLEntryReviewLog.SetRange("Reviewed Amount", 0);
+ if GLEntryReviewLog.FindSet() then
+ repeat
+ if GlEntry.Get(GLEntryReviewLog."G/L Entry No.") then begin
+ GLEntryReviewLog."Reviewed Amount" := GlEntry.Amount;
+ if not GLEntryReviewLog.Modify(false) then begin
+ Session.LogMessage('0000QUR', 'Failed upgrading G/L Entry Review Log with Reviewed Amount Zero', Verbosity::Error, DataClassification::SystemMetadata, TelemetryScope::ExtensionPublisher, 'Category', 'Review G/L Entries');
+ exit;
+ end;
+ end;
+ until GLEntryReviewLog.Next() = 0;
+
+ UpgradeTag.SetUpgradeTag(UpgradeFixGLEntryReviewLogWithReviewedAmountZeroTag());
end;
local procedure MovetoGLEntryReviewLog()
@@ -37,15 +64,20 @@ codeunit 22201 "Upgrade"
UpgradeTag.SetUpgradeTag(UpgradeReviewGLEntryTag());
end;
-
[EventSubscriber(ObjectType::Codeunit, Codeunit::"Upgrade Tag", 'OnGetPerCompanyUpgradeTags', '', false, false)]
local procedure RegisterPerCompanyTags(var PerCompanyUpgradeTags: List of [Code[250]])
begin
PerCompanyUpgradeTags.Add(UpgradeReviewGLEntryTag());
+ PerCompanyUpgradeTags.Add(UpgradeFixGLEntryReviewLogWithReviewedAmountZeroTag());
end;
local procedure UpgradeReviewGLEntryTag(): Code[250]
begin
exit('MS-547765-UpdateReviewGLEntry-20250704');
end;
+
+ local procedure UpgradeFixGLEntryReviewLogWithReviewedAmountZeroTag(): Code[250]
+ begin
+ exit('MS-616473-UpgradeFixGLEntryReviewLogWithReviewedAmountZeroTag-20251216');
+ end;
}
\ No newline at end of file
diff --git a/Apps/W1/ReviewGLEntries/app/src/pages/ReviewGLEntries.Page.al b/Apps/W1/ReviewGLEntries/app/src/pages/ReviewGLEntries.Page.al
index a9c6336bc1..f779e9e6a1 100644
--- a/Apps/W1/ReviewGLEntries/app/src/pages/ReviewGLEntries.Page.al
+++ b/Apps/W1/ReviewGLEntries/app/src/pages/ReviewGLEntries.Page.al
@@ -80,7 +80,7 @@ page 22207 "Review G/L Entries"
Editable = false;
ToolTip = 'Specifies a code for the ID when you set entries as reviewed.';
AboutTitle = 'About Reviewer?';
- AboutText = 'When an entry has been marked as reviewed, you can see the name of that person';
+ AboutText = 'When an entry has been marked as reviewed, you can see the name of that person.';
}
field("Reviewed Date"; Rec."Reviewed Date")
{
@@ -88,11 +88,16 @@ page 22207 "Review G/L Entries"
Editable = false;
ToolTip = 'Specifies the time when the ledger entries were reviewed.';
AboutTitle = 'About Reviewed Date?';
- AboutText = 'When an entry has been marked as reviewed, you can see the date on which it was done';
+ AboutText = 'When an entry has been marked as reviewed, you can see the date on which it was done.';
}
field("Amount to Review"; Rec."Amount to Review")
{
ApplicationArea = Basic, Suite;
+ Caption = 'Amount to Review';
+ BlankZero = true;
+ ToolTip = 'Specifies the amount that you want to review for the entry. Leaving this field blank or setting it to zero indicates that the entire amount is to be reviewed.';
+ AboutTitle = 'About Amount to Review?';
+ AboutText = 'When only a part of an entry amount is to be reviewed, set that custom amount in this field.';
trigger OnValidate()
begin
@@ -108,7 +113,7 @@ page 22207 "Review G/L Entries"
ApplicationArea = Basic, Suite;
Caption = 'Remaining Amount';
Editable = false;
- ToolTip = 'Specifies the remaining amount that can be applied to the entry.';
+ ToolTip = 'Specifies the remaining amount that can be reviewed.';
}
field("Review Id"; Rec."Reviewed Identifier")
{
@@ -335,15 +340,13 @@ page 22207 "Review G/L Entries"
InitialRecordsLoaded := Rec.GetView();
FeatureTelemetry.LogUptake('0000J2Y', 'Review G/L Entries', "Feature Uptake Status"::Discovered);
- CalcBalance();
+ CalcBalance(Rec);
end;
trigger OnAfterGetRecord()
begin
Rec.CalcFields("Reviewed Amount");
RemainingAmount := Rec.Amount - Rec."Reviewed Amount";
- if Rec."Amount to Review" = 0 then
- Rec."Amount to Review" := RemainingAmount;
end;
trigger OnAfterGetCurrRecord()
@@ -353,7 +356,14 @@ page 22207 "Review G/L Entries"
trigger OnModifyRecord(): Boolean
begin
- Balance := Balance + Rec."Amount to Review" - xRec."Amount to Review";
+ if (Rec."Amount to Review" <> xRec."Amount to Review") then
+ if xRec."Amount to Review" = 0 then
+ Balance := Balance - Rec.Amount + Rec."Amount to Review"
+ else
+ if Rec."Amount to Review" = 0 then
+ Balance := Balance + Rec.Amount - xRec."Amount to Review"
+ else
+ Balance := Balance + Rec."Amount to Review" - xRec."Amount to Review";
end;
local procedure SetSelectedRecordsAsReviewed()
@@ -381,6 +391,7 @@ page 22207 "Review G/L Entries"
GLEntry.CalcSums("Debit Amount", "Credit Amount");
Debit := GLEntry."Debit Amount";
Credit := GLEntry."Credit Amount";
+ CalcBalance(GLEntry);
CurrPage.Update(false);
end;
@@ -401,26 +412,19 @@ page 22207 "Review G/L Entries"
exit(StrSubstNo(CaptionLbl, GLAccount."No.", GLAccount.Name));
end;
- local procedure CalcBalance()
+ local procedure CalcBalance(var GLEntryRec: Record "G/L Entry")
var
GLEntry: Record "G/L Entry";
- FeatureTelemetry: Codeunit "Feature Telemetry";
begin
Balance := 0;
- GLEntry.Copy(Rec);
- GLEntry.SetLoadFields("Amount to Review");
+ GLEntry.Copy(GLEntryRec);
+ GLEntry.SetLoadFields("Amount to Review", Amount);
GLEntry.SetFilter("Amount to Review", '<>0');
- if GLEntry.CalcSums("Amount to Review") then
- Balance := GLEntry."Amount to Review"
- else begin
- FeatureTelemetry.LogUsage('0000QPE', 'Review G/L Entries', 'Adding up Amount to Review one by one');
- if GLEntry.FindSet() then
- repeat
- Balance += GLEntry."Amount to Review";
- until GLEntry.Next() = 0;
- FeatureTelemetry.LogUsage('0000QPF', 'Review G/L Entries', 'Added up Amount to Review one by one');
- end;
-
+ GLEntry.CalcSums("Amount to Review");
+ Balance += GLEntry."Amount to Review";
+ GLEntry.SetRange("Amount to Review", 0);
+ GLEntry.CalcSums(Amount);
+ Balance += GLEntry.Amount;
end;
local procedure AreOppositeSign(Amount1: Decimal; Amount2: Decimal): Boolean
diff --git a/Apps/W1/ReviewGLEntries/app/src/tables/GLEntryReview.TableExt.al b/Apps/W1/ReviewGLEntries/app/src/tables/GLEntryReview.TableExt.al
index 977f5c23a7..004b32746d 100644
--- a/Apps/W1/ReviewGLEntries/app/src/tables/GLEntryReview.TableExt.al
+++ b/Apps/W1/ReviewGLEntries/app/src/tables/GLEntryReview.TableExt.al
@@ -46,8 +46,9 @@ tableextension 22211 "G/L Entry Review" extends "G/L Entry"
field(22218; "Amount to Review"; Decimal)
{
Caption = 'Amount to Review';
+ BlankZero = true;
DataClassification = CustomerContent;
- ToolTip = 'Specifies the amount that will be reviewed.';
+ ToolTip = 'Specifies the amount that you want to review for the entry. Leaving this field blank or setting it to zero indicates that the entire amount is to be reviewed.';
}
field(22219; "Review Policy"; Enum "Review Policy Type")
{
diff --git a/Apps/W1/ReviewGLEntries/app/src/tables/GLEntryReviewLog.Table.al b/Apps/W1/ReviewGLEntries/app/src/tables/GLEntryReviewLog.Table.al
index 4bbf19d96a..bb9adf0672 100644
--- a/Apps/W1/ReviewGLEntries/app/src/tables/GLEntryReviewLog.Table.al
+++ b/Apps/W1/ReviewGLEntries/app/src/tables/GLEntryReviewLog.Table.al
@@ -46,6 +46,13 @@ table 22218 "G/L Entry Review Log"
{
Clustered = true;
}
+ key(GLEntryNo; "G/L Entry No.")
+ {
+ IncludedFields = "Reviewed Amount";
+ }
+ key(ReviewedAmount; "Reviewed Amount")
+ {
+ }
}
trigger OnInsert()
begin
diff --git a/Apps/W1/ReviewGLEntries/test/src/ReviewGLEntriesTests.Codeunit.al b/Apps/W1/ReviewGLEntries/test/src/ReviewGLEntriesTests.Codeunit.al
index 3b1bcface9..4aba5509e1 100644
--- a/Apps/W1/ReviewGLEntries/test/src/ReviewGLEntriesTests.Codeunit.al
+++ b/Apps/W1/ReviewGLEntries/test/src/ReviewGLEntriesTests.Codeunit.al
@@ -35,7 +35,7 @@ codeunit 139759 "Review G/L Entries Tests"
GLAccount: record "G/L Account";
GLEntry: record "G/L Entry";
begin
- CreateGeneralLedgerEntriesForGLAccount(GLAccount, "Review Policy Type"::None, false);
+ CreateGeneralLedgerEntriesForGLAccount(GLAccount, "Review Policy Type"::None, false, false);
GLEntry.SetRange("G/L Account No.", GLAccount."No.");
asserterror
ReviewGLEntry.ReviewEntries(GLEntry);
@@ -48,7 +48,18 @@ codeunit 139759 "Review G/L Entries Tests"
GLAccount: record "G/L Account";
GLEntry: record "G/L Entry";
begin
- CreateGeneralLedgerEntriesForGLAccount(GLAccount, "Review Policy Type"::"Allow Review", false);
+ CreateGeneralLedgerEntriesForGLAccount(GLAccount, "Review Policy Type"::"Allow Review", false, false);
+ GLEntry.SetRange("G/L Account No.", GLAccount."No.");
+ ReviewGLEntry.ReviewEntries(GLEntry);
+ end;
+
+ [Test]
+ procedure ReviewEntriesWithAllowReviewAndNonEmptyAmountToReview()
+ var
+ GLAccount: record "G/L Account";
+ GLEntry: record "G/L Entry";
+ begin
+ CreateGeneralLedgerEntriesForGLAccount(GLAccount, "Review Policy Type"::"Allow Review", false, true);
GLEntry.SetRange("G/L Account No.", GLAccount."No.");
ReviewGLEntry.ReviewEntries(GLEntry);
end;
@@ -59,9 +70,25 @@ codeunit 139759 "Review G/L Entries Tests"
GLAccount: record "G/L Account";
GLEntry: record "G/L Entry";
begin
- CreateGeneralLedgerEntriesForGLAccount(GLAccount, "Review Policy Type"::"Allow Review and Match Balance", false);
+ CreateGeneralLedgerEntriesForGLAccount(GLAccount, "Review Policy Type"::"Allow Review and Match Balance", false, false);
GLEntry.SetRange("G/L Account No.", GLAccount."No.");
ReviewGLEntry.ReviewEntries(GLEntry);
+ VerifyReviewedEntriesLog(GLEntry);
+ end;
+
+ local procedure VerifyReviewedEntriesLog(var GLEntry: record "G/L Entry")
+ var
+ GLEntryReviewLog: record "G/L Entry Review Log";
+ begin
+ if GLEntry.FindSet() then
+ repeat
+ GLEntryReviewLog.SetRange("G/L Entry No.", GLEntry."Entry No.");
+ GLEntryReviewLog.FindFirst();
+ if GLEntry."Amount to Review" = 0 then
+ Assert.AreEqual(GLEntry.Amount, GLEntryReviewLog."Reviewed Amount", 'Reviewed Amount does not match for G/L Entry No. %1')
+ else
+ Assert.AreEqual(GLEntry."Amount to Review", GLEntryReviewLog."Reviewed Amount", 'Reviewed Amount does not match for G/L Entry No. %1');
+ until GLEntry.Next() = 0;
end;
[Test]
@@ -70,7 +97,7 @@ codeunit 139759 "Review G/L Entries Tests"
GLAccount: record "G/L Account";
GLEntry: record "G/L Entry";
begin
- CreateGeneralLedgerEntriesForGLAccount(GLAccount, "Review Policy Type"::"Allow Review and Match Balance", true);
+ CreateGeneralLedgerEntriesForGLAccount(GLAccount, "Review Policy Type"::"Allow Review and Match Balance", true, false);
GLEntry.SetRange("G/L Account No.", GLAccount."No.");
asserterror
ReviewGLEntry.ReviewEntries(GLEntry);
@@ -83,19 +110,30 @@ codeunit 139759 "Review G/L Entries Tests"
GLAccount: record "G/L Account";
GLEntry: record "G/L Entry";
begin
- CreateGeneralLedgerEntriesForGLAccount(GLAccount, "Review Policy Type"::"Allow Review and Match Balance", false);
+ CreateGeneralLedgerEntriesForGLAccount(GLAccount, "Review Policy Type"::"Allow Review and Match Balance", false, false);
GLEntry.SetRange("G/L Account No.", GLAccount."No.");
InsertAmountToReview(GLAccount."No.", false);
ReviewGLEntry.ReviewEntries(GLEntry);
end;
+ [Test]
+ procedure ReviewEntriesWithAllowReviewAndMatchBalanceAndAmountNonEmptyAmountToReview()
+ var
+ GLAccount: record "G/L Account";
+ GLEntry: record "G/L Entry";
+ begin
+ CreateGeneralLedgerEntriesForGLAccount(GLAccount, "Review Policy Type"::"Allow Review and Match Balance", false, true);
+ GLEntry.SetRange("G/L Account No.", GLAccount."No.");
+ ReviewGLEntry.ReviewEntries(GLEntry);
+ end;
+
[Test]
procedure ReviewEntriesWithAllowReviewAndMatchBalanceAndAmountNotMatch()
var
GLAccount: record "G/L Account";
GLEntry: record "G/L Entry";
begin
- CreateGeneralLedgerEntriesForGLAccount(GLAccount, "Review Policy Type"::"Allow Review and Match Balance", false);
+ CreateGeneralLedgerEntriesForGLAccount(GLAccount, "Review Policy Type"::"Allow Review and Match Balance", false, false);
GLEntry.SetRange("G/L Account No.", GLAccount."No.");
InsertAmountToReview(GLAccount."No.", true);
asserterror ReviewGLEntry.ReviewEntries(GLEntry);
@@ -110,7 +148,7 @@ codeunit 139759 "Review G/L Entries Tests"
GLEntry: record "G/L Entry";
ReviewGLEntries: TestPage "Review G/L Entries";
begin
- CreateGeneralLedgerEntriesForGLAccount(GLAccount, "Review Policy Type"::"Allow Review and Match Balance", false);
+ CreateGeneralLedgerEntriesForGLAccount(GLAccount, "Review Policy Type"::"Allow Review and Match Balance", false, false);
GLEntry.SetRange("G/L Account No.", GLAccount."No.");
GLEntry.FindFirst();
ReviewGLEntries.OpenEdit();
@@ -123,9 +161,10 @@ codeunit 139759 "Review G/L Entries Tests"
Assert.ExpectedError('Amount to Review must not be larger than Remaining Amount');
end;
- local procedure CreateGeneralLedgerEntriesForGLAccount(var GLAccount: record "G/L Account"; ReviewPolicy: enum "Review Policy Type"; RandomAmount: boolean)
+ local procedure CreateGeneralLedgerEntriesForGLAccount(var GLAccount: record "G/L Account"; ReviewPolicy: enum "Review Policy Type"; RandomAmount: boolean; NonEmptyAmountToReview: boolean)
var
Count: Integer;
+ CreditAmount, DebitAmount : Decimal;
begin
LibraryERM.CreateGLAccount(GLAccount);
Commit();
@@ -133,16 +172,25 @@ codeunit 139759 "Review G/L Entries Tests"
GLAccount.Modify();
Commit();
for Count := 1 to 10 do
- if RandomAmount then
- InsertGLEntry(GLAccount."No.", LibraryRandom.RandDecInRange(100, 200, 2), LibraryRandom.RandDecInRange(100, 200, 2))
- else begin
- InsertGLEntry(GLAccount."No.", 0, Count);
- InsertGLEntry(GLAccount."No.", Count, 0);
- end;
+ if RandomAmount then begin
+ DebitAmount := LibraryRandom.RandDecInRange(100, 200, 2);
+ CreditAmount := DebitAmount + 2;
+ if NonEmptyAmountToReview then
+ InsertGLEntry(GLAccount."No.", DebitAmount, CreditAmount, 1)
+ else
+ InsertGLEntry(GLAccount."No.", DebitAmount, CreditAmount, 0)
+ end else
+ if NonEmptyAmountToReview then begin
+ InsertGLEntry(GLAccount."No.", 0.5, Count + 0.5, Count);
+ InsertGLEntry(GLAccount."No.", Count, 0, 0)
+ end else begin
+ InsertGLEntry(GLAccount."No.", 0, Count, 0);
+ InsertGLEntry(GLAccount."No.", Count, 0, 0)
+ end;
Commit();
end;
- local procedure InsertGLEntry(GLAccNo: Code[20]; DebitAmount: Decimal; CreditAmount: Decimal): Integer
+ local procedure InsertGLEntry(GLAccNo: Code[20]; DebitAmount: Decimal; CreditAmount: Decimal; AmountToReview: Decimal): Integer
var
GLEntry: Record "G/L Entry";
begin
@@ -152,6 +200,7 @@ codeunit 139759 "Review G/L Entries Tests"
GLEntry."Posting Date" := WorkDate();
GLEntry."Debit Amount" := DebitAmount;
GLEntry."Credit Amount" := CreditAmount;
+ GLEntry."Amount to Review" := AmountToReview;
GLEntry.Insert();
exit(GLEntry."Entry No.");
end;
diff --git a/Apps/W1/SalesOrderAgent/app/src/RoleCenter/SOAUserNotifications.Codeunit.al b/Apps/W1/SalesOrderAgent/app/src/RoleCenter/SOAUserNotifications.Codeunit.al
deleted file mode 100644
index dcfa738714..0000000000
--- a/Apps/W1/SalesOrderAgent/app/src/RoleCenter/SOAUserNotifications.Codeunit.al
+++ /dev/null
@@ -1,89 +0,0 @@
-// ------------------------------------------------------------------------------------------------
-// Copyright (c) Microsoft Corporation. All rights reserved.
-// Licensed under the MIT License. See License.txt in the project root for license information.
-// ------------------------------------------------------------------------------------------------
-
-#pragma warning disable AS0007
-namespace Microsoft.Agent.SalesOrderAgent;
-
-using Microsoft.Sales.Document;
-using System.Agents;
-
-codeunit 4566 "SOA User Notifications"
-{
- Access = Internal;
- InherentEntitlements = X;
- InherentPermissions = X;
- EventSubscriberInstance = Manual;
- Permissions = tabledata "SOA KPI Entry" = r, tabledata "Agent Task Log Entry" = r;
-
- [EventSubscriber(ObjectType::Page, Page::"Sales Quote", OnAfterGetRecordEvent, '', false, false)]
- local procedure OnAfterLoadSalesQuote(var Rec: Record "Sales Header")
- begin
- if not IsDocumentUnderReview(Rec) then
- exit;
-
- ShowDocumentUnderReviewNotification();
- end;
-
- [EventSubscriber(ObjectType::Page, Page::"Sales Order", OnAfterGetRecordEvent, '', false, false)]
- local procedure OnAfterLoadSalesOrder(var Rec: Record "Sales Header")
- begin
- if not IsDocumentUnderReview(Rec) then
- exit;
-
- ShowDocumentUnderReviewNotification();
- end;
-
- local procedure IsDocumentUnderReview(var Rec: Record "Sales Header"): Boolean
- var
- SOAKPIEntry: Record "SOA KPI Entry";
- AgentTaskLogEntry: Record "Agent Task Log Entry";
- RecordType: Option;
- begin
- SOAKPIEntry.ReadIsolation := IsolationLevel::ReadCommitted;
-
- case Rec."Document Type" of
- Rec."Document Type"::Order:
- RecordType := SOAKPIEntry."Record Type"::"Sales Order";
- Rec."Document Type"::Quote:
- RecordType := SOAKPIEntry."Record Type"::"Sales Quote";
- else
- exit(false);
- end;
-
- if not SOAKPIEntry.Get(RecordType, Rec."No.") then
- exit(false);
-
- if SOAKPIEntry."Task ID" = 0 then
- exit(false);
-
- AgentTaskLogEntry.SetRange("Task ID", SOAKPIEntry."Task ID");
- if not AgentTaskLogEntry.FindLast() then
- exit(false);
-
- exit(AgentTaskLogEntry.Type = AgentTaskLogEntry.Type::"User Intervention Request");
- end;
-
- local procedure ShowDocumentUnderReviewNotification()
- var
- DocumentIsUnderReviewNotification: Notification;
- begin
- DocumentIsUnderReviewNotification.Id := '3dc968a6-1faa-496e-b390-020dce9e1a07';
- DocumentIsUnderReviewNotification.Message := AgentCreatedDocumentUnderReviewLbl;
- DocumentIsUnderReviewNotification.AddAction(LearnMoreActionLbl, Codeunit::"SOA User Notifications", 'ShowAgentDocumentUnderReviewMessage');
- DocumentIsUnderReviewNotification.Scope := NotificationScope::LocalScope;
- if DocumentIsUnderReviewNotification.Recall() then;
- DocumentIsUnderReviewNotification.Send();
- end;
-
- procedure ShowAgentDocumentUnderReviewMessage(LearnMoreNotification: Notification)
- begin
- Message(AgentCreatedDocumentUnderReviewMsg);
- end;
-
- var
- AgentCreatedDocumentUnderReviewLbl: Label 'Sales Order Agent made changes to this page that await review.';
- AgentCreatedDocumentUnderReviewMsg: Label 'Sales Order Agent recently created or updated this page as part of a task. A user assigned to this agent must review the page before the agent can proceed with the task.';
- LearnMoreActionLbl: Label 'Learn more';
-}
diff --git a/Apps/W1/SalesOrderAgent/app/src/Validation/SOASessionEvents.Codeunit.al b/Apps/W1/SalesOrderAgent/app/src/Validation/SOASessionEvents.Codeunit.al
index 23e1d035fb..95907828cd 100644
--- a/Apps/W1/SalesOrderAgent/app/src/Validation/SOASessionEvents.Codeunit.al
+++ b/Apps/W1/SalesOrderAgent/app/src/Validation/SOASessionEvents.Codeunit.al
@@ -69,9 +69,6 @@ codeunit 4304 "SOA Session Events"
begin
if not BindSubscription(GlobalSOAKPITrackAll) then
FeatureTelemetry.LogUsage('0000O41', SOASetupCU.GetFeatureName(), FailedToBindUserKPISubscriptionErr, TelemetryDimensions);
-
- if not BindSubscription(GlobalSOAUserNotifications) then
- FeatureTelemetry.LogUsage('0000ORY', SOASetupCU.GetFeatureName(), FailedToBindUserNotificationErr, TelemetryDimensions);
end;
local procedure SetupKPITrackingEvents()
@@ -119,10 +116,8 @@ codeunit 4304 "SOA Session Events"
GlobalSOAVariantSearch: Codeunit "SOA Variant Search";
GlobalSOAKPITrackAgents: Codeunit "SOA - KPI Track Agents";
GlobalSOAKPITrackAll: Codeunit "SOA - KPI Track All";
- GlobalSOAUserNotifications: Codeunit "SOA User Notifications";
GlobalSOAAwarenessNotifications: Codeunit "SOA Awareness Notifications";
FeatureTelemetry: Codeunit "Feature Telemetry";
ContactFilteringDisabledAgentTxt: Label 'Contact and customer filtering is disabled for this agent through an event.', Locked = true;
FailedToBindUserKPISubscriptionErr: Label 'Failed to bind subscription for User Agent KPI changes.', Locked = true;
- FailedToBindUserNotificationErr: Label 'Failed to bind subscription for User Agent Notifications.', Locked = true;
}
\ No newline at end of file
diff --git a/Build/Packages.json b/Build/Packages.json
index 08b2c3aacc..5779abcc7d 100644
--- a/Build/Packages.json
+++ b/Build/Packages.json
@@ -4,7 +4,7 @@
"Source": "NuGet.org"
},
"AppBaselines-BCArtifacts": {
- "Version": "27.3.43157",
+ "Version": "27.3.43540",
"Source": "BCArtifacts",
"_comment": "Used to fetch app baselines from BC artifacts"
}