<?php

$to=0;
$query=mysqli_query($con,"SELECT * , DATE_FORMAT(`ven_fecha`,'%d-%m-%Y') as ven_fecha FROM ventas where ven_id='$ven_id' and empresa='$empresa' ");
$roww=mysqli_fetch_array($query);
$ven_cc=$roww['ven_cc'];
$estado_dian=$roww['estado_dian'];
$Cliente_clie_id=$roww['Cliente_clie_id'];
$ven_nombre=$roww['ven_nombre'];
$ven_telefono=$roww['ven_telefono'];
$ven_fecha=$roww['ven_fecha'];
$ven_estado=$roww['ven_estado'];
$ven_prefijo=$roww['ven_prefijo']; 
$ven_n_venta=$roww['ven_n_venta']; 
$ven_forma_de_pago=$roww['ven_forma_de_pago'];
$ven_dias=$roww['ven_dias'];
$cufe=$roww['cufe'];
$vendedor=$roww['vendedor'];
$ven_tipo=$roww['ven_tipo'];
$observaciones=$roww['observaciones'];
$ven_ser_id=$roww['ven_ser_id'];



$resol=mysqli_query($con,"SELECT * FROM serie_factura where ser_id='$ven_ser_id' ") or die(mysqli_error($con)); 
$res=mysqli_fetch_array($resol);
$result = mysqli_num_rows($resol);
$ser_inicio=$res['ser_inicio'];
$ser_resolucion=$res['ser_resolucion'];
$ser_fecha=$res['ser_fecha'];
$ser_fin=$res['ser_fin'];
$ser_fecha_ven=$res['ser_fecha_ven'];



$dir=mysqli_query($con,"SELECT * FROM cliente where clie_id='$Cliente_clie_id'") or die(mysqli_error($con)); 
$dire=mysqli_fetch_array($dir);
$clie_dv=$dire['clie_dv'];
$clie_direccion=$dire['clie_direccion'];
$clie_correo=$dire['clie_correo'];
$clie_departamento=$dire['clie_departamento'];
$clie_ciudad=$dire['clie_ciudad'];

$dep=mysqli_query($api,"SELECT * from departments where id='$clie_departamento'");
$depa=mysqli_fetch_array($dep);
$name_departameto=$depa['name'];

$ciu=mysqli_query($api,"SELECT * from municipalities where id='$clie_ciudad'");
$ciud=mysqli_fetch_array($ciu);
$name=$ciud['name'];

$sql3=mysqli_query($con,"SELECT * from usuario where usu_id='$vendedor'");
$usu=mysqli_fetch_array($sql3);
$usu_nombre=$usu['usu_nombre'];

$vence = strtotime($ven_fecha."+ ".$ven_dias." days");
                date("Y-m-d",$vence) . "\n";
                $fecha=date('Y-m-d ');

$hasta=date("d-m-Y",$vence) . "\n";

          
$sumador_combo=0;
$sumador_total=0;

$neto=0;
$total_descuento=0;
$total_iva=0;
$total_retencion=0;
$sumador_articulos=0;

$ret=mysqli_query($con, "SELECT * FROM retencion_venta where ventas_ven_id='$ven_id' ") or die(mysqli_error($con)); 
$rets=mysqli_fetch_array($ret);
$ret_porcentaje=$rets['porcentaje'];

$sql=mysqli_query($con, "SELECT * from venta_detalle where ventas_ven_id='$ven_id'");
while ($row=mysqli_fetch_array($sql))
{
    
    $vend_referencia=$row['vend_referencia'];
    $vend_nombre=$row['vend_nombre'];
    $vend_cantidad=$row['vend_cantidad'];
    $vend_precio=$row['vend_precio']; //1.000.000
    $vend_iva=$row['vend_iva']; //19%
    $vend_descuento=$row['vend_desc']; //10%

    $iva0=$vend_iva/100; //0.19
    $iva1=1+$iva0; //1.19

    $precio_total_item=$vend_precio*$vend_cantidad;//precio normal 1.000.000
	$precio_total_sin_iva_item=($vend_precio/$iva1)*$vend_cantidad; //precio sin iva  840.336
	$descuento_item=($vend_descuento/100)*$precio_total_sin_iva_item; //descuento_item 84.033
	$total_iva_item=$precio_total_sin_iva_item*$iva0; // total iva  159.336

	$neto+=$precio_total_sin_iva_item;
	$total_descuento+=$descuento_item;
	$total_iva+=$total_iva_item;

	$sumador_articulos=($neto+$total_iva)-$total_descuento;
}

