Spaces:
Runtime error
Runtime error
Download app.py from jonels1988/BusinessSolutionsKnowledgeBase: direct link, hf CLI and curl.
- Browser
- Download file 5.33 kB
-
https://huggingface.co/spaces/jonels1988/BusinessSolutionsKnowledgeBase/resolve/main/app.py
- Command line
-
hf download hf://spaces/jonels1988/BusinessSolutionsKnowledgeBase/app.py
-
curl -L -o app.py https://huggingface.co/spaces/jonels1988/BusinessSolutionsKnowledgeBase/resolve/main/app.py
5.33 kB
| import streamlit as st | |
| # Set page config MUST be first Streamlit command | |
| st.set_page_config( | |
| page_title="Business Knowledge Base", | |
| page_icon="π", | |
| layout="wide", | |
| initial_sidebar_state="expanded" | |
| ) | |
| # Initialize session state for knowledge base | |
| if 'knowledge_base' not in st.session_state: | |
| st.session_state.knowledge_base = { | |
| 'bookkeeping': [ | |
| { | |
| 'subTopic': 'Accounts Receivable', | |
| 'title': 'GTM Medical Trading - Payments Tender', | |
| 'description': 'Streamlined 3-step process for GTM Medical Trading invoice payments using AgileSuite QuickBooks system to significantly reduce processing fees while maintaining accuracy.', | |
| 'steps': [ | |
| 'Step 1: Open AgileSuite Payment Form and input transaction date, total amount, and invoice count', | |
| 'Step 2: Update multi-use link amount in QuickBooks and scan QR code with separate device', | |
| 'Step 3: Process payment through customer checkout page and use action buttons to complete' | |
| ], | |
| 'benefits': [ | |
| 'Cost Reduction: Saves $600-$1,000+ monthly in processing fees', | |
| 'Time Efficiency: Process 5-10 invoices simultaneously', | |
| 'Accuracy: Automated system matching prevents duplicates', | |
| 'Simplicity: Three straightforward steps replace complex manual processes' | |
| ] | |
| } | |
| ], | |
| 'quickbooks': [], | |
| 'paytrace': [], | |
| 'fishbowl': [], | |
| 'tax': [], | |
| 'business': [], | |
| 'budgeting': [] | |
| } | |
| # Main app | |
| def main(): | |
| st.title("π Business Knowledge Base") | |
| st.markdown("QuickBooks β’ PayTrace β’ Fishbowl β’ Tax Preparation β’ Business Solutions") | |
| # Sidebar for navigation | |
| with st.sidebar: | |
| st.header("Categories") | |
| selected_category = st.radio( | |
| "Select Category:", | |
| ["Bookkeeping - Operations", "QuickBooks", "PayTrace", "Fishbowl Inventory", | |
| "Tax Preparation", "Business Solutions", "Budgeting"], | |
| index=0 | |
| ) | |
| st.divider() | |
| if st.button("β Add New Content"): | |
| st.session_state.show_add_form = True | |
| # Main content area | |
| if selected_category == "Bookkeeping - Operations": | |
| display_bookkeeping_content() | |
| else: | |
| st.info(f"Content for {selected_category} coming soon...") | |
| st.button("Add first article to this category") | |
| # Add content form | |
| if st.session_state.get('show_add_form', False): | |
| display_add_content_form() | |
| def display_bookkeeping_content(): | |
| st.header("Bookkeeping - Operations") | |
| # Breadcrumb | |
| st.caption("Home > Bookkeeping - Operations > Accounts Receivable") | |
| # Article content | |
| article = st.session_state.knowledge_base['bookkeeping'][0] | |
| st.subheader(article['title']) | |
| st.write(article['description']) | |
| # Key points in columns | |
| col1, col2 = st.columns(2) | |
| with col1: | |
| st.info("**π° Cost Savings:** $600-$1,000+ monthly") | |
| st.info("**β±οΈ Time Savings:** Process 5-10 invoices together") | |
| with col2: | |
| st.info("**β Accuracy:** Automated matching") | |
| st.info("**π± Simple:** 3-step process") | |
| # 3-Step Process | |
| st.subheader("3-Step Payment Process") | |
| steps = article['steps'] | |
| for step in steps: | |
| st.write(f"**{step}**") | |
| # Important Notes | |
| st.warning(""" | |
| **Important Notes:** | |
| - Always use separate device/QR code for payment entry | |
| - Never manually match payments after processing | |
| - Include shipping costs in total amount | |
| - Contact support for issues rather than manual adjustments | |
| """) | |
| # Action buttons | |
| col1, col2, col3, col4 = st.columns(4) | |
| with col1: | |
| if st.button("π§ Send Copy", use_container_width=True): | |
| st.success("Copy sent to QuickBooks!") | |
| with col2: | |
| if st.button("π¨οΈ Print", use_container_width=True): | |
| st.success("Ready for printing...") | |
| with col3: | |
| if st.button("πΎ Save", use_container_width=True): | |
| st.success("Transaction saved!") | |
| with col4: | |
| if st.button("ποΈ Clear Form", use_container_width=True): | |
| st.session_state.knowledge_base['bookkeeping'][0] = st.session_state.knowledge_base['bookkeeping'][0].copy() | |
| st.rerun() | |
| def display_add_content_form(): | |
| st.sidebar.divider() | |
| st.sidebar.subheader("Add New Content") | |
| with st.sidebar.form("add_content_form"): | |
| category = st.selectbox("Category", list(st.session_state.knowledge_base.keys())) | |
| sub_topic = st.text_input("Subtopic") | |
| title = st.text_input("Article Title") | |
| description = st.text_area("Description") | |
| submitted = st.form_submit_button("Add Article") | |
| if submitted: | |
| if sub_topic and title: | |
| # Add validation and saving logic here | |
| st.sidebar.success("Article added successfully!") | |
| st.session_state.show_add_form = False | |
| st.rerun() | |
| else: | |
| st.sidebar.error("Please fill in required fields") | |
| if __name__ == "__main__": | |
| main() |