| | |
| | | result := null(ConversionFactor ); |
| | | |
| | | if( isnull( source ) or isnull( target ) ) { |
| | | error( "can't find source or target unit of measure" ) |
| | | info( "can't find source or target unit of measure" ) |
| | | } |
| | | if( productId <> "" ) { |
| | | |
| | | if( not isnull( source) and not isnull( target)){ |
| | | if( productId <> "" ) { |
| | | product := Product_MP::FindById( macroPlan, productId ); |
| | | }else{ |
| | | result := BaseConversionFactor::CreateUpdate( source, target, factor, product, isEnable ) |
| | | }else{ |
| | | result := BaseConversionFactor::CreateUpdate( source, target, factor, product, isEnable ) |
| | | } |
| | | |
| | | if( isnull( product ) ) { |
| | | info( "invalid product id" ) |
| | | if( isnull( product ) ) { |
| | | info( "单位转换出现无效id,"+productId ) |
| | | }else{ |
| | | result := BaseConversionFactor::CreateUpdate( source, target, factor, product, isEnable ); |
| | | } |
| | | } |
| | | |
| | | return result; |
| | | *] |
| | |
| | | } |
| | | // 检查依赖项 |
| | | 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 ) ) { |
| | |
| | | } |
| | | // 检查依赖项 |
| | | if( isnull( product ) ) { |
| | | error( "product not found" ); |
| | | info( "product not found" + productId); |
| | | } |
| | | if( isnull( salesSegment ) ) { |
| | | error( "sales segment not found" ); |
| | | info( "sales segment not found" + salesSegmentName); |
| | | } |
| | | if( isnull( stockingPoint ) ) { |
| | | error( "stock point not found" ); |
| | | info( "stock point not found" + stockingPointId); |
| | | } |
| | | if( isnull( currency ) ) { |
| | | error( "currency not found" ); |
| | | info( "currency not found" + currencyId); |
| | | } |
| | | if( unitOfMeasureName <> "" and isnull( unitOfMeasure) ) { |
| | | error( "unit of measure not found" ); |
| | | info( "unit of measure not found" + unitOfMeasureName ); |
| | | } |
| | | if( priorityName <> "" and isnull( stockingPoint) ) { |
| | | error( "priority not found" ); |
| | | } |
| | | //if( priorityName <> "" and isnull( stockingPoint) ) { |
| | | // info( "priority not found" ); |
| | | //} |
| | | // 新增/更新 |
| | | result := Forecast::FindById( macroPlan, id ); |
| | | if( isnull( result) ) { |
| | |
| | | // sync data |
| | | if( data.EnableSync() ) { |
| | | MacroPlan::DoSync( macroPlanNew, |
| | | data.BusinessType(), data.IsKeyProduct(), data.CreatePurchaseSupplyMaterial() ); |
| | | data.BusinessType(), data.IsKeyProduct(), data.CreatePurchaseSupplyMaterial() ,GlobalOTDTable); |
| | | } |
| | | |
| | | this.Close(); |
| | |
| | | ProjectProperties |
| | | { |
| | | ApplicationComponentName: 'ApplicationMacroPlanner' |
| | | BuildVersion: '2022.3.0.32' |
| | | BuildVersion: '2022.3.0.34' |
| | | Description: 'Quintiq Macro Planner' |
| | | ProjectKind: 'WebClient' |
| | | } |