Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

A new page to see the real movements from la caixa

  • Loading branch information...
commit 770e93ca3eaed7eb761d9acbdbddba7b7cb66b26 1 parent 6495e22
@rogercampos authored
View
11 app/controllers/accounts_controller.rb
@@ -69,5 +69,16 @@ def import
redirect_to entries_url
end
+
+ def la_caixa_view
+ lacaixa.log_in
+ @lacaixa_account = lacaixa.accounts.detect{|x| x.number == @account.number}
+ unless @lacaixa_account
+ render :text => "Account no encontrado en La Caixa"
+ return
+ end
+
+ @last_movements = lacaixa._movements_for(@lacaixa_account, Date.today - 20.days)
+ end
end
View
13 app/views/accounts/la_caixa_view.html.haml
@@ -0,0 +1,13 @@
+%h1 Movimientos de La Caixa:
+
+%table
+ %tr
+ %th Fecha
+ %th Razon
+ %th Movimiento
+
+ - @last_movements.each do |movement|
+ %tr
+ %td= movement.date
+ %td= movement.statement
+ %td= movement.amount
View
8 app/views/entries/index.html.haml
@@ -2,8 +2,12 @@
- if @can_write
.right=link_to image_tag("refresh.png"), recalculation_entries_path, :class => "button", :title => "Recalcula"
--#.right=link_to image_tag("export.png"), "#tools", :class => "button", :rel => "facebox"
--#.right=link_to image_tag("lupa.png"), "#search-form", :class => "button", :rel => "facebox"
+ -#.right=link_to image_tag("export.png"), "#tools", :class => "button", :rel => "facebox"
+ -#.right=link_to image_tag("lupa.png"), "#search-form", :class => "button", :rel => "facebox"
+ - if @account.integrated?
+ .right
+ = link_to "Visualizar La Caixa", la_caixa_view_account_path(@account), :class => "button"
+
%h1
- if @is_search
Resultats de la cerca
View
4 config/routes.rb
@@ -10,6 +10,10 @@
resources :accounts do
resources :groups
+
+ member do
+ get :la_caixa_view
+ end
end
resources :entries do
Please sign in to comment.
Something went wrong with that request. Please try again.