others payment
This commit is contained in:
@@ -1,10 +0,0 @@
|
|||||||
class Origami::CardPaymentsController < BaseOrigamiController
|
|
||||||
|
|
||||||
|
|
||||||
def index
|
|
||||||
end
|
|
||||||
|
|
||||||
def create
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
|
||||||
10
app/controllers/origami/others_payments_controller.rb
Normal file
10
app/controllers/origami/others_payments_controller.rb
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
class Origami::OthersPaymentsController < BaseOrigamiController
|
||||||
|
|
||||||
|
|
||||||
|
def index
|
||||||
|
end
|
||||||
|
|
||||||
|
def create
|
||||||
|
end
|
||||||
|
|
||||||
|
end
|
||||||
@@ -5,13 +5,17 @@ class Origami::PaymentsController < BaseOrigamiController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def create
|
def create
|
||||||
#payment type
|
cash = params[:cash]
|
||||||
#sale status
|
card = params[:card]
|
||||||
#point - get [ food amount ]
|
|
||||||
|
#process_payment(invoice, action_by)
|
||||||
end
|
end
|
||||||
|
|
||||||
def show
|
def show
|
||||||
|
sale_id = params[:sale_id]
|
||||||
|
if Sale.exists?(sale_id)
|
||||||
|
@sale_data = Sale.find_by_sale_id(sale_id)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -26,12 +26,4 @@ class Origami::RequestBillsController < BaseOrigamiController
|
|||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
def show
|
|
||||||
sale_id = params[:sale_id]
|
|
||||||
if Sale.exists?(sale_id)
|
|
||||||
@sale_data = Sale.find_by_sale_id(sale_id)
|
|
||||||
end
|
|
||||||
end
|
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -87,7 +87,7 @@
|
|||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
<div class="row" id="card_payment">
|
<div class="row" id="card_payment">
|
||||||
<div class="col-md-8">CARD</div>
|
<div class="col-md-8">OTHERS PAYMENT</div>
|
||||||
<div class="col-md-4">0.0</div>
|
<div class="col-md-4">0.0</div>
|
||||||
</div>
|
</div>
|
||||||
<hr>
|
<hr>
|
||||||
@@ -150,8 +150,8 @@
|
|||||||
<div class="col-md-7">
|
<div class="col-md-7">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-3 cashier_number"></div>
|
<div class="col-md-3 cashier_number"></div>
|
||||||
<div class="col-md-3 cashier_number red">DEL</div>
|
<div class="col-md-3 cashier_number red" data-type="del">DEL</div>
|
||||||
<div class="col-md-3 cashier_number green">CLR</div>
|
<div class="col-md-3 cashier_number green" data-type="clr">CLR</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-md-5">
|
<div class="col-md-5">
|
||||||
@@ -191,6 +191,10 @@ $(document).on('click', '.cashier_number', function(event){
|
|||||||
update_balance();
|
update_balance();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'clr':
|
||||||
|
$('#cash').text("0.0");
|
||||||
|
update_balance();
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
event.handled = true;
|
event.handled = true;
|
||||||
} else {
|
} else {
|
||||||
@@ -207,16 +211,28 @@ $( document ).ready(function() {
|
|||||||
|
|
||||||
$('#card_payment').click(function() {
|
$('#card_payment').click(function() {
|
||||||
var sale_id = $('#sale_id').text();
|
var sale_id = $('#sale_id').text();
|
||||||
window.location.href = '/origami/sale/'+ sale_id + "/payment/card_payment"
|
window.location.href = '/origami/sale/'+ sale_id + "/payment/others_payment"
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
$('#pay').click(function() {
|
$('#pay').click(function() {
|
||||||
console.log("pay")
|
|
||||||
if($('#amount_due').text() > 0){
|
if($('#balance').text() > 0){
|
||||||
console.log("greater")
|
alert(" Insufficient Amount!")
|
||||||
}else{
|
}else{
|
||||||
console.log("less")
|
// payment
|
||||||
|
var cash = $('#cash').text();
|
||||||
|
var credit = $('#credit').text();
|
||||||
|
var card = $('#card').text();
|
||||||
|
|
||||||
|
$.ajax({type: "POST",
|
||||||
|
url: "<%= origami_payment_process_path %>",
|
||||||
|
data: "cash="+ cash,
|
||||||
|
success:function(result){
|
||||||
|
alert("THANK YOU")
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
@@ -68,14 +68,16 @@ Rails.application.routes.draw do
|
|||||||
namespace :origami do
|
namespace :origami do
|
||||||
root "home#index"
|
root "home#index"
|
||||||
get "/:booking_id" => "home#show" do #origami/:booking_id will show
|
get "/:booking_id" => "home#show" do #origami/:booking_id will show
|
||||||
resources :payments, only: [:index, :new, :create ] #add payment by payment_method
|
|
||||||
resources :discounts, only: [:index,:new, :create ] #add discount type
|
resources :discounts, only: [:index,:new, :create ] #add discount type
|
||||||
resources :customers, only: [:index,:new, :create ] #add customer type
|
resources :customers, only: [:index,:new, :create ] #add customer type
|
||||||
end
|
end
|
||||||
# resources :request_bills, only: [:show]
|
|
||||||
get 'sale/:sale_id/payment' => 'request_bills#show'
|
get 'sale/:sale_id/payment' => 'payments#show'
|
||||||
|
post 'payment_process' => 'payments#create'
|
||||||
|
|
||||||
get 'sale/:sale_id/payment/credit_payment' => "credit_payments#index"
|
get 'sale/:sale_id/payment/credit_payment' => "credit_payments#index"
|
||||||
get 'sale/:sale_id/payment/card_payment' => "card_payments#index"
|
get 'sale/:sale_id/payment/others_payment' => "others_payments#index"
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
#--------- Waiter/Ordering Station ------------#
|
#--------- Waiter/Ordering Station ------------#
|
||||||
|
|||||||
Reference in New Issue
Block a user