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
import { CheckboxSOP } from '../../libappsop/checkboxsop';
import { DateTimeSelectorSOP } from '../../libappsop/datetimeselectorsop';
import { DialogSOP } from '../../libappsop/dialogsop';
import { DropDownListSOP } from '../../libappsop/dropdownlistsop';
import { EditFieldSOP } from '../../libappsop/editfieldsop';
import { PanelSOP } from '../../libappsop/panelsop';
 
export interface DialogCustomerOrderFields {
  SalesSegment?: string;
  Product?: string;
  StockingPoint?: string;
  OrderDate?: string;
  Quantity?: string;
  Price?: string;
  CustomerName?: string;
  CustomerID?: string;
  OrderID?: string;
  OrderLineID?: string;
  // Advanced tab fields
  ExcludeFromFulfillmentKPI?: string;
  IsEligibleNetting?: string;
  IsFirmed?: string;
}
 
export class DialogCustomerOrder extends DialogSOP<DialogCustomerOrderFields> {
  public static readonly title = 'Customer Order';
  public readonly pnlGeneral = new PanelSOP('PanelGeneral');
  public readonly pnlAdvanced = new PanelSOP('PanelAdvanced');
  public readonly ddlSalesSegment = new DropDownListSOP('DropDownListSalesSegment');
  public readonly ddlProduct = new DropDownListSOP('DropDownListProduct');
  public readonly ddlStockingPoint = new DropDownListSOP('DropDownListStockingPoint');
  public readonly dsOrderDate = new DateTimeSelectorSOP('DateSelectorStart');
  public readonly efQuantity = new EditFieldSOP('EditFieldQuantityUom');
  public readonly efPrice = new EditFieldSOP('EditFieldPrice');
  public readonly efCustomerName = new EditFieldSOP('EditFieldCustomerName');
  public readonly efCustomerID = new EditFieldSOP('EditFieldCustomerID');
  public readonly efOrderID = new EditFieldSOP('EditFieldOrderID');
  public readonly efOrderLineID = new EditFieldSOP('EditFieldOrderLineID');
  public readonly cbExcludeFromFulfillmentKPI = new CheckboxSOP('CheckBoxIsExcludedFromFulfillmentKPI');
  public readonly cbIsEligibleNetting = new CheckboxSOP('CheckboxIsForNetting');
  public readonly cbIsFirmed = new CheckboxSOP('CheckboxIsFirmed');
 
  public constructor() {
    super('DialogCreateEditCustomerOrder');
 
    // Set UI element mapping to pair the UI name to the UI element for use in DialogSOP to find the UI object to set value or verify value
    // This prevents each new Dialog to duplicate code just to set/verify UI element value
    this._uiMap.set('SalesSegment', this.ddlSalesSegment);
    this._uiMap.set('Product', this.ddlProduct);
    this._uiMap.set('StockingPoint', this.ddlStockingPoint);
    this._uiMap.set('OrderDate', this.dsOrderDate);
    this._uiMap.set('Quantity', this.efQuantity);
    this._uiMap.set('Price', this.efPrice);
    this._uiMap.set('CustomerName', this.efCustomerName);
    this._uiMap.set('CustomerID', this.efCustomerID);
    this._uiMap.set('OrderID', this.efOrderID);
    this._uiMap.set('OrderLineID', this.efOrderLineID);
    // Advanced tab fields
    this._uiMap.set('ExcludeFromFulfillmentKPI', this.cbExcludeFromFulfillmentKPI);
    this._uiMap.set('IsEligibleNetting', this.cbIsEligibleNetting);
    this._uiMap.set('IsFirmed', this.cbIsFirmed);
  }
}