yanweiyuan3
2023-09-22 42f46304bc28d9fb2bee770668b70204d877db93
_Main/BL/Type_CustomerOrder/StaticMethod_CreateOrUpdate.qbl
@@ -62,9 +62,34 @@
                               priorityName, salesSegmentName, currencyId, unitOfMeasureName, 
                               false, customerName, customerId, orderId, orderLineId, true, true, true );
    } else {
        result.Update( product, stockingPoint, orderDate, quantity, price,
                       priorityName, salesSegmentName, currencyId, unitOfMeasureName,
                       false, customerName, customerId, orderId, orderLineId, true, true, true );
        if( result.ProductID() = productId
            and result.StockingPointID() = stockingPointId
            and result.StartDate() = orderDate
            and result.Quantity() = quantity
            and result.Price() = price
            and result.PriorityName() = priorityName
            and result.SalesSegmentName() = salesSegmentName
            and result.CurrencyID() = currencyId
            and result.UnitOfMeasureName() = unitOfMeasureName
            and result.CustomerName() = customerName
            and result.CustomerID() = customerId
            and result.OrderID() = orderId
            and result.OrderLineID() = orderLineId ){
              info( "No need to update this order: " + id );
              }else{
                if( result.IsLocked() = true ){
                  pispips := selectset( result, ProductInStockingPoint_MP.ProductInStockingPointInPeriod, pispip, true );
                  pispipLeafs := selectset( pispips,
                                            Elements.astype( ProductInStockingPointInPeriodPlanningLeaf ),
                                            pispip,
                                            true );
                  ProductInStockingPointInPeriod::LockUnlockPlanning( pispipLeafs, false, true );
                }
                result.Update( product, stockingPoint, orderDate, quantity, price,
                               priorityName, salesSegmentName, currencyId, unitOfMeasureName,
                               false, customerName, customerId, orderId, orderLineId, true, true, true );
                result.IsLocked( false );
                }
    }
    return result;
  *]