Subversion Repositories SmartDukaan

Rev

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

Rev 18829 Rev 18903
Line 9120... Line 9120...
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.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 (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:
9129
        credit_hs_query = credit_hs_query.filter(CreditHistory.payment_id==paymentId)
9129
        credit_hs_query = credit_hs_query.filter(CreditHistory.payment_id==paymentId)
9130
    if userId and userId>0:
9130
    if userId and userId>0:
Line 9250... Line 9250...
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.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 (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:
9259
        loan_hs_query = loan_hs_query.filter(LoanHistory.payment_id==paymentId)
9259
        loan_hs_query = loan_hs_query.filter(LoanHistory.payment_id==paymentId)
9260
    if userId and userId>0:
9260
    if userId and userId>0: