Fix invoice re-creation after void; add payment terms selector and shop supplies line
- Voided invoices no longer block creating a new invoice for the same job: voided invoice's JobId FK is cleared so the unique index slot is freed for the replacement - Invoice Details view shows voided invoices as history rather than hiding them - Payment terms: standardized SelectList (Due on Receipt, Net 15/30/45/60/90, 2% 10 Net 30, COD) with custom-term preservation; invoice-due-date.js auto-updates Due Date on term change - Shop supplies on direct (no-quote) jobs: InvoicesController derives the shop supplies line from the company rate when the job has no source quote to read the pre-agreed amount from - Job entity: ShopSuppliesAmount + ShopSuppliesPercent fields preserved through job lifecycle - Migration: AddShopSuppliesAmountToJob Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -24,7 +24,9 @@ public class InvoiceProfile : Profile
|
||||
? s.Customer.CompanyName
|
||||
: $"{s.Customer.ContactFirstName} {s.Customer.ContactLastName}".Trim())
|
||||
: string.Empty))
|
||||
.ForMember(d => d.CustomerEmail, o => o.MapFrom(s => s.Customer != null ? s.Customer.Email : null))
|
||||
.ForMember(d => d.CustomerEmail, o => o.MapFrom(s => s.Customer != null
|
||||
? (s.Customer.BillingEmail ?? s.Customer.Email)
|
||||
: null))
|
||||
.ForMember(d => d.CustomerPhone, o => o.MapFrom(s => s.Customer != null ? s.Customer.Phone : null))
|
||||
.ForMember(d => d.CustomerNotifyByEmail, o => o.MapFrom(s => s.Customer == null || s.Customer.NotifyByEmail))
|
||||
.ForMember(d => d.PreparedByName, o => o.MapFrom(s => s.PreparedBy != null
|
||||
|
||||
Reference in New Issue
Block a user