| | |
| | | [* |
| | | // 甄兰鸽 Jun-24-2024 (created) |
| | | owner.EnginePipelineSource( relflush ); |
| | | ccunit := EnginePipelineReport::GetDefaultCCUnit(); |
| | | dlunit := EnginePipelineReport::GetDefaultDLUnit(); |
| | | //ccunit := EnginePipelineReport::GetDefaultCCUnit(); |
| | | //dlunit := EnginePipelineReport::GetDefaultDLUnit(); |
| | | ccalineunit := FinancialProductionReport::GetDefaultCCALineUnit(); |
| | | dlalienunit := FinancialProductionReport::GetDefaultDLALineUnit() |
| | | ccmplineunit := FinancialProductionReport::GetDefaultCCMPLineUnit() |
| | | dlmplineunit := FinancialProductionReport::GetDefaultDLMPLineUnit(); |
| | | //allunit := EnginePipelineReport::GetDefaultAllUnit(); |
| | | source := owner.EnginePipelineSource( relnew, Name := EnginePipelineReport::GetDefaultName() ); |
| | | table := source.Report( relnew, ID := source.Name(), Name := source.Name() ); |
| | |
| | | unit := stockingpoint.Unit(); |
| | | parentunits := unit.GetAllParent(); |
| | | //是否属于长春工厂 |
| | | iscc := unit.ID() = ccunit or exists( parentunits, Elements, punit, punit.ID() = ccunit ); |
| | | iscc := unit.ID() = ccalineunit or unit.ID() = ccmplineunit or exists( parentunits, Elements, punit, punit.ID() = ccalineunit or punit.ID() = ccmplineunit ); |
| | | //是否属于大连工厂 |
| | | isdl := unit.ID() = dlunit or exists( parentunits, Elements, punit, punit.ID() = dlunit ); |
| | | isdl := unit.ID() = dlalienunit or unit.ID() = dlmplineunit or exists( parentunits, Elements, punit, punit.ID() = dlalienunit or punit.ID() = dlmplineunit ); |
| | | |
| | | traverse( stockingpoint, ProductInStockingPoint_MP, pisp, pisp.Product_MP().IsLeaf() and not pisp.IsSystem() ){ |
| | | weekstart := owner.StartOfPlanning().Date(); |
| | |
| | | daycolumn := table.GetColumnByUnit( Translations::MP_GlobalParameters_Day(), pispip.Start().Date() ); |
| | | //周 |
| | | weekcolumn := table.GetColumnByUnit( Translations::MP_GlobalParameters_Week(), weekstart ); |
| | | supplyquantity := [Real]ceil( pispip.NewSupplyQuantity() );//向上取整 |
| | | inventoryquantity := [Real]ceil( pispip.PlannedInventoryLevelEnd() );//向上取整 |
| | | supplyquantity := [Number]pispip.NewSupplyQuantity();//四舍五入 |
| | | inventoryquantity := [Number]pispip.PlannedInventoryLevelEnd();//四舍五入 |
| | | //产量是加总 |
| | | if( iscc or isdl ){ |
| | | row.SetCellProductionValue( daycolumn, iscc, supplyquantity ); |
| | | row.SetCellProductionValue( weekcolumn, iscc, supplyquantity ); |
| | | row.SetCellProductionValue( daycolumn, iscc, [Real]supplyquantity ); |
| | | row.SetCellProductionValue( weekcolumn, iscc, [Real]supplyquantity ); |
| | | } |
| | | //库存需要取最后一天 |
| | | row.SetCellInventoryValue( daycolumn, pispip.PlannedInventoryLevelEnd() ); |
| | | row.SetCellInventoryValue( daycolumn, [Real]inventoryquantity ); |
| | | |
| | | if( pispip.Start() = weekstart + Duration::Days( 6 ) or pispip.Period_MP() = endperiod ){ |
| | | weekstart := ( weekstart + Duration::Days( 7 ) ).Date(); |
| | | |
| | | row.SetCellInventoryValue( weekcolumn, inventoryquantity ); |
| | | row.SetCellInventoryValue( weekcolumn, [Real]inventoryquantity ); |
| | | } |
| | | } |
| | | } |