update quick service for payment
This commit is contained in:
@@ -797,7 +797,7 @@ $(function() {
|
||||
success:function(result){
|
||||
console.log(result)
|
||||
if (result.status) {
|
||||
window.location.href = "/origami/sale/"+result.data["sale_id"]+"/payment"
|
||||
window.location.href = "/origami/sale/"+result.data["sale_id"]+"/"+type+"/payment"
|
||||
}
|
||||
// window.location.href = "/origami/quick_service"
|
||||
}
|
||||
|
||||
@@ -136,9 +136,6 @@ class Origami::AddordersController < ApplicationController#BaseOrigamiController
|
||||
@status, @sale = Sale.request_bill(@order,current_user,current_login_employee)
|
||||
result = {:status=> @status, :data => @sale }
|
||||
render :json => result.to_json
|
||||
puts @status
|
||||
puts @sale.to_json
|
||||
puts "ssssssssssssssssssss"
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
class Origami::CreditPaymentsController < BaseOrigamiController
|
||||
def index
|
||||
@sale_id = params[:sale_id]
|
||||
@cashier_type = params[:type]
|
||||
|
||||
# limit visa_amount
|
||||
sale_data = Sale.find_by_sale_id(@sale_id)
|
||||
|
||||
@@ -2,7 +2,7 @@ class Origami::JcbController < BaseOrigamiController
|
||||
|
||||
def index
|
||||
@sale_id = params[:sale_id]
|
||||
|
||||
@cashier_type = params[:type]
|
||||
# limit jcb_amount
|
||||
sale_data = Sale.find_by_sale_id(@sale_id)
|
||||
total = sale_data.grand_total
|
||||
|
||||
@@ -2,7 +2,7 @@ class Origami::MasterController < BaseOrigamiController
|
||||
|
||||
def index
|
||||
@sale_id = params[:sale_id]
|
||||
|
||||
@cashier_type = params[:type]
|
||||
# limit master_amount
|
||||
sale_data = Sale.find_by_sale_id(@sale_id)
|
||||
total = sale_data.grand_total
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
class Origami::MpuController < BaseOrigamiController
|
||||
def index
|
||||
@sale_id = params[:sale_id]
|
||||
|
||||
@cashier_type = params[:type]
|
||||
# limit mpu_amount
|
||||
sale_data = Sale.find_by_sale_id(@sale_id)
|
||||
total = sale_data.grand_total
|
||||
|
||||
@@ -2,6 +2,7 @@ class Origami::OthersPaymentsController < BaseOrigamiController
|
||||
def index
|
||||
@membership_rebate_balance = 0
|
||||
@sale_id = params[:sale_id]
|
||||
@cashier_type = params[:type]
|
||||
@payment_method_setting = PaymentMethodSetting.all
|
||||
|
||||
@rebate = MembershipSetting.find_by_rebate(1)
|
||||
|
||||
@@ -146,6 +146,7 @@ class Origami::PaymentsController < BaseOrigamiController
|
||||
|
||||
def show
|
||||
sale_id = params[:sale_id]
|
||||
@cashier_type = params[:type]
|
||||
|
||||
@member_discount = MembershipSetting.find_by_discount(1)
|
||||
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
class Origami::PayparPaymentsController < BaseOrigamiController
|
||||
def create
|
||||
sale_id = params[:sale_id]
|
||||
@cashier_type = params[:type]
|
||||
redeem_amount = params[:redeem_amount]
|
||||
membership_id = params[:membership_id]
|
||||
payment_method = "paypar"
|
||||
|
||||
@@ -2,6 +2,7 @@ class Origami::RedeemPaymentsController < BaseOrigamiController
|
||||
def index
|
||||
@sale_id = params[:sale_id]
|
||||
payment_method = params[:payment_method]
|
||||
@cashier_type = params[:type]
|
||||
@membership_rebate_balance=0
|
||||
sale_data = Sale.find_by_sale_id(@sale_id)
|
||||
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
class Origami::UnionpayController < BaseOrigamiController
|
||||
def index
|
||||
@sale_id = params[:sale_id]
|
||||
|
||||
@cashier_type = params[:type]
|
||||
# limit unionpay_amount
|
||||
sale_data = Sale.find_by_sale_id(@sale_id)
|
||||
total = sale_data.grand_total
|
||||
@@ -23,8 +23,6 @@ class Origami::UnionpayController < BaseOrigamiController
|
||||
others = others + sale_payment.payment_amount
|
||||
end
|
||||
end
|
||||
puts "unionpaycount"
|
||||
puts @unionpaycount
|
||||
@can_unionpay = total - @unionpaycount - others
|
||||
@member_discount = MembershipSetting.find_by_discount(1)
|
||||
@sub_total = sale_data.total_amount
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
class Origami::VisaController < BaseOrigamiController
|
||||
def index
|
||||
@sale_id = params[:sale_id]
|
||||
|
||||
@cashier_type = params[:type]
|
||||
# limit visa_amount
|
||||
sale_data = Sale.find_by_sale_id(@sale_id)
|
||||
total = sale_data.grand_total
|
||||
|
||||
@@ -115,6 +115,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<span id="cashier_type" class="hidden"><%=@cashier_type%></span>
|
||||
<script>
|
||||
$(document).ready(function() {
|
||||
if(localStorage.getItem("cash") == null || localStorage.getItem("cash") == 'null'){}
|
||||
@@ -122,6 +123,7 @@
|
||||
$('#validamount').attr("value",parseFloat("<%= @can_credit %>") - parseFloat(localStorage.getItem("cash")));
|
||||
}
|
||||
});
|
||||
cashier_type = $('#cashier_type').text();
|
||||
$(document).on('click', '.cashier_number', function(event){
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
@@ -165,6 +167,7 @@
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
$('#credit_pay').on('click',function(){
|
||||
var amount = $('#amount').text();
|
||||
var sale_id = "<%= @sale_id %>";
|
||||
@@ -184,7 +187,7 @@
|
||||
closeOnCancel: false,
|
||||
allowOutsideClick: false
|
||||
}, function () {
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/payment";
|
||||
window.location.href = '/origami/sale/'+ sale_id +"/"+ cashier_type + "/payment";
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -665,7 +665,7 @@
|
||||
|
||||
$('#pay').on('click', function () {
|
||||
var sale_id = $('#sale_id').val();
|
||||
window.location.href = '/origami/sale/' + sale_id + "/payment";
|
||||
window.location.href = '/origami/sale/' + sale_id + "/cashier/payment";
|
||||
});
|
||||
|
||||
// Bill Request
|
||||
|
||||
@@ -119,6 +119,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var cashier_type = "<%= @cashier_type %>";
|
||||
$(document).ready(function() {
|
||||
var sale_id = "<%= @sale_id %>";
|
||||
var bank_integration = "<%= @bank_integration %>";
|
||||
@@ -140,7 +141,7 @@
|
||||
closeOnCancel: false,
|
||||
allowOutsideClick: false
|
||||
}, function () {
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/payment/others_payment";
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/"+cashier_type+"/payment/others_payment";
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -228,7 +229,7 @@ $('#jcb_pay').on('click',function(){
|
||||
closeOnCancel: false,
|
||||
allowOutsideClick: false
|
||||
}, function () {
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/payment";
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/"+cashier_type+"/payment";
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,6 +120,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var cashier_type = "<%= @cashier_type %>";
|
||||
$(document).ready(function() {
|
||||
var sale_id = "<%= @sale_id %>";
|
||||
var bank_integration = "<%= @bank_integration %>";
|
||||
@@ -141,7 +142,7 @@
|
||||
closeOnCancel: false,
|
||||
allowOutsideClick: false
|
||||
}, function () {
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/payment/others_payment";
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/"+cashier_type+"/payment/others_payment";
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -226,7 +227,7 @@
|
||||
closeOnCancel: false,
|
||||
allowOutsideClick: false
|
||||
}, function () {
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/payment";
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/"+cashier_type+"/payment";
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -125,6 +125,7 @@
|
||||
$(document).ready(function() {
|
||||
var sale_id = "<%= @sale_id %>";
|
||||
var bank_integration = "<%= @bank_integration %>";
|
||||
var cashier_type = "<%= @cashier_type %>";
|
||||
if(localStorage.getItem("cash") == null || localStorage.getItem("cash") == 'null'){}
|
||||
else {
|
||||
$('#validamount').attr("value",parseFloat("<%= @can_mpu %>") - parseFloat(localStorage.getItem("cash")));
|
||||
@@ -143,7 +144,7 @@
|
||||
closeOnCancel: false,
|
||||
allowOutsideClick: false
|
||||
}, function () {
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/payment/others_payment";
|
||||
window.location.href = '/origami/sale/'+ sale_id +"/"+cashier_type+ "/payment/others_payment";
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -198,6 +199,7 @@
|
||||
var sale_id = "<%= @sale_id %>";
|
||||
var receipt_no = "<%= @receipt_no %>";
|
||||
var bank_integration = "<%= @bank_integration %>";
|
||||
var cashier_type = "<%= @cashier_type %>";
|
||||
if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) && amount > 0){
|
||||
$(this).off("click");
|
||||
//start member discount 5% by pay card
|
||||
@@ -230,7 +232,7 @@
|
||||
closeOnCancel: false,
|
||||
allowOutsideClick: false
|
||||
}, function () {
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/payment";
|
||||
window.location.href = '/origami/sale/'+ sale_id +"/"+cashier_type+ "/payment";
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
</span>
|
||||
</ol>
|
||||
</div> -->
|
||||
|
||||
<div class="row">
|
||||
<div class="col-lg-11col-md-11 col-sm-11">
|
||||
<div >
|
||||
@@ -29,6 +28,7 @@
|
||||
<input type="hidden" id="server_mode" value="<%= ENV["SERVER_MODE"] %>">
|
||||
<script type="text/javascript">
|
||||
/* start check first bill or not*/
|
||||
var cashier_type = "<%= @cashier_type %>";
|
||||
var receipt_no = "";
|
||||
if(($("#receipt_no").html()!=undefined) && ($("#receipt_no").html()!="")){
|
||||
receipt_no = ($("#receipt_no").html()).trim();
|
||||
@@ -47,7 +47,7 @@
|
||||
$('.others-payment').on('click',function(){
|
||||
var input_type = $(this).attr("data-type");
|
||||
var sale_id = $(this).attr("data-sale-id");
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/payment/others_payment/" + input_type;
|
||||
window.location.href = '/origami/sale/'+ sale_id +"/"+ cashier_type + "/payment/others_payment/" + input_type;
|
||||
})
|
||||
|
||||
$('#back').on('click',function(){
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
<div id="loading_wrapper" style="display:none;">
|
||||
<div id="loading"></div>
|
||||
</div>
|
||||
|
||||
<div class="row clearfix">
|
||||
<div class="col-lg-6 col-md-6 col-sm-6 col-xs-6">
|
||||
<div class="card">
|
||||
@@ -303,6 +302,7 @@
|
||||
</div>
|
||||
|
||||
<script>
|
||||
var cashier_type = "<%= @cashier_type %>";
|
||||
$(document).ready(function(){
|
||||
/* start check first bill or not*/
|
||||
var member_id = $('#membership_id').text();
|
||||
@@ -337,7 +337,12 @@
|
||||
|
||||
$("#back").on('click', function() {
|
||||
localStorage.removeItem('cash');
|
||||
window.location.href = '/origami/table/'+ dining_id;
|
||||
if (cashier_type=="cashier") {
|
||||
window.location.href = '/origami/table/'+ dining_id;
|
||||
}else{
|
||||
window.location.href = '/origami/quick_service';
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
if(localStorage.getItem("cash") == null || localStorage.getItem("cash") == 'null'){
|
||||
@@ -407,19 +412,20 @@
|
||||
});
|
||||
|
||||
$( document ).ready(function() {
|
||||
|
||||
// Disable click event cash to prevent
|
||||
$(".payment .cash-color").off('click');
|
||||
|
||||
$('#credit_payment').click(function() {
|
||||
var sale_id = $('#sale_id').text();
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/payment/credit_payment"
|
||||
window.location.href = '/origami/sale/'+ sale_id +"/"+cashier_type+"/payment/credit_payment"
|
||||
return false;
|
||||
});
|
||||
|
||||
$('#card_payment').click(function() {
|
||||
localStorage.setItem("cash",$('#cash').text() );
|
||||
var sale_id = $('#sale_id').text();
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/payment/others_payment"
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/"+cashier_type+"/payment/others_payment"
|
||||
return false;
|
||||
});
|
||||
|
||||
@@ -492,7 +498,11 @@
|
||||
closeOnCancel: false,
|
||||
allowOutsideClick: false
|
||||
}, function () {
|
||||
window.location.href = '/origami';
|
||||
if (cashier_type=="cashier") {
|
||||
window.location.href = '/origami';
|
||||
}else{
|
||||
window.location.href = '/origami/quick_service';
|
||||
}
|
||||
});
|
||||
}else{
|
||||
$('#pay').text("Pay");
|
||||
@@ -504,7 +514,11 @@
|
||||
closeOnCancel: false,
|
||||
allowOutsideClick: false
|
||||
}, function () {
|
||||
window.location.href = '/origami';
|
||||
if (cashier_type=="cashier") {
|
||||
window.location.href = '/origami';
|
||||
}else{
|
||||
window.location.href = '/origami/quick_service';
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -525,7 +539,11 @@
|
||||
type: 'POST',
|
||||
url: ajax_url,
|
||||
success: function () {
|
||||
window.location.href = '/origami/';
|
||||
if (cashier_type=="cashier") {
|
||||
window.location.href = '/origami';
|
||||
}else{
|
||||
window.location.href = '/origami/quick_service';
|
||||
}
|
||||
}
|
||||
})
|
||||
});
|
||||
@@ -573,7 +591,11 @@
|
||||
title: "Information!",
|
||||
text: 'Thank You !',
|
||||
}, function () {
|
||||
window.location.href = '/origami';
|
||||
if (cashier_type=="cashier") {
|
||||
window.location.href = '/origami';
|
||||
}else{
|
||||
window.location.href = '/origami/quick_service';
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -108,6 +108,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<script type="text/javascript">
|
||||
var cashier_type = "<%= @cashier_type %>";
|
||||
$(document).ready(function() {
|
||||
if(localStorage.getItem("cash") == null || localStorage.getItem("cash") == 'null'){}
|
||||
else {
|
||||
@@ -185,7 +186,7 @@
|
||||
closeOnCancel: false,
|
||||
allowOutsideClick: false
|
||||
}, function () {
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/payment"
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/"+cashier_type+"/payment"
|
||||
});
|
||||
|
||||
}else{
|
||||
|
||||
@@ -669,7 +669,7 @@ $('#pay').on('click',function() {
|
||||
type: "POST",
|
||||
url: '/origami/sale/'+ sale_id + "/rounding_adj",
|
||||
success:function(result){
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/payment";
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/cashier/payment";
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -120,6 +120,8 @@
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var cashier_type = "<%= @cashier_type %>";
|
||||
|
||||
$(document).ready(function() {
|
||||
var sale_id = "<%= @sale_id %>";
|
||||
var bank_integration = "<%= @bank_integration %>";
|
||||
@@ -143,7 +145,7 @@
|
||||
closeOnCancel: false,
|
||||
allowOutsideClick: false
|
||||
}, function () {
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/payment/others_payment";
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/"+cashier_type+"/payment/others_payment";
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -230,7 +232,7 @@
|
||||
closeOnCancel: false,
|
||||
allowOutsideClick: false
|
||||
}, function () {
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/payment";
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/"+cashier_type+"/payment";
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -120,6 +120,7 @@
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
var cashier_type = "<%= @cashier_type %>";
|
||||
$(document).ready(function() {
|
||||
var sale_id = "<%= @sale_id %>";
|
||||
var bank_integration = "<%= @bank_integration %>";
|
||||
@@ -143,7 +144,7 @@
|
||||
closeOnCancel: false,
|
||||
allowOutsideClick: false
|
||||
}, function () {
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/payment/others_payment";
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/"+cashier_type+"/payment/others_payment";
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -232,7 +233,7 @@
|
||||
closeOnCancel: false,
|
||||
allowOutsideClick: false
|
||||
}, function () {
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/payment";
|
||||
window.location.href = '/origami/sale/'+ sale_id + "/"+cashier_type+"/payment";
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -84,8 +84,11 @@ scope "(:locale)", locale: /en|mm/ do
|
||||
|
||||
#--------- Cashier ------------#
|
||||
namespace :origami do
|
||||
get "dashboard" => "dashboard#index"
|
||||
get "dashboard" => "dashboard#index"
|
||||
|
||||
get "quick_service" => "quick_service#index"
|
||||
|
||||
# post '/:quick_service/create' => "quick_service#create", :defaults => { :format => 'json' }
|
||||
|
||||
resources :cash_ins, only: [:new, :create]
|
||||
resources :cash_outs, only: [:new, :create]
|
||||
@@ -154,7 +157,7 @@ scope "(:locale)", locale: /en|mm/ do
|
||||
#--------- Payment ------------#
|
||||
post 'sale/:sale_id/rounding_adj' => 'payments#rounding_adj', :as => "calculate_rouding_adjs"
|
||||
get 'sale/:sale_id/first_bill' => 'payments#first_bill', :defaults => {:format => 'json'}
|
||||
get 'sale/:sale_id/payment' => 'payments#show'
|
||||
get 'sale/:sale_id/:type/payment' => 'payments#show'
|
||||
|
||||
post 'payment/foc' => 'payments#foc', :defaults => {:format => 'json'}
|
||||
post 'payment/cash' => 'payments#create'
|
||||
@@ -167,15 +170,15 @@ scope "(:locale)", locale: /en|mm/ do
|
||||
post 'payment/credit' => 'credit_payments#create'
|
||||
post 'payment/voucher' => 'voucher_payments#create'
|
||||
|
||||
get 'sale/:sale_id/payment/credit_payment' => "credit_payments#index"
|
||||
get 'sale/:sale_id/payment/others_payment' => "others_payments#index"
|
||||
get 'sale/:sale_id/payment/others_payment/MPU' => "mpu#index"
|
||||
get 'sale/:sale_id/payment/others_payment/VISA' => "visa#index"
|
||||
get 'sale/:sale_id/payment/others_payment/Master' => "master#index"
|
||||
get 'sale/:sale_id/payment/others_payment/JCB' => "jcb#index"
|
||||
get 'sale/:sale_id/payment/others_payment/UNIONPAY' => "unionpay#index"
|
||||
get 'sale/:sale_id/payment/others_payment/Redeem' => "redeem_payments#index"
|
||||
get 'sale/:sale_id/payment/others_payment/Voucher' => "voucher#index"
|
||||
get 'sale/:sale_id/:type/payment/credit_payment' => "credit_payments#index"
|
||||
get 'sale/:sale_id/:type/payment/others_payment' => "others_payments#index"
|
||||
get 'sale/:sale_id/:type/payment/others_payment/MPU' => "mpu#index"
|
||||
get 'sale/:sale_id/:type/payment/others_payment/VISA' => "visa#index"
|
||||
get 'sale/:sale_id/:type/payment/others_payment/Master' => "master#index"
|
||||
get 'sale/:sale_id/:type/payment/others_payment/JCB' => "jcb#index"
|
||||
get 'sale/:sale_id/:type/payment/others_payment/UNIONPAY' => "unionpay#index"
|
||||
get 'sale/:sale_id/:type/payment/others_payment/Redeem' => "redeem_payments#index"
|
||||
get 'sale/:sale_id/:type/payment/others_payment/Voucher' => "voucher#index"
|
||||
|
||||
#---------Void --------------#
|
||||
post 'sale/:sale_id/void' => 'void#overall_void'
|
||||
@@ -222,6 +225,9 @@ scope "(:locale)", locale: /en|mm/ do
|
||||
post "bank_integration/settle_trans", to: "bank_integration#settle_trans", as:"settle_trans"
|
||||
post "bank_integration/sale_trans", to: "bank_integration#sale_trans", as:"sale_trans"
|
||||
|
||||
|
||||
|
||||
|
||||
end
|
||||
|
||||
#--------- Waiter/Ordering Station ------------#
|
||||
|
||||
Reference in New Issue
Block a user