Merge branch 'master' of bitbucket.org:code2lab/sxrestaurant into adminbsb_ui_changes
This commit is contained in:
@@ -4,6 +4,25 @@ class Origami::DashboardController < BaseOrigamiController
|
|||||||
@shop = Shop.first
|
@shop = Shop.first
|
||||||
|
|
||||||
today = DateTime.now.strftime('%Y-%m-%d')
|
today = DateTime.now.strftime('%Y-%m-%d')
|
||||||
|
# @orders = Sale::where("payment_status='new' and sale_status='bill' and DATE_FORMAT(receipt_date,'%Y-%m-%d') = '#{today}'").count()
|
||||||
|
# @sales = Sale::where("payment_status='paid' and sale_status='completed' and DATE_FORMAT(receipt_date,'%Y-%m-%d') = '#{today}'").count()
|
||||||
|
|
||||||
|
# @top_products = Sale.top_products(today).sum('i.qty')
|
||||||
|
# @bottom_products = Sale.bottom_products(today).sum('i.qty')
|
||||||
|
# @hourly_sales = Sale.hourly_sales(today).sum(:grand_total)
|
||||||
|
# .group_by_hour(:created_at, :time_zone => 'Asia/Rangoon',format: '%I:%p')
|
||||||
|
# .sum(:grand_total)
|
||||||
|
# @employee_sales = Sale.employee_sales(today)
|
||||||
|
# .sum('(CASE WHEN sp.payment_method="cash" THEN (sp.payment_amount - sales.amount_changed) ELSE sp.payment_amount END)')
|
||||||
|
# @inventories = StockJournal.inventory_balances(today).sum(:balance)
|
||||||
|
|
||||||
|
# @total_sale = Sale.total_sale(today,current_user)
|
||||||
|
# @total_count = Sale.total_count(today,current_user)
|
||||||
|
# @total_card = Sale.total_card_sale(today,current_user)
|
||||||
|
# @total_credit = Sale.credit_payment(today,current_user)
|
||||||
|
|
||||||
|
@display_type = Lookup.find_by_lookup_type("display_type")
|
||||||
|
|
||||||
@sale_data = Array.new
|
@sale_data = Array.new
|
||||||
@total_payment_methods = Sale.total_payment_methods(today,current_user)
|
@total_payment_methods = Sale.total_payment_methods(today,current_user)
|
||||||
if !@total_payment_methods.nil?
|
if !@total_payment_methods.nil?
|
||||||
|
|||||||
@@ -219,7 +219,13 @@ $(function() {
|
|||||||
});
|
});
|
||||||
|
|
||||||
$(".qs_view").on('click', function() {
|
$(".qs_view").on('click', function() {
|
||||||
if ($('#server_mode').val() != "cloud") {
|
var display_type = '<%= @display_type %>';
|
||||||
|
if (display_type.length>0) {
|
||||||
|
display_type = '<%= @display_type %>';
|
||||||
|
}else{
|
||||||
|
display_type = null;
|
||||||
|
}
|
||||||
|
if ($('#server_mode').val() != "cloud" && display_type == 2) {
|
||||||
document.getElementById('second_view').click();
|
document.getElementById('second_view').click();
|
||||||
}
|
}
|
||||||
window.location.href = '/origami/quick_service';
|
window.location.href = '/origami/quick_service';
|
||||||
|
|||||||
Reference in New Issue
Block a user