2
0
mirror of https://github.com/frappe/books.git synced 2024-11-10 07:40:55 +00:00
books/models/regionalModels/in/Party.ts
18alantom d0571a2450 chore: fix all fixable eslint errors in remaining non vue files
- update files to ignore
- delete babel.config.js
2023-06-22 14:22:54 +05:30

23 lines
613 B
TypeScript

import { HiddenMap } from 'fyo/model/types';
import { Party as BaseParty } from 'models/baseModels/Party/Party';
import { GSTType } from './types';
export class Party extends BaseParty {
gstin?: string;
gstType?: GSTType;
// eslint-disable-next-line @typescript-eslint/require-await
async beforeSync() {
const gstin = this.get('gstin') as string | undefined;
const gstType = this.get('gstType') as GSTType;
if (gstin && gstType !== 'Registered Regular') {
this.gstin = '';
}
}
hidden: HiddenMap = {
gstin: () => (this.gstType as GSTType) !== 'Registered Regular',
};
}