lazhen
2024-10-21 b02a3586a97064c94087c0e3ca2eac36cd9d9b42
库存汇总报表导出格式修改
已修改14个文件
已添加7个文件
已删除6个文件
680 ■■■■ 文件已修改
_Main/BL/Type_FinancialProductionReport/Method_GenerateShow.qbl 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_FinancialProductionRow/Attribute_Factory.qbl 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_FinancialProductionSource/StaticMethod_Download.qbl 124 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_FinancialSalesReport/Method_Generate.qbl 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_FinancialSalesReport/Method_GenerateShow.qbl 23 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_FinancialSalesRow/Attribute_Factory.qbl 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_FinancialSalesRow/DefaultValue_Factory.qbl 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_FinancialSalesSource/StaticMethod_Download.qbl 133 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_InventorySummaryColumn/Method_GenerateCell.qbl 10 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_InventorySummaryReport/Method_GenerateShow#925.qbl 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_InventorySummaryReport/Method_GetRow.qbl 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_InventorySummarySource/StaticMethod_CreateCellElement0.qbl 19 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_InventorySummarySource/StaticMethod_CreateColumnElement#822.qbl 24 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_InventorySummarySource/StaticMethod_CreateColumnElement.qbl 26 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_InventorySummarySource/StaticMethod_CreateColumnElement0.qbl 21 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_InventorySummarySource/StaticMethod_Download.qbl 93 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_InventorySummarySource/StaticMethod_Download0.qbl 104 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_InventorySummarySource/StaticMethod_GetSearchRows.qbl 22 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_InventorySummarySource/StaticMethod_Initialize.qbl 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_InventroySummaryRow/Attribute_Factory.qbl 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_InventroySummaryRow/Attribute_Generation.qbl 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_InventroySummaryRow/Attribute_MLBMQB.qbl 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_InventroySummaryRow/Attribute_Power.qbl 7 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormFinancialProductionReport/Response_PanelExport_369_ButtonExport696_OnClick.def 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormFinancialSalesReport/Component_PanelLeft.def 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormFinancialSalesReport/Response_PanelExport_ButtonExport570_OnClick.def 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/UI/MacroPlannerWebApp/Component_FormInventorySummaryReport/Response_PanelExport_ButtonSummaryExport_OnClick.def 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_FinancialProductionReport/Method_GenerateShow.qbl
@@ -11,7 +11,7 @@
    // ç”„兰鸽 Oct-12-2024 (created)
    //年汇总
    yearcolumn                := this.FinancialProductionColumn( relnew, Name := '汇总', Period := this.FinancialProductionSource().MacroPlan().StartOfPlanning().StartOfNextYear().Date() );
    sumrow                    := this.FinancialProductionRow( relnew, Name := factory.Format( 'S(Len(10))' ).Concat( 'SUM' ), Unit := factory );
    sumrow                    := this.FinancialProductionRow( relnew, Name := factory.Format( 'S(Len(10))' ).Concat( 'SUM' ), Factory := factory );
    sumyearcell               := yearcolumn.FinancialProductionCell( relnew, Quantity := 0 );
    sumrow.FinancialProductionCell( relinsert, sumyearcell );
    traverse( table, FinancialProductionRow, row, row.Unit() = factory ){
@@ -19,7 +19,8 @@
      productid.Add( row.Name() );
        
      if( productids.ContainsAll( productid ) ){
        showrow               := this.FinancialProductionRow( relnew, Name := factory.Format( 'S(Len(10))' ).Concat( row.Name() ), Unit := row.Unit() );
        showrow               := this.FinancialProductionRow( relnew, Name := factory.Format( 'S(Len(10))' ).Concat( row.Name() ), Unit := row.Unit(), Factory := factory );
        row.Product_MP().FinancialProductionRow( relinsert, showrow );
        yearcell              := yearcolumn.FinancialProductionCell( relnew, Quantity := 0 );
        showrow.FinancialProductionCell( relinsert, yearcell );
        traverse( row, FinancialProductionCell, cell, not cell.FinancialProductionColumn().IsDay() ){
_Main/BL/Type_FinancialProductionRow/Attribute_Factory.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,7 @@
Quintiq file version 2.0
#parent: #root
Attribute Factory
{
  #keys: '3[415136.0.1226310164][415136.0.1226310163][415136.0.1226310165]'
  ValueType: String
}
_Main/BL/Type_FinancialProductionSource/StaticMethod_Download.qbl
@@ -1,11 +1,7 @@
Quintiq file version 2.0
#parent: #root
StaticMethod Download (
  MacroPlan macroPlan,
  Factorys factorys,
  ProductGenerations generations,
  ProductPowers powers,
  ProductMLBMQBs mlbmqls
  MacroPlan macroPlan
) as BinaryValue
{
  Description: '下载财务报表数据'
@@ -18,116 +14,42 @@
    xmlDOM                        := xmlDOMI.CreateDocumentFromString( '<?xml version="1.0" encoding="UTF-16"?><table><name>' + table.Name() + '</name></table>' );
    
    tableElement                  := xmlDOM.GetElementByTagName( "table", 0 );
    //Search
    searchcolumnelement           := xmlDOM.CreateElement( "column" );
    searchnameelement             := xmlDOM.CreateElement( "name" );
    searchtypeelement             := xmlDOM.CreateElement( "type" );
    searchnameelement.TextContent( 'Search' );
    searchtypeelement.TextContent( "String" );
    searchcolumnelement.AppendChild( searchnameelement );
    searchcolumnelement.AppendChild( searchtypeelement );
    //Factory
    searchunitcolumn              := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, 'Unit' );
    //Generation
    generationcolumn              := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, 'Generation' );
    //Power
    powercolumn                   := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, 'Power' );
    //MLBMQBS
    mlbmqbcolumn                  := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, 'MLBMQB' );
    //Product
    productcolumnelement          := xmlDOM.CreateElement( "column" );
    productnameelement            := xmlDOM.CreateElement( "name" );
    producttypeelement            := xmlDOM.CreateElement( "type" );
    productnameelement.TextContent( 'Product' );
    producttypeelement.TextContent( "String" );
    productcolumnelement.AppendChild( productnameelement );
    productcolumnelement.AppendChild( producttypeelement );
    productcolumnelement          := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, 'Product' );
    //Unit
    unitcolumnelement             := xmlDOM.CreateElement( "column" );
    unitnameelement               := xmlDOM.CreateElement( "name" );
    unittypeelement               := xmlDOM.CreateElement( "type" );
    unitnameelement.TextContent( 'Unit' );
    unittypeelement.TextContent( "String" );
    unitcolumnelement.AppendChild( unitnameelement );
    unitcolumnelement.AppendChild( unittypeelement );
    tableElement.AppendChild( searchcolumnelement );
    tableElement.AppendChild( productcolumnelement );
    tableElement.AppendChild( unitcolumnelement );
    searchtotal                   := factorys.Size() + generations.Size() + powers.Size() + mlbmqls.Size() + 4 ;
    searchunitElement             := xmlDOM.CreateElement( "cell" );
    searchunitElement.SetAttribute( "value", 'Unit' );
    searchcolumnelement.AppendChild( searchunitElement );
    traverse( factorys, Elements, factory ){
      searchunitcellElement       := xmlDOM.CreateElement( "cell" );
      searchunitcellElement.SetAttribute( "value", factory.Name() );
      searchcolumnelement.AppendChild( searchunitcellElement );
    }
    searchgenerationElement       := xmlDOM.CreateElement( "cell" );
    searchgenerationElement.SetAttribute( "value", 'Generation' );
    searchcolumnelement.AppendChild( searchgenerationElement );
    traverse( generations, Elements, generation ){
      generationcellElement       := xmlDOM.CreateElement( "cell" );
      generationcellElement.SetAttribute( "value", generation.Generation() );
      searchcolumnelement.AppendChild( generationcellElement );
    }
    searchpowerElement            := xmlDOM.CreateElement( "cell" );
    searchpowerElement.SetAttribute( "value", 'Power' );
    searchcolumnelement.AppendChild( searchpowerElement );
    traverse( powers, Elements, power ){
      searchpowercellElement      := xmlDOM.CreateElement( "cell" );
      searchpowercellElement.SetAttribute( "value", power.Power() );
      searchcolumnelement.AppendChild( searchpowercellElement );
    }
    searchmlbmqlElement           := xmlDOM.CreateElement( "cell" );
    searchmlbmqlElement.SetAttribute( "value", 'MQBMLB' );
    searchcolumnelement.AppendChild( searchmlbmqlElement );
    traverse( mlbmqls, Elements, mlbmql ){
      searchmlbmqlcellElement     := xmlDOM.CreateElement( "cell" );
      searchmlbmqlcellElement.SetAttribute( "value", mlbmql.MLBMQB() );
      searchcolumnelement.AppendChild( searchmlbmqlcellElement );
    }
    for( i := searchtotal; i < table.FinancialProductionRow( relsize ); i := i + 1 ){
      searchcellElement           := xmlDOM.CreateElement( "cell" );
      searchcellElement.SetAttribute( "value", '' );
      searchcolumnelement.AppendChild( searchcellElement );
    }
    unitcolumnelement             := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, 'Unit' );
    
    minindex                      := min( table, FinancialProductionColumn, column, not column.IsDay(), column.Index() );
    traverse ( table, FinancialProductionColumn, column, not column.IsDay() ) {
      columnelement               := xmlDOM.CreateElement( "column" );
      nameelement                 := xmlDOM.CreateElement( "name" );
      typeelement                 := xmlDOM.CreateElement( "type" );
      nameelement.TextContent( column.Name() );
      typeelement.TextContent( "String" );
      columnelement.AppendChild( nameelement );
      columnelement.AppendChild( typeelement );
      columnelement               := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, column.Name() );
      
      cells                       := selectsortedset( column, FinancialProductionCell, cell, cell.FinancialProductionRow().RowNr() );
    
      traverse ( cells, Elements, c ) {
        if( column.Index() = minindex ){
          row                     := c.FinancialProductionRow();
          //Factory
          InventorySummarySource::CreateCellElement( xmlDOM, searchunitcolumn, row.Factory() );
          //Generation
          InventorySummarySource::CreateCellElement( xmlDOM, generationcolumn, row.Product_MP().Generation() );
          //Power
          InventorySummarySource::CreateCellElement( xmlDOM, powercolumn, row.Product_MP().Power() );
          //MLBMQBS
          InventorySummarySource::CreateCellElement( xmlDOM, mlbmqbcolumn, row.Product_MP().MQBMLB() );
          //Product
          productcellElement      := xmlDOM.CreateElement( "cell" );
          productcellElement.SetAttribute( "value", row.Name() );
          productcolumnelement.AppendChild( productcellElement );
          InventorySummarySource::CreateCellElement( xmlDOM, productcolumnelement, row.Name() );
          //Unit
          unitcellElement         := xmlDOM.CreateElement( "cell" );
          unitcellElement.SetAttribute( "value", row.Unit() );
          unitcolumnelement.AppendChild( unitcellElement );
          InventorySummarySource::CreateCellElement( xmlDOM, unitcolumnelement, row.Unit() );
        }
        cellElement               := xmlDOM.CreateElement( "cell" );
        cellElement.SetAttribute( "value", c.Value() );
        columnelement.AppendChild( cellElement );
      }
      for( i := cells.Size(); i < searchtotal; i := i + 1 ){
        searchcellElement         := xmlDOM.CreateElement( "cell" );
        searchcellElement.SetAttribute( "value", '' );
        columnelement.AppendChild( searchcellElement );
        if( column.Index() = minindex ){
          productcellElement      := xmlDOM.CreateElement( "cell" );
          productcellElement.SetAttribute( "value", '' );
          productcolumnelement.AppendChild( productcellElement );
          //Unit
          unitcellElement         := xmlDOM.CreateElement( "cell" );
          unitcellElement.SetAttribute( "value", '' );
          unitcolumnelement.AppendChild( unitcellElement );
        }
        InventorySummarySource::CreateCellElement( xmlDOM, columnelement, c.Value() );
      }
      tableElement.AppendChild( columnelement );  
    }
