overall void
This commit is contained in:
@@ -122,7 +122,6 @@ GEM
|
||||
nokogiri (1.8.0)
|
||||
mini_portile2 (~> 2.2.0)
|
||||
pdf-core (0.7.0)
|
||||
pg (0.21.0)
|
||||
prawn (2.2.2)
|
||||
pdf-core (~> 0.7.0)
|
||||
ttfunk (~> 1.5)
|
||||
@@ -261,7 +260,6 @@ DEPENDENCIES
|
||||
kaminari (~> 1.0.1)
|
||||
listen (~> 3.0.5)
|
||||
mysql2 (>= 0.3.18, < 0.5)
|
||||
pg
|
||||
prawn
|
||||
prawn-table
|
||||
puma (~> 3.0)
|
||||
|
||||
@@ -35,7 +35,7 @@ class Origami::HomeController < BaseOrigamiController
|
||||
@status_order = 'order'
|
||||
else
|
||||
sale = Sale.find(booking.sale_id)
|
||||
if sale.sale_status != "completed"
|
||||
if sale.sale_status != "completed" && sale.sale_status != 'void'
|
||||
puts "enter"
|
||||
@sale_array.push(sale)
|
||||
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" 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" class="btn btn-primary btn-block" > Void </button>
|
||||
<button type="button" id="void" class="btn btn-primary btn-block" > Void </button>
|
||||
<% end %>
|
||||
<!-- Cashier Buttons -->
|
||||
|
||||
@@ -455,4 +455,22 @@ $('#edit').on('click',function(){
|
||||
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>
|
||||
|
||||
@@ -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/Redeem' => "redeem_payments#index"
|
||||
|
||||
#---------Void --------------#
|
||||
post 'sale/:sale_id/void' => 'void#overall_void'
|
||||
|
||||
#---------Add Customer --------------#
|
||||
#resources :customers
|
||||
get '/:sale_id/customers', to: "customers#add_customer"
|
||||
|
||||
Reference in New Issue
Block a user