Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant into adminbsb_ui_changes

This commit is contained in:
phyusin
2017-11-17 10:03:59 +06:30
25 changed files with 774 additions and 88 deletions

View File

@@ -33,7 +33,7 @@ class Crm::CustomersController < BaseCrmController
end
end
end
@crm_customers = Kaminari.paginate_array(@crm_customers).page(params[:page]).per(50)
@crm_customers = Kaminari.paginate_array(@crm_customers).page(params[:page]).per(15)
@crm_customer = Customer.new
@count_customer = Customer.count_customer
@@ -70,7 +70,7 @@ class Crm::CustomersController < BaseCrmController
#get customer amount
@customer = Customer.find(params[:id])
@response = Customer.get_membership_transactions(@customer)
puts @response.to_json
# @response = ""
#end customer amount

View File

@@ -7,6 +7,7 @@ class Crm::DiningQueuesController < BaseCrmController
def index
today = DateTime.now.strftime('%Y-%m-%d')
@dining_queues = DiningQueue.where("DATE_FORMAT(created_at,'%Y-%m-%d') = ? and status is NULL ", today).order("queue_no asc")
@complete_queue = DiningQueue.where("DATE_FORMAT(created_at,'%Y-%m-%d') = ? and status = 'Assign' ", today).order("queue_no asc")
end
# GET /crm/dining_queues/1

View File

@@ -215,7 +215,7 @@ class Origami::DiscountsController < BaseOrigamiController
else
response = {"status": false, "message": "You have no selected discount item" }
end
puts "discount"
puts "discountttttttttttt"
puts response.to_json
# Re-calc All Amount in Sale
if response["status"] == true

View File

@@ -9,6 +9,7 @@ class Origami::RequestBillsController < ApplicationController
order_id = params[:id] # order_id
bk_order = BookingOrder.find_by_order_id(order_id)
check_booking = Booking.find_by_booking_id(bk_order.booking_id)
if check_booking.sale_id.nil?
# Create Sale if it doesn't exist
# puts "current_login_employee"

View File

@@ -0,0 +1,61 @@
class Transactions::ShiftSalesController < ApplicationController
load_and_authorize_resource except: [:create]
before_action :set_transactions_shift_sale, only: [:show, :edit, :update, :destroy]
def index
filter = params[:filter]
from = params[:from]
to = params[:to]
if filter.nil? && from.nil? && to.nil?
@shift_sales = ShiftSale.all.order("id desc")
@shift_sales = Kaminari.paginate_array(@shift_sales).page(params[:page]).per(20)
else
shift_sale = ShiftSale.search(filter,from,to)
if shift_sale.count > 0
@shift_sales = shift_sale
@shift_sales = Kaminari.paginate_array(@shift_sales).page(params[:page]).per(20)
else
@shift_sales = 0
end
end
respond_to do |format|
format.html # index.html.erb
format.json { render json: @shift_sales }
end
end
# GET /transactions/shift_sales/1
# GET /transactions/shift_sales/1.json
def show
@shift = ShiftSale.find(params[:id])
#get tax
shift_obj = ShiftSale.where('id =?',@shift.id)
@sale_taxes = Sale.get_separate_tax(shift_obj,from=nil,to=nil,type='')
#other payment details for mpu or visa like card
@other_payment = ShiftSale.get_by_shift_other_payment(@shift)
# Calculate price_by_accounts
@total_amount_by_account = ShiftSale.calculate_total_price_by_accounts(@shift,'amount')
@total_discount_by_account = ShiftSale.calculate_total_price_by_accounts(@shift,'discount')
@total_member_discount = ShiftSale.get_total_member_discount(@shift)
respond_to do |format|
format.html # show.html.erb
format.json { render json: @shift }
end
end
private
# Use callbacks to share common setup or constraints between actions.
def set_transactions_shift_sale
@transactions_shift_sale = ShiftSale.find(params[:id])
end
end