Spaces:
Sleeping
Sleeping
| 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) | |