mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 04:40:32 +00:00
BIG-238: Validate bill due date.
This commit is contained in:
@@ -1,16 +1,19 @@
|
||||
import * as Yup from 'yup';
|
||||
import moment from 'moment';
|
||||
import intl from 'react-intl-universal';
|
||||
import { DATATYPES_LENGTH } from 'common/dataTypes';
|
||||
import { isBlank } from 'utils';
|
||||
|
||||
const BillFormSchema = Yup.object().shape({
|
||||
vendor_id: Yup.number()
|
||||
.required()
|
||||
.label(intl.get('vendor_name_')),
|
||||
bill_date: Yup.date()
|
||||
.required()
|
||||
.label(intl.get('bill_date_')),
|
||||
vendor_id: Yup.number().required().label(intl.get('vendor_name_')),
|
||||
bill_date: Yup.date().required().label(intl.get('bill_date_')),
|
||||
due_date: Yup.date()
|
||||
.min(Yup.ref('bill_date'), ({ path, min }) =>
|
||||
intl.get('bill.validation.due_date', {
|
||||
path,
|
||||
min: moment(min).format('YYYY/MM/DD'),
|
||||
}),
|
||||
)
|
||||
.required()
|
||||
.label(intl.get('due_date_')),
|
||||
bill_number: Yup.string()
|
||||
@@ -25,7 +28,7 @@ const BillFormSchema = Yup.object().shape({
|
||||
open: Yup.boolean(),
|
||||
branch_id: Yup.string(),
|
||||
warehouse_id: Yup.string(),
|
||||
exchange_rate:Yup.number(),
|
||||
exchange_rate: Yup.number(),
|
||||
entries: Yup.array().of(
|
||||
Yup.object().shape({
|
||||
quantity: Yup.number()
|
||||
|
||||
Reference in New Issue
Block a user