yanyuan
2023-09-06 6cf15a08f9ce74311cac09a81994b86d6ab5bcd8
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
Quintiq file version 2.0
#parent: #root
Method InitialUnitAndStockingPoint
{
  TextBody:
  [*
    // Administrator Sep-1-2023 (created)
    
    //Set the Default values
    unitofmeasurename := "PCS";
    currencyid := "CNY";
    startdate := Date::Date( 1900, 1, 1 );
    enddate := Date::Date( 9999, 12, 31 );
    capacitytype := "Infinite";
    
    if( isnull( Unit::FindById( this, "空运" ) ) ){
      this.Unit( relnew, 
                 ID := "空运", 
                 Name := "空运", 
                 UnitOfMeasureName := unitofmeasurename, 
                 CurrencyID := currencyid, 
                 StartDate := startdate, 
                 EndDate := enddate, 
                 CapacityType := capacitytype );
      }
    
    if( isnull( Unit::FindById( this, "库存事务处理" ) ) ){
      this.Unit( relnew, 
                 ID := "库存事务处理", 
                 Name := "库存事务处理", 
                 UnitOfMeasureName := unitofmeasurename, 
                 CurrencyID := currencyid, 
                 StartDate := startdate, 
                 EndDate := enddate, 
                 CapacityType := capacitytype );
    }
    
    unitofmeasurename := "PCS";
    name := "手动创建库存点";
    currencyname := "CNY";
    isplannedinfinite := false;
    datestart := Date::Construct(1900, 1, 1) ;
    dateend := Date::Construct(9999, 12, 31);
    groupname := " ";
    description := " ";
    isfromdb := true;
    
    if( isnull( StockingPoint_MP::FindById( this, "F13_FG_STOCK" ) ) ){
      StockingPoint_MP::Create( this, 
                                "F13_FG_STOCK", 
                                "F13", 
                                name, 
                                unitofmeasurename, 
                                currencyname, 
                                isplannedinfinite, 
                                datestart, 
                                dateend, 
                                groupname, 
                                description, 
                                isfromdb );
    }
    
    if( isnull( StockingPoint_MP::FindById( this, "H10_SA_STOCK" ) ) ){
      StockingPoint_MP::Create( this, 
                                "H10_SA_STOCK", 
                                "H10", 
                                name, 
                                unitofmeasurename, 
                                currencyname, 
                                isplannedinfinite, 
                                datestart, 
                                dateend, 
                                groupname, 
                                description, 
                                isfromdb );
    }
    
    if( isnull( StockingPoint_MP::FindById( this, "Q10_FG_STOCK" ) ) ){
      StockingPoint_MP::Create( this, 
                                "Q10_FG_STOCK", 
                                "Q10", 
                                name, 
                                unitofmeasurename, 
                                currencyname, 
                                isplannedinfinite, 
                                datestart, 
                                dateend, 
                                groupname, 
                                description, 
                                isfromdb );
    }
    
    existcurrency := Currency_MP::FindById( this, "CNY" );
    if( isnull( existcurrency ) ){
      Currency_MP::CreateCurrency( this, "CNY", "CNY", "", true );
      currency := Currency_MP::FindById( this, "EUR" );
      currency.IsBase(false);
      Transaction::Transaction().Propagate();
      }
    
    isproductcatagory := false;
    isfromdb := false;
    existproductlevel := ProductLevel_MP::FindProductLevelTypeIndex( "2" );
    if( isnull( existproductlevel ) ){
      ProductLevel_MP::Create( "1", isproductcatagory, this, isfromdb );
      ProductLevel_MP::Create( "2", isproductcatagory, this, isfromdb );
      ProductLevel_MP::Create( "3", isproductcatagory, this, isfromdb );
      }
  *]
}