Exemplo n.º 1
0
 def virtual_revenue_by_period(cls, period, start=None, end=None):
     r = DBSession.query(cls.amount.label('summable'), event.Event.timestamp)\
                  .join(Transaction)\
                  .join(event.Event)\
                  .filter(event.Event.deleted==False)\
                  .order_by(event.Event.timestamp)
     if start:
         r = r.filter(event.Event.timestamp>=start.replace(tzinfo=None))
     if end:
         r = r.filter(event.Event.timestamp<end.replace(tzinfo=None))
     return utility.group(r.all(), period)
Exemplo n.º 2
0
 def virtual_revenue_by_period(cls, period, start=None, end=None):
     r = DBSession.query(cls.amount.label('summable'), event.Event.timestamp)\
                  .join(Transaction)\
                  .join(event.Event)\
                  .filter(event.Event.deleted==False)\
                  .order_by(event.Event.timestamp)
     if start:
         r = r.filter(event.Event.timestamp >= start.replace(tzinfo=None))
     if end:
         r = r.filter(event.Event.timestamp < end.replace(tzinfo=None))
     return utility.group(r.all(), period)
Exemplo n.º 3
0
 def quantity_by_period(cls, period, start=None, end=None):
     r = DBSession.query(cls.quantity.label('summable'), event.Event.timestamp)\
                  .join(Transaction)\
                  .join(event.Event)\
                  .filter(event.Event.deleted==False)\
                  .order_by(event.Event.timestamp)
     if start:
         r = r.filter(event.Event.timestamp>=start)
     if end:
         r = r.filter(event.Event.timestamp<end)
     return utility.group(r.all(), period)
Exemplo n.º 4
0
 def virtual_revenue_by_period(cls, period):
     r = DBSession.query(cls.amount.label('summable'), event.Event.timestamp)\
                  .join(Transaction)\
                  .join(event.Event)\
                  .order_by(event.Event.timestamp).all()
     return utility.group(r, period)
Exemplo n.º 5
0
 def deposits_by_period(cls, period):
     r = DBSession.query(cls.amount.label('summable'), event.Event.timestamp)\
                  .join(event.Event)\
                  .order_by(event.Event.timestamp).all()
     return utility.group(r, period)