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_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_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 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_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_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_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.checkProcesses()
    myTools.sectionEndTimeStamp()
def fEnter_Transactions(transMonth):
#---------------------------------------------------#

    myTools.checkProcesses()

    # enter transactions for month

#    trans_SpecCredits.fCreate_SpecCredits(transMonth)
    trans_Writeoff.fCreate_Writeoffs(transMonth)
#    trans_ReversePay.fCreate_RevPays(transMonth)
#    trans_Discounts.fCreate_Discounts(transMonth)
#    trans_Payments.fCreate_PaymentsForMonth(transMonth)
#    backup_Data.fBackup_Checkpoint("payments")

#    trans_Transfers.fCreate_Transfers(transMonth)
#    trans_TransfersToFunds.fCreate_TransfersToFunds(transMonth)
#    backup_Data.fBackup_Checkpoint("transfers")
        
#    trans_Refunds.fCreate_Refunds(transMonth)        
#    trans_PaymentsToAccount.fCreate_PaymentsToAccount(transMonth)
#    backup_Data.fBackup_Checkpoint("pta")

#    trans_Credits.fCreate_CreditsForMonth(transMonth)
#    backup_Data.fBackup_Checkpoint("credits")
    
#    client_FinanceCharges.fCreate_FinanceCharges(transMonth)        
#    backup_Data.fBackup_Checkpoint("finchar")
    
#    trans_BankDepositSlip.fBankDepositSlips_Create(transMonth)
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()
Beispiel #10
0
def fBackup_Checkpoint(pCheckpointName):
#---------------------------------------------------#

    myTools.sectionStartTimeStamp("backup checkpoint")
    logging.debug('Backup_Checkpoint: ' + pCheckpointName)

    # name backup file: ex: 2015-slips
    strBackupFile = Settings.tsVersion + "-" + pCheckpointName

    fBackup_Data(strBackupFile)

    myTools.checkProcesses()
    myTools.sectionEndTimeStamp()
Beispiel #11
0
def fBackup_BillData(pBillMonth,pAorB):
#---------------------------------------------------#

    myTools.sectionStartTimeStamp("backup billdata")
    logging.debug('Backup_Data: ' + str(pBillMonth))

    if Settings.tsDB == "PREM":
        bkuExt = pAorB + ".tbu"
    else:
        bkuExt = pAorB + ".bku"

    # name backup file: ex: 2015-bill-03
    strBackupFile = myTools.bkuName(pBillMonth,"-bill-",bkuExt)
    fBackup_Data(strBackupFile)

    myTools.checkProcesses()
    myTools.sectionEndTimeStamp()
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 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 fBankDepositSlips_Create(bds_month):
#---------------------------------------------------#

    myTools.sectionStartTimeStamp("bank deposit slip")
    logging.debug('BankDepositSlip_Create')

    # make sure timeslips has focus
    myTools.getFocus()

    fBankDepositSlip_CreateOne(bds_month)

    clientList = ["Hadley","Halifax"]
    bds_count = 0

    # add transactions to deposit slip
    for bds_client in clientList:
        bds_count += 1
        
        trans_amount = 30 + bds_count + bds_month/float(100)        
        fPayment_CreateOne(bds_client,bds_month,bds_count,trans_amount)

        trans_amount = 20 + bds_count + bds_month/float(100)
        fPayToAccount_CreateOne(bds_client,bds_month,bds_count,trans_amount)

        trans_amount = 10 + bds_count + bds_month/float(100)        
        fDepToAccount_CreateOne(bds_client,bds_month,bds_count,trans_amount)

    # close
    type(Key.F4,KeyModifier.CTRL)
    time.sleep(1)

    if exists("please_note.png"):
        type(Key.ENTER)
        time.sleep(1)
        
    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()
