Fix account dropdowns: vendor auto-select + sub-type filtering
Inventory vendor auto-select: match the dropdown off the Manufacturer field (almost always populated and equal to the vendor for the shop's distributors) instead of the AI's price-conditional vendorName, which was only returned when a price was scraped. Centralizes the logic in a shared inventory-vendor-match.js used by catalog lookup, AI lookup, label scan, and manual entry; skips brands sold by multiple distributors (PPG, KP Pigments) so those stay manual. Account dropdowns filtered by sub-type now filter by parent AccountType, so accounts a company classifies under a non-standard sub-type still appear: Inventory account (Asset), AP account (Liability), pay-from/bank and Bank Reconciliation pickers (Asset + Liability). Deposit account is now a user-selectable dropdown on the Job and Quote deposit modals (Asset + Liability accounts) instead of a silent auto-pick of the first Checking/Cash account; falls back to the old behavior when left blank, and validates the chosen account belongs to the company. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -302,6 +302,9 @@ public class QuotesController : Controller
|
||||
|
||||
var quoteDto = _mapper.Map<QuoteDto>(quote);
|
||||
|
||||
// Bank/asset accounts the deposit can land in (deposit modal dropdown)
|
||||
ViewBag.DepositAccounts = await AccountingDropdownHelper.LoadDepositAccountsAsync(_unitOfWork, companyId);
|
||||
|
||||
// Get customer info if exists
|
||||
if (quote.CustomerId.HasValue)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user