budget/app/views/credit_card_bills/_credit_card_bill.html.erb

49 lines
1.9 KiB
Text
Raw Permalink Normal View History

2023-03-03 18:12:59 -05:00
<div id="<%= dom_id credit_card_bill %>">
2023-02-24 19:08:12 -05:00
<p class="my-5">
<strong class="block font-medium mb-1">Description:</strong>
2023-03-03 18:12:59 -05:00
<%= credit_card_bill.description %>
2023-02-24 19:08:12 -05:00
</p>
<p class="my-5">
<strong class="block font-medium mb-1">Amount:</strong>
2023-03-03 18:12:59 -05:00
<%= credit_card_bill.amount %>
2023-02-24 19:08:12 -05:00
</p>
<p class="my-5">
<strong class="block font-medium mb-1">Accounted For:</strong>
2023-03-03 18:12:59 -05:00
<%= Expense.credit_card_monthly_total %>
2023-02-24 19:08:12 -05:00
</p>
<p class="my-5">
2023-03-03 18:12:59 -05:00
<strong class="block font-medium mb-1">Unpaid:</strong>
<%= credit_card_bill.unpaid %>
2023-02-24 19:08:12 -05:00
</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>
2023-03-03 18:12:59 -05:00
<td class="text-sm text-gray-900 font-light px-6 py-4 whitespace-nowrap"><%= number_to_currency(member.burden_amount(total_amount: credit_card_bill.unpaid)) %></td>
2023-02-24 19:08:12 -05:00
</tr>
<% end %>
</tbody>
</table>
</p>
<% if action_name != "show" %>
2023-03-03 18:12:59 -05:00
<%= link_to "Show this credit card bill", credit_card_bill, class: "rounded-lg py-3 px-5 bg-gray-100 inline-block font-medium" %>
<%= link_to 'Edit this credit card bill', edit_credit_card_bill_path(credit_card_bill), class: "rounded-lg py-3 ml-2 px-5 bg-gray-100 inline-block font-medium" %>
2023-02-24 19:08:12 -05:00
<hr class="mt-6">
<% end %>
</div>