haorenhui
2023-10-30 6d6cc10d9e8e242661da7fd655dec155a09d676c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
import { ListSOP } from '../../libappsop/listsop';
import { FormSOP } from '../../libappsop/formsop';
import { DialogPostponeForecast } from '../dialogs/dialog.postponeforecast';
import { DialogCustomerOrder } from '../dialogs/dialog.customerorder';
 
export class FormCustomerOrders extends FormSOP {
  public listCustomerOrders = new ListCustomerOrders();
  public listCustomerOrdersPlanningLevel = new ListCustomerOrdersPlanningLevel();
 
  public constructor() {
    super('FormCustomerOrders');
  }
}
 
export class ListCustomerOrders extends ListSOP<DialogCustomerOrder, ListCustomerOrdersColumn> {
  public readonly title = 'Customer Orders';
 
  public constructor() {
    super('ListSalesDemands', new DialogCustomerOrder());
 
    // Set primary key column name(s), to display in error message when assert fails
    this.rowPrimaryColumnNames = {'Sales segment': '', 'Stocking point': '', Product: '', 'Order date': '', Quantity: ''};
    this.rowAllConstraintsColumnName = { 'All constraints': '' };
  }
}
 
export class ListCustomerOrdersPlanningLevel extends ListSOP<DialogPostponeForecast, ListCustomerOrdersPlanningLevelColumn> {
  public readonly title = 'Customer Orders at planning level';
 
  public constructor() {
    super('ListSDIP', new DialogPostponeForecast());
  }
}
 
// List Customer Orders columns
export interface ListCustomerOrdersColumn {
  'All constraints'?: string;
  Product?: string;
  'Sales segment'?: string;
  'Stocking point'?: string;
  'Order date'?: string;
  Quantity?: string;
  Price?: string;
  'Customer name'?: string;
  'Customer ID'?: string;
  'Order ID'?: string;
  'Order line ID'?: string;
}
 
export interface ListCustomerOrdersPlanningLevelColumn {
  Product?: string;
  'Sales segment'?: string;
  'Stocking point'?: string;
  Start?: string;
  End?: string;
  Quantity?: string;
}
 
// List CustomerOrders context menu items
const listCustomerOrdersContextMenuItem = {
  Create: { ContextMenu: 'listContextMenuSD', Name: 'MenuCreate', Label: 'Create' },
  Edit: { ContextMenu: 'listContextMenuSD', Name: 'MenuEdit', Label: 'Edit' },
  Delete: { ContextMenu: 'listContextMenuSD', Name: 'MenuDelete', Label: 'Delete' },
  AdjustQuantity: { ContextMenu: 'listContextMenuSD', Name: 'MenuAdjustQuantity', Label: 'Adjust Quantity...' },
};
 
const listCustomerOrdersPlanningLevelContextMenuItem = {
  Postpone: { ContextMenu: 'listContextMenuSDIP', Name: 'MenuPostpone', Label: 'Postpone' },
};
 
export { listCustomerOrdersContextMenuItem as ListCustomerOrdersContextMenuItem };
export { listCustomerOrdersPlanningLevelContextMenuItem as ListCustomerOrdersPlanningLevelContextMenuItem };