| | |
| | | Quintiq file version 2.0 |
| | | #parent: #root |
| | | StaticMethod SM_GetBOMBySKU ( |
| | | MacroPlan Owner, |
| | | GlobalOTDTable GlobData, |
| | | String SKU |
| | | ) as MappingBOM |
| | | ) as Global_MappingOperationBOM |
| | | { |
| | | Description: 'æ ¹æ®SKUè·åBOM' |
| | | TextBody: |
| | | [* |
| | | Obj :=null( MappingBOM,constcontent ); |
| | | if( not isnull( Owner) and SKU.Length()>0) |
| | | Obj :=null( Global_MappingOperationBOM,constcontent ); |
| | | if( not isnull( GlobData) and SKU.Length()>0) |
| | | { |
| | | Obj := select( Owner,MappingBOM,ObjM,ObjM.ProductCode()=SKU); |
| | | Obj := select( GlobData,Global_MappingOperationBOM,ObjM,ObjM.ProductCode()=SKU); |
| | | } |
| | | return Obj; |
| | | *] |
| | |
| | | Number ProductQty, |
| | | String ForecastId, |
| | | String VCode, |
| | | Date NDate |
| | | Date NDate, |
| | | GlobalOTDTable GlobData |
| | | ) as owning JSON |
| | | { |
| | | Description: 'è·åç©æä¿¡æ¯' |
| | |
| | | if( Owner.MappingBOM(relsize )>0) |
| | | { |
| | | // å¾å°ä¸ä¸çº§æ°æ® |
| | | AllData:= selectset( Owner, MappingBOM,object,object.ComponentCode()=ParentSKU); |
| | | ObjProduct := null( MappingProduct,constcontent ); |
| | | AllData:= selectset( GlobData, Global_MappingOperationBOM,object,object.ComponentCode()=ParentSKU); |
| | | ObjProduct := null( Product_MP,constcontent ); |
| | | ObjUnit := null( Unit,constcontent ); |
| | | MaterialType:=""; |
| | | MaterialName:="-"; |
| | | StockPoint := ""; |
| | | NRate:=1.0; |
| | | NComponentsUsed :=0.0; |
| | | ObjBOM := H_FunctionClass::SM_GetBOMBySKU(Owner,ParentSKU); |
| | | ObjBOM := H_FunctionClass::SM_GetBOMBySKU(GlobData,ParentSKU); |
| | | if(not isnull( ObjBOM)) |
| | | { |
| | | NRate := ObjBOM.ComponentOutputRate(); |
| | |
| | | ObjProduct:= H_FunctionClass::SM_GetProductInfo(Owner,Obj.ProductCode()); |
| | | if( not isnull( ObjProduct)) |
| | | { |
| | | MaterialType:= ObjProduct.ProductMajorType(); |
| | | MaterialType:= ObjProduct.ParentID(); |
| | | MaterialName:=ObjProduct.Name(); |
| | | } |
| | | ObjUnit:= H_FunctionClass::SM_GetUnitBySKU( Owner,Obj.ProductCode()); |
| | |
| | | StaticMethod SM_GetProductInfo ( |
| | | MacroPlan Owner, |
| | | String SKU |
| | | ) as MappingProduct |
| | | ) as Product_MP |
| | | { |
| | | Description: 'æ ¹æ®SKUè·åç©æä¿¡æ¯' |
| | | TextBody: |
| | | [* |
| | | // æ ¹æ®SKUè·åç©æä¿¡æ¯ |
| | | // 注æï¼ç©æç±»åå ParentIDï¼ |
| | | Obj := null( MappingProduct,constcontent ); |
| | | // 注æï¼ç©æç±»åå ParentID |
| | | Obj := null( Product_MP,constcontent ); |
| | | if( not isnull( Owner) and SKU.Length()>0) |
| | | { |
| | | Obj:= select( Owner,MappingProduct,ObjMP,ObjMP.ID()=SKU); |
| | | Obj:= select( Owner,Product_MP,ObjMP,ObjMP.ID()=SKU); |
| | | } |
| | | return Obj; |
| | | *] |
| | |
| | | idx:=0; |
| | | RQty:=0; |
| | | ObjOrderRealQty:=null( H_OrderForecastRealQty,constcontent ); |
| | | SKU:=""; |
| | | SKUName := ""; |
| | | |
| | | traverse( AllData,Elements,Obj,not isnull(Obj)) |
| | | { |
| | | // 没æå®¢æ·ä¿¡æ¯åé¨é¨ä¿¡æ¯ï¼SalesSegmentName=äºä¸é¨+â-â+客æ·åç§° |
| | | CustomName := Obj.SalesSegmentName(); |
| | | DepartMent := Obj.SalesSegmentName(); |
| | | SKU :=Obj.ProductID(); |
| | | // è¿éç¨æ¥æ¾åæªåï¼å 为ä¸ç¡®å®æå 个横线ï¼ä»¥ç¬¬ä¸ä¸ªä¸ºå |
| | | idx:=Obj.SalesSegmentName().FindString( "-",0); |
| | | if(idx>0) |
| | |
| | | DepartMent:=Obj.SalesSegmentName().SubString( 0,idx); |
| | | CustomName := Obj.SalesSegmentName().SubString( idx+1, Obj.SalesSegmentName().Length() - (idx+1)); |
| | | } |
| | | |
| | | // è·åç©æä¿¡æ¯ |
| | | ObjMaterial := H_FunctionClass::SM_GetProductInfo( Owner,Obj.ProductID()); |
| | | if(not isnull( ObjMaterial)) |
| | | { |
| | | SKUName := ObjMaterial.Name(); |
| | | } |
| | | |
| | | // æ´æ°é¢æµä¿¡æ¯ï¼éæ°æ°æ®æ´æ°ä¿¡æ¯ã |
| | | ObjOrderRealQty := select( Owner,H_OrderForecastRealQty,ObjO,ObjO.CustomCode()=CustomName and ObjO.SKU()=Obj.ProductID() |
| | | and ObjO.Month().StartOfMonth() = Obj.EndDate().StartOfMonth() ) |
| | |
| | | Owner.H_OrderForecastRealQty(relnew,CustomCode := CustomName,CustomName := CustomName,ForecastQty := [Number]Obj.Quantity().Round( 0) |
| | | ,ForecatsRealQty := [Number]Obj.Quantity().Round( 0),ID := H_FunctionClass::SM_GenerateID( "OR") |
| | | ,Month := Obj.EndDate(),SKU := Obj.ProductID(),Unit := Obj.UnitOfMeasureName() |
| | | ,Department := DepartMent,VCode := VersionCode); |
| | | ,Department := DepartMent,VCode := VersionCode,SKUName := SKUName); |
| | | } |
| | | else |
| | | { |
| | |
| | | { |
| | | JInfo := JSON::Parse( SelectItem.ValueJsonString()); |
| | | lb_SUK_FAACM.Text(JInfo.Get( "ParentSKU").GetString()); |
| | | lb_SKUName_FAACM.Text(JInfo.Get( "ParentSKUName").GetString()); |
| | | lb_MaterialCode_FAACM.Text(JInfo.Get( "SKU").GetString()); |
| | | lb_MaterialName.Text(JInfo.Get( "MaterialName").GetString()); |
| | | lb_Unit_FAACM.Text(JInfo.Get( "Unit").GetString()); |
| | | lb_Operator_FAACM.Text(ApplicationMacroPlanner.GetUserName()); |
| | | lb_MaterialType_FAACM.Text(JInfo.Get( "MaterialType").GetString()); |
| | | txt_CustomID_FAACM.Text(JInfo.Get( "CustomCode").GetString()); |
| | | txt_CustomName_FAACM.Text(JInfo.Get( "CustomName").GetString()); |
| | | } |
| | |
| | | // 颿µè®¢ååºæ¬ä¿¡æ¯ |
| | | CustomCode:=""; |
| | | CustomName:=""; |
| | | SKUName:=""; |
| | | SValueJsonString:=""; |
| | | // è·å客æ·åç§°å客æ·ID |
| | | if(txtSaveForecastData_FM.Text().Length()>0) |
| | |
| | | jForecast := JSON::Parse( txtSaveForecastData_FM.Text()); |
| | | CustomCode := jForecast.Get( "CustomCode").GetString(); |
| | | CustomName := jForecast.Get( "CustomName").GetString(); |
| | | SKUName := jForecast.Get( "SKUName").GetString(); |
| | | } |
| | | |
| | | if(selection.MaterialType()="åæå") |
| | |
| | | JForecast := JSON::Parse(txtSaveForecastData_FM.Text()); |
| | | ForecastID := JForecast.Get( "ForecastID").GetString(); |
| | | } |
| | | jResult := H_FunctionClass::SM_GetMaterialData( MacroPlan,selection.SKU(),selection.NeedQty(), ForecastID,"-",selection.NeedDate()); |
| | | jResult := H_FunctionClass::SM_GetMaterialData( MacroPlan,selection.SKU(),selection.NeedQty(), ForecastID,"-",selection.NeedDate(),GlobalOTDTable); |
| | | if(jResult.Get( "Status").GetBoolean()) |
| | | { |
| | | de_dh_FM_ProductMP.FixedFilter( "object.ParentSKU() = " + selection.SKU().AsQUILL() |
| | |
| | | .Add( "Unit",selection.Unit()) |
| | | .Add( "CustomCode",CustomCode) |
| | | .Add( "ParentSKU",lb_SUK_FM.Text()) |
| | | .Add( "ParentSKUName",SKUName) |
| | | .Add( "CustomName",CustomName).Build().AsString(); |
| | | } |
| | | if(isnull( SelectItem)) |
| | |
| | | CustomName:=""; |
| | | SValue:=""; |
| | | SValueJsonString:=""; |
| | | SKUName:=""; |
| | | // è·å客æ·åç§°å客æ·ID |
| | | if(txtSaveForecastData_FM.Text().Length()>0) |
| | | { |
| | | jForecast := JSON::Parse( txtSaveForecastData_FM.Text()); |
| | | CustomCode := jForecast.Get( "CustomCode").GetString(); |
| | | CustomName := jForecast.Get( "CustomName").GetString(); |
| | | SKUName := jForecast.Get( "SKUName").GetString(); |
| | | } |
| | | if(not isnull(selection)) |
| | | { |
| | |
| | | .Add( "Unit",selection.Unit()) |
| | | .Add( "CustomCode",CustomCode) |
| | | .Add( "ParentSKU",lb_SUK_FM.Text()) |
| | | .Add( "ParentSKUName",SKUName) |
| | | .Add( "CustomName",CustomName).Build().AsString(); |
| | | } |
| | | if( isnull( SelectItem)) |
| | |
| | | ButtonSize: 'compact' |
| | | Description: 'è®¢åæ°å¢åç¾/ææ' |
| | | Label: 'è®¢åæ°å¢åç¾/ææ' |
| | | Taborder: 1 |
| | | Taborder: 0 |
| | | ] |
| | | ResponseDefinitions: |
| | | [ |
| | |
| | | ButtonSize: 'compact' |
| | | Description: 'åææ°å¢åç¾/ææ' |
| | | Label: 'åææ°å¢åç¾/ææ' |
| | | Taborder: 2 |
| | | Taborder: 1 |
| | | ] |
| | | ResponseDefinitions: |
| | | [ |
| | |
| | | } |
| | | ] |
| | | } |
| | | Component btn_InitialData778 |
| | | { |
| | | #keys: '[414724.0.115504406]' |
| | | BaseType: 'WebButton' |
| | | Properties: |
| | | [ |
| | | ButtonSize: 'compact' |
| | | Description: 'å è½½æ°æ®ï¼åçï¼åç»éè¦å¯¹æ¥æ°æ®ï¼' |
| | | Label: 'å è½½é¢æµè®¢åæ°æ®' |
| | | Taborder: 0 |
| | | Visible: false |
| | | ] |
| | | } |
| | | Component btn_OrderH_FOF |
| | | { |
| | | #keys: '[414724.0.165490408]' |
| | |
| | | Description: 'ERO订åå²å' |
| | | Image: 'AMMUNITION_BOX_CLOSED' |
| | | Label: 'ERP订åå²å' |
| | | Taborder: 3 |
| | | Taborder: 2 |
| | | ] |
| | | } |
| | | Component txt_QueryContent_FOF |
| | |
| | | Properties: |
| | | [ |
| | | PlaceHolder: 'æ¨¡ç³æç´¢' |
| | | Taborder: 4 |
| | | Taborder: 3 |
| | | ] |
| | | } |
| | | Component btn_Query_FOF |
| | |
| | | Description: 'æ¥è¯¢' |
| | | Image: 'VIEW' |
| | | Label: 'æ¥è¯¢' |
| | | Taborder: 5 |
| | | Taborder: 4 |
| | | ] |
| | | } |
| | | ] |
| | |
| | | { |
| | | MacroPlan.H_MessagePassing(relnew,FKey :="FrmOrderForecast",ItemKey := "ListSelect", |
| | | ValueJsonString := JSON::Object().Add( "SKU",selection.SKU()) |
| | | .Add( "SKUName",selection.SKUName()) |
| | | .Add( "Util",selection.Unit()) |
| | | .Add( "CustomCode",selection.CustomCode()) |
| | | .Add( "CustomName",selection.CustomName()) |
| | |
| | | else |
| | | { |
| | | SelectItem.ValueJsonString(JSON::Object().Add( "SKU",selection.SKU()) |
| | | .Add( "SKUName",selection.SKUName()) |
| | | .Add( "Util",selection.Unit()) |
| | | .Add( "CustomCode",selection.CustomCode()) |
| | | .Add( "CustomName",selection.CustomName()) |
| | |
| | | .Add( "NeedTime",selection.Month().AsQUILL()).Build().AsString()); |
| | | } |
| | | |
| | | jResult := H_FunctionClass::SM_GetMaterialData( MacroPlan,selection.SKU(),selection.ForecastQty(),selection.ID(),"-",selection.Month()); |
| | | jResult := H_FunctionClass::SM_GetMaterialData( MacroPlan,selection.SKU(),selection.ForecastQty(),selection.ID(),"-",selection.Month(),GlobalOTDTable); |
| | | if(jResult.Get( "Status").GetBoolean()) |
| | | { |
| | | Application.OpenForm( "FrmMaterial","popout"); |
| | |
| | | SelectItem := select( MacroPlan,H_MessagePassing,Obj,Obj.FKey()="FrmOrderForecast" and Obj.ItemKey()="ListSelect"); |
| | | if( isnull( SelectItem)) |
| | | { |
| | | |
| | | MacroPlan.H_MessagePassing(relnew,FKey :="FrmOrderForecast",ItemKey := "ListSelect", |
| | | ValueJsonString := JSON::Object().Add( "SKU",selection.SKU()) |
| | | .Add( "Util",selection.Unit()) |
| | | .Add( "CustomCode",selection.CustomCode()) |
| | | .Add( "SKUName",selection.SKUName()) |
| | | .Add( "CustomName",selection.CustomName()).Build().AsString()); |
| | | } |
| | | else |
| | |
| | | SelectItem.ValueJsonString(JSON::Object().Add( "SKU",selection.SKU()) |
| | | .Add( "Util",selection.Unit()) |
| | | .Add( "CustomCode",selection.CustomCode()) |
| | | .Add( "SKUName",selection.SKUName()) |
| | | .Add( "CustomName",selection.CustomName()).Build().AsString()); |
| | | } |
| | | Application.OpenForm( "FrmAuthorizeAndCountersign_Order","modal"); |
| | |
| | | { |
| | | MacroPlan.H_MessagePassing(relnew,FKey :="FrmOrderForecast",ItemKey := "ListSelect", |
| | | ValueJsonString := JSON::Object().Add( "SKU",selection.SKU()) |
| | | .Add( "SKUName",selection.SKUName()) |
| | | .Add( "Util",selection.Unit()) |
| | | .Add( "CustomCode",selection.CustomCode()) |
| | | .Add( "CustomName",selection.CustomName()) |
| | |
| | | else |
| | | { |
| | | SelectItem.ValueJsonString(JSON::Object().Add( "SKU",selection.SKU()) |
| | | .Add( "SKUName",selection.SKUName()) |
| | | .Add( "Util",selection.Unit()) |
| | | .Add( "CustomCode",selection.CustomCode()) |
| | | .Add( "CustomName",selection.CustomName()) |
| | |
| | | .Add( "NeedTime",selection.Month().AsQUILL()).Build().AsString()); |
| | | } |
| | | |
| | | jResult := H_FunctionClass::SM_GetMaterialData( MacroPlan,selection.SKU(),selection.ForecastQty(),selection.ID(),"-",selection.Month()); |
| | | jResult := H_FunctionClass::SM_GetMaterialData( MacroPlan,selection.SKU(),selection.ForecastQty(),selection.ID(),"-",selection.Month(),GlobalOTDTable ); |
| | | if(jResult.Get( "Status").GetBoolean()) |
| | | { |
| | | Application.OpenForm( "FrmMaterial","popout"); |