$total_retencion+=($neto+$sumador_combo-$total_descuento)*($ret_porcentaje/100);
$sumador_total=$sumador_articulos+$sumador_combo-$total_retencion;

$dir = '../../temp/';
if (!file_exists($dir))
    mkdir($dir);
$filename = $dir.'test.png';
$numfac=$ven_prefijo.$ven_n_venta;//numero de factura
$fecfac=$ven_fecha;//fecha de facturas
$nitfac=$emp_nit;//nit de empresa
$docadq=$ven_cc;//documento del clienta
$valfac=round($neto,2);//neto
$valiva=round($total_iva,2);//iva
$valotroim=round($total_descuento,2);//descuento
$valfaclm=round($sumador_total,2);//total
$cufe=$cufe;//cufe
$tamaño = 10; //Tamaño de Pixel
$level = 'L'; //Precisión Baja
$framSize = 3; //Tamaño en blanco
$contenido = 'NumFac: '.$numfac.PHP_EOL.'FecFac: '.$fecfac.PHP_EOL.'NitFac: '.$nitfac.PHP_EOL.'DocAdq: '.$docadq.PHP_EOL.'ValFac: '.$valfac.PHP_EOL.'ValIva: '.$valiva.PHP_EOL.'ValOtroIm: '.$valotroim.PHP_EOL.'ValTotal: '.$valfaclm.PHP_EOL.'CUFE: '.$cufe.PHP_EOL.'https://catalogo-vpfe.dian.gov.co/document/searchqr?documentkey='.$cufe; //Texto

QRcode::png($contenido, $filename, $level, $tamaño, $framSize); 
$qr=$dir.basename($filename);

?>
<page backtop="1mm" backbottom="5mm" backleft="5mm" backright="5mm" style="font-size: 11pt; font-family: arial" >
    <table cellspacing="0" style="width: 100%;" >
        <tr>
            <td style="width: 33%; color: #444444;">
                <img style="width: 80%;" src="../../../img/<?php echo $empresa;?>.png" alt="Logo"><br>
            </td>
			<td style="width: 34%; font-size:12px;text-align:center;">
				<strong style="font-size:15px"><?php echo $emp_nombre;?></strong><br>
				<strong>Nit: <?php echo $emp_nit;?></strong> <br>
				<strong><?php echo $emp_direccion;?></strong><br>
				<strong><?php echo $emp_correo;?></strong><br>
				<strong>Tel: <?php echo $emp_cel;?> / <?php echo $emp_telefono;?></strong><br>
				<!--<strong>Responsable de IVA </strong><br> 
				<strong>Agente de retención en el impuesto sobre las ventas</strong>-->
			</td>
			<td style="width: 21%;"></td>
			<?php if($estado_dian=='Aprobada'){?>
			<td style="width: 12%;"><img style="width: 100%;" align="right" src="<?php echo $qr; ?>" alt="Logo"></td>
		    <?php } ?>
        </tr>
    </table>
    <div style="text-align: center;font-size:9px;padding-bottom:0px;">
<p><?php echo $texto_cabeza; ?></p></div>


