<%-# Fedena #Copyright 2010 Foradian Technologies Private Limited # #This product includes software developed at #Project Fedena - http://www.projectfedena.org/ # #Licensed under the Apache License, Version 2.0 (the "License"); #you may not use this file except in compliance with the License. #You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # #Unless required by applicable law or agreed to in writing, #software distributed under the License is distributed on an #"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY #KIND, either express or implied. See the License for the #specific language governing permissions and limitations #under the License. -%>
<%= image_tag("/images/show_finance.png") %>

<%= t('transactions') %>

<%= t('transaction_comparision') %>

<%= link_to_function image_tag("/images/buttons/back.png",:border => 0), "history.back()" %>

<% unless @salary == 0 and @donations_total == 0 and @transactions_fees and @other_transactions %> <%= @graph %> <% end %>


<%= t('report_for_the_period_from') %><%= @start_date.strftime("%d-%m-%Y") %> to <%= @end_date.strftime("%d-%m-%Y") %>

<% index = 0 %> <%income_total = 0%> <%expenses_total = 0%> <% unless @hr.nil? %> <% unless @salary == 0 %> <% else %> <% end %> <% end %> <% unless @donations_total == 0 %> <% else %> <% end %> <% unless @transactions_fees == 0 %> <% else %> <% end %> <% FedenaPlugin::FINANCE_CATEGORY.each do |category| %> <% if @category_transaction_totals["#{category[:category_name]}"][:category_type] == "income"%> <% else %> <% end %> <% end %> <% @other_transaction_categories.each_with_index do |t,i| %> <% income = t.total_income(@start_date,@end_date) %> <% expense = t.total_expense(@start_date,@end_date) %> "> <%income_total +=income%> <%expenses_total +=expense%> <%end%> <% if @grand_total >= 0 %> <% else %> <% end %>
<%= t('sl_no') %> <%= t('particulars') %> <%= t('expenses') %>(<%= currency %>) <%= t('income') %>(<%= currency %>)
<%= index+=1 %><%= link_to "#{t('salary_account')}" , :action => 'salary_department' , :start => @start_date,:end => @end_date%> <%= t('salary_account') %><%= @salary%>
<%= index+=1 %><%= link_to "#{t('donations')}" , :action => 'donations_report',:start => @start_date,:end => @end_date%><%= t('donations') %> <%=@donations_total%>
<%= index+=1 %><%= link_to "#{t('fees_account')}" , :action => 'fees_report' , :start => @start_date,:end => @end_date%> <%= t('fees_account') %> <%=@transactions_fees%>
<%= index+=1 %> <%= link_to "#{t(category[:category_name]+'_account')}" , category[:destination].merge(:start => @start_date,:end => @end_date)%> <%=@category_transaction_totals["#{category[:category_name]}"][:amount]%><%=@category_transaction_totals["#{category[:category_name]}"][:amount]%>
<%=i+index+1%> <%= t.name %> <%= expense %> <%= income %>
<%= t('grand_total') %> <%= sprintf("%.2f",@grand_total)%><%= sprintf("%.2f",@grand_total * -1)%>
<%#= will_paginate@other_transactions,:params => {:start_date => @start_date , :end_date => @end_date}%>

<%= t('report_for_the_period_from') %><%= I18n.l(@start_date2,:format=>"%d-%m-%Y") %> to <%= I18n.l(@end_date2,:format=>"%d-%m-%Y") %>

<% index = 0 %> <%income_total = 0%> <%expenses_total = 0%> <% unless @hr.nil? %> <% unless @salary2 == 0 %> <% else %> <% end %> <% end %> <% unless @donations_total2 == 0 %> <% else %> <% end %> <% unless @transactions_fees2 == 0 %> <% else %> <% end %> <% FedenaPlugin::FINANCE_CATEGORY.each do |category| %> <% if @category_transaction_totals["#{category[:category_name]}"][:category_type] == "income"%> <% else %> <% end %> <% end %> <% @other_transaction_categories2.each_with_index do |t,i| %> <% income = t.total_income(@start_date2,@end_date2) %> <% expense = t.total_expense(@start_date2,@end_date2) %> "> <%income_total +=income%> <%expenses_total +=expense%> <%end%> <% if @grand_total2 >= 0 %> <% else %> <% end %>
<%= t('sl_no') %> <%= t('particulars') %> <%= t('expenses') %>(<%= currency %>) <%= t('income') %>(<%= currency %>)
<%= index+=1 %><%= link_to "#{t('salary_account')}" , :action => 'salary_department' , :start => @start_date2,:end => @end_date2%> <%= t('salary_account') %><%= @salary2%>
<%= index+=1 %><%= link_to "#{t('donations')}" , :action => 'donations_report',:start => @start_date2,:end => @end_date2%><%= t('donations') %> <%=@donations_total2%>
<%= index+=1 %><%= link_to "#{t('fees_account')}" , :action => 'fees_report' , :start => @start_date2,:end => @end_date2%> <%= t('fees_account') %> <%=@transactions_fees2%>
<%= index+=1 %> <%= link_to "#{t(category[:category_name]+'_account')}" , category[:destination].merge(:start => @start_date2,:end => @end_date2)%> <%=@category_transaction_totals["#{category[:category_name]}"][:amount]%><%=@category_transaction_totals["#{category[:category_name]}"][:amount]%>
<%=i+index+1%> <%= t.name %> <%= expense %> <%= income %>
<%= t('grand_total') %> <%= sprintf("%.2f",@grand_total2)%><%= sprintf("%.2f",@grand_total2 * -1)%>
<%#= will_paginate@other_transactions2,:params => {:start_date => @start_date2 , :end_date => @end_date2}%>