<?php
  include("stilos/config.inc.php");
  include("../clases/BDConexion.php");
  include("../clases/clsReq.php");
  include("funcion/funciones.php");
  include("Funciones.php");
  session_start();
  $objPer=new clsReq;
  $resulta = $objPer->DevolverAutorizaciondepago($num_req);
  $resultprov =  $objPer->DevolverProvedor($ruc);
  $resultadoc=$objPer->DevolverDetalleAutorizaciondepago($num_req);
  $fila=$objPer->NextRow($resulta);
  $filap=$objPer->NextRow($resultprov);
  ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>.:: Impresion de Requisicion ::.</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="style.css" rel="stylesheet" type="text/css">

<link href="Estilos.css" rel="stylesheet" type="text/css">

<link href="stilos/Estilos.css" rel="stylesheet" type="text/css">
<SCRIPT language=JavaScript src="js/calendario.js"></SCRIPT>
<!-- Copyright 2000,2001 Macromedia, Inc. All rights reserved. -->
<script language="JavaScript"> 
<!--
function Abrir_Ventanapopup1(sURL,x,y) {
if (!window.focus) return;
			var par;
			par = "width=" +x + ",height="+y+","
			par = par + "dependent=no,scrollbars=yes,resizable=yes"
			par = par + "menubar=no,toolbar=no,status=no"
			var ventana = window.open(sURL,"Ver",par)
			ventana.focus();
}
//--> 
</script>

</head>

