<?php
 
session_start();
include("DMMYSQLG.php");
include("DSA1000.php");
include("DF30000.inc");
include("DF80000.php");
include('JQUERY.inc');
$numVen=0;
$granTot=0;
$granTotpro2=0;
$granTot2=0;
?>
<html> 
<head>
<link rel="stylesheet" href="css/estilo1.css" type="text/css"/>
<script type="text/javascript" language="JavaScript1.2" src="DSSCRIPT.js"></script>
<script language="javascript">

$(document).ready(function(){

	$('#boproc').click(function() { 
	var timeSlide = 1000;
	$('#timer').fadeIn(300);
    $('.box-success, .box-error').slideUp(timeSlide);
	fecini=document.getElementById("fecini").value;
	fecfin=document.getElementById("fecfin").value;
	setipvent=document.getElementById("setipvent").value;
	secodven=document.getElementById("secodven").value;

		if (fecini != null && fecfin != "") {
			
			$.ajax({
                    type: 'POST',
                    url: 'rep_pagos_PR_ajax.php',
                    data: { fecini: fecini, fecfin: fecfin, setipvent: setipvent, secodven: secodven},

                    success:function(msj){
                        if ( msj >= 1 ){
                            $('#alertBoxes').html('<br><div class="box-success"></div>');
                            $('.box-success').hide(0).html('Espera un momento…');
                            $('.box-success').slideDown(timeSlide);
                            setTimeout(function(){
                                openpage('ven_corte_PR.php','_self');
                            },(timeSlide + 500));
                        } else{
                            $('#alertBoxes').html('<br><div class="box-error"></div>');
                            $('.box-error').hide(0).html('Lo sentimos, pero los datos son incorrectos');
                            $('.box-error').slideDown(timeSlide);
                        }
                        $('#timer').fadeOut(300);
                    }
                });
			
		}else {
							
			alert("por favor ingrese la clave");
			return false;
		}
    

	});

});
</script>
<style type="text/css">
<!--
.Estilo2 {
	font-family: Arial, Helvetica, sans-serif;
	font-size: 14px;
	font-weight: bold;
}
.Estilo3 {border: 1px; font-family :urw gothic l; color: #000099; background-color: #dbe0e9;}
.Estilo5 {color: #FFFFFF}
.estiloTotal{
	background-color:#0099FF;
	font-size:18px;
	font-family:Arial, Helvetica, sans-serif;
	font-weight:bolder;
	 ;
	text-align:right;
}
.red{
	color: #FB4444;
}

.estiloSubTotal{
	background-color:#FFFFF2;
	font-size:12px;
	font-family:Arial, Helvetica, sans-serif;
	font-style:italic;
	font-weight:bolder;
	color:#000000;
}
.estiloGrupo{
	background-color:#E1E1DD;
	font-size:14px;
	font-family:Arial, Helvetica, sans-serif;
	font-weight:bolder;
	color:#000000;
}
.estiloEnc{
	background-color:#D9ECFF;
	font-size:12px;
	font-family:Arial, Helvetica, sans-serif;
	/*font-weight:bold;*/
	color:#000000;
}
.estiloEncR{
	background-color:#D9ECFF;
	font-size:12px;
	font-family:Arial, Helvetica, sans-serif;
	/*font-weight:bold;*/
	color:#000000;
	text-align:right;
}

.estiloDet{
	background- ;
	font-size:10px;
	font-family:Arial, Helvetica, sans-serif;
	font-style:italic;
	/*font-weight:bold;*/
	color:#000000;
}
.estiloDetR{
	background- ;
	font-size:10px;
	font-family:Arial, Helvetica, sans-serif;
	font-style:italic;
	/*font-weight:bold;*/
	color:#000000;
	text-align:right;
}
.detFacTr{
	font-family:Arial, Helvetica, sans-serif;
	font-size:16px;

}
.detFacL{
	text-align:left;
	 ;
}
.detFacR{
	text-align:right;
	 ;
}
.detFacC{
	text-align:center;
	 ;
}
.granTotL{
	font-family:Arial, Helvetica, sans-serif;
	font-size:14px;
	font-weight:bold;
	text-align:left;
	background-color:#0080FF;
	 ;
}
.granTotR{
	font-family:Arial, Helvetica, sans-serif;
	font-size:14px;
	font-weight:bold;
	text-align:right;
	background-color:#0080FF;
	 ;	
}


-->
</style>
</head>
<body>
<?php
 
$sq_tippag = mysqli_query($con ,"select * from dgtippag");//Datos para combo setipven 
$sq_pvta = mysqli_query($con ,"select * from ptventa");//Datos para combo punto de venta 

?>
<div align="center">
<form name="frm1" id="frm1" method="post" action="">
  <table  align="center">
    	<tr>
    	  <th colspan="2">REPORTE POR TIPO DE PAGO</th>
		</tr>
     	<tr>
     	  <td>Punto de Venta:</td>
        	<td>
            	<div align="left">
            	  <select name="setipvent" id="setipvent">
            	    <option value="T">------ TODOS ------</option>
            	    <?php
 
						while ($dt_tippag = mysqli_fetch_array($sq_pvta)){
							if($dt_tippag['nparte1'] == $_POST['setipvent']) 
								echo '<option value="'.$dt_tippag['nparte1'].'" selected>'.$dt_tippag['np_desc1'].'</option>';
							else
								echo '<option value="'.$dt_tippag['nparte1'].'">'.$dt_tippag['np_desc1'].'</option>';
						}
					?>
          	    </select>
       	        </div></td>
      	</tr>
		<tr>
     	  <td>Tipo Pago:</td>
        	<td>
            	<div align="left">
            	  <select name="setipven" id="setipven">
            	    <option value="T">------ TODOS ------</option>
            	    <?php
 
						while ($dt_tippag = mysqli_fetch_array($sq_tippag)){
							if($dt_tippag['tip_pag'] == $_POST['setipven']) 
								echo '<option value="'.$dt_tippag['tip_pag'].'" selected>'.$dt_tippag['desc_pag'].'</option>';
							else
								echo '<option value="'.$dt_tippag['tip_pag'].'">'.$dt_tippag['desc_pag'].'</option>';
						}
					?>
          	    </select>
       	        </div></td>
      	</tr>      	
      	<tr>
      	  <td>Cajero:</td>
      	  <td><select name="secodven" id="secodven">
			<option value="T">------ TODOS ------</option>
            <?php
 
			$sql = mysqli_query($con ,"SELECT * FROM dgcatven order by CONCAT(nom_ven,' ',ap_pat_ven,' ',ap_mat_ven) asc");
			while($reg=mysqli_fetch_array($sql)){
				if($reg['cod_ven'] == $_POST['secodven']){
					echo '<option value="' . $reg['cod_ven'] . '" selected>' . $reg['nom_ven'] . ' ' . $reg['ap_pat_ven'] . ' ' . $reg['ap_mat_ven'] .'</option>';
				}else{
					echo '<option value="' . $reg['cod_ven'] . '">' . $reg['nom_ven'] . ' ' . $reg['ap_pat_ven'] . ' ' . $reg['ap_mat_ven'] . '</option>';
				}
			
			}
			?>
            </select>&nbsp;</td>
   	  </tr>
<tr>
      	  <td colspan="2" nowrap>
		    <div align="center" class="estiloFecha">

			  Del 
			  <input name="fecini" type="text" class="Estilo3 datefrom" id="fecini" size="15"  
			  	<?php
 
					if(isset($_POST['fecini']))
						echo 'value="'.$_POST['fecini'].'"'; 
				  	else
				    	echo 'value="'.date('d/m/Y').'"'; 
				?>>		      
	    al 
	        

	          <input name="fecfin" type="text" class="Estilo3 dateto" id="fecfin" size="15" 
			<?php
 
				if(isset($_POST['fecfin']))
			  		echo 'value="'.$_POST['fecfin'].'"'; 
			  	else
			  		echo 'value="'.date('d/m/Y').'"'; 
			?>>
	      
          </div></td>
       	</tr>	  
      	<tr>
      	  <td colspan="2"><div align="center">
       		  <input name="boproc" type="submit" id="boproc" value="Procesar" onClick="openpage('rep_pagos_PR.php','_self')" />
       	  </div>

       	  </td>
       	</tr>
       	<?php 
				if ( isset($_POST["boproc"])){

					$fecIni=chfecha($_POST['fecini'],'d/m/Y','Y-m-d');
	$fecFin=chfecha($_POST['fecfin'],'d/m/Y','Y-m-d');
	
					if($_POST['setipvent']!='T') {
  						$cond1=' and ptventa.nparte1='.$_POST['setipvent'].' ';
					}else {
						$cond1=' and ptventa.nparte1!=0 ';
    				}
    				if ($_POST['secodven']!='T') {
    					$cond2=' and vendedor='.$_POST['secodven'].' ';
    				} else {
    				    $cond2=' ';
    				}
    				
    
    				 $sql=mysqli_query($con ,"SELECT dgpemema.fol_ven FROM dgpemema
							LEFT JOIN fpos ON fpos.fol_ven=dgpemema.fol_ven
							LEFT JOIN ctmesas ON ctmesas.nparte1=fpos.mesa
							LEFT JOIN ptventa ON ptventa.nparte1=ctmesas.descripcion
							LEFT JOIN dgger_cajerosj ON dgger_cajerosj.pedido=dgpemema.fol_ven	
							where dgpemema.fec_ven between '".$fecIni."' and '".$fecFin."' AND dgpemema.cancelado!=1 and dgpemema.cancela!=1 and dgpemema.pagado!='S' and dgpemema.oper=0 ".$cond1." ".$cond2);
          
          			$numeros=mysqli_num_rows($sql);

          			if ($numeros>0) {
          				
          					?>
							<tr>
      	  						<td colspan="2">
      	  							<div class="red" align="center">
       		  							<?php echo "Hay ".$numeros." cuentas abiertas sin traspaso debes traspasar o cancelar antes de continuar"; ?>
       	  							</div>
       	  						</td>
       						</tr>
          					<?php 
          				

          			}else{
          				?>
							<tr>
      	  						<td colspan="2">
      	  							<div class="red" align="center">
       		  							<?php echo "no hay cuentas abiertas"; ?>
       	  							</div>
       	  						</td>
       						</tr>
          					<?php 
          			}

				}

			 ?>
	</table>

  <table border="0" width="100%">
    	<tr>
        	<th colspan="6">
          	<div align="left">
            	<input type="button" name="bot4" value="Imprimir" onClick="openpage('rep_pagos_IM.php','_self')">
            				
          	</div>			</th>
      	</tr>
    	<tr>
    	  <th colspan="6" align="justify"><?php
 if (isset($_POST["setipven"])&&$_POST["setipven"]=="T"){
					echo "TIP. PAGO.: ";
					echo "TODAS"; 
					} else 
					{
					@$bus = mysqli_query($con ,"SELECT * FROM dgtippag WHERE tip_pag = '".$_POST['setipven']."'");
					$re = mysqli_fetch_array($bus);
					echo "TIP. PAGO.: ";
					echo $re['desc_pag'];
					}			
				 ?></th>
  	  </tr>
    	<tr>
    	  <th colspan="6" ><?php
 if (isset($_POST["secodven"])&&$_POST["secodven"]=="T"){
					echo "CAJERO: ";
					echo "TODOS"; 
					} else 
					{
					@$bus1 = mysqli_query($con ,"SELECT * FROM dgcatven WHERE cod_ven = '".$_POST['secodven']."'");
					$re1 = mysqli_fetch_array($bus1);
					echo "CAJERO: ";
					echo $re1['nom_ven'];
					echo ' ';
					echo $re1['ap_pat_ven']; 
					echo ' ';
					echo $re1['ap_mat_ven'];
					}			
				 ?></th>
  	  </tr>


<?php


//$aud=mysqli_query($con ,"select * from dgger_cajerosd");
//while($aud2=mysqli_fetch_array($aud)){
//echo "".$aud2['importe']."<br>";
//}

if ( isset($_POST["boproc"])){
	$fecIni=chfecha($_POST['fecini'],'d/m/Y','Y-m-d');
	$fecFin=chfecha($_POST['fecfin'],'d/m/Y','Y-m-d');

	
	if ($fecIni<'2013-07-01'){
	$table='pvrescaj';
	$taDet='pvrescad';
	$posicion='fposres';
	$tip='pvrestip';
	//$brain='pvresmema';
	}else{
	$table='dgger_cajerosj';
	$taDet='dgger_cajerosd';
	$posicion='fpos';
	$tip='fpropina';
	//$brain='dgpemema';
	}
	
	$brain='dgpemema';
	
	if($_POST['secodven']!='T') {
		$arrBus[]="".$table.".vendedor='".$_POST['secodven']."'";		
	}else {
		$arrBus[]="".$table.".vendedor!='0'";		
	}
	if($_POST['setipven']!='T') 
	{
	 	$arrBus[]="dgtippag.tip_pag='".$_POST['setipven']."'";
	}
	if($_POST['setipvent']!='T') {
  		$arrBus[]=' ptventa.nparte1='.$_POST['setipvent'].' ';
  }else {
		$arrBus[]=' ptventa.nparte1!=0 ';
  }
	$arrBus[]=" $table.cancelado=0 AND ($table.fec_rec between '".$fecIni."' and '".$fecFin."') ";	
   	$WHERE="WHERE ".implode(" AND ",$arrBus);
	//$table.tip_mov as tipag,
	//$taDet.tip_pag as tipo_pago,
	//
	@$sql = mysqli_query($con ,"
		SELECT 
			
			
			dgtippag.tip_pag as idpag,
			dgtippag.desc_pag as descpag,
			$table.vendedor as vendedor
		FROM 
			$table
			LEFT JOIN $taDet ON $taDet.n_rec=$table.n_rec	
			LEFT JOIN dgtippag ON dgtippag.tip_pag=$taDet.tip_pag											
			LEFT outer JOIN $posicion ON $posicion.fol_ven=$table.pedido
			LEFT JOIN ctmesas ON ctmesas.nparte1=$posicion.mesa
			LEFT JOIN ptventa ON ptventa.nparte1=ctmesas.descripcion
		$WHERE
		GROUP BY dgtippag.tip_pag
		ORDER BY 
			dgtippag.desc_pag");
	echo mysqli_error($con);
	$a=0;
	while($reg = mysqli_fetch_array($sql))
	{
	//ENCABEZADO DE CADA PAGO 

	echo "<tr>"
		."	  <td class=\"estiloDet\">".$reg['idpag']."</td>"
			 ." <td class=\"estiloDet\" colspan=\"5\">".$reg['descpag']."</td>"
         ." </tr>";
///---------------------------------------PAGOS Y PROPINA DE FORMA INDIVIDUAL----------------------------------------------------------//		
if($_POST['secodven']!='T') {
  $vendedor=''.$table.'.vendedor='.$reg['vendedor'].' ';
  }else {
  $vendedor=''.$table.'.vendedor!=0 ';
  }

if($_POST['setipvent']!='T') {
  $ptvta=' ptventa.nparte1='.$_POST['setipvent'].' ';
  }else {
  $ptvta=' ptventa.nparte1!=0 ';
  }

	//ENCABEZADO PARA LOS DETALLES 
	echo '<tr class="typeagre">
	 	  <td><div align="center">Folio Orden</div></td>
		  <td><div align="center">Cajero</div></td>
		  <td><div align="center">Referencia</div></td>
 		  <td><div align="center">Autoriza</div></td>
		  <td><div align="center">Importe</div></td>
  		  <td><div align="center">Punto de Venta</div></td>
	 	</tr>';
	@$sql_pg = mysqli_query($con ,"
		SELECT 
			$brain.con_ven as fol_ven,
			CONCAT(dgcatven.nom_ven,' ',dgcatven.ap_pat_ven,' ',dgcatven.ap_mat_ven) as nomVen,	
			$taDet.importe as saldo,	
			$taDet.ref as referencia,			
			$table.pedido as pedido,
			$table.num_cli as cliente,	
			$brain.tip as propina,
			ptventa.np_desc1 as dptvta,
			$table.fol_unp as folp
		FROM 
			$brain
			
			LEFT JOIN ctmesas ON ctmesas.nparte1=$brain.fpos_mesa
			LEFT JOIN ptventa ON ptventa.nparte1=ctmesas.descripcion
			INNER JOIN $table ON $table.pedido=$brain.fol_ven		
			
			LEFT JOIN  $taDet ON $taDet.n_rec=$table.n_rec				
			LEFT JOIN  dgtippag ON dgtippag.tip_pag=$taDet.tip_pag								
			left JOIN dgcatven ON $table.vendedor=dgcatven.cod_ven
			
		WHERE dgtippag.tip_pag='".$reg['idpag']."' and $table.fol_unp=0 and $table.cancelado=0 AND $brain.cancela=0 and $brain.cancelado=0 AND $vendedor AND $ptvta AND ($brain.fec_ven between '".$fecIni."' and '".$fecFin."')
			ORDER BY 
			$brain.con_ven");
	echo mysqli_error($con);
	$a=0;
				$b=0;	
	$granTot=0;
	while($rgp = mysqli_fetch_array($sql_pg)){
	if ($reg['idpag']==1){
	$sql_cli=mysqli_query($con ,"select * from valeryus19 where n_reg='".$rgp['cliente']."'");
	$reg_hb=mysqli_fetch_array($sql_cli);
	if ($reg_hb['fnumcto']!='')
	$hbit=$reg_hb['fnumcto'];
	else
	$hbit=$reg_hb['fmuncto'];
	
		echo '<tr class="detFacTr">';
		echo '<td class="detFacC">'.$rgp["fol_ven"].'&nbsp;</td>'; 
		echo '<td class="detFacL">'.$rgp['nomVen'].'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FOLIO:  '.$reg_hb['n_reg'].' &nbsp;&nbsp;&nbsp;&nbsp;HABITACION:'.$hbit.'</td>';  
		echo '<td class="detFacL">'.$rgp['referencia'].'&nbsp;</td>';  
		echo '<td class="detFacL">'.$rgp['autoriza'].'&nbsp;</td>';  			
		echo '<td class="detFacR">$'.number_format(($rgp["saldo"]+$rgp['propina']),2,'.',',').'</td>'; 
		echo '<td class="detFacL"> &nbsp;&nbsp;'.$rgp['dptvta'].'</td>'; 		 
		echo '</tr>';	
	}else{
		echo '<tr class="detFacTr">';
		echo '<td class="detFacC">'.$rgp["fol_ven"].'&nbsp;</td>'; 
		echo '<td class="detFacL">'.$rgp['nomVen'].'&nbsp;</td>';  
		echo '<td class="detFacL">'.$rgp['referencia'].'&nbsp;</td>'; 
                $vra=(isset($rgp['autoriza']))?$rgp['autoriza']:"";
		echo '<td class="detFacL">'.$rgp['autoriza'].'&nbsp;</td>';  			

		
		echo '<td class="detFacR">$'.number_format($rgp["saldo"],2,'.',',').'</td>'; 

		echo '<td class="detFacL"> &nbsp;&nbsp;'.$rgp['dptvta'].'</td>'; 		 
		echo '</tr>';	
	}	$numVen ++;
		$a ++;
		$granTot +=$rgp["saldo"];  //suma saldo individual
		$granTot2 +=$rgp["saldo"];  //suma saldo				
		} //cierra el detalle de pago INDIVIDUAL + PROPINA
///------------------------------------------------------------------------------------------------------------------------------------//		
//****************************************FORMASD DE PAGO PAGADAS DE FORMA general***************************************+*////

	@$sql_pro = mysqli_query($con ,"
		SELECT 
			$table.pedido as fol_ven,
			CONCAT(dgcatven.nom_ven,' ',dgcatven.ap_pat_ven,' ',dgcatven.ap_mat_ven) as nomVen,	
			$taDet.importe as saldo,
			$taDet.ref as referencia,	
			$table.pedido as pedido,
			$table.num_cli as cliente,	
			$tip.tip as propina,
			ptventa.np_desc1 as dptvta,
			$table.fol_unp as folp
		FROM 
			$table
			LEFT JOIN $posicion ON $posicion.fol_ven=$table.pedido
			LEFT JOIN ctmesas ON ctmesas.nparte1=$posicion.mesa
			LEFT JOIN ptventa ON ptventa.nparte1=ctmesas.descripcion		
			LEFT JOIN  $tip ON $tip.fol_unp=$table.fol_unp	
			LEFT JOIN  $taDet ON $taDet.n_rec=$table.n_rec				
			LEFT JOIN  dgtippag ON dgtippag.tip_pag=$taDet.tip_pag								
			left JOIN dgcatven ON $table.vendedor=dgcatven.cod_ven
			
		WHERE dgtippag.tip_pag='".$reg['idpag']."' and $table.fol_unp!=0 and $table.cancelado=0 AND $vendedor AND $ptvta AND ($table.fec_rec between '".$fecIni."' and '".$fecFin."')
		group by $table.fol_unp
		ORDER BY 
			$table.pedido");
	echo mysqli_error($con);
	if (mysqli_num_rows($sql_pro)!=0){
		//ENCABEZADO PARA LA PROPINA
/*	echo "<tr>
			  <td class=\"estiloDet\"></td>
			  <td class=\"estiloDet\" colspan=\"5\">PROPINAS PAGADAS DE FORMA GENERAL </td>
          </tr>";*/
	}
	$granTotpro=0;
	while($rgpro = mysqli_fetch_array($sql_pro)){
	if ($reg['idpag']==1){
	$sql_cli=mysqli_query($con ,"select * from valeryus19 where n_reg='".$rgpro['cliente']."'");
	$reg_hb=mysqli_fetch_array($sql_cli);
	if ($reg_hb['fnumcto']!='')
	$hbit=$reg_hb['fnumcto'];
	else
	$hbit=$reg_hb['fmuncto'];
	
		echo '<tr class="detFacTr">';
	$folio=mysqli_query($con ,"select $brain.con_ven as folio, $table.fol_unp as folpf from $table inner join $brain on $brain.fol_ven=$table.pedido
	   where $table.fol_unp='".$rgpro['folp']."'");
		echo '<td class="detFacC">&nbsp;';
			   while($rg=mysqli_fetch_array($folio)){
	   echo $rg['folio'];
	   echo ' | ';
	   }
		echo '</td>'; 
	
		echo '<td class="detFacL">'.$rgpro['nomVen'].'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; FOLIO:  '.$reg_hb['n_reg'].' &nbsp;&nbsp;&nbsp;&nbsp;HABITACION:'.$hbit.'</td>';  
		echo '<td class="detFacL">'.$rgpro['referencia'].'&nbsp;</td>';  
		echo '<td class="detFacL">'.$rgpro['autoriza'].'&nbsp;</td>';  			
		echo '<td class="detFacR">$'.number_format(($rgpro["saldo"]),2,'.',',').'</td>'; 
		echo '<td class="detFacL"> &nbsp;&nbsp;'.$rgpro['dptvta'].'</td>'; 		 
		echo '</tr>';	
	}else{
		echo '<tr class="detFacTr">';
		$folio=mysqli_query($con ,"select $brain.con_ven as folio, $table.fol_unp as folpf from $table left join $brain on $brain.fol_ven=$table.pedido
	   where $table.fol_unp='".$rgpro['folp']."'");
		echo '<td class="detFacC">&nbsp;';
		while($rg=mysqli_fetch_array($folio)){
	   echo $rg['folio'];
	   echo ' | ';
	   }
		echo '</td>'; 
		echo '<td class="detFacL">'.$rgpro['nomVen'].'&nbsp;</td>';  
		echo '<td class="detFacL">'.$rgpro['referencia'].'&nbsp;</td>';  
		echo '<td class="detFacL">'.$rgpro['autoriza'].'&nbsp;</td>';  			

		
		echo '<td class="detFacR">$'.number_format($rgpro['saldo'],2,'.',',').'</td>'; 

		echo '<td class="detFacL"> &nbsp;&nbsp;'.$rgpro['dptvta'].'</td>'; 		 
		echo '</tr>';	
	}		
		$granTotpro +=$rgpro['saldo'];  //suma propina individual
		$granTotpro2 +=$rgpro['saldo'];  //suma propina 
			$a ++;
				$numVen ++; 
							
		} //cierra el detalle de pago  PROPINA
//************************************************************************************************************************************////		
//||||||||||||||||||||||||||||||||||||||||||||||||||CANTIDAD NETA DE CADA FORMA DE PAGO |||||||||||||||||||||||||||||||||||||||||||||||//						
		echo "<tr> 
			<td class=\"granTotL\"  colspan=\"4\"> Numero Ventas: $a</td>  						
			<td class=\"granTotR\"></td>  	
			<td class=\"granTotR\">".number_format(($granTot+$granTotpro),2,'.',',')."</td> 						
		</tr>";
			echo "<tr>
			  <td></td>
			  <td colspan=\"5\">&nbsp;&nbsp;</td>
          </tr>";
//|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||//		
		
	} //cierra el tipo de pago

}
echo "<tr> 
			<td class=\"estiloSubTotal\" colspan=\"4\"> Numero Ventas Totales: $numVen</td>  						
			<td class=\"estiloSubTotal\"></td>  	
			<td class=\"estiloSubTotal\" align=\"right\">".number_format(($granTotpro2+$granTot2),2,'.',',')."</td> 						
		</tr>";
?>	
    </table>
  </form>
</div>
</body>
</html>
