has_accounts_engine 3.0.0.beta13 → 3.0.0.beta14

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b39620cccb368cedd53cf0961b8ec92d6c94ff63
4
- data.tar.gz: 28d8a584464240cb74b413e6cb2e279a69b2fe94
3
+ metadata.gz: 8958dca0de9ab8dd201d2e509d52be51c3607f99
4
+ data.tar.gz: 6801c3a019deb8f2ea8a4892eea92699db889088
5
5
  SHA512:
6
- metadata.gz: 32eb1d7cf85729d5467a294505d0abaabeaff46a34968e251c15c495651200495faa585ff07659ea73202cb30bbf0ad40d39943441ee3f634d945f4bbfde02ba
7
- data.tar.gz: 0f66cfe81f47c1fc34269884405cb68d1422ef68d63145143b0b1a34b80a676753334b976bd247deb298ea5cf9b3cc69720544e5d88f6ce0260d4942e42ad830
6
+ metadata.gz: a34f89e7c8db90206aa61c64305eae12251dbc140bc0964b6b36488632f327f42a49a8a0057ef22eba1ae8086bdfaa330290ef1a85ac18fae41b1359a682bda6
7
+ data.tar.gz: e0fd4ae0846c665d4928cd6551206c34248f42127a096bd960a4e9f891e01566f6cffcf81dfe945e8c06c21acb32a03a3d22098c03edb36e5e8316898f6c0cc2
@@ -5,27 +5,6 @@ class BookingsController < HasAccountsController
5
5
  has_scope :by_amount, :using => [:from, :to]
6
6
  has_scope :by_date, :using => [:from, :to]
7
7
 
8
- # Actions
9
- def select_booking
10
- @booking = Booking.find(params[:id]).dup
11
-
12
- # Clear reference
13
- @booking.reference = nil
14
-
15
- increment_booking_code
16
- # Take value date from form
17
- @booking.value_date = params[:booking][:value_date]
18
-
19
- render :action => 'edit'
20
- end
21
-
22
- def select
23
- @booking = Booking.new(params[:booking])
24
- increment_booking_code
25
- @booking_templates = BookingTemplate.where(:type => [nil, 'BookingTemplate']).where("NOT(code LIKE '%:%')").paginate(:page => params[:page])
26
- @bookings = Booking.where("title LIKE ?", '%' + @booking.title + '%').order('value_date DESC').paginate(:page => params[:page])
27
- end
28
-
29
8
  def create
30
9
  create! { new_booking_path }
31
10
  end
@@ -34,6 +13,7 @@ class BookingsController < HasAccountsController
34
13
  original_booking = Booking.find(params[:id])
35
14
 
36
15
  @booking = original_booking.dup
16
+ increment_booking_code
37
17
 
38
18
  render 'edit'
39
19
  end
@@ -1,8 +1,11 @@
1
1
  %tr[account]
2
2
  %td= account.code
3
3
  %td
4
- = link_to account.title, url_for(account), {'data-href-container' => 'tr'}
5
- .pull-right= account.tags.map{|tag| boot_label(tag.name)}.join(' ').html_safe
4
+ = link_to account.title, account, 'data-href-container' => 'tr'
5
+ .pull-right
6
+ - account.tags.each do |tag|
7
+ = boot_label(tag)
6
8
  %td.action-links
7
9
  = list_link_for(:edit, account)
8
10
  = list_link_for(:delete, account)
11
+ = list_link_to :print, account_path(account, :format => :pdf, :per_page => 5000)
@@ -1,8 +1,9 @@
1
1
  %tr#booking_list_saldo{:style => "border-top: double 2px black"}
2
2
  %td{:colspan => "3"}
