Moved financial_transaction into the new finance-namespace.

This commit is contained in:
Benjamin Meichsner 2009-01-10 21:28:22 +01:00
parent 1d85b880f2
commit c282cae79c
19 changed files with 167 additions and 153 deletions

View file

@ -0,0 +1,41 @@
<% if @total == 0 %>
<p>Keine gefunden</p>
<% else %>
<p>Anzahl gefundener Transaktionen: <b><%= @total %></b></p>
<p>
<%= pagination_links_remote @financial_transactions, @per_page, {:sort => params[:sort], :query => params['query']}%>
</p>
<table>
<thead>
<tr>
<td <%= sort_td_class_helper "date" %>>
<%= sort_link_helper "Datum", "date" %>
</td>
<td>Wer</td>
<td <%= sort_td_class_helper "note" %>>
<%= sort_link_helper "Notiz", "note" %>
</td>
<td <%= sort_td_class_helper "amount" %>>
<%= sort_link_helper "Betrag", "amount" %>
</td>
</tr>
</thead>
<tbody>
<% @financial_transactions.each do |t| %>
<tr class="<%= cycle("even","odd") %>">
<td><%= format_time(t.created_on) %></td>
<td><%=h t.user.nil? ? '??' : t.user.nick %></td>
<td><%=h t.note %></td>
<td style="color:<%= t.amount < 0 ? 'red' : 'black' %>; width:5em" class="currency"><%= number_to_currency(t.amount) %></td>
</tr>
<% end %>
</tbody>
</table>
<% end %>

View file

@ -0,0 +1,6 @@
%tr.transaction
%td
%select{:name => 'financial_transactions[][order_group_id]'}
= options_for_select OrderGroup.find(:all, :order => 'name').collect { |g| [ g.name, g.id ] }
%td= text_field_tag 'financial_transactions[][amount]'
%td= link_to_function image_tag("b_drop.png", :size => "16x16", :alt => _("Remove"), :border => "0"), "$(this).up('.transaction').remove()", {:title => _("Remove ordergroup")}

View file

@ -0,0 +1,28 @@
%p
= _("Found") + ":"
= @total
%p
%table{:style => "width:100%"}
%tr
%td
= pagination_links_remote @groups, @per_page, {:sort => params[:sort]}
%td{:style => "text-align:right"}
- if @total > 20
= items_per_page
%table.list
%thead
%tr
%th= sort_link_helper _("Name"), "name", @per_page
%th= sort_link_helper _("Size of group"), "size", @per_page
%th= sort_link_helper _("Account balance"), "account_balance", @per_page
%th
%tbody
- for group in @groups
%tr{:class => cycle('even','odd', :name => 'groups')}
%td= group.name
%td= group.actual_size
%td{:class => "currency", :style => "width:5em"}= number_to_currency(group.account_balance)
%td{:class => "actions"}
= link_to image_tag("euro_new.png", :size => "16x16", :alt => _("New transaction"), :border => "0"), {:action => 'new', :id => group}, {:title => _("New transaction")}
= link_to image_tag("b_browse.png", :size => "16x16", :border => "0", :alt => 'Kontoauszug'), {:action => 'list', :id => group}, {:title => _("List transactions")}

View file

@ -0,0 +1,2 @@
<h1>Finance::Transactions#create</h1>
<p>Find me in app/views/finance/transactions/create.html.erb</p>

View file

@ -0,0 +1,2 @@
<h1>Finance::Transactions#create_collection</h1>
<p>Find me in app/views/finance/transactions/create_collection.html.erb</p>

View file

@ -0,0 +1,25 @@
%h1 Manage accounts
%p
%i
=_ "To create multiple transactions at once please follow this "
= link_to _("link"), :action => 'new_collection'
.left_column{:style=>"width:50em"}
.box_title
%h2=_ "Ordergroups"
.column_content
#group_filter
%form{:name=>"sform", :action=>"", :style=>"display:inline;"}
%label{:for => 'article_name'}= _("Search in name") + ":"
= text_field_tag("query", params['query'], :size => 10 )
= observe_field 'query', :frequency => 2, |
:before => "Element.show('loader')", |
:success => "Element.hide('loader')", |
:url => {:action => 'index'}, |
:with => 'query' |
#table
= render :partial => "ordergroups"
%br/
- if @current_user.role_admin?
= link_to _("New ordergroup"), :controller => 'admin', :action => 'newOrderGroup'

View file

@ -0,0 +1,25 @@
<% title "Kontoauszug für #{@group.name}" %>
<p>
<b>Kontostand: <%= number_to_currency(@group.account_balance) -%></b>
<span style="color:grey">(zuletzt aktualisiert vor <%= distance_of_time_in_words(Time.now, @group.account_updated) -%>)</span>
</p>
<div class="left_column" style="width:100%">
<div class="box_title"><h2>Überweisungen</h2></div>
<div class="column_content">
<form name="sform" action="" style="display:inline;">
<label for="financial_transaction_note">in Notizen suchen: </label>
<%= text_field_tag("query", params['query'], :size => 10 ) %>
</form>
<%= observe_field 'query', :frequency => 2,
:before => "Element.show('loader')",
:success => "Element.hide('loader')",
:url => {:action => 'list'},
:with => 'query' %>
<div id="table">
<%= render :partial => "list" %>
</div>
<p><%= link_to 'Neue Transaktion', :action => 'new', :id => @group %></p>
</div>
<%= link_to 'Gruppenübersicht', :action => 'index' %>
</div>

View file

@ -0,0 +1,21 @@
%h1 New transaction
.edit_form{ :style => "width:30em" }
- form_for(@financial_transaction, :url => { :action => 'create' }) do |f|
= f.error_messages
= f.hidden_field :order_group_id
%p
Group:
%b=h @group.name
%p
= f.label :amount
%br/
= f.text_field :amount, :size => 10
%p
= f.label :note
%br/
= f.text_area :note, :cols => 40, :rows => 5
%p
= submit_tag "Save"
= link_to "Back", :controller => 'transactions'

View file

@ -0,0 +1,2 @@
<h1>Finance::Transactions#new_collection</h1>
<p>Find me in app/views/finance/transactions/new_collection.html.erb</p>

View file

@ -0,0 +1,20 @@
- title _("Update multiple accounts")
- form_tag :action => "create_collection" do
%p
%b= _("Note") + ":"
= text_field_tag "note"
%p
%table#OrderGroups{:style => "width:20em"}
%tr
%th=_ "Ordergroup"
%th=_ "Amount"
= render :partial => 'order_group', :collection => [1, 2, 3]
%p
= link_to_function _("Add another ordergroup") do |page|
- page.insert_html :bottom, :OrderGroups, :partial => 'order_group'
%p
= submit_tag _("Save")
|
= link_to _("Cancel"), :controller => 'finance/transactions'