Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant into crm
This commit is contained in:
@@ -1,14 +1,24 @@
|
||||
<style>
|
||||
.pin_pad {
|
||||
width:10rem;
|
||||
height:10rem;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
line-height: 10rem;
|
||||
margin:2px;
|
||||
margin-top:4px;
|
||||
margin-bottom:4px;
|
||||
font-size:3rem;
|
||||
width: 30%;
|
||||
height:70px;
|
||||
line-height:70px;
|
||||
text-align:center;
|
||||
background:#54A5AF;
|
||||
font-size:20px;
|
||||
color:white;
|
||||
}
|
||||
.bottom{
|
||||
margin-bottom: 1px;
|
||||
}
|
||||
.left{
|
||||
margin-left:1px;
|
||||
}
|
||||
.orange{
|
||||
background-color:#FF7F50;
|
||||
}
|
||||
.purple {
|
||||
background-color:#7a62d3;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -23,21 +33,29 @@
|
||||
<%= f.input :password, label: "Access PIN", required: false, class: "form-control" %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content" style="margin:10px; margin-top:0px; text-align:center">
|
||||
<button class="pin_pad" data-value="1">1</button>
|
||||
<button class="pin_pad" data-value="2">2</button>
|
||||
<button class="pin_pad" data-value="3">3</button>
|
||||
<button class="pin_pad" data-value="4">4</button>
|
||||
<button class="pin_pad" data-value="5">5</button>
|
||||
<button class="pin_pad" data-value="6">6</button>
|
||||
<button class="pin_pad" data-value="7">7</button>
|
||||
<button class="pin_pad" data-value="8">8</button>
|
||||
<button class="pin_pad" data-value="9">9</button>
|
||||
<button class="pin_pad" data-value="CLR">CLR</button>
|
||||
<button class="pin_pad" data-value="8">0</button>
|
||||
<button class="pin_pad btn-warning" data-value="ENT">ENT</button>
|
||||
|
||||
<div class="content row" style="padding-left:10px;margin-left:10px; margin-top:0px; text-align:center">
|
||||
<div class='col-md-12'>
|
||||
<div class='row bottom'>
|
||||
<div class="pin_pad " data-value="1">1</div>
|
||||
<div class="pin_pad left" data-value="2">2</div>
|
||||
<div class="pin_pad left" data-value="3">3</div>
|
||||
</div>
|
||||
<div class='row bottom'>
|
||||
<div class="pin_pad" data-value="4">4</div>
|
||||
<div class="pin_pad left" data-value="5">5</div>
|
||||
<div class="pin_pad left" data-value="6">6</div>
|
||||
</div>
|
||||
<div class='row bottom'>
|
||||
<div class="pin_pad" data-value="7">7</div>
|
||||
<div class="pin_pad left" data-value="8">8</div>
|
||||
<div class="pin_pad left" data-value="9">9</div>
|
||||
</div>
|
||||
<div class='row bottom'>
|
||||
<div class="pin_pad orange" data-value="CLR">CLR</div>
|
||||
<div class="pin_pad left" data-value="8">0</div>
|
||||
<div class="pin_pad left purple" data-value="ENT">ENT</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer text-center" style="margin:10px">
|
||||
|
||||
</div>
|
||||
|
||||
79
app/views/origami/cash_ins/new.html.erb
Normal file
79
app/views/origami/cash_ins/new.html.erb
Normal file
@@ -0,0 +1,79 @@
|
||||
|
||||
<div class='row'>
|
||||
<div class="col-lg-11 col-md-11 col-sm-11">
|
||||
<h2> Payment Credit </h2>
|
||||
<br>
|
||||
<table class='table table-striped'>
|
||||
<tr>
|
||||
<td> Payment Reference
|
||||
</td>
|
||||
<td><input type='text' id='reference'/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> Remark
|
||||
</td>
|
||||
<td><input type="text" id='remark'/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> Payment Method
|
||||
</td>
|
||||
<td>
|
||||
<button class='btn btn-primary payment-type' data-id='cash' id='cash'>CASH</button>
|
||||
<button class='btn btn-primary payment-type' data-id='mpu' id='mpu'>MPU</button>
|
||||
<button class='btn btn-primary payment-type' data-id='visa' id='visa'>VISA</button>
|
||||
<button class='btn btn-primary payment-type' data-id='jcb' id='jcb'>JCB</button>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
<div class='row'>
|
||||
<div class='col-md-2'></div>
|
||||
<div class='col-md-2'>Reference Number </div>
|
||||
<div class='col-md-4'><input type='text' id='payment_method_reference'/> </div>
|
||||
</div>
|
||||
<br>
|
||||
<div class='row'>
|
||||
<div class='col-md-2'></div>
|
||||
<div class='col-md-2'>Amount</div>
|
||||
<div class='col-md-4'><input type='text' id='amount'/></div>
|
||||
</div>
|
||||
<br><br>
|
||||
<div class='row'>
|
||||
<div class='col-md-3'></div>
|
||||
<div class='col-md-4'><button class='btn btn-primary btn-lg' id='cash_in' style='width:200px;'> Cash In</button></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<button class='btn btn-primary ' id='cash_in' style='width:100px;'> Back </button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var payment_method = "";
|
||||
$('.payment-type').on('click',function(){
|
||||
$('.payment-type').css("background-color","#7a62d3")
|
||||
$(this).css("background-color","green");
|
||||
var type = $(this).attr('data-id')
|
||||
if(type == 'cash'){
|
||||
payment_method = 'cash';
|
||||
}else if(type == 'mpu'){
|
||||
payment_method = "mpu";
|
||||
}else if(type == 'visa'){
|
||||
payment_method = "visa";
|
||||
}else if(type == 'jcb'){
|
||||
payment_method = "jcb";
|
||||
}
|
||||
})
|
||||
$('#cash_in').on('click',function(){
|
||||
var reference = $('#reference').val();
|
||||
var remark = $('#remark').val();
|
||||
var amount = $('#amount').val();
|
||||
var payment_method_reference = $('#payment_method_reference').val();
|
||||
$.ajax({type: "POST",
|
||||
url: "<%= origami_cash_ins_path %>",
|
||||
data: "reference="+ reference + "&remark=" + remark + "&amount="+ amount + "&payment_method="+payment_method + "&payment_method_reference="+ payment_method_reference,
|
||||
success:function(result){
|
||||
window.location.href = '/origami';
|
||||
}
|
||||
});
|
||||
})
|
||||
</script>
|
||||
44
app/views/origami/cash_outs/new.html.erb
Normal file
44
app/views/origami/cash_outs/new.html.erb
Normal file
@@ -0,0 +1,44 @@
|
||||
<h2>Payment Debit</h2>
|
||||
<div class='row'>
|
||||
<div class='col-md-9'>
|
||||
<table class='table table-striped'>
|
||||
<tr>
|
||||
<td> Payment Reference
|
||||
</td>
|
||||
<td><input id='reference' type='text' value=''/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> Remark
|
||||
</td>
|
||||
<td><input id='remark' type="text" value=''/></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td> Amount
|
||||
</td>
|
||||
<td><input id='amount' type="text" value=''/></td>
|
||||
</tr>
|
||||
</table>
|
||||
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<br><br>
|
||||
<div class='row'>
|
||||
<div class='col-md-3'></div>
|
||||
<div class='col-md-4'><button class='btn btn-primary btn-lg' id='cash_out'> Cash Out</button></div>
|
||||
</div>
|
||||
<script>
|
||||
|
||||
$('#cash_out').on('click',function(){
|
||||
var reference = $('#reference').val();
|
||||
var remark = $('#remark').val();
|
||||
var amount = $('#amount').val();
|
||||
$.ajax({type: "POST",
|
||||
url: "<%= origami_cash_outs_path %>",
|
||||
data: "reference="+ reference + "&remark=" + remark + "&amount="+ amount,
|
||||
success:function(result){
|
||||
window.location.href = '/origami';
|
||||
}
|
||||
});
|
||||
})
|
||||
</script>
|
||||
@@ -1,6 +1,6 @@
|
||||
<div class="row">
|
||||
<!-- Column One -->
|
||||
<div class="col-lg-11 col-md-11 col-sm-11">
|
||||
<div class="col-lg-10 col-md-10 col-sm-10">
|
||||
|
||||
<!-- Nav tabs -->
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
@@ -103,8 +103,11 @@
|
||||
</div>
|
||||
<!-- tabs - End -->
|
||||
</div>
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<button id="refreshbutton" type="button" class="btn btn-block" style="border-radius:5px;color:#fff;background-color:red;"> Refresh off </button>
|
||||
<button id="cash_in" type="button" class="btn btn-block btn-primary" style="border-radius:5px;color:#fff;"> Cash In </button>
|
||||
<button id="cash_out" type="button" class="btn btn-block btn-primary" style="border-radius:5px;color:#fff;"> Cash Out </button>
|
||||
<button id="close_cashier" type="button" class="btn btn-block btn-primary" style="border-radius:5px;color:#fff;"> Close Cashier </button>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Column One -->
|
||||
@@ -193,4 +196,16 @@ $(function() {
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
$('#cash_in').on('click',function(){
|
||||
window.location.href = '/origami/cash_ins/new';
|
||||
})
|
||||
|
||||
$('#cash_out').on('click',function(){
|
||||
window.location.href = '/origami/cash_outs/new';
|
||||
})
|
||||
|
||||
$('#close_cashier').on('click',function(){
|
||||
window.location.href = '/origami/shift/close';
|
||||
})
|
||||
</script>
|
||||
|
||||
@@ -3,9 +3,11 @@
|
||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||
|
||||
<!-- Nav tabs -->
|
||||
<ul class="nav nav-tabs" role="tablist" id="mytab">
|
||||
|
||||
<ul class="nav nav-tabs" role="tablist">
|
||||
<li class="nav-item">
|
||||
<a class="nav-link" data-toggle="tab" href="#completed" role="tab">Completed</a>
|
||||
<a class="nav-link" data-toggle="tab" href="#Completed" role="tab">Completed</a>
|
||||
|
||||
</li>
|
||||
<li class="nav-item">
|
||||
<a class="nav-link active" data-toggle="tab" href="#tables" role="tab">Tables</a>
|
||||
@@ -21,6 +23,7 @@
|
||||
|
||||
<div class="tab-content" style="max-height:670px; overflow:auto">
|
||||
<!--- Panel 0 - Completed Orders -->
|
||||
|
||||
<div class="tab-pane" id="completed" role="tabpanel">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<% @complete.each do |sale| %>
|
||||
@@ -39,6 +42,7 @@
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<% @tables.each do |table| %>
|
||||
<% if table.status == 'occupied' %>
|
||||
|
||||
<% if table.get_booking.nil? %>
|
||||
<div class="card tables red text-white" data-id="<%= table.id %>">
|
||||
<div class="card-block">
|
||||
@@ -71,6 +75,7 @@
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
<% @rooms.each do |room| %>
|
||||
<% if room.status == 'occupied' %>
|
||||
|
||||
<div class="card rooms red text-white" data-id="<%= room.id %>">
|
||||
<div class="card-block">
|
||||
<%= room.name %>
|
||||
@@ -95,6 +100,7 @@
|
||||
<!--- Panel 3 - Orders -->
|
||||
<div class="tab-pane" id="orders" role="tabpanel">
|
||||
<div class="card-columns" style="padding-top:10px; column-gap: 1.2rem;">
|
||||
|
||||
<% @orders.each do |order| %>
|
||||
<div class="card orders red text-white" data-id = "<%= order.order_id %>">
|
||||
<div class="card-block">
|
||||
@@ -104,7 +110,6 @@
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<!-- tabs - End -->
|
||||
</div>
|
||||
@@ -114,6 +119,7 @@
|
||||
<div class="col-lg-5 col-md-5 col-sm-5">
|
||||
<div class="card" >
|
||||
<div class="card-header">
|
||||
|
||||
<% if @status_order == 'order' && @status_sale != 'sale' %>
|
||||
<div id="save_order_id" data-order="<%= @obj_order.order_id %>"><strong id="order-title">ORDER DETAILS </strong> | Table <%= @dining.name rescue "" %></div>
|
||||
<% elsif @status_sale == 'sale' %>
|
||||
@@ -124,12 +130,14 @@
|
||||
<div class="card-title row">
|
||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||
<p> Receipt No: <span id="receipt_no">
|
||||
|
||||
<% if @status_sale == 'sale' %>
|
||||
<%= @sale_array[0].receipt_no rescue '' %>
|
||||
<% end %>
|
||||
</span></p>
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-6 col-sm-6 text-right">
|
||||
|
||||
<p>Date: <span id="receipt_date"><%= @date.utc.getlocal.strftime("%d/%m/%Y - %I:%M %p") rescue '-'%></span></p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -146,6 +154,7 @@
|
||||
<table class="table table-striped" id="order-items-table">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
<th>#</th>
|
||||
<th class="item-name">Items</th>
|
||||
<th class="item-attr">QTY</td>
|
||||
@@ -154,6 +163,7 @@
|
||||
</thead>
|
||||
<tbody>
|
||||
<%
|
||||
|
||||
count = 0
|
||||
sub_total = 0
|
||||
if @status_sale == "sale"
|
||||
@@ -173,6 +183,7 @@
|
||||
<td class='item-attr'><%= sale_item.price %></td>
|
||||
</tr>
|
||||
<%
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -192,6 +203,7 @@
|
||||
<td class='item-attr'><%= order_item.qty*order_item.price %></td>
|
||||
</tr>
|
||||
<%
|
||||
|
||||
end
|
||||
end
|
||||
end
|
||||
@@ -208,6 +220,7 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="charges-name"><strong>Discount:</strong></td>
|
||||
|
||||
<td class="item-attr"><strong id="order-discount">(<%= @obj_sale.total_discount rescue 0%>)</strong></td>
|
||||
</tr>
|
||||
<% if @status_sale == "sale" %>
|
||||
@@ -215,6 +228,10 @@
|
||||
<td class="charges-name"><strong>Tax:</strong></td>
|
||||
<td class="item-attr"><strong id="order-Tax"><%= @obj_sale.total_tax rescue 0%></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="charges-name"><strong>Rounding Adj:</strong></td>
|
||||
<td class="item-attr"><strong id="order-round-adj"><%= @obj_sale.rounding_adjustment rescue 0%></strong></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td class="charges-name"><strong>Grand Total:</strong></td>
|
||||
<td class="item-attr"><strong id="order-grand-total"><%= @obj_sale.grand_total rescue 0%></strong></td>
|
||||
@@ -271,7 +288,6 @@
|
||||
end
|
||||
end
|
||||
%>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -279,6 +295,7 @@
|
||||
<!-- Column Three -->
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<!-- Waiter Buttons -->
|
||||
|
||||
<button type="button" class="btn btn-primary btn-block" id='back' >Back</button>
|
||||
<% if @dining.bookings.length >= 1 %>
|
||||
<button type="button" id="customer" class="btn btn-primary btn-block" >Customer</button>
|
||||
@@ -289,6 +306,7 @@
|
||||
<button type="button" id="discount" class="btn btn-primary btn-block" disabled >Discount</button>
|
||||
<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="first_bill" class="btn btn-primary btn-block" disabled>First 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>
|
||||
<% else %>
|
||||
@@ -297,6 +315,7 @@
|
||||
<button type="button" id="discount" class="btn btn-primary btn-block" >Discount</button>
|
||||
<button type="button" class="btn btn-primary btn-block" id='move' disabled="">Move</button>
|
||||
<button type="button" id="request_bills" class="btn btn-primary btn-block" disabled> Req.Bill</button>
|
||||
<button type="button" id="first_bill" class="btn btn-primary btn-block">First Bill</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>
|
||||
<% end %>
|
||||
@@ -308,6 +327,7 @@
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
|
||||
$('.invoicedetails').on('click',function(){
|
||||
var dining_id = "<%= @dining.id %>";
|
||||
var sale_id = this.id;
|
||||
@@ -391,7 +411,19 @@ $(document).ready(function(){
|
||||
|
||||
});
|
||||
|
||||
// Print for first bill
|
||||
$("#first_bill").on('click', function(){
|
||||
var sale_id = $('#sale_id').val();
|
||||
var ajax_url = "/origami/sale/"+ sale_id + "/first_bill";
|
||||
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: ajax_url,
|
||||
success:function(result){
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
$('#pay').on('click',function() {
|
||||
var sale_id = $('#sale_id').val();
|
||||
@@ -403,9 +435,9 @@ $('#request_bills').click(function() {
|
||||
var order_id = $('#save_order_id').attr('data-order');
|
||||
var ajax_url = "/origami/" + order_id + "/request_bills";
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
type: "GET",
|
||||
url: ajax_url,
|
||||
data: 'order_id='+ order_id,
|
||||
// data: 'order_id='+ order_id,
|
||||
success:function(result){
|
||||
|
||||
location.reload();
|
||||
@@ -469,31 +501,28 @@ function show_customer_details(customer_id){
|
||||
}
|
||||
});
|
||||
//End Ajax
|
||||
}
|
||||
}
|
||||
|
||||
$('#edit').on('click',function(){
|
||||
var dining_id = "<%= @dining.id %>"
|
||||
var sale_id = "<%= @obj_sale.sale_id rescue "" %>"
|
||||
window.location.href = '/origami/table/'+ dining_id + "/sale/"+ sale_id + "/edit";
|
||||
})
|
||||
|
||||
$('#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 {
|
||||
|
||||
}
|
||||
|
||||
})
|
||||
$('#edit').on('click',function(){
|
||||
var dining_id = "<%= @dining.id %>"
|
||||
var sale_id = "<%= @obj_sale.sale_id rescue "" %>"
|
||||
window.location.href = '/origami/table/'+ dining_id + "/sale/"+ sale_id + "/edit";
|
||||
});
|
||||
|
||||
$('#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>
|
||||
|
||||
@@ -268,61 +268,128 @@
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<!-- Waiter Buttons -->
|
||||
<button type="button" class="btn btn-primary btn-block" id='back' >Back</button>
|
||||
<button type="button" class="btn btn-primary btn-block" disabled>Add Order</button>
|
||||
<button type="button" class="btn btn-primary btn-block" disabled>Edit</button>
|
||||
<button type="button" class="btn btn-primary btn-block" id="move">Move</button>
|
||||
<button type="button" id="customer" class="btn btn-primary btn-block">Customer</button>
|
||||
<button type="button" id="request_bills" class="btn btn-primary btn-block">Req.Bill</button>
|
||||
<% if @dining.bookings.length >= 1 %>
|
||||
<button type="button" id="customer" class="btn btn-primary btn-block" >Customer</button>
|
||||
|
||||
<% if @status_order == 'order' && @status_sale != 'sale' %>
|
||||
<button type="button" class="btn btn-primary btn-block" >Add Order</button>
|
||||
<button type="button" class="btn btn-primary btn-block" disabled >Edit</button>
|
||||
<button type="button" id="discount" class="btn btn-primary btn-block" disabled >Discount</button>
|
||||
<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="first_bill" class="btn btn-primary btn-block" disabled>First 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>
|
||||
<% 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>
|
||||
<button type="button" id="discount" class="btn btn-primary btn-block" >Discount</button>
|
||||
<button type="button" class="btn btn-primary btn-block" id='move' disabled="">Move</button>
|
||||
<button type="button" id="request_bills" class="btn btn-primary btn-block" disabled> Req.Bill</button>
|
||||
<button type="button" id="first_bill" class="btn btn-primary btn-block">First Bill</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>
|
||||
<% end %>
|
||||
<!-- Cashier Buttons -->
|
||||
<button type="button" id="discount" class="btn btn-primary btn-block">Discount</button>
|
||||
<!-- <button type="button" class="btn btn-primary btn-lg btn-block" disabled>Tax</button> -->
|
||||
<button type="button" id="pay" class="btn btn-primary btn-block">Pay</button>
|
||||
<!-- <button type="button" id="re-print" class="btn btn-primary btn-block">Re.Print</button> -->
|
||||
|
||||
<!-- <button type="button" id="re-print" class="btn btn-primary btn-block" >Re.Print</button> -->
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$(document).ready(function(){
|
||||
// $(".tables").on('click', function(){
|
||||
// var customer_id=$(".customer-id").text();
|
||||
// show_customer_details(customer_id);
|
||||
|
||||
// var dining_id = $(this).attr("data-id");
|
||||
// window.location.href = '/origami/table/' + dining_id;
|
||||
// })
|
||||
// $(".sales").on('click',function(){
|
||||
// var customer_id=$(".customer-id").text();
|
||||
// show_customer_details(customer_id);
|
||||
|
||||
// var sale_id = $(this).attr("data-id");
|
||||
// window.location.href = '/origami/sale/' + sale_id;
|
||||
// })
|
||||
// $(".rooms").on('click', function(){
|
||||
// var customer_id=$(".customer-id").text();
|
||||
// show_customer_details(customer_id);
|
||||
|
||||
// var dining_id = $(this).attr("data-id");
|
||||
// window.location.href = '/origami/room/' + dining_id;
|
||||
// })
|
||||
// $(".orders").on('click',function(){
|
||||
// var customer_id=$(".customer-id").text();
|
||||
// show_customer_details(customer_id);
|
||||
|
||||
// var order_id = $(this).attr("data-id");
|
||||
// window.location.href = '/origami/order/' + order_id;
|
||||
// })
|
||||
|
||||
$('.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();
|
||||
show_customer_details(customer_id);
|
||||
|
||||
var dining_id = $(this).attr("data-id");
|
||||
window.location.href = '/origami/table/' + dining_id;
|
||||
})
|
||||
});
|
||||
|
||||
$(".sales").on('click',function(){
|
||||
|
||||
var customer_id=$(".customer-id").text();
|
||||
show_customer_details(customer_id);
|
||||
|
||||
var sale_id = $(this).attr("data-id");
|
||||
window.location.href = '/origami/sale/' + sale_id;
|
||||
})
|
||||
var sale_id = $(this).attr("data-id");
|
||||
window.location.href = '/origami/sale/' + sale_id;
|
||||
});
|
||||
|
||||
$(".rooms").on('click', function(){
|
||||
|
||||
var customer_id=$(".customer-id").text();
|
||||
show_customer_details(customer_id);
|
||||
|
||||
var dining_id = $(this).attr("data-id");
|
||||
window.location.href = '/origami/room/' + dining_id;
|
||||
})
|
||||
});
|
||||
|
||||
$(".orders").on('click',function(){
|
||||
|
||||
var customer_id=$(".customer-id").text();
|
||||
show_customer_details(customer_id);
|
||||
|
||||
var order_id = $(this).attr("data-id");
|
||||
window.location.href = '/origami/order/' + order_id;
|
||||
})
|
||||
var order_id = $(this).attr("data-id");
|
||||
window.location.href = '/origami/order/' + order_id;
|
||||
});
|
||||
|
||||
// bind customer to order or sale
|
||||
$("#customer").on('click', function(){
|
||||
$("#customer").on('click', function(){
|
||||
var sale = $('#sale_id').val();
|
||||
if (sale) {
|
||||
var sale_id = sale
|
||||
}else{
|
||||
var sale_id = $('#save_order_id').attr('data-order');
|
||||
}
|
||||
var table_id = $('.tables').attr("data-id");
|
||||
|
||||
window.location.href = '/origami/'+ sale_id + "/customers"
|
||||
|
||||
});
|
||||
|
||||
$('#re-print').click(function() {
|
||||
var sale_id = $('#sale_id').val();
|
||||
window.location.href = '/origami/'+ sale_id + "/reprint"
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
|
||||
// Discount for Payment
|
||||
$('#discount').click(function() {
|
||||
var sale = $('#sale_id').val();
|
||||
@@ -341,6 +408,20 @@ $("#customer").on('click', function(){
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
// Print for first bill
|
||||
$("#first_bill").on('click', function(){
|
||||
var sale_id = $('#sale_id').val();
|
||||
var ajax_url = "/origami/sale/"+ sale_id + "/first_bill";
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: ajax_url,
|
||||
success:function(result){
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
@@ -354,9 +435,9 @@ $('#request_bills').click(function() {
|
||||
var order_id = $('#save_order_id').attr('data-order');
|
||||
var ajax_url = "/origami/" + order_id + "/request_bills";
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
type: "GET",
|
||||
url: ajax_url,
|
||||
data: 'order_id='+ order_id,
|
||||
// data: 'order_id='+ order_id,
|
||||
success:function(result){
|
||||
|
||||
location.reload();
|
||||
@@ -373,39 +454,109 @@ $('#back').on('click',function(){
|
||||
window.location.href = '/origami/';
|
||||
})
|
||||
|
||||
//show cusotmer rebate amount
|
||||
function show_customer_details(customer_id){
|
||||
$('#add_invoice').on('click',function(){
|
||||
var dining_id = "<%= @dining.id %>"
|
||||
var sale_id = "<%= @obj_sale.sale_id rescue "" %>"
|
||||
var ajax_url = "/origami/sale/append_order";
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: ajax_url,
|
||||
data: 'dining_id='+ dining_id + "&sale_id=" + sale_id,
|
||||
success:function(result){
|
||||
alert("Invoice updated")
|
||||
window.location.reload();
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
// //show cusotmer rebate amount
|
||||
// function show_customer_details(customer_id){
|
||||
// var url = '<%= @show_customer_details_path %>'
|
||||
// //Start Ajax
|
||||
// $.ajax({
|
||||
// type: "GET",
|
||||
// url: url,
|
||||
// data: {},
|
||||
// dataType: "json",
|
||||
// success: function(data) {
|
||||
// $("#customer_name").text(data["customer"].name);
|
||||
// if (data["response_data"]["data"].length) {
|
||||
// $.each(data["response_data"]["data"], function (i) {
|
||||
// if(data["response_data"]["data"][i]["accountable_type"] == "RebateAccount"){
|
||||
// var balance = data["response_data"]["data"][i]["balance"];
|
||||
// if (data["response_data"]["status"]==true) {
|
||||
// $('.rebate_amount').removeClass('hide');
|
||||
// row =
|
||||
// '<td class="charges-name">' + "Rebate Balance" +'</td>'
|
||||
// +'<td class="item-attr">' + balance + '</td>';
|
||||
|
||||
// $(".rebate_amount").html(row);
|
||||
// }
|
||||
|
||||
// }
|
||||
// });
|
||||
// }else{
|
||||
// $('.rebate_amount').addClass('hide');
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// //End Ajax
|
||||
// }
|
||||
|
||||
//show cusotmer rebate amount
|
||||
function show_customer_details(customer_id){
|
||||
var url = '<%= @show_customer_details_path %>'
|
||||
//Start Ajax
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: url,
|
||||
data: {},
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
$("#customer_name").text(data["customer"].name);
|
||||
if (data["response_data"]["data"].length) {
|
||||
$.each(data["response_data"]["data"], function (i) {
|
||||
if(data["response_data"]["data"][i]["accountable_type"] == "RebateAccount"){
|
||||
var balance = data["response_data"]["data"][i]["balance"];
|
||||
if (data["response_data"]["status"]==true) {
|
||||
$('.rebate_amount').removeClass('hide');
|
||||
row =
|
||||
'<td class="charges-name">' + "Rebate Balance" +'</td>'
|
||||
+'<td class="item-attr">' + balance + '</td>';
|
||||
|
||||
//Start Ajax
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: url,
|
||||
data: {},
|
||||
dataType: "json",
|
||||
success: function(data) {
|
||||
$("#customer_name").text(data["customer"].name);
|
||||
if (data["response_data"]["data"].length) {
|
||||
$.each(data["response_data"]["data"], function (i) {
|
||||
if(data["response_data"]["data"][i]["accountable_type"] == "RebateAccount"){
|
||||
var balance = data["response_data"]["data"][i]["balance"];
|
||||
if (data["response_data"]["status"]==true) {
|
||||
$('.rebate_amount').removeClass('hide');
|
||||
row =
|
||||
'<td class="charges-name">' + "Rebate Balance" +'</td>'
|
||||
+'<td class="item-attr">' + balance + '</td>';
|
||||
|
||||
$(".rebate_amount").html(row);
|
||||
}
|
||||
|
||||
$(".rebate_amount").html(row);
|
||||
}
|
||||
});
|
||||
}else{
|
||||
$('.rebate_amount').addClass('hide');
|
||||
|
||||
}
|
||||
}
|
||||
});
|
||||
//End Ajax
|
||||
});
|
||||
}else{
|
||||
$('.rebate_amount').addClass('hide');
|
||||
}
|
||||
}
|
||||
});
|
||||
//End Ajax
|
||||
}
|
||||
|
||||
$('#edit').on('click',function(){
|
||||
var dining_id = "<%= @dining.id %>"
|
||||
var sale_id = "<%= @obj_sale.sale_id rescue "" %>"
|
||||
window.location.href = '/origami/table/'+ dining_id + "/sale/"+ sale_id + "/edit";
|
||||
});
|
||||
|
||||
$('#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>
|
||||
|
||||
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
|
||||
@@ -1,2 +1 @@
|
||||
<h1>Origami::Shifts#edit</h1>
|
||||
<p>Find me in app/views/origami/shifts/edit.html.erb</p>
|
||||
<h1> Close Cashier </h1>
|
||||
|
||||
@@ -1,2 +1,46 @@
|
||||
<h1>Origami::Shifts#new</h1>
|
||||
<p>Find me in app/views/origami/shifts/new.html.erb</p>
|
||||
<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>
|
||||
|
||||
@@ -1,2 +1,92 @@
|
||||
<h1>Origami::Shifts#show</h1>
|
||||
<p>Find me in app/views/origami/shifts/show.html.erb</p>
|
||||
|
||||
<div class='row'>
|
||||
<div class='col-md-10'>
|
||||
<h1>Close Cashier</h1>
|
||||
<br>
|
||||
<table class='table table-striped'>
|
||||
<tr>
|
||||
<td>Shift Started At</td>
|
||||
<td><%= @shift.shift_started_at.utc.getlocal.strftime("%d/%m/%Y - %I:%M %p") rescue '-' %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Cashier Name</td>
|
||||
<td><%= @shift.employee.name rescue ''%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Opening Balance</td>
|
||||
<td><%= @shift.opening_balance rescue ''%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Total Revenue</td>
|
||||
<td><%= @shift.total_revenue rescue ''%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Total Discount</td>
|
||||
<td><%= @shift.total_discounts rescue ''%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Total Tax</td>
|
||||
<td><%= @shift.total_taxes rescue ''%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Grand Total</td>
|
||||
<td><%= @shift.grand_total rescue ''%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Nett Sale</td>
|
||||
<td><%= @shift.nett_sales rescue ''%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Cash Sale</td>
|
||||
<td><%= @shift.cash_sales rescue ''%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Credit Sale</td>
|
||||
<td><%= @shift.credit_sales rescue ''%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Other Sale</td>
|
||||
<td><%= @shift.other_sales rescue ''%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Commercial Tax</td>
|
||||
<td><%= @shift.commercial_taxes rescue ''%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Cash In</td>
|
||||
<td><%= @shift.cash_in rescue ''%></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>Cash Out</td>
|
||||
<td><%= @shift.cash_out rescue ''%></td>
|
||||
</tr>
|
||||
</table>
|
||||
<hr>
|
||||
<div class='row'>
|
||||
<div class='col-md-5'>
|
||||
<span style='font-size:20px;'><b>Closing Balance</b></span>
|
||||
</div>
|
||||
<div class='col-md-6'>
|
||||
<span style='font-size:20px;padding-left:18px;'><b><%= @shift.closing_balance rescue ''%></b></span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||
<button type="button" class="btn btn-primary btn-block" id='back'> Back </button>
|
||||
<button type="button" class="btn btn-primary btn-block green" id='close_cashier'> Close Cashier </button>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
$('#close_cashier').on('click',function(){
|
||||
$.ajax({type: "POST",
|
||||
url: "<%= origami_close_shift_path %>",
|
||||
success:function(result){
|
||||
console.log(result)
|
||||
window.location.href = '/';
|
||||
}
|
||||
});
|
||||
})
|
||||
$('#back').on('click',function(){
|
||||
window.location.href = '/origami';
|
||||
})
|
||||
</script>
|
||||
|
||||
1
app/views/origami/shifts/update_shift.json.jbuilder
Normal file
1
app/views/origami/shifts/update_shift.json.jbuilder
Normal file
@@ -0,0 +1 @@
|
||||
json.status true
|
||||
Reference in New Issue
Block a user