2
0
mirror of https://github.com/frappe/books.git synced 2024-11-10 15:50:56 +00:00
books/models/inventory/PurchaseReceipt.ts
2023-04-25 12:37:29 +05:30

27 lines
711 B
TypeScript

import { ListViewSettings } from 'fyo/model/types';
import { getTransactionStatusColumn } from 'models/helpers';
import { updateSerialNoStatus } from './helpers';
import { PurchaseReceiptItem } from './PurchaseReceiptItem';
import { StockTransfer } from './StockTransfer';
export class PurchaseReceipt extends StockTransfer {
items?: PurchaseReceiptItem[];
async afterSubmit(): Promise<void> {
await super.afterSubmit();
await updateSerialNoStatus(this, this.items!, 'Active');
}
static getListViewSettings(): ListViewSettings {
return {
columns: [
'name',
getTransactionStatusColumn(),
'party',
'date',
'grandTotal',
],
};
}
}