| | |
| | | TextBody: |
| | | [* |
| | | // çå
°é¸½ Jun-25-2024 (created) |
| | | startofplanning := owner.StartOfPlanning(); |
| | | startofyear := startofplanning.StartOfYear().Date(); |
| | | startofendyear := startofplanning.StartOfNextYear().Date(); |
| | | //æ¥è¯¢æ¥æè¿åéè¦å¨è®¡åæ¥æä¹å
|
| | | weekstart := owner.StartOfPlanning().Date(); |
| | | traverse( owner, Period_MP, period, not period.IsHistorical() and period.TimeUnit() = Translations::MP_GlobalParameters_Day() ){ |
| | | if( timeunit = 'All' or timeunit = Translations::MP_GlobalParameters_Day() ){ |
| | | periodtime := period.StartDate(); |
| | | periodname := periodtime.Format( "M2/D2/Y" ); |
| | | |
| | | this.Column( relnew, Name := periodname, StartDate := periodtime, EndDate := periodtime, TimeUnit := Translations::MP_GlobalParameters_Day() ); |
| | | if( startdate < startofendyear and enddate > startofyear ){ |
| | | if( startdate < startofyear ){ |
| | | startdate := startofyear; |
| | | } |
| | | |
| | | if( enddate > startofendyear ){ |
| | | enddate := startofendyear; |
| | | } |
| | | if( timeunit = 'All' or timeunit = Translations::MP_GlobalParameters_Day() ){ |
| | | for( start := startdate; start <= enddate; start := start.DateTime().StartOfNextDay().Date() ){ |
| | | periodname := start.Format( "M2/D2/Y" ); |
| | | this.Column( relnew, Name := periodname, StartDate := start, EndDate := start, TimeUnit := Translations::MP_GlobalParameters_Day() ); |
| | | } |
| | | } |
| | | if( timeunit = 'All' or timeunit = Translations::MP_GlobalParameters_Week() ){ |
| | | if( period.StartDate() = weekstart ){ |
| | | weekperiodname := weekstart.Format( "M2/D2/Y" ); |
| | | this.Column( relnew, Name := weekperiodname, StartDate := weekstart, EndDate := ( weekstart + Duration::Days( 6 ) ).Date(), TimeUnit := Translations::MP_GlobalParameters_Week() ); |
| | | weekstart := ( weekstart + Duration::Days( 7 ) ).Date(); |
| | | for( start := startdate; start <= enddate; start := start.StartOfNextWeek() ){ |
| | | periodname := start.Format( "M2/D2/Y" ); |
| | | weekend := ( start.StartOfNextWeek() - Duration::Days( 1 ) ).Date(); |
| | | |
| | | this.Column( relnew, Name := periodname, StartDate := start, EndDate := weekend, TimeUnit := Translations::MP_GlobalParameters_Week() ); |
| | | } |
| | | } |
| | | } |
| | |
| | | traverse( stockingpoint, ProductInStockingPoint_MP, pisp, pisp.Product_MP().IsLeaf() and not pisp.IsSystem() |
| | | and exists( pisp.Product_MP().GetAllParent(), Elements, e, e.ID() = productparent ) |
| | | and exists( pisp, ProductInStockingPointInPeriod, pispip, not pispip.Period_MP().IsHistorical() and pispip.Period_MP().TimeUnit() = Translations::MP_GlobalParameters_Day() and ( pispip.NewSupplyQuantity() <> 0 or pispip.PlannedInventoryLevelEnd() <> 0 ) ) ){ |
| | | weekstart := owner.StartOfPlanning().Date(); |
| | | pispips := selectsortedset( pisp, ProductInStockingPointInPeriod, pispip, not pispip.Period_MP().IsHistorical() |
| | | and pispip.Period_MP().TimeUnit() = Translations::MP_GlobalParameters_Day(), pispip.Start() ); |
| | | row := table.GetRow( pisp.ProductID() ); |
| | |
| | | //åºåéè¦åæåä¸å¤© |
| | | row.SetCellInventoryValue( daycolumn, [Real]inventoryquantity ); |
| | | |
| | | if( pispip.Start() = weekstart + Duration::Days( 6 ) or pispip.Period_MP() = endperiod ){ |
| | | weekstart := ( weekstart + Duration::Days( 7 ) ).Date(); |
| | | if( pispip.Start().Date() = weekcolumn.EndDate() or pispip.Period_MP() = endperiod ){ |
| | | |
| | | row.SetCellInventoryValue( weekcolumn, [Real]inventoryquantity ); |
| | | } |
| | |
| | | , MLBMQB := product.MQBMLB() |
| | | , Power := product.Power() |
| | | , Product := product.ID() |
| | | , InventoryDate := column.Period() |
| | | , InventoryDate := column.StartDate() |
| | | , InventoryEndQty := cell.EndingInventory() |
| | | , InventoryMinQty := cell.MinimumInventory() |
| | | , InventoryMaxQty := cell.MaximumInventory() |
| | |
| | | } |
| | | }else if( timeunit = Translations::MP_GlobalParameters_Week() ){ |
| | | for( start := starttime; start <= endtime; start := start.StartOfNextWeek() ){ |
| | | periodtime := start.Date(); |
| | | periodname := periodtime.Format( "M2/D2/Y" ); |
| | | weekend := ( start.StartOfNextWeek() - Duration::Days( 1 ) ).Date(); |
| | | |
| | | this.InventorySummaryColumn( relnew, Name := periodname, StartDate := periodtime, EndaDate := weekend, TimeUnit := Translations::MP_GlobalParameters_Week() ); |
| | | this.InventorySummaryColumn( relnew, Name := weekend.Format( "M2/D2/Y" ), StartDate := start.Date(), EndaDate := weekend, TimeUnit := Translations::MP_GlobalParameters_Week() ); |
| | | } |
| | | }else if( timeunit = Translations::MP_GlobalParameters_Month() ){ |
| | | for( start := starttime; start <= endtime; start := start.StartOfNextMonth() ){ |
| | | periodtime := start.Date(); |
| | | periodname := periodtime.Format( "M2/D2/Y" ); |
| | | monthend := ( start.StartOfNextMonth() - Duration::Days( 1 ) ).Date(); |
| | | |
| | | this.InventorySummaryColumn( relnew, Name := periodname, StartDate := periodtime, EndaDate := monthend, TimeUnit := Translations::MP_GlobalParameters_Month() ); |
| | | this.InventorySummaryColumn( relnew, Name := monthend.Format( "M2/D2/Y" ), StartDate := start.Date(), EndaDate := monthend, TimeUnit := Translations::MP_GlobalParameters_Month() ); |
| | | } |
| | | } |
| | | } |
| | |
| | | periodname := periodtime.Format( "M2/D2/Y" ); |
| | | |
| | | //天ï¼éæ©æ¥é¢ç²åº¦æ¶ï¼ææ«åºåï¼æå°åºåï¼æå¤§åºååå¹³ååºåçæ°å¼ä¿æä¸è´ |
| | | daycolumn := selectobject( table, InventorySummaryColumn, column, column.Name() = periodname, column.Period() = periodtime, column.TimeUnit() = Translations::MP_GlobalParameters_Day() ); |
| | | daycolumn := selectobject( table, InventorySummaryColumn, column, column.Name() = periodname, column.StartDate() = periodtime, column.TimeUnit() = Translations::MP_GlobalParameters_Day() ); |
| | | quantity := ifexpr( pispip.Period_MP().IsHistorical(), [Number]pispip.ActualInventoryLevelEnd(), [Number]pispip.PlannedInventoryLevelEnd() ); |
| | | factoryrow.SetCellValue( daycolumn, quantity ); |
| | | allrow.SetCellValue( daycolumn, quantity ); |
| | |
| | | selections := selectset( interface, InventoryPointSelection, selection, allsps.Find( selection.StockpoingPoint() ) >= 0 and selection.IsIncluded() ); |
| | | productids := selectuniquevalues( selections, Elements, selection, selection.ProductID() ); |
| | | //æåå°è¿äºåºä½ä¸é¶ä»¶å·çæ°éè¿è¡å æ» |
| | | traverse( table, InventorySummaryColumn, column, column.TimeUnit() = Translations::MP_GlobalParameters_Day() and column.Period() < startofplanning.Date() ){ |
| | | traverse( table, InventorySummaryColumn, column, column.TimeUnit() = Translations::MP_GlobalParameters_Day() and column.StartDate() < startofplanning.Date() ){ |
| | | traverse( productids, Elements, productid ){ |
| | | column.GenerateCell( selections, ccsps, dlsps, table, column.Period(), column.Period(), productid, allunit, ccunit, dlunit ); |
| | | column.GenerateCell( selections, ccsps, dlsps, table, column.StartDate(), column.EndaDate(), productid, allunit, ccunit, dlunit ); |
| | | } |
| | | } |
| | | |
| | |
| | | [* |
| | | // çå
°é¸½ Jun-25-2024 (created) |
| | | //æ¥è¯¢æ¥æè¿åéè¦å¨è®¡åæ¥æä¹å
|
| | | weekstart := owner.StartOfPlanning().Date(); |
| | | traverse( owner, Period_MP, period, not period.IsHistorical() and period.TimeUnit() = Translations::MP_GlobalParameters_Day() ){ |
| | | if( timeunit = 'All' or timeunit = Translations::MP_GlobalParameters_Day() ){ |
| | | periodtime := period.StartDate(); |
| | | periodname := periodtime.Format( "M2/D2/Y" ); |
| | | |
| | | this.Column( relnew, Name := periodname, StartDate := periodtime, EndDate := periodtime, TimeUnit := Translations::MP_GlobalParameters_Day() ); |
| | | startofplanning := owner.StartOfPlanning(); |
| | | startofyear := startofplanning.StartOfYear().Date(); |
| | | startofendyear := startofplanning.StartOfNextYear().Date(); |
| | | //æ¥è¯¢æ¥æè¿åéè¦å¨è®¡åæ¥æä¹å
|
| | | if( startdate < startofendyear and enddate > startofyear ){ |
| | | if( startdate < startofyear ){ |
| | | startdate := startofyear; |
| | | } |
| | | |
| | | if( enddate > startofendyear ){ |
| | | enddate := startofendyear; |
| | | } |
| | | if( timeunit = 'All' or timeunit = Translations::MP_GlobalParameters_Day() ){ |
| | | for( start := startdate; start <= enddate; start := start.DateTime().StartOfNextDay().Date() ){ |
| | | periodname := start.Format( "M2/D2/Y" ); |
| | | this.Column( relnew, Name := periodname, StartDate := start, EndDate := start, TimeUnit := Translations::MP_GlobalParameters_Day() ); |
| | | } |
| | | } |
| | | if( timeunit = 'All' or timeunit = Translations::MP_GlobalParameters_Week() ){ |
| | | if( period.StartDate() = weekstart ){ |
| | | weekperiodname := weekstart.Format( "M2/D2/Y" ); |
| | | this.Column( relnew, Name := weekperiodname, StartDate := weekstart, EndDate := ( weekstart + Duration::Days( 6 ) ).Date(), TimeUnit := Translations::MP_GlobalParameters_Week() ); |
| | | weekstart := ( weekstart + Duration::Days( 7 ) ).Date(); |
| | | for( start := startdate; start <= enddate; start := start.StartOfNextWeek() ){ |
| | | periodname := start.Format( "M2/D2/Y" ); |
| | | weekend := ( start.StartOfNextWeek() - Duration::Days( 1 ) ).Date(); |
| | | |
| | | this.Column( relnew, Name := periodname, StartDate := start, EndDate := weekend, TimeUnit := Translations::MP_GlobalParameters_Week() ); |
| | | } |
| | | } |
| | | } |
| | |
| | | // çå
°é¸½ Jun-24-2024 (created) |
| | | owner.FinancialProductionSource( relflush ); |
| | | productparent := MachiningPipelineReport::GetDefaultProductParent(); |
| | | //ccunit := MachiningPipelineReport::GetDefaultCCUnit(); |
| | | //dlunit := MachiningPipelineReport::GetDefaultDLUnit(); |
| | | //allunit := EnginePipelineReport::GetDefaultAllUnit(); |
| | | source := owner.MachiningPipelineSource( relnew, Name := MachiningPipelineReport::GetDefaultName() ); |
| | | table := source.Report( relnew, ID := source.Name(), Name := source.Name() ); |
| | | showtable := source.Report( relnew, ID := source.Name() + 'Show', Name := source.Name(), IsShow := true ); |
| | |
| | | iscc := stockingpoint.ID().StartsWith( 'CC' ) or unit.ID().StartsWith( 'CC' ) or exists( parentunits, Elements, punit, punit.ID().StartsWith( 'CC' ) );//unit.ID() = ccunit or exists( parentunits, Elements, punit, punit.ID() = ccunit ); |
| | | //æ¯å¦å±äºå¤§è¿å·¥å |
| | | isdl := stockingpoint.ID().StartsWith( 'DL' ) or unit.ID().StartsWith( 'DL' ) or exists( parentunits, Elements, punit, punit.ID().StartsWith( 'DL' ) );//unit.ID() = dlunit or exists( parentunits, Elements, punit, punit.ID() = dlunit ); |
| | | //æ¯å¦å±äºé¿æ¥è£
é
线CCåå
åº |
| | | // isccassemnly := stockingpoint.ID().EndsWith( 'åå
åº' ) and ( stockingpoint.ID().StartsWith( 'CC' ) or stockingpoint.ID().StartsWith( 'é¿æ¥' ) );//unit.ID() = MachiningPipelineReport::GetDefaultCCAssemnlyUnit() or exists( parentunits, Elements, punit, punit.ID() = MachiningPipelineReport::GetDefaultCCAssemnlyUnit() ); |
| | | //æ¯å¦å±äºå¤§è¿è£
é
线DLåå
åº |
| | | // isdlassemnly := stockingpoint.ID().EndsWith( 'åå
åº' ) and ( stockingpoint.ID().StartsWith( 'DL' ) or stockingpoint.ID().StartsWith( '大è¿' ) );//unit.ID() = MachiningPipelineReport::GetDefaultDLAssemnlyUnit() or exists( parentunits, Elements, punit, punit.ID() = MachiningPipelineReport::GetDefaultDLAssemnlyUnit() ); |
| | | //æ¯å¦å±äºé¿æ¥æºå 产线 |
| | | isccproduction := stockingpoint.ID().EndsWith( '线边åº' ) and ( stockingpoint.ID().StartsWith( 'CC' ) or stockingpoint.ID().StartsWith( 'é¿æ¥' ) );//unit.ID() = MachiningPipelineReport::GetDefaultCCProductionUnit() or exists( parentunits, Elements, punit, punit.ID() = MachiningPipelineReport::GetDefaultCCProductionUnit() ); |
| | | //æ¯å¦å±äºå¤§è¿æºå 产线 |
| | | isdlproduction := unit.ID().EndsWith( 'MoMo' ) and unit.ID().StartsWith( 'DL' );//unit.ID() = MachiningPipelineReport::GetDefaultDLProductionUnit() or exists( parentunits, Elements, punit, punit.ID() = MachiningPipelineReport::GetDefaultDLProductionUnit() ); |
| | | if( iscc or isdl ){ |
| | | traverse( stockingpoint, ProductInStockingPoint_MP, pisp, pisp.Product_MP().IsLeaf() and not pisp.IsSystem() |
| | | traverse( stockingpoint, ProductInStockingPoint_MP, pisp, pisp.Product_MP().IsLeaf() and not pisp.IsSystem()// and pisp.ProductID() = '06K103011CM' |
| | | and exists( pisp.Product_MP().GetAllParent(), Elements, e, e.ID() = productparent ) |
| | | and exists( pisp, ProductInStockingPointInPeriod, pispip, not pispip.Period_MP().IsHistorical() and pispip.Period_MP().TimeUnit() = Translations::MP_GlobalParameters_Day() and ( pispip.NewSupplyQuantity() <> 0 or pispip.PlannedInventoryLevelEnd() <> 0 or pispip.DependentDemandAndSalesDemandQuantity() <> 0 ) ) ){ |
| | | isccassemnly := stockingpoint.ID().EndsWith( pisp.Product_MP().ParentID() + '线边åº' ) and ( stockingpoint.ID().StartsWith( 'CC' ) or stockingpoint.ID().StartsWith( 'é¿æ¥' ) ); |
| | | isdlassemnly := stockingpoint.ID().EndsWith( pisp.Product_MP().ParentID() ) and ( stockingpoint.ID().StartsWith( 'DL' ) or stockingpoint.ID().StartsWith( '大è¿' ) ); |
| | | pispips := selectsortedset( pisp, ProductInStockingPointInPeriod, pispip, not pispip.Period_MP().IsHistorical() |
| | | and pispip.Period_MP().TimeUnit() = Translations::MP_GlobalParameters_Day() and ( pispip.NewSupplyQuantity() <> 0 or pispip.PlannedInventoryLevelEnd() <> 0 or pispip.DependentDemandAndSalesDemandQuantity() <> 0 ), pispip.Start() ); |
| | | traverse( pispips, Elements, pispip ){ |
| | | traverse( pispips, Elements, pispip){//, pispip.Start().Month() = 1 and pispip.Start().Day() = 2 |
| | | products.Add( pisp.Product_MP() ); |
| | | |
| | | //天 |
| | |
| | | |
| | | row := table.GetRow( pisp.ProductID() ); |
| | | |
| | | //è£
é
线 |
| | | if( isccassemnly or isdlassemnly ){ |
| | | quantity := [Number]pispip.DependentDemandAndSalesDemandQuantity();//åèäºå
¥ |
| | | row.SetCellProductionValue( daycolumn, isccassemnly, [Real]quantity ); |
| | | row.SetCellProductionValue( weekcolumn, isccassemnly, [Real]quantity ); |
| | | } |
| | | |
| | | //æºå 线 |
| | | if( isccproduction or isdlproduction ){ |
| | | if( isccassemnly or isdlassemnly ){ |
| | | //è£
é
线 |
| | | quantity := [Number]pispip.DependentDemandAndSalesDemandQuantity();//åèäºå
¥ |
| | | row.SetAssemblyPlanValue( daycolumn, isccassemnly, [Real]quantity ); |
| | | row.SetAssemblyPlanValue( weekcolumn, isccassemnly, [Real]quantity ); |
| | | //ç产 |
| | | supplyqty := [Number]pispip.NewSupplyQuantity();//åèäºå
¥ |
| | | row.SetCellProductionValue( daycolumn, isccproduction, [Real]supplyqty ); |
| | | row.SetCellProductionValue( weekcolumn, isccproduction, [Real]supplyqty ); |
| | | // info( '****************', quantity, supplyqty ); |
| | | row.SetCellProductionValue( daycolumn, isccassemnly, [Real]supplyqty ); |
| | | row.SetCellProductionValue( weekcolumn, isccassemnly, [Real]supplyqty ); |
| | | } |
| | | |
| | | //åºå |
| | |
| | | Properties: |
| | | [ |
| | | Image: 'EXPORT1' |
| | | Label: '导å
¥' |
| | | Label: '导åº' |
| | | Taborder: 1 |
| | | ] |
| | | } |