renhao
2023-09-19 378955a39437125d274173c1ebcfd91dba15fc18
需求和外部库存日期限制过滤取消
创建采购供应
已修改4个文件
25 ■■■■ 文件已修改
_Main/BL/Type_MacroPlan/Method_MappingCustomerOrderData.qbl 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_MacroPlan/Method_MappingExternalSupplyData.qbl 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_MacroPlan/Method_MappingOperationBOMData.qbl 4 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_MacroPlan/Method_MappingOperationBOMDataSupplyPurchase.qbl 17 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_MacroPlan/Method_MappingCustomerOrderData.qbl
@@ -17,7 +17,7 @@
    }
    queryStartDate := guard( min( this, Period_MP, item, true, item.StartDate() ) - Duration::Days( 30 ), DateTime::MinDateTime() ).Date();
    queryEndDate := guard( max( this, Period_MP, item, true, item.EndDate() ), Date::MaxDate() );
    listToDeal := selectset( listToDeal, Elements, item, item.OrderDate() >= queryStartDate and item.OrderDate() <= queryEndDate, not isnull( Product_MP::FindById( this, item.ProductID() ) ) and not isnull( StockingPoint_MP::FindById( this, item.StockPointID() ) ) and not isnull( SalesSegment_MP::FindByName( this, item.SalesSegmentName() ) ) );
    listToDeal := selectset( listToDeal, Elements, item, item.OrderDate() >= queryStartDate /*and item.OrderDate() <= queryEndDate*/, not isnull( Product_MP::FindById( this, item.ProductID() ) ) and not isnull( StockingPoint_MP::FindById( this, item.StockPointID() ) ) and not isnull( SalesSegment_MP::FindByName( this, item.SalesSegmentName() ) ) );
    
    totalcount := listToDeal.Size();
    info( "CustomerOrder has " + totalcount.AsQUILL() + " rows in total" );
_Main/BL/Type_MacroPlan/Method_MappingExternalSupplyData.qbl
@@ -10,7 +10,7 @@
    // renhao Aug-14-2023 (created)
    queryStartDate := guard( min( this, Period_MP, item, true, item.StartDate() ) - Duration::Days( 30 ), DateTime::MinDateTime() ).Date();
    queryEndDate := guard( max( this, Period_MP, item, true, item.EndDate() ), Date::MaxDate() );
    listtodeal := selectset( this,MappingExternalSupply,externalSupply, externalSupply.UserQuantity()>0 and externalSupply.Date() >= queryStartDate and externalSupply.Date() <= queryEndDate);
    listtodeal := selectset( this,MappingExternalSupply,externalSupply, externalSupply.UserQuantity()>0 and externalSupply.Date() >= queryStartDate /*and externalSupply.Date() <= queryEndDate*/);
    totalcount := listtodeal.Size();
    description := "在途在制";
    info( "ExternalSupply has " + totalcount.AsQUILL() + " rows in total" );
_Main/BL/Type_MacroPlan/Method_MappingOperationBOMData.qbl
@@ -71,9 +71,9 @@
    }
    if( createPurchaseSupplyMaterial ) {
        toCreateBomList := selectuniquevalues( bomList, Elements, item, 
                                               item.ProductType() = "P", item.OrganCode() + item.ComponentCode());
                                               item.ComponentType() = "P", item.OrganCode() + item.ComponentCode());
        traverse( toCreateBomList, Elements, key ) {
            boms := selectset( bomList, Elements, item, item.ProductType() = "P" and item.OrganCode() + item.ComponentCode() = key );
            boms := selectset( bomList, Elements, item, item.ComponentType() = "P" and item.OrganCode() + item.ComponentCode() = key );
            bom := boms.First();
            this.MappingOperationBOMDataSupplyPurchase( bom.OrganCode(), bom.ComponentCode(), bom.ComponentType());
        }
_Main/BL/Type_MacroPlan/Method_MappingOperationBOMDataSupplyPurchase.qbl
@@ -8,14 +8,7 @@
{
  TextBody:
  [*
    routingId := "PR_"+orgCode + "_" + productId;
    unitId := "供应商";
    routingStepName := "Purchase";
    operationId := orgCode + "_PR_" + productId;
    routing := Routing::CreateOrUpdate( this, routingId );
    toDeleteSteps := selectset( routing, RoutingStep, routingStep, true );
    RoutingStep::Delete( toDeleteSteps );
    routingStep := RoutingStep::Create( routing, routingStepName, "", true );
    product := Product_MP::FindById( this, productId );
    if( isnull( product ) ) {
        info(  "product : " + productId + " not found" );
@@ -27,6 +20,14 @@
    }
    
    if( not isnull( product) and not isnull( stockingPoint)){
      routingId := "PR_"+orgCode + "_" + productId;
      unitId := "供应商";
      routingStepName := "Purchase";
      operationId := orgCode + "_PR_" + productId;
      routing := Routing::CreateOrUpdate( this, routingId );
      toDeleteSteps := selectset( routing, RoutingStep, routingStep, true );
      RoutingStep::Delete( toDeleteSteps );
      routingStep := RoutingStep::Create( routing, routingStepName, "", true );
      unit := Unit::FindById( this, unitId );
      if( isnull( unit ) ) {
        unit := this.Unit( relnew,