diff --git a/src/PowderCoating.Application/Services/PdfService.cs b/src/PowderCoating.Application/Services/PdfService.cs index e42a196..eef85a9 100644 --- a/src/PowderCoating.Application/Services/PdfService.cs +++ b/src/PowderCoating.Application/Services/PdfService.cs @@ -497,14 +497,20 @@ public class PdfService : IPdfService if (quote.CustomerId.HasValue) { // Existing customer - if (!string.IsNullOrWhiteSpace(quote.CustomerCompanyName)) - column.Item().Text(quote.CustomerCompanyName).FontSize(10).Bold(); - var contactName = new List(); if (!string.IsNullOrWhiteSpace(quote.CustomerContactFirstName)) contactName.Add(quote.CustomerContactFirstName); if (!string.IsNullOrWhiteSpace(quote.CustomerContactLastName)) contactName.Add(quote.CustomerContactLastName); + var contactFullName = string.Join(" ", contactName); + + // Only show company name when it's distinct from the contact's full name. + // Non-commercial customers store the person's name in CompanyName, which would + // otherwise render twice (e.g. "Bryndon Lee" bold + "Bryndon Lee" regular). + if (!string.IsNullOrWhiteSpace(quote.CustomerCompanyName) && + !string.Equals(quote.CustomerCompanyName.Trim(), contactFullName.Trim(), StringComparison.OrdinalIgnoreCase)) + column.Item().Text(quote.CustomerCompanyName).FontSize(10).Bold(); + if (contactName.Any()) - column.Item().Text(string.Join(" ", contactName)).FontSize(9); + column.Item().Text(contactFullName).FontSize(9); if (!string.IsNullOrWhiteSpace(quote.CustomerEmail)) column.Item().Text(quote.CustomerEmail).FontSize(9);