updated for api bill controller
This commit is contained in:
2
app/views/origami/cash_mgmt/create.html.erb
Normal file
2
app/views/origami/cash_mgmt/create.html.erb
Normal file
@@ -0,0 +1,2 @@
|
||||
<h1>CashMgmt#create</h1>
|
||||
<p>Find me in app/views/cash_mgmt/create.html.erb</p>
|
||||
2
app/views/origami/cash_mgmt/index.html.erb
Normal file
2
app/views/origami/cash_mgmt/index.html.erb
Normal file
@@ -0,0 +1,2 @@
|
||||
<h1>CashMgmt#index</h1>
|
||||
<p>Find me in app/views/cash_mgmt/index.html.erb</p>
|
||||
2
app/views/origami/cash_mgmt/new.html.erb
Normal file
2
app/views/origami/cash_mgmt/new.html.erb
Normal file
@@ -0,0 +1,2 @@
|
||||
<h1>CashMgmt#new</h1>
|
||||
<p>Find me in app/views/cash_mgmt/new.html.erb</p>
|
||||
@@ -27,6 +27,7 @@
|
||||
<div class="card sales red text-white" data-id = "<%= sale.sale_id %>">
|
||||
<div class="card-block">
|
||||
<%= sale.receipt_no %>
|
||||
<span style="font-size:12px;float:right;line-height:inherit;"><%= sale.sale_status %></span>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
<div class="card sales red text-white" data-id = "<%= sale.sale_id %>">
|
||||
<div class="card-block">
|
||||
<%= sale.receipt_no %>
|
||||
<span style="font-size:12px;float:right;line-height:inherit;"><%= sale.sale_status %></span>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -289,7 +290,7 @@
|
||||
<button type="button" class="btn btn-primary btn-block" id='move'>Move</button>
|
||||
<button type="button" id="request_bills" class="btn btn-primary btn-block">Req.Bill</button>
|
||||
<button type="button" id="pay" class="btn btn-primary btn-block" disabled>Pay</button>
|
||||
<button type="button" class="btn btn-primary btn-block" disabled=""> Void </button>
|
||||
<button type="button" class="btn btn-primary btn-block" disabled> Void </button>
|
||||
<% else %>
|
||||
<button type="button" class="btn btn-primary btn-block" disabled>Add Order</button>
|
||||
<button type="button" class="btn btn-primary btn-block" id='edit'>Edit</button>
|
||||
@@ -490,9 +491,9 @@ $('#edit').on('click',function(){
|
||||
})
|
||||
} else {
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
</script>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<% @complete.each do |sale| %>
|
||||
<div class="card sales red text-white" data-id = "<%= sale.sale_id %>">
|
||||
<div class="card-block">
|
||||
<%= sale.receipt_no %>
|
||||
<%= sale.receipt_no %><span style="font-size:12px;float:right;line-height:inherit;"><%= sale.sale_status %></span>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Table No</strong> <% if @sale_data%>- <%=@sale_data.receipt_no%><% end %></td>
|
||||
<td><strong>Sale Id</strong> </span><span id="sale_id"><% if @sale_data %><%=@sale_data.sale_id %><% end %></td>
|
||||
<td><strong>Sale Id</strong> <span id="sale_id"><% if @sale_data %><%=@sale_data.sale_id %><% end %></span></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>Customer :</strong> <%= @sale_data.customer.name%></td>
|
||||
@@ -244,7 +244,7 @@
|
||||
|
||||
<button type="button" class="btn btn-primary btn-block" onclick="localStorage.removeItem('cash');window.location.href = '/origami';"> Back </button>
|
||||
<button type="button" class="btn btn-primary btn-block"> FOC </button>
|
||||
<button type="button" class="btn btn-primary btn-block"> Void </button>
|
||||
<button type="button" class="btn btn-primary btn-block" id="void"> Void </button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -354,6 +354,23 @@ $( document ).ready(function() {
|
||||
}
|
||||
});
|
||||
|
||||
$('#void').on('click',function () {
|
||||
var sure = confirm("Are you sure want to Void");
|
||||
if (sure == true) {
|
||||
var sale_id = $('#sale_id').text();
|
||||
var ajax_url = "/origami/sale/" + sale_id + '/void';
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: ajax_url,
|
||||
success: function () {
|
||||
window.location.href = '/origami/';
|
||||
}
|
||||
})
|
||||
} else {
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
function update_balance(){
|
||||
@@ -369,4 +386,5 @@ function update_balance(){
|
||||
var result = amount_due - total;
|
||||
$('#balance').text(result.toFixed(2));
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<% @complete.each do |sale| %>
|
||||
<div class="card sales red text-white" data-id = "<%= sale.sale_id %>">
|
||||
<div class="card-block">
|
||||
<%= sale.receipt_no %>
|
||||
<%= sale.receipt_no %><span style="font-size:12px;float:right;line-height:inherit;"><%= sale.sale_status %></span>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
@@ -26,7 +26,7 @@
|
||||
<% @complete.each do |sale| %>
|
||||
<div class="card sales red text-white" data-id = "<%= sale.sale_id %>">
|
||||
<div class="card-block">
|
||||
<%= sale.receipt_no %>
|
||||
<%= sale.receipt_no %><span style="font-size:12px;float:right;line-height:inherit;"><%= sale.sale_status %></span>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
@@ -185,7 +185,9 @@
|
||||
<!-- Column Three -->
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<button type="button" class="btn btn-primary btn-block" id='back'>Back</button>
|
||||
<button type="button" id="void" class="btn btn-primary btn-block">VOID</button>
|
||||
<% if @sale.sale_status != 'void' %>
|
||||
<button type="button" id="void" class="btn btn-primary btn-block">VOID</button>
|
||||
<% end %>
|
||||
<button type="button" id="re-print" class="btn btn-primary btn-block">Re.Print</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
1
app/views/origami/shifts/create.json.jbuilder
Normal file
1
app/views/origami/shifts/create.json.jbuilder
Normal file
@@ -0,0 +1 @@
|
||||
json.status true
|
||||
2
app/views/origami/shifts/edit.html.erb
Normal file
2
app/views/origami/shifts/edit.html.erb
Normal file
@@ -0,0 +1,2 @@
|
||||
<h1>Origami::Shifts#edit</h1>
|
||||
<p>Find me in app/views/origami/shifts/edit.html.erb</p>
|
||||
2
app/views/origami/shifts/index.html.erb
Normal file
2
app/views/origami/shifts/index.html.erb
Normal file
@@ -0,0 +1,2 @@
|
||||
<h1>Origami::Shifts#index</h1>
|
||||
<p>Find me in app/views/origami/shifts/index.html.erb</p>
|
||||
46
app/views/origami/shifts/new.html.erb
Normal file
46
app/views/origami/shifts/new.html.erb
Normal file
@@ -0,0 +1,46 @@
|
||||
<h1>Open Cashier</h1>
|
||||
<br>
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<table class='table table-striped'>
|
||||
<% @float.each do |float| %>
|
||||
<tr>
|
||||
<th><%= float.name %></th>
|
||||
<th><input class='float-value' type='text' data-value ="<%= float.value %>" value='' /></th>
|
||||
</tr>
|
||||
<% end %>
|
||||
<tr>
|
||||
<th>Total</th>
|
||||
<th><div id='total'></div></th>
|
||||
</tr>
|
||||
</table>
|
||||
<div class="row">
|
||||
<div class='col-md-4'></div>
|
||||
<div class='col-md-2'>
|
||||
<button class='btn btn-primary' id='open_cashier'>Open Cashier</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var total = 0
|
||||
$(document).on('focusout', '.float-value', function(event){
|
||||
var input_type = $(this).attr("data-value");
|
||||
var count = $(this).val();
|
||||
total += input_type * count
|
||||
$('#total').text(total)
|
||||
|
||||
})
|
||||
$('#open_cashier').on('click',function(){
|
||||
var amount = $('#total').text();
|
||||
$.ajax({type: "POST",
|
||||
url: "<%= origami_shifts_path %>",
|
||||
data: "opening_balance=" + amount,
|
||||
success:function(result){
|
||||
if(result){
|
||||
window.location.href = '/origami';
|
||||
}
|
||||
}
|
||||
});
|
||||
})
|
||||
</script>
|
||||
2
app/views/origami/shifts/show.html.erb
Normal file
2
app/views/origami/shifts/show.html.erb
Normal file
@@ -0,0 +1,2 @@
|
||||
<h1>Origami::Shifts#show</h1>
|
||||
<p>Find me in app/views/origami/shifts/show.html.erb</p>
|
||||
@@ -128,6 +128,7 @@
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<button type="button" class="btn btn-primary btn-block" id='back'>Back</button>
|
||||
<button type="button" id="pay" class="btn btn-primary btn-block">Pay</button>
|
||||
<button type="button" id="void" class="btn btn-primary btn-block"> Void </button>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
@@ -143,5 +144,21 @@ $('#pay').on('click',function() {
|
||||
});
|
||||
$('#back').on('click',function(){
|
||||
window.location.href = '/origami/table/<%= @table.id %>';
|
||||
})
|
||||
});
|
||||
$('#void').on('click',function () {
|
||||
var sure = confirm("Are you sure want to Void");
|
||||
if (sure == true) {
|
||||
var sale_id = $('#sale_id').val();
|
||||
var ajax_url = "/origami/sale/" + sale_id + '/void';
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: ajax_url,
|
||||
success: function () {
|
||||
window.location.href = '/origami/';
|
||||
}
|
||||
})
|
||||
} else {
|
||||
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
Reference in New Issue
Block a user