<body onLoad="print();">
<table width="723" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td height="10"><div align="center"></div></td>
  </tr>
  <tr>
    <td><div align="center">
      <table width="721" border="0" cellspacing="0" cellpadding="0" style="<?=$stylo['tabla']?>" bordercolor="<?=$bordetabla1?>">
        <tr class="lblCampo12" valign="top">
          <td width="208" height="80" >
              <div align="left"></div></td>
			  <td width="238"><div align="center" class="lblTituloReporteN">
            <p>&nbsp;</p>
            <p><u><br>
              <br>
              AUTORIZACION PARA GASTO</u> <br>              
            
			(OFICINA IQUITOS)			</p>
          </div></td>
          <td width="276"><div align="left" class="lblCampo12">
            <div align="right">
                    
                    <span class="camporesaltado"><img src="../imagenes/logo_perenco.GIF" width="270" height="90"></span></div>
          </div></td>
        </tr>
        <tr class="lblCampo12" valign="top">
          <td>&nbsp;</td>
          <td>&nbsp;</td>
          <td>&nbsp;</td>
        </tr>
        <tr class="lblCampo12" valign="top">
          <td colspan="3"><div align="left">
              <table width="721" border="0" cellspacing="0" cellpadding="0" style="<?=$stylo['tabla']?>" bordercolor="<?=$bordetabla1?>">
                <tr>
                  <td width="61" height="20"><div align="left"><strong>Direccion </strong></div></td>
                  <td width="10">:</td>
                  <td width="370">Canaval y Moreyra 380, Of. 1002 </td>
                  <td width="155"><strong>N&ordm; de Autorizaci&oacute;n </strong></td>
                  <td width="125"><div align="right">001 - 0<?=$fila['id_autoriza']?> </div></td>
                </tr>
                <tr>
                  <td height="20"><div align="left"><strong>RUC</strong></div></td>
                  <td>:</td>
                  <td>20332473388</td>
                  <td><strong>Fecha </strong></td>
                  <td><div align="right">
                    <?=extraerfechanormal($fila['fecha_a'])?>
                  </div></td>
                </tr>
                <tr>
                  <td height="20"><div align="left"><strong>Tel&eacute;fono</strong></div></td>
                  <td>:</td>
                  <td>01-6151600</td>
                  <td><strong>Condici&oacute;n de Pago</strong></td>
                  <td align="right"><?=$fila['condicion_pago']?></td>
                </tr>
                <tr>
                  <td height="20">&nbsp;</td>
                  <td>&nbsp;</td>
                  <td>&nbsp;</td>
                  <td><strong>Moneda</strong></td>
                  <td align="right"><?=$fila['tipo_moneda']?></td>
                </tr>
              </table>
          </div></td>
        </tr>
        <tr class="lblCampo12" valign="top">
          <td height="25" colspan="3">&nbsp;</td>
        </tr>
        <tr class="lblCampo12" valign="top">
          <td colspan="3"><div align="left">
            <table width="720" border="1" cellspacing="0" cellpadding="0" style="<?=$stylo['tabla']?>" bordercolor="<?=$bordetabla1?>">
              <tr>
                <td><div align="left">
                  <table width="718" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td width="83" height="25">Proveedor</td>
                      <td width="10">:</td>
                      <td width="625"><strong><?=$filap['razon_emp']?>
                      </strong></td>
                    </tr>
                    <tr>
                      <td height="25">RUC</td>
                      <td>:</td>
                      <td><strong><?=$filap['ruc_emp']?>
                      </strong></td>
                    </tr>
                  </table>
                </div></td>
              </tr>
            </table>
          </div></td>
        </tr>
        <tr>
          <td colspan="3"><div align="left">
              <table width="718" border="0" cellspacing="0" cellpadding="0">
                <tr class="lblCampo12">
                  <td><table width="720" border="0" cellspacing="0" cellpadding="0">
                    <tr>
                      <td><?=//$fila['tipo_doc_ref']?>  
                        <?=//$fila['n_doc_ref']?></td>
                    </tr>
                    <tr>
                      <td height="30">&nbsp;</td>
                    </tr>
                  </table></td>
                </tr>
                <tr valign="top">
                  <td height="500"><div align="left">
                      <table width="721" border="1" cellpadding="0" cellspacing="0" style="<?=$stylo['tabla']?>" bordercolor="<?=$bordetabla1?>">
                        <tr valign="top" class="lblCampo12" >
                          <td width="29" height="25"><div align="center"><strong>Item</strong></div>
                              <div align="center"></div></td>
                          <td width="263">
                            <div align="left"><strong>Descripcion</strong></div></td>
                          <td width="80"><div align="center"><strong>Tipo doc.</strong></div></td>
                          <td width="89"><div align="center"><strong>N&ordm; Doc. </strong></div></td>
                          <td width="49"><div align="center"><strong>UM</strong></div></td>
                          <td width="57"><div align="center"><strong>Cantidad</strong></div></td>
                          <td width="73"><div align="center"><strong>Precio</strong></div></td>
                          <td width="63"><div align="center"><strong>Total</strong></div></td>
                        </tr>
                        <? 
					  		$contar = 0;
							while ($filac=$objPer->NextRow($resultadoc)){ 
							  
				  	   ?>
                        <tr valign="top" class="lblCampo12" >
                          <td height="25" class="lblCampo12">
                            <div align="center"> <?= $contar = $contar + 1;  ?> </div></td>
                          <td class="lblCampo12">
                            <div align="left">
                              <?=$filac['descripciones'];?>
                          </div></td>
                          <td class="lblCampo12"><div align="center">
                            <?=$filac['tipodoc'];?>
                          </div></td>
                          <td class="lblCampo12"><div align="center">
                            <?=$filac['ndoc'];?>
                          </div></td>
                          <td class="lblCampo12">
                            <div align="center"><?=$filac['um'];?></div></td>
                          <td class="lblCampo12" align="center"><div align="center"><?=$filac['cantidad'];?>
                          </div></td>
                          <td class="lblCampo12"><div align="right"><?=$filac['precio'];?>
                          </div></td>
                          <td class="lblCampo12"><div align="right"><?=$filac['total'];?>
                          </div></td>
                        </tr>
                        <? 
						 }
			?>
                      </table>
                  </div></td>
                </tr>
                <tr>
                  <td>&nbsp;</td>
                </tr>
                <tr class="lblCampo12">
                  <td><div align="left">
                      <table width="720" border="0" cellspacing="0" cellpadding="0" style="<?=$stylo['tabla']?>" bordercolor="<?=$bordetabla1?>">
                        <tr valign="top">
                          <td width="484"><div align="left"><strong>Observaciones</strong><br>
                            </div>                            </td>
                          <td width="136">&nbsp;</td>
                          <td width="100">&nbsp;</td>
                        </tr>
                        <tr valign="top">
                          <td><table width="415" border="1" cellspacing="0" cellpadding="0" style="<?=$stylo['tabla']?>" bordercolor="<?=$bordetabla1?>">
                            <tr>
                              <td width="411" valign="middle"><p>                                <?=$fila['observacion']?>
                                  <br>
                                  <br>
                                  <br>
                                  <br>
                              </p>                                </td>
                            </tr>
                          </table></td>
                          <td><div align="left">
                            <table width="98" border="0" align="right" cellpadding="0" cellspacing="0">
                              <tr>
                                <td height="20"><strong>Sin IGV </strong></td>
                              </tr>
                              <tr>
                                <td height="20"><strong>IGV</strong></td>
                              </tr>
                              <tr>
                                <td height="20"><strong>TOTAL</strong></td>
                              </tr>
                            </table>
                          </div></td>
                          <td><table width="98" border="1" cellspacing="0" cellpadding="0" style="<?=$stylo['tabla']?>" bordercolor="<?=$bordetabla1?>">
                            <tr>
                              <td height="20" align="right"><?=$fila['total']?></td>
                            </tr>
                            <tr>
                              <td height="20" align="right"><?="-----"?></td>
                            </tr>
                            <tr>
                              <td height="20" align="right"><?=$fila['total']?></td>
                            </tr>
                          </table></td>
                        </tr>
                      </table>
                  </div></td>
                </tr>
                <tr class="lblCampo12">
                  <td height="20">&nbsp;</td>
                </tr>
                <tr class="lblCampo12">
                  <td>
                    <div align="center">
                      <table width="720" border="0" cellspacing="0" cellpadding="0" style="<?=$stylo['tabla']?>" bordercolor="<?=$bordetabla1?>">
                        <tr valign="top">
                          <td><div align="left">
                            <table width="720" border="1" cellspacing="0" cellpadding="0" style="<?=$stylo['tabla']?>" bordercolor="<?=$bordetabla1?>">
                              <tr>
                                <td width="234"><strong>Solicitado Por:</strong></td>
                                <td width="268"><strong>Aprobado Por </strong></td>
                                <td width="210"><strong>Representante de Proveedor:</strong></td>
                              </tr>
                            </table>
                            </div>                            </td>
                          </tr>
                        <tr valign="top">
                          <td><table width="720" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                              <td width="238" height="30"><div align="left"><strong>Nombre:
                                    <?=$fila['soli_nom']?>
                              </strong></div></td>
                              <td width="271"><div align="left"><strong>Nombre:
                                    <?=$fila['apro_nom']?>
                              </strong></div></td>
                              <td width="211"><div align="left"><strong>Nombre:
                                    <?=$fila['repre_prov']?>
                              </strong></div></td>
                            </tr>
                            <tr>
                              <td height="30"><div align="left"><strong>Fecha:
                                    <?php if($fila['soli_fecha'] =='0000-00-00'){echo "";}else{echo extraerfechanormal($fila['soli_fecha']);}?>
                              </strong></div></td>
                              <td><div align="left"><strong>Fecha:
                                    <?php if($fila['apro_fecha'] =='0000-00-00'){echo "";}else {echo extraerfechanormal($fila['apro_fecha']);}?>
                              </strong></div></td>
                              <td><div align="left"><strong>Fecha:
                                    <?php if($fila['fecha_repre_prov'] =='0000-00-00'){echo "";}else {echo extraerfechanormal($fila['fecha_repre_prov']);}?>
                              </strong></div></td>
                            </tr>
                            <tr>
                              <td height="30"><div align="left"><strong>Firma:</strong></div></td>
                              <td><div align="left"><strong>Firma:</strong></div></td>
                              <td><div align="left"><strong>Firma</strong></div></td>
                            </tr>
                          </table></td>
                          </tr>
                      </table>
                  </div></td>
                </tr>
              </table>
          </div></td>
        </tr>
        <tr class="lblCampo12">
          <td colspan="3"><div align="right"></div></td>
        </tr>
      </table>
    </div></td>
  </tr>
</table>
</body>

</html>