3
- Kontostand (per #{@bookings.last.value_date})
3
+ - if @bookings.any?
4
+ Kontostand (per #{@bookings.last.value_date})
4
5
  %td
5
6
  %td
6
7
  %td
7
- %td{:style => "text-align: right"}= currency_fmt(@account.saldo(@bookings.last))
8
+ %td.currency= currency_fmt(@account.saldo(@bookings.last))
8
9
  %td.action-links
@@ -1,8 +1,9 @@
1
1
  - credit_turnover, debit_turnover = @account.turnover(@bookings)
2
2
  %tr#booking_list_turnover{:style => "border-top: double 2px black"}
3
3
  %td{:colspan => "4"}
4
- Umsatz (#{h @bookings.first.value_date} bis #{h @bookings.last.value_date})
5
- %td{:style => "text-align: right"}= currency_fmt(debit_turnover)
6
- %td{:style => "text-align: right"}= currency_fmt(credit_turnover)
4
+ - if @bookings.any?
5
+ Umsatz (#{h @bookings.first.value_date} bis #{h @bookings.last.value_date})
6
+ %td.currency= currency_fmt(debit_turnover)
7
+ %td.currency= currency_fmt(credit_turnover)
7
8
  %td
8
9
  %td.action-links
@@ -1,10 +1,9 @@
1
- %tr{:id => "carry_booking"}
1
+ %tr#carry_booking
2
2
  %td= @carry_booking.value_date
3
3
  %td
4
+ %td= t('bookyt.carry_booking')
4
5
  %td
5
- = t('bookyt.carry_booking')
6
6
  %td
7
7
  %td
8
- %td
9
- %td{:style => "text-align: right"}= currency_fmt(@saldo)
8
+ %td.currency= currency_fmt(@saldo)
10
9
  %td.action-links
@@ -14,6 +14,6 @@
14
14
  - @saldo += @booking.accounted_amount(@account)
15
15
  = render 'accounts/booking_item'
16
16
  %tfoot
17
- = render 'accounts/booking_list_footer'
17
+ = render 'accounts/booking_list_footer' unless @bookings.empty?
18
18
 
19
19
  = paginate @bookings
@@ -1,8 +1,6 @@
1
- - item_action ||= lambda{|object| url_for(object)}
2
-
3
1
  %tr[booking_template]
4
2
  %td
5
- = link_to "%s" % [booking_template.title, booking_template.code], item_action.call(booking_template), 'data-href-container' => 'tr'
3
+ = link_to booking_template.title, [:new_booking, booking_template], 'data-href-container' => 'tr'
6
4
  - if booking_template.comments.present?
7
5
  %hr{:style => "height: 1px; margin: 0"}/
8
6
  %i= booking_template.comments
@@ -13,3 +11,6 @@
13
11
  %td= link_to booking_template.credit_account.code, account_path(booking_template.credit_account), :title => booking_template.credit_account.title unless booking_template.credit_account.nil?
14
12
  %td.currency= amount_to_s(booking_template)
15
13
  %td= t(booking_template.amount_relates_to, :scope => 'booking_template.relation') if booking_template.amount_relates_to.present?
14
+ %td.action-links
15
+ = list_link_for(:edit, booking_template)
16
+ = list_link_for(:delete, booking_template)
@@ -9,4 +9,4 @@
9
9
  %th= t_attr :amount_relates_to, BookingTemplate
10
10
  %th.action-links
11
11
  %tbody
12
- = render @booking_templates, :item_action => (item_action ||= nil)
12
+ = render @booking_templates
@@ -1,10 +1,8 @@
1
- - item_action ||= lambda{|object| url_for(object)}
2
-
3
1
  %tr[booking]
4
2
  %td= booking.value_date
5
3
  %td= booking.code
6
4
  %td.subject
7
- = link_to booking.title, item_action.call(booking), 'data-table-key' => '13'
5
+ = link_to booking.title, booking, 'data-table-key' => '13'
8
6
  - if booking.comments.present?
9
7
  %div
10
8
  %i= booking.comments
@@ -9,9 +9,9 @@
9
9
  %th.debit_account= t_attr :debit_account
10
10
  %th.credit_account= t_attr :credit_account
11
11
  %th.amount.currency= t_attr 'amount'
12
- %th.action-links(style='width: 66px')
12
+ %th.action-links
13
13
  %tbody
14
- = render collection, :item_action => (item_action ||= nil)
14
+ = render collection
15
15
 
16
16
  = paginate collection if defined?(paginate)
17
17
  = render 'bookings/sidebar'
@@ -4,11 +4,7 @@
4
4
  Rails.application.routes.draw do
5
5
  # Bookings
6
6
  resources :bookings do
7
- collection do
8
- post :select
9
- end
10
7
  member do
11
- get :select_booking
12
8
  get :copy
13
9
  end
14
10
  end
@@ -23,24 +19,6 @@ Rails.application.routes.draw do
23
19
  resources :attachments
24
20
  end
25
21
 
26
- resources :banks do
27
- resources :phone_numbers
28
- member do
29
- get :new_phone_number
30
- end
31
- collection do
32
- get :new_phone_number
33
- end
34
- end
35
-
36
- resources :bank_accounts do
37
- member do
38
- get :csv_bookings
39
- end
40
- resources :bookings
41
- resources :attachments
42
- end
43
-
44
22
  resources :booking_templates do
45
23
  member do
46
24
  get :new_booking
@@ -1,3 +1,3 @@
1
1
  module HasAccountsEngine
2
- VERSION = "3.0.0.beta13"
2
+ VERSION = "3.0.0.beta14"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: has_accounts_engine
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0.beta13
4
+ version: 3.0.0.beta14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Simon Hürlimann (CyT)
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-11-06 00:00:00.000000000 Z
11
+ date: 2016-01-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -299,7 +299,6 @@ files:
299
299
  - app/views/bookings/_sidebar.html.haml
300
300
  - app/views/bookings/index.html.haml
301
301
  - app/views/bookings/index.js.erb
302
- - app/views/bookings/select.html.haml
303
302
  - app/views/bookings/show.html.haml
304
303
  - app/views/bookings/show.js.erb
305
304
  - app/views/bookings/update.js.erb
@@ -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])}