{
    "title": "Journal Entry",
    "body": [
      {
        "type": "tabs",
        "tabs": [
          {
            "label": "Create Entry",
            "elements": [
              {
                "type": "form",
                "options": {
                  "formId": 202,
                  "tableName": "GL_Journal_Entries",
                  "submitEndpoint": "/api/gl-transactions/post-entry",
                  "customComponents": {
                    "journal_lines": "JournalLinesEditor"
                  },
                  "onSuccess": "refreshJournalEntries"
                }
              }
            ]
          },
          {
            "label": "Recent Entries",
            "elements": [
              {
                "type": "table",
                "options": {
                  "tableName": "GL_Journal_Entries",
                  "orderBy": "entry_date DESC, created_at DESC",
                  "limit": 50,
                  "columnsToShow": ["entry_date", "reference", "description", "total_debits", "status"],
                  "rowActions": [
                    {
                      "label": "View Details",
                      "onClick": "viewJournalEntry"
                    },
                    {
                      "label": "Reverse Entry",
                      "onClick": "reverseJournalEntry",
                      "condition": "status == \"posted\"",
                      "confirm": "Are you sure you want to reverse this journal entry?"
                    }
                  ],
                  "filters": {
                    "status": ["draft", "posted", "reversed"]
                  }
                }
              }
            ]
          },
          {
            "label": "Trial Balance",
            "elements": [
              {
                "type": "button",
                "label": "Generate Trial Balance",
                "style": "primary",
                "onClick": "generateTrialBalance"
              },
              {
                "type": "date-picker",
                "id": "trialBalanceDate",
                "label": "As of Date",
                "value": "today"
              },
              {
                "type": "report-viewer",
                "id": "trialBalanceReport",
                "options": {
                  "endpoint": "/api/gl-transactions/trial-balance",
                  "reportType": "trial_balance",
                  "exportFormats": ["pdf", "csv", "excel"]
                }
              }
            ]
          }
        ]
      }
    ],
    "header": [
      {
        "type": "button",
        "label": "New Journal Entry",
        "formId": 202
      },
      {
        "type": "button",
        "label": "Trial Balance",
        "onClick": "showTrialBalance"
      }
    ],
    "footer": [
      {
        "type": "button",
        "label": "Close",
        "onClick": "closeModal"
      }
    ]
  }