lazhen
2024-08-15 5f8bcf34b598f40388661497c74c788b13b904dc
机加件管线报表周度bug
已添加2个文件
已修改3个文件
已删除1个文件
42 ■■■■■ 文件已修改
_Main/BL/Type_MachiningPipelineColumn0/Attribute_EndDate.qbl 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_MachiningPipelineColumn0/Attribute_Period.qbl 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_MachiningPipelineColumn0/Attribute_StartDate.qbl 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_MachiningPipelineReport/Method_GenerateColumn.qbl 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_MachiningPipelineReport/Method_GetColumnByUnit.qbl 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_MachiningPipelineSource0/StaticMethod_Initialize.qbl 13 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_MachiningPipelineColumn0/Attribute_EndDate.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,7 @@
Quintiq file version 2.0
#parent: #root
Attribute EndDate
{
  #keys: '3[415136.0.1004832687][415136.0.1004832686][415136.0.1004832688]'
  ValueType: Date
}
_Main/BL/Type_MachiningPipelineColumn0/Attribute_Period.qbl
ÎļþÒÑɾ³ý
_Main/BL/Type_MachiningPipelineColumn0/Attribute_StartDate.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,7 @@
Quintiq file version 2.0
#parent: #root
Attribute StartDate
{
  #keys: '3[415136.0.1004832677][415136.0.1004832676][415136.0.1004832678]'
  ValueType: Date
}
_Main/BL/Type_MachiningPipelineReport/Method_GenerateColumn.qbl
@@ -17,13 +17,13 @@
        periodtime          := period.StartDate();
        periodname          := periodtime.Format( "M2/D2/Y" );
        
        this.Column( relnew, Name := periodname, Period := periodtime, TimeUnit := Translations::MP_GlobalParameters_Day() );
        this.Column( relnew, Name := periodname, StartDate := periodtime, EndDate := periodtime, 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, Period := weekstart, TimeUnit := Translations::MP_GlobalParameters_Week() );
          this.Column( relnew, Name := weekperiodname, StartDate := weekstart, EndDate := ( weekstart + Duration::Days( 6 ) ).Date(), TimeUnit := Translations::MP_GlobalParameters_Week() );
          weekstart         := ( weekstart + Duration::Days( 7 ) ).Date();
        }
      }
_Main/BL/Type_MachiningPipelineReport/Method_GetColumnByUnit.qbl
@@ -8,9 +8,9 @@
  TextBody:
  [*
    // ç”„兰鸽 Aug-7-2024 (created)
    periodname := period.Format( "M2/D2/Y" );
    //periodname := period.Format( "M2/D2/Y" );
    
    column := selectobject( this, Column, column, column.Name() = periodname and column.Period() = period and column.TimeUnit() = unit );
    column := selectobject( this, Column, column, column.StartDate() <= period and column.EndDate() >= period and column.TimeUnit() = unit );
    
    return column;
  *]
_Main/BL/Type_MachiningPipelineSource0/StaticMethod_Initialize.qbl
@@ -48,7 +48,7 @@
          if( exists( productparents, Elements, e, e.ID() = productparent ) ){//查询产品类型是发动机
            row               := table.GetRow( pisp.ProductID() );
            products.Add( pisp.Product_MP() );
            weekstart         := owner.StartOfPlanning().Date();
    //        weekstart         := owner.StartOfPlanning().Date();
            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 ), pispip.Start() );
            
@@ -56,7 +56,7 @@
              //天
              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();//四舍五入
@@ -75,8 +75,9 @@
              //库存
              if( iscc or isdl ){
                row.SetCellInventoryValue( daycolumn, iscc, [Real]inventoryquantity );
                if( pispip.Start() = weekstart + Duration::Days( 6 ) or pispip.Period_MP() = endperiod ){
                  weekstart      := ( weekstart + Duration::Days( 7 ) ).Date();
                if( weekcolumn.EndDate() = pispip.Start().Date() or pispip.Period_MP() = endperiod ){
    //            if( pispip.Start() = weekstart + Duration::Days( 6 ) or pispip.Period_MP() = endperiod ){
    //              weekstart      := ( weekstart + Duration::Days( 7 ) ).Date();
                  row.SetCellInventoryValue( weekcolumn, iscc, [Real]inventoryquantity );
                }
              }
@@ -92,14 +93,14 @@
      traverse( table, Column, column ){
        cell := selectobject( row, Cell, cell, cell.Column() = column );
        if( column.TimeUnit() = Translations::MP_GlobalParameters_Day() ){
          tpcell := selectobject( tprow, TransferPlanCell, tpcell, tpcell.TransferPlanColumn().ColumnDate() = column.Period() );
          tpcell := selectobject( tprow, TransferPlanCell, tpcell, tpcell.TransferPlanColumn().ColumnDate() = column.StartDate() );
          if( tprow.SourceStockpoingPointID() = 'CC' and tprow.TargetStockpoingPointID() = 'DL' ){
            cell.CCTransferQty( [Real]tpcell.Value() );
          }else if( tprow.SourceStockpoingPointID() = 'DL' and tprow.TargetStockpoingPointID() = 'CC' ){
            cell.DLTransferQty( [Real]tpcell.Value() );
          }
        }else if( column.TimeUnit() = Translations::MP_GlobalParameters_Week() ){
          period := column.Period() + Duration::Days( 6 );
          period := column.StartDate() + Duration::Days( 6 );
          tpcell := selectobject( tprow, TransferPlanCell, tpcell, tpcell.TransferPlanColumn().ColumnDate() = period.Date() );
          
          if( tprow.SourceStockpoingPointID() = 'CC' and tprow.TargetStockpoingPointID() = 'DL' ){