mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-21 07:10:33 +00:00
Fix: min sell and purchase price zero.
This commit is contained in:
@@ -17,14 +17,14 @@ const Schema = Yup.object().shape({
|
|||||||
.max(DATATYPES_LENGTH.STRING)
|
.max(DATATYPES_LENGTH.STRING)
|
||||||
.label(formatMessage({ id: 'item_type_' })),
|
.label(formatMessage({ id: 'item_type_' })),
|
||||||
code: Yup.string().trim().min(0).max(DATATYPES_LENGTH.STRING),
|
code: Yup.string().trim().min(0).max(DATATYPES_LENGTH.STRING),
|
||||||
cost_price: Yup.number().when(['purchasable'], {
|
cost_price: Yup.number().min(0).when(['purchasable'], {
|
||||||
is: true,
|
is: true,
|
||||||
then: Yup.number()
|
then: Yup.number()
|
||||||
.required()
|
.required()
|
||||||
.label(formatMessage({ id: 'cost_price_' })),
|
.label(formatMessage({ id: 'cost_price_' })),
|
||||||
otherwise: Yup.number().nullable(true),
|
otherwise: Yup.number().nullable(true),
|
||||||
}),
|
}),
|
||||||
sell_price: Yup.number().when(['sellable'], {
|
sell_price: Yup.number().min(0).when(['sellable'], {
|
||||||
is: true,
|
is: true,
|
||||||
then: Yup.number()
|
then: Yup.number()
|
||||||
.required()
|
.required()
|
||||||
|
|||||||
Reference in New Issue
Block a user