Explorar el Código

added and moved descrptions to cashout helper

Jose Miguel Ledon Nieblas hace 9 años
padre
commit
10527a6647
Se han modificado 2 ficheros con 22 adiciones y 13 borrados
  1. 18 0
      app/helpers/cash_outs_helper.rb
  2. 4 13
      app/views/cash_outs/show.html.erb

+ 18 - 0
app/helpers/cash_outs_helper.rb

@@ -1,2 +1,20 @@
 module CashOutsHelper
+  def cash_move_type(move)
+    case move.concept
+    when "sale"
+      'VENTA'
+    when "purchase"
+      'COMPRA CANCELADA'
+    when "expense"
+      'GASTO CANCELADO'
+    when "credit_payment"
+      'ABONO A CRÉDITO'
+    when "reserved_payment"
+      'ABONO A APARTADO'
+    when "reserved_first_payment"
+      'ANTICIPO DE APARTADO'
+    when "reserved_last_payment"
+      'LIQUIDACIÓN DE APARTADO'
+    end
+  end
 end

+ 4 - 13
app/views/cash_outs/show.html.erb

@@ -246,30 +246,21 @@
 										          <td><%= key + 1 %></td>
 										          <td>
 										            <% case move.concept %>
-										              <% when "sale",  "reserved_payment",  "credit_payment" %>
+          												<% when "sale",  "reserved_payment", "reserved_first_payment", "reserved_last_payment" %>
 										                <%= move.sale.sale_code %>
 										              <% when "purchase"%>
 										                <%= move.purchase.purchase_code %>
 										              <% when "expense"%>
 										                <%= move.expense.expense_code %>
+										              <% when "credit_payment"%>
+										                <%= move.credit_payment.id %>
 										            <% end %>
 										          </td>
 										          <td><%= move.open_cash_register.cash_register.name%></td>
 										          <td><%= move.payment_method.method %></td>
 										          <td><%= number_to_currency(move.quantity, precision: 2) %></td>
 										          <td>
-						                          	<% case move.concept %>
-						                          	<% when "sale"%>
-						                            	Venta
-						                          	<% when "purchase"%>
-						                            	Compra cancelada
-						                          	<% when "expense"%>
-						                            	Gasto cancelado
-						                           	<% when "reserved_payment" %>
-						                           		Abono a apartado
-						                           	<% when "credit_payment" %>
-						                           	    Abono a crédito
-							                          <% end %>
+                                  <%= cash_move_type(move) %>
 								           		 </td>
 										          <td><%= l(move.created_at, :format => '%I:%M %p') %> </td>
 										        </tr>