xiaoding721
2024-10-12 489022017f8b581ab413455b41ec841879a75e03
_Main/BL/Type_InventorySummarySource/StaticMethod_Initialize.qbl
@@ -10,7 +10,7 @@
  [*
    // 甄兰鸽 Jun-24-2024 (created)
    owner.InventorySummarySource( relflush );
    products                  := construct( Product_MPs );
    productids                := construct( Strings );
    allunit                   := InventorySummaryReport::GetDefaultAllUnit();
    ccunit                    := InventorySummaryReport::GetDefaultCCUnit();
    dlunit                    := InventorySummaryReport::GetDefaultDLUnit();
@@ -35,6 +35,7 @@
      isdl                    := exists( parentunits, Elements, punit, punit.ID().StartsWith( 'VWED DL' ) );
      if( iscc or isdl ){
        traverse( stockingpoint, ProductInStockingPoint_MP, pisp,  pisp.Product_MP().IsLeaf() ){
          productids.Add( pisp.ProductID() );
          //获取工厂行
          factoryrow          := table.GetRow( ifexpr( iscc, ccunit, dlunit ), pisp.ProductID() );
          //获取合计行
@@ -44,7 +45,6 @@
                                                  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" );
@@ -75,10 +75,11 @@
    }
    //再在库存更新的子界面库存点选择中找到这些库存点所关联的已勾选库位
    selections                := selectset( interface, InventoryPointSelection, selection, allsps.Find( selection.StockpoingPoint() ) >= 0 and selection.IsIncluded() );
    productids                := selectuniquevalues( selections, Elements, selection, selection.ProductID() );
    productidset              := selectuniquevalues( selections, Elements, selection, selection.ProductID() );
    //最后将这些库位中零件号的数量进行加总
    traverse( table, InventorySummaryColumn, column, column.TimeUnit() = Translations::MP_GlobalParameters_Day() and column.StartDate() < startofplanning.Date() ){
      traverse( productids, Elements, productid ){
      traverse( productidset, Elements, productid ){
        productids.Add( productid );
        column.GenerateCell( selections, ccsps, dlsps, table, column.StartDate(), column.EndaDate(), productid, allunit, ccunit, dlunit );
      }
    }
@@ -94,6 +95,8 @@
        e.Delete();
      }
    }
    showtable.Generate( search, products );
    factorys                  := selectset( owner, Factory, factory, factory.ID() = FinancialProductionReport::GetDefaultAllUnit() );
    showtable.Generate( search, factorys, productids );
  *]
}