Plataforma de Gestoría Inteligente Especificación funcional + técnica • v1 • 18/12/2025
智能管理平台 功能 + 技术规范 • v1 • 18/12/2025
Intelligent Management Platform Functional + technical specification • v1 • 18/12/2025
Plataforma de Gestoría Inteligente Especificación técnica • v1 • 18/12/2025
智能管理平台 技术规范 • v1 • 18/12/2025
Intelligent Management Platform Technical specification • v1 • 18/12/2025

4. Módulo Contable

OCR + asientos automáticos + conciliación + cierres con trazabilidad.

AutomatizaOCR + reglas
CalidadBloqueos
VelocidadConciliación

Visión del módulo

Contabilidad oficial con automatización desde documentos y bancos. Incluye cierres, bloqueos por periodo, libros e informes.

Objetivos

  • Reducir carga manual con OCR y reglas por proveedor/cliente.
  • Garantizar consistencia para alimentar fiscalidad (bases/retenciones).
  • Asegurar cierres por periodo con trazabilidad y reaperturas controladas.
  • Conciliación bancaria asistida para acelerar el cierre.

Alcance

  • Plan contable, asientos, diarios y mayores.
  • OCR: extracción de datos + propuesta de asiento.
  • Conciliación: matching facturas ↔ banco ↔ asientos.
  • Amortizaciones, provisiones y periodificaciones.
  • Libros e informes exportables.

Personas y roles

RolNecesidad / uso principal
Gestor contableContabilizar rápido con OCR y reglas; conciliar sin fricción.
Gestor fiscalDatos fiables para calcular impuestos.
ClienteVisión económica e informes (si se habilita).

Diseño funcional

Flujos principales

Entrada de factura con OCR
Cliente sube factura o llega por integración (email/R2/ERP).
  • Documento entra en cola OCR y se extraen campos (proveedor, NIF, fecha, bases, IVA).
  • Validación: totales y consistencia (NIF, duplicidad).
  • Asignación de regla (si proveedor conocido) → propuesta de cuentas.
  • Gestor aprueba propuesta → se crea asiento y se vincula documento.
  • Se marca el documento como 'Contabilizado'.
Salida: Asiento creado con documento vinculado y trazabilidad.
Conciliación bancaria
Importación diaria/semanal de extractos.
  • Importar movimientos bancarios.
  • Matching automático por importe/fecha/referencia/proveedor.
  • Gestor revisa excepciones y confirma.
  • Generar asiento si falta (comisiones, ingresos).
  • Bloquear periodo al completar conciliación.
Salida: Banco conciliado y periodo listo para cierre.
Cierre de periodo
Fin de mes/trimestre.
  • Ejecutar validaciones (cuadres, saldos, conciliación completada).
  • Generar amortizaciones/periodificaciones.
  • Marcar periodo como bloqueado (solo lectura).
  • Emitir informes y snapshots para fiscalidad.
Salida: Periodo cerrado con evidencias y consistencia fiscal.

Pantallas (UI)

  • Bandeja OCR: pendientes, propuesta, aprobación.
  • Asientos: editor + trazabilidad + vínculo al documento.
  • Conciliación: vista de matching y excepciones.
  • Cierres: checklist y bloqueo de periodos.

Diseño técnico

Entidades y modelo de datos (mínimo)

EntidadCampos principales / notas
Accountcode, name, type, parent_code, active
JournalEntryid, date, memo, lines[], source(doc/bank/manual), locked
JournalLineentry_id, account_code, debit, credit, vat_code?, third_party_id?
Invoiceid, supplier_id, number, date, totals, status, doc_id
BankTransactionid, bank_account_id, date, amount, description, matched_ref
PeriodLockcompany_id, period, locked_by, locked_at, reason

Permisos y seguridad (RBAC)

  • Edición de asientos bloqueada en periodos cerrados; reapertura solo supervisor.
  • Reglas OCR/contabilización solo admin/supervisor (para evitar descontrol).
  • Auditoría obligatoria en asientos editados/eliminados (idealmente no borrar, reversar).

Validaciones y reglas

  • Prohibir borrado duro: usar asientos de reversión/corrección.
  • Detectar duplicados de factura por proveedor + número + fecha + importe.
  • Conciliación requerida para cierre fiscal (configurable).

APIs sugeridas (API-first)

GET /api/v1/accounts?company_id=... POST /api/v1/journal-entries GET /api/v1/journal-entries?period=... POST /api/v1/invoices/import POST /api/v1/ocr/jobs # encola OCR POST /api/v1/banks/transactions/import POST /api/v1/banks/reconcile # matching PATCH /api/v1/periods/{id}/lock PATCH /api/v1/periods/{id}/unlock

