mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-21 07:10:33 +00:00
BIG-236: Validate estimate expiration date.
This commit is contained in:
@@ -2,16 +2,19 @@ import * as Yup from 'yup';
|
|||||||
import intl from 'react-intl-universal';
|
import intl from 'react-intl-universal';
|
||||||
import { DATATYPES_LENGTH } from 'common/dataTypes';
|
import { DATATYPES_LENGTH } from 'common/dataTypes';
|
||||||
import { isBlank } from 'utils';
|
import { isBlank } from 'utils';
|
||||||
|
import moment from 'moment';
|
||||||
|
|
||||||
const Schema = Yup.object().shape({
|
const Schema = Yup.object().shape({
|
||||||
customer_id: Yup.number()
|
customer_id: Yup.number().label(intl.get('customer_name_')).required(),
|
||||||
.label(intl.get('customer_name_'))
|
estimate_date: Yup.date().required().label(intl.get('estimate_date_')),
|
||||||
.required(),
|
|
||||||
estimate_date: Yup.date()
|
|
||||||
.required()
|
|
||||||
.label(intl.get('estimate_date_')),
|
|
||||||
expiration_date: Yup.date()
|
expiration_date: Yup.date()
|
||||||
.required()
|
.required()
|
||||||
|
.min(Yup.ref('estimate_date'), ({ path, min }) =>
|
||||||
|
intl.get('estimate.validation.expiration_date', {
|
||||||
|
path,
|
||||||
|
min: moment(min).format('YYYY/MM/DD'),
|
||||||
|
}),
|
||||||
|
)
|
||||||
.label(intl.get('expiration_date_')),
|
.label(intl.get('expiration_date_')),
|
||||||
estimate_number: Yup.string()
|
estimate_number: Yup.string()
|
||||||
.max(DATATYPES_LENGTH.STRING)
|
.max(DATATYPES_LENGTH.STRING)
|
||||||
|
|||||||
@@ -2009,5 +2009,6 @@
|
|||||||
"warehouse_transfer.empty_status.description": "غالبًا ماتحتاج الاعمال ذات مستودعات متعددة لطلبات نقل البضائع من مستودع إلى آخر عندما تكون في حاجة ماسة إلى البائعين.",
|
"warehouse_transfer.empty_status.description": "غالبًا ماتحتاج الاعمال ذات مستودعات متعددة لطلبات نقل البضائع من مستودع إلى آخر عندما تكون في حاجة ماسة إلى البائعين.",
|
||||||
"item.error.you_could_not_delete_item_has_associated": "لا يمكنك حذف العنصر لديه معاملات مرتبطة به ",
|
"item.error.you_could_not_delete_item_has_associated": "لا يمكنك حذف العنصر لديه معاملات مرتبطة به ",
|
||||||
"warehouse_transfer.quantity_cannot_be_zero_or_empty": "لا يمكن أن تكون الكمية صفراً أو فارغة.",
|
"warehouse_transfer.quantity_cannot_be_zero_or_empty": "لا يمكن أن تكون الكمية صفراً أو فارغة.",
|
||||||
"invoice.validation.due_date": "يجب أن يكون حقل {path} في وقت لاحق من {min}"
|
"invoice.validation.due_date": "يجب أن يكون حقل {path} في وقت لاحق من {min}",
|
||||||
|
"estimate.validation.expiration_date": "يجب أن يكون حقل {path} في وقت لاحق من {min}"
|
||||||
}
|
}
|
||||||
@@ -2009,5 +2009,6 @@
|
|||||||
"warehouse_transfer.form.reason.label": "Reason",
|
"warehouse_transfer.form.reason.label": "Reason",
|
||||||
"warehouse_transfer.form.reason.placeholder": "Enter the reason behind the transfer order.",
|
"warehouse_transfer.form.reason.placeholder": "Enter the reason behind the transfer order.",
|
||||||
"warehouse_transfer.quantity_cannot_be_zero_or_empty": "Quantity cannot be zero or empty.",
|
"warehouse_transfer.quantity_cannot_be_zero_or_empty": "Quantity cannot be zero or empty.",
|
||||||
"invoice.validation.due_date": "{path} field must be later than {min}"
|
"invoice.validation.due_date": "{path} field must be later than {min}",
|
||||||
|
"estimate.validation.expiration_date": "{path} field must be later than {min}"
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user