| Quintiq file version 2.0 | 
| #parent: #root | 
| StaticMethod Create ( | 
|   String id, | 
|   MacroPlan owner, | 
|   String name, | 
|   UnitOfMeasure_MP unitofmeasure, | 
|   Unit parent, | 
|   String capacitytype, | 
|   String createstockingpointtype, | 
|   SupplyChainView view, | 
|   Number gridx, | 
|   Number gridy, | 
|   Boolean isfromdb | 
| ) as Unit | 
| { | 
|   Description: 'Create a unit base with minimal arguments.' | 
|   TextBody: | 
|   [* | 
|     // Populate the required arguments with default values | 
|     group                        := null( Group ); | 
|     currency                     := owner.BaseCurrency(); | 
|     isvisible                    := true; | 
|     startdate                    := Date::MinDate(); | 
|     enddate                      := Date::MaxDate(); | 
|     campaigntypeduration         := Duration::Days( 3650 ); | 
|     isplannedinfinite            := false; | 
|     minimumquantity              := 0.0; | 
|     hasmaximumquantity           := false; | 
|     maximumquantity              := 0.0; | 
|     lotsize                      := 0.0; | 
|     usericonname                 := GlobalParameters_MP::GetDefaultUnitIcon(); | 
|     textcolor                    := 'Black'; | 
|     namedisplaybehavior          := ''; | 
|     quantitytoprocess            := ifexpr( isnull( parent ), GlobalParameters_MP::GetQTProcessOut(), parent.QuantityToProcess() ); | 
|     giscountrycode               := ''; | 
|     giscity                      := ''; | 
|     gispostalcode                := ''; | 
|     notes                        := ''; | 
|     hascapacitysmoothing         := false; | 
|     issmoothcapacityoverallperiods := false; | 
|     usercapacitysmoothinglength  := 2; | 
|     capacitysmoothingpercentagedelta := 0.0; | 
|     isoverlapcapacitysmoothing   := false; | 
|     isincludedinsupplyspec       := true; | 
|     issupplier                   := false; | 
|     hasuserfrozenfutureduration  := false; | 
|     userfrozenfutureduration     := Duration::Zero();  | 
|     useshiftoptimization         := false; | 
|      | 
|     // Create unit with minimal user passed in arguments | 
|     unit := Unit::Create( id, owner, name, parent, capacitytype, group, | 
|                           unitofmeasure, currency, view, isvisible, gridx, gridy, | 
|                           startdate, enddate, campaigntypeduration, | 
|                           isplannedinfinite, | 
|                           minimumquantity, hasmaximumquantity, maximumquantity, lotsize, | 
|                           usericonname, | 
|                           textcolor, namedisplaybehavior, | 
|                           createstockingpointtype, | 
|                           quantitytoprocess, | 
|                           giscountrycode, giscity, gispostalcode, | 
|                           notes, | 
|                           hascapacitysmoothing, | 
|                           issmoothcapacityoverallperiods, | 
|                           usercapacitysmoothinglength, | 
|                           capacitysmoothingpercentagedelta, | 
|                           isoverlapcapacitysmoothing, | 
|                           isincludedinsupplyspec, issupplier, | 
|                           hasuserfrozenfutureduration, userfrozenfutureduration, | 
|                           useshiftoptimization, | 
|                           isfromdb ); | 
|      | 
|     return unit; | 
|   *] | 
| } |