Ejemplo n.º 1
0
 public function getFile($nFile)
 {
     $sql = 'SELECT agencia, nompax, CONVERT(Nvarchar(10), fecha, 103) as fecha, hora, CONVERT(Nvarchar(10), f_viaje, 103) as f_viaje, comag, tcomi, cambio, moneda, 
         totventa, ajuste, (totventa+ajuste) as tot_reserva, vage,ope,totpag,totalco,ciudad,pais
         ,npax, (convert(varchar,(DATEADD(HOUR,48,GETDATE())),103)+" "+convert(varchar(5),(DATEADD(HOUR,48,GETDATE())),108)) AS LIMITE_PAGO,
         estado,(convert(varchar,(DATEADD(HOUR,48,GETDATE())),103))as fconsulta,convert(varchar(5),(DATEADD(HOUR,48,GETDATE())),108) as fhora
         FROM file_ 
         WHERE num_file = "' . $nFile . '"';
     //echo $sql; exit;
     $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->setNomPax(trim($fileDB['nompax']));
             $objFile->setNpax(trim($fileDB['npax']));
             $objFile->setFecha(trim($fileDB['fecha']));
             $objFile->setHora(trim($fileDB['hora']));
             $objFile->setFViaje(trim($fileDB['f_viaje']));
             $objFile->setComag(trim($fileDB['comag']));
             $objFile->setTcomi(intval(trim($fileDB['tcomi'])));
             $objFile->setCambio(trim($fileDB['cambio']));
             $objFile->setMoneda(trim($fileDB['moneda']));
             $objFile->setTotVenta(trim($fileDB['totventa']));
             $objFile->setAjuste(trim($fileDB['ajuste']));
             $objFile->setChora(trim($fileDB['fhora']));
             $objFile->setFconsulta(trim($fileDB['fconsulta']));
             $objFile->setTotPag(trim($fileDB['totpag']));
             $objFile->setTotReserva(trim($fileDB['tot_reserva']));
             $objFile->setVage(trim($fileDB['vage']));
             $objFile->setOperador(trim($fileDB['ope']));
             $objFile->setTotalco(trim($fileDB['totalco']));
             $objFile->setEstado(trim($fileDB['estado']));
             $objFile->setPais(trim($fileDB['pais']));
             $objFile->setCiudad(trim($fileDB['ciudad']));
             $sql = 'SELECT piva  FROM iva';
             $datos = $this->_db->consulta($sql);
             $iva = $this->_db->fetchAll($datos);
             if ($fileDB['tcomi'] == 1) {
                 $resultado = $fileDB['comag'] * $iva[0][0];
             } else {
                 $resultado = $fileDB['comag'];
             }
             if ($fileDB['moneda'] === 'D') {
                 $comision = round($fileDB['totventa'] * ($resultado / 100), 2);
             } else {
                 $comision = round($fileDB['totventa'] * ($resultado / 100), 0);
             }
             $objFile->setComision($comision);
             $objFile->setHoraLimi(trim($fileDB['LIMITE_PAGO']));
             $objetosFile[] = $objFile;
         }
         return $objetosFile;
     } else {
         return false;
     }
 }
 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;
     }
 }