Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ using Microsoft.Sales.Customer;
using Microsoft.Purchases.Document;
using Microsoft.Foundation.Company;
using Microsoft.Purchases.Vendor;
using Microsoft.Finance.GeneralLedger.Setup;
using Microsoft.Finance.VAT.Setup;
using System.Threading;
using Microsoft.eServices.EDocument.Integration;
using Microsoft.eServices.EDocument.Service;
Expand Down Expand Up @@ -532,10 +534,17 @@ codeunit 148191 "Integration Tests"
var
ConnectionSetup: Record "Connection Setup";
CompanyInformation: Record "Company Information";
GeneralLedgerSetup: Record "General Ledger Setup";
AvalaraAuth: Codeunit Authenticator;
KeyGuid: Guid;
begin
LibraryPermission.SetOutsideO365Scope();

GeneralLedgerSetup.Get();
PrevVATReportingDateValue := GeneralLedgerSetup."VAT Reporting Date Usage";
GeneralLedgerSetup."VAT Reporting Date Usage" := Enum::"VAT Reporting Date Usage"::Disabled;
GeneralLedgerSetup.Modify();

// Clean up token between runs
if ConnectionSetup.Get() then
if IsolatedStorage.Delete(ConnectionSetup."Token - Key", DataScope::Company) then;
Expand Down Expand Up @@ -575,8 +584,6 @@ codeunit 148191 "Integration Tests"
IsInitialized := true;
end;



local procedure SetCompanyIdInConnectionSetup(Id: Text[100]; Name: Text[100])
var
ConnectionSetup: Record "Connection Setup";
Expand Down Expand Up @@ -658,10 +665,15 @@ codeunit 148191 "Integration Tests"
local procedure TearDown()
var
CompanyInformation: Record "Company Information";
GeneralLedgerSetup: Record "General Ledger Setup";
begin
CompanyInformation.Get();
CompanyInformation."VAT Registration No." := OriginalVATNumber;
CompanyInformation.Modify();

GeneralLedgerSetup.Get();
GeneralLedgerSetup."VAT Reporting Date Usage" := PrevVATReportingDateValue;
GeneralLedgerSetup.Modify();
end;

[HttpClientHandler]
Expand Down Expand Up @@ -711,6 +723,7 @@ codeunit 148191 "Integration Tests"
LibraryERM: Codeunit "Library - ERM";
Assert: Codeunit Assert;
IsInitialized: Boolean;
PrevVATReportingDateValue: Enum "VAT Reporting Date Usage";
OriginalVATNumber: Text[20];
IncorrectValueErr: Label 'Wrong value';
DocumentStatus: Option Completed,Pending,Error;
Expand Down
Loading