|  |  |  | 
|---|
|  |  |  | } | 
|---|
|  |  |  | // 检查依赖项 | 
|---|
|  |  |  | if( isnull( product) ) { | 
|---|
|  |  |  | info( "product not found" ); | 
|---|
|  |  |  | info( "product not found" + productId); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if( isnull( salesSegment) ) { | 
|---|
|  |  |  | info( "sales segment not found" ); | 
|---|
|  |  |  | info( "sales segment not found" + salesSegmentName); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if( isnull( stockingPoint) ) { | 
|---|
|  |  |  | info( "stock point not found" ); | 
|---|
|  |  |  | info( "stock point not found" + stockingPointId); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //if( isnull( currency) ) { | 
|---|
|  |  |  | //    error( "currency not found" ); | 
|---|
|  |  |  | //} | 
|---|
|  |  |  | if( unitOfMeasureName <> "" and isnull( unitOfMeasure) ) { | 
|---|
|  |  |  | info( "unit of measure not found" ); | 
|---|
|  |  |  | info( "unit of measure not found" + unitOfMeasureName); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if( priorityName <> "" and isnull( stockingPoint) ) { | 
|---|
|  |  |  | info( "priority not found" ); | 
|---|
|  |  |  | } | 
|---|
|  |  |  | //if( priorityName <> "" and isnull( stockingPoint) ) { | 
|---|
|  |  |  | //    info( "priority not found" ); | 
|---|
|  |  |  | //} | 
|---|
|  |  |  | // 新增/更新 | 
|---|
|  |  |  | result := CustomerOrder::FindById( macroPlan, id ); | 
|---|
|  |  |  | if( isnull( result ) ) { | 
|---|
|  |  |  | CustomerOrder::Create( product, stockingPoint, id, orderDate, quantity, price, | 
|---|
|  |  |  | result := CustomerOrder::Create( product, stockingPoint, id, orderDate, quantity, price, | 
|---|
|  |  |  | priorityName, salesSegmentName, currencyId, unitOfMeasureName, | 
|---|
|  |  |  | false, customerName, customerId, orderId, orderLineId, true, true, true ); | 
|---|
|  |  |  | } else { | 
|---|