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:
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user