Ejemplo n.º 1
0
def newEvent(event, acct=None, posted=None, note=None, amount=None):
    e = Event()
    e.account = acct or None
    e.event = event
    if type(posted) == type(""):
        e.posted = DateTime(posted)
    elif isinstance(posted, DateTime) or isinstance(posted, Date):
        e.posted = posted
    elif not posted:
        e.posted = DateTime("now")
    else:
        raise TypeError, "Event posted with illegal DateTime type"
    e.amount = amount or Decimal("0.00")
    e.note = note or ""
    return e
Ejemplo n.º 2
0
def newEvent(event, acct=None, posted=None, note=None, amount=None):
    e = Event()
    e.account = acct or None
    e.event = event
    if type(posted) == type(""):
        e.posted = DateTime(posted)
    elif isinstance(posted, DateTime) or isinstance(posted, Date):
        e.posted = posted
    elif not posted:
        e.posted = DateTime("now")
    else:
        raise TypeError, "Event posted with illegal DateTime type"
    e.amount = amount or FixedPoint("0.00")
    e.note = note or ""
    return e