diff --git a/apps/api/src/services/contribuyente-facturapi.service.ts b/apps/api/src/services/contribuyente-facturapi.service.ts index dd3e89a..49fc197 100644 --- a/apps/api/src/services/contribuyente-facturapi.service.ts +++ b/apps/api/src/services/contribuyente-facturapi.service.ts @@ -435,7 +435,7 @@ export async function createInvoiceContribuyente( unit_key: item.unitKey || 'E48', unit_name: item.unitName || 'Servicio', price: item.price, - tax_included: item.taxIncluded ?? true, + tax_included: item.taxIncluded ?? false, taxes: item.taxes?.map((t: any) => ({ type: t.type, rate: t.rate, diff --git a/apps/api/src/services/facturapi.service.ts b/apps/api/src/services/facturapi.service.ts index 1b48e71..4fc7f3e 100644 --- a/apps/api/src/services/facturapi.service.ts +++ b/apps/api/src/services/facturapi.service.ts @@ -315,7 +315,7 @@ export async function createInvoice( unit_key: item.unitKey || 'E48', unit_name: item.unitName || 'Servicio', price: item.price, - tax_included: item.taxIncluded ?? true, + tax_included: item.taxIncluded ?? false, taxes: item.taxes?.map(t => ({ type: t.type, rate: t.rate, diff --git a/apps/web/app/(dashboard)/facturacion/page.tsx b/apps/web/app/(dashboard)/facturacion/page.tsx index b8da3e2..8371e8c 100644 --- a/apps/web/app/(dashboard)/facturacion/page.tsx +++ b/apps/web/app/(dashboard)/facturacion/page.tsx @@ -611,8 +611,7 @@ export default function FacturacionPage() { // Cálculos function calcConcepto(c: ConceptoForm) { const trasladoRates = c.taxes.filter(t => t.category === 'traslado' && t.factor === 'Tasa').reduce((s, t) => s + t.rate, 0); - const unitPrice = trasladoRates > 0 ? c.price / (1 + trasladoRates) : c.price; - const base = unitPrice * c.quantity - c.discount; + const base = c.price * c.quantity - c.discount; const traslados = c.taxes.filter(t => t.category === 'traslado' && t.factor === 'Tasa').reduce((s, t) => s + base * t.rate, 0); const retenciones = c.taxes.filter(t => t.category === 'retencion').reduce((s, t) => s + base * t.rate, 0); return { base, traslados, retenciones }; @@ -688,7 +687,7 @@ export default function FacturacionPage() { quantity: c.quantity, price: tipoComprobante === 'T' ? 0 : c.price, discount: c.discount || 0, - taxIncluded: true, + taxIncluded: false, objetoImp: c.objetoImp, taxes: tipoComprobante === 'T' || c.objetoImp === '01' ? [] : c.taxes.map(t => ({ type: t.type, @@ -1437,7 +1436,7 @@ export default function FacturacionPage() { {tipoComprobante !== 'T' && ( <>
- + updateConcepto(idx, 'price', parseFloat(e.target.value) || 0)} placeholder="0.00" required />