-
-
setEditFields((p) => ({ ...p, serialNumber: e.target.value }))} />
+
-
-
-
-
-
-
-
- setEditFields((p) => ({ ...p, estimatedCost: e.target.value }))} />
-
-
-
-
setEditFields((p) => ({ ...p, actualCost: e.target.value }))} />
+
+
+
+
+
+
setEditFields((p) => ({ ...p, estimatedCost: e.target.value }))} />
+
setEditFields((p) => ({ ...p, actualCost: e.target.value }))} />
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
-
Customer: {ticket.customerName}
-
Phone: {ticket.customerPhone ?? '-'}
-
Account: {ticket.accountId ?? 'Walk-in'}
+ ) : (
+
+
+
+
Customer: {ticket.customerName}
+
Phone: {ticket.customerPhone ?? '-'}
+
Account: {ticket.accountId ?? 'Walk-in'}
+
+
+
Instrument: {ticket.instrumentDescription ?? '-'}
+
Serial: {ticket.serialNumber ?? '-'}
+
Condition: {ticket.conditionIn ?? '-'}
+
-
Instrument: {ticket.instrumentDescription ?? '-'}
-
Serial: {ticket.serialNumber ?? '-'}
-
Condition: {ticket.conditionIn ?? '-'}
+
Problem: {ticket.problemDescription}
+ {ticket.conditionInNotes &&
Condition Notes: {ticket.conditionInNotes}
}
+ {ticket.technicianNotes &&
Tech Notes: {ticket.technicianNotes}
}
+
+
+
Estimate: {ticket.estimatedCost ? `$${ticket.estimatedCost}` : '-'}
+
Actual: {ticket.actualCost ? `$${ticket.actualCost}` : '-'}
+
Promised: {ticket.promisedDate ? new Date(ticket.promisedDate).toLocaleDateString() : '-'}
+
Intake: {new Date(ticket.intakeDate).toLocaleDateString()}
-
-
Problem: {ticket.problemDescription}
- {ticket.conditionInNotes &&
Condition Notes: {ticket.conditionInNotes}
}
- {ticket.technicianNotes &&
Tech Notes: {ticket.technicianNotes}
}
-
-
-
Estimate: {ticket.estimatedCost ? `$${ticket.estimatedCost}` : '-'}
-
Actual: {ticket.actualCost ? `$${ticket.actualCost}` : '-'}
-
Promised: {ticket.promisedDate ? new Date(ticket.promisedDate).toLocaleDateString() : '-'}
-
Intake: {new Date(ticket.intakeDate).toLocaleDateString()}
-
-
- )}
-
-
+ )}
+
+
+ )}
- {/* Photos by Phase */}
-
-
- Photos
-
-
-
-
-
+ {activeTab === 'line-items' && (
+
+
+ Line Items
+ {hasPermission('repairs.edit') && (
+
+ )}
+
+
+
+
+
+ )}
- {/* Notes Journal */}
-
-
- Notes
-
-
-
-
-
+ {activeTab === 'notes' && (
+
+
+ Notes
+
+
+
+
+
+ )}
- {/* Line Items */}
-
-
- Line Items
- {hasPermission('repairs.edit') && (
-
- )}
-
-
-
-
-
+ {activeTab === 'files' && (
+
+
+ Photos & Documents
+
+
+
+
+
+ )}
)
}
@@ -398,23 +403,12 @@ function AddLineItemDialog({ ticketId, open, onOpenChange }: { ticketId: string;
})
function resetForm() {
- setDescription('')
- setQty('1')
- setUnitPrice('0')
- setCost('')
- setItemType('labor')
- setTemplateSearch('')
- setShowTemplates(false)
+ setDescription(''); setQty('1'); setUnitPrice('0'); setCost(''); setItemType('labor'); setTemplateSearch(''); setShowTemplates(false)
}
function selectTemplate(template: { name: string; instrumentType: string | null; size: string | null; itemType: string; defaultPrice: string; defaultCost: string | null }) {
const desc = [template.name, template.instrumentType, template.size].filter(Boolean).join(' — ')
- setDescription(desc)
- setItemType(template.itemType)
- setUnitPrice(template.defaultPrice)
- setCost(template.defaultCost ?? '')
- setShowTemplates(false)
- setTemplateSearch('')
+ setDescription(desc); setItemType(template.itemType); setUnitPrice(template.defaultPrice); setCost(template.defaultCost ?? ''); setShowTemplates(false); setTemplateSearch('')
}
function handleSubmit(e: React.FormEvent) {
@@ -434,78 +428,36 @@ function AddLineItemDialog({ ticketId, open, onOpenChange }: { ticketId: string;
Add Line Item
-
- {/* Template picker */}
-
{ setTemplateSearch(e.target.value); setShowTemplates(true) }}
- onFocus={() => templateSearch && setShowTemplates(true)}
- className="mt-1"
- />
+
+
+ { setTemplateSearch(e.target.value); setShowTemplates(true) }} onFocus={() => templateSearch && setShowTemplates(true)} className="pl-9" />
+
{showTemplates && templateSearch.length > 0 && (
- {templates.length === 0 ? (
-
No templates found
- ) : (
- templates.map((t) => (
-
- ))
- )}
+ {templates.length === 0 ?
No templates found
: templates.map((t) => (
+
+ ))}
)}
-
-
-
+