Spaces:
Running
Running
Update main.py
Browse files5973 unmodified lines5974597559765977597759785979598068 unmodified lines6049605060516052605260536054605579 unmodified lines613561366137613861386139614061415973 unmodified lines
async def create_ar_from_sale(sale_id: str, org_id: str, customer_id: Optional[str] = None): """Create A/R entry and journal entry for a completed sale.""" client = get_supabase() client = get_admin_supabase() sale = await run_sync_db_call( client.table("sales") .select("total_amount, created_at, user_id")68 unmodified lines
async def create_ap_from_po(po_id: str, org_id: str, supplier_id: str): """Create A/P entry and journal entry for a received purchase order.""" client = get_supabase() client = get_admin_supabase() po = await run_sync_db_call( client.table("purchase_orders") .select("total_amount, order_date, supplier_id")79 unmodified lines
async def create_ap_from_grn(grn_id: str, org_id: str): """Create A/P entry and journal entry from a posted GRN.""" client = get_supabase() client = get_admin_supabase()
# 1. Fetch GRN header grn = await run_sync_db_call(main.py+3-3