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
12 changes: 12 additions & 0 deletions src/Apps/W1/Shopify/Test/Base/ShpfyInitializeTest.Codeunit.al
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,9 @@ using Microsoft.Foundation.Enums;
using Microsoft.Foundation.NoSeries;
using Microsoft.Integration.Shopify;
using Microsoft.Inventory.Item;
using Microsoft.Inventory.Setup;
using Microsoft.Sales.Customer;
using Microsoft.Sales.Setup;
using System.TestLibraries.Utilities;

/// <summary>
Expand All @@ -34,6 +36,7 @@ codeunit 139561 "Shpfy Initialize Test"
CommunicationMgt: Codeunit "Shpfy Communication Mgt.";
LibraryERM: Codeunit "Library - ERM";
LibraryRandom: Codeunit "Library - Random";
LibraryUtility: Codeunit "Library - Utility";
ShopifyAccessToken: Text;
#pragma warning disable AA0240
DummyCustomerEmailLbl: Label 'dummy@customer.com';
Expand All @@ -47,7 +50,10 @@ codeunit 139561 "Shpfy Initialize Test"

internal procedure CreateShop(): Record "Shpfy Shop"
var
GeneralPostingSetup: Record "General Posting Setup";
InventorySetup: Record "Inventory Setup";
RefundGLAccount: Record "G/L Account";
SalesReceivablesSetup: Record "Sales & Receivables Setup";
Shop: Record "Shpfy Shop";
VATPostingSetup: Record "VAT Posting Setup";
ShpfyInitializeTest: Codeunit "Shpfy Initialize Test";
Expand All @@ -65,6 +71,8 @@ codeunit 139561 "Shpfy Initialize Test"

Code := CopyStr(Any.AlphabeticText(MaxStrLen(Code)), 1, MaxStrLen(Code));

LibraryERM.CreateGeneralPostingSetupInvt(GeneralPostingSetup);

LibraryERM.CreateVATPostingSetupWithAccounts(VATPostingSetup,
VATPostingSetup."VAT Calculation Type"::"Normal VAT", LibraryRandom.RandDecInDecimalRange(10, 25, 0));

Expand Down Expand Up @@ -95,6 +103,10 @@ codeunit 139561 "Shpfy Initialize Test"
Commit();
CommunicationMgt.SetShop(Shop);
CommunicationMgt.SetTestInProgress(true);
LibraryUtility.UpdateSetupNoSeriesCode(
DATABASE::"Sales & Receivables Setup", SalesReceivablesSetup.FieldNo("Customer Nos."));
LibraryUtility.UpdateSetupNoSeriesCode(
DATABASE::"Inventory Setup", InventorySetup.FieldNo("Item Nos."));
CreateDummyCustomer(CustomerTemplateCode);
CreateDummyItem(ItemTemplateCode);
if not TempShop.Get(Code) then begin
Expand Down
Loading