Skip to content

Commit

Permalink
Merge pull request #1052 from sul-dlss/group-fines-payments
Browse files Browse the repository at this point in the history
Remove fee/fine conditions for proxy groups that do not apply in FOLIO
  • Loading branch information
jcoyne authored Feb 14, 2024
2 parents 85ecdb7 + 3455dfd commit 713be9a
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 74 deletions.
4 changes: 3 additions & 1 deletion app/models/folio/group.rb
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,10 @@ def checkouts
sponsor.group_checkouts || []
end

# NOTE: Fines on items borrowed by a proxy/group are associated
# with the sponsor's individual account.
def fines
sponsor.group_fines
[]
end

def requests
Expand Down
10 changes: 0 additions & 10 deletions app/models/folio/patron.rb
Original file line number Diff line number Diff line change
Expand Up @@ -126,16 +126,6 @@ def payments
all_accounts.select(&:closed?)
end

# TODO: delete after FOLIO launch. All group fines are now affiliated with a single Sponsor patron.
def group_fines
[]
end

# TODO: delete after FOLIO launch. All group payments are now affiliated with a single Sponsor patron.
def group_payments
[]
end

def proxy_borrower?
user_info['proxiesFor']&.any?
end
Expand Down
59 changes: 19 additions & 40 deletions app/views/fines/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -9,49 +9,28 @@
<h2>Payable: <%= number_to_currency(@fines.sum(&:owed)) %></h2>

<% if @fines.any? %>
<%# TODO: after FOLIO launch remove this condition %>
<% if params[:group] && patron.sponsor? %>
<div class="pb-3">
Fines can be paid in My Library Account only by the borrower who accrued them. <br />
To pay proxy fines using iJournal,
<%= link_to contact_path, data: { 'mylibrary-modal' => 'trigger' } do %>
contact Circulation & Privileges.
contact Circulation & Privileges.
<% end %>
</div>
<%# The user is a Proxy; the fine is not shown and must be paid in the Sponsor account %>
<% elsif params[:group] %>
<div class="pb-3">
<%= sul_icon :'sharp-error-24px', classes: 'text-recalled' %> The research group has unpaid fines that may affect
the status of all proxies.
</div>
<%# The user has fines on their personal account and can pay here %>
<% else %>
<div class="mb-3">
<%= render 'fines/shared_computer_alert' %>
<%= render 'fines/pay_all_button' %>
</div>
<% end %>

<% unless params[:group] && !patron.sponsor? %>
<div class="d-none d-md-flex row font-weight-bold list-header">
<div class="row col-md-4">
<div class="col-md-12 col-lg-6">Reason</div>
<div class="col-md-12 col-lg-6">Amount</div>
<div class="mb-3">
<%= render 'fines/shared_computer_alert' %>
<%= render 'fines/pay_all_button' %>
</div>
<div class="col-md-5">Title</div>
<div class="row col-md-3">
<div class="col-md-12 col-lg-6">Author</div>
<div class="col-md-12 col-lg-6 call_number">Call number</div>

<div class="d-none d-md-flex row font-weight-bold list-header">
<div class="row col-md-4">
<div class="col-md-12 col-lg-6">Reason</div>
<div class="col-md-12 col-lg-6">Amount</div>
</div>
<div class="col-md-5">Title</div>
<div class="row col-md-3">
<div class="col-md-12 col-lg-6">Author</div>
<div class="col-md-12 col-lg-6 call_number">Call number</div>
</div>
</div>
</div>
<ul class="fines list-group">
<%= render @fines %>
</ul>
<ul class="fines list-group">
<%= render @fines %>
</ul>
<% end %>
<% end %>
<%# TODO: after FOLIO launch remove the Folio::Patron part of this condition %>
<% if patron.is_a?(Folio::Patron) && params[:group] && patron.sponsor? %>

<% if params[:group] && patron.sponsor? %>
Fines incurred by proxy borrowers appear in the list of fines under their sponsor's Self tab.
<% end %>
</div>
Expand Down
29 changes: 6 additions & 23 deletions app/views/summaries/_summary.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -29,29 +29,12 @@

<div class="page-section">
<h3><%= sul_icon :'sharp-attach_money-24px', classes: 'lg' %> Fines &amp; fees payable: <%= number_to_currency(patron.fines.sum(&:owed)) %></h3>
<%# TODO: after FOLIO launch remove this condition %>
<% if params[:group] && patron.fines.sum(&:owed).positive? %>
<% if patron.sponsor? %>
<div class="ml-4">
Fines can be paid in My Library Account only by the borrower who accrued them. <br />
To pay proxy fines using iJournal,
<%= link_to contact_path, data: { 'mylibrary-modal' => 'trigger' } do %>
contact Circulation & Privileges.
<% end %>
</div>
<% else %>
<div class="ml-4">
<%= sul_icon :'sharp-error-24px', classes: 'text-recalled' %> The research group has unpaid fines that may affect the status of all proxies.
</div>
<% end %>
<% else %>
<div class="mb-1">
<%= render 'fines/shared_computer_alert' %>
<%= render 'fines/pay_all_button' %>
</div>
<% end %>
<%# TODO: after FOLIO launch remove the Folio::Patron part of this condition %>
<% if patron.is_a?(Folio::Patron) && params[:group] && patron.sponsor?%>
<div class="mb-1">
<%= render 'fines/shared_computer_alert' %>
<%= render 'fines/pay_all_button' %>
</div>

<% if params[:group] && patron.sponsor?%>
Fines incurred by proxy borrowers appear in the list of fines under their sponsor's Self tab.
<% end %>

Expand Down

0 comments on commit 713be9a

Please sign in to comment.