if($keyR[$i]){ $q = "UPDATE OC set status='pendiente' WHERE keyR='".$keyR[$i]."'"; //mysql_db_query($basedatos,$q); echo mysql_error(); } } $link=new ventanasPrototype(); $mensaje=new ventanasPrototype(); $link->links(); $mensaje->despliegaMensaje('Se hizo una solicitud de compra'); ?> <script> window.close(); </script> <?php } ?> <script language=javascript>
public function eCCI($usuario, $entidad, $folioVenta, $basedatos) { $cargosCia = new acumulados(); //**********************************CANDADO PRINCIPAL********************** /* $bali=$almacen; $sSQLC= "Select * From statusCaja where entidad='".$entidad."' and usuario='".$usuario."' order by keySTC DESC "; $resultC=mysql_db_query($basedatos,$sSQLC); $myrowC = mysql_fetch_array($resultC); $sSQL1= "Select usuario,folioVenta From transacciones WHERE entidad='".$entidad."' and folioVenta ='".$_GET['folioVenta']."' "; $result1=mysql_db_query($basedatos,$sSQL1); $myrow1 = mysql_fetch_array($result1); echo mysql_error(); if($myrow1['folioVenta'] AND $myrow1['usuario']!=$usuario){ ?> <script> window.alert("Este proceso est� siendo utilizado por: (<?php echo $myrow1['usuario'];?>) y s�lo el puede terminar este proceso"); window.close(); </script> <?php } else if(!$myrow1['folioVenta']){ $agrega = "INSERT INTO transacciones ( folioVenta,usuario,fecha,hora,keyCatC,entidad) values ('".$_GET['folioVenta']."','".$usuario."','".$fecha1."','".$hora1."','".$myrowC['keyCatC']."' ,'".$entidad."' ) "; mysql_db_query($basedatos,$agrega); echo mysql_error(); } */ //************************************CANDADO DE USUARIO ?> <?php if ($_POST['cerrar']) { $particular = $_POST['particular']; $aseguradora = $_POST['aseguradora']; //cierro cuenta $agrega4 = "UPDATE clientesInternos set \r\ntipoCuenta='H',\r\nstatus='cerrada',\r\nstatusCuenta='cerrada',\r\nusuarioCierre='" . $usuario . "',\r\nfechaCierre='" . $fecha1 . "',\r\nhoraCierre='" . $hora1 . "',\r\nstatusCaja='pagado'\r\nwhere\r\nentidad='" . $entidad . "'\r\nand\r\nfolioVenta='" . $_GET['folioVenta'] . "' "; mysql_db_query($basedatos, $agrega4); echo mysql_error(); //********************CIERRO STATUS CUENTA*********************** $agrega = "UPDATE cargosCuentaPaciente set \r\nstatusCuenta='cerrada'\r\nwhere\r\nentidad='" . $entidad . "'\r\nand\r\nfolioVenta='" . $_GET['folioVenta'] . "'"; mysql_db_query($basedatos, $agrega); echo mysql_error(); //********************************************* //cierro cuarto a sucio if ($myrow3['cuarto']) { $agregad = "UPDATE cuartos set \r\nstatus='sucio',\r\nusuarioSalida='" . $usuario . "',\r\nfechaSalida='" . $fecha1 . "',\r\nhoraSalida='" . $hora1 . "'\r\n\r\nwhere\r\nentidad='" . $entidad . "'\r\nand\r\ncodigoCuarto='" . $myrow3['cuarto'] . "' \r\n"; //mysql_db_query($basedatos,$agregad); echo mysql_error(); } $leyenda = 'Se cerr� la cuenta'; $sSQL3 = "Select * From clientesInternos WHERE entidad='" . $entidad . "' and folioVenta = '" . $_GET['folioVenta'] . "' "; $result3 = mysql_db_query($basedatos, $sSQL3); $myrow3 = mysql_fetch_array($result3); if ($myrow3['status'] == 'cerrada' and $myrow3['statusCuenta'] == 'cerrada') { ?> <script> window.opener.document.forms["form1"].submit(); window.alert("Cuenta Cerrada"); //window.close(); </script> <?php } else { ?> <script> window.opener.document.forms["form1"].submit(); window.alert("Hay un problema con la cuenta"); //window.close(); </script> <?php } } ?> <script language=javascript> function ventanaSecundaria2 (URL){ window.open(URL,"ventana2","width=630,height=500,scrollbars=YES,scrollbars=YES,resizable=YES, maximizable=YES") } </script> <script language=javascript> function ventanaSecundaria7 (URL){ window.open(URL,"ventanaSecundaria7","width=1024,height=800,scrollbars=YES,resizable=YES, maximizable=YES") } </script> <script> var win = null; function nueva(mypage,myname,w,h,scroll){ LeftPosition = (screen.width) ? (screen.width-w)/2 : 0; TopPosition = (screen.height) ? (screen.height-h)/2 : 0; settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable' win = window.open(mypage,myname,settings) if(win.window.focus){win.window.focus();} } </script> <?php //************************ACTUALIZO ********************** //Llenado de datos $sSQL3 = "Select * From clientesInternos WHERE keyClientesInternos = '" . $_GET['nT'] . "' "; $result3 = mysql_db_query($basedatos, $sSQL3); $myrow3 = mysql_fetch_array($result3); $numeroE = $myrow3['numeroE']; $nCuenta = $myrow3['nCuenta']; $cuarto = $myrow3['cuarto']; $seguroT = ltrim($myrow3['seguro']); //***************aplicar pago********************** ?> <?php if ($_POST['imprimir']) { if ($_GET['paquete'] == 'si') { ?> <script language="javascript"> nueva('<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /cargos/imprimirReciboPaquetes.php?numeroE=<?php echo $myrow3['numeroE']; ?> &nCuenta=<?php echo $myrow3['nCuenta']; ?> &keyClientesInternos=<?php echo $myrow3['keyClientesInternos']; ?> &paciente=<?php echo $_POST['paciente']; ?> &numeroConfirmacion=<?php echo $numeroConfirmacion; ?> &hora1=<?php echo $hora1; ?> &cajero=<?php echo $usuario; ?> &codigoPaquete=<?php echo $myrow3['codigoPaquete']; ?> &numRecibo=<?php echo $myrowC['numRecibo']; ?> &paciente=<?php echo $_POST['paciente']; ?> &cantidadRecibida=<?php echo $_POST['cantidadRecibida']; ?> &folioVenta=<?php echo $myrow3['folioVenta']; ?> &fechaSolicitud=<?php print $_POST['variable_php']; ?> ','ventana7','800','600','yes'); //window.opener.document.form10["form10"].submit(); //window.alert("sandra"); window.close(); </script> <?php } else { ?> <script> nueva('<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /cargos/imprimirCargosPA.php?numeroE=<?php echo $numeroE; ?> &nCuenta=<?php echo $nCuenta; ?> &keyClientesInternos=<?php echo $nT; ?> &paciente=<?php echo $_POST['paciente']; ?> &numeroConfirmacion=<?php echo $numeroConfirmacion; ?> &hora1=<?php echo $hora1; ?> &cajero=<?php echo $usuario; ?> &fechaSolicitud=<?php print $_POST['variable_php']; ?> ','ventana7','800','600','yes'); //window.opener.document.form10["form"].submit(); window.close(); </script> <?php } ?> <?php } ?> <?php $sSQL3 = "Select * From clientesInternos WHERE entidad='" . $entidad . "' and folioVenta = '" . $_GET['folioVenta'] . "' "; $result3 = mysql_db_query($basedatos, $sSQL3); $myrow3 = mysql_fetch_array($result3); //***************aplicar pago********************** if ($myrow3['statusCuenta'] == 'cerrada' and $myrow3['status'] == 'cerrada') { echo "LA CUENTA DEL PACIENTE " . $myrow3['paciente'] . " ESTA CERRADA..."; ?> <input name="print" type="button" class="normal" id="print" value="Imprimir EC" onClick="ventanaSecundaria7('<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /INGRESOS HLC/caja/imprimirEstadoCuenta.php?numeroE=<?php echo $myrow['numeroE']; ?> &nCuenta=<?php echo $myrow['nCuenta']; ?> &almacen=<?php echo $ALMACEN; ?> &almacenFuente=<?php echo $ALMACEN; ?> &keyClientesInternos=<?php echo $myrow3['keyClientesInternos']; ?> &tipoCliente=<?php echo $tipoCliente; ?> &tipoMovimiento=<?php echo 'cierreCuenta'; ?> &tipoPaciente=interno&folioVenta=<?php echo $myrow3['folioVenta']; ?> ');"> <?php } else { ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <html xmlns="http://www.w3.org/1999/xhtml"> <title></title> <?php $link = new ventanasPrototype(); $link->links(); $estilo = new muestraEstilos(); $estilo->styles(); ?> <?php include CONSTANT_PATH_CONFIGURACION . '/clases/encabezado.php'; ?> <?php include CONSTANT_PATH_CONFIGURACION . '/clases/mostrarDatosCuenta.php'; ?> <?php include CONSTANT_PATH_CONFIGURACION . '/clases/mostrarEfectuarTransacciones.php'; ?> </html> <?php } }
public function listaInternos($entidad, $TITULO, $ventana, $basedatos) { ?> <script language=javascript> function ventanaSecundaria11 (URL){ window.open(URL,"ventana11","width=800,height=600,scrollbars=YES,resizable=YES, maximizable=YES") } </script> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title></title> <style type="text/css"> .style11 {color: #FFFFFF; font-size: 10px; font-weight: bold; } .style12 {font-size: 10px} .style7 {font-size: 9px} .style13 {color: #FFFFFF} .enlace {cursor:default;} div.htmltooltip{ position: absolute; /*leave this and next 3 values alone*/ z-index: 1000; left: -1000px; top: -1000px; background: #272727; border: 10px solid black; color: white; padding: 3px; width: 250px; /*width of tooltip*/ } </style> </head> <META HTTP-EQUIV="Refresh" CONTENT="60"> <body> <?php require CONSTANT_PATH_CONFIGURACION . "/funciones.php"; ventanasPrototype::links(); ?> <form id="form1" name="form1" method="get" action="#"> <h1 align="center"> <?php echo $TITULO; ?> </h1> <table width="707" border="0.2" align="center"> <tr> <th width="49" bgcolor="#660066" class="style12" scope="col"><div align="left"><span class="style11 style13"># Folio </span></div></th> <th bgcolor="#660066" class="style12" scope="col"><div align="left"><span class="style11 style13">Nombre del paciente:</span></div></th> <th bgcolor="#660066" class="style12" scope="col"><span class="style121"><span class="style11 style13">Seguro</span></span></th> <th bgcolor="#660066" class="style12" scope="col"><div align="left"><span class="style11 style13">Cuarto</span></div></th> <th bgcolor="#660066" class="style12" scope="col"><div align="left"><span class="style11 style13">Hora Inicial </span></div></th> <th bgcolor="#660066" class="style12" scope="col"><div align="left"><span class="style11 style13">Hora Actual </span></div></th> <th bgcolor="#660066" class="style12" scope="col"><div align="left"><span class="style11 style13">TOTAL</span></div></th> </tr> <tr> <?php $sSQL = "SELECT *\r\nFROM\r\nclientesInternos \r\nWHERE \r\nentidad='" . $entidad . "'\r\nAND\r\n(tipoPaciente='interno' or tipoPaciente='urgencias')\r\nand\r\nstatusCuenta = 'abierta'\r\nand\r\nstatus='activa'\r\nand \r\n(statusDeposito='pagado' or statusDeposito='cxc' or statusDeposito='urgencias')\r\nORDER BY keyClientesInternos DESC\r\n "; if ($result = mysql_db_query($basedatos, $sSQL)) { while ($myrow = mysql_fetch_array($result)) { if ($col) { $color = '#FFCCFF'; $col = ""; } else { $color = '#FFFFFF'; $col = 1; } $seguro = $myrow['seguro']; $nT = $myrow['keyClientesInternos']; $sSQL1711 = "\r\n\tSELECT \r\nnomCliente\r\nFROM\r\nclientes\r\nWHERE \r\nnumCliente = '" . $seguro . "'\r\n\r\n"; $result1711 = mysql_db_query($basedatos, $sSQL1711); $myrow1711 = mysql_fetch_array($result1711); $seguro = $myrow1711['nomCliente']; if ($seguro) { $tipoCliente = 'aseguradora'; } else { $tipoCliente = 'particular'; } if (!$seguro) { $seguro = 'particular'; } ?> <td height="24" bgcolor="<?php echo $color; ?> " class="style12"><span class="style7"> <?php echo $myrow['keyClientesInternos']; ?> </span></td> <td width="249" bgcolor="<?php echo $color; ?> " class="style12"><span class="style7"> <a href="#" onClick="javascript:ventanaSecundaria11('<?php echo $ventana; ?> ?numeroE=<?php echo $myrow['numeroE']; ?> &nCuenta=<?php echo $myrow['nCuenta']; ?> &almacen=<?php echo $ALMACEN; ?> &nT=<?php echo $nT; ?> &tipoCliente=<?php echo $tipoCliente; ?> ')"> <?php echo $myrow['paciente']; ?> </a> <input name="nombrePaciente" type="hidden" id="nombrePaciente" value="<?php echo $nombrePaciente; ?> "/> <input name="tipoSeguro" type="hidden" id="tipoSeguro" value="<?php echo $seguro; ?> "/> </span></td> <td width="69" bgcolor="<?php echo $color; ?> " class="style12"><span class="style121"><span class="style71"> <?php echo $seguro; ?> </span></span></td> <td width="49" bgcolor="<?php echo $color; ?> " class="style12"><span class="style7"><?php echo $myrow['cuarto']; ?> </span></td> <td width="98" bgcolor="<?php echo $color; ?> " class="style12"> </td> <td width="84" bgcolor="<?php echo $color; ?> " class="style12"> </td> <td width="79" bgcolor="<?php echo $color; ?> " class="style12"> </td> </tr> <?php } } ?> <input name="menu" type="hidden" value="<?php echo $menu; ?> " /> </table> <?php $titulo = 'prueba'; $url = $ventana; $abajo = 70; $izquierda = 0; $ancho = 300; $alto = 200; //$ventanas=new ventanasPrototype(); //$ventanas->despliegaVentana($titulo,$url,$abajo,$izquierda,$anchura,$altura); ?> <p> </p> </form> </body> </html> <?php }
public function listaExternos($usuario, $ALMACEN, $entidad, $TITULO, $fecha1, $ventana, $basedatos) { $sSQLC = "Select * From statusCaja where entidad='" . $entidad . "' and usuario='" . $usuario . "' order by keySTC DESC "; $resultC = mysql_db_query($basedatos, $sSQLC); $myrowC = mysql_fetch_array($resultC); if ($myrowC['status'] == 'abierta') { //*******************Comienzo la validaci�n***************** ?> <script language=javascript> function ventanaSecundaria (URL){ window.open(URL,"ventana","width=800,height=600,scrollbars=YES,resizable=YES, maximizable=YES") } </script> <script language="javascript" type="text/javascript"> var win = null; function nueva(mypage,myname,w,h,scroll){ LeftPosition = (screen.width) ? (screen.width-w)/2 : 0; TopPosition = (screen.height) ? (screen.height-h)/2 : 0; settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable' win = window.open(mypage,myname,settings) if(win.window.focus){win.window.focus();} } </script> <!-Hoja de estilos del calendario --> <link rel="stylesheet" type="text/css" media="all" href="<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /calendario/calendar-brown.css" title="win2k-cold-1" /> <!-- librer�a principal del calendario --> <script type="text/javascript" src="<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /calendario/calendar.js"></script> <!-- librer�a para cargar el lenguaje deseado --> <script type="text/javascript" src="<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /calendario/lang/calendar-es.js"></script> <!-- librer�a que declara la funci�n Calendar.setup, que ayuda a generar un calendario en unas pocas l�neas de c�digo --> <script type="text/javascript" src="<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /calendario/calendar-setup.js"></script> <script type="text/javascript" src="<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /js/wz_tooltip.js"></script> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <style type="text/css"> <!-- .Estilo24 {font-size: 13px} --> </style> <head> <?php $estilos = new muestraEstilos(); $estilos->styles(); ?> <meta http-equiv="refresh" content="30" > </head> <body> <?php if ($_GET['fechaInicial']) { $date = $_GET['fechaInicial']; } else { $date = $fecha1; } ?> <form id="form10" name="form10" method="get" action="#"> <h1 align="center" class="titulo"> <?php echo $TITULO; ?> </h1> <p align="center" class="titulo"> <label> <input onChange="this.form.submit();" name="fechaInicial" type="text" class="Estilo24" id="campo_fecha" size="10" maxlength="9" readonly="" value="<?php echo $date; ?> "/> </label> <input name="button" type="button" class="Estilo24" id="lanzador" value="..." /> </p> <img src="<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /imagenes/bordestablas/borde1.png" width="864" height="24" /> <table width="864" border="0.2" align="center" cellpadding="4" cellspacing="0"> <tr bgcolor="#FFFF00"> <th width="85" class="blanco" scope="col"><div align="left">Referencia</div></th> <th width= "195" class="blanco" scope="col"><div align="left">Nombre del paciente:</div></th> <th width= "260" class="blanco" scope="col"><div align="left">Aseguradora</div></th> <th class="blanco" scope="col"><div align="left">Departamento</div></th> <th class="blanco" scope="col"><div align="left">Usuario</div></th> <th class="blanco" scope="col">Aplicar</th> </tr> <tr> <?php $sSQL = "SELECT *\r\nFROM\r\nclientesInternos,cargosCuentaPaciente\r\nWHERE \r\nclientesInternos.entidad='" . $entidad . "' AND\r\nclientesInternos.keyClientesInternos=cargosCuentaPaciente.keyClientesInternos\r\nAND\r\ncargosCuentaPaciente.statusCargo='cargado'\r\nAND\r\nclientesInternos.status='activa' \r\nand \r\nclientesInternos.tipoPaciente='interno'\r\nAND\r\n((clientesInternos.almacenSolicitud!='' and clientesInternos.fechaSolicitud='" . $date . "' ) \r\nor\r\n(clientesInternos.fecha1='" . $date . "' )) \r\ngroup by clientesInternos.keyClientesInternos\r\nORDER BY clientesInternos.nomCliente DESC\r\n "; if ($result = mysql_db_query($basedatos, $sSQL)) { while ($myrow = mysql_fetch_array($result)) { $numeroE = $myrow['numeroE']; $nCuenta = $myrow['nCuenta']; if ($col) { $color = '#FFCCFF'; $col = ""; } else { $color = '#FFFFFF'; $col = 1; } $nT = $myrow['keyClientesInternos']; ?> <td height="24" bgcolor="<?php echo $color; ?> " class="codigos"><?php echo $myrow['folioVenta']; ?> </td> <td width="195" bgcolor="<?php echo $color; ?> " class="normal"> <?php $verificaCargos = new acumulados(); $verificaCargos->verificaCargos($basedatos, $usuario, $numeroE, $nCuenta); if ($myrow['paciente']) { ?> <?php echo $myrow['paciente']; ?> <?php } else { ?> <?php echo $myrow['paciente'] . " [NO TIENE NINGUN CARGO]"; ?> <?php } ?> <input name="nombrePaciente" type="hidden" id="nombrePaciente" value="<?php echo $nombrePaciente; ?> "/> <input name="tipoSeguro" type="hidden" id="tipoSeguro" value="<?php echo $myrow['seguro']; ?> "/> </span></td> <td width="260" bgcolor="<?php echo $color; ?> " class="normal"><?php if ($myrow['seguro']) { $numCliente = $myrow['seguro']; $sSQL17 = "\r\n\tSELECT \r\n*\r\nFROM\r\nclientes\r\nWHERE \r\nnumCliente = '" . $numCliente . "'\r\n"; $result17 = mysql_db_query($basedatos, $sSQL17); $myrow17 = mysql_fetch_array($result17); echo $myrow17['nomCliente']; } else { echo "Sin Seguro"; } ?> </span></td> <td width="179" bgcolor="<?php echo $color; ?> " class="normal"><?php $al = $myrow['almacen']; $sSQL17 = "\r\n\tSELECT \r\ndescripcion\r\nFROM\r\nalmacenes\r\nWHERE \r\nalmacen = '" . $al . "'\r\n"; $result17 = mysql_db_query($basedatos, $sSQL17); $myrow17 = mysql_fetch_array($result17); echo $myrow17['descripcion']; ?> </td> <td width="70" bgcolor="<?php echo $color; ?> " class="codigos"><?php echo $myrow['usuario']; ?> </td> <td width="49" bgcolor="<?php echo $color; ?> " class="normal" align="center"><label> <a href="javascript:nueva('estadoCuentaE.php?numeroE=<?php echo $myrow['keyClientesInternos']; ?> &nCuenta=<?php echo $myrow['keyClientesInternos']; ?> &almacenSolicitante=<?php echo $ALMACEN; ?> &nT=<?php echo $nT; ?> &folioVenta=<?php echo $myrow['folioVenta']; ?> &tipoVenta=<?php echo 'externo'; ?> ','ventana1','800','600','yes')"><img src="<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /imagenes/btns/aplybtn.png" alt="Almacén ó Médico Activo" width="30" height="24" border="0"/> </a> </label></td> </tr> <?php } } ?> <input name="menu" type="hidden" value="<?php echo $menu; ?> " /> </table> <img src="../imagenes/bordestablas/borde2.png" width="864" height="24" /> <p> </p> </form> <script type="text/javascript"> Calendar.setup({ inputField : "campo_fecha", // id del campo de texto ifFormat : "%Y-%m-%d", // formato de la fecha que se escriba en el campo de texto button : "lanzador" // el id del bot�n que lanzar� el calendario }); </script> </body> </html> <?php } else { $link = new ventanasPrototype(); $mensaje = new ventanasPrototype(); $link->links(); $mensaje->despliegaMensaje('LA CAJA ESTA CERRADA'); } ?> <?php }
public function eCuentaE($descripcionTransaccion, $mostrar, $usuario, $entidad, $almacen, $fecha1, $hora1, $dia, $usu, $nT, $basedatos) { $cargosCia = new acumulados(); $sSQLCent = "Select * From entidades where codigoEntidad='" . $entidad . "'"; $resultCent = mysql_db_query($basedatos, $sSQLCent); $myrowCent = mysql_fetch_array($resultCent); if ($myrowCent['rutaRecibo'] != NULL and $myrowCent['rutaReciboPaquete'] != NULL) { //**********************************CANDADO PRINCIPAL********************** $bali = $almacen; $agrega = "INSERT INTO logs (\r\ndescripcion,almacenSolicitante,almacenDestino,usuario,hora,fecha,entidad,folioVenta,cuartoIngreso,cuartoTransferido)\r\nvalues\r\n('ABRiO EL ESTADO DE CUENTA DE CAJA','" . $bali . "','" . $ALMACEN . "',\r\n'" . $usuario . "','" . $hora1 . "','" . $fecha1 . "','" . $entidad . "','" . $_GET['folioVenta'] . "',\r\n'','')"; //mysql_db_query($basedatos,$agrega); echo mysql_error(); $sSQLC = "Select * From statusCaja where entidad='" . $entidad . "' and usuario='" . $usuario . "' order by keySTC DESC "; $resultC = mysql_db_query($basedatos, $sSQLC); $myrowC = mysql_fetch_array($resultC); $sSQL1 = "Select usuario,folioVenta,keyT From transacciones WHERE entidad='" . $entidad . "' and folioVenta ='" . $_GET['folioVenta'] . "' "; $result1 = mysql_db_query($basedatos, $sSQL1); $myrow1 = mysql_fetch_array($result1); echo mysql_error(); $sSQL1d = "Select * From clientesInternos WHERE entidad='" . $entidad . "' and folioVenta ='" . $_GET['folioVenta'] . "' "; $result1d = mysql_db_query($basedatos, $sSQL1d); $myrow1d = mysql_fetch_array($result1d); echo mysql_error(); /* $sSQL1tv= "Select * From transacciones WHERE entidad='".$entidad."' and usuario ='".$usuario."' and status='standby' "; $result1tv=mysql_db_query($basedatos,$sSQL1tv); $myrow1tv = mysql_fetch_array($result1tv); echo mysql_error(); if(($myrow1tv['folioVenta']!=NULL and $myrow1tv['folioVenta']!=$_GET['folioVenta']) and $myrow1d['tipoPaciente']=='externo'){//candado?> <script> window.alert("ERROR: PARA PODER CONTINUAR DEBES FINALIZAR LA TRANSACCION DEL FOLIO: <?php echo $myrow1tv['folioVenta'];?> y esta en la fecha <?php echo cambia_a_normal($myrow1tv['fecha']);?>"); window.close(); </script> <?php } */ if ($myrow1d['tipoPaciente'] == 'externo' and $_POST['imprimir'] != NULL) { //***************C A S O 2 ****************** if ($myrow1['folioVenta'] and $myrow1['usuario'] != $usuario) { ?> <script> window.alert("Este proceso esta siendo utilizado por: (<?php echo $myrow1['usuario']; ?> ) y solo el puede terminar este proceso"); window.close(); </script> <?php } //*******TRASPASO AL MODULO DE FACTURACION AUTOMATICO******* $sSQLef = "SELECT\r\n *\r\n FROM\r\n cargosCuentaPaciente\r\n WHERE \r\n entidad='" . $entidad . "'\r\n and\r\n folioVenta='" . $_GET['folioVenta'] . "'\r\n and\r\n gpoProducto!=''\r\n and \r\n cantidadParticular>0\r\n "; $resultef = mysql_db_query($basedatos, $sSQLef); $myrowef = mysql_fetch_array($resultef); if ($myrowef['cantidadParticular'] > 0) { if ($myrow1d['statusDevolucion'] != 'si') { //GENERO LA SOLICITUD $sSQL8aa3 = "\r\nSELECT max(contador)+1 as n\r\nFROM\r\ncontadorFacturas\r\nWHERE\r\nentidad='" . $entidad . "'\r\n "; $result8aa3 = mysql_db_query($basedatos, $sSQL8aa3); $myrow8aa3 = mysql_fetch_array($result8aa3); $n = $myrow8aa3['n']; if (!$n) { $n = 1; } //asigno valor $_GET['numSolicitud'] = $n; $agrega = "INSERT INTO contadorFacturas (\r\nusuario,contador,entidad\r\n) values (\r\n'" . $usuario . "','" . $n . "','" . $entidad . "'\r\n)"; mysql_db_query($basedatos, $agrega); echo mysql_error(); //ACTUALIZAR ENCABEZA $actualiza = "UPDATE facturaGrupos\r\nset\r\nnumFactura='" . $_POST['numFactura'] . "'\r\n\r\nwhere\r\nentidad='" . $entidad . "'\r\n and\r\nnumSolicitud='" . $_GET['numSolicitud'] . "'\r\n"; //mysql_db_query($basedatos,$actualiza); echo mysql_error(); //CIERRA ACTUALIZA $sSQL2 = "Select * From RFC WHERE RFC like '%{$rfc}%' "; $result2 = mysql_db_query($basedatos, $sSQL2); $myrow2 = mysql_fetch_array($result2); $sSQL2a = "Select * From datosfacturacion WHERE entidad='" . $entidad . "' and numSolicitud='" . $_GET['numSolicitud'] . "' "; $result2a = mysql_db_query($basedatos, $sSQL2a); $myrow2a = mysql_fetch_array($result2a); if (!$myrow2a['numSolicitud']) { $sql0 = "INSERT INTO datosfacturacion\r\n(razonSocial,\r\n\t\tcalle,\r\n\t \tcolonia,\r\n\t \tciudad,\r\n\t \testado,\r\n\t \tcp,\r\n\t \tdelegacion,\r\n\t \tpais,\r\n\t \tentidad,\r\n\t \trfc,\r\n\t \tcalle1,\r\n\t \tnumFactura,numSolicitud\r\n )\r\nvalues\r\n(\r\n'" . $myrow2['razonSocial'] . "',\r\n'" . $myrow2['calle'] . "','" . $myrow2['colonia'] . "',\r\n '" . $myrow2['ciudad'] . "','" . $myrow2['estado'] . "',\r\n '" . $myrow2['cp'] . "','" . $myrow2['delegacion'] . "',\r\n '" . $myrow2['pais'] . "','" . $entidad . "','" . $myrow2['RFC'] . "',\r\n '" . $myrow2['calle1'] . "','" . $_POST['numFactura'] . "','" . $_GET['numSolicitud'] . "')\r\n\r\n"; mysql_db_query($basedatos, $sql0); echo mysql_error(); } $_POST['flag1'] = 1; $sSQL = "SELECT\r\n *\r\n FROM\r\n cargosCuentaPaciente\r\n WHERE \r\n entidad='" . $entidad . "'\r\n and\r\n folioVenta='" . $_GET['folioVenta'] . "'\r\n and\r\n gpoProducto!=''\r\n \r\n "; $result = mysql_db_query($basedatos, $sSQL); while ($myrow = mysql_fetch_array($result)) { $sql5da = "\r\nSELECT *\r\nFROM\r\nfacturasAplicadas\r\nWHERE\r\nentidad='" . $entidad . "'\r\n and\r\nfolioVenta='" . $_GET['folioVenta'] . "' \r\nand\r\nnumSolicitud='" . $_GET['numSolicitud'] . "'\r\n and\r\n keyCAP='" . $myrow['keyCAP'] . "'\r\n\r\n"; $result5da = mysql_db_query($basedatos, $sql5da); $myrow5da = mysql_fetch_array($result5da); $agrega = "INSERT INTO facturasAplicadas (\r\nnumSolicitud,folioVenta,cantidad,\r\nimporte,iva,gpoProducto,descripcionArticulo,\r\ndescripcionGrupo,entidad,status,fecha,hora,numFactura,\r\ncodigo,naturaleza,keyCAP,usuario\r\n\r\n)\r\nvalues \r\n(\r\n\r\n'" . $_GET['numSolicitud'] . "','" . $_GET['folioVenta'] . "','" . $myrow['cantidad'] . "',\r\n'" . $myrow['cantidadParticular'] . "','" . $myrow['ivaParticular'] . "','" . $myrow['gpoProducto'] . "',\r\n '" . $myrow['descripcionArticulo'] . "','" . $myrow['descripcionGrupoProducto'] . "',\r\n '" . $entidad . "','request','" . $fecha1 . "','" . $hora1 . "','',\r\n '" . $myrow['codProcedimiento'] . "','" . $myrow['naturaleza'] . "',\r\n '" . $myrow['keyCAP'] . "','" . $usuario . "'\r\n \r\n)"; mysql_db_query($basedatos, $agrega); echo mysql_error(); $tipoMensaje = 'registrosAgregados'; $encabezado = 'Exitoso'; $texto = 'Se agregaron Folios de Venta'; } //cierra while //TERMINA DE AGREGAR A FACTURAS APLICADAS $sSQLab = "SELECT * FROM entidades where codigoEntidad='" . $entidad . "' "; $resultab = mysql_db_query($basedatos, $sSQLab); $myrowab = mysql_fetch_array($resultab); if ($myrowab['digitosFactura'] > 0) { $sSQLaa = "SELECT contador from contadorSeriesFacturas where \r\n entidad='" . $entidad . "'\r\n and \r\n numSolicitud='" . $_GET['numSolicitud'] . "' and tipoFactura='efectivo' "; $resultaa = mysql_db_query($basedatos, $sSQLaa); $myrowaa = mysql_fetch_array($resultaa); if (!$myrowaa['contador']) { //GENERAR FACTURA $q4 = "\r\n\r\n INSERT INTO contadorSeriesFacturas(contador, usuario,entidad,numSolicitud,tipoFactura)\r\n SELECT(IFNULL((SELECT MAX(contador)+1 from contadorSeriesFacturas where entidad='" . $entidad . "'), 1)), '" . $usuario . "','" . $entidad . "','" . $_GET['numSolicitud'] . "','efectivo'\r\n\r\n "; mysql_db_query($basedatos, $q4); echo mysql_error(); $sSQLac = "SELECT contador as topeMaximo from contadorSeriesFacturas where \r\n entidad='" . $entidad . "'\r\n and \r\n numSolicitud='" . $_GET['numSolicitud'] . "' and tipoFactura='efectivo' "; $resultac = mysql_db_query($basedatos, $sSQLac); $myrowac = mysql_fetch_array($resultac); //echo $myrowac['topeMaximo']; //echo '<br>'; $digitos = strlen($myrowac['topeMaximo']); $totalDigitos = $myrowab['digitosFactura'] - $digitos; $totalDigitos = '%0' . $totalDigitos . 's'; $digtosCompilados = sprintf($totalDigitos, $var); $numFactura = $myrowab['prefijoEfectivo'] . $digtosCompilados . $myrowac['topeMaximo']; $actualiza = "UPDATE facturaGrupos\r\nset\r\nstatus='facturado',numFactura='" . $numFactura . "'\r\n\r\nwhere\r\nentidad='" . $entidad . "'\r\n and\r\nnumSolicitud='" . $_GET['numSolicitud'] . "'\r\n"; mysql_db_query($basedatos, $actualiza); echo mysql_error(); $actualiza1 = "UPDATE facturasAplicadas\r\nset\r\nstatus='facturado',numFactura='" . $numFactura . "'\r\n\r\nwhere\r\nentidad='" . $entidad . "'\r\n and\r\nnumSolicitud='" . $_GET['numSolicitud'] . "'\r\n"; mysql_db_query($basedatos, $actualiza1); echo mysql_error(); $actualiza2 = "UPDATE datosfacturacion\r\nset\r\n\r\nnumFactura='" . $numFactura . "'\r\n\r\nwhere\r\nentidad='" . $entidad . "'\r\n and\r\nnumSolicitud='" . $_GET['numSolicitud'] . "'\r\n"; mysql_db_query($basedatos, $actualiza2); echo mysql_error(); //echo '<script>'; //echo 'window.alert("SE GENERO LA FACTURA: '.$numFactura.'");'; //echo '</script>'; $tipoMensaje = 'registrosAgregados'; $encabezado = 'Exitoso'; $texto = 'FOLIO(s) FACTURADOS..'; //****GENERAR TICKET****** $qTi = "\r\n\r\n INSERT INTO contadorTicket(contador, usuario,entidad,keyClientesInternos)\r\n SELECT(IFNULL((SELECT MAX(contador)+1 from contadorTicket where entidad='" . $entidad . "'), 1)), '" . $usuario . "','" . $entidad . "','" . $myrow1d['keyClientesInternos'] . "'\r\n\r\n "; mysql_db_query($basedatos, $qTi); echo mysql_error(); //************************ $sSQLT = "SELECT contador as topeMaximo from contadorTicket where entidad='" . $entidad . "' and usuario='" . $usuario . "'order by keyCExt DESC "; $resultT = mysql_db_query($basedatos, $sSQLT); $myrowT = mysql_fetch_array($resultT); $ticket = $myrowT['topeMaximo']; $tipoFacturacion = 'Auto'; require CONSTANT_PATH_CONFIGURACION . "/clases/generarFacturaElectronica.php"; } else { echo '<script>window.alert("YA SE GENERO LA FACTURA!");</script>'; } } else { echo '<script>window.alert("FAVOR DE CONFIGURAR LA ENTIDAD PARA FACTURAR CORRECTAMENTE!");</script>'; } } //solo entra aqui si no es devolucion } //solo entra aqui si trae cantidad particular //*******CIERRA MODULO DE FACTURACION******** $actualiza1 = "update faltantes\r\nset\r\nstatus='venta'\r\n\r\nWHERE entidad='" . $entidad . "'\r\nand\r\nkeyClientesInternos='" . $nT . "'\r\nand\r\ngpoProducto!=''\r\n"; mysql_db_query($basedatos, $actualiza1); echo mysql_error(); $agrega4 = "\r\n \r\nUPDATE clientesInternos set\r\nnumeroFactura='" . $numFactura . "',\r\nticket='" . $ticket . "', \r\ntipoCuenta='H',\r\nstatus='cerrada',\r\nstatusCuenta='cerrada',\r\nusuarioCierre='" . $usuario . "',\r\nfechaCierre='" . $fecha1 . "',\r\nhoraCierre='" . $hora1 . "',\r\nstatusCaja='pagado'\r\nwhere\r\nentidad='" . $entidad . "'\r\nand\r\nfolioVenta='" . $_GET['folioVenta'] . "' "; mysql_db_query($basedatos, $agrega4); echo mysql_error(); $agrega = "UPDATE cargosCuentaPaciente set \r\nstatusCuenta='cerrada',statusCaja='pagado',fechaCierre='" . $fecha1 . "',fecha1='" . $fecha1 . "'\r\nwhere\r\nentidad='" . $entidad . "'\r\nand\r\nfolioVenta='" . $_GET['folioVenta'] . "' "; mysql_db_query($basedatos, $agrega); echo mysql_error(); $sSQLCaR = "Select numRecibo,codigoCaja From cargosCuentaPaciente where entidad='" . $entidad . "'\r\nand\r\nfolioVenta='" . $_GET['folioVenta'] . "' \r\nand\r\ntipoTransaccion!=''\r\nand\r\nnumRecibo>0\r\n"; $resultCaR = mysql_db_query($basedatos, $sSQLCaR); $myrowCaR = mysql_fetch_array($resultCaR); $agregado = "UPDATE cargosCuentaPaciente set \r\n numRecibo='" . $myrowCaR['numRecibo'] . "',codigoCaja='" . $myrowCaR['codigoCaja'] . "'\r\nwhere\r\nentidad='" . $entidad . "'\r\nand\r\nfolioVenta='" . $_GET['folioVenta'] . "'\r\n and tipoTransaccion!=''\r\n and\r\n numRecibo=''\r\n"; mysql_db_query($basedatos, $agregado); echo mysql_error(); //********************************************* //************CASO 1 ********************** $sSQL1t = "Select status,usuario,folioVenta From transacciones WHERE entidad='" . $entidad . "' and usuario='" . $usuario . "' order by keyT DESC "; $result1t = mysql_db_query($basedatos, $sSQL1t); $myrow1t = mysql_fetch_array($result1t); echo mysql_error(); //echo $_GET['folioVenta']; //echo $myrow1t['status'].' '.$myrow1t['folioVenta']; if ($myrow1t['status'] == 'standby' and $myrow1t['folioVenta'] != $_GET['folioVenta']) { //echo "Debes terminar de completar la transaccion: ".$myrow1t['folioVenta']; ?> <script> window.alert("Estimado: <?php echo $myrow1t['usuario']; ?> , debes de completar la transaccion del folio: <?php echo $myrow1t['folioVenta']; ?> "); window.close(); </script> <?php } } //solo externos //************************************CANDADO DE USUARIO***************************************** ?> <?php if ($_POST['cerrar']) { $particular = $_POST['particular']; $aseguradora = $_POST['aseguradora']; //*******TRASPASO AL MODULO DE FACTURACION AUTOMATICO******* $sSQLef = "SELECT\r\n *\r\n FROM\r\n cargosCuentaPaciente\r\n WHERE \r\n entidad='" . $entidad . "'\r\n and\r\n folioVenta='" . $_GET['folioVenta'] . "'\r\n and\r\n gpoProducto!=''\r\n and \r\n cantidadParticular>0\r\n "; $resultef = mysql_db_query($basedatos, $sSQLef); $myrowef = mysql_fetch_array($resultef); if ($myrowef['cantidadParticular'] > 0) { //solamente entra si tiene cantidad particular if ($myrow1d['statusDevolucion'] != 'si') { //GENERO LA SOLICITUD $sSQL8aa3 = "\r\nSELECT max(contador)+1 as n\r\nFROM\r\ncontadorFacturas\r\nWHERE\r\nentidad='" . $entidad . "'\r\n "; $result8aa3 = mysql_db_query($basedatos, $sSQL8aa3); $myrow8aa3 = mysql_fetch_array($result8aa3); $n = $myrow8aa3['n']; if (!$n) { $n = 1; } //asigno valor $_GET['numSolicitud'] = $n; $agrega = "INSERT INTO contadorFacturas (\r\nusuario,contador,entidad\r\n) values (\r\n'" . $usuario . "','" . $n . "','" . $entidad . "'\r\n)"; mysql_db_query($basedatos, $agrega); echo mysql_error(); //ACTUALIZAR ENCABEZA $actualiza = "UPDATE facturaGrupos\r\nset\r\nnumFactura='" . $_POST['numFactura'] . "'\r\n\r\nwhere\r\nentidad='" . $entidad . "'\r\n and\r\nnumSolicitud='" . $_GET['numSolicitud'] . "'\r\n"; //mysql_db_query($basedatos,$actualiza); echo mysql_error(); //CIERRA ACTUALIZA $sSQL2 = "Select * From RFC WHERE RFC like '%{$rfc}%' "; $result2 = mysql_db_query($basedatos, $sSQL2); $myrow2 = mysql_fetch_array($result2); $sSQL2a = "Select * From datosfacturacion WHERE entidad='" . $entidad . "' and numSolicitud='" . $_GET['numSolicitud'] . "' "; $result2a = mysql_db_query($basedatos, $sSQL2a); $myrow2a = mysql_fetch_array($result2a); if (!$myrow2a['numSolicitud']) { $sql0 = "INSERT INTO datosfacturacion\r\n(razonSocial,\r\n\t\tcalle,\r\n\t \tcolonia,\r\n\t \tciudad,\r\n\t \testado,\r\n\t \tcp,\r\n\t \tdelegacion,\r\n\t \tpais,\r\n\t \tentidad,\r\n\t \trfc,\r\n\t \tcalle1,\r\n\t \tnumFactura,numSolicitud\r\n )\r\nvalues\r\n(\r\n'" . $myrow2['razonSocial'] . "',\r\n'" . $myrow2['calle'] . "','" . $myrow2['colonia'] . "',\r\n '" . $myrow2['ciudad'] . "','" . $myrow2['estado'] . "',\r\n '" . $myrow2['cp'] . "','" . $myrow2['delegacion'] . "',\r\n '" . $myrow2['pais'] . "','" . $entidad . "','" . $myrow2['RFC'] . "',\r\n '" . $myrow2['calle1'] . "','" . $_POST['numFactura'] . "','" . $_GET['numSolicitud'] . "')\r\n\r\n"; mysql_db_query($basedatos, $sql0); echo mysql_error(); } $_POST['flag1'] = 1; $sSQL = "SELECT\r\n *\r\n FROM\r\n cargosCuentaPaciente\r\n WHERE \r\n entidad='" . $entidad . "'\r\n and\r\n folioVenta='" . $_GET['folioVenta'] . "'\r\n and\r\n gpoProducto!=''\r\n \r\n "; $result = mysql_db_query($basedatos, $sSQL); while ($myrow = mysql_fetch_array($result)) { $sql5da = "\r\nSELECT *\r\nFROM\r\nfacturasAplicadas\r\nWHERE\r\nentidad='" . $entidad . "'\r\n and\r\nfolioVenta='" . $_GET['folioVenta'] . "' \r\nand\r\nnumSolicitud='" . $_GET['numSolicitud'] . "'\r\n and\r\n keyCAP='" . $myrow['keyCAP'] . "'\r\n\r\n"; $result5da = mysql_db_query($basedatos, $sql5da); $myrow5da = mysql_fetch_array($result5da); $agrega = "INSERT INTO facturasAplicadas (\r\nnumSolicitud,folioVenta,cantidad,\r\nimporte,iva,gpoProducto,descripcionArticulo,\r\ndescripcionGrupo,entidad,status,fecha,hora,numFactura,\r\ncodigo,naturaleza,keyCAP,usuario\r\n\r\n)\r\nvalues \r\n(\r\n\r\n'" . $_GET['numSolicitud'] . "','" . $_GET['folioVenta'] . "','" . $myrow['cantidad'] . "',\r\n'" . $myrow['cantidadParticular'] . "','" . $myrow['ivaParticular'] . "','" . $myrow['gpoProducto'] . "',\r\n '" . $myrow['descripcionArticulo'] . "','" . $myrow['descripcionGrupoProducto'] . "',\r\n '" . $entidad . "','request','" . $fecha1 . "','" . $hora1 . "','',\r\n '" . $myrow['codProcedimiento'] . "','" . $myrow['naturaleza'] . "',\r\n '" . $myrow['keyCAP'] . "','" . $usuario . "'\r\n \r\n)"; mysql_db_query($basedatos, $agrega); echo mysql_error(); $tipoMensaje = 'registrosAgregados'; $encabezado = 'Exitoso'; $texto = 'Se agregaron Folios de Venta'; } //cierra while //TERMINA DE AGREGAR A FACTURAS APLICADAS $sSQLab = "SELECT * FROM entidades where codigoEntidad='" . $entidad . "' "; $resultab = mysql_db_query($basedatos, $sSQLab); $myrowab = mysql_fetch_array($resultab); if ($myrowab['digitosFactura'] > 0) { $sSQLaa = "SELECT contador from contadorSeriesFacturas where \r\n entidad='" . $entidad . "'\r\n and \r\n numSolicitud='" . $_GET['numSolicitud'] . "' and tipoFactura='efectivo' "; $resultaa = mysql_db_query($basedatos, $sSQLaa); $myrowaa = mysql_fetch_array($resultaa); if (!$myrowaa['contador']) { //GENERAR FACTURA $q4 = "\r\n\r\n INSERT INTO contadorSeriesFacturas(contador, usuario,entidad,numSolicitud,tipoFactura)\r\n SELECT(IFNULL((SELECT MAX(contador)+1 from contadorSeriesFacturas where entidad='" . $entidad . "'), 1)), '" . $usuario . "','" . $entidad . "','" . $_GET['numSolicitud'] . "','efectivo'\r\n\r\n "; mysql_db_query($basedatos, $q4); echo mysql_error(); $sSQLac = "SELECT contador as topeMaximo from contadorSeriesFacturas where \r\n entidad='" . $entidad . "'\r\n and \r\n numSolicitud='" . $_GET['numSolicitud'] . "' and tipoFactura='efectivo' "; $resultac = mysql_db_query($basedatos, $sSQLac); $myrowac = mysql_fetch_array($resultac); //echo $myrowac['topeMaximo']; //echo '<br>'; $digitos = strlen($myrowac['topeMaximo']); $totalDigitos = $myrowab['digitosFactura'] - $digitos; $totalDigitos = '%0' . $totalDigitos . 's'; $digtosCompilados = sprintf($totalDigitos, $var); $numFactura = $myrowab['prefijoEfectivo'] . $digtosCompilados . $myrowac['topeMaximo']; $actualiza = "UPDATE facturaGrupos\r\nset\r\nstatus='facturado',numFactura='" . $numFactura . "'\r\n\r\nwhere\r\nentidad='" . $entidad . "'\r\n and\r\nnumSolicitud='" . $_GET['numSolicitud'] . "'\r\n"; mysql_db_query($basedatos, $actualiza); echo mysql_error(); $actualiza1 = "UPDATE facturasAplicadas\r\nset\r\nstatus='facturado',numFactura='" . $numFactura . "'\r\n\r\nwhere\r\nentidad='" . $entidad . "'\r\n and\r\nnumSolicitud='" . $_GET['numSolicitud'] . "'\r\n"; mysql_db_query($basedatos, $actualiza1); echo mysql_error(); $actualiza2 = "UPDATE datosfacturacion\r\nset\r\n\r\nnumFactura='" . $numFactura . "'\r\n\r\nwhere\r\nentidad='" . $entidad . "'\r\n and\r\nnumSolicitud='" . $_GET['numSolicitud'] . "'\r\n"; mysql_db_query($basedatos, $actualiza2); echo mysql_error(); //echo '<script>'; //echo 'window.alert("SE GENERO LA FACTURA: '.$numFactura.'");'; //echo '</script>'; $tipoMensaje = 'registrosAgregados'; $encabezado = 'Exitoso'; $texto = 'FOLIO(s) FACTURADOS..'; //****GENERAR TICKET****** $qTi = "\r\n\r\n INSERT INTO contadorTicket(contador, usuario,entidad,keyClientesInternos)\r\n SELECT(IFNULL((SELECT MAX(contador)+1 from contadorTicket where entidad='" . $entidad . "'), 1)), '" . $usuario . "','" . $entidad . "','" . $myrow1d['keyClientesInternos'] . "'\r\n\r\n "; mysql_db_query($basedatos, $qTi); echo mysql_error(); //************************ $sSQLT = "SELECT contador as topeMaximo from contadorTicket where entidad='" . $entidad . "' and usuario='" . $usuario . "'order by keyCExt DESC "; $resultT = mysql_db_query($basedatos, $sSQLT); $myrowT = mysql_fetch_array($resultT); $ticket = $myrowT['topeMaximo']; $tipoFacturacion = 'Auto'; require CONSTANT_PATH_CONFIGURACION . "/clases/generarFacturaElectronica.php"; } else { echo '<script>window.alert("YA SE GENERO LA FACTURA!");</script>'; } } else { echo '<script>window.alert("FAVOR DE CONFIGURAR LA ENTIDAD PARA FACTURAR CORRECTAMENTE!");</script>'; } } //solo entra aqui si no es devolucion } //solo entra aqui si trae cantidad particular //*******CIERRA MODULO DE FACTURACION******** if ($myrow1d['tipoPaciente'] == 'externo') { $agregado = "UPDATE cargosCuentaPaciente set \r\n numRecibo='" . $myrow1d['numRecibo'] . "',codigoCaja='" . $myrow1d['codigoCaja'] . "',numCorte='" . $myrow1d['numCorte'] . "'\r\nwhere\r\nentidad='" . $entidad . "'\r\nand\r\nfolioVenta='" . $_GET['folioVenta'] . "'\r\n and\r\n gpoProducto=''\r\n and\r\n numRecibo=''\r\n"; //mysql_db_query($basedatos,$agregado); echo mysql_error(); } $q = "UPDATE antibioticos set\r\nstatus='pagado'\r\n\r\nWHERE\r\nentidad='" . $entidad . "'\r\n and\r\nkeyClientesInternos='" . trim($_GET['nT']) . "'\r\n"; mysql_db_query($basedatos, $q); echo mysql_error(); //cierro cuenta $agrega4 = "UPDATE clientesInternos set\r\nticket='" . $ticket . "',\r\n numSolicitud='" . $_GET['numSolicitud'] . "',\r\nstatusEstudio='cargado', \r\ntipoCuenta='H',\r\nstatus='cerrada',\r\nstatusCuenta='cerrada',\r\nusuarioCierre='" . $usuario . "',\r\nfechaCierre='" . $fecha1 . "',\r\nhoraCierre='" . $hora1 . "',\r\nstatusCaja='pagado'\r\nwhere\r\nentidad='" . $entidad . "'\r\nand\r\nfolioVenta='" . $_GET['folioVenta'] . "' "; mysql_db_query($basedatos, $agrega4); echo mysql_error(); $agrega4a = "UPDATE cargosCuentaPaciente set\r\ntipoCuenta='H',\r\nstatus='cerrada',\r\nstatusCuenta='cerrada',\r\n\r\nfechaCierre='" . $fecha1 . "',\r\n\r\nstatusCaja='pagado'\r\nwhere\r\nentidad='" . $entidad . "'\r\nand\r\nfolioVenta='" . $_GET['folioVenta'] . "' "; mysql_db_query($basedatos, $agrega4a); echo mysql_error(); //cierro cuarto a sucio if ($myrow3['cuarto']) { $agregad = "UPDATE cuartos set \r\nstatus='sucio',\r\nusuarioSalida='" . $usuario . "',\r\nfechaSalida='" . $fecha1 . "',\r\nhoraSalida='" . $hora1 . "'\r\n\r\nwhere\r\nentidad='" . $entidad . "'\r\nand\r\ncodigoCuarto='" . $myrow3['cuarto'] . "' \r\n"; //mysql_db_query($basedatos,$agregad); echo mysql_error(); } $leyenda = 'Cuenta Cerrada!'; $sSQL3 = "Select * From clientesInternos WHERE entidad='" . $entidad . "' and folioVenta = '" . $_GET['folioVenta'] . "'\r\n "; $result3 = mysql_db_query($basedatos, $sSQL3); $myrow3 = mysql_fetch_array($result3); $agrega5 = "UPDATE porcentajeBeneficencias set\r\nstatus='cargado'\r\nwhere\r\nentidad='" . $entidad . "'\r\nand\r\nnumeroE='" . $myrow3['numeroE'] . "'\r\nand\r\nstatus='standby'\r\nand\r\ndepartamento='" . $myrow3['almacen'] . "'\r\n"; mysql_db_query($basedatos, $agrega5); echo mysql_error(); if ($myrow3['status'] == 'cerrada' and $myrow3['statusCuenta'] == 'cerrada') { ?> <script> //window.opener.document.forms["form1"].submit(); //window.alert("Cuenta Cerrada"); //window.close(); </script> <?php } else { ?> <script> window.opener.document.forms["form1"].submit(); window.alert("Hay un problema con la cuenta"); //window.close(); </script> <?php } } ?> <script language=javascript> function ventanaSecundaria2 (URL){ window.open(URL,"ventana2","width=800,height=500,scrollbars=YES,scrollbars=YES,resizable=YES, maximizable=YES") } </script> <script language=javascript> function ventanaSecundaria7 (URL){ window.open(URL,"ventanaSecundaria7","width=1024,height=800,scrollbars=YES,resizable=YES, maximizable=YES") } </script> <script> var win = null; function nueva(mypage,myname,w,h,scroll){ LeftPosition = (screen.width) ? (screen.width-w)/2 : 0; TopPosition = (screen.height) ? (screen.height-h)/2 : 0; settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable' win = window.open(mypage,myname,settings) if(win.window.focus){win.window.focus();} } </script> <?php //************************ACTUALIZO ********************** //Llenado de datos $sSQL3 = "Select * From clientesInternos WHERE \r\n\r\nkeyClientesInternos = '" . $_GET['nT'] . "' "; $result3 = mysql_db_query($basedatos, $sSQL3); $myrow3 = mysql_fetch_array($result3); $numeroE = $myrow3['numeroE']; $nCuenta = $myrow3['nCuenta']; $cuarto = $myrow3['cuarto']; $seguroT = ltrim($myrow3['seguro']); //***************aplicar pago********************** ?> <?php $sSQL3ae = "\r\n\tSELECT \r\nimprimeTicket\r\nFROM\r\nalmacenes\r\nwhere\r\nentidad='" . $entidad . "'\r\n and\r\nalmacen='" . $_GET['almacenSolicitante'] . "'\r\n\r\n"; $result3ae = mysql_db_query($basedatos, $sSQL3ae); $myrow3ae = mysql_fetch_array($result3ae); ?> <?php if ($_POST['imprimir']) { //********************verificar diferencia de centavos************* $diferencia = number_format($_POST['totalAbono'] - $_POST['totalCargo'], 2); if ($diferencia > 0) { $sSQL3c = "Select keyCAP,cantidadParticular,cantidadAseguradora,ivaParticular,ivaAseguradora From cargosCuentaPaciente WHERE \r\nentidad='" . $entidad . "' and folioVenta = '" . $_GET['folioVenta'] . "' \r\nand\r\ngpoProducto=''\r\nand\r\nnaturaleza='A' order by keyCAP DESC\r\n\r\n "; $result3c = mysql_db_query($basedatos, $sSQL3c); $myrow3c = mysql_fetch_array($result3c); if ($myrow3c['cantidadParticular'] > 0) { $agrega4 = "UPDATE cargosCuentaPaciente set \r\ncantidadParticular=cantidadParticular-'" . $diferencia . "',\r\nprecioVenta=cantidadParticular+cantidadAseguradora\r\nwhere\r\nkeyCAP='" . $myrow3c['keyCAP'] . "' "; mysql_db_query($basedatos, $agrega4); echo mysql_error(); } else { if ($myrow3c['cantidadAseguradora'] > 0) { $agrega4 = "UPDATE cargosCuentaPaciente set \r\ncantidadAseguradora=cantidadAseguradora-'" . $diferencia . "',\r\nprecioVenta=cantidadParticular+cantidadAseguradora\r\nwhere\r\nkeyCAP='" . $myrow3c['keyCAP'] . "' "; mysql_db_query($basedatos, $agrega4); echo mysql_error(); } } } //******************************************* //********************TODOS SUS MOVIMIENTOS DEBEN ESTAR PAGADOS*********************** $agrega4 = "UPDATE clientesInternos set \r\ntipoCuenta='H',\r\nstatus='cerrada',\r\nstatusCuenta='cerrada',\r\nusuarioCierre='" . $usuario . "',\r\nfechaCierre='" . $fecha1 . "',\r\nhoraCierre='" . $hora1 . "',\r\nstatusCaja='pagado'\r\nwhere\r\nentidad='" . $entidad . "'\r\nand\r\nfolioVenta='" . $_GET['folioVenta'] . "' "; mysql_db_query($basedatos, $agrega4); echo mysql_error(); if ($myrow3['tipoPaciente'] == 'externo') { $qd = "UPDATE transacciones\r\nset\r\nstatus='done'\r\nwhere\r\n\r\nstatus='standby'\r\nand\r\nusuario='" . $usuario . "' \r\n "; mysql_db_query($basedatos, $qd); echo mysql_error(); $sSQL1d = "Select * From clientesInternos WHERE entidad='" . $entidad . "' and folioVenta ='" . $_GET['folioVenta'] . "' "; $result1d = mysql_db_query($basedatos, $sSQL1d); $myrow1d = mysql_fetch_array($result1d); echo mysql_error(); #SI NO TIENE EL RECIBO HAY QUE PONERSELO EN CASO DE CORTESIAS if (!$myrow1d['numRecibo']) { $sSQLC = "Select * From statusCaja where entidad='" . $entidad . "' and usuario='" . $usuario . "' order by keySTC DESC "; $resultC = mysql_db_query($basedatos, $sSQLC); $myrowC = mysql_fetch_array($resultC); $q = "UPDATE statusCaja set\r\nnumRecibo= numRecibo+1\r\nwhere\r\n\r\nkeySTC='" . $myrowC['keySTC'] . "'\r\n "; mysql_db_query($basedatos, $q); echo mysql_error(); //***********************ASIGNARA NUMERO DE RECIBO $sSQLCa = "Select numRecibo From statusCaja where keySTC='" . $myrowC['keySTC'] . "'"; $resultCa = mysql_db_query($basedatos, $sSQLCa); $myrowCa = mysql_fetch_array($resultCa); $RECIBO = $myrowCa['numRecibo']; $numCorte = $myrowC['numCorte']; $q4 = "UPDATE clientesInternos set numRecibo='" . $RECIBO . "',numCorte='" . $numCorte . "',codigoCaja='" . $myrowC['keyCatC'] . "',\r\nautoriza='" . $usuario . "',statusOtros='standby',responsableCuenta='" . $_GET['responsableCuenta'] . "',\r\nfechaVencimiento='" . $_GET['fechaVencimiento'] . "',\r\nstatusDeposito='pagado',usuario='" . $usuario . "',fecha1='" . $fecha1 . "'\r\nWHERE entidad='" . $entidad . "' and folioVenta='" . $_GET['folioVenta'] . "'"; mysql_db_query($basedatos, $q4); echo mysql_error(); $agregado = "UPDATE cargosCuentaPaciente set \r\n numRecibo='" . $RECIBO . "',codigoCaja='" . $myrowC['keyCatC'] . "',numCorte='" . $numCorte . "'\r\nwhere\r\nentidad='" . $entidad . "'\r\nand\r\nfolioVenta='" . $_GET['folioVenta'] . "'\r\n and\r\n gpoProducto=''\r\n and\r\n numRecibo=''\r\n"; mysql_db_query($basedatos, $agregado); echo mysql_error(); } } //**************************cierro if ($_GET['paquete'] == 'si') { ?> <script language="javascript"> nueva('<?php echo $myrowCent['rutaReciboPaquetes']; ?> ?numeroE=<?php echo $myrow3['numeroE']; ?> &nCuenta=<?php echo $myrow3['nCuenta']; ?> &keyClientesInternos=<?php echo $myrow3['keyClientesInternos']; ?> &paciente=<?php echo $_POST['paciente']; ?> &numeroConfirmacion=<?php echo $numeroConfirmacion; ?> &hora1=<?php echo $hora1; ?> &cajero=<?php echo $usuario; ?> &codigoPaquete=<?php echo $myrow3['codigoPaquete']; ?> &numRecibo=<?php echo $myrowC['numRecibo']; ?> &paciente=<?php echo $_POST['paciente']; ?> &cantidadRecibida=<?php echo $_POST['cantidadRecibida']; ?> &folioVenta=<?php echo $myrow3['folioVenta']; ?> &fechaSolicitud=<?php print $_POST['variable_php']; ?> ','ventana7','800','600','yes'); window.opener.document.form10["form10"].submit(); //window.alert("sandra"); window.close(); </script> <?php } else { ?> <?php if ($myrow3ae['imprimeTicket'] == 'si') { ?> <script> nueva('imprimeTicket.php?numeroE=<?php echo $numeroE; ?> &nCuenta=<?php echo $nCuenta; ?> &keyClientesInternos=<?php echo $nT; ?> &paciente=<?php echo $_POST['paciente']; ?> &numeroConfirmacion=<?php echo $numeroConfirmacion; ?> &hora1=<?php echo $hora1; ?> &cajero=<?php echo $usuario; ?> &fechaSolicitud=<?php print $_POST['variable_php']; ?> &folioVenta=<?php echo $myrow3['folioVenta']; ?> &entidad=<?php echo $entidad; ?> ','ventana7','800','600','yes'); window.opener.document.form10["form"].submit(); window.close(); </script> <?php } else { ?> <script> nueva('<?php echo $myrowCent['rutaRecibo']; ?> ?numeroE=<?php echo $numeroE; ?> &nCuenta=<?php echo $nCuenta; ?> &keyClientesInternos=<?php echo $nT; ?> &paciente=<?php echo $_POST['paciente']; ?> &numeroConfirmacion=<?php echo $numeroConfirmacion; ?> &hora1=<?php echo $hora1; ?> &cajero=<?php echo $usuario; ?> &fechaSolicitud=<?php print $_POST['variable_php']; ?> &folioVenta=<?php echo $myrow3['folioVenta']; ?> &entidad=<?php echo $entidad; ?> ','ventana7','800','600','yes'); window.opener.document.form10["form"].submit(); window.close(); </script> <?php } ?> <?php } ?> <?php } ?> <?php $sSQL3 = "Select * From clientesInternos WHERE entidad='" . $entidad . "' and folioVenta = '" . $_GET['folioVenta'] . "' "; $result3 = mysql_db_query($basedatos, $sSQL3); $myrow3 = mysql_fetch_array($result3); //***************aplicar pago********************** if ($myrow3['statusCuenta'] == 'cerrada' and $myrow3['status'] == 'cerrada') { echo "LA CUENTA DEL PACIENTE " . $myrow3['paciente'] . " ESTA CERRADA..."; $agrega5 = "UPDATE porcentajeBeneficencias set\r\nstatus='cargado'\r\nwhere\r\nentidad='" . $entidad . "'\r\nand\r\nnumeroE='" . $myrow3['numeroE'] . "'\r\nand\r\nstatus='standby'\r\nand\r\ndepartamento='" . $myrow3['almacen'] . "'\r\n"; mysql_db_query($basedatos, $agrega5); echo mysql_error(); ?> <input name="print" type="button" class="normal" id="print" value="Imprimir EC" onClick="nueva('<?php echo $myrowCent['rutaRecibo']; ?> ?numeroE=<?php echo $numeroE; ?> &nCuenta=<?php echo $nCuenta; ?> &keyClientesInternos=<?php echo $nT; ?> &paciente=<?php echo $_POST['paciente']; ?> &numeroConfirmacion=<?php echo $numeroConfirmacion; ?> &hora1=<?php echo $hora1; ?> &cajero=<?php echo $usuario; ?> &fechaSolicitud=<?php print $_POST['variable_php']; ?> &folioVenta=<?php echo $myrow3['folioVenta']; ?> &entidad=<?php echo $entidad; ?> ','ventana7','800','600','yes');"> <?php } else { ?> <script language=javascript> function ventanaSecundaria (URL){ window.open(URL,"ventanaSecundaria","width=800,height=600,scrollbars=YES,resizable=YES, maximizable=YES") } </script> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <html xmlns="http://www.w3.org/1999/xhtml"> <html> <head> </head> <title></title> <?php $link = new ventanasPrototype(); $link->links(); $estilo = new muestraEstilos(); $estilo->styles(); ?> <style type="text/css"> .popup_effect1 { background:#11455A; opacity: 0.2; } .popup_effect2 { background:#FF0041; border: 3px dashed #000; } </style> <script languaje="JavaScript"> var reloj=new Date(); varjs= reloj.getHours()+":"+reloj.getMinutes(); </script> <form id="form1" name="form1" method="post" > <?php //require('/configuracion/clases/encabezado.php'); //ABRE ENCABEZADO ?> <?php if (!$folioVenta) { $folioVenta = $_GET['folioVenta']; } ?> <?php $link = new ventanasPrototype(); $link->links(); $estilo = new muestraEstilos(); $estilo->styles(); ?> <script languaje="JavaScript"> var reloj=new Date(); varjs= reloj.getHours()+":"+reloj.getMinutes(); </script> <form id="form1" name="form1" method="post" action="#"> <?php $sSQL = "SELECT *\r\nFROM\r\nclientesInternos \r\nwhere\r\nentidad='" . $entidad . "'\r\nand\r\nfolioVenta='" . $folioVenta . "'\r\n\r\n "; $result = mysql_db_query($basedatos, $sSQL); $myrow = mysql_fetch_array($result); $entidad = $myrow['entidad']; $mmt = $myrow['credencial']; $keyClientesInternos = $myrow['keyClientesInternos']; $folioVENTA = $myrow['folioVenta']; $tipoPACIENTE = $myrow['tipoPaciente']; $limiteSEGURO = $myrow['limiteSeguro']; $SEGURO = $myrow['seguro']; ?> <h1>ESTADO DE CUENTA</h1> <table width="993" style="border: 1px solid #CCC;"> <tr > <td width="124" align="left" ><b>FOLIO N°</b></td> <td width="655" align="center" > <b>PACIENTE: <span class="titulomedio"><?php echo $myrow['paciente']; ?> </span></b></td> <td width="200" align="left" ><b>DEPTO - CUARTO</b></td> </tr> <?php if ($myrow['statusCortesia'] == 'si') { ?> <tr> <td colspan="3" style="text-align: center"><span class="codigos" style="size:14"><blink>*****EL PACIENTE ES DE CORTESIA****</blink></span></td> </tr> <?php } ?> <tr> <td align="left" style="text-align: center"><span ><?php echo $myrow['folioVenta']; ?> </span></td> <td ><span style="text-align: left">Seguro: <span class="normalmid"> <?php $segur = $myrow['seguro']; if ($segur != '') { $sSQL4 = "Select nomCliente From clientes WHERE entidad='" . $entidad . "' and numCliente='" . $segur . "';\r\n"; $result4 = mysql_db_query($basedatos, $sSQL4); $myrow4 = mysql_fetch_array($result4); echo $myrow4['nomCliente']; } else { echo particular; } ?> - <?php echo $myrow['credencial']; ?> </span></span></td> <td><span > <?php $id_almacen = $myrow['almacen']; $sSQL1 = "SELECT almacen,descripcion\r\nFROM\r\nalmacenes\r\nWHERE \r\nentidad='" . $entidad . "'\r\nand\r\nalmacen='" . $id_almacen . "'\r\n "; $result1 = mysql_db_query($basedatos, $sSQL1); $myrow1 = mysql_fetch_array($result1); echo $myrow1['descripcion']; ?> - <?php echo $myrow['cuarto']; ?> </span></td> </tr> <tr> <td colspan="2" style="text-align: left" >Fecha/Hora de Inter.: <span class="normalmid"><?php echo $myrow['fecha'] . " / " . $myrow['hora']; ?> </span></td> <td> </td> </tr> <tr> <td colspan="2" style="text-align: left" >Médico de Inter.: <span class="normalmid"> <?php if ($myrow['medico']) { $medico1 = $myrow['medico']; $sSQL3 = "SELECT nombre1,apellido1,apellido2\r\n\tFROM\r\n\tmedicos \r\n\twhere\r\n\tentidad='" . $entidad . "'\r\n\tand\r\n\tnumMedico='" . $medico1 . "'"; $result3 = mysql_db_query($basedatos, $sSQL3); $myrow3 = mysql_fetch_array($result3); echo $myrow3['nombre1'] . " " . $myrow3['apellido1'] . " " . $myrow3['apellido2']; } else { echo $myrow['medicoForaneo']; } ?> </span></td> <td> </td> </tr> <tr> <td colspan="2" style="text-align: left" >Diagnóstico: <span class="normalmid"><?php echo $myrow['dx']; ?> </span></td> <td> </td> </tr> <tr> <td colspan="2" style="text-align: left" ><span style="text-align: left">Fecha/Hora de Alta: <span class="normalmid"><?php echo $myrow['fechaCierre'] . " / " . $myrow['horaCierre']; ?> </span></span></td> <td> </td> </tr> <?php if ($myrow['numeroFactura']) { ?> <tr> <td colspan="2" style="text-align: left" ><span style="text-align: left">Numero Factura: <span class="normalmid"><?php echo $myrow['numeroFactura']; ?> </span></span></td> <td> </td> </tr> <?php } ?> </table> <p align="center"> <?php $sSQLnc = "SELECT *\r\n\tFROM\r\n\tclientesInternos \r\n\twhere\r\n\tentidad='" . $entidad . "'\r\n\tand\r\n\tfolioVenta='" . $myrow['folioDevolucion'] . "' and statusCuenta='cerrada' "; $resultnc = mysql_db_query($basedatos, $sSQLnc); $myrownc = mysql_fetch_array($resultnc); //echo $myrow3i['folioVenta']; ?> <?php if ($myrownc['folioVenta']) { ?> <h1 align="center" class="titulos"> <a href="javascript:nueva('<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /cargos/despliegaCargos.php?usuario=<?php echo $_GET['usuario']; ?> &numeroE=<?php echo $numeroE; ?> &almacen=<?php echo $_GET['almacenSolicitante']; ?> &almacenFuente=<?php echo $almacen; ?> &seguro=<?php echo $seguroT; ?> &nCuenta=<?php echo $myrow3['keyClientesInternos']; ?> &tipoCliente=<?php echo 'particular'; ?> &tipoVenta=<?php echo $_GET['tipoVenta']; ?> &folioVenta=<?php echo $myrow['folioDevolucion']; ?> &keyClientesInternos=<?php echo $myrow3['keyClientesInternos']; ?> &rand=<?php echo rand(1000, 10000000); ?> &paquete=<?php echo $_GET['paquete']; ?> &transaccion=<?php echo $my['codigoTT']; ?> &precioVenta=<?php echo $totalParticular; ?> &modoPago=<?php if ($_GET['devolucion'] == 'si') { echo 'devolucion'; } else { echo 'efectivo'; } ?> &tipoTransaccion=particular&devolucion=<?php echo $_GET['devolucion']; ?> &tipoPago=Efectivo','ventana7','800','600','yes');"> NOTA DE CREDITO </a> <?php } ?> </p> <?php //CIERRA ENCABEZADO ?> <?php //require('/configuracion/clases/operacionesGlobales.php'); ?> <?php //*******************************OPERACION GLOBAL***************************** //CARGOS if ($myrow['naturaleza'] == 'C' and $myrow['statusRegreso'] != 'si') { $cargo[0] += (double) ($myrow['precioVenta'] * $myrow['cantidad']) + $myrow['iva'] * $myrow['cantidad']; } //ABONOS if ($myrow['naturaleza'] == 'A' and $myrow['gpoProducto'] == '') { $abono[0] += (double) ($myrow['precioVenta'] * $myrow['cantidad']) + $myrow['iva'] * $myrow['cantidad']; } //DEVOLUCIONES if ($myrow['naturaleza'] == 'A' and $myrow['statusDevolucion'] == 'si') { $devolucion[0] += (double) ($myrow['precioVenta'] * $myrow['cantidad']) + $myrow['iva'] * $myrow['cantidad']; } //DEVOLUCIONES CARGOS if ($myrow['naturaleza'] == 'C' and $myrow['statusDevolucion'] == 'si') { $devolucionCargos[0] += (double) ($myrow['precioVenta'] * $myrow['cantidad']) + $myrow['iva'] * $myrow['cantidad']; } //REGRESOS if ($myrow['naturaleza'] == 'C' and $myrow['statusRegreso'] == 'si') { $regreso[0] += (double) ($myrow['precioVenta'] * $myrow['cantidad']) + $myrow['iva'] * $myrow['cantidad']; } //******************************************************************************* //CARGOS PARTICULARES if ($myrow['naturaleza'] == 'C' and $myrow['statusRegreso'] != 'si') { $cargoParticular[0] += (double) ($myrow['cantidadParticular'] * $myrow['cantidad']) + $myrow['ivaParticular'] * $myrow['cantidad']; } //ABONOS if ($myrow['naturaleza'] == 'A' and $myrow['gpoProducto'] == '') { $abonoParticular[0] += (double) ($myrow['cantidadParticular'] * $myrow['cantidad']) + $myrow['ivaParticular'] * $myrow['cantidad']; } //DEVOLUCIONES if ($myrow['naturaleza'] == 'A' and $myrow['statusDevolucion'] == 'si') { $devolucionParticular[0] += (double) ($myrow['cantidadParticular'] * $myrow['cantidad']) + $myrow['ivaParticular'] * $myrow['cantidad']; } //REGRESO DE EFECTIVO if ($myrow['naturaleza'] == 'C' and $myrow['statusRegreso'] == 'si') { $regresoParticular[0] += (double) ($myrow['cantidadParticular'] * $myrow['cantidad']) + $myrow['ivaParticular'] * $myrow['cantidad']; } //****************************************************************************************** //CARGOS ASEGURADORA //ES BENEFICENCIA // if($myrow['naturaleza']=='A' and $myrow['gpoProducto']==NULL){//devolucion transacciones // $abonosBeneficencia[0]+=$myrow['cantidadAseguradora']*$myrow['cantidad']; // }elseif($myrow['naturaleza']=='A' and $myrow['statusDevolucion']=='si'){//cargos al paciente // $devolucionBeneficencia[0]+=($myrow['cantidadAseguradora']*$myrow['cantidad'])+($myrow['ivaAseguradora']*$myrow['cantidad']);//devolucion articulos // }else if($myrow['naturaleza']=='C' ){//cargos al paciente // $cargosBeneficencia[0]+=($myrow['cantidadAseguradora']*$myrow['cantidad'])+($myrow['ivaAseguradora']*$myrow['cantidad']); // }else if($myrow['naturaleza']=='C' and $myrow['gpoProducto']==''){//cargos al paciente // $pagoDevBeneficencia[0]+=($myrow['precioVenta']*$myrow['cantidad'])+($myrow['iva']*$myrow['cantidad']); // } if ($myrow['naturaleza'] == 'C' and $myrow['gpoProducto'] != '') { //cargos al paciente $cargosBeneficencia[0] += (double) ($myrow['cantidadBeneficencia'] * $myrow['cantidad']) + $myrow['ivaBeneficencia'] * $myrow['cantidad']; } if ($myrow['naturaleza'] == 'A' and $myrow['gpoProducto'] != '') { //devolucion de cargo beneficencia $devolucionBeneficencia[0] += (double) ($myrow['cantidadBeneficencia'] * $myrow['cantidad']) + $myrow['ivaBeneficencia'] * $myrow['cantidad']; } if ($myrow['tipoTransaccion'] == 'DEVXB') { $dtBeneficencia[0] += (double) ($myrow['precioVenta'] * $myrow['cantidad']) + $myrow['iva'] * $myrow['cantidad']; } if ($myrow['naturaleza'] == 'A' and $myrow['gpoProducto'] == '') { //abonos $abonosBeneficencia[0] += (double) ($myrow['cantidadBeneficencia'] * $myrow['cantidad']); } if ($myrow['naturaleza'] == 'C' and $myrow['statusRegreso'] != 'si') { $cargoAseguradora[0] += (double) ($myrow['cantidadAseguradora'] * $myrow['cantidad']) + $myrow['ivaAseguradora'] * $myrow['cantidad']; } //ABONOS if ($myrow['naturaleza'] == 'A' and $myrow['gpoProducto'] == '') { $abonoAseguradora[0] += (double) ($myrow['cantidadAseguradora'] * $myrow['cantidad']) + $myrow['ivaAseguradora'] * $myrow['cantidad']; } //DEVOLUCIONES if ($myrow['naturaleza'] == 'A' and $myrow['statusDevolucion'] == 'si') { $devolucionAseguradora[0] += (double) ($myrow['cantidadAseguradora'] * $myrow['cantidad']) + $myrow['ivaAseguradora'] * $myrow['cantidad']; } //REGRESO DE TRASLADO if ($myrow['naturaleza'] == 'C' and $myrow['statusRegreso'] == 'si') { $regresoAseguradora[0] += (double) ($myrow['cantidadAseguradora'] * $myrow['cantidad']) + $myrow['ivaAseguradora'] * $myrow['cantidad']; } //IVA if ($myrow['naturaleza'] == 'C') { $ivaCargos[0] += (double) ($myrow['iva'] * $myrow['cantidad']); } elseif ($myrow['naturaleza'] == 'A') { $ivaAbonos[0] += (double) ($myrow['iva'] * $myrow['cantidad']); } //****************************************************************************************** ?> <?php //****************************COASEGURO / DEDUCIBLE ********************************** $s1 = "Select codigoTT From catTTCaja WHERE coaseguro1='si' "; $rs1 = mysql_db_query($basedatos, $s1); $my1 = mysql_fetch_array($rs1); $s2 = "Select codigoTT From catTTCaja WHERE coaseguro2='si' "; $rs2 = mysql_db_query($basedatos, $s2); $my2 = mysql_fetch_array($rs2); $s3 = "Select codigoTT From catTTCaja WHERE deducible1='si' "; $rs3 = mysql_db_query($basedatos, $s3); $my3 = mysql_fetch_array($rs3); $s4 = "Select codigoTT From catTTCaja WHERE deducible2='si' "; $rs4 = mysql_db_query($basedatos, $s4); $my4 = mysql_fetch_array($rs4); $s5 = "Select codigoTT From catTTCaja WHERE aplicarDescuentoParticulares='si' "; $rs5 = mysql_db_query($basedatos, $s5); $my5 = mysql_fetch_array($rs5); $s5a = "Select codigoTT From catTTCaja WHERE descuentoParticulares='si' "; $rs5a = mysql_db_query($basedatos, $s5a); $my5a = mysql_fetch_array($rs5a); $s6 = "Select codigoTT From catTTCaja WHERE aplicarDescuentoAseguradoras='si' "; $rs6 = mysql_db_query($basedatos, $s6); $my6 = mysql_fetch_array($rs6); $s6a = "Select codigoTT From catTTCaja WHERE descuentoAseguradoras='si' "; $rs6a = mysql_db_query($basedatos, $s6a); $my6a = mysql_fetch_array($rs6a); $s7 = "Select codigoTT From catTTCaja WHERE trasladoBeneficencia='si' "; $rs7 = mysql_db_query($basedatos, $s7); $my7 = mysql_fetch_array($rs7); //************************************************************************************* if ($myrow['tipoTransaccion'] == $my1['codigoTT']) { $coaseguro1 = $my1['codigoTT']; if ($myrow['naturaleza'] == '-') { $totalCargoCoaseguro1[0] += (double) ($myrow['precioVenta'] * $myrow['cantidad']); } else { $totalAbonoCoaseguro1[0] += (double) ($myrow['precioVenta'] * $myrow['cantidad']); } } if ($myrow['tipoTransaccion'] == $my2['codigoTT']) { $coaseguro2 = $my2['codigoTT']; if ($myrow['naturaleza'] == '-') { $totalCargoCoaseguro2[0] += (double) ($myrow['precioVenta'] * $myrow['cantidad']); } else { $totalAbonoCoaseguro2[0] += (double) ($myrow['precioVenta'] * $myrow['cantidad']); } } if ($myrow['tipoTransaccion'] == $my3['codigoTT']) { $deducible1 = $my3['codigoTT']; if ($myrow['naturaleza'] == '-') { $totalCargoDeducible1[0] += (double) ($myrow['precioVenta'] * $myrow['cantidad']); } else { $totalAbonoDeducible1[0] += (double) ($myrow['precioVenta'] * $myrow['cantidad']); } } if ($myrow['tipoTransaccion'] == $my4['codigoTT']) { $deducible2 = $my4['codigoTT']; if ($myrow['naturaleza'] == '-') { $totalCargoDeducible2[0] += (double) ($myrow['precioVenta'] * $myrow['cantidad']); } else { $totalAbonoDeducible2[0] += (double) ($myrow['precioVenta'] * $myrow['cantidad']); } } //*******************CIERRO COASEGURO Y DEDUCIBLE //****************APlicar descuentos********** if ($myrow['tipoTransaccion'] == $my5['codigoTT'] || $myrow['tipoTransaccion'] == $my5a['codigoTT']) { $descuentoParticular = $my5a['codigoTT']; if ($myrow['naturaleza'] == '-') { $descuentoParticularAplicado[0] += (double) ($myrow['cantidadParticular'] * $myrow['cantidad']); } else { $descuentosParticulares[0] += (double) ($myrow['cantidadParticular'] * $myrow['cantidad']); } } if ($myrow['tipoTransaccion'] == $my6['codigoTT'] || $myrow['tipoTransaccion'] == $my6a['codigoTT']) { $descuentoAseguradora = $my6a['codigoTT']; if ($myrow['naturaleza'] == '-') { $descuentoAseguradoraAplicado[0] += (double) ($myrow['cantidadAseguradora'] * $myrow['cantidad']); } else { $descuentosAseguradoras[0] += (double) ($myrow['cantidadAseguradora'] * $myrow['cantidad']); } } if ($myrow['tipoTransaccion'] == $my7['codigoTT'] || $myrow['tipoTransaccion'] == $my7a['codigoTT']) { $transB = $my7['codigoTT']; } //********************************************* ?> <?php //CIERRA OPERACIONES GLOBALES ?> <?php //require('/configuracion/clases/mostrarDatosCuenta.php'); //MOSTRAR DATOS CUENTA ?> <script language=javascript> function ventanaSecundaria10 (URL){ window.open(URL,"ventanaSecundaria10","width=500,height=300,scrollbars=YES,resizable=YES, maximizable=YES") } </script> <div align="center"> <span >Opciones de Grupo de Producto: </br></span> <?php $sSQL7 = "Select gpoProducto From cargosCuentaPaciente\r\n where entidad='" . $entidad . "'\r\n and\r\n folioVenta='" . $_GET['folioVenta'] . "'\r\n and\r\n gpoProducto!=''\r\n group by gpoProducto"; $result7 = mysql_db_query($basedatos, $sSQL7); echo mysql_error(); ?> <select name="gpoProducto1" id="gpoProducto1" onChange="this.form.submit();" > <option value="">Todos</option> <?php while ($myrow7 = mysql_fetch_array($result7)) { $sSQL78 = "SELECT *\r\n FROM\r\n gpoProductos\r\n WHERE\r\n entidad = '" . $entidad . "'\r\n and\r\n codigoGP='" . $myrow7['gpoProducto'] . "'\r\n "; $result78 = mysql_db_query($basedatos, $sSQL78); $myrow78 = mysql_fetch_array($result78); ?> <option <?php if ($_POST['gpoProducto1'] == $myrow7['gpoProducto']) { echo 'selected'; } ?> value="<?php echo $myrow7['gpoProducto']; ?> "><?php echo $myrow78['descripcionGP']; ?> </option> <?php } ?> </select> <p></p> <table width="817" class="table table-striped" style="border: 1px solid #CCC;"> <tr > <th width="19" scope="col"><div align="center">#</div></th> <th width= "56" scope="col"><div align="center"># Reg</div></th> <th width= "45" scope="col"><div align="center">Fecha</div></th> <th width= "23" scope="col"><div align="center">C</div></th> <th width= "431" scope="col"><div align="center">Descripcion</div></th> <th width= "52" scope="col"><div align="center">Totales</div></th> <th width= "25" scope="col"><div align="center">N</div></th> <th width= "59" scope="col">Part</th> <th width= "59" scope="col">Benef</th> <th width= "69" scope="col"><div align="center">Aseg</div></th> </tr> <tr> <?php $q = "DELETE FROM reportesTemporales\r\nwhere\r\nentidad='" . $entidad . "'\r\nand\r\nusuario='" . $usuario . "'\r\n"; mysql_db_query($basedatos, $q); echo mysql_error(); if ($_POST['gpoProducto1'] == null) { $sSQL = "SELECT *\r\nFROM\r\ncargosCuentaPaciente\r\nwhere\r\nentidad='" . $entidad . "'\r\nand\r\nfolioVenta='" . $_GET['folioVenta'] . "'\r\n\r\n\r\n"; } else { $sSQL = "SELECT *\r\nFROM\r\ncargosCuentaPaciente\r\nwhere\r\nentidad='" . $entidad . "'\r\nand\r\nfolioVenta='" . $_GET['folioVenta'] . "'\r\n and\r\n gpoProducto='" . $_POST['gpoProducto1'] . "'\r\n\r\n\r\n"; } if ($result = mysql_db_query($basedatos, $sSQL)) { while ($myrow = mysql_fetch_array($result)) { $numeroE = $myrow['numeroE']; $nCuenta = $myrow['nCuenta']; if ($col) { $color = '#FFCCFF'; $col = ""; } else { $color = '#FFFFFF'; $col = 1; } $a += 1; $nT = $myrow['keyClientesInternos']; if ($myrow['naturaleza'] == 'A') { $signo = '-'; } else { $signo = NULL; } // ?> <tr > <td height="24" ><?php print $a; ?> </td> <td width="56" align="center"><?php echo $myrow['keyCAP']; ?> </td> <td width="45" ><?php echo cambia_a_normal($myrow['fecha1']); ?> </td> <td width="23" ><div align="center"> <?php echo round($myrow['cantidad'], 3); //echo $myrow['cantidad']; ?> </div></td> <td width="431" ><?php echo '<span >'; echo $myrow['descripcionArticulo']; echo '</span>'; if ($myrow['tipoPaciente'] != 'externo') { if ($myrow['naturaleza'] == 'A' and $myrow['gpoProducto'] != '') { echo '</br><div >' . 'Devolucion, folio: ' . $myrow['folioDevolucion'] . '</div>'; } } if ($myrow['fechaSolicitud'] != '') { echo '<br>'; echo 'Fecha Solicitud: ' . cambia_a_normal($myrow['fechaSolicitud']); } if ($myrow['gpoProducto'] != '') { if ($myrow['statusCargo'] == 'cargado') { echo '</br><div >' . '[ ' . $myrow['statusCargo'] . ']' . ' a las ' . '[ ' . $myrow['horaCargo'] . ']' . ' </div>Solicitado por: ' . '[ ' . $myrow['usuario'] . ']'; } else { echo '</br><div ><blink>' . '*************** FAVOR DE SURTIR ********' . '</blink></div>'; } } else { echo '</br><div >' . '[ Transaccion]' . '</div>'; } $sSQL341c = "Select descripcionGP From gpoProductos WHERE entidad='" . $entidad . "' and codigoGP='" . $myrow['gpoProducto'] . "'"; $result341c = mysql_db_query($basedatos, $sSQL341c); $myrow341c = mysql_fetch_array($result341c); echo '</br>'; echo '- ' . $myrow341c['descripcionGP'] . ' -'; echo '</br>'; if ($myrow['statusDescuentoGlobal'] == 'si') { echo '</br><span >' . ' [' . $myrow['descripcionDescuentoGlobal'] . ']' . '</span>'; } if ($myrow['facturacionEspecial'] == 'si') { echo '</br><span >' . ' [' . $myrow['descripcionSeguroFacturacion'] . ']' . '</span>'; } //***********************************ALMACENES********************************** $sSQL341cs = "Select * From almacenes WHERE entidad='" . $entidad . "' and almacen='" . $myrow['almacenSolicitante'] . "'"; $result341cs = mysql_db_query($basedatos, $sSQL341cs); $myrow341cs = mysql_fetch_array($result341cs); $sSQL341ca = "Select * From almacenes WHERE entidad='" . $entidad . "' and almacen='" . $myrow['almacenDestino'] . "'"; $result341ca = mysql_db_query($basedatos, $sSQL341ca); $myrow341ca = mysql_fetch_array($result341ca); if ($myrow['gpoProducto'] != '') { echo '</br><span >' . ' [' . $myrow341cs['descripcion'] . ' > ' . $myrow341ca['descripcion'] . '] ' . '</span>'; } //******************************************************************************************** if ($myrow['numRecibo']) { ?> </br><span > Recibo: </span> <a href="javascript:nueva('<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /INGRESOS HLC/caja/imprimirNumeroRecibo.php?keyClientesInternos=<?php echo $myrow['keyClientesInternos']; ?> &folioFactura=<?php echo $_POST['folioFactura']; ?> &paciente=<?php echo $_POST['paciente']; ?> &usuario=<?php echo $usuario; ?> &hora1=<?php echo $hora1; ?> &fechaImpresion=<?php echo $_POST['fechaImpresion']; ?> &credencial=<?php echo $_POST['credencial']; ?> &siniestro=<?php echo $_POST['siniestro']; ?> &folioVenta=<?php echo $myrow['folioVenta']; ?> &entidad=<?php echo $entidad; ?> &keyCAP=<?php echo $myrow['keyCAP']; ?> ','ventana7','800','600','yes');"> <?php echo $myrow['numRecibo']; ?> </a> <?php } if ($myrow['naturaleza'] == '-') { ?> </br><span > Cancelar </span> <a href="javascript:nueva('<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /INGRESOS HLC/caja/imprimirNumeroRecibo.php?keyClientesInternos=<?php echo $myrow['keyClientesInternos']; ?> &folioFactura=<?php echo $_POST['folioFactura']; ?> &paciente=<?php echo $_POST['paciente']; ?> &usuario=<?php echo $usuario; ?> &hora1=<?php echo $hora1; ?> &fechaImpresion=<?php echo $_POST['fechaImpresion']; ?> &credencial=<?php echo $_POST['credencial']; ?> &siniestro=<?php echo $_POST['siniestro']; ?> &folioVenta=<?php echo $myrow['folioVenta']; ?> &entidad=<?php echo $entidad; ?> &keyCAP=<?php echo $myrow['keyCAP']; ?> ','ventana7','800','600','yes');"> <?php echo $myrow['numRecibo']; ?> </a> <?php } if ($myrow['gpoProducto'] != '' and $usuario) { $sSQLa = "\r\nSELECT *\r\nFROM\r\nreportesTemporales\r\nWHERE \r\nentidad='" . $entidad . "' \r\nand\r\nusuario='" . $usuario . "' \r\nand\r\ncodigoGP='" . $myrow['gpoProducto'] . "' "; $resulta = mysql_db_query($basedatos, $sSQLa); $myrowa = mysql_fetch_array($resulta); $agrega = "INSERT INTO reportesTemporales (\r\ngpoProducto,importe,entidad,usuario,random,codigoGP,naturaleza,folioVenta\r\n) values (\r\n'" . $myrow341c['descripcionGP'] . "',\r\n'" . $myrow['precioVenta'] * $myrow['cantidad'] . "',\r\n'" . $entidad . "','" . $usuario . "','" . $random . "','" . $myrow['gpoProducto'] . "','" . $myrow['naturaleza'] . "','" . $_GET['folioVenta'] . "'\r\n\r\n)"; mysql_db_query($basedatos, $agrega); echo mysql_error(); } ?> <?php if ($myrow['naturaleza'] == '-') { ?> </br><span > <a href="javascript:ventanaSecundaria10('<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /cargos/ventanaEditar.php?keyClientesInternos=<?php echo $myrow['keyClientesInternos']; ?> &folioFactura=<?php echo $_POST['folioFactura']; ?> &paciente=<?php echo $_POST['paciente']; ?> &usuario=<?php echo $usuario; ?> &hora1=<?php echo $hora1; ?> &fechaImpresion=<?php echo $_POST['fechaImpresion']; ?> &credencial=<?php echo $_POST['credencial']; ?> &siniestro=<?php echo $_POST['siniestro']; ?> &folioVenta=<?php echo $myrow['folioVenta']; ?> &entidad=<?php echo $entidad; ?> &keyCAP=<?php echo $myrow['keyCAP']; ?> ','ventana7','500','200','yes');"> Editar</a> <?php } ?> </span> <hr /> </td> <td width="52" ><div align="center"> <?php echo '$' . number_format($myrow['precioVenta'] * $myrow['cantidad'] + $myrow['iva'] * $myrow['cantidad'], 2); ?> </div></td> <td width="25" ><div align="center"> <?php echo $myrow['naturaleza']; ?> </div></td> <td width="59" ><div align="center"> <span > <?php $triggerParticular = (double) ($myrow['cantidadParticular'] * $myrow['cantidad']) + $myrow['ivaParticular'] * $myrow['cantidad']; echo '$' . number_format($myrow['cantidadParticular'] * $myrow['cantidad'] + $myrow['ivaParticular'] * $myrow['cantidad'], 2); ?> </span> </div></td> <td width="59" ><div align="center"> <span > <?php $triggerBeneficencia = (double) ($myrow['cantidadBeneficencia'] * $myrow['cantidad']) + $myrow['ivaBeneficencia'] * $myrow['cantidad']; echo '$' . number_format($myrow['cantidadBeneficencia'] * $myrow['cantidad'] + $myrow['ivaBeneficencia'] * $myrow['cantidad'], 2); ?> </span> </div></td> <td width="69" ><div align="center"> <span > <?php $triggerAseguradora = (double) ($myrow['cantidadAseguradora'] * $myrow['cantidad']) + $myrow['ivaAseguradora'] * $myrow['cantidad']; echo '$' . number_format($myrow['cantidadAseguradora'] * $myrow['cantidad'] + $myrow['ivaAseguradora'] * $myrow['cantidad'], 2); ?> </span> </div></td> </tr> <?php //require('/configuracion/clases/operacionesGlobales.php'); //ABRE OPERACIONES GLOBALES ?> <?php //*******************************OPERACION GLOBAL***************************** //CARGOS if ($myrow['naturaleza'] == 'C' and $myrow['statusRegreso'] != 'si') { $cargo[0] += (double) ($myrow['precioVenta'] * $myrow['cantidad']) + $myrow['iva'] * $myrow['cantidad']; } //ABONOS if ($myrow['naturaleza'] == 'A' and $myrow['gpoProducto'] == '') { $abono[0] += (double) ($myrow['precioVenta'] * $myrow['cantidad']) + $myrow['iva'] * $myrow['cantidad']; } //DEVOLUCIONES if ($myrow['naturaleza'] == 'A' and $myrow['statusDevolucion'] == 'si') { $devolucion[0] += (double) ($myrow['precioVenta'] * $myrow['cantidad']) + $myrow['iva'] * $myrow['cantidad']; } //DEVOLUCIONES CARGOS if ($myrow['naturaleza'] == 'C' and $myrow['statusDevolucion'] == 'si') { $devolucionCargos[0] += (double) ($myrow['precioVenta'] * $myrow['cantidad']) + $myrow['iva'] * $myrow['cantidad']; } //REGRESOS if ($myrow['naturaleza'] == 'C' and $myrow['statusRegreso'] == 'si') { $regreso[0] += (double) ($myrow['precioVenta'] * $myrow['cantidad']) + $myrow['iva'] * $myrow['cantidad']; } //******************************************************************************* //CARGOS PARTICULARES if ($myrow['naturaleza'] == 'C' and $myrow['statusRegreso'] != 'si') { $cargoParticular[0] += (double) ($myrow['cantidadParticular'] * $myrow['cantidad']) + $myrow['ivaParticular'] * $myrow['cantidad']; } //ABONOS if ($myrow['naturaleza'] == 'A' and $myrow['gpoProducto'] == '') { $abonoParticular[0] += (double) ($myrow['cantidadParticular'] * $myrow['cantidad']) + $myrow['ivaParticular'] * $myrow['cantidad']; } //DEVOLUCIONES if ($myrow['naturaleza'] == 'A' and $myrow['statusDevolucion'] == 'si') { $devolucionParticular[0] += (double) ($myrow['cantidadParticular'] * $myrow['cantidad']) + $myrow['ivaParticular'] * $myrow['cantidad']; } //REGRESO DE EFECTIVO if ($myrow['naturaleza'] == 'C' and $myrow['statusRegreso'] == 'si') { $regresoParticular[0] += (double) ($myrow['cantidadParticular'] * $myrow['cantidad']) + $myrow['ivaParticular'] * $myrow['cantidad']; } //****************************************************************************************** //CARGOS ASEGURADORA //ES BENEFICENCIA // if($myrow['naturaleza']=='A' and $myrow['gpoProducto']==NULL){//devolucion transacciones // $abonosBeneficencia[0]+=$myrow['cantidadAseguradora']*$myrow['cantidad']; // }elseif($myrow['naturaleza']=='A' and $myrow['statusDevolucion']=='si'){//cargos al paciente // $devolucionBeneficencia[0]+=($myrow['cantidadAseguradora']*$myrow['cantidad'])+($myrow['ivaAseguradora']*$myrow['cantidad']);//devolucion articulos // }else if($myrow['naturaleza']=='C' ){//cargos al paciente // $cargosBeneficencia[0]+=($myrow['cantidadAseguradora']*$myrow['cantidad'])+($myrow['ivaAseguradora']*$myrow['cantidad']); // }else if($myrow['naturaleza']=='C' and $myrow['gpoProducto']==''){//cargos al paciente // $pagoDevBeneficencia[0]+=($myrow['precioVenta']*$myrow['cantidad'])+($myrow['iva']*$myrow['cantidad']); // } if ($myrow['naturaleza'] == 'C' and $myrow['gpoProducto'] != '') { //cargos al paciente $cargosBeneficencia[0] += (double) ($myrow['cantidadBeneficencia'] * $myrow['cantidad']) + $myrow['ivaBeneficencia'] * $myrow['cantidad']; } if ($myrow['naturaleza'] == 'A' and $myrow['gpoProducto'] != '') { //devolucion de cargo beneficencia $devolucionBeneficencia[0] += (double) ($myrow['cantidadBeneficencia'] * $myrow['cantidad']) + $myrow['ivaBeneficencia'] * $myrow['cantidad']; } if ($myrow['tipoTransaccion'] == 'DEVXB') { $dtBeneficencia[0] += (double) ($myrow['precioVenta'] * $myrow['cantidad']) + $myrow['iva'] * $myrow['cantidad']; } if ($myrow['naturaleza'] == 'A' and $myrow['gpoProducto'] == '') { //abonos $abonosBeneficencia[0] += (double) ($myrow['cantidadBeneficencia'] * $myrow['cantidad']); } if ($myrow['naturaleza'] == 'C' and $myrow['statusRegreso'] != 'si') { $cargoAseguradora[0] += (double) ($myrow['cantidadAseguradora'] * $myrow['cantidad']) + $myrow['ivaAseguradora'] * $myrow['cantidad']; } //ABONOS if ($myrow['naturaleza'] == 'A' and $myrow['gpoProducto'] == '') { $abonoAseguradora[0] += (double) ($myrow['cantidadAseguradora'] * $myrow['cantidad']) + $myrow['ivaAseguradora'] * $myrow['cantidad']; } //DEVOLUCIONES if ($myrow['naturaleza'] == 'A' and $myrow['statusDevolucion'] == 'si') { $devolucionAseguradora[0] += (double) ($myrow['cantidadAseguradora'] * $myrow['cantidad']) + $myrow['ivaAseguradora'] * $myrow['cantidad']; } //REGRESO DE TRASLADO if ($myrow['naturaleza'] == 'C' and $myrow['statusRegreso'] == 'si') { $regresoAseguradora[0] += (double) ($myrow['cantidadAseguradora'] * $myrow['cantidad']) + $myrow['ivaAseguradora'] * $myrow['cantidad']; } //IVA if ($myrow['naturaleza'] == 'C') { $ivaCargos[0] += (double) ($myrow['iva'] * $myrow['cantidad']); } elseif ($myrow['naturaleza'] == 'A') { $ivaAbonos[0] += (double) ($myrow['iva'] * $myrow['cantidad']); } //****************************************************************************************** ?> <?php //****************************COASEGURO / DEDUCIBLE ********************************** $s1 = "Select codigoTT From catTTCaja WHERE coaseguro1='si' "; $rs1 = mysql_db_query($basedatos, $s1); $my1 = mysql_fetch_array($rs1); $s2 = "Select codigoTT From catTTCaja WHERE coaseguro2='si' "; $rs2 = mysql_db_query($basedatos, $s2); $my2 = mysql_fetch_array($rs2); $s3 = "Select codigoTT From catTTCaja WHERE deducible1='si' "; $rs3 = mysql_db_query($basedatos, $s3); $my3 = mysql_fetch_array($rs3); $s4 = "Select codigoTT From catTTCaja WHERE deducible2='si' "; $rs4 = mysql_db_query($basedatos, $s4); $my4 = mysql_fetch_array($rs4); $s5 = "Select codigoTT From catTTCaja WHERE aplicarDescuentoParticulares='si' "; $rs5 = mysql_db_query($basedatos, $s5); $my5 = mysql_fetch_array($rs5); $s5a = "Select codigoTT From catTTCaja WHERE descuentoParticulares='si' "; $rs5a = mysql_db_query($basedatos, $s5a); $my5a = mysql_fetch_array($rs5a); $s6 = "Select codigoTT From catTTCaja WHERE aplicarDescuentoAseguradoras='si' "; $rs6 = mysql_db_query($basedatos, $s6); $my6 = mysql_fetch_array($rs6); $s6a = "Select codigoTT From catTTCaja WHERE descuentoAseguradoras='si' "; $rs6a = mysql_db_query($basedatos, $s6a); $my6a = mysql_fetch_array($rs6a); $s7 = "Select codigoTT From catTTCaja WHERE trasladoBeneficencia='si' "; $rs7 = mysql_db_query($basedatos, $s7); $my7 = mysql_fetch_array($rs7); //************************************************************************************* if ($myrow['tipoTransaccion'] == $my1['codigoTT']) { $coaseguro1 = $my1['codigoTT']; if ($myrow['naturaleza'] == '-') { $totalCargoCoaseguro1[0] += (double) ($myrow['precioVenta'] * $myrow['cantidad']); } else { $totalAbonoCoaseguro1[0] += (double) ($myrow['precioVenta'] * $myrow['cantidad']); } } if ($myrow['tipoTransaccion'] == $my2['codigoTT']) { $coaseguro2 = $my2['codigoTT']; if ($myrow['naturaleza'] == '-') { $totalCargoCoaseguro2[0] += (double) ($myrow['precioVenta'] * $myrow['cantidad']); } else { $totalAbonoCoaseguro2[0] += (double) ($myrow['precioVenta'] * $myrow['cantidad']); } } if ($myrow['tipoTransaccion'] == $my3['codigoTT']) { $deducible1 = $my3['codigoTT']; if ($myrow['naturaleza'] == '-') { $totalCargoDeducible1[0] += (double) ($myrow['precioVenta'] * $myrow['cantidad']); } else { $totalAbonoDeducible1[0] += (double) ($myrow['precioVenta'] * $myrow['cantidad']); } } if ($myrow['tipoTransaccion'] == $my4['codigoTT']) { $deducible2 = $my4['codigoTT']; if ($myrow['naturaleza'] == '-') { $totalCargoDeducible2[0] += (double) ($myrow['precioVenta'] * $myrow['cantidad']); } else { $totalAbonoDeducible2[0] += (double) ($myrow['precioVenta'] * $myrow['cantidad']); } } //*******************CIERRO COASEGURO Y DEDUCIBLE //****************APlicar descuentos********** if ($myrow['tipoTransaccion'] == $my5['codigoTT'] || $myrow['tipoTransaccion'] == $my5a['codigoTT']) { $descuentoParticular = $my5a['codigoTT']; if ($myrow['naturaleza'] == '-') { $descuentoParticularAplicado[0] += (double) ($myrow['cantidadParticular'] * $myrow['cantidad']); } else { $descuentosParticulares[0] += (double) ($myrow['cantidadParticular'] * $myrow['cantidad']); } } if ($myrow['tipoTransaccion'] == $my6['codigoTT'] || $myrow['tipoTransaccion'] == $my6a['codigoTT']) { $descuentoAseguradora = $my6a['codigoTT']; if ($myrow['naturaleza'] == '-') { $descuentoAseguradoraAplicado[0] += (double) ($myrow['cantidadAseguradora'] * $myrow['cantidad']); } else { $descuentosAseguradoras[0] += (double) ($myrow['cantidadAseguradora'] * $myrow['cantidad']); } } if ($myrow['tipoTransaccion'] == $my7['codigoTT'] || $myrow['tipoTransaccion'] == $my7a['codigoTT']) { $transB = $my7['codigoTT']; } //********************************************* ?> <?php //CIERRA OPERACIONES GLOBALES= ?> <?php } } ?> <input name="menu" type="hidden" value="<?php echo $menu; ?> " /> </table> </p> </div> <p> <?php //require('/configuracion/clases/mostrarTotalesEC.php'); //MOSTRAR TOTALES EC ?> <?php //OPERACIONES GLOBALES $totalCargo = (double) ($cargo[0] - $devolucion[0]); $totalAbono = (double) ($abono[0] - $regreso[0] + $descuentos[0]); $totalParticular = (double) ($cargoParticular[0] - $abonoParticular[0]) - ($devolucionParticular[0] - $regresoParticular[0]); $totalBeneficencia = (double) ($cargosBeneficencia[0] - ($abonosBeneficencia[0] - $dtBeneficencia[0])) - ($devolucionBeneficencia[0] - $regresoBeneficencia[0]); $totalAseguradora = (double) ($cargoAseguradora[0] - $abonoAseguradora[0]) - ($devolucionAseguradora[0] - $regresoAseguradora[0]); //echo $cargosBeneficencia[0].'-1- '.$abonosBeneficencia[0].'-2- '.$devolucionBeneficencia[0].' -3- '.$regresoBeneficencia[0]; //REDONDEO GLOBALES****/ $TOTAL = (double) ($totalCargo - $totalAbono); if ($TOTAL > -1 and $TOTAL < 1) { $TOTAL = '0.00'; } //************************** //******TOTAL PARTICULAR $totalParticular = (double) $totalParticular; if ($totalParticular > -1 and $totalParticular < 1) { $totalParticular = '0.00'; } //********************* //****************TOTAL IVA $ivaTotal = (double) ($ivaCargos[0] - $ivaAbonos[0]); //************************** //******TOTAL ASEGURADORA if ($totalAseguradora > -1 and $totalAseguradora < 1) { $totalAseguradora = '0.00'; } //********************* //**********COASEGUROS DEDUCIBLES************** $totalCoaseguro1 = (double) ($totalCargoCoaseguro1[0] - $totalAbonoCoaseguro1[0]); $totalCoaseguro2 = (double) ($totalCargoCoaseguro2[0] - $totalAbonoCoaseguro2[0]); $totalDeducible1 = (double) ($totalCargoDeducible1[0] - $totalAbonoDeducible1[0]); $totalDeducible2 = (double) ($totalCargoDeducible2[0] - $totalAbonoDeducible2[0]); //*************************************************** //*****************DESCUENTOS********* $descuentoP = (double) ($descuentoParticularAplicado[0] - $descuentosParticulares[0]); $descuentoA = (double) ($descuentoAseguradoraAplicado[0] - $descuentosAseguradoras[0]); //*************************************** //****************BENEFICENCIAS******** $ben = (double) ($cargosBeneficencia[0] - $devolucionBeneficencia[0]) - ($abonosBeneficencia[0] - $dtBeneficencia[0] - $pagoDevBeneficencia[0]); //************************************* ?> <?php //CIERRA TOTALES EC ?> </p> <table width="312" style="border: 1px solid #CCC;"> <tr> <th width="212" scope="col"><div align="left">Descripción</div></th> <th width="62" scope="col"><div align="left">Importe</div></th> </tr> <tr> <?php $sSQL = "\r\nSELECT gpoProducto\r\nFROM\r\ncargosCuentaPaciente\r\nWHERE\r\nentidad='" . $entidad . "'\r\nand\r\nfolioVenta='" . $_GET['folioVenta'] . "'\r\nand gpoProducto!=''\r\ngroup by gpoProducto\r\n "; if ($result = mysql_db_query($basedatos, $sSQL)) { while ($myrow = mysql_fetch_array($result)) { $codigo = $code = $myrow['codigo']; $i += 1; $sSQLac = "\r\nSELECT sum(importe) as cargo\r\nFROM\r\nreportesTemporales\r\nWHERE\r\nentidad='" . $entidad . "'\r\nand\r\nfolioVenta='" . $_GET['folioVenta'] . "'\r\nand\r\ncodigoGP='" . $myrow['gpoProducto'] . "'\r\nand\r\nnaturaleza='C'\r\n\r\n "; $resultac = mysql_db_query($basedatos, $sSQLac); $myrowac = mysql_fetch_array($resultac); $sSQLaa = "\r\nSELECT sum(importe) as abono\r\nFROM\r\nreportesTemporales\r\nWHERE\r\nentidad='" . $entidad . "'\r\nand\r\nfolioVenta='" . $_GET['folioVenta'] . "'\r\nand\r\ncodigoGP='" . $myrow['gpoProducto'] . "'\r\nand\r\nnaturaleza='A'\r\n "; $resultaa = mysql_db_query($basedatos, $sSQLaa); $myrowaa = mysql_fetch_array($resultaa); $sSQLaa1 = "\r\nSELECT *\r\nFROM\r\ngpoProductos\r\nWHERE\r\nentidad='" . $entidad . "'\r\nand codigoGP='" . $myrow['gpoProducto'] . "'\r\norder by descripcionGP ASC\r\n "; $resultaa1 = mysql_db_query($basedatos, $sSQLaa1); $myrowaa1 = mysql_fetch_array($resultaa1); ?> <td ><div align="left"><span > <?php echo $myrowaa1['descripcionGP']; ?> </span></div></td> <td align="right" ><?php echo "\$" . number_format($myrowac['cargo'] - $myrowaa['abono'], 2); ?> </td> </tr> <?php } } ?> <td align="right" > IVA: <?php echo "\$" . number_format($ivaTotal, 2); ?> </td> </table> <p align="center"> <input type="hidden" name="variable_php" id="variable_php" /> </form> <p align="center"> </p> <script languaje="JavaScript"> document.form1.variable_php.value=varjs; </script> <?php //***************SOLO MOSTRAR $q = "DELETE FROM reportesTemporales\r\nwhere\r\nentidad='" . $entidad . "'\r\nand\r\nusuario='" . $usuario . "'\r\n"; mysql_db_query($basedatos, $q); echo mysql_error(); ?> <?php //MOSSTRAR DATOS CUENTA ?> </table> </div> <?php //MOSTRAR DATOS EC // require('/configuracion/clases/mostrarDatosEC.php'); // ?> <?php //*******************REFERENCIA******************* /* //*******************************OPERACION GLOBAL***************************** //CARGOS if($myrow['naturaleza']=='C' and $myrow['statusRegreso']!='si'){ $cargo[0]+=($myrow['precioVenta']*$myrow['cantidad'])+($myrow['iva']*$myrow['cantidad']); } //ABONOS if($myrow['naturaleza']=='A' and $myrow['gpoProducto']==''){ $abono[0]+=($myrow['precioVenta']*$myrow['cantidad'])+($myrow['iva']*$myrow['cantidad']); } //DEVOLUCIONES if($myrow['naturaleza']=='A' and $myrow['statusDevolucion']=='si'){ $devolucion[0]+=($myrow['precioVenta']*$myrow['cantidad'])+($myrow['iva']*$myrow['cantidad']); } if($myrow['naturaleza']=='C' and $myrow['statusRegreso']=='si'){ $regreso[0]+=($myrow['precioVenta']*$myrow['cantidad'])+($myrow['iva']*$myrow['cantidad']); } //******************************************************************************* */ //************************************************* /* //*************CARGOS************* $sc="SELECT sum((precioVenta*cantidad) +(iva*cantidad)) as cargos FROM cargosCuentaPaciente WHERE entidad='".$entidad."' and folioVenta='".$_GET['folioVenta']."' and gpoProducto!='' and naturaleza='C' "; $rc=mysql_db_query($basedatos,$sc); $mc = mysql_fetch_array($rc); //************************************** //****************ABONOS************ $sa="SELECT sum((precioVenta*cantidad) +(iva*cantidad)) as abonos FROM cargosCuentaPaciente WHERE entidad='".$entidad."' and folioVenta='".$_GET['folioVenta']."' and gpoProducto='' and naturaleza='A' "; $ra=mysql_db_query($basedatos,$sa); $ma = mysql_fetch_array($ra); //************************************* //*******************DEVOLUCIONES************** $sd="SELECT sum((precioVenta*cantidad) +(iva*cantidad)) as devolucion FROM cargosCuentaPaciente WHERE entidad='".$entidad."' and folioVenta='".$_GET['folioVenta']."' and gpoProducto!='' and naturaleza='A' and statusDevolucion='si' "; $rd=mysql_db_query($basedatos,$sd); $md = mysql_fetch_array($rd); //************************************************************* //*****************REGRESO********************* $sr="SELECT sum((precioVenta*cantidad) +(iva*cantidad)) as regreso FROM cargosCuentaPaciente WHERE entidad='".$entidad."' and folioVenta='".$_GET['folioVenta']."' and gpoProducto!='' and naturaleza='C' and statusRegreso='si' "; $rr=mysql_db_query($basedatos,$sr); $mr = mysql_fetch_array($rr); //************************************************** //*****************REGRESO********************* $sdes="SELECT sum((precioVenta*cantidad) +(iva*cantidad)) as descuento FROM cargosCuentaPaciente WHERE entidad='".$entidad."' and folioVenta='".$_GET['folioVenta']."' and gpoProducto!='' and naturaleza='A' and statusDescuento='si' "; $rdes=mysql_db_query($basedatos,$sdes); $mdes = mysql_fetch_array($rdes); //************************************************** $totalCargo= $mc['cargos']-$md['devolucion']-$mr['regreso']-$mdes['descuento']; $totalAbono=$ma['abonos']; */ ?> <table width="380" border="0" align="center" cellspacing="0" style="border: 1px solid #CCC;"> <tr > <td width="25" height="25" > </td> <td width="113" >Cargos</td> <td width="36" > <?php echo '$' . number_format($totalCargo, 2); ?> </td> </tr> <tr > <td height="26"> </td> <td >Abonos</td> <td ><?php echo '$' . number_format($totalAbono, 2); ?> </td> </tr> <tr > <td height="26" > </td> <td >Total</td> <td ><?php echo '$' . number_format($TOTAL, 2); ?> </td> </tr> </table> <?php // // //CIERRA MOSTRAR DATOS EC ?> <?php $saldos = new acumulados(); if ($limiteSEGURO > 0 and $SEGURO != NULL) { //doble if $sSQL7ab = "Select * from segurosLimites where entidad='" . $entidad . "' and seguro='" . $SEGURO . "' "; $result7ab = mysql_db_query($basedatos, $sSQL7ab); $myrow7ab = mysql_fetch_array($result7ab); $acumulado = $myrow7ab['cantidad'] - $saldos->verificarSaldos($myrow3['seguro'], $entidad, $fecha1, $basedatos, $myrow3['numeroE'], $mmt); if ($TOTAL <= $acumulado) { //MOSTRAR EFECTUAR TRANSACCIONES ?> <?php $descripcionTransaccion = $_GET['descripcionTransaccion']; //******ULTIMO TIRON************** if ($_GET['descripcionTransaccion'] == 'altaPacientes') { $sSQL3 = "Select * From clientesInternos WHERE keyClientesInternos = '" . $_GET['nT'] . "' "; $result3 = mysql_db_query($basedatos, $sSQL3); $myrow3 = mysql_fetch_array($result3); } else { $sSQL3 = "Select * From clientesInternos WHERE keyClientesInternos = '" . $_GET['nCuenta'] . "' "; $result3 = mysql_db_query($basedatos, $sSQL3); $myrow3 = mysql_fetch_array($result3); } //*********************************** ?> <p> </p> <a name="final"> </a> <table width="590" border="0" align="center" cellpadding="4" cellspacing="0" class="table table-striped" style="border: 1px solid #CCC;"> <tr> <th colspan="2" ><b >Particular</b></th> <th width="75" > </th> <th colspan="2" ><b >Beneficencia</b></th> <th width="75" > </th> <th colspan="2" ><b >Aseguradora</b></th> </tr> <tr> <td width="137" ><span >Cargos</span></td> <td width="75"><span > <?php $sSQLpartc = "Select sum(cantidadParticular*cantidad) as totalParticular, sum(ivaParticular*cantidad) as totalIVA From cargosCuentaPaciente WHERE entidad='" . $entidad . "' and folioVenta = '" . $_GET['folioVenta'] . "' \r\nand\r\nnaturaleza='C'\r\nand\r\ngpoProducto!=''\r\n "; $resultpartc = mysql_db_query($basedatos, $sSQLpartc); $myrowpartc = mysql_fetch_array($resultpartc); $sSQLparta = "Select sum(cantidadParticular*cantidad) as totalParticular, sum(ivaParticular*cantidad) as totalIVA From cargosCuentaPaciente WHERE entidad='" . $entidad . "' and folioVenta = '" . $_GET['folioVenta'] . "' \r\nand\r\nnaturaleza='A'\r\nand\r\ngpoProducto!=''\r\n "; $resultparta = mysql_db_query($basedatos, $sSQLparta); $myrowparta = mysql_fetch_array($resultparta); echo '$' . number_format($myrowpartc['totalParticular'] - $myrowparta['totalParticular'], 2); ?> </span></td> <td> </td> <td width="137" ><span >Cargos</span></td> <td width="75"><span > <?php $sSQLbenec = "Select sum(cantidadBeneficencia*cantidad) as totalParticular, sum(ivaBeneficencia*cantidad) as totalIVA From cargosCuentaPaciente WHERE entidad='" . $entidad . "' and folioVenta = '" . $_GET['folioVenta'] . "' \r\nand\r\nnaturaleza='C'\r\nand\r\ngpoProducto!=''\r\n "; $resultbenec = mysql_db_query($basedatos, $sSQLbenec); $myrowbenec = mysql_fetch_array($resultbenec); $sSQLbenea = "Select sum(cantidadBeneficencia*cantidad) as totalParticular, sum(ivaBeneficencia*cantidad) as totalIVA From cargosCuentaPaciente WHERE entidad='" . $entidad . "' and folioVenta = '" . $_GET['folioVenta'] . "' \r\nand\r\nnaturaleza='A'\r\nand\r\ngpoProducto!=''\r\n "; $resultbenea = mysql_db_query($basedatos, $sSQLbenea); $myrowbenea = mysql_fetch_array($resultbenea); echo '$' . number_format($myrowbenec['totalParticular'] - $myrowbenea['totalParticular'], 2); ?> </span></td> <td> </td> <td width="116"><span >Cargos</span></td> <td width="153"><span > <?php $sSQLasegc = "Select sum(cantidadAseguradora*cantidad) as totalAseguradora, sum(ivaAseguradora*cantidad) as totalIVA From cargosCuentaPaciente WHERE entidad='" . $entidad . "' and folioVenta = '" . $_GET['folioVenta'] . "' \r\nand\r\nnaturaleza='C'\r\nand\r\ngpoProducto!=''\r\n "; $resultasegc = mysql_db_query($basedatos, $sSQLasegc); $myrowasegc = mysql_fetch_array($resultasegc); $sSQLasega = "Select sum(cantidadAseguradora*cantidad) as totalAseguradora, sum(ivaAseguradora*cantidad) as totalIVA \r\n From cargosCuentaPaciente WHERE entidad='" . $entidad . "' and folioVenta = '" . $_GET['folioVenta'] . "' \r\nand\r\nnaturaleza='A'\r\nand\r\ngpoProducto!=''\r\n "; $resultasega = mysql_db_query($basedatos, $sSQLasega); $myrowasega = mysql_fetch_array($resultasega); echo '$' . number_format($myrowasegc['totalAseguradora'] - $myrowasega['totalAseguradora'], 2); ?> </span></td> </tr> <tr> <td><span >IVA</span></td> <td><span ><?php echo '$' . number_format($myrowpartc['totalIVA'] - $myrowparta['totalIVA'], 2); ?> </span></td> <td> </td> <td><span >IVA</span></td> <td><span ><?php echo '$' . number_format($myrowbenec['totalIVA'] - $myrowbenea['totalIVA'], 2); ?> </span></td> <td> </td> <td><span >IVA</span></td> <td><span ><?php echo '$' . number_format($myrowasegc['totalIVA'] - $myrowasega['totalIVA'], 2); ?> </span></td> </tr> <tr> <td><span >Total</span></td> <td><span ><?php echo '$' . number_format($myrowpartc['totalParticular'] + $myrowpartc['totalIVA'] - ($myrowparta['totalParticular'] + $myrowparta['totalIVA']), 2); ?> </span></td> <td> </td> <td><span >Total</span></td> <td><span ><?php echo '$' . number_format($myrowbenec['totalParticular'] + $myrowbenec['totalIVA'] - ($myrowbenea['totalParticular'] + $myrowbenea['totalIVA']), 2); ?> </span></td> <td> </td> <td><span >Total</span></td> <td><span ><?php echo '$' . number_format($myrowasegc['totalAseguradora'] + $myrowasegc['totalIVA'] - ($myrowasega['totalAseguradora'] + $myrowasega['totalIVA']), 2); ?> </span></td> </tr> </table> <p> </p> <table width="900" class="table table-striped" style="border: 1px solid #CCC;"> <tr > <th width="76" ><div align="center">Part</div></th> <th width="76" ><div align="center">Aseg</div></th> <th width="111" ><div align="center">Regreso Aseg</div></th> <th width="104" ><div align="center">Regreso Part </div></th> <th width="89" ><div align="center">C1</div></th> <th width="100" ><div align="center">C2</div></th> <th width="95" ><div align="center">D1</div></th> <th width="88" ><div align="center">D2</div></th> <th width="77" ><div align="center">Desc Part </div></th> <th width="84" ><div align="center">Desc Aseg </div></th> <th width="84" ><div align="center">Beneficencia</div></th> </tr> <tr > <td height="48" ><div align="center"><span > <?php //************************PARTICULARES********************************************************************** //CARGOS PARTICULARES REFERENCIAS /* if($myrow['naturaleza']=='C' and $myrow['statusRegreso']!='si'){ $cargoParticular[0]+=($myrow['cantidadParticular']*$myrow['cantidad'])+($myrow['ivaParticular']*$myrow['cantidad']); } //ABONOS if($myrow['naturaleza']=='A' and $myrow['gpoProducto']==''){ $abonoParticular[0]+=($myrow['cantidadParticular']*$myrow['cantidad'])+($myrow['ivaParticular']*$myrow['cantidad']); } //DEVOLUCIONES if($myrow['naturaleza']=='A' and $myrow['statusDevolucion']=='si'){ $devolucionParticular[0]+=($myrow['cantidadParticular']*$myrow['cantidad'])+($myrow['ivaParticular']*$myrow['cantidad']); } //REGRESO DE EFECTIVO if($myrow['naturaleza']=='C' and $myrow['statusRegreso']=='si'){ $regresoParticular[0]+=($myrow['cantidadParticular']*$myrow['cantidad'])+($myrow['ivaParticular']*$myrow['cantidad']); } */ //****************************************************************************************** /* //*************CARGOS************* $sPc="SELECT sum((cantidadParticular*cantidad) +(ivaParticular*cantidad) as cargoParticular FROM cargosCuentaPaciente WHERE entidad='".$entidad."' and folioVenta='".$_GET['folioVenta']."' and gpoProducto!='' and naturaleza='C' "; $rPc=mysql_db_query($basedatos,$sPc); $mPc = mysql_fetch_array($rPc); //************************************** //****************ABONOS************ $sPa="SELECT sum((cantidadParticular*cantidad) +(ivaParticular*cantidad) as abonoParticular FROM cargosCuentaPaciente WHERE entidad='".$entidad."' and folioVenta='".$_GET['folioVenta']."' and gpoProducto='' and naturaleza='A' "; $rPa=mysql_db_query($basedatos,$sPa); $mPa = mysql_fetch_array($rPa); //************************************* //*******************DEVOLUCIONES************** $sPd="SELECT sum((cantidadParticular*cantidad) +(ivaParticular*cantidad) as devolucionParticular FROM cargosCuentaPaciente WHERE entidad='".$entidad."' and folioVenta='".$_GET['folioVenta']."' and gpoProducto!='' and naturaleza='A' and statusDevolucion='si' "; $rPd=mysql_db_query($basedatos,$sPd); $mPd = mysql_fetch_array($rPd); //************************************************************* //*****************REGRESO********************* $sPr="SELECT sum((cantidadParticular*cantidad) +(ivaParticular*cantidad) as regresoParticular FROM cargosCuentaPaciente WHERE entidad='".$entidad."' and folioVenta='".$_GET['folioVenta']."' and gpoProducto!='' and naturaleza='C' and statusRegreso='si' "; $rPr=mysql_db_query($basedatos,$sPr); $mPr = mysql_fetch_array($rPr); //************************************************** //*****************REGRESO********************* $sPdes="SELECT sum((cantidadParticular*cantidad) +(ivaParticular*cantidad) as descuentoParticular FROM cargosCuentaPaciente WHERE entidad='".$entidad."' and folioVenta='".$_GET['folioVenta']."' and gpoProducto!='' and naturaleza='A' and statusDescuento='si' "; $rPdes=mysql_db_query($basedatos,$sPdes); $mPdes = mysql_fetch_array($rPdes); //************************************************** $totalParticular= $mPc['cargoParticular']-$mPa['abonoParticular']-$mPd['devolucionParticular']-$mPr['regresoParticular']-$mPdes['descuentoParticular']; //*********************************************** ****************************************************************************** */ if ($totalParticular > 1 || ($myrow3['statusDevolucion'] == 'si' and $descuentoP < 1 and $descuentoA < 1)) { if ($myrow3['statusCortesia'] == 'si') { $tipoPago = 'Cortesia'; } else { if ($myrow3['tipoPaciente'] == 'externo' or ($myrow3['tipoPaciente'] == 'interno' or $myrow3['tipoPaciente'] == 'urgencias') and $myrow3['statusDevolucion'] == 'si') { if ($devolucionParticular[0] > 0 and $myrow3['statusDevolucion'] == 'si') { $tipoDevolucion = ''; $tipoPago = ''; if ($totalParticular < 0) { $totalParticular *= -1; } } else { $s = "Select codigoTT From catTTCaja WHERE pagoEfectivo='si'"; $rs = mysql_db_query($basedatos, $s); $my = mysql_fetch_array($rs); $tipoPago = 'Efectivo'; } } elseif ($myrow3['activaBeneficencia'] == 'si') { $s = "Select codigoTT From catTTCaja WHERE trasladoBeneficencia='si'"; $rs = mysql_db_query($basedatos, $s); $my = mysql_fetch_array($rs); $tipoPago = 'Beneficencia'; $caso = 1; } else { $s = "Select codigoTT From catTTCaja WHERE gastosParticulares='si'"; $rs = mysql_db_query($basedatos, $s); $my = mysql_fetch_array($rs); $tipoPago = 'Efectivo'; } } ?> <?php if ($mostrar == TRUE) { ?> <?php if ($totalParticular > 0 and $totalParticular > -1) { ?> <a href="javascript:nueva('<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /INGRESOS%20HLC/caja/ventanaAplicaPagoInternos.php?usuario=<?php echo $_GET['usuario']; ?> &numeroE=<?php echo $numeroE; ?> &almacen=<?php echo $_GET['almacenSolicitante']; ?> &almacenFuente=<?php echo $almacen; ?> &seguro=<?php echo $seguroT; ?> &nCuenta=<?php echo $keyClientesInternos; ?> &tipoCliente=<?php echo 'particular'; ?> &tipoVenta=<?php echo $folioVENTA; ?> &folioVenta=<?php echo $myrow3['folioVenta']; ?> &keyClientesInternos=<?php echo $keyClientesInternos; ?> &rand=<?php echo rand(1000, 10000000); ?> &paquete=<?php echo $_GET['paquete']; ?> &transaccion=particular&precioVenta=<?php echo $totalParticular; ?> &modoPago=<?php if ($_GET['devolucion'] == 'si') { echo 'devolucionParticular'; } else { echo 'efectivo'; } ?> &tipoTransaccion=particular&tipoPago=<?php echo $tipoPago; ?> &descripcionTransaccion=<?php echo $descripcionTransaccion; ?> &status=<?php echo $myrow3['status']; ?> &statusCortesia=<?php echo $myrow3['statusCortesia']; ?> &tipoDevolucion=<?php echo $tipoDevolucion; ?> &beneficencia=<?php if ($myrow3['activaBeneficencia'] == 'si') { echo 'si'; } ?> &statusBeneficencia=<?php if ($myrow3['activaBeneficencia'] == 'si') { echo 'si'; } ?> &activaBeneficencia=<?php if ($myrow3['activaBeneficencia'] == 'si') { echo 'si'; } ?> &caso=<?php echo $caso; ?> ','ventana7','680','380','yes');"> <?php echo '$' . number_format($totalParticular, 2); ?> </a> <?php } else { echo '<img src="' . CONSTANT_PATH_SIMA_RAIZ . '/imagenes/btns/checkbtn.png" width="18" height="18" />'; } ?> <?php } else { echo '$' . number_format($totalParticular, 2); } ?> <?php } else { ?> <img src="<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /imagenes/btns/checkbtn.png" width="18" height="18" /> <?php } ?> </span></div></td> <td ><div align="center"><span > <?php //********************************cANTIDAD ASEGURADORA**************************************** //*********************REFERENCIA*****************/ /* //CARGOS ASEGURADORA if($myrow['naturaleza']=='C' and $myrow['statusRegreso']!='si'){ $cargoAseguradora[0]+=($myrow['cantidadAseguradora']*$myrow['cantidad'])+($myrow['ivaAseguradora']*$myrow['cantidad']); } //ABONOS if($myrow['naturaleza']=='A' and $myrow['gpoProducto']==''){ $abonoAseguradora[0]+=($myrow['cantidadAseguradora']*$myrow['cantidad'])+($myrow['ivaAseguradora']*$myrow['cantidad']); } //DEVOLUCIONES if($myrow['naturaleza']=='A' and $myrow['statusDevolucion']=='si'){ $devolucionAseguradora[0]+=($myrow['cantidadAseguradora']*$myrow['cantidad'])+($myrow['ivaAseguradora']*$myrow['cantidad']); } //REGRESO DE TRASLADO if($myrow['naturaleza']=='C' and $myrow['statusRegreso']=='si'){ $regresoAseguradora[0]+=($myrow['cantidadAseguradora']*$myrow['cantidad'])+($myrow['ivaAseguradora']*$myrow['cantidad']); } */ /* //*************CARGOS************* $sAc="SELECT sum((cantidadAseguradora*cantidad) +(ivaAseguradora*cantidad) as cargoAseguradora FROM cargosCuentaPaciente WHERE entidad='".$entidad."' and folioVenta='".$_GET['folioVenta']."' and gpoProducto!='' and naturaleza='C' "; $rAc=mysql_db_query($basedatos,$sAc); $mAc = mysql_fetch_array($rAc); //************************************** //****************ABONOS************ $sAa="SELECT sum((cantidadAseguradora*cantidad) +(ivaAseguradora*cantidad) as abonoAseguradora FROM cargosCuentaPaciente WHERE entidad='".$entidad."' and folioVenta='".$_GET['folioVenta']."' and gpoProducto='' and naturaleza='A' "; $rAa=mysql_db_query($basedatos,$sAa); $mAa = mysql_fetch_array($rAa); //************************************* //*******************DEVOLUCIONES************** $sAd="SELECT sum((cantidadAseguradora*cantidad) +(ivaAseguradora*cantidad) as devolucionAseguradora FROM cargosCuentaPaciente WHERE entidad='".$entidad."' and folioVenta='".$_GET['folioVenta']."' and gpoProducto!='' and naturaleza='A' and statusDevolucion='si' "; $rAd=mysql_db_query($basedatos,$sAd); $mAd = mysql_fetch_array($rAd); //************************************************************* //*****************REGRESO********************* $sAr="SELECT sum((cantidadAseguradora*cantidad) +(ivaAseguradora*cantidad) as regresoAseguradora FROM cargosCuentaPaciente WHERE entidad='".$entidad."' and folioVenta='".$_GET['folioVenta']."' and gpoProducto!='' and naturaleza='C' and statusRegreso='si' "; $rAr=mysql_db_query($basedatos,$sAr); $mAr = mysql_fetch_array($rAr); //************************************************** //*****************REGRESO********************* $sdes="SELECT sum((cantidadAseguradora*cantidad) +(ivaAseguradora*cantidad) as descuentoAseguradora FROM cargosCuentaPaciente WHERE entidad='".$entidad."' and folioVenta='".$_GET['folioVenta']."' and gpoProducto!='' and naturaleza='A' and statusDescuento='si' "; $rPdes=mysql_db_query($basedatos,$sPdes); $mPdes = mysql_fetch_array($rPdes); //************************************************** $totalParticular= $mPc['cargoParticular']-$mPa['abonoParticular']-$mPd['devolucionParticular']-$mPr['regresoParticular']-$mPdes['descuentoParticular']; //*********************************************** ****************************************************************************** */ //************************************************************************************************** if ($totalAseguradora > 1 || $myrow3['statusDevolucion'] == 'si') { if ($devolucionAseguradora[0] > 0 and $myrow3['statusDevolucion'] == 'si') { $s = "Select codigoTT From catTTCaja WHERE devolucionAseguradora='si'"; $rs = mysql_db_query($basedatos, $s); $my = mysql_fetch_array($rs); if ($totalAseguradora < 0) { $totalAseguradora *= -1; } $tipoPago = ''; } else { $s = "Select codigoTT From catTTCaja WHERE trasladoAseguradora='si'"; $rs = mysql_db_query($basedatos, $s); $my = mysql_fetch_array($rs); $tipoPago = 'Cuentas por Cobrar'; } ?> <?php if ($totalCoaseguro1 < 1 and $totalCoaseguro2 < 1 and $totalDeducible1 < 1 and $totalDeducible2 < 1 and $descuentoP < 1 and $descuentoA < 1) { ?> <?php if ($mostrar == TRUE) { ?> <?php if ($totalAseguradora > -1 and $totalAseguradora > 0) { ?> <a href="javascript:nueva('<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /INGRESOS%20HLC/caja/ventanaAplicaPagoInternos.php?usuario=<?php echo $_GET['usuario']; ?> &numeroE=<?php echo $numeroE; ?> &almacen=<?php echo $_GET['almacenSolicitante']; ?> &almacenFuente=<?php echo $almacen; ?> &seguro=<?php echo $seguroT; ?> &nCuenta=<?php echo $keyClientesInternos; ?> &tipoCliente=<?php echo 'particular'; ?> &tipoVenta=<?php echo $folioVENTA; ?> &folioVenta=<?php echo $myrow3['folioVenta']; ?> &keyClientesInternos=<?php echo $keyClientesInternos; ?> &rand=<?php echo rand(1000, 10000000); ?> &paquete=<?php echo $_GET['paquete']; ?> &precioVenta=<?php echo $totalAseguradora; ?> &modoPago=<?php if ($_GET['devolucion'] == 'si') { echo 'devolucionAseguradora'; } else { echo 'cxc'; } ?> &transaccion=<?php echo $my['codigoTT']; ?> &tipoTransaccion=aseguradora&tipoPago=<?php echo $tipoPago; ?> &devolucion=<?php echo $_GET['devolucion']; ?> &descripcionTransaccion=<?php echo $descripcionTransaccion; ?> &status=<?php echo $myrow3['status']; ?> ','ventana7','800','380','yes');"> <?php echo '$' . number_format($totalAseguradora, 2); ?> </a> <?php } else { echo '<img src="' . CONSTANT_PATH_SIMA_RAIZ . '/imagenes/btns/checkbtn.png" width="18" height="18" />'; } ?> <?php } else { echo '$' . number_format($totalAseguradora, 2); } ?> <?php } else { ?> <?php echo '$' . number_format($totalAseguradora, 2); ?> <?php } ?> <?php } else { ?> <img src="<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /imagenes/btns/checkbtn.png" width="18" height="18" /> <?php } ?> </span></div></td> <td > <div align="center"><span > <?php if ($totalAseguradora < -1 and $devolucionAseguradora[0] < 1) { $tA = $totalAseguradora * -1; ?> <?php if ($mostrar == TRUE) { ?> <a href="javascript:nueva('<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /INGRESOS%20HLC/caja/ventanaAplicaPagoInternos.php?usuario=<?php echo $_GET['usuario']; ?> &numeroE=<?php echo $numeroE; ?> &almacen=<?php echo $_GET['almacenSolicitante']; ?> &almacenFuente=<?php echo $almacen; ?> &seguro=<?php echo $seguroT; ?> &nCuenta=<?php echo $keyClientesInternos; ?> &tipoCliente=<?php echo 'particular'; ?> &tipoVenta=<?php echo $folioVENTA; ?> &folioVenta=<?php echo $myrow3['folioVenta']; ?> &keyClientesInternos=<?php echo $keyClientesInternos; ?> &rand=<?php echo rand(1000, 10000000); ?> &paquete=<?php echo $_GET['paquete']; ?> &transaccion=regreso&precioVenta=<?php echo $tA; ?> &modoPago=regresoAseguradora&tipoTransaccion=particular&tipoPago=regresoAseguradora&descripcionTransaccion=<?php echo $descripcionTransaccion; ?> &status=<?php echo $myrow3['status']; ?> ','ventana7','400','800','yes');"> </a></span></div> <span ><a href="javascript:nueva('<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /INGRESOS%20HLC/caja/ventanaAplicaPagoInternos.php?usuario=<?php echo $_GET['usuario']; ?> &numeroE=<?php echo $numeroE; ?> &almacen=<?php echo $_GET['almacenSolicitante']; ?> &almacenFuente=<?php echo $almacen; ?> &seguro=<?php echo $seguroT; ?> &nCuenta=<?php echo $keyClientesInternos; ?> &tipoCliente=<?php echo 'particular'; ?> &tipoVenta=<?php echo $folioVENTA; ?> &folioVenta=<?php echo $myrow3['folioVenta']; ?> &keyClientesInternos=<?php echo $keyClientesInternos; ?> &rand=<?php echo rand(1000, 10000000); ?> &paquete=<?php echo $_GET['paquete']; ?> &transaccion=regreso&precioVenta=<?php echo $tA; ?> &modoPago=regresoAseguradora&tipoTransaccion=particular&tipoPago=regresoAseguradora&descripcionTransaccion=<?php echo $descripcionTransaccion; ?> &status=<?php echo $myrow3['status']; ?> ','ventana7','400','800','yes');"><blink> <div align="center"><?php echo '$' . number_format($tA, 2); ?> </div> </blink></a> <div align="center"> <?php } else { echo '$' . number_format($tA, 2); } ?> <?php } else { ?> <img src="<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /imagenes/btns/checkbtn.png" width="18" height="18" /> <?php } ?> </div> </span> </td> <td ><div align="center"><span > <?php if ($totalParticular < -1) { $tP = $totalParticular * -1; ?> <?php if ($mostrar == TRUE) { ?> <a href="javascript:nueva('<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /INGRESOS%20HLC/caja/ventanaAplicaPagoInternos.php?usuario=<?php echo $_GET['usuario']; ?> &numeroE=<?php echo $numeroE; ?> &almacen=<?php echo $_GET['almacenSolicitante']; ?> &almacenFuente=<?php echo $almacen; ?> &seguro=<?php echo $seguroT; ?> &nCuenta=<?php echo $keyClientesInternos; ?> &tipoCliente=<?php echo 'particular'; ?> &tipoVenta=<?php echo $folioVENTA; ?> &folioVenta=<?php echo $myrow3['folioVenta']; ?> &keyClientesInternos=<?php echo $keyClientesInternos; ?> &rand=<?php echo rand(1000, 10000000); ?> &paquete=<?php echo $_GET['paquete']; ?> &transaccion=regreso&precioVenta=<?php echo $tP; ?> &modoPago=regresoParticular&tipoTransaccion=particular&tipoPago=regresoParticular&descripcionTransaccion=<?php echo $descripcionTransaccion; ?> &status=<?php echo $myrow3['status']; ?> ','ventana7','400','800','yes');"></a></span></div> <span > <a href="javascript:nueva('<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /INGRESOS%20HLC/caja/ventanaAplicaPagoInternos.php?usuario=<?php echo $_GET['usuario']; ?> &numeroE=<?php echo $numeroE; ?> &almacen=<?php echo $_GET['almacenSolicitante']; ?> &almacenFuente=<?php echo $almacen; ?> &seguro=<?php echo $seguroT; ?> &nCuenta=<?php echo $keyClientesInternos; ?> &tipoCliente=<?php echo 'particular'; ?> &tipoVenta=<?php echo $folioVENTA; ?> &folioVenta=<?php echo $myrow3['folioVenta']; ?> &keyClientesInternos=<?php echo $keyClientesInternos; ?> &rand=<?php echo rand(1000, 10000000); ?> &paquete=<?php echo $_GET['paquete']; ?> &transaccion=regreso&precioVenta=<?php echo $tP; ?> &modoPago=regresoParticular&tipoTransaccion=particular&tipoPago=regresoParticular&descripcionTransaccion=<?php echo $descripcionTransaccion; ?> &status=<?php echo $myrow3['status']; ?> ','ventana7','400','800','yes');"><blink> <div align="center"> <?php echo '$' . number_format($tP, 2); ?> </div> </blink></a> <div align="center"> <?php } else { echo '$' . number_format($tP, 2); } ?> <?php } else { ?> <img src="<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /imagenes/btns/checkbtn.png" width="18" height="18" /> <?php } ?> </div> </span></td> <td ><div align="center"><span > <?php if ($totalCoaseguro1 > 1) { ?> <?php if ($mostrar == TRUE) { ?> <a href="javascript:nueva('<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /INGRESOS%20HLC/caja/ventanaAplicaPagoInternos.php?usuario=<?php echo $_GET['usuario']; ?> &numeroE=<?php echo $numeroE; ?> &almacen=<?php echo $_GET['almacenSolicitante']; ?> &almacenFuente=<?php echo $almacen; ?> &seguro=<?php echo $seguroT; ?> &nCuenta=<?php echo $keyClientesInternos; ?> &tipoCliente=<?php echo 'particular'; ?> &tipoVenta=<?php echo $folioVENTA; ?> &folioVenta=<?php echo $myrow3['folioVenta']; ?> &keyClientesInternos=<?php echo $keyClientesInternos; ?> &rand=<?php echo rand(1000, 10000000); ?> &paquete=<?php echo $_GET['paquete']; ?> &transaccion=<?php echo $coaseguro1; ?> &precioVenta=<?php echo $totalCoaseguro1; ?> &modoPago=efectivo&tipoTransaccion=coaseguro&numCoaseguro=PCoaS1&tipoPago=Efectivo&descripcionTransaccion=<?php echo $descripcionTransaccion; ?> &status=<?php echo $myrow3['status']; ?> ','ventana7','480','380','yes');"> <?php echo '$' . number_format($totalCoaseguro1, 2); ?> </a> <?php } else { echo '$' . number_format($totalCoaseguro1, 2); } ?> <?php } else { ?> <img src="<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /imagenes/btns/checkbtn.png" width="18" height="18" /> <?php } ?> </span></div></td> <td ><div align="center"><span > <?php if ($totalCoaseguro2 > 1) { ?> <?php if ($mostrar == TRUE) { ?> <a href="javascript:nueva('<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /INGRESOS%20HLC/caja/ventanaAplicaPagoInternos.php?usuario=<?php echo $_GET['usuario']; ?> &numeroE=<?php echo $numeroE; ?> &almacen=<?php echo $_GET['almacenSolicitante']; ?> &almacenFuente=<?php echo $almacen; ?> &seguro=<?php echo $seguroT; ?> &nCuenta=<?php echo $keyClientesInternos; ?> &tipoCliente=<?php echo 'particular'; ?> &tipoVenta=<?php echo $folioVENTA; ?> &folioVenta=<?php echo $myrow3['folioVenta']; ?> &keyClientesInternos=<?php echo $keyClientesInternos; ?> &rand=<?php echo rand(1000, 10000000); ?> &paquete=<?php echo $_GET['paquete']; ?> &transaccion=<?php echo $coaseguro2; ?> &precioVenta=<?php echo $totalCoaseguro2; ?> &modoPago=efectivo&tipoTransaccion=coaseguro&numCoaseguro=PCoaS2&tipoPago=Efectivo&descripcionTransaccion=<?php echo $descripcionTransaccion; ?> &status=<?php echo $myrow3['status']; ?> ','ventana7','480','380','yes');"> <?php echo '$' . number_format($totalCoaseguro2, 2); ?> </a> <?php } else { echo '$' . number_format($totalCoaseguro2, 2); } ?> <?php } else { ?> <img src="<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /imagenes/btns/checkbtn.png" width="18" height="18" /> <?php } ?> </span></div></td> <td ><div align="center"><span > <?php if ($totalDeducible1 > 1) { ?> <?php if ($mostrar == TRUE) { ?> <a href="javascript:nueva('<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /INGRESOS%20HLC/caja/ventanaAplicaPagoInternos.php?usuario=<?php echo $_GET['usuario']; ?> &numeroE=<?php echo $numeroE; ?> &almacen=<?php echo $_GET['almacenSolicitante']; ?> &almacenFuente=<?php echo $almacen; ?> &seguro=<?php echo $seguroT; ?> &nCuenta=<?php echo $keyClientesInternos; ?> &tipoCliente=<?php echo 'particular'; ?> &tipoVenta=<?php echo $folioVENTA; ?> &folioVenta=<?php echo $myrow3['folioVenta']; ?> &keyClientesInternos=<?php echo $keyClientesInternos; ?> &rand=<?php echo rand(1000, 10000000); ?> &paquete=<?php echo $_GET['paquete']; ?> &transaccion=<?php echo $deducible1; ?> &precioVenta=<?php echo $totalDeducible1; ?> &modoPago=efectivo&tipoTransaccion=coaseguro&numCoaseguro=PDeduSeg1&tipoPago=Efectivo&descripcionTransaccion=<?php echo $descripcionTransaccion; ?> &status=<?php echo $myrow3['status']; ?> ','ventana7','480','380','yes');"> <?php echo '$' . number_format($totalDeducible1, 2); ?> </a> <?php } else { echo '$' . number_format($totalDeducible1, 2); } ?> <?php } else { ?> <img src="<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /imagenes/btns/checkbtn.png" width="18" height="18" /> <?php } ?> </span></div></td> <td ><div align="center"><span > <?php if ($totalDeducible2 > 1) { ?> <?php if ($mostrar == TRUE) { ?> <a href="javascript:nueva('<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /INGRESOS%20HLC/caja/ventanaAplicaPagoInternos.php?usuario=<?php echo $_GET['usuario']; ?> &numeroE=<?php echo $numeroE; ?> &almacen=<?php echo $_GET['almacenSolicitante']; ?> &almacenFuente=<?php echo $almacen; ?> &seguro=<?php echo $seguroT; ?> &nCuenta=<?php echo $keyClientesInternos; ?> &tipoCliente=<?php echo 'particular'; ?> &tipoVenta=<?php echo $folioVENTA; ?> &folioVenta=<?php echo $myrow3['folioVenta']; ?> &keyClientesInternos=<?php echo $keyClientesInternos; ?> &rand=<?php echo rand(1000, 10000000); ?> &paquete=<?php echo $_GET['paquete']; ?> &transaccion=<?php echo $deducible2; ?> &precioVenta=<?php echo $totalDeducible2; ?> &modoPago=efectivo&tipoTransaccion=coaseguro&numCoaseguro=PDeduSeg2&tipoPago=Efectivo&descripcionTransaccion=<?php echo $descripcionTransaccion; ?> &status=<?php echo $myrow3['status']; ?> ','ventana7','480','380','yes');"> <?php echo '$' . number_format($totalDeducible2, 2); ?> </a> <?php } else { echo '$' . number_format($totalDeducible2, 2); } ?> <?php } else { ?> <img src="<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /imagenes/btns/checkbtn.png" width="18" height="18" /> <?php } ?> </span></div></td> <td > <div align="center"> <span > <?php if ($descuentoP > 1) { ?> <?php if ($mostrar == TRUE) { ?> <a href="javascript:nueva('<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /INGRESOS%20HLC/caja/ventanaAplicaPagoInternos.php?usuario=<?php echo $_GET['usuario']; ?> &numeroE=<?php echo $numeroE; ?> &almacen=<?php echo $_GET['almacenSolicitante']; ?> &almacenFuente=<?php echo $almacen; ?> &seguro=<?php echo $seguroT; ?> &nCuenta=<?php echo $keyClientesInternos; ?> &tipoCliente=<?php echo 'particular'; ?> &tipoVenta=<?php echo $folioVENTA; ?> &folioVenta=<?php echo $myrow3['folioVenta']; ?> &keyClientesInternos=<?php echo $keyClientesInternos; ?> &rand=<?php echo rand(1000, 10000000); ?> &paquete=<?php echo $_GET['paquete']; ?> &transaccion=<?php echo $descuentoParticular; ?> &precioVenta=<?php echo $descuentoP; ?> &modoPago=descuentos&tipoPago=descuentos&descuento=particular&descripcionTransaccion=<?php echo $descripcionTransaccion; ?> &status=<?php echo $myrow3['status']; ?> ','ventana7','480','380','yes');"> <?php echo '<span class="precio1"><blink>$' . number_format($descuentoP, 2) . '</blink></span>'; ?> </a> <?php } else { echo '$' . number_format($descuentoP, 2); } ?> <?php } else { ?> <img src="<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /imagenes/btns/checkbtn.png" width="18" height="18" /> <?php } ?> </span></div></td> <td ><div align="center"><span > <?php if ($descuentoA > 1) { ?> <?php if ($mostrar == TRUE) { ?> <a href="javascript:nueva('<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /INGRESOS%20HLC/caja/ventanaAplicaPagoInternos.php?usuario=<?php echo $_GET['usuario']; ?> &numeroE=<?php echo $numeroE; ?> &almacen=<?php echo $_GET['almacenSolicitante']; ?> &almacenFuente=<?php echo $almacen; ?> &seguro=<?php echo $seguroT; ?> &nCuenta=<?php echo $keyClientesInternos; ?> &tipoCliente=<?php echo 'particular'; ?> &tipoVenta=<?php echo $folioVENTA; ?> &folioVenta=<?php echo $myrow3['folioVenta']; ?> &keyClientesInternos=<?php echo $keyClientesInternos; ?> &rand=<?php echo rand(1000, 10000000); ?> &paquete=<?php echo $_GET['paquete']; ?> &transaccion=<?php echo $descuentoAseguradora; ?> &precioVenta=<?php echo $descuentoA; ?> &modoPago=descuentos&tipoPago=descuentos&descuento=aseguradora&descripcionTransaccion=<?php echo $descripcionTransaccion; ?> &status=<?php echo $myrow3['status']; ?> ','ventana7','480','380','yes');"> <?php echo '<span class="precio1"><blink>$' . number_format($descuentoA, 2) . '</blink></span>'; ?> </a> <?php } else { echo '$' . number_format($descuentoA, 2); } ?> <?php } else { ?> <img src="<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /imagenes/btns/checkbtn.png" width="18" height="18" /> <?php } ?> </span></div></td> <?php //*******************BENEFICENCIA if ($ben != NULL and $ben < 0) { $mp = 'devolucionBeneficencia'; $ben = $ben * -1; $tpb = 'devolucionBeneficencia'; } else { $mp = 'Beneficencia'; $tpb = 'Beneficencia'; } ?> <td ><div align="center"><span > <?php if ($ben != NULL) { ?> <?php if ($mostrar == TRUE) { ?> <a href="javascript:nueva('<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /INGRESOS%20HLC/caja/ventanaAplicaPagoInternos.php?usuario=<?php echo $_GET['usuario']; ?> &numeroE=<?php echo $numeroE; ?> &almacen=<?php echo $_GET['almacenSolicitante']; ?> &almacenFuente=<?php echo $almacen; ?> &seguro=<?php echo $seguroT; ?> &nCuenta=<?php echo $keyClientesInternos; ?> &tipoCliente=<?php echo 'particular'; ?> &tipoVenta=<?php echo $folioVENTA; ?> &folioVenta=<?php echo $myrow3['folioVenta']; ?> &keyClientesInternos=<?php echo $keyClientesInternos; ?> &rand=<?php echo rand(1000, 10000000); ?> &paquete=<?php echo $_GET['paquete']; ?> &transaccion=<?php echo $transB; ?> &precioVenta=<?php echo $ben; ?> &modoPago=<?php echo $mp; ?> &tipoPago=<?php echo $tpb; ?> &descripcionTransaccion=beneficencia&status=<?php echo $myrow3['status']; ?> &beneficencia=si&statusBeneficencia=si','ventana7','480','380','yes');"> <?php echo '$' . number_format($ben, 2); ?> </a> <?php } else { echo '$' . number_format($ben, 2); } ?> <?php } else { ?> <img src="<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /imagenes/btns/checkbtn.png" width="18" height="18" /> <?php } ?> </span></div></td> </tr> </table> <p> </p> <?php //CIERRA MOSTRAR EFECTUAR TRANSACCIONES } else { echo '<br>'; echo '<span class="codigos">ERROR: <blink>' . 'Imposible hacer movimientos en esta cuenta, ya supero su limite de credito!' . '</blink>' . ' tienes cargos por: ' . '$' . number_format($saldos->verificarSaldos($myrow3['seguro'], $entidad, $fecha1, $basedatos, $myrow3['numeroE'], $matricula), 2) . '!!' . '</span>'; } } else { //no tiene limites ?> <?php //MOSTRAR EFECTUAR TRANSACCIONES $descripcionTransaccion = $_GET['descripcionTransaccion']; //******ULTIMO TIRON************** if ($_GET['descripcionTransaccion'] == 'altaPacientes') { $sSQL3 = "Select * From clientesInternos WHERE keyClientesInternos = '" . $_GET['nT'] . "' "; $result3 = mysql_db_query($basedatos, $sSQL3); $myrow3 = mysql_fetch_array($result3); } else { $sSQL3 = "Select * From clientesInternos WHERE keyClientesInternos = '" . $_GET['nCuenta'] . "' "; $result3 = mysql_db_query($basedatos, $sSQL3); $myrow3 = mysql_fetch_array($result3); } //*********************************** ?> <p> </p> <a name="final"> </a> <table width="590" border="0" align="center" cellpadding="4" cellspacing="0" class="table table-striped" style="border: 1px solid #CCC;"> <tr> <th colspan="2" ><b >Particular</b></th> <th width="75" > </th> <th colspan="2" ><b >Beneficencia</b></th> <th width="75" > </th> <th colspan="2" ><b >Aseguradora</b></th> </tr> <tr> <td width="137" ><span >Cargos</span></td> <td width="75"><span > <?php $sSQLpartc = "Select sum(cantidadParticular*cantidad) as totalParticular, sum(ivaParticular*cantidad) as totalIVA From cargosCuentaPaciente WHERE entidad='" . $entidad . "' and folioVenta = '" . $_GET['folioVenta'] . "' \r\nand\r\nnaturaleza='C'\r\nand\r\ngpoProducto!=''\r\n "; $resultpartc = mysql_db_query($basedatos, $sSQLpartc); $myrowpartc = mysql_fetch_array($resultpartc); $sSQLparta = "Select sum(cantidadParticular*cantidad) as totalParticular, sum(ivaParticular*cantidad) as totalIVA From cargosCuentaPaciente WHERE entidad='" . $entidad . "' and folioVenta = '" . $_GET['folioVenta'] . "' \r\nand\r\nnaturaleza='A'\r\nand\r\ngpoProducto!=''\r\n "; $resultparta = mysql_db_query($basedatos, $sSQLparta); $myrowparta = mysql_fetch_array($resultparta); echo '$' . number_format($myrowpartc['totalParticular'] - $myrowparta['totalParticular'], 2); ?> </span></td> <td> </td> <td width="137" ><span >Cargos</span></td> <td width="75"><span > <?php $sSQLbenec = "Select sum(cantidadBeneficencia*cantidad) as totalParticular, sum(ivaBeneficencia*cantidad) as totalIVA From cargosCuentaPaciente WHERE entidad='" . $entidad . "' and folioVenta = '" . $_GET['folioVenta'] . "' \r\nand\r\nnaturaleza='C'\r\nand\r\ngpoProducto!=''\r\n "; $resultbenec = mysql_db_query($basedatos, $sSQLbenec); $myrowbenec = mysql_fetch_array($resultbenec); $sSQLbenea = "Select sum(cantidadBeneficencia*cantidad) as totalParticular, sum(ivaBeneficencia*cantidad) as totalIVA From cargosCuentaPaciente WHERE entidad='" . $entidad . "' and folioVenta = '" . $_GET['folioVenta'] . "' \r\nand\r\nnaturaleza='A'\r\nand\r\ngpoProducto!=''\r\n "; $resultbenea = mysql_db_query($basedatos, $sSQLbenea); $myrowbenea = mysql_fetch_array($resultbenea); echo '$' . number_format($myrowbenec['totalParticular'] - $myrowbenea['totalParticular'], 2); ?> </span></td> <td> </td> <td width="116"><span >Cargos</span></td> <td width="153"><span > <?php $sSQLasegc = "Select sum(cantidadAseguradora*cantidad) as totalAseguradora, sum(ivaAseguradora*cantidad) as totalIVA From cargosCuentaPaciente WHERE entidad='" . $entidad . "' and folioVenta = '" . $_GET['folioVenta'] . "' \r\nand\r\nnaturaleza='C'\r\nand\r\ngpoProducto!=''\r\n "; $resultasegc = mysql_db_query($basedatos, $sSQLasegc); $myrowasegc = mysql_fetch_array($resultasegc); $sSQLasega = "Select sum(cantidadAseguradora*cantidad) as totalAseguradora, sum(ivaAseguradora*cantidad) as totalIVA \r\n From cargosCuentaPaciente WHERE entidad='" . $entidad . "' and folioVenta = '" . $_GET['folioVenta'] . "' \r\nand\r\nnaturaleza='A'\r\nand\r\ngpoProducto!=''\r\n "; $resultasega = mysql_db_query($basedatos, $sSQLasega); $myrowasega = mysql_fetch_array($resultasega); echo '$' . number_format($myrowasegc['totalAseguradora'] - $myrowasega['totalAseguradora'], 2); ?> </span></td> </tr> <tr> <td><span >IVA</span></td> <td><span ><?php echo '$' . number_format($myrowpartc['totalIVA'] - $myrowparta['totalIVA'], 2); ?> </span></td> <td> </td> <td><span >IVA</span></td> <td><span ><?php echo '$' . number_format($myrowbenec['totalIVA'] - $myrowbenea['totalIVA'], 2); ?> </span></td> <td> </td> <td><span >IVA</span></td> <td><span ><?php echo '$' . number_format($myrowasegc['totalIVA'] - $myrowasega['totalIVA'], 2); ?> </span></td> </tr> <tr> <td><span >Total</span></td> <td><span ><?php echo '$' . number_format($myrowpartc['totalParticular'] + $myrowpartc['totalIVA'] - ($myrowparta['totalParticular'] + $myrowparta['totalIVA']), 2); ?> </span></td> <td> </td> <td><span >Total</span></td> <td><span ><?php echo '$' . number_format($myrowbenec['totalParticular'] + $myrowbenec['totalIVA'] - ($myrowbenea['totalParticular'] + $myrowbenea['totalIVA']), 2); ?> </span></td> <td> </td> <td><span >Total</span></td> <td><span ><?php echo '$' . number_format($myrowasegc['totalAseguradora'] + $myrowasegc['totalIVA'] - ($myrowasega['totalAseguradora'] + $myrowasega['totalIVA']), 2); ?> </span></td> </tr> </table> <p> </p> <table width="900" class="table table-striped" style="border: 1px solid #CCC;"> <tr > <th width="76" ><div align="center">Part</div></th> <th width="76" ><div align="center">Aseg</div></th> <th width="111" ><div align="center">Regreso Aseg</div></th> <th width="104" ><div align="center">Regreso Part </div></th> <th width="89" ><div align="center">C1</div></th> <th width="100" ><div align="center">C2</div></th> <th width="95" ><div align="center">D1</div></th> <th width="88" ><div align="center">D2</div></th> <th width="77" ><div align="center">Desc Part </div></th> <th width="84" ><div align="center">Desc Aseg </div></th> <th width="84" ><div align="center">Beneficencia</div></th> </tr> <tr > <td height="48" ><div align="center"><span > <?php //************************PARTICULARES********************************************************************** //CARGOS PARTICULARES REFERENCIAS /* if($myrow['naturaleza']=='C' and $myrow['statusRegreso']!='si'){ $cargoParticular[0]+=($myrow['cantidadParticular']*$myrow['cantidad'])+($myrow['ivaParticular']*$myrow['cantidad']); } //ABONOS if($myrow['naturaleza']=='A' and $myrow['gpoProducto']==''){ $abonoParticular[0]+=($myrow['cantidadParticular']*$myrow['cantidad'])+($myrow['ivaParticular']*$myrow['cantidad']); } //DEVOLUCIONES if($myrow['naturaleza']=='A' and $myrow['statusDevolucion']=='si'){ $devolucionParticular[0]+=($myrow['cantidadParticular']*$myrow['cantidad'])+($myrow['ivaParticular']*$myrow['cantidad']); } //REGRESO DE EFECTIVO if($myrow['naturaleza']=='C' and $myrow['statusRegreso']=='si'){ $regresoParticular[0]+=($myrow['cantidadParticular']*$myrow['cantidad'])+($myrow['ivaParticular']*$myrow['cantidad']); } */ //****************************************************************************************** /* //*************CARGOS************* $sPc="SELECT sum((cantidadParticular*cantidad) +(ivaParticular*cantidad) as cargoParticular FROM cargosCuentaPaciente WHERE entidad='".$entidad."' and folioVenta='".$_GET['folioVenta']."' and gpoProducto!='' and naturaleza='C' "; $rPc=mysql_db_query($basedatos,$sPc); $mPc = mysql_fetch_array($rPc); //************************************** //****************ABONOS************ $sPa="SELECT sum((cantidadParticular*cantidad) +(ivaParticular*cantidad) as abonoParticular FROM cargosCuentaPaciente WHERE entidad='".$entidad."' and folioVenta='".$_GET['folioVenta']."' and gpoProducto='' and naturaleza='A' "; $rPa=mysql_db_query($basedatos,$sPa); $mPa = mysql_fetch_array($rPa); //************************************* //*******************DEVOLUCIONES************** $sPd="SELECT sum((cantidadParticular*cantidad) +(ivaParticular*cantidad) as devolucionParticular FROM cargosCuentaPaciente WHERE entidad='".$entidad."' and folioVenta='".$_GET['folioVenta']."' and gpoProducto!='' and naturaleza='A' and statusDevolucion='si' "; $rPd=mysql_db_query($basedatos,$sPd); $mPd = mysql_fetch_array($rPd); //************************************************************* //*****************REGRESO********************* $sPr="SELECT sum((cantidadParticular*cantidad) +(ivaParticular*cantidad) as regresoParticular FROM cargosCuentaPaciente WHERE entidad='".$entidad."' and folioVenta='".$_GET['folioVenta']."' and gpoProducto!='' and naturaleza='C' and statusRegreso='si' "; $rPr=mysql_db_query($basedatos,$sPr); $mPr = mysql_fetch_array($rPr); //************************************************** //*****************REGRESO********************* $sPdes="SELECT sum((cantidadParticular*cantidad) +(ivaParticular*cantidad) as descuentoParticular FROM cargosCuentaPaciente WHERE entidad='".$entidad."' and folioVenta='".$_GET['folioVenta']."' and gpoProducto!='' and naturaleza='A' and statusDescuento='si' "; $rPdes=mysql_db_query($basedatos,$sPdes); $mPdes = mysql_fetch_array($rPdes); //************************************************** $totalParticular= $mPc['cargoParticular']-$mPa['abonoParticular']-$mPd['devolucionParticular']-$mPr['regresoParticular']-$mPdes['descuentoParticular']; //*********************************************** ****************************************************************************** */ if ($totalParticular >= 1 || ($myrow3['statusDevolucion'] == 'si' and $descuentoP < 1 and $descuentoA < 1)) { if ($myrow3['statusCortesia'] == 'si') { $tipoPago = 'Cortesia'; } else { if ($myrow3['tipoPaciente'] == 'externo' or ($myrow3['tipoPaciente'] == 'interno' or $myrow3['tipoPaciente'] == 'urgencias') and $myrow3['statusDevolucion'] == 'si') { if ($devolucionParticular[0] > 0 and $myrow3['statusDevolucion'] == 'si') { $tipoDevolucion = ''; $tipoPago = ''; if ($totalParticular < 0) { $totalParticular *= -1; } } else { $s = "Select codigoTT From catTTCaja WHERE pagoEfectivo='si'"; $rs = mysql_db_query($basedatos, $s); $my = mysql_fetch_array($rs); $tipoPago = 'Efectivo'; } } elseif ($myrow3['activaBeneficencia'] == 'si') { $s = "Select codigoTT From catTTCaja WHERE trasladoBeneficencia='si'"; $rs = mysql_db_query($basedatos, $s); $my = mysql_fetch_array($rs); $tipoPago = 'Beneficencia'; $caso = 1; } else { $s = "Select codigoTT From catTTCaja WHERE gastosParticulares='si'"; $rs = mysql_db_query($basedatos, $s); $my = mysql_fetch_array($rs); $tipoPago = 'Efectivo'; } } ?> <?php if ($mostrar == TRUE) { ?> <?php if ($totalParticular > 0 and $totalParticular > -1) { ?> <a href="javascript:nueva('<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /INGRESOS%20HLC/caja/ventanaAplicaPagoInternos.php?usuario=<?php echo $_GET['usuario']; ?> &numeroE=<?php echo $numeroE; ?> &almacen=<?php echo $_GET['almacenSolicitante']; ?> &almacenFuente=<?php echo $almacen; ?> &seguro=<?php echo $seguroT; ?> &nCuenta=<?php echo $keyClientesInternos; ?> &tipoCliente=<?php echo 'particular'; ?> &tipoVenta=<?php echo $folioVENTA; ?> &folioVenta=<?php echo $myrow3['folioVenta']; ?> &keyClientesInternos=<?php echo $keyClientesInternos; ?> &rand=<?php echo rand(1000, 10000000); ?> &paquete=<?php echo $_GET['paquete']; ?> &transaccion=particular&precioVenta=<?php echo $totalParticular; ?> &modoPago=<?php if ($_GET['devolucion'] == 'si') { echo 'devolucionParticular'; } else { echo 'efectivo'; } ?> &tipoTransaccion=particular&tipoPago=<?php echo $tipoPago; ?> &descripcionTransaccion=<?php echo $descripcionTransaccion; ?> &status=<?php echo $myrow3['status']; ?> &statusCortesia=<?php echo $myrow3['statusCortesia']; ?> &tipoDevolucion=<?php echo $tipoDevolucion; ?> &beneficencia=<?php if ($myrow3['activaBeneficencia'] == 'si') { echo 'si'; } ?> &statusBeneficencia=<?php if ($myrow3['activaBeneficencia'] == 'si') { echo 'si'; } ?> &activaBeneficencia=<?php if ($myrow3['activaBeneficencia'] == 'si') { echo 'si'; } ?> &caso=<?php echo $caso; ?> ','ventana7','680','380','yes');"> <?php echo '$' . number_format($totalParticular, 2); ?> </a> <?php } else { echo '<img src="' . CONSTANT_PATH_SIMA_RAIZ . '/imagenes/btns/checkbtn.png" width="18" height="18" />'; } ?> <?php } else { echo '$' . number_format($totalParticular, 2); } ?> <?php } else { ?> <img src="<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /imagenes/btns/checkbtn.png" width="18" height="18" /> <?php } ?> </span></div></td> <td ><div align="center"><span > <?php //********************************cANTIDAD ASEGURADORA**************************************** //*********************REFERENCIA*****************/ /* //CARGOS ASEGURADORA if($myrow['naturaleza']=='C' and $myrow['statusRegreso']!='si'){ $cargoAseguradora[0]+=($myrow['cantidadAseguradora']*$myrow['cantidad'])+($myrow['ivaAseguradora']*$myrow['cantidad']); } //ABONOS if($myrow['naturaleza']=='A' and $myrow['gpoProducto']==''){ $abonoAseguradora[0]+=($myrow['cantidadAseguradora']*$myrow['cantidad'])+($myrow['ivaAseguradora']*$myrow['cantidad']); } //DEVOLUCIONES if($myrow['naturaleza']=='A' and $myrow['statusDevolucion']=='si'){ $devolucionAseguradora[0]+=($myrow['cantidadAseguradora']*$myrow['cantidad'])+($myrow['ivaAseguradora']*$myrow['cantidad']); } //REGRESO DE TRASLADO if($myrow['naturaleza']=='C' and $myrow['statusRegreso']=='si'){ $regresoAseguradora[0]+=($myrow['cantidadAseguradora']*$myrow['cantidad'])+($myrow['ivaAseguradora']*$myrow['cantidad']); } */ /* //*************CARGOS************* $sAc="SELECT sum((cantidadAseguradora*cantidad) +(ivaAseguradora*cantidad) as cargoAseguradora FROM cargosCuentaPaciente WHERE entidad='".$entidad."' and folioVenta='".$_GET['folioVenta']."' and gpoProducto!='' and naturaleza='C' "; $rAc=mysql_db_query($basedatos,$sAc); $mAc = mysql_fetch_array($rAc); //************************************** //****************ABONOS************ $sAa="SELECT sum((cantidadAseguradora*cantidad) +(ivaAseguradora*cantidad) as abonoAseguradora FROM cargosCuentaPaciente WHERE entidad='".$entidad."' and folioVenta='".$_GET['folioVenta']."' and gpoProducto='' and naturaleza='A' "; $rAa=mysql_db_query($basedatos,$sAa); $mAa = mysql_fetch_array($rAa); //************************************* //*******************DEVOLUCIONES************** $sAd="SELECT sum((cantidadAseguradora*cantidad) +(ivaAseguradora*cantidad) as devolucionAseguradora FROM cargosCuentaPaciente WHERE entidad='".$entidad."' and folioVenta='".$_GET['folioVenta']."' and gpoProducto!='' and naturaleza='A' and statusDevolucion='si' "; $rAd=mysql_db_query($basedatos,$sAd); $mAd = mysql_fetch_array($rAd); //************************************************************* //*****************REGRESO********************* $sAr="SELECT sum((cantidadAseguradora*cantidad) +(ivaAseguradora*cantidad) as regresoAseguradora FROM cargosCuentaPaciente WHERE entidad='".$entidad."' and folioVenta='".$_GET['folioVenta']."' and gpoProducto!='' and naturaleza='C' and statusRegreso='si' "; $rAr=mysql_db_query($basedatos,$sAr); $mAr = mysql_fetch_array($rAr); //************************************************** //*****************REGRESO********************* $sdes="SELECT sum((cantidadAseguradora*cantidad) +(ivaAseguradora*cantidad) as descuentoAseguradora FROM cargosCuentaPaciente WHERE entidad='".$entidad."' and folioVenta='".$_GET['folioVenta']."' and gpoProducto!='' and naturaleza='A' and statusDescuento='si' "; $rPdes=mysql_db_query($basedatos,$sPdes); $mPdes = mysql_fetch_array($rPdes); //************************************************** $totalParticular= $mPc['cargoParticular']-$mPa['abonoParticular']-$mPd['devolucionParticular']-$mPr['regresoParticular']-$mPdes['descuentoParticular']; //*********************************************** ****************************************************************************** */ //************************************************************************************************** if ($totalAseguradora >= 1 || $myrow3['statusDevolucion'] == 'si') { if ($devolucionAseguradora[0] > 0 and $myrow3['statusDevolucion'] == 'si') { $s = "Select codigoTT From catTTCaja WHERE devolucionAseguradora='si'"; $rs = mysql_db_query($basedatos, $s); $my = mysql_fetch_array($rs); if ($totalAseguradora < 0) { $totalAseguradora *= -1; } $tipoPago = ''; } else { $s = "Select codigoTT From catTTCaja WHERE trasladoAseguradora='si'"; $rs = mysql_db_query($basedatos, $s); $my = mysql_fetch_array($rs); $tipoPago = 'Cuentas por Cobrar'; } ?> <?php if ($totalCoaseguro1 < 1 and $totalCoaseguro2 < 1 and $totalDeducible1 < 1 and $totalDeducible2 < 1 and $descuentoP < 1 and $descuentoA < 1) { ?> <?php if ($mostrar == TRUE) { ?> <?php if ($totalAseguradora > -1 and $totalAseguradora > 0) { ?> <a href="javascript:nueva('<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /INGRESOS%20HLC/caja/ventanaAplicaPagoInternos.php?usuario=<?php echo $_GET['usuario']; ?> &numeroE=<?php echo $numeroE; ?> &almacen=<?php echo $_GET['almacenSolicitante']; ?> &almacenFuente=<?php echo $almacen; ?> &seguro=<?php echo $seguroT; ?> &nCuenta=<?php echo $keyClientesInternos; ?> &tipoCliente=<?php echo 'particular'; ?> &tipoVenta=<?php echo $folioVENTA; ?> &folioVenta=<?php echo $myrow3['folioVenta']; ?> &keyClientesInternos=<?php echo $keyClientesInternos; ?> &rand=<?php echo rand(1000, 10000000); ?> &paquete=<?php echo $_GET['paquete']; ?> &precioVenta=<?php echo $totalAseguradora; ?> &modoPago=<?php if ($_GET['devolucion'] == 'si') { echo 'devolucionAseguradora'; } else { echo 'cxc'; } ?> &transaccion=<?php echo $my['codigoTT']; ?> &tipoTransaccion=aseguradora&tipoPago=<?php echo $tipoPago; ?> &devolucion=<?php echo $_GET['devolucion']; ?> &descripcionTransaccion=<?php echo $descripcionTransaccion; ?> &status=<?php echo $myrow3['status']; ?> ','ventana7','800','380','yes');"> <?php echo '$' . number_format($totalAseguradora, 2); ?> </a> <?php } else { echo '<img src="' . CONSTANT_PATH_SIMA_RAIZ . '/imagenes/btns/checkbtn.png" width="18" height="18" />'; } ?> <?php } else { echo '$' . number_format($totalAseguradora, 2); } ?> <?php } else { ?> <?php echo '$' . number_format($totalAseguradora, 2); ?> <?php } ?> <?php } else { ?> <img src="<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /imagenes/btns/checkbtn.png" width="18" height="18" /> <?php } ?> </span></div></td> <td > <div align="center"><span > <?php if ($totalAseguradora < -1 and $devolucionAseguradora[0] < 1) { $tA = $totalAseguradora * -1; ?> <?php if ($mostrar == TRUE) { ?> <a href="javascript:nueva('<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /INGRESOS%20HLC/caja/ventanaAplicaPagoInternos.php?usuario=<?php echo $_GET['usuario']; ?> &numeroE=<?php echo $numeroE; ?> &almacen=<?php echo $_GET['almacenSolicitante']; ?> &almacenFuente=<?php echo $almacen; ?> &seguro=<?php echo $seguroT; ?> &nCuenta=<?php echo $keyClientesInternos; ?> &tipoCliente=<?php echo 'particular'; ?> &tipoVenta=<?php echo $folioVENTA; ?> &folioVenta=<?php echo $myrow3['folioVenta']; ?> &keyClientesInternos=<?php echo $keyClientesInternos; ?> &rand=<?php echo rand(1000, 10000000); ?> &paquete=<?php echo $_GET['paquete']; ?> &transaccion=regreso&precioVenta=<?php echo $tA; ?> &modoPago=regresoAseguradora&tipoTransaccion=particular&tipoPago=regresoAseguradora&descripcionTransaccion=<?php echo $descripcionTransaccion; ?> &status=<?php echo $myrow3['status']; ?> ','ventana7','400','800','yes');"> </a></span></div> <span ><a href="javascript:nueva('<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /INGRESOS%20HLC/caja/ventanaAplicaPagoInternos.php?usuario=<?php echo $_GET['usuario']; ?> &numeroE=<?php echo $numeroE; ?> &almacen=<?php echo $_GET['almacenSolicitante']; ?> &almacenFuente=<?php echo $almacen; ?> &seguro=<?php echo $seguroT; ?> &nCuenta=<?php echo $keyClientesInternos; ?> &tipoCliente=<?php echo 'particular'; ?> &tipoVenta=<?php echo $folioVENTA; ?> &folioVenta=<?php echo $myrow3['folioVenta']; ?> &keyClientesInternos=<?php echo $keyClientesInternos; ?> &rand=<?php echo rand(1000, 10000000); ?> &paquete=<?php echo $_GET['paquete']; ?> &transaccion=regreso&precioVenta=<?php echo $tA; ?> &modoPago=regresoAseguradora&tipoTransaccion=particular&tipoPago=regresoAseguradora&descripcionTransaccion=<?php echo $descripcionTransaccion; ?> &status=<?php echo $myrow3['status']; ?> ','ventana7','400','800','yes');"><blink> <div align="center"><?php echo '$' . number_format($tA, 2); ?> </div> </blink></a> <div align="center"> <?php } else { echo '$' . number_format($tA, 2); } ?> <?php } else { ?> <img src="<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /imagenes/btns/checkbtn.png" width="18" height="18" /> <?php } ?> </div> </span> </td> <td ><div align="center"><span > <?php if ($totalParticular < -1) { $tP = $totalParticular * -1; ?> <?php if ($mostrar == TRUE) { ?> <a href="javascript:nueva('<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /INGRESOS%20HLC/caja/ventanaAplicaPagoInternos.php?usuario=<?php echo $_GET['usuario']; ?> &numeroE=<?php echo $numeroE; ?> &almacen=<?php echo $_GET['almacenSolicitante']; ?> &almacenFuente=<?php echo $almacen; ?> &seguro=<?php echo $seguroT; ?> &nCuenta=<?php echo $keyClientesInternos; ?> &tipoCliente=<?php echo 'particular'; ?> &tipoVenta=<?php echo $folioVENTA; ?> &folioVenta=<?php echo $myrow3['folioVenta']; ?> &keyClientesInternos=<?php echo $keyClientesInternos; ?> &rand=<?php echo rand(1000, 10000000); ?> &paquete=<?php echo $_GET['paquete']; ?> &transaccion=regreso&precioVenta=<?php echo $tP; ?> &modoPago=regresoParticular&tipoTransaccion=particular&tipoPago=regresoParticular&descripcionTransaccion=<?php echo $descripcionTransaccion; ?> &status=<?php echo $myrow3['status']; ?> ','ventana7','400','800','yes');"></a></span></div> <span > <a href="javascript:nueva('<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /INGRESOS%20HLC/caja/ventanaAplicaPagoInternos.php?usuario=<?php echo $_GET['usuario']; ?> &numeroE=<?php echo $numeroE; ?> &almacen=<?php echo $_GET['almacenSolicitante']; ?> &almacenFuente=<?php echo $almacen; ?> &seguro=<?php echo $seguroT; ?> &nCuenta=<?php echo $keyClientesInternos; ?> &tipoCliente=<?php echo 'particular'; ?> &tipoVenta=<?php echo $folioVENTA; ?> &folioVenta=<?php echo $myrow3['folioVenta']; ?> &keyClientesInternos=<?php echo $keyClientesInternos; ?> &rand=<?php echo rand(1000, 10000000); ?> &paquete=<?php echo $_GET['paquete']; ?> &transaccion=regreso&precioVenta=<?php echo $tP; ?> &modoPago=regresoParticular&tipoTransaccion=particular&tipoPago=regresoParticular&descripcionTransaccion=<?php echo $descripcionTransaccion; ?> &status=<?php echo $myrow3['status']; ?> ','ventana7','400','800','yes');"><blink> <div align="center"> <?php echo '$' . number_format($tP, 2); ?> </div> </blink></a> <div align="center"> <?php } else { echo '$' . number_format($tP, 2); } ?> <?php } else { ?> <img src="<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /imagenes/btns/checkbtn.png" width="18" height="18" /> <?php } ?> </div> </span></td> <td ><div align="center"><span > <?php if ($totalCoaseguro1 >= 1) { ?> <?php if ($mostrar == TRUE) { ?> <a href="javascript:nueva('<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /INGRESOS%20HLC/caja/ventanaAplicaPagoInternos.php?usuario=<?php echo $_GET['usuario']; ?> &numeroE=<?php echo $numeroE; ?> &almacen=<?php echo $_GET['almacenSolicitante']; ?> &almacenFuente=<?php echo $almacen; ?> &seguro=<?php echo $seguroT; ?> &nCuenta=<?php echo $keyClientesInternos; ?> &tipoCliente=<?php echo 'particular'; ?> &tipoVenta=<?php echo $folioVENTA; ?> &folioVenta=<?php echo $myrow3['folioVenta']; ?> &keyClientesInternos=<?php echo $keyClientesInternos; ?> &rand=<?php echo rand(1000, 10000000); ?> &paquete=<?php echo $_GET['paquete']; ?> &transaccion=<?php echo $coaseguro1; ?> &precioVenta=<?php echo $totalCoaseguro1; ?> &modoPago=efectivo&tipoTransaccion=coaseguro&numCoaseguro=PCoaS1&tipoPago=Efectivo&descripcionTransaccion=<?php echo $descripcionTransaccion; ?> &status=<?php echo $myrow3['status']; ?> ','ventana7','480','380','yes');"> <?php echo '$' . number_format($totalCoaseguro1, 2); ?> </a> <?php } else { echo '$' . number_format($totalCoaseguro1, 2); } ?> <?php } else { ?> <img src="<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /imagenes/btns/checkbtn.png" width="18" height="18" /> <?php } ?> </span></div></td> <td ><div align="center"><span > <?php if ($totalCoaseguro2 >= 1) { ?> <?php if ($mostrar == TRUE) { ?> <a href="javascript:nueva('<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /INGRESOS%20HLC/caja/ventanaAplicaPagoInternos.php?usuario=<?php echo $_GET['usuario']; ?> &numeroE=<?php echo $numeroE; ?> &almacen=<?php echo $_GET['almacenSolicitante']; ?> &almacenFuente=<?php echo $almacen; ?> &seguro=<?php echo $seguroT; ?> &nCuenta=<?php echo $keyClientesInternos; ?> &tipoCliente=<?php echo 'particular'; ?> &tipoVenta=<?php echo $folioVENTA; ?> &folioVenta=<?php echo $myrow3['folioVenta']; ?> &keyClientesInternos=<?php echo $keyClientesInternos; ?> &rand=<?php echo rand(1000, 10000000); ?> &paquete=<?php echo $_GET['paquete']; ?> &transaccion=<?php echo $coaseguro2; ?> &precioVenta=<?php echo $totalCoaseguro2; ?> &modoPago=efectivo&tipoTransaccion=coaseguro&numCoaseguro=PCoaS2&tipoPago=Efectivo&descripcionTransaccion=<?php echo $descripcionTransaccion; ?> &status=<?php echo $myrow3['status']; ?> ','ventana7','480','380','yes');"> <?php echo '$' . number_format($totalCoaseguro2, 2); ?> </a> <?php } else { echo '$' . number_format($totalCoaseguro2, 2); } ?> <?php } else { ?> <img src="<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /imagenes/btns/checkbtn.png" width="18" height="18" /> <?php } ?> </span></div></td> <td ><div align="center"><span > <?php if ($totalDeducible1 >= 1) { ?> <?php if ($mostrar == TRUE) { ?> <a href="javascript:nueva('<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /INGRESOS%20HLC/caja/ventanaAplicaPagoInternos.php?usuario=<?php echo $_GET['usuario']; ?> &numeroE=<?php echo $numeroE; ?> &almacen=<?php echo $_GET['almacenSolicitante']; ?> &almacenFuente=<?php echo $almacen; ?> &seguro=<?php echo $seguroT; ?> &nCuenta=<?php echo $keyClientesInternos; ?> &tipoCliente=<?php echo 'particular'; ?> &tipoVenta=<?php echo $folioVENTA; ?> &folioVenta=<?php echo $myrow3['folioVenta']; ?> &keyClientesInternos=<?php echo $keyClientesInternos; ?> &rand=<?php echo rand(1000, 10000000); ?> &paquete=<?php echo $_GET['paquete']; ?> &transaccion=<?php echo $deducible1; ?> &precioVenta=<?php echo $totalDeducible1; ?> &modoPago=efectivo&tipoTransaccion=coaseguro&numCoaseguro=PDeduSeg1&tipoPago=Efectivo&descripcionTransaccion=<?php echo $descripcionTransaccion; ?> &status=<?php echo $myrow3['status']; ?> ','ventana7','480','380','yes');"> <?php echo '$' . number_format($totalDeducible1, 2); ?> </a> <?php } else { echo '$' . number_format($totalDeducible1, 2); } ?> <?php } else { ?> <img src="<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /imagenes/btns/checkbtn.png" width="18" height="18" /> <?php } ?> </span></div></td> <td ><div align="center"><span > <?php if ($totalDeducible2 >= 1) { ?> <?php if ($mostrar == TRUE) { ?> <a href="javascript:nueva('<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /INGRESOS%20HLC/caja/ventanaAplicaPagoInternos.php?usuario=<?php echo $_GET['usuario']; ?> &numeroE=<?php echo $numeroE; ?> &almacen=<?php echo $_GET['almacenSolicitante']; ?> &almacenFuente=<?php echo $almacen; ?> &seguro=<?php echo $seguroT; ?> &nCuenta=<?php echo $keyClientesInternos; ?> &tipoCliente=<?php echo 'particular'; ?> &tipoVenta=<?php echo $folioVENTA; ?> &folioVenta=<?php echo $myrow3['folioVenta']; ?> &keyClientesInternos=<?php echo $keyClientesInternos; ?> &rand=<?php echo rand(1000, 10000000); ?> &paquete=<?php echo $_GET['paquete']; ?> &transaccion=<?php echo $deducible2; ?> &precioVenta=<?php echo $totalDeducible2; ?> &modoPago=efectivo&tipoTransaccion=coaseguro&numCoaseguro=PDeduSeg2&tipoPago=Efectivo&descripcionTransaccion=<?php echo $descripcionTransaccion; ?> &status=<?php echo $myrow3['status']; ?> ','ventana7','480','380','yes');"> <?php echo '$' . number_format($totalDeducible2, 2); ?> </a> <?php } else { echo '$' . number_format($totalDeducible2, 2); } ?> <?php } else { ?> <img src="<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /imagenes/btns/checkbtn.png" width="18" height="18" /> <?php } ?> </span></div></td> <td > <div align="center"> <span > <?php if ($descuentoP >= 1) { ?> <?php if ($mostrar == TRUE) { ?> <a href="javascript:nueva('<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /INGRESOS%20HLC/caja/ventanaAplicaPagoInternos.php?usuario=<?php echo $_GET['usuario']; ?> &numeroE=<?php echo $numeroE; ?> &almacen=<?php echo $_GET['almacenSolicitante']; ?> &almacenFuente=<?php echo $almacen; ?> &seguro=<?php echo $seguroT; ?> &nCuenta=<?php echo $keyClientesInternos; ?> &tipoCliente=<?php echo 'particular'; ?> &tipoVenta=<?php echo $folioVENTA; ?> &folioVenta=<?php echo $myrow3['folioVenta']; ?> &keyClientesInternos=<?php echo $keyClientesInternos; ?> &rand=<?php echo rand(1000, 10000000); ?> &paquete=<?php echo $_GET['paquete']; ?> &transaccion=<?php echo $descuentoParticular; ?> &precioVenta=<?php echo $descuentoP; ?> &modoPago=descuentos&tipoPago=descuentos&descuento=particular&descripcionTransaccion=<?php echo $descripcionTransaccion; ?> &status=<?php echo $myrow3['status']; ?> ','ventana7','480','380','yes');"> <?php echo '<span class="precio1"><blink>$' . number_format($descuentoP, 2) . '</blink></span>'; ?> </a> <?php } else { echo '$' . number_format($descuentoP, 2); } ?> <?php } else { ?> <img src="<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /imagenes/btns/checkbtn.png" width="18" height="18" /> <?php } ?> </span></div></td> <td ><div align="center"><span > <?php if ($descuentoA >= 1) { ?> <?php if ($mostrar == TRUE) { ?> <a href="javascript:nueva('<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /INGRESOS%20HLC/caja/ventanaAplicaPagoInternos.php?usuario=<?php echo $_GET['usuario']; ?> &numeroE=<?php echo $numeroE; ?> &almacen=<?php echo $_GET['almacenSolicitante']; ?> &almacenFuente=<?php echo $almacen; ?> &seguro=<?php echo $seguroT; ?> &nCuenta=<?php echo $keyClientesInternos; ?> &tipoCliente=<?php echo 'particular'; ?> &tipoVenta=<?php echo $folioVENTA; ?> &folioVenta=<?php echo $myrow3['folioVenta']; ?> &keyClientesInternos=<?php echo $keyClientesInternos; ?> &rand=<?php echo rand(1000, 10000000); ?> &paquete=<?php echo $_GET['paquete']; ?> &transaccion=<?php echo $descuentoAseguradora; ?> &precioVenta=<?php echo $descuentoA; ?> &modoPago=descuentos&tipoPago=descuentos&descuento=aseguradora&descripcionTransaccion=<?php echo $descripcionTransaccion; ?> &status=<?php echo $myrow3['status']; ?> ','ventana7','480','380','yes');"> <?php echo '<span class="precio1"><blink>$' . number_format($descuentoA, 2) . '</blink></span>'; ?> </a> <?php } else { echo '$' . number_format($descuentoA, 2); } ?> <?php } else { ?> <img src="<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /imagenes/btns/checkbtn.png" width="18" height="18" /> <?php } ?> </span></div></td> <?php //*******************BENEFICENCIA if ($ben != NULL and $ben < 0) { $mp = 'devolucionBeneficencia'; $ben = $ben * -1; $tpb = 'devolucionBeneficencia'; } else { $mp = 'Beneficencia'; $tpb = 'Beneficencia'; } ?> <td ><div align="center"><span > <?php if ($ben != NULL) { ?> <?php if ($mostrar == TRUE) { ?> <a href="javascript:nueva('<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /INGRESOS%20HLC/caja/ventanaAplicaPagoInternos.php?usuario=<?php echo $_GET['usuario']; ?> &numeroE=<?php echo $numeroE; ?> &almacen=<?php echo $_GET['almacenSolicitante']; ?> &almacenFuente=<?php echo $almacen; ?> &seguro=<?php echo $seguroT; ?> &nCuenta=<?php echo $keyClientesInternos; ?> &tipoCliente=<?php echo 'particular'; ?> &tipoVenta=<?php echo $folioVENTA; ?> &folioVenta=<?php echo $myrow3['folioVenta']; ?> &keyClientesInternos=<?php echo $keyClientesInternos; ?> &rand=<?php echo rand(1000, 10000000); ?> &paquete=<?php echo $_GET['paquete']; ?> &transaccion=<?php echo $transB; ?> &precioVenta=<?php echo $ben; ?> &modoPago=<?php echo $mp; ?> &tipoPago=<?php echo $tpb; ?> &descripcionTransaccion=beneficencia&status=<?php echo $myrow3['status']; ?> &beneficencia=si&statusBeneficencia=si','ventana7','480','380','yes');"> <?php echo '$' . number_format($ben, 2); ?> </a> <?php } else { echo '$' . number_format($ben, 2); } ?> <?php } else { ?> <img src="<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /imagenes/btns/checkbtn.png" width="18" height="18" /> <?php } ?> </span></div></td> </tr> </table> <p> </p> <?php //CIERRA MOSTRAR EFECTUAR TRANSACCIONES } ?> <p align="center"> </p> <p align="center"> <form method="post" > <div align="center"> <?php //********************************* $TOTAL = (double) $TOTAL; if ($tipoPACIENTE == 'externo') { $diferencia = (double) ($totalParticular - $totalAseguradora); if ($ben < 1 and (!$diferencia and ($totalParticular < 1 or $totalAseguradora < 1))) { ?> <input type="hidden" name="keyT" id="keyT" value="<?php echo $myrow1['keyT']; ?> " /> <input name="imprimir" type="submit" id="imprimir" value="Finalizar Transaccion" src="../imagenes/btns/new_print.png" onClick="Disab (2)"/> <?php } ?> </p> <?php } else { ?> <?php if ($TOTAL > -1 && $TOTAL < 1 && ($descuentoP < 1 and $descuentoA < 1)) { ?> <input name="cerrar" type="submit" class="normal" id="cerrar" value="Cerrar Cuenta" onClick="if(confirm('¿Estás seguro que deseas cerrar la cuenta?') == false){return false;}" /> <?php } ?> <?php } ?> <input type="hidden" name="totalCargo" value="<?php echo $totalCargo; ?> " /> <input type="hidden" name="totalAbono" value="<?php echo $totalAbono; ?> " /> <input type="hidden" name="variable_php" id="variable_php" /> </div> </form> <script languaje="JavaScript"> document.form1.folioVenta.value=<?php echo $_GET['folioVenta']; ?> document.form1.keyClientesInternos.value=<?php echo $_GET['nT']; ?> document.form1.nT.value=<?php echo $_GET['nT']; ?> </script> <br> </body> </html> <?php } ?> <?php } else { //validacion del recibo de caja echo '<div class="error">ERROR! NO EXISTE LA RUTA DEL RECIBO DE CAJA!</div>'; echo '<script>'; echo 'window.alert("NO EXISTE LA RUTA DEL RECIBO!");'; echo '</script>'; } }
top:2em; left:2em; width:50px; padding:5px; background-color: #0080C0; color: #FFFFFF; } .style71 {font-size: 9px} .style71 {font-size: 9px} .style71 {font-size: 9px} .Estilo24 {font-size: 10px} </style> </head> <body> <?php ventanasPrototype::links(); ?> <form id="form2" name="form2" method="post" action=""> <h1 align="center"><strong>LISTADO DE MEDICOS </strong></h1> <p> <label> <div align="center"> </label> </form> <form id="form1" name="form1" method="post" action="modificaMedicos.php"> <table width="637" border="0" align="center"> <tr bgcolor="#FFFF00"> <th width="53" class="style12" scope="col"><div align="left"><span class="none">Código </span></div></th> <th class="style12" scope="col"><div align="left"><span class="none">Nombre del Médico:</span></div></th> <th class="style12" scope="col"><div align="left"><span class="none">Tipo Médico </span></div></th> <th class="style12" scope="col"><div align="left"><span class="none">Editar S. </span></div></th>
public function eCuentaE($folioVenta, $usuario, $entidad, $almacen, $fecha1, $hora1, $dia, $usu, $nT, $basedatos) { include CONSTANT_PATH_CONFIGURACION . "/funciones.php"; $cargosCia = new acumulados(); //**********************************CANDADO PRINCIPAL********************** $bali = $almacen; $sSQLC = "Select * From statusCaja where entidad='" . $entidad . "' and usuario='" . $usuario . "' order by keySTC DESC "; $resultC = mysql_db_query($basedatos, $sSQLC); $myrowC = mysql_fetch_array($resultC); $sSQL1 = "Select usuario,folioVenta From transacciones WHERE folioVenta ='" . $_GET['folioVenta'] . "' "; $result1 = mysql_db_query($basedatos, $sSQL1); $myrow1 = mysql_fetch_array($result1); echo mysql_error(); if ($myrow1['folioVenta'] and $myrow1['usuario'] != $usuario) { ?> <script> window.alert("Este proceso est� siendo utilizado por: (<?php echo $myrow1['usuario']; ?> ) y s�lo el puede terminar este proceso"); window.close(); </script> <?php } else { if (!$myrow1['folioVenta']) { $agrega = "INSERT INTO transacciones (\r\nfolioVenta,usuario,fecha,hora,keyCatC) \r\nvalues ('" . $_GET['folioVenta'] . "','" . $usuario . "','" . $fecha1 . "','" . $hora1 . "','" . $myrowC['keyCatC'] . "')"; mysql_db_query($basedatos, $agrega); echo mysql_error(); } } //************************************CANDADO DE USUARIO ?> <script language=javascript> function ventanaSecundaria2 (URL){ window.open(URL,"ventana2","width=630,height=500,scrollbars=YES,scrollbars=YES,resizable=YES, maximizable=YES") } </script> <script language=javascript> function ventanaSecundaria7 (URL){ window.open(URL,"ventana7","width=500,height=600,scrollbars=YES,resizable=YES, maximizable=YES") } </script> <script> var win = null; function nueva(mypage,myname,w,h,scroll){ LeftPosition = (screen.width) ? (screen.width-w)/2 : 0; TopPosition = (screen.height) ? (screen.height-h)/2 : 0; settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable' win = window.open(mypage,myname,settings) if(win.window.focus){win.window.focus();} } </script> <?php //************************ACTUALIZO ********************** //********************Llenado de datos $sSQL3 = "Select * From clientesInternos WHERE folioVenta = '" . $_GET['folioVenta'] . "' "; $result3 = mysql_db_query($basedatos, $sSQL3); $myrow3 = mysql_fetch_array($result3); $numeroE = $myrow3['numeroE']; $nCuenta = $myrow3['nCuenta']; $cuarto = $myrow3['cuarto']; $seguroT = ltrim($myrow3['seguro']); //***************aplicar pago********************** if ($_POST['actualizar']) { $particular = $_POST['particular']; $aseguradora = $_POST['aseguradora']; for ($i = 0; $i <= $_POST['bandera2']; $i++) { if ($aseguradora[$i]) { $status = 'efectivo'; $keyCAP[] = $aseguradora[$i]; } else { $status = 'cxc'; $keyCAP[] = $particular[$i]; } $agrega = "UPDATE cargosCuentaPaciente set \r\nstatusAlta='" . $status . "',\r\nusuarioAlta='" . $usuario . "',\r\nfechaAlta='" . $fecha1 . "',\r\nhoraAlta='" . $hora1 . "'\r\n\r\nwhere\r\nkeyCAP='" . $keyCAP[$i] . "' \r\n"; mysql_db_query($basedatos, $agrega); echo mysql_error(); } //cierra for } //cierra actualizar $cargosParticulares = new acumulados(); $totalxSurtir = new acumulados(); $cargosAseguradora = new acumulados(); $otros = new acumulados(); if ($_POST['imprimir']) { //*************SACO EL NUMERO DE MOVIMIENTO y lo actualizo************************* $actualiza3 = "UPDATE clientesInternos,cargosCuentaPaciente\r\nset\r\ncargosCuentaPaciente.codigoCaja='" . $myrowC['keyCatC'] . "',\r\ncargosCuentaPaciente.numRecibo='" . $myrowCa['numRecibo'] . "',\r\ncargosCuentaPaciente.numCorte='" . $myrowC['numCorte'] . "',\r\nclientesInternos.codigoCaja='" . $myrowC['keyCatC'] . "',\r\nclientesInternos.numRecibo='" . $RECIBO . "',\r\nclientesInternos.numCorte='" . $myrowC['numCorte'] . "',\r\ncargosCuentaPaciente.folioVenta='" . $_GET['folioVenta'] . "',\r\nclientesInternos.folioVenta='" . $_GET['folioVenta'] . "'\r\n\r\n\r\nWHERE \r\nclientesInternos.folioVenta='" . $_GET['folioVenta'] . "'\r\nand\r\nclientesInternos.folioVenta=cargosCuentaPaciente.folioVenta\r\n"; //mysql_db_query($basedatos,$actualiza3); echo mysql_error(); //************************************************************* if ($_GET['paquete'] == 'si') { ?> <script language="javascript"> nueva('<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /cargos/imprimirReciboPaquetes.php?numeroE=<?php echo $myrow3['numeroE']; ?> &nCuenta=<?php echo $myrow3['nCuenta']; ?> &keyClientesInternos=<?php echo $myrow3['keyClientesInternos']; ?> &paciente=<?php echo $_POST['paciente']; ?> &numeroConfirmacion=<?php echo $numeroConfirmacion; ?> &hora1=<?php echo $hora1; ?> &cajero=<?php echo $usuario; ?> &codigoPaquete=<?php echo $myrow3['codigoPaquete']; ?> &numRecibo=<?php echo $myrowC['numRecibo']; ?> &paciente=<?php echo $_POST['paciente']; ?> &cantidadRecibida=<?php echo $_POST['cantidadRecibida']; ?> &folioVenta=<?php echo $myrow3['folioVenta']; ?> ','ventana7','800','600','yes'); //window.opener.document.form10["form10"].submit(); //window.alert("sandra"); window.close(); </script> <?php } else { ?> <script> nueva('<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /cargos/imprimirCargosPA.php?numeroE=<?php echo $numeroE; ?> &nCuenta=<?php echo $nCuenta; ?> &keyClientesInternos=<?php echo $nT; ?> &paciente=<?php echo $_POST['paciente']; ?> &numeroConfirmacion=<?php echo $numeroConfirmacion; ?> &hora1=<?php echo $hora1; ?> &cajero=<?php echo $usuario; ?> ','ventana7','800','600','yes'); //window.opener.document.form10["form"].submit(); window.close(); </script> <?php } ?> <?php } ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <title></title> <?php $link = new ventanasPrototype(); $link->links(); $estilo = new muestraEstilos(); $estilo->styles(); ?> <style type="text/css"> .popup_effect1 { background:#11455A; opacity: 0.2; } .popup_effect2 { background:#FF0041; border: 3px dashed #000; } </style> </head> <h1 align="center" class="titulos">Nota de Venta </h1> <form id="form1" name="form1" method="post" action="#"> <table width="642" border="0" align="center" cellpadding="1" cellspacing="1" bordercolor="#990099" class="Estilo24"> <tr> <th width="10" class="blanco" scope="col"> </th> <th bgcolor="#660066" class="blanco" scope="col"><div align="left" class="blanco">Folio de Venta</div></th> <th bgcolor="#660066" class="blanco" scope="col"><div align="left" class="blanco"><?php echo $_GET['folioVenta']; ?> </label></div> </th> </tr> <tr> <th width="10" class="normal" scope="col"> </th> <th width="134" bgcolor="#FFCCFF" class="normal" scope="col"><div align="left" class="normal">Paciente: </div></th> <th width="408" bgcolor="#FFCCFF" scope="col"><div align="left" class="normal"><strong> <label> </label> </strong> <?php echo $myrow3['paciente']; ?> </div></th> </tr> <tr> <th width="10" class="Estilo24" scope="col"> </th> <td class="normal">Compañía: </td> <td class="normal"> <label> <?php echo $traeSeguro = $myrow3['seguro']; ?> <?php displaySeguro::despliegaSeguro($traeSeguro, $basedatos); ?> <input name="seguro2" type="hidden" id="seguro2" value="<?php echo $traeSeguro; ?> " /> </label> </td> </tr> <tr> <th class="Estilo24" scope="col"> </th> <td bgcolor="#FFCCFF" class="normal">N° Credencial: </td> <td bgcolor="#FFCCFF" class="normal"><?php echo $myrow3['credencial']; ?> </td> </tr> </table> <p align="center"> <?php if ($_GET['codigoPaquete']) { echo 'Paquete: ' . $_GET['codigoPaquete']; } ?> </p> <table width="761" border="0" align="center"> <tr> <th width="306" height="14" bgcolor="#660066" class="blanco" scope="col"><div align="left" class="blanco">Descripción/Concepto</div></th> <th width="33" bgcolor="#660066" class="blanco" scope="col"><div align="left" class="blanco">Cant</div></th> <th width="76" bgcolor="#660066" class="blanco" scope="col">P.Unitario</th> <th width="76" bgcolor="#660066" class="blanco" scope="col"><div align="left">Particular</div></th> <th width="76" bgcolor="#660066" class="blanco" scope="col"><div align="left" class="blanco">Aseguradora</div></th> <th width="47" bgcolor="#660066" class="blanco" scope="col"><div align="left" class="blanco">IVA</div></th> <th width="96" bgcolor="#660066" class="blanco" scope="col"><div align="left" class="blanco">Convenio</div></th> <th width="17" bgcolor="#660066" class="blanco" scope="col"><div align="left" class="blanco">N</div></th> </tr> <tr> <?php //traigo agregados $sSQL81 = "\r\nSELECT \r\n*\r\nFROM\r\ncargosCuentaPaciente \r\n WHERE \r\nfolioVenta='" . $_GET['folioVenta'] . "'\r\n \r\n \r\n \r\n order by folioVenta asc\r\n"; $result81 = mysql_db_query($basedatos, $sSQL81); while ($myrow81 = mysql_fetch_array($result81)) { $a += '1'; $chain = $myrow81['hora1'] . " " . cambia_a_normal($myrow81['fecha1']); $art = $myrow81['codProcedimiento']; $codigo = $proc = $myrow81['codProcedimiento']; $keyCAP = $myrow81['keyCAP']; if ($myrow81['naturaleza'] == 'A') { $abonos[0] += $myrow81['precioVenta']; } else { $abonos[0] = '0.00'; } ?> <td height="21" bgcolor="<?php echo $color; ?> " class="normal"> <?php $descripcion = new articulosDetalles(); $descripcion->descripcion($keyCAP, $numeroE, $nCuenta, $codigo, $basedatos); if ($myrow81['tipoPago']) { echo '(' . $myrow81['tipoPago'] . ')'; } ?> <?php if ($myrow811['um'] == 's' or $myrow811['um'] == 'S') { echo ' ( Servicio ) '; } ?> </td> <td bgcolor="<?php echo $color; ?> " ><div align="center" class="normal"> <?php echo $cantidad = $myrow81['cantidad']; ?> </div></td> <td bgcolor="<?php echo $color; ?> " class="normal"><?php echo '$' . number_format($myrow81['precioVenta'], 2); ?> </td> <td bgcolor="<?php echo $color; ?> " class="normal"><?php if ($myrow81['naturaleza'] == 'C') { $particular[0] += $myrow81['cantidadParticular'] * $myrow81['cantidad']; } echo '$' . number_format($myrow81['cantidadParticular'] * $myrow81['cantidad'], 2); ?> </td> <td bgcolor="<?php echo $color; ?> " class="normal"> <?php if ($myrow81['naturaleza'] == 'C') { $aseguradora[0] += $myrow81['cantidadAseguradora'] * $myrow81['cantidad']; } echo '$' . number_format($myrow81['cantidadAseguradora'] * $myrow81['cantidad'], 2); ?> </td> <td bgcolor="<?php echo $color; ?> " class="normal"> <?php if ($myrow81['naturaleza'] == 'C') { $ivaTotal[0] += $myrow81['iva'] * $myrow81['cantidad']; } echo '$' . number_format($myrow81['iva'] * $myrow81['cantidad'], 2); ?> </td> <td bgcolor="<?php echo $color; ?> "><span class="normal"> <?php if ($myrow81['tipoConvenio'] and $myrow81['tipoConvenio'] != 'No') { echo '<img src="' . CONSTANT_PATH_SIMA_RAIZ . '/imagenes/cci/grafica.png" width="20" height="20" />'; } else { echo '---'; } ?> </span></td> <td bgcolor="<?php echo $color; ?> "><div align="center" class="normal"> <div align="left"> <?php echo $myrow81['naturaleza']; ?> </div> </div></td> </tr> <?php } ?> </table> <p> </p> <div align="center"> <table width="558" border="0" align="center"> <tr> <td width="113" class="style12"> </td> <td width="124" class="style12"> </td> <td width="97" class="normal">Total Cargos <?php $suma = $particular[0] + $aseguradora[0] + $ivaTotal[0]; echo '$' . number_format($suma, 2); ?> </td> <td width="106" height="23"><div align="left" class="normal">Total Abonos <?php echo '$' . number_format($abonos[0], 2); ?> </div></td> <td width="96"><div align="left" class="normal"><strong>Saldo Actual</strong><strong> <?php $total = $suma - $abonos[0]; echo "\$" . number_format($suma - $abonos[0], 2); ?> </strong></div></td> </tr> <tr> <td class="style12"> </td> <td class="style12"> </td> <td class="style12"><input name="cantidadRecibida" type="hidden" class="style7" id="cantidadRecibida" value="" /></td> <td height="23" class="normal"><div align="right"></div></td> <td class="normal"><div align="right"></div></td> </tr> <tr> <td class="style12"> </td> <td class="style12"> </td> <td class="style12"> </td> <td height="23" class="style23 Estilo24"><div align="right"></div></td> <td class="style12"><div align="right"></div></td> </tr> </table> </div> <p align="center"> <?php //********************************* if (round($total) == NULL) { ?> <label> <input name="imprimir" type="image" id="imprimir" value="Imprimir" src="<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /imagenes/btns/printbutton.png" onclick="Disab (2)"/> </label> <?php } else { ?> <input name="cargado" type="image" value="Aplicar Pagos" src="<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /imagenes/btns/aplicapay.png" onclick="nueva('<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /INGRESOS%20HLC/caja/ventanaAplicaPagoInternos.php?usuario=<?php echo $_GET['usuario']; ?> &numeroE=<?php echo $numeroE; ?> &almacen=<?php echo $_GET['almacenSolicitante']; ?> &almacenFuente=<?php echo $almacen; ?> &seguro=<?php echo $seguroT; ?> &nCuenta=<?php echo $myrow3['keyClientesInternos']; ?> &tipoCliente=<?php echo 'particular'; ?> &tipoVenta=<?php echo $_GET['tipoVenta']; ?> &folioVenta=<?php echo $myrow3['folioVenta']; ?> &keyClientesInternos=<?php echo $myrow3['keyClientesInternos']; ?> &rand=<?php echo rand(1000, 10000000); ?> &paquete=<?php echo $_GET['paquete']; ?> ','ventana7','500','600','yes')"/> <?php } ?> </p> </form> <p align="center"> </p> </body> </html> <?php }
evt = (evt) ? evt : window.event var charCode = (evt.which) ? evt.which : evt.keyCode if (charCode > 31 && (charCode < 48 || charCode > 57)) { status = "Este campo solo acepta numeros." return false } status = "" return true } </script> <?php $window=new ventanasPrototype(); $window->links(); $abrir=new ventanasPrototype(); $hoy = date("d/m/Y"); $hora = date("g:i a"); $cendis=new whoisCendis(); /* ?> <script> // Windows with an URL as content
public function eCuentaE($usuario, $entidad, $almacen, $fecha1, $hora1, $dia, $usu, $nT, $basedatos) { $cargosCia = new acumulados(); //**********************************CANDADO PRINCIPAL********************** $bali = $almacen; $sSQLC = "Select * From statusCaja where entidad='" . $entidad . "' and usuario='" . $usuario . "' order by keySTC DESC "; $resultC = mysql_db_query($basedatos, $sSQLC); $myrowC = mysql_fetch_array($resultC); $sSQL1 = "Select usuario,folioVenta From transacciones WHERE folioVenta ='" . $_GET['folioVenta'] . "' "; $result1 = mysql_db_query($basedatos, $sSQL1); $myrow1 = mysql_fetch_array($result1); echo mysql_error(); if ($myrow1['folioVenta'] and $myrow1['usuario'] != $usuario) { ?> <script> window.alert("Este proceso est� siendo utilizado por: (<?php echo $myrow1['usuario']; ?> ) y s�lo el puede terminar este proceso"); window.close(); </script> <?php } else { if (!$myrow1['folioVenta']) { $agrega = "INSERT INTO transacciones (\r\nfolioVenta,usuario,fecha,hora,keyCatC) \r\nvalues ('" . $_GET['folioVenta'] . "','" . $usuario . "','" . $fecha1 . "','" . $hora1 . "','" . $myrowC['keyCatC'] . "')"; mysql_db_query($basedatos, $agrega); echo mysql_error(); } } //************************************CANDADO DE USUARIO ?> <?php if ($_POST['cerrar']) { $particular = $_POST['particular']; $aseguradora = $_POST['aseguradora']; //cierro cuenta $agrega4 = "UPDATE clientesInternos set \r\ntipoCuenta='H',\r\nstatus='cerrada',\r\nstatusCuenta='cerrada',\r\nusuarioCierre='" . $usuario . "',\r\nfechaCierre='" . $fecha1 . "',\r\nhoraCierre='" . $hora1 . "',\r\nstatusCaja='pagado'\r\nwhere\r\nfolioVenta='" . $_GET['folioVenta'] . "' "; mysql_db_query($basedatos, $agrega4); echo mysql_error(); //********************CIERRO STATUS CUENTA*********************** $agrega = "UPDATE cargosCuentaPaciente set \r\nstatusCuenta='cerrada'\r\nwhere\r\nfolioVenta='" . $_GET['folioVenta'] . "'"; mysql_db_query($basedatos, $agrega); echo mysql_error(); //********************************************* //cierro cuarto a sucio if ($myrow3['cuarto']) { $agregad = "UPDATE cuartos set \r\nstatus='sucio',\r\nusuarioSalida='" . $usuario . "',\r\nfechaSalida='" . $fecha1 . "',\r\nhoraSalida='" . $hora1 . "'\r\n\r\nwhere\r\ncodigoCuarto='" . $myrow3['cuarto'] . "' \r\n"; //mysql_db_query($basedatos,$agregad); echo mysql_error(); } $leyenda = 'Se cerr� la cuenta'; $sSQL3 = "Select * From clientesInternos WHERE folioVenta = '" . $_GET['folioVenta'] . "' "; $result3 = mysql_db_query($basedatos, $sSQL3); $myrow3 = mysql_fetch_array($result3); if ($myrow3['status'] == 'cerrada' and $myrow3['statusCuenta'] == 'cerrada') { ?> <script> window.opener.document.forms["form1"].submit(); window.alert("Cuenta Cerrada"); //window.close(); </script> <?php } else { ?> <script> window.opener.document.forms["form1"].submit(); window.alert("Hay un problema con la cuenta"); //window.close(); </script> <?php } } ?> <script language=javascript> function ventanaSecundaria2 (URL){ window.open(URL,"ventana2","width=630,height=500,scrollbars=YES,scrollbars=YES,resizable=YES, maximizable=YES") } </script> <script language=javascript> function ventanaSecundaria7 (URL){ window.open(URL,"ventanaSecundaria7","width=1024,height=800,scrollbars=YES,resizable=YES, maximizable=YES") } </script> <script> var win = null; function nueva(mypage,myname,w,h,scroll){ LeftPosition = (screen.width) ? (screen.width-w)/2 : 0; TopPosition = (screen.height) ? (screen.height-h)/2 : 0; settings = 'height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',resizable' win = window.open(mypage,myname,settings) if(win.window.focus){win.window.focus();} } </script> <?php //************************ACTUALIZO ********************** //Llenado de datos $sSQL3 = "Select * From clientesInternos WHERE keyClientesInternos = '" . $_GET['nT'] . "' "; $result3 = mysql_db_query($basedatos, $sSQL3); $myrow3 = mysql_fetch_array($result3); $numeroE = $myrow3['numeroE']; $nCuenta = $myrow3['nCuenta']; $cuarto = $myrow3['cuarto']; $seguroT = ltrim($myrow3['seguro']); //***************aplicar pago********************** ?> <?php if ($_POST['imprimir']) { if ($_GET['paquete'] == 'si') { ?> <script language="javascript"> nueva('<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /cargos/imprimirReciboPaquetes.php?numeroE=<?php echo $myrow3['numeroE']; ?> &nCuenta=<?php echo $myrow3['nCuenta']; ?> &keyClientesInternos=<?php echo $myrow3['keyClientesInternos']; ?> &paciente=<?php echo $_POST['paciente']; ?> &numeroConfirmacion=<?php echo $numeroConfirmacion; ?> &hora1=<?php echo $hora1; ?> &cajero=<?php echo $usuario; ?> &codigoPaquete=<?php echo $myrow3['codigoPaquete']; ?> &numRecibo=<?php echo $myrowC['numRecibo']; ?> &paciente=<?php echo $_POST['paciente']; ?> &cantidadRecibida=<?php echo $_POST['cantidadRecibida']; ?> &folioVenta=<?php echo $myrow3['folioVenta']; ?> &fechaSolicitud=<?php print $_POST['variable_php']; ?> ','ventana7','800','600','yes'); //window.opener.document.form10["form10"].submit(); //window.alert("sandra"); window.close(); </script> <?php } else { ?> <script> nueva('<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /cargos/imprimirCargosPA.php?numeroE=<?php echo $numeroE; ?> &nCuenta=<?php echo $nCuenta; ?> &keyClientesInternos=<?php echo $nT; ?> &paciente=<?php echo $_POST['paciente']; ?> &numeroConfirmacion=<?php echo $numeroConfirmacion; ?> &hora1=<?php echo $hora1; ?> &cajero=<?php echo $usuario; ?> &fechaSolicitud=<?php print $_POST['variable_php']; ?> ','ventana7','800','600','yes'); //window.opener.document.form10["form"].submit(); window.close(); </script> <?php } ?> <?php } ?> <?php $sSQL3 = "Select * From clientesInternos WHERE folioVenta = '" . $_GET['folioVenta'] . "' "; $result3 = mysql_db_query($basedatos, $sSQL3); $myrow3 = mysql_fetch_array($result3); //***************aplicar pago********************** if ($myrow3['statusCuenta'] == 'cerrada' and $myrow3['status'] == 'cerrada') { echo "LA CUENTA DEL PACIENTE " . $myrow3['paciente'] . " ESTA CERRADA..."; ?> <input name="print" type="button" class="normal" id="print" value="Imprimir EC" onClick="ventanaSecundaria7('<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /cargos/despliegaCargos.php?numeroE=<?php echo $myrow['numeroE']; ?> &nCuenta=<?php echo $myrow['nCuenta']; ?> &almacen=<?php echo $ALMACEN; ?> &almacenFuente=<?php echo $ALMACEN; ?> &nT=<?php echo $nT; ?> &tipoCliente=<?php echo $tipoCliente; ?> &tipoMovimiento=<?php echo 'cierreCuenta'; ?> &tipoPaciente=interno&folioVenta=<?php echo $myrow3['folioVenta']; ?> ');"> <?php } else { ?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <html xmlns="http://www.w3.org/1999/xhtml"> <title></title> <?php $link = new ventanasPrototype(); $link->links(); $estilo = new muestraEstilos(); $estilo->styles(); ?> <style type="text/css"> .popup_effect1 { background:#11455A; opacity: 0.2; } .popup_effect2 { background:#FF0041; border: 3px dashed #000; } </style> <script languaje="JavaScript"> var reloj=new Date(); varjs= reloj.getHours()+":"+reloj.getMinutes(); </script> <h1 align="center" class="titulos">Nota de Venta </h1> <form id="form1" name="form1" method="post" action="#"> <table width="484" border="0" align="center" cellpadding="1" cellspacing="1" bordercolor="#990099" class="Estilo24"> <tr bgcolor="#330099"> <th class="blanco" scope="col"><div align="left" class="blanco">Folio de Venta</div></th> <th class="blanco" scope="col"><div align="left" class="blanco"><?php echo $nCliente = $myrow3['folioVenta']; ?> <input name="numeroE" type="hidden" class="blanco" id="numeroE" value="<?php echo $nCliente = $_POST['numeroE']; ?> " readonly=""/> </label></div> </th> </tr> <tr> <th width="134" bgcolor="#330099" class="blanco" scope="col"><div align="left" class="blanco">Paciente: </div></th> <th width="343" bgcolor="#FFFFFF" scope="col"><div align="left" class="normal"><strong> <label> </label> </strong> <?php echo $myrow3['paciente']; ?> </div></th> </tr> <tr> <td bgcolor="#330099" class="blanco">Compañía: </td> <td bgcolor="#FFFFFF" class="normal"> <label> <?php echo $traeSeguro = $myrow3['seguro']; ?> <input name="seguro2" type="hidden" id="seguro2" value="<?php echo $traeSeguro; ?> " /> </label> </td> </tr> <tr> <td bgcolor="#330099" class="blanco">N° Credencial: </td> <td bgcolor="#FFFFFF" class="normal"><?php echo $myrow3['credencial']; ?> </td> </tr> <tr> <td bgcolor="#330099" class="blanco">Fecha</td> <td bgcolor="#FFFFFF" class="normal"><?php echo cambia_a_normal($myrow3['fecha']); ?> </td> </tr> </table> <p align="center"> <?php if ($_GET['codigoPaquete']) { echo 'Paquete: ' . $_GET['codigoPaquete']; } ?> </p> <a href="#" onclick="javascript:ventanaSecundaria7('<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /cargos/despliegaCargos.php?numeroE=<?php echo $myrow['numeroE']; ?> &nCuenta=<?php echo $myrow['nCuenta']; ?> &almacen=<?php echo $ALMACEN; ?> &almacenFuente=<?php echo $ALMACEN; ?> &nT=<?php echo $nT; ?> &tipoCliente=<?php echo $tipoCliente; ?> &tipoMovimiento=<?php echo 'cierreCuenta'; ?> &tipoPaciente=interno&folioVenta=<?php echo $myrow3['folioVenta']; ?> ')"> <p align="center"> </p> </a><div align="center"> <p> </p> <table width="1124" border="0.2" align="center"> <tr> <th width="54" bgcolor="#660066" class="blanco" scope="col"><div align="center">#</div></th> <th width= "341" bgcolor="#660066" class="blanco" scope="col"><div align="center">Descripcion</div></th> <th width= "76" bgcolor="#660066" class="blanco" scope="col"><div align="center">Totales</div></th> <th width= "35" bgcolor="#660066" class="blanco" scope="col"><div align="center">N</div></th> <th width= "86" bgcolor="#660066" class="blanco" scope="col"><div align="center">Particular</div></th> <th bgcolor="#660066" class="blanco" scope="col"><div align="center">Aseguradora</div></th> <th bgcolor="#660066" class="blanco" scope="col"><div align="center">Otros</div></th> <th bgcolor="#660066" class="blanco" scope="col"><div align="center">Coaseguro1</div></th> <th bgcolor="#660066" class="blanco" scope="col"><div align="center">Coaseguro2</div></th> <th bgcolor="#660066" class="blanco" scope="col"><div align="center">Deducible1</div></th> <th bgcolor="#660066" class="blanco" scope="col"><div align="center">Deducible2</div></th> </tr> <tr> <?php $sSQL = "SELECT *\r\nFROM\r\ncargosCuentaPaciente\r\nwhere\r\nfolioVenta='" . $_GET['folioVenta'] . "'"; if ($result = mysql_db_query($basedatos, $sSQL)) { while ($myrow = mysql_fetch_array($result)) { $numeroE = $myrow['numeroE']; $nCuenta = $myrow['nCuenta']; if ($col) { $color = '#FFCCFF'; $col = ""; } else { $color = '#FFFFFF'; $col = 1; } $a += 1; $nT = $myrow['keyClientesInternos']; if ($myrow['naturaleza'] == 'A') { $signo = '-'; } else { $signo = NULL; } ?> <td height="24" bgcolor="<?php echo $color; ?> " class="codigos"><?php print $a; ?> </td> <td width="341" bgcolor="<?php echo $color; ?> " class="normal"><?php if ($myrow['descripcionArticulo'] != '') { echo $myrow['descripcionArticulo']; } else { if ($myrow['gpoProducto'] and $myrow['naturaleza'] == 'A') { echo 'Devolucion'; } else { echo 'Operacion de Caja'; } } ?> </td> <td width="76" bgcolor="<?php echo $color; ?> " class="normal"><div align="center"> <?php echo '$' . number_format($myrow['precioVenta'] * $myrow['cantidad'] + $myrow['iva'] * $myrow['cantidad'], 2); ?> </div></td> <td width="35" bgcolor="<?php echo $color; ?> " class="normal"><div align="center"> <?php echo $myrow['naturaleza']; ?> </div></td> <td width="86" bgcolor="<?php echo $color; ?> " class="normal"><div align="center"> <?php echo '$' . number_format($myrow['cantidadParticular'] * $myrow['cantidad'] + $myrow['ivaParticular'] * $myrow['cantidad'], 2); ?> </div></td> <td width="97" bgcolor="<?php echo $color; ?> " class="normal"><div align="center"> <?php echo '$' . number_format($myrow['cantidadAseguradora'] * $myrow['cantidad'] + $myrow['ivaAseguradora'] * $myrow['cantidad'], 2); ?> </div></td> <td width="63" bgcolor="<?php echo $color; ?> " class="codigos"><div align="center"> <?php echo '$0.00'; ?> </div></td> <td width="84" bgcolor="<?php echo $color; ?> " class="codigos"><div align="center"> <?php if ($myrow['tipoTransaccion'] == 'PCoaS1') { echo '$' . number_format($myrow['precioVenta'], 2); } else { echo '$0.00'; } ?> </div></td> <td width="84" bgcolor="<?php echo $color; ?> " class="codigos"><div align="center"> <?php if ($myrow['tipoTransaccion'] == 'PCoaS2') { echo '$' . number_format($myrow['precioVenta'], 2); } else { echo '$0.00'; } ?> </div></td> <td width="78" bgcolor="<?php echo $color; ?> " class="codigos"> <?php if ($myrow['tipoTransaccion'] == 'PDeduSeg1') { echo '$' . number_format($myrow['precioVenta'], 2); } else { echo '$0.00'; } ?> </td> <td width="80" bgcolor="<?php echo $color; ?> " class="codigos"> <?php if ($myrow['tipoTransaccion'] == 'PDeduSeg2') { echo '$' . number_format($myrow['precioVenta'], 2); } else { echo '$0.00'; } ?> </td> </tr> <?php //**************************TOTALES************************* if ($myrow['gpoProducto'] != '' and $myrow['status'] != 'transaccion') { if ($myrow['naturaleza'] == 'C') { $pVC[0] += $myrow['precioVenta'] * $myrow['cantidad']; $ivaC[0] += $myrow['iva'] * $myrow['cantidad']; } else { $pVA[0] += $myrow['precioVenta'] * $myrow['cantidad']; $ivaA[0] += $myrow['iva'] * $myrow['cantidad']; } } else { $transacciones[0] += $myrow['precioVenta'] * $myrow['cantidad']; } //********************************************************** //***********************PARTICULAR*********************** if ($myrow['naturaleza'] == 'C') { $cantidadParticularCargo[0] += $myrow['cantidadParticular'] * $myrow['cantidad']; $ivaParticularCargo[0] += $myrow['ivaParticular'] * $myrow['cantidad']; } else { $cantidadParticularAbono[0] += $myrow['cantidadParticular'] * $myrow['cantidad']; $ivaParticularAbono[0] += $myrow['ivaParticular'] * $myrow['cantidad']; } //********************************************************** //***************************ASEGURADORA******************* if ($myrow['naturaleza'] == 'C') { $cantidadAseguradoraCargo[0] += $myrow['cantidadAseguradora'] * $myrow['cantidad']; $ivaAseguradoraCargo[0] += $myrow['ivaAseguradora'] * $myrow['cantidad']; } else { $cantidadAseguradoraAbono[0] += $myrow['cantidadAseguradora'] * $myrow['cantidad']; $ivaAseguradoraAbono[0] += $myrow['ivaAseguradora'] * $myrow['cantidad']; } //******************************************************** //**********************COASEGURO1**************************** if ($myrow['tipoTransaccion'] == 'PCoaS1') { if ($myrow['naturaleza'] == '-') { $totalCargoCoaseguro1[0] += $myrow['precioVenta']; } else { $totalAbonoCoaseguro1[0] += $myrow['precioVenta']; } } if ($myrow['tipoTransaccion'] == 'PCoaS2') { if ($myrow['naturaleza'] == '-') { $totalCargoCoaseguro2[0] += $myrow['precioVenta']; } else { $totalAbonoCoaseguro2[0] += $myrow['precioVenta']; } } if ($myrow['tipoTransaccion'] == 'PDeduSeg1') { if ($myrow['naturaleza'] == '-') { $totalCargoDeducible1[0] += $myrow['precioVenta']; } else { $totalAbonoDeducible1[0] += $myrow['precioVenta']; } } if ($myrow['tipoTransaccion'] == 'PDeduSeg2') { if ($myrow['naturaleza'] == '-') { $totalCargoDeducible2[0] += $myrow['precioVenta']; } else { $totalAbonoDeducible2[0] += $myrow['precioVenta']; } } //************************************************************ ?> <?php } } ?> <input name="menu" type="hidden" value="<?php echo $menu; ?> " /> </table> </p> </div> <?php $totales[0] = $pVC[0] + $ivaC[0] - ($pVA[0] + $ivaA[0]); $totalParticular = $cantidadParticularCargo[0] + $ivaParticularCargo[0] - ($cantidadParticularAbono[0] + $ivaParticularAbono[0]); $totalAseguradora = $cantidadAseguradoraCargo[0] + $ivaAseguradoraCargo[0] - ($cantidadAseguradoraAbono[0] + $ivaAseguradoraAbono[0]); $totalCoaseguro1 = $totalCargoCoaseguro1[0] - $totalAbonoCoaseguro1[0]; $totalCoaseguro2 = $totalCargoCoaseguro2[0] - $totalAbonoCoaseguro2[0]; $totalDeducible1 = $totalCargoDeducible1[0] - $totalAbonoDeducible1[0]; $totalDeducible2 = $totalCargoDeducible2[0] - $totalAbonoDeducible2[0]; ?> <table width="200" border="1" align="center" class="normal"> <tr> <td>Total</td> <td>Particular</td> <td>Aseguradora</td> <td>Otros</td> <td>Coaseguro1</td> <td>Coaseguro2</td> <td>Deducible1</td> <td>Deducible2</td> </tr> <tr> <td><?php echo '$' . number_format($totales[0], 2); ?> </td> <td><?php if ($totalParticular > 0) { ?> <a href="javascript:nueva('<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /INGRESOS%20HLC/caja/ventanaAplicaPagoInternos.php?usuario=<?php echo $_GET['usuario']; ?> &numeroE=<?php echo $numeroE; ?> &almacen=<?php echo $_GET['almacenSolicitante']; ?> &almacenFuente=<?php echo $almacen; ?> &seguro=<?php echo $seguroT; ?> &nCuenta=<?php echo $myrow3['keyClientesInternos']; ?> &tipoCliente=<?php echo 'particular'; ?> &tipoVenta=<?php echo $_GET['tipoVenta']; ?> &folioVenta=<?php echo $myrow3['folioVenta']; ?> &keyClientesInternos=<?php echo $myrow3['keyClientesInternos']; ?> &rand=<?php echo rand(1000, 10000000); ?> &paquete=<?php echo $_GET['paquete']; ?> &transaccion=particular&precioVenta=<?php echo $totalParticular; ?> &modoPago=efectivo&tipoTransaccion=PCoaS1','ventana7','800','800','yes');"> <?php echo '$' . number_format($totalParticular, 2); ?> </a> <?php } else { echo 'Ok'; } ?> </td> <td> <?php if ($totalAseguradora > 0) { ?> <a href="javascript:nueva('<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /INGRESOS%20HLC/caja/ventanaAplicaPagoInternos.php?usuario=<?php echo $_GET['usuario']; ?> &numeroE=<?php echo $numeroE; ?> &almacen=<?php echo $_GET['almacenSolicitante']; ?> &almacenFuente=<?php echo $almacen; ?> &seguro=<?php echo $seguroT; ?> &nCuenta=<?php echo $myrow3['keyClientesInternos']; ?> &tipoCliente=<?php echo 'particular'; ?> &tipoVenta=<?php echo $_GET['tipoVenta']; ?> &folioVenta=<?php echo $myrow3['folioVenta']; ?> &keyClientesInternos=<?php echo $myrow3['keyClientesInternos']; ?> &rand=<?php echo rand(1000, 10000000); ?> &paquete=<?php echo $_GET['paquete']; ?> &precioVenta=<?php echo $totalAseguradora; ?> &modoPago=cxc&transaccion=aseguradora&tipoTransaccion=aseguradora','ventana7','800','800','yes');"> <?php echo '$' . number_format($totalAseguradora, 2); ?> </a> <?php } else { echo 'Ok'; } ?> </td> <td>$0.00</td> <td> <?php if ($totalCoaseguro1 > 0) { ?> <a href="javascript:nueva('<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /INGRESOS%20HLC/caja/ventanaAplicaPagoInternos.php?usuario=<?php echo $_GET['usuario']; ?> &numeroE=<?php echo $numeroE; ?> &almacen=<?php echo $_GET['almacenSolicitante']; ?> &almacenFuente=<?php echo $almacen; ?> &seguro=<?php echo $seguroT; ?> &nCuenta=<?php echo $myrow3['keyClientesInternos']; ?> &tipoCliente=<?php echo 'particular'; ?> &tipoVenta=<?php echo $_GET['tipoVenta']; ?> &folioVenta=<?php echo $myrow3['folioVenta']; ?> &keyClientesInternos=<?php echo $myrow3['keyClientesInternos']; ?> &rand=<?php echo rand(1000, 10000000); ?> &paquete=<?php echo $_GET['paquete']; ?> &transaccion=particular&precioVenta=<?php echo $totalCoaseguro1; ?> &modoPago=efectivo&tipoTransaccion=coaseguro&numCoaseguro=PCoaS1','ventana7','800','800','yes');"> <?php echo '$' . number_format($totalCoaseguro1, 2); ?> </a> <?php } else { echo 'Ok'; } ?> </td> <td> <?php if ($totalCoaseguro2 > 0) { ?> <a href="javascript:nueva('<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /INGRESOS%20HLC/caja/ventanaAplicaPagoInternos.php?usuario=<?php echo $_GET['usuario']; ?> &numeroE=<?php echo $numeroE; ?> &almacen=<?php echo $_GET['almacenSolicitante']; ?> &almacenFuente=<?php echo $almacen; ?> &seguro=<?php echo $seguroT; ?> &nCuenta=<?php echo $myrow3['keyClientesInternos']; ?> &tipoCliente=<?php echo 'particular'; ?> &tipoVenta=<?php echo $_GET['tipoVenta']; ?> &folioVenta=<?php echo $myrow3['folioVenta']; ?> &keyClientesInternos=<?php echo $myrow3['keyClientesInternos']; ?> &rand=<?php echo rand(1000, 10000000); ?> &paquete=<?php echo $_GET['paquete']; ?> &transaccion=particular&precioVenta=<?php echo $totalCoaseguro2; ?> &modoPago=efectivo&tipoTransaccion=coaseguro&numCoaseguro=PCoaS2','ventana7','800','800','yes');"> <?php echo '$' . number_format($totalCoaseguro2, 2); ?> </a> <?php } else { echo 'Ok'; } ?> </td> <td> <?php if ($totalDeducible1 > 0) { ?> <a href="javascript:nueva('<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /INGRESOS%20HLC/caja/ventanaAplicaPagoInternos.php?usuario=<?php echo $_GET['usuario']; ?> &numeroE=<?php echo $numeroE; ?> &almacen=<?php echo $_GET['almacenSolicitante']; ?> &almacenFuente=<?php echo $almacen; ?> &seguro=<?php echo $seguroT; ?> &nCuenta=<?php echo $myrow3['keyClientesInternos']; ?> &tipoCliente=<?php echo 'particular'; ?> &tipoVenta=<?php echo $_GET['tipoVenta']; ?> &folioVenta=<?php echo $myrow3['folioVenta']; ?> &keyClientesInternos=<?php echo $myrow3['keyClientesInternos']; ?> &rand=<?php echo rand(1000, 10000000); ?> &paquete=<?php echo $_GET['paquete']; ?> &transaccion=particular&precioVenta=<?php echo $totalDeducible1; ?> &modoPago=efectivo&tipoTransaccion=coaseguro&numCoaseguro=PDeduSeg1','ventana7','800','800','yes');"> <?php echo '$' . number_format($totalDeducible1, 2); ?> </a> <?php } else { echo 'Ok'; } ?> </td> <td> <?php if ($totalDeducible2 > 0) { ?> <a href="javascript:nueva('<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /INGRESOS%20HLC/caja/ventanaAplicaPagoInternos.php?usuario=<?php echo $_GET['usuario']; ?> &numeroE=<?php echo $numeroE; ?> &almacen=<?php echo $_GET['almacenSolicitante']; ?> &almacenFuente=<?php echo $almacen; ?> &seguro=<?php echo $seguroT; ?> &nCuenta=<?php echo $myrow3['keyClientesInternos']; ?> &tipoCliente=<?php echo 'particular'; ?> &tipoVenta=<?php echo $_GET['tipoVenta']; ?> &folioVenta=<?php echo $myrow3['folioVenta']; ?> &keyClientesInternos=<?php echo $myrow3['keyClientesInternos']; ?> &rand=<?php echo rand(1000, 10000000); ?> &paquete=<?php echo $_GET['paquete']; ?> &transaccion=particular&precioVenta=<?php echo $totalDeducible2; ?> &modoPago=efectivo&tipoTransaccion=coaseguro&numCoaseguro=PDeduSeg2','ventana7','800','800','yes');"> <?php echo '$' . number_format($totalDeducible2, 2); ?> </a> <?php } else { echo 'Ok'; } ?> </td> </tr> </table> <p align="center"> </p> <p align="center"> <?php //********************************* if ($myrow3['tipoPaciente'] == 'externo') { if ($totalParticular == 0 and $totalAseguradora == 0) { ?> <label> <input name="imprimir" type="image" id="imprimir" value="Imprimir" src="<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /imagenes/btns/printbutton.png" onClick="Disab (2)"/> </label> <?php } ?> </p> <?php } else { ?> <input name="cerrar" type="submit" class="normal" id="cerrar" value="Cerrar Cuenta" onClick="if(confirm('¿Estás seguro que deseas cerrar la cuenta?') == false){return false;}" /> <?php } ?> <input type="hidden" name="variable_php" id="variable_php" /> </form> <p align="center"> </p> <script languaje="JavaScript"> document.form1.variable_php.value=varjs; </script> </body> </html> <?php } ?> <?php }
public function trasladoDiarioCuentas($entidad, $fecha1, $hora1, $dia, $usuario, $nT, $basedatos) { include CONSTANT_PATH_CONFIGURACION . "/funciones.php"; $cargosCia = new acumulados(); ?> <script language=javascript> function ventanaSecundaria4 (URL){ window.open(URL,"ventana4","width=800,height=300,scrollbars=YES,resizable=YES, maximizable=YES") } </script> <script language=javascript> function ventanaSecundaria2 (URL){ window.open(URL,"ventana2","width=630,height=500,scrollbars=YES,scrollbars=YES,resizable=YES, maximizable=YES") } </script> <script language=javascript> function ventanaSecundaria1 (URL){ window.open(URL,"ventana1","width=530,height=300,scrollbars=YES") } </script> <script language=javascript> function ventanaSecundaria5 (URL){ window.open(URL,"ventana5","width=500,height=500,scrollbars=YES,resizable=YES, maximizable=YES") } </script> <script language=javascript> function ventanaSecundaria3 (URL){ window.open(URL,"ventana3","width=500,height=400,scrollbars=YES,resizable=YES, maximizable=YES") } </script> <script language=javascript> function ventanaSecundaria6 (URL){ window.open(URL,"ventana6","width=500,height=400,scrollbars=YES,resizable=YES, maximizable=YES") } </script> <script language=javascript> function ventanaSecundaria7 (URL){ window.open(URL,"ventana7","width=500,height=600,scrollbars=YES,resizable=YES, maximizable=YES") } </script> <script language="javascript" type="text/javascript"> //Validacion de campos de texto no vacios by Mauricio Escobar // //Iv�n Nieto P�rez //Este script y otros muchos pueden //descarse on-line de forma gratuita //en El C�digo: www.elcodigo.com //********************************************************************************* // Function que valida que un campo contenga un string y no solamente un " " // Es tipico que al validar un string se diga // if(campo == "") ? alert(Error) // Si el campo contiene " " entonces la validacion anterior no funciona //********************************************************************************* //busca caracteres que no sean espacio en blanco en una cadena function vacio(q) { for ( i = 0; i < q.length; i++ ) { if ( q.charAt(i) != " " ) { return true } } return false } //valida que el campo no este vacio y no tenga solo espacios en blanco function valida(F) { if( vacio(F.campo.value) == false ) { alert("Introduzca un cadena de texto.") return false } else { alert("OK") //cambiar la linea siguiente por return true para que ejecute la accion del formulario return true } } </script> <SCRIPT LANGUAGE="JavaScript"> function checkIt(evt) { evt = (evt) ? evt : window.event var charCode = (evt.which) ? evt.which : evt.keyCode if (charCode > 31 && (charCode < 48 || charCode > 57)) { status = "Este campo s�lo acepta n�meros." return false } status = "" return true } </SCRIPT> <script type="text/javascript"> <!-- por carlitos. cualquier duda o pregunta, visita www.forosdelweb.com var ancho=100 var alto=100 var fin=300 var x=100 var y=100 function inicio() { ventana = window.open("cita.php", "_blank", "height=1,width=1,top=x,left=y,screenx=x,screeny=y"); abre(); } function abre() { if (ancho<=fin) { ventana.moveto(x,y); ventana.resizeto(ancho,alto); x+=5 y+=5 ancho+=15 alto+=15 timer= settimeout("abre()",1) } else { cleartimeout(timer) } } // --> </script> <?php //************************ACTUALIZO ********************** //********************Llenado de datos if (!$_GET['nT']) { $_GET['nT'] = $nT; } if (!$bali) { $bali = $_GET['almacenFuente']; } $sSQL3 = "Select * From clientesInternos WHERE keyClientesInternos = '" . $_GET['nT'] . "' "; $result3 = mysql_db_query($basedatos, $sSQL3); $myrow3 = mysql_fetch_array($result3); $numeroE = $myrow3['numeroE']; $nCuenta = $myrow3['nCuenta']; $cuarto = $myrow3['cuarto']; //***************aplicar pago********************** if ($_POST['actualizar']) { $particular = $_POST['particular']; $aseguradora = $_POST['aseguradora']; for ($i = 0; $i <= $_POST['bandera2']; $i++) { if ($aseguradora[$i]) { $status = 'efectivo'; $keyCAP[] = $aseguradora[$i]; } else { $status = 'cxc'; $keyCAP[] = $particular[$i]; } $agrega = "UPDATE cargosCuentaPaciente set \r\nstatusAlta='" . $status . "',\r\nusuarioAlta='" . $usuario . "',\r\nfechaAlta='" . $fecha1 . "',\r\nhoraAlta='" . $hora1 . "'\r\n\r\nwhere\r\nkeyCAP='" . $keyCAP[$i] . "' \r\n"; mysql_db_query($basedatos, $agrega); echo mysql_error(); } //cierra for } //cierra actualizar $cargosParticulares = new acumulados(); $totalxSurtir = new acumulados(); $cargosAseguradora = new acumulados(); $otros = new acumulados(); if ($_POST['cerrar'] and $cargosParticulares->cargosParticulares($basedatos, $usuario, $numeroE, $nCuenta) == NULL and $totalxSurtir->totalxSurtir($basedatos, $usuario, $numeroE, $nCuenta) == NULL and $otros->otros($basedatos, $usuario, $numeroE, $nCuenta) == NULL and $cargosAseguradora->cargosAseguradora($basedatos, $usuario, $numeroE, $nCuenta) == NULL) { $particular = $_POST['particular']; $aseguradora = $_POST['aseguradora']; for ($i = 0; $i <= $_POST['bandera2']; $i++) { $agrega = "UPDATE cargosCuentaPaciente set \r\nstatus='cerrada',\r\nusuarioAlta='" . $usuario . "',\r\nfechaAlta='" . $fecha1 . "',\r\nhoraAlta='" . $hora1 . "'\r\n\r\nwhere\r\nnumeroE='" . $numeroE . "' \r\nand\r\nnCuenta='" . $nCuenta . "'\r\nand statusAlta='efectivo'\r\n"; //mysql_db_query($basedatos,$agrega); echo mysql_error(); } //cierro cuenta $agrega = "UPDATE clientesInternos set \r\nstatus='cerrada',\r\nstatusCuenta='cerrada',\r\nusuarioCierre='" . $usuario . "',\r\nfechaCierre='" . $fecha1 . "',\r\nhoraCierre='" . $hora1 . "'\r\n\r\nwhere\r\nkeyClientesInternos='" . $_GET['nT'] . "' \r\n"; mysql_db_query($basedatos, $agrega); echo mysql_error(); //cierro cuarto a sucio $agrega = "UPDATE cuartos set \r\nstatus='sucio',\r\nusuarioSalida='" . $usuario . "',\r\nfechaSalida='" . $fecha1 . "',\r\nhoraSalida='" . $hora1 . "'\r\n\r\nwhere\r\ncodigoCuarto='" . $cuarto . "' \r\n"; mysql_db_query($basedatos, $agrega); echo mysql_error(); $leyenda = 'Se cerr� la cuenta'; ?> <script type="text/vbscript"> msgbox "LA CUENTA <?php echo $_GET['nT']; ?> ESTA CERRADA!" </script>'; <script> javascript:ventanaSecundaria6('<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /INGRESOS%20HLC/caja/imprimirCierreCuenta.php?numeroE=<?php echo $nCliente5; ?> &nT=<?php echo $numeroCuenta; ?> &paciente=<?php echo $_POST['paciente']; ?> &orden=<?php echo $E; ?> &hora1=<?php echo $hora1; ?> '); </script> <script> close(); </script> <script language="JavaScript" type="text/javascript"> <!-- opener.location.reload(true); self.close(); // --> </script> <?php } ?> <!-Hoja de estilos del calendario --> <link rel="stylesheet" type="text/css" media="all" href="<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /calendario/calendar-tas.css" title="win2k-cold-1" /> <!-- librer�a principal del calendario --> <script type="text/javascript" src="<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /calendario/calendar.js"></script> <!-- librer�a para cargar el lenguaje deseado --> <script type="text/javascript" src="<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /calendario/lang/calendar-es.js"></script> <!-- librer�a que declara la funci�n Calendar.setup, que ayuda a generar un calendario en unas pocas l�neas de c�digo --> <script type="text/javascript" src="<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /calendario/calendar-setup.js"></script> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <html xmlns="http://www.w3.org/1999/xhtml"> <style type="text/css"> <!-- .style71 {font-size: 9px} .style71 {font-size: 9px} .style71 {font-size: 9px} --> </style> <head> <title></title> <style type="text/css"> <!-- .style13 {color: #FFFFFF} .style11 {color: #FFFFFF; font-size: 10px; font-weight: bold; } .style7 {font-size: 9px} .Estilo24 {font-size: 10px} .style19 {color: #000000; font-weight: bold; } --> </style> </head> <style type="text/css"> <!-- .style12 {font-size: 10px} .style14 {font-size: 10px; color: #FFFFFF; } .style21 {color: #FF0000} --> </style> <BODY > <?php ventanasPrototype::links(); ?> <h1 align="center">Reporte Diario de Cuentas </h1> <form id="form1" name="form1" method="post" action=""> <table width="642" border="0" align="center" cellpadding="1" cellspacing="1" bordercolor="#990099" class="Estilo24"> <tr> <th width="10" class="Estilo24" scope="col"> </th> <td width="134" class="Estilo24">Fecha</td> <td width="408" class="Estilo24"><span class="style12"> <label> <input type="checkbox" name="banderaFecha" value="checkbox" onClick="javascript:this.form.submit();" <?php if ($_POST['banderaFecha']) { echo 'checked="checked"'; } ?> /> </label> <?php if ($_POST['banderaFecha']) { ?> <input name="fecha" type="text" class="style12" id="campo_fecha" value="<?php if ($_POST['fecha']) { echo $_POST['fecha']; } else { if ($myrow3['hoy']) { echo $myrow3['hoy']; } else { echo $fecha1; } } ?> " size="9" readonly="" /> <label> <input name="button" type="button" class="style12" id="lanzador" value="..." /> Entre </label> <input name="fecha2" type="text" class="style12" id="campo_fecha1" value="<?php if ($_POST['fecha2']) { echo $_POST['fecha2']; } else { if ($myrow3['hoy']) { echo $myrow3['hoy']; } else { echo $fecha1; } } ?> " size="9" readonly="" /> <label> <input name="button2" type="button" class="style12" id="lanzador1" value="..." /> <input name="show" type="submit" class="style7" id="show" value=">" /> <?php } else { ?> <input name="fecha3" type="hidden" class="style12" id="fecha2" value="<?php echo 'all'; ?> "/> <?php } ?> </label> </span></td> </tr> </table> <p> </p> <table width="847" border="0" align="center"> <tr> <th width="60" bgcolor="#660066" class="style14" scope="col"><div align="left"><span class="style12 ">#MOV </span></div></th> <th width="96" height="14" bgcolor="#660066" class="style14" scope="col"><div align="left"><span class="style12 ">Fecha/Hora </span></div></th> <th width="300" bgcolor="#660066" class="style14" scope="col"><div align="left"><span class="style12 ">Descripción/Concepto</span></div></th> <th width="21" bgcolor="#660066" class="style14" scope="col"><div align="left"><span class="style12 ">Cant</span></div></th> <th width="55" bgcolor="#660066" class="style14" scope="col"><div align="left"><span class="style12 ">Importe</span></div></th> <th width="33" bgcolor="#660066" class="style14" scope="col"><div align="left"><span class="style12 ">IVA</span></div></th> <th width="27" bgcolor="#660066" class="style14" scope="col"><div align="left"><span class="style12 ">Status</span></div></th> <th width="47" bgcolor="#660066" class="style14" scope="col"><div align="left"><span class="style12 ">D Solicita</span></div></th> <th width="52" bgcolor="#660066" class="style14" scope="col"><div align="left"><span class="style12 ">D Cargo.</span></div></th> <th width="72" bgcolor="#660066" class="style14" scope="col"><div align="left"><span class="style12 ">Tipo P </span></div></th> <th width="38" bgcolor="#660066" class="style14" scope="col"><div align="left"><span class="style12 ">N </span></div></th> </tr> <?php //traigo agregados if ($_POST['tipoVista'] == 'Agrupado' and $_POST['banderaFecha']) { $sSQL81 = "\r\nSELECT \r\nkeyCAP,codProcedimiento,um,hora1,fecha1,cantidad,iva,almacenDestino,almacenSolicitante,precioVenta,tipoCliente,gpoProducto,naturaleza\r\nFROM\r\ncargosCuentaPaciente \r\n WHERE numeroE = '" . $numeroE . "'\r\n \r\n and nCuenta='" . $nCuenta . "'\r\n and (status!='standby' and statusCargo!='standby' and status!='cxc' AND status!='cancelado')\r\n and\r\n(fecha1 between'" . $_POST['fecha'] . "' and '" . $_POST['fecha2'] . "')\r\n\r\n\r\n \r\n group by codProcedimiento \r\n order by fecha1,hora1 asc\r\n"; } else { if ($_POST['tipoVista'] == 'Detalle' and $_POST['banderaFecha']) { $sSQL81 = "\r\nSELECT \r\nkeyCAP,codProcedimiento,um,hora1,fecha1,cantidad,iva,almacenDestino,almacenSolicitante,precioVenta,tipoCliente,gpoProducto,naturaleza\r\nFROM\r\ncargosCuentaPaciente \r\n WHERE \r\n numeroE = '" . $numeroE . "'\r\n \r\n and nCuenta='" . $nCuenta . "'\r\n \r\n and (status!='standby' and statusCargo!='standby' and status!='cxc' AND status!='cancelado')\r\n and \r\n (fecha1 between'" . $_POST['fecha'] . "' and '" . $_POST['fecha2'] . "')\r\n\r\n order by hora1 asc\r\n"; } else { if ($_POST['tipoVista'] == 'Agrupado' and !$_POST['banderaFecha']) { $sSQL81 = "\r\nSELECT \r\nkeyCAP,codProcedimiento,um,hora1,fecha1,cantidad,iva,almacenDestino,almacenSolicitante,precioVenta,tipoCliente,gpoProducto,naturaleza\r\nFROM\r\ncargosCuentaPaciente \r\n WHERE \r\nnumeroE = '" . $numeroE . "'\r\n \r\n and nCuenta='" . $nCuenta . "'\r\n\r\n\r\n \r\n group by codProcedimiento \r\n order by fecha1,hora1 asc\r\n"; } else { if ($_POST['tipoVista'] == 'Detalle' and !$_POST['banderaFecha']) { $sSQL81 = "\r\nSELECT \r\nkeyCAP,codProcedimiento,um,hora1,fecha1,cantidad,iva,almacenDestino,almacenSolicitante,precioVenta,tipoCliente,gpoProducto,naturaleza\r\nFROM\r\ncargosCuentaPaciente \r\n WHERE \r\n numeroE = '" . $numeroE . "'\r\n \r\n and nCuenta='" . $nCuenta . "'\r\n\r\nand \r\nstatus!='cancelado'\r\n \r\n \r\n \r\n order by fecha1,hora1 asc\r\n"; } } } } if ($result81 = mysql_db_query($basedatos, $sSQL81)) { while ($myrow81 = mysql_fetch_array($result81)) { $a += '1'; $art = $myrow81['codProcedimiento']; $codigo = $proc = $myrow81['codProcedimiento']; $keyCAP = $myrow81['keyCAP']; if ($_POST['tipoVista'] == 'Agrupado') { $sSQL14 = "\r\nSELECT \r\nsum(cantidad) as cantidad2\r\nFROM\r\ncargosCuentaPaciente\r\nWHERE \r\ncodProcedimiento = '" . $proc . "' and numeroE = '" . $numeroE . "'\r\n"; $result14 = mysql_db_query($basedatos, $sSQL14); $myrow14 = mysql_fetch_array($result14); } ?> <tr> <td bgcolor="<?php echo $color; ?> " class="Estilo24"><div align="left"><span class="<?php echo $estilo; ?> "><?php echo $myrow81['keyCAP']; ?> </span></div></td> <td height="21" bgcolor="<?php echo $color; ?> " class="Estilo24"><div align="left"><span class="<?php echo $estilo; ?> "> <?php echo $myrow81['hora1'] . " " . cambia_a_normal($myrow81['fecha1']); ?> </span></div></td> <td bgcolor="<?php echo $color; ?> " class="Estilo24"><div align="left"><span class="<?php echo $estilo; ?> "><span class="style12"><span class="style7"> <?php $descripcion = new articulosDetalles(); $descripcion->descripcion($numeroE, $nCuenta, $codigo, $basedatos); ?> </span></span> <span class="style12"> <?php if ($myrow81['gpoProducto']) { echo '[' . $myrow81['gpoProducto'] . ']'; } ?> </span> </span></div></td> <td bgcolor="<?php echo $color; ?> " class="Estilo24"><div align="left"><span class="<?php echo $estilo; ?> "> <?php if ($_POST['tipoVista'] == 'Agrupado') { echo $cantidad = $myrow14['cantidad2']; } else { echo $cantidad = $myrow81['cantidad']; } ?> </span></div></td> <td bgcolor="<?php echo $color; ?> " class="Estilo24"><div align="left"><span class="<?php echo $estilo; ?> "> <span class="style12"><span class="style7"> <?php $importe = new acumulados(); echo $importe->importe($keyCAP, $basedatos); ?> </span></span> </span></div></td> <td bgcolor="<?php echo $color; ?> " class="<?php echo $estilo; ?> "><div align="left"><span class="style7"> <?php $mostrarIVA = new articulosDetalles(); echo $mostrarIVA->mostrarIVA($keyCAP, $basedatos); ?> </span></div></td> <td bgcolor="<?php echo $color; ?> " class="<?php echo $estilo; ?> "><div align="left"><span class="style7"> <span class="style12"> <?php $status = new acumulados(); echo $status->status($keyCAP, $basedatos, $usuario, $numeroE, $nCuenta); ?> </span></span></div></td> <td bgcolor="<?php echo $color; ?> " class="<?php echo $estilo; ?> "><div align="left"><span class="style7"><span class="style12"> <?php echo $myrow81['almacenSolicitante']; ?> </span></span></div></td> <td bgcolor="<?php echo $color; ?> " class="<?php echo $estilo; ?> "><div align="left"><span class="style7"><span class="style12"><?php echo $myrow81['almacenDestino']; ?> </span></span></div></td> <td bgcolor="<?php echo $color; ?> " class="<?php echo $estilo; ?> "><span class="Estilo24"><?php echo $myrow81['tipoCliente']; ?> </span></td> <td bgcolor="<?php echo $color; ?> " class="<?php echo $estilo; ?> "> <div align="left"><span class="style7"><span class="style12"> <?php echo $myrow81['naturaleza']; ?> </span> </span></div></td> <?php if ($myrow811['statusAlta'] == 'cxc') { $flagCxC = 'activa'; ?> <?php } else { if ($myrow811['status'] == 'pagado') { $flagCxC = 'inactiva'; ?> <?php } else { $flagCxC = 'inactiva'; ?> <?php } } ?> <?php if (($myrow811['statusAlta'] == 'efectivo' or !$myrow811['statusAlta']) and $myrow811['status'] != 'pagado') { ?> <?php } else { if ($myrow811['status'] == 'pagado') { ?> <?php } } ?> </tr> <?php } } }