Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant
This commit is contained in:
4
app/views/oqs/edit/index.html.erb
Executable file → Normal file
4
app/views/oqs/edit/index.html.erb
Executable file → Normal file
@@ -112,6 +112,8 @@ $(document).ready(function(){
|
||||
var remarks = $("textarea[name='remarks']").val();
|
||||
var order_items_id = $(this).attr('data-id');
|
||||
var params = { 'order_items_id': order_items_id, 'qty_weight': qty_weight, 'remarks': remarks }
|
||||
var booking_id = '<%= @booking.booking_id %>';
|
||||
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: '/oqs/' + order_items_id,
|
||||
@@ -121,6 +123,8 @@ $(document).ready(function(){
|
||||
<% if !@link_type.nil? %>
|
||||
<% if @link_type == 'oqs' %>
|
||||
window.location.href = '/oqs';
|
||||
<% elsif @link_type == 'pending' %>
|
||||
window.location.href = '/origami/quick_service/pending_order/'+booking_id;
|
||||
<% else %>
|
||||
<% if !@dining_type.nil? %>
|
||||
<% if @dining_type == 'Table' %>
|
||||
|
||||
@@ -723,7 +723,9 @@
|
||||
receipt_no = ($("#receipt_no").html()).trim();
|
||||
if((receipt_no!=undefined) && (receipt_no!=""))
|
||||
createReceiptNoInFirstBillData(receipt_no,"");
|
||||
|
||||
|
||||
// console.log(result);
|
||||
// code2lab.printBill(result.filepath, result.printer_model, result.printer_url);
|
||||
location.reload();
|
||||
}
|
||||
});
|
||||
|
||||
5
app/views/origami/junction_pay/create.json.jbuilder
Executable file
5
app/views/origami/junction_pay/create.json.jbuilder
Executable file
@@ -0,0 +1,5 @@
|
||||
if(@status)
|
||||
json.status @status
|
||||
else
|
||||
json.status false
|
||||
end
|
||||
300
app/views/origami/junction_pay/index.html.erb
Executable file
300
app/views/origami/junction_pay/index.html.erb
Executable file
@@ -0,0 +1,300 @@
|
||||
<div class="container-fluid">
|
||||
<div id="loading_wrapper" style="display:none;">
|
||||
<div id="loading"></div>
|
||||
</div>
|
||||
<!-- <div class="page-header">
|
||||
<ol class="breadcrumb">
|
||||
<li class="breadcrumb-item"><a href="<%=origami_root_path %>"><%= t :home %></a></li>
|
||||
<li class="breadcrumb-item"><a href="/origami/sale/<%=@sale_id %>/payment"><%= t("views.btn.payment") %></a></li>
|
||||
<li class="breadcrumb-item active"><%= t("views.btn.jcb") %></li>
|
||||
<span class="float-right">
|
||||
<%= link_to t('.back',:default => t("views.btn.back")),'/origami/sale/'+@sale_id+'/payment/others_payment'%>
|
||||
</span>
|
||||
</ol>
|
||||
</div> -->
|
||||
<div class="row">
|
||||
<div class="col-lg-5 col-md-5 col-sm-3">
|
||||
<span class="hidden" id="membership_id"><%= @membership_id%></span>
|
||||
<span class="hidden" id="member_discount"><%= @member_discount%></span>
|
||||
<span class="hidden" id="sub-total"><%= @sub_total%></span>
|
||||
<div class="card m-l-10 m-t-10" style="padding:0px 20px;">
|
||||
<div class="rebate-form">
|
||||
<div class="row">
|
||||
<div class="form-group col-lg-12 col-md-12 col-sm-12">
|
||||
<label for="com_port_name">Select Device</label>
|
||||
<select id="com_port_name" name="com_port_name" class="form-control select col-lg-7 col-md-7 col-sm-7">
|
||||
|
||||
</select>
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="form-group col-lg-12 col-md-12 col-sm-12">
|
||||
<label>You can pay up to </label>
|
||||
<%@can_junction_pay = @can_junction_pay +@rounding_adj%>
|
||||
<input type="text" name="validamount" id="validamount" class="form-control col-lg-7 col-md-7 col-sm-7" readonly="" value="<%=@can_junction_pay %>" data-member-value="">
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
<% if @jcbcount != 0 %>
|
||||
<div class="row">
|
||||
<div class="form-group col-lg-12 col-md-12 col-sm-12">
|
||||
<label>Recent junction pay paid amount </label>
|
||||
<input type="text" name="" id="" class="form-control col-lg-7 col-md-7 col-sm-7" readonly="" value="<%=@junction_pay_count %>" data-member-value="">
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="row">
|
||||
<div class="form-group col-lg-12 col-md-12 col-sm-12">
|
||||
<label>Reference Number</label>
|
||||
<input type="text" name="reference_no" id="reference_no" class="form-control col-lg-7 col-md-7 col-sm-7" value="" data-value="<%=@sale_id %>" data-member-value="">
|
||||
<br><span id="reference_no_Err" style="color:red;"></span>
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="form-group col-lg-12 col-md-12 col-sm-12">
|
||||
<label>Amount</label>
|
||||
<div id="amount" class="form-control col-lg-7 col-md-7 col-sm-7">0.0</div>
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||
<div class="m-t-10 p-l-20">
|
||||
<div class="row">
|
||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||
<div class="row bottom">
|
||||
<div class="col-md-4 cashier_number border-left" data-value="1" data-type="num">1</div>
|
||||
<div class="col-md-4 cashier_number border-left" data-value="2" data-type="num">2</div>
|
||||
<div class="col-md-4 cashier_number border-left" data-value="3" data-type="num">3</div>
|
||||
</div>
|
||||
<div class="row bottom">
|
||||
<div class="col-md-4 cashier_number border-left" data-value="4" data-type="num">4</div>
|
||||
<div class="col-md-4 cashier_number border-left" data-value="5" data-type="num">5</div>
|
||||
<div class="col-md-4 cashier_number border-left" data-value="6" data-type="num">6</div>
|
||||
</div>
|
||||
<div class="row bottom">
|
||||
<div class="col-md-4 cashier_number border-left" data-value="7" data-type="num">7</div>
|
||||
<div class="col-md-4 cashier_number border-left" data-value="8" data-type="num">8</div>
|
||||
<div class="col-md-4 cashier_number border-left" data-value="9" data-type="num">9</div>
|
||||
</div>
|
||||
<div class="row bottom">
|
||||
<div class="col-md-4 cashier_number border-left" data-value="0" data-type="num">0</div>
|
||||
<div class="col-md-4 cashier_number border-left" data-value="." data-type="num">.</div>
|
||||
<div class="col-md-4 cashier_number border-left" data-value="00" data-type="num">00</div>
|
||||
</div>
|
||||
<div class="row bottom">
|
||||
<div class="col-md-4 cashier_number green border-left" data-type="nett" >Nett</div>
|
||||
<div class="col-md-4 cashier_number red border-left" data-type="del">Del</div>
|
||||
<div class="col-md-4 cashier_number orange border-left" data-type="clr">Clr</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="col-lg-6 col-md-6 col-sm-6">
|
||||
<div class="row bottom m-l-5">
|
||||
<div class="cashier_number long border-left" data-value="1000" data-type="add">1000</div>
|
||||
<div class="cashier_number long left" data-value="3000" data-type="add">3000</div>
|
||||
</div>
|
||||
<div class="row bottom m-l-5">
|
||||
<div class="cashier_number long border-left" data-value="5000" data-type="add">5000</div>
|
||||
<div class="cashier_number long left" data-value="10000" data-type="add">10000</div>
|
||||
</div>
|
||||
<div class="row bottom m-l-5">
|
||||
<div class="pay purple left" id="junction_pay">Pay</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-lg-1 col-md-1 col-sm-1">
|
||||
<button type="button" class="btn btn-default btn-block" onclick="window.location.href = '/origami/sale/<%= @sale_id %>/<%= @cashier_type %>/payment/others_payment';"> <i class="material-icons m-t--5">reply</i>Back </button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var cashier_type = "<%= @cashier_type %>";
|
||||
$(document).ready(function() {
|
||||
var sale_id = "<%= @sale_id %>";
|
||||
var bank_integration = "<%= @bank_integration %>";
|
||||
if(localStorage.getItem("cash") == null || localStorage.getItem("cash") == 'null'){}
|
||||
else {
|
||||
$('#validamount').attr("value",parseFloat("<%= @can_junction_pay %>") - parseFloat(localStorage.getItem("cash")));
|
||||
}
|
||||
|
||||
code2lab.getCommPorts(); //get comportlists from jade
|
||||
});
|
||||
|
||||
// number key pad
|
||||
$(document).on('click', '.cashier_number', function(event){
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
if(event.handled !== true) {
|
||||
var original_value;
|
||||
original_value = $('#amount').text();
|
||||
|
||||
var input_value = $(this).attr("data-value");
|
||||
|
||||
var input_type = $(this).attr("data-type");
|
||||
switch (input_type) {
|
||||
case 'num':
|
||||
if (original_value == "0.0"){
|
||||
$('#amount').text(input_value);
|
||||
}else{
|
||||
$('#amount').append(input_value);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'add':
|
||||
var input_value = $(this).attr("data-value");
|
||||
amount = parseInt(input_value) + parseInt(original_value);
|
||||
$('#amount').html(amount);
|
||||
|
||||
break;
|
||||
case 'clr':
|
||||
$('#amount').html("0.0");
|
||||
break;
|
||||
case 'del' :
|
||||
var cash=$('#amount').text();
|
||||
$('#amount').text(cash.substr(0,cash.length-1));
|
||||
break;
|
||||
case 'nett':
|
||||
var remain_amount = $('#validamount').val();
|
||||
$('#amount').text(remain_amount);
|
||||
break;
|
||||
|
||||
}
|
||||
event.handled = true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
$('#junction_pay').on('click',function(){
|
||||
var amount = $('#amount').text();
|
||||
var reference_no = $('#reference_no').val();
|
||||
var sale_id = "<%= @sale_id %>";
|
||||
var receipt_no = "<%= @receipt_no %>";
|
||||
var cashier_id = "<%= @cashier_id %>";
|
||||
$("#reference_no_Err").html("");
|
||||
if(reference_no.length > 0){
|
||||
if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){
|
||||
$(this).off("click");
|
||||
//start member discount 5% by pay card
|
||||
// var sub_total = $('#sub-total').text();
|
||||
// var member_id = $('#membership_id').text();
|
||||
// var member_discount = $('#member_discount').text();
|
||||
// if (member_id && member_discount) {
|
||||
// $.ajax({
|
||||
// type: "POST",
|
||||
// url: "/origami/" + sale_id + "/member_discount",
|
||||
// data: {'sale_id':sale_id, 'sub_total':sub_total,'is_card':true },
|
||||
// success:function(result){
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
//end member discount
|
||||
$("#loading_wrapper").show();
|
||||
var com_port = '/dev/' + $("#com_port_name").val();
|
||||
var is_rebate=false;
|
||||
//alert(cashier_id + amount + com_port);
|
||||
code2lab.reqJunctionPay(true, cashier_id, parseFloat(amount), receipt_no, com_port);
|
||||
resJunctionPayUpdate = function(totalBillAmount , finalBillAmt,giftCardAmount, voucherAmount,voucherNumber,receiptNumber){
|
||||
$("#loading_wrapper").hide();
|
||||
|
||||
var voucher_no = voucherNumber;
|
||||
if (voucher_no == ''){
|
||||
voucher_no = reference_no;
|
||||
}
|
||||
|
||||
$.ajax({
|
||||
type: "POST",
|
||||
url: "<%= origami_payment_junctionpay_path %>",
|
||||
data: "gift_amount="+ giftCardAmount + "&voucher_amount=" + voucherAmount +
|
||||
"&voucher_no=" + voucher_no + "&sale_id="+ sale_id,
|
||||
success:function(result){
|
||||
if(result){
|
||||
var desc = 'Payment Successfully';
|
||||
// is_rebate get from resJunctionPay and if member
|
||||
if(is_rebate){ desc = desc + ". And You get Rebate!"}
|
||||
|
||||
swal({
|
||||
title: "Information!",
|
||||
text: desc,
|
||||
html: true,
|
||||
closeOnConfirm: false,
|
||||
closeOnCancel: false,
|
||||
allowOutsideClick: false
|
||||
}, function () {
|
||||
window.location.href = '/origami/sale/'+ sale_id +"/"+cashier_type+"/payment";
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
resJunctionPay = function(memberno,transactionNo,finalBillingAmt){
|
||||
if(memberno != ''){ is_rebate = true; }
|
||||
};
|
||||
|
||||
|
||||
// $("#loading_wrapper").hide();
|
||||
// $.ajax({type: "POST",
|
||||
// url: "/origami/payment/"+payment_type,
|
||||
// data: "amount="+ finalBillingAmt + "&sale_id="+ sale_id,
|
||||
// success:function(result){
|
||||
// if(result){
|
||||
// swal({
|
||||
// title: "Information!",
|
||||
// text: "Payment Successfully",
|
||||
// html: true,
|
||||
// closeOnConfirm: false,
|
||||
// closeOnCancel: false,
|
||||
// allowOutsideClick: false
|
||||
// }, function () {
|
||||
// window.location.href = '/origami/sale/'+ sale_id +"/"+cashier_type+"/payment";
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// });
|
||||
|
||||
// var resError = function(message){
|
||||
// console.log(message);
|
||||
// $("#loading_wrapper").hide();
|
||||
// swal ( "Oops" , message , "error" );
|
||||
// };
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
// var resJunctionPayUpdate = function(totalBillAmount , finalBillAmt,giftCardAmount,voucherAmount, voucherNumber,receiptNumber){
|
||||
// $("#loading_wrapper").hide();
|
||||
// // alert(voucherNumber + ' ' + totalBillAmount + ' ' + receiptNumber + ' ' + giftCardAmount);
|
||||
// $.ajax({
|
||||
// type: "POST",
|
||||
// url: "<%= origami_payment_junctionpay_path %>",
|
||||
// data: "amount="+ totalBillAmount + "&sale_id="+ sale_id,
|
||||
// success:function(result){
|
||||
// if(result){
|
||||
// swal({
|
||||
// title: "Information!",
|
||||
// text: "Payment Successfully",
|
||||
// html: true,
|
||||
// closeOnConfirm: false,
|
||||
// closeOnCancel: false,
|
||||
// allowOutsideClick: false
|
||||
// }, function () {
|
||||
// window.location.href = '/origami/sale/'+ sale_id +"/"+cashier_type+"/payment";
|
||||
// });
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
// };
|
||||
</script>
|
||||
@@ -265,6 +265,20 @@
|
||||
<div class="col-md-4" id="unionpaycount"><%= number_with_precision(0, precision: precision.to_i ) %></div>
|
||||
</div>
|
||||
<% end %>
|
||||
<!-- Junction Pay -->
|
||||
<% if @junctionpaycount != 0.0 %>
|
||||
<div class="row payment others-color">
|
||||
<div class="col-md-5"></div>
|
||||
<div class="col-md-3">JUNCTION PAY</div>
|
||||
<div class="col-md-4 master is_card" id="junctionpaycount"><%= number_with_precision(@junctionpaycount, precision: precision.to_i ) rescue number_with_precision(0, precision: precision.to_i ) %></div>
|
||||
</div>
|
||||
<% else %>
|
||||
<div class="row hidden">
|
||||
<div class="col-md-5"></div>
|
||||
<div class="col-md-3">JUNCTION PAY</div>
|
||||
<div class="col-md-4" id="junctionpaycount"><%= number_with_precision(0, precision: precision.to_i ) %></div>
|
||||
</div>
|
||||
<% end %>
|
||||
<div class="row m-l-5 m-r-5">
|
||||
<div class="col-md-8"><strong>Balance</strong></div>
|
||||
<div class="col-md-4"><strong><span id='balance'><%= number_with_precision(@sale_data.grand_total, precision: precision.to_i ) rescue number_with_precision(0, precision: precision.to_i ) %></span></strong></div>
|
||||
@@ -488,10 +502,7 @@ var customer_name = "<%= @customer.name %>";
|
||||
payment_type = '';
|
||||
|
||||
if ($("#server_mode").val() != "cloud") { // first bill not used in cloud
|
||||
console.log("ssssssssssss")
|
||||
payment_type = checkReceiptNoInFirstBillData(receipt_no,"payment");
|
||||
console.log(member_id);
|
||||
console.log(member_discount);
|
||||
if (member_id && member_discount) {
|
||||
if(parseInt(jQuery.inArray("Credit", payment_type)) == -1){
|
||||
$("#credit_payment").hide();
|
||||
@@ -499,7 +510,7 @@ var customer_name = "<%= @customer.name %>";
|
||||
$("#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 || parseInt(jQuery.inArray("Redeem", 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("JUNCTIONPAY", payment_type)) !=-1){
|
||||
$("#card_payment").show();
|
||||
} else{
|
||||
$("#card_payment").hide();
|
||||
@@ -562,6 +573,9 @@ var customer_name = "<%= @customer.name %>";
|
||||
else if(payment_type == "UNIONPAY" && $('#unionpaycount').text()==0 && sub_total != 0.0){
|
||||
swal("Oops","Please Pay with UNIONPAY Payment","warning");
|
||||
}
|
||||
else if(payment_type == "JUNCTIONPAY" && $('#junctionpaycount').text()==0 && sub_total != 0.0){
|
||||
swal("Oops","Please Pay with JUNCTIONPAY Payment","warning");
|
||||
}
|
||||
else if(payment_type == "Credit" && $('#credit').text()==0 && sub_total != 0.0){
|
||||
swal("Oops","Please Pay with Credit Payment","warning");
|
||||
}else{
|
||||
@@ -837,7 +851,8 @@ var customer_name = "<%= @customer.name %>";
|
||||
var jcb1 = $('#jcbcount').text();
|
||||
var master1 = $('#mastercount').text();
|
||||
var unionpay1 = $('#unionpaycount').text();
|
||||
var othertotal = parseFloat(credit1) + parseFloat(card1) + parseFloat(paypar1) + parseFloat(visa1) + parseFloat(jcb1) + parseFloat(master1) + parseFloat(unionpay1);
|
||||
var junctionpay1 = $('#junctionpaycount').text();
|
||||
var othertotal = parseFloat(credit1) + parseFloat(card1) + parseFloat(paypar1) + parseFloat(visa1) + parseFloat(jcb1) + parseFloat(master1) + parseFloat(unionpay1) + parseFloat(junctionpay1);
|
||||
var total = $('#amount_due').text();
|
||||
var amt = 0;
|
||||
<% if precision.to_i > 0 %>;
|
||||
@@ -865,8 +880,9 @@ var customer_name = "<%= @customer.name %>";
|
||||
var jcb = $('#jcbcount').text();
|
||||
var master = $('#mastercount').text();
|
||||
var unionpay = $('#unionpaycount').text();
|
||||
var junctionpay = $('#junctionpaycount').text();
|
||||
var amount_due = $('#amount_due').text();
|
||||
var total = parseFloat(cash) + parseFloat(credit) + parseFloat(card) + parseFloat(paypar) + parseFloat(visa) + parseFloat(jcb) + parseFloat(master) + parseFloat(unionpay)
|
||||
var total = parseFloat(cash) + parseFloat(credit) + parseFloat(card) + parseFloat(paypar) + parseFloat(visa) + parseFloat(jcb) + parseFloat(master) + parseFloat(unionpay) + parseFloat(junctionpay)
|
||||
var result = parseFloat(amount_due) - parseFloat(total);
|
||||
<% if precision.to_i > 0 %>
|
||||
$('#balance').text(parseFloat(result).toFixed(<%= precision %>));
|
||||
|
||||
10
app/views/origami/pending_order/show.html.erb
Executable file → Normal file
10
app/views/origami/pending_order/show.html.erb
Executable file → Normal file
@@ -100,7 +100,7 @@
|
||||
@order_items.each do |order_item|
|
||||
sub_total = sub_total + order_item.price %>
|
||||
<input type="hidden" id="sale_id" value="<%= @bookings.booking_id %>">
|
||||
<tr>
|
||||
<tr class="edit_order" data-id='<%= order_item.order_items_id %>'>
|
||||
<td class='item-name'><%= order_item.item_name %></td>
|
||||
<td class='item-attr'><%= order_item.qty %></td>
|
||||
<td class='item-attr'><%= order_item.price %></td>
|
||||
@@ -289,5 +289,13 @@ $(document).ready(function(){
|
||||
window.location.href = linkURL;
|
||||
});
|
||||
}
|
||||
|
||||
/*edit order in oqs*/
|
||||
$('.edit_order').on('click',function(){
|
||||
var assigned_order_item_id = $(this).attr('data-id');
|
||||
if((assigned_order_item_id!=undefined) && (assigned_order_item_id!='')){
|
||||
window.location.href = '/oqs/'+ assigned_order_item_id + "/edit/pending";
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
9
app/views/origami/split_bill/index.html.erb
Executable file → Normal file
9
app/views/origami/split_bill/index.html.erb
Executable file → Normal file
@@ -53,12 +53,14 @@
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<% order_item_count = 0 %>
|
||||
<% if !@order_items.nil? %>
|
||||
<% sub_total = 0 %>
|
||||
<% @order_items.each do |order_item| %>
|
||||
<% if order_item.include? ('all_order') %>
|
||||
<% order_item['all_order'].each do |odr_item| %>
|
||||
<%
|
||||
order_item_count = order_item_count.to_i + 1
|
||||
sub_total += odr_item['qty'].to_f * odr_item['price'].to_f
|
||||
%>
|
||||
<tr class="item-row" id=<%= odr_item['order_items_id'] %> >
|
||||
@@ -385,10 +387,9 @@
|
||||
|
||||
//order_item_split
|
||||
$('#order_item_split').on('click',function () {
|
||||
var cnt_order_item = "<%= @order_items.count %>";
|
||||
var cnt_order_item = "<%= order_item_count %>";
|
||||
var order_items = get_selected_order_items();// Selected Order Items
|
||||
|
||||
var cnt_items = parseInt(cnt_order_item - 1) - parseInt(order_items.length);
|
||||
var cnt_items = parseInt(cnt_order_item) - parseInt(order_items.length);
|
||||
if (order_items.length > 0){
|
||||
// if(cnt_items > 0){
|
||||
swal({
|
||||
@@ -423,6 +424,7 @@
|
||||
$.each(orders, function(key,value){
|
||||
if($("a[href$='#"+value.order_id+"']").parent().hasClass('selected-split-item')){
|
||||
$("a[href$='#"+value.order_id+"']").parent().removeClass('selected-split-item');
|
||||
$(".item-row").removeClass('selected-split-item');
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -621,6 +623,7 @@ function orderItemSplitBillProcess(cnt_items){
|
||||
if(cnt_items == 0){
|
||||
booking_id = json_booking.booking_id;
|
||||
}
|
||||
console.log(booking_id);
|
||||
|
||||
var order_ids = [];
|
||||
var arr_order_ids = [];
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
<%= f.input :template %>
|
||||
<%= f.input :font %>
|
||||
<%= f.input :printer_name, :as => :select, :collection => Printer::PrinterWorker.printers, include_blank: false %>
|
||||
<%= f.input :brand_name %>
|
||||
<%= f.input :printer_type %>
|
||||
<%= f.input :api_settings %>
|
||||
<%= f.input :page_width %>
|
||||
<%= f.input :page_height %>
|
||||
@@ -61,6 +63,22 @@
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).ready(function(){
|
||||
|
||||
// if selected printer change call and bind
|
||||
$("#print_setting_printer_name").on("change", function(){
|
||||
var printer_name = $(this).val();
|
||||
$.ajax({
|
||||
type: "GET",
|
||||
url: "/get_printer_options/"+printer_name,
|
||||
success:function(result){
|
||||
$("#print_setting_brand_name").val(result.model);
|
||||
$("#print_setting_api_settings").val(result.url);
|
||||
}
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
function isNumberKey(evt) {
|
||||
var charCode = (evt.which) ? evt.which : event.keyCode;
|
||||
if (charCode != 46 && charCode > 31 && (charCode < 48 || charCode > 57)) {
|
||||
|
||||
@@ -1,2 +1,2 @@
|
||||
json.extract! print_setting, :id, :name, :unique_code, :template, :printer_name, :font, :api_settings, :page_width, :page_height, :print_copies, :created_at, :updated_at
|
||||
json.extract! print_setting, :id, :name, :unique_code, :template, :printer_name, :brand_name, :printer_type, :font, :api_settings, :page_width, :page_height, :print_copies, :created_at, :updated_at
|
||||
json.url print_setting_url(print_setting, format: :json)
|
||||
|
||||
@@ -30,6 +30,14 @@
|
||||
<th><%= t("views.right_panel.detail.printer_name") %></th>
|
||||
<td><%= @print_setting.printer_name %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><%= t("views.right_panel.detail.brand_name") %></th>
|
||||
<td><%= @print_setting.brand_name %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><%= t("views.right_panel.detail.printer_type") %></th>
|
||||
<td><%= @print_setting.printer_type %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th><%= t("views.right_panel.detail.font") %></th>
|
||||
<td><%= @print_setting.font rescue '-' %></td>
|
||||
|
||||
@@ -8,14 +8,16 @@
|
||||
<%= f.error_notification %>
|
||||
|
||||
<div class="form-inputs p-l-15">
|
||||
<%= f.input :name %>
|
||||
<%= f.input :group_type, :collection => Lookup.collection_of("tax_profiles"),:input_html=>{:class=>"col-md-10"},:required=>true %>
|
||||
<%= f.input :name, :input_html=>{:onchange=>"checkDuplicate(this.value);"} %>
|
||||
<span id="tax_profile_nameErr" style="color:red;"></span>
|
||||
<%= f.input :rate %>
|
||||
<%= f.input :inclusive %>
|
||||
<%= f.input :order_by %>
|
||||
</div>
|
||||
|
||||
<div class="form-actions p-l-15">
|
||||
<%= f.submit "Submit",:class => 'btn btn-primary btn-lg waves-effect' %>
|
||||
<%= f.submit "Submit",:class => 'btn btn-primary btn-lg waves-effect btn_submit' %>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
@@ -45,5 +47,25 @@
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
<script type="text/javascript">
|
||||
function checkDuplicate(obj){
|
||||
// $("#tax_profile_nameErr").html("");
|
||||
var name = '<%= @name %>';
|
||||
var tax_profiles = JSON.parse('<%= @tax_profiles.to_json.html_safe %>');
|
||||
var group_type = $("#tax_profile_group_type").val();
|
||||
if(tax_profiles!=undefined && tax_profiles!=null && tax_profiles!=""){
|
||||
$.each(tax_profiles,function(key,value){
|
||||
if(value.group_type == group_type){
|
||||
if(name.trim().toLowerCase()!=value.name.trim().toLowerCase()){
|
||||
if(value.name.trim().toLowerCase() == obj.trim().toLowerCase()){
|
||||
$("#tax_profile_name").val("");
|
||||
$("#tax_profile_nameErr").html("duplicate group type and name");
|
||||
}
|
||||
}
|
||||
return;
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
<table class="table">
|
||||
<thead>
|
||||
<tr>
|
||||
<th><%= t("views.right_panel.detail.group_type") %></th>
|
||||
<th><%= t("views.right_panel.detail.name") %></th>
|
||||
<th><%= t("views.right_panel.detail.rate") %></th>
|
||||
<th><%= t("views.right_panel.detail.inclusive") %></th>
|
||||
@@ -29,6 +30,7 @@
|
||||
<tbody>
|
||||
<% @settings_tax_profiles.each do |settings_tax_profile| %>
|
||||
<tr>
|
||||
<td><%= settings_tax_profile.group_type %></td>
|
||||
<td><%= settings_tax_profile.name %></td>
|
||||
<td><%= settings_tax_profile.rate %></td>
|
||||
<td><%= settings_tax_profile.inclusive %></td>
|
||||
|
||||
@@ -15,6 +15,11 @@
|
||||
<div class="card-block">
|
||||
<h4 class="card-title"><%= t("en.tax_profile") %></h4>
|
||||
<table class="table">
|
||||
<tr>
|
||||
<td><strong><%= t("views.right_panel.detail.group_type") %>:</strong></td>
|
||||
<td><%= @settings_tax_profile.group_type %></td>
|
||||
</tr>
|
||||
|
||||
<tr>
|
||||
<td><strong><%= t("views.right_panel.detail.name") %>:</strong></td>
|
||||
<td><%= @settings_tax_profile.name %></td>
|
||||
|
||||
Reference in New Issue
Block a user