lazhen
2024-09-26 f9d10cc34dbb1aa029cb3304c2c1f2c4de328d08
财务产量报表数据误差处理
已添加1个文件
已修改5个文件
45 ■■■■■ 文件已修改
_Main/BL/Type_FinancialProductionCell/Attribute_Quantity.qbl 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_FinancialProductionReport/Method_Generate.qbl 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_FinancialProductionRow/Method_Initialize#110.qbl 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_FinancialProductionRow/Method_Initialize.qbl 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_FinancialProductionSource/Method_AfterImport.qbl 8 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_FinancialProductionSource/StaticMethod_Initialize.qbl 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_FinancialProductionCell/Attribute_Quantity.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,8 @@
Quintiq file version 2.0
#parent: #root
Attribute Quantity
{
  #keys: '3[415136.0.1167140019][415136.0.1167140018][415136.0.1167140020]'
  Description: '数量'
  ValueType: Real
}
_Main/BL/Type_FinancialProductionReport/Method_Generate.qbl
@@ -29,16 +29,22 @@
          
          sumcell  := selectobject( column, FinancialProductionCell, c, c.FinancialProductionRow() = sumrow );
          if( isnull( sumcell ) ){
            sumcell := column.FinancialProductionCell( relnew, Value := '0' );
            sumcell := column.FinancialProductionCell( relnew, Quantity := 0 );
            sumrow.FinancialProductionCell( relinsert, sumcell );
          }
          
          showcell := column.FinancialProductionCell( relnew, Value := cell.Value() );
          showcell := column.FinancialProductionCell( relnew, Quantity := cell.Quantity() );
          showrow.FinancialProductionCell( relinsert, showcell );
          value := [Real]cell.Value() + [Real]sumcell.Value();
          sumcell.Value( [String]value );
        }
      }
    }
    traverse( this, FinancialProductionRow, row ){
      traverse( row, FinancialProductionCell, cell ){
        cell.Value( [String]([Number]cell.Quantity()) );
      }
    }
  *]
}
_Main/BL/Type_FinancialProductionRow/Method_Initialize#110.qbl
@@ -10,7 +10,7 @@
  TextBody:
  [*
    // ç”„兰鸽 Jun-24-2024 (created)
    cell := column.FinancialProductionCell( relnew, Value := '' );
    cell := column.FinancialProductionCell( relnew, Quantity := 0 );
    
    this.FinancialProductionCell( relinsert, cell );
    if( unit <> FinancialProductionReport::GetDefaultAllUnit() ){
_Main/BL/Type_FinancialProductionRow/Method_Initialize.qbl
@@ -2,7 +2,7 @@
#parent: #root
Method Initialize (
  FinancialProductionColumn column,
  Number quantity
  Real quantity
)
{
  TextBody:
@@ -10,7 +10,8 @@
    // ç”„兰鸽 Jun-24-2024 (created)
    cell := selectobject( this, FinancialProductionCell, cell, cell.FinancialProductionColumn() = column );
          
    value := [Number]cell.Value() + quantity;
    cell.Value( [String]value );
    //value := [Number]cell.Value() + quantity;
    //cell.Value( [String]value );
    cell.Quantity( cell.Quantity() + quantity );
  *]
}
_Main/BL/Type_FinancialProductionSource/Method_AfterImport.qbl
@@ -28,11 +28,13 @@
          allcell  := selectobject( allrow, FinancialProductionCell, allcell, allcell.FinancialProductionColumn().Name() = column.Name() );
    //      info( isnull( unitcell ), isnull( allcell ), cell.Value(), unitcell.Value(), allcell.Value() );
          if( not isnull( unitcell ) ){
            unitcell.Value( cell.Value() );
    //        unitcell.Value( cell.Value() );
            unitcell.Quantity( [Real]cell.Value() );
          }
          if( not isnull( allcell ) ){
            value := [Real]cell.Value() + [Real]allcell.Value();
            allcell.Value( [String]value );
    //        value := [Real]cell.Value() + [Real]allcell.Value();
    //        allcell.Value( [String]value );
            allcell.Quantity( allcell.Quantity() + [Real]allcell.Value() );
          }
        }
      }
_Main/BL/Type_FinancialProductionSource/StaticMethod_Initialize.qbl
@@ -36,7 +36,7 @@
    table.GenerateColumn( owner );
    //取当前版本的product planning里new supply字段,分大连和长春工厂的产线,进行加总
    //traverse( owner, StockingPoint_MP, stockingpoint ){
    traverse( owner, StockingPoint_MP, stockingpoint, stockingpoint.ID().EndsWith( '厂内库' ) ){
    traverse( owner, StockingPoint_MP, stockingpoint, stockingpoint.ID().EndsWith( '厂内库' ) or stockingpoint.ID() = '大连外租库' ){
      iscc                    := stockingpoint.ID().StartsWith( 'CC' ) or stockingpoint.ID().StartsWith( '长春' );
      isdl                    := stockingpoint.ID().StartsWith( 'DL' ) or stockingpoint.ID().StartsWith( '大连' );
    //  unit                    := stockingpoint.Unit();
@@ -59,12 +59,12 @@
            dayperiodname     := dayperiodtime.Format( "M2/D2/Y" );
            periodtime        := pispip.Start().StartOfMonth().Date();
            periodname        := periodtime.Format( "M2/D2/Y" );
            quantity          := [Number]pispip.NewSupplyQuantity();//四舍五入
    //        quantity          := [Number]pispip.NewSupplyQuantity();//四舍五入
            daycolumn         := selectobject( table, FinancialProductionColumn, column, column.Name() = dayperiodname and column.Period() = dayperiodtime and column.IsDay() );
            column            := selectobject( table, FinancialProductionColumn, column, column.Name() = periodname and column.Period() = periodtime and not column.IsDay() );
            factoryrow.Initialize( daycolumn, quantity );
            factoryrow.Initialize( column, quantity );
            allrow.Initialize( column, quantity );
            factoryrow.Initialize( daycolumn, pispip.NewSupplyQuantity() );
            factoryrow.Initialize( column, pispip.NewSupplyQuantity() );
            allrow.Initialize( column, pispip.NewSupplyQuantity() );
          }    
        }
      }