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:
@@ -510,6 +510,19 @@ def cancel_sale(conn, sale_id, reason):
|
||||
old_value={'status': 'completed', 'total': float(s_total)},
|
||||
new_value={'status': 'cancelled', 'reason': reason})
|
||||
|
||||
# Push notification to owner/admin (best-effort, non-blocking)
|
||||
try:
|
||||
from services.push_service import notify_owner
|
||||
emp_name = getattr(g, 'employee_name', 'Empleado')
|
||||
notify_owner(
|
||||
conn,
|
||||
'Venta Cancelada',
|
||||
f'Venta #{sale_id} (${float(s_total):,.2f}) cancelada por {emp_name}: {reason}',
|
||||
'/pos'
|
||||
)
|
||||
except Exception:
|
||||
pass # Push failures never block business logic
|
||||
|
||||
cur.close()
|
||||
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user