yanyuan
2023-09-06 d741e529a05597074596281f999c5c82f18f1363
Merge branch 'dev_yy' into dev
已添加4个文件
已修改2个文件
106 ■■■■■ 文件已修改
_Main/BL/Type_ActualProductInStockingPointInPeriod/StaticMethod_CreateOrUpdate.qbl 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_ActualProductInStockingPointInPeriod/_ROOT_Type_ActualProductInStockingPointInPeriod.qbl 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_InventorySupply/StaticMethod_CreateOrUpdate.qbl 31 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_InventorySupply/_ROOT_Type_InventorySupply.qbl 6 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_MacroPlan/Method_MappingActualPISPIPData.qbl 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_MacroPlan/Method_MappingExternalSupplyData.qbl 16 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
_Main/BL/Type_ActualProductInStockingPointInPeriod/StaticMethod_CreateOrUpdate.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,31 @@
Quintiq file version 2.0
#parent: #root
StaticMethod CreateOrUpdate (
  MacroPlan owner,
  String productid,
  String stockingpointid,
  String description,
  Real actualinventorylevelend,
  Date manufactureddate
)
{
  TextBody:
  [*
    // Administrator Sep-6-2023 (created)
    date := Date :: Today();
    actualpispip := ActualProductInStockingPointInPeriod::FindActualProductInStockingPointInPeriodTypeIndex( productid, stockingpointid, date, manufactureddate );
    if( isnull( actualpispip ) ){
      ActualProductInStockingPointInPeriod::Create( owner,
                                                    productid,
                                                    stockingpointid,
                                                    description,
                                                    actualinventorylevelend,
                                                    date,
                                                    manufactureddate,
                                                    true);
      }else{
        actualpispip.Update( actualinventorylevelend, description, true );
        }
  *]
}
_Main/BL/Type_ActualProductInStockingPointInPeriod/_ROOT_Type_ActualProductInStockingPointInPeriod.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,6 @@
Quintiq file version 2.0
#root
#parent: #DomainModel
TypeSpecialization ActualProductInStockingPointInPeriod #extension
{
}
_Main/BL/Type_InventorySupply/StaticMethod_CreateOrUpdate.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,31 @@
Quintiq file version 2.0
#parent: #root
StaticMethod CreateOrUpdate (
  String id,
  Product_MP productmp,
  StockingPoint_MP stockingpoint,
  Date date,
  Date manufacturedate,
  Real userquantity,
  String description
)
{
  TextBody:
  [*
    // Administrator Sep-6-2023 (created)
    inventorysupply := InventorySupply::FindInventorySupplyTypeIndex( id );
    if( isnull( inventorysupply ) ){
      InventorySupply::Create(id,
                               productmp,
                               stockingpoint,
                               date,
                               manufacturedate,
                               userquantity,
                               description,
                               true);
      }else{
        inventorysupply.Update( userquantity );
        }
  *]
}
_Main/BL/Type_InventorySupply/_ROOT_Type_InventorySupply.qbl
¶Ô±ÈÐÂÎļþ
@@ -0,0 +1,6 @@
Quintiq file version 2.0
#root
#parent: #DomainModel
TypeSpecialization InventorySupply #extension
{
}
_Main/BL/Type_MacroPlan/Method_MappingActualPISPIPData.qbl
@@ -26,14 +26,22 @@
        for( i :=0 ;i < businessTypes.Size();i++ ){
          businessType := businessTypes.Element( i);
          if( product.BusinessType() = businessType and not product.IsCommon()){
            ActualProductInStockingPointInPeriod::Create( this,actual.ProductID(),actual.StockingPointID(),actual.Description(),actual.ActualInventoryLevelEnd(),
                                                  date,actual.ManufacturedDate(),true);
            ActualProductInStockingPointInPeriod::CreateOrUpdate( this,
                                                                  actual.ProductID(),
                                                                  actual.StockingPointID(),
                                                                  actual.Description(),
                                                                  actual.ActualInventoryLevelEnd(),
                                                                  actual.ManufacturedDate());
          }
        }
        
      }else{
        ActualProductInStockingPointInPeriod::Create( this,actual.ProductID(),actual.StockingPointID(),actual.Description(),actual.ActualInventoryLevelEnd(),
                                                  date,actual.ManufacturedDate(),true);
        ActualProductInStockingPointInPeriod::CreateOrUpdate( this,
                                                              actual.ProductID(),
                                                              actual.StockingPointID(),
                                                              actual.Description(),
                                                              actual.ActualInventoryLevelEnd(),
                                                              actual.ManufacturedDate());
      }
        
      }
_Main/BL/Type_MacroPlan/Method_MappingExternalSupplyData.qbl
@@ -30,15 +30,23 @@
          for( i :=0 ;i < businessTypes.Size();i++ ){
            businessType := businessTypes.Element( i);
            if( product.BusinessType() = businessType and not product.IsCommon()){
              InventorySupply::Create(externalSupply.ID(),productMP,stockingpoint,externalSupply.Date(),externalSupply.ManufacturedDate(),externalSupply.UserQuantity(),"在途在制",true);
              InventorySupply::CreateOrUpdate( externalSupply.ID(),
                                               productMP,
                                               stockingpoint,
                                               externalSupply.Date(),
                                               externalSupply.ManufacturedDate(),
                                               externalSupply.UserQuantity(),"在途在制");
            }
          }
          
        }else{
    //    productMP :=  Product_MP::FindById( this, externalSupply.ProductID() );
    //    stockingpoint := StockingPoint_MP::FindById( this, externalSupply.StockingPointID() );
        if( not isnull( stockingpoint) and not isnull( productMP)){
          InventorySupply::Create(externalSupply.ID(),productMP,stockingpoint,externalSupply.Date(),externalSupply.ManufacturedDate(),externalSupply.UserQuantity(),"在途在制",true);
          InventorySupply::CreateOrUpdate( externalSupply.ID(),
                                           productMP,
                                           stockingpoint,
                                           externalSupply.Date(),
                                           externalSupply.ManufacturedDate(),
                                           externalSupply.UserQuantity(),"在途在制");
        }
      
        }