Multiple Invoices Phase 1

This commit is contained in:
Phyo
2017-06-26 11:10:49 +06:30
parent 4958cb6872
commit 6e49f91b89
8 changed files with 557 additions and 7 deletions

View File

@@ -126,7 +126,7 @@
<p>Date: <span id="receipt_date"><%= @date.utc.getlocal.strftime("%d/%m/%Y - %I:%M %p") rescue '-'%></span></p>
</div>
</div>
<div class="card-title row">
<div class="col-lg-6 col-md-6 col-sm-6">
<p class="hidden customer-id"><%= @customer.customer_id %></p>
@@ -241,18 +241,18 @@
%>
</table>
<button class='btn btn-primary' id='add_invoice'> Add to existing invoice </button>
<%
end
@sale_array.each do |sale|
<% end %>
<br><br>
Pending Payment
<% @sale_array.each do |sale|
if @sale_array.size > 1
unless sale.receipt_no == @sale_array[0].receipt_no
%>
<br><br>
Pending Payment
<table class="table table-striped">
<tr>
<td>Receipt No - <%= sale.receipt_no %></td>
<td><button class='btn btn-sm btn-primary '>Show Detail </button></td>
<td><button class='btn btn-sm btn-primary invoicedetails' id="<%= sale.sale_id %>">Show Detail </button></td>
</tr>
</table>
<%
@@ -298,6 +298,11 @@
</div>
<script>
$(document).ready(function(){
$('.invoicedetails').on('click',function(){
var dining_id = "<%= @dining.id %>";
var sale_id = this.id;
window.location.href = '/origami/table/'+ dining_id + "/table_invoice/"+sale_id;
})
$(".tables").on('click', function(){
var customer_id=$(".customer-id").text();
@@ -455,4 +460,5 @@ $('#edit').on('click',function(){
window.location.href = '/origami/table/'+ dining_id + "/sale/"+ sale_id + "/edit";
})
</script>