fix: correct receipt note wording and enhance address parsing in servizio controller
This commit is contained in:
parent
4e447cade4
commit
eedaab6e9b
2 changed files with 9 additions and 2 deletions
|
|
@ -96,7 +96,7 @@ function Receipt({ data }: ReceiptProps) {
|
||||||
"Via Beata Giovanna 1\nBassano del Grappa (VI) 36061\nItalia";
|
"Via Beata Giovanna 1\nBassano del Grappa (VI) 36061\nItalia";
|
||||||
|
|
||||||
const note =
|
const note =
|
||||||
"La presente è non costituisce ricevuta o fattura fiscale ai sensi dell'Art.21, DPR 633/72.\nSeguirà fattura elettronica direttamente al tuo indirizzo di posta.";
|
"La presente non costituisce ricevuta o fattura fiscale ai sensi dell'Art.21, DPR 633/72.\nSeguirà fattura elettronica direttamente al tuo indirizzo di posta.";
|
||||||
const footer =
|
const footer =
|
||||||
"Arcenia Srl. | Tel. +39 0424529869 | Email: arca@infoalloggi.it";
|
"Arcenia Srl. | Tel. +39 0424529869 | Email: arca@infoalloggi.it";
|
||||||
return (
|
return (
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import { z } from "zod/v4";
|
||||||
import type { PurchaseData } from "~/components/acquisto_receipt";
|
import type { PurchaseData } from "~/components/acquisto_receipt";
|
||||||
import { env } from "~/env";
|
import { env } from "~/env";
|
||||||
import type { PaymentType } from "~/i18n/stripe";
|
import type { PaymentType } from "~/i18n/stripe";
|
||||||
|
import { parseDBComune, parseDBNazione } from "~/lib/catasto";
|
||||||
import type { Annunci, AnnunciId } from "~/schemas/public/Annunci";
|
import type { Annunci, AnnunciId } from "~/schemas/public/Annunci";
|
||||||
import OrderTypeEnum from "~/schemas/public/OrderTypeEnum";
|
import OrderTypeEnum from "~/schemas/public/OrderTypeEnum";
|
||||||
import type { Ordini, OrdiniOrdineId } from "~/schemas/public/Ordini";
|
import type { Ordini, OrdiniOrdineId } from "~/schemas/public/Ordini";
|
||||||
|
|
@ -42,6 +43,7 @@ import { createOrdine } from "../services/ordini.service";
|
||||||
import { genPdfCondizioniBase64 } from "../services/puppeteer.service";
|
import { genPdfCondizioniBase64 } from "../services/puppeteer.service";
|
||||||
import { getServizioById } from "../services/servizio.service";
|
import { getServizioById } from "../services/servizio.service";
|
||||||
import type { AnnuncioRicerca } from "./annunci.controller";
|
import type { AnnuncioRicerca } from "./annunci.controller";
|
||||||
|
import { getComuni, getNazioni } from "./catasto.controller";
|
||||||
import { SaldoSolver } from "./pagamenti.controller";
|
import { SaldoSolver } from "./pagamenti.controller";
|
||||||
|
|
||||||
export const getServiziByUserId = async (userId: UsersId) => {
|
export const getServiziByUserId = async (userId: UsersId) => {
|
||||||
|
|
@ -1371,9 +1373,14 @@ export const getOrdineRicevutaData = async ({
|
||||||
.executeTakeFirstOrThrow(
|
.executeTakeFirstOrThrow(
|
||||||
() => new Error(`Anagrafica not found - userid: ${data.userid}`),
|
() => new Error(`Anagrafica not found - userid: ${data.userid}`),
|
||||||
);
|
);
|
||||||
|
const comuni = await getComuni();
|
||||||
|
const nazioni = await getNazioni();
|
||||||
|
|
||||||
|
const parsedComune = parseDBComune(anagrafica.comune_residenza, comuni);
|
||||||
|
const parsedNazione = parseDBNazione(anagrafica.nazione_residenza, nazioni);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
clienteIndirizzo: `${anagrafica.via_residenza} ${anagrafica.civico_residenza}\n${anagrafica.comune_residenza} (${anagrafica.provincia_residenza}) ${anagrafica.cap_residenza}\n${anagrafica.nazione_residenza}`,
|
clienteIndirizzo: `${anagrafica.via_residenza} ${anagrafica.civico_residenza}\n${parsedComune?.nome} (${anagrafica.provincia_residenza}) ${anagrafica.cap_residenza}\n${parsedNazione?.nome}`,
|
||||||
clienteNome: anagrafica.username,
|
clienteNome: anagrafica.username,
|
||||||
codiceFiscale: anagrafica.codice_fiscale,
|
codiceFiscale: anagrafica.codice_fiscale,
|
||||||
date: data.created_at,
|
date: data.created_at,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue