client_management/app/views/client_managements/_purchase_partial.html.erb

53 lines
2.2 KiB
Plaintext
Raw Normal View History

2017-04-10 08:16:47 +00:00
<% @purchases.each do |purchase| %>
<% contract = purchase.request_contract %>
<div class="item-history">
<span class="site-title-history"><a href="" onclick="return false;">Purchase for contract : <%= contract.uid %></a></span>
<div class="info-site">
<span class="url-site"><i class="fa fa-money" aria-hidden="true"></i>Total : <%= purchase.total_amount %> NTD.</span>
<span class="url-site"><i class="fa fa-money" aria-hidden="true"></i>Amount Received : <span style="color:green;"> <%= purchase.total_amount_recieved %></span> NTD.</span>
<span class="time-site"><i class="fa fa-clock-o" aria-hidden="true"></i>Time :&nbsp;&nbsp;<%= purchase.created_at.strftime("%d %B, %Y %H:%M") %></span>
</div>
<% if !purchase.purchase_receipts.blank? %>
<div class="receipt-site">
<% purchase.purchase_receipts.each do |receipt| %>
<div class="item-receipt">
<table class="table-receipt" cellspacing="5">
<tbody>
<tr>
<th>Receipt Number</th>
<th>Total Amount</th>
<th>Amount Received</th>
<th>Amount Pending</th>
<th>Receipt Status</th>
</tr>
<tr>
<td class="number"><%= receipt.receipt_number %></td>
<td class="total"><%= receipt.amount %></td>
<td class="received"><%= receipt.amount_received %></td>
<td class="pending"><%= receipt.amount_pending %></td>
<td class="status">
<% if receipt.is_pending? %>
<span class="pending">Pending</span>
<% else %>
<span class="cleared">Cleared</span>
<% end %>
</td>
</tr>
</tbody>
</table>
</div>
<% end %>
</div>
<% end %>
<% if purchase.cleared? %>
<span class="status-detail pending">Cleared</span>
<% else %>
<span class="status-detail purchased">Pending</span>
<% end %>
<% if !purchase.purchase_receipts.blank? %>
<span class="action-site">
<a href="#" class="btn btn-receipt">Receipts</a>
</span>
<% end %>
</div>
<% end %>