FIx BaseConversionFactor error
基础单位转换数据(中间表)中不允许存在类似PCS转PCS这样自己转自己的数据
| | |
| | | if( productId <> "" ) { |
| | | product := Product_MP::FindById( macroPlan, productId ); |
| | | }else{ |
| | | // info( productId ); |
| | | // cf := select( source, |
| | | // AsSourceUnitOfMeasure, |
| | | // cf, |
| | | // ( cf.TargetUnitOfMeasure() = target |
| | | // or cf.TargetUnitOfMeasure() = source ) |
| | | // and cf.Product_MP() = product |
| | | // ); |
| | | // info( isnull( cf ) ); |
| | | // info( "sourceuomname: " + cf.astype( BaseConversionFactor ).SourceUnitOfMeasureName() ); |
| | | // info( "targetuomname: " + target.Name() ); |
| | | // info( "cf.targetuomname: " + cf.astype( BaseConversionFactor ).TargetUnitOfMeasureName() ); |
| | | // info( "productid: " + guard( product.ID(), "" ) ); |
| | | // info( "cf.product: " + cf.astype( BaseConversionFactor ).ProductID() ); |
| | | result := BaseConversionFactor::CreateUpdate( source, target, factor, product, isEnable ) |
| | | } |
| | | |
| | |
| | | TextBody: |
| | | [* |
| | | organcodelist := selectvalues( this, Global_MappingOperationBOM, bom,true, bom.OrganCode() ); |
| | | info( macroPlan.BusinessType() ); |
| | | businessTypes := macroPlan.BusinessType().Tokenize( "," ); |
| | | if( not isnull( businessTypes ) and businessTypes.Size() > 0 ) { |
| | | traverse( businessTypes, Elements, item ) { |
| | |
| | | } |
| | | |
| | | macroPlan.InitialUnitAndStockingPoint(); |
| | | info( macroPlan.BusinessType() ); |
| | | info( organcodelist.Element( 0 ) ); |
| | | // |
| | | //if ( isUnitOfMeasure_MP ) { |
| | |
| | | info( "Prepare to do sync" ) |
| | | info( "Get organ code list" ) |
| | | businessTypeName := businessType.BusinessTypeName().Tokenize( "," ); |
| | | macroPlan.BusinessType( businessType.BusinessTypeName() ); |
| | | |
| | | organcodelist := selectvalues( businessType, OrganCode, organ, true, organ.OrganCodeName() ); |
| | | |
| | | if( organcodelist.Size() = 0 ){ |