?> " class="style12"><span class="Estilo24"> <?php $subTotal[0] = $subt[0]; echo "\$" . number_format($subTotal[0], 2); $subtotal[0] += $subTotal[0]; ?> </span></td> <td bgcolor="<?php echo $color; ?> " class="style12"><span class="Estilo24"> <?php $notaCredito[0] = $t * $myrow2['costo']; $gpoProducto = gpoProducto($code1, $basedatos); $ivas = iva($gpoProducto, $notaCredito[0], $basedatos); $totalNC[0] = $notaCredito[0] + $ivas; echo "\$" . number_format($totalNC[0], 2); $totalNC1[0] += $totalNC[0]; if ($iva) { echo " c/ Iva"; } ?> </span></td> <td bgcolor="<?php echo $color; ?> " class="style12"><span class="Estilo24"> <input name="obsequio[]2" type="text" class="style7" id="obsequio[]2" size="3" value="<?php echo $myrow18['obsequio'];
<?php $sqlc = "SELECT precio, cantidad\n\t\t\t\t\tFROM kng_conceptos\n\t\t\t\t\tWHERE proforma = '" . $row['faid'] . "'\n\t\t\t\t\t"; $resc = mysql_query($sqlc); $tutti = 0; while ($rowc = mysql_fetch_array($resc)) { $tutti += $rowc['precio'] * $rowc['cantidad']; } echo number_format($tutti, 2, ',', '.') . ' €'; ?> </td> <td><?php echo ivafecha($row['fecha']) . '%'; ?> </td> <td style="text-align: right; padding-right: 10px;"><?php echo number_format(iva($tutti, $row['fecha']), 2, ',', '.') . ' €'; ?> </td> <td class="tcentrado"> <?php //MIRAMSO SI YA EXISTE UNA FACTURA DE ESTA PROFORMA $sqlp = "SELECT id FROM kng_facturas WHERE presupuesto = '" . $row['presupuesto'] . "'"; //echo $sqlp.'<br /><br />'; $resp = mysql_query($sqlp); if (mysql_num_rows($resp) > 0) { $rowp = mysql_fetch_array($resp); ?> <a target="_blank" href="fac/fac_pdf_m.php?id=<?php echo $rowp['id']; ?> "><img src="imagenes/ok.png" alt="Factura creada" title="Factura creada" width="16" height="16" /></a>
?> "><span class="error"> <?php echo $importoError; ?> </span><br><br> <input type="submit"> </form> <?php if ($importo != null && $importoError == null && $okay == TRUE) { echo "<br>" . "Welcome, " . "<strong>" . $name . "</strong>" . " - Your email address is: " . $email; echo "<hr />" . "<br>"; include 'FatturaFunzioniCalcolo.php'; $inps = inps($importo); $imponibile = imponibile($importo, $inps); $iva = iva($imponibile); $imponibileIva = imponibileIva($imponibile, $iva); $ritenuta = ritenuta($imponibileIva); $aPagare = aPagare($imponibileIva, $ritenuta); echo "<br>" . "<strong>" . "Importo fattura: " . number_format($importo, 2, ".", ",") . "</strong>" . "<br>" . "<br>"; echo "Inps (4%): " . number_format($inps, 2, ".", ",") . "<br>"; echo "Imponibile con Inps: " . number_format($imponibile, 2, ".", ",") . "<br>"; echo "Iva (22%): " . number_format($iva, 2, ".", ",") . "<br>"; echo "Imponibile con Iva: " . number_format($imponibileIva, 2, ".", ",") . "<br>"; echo "Ritenuta d'acconto (20%): " . number_format($ritenuta, 2, ".", ",") . "<br>" . "<br>"; echo "<strong>" . "Totale da pagare: " . number_format($aPagare, 2, ".", ",") . "</strong>" . "<br>"; } /* function inps($importo) { return $importo * 0.04; }
} $codigo = $_POST['codigoArt']; $cantidad = $_POST['cantidad']; $agregarA = $_POST['agregarA']; for ($i = 0; $i <= $_POST['bandera']; $i++) { //********************FOR $Cost = $myrow23['costo']; //*********************saco centro de costo************ //*************************************CONVENIOS******************************************** $codigo[$i] = $agregarA[$i]; $costoHospital = costoHospital($codigo[$i], $basedatos); $gpoProducto = gpoProducto($code = $codigo[$i], $basedatos); $descripcion = descripcion($code = $codigo[$i], $basedatos); $ctaContable = centroCosto($medico, $basedatos); $priceLevel = validacionConvenios($precioLevel, $code, $almacen, $gpoProducto, $seguro, $basedatos); $iva = iva($gpoProducto, $priceLevel, $basedatos); $porcentajeCXC = porcentajeCXC($porcentajeCXC, $code, $almacen, $gpoProducto, $seguro, $basedatos); $ivaCXC = ivaCXC($gpoProducto, $porcentajeCXC, $basedatos); //*/****************************************Cierro validacion de convenios************************ //****************CIERRO PRECIOS****************/ if ($codigo[$i] and $cantidad[$i] and $agregarA[$i]) { $leyenda = "Se ingresaron cargos a la cuenta paciente"; $agrega1 = "INSERT INTO cargosCuentaPaciente (\r\nnumeroE,\r\ncodProcedimiento,\r\ncantidad,\r\nusuario,\r\nfecha1,\r\nip,\r\nstatus,\r\nalmacen,\r\ncosto,\r\n\r\nctaMayor,\r\nctoCosto,\r\nauxiliar,\r\n\r\nejercicio,\r\nseguro,\r\ndia,\r\niva,costoHospital\r\n) values (\r\n'" . $numeroPaciente . "',\r\n'" . $agregarA[$i] . "',\r\n'" . $cantidad[$i] . "',\r\n'" . $usuario . "',\r\n'" . $fecha1 . "',\r\n'" . $ip . "',\r\n'" . $status . "',\r\n'" . $ali . "',\r\n'" . $priceLevel . "',\r\n\r\n'" . $ctaMayor . "',\r\n'" . $ID_CCOSTO . "',\r\n'" . $aux . "',\r\n\r\n'" . $ID_EJERCICIOM . "',\r\n'" . $seguro . "',\r\n'" . $dia . "','" . $iva . "','" . $costoHospital . "'\r\n)"; mysql_db_query($basedatos, $agrega1); echo mysql_error(); if ($porcentajeCXC and !$_POST['cargo']) { $agrega1 = "INSERT INTO cargosCuentaPaciente (\r\nnumeroE,codProcedimiento,usuario,fecha1,ip,status,almacen,costo,iva,ctaMayor,ctoCosto,auxiliar,medico,ejercicio,dia,seguro,hora1,\r\ncostoHospital\r\n) values ('" . $_POST["numeroE"] . "','" . $agregarlos[$i] . "','" . $usuario . "',\r\n'" . $fecha1 . "','" . $ip . "','cxc','" . $ali . "','" . $porcentajeCXC . "',\r\n'" . $ivaCXC . "','" . $ctaContable . "','" . $ctaContable . "','" . $aux . "','" . $_POST["medico"] . "','" . $ID_EJERCICIOM . "','" . $dia . "',\r\n'" . $seguro . "','" . $hora1 . "','" . $costoHospital . "'\r\n)"; mysql_db_query($basedatos, $agrega1); echo mysql_error(); $q = "UPDATE clientesAmbulatorios set \r\ncargosCXC='cxc'\r\n\r\nWHERE numeroE = '" . $_POST['numeroE'] . "'"; mysql_db_query($basedatos, $q);
<td style="text-align: right; padding-right: 10px;"><?php echo number_format(iva($tutti, $row['fecha']), 2, ',', '.') . ' €'; ?> </td> <td style="text-align: right; padding-right: 10px;" > <?php $sql2 = "SELECT SUM(cantidad) AS total\n\t\t\t\t\t\tFROM kng_pagos\n\t\t\t\t\t\tWHERE borrado = '0' AND factura = '" . $row['faid'] . "'\n\t\t\t\t\t\tGROUP BY factura "; $res2 = mysql_query($sql2); $row2 = mysql_fetch_array($res2); echo number_format($row2['total'], 2, ',', '.'); ?> € </td> <?php //PARA MARCAR EL CUADRO EN ROJO SI NO ESTA PAGADA $resto = round(iva($tutti, $row['fecha']), 2) - $row2['total']; $clasu = ''; if ($resto > 0) { $clasu = 'border: 1px solid red; background-color: #FFDDDD;'; } else { $clasu = 'border: 1px solid green; background-color: #DDFFDD;'; } ?> <td style="text-align: right; padding-right: 10px; <?php echo $clasu; ?> "> <?php //cho 'T_'.round(iva($tutti, $row['fecha']),2).'<br>'; //echo 'P_'.$row2['total'].'<br>'; if ($resto < 0) {
<input name="receipt" type="text"></input> <input type="submit"/> </form> </html> <?php function iva($a, $b) { $risultato = $a + $a * $b / 100; return $risultato; } $a = $_GET["price"]; $b = $_GET["tax"]; //$c=$_GET["receipt"];; echo $prezzo = iva($a, $b) . "<br />" . "<br />"; //echo $risultato= $a+(($a*$b)/100); ?> ----------esercizio 5---------------------------- <html> //<form method="get"> <input name="price" type="text"></input> <input name="tax" type="text"></input> <!--<input name="receipt" type="text"></input> --> <input type="submit"/> </form> </html> //<?php
$s2 .= " AND pa.borrado = '0'"; //echo $s2.'<br /><br />';//QUERY S2 $r2 = mysql_query($s2); $t2 = mysql_fetch_array($r2); //MOSTRAMOS LOS DAOTOS ?> <div style="width: 90%; padding: 10px 0px; text-align: center; color: #FFFFFF; margin: auto; text-shadow: none; font-weight: bold; font-size: 12px;"><?php if ($esteanio == "%") { echo "TOTAL"; } else { echo $esteanio; } ?> </div> <div class="cajaround bg_azulgrad"> <?php echo "Facturado: " . number_format(iva($st, date("Y-m-d")), 2, ',', '.') . " €<br />Sin IVA: " . number_format($st, 2, ',', '.') . " €"; ?> </div> <div class="cajaround bg_verdegrad"> <?php echo "Pagado: " . number_format($t2['TOTAL'], 2, ',', '.') . " €<br /><br />"; ?> </div> <div class="cajaround bg_rojograd"> <?php echo "Pendiente: " . number_format(iva($st, date("Y-m-d")) - $t2['TOTAL'], 2, ',', '.') . " €<br /><br />"; ?> </div> <div class="finflotar"></div> </div>
<th width="82" bgcolor="#CCCCCC" class="style13" scope="col"><div align="center">Subtotal</div></th> <th width="74" bgcolor="#CCCCCC" class="style13" scope="col"><div align="center">IVA</div></th> <th width="68" bgcolor="#CCCCCC" class="style13" scope="col"><div align="center"><strong>Total</strong></div></th> <th width="57" bgcolor="#CCCCCC" class="style13" scope="col"><div align="center"><strong>N. C </strong></div></th> </tr> <tr> <td bgcolor="#FFFFFF" class="style13"><div align="center"> <?php $subTotal[0] = $sumaCosto[0]; echo "\$" . number_format($subTotal[0], 2); ?> </div></td> <td bgcolor="#FFFFFF" class="style13"><div align="center"> <?php $gpoProducto = gpoProducto($code1, $basedatos); $iva = iva($gpoProducto, $myrow2['costo'], $basedatos); echo "\$" . number_format($iva, 2); ?> </div></td> <td bgcolor="#FFFFFF" class="style13"><div align="center"><strong> <?php $Total = $subTotal[0] + $iva; echo "\$" . number_format($Total, 2); ?> </strong></div></td> <td bgcolor="#FFFFFF" class="style13"><div align="center"><?php echo $TOTAL = "\$" . number_format($myrow3['importeFactura'] - $Total, 2); ?> </div></td> </tr> <tr>
$tabla .= "<th>" . $col . "</th>"; } $tabla .= "</tr>"; while ($row = mysql_fetch_array($res)) { $numi = ""; $largura = strlen($row['numero']); for ($xz = $largura; $xz < 5; $xz++) { $numi .= "0"; } $numi = 'SN_' . $numi . $row['numero'] . '/' . substr($row['fecha'], 0, 4); $sqlc = "SELECT precio, cantidad\n FROM kng_conceptos\n WHERE factura = '" . $row['faid'] . "'\n "; $resc = mysql_query($sqlc); $tutti = 0; while ($rowc = mysql_fetch_array($resc)) { $tutti += $rowc['precio'] * $rowc['cantidad']; } $tabla .= "<tr>"; $tabla .= "<td>" . $numi . "</td>"; $tabla .= "<td>" . $row['presupuesto'] . "</td>"; $tabla .= "<td>" . $row['titipo'] . "</td>"; $tabla .= "<td>" . fechaes($row['fecha']) . "</td>"; $tabla .= "<td>" . $row['nombre'] . "</td>"; $tabla .= "<td>" . $row['titulo'] . "</td>"; $tabla .= "<td>" . number_format($tutti, 2, ',', '.') . "</td>"; $tabla .= "<td>" . ivafecha($row['fecha']) . "%</td>"; $tabla .= "<td>" . number_format(iva($tutti, $row['fecha']), 2, ',', '.') . "</td>"; $tabla .= "</tr>"; } $tabla .= "</table>"; echo $tabla; exit;
<th width="43" bgcolor="#660066" scope="col"><span class="style11">U.Medida</span></th> <th width="48" bgcolor="#660066" scope="col"><span class="style11">Precio</span></th> <th width="37" bgcolor="#660066" scope="col"><span class="style11">Agregar</span></th> </tr> <tr> <?php while ($myrow = mysql_fetch_array($result)) { $bandera += "1"; $code = $myrow['codigo']; //*************************************CONVENIOS******************************************** $um = um($code, $basedatos); $gpoProducto = gpoProducto($code, $basedatos); $descripcion = descripcion($code, $basedatos); $ctaContable = centroCosto($medico, $basedatos); $precioLevel = validacionConvenios($precioLevel, $code, $almacen, $gpoProducto, $seguro, $basedatos); $iva = iva($gpoProducto, $precioLevel, $basedatos); $porcentajeCXC = porcentajeCXC($porcentajeCXC, $code, $almacen, $gpoProducto, $seguro, $basedatos); $ivaCXC = ivaCXC($gpoProducto, $porcentajeCXC, $basedatos); //*/****************************************Cierro validacion de convenios************************ //cierro descuento if ($col) { $color = '#FFCCFF'; $col = ""; } else { $color = '#FFFFFF'; $col = 1; } $sSQL4 = "\r\nSELECT \r\n *\r\nFROM\r\nexistencias\r\nWHERE codigo = '" . $code1 . "'\r\nand \r\nalmacen='" . $almacen . "'\r\n"; $result4 = mysql_db_query($basedatos, $sSQL4); $myrow4 = mysql_fetch_array($result4); ?>
} /* Esto es para saber si hemos presionado una tecla de algún operador con la variable 'op' */ if (isset($_GET['op'])) { /* SI hemos presionado una tecla de un operador */ $oper = $_GET['op']; $oper1 = $_SESSION['oper1']; /* Vamos a procesar las acciones de cada una de las teclas de cada operador */ if ($oper == "clr") { $resultado = "00000000.00"; } elseif ($oper == "iva") { /* Importamos el módulo de la operación para el porciento */ include "common/iva.php"; /* Realizamos la operación */ $resultado = iva($resultado); } elseif ($oper == "eq") { /* Se realiza la acción para la tecla = */ /* Realizar la operación guardada en $oper1 usando como 1er valor a $valor1 y como 2do valor a lo que hay en $resultado y hay que colocar el resultado en el display. */ if ($oper1 == 'suma') { /* Importamos el módulo de la operación para suma */ include "common/suma.php"; /* Pedimos del más allá el valor de $valor1 */ $valor1 = $_SESSION['valor1']; /* Realizamos la operación */ $resultado = suma($valor1, $resultado); }