Foros del Web » Programando para Internet » Javascript »

facturacion

Estas en el tema de facturacion en el foro de Javascript en Foros del Web. buenas tardes estoy haciend un modulo de facturacion al cual le hice un bucle para poder ingresar varios registros al mismo tiempo hasta hay todo ...
  #1 (permalink)  
Antiguo 01/11/2011, 14:57
 
Fecha de Ingreso: noviembre-2011
Ubicación: bogota
Mensajes: 9
Antigüedad: 12 años, 6 meses
Puntos: 0
Pregunta facturacion

buenas tardes estoy haciend un modulo de facturacion al cual le hice un bucle para poder ingresar varios registros al mismo tiempo hasta hay todo bien le colo un script que es de una suma automatica al cual al hacer el bucle para la fila nueva ya no me genera la suma ni la sumatoria total... alguien que me pueda ayudar he investidado y todavia no pasa lada dejo aqui el codigo espero me puedan ayudar
Código HTML:
Ver original
  1. <script language="JavaScript" type="text/JavaScript">
  2. <!--
  3. function MM_jumpMenu(targ,selObj,restore){ //v3.0
  4.  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  5.  if (restore) selObj.selectedIndex=0;
  6. }
  7. //-->
  8. <script language="javascript">
  9.  
  10. function abrirCaja()
  11. {
  12. posx=((screen.availWidth-320)/2)
  13. posy=((screen.availHeight-200)/2)
  14. eval("boxwindow=window.open('ticket.php','boxwindow','width=320,height=400,toolbar=0,directories=0,status=0,scrollbars=0,resize=0,menubar=0,screenx="+posx+",screeny="+posy+",left="+posx+",top="+posy+"')")
  15. }
  16.  
  17. function Sumar(){  
  18.       interval = setInterval("calcular()",1);
  19. }  
  20. function calcular(){  
  21.       uno = document.autoSumForm.valor.value;  
  22.      dos = document.autoSumForm.comision.value;    
  23.      document.autoSumForm.valortotal.value = (uno*1)+(dos*1);  
  24. }  
  25. function NoSumar(){  
  26.      clearInterval(interval);  
  27. }  
  28.  
  29.  
  30. </script>
  31.  
  32. <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  33. <title>FACTURACION</title>
  34. <style type="text/css">
  35. <!--
  36. .Estilo1 {font-family: "Comic Sans MS"}
  37. .Estilo2 {
  38.     font-weight: bold;
  39.     font-size: 16px;
  40. }
  41. .Estilo3 {
  42.     font-family: "Arial Black";
  43.     font-weight: bold;
  44.     font-size: 24px;
  45.     color: #FFF;
  46.     text-align: center;
  47. }
  48. body {
  49.     background-image: url(80.jpg);
  50. }
  51. .Estilo6 {font-family: "Comic Sans MS"; color: #000000; }
  52. .Estilo7 {font-size: 16px}
  53. .Estilo8 {
  54.     color: #FFFFFF;
  55.     text-align: center;
  56. }
  57. .style1 {font-size: 18px}
  58. -->
  59.  
  60.  
  61.  
  62. </head>
  63.  
  64. <table width="100%" border="0"><tr><td width="85%" height="415">
  65. <form id="formulario1" name="autoSumForm" method="POST" action="guardar_factura.php">
  66.   <table width="100%" border="0">
  67.     <tr>
  68.       <td height="414" colspan="3"><div align="center" class="Estilo3">
  69.         <table width="100%" border="0">
  70.           <tr>
  71.             <td> <div align="right" class="Estilo3">
  72.               <p>USUARIO: <span><strong><? echo $_SESSION['usuario']; ?> </strong></span></p>
  73.               <p><a href="desconectar.php">cerrar sesion</a></p>
  74.             </div> </td>
  75.             <td><center><img src="INICIO.png" width="295" height="114"></center></td>
  76.           </tr>
  77.           <tr>
  78.             <td width="15%" rowspan="2"><script type="text/javascript" src="index-files/sc14h1a.js"></script>
  79.               <table id="vista-buttons.com:id14h1a" width=0 cellpadding=0 cellspacing=0 border=0>
  80.                 <tr>
  81.                   <td style="padding-bottom:11px" title ="FACTURACION"><a href="facturacion.php" onMouseDown='xpe("14h1ac");' onMouseOver='xpe("14h1ao");' onMouseOut='xpe("14h1an");'></a><a href="facturacion.php" onMouseDown='xpe("14h1ac");' onMouseOver='xpe("14h1ao");' onMouseOut='xpe("14h1an");'><img id="xpi_14h1a" src="index-files/bt14h1a_0.gif" name="vb14h1a" width="180" height="39" border="0" alt="FACTURACION"/></a></td>
  82.                 </tr>
  83.                 <tr>
  84.                   <td style="padding-bottom:11px" title ="VENTAS"><a onMouseOver='xpe("c4h1ao");' onMouseOut='xpe("c4h1an");' onMouseDown='xpe("c4h1ac");'><img id="xpi_c4h1a" src="index-files/btc4h1a_0.gif" name="vbc4h1a" width="180" height="39" border="0" alt="VENTAS"/></a></td>
  85.                 </tr>
  86.                 <tr>
  87.                   <td style="padding-bottom:11px" title ="INVENTARIOS"><a onMouseOver='xpe("d4h1ao");' onMouseOut='xpe("d4h1an");' onMouseDown='xpe("d4h1ac");'><img id="xpi_d4h1a" src="index-files/btd4h1a_0.gif" name="vbd4h1a" width="180" height="39" border="0" alt="INVENTARIOS"/></a></td>
  88.                 </tr>
  89.                 <tr>
  90.                   <td style="padding-bottom:11px" title ="PROVEDORES"><a onMouseOver='xpe("74h1ao");' onMouseOut='xpe("74h1an");' onMouseDown='xpe("74h1ac");'><img id="xpi_74h1a" src="index-files/bt74h1a_0.gif" name="vb74h1a" width="180" height="39" border="0" alt="PROVEDORES"/></a></td>
  91.                 </tr>
  92.               </table>
  93.               <noscript>
  94.               </noscript></td>
  95.             <td width="85%" height="152"><table width="100%" border="0">
  96.               <tr>
  97.                 <td colspan="15"><div align="center" class="Estilo7 Estilo1 Estilo6 Estilo8 style1"><strong> FACTURACION SERVICIOS PUBLICOS</strong></div></td>
  98.               </tr>
  99.               <tr>
  100.                 <td colspan="15"><span class="Estilo3">SELECCIONE CANTIDAD</span> <select name="menu1" class="Estilo6" onChange="MM_jumpMenu('parent',this,0)">
  101.   <?
  102. for($i=1;$i<=20;$i++)
  103. {
  104.     if($_GET["Line"] == $i)
  105.     {
  106.         $sel = "selected";
  107.     }
  108.     else
  109.     {
  110.         $sel = "";
  111.     }
  112. ?>
  113.   <option value="<?=$_SERVER["PHP_SELF"];?>?Line=<?=$i;?>" <?=$sel;?>>
  114.     <?=$i;?>
  115.     </option>
  116.   <?
  117. }
  118. ?>
  119. </select></td>
  120.               </tr>
  121.               <tr>
  122.                 <td class="Estilo1"><div align="right" class="Estilo7 Estilo1 Estilo6 Estilo8">
  123.                   <div align="left"><strong>REF</strong></div>
  124.                 </div></td>
  125.                 <td class="Estilo1"><div align="right" class="Estilo7 Estilo1 Estilo6 Estilo8">
  126.                   <div align="left"><strong> CODIGO</strong></div>
  127.                 </div></td>
  128.                 <td width="20%" class="Estilo1"><div align="right" class="Estilo7 Estilo1 Estilo6 Estilo8">
  129.                   <div align="left"><strong>FECHA LIMITE</strong></div>
  130.                 </div></td>
  131.                 <td width="15%" class="Estilo1"><div align="right" class="Estilo7 Estilo1 Estilo6 Estilo8">
  132.                   <div align="left"><strong>VALOR</strong></div>
  133.                 </div></td>
  134.                 <td width="15%" class="Estilo1"><div align="right" class="Estilo7 Estilo1 Estilo6 Estilo8">
  135.                   <div align="left"><strong>COMISION</strong></div>
  136.                 </div></td>
  137.                 <td width="19%"><div align="right" class="Estilo7 Estilo1 Estilo6 Estilo8">
  138.                   <div align="left"><strong>VALOR UND</strong></div>
  139.                 </div></td>
  140.                 <td width="5%">&nbsp;</td>
  141.               </tr>
  142.   <?
  143.  $line = $_GET["Line"];
  144.  if($line == 0){$line=1;}
  145.  for($i=1;$i<=$line;$i++)
  146.  {
  147.  ?>
  148.               <tr>
  149.                 <td width="15%" class="Estilo1"><center>
  150.                   <select name="empresa<?=$i;?>"class="estilo1" id="empresa">
  151.                     <option value="" selected>EMPRESA</option>
  152.                     <option>ACUEDUCTO-ASEO</option>
  153.                     <option>CODENSA</option>
  154.                     <option>COMCEL</option>
  155.                     <option>DIRECT TV</option>
  156.                     <option>ETB</option>
  157.                     <option>GAS NATURAL</option>
  158.                     <option>MOVISTAR</option>
  159.                     <option>SALUD</option>
  160.                     <option>TELMEX</option>
  161.                     <option>TIGO</option>
  162.                     <option>UNE</option>
  163.              
  164.                   </select></td>
  165.                 <td width="11%" class="Estilo1"><div align="center">
  166.                   <input name="codigo<?=$i;?>" type="text" id="codigo" value="" size="10" maxlength="10" />
  167.                 </div></td>
  168.                 <td class="Estilo1"><div align="center">
  169.                   <input name="fecha<?=$i;?>" type="text" id="fecha" value="" size="20" maxlength="20" />
  170.                 </div></td>
  171.                 <td class="Estilo1"><div align="center">
  172.                   <input  type="text"id="valor" onFocus="Sumar();" onBlur="NoSumar();" name="valor<?=$i;?>" value="" size="15" maxlength="15">
  173.                 </div></td>
  174.                 <td class="Estilo1"><div align="center">
  175.                   <input  type="text" id="comision" onFocus="Sumar();" onBlur="NoSumar();" name="comision<?=$i;?>"  value="" size="15" maxlength="15">
  176.                 </div></td>
  177.                 <td><div align="left" class="Estilo1">
  178.                   <div align="center">
  179.                     <input type="text" class="Estilo6" id="valortotal"  name="valortotal<?=$i;?>"  size="15" maxlength="15" />
  180.                   </div>
  181.                 </div></td>
  182.                 <td>&nbsp;</td>
  183.               </tr>
  184.                 <?
  185.                 }
  186.                 ?>
  187.                 <tr>
  188.                   <td height="37" colspan="7" class="Estilo8">VALOR TOTAL:<?PHP echo $_REQUEST['valortotal<?=$i;?>'] ?></td>
  189.                   </tr>
  190.                 <td class="Estilo1">&nbsp;</td>
  191.                 <td height="37" class="Estilo1">&nbsp;</td>
  192.                 <td height="37" class="Estilo1"><div align="center" class="Estilo1 Estilo2 Estilo1">
  193.                   <input name="Submit" type="submit" class="Estilo1" id="guardar" value="guardar"/>
  194.                   <input type="hidden" name="hdnLine" value="<?=$i;?>">



les agradesco mucho de antemano

Etiquetas: facturacion, formulario, html, js, php
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta

SíEste tema le ha gustado a 1 personas




La zona horaria es GMT -6. Ahora son las 19:54.