_Main/BL/Type_FinancialSalesReport/Method_Generate.qbl
@@ -9,7 +9,7 @@
  TextBody:
  [*
    // ç”„兰鸽 Jun-25-2024 (created)
    table      := selectobject( this, FinancialSalesSource.FinancialSalesReport, report, not report.IsShow() );
    table                   := selectobject( this, FinancialSalesSource.FinancialSalesReport, report, not report.IsShow() );
    //清空之前存储的显示数据
    this.Clear();
    traverse( factorys, Elements, factory ){
@@ -19,7 +19,7 @@
    i                       := 0;
    traverse( rows, Elements, e ){
      e.RowNr( i );
      i                    := i + 1;
      i                     := i + 1;
    }
  *]
}
_Main/BL/Type_FinancialSalesReport/Method_GenerateShow.qbl
@@ -10,33 +10,34 @@
  [*
    // ç”„兰鸽 Oct-12-2024 (created)
    //年汇总
    yearcolumn := this.FinancialSalesColumn( relnew, Name := '汇总', Period := this.FinancialSalesSource().MacroPlan().StartOfPlanning().StartOfNextYear().Date() );
    sumrow     := this.FinancialSalesRow( relnew, Name := factory.Format( 'S(Len(10))' ).Concat( 'SUM' ), Unit := factory, RowNr := table.FinancialSalesRow( relsize ) );
    sumyearcell := yearcolumn.FinancialSalesCell( relnew, Value := '0' );
    yearcolumn          := this.FinancialSalesColumn( relnew, Name := '汇总', Period := this.FinancialSalesSource().MacroPlan().StartOfPlanning().StartOfNextYear().Date() );
    sumrow              := this.FinancialSalesRow( relnew, Name := factory.Format( 'S(Len(10))' ).Concat( 'SUM' ), Factory := factory );
    sumyearcell         := yearcolumn.FinancialSalesCell( relnew, Value := '0' );
    sumrow.FinancialSalesCell( relinsert, sumyearcell );
    traverse( table, FinancialSalesRow, row, row.Unit() = factory ){
      productid  := construct( Strings );
      productid         := construct( Strings );
      productid.Add( row.Name() );
      
      if( productids.ContainsAll( productid ) ){
        showrow := this.FinancialSalesRow( relnew, Name := factory.Format( 'S(Len(10))' ).Concat( row.Name() ), Unit := row.Unit(), RowNr := row.RowNr() );
        yearcell := yearcolumn.FinancialSalesCell( relnew, Value := '0' );
        showrow         := this.FinancialSalesRow( relnew, Name := factory.Format( 'S(Len(10))' ).Concat( row.Name() ), Unit := row.Unit() );
        row.Product_MP().FinancialSalesRow( relinsert, showrow );
        yearcell        := yearcolumn.FinancialSalesCell( relnew, Value := '0' );
        showrow.FinancialSalesCell( relinsert, yearcell );
        
        traverse( row, FinancialSalesCell, cell, not cell.FinancialSalesColumn().IsDay() ){
          column   := selectobject( this, FinancialSalesColumn, column, column.Name() = cell.FinancialSalesColumn().Name() and not column.IsDay());
          column        := selectobject( this, FinancialSalesColumn, column, column.Name() = cell.FinancialSalesColumn().Name() and not column.IsDay());
          
          sumcell  := selectobject( column, FinancialSalesCell, c, c.FinancialSalesRow() = sumrow );
          sumcell       := selectobject( column, FinancialSalesCell, c, c.FinancialSalesRow() = sumrow );
          if( isnull( sumcell ) ){
            sumcell := column.FinancialSalesCell( relnew, Value := '0' );
            sumcell     := column.FinancialSalesCell( relnew, Value := '0' );
            sumrow.FinancialSalesCell( relinsert, sumcell );
          }
          
          showcell := column.FinancialSalesCell( relnew, Value := cell.Value(), IsUpdate := cell.IsUpdate()  );
          showcell      := column.FinancialSalesCell( relnew, Value := cell.Value(), IsUpdate := cell.IsUpdate()  );
          showrow.FinancialSalesCell( relinsert, showcell );
          yearcell.Value( [String]( [Real]yearcell.Value() + [Real]cell.Value() ) );
          sumyearcell.Value( [String]( [Real]sumyearcell.Value() + [Real]cell.Value() ) );
          value := [Real]cell.Value() + [Real]sumcell.Value();
          value         := [Real]cell.Value() + [Real]sumcell.Value();
          sumcell.Value( [String]value );
        }
      }
_Main/BL/Type_FinancialSalesRow/Attribute_Factory.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,7 @@
Quintiq file version 2.0
#parent: #root
Attribute Factory
{
  #keys: '3[415136.0.1226310174][415136.0.1226310173][415136.0.1226310175]'
  ValueType: String
}
_Main/BL/Type_FinancialSalesRow/DefaultValue_Factory.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,6 @@
Quintiq file version 2.0
#parent: #root
DefaultValue
{
  TargetAttribute: Factory
}
_Main/BL/Type_FinancialSalesSource/StaticMethod_Download.qbl
@@ -1,11 +1,7 @@
Quintiq file version 2.0
#parent: #root
StaticMethod Download (
  MacroPlan macroPlan,
  Factorys factorys,
  ProductGenerations generations,
  ProductPowers powers,
  ProductMLBMQBs mlbmqls
  MacroPlan macroPlan
) as BinaryValue
{
  Description: '下载财务报表数据'
@@ -18,123 +14,42 @@
    xmlDOM                        := xmlDOMI.CreateDocumentFromString( '<?xml version="1.0" encoding="UTF-16"?><table><name>' + table.Name() + '</name></table>' );
    
    tableElement                  := xmlDOM.GetElementByTagName( "table", 0 );
    //Search
    searchcolumnelement           := xmlDOM.CreateElement( "column" );
    searchnameelement             := xmlDOM.CreateElement( "name" );
    searchtypeelement             := xmlDOM.CreateElement( "type" );
    searchnameelement.TextContent( 'Search' );
    searchtypeelement.TextContent( "String" );
    searchcolumnelement.AppendChild( searchnameelement );
    searchcolumnelement.AppendChild( searchtypeelement );
    //Factory
    searchunitcolumn              := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, 'Unit' );
    //Generation
    generationcolumn              := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, 'Generation' );
    //Power
    powercolumn                   := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, 'Power' );
    //MLBMQBS
    mlbmqbcolumn                  := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, 'MLBMQB' );
    //Product
    productcolumnelement          := xmlDOM.CreateElement( "column" );
    productnameelement            := xmlDOM.CreateElement( "name" );
    producttypeelement            := xmlDOM.CreateElement( "type" );
    productnameelement.TextContent( 'Product' );
    producttypeelement.TextContent( "String" );
    productcolumnelement.AppendChild( productnameelement );
    productcolumnelement.AppendChild( producttypeelement );
    productcolumnelement          := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, 'Product' );
    //Unit
    unitcolumnelement             := xmlDOM.CreateElement( "column" );
    unitnameelement               := xmlDOM.CreateElement( "name" );
    unittypeelement               := xmlDOM.CreateElement( "type" );
    unitnameelement.TextContent( 'Unit' );
    unittypeelement.TextContent( "String" );
    unitcolumnelement.AppendChild( unitnameelement );
    unitcolumnelement.AppendChild( unittypeelement );
    unitcolumnelement             := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, 'Unit' );
    
    tableElement.AppendChild( searchcolumnelement );
    tableElement.AppendChild( productcolumnelement );
    tableElement.AppendChild( unitcolumnelement );
    searchtotal                   := factorys.Size() + generations.Size() + powers.Size() + mlbmqls.Size() + 4 ;
    searchunitElement             := xmlDOM.CreateElement( "cell" );
    searchunitElement.SetAttribute( "value", 'Unit' );
    searchcolumnelement.AppendChild( searchunitElement );
    traverse( factorys, Elements, factory ){
      searchunitcellElement       := xmlDOM.CreateElement( "cell" );
      searchunitcellElement.SetAttribute( "value", factory.Name() );
      searchcolumnelement.AppendChild( searchunitcellElement );
    }
    searchgenerationElement       := xmlDOM.CreateElement( "cell" );
    searchgenerationElement.SetAttribute( "value", 'Generation' );
    searchcolumnelement.AppendChild( searchgenerationElement );
    traverse( generations, Elements, generation ){
      generationcellElement       := xmlDOM.CreateElement( "cell" );
      generationcellElement.SetAttribute( "value", generation.Generation() );
      searchcolumnelement.AppendChild( generationcellElement );
    }
    searchpowerElement            := xmlDOM.CreateElement( "cell" );
    searchpowerElement.SetAttribute( "value", 'Power' );
    searchcolumnelement.AppendChild( searchpowerElement );
    traverse( powers, Elements, power ){
      searchpowercellElement      := xmlDOM.CreateElement( "cell" );
      searchpowercellElement.SetAttribute( "value", power.Power() );
      searchcolumnelement.AppendChild( searchpowercellElement );
    }
    searchmlbmqlElement           := xmlDOM.CreateElement( "cell" );
    searchmlbmqlElement.SetAttribute( "value", 'MQBMLB' );
    searchcolumnelement.AppendChild( searchmlbmqlElement );
    traverse( mlbmqls, Elements, mlbmql ){
      searchmlbmqlcellElement     := xmlDOM.CreateElement( "cell" );
      searchmlbmqlcellElement.SetAttribute( "value", mlbmql.MLBMQB() );
      searchcolumnelement.AppendChild( searchmlbmqlcellElement );
    }
    for( i := searchtotal; i < table.FinancialSalesRow( relsize ); i := i + 1 ){
      searchcellElement           := xmlDOM.CreateElement( "cell" );
      searchcellElement.SetAttribute( "value", '' );
      searchcolumnelement.AppendChild( searchcellElement );
    }
    minindex        := min( table, FinancialSalesColumn, column, not column.IsDay(), column.Index() );
    minindex                      := min( table, FinancialSalesColumn, column, not column.IsDay(), column.Index() );
    traverse ( table, FinancialSalesColumn, column, not column.IsDay() ) {
      columnelement               := xmlDOM.CreateElement( "column" );
      nameelement                 := xmlDOM.CreateElement( "name" );
      typeelement                 := xmlDOM.CreateElement( "type" );
      nameelement.TextContent( column.Name() );
      typeelement.TextContent( "String" );
      columnelement.AppendChild( nameelement );
      columnelement.AppendChild( typeelement );
      columnelement               := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, column.Name() );
      
      cells := selectsortedset( column, FinancialSalesCell, cell, cell.FinancialSalesRow().RowNr() );
    
      traverse ( cells, Elements, c ) {
        if( column.Index() = minindex ){
          row                     := c.FinancialSalesRow();
          //Factory
          InventorySummarySource::CreateCellElement( xmlDOM, searchunitcolumn, row.Factory() );
          //Generation
          InventorySummarySource::CreateCellElement( xmlDOM, generationcolumn, row.Product_MP().Generation() );
          //Power
          InventorySummarySource::CreateCellElement( xmlDOM, powercolumn, row.Product_MP().Power() );
          //MLBMQBS
          InventorySummarySource::CreateCellElement( xmlDOM, mlbmqbcolumn, row.Product_MP().MQBMLB() );
          //Product
          productcellElement      := xmlDOM.CreateElement( "cell" );
          productcellElement.SetAttribute( "value", row.Name() );
          productcolumnelement.AppendChild( productcellElement );
          InventorySummarySource::CreateCellElement( xmlDOM, productcolumnelement, row.Name() );
          //Unit
          unitcellElement         := xmlDOM.CreateElement( "cell" );
          unitcellElement.SetAttribute( "value", row.Unit() );
          unitcolumnelement.AppendChild( unitcellElement );
          if( cells.Size() > searchtotal ){
            for( i := searchtotal; i < cells.Size(); i := i + 1 ){
              searchcellElement1  := xmlDOM.CreateElement( "cell" );
              searchcellElement1.SetAttribute( "value", '' );
              searchcolumnelement.AppendChild( searchcellElement1 );
            }
          }
          InventorySummarySource::CreateCellElement( xmlDOM, unitcolumnelement, row.Unit() );
        }
        cellElement               := xmlDOM.CreateElement( "cell" );
        cellElement.SetAttribute( "value", c.Value() );
        columnelement.AppendChild( cellElement );
      }
      for( i := cells.Size(); i < searchtotal; i := i + 1 ){
        searchcellElement         := xmlDOM.CreateElement( "cell" );
        searchcellElement.SetAttribute( "value", '' );
        columnelement.AppendChild( searchcellElement );
        if( column.Index() = minindex ){
          productcellElement      := xmlDOM.CreateElement( "cell" );
          productcellElement.SetAttribute( "value", '' );
          productcolumnelement.AppendChild( productcellElement );
          //Unit
          unitcellElement         := xmlDOM.CreateElement( "cell" );
          unitcellElement.SetAttribute( "value", '' );
          unitcolumnelement.AppendChild( unitcellElement );
        }
        InventorySummarySource::CreateCellElement( xmlDOM, columnelement, c.Value() );
      }
      tableElement.AppendChild( columnelement );  
    }
