Spaces:
Sleeping
Sleeping
poemsforaphrodite
commited on
Commit
โข
5fe0bae
1
Parent(s):
72b6e16
Update app.py
Browse files
app.py
CHANGED
@@ -209,9 +209,21 @@ def calculate_ssnit(basic_salary):
|
|
209 |
|
210 |
def main():
|
211 |
st.set_page_config(page_title="HR Document Assistant", layout="wide")
|
212 |
-
|
213 |
-
|
214 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
215 |
|
216 |
with tab1:
|
217 |
st.header("Upload PDF")
|
@@ -248,8 +260,10 @@ def main():
|
|
248 |
]
|
249 |
|
250 |
selected_document = st.selectbox("Select HR Document Type", document_types)
|
251 |
-
additional_info = st.text_area(
|
252 |
-
|
|
|
|
|
253 |
|
254 |
if st.button("โ๏ธ Generate Document"):
|
255 |
with st.spinner("Generating document..."):
|
@@ -274,8 +288,10 @@ def main():
|
|
274 |
"Executive": (240000, 180000)
|
275 |
}
|
276 |
|
277 |
-
selected_example = st.selectbox(
|
278 |
-
|
|
|
|
|
279 |
|
280 |
if selected_example == "Custom":
|
281 |
annual_income = st.number_input("Annual Income (GHโต)", min_value=0.0, value=0.0, step=1000.0)
|
@@ -306,7 +322,10 @@ def main():
|
|
306 |
sizes = [ssnit_contribution, paye, net_income]
|
307 |
labels = ['SSNIT', 'PAYE', 'Net']
|
308 |
colors = ['#ff9999', '#66b3ff', '#99ff99']
|
309 |
-
ax.pie(
|
|
|
|
|
|
|
310 |
ax.axis('equal')
|
311 |
plt.title("Income Breakdown", fontsize=8)
|
312 |
st.pyplot(fig)
|
@@ -314,7 +333,11 @@ def main():
|
|
314 |
# Display tax rates by income bracket as a table
|
315 |
st.subheader("Tax Rates by Income Bracket")
|
316 |
tax_data = {
|
317 |
-
"Income Range (GHโต)": [
|
|
|
|
|
|
|
|
|
318 |
"Rate (%)": [0, 5, 10, 17.5, 25, 30, 35]
|
319 |
}
|
320 |
df = pd.DataFrame(tax_data)
|
|
|
209 |
|
210 |
def main():
|
211 |
st.set_page_config(page_title="HR Document Assistant", layout="wide")
|
212 |
+
|
213 |
+
# Create a header with logo and title
|
214 |
+
col1, col2 = st.columns([1, 4])
|
215 |
+
with col1:
|
216 |
+
st.image("logo.png", width=200) # Adjust the width as needed
|
217 |
+
with col2:
|
218 |
+
st.title("HR Document Assistant")
|
219 |
+
|
220 |
+
tab1, tab2, tab3, tab4, tab5 = st.tabs([
|
221 |
+
"๐ค Upload PDF",
|
222 |
+
"๐ Query Database",
|
223 |
+
"๐ Generate HR Document",
|
224 |
+
"๐งฎ Tax Calculator",
|
225 |
+
"๐๏ธ Clear Database"
|
226 |
+
])
|
227 |
|
228 |
with tab1:
|
229 |
st.header("Upload PDF")
|
|
|
260 |
]
|
261 |
|
262 |
selected_document = st.selectbox("Select HR Document Type", document_types)
|
263 |
+
additional_info = st.text_area(
|
264 |
+
"Additional Information",
|
265 |
+
placeholder="Enter any specific details or requirements for the document..."
|
266 |
+
)
|
267 |
|
268 |
if st.button("โ๏ธ Generate Document"):
|
269 |
with st.spinner("Generating document..."):
|
|
|
288 |
"Executive": (240000, 180000)
|
289 |
}
|
290 |
|
291 |
+
selected_example = st.selectbox(
|
292 |
+
"Select a salary example or enter custom values:",
|
293 |
+
["Custom"] + list(salary_examples.keys())
|
294 |
+
)
|
295 |
|
296 |
if selected_example == "Custom":
|
297 |
annual_income = st.number_input("Annual Income (GHโต)", min_value=0.0, value=0.0, step=1000.0)
|
|
|
322 |
sizes = [ssnit_contribution, paye, net_income]
|
323 |
labels = ['SSNIT', 'PAYE', 'Net']
|
324 |
colors = ['#ff9999', '#66b3ff', '#99ff99']
|
325 |
+
ax.pie(
|
326 |
+
sizes, labels=labels, colors=colors,
|
327 |
+
autopct='%1.1f%%', startangle=90, textprops={'fontsize': 6}
|
328 |
+
)
|
329 |
ax.axis('equal')
|
330 |
plt.title("Income Breakdown", fontsize=8)
|
331 |
st.pyplot(fig)
|
|
|
333 |
# Display tax rates by income bracket as a table
|
334 |
st.subheader("Tax Rates by Income Bracket")
|
335 |
tax_data = {
|
336 |
+
"Income Range (GHโต)": [
|
337 |
+
"0 - 5,880", "5,881 - 7,200", "7,201 - 8,760",
|
338 |
+
"8,761 - 46,760", "46,761 - 238,760",
|
339 |
+
"238,761 - 605,000", "Above 605,000"
|
340 |
+
],
|
341 |
"Rate (%)": [0, 5, 10, 17.5, 25, 30, 35]
|
342 |
}
|
343 |
df = pd.DataFrame(tax_data)
|