fix(pos-selfpay): add Confirmar button after payment + print-only receipt
This commit is contained in:
@@ -1659,6 +1659,7 @@ export default function RegisterPage() {
|
|||||||
)}
|
)}
|
||||||
{/* POS-SELFPAY-FLOW: in selfpay mode, hide payment methods until email is captured */}
|
{/* POS-SELFPAY-FLOW: in selfpay mode, hide payment methods until email is captured */}
|
||||||
{(!isSelfpayMode || selfpayPaymentReady) && (
|
{(!isSelfpayMode || selfpayPaymentReady) && (
|
||||||
|
<>
|
||||||
<div className="mt-3 grid grid-cols-2 gap-2">
|
<div className="mt-3 grid grid-cols-2 gap-2">
|
||||||
{config.paymentMethods.map((method) => (
|
{config.paymentMethods.map((method) => (
|
||||||
<button
|
<button
|
||||||
@@ -1672,6 +1673,18 @@ export default function RegisterPage() {
|
|||||||
</button>
|
</button>
|
||||||
))}
|
))}
|
||||||
</div>
|
</div>
|
||||||
|
{/* POS-SELFPAY-FLOW: confirm button after payment added in selfpay */}
|
||||||
|
{isSelfpayMode && selfpayPaymentReady && !paymentMethod && (
|
||||||
|
<button
|
||||||
|
type="button"
|
||||||
|
onClick={() => void confirmSale()}
|
||||||
|
disabled={processing || cart.length === 0 || paidCents <= 0 || paidCents > totals.total}
|
||||||
|
className="mt-3 w-full min-h-16 rounded-xl bg-[#1B4332] text-lg font-bold text-white disabled:opacity-40"
|
||||||
|
>
|
||||||
|
{processing ? 'Confirmando…' : '✅ Confirmar e imprimir'}
|
||||||
|
</button>
|
||||||
|
)}
|
||||||
|
</>
|
||||||
)}
|
)}
|
||||||
<div className="mt-3 grid grid-cols-2 gap-2">
|
<div className="mt-3 grid grid-cols-2 gap-2">
|
||||||
{!isSelfpayMode && (
|
{!isSelfpayMode && (
|
||||||
@@ -2119,8 +2132,13 @@ export default function RegisterPage() {
|
|||||||
{receipt && (
|
{receipt && (
|
||||||
<ReceiptModal
|
<ReceiptModal
|
||||||
receipt={receipt}
|
receipt={receipt}
|
||||||
initialEmail={customer?.email ?? receipt.customerEmail ?? ''}
|
initialEmail={
|
||||||
|
isSelfpayMode
|
||||||
|
? selfpayEmail || undefined
|
||||||
|
: customer?.email ?? receipt.customerEmail ?? ''
|
||||||
|
}
|
||||||
onDelivered={resetCashier}
|
onDelivered={resetCashier}
|
||||||
|
showActions={!isSelfpayMode}
|
||||||
onReturn={
|
onReturn={
|
||||||
config?.session && config?.terminal
|
config?.session && config?.terminal
|
||||||
? (orderId, latest) => {
|
? (orderId, latest) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user