diff --git a/Apps/W1/EDocumentConnectors/Tietoevry/app/src/ConnectionSetupCard.Page.al b/Apps/W1/EDocumentConnectors/Tietoevry/app/src/ConnectionSetupCard.Page.al index 7560ea236..c406b4abd 100644 --- a/Apps/W1/EDocumentConnectors/Tietoevry/app/src/ConnectionSetupCard.Page.al +++ b/Apps/W1/EDocumentConnectors/Tietoevry/app/src/ConnectionSetupCard.Page.al @@ -105,7 +105,9 @@ page 6392 "Connection Setup Card" begin Token := TietoevryAuth.GetAccessToken(); if not Token.IsEmpty() then - Message(this.AuthSuccessMsg); + Message(this.AuthSuccessMsg) + else + Error(this.AuthFailedErr); end; } } @@ -130,6 +132,7 @@ page 6392 "Connection Setup Card" TietoevryAuth: Codeunit "Authenticator"; TietoevryProcessing: Codeunit Processing; AuthSuccessMsg: Label 'Authenticated successfully'; + AuthFailedErr: Label 'Authentication failed'; [NonDebuggable] ClientID, ClientSecret : Text; } diff --git a/Apps/W1/EDocumentConnectors/Tietoevry/app/src/Formats/EDocumentImpl.al b/Apps/W1/EDocumentConnectors/Tietoevry/app/src/Formats/EDocumentImpl.Codeunit.al similarity index 100% rename from Apps/W1/EDocumentConnectors/Tietoevry/app/src/Formats/EDocumentImpl.al rename to Apps/W1/EDocumentConnectors/Tietoevry/app/src/Formats/EDocumentImpl.Codeunit.al diff --git a/Apps/W1/EDocumentConnectors/Tietoevry/app/src/Formats/Cod6398.FormatEvents.al b/Apps/W1/EDocumentConnectors/Tietoevry/app/src/Formats/FormatEvents.Codeunit.al similarity index 100% rename from Apps/W1/EDocumentConnectors/Tietoevry/app/src/Formats/Cod6398.FormatEvents.al rename to Apps/W1/EDocumentConnectors/Tietoevry/app/src/Formats/FormatEvents.Codeunit.al diff --git a/Apps/W1/EDocumentConnectors/Tietoevry/app/src/Formats/TietoevryEDocImport.al b/Apps/W1/EDocumentConnectors/Tietoevry/app/src/Formats/TietoevryEDocImport.Codeunit.al similarity index 95% rename from Apps/W1/EDocumentConnectors/Tietoevry/app/src/Formats/TietoevryEDocImport.al rename to Apps/W1/EDocumentConnectors/Tietoevry/app/src/Formats/TietoevryEDocImport.Codeunit.al index ca954b654..358bb77be 100644 --- a/Apps/W1/EDocumentConnectors/Tietoevry/app/src/Formats/TietoevryEDocImport.al +++ b/Apps/W1/EDocumentConnectors/Tietoevry/app/src/Formats/TietoevryEDocImport.Codeunit.al @@ -14,6 +14,8 @@ using Microsoft.Purchases.Vendor; using Microsoft.Finance.GeneralLedger.Setup; using Microsoft.eServices.EDocument.Service.Participant; +// The following line can be removed when/if Microsoft changes the protection level on the EDocumentAttachmentGen.Insert() procedure +#pragma warning disable AA0137 codeunit 6393 "Tietoevry E-Document Import" { procedure ParseBasicInfo(var EDocument: Record "E-Document"; var TempBlob: Codeunit "Temp Blob") @@ -31,7 +33,7 @@ codeunit 6393 "Tietoevry E-Document Import" EDocument.Direction := EDocument.Direction::Incoming; - case UpperCase(GetDocumentType(TempXMLBuffer)) of + case UpperCase(this.GetDocumentType(TempXMLBuffer)) of 'INVOICE': this.ParseInvoiceBasicInfo(EDocument, TempXMLBuffer); 'CREDITNOTE': @@ -65,7 +67,7 @@ codeunit 6393 "Tietoevry E-Document Import" Currency: Text[10]; begin EDocument."Document Type" := EDocument."Document Type"::"Purchase Invoice"; - EDocument."Incoming E-Document No." := CopyStr(GetNodeByPath(TempXMLBuffer, '/Invoice/cbc:ID'), 1, MaxStrLen(EDocument."Document No.")); + EDocument."Incoming E-Document No." := CopyStr(this.GetNodeByPath(TempXMLBuffer, '/Invoice/cbc:ID'), 1, MaxStrLen(EDocument."Document No.")); this.ParseAccountingSupplierParty(EDocument, TempXMLBuffer, 'Invoice'); this.ParseAccountingCustomerParty(EDocument, TempXMLBuffer, 'Invoice'); @@ -103,10 +105,10 @@ codeunit 6393 "Tietoevry E-Document Import" if IssueDate <> '' then Evaluate(EDocument."Document Date", IssueDate, 9); - Evaluate(EDocument."Amount Excl. VAT", GetNodeByPath(TempXMLBuffer, '/CreditNote/cac:LegalMonetaryTotal/cbc:TaxExclusiveAmount'), 9); - Evaluate(EDocument."Amount Incl. VAT", GetNodeByPath(TempXMLBuffer, '/CreditNote/cac:LegalMonetaryTotal/cbc:PayableAmount'), 9); + Evaluate(EDocument."Amount Excl. VAT", this.GetNodeByPath(TempXMLBuffer, '/CreditNote/cac:LegalMonetaryTotal/cbc:TaxExclusiveAmount'), 9); + Evaluate(EDocument."Amount Incl. VAT", this.GetNodeByPath(TempXMLBuffer, '/CreditNote/cac:LegalMonetaryTotal/cbc:PayableAmount'), 9); - Currency := CopyStr(GetNodeByPath(TempXMLBuffer, '/CreditNote/cbc:DocumentCurrencyCode'), 1, MaxStrLen(EDocument."Currency Code")); + Currency := CopyStr(this.GetNodeByPath(TempXMLBuffer, '/CreditNote/cbc:DocumentCurrencyCode'), 1, MaxStrLen(EDocument."Currency Code")); if this.LCYCode <> Currency then EDocument."Currency Code" := Currency; end; @@ -173,6 +175,7 @@ codeunit 6393 "Tietoevry E-Document Import" // Insert last document attachment if DocumentAttachment."No." <> '' then begin DocumentAttachmentData.CreateInStream(InStream, TextEncoding::UTF8); + // The following line can be uncommented when/if Microsoft changes the protection level on the procedure Insert // EDocumentAttachmentGen.Insert(EDocument, InStream, DocumentAttachment.FindUniqueFileName(DocumentAttachment."File Name", DocumentAttachment."File Extension")); Clear(DocumentAttachment); end; @@ -204,6 +207,7 @@ codeunit 6393 "Tietoevry E-Document Import" // Insert last document attachment if DocumentAttachment."No." <> '' then begin DocumentAttachmentData.CreateInStream(InStream, TextEncoding::UTF8); + // The following line can be uncommented when/if Microsoft changes the protection level on the procedure Insert // EDocumentAttachmentGen.Insert(EDocument, InStream, DocumentAttachment.FindUniqueFileName(DocumentAttachment."File Name", DocumentAttachment."File Extension")); Clear(DocumentAttachment); end; @@ -322,6 +326,7 @@ codeunit 6393 "Tietoevry E-Document Import" begin if DocumentAttachment."No." <> '' then begin DocumentAttachmentData.CreateInStream(InStream, TextEncoding::UTF8); + // The following line can be uncommented when/if Microsoft changes the protection level on the procedure Insert // EDocumentAttachmentGen.Insert(EDocument, InStream, DocumentAttachment.FindUniqueFileName(DocumentAttachment."File Name", DocumentAttachment."File Extension")); Clear(DocumentAttachment); end; @@ -433,7 +438,8 @@ codeunit 6393 "Tietoevry E-Document Import" begin if DocumentAttachment."No." <> '' then begin DocumentAttachmentData.CreateInStream(InStream, TextEncoding::UTF8); - //EDocumentAttachmentGen.Insert(EDocument, InStream, DocumentAttachment.FindUniqueFileName(DocumentAttachment."File Name", DocumentAttachment."File Extension")); + // The following line can be uncommented when/if Microsoft changes the protection level on the procedure Insert + // EDocumentAttachmentGen.Insert(EDocument, InStream, DocumentAttachment.FindUniqueFileName(DocumentAttachment."File Name", DocumentAttachment."File Extension")); Clear(DocumentAttachment); end; @@ -573,6 +579,8 @@ codeunit 6393 "Tietoevry E-Document Import" end; var + + // The variable "EDocumentAttachmentGen" is when/if Microsoft changes the protection level on the procedure Insert EDocumentAttachmentGen: Codeunit "E-Doc. Attachment Processor"; EDocumentImportHelper: Codeunit "E-Document Import Helper"; LCYCode: Code[10]; diff --git a/Apps/W1/EDocumentConnectors/Tietoevry/app/src/Permissions/TeitoevryEDocConnectorEdit.PermissionSetExt.al b/Apps/W1/EDocumentConnectors/Tietoevry/app/src/Permissions/TietoevryEDocConnectorEdit.PermissionSetExt.al similarity index 100% rename from Apps/W1/EDocumentConnectors/Tietoevry/app/src/Permissions/TeitoevryEDocConnectorEdit.PermissionSetExt.al rename to Apps/W1/EDocumentConnectors/Tietoevry/app/src/Permissions/TietoevryEDocConnectorEdit.PermissionSetExt.al diff --git a/Apps/W1/EDocumentConnectors/Tietoevry/app/src/Permissions/Edit.PermissionSet.al b/Apps/W1/EDocumentConnectors/Tietoevry/app/src/Permissions/TietoevryEdit.PermissionSet.al similarity index 100% rename from Apps/W1/EDocumentConnectors/Tietoevry/app/src/Permissions/Edit.PermissionSet.al rename to Apps/W1/EDocumentConnectors/Tietoevry/app/src/Permissions/TietoevryEdit.PermissionSet.al diff --git a/Apps/W1/EDocumentConnectors/Tietoevry/app/src/Permissions/Objects.PermissionSet.al b/Apps/W1/EDocumentConnectors/Tietoevry/app/src/Permissions/TietoevryObjects.PermissionSet.al similarity index 100% rename from Apps/W1/EDocumentConnectors/Tietoevry/app/src/Permissions/Objects.PermissionSet.al rename to Apps/W1/EDocumentConnectors/Tietoevry/app/src/Permissions/TietoevryObjects.PermissionSet.al diff --git a/Apps/W1/EDocumentConnectors/Tietoevry/app/src/Permissions/Read.PermissionSet.al b/Apps/W1/EDocumentConnectors/Tietoevry/app/src/Permissions/TietoevryRead.PermissionSet.al similarity index 100% rename from Apps/W1/EDocumentConnectors/Tietoevry/app/src/Permissions/Read.PermissionSet.al rename to Apps/W1/EDocumentConnectors/Tietoevry/app/src/Permissions/TietoevryRead.PermissionSet.al diff --git a/Apps/W1/EDocumentConnectors/Tietoevry/app/src/Upgrade.Codeunit.al b/Apps/W1/EDocumentConnectors/Tietoevry/app/src/Upgrade.Codeunit.al deleted file mode 100644 index 026fcfe12..000000000 --- a/Apps/W1/EDocumentConnectors/Tietoevry/app/src/Upgrade.Codeunit.al +++ /dev/null @@ -1,64 +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.Tietoevry; - -using System.Upgrade; -#if not CLEAN26 -using Microsoft.eServices.EDocument.Integration; -using Microsoft.eServices.EDocument; -#endif - -codeunit 6390 Upgrade -{ - Access = Internal; - Subtype = Upgrade; - - trigger OnUpgradePerCompany() - var - - begin -#if not CLEAN26 - // Upgrade code per company - this.UpdateServiceIntegration(); -#endif - - end; - -#if not CLEAN26 - local procedure UpdateServiceIntegration() - var - EDocumentService: Record "E-Document Service"; - UpgradeTag: Codeunit "Upgrade Tag"; - begin - if UpgradeTag.HasUpgradeTag(UpgradeServiceIntegrationTag()) then - exit; - - // 6390 - Tietoevry Integration - EDocumentService.SetRange("Service Integration", 6370); - if EDocumentService.FindSet() then - repeat - EDocumentService."Service Integration V2" := Enum::"Service Integration"::Tietoevry; - EDocumentService."Service Integration" := Enum::"E-Document Integration"::"No Integration"; - EDocumentService.Modify(); - until EDocumentService.Next() = 0; - - UpgradeTag.SetUpgradeTag(UpgradeServiceIntegrationTag()); - end; -#endif - - - [EventSubscriber(ObjectType::Codeunit, Codeunit::"Upgrade Tag", 'OnGetPerCompanyUpgradeTags', '', false, false)] - local procedure RegisterPerCompanyTags(var PerCompanyUpgradeTags: List of [Code[250]]) - begin - PerCompanyUpgradeTags.Add(UpgradeServiceIntegrationTag()); - end; - - local procedure UpgradeServiceIntegrationTag(): Code[250] - begin - exit('MS-000000-UpdateServiceIntegrationTietoevry-20241125'); - end; - - -} \ No newline at end of file