{
    "checks": [
        {
            "name": "Transactions Without Cash Flow Entries",
            "description": "Sales transactions that have no corresponding cash_flow_transactions entries",
            "issues_found": 0,
            "details": [],
            "priority": "high"
        },
        {
            "name": "Transactions Without HPP Cash Flow Entries",
            "description": "Sales transactions with HPP but no corresponding HPP cash_flow_transactions",
            "issues_found": 0,
            "details": [],
            "priority": "high"
        },
        {
            "name": "Cash Flow Entries Without Journals",
            "description": "Cash flow transactions that have no corresponding journal entries",
            "issues_found": 41220,
            "details": [
                {
                    "id": 42485,
                    "transaction_id": 283,
                    "transaction_type": "penjualan",
                    "amount": "139000.00",
                    "transaction_date": "2024-12-01",
                    "branch_id": 2,
                    "company_id": 2
                },
                {
                    "id": 42486,
                    "transaction_id": 284,
                    "transaction_type": "penjualan",
                    "amount": "26000.00",
                    "transaction_date": "2024-12-01",
                    "branch_id": 2,
                    "company_id": 2
                },
                {
                    "id": 42487,
                    "transaction_id": 285,
                    "transaction_type": "penjualan",
                    "amount": "107000.00",
                    "transaction_date": "2024-12-01",
                    "branch_id": 2,
                    "company_id": 2
                },
                {
                    "id": 42488,
                    "transaction_id": 286,
                    "transaction_type": "penjualan",
                    "amount": "15000.00",
                    "transaction_date": "2024-12-01",
                    "branch_id": 2,
                    "company_id": 2
                },
                {
                    "id": 42489,
                    "transaction_id": 287,
                    "transaction_type": "penjualan",
                    "amount": "173000.00",
                    "transaction_date": "2024-12-01",
                    "branch_id": 2,
                    "company_id": 2
                }
            ],
            "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": 0,
            "details": [],
            "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": 877,
            "details": [
                {
                    "id": 290,
                    "totalPrice": "14450.00",
                    "items_total": "17000.00",
                    "discount": "2550.00",
                    "tax": "0.00",
                    "difference": 2550
                },
                {
                    "id": 384,
                    "totalPrice": "86700.00",
                    "items_total": "102000.00",
                    "discount": "15300.00",
                    "tax": "0.00",
                    "difference": 15300
                },
                {
                    "id": 409,
                    "totalPrice": "171000.00",
                    "items_total": "190000.00",
                    "discount": "19000.00",
                    "tax": "0.00",
                    "difference": 19000
                },
                {
                    "id": 414,
                    "totalPrice": "0.00",
                    "items_total": "71000.00",
                    "discount": "71000.00",
                    "tax": "0.00",
                    "difference": 71000
                },
                {
                    "id": 496,
                    "totalPrice": "24000.00",
                    "items_total": "30000.00",
                    "discount": "6000.00",
                    "tax": "0.00",
                    "difference": 6000
                }
            ],
            "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": 42097,
        "high_priority": 41220,
        "medium_priority": 877,
        "low_priority": 0,
        "recommendations": [
            "Run the sync_sales_journals.php script to create missing journals for cash flow entries",
            "Review and fix transactions where totalPrice does not match the sum of item prices"
        ]
    },
    "timestamp": "2025-05-17 19:04:18",
    "runtime_info": {
        "branch_id": "2",
        "company_id": "2"
    }
}