removed collected amount check
This commit is contained in:
+2
-2
@@ -341,8 +341,8 @@ class Loan(db.Model):
|
|||||||
balance = Decimal(str(loan.balance or 0)).quantize(Decimal("0.01"), rounding=ROUND_HALF_UP)
|
balance = Decimal(str(loan.balance or 0)).quantize(Decimal("0.01"), rounding=ROUND_HALF_UP)
|
||||||
|
|
||||||
# Ensure valid repayment amount
|
# Ensure valid repayment amount
|
||||||
if amount_collected <= Decimal("0.00"):
|
# if amount_collected <= Decimal("0.00"):
|
||||||
raise ValueError("Repayment amount must be greater than zero.")
|
# raise ValueError("Repayment amount must be greater than zero.")
|
||||||
if balance <= Decimal("0.00"):
|
if balance <= Decimal("0.00"):
|
||||||
raise ValueError("There is no balance for this loan.")
|
raise ValueError("There is no balance for this loan.")
|
||||||
if amount_collected > balance:
|
if amount_collected > balance:
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ def get_headers():
|
|||||||
"password": "G7$k9@pL2!qR"
|
"password": "G7$k9@pL2!qR"
|
||||||
}
|
}
|
||||||
logger.info(f"Calling Bank Call-Auth Endpoint: {url}")
|
logger.info(f"Calling Bank Call-Auth Endpoint: {url}")
|
||||||
logger.info(f"Calling Bank Call-Auth Endpoint with data: {data}")
|
|
||||||
|
|
||||||
headers = {"Content-Type": "application/json"}
|
headers = {"Content-Type": "application/json"}
|
||||||
|
|
||||||
@@ -25,7 +24,6 @@ def get_headers():
|
|||||||
response.raise_for_status() # Raises HTTPError for 4xx/5xx
|
response.raise_for_status() # Raises HTTPError for 4xx/5xx
|
||||||
result = response.json()
|
result = response.json()
|
||||||
|
|
||||||
logger.info(f"Bank Call Auth Response: {result}")
|
|
||||||
|
|
||||||
# Check if access_token is present
|
# Check if access_token is present
|
||||||
if 'access_token' not in result:
|
if 'access_token' not in result:
|
||||||
|
|||||||
Reference in New Issue
Block a user