<?php
				
$datos['criterio']='por_listado_entrada';			
$filas = $objsiv->ConsultaMovCostos($datos);

$ancho[1] = 60;
$ancho[2] = 60;
$ancho[3] = 60;
$ancho[4] = 150;
$ancho[5] = 60;
$ancho[6] = 100;
$ancho[7] = 100;

		
$ancho_total = array_sum($ancho);
			
if(!$filas['rs']->RecordCount()){
	//$mensaje = 'No hay movimientos de costo para esta entrada de Inventario.<br>';
	//$objsiv->io_conexiones->mensajes_ajax($mensaje);
	exit();
}
$clave=1;
?>

<link href="../shared/css/catalogos.css" rel="stylesheet" type="text/css">
<link href="../shared/css/tablas.css" rel="stylesheet" type="text/css">
<br /><br />
<table width="<?php echo $ancho_total; ?>" border="0" cellpadding="0" cellspacing="0"   class='fondo-tabla'>
  <tr class="titulo-celda">
    <td width="<?php echo $ancho[1] ?>" align="center">Num. Ord.</td>
    <td width="<?php echo $ancho[2] ?>" align="center">Num. Recep.</td>
    <td width="<?php echo $ancho[3] ?>" align="center">Nro Mov</td>
    <td width="<?php echo $ancho[4] ?>" align="center">Desc. Costo</td>
    <td width="<?php echo $ancho[5] ?>" align="center">Tipo Costo</td>
    <td width="<?php echo $ancho[6] ?>" align="center">Valor</td>
    <td width="<?php echo $ancho[7] ?>" align="center">Factor</td>
  </tr>

  <?php foreach($filas['rs'] as $datosRow) {
		   	
        $aceptar = 'onClick="ObjForm.CargarMov('."'".$datosRow['numordcom']."','".
												     $datosRow['numconrec']."','".
												     $datosRow['nummovcos']."','".
												     $datosRow['codconcos']."','".	
													 $datosRow['tipconcos']."','".											     
	   $objsiv->io_conexiones->formatea_fecha_normal($datosRow['fecconcos'])."','".
									   number_format($datosRow['valmovcos'],2,',','.')."','".
									   number_format($datosRow['factorcos'],2,',','.')."','".
												     $clave."');  return false;".'"';
        		
		
    ?>
       <tr id="consulta" <?php echo $color_fila; ?> > 
          <td width="<?php echo $ancho[1] ?>" align="center"><a href="#" <?php echo $aceptar; ?>><div style="color:#189FBC;padding-right:10px;"><?php echo $datosRow['numordcom']; ?></div></a></td>
          <td width="<?php echo $ancho[2] ?>" align="center"><a href="#" <?php echo $aceptar; ?>><div style="color:#189FBC;padding-right:10px;"><?php echo $datosRow['numconrec']; ?></div></a></td>
          <td width="<?php echo $ancho[3] ?>" align="center"><a href="#" <?php echo $aceptar; ?>><div style="color:#189FBC;padding-right:10px;"><?php echo $datosRow['nummovcos']; ?></div></a></td>
          <td width="<?php echo $ancho[4] ?>" align="center"><a href="#" <?php echo $aceptar; ?>><?php echo $datosRow['desconcos']; ?></a></td>
          <td width="<?php echo $ancho[5] ?>" align="left"><a href="#" <?php echo $aceptar; ?>><?php echo $datosRow['tipconcos']; ?></a></td>
          <td width="<?php echo $ancho[6] ?>" align="left"><a href="#" <?php echo $aceptar; ?>><?php echo number_format($datosRow['valmovcos'],2,',','.'); ?></a></td>
          <td width="<?php echo $ancho[7] ?>" align="center"><a href="#" <?php echo $aceptar; ?>><?php echo number_format($datosRow['factorcos'],2,',','.'); ?></a></td>
      </tr>
      <tr>
        <td height="1" bgcolor="#BBBBBB" colspan="5">
            <input name="hobsmovcos<?php echo $clave;?>" type="hidden" id="hobsmovcos<?php echo $clave;?>"  value="<?php echo $datosRow['obsmovcos']; ?>"/>
            <input name="hdesconcos<?php echo $clave;?>" type="hidden" id="hdesconcos<?php echo $clave;?>"  value="<?php echo $datosRow['desconcos']; ?>"/>
         </td>
      </tr>

  <?php $clave++; } ?>
</table>
<br /><br />	         