$myrow3 = mysql_fetch_array($result3); $numeroE=$myrow3['numeroE']; $nCuenta=$myrow3['nCuenta']; $cuarto=$myrow3['cuarto']; //***************aplicar pago********************** if($_POST['aplicar'] and (is_numeric($_POST['porcentaje']) or $_POST['tipoTransaccion']) ){ if($_POST['porcentaje']){ if($_POST['cargosHospitalarios']=='si'){ $banderaPM=new acumulados(); $_POST['cantidadRecibida']=$banderaPM->banderaPorcentajeMedicamentos($entidad,$basedatos,$usuario,$numeroE,$nCuenta); $_POST['cantidadRecibida']=porcentaje($_POST['cantidadRecibida'],$_POST['porcentaje'],$decimales); } else { $_POST['cargosHospitalarios']='no'; $cargosGlobales=new acumulados(); $_POST['cantidadRecibida']=$cargosGlobales->cargosGlobalesCoaseguro($entidad,$basedatos,$usuario,$numeroE,$nCuenta); $_POST['cantidadRecibida']=porcentaje($_POST['cantidadRecibida'],$_POST['porcentaje'],$decimales); } } $cantidadRecibida=$_POST['cantidadRecibida']; $naturaleza='-';
public function eCuenta($bali, $transacciones, $TITULO, $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']; //********************CIERRO STATUS CUENTA*********************** $agrega = "UPDATE cargosCuentaPaciente set \r\nstatusCuenta='cerrada'\r\n\r\n\r\nwhere\r\nnumeroE='" . $numeroE . "' \r\nand\r\nnCuenta='" . $nCuenta . "'\r\n\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'; ?> <?php } if (!$_POST['tipoVista']) { $_POST['tipoVista'] = 'Detalle'; } ?> <?php if ($_POST['imprimir']) { ?> <script> javascript:ventanaSecundaria2('<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /cargos/imprimirCargosInternosCC.php?numeroE=<?php echo $numeroE; ?> &nCuenta=<?php echo $nCuenta; ?> &paciente=<?php echo $_POST['paciente']; ?> &numeroConfirmacion=<?php echo $numeroConfirmacion; ?> &hora1=<?php echo $hora1; ?> &keyClientesInternos=<?php echo $myrow3['keyClientesInternos']; ?> '); <!-- window.opener.document.forms["form1"].submit(); 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"> <head> <?php $showStyles = new muestraEstilos(); $showStyles->styles(); ?> </head> <BODY > <?php //ventanasPrototype::links(); ?> <h1 align="center"><?php echo $TITULO; ?> </h1> <form id="form1" name="form1" method="post" action=""> <table width="549" border="0" align="center" cellpadding="1" cellspacing="1" bordercolor="#990099" class="normal"> <tr> <th bgcolor="#660066" class="blanco" scope="col"><div align="left">Número de Transacción: </div></th> <th bgcolor="#660066" class="blanco" scope="col"><div align="left"><?php echo $nCliente = $myrow3['keyClientesInternos']; ?> <input name="numeroE" type="hidden" class="normal" id="numeroE" value="<?php echo $nCliente = $_POST['numeroE']; ?> " readonly=""/> </label></div> </th> </tr> <tr> <th width="134" bgcolor="#FFCCFF" class="normal" scope="col"><div align="left"><strong>Paciente: </strong></div></th> <th width="408" bgcolor="#FFCCFF" class="normal" scope="col"><div align="left"><strong> <label> </label> </strong> <?php echo $myrow3['paciente']; ?> </div></th> </tr> <tr> <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> <td bgcolor="#FFCCFF" class="normal">N° Credencial: </td> <td bgcolor="#FFCCFF" class="normal"><?php echo $myrow3['credencial']; ?> </td> </tr> <tr> <td class="normal">Fecha</td> <td class="normal"><span class="normal"> <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="normal" 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="normal" id="lanzador" value="..." /> Entre </label> <input name="fecha2" type="text" class="normal" 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="normal" id="lanzador1" value="..." /> <input name="show" type="submit" class="normal" id="show" value=">" /> <?php } else { ?> <input name="fecha3" type="hidden" class="normal" id="fecha2" value="<?php echo 'all'; ?> "/> <?php } ?> </label> </span></td> </tr> <tr> <th class="normal" scope="col"><div align="left"><strong>Médico: </strong></div></th> <th class="normal" scope="col"><div align="left"> <label> <?php echo $medico = $myrow3['medico']; ?> </label> <label> </label> <?php $sSQL18 = "Select * From medicos WHERE numMedico ='" . $medico . "'"; $result18 = mysql_db_query($basedatos, $sSQL18); $rNombre18 = mysql_fetch_array($result18); ?> <?php echo $dr = "Dr(a): " . $rNombre18["apellido1"] . " " . $rNombre18["apellido2"] . " " . $rNombre18["apellido3"] . " " . $rNombre18["nombre1"] . " " . $rNombre18["nombre2"]; ?> </div></th> </tr> <tr> <td bgcolor="#FFCCFF" class="normal">Tipo de Vista: </td> <td bgcolor="#FFCCFF" class="normal"><label> <select name="tipoVista" class="normal" id="tipoVista" onChange="javascript:form1.submit();"> <option>Escoje la Opción</option> <option <?php if ($_POST['tipoVista'] == 'Agrupado') { ?> selected="selected" <?php } ?> value="Agrupado">Agrupado</option> <option <?php if ($_POST['tipoVista'] == 'Detalle') { ?> selected="selected" <?php } ?> value="Detalle">Detalle</option> </select> </label></td> </tr> </table> <p> </p> <?php //compruebo el proceso de alta $sSQL32 = "Select * From procesoAlta WHERE (status='request' or status='cargado')\r\nand\r\nkeyClientesInternos='" . $_GET['nT'] . "'"; $result32 = mysql_db_query($basedatos, $sSQL32); $myrow32 = mysql_fetch_array($result32); ?> <?php if ($myrow32['numeroE']) { ?> <table width="471" border="0" align="center"> <tr> <th width="420" height="15" bgcolor="#660066" scope="col"><div align="left"><span class="blanco">Departamento </span></div></th> <th width="58" bgcolor="#660066" scope="col"><div align="left"><span class="blanco">Fecha</span></div></th> <th width="76" bgcolor="#660066" scope="col"><div align="left"><span class="blanco">Hora</span></div></th> <th width="37" bgcolor="#660066" scope="col"><div align="left"><span class="blanco">Usuario</span></div></th> <th width="56" bgcolor="#660066" scope="col"><div align="left"><span class="blanco">Status </span></div></th> </tr> <tr> <?php $sSQL = "Select * From almacenes WHERE entidad='" . $entidad . "'\r\n and\r\naltaPaciente='si'\r\norder by descripcion ASC\r\n"; if ($sSQL) { $result = mysql_db_query($basedatos, $sSQL); while ($myrow = mysql_fetch_array($result)) { if ($col) { $color = '#FFCCFF'; $col = ""; } else { $color = '#FFFFFF'; $col = 1; } $A = $myrow['almacen']; $sSQL661 = "Select * From procesoAlta \r\nWHERE\r\nentidad='" . $entidad . "'\r\nand\r\nstatus='cargado'\r\nand\r\nalmacen='" . $A . "'\r\nand\r\nkeyClientesInternos='" . $_GET['nT'] . "'"; $result661 = mysql_db_query($basedatos, $sSQL661); $myrow661 = mysql_fetch_array($result661); ?> <td bgcolor="<?php echo $color; ?> " class="normal"><span class="style71"><?php if ($myrow661['status']) { echo $myrow['descripcion']; } else { echo $myrow['descripcion'] . ' [No se ha completado el proceso de Cierre]'; } ?> </span></td> <td bgcolor="<?php echo $color; ?> " class="normal"><span class="style71"><?php if ($myrow661['fecha']) { echo cambia_a_normal($myrow661['fecha']); } ?> </span></td> <td bgcolor="<?php echo $color; ?> " class="normal"><span class="style71"><?php echo $myrow661['hora']; ?> </span></td> <td bgcolor="<?php echo $color; ?> " class="normal"><span class="style71"><?php echo $myrow661['usuario']; ?> </span></td> <td bgcolor="<?php echo $color; ?> " class="normal"><span class="style71"><?php if (!$myrow661['status']) { echo '<img src="' . CONSTANT_PATH_SIMA_RAIZ . '/imagenes/candado.png" alt="LA CUENTA ESTA EN REVISION" width="12" height="12" border="0">'; } else { echo '<img src="' . CONSTANT_PATH_SIMA_RAIZ . '/imagenes/solicitado.png" alt="LA CUENTA ESTA EN REVISION" width="12" height="12" border="0">'; } ?> <span class="normal"></span></span></td> </tr> <?php } } ?> </table> <?php } ?> <p> <?php if ($_POST['tipoVista']) { ?> </p> <table width="847" border="0" align="center"> <tr> <th width="96" height="14" bgcolor="#660066" class="blanco" scope="col"><div align="left"><span class="blanco ">Fecha/Hora </span></div></th> <th width="300" bgcolor="#660066" scope="col"><div align="left"><span class="blanco ">Descripción/Concepto</span></div></th> <th width="21" bgcolor="#660066" scope="col"><div align="left"><span class="blanco ">Cant</span></div></th> <th width="55" bgcolor="#660066" scope="col"><div align="left"><span class="blanco ">P.U.</span></div></th> <th width="55" bgcolor="#660066" scope="col"><div align="left"><span class="blanco ">Importe</span></div></th> <th width="33" bgcolor="#660066" scope="col"><div align="left"><span class="blanco ">IVA</span></div></th> <th width="27" bgcolor="#660066" scope="col"><div align="left"><span class="blanco ">Status</span></div></th> <th width="47" bgcolor="#660066" scope="col"><div align="left"><span class="blanco ">D Solicita</span></div></th> <th width="52" bgcolor="#660066" scope="col"><div align="left"><span class="blanco ">D Cargo.</span></div></th> <th width="72" bgcolor="#660066" scope="col"><div align="left"><span class="blanco ">Tipo P </span></div></th> <th width="38" bgcolor="#660066" scope="col"><div align="left"><span class="blanco ">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,tipoTransaccion,porcentajeVariable,cargosHospitalarios,descripcion,status,almacen,statusDevolucion\r\nFROM\r\ncargosCuentaPaciente \r\n WHERE keyClientesInternos='" . $_GET['nT'] . "'\r\n \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,tipoTransaccion,porcentajeVariable,cargosHospitalarios,descripcion,status,almacen,statusDevolucion\r\nFROM\r\ncargosCuentaPaciente \r\n WHERE \r\nkeyClientesInternos='" . $_GET['nT'] . "'\r\n \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,tipoTransaccion,porcentajeVariable,cargosHospitalarios,descripcion,status,almacen,statusDevolucion\r\nFROM\r\ncargosCuentaPaciente \r\n WHERE \r\nkeyClientesInternos='" . $_GET['nT'] . "'\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,tipoTransaccion,porcentajeVariable,cargosHospitalarios,descripcion,status,almacen,statusDevolucion\r\nFROM\r\ncargosCuentaPaciente \r\n WHERE \r\nkeyClientesInternos='" . $_GET['nT'] . "'\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)) { if ($col) { $color = '#FFCCFF'; $col = ""; } else { $color = '#FFFFFF'; $col = 1; } $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); } $style = 'normal'; ?> <tr> <td height="21" bgcolor="<?php echo $color; ?> " class="<?php echo $style; ?> "><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; ?> "> <div align="left"> <span class="<?php echo $style; ?> "> <?php $descripcion = new articulosDetalles(); $descripcion->descripcion($keyCAP, $numeroE, $nCuenta, $codigo, $basedatos); if ($myrow81['status'] != 'transaccion') { $nombreMed = new nombreMedico(); //echo " ".$myrow81['descripcion'].$nombreMed->nombreMed($myrow81['almacen'],$basedatos); } ?> <?php if ($myrow81['gpoProducto']) { echo '[' . $myrow81['gpoProducto'] . ']'; } ?> </span> </div></td> <td bgcolor="<?php echo $color; ?> " class="<?php echo $style; ?> "><div align="left"> <?php if ($_POST['tipoVista'] == 'Agrupado') { echo $cantidad = $myrow14['cantidad2']; } else { echo $cantidad = $myrow81['cantidad']; } ?> </div></td> <td bgcolor="<?php echo $color; ?> " ><?php if ($myrow81['naturaleza'] == 'C') { echo '$' . number_format($myrow81['precioVenta'], 2); } else { echo '---'; } ?> </td> <td bgcolor="<?php echo $color; ?> " ><div align="left"><span class="<?php echo $style; ?> "> <?php if ($myrow81['cargosHospitalarios']) { $tipoTransaccion = $myrow81['tipoTransaccion']; $sSQL6 = "\r\n\tSELECT \r\nvariable\r\nFROM\r\ncatTTCaja\r\nWHERE \r\ncodigoTT = '" . $tipoTransaccion . "'\r\nand\r\nvariable='si'\r\n"; $result6 = mysql_db_query($basedatos, $sSQL6); $myrow6 = mysql_fetch_array($result6); if ($myrow6['variable']) { if ($myrow81['cargosHospitalarios'] == 'si') { $banderaPM = new acumulados(); $precioVentaC = $banderaPM->banderaPorcentajeMedicamentos($entidad, $basedatos, $usuario, $numeroE, $nCuenta); $precioVentaC = porcentaje($precioVentaC, $myrow81['porcentajeVariable'], $a); } else { $cargosAseguradora = new acumulados(); $precioVentaC = $cargosAseguradora->cargosAseguradora($basedatos, $usuario, $numeroE, $nCuenta); $precioVentaC = porcentaje($precioVentaC, $myrow81['porcentajeVariable'], $a); } //Actualiza $q1 = "UPDATE cargosCuentaPaciente set \r\nprecioVenta='" . $precioVentaC . "'\r\nWHERE \r\nkeyCAP='" . $keyCAP . "'"; //mysql_db_query($basedatos,$q1); echo mysql_error(); } } ?> <?php $importe = new acumulados(); echo $importe->importe($keyCAP, $basedatos); ?> </span></div></td> <td bgcolor="<?php echo $color; ?> " > <div align="left"> <span class="<?php echo $style; ?> "> <?php $mostrarIVA = new articulosDetalles(); echo $mostrarIVA->mostrarIVA($keyCAP, $basedatos); ?> </span></div></td> <td bgcolor="<?php echo $color; ?> " class="<?php echo $style; ?> "><div align="left"> <?php $status = new acumulados(); echo $status->status($keyCAP, $basedatos, $usuario, $numeroE, $nCuenta); ?> </div></td> <td bgcolor="<?php echo $color; ?> " class="<?php echo $style; ?> "><div align="left"> <?php echo $myrow81['almacenSolicitante']; ?> </div></td> <td bgcolor="<?php echo $color; ?> " class="<?php echo $style; ?> "><div align="left"><?php echo $myrow81['almacenDestino']; ?> </div></td> <td bgcolor="<?php echo $color; ?> " class="<?php echo $style; ?> "><?php echo $myrow81['tipoCliente']; ?> </td> <td bgcolor="<?php echo $color; ?> " class="<?php echo $style; ?> "> <div align="left"> <?php echo $myrow81['naturaleza']; ?> </div></td> </tr> <?php } ?> </table> <p> </p> <p> <input name="recibo" type="hidden" id="recibo" value="<?php echo $nCliente = $_POST['numeroE']; ?> " /> <input name="nCliente" type="hidden" id="nCliente" value="<?php echo $nCliente; ?> " /> <input name="almacen" type="hidden" id="almacen" value="<?php echo $ALMACEN; ?> " /> </p> <div align="center"> <div align="left"> <p> </p> <?php $mostrarCuadroGP = new cuadritoAcumuladoGPO(); echo $mostrarCuadroGP->mostrarCuadrito($_POST['fecha'], $_POST['fecha2'], 'normal', $entidad, $numeroE, $nCuenta, $basedatos); ?> <p> </p> <p> </p> </div> <p> </p> <table width="239" border="0" align="center" class="normal"> <tr> <td width="141" height="23" class="normal">Total por Surtir (iva incluido ) </td> <td width="88" class="normal"><div align="right"> <?php $totalxSurtir = new acumulados(); echo "\$" . number_format($totalxSurtir->totalxSurtir($basedatos, $usuario, $numeroE, $nCuenta), 2); ?> </div></td> </tr> </table> <p> </p> <p> </p> <table width="239" border="0" align="left" class="normal"> <tr> <td width="139" height="23" class="normal">IVA</td> <td width="90" class="normal"><div align="right"> <?php $iva = new acumulados(); $iva = $iva->ivaAcumulado($basedatos, $usuario, $numeroE, $nCuenta); echo "\$" . number_format($iva, 2); ?> </div></td> </tr> <tr bgcolor="#FFCCFF"> <td height="23" class="normal">Total Cargos </td> <td class="normal"><div align="right"> <?php $totalAcumulado = new acumulados(); $cargoS = $totalAcumulado->totalAcumulado($basedatos, $usuario, $numeroE, $nCuenta); echo "\$" . number_format($totalAcumulado->totalAcumulado($basedatos, $usuario, $numeroE, $nCuenta) + $coaseguro, 2); ?> </div></td> </tr> </table> <p> </p> <p> </p> <p align="left"> </p> <table width="239" border="0" align="left" > <tr bgcolor="#FFCCFF"> <td width="141" height="23" class="normal"><span class="normal">Total Abonos</span></td> <td width="88" class="normal"> <div align="right"> <?php $abonos = new acumulados(); $abonoS = $abonos->abonos($basedatos, $usuario, $numeroE, $nCuenta); echo "\$" . number_format($abonos->abonos($basedatos, $usuario, $numeroE, $nCuenta), 2); ?> </div> </td> </tr> <tr> <td height="23" class="normal">Saldo Actual </td> <td class="normal"><div align="right"> <?php $totalCargos = new acumulados(); $totalCargos = $totalCargos->total($totalAcumulado->totalAcumulado($basedatos, $usuario, $numeroE, $nCuenta), $abonos->abonos($basedatos, $usuario, $numeroE, $nCuenta), $numeroE1, $nCuenta1); if ($abonoS < 0) { $abonoS *= -1; } $STotal = $cargoS - $abonoS; echo "\$" . number_format($cargoS - $abonoS, 2); /* if(!$STotal and eregi('-',$STotal)){ echo 'step'; } */ /* if(($cargoS-$abonoS>0){ echo "$".number_format($cargoS-$abonoS,2); } else { echo "$".number_format(($cargoS-$abonoS)*-1,2); } */ ?> </div></td> </tr> </table> <?php if ($myrow3['status'] != 'cerrada') { ?> <p> </p> <p> </p> <p> </p> <p> </p> <p> </p> <table width="86%" border="0" cellspacing="0" cellpadding="0"> <tr> <th width="15%" scope="col"> <table width="94" border="0" align="left"> <tr bgcolor="#660066"> <th class="blanco" scope="col"> <span class="blanco">Particular<a href="#" onClick="javascript:ventanaSecundaria7('<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /INGRESOS%20HLC/caja/ventanaAplicaPagoInternos.php?numeroE=<?php echo $numeroE; ?> &almacen=<?php echo $bali; ?> &seguro=<?php echo $_POST['seguro']; ?> &nCuenta=<?php echo $myrow3['keyClientesInternos']; ?> &tipoCliente=<?php echo 'particular'; ?> ')"> </a></span></th> </tr> <tr> <th width="98" bgcolor="#660066" class="blanco" scope="col"><span class="blanco"> <span class="blanco">Total a pagar </span> </span></th> </tr> <tr> <td><div align="center"><span class="normal"> <span class="normal"> <?php //echo "$".number_format($cargosParticulares->cargosParticulares($basedatos,$usuario,$numeroE,$nCuenta),2); $cargosParticulares = new acumulados(); $T = $cargosParticulares->cargosParticulares($basedatos, $usuario, $numeroE, $nCuenta); // $T=round($T,$ase); if ($T and $transacciones == 'si') { ?> <a href="#" onClick="javascript:ventanaSecundaria7('<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /INGRESOS%20HLC/caja/ventanaAplicaPagoInternos.php?almacenFuente=<?php echo $bali; ?> &numeroE=<?php echo $numeroE; ?> &almacen=<?php echo $bali; ?> &seguro=<?php echo $_POST['seguro']; ?> &nCuenta=<?php echo $myrow3['keyClientesInternos']; ?> &tipoCliente=<?php echo 'particular'; ?> &tipoVenta=<?php echo 'interno'; ?> &tipoMovimiento=<?php echo 'transaccion'; ?> &tipoPago=Efectivo')"> <?php echo "\$" . number_format($cargosParticulares->cargosParticulares($basedatos, $usuario, $numeroE, $nCuenta), 2); ?> </a> <?php } else { echo "\$" . number_format($cargosParticulares->cargosParticulares($basedatos, $usuario, $numeroE, $nCuenta), 2); } ?> </span></span></div></td> </tr> </table> </th> <th width="2%" scope="col"> </th> <th width="15%" scope="col"><table width="94" border="0" align="center"> <tr> <th bgcolor="#660066" scope="col"><span class="blanco">Otros Clientes </span></th> </tr> <tr> <th width="88" bgcolor="#660066" scope="col"><span class="blanco">Total a pagar </span></th> </tr> <tr> <td><div align="center"><span class="normal"> <?php $otros = new acumulados(); if ($otros->otros($basedatos, $usuario, $numeroE, $nCuenta) > 0) { ?> <a href="#" onClick="javascript:ventanaSecundaria7('<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /INGRESOS%20HLC/caja/ventanaAplicaPagoInternos.php?numeroE=<?php echo $numeroE; ?> &almacen=<?php echo $bali; ?> &almacenFuente=<?php echo $bali; ?> &seguro=<?php echo $_POST['seguro']; ?> &nCuenta=<?php echo $myrow3['keyClientesInternos']; ?> &tipoCliente=<?php echo 'otros'; ?> &tipoVenta=<?php echo 'interno'; ?> &tipoMovimiento=<?php echo 'transaccion'; ?> ')"> <?php echo "\$" . number_format($otros->otros($basedatos, $usuario, $numeroE, $nCuenta), 2); ?> </a> <?php } else { echo "\$" . number_format($otros->otros($basedatos, $usuario, $numeroE, $nCuenta), 2); } ?> </span></div></td> </tr> </table></th> <th width="31%" scope="col"> </th> <th width="2%" scope="col"> </th> <th width="5%" scope="col"> </th> <th width="16%" scope="col"><table width="94" border="0"> <tr> <th bgcolor="#660066" scope="col"><span class="blanco">D.Coaseguro </span></th> </tr> <tr> <th width="88" bgcolor="#660066" scope="col"><span class="blanco">Total a pagar </span></th> </tr> <tr> <td><div align="center"><span class="normal"> <?php $coaseguro = new acumulados(); if ($coaseguro->cargosCoaseguro($basedatos, $usuario, $numeroE, $nCuenta) > 0) { ?> <a href="#" onClick="javascript:ventanaSecundaria7('<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /INGRESOS%20HLC/caja/ventanaAplicaPagoInternos.php?numeroE=<?php echo $numeroE; ?> &almacen=<?php echo $bali; ?> &almacenFuente=<?php echo $bali; ?> &seguro=<?php echo $_POST['seguro']; ?> &nCuenta=<?php echo $myrow3['keyClientesInternos']; ?> &tipoCliente=<?php echo 'coaseguro'; ?> &tipoVenta=<?php echo 'interno'; ?> &tipoMovimiento=<?php echo 'transaccion'; ?> ')"> <?php echo "\$" . number_format($coaseguro->cargosCoaseguro($basedatos, $usuario, $numeroE, $nCuenta), 2); ?> </a> <?php } else { echo "\$" . number_format($coaseguro->cargosCoaseguro($basedatos, $usuario, $numeroE, $nCuenta), 2); } ?> </span></div></td> </tr> </table></th> <th width="14%" scope="col"><table width="94" border="0" align="right"> <tr> <th bgcolor="#660066" scope="col"><span class="blanco"> Compañía <?php //echo "$".number_format($Tcargos,2); ?> <?php //echo "$".number_format( $Tabonos,2); $t1 = $TOTAL + $Tiva; ?> <?php //echo "$".number_format($deposito[0],2); //echo "Pago por Otros"; $t2 = $Tabonos; ?> </span></th> </tr> <tr> <th width="172" bgcolor="#660066" class="blanco" scope="col">Saldo Cia. </th> </tr> <tr> <td><span class="normal"> <?php $cargosAseguradora = new acumulados(); if ($cargosAseguradora->cargosAseguradora($basedatos, $usuario, $numeroE, $nCuenta) != null and $transacciones == 'si') { ?> <a href="#" onClick="javascript:ventanaSecundaria7('<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /INGRESOS%20HLC/caja/ventanaAplicaPagoInternos.php?numeroE=<?php echo $numeroE; ?> &almacen=<?php echo $bali; ?> &almacenFuente=<?php echo $bali; ?> &seguro=<?php echo $_POST['seguro']; ?> &nCuenta=<?php echo $myrow3['keyClientesInternos']; ?> &tipoCliente=<?php echo 'aseguradora'; ?> &tipoVenta=<?php echo 'interno'; ?> ')"> <?php echo "\$" . number_format($cargosAseguradora->cargosAseguradora($basedatos, $usuario, $numeroE, $nCuenta), 2); ?> </a> <?php } else { echo "\$" . number_format($cargosAseguradora->cargosAseguradora($basedatos, $usuario, $numeroE, $nCuenta), 2); } ?> </span> </td> </tr> </table></th> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> </table> <p> </p> </div> <?php if (($cargosParticulares->cargosParticulares($basedatos, $usuario, $numeroE, $nCuenta) == NULL or $cargosParticulares->cargosParticulares($basedatos, $usuario, $numeroE, $nCuenta) == 0) and ($totalxSurtir->totalxSurtir($basedatos, $usuario, $numeroE, $nCuenta) == NULL or $totalxSurtir->totalxSurtir($basedatos, $usuario, $numeroE, $nCuenta) == 0) and ($otros->otros($basedatos, $usuario, $numeroE, $nCuenta) == NULL or $otros->otros($basedatos, $usuario, $numeroE, $nCuenta) == 0) and ($cargosAseguradora->cargosAseguradora($basedatos, $usuario, $numeroE, $nCuenta) == NULL or $cargosAseguradora->cargosAseguradora($basedatos, $usuario, $numeroE, $nCuenta) == 0)) { ?> <p align="center"> <?php if (!$myrow661['status']) { ?> <input name="faltan" type="submit" class="normal" id="cerrar" value="Faltan Departamentos" disabled=""/> <?php } else { ?> <input name="cerrar" type="submit" class="normal" id="cerrar" value="Cerrar Cuenta" /> <?php } //cierra validaciones de proceso de cierre de departamentos ?> <input name="keyClientesInternos" type="hidden" id="keyClientesInternos" value="<?php echo $myrow3['keyClientesInternos']; ?> " /> </p> <div align="center"> <?php } ?> <?php } else { echo "LA CUENTA DEL PACIENTE " . $myrow3['paciente'] . " ESTA CERRADA..."; ?> <input name="imprimir" type="submit" class="normal" id="imprimir" value="Imprimir" /> <?php } ?> </div> </form> <?php } ?> <p align="center"> </p> <?php if ($_POST['banderaFecha']) { ?> <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> <script type="text/javascript"> Calendar.setup({ inputField : "campo_fecha1", // id del campo de texto ifFormat : "%Y-%m-%d", // formato de la fecha que se escriba en el campo de texto button : "lanzador1" // el id del bot�n que lanzar� el calendario }); </script> <?php } } ?> </body> </html> <?php }
public function subCuenta($bali, $tipoCliente, $TITULO, $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=800,height=600,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['escoje']) { $keyCAP = $_POST['keyCAP']; $solicita = $_POST['solicita']; $solicita1 = $_POST['solicita1']; for ($i = 0; $i <= $_POST['bandera']; $i++) { $sSQL34 = "Select statusFactura From cargosCuentaPaciente WHERE keyCAP='" . $solicita[$i] . "' "; $result34 = mysql_db_query($basedatos, $sSQL34); $myrow34 = mysql_fetch_array($result34); if ($solicita[$i]) { if ($myrow34['statusFactura'] == 'standby') { $agrega = "UPDATE cargosCuentaPaciente set \r\n\r\nstatusFactura='request'\r\nwhere\r\nkeyCAP='" . $solicita[$i] . "' \r\n"; } mysql_db_query($basedatos, $agrega); echo mysql_error(); } } //cierra for } //cierra actualizar if ($_POST['quitar']) { $keyCAP = $_POST['keyCAP']; $solicita1 = $_POST['solicita1']; for ($i = 0; $i <= $_POST['bandera']; $i++) { $sSQL34 = "Select statusFactura From cargosCuentaPaciente WHERE keyCAP='" . $solicita1[$i] . "' "; $result34 = mysql_db_query($basedatos, $sSQL34); $myrow34 = mysql_fetch_array($result34); if ($solicita1[$i]) { if ($myrow34['statusFactura'] == 'request') { $agrega = "UPDATE cargosCuentaPaciente set \r\nstatusFactura='standby'\r\nwhere\r\nkeyCAP='" . $solicita1[$i] . "' \r\n"; } mysql_db_query($basedatos, $agrega); echo mysql_error(); } } //cierra for } //cierra quitar ?> <?php if ($_POST['facturar']) { if ($_POST['cantidadSolicitada']) { if ($_POST['cantidadSolicitada'] <= $_POST['cantidadActual']) { $porcentaje = $_POST['cantidadSolicitada'] / $_POST['cantidadActual']; $agrega = "INSERT INTO cargosFacturados (nt, cantidadFacturada,porcentaje,usuario,fecha,tipoCliente,seguro) values('" . $_GET['nT'] . "','" . $_POST['cantidadSolicitada'] . "','" . $porcentaje . "','" . $usuario . "','" . $fecha . "','" . $_GET['tipoCliente'] . "','" . $myrow3['seguro'] . "')"; mysql_db_query($basedatos, $agrega); echo mysql_error(); ?> <script> javascript:ventanaSecundaria6('<?php echo CONSTANT_PATH_SIMA_RAIZ; ?> /cargos/applyInvoice.php?nT=<?php echo $nT; ?> &tipoFacturacion=<?php echo $tipoFacturacion; ?> &tipoCliente=<?php echo $_POST['tipoCliente']; ?> &porcentaje=<?php echo $porcentaje; ?> '); </script> <?php /* <script> javascript:ventanaSecundaria6('/sima/cargos/applyInvoice.php?nT=<?php echo $nT;?>&tipoFacturacion=<?php echo $tipoFacturacion;?>&tipoCliente=<?php echo $_POST['tipoCliente'];?>&porcentaje=<?php echo $porcentaje;?>'); </script> */ } else { $leyenda = 'La cantidad no debe ser mayor a la q existe!'; } } else { $leyenda = 'Escribe la cantidad!'; } } ?> <!-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} .style72 {font-size: 10px} .style72 {font-size: 10px} .style1 {color: #FF0000} .style73 {color: #FF0000} .style73 {color: #FF0000;font-size: 9px} .style74 {color: #FF0000} .style74 {color: #FF0000;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; } .style1 {color: #FF0000;font-size: 9px} --> </style> </head> <style type="text/css"> <!-- .style12 {font-size: 10px} .style14 {font-size: 10px; color: #FFFFFF; } .style21 {color: #FF0000} --> </style> <BODY > <h1 align="center"><?php echo $TITULO; ?> </h1> <form id="form1" name="form1" method="post" action=""> <table width="549" border="0" align="center" cellpadding="1" cellspacing="1" bordercolor="#990099" class="Estilo24"> <tr> <th bgcolor="#660066" class="style14" scope="col"><div align="left">Número de Transacción: </div></th> <th bgcolor="#660066" class="style14" scope="col"><div align="left"><?php echo $nCliente = $myrow3['keyClientesInternos']; ?> <input name="numeroE" type="hidden" class="Estilo24" id="numeroE" value="<?php echo $nCliente = $_POST['numeroE']; ?> " readonly=""/> </label></div> </th> </tr> <tr> <th width="134" bgcolor="#FFCCFF" class="Estilo24" scope="col"><div align="left"><strong>Paciente: </strong></div></th> <th width="408" bgcolor="#FFCCFF" class="Estilo24" scope="col"><div align="left"><strong> <label> </label> </strong> <?php echo $myrow3['paciente']; ?> </div></th> </tr> <tr> <td class="Estilo24">Compañía: </td> <td class="Estilo24"><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> <td bgcolor="#FFCCFF" class="Estilo24">N° Credencial: </td> <td bgcolor="#FFCCFF" class="Estilo24"><?php echo $myrow3['credencial']; ?> </td> </tr> <tr> <th class="Estilo24" scope="col"><div align="left"><strong>Médico: </strong></div></th> <th class="Estilo24" scope="col"><div align="left"> <label> <?php echo $medico = $myrow3['medico']; ?> </label> <label> </label> <?php $sSQL18 = "Select * From medicos WHERE numMedico ='" . $medico . "'"; $result18 = mysql_db_query($basedatos, $sSQL18); $rNombre18 = mysql_fetch_array($result18); ?> <?php echo $dr = "Dr(a): " . $rNombre18["apellido1"] . " " . $rNombre18["apellido2"] . " " . $rNombre18["apellido3"] . " " . $rNombre18["nombre1"] . " " . $rNombre18["nombre2"]; ?> </div></th> </tr> </table> <p> </p> <p align="center"> <label></label> </p> <?php $sSQL341 = "Select sum(cantidadFacturada) as cantidadF From cargosFacturados WHERE nT='" . $_GET['nT'] . "' "; $result341 = mysql_db_query($basedatos, $sSQL341); $myrow341 = mysql_fetch_array($result341); ?> <p align="center"> </p> <table width="669" border="0" align="center"> <tr> <th width="54" bgcolor="#660066" class="style14" scope="col"><div align="left"><span class="style12 ">#MOV </span></div></th> <th width="87" height="14" bgcolor="#660066" class="style14" scope="col"><div align="left"><span class="style12 ">Fecha/Hora </span></div></th> <th width="246" bgcolor="#660066" class="style14" scope="col"><div align="left"><span class="style12 ">Descripción/Concepto</span></div></th> <th width="56" bgcolor="#660066" class="style14" scope="col"><div align="left"><span class="style12 ">Cant</span></div></th> <th width="53" bgcolor="#660066" class="style14" scope="col"><div align="left"><span class="style12 ">Importe</span></div></th> <th width="85" bgcolor="#660066" class="style14" scope="col"><div align="left"><span class="style12 ">Importe</span>Facturado</div></th> <th width="34" bgcolor="#660066" class="style14" scope="col"><div align="left"><span class="style12 ">Escojer </span></div></th> <th width="20" bgcolor="#660066" class="style14" scope="col"><div align="left"></div></th> </tr> <?php //traigo agregados if ($tipoCliente == 'aseguradora') { $sSQL81 = "\r\nSELECT \r\n* FROM\r\ncargosCuentaPaciente \r\n WHERE \r\n numeroE = '" . $numeroE . "'\r\n \r\n and nCuenta='" . $nCuenta . "'\r\nand\r\nstatus!='transaccion'\r\nand \r\nstatusTraslado='trasladado'\r\nand\r\ntipoCliente='" . $tipoCliente . "'\r\n\r\n \r\n \r\n order by fecha1,hora1 asc\r\n"; } else { $sSQL81 = "\r\nSELECT \r\n* FROM\r\ncargosCuentaPaciente \r\n WHERE \r\n numeroE = '" . $numeroE . "'\r\n \r\n and nCuenta='" . $nCuenta . "'\r\nand\r\nstatus!='transaccion'\r\n\r\n\r\n\r\n \r\n \r\n order by fecha1,hora1 asc\r\n"; } $result81 = mysql_db_query($basedatos, $sSQL81); while ($myrow81 = mysql_fetch_array($result81)) { $a += '1'; $art = $myrow81['codProcedimiento']; $codigo = $proc = $myrow81['codProcedimiento']; $keyCAP = $myrow81['keyCAP']; ?> <tr> <td bgcolor="<?php echo $color; ?> " class="Estilo24"><div align="left"><span class="<?php echo $estilo; ?> "><?php echo $myrow81['keyCAP']; ?> </span> <label> <input name="keyCAP[]" type="hidden" id="keyCAP[]" value="<?php echo $keyCAP; ?> " /> </label> </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($keyCAP, $numeroE, $nCuenta, $codigo, $basedatos); if ($myrow81['status'] != 'transaccion') { $nombreMed = new nombreMedico(); echo " " . $myrow81['descripcion'] . $nombreMed->nombreMed($medico, $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; ?> "> <?php if ($myrow81['cargosHospitalarios']) { $tipoTransaccion = $myrow81['tipoTransaccion']; $sSQL6 = "\r\n\tSELECT \r\nvariable\r\nFROM\r\ncatTTCaja\r\nWHERE \r\ncodigoTT = '" . $tipoTransaccion . "'\r\nand\r\nvariable='si'\r\n"; $result6 = mysql_db_query($basedatos, $sSQL6); $myrow6 = mysql_fetch_array($result6); if ($myrow6['variable']) { if ($myrow81['cargosHospitalarios'] == 'si') { $banderaPM = new acumulados(); $precioVentaC = $banderaPM->banderaPorcentajeMedicamentos($entidad, $basedatos, $usuario, $numeroE, $nCuenta); $precioVentaC = porcentaje($precioVentaC, $myrow81['porcentajeVariable'], $a); } else { $cargosAseguradora = new acumulados(); $precioVentaC = $cargosAseguradora->cargosAseguradora($basedatos, $usuario, $numeroE, $nCuenta); $precioVentaC = porcentaje($precioVentaC, $myrow81['porcentajeVariable'], $a); } //Actualiza $q1 = "UPDATE cargosCuentaPaciente set \r\nprecioVenta='" . $precioVentaC . "'\r\nWHERE \r\nkeyCAP='" . $keyCAP . "'"; //mysql_db_query($basedatos,$q1); echo mysql_error(); } } ?> <span class="style12"><span class="style7"> <?php $cantidadActual[0] += $myrow81['precioVenta'] * $myrow81['cantidad'] + $myrow81['iva'] * $myrow81['cantidad']; echo "\$" . number_format($cantidadActual[0], 2); ?> </span></span> </span></div></td> <td bgcolor="<?php echo $color; ?> " class="<?php echo $estilo; ?> "> </td> <td bgcolor="<?php echo $color; ?> " class="<?php echo $estilo; ?> "> <?php if ($myrow81['statusFactura'] == 'standby') { ?> <input name="solicita[]" type="checkbox" id="solicita[]" value="<?php echo $keyCAP; ?> " /> <?php } ?> </td> <td bgcolor="<?php echo $color; ?> " class="<?php echo $estilo; ?> "> <div align="left"> <label> <?php if ($myrow81['statusFactura'] == 'request') { $b += 1; ?> <input name="solicita1[]" type="checkbox" id="solicita1[]" value="<?php echo $keyCAP; ?> " /> <?php } ?> </label> </div></td> </tr> <?php } ?> </table> <table width="671" border="0" align="center" cellpadding="1" cellspacing="1"> <tr> <th width="92" scope="col"> </th> <th width="92" scope="col"> </th> <th width="92" scope="col"> </th> <th width="170" scope="col"> </th> <th width="57" scope="col"> </th> <th width="84" scope="col"><div align="left"><span class="style71"> <?php echo "\$" . number_format($myrow341['cantidadF'], 2); ?> </span></div></th> <th width="37" scope="col"> </th> <th width="22" scope="col"> </th> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> </table> <p> </p> <table width="53%" border="3" align="center" cellpadding="1" cellspacing="1" class="style71"> <tr> <th width="18%" scope="col"><span class="style72">Cantidad</span></th> <th width="23%" scope="col"> <input name="cantidadSolicitada" type="text" class="style71" id="cantidadSolicitada" value="<?php echo $cantidadActual[0]; ?> "></th> <th width="59%" scope="col"> <span class="style74"><blink><?php echo $leyenda; ?> </blink></span></th> </tr> </table> <p align="center"> </p> <p align="center"> <?php if ($myrow341['cantidadF']) { echo 'Tienes disponible para facturar: ' . '$' . number_format(ltrim($cantidadActual[0]) - ltrim($myrow341['cantidadF']), 2); $cActual = number_format(ltrim($cantidadActual[0]) - ltrim($myrow341['cantidadF']), 2); } else { $cActual = $cantidadActual[0] + $cantidadIva[0]; } ?> </p> <p align="center"> <label> <input name="tipoCliente" type="hidden" id="tipoCliente" value="<?php echo $_GET['tipoCliente']; ?> " /> <input name="bandera" type="hidden" id="bandera" value="<?php echo $a; ?> "> <input name="escoje" type="submit" class="style7" id="escoje" value="Escoje" /> </label> <input name="quitar" type="submit" class="style71" id="quitar" value="Quitar" /> </p> <p align="center"> <?php if ($b > 0) { ?> <input name="facturar" type="submit" class="style71" id="nuevo" value="Solicitar Facturar" <?php if (!$cActual) { echo 'disabled=""'; } ?> /> <?php } ?> <input name="cantidadActual" type="hidden" id="cantidadActual" value="<?php echo $cActual; ?> " /> </p> </form> <p align="center"> </p> </body> </html> <?php }
public function subCuenta($ID_EJERCICIO, $folioFactura, $bali, $tipoCliente, $TITULO, $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=800,height=600,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> <?php //************************ACTUALIZO ********************** //********************Llenado de datos if (!$_GET['nT']) { $_GET['nT'] = $nT; } if (!$bali) { $bali = $_GET['almacenFuente']; } $sSQL3 = "Select * From RFC WHERE entidad='" . $entidad . "' and RFC = '" . $_GET['rfc'] . "' "; $result3 = mysql_db_query($basedatos, $sSQL3); $myrow3 = mysql_fetch_array($result3); //***************aplicar pago********************** if ($_POST['escoje']) { $keyCAP = $_POST['keyCAP']; $solicita = $_POST['solicita']; $solicita1 = $_POST['solicita1']; for ($i = 0; $i <= $_POST['bandera']; $i++) { $sSQL34 = "Select statusFactura From cargosCuentaPaciente WHERE keyCAP='" . $solicita[$i] . "' "; $result34 = mysql_db_query($basedatos, $sSQL34); $myrow34 = mysql_fetch_array($result34); if ($solicita[$i]) { if ($myrow34['statusFactura'] == 'solicita') { $agrega = "UPDATE cargosCuentaPaciente set \r\n\r\nstatusFactura='standby'\r\nwhere\r\nkeyCAP='" . $solicita[$i] . "' \r\n"; } mysql_db_query($basedatos, $agrega); echo mysql_error(); } } //cierra for } //cierra actualizar ?> <?php /* echo '<script language="JavaScript" type="text/javascript"> <!-- window.opener.document.forms["form1"].submit(); self.close(); // --> </script>';*/ if ($_POST['facturar']) { if ($_POST['cantidadSolicitada']) { if ($_POST['cantidadSolicitada'] <= $_POST['cantidadActual']) { $porcentaje = $_POST['cantidadSolicitada'] / $_POST['cantidadActual']; $agrega = "INSERT INTO cargosFacturados (numFactura,cantidadFacturada,porcentaje,usuario,fecha,tipoCliente,seguro,nT) values('" . $_GET['folioFactura'] . "','" . $_POST['cantidadSolicitada'] . "','" . $porcentaje . "','" . $usuario . "','" . $fecha . "','" . $_GET['tipoCliente'] . "','" . $myrow3['seguro'] . "','" . $_GET['nT'] . "')"; mysql_db_query($basedatos, $agrega); echo mysql_error(); echo '<script language="JavaScript" type="text/javascript"> <!-- window.opener.document.forms["form1"].submit(); self.close(); // --> </script>'; } else { $leyenda = 'La cantidad no debe ser mayor a la q existe!'; } } else { $leyenda = 'Escribe la cantidad!'; } } ?> <!-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} .style72 {font-size: 10px} .style72 {font-size: 10px} .style1 {color: #FF0000} .style73 {color: #FF0000} .style73 {color: #FF0000;font-size: 9px} .style74 {color: #FF0000} .style74 {color: #FF0000;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; } .style1 {color: #FF0000;font-size: 9px} --> </style> </head> <style type="text/css"> <!-- .style12 {font-size: 10px} .style14 {font-size: 10px; color: #FFFFFF; } .style21 {color: #FF0000} --> </style> <BODY > <h1 align="center"><?php echo $TITULO; ?> </h1> <form id="form1" name="form1" method="post" action=""> <table width="264" border="0" align="center" cellpadding="1" cellspacing="1" bordercolor="#990099" class="Estilo24"> <tr> <th width="134" bgcolor="#660066" class="style14" scope="col"><div align="left">Factura </div></th> <th width="408" bgcolor="#660066" class="style14" scope="col"> <div align="left"> <input name="folioFactura" type="hidden" class="Estilo24" id="folioFactura" value="<?php echo $_GET['folioFactura']; ?> " readonly=""/> <?php echo $_GET['folioFactura']; ?> </div></th> </tr> </table> <p> <label></label><?php $sSQL341 = "Select sum(cantidadFacturada) as cantidadF From cargosFacturados WHERE numFactura='" . $_GET['folioFactura'] . "' "; $result341 = mysql_db_query($basedatos, $sSQL341); $myrow341 = mysql_fetch_array($result341); ?> </p> <p align="center"> </p> <table width="607" border="0" align="center"> <tr> <th width="54" bgcolor="#660066" class="style14" scope="col"><div align="left"><span class="style12 "># Registro </span></div></th> <th width="87" height="14" bgcolor="#660066" class="style14" scope="col"><div align="left"><span class="style12 ">Fecha/Hora </span></div></th> <th width="246" bgcolor="#660066" class="style14" scope="col"><div align="left"><span class="style12 ">Descripción/Concepto</span></div></th> <th width="56" bgcolor="#660066" class="style14" scope="col"><div align="left"><span class="style12 ">Cant</span></div></th> <th width="53" bgcolor="#660066" class="style14" scope="col"><div align="left"><span class="style12 ">Importe</span></div></th> <th width="85" bgcolor="#660066" class="style14" scope="col"><div align="left"><span class="style12 ">Importe</span>Facturado</div></th> </tr> <?php //traigo agregados $sSQL81 = "\r\nSELECT \r\n* FROM\r\ncargosCuentaPaciente \r\n WHERE \r\n entidad='" . $entidad . "'\r\n and\r\n folioFactura='" . $_GET['folioFactura'] . "'\r\n \r\n \r\n order by fecha1,hora1 asc\r\n"; $result81 = mysql_db_query($basedatos, $sSQL81); while ($myrow81 = mysql_fetch_array($result81)) { $a += '1'; $art = $myrow81['codProcedimiento']; $codigo = $proc = $myrow81['codProcedimiento']; $keyCAP = $myrow81['keyCAP']; ?> <tr> <td bgcolor="<?php echo $color; ?> " class="Estilo24"><div align="left"><span class="<?php echo $estilo; ?> "><?php echo $myrow81['keyCAP']; ?> </span> <label> <input name="keyCAP[]" type="hidden" id="keyCAP[]" value="<?php echo $keyCAP; ?> " /> </label> </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($keyCAP, $numeroE, $nCuenta, $codigo, $basedatos); if ($myrow81['status'] != 'transaccion') { $nombreMed = new nombreMedico(); echo " " . $myrow81['descripcion'] . $nombreMed->nombreMed($medico, $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; ?> "> <?php if ($myrow81['cargosHospitalarios']) { $tipoTransaccion = $myrow81['tipoTransaccion']; $sSQL6 = "\r\n\tSELECT \r\nvariable\r\nFROM\r\ncatTTCaja\r\nWHERE \r\ncodigoTT = '" . $tipoTransaccion . "'\r\nand\r\nvariable='si'\r\n"; $result6 = mysql_db_query($basedatos, $sSQL6); $myrow6 = mysql_fetch_array($result6); if ($myrow6['variable']) { if ($myrow81['cargosHospitalarios'] == 'si') { $banderaPM = new acumulados(); $precioVentaC = $banderaPM->banderaPorcentajeMedicamentos($entidad, $basedatos, $usuario, $numeroE, $nCuenta); $precioVentaC = porcentaje($precioVentaC, $myrow81['porcentajeVariable'], $a); } else { $cargosAseguradora = new acumulados(); $precioVentaC = $cargosAseguradora->cargosAseguradora($basedatos, $usuario, $numeroE, $nCuenta); $precioVentaC = porcentaje($precioVentaC, $myrow81['porcentajeVariable'], $a); } //Actualiza $q1 = "UPDATE cargosCuentaPaciente set \r\nprecioVenta='" . $precioVentaC . "'\r\nWHERE \r\nkeyCAP='" . $keyCAP . "'"; //mysql_db_query($basedatos,$q1); echo mysql_error(); } } ?> <span class="style12"><span class="style7"> <?php $sSQL31 = "Select sum(cantidadFacturada) as sumaFacturada From cargosFacturados WHERE numFactura = '" . $_GET['folioFactura'] . "' "; $result31 = mysql_db_query($basedatos, $sSQL31); $myrow31 = mysql_fetch_array($result31); $cantidadActual[0] += $myrow81['precioVenta'] * $myrow81['cantidad'] + $myrow81['iva'] * $myrow81['cantidad']; echo "\$" . number_format($cantidadActual[0] - $myrow31['sumaFacturada'], 2); ?> </span></span> </span></div></td> <td bgcolor="<?php echo $color; ?> " class="<?php echo $estilo; ?> "> </td> </tr> <?php } ?> </table> <table width="606" border="0" align="center" cellpadding="1" cellspacing="1"> <tr> <th width="92" scope="col"> </th> <th width="92" scope="col"> </th> <th width="92" scope="col"> </th> <th width="170" scope="col"> </th> <th width="57" scope="col"> </th> <th width="84" scope="col"><div align="left"><span class="style71"> <?php echo "\$" . number_format($myrow341['cantidadF'], 2); ?> </span></div></th> </tr> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> </table> <p> </p> <table width="53%" border="3" align="center" cellpadding="1" cellspacing="1" class="style71"> <tr> <th width="18%" scope="col"><span class="style72">Cantidad</span></th> <th width="23%" scope="col"> <input name="cantidadSolicitada" type="text" class="style71" id="cantidadSolicitada" value="<?php echo $cantidadActual[0] - $myrow31['sumaFacturada']; ?> "></th> <th width="59%" scope="col"> <span class="style74"><blink><?php echo $leyenda; ?> </blink></span></th> </tr> </table> <p align="center"> </p> <p align="center"> <?php if ($myrow341['cantidadF']) { echo 'Tienes disponible para facturar: ' . '$' . number_format(ltrim($cantidadActual[0]) - ltrim($myrow31['sumaFacturada']), 2); $cActual = number_format(ltrim($cantidadActual[0]) - ltrim($myrow31['sumaFacturada']), 2); } else { $cActual = $cantidadActual[0] + $cantidadIva[0]; } ?> </p> <p align="center"> <label> <input name="tipoCliente" type="hidden" id="tipoCliente" value="<?php echo $_GET['tipoCliente']; ?> " /> <input name="bandera" type="hidden" id="bandera" value="<?php echo $a; ?> "> </label> </p> <p align="center"> <input name="facturar" type="submit" class="style71" id="nuevo" value="Solicitar Facturar" <?php if (!$cActual) { echo 'disabled=""'; } ?> /> <input name="cantidadActual" type="hidden" id="cantidadActual" value="<?php echo $cActual; ?> " /> </p> </form> <p align="center"> </p> </body> </html> <?php }