Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant into sqa-1804-001

This commit is contained in:
Aung Myo
2018-05-17 10:44:37 +06:30
10 changed files with 83 additions and 23 deletions

View File

@@ -56,6 +56,9 @@
</div>
<script>
cashier_type = window.location.href.indexOf("quick_service");
console.log(cashier_type)
var payment_method = "";
$('.payment-type').on('click',function(){
$('.payment-type').css("background-color","#7a62d3")
@@ -80,11 +83,19 @@
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';
if (cashier_type == -1) {
window.location.href = '/origami';
}else{
window.location.href = '/origami/quick_service/pending_order';
}
}
});
})
$('#back').on('click',function(){
window.location.href = '/origami';
if (cashier_type == -1) {
window.location.href = '/origami';
}else{
window.location.href = '/origami/quick_service/pending_order';
}
})
</script>

View File

@@ -25,6 +25,7 @@
</div>
</div>
<script>
cashier_type = window.location.href.indexOf("quick_service");
$('#cash_out').on('click',function(){
var reference = $('#reference').val();
var remark = $('#remark').val();
@@ -33,12 +34,22 @@
url: "<%= origami_cash_outs_path %>",
data: "reference="+ reference + "&remark=" + remark + "&amount="+ amount,
success:function(result){
window.location.href = '/origami';
if (cashier_type == -1) {
window.location.href = '/origami';
}else{
window.location.href = '/origami/quick_service/pending_order';
}
}
});
})
$('#back').on('click',function(){
window.location.href = '/origami';
cashier_type = window.location.href.indexOf("quick_service");
if (cashier_type == -1) {
window.location.href = '/origami';
}else{
window.location.href = '/origami/quick_service/pending_order';
}
})
</script>

View File

@@ -571,6 +571,7 @@ var customer_name = "<%= @customer.name %>";
if ($("#server_mode").val() != "cloud") { // first bill not used in cloud
payment_type = checkReceiptNoInFirstBillData(receipt_no,"payment");
console.log(payment_type)
console.log(parseInt(jQuery.inArray("MPU", payment_type)))
if (member_id && member_discount) {
if(parseInt(jQuery.inArray("Credit", payment_type)) == -1){
$("#credit_payment").hide();
@@ -654,7 +655,7 @@ var customer_name = "<%= @customer.name %>";
else if(parseInt(jQuery.inArray("Alipay", payment_type)) != -1 && $('#alipaycount').text()== 0 && sub_total != 0.0 && member){
swal("Oops","Please Pay with Alipay Payment","warning");
}
else if(parseInt(jQuery.inArray("JUNCTIONPAY", payment_type)) != -1 != -1 && $('#junctionpaycount').text()==0 && sub_total != 0.0 && member){
else if(parseInt(jQuery.inArray("JUNCTIONPAY", payment_type)) != -1 && $('#junctionpaycount').text()==0 && sub_total != 0.0 && member){
swal("Oops","Please Pay with JUNCTIONPAY Payment","warning");
}
else if(payment_type == "Credit" && $('#credit').text()==0 && sub_total != 0.0 && member){

View File

@@ -172,6 +172,8 @@
<button type="button" id="reprint" class="btn bg-blue btn-block">Reprint</button>
<% if current_user.role != "waiter" %>
<button id="close_cashier" type="button" class="btn btn-block btn-lg bg-blue waves-effect"> <%= t("views.btn.close_cashier") %></button>
<button id="cash_in" type="button" class="btn btn-block btn-lg bg-blue waves-effect"> <%= t("views.btn.cash_in") %> </button>
<button id="cash_out" type="button" class="btn btn-block btn-lg bg-blue waves-effect"> <%= t("views.btn.cash_out") %> </button>
<% end %>
</div>
</div>
@@ -201,7 +203,13 @@ $(document).ready(function(){
var linkURL = '/origami/shift/quick_service/close';
warnBeforeRedirect(linkURL);
});
$('#cash_in').on('click',function(){
window.location.href = '/origami/quick_service/cash_ins';
})
$('#cash_out').on('click',function(){
window.location.href = '/origami/quick_service/cash_outs';
})
});
</script>

View File

@@ -55,7 +55,9 @@
</button>
<% if current_user.role != "waiter" %>
<button id="close_cashier" type="button" class="btn btn-block btn-lg bg-blue waves-effect"> <%= t("views.btn.close_cashier") %></button>
<% end %>
<button id="cash_in" type="button" class="btn btn-block btn-lg bg-blue waves-effect"> <%= t("views.btn.cash_in") %> </button>
<button id="cash_out" type="button" class="btn btn-block btn-lg bg-blue waves-effect"> <%= t("views.btn.cash_out") %> </button>
<% end %>
</div>
</div>
</div>
@@ -83,6 +85,14 @@
warnBeforeRedirect(linkURL);
});
$('#cash_in').on('click',function(){
window.location.href = '/origami/quick_service/cash_ins';
})
$('#cash_out').on('click',function(){
window.location.href = '/origami/quick_service/cash_outs';
})
function warnBeforeRedirect(linkURL) {
swal({
title: "Alert!",

View File

@@ -188,6 +188,8 @@
<%end%>
<% if current_user.role != "waiter" %>
<button id="close_cashier" type="button" class="btn btn-block btn-lg bg-blue waves-effect"> <%= t("views.btn.close_cashier") %></button>
<!-- <button id="cash_in" type="button" class="btn btn-block btn-lg bg-blue waves-effect"> <%= t("views.btn.cash_in") %> </button>
<button id="cash_out" type="button" class="btn btn-block btn-lg bg-blue waves-effect"> <%= t("views.btn.cash_out") %> </button> -->
<% end %>
</div>
</div>
@@ -321,5 +323,13 @@ $(document).ready(function(){
window.location.href = '/oqs/'+ assigned_order_item_id + "/edit/pending";
}
});
$('#cash_in').on('click',function(){
window.location.href = '/origami/quick_service/cash_ins';
})
$('#cash_out').on('click',function(){
window.location.href = '/origami/quick_service/cash_outs';
})
});
</script>