public function getFile($nFile)
 {
     $sql = 'SELECT [num_file], [tipof], [n_coti], CONVERT(Nvarchar(10), fecha, 103) as fecha, ' . 'CONVERT(Nvarchar(10), f_viaje, 103) as f_viaje, [npax], [agencia], [nompax], [naciona], [ope], ' . '[ciudad], [pais], [moneda], [cambio], [comag], [tcomi], [estado], [neto], [ajuste], [tticket], ' . '[totventa], [totalco], [totpag], [vage], [datos], [notas], [fecontab], [ftkt], [autmod], [estnul], ' . '[efactu], [totfac], [tipred], [totnc], [cfinal], [tt], [vta_age], [au_mg_me], [promoto], [feccierre], ' . '[diacierre], [montodesciva], [MRK], [vta_comagdes], [Referencia], [NegocioSigav], [atipoa], [Por_comi], ' . '[Tipo_comi], [Por_comip], [Tipo_comip], [area], [id_nodo] ' . 'FROM file_ ' . 'WHERE num_file = ' . $nFile;
     $datos = $this->_db->consulta($sql);
     if ($this->_db->numRows($datos) > 0) {
         $objetosFile = array();
         $arrayObjFile = $this->_db->fetchAll($datos);
         foreach ($arrayObjFile as $fileDB) {
             $objFile = new reservaDTO();
             $objFile->setAgencia(trim($fileDB['agencia']));
             $objFile->setVage(trim($fileDB['vage']));
             $objFile->setNomPax(trim($fileDB['nompax']));
             $objFile->setNpax(trim($fileDB['npax']));
             $objFile->setFViaje(trim($fileDB['f_viaje']));
             $objFile->setMoneda(trim($fileDB['moneda']));
             $objFile->setTotVenta(trim($fileDB['totventa']));
             $objFile->setCambio(trim($fileDB['cambio']));
             $objFile->setComag(trim($fileDB['comag']));
             $objFile->setDatos(trim($fileDB['datos']));
             $objFile->setAjuste(trim($fileDB['ajuste']));
             $objFile->setTcomi(intval(trim($fileDB['tcomi'])));
             $objFile->setFecha(trim($fileDB['fecha']));
             $objetosFile[] = $objFile;
         }
         return $objetosFile;
     } else {
         return false;
     }
 }
Ejemplo n.º 2
0
 public function getFileOK($file)
 {
     $sql = "SELECT num_file, ajuste+totventa as totv,moneda,cambio,tipof,n_coti,CONVERT(Nvarchar(10), fecha, 103) as fecha," . "CONVERT(Nvarchar(10), f_viaje, 103) as f_viaje,npax,agencia,nompax,naciona,ope,ciudad,pais,comag,tcomi,estado," . "neto,ajuste,tticket,totventa,totalco,totpag,vage,datos,notas,fecontab,ftkt,autmod,estnul,efactu,totfac,tipred," . "totnc,cfinal,tt,vta_age,au_mg_me,promoto,feccierre,diacierre,montodesciva,MRK,vta_comagdes,Referencia,NegocioSigav," . "atipoa,Por_comi FROM file_ f where num_file ={$file}";
     $datos = $this->_db->consulta($sql);
     if ($this->_db->numRows($datos) > 0) {
         $respuesta = $this->_db->fetchAll($datos);
         $file = new reservaDTO();
         foreach ($respuesta as $r) {
             $file->setMoneda(trim($r['moneda']));
             $file->setTotVenta(trim($r['totv']));
             $file->setCambio(trim($r['cambio']));
             $file->setAgencia(trim($r['agencia']));
             $file->setVage(trim($r['vage']));
             $file->setNomPax(trim($r['nompax']));
             $file->setNpax(trim($r['npax']));
             $file->setFViaje(trim($r['f_viaje']));
             $file->setVentaFinal(trim($r['totventa']));
             $file->setComag(trim($r['comag']));
             $file->setDatos(trim($r['datos']));
             $file->setAjuste(trim($r['ajuste']));
             $file->setTcomi(intval(trim($r['tcomi'])));
         }
         return $file;
     } else {
         return false;
     }
 }