cash_outs_helper.rb 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. module CashOutsHelper
  2. def cash_move_type(move)
  3. case move.concept
  4. when "sale"
  5. 'VENTA'
  6. when "purchase"
  7. 'COMPRA CANCELADA'
  8. when "expense"
  9. 'GASTO CANCELADO'
  10. when "credit_payment"
  11. 'ABONO A CRÉDITO'
  12. when "reserved_payment"
  13. 'ABONO A APARTADO'
  14. when "reserved_first_payment"
  15. 'ANTICIPO DE APARTADO'
  16. when "reserved_last_payment"
  17. 'LIQUIDACIÓN DE APARTADO'
  18. when "products_return"
  19. 'DIFERENCIA POR DEVOLUCIÓN'
  20. end
  21. end
  22. def move_concept_folio(move)
  23. case move.concept
  24. when "sale" then
  25. content_tag(:span, move.sale.sale_code)
  26. when "purchase" then
  27. content_tag(:span, move.purchase.purchase_code)
  28. when "expense" then
  29. content_tag(:span, move.expense.expense_code)
  30. # when "credit_payment" then
  31. # cp = CreditPayment.find_by(cash_registers_move_id: move.id)
  32. # unless cp.nil?
  33. # content_tag(:span, cp.id)
  34. # end
  35. when "returned_money" then
  36. content_tag(:span, ProductsReturn.find(move.products_return_id).return_code)
  37. when "paid_product_change" then
  38. content_tag(:span, ProductsReturn.find(move.products_return_id).return_code)
  39. end
  40. end
  41. end