Spaces:
Sleeping
Sleeping
mattoofahaddcube
commited on
Commit
•
5858a75
1
Parent(s):
194df8b
updating for initial or parameter
Browse files
app.py
CHANGED
@@ -45,35 +45,50 @@ if st.button("Calculate", use_container_width=True) and st.session_state.valid_i
|
|
45 |
st.markdown("---")
|
46 |
if st.session_state.user_initial_desired_net > 0:
|
47 |
st.success("✅ Initial Desired Net Salary was provided by the user.")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
48 |
else:
|
49 |
st.info(
|
50 |
"ℹ️ Initial Desired Net Salary was calculated based on the provided parameters."
|
51 |
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
52 |
|
53 |
# Display a summary of the calculation
|
54 |
st.subheader("Calculation Summary")
|
55 |
-
|
56 |
-
{
|
57 |
-
"Parameter": [
|
58 |
-
"Current Salary",
|
59 |
-
"Desired Increment",
|
60 |
-
"Daily Travel Cost",
|
61 |
-
"On-Site Days/Week",
|
62 |
-
"Gross Salary",
|
63 |
-
"Tax",
|
64 |
-
"Final Net Salary",
|
65 |
-
],
|
66 |
-
"Value": [
|
67 |
-
f"PKR {st.session_state.current_salary:,.2f}",
|
68 |
-
f"{st.session_state.desired_increment_percentage:.2%}",
|
69 |
-
f"PKR {st.session_state.daily_cost_of_travel:,.2f}",
|
70 |
-
f"{st.session_state.physical_days_per_week}",
|
71 |
-
f"PKR {result['gross_salary_needed']:,.2f}",
|
72 |
-
f"PKR {result['tax']:,.2f}",
|
73 |
-
f"PKR {result['final_net_salary']:,.2f}",
|
74 |
-
],
|
75 |
-
}
|
76 |
-
)
|
77 |
st.table(summary_df)
|
78 |
|
79 |
st.subheader("Salary Breakdown")
|
|
|
45 |
st.markdown("---")
|
46 |
if st.session_state.user_initial_desired_net > 0:
|
47 |
st.success("✅ Initial Desired Net Salary was provided by the user.")
|
48 |
+
summary_df = pd.DataFrame(
|
49 |
+
{
|
50 |
+
"Parameter": [
|
51 |
+
"Final Net Salary",
|
52 |
+
"Tax",
|
53 |
+
"Gross Salary",
|
54 |
+
],
|
55 |
+
"Value": [
|
56 |
+
f"PKR {result['final_net_salary']:,.2f}",
|
57 |
+
f"PKR {result['tax']:,.2f}",
|
58 |
+
f"PKR {result['gross_salary_needed']:,.2f}",
|
59 |
+
],
|
60 |
+
}
|
61 |
+
)
|
62 |
else:
|
63 |
st.info(
|
64 |
"ℹ️ Initial Desired Net Salary was calculated based on the provided parameters."
|
65 |
)
|
66 |
+
summary_df = pd.DataFrame(
|
67 |
+
{
|
68 |
+
"Parameter": [
|
69 |
+
"Current Salary",
|
70 |
+
"Desired Increment",
|
71 |
+
"Daily Travel Cost",
|
72 |
+
"On-Site Days/Week",
|
73 |
+
"Gross Salary",
|
74 |
+
"Tax",
|
75 |
+
"Final Net Salary",
|
76 |
+
],
|
77 |
+
"Value": [
|
78 |
+
f"PKR {st.session_state.current_salary:,.2f}",
|
79 |
+
f"{st.session_state.desired_increment_percentage:.2%}",
|
80 |
+
f"PKR {st.session_state.daily_cost_of_travel:,.2f}",
|
81 |
+
f"{st.session_state.physical_days_per_week}",
|
82 |
+
f"PKR {result['gross_salary_needed']:,.2f}",
|
83 |
+
f"PKR {result['tax']:,.2f}",
|
84 |
+
f"PKR {result['final_net_salary']:,.2f}",
|
85 |
+
],
|
86 |
+
}
|
87 |
+
)
|
88 |
|
89 |
# Display a summary of the calculation
|
90 |
st.subheader("Calculation Summary")
|
91 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
92 |
st.table(summary_df)
|
93 |
|
94 |
st.subheader("Salary Breakdown")
|