Added offer and charge
This commit is contained in:
@@ -28,7 +28,7 @@ class LoanRepaymentSchedule(db.Model):
|
||||
# )
|
||||
|
||||
@classmethod
|
||||
def get_all_repayment_schedules(cls, loan_id=None, product_id=None, paid=None,
|
||||
def get_all_repayment_schedules(cls, loan_id=None, product_id=None, transaction_id=None, paid=None,
|
||||
due_before=None, due_after=None, installment_number=None,
|
||||
page=1, limit=20):
|
||||
"""
|
||||
@@ -37,6 +37,7 @@ class LoanRepaymentSchedule(db.Model):
|
||||
Args:
|
||||
loan_id (int, optional): Filter by loan ID
|
||||
product_id (str, optional): Filter by product ID
|
||||
transaction_id (str, optional): Filter by transaction ID
|
||||
paid (bool, optional): Filter by paid status
|
||||
due_before (datetime, optional): Filter schedules due before this date
|
||||
due_after (datetime, optional): Filter schedules due after this date
|
||||
@@ -56,6 +57,9 @@ class LoanRepaymentSchedule(db.Model):
|
||||
if product_id:
|
||||
query = query.filter(cls.product_id == product_id)
|
||||
|
||||
if transaction_id:
|
||||
query = query.filter(cls.transaction_id == transaction_id)
|
||||
|
||||
if paid is not None:
|
||||
query = query.filter(cls.paid == paid)
|
||||
|
||||
@@ -85,6 +89,7 @@ class LoanRepaymentSchedule(db.Model):
|
||||
'id': self.id,
|
||||
'loan_id': self.loan_id,
|
||||
'product_id': self.product_id,
|
||||
'transaction_id': self.transaction_id,
|
||||
'installment_number': self.installment_number,
|
||||
'due_date': self.due_date.isoformat() if self.due_date else None,
|
||||
'installment_amount': self.installment_amount,
|
||||
|
||||
Reference in New Issue
Block a user