Skip to content

Commit 5a72dd2

Browse files
[Reimbursements] Link to payout transfer on report page (#9528)
## Summary of the problem It's hard to track down the actual ACH / check sent from a reimbursement ## Describe your changes Admins can now go directly to the ACH / check / PayPal transfer from a reimbursement <img width="659" alt="image" src="https://github.com/user-attachments/assets/aea13573-4c38-451c-a296-637f137772c7" /> --------- Co-authored-by: Sam Poder <[email protected]>
1 parent 4c79bc1 commit 5a72dd2

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

app/views/reimbursement/reports/_conversation.html.erb

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,14 +11,28 @@
1111
<%= render "comments/item", comment: item %>
1212
</div>
1313
<% else %>
14+
<% reimbursed_change_text = capture do %>
15+
<%= error_boundary fallback_text: "initiated a transfer" do %>
16+
<% raw_text = render_money(@report.amount_cents) + " " + @report.transfer_text %>
17+
<% payout_transfer_url = hcb_code_path(@report.payout_holding&.payout_transfer&.local_hcb_code) if @report.payout_holding&.payout_transfer&.local_hcb_code %>
18+
19+
<%= @report.initiated_transfer_text %> a
20+
<% if payout_transfer_url && policy(@report.payout_holding&.payout_transfer&.local_hcb_code).show? %>
21+
<%= link_to raw_text, payout_transfer_url, target: :_blank %>
22+
<% else %>
23+
<%= raw_text %>
24+
<% end %>
25+
to <%= @report.user.name %>
26+
<% end %>
27+
<% end %>
1428
<% changes = {
1529
"submitted" => ["send", "info", "submitted this report"],
1630
"rejected" => ["thumbsdown", "error", "rejected this report"],
1731
"reimbursement_requested" => ["thumbsup", "success", "approved on behalf of #{Event.find_by_id(item.object&.[]("event_id") || @report.event_id)&.name}"],
1832
"reimbursement_approved" => ["admin", "warning", "approved this report on behalf of the HCB team"],
1933
"draft" => ["docs", "muted", "converted this report to a draft"],
2034
"draft_created" => ["plus", "success", "created this draft report"],
21-
"reimbursed" => ["payment-transfer", "purple", "#{@report.initiated_transfer_text} a #{render_money @report.amount_cents} #{@report.transfer_text} to #{@report.user.name}"],
35+
"reimbursed" => ["payment-transfer", "purple", reimbursed_change_text],
2236
"reversed" => ["sad", "warning", "cancelled this reimbursement"],
2337
} %>
2438
<% state_change = item.changeset["aasm_state"]&.second %>

0 commit comments

Comments
 (0)