| | |
| | | MaterialType:= ObjProduct.ParentID(); |
| | | MaterialName:=ObjProduct.Name(); |
| | | } |
| | | ObjUnit:= H_FunctionClass::SM_GetUnitBySKU( Owner,Obj.ComponentCode()); |
| | | ObjUnit:= H_FunctionClass::SM_GetUnitBySKU( Owner,Obj.ComponentCode(),GlobData); |
| | | if( not isnull( ObjUnit)) |
| | | { |
| | | StockPoint:= ObjUnit.Name(); |
| | |
| | | // 没有BOM 添加测试数据 |
| | | else |
| | | { |
| | | error( "BOM 数据获取失败,无法扩展原材料信息!"); |
| | | //error( "BOM 数据获取失败,无法扩展原材料信息!"); |
| | | nCount :=Owner.H_MaterialInfo(relsize ); |
| | | Owner.H_MaterialInfo(relnew,ParentSKU := ParentSKU,SKU := "SKU"+ nCount.AsQUILL() ,ForecastID := ForecastId,OrgCode := "ORG_000",VCode := VCode |
| | | ,ID := H_FunctionClass::SM_GenerateID( "MI"),MaterialType := "原材料",NeedDate := NDate |
| | |
| | | #parent: #root |
| | | StaticMethod SM_GetUnitBySKU ( |
| | | MacroPlan Owner, |
| | | String SKU |
| | | String SKU, |
| | | GlobalOTDTable GlobData |
| | | ) as Unit |
| | | { |
| | | Description: '通过SKU获取库存点信息' |
| | |
| | | Obj :=null( Unit,constcontent ); |
| | | if( not isnull( Owner) and SKU.Length()>0) |
| | | { |
| | | OrgCode := select( Owner,MappingBOM,ObjM,ObjM.ProductCode()=SKU); |
| | | OrgCode := select( GlobData,Global_MappingOperationBOM,ObjM,ObjM.ProductCode()=SKU); |
| | | if( not isnull( OrgCode)) |
| | | { |
| | | Obj := select( Owner,Unit,ObjU,ObjU.ID()= OrgCode.OrganCode()); |