lihongji
2024-08-12 acf70acb5438a3358d07978afdc0eb28950f40d5
_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 );
@@ -59,7 +59,7 @@
    //      info( '-------------------------', periodname, periodtime );
          column             := selectobject( table, FinancialSalesColumn, column, column.Name() = periodname and column.Period() = periodtime );
    //      info( '-------------------------', column.Name() );
          quantity   := ceil( psdip.Quantity() );//向上取整
          quantity   := [Number]psdip.Quantity();//四舍五入
          
          factoryrow.Initialize( column, quantity );
          allrow.Initialize( column, quantity );
@@ -74,13 +74,13 @@
    //  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" );
            column          := selectobject( table, FinancialSalesColumn, column, column.Name() = periodname and column.Period() = periodtime );
            quantity        := ceil( pispip.DependentDemandAndSalesDemandQuantity() );//向上取整
            quantity        := [Number]pispip.DependentDemandAndSalesDemandQuantity();//四舍五入
            
            ccrow.Initialize( column, quantity );//取Total Demand字段按月汇总需求数量
            allrow.Initialize( column, quantity );
@@ -104,11 +104,11 @@
          
          column            := selectobject( table, FinancialSalesColumn, column, column.Name() = periodname and column.Period() = periodtime );
          traverse( trip, ProductInTrip, pit ){
            quantity        := ceil( pit.Quantity() );//向上取整
            dlrow           := table.GetRow( dlunit, pit.ProductID() );
            quantity        := [Number]pit.Quantity();//四舍五入
            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 );
          }
        }