<div style="text-align: right;font-size:8px;padding-bottom:0px;"><p>Resolucion de Facturación <?php echo $roww['ven_tipo']; ?> No. <?php echo $ser_resolucion; ?> de <?php echo $ser_fecha; ?>, Rango <?php echo $ser_inicio; ?> Al <?php echo $ser_fin; ?> - Vigencia Desde: <?php echo $ser_fecha ?> Hasta: <?php echo $ser_fecha_ven; ?></p></div>


 	<table cellspacing="0" style="width: 100%;" >
        <tr>
             <td style="width: 70%;">
                <table cellspacing="0">
                    <tr>
                        <td  style="background-color:#bdc3c7;padding:2px;text-align:center;"> 
                            <strong style="font-size:10px;color: #000" >DATOS DEL CLIENTE</strong>
                        </td>
                    </tr>
					<tr>
						<td style="width: 100%;text-align:left;border:solid 1px #bdc3c7;font-size:10px ;padding-left: 15px"> 
							<p style="padding:-10px;"><strong>NOMBRE: </strong><?php echo $ven_nombre;?></p>
							<p style="padding:-10px;"><strong>DOCUMENTO: </strong><?php echo $ven_cc;?>-<?php echo $clie_dv;?></p>
							<p style="padding:-10px;"><strong>TELEFONO: </strong><?php echo $ven_telefono;?></p>
							<p style="padding:-10px;"><strong>DIRECCION: </strong><?php echo $clie_direccion;?> </p>
							<p style="padding:-10px;"><strong>CIUDAD: </strong> <?php echo mb_strtoupper($name_departameto);?> - <?php echo mb_strtoupper($name);?></p>
							<p style="padding:-10px;"><strong>CORREO: </strong><?php echo mb_strtoupper($clie_correo);?> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <strong>FORMA DE PAGO: </strong><?php echo mb_strtoupper($ven_forma_de_pago);?></p>
						</td>
					</tr>
			    </table>
            </td>
			<td style="width: 30%;">
				<table cellspacing="0" style="width: 100%; padding-left:5px">
			        <tr>
						<td style="width: 100%;color:white;background-color:#bdc3c7;padding:2px;text-align:center"> 
							<strong style="font-size:10px;color: #000" >FACTURA DE VENTA N°</strong>
						</td>
					</tr>
					<tr>
						<td style="width: 100%;padding:2px;text-align:center;border:solid 1px #bdc3c7;font-size:12px"> 
							<strong style="color: red"><?php echo $ven_prefijo;echo $ven_n_venta;?></strong>
						</td>
					</tr>
			    </table>
			    <table cellspacing="0" style="width: 100%;padding-left: 5px; padding-top: 5px;">
					<tr>
						<td style="width: 100%;text-align:left;border:solid 1px #bdc3c7;font-size:10px ;padding-left: 15px;"> 
							<p style="padding:-10px;"><strong>FECHA FACTURACION: </strong><?php echo $ven_fecha;?></p>
							<p style="padding:-10px;"><strong>FECHA VENCIMIENTO: </strong><?php echo $hasta;?></p>
							<p style="padding:-10px;"><strong>VENDEDOR: </strong><?php echo $usu_nombre;?></p>
						</td>
					</tr>
			    </table>
			</td>
		</tr>
    </table>



	<table cellspacing="0" style="width: 100%; padding-top: 5px;">
        <tr>
			<td style="width: 10%;color:white;background-color:#bdc3c7;padding:2px;text-align:center"> 
				<strong style="font-size:10px;color: #000">REF</strong>
			</td>
			<td style="width: 5%; color:white;background-color:#bdc3c7;padding:2px;text-align:center"> 
				<strong style="font-size:10px;color: #000">CANT</strong>
			</td>
			<td style="width: 5%; color:white;background-color:#bdc3c7;padding:2px;text-align:center"> 
				<strong style="font-size:10px;color: #000">GTIA</strong>
			</td>
			<td style="width: 50%; color:white;background-color:#bdc3c7;padding:2px;text-align:center"> 
				<strong style="font-size:10px;color: #000">DESCRIPCIÓN</strong>
			</td>
			
			<td style="width: 8%; color:white;background-color:#bdc3c7;padding:2px;text-align:center"> 
				<strong style="font-size:10px;color: #000">PRECIO U</strong>
			</td>
			<td style="width: 6%; color:white;background-color:#bdc3c7;padding:2px;text-align:center"> 
				<strong style="font-size:10px;color: #000">IVA %</strong>
			</td>
			<td style="width: 7%; color:white;background-color:#bdc3c7;padding:2px;text-align:center"> 
				<strong style="font-size:10px;color: #000">DESC %</strong>
			</td>
			<td style="width:9%; color:white;background-color:#bdc3c7;padding:2px;text-align:center"> 
				<strong style="font-size:10px;color: #000">TOTAL</strong>
			</td>
		</tr>
<?php
$suma=0;

$sumador_combo=0;
$sumador_total=0;

$neto=0;
$total_descuento=0;
$total_iva=0;
$total_retencion=0;
$sumador_articulos=0;

$ret=mysqli_query($con, "SELECT * FROM retencion_venta where ventas_ven_id='$ven_id' ") or die(mysqli_error($con)); 
$rets=mysqli_fetch_array($ret);
$ret_porcentaje=$rets['porcentaje'];

$sqli=mysqli_query($con, "SELECT COUNT(*) AS items from venta_detalle where ventas_ven_id='$ven_id'");
$rowi=mysqli_fetch_array($sqli);
$items=$rowi['items'];

