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()