Update app.py
Browse files68 unmodified lines6970717272737576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311474757651 unmodified lines12812913017213113213313468 unmodified lines return blank_area, cost
# Add debug section at the topst.title("📦 Packaging Box Cost Calculator")
# Debug sectionwith st.expander("🔧 Debug & Testing"): st.write("Use this section to test your Google Sheets integration") if st.button("Test Webhook Connection"): status_code, response_text = test_webhook_connection() if status_code: if status_code == 200: st.success(f"✅ Webhook is reachable! Status: {status_code}") st.code(response_text) else: st.error(f"❌ Webhook returned status {status_code}") st.code(response_text) else: st.error(f"❌ Cannot reach webhook: {response_text}") debug_mode = st.checkbox("Enable Debug Mode (shows detailed logging info)") if st.button("Send Test Data"): test_data = { "company_name": "Test Company", "box_length": 12.0, "box_width": 10.0, "box_height": 6.0, "material_type": "32 ECT C-Flute", "moq": 1000, "current_price": 0.50, "blank_area": 5.625, "estimated_cost": 0.5625, "price_difference_percent": -11.1 } success, message = send_to_google_sheet(test_data, debug=True) if success: st.success("✅ Test data sent successfully!") else: st.error(f"❌ Failed to send test data: {message}")
st.markdown("---")
# Input formcompany_name = st.text_input("Company Name*", placeholder="Enter your company name")
51 unmodified lines } # Send data to Google Sheets success, message = send_to_google_sheet(sheet_data, debug=debug_mode) success, message = send_to_google_sheet(sheet_data) if success: st.success("📊 Data logged successfully!")app.py+1-42