$sql=mysqli_query($con, "SELECT * from venta_detalle where ventas_ven_id='$ven_id'");
while ($row=mysqli_fetch_array($sql))
{
    
    $vend_id=$row['vend_id'];
    $vend_art_id=$row['vend_art_id'];
    $vend_referencia=$row['vend_referencia'];
    $vend_nombre=$row['vend_nombre'];
    $vend_cantidad=$row['vend_cantidad'];
    $vend_precio=$row['vend_precio']; //1.000.000
    $vend_iva=$row['vend_iva']; //19%
    $vend_descuento=$row['vend_desc']; //10%
    $suma+=$row['vend_cantidad'];

    $iva0=$vend_iva/100; //0.19
    $iva1=1+$iva0; //1.19
	
	$precio_total_item=$vend_precio*$vend_cantidad;//precio normal 1.000.000
	$precio_unit_sin_iva_item=($vend_precio/$iva1); //precio sin iva  840.336
	$precio_total_sin_iva_item=($vend_precio/$iva1)*$vend_cantidad; //precio sin iva  840.336
	$descuento_item=($vend_descuento/100)*$precio_total_sin_iva_item; //descuento_item 84.033
	$total_iva_item=$precio_total_sin_iva_item*$iva0; // total iva  159.336

	$neto+=$precio_total_sin_iva_item;
	$total_descuento+=$descuento_item;
	$total_iva+=$total_iva_item;

	$sumador_articulos=($neto+$total_iva)-$total_descuento;


    $gar=mysqli_query($con,"SELECT * FROM articulos where art_id='$vend_art_id' and empresa='$empresa'") ;
    $gar=mysqli_fetch_array($gar);

?>		
		<tr>
			<td style="width:10%;padding:2px;text-align:center;border-left:solid 1px #bdc3c7; border-bottom:solid 1px #bdc3c7;font-size:9px"> 
				<?php echo $vend_referencia;?>
			</td>
			<td style="width:5%;padding:2px;text-align:center;border-left:solid 1px #bdc3c7; border-bottom:solid 1px #bdc3c7;font-size:9px"> 
				<?php echo $vend_cantidad;?>
			</td>
			<td style="width:5%;padding:2px;text-align:center;border-left:solid 1px #bdc3c7; border-bottom:solid 1px #bdc3c7;font-size:9px"> 
				<?php echo $gar['art_garantia'];?>
			</td>
			<td style="width: 50%;padding:2px;text-align:left;border-left:solid 1px #bdc3c7; border-bottom:solid 1px #bdc3c7;font-size:9px"> 
				<?php echo $vend_nombre;?>
				<?php 
				$art0=mysqli_query($con,"SELECT count(*) AS numrows FROM venta_detalle_sabores_productos WHERE vend_id='$vend_id'")or die(mysqli_error($con));
	            $row0=mysqli_fetch_array($art0);
	            $numrows = $row0['numrows'];
	            if($numrows>0)  
	            {
	                echo'('; $art=mysqli_query($con,"SELECT * FROM venta_detalle_sabores_productos WHERE vend_id='$vend_id'")or die(mysqli_error($con));
	                    while ($row1=mysqli_fetch_array($art))
	                    {
	                        echo $row1['sab_nombre'];
	                        echo '-';
	                    }
	                echo')';
	            } 

				$sql4=mysqli_query($con,"SELECT * from seriales where venta_detalle_vend_id='$vend_id'");
				$result4=mysqli_num_rows($sql4);
				if($result4>0)
				{ 
					echo '(- ';
					while ($row4=mysqli_fetch_array($sql4))
					{
						echo $row4['ser_codigo'];
						echo ' - ';
					}
					echo ')';
				}
				?>
			</td>
			
			<td style="width:8%;padding:2px;text-align:right;border-left:solid 1px #bdc3c7; border-bottom:solid 1px #bdc3c7;font-size:9px"> 
				<?php echo number_format($precio_unit_sin_iva_item,0);?>
			</td>
			<td style="width:6%;padding:2px;text-align:center;border-left:solid 1px #bdc3c7; border-bottom:solid 1px #bdc3c7;font-size:9px"> 
				<?php echo $vend_iva;?>
			</td>
			<td style="width:7%;padding:2px;text-align:center;border-left:solid 1px #bdc3c7; border-bottom:solid 1px #bdc3c7;font-size:9px"> 
				<?php echo $vend_descuento;?>
			</td>
			<td style="width: 9%;padding:2px;text-align:right;border-left:solid 1px #bdc3c7;border-right:solid 1px #bdc3c7; border-bottom:solid 1px #bdc3c7;font-size:9px"> 
				<?php echo number_format($precio_total_sin_iva_item,0);?>
			</td>
		</tr>
<?php } 

