Fixes for Estimate/Sales Order creation.

This commit is contained in:
rocketdebris 2026-01-09 13:29:51 -05:00
parent 016aa08b95
commit f7ce3a39d0
5 changed files with 34 additions and 33 deletions

View file

@ -592,6 +592,7 @@ const saveDraft = async () => {
isSubmitting.value = true;
try {
const data = {
address: formData.address,
addressName: formData.addressName,
contactName: selectedContact.value.name,
customer: selectedAddress.value?.customer?.name,
@ -768,7 +769,7 @@ watch(
} else if (newAddressQuery) {
await selectAddress(newAddressQuery);
}
formData.contact = estimate.value.contactPerson;
selectedContact.value = contacts.value.find((c) => c.name === estimate.value.contactPerson) || null;
@ -811,7 +812,7 @@ onMounted(async () => {
console.error("Error loading quotation items:", error);
}
fetchProjectTemplates();
if (isNew.value) {
fetchTemplates();
}
@ -839,7 +840,7 @@ onMounted(async () => {
} else if (addressQuery.value) {
await selectAddress(addressQuery.value);
}
// Set the contact from the estimate
formData.contact = estimate.value.contactPerson;
selectedContact.value = contacts.value.find((c) => c.name === estimate.value.contactPerson) || null;