<?php
require_once 'header.php';
require_once 'connect.php';
require_once 'inc/usuario.php';

checkLogin('login.php');
?>

<form method="post" action="erpc_nfecode_devolucao_ws.php" id=validate_custom>
<div class="block">
  <div class="header">
    <h2>Emitir Nota Devolução</h2>
  </div>
  <div class="block">
    <div class="content">
      <?php
      displayMessagesAndErrors(true); ?>
    </div>
  </div> 

  <div class="content">
    <div class="form-row">
      <div class="col-md-3"><label>Pedido</label></div>
      <div class="col-md-2">
        <div class="input-group">
          <input required id="id_pedido" name="id_pedido" class="form-control"/>

        <div class="input-group-addon">
          <a href="erpc_nfecode_devolucao_helper.php" class='input-helper' data-remote="false" data-toggle="modal" data-target="#helper-modal-div" data-value="input[name='id_pedido']" data-description="input[name='ds_nome_cliente']" data-title="Selecione:">
          <span class="fa fa-search"></span></a>
         </div>
         </div>
         </div>
      <div class="col-md-4"><input readonly name="ds_nome_cliente" id="ds_nome_cliente"/></div>
    </div>

    <div class="form-row">
      <div class="col-md-3"><label>Nota Fiscal de Referência</label></div>
      <div class="col-md-2">
        <div class="input-group">
          <input id="ds_numnf_referencia" name="ds_numnf_referencia" class="form-control"/>

        <div class="input-group-addon">
          <a href="erpc_nfecode_devolucao_ref_helper.php" class='input-helper' data-remote="false" data-toggle="modal" data-target="#helper-modal-div" data-value="input[name='ds_numnf_referencia']" data-description="input[name='dt_emissao']" data-title="Selecione:">
          <span class="fa fa-search"></span></a>
         </div>
         </div>
         </div>
      <div class="col-md-7"><input readonly name="dt_emissao" id="dt_emissao"/></div>
    </div>

    <div class="form-row">
  		<div class="col-md-3"><label>Tipo</label></div>
  		<div class="col-md-4">
          <label class="radio-inline">
            <input required type=radio name="fl_tipo" value="0" /> Entrada </label>

  			<label  class="radio-inline">
  			    <input required type=radio name="fl_tipo" value="1" checked /> Saída </label>
  		</div>
  	</div>

    <!--
    <div class="form-row">
      <div class="col-md-3"><label>Justificativa</label></div>
      <div class="col-md-9">
          <input required type="text" name="ds_complementar_nfe" min="15" maxlength="255" />
      </div>
    </div>
    -->

  </div>

  <div class="clearfix">&nbsp</div>
</div>

  <div class="block">
    <div class="content controls">
      <div class="form-row">
        <div class="col-md-12 text-right">
          <button type="submit" name="btn-add" id="btn-add" class="btn btn-primary btn-cleanx" onClick="$('#validate_custom').validationEngine('hide');" >Adicionar</button>
          <button type="button" name="btn-voltar" id="btn-voltar" class="btn btn-default btn-cleanx">Voltar</button>
        </div>
      </div>
    </div>
  </div>

</form>

<? include 'inc/helper_modal_div.php'; ?>

<? require_once 'footer.php';?>
