mirror of
https://github.com/crater-invoice/crater.git
synced 2025-10-27 11:41:09 -04:00
Fix an issue with due date + expiry date not setting correctly & mark as sent button issue
This commit is contained in:
@ -496,9 +496,11 @@ export const useEstimateStore = (useWindow = false) => {
|
|||||||
this.newEstimate.discount_per_item =
|
this.newEstimate.discount_per_item =
|
||||||
companyStore.selectedCompanySettings.discount_per_item
|
companyStore.selectedCompanySettings.discount_per_item
|
||||||
this.newEstimate.estimate_date = moment().format('YYYY-MM-DD')
|
this.newEstimate.estimate_date = moment().format('YYYY-MM-DD')
|
||||||
this.newEstimate.expiry_date = moment()
|
if (companyStore.selectedCompanySettings.estimate_set_expiry_date_automatically === 'YES') {
|
||||||
.add(7, 'days')
|
this.newEstimate.expiry_date = moment()
|
||||||
.format('YYYY-MM-DD')
|
.add(companyStore.selectedCompanySettings.estimate_expiry_date_days, 'days')
|
||||||
|
.format('YYYY-MM-DD')
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
editActions = [this.fetchEstimate(route.params.id)]
|
editActions = [this.fetchEstimate(route.params.id)]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -449,9 +449,11 @@ export const useInvoiceStore = (useWindow = false) => {
|
|||||||
this.newInvoice.discount_per_item =
|
this.newInvoice.discount_per_item =
|
||||||
companyStore.selectedCompanySettings.discount_per_item
|
companyStore.selectedCompanySettings.discount_per_item
|
||||||
this.newInvoice.invoice_date = moment().format('YYYY-MM-DD')
|
this.newInvoice.invoice_date = moment().format('YYYY-MM-DD')
|
||||||
this.newInvoice.due_date = moment()
|
if (companyStore.selectedCompanySettings.invoice_set_due_date_automatically ==='YES') {
|
||||||
.add(7, 'days')
|
this.newInvoice.due_date = moment()
|
||||||
.format('YYYY-MM-DD')
|
.add(companyStore.selectedCompanySettings.invoice_due_date_days, 'days')
|
||||||
|
.format('YYYY-MM-DD')
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
editActions = [this.fetchInvoice(route.params.id)]
|
editActions = [this.fetchInvoice(route.params.id)]
|
||||||
}
|
}
|
||||||
|
|||||||
@ -195,7 +195,7 @@
|
|||||||
truncate
|
truncate
|
||||||
"
|
"
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<div
|
<div
|
||||||
class="
|
class="
|
||||||
mt-1
|
mt-1
|
||||||
@ -461,6 +461,7 @@ async function onMarkAsSent() {
|
|||||||
estimateData.value.status = 'SENT'
|
estimateData.value.status = 'SENT'
|
||||||
isMarkAsSent.value = true
|
isMarkAsSent.value = true
|
||||||
}
|
}
|
||||||
|
isMarkAsSent.value = false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -185,9 +185,6 @@ const rules = {
|
|||||||
estimate_date: {
|
estimate_date: {
|
||||||
required: helpers.withMessage(t('validation.required'), required),
|
required: helpers.withMessage(t('validation.required'), required),
|
||||||
},
|
},
|
||||||
expiry_date: {
|
|
||||||
required: helpers.withMessage(t('validation.required'), required),
|
|
||||||
},
|
|
||||||
estimate_number: {
|
estimate_number: {
|
||||||
required: helpers.withMessage(t('validation.required'), required),
|
required: helpers.withMessage(t('validation.required'), required),
|
||||||
},
|
},
|
||||||
|
|||||||
@ -26,8 +26,6 @@
|
|||||||
<BaseInputGroup
|
<BaseInputGroup
|
||||||
:label="$t('estimates.expiry_date')"
|
:label="$t('estimates.expiry_date')"
|
||||||
:content-loading="isLoading"
|
:content-loading="isLoading"
|
||||||
required
|
|
||||||
:error="v.expiry_date.$error && v.expiry_date.$errors[0].$message"
|
|
||||||
>
|
>
|
||||||
<BaseDatePicker
|
<BaseDatePicker
|
||||||
v-model="estimateStore.newEstimate.expiry_date"
|
v-model="estimateStore.newEstimate.expiry_date"
|
||||||
@ -82,6 +80,8 @@
|
|||||||
<script setup>
|
<script setup>
|
||||||
import { useEstimateStore } from '@/scripts/stores/estimate'
|
import { useEstimateStore } from '@/scripts/stores/estimate'
|
||||||
import ExchangeRateConverter from '@/scripts/components/estimate-invoice-common/ExchangeRateConverter.vue'
|
import ExchangeRateConverter from '@/scripts/components/estimate-invoice-common/ExchangeRateConverter.vue'
|
||||||
|
import { useCompanyStore } from '@/scripts/stores/company'
|
||||||
|
import { reactive, inject } from 'vue'
|
||||||
|
|
||||||
const props = defineProps({
|
const props = defineProps({
|
||||||
v: {
|
v: {
|
||||||
|
|||||||
@ -101,6 +101,7 @@ async function onMarkAsSent() {
|
|||||||
invoiceData.value.status = 'SENT'
|
invoiceData.value.status = 'SENT'
|
||||||
isMarkAsSent.value = true
|
isMarkAsSent.value = true
|
||||||
}
|
}
|
||||||
|
isMarkAsSent.value = false
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -186,9 +186,6 @@ const rules = {
|
|||||||
invoice_date: {
|
invoice_date: {
|
||||||
required: helpers.withMessage(t('validation.required'), required),
|
required: helpers.withMessage(t('validation.required'), required),
|
||||||
},
|
},
|
||||||
due_date: {
|
|
||||||
required: helpers.withMessage(t('validation.required'), required),
|
|
||||||
},
|
|
||||||
reference_number: {
|
reference_number: {
|
||||||
maxLength: helpers.withMessage(
|
maxLength: helpers.withMessage(
|
||||||
t('validation.price_maxlength'),
|
t('validation.price_maxlength'),
|
||||||
|
|||||||
@ -26,8 +26,6 @@
|
|||||||
<BaseInputGroup
|
<BaseInputGroup
|
||||||
:label="$t('invoices.due_date')"
|
:label="$t('invoices.due_date')"
|
||||||
:content-loading="isLoading"
|
:content-loading="isLoading"
|
||||||
required
|
|
||||||
:error="v.due_date.$error && v.due_date.$errors[0].$message"
|
|
||||||
>
|
>
|
||||||
<BaseDatePicker
|
<BaseDatePicker
|
||||||
v-model="invoiceStore.newInvoice.due_date"
|
v-model="invoiceStore.newInvoice.due_date"
|
||||||
|
|||||||
Reference in New Issue
Block a user