mirror of
https://github.com/frappe/books.git
synced 2024-12-23 03:19:01 +00:00
024687c1b9
- remove "computed" - fix a few formcontrols - simplify doc.ts a bit more
19 lines
510 B
TypeScript
19 lines
510 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 {
|
|
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',
|
|
};
|
|
}
|