feat(facturacion): cuenta predial para régimen 606 (arrendamiento)
- Frontend: muestra input 'No. Cuenta Predial' en sección 'Datos del Inmueble' cuando el régimen del emisor es 606 (Arrendamiento), antes de Conceptos - Frontend: incluye cuentaPredial en payload; se resetea al cambiar contribuyente - Backend: pasa property_tax_account a nivel de cada item en Facturapi para facturapi.service.ts y contribuyente-facturapi.service.ts - Build y deploy exitosos
This commit is contained in:
@@ -443,6 +443,7 @@ export async function createInvoiceContribuyente(
|
|||||||
...(t.withholding ? { withholding: true } : {}),
|
...(t.withholding ? { withholding: true } : {}),
|
||||||
})) || [{ type: 'IVA', rate: 0.16 }],
|
})) || [{ type: 'IVA', rate: 0.16 }],
|
||||||
},
|
},
|
||||||
|
...(data.cuentaPredial ? { property_tax_account: data.cuentaPredial } : {}),
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -323,6 +323,7 @@ export async function createInvoice(
|
|||||||
...(t.withholding ? { withholding: true } : {}),
|
...(t.withholding ? { withholding: true } : {}),
|
||||||
})) || [{ type: 'IVA', rate: 0.16 }],
|
})) || [{ type: 'IVA', rate: 0.16 }],
|
||||||
},
|
},
|
||||||
|
...((data as any).cuentaPredial ? { property_tax_account: (data as any).cuentaPredial } : {}),
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -303,6 +303,7 @@ export default function FacturacionPage() {
|
|||||||
const [serie, setSerie] = useState('');
|
const [serie, setSerie] = useState('');
|
||||||
const [folio, setFolio] = useState('');
|
const [folio, setFolio] = useState('');
|
||||||
const [condiciones, setCondiciones] = useState('');
|
const [condiciones, setCondiciones] = useState('');
|
||||||
|
const [cuentaPredial, setCuentaPredial] = useState('');
|
||||||
const [fechaEmision, setFechaEmision] = useState(() => {
|
const [fechaEmision, setFechaEmision] = useState(() => {
|
||||||
const d = new Date();
|
const d = new Date();
|
||||||
d.setHours(12, 0, 0, 0);
|
d.setHours(12, 0, 0, 0);
|
||||||
@@ -349,6 +350,7 @@ export default function FacturacionPage() {
|
|||||||
setSerie('');
|
setSerie('');
|
||||||
setFolio('');
|
setFolio('');
|
||||||
setCondiciones('');
|
setCondiciones('');
|
||||||
|
setCuentaPredial('');
|
||||||
setConceptos([{ ...emptyConcepto, unitKey: defaultUnit }]);
|
setConceptos([{ ...emptyConcepto, unitKey: defaultUnit }]);
|
||||||
setRelatedUuid('');
|
setRelatedUuid('');
|
||||||
setRelatedRelationship('01');
|
setRelatedRelationship('01');
|
||||||
@@ -658,6 +660,7 @@ export default function FacturacionPage() {
|
|||||||
if (serie) data.series = serie;
|
if (serie) data.series = serie;
|
||||||
if (folio) data.folioNumber = parseInt(folio) || undefined;
|
if (folio) data.folioNumber = parseInt(folio) || undefined;
|
||||||
if (condiciones) data.conditions = condiciones;
|
if (condiciones) data.conditions = condiciones;
|
||||||
|
if (cuentaPredial) data.cuentaPredial = cuentaPredial;
|
||||||
|
|
||||||
// Validar fecha de emisión para I, E, T
|
// Validar fecha de emisión para I, E, T
|
||||||
if (tipoComprobante !== 'P' && fechaEmision) {
|
if (tipoComprobante !== 'P' && fechaEmision) {
|
||||||
@@ -1345,6 +1348,30 @@ export default function FacturacionPage() {
|
|||||||
</Card>
|
</Card>
|
||||||
)}
|
)}
|
||||||
|
|
||||||
|
{/* Cuenta Predial — solo régimen 606 (Arrendamiento) */}
|
||||||
|
{emisorRegimen === '606' && config.needsConceptos && (
|
||||||
|
<Card>
|
||||||
|
<CardHeader>
|
||||||
|
<CardTitle className="text-base">Datos del Inmueble</CardTitle>
|
||||||
|
<CardDescription>Obligatorio para arrendamiento (SAT)</CardDescription>
|
||||||
|
</CardHeader>
|
||||||
|
<CardContent>
|
||||||
|
<div className="space-y-2">
|
||||||
|
<Label>No. Cuenta Predial</Label>
|
||||||
|
<Input
|
||||||
|
value={cuentaPredial}
|
||||||
|
onChange={e => setCuentaPredial(e.target.value.replace(/[^0-9a-zA-Z]/g, '').toUpperCase())}
|
||||||
|
placeholder="Ej. 15956011002"
|
||||||
|
maxLength={150}
|
||||||
|
/>
|
||||||
|
<p className="text-xs text-muted-foreground">
|
||||||
|
Número de cuenta predial del inmueble arrendado. Si contiene letras o guiones, sustitúyalos por "0".
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</CardContent>
|
||||||
|
</Card>
|
||||||
|
)}
|
||||||
|
|
||||||
{/* Conceptos (Ingreso, Egreso, Traslado) */}
|
{/* Conceptos (Ingreso, Egreso, Traslado) */}
|
||||||
{config.needsConceptos && (
|
{config.needsConceptos && (
|
||||||
<Card>
|
<Card>
|
||||||
|
|||||||
@@ -70,6 +70,7 @@ export interface InvoiceData {
|
|||||||
folioNumber?: number;
|
folioNumber?: number;
|
||||||
conditions?: string;
|
conditions?: string;
|
||||||
fechaEmision?: string;
|
fechaEmision?: string;
|
||||||
|
cuentaPredial?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface InvoiceResult {
|
export interface InvoiceResult {
|
||||||
|
|||||||
Reference in New Issue
Block a user