def Compare_OneReport(pReportName):
#---------------------------------------------------#
    logging.debug(' ')
    logging.debug('COMPARE: ' + pReportName)

    removeVersion = "-" + Settings.tsVersion
    reportNameMinusVersion = pReportName.replace(removeVersion,"")

# point to old report, new report, and output file
    logging.debug('- set file names')
    baseFile = Settings.baseRepFolder + "\\" + reportNameMinusVersion #trim version from name
    newFile = Settings.repFolder + "\\" + pReportName

    global newRepLine

# don't compare if old report doesn't exist
    logging.debug('- check for base file')
    if not os.path.exists(baseFile):
        logging.debug("--> " + reportNameMinusVersion + " MISSING")
        myTools.pushReportLog(pReportName," MISSING")
        return

# don't compare if new report doesn't exist
    logging.debug('- check for printed file')
    if not os.path.exists(baseFile):
        logging.debug("--> " + pReportName + " MISSING")        
        myTools.pushReportLog(pReportName," MISSING")
        return

# open report files
    logging.debug('- read report files')

    baseRep = open(baseFile)
    newRep = open(newFile)

# read lines of the report files
    baseRepLines = baseRep.read().splitlines()
    newRepLines = newRep.read().splitlines()

# close report files
    baseRep.close()
    newRep.close()

# open reset line counter and error flag
    newRepLine = 0
    errorFound = False

# compare lengths of files
    logging.debug('- compare lengths')
    
    if len(baseRepLines) < len(newRepLines):
        errorFound = True        
        logging.debug("--> FAILED: " + pReportName)
        logging.debug("--> NEW report has more lines")
        myTools.pushReportLog(pReportName," WRONG SIZE")
    elif len(baseRepLines) > len(newRepLines):
        errorFound = True        
        logging.debug("--> FAILED: " + pReportName)
        logging.debug("--> BASE report has more lines")
        myTools.pushReportLog(pReportName," WRONG SIZE")

    # compare each line in base report to new report; jump out on first mismatch
    else:
        logging.debug("-- SAME length")    
        logging.debug('- compare files')
        for baseRepLine in baseRepLines:
            if baseRepLine != newRepLines[newRepLine]:
                errorFound = True
                logging.debug("--> FAILED: " + pReportName)
                logging.debug("--> Line: %d \n" % (newRepLine+1))
                logging.debug("--> Base: " + baseRepLine)
                logging.debug("--> New:  " + newRepLines[newRepLine])
                myTools.pushReportLog(pReportName," FAILED    ")
                break
            newRepLine += 1
    
    if errorFound == True:
        Copy_ErrorFiles(baseFile,newFile)        
    else:    
        logging.debug("-- reports MATCH: " + pReportName)
        myTools.pushReportLog(pReportName," pass      ")

    myTools.checkProcesses()
Beispiel #17
0
    settings_Prefs.fTweak_Prefs()

    settings_Categories.fCreate_Categories()
    settings_CustomFields.fCreate_CustomFields()
    
    names_Create.fCreateImportEdit_Names()
    
    slips_Create.Create_Slips(10,10) # pass in numTimeSlips and numExpSlips to create manually; should be 10, 10
    slips_CreateManually.Create_Slips(702,702) # pass in numTimeSlips and numExpSlips to create manually; should be 10, 10
    
    settings_TAL.fSetup_TAL()
    bill_Split.fSetup_SplitBills()
    email_Setup.setup_Templates()
    
    reports_CreateReports.create_Layouts()
    bill_MonthlyCycle.fRun_BillCycle(1,2) # pass in start and end+1 month; should by 1, 13 unless starting in mid stream
    
    ba__Common.fRestore_BABackup()
    ba__Common.fSetup_BADefaultLayout()
    ba__Main.fReview_Arrangements()
    
    bill_BillFields.fBill_BillFields()
    
    calendar_Terms.fSetup_CalTerms()
    calendar_Entries.fCalendar_Entries()
    
    myTools.checkProcesses()
    myTools.endTimeStamp()

    exit()