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_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 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 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 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 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 fClear_Filter(): #---------------------------------------------------# # selection click("selection_button.png") time.sleep(1) # clear myTools.clickRemoveAll() # OK type(Key.ENTER) time.sleep(1) # Update myTools.pressTAB(1) type(Key.ENTER) myTools.waitForTransList()
def fCreate_RevPays(pMonth): #---------------------------------------------------# myTools.sectionStartTimeStamp("revpays" + str(pMonth)) logging.debug('fCreate_RevPays: ' + str(pMonth)) if (pMonth == 1): logging.debug('- SKIP MONTH') myTools.sectionEndTimeStamp() return # list the client that will get a refund each month refundClientsA = ["Gardner","Freetown","Franklin","Framingham","Foxborough","Florida","Fitchburg","Falmouth","Fall River","Fairhaven","Everett"] oneClientA = refundClientsA[(pMonth - 2)] refundClientsB = ["Dover","Douglas","Dighton","Dennis","Deerfield","Dedham","Dartmouth","Danvers","Dalton","Cummington","Conway"] oneClientB = refundClientsB[(pMonth - 2)] # create a list of clients for current month allClients = [] allClients.append(oneClientA) allClients.append(oneClientB) count = 0 myTools.getFocus() # open a/r tran list type("t",KeyModifier.CTRL) myTools.waitForTransList() for oneClient in allClients: count += 1 fCreate_OneRevPay(oneClient,count,pMonth) type(Key.F4,KeyModifier.CTRL) time.sleep(1) type(Key.F4,KeyModifier.CTRL) myTools.sectionEndTimeStamp() myTools.checkProcesses()
def fFilter_Invoices(): #---------------------------------------------------# # selection logging.debug('- filters') click("selection_button.png") time.sleep(1) # clear any existing filters if exists("remove_all.png"): click("remove_all.png") time.sleep(1) # add tran type filter click("trans_type.png") time.sleep(1) click("add_filter-1.png") time.sleep(1) # unselect all type(Key.DELETE) # select invoice myTools.pressDOWN(5) type(Key.F4) time.sleep(1) # OK myTools.pressTAB(1) type(Key.ENTER) time.sleep(1) # OK type(Key.ENTER) time.sleep(1) # Update myTools.pressTAB(1) type(Key.ENTER) myTools.waitForTransList()
def fCreate_PaymentsForMonth(pMonth): #---------------------------------------------------# myTools.sectionStartTimeStamp("payments" + str(pMonth)) logging.debug('Create_PaymentsForMonth: ' + str(pMonth)) allClients = names_Init.fInit_Clients() transferClients = ["East.Bridgewater","North.Adams","West.Boylston"] transferFundsClients = ["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 # always create payments for first 5 clients # then create payments for 1 out of 5 next clients # always create payments for certain projects if (count in range(6)) or ((count + pMonth) % 5 == 0) or (oneClient in transferClients) or (oneClient in transferFundsClients): payAmount = 100 + int(count) + pMonth/float(100) # calc amount first, so we can log it fCreate_OnePayment(oneClient,count,pMonth,payAmount) 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 fCreate_SpecCredits(pMonth): #---------------------------------------------------# myTools.sectionStartTimeStamp("specialCredits" + str(pMonth)) logging.debug('Create_SpecCredits: ' + str(pMonth)) if int(Settings.tsVersion) < 2017: logging.debug('- SKIP until 2017') return myTools.getFocus() # list of invoices; one for each month invList = ["12400","12600","13100","13330","13830","14210","14370","14850","15200","15460","15960","16240"] # open a/r tran list logging.debug('- open a/r list') type("t",KeyModifier.CTRL) myTools.waitForTransList() # go to invoice type('g',KeyModifier.CTRL + KeyModifier.SHIFT) time.sleep(1) myTools.pressTAB(2) invNum = invList[pMonth-1] logging.debug('- look for: ' + invNum) type(invNum) type(Key.ENTER) time.sleep(1) # open it type(Key.ENTER) myTools.waitForTransEntry() # apply a new special credit click("apply_new.png") myTools.pressDOWN(5) type(Key.ENTER) time.sleep(1) # type type(Key.TAB) # client type(Key.TAB) # date tranDate = str(pMonth) + "/28/" + Settings.dataYear type(tranDate) time.sleep(1) type(Key.TAB) # Description type(Key.END) type(" - " + tranDate) time.sleep(1) myTools.pressTAB(2) # Fees feeAmount = 5 + pMonth/float(100) type(str(feeAmount)) time.sleep(1) type(Key.TAB) # Costs costAmount = 4 + pMonth/float(100) type(str(costAmount)) time.sleep(1) type(Key.TAB) # Interest interestAmount = 3 + pMonth/float(100) type(str(interestAmount)) time.sleep(1) #save type("s",KeyModifier.CTRL) myTools.checkForUnappliedAmount() myTools.waitForTransSave() # close type(Key.F4,KeyModifier.CTRL) time.sleep(1) type(Key.F4,KeyModifier.CTRL) myTools.sectionEndTimeStamp() myTools.checkProcesses()