-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #602 from coopdevs/develop
v3.9.0
- Loading branch information
Showing
28 changed files
with
197 additions
and
66 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
app/decorators/member_report_decorator.rb → app/decorators/report/member_decorator.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
app/decorators/post_report_decorator.rb → app/decorators/report/post_decorator.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
class Report::TransferDecorator | ||
include Rails.application.routes.url_helpers | ||
include ActionView::Helpers | ||
include ApplicationHelper, TransfersHelper | ||
|
||
def initialize(org, collection) | ||
@org = org | ||
@collection = collection | ||
end | ||
|
||
def name(extension) | ||
"#{@org.name}_"\ | ||
"#{Transfer.model_name.human(count: :many)}_"\ | ||
"#{Date.today}."\ | ||
"#{extension}" | ||
end | ||
|
||
def headers | ||
[ | ||
I18n.t('statistics.all_transfers.date'), | ||
I18n.t('statistics.all_transfers.from'), | ||
I18n.t('statistics.all_transfers.to'), | ||
I18n.t('statistics.all_transfers.post'), | ||
I18n.t('statistics.all_transfers.quantity') | ||
] | ||
end | ||
|
||
def rows | ||
@collection.map do |transfer| | ||
[ | ||
transfer.created_at.to_s, | ||
accounts_from_movements(transfer), | ||
transfer.post.to_s, | ||
seconds_to_hm(transfer.movements.first.amount.abs, 0) | ||
].flatten | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module Report | ||
module Csv | ||
class Transfer < Base | ||
def initialize(org, collection) | ||
self.decorator = Report::TransferDecorator.new(org, collection) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
module Report | ||
module Pdf | ||
class Transfer < Base | ||
def initialize(org, collection) | ||
self.decorator = Report::TransferDecorator.new(org, collection) | ||
end | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
<div class="row"> | ||
<table class="table table-condensed table-bordered table-striped"> | ||
<thead> | ||
<tr> | ||
<th><%= t('statistics.all_transfers.date') %></th> | ||
<th><%= t('statistics.all_transfers.from') %></th> | ||
<th><%= t('statistics.all_transfers.to') %></th> | ||
<th><%= t('statistics.all_transfers.post') %></th> | ||
<th><%= t('statistics.all_transfers.quantity') %></th> | ||
</tr> | ||
</thead> | ||
<tbody> | ||
<% @transfers.each do |transfer| %> | ||
<tr> | ||
<td><%= l(transfer.created_at, format: :long) %></td> | ||
<% accounts_from_movements(transfer).each do |account| %> | ||
<td><%= account %></td> | ||
<% end %> | ||
<td><%= transfer.post %></td> | ||
<td><%= seconds_to_hm(transfer.movements.first.amount.abs) %></td> | ||
</tr> | ||
<% end %> | ||
</tbody> | ||
</table> | ||
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...ecorators/member_report_decorator_spec.rb → ...ecorators/report/member_decorator_spec.rb
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.