diff --git a/apps/infoalloggi/src/components/acquisto_receipt.tsx b/apps/infoalloggi/src/components/acquisto_receipt.tsx index 34027d0..c305fd2 100644 --- a/apps/infoalloggi/src/components/acquisto_receipt.tsx +++ b/apps/infoalloggi/src/components/acquisto_receipt.tsx @@ -77,7 +77,7 @@ export type PurchaseData = { clienteNome: string; clienteIndirizzo: string; - paymentMethod: string; + paymentMethod: PaymentType; packName: string; sconto: number; @@ -186,7 +186,7 @@ function Receipt({ data }: ReceiptProps) {

Metodo di pagamento

-

{PaymentMethodToString(data.paymentMethod as PaymentType)}

+

{PaymentMethodToString(data.paymentMethod)}

Status pagamento

diff --git a/apps/infoalloggi/src/components/area-riservata/ordini.tsx b/apps/infoalloggi/src/components/area-riservata/ordini.tsx index 29f25e2..b90a69c 100644 --- a/apps/infoalloggi/src/components/area-riservata/ordini.tsx +++ b/apps/infoalloggi/src/components/area-riservata/ordini.tsx @@ -15,7 +15,6 @@ import { Button } from "~/components/ui/button"; import { FormEditOrder } from "~/forms/FormEditOrdine"; import { formatCurrency } from "~/lib/utils"; import type { OrdiniOrdineId } from "~/schemas/public/Ordini"; -import PaymentStatusEnum from "~/schemas/public/PaymentStatusEnum"; import type { Prezziario } from "~/schemas/public/Prezziario"; import { api } from "~/utils/api"; @@ -68,14 +67,16 @@ const AdminOrdiniModal = ({

Id Ordine: {data.ordine_id}

{data.isActive && ( - - - +
+ + + +
)} setSelected(null)} @@ -139,19 +140,18 @@ export const UserOrdiniModal = ({ Importo: {formatCurrency(data.amount_cent / 100)}{" "} {data.sconto > 0 && ({data.sconto}%)}

- {data.isActive && - data.paymentstatus === PaymentStatusEnum.success && ( -
- - - -
- )} + {data.isActive && ( +
+ + + +
+ )}
diff --git a/apps/infoalloggi/src/components/ui/select.tsx b/apps/infoalloggi/src/components/ui/select.tsx index 1c50891..79f1b7d 100644 --- a/apps/infoalloggi/src/components/ui/select.tsx +++ b/apps/infoalloggi/src/components/ui/select.tsx @@ -35,7 +35,7 @@ function SelectTrigger({ return ( { <>
- -
- { - const pack = prezziario.find( - (p) => p.idprezziario === field.value, - ); - return ( - + +
+
+ { + const pack = prezziario.find( + (p) => p.idprezziario === field.value, + ); + return ( + +
+ Servizio + +
+ + { + const selected = zPrezziarioId.safeParse( + value.value, + ); + if (selected.success) { + field.onChange(selected.data); + const selectedPrezzo = prezziario.find( + (p) => p.idprezziario === selected.data, + ); + if (selectedPrezzo) { + form.setValue( + "amount_cent", + selectedPrezzo.prezzo_cent, + ); + } + } else { + console.error( + "Invalid packid selected", + value.value, + ); + } + }} + options={prezziario.map((p) => ({ + label: `${p.idprezziario} - ${p.nome_it} (${formatCurrency(p.prezzo_cent / 100)})`, + value: p.idprezziario, + }))} + placeholder="Seleziona..." + /> + +
+ ); + }} + /> + + ( +
- Servizio + Tipologia
- { - const selected = zPrezziarioId.safeParse( - value.value, - ); - if (selected.success) { - field.onChange(selected.data); - const selectedPrezzo = prezziario.find( - (p) => p.idprezziario === selected.data, - ); - if (selectedPrezzo) { - form.setValue( - "amount_cent", - selectedPrezzo.prezzo_cent, - ); - } - } else { - console.error( - "Invalid packid selected", - value.value, - ); - } - }} - options={prezziario.map((p) => ({ - label: `${p.idprezziario} - ${p.nome_it} (${formatCurrency(p.prezzo_cent / 100)})`, - value: p.idprezziario, - }))} - placeholder="Seleziona..." - /> +
- ); - }} - /> - - ( - -
- Tipologia - -
- - - -
- )} - /> + )} + /> +
{ render={({ field }) => (
- Pagato + Attivo { )} /> +
+ ( + +
+ Stato Pagameto + +
+ + + +
+ )} + /> + ( + +
+ + Metodo di Pagamento + + +
+ + + +
+ )} + /> +