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

This commit is contained in:
phyusin
2018-08-02 11:55:14 +06:30
21 changed files with 236 additions and 68 deletions

View File

@@ -0,0 +1,30 @@
class Api::SoundEffectController < Api::ApiController
#sound effect / alarm api for doemal side calling
def sound_effect
shop = Shop.find_by_id(1)
if !shop.nil?
shop_code = shop.shop_code
order_audio = DisplayImage.find_by_shop_id_and_name(shop.id, "order_audio")
if !order_audio.nil?
audio = order_audio.image
end
else
shop_code = nil
audio = nil
end
if !shop_code.nil? && !audio.nil?
if ENV["SERVER_MODE"] == 'cloud'
from = request.subdomain + "." + request.domain
else
from = ""
end
ActionCable.server.broadcast "sound_effect_channel",data: {status: params[:status], message: params[:message]},shop_code: shop_code,from:from,audio:audio
else
render :json => { :status => true, :message => "Something wrongs!" }
end
end
#sound effect / alarm api for doemal side calling
end

View File

@@ -126,8 +126,11 @@ class HomeController < ApplicationController
if !employee_sales.nil?
employee_sales.each do |emp|
emp_data = []
emp_data.push([emp.e_name, emp.payment_amount])
@employee_sales.push({'name' => emp.payment_method, 'data' => emp_data})
if emp.payment_amount > 0
emp_data.push([emp.e_name, emp.payment_amount])
@employee_sales.push({'name' => emp.payment_method, 'data' => emp_data})
end
end
end
@inventories = StockJournal.inventory_balances(today,@from,@to,@from_time,@to_time).sum(:balance)

View File

@@ -241,7 +241,7 @@ class Origami::PaymentsController < BaseOrigamiController
sale_id = params[:sale_id]
@cashier_type = params[:type]
if path.include? ("credit_payment")
@sale_payment = SalePayment.get_credit_total_left(sale_id)
@sale_payment = SalePayment.get_credit_amount_due_left(sale_id)
end
@member_discount = MembershipSetting.find_by_discount(1)