feat(facturacion): precio unitario sin IVA en conceptos
- Cambia label de 'Precio Unitario (IVA incluido)' a 'Precio Unitario (sin IVA)' - Elimina división interna price/(1+iva) en calcConcepto; ahora price es la base - Cambia taxIncluded: true → false en payload enviado a backend - Backend: tax_included default false en facturapi.service.ts y contribuyente-facturapi.service.ts - Build y deploy exitosos
This commit is contained in:
@@ -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,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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' && (
|
||||
<>
|
||||
<div className="space-y-2">
|
||||
<Label>Precio Unitario (IVA incluido)</Label>
|
||||
<Label>Precio Unitario (sin IVA)</Label>
|
||||
<Input type="number" min="0" step="0.01" value={c.price || ''} onChange={e => updateConcepto(idx, 'price', parseFloat(e.target.value) || 0)} placeholder="0.00" required />
|
||||
</div>
|
||||
<div className="space-y-2">
|
||||
|
||||
Reference in New Issue
Block a user