Eventos y auditoría

  • ocr.completed
  • accounting.entry.created/updated
  • bank.transaction.imported
  • bank.reconciled
  • period.locked/unlocked

Impacto de negocio

Beneficio para la gestoría

  • Ahorra horas en contabilización y conciliación.
  • Menos errores al vincular documento-asiento y bloquear periodos.
  • Mejor base para fiscal: cálculos más fiables.

Beneficio para el cliente

  • Contabilidad al día; informes más rápidos y claros.
  • Menos solicitudes de correcciones por duplicados.

Riesgos / puntos críticos

  • OCR requiere control de calidad; sin revisión humana hay riesgo de errores.
  • Conciliación mal diseñada genera frustración; requiere buen matching y UX.
  • Bloqueos demasiado rígidos deben tener reapertura controlada.

4. 会计模块

OCR + 自动分录 + 对账 + 带可追溯性的结账。

自动化OCR + 规则
质量锁定
速度对账

模块愿景

从文档和银行自动化的官方会计。包括结账、按期间锁定、账簿和报告。

目标

  • 通过OCR和按供应商/客户的规则减少手动工作量。
  • 保证一致性以支持税务(基数/预扣)。
  • 确保带可追溯性和受控重新打开的按期间结账。
  • 辅助银行对账以加速结账。

范围

  • 会计科目表、分录、日记账和总账。
  • OCR:数据提取 + 分录建议。
  • 对账:发票 ↔ 银行 ↔ 分录的匹配。
  • 摊销、准备金和期间化。
  • 可导出的账簿和报告。

人员和角色

角色需求 / 主要用途
会计经理使用OCR和规则快速记账;无摩擦对账。
税务经理可靠数据以计算税款。
客户经济视图和报告(如果启用)。

功能设计

主要流程

带OCR的发票输入
客户上传发票或通过集成到达(电子邮件/R2/ERP)。
  • 文档进入OCR队列并提取字段(供应商、NIF、日期、基数、增值税)。
  • 验证:总额和一致性(NIF、重复)。
  • 规则分配(如果供应商已知)→ 账户建议。
  • 经理批准建议 → 创建分录并链接文档。
  • 将文档标记为"已记账"。
输出:创建的分录,带链接文档和可追溯性。
银行对账
每日/每周导入对账单。
  • 导入银行交易。
  • 按金额/日期/参考/供应商自动匹配。
  • 经理审查异常并确认。
  • 如果缺少,生成分录(佣金、收入)。
  • 完成对账后锁定期间。
输出:银行已对账,期间准备结账。
期间结账
月末/季末。
  • 执行验证(对账、余额、对账完成)。
  • 生成摊销/期间化。
  • 将期间标记为已锁定(只读)。
  • 为税务发出报告和快照。
输出:已关闭的期间,带证据和税务一致性。

屏幕(UI)

  • OCR托盘:待办、建议、批准。
  • 分录:编辑器 + 可追溯性 + 文档链接。
  • 对账:匹配视图和异常。
  • 结账:清单和期间锁定。

技术设计

实体和数据模型(最小)

实体主要字段 / 注释
Accountcode, name, type, parent_code, active
JournalEntryid, date, memo, lines[], source(doc/bank/manual), locked
JournalLineentry_id, account_code, debit, credit, vat_code?, third_party_id?
Invoiceid, supplier_id, number, date, totals, status, doc_id
BankTransactionid, bank_account_id, date, amount, description, matched_ref
PeriodLockcompany_id, period, locked_by, locked_at, reason

权限和安全性(RBAC)

  • 在封闭期间阻止分录编辑;仅主管可重新打开。
  • OCR/记账规则仅管理员/主管(以避免失控)。
  • 在编辑/删除的分录中强制审计(理想情况下不删除,反转)。

验证和规则

  • 禁止硬删除:使用反转/更正分录。
  • 按供应商 + 编号 + 日期 + 金额检测发票重复。
  • 税务结账需要对账(可配置)。

建议的API(API优先)

GET /api/v1/accounts?company_id=... POST /api/v1/journal-entries GET /api/v1/journal-entries?period=... POST /api/v1/invoices/import POST /api/v1/ocr/jobs # encola OCR POST /api/v1/banks/transactions/import POST /api/v1/banks/reconcile # matching PATCH /api/v1/periods/{id}/lock PATCH /api/v1/periods/{id}/unlock

事件和审计

  • ocr.completed
  • accounting.entry.created/updated
  • bank.transaction.imported
  • bank.reconciled
  • period.locked/unlocked

业务影响

对管理办公室的好处

  • 在记账和对账中节省时间。
  • 通过链接文档-分录和锁定期间减少错误。
  • 更好的税务基础:更可靠的计算。

