change crm booking
This commit is contained in:
2
Gemfile
2
Gemfile
@@ -10,7 +10,7 @@ end
|
|||||||
gem 'rails', '~> 5.1.0'
|
gem 'rails', '~> 5.1.0'
|
||||||
# Use mysql as the database for Active Record
|
# Use mysql as the database for Active Record
|
||||||
|
|
||||||
gem 'mysql2', '>= 0.3.18', '< 0.5'
|
#gem 'mysql2', '>= 0.3.18', '< 0.5'
|
||||||
|
|
||||||
#Use PosgreSQL
|
#Use PosgreSQL
|
||||||
|
|
||||||
|
|||||||
@@ -119,7 +119,6 @@ GEM
|
|||||||
minitest (5.10.2)
|
minitest (5.10.2)
|
||||||
multi_json (1.12.1)
|
multi_json (1.12.1)
|
||||||
multi_xml (0.6.0)
|
multi_xml (0.6.0)
|
||||||
mysql2 (0.4.6)
|
|
||||||
nio4r (2.1.0)
|
nio4r (2.1.0)
|
||||||
nokogiri (1.7.2)
|
nokogiri (1.7.2)
|
||||||
mini_portile2 (~> 2.1.0)
|
mini_portile2 (~> 2.1.0)
|
||||||
@@ -259,7 +258,6 @@ DEPENDENCIES
|
|||||||
jquery-rails
|
jquery-rails
|
||||||
kaminari!
|
kaminari!
|
||||||
listen (~> 3.0.5)
|
listen (~> 3.0.5)
|
||||||
mysql2 (>= 0.3.18, < 0.5)
|
|
||||||
pg
|
pg
|
||||||
prawn
|
prawn
|
||||||
prawn-table
|
prawn-table
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
class Origami::RequestBillsController < BaseOrigamiController
|
class Origami::RequestBillsController < BaseOrigamiController
|
||||||
|
|
||||||
def create
|
def show
|
||||||
@sale = Sale.new
|
@sale = Sale.new
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -218,7 +218,6 @@ class Order < ApplicationRecord
|
|||||||
left join dining_facilities on dining_facilities.id = bookings.dining_facility_id
|
left join dining_facilities on dining_facilities.id = bookings.dining_facility_id
|
||||||
left join order_items on order_items.order_id = orders.order_id")
|
left join order_items on order_items.order_id = orders.order_id")
|
||||||
.where("dining_facilities.type=? and orders.order_type=? and dining_facilities.is_active=?",DiningFacility::TABLE_TYPE,"dine_in",true)
|
.where("dining_facilities.type=? and orders.order_type=? and dining_facilities.is_active=?",DiningFacility::TABLE_TYPE,"dine_in",true)
|
||||||
|
|
||||||
.group("orders.order_id, order_items.order_items_id,dining_facilities.name")
|
.group("orders.order_id, order_items.order_items_id,dining_facilities.name")
|
||||||
end
|
end
|
||||||
def self.get_booking_order_table
|
def self.get_booking_order_table
|
||||||
@@ -271,7 +270,6 @@ class Order < ApplicationRecord
|
|||||||
left join sale_orders on sale_orders.order_id = orders.order_id
|
left join sale_orders on sale_orders.order_id = orders.order_id
|
||||||
left join sales on sales.sale_id = sale_orders.sale_id")
|
left join sales on sales.sale_id = sale_orders.sale_id")
|
||||||
.where("dining_facilities.is_active=? and orders.date between ? and ?",true,from,to)
|
.where("dining_facilities.is_active=? and orders.date between ? and ?",true,from,to)
|
||||||
|
|
||||||
.group("orders.order_id,order_items.order_items_id,dining_facilities.name,sales.receipt_no,bookings.booking_id,sales.sale_id")
|
.group("orders.order_id,order_items.order_items_id,dining_facilities.name,sales.receipt_no,bookings.booking_id,sales.sale_id")
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
if (@booking)
|
if (@booking)
|
||||||
json.id @booking.booking_id
|
json.id @booking.booking_id
|
||||||
json.status @booking.booking_status
|
json.status @booking.booking_status
|
||||||
json.checkin_at @booking.checkin_at
|
json.checkin_at @booking.checkin_at.strftime("%d-%m-%Y")
|
||||||
json.checkin_by @booking.checkin_by
|
json.checkin_by @booking.checkin_by
|
||||||
json.table_name @booking.dining_facility.name
|
json.table_name @booking.dining_facility.name
|
||||||
|
|
||||||
@@ -17,9 +17,9 @@ if (@booking)
|
|||||||
order_items = []
|
order_items = []
|
||||||
@booking.booking_orders.each do |bo|
|
@booking.booking_orders.each do |bo|
|
||||||
order = Order.find(bo.order_id)
|
order = Order.find(bo.order_id)
|
||||||
if (order.status == "new")
|
#if (order.status == "new")
|
||||||
order_items = order_items + order.order_items
|
order_items = order_items + order.order_items
|
||||||
end
|
#end
|
||||||
end
|
end
|
||||||
|
|
||||||
json.order_items order_items do |item|
|
json.order_items order_items do |item|
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ $(function(){
|
|||||||
$(".summary-items tbody tr").remove();
|
$(".summary-items tbody tr").remove();
|
||||||
$("#cancel").removeAttr("disabled");
|
$("#cancel").removeAttr("disabled");
|
||||||
$("#assign").removeAttr("disabled");
|
$("#assign").removeAttr("disabled");
|
||||||
var url = $(this).attr('data-ref');alert(url);
|
var url = $(this).attr('data-ref');
|
||||||
show_details(url);
|
show_details(url);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
@@ -72,6 +72,9 @@ Rails.application.routes.draw do
|
|||||||
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'
|
get 'sale/:sale_id/payment' => 'payments#show'
|
||||||
post 'payment_process' => 'payments#create'
|
post 'payment_process' => 'payments#create'
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user