| | |
| | | //天 |
| | | daycolumn := table.GetColumnByUnit( Translations::MP_GlobalParameters_Day(), pispip.Start().Date() ); |
| | | //周 |
| | | weekcolumn := table.GetColumnByUnit( Translations::MP_GlobalParameters_Week(), weekstart ); |
| | | weekcolumn := table.GetColumnByUnit( Translations::MP_GlobalParameters_Week(), pispip.Start().Date() ); |
| | | supplyquantity := [Number]pispip.NewSupplyQuantity();//四舍五入 |
| | | inventoryquantity := [Number]pispip.PlannedInventoryLevelEnd();//四舍五入 |
| | | //产量是加总 |
| | |
| | | } |
| | | |
| | | //生成需求数据 |
| | | traverse( owner, SalesDemand.astype( Forecast ), forecast, forecast.StartDate() < endperiod.StartDate() and forecast.Quantity() <> 0 |
| | | traverse( owner, SalesDemand.astype( Forecast ), forecast, not isnull( forecast.SalesSegment_MP() ) and forecast.StartDate() < endperiod.StartDate() and forecast.Quantity() <> 0 |
| | | and exists( forecast.Product_MP().GetAllParent(), Elements, e, e.ID() = productparent ) |
| | | and exists( forecast, PlanningSalesDemandInPeriod, psdip, psdip.Quantity() <> 0 ) ){ |
| | | row := table.GetRow( forecast.ProductID() ); |
| | | weekstart := owner.StartOfPlanning().Date(); |
| | | // weekstart := owner.StartOfPlanning().Date(); |
| | | traverse( forecast, PlanningSalesDemandInPeriod, psdip, psdip.Quantity() <> 0 ){ |
| | | //天 |
| | | daycolumn := table.GetColumnByUnit( Translations::MP_GlobalParameters_Day(), psdip.StartDate() ); |
| | | //周 |
| | | weekcolumn := table.GetColumnByUnit( Translations::MP_GlobalParameters_Week(), weekstart ); |
| | | weekcolumn := table.GetColumnByUnit( Translations::MP_GlobalParameters_Week(), psdip.StartDate() ); |
| | | |
| | | if( not isnull( daycolumn ) ){ |
| | | row.SetCellDemandValue( daycolumn, forecast.SalesSegmentName(), forecast.Quantity() ); |
| | |
| | | if( not isnull( weekcolumn ) ){ |
| | | row.SetCellDemandValue( weekcolumn, forecast.SalesSegmentName(), forecast.Quantity() ); |
| | | } |
| | | if( psdip.StartDate() = ( weekstart + Duration::Days( 6 ) ).Date() or psdip.PeriodStart() = endperiod.StartDate() ){ |
| | | weekstart := ( weekstart + Duration::Days( 7 ) ).Date(); |
| | | } |
| | | // if( psdip.StartDate() = ( weekstart + Duration::Days( 6 ) ).Date() or psdip.PeriodStart() = endperiod.StartDate() ){ |
| | | // weekstart := ( weekstart + Duration::Days( 7 ) ).Date(); |
| | | // } |
| | | } |
| | | } |
| | | |