lazhen
2024-08-14 94ab2bd0381925ecf01a2f1a812b114d0f82d5bb
_Main/BL/Type_CCEngineLogisticsCostReport/StaticMethod_Initialize.qbl
@@ -8,6 +8,7 @@
  [*
    // 甄兰鸽 Aug-12-2024 (created)
    owner.CCEngineLogisticsCostReport( relflush );
    produtparent              := CCEngineLogisticsCostReport::GetDefaultProductParent();
    name                      := CCEngineLogisticsCostReport::GetDefaultName();
    allunit                   := CCEngineLogisticsCostReport::GetDefaultAllUnit();
    ccunit                    := CCEngineLogisticsCostReport::GetDefaultCCUnit();
@@ -31,16 +32,15 @@
        traverse( report, FinancialProductionRow, row, row.Unit() = ccunit and exists( row, FinancialProductionCell, cell, cell.Value() <> '0' ) ){//财务产量报表里的长春产量, 不为0
          ccrow               := table.GetRow( row.Name() );
          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()
                                                 and engine.Factory() = ccunit
                                                 and exists( productparents, Elements, e, e.ID() = engine.Product() ) );
            if( not isnull( enginecost ) ){
              product             := row.Product_MP();
              products.Add( product );
              traverse( row, FinancialProductionCell, cell, cell.Value() <> '0' ){
                //入库量/包装容量*入库单价,入库量等于长春产量
                quantity          := ceil( [Number]cell.Value() / enginecost.PackagingCapacity() ) * enginecost.WarehousingPrice();
@@ -60,7 +60,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 ) ){//查询产品类型是发动机
            //查询对应的发动机成本
            enginecost          := selectobject( owner, LogisticsCostEngine, engine, engine.Generation() = product.Generation() 
                                                 and engine.MLB_MQB() = product.MQBMLB()
@@ -98,7 +98,7 @@
            row              := table.GetRow( pit.ProductID() );
            product          := pit.Product_MP();
            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()
@@ -130,7 +130,7 @@
          product            := pisp.Product_MP();
          productparents     := product.GetAllParent();
          row                := table.GetRow( pisp.ProductID() );
          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()