feat(pos): add 5 quick improvements — dark mode, email quotes, barcode scan, returns, offline catalog

1. Auto dark mode: detect system prefers-color-scheme, auto-switch industrial/modern theme
2. Email quotation endpoint: POST /quotations/:id/email sends HTML email via SMTP
3. Camera barcode scanner: BarcodeDetector API with getUserMedia overlay in catalog
4. Returns with warranty: POST /returns endpoint with stock restoration and sale status tracking
5. Partial offline catalog: cache top 500 parts in IndexedDB, search when offline

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-04-04 08:03:28 +00:00
parent 39f2aaf98f
commit c61e58ac6a
9 changed files with 751 additions and 23 deletions

View File

@@ -1005,6 +1005,20 @@
}
// ─── EXPOSE GLOBALS (for backward compat) ───
// ─── BARCODE CAMERA SCAN ───
function startBarcodeScan() {
if (!window.NexusNative) {
alert('El modulo de escaneo no esta cargado.');
return;
}
window.NexusNative.scanBarcode().then(function (code) {
if (code) {
searchInput.value = code;
runSearch(code);
}
});
}
window.CatalogApp = {
toggleCart: toggleCart,
goToCheckout: goToCheckout,
@@ -1018,6 +1032,7 @@
vsModelChanged: vsModelChanged,
vsEngineChanged: vsEngineChanged,
vsClear: vsClearAll,
startBarcodeScan: startBarcodeScan,
};
// ─── INIT ───