Fixed error with inclusion in pdf of quotation
This commit is contained in:
@@ -23,7 +23,6 @@ public class CreateQuotationEndpoint(
|
|||||||
public override async Task HandleAsync(CreateQuotationDto req, CancellationToken ct)
|
public override async Task HandleAsync(CreateQuotationDto req, CancellationToken ct)
|
||||||
{
|
{
|
||||||
Quotation quotation = mapper.Map<Quotation>(req);
|
Quotation quotation = mapper.Map<Quotation>(req);
|
||||||
quotation.CustomerId = 1; // TODO: A changer
|
|
||||||
await quotationsRepository.AddAsync(quotation, ct);
|
await quotationsRepository.AddAsync(quotation, ct);
|
||||||
|
|
||||||
if (req.Products != null)
|
if (req.Products != null)
|
||||||
|
|||||||
@@ -35,7 +35,8 @@ public class QuotationPdfService : IQuotationPdfService
|
|||||||
col.Item().Text("");
|
col.Item().Text("");
|
||||||
col.Item().Text("");
|
col.Item().Text("");
|
||||||
col.Item().Text("Client").SemiBold().FontSize(12);
|
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
|
// Logo + société à droite
|
||||||
|
|||||||
@@ -11,6 +11,8 @@ public class GetQuotationByIdWithProductsSpec : SingleResultSpecification<Quotat
|
|||||||
.Where(x => x.Id == quotationId)
|
.Where(x => x.Id == quotationId)
|
||||||
.Include(x => x.QuotationProducts!)
|
.Include(x => x.QuotationProducts!)
|
||||||
.ThenInclude(x => x.Product)
|
.ThenInclude(x => x.Product)
|
||||||
.ThenInclude(x => x!.Prices);
|
.ThenInclude(x => x!.Prices)
|
||||||
|
.Include(x => x.Customer)
|
||||||
|
.ThenInclude(x => x!.CustomerType);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user