The Collections module (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/corpentunida-org/corpen/llms.txt
Use this file to discover all available pages before exploring further.
/recaudo) handles the incoming cash flow of the cooperative: recording payment receipts from members (PagoRecaudo) and creating the corresponding accounting imputations (RecImputacionContable) that link each bank-statement transaction to a third party and a district. Every route in the module is protected by the auth middleware.
The module sits between the Accounting module (which owns the source bank transactions in con_extractos_transacciones) and the Portfolio module (which tracks receivables per obligation). An imputation is the formal record that a transaction recorded in the bank statement has been attributed to a specific member, closing the loop between cash received and the accounting ledger.
Route reference
| Method | URL | Route name | Handler | Description |
|---|---|---|---|---|
GET | /recaudo/imputaciones | recaudo.imputaciones.index | RecImputacionContableController@index | Paginated list with live-search |
GET | /recaudo/imputaciones/create | recaudo.imputaciones.create | RecImputacionContableController@create | Create form |
POST | /recaudo/imputaciones | recaudo.imputaciones.store | RecImputacionContableController@store | Persist new imputation |
GET | /recaudo/imputaciones/{id} | recaudo.imputaciones.show | RecImputacionContableController@show | Audit detail |
GET | /recaudo/imputaciones/{id}/edit | recaudo.imputaciones.edit | RecImputacionContableController@edit | Edit form |
PUT | /recaudo/imputaciones/{id} | recaudo.imputaciones.update | RecImputacionContableController@update | Update record |
DELETE | /recaudo/imputaciones/{id} | recaudo.imputaciones.destroy | RecImputacionContableController@destroy | Delete record |
GET | /recaudo/buscar-distrito/{terceroId} | recaudo.buscar-distrito | RecImputacionContableController@buscarDistrito | AJAX: resolve district code |
PagoRecaudoController manages payment receipts within the recaudo namespace. Its resource routes are not separately registered in the main web.php group; payment receipt actions are handled through the controller directly.
Payment receipts (PagoRecaudo)
The rec_pagos table stores each instalment collected from a member.
| Column | Type | Notes |
|---|---|---|
id | bigint (PK) | Auto-increment |
cuota | integer | Instalment number |
valor_pagado | decimal (15,2) | Amount received |
rc | string (unique) | Cash receipt number |
comprobante | string (nullable) | Path to supporting file |
cre_creditos_id | FK → cre_creditos | Parent credit |
created_at / updated_at | timestamps |
PagoRecaudo model belongs to a Credito, so every payment receipt is always traceable to the originating loan record.
Accounting imputations (RecImputacionContable)
The rec_imputaciones_contables table creates the formal link between a bank transaction and Corpen’s accounting ledger entries.
| Column | Type | Notes |
|---|---|---|
id | bigint (PK) | Auto-increment |
id_transaccion | FK → con_extractos_transacciones.id_transaccion | Source bank movement |
id_tercero_origen | FK → MaeTerceros.cod_ter | Payer |
id_distrito | FK → MaeDistritos.COD_DIST | District of the payer |
id_recibo | bigint (unique) | Receipt identifier |
tipo | string | Imputation type |
concepto_contable | text | Accounting concept (e.g. L.I MENORES, CTA 14 DIC) |
valor_imputado | integer | Amount attributed |
link_ecm | text (nullable, URL) | ECM document management link |
estado_conciliacion | enum | Pendiente, Conciliado_Auto, Conciliado_Manual, Anulado |
id_user | FK → users | Authenticated user who created the record |
index) supports three simultaneous filters:
- Live search (
search): matchesid_recibo,concepto_contable, orid_tercero_origen. - Reconciliation state (
estado_conciliacion): exact enum match. - Type (
tipo): free text match.
X-Requested-With: XMLHttpRequest header is present, the controller returns only the imputaciones-list Livewire fragment, enabling real-time table updates without a full page reload.
Recording a collection payment
Identify the bank transaction
Open the Accounting module’s statement list at
GET /contabilidad/extractos and locate the target transaction. Copy its id_transaccion value. Alternatively, navigate directly to GET /recaudo/imputaciones/create?id_transaccion={id} — the controller will pre-fill the ConExtractoTransaccion data onto the form automatically.Look up the payer's district
On the create form, once the The response returns the member’s
id_tercero_origen field is populated (the member’s cod_ter), the UI calls the AJAX helper:cod_dist from the MaeTerceros master table, which pre-fills the district dropdown:Complete and submit the imputation form
Fill in the remaining fields and submit The
POST /recaudo/imputaciones:id_user field is injected automatically from the authenticated session — it is never exposed in the form.Verify the audit record
After a successful
store, the controller wraps the insert in a database transaction (DB::beginTransaction / DB::commit). Navigate to GET /recaudo/imputaciones/{id} to view the full audit record, which eager-loads the nested chain: imputation → bank transaction → bank account, plus the linked third party, district, and creating user.The
show view loads the full relationship chain (transaccion.cuentaBancaria, tercero, distrito, user) in a single Eager Loading call, providing a complete audit ficha without additional queries.Relationship with other modules
The Collections module depends on entities owned by two other modules:- Accounting — every
RecImputacionContablemust reference a validcon_extractos_transaccionesrow. The imputation’sestado_conciliacionmirrors the reconciliation lifecycle defined in the Accounting module. - Portfolio — payment receipts (
rec_pagos) belong to acre_creditosrecord. Payments recorded here eventually feed the portfolio’s outstanding balance calculations and can be matched to portfolio payment vouchers during the conciliation process.