diff --git a/app/Http/Controllers/V1/Admin/Auth/ForgotPasswordController.php b/app/Http/Controllers/V1/Admin/Auth/ForgotPasswordController.php index fa38ac7f..39122e7e 100644 --- a/app/Http/Controllers/V1/Admin/Auth/ForgotPasswordController.php +++ b/app/Http/Controllers/V1/Admin/Auth/ForgotPasswordController.php @@ -45,6 +45,8 @@ class ForgotPasswordController extends Controller */ protected function sendResetLinkFailedResponse(Request $request, $response) { - return response('Email could not be sent to this email address.', 403); + return response()->json([ + 'error' => 'Email could not be sent to this email address.' + ], 403); } } diff --git a/resources/scripts/helpers/error-handling.js b/resources/scripts/helpers/error-handling.js index c796e65b..b08c279d 100644 --- a/resources/scripts/helpers/error-handling.js +++ b/resources/scripts/helpers/error-handling.js @@ -140,6 +140,10 @@ export const showError = (error) => { showToaster('errors.not_allowed') break + case 'Email could not be sent to this email address.': + showToaster('errors.email_could_not_be_sent') + break + default: showToaster(error, false) break diff --git a/resources/scripts/locales/en.json b/resources/scripts/locales/en.json index 42aca27c..9708cb08 100644 --- a/resources/scripts/locales/en.json +++ b/resources/scripts/locales/en.json @@ -1383,7 +1383,8 @@ "invalid_credentials": "Invalid Credentials.", "not_allowed": "Not Allowed", "login_invalid_credentials": "These credentials do not match our records.", - "enter_valid_cron_format": "Please enter a valid cron format" + "enter_valid_cron_format": "Please enter a valid cron format", + "email_could_not_be_sent": "Email could not be sent to this email address." }, "pdf_estimate_label": "Estimate", "pdf_estimate_number": "Estimate Number", diff --git a/resources/scripts/stores/invoice.js b/resources/scripts/stores/invoice.js index ccb490be..f1833477 100644 --- a/resources/scripts/stores/invoice.js +++ b/resources/scripts/stores/invoice.js @@ -278,6 +278,14 @@ export const useInvoiceStore = (useWindow = false) => { axios .post(`/api/v1/invoices/${data.id}/status`, data) .then((response) => { + let pos = this.invoices.findIndex( + (invoices) => invoices.id === data.id + ) + + if (this.invoices[pos]) { + this.invoices[pos].status = 'SENT' + } + notificationStore.showNotification({ type: 'success', message: global.t('invoices.mark_as_sent_successfully'), diff --git a/resources/scripts/views/estimates/Index.vue b/resources/scripts/views/estimates/Index.vue index b61d7b90..554ef09e 100644 --- a/resources/scripts/views/estimates/Index.vue +++ b/resources/scripts/views/estimates/Index.vue @@ -184,7 +184,7 @@ diff --git a/resources/scripts/views/expenses/Create.vue b/resources/scripts/views/expenses/Create.vue index c21d8e19..54767633 100644 --- a/resources/scripts/views/expenses/Create.vue +++ b/resources/scripts/views/expenses/Create.vue @@ -422,14 +422,21 @@ async function searchCustomer(search) { } async function loadData() { - expenseStore.currentExpense.currency_id = companyStore.selectedCompanyCurrency.id - expenseStore.currentExpense.selectedCurrency = companyStore.selectedCompanyCurrency + if (!isEdit.value) { + expenseStore.currentExpense.currency_id = + companyStore.selectedCompanyCurrency.id + expenseStore.currentExpense.selectedCurrency = + companyStore.selectedCompanyCurrency + } isFetchingInitialData.value = true await expenseStore.fetchPaymentModes({ limit: 'all' }) if (isEdit.value) { await expenseStore.fetchExpense(route.params.id) + + expenseStore.currentExpense.currency_id = + expenseStore.currentExpense.selectedCurrency.id } else if (route.query.customer) { expenseStore.currentExpense.customer_id = route.query.customer } diff --git a/resources/scripts/views/expenses/Index.vue b/resources/scripts/views/expenses/Index.vue index 4d27a5ac..e28dc741 100644 --- a/resources/scripts/views/expenses/Index.vue +++ b/resources/scripts/views/expenses/Index.vue @@ -181,7 +181,7 @@ diff --git a/resources/scripts/views/invoices/Index.vue b/resources/scripts/views/invoices/Index.vue index b8aae418..425e60bc 100644 --- a/resources/scripts/views/invoices/Index.vue +++ b/resources/scripts/views/invoices/Index.vue @@ -194,7 +194,7 @@ diff --git a/resources/scripts/views/payments/Index.vue b/resources/scripts/views/payments/Index.vue index 906d44a3..363c5400 100644 --- a/resources/scripts/views/payments/Index.vue +++ b/resources/scripts/views/payments/Index.vue @@ -185,7 +185,7 @@ diff --git a/resources/scripts/views/recurring-invoices/Index.vue b/resources/scripts/views/recurring-invoices/Index.vue index 5739f003..09c52713 100644 --- a/resources/scripts/views/recurring-invoices/Index.vue +++ b/resources/scripts/views/recurring-invoices/Index.vue @@ -124,7 +124,11 @@ " > - + @@ -189,7 +193,7 @@ @@ -331,6 +335,10 @@ onUnmounted(() => { } }) +const currentStatusIndex = computed(() => { + return statusList.value.findIndex((status) => status === filters.status) +}) + function canViewActions() { return userStore.hasAbilities([ abilities.DELETE_RECURRING_INVOICE,