<?php
include 'header.php';
include 'erpc_condicao_pagamento_toolbar.php';
?>

<!-- Nav tabs -->
<ul class="nav nav-tabs" role="tablist">
  <li role="presentation" class="active"><a id="mform1" href="#form1" aria-controls="form1" role="tab" data-toggle="tab">Cadastro</a></li>
  <li role="presentation"><a id="mform2" href="#form2" aria-controls="form2" role="tab" data-toggle="tab">Simulação</a></li>
</ul>

<form id=validate_custom method=POST action="erpc_condicao_pagamento_ws.php" >
<!-- Tab panes -->
<div class="tab-content">
  <div role="tabpanel" class="tab-pane fade in active" id="form1">
    <div class="block">
    <div class="content controls">

      <div class=form-row>
         <div class=col-md-2><label>Descrição do Tipo</label></div>
         <div class=col-md-6><input name="ds_condicao" id="ds_condicao" class="validate[required]"></div>
      </div>

      <div class="form-row">
        <div class="col-md-2"><label>Tipo</label></div>
        <div class="col-md-2">
          <div class="input-group">
          <input name="id_tipo" id="id_tipo"/>
            <div class="input-group-addon">
                <a href="erpc_dom_tipo_condicao_pagamento_helper.php" class='input-helper' data-remote="false" data-toggle="modal" data-target="#helper-modal-div" data-value="#id_tipo" data-description="#ds_tipo" data-title="Selecione:">
                <span class="fa fa-search"></span></a>
            </div>
          </div>
        </div>
        <div class="col-md-4"><input id="ds_tipo" readonly></div>
      </div>

      <div class=form-row>
         <div class=col-md-2><label>Quantidade de Parcelas</label></div>
         <div class=col-md-2><input type=number name="nr_qtde_parcelas" id="nr_qtde_parcelas" min="0" class="validate[required]"></div>
      </div>
      
      <div class=form-row>
         <div class=col-md-2><label>Dia</label></div>
         <div class=col-md-2><input name="nr_dia" id="nr_dia" min="0" max="31" class="validate[required]"></div>
      </div>

      <div class=form-row>
         <div class=col-md-2><label>Estrutura</label></div>
         <div class=col-md-2><input name="ds_estrutura" id="ds_estrutura"></div>
      </div>

      <div class=form-row>
         <div class=col-md-2><label>Gera Título Financeiro</label></div>
         <div class=col-md-2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<input type=checkbox name="fl_gera_titulo" id="fl_gera_titulo"></div>
      </div>
      
      <div class="form-row">
        <div class="col-md-2"><label>Cheque</label></div>
        <div class="col-md-4">
          <select name="fl_cheque" id="fl_cheque" class="validate[required]">
            <option value="1">Sim</option>
            <option value="0">Não</option>
          </select>
        </div>
      </div>


      <div class="form-row">
        <div class="col-md-2"><label>ICMS Solid</label></div>
        <div class="col-md-4">
          <select name="id_icm_solidario" id="id_icm_solidario" class="validate[required]">
            <option value="1">Normal</option>
            <option value="2">Junto</option>
            <option value="3">Separado</option>
          </select>
        </div>
      </div>

      <div class="form-row">
        <div class="col-md-2"><label>IPI Solid</label></div>
        <div class="col-md-4">
          <select name="id_ipi" id="id_ipi" class="validate[required]">
            <option value="1">Normal</option>
            <option value="2">Junto</option>
            <option value="3">Separado</option>
          </select>
        </div>
      </div>


      <div class=form-row>
         <div class=col-md-2><label>% Juros Adicionais</label></div>
         <div class=col-md-2><input name="vl_perc_juros_adicionais" id="vl_perc_juros_adicionais" min="0" step="0.01" class="validate[required]"></div>
      </div>
    </div>
    </div>
  </div>


  <div role="tabpanel" class="tab-pane fade" id="form2" hidden>
    <div class="block">
      <div class="content controls">
        <div class="form-row">
          <div class="col-md-2"><label>Valor de Referencia</label></div>
          <div class="col-md-2"><input type=number name="nr_valor_referencia" id="nr_valor_referencia" min=0 step="0.01"/></div>
        </div>

        <div class="form-row">
          <div class="col-md-2"><label>Data de Referencia</label></div>
          <div class="col-md-2"><input name="dt_referencia" id="dt_referencia" class="datepicker"/></div>
        </div>

        <div class="form-row">
          <div class="col-md-2"><label>Valor de IPI</label></div>
          <div class="col-md-2"><input type=number name="nr_valor_ipi" id="nr_valor_ipi" min=0 step="0.01"/></div>
        </div>

        <div class="form-row">
          <div class="col-md-2"><label>Valor de ICMS Solid</label></div>
          <div class="col-md-2"><input type=number name="nr_valor_icms" id="nr_valor_icms" min=0 step="0.01"/></div>
        </div>

        <div class="form-row">
          <div class="col-md-2">
            <button type="button" name="btn-simular" id="btn-simular"/></button>
          </div>
        </div>

        <div class="form-row">
          <div class="col-md-2"><label>Resultado</label></div>
          <div class="col-md-4"><input name="tx_resultado" id="tx_resultado" readonly/></div>
        </div>
      </div>
    </div>
  </div>

  <!-- Botão submit -->
  <div class=footer>
      <div class="side pull-right">
        <div class=btn-group>
          <button class="btn btn-default" type="button" onClick="window.history.go(-1)" value="Voltar">Voltar</button>
          <button class="btn btn-success" type="submit" value="adicionar" onClick="$('#validate_custom').validationEngine('hide');" name="adicionar">Adicionar</button>
        </div>
      </div>
    </div>

</div>
</form>

<!-- modal do helper -->
<div class="row-clear">&nbsp;</div>
<div class="modal modal-white modal-draggable fade" id="helper-modal-div" tabindex="-1" role="dialog" aria-labelledby="helper-modal-label" aria-hidden="true">
  <div class="modal-dialog modal-lg">
    <div class="modal-content">
      <div class="modal-header">
        <button type="button" class="close" data-dismiss="modal" aria-label="Close">
          <span aria-hidden="true">&times;</span></button>
        <h4 class="modal-title" id="helper-modal-label">Helper</h4>
      </div>
      <div class="modal-body">
        ...
      </div>
      <div class="modal-footer">
        <button type="button" class="btn btn-default" data-dismiss="modal" id="modalCancel">Cancelar</button>
        <button type="button" class="btn btn-primary" data-dismiss="modal" id="modalOk" disabled="disabled">Selecionar</button>
      </div>
    </div>
  </div>
</div>

<?php include 'footer.php'; ?>
<script type="text/javascript" src="js/acme.js"></script>
