<div class="portlet-body form">
  <%= form_tag(generate_gpi_path, method: "GET", remote: true, class: "form-horizontal", id: "general_public_invoice_form", onsubmit: "closeDialog()") do %>
    <%= hidden_field_tag :generate, true %>
    <div id="error_explanation"></div>
    <div class="row">
      <div class="col-md-12">
        <!-- caja registradora -->
        <div class="form-group">
          <%= label_tag :total_for_invoice, "Total de ventas a contado", { class: "col-md-4 control-label" } do %> Total de ventas a contado <% end %>
          <div class="col-md-8">
            <div class="input-group">
              <span class="input-group-addon"> $ </span>
              <%= number_field_tag :total_for_invoice, format('%0.2f', @sales_total), { disabled: true, class: "form-control input-small" } %>
              <%= hidden_field_tag :total_for_invoice, @sales_total %>
              <%= hidden_field_tag :amount_for_invoice, @sales_amount %>
              <%= hidden_field_tag :tax_for_invoice, @sales_tax %>
            </div>
          </div>
        </div>
      </div>
    </div>
    <h4 class="form-section" style="margin:20px 0px 10px 0px"></h4>
    <div class="actions col-md-offset-3">
      <!-- <button type="button" class="btn btn-success" onclick="submitForm()" id="gpibutton">Generar</button> -->
      <%= submit_tag 'Generar factura', class: "btn btn-success" %>
      <button type="button" class="btn default" onclick="closeDialog()" id="cancel">Cancelar</button>
    </div>
  <% end %>
</div>

<script>
  function closeDialog() {
    $(".modal-body").html('');
    $('#dialog').modal('toggle');
  }
</script>
