second display
This commit is contained in:
@@ -31,7 +31,7 @@
|
||||
<span class="hidden" id="dining"><%if !@dining.nil?%><%= @dining.id%><%end%></span>
|
||||
<div class="col-lg-6 col-md-6 col-sm-6 text-left"><strong>Sale ID :</strong> <span id="sale_id"><% if @sale_data %><%=@sale_data.sale_id %><% end %></span></div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row p-l-5 p-r-5">
|
||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||
<strong>Customer :</strong>
|
||||
@@ -186,7 +186,7 @@
|
||||
</strong>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="row payment cash-color p-l-5 p-r-5">
|
||||
<div class="col-md-8">Cash</div>
|
||||
<div class="col-md-4" id="cash" >
|
||||
@@ -387,6 +387,8 @@
|
||||
<div class="cashier_number border-top border- border-left payment-long" data-value="10000" data-type="add">10000</div>
|
||||
</div>
|
||||
<div class="row bottom">
|
||||
<input type="hidden" name="server_mode" value="<%=ENV["SERVER_MODE"]%>" id="server_mode">
|
||||
<input type="hidden" name="display_type" id="display_type" value="<%= @display_type%>">
|
||||
<div class="pay border-top border- border-left purple payment-left" id="pay">Pay</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -442,7 +444,7 @@
|
||||
<% else %>
|
||||
<button type="button" class="btn btn-block bg-blue waves-effect" id='edit' <%= (can? :edit, :sale_edit)? ' ': 'disabled=' %> active="true">Edit</button>
|
||||
<% end %>
|
||||
|
||||
|
||||
<button type="button" id="discount" class="btn btn-block bg-blue waves-effect" <%= (can? :index, :discount)? ' ': 'disabled=' %> active="true">Discount</button>
|
||||
<button type="button" id="other-charges" class="btn btn-block bg-blue waves-effect">Charges</button>
|
||||
<!-- Waiter Buttons -->
|
||||
@@ -468,7 +470,7 @@
|
||||
<button type="button" class="btn btn-link p-t-5 p-b-5 bg-blue waves-effect" data-dismiss="modal">CLOSE</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
@@ -491,11 +493,11 @@
|
||||
<button type="button" class="btn btn-link bg-blue waves-effect" data-dismiss="modal">CLOSE</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- pdf light box -->
|
||||
<div class="modal fade" id="pdfModal" tabindex="-1" role="dialog" >
|
||||
@@ -511,20 +513,20 @@
|
||||
<input type="hidden" name="sale_receipt_no" id="sale_receipt_no">
|
||||
<input type="hidden" name="filename" id="filename">
|
||||
<input type="hidden" name="printer_name" id="printer_name">
|
||||
<div class="text-center">
|
||||
<div class="text-center">
|
||||
<iframe id="receipt_pdf" src="" class="pdf-iframe" scrolling="no"></iframe>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="mr-2 m-t-5 btn-lg btn-block bg-red waves-effect print_receipt" id="print_receipt"> Print
|
||||
</button>
|
||||
</button>
|
||||
<button type="button" class="btn-lg btn-block bg-blue waves-effect btn_pdf_close" data-dismiss="modal">
|
||||
CLOSE
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- customer light box -->
|
||||
<div class="modal fade" id="is_memberModal" tabindex="-1" role="dialog">
|
||||
@@ -570,7 +572,7 @@
|
||||
<div class="modal-footer"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="modal fade" id="AccessCodeModal" tabindex="-1" role="dialog">
|
||||
<div class="modal-dialog modal-sm" role="document">
|
||||
@@ -579,7 +581,7 @@
|
||||
<h4 class="modal-title" id="AccessCodeModalLabel">Enter Access Code</h4>
|
||||
<button type="button" class="close" id="close" data-dismiss="modal" aria-hidden="true" style="font-size: 20px;color:#111;">×</button>
|
||||
</div>
|
||||
<div class="modal-body" style="padding: 0px 25px 15px 25px !important">
|
||||
<div class="modal-body" style="padding: 0px 25px 15px 25px !important">
|
||||
<input type="password" id="access_code" class="access_code form-control col-md-12 ">
|
||||
<div class="row bottom p-l-15 p-r-15 m-t-10">
|
||||
<div class="col-md-3 access_number border-top border-left" data-value="1" data-type="num">1</div>
|
||||
@@ -598,12 +600,12 @@
|
||||
<div class="col-md-3 access_number border-top border-left" data-value="0" data-type="num">0</div>
|
||||
<div class="col-md-3 access_number border-top border-left orange" data-type="clr">Clr</div>
|
||||
<div class="col-md-3 access_number ok border-top border-left blue" data-type="ok" data-action="">OK</div>
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- change tax modal -->
|
||||
<div class="modal fade" id="change_taxModal" tabindex="-1" role="dialog">
|
||||
@@ -667,7 +669,7 @@
|
||||
<div class="m-r-20" align="right">
|
||||
<button type="button" class="btn btn-lg btn-link bg-red waves-effect btn_cancel">Cancel</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- customer light box -->
|
||||
<div class="modal fade m-t-40" id="is_paymemberModal" tabindex="-1" role="dialog">
|
||||
@@ -694,14 +696,14 @@
|
||||
<div class="modal-footer"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
// //control borwser back
|
||||
window.location.hash="no-back-button";
|
||||
window.location.hash="Again-No-back-button";//again because google chrome don't insert first hash into history
|
||||
window.onhashchange=function(){window.location.hash="";}
|
||||
var cashier_type = "<%= @cashier_type %>";
|
||||
var cashier_type = "<%= @cashier_type %>";
|
||||
var customer_id = "<%= @customer.id %>";
|
||||
var customer_name = "<%= @customer.name %>";
|
||||
var pdf_view = '<%=@pdf_view%>';
|
||||
@@ -725,35 +727,35 @@ $(document).ready(function(){
|
||||
/* start check first bill or not*/
|
||||
var member_id = $('#membership_id').text();
|
||||
var member_discount = $('#member_discount').text();
|
||||
var receipt_no = "";
|
||||
var receipt_no = "";
|
||||
if(($("#receipt_no").html()!=undefined) && ($("#receipt_no").html()!="")){
|
||||
receipt_no = ($("#receipt_no").html()).trim();
|
||||
}
|
||||
|
||||
payment_type = '';
|
||||
|
||||
|
||||
// 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();
|
||||
$("#credit_payment").hide();
|
||||
} else{
|
||||
$("#credit_payment").show();
|
||||
}
|
||||
if(parseInt(jQuery.inArray("MPU", payment_type)) != -1 ||
|
||||
parseInt(jQuery.inArray("VISA", payment_type)) != -1 ||
|
||||
parseInt(jQuery.inArray("JCB", payment_type)) != -1 ||
|
||||
parseInt(jQuery.inArray("Master", payment_type)) != -1 ||
|
||||
parseInt(jQuery.inArray("UNIONPAY", payment_type)) != -1 ||
|
||||
if(parseInt(jQuery.inArray("MPU", payment_type)) != -1 ||
|
||||
parseInt(jQuery.inArray("VISA", payment_type)) != -1 ||
|
||||
parseInt(jQuery.inArray("JCB", payment_type)) != -1 ||
|
||||
parseInt(jQuery.inArray("Master", payment_type)) != -1 ||
|
||||
parseInt(jQuery.inArray("UNIONPAY", payment_type)) != -1 ||
|
||||
parseInt(jQuery.inArray("Redeem", payment_type)) != -1 ||
|
||||
parseInt(jQuery.inArray("PAYMAL", payment_type)) != -1 ||
|
||||
parseInt(jQuery.inArray("JUNCTIONPAY", payment_type)) != -1 ||
|
||||
parseInt(jQuery.inArray("Alipay", payment_type)) != -1 ||
|
||||
parseInt(jQuery.inArray("PAYMAL", payment_type)) != -1 ||
|
||||
parseInt(jQuery.inArray("JUNCTIONPAY", payment_type)) != -1 ||
|
||||
parseInt(jQuery.inArray("Alipay", payment_type)) != -1 ||
|
||||
parseInt(jQuery.inArray("DINGA", payment_type)) != -1 ||
|
||||
parseInt(jQuery.inArray("GiftVoucher", payment_type)) != -1){
|
||||
$("#card_payment").show();
|
||||
$("#card_payment").show();
|
||||
} else{
|
||||
$("#card_payment").hide();
|
||||
}
|
||||
@@ -775,9 +777,9 @@ $(document).ready(function(){
|
||||
window.location.href = '/origami/table/'+ dining_id;
|
||||
}else{
|
||||
window.location.href = '/origami/'+cashier_type+'/pending_order/'+sale_id;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
if(localStorage.getItem("cash") == null || localStorage.getItem("cash") == 'null'){
|
||||
@@ -826,7 +828,7 @@ $(document).ready(function(){
|
||||
swal("Oops","Please Pay with Redeem Payment","warning");
|
||||
}else if(parseInt(jQuery.inArray("VISA", payment_type)) != -1 && $('#visacount').text()== 0 && sub_total != 0.0 && member){
|
||||
swal("Oops","Please Pay with Visa Payment","warning");
|
||||
|
||||
|
||||
}else if(parseInt(jQuery.inArray("JCB", payment_type)) != -1 && $('#jcbcount').text()== 0 && sub_total != 0.0 && member){
|
||||
swal("Oops","Please Pay with jcb Payment","warning");
|
||||
}
|
||||
@@ -871,7 +873,7 @@ $(document).ready(function(){
|
||||
calculate_member_discount(sale_id,tax_type);
|
||||
}
|
||||
|
||||
// $("#pdfModal").on('shown.bs.modal', function () {
|
||||
// $("#pdfModal").on('shown.bs.modal', function () {
|
||||
// $('#pdfModal').focus() }).modal({show : true, backdrop : false, keyboard : false});
|
||||
/* check credit payment or not*/
|
||||
if(location.pathname.includes("credit_payment")){
|
||||
@@ -891,7 +893,7 @@ $(document).ready(function(){
|
||||
}
|
||||
/* end delete receipt no in first bill*/
|
||||
|
||||
localStorage.removeItem("cash");
|
||||
localStorage.removeItem("cash");
|
||||
if (result.status) {
|
||||
var msg = result.message;
|
||||
}
|
||||
@@ -899,7 +901,7 @@ $(document).ready(function(){
|
||||
var msg = '';
|
||||
}
|
||||
|
||||
$("#loading_wrapper" ).hide();
|
||||
$("#loading_wrapper" ).hide();
|
||||
if(location.pathname.includes("credit_payment")){
|
||||
payment_success_alert();
|
||||
}else{
|
||||
@@ -922,7 +924,7 @@ $(document).ready(function(){
|
||||
$("#pdfModal").modal({show : true, backdrop : false, keyboard : false});
|
||||
$("#pdfModalLabel").text("Sale Completed");
|
||||
}else{
|
||||
//PDF lightbox data
|
||||
//PDF lightbox data
|
||||
print_receipt();
|
||||
}
|
||||
}
|
||||
@@ -930,10 +932,26 @@ $(document).ready(function(){
|
||||
});
|
||||
}
|
||||
}
|
||||
var second_display_lookup = $("#display_type").val();
|
||||
if ($('#server_mode').val() != "cloud" && second_display_lookup == 2){
|
||||
customer_display_view(null,"reload");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
function customer_display_view(data,status) {
|
||||
url = '../../../../origami/customer_view';
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: url,
|
||||
data: {"data":data,"status":status},
|
||||
dataType: "json",
|
||||
success:function(result){
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// $('#void').on('click',function () {
|
||||
// if ($(this).attr('active') === "true") {
|
||||
// if ($(this).attr('active') === "true") {
|
||||
// var sale_id = $('#sale_id').text();
|
||||
// var remark = $("#remark").val();
|
||||
// var ajax_url = "/origami/sale/" + sale_id + '/void';
|
||||
@@ -949,7 +967,7 @@ $(document).ready(function(){
|
||||
// swal("Oops","You are not authorized for void","warning")
|
||||
// }
|
||||
// });
|
||||
|
||||
|
||||
});
|
||||
|
||||
// bind survey to order or sale
|
||||
@@ -960,7 +978,7 @@ $(document).ready(function(){
|
||||
} else {
|
||||
var sale_id = $('#dining').text();
|
||||
}
|
||||
//var table_id = $('.tables').attr("data-id");
|
||||
//var table_id = $('.tables').attr("data-id");
|
||||
window.location.href = '/origami/' + sale_id +"/"+ cashier_type + "/surveys";
|
||||
});
|
||||
|
||||
@@ -1023,7 +1041,7 @@ $(document).ready(function(){
|
||||
}else{
|
||||
window.location.href = "/origami/table/sale/" + sale_id + "/"+cashier_type+"/edit";
|
||||
}
|
||||
|
||||
|
||||
}else{
|
||||
swal("Oops","You are not authorized for void","warning")
|
||||
}
|
||||
@@ -1118,7 +1136,7 @@ $(document).ready(function(){
|
||||
var total = parseFloat(cash) + parseFloat(credit) + parseFloat(card) + parseFloat(paypar) + parseFloat(visa) + parseFloat(jcb) + parseFloat(master) + parseFloat(unionpay) + parseFloat(alipay) + parseFloat(junctionpay) + parseFloat(paymal) + parseFloat(dinga) + parseFloat(giftvoucher);
|
||||
|
||||
var result = parseFloat(amount_due) - parseFloat(total);
|
||||
|
||||
|
||||
<% if precision.to_i > 0 %>
|
||||
$('#balance').text(parseFloat(result).toFixed(<%= precision %>));
|
||||
<% else %>
|
||||
@@ -1134,7 +1152,7 @@ $(document).ready(function(){
|
||||
url: '../../../customer_view',
|
||||
data: {"data":data,"status":status},
|
||||
dataType: "json",
|
||||
success:function(result){
|
||||
success:function(result){
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -1155,7 +1173,7 @@ $(document).ready(function(){
|
||||
url: "/origami/" + sale_id + "/member_discount",
|
||||
data: {'sale_id':sale_id, 'sub_total':sub_total,'is_card':is_card,'cashier_type':cashier_type, 'tax_type':tax_type },
|
||||
async: false,
|
||||
success:function(result){
|
||||
success:function(result){
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -1179,7 +1197,7 @@ $(document).ready(function(){
|
||||
var receipt_no = $("#sale_receipt_no").val();
|
||||
var params = { 'filename':filename, 'receipt_no':receipt_no, 'printer_name':printer_name };
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
type: "POST",
|
||||
url: "/origami/sale/"+sale_id+"/"+cashier_type+"/payment/print",
|
||||
data: params,
|
||||
success:function(result){
|
||||
@@ -1203,7 +1221,7 @@ $(document).ready(function(){
|
||||
if (cashier_type=="quick_service"){
|
||||
customer_display_view(null,"reload");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}else{
|
||||
payment_success_alert();
|
||||
@@ -1216,7 +1234,7 @@ $(document).ready(function(){
|
||||
var title = "Payment Successful!";
|
||||
if($('#balance').text() < 0){
|
||||
var text = 'Changed amount ' + $('#balance').text() * (-1);
|
||||
}else{
|
||||
}else{
|
||||
$('#pay').text("Pay");
|
||||
var text = 'Thank You !';
|
||||
}
|
||||
@@ -1225,7 +1243,7 @@ $(document).ready(function(){
|
||||
title: "Payment Successful!",
|
||||
text: text,
|
||||
html: true,
|
||||
closeOnConfirm: false,
|
||||
closeOnConfirm: false,
|
||||
closeOnCancel: false,
|
||||
allowOutsideClick: false
|
||||
}, function () {
|
||||
@@ -1245,7 +1263,7 @@ $(document).ready(function(){
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
$(".btn_pdf_close").on('click',function(){
|
||||
var flag = localStorage.getItem("trans_flag");
|
||||
@@ -1257,9 +1275,9 @@ $(document).ready(function(){
|
||||
window.location.href = '/origami';
|
||||
}else{
|
||||
window.location.href = '/origami/'+cashier_type;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
});
|
||||
|
||||
$(".btn_customer_yes").on('click',function(){
|
||||
@@ -1268,8 +1286,8 @@ $(document).ready(function(){
|
||||
});
|
||||
|
||||
// Read Card Reader
|
||||
$(".btn_member").on('click', function(){
|
||||
var cardNo = "";
|
||||
$(".btn_member").on('click', function(){
|
||||
var cardNo = "";
|
||||
var customer_id = '';
|
||||
var customer_name = '';
|
||||
var membership_id = '';
|
||||
@@ -1278,13 +1296,13 @@ $(document).ready(function(){
|
||||
var customer_mamber_card_no = 0;
|
||||
|
||||
$("#is_memberModal").hide();
|
||||
$("#sxModal").show();
|
||||
$("#sxModal").show();
|
||||
setTimeout(function(){
|
||||
getCardNo();
|
||||
$("#sxModal").hide();
|
||||
$("#sxModal").hide();
|
||||
customer_mamber_card_no = $("#paypar_account_no").val();
|
||||
|
||||
if(sale_id != 0 && customer_mamber_card_no != 0){
|
||||
|
||||
if(sale_id != 0 && customer_mamber_card_no != 0){
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/origami/"+sale_id+"/get_customer" ,
|
||||
@@ -1302,7 +1320,7 @@ $(document).ready(function(){
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
},100);
|
||||
});
|
||||
@@ -1324,17 +1342,17 @@ $(document).ready(function(){
|
||||
// QR Code Reader
|
||||
$(".btn_qr_code").on('click', function(e){
|
||||
$("#is_memberModal").hide();
|
||||
var code = "";
|
||||
var code = "";
|
||||
var customer_id = '';
|
||||
var customer_name = '';
|
||||
var membership_id = '';
|
||||
var membership_type = '';
|
||||
var membership_type = '';
|
||||
setTimeout(function(){
|
||||
code=getQRCode();
|
||||
code=getQRCode();
|
||||
$("#qr_code").val(code);
|
||||
});
|
||||
|
||||
if(sale_id != 0 && code != ""){
|
||||
if(sale_id != 0 && code != ""){
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/origami/"+sale_id+"/get_customer" ,
|
||||
@@ -1352,13 +1370,13 @@ $(document).ready(function(){
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
// Read qrcode from java
|
||||
function getQRCode(){
|
||||
return code2lab.readQRCode();
|
||||
return code2lab.readQRCode();
|
||||
}
|
||||
|
||||
function update_sale(membership_id, customer_id, customer_name, sale_id) {
|
||||
@@ -1393,7 +1411,7 @@ $(document).ready(function(){
|
||||
location.reload();
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
@@ -1462,7 +1480,7 @@ $(document).ready(function(){
|
||||
var cash = $('#grand_total').text();
|
||||
var sub_total = $('#sub-total').text();
|
||||
var sale_id = $('#sale_id').text();
|
||||
var params = { 'cash':cash,'sale_id':sale_id,'sub_total':sub_total,'remark':remark,'type':cashier_type,'access_code':access_code };
|
||||
var params = { 'cash':cash,'sale_id':sale_id,'sub_total':sub_total,'remark':remark,'type':cashier_type,'access_code':access_code };
|
||||
swal({
|
||||
title: "Alert",
|
||||
text: "Are you sure want to FOC This Receipt?",
|
||||
@@ -1477,8 +1495,8 @@ $(document).ready(function(){
|
||||
type: "POST",
|
||||
url: "/origami/payment/"+cashier_type+"/foc",
|
||||
data: params,
|
||||
success:function(result){
|
||||
customer_display_view(null,"reload");
|
||||
success:function(result){
|
||||
customer_display_view(null,"reload");
|
||||
if (cash >= 0) {
|
||||
swal({
|
||||
title: "Information!",
|
||||
@@ -1498,14 +1516,14 @@ $(document).ready(function(){
|
||||
window.location.href = '/origami';
|
||||
}else{
|
||||
window.location.href = '/origami/'+cashier_type;
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
$('#void').on('click', function () {
|
||||
@@ -1543,12 +1561,12 @@ $(document).ready(function(){
|
||||
window.location.href = '/origami';
|
||||
}else{
|
||||
window.location.href = '/origami/'+cashier_type;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
function waste_and_spoilage(remark) {
|
||||
@@ -1588,12 +1606,12 @@ $(document).ready(function(){
|
||||
if(cashier_type=="quick_service"){
|
||||
customer_display_view(null,"reload");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
/* Start function for tax changable */
|
||||
@@ -1628,12 +1646,12 @@ $(document).ready(function(){
|
||||
type: "POST",
|
||||
url: "/origami/payment/"+cashier_type+"/change_tax",
|
||||
data: {sale_id: sale_id, cashier_type: cashier_type, tax_type: type},
|
||||
success:function(data){
|
||||
success:function(data){
|
||||
if(data.status){
|
||||
// console.log(type);
|
||||
localStorage.setItem("tax_type", type);
|
||||
window.location.href = '/origami/sale/'+sale_id+'/'+cashier_type+'/payment';
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
}else{
|
||||
@@ -1666,10 +1684,10 @@ $(document).ready(function(){
|
||||
});
|
||||
|
||||
// Read Card Reader - Paymal payment for FoodCourt
|
||||
$(".btn_paymal_member").on('click', function (){
|
||||
var cardNo = "";
|
||||
$(".btn_paymal_member").on('click', function (){
|
||||
var cardNo = "";
|
||||
var sale_id = $("#sale_id").text() || 0;
|
||||
var receipt_no = "";
|
||||
var receipt_no = "";
|
||||
if(($("#receipt_no").html()!=undefined) && ($("#receipt_no").html()!="")){
|
||||
receipt_no = ($("#receipt_no").html()).trim();
|
||||
}
|
||||
@@ -1678,15 +1696,15 @@ $(document).ready(function(){
|
||||
var payment_amount = parseFloat($("#grand_total").text());
|
||||
|
||||
$("#is_paymemberModal").hide();
|
||||
$("#sxModal").show();
|
||||
$("#sxModal").show();
|
||||
setTimeout(function(){
|
||||
getCardNo();
|
||||
$("#sxModal").hide();
|
||||
$("#sxModal").hide();
|
||||
customer_mamber_card_no = $("#paypar_account_no").val();
|
||||
if (customer_mamber_card_no == 0) {
|
||||
customer_mamber_card_no = $("#membership_id").text() || 0;
|
||||
}
|
||||
if(sale_id != 0 && customer_mamber_card_no !=0){
|
||||
if(sale_id != 0 && customer_mamber_card_no !=0){
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/origami/"+sale_id+"/send_account" ,
|
||||
@@ -1743,7 +1761,7 @@ $(document).ready(function(){
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
});
|
||||
}else{
|
||||
swal({
|
||||
title: 'Oops',
|
||||
@@ -1763,16 +1781,16 @@ $(document).ready(function(){
|
||||
// QR Code Reader
|
||||
$(".btn_paymal_qr_code").on('click', function(e){
|
||||
$("#is_paymemberModal").hide();
|
||||
var code = "";
|
||||
var code = "";
|
||||
var sale_id = $("#sale_id").text() || 0;
|
||||
var receipt_no = "";
|
||||
var receipt_no = "";
|
||||
if(($("#receipt_no").html()!=undefined) && ($("#receipt_no").html()!="")){
|
||||
receipt_no = ($("#receipt_no").html()).trim();
|
||||
}
|
||||
var payment_amount = parseFloat($("#grand_total").text());
|
||||
setTimeout(function(){
|
||||
code=getQRCode();
|
||||
if(sale_id != 0 && code != ""){
|
||||
code=getQRCode();
|
||||
if(sale_id != 0 && code != ""){
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "/origami/"+sale_id+"/send_account" ,
|
||||
@@ -1828,8 +1846,8 @@ $(document).ready(function(){
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
},100);
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user