| | |
| | | machineproductparent := MachiningPipelineReport::GetDefaultProductParent(); |
| | | engineproductparent := EnginePipelineReport::GetDefaultProductParent(); |
| | | allunit := AssemblyOnlinePlanVersion::GetDefaultAllUnit(); |
| | | name := InventoryPlanArchiveVersion::GetDefaultName(); |
| | | search := interfaceDataset.InventoryPlanArchiveVersionSearch( relnew, Product := allunit, Unit := allunit, StartDate := Date::MinDate(), EndDate := Date::MaxDate() );//, TimeUnit := Translations::MP_GlobalParameters_Day() |
| | | name := InventoryPlanArchiveVersion::GetDefaultName();//search := |
| | | interfaceDataset.InventoryPlanArchiveVersionSearch( relnew, Product := allunit, Unit := allunit, StartDate := Date::MinDate(), EndDate := Date::MaxDate() );//, TimeUnit := Translations::MP_GlobalParameters_Day() |
| | | table := selectobject( interfaceDataset, InventoryPlanArchiveVersion, version, not version.IsShow() ); |
| | | if( isnull( table ) ){ |
| | | table := interfaceDataset.InventoryPlanArchiveVersion( relnew, ID := name, Name := name ); |
| | | } |
| | | showtable := selectobject( interfaceDataset, InventoryPlanArchiveVersion, version, version.IsShow() ); |
| | | if( isnull( showtable ) ){ |
| | | showtable := interfaceDataset.InventoryPlanArchiveVersion( relnew, ID := name, Name := name, IsShow := true ); |
| | | } |
| | | //showtable := selectobject( interfaceDataset, InventoryPlanArchiveVersion, version, version.IsShow() ); |
| | | //if( isnull( showtable ) ){ |
| | | // showtable := interfaceDataset.InventoryPlanArchiveVersion( relnew, ID := name, Name := name, IsShow := true ); |
| | | //} |
| | | periods := selectuniquevalues( macroPlan, Period_MP, period, not period.IsHistorical() and period.TimeUnit() = Translations::MP_GlobalParameters_Day() |
| | | and not exists( table, Column, column, column.StartDate() = period.StartDate() ), period.StartDate() );//column.TimeUnit() = Translations::MP_GlobalParameters_Day() and |
| | | if( periods.Size() > 0 ){ |
| | |
| | | traverse ( pispmp, ProductInStockingPointInPeriodPlanning.astype( ProductInStockingPointInPeriodPlanningLeaf ), pispippl, not pispippl.IsPeriodFrozen() ) { |
| | | startdate := pispippl.Start().Date(); |
| | | daycolumn := table.GetColumnByTimeUnit( Translations::MP_GlobalParameters_Day(), startdate ); |
| | | weekcolumn := table.GetColumnByTimeUnit( Translations::MP_GlobalParameters_Week(), startdate ); |
| | | monthcolumn := table.GetColumnByTimeUnit( Translations::MP_GlobalParameters_Month(), startdate ); |
| | | // weekcolumn := table.GetColumnByTimeUnit( Translations::MP_GlobalParameters_Week(), startdate ); |
| | | // monthcolumn := table.GetColumnByTimeUnit( Translations::MP_GlobalParameters_Month(), startdate ); |
| | | actinventoryKey := pispmp.ProductID() + startdate.AsQUILL(); |
| | | actinventoryhandle := actinventorytree.GetHandle( actinventoryKey ); |
| | | actinventoryindex := guard( actinventorytree.Root().Child( actinventoryhandle ),null( NamedValue )); |
| | |
| | | actinventoryqty := inventoryqrys.Element( actinventoryindex.GetValueAsNumber() ); |
| | | } |
| | | inventoryrow.SetQuantity( daycolumn, pispippl.InventoryLevelEnd(), actinventoryqty ); |
| | | inventoryrow.SetQuantity( weekcolumn, pispippl.InventoryLevelEnd(), actinventoryqty ); |
| | | inventoryrow.SetQuantity( monthcolumn, pispippl.InventoryLevelEnd(), actinventoryqty ); |
| | | // inventoryrow.SetQuantity( weekcolumn, pispippl.InventoryLevelEnd(), actinventoryqty ); |
| | | // inventoryrow.SetQuantity( monthcolumn, pispippl.InventoryLevelEnd(), actinventoryqty ); |
| | | |
| | | } |
| | | } |
| | | } |
| | | |
| | | info( '-------------------------End---------------------'); |
| | | productids := selectuniquevalues( table, Row, row, row.Name() ); |
| | | productlines := selectuniquevalues( table, Row, row, row.Unit() ); |
| | | showtable.Generate( search, productids, productlines ); |
| | | //productids := selectuniquevalues( table, Row, row, row.Name() ); |
| | | //productlines := selectuniquevalues( table, Row, row, row.Unit() ); |
| | | //showtable.Generate( search, productids, productlines ); |
| | | *] |
| | | } |