Merge branch 'v5-issues' into 'master'

V5 issues

See merge request mohit.panjvani/crater-web!1301
This commit is contained in:
Mohit Panjwani
2021-12-01 12:08:37 +00:00
10 changed files with 44 additions and 11 deletions

View File

@ -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);
}
}

View File

@ -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

View File

@ -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",

View File

@ -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'),

View File

@ -184,7 +184,7 @@
<!-- Estimate date -->
<template #cell-estimate_date="{ row }">
{{ row.data.formatted_estimate_date }}
{{ row.data.formatted_estimate_date }}
</template>
<template #cell-estimate_number="{ row }">
@ -209,7 +209,10 @@
</template>
<template #cell-total="{ row }">
<BaseFormatMoney :amount="row.data.total" />
<BaseFormatMoney
:amount="row.data.total"
:currency="row.data.customer.currency"
/>
</template>
<!-- Actions -->

View File

@ -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
}

View File

@ -181,7 +181,7 @@
<template #cell-amount="{ row }">
<BaseFormatMoney
:amount="row.data.amount"
:currency="companyStore.selectedCompanyCurrency"
:currency="row.data.currency"
/>
</template>

View File

@ -194,7 +194,7 @@
<!-- Invoice date -->
<template #cell-invoice_date="{ row }">
{{ row.data.formatted_invoice_date }}
{{ row.data.formatted_invoice_date }}
</template>
<!-- Invoice Total -->

View File

@ -185,7 +185,7 @@
<template #cell-amount="{ row }">
<BaseFormatMoney
:amount="row.data.amount"
:currency="companyStore.selectedCompanyCurrency"
:currency="row.data.customer.currency"
/>
</template>

View File

@ -124,7 +124,11 @@
"
>
<!-- Tabs -->
<BaseTabGroup class="-mb-5" @change="setStatusFilter">
<BaseTabGroup
class="-mb-5"
:default-index="currentStatusIndex"
@change="setStatusFilter"
>
<BaseTab :title="$t('recurring_invoices.active')" filter="ACTIVE" />
<BaseTab :title="$t('recurring_invoices.on_hold')" filter="ON_HOLD" />
<BaseTab :title="$t('recurring_invoices.all')" filter="ALL" />
@ -189,7 +193,7 @@
<!-- Starts at -->
<template #cell-starts_at="{ row }">
{{ row.data.formatted_starts_at }}
{{ row.data.formatted_starts_at }}
</template>
<!-- Customer -->
@ -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,