conciliation_summary function returns a financial snapshot for a custody account by aggregating data from all reconciliation tables. It provides a single object (resumen) that lets you quickly assess how much has been reconciled, what is still pending, and whether the bank and platform balances align.
conciliation_summary
The custody account number to summarize. Used as the primary filter across all reconciliation tables.
Start date for filtering reconciled and non-reconciled records. Applied to the
fecha_reg column in conc_conciliacion, conc_noconciliado_c, and conc_noconciliado_b. Does not affect the balance (saldodia_*) lookup.End date for filtering reconciled and non-reconciled records. Applied to the
fecha_reg column.Response
Response — summary foundconc_saldos_banco for the requested account, the function looks up the custody account in Firestore and seeds an initial balance record from opening_balance.
When you receive the “Saldo Actualizado” response, the initial balance has been written to
conc_saldos_banco. Call conciliation_summary again to get the full resumen object.Response fields
Current bank balance for the account. Sourced from
conc_saldos_banco.saldo_banco. This is the reference balance used to compare against the platform.Current platform/company balance. Sourced from
conc_arckmc.sal_dia_ant (prior day balance in the platform’s accounting table).Sum of
monto_b across all matched records in conc_conciliacion for the requested account and date range. Represents the total bank-side amount that has been successfully reconciled.Sum of
monto across all matched records in conc_conciliacion for the requested account and date range. Represents the total platform-side amount that has been successfully reconciled.Sum of
monto in conc_noconciliado_c for the account and date range. Represents platform transactions that have not yet been matched to a bank record.Sum of
monto in conc_noconciliado_b for the account and date range. Represents bank entries that have not yet been matched to a platform record.Sum of
monto_ajuste from the conc_ajustes table. Represents the total value of manual adjustments applied to the account. Date range is not applied to this figure — it uses only no_cta as a filter.Transfers in transit. Always returns
0 in the current implementation; reserved for future use.Interpreting the summary
A fully reconciled account will show:saldo_pendiente_cia or saldo_pendiente_banco is non-zero, there are outstanding items that require review. Use noconciliation_data_cia and noconciliation_data_b to retrieve the individual records, then apply conciliation_ajustes to resolve them.
If saldo_conciliado_banco and saldo_conciliado_cia differ, the matched pairs have different amounts on each side — this can happen with currency conversion or rounding and should be investigated.
Data sources
| Field | Source table | Column |
|---|---|---|
saldodia_banco | conc_saldos_banco | saldo_banco |
saldodia_cia | conc_arckmc | sal_dia_ant |
saldo_conciliado_banco | conc_conciliacion | sum(monto_b) |
saldo_conciliado_cia | conc_conciliacion | sum(monto) |
total_ajustes | conc_ajustes | sum(monto_ajuste) |
saldo_pendiente_cia | conc_noconciliado_c | sum(monto) |
saldo_pendiente_banco | conc_noconciliado_b | sum(monto) |