lazhen
2024-09-27 d65ca044060c02ed74022a273429ee741f61e1f0
长春周报报表数据bug
已修改7个文件
51 ■■■■ 文件已修改
_Main/BL/Type_FinancialProductionReport/Method_Generate.qbl 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_FinancialSalesSource/StaticMethod_Download.qbl 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_FinancialWeeklyReport/StaticMethod_GetDefaultCCUnit.qbl 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_FinancialWeeklyReport/StaticMethod_GetDefaultDLUnit.qbl 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_FinancialWeeklyReport/StaticMethod_Initialize.qbl 18 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_InventorySummarySource/StaticMethod_Initialize.qbl 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_MachiningPipelineSource0/StaticMethod_Initialize.qbl 20 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_FinancialProductionReport/Method_Generate.qbl
@@ -35,8 +35,8 @@
          
          showcell := column.FinancialProductionCell( relnew, Quantity := cell.Quantity() );
          showrow.FinancialProductionCell( relinsert, showcell );
          value := [Real]cell.Value() + [Real]sumcell.Value();
          sumcell.Value( [String]value );
    //      value := [Real]cell.Value() + [Real]sumcell.Value();
          sumcell.Quantity( sumcell.Quantity() + cell.Quantity() );
        }
      }
    }
_Main/BL/Type_FinancialSalesSource/StaticMethod_Download.qbl
@@ -34,7 +34,7 @@
    tableElement.AppendChild( productcolumnelement ); 
    tableElement.AppendChild( unitcolumnelement ); 
    minindex        := min( table, FinancialSalesColumn, column, not column.IsDay(), column.Index() );
    traverse ( table, FinancialSalesColumn, column ) {
    traverse ( table, FinancialSalesColumn, column, not column.IsDay() ) {
      columnelement := xmlDOM.CreateElement( "column" );
      nameelement   := xmlDOM.CreateElement( "name" );
      typeelement   := xmlDOM.CreateElement( "type" );
_Main/BL/Type_FinancialWeeklyReport/StaticMethod_GetDefaultCCUnit.qbl
@@ -5,7 +5,8 @@
  TextBody:
  [*
    // 甄兰鸽 Jun-28-2024 (created)
    return '长春工厂';
    //return '长春工厂';
    return 'VWED CC';
    //return 'Assembly Plant (France)';
  *]
}
_Main/BL/Type_FinancialWeeklyReport/StaticMethod_GetDefaultDLUnit.qbl
@@ -5,7 +5,8 @@
  TextBody:
  [*
    // 甄兰鸽 Jun-28-2024 (created)
    return '大连工厂';
    //return '大连工厂';
    return 'VWED DL';
    //return 'Assembly Plant (Spain)';
  *]
}
_Main/BL/Type_FinancialWeeklyReport/StaticMethod_Initialize.qbl
@@ -44,38 +44,38 @@
    ccsvaluecumulant          := [Real]0;
    
    traverse( table, FinancialWeeklyColumn, column ){
      productioncolumn      := selectobject( productiontable, FinancialProductionColumn, pcolumn, pcolumn.Name() = column.Name() and pcolumn.Period() = column.Period() );
      salescolumn           := selectobject( salestable, FinancialSalesColumn, scolumn, scolumn.Name() = column.Name() and scolumn.Period() = column.Period() );
      productioncolumn      := selectobject( productiontable, FinancialProductionColumn, pcolumn, pcolumn.Name() = column.Name() and pcolumn.Period() = column.Period() and not pcolumn.IsDay() );
      salescolumn           := selectobject( salestable, FinancialSalesColumn, scolumn, scolumn.Name() = column.Name() and scolumn.Period() = column.Period() and not scolumn.IsDay() );
      
      //产量汇总
      totalpvalue           := [Real]0;
      dlpvalue              := [Real]0;
      ccpvalue              := [Real]0;
      traverse( productioncolumn, FinancialProductionCell, cell, [Real]cell.Value() > 0 ){
      traverse( productioncolumn, FinancialProductionCell, cell, cell.Quantity() > 0 ){
        unit                := cell.FinancialProductionRow().Unit();
        
        if( unit = allunit ){
          totalpvalue       := totalpvalue + [Real]cell.Value();
          totalpvalue       := totalpvalue + cell.Quantity();
          if( column.Period() = startofplanning.StartOfMonth().Date() ){
            totalpvaluecumulant := totalpvaluecumulant - cell.PlanValue();
          }
        }else if( unit = dlunit ){
          dlpvalue          := dlpvalue + [Real]cell.Value();
          dlpvalue          := dlpvalue + cell.Quantity();
          if( column.Period() = startofplanning.StartOfMonth().Date() ){
            dlpvaluecumulant := dlpvaluecumulant - cell.PlanValue();
          }
        }else if( unit = ccunit ){
          ccpvalue          := ccpvalue + [Real]cell.Value();
          ccpvalue          := ccpvalue + cell.Quantity();
          if( column.Period() = startofplanning.StartOfMonth().Date() ){
            ccpvaluecumulant := ccpvaluecumulant - cell.PlanValue();
          }
        }
      }
      totalpcell            := column.FinancialWeeklyCell( relnew, Value := [String]totalpvalue );
      totalpcell            := column.FinancialWeeklyCell( relnew, Value := [String]( [Number]totalpvalue ) );
      totalproduction.FinancialWeeklyCell( relinsert, totalpcell );
      dlpcell               := column.FinancialWeeklyCell( relnew, Value := [String]dlpvalue );
      dlpcell               := column.FinancialWeeklyCell( relnew, Value := [String]( [Number]dlpvalue ) );
      dlproduction.FinancialWeeklyCell( relinsert, dlpcell );
      ccpcell               := column.FinancialWeeklyCell( relnew, Value := [String]ccpvalue );
      ccpcell               := column.FinancialWeeklyCell( relnew, Value := [String]( [Number]ccpvalue ) );
      ccproduction.FinancialWeeklyCell( relinsert, ccpcell );
      
      //销量汇总
_Main/BL/Type_InventorySummarySource/StaticMethod_Initialize.qbl
@@ -59,6 +59,7 @@
                                                  and pispip.Period_MP().TimeUnit() = Translations::MP_GlobalParameters_Day(), pispip.Start() );
    
          traverse( pispips, Elements, pispip ){
            products.Add( pisp.Product_MP() );
            period            := pispip.Period_MP();
            periodtime        := period.Start().Date();
            periodname        := periodtime.Format( "M2/D2/Y" );
_Main/BL/Type_MachiningPipelineSource0/StaticMethod_Initialize.qbl
@@ -95,17 +95,17 @@
      productparents        := product.GetAllParent();
      if( exists( productparents, Elements, e, e.ID() = productparent ) ){//查询产品类型是发动机
        //起始库存点是否是大连or长春
        originsp              := selectobject( owner, StockingPoint_MP, sp, sp.ID() = tprow.SourceStockpoingPointID() );
        originunit            := originsp.Unit();
        originparentunits     := originunit.GetAllParent();
        originiscc            := originsp.ID() = ccunit or originunit.ID() = ccunit or exists( originparentunits, Elements, punit, punit.ID() = ccunit );
        originisdl            := originsp.ID() = dlunit or originunit.ID() = dlunit or exists( originparentunits, Elements, punit, punit.ID() = dlunit );
    //    originsp              := selectobject( owner, StockingPoint_MP, sp, sp.ID() = tprow.SourceStockpoingPointID() );
    //    originunit            := originsp.Unit();
    //    originparentunits     := originunit.GetAllParent();
        originiscc            := tprow.SourceStockpoingPointID() = 'CC';//originsp.ID() = ccunit or originunit.ID() = ccunit or exists( originparentunits, Elements, punit, punit.ID() = ccunit );
        originisdl            := tprow.SourceStockpoingPointID() = 'DL';//originsp.ID() = dlunit or originunit.ID() = dlunit or exists( originparentunits, Elements, punit, punit.ID() = dlunit );
        //目的地是否是长春外租库
        destisp               := selectobject( owner, StockingPoint_MP, sp, sp.ID() = tprow.TargetStockpoingPointID() );
        destiunit             := destisp.Unit();
        destiparentunits      := destiunit.GetAllParent();
        destiiscc             := destisp.ID() = ccunit or destiunit.ID() = ccunit or exists( destiparentunits, Elements, punit, punit.ID() = ccunit );
        destiisdl             := destisp.ID() = dlunit or destiunit.ID() = dlunit or exists( destiparentunits, Elements, punit, punit.ID() = dlunit );
    //    destisp               := selectobject( owner, StockingPoint_MP, sp, sp.ID() = tprow.TargetStockpoingPointID() );
    //    destiunit             := destisp.Unit();
    //    destiparentunits      := destiunit.GetAllParent();
        destiiscc             := tprow.TargetStockpoingPointID() = 'CC';//destisp.ID() = ccunit or destiunit.ID() = ccunit or exists( destiparentunits, Elements, punit, punit.ID() = ccunit );
        destiisdl             := tprow.TargetStockpoingPointID() = 'DL';//destisp.ID() = dlunit or destiunit.ID() = dlunit or exists( destiparentunits, Elements, punit, punit.ID() = dlunit );
        if( ( originiscc and destiisdl ) or ( originisdl and destiiscc ) ){
          row := table.GetRow( tprow.ProductID() );
          traverse( tprow, TransferPlanCell, tpcell, tpcell.TransferPlanColumn().ColumnDate() <> Date::MinDate() ){