update order queue , sale void

This commit is contained in:
Aung Myo
2017-06-15 16:24:00 +06:30
parent f83d11e379
commit f0d3f30d88
8 changed files with 50 additions and 40 deletions

View File

@@ -20,9 +20,9 @@
<td colspan="8">
<%= form_tag transactions_sales_path, :method => :get do %>
<div class="input-append form-group pull-right col-md-6">
<!-- <input class="datepicker col-md-3 form-control" name="date" id="date" type="text" placeholder="Receipt date" style="margin-right: 10px"> -->
<input class="datepicker col-md-3 form-control" name="date" id="date" type="text" placeholder="Receipt date" style="margin-right: 10px">
<input type="text" name="receipt_no" class="col-md-6 form-control" placeholder="Receipt No" style="margin-right: 10px">
<input type="text" name="receipt_no" class="col-md-5 form-control" placeholder="Receipt No" style="margin-right: 10px">
<button type="submit" class="btn btn-primary btn">Search</button>
</div>
<% end %>
@@ -41,23 +41,28 @@
</thead>
<tbody>
<% @sales.each do |sale| %>
<tr>
<td><%= sale.sale_id %></td>
<td><%= sale.receipt_no %></td>
<td><%= sale.grand_total rescue '-' %></td>
<td><%= sale.total_tax %></td>
<td><%= sale.cashier_name rescue '-' %></td>
<td> <%= sale.sale_status %> </td>
<td> <%= sale.receipt_date.strftime("%d-%m-%Y") %> </td>
<td><%= link_to 'Show', transactions_sale_path(sale) %></td>
</tr>
<% if @sales != 0 %>
<% @sales.each do |sale| %>
<tr>
<td><%= sale.sale_id %></td>
<td><%= sale.receipt_no %></td>
<td><%= sale.grand_total rescue '-' %></td>
<td><%= sale.total_tax %></td>
<td><%= sale.cashier_name rescue '-' %></td>
<td> <%= sale.sale_status %> </td>
<td> <%= sale.receipt_date.strftime("%d-%m-%Y") %> </td>
<td><%= link_to 'Show', transactions_sale_path(sale) %></td>
</tr>
<% end %>
<% else %>
<tr><td colspan="8"><strong><p style="text-align: center">There is no data for search....</p></strong></td></tr>
<% end %>
</tbody>
</table>
<br>
<%= paginate @sales %>
<% if @sales != 0 %>
<%= paginate @sales %>
<% end %>
</div>
</div>

View File

@@ -171,11 +171,11 @@
</a>
<!-- Temporary No Needs -->
<!-- <a href="<%= transactions_void_path(@sale)%>" style="margin-top: 10px " class="btn btn-primary pull-right btn-lg">
<a href="<%= transactions_void_path(@sale)%>" style="margin-top: 10px " class="btn btn-danger pull-right btn-lg">
<i class="fa fa-trash fa-lg"></i> Void Sale
</a>
<a href="<%= %>" style="margin-top: 10px " class="btn btn-primary pull-right btn-lg">
<!-- <a href="<%= %>" style="margin-top: 10px " class="btn btn-success pull-right btn-lg">
<i class="fa fa-invoice fa-lg"></i> Complete Sale
</a> -->
</div>

View File

@@ -61,18 +61,16 @@
var reason = $('input[type="radio"]:checked').val();
console.log(reason)
var url = '<% transactions_manual_void_sale_path()%>';
var url = 'manual_void_sale';alert(url)
var sale_id = $(this).find(".customer-id").text();
$.ajax({
type: 'POST',
url: 'sales/manual_void_sale',
url: 'manual_void_sale',
data: {reason: reason, sale_id: sale_id},
success: function(data){
window.location.href = "transactions/sales"
// window.location.href = "transactions/sales"
}
});
});
});