| Quintiq file version 2.0 | 
| #parent: #root | 
| Method Generate ( | 
|   AssemblyOnlinePlanVersionSearch search | 
| ) | 
| { | 
|   TextBody: | 
|   [* | 
|     // 甄兰鸽 Jun-25-2024 (created) | 
|     info( '-----------Search start-------' ); | 
|     table                   := selectobject( this,InterfaceDataset.AssemblyOnlinePlanVersion, report, not report.IsShow() ); | 
|     //清空之前存储的显示数据 | 
|     aopcolumns              := selectuniquevalues(  table, Column, aopcolumn, aopcolumn.TimeUnit() = search.TimeUnit() and aopcolumn.StartDate() >= search.StartDate() and aopcolumn.StartDate() <= search.EndDate(), aopcolumn.StartDate() ); | 
|     this.Clear( aopcolumns ); | 
|     traverse( table, Row, row, ( search.Unit() = FinancialProductionReport::GetDefaultAllUnit() or row.Unit() = search.Unit() )  | 
|               and ( search.Product() = FinancialProductionReport::GetDefaultAllUnit() or search.Product() = row.Name() ) | 
|               and ( search.ProductionLine() = FinancialProductionReport::GetDefaultAllUnit() or search.ProductionLine() = row.ProductionLine() ) ){ | 
|        | 
|       showrow               := selectobject( this, Row, showrow, showrow.Name() = row.Name() and showrow.Unit() = search.Unit() ); | 
|       if( isnull( showrow ) ){ | 
|         showrow             := this.Row( relnew, Name := row.Name(), ProductID := row.ProductID(), ProductionLine := row.ProductionLine(), Type := row.Type(), Unit := search.Unit() ); | 
|       } | 
|       traverse( row, Cell, cell, cell.Column().TimeUnit() = search.TimeUnit() ){ | 
|         column              := selectobject( this, Column, column, column.ColumnName() = cell.Column().ColumnName() ); | 
|         if( not isnull( column ) ){ | 
|           showcell          := selectobject( showrow, Cell, showcell, showcell.Column() = column ); | 
|           if( isnull( showcell ) ){ | 
|             showcell        := column.Cell( relnew, Quantity := 0 ); | 
|             showrow.Cell( relinsert, showcell ); | 
|           } | 
|           showcell.Quantity( cell.Quantity() + showcell.Quantity() ); | 
|         } | 
|       } | 
|     } | 
|     info( '-----------Search end-------' ); | 
|   *] | 
| } |