renhao
2023-10-12 df6e56c65e758b5a5e7b28bb9192575710a76c47
_Main/BL/Type_MPSync/StaticMethod_TestData.qbl
@@ -9,10 +9,10 @@
  [*
    // yypsybs Sep-20-2023 (created)
    
    info( "MPSync::TestData" );
    debuginfo( "MPSync::TestData" );
    
    productCodeList := selectuniquevalues( macroPlan, Product_MP, item, item.ID() );
    info( "productCodeList : " + [String]productCodeList.Size() );
    debuginfo( "productCodeList : " + [String]productCodeList.Size() );
    
    mpSync.MappingCapacityAndSaleBudge( relflush );
    for( year := Date::ActualDate().Year() - 10; year <= Date::ActualDate().Year() + 5; year := year + 1 ) {
@@ -38,27 +38,6 @@
      }
    }
    result1 := selectset( mpSync, MappingCapacityAndSaleBudge, item, true );
    info( "test MappingCapacityAndSaleBudge size : " + [String]result1.Size() );
    mpSync.MappingAnnualBudget( relflush );
    for( year := Date::ActualDate().Year() - 10; year <= Date::ActualDate().Year() + 5; year := year + 1 ) {
      for( i := 1; i <= productCodeList.Size(); i := i + 1 ) {
        productCode := productCodeList.Element( i - 1 );
        mappingAnnualBudget := mpSync.MappingAnnualBudget( relnew,
                                                           YearNo := year,
                                                           ProductId := productCode
                                                            );
        for( month := 1; month <= 12; month := month + 1 ) {
          field := Reflection::FindAttribute( "MappingAnnualBudget", "MonthlyModCapacity" + [String]month );
          field.Set( mappingAnnualBudget, Real::Random( 20000.0, 30000.0 ) );
          field := Reflection::FindAttribute( "MappingAnnualBudget", "MonthlySheetCapacity" + [String]month );
          field.Set( mappingAnnualBudget, Real::Random( 20000.0, 30000.0 ) );
          field := Reflection::FindAttribute( "MappingAnnualBudget", "MonthlySales" + [String]month );
          field.Set( mappingAnnualBudget, Real::Random( 20000.0, 30000.0 ) );
        }
      }
    }
    result2 := selectset( mpSync, MappingAnnualBudget, item, true );
    info( "test MappingAnnualBudget size : " + [String]result2.Size() );
    debuginfo( "test MappingCapacityAndSaleBudge size : " + [String]result1.Size() );
  *]
}