Skip to content
Open

V4.9.2 #1206

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
4.9.1
4.9.2
4 changes: 4 additions & 0 deletions app/assets/javascripts/application_legacy.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,10 @@ $(function() {
// Handle ajax errors
// render json: {error: "can't except this!"}, status: :unprocessable_entity
$(document).ajaxError(function(ev, xhr, settings, exception) {
if (xhr.statusText === 'abort') {
return;
}
console.log(exception.message)
try {
msg = xhr.responseJSON.error;
} catch(err) {
Expand Down
2 changes: 1 addition & 1 deletion app/assets/stylesheets/bootstrap_and_overrides.css.less
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ span.positive_amount {
color: black;
}

span.negative_amout {
span.negative_amount {
color: red;
}

Expand Down
1 change: 1 addition & 0 deletions app/controllers/concerns/auth.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ def authenticate(role = 'any')
if current_user
# We have an authenticated user, now check role...
# Roles gets the user through his memberships.

hasRole = case role
when 'admin' then current_user.role_admin?
when 'finance' then current_user.role_finance?
Expand Down
2 changes: 1 addition & 1 deletion app/helpers/application_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ def format_datetime_timespec(time, format)
def format_currency(amount)
return nil if amount.nil?

class_name = amount < 0 ? 'negative_amout' : 'positive_amount'
class_name = amount < 0 ? 'negative_amount' : 'positive_amount'
content_tag :span, number_to_currency(amount), class: class_name
end

Expand Down
44 changes: 23 additions & 21 deletions app/views/finance/financial_transactions/_transactions.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -23,8 +23,6 @@
%th= heading_helper FinancialTransaction, :financial_transaction_type
%th= sort_link_helper heading_helper(FinancialTransaction, :note), "note"
- if with_payment
%th= heading_helper FinancialTransaction, :payment_plugin
%th= heading_helper FinancialTransaction, :payment_method
%th= heading_helper FinancialTransaction, :payment_amount
%th= heading_helper FinancialTransaction, :payment_fee
%th= heading_helper FinancialTransaction, :payment_state
Expand All @@ -34,33 +32,37 @@
- if with_hidden
%th
%tbody
- @financial_transactions.each do |t|
%tr{class: "#{'deleted_row' if t.hidden?}"}
- @financial_transactions.each do |ta|
%tr{class: "#{'deleted_row' if ta.hidden?}"}
%td
- if t.financial_link && current_user.role_finance?
= link_to format_time(t.created_on), finance_link_path(t.financial_link)
- if ta.financial_link && current_user.role_finance?
= link_to format_time(ta.created_on), finance_link_path(ta.financial_link)
- else
= format_time(t.created_on)
= format_time(ta.created_on)
- if with_ordergroup
%td= h link_to t.ordergroup_name, finance_group_transactions_path(t.ordergroup)
%td= h show_user(t.user)
%td= h link_to ta.ordergroup_name, finance_group_transactions_path(ta.ordergroup)
%td= h show_user(ta.user)
- if FinancialTransactionType.has_multiple_types
%td= h t.financial_transaction_type.name
%td= render "finance/financial_transactions/order_note", financial_transaction:t, with_grouporder_link: with_grouporder_links
%td= h ta.financial_transaction_type.name
%td= render "finance/financial_transactions/order_note", financial_transaction:ta, with_grouporder_link: with_grouporder_links
- if with_payment
%td= t.payment_plugin
%td= t.payment_method
%td= format_currency t.payment_amount
%td= format_currency t.payment_fee
%td= t.payment_state
%td= format_currency ta.payment_amount
%td= format_currency ta.payment_fee
- else
%td= ' '
%td= ' '
- if not ta.payment_state.nil?
%td= format_state "payments.mollie.result.#{ta.payment_state}"
- else
%td= ' '
- FinancialTransactionClass.sorted.each do |c|
%td.numeric{style: 'width:5em'}
- if t.financial_transaction_type.financial_transaction_class == c
= format_currency t.amount
- if ta.financial_transaction_type.financial_transaction_class == c
= format_currency ta.amount
- if with_hidden
%td.actions{style: 'width:1em'}
- unless t.hidden? || t.amount.nil?
= link_to finance_transaction_path(t), method: :delete,
data: {confirm: t('.confirm_revert', name: t.note)}, title: t('.revert_title'),
- unless ta.hidden? || ta.amount.nil?
= link_to finance_transaction_path(ta), method: :delete,
data: {confirm: t('.confirm_revert', name: ta.note)}, title: t('.revert_title'),
class: 'btn btn-danger btn-mini' do
= glyph :remove
16 changes: 12 additions & 4 deletions app/views/home/index.html.haml
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,12 @@
%b= current_user.ordergroup.name
= ' | '
- if FoodsoftConfig[:charge_members_manually]
= heading_helper(Ordergroup, :account_balance) + ':'
= heading_helper(Ordergroup, :account_balance) + ': '
= number_to_currency(current_user.ordergroup.account_balance)
- else
= heading_helper(Ordergroup, :available_funds) + ':'
= heading_helper(Ordergroup, :available_funds) + ': '
= number_to_currency(current_user.ordergroup.get_available_funds)
= ' | '
%small= t '.my_ordergroup.last_update', when: distance_of_time_in_words(Time.now, current_user.ordergroup.account_updated)
%h3
= t '.my_ordergroup.transactions.title'
Expand All @@ -79,19 +80,26 @@
- FinancialTransactionClass.sorted.each do |fc|
%th
= fc.display
- if with_payment
%th= heading_helper FinancialTransaction, :payment_fee
- for ft in financial_transactions
%tr
%td= format_time(ft.created_on)
%td= h(show_user(ft.user))
- if FinancialTransactionType.has_multiple_types
%td= h(ft.financial_transaction_type.name)
%td= h(render "finance/financial_transactions/order_note", financial_transaction:ft, with_grouporder_link: true)
- if with_payment
%td= h(ft.payment_state)
- if with_payment and not ft.payment_state.nil?
%td= h(format_state "payments.mollie.result.#{ft.payment_state}")
- else
%td= ' '
- FinancialTransactionClass.sorted.each do |fc|
%td.numeric{style: 'width:5em'}
- if ft.financial_transaction_type.financial_transaction_class == fc
= format_currency(ft.amount)
%td.numeric{style: 'width:5em'}
- if with_payment and (not ft.payment_state.nil? and ft.payment_state["paid"])
= format_currency(ft.payment_fee)

-# placeholder deface to add content using erb[silent]:contains()
- '<dashboard_bottom_mark>'
6 changes: 6 additions & 0 deletions config/environments/development.rb.SAMPLE
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ Rails.application.configure do
# Show full error reports.
config.consider_all_requests_local = true

# Allow another local ip range (additionaly to 127.0.0.0)
config.web_console.permissions = '10.0.0.0/16'

# Allow specific host to be allowed (mainly useful when working with redirects when testing Mollie)
config.hosts << '.reepie.nl'

# Enable/disable caching. By default caching is disabled.
# Run rails dev:cache to toggle caching.
if Rails.root.join('tmp', 'caching-dev.txt').exist?
Expand Down
1 change: 1 addition & 0 deletions config/locales/en.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ en:
note: Note
ordergroup: Ordergroup
user: Entered by
payment_state: Payment state
financial_transaction_class:
ignore_for_account_balance: Ignore for account balance
name: Name
Expand Down
12 changes: 8 additions & 4 deletions config/locales/nl.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ nl:
unit_quantity: Colligrootte
bank_account:
balance: Tegoed
bank_gateway: Bank gateway
bank_gateway: Bank
description: Omschrijving
iban: IBAN
name: Naam
Expand Down Expand Up @@ -69,7 +69,11 @@ nl:
financial_transaction_type: Financiële-transactietype
note: Notitie
ordergroup: Huishouden
user: Ingevoerd door
user: Gebruiker
payment_state: Status
payment_amount: Totaal bedrag
payment_fee: Kosten

financial_transaction_class:
ignore_for_account_balance: Negeren voor rekeningsaldo
name: Naam
Expand Down Expand Up @@ -150,7 +154,7 @@ nl:
order_comment:
text: Commentaar voor deze bestelling toevoegen…
ordergroup:
account_balance: Tegoed
account_balance: Tegoed totaal
available_funds: Beschikbaar tegoed
break: "(Laatste) pauze"
break_until: tot
Expand Down Expand Up @@ -1138,7 +1142,7 @@ nl:
index:
due_date_format: "%A %d %B"
my_ordergroup:
last_update: Laatst gewijzigd %{when} geleden
last_update: Laatst bijgewerkt %{when} geleden
title: Mijn huishouden
transactions:
title: Laatste transacties
Expand Down
2 changes: 2 additions & 0 deletions plugins/mollie/app/controllers/payments/mollie_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,8 @@ def update_transaction(transaction)
def payment_methods
@payment_methods = fetch_mollie_methods
@payment_methods_fees = @payment_methods.to_h do |method|
next [method.id, []] if method.pricing.blank?

[method.id, method.pricing.map do |pricing|
{
description: pricing.description,
Expand Down
Loading