Esempio n. 1
0
def command(timebook, config, sheet, start, end, billing, format, money, **kwargs):
    # get the db
    cfg=parse_config(config)
    db=Database(timebook, cfg)

    sheet = sheet or db.get_current_sheet()

    start_timestamp = parse_date_time(start) if start else None
    end_timestamp = parse_date_time(end) if end else None

    if billing:
        if start or end:
            parser.error('if you specify --billing, you cannot specify a start ' \
                'or end ')

        billing_time = db.get_billing_start_time(sheet)

        if billing_time:
            start_timestamp = billing_time

    display(db, sheet, start_timestamp, end_timestamp, format, money)