has_accounts 0.20.1 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/has_accounts/version.rb +1 -1
- metadata +31 -50
- data/app/controllers/accounts_controller.rb +0 -52
- data/app/controllers/bank_accounts_controller.rb +0 -3
- data/app/controllers/banks_controller.rb +0 -3
- data/app/controllers/bookings_controller.rb +0 -67
- data/app/helpers/account_helper.rb +0 -6
- data/app/views/accounts/_account.html.haml +0 -12
- data/app/views/accounts/_booking_item.html.haml +0 -15
- data/app/views/accounts/_booking_list_footer.html.haml +0 -2
- data/app/views/accounts/_booking_list_header.html.haml +0 -8
- data/app/views/accounts/_booking_list_paginate.html.haml +0 -5
- data/app/views/accounts/_booking_list_saldo.html.haml +0 -8
- data/app/views/accounts/_booking_list_turnover.html.haml +0 -8
- data/app/views/accounts/_carry_booking.html.haml +0 -9
- data/app/views/accounts/_edit_booking.html.haml +0 -14
- data/app/views/accounts/_edit_bookings.html.haml +0 -15
- data/app/views/accounts/_form.html.haml +0 -7
- data/app/views/accounts/_list_footer.html.haml +0 -2
- data/app/views/accounts/_list_header.html.haml +0 -5
- data/app/views/accounts/_show.html.haml +0 -9
- data/app/views/accounts/_show_bookings.html.haml +0 -19
- data/app/views/accounts/edit_bookings.html.haml +0 -5
- data/app/views/accounts/edit_bookings.js.erb +0 -2
- data/app/views/accounts/index.html.haml +0 -9
- data/app/views/accounts/show.html.haml +0 -10
- data/app/views/bank_accounts/_bank_account.html.haml +0 -1
- data/app/views/bank_accounts/_form.html.haml +0 -10
- data/app/views/banks/_bank.html.haml +0 -3
- data/app/views/banks/_form.html.haml +0 -12
- data/app/views/bookings/_booking.html.haml +0 -17
- data/app/views/bookings/_form.html.haml +0 -28
- data/app/views/bookings/_list.html.haml +0 -16
- data/app/views/bookings/_new_form.html.haml +0 -5
- data/app/views/bookings/_sidebar.html.haml +0 -6
- data/app/views/bookings/_simple_form.html.haml +0 -25
- data/app/views/bookings/new.html.haml +0 -8
- data/app/views/bookings/select.html.haml +0 -11
- data/app/views/bookings/show.html.haml +0 -7
- data/app/views/bookings/simple_edit.html.haml +0 -4
- data/config/routes.rb +0 -44
data/lib/has_accounts/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: has_accounts
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,11 +9,11 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-
|
12
|
+
date: 2013-06-18 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: rails
|
16
|
-
requirement:
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
17
|
none: false
|
18
18
|
requirements:
|
19
19
|
- - ~>
|
@@ -21,10 +21,15 @@ dependencies:
|
|
21
21
|
version: '3.1'
|
22
22
|
type: :runtime
|
23
23
|
prerelease: false
|
24
|
-
version_requirements:
|
24
|
+
version_requirements: !ruby/object:Gem::Requirement
|
25
|
+
none: false
|
26
|
+
requirements:
|
27
|
+
- - ~>
|
28
|
+
- !ruby/object:Gem::Version
|
29
|
+
version: '3.1'
|
25
30
|
- !ruby/object:Gem::Dependency
|
26
31
|
name: has_vcards
|
27
|
-
requirement:
|
32
|
+
requirement: !ruby/object:Gem::Requirement
|
28
33
|
none: false
|
29
34
|
requirements:
|
30
35
|
- - ! '>='
|
@@ -32,10 +37,15 @@ dependencies:
|
|
32
37
|
version: '0'
|
33
38
|
type: :runtime
|
34
39
|
prerelease: false
|
35
|
-
version_requirements:
|
40
|
+
version_requirements: !ruby/object:Gem::Requirement
|
41
|
+
none: false
|
42
|
+
requirements:
|
43
|
+
- - ! '>='
|
44
|
+
- !ruby/object:Gem::Version
|
45
|
+
version: '0'
|
36
46
|
- !ruby/object:Gem::Dependency
|
37
47
|
name: validates_timeliness
|
38
|
-
requirement:
|
48
|
+
requirement: !ruby/object:Gem::Requirement
|
39
49
|
none: false
|
40
50
|
requirements:
|
41
51
|
- - ! '>='
|
@@ -43,10 +53,15 @@ dependencies:
|
|
43
53
|
version: '0'
|
44
54
|
type: :runtime
|
45
55
|
prerelease: false
|
46
|
-
version_requirements:
|
56
|
+
version_requirements: !ruby/object:Gem::Requirement
|
57
|
+
none: false
|
58
|
+
requirements:
|
59
|
+
- - ! '>='
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
47
62
|
- !ruby/object:Gem::Dependency
|
48
63
|
name: inherited_resources
|
49
|
-
requirement:
|
64
|
+
requirement: !ruby/object:Gem::Requirement
|
50
65
|
none: false
|
51
66
|
requirements:
|
52
67
|
- - ! '>='
|
@@ -54,7 +69,12 @@ dependencies:
|
|
54
69
|
version: '0'
|
55
70
|
type: :runtime
|
56
71
|
prerelease: false
|
57
|
-
version_requirements:
|
72
|
+
version_requirements: !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
58
78
|
description: HasAccounts is a full featured Rails 3 gem providing models for financial
|
59
79
|
accounting.
|
60
80
|
email:
|
@@ -65,53 +85,14 @@ extra_rdoc_files:
|
|
65
85
|
- MIT-LICENSE
|
66
86
|
- README.md
|
67
87
|
files:
|
68
|
-
- app/controllers/accounts_controller.rb
|
69
|
-
- app/controllers/bank_accounts_controller.rb
|
70
|
-
- app/controllers/banks_controller.rb
|
71
|
-
- app/controllers/bookings_controller.rb
|
72
|
-
- app/helpers/account_helper.rb
|
73
88
|
- app/models/account.rb
|
74
89
|
- app/models/account_scope_extension.rb
|
75
90
|
- app/models/account_type.rb
|
76
91
|
- app/models/bank.rb
|
77
92
|
- app/models/bank_account.rb
|
78
93
|
- app/models/booking.rb
|
79
|
-
- app/views/accounts/_account.html.haml
|
80
|
-
- app/views/accounts/_booking_item.html.haml
|
81
|
-
- app/views/accounts/_booking_list_footer.html.haml
|
82
|
-
- app/views/accounts/_booking_list_header.html.haml
|
83
|
-
- app/views/accounts/_booking_list_paginate.html.haml
|
84
|
-
- app/views/accounts/_booking_list_saldo.html.haml
|
85
|
-
- app/views/accounts/_booking_list_turnover.html.haml
|
86
|
-
- app/views/accounts/_carry_booking.html.haml
|
87
|
-
- app/views/accounts/_edit_booking.html.haml
|
88
|
-
- app/views/accounts/_edit_bookings.html.haml
|
89
|
-
- app/views/accounts/_form.html.haml
|
90
|
-
- app/views/accounts/_list_footer.html.haml
|
91
|
-
- app/views/accounts/_list_header.html.haml
|
92
|
-
- app/views/accounts/_show.html.haml
|
93
|
-
- app/views/accounts/_show_bookings.html.haml
|
94
|
-
- app/views/accounts/edit_bookings.html.haml
|
95
|
-
- app/views/accounts/edit_bookings.js.erb
|
96
|
-
- app/views/accounts/index.html.haml
|
97
|
-
- app/views/accounts/show.html.haml
|
98
|
-
- app/views/bank_accounts/_bank_account.html.haml
|
99
|
-
- app/views/bank_accounts/_form.html.haml
|
100
|
-
- app/views/banks/_bank.html.haml
|
101
|
-
- app/views/banks/_form.html.haml
|
102
|
-
- app/views/bookings/_booking.html.haml
|
103
|
-
- app/views/bookings/_form.html.haml
|
104
|
-
- app/views/bookings/_list.html.haml
|
105
|
-
- app/views/bookings/_new_form.html.haml
|
106
|
-
- app/views/bookings/_sidebar.html.haml
|
107
|
-
- app/views/bookings/_simple_form.html.haml
|
108
|
-
- app/views/bookings/new.html.haml
|
109
|
-
- app/views/bookings/select.html.haml
|
110
|
-
- app/views/bookings/show.html.haml
|
111
|
-
- app/views/bookings/simple_edit.html.haml
|
112
94
|
- config/locales/de.yml
|
113
95
|
- config/locales/en.yml
|
114
|
-
- config/routes.rb
|
115
96
|
- db/migrate/20111108000000_create_has_accounts_tables.rb
|
116
97
|
- db/migrate/20111109093857_use_string_for_account_number.rb
|
117
98
|
- db/migrate/20111230121259_bank_now_inherits_from_person.rb
|
@@ -145,7 +126,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
145
126
|
version: '0'
|
146
127
|
requirements: []
|
147
128
|
rubyforge_project:
|
148
|
-
rubygems_version: 1.8.
|
129
|
+
rubygems_version: 1.8.23
|
149
130
|
signing_key:
|
150
131
|
specification_version: 3
|
151
132
|
summary: HasAccounts provides models for financial accounting.
|
@@ -1,52 +0,0 @@
|
|
1
|
-
class AccountsController < AuthorizedController
|
2
|
-
# Scopes
|
3
|
-
has_scope :by_value_period, :using => [:from, :to], :default => proc { |c| c.session[:has_scope] }
|
4
|
-
has_scope :by_text
|
5
|
-
|
6
|
-
has_scope :page, :only => :index
|
7
|
-
|
8
|
-
def index
|
9
|
-
@accounts = apply_scopes(Account).includes(:account_type).includes(:credit_bookings, :credit_bookings)
|
10
|
-
end
|
11
|
-
|
12
|
-
def show
|
13
|
-
@account = Account.find(params[:id])
|
14
|
-
@bookings = apply_scopes(Booking).includes(:debit_account => :account_type, :credit_account => :account_type).by_account(@account)
|
15
|
-
@bookings = @bookings.page(params[:page]) || 1
|
16
|
-
|
17
|
-
if params[:only_credit_bookings]
|
18
|
-
@bookings = @bookings.where(:credit_account_id => @account.id)
|
19
|
-
end
|
20
|
-
if params[:only_debit_bookings]
|
21
|
-
@bookings = @bookings.where(:debit_account_id => @account.id)
|
22
|
-
end
|
23
|
-
@bookings = @bookings
|
24
|
-
@carry_booking = @bookings.all.first
|
25
|
-
|
26
|
-
show!
|
27
|
-
end
|
28
|
-
|
29
|
-
def csv_bookings
|
30
|
-
@account = Account.find(params[:id])
|
31
|
-
@bookings = apply_scopes(Booking).by_account(@account)
|
32
|
-
send_csv @bookings, :only => [:value_date, :title, :comments, :amount, 'credit_account.code', 'debit_account.code'], :filename => "%s-%s.csv" % [@account.code, @account.title]
|
33
|
-
end
|
34
|
-
|
35
|
-
def edit_bookings
|
36
|
-
@account = Account.find(params[:id])
|
37
|
-
@bookings = apply_scopes(Booking).by_account(@account)
|
38
|
-
end
|
39
|
-
|
40
|
-
def update_bookings
|
41
|
-
bookings = params[:bookings]
|
42
|
-
|
43
|
-
bookings.each do |id, attributes|
|
44
|
-
attributes.merge!({:credit_account_id => Account.find_by_code(attributes[:credit_account_code]).id})
|
45
|
-
attributes.merge!({:debit_account_id => Account.find_by_code(attributes[:debit_account_code]).id})
|
46
|
-
Booking.find(id).update_attributes(attributes)
|
47
|
-
end
|
48
|
-
|
49
|
-
account = Account.find(params[:id])
|
50
|
-
redirect_to account
|
51
|
-
end
|
52
|
-
end
|
@@ -1,67 +0,0 @@
|
|
1
|
-
class BookingsController < AuthorizedController
|
2
|
-
# Scopes
|
3
|
-
has_scope :by_value_period, :using => [:from, :to], :default => proc { |c| c.session[:has_scope] }
|
4
|
-
has_scope :by_text
|
5
|
-
|
6
|
-
# Actions
|
7
|
-
def index
|
8
|
-
# @bookings = apply_scopes(Booking).accessible_by(current_ability, :list).includes(:credit_account, :debit_account).paginate(:page => params[:page], :per_page => params[:per_page])
|
9
|
-
index!
|
10
|
-
end
|
11
|
-
|
12
|
-
def new
|
13
|
-
@booking = Booking.new(:value_date => Date.today)
|
14
|
-
# Only include base class records
|
15
|
-
@booking_templates = BookingTemplate.where(:type => [nil, 'BookingTemplate']).where("NOT(code LIKE '%:%')").paginate(:page => params[:page])
|
16
|
-
new!
|
17
|
-
end
|
18
|
-
|
19
|
-
def select_booking
|
20
|
-
@booking = Booking.find(params[:id]).dup
|
21
|
-
|
22
|
-
# Clear reference
|
23
|
-
@booking.reference = nil
|
24
|
-
|
25
|
-
increment_booking_code
|
26
|
-
# Take value date from form
|
27
|
-
@booking.value_date = params[:booking][:value_date]
|
28
|
-
|
29
|
-
render :action => 'simple_edit'
|
30
|
-
end
|
31
|
-
|
32
|
-
def simple_edit
|
33
|
-
new!
|
34
|
-
end
|
35
|
-
|
36
|
-
def select
|
37
|
-
@booking = Booking.new(params[:booking])
|
38
|
-
increment_booking_code
|
39
|
-
@booking_templates = BookingTemplate.where(:type => [nil, 'BookingTemplate']).where("NOT(code LIKE '%:%')").paginate(:page => params[:page])
|
40
|
-
@bookings = Booking.where("title LIKE ?", '%' + @booking.title + '%').order('value_date DESC').paginate(:page => params[:page])
|
41
|
-
end
|
42
|
-
|
43
|
-
def create
|
44
|
-
@booking = Booking.new(params[:booking])
|
45
|
-
|
46
|
-
create! do |success, failure|
|
47
|
-
success.html do
|
48
|
-
redirect_to new_booking_path
|
49
|
-
end
|
50
|
-
failure.html {render 'edit'}
|
51
|
-
end
|
52
|
-
end
|
53
|
-
|
54
|
-
def copy
|
55
|
-
original_booking = Booking.find(params[:id])
|
56
|
-
|
57
|
-
@booking = original_booking.dup
|
58
|
-
|
59
|
-
render 'edit'
|
60
|
-
end
|
61
|
-
|
62
|
-
private
|
63
|
-
|
64
|
-
def increment_booking_code
|
65
|
-
@booking.code = (Booking.maximum(:code) || 0) + 1
|
66
|
-
end
|
67
|
-
end
|
@@ -1,12 +0,0 @@
|
|
1
|
-
%tr[account]
|
2
|
-
%td= account.code
|
3
|
-
%td= link_to account.title, url_for(account), {'data-href-container' => 'tr'}, :by_value_period => params[:by_value_period]
|
4
|
-
- if @date
|
5
|
-
%td{:style => "text-align: right"}= currency_fmt(account.saldo(@date))
|
6
|
-
- elsif params[:by_value_period]
|
7
|
-
%td{:style => "text-align: right"}= currency_fmt(account.saldo(params[:by_value_period][:from]..params[:by_value_period][:to]))
|
8
|
-
- else
|
9
|
-
%td{:style => "text-align: right"}= currency_fmt(account.saldo)
|
10
|
-
%td.action-links
|
11
|
-
= list_link_for(:edit, account)
|
12
|
-
= list_link_for(:delete, account)
|
@@ -1,15 +0,0 @@
|
|
1
|
-
%tr[@booking]
|
2
|
-
%td= @booking.value_date
|
3
|
-
%td
|
4
|
-
= link_to @booking.title, @booking, {'data-href-container' => 'tr'}
|
5
|
-
- if @booking.comments.present?
|
6
|
-
%hr{:style => "height: 1px; margin: 0"}/
|
7
|
-
%i= @booking.comments
|
8
|
-
%td= link_to @booking.reference.to_s(:reference), @booking.reference unless @booking.reference.nil?
|
9
|
-
%td.currency= (@booking.credit_account == @account) ? currency_fmt(@booking.amount) : content_tag('i', link_to(@booking.credit_account.code, account_path(@booking.credit_account), :title => @booking.credit_account.title))
|
10
|
-
%td.currency= (@booking.debit_account == @account) ? currency_fmt(@booking.amount) : content_tag('i', link_to(@booking.debit_account.code, account_path(@booking.debit_account), :title => @booking.debit_account.title))
|
11
|
-
%td.currency= currency_fmt(@saldo)
|
12
|
-
%td.action-links
|
13
|
-
= list_link_for(:edit, [@account, @booking])
|
14
|
-
= list_link_for(:delete, [@account, @booking], :remote => true)
|
15
|
-
= list_link_for(:copy, @booking)
|
@@ -1,5 +0,0 @@
|
|
1
|
-
%tr
|
2
|
-
- ## TODO: See http://groups.google.com/group/will_paginate/browse_thread/thread/5d702999d78e47e5
|
3
|
-
- url_params = {:controller => 'accounts', :action => 'show', :id => params[:account_id] || params[:id]}
|
4
|
-
%th{:colspan => "6", :style => "text-align: right"}= will_paginate @bookings, :params => url_params.merge(:query => params[:query])
|
5
|
-
%th
|
@@ -1,8 +0,0 @@
|
|
1
|
-
- credit_turnover, debit_turnover = @account.turnover(@bookings)
|
2
|
-
%tr#booking_list_turnover{:style => "border-top: double 2px black"}
|
3
|
-
%td{:colspan => "3"}
|
4
|
-
Umsatz (#{h @bookings.first.value_date} bis #{h @bookings.last.value_date})
|
5
|
-
%td{:style => "text-align: right"}= currency_fmt(credit_turnover)
|
6
|
-
%td{:style => "text-align: right"}= currency_fmt(debit_turnover)
|
7
|
-
%td
|
8
|
-
%td
|
@@ -1,14 +0,0 @@
|
|
1
|
-
%tr
|
2
|
-
= f.fields_for "", edit_booking do |f|
|
3
|
-
%td.span2= f.text_field :value_date, :style => 'width: 96%'
|
4
|
-
%td.span6
|
5
|
-
= f.text_field :title, :style => 'width: 98%'
|
6
|
-
= f.text_field :comments, :style => 'width: 98%'
|
7
|
-
= f.hidden_field :reference_type, :value => 'Invoice'
|
8
|
-
= f.select :reference_id, suggested_invoices_for_booking(f.object), :include_blank => true, :style => 'width: 98%', :class => 'combobox'
|
9
|
-
%td.span1= f.text_field :amount, :style => 'width: 94%'
|
10
|
-
|
11
|
-
%td.span1= f.association :credit_account, :collection => accounts_as_collection(Account.all), :as => :combobox, :style => 'width: 94%', :wrapper => :inline
|
12
|
-
%td.span1= f.association :debit_account, :collection => accounts_as_collection(Account.all), :as => :combobox, :style => 'width: 94%', :wrapper => :inline
|
13
|
-
|
14
|
-
%td{:style => 'display:none'}= f.hidden_field :id
|
@@ -1,15 +0,0 @@
|
|
1
|
-
- url_params = {:controller => 'accounts', :action => 'show', :id => params[:account_id] || params[:id]}
|
2
|
-
= paginated_section @bookings, :params => url_params.merge(:query => params[:query]) do
|
3
|
-
= simple_form_for :bookings, :url => update_bookings_account_path do |f|
|
4
|
-
%table.table.table-striped
|
5
|
-
%thead
|
6
|
-
%tr
|
7
|
-
%th= t_attr :value_date, Booking
|
8
|
-
%th= t_attr :title, Booking
|
9
|
-
%th= t_attr :amount, Booking
|
10
|
-
%th= t_attr :credit_account, Booking
|
11
|
-
%th= t_attr :debit_account, Booking
|
12
|
-
%tbody
|
13
|
-
= render :partial => 'edit_booking', :collection => @bookings, :locals => {:f => f}
|
14
|
-
|
15
|
-
= f.button :submit
|
@@ -1,9 +0,0 @@
|
|
1
|
-
.tabbable
|
2
|
-
%ul.nav.nav-tabs
|
3
|
-
%li.active= link_to t_title(:journal, Account), '#tab-bookings', {:data => {:toggle => 'tab'}}
|
4
|
-
%li= link_to t_title(:info, Account), '#tab-info', {:data => {:toggle => 'tab'}}
|
5
|
-
%li= link_to t_title(:list, Attachment), '#tab-attachments', {:data => {:toggle => 'tab'}}
|
6
|
-
|
7
|
-
.tab-content
|
8
|
-
#tab-bookings.tab-pane.active= render 'show_bookings'
|
9
|
-
#tab-info.tab-pane= render "form"
|
@@ -1,19 +0,0 @@
|
|
1
|
-
- url_params = {:controller => 'accounts', :action => 'show', :id => params[:account_id] || params[:id]}
|
2
|
-
|
3
|
-
%table.table.table-striped.bookings.collection
|
4
|
-
%thead
|
5
|
-
= render 'accounts/booking_list_header'
|
6
|
-
- @saldo = @account.saldo(@carry_booking, false)
|
7
|
-
%tbody
|
8
|
-
= render 'accounts/carry_booking' unless @saldo == 0
|
9
|
-
|
10
|
-
- for @booking in @bookings
|
11
|
-
- amount = @booking.amount
|
12
|
-
- amount = -(amount) if @account.is_liability_account?
|
13
|
-
- @saldo -= amount if @booking.debit_account == @account
|
14
|
-
- @saldo += amount if @booking.credit_account == @account
|
15
|
-
= render 'accounts/booking_item'
|
16
|
-
%tfoot
|
17
|
-
= render 'accounts/booking_list_footer' unless @bookings.empty?
|
18
|
-
= paginate @bookings
|
19
|
-
|
@@ -1,10 +0,0 @@
|
|
1
|
-
.contextual
|
2
|
-
= icon_link_to 'only_credit_bookings', url_for(:only_credit_bookings => true) unless params[:only_credit_bookings]
|
3
|
-
= icon_link_to 'only_debit_bookings', url_for(:only_debit_bookings => true) unless params[:only_debit_bookings]
|
4
|
-
= icon_link_to 'all_bookings', @account if params[:only_credit_bookings] || params[:only_debit_bookings]
|
5
|
-
= contextual_links_for
|
6
|
-
|
7
|
-
= boot_page_title
|
8
|
-
= render 'show'
|
9
|
-
|
10
|
-
= render 'bookings/sidebar'
|
@@ -1 +0,0 @@
|
|
1
|
-
= render 'accounts/account', :account => bank_account
|
@@ -1,17 +0,0 @@
|
|
1
|
-
- item_action ||= lambda{|object| url_for(object)}
|
2
|
-
|
3
|
-
%tr[booking]
|
4
|
-
%td= booking.value_date
|
5
|
-
%td
|
6
|
-
= link_to booking.title, item_action.call(booking), 'data-href-container' => 'tr'
|
7
|
-
- if booking.comments.present?
|
8
|
-
%hr{:style => "height: 1px; margin: 0"}/
|
9
|
-
%i= booking.comments
|
10
|
-
%td= link_to booking.reference.to_s(:reference), booking.reference unless booking.reference.nil?
|
11
|
-
%td= link_to booking.credit_account.code, account_path(booking.credit_account), :title => booking.credit_account.title unless booking.credit_account.nil?
|
12
|
-
%td= link_to booking.debit_account.code, account_path(booking.debit_account), :title => booking.debit_account.title unless booking.debit_account.nil?
|
13
|
-
%td.currency= currency_fmt(booking.amount)
|
14
|
-
%td.action-links
|
15
|
-
= list_link_for(:edit, booking)
|
16
|
-
= list_link_for(:delete, booking, :remote => true)
|
17
|
-
= list_link_for(:copy, booking)
|
@@ -1,28 +0,0 @@
|
|
1
|
-
= simple_form_for @booking do |f|
|
2
|
-
.row-fluid
|
3
|
-
.span6
|
4
|
-
= f.input :title, :input_html => {"data-autofocus" => true}
|
5
|
-
.span6
|
6
|
-
= f.input :value_date, :as => :date_field
|
7
|
-
.row-fluid
|
8
|
-
.span6
|
9
|
-
= f.input :amount, :as => :string, :input_html => {:size => 12}
|
10
|
-
.span6
|
11
|
-
= f.input :code
|
12
|
-
|
13
|
-
.row-fluid
|
14
|
-
.span6
|
15
|
-
= f.association :credit_account, :collection => accounts_as_collection(Account.all), :as => :combobox
|
16
|
-
.span6
|
17
|
-
= f.association :debit_account, :collection => accounts_as_collection(Account.all), :as => :combobox
|
18
|
-
|
19
|
-
.row-fluid
|
20
|
-
.span12
|
21
|
-
= f.input :comments, :input_html => {:rows => 4, :class => 'span12'}
|
22
|
-
|
23
|
-
.row-fluid
|
24
|
-
.span12
|
25
|
-
= f.input :reference_type, :as => :hidden, :input_html => {:value => 'Invoice'}
|
26
|
-
//= f.association :reference, :collection => suggested_invoices_for_booking(@booking, :include_all => true), :as => :combobox, :include_blank => true
|
27
|
-
|
28
|
-
= f.button :submit
|
@@ -1,16 +0,0 @@
|
|
1
|
-
%table.table.table-striped.bookings.collection
|
2
|
-
%thead
|
3
|
-
%tr
|
4
|
-
%th= t_attr :valuta
|
5
|
-
%th= t_attr :title
|
6
|
-
%th= t_attr :reference
|
7
|
-
%th= t_attr :credit_account
|
8
|
-
%th= t_attr :debit_account
|
9
|
-
%th.currency= t_attr 'amount'
|
10
|
-
%th.action-links
|
11
|
-
%tbody
|
12
|
-
= render collection, :item_action => (item_action ||= nil)
|
13
|
-
|
14
|
-
= paginate collection
|
15
|
-
|
16
|
-
= render 'bookings/sidebar'
|
@@ -1,5 +0,0 @@
|
|
1
|
-
= simple_form_for @booking, :url => select_bookings_path do |f|
|
2
|
-
= hidden_field_tag :stage, 'select'
|
3
|
-
= f.input :title, :input_html => {'data-autofocus' => true}
|
4
|
-
= f.input :value_date, :as => :date_field, :input_html => {:size => 10, :style => 'text-align: right'}
|
5
|
-
= f.button :submit
|
@@ -1,6 +0,0 @@
|
|
1
|
-
- filter_name = :by_value_period
|
2
|
-
- content_for :sidebar do
|
3
|
-
- filters = current_tenant.fiscal_years.reverse.map do |period|
|
4
|
-
- value = {"from" => period[:from].to_s(:db), "to" => period[:to].to_s(:db)}
|
5
|
-
- {:value => value, :title => period[:to].year}
|
6
|
-
= boot_nav_filter(filter_name, [{:title => :all, :value => nil}] + filters)
|
@@ -1,25 +0,0 @@
|
|
1
|
-
= simple_form_for @booking do |f|
|
2
|
-
|
3
|
-
.row-fluid
|
4
|
-
.span6
|
5
|
-
= f.input :title, :input_html => {"data-autofocus" => true}
|
6
|
-
.span6
|
7
|
-
= f.input :value_date, :as => :date_field
|
8
|
-
.row-fluid
|
9
|
-
.span6
|
10
|
-
= f.input :amount, :as => :string, :input_html => {:size => 12}
|
11
|
-
.span6
|
12
|
-
= f.input :code
|
13
|
-
|
14
|
-
.row-fluid
|
15
|
-
.span6
|
16
|
-
= f.association :credit_account, :collection => accounts_as_collection(Account.all), :as => :combobox
|
17
|
-
.span6
|
18
|
-
= f.association :debit_account, :collection => accounts_as_collection(Account.all), :as => :combobox
|
19
|
-
|
20
|
-
.row-fluid
|
21
|
-
.span12
|
22
|
-
= f.input :comments, :input_html => {:rows => 4}
|
23
|
-
|
24
|
-
= f.button :submit
|
25
|
-
|
@@ -1,11 +0,0 @@
|
|
1
|
-
= contextual_links
|
2
|
-
|
3
|
-
= boot_page_title :new
|
4
|
-
|
5
|
-
= render 'form'
|
6
|
-
|
7
|
-
%h3= t_model(BookingTemplate)
|
8
|
-
= render 'booking_templates/list', :item_action => lambda{|object| new_booking_booking_template_path(object)}
|
9
|
-
|
10
|
-
%h3= t_model(Booking)
|
11
|
-
= render 'bookings/list', :item_action => lambda{|object| select_booking_booking_path(object, :booking => params[:booking])}
|
data/config/routes.rb
DELETED
@@ -1,44 +0,0 @@
|
|
1
|
-
# encoding: UTF-8
|
2
|
-
|
3
|
-
# Routes
|
4
|
-
Rails.application.routes.draw do
|
5
|
-
# Bookings
|
6
|
-
resources :bookings do
|
7
|
-
collection do
|
8
|
-
post :select
|
9
|
-
get :simple_edit
|
10
|
-
end
|
11
|
-
member do
|
12
|
-
get :select_booking
|
13
|
-
get :copy
|
14
|
-
end
|
15
|
-
end
|
16
|
-
|
17
|
-
resources :accounts do
|
18
|
-
member do
|
19
|
-
get :csv_bookings
|
20
|
-
get :edit_bookings
|
21
|
-
post :update_bookings
|
22
|
-
end
|
23
|
-
resources :bookings
|
24
|
-
resources :attachments
|
25
|
-
end
|
26
|
-
|
27
|
-
resources :banks do
|
28
|
-
resources :phone_numbers
|
29
|
-
member do
|
30
|
-
get :new_phone_number
|
31
|
-
end
|
32
|
-
collection do
|
33
|
-
get :new_phone_number
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
|
-
resources :bank_accounts do
|
38
|
-
member do
|
39
|
-
get :csv_bookings
|
40
|
-
end
|
41
|
-
resources :bookings
|
42
|
-
resources :attachments
|
43
|
-
end
|
44
|
-
end
|