public static void _SA_OpenCompany(string dbPath) { if (!OpenCompany.repo.SelfInfo.Exists()) { OpenCompany._Invoke(); SimplyMessage._SA_HandleMessage(SimplyMessage.repo.Yes, SimplyMessage.repo._Msg_AreYouSureYouAreFinishedWithThisCompany); if (SimplyMessage.repo._Msg_DoyouwanttobackupthiscompanybeforeclosingInfo.Exists()) { SimplyMessage.repo.NoRadioBtn.Click(); SimplyMessage.repo.DoNotAskMeAgain.Check(); SimplyMessage.repo.OK.Click(); } } OpenCompany.repo.FileName.TextValue = dbPath; OpenCompany.repo.Open.Click(); // if necessary convert db, then handle messages to get to home window Simply._SA_GotoHomeWindow(); // set flavor if ((!Functions.GoodData(Variables.bAcctEd)) || (Variables.bAcctEd)) { Simply._SA_SetFlavorVariables(); } // if we don't do this it will populate with previous db Settings._SA_GetCompanyInformation(); }
public static void _Print_T5018Summary(string sCraNum) { Simply.repo.Self.Activate(); Simply.repo.Reports_Item.Click(); Simply.repo.Rpt_Item_Payables.Click(); Simply.repo.Rpt_PrintT5018Slips.Click(); T5018Options.repo.T5018Statements.Uncheck(); T5018Options.repo.CraBusinessNo.TextValue = sCraNum; T5018Options.repo.Print.Click(); // Save CRA number message if (SimplyMessage.repo.SelfInfo.Exists()) { if (SimplyMessage.repo.MessageText.TextValue.Contains(SimplyMessage.sUpdateCraNumMsg)) { SimplyMessage._SA_HandleMessage(SimplyMessage.repo.Yes); } } // Printing changes message if (SimplyMessage.repo.SelfInfo.Exists()) { if (SimplyMessage.repo.PrintChgT5018MsgText.TextValue.Contains(SimplyMessage.sPrintChgT5018Msg)) { SimplyMessage._SA_HandleMessage(SimplyMessage.repo.Continue); } } // send to File automatically. }
public static void _SA_StartNewYear(bool bClearDataFlag) { try { // Open dialog Simply.repo.Self.Activate(); Simply.repo.MaintenanceMenu.Click(); Simply.repo.StartNewYearMenuItem.Click(); // When fiscal year and calendar year are different if (StartNewYear.repo.SelfInfo.Exists()) { StartNewYear.repo.FiscalYear.Click(); StartNewYear.repo.OK.Click(); } // If fiscal and calendar year are the same, this is the first dialog if (SimplyMessage.repo.CmMessageTextInfo.Exists(Variables.iExistWaitTime)) { if (SimplyMessage.repo.CmMessageText.TextValue.Contains(SimplyMessage.sStartNewFiscalAndCalendarYear)) { SimplyMessage.repo.NoRadioBtn.Click(); SimplyMessage.repo.OK.Click(); } } // Wait for the Success message while (!SimplyMessage.repo.CmMessageText.TextValue.Contains(SimplyMessage.sSuccessfullyStartedNewYear)) { System.Threading.Thread.Sleep(1000); } SimplyMessage._SA_HandleMessage(SimplyMessage.repo.OK, SimplyMessage.sSuccessfullyStartedNewYear, true, false); // Clear existing data or not if (bClearDataFlag) { SimplyMessage._SA_HandleMessage(SimplyMessage.repo.Yes, SimplyMessage.sClearData, false, false); } else { SimplyMessage._SA_HandleMessage(SimplyMessage.repo.No, SimplyMessage.sClearData, false, false); } // HST Tax information wizard. Not sure if this is still available // } catch (Exception ex) { Ranorex.Report.Info(ex.Message.ToString()); } }
public static void _SA_FinishHistory() { Simply.repo.Self.Activate(); Simply.repo.History.Click(); Simply.repo.FinishEnteringHistory.Click(); SimplyMessage._SA_HandleMessage(SimplyMessage.repo.Proceed, SimplyMessage.sFinishHistoryMsg); // wait while (!Simply.repo.Self.Active) { Thread.Sleep(1000); } Variables.bHistoryMode = false; }
public static void _SA_printTransaction(string sFileName, RECEIPT ReceiptRecord) { if (Functions.GoodData(ReceiptRecord)) { ReceiptsJournal._SA_Open(ReceiptRecord); Trace.WriteLine("Receipt" + ReceiptRecord.transNumber + ""); } ReceiptsJournal.repo.Print.Click(); SimplyMessage._SA_HandleMessage(SimplyMessage.repo.Yes, SimplyMessage.sChqNumIsOutOfSequence, false, false); PrintToFileDialog.Print(sFileName); // Undo changes ReceiptsJournal.ClickUndoChanges(); }
public static void _SA_printTransaction(string sFileName, PAYMENT PaymentRecord) { // payment paid by cheque only if (Functions.GoodData(PaymentRecord)) { if (PaymentRecord.GetType() != typeof(PAYMENT_CREDIT_CARD)) { PaymentsJournal._SA_Open(PaymentRecord); } Ranorex.Report.Info(String.Format("Printing payment {0} ", PaymentRecord.chequeNumber)); } PaymentsJournal.repo.Print.Click(); SimplyMessage._SA_HandleMessage(SimplyMessage.repo.Yes, SimplyMessage.sChqNumIsOutOfSequence); PrintToFileDialog.Print(sFileName); // Undo changes PaymentsJournal.ClickUndoChanges(); SimplyMessage._SA_HandleMessage(SimplyMessage.repo.Yes, SimplyMessage.sDiscardJournalMsg); }
public static void _SA_Delete(PAYMENT Payment) { // does one-step reversal by clicking on the reverse toolstrip button // the param has to be the type of PAYMENT, PAYMENT_OTHER, PAYMENT_CREDIT_CARD, or PAYMENT_REMIT string source; if (Functions.GoodData(Payment.chequeNumber)) { source = Payment.chequeNumber; } else { source = Payment.source; } Ranorex.Report.Info(String.Format("Deleting the payment record {0} ", source)); PaymentsJournal._SA_Open(Payment); // load the transaction for deletion PaymentsJournal.repo.Reverse.Click(); // handle the conformation message SimplyMessage._SA_HandleMessage(SimplyMessage.repo.Yes, SimplyMessage.sReversePaymentMsg, true); }
public static void _SA_Create(COMPANY Company) { Simply.repo.Self.Activate(); Simply.repo.File.Click(); Simply.repo.NewCompany.Click(); SimplyMessage._SA_HandleMessage(SimplyMessage.repo.Yes, SimplyMessage.repo._Msg_AreYouSureYouAreFinishedWithThisCompany); NewCompanyWizard.repo.Next.Click(); if (NewCompanyWizard.repo.QuantumInfo.Exists()) { switch ((int)Company.edition) { case 1: NewCompanyWizard.repo.First.Click(); break; case 2: NewCompanyWizard.repo.Pro.Click(); break; case 3: NewCompanyWizard.repo.Premium.Click(); break; case 4: NewCompanyWizard.repo.Quantum.Click(); break; default: NewCompanyWizard.repo.Premium.Click(); break; } NewCompanyWizard.repo.Next.Click(); } NewCompanyWizard.repo.Name.TextValue = Company.companyInformation.companyName; if (Functions.GoodData(Company.companyInformation.Address) && Functions.GoodData(Company.companyInformation.Address.street1)) { NewCompanyWizard.repo.Street1.TextValue = Company.companyInformation.Address.street1; } if (Functions.GoodData(Company.companyInformation.Address) && Functions.GoodData(Company.companyInformation.Address.street2)) { NewCompanyWizard.repo.Street2.TextValue = Company.companyInformation.Address.street2; } if (Functions.GoodData(Company.companyInformation.Address) && Functions.GoodData(Company.companyInformation.Address.city)) { NewCompanyWizard.repo.City.TextValue = Company.companyInformation.Address.city; } // if (Variables.productVersion == "Canadian") // { if (Functions.GoodData(Company.companyInformation.Address) && Functions.GoodData(Company.companyInformation.Address.provinceCode)) { NewCompanyWizard.repo.Province.Select(Company.companyInformation.Address.provinceCode); } if (Functions.GoodData(Company.companyInformation.Address) && Functions.GoodData(Company.companyInformation.Address.province)) { NewCompanyWizard.repo.ProvinceName.TextValue = Company.companyInformation.Address.province; } // } // else // { // if (Functions.GoodData (Company.companyInformation.Address) && Functions.GoodData (Company.companyInformation.Address.State)) // { // NewCompanyWizard.Instance.State.SetText (Company.companyInformation.Address.State); // } // } if (Functions.GoodData(Company.companyInformation.Address) && Functions.GoodData(Company.companyInformation.Address.country)) { NewCompanyWizard.repo.Country.TextValue = Company.companyInformation.Address.country; } if (Functions.GoodData(Company.companyInformation.Address) && Functions.GoodData(Company.companyInformation.Address.postalCode)) { NewCompanyWizard.repo.Postal.TextValue = Company.companyInformation.Address.postalCode; } if (Functions.GoodData(Company.companyInformation.Address) && Functions.GoodData(Company.companyInformation.Address.phone1)) { NewCompanyWizard.repo.Phone1.TextValue = Company.companyInformation.Address.phone1; } if (Functions.GoodData(Company.companyInformation.Address) && Functions.GoodData(Company.companyInformation.Address.phone2)) { NewCompanyWizard.repo.Phone2.TextValue = Company.companyInformation.Address.phone2; } if (Functions.GoodData(Company.companyInformation.Address) && Functions.GoodData(Company.companyInformation.Address.fax)) { NewCompanyWizard.repo.Fax.TextValue = Company.companyInformation.Address.fax; } NewCompanyWizard.repo.Next.Click(); if (!(Functions.GoodData(Company.companyInformation.fiscalStart))) { Company.companyInformation.fiscalStart = "1/1/" + Variables.sLongYear + ""; } NewCompanyWizard.repo.FiscalStart.TextValue = Company.companyInformation.fiscalStart; if (Functions.GoodData(Company.companyInformation.earliestTransaction)) { NewCompanyWizard.repo.EarliestTransaction.TextValue = Company.companyInformation.earliestTransaction; } else { Company.companyInformation.earliestTransaction = NewCompanyWizard.repo.EarliestTransaction.TextValue; } if (Functions.GoodData(Company.companyInformation.fiscalEnd)) { NewCompanyWizard.repo.FiscalEnd.TextValue = Company.companyInformation.fiscalEnd; } else { Company.companyInformation.fiscalEnd = NewCompanyWizard.repo.FiscalEnd.TextValue; } NewCompanyWizard.repo.Next.Click(); // Select default the list of accounts NewCompanyWizard.repo.Next.Click(); if (Company.ownership != 0) { NewCompanyWizard.repo.Ownership.Select(Company.ownership.ToString()); } else { Company.ownership = (OWNERSHIP)NewCompanyWizard.repo.Ownership.SelectedItemIndex; } if (Company.industryType != 0) { NewCompanyWizard.repo.IndustryType.Select(Company.industryType.ToString()); } else { Company.industryType = (INDUSTRY_TYPE)NewCompanyWizard.repo.IndustryType.SelectedItemIndex; } if (Functions.GoodData(Company.companyType)) { NewCompanyWizard.repo.CompanyType.SelectListItem(Company.companyType); } else { Company.companyType = NewCompanyWizard.repo.CompanyType.SelectedItemText; } // Account ranges if (Company.AccountDetails.accountNumberDigits != 0) // temp using till good data is properly updated { NewCompanyWizard.repo.AccountRanges.Click(); if (Functions.GoodData(Company.AccountDetails.accountNumberDigits)) { AccountInformation.repo.Digits.Select(Company.AccountDetails.accountNumberDigits.ToString()); } else { Company.AccountDetails.accountNumberDigits = 4; } AccountInformation.repo.AccountContainer.MoveRight(); if (Functions.GoodData(Company.AccountDetails.startingAssetAccountNumber)) { AccountInformation.repo.AccountContainer.SetText(Company.AccountDetails.startingAssetAccountNumber); } AccountInformation.repo.AccountContainer.MoveRight(); if (Functions.GoodData(Company.AccountDetails.endingAssetAccountNumber)) { AccountInformation.repo.AccountContainer.SetText(Company.AccountDetails.endingAssetAccountNumber); } AccountInformation.repo.AccountContainer.MoveRight(); if (Functions.GoodData(Company.AccountDetails.startingLiabilityAccountNumber)) { AccountInformation.repo.AccountContainer.SetText(Company.AccountDetails.startingLiabilityAccountNumber); } AccountInformation.repo.AccountContainer.MoveRight(); if (Functions.GoodData(Company.AccountDetails.endingLiabilityAccountNumber)) { AccountInformation.repo.AccountContainer.SetText(Company.AccountDetails.endingLiabilityAccountNumber); } AccountInformation.repo.AccountContainer.MoveRight(); if (Functions.GoodData(Company.AccountDetails.startingEquityAccountNumber)) { AccountInformation.repo.AccountContainer.SetText(Company.AccountDetails.startingEquityAccountNumber); } AccountInformation.repo.AccountContainer.MoveRight(); if (Functions.GoodData(Company.AccountDetails.endingEquityAccountNumber)) { AccountInformation.repo.AccountContainer.SetText(Company.AccountDetails.endingEquityAccountNumber); } AccountInformation.repo.AccountContainer.MoveRight(); if (Functions.GoodData(Company.AccountDetails.startingRevenueAccountNumber)) { AccountInformation.repo.AccountContainer.SetText(Company.AccountDetails.startingRevenueAccountNumber); } AccountInformation.repo.AccountContainer.MoveRight(); if (Functions.GoodData(Company.AccountDetails.endingRevenueAccountNumber)) { AccountInformation.repo.AccountContainer.SetText(Company.AccountDetails.endingRevenueAccountNumber); } AccountInformation.repo.AccountContainer.MoveRight(); if (Functions.GoodData(Company.AccountDetails.startingExpenseAccountNumber)) { AccountInformation.repo.AccountContainer.SetText(Company.AccountDetails.startingExpenseAccountNumber); } AccountInformation.repo.AccountContainer.MoveRight(); if (Functions.GoodData(Company.AccountDetails.endingExpenseAccountNumber)) { AccountInformation.repo.AccountContainer.SetText(Company.AccountDetails.endingExpenseAccountNumber); } AccountInformation.repo.AccountContainer.MoveRight(); AccountInformation.repo.OK.Click(); } else { Company.AccountDetails.accountNumberDigits = 4; } NewCompanyWizard.repo.Next.Click(); if (Functions.GoodData(Company.companyNameFile)) { NewCompanyWizard.repo.CompanyName.TextValue = Company.companyNameFile; } else { Company.companyNameFile = NewCompanyWizard.repo.CompanyName.TextValue; } if (Functions.GoodData(Company.companyFileLocation)) { NewCompanyWizard.repo.Location.TextValue = Company.companyFileLocation; } else { Company.companyFileLocation = NewCompanyWizard.repo.Location.TextValue; } NewCompanyWizard.repo.Next.Click(); //SimplyMessage._SA_HandleMessage(SimplyMessage.Yes, SimplyMessage._Msg_TheFolderAndFileDoNotExist) // //SimplyMessage._SA_HandleMessage (SimplyMessage.Yes, SimplyMessage._Msg_ReplaceExistingFile) if (SimplyMessage.repo.YesInfo.Exists()) { SimplyMessage.repo.Yes.Click(); } NewCompanyWizard.repo.Finish.Click(); while (!NewCompanyWizard.repo.CloseInfo.Exists()) { Thread.Sleep(1000); } NewCompanyWizard.repo.Close.Click(); // Getting started always exists when a new company is created while (!GettingStarted.repo.SelfInfo.Exists()) { Thread.Sleep(500); } GettingStarted.repo.Show.Uncheck(); GettingStarted.repo.Close.Click(); Simply.isEnhancedView(); // Simply.Instance.SwitchViewLink.Click(); // FunctionsLib.WUEn (Simply.Instance.SwitchToEnhancedViewLink);DW if ((!Functions.GoodData(Variables.bAcctEd)) || (Variables.bAcctEd)) { Simply._SA_SetFlavorVariables(); } Settings._SA_SetToGenericValues(); // need to do this after getting a new, clean company Variables.bHistoryMode = true; }
public static void ClickUndoChanges() { ReceiptsJournal.repo.Undo.Click(); SimplyMessage._SA_HandleMessage(SimplyMessage.repo.Yes, SimplyMessage.sDiscardJournalMsg); // the message does not appear when in lookup mode }
public static void _SA_Delete(RECEIPT ReceiptRecord) { ReceiptsJournal._SA_Open(ReceiptRecord); // load the receipt for deletion ReceiptsJournal.repo.Reverse.Click(); SimplyMessage._SA_HandleMessage(SimplyMessage.repo.Yes, SimplyMessage.sReverseReceiptMsg); }