From f3dec8f5b480474c9a3b2ea0fabb0f6b9fdc0423 Mon Sep 17 00:00:00 2001
From: renhao <renhui.hao@capgemini.com>
Date: 星期五, 13 十月 2023 17:11:34 +0800
Subject: [PATCH] Merge branch 'dev'
---
_Main/BL/Type_MacroPlan/Method_MappingOperationBOMDataSupplyPurchase.qbl | 42 +++++++++++++++++++++++++-----------------
1 files changed, 25 insertions(+), 17 deletions(-)
diff --git a/_Main/BL/Type_MacroPlan/Method_MappingOperationBOMDataSupplyPurchase.qbl b/_Main/BL/Type_MacroPlan/Method_MappingOperationBOMDataSupplyPurchase.qbl
index 41be758..7ea305b 100644
--- a/_Main/BL/Type_MacroPlan/Method_MappingOperationBOMDataSupplyPurchase.qbl
+++ b/_Main/BL/Type_MacroPlan/Method_MappingOperationBOMDataSupplyPurchase.qbl
@@ -8,38 +8,46 @@
{
TextBody:
[*
- routingId := orgCode + "_" + productId;
- unitId := orgCode + "_PR_" + productId;
- 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 ) ) {
- error( "product : " + productId + " not found" );
+ info( "product : " + productId + " not found" );
}
- stockingPointId := orgCode + "_" + productType + "_Stock";
+ stockingPointId := orgCode + "_Stock";
stockingPoint := StockingPoint_MP::FindById( this, stockingPointId );
if( isnull( stockingPoint ) ) {
- error( "stockingPoint : " + stockingPointId + " not found" );
+ info( "stockingPoint : " + stockingPointId + " not found" );
}
- unit := Unit::FindById( this, unitId );
- if( isnull( unit ) ) {
+
+ 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,
ID := unitId, Name := unitId, CapacityType := "Infinite",
DefaultGridX := 0, DefaultGridY := 0,
IsManuallyConfigured := false,
Currency_MP := this.BaseCurrency(), UnitOfMeasure_MP := this.DefaultUnitOfMeasure() );
- }
+ }
// Operation
- operation := Operation::Create( operationId, unit, operationId, routingStep,
+ operation := Operation::FindOperationTypeIndex( operationId);
+ if( isnull( operation)){
+ operation := Operation::Create( operationId, unit, operationId, routingStep,
Duration::Zero(), Duration::Zero(), 1.0, false,
Real::MinReal(), false, Real::MaxReal(),
0.0, 0.0, false, true );
// OperaionBom
- operation.CreateOperationBOM( product, stockingPoint, false, true );
- operation.GetOperationBOM( product.ID(), stockingPoint.ID(), false ).Quantity( 1 );
+ operation.CreateOperationBOM( product, stockingPoint, false, true );
+ operation.GetOperationBOM( product.ID(), stockingPoint.ID(), false ).Quantity( 1 );
+ }
+
+ }
*]
}
--
Gitblit v1.9.3