|
|
@@ -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) %>
|
|
|
<%= hidden_field_tag :reserve_sale_percent, @min_quantity_reserve %>
|
|
|
<div class="portlet-body form">
|
|
|
<div class="alert alert-danger hidden" id="error_explanation_move"></div>
|
|
|
@@ -52,7 +52,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>
|
|
|
@@ -62,7 +62,7 @@
|
|
|
<span class="help-block">monto a ABONAR. </span>
|
|
|
<div class="input-group col-md-11">
|
|
|
<span class="input-group-addon"> $ </span>
|
|
|
- <%= f.number_field :quantity, {:class=>"form-control mask_decimal"} %>
|
|
|
+ <%= f.number_field :quantity, { class: "form-control mask_decimal" } %>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -71,7 +71,7 @@
|
|
|
<div class="form-group">
|
|
|
<span class="help-block">forma de pago. </span>
|
|
|
<div class="input-group col-md-12">
|
|
|
- <%= 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>
|
|
|
@@ -80,30 +80,30 @@
|
|
|
<button type="button" class="btn green pull-right" onclick="addRow()">Agregar</button>
|
|
|
</div>
|
|
|
<!-- datos de la tarjeta cuando aplica -->
|
|
|
- <div class="col-md-12" id="card_info" style="display: none;">
|
|
|
+ <div class="col-md-offset-6 col-md-6" id="card_info" style="display: none;">
|
|
|
<div class="form-group">
|
|
|
- <%= f.label :cardnumber, {:class=>"col-md-3 control-label", :autocomplete=> "off"} do %> Tarjeta: <span class="required">*</span>
|
|
|
+ <%= f.label :cardnumber, { class: "col-md-2 control-label", :autocomplete=> "off" } 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>
|
|
|
+ <div class="col-md-6">
|
|
|
+ <%= f.text_field :cardnumber, { class: "form-control", 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 -->
|
|
|
@@ -118,7 +118,7 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="col-md-12">
|
|
|
- <span class="help-block">Este boton se habilita cuando se cubre la cantidad minima de anticipo. </span>
|
|
|
+ <span class="help-block">Este botón se habilita cuando se cubre la cantidad mínima de anticipo. </span>
|
|
|
<button type="button" class="btn green btn-block" id="save_move" disabled onclick="confirmReserve()">Apartar</button>
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -126,7 +126,7 @@
|
|
|
<script type="text/javascript">
|
|
|
$('#closemodal').removeAttr('data-dismiss');
|
|
|
$( "#closemodal" ).click(function() {
|
|
|
- if (window.confirm("Está seguro que desea SALIR?, al salir SE CANCELARÁ EL APARTADO")) {
|
|
|
+ if (window.confirm("¿Está seguro que desea SALIR?, al salir SE CANCELARÁ EL APARTADO")) {
|
|
|
$.ajax({
|
|
|
type: "DELETE",
|
|
|
url: "/sales/" + <%= @sale.id %> ,
|
|
|
@@ -166,7 +166,13 @@
|
|
|
});
|
|
|
|
|
|
function addRow() {
|
|
|
- $('#cash_register_move_form').submit();
|
|
|
+ debt = parseFloat($('#sale_total').val());
|
|
|
+ quantity = parseFloat($('#cash_registers_move_quantity').val());
|
|
|
+ if (quantity <= debt) {
|
|
|
+ $('#cash_register_move_form').submit();
|
|
|
+ } else {
|
|
|
+ toastr["error"]("El monto del anticipo no puede ser mayor al total de la venta");
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
function unlockConfirmPayment() {
|