shift sale

This commit is contained in:
Nweni
2017-07-01 09:46:14 +06:30
parent 18094f5a71
commit c589f11758
6 changed files with 29 additions and 17 deletions

View File

@@ -1,12 +1,19 @@
<h1>Open Cashier</h1>
<br>
<div class="row">
<div class="col-md-12">
</div>
</div>
<div class="row">
<div class="col-md-4">
<table class='table table-striped'>
<tr>
<th>Cashier Terminal</th>
<th>
<select class='form-control' id='cashier_terminal'>
<% @terminal.each do |ter| %>
<option value="<%= ter.id %>"><%= ter.name %></option>
<% end %>
</select>
</th>
</tr>
<% @float.each do |float| %>
<tr>
<th><%= float.name %></th>
@@ -69,10 +76,12 @@ $(document).on('focusout', '.float-value', function(event){
})
$('#open_cashier').on('click',function(){
var cashier_terminal = $('#cashier_terminal').val();
alert(cashier_terminal)
var amount = $('#total').text();
$.ajax({type: "POST",
url: "<%= origami_shifts_path %>",
data: "opening_balance=" + amount,
data: "opening_balance=" + amount + "&cashier_terminal="+ cashier_terminal,
success:function(result){
if(result){
window.location.href = '/origami';