poemsforaphrodite commited on
Commit
5fe0bae
โ€ข
1 Parent(s): 72b6e16

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +32 -9
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
- st.title("HR Document Assistant")
213
-
214
- tab1, tab2, tab3, tab4, tab5 = st.tabs(["๐Ÿ“ค Upload PDF", "๐Ÿ” Query Database", "๐Ÿ“ Generate HR Document", "๐Ÿงฎ Tax Calculator", "๐Ÿ—‘๏ธ Clear Database"])
 
 
 
 
 
 
 
 
 
 
 
 
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("Additional Information",
252
- placeholder="Enter any specific details or requirements for the document...")
 
 
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("Select a salary example or enter custom values:",
278
- ["Custom"] + list(salary_examples.keys()))
 
 
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(sizes, labels=labels, colors=colors, autopct='%1.1f%%', startangle=90, textprops={'fontsize': 6})
 
 
 
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โ‚ต)": ["0 - 5,880", "5,881 - 7,200", "7,201 - 8,760", "8,761 - 46,760", "46,761 - 238,760", "238,761 - 605,000", "Above 605,000"],
 
 
 
 
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)