refactoring: payment receive form.

This commit is contained in:
a.bouhuolia
2021-02-17 19:45:18 +02:00
parent 95cccfd13b
commit e36817cb88
46 changed files with 775 additions and 325 deletions

View File

@@ -2,7 +2,6 @@ import * as Yup from 'yup';
import { defaultTo } from 'lodash';
import { formatMessage } from 'services/intl';
import { DATATYPES_LENGTH } from 'common/dataTypes';
import { isBlank } from 'utils';
const Schema = Yup.object().shape({
active: Yup.boolean(),
@@ -20,6 +19,7 @@ const Schema = Yup.object().shape({
code: Yup.string().trim().min(0).max(DATATYPES_LENGTH.STRING),
cost_price: Yup.number()
.min(0)
.max(DATATYPES_LENGTH.DECIMAL_13_3)
.when(['purchasable'], {
is: true,
then: Yup.number()
@@ -29,6 +29,7 @@ const Schema = Yup.object().shape({
}),
sell_price: Yup.number()
.min(0)
.max(DATATYPES_LENGTH.DECIMAL_13_3)
.when(['sellable'], {
is: true,
then: Yup.number()