xiaoding721
2024-12-04 7738d23499684bc91a6907ddbe7f892983aa6de2
_Main/BL/Type_InventoryInterfaceData/StaticMethod_Generate.qbl
@@ -1,6 +1,7 @@
Quintiq file version 2.0
#parent: #root
StaticMethod Generate (
  MacroPlan macroplan,
  InterfaceDataset interfaceDataset,
  Date date,
  String partno,
@@ -16,9 +17,15 @@
    if( isnull( iid ) ){
      iid := interfaceDataset.InventoryInterfaceData( relnew, Date := date, PartNumber := partno );
    }
    product    := selectobject( macroplan, Product_MP, product, product.ID() = partno );
    if( not isnull( product ) and exists( product.GetAllParent(), Elements, proparent, proparent.ID() = 'PL' ) ){
      quantitiy   := floor( [Real]quantitiy / 4 );
    }
    iidl := selectobject( iid, InventoryInterfaceDataDetail, detail, detail.InventoryPoint() = inventory and detail.Fac() = fac );
    if( isnull( iidl ) ){
      iid.InventoryInterfaceDataDetail( relnew, Date := date, PartNumber := partno, InventoryPoint := inventory, Fac := fac, Quantity := quantitiy );
    }else{
      iidl.Quantity( );
    }
  *]
}