diff --git a/pos/static/js/inventory.js b/pos/static/js/inventory.js index b16199f..f2ed69c 100644 --- a/pos/static/js/inventory.js +++ b/pos/static/js/inventory.js @@ -470,6 +470,77 @@ html += '
Cargando equivalencias...
'; + html += 'Sin conexion al catalogo.
'; }); + return; + } + + renderCrossRefs(el, alternatives, bodegas); + }) + .catch(function() { + var el = document.getElementById('crossRefContent'); + if (el) el.innerHTML = 'Sin conexion al catalogo central.
'; + }); + })(); + + function renderCrossRefs(el, alternatives, bodegas) { + var html2 = ''; + + if (bodegas && bodegas.length > 0) { + html2 += '| Bodega | Stock | Precio | Ubicacion |
|---|---|---|---|
| ' + esc(b.business_name || b.bodega || '') + ' | ' + (b.stock || b.stock_quantity || 0) + ' | $' + fmt(b.price || 0) + ' | ' + esc(b.location || b.warehouse_location || '') + ' |
| No. Parte | Fabricante | Nombre |
|---|---|---|
| ' + esc(a.part_number || a.cross_reference_number || '') + ' | ' + esc(a.manufacturer || a.source_ref || '') + ' | ' + esc(a.name || a.name_aftermarket_parts || '') + ' |
No se encontraron equivalencias para esta parte.
'; + } + el.innerHTML = html2; + } + // Movement history html += '