Set quote status to Converted and show job number link on quote details
- CreateJobFromQuote now sets QuoteStatusId to CONVERTED after creating the job - Added ConvertedToJobNumber to QuoteDto, populated in Details action - 'View Job' button on Quote Details now shows the job number (e.g. 'View Job JOB-2505-0001') Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -315,6 +315,7 @@ public class QuotesController : Controller
|
||||
else
|
||||
{
|
||||
quoteDto.ConvertedToJobId = quote.ConvertedToJobId;
|
||||
quoteDto.ConvertedToJobNumber = linkedJob.JobNumber;
|
||||
}
|
||||
}
|
||||
else
|
||||
@@ -3164,9 +3165,14 @@ public class QuotesController : Controller
|
||||
uniquePrepServiceIds.Count, job.JobNumber);
|
||||
}
|
||||
|
||||
// Update quote to track the conversion
|
||||
// Update quote to track the conversion and mark it as converted
|
||||
quote.ConvertedToJobId = job.Id;
|
||||
quote.ConvertedDate = DateTime.UtcNow;
|
||||
var companyIdForStatus = quote.CompanyId;
|
||||
var quoteStatuses = await _lookupCache.GetQuoteStatusLookupsAsync(companyIdForStatus);
|
||||
var convertedQuoteStatus = quoteStatuses.FirstOrDefault(s => s.StatusCode == "CONVERTED");
|
||||
if (convertedQuoteStatus != null)
|
||||
quote.QuoteStatusId = convertedQuoteStatus.Id;
|
||||
await _unitOfWork.SaveChangesAsync();
|
||||
|
||||
// The interceptor just bumped quote.UpdatedAt as part of the ConvertedToJobId write.
|
||||
|
||||
Reference in New Issue
Block a user