mirror of
https://github.com/frappe/books.git
synced 2024-12-22 02:49:03 +00:00
feat: validate hsnCode
This commit is contained in:
parent
73adacc784
commit
dca298fa75
@ -76,6 +76,11 @@ export class Item extends Doc {
|
||||
throw new ValidationError(this.fyo.t`Rate can't be negative.`);
|
||||
}
|
||||
},
|
||||
hsnCode: (value: DocValue) => {
|
||||
if (value && !(value as string).match(/^\d{4,8}$/)) {
|
||||
throw new ValidationError(this.fyo.t`Invalid HSN Code.`);
|
||||
}
|
||||
},
|
||||
};
|
||||
|
||||
static getActions(fyo: Fyo): Action[] {
|
||||
|
Loading…
Reference in New Issue
Block a user