
You are given ERP transaction data and a month-end ledger summary. Write a PostgreSQL query that compares the two sources by account and month-end date, then returns only the rows that do not reconcile. Your output should show the month-end date, account code, ERP total, ledger total, and a reconciliation flag that identifies matches, mismatches, and missing-source cases.