Nota de horas: datos de pago (bancarios) + periodo en el nombre del archivo
- Las notas "por pagar" ahora incluyen los datos bancarios de cobro configurados (Transferencia Nacional/Internacional: cuenta, CLABE, beneficiario, RFC, banco, SWIFT), igual que el PDF de cotizacion. Solo se muestran en las notas por pagar. - El nombre del PDF incluye el periodo cobrado (fecha minima a maxima de los registros), formato DD-MM-YYYY_DD-MM-YYYY. Ej: "Nota de horas por pagar UJ2606AG777 - 24-06-2026_24-06-2026". Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
This commit is contained in:
co-authored by
Claude Opus 4.8
parent
feb88de203
commit
3824dd00be
@@ -37,6 +37,16 @@ export interface NotaHorasPDFData {
|
||||
iva: number;
|
||||
total: number;
|
||||
etiquetaTotal: string; // "Total a pagar" | "Total pagado" | "Total"
|
||||
// Datos bancarios para el cobro (se muestran solo en las notas "por pagar").
|
||||
datosPago?: {
|
||||
razonSocial: string;
|
||||
rfc: string;
|
||||
cuentaNacional: string;
|
||||
clabeNacional: string;
|
||||
bancoNacional: string;
|
||||
clabeInternacional: string;
|
||||
swift: string;
|
||||
};
|
||||
colorPrimario?: string;
|
||||
colorSecundario?: string;
|
||||
logoBase64?: string;
|
||||
@@ -212,6 +222,44 @@ export async function generateNotaHorasPDF(data: NotaHorasPDFData): Promise<Buff
|
||||
if (data.incluirIva) line("IVA (16%)", money(data.iva));
|
||||
line(data.etiquetaTotal, money(data.total), true, true);
|
||||
|
||||
// ── DATOS PARA EL PAGO (solo notas por pagar) ──
|
||||
const dp = data.datosPago;
|
||||
if (dp) {
|
||||
const boxH = 52;
|
||||
y = need(boxH + 30, y) + 16;
|
||||
doc.rect(L, y, 3, 10).fill(PRIMARY);
|
||||
doc.font("Helvetica-Bold").fontSize(10).fillColor(DARK).text("Datos para el pago", L + 10, y);
|
||||
y += 16;
|
||||
|
||||
// Transferencia Nacional
|
||||
doc.save();
|
||||
doc.rect(L, y, W, boxH).fill(HEAD_BG).stroke(BORDER);
|
||||
doc.font("Helvetica-Bold").fontSize(8).fillColor(DARK).text("Transferencia Nacional", L + 8, y + 5);
|
||||
doc.font("Helvetica").fontSize(8.5).fillColor(DARK);
|
||||
if (dp.cuentaNacional) doc.text(`Cuenta: ${dp.cuentaNacional}`, L + 8, y + 18, { lineBreak: false });
|
||||
if (dp.clabeNacional) doc.text(`CLABE: ${dp.clabeNacional}`, L + W * 0.5, y + 18, { lineBreak: false });
|
||||
doc.text(`Beneficiario: ${dp.razonSocial}`, L + 8, y + 30, { lineBreak: false });
|
||||
doc.text(`RFC: ${dp.rfc}`, L + W * 0.5, y + 30, { lineBreak: false });
|
||||
if (dp.bancoNacional) doc.text(`Banco: ${dp.bancoNacional}`, L + 8, y + 42, { lineBreak: false });
|
||||
doc.restore();
|
||||
y += boxH + 8;
|
||||
|
||||
// Transferencia Internacional (si hay datos)
|
||||
if (dp.clabeInternacional || dp.swift) {
|
||||
y = need(boxH, y);
|
||||
doc.save();
|
||||
doc.rect(L, y, W, boxH).fill(HEAD_BG).stroke(BORDER);
|
||||
doc.font("Helvetica-Bold").fontSize(8).fillColor(DARK).text("Transferencia Internacional", L + 8, y + 5);
|
||||
doc.font("Helvetica").fontSize(8.5).fillColor(DARK);
|
||||
doc.text(`Beneficiario: ${dp.razonSocial}`, L + 8, y + 18, { lineBreak: false });
|
||||
if (dp.clabeInternacional) doc.text(`CLABE: ${dp.clabeInternacional}`, L + W * 0.5, y + 18, { lineBreak: false });
|
||||
doc.text(`Banco: BBVA Mexico`, L + 8, y + 30, { lineBreak: false });
|
||||
if (dp.swift) doc.text(`SWIFT: ${dp.swift}`, L + W * 0.5, y + 30, { lineBreak: false });
|
||||
doc.restore();
|
||||
y += boxH + 8;
|
||||
}
|
||||
}
|
||||
|
||||
// ── PIE ───────────────────────────────────────
|
||||
y = need(30, y) + 14;
|
||||
doc.font("Helvetica").fontSize(8).fillColor(MUTED).text(
|
||||
|
||||
Reference in New Issue
Block a user