def dump(self):
     elt = self.elements
     elt[DEBIT] = amountt.to_string(elt[DEBIT])
     elt[CREDIT] = amountt.to_string(elt[CREDIT])
     elt[DATE] = datet.to_string(elt[DATE])
     elt[POSTED] = datet.to_string(elt[POSTED])
     return elt
 def print_amounts(name, activity, budget, spent, level=0):
     act = amountt.to_string(activity)
     bud = amountt.to_string(budget)
     spn = amountt.to_string(spent)
     left = budget - spent
     percent = float(left) / float(budget) if budget else 0
     lft = amountt.to_string(left)
     pct = "{:.2f}".format(percent)
     print_line(name, act, bud, spn, lft, pct, level)
예제 #3
0
def vendor_report(forest, entries, layout=None, all_vendors=False):

    # pylint: disable=too-many-arguments
    # pylint: disable=too-many-locals

    trees = forest.tree_number('2.000.000.000').subtrees()

    first = True
    for tree in trees:
        number = tree.node().number()
        details = [entry for entry in entries
                   if entry.number_is([number]) or all_vendors]
        if not details and not tree.node().balance():
            continue

        if not first:
            print
        first = False

        print "{}: prior balance {}, balance {}".format(
            tree.node().name(),
            amountt.to_string(tree.node().balance()-tree.node().period_activity()),
            amountt.to_string(tree.node().balance()))
        detail.detail(details, credit=True, layout=layout)
예제 #4
0
 def print_line(amount, date, name, comment):
     amount = amountt.to_string(amount)
     (month, day, _) = datet.parse_ymd_string(date)
     name = name[:name_w]
     comment = comment[:comment_w]
     print string.format(amount, month, day, name, comment)
예제 #5
0
 def print_amounts(name, activity, balance, level=0):
     print_line(name, amountt.to_string(activity),
                amountt.to_string(balance), level)