lazhen
2024-08-09 23e251ff1d124de2fb13fe195a8b4575bc0676a1
_Main/BL/Type_FinancialSalesSource/StaticMethod_Initialize.qbl
@@ -46,9 +46,9 @@
      if( ( iscc and forecast.Product_MP().MQBMLB() = 'MLB' ) or isdl ){
        product              := forecast.Product_MP();
        //获取合计行
        allrow               := table.GetRow( allunit, product.ID() );
        allrow               := table.GetRow( allunit, product );
        //获取工厂行
        factoryrow           := table.GetRow( ifexpr( iscc and forecast.Product_MP().MQBMLB() = 'MLB', ccunit, dlunit ), product.ID() );
        factoryrow           := table.GetRow( ifexpr( iscc and forecast.Product_MP().MQBMLB() = 'MLB', ccunit, dlunit ), product );
      
        if( products.Find( product ) < 0 ){
          products.Add( product );
@@ -74,8 +74,8 @@
    //  iscc                  := unit.ID() = ccspline or exists( parentunits, Elements, punit, punit.ID() = ccspline );
      if( table.IsInUnit( stockingpoint, ccspline ) ){
        traverse( stockingpoint, ProductInStockingPoint_MP, pisp, pisp.Product_MP().IsLeaf() and pisp.Product_MP().MQBMLB() = 'MQB' ){//产品为MQB
          allrow            := table.GetRow( allunit, pisp.ProductID() );
          ccrow             := table.GetRow( ccunit, pisp.ProductID() );
          allrow            := table.GetRow( allunit, pisp.Product_MP() );
          ccrow             := table.GetRow( ccunit, pisp.Product_MP() );
          traverse( pisp, ProductInStockingPointInPeriod, pispip, not pispip.Period_MP().IsHistorical() and pispip.Period_MP().StartDate() < startofnextyear ){
            periodtime      := pispip.Start().StartOfMonth().Date();
            periodname      := periodtime.Format( "M2/D2/Y" );
@@ -105,10 +105,10 @@
          column            := selectobject( table, FinancialSalesColumn, column, column.Name() = periodname and column.Period() = periodtime );
          traverse( trip, ProductInTrip, pit ){
            quantity        := [Number]pit.Quantity();//四舍五入
            dlrow           := table.GetRow( dlunit, pit.ProductID() );
            dlrow           := table.GetRow( dlunit, pit.Product_MP() );
            dlrow.Initialize( column, quantity );//汇总数量
            
            allrow          := table.GetRow( allunit, pit.ProductID() );
            allrow          := table.GetRow( allunit, pit.Product_MP() );
            allrow.Initialize( column, quantity );
          }
        }