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(); 
 | 
    //年汇总 
 | 
    yearcolumn := this.Column( relnew, Name := '汇总', StartDate := search.MacroPlan().StartOfPlanning().StartOfNextYear().Date() ); 
 | 
    //过滤后的产品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 ) ); 
 | 
    sumyearcell      := sumrow.Initialize( yearcolumn ); 
 | 
    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() ); 
 | 
        yearcell     := showrow.Initialize( yearcolumn ); 
 | 
         
 | 
        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.Initialize( column ); 
 | 
          } 
 | 
          //显示月单元格 
 | 
          showcell   := showrow.Cell( relnew, CCRentInCost           := cell.CCRentInCost() 
 | 
                                      , CCRentOutOfCost              := cell.CCRentOutOfCost() 
 | 
                                      , CCLongTransCost              := cell.CCLongTransCost() 
 | 
                                      , CCShorTransCost              := cell.CCShorTransCost() 
 | 
                                      , CCRentStorCost               := cell.CCRentStorCost() 
 | 
                                      , DLRentInCost                 := cell.DLRentInCost() 
 | 
                                      , DLRentOutOfCost              := cell.DLRentOutOfCost() 
 | 
                                      , WerkToDLRentTransCost        := cell.WerkToDLRentTransCost() 
 | 
                                      , DLRentStorCost               := cell.DLRentStorCost() 
 | 
                                      , CoefficientValue             := cell.CoefficientValue() 
 | 
                                      , AllCost                      := cell.EstimateTotalCost() * [Real]cell.CoefficientValue() ); 
 | 
          column.Cell( relinsert, showcell ); 
 | 
          //显示年单元格 
 | 
          yearcell.CCRentInCost( cell.CCRentInCost() + yearcell.CCRentInCost() ); 
 | 
          yearcell.CCRentOutOfCost( cell.CCRentOutOfCost() + yearcell.CCRentOutOfCost() ); 
 | 
          yearcell.CCLongTransCost( cell.CCLongTransCost() + yearcell.CCLongTransCost() ); 
 | 
          yearcell.CCShorTransCost( cell.CCShorTransCost() + yearcell.CCShorTransCost() ); 
 | 
          yearcell.CCRentStorCost( cell.CCRentStorCost() + yearcell.CCRentStorCost() ); 
 | 
          yearcell.DLRentInCost( cell.DLRentInCost() + yearcell.DLRentInCost() ); 
 | 
          yearcell.DLRentOutOfCost( cell.DLRentOutOfCost() + yearcell.DLRentOutOfCost() ); 
 | 
          yearcell.WerkToDLRentTransCost( cell.WerkToDLRentTransCost() + yearcell.WerkToDLRentTransCost() ); 
 | 
          yearcell.DLRentStorCost( cell.DLRentStorCost() + yearcell.DLRentStorCost() ); 
 | 
          //显示合计年单元格 
 | 
          sumyearcell.CCRentInCost( cell.CCRentInCost() + sumyearcell.CCRentInCost() ); 
 | 
          sumyearcell.CCRentOutOfCost( cell.CCRentOutOfCost() + sumyearcell.CCRentOutOfCost() ); 
 | 
          sumyearcell.CCLongTransCost( cell.CCLongTransCost() + sumyearcell.CCLongTransCost() ); 
 | 
          sumyearcell.CCShorTransCost( cell.CCShorTransCost() + sumyearcell.CCShorTransCost() ); 
 | 
          sumyearcell.CCRentStorCost( cell.CCRentStorCost() + sumyearcell.CCRentStorCost() ); 
 | 
          sumyearcell.DLRentInCost( cell.DLRentInCost() + sumyearcell.DLRentInCost() ); 
 | 
          sumyearcell.DLRentOutOfCost( cell.DLRentOutOfCost() + sumyearcell.DLRentOutOfCost() ); 
 | 
          sumyearcell.WerkToDLRentTransCost( cell.WerkToDLRentTransCost() + sumyearcell.WerkToDLRentTransCost() ); 
 | 
          sumyearcell.DLRentStorCost( cell.DLRentStorCost() + sumyearcell.DLRentStorCost() ); 
 | 
          //显示合计月单元格 
 | 
          sumcell.CCRentInCost( cell.CCRentInCost() + sumcell.CCRentInCost() ); 
 | 
          sumcell.CCRentOutOfCost( cell.CCRentOutOfCost() + sumcell.CCRentOutOfCost() ); 
 | 
          sumcell.CCLongTransCost( cell.CCLongTransCost() + sumcell.CCLongTransCost() ); 
 | 
          sumcell.CCShorTransCost( cell.CCShorTransCost() + sumcell.CCShorTransCost() ); 
 | 
          sumcell.CCRentStorCost( cell.CCRentStorCost() + sumcell.CCRentStorCost() ); 
 | 
          sumcell.DLRentInCost( cell.DLRentInCost() + sumcell.DLRentInCost() ); 
 | 
          sumcell.DLRentOutOfCost( cell.DLRentOutOfCost() + sumcell.DLRentOutOfCost() ); 
 | 
          sumcell.WerkToDLRentTransCost( cell.WerkToDLRentTransCost() + sumcell.WerkToDLRentTransCost() ); 
 | 
          sumcell.DLRentStorCost( cell.DLRentStorCost() + sumcell.DLRentStorCost() ); 
 | 
        } 
 | 
        yearcell.EstimateTotalCost( yearcell.CalcEstimateTotalCost() ); 
 | 
        yearcell.AllCost( yearcell.EstimateTotalCost() * [Real]yearcell.CoefficientValue() ); 
 | 
      } 
 | 
    } 
 | 
     
 | 
    traverse( yearcolumn, Cell, cell ){ 
 | 
      cell.EstimateTotalCost( cell.CalcEstimateTotalCost() ); 
 | 
      cell.AllCost( cell.EstimateTotalCost() * [Real]cell.CoefficientValue() ); 
 | 
    } 
 | 
    traverse( sumrow, Cell, cell ){ 
 | 
      cell.EstimateTotalCost( cell.CalcEstimateTotalCost() ); 
 | 
      cell.AllCost( cell.EstimateTotalCost() * [Real]cell.CoefficientValue() ); 
 | 
      cell.IsAllCostUpdate( exists( cell.Column(), Cell, acell, acell.IsAllCostUpdate() ) ); 
 | 
      cell.IsCCLongTransCostUpdate( exists( cell.Column(), Cell, acell, acell.IsCCLongTransCostUpdate() ) ); 
 | 
      cell.IsCCRentInCostUpdate( exists( cell.Column(), Cell, acell, acell.IsCCRentInCostUpdate() ) ); 
 | 
      cell.IsCCRentOutOfCostUpdate( exists( cell.Column(), Cell, acell, acell.IsCCRentOutOfCostUpdate() ) ); 
 | 
      cell.IsCCRentStorCostUpdate( exists( cell.Column(), Cell, acell, acell.IsCCRentStorCostUpdate() ) ); 
 | 
      cell.IsCCShorTransCostUpdate( exists( cell.Column(), Cell, acell, acell.IsCCShorTransCostUpdate() ) ); 
 | 
      cell.IsCoefficientUpdate( exists( cell.Column(), Cell, acell, acell.IsCoefficientUpdate() ) ); 
 | 
      cell.IsDLRentInCostUpdate( exists( cell.Column(), Cell, acell, acell.IsDLRentInCostUpdate() ) ); 
 | 
      cell.IsDLRentOtherCostUpdate( exists( cell.Column(), Cell, acell, acell.IsDLRentOtherCostUpdate() ) ); 
 | 
      cell.IsDLRentOutOfCostUpdate( exists( cell.Column(), Cell, acell, acell.IsDLRentOutOfCostUpdate() ) ); 
 | 
      cell.IsDLRentStorCostUpdate( exists( cell.Column(), Cell, acell, acell.IsDLRentStorCostUpdate() ) ); 
 | 
      cell.IsEstimateTotalCostUpdate( exists( cell.Column(), Cell, acell, acell.IsEstimateTotalCostUpdate() ) ); 
 | 
      cell.IsWerkToDLRentTransCostUpdate( exists( cell.Column(), Cell, acell, acell.IsWerkToDLRentTransCostUpdate() ) ); 
 | 
    } 
 | 
    info( '-------------------------g------------end---------------------------------' ); 
 | 
  *] 
 | 
} 
 |