budget/app/views/extra_bills/_extra_bill.html.erb

53 lines
2 KiB
Text

<div id="<%= dom_id extra_bill %>">
<p class="my-5">
<strong class="block font-medium mb-1">Description:</strong>
<%= extra_bill.description %>
</p>
<p class="my-5">
<strong class="block font-medium mb-1">Amount:</strong>
<%= extra_bill.amount %>
</p>
<p class="my-5">
<strong class="block font-medium mb-1">Adjusted Amount:</strong>
<%= extra_bill.adjusted_amount %>
</p>
<p class="my-5">
<strong class="block font-medium mb-1">Accounted For:</strong>
<%= Expense.autopaid_total %>
</p>
<p class="my-5">
<strong class="block font-medium mb-1">Deduct autopaid:</strong>
<%= extra_bill.deduct_autopaid %>
</p>
<p class="my-5">
<table class="min-w-full mb-8">
<thead class="border-b">
<tr>
<th scope="col" class="text-sm font-medium text-gray-900 px-6 py-4 text-left">Member</th>
<th scope="col" class="text-sm font-medium text-gray-900 px-6 py-4 text-left">Burden Percent</th>
<th scope="col" class="text-sm font-medium text-gray-900 px-6 py-4 text-left">Burden Amount</th>
</tr>
</thead>
<tbody>
<% Member.all.each do |member| %>
<tr class="even:bg-gray-50 border-b">
<td class="text-sm text-gray-900 font-light px-6 py-4 whitespace-nowrap"><%= member.name %></td>
<td class="text-sm text-gray-900 font-light px-6 py-4 whitespace-nowrap"><%= member.burden_percent * 100 %>%</td>
<td class="text-sm text-gray-900 font-light px-6 py-4 whitespace-nowrap"><%= number_to_currency(member.burden_amount(total_amount: extra_bill.adjusted_amount)) %></td>
</tr>
<% end %>
</tbody>
</table>
</p>
<% if action_name != "show" %>
<%= link_to "Show this extra bill", extra_bill, class: "rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %>
<%= link_to 'Edit this extra bill', edit_extra_bill_path(extra_bill), class: "rounded-lg py-3 ml-2 px-5 bg-gray-100 inline-block font-medium" %>
<hr class="mt-6">
<% end %>
</div>