$sql = "SELECT id from transfer_type WHERE direction = 'in' and description = 'stock'";
$rs = $this->db->getOne($sql);
$this->transtype = $rs['id'];
$sql = "SELECT id from transfer_type WHERE direction = 'in' and description = 'stock'";
$rs = $this->db->getOne($sql);
$this->transtype = $rs['id'];