| | |
| | | productparents := product.GetAllParent(); |
| | | if( exists( productparents, Elements, e, e.ID() = productparent ) ){//查询产品类型是发动机 |
| | | //起始库存点是否是大连or长春 |
| | | originsp := selectobject( owner, StockingPoint_MP, sp, sp.ID() = tprow.SourceStockpoingPointID() ); |
| | | originunit := originsp.Unit(); |
| | | originparentunits := originunit.GetAllParent(); |
| | | originiscc := originsp.ID() = ccunit or originunit.ID() = ccunit or exists( originparentunits, Elements, punit, punit.ID() = ccunit ); |
| | | originisdl := originsp.ID() = dlunit or originunit.ID() = dlunit or exists( originparentunits, Elements, punit, punit.ID() = dlunit ); |
| | | // originsp := selectobject( owner, StockingPoint_MP, sp, sp.ID() = tprow.SourceStockpoingPointID() ); |
| | | // originunit := originsp.Unit(); |
| | | // originparentunits := originunit.GetAllParent(); |
| | | originiscc := tprow.SourceStockpoingPointID() = 'CC';//originsp.ID() = ccunit or originunit.ID() = ccunit or exists( originparentunits, Elements, punit, punit.ID() = ccunit ); |
| | | originisdl := tprow.SourceStockpoingPointID() = 'DL';//originsp.ID() = dlunit or originunit.ID() = dlunit or exists( originparentunits, Elements, punit, punit.ID() = dlunit ); |
| | | //目的地是否是长春外租库 |
| | | destisp := selectobject( owner, StockingPoint_MP, sp, sp.ID() = tprow.TargetStockpoingPointID() ); |
| | | destiunit := destisp.Unit(); |
| | | destiparentunits := destiunit.GetAllParent(); |
| | | destiiscc := destisp.ID() = ccunit or destiunit.ID() = ccunit or exists( destiparentunits, Elements, punit, punit.ID() = ccunit ); |
| | | destiisdl := destisp.ID() = dlunit or destiunit.ID() = dlunit or exists( destiparentunits, Elements, punit, punit.ID() = dlunit ); |
| | | // destisp := selectobject( owner, StockingPoint_MP, sp, sp.ID() = tprow.TargetStockpoingPointID() ); |
| | | // destiunit := destisp.Unit(); |
| | | // destiparentunits := destiunit.GetAllParent(); |
| | | destiiscc := tprow.TargetStockpoingPointID() = 'CC';//destisp.ID() = ccunit or destiunit.ID() = ccunit or exists( destiparentunits, Elements, punit, punit.ID() = ccunit ); |
| | | destiisdl := tprow.TargetStockpoingPointID() = 'DL';//destisp.ID() = dlunit or destiunit.ID() = dlunit or exists( destiparentunits, Elements, punit, punit.ID() = dlunit ); |
| | | if( ( originiscc and destiisdl ) or ( originisdl and destiiscc ) ){ |
| | | row := table.GetRow( tprow.ProductID() ); |
| | | traverse( tprow, TransferPlanCell, tpcell, tpcell.TransferPlanColumn().ColumnDate() <> Date::MinDate() ){ |