PR
yypsybs
2023-09-19 93b4b535d06d9dd71039827e759bfc211c3ff4ef
_Main/BL/Type_PRData/StaticMethod_FromSupplyPlanning#662.qbl
@@ -1,6 +1,7 @@
Quintiq file version 2.0
#parent: #root
StaticMethod FromSupplyPlanning (
  GlobalOTDTable otdTable,
  MacroPlan macroPlan,
  MacroPlan mappingRoot,
  ProductInStockingPointInPeriod pispip
@@ -17,6 +18,7 @@
    stockingPoint := pisp.StockingPoint_MP();
    period := pispip.Period_MP();
    mappingProduct := MappingProduct::GetByProductId( mappingRoot, product.ID() );
    matAttrSetting := MatAttrSettingAndPlanStrategy::GetExistByMatCode( otdTable, product.ID() );
    // 接口/中间表暂无
    mappingProviderCapacity := "暂无";
    erpData := "暂无";
@@ -37,6 +39,12 @@
    result.PRSuggestionDate( ifexpr( (result.ProduceRequiredDate() - Duration::Days( 7 )).Date() >= Date::Today(),
                                     Date::Today(), (result.ProduceRequiredDate() - Duration::Days( 7 )).Date() ) );
    
    // 根据 物料属性标签设定&物料计划策略
    result.IsPannelMaterial();
    result.IsGenericMaterial( matAttrSetting.FlagGeneric() );
    result.IsLongLeadItem( matAttrSetting.FlagLongTerm() );
    result.MaterialMRPType( ifexpr( matAttrSetting.PlanningStrategyCustom() <> "", matAttrSetting.PlanningStrategyCustom(), matAttrSetting.PlanningStrategyAuto() ) );
    // 根据product中间表
    result.BusinessType( mappingProduct.BusinessType() );
    result.OrganCode( mappingProduct.OrgCode() );
@@ -45,6 +53,7 @@
    // 根据供应商能力中间表
    result.ProviderCode( mappingProviderCapacity );
    result.ProductName( mappingProviderCapacity );
    result.LeadTime( 0.0 );
    
    // 根据erp接口 固定值
    result.RequisitionType( "PURCHASE" );
@@ -68,7 +77,7 @@
    // 发送信息
    result.SendStatus( "" );
    result.SendBy( "" );
    result.SendTIme( DateTime::MinDateTime() );
    result.SendTime( DateTime::MinDateTime() );
    
    return result;
  *]