Compare commits
2 Commits
16fd7dd423
...
0171daea38
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
0171daea38 | ||
|
|
a1c647a7b3 |
@ -124,7 +124,7 @@ export function CreateInvoiceFromEstimateButton() {
|
|||||||
</Button>
|
</Button>
|
||||||
|
|
||||||
<Dialog open={open} onOpenChange={setOpen}>
|
<Dialog open={open} onOpenChange={setOpen}>
|
||||||
<DialogContent className="min-w-2xl">
|
<DialogContent className="sm:max-w-5xl">
|
||||||
<DialogHeader>
|
<DialogHeader>
|
||||||
<DialogTitle>Generate Invoice from Estimate</DialogTitle>
|
<DialogTitle>Generate Invoice from Estimate</DialogTitle>
|
||||||
</DialogHeader>
|
</DialogHeader>
|
||||||
|
|||||||
@ -24,6 +24,7 @@ import {
|
|||||||
import { DEPARTMENT_ROUTES } from "@garage/api"
|
import { DEPARTMENT_ROUTES } from "@garage/api"
|
||||||
import { FUEL_LEVEL_OPTIONS } from "./job-card.schema"
|
import { FUEL_LEVEL_OPTIONS } from "./job-card.schema"
|
||||||
import { toId } from "@/shared/lib/utils"
|
import { toId } from "@/shared/lib/utils"
|
||||||
|
import { DepartmentInlineForm } from "@/modules/services/inline-forms/department-inline-form"
|
||||||
|
|
||||||
// ── Schema ──
|
// ── Schema ──
|
||||||
|
|
||||||
@ -46,7 +47,7 @@ const mapLookupOption = (item: any) => ({
|
|||||||
label: item.name,
|
label: item.name,
|
||||||
})
|
})
|
||||||
|
|
||||||
const STORE_OBJECT = { storeObject: true } as const
|
const STORE_OBJECT = { getOptionValue: (o: any) => o, getOptionLabel: (o: any) => o.label } as const
|
||||||
|
|
||||||
// ── Props ──
|
// ── Props ──
|
||||||
|
|
||||||
@ -138,11 +139,10 @@ export function JobCardCheckInDialog({
|
|||||||
required
|
required
|
||||||
queryKey={[DEPARTMENT_ROUTES.INDEX]}
|
queryKey={[DEPARTMENT_ROUTES.INDEX]}
|
||||||
listFn={() => api.departments.list()}
|
listFn={() => api.departments.list()}
|
||||||
mapOption={(op:any)=> ({value: op.id, label: op.name})}
|
mapOption={(item: any) => ({ value: String(item.id), label: item.name ?? String(item.id) })}
|
||||||
|
createForm={(props) => <DepartmentInlineForm {...props} />}
|
||||||
|
createLabel="Department"
|
||||||
{...STORE_OBJECT}
|
{...STORE_OBJECT}
|
||||||
getOptionLabel={op=>op.label}
|
|
||||||
getOptionValue={op=>op}
|
|
||||||
|
|
||||||
/>
|
/>
|
||||||
<div className="grid grid-cols-1 gap-4 sm:grid-cols-2">
|
<div className="grid grid-cols-1 gap-4 sm:grid-cols-2">
|
||||||
<RhfDateField name="delivery_date" label="Delivery Date" />
|
<RhfDateField name="delivery_date" label="Delivery Date" />
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user