<?php
session_start();
$ruta='../';
require_once("clases/covensol_cxc_c_cuentasxcobrar.php");
$objcxc = new covensol_cxc_cuentasxcobrar();
$objcxc->io_conexiones->decodificar_post();
$datos = $objcxc->io_conexiones->asignar_post();
$resp = $objcxc->MonedaPorDefecto();
		
$datos['datosGrid'] = stripslashes($datos['datosGrid']);
$ObjJson = $objcxc->json->decode($datos['datosGrid']);
//print_r($ObjJson);
if(!$ObjJson->RecordCount){exit();}

$ancho[0] = 10;
$ancho[1] = 250;
$ancho[2] = 60;
$ancho[3] = 60;
$ancho[4] = 150;
$ancho[5] = 120;
$ancho[6] = 70;
$ancho[7] = 100;
$ancho[8] = 100;
$ancho[9] = 100;
$ancho[10] = 100;
$ancho[11] = 100;	
$ancho_total = array_sum($ancho);
$clave = 1;
?>
<link href="../shared/css/tablas.css" rel="stylesheet" type="text/css">
<link href="../shared/css/ventanas.css" rel="stylesheet" type="text/css">
<link href="../shared/css/cabecera.css" rel="stylesheet" type="text/css">
<link href="../shared/css/general.css" rel="stylesheet" type="text/css">
<table width="<?php echo $ancho_total + 50; ?>" border="0" align="center" cellpadding="0" cellspacing="20" class="contorno">
      <tr>
        <td >
            <table id="GridRetFact" width="<?php echo $ancho_total; ?>" border="1" cellpadding="0" cellspacing=""  bordercolor="#CCCCCC" bgcolor="#FFFFFF" style="border-collapse:collapse">
              <tr class="titulo-celda">
                <td width="<?php echo $ancho[0] ?>" align="center"></td>
                <td width="<?php echo $ancho[1] ?>" align="center">Agen. Ret.</td>
                <td width="<?php echo $ancho[2] ?>" align="center">Tipo</td>
                <td width="<?php echo $ancho[3] ?>" align="center">N°</td>
                <td width="<?php echo $ancho[4] ?>" align="center">Desc Ret</td>
                <td width="<?php echo $ancho[5] ?>" align="center">Comp</td>
                <td width="<?php echo $ancho[6] ?>" align="center">Fecha</td>
                <td width="<?php echo $ancho[7] ?>" align="center">Base Imp</td>
                <td width="<?php echo $ancho[8] ?>" align="center">Iva(%)</td>
                <td width="<?php echo $ancho[9] ?>" align="center">Monimp</td>                
                <td width="<?php echo $ancho[10] ?>" align="center">Ret(%)</td>
                <td width="<?php echo $ancho[11] ?>" align="center">Mon Ret(<?php echo $objcxc->DatosMonedaDef['abrmon'] ?>)</td>              
              </tr>
              <?php 
			  
			  try{
					foreach($ObjJson->datos as $datosGrid) {				
																															
														
							?>
						   <tr id="consulta" <?php echo $color_fila; ?> >
							  <td width="<?php echo $ancho[0] ?>" align="right"><img src="../shared/imagebank/tools20/eliminar.gif" alt="aplicar" width="20" height="20" style="cursor:pointer"  onclick=" <?php echo $retornar; ?> ObjForm.EliminarRetFila('<?php echo $datosGrid->codded; ?>');" /></td>
							  <td width="<?php echo $ancho[1] ?>" align="left"><?php echo $datosGrid->nombre_cliente; ?></td> 
							  <td width="<?php echo $ancho[2] ?>" align="center"><?php echo $datosGrid->tipret; ?></td>
							  <td width="<?php echo $ancho[3] ?>" align="center"><?php echo $datosGrid->numretdoc; ?></td>
							  <td width="<?php echo $ancho[4] ?>" align="left"><?php echo $datosGrid->dended; ?></td>
							  <td width="<?php echo $ancho[5] ?>" align="center"><?php echo $datosGrid->numcom; ?></td>
							  <td width="<?php echo $ancho[6] ?>" align="center"><?php echo $datosGrid->feccomp; ?></td>
							  <td width="<?php echo $ancho[7] ?>" align="right"><?php echo $datosGrid->basimp; ?></td>
							  <td width="<?php echo $ancho[8] ?>" align="right"><?php echo $datosGrid->porimp; ?></td>
							  <td width="<?php echo $ancho[9] ?>" align="right"><?php echo $datosGrid->monimp; ?></td>
							  <td width="<?php echo $ancho[10] ?>" align="right"><?php echo $datosGrid->porcret; ?></td>
                              <td width="<?php echo $ancho[11] ?>" align="right"><?php echo $datosGrid->monret; ?>
                              <input name="txtcodret<?php echo $clave;?>" type="hidden" class="sin-borde" id="txtcodret<?php echo $clave;?>"  value="<?php echo $datosGrid->codded; ?>" />
                              </td>
							</tr>
			
			<?php 
							$clave++;  
				} 
			}
			catch(ErrorException $e){exit();}
			?>
            </table>	         
    </td>
   </tr>
 </table>