Warehouse Management

On Dock
0
Ready Tonight
0
Staging
0
Dropped Off
0
Cubic Feet
0
Total Weight
0

Items on Dock

Carrier Drop Offs Staging

Dropped Off Items

Carrier Management

Vehicle Management

Warehouse Layout Management

Front Warehouse

Active Areas: 0

Back Warehouse (Freight Storage)

Active Areas: 0

Area Types

Staging Area
Storage Area
Loading Dock
Rack System

Rack Management System

Wall Rack A (Left Wall)

Levels: 4 | Capacity: 16 locations

Wall Rack B (Right Wall)

Levels: 4 | Capacity: 16 locations

Back Wall Rack (3 Levels)

Levels: 3 | Capacity: 18 locations

Center Island (4 Levels)

Levels: 4 | Capacity: 32 locations

Recent Location Changes

Shipping Label Printing

Shipping Label Configuration

Select Shipments for Labels

Shipping Labels Preview

Location Labels Preview

`); printWindow.document.close(); printWindow.print(); } // Shipment Management Functions let currentEditingShipment = null; function openShipmentModal(shipmentId = null) { const modal = document.getElementById('shipmentModal'); const title = document.getElementById('shipmentModalTitle'); const form = document.getElementById('shipmentForm'); if (shipmentId) { // Edit mode currentEditingShipment = warehouseShipments.find(s => s.id === shipmentId); title.textContent = 'Edit Shipment'; populateShipmentForm(currentEditingShipment); } else { // Add mode currentEditingShipment = null; title.textContent = 'Add New Shipment'; form.reset(); document.getElementById('piecesInput').value = '1'; } modal.classList.remove('hidden'); } function closeShipmentModal() { const modal = document.getElementById('shipmentModal'); modal.classList.add('hidden'); currentEditingShipment = null; } function populateShipmentForm(shipment) { document.getElementById('hawbInput').value = shipment.hawb || ''; document.getElementById('mawbInput').value = shipment.mawb || ''; document.getElementById('customerInput').value = shipment.customer || ''; document.getElementById('shipperInput').value = shipment.shipper || ''; document.getElementById('originInput').value = shipment.origin || ''; document.getElementById('destinationInput').value = shipment.destination || ''; document.getElementById('carrierInput').value = shipment.carrier || ''; document.getElementById('piecesInput').value = shipment.pieces || 1; document.getElementById('weightInput').value = shipment.weight || ''; document.getElementById('dropOffInput').value = shipment.dropOffField || ''; } function saveShipment() { const formData = { hawb: document.getElementById('hawbInput').value.toUpperCase(), mawb: document.getElementById('mawbInput').value.toUpperCase(), customer: document.getElementById('customerInput').value.toUpperCase(), shipper: document.getElementById('shipperInput').value.toUpperCase(), origin: document.getElementById('originInput').value.toUpperCase(), destination: document.getElementById('destinationInput').value.toUpperCase(), carrier: document.getElementById('carrierInput').value, pieces: parseInt(document.getElementById('piecesInput').value) || 1, weight: parseFloat(document.getElementById('weightInput').value) || 0, dropOffField: document.getElementById('dropOffInput').value.toUpperCase(), status: 'ready' }; // Validate required fields if (!formData.customer || !formData.shipper || !formData.origin || !formData.destination || !formData.carrier) { alert('Please fill in all required fields.'); return; } if (currentEditingShipment) { // Update existing shipment Object.assign(currentEditingShipment, formData); alert('Shipment updated successfully!'); } else { // Add new shipment const newShipment = { id: 'SH' + Date.now().toString().slice(-6), ...formData }; warehouseShipments.push(newShipment); alert('Shipment added successfully!'); } closeShipmentModal(); renderShipmentSelection(); } function editShipment(shipmentId) { openShipmentModal(shipmentId); } function deleteShipment(shipmentId) { if (confirm('Are you sure you want to delete this shipment?')) { warehouseShipments = warehouseShipments.filter(s => s.id !== shipmentId); renderShipmentSelection(); alert('Shipment deleted successfully!'); } } // Scanner for location updates function openLocationScanner() { const trackingNumber = prompt('Enter tracking number to scan:'); if (!trackingNumber) return; const newLocation = prompt('Enter new location (e.g., A-B2):'); if (!newLocation) return; // Find existing location let oldLocation = null; Object.keys(rackSystems).forEach(rackId => { const index = rackSystems[rackId].findIndex(item => item === trackingNumber); if (index !== -1) { const cell = document.querySelector(`[data-rack="${rackId}"][data-index="${index}"]`); oldLocation = cell.dataset.location; rackSystems[rackId][index] = null; updateRackCell(cell, null); } }); // Update location history addLocationHistory(oldLocation || 'Unknown', trackingNumber, 'scanned', newLocation); alert(`Item ${trackingNumber} location updated to ${newLocation}`); } // Add event listeners for new features document.addEventListener('DOMContentLoaded', () => { // Existing event listeners... // Warehouse layout events document.getElementById('addAreaBtn').addEventListener('click', () => { alert('Click on grid cells to add areas'); }); document.getElementById('saveLayoutBtn').addEventListener('click', saveWarehouseLayout); document.getElementById('clearFrontBtn').addEventListener('click', () => clearWarehouseArea('front')); document.getElementById('clearBackBtn').addEventListener('click', () => clearWarehouseArea('back')); // Rack management events document.getElementById('addRackBtn').addEventListener('click', () => { alert('Click on rack cells to assign items'); }); document.getElementById('scanLocationBtn').addEventListener('click', openLocationScanner); // Label printing events document.getElementById('generateShippingLabelsBtn').addEventListener('click', generateShippingLabels); document.getElementById('printShippingLabelsBtn').addEventListener('click', printShippingLabels); document.getElementById('generateLocationLabelsBtn').addEventListener('click', generateLocationLabels); // Shipment management events document.getElementById('addShipmentBtn').addEventListener('click', () => openShipmentModal()); document.getElementById('closeShipmentModal').addEventListener('click', closeShipmentModal); document.getElementById('cancelShipmentBtn').addEventListener('click', closeShipmentModal); document.getElementById('shipmentForm').addEventListener('submit', (e) => { e.preventDefault(); saveShipment(); }); // Initialize shipment selection setTimeout(() => { if (document.getElementById('shipmentSelection')) { renderShipmentSelection(); } }, 1000); // Initialize layout setTimeout(() => { if (document.getElementById('frontWarehouseLayout')) { initializeWarehouseLayout(); } }, 1000); // Load customization settings loadCustomizationSettings(); // Initialize enhanced preview functionality window.generateShippingLabels = function() { const labelSize = document.getElementById('shippingLabelSize').value; const labelType = document.getElementById('shippingLabelType').value; const labelsPerShipment = parseInt(document.getElementById('labelsPerShipment').value) || 1; shippingLabelQueue = []; if (labelType === 'routing' || labelType === 'both') { selectedShipments.forEach(shipment => { for (let i = 1; i <= labelsPerShipment; i++) { shippingLabelQueue.push({ type: 'routing', shipment: shipment, pieceNumber: i, totalPieces: labelsPerShipment, size: labelSize, printDate: new Date().toISOString() }); } }); } renderShippingLabelPreviews(); renderEnhancedLabelPreviews(); alert(`Generated ${shippingLabelQueue.length} shipping labels`); }; // Update customization settings load if (document.getElementById('showWeight')) { document.getElementById('showWeight').checked = customizationSettings.screenSettings.carrierDropOff.showWeight; document.getElementById('showCube').checked = customizationSettings.screenSettings.carrierDropOff.showCube; document.getElementById('showMawb').checked = customizationSettings.screenSettings.carrierDropOff.showMawb; document.getElementById('groupByCarrier').checked = customizationSettings.screenSettings.carrierDropOff.groupByCarrier; } });