From 5fb9bf494c68b3d404bb883199f9695d2bbd2833 Mon Sep 17 00:00:00 2001 From: tommaso Date: Tue, 7 Jul 2026 16:47:17 +0200 Subject: [PATCH] Dashboard Recessi: promemoria rimborso 14gg (Art. 56) + colonna 'Rimborsa entro' (trasmissione + 14gg) Il promemoria non e' piu' solo nella notifica email: visibile anche dove il merchant gestisce le richieste (funziona pure con notifiche off). Co-Authored-By: Claude Opus 4.8 (1M context) Claude-Session: https://claude.ai/code/session_01Mv83a29B4eFv5ixoj6PoE1 --- app/app/routes/app.withdrawals.tsx | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/app/app/routes/app.withdrawals.tsx b/app/app/routes/app.withdrawals.tsx index 1b3ccfd..2d72303 100644 --- a/app/app/routes/app.withdrawals.tsx +++ b/app/app/routes/app.withdrawals.tsx @@ -7,6 +7,7 @@ import { DataTable, Text, Badge, + Banner, BlockStack, } from "@shopify/polaris"; import { TitleBar } from "@shopify/app-bridge-react"; @@ -15,6 +16,18 @@ import { authenticate } from "../shopify.server"; import db from "../db.server"; import { formatTransmittedAt } from "../lib/recesso.server"; +// Scadenza rimborso (Art. 56): trasmissione + 14 giorni, data Europe/Rome. +function refundBy(transmittedAt: Date): string { + const d = new Date(transmittedAt); + d.setDate(d.getDate() + 14); + return new Intl.DateTimeFormat("it-IT", { + timeZone: "Europe/Rome", + day: "2-digit", + month: "2-digit", + year: "numeric", + }).format(d); +} + export const loader = async ({ request }: LoaderFunctionArgs) => { const { session } = await authenticate.admin(request); const items = await db.withdrawalRequest.findMany({ @@ -29,6 +42,7 @@ export const loader = async ({ request }: LoaderFunctionArgs) => { customerName: w.customerName, email: w.email, transmittedAt: formatTransmittedAt(w.transmittedAt), + refundBy: refundBy(w.transmittedAt), receiptSent: !!w.receiptSentAt, hasReturn: !!w.shopifyReturnId, })), @@ -43,6 +57,7 @@ export default function WithdrawalsPage() { r.customerName, r.email, r.transmittedAt, + r.refundBy, r.receiptSent ? "Inviata" : "-", r.hasReturn ? "Sì" : "-", ]); @@ -68,6 +83,11 @@ export default function WithdrawalsPage() { Registro recessi ({rows.length}) + + Ricorda: disponi il rimborso entro 14 giorni dalla richiesta + (art. 56). Puoi trattenere fino alla riconsegna della merce o + alla prova di spedizione. +