Book My Garrage
Order Management
Main Dashboard Super Dashboard Orders CR Module Management Vendors Customers Services Finance Settlements Payments Quick Links Vendor Dashboard Track Order Main Website

Order Management

Manage all orders with 15-step workflow
Inspection Form
  • Order Details
  • Vehicle Assets
  • Inspection Checklist
Vehicle Inventory
Vehicle Readings
Assign Garage
Add New Order
Customer Details
Vehicle Details

Service Details
Schedule
`); } } function putOnHold(orderId) { if (confirm('Put this order on hold?')) { BMGWorkflow.updateOrderStatus(orderId, 'on_hold', 'Admin'); showToast('Order put on hold', 'warning'); loadOrders(); loadCategoryTabs(); } } function cancelOrder(orderId) { if (confirm('Are you sure you want to cancel this order?')) { BMGWorkflow.updateOrderStatus(orderId, 'cancelled', 'Admin'); showToast('Order cancelled', 'warning'); loadOrders(); loadCategoryTabs(); } } function collectNPS(orderId) { const score = prompt('Enter NPS score (0-10):'); if (score !== null) { const feedback = prompt('Enter customer feedback:'); BMGWorkflow.saveNPSFeedback(orderId, { score: parseInt(score), feedback: feedback || '' }); showToast('Feedback collected!', 'success'); loadOrders(); } } function capturePhoto() { const input = document.createElement('input'); input.type = 'file'; input.accept = 'image/*'; input.capture = 'environment'; input.onchange = (e) => { const file = e.target.files[0]; if (file) { const reader = new FileReader(); reader.onload = function(e) { const preview = document.getElementById('photoPreview'); preview.innerHTML += ``; }; reader.readAsDataURL(file); showToast('Photo added!', 'success'); } }; input.click(); } function refreshOrders() { BMGWorkflow.loadOrdersFromStorage(); loadOrders(); loadCategoryTabs(); showToast('Orders refreshed!', 'success'); } function showAddOrderModal() { document.getElementById('newPickupDate').value = new Date().toISOString().split('T')[0]; const modal = new bootstrap.Modal(document.getElementById('addOrderModal')); modal.show(); } function updateServicePrice() { const select = document.getElementById('newServiceType'); const selected = select.options[select.selectedIndex]; document.getElementById('newServicePrice').value = selected.dataset.price || 0; } function createNewOrder() { const name = document.getElementById('newCustomerName').value; const phone = document.getElementById('newCustomerPhone').value; const manufacturer = document.getElementById('newCarManufacturer').value; const model = document.getElementById('newCarModel').value; const regNo = document.getElementById('newCarRegNo').value; const serviceName = document.getElementById('newServiceType').value; const price = parseInt(document.getElementById('newServicePrice').value) || 0; if (!name || !phone || !manufacturer || !model || !regNo || !serviceName) { showToast('Please fill all required fields!', 'error'); return; } const newOrder = { id: 'BMG' + Date.now().toString().slice(-6), customer: { name: name, phone: phone, email: document.getElementById('newCustomerEmail').value || '' }, car: { manufacturer: manufacturer, model: model, regNo: regNo.toUpperCase(), fuelType: document.getElementById('newCarFuel').value, year: parseInt(document.getElementById('newCarYear').value) }, services: [{ name: serviceName, price: price }], total: price, status: 'pending_request', statusHistory: [{ status: 'pending_request', timestamp: new Date().toISOString(), by: 'Admin' }], vendor: null, driver: null, scheduledDate: document.getElementById('newPickupDate').value, scheduledTime: document.getElementById('newPickupTime').value, pickupAddress: document.getElementById('newPickupAddress').value, ppi: null, psi: null, pdi: null, vehicleInventory: null, vehicleReadings: { pickup: null, delivery: null }, nps: null, createdAt: new Date().toISOString() }; BMGWorkflow.ordersData.unshift(newOrder); BMGWorkflow.saveOrdersToStorage(); bootstrap.Modal.getInstance(document.getElementById('addOrderModal')).hide(); showToast(`Order #${newOrder.id} created successfully!`, 'success'); loadOrders(); loadCategoryTabs(); } function showToast(message, type = 'info') { const container = document.getElementById('toastContainer'); const id = 'toast-' + Date.now(); const bgClass = { 'success': 'bg-success', 'error': 'bg-danger', 'warning': 'bg-warning', 'info': 'bg-info' }[type] || 'bg-info'; container.innerHTML += `
${message}
`; setTimeout(() => { const toast = document.getElementById(id); if (toast) toast.remove(); }, 3000); }