_Main/BL/Type_InventorySummaryColumn/Method_GenerateCell.qbl
@@ -7,7 +7,7 @@
  InventorySummaryReport table,
  Date start,
  Date end,
  String productid,
  Product_MP product,
  String allunit,
  String ccunit,
  String dlunit
@@ -17,22 +17,22 @@
  [*
    // ç”„兰鸽 Jul-3-2024 (created)
    //All
    alldetails := selectset( selections, Elements.InventoryInterfaceDataDetail, detail, detail.PartNumber() = productid and detail.Date() >= start and detail.Date() <= end );
    alldetails := selectset( selections, Elements.InventoryInterfaceDataDetail, detail, detail.PartNumber() = product.ID() and detail.Date() >= start and detail.Date() <= end );
    if( alldetails.Size() > 0 ){
      allrow     := table.GetRow( allunit, productid );
      allrow     := table.GetRow( allunit, product );
      allvalue := sum( alldetails, Elements, e, [Number]e.Quantity() );
      allrow.SetCellValue( this, allvalue );
      //长春
      ccdetails := selectset( alldetails, Elements, detail, ccstockingpointids.Find( detail.InventoryPointSelection().StockpoingPoint() ) >= 0 );
      if( ccdetails.Size() > 0 ){
        ccrow := table.GetRow( ccunit, productid );
        ccrow := table.GetRow( ccunit, product );
        value := sum( ccdetails, Elements, e, [Number]e.Quantity() );
        ccrow.SetCellValue( this, value );
      }
      //大连
      dldetails := selectset( alldetails, Elements, detail, dlstockingpointids.Find( detail.InventoryPointSelection().StockpoingPoint() ) >= 0 );
      if( dldetails.Size() > 0 ){
        dlrow := table.GetRow( dlunit, productid );
        dlrow := table.GetRow( dlunit, product );
        value := sum( dldetails, Elements, e, [Number]e.Quantity() );
        dlrow.SetCellValue( this, value );
      }
_Main/BL/Type_InventorySummaryReport/Method_GenerateShow#925.qbl
@@ -9,14 +9,14 @@
  TextBody:
  [*
    // ç”„兰鸽 Oct-12-2024 (created)
    sumrow                    := this.InventroySummaryRow( relnew, Name := factory.Format( 'S(Len(10))' ).Concat( 'SUM' ), Unit := factory );
    sumrow                    := this.InventroySummaryRow( relnew, Name := factory.Format( 'S(Len(10))' ).Concat( 'SUM' ), Factory := factory );
    sumrow.InitializeCell( this );
    traverse( table, InventroySummaryRow, row, row.Unit() = factory ){
      productid               := construct( Strings );
      productid.Add( row.Name() );
        
      if( productids.ContainsAll( productid ) ){
        showrow               := this.InventroySummaryRow( relnew, Name := factory.Format( 'S(Len(10))' ).Concat( row.Name() ), Unit := row.Unit(), RowNr := row.RowNr() );
        showrow               := this.InventroySummaryRow( relnew, Name := factory.Format( 'S(Len(10))' ).Concat( row.Name() ), Generation := row.Generation(), Power := row.Power(), MLBMQB := row.MLBMQB(), Unit := row.Unit(), Factory := factory, RowNr := row.RowNr() );
        traverse( this, InventorySummaryColumn, column ){
          sumcell             := selectobject( column, InventorySummaryCell, c, c.InventroySummaryRow() = sumrow );
          daycells            := selectset( row, InventorySummaryCell, cell, cell.InventorySummaryColumn().TimeUnit() = Translations::MP_GlobalParameters_Day() and
_Main/BL/Type_InventorySummaryReport/Method_GetRow.qbl
@@ -2,16 +2,16 @@
#parent: #root
Method GetRow (
  String unit,
  String product
  Product_MP product
) as InventroySummaryRow
{
  TextBody:
  [*
    // ç”„兰鸽 Jun-28-2024 (created)
    row := selectobject( this, InventroySummaryRow, row, row.Name() = product and row.Unit() = unit );
    row := selectobject( this, InventroySummaryRow, row, row.Name() = product.ID() and row.Unit() = unit );
    
    if( isnull( row ) ){
      row := this.InventroySummaryRow( relnew, Name := product, Unit := unit );
      row := this.InventroySummaryRow( relnew, Name := product.ID(), Generation := product.Generation(), Power := product.Power(), MLBMQB := product.MQBMLB(), Unit := unit );
      //初始化单元格
      row.InitializeCell( this );
    }
_Main/BL/Type_InventorySummarySource/StaticMethod_CreateCellElement0.qbl
ÎļþÒÑɾ³ý
_Main/BL/Type_InventorySummarySource/StaticMethod_CreateColumnElement#822.qbl
ÎļþÒÑɾ³ý
_Main/BL/Type_InventorySummarySource/StaticMethod_CreateColumnElement.qbl
ÎļþÒÑɾ³ý
_Main/BL/Type_InventorySummarySource/StaticMethod_CreateColumnElement0.qbl
ÎļþÒÑɾ³ý
_Main/BL/Type_InventorySummarySource/StaticMethod_Download.qbl
@@ -1,84 +1,61 @@
Quintiq file version 2.0
#parent: #root
StaticMethod Download (
  MacroPlan macroPlan,
  Factorys factorys,
  ProductGenerations generations,
  ProductPowers powers,
  ProductMLBMQBs mlbmqls,
  InventorySummarySearch search
  MacroPlan macroPlan
) as BinaryValue
{
  Description: '下载财务报表数据'
  TextBody:
  [*
    //获取查询行数
    searchrowsize               := InventorySummarySource::GetSearchRows( factorys, generations, powers, mlbmqls );
    table                       := selectobject( macroPlan, InventorySummarySource.InventorySummaryReport, table, table.IsShow() );
    
    xmlDOMI                     := XMLDOMImplementation::Create();
    xmlDOM                      := xmlDOMI.CreateDocumentFromString( '<?xml version="1.0" encoding="UTF-16"?><table><name>' + table.Name() + '</name></table>' );
    
    tableElement                := xmlDOM.GetElementByTagName( "table", 0 );
    //Product/Unit
    factoryvalues               := selectuniquevalues( factorys, Elements, factory, factory.Name() );
    productcolumnelement        := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, factoryvalues, 'Unit', searchrowsize );
    InventorySummarySource::CreateCellElement( xmlDOM, productcolumnelement, 'Product' );
    //Unit/Generation
    generationvalues            := selectuniquevalues( generations, Elements, generation, generation.Generation() );
    unitcolumnelement           := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, generationvalues, 'Generation', searchrowsize );
    InventorySummarySource::CreateCellElement( xmlDOM, unitcolumnelement, 'Unit' );
    //Attribute/Power
    powervalues                 := selectuniquevalues( powers, Elements, power, power.Power() );
    attricolumnelement          := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, powervalues, 'Power', searchrowsize );
    InventorySummarySource::CreateCellElement( xmlDOM, attricolumnelement, 'Attribute' );
    //Factory
    searchunitcolumn            := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, 'Unit' );
    //Generation
    generationcolumn            := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, 'Generation' );
    //Power
    powercolumn                 := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, 'Power' );
    //MLBMQBS
    mlbmqbvalues                := selectuniquevalues( mlbmqls, Elements, mlbmqb, mlbmqb.MLBMQB() );
    mlbmqlcolumnelement         := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, mlbmqbvalues, 'MLBMQB', searchrowsize );
    //Start date
    startcolumnelement          := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, search.StartDate().Format( 'M2/D2/Y' ), 'Start date', searchrowsize );
    //End date
    endcolumnelement            := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, search.EndDate().Format( 'M2/D2/Y' ), 'End date', searchrowsize );
    //Period
    periodcolumnelement         := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, search.Category(), 'Period', searchrowsize );
    searchcolumn                := 7 ;
    rowsize                     := table.InventroySummaryRow( relsize ) * 4;
    for( i := table.InventorySummaryColumn( relsize ); i < searchcolumn - 3; i := i + 1 ){
      if( i = 0 ){
        InventorySummarySource::CreateCellElement( xmlDOM, mlbmqlcolumnelement, '', rowsize );
      }else if( i = 1 ){
        InventorySummarySource::CreateCellElement( xmlDOM, startcolumnelement, '', rowsize );
      }else if( i = 2 ){
        InventorySummarySource::CreateCellElement( xmlDOM, endcolumnelement, '', rowsize );
      }else if( i = 3 ){
        InventorySummarySource::CreateCellElement( xmlDOM, periodcolumnelement, '', rowsize );
      }
    }
    mlbmqbcolumn                := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, 'MLBMQB' );
    //Product
    productcolumnelement        := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, 'Product' );
    //Unit
    unitcolumnelement           := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, 'Unit' );
    //Attribute
    attricolumnelement          := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, 'Attribute' );
    traverse ( table, InventorySummaryColumn, column ) {
      columnelement             := null( XMLDOMElement );
      if( column.Index() = 0 ){
        columnelement           := mlbmqlcolumnelement;
        InventorySummarySource::CreateCellElement( xmlDOM, mlbmqlcolumnelement, column.Name() );
      }else if( column.Index() = 1 ){
        columnelement           := startcolumnelement
        InventorySummarySource::CreateCellElement( xmlDOM, startcolumnelement, column.Name() );
      }else if( column.Index() = 2 ){
        columnelement           := endcolumnelement;
        InventorySummarySource::CreateCellElement( xmlDOM, endcolumnelement, column.Name() );
      }else if( column.Index() = 3 ){
        columnelement           := periodcolumnelement;
        InventorySummarySource::CreateCellElement( xmlDOM, periodcolumnelement, column.Name() );
      }else{
        columnelement           := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, column.Name(), rowsize );
      }
      columnelement             := InventorySummarySource::CreateColumnElement( tableElement, xmlDOM, column.Name() );
      
      cells                     := selectsortedset( column, InventorySummaryCell, cell, cell.InventroySummaryRow().RowNr() );
    
      traverse ( cells, Elements, c ) {
        if( column.Index() = 0 ){
          row                   := c.InventroySummaryRow();
          //Factory
          InventorySummarySource::CreateCellElement( xmlDOM, searchunitcolumn, row.Factory() );
          InventorySummarySource::CreateCellElement( xmlDOM, searchunitcolumn, row.Factory() );
          InventorySummarySource::CreateCellElement( xmlDOM, searchunitcolumn, row.Factory() );
          InventorySummarySource::CreateCellElement( xmlDOM, searchunitcolumn, row.Factory() );
          //Generation
          InventorySummarySource::CreateCellElement( xmlDOM, generationcolumn, row.Generation() );
          InventorySummarySource::CreateCellElement( xmlDOM, generationcolumn, row.Generation() );
          InventorySummarySource::CreateCellElement( xmlDOM, generationcolumn, row.Generation() );
          InventorySummarySource::CreateCellElement( xmlDOM, generationcolumn, row.Generation() );
          //Power
          InventorySummarySource::CreateCellElement( xmlDOM, powercolumn, row.Power() );
          InventorySummarySource::CreateCellElement( xmlDOM, powercolumn, row.Power() );
          InventorySummarySource::CreateCellElement( xmlDOM, powercolumn, row.Power() );
          InventorySummarySource::CreateCellElement( xmlDOM, powercolumn, row.Power() );
          //MLBMQBS
          InventorySummarySource::CreateCellElement( xmlDOM, mlbmqbcolumn, row.MLBMQB() );
          InventorySummarySource::CreateCellElement( xmlDOM, mlbmqbcolumn, row.MLBMQB() );
          InventorySummarySource::CreateCellElement( xmlDOM, mlbmqbcolumn, row.MLBMQB() );
          InventorySummarySource::CreateCellElement( xmlDOM, mlbmqbcolumn, row.MLBMQB() );
          //Product
          InventorySummarySource::CreateCellElement( xmlDOM, productcolumnelement, row.Name() );
          InventorySummarySource::CreateCellElement( xmlDOM, productcolumnelement, row.Name() );
_Main/BL/Type_InventorySummarySource/StaticMethod_Download0.qbl
ÎļþÒÑɾ³ý
_Main/BL/Type_InventorySummarySource/StaticMethod_GetSearchRows.qbl
ÎļþÒÑɾ³ý
_Main/BL/Type_InventorySummarySource/StaticMethod_Initialize.qbl
@@ -37,9 +37,9 @@
        traverse( stockingpoint, ProductInStockingPoint_MP, pisp,  pisp.Product_MP().IsLeaf() ){
          productids.Add( pisp.ProductID() );
          //获取工厂行
          factoryrow          := table.GetRow( ifexpr( iscc, ccunit, dlunit ), pisp.ProductID() );
          factoryrow          := table.GetRow( ifexpr( iscc, ccunit, dlunit ), pisp.Product_MP() );
          //获取合计行
          allrow              := table.GetRow( allunit, pisp.ProductID() );
          allrow              := table.GetRow( allunit, pisp.Product_MP() );
          
          pispips             := selectsortedset( pisp, ProductInStockingPointInPeriod, pispip, pispip.Start() < startofnextyear 
                                                  and pispip.Period_MP().TimeUnit() = Translations::MP_GlobalParameters_Day(), pispip.Start() );
@@ -80,7 +80,8 @@
    traverse( table, InventorySummaryColumn, column, column.TimeUnit() = Translations::MP_GlobalParameters_Day() and column.StartDate() < startofplanning.Date() ){
      traverse( productidset, Elements, productid ){
        productids.Add( productid );
        column.GenerateCell( selections, ccsps, dlsps, table, column.StartDate(), column.EndaDate(), productid, allunit, ccunit, dlunit );
        product               := selectobject( owner, Product_MP, product, product.ID() = productid );
        column.GenerateCell( selections, ccsps, dlsps, table, column.StartDate(), column.EndaDate(), product, allunit, ccunit, dlunit );
      }
    }
      
_Main/BL/Type_InventroySummaryRow/Attribute_Factory.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,7 @@
Quintiq file version 2.0
#parent: #root
Attribute Factory
{
  #keys: '3[415136.0.1226331362][415136.0.1226331361][415136.0.1226331363]'
  ValueType: String
}
_Main/BL/Type_InventroySummaryRow/Attribute_Generation.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,7 @@
Quintiq file version 2.0
#parent: #root
Attribute Generation
{
  #keys: '3[415136.0.1226310057][415136.0.1226310056][415136.0.1226310058]'
  ValueType: String
}
_Main/BL/Type_InventroySummaryRow/Attribute_MLBMQB.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,7 @@
Quintiq file version 2.0
#parent: #root
Attribute MLBMQB
{
  #keys: '3[415136.0.1226310078][415136.0.1226310077][415136.0.1226310079]'
  ValueType: String
}
_Main/BL/Type_InventroySummaryRow/Attribute_Power.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,7 @@
Quintiq file version 2.0
#parent: #root
Attribute Power
{
  #keys: '3[415136.0.1226310068][415136.0.1226310067][415136.0.1226310069]'
  ValueType: String
}
_Main/UI/MacroPlannerWebApp/Component_FormFinancialProductionReport/Response_PanelExport_369_ButtonExport696_OnClick.def
@@ -13,7 +13,7 @@
  {
    Body:
    [*
      binaryValue := FinancialProductionSource::Download( MacroPlan, dhFactorys.Data(), dhGenerations.Data(), dhPowers.Data(), dhMQBMLBs.Data() );
      binaryValue := FinancialProductionSource::Download( MacroPlan );
      
      Application.Download( FinancialProductionReport::GetDefaultName() + '.xlsx', binaryValue.AsBinaryData() );
    *]
_Main/UI/MacroPlannerWebApp/Component_FormFinancialSalesReport/Component_PanelLeft.def
@@ -12,6 +12,7 @@
  ]
  Properties:
  [
    FixedSize: true
    Taborder: 0
  ]
}
_Main/UI/MacroPlannerWebApp/Component_FormFinancialSalesReport/Response_PanelExport_ButtonExport570_OnClick.def
@@ -13,7 +13,7 @@
  {
    Body:
    [*
      binaryValue := FinancialSalesSource::Download( MacroPlan, dhFactorys.Data(), dhGenerations.Data(), dhPowers.Data(), dhMQBMLBs.Data() );
      binaryValue := FinancialSalesSource::Download( MacroPlan );
      
      Application.Download( FinancialSalesReport::GetDefaultName() + '.xlsx', binaryValue.AsBinaryData() );
      //owner.FinancialSalesSource( relflush );
_Main/UI/MacroPlannerWebApp/Component_FormInventorySummaryReport/Response_PanelExport_ButtonSummaryExport_OnClick.def
@@ -13,7 +13,7 @@
  {
    Body:
    [*
      binaryValue := InventorySummarySource::Download( MacroPlan, dhFactorys.Data(), dhGenerations.Data(), dhPowers.Data(), dhMQBMLBs.Data(), dhSearch.Data() );
      binaryValue := InventorySummarySource::Download( MacroPlan );
      
      Application.Download( InventorySummaryReport::GetDefaultName() + '.xlsx', binaryValue.AsBinaryData() );
    *]