File size: 1,442 Bytes
112ce92
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
import streamlit as st

st.header("Profit Calc")
col1, col2, col3 = st.columns(3)
with col1:
    balance = st.number_input("Total Capital ₹", min_value=0)
initialbalance = balance
with col2:
    investment = st.number_input("Investment ₹", min_value=0)
balance = balance - investment
with col3:
    prof = st.number_input("Profit %", min_value=0)
profit = (prof/100) * investment
pbt = profit
brokerage = st.number_input("Brokerage Charges ₹", min_value=0)
col4, col5 = st.columns(2)
with col4:
    incometax = st.number_input("Incometax Charges %", min_value=0)
with col5:
    service = st.number_input("Service Charges %", min_value=0)
incometaxcharge = (incometax/100) * profit
servicecharge = (service/100) * incometaxcharge
totalcharge = incometaxcharge + servicecharge + brokerage

profit = profit - totalcharge

totalprofit = profit + investment

balance = balance + totalprofit
st.sidebar.header("Dashboard")

st.sidebar.write("Balance: ₹", balance)
st.sidebar.write("Total Charges ₹",totalcharge)
st.sidebar.write("Profit: ₹", profit)
st.sidebar.write("Investment + Profit ₹",totalprofit)

data = {
  "name": ["Initial Balance", "Investment", "Profit Before Tax","brokerage charges","incometax charges", "service charges",  "Final Profit", " Final Balance"],
  "Rs.": [initialbalance, investment, pbt, brokerage, incometaxcharge, servicecharge,  profit, balance]
}
st.sidebar.header("Chart")
st.sidebar.dataframe(data)