| | |
| | | and pispippl.Period_MP().TimeUnit() = Translations::MP_GlobalParameters_Day()); |
| | | |
| | | if( pispippls.Size() <> 0 ){ |
| | | localRow := null( LocalRow ); |
| | | { |
| | | localRowHandle := localRowIndexTree.GetHandle( pisp_mp.ProductID() + pisp_mp.StockingPoint_MP().Unit().Name() ); |
| | | localRowIndex := guard( localRowIndexTree.Root().Child( localRowHandle ),null( NamedValue )); |
| | | if( isnull( localRowIndex )){ |
| | | localRow := localTable.LocalRow( relnew,CustomName := pisp_mp.ProductID() + " in " + pisp_mp.StockingPoint_MP().Unit().Name(),ProductID := pisp_mp.ProductID(),ProductionLine := pisp_mp.StockingPoint_MP().Unit().Name(),Index := localTable.GetRowIndexCache() ); |
| | | localRows.Add( localRow ); |
| | | localRowIndexTree.Root().AddChild( localRowHandle,localRows.Size() - 1 ); |
| | | traverse( pispippls,Elements.NewSupply,newSupply ){ |
| | | unit := newSupply.PeriodTask_MP().UnitPeriod().Unit(); |
| | | |
| | | localRow := null( LocalRow ); |
| | | { |
| | | localRowHandle := localRowIndexTree.GetHandle( pisp_mp.ProductID() + unit.Name() ); |
| | | localRowIndex := guard( localRowIndexTree.Root().Child( localRowHandle ),null( NamedValue )); |
| | | if( isnull( localRowIndex )){ |
| | | localRow := localTable.LocalRow( relnew,CustomName := pisp_mp.ProductID() + " in " + unit.Name(), |
| | | ProductID := pisp_mp.ProductID(), |
| | | ProductionLine := unit.Name(), |
| | | Index := localTable.GetRowIndexCache() ); |
| | | localRows.Add( localRow ); |
| | | localRowIndexTree.Root().AddChild( localRowHandle,localRows.Size() - 1 ); |
| | | }else{ |
| | | localRow := localRows.Element( localRowIndex.GetValueAsNumber() ); |
| | | } |
| | | } |
| | | |
| | | column := null( LocalColumn ); |
| | | { |
| | | columnHandle := localColumnIndexTree.GetHandle( newSupply.PeriodTask_MP().UnitPeriod().Period_MP().StartDate().AsQUILL() ); |
| | | columnIndex := guard( localColumnIndexTree.Root().Child( columnHandle ),null( NamedValue )); |
| | | if( not isnull( columnIndex )){ |
| | | column := localColumns.Element( columnIndex.GetValueAsNumber() ); |
| | | }else{ |
| | | column := localTable.LocalColumn( relnew,CustomDate := newSupply.PeriodTask_MP().UnitPeriod().Period_MP().StartDate() ,TimeUnit := "Day"); |
| | | localColumns.Add( column ); |
| | | localColumnIndexTree.Root().AddChild( columnHandle,localColumns.Size() - 1 ); |
| | | } |
| | | } |
| | | |
| | | localCellHandle := localCellIndexTree.GetHandle( localRow.ProductID() + localRow.ProductionLine() + column.CustomDate().AsQUILL() + column.TimeUnit() ); |
| | | localCellIndex := guard( localCellIndexTree.Root().Child( localCellHandle ),null( NamedValue )); |
| | | if( isnull( localCellIndex )){ |
| | | localCell := localRow.LocalCell( relnew,LocalCell_Default,LocalColumn := column ); |
| | | localCell.RealValue( newSupply.Quantity() ); |
| | | localCells.Add( localCell ); |
| | | localCellIndexTree.Root().AddChild( localCellHandle,localCells.Size() - 1 ); |
| | | }else{ |
| | | localRow := localRows.Element( localRowIndex.GetValueAsNumber() ); |
| | | localCell := localCells.Element( localCellIndex.GetValueAsNumber() ); |
| | | localCell.RealValue( localCell.RealValue() + newSupply.Quantity() ); |
| | | } |
| | | } |
| | | |
| | | |
| | | traverse( pispippls,Elements,pispippl ){ |
| | | unit := pispippl.ProductInStockingPoint_MP().StockingPoint_MP().Unit(); |
| | | |
| | | localRow := null( LocalRow ); |
| | | { |
| | | localRowHandle := localRowIndexTree.GetHandle( pisp_mp.ProductID() + unit.Name() ); |
| | | localRowIndex := guard( localRowIndexTree.Root().Child( localRowHandle ),null( NamedValue )); |
| | | if( isnull( localRowIndex )){ |
| | | localRow := localTable.LocalRow( relnew,CustomName := pisp_mp.ProductID() + " in " + unit.Name(), |
| | | ProductID := pisp_mp.ProductID(), |
| | | ProductionLine := unit.Name(), |
| | | Index := localTable.GetRowIndexCache() ); |
| | | localRows.Add( localRow ); |
| | | localRowIndexTree.Root().AddChild( localRowHandle,localRows.Size() - 1 ); |
| | | }else{ |
| | | localRow := localRows.Element( localRowIndex.GetValueAsNumber() ); |
| | | } |
| | | } |
| | | |
| | | column := null( LocalColumn ); |
| | | { |
| | | columnHandle := localColumnIndexTree.GetHandle( pispippl.Period_MP().StartDate().AsQUILL() ); |
| | |
| | | localCellIndex := guard( localCellIndexTree.Root().Child( localCellHandle ),null( NamedValue )); |
| | | if( isnull( localCellIndex )){ |
| | | localCell := localRow.LocalCell( relnew,LocalCell_Default,LocalColumn := column ); |
| | | localCell.RealValue( pispippl.NewSupplyQuantity() ); |
| | | localCell.RealValue( pispippl.NewSupplyQuantity()); |
| | | localCells.Add( localCell ); |
| | | localCellIndexTree.Root().AddChild( localCellHandle,localCells.Size() - 1 ); |
| | | }else{ |