| Quintiq file version 2.0 | 
| #parent: #root | 
| StaticMethod InitiateSearch ( | 
|   InterfaceDataset owner | 
| ) as OfflinePlanArchiveVersion | 
| { | 
|   TextBody: | 
|   [* | 
|     // 甄兰鸽 Sep-29-2024 (created) | 
|     allunit                   := FinancialProductionReport::GetDefaultAllUnit(); | 
|     search                    := owner.OfflinePlanArchiveSearch(); | 
|     if( isnull( owner.OfflinePlanArchiveSearch() ) ){ | 
|       search                  := owner.OfflinePlanArchiveSearch( relnew, Product := allunit, ProductionLine := allunit, Unit := allunit, StartDate := Date::MinDate(), EndDate := Date::MaxDate() );//, TimeUnit := Translations::MP_GlobalParameters_Day() | 
|     }else{ | 
|       search                  := owner.OfflinePlanArchiveSearch(); | 
|       search.Product( allunit ); | 
|       search.ProductionLine( allunit ); | 
|     //  search.TimeUnit(  Translations::MP_GlobalParameters_Day() ); | 
|       search.Unit( allunit ); | 
|       search.StartDate( Date::MinDate() ); | 
|       search.EndDate( Date::MaxDate() ); | 
|     } | 
|     table                     := selectobject( owner, OfflinePlanArchiveVersion, table, table.IsShow() ); | 
|     if( not isnull( table ) ){ | 
|       productids             := selectuniquevalues( table, Row, row, row.Name() ); | 
|       productlines           := selectuniquevalues( table, Row, row, row.ProductionLine() ); | 
|       table.Generate( search, productids, productlines ); | 
|     } | 
|     return table; | 
|   *] | 
| } |