lazhen
2024-08-15 fe28d603a518b0561ab684570e71c0d2811329ab
发动机管线报表bug
已修改10个文件
已添加2个文件
已删除1个文件
63 ■■■■■ 文件已修改
_Main/BL/Type_CCEngineLogisticsCostReport0/StaticMethod_Initialize.qbl 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_EnginePipelineColumn/Attribute_EndDate.qbl 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_EnginePipelineColumn/Attribute_Period.qbl 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_EnginePipelineColumn/Attribute_StartDate.qbl 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_EnginePipelineReport/Method_Generate.qbl 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_EnginePipelineReport/Method_GenerateColumn.qbl 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_EnginePipelineReport/Method_GetColumnByUnit.qbl 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_EnginePipelineRow/Method_SetCellDemandValue.qbl 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_EnginePipelineRow/Method_SetCellProductionValue.qbl 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_EnginePipelineSource/StaticMethod_Initialize.qbl 14 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_FinancialSalesSource/StaticMethod_Initialize.qbl 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_MachiningPipelineReport/StaticMethod_GetDefaultCCProductionUnit.qbl 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_MachiningPipelineReport/StaticMethod_GetDefaultDLProductionUnit.qbl 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_CCEngineLogisticsCostReport0/StaticMethod_Initialize.qbl
@@ -171,7 +171,7 @@
      }
    }
    //长春短途运输费用:客户需求数量/包装容量/装载容量*运输单价,客户需求数量取自forecast里sales segment为长春的数量汇总,再用公式计算,月度进行汇总(取客户需求数量换算成车次)
    traverse( owner, SalesDemand.astype( Forecast ), forecast, forecast.StartDate() < startofnextyear ){
    traverse( owner, SalesDemand.astype( Forecast ), forecast, not isnull( forecast.SalesSegment_MP() ) and forecast.StartDate() < startofnextyear ){
      salessegment            := forecast.SalesSegment_MP();
      parentsalessegments     := salessegment.GetAllParent();
      //是否属于长春
_Main/BL/Type_EnginePipelineColumn/Attribute_EndDate.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,8 @@
Quintiq file version 2.0
#parent: #root
Attribute EndDate
{
  #keys: '3[415136.0.999760039][415136.0.999760038][415136.0.999760040]'
  Description: '结束日期'
  ValueType: Date
}
_Main/BL/Type_EnginePipelineColumn/Attribute_Period.qbl
ÎļþÒÑɾ³ý
_Main/BL/Type_EnginePipelineColumn/Attribute_StartDate.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,8 @@
Quintiq file version 2.0
#parent: #root
Attribute StartDate
{
  #keys: '3[415136.0.999760029][415136.0.999760028][415136.0.999760030]'
  Description: '开始日期'
  ValueType: Date
}
_Main/BL/Type_EnginePipelineReport/Method_Generate.qbl
@@ -132,7 +132,7 @@
          }
    
          for( demandr := showrowdemand.RowNr() + 1; demandr < showrowinventory.RowNr(); demandr := demandr + 1 ){
            demandrow              := selectobject( this, Row, r, r.RowNr() = demandr );
            demandrow              := selectobject( this, Row, r, r.RowNr() = demandr and r.Name() = row.Name() );
            if( not isnull( demandrow ) and not exists( demandrow, CellValue, cv, cv.Column() = column ) ){
              demandcell           := column.CellValue( relnew, Value := '' );
              demandrow.CellValue( relinsert, demandcell );
@@ -155,7 +155,7 @@
    }
    traverse( this, Column, column ){
      for( demandr := sumrowdemand.RowNr() + 1; demandr < sumrowinventory.RowNr(); demandr := demandr + 1 ){
        demandrow              := selectobject( this, Row, r, r.RowNr() = demandr );
        demandrow              := selectobject( this, Row, r, r.RowNr() = demandr and r.Name() = 'SUM' );
    //    info( '------------------14----------------' );
        if( not isnull( demandrow ) and not exists( demandrow, CellValue, cv, cv.Column() = column ) ){
          demandcell           := column.CellValue( relnew, Value := '' );
_Main/BL/Type_EnginePipelineReport/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_EnginePipelineReport/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_EnginePipelineRow/Method_SetCellDemandValue.qbl
@@ -11,10 +11,10 @@
    // ç”„兰鸽 Jun-24-2024 (created)
    cell := selectobject( this, Cell, cell, cell.Column() = column );
    
    demand := selectobject( cell, Demand, demand, demand.EngineType() = cell.Row().Name() and demand.Model() = segment and demand.Period() = column.Period() );
    demand := selectobject( cell, Demand, demand, demand.EngineType() = cell.Row().Name() and demand.Model() = segment and demand.Period() = column.StartDate() );
    
    if( isnull( demand ) ){
      demand := cell.Demand( relnew, EngineType := cell.Row().Name(), Period := column.Period(), Model := segment, Quantity := 0 );
      demand := cell.Demand( relnew, EngineType := cell.Row().Name(), Period := column.StartDate(), Model := segment, Quantity := 0 );
    }
    
    demand.Quantity( demand.Quantity() + quantity );
_Main/BL/Type_EnginePipelineRow/Method_SetCellProductionValue.qbl
@@ -14,7 +14,7 @@
    production := cell.Production();
    
    if( isnull( production ) ){
      production := cell.Production( relnew, EngineType := cell.Row().Name(), Period := column.Period(), DLProduction := 0, CCProduction := 0 );
      production := cell.Production( relnew, EngineType := cell.Row().Name(), Period := column.StartDate(), DLProduction := 0, CCProduction := 0 );
    }
    
    if( isccunit ){
_Main/BL/Type_EnginePipelineSource/StaticMethod_Initialize.qbl
@@ -47,7 +47,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();//四舍五入
          //产量是加总
@@ -68,16 +68,16 @@
    }
    
    //生成需求数据
    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() );
@@ -85,9 +85,9 @@
        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();
    //    }
      }
    }
    
_Main/BL/Type_FinancialSalesSource/StaticMethod_Initialize.qbl
@@ -32,7 +32,7 @@
    table.GenerateColumn( owner );
    
    //首先在forecast界面查找sales segment为长春的所有需求,识别出MLB的所有产品,每个产品按月汇总需求数量
    traverse( owner, SalesDemand.astype( Forecast ), forecast, forecast.StartDate() < startofnextyear and forecast.Quantity() <> 0
    traverse( owner, SalesDemand.astype( Forecast ), forecast, not isnull( forecast.SalesSegment_MP() ) and forecast.StartDate() < startofnextyear and forecast.Quantity() <> 0
              and exists( forecast, PlanningSalesDemandInPeriod, psdip, psdip.Quantity() <> 0 ) ){
      salessegment            := forecast.SalesSegment_MP();
      parentsalessegments     := salessegment.GetAllParent();
_Main/BL/Type_MachiningPipelineReport/StaticMethod_GetDefaultCCProductionUnit.qbl
@@ -5,7 +5,7 @@
  TextBody:
  [*
    // ç”„兰鸽 Jun-25-2024 (created)
    return '长春机加产线';
    return '长春机加线';
    //return 'Assembly Plant (France)';
  *]
}
_Main/BL/Type_MachiningPipelineReport/StaticMethod_GetDefaultDLProductionUnit.qbl
@@ -5,7 +5,7 @@
  TextBody:
  [*
    // ç”„兰鸽 Jun-25-2024 (created)
    return '大连机加产线';
    return '大连机加线';
    //return 'Assembly Plant (Spain)';
  *]
}