has_accounts_engine 3.0.0.beta10 → 3.0.0.beta11

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: 76006e88be871b79e33bca9f8ceb7780218bd15f
4
- data.tar.gz: 0483ee9a50458ca0897698df090732c5af74c3ab
3
+ metadata.gz: 1a9a0fc966a5f625dece331009a3d9f15d95d34e
4
+ data.tar.gz: f96c0f4ee3acf648b9bd1a25db88e184d0061431
5
5
  SHA512:
6
- metadata.gz: 20442b5840215e0e66941993bc216fd527a83314f23666f230edcc3a8a3bc0acdc8b39f1a80f1d157a53dda619ebd2e35ec490dc2f36442940d6b19d6293c8ad
7
- data.tar.gz: 3e6e6282189af1eff23eb6124c1399293054067c8811ba38edea850205c91ef0c40a9a261426752878c474f6e11d06790eb7653d6cc415133af20a7c98d8bc8b
6
+ metadata.gz: 5b8fec12a5c69246ec8e23179105a98c65db7d62ea1be2c573d0f397b5f15b88e0fdb431864519c503833cabe580625232663007977aedc7f605c69a218ca6d9
7
+ data.tar.gz: f1e334312c52edcdd66c233c442e423932a7d3cc4d4aba8d959eea1a8c7dc3dc4948ce1a93f1c9255d032b241b1dbe5fb4266cdefe2c500027b4fa9326455df8
@@ -12,7 +12,8 @@ class AccountsController < HasAccountsController
12
12
  def show
13
13
  @account = Account.find(params[:id])
14
14
  @bookings = apply_scopes(Booking).includes(:debit_account => :account_type, :credit_account => :account_type).by_account(@account)
15
- @bookings = @bookings.page(params[:page]) || 1
15
+ @bookings = @bookings.page(params[:page] || 1)
16
+ @bookings = @bookings.per_page(params[:per_page].to_i) if params[:per_page].present?
16
17
 
17
18
  if params[:only_credit_bookings]
18
19
  @bookings = @bookings.where(:credit_account_id => @account.id)
@@ -1,5 +1,6 @@
1
1
  class BookingsController < HasAccountsController
2
2
  # Scopes
3
+ has_scope :by_code
3
4
  has_scope :by_text
4
5
  has_scope :by_amount, :using => [:from, :to]
5
6
  has_scope :by_date, :using => [:from, :to]
@@ -0,0 +1,13 @@
1
+ = simple_form_for '', :method => :get, remote: true do |f|
2
+ .container-fluid
3
+ .row-fluid
4
+ .span3= f.input :by_code, label: t_attr(:code), required: false
5
+ .span6= f.input :by_text, label: t(:by_text, scope: 'bookings.search'), required: false
6
+ .row-fluid
7
+ .span3= f.input 'by_amount[from]', label: t(:by_amount_from, scope: 'bookings.search'), required: false
8
+ .span3= f.input 'by_amount[to]', label: t(:by_amount_to, scope: 'bookings.search'), required: false
9
+ .span3= f.input 'by_date[from]', label: t(:by_date_from, scope: 'bookings.search'), required: false, input_html: { value: try_parse_date(params[:by_date][:from]) }
10
+ .span3= f.input 'by_date[to]', label: t(:by_date_to, scope: 'bookings.search'), required: false, input_html: { value: try_parse_date(params[:by_date][:to]) }
11
+
12
+ .form-actions
13
+ = f.button :submit, t_action(:search)
@@ -1,5 +1,5 @@
1
- = simple_form_for @booking do |f|
2
- = render 'form_fields', resource: @booking, f: f
1
+ = simple_form_for resource, remote: true do |f|
2
+ = render 'form_fields', resource: resource, f: f
3
3
 
4
4
  .form-actions
5
5
  = f.button :submit
@@ -2,18 +2,7 @@
2
2
 
3
3
  = boot_page_title
4
4
 
5
- = simple_form_for '', :method => :get, remote: true do |f|
6
- .container-fluid
7
- .row-fluid
8
- .span6= f.input :by_text, label: t(:by_text, scope: 'bookings.search'), required: false
9
- .row-fluid
10
- .span3= f.input 'by_amount[from]', label: t(:by_amount_from, scope: 'bookings.search'), required: false
11
- .span3= f.input 'by_amount[to]', label: t(:by_amount_to, scope: 'bookings.search'), required: false
12
- .span3= f.input 'by_date[from]', label: t(:by_date_from, scope: 'bookings.search'), required: false, input_html: { value: try_parse_date(params[:by_date][:from]) }
13
- .span3= f.input 'by_date[to]', label: t(:by_date_to, scope: 'bookings.search'), required: false, input_html: { value: try_parse_date(params[:by_date][:to]) }
14
-
15
- .form-actions
16
- = f.button :submit, t_action(:search)
5
+ = render 'filter_form'
17
6
 
18
7
  .index
19
8
  = render 'list'
@@ -1,3 +1,3 @@
1
1
  module HasAccountsEngine
2
- VERSION = "3.0.0.beta10"
2
+ VERSION = "3.0.0.beta11"
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.beta10
4
+ version: 3.0.0.beta11
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-09-03 00:00:00.000000000 Z
11
+ date: 2015-11-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -292,6 +292,7 @@ files:
292
292
  - app/views/booking_templates/_list.html.haml
293
293
  - app/views/bookings/_booking.html.haml
294
294
  - app/views/bookings/_booking_form.html.haml
295
+ - app/views/bookings/_filter_form.html.haml
295
296
  - app/views/bookings/_form.html.haml
296
297
  - app/views/bookings/_form_fields.html.haml
297
298
  - app/views/bookings/_list.html.haml