| | |
| | | [* |
| | | // 甄兰鸽 Aug-12-2024 (created) |
| | | owner.CCEngineLogisticsCostReport( relflush ); |
| | | produtparent := CCEngineLogisticsCostReport::GetDefaultProductParent(); |
| | | name := CCEngineLogisticsCostReport::GetDefaultName(); |
| | | allunit := CCEngineLogisticsCostReport::GetDefaultAllUnit(); |
| | | ccunit := CCEngineLogisticsCostReport::GetDefaultCCUnit(); |
| | |
| | | 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(); |
| | |
| | | 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() |
| | |
| | | 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() |
| | |
| | | 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() |