<?php
 
session_start();
$com = "C"; 
include("DMMYSQLG.php");
include("DF30000.inc");
include("DMMYSQLG.php");
?>
<html>
<link rel="stylesheet" href="css/estilo1.css" type="text/css"/>
<script type="text/javascript" language="JavaScript1.2" src="DSSCRIPT.js"></script>
<body>
<?php
 
$sql = mysqli_query($con ,"select * from dvnotcre where n_reg = '".$_REQUEST['bot']."'");
$res=mysqli_fetch_array($sql); 
?>
<form name="frm1" id="frm1" method="post" >
<input name="bot" type="hidden" 
	<?php
 
	if(isset($_REQUEST['bot1'])){
		echo 'value="'.$_REQUEST['bot'].'"';		
	}
	?>
	>
  <table width="756"  align="center">
    <tr>
      <td colspan="6" class="mentab"><div align="left">Documento Numero: 
	  <?php
 echo $res['num_not'];  ?>
</div></td>
    </tr>
    <tr>
      <th colspan="6">CONSLUTAR NOTA CREDITO </th>
    </tr>
    <tr>
      <td>Nota de Credito </td>
      <td>
	  <?php
 
		@$resultado=mysqli_query($con ,"select * from dvtinotc where tip_not = '".$res['tip_not']."'");
		@$registro=mysqli_fetch_array($resultado);
	  echo $registro['des_not']; 
	  ?>&nbsp;</td>
      <td>Factura</td>
      <td><?php
 
	  echo $res['num_noa']; 
	  ?></td>
      <td>Genera Poliza </td>
      <td><?php
 
	  echo $res['gen_pol']; 
	  ?></td>
    </tr>
    <tr>
      <td>Cliente:</td>
      <td>
	  <?php
 
	  $sqlx = mysqli_query($con ,"select * from dxbascps where codigo = '".$res['codigo']."'");
	  $resx=mysqli_fetch_array($sqlx); 
	  echo $resx['nombre']. ' ' . $resx['ap_paterno']. ' ' . $resx['ap_materno']; 
	  ?>&nbsp;</td>
      <td>Fecha:</td>
      <td><?php
 
	  $fec1 = $res['fec_doc'];
	  include('DF20000.php');
	  echo $f_f; 
	  ?>&nbsp;</td>
      <td>Sub-Total:</td>
      <td><?php
 
	  echo '$' . number_format($res['sub_not'], 2, '.', ','); 
	  ?></td>
    </tr>
    <tr>
      <td>movimiento</td>
      <td><?php
 
	 
	  if ($reg['cve_mto'] == "D") echo "DESCUENTO";
	  else echo "CANCELACION";
	  ?></td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
      <td>&nbsp;</td>
    </tr>
  </table>

  <table width="756"  align="center">
    <tr>
      <th colspan="5">Detalle de Documentos </th>
    </tr>
    <tr>
      <th colspan="5" class="inputcodigo"><div align="left"></div></th>
    </tr>
    <tr>
      <td width="130"><div align="center">Con</div></td>
      <td width="183"><div align="center">Fol_mov</div></td>
      <td width="126"><div align="center">Total </div></td>
      <td width="236"><div align="center">movimiento</div></td>
    </tr>
	<?php
 
	
	@$sql = mysqli_query($con ,"select * from dvnotcrd where n_nota = '".$_REQUEST['bot']."'");

	$j=0;
	while(@$res=mysqli_fetch_array($sql)){
	$j += 1;
	echo '<tr>';
		echo '<td><div align="center">'.$j.'&nbsp;</div></td>';
		echo '<td><div align="center">'.$res['num_not'].'&nbsp;</div></td>';
		$nd = $res['num_not'];
		echo '<td><div align="center">'.'$' . number_format($res['total'], 2, '.', ',').'&nbsp;</div></td>';
		if ($reg['cve_mto'] == "D") $des =  "DESCUENTO";
	  else $des = "CANCELACION";
		echo '<td><div align="center">'.$des .'&nbsp;</div></td>';
	echo '</tr>';
	}	
	?>
  </table>
  <div align="center">
<?php
 
	if(isset($_REQUEST['Submit3'])){
		echo '<input name="Submit4" type="submit" value = "Guardar Modificacion">';
	}
?>
  </div>
  <p>
    <input name="Submit5" type="submit" id="Submit5" value="Regresar" onClick="openpage('DV33000_PR.php','_self')">
  </p>
</form>
</body>
</html>
