UNPKG

cfdi40

Version:

Libreria para crear y sellar xml cfdi V4.0

67 lines (56 loc) 1.61 kB
const fs = require('fs'); const CFDI = require('../src/CFDI'); const key = './EKU9003173C9.key'; const cer = './eku9003173c9.cer'; const cfdi = new CFDI({ Version: '4.0', Serie: 'B', Folio: '167ABC', Fecha: '2026-04-08T10:02:33', SubTotal: '369.83', Moneda: 'MXN', Total: '369.83', TipoDeComprobante: 'I', FormaPago: '01', MetodoPago: 'PUE', CondicionesDePago: 'CONDICIONES', TipoCambio: '1', Exportacion: '01', LugarExpedicion: '45079' }).emisor({ Rfc: 'EKU9003173C9', Nombre: 'ESCUELA KEMPER URGATE', RegimenFiscal: '601' }).receptor({ DomicilioFiscalReceptor: '80290', Nombre: 'MARIA OLIVIA MARTINEZ SAGAZ', RegimenFiscalReceptor: '610', Rfc: 'MASO451221PM4', UsoCFDI: 'CP01' }); cfdi.concepto({ ClaveProdServ: '01010101', ClaveUnidad: 'E48', NoIdentificacion: '3031130179', Cantidad: '1', Unidad: 'PZ', Descripcion: 'BATITA UNICORNIO', ValorUnitario: '369.83', Importe: '369.83', ObjetoImp: '01' }).ACuentaTerceros([{ DomicilioFiscalACuentaTerceros: '58000', NombreACuentaTerceros: 'INNOVACION VALOR Y DESARROLLO SA', RegimenFiscalACuentaTerceros: '610', RfcACuentaTerceros: 'MALD930428US2' }, { DomicilioFiscalACuentaTerceros: '58000', NombreACuentaTerceros: 'INNOVACION VALOR Y DESARROLLO SA', RegimenFiscalACuentaTerceros: '610', RfcACuentaTerceros: 'MALD930428US3' }]).agregar(cfdi); cfdi .certificar(cer) .xmlSellado(key, '12345678a') .then(xml => fs.writeFileSync('./testSelladoACuentaTerceros.xml', xml)) .catch(err => console.log(err));