mirror of
https://github.com/bigcapitalhq/bigcapital.git
synced 2026-02-16 04:40:32 +00:00
- feat: Filter expense and payment accounts on expense form.
- feat: Make journal errors with receivable and payable accounts. - fix: Handle database big numbers. - fix: Indexing lines when add a new line on make journal form. - fix: Abstruct accounts type component.
This commit is contained in:
23
client/src/services/yup.js
Normal file
23
client/src/services/yup.js
Normal file
@@ -0,0 +1,23 @@
|
||||
import * as Yup from 'yup';
|
||||
|
||||
|
||||
Yup.addMethod(Yup.string, 'digits', function () {
|
||||
return this.test(
|
||||
'is-digits',
|
||||
'${path} should be digits only.',
|
||||
value => /^(0|[1-9]\d*)$/.test(value),
|
||||
);
|
||||
});
|
||||
|
||||
Yup.addMethod(Yup.number, 'decimalScale', function(scale) {
|
||||
return this.test(
|
||||
'numeric-length',
|
||||
'${path} should decimal length ',
|
||||
(value) => {
|
||||
const reg = new RegExp(/^(?:\d{1,13}|(?!.{15})\d+\.\d+)$/);
|
||||
return reg.test(value);
|
||||
},
|
||||
);
|
||||
})
|
||||
|
||||
export default Yup;
|
||||
Reference in New Issue
Block a user