对客户的好处

  • 最新的会计;更快更清晰的报告。
  • 减少因重复而请求的更正。

风险 / 关键点

  • OCR需要质量控制;没有人工审查有错误风险。
  • 设计不当的对账会产生挫败感;需要良好的匹配和UX。
  • 过于严格的锁定必须有受控的重新打开。

4. Accounting Module

OCR + automatic entries + reconciliation + closings with traceability.

AutomatesOCR + rules
QualityLocks
SpeedReconciliation

Module Vision

Official accounting with automation from documents and banks. Includes closings, period locks, books and reports.

Objectives

  • Reduce manual workload with OCR and rules per supplier/client.
  • Ensure consistency to feed taxation (bases/retentions).
  • Ensure period closings with traceability and controlled reopenings.
  • Assisted bank reconciliation to accelerate closing.

Scope

  • Chart of accounts, entries, journals and ledgers.
  • OCR: data extraction + entry proposal.
  • Reconciliation: matching invoices ↔ bank ↔ entries.
  • Amortizations, provisions and periodifications.
  • Exportable books and reports.

People and Roles

RoleNeed / main use
Accounting ManagerAccount quickly with OCR and rules; reconcile without friction.
Tax ManagerReliable data to calculate taxes.
ClientEconomic view and reports (if enabled).

Functional Design

Main Flows

Invoice Entry with OCR
Client uploads invoice or arrives via integration (email/R2/ERP).
  • Document enters OCR queue and fields are extracted (supplier, NIF, date, bases, VAT).
  • Validation: totals and consistency (NIF, duplication).
  • Rule assignment (if known supplier) → account proposal.
  • Manager approves proposal → entry is created and document is linked.
  • Document is marked as 'Accounted'.
Output: Entry created with linked document and traceability.
Bank Reconciliation
Daily/weekly import of statements.
  • Import bank transactions.
  • Automatic matching by amount/date/reference/supplier.
  • Manager reviews exceptions and confirms.
  • Generate entry if missing (commissions, income).
  • Lock period upon completing reconciliation.
Output: Bank reconciled and period ready for closing.
Period Closing
End of month/quarter.
  • Execute validations (reconciliations, balances, reconciliation completed).
  • Generate amortizations/periodifications.
  • Mark period as locked (read-only).
  • Issue reports and snapshots for taxation.
Output: Period closed with evidence and tax consistency.

Screens (UI)

  • OCR Tray: pending items, proposal, approval.
  • Entries: editor + traceability + document link.
  • Reconciliation: matching view and exceptions.
  • Closings: checklist and period locking.

Technical Design

Entities and Data Model (minimum)

EntityMain fields / notes
Accountcode, name, type, parent_code, active
JournalEntryid, date, memo, lines[], source(doc/bank/manual), locked
JournalLineentry_id, account_code, debit, credit, vat_code?, third_party_id?
Invoiceid, supplier_id, number, date, totals, status, doc_id
BankTransactionid, bank_account_id, date, amount, description, matched_ref
PeriodLockcompany_id, period, locked_by, locked_at, reason

Permissions and Security (RBAC)

  • Entry editing blocked in closed periods; reopening only supervisor.
  • OCR/accounting rules only admin/supervisor (to avoid loss of control).
  • Mandatory auditing on edited/deleted entries (ideally do not delete, reverse).

Validations and Rules

  • Prohibit hard deletion: use reversal/correction entries.
  • Detect invoice duplicates by supplier + number + date + amount.
  • Reconciliation required for tax closing (configurable).

Suggested APIs (API-first)

GET /api/v1/accounts?company_id=... POST /api/v1/journal-entries GET /api/v1/journal-entries?period=... POST /api/v1/invoices/import POST /api/v1/ocr/jobs # encola OCR POST /api/v1/banks/transactions/import POST /api/v1/banks/reconcile # matching PATCH /api/v1/periods/{id}/lock PATCH /api/v1/periods/{id}/unlock

Events and Auditing

  • ocr.completed
  • accounting.entry.created/updated
  • bank.transaction.imported
  • bank.reconciled
  • period.locked/unlocked

Business Impact

Benefit for the Office

  • Saves hours in accounting and reconciliation.
  • Fewer errors by linking document-entry and locking periods.
  • Better foundation for tax: more reliable calculations.

Benefit for the Client

  • Up-to-date accounting; faster and clearer reports.
  • Fewer correction requests due to duplicates.

Risks / Critical Points

  • OCR requires quality control; without human review there is risk of errors.
  • Poorly designed reconciliation generates frustration; requires good matching and UX.
  • Too rigid locks must have controlled reopening.

Vista desarrollo - contenido pendiente...

开发视图 - 内容待定...

Development view - content pending...