mirror of
https://github.com/frappe/books.git
synced 2024-11-10 07:40:55 +00:00
7f928ca712
- add enableDiscounting - add toggle between amount and percent - minor ui fixes
37 lines
759 B
TypeScript
37 lines
759 B
TypeScript
import { Doc } from 'fyo/model/doc';
|
|
import {
|
|
FiltersMap,
|
|
ListsMap,
|
|
ReadOnlyMap,
|
|
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()),
|
|
};
|
|
|
|
readOnly: ReadOnlyMap = {
|
|
enableDiscounting: () => {
|
|
return !!this.enableDiscounting;
|
|
},
|
|
};
|
|
}
|