?>	


<?php
    $sumador_combo=0;
    $sql2=mysqli_query($con, "SELECT * from venta_detalle_combo where ven_id='$ven_id'");
    while ($row2=mysqli_fetch_array($sql2))
        {

            $precio=($row2['combo_cantidad']*$row2['combo_precio']);
            $sumador_combo+=$precio;
?>
       <tr>
			<td style="width:10%;padding:2px;text-align:center;border-left:solid 1px #bdc3c7; border-bottom:solid 1px #bdc3c7;font-size:9px"> 
				<?php //echo $row2['combo_nombre']; ?>
			</td>
			<td style="width:5%;padding:2px;text-align:center;border-left:solid 1px #bdc3c7; border-bottom:solid 1px #bdc3c7;font-size:9px"> 
				
			</td>
			<td style="width: 5%;padding:2px;text-align:left;border-left:solid 1px #bdc3c7; border-bottom:solid 1px #bdc3c7;font-size:9px"> 
				
			</td>
			<td style="width:50%;padding:2px;text-align:left;border-left:solid 1px #bdc3c7; border-bottom:solid 1px #bdc3c7;font-size:9px"> 
				<?php echo $row2['combo_nombre'];?>
			</td>
			
			
			
			<td style="width:8%;padding:2px;text-align:right;border-left:solid 1px #bdc3c7; border-bottom:solid 1px #bdc3c7;font-size:9px"> 
				<?php echo number_format($row2['combo_precio'],0);?>
			</td>
			<td style="width:6%;padding:2px;text-align:center;border-left:solid 1px #bdc3c7; border-bottom:solid 1px #bdc3c7;font-size:9px"> 
				<?php //echo $vend_iva;?>
			</td>
			<td style="width:7%;padding:2px;text-align:center;border-left:solid 1px #bdc3c7; border-bottom:solid 1px #bdc3c7;font-size:9px"> 
				<?php echo $row2['combo_desc'];?>
			</td>
			<td style="width: 9%;padding:2px;text-align:right;border-left:solid 1px #bdc3c7;border-right:solid 1px #bdc3c7; border-bottom:solid 1px #bdc3c7;font-size:9px"> 
				<?php echo number_format($precio,0);?>
			</td>
		</tr>
<?php }

$total_retencion+=($neto+$sumador_combo-$total_descuento)*($ret_porcentaje/100);
$sumador_total=$sumador_articulos+$sumador_combo-$total_retencion;

