Quintiq file version 2.0 
 | 
#parent: #root 
 | 
Method Generate ( 
 | 
  DLEngineLogisticsCostSearch search, 
 | 
  Product_MPs products 
 | 
) 
 | 
{ 
 | 
  TextBody: 
 | 
  [* 
 | 
    // 甄兰鸽 Jun-25-2024 (created) 
 | 
    table            := selectobject( this, MacroPlan.DLEngineLogisticsCostReport, report, not report.IsShow() ); 
 | 
    allunit          := '<All>'; 
 | 
    //清空之前存储的显示数据 
 | 
    this.Clear(); 
 | 
    //过滤后的产品id 
 | 
    productids       := selectuniquevalues( products, Elements, product, ( search.Generation() = allunit or product.Generation() = search.Generation() ) 
 | 
                                      and ( search.MqbMlb() = allunit or product.MQBMLB() = search.MqbMlb() ) 
 | 
                                      and ( search.Power() = allunit or product.Power() = search.Power() ), product.ID() ); 
 | 
    sumrow           := this.Row( relnew, Name := 'SUM', RowNr := table.Row( relsize ) ); 
 | 
    traverse( table, Row, row ){ 
 | 
      productid      := construct( Strings ); 
 | 
      productid.Add( row.Name() ); 
 | 
       
 | 
      if( productids.ContainsAll( productid ) ){ 
 | 
        showrow      := this.Row( relnew, Name := row.Name(), RowNr := row.RowNr() ); 
 | 
         
 | 
        traverse( row, Cell, cell ){ 
 | 
          column     := selectobject( this, Column, column, column.Name() = cell.Column().Name() ); 
 | 
           
 | 
          sumcell    := selectobject( column, Cell, c, c.Row() = sumrow ); 
 | 
          if( isnull( sumcell ) ){ 
 | 
            sumcell  := sumrow.Cell( relnew, CCRentEnterCost         := 0 
 | 
                                     , CCRentOutCost                 := 0  
 | 
                                     , CCLongTransCoat               := 0 
 | 
                                     , CCShortTransCost              := 0 
 | 
                                     , CCRentStorageCost             := 0 
 | 
                                     , DLRentEnterCost               := 0 
 | 
                                     , DLRentOutCost                 := 0 
 | 
                                     , FactoryToDLRentTransCost      := 0 
 | 
                                     , DLRentStorageCost             := 0 ); 
 | 
            column.Cell( relinsert, sumcell ); 
 | 
          } 
 | 
           
 | 
          showcell   := showrow.Cell( relnew, CCRentEnterCost        := cell.CCRentEnterCost() 
 | 
                                      , CCRentOutCost                := cell.CCRentOutCost() 
 | 
                                      , CCLongTransCoat              := cell.CCLongTransCoat() 
 | 
                                      , CCShortTransCost             := cell.CCShortTransCost() 
 | 
                                      , CCRentStorageCost            := cell.CCRentStorageCost() 
 | 
                                      , DLRentEnterCost              := cell.DLRentEnterCost() 
 | 
                                      , DLRentOutCost                := cell.DLRentOutCost() 
 | 
                                      , FactoryToDLRentTransCost     := cell.FactoryToDLRentTransCost() 
 | 
                                      , DLRentStorageCost            := cell.DLRentStorageCost() ); 
 | 
          column.Cell( relinsert, showcell ); 
 | 
          sumcell.CCRentEnterCost( cell.CCRentEnterCost() + sumcell.CCRentEnterCost() ); 
 | 
          sumcell.CCRentOutCost( cell.CCRentOutCost() + sumcell.CCRentOutCost() ); 
 | 
          sumcell.CCLongTransCoat( cell.CCLongTransCoat() + sumcell.CCLongTransCoat() ); 
 | 
          sumcell.CCShortTransCost( cell.CCShortTransCost() + sumcell.CCShortTransCost() ); 
 | 
          sumcell.CCRentStorageCost( cell.CCRentStorageCost() + sumcell.CCRentStorageCost() ); 
 | 
          sumcell.DLRentEnterCost( cell.DLRentEnterCost() + sumcell.DLRentEnterCost() ); 
 | 
          sumcell.DLRentOutCost( cell.DLRentOutCost() + sumcell.DLRentOutCost() ); 
 | 
          sumcell.FactoryToDLRentTransCost( cell.FactoryToDLRentTransCost() + sumcell.FactoryToDLRentTransCost() ); 
 | 
          sumcell.DLRentStorageCost( cell.DLRentStorageCost() + sumcell.DLRentStorageCost() ); 
 | 
        } 
 | 
      } 
 | 
    } 
 | 
    info( '-------------------------g------------end---------------------------------' ); 
 | 
  *] 
 | 
} 
 |