feat(pos): add 3 improvements — Spanish translations, PDF quotes, push notifications

1. Spanish translations for TecDoc catalog (translations.py) applied to
   catalog_service.py and dashboard server.py endpoints
2. Printable quotation HTML endpoint (/pos/api/quotations/<id>/pdf) with
   @media print CSS for clean browser-to-PDF output
3. Web Push notifications to owner/admin on sale cancellation, stock zero,
   and cash register differences > $500. Includes service worker, VAPID
   key management, and subscription endpoints.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-04 08:05:11 +00:00
parent c61e58ac6a
commit 5d5a2777eb
11 changed files with 848 additions and 14 deletions

View File

@@ -345,6 +345,21 @@ def cut_z():
})
conn.commit()
# Push notification to owner if cash difference > $500
if abs(difference) > 500:
try:
from services.push_service import notify_owner
emp_name = getattr(g, 'employee_name', 'Empleado')
notify_owner(
conn,
'Diferencia en Caja',
f'Corte Z caja #{register_id}: diferencia de ${difference:,.2f} ({emp_name})',
'/pos'
)
except Exception:
pass # Push failures never block business logic
cur.close(); conn.close()
return jsonify({