Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/ttpullima/RomsoftBackEnd2021_v2/llms.txt

Use this file to discover all available pages before exploring further.

Peru’s General Corporate Accounting Plan (Plan Contable General Empresarial — PCGE), issued by the Consejo Normativo de Contabilidad, mandates a standardised hierarchical chart of accounts for all enterprises subject to SUNAT and the MEF. Gestión Clínica implements this plan in the CON_CUENTA_CONTABLE table, where every account node (from the two-digit element level down to the analytical sub-account level) is stored with its official PCGE code and description. Cost centers (CON_CENTRO_COSTO) complement the chart of accounts by enabling the clinic to attribute expenses and revenues to specific operating units — outpatient clinic, pharmacy, emergency, imaging, laboratory, and so on — without altering the account structure itself. Together, these two reference datasets are required when posting journal entries, configuring automatic accounting rules for billing events, and producing the financial statements that SUNAT and SBS audits demand.
Both endpoints are HTTP POST and require an Authorization: Bearer {token} header. The request body carries a DTO that is mapped but the GetAllActives business-layer call ignores its filter values — the full active list is always returned. Responses follow the standard JsonResponse envelope.

CON_CUENTA_CONTABLE Endpoints

POST /api/CON_CUENTA_CONTABLE/GetAllActives

Returns all active chart-of-accounts entries. The controller accepts a CON_CUENTA_CONTABLEDTO body (mapped internally) but always delegates to CON_CUENTA_CONTABLEBL.Instancia.GetAllActives(), which returns the complete active set regardless of any filter values supplied. Request body — CON_CUENTA_CONTABLEDTO
id_cuenta_contable
int
Primary key filter. Accepted by the mapper but not used as a filter in the current implementation — pass 0 or omit.
c_codigo
string
PCGE account code filter. Accepted by the mapper but not applied as a filter in the current implementation — pass null or omit.
t_descripcion
string
Account description filter. Accepted by the mapper but not applied as a filter in the current implementation — pass null or omit.
Because the current business layer always fetches the full active list, clients should cache or paginate the result on the front-end rather than calling this endpoint repeatedly with different filter values.
Response — array of CON_CUENTA_CONTABLEDTO Sample response
{
  "Success": true,
  "Message": null,
  "Data": [
    { "id_cuenta_contable": 1,  "c_codigo": "10",    "t_descripcion": "EFECTIVO Y EQUIVALENTES DE EFECTIVO" },
    { "id_cuenta_contable": 2,  "c_codigo": "101",   "t_descripcion": "CAJA" },
    { "id_cuenta_contable": 3,  "c_codigo": "1011",  "t_descripcion": "CAJA - MONEDA NACIONAL" },
    { "id_cuenta_contable": 45, "c_codigo": "121",   "t_descripcion": "FACTURAS, BOLETAS Y OTROS COMPROBANTES POR COBRAR" },
    { "id_cuenta_contable": 88, "c_codigo": "401",   "t_descripcion": "GOBIERNO CENTRAL" },
    { "id_cuenta_contable": 89, "c_codigo": "4011",  "t_descripcion": "IMPUESTO GENERAL A LAS VENTAS" }
  ]
}
curl example
curl -s -X POST https://{host}/api/CON_CUENTA_CONTABLE/GetAllActives \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{}'
The PCGE code hierarchy is encoded in the c_codigo string itself: two-digit codes are element-level accounts (e.g., "10"), three-digit codes are sub-element accounts ("101"), and four or more digits are analytical accounts ("1011"). Sort or group by c_codigo string-numerically to reproduce the official plan order.

CON_CENTRO_COSTO Endpoints

POST /api/CON_CENTRO_COSTO/GetAllActives

Returns all active cost center records. Like CON_CUENTA_CONTABLE/GetAllActives, the controller accepts a DTO body that is mapped but the business layer always returns the complete active set. Request body — CON_CENTRO_COSTODTO
id_centro_costo
int
Primary key. Accepted by the mapper but not applied as a filter — pass 0 or omit.
c_codigo
string
Cost center code. Accepted by the mapper but not applied as a filter — pass null or omit.
t_descripcion
string
Cost center description. Accepted by the mapper but not applied as a filter — pass null or omit.
Response — array of CON_CENTRO_COSTODTO Sample response
{
  "Success": true,
  "Message": null,
  "Data": [
    { "id_centro_costo": 1, "c_codigo": "CC001", "t_descripcion": "FARMACIA" },
    { "id_centro_costo": 2, "c_codigo": "CC002", "t_descripcion": "EMERGENCIA" },
    { "id_centro_costo": 3, "c_codigo": "CC003", "t_descripcion": "CONSULTA EXTERNA" },
    { "id_centro_costo": 4, "c_codigo": "CC004", "t_descripcion": "LABORATORIO CLINICO" },
    { "id_centro_costo": 5, "c_codigo": "CC005", "t_descripcion": "IMAGENOLOGIA" },
    { "id_centro_costo": 6, "c_codigo": "CC006", "t_descripcion": "ADMINISTRACION" }
  ]
}
curl example
curl -s -X POST https://{host}/api/CON_CENTRO_COSTO/GetAllActives \
  -H "Authorization: Bearer {token}" \
  -H "Content-Type: application/json" \
  -d '{}'

Common Response Envelope

Both controllers return responses in the standard JsonResponse wrapper:
FieldTypeDescription
Successbooleantrue unless an unhandled exception occurred.
Warningbooleantrue when a business rule prevented the operation (not used by these read-only endpoints).
MessagestringHuman-readable result or error message (Spanish). null on success.
DataarrayArray of CON_CUENTA_CONTABLEDTO or CON_CENTRO_COSTODTO objects.

Usage in Accounting Workflows

The following diagram shows how chart-of-accounts and cost-center references feed downstream accounting operations:
Reference DataUsed When
CON_CUENTA_CONTABLEConfiguring automatic journal-entry templates for billing events (PCGE accounts per service type).
CON_CUENTA_CONTABLESelecting debit/credit accounts when manually posting ledger entries.
CON_CENTRO_COSTOTagging expense and revenue lines to a clinic department for management accounting reports.
CON_CENTRO_COSTOFiltering the trial balance and P&L by operating unit.
PCGE account codes in CON_CUENTA_CONTABLE must match the official Peruvian chart of accounts as updated by the Consejo Normativo de Contabilidad. Do not insert custom account codes that conflict with the official numbering; doing so will invalidate automated SUNAT ledger exports.
Load both CON_CUENTA_CONTABLE and CON_CENTRO_COSTO lists once when initialising a journal-entry screen and store them in front-end state. Neither list changes frequently; refreshing them on each form open is unnecessary.

Build docs developers (and LLMs) love