From 6f2c60e6c01eea9d9a338e939c5f94b24293b8d5 Mon Sep 17 00:00:00 2001 From: sanchezvem Date: Wed, 27 May 2026 13:12:57 +0100 Subject: [PATCH] Fixed error with inclusion in pdf of quotation --- PyroFetes/Endpoints/Quotations/CreateQuotationEndpoint.cs | 1 - PyroFetes/Services/Pdf/QuotationPdfService.cs | 3 ++- .../Quotations/GetQuotationByIdWithProductsSpec.cs | 4 +++- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/PyroFetes/Endpoints/Quotations/CreateQuotationEndpoint.cs b/PyroFetes/Endpoints/Quotations/CreateQuotationEndpoint.cs index f8b2f9a..4dfcda5 100644 --- a/PyroFetes/Endpoints/Quotations/CreateQuotationEndpoint.cs +++ b/PyroFetes/Endpoints/Quotations/CreateQuotationEndpoint.cs @@ -23,7 +23,6 @@ public class CreateQuotationEndpoint( public override async Task HandleAsync(CreateQuotationDto req, CancellationToken ct) { Quotation quotation = mapper.Map(req); - quotation.CustomerId = 1; // TODO: A changer await quotationsRepository.AddAsync(quotation, ct); if (req.Products != null) diff --git a/PyroFetes/Services/Pdf/QuotationPdfService.cs b/PyroFetes/Services/Pdf/QuotationPdfService.cs index 87204e7..9456932 100644 --- a/PyroFetes/Services/Pdf/QuotationPdfService.cs +++ b/PyroFetes/Services/Pdf/QuotationPdfService.cs @@ -35,7 +35,8 @@ public class QuotationPdfService : IQuotationPdfService col.Item().Text(""); col.Item().Text(""); col.Item().Text("Client").SemiBold().FontSize(12); - col.Item().Text($"{quotation.Customer}"); + col.Item().Text($"{quotation.Customer?.Note}"); + col.Item().Text($"{quotation.Customer?.CustomerType?.Label}"); }); // Logo + société à droite diff --git a/PyroFetes/Specifications/Quotations/GetQuotationByIdWithProductsSpec.cs b/PyroFetes/Specifications/Quotations/GetQuotationByIdWithProductsSpec.cs index b7f0e88..b689f14 100644 --- a/PyroFetes/Specifications/Quotations/GetQuotationByIdWithProductsSpec.cs +++ b/PyroFetes/Specifications/Quotations/GetQuotationByIdWithProductsSpec.cs @@ -11,6 +11,8 @@ public class GetQuotationByIdWithProductsSpec : SingleResultSpecification x.Id == quotationId) .Include(x => x.QuotationProducts!) .ThenInclude(x => x.Product) - .ThenInclude(x => x!.Prices); + .ThenInclude(x => x!.Prices) + .Include(x => x.Customer) + .ThenInclude(x => x!.CustomerType); } } \ No newline at end of file