|
11 | 11 | <%= render "comments/item", comment: item %> |
12 | 12 | </div> |
13 | 13 | <% 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 %> |
14 | 28 | <% changes = { |
15 | 29 | "submitted" => ["send", "info", "submitted this report"], |
16 | 30 | "rejected" => ["thumbsdown", "error", "rejected this report"], |
17 | 31 | "reimbursement_requested" => ["thumbsup", "success", "approved on behalf of #{Event.find_by_id(item.object&.[]("event_id") || @report.event_id)&.name}"], |
18 | 32 | "reimbursement_approved" => ["admin", "warning", "approved this report on behalf of the HCB team"], |
19 | 33 | "draft" => ["docs", "muted", "converted this report to a draft"], |
20 | 34 | "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], |
22 | 36 | "reversed" => ["sad", "warning", "cancelled this reimbursement"], |
23 | 37 | } %> |
24 | 38 | <% state_change = item.changeset["aasm_state"]&.second %> |
|
0 commit comments