def fCreate_CreditsForMonth(pMonth): # ---------------------------------------------------# myTools.sectionStartTimeStamp("credits" + str(pMonth)) logging.debug("Create_CreditsForMonth: " + str(pMonth)) allClients = names_Init.fInit_Clients() count = 0 myTools.getFocus() # open a/r tran list type("t", KeyModifier.CTRL) myTools.waitForTransList() for oneClient in allClients: count += 1 # always create credits for first 5 clients # then create credits for 1 out of 9 next clients if (count in range(6)) or ((count + pMonth) % 9 == 0): creditAmount = pMonth + pMonth / float(100) fCreate_OneCredit(oneClient, count, pMonth, creditAmount) else: logging.debug("-- skip: " + str(pMonth) + "-" + oneClient) type(Key.F4, KeyModifier.CTRL) time.sleep(1) type(Key.F4, KeyModifier.CTRL) myTools.sectionEndTimeStamp() myTools.checkProcesses()
def fSetup_ClientHold(): #---------------------------------------------------# myTools.sectionStartTimeStamp("set up client hold") logging.debug('set up client hold') # make sure timeslips has focus myTools.getFocus() logging.debug('- open client list') type("n",KeyModifier.ALT) type("i") time.sleep(1) fHold_Time_NextBill_Hours() fHold_Exp_AllBills_Amount() fHold_Bill_AllBills_AmountAndHours() fHold_AR_AllBills() time.sleep(1) type(Key.F4,KeyModifier.CTRL) time.sleep(1) type(Key.F4,KeyModifier.CTRL) myTools.sectionEndTimeStamp()
def fChange_ClientSettings(): #---------------------------------------------------# logging.debug('- Change_ClientSettings') myTools.getFocus() logging.debug('-- change a client') type("i",KeyModifier.CTRL) time.sleep(1) type(Key.ENTER) time.sleep(1) myTools.pressF6(4) if Settings.tsVersion > "2014": myTools.pressF6(3) time.sleep(1) myTools.pressTAB(3) time.sleep(1) type("my") logging.debug('-- save client') type("s",KeyModifier.CTRL) fExport_ClientSettings() fExport_TemplateSettings() time.sleep(1) type(Key.F4,KeyModifier.CTRL) type(Key.F4,KeyModifier.CTRL)
def fFundsAccouts_Setup(): # - - - - - - - - - - - - - - - - - - - - - - - - - # myTools.sectionStartTimeStamp("funds account") logging.debug('FundsAccount_Setup') # make sure timeslips has focus myTools.getFocus() # switch date to 1/27/13 fSet_BillDate(1) fBankAccount_Create() # open client list type("i",KeyModifier.CTRL) time.sleep(1) clientList = ["Hadley","Halifax"] count = 0 for oneCli in clientList: count += 1 fFundsAccount_Create(oneCli,count) type(Key.F4,KeyModifier.CTRL) myTools.sectionEndTimeStamp()
def fSetup_SplitBills(): #---------------------------------------------------# myTools.sectionStartTimeStamp("setup split") logging.debug('- set up split bills') myTools.getFocus() # open split billing rule list type("b",KeyModifier.ALT) time.sleep(1) type("i") time.sleep(1) fSetup_Primary("Beverly") # new secondary myTools.pressTAB(7) fSetup_Secondary("Peabody",15) fSetup_Secondary("Saugus",20) # done myTools.pressTAB(4) type(Key.SPACE) myTools.sectionEndTimeStamp() backup_Data.fBackup_Checkpoint("split")
def fEdit_Client(): #---------------------------------------------------# myTools.sectionStartTimeStamp("edit client") logging.debug('Edit_Client') # make sure timeslips has focus myTools.getFocus() fEdit_CliGenInfo() fEdit_CliCustom() fEdit_CliRatesNotes() logging.debug('- save') type("s",KeyModifier.CTRL) time.sleep(1) fEdit_DefaultRates() fEdit_InterestSetting() type(Key.F4,KeyModifier.CTRL) time.sleep(1) type(Key.F4,KeyModifier.CTRL) myTools.sectionEndTimeStamp()
def fPrint_FeeAllocPer(pReportMonth,pRepExt): #---------------------------------------------------# myTools.sectionStartTimeStamp("print FeeAllocPer") # name report file: ex: PreBill-03 reportName = myTools.buildRepName("FeeAllocPer",pRepExt) logging.debug('Print_FeeAllocPer: ' + reportName) # make sure timeslips has focus myTools.getFocus() logging.debug('- open FeeAllocPer') type("r",KeyModifier.ALT) type("t") time.sleep(1) myTools.pressDOWN(3) time.sleep(1) # choose csv myTools.pressSHIFTTAB(2) type("c") time.sleep(1) myTools.enterCurrentMonthOnList(pReportMonth) # print the report type(Key.ENTER) time.sleep(1) myTools.finishReport(reportName)
def fCreate_Discounts(pMonth): #---------------------------------------------------# myTools.sectionStartTimeStamp("discounts" + str(pMonth)) logging.debug('fCreate_Discounts: ' + str(pMonth)) # list the client that will get a refund each month discountClients = ["Natick","Orange","Oakham","Oak Bluffs","Southampton","Otis","Oxford","Leyden","Monroe","Monson","Methuen","Uxbridge"] oneClient = discountClients[(pMonth - 1)] myTools.getFocus() # open a/r tran list type("t",KeyModifier.CTRL) myTools.waitForTransList() discountAmount = 49 + pMonth/float(100) fCreate_OneDiscount(oneClient,pMonth,discountAmount) type(Key.F4,KeyModifier.CTRL) time.sleep(1) type(Key.F4,KeyModifier.CTRL) myTools.sectionEndTimeStamp() myTools.checkProcesses()
def fCreate_Categories(): # ---------------------------------------------------# myTools.sectionStartTimeStamp("categories") logging.debug("fCreate_Categories") # make sure timeslips has focus myTools.getFocus() logging.debug("- open category list") type("p", KeyModifier.ALT) # hot keys changed for TS2014 if int(Settings.tsVersion) < 2014: type("i") else: type("o") time.sleep(1) for category in ["Construction", "General", "Landscape", "Hardware", "Supplies", "Materials", "Other"]: logging.debug("-- create: " + category) type("n", KeyModifier.ALT) type(category) type(Key.ENTER) logging.debug("- close list") myTools.pressTAB(4) type(Key.ENTER) myTools.sectionEndTimeStamp()
def fCreate_FinanceCharges(pMonth): #---------------------------------------------------# myTools.sectionStartTimeStamp("finance" + str(pMonth)) logging.debug('Create_FinanceCharges: ' + str(pMonth)) allClients = names_Init.fInit_Clients() count = 0 myTools.getFocus() # client list type("i",KeyModifier.CTRL) for oneClient in allClients: count += 1 # always create finance charge for first 5 clients # then create finance charge for 1 out of 35 next clients if (count in range(6)) or ((count + pMonth) % 35 == 0): financeCharge = str(count) + ".99" fCreate_OneFinanceCharge(oneClient,count,pMonth,financeCharge) else: logging.debug('-- skip: ' + str(pMonth) + "-" + oneClient) type(Key.F4,KeyModifier.CTRL) myTools.sectionEndTimeStamp()
def fBill_BillFields(): #---------------------------------------------------# myTools.sectionStartTimeStamp("bill fields") logging.debug("fBill_BillFields") buName = Settings.tsVersion + "-bill-12b" backup_Data.fRestore_Backup(buName) reportName = "BillFields-13-" + Settings.tsVersion + ".txt" myTools.getFocus() # make sure timeslips has focus if int(Settings.tsVersion) < 2016: # to get around a defect in pre-2016 type("i",KeyModifier.CTRL) # open client info and close it to load custom fields time.sleep(1) type("o",KeyModifier.CTRL) time.sleep(1) type(Key.F4,KeyModifier.CTRL) time.sleep(1) type(Key.F4,KeyModifier.CTRL) bill_ImportLayout.fImport_BillLayout("Fields") # import the layout fSet_BillDate(12) # set billing data to 12/27 for text bills fPrint_BillsToText(reportName) # print all bills to one text file reports_Compare.Compare_OneReport(reportName) myTools.sectionEndTimeStamp()
def fCreate_Writeoffs(pMonth): #---------------------------------------------------# myTools.sectionStartTimeStamp("writeoffs" + str(pMonth)) logging.debug('Create_Writeoffs: ' + str(pMonth)) count = 0 myTools.getFocus() # open a/r tran list type("t",KeyModifier.CTRL) myTools.waitForTransList() clientList = ["Blackstone","Carver"] for woClient in clientList: count += 1 if woClient == "Blackstone": woAmount = 2 else: woAmount = 3 woAmount = woAmount + pMonth/float(100) fCreate_OneWriteOff(woClient,count,pMonth,woAmount) type(Key.F4,KeyModifier.CTRL) time.sleep(1) type(Key.F4,KeyModifier.CTRL) myTools.sectionEndTimeStamp() myTools.checkProcesses()
def fBudget_Setup(): #---------------------------------------------------# myTools.sectionStartTimeStamp("budgets") logging.debug('budgets') myTools.getFocus() # open budget setup type("n", KeyModifier.ALT) type("b") time.sleep(1) if (int(Settings.tsVersion) > 2016) and (Settings.tsDB == "PREM"): fTimekeeperBudget_New() fClientBudget_New() fFirmBudget_New() else: fTimekeeperBudget() fClientBudget() fFirmBudget() type(Key.F4,KeyModifier.CTRL) myTools.sectionEndTimeStamp()
def fCreate_Refunds(pMonth): #---------------------------------------------------# myTools.sectionStartTimeStamp("refunds" + str(pMonth)) logging.debug('fCreate_Refunds: ' + str(pMonth)) # list the client that will get a refund each month refundClients = ["Hawley","Haverhill","Hatfield","Harwich","Harvard","Hawley","Haverhill","Hatfield","Harwich","Harvard","Hawley","Haverhill"] oneClient = refundClients[(pMonth - 1)] myTools.getFocus() # open a/r tran list type("t",KeyModifier.CTRL) myTools.waitForTransList() refundAmount = 99 + pMonth/float(100) fCreate_OneRefund(oneClient,pMonth,refundAmount) type(Key.F4,KeyModifier.CTRL) time.sleep(1) type(Key.F4,KeyModifier.CTRL) myTools.sectionEndTimeStamp() myTools.checkProcesses()
def fCreate_Transfers(pMonth): #---------------------------------------------------# myTools.sectionStartTimeStamp("transfers" + str(pMonth)) logging.debug('Create_Transfers: ' + str(pMonth)) allClients = ["East.Bridgewater","North.Adams","West.Boylston"] count = 0 myTools.getFocus() # open a/r tran list type("t",KeyModifier.CTRL) myTools.waitForTransList() for oneClient in allClients: count += 1 transferAmount = 10 + int(count) + pMonth/float(100) fCreate_OneTransfer(oneClient,count,pMonth,transferAmount) type(Key.F4,KeyModifier.CTRL) time.sleep(1) type(Key.F4,KeyModifier.CTRL) myTools.sectionEndTimeStamp() myTools.checkProcesses()
def fSetup_InvoiceListing(): # ---------------------------------------------------# logging.debug("- set up invlist") myTools.getFocus() type("r", KeyModifier.ALT) type("a") time.sleep(1) type("i") time.sleep(1) myTools.removeDateAndTime() type(Key.F4, KeyModifier.CTRL) time.sleep(1) type("y") time.sleep(1) # open report type("o", KeyModifier.CTRL) # add invoice number sort type(Key.F6) time.sleep(1) myTools.pressTAB(2) time.sleep(1) type(Key.SPACE) # close and save report type(Key.F4, KeyModifier.CTRL) time.sleep(1) type("y") time.sleep(1) type(Key.F4, KeyModifier.CTRL)
def fPrint_SlipListCalc(pReportMonth,pRepExt): #---------------------------------------------------# myTools.sectionStartTimeStamp("print slipcalcs") # name report file: ex: UDSlip1-03 reportName = myTools.buildRepName("UDSCalc",pRepExt) logging.debug('Print_UDSCalc: ' + reportName) myTools.getFocus() logging.debug('- open report list') type("r",KeyModifier.ALT) type("s") time.sleep(1) logging.debug('- choose report') type("uds c") time.sleep(1) # fSort_SlipReportFields() fChoose_CSV_Print(reportName) myTools.waitForReport() reports_Compare.Compare_OneReport(reportName) # close the report type(Key.F4,KeyModifier.CTRL) time.sleep(1) type("n") type(Key.F4,KeyModifier.CTRL) myTools.sectionEndTimeStamp()
def fPrint_ARwRunBal(pReportMonth,pRepExt): #---------------------------------------------------# myTools.sectionStartTimeStamp("print ARwRunBal") # name report file: ex: UDSlip1-03 reportName = myTools.buildRepName("ARwRunBal",pRepExt) logging.debug('fPrint_ARwRunBal: ' + reportName) myTools.getFocus() logging.debug('- open report list') type("r",KeyModifier.ALT) type("a") time.sleep(1) logging.debug('- choose report') myTools.pressDOWN(2) time.sleep(1) # choose txt myTools.pressSHIFTTAB(2) time.sleep(1) type("t") time.sleep(1) myTools.enterCurrentMonthOnList(pReportMonth) # print the report type(Key.ENTER) time.sleep(1) myTools.finishReport(reportName)
def fCreate_TransfersToFunds(pMonth): #---------------------------------------------------# myTools.sectionStartTimeStamp("transfer funds" + str(pMonth)) logging.debug('Create_TransfersFunds: ' + str(pMonth)) allClients = ["East.Brookfield","North.Andover","West.Bridgewater"] count = 0 myTools.getFocus() # open a/r tran list type("t",KeyModifier.CTRL) myTools.waitForTransList() for oneClient in allClients: count += 1 fCreate_OneFundsTransfer(oneClient,count,pMonth) type(Key.F4,KeyModifier.CTRL) time.sleep(1) type(Key.F4,KeyModifier.CTRL) myTools.sectionEndTimeStamp() myTools.checkProcesses()
def fPrint_FlatFee(pReportMonth,pRepExt): #---------------------------------------------------# myTools.sectionStartTimeStamp("print FlatFee") # name report file: ex: ARAgedBal-03 reportName = myTools.buildRepName("FlatFee",pRepExt) logging.debug('Print_FlatFee: ' + reportName) # make sure timeslips has focus myTools.getFocus() logging.debug('- open report') type("r",KeyModifier.ALT) type("c") time.sleep(1) type("f") time.sleep(1) # move to Print To and choose CSV myTools.pressSHIFTTAB(2) time.sleep(1) type("c") # print the report type(Key.ENTER) time.sleep(1) myTools.finishReport(reportName)
def fCreate_PaymentsToAccount(pMonth): #---------------------------------------------------# myTools.sectionStartTimeStamp("paystoaccount" + str(pMonth)) logging.debug('Create_PaysToAccount: ' + str(pMonth)) allClients = names_Init.fInit_Clients() count = 0 myTools.getFocus() # open funds list type("f",KeyModifier.CTRL) myTools.waitForFundsList() # create PTA for first 5 clients and then every 6th client for oneClient in allClients: count += 1 if (count in range(6)) or ((count + pMonth) % 6 == 0): ptaAmount = 25 + pMonth/float(100) fCreate_OnePayToAccount(oneClient,count,pMonth,ptaAmount) else: logging.debug('-- skip: ' + str(pMonth) + "-" + oneClient) type(Key.F4,KeyModifier.CTRL) time.sleep(1) type(Key.F4,KeyModifier.CTRL) myTools.sectionEndTimeStamp() myTools.checkProcesses()
def fImport_Statement(): #---------------------------------------------------# logging.debug('- fImport_Statement') # make sure timeslips has focus myTools.getFocus() type("b",KeyModifier.ALT) # layouts type("t") time.sleep(1) type(Key.F6) time.sleep(1) type("o",KeyModifier.CTRL) # open time.sleep(1) type("l",KeyModifier.ALT) # import type("p") time.sleep(1) statementLayout = Settings.dataFolder + '\\Statement.tsl' type(statementLayout) time.sleep(1) type(Key.ENTER) time.sleep(1) type("y") time.sleep(1) type(Key.F4,KeyModifier.CTRL) # close / save time.sleep(1) type("y") time.sleep(1) type(Key.F4,KeyModifier.CTRL) time.sleep(1)
def fCreate_SlipListDetailed(): #---------------------------------------------------# logging.debug('- fCreate_SlipListDetailed') # make sure timeslips has focus myTools.getFocus() type(Key.F3,KeyModifier.CTRL) # create a report time.sleep(1) type("r",KeyModifier.ALT) # ud report type("n",KeyModifier.ALT) # next time.sleep(1) type("s") # slip type("n",KeyModifier.ALT) # next time.sleep(1) myTools.pressDOWN(2) # detailed Listing Simple type("n",KeyModifier.ALT) # next time.sleep(1) type("n",KeyModifier.ALT) # next type(Key.ENTER) # Open Report Entry time.sleep(1) type("s",KeyModifier.CTRL) # save type(Key.ENTER) # OK time.sleep(1) type(Key.F4,KeyModifier.CTRL) # close report time.sleep(1)
def fPrint_SlipFields(pReportMonth,pRepExt): #---------------------------------------------------# # this does not include applied fields, since we fixed some stuff in ts2016 myTools.sectionStartTimeStamp("print slipfields") # name report file: ex: UDSlip1-03 reportName = myTools.buildRepName("UDSlip2",pRepExt) logging.debug('Print_UDSlip2: ' + reportName) myTools.getFocus() logging.debug('- open report list') type("r",KeyModifier.ALT) type("s") time.sleep(1) logging.debug('- choose report') type("UDS SlipFields") time.sleep(1) # fSort_SlipReportFields() fChoose_CSV_Print(reportName) myTools.waitForReport() reports_Compare.Compare_OneReport(reportName) # close the report type(Key.F4,KeyModifier.CTRL) time.sleep(1) type("n") type(Key.F4,KeyModifier.CTRL) myTools.sectionEndTimeStamp()
def fPrint_InvoiceListing(pReportMonth, pRepExt): # ---------------------------------------------------# myTools.sectionStartTimeStamp("print invoicelist") # name report file: ex: UDSlip1-03 reportName = myTools.buildRepName("InvList", pRepExt) logging.debug("Print_InvoiceList: " + reportName) myTools.getFocus() logging.debug("- open report list") type("r", KeyModifier.ALT) type("a") time.sleep(1) logging.debug("- choose report") type("i") time.sleep(1) # choose txt myTools.pressSHIFTTAB(2) time.sleep(1) type("t") time.sleep(1) myTools.enterYearToDateOnList(pReportMonth) # print the report type(Key.ENTER) time.sleep(1) myTools.finishReport(reportName)
def Print_TkCC(pReportMonth,pRepExt): #---------------------------------------------------# myTools.sectionStartTimeStamp("print tkcc") # name report file: ex: TkCC-03 reportName = myTools.buildRepName("TkCC",pRepExt) logging.debug('Print_TkCC: ' + reportName) # make sure timeslips has focus myTools.getFocus() logging.debug('- open report') type("r",KeyModifier.ALT) type("t") time.sleep(2) type("timekeeper cont") time.sleep(1) myTools.pressDOWN(1) time.sleep(1) type("o",KeyModifier.CTRL) time.sleep(1) logging.debug('- default options') # options button myTools.pressSHIFTTAB(4) type(Key.ENTER) time.sleep(1) # default button myTools.pressSHIFTTAB(4) type(Key.ENTER) time.sleep(1) # show client breakdown myTools.pressTAB(4) type(Key.SPACE) time.sleep(1) # close dialog type(Key.ENTER) time.sleep(1) logging.debug('- print report') # move to Print To and choose CSV myTools.pressTAB(2) type("c") time.sleep(1) if pReportMonth != 13: Filter_SplitClients() # print the report type(Key.ENTER) time.sleep(1) myTools.finishReport(reportName)
def Open_SlipList(): #---------------------------------------------------# # open slip list and verify it's open myTools.getFocus() type("m",KeyModifier.CTRL) time.sleep(1) click("number_of_slips.png")
def fPrint_AgedClient(pReportMonth,pRepExt): #---------------------------------------------------# myTools.sectionStartTimeStamp("print AgedClient") # name report file: ex: PreBill-03 reportName = myTools.buildRepName("AgedClient",pRepExt) logging.debug('Print_AgedClient: ' + reportName) # make sure timeslips has focus myTools.getFocus() logging.debug('- open PayPerf') type("r",KeyModifier.ALT) type("c") time.sleep(1) myTools.pressDOWN(1) time.sleep(1) logging.debug('- set up report') type("o",KeyModifier.CTRL) # Options myTools.pressSHIFTTAB(4) type(Key.SPACE) time.sleep(1) # Default myTools.pressSHIFTTAB(4) type(Key.SPACE) time.sleep(1) # Show hours myTools.pressTAB(10) type(Key.SPACE) time.sleep(1) # Show Adjustment columns myTools.pressTAB(1) type(Key.SPACE) time.sleep(1) # OK type(Key.ENTER) time.sleep(1) # choose csv myTools.pressTAB(2) type("c") time.sleep(1) myTools.enterSlipFilter(pReportMonth,"yy") # print the report type(Key.ENTER) time.sleep(1) myTools.finishReport(reportName)
def Print_GLXfer(pReportMonth,pRepExt): #---------------------------------------------------# myTools.sectionStartTimeStamp("print glxfer") # name report file: ex: TkCC-03 reportName = myTools.buildRepName("GLXfer",pRepExt) logging.debug('Print_GLXfer: ' + reportName) # make sure timeslips has focus myTools.getFocus() logging.debug('- open report') type("a",KeyModifier.ALT) type("g") time.sleep(1) logging.debug('- default options') # options button myTools.pressSHIFTTAB(4) type(Key.ENTER) time.sleep(1) # default button myTools.pressSHIFTTAB(4) type(Key.ENTER) time.sleep(1) # trans types myTools.pressTAB(4) type(Key.ENTER) time.sleep(1) # remove transfer since they were wrong before ts2016 type("t") time.sleep(1) type(Key.SPACE) time.sleep(1) type(Key.ENTER) # close dialog myTools.pressSHIFTTAB(3) type(Key.ENTER) time.sleep(1) logging.debug('- print report') # move to Print To and choose CSV myTools.pressTAB(2) type("c") time.sleep(1) # print the report type(Key.ENTER) time.sleep(1) myTools.finishReport(reportName)
def Print_SlipTotalsWeekly(pReportMonth,pRepExt): #---------------------------------------------------# myTools.sectionStartTimeStamp("slip totals") # name report file: ex: PayDistr-03 reportName = myTools.buildRepName("SlipTot",pRepExt) logging.debug('Print_SlipTotalsWeekly: ' + reportName) # make sure timeslips has focus myTools.getFocus() logging.debug('- open report') type("r",KeyModifier.ALT) type("s") time.sleep(2) type("w") time.sleep(1) type("o",KeyModifier.CTRL) time.sleep(1) logging.debug('- default options') # switch to CSV myTools.pressSHIFTTAB(2) time.sleep(1) type("c") # options button myTools.pressSHIFTTAB(2) type(Key.ENTER) time.sleep(1) # default button myTools.pressSHIFTTAB(4) type(Key.ENTER) time.sleep(1) # Include totals myTools.pressTAB(8) time.sleep(1) type(Key.SPACE) # OK type(Key.ENTER) time.sleep(1) myTools.enterSlipFilter(pReportMonth,"y") logging.debug('- print report') type(Key.ENTER) time.sleep(1) myTools.finishReport(reportName)