Add invoice SMS notifications and customer intake kiosk
Invoice SMS:
- Send Invoice modal now prompts Email/SMS/Both based on customer contact data
- New /invoice/{token} customer-facing view page with full line items and pay button
- PublicViewToken (permanent) added to Invoice; separate from expiring PaymentLinkToken
- InvoiceSent SMS default template added; customizable via Notification Templates settings
- {{viewUrl}} placeholder documented in template editor
Customer Intake Kiosk:
- Tablet kiosk flow: Contact → Job → Terms/Signature → Confirmation
- Remote link mode for off-site customers (lighter form, no signature)
- KioskHub (AllowAnonymous SignalR) for staff-to-tablet push without login
- Staff activates tablet via cookie; sends remote link manually
- Submitted sessions create Customer + Job automatically; fires in-app notification
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,198 @@
|
||||
/* ── Kiosk touch-optimised styles ─────────────────────────────────────────── */
|
||||
|
||||
:root {
|
||||
--kiosk-accent: #2563eb;
|
||||
--kiosk-radius: 12px;
|
||||
--kiosk-input-h: 56px;
|
||||
--kiosk-btn-h: 64px;
|
||||
}
|
||||
|
||||
body.kiosk-body {
|
||||
font-size: 1.125rem;
|
||||
background: #f8fafc;
|
||||
min-height: 100dvh;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
/* ── Inputs ── */
|
||||
.kiosk-input,
|
||||
.kiosk-body .form-control,
|
||||
.kiosk-body .form-select {
|
||||
min-height: var(--kiosk-input-h);
|
||||
border-radius: var(--kiosk-radius);
|
||||
font-size: 1.125rem;
|
||||
padding: 0.75rem 1rem;
|
||||
border: 2px solid #cbd5e1;
|
||||
transition: border-color 0.15s;
|
||||
}
|
||||
|
||||
.kiosk-body .form-control:focus,
|
||||
.kiosk-body .form-select:focus {
|
||||
border-color: var(--kiosk-accent);
|
||||
box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
|
||||
}
|
||||
|
||||
.kiosk-body textarea.form-control {
|
||||
min-height: 140px;
|
||||
resize: none;
|
||||
}
|
||||
|
||||
.kiosk-body .form-check-input {
|
||||
width: 1.5rem;
|
||||
height: 1.5rem;
|
||||
margin-top: 0.15rem;
|
||||
}
|
||||
|
||||
.kiosk-body .form-check-label {
|
||||
font-size: 1rem;
|
||||
padding-left: 0.5rem;
|
||||
}
|
||||
|
||||
/* ── Buttons ── */
|
||||
.kiosk-btn,
|
||||
.kiosk-body .btn-primary,
|
||||
.kiosk-body .btn-success {
|
||||
min-height: var(--kiosk-btn-h);
|
||||
border-radius: var(--kiosk-radius);
|
||||
font-size: 1.2rem;
|
||||
font-weight: 600;
|
||||
width: 100%;
|
||||
}
|
||||
|
||||
/* Suppress all hover effects on touch screens */
|
||||
@media (hover: none) {
|
||||
.kiosk-body .btn:hover { filter: none; opacity: 1; }
|
||||
}
|
||||
|
||||
/* ── Step progress dots ── */
|
||||
.kiosk-steps {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
gap: 10px;
|
||||
margin: 1.25rem 0;
|
||||
}
|
||||
|
||||
.kiosk-step-dot {
|
||||
width: 14px;
|
||||
height: 14px;
|
||||
border-radius: 50%;
|
||||
background: #cbd5e1;
|
||||
transition: background 0.2s;
|
||||
}
|
||||
|
||||
.kiosk-step-dot.active {
|
||||
background: var(--kiosk-accent);
|
||||
transform: scale(1.2);
|
||||
}
|
||||
|
||||
.kiosk-step-dot.done {
|
||||
background: #16a34a;
|
||||
}
|
||||
|
||||
/* ── Card ── */
|
||||
.kiosk-card {
|
||||
background: #fff;
|
||||
border: 1px solid #e2e8f0;
|
||||
border-radius: 1rem;
|
||||
box-shadow: 0 2px 8px rgba(0,0,0,0.06);
|
||||
padding: 2rem;
|
||||
width: 100%;
|
||||
max-width: 680px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
|
||||
/* ── Signature canvas ── */
|
||||
#signatureCanvas {
|
||||
border: 2px solid #cbd5e1;
|
||||
border-radius: var(--kiosk-radius);
|
||||
background: #fff;
|
||||
width: 100%;
|
||||
height: 200px;
|
||||
cursor: crosshair;
|
||||
touch-action: none;
|
||||
}
|
||||
|
||||
#signatureCanvas.signed {
|
||||
border-color: #16a34a;
|
||||
}
|
||||
|
||||
/* ── Welcome screen ── */
|
||||
.kiosk-welcome-screen {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 100dvh;
|
||||
text-align: center;
|
||||
padding: 2rem;
|
||||
}
|
||||
|
||||
.kiosk-welcome-logo {
|
||||
max-height: 120px;
|
||||
max-width: 280px;
|
||||
object-fit: contain;
|
||||
margin-bottom: 2rem;
|
||||
}
|
||||
|
||||
.kiosk-welcome-title {
|
||||
font-size: 2.5rem;
|
||||
font-weight: 700;
|
||||
color: #1e293b;
|
||||
margin-bottom: 0.75rem;
|
||||
}
|
||||
|
||||
.kiosk-welcome-subtitle {
|
||||
font-size: 1.25rem;
|
||||
color: #64748b;
|
||||
}
|
||||
|
||||
.kiosk-idle-indicator {
|
||||
margin-top: 3rem;
|
||||
font-size: 0.9rem;
|
||||
color: #94a3b8;
|
||||
}
|
||||
|
||||
/* ── Confirmation screen ── */
|
||||
.kiosk-confirmation {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
min-height: 60vh;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.kiosk-confirmation-icon {
|
||||
font-size: 5rem;
|
||||
color: #16a34a;
|
||||
margin-bottom: 1.5rem;
|
||||
}
|
||||
|
||||
.kiosk-countdown {
|
||||
font-size: 0.9rem;
|
||||
color: #94a3b8;
|
||||
margin-top: 2rem;
|
||||
}
|
||||
|
||||
/* ── Terms scroll box ── */
|
||||
.kiosk-terms-scroll {
|
||||
max-height: 260px;
|
||||
overflow-y: auto;
|
||||
border: 1px solid #e2e8f0;
|
||||
border-radius: var(--kiosk-radius);
|
||||
padding: 1.25rem;
|
||||
background: #f8fafc;
|
||||
font-size: 0.9rem;
|
||||
color: #475569;
|
||||
line-height: 1.6;
|
||||
margin-bottom: 1.5rem;
|
||||
}
|
||||
|
||||
/* ── Labels ── */
|
||||
.kiosk-body .form-label {
|
||||
font-weight: 600;
|
||||
margin-bottom: 0.5rem;
|
||||
color: #1e293b;
|
||||
}
|
||||
@@ -0,0 +1,48 @@
|
||||
"use strict";
|
||||
|
||||
(function () {
|
||||
// ── Signature pad (InPerson sessions only) ─────────────────────────────────
|
||||
const canvas = document.getElementById("signatureCanvas");
|
||||
if (canvas) {
|
||||
const pad = new SignaturePad(canvas, { penColor: "#1e293b" });
|
||||
|
||||
// Scale canvas to device pixel ratio for crisp rendering on high-DPI tablets
|
||||
function resizeCanvas() {
|
||||
const ratio = Math.max(window.devicePixelRatio || 1, 1);
|
||||
canvas.width = canvas.offsetWidth * ratio;
|
||||
canvas.height = canvas.offsetHeight * ratio;
|
||||
canvas.getContext("2d").scale(ratio, ratio);
|
||||
pad.clear();
|
||||
}
|
||||
resizeCanvas();
|
||||
window.addEventListener("resize", resizeCanvas);
|
||||
|
||||
// Show visual feedback when the canvas has been signed
|
||||
pad.addEventListener("endStroke", function () {
|
||||
canvas.classList.add("signed");
|
||||
});
|
||||
|
||||
document.getElementById("clearSignatureBtn")?.addEventListener("click", function () {
|
||||
pad.clear();
|
||||
canvas.classList.remove("signed");
|
||||
});
|
||||
|
||||
// On submit: write base64 PNG to the hidden input
|
||||
const form = document.getElementById("termsForm");
|
||||
if (form) {
|
||||
form.addEventListener("submit", function (e) {
|
||||
const hiddenInput = document.getElementById("SignatureDataBase64");
|
||||
if (hiddenInput) {
|
||||
if (pad.isEmpty()) {
|
||||
e.preventDefault();
|
||||
const msg = document.getElementById("signatureError");
|
||||
if (msg) msg.classList.remove("d-none");
|
||||
canvas.classList.add("is-invalid");
|
||||
return;
|
||||
}
|
||||
hiddenInput.value = pad.toDataURL("image/png");
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
})();
|
||||
@@ -0,0 +1,48 @@
|
||||
"use strict";
|
||||
|
||||
(function () {
|
||||
const el = document.getElementById("kiosk-welcome-root");
|
||||
if (!el) return;
|
||||
|
||||
const companyId = el.dataset.companyId;
|
||||
if (!companyId) return;
|
||||
|
||||
const connection = new signalR.HubConnectionBuilder()
|
||||
.withUrl(`/hubs/kiosk?companyId=${companyId}`)
|
||||
.withAutomaticReconnect([2000, 5000, 10000, 30000])
|
||||
.configureLogging(signalR.LogLevel.Warning)
|
||||
.build();
|
||||
|
||||
connection.on("StartIntake", function (sessionToken) {
|
||||
window.location.href = `/Kiosk/Intake/${sessionToken}/Contact`;
|
||||
});
|
||||
|
||||
async function startConnection() {
|
||||
try {
|
||||
await connection.start();
|
||||
} catch (err) {
|
||||
console.warn("Kiosk SignalR connect failed, retrying in 10s...", err);
|
||||
setTimeout(startConnection, 10000);
|
||||
}
|
||||
}
|
||||
|
||||
startConnection();
|
||||
|
||||
// Show connection status indicator
|
||||
connection.onreconnecting(() => {
|
||||
const dot = document.getElementById("kiosk-conn-dot");
|
||||
if (dot) dot.style.background = "#f59e0b";
|
||||
});
|
||||
|
||||
connection.onreconnected(() => {
|
||||
const dot = document.getElementById("kiosk-conn-dot");
|
||||
if (dot) dot.style.background = "#16a34a";
|
||||
});
|
||||
|
||||
connection.onclose(() => {
|
||||
const dot = document.getElementById("kiosk-conn-dot");
|
||||
if (dot) dot.style.background = "#ef4444";
|
||||
// Keep retrying
|
||||
setTimeout(startConnection, 10000);
|
||||
});
|
||||
})();
|
||||
Reference in New Issue
Block a user