Kevin Kok Khah Whey
2023-10-18 d5e46a7a9f2cb9123b9aafb39a20e14059faa2e4
_Main/UI/MacroPlannerWebApp/Component_DialogCreateEditScenario/Method_OnOk.def
@@ -6,7 +6,7 @@
  [*
    // Disabled button to prevent the possibility of multiple firing
    
    macroPlanOld := MacroPlan;
    //macroPlanOld := MacroPlan;
    
    btnOK.Enabled( false, '' )
    
@@ -19,13 +19,14 @@
    
    // New version
    globalotdtable := GlobalOTDTable;
    globalotdsop := GlobalOTDSOP;
    testbusinesstype := "集团";
    if( data.IsCreateNewVersion() ){
      VersionControl::CreateNewSceneVersion( globalotdtable, testbusinesstype );
      VersionControl::CreateNewSceneVersion( globalotdsop, testbusinesstype );
      }else{
        VersionControl::CopyVersion( globalotdtable, testbusinesstype );
        VersionControl::CopyVersion( globalotdsop, testbusinesstype );
        }
    versionname := VersionControl::GetVersionInfo( globalotdtable, testbusinesstype ).Element( 3 );
    versionname := VersionControl::GetVersionInfo( globalotdsop, testbusinesstype ).Element( 3 );
    
    // Get Version Name
    if( data.Name() = "" ){
@@ -33,10 +34,11 @@
      }
    
    // Get Business Type from Scenario Name
    businesstype := select( globalotdtable,
                            BusinessType,
                            b,
                            b.ScenarioName()=data.ScenarioName() ).BusinessTypeName();
    businesstype := guard( select( globalotdtable,
                                   BusinessType,
                                   b,
                                   b.ScenarioName()=data.ScenarioName() ).BusinessTypeName(),
                           "" );
    data.BusinessType( businesstype );
    
    // Copy scenario
@@ -110,7 +112,7 @@
    }
    
    macroPlanNew := MacroPlan;
    ManufactureLTImputation::Transfer( macroPlanOld, macroPlanNew );
    //ManufactureLTImputation::Transfer( macroPlanOld, macroPlanNew );
    
    // sync data
    if( data.EnableSync() ) {