Subversion Repositories SmartDukaan

Rev

Rev 3195 | Rev 3226 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 3195 Rev 3216
Line 658... Line 658...
658
def get_valid_order_count():
658
def get_valid_order_count():
659
    '''
659
    '''
660
    Returns the number of orders which we processed. The reshipped orders are not
660
    Returns the number of orders which we processed. The reshipped orders are not
661
    counted since there'll always be a new compensating order present.
661
    counted since there'll always be a new compensating order present.
662
    '''
662
    '''
663
    return Order.query.filter(Order.status >= OrderStatus.SUBMITTED_FOR_PROCESSING).filter(not_(Order.status.in_((OrderStatus.SALES_RET_RESHIPPED, OrderStatus.DOA_INVALID_RESHIPPED, OrderStatus.DOA_RESHIPPED)))).count()
663
    return Order.query.filter(Order.status >= OrderStatus.SUBMITTED_FOR_PROCESSING).filter(not_(Order.status.in_((OrderStatus.SALES_RET_RESHIPPED, OrderStatus.DOA_INVALID_RESHIPPED, OrderStatus.DOA_RESHIPPED, OrderStatus.CANCELED)))).count()
664
 
664
 
665
def get_cust_count_with_successful_txn():
665
def get_cust_count_with_successful_txn():
666
    '''
666
    '''
667
    Returns the number of distinct customers who have done successful transactions.
667
    Returns the number of distinct customers who have done successful transactions.
668
    It uses the sqlalchemy func module to construct an efficient query.
668
    It uses the sqlalchemy func module to construct an efficient query.