mirror of
https://github.com/marcogll/ap_pos.git
synced 2026-01-13 13:15:16 +00:00
feat: Release version 1.5.0 with major UI improvements and advanced anticipos
- Add sales subtabs: Ventas and Tickets for better organization - Implement manual anticipos with confirmation checkbox system - Add automatic "Público General" for sales without specific client - Reorganize service order: Clean Girl → Elegant → Mystery → Seduction - Replace gradient with solid black header background - Improve price alignment with grid layout - Add sort_order field to products for consistent ordering - Move movements section from dashboard to Tickets subtab - Enhanced JavaScript functionality for subtab navigation - Remove TASKS.md documentation file 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
36
print.js
36
print.js
@@ -97,7 +97,41 @@ function templateTicket(mov, settings) {
|
||||
|
||||
// DESCUENTOS SI EXISTEN
|
||||
if (mov.descuento && mov.descuento > 0) {
|
||||
lines.push(`<div class="t-row t-small"><span>Descuento ${mov.motivoDescuento ? '(' + esc(mov.motivoDescuento) + ')' : ''}:</span><span>-$${Number(mov.descuento).toFixed(2)}</span></div>`);
|
||||
if (mov.discountInfo) {
|
||||
// Mostrar información detallada del descuento
|
||||
const discountInfo = mov.discountInfo;
|
||||
let descriptionText = '';
|
||||
let amountText = `-$${Number(mov.descuento).toFixed(2)}`;
|
||||
|
||||
if (discountInfo.type === 'anticipo') {
|
||||
// Distinguir entre anticipo registrado y manual
|
||||
if (discountInfo.anticipo && discountInfo.anticipo.manual) {
|
||||
descriptionText = `Anticipo manual aplicado (${discountInfo.anticipo.comentario})`;
|
||||
} else {
|
||||
descriptionText = `Anticipo aplicado ${discountInfo.anticipo ? `(${discountInfo.anticipo.folio})` : ''}`;
|
||||
}
|
||||
amountText = `-$${Number(mov.descuento).toFixed(2)} (${discountInfo.percentage.toFixed(1)}%)`;
|
||||
} else if (discountInfo.type === 'warrior') {
|
||||
descriptionText = 'Descuento Vanity (100%)';
|
||||
amountText = `-$${Number(mov.descuento).toFixed(2)} (${discountInfo.percentage.toFixed(1)}%)`;
|
||||
} else if (discountInfo.type === 'percentage') {
|
||||
descriptionText = `Descuento (${discountInfo.value}%)`;
|
||||
amountText = `-$${Number(mov.descuento).toFixed(2)} (${discountInfo.percentage.toFixed(1)}%)`;
|
||||
} else if (discountInfo.type === 'amount') {
|
||||
descriptionText = `Descuento ($${discountInfo.value})`;
|
||||
amountText = `-$${Number(mov.descuento).toFixed(2)} (${discountInfo.percentage.toFixed(1)}%)`;
|
||||
}
|
||||
|
||||
lines.push(`<div class="t-row t-small"><span>${descriptionText}:</span><span>${amountText}</span></div>`);
|
||||
|
||||
// Mostrar comentario del descuento si existe
|
||||
if (discountInfo.reason && discountInfo.reason.trim()) {
|
||||
lines.push(`<div class="t-center t-small t-service-detail"><b>Motivo:</b> ${esc(discountInfo.reason)}</div>`);
|
||||
}
|
||||
} else {
|
||||
// Fallback para formato anterior
|
||||
lines.push(`<div class="t-row t-small"><span>Descuento ${mov.motivoDescuento ? '(' + esc(mov.motivoDescuento) + ')' : ''}:</span><span>-$${Number(mov.descuento).toFixed(2)}</span></div>`);
|
||||
}
|
||||
}
|
||||
|
||||
if (mov.staff) lines.push(`<div class="t-center t-small t-service-detail"><b>Te atendió:</b> ${esc(mov.staff)}</div>`);
|
||||
|
||||
Reference in New Issue
Block a user