renhao
2023-10-13 d8483f551bc64f0356e06e9ec32475a84c301364
Merge branch 'dev_cyy'
已修改4个文件
26 ■■■■■ 文件已修改
_Main/BL/Type_H_FunctionClass/StaticMethod_SM_GetMaterialData.qbl 3 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_H_FunctionClass/StaticMethod_SM_GetUnitBySKU.qbl 5 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_H_FunctionClass/StaticMethod_SM_OrderHedging.qbl 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_H_FunctionClass/StaticMethod_SM_OrderHedgingEx.qbl 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_H_FunctionClass/StaticMethod_SM_GetMaterialData.qbl
@@ -63,7 +63,7 @@
                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();
@@ -83,6 +83,7 @@
      // 没有BOM 添加测试数据
      else
      {
        //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
_Main/BL/Type_H_FunctionClass/StaticMethod_SM_GetUnitBySKU.qbl
@@ -2,7 +2,8 @@
#parent: #root
StaticMethod SM_GetUnitBySKU (
  MacroPlan Owner,
  String SKU
  String SKU,
  GlobalOTDTable GlobData
) as Unit
{
  Description: '通过SKU获取库存点信息'
@@ -11,7 +12,7 @@
    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());
_Main/BL/Type_H_FunctionClass/StaticMethod_SM_OrderHedging.qbl
@@ -15,6 +15,10 @@
    *创建人:yunying
    *创建时间:20230-09-24
    *描述:系统内订单冲减调用函数,IsNew=true时,重新处理预测信息,IsNew=false时,用预测累计信息。
    *参数:IsNew 是否时新的计算表示
    *     Operator 操作人
    *     OperatorType 操作类型[反签,授权,ERP订单],这里应该是ERP订单
    *备注:客户全部使用客户名称,不要使用客户ID,预测原始数据没有客户ID信息
    *****************************************************************************/
    // 初始化结果
    bStatus := false;
@@ -58,9 +62,9 @@
              nHaveForecastQty :=0; //有预测数量
              nNoHaveForecastQty:=0;//五预测数量
              OrderQuantity := 0;   //剩余订单数量
              // 获取预测数量(客户+SKU+月份 理论是没有物料预测)
              // 获取预测数量(客户名称+SKU+月份 理论是没有物料预测)
              OrderForecast := select(Owner, H_OrderForecastRealQty , Obj, Obj.SKU() = ObjOrder.ProductID() 
                                                    and Obj.CustomCode() = ObjOrder.CustomerName()
                                                    and Obj.CustomName() = ObjOrder.CustomerName()
                                                    and Obj.Month().Format( "YM2") =ObjOrder.EndDate().Format( "YM2"));
              if ( not isnull(OrderForecast))
              {
@@ -74,9 +78,9 @@
                  nReverseQtyOld := ObjReverse.ReverseRealQty();
                  nReverseQtyNew := nReverseQtyOld;
              }
              // 获取授权数量(客户ID+SKU)
              // 获取授权数量(客户名称+SKU)
              ObjAuthorize := select(Owner, H_AuthorizeRealQty , Obj, Obj.SKU() = ObjOrder.ProductID() 
                                                                      and Obj.CustomID() = ObjOrder.CustomerName());
                                                                      and Obj.CustomName() = ObjOrder.CustomerName());
              if ( not isnull(ObjAuthorize))
              {
                  nAuthorizeQtyOld := ObjAuthorize.AuthorizeRealQty();
_Main/BL/Type_H_FunctionClass/StaticMethod_SM_OrderHedgingEx.qbl
@@ -170,9 +170,9 @@
    {
      strMsg :="填产后订单冲减发生错误,请联系系统管理员!";
      // 记录错误日志
    //  Owner.H_ErrorLogs(relnew,EClassName := "H_FunctionClass",EDateTime := DateTime::ActualGMTTime(),EFunctionName := "SM_OrderHedgingEx",
    //                     DeveloperInformation :=  e.DeveloperInformation(),ErrorNr := e.ErrorNr(),DetailedInformation := e.DetailedInformation(),
    //                     GeneralInformation := e.GeneralInformation());
      Owner.H_ErrorLogs(relnew,EClassName := "H_FunctionClass",EDateTime := DateTime::ActualGMTTime(),EFunctionName := "SM_OrderHedgingEx",
                         DeveloperInformation :=  e.DeveloperInformation(),ErrorNr := e.ErrorNr(),DetailedInformation := e.DetailedInformation(),
                         GeneralInformation := e.GeneralInformation());
    }
    return JSON::Object().Add( "Status",bStatus)
                         .Add( "Count",nCount)