Commit abe82c29284b6f348eff41f4de09cc0ff112d3f7
1 parent
e6d8782c47
Exists in
master
fix iva en productos
Showing
3 changed files
with
4 additions
and
4 deletions
Show diff stats
debo/cabeceraDebo.js
... | ... | @@ -20,7 +20,7 @@ module.exports = function(comprobante, afipTablas, entities) { |
20 | 20 | IRS: 0, // [money] NOT NULL, FIJO 0 |
21 | 21 | IMI: comprobante.importesTotales.importeImpuestosInternos, // [money] NOT NULL, SUMATORIA DE LOS IMPUESTOS INTERNOS POR ITEM |
22 | 22 | RGA: 0, // [money] NOT NULL, IMPORTE RETENCION DE GANANCIAS |
23 | - RIB: 0, // [money] NOT NULL, IMPORTE RETENCION DE INGRESOS BRUTOS | |
23 | + RIB: comprobante.importesTotales.importeIB, // [money] NOT NULL, IMPORTE RETENCION DE INGRESOS BRUTOS | |
24 | 24 | PIV: comprobante.detalleOtrosImpuestosComprobante.percepcionIVA ? comprobante.detalleOtrosImpuestosComprobante.percepcionIVA.importeImpuesto : 0, // [money] NOT NULL, IMPORTE PERCEPCION DE IVA, SECTOR 90 C05 |
25 | 25 | CNG: comprobante.importesTotales.totalConceptosNoNetoGravado, // [money] NULL, IMPORTE DE CONCEPTOS NO GRAVADOS |
26 | 26 | TOT: comprobante.importesTotales.totalOperacion, // [money] NOT NULL, IMPORTE TOTAL DE LA FACTURA |
... | ... | @@ -57,7 +57,7 @@ module.exports = function(comprobante, afipTablas, entities) { |
57 | 57 | CAI: comprobante.identificaxComprobante.cai, // [char](16) NOT NULL, NUMERO DE CAI |
58 | 58 | CHO: 0, // [int] NOT NULL, FIJO 0 |
59 | 59 | CTR: '', // [char](1) NOT NULL, VACIO NO NULO |
60 | - PER: comprobante.importesTotales.importeIB, // [money] NOT NULL, IMPORTE DE PERCEPCIONES | |
60 | + PER: comprobante.importesTotales.importeActaImpuestosNacionales, // [money] NOT NULL, IMPORTE DE PERCEPCIONES | |
61 | 61 | CCA9: 0, // [int] NOT NULL, FIJO 0 |
62 | 62 | FECVEN: comprobante.identificaxComprobante.fechaVencimiento, // [smalldatetime] NOT NULL, FECHA DE VENCIMIENTO DE LA FACTURA |
63 | 63 | CNG2: 0, // [money] NOT NULL, IMPORTE DE CONCEPTOS NO GRAVADOS 2 |
debo/cuerpoDebo.js
... | ... | @@ -15,7 +15,7 @@ module.exports = function(comprobante, afipTablas, entities, item) { |
15 | 15 | CAN: item.cantidad, // [money] NOT NULL, CANTIDAD DEL ITEM |
16 | 16 | PUN: item.precioUnitario, // [decimal](20, 8) NOT NULL PRECIO UNITARIO DEL PRODUCTO ITEM |
17 | 17 | IMI: item.impuestoInterno ? item.impuestoInterno.importeImpuesto : 0, // [money] NOT NULL, IMPORTE IMPUESTOS INTERNOS DEL ITEM |
18 | - IVA: item.importeIVA, // [money] NOT NULL, IMPORTE IVA DEL ITEM | |
18 | + IVA: comprobante.itemsFactura.alicuotaIVAAplicable ? ((item.precioUnitario * item.cantidad) * comprobante.itemsFactura.alicuotaIVAAplicable) / 100 : 0, | |
19 | 19 | PUT: item.precioUnitario, // [money] NOT NULL, IGUAL AL PUN |
20 | 20 | LEG: 0, // [int] NOT NULL, FIJO 0 |
21 | 21 | CMF: 0, // [int] NOT NULL, FIJO 0 |
rutas/comprobantes.js
... | ... | @@ -91,7 +91,7 @@ router.post('/comprobante', function(req, res) { |
91 | 91 | |
92 | 92 | req.body.cuerpo.forEach(cuerpo => { |
93 | 93 | |
94 | - if (cuerpo.estado = 'rechazado' && !(cuerpo.COD == 0 && cuerpo.ART == 0 && cuerpo.RUB == 0)) { | |
94 | + if (cuerpo.estado != 'rechazado' && !(cuerpo.COD == 0 && cuerpo.ART == 0)) { | |
95 | 95 | |
96 | 96 | promesas.push(knex('AMOVSTOC').insert({ |
97 | 97 | SEC: cuerpo.COD, |