2
0
mirror of https://github.com/frappe/books.git synced 2024-12-23 19:39:07 +00:00
books/models/baseModels/AccountingSettings/AccountingSettings.ts
18alantom 9877bf4fd3 incr: simplify doc a bit
- allow nulls in converter else not not null'll fail
2022-05-23 16:18:22 +05:30

26 lines
626 B
TypeScript

import { Doc } from 'fyo/model/doc';
import { FiltersMap, ListsMap, ValidationMap } from 'fyo/model/types';
import { validateEmail } from 'fyo/model/validationFunction';
import { getCountryInfo } from 'utils/misc';
export class AccountingSettings extends Doc {
static filters: FiltersMap = {
writeOffAccount: () => ({
isGroup: false,
rootType: 'Expense',
}),
roundOffAccount: () => ({
isGroup: false,
rootType: 'Expense',
}),
};
validations: ValidationMap = {
email: validateEmail,
};
static lists: ListsMap = {
country: () => Object.keys(getCountryInfo()),
};
}