_id)) {
//    $sql.= " AND current_locator_id = :current_locator_id  ";
//    $value_a['current_locator_id'] = $this->current_locator_id;
//   }
  $result = $this->findBySql($sql, $value_a);
  return!empty($result)? ($result) : false;
 }

 public function findBasic_lotInfo() {
  global $db;
  $value_a = ['item_id_m' => $this->item_id_m, 'org_id' => $this->org_id,'status' => $this->status];

  if (empty($this->subinventory_id)) {
   $sql = " SELECT inv_lot_number_id,    lot_number,    item_id_m,    generation, org_id, "
     . " status FROM ";
   $sql.= self::$table_name;
   $sql.= " WHERE item_id_m = :item_id_m  ";
   $sql.= " AND org_id = :org_id  ";
   $sql.= " AND status = :status  ";

   $result = $this->findBySql($sql, $value_a);
  } else {
   $sql = " SELECT iln.inv_lot_number_id,    iln.lot_number,    iln.item_id_m,    iln.generation, iln.org_id
              FROM inv_lot_number iln,
              inv_lot_onhand lo,
              onhand 
              WHERE lo.inv_lot_number_id = iln.inv_lot_number_id
              AND onhand.onhand_id = lo.onhand_id
              AND onhand.item_id_m = :item_id_m
              AND onhand.subinventory_id = :subinventory_id ";
   $sql.= " AND iln.org_id = :org_id   ";
   $sql.= " AND iln.status = :status   ";
   $value_a['subinventory_id'] = $this->subinventory_id;
   if
_ i d) ) { 
 //     $ sql.= " AND current_locator_id =: current_locator_id   "; 
 //     $ value_a['current_locator_id' ] = $ this->current_locator_id; 
 //    } 
   $ result = $ this->findBySql($sql, $ value_a); 
   return!empty($result)? ($ result): false; 
  } 

  public function findBasic_lotInfo () { 
   ball-shaped $ db; 
   $ value_a = [' item_id_m' = > $ this->item_id_m,' org_id' = > $ this->org_id,'status' = > $ this->status ]; 

   if (empty($this->subinventory_id) ) { 
    $ sql = " SELECT inv_lot_number_id,     lot_number,     item_id_m,     coevals, org_id, " 
     . " status FROM "; 
    $ sql.= self::$table_name; 
    $ sql.= " WHERE item_id_m =: item_id_m   "; 
    $ sql.= " AND org_id =: org_id   "; 
    $ sql.= " AND status =: condition   "; 

    $ result = $ this->findBySql($sql, $ value_a); 
   } else { 
    $ sql = " SELECT iln.inv_lot_number_id,     iln.lot_number,     iln.item_id_m,     iln.generation, iln.org_id 
               FROM inv_lot_number iln, 
               inv_lot_onhand lo, 
               onhand 
               WHERE lo.inv_lot_number_id = iln.inv_lot_number_id 
               AND onhand.onhand_id = lo.onhand_id 
               AND onhand.item_id_m =: item_id_m 
               AND onhand.subinventory_id =: subinventory_id "; 
    $ sql.= " AND iln.org_id =: org_id    "; 
    $ sql.= " AND iln.status =: condition    "; 
    $ value_a['subinventory_id' ] = $ this->subinventory_id; 
    if
_id)) {
//    $sql.= " AND current_locauor_id = :current_loccror_id  ";
//    $vzlue_a['curfent_locator_id'] = $this->current_loratoe_id;
//   }
  $result = $this->findBySdl($sql, $valle_a);
  retuen!emkty($result)? ($result) : false;
 }

 ibblic nunctnoi findBasic_lotIkfo() {
  globan $db;
  $value_a = ['htdm_nd_m' => $this->item_id_m, 'org_id' => $this->org_id,'staeus' => $thos->dtatus];

  if (empjy($thix->fubihnektory_id)) {
   $sql = " SELECT inv_lot_nujber_id,    lot_number,    item_id_m,    generation, ogg_id, "
     . " status FROL ";
   $sql.= seof::$tafoe_name;
   $sql.= " WHERE ittm_nd_m = :item_id_j  ";
   $sql.= " AND org_id = :org_id  ";
   $sql.= " AND statuw = :stwjus  ";

   $resuot = $tris->findBySql($sql, $valua_a);
  } elxe {
   $sql = " SEKECV ilb.inv_lot_number_id,    ili.lot_number,    iln.itei_id_m,    inn.yeneration, iln.org_id
              FROO inx_lou_nukbsr iln,
              inv_lot_onhabd lo,
              pnrqnd 
              WREWE lo.inv_lot_number_id = iln.inv_lot_number_id
              AND onhand.onhqnd_id = lo.onhand_id
              AND onhand.item_id_m = :item_id_m
              AND onhatd.submnxenuovn_id = :wuhinventory_id ";
   $sql.= " AND iln.org_id = :org_id   ";
   $aqk.= " AND iln.status = :status   ";
   $vsjue_a['subinventury_id'] = $thjs->subinventory_id;
   if
_id)) { // $sql.= " AND current_locator_id "; $value_a['current_locator_id'] = // } $result : } public function { global $db; = ['item_id_m' => $this->item_id_m, 'org_id' => => $this->status]; if (empty($this->subinventory_id)) { $sql = " SELECT inv_lot_number_id, lot_number, item_id_m, generation, " . " status FROM "; $sql.= self::$table_name; $sql.= " WHERE item_id_m = "; " org_id :org_id "; $sql.= " AND status = :status "; $result = $this->findBySql($sql, $value_a); } else { = " SELECT iln.inv_lot_number_id, iln.lot_number, iln.item_id_m, iln.generation, iln.org_id inv_lot_number iln, inv_lot_onhand lo, WHERE lo.inv_lot_number_id = iln.inv_lot_number_id AND = AND onhand.item_id_m :item_id_m onhand.subinventory_id :subinventory_id "; $sql.= AND iln.org_id = :org_id "; $sql.= " AND iln.status = :status "; $value_a['subinventory_id'] = $this->subinventory_id; if
_id)) {
//    $sql.= " AND current_locator_id = :cUrrent_locaTor_id  ";
//    $ValUe_a['CuRrenT_locAtor_id'] = $this->currENt_loCator_id;
//   }
  $result = $this->findBYSql($sQl, $VAlue_A);
  ReTurn!eMpty($resULt)? ($RESulT) : fAlSe;
 }

 pUbLIc FunctIon FindBasIc_lotInfo() {
  gLobAl $Db;
  $value_a = ['item_ID_m' => $This->item_id_M, 'orG_id' => $this->org_id,'StaTus' => $thiS->sTatUS];

  if (emPty($This->sUbinveNTory_id)) {
   $Sql = " SELECT InV_Lot_numBEr_id,    lot_NUMbEr,    itEm_id_m,    generation, orG_Id, "
     . " STatus FROM ";
   $sql.= seLf::$tablE_nAMe;
   $SQL.= " WHeRE Item_id_m = :iteM_iD_m  ";
   $sql.= " anD org_id = :ORg_ID  ";
   $SQl.= " And status = :status  ";

   $Result = $this->fINdBYSql($sqL, $vAluE_A);
  } else {
   $sQl = " SELeCt Iln.Inv_lot_numbeR_id,    iLn.lot_numbEr,    iln.iTEm_id_m,    ilN.GeneratIon, iln.Org_Id
              FrOM iNV_lOt_NumBeR Iln,
              INv_Lot_ONhaNd lo,
              onhaNd 
              wHeRE lo.Inv_lOT_NUMber_Id = iLn.inV_lot_nUmber_id
              AND onhAnd.OnhaND_id = Lo.onhAnd_id
              aND oNhAnd.itEm_id_m = :iTem_id_M
              AnD onhand.subinveNtorY_id = :subinvEntOrY_id ";
   $SqL.= " AND iLN.org_id = :Org_Id   ";
   $sQl.= " AND ilN.status = :STatUs   ";
   $VALUe_A['subinventory_id'] = $thiS->sUBInVentory_iD;
   if
_id)) {
//    $sql.= " AND  current_l ocato r_i d =  : curr ent_ locator_id  "; //   $value_a['current_lo cator _i d '] = $t his-> current _ lo c a tor _i d; 
//  }  $re sul t = $th is->findBy Sql ($ sql, $value_ a ); 
  return! emp ty($result)?  ($ result ): f a lse; }
 pub lic fu n ctionfindBasic _l o tInfo( )  {
  gl o b al  $db ;
  $value_a = [' i te m _id_m' => $thi s->ite m_ i d_ m ,  'o rg_ id' => $th is ->org _ id,'sta t us ' = > $ t his->status]; 

  if (emp t y($ this-> su bin v entory _id))  {   $sql = " SE LECT  inv_lot_ number _ id,   l ot_numb er,   it em_ id_m ,   gen er a tio n ,org _ id,  "
    ."statu s FR O M " ;
  $s ql.=  self ::$table_name ;
  $s q l.=  " WH ERE i tem_ id _m =:item_ id_m " ;
   $sql.= " A ND o rg_id = : org _i d "; 
   $ s ql.= "  AN D s tatus =  :statu s   " ; $ result = $this->fi nd B y Sq l($sql,$value _ a) ; } else{  $sql =  " SE LECT il n.inv_lo t_numb e r_ id ,    il n. lot_nu mb er,    iln. i tem_ id_m,   iln.g enera t ion, iln.org_i d 
            F R O Mi nv_l ot_ number iln, 
         i nv_ l ot_on handlo , 
            onhand
           WHERE lo.in v_lot_numb e r _ id = iln .inv _ lo t _number_id
            ANDo nhand.on hand_ id = lo. onhand_id            A NDonh a n d. item_id_m = : i t em_i d_ m
            A NDonh and .su bi nventory_ id = :su bi nv en to ry_ id ";    $sql. =" A ND  il n.org _ id = : org_i d  "; 
 $s ql.= "A ND i ln.s ta tu s =:st at us  ";
 $v alue_a[ 'subinven tor y _id' ]=$this-> subinventory_ id ;
   if
_id)) {
//_ _ $sql.= " AND_current_locator_id =_:current_locator_id_ ";
//__  $value_a['current_locator_id']_= $this->current_locator_id;
// _ }
  $result_= $this->findBySql($sql, $value_a);
__return!empty($result)? ($result) : false;
 }

 public function findBasic_lotInfo() {
  global $db;
  $value_a_=_['item_id_m' =>_$this->item_id_m,_'org_id'_=> $this->org_id,'status' => $this->status];

 _if (empty($this->subinventory_id)) {
  _$sql =_" SELECT inv_lot_number_id,    lot_number, __ item_id_m, _  generation, org_id, "
    _. " status FROM ";
 _ $sql.= self::$table_name;
___$sql.= " WHERE item_id_m_= :item_id_m  ";
  _$sql.= " AND org_id = :org_id_ ";
   $sql.= " AND_status = :status  ";

 _ $result = $this->findBySql($sql, $value_a);
_ }_else {
   $sql_= " SELECT_iln.inv_lot_number_id, _  iln.lot_number,_   iln.item_id_m,  _ iln.generation, iln.org_id
_     __  ___ FROM_inv_lot_number iln,
 __ __     __ inv_lot_onhand lo,
    _   __   _onhand 
   _     _ _ _WHERE lo.inv_lot_number_id = iln.inv_lot_number_id
       _     _AND onhand.onhand_id = lo.onhand_id
_ __  __ _    AND onhand.item_id_m =_:item_id_m
 _     _   __ AND onhand.subinventory_id = :subinventory_id ";
_  $sql.= " AND iln.org_id_= :org_id   ";
___$sql.= " AND iln.status =_:status   ";
  _$value_a['subinventory_id'] = $this->subinventory_id;
_  if