overall void
This commit is contained in:
@@ -122,7 +122,6 @@ GEM
|
|||||||
nokogiri (1.8.0)
|
nokogiri (1.8.0)
|
||||||
mini_portile2 (~> 2.2.0)
|
mini_portile2 (~> 2.2.0)
|
||||||
pdf-core (0.7.0)
|
pdf-core (0.7.0)
|
||||||
pg (0.21.0)
|
|
||||||
prawn (2.2.2)
|
prawn (2.2.2)
|
||||||
pdf-core (~> 0.7.0)
|
pdf-core (~> 0.7.0)
|
||||||
ttfunk (~> 1.5)
|
ttfunk (~> 1.5)
|
||||||
@@ -261,7 +260,6 @@ DEPENDENCIES
|
|||||||
kaminari (~> 1.0.1)
|
kaminari (~> 1.0.1)
|
||||||
listen (~> 3.0.5)
|
listen (~> 3.0.5)
|
||||||
mysql2 (>= 0.3.18, < 0.5)
|
mysql2 (>= 0.3.18, < 0.5)
|
||||||
pg
|
|
||||||
prawn
|
prawn
|
||||||
prawn-table
|
prawn-table
|
||||||
puma (~> 3.0)
|
puma (~> 3.0)
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ class Origami::HomeController < BaseOrigamiController
|
|||||||
@status_order = 'order'
|
@status_order = 'order'
|
||||||
else
|
else
|
||||||
sale = Sale.find(booking.sale_id)
|
sale = Sale.find(booking.sale_id)
|
||||||
if sale.sale_status != "completed"
|
if sale.sale_status != "completed" && sale.sale_status != 'void'
|
||||||
puts "enter"
|
puts "enter"
|
||||||
@sale_array.push(sale)
|
@sale_array.push(sale)
|
||||||
if @status_order == 'order'
|
if @status_order == 'order'
|
||||||
|
|||||||
@@ -288,7 +288,7 @@
|
|||||||
<button type="button" class="btn btn-primary btn-block" id='move' disabled="">Move</button>
|
<button type="button" class="btn btn-primary btn-block" id='move' disabled="">Move</button>
|
||||||
<button type="button" id="request_bills" class="btn btn-primary btn-block" disabled> Req.Bill</button>
|
<button type="button" id="request_bills" class="btn btn-primary btn-block" disabled> Req.Bill</button>
|
||||||
<button type="button" id="pay" class="btn btn-primary btn-block">Pay</button>
|
<button type="button" id="pay" class="btn btn-primary btn-block">Pay</button>
|
||||||
<button type="button" class="btn btn-primary btn-block" > Void </button>
|
<button type="button" id="void" class="btn btn-primary btn-block" > Void </button>
|
||||||
<% end %>
|
<% end %>
|
||||||
<!-- Cashier Buttons -->
|
<!-- Cashier Buttons -->
|
||||||
|
|
||||||
@@ -454,5 +454,23 @@ $('#edit').on('click',function(){
|
|||||||
var sale_id = "<%= @obj_sale.sale_id rescue "" %>"
|
var sale_id = "<%= @obj_sale.sale_id rescue "" %>"
|
||||||
window.location.href = '/origami/table/'+ dining_id + "/sale/"+ sale_id + "/edit";
|
window.location.href = '/origami/table/'+ dining_id + "/sale/"+ sale_id + "/edit";
|
||||||
})
|
})
|
||||||
|
|
||||||
|
$('#void').on('click',function () {
|
||||||
|
var sure = confirm("Are you sure want to Void");
|
||||||
|
if (sure == true) {
|
||||||
|
var sale_id = $('#sale_id').val();
|
||||||
|
var ajax_url = "/origami/sale/" + sale_id + '/void';
|
||||||
|
$.ajax({
|
||||||
|
type: 'POST',
|
||||||
|
url: ajax_url,
|
||||||
|
success: function () {
|
||||||
|
window.location.href = '/origami/';
|
||||||
|
}
|
||||||
|
})
|
||||||
|
} else {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
})
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -110,6 +110,9 @@ Rails.application.routes.draw do
|
|||||||
get 'sale/:sale_id/payment/others_payment/JCB' => "jcb#index"
|
get 'sale/:sale_id/payment/others_payment/JCB' => "jcb#index"
|
||||||
get 'sale/:sale_id/payment/others_payment/Redeem' => "redeem_payments#index"
|
get 'sale/:sale_id/payment/others_payment/Redeem' => "redeem_payments#index"
|
||||||
|
|
||||||
|
#---------Void --------------#
|
||||||
|
post 'sale/:sale_id/void' => 'void#overall_void'
|
||||||
|
|
||||||
#---------Add Customer --------------#
|
#---------Add Customer --------------#
|
||||||
#resources :customers
|
#resources :customers
|
||||||
get '/:sale_id/customers', to: "customers#add_customer"
|
get '/:sale_id/customers', to: "customers#add_customer"
|
||||||
|
|||||||
Reference in New Issue
Block a user