2
0
mirror of https://github.com/frappe/books.git synced 2024-11-10 15:50:56 +00:00
books/models/inventory/Shipment.ts

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

32 lines
820 B
TypeScript
Raw Normal View History

import { ListViewSettings } from 'fyo/model/types';
import { getTransactionStatusColumn } from 'models/helpers';
2023-04-25 07:07:29 +00:00
import { updateSerialNoStatus } from './helpers';
import { ShipmentItem } from './ShipmentItem';
import { StockTransfer } from './StockTransfer';
export class Shipment extends StockTransfer {
items?: ShipmentItem[];
2023-04-25 07:07:29 +00:00
async afterSubmit(): Promise<void> {
await super.afterSubmit();
await updateSerialNoStatus(this, this.items!, 'Delivered');
}
async afterCancel(): Promise<void> {
await super.afterCancel();
await updateSerialNoStatus(this, this.items!, 'Active');
}
static getListViewSettings(): ListViewSettings {
return {
columns: [
'name',
getTransactionStatusColumn(),
'party',
'date',
'grandTotal',
],
};
}
}