Subversion Repositories SmartDukaan

Rev

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

Rev 18797 Rev 18804
Line 9118... Line 9118...
9118
    if offset>0 and limit >0:
9118
    if offset>0 and limit >0:
9119
        credit_hs_query = credit_hs_query.offset(offset)
9119
        credit_hs_query = credit_hs_query.offset(offset)
9120
    return credit_hs_query.all()
9120
    return credit_hs_query.all()
9121
 
9121
 
9122
def get_credit_history_records_paginated(paymentId, userId, creditorId, creditTxnType, limit=0, offset=0):
9122
def get_credit_history_records_paginated(paymentId, userId, creditorId, creditTxnType, limit=0, offset=0):
9123
    totalCount = CreditHistory.query.filter(CreditHistory.id>0).count()
9123
    totalCount = CreditHistory.query.count()
9124
    hasMore = False
9124
    hasMore = False
9125
    if limit >0 and offset > 0 and (limit+offset) < totalCount:
9125
    if limit >0 and offset > 0 and (limit+offset) < totalCount:
9126
        hasMore = True
9126
        hasMore = True
9127
    credit_hs_query = CreditHistory.query
9127
    credit_hs_query = CreditHistory.query
9128
    if paymentId and paymentId>0:
9128
    if paymentId and paymentId>0:
Line 9248... Line 9248...
9248
        loan_hs_query = loan_hs_query.offset(offset)
9248
        loan_hs_query = loan_hs_query.offset(offset)
9249
    
9249
    
9250
    return loan_hs_query.all()
9250
    return loan_hs_query.all()
9251
 
9251
 
9252
def get_loan_history_records_paginated(paymentId, userId, creditorId, creditTxnType, limit=0, offset=0):
9252
def get_loan_history_records_paginated(paymentId, userId, creditorId, creditTxnType, limit=0, offset=0):
9253
    totalCount = LoanHistory.query.filter(LoanHistory.id>0).count()
9253
    totalCount = LoanHistory.query.count()
9254
    hasMore = False
9254
    hasMore = False
9255
    if limit >0 and offset > 0 and (limit+offset) < totalCount:
9255
    if limit >0 and offset > 0 and (limit+offset) < totalCount:
9256
        hasMore = True
9256
        hasMore = True
9257
    loan_hs_query = LoanHistory.query
9257
    loan_hs_query = LoanHistory.query
9258
    if paymentId and paymentId>0:
9258
    if paymentId and paymentId>0: