{"body": [{"tabs": [{"label": "Cases", "elements": [{"type": "table", "options": {"addButton": false, "tableName": "cases", "rowActions": [{"label": "Select", "onClick": "selectCaseForManagement"}], "filterField": "client_name", "listenColumn": "client_name", "columnsToShow": ["client_name", "case_number", "title", "lead_rep_name", "status", "added_by"], "primaryKeyField": "case_id", "showGlobalSearch": false}}]}, {"label": "Details", "elements": [{"type": "detail-view", "viewId": 2, "tableName": "cases", "filterField": "case_id"}]}, {"label": "Instructions", "elements": [{"type": "button", "label": "Add Instruction", "formName": "Case Instruction", "prefillFilter": "case_id"}, {"type": "table", "options": {"addButton": false, "tableName": "case_instructions", "inlineEdit": true, "filterField": "case_id", "showGlobalSearch": false}}]}, {"label": "Documents", "elements": [{"type": "documents", "options": {"filterField": "case_id", "listenColumn": "case_id", "metadataFields": {"status": "status", "client_id": "client_id", "case_title": "title", "case_number": "case_number", "client_name": "client_name", "matter_type": "matter_type"}}}]}, {"label": "Hours", "elements": [{"type": "table", "options": {"tableUrl": "../api/time_entries", "addButton": false, "tableName": "time_entries", "editFormId": 38, "inlineEdit": true, "filterField": "reference_id", "listenColumn": "case_id", "columnsToShow": ["Counsel", "date", "hours", "total", "work_type", "description"], "ownerEditOnly": true, "multipleSelect": true, "showGlobalSearch": false}}]}, {"label": "Expenses", "elements": [{"type": "table", "options": {"addButton": false, "tableName": "expenses", "editFormId": 48, "inlineEdit": true, "filterField": "reference_id", "listenColumn": "case_id", "columnsToShow": ["date", "counsel", "amount", "description", "billable"], "ownerEditOnly": true, "multipleSelect": true, "showGlobalSearch": false}}]}, {"label": "One Time Costs", "elements": [{"type": "button", "label": "Add One Time Cost", "formName": "One Time Cost", "prefillFilter": "case_id"}, {"type": "table", "options": {"addButton": false, "tableName": "one_time_service_costs", "editFormId": 58, "inlineEdit": true, "filterField": "reference_id", "listenColumn": "case_id", "columnsToShow": ["date", "counsel", "amount", "description", "billable"], "ownerEditOnly": true, "multipleSelect": true, "showGlobalSearch": false}}]}, {"label": "Invoices", "elements": [{"type": "table", "options": {"filters": {"reference_table": "cases"}, "addButton": false, "tableName": "invoices", "inlineEdit": true, "rowActions": [{"label": "Edit", "onClick": "openCaseInvoiceEditForm"}, {"label": "Record Payment", "onClick": "recordInvoicePayment"}, {"icon": "fa-paper-plane", "label": "Submit to TaxCore", "onClick": "submitInvoiceToTaxCore", "condition": "status == 'approved'"}, {"label": "Download", "onClick": "downloadCaseInvoice"}, {"label": "Preview", "onClick": "previewCaseInvoice"}], "filterField": "reference_id", "listenColumn": "case_id", "columnsToShow": ["invoice_date", "sent_at", "invoice_number", "amount", "amount_paid", "balance"], "showGlobalSearch": false}}]}, {"label": "Payments", "elements": [{"type": "table", "options": {"filters": {"reference_table": "cases"}, "addButton": false, "tableName": "payments", "inlineEdit": true, "filterField": "reference_id", "listenColumn": "case_id", "columnsToShow": ["payment_date", "total_amount", "payment_method", "status", "notes"], "showGlobalSearch": false}}]}], "type": "tabs"}], "title": "Case Management", "footer": [{"type": "button", "label": "Close", "onClick": "closeModal"}], "header": [{"type": "filter-select", "options": {"data_column": "client_name", "debounce_ms": 250, "max_results": 25, "placeholder": "Search by client name...", "populateMode": "immediate", "source_table": "clients", "search_fields": ["name"], "source_column": "client_id", "data_column_id": "selected_client_id", "display_column": "name"}}, {"type": "button", "label": "Add Client", "formName": "Client"}, {"type": "button", "label": "Edit Client", "onClick": "openEditForm"}, {"type": "button", "label": "Add Case", "formName": "Case"}, {"type": "button", "label": "Edit Case", "onClick": "openEditForm"}, {"type": "button", "label": "Add Hour", "formName": "Time Entries", "prefillFilter": "case_id", "source_column": "case_id"}, {"type": "button", "label": "Add Expense", "formName": "Case Expense", "prefillFilter": "case_id"}, {"type": "button", "label": "Add One Time Cost", "formName": "One Time Cost", "prefillFilter": "case_id"}, {"type": "button", "label": "Create Cost Schedule", "onClick": "createCostSchedule"}, {"type": "button", "label": "Create Invoice", "onClick": "createCostSchedule"}, {"type": "button", "label": "Record Payment", "onClick": "recordGeneralPayment"}, {"type": "button", "label": "TaxCore Settings", "onClick": "openTaxCoreSettings"}, {"type": "button", "label": "Transactions", "onClick": "showCaseTransactions"}, {"type": "button", "label": "Back", "onClick": "backToCases"}]}