Merge branch 'crm' of bitbucket.org:code2lab/sxrestaurant
This commit is contained in:
@@ -7,7 +7,7 @@ class BaseOrigamiController < ActionController::Base
|
||||
|
||||
rescue_from CanCan::AccessDenied do |exception|
|
||||
flash[:warning] = exception.message
|
||||
redirect_to root_path
|
||||
redirect_to origami_root_path
|
||||
end
|
||||
|
||||
def current_user
|
||||
|
||||
@@ -96,6 +96,17 @@ class Crm::DiningQueuesController < BaseCrmController
|
||||
end
|
||||
end
|
||||
|
||||
def cancel_queue
|
||||
queue = DiningQueue.find(params[:id])
|
||||
|
||||
status = queue.update_attributes(id: params[:id],status:"Cancel")
|
||||
|
||||
if status == true
|
||||
render json: JSON.generate({:status => true , notice: 'Dining queue was successfully canceled .'})
|
||||
else
|
||||
render json: JSON.generate({:status => false, :error_message => "Record not found"})
|
||||
end
|
||||
end
|
||||
|
||||
private
|
||||
# Use callbacks to share common setup or constraints between actions.
|
||||
|
||||
@@ -9,7 +9,12 @@ class Origami::PaymentsController < BaseOrigamiController
|
||||
sale_data = Sale.find_by_sale_id(sale_id)
|
||||
sale_items = SaleItem.where("sale_id=?",sale_id)
|
||||
|
||||
new_total = Sale.get_rounding_adjustment(sale_data.grand_total)
|
||||
rounding_adj = sale_data.grand_total - new_total
|
||||
|
||||
sale_data.update_attributes(grand_total: new_total,rounding_adjustment:rounding_adj)
|
||||
# Print for First Bill to Customer
|
||||
|
||||
unique_code = "ReceiptBillPdf"
|
||||
#shop detail
|
||||
shop_details = Shop.find(1)
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class Origami::SaleEditController < BaseOrigamiController
|
||||
|
||||
authorize_resource :class => false
|
||||
# Index for sale item void OR edit
|
||||
def edit
|
||||
sale_id = params[:sale_id]
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
class Origami::VoidController < BaseOrigamiController
|
||||
|
||||
authorize_resource :class => false
|
||||
def overall_void
|
||||
|
||||
sale_id = params[:sale_id]
|
||||
|
||||
18
app/controllers/reports/shiftsale_controller.rb
Normal file
18
app/controllers/reports/shiftsale_controller.rb
Normal file
@@ -0,0 +1,18 @@
|
||||
class Reports::ShiftsaleController < ApplicationController
|
||||
# authorize_resource :class => false
|
||||
|
||||
def index
|
||||
|
||||
from, to, report_type = get_date_range_from_params
|
||||
@sale_data = Sale.get_by_shiftsales(from,to)
|
||||
respond_to do |format|
|
||||
format.html
|
||||
format.xls
|
||||
end
|
||||
end
|
||||
|
||||
def show
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user