| | |
| | | loginfo.AOnlineAndMOfflinePlanPIR( relinsert, pir ); |
| | | traverse( owner, AssemblyOnlinePlanVersion, verison, not verison.IsShow() ){ |
| | | traverse( verison, Column, column, column.TimeUnit() = Translations::MP_GlobalParameters_Day() and column.StartDate() >= startdate and column.StartDate() <= enddate ){ |
| | | traverse( column, Cell, cell, ( werk = 'All' or cell.Row().ProductionLine().FindString( werk, 0 ) > -1 ) |
| | | and cell.Row().Type() = '1' ){ |
| | | quantityrow := cell.Row(); |
| | | traverse( column, Cell, cell, ( werk = 'All' or cell.Row().Unit().FindString( werk, 0 ) > -1 ) ){ |
| | | quantityrow := cell.Row(); |
| | | rowwerk := ifexpr( quantityrow.ProductionLine().FindString( "CC", 0 ) > -1, AOnlineAndMOfflinePlanPIR::GetWerk( FinancialProductionReport::GetDefaultCCUnit() ), AOnlineAndMOfflinePlanPIR::GetWerk( FinancialProductionReport::GetDefaultDLUnit() ) ); |
| | | if( not exists( productids, Elements, e, e = quantityrow.ProductID() ) ){ |
| | | productids.Add( quantityrow.ProductID() ); |
| | | } |
| | | |
| | | pir.PIRData( relnew, Product := quantityrow.ProductID() |
| | | , PlanningDate := column.StartDate() |
| | | , PlanningQty := [Number]cell.Value()); |
| | | pir.PIRData( relnew, Product := quantityrow.ProductID(), PlanningDate := column.StartDate(), PlanningQty := [Number]cell.Value(), Werk := rowwerk ); |
| | | } |
| | | } |
| | | } |
| | | |
| | | traverse( owner, OfflinePlanArchiveVersion, table ){ |
| | | traverse( table, Column, column, column.StartDate() >= startdate and column.StartDate() <= enddate ){ |
| | | traverse( column, Cell, cell, ( werk = 'All' or cell.Row().ProductionLine().FindString( werk, 0 ) > -1 ) |
| | | and ( cell.Row().ProductionLine() <> 'DL_MOMO' or cell.Row().ProductionLine() <> 'CC_MOMO' ) |
| | | and cell.Row().Type() = '1' ){ |
| | | traverse( column, Cell, cell, ( werk = 'All' or cell.Row().Unit().FindString( werk, 0 ) > -1 ) |
| | | and ( cell.Row().ProductionLine() <> 'DL_MOMO' or cell.Row().ProductionLine() <> 'CC_MOMO' ) ){ |
| | | row := cell.Row(); |
| | | rowwerk := ifexpr( row.ProductionLine().FindString( "CC", 0 ) > -1, AOnlineAndMOfflinePlanPIR::GetWerk( FinancialProductionReport::GetDefaultCCUnit() ), AOnlineAndMOfflinePlanPIR::GetWerk( FinancialProductionReport::GetDefaultDLUnit() ) ); |
| | | if( not exists( productids, Elements, e, e = row.ProductID() ) ){ |
| | | productids.Add( row.ProductID() ); |
| | | } |
| | | pirdata := selectobject( pir, PIRData, pirdata, pirdata.Product() = row.ProductID() and pirdata.PlanningDate() = column.StartDate() ); |
| | | if( isnull( pirdata ) ){ |
| | | pirdata := pir.PIRData( relnew, Product := row.ProductID() |
| | | , PlanningDate := column.StartDate() |
| | | , PlanningQty := 0 ); |
| | | pirdata := pir.PIRData( relnew, Product := row.ProductID(), PlanningDate := column.StartDate(), PlanningQty := 0, Werk := rowwerk ); |
| | | } |
| | | pirdata.PlanningQty( pirdata.PlanningQty() + [Number]cell.Value() ); |
| | | } |
| | | } |
| | | } |
| | | traverse( productids, Elements, e ){ |
| | | for( date := startdate.StartOfWeek(); date <= enddate; date := ( date + Duration::Days( 1 ) ).Date() ){ |
| | | for( date := startdate.StartOfWeek(); date <= enddate; date := ( date + Duration::Days( 1 ) ).Date() ){ |
| | | if( not exists( pir, PIRData, pirdata, pirdata.Product() = e and pirdata.PlanningDate() = date ) ){ |
| | | pir.PIRData( relnew, Product := e |
| | | , PlanningDate := date |
| | | , PlanningQty := 0 ); |
| | | if( werk = 'All' ){ |
| | | pir.PIRData( relnew, Product := e, PlanningDate := date, PlanningQty := 0, Werk := '8200' ); |
| | | pir.PIRData( relnew, Product := e, PlanningDate := date, PlanningQty := 0, Werk := '8201' ); |
| | | }else{ |
| | | pir.PIRData( relnew, Product := e, PlanningDate := date, PlanningQty := 0, Werk := pir.Werk() ); |
| | | } |
| | | } |
| | | } |
| | | } |