diff --git a/src/pages/PosPage.tsx b/src/pages/PosPage.tsx index a3c9905..e2db39d 100644 --- a/src/pages/PosPage.tsx +++ b/src/pages/PosPage.tsx @@ -22,7 +22,7 @@ interface RoomBalance { nights: number } -type PaymentMethod = 'cash' | 'terminal' | 'atol' +type PaymentMethod = 'cash' | 'terminal' type ChargePurpose = 'stay' | 'breakfast' | 'transfer' | 'parking' | 'extra' type PosTab = 'main' | 'report' | 'atol' type AtolConnection = 'usb' | 'tcp' | 'com' @@ -82,9 +82,8 @@ const TAX_SYSTEM_LABELS: Record = { // ── Subcomponents ───────────────────────────────────────────────────────────── function MethodIcon({ method, size = 11 }: { method: PaymentMethod; size?: number }) { - if (method === 'cash') return - if (method === 'terminal') return - return + if (method === 'cash') return + return } // ── Component ───────────────────────────────────────────────────────────────── @@ -100,6 +99,7 @@ export function PosPage() { const [amount, setAmount] = useState(0) const [method, setMethod] = useState('terminal') const [notes, setNotes] = useState('') + const [printFiscal, setPrintFiscal] = useState(true) const [lastReceipt, setLastReceipt] = useState(null) const [activeTab, setActiveTab] = useState('main') @@ -151,10 +151,8 @@ export function PosPage() { const shiftRevenue = shiftReceipts.reduce((s, r) => s + r.amount, 0) const cashRevenue = shiftReceipts.filter(r => r.method === 'cash').reduce((s, r) => s + r.amount, 0) const termRevenue = shiftReceipts.filter(r => r.method === 'terminal').reduce((s, r) => s + r.amount, 0) - const atolRevenue = shiftReceipts.filter(r => r.method === 'atol').reduce((s, r) => s + r.amount, 0) const cashCount = shiftReceipts.filter(r => r.method === 'cash').length const termCount = shiftReceipts.filter(r => r.method === 'terminal').length - const atolCount = shiftReceipts.filter(r => r.method === 'atol').length const handlePay = () => { if (!selectedRoom || amount <= 0 || !shiftOpen) return @@ -390,11 +388,10 @@ export function PosPage() { {/* Payment method */}

Способ оплаты

-
+
{([ { key: 'cash', label: 'Наличные', Icon: Banknote, cls: 'emerald' }, { key: 'terminal', label: 'Терминал', Icon: CreditCard, cls: 'blue' }, - { key: 'atol', label: 'АТОЛ', Icon: Printer, cls: 'violet' }, ] as const).map(m => ( ))}
+ {/* Fiscal receipt (ATOL) */} +
+
+ +
+

+ Фискальный чек (АТОЛ) +

+

+ {atolConnected ? 'Регистратор подключён · автопечать чека' : 'Регистратор не подключён'} +

+
+
+ +
+ {/* Notes */}
@@ -467,10 +491,6 @@ export function PosPage() { Терминал {formatCurrency(termRevenue)}
-
- АТОЛ - {formatCurrency(atolRevenue)} -
Итого {formatCurrency(shiftRevenue)} @@ -541,14 +561,6 @@ export function PosPage() { {termCount} {formatCurrency(termRevenue)} - - - - АТОЛ - - {atolCount} - {formatCurrency(atolRevenue)} - ИТОГО {shiftReceipts.length} @@ -557,6 +569,12 @@ export function PosPage() { + {/* Fiscal register info */} +
+ + Фискальный регистратор АТОЛ: {atolConnected ? подключён : не подключён} +
+ {/* Refunds */}
@@ -769,7 +787,8 @@ export function PosPage() {

Оплата принята

{formatCurrency(lastReceipt.amount)}

- {lastReceipt.method === 'cash' ? 'Наличными' : lastReceipt.method === 'terminal' ? 'Терминал' : 'АТОЛ'} · {format(lastReceipt.createdAt, 'HH:mm')} + {lastReceipt.method === 'cash' ? 'Наличными' : 'Терминал'} · {format(lastReceipt.createdAt, 'HH:mm')} + {printFiscal && atolConnected && · Фискальный чек распечатан}