{
    "checks": [
        {
            "name": "Transactions Without Cash Flow Entries",
            "description": "Sales transactions that have no corresponding cash_flow_transactions entries",
            "issues_found": 18,
            "details": [],
            "priority": "high"
        },
        {
            "name": "Transactions Without HPP Cash Flow Entries",
            "description": "Sales transactions with HPP but no corresponding HPP cash_flow_transactions",
            "issues_found": 18,
            "details": [],
            "priority": "high"
        },
        {
            "name": "Cash Flow Entries Without Journals",
            "description": "Cash flow transactions that have no corresponding journal entries",
            "issues_found": 20742,
            "details": [],
            "priority": "high"
        },
        {
            "name": "Journals Without Entries",
            "description": "Journal headers that have no corresponding journal entries",
            "issues_found": 0,
            "details": [],
            "priority": "high"
        },
        {
            "name": "Unbalanced Journals",
            "description": "Journals where debit and credit totals do not match",
            "issues_found": 0,
            "details": [],
            "priority": "high"
        },
        {
            "name": "Amount Mismatches Between Cash Flow and Journal Entries",
            "description": "Cash flow transactions with amounts that do not match their corresponding journal entries",
            "issues_found": 0,
            "details": [],
            "priority": "medium"
        },
        {
            "name": "Missing Account Settings",
            "description": "Branch and transaction type combinations that have no account settings defined",
            "issues_found": 18,
            "details": [
                {
                    "branch_id": 1,
                    "transaction_type": "penjualan"
                },
                {
                    "branch_id": 1,
                    "transaction_type": "hpp"
                },
                {
                    "branch_id": 1,
                    "transaction_type": "pembelian"
                },
                {
                    "branch_id": 1,
                    "transaction_type": "pengeluaran"
                },
                {
                    "branch_id": 1,
                    "transaction_type": "stock_opname_surplus"
                },
                {
                    "branch_id": 1,
                    "transaction_type": "stock_opname_deficit"
                },
                {
                    "branch_id": 5,
                    "transaction_type": "penjualan"
                },
                {
                    "branch_id": 5,
                    "transaction_type": "hpp"
                },
                {
                    "branch_id": 5,
                    "transaction_type": "pembelian"
                },
                {
                    "branch_id": 5,
                    "transaction_type": "pengeluaran"
                },
                {
                    "branch_id": 5,
                    "transaction_type": "stock_opname_surplus"
                },
                {
                    "branch_id": 5,
                    "transaction_type": "stock_opname_deficit"
                },
                {
                    "branch_id": 6,
                    "transaction_type": "penjualan"
                },
                {
                    "branch_id": 6,
                    "transaction_type": "hpp"
                },
                {
                    "branch_id": 6,
                    "transaction_type": "pembelian"
                },
                {
                    "branch_id": 6,
                    "transaction_type": "pengeluaran"
                },
                {
                    "branch_id": 6,
                    "transaction_type": "stock_opname_surplus"
                },
                {
                    "branch_id": 6,
                    "transaction_type": "stock_opname_deficit"
                }
            ],
            "priority": "high"
        },
        {
            "name": "Incorrect Transaction Totals",
            "description": "Transactions where the total price does not match the sum of item prices (accounting for discount and tax)",
            "issues_found": 879,
            "details": [],
            "priority": "medium"
        },
        {
            "name": "Invalid List Sub Account References",
            "description": "Cash flow transactions that reference non-existent list_sub_account records",
            "issues_found": 0,
            "details": [],
            "priority": "high"
        },
        {
            "name": "Duplicate Cash Flow Entries",
            "description": "Transactions that have multiple cash flow entries of the same type",
            "issues_found": 0,
            "details": [],
            "priority": "medium"
        }
    ],
    "summary": {
        "total_issues": 21675,
        "high_priority": 20796,
        "medium_priority": 879,
        "low_priority": 0,
        "recommendations": [
            "Run the sync_sales_journals.php script to create missing cash flow entries",
            "Run the sync_sales_journals.php script to create missing HPP cash flow entries",
            "Run the sync_sales_journals.php script to create missing journals for cash flow entries",
            "Configure account settings for these branches and transaction types to ensure proper journal creation",
            "Review and fix transactions where totalPrice does not match the sum of item prices"
        ]
    },
    "timestamp": "2025-05-17 20:32:41",
    "runtime_info": {
        "branch_id": null,
        "company_id": null
    }
}