| | |
| | | { |
| | | TextBody: |
| | | [* |
| | | routingId := "PR_"+orgCode + "_" + productId; |
| | | unitId := "供应商"; |
| | | routingStepName := "Purchase"; |
| | | operationId := orgCode + "_PR_" + productId; |
| | | routing := Routing::CreateOrUpdate( this, routingId ); |
| | | toDeleteSteps := selectset( routing, RoutingStep, routingStep, true ); |
| | | RoutingStep::Delete( toDeleteSteps ); |
| | | routingStep := RoutingStep::Create( routing, routingStepName, "", true ); |
| | | |
| | | product := Product_MP::FindById( this, productId ); |
| | | if( isnull( product ) ) { |
| | | info( "product : " + productId + " not found" ); |
| | | } |
| | | stockingPointId := orgCode + "_" + productType + "_Stock"; |
| | | stockingPointId := orgCode + "_Stock"; |
| | | stockingPoint := StockingPoint_MP::FindById( this, stockingPointId ); |
| | | if( isnull( stockingPoint ) ) { |
| | | info( "stockingPoint : " + stockingPointId + " not found" ); |
| | | } |
| | | |
| | | if( not isnull( product) and not isnull( stockingPoint)){ |
| | | routingId := "PR_"+orgCode + "_" + productId; |
| | | unitId := "供应商"; |
| | | routingStepName := "Purchase"; |
| | | operationId := orgCode + "_PR_" + productId; |
| | | routing := Routing::CreateOrUpdate( this, routingId ); |
| | | toDeleteSteps := selectset( routing, RoutingStep, routingStep, true ); |
| | | RoutingStep::Delete( toDeleteSteps ); |
| | | routingStep := RoutingStep::Create( routing, routingStepName, "", true ); |
| | | unit := Unit::FindById( this, unitId ); |
| | | if( isnull( unit ) ) { |
| | | unit := this.Unit( relnew, |