Example #1
0
File: wip.py Project: blippy/pypms
    # output the totals for each job code
    for wip in wips:
        line = create_wip_line(wip, data["auto_invoices"])
        output.append(line)
    total = common.summate_cols(output)
    total[0] = "TOTAL"
    total[4] = ""
    output.append(total)

    return output


###########################################################################


def create_wip_report(data, output_text=True):
    output = create_wip_lines(data)
    if output_text:
        period.create_text_report("wip.txt", output)
    else:
        # TODO Consider zapping Excel output option if considered unecessary
        excel.create_report("Wip", output, [2, 3, 4, 5, 6, 7])


###########################################################################

if __name__ == "__main__":
    data = db.load_state()
    create_wip_report(data)
    princ("Finish")
Example #2
0
    
    camel_recoveries = tweaks.tweak_recoveries(the_tweaks)
    jobcodes_to_process = set(tweaks.tweaked_jobs(the_tweaks))
    db_recoveries = get_dbase_recoveries(d)
    for k, v in db_recoveries.items():
        if abs(v) >= 0.01: jobcodes_to_process.add(k)    
    jobcodes_to_process = sorted(list(jobcodes_to_process))
    output = ['RECOVERY RECONILIATION', '']

    tweaks_grand_total = 0.0
    pms_grand_total = 0.0
    for job_code in jobcodes_to_process:
        job = d['jobs'][job_code] # TODO - d['jobs'][job_code] is a common idiom which ought to be abstracted        
        camel_job_recoveries = dget(camel_recoveries, job_code, [])
        db_job_recovery = dget(db_recoveries, job_code)
        tweak_amount, recovery_text = create_recovery_text(job, camel_job_recoveries, db_job_recovery)
        output += recovery_text
        tweaks_grand_total += tweak_amount
        pms_grand_total += db_job_recovery
       
    output.append('SUMMARY:')
    output.append(line(tweaks_grand_total, 'TWEAKS GRAND TOTAL'))
    output.append(line(pms_grand_total, 'PMS GRAND TOTAL'))
    output.append(line(tweaks_grand_total - pms_grand_total, 'OVERALL DIFF'))
    period.save_report('recoveries.txt', output)
    
        
if  __name__ == "__main__":
    d = db.load_state()
    create_recovery_report(d)
    princ("Finished")