This commit is contained in:
parent
07c1181d6e
commit
041e9f5461
9 changed files with 371 additions and 249 deletions
|
|
@ -93,7 +93,7 @@
|
|||
/>
|
||||
</div>
|
||||
<div v-if="estimate">
|
||||
<Button label="Send Estimate" @click="showConfirmationModal = true"/>
|
||||
<Button label="Send Estimate" @click="showConfirmationModal = true" :disabled="estimate.docstatus !== 0"/>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
|
@ -196,7 +196,7 @@
|
|||
@click="showConfirmationModal = false"
|
||||
severity="secondary"
|
||||
/>
|
||||
<Button label="Send Estimate" @click="confirmAndSendEstimate" />
|
||||
<Button label="Send Estimate" @click="confirmAndSendEstimate" :disabled="estimate.customSent !== 0" />
|
||||
</div>
|
||||
</div>
|
||||
</Modal>
|
||||
|
|
@ -371,9 +371,13 @@ const saveDraft = async () => {
|
|||
};
|
||||
|
||||
const confirmAndSendEstimate = async () => {
|
||||
loadingStore.setLoading(true, "Sending estimate...");
|
||||
const updatedEstimate = await Api.sendEstimateEmail(estimate.value.name);
|
||||
loadingStore.setLoading(false);
|
||||
notificationStore.addSuccess("Estimate sent successfully", "success");
|
||||
showConfirmationModal.value = false;
|
||||
// TODO: Implement send estimate functionality
|
||||
notificationStore.addWarning("Send estimate functionality coming soon");
|
||||
notificationStore.addWarning("Estimate has been locked and can no longer be edited.", "warning");
|
||||
estimate.value = updatedEstimate;
|
||||
};
|
||||
|
||||
const tableActions = [
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue