|
|
@@ -1,6 +1,6 @@
|
|
|
-<%= form_for(@cash_registers_move, :remote => true, :html => {:class=>"form-horizontal", :id=> "cash_register_move_form"}) do |f| %>
|
|
|
- <%= f.hidden_field(:open_cash_register_id, :value => @sale.open_cash_register_id) %>
|
|
|
- <%= f.hidden_field(:sale_id, :value => @sale.id) %>
|
|
|
+<%= form_for(@cash_registers_move, remote: true, html: { class: "form-horizontal", id: "cash_register_move_form" }) do |f| %>
|
|
|
+ <%= f.hidden_field(:open_cash_register_id, value: @sale.open_cash_register_id) %>
|
|
|
+ <%= f.hidden_field(:sale_id, value: @sale.id) %>
|
|
|
<div class="portlet-body form">
|
|
|
<div class="alert alert-danger hidden" id="error_explanation_move"></div>
|
|
|
<div class="row">
|
|
|
@@ -26,7 +26,7 @@
|
|
|
<div class="col-md-6">
|
|
|
<span>Folio:</span> <br/>
|
|
|
<span><%= @sale.sale_code %></span>
|
|
|
- <%= f.hidden_field(:ticket, :value => @sale.sale_code) %>
|
|
|
+ <%= f.hidden_field(:ticket, value: @sale.sale_code) %>
|
|
|
</div>
|
|
|
<!-- div fecha -->
|
|
|
<div class="col-md-6">
|
|
|
@@ -50,7 +50,7 @@
|
|
|
<span class="help-block">monto recibido. </span>
|
|
|
<div class="input-group col-md-11">
|
|
|
<span class="input-group-addon"> $ </span>
|
|
|
- <%= f.number_field :received, {:class=>"form-control mask_decimal first_input"} %>
|
|
|
+ <%= f.number_field :received, { class: "form-control mask_decimal first_input"} %>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -59,7 +59,7 @@
|
|
|
<div class="form-group">
|
|
|
<div class="input-group col-md-12">
|
|
|
<span class="help-block">seleccione forma de pago. </span>
|
|
|
- <%= f.select :payment_method_id, PaymentMethod.vigentes.map {|c| [c.method, c.id] }, {:include_blank => "Seleccione", :selected => @cash_id}, {:class => "form-control" } %>
|
|
|
+ <%= f.select :payment_method_id, PaymentMethod.vigentes.map { |c| [c.method, c.id] }, { include_blank: "Seleccione", selected: @cash_id}, { class: "form-control" } %>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -70,28 +70,28 @@
|
|
|
<!-- datos de la tarjeta cuando aplica -->
|
|
|
<div class="col-md-12" id="card_info" style="display: none;">
|
|
|
<div class="form-group">
|
|
|
- <%= f.label :cardnumber, {:class=>"col-md-3 control-label "} do %> Tarjeta: <span class="required">*</span>
|
|
|
+ <%= f.label :cardnumber, { class: "col-md-3 control-label" } do %> Tarjeta: <span class="required">*</span>
|
|
|
<% end %>
|
|
|
<div class="col-md-8">
|
|
|
- <%= f.text_field :cardnumber, {:class => "form-control"} %>
|
|
|
- <span class="help-block">Ultimos 4 digitos de la tarjeta. </span>
|
|
|
+ <%= f.text_field :cardnumber, { class: "form-control input-small", maxlength: 4 } %>
|
|
|
+ <span class="help-block">Últimos 4 dígitos de la tarjeta. </span>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="col-md-12">
|
|
|
<table class="table table-striped table-hover table-bordered" id="payments_table">
|
|
|
- <thead>
|
|
|
- <tr>
|
|
|
- <th> Recibido </th>
|
|
|
- <th> Cobro </th>
|
|
|
- <th> Forma de pago </th>
|
|
|
- <th> Info. adicional </th>
|
|
|
- <th> Acciones </th>
|
|
|
- </tr>
|
|
|
- </thead>
|
|
|
- <tbody>
|
|
|
- </tbody>
|
|
|
+ <thead>
|
|
|
+ <tr>
|
|
|
+ <th> Recibido </th>
|
|
|
+ <th> Cobro </th>
|
|
|
+ <th> Forma de pago </th>
|
|
|
+ <th> Info. adicional </th>
|
|
|
+ <th> Acciones </th>
|
|
|
+ </tr>
|
|
|
+ </thead>
|
|
|
+ <tbody>
|
|
|
+ </tbody>
|
|
|
</table>
|
|
|
</div>
|
|
|
<!-- div para mostrar total -->
|
|
|
@@ -107,7 +107,7 @@
|
|
|
</div>
|
|
|
<div class="col-md-12">
|
|
|
<% if @sale.cash? %>
|
|
|
- <span class="help-block">Este boton se habilita cuando se cubre en su totalidad el monto de la venta. </span>
|
|
|
+ <span class="help-block">Este botón se habilita cuando se cubre en su totalidad el monto de la venta. </span>
|
|
|
<% end %>
|
|
|
<button type="button" class="btn green btn-block" id="save_move" disabled onclick="confirmPayments()">Cobrar</button>
|
|
|
</div>
|
|
|
@@ -119,7 +119,6 @@
|
|
|
|
|
|
// no dejar que cierren el modal porque la venta ya se creó
|
|
|
<% if @sale.cash? %>
|
|
|
- console.log(true);
|
|
|
$('#closemodal').removeAttr('data-dismiss');
|
|
|
if (window.location.pathname == "/sales/new") {
|
|
|
$( "#closemodal" ).click(function() {
|
|
|
@@ -129,7 +128,7 @@
|
|
|
url: "/sales/" + <%= @sale.id %> ,
|
|
|
dataType: "json",
|
|
|
data: {
|
|
|
- return_cash: true
|
|
|
+ return_cash: true
|
|
|
},
|
|
|
success: function(xhr, status, error) {
|
|
|
window.location = "<%= new_sale_path %>";
|
|
|
@@ -244,7 +243,6 @@
|
|
|
} else {
|
|
|
// $('#display_change').html(formatter.format(0));
|
|
|
$('#display_change').html(accounting.formatMoney(0));
|
|
|
-
|
|
|
}
|
|
|
}
|
|
|
</script>
|