add roic rule

This commit is contained in:
MuslemRahimi 2024-09-07 11:20:18 +02:00
parent b5a939d0d6
commit 0586fd2501

View File

@ -355,6 +355,14 @@ def get_financial_statements(item, symbol):
item['profitPerEmployee'] = round((item['netIncome'] / item['employees']),2) item['profitPerEmployee'] = round((item['netIncome'] / item['employees']),2)
except: except:
item['profitPerEmployee'] = None item['profitPerEmployee'] = None
try:
tax_rate = item['incomeTaxExpense'] / item['incomeBeforeTax'] if item['incomeBeforeTax'] != 0 else 0
nopat = item['operatingIncome'] * (1 - tax_rate)
invested_capital = item['totalDebt'] + item['totalEquity']
item['returnOnInvestedCapital'] = round((nopat / invested_capital)*100,2) if invested_capital != 0 else None
except:
item['returnOnInvestedCapital'] = None
return item return item