lazhen
2024-08-14 94ab2bd0381925ecf01a2f1a812b114d0f82d5bb
_Main/BL/Type_CCEngineLogisticsCostReport0/StaticMethod_Initialize.qbl
@@ -8,6 +8,7 @@
  [*
    // 甄兰鸽 Aug-12-2024 (created)
    owner.DLEngineLogisticsCostReport( relflush );
    produtparent              := DLEngineLogisticsCostReport::GetDefaultProductParent();
    name                      := DLEngineLogisticsCostReport::GetDefaultName();
    allunit                   := DLEngineLogisticsCostReport::GetDefaultAllUnit();
    ccunit                    := DLEngineLogisticsCostReport::GetDefaultCCUnit();
@@ -45,7 +46,7 @@
          periodname         := periodtime.Format( "M2/D2/Y" );
          
          column             := selectobject( table, Column, column, column.Name() = periodname and column.StartDate() = periodtime );
          traverse( trip, ProductInTrip, pit, pit.Quantity() = 0 and exists( pit.Product_MP().GetAllParent(), Elements, e, e.ID() = '发动机' ) ){//查询产品类型是发动机
          traverse( trip, ProductInTrip, pit, pit.Quantity() = 0 and exists( pit.Product_MP().GetAllParent(), Elements, e, e.ID() = produtparent ) ){//查询产品类型是发动机
            quantity         := [Number]pit.Quantity();
            row              := table.GetRow( pit.ProductID() );
            product          := pit.Product_MP();
@@ -98,7 +99,7 @@
          product             := row.Product_MP();
          products.Add( product );
          productparents      := product.GetAllParent();
          if( exists( productparents, Elements, e, e.ID() = '发动机' ) ){//查询产品类型是发动机
          if( exists( productparents, Elements, e, e.ID() = produtparent ) ){//查询产品类型是发动机
            //查询对应的发动机成本
            enginecost        := selectobject( owner, LogisticsCostEngine, engine, engine.Generation() = product.Generation() 
                                                 and engine.MLB_MQB() = product.MQBMLB()
@@ -122,7 +123,7 @@
          ccrow               := table.GetRow( row.Name() );
          product             := row.Product_MP();
          productparents      := product.GetAllParent();
          if( exists( productparents, Elements, e, e.ID() = '发动机' ) ){//查询产品类型是发动机
          if( exists( productparents, Elements, e, e.ID() = produtparent ) ){//查询产品类型是发动机
            products.Add( product );
            //查询对应的发动机成本
            enginecost        := selectobject( owner, LogisticsCostEngine, engine, engine.Generation() = product.Generation() 
@@ -144,7 +145,7 @@
    traverse( owner, TransferPlanRow, tprow, tprow.SourceStockpoingPointID() = 'DL' and tprow.TargetStockpoingPointID() = 'CC' ){
      product                 := selectobject( owner, Product_MP, product, product.ID() = tprow.ProductID() );
      productparents          := product.GetAllParent();
      if( exists( productparents, Elements, e, e.ID() = '发动机' ) ){//查询产品类型是发动机
      if( exists( productparents, Elements, e, e.ID() = produtparent ) ){//查询产品类型是发动机
        //查询对应的发动机成本
         enginecost           := selectobject( owner, LogisticsCostEngine, engine, engine.Generation() = product.Generation() 
                                               and engine.MLB_MQB() = product.MQBMLB()
@@ -178,7 +179,7 @@
      if( iscc ){
        product               := forecast.Product_MP();
        productparents        := product.GetAllParent();
        if( exists( productparents, Elements, e, e.ID() = '发动机' ) ){//查询产品类型是发动机
        if( exists( productparents, Elements, e, e.ID() = produtparent ) ){//查询产品类型是发动机
          row                 := table.GetRow( forecast.ProductID() );
          products.Add( forecast.Product_MP() );
          
@@ -215,7 +216,7 @@
          //获取行
          product             := pisp.Product_MP();
          productparents      := product.GetAllParent();
          if( exists( productparents, Elements, e, e.ID() = '发动机' ) ){//查询产品类型是发动机
          if( exists( productparents, Elements, e, e.ID() = produtparent ) ){//查询产品类型是发动机
            row               := table.GetRow( pisp.ProductID() );
            products.Add( pisp.Product_MP() );
            traverse( pisp, ProductInStockingPointInPeriod, pispip, not pispip.Period_MP().IsHistorical() and pispip.Period_MP().StartDate() < startofnextyear ){