/// <summary> /// Performs the playback of actions in this module. /// </summary> /// <remarks>You should not call this method directly, instead pass the module /// instance to the <see cref="TestModuleRunner.Run(ITestModule)"/> method /// that will in turn invoke this method.</remarks> void ITestModule.Run() { Mouse.DefaultMoveTime = 300; Keyboard.DefaultKeyPressTime = 100; Delay.SpeedFactor = 1.0; // create record to hold customer data CUSTOMER cus = new CUSTOMER(); cus.name = "cust" + StringFunctions.RandStr("X(8)"); // call create method from class to add customer ReceivablesLedger._SA_Create(cus); ReceivablesLedger._SA_Close(); // set customer name to global var this._varCustomer = cus.name; }
/// <summary> /// Performs the playback of actions in this module. /// </summary> /// <remarks>You should not call this method directly, instead pass the module /// instance to the <see cref="TestModuleRunner.Run(ITestModule)"/> method /// that will in turn invoke this method.</remarks> void ITestModule.Run() { Mouse.DefaultMoveTime = 300; Keyboard.DefaultKeyPressTime = 100; Delay.SpeedFactor = 1.0; // create record to hold customer data CUSTOMER cus = new CUSTOMER(); cus.name = "cust" + StringFunctions.RandStr("X(8)"); cus.inactiveCheckBox = true; cus.internalCheckBox = true; // address cus.Address.contact = "contact"; cus.Address.street1 = "street 1"; cus.Address.street2 = "street 2"; cus.Address.city = "city"; cus.Address.province = "province"; cus.Address.postalCode = "V4F 16Y"; cus.Address.country = "country"; cus.Address.phone1 = "1234567894"; cus.Address.phone2 = "1234567895"; cus.Address.fax = "1234567896"; cus.Address.email = "email"; cus.Address.webSite = "website"; //cus.salesPerson = ""; cus.customerSince = "08/08/2000"; //cus.department = "0200 Marketing"; // ship-to-address cus.defaultShipToAddressCheckbox = true; cus.ShipToAddress.contact = "ship contact"; cus.ShipToAddress.street1 = "sh street 1"; cus.ShipToAddress.street2 = "sh street 2"; cus.ShipToAddress.city = "sh city"; cus.ShipToAddress.province = "sh province"; cus.ShipToAddress.postalCode = "V4F 16Y"; cus.ShipToAddress.country = "sh country"; cus.ShipToAddress.phone1 = "1234567894"; cus.ShipToAddress.phone2 = "1234567895"; cus.ShipToAddress.fax = "1234567896"; cus.ShipToAddress.email = "sh email"; cus.ShipToAddress.webSite = "sh website"; // options //cus.revenueAccount.acctNumber = "10500 Petty Cash"; cus.conductBusinessIn = "English"; cus.priceList = "Preferred"; //cus.usuallyShipItemFrom = "BC"; cus.discountPercent = "5"; cus.discountPeriod = "20"; cus.termPeriod = "30"; cus.produceStatementsForThisCustCheckbox = false; cus.synchronizeWithOutlook = true; cus.formsForThisCustomer = "Email"; // taxes TAX_LEDGER tax = new TAX_LEDGER(); tax.tax.taxName = "GST"; tax.taxExempt = "Yes"; tax.taxID = "1234567"; cus.taxList.Add(tax); cus.taxCode.code = "GP"; // // PAD // cus.custHasPADCheckbox = true; // cus.currencyAndLocation = "CAD bank account in Canada"; // cus.branchNumber = "11111"; // cus.institutionNumber = "111"; // cus.accountNumber = "123456789"; // statistics cus.creditLimit = "2000"; // memo cus.memo = "memo memo memo"; cus.toDoDate = "08/30/2016"; cus.displayCheckBox = true; // // import // cus.hasSage50CheckBox = true; // //cus.usesMyItemNumCheckBox = true; // // IMPORT import = new IMPORT(); // // import.itemNumber = "12345"; // import.myItemNumber = "C1020"; // // cus.imports.Add(import); // additional info cus.additional1 = "add 1"; cus.additional2 = "add 2"; cus.additional3 = "add 3"; cus.additional4 = "add 4"; cus.additional5 = "add 5"; cus.addCheckBox1 = true; cus.addCheckBox2 = true; cus.addCheckBox3 = true; cus.addCheckBox4 = true; cus.addCheckBox5 = true; // assign to global parameter to be used in latter test cases //varCustomer = cus.name; // call create method from class to add customer ReceivablesLedger._SA_Create(cus); ReceivablesLedger._SA_Close(); }
/// <summary> /// Performs the playback of actions in this module. /// </summary> /// <remarks>You should not call this method directly, instead pass the module /// instance to the <see cref="TestModuleRunner.Run(ITestModule)"/> method /// that will in turn invoke this method.</remarks> void ITestModule.Run() { Mouse.DefaultMoveTime = 300; Keyboard.DefaultKeyPressTime = 100; Delay.SpeedFactor = 1.0; // Remove existing print file string printedInvoice = @"C:\Users\Public\Documents\Simply Accounting\2018\Data\Invoice.pdf"; // @"C:\Users\_sabvt\Documents\Simply Accounting\DATA\Invoice.pdf"; Functions.RemoveExistingFile(printedInvoice); // Create a customer CUSTOMER cus = new CUSTOMER(); if (this.varCustomer == "") { cus.name = "cust" + StringFunctions.RandStr("X(8)"); ReceivablesLedger._SA_Create(cus); ReceivablesLedger._SA_Close(); } else { cus.name = this.varCustomer; } // Create an item ITEM item = new ITEM(); ITEM_PRICE itemPrice = new ITEM_PRICE(); itemPrice.currency = "Canadian Dollars"; itemPrice.priceList = "Regular"; itemPrice.pricePerSellingUnit = Functions.RandCashAmount(); item.ItemPrices.Add(itemPrice); if (this.varItem == "") { item.invOrServNumber = StringFunctions.RandStr("A(9)"); InventoryServicesLedger._SA_Create(item); InventoryServicesLedger._SA_Close(); } else { item.invOrServNumber = this._varItem; } // Create an invoice and print a Simply form SALES_INVOICE salesInv = new SALES_INVOICE(); salesInv.Customer = cus; ROW firstRow = new ROW(); firstRow.Item.invOrServNumber = item.invOrServNumber; firstRow.quantityShipped = Functions.RandCashAmount(2); salesInv.GridRows.Add(firstRow); SalesJournal._SA_Create(salesInv, false); // Print. Install, then setup pdf printer to be default printer first SalesJournal._SA_PrintToFile(printedInvoice); // wait for file to be created Thread.Sleep(13000); // undo and close journal SalesJournal.UndoChanges(); SalesJournal._SA_Close(); // Verify file has been printed if (!Functions.VerifyFileExists(printedInvoice)) { Functions.Verify(false, true, "Printed Simply form found"); } }
/// <summary> /// Performs the playback of actions in this module. /// </summary> /// <remarks>You should not call this method directly, instead pass the module /// instance to the <see cref="TestModuleRunner.Run(ITestModule)"/> method /// that will in turn invoke this method.</remarks> void ITestModule.Run() { Mouse.DefaultMoveTime = 300; Keyboard.DefaultKeyPressTime = 100; Delay.SpeedFactor = 1.0; // create record to hold customer data CUSTOMER cus = new CUSTOMER(); // only create a new customer if running test case alone if (this._varCustomer == "") { cus.name = "cust" + StringFunctions.RandStr("X(8)"); ReceivablesLedger._SA_Create(cus); ReceivablesLedger._SA_Close(); } else { // other wise take customer name from global variable cus.name = this._varCustomer; } // create item to use in invoice ITEM item = new ITEM(); item.ItemPrices.Add(new ITEM_PRICE("Canadian Dollars")); item.ItemPrices[0].priceList = "Regular"; item.ItemPrices[0].pricePerSellingUnit = Functions.RandCashAmount(); // only create a new item if running test case alone if (this._varItem == "") { item.invOrServNumber = StringFunctions.RandStr("A(9)"); InventoryServicesLedger._SA_Create(item); InventoryServicesLedger._SA_Close(); } else { item.invOrServNumber = this._varItem; } // Create an Invoice SALES_INVOICE sale = new SALES_INVOICE(); sale.Customer = cus; ROW r = new ROW(); r.Item = item; r.quantityShipped = Functions.RandCashAmount(2); r.price = Functions.RandCashAmount(); sale.GridRows.Add(r); SalesJournal._SA_Create(sale); System.Threading.Thread.Sleep(2000); SalesJournal._SA_Close(); this.varSInvoice = sale.transNumber; }
/// <summary> /// Performs the playback of actions in this module. /// </summary> /// <remarks>You should not call this method directly, instead pass the module /// instance to the <see cref="TestModuleRunner.Run(ITestModule)"/> method /// that will in turn invoke this method.</remarks> void ITestModule.Run() { Mouse.DefaultMoveTime = 300; Keyboard.DefaultKeyPressTime = 100; Delay.SpeedFactor = 1.0; // Create a customer CUSTOMER cus = new CUSTOMER(); cus.name = "cust" + StringFunctions.RandStr("X(8)"); //cus.name = "International Oil"; ReceivablesLedger._SA_Create(cus); ReceivablesLedger._SA_Close(); // Create an item ITEM item = new ITEM(); item.invOrServNumber = StringFunctions.RandStr("A(9)"); //item.invOrServNumber = "C1020"; item.ItemPrices.Add(new ITEM_PRICE("Canadian Dollars")); item.ItemPrices[0].priceList = "Regular"; item.ItemPrices[0].pricePerSellingUnit = Functions.RandCashAmount(); InventoryServicesLedger._SA_Create(item); InventoryServicesLedger._SA_Close(); // Create an Invoice SALES_INVOICE sale = new SALES_INVOICE(); sale.Customer = cus; sale.transNumber = StringFunctions.RandStr("9(8)"); ROW r = new ROW(); r.Item = item; r.quantityShipped = Functions.RandCashAmount(2); r.price = Functions.RandCashAmount(); sale.GridRows.Add(r); SalesJournal._SA_Create(sale); System.Threading.Thread.Sleep(2000); SalesJournal._SA_Close(); // // tmp // CUSTOMER cus = new CUSTOMER(); // cus.name = "custYXTngnQw"; // ITEM item = new ITEM(); // item.invOrServNumber = "aqlUMddep"; // SALES_INVOICE sale = new SALES_INVOICE(); // sale.Customer = cus; // sale.transNumber = "15883414"; // // Create an receipt RECEIPT receipt = new RECEIPT(); receipt.Customer = cus; RECEIPT_ROW row1 = new RECEIPT_ROW(); row1.Invoice = sale; receipt.GridRows.Add(row1); ReceiptsJournal._SA_Create(receipt); System.Threading.Thread.Sleep(1000); ReceiptsJournal._SA_Close(); }
/// <summary> /// Performs the playback of actions in this module. /// </summary> /// <remarks>You should not call this method directly, instead pass the module /// instance to the <see cref="TestModuleRunner.Run(ITestModule)"/> method /// that will in turn invoke this method.</remarks> void ITestModule.Run() { Mouse.DefaultMoveTime = 300; Keyboard.DefaultKeyPressTime = 100; Delay.SpeedFactor = 1.0; // create record to hold customer data CUSTOMER cus = new CUSTOMER(); if (this.varCustomer == "") { cus.name = "cust" + StringFunctions.RandStr("X(8)"); ReceivablesLedger._SA_Create(cus); ReceivablesLedger._SA_Close(); } else { cus.name = this.varCustomer; } // create an item to use in invoice ITEM item = new ITEM(); item.ItemPrices.Add(new ITEM_PRICE("Canadian Dollars")); item.ItemPrices[0].priceList = "Regular"; item.ItemPrices[0].pricePerSellingUnit = Functions.RandCashAmount(); if (this.varCustomer == "") { item.invOrServNumber = StringFunctions.RandStr("A(9)"); InventoryServicesLedger._SA_Create(item); InventoryServicesLedger._SA_Close(); } else { item.invOrServNumber = this.varItem; } // Create an Invoice SALES_INVOICE sale = new SALES_INVOICE(); sale.Customer = cus; ROW r = new ROW(); r.Item = item; r.quantityShipped = Functions.RandCashAmount(2); r.price = Functions.RandCashAmount(); sale.GridRows.Add(r); if (this._varSInvoice == "") { SalesJournal._SA_Create(sale); // sleep is setup in _SA_Close method SalesJournal._SA_Close(); } else { sale.transNumber = this.varSInvoice; } // Adjust invoice ROW adjR = new ROW(); r.quantityShipped = Functions.RandCashAmount(2); sale.GridRows.Add(adjR); SalesJournal._SA_Create(sale, true, true); SalesJournal._SA_Close(); }
/// <summary> /// Performs the playback of actions in this module. /// </summary> /// <remarks>You should not call this method directly, instead pass the module /// instance to the <see cref="TestModuleRunner.Run(ITestModule)"/> method /// that will in turn invoke this method.</remarks> void ITestModule.Run() { Mouse.DefaultMoveTime = 300; Keyboard.DefaultKeyPressTime = 100; Delay.SpeedFactor = 1.0; // Create a customer CUSTOMER cus = new CUSTOMER(); if (this.varCustomer == "") { cus.name = "cust" + StringFunctions.RandStr("X(8)"); ReceivablesLedger._SA_Create(cus); ReceivablesLedger._SA_Close(); } else { cus.name = this.varCustomer; } // Create an item to be used in invoice ITEM item = new ITEM(); item.ItemPrices.Add(new ITEM_PRICE("Canadian Dollars")); item.ItemPrices[0].priceList = "Regular"; item.ItemPrices[0].pricePerSellingUnit = Functions.RandCashAmount(); if (this.varItem == "") { item.invOrServNumber = StringFunctions.RandStr("A(9)"); InventoryServicesLedger._SA_Create(item); InventoryServicesLedger._SA_Close(); } else { item.invOrServNumber = this.varItem; } // Create an Invoice SALES_INVOICE sale = new SALES_INVOICE(); sale.Customer = cus; ROW r = new ROW(); r.Item = item; r.quantityShipped = Functions.RandCashAmount(2); r.price = Functions.RandCashAmount(); sale.GridRows.Add(r); if (this.varSInvoice == "") { SalesJournal._SA_Create(sale); System.Threading.Thread.Sleep(1000); SalesJournal._SA_Close(); } else { sale.transNumber = this.varSInvoice; } // Create a receipt RECEIPT receipt = new RECEIPT(); receipt.Customer = cus; RECEIPT_ROW receiptRow = new RECEIPT_ROW(); receiptRow.Invoice = sale; receipt.GridRows.Add(receiptRow); ReceiptsJournal._SA_Create(receipt); System.Threading.Thread.Sleep(1000); ReceiptsJournal._SA_Close(); }