{
  "name": "OTO e-CF DGII (Compupar)",
  "provider": "Compupar",
  "devise_field": "devise",
  "emisor": {
    "rnc_emisor": null,
    "razon_social": null,
    "source": null,
    "a_confirmer": true,
    "note": "RNC + raison sociale de l'entité émettrice (WA SRL / AC Arias Cuevas selon projet) — jamais fabriqués ici ; renseignés par la Direction/Compta avec source (#6)."
  },
  "provider_config": {
    "nom": "Compupar",
    "role": "PAC — signe et transmet l'e-CF a la DGII pour le compte de l'emetteur ; recoit l'aprobacion comercial.",
    "endpoint_recepcion": null,
    "endpoint_aprobacion_comercial": null,
    "credentials_ref": "/etc/oto/credentials (VPS · #8 · JAMAIS en repo)",
    "certificat_ref": "certificat digital DGII cote VPS (#8)",
    "source": "DGII · facturacion electronica — proveedor certifie (Compupar)",
    "a_confirmer": true
  },
  "e_ncf": {
    "prefix": "E",
    "longueur": 13,
    "regex": "^E[0-9]{12}$",
    "structure": "E + tipoeCF (2 chiffres) + secuencia (10 chiffres)",
    "note_secuencia": "La secuencia provient d'un RANGO autorise par la DGII (autorizacion de e-NCF) — jamais fabriquee en repo ; assignee cote VPS/Compupar (#8).",
    "source": "DGII · formato e-NCF (Ley 32-23 de Facturacion Electronica)"
  },
  "tipos_ecf": [
    {
      "code": "31",
      "label": "Factura de Credito Fiscal Electronica",
      "en_scope": true
    },
    {
      "code": "32",
      "label": "Factura de Consumo Electronica",
      "en_scope": true
    },
    {
      "code": "33",
      "label": "Nota de Debito Electronica",
      "en_scope": true
    },
    {
      "code": "34",
      "label": "Nota de Credito Electronica",
      "en_scope": true
    },
    {
      "code": "41",
      "label": "Compras Electronico",
      "en_scope": false
    },
    {
      "code": "43",
      "label": "Gastos Menores Electronico",
      "en_scope": false
    },
    {
      "code": "44",
      "label": "Regimenes Especiales Electronico",
      "en_scope": false
    },
    {
      "code": "45",
      "label": "Gubernamental Electronico",
      "en_scope": false
    },
    {
      "code": "46",
      "label": "Comprobante para Exportaciones Electronico",
      "en_scope": true
    },
    {
      "code": "47",
      "label": "Comprobante para Pagos al Exterior Electronico",
      "en_scope": false
    }
  ],
  "tipos_en_scope": [
    "31",
    "32",
    "33",
    "34",
    "46"
  ],
  "formas_pago": [
    {
      "code": "1",
      "label": "Efectivo"
    },
    {
      "code": "2",
      "label": "Cheque/Transferencia/Deposito"
    },
    {
      "code": "3",
      "label": "Tarjeta Debito/Credito"
    },
    {
      "code": "4",
      "label": "Venta a Credito"
    },
    {
      "code": "5",
      "label": "Bonos o Certificados de regalo"
    },
    {
      "code": "6",
      "label": "Permuta"
    },
    {
      "code": "7",
      "label": "Nota de credito"
    },
    {
      "code": "8",
      "label": "Otras Formas de pago"
    }
  ],
  "forma_pago_defaut": {
    "code": "3",
    "motif": "Encaissements OTO par carte via Cardnet (CLAUDE.md #10) → FormaPago 3 (Tarjeta).",
    "source": "DGII · tabla FormaPago (code 3) · CLAUDE.md #10 (Cardnet)"
  },
  "moneda": {
    "tipo_moneda_field": "devise",
    "options": [
      "USD",
      "DOP"
    ],
    "options_source": "CLAUDE.md #10 — devises **USD + DOP** (source unique · jamais inventé · #6). Distinct de `source` (taux TipoCambio) qui reste null/a_confirmer.",
    "tipo_cambio": null,
    "note_cambio": "Un e-CF libelle en USD exige un TipoCambio (DOP/USD) SOURCE (taux du jour BCRD/DGII) — jamais fabrique (#6). En DOP, TipoCambio non requis.",
    "source": null,
    "a_confirmer": true
  },
  "taxes": [
    {
      "code": "ITBIS",
      "label": "Impuesto sobre Transferencias de Bienes Industrializados y Servicios",
      "taux_pct": null,
      "source": null,
      "a_confirmer": true,
      "note": "Le taux ITBIS applicable (et l'exoneration eventuelle CONFOTUR sur l'immobilier touristique) est fiscal et depend du projet ; renseigne par le Fiscaliste eCF avec source (#6) — jamais fabrique ici."
    }
  ],
  "emission_events": [
    {
      "update_value": "contrat",
      "tipo_ecf": null,
      "base_field": "montant_contrat",
      "role_id": "compta-fiscaliste-ecf",
      "erpnext_role_name": "OTO Compta Fiscaliste eCF",
      "libelle": "Emission e-CF sur contrat signe (comprobante principal)",
      "a_confirmer": true
    },
    {
      "update_value": "reservation",
      "tipo_ecf": null,
      "base_field": "montant_reservation",
      "role_id": "compta-fiscaliste-ecf",
      "erpnext_role_name": "OTO Compta Fiscaliste eCF",
      "libelle": "Emission e-CF sur depot de reservation encaisse",
      "a_confirmer": true
    }
  ],
  "field_map": [
    {
      "dossier_field": "client",
      "ecf_element": "Comprador.RazonSocialComprador",
      "note": "Customer ERPNext → razon social acheteur"
    },
    {
      "dossier_field": "devise",
      "ecf_element": "Encabezado.TipoMoneda",
      "note": "Select USD/DOP → TipoMoneda (#10)"
    },
    {
      "dossier_field": "montant_contrat",
      "ecf_element": "Totales.MontoTotal",
      "note": "base Currency contrat → MontoTotal"
    },
    {
      "dossier_field": "montant_reservation",
      "ecf_element": "Totales.MontoTotal",
      "note": "base Currency reservation → MontoTotal (e-CF de reservation)"
    },
    {
      "dossier_field": "projet",
      "ecf_element": "DetallesItems.Item.NombreItem",
      "note": "projet/unite → description de la ligne"
    },
    {
      "dossier_field": "unite",
      "ecf_element": "DetallesItems.Item.NombreItem",
      "note": "reference d'unite → complement description"
    }
  ]
}