?>

		<tr>
			<td  style="padding:2px;text-align:right;border-left:solid 1px #bdc3c7;border-bottom:solid 1px #bdc3c7;font-size:8px">Total Unidades</td>
			<td  style="padding:2px;text-align:center;border-left:solid 1px #bdc3c7;border-bottom:solid 1px #bdc3c7;font-size:8px"><?php echo $suma; ?></td>
			<td colspan="6"  style="padding:2px;text-align:le;border-left:solid 1px #bdc3c7;border-bottom:solid 1px #bdc3c7;border-right:solid 1px #bdc3c7;font-size:8px">Total Items: <?php echo $items; ?></td>
		</tr>
    </table>


    <table cellspacing="0" style="width: 100%;padding-top: 5px;">
        <tr>
            <td style="width: 69%;">
            	<table cellspacing="0" style="width: 100%;">
			        <tr>
						<td style="width: 100%;color:white;background-color:#bdc3c7;padding:2px;text-align:center;"> 
							<strong style="font-size:10px;color: #000" >OBSERVACIONES</strong>
						</td>
					</tr>
				
					<tr>
						<td style="width: 100%;border-left:solid 1px #bdc3c7;border-bottom:solid 1px #bdc3c7;border-right:solid 1px #bdc3c7;"><strong style="font-size:8px;"><?php echo $observaciones;?> </strong>
						</td>
					</tr>
					<tr>
						<td>
							<table cellspacing="0" style="width: 100%;" >
								<tr>
									<td colspan="3" style="width: 100%;padding-bottom: 36px"></td>
								</tr>
								<tr>
									<td style="width: 45%;">_______________________________</td>
									<td style="width: 5%;"></td>
									<td style="width: 45%;">_____________________________</td>	
								</tr>
								<tr>
									<td style="width: 45%;font-size:8px;">Cliente C.C</td>
									<td style="width: 5%;"></td>
									<td style="width: 45%;font-size:8px;">Vendedor C.C</td>		
								</tr>
						    </table>
						</td>
					</tr>
			    </table>
            </td>
            <td style="width: 1%;"></td>
			<td style="width: 30%;">
				<table cellspacing="0" style="width: 100%;">
			        <tr>
						<td colspan="2" style="width: 100%;color:white;background-color:#bdc3c7;text-align:center;padding:2px;"> 
							<strong style="font-size:10px;color: #000" >TOTALES</strong>
						</td>
					</tr>
					<tr>
						<td style="width: 50%;padding:2px;text-align:center;border-bottom:solid 1px #bdc3c7;border-left:solid 1px #bdc3c7;font-size:10px;text-align:right;"> 
							NETO
						</td>
						<td style="width: 50%;padding:2px;text-align:center;border-bottom:solid 1px #bdc3c7;border-left:solid 1px #bdc3c7;border-right:solid 1px #bdc3c7;font-size:10px;text-align:right;"> 
							<?php echo number_format($neto,0); ?>
						</td>
					</tr>
					<tr>
						<td style="width: 50%;padding:2px;text-align:center;border-bottom:solid 1px #bdc3c7;border-left:solid 1px #bdc3c7;font-size:10px;text-align:right;"> 
							DESCUENTO
						</td>
						<td style="width: 50%;padding:2px;text-align:center;border-bottom:solid 1px #bdc3c7;border-left:solid 1px #bdc3c7;border-right:solid 1px #bdc3c7;font-size:10px;text-align:right;"> 
							<?php echo number_format($total_descuento,0); ?>
						</td>
					</tr>
					<tr>
						<td style="width: 50%;padding:2px;text-align:center;border-bottom:solid 1px #bdc3c7;border-left:solid 1px #bdc3c7;font-size:10px;text-align:right;"> 
							IVA
						</td>
						<td style="width: 50%;padding:2px;text-align:center;border-bottom:solid 1px #bdc3c7;border-left:solid 1px #bdc3c7;border-right:solid 1px #bdc3c7;font-size:10px;text-align:right;"> 
							<?php echo number_format($total_iva,0); ?>
						</td>
					</tr>
					<tr>
						<td style="width: 50%;padding:2px;text-align:center;border-bottom:solid 1px #bdc3c7;border-left:solid 1px #bdc3c7;font-size:10px;text-align:right;"> 
							RETENCION
						</td>
						<td style="width: 50%;padding:2px;text-align:center;border-bottom:solid 1px #bdc3c7;border-left:solid 1px #bdc3c7;border-right:solid 1px #bdc3c7;font-size:10px;text-align:right;"> 
							<?php echo number_format($total_retencion,0); ?>
						</td>
					</tr>
					<tr>
						<td style="width: 50%;padding:4px;text-align:center;border-bottom:solid 1px #bdc3c7;border-left:solid 1px #bdc3c7;font-size:10px;text-align:right;"> 
							TOTAL
						</td>
						<td style="width: 50%;padding:4px;text-align:center;border-bottom:solid 1px #bdc3c7;border-left:solid 1px #bdc3c7;border-right:solid 1px #bdc3c7;font-size:11px;text-align:right; color: red;"> 
							<strong><?php echo number_format($sumador_total,0); ?></strong>
						</td>
					</tr>
			    </table>
			</td>
		</tr>
    </table>

    <table cellspacing="0" style="width: 100%;padding-top: 5px">
        <tr>
			<td style="width: 100%;color:white;background-color:#bdc3c7;padding:2px;text-align:center;"> 
				<strong style="font-size:10px;color: #000" >CONDICIONES DE GARANTIA</strong>
			</td>
		</tr>
	
		<tr>
			<td style="width: 100%;border-left:solid 1px #bdc3c7;border-bottom:solid 1px #bdc3c7;border-right:solid 1px #bdc3c7;"><strong style="font-size:8px;"><?php echo $condiciones;?> </strong>
			</td>
		</tr>
    </table>
    <?php if($ven_tipo=='electronica'){?>
		<div style="font-size:8px;text-align: center;padding: 2px">Cufe: <?php echo $cufe;?></div>
	<?php } ?>
	
    <div style="font-size:8px; padding: 2px;text-align: center;">Impreso por | <?php echo $emp_nombre;?> - VICPOS - <?php echo $emp_url;?></div>
	<div style="width:100%; border-top:dashed 1px;margin-top:1mm;"></div>
	
	<!--<div style="padding-top:-400px;padding-left: 380px;" > <img src="../../../img/factura/cancelado.png" style="width: 60%;" /></div>-->

	
</page>	  