diff --git a/src/app/(admin)/bookings/[id]/booking-detail.tsx b/src/app/(admin)/bookings/[id]/booking-detail.tsx index 284ad34..d7221af 100644 --- a/src/app/(admin)/bookings/[id]/booking-detail.tsx +++ b/src/app/(admin)/bookings/[id]/booking-detail.tsx @@ -33,11 +33,13 @@ export function BookingDetail({ const [phone, setPhone] = useState(booking.phone); const [objectIds, setObjectIds] = useState>(new Set(booking.objects.map((o) => o.id))); const [date, setDate] = useState(toDateInputValue(booking.date)); + const [checkOutDate, setCheckOutDate] = useState(booking.checkOutDate ? toDateInputValue(booking.checkOutDate) : ""); const [checkIn, setCheckIn] = useState(booking.checkIn); const [checkOut, setCheckOut] = useState(booking.checkOut); const [guestCount, setGuestCount] = useState(String(booking.guestCount)); const [cost, setCost] = useState(String(booking.cost)); const [prepayment, setPrepayment] = useState(String(booking.prepayment)); + const [discount, setDiscount] = useState(String(booking.discount)); const [comment, setComment] = useState(booking.comment ?? ""); const [source, setSource] = useState(booking.source ?? ""); @@ -66,11 +68,13 @@ export function BookingDetail({ phone, objectIds: Array.from(objectIds), date, + checkOutDate: checkOutDate || null, checkIn, checkOut, guestCount: Number(guestCount), cost: Number(cost), prepayment: Number(prepayment) || 0, + discount: Number(discount) || 0, comment: comment.trim() || null, source: source.trim() || null, }), @@ -160,22 +164,26 @@ export function BookingDetail({ -
+
+
-
+
+
- {formatDate(booking.date)}, {booking.checkIn}–{booking.checkOut} + + {formatDate(booking.date)} + {booking.checkOutDate ? ` - ${formatDate(booking.checkOutDate)}` : ""}, {booking.checkIn}–{booking.checkOut} + {booking.guestCount} diff --git a/src/app/(admin)/bookings/new/new-booking-form.tsx b/src/app/(admin)/bookings/new/new-booking-form.tsx index c3ffce8..f358c99 100644 --- a/src/app/(admin)/bookings/new/new-booking-form.tsx +++ b/src/app/(admin)/bookings/new/new-booking-form.tsx @@ -13,11 +13,13 @@ export function NewBookingForm({ objects }: { objects: BookableObjectDTO[] }) { const [phone, setPhone] = useState(""); const [objectIds, setObjectIds] = useState>(new Set()); const [date, setDate] = useState(""); + const [checkOutDate, setCheckOutDate] = useState(""); const [checkIn, setCheckIn] = useState(""); const [checkOut, setCheckOut] = useState(""); const [guestCount, setGuestCount] = useState(""); const [cost, setCost] = useState(""); const [prepayment, setPrepayment] = useState("0"); + const [discount, setDiscount] = useState("0"); const [comment, setComment] = useState(""); const [source, setSource] = useState(""); const [loading, setLoading] = useState(false); @@ -50,11 +52,13 @@ export function NewBookingForm({ objects }: { objects: BookableObjectDTO[] }) { phone, objectIds: Array.from(objectIds), date, + checkOutDate: checkOutDate || null, checkIn, checkOut, guestCount: Number(guestCount), cost: Number(cost), prepayment: Number(prepayment) || 0, + discount: Number(discount) || 0, comment: comment.trim() || null, source: source.trim() || null, }), @@ -117,22 +121,26 @@ export function NewBookingForm({ objects }: { objects: BookableObjectDTO[] }) { )}
-
+
+
-
+
+