-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #404 from roberanegussie/debtServiceCoverageRatio
Debt service coverage ratio
- Loading branch information
Showing
6 changed files
with
97 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
from helpers import functions | ||
from fastapi import HTTPException, status | ||
|
||
def debt_service_coverage_ratio_task(revenue: float, operating_expenses: float, interest: float, | ||
tax_rate: float, principal: float): | ||
try: | ||
net_operating_income = revenue - operating_expenses | ||
total_debt_service = (interest * (1 - tax_rate)) + principal | ||
ratio = functions.debt_service_coverage_ratio(revenue, | ||
operating_expenses, | ||
interest, | ||
tax_rate, | ||
principal) | ||
return { | ||
"Tag": "Debt Service Coverage Ratio", | ||
"Revenue": revenue, | ||
"Operating Expenses": operating_expenses, | ||
"Interest": interest, | ||
"Tax Rate": tax_rate, | ||
"Principal": principal, | ||
"Net Operating Income": net_operating_income, | ||
"Total Debt Service": total_debt_service, | ||
"Debt Service Coverage Ratio": ratio | ||
} | ||
except: | ||
return HTTPException(status_code=status.HTTP_500_INTERNAL_SERVER_ERROR) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters