change migration file
This commit is contained in:
@@ -38,11 +38,11 @@ class ApplicationController < ActionController::Base
|
|||||||
end
|
end
|
||||||
else
|
else
|
||||||
# check for license file
|
# check for license file
|
||||||
if check_license
|
# if check_license
|
||||||
current_license(ENV["SX_PROVISION_URL"])
|
# current_license(ENV["SX_PROVISION_URL"])
|
||||||
else
|
# else
|
||||||
redirect_to activate_path
|
# redirect_to activate_path
|
||||||
end
|
# end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -62,6 +62,9 @@ class HomeController < ApplicationController
|
|||||||
end
|
end
|
||||||
|
|
||||||
def dashboard
|
def dashboard
|
||||||
|
# puts "date range =>"
|
||||||
|
# puts get_date_range_from_params
|
||||||
|
|
||||||
@shop = Shop.first
|
@shop = Shop.first
|
||||||
|
|
||||||
today = DateTime.now.strftime('%Y-%m-%d')
|
today = DateTime.now.strftime('%Y-%m-%d')
|
||||||
@@ -162,4 +165,20 @@ class HomeController < ApplicationController
|
|||||||
redirect_to reports_dailysale_index_path
|
redirect_to reports_dailysale_index_path
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def get_date_range_from_params
|
||||||
|
from = params[:from]
|
||||||
|
to = params[:to]
|
||||||
|
|
||||||
|
if from.present? && to.present?
|
||||||
|
f_date = DateTime.parse(from)
|
||||||
|
t_date = DateTime.parse(to)
|
||||||
|
f_time = Time.mktime(f_date.year,f_date.month,f_date.day,f_date.hour,f_date.min,f_date.sec)
|
||||||
|
t_time = Time.mktime(t_date.year,t_date.month,t_date.day,t_date.hour,t_date.min,t_date.sec)
|
||||||
|
from = f_time.beginning_of_day.utc.getlocal
|
||||||
|
to = t_time.end_of_day.utc.getlocal
|
||||||
|
end
|
||||||
|
|
||||||
|
return from, to
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -67,11 +67,21 @@
|
|||||||
<!-- CPU Usage -->
|
<!-- CPU Usage -->
|
||||||
|
|
||||||
<!-- Date range for dashboard -->
|
<!-- Date range for dashboard -->
|
||||||
<div class="row">
|
<!-- <div class="row clearfix">
|
||||||
<div class="col-lg-12 col-md-12 col-sm-12">
|
<div class="col-lg-4 col-md-4 col-sm-4">
|
||||||
|
<label class="font-14"><%= t("views.right_panel.detail.from") %></label>
|
||||||
|
<input data-behaviour='datepicker' class="form-control datepicker" name="from" id="from" type="text" placeholder="From date" style="height: 35px;">
|
||||||
|
</div>
|
||||||
|
<div class="col-lg-4 col-md-4 col-sm-4">
|
||||||
|
<label class="font-14"><%= t("views.right_panel.detail.to") %></label>
|
||||||
|
<input data-behaviour='datepicker' class="form-control datepicker" name="to" id="to" type="text" placeholder="To date" style="height: 35px;">
|
||||||
|
</div>
|
||||||
|
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||||
|
<label></label><br>
|
||||||
|
<input type="button" value="Generate" class='btn btn-primary btn_generate'>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<br> -->
|
||||||
<!-- Date range for dashboard -->
|
<!-- Date range for dashboard -->
|
||||||
|
|
||||||
<div class="row">
|
<div class="row">
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ class CreateEmployees < ActiveRecord::Migration[5.1]
|
|||||||
t.datetime :session_expiry
|
t.datetime :session_expiry
|
||||||
t.datetime :session_last_login
|
t.datetime :session_last_login
|
||||||
t.string :created_by
|
t.string :created_by
|
||||||
|
t.string :image_path
|
||||||
t.timestamps
|
t.timestamps
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ class CreateCustomers < ActiveRecord::Migration[5.1]
|
|||||||
t.string :membership_authentication_code
|
t.string :membership_authentication_code
|
||||||
t.string :customer_type, :default => "Dinein"
|
t.string :customer_type, :default => "Dinein"
|
||||||
t.json :tax_profiles
|
t.json :tax_profiles
|
||||||
|
t.string :image_path
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ class CreateCommissioners < ActiveRecord::Migration[5.1]
|
|||||||
t.datetime :joined_date
|
t.datetime :joined_date
|
||||||
t.datetime :resigned_date
|
t.datetime :resigned_date
|
||||||
t.boolean :is_active, default: true
|
t.boolean :is_active, default: true
|
||||||
|
t.string :image_path
|
||||||
t.timestamps
|
t.timestamps
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,9 +0,0 @@
|
|||||||
class AddImagePathToEmployees < ActiveRecord::Migration[5.1]
|
|
||||||
def change
|
|
||||||
add_column :employees, :image_path, :string
|
|
||||||
end
|
|
||||||
|
|
||||||
def down
|
|
||||||
remove_column :image_path
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
class AddImagePathToCustomers < ActiveRecord::Migration[5.1]
|
|
||||||
def change
|
|
||||||
add_column :customers, :image_path, :string
|
|
||||||
end
|
|
||||||
|
|
||||||
def down
|
|
||||||
remove_column :image_path
|
|
||||||
end
|
|
||||||
end
|
|
||||||
@@ -1,9 +0,0 @@
|
|||||||
class AddImagePathToCommissioners < ActiveRecord::Migration[5.1]
|
|
||||||
def change
|
|
||||||
add_column :commissioners, :image_path, :string
|
|
||||||
end
|
|
||||||
|
|
||||||
def down
|
|
||||||
remove_column :image_path
|
|
||||||
end
|
|
||||||
end
|
|
||||||
Reference in New Issue
Block a user