This commit is contained in:
Zoey
2019-06-26 11:42:51 +06:30
parent 56b8115ac9
commit 79d8eb94ef
17 changed files with 306 additions and 78 deletions

View File

@@ -540,6 +540,8 @@
<button type="button" id="pay" data-order="<%= existing_order %>" class="btn btn-block bg-blue waves-effect">Pay</button>
<!-- <button type="button" id="kbz_query" data-order="<%= existing_order %>" class="btn btn-block bg-blue waves-effect">KBZ Query</button> -->
<!--<% if current_login_employee.role != "waiter" %>
<button type="button" class="btn action-btn bg-blue waves-effect" data-toggle="modal" data-target="#waste_spoileModal" > Waste & Spoile</button>
<% end %>-->
@@ -1072,6 +1074,24 @@
}
});
// $('#kbz_query').on('click', function(){
// var sale_id = $('#sale_id').val();
// var dining_id = "<%= @dining.id %>";
// // window.location.href = '/origami/payment/kbz_query/'+ sale_id;
// $.ajax({
// type: 'POST',
// data: 'table_id='+dining_id,
// url: '/origami/payment/kbz_query/'+sale_id,
// success: function(result){
// if (result.status == true) {
// window.location.href = '/origami';
// }else{
// location.reload()
// }
// }
// })
// })
// Bill Request
$('#request_bills').click(function () {
var order_id = $('#save_order_id').attr('data-order');

View File

@@ -201,7 +201,14 @@
<% else %>
<div class="col-md-4 hidden" id="credit">0</div>
<% end %>
<% if @other == 0.0 && @ppamount == 0.0 && @visacount == 0.0 && @jcbcount == 0.0 && @mastercount == 0.0 && @unionpaycount == 0.0 && @alipaycount == 0.0 && @paymalcount == 0.0 && @junctionpaycount == 0.0 && @dingacount == 0.0 && @giftvouchercount == 0.0 %>
<% if @kbz_pay_amount > 0.0 %>
<div class="row payment other-payment-color" id="card_payment" >
<div class="col-md-8">Other Payments (KBZ Pay)</div>
<div class="col-md-4" id="others">
<%= number_with_precision(@kbz_pay_amount, precision: precision.to_i) rescue number_with_precision(0, precision: precision.to_i) %>
</div>
</div>
<% elsif @other == 0.0 && @ppamount == 0.0 && @visacount == 0.0 && @jcbcount == 0.0 && @mastercount == 0.0 && @unionpaycount == 0.0 && @alipaycount == 0.0 && @paymalcount == 0.0 && @junctionpaycount == 0.0 && @dingacount == 0.0 && @giftvouchercount == 0.0 %>
<div class="row payment other-payment-color" id="card_payment" >
<div class="col-md-8">Other Payments</div>
<div class="col-md-4" id="others">
@@ -400,6 +407,10 @@
<button type="button" class="btn btn-block btn-default waves-effect" id='back'>
<i class="material-icons">reply</i>
Back
</button>
<button type="button" class="btn btn-block btn-default waves-effect" id='refresh'>
<!-- <i class="material-icons">reply</i> -->
Refresh
</button>
<!-- -->
<% if current_login_employee.role == "cashier" %>
@@ -782,6 +793,10 @@ $(document).ready(function(){
});
$("#refresh").on('click', function(){
window.location.reload();
})
if(localStorage.getItem("cash") == null || localStorage.getItem("cash") == 'null'){
}
@@ -867,6 +882,11 @@ $(document).ready(function(){
var cash = $('#cash').text();
var credit = $('#credit').text();
var card = $('#card').text();
var kbz_amt = "<%= @kbz_pay_amount %>";
var is_kbz = false;
if (kbz_amt > 0) {
is_kbz = true
}
var tax_type = localStorage.getItem("tax_type") ? localStorage.getItem("tax_type") : 'all';
if (credit <= 0 && (!location.pathname.includes("credit_payment"))) {
@@ -884,7 +904,7 @@ $(document).ready(function(){
$.ajax({type: "POST",
url: url,
data: "cash="+ cash + "&sale_id=" + sale_id + "&type=" + cashier_type + "&tax_type=" + tax_type,
data: "cash="+ cash + "&sale_id=" + sale_id + "&type=" + cashier_type + "&tax_type=" + tax_type + "&is_kbz=" + is_kbz,
success:function(result){
/* start delete receipt no in first bill*/
if(($("#receipt_no").html()!=undefined) && ($("#receipt_no").html()!="")){