From 2e7abc2b7abba8bfe91d8f012712714f761cbb3a Mon Sep 17 00:00:00 2001 From: HotelSync Date: Mon, 16 Mar 2026 14:48:06 +0300 Subject: [PATCH] Apply 7 calendar/booking UI improvements MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Remove redundant "Шахматка бронирований" header from CalendarPage 2. Fix Saturday abbreviation: "су" → "сб" (use EEEEEE format) 3. Compact toggle: add "Вид" text label to button 4. Booking bars: check-in starts at 1/3 cell, check-out ends at 1/3 cell 5. BookingModal: move "Статус гостя" tags to left column 6. BookingDetailPanel: add scan button + print package in Docs tab 7. RentalBookingModal: add payment method + amount section Co-Authored-By: Claude Sonnet 4.6 --- .../bookings/BookingDetailPanel.tsx | 17 +++++++ src/components/bookings/BookingModal.tsx | 6 +-- src/components/calendar/BookingCalendar.tsx | 31 +++++++++---- src/components/rental/RentalBookingModal.tsx | 45 ++++++++++++++++++- src/data/rentalData.ts | 1 + src/pages/CalendarPage.tsx | 8 ---- 6 files changed, 87 insertions(+), 21 deletions(-) diff --git a/src/components/bookings/BookingDetailPanel.tsx b/src/components/bookings/BookingDetailPanel.tsx index c5030f4..0bb03bf 100644 --- a/src/components/bookings/BookingDetailPanel.tsx +++ b/src/components/bookings/BookingDetailPanel.tsx @@ -463,6 +463,23 @@ export function BookingDetailPanel({ booking, room, onClose, onUpdate }: Booking )) } + +
+ +

+ Состав комплекта настраивается в разделе «Документы» +

+
)} diff --git a/src/components/bookings/BookingModal.tsx b/src/components/bookings/BookingModal.tsx index 8410acc..bd17fa1 100644 --- a/src/components/bookings/BookingModal.tsx +++ b/src/components/bookings/BookingModal.tsx @@ -417,10 +417,7 @@ export function BookingModal({ open, draft, rooms, onClose, onSave, existing }: - - {/* ── RIGHT COLUMN ── */} -
{/* Guest tags */}
+ + {/* ── RIGHT COLUMN ── */} +
{/* Payment */} {total > 0 && (
diff --git a/src/components/calendar/BookingCalendar.tsx b/src/components/calendar/BookingCalendar.tsx index ab0763d..8d542b8 100644 --- a/src/components/calendar/BookingCalendar.tsx +++ b/src/components/calendar/BookingCalendar.tsx @@ -98,15 +98,24 @@ export function BookingCalendar({ rooms, bookings, onBookingCreate, onBookingUpd const getBlockStyle = (booking: Booking) => { const start = parseISO(booking.checkIn) - const end = parseISO(booking.checkOut) + const end = parseISO(booking.checkOut) + const rawColStart = differenceInDays(start, startDate) + const rawColEnd = differenceInDays(end, startDate) + if (rawColStart >= visibleDays || rawColEnd <= 0) return null - const colStart = Math.max(0, differenceInDays(start, startDate)) - const colEnd = Math.min(visibleDays, differenceInDays(end, startDate)) - if (colStart >= visibleDays || colEnd <= 0) return null + const INSET = Math.round(CELL_WIDTH / 3) + const isClippedLeft = rawColStart < 0 + const isClippedRight = rawColEnd > visibleDays + + const colStart = Math.max(0, rawColStart) + const colEnd = Math.min(visibleDays, rawColEnd) + + const leftPx = colStart * CELL_WIDTH + (isClippedLeft ? 0 : INSET) + const rightPx = colEnd * CELL_WIDTH + (isClippedRight ? 0 : INSET) return { - left: colStart * CELL_WIDTH, - width: (colEnd - colStart) * CELL_WIDTH - 4, + left: leftPx + 2, + width: Math.max(8, rightPx - leftPx - 4), } } @@ -245,9 +254,13 @@ export function BookingCalendar({ rooms, bookings, onBookingCreate, onBookingUpd
+ + {/* Payment */} +
+ +
+ {([ + { id: 'cash' as const, label: 'Наличные', icon: Banknote }, + { id: 'card' as const, label: 'Карта', icon: CreditCard }, + { id: 'transfer' as const, label: 'Перевод', icon: Building2 }, + ]).map(m => ( + + ))} +
+ setPaidAmount(e.target.value)} + min="0" + max={totalAmount} + /> + {paidAmount && parseFloat(paidAmount) > 0 && parseFloat(paidAmount) < totalAmount && ( +

+ Остаток: {(totalAmount - parseFloat(paidAmount)).toLocaleString('ru-RU')} ₽ +

+ )} +
{/* Footer */} diff --git a/src/data/rentalData.ts b/src/data/rentalData.ts index 862d87b..6796b7e 100644 --- a/src/data/rentalData.ts +++ b/src/data/rentalData.ts @@ -24,6 +24,7 @@ export interface RentalBooking { guestPhone: string linkedRoomId?: string totalAmount: number + paidAmount?: number status: 'confirmed' | 'cancelled' notes?: string } diff --git a/src/pages/CalendarPage.tsx b/src/pages/CalendarPage.tsx index 3c23450..66e406f 100644 --- a/src/pages/CalendarPage.tsx +++ b/src/pages/CalendarPage.tsx @@ -39,14 +39,6 @@ export function CalendarPage() { return (
-
-

- Шахматка бронирований -

-

- Нажмите и потяните по ячейкам для создания бронирования -

-