_Main/BL/Type_FinancialProductionReport/Method_GetCurrentPeriod.qbl | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
_Main/BL/Type_FinancialProductionReport/Method_GetRowByUnit.qbl | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
_Main/BL/Type_FinancialProductionReport/StaticMethod_GetDefaultCCUnit.qbl | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
_Main/BL/Type_FinancialProductionReport/StaticMethod_GetDefaultDLUnit.qbl | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
_Main/BL/Type_FinancialProductionRow/Method_Initialize.qbl | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
_Main/BL/Type_FinancialProductionSource/StaticMethod_Initialize.qbl | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
_Main/BL/Type_InventorySummaryReport/StaticMethod_GetDefaultCCUnit.qbl | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 | |
_Main/BL/Type_InventorySummaryReport/StaticMethod_GetDefaultDLUnit.qbl | ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史 |
_Main/BL/Type_FinancialProductionReport/Method_GetCurrentPeriod.qbl
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,53 @@ Quintiq file version 2.0 #parent: #root Method GetCurrentPeriod ( Date startofplanning, Period_MPs periods ) as owning Period_MPs { Description: 'è·åå½åæç计å卿---------------åºå¼' TextBody: [* // çå °é¸½ Aug-2-2024 (created) //å¼å§æ¥æå°ä¸ä¸ªæçé´éå¤©æ° currentperiods := construct( Period_MPs ); startofnextmonth := startofplanning.StartOfNextMonth(); //ç¹æ®æ åµï¼å½å¼å§æ¥ææ£å¥½æ¯è¿ä¸ªæç¬¬ä¸å¤©ï¼ åç´æ¥ä½¿ç¨TimeUnit为æçæ°æ® if( startofplanning.StartOfMonth() = startofplanning ){ period := selectobject( periods, Elements, period, period.TimeUnit() = Translations::MP_GlobalParameters_Month() and period.StartDate() = startofplanning ); currentperiods.Add( period ); } else if( startofplanning.StartOfWeek() = startofplanning ){ //ç¹æ®æ åµï¼å½å¼å§æ¥ææ£å¥½æ¯è¿ä¸ªå¨ç¬¬ä¸å¤©ï¼ åç´æ¥ä½¿ç¨TimeUnit为å¨çæ°æ®ï¼ è·¨å¨æ¶ä½¿ç¨day traverse( periods, Elements, period, ( period.TimeUnit() = Translations::MP_GlobalParameters_Week() and period.StartDate() < startofnextmonth ) or ( period.TimeUnit() = Translations::MP_GlobalParameters_Day() and period.EndDate() = startofnextmonth ) ){ currentperiods.Add( period ); } } else { duration := startofplanning.StartOfNextMonth() - startofplanning; //å¦æè®¡åå¼å§æ¥æå°ä¸ä¸ªæå°äº7天ï¼åå¯ä»¥ç´æ¥ä½¿ç¨PeriodçTimeUnitä¸ºå¤©çæ°æ® if( duration <= 7 ){ i := 1; traverse( periods, Elements, period, period.TimeUnit() = Translations::MP_GlobalParameters_Day() and i < duration ){ currentperiods.Add( period ); i ++; } }else{ //åä¹éè¦å¨å ä¸PeriodçTimeUnit为å¨çæ°æ® day := startofplanning; while( day < startofnextmonth ){ if( day = day.StartOfWeek() ){ period := selectobject( periods, Elements, cperiod, cperiod.TimeUnit() = Translations::MP_GlobalParameters_Week() and cperiod.StartDate() = day ); day := period.EndDate(); currentperiods.Add( period ); } else { period := selectobject( periods, Elements, cperiod, cperiod.TimeUnit() = Translations::MP_GlobalParameters_Day() and cperiod.StartDate() = day ); day := period.EndDate(); currentperiods.Add( period ); } } } } return ¤tperiods; *] } _Main/BL/Type_FinancialProductionReport/Method_GetRowByUnit.qbl
¶Ô±ÈÐÂÎļþ @@ -0,0 +1,22 @@ Quintiq file version 2.0 #parent: #root Method GetRowByUnit ( String product, String unit ) as FinancialProductionRow { Description: 'æ ¹æ®å·¥åè·åè¡' TextBody: [* // çå °é¸½ Aug-2-2024 (created) row := selectobject( this, FinancialProductionRow, row, row.Name() = product and row.Unit() = unit ); if( isnull( row ) ){ //åå§ååå æ ¼ row := this.FinancialProductionRow( relnew, Name := product, Unit := unit ); traverse( this, FinancialProductionColumn, column ){ row.Initialize( column, unit ); } } return row; *] } _Main/BL/Type_FinancialProductionReport/StaticMethod_GetDefaultCCUnit.qbl
@@ -5,7 +5,7 @@ TextBody: [* // çå °é¸½ Jun-25-2024 (created) return 'é¿æ¥'; return 'é¿æ¥å·¥å'; //return 'Assembly Plant (France)'; *] } _Main/BL/Type_FinancialProductionReport/StaticMethod_GetDefaultDLUnit.qbl
@@ -5,7 +5,7 @@ TextBody: [* // çå °é¸½ Jun-25-2024 (created) return '大è¿'; return '大è¿å·¥å'; //return 'Assembly Plant (Spain)'; *] } _Main/BL/Type_FinancialProductionRow/Method_Initialize.qbl
@@ -2,7 +2,7 @@ #parent: #root Method Initialize ( FinancialProductionColumn column, Real quantity Number quantity ) { TextBody: @@ -10,7 +10,7 @@ // çå °é¸½ Jun-24-2024 (created) cell := selectobject( this, FinancialProductionCell, cell, cell.FinancialProductionColumn() = column ); value := [Real]cell.Value() + quantity; value := [Number]cell.Value() + quantity; cell.Value( [String]value ); *] } _Main/BL/Type_FinancialProductionSource/StaticMethod_Initialize.qbl
@@ -14,66 +14,54 @@ source := owner.FinancialProductionSource( relnew, IsImport := false, Name := FinancialProductionReport::GetDefaultName() ); table := source.FinancialProductionReport( relnew, ID := source.Name(), Name := source.Name(), IsImport := false ); showtable := source.FinancialProductionReport( relnew, ID := source.Name() + 'Show', Name := source.Name(), IsImport := false, IsShow := true ); startofplanning := owner.StartOfPlanning(); startofnextmonth := owner.StartOfPlanning().StartOfNextMonth(); startofyear := startofplanning.StartOfYear(); startofplanning := owner.StartOfPlanning().Date(); //startofnextmonth := startofplanning.StartOfNextMonth(); startofnextyear := startofplanning.StartOfNextYear(); search := source.FinancialProductionSearch( relnew, Unit := allunit, Generation := allunit, MqbMlb := allunit, Power := allunit ); products := construct( Product_MPs ); //éè¦çæ¥æåºé´ï¼ å¨å天çåªéè¦å½åæ //periods := selectset( owner, Period_MP, period, not period.IsHistorical() // and period.StartDate() < startofnextmonth // and period.TimeUnit() <> Translations::MP_GlobalParameters_Quarter() // ); //è·åå½åæéè¦çPeriod //currentperiods := table.GetCurrentPeriod( startofplanning, periods ); table.GenerateColumn( owner ); traverse( owner, Product_MP.ProductInStockingPoint_MP, pisp, pisp.Product_MP().IsLeaf() and not isnull( pisp.StockingPoint_MP() ) and ( pisp.StockingPoint_MP().UnitID() = ccunit or pisp.StockingPoint_MP().UnitID() = dlunit ) ){ unit := pisp.StockingPoint_MP().UnitID(); info( unit, pisp.ProductID() ); ccrow := null( FinancialProductionRow ); dlrow := null( FinancialProductionRow ); allrow := selectobject( table, FinancialProductionRow, row, row.Name() = pisp.ProductID() and row.Unit() = allunit ); if( unit = ccunit ){ ccrow := table.FinancialProductionRow( relnew, Name := pisp.ProductID(), Unit := unit ); }else{ dlrow := table.FinancialProductionRow( relnew, Name := pisp.ProductID(), Unit := unit ); } if( isnull( allrow ) ){ products.Add( pisp.Product_MP() ); allrow := table.FinancialProductionRow( relnew, Name := pisp.ProductID(), Unit := allunit ); } for( start := startofyear; start < startofnextyear; start := start.StartOfNextMonth() ){ periodtime := start.Date(); periodname := periodtime.Format( "M2/D2/Y" ); column := selectobject( table, FinancialProductionColumn, column, column.Name() = periodname and column.Period() = periodtime ); if( not isnull( ccrow ) ){ ccrow.Initialize( column, ccunit ); //åå½åçæ¬çproduct planningénew supplyåæ®µï¼å大è¿åé¿æ¥å·¥åç产线ï¼è¿è¡å æ» traverse( owner, StockingPoint_MP, stockingpoint ){ unit := stockingpoint.Unit(); parentunits := unit.GetAllParent(); //æ¯å¦å±äºé¿æ¥å·¥å iscc := unit.ID() = ccunit or exists( parentunits, Elements, punit, punit.ID() = ccunit ); //æ¯å¦å±äºå¤§è¿å·¥å isdl := unit.ID() = dlunit or exists( parentunits, Elements, punit, punit.ID() = dlunit ); if( iscc or isdl ){ traverse( stockingpoint, ProductInStockingPoint_MP, pisp, pisp.Product_MP().IsLeaf() ){ //è·åå·¥åè¡ factoryrow := table.GetRowByUnit( pisp.ProductID(), ifexpr( iscc, ccunit, dlunit ) ); //è·ååè®¡è¡ allrow := table.GetRowByUnit( pisp.ProductID(), allunit ); products.Add( pisp.Product_MP() ); //å½product planningçæ¥æåºé´å¨éè¦çæ¥æåºé´å traverse( pisp, ProductInStockingPointInPeriod, pispip, not pispip.Period_MP().IsHistorical() and pispip.Period_MP().StartDate() < startofnextyear // and ( ( pispip.Period_MP().StartDate().StartOfMonth() = startofplanning.StartOfMonth() and currentperiods.Find( pispip.Period_MP() ) >= 0 ) // or ( pispip.Period_MP().TimeUnit() = Translations::MP_GlobalParameters_Month() and pispip.Period_MP().StartDate() < startofnextyear ) ) ){ periodtime := pispip.Start().StartOfMonth().Date(); periodname := periodtime.Format( "M2/D2/Y" ); quantity := ceil( pispip.NewSupplyQuantity() );//åä¸åæ´ column := selectobject( table, FinancialProductionColumn, column, column.Name() = periodname and column.Period() = periodtime ); factoryrow.Initialize( column, quantity ); allrow.Initialize( column, quantity ); } } if( not isnull( dlrow ) ){ dlrow.Initialize( column, dlunit ); } if( not exists( allrow, FinancialProductionCell, allcell, allcell.FinancialProductionColumn() = column ) ){ allrow.Initialize( column, allunit ); } } traverse( pisp, ProductInStockingPointInPeriod, pispip, pispip.Start() >= startofplanning and ( ( pispip.Start() < startofnextmonth and pispip.Period_MP().TimeUnit() = Translations::MP_GlobalParameters_Day() ) or ( pispip.Start() < startofnextyear and pispip.Period_MP().TimeUnit() = Translations::MP_GlobalParameters_Month() ) ) ){ periodtime := pispip.Start().StartOfMonth().Date(); periodname := periodtime.Format( "M2/D2/Y" ); column := selectobject( table, FinancialProductionColumn, column, column.Name() = periodname and column.Period() = periodtime ); if( not isnull( ccrow ) ){ ccrow.Initialize( column, pispip.NewSupplyProductionQuantity() ); } if( not isnull( dlrow ) ){ dlrow.Initialize( column, pispip.NewSupplyProductionQuantity() ); } allrow.Initialize( column, pispip.NewSupplyProductionQuantity() ); } } rows := selectsortedset( table, FinancialProductionRow, row, row.Name() ); i := 0; traverse( rows, Elements, e ){ _Main/BL/Type_InventorySummaryReport/StaticMethod_GetDefaultCCUnit.qbl
@@ -5,7 +5,7 @@ TextBody: [* // çå °é¸½ Jun-28-2024 (created) return 'é¿æ¥'; return 'é¿æ¥å·¥ç¨'; //return 'Assembly Plant (France)'; *] } _Main/BL/Type_InventorySummaryReport/StaticMethod_GetDefaultDLUnit.qbl
@@ -5,7 +5,7 @@ TextBody: [* // çå °é¸½ Jun-28-2024 (created) return '大è¿'; return '大è¿å·¥å'; //return 'Assembly Plant (Spain)'; *] }