Merge branch 'august_spring' of bitbucket.org:code2lab/sxrestaurant into august_spring
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -51,3 +51,6 @@ dump.rdb
|
||||
|
||||
# Fonts
|
||||
public/fonts/*
|
||||
|
||||
# Ruby-Mine IDE folder
|
||||
.idea
|
||||
|
||||
2
.idea/.generators
generated
2
.idea/.generators
generated
@@ -5,4 +5,4 @@ You are allowed to:
|
||||
2. Remove generators
|
||||
3. Add installed generators
|
||||
To add new installed generators automatically delete this file and reload the project.
|
||||
--><GeneratorsGroup><Generator name="active_record:migration" /><Generator name="active_record:model" /><Generator name="active_record:observer" /><Generator name="active_record:session_migration" /><Generator name="controller" /><Generator name="erb:controller" /><Generator name="erb:mailer" /><Generator name="erb:scaffold" /><Generator name="generator" /><Generator name="helper" /><Generator name="integration_test" /><Generator name="mailer" /><Generator name="metal" /><Generator name="migration" /><Generator name="model" /><Generator name="model_subclass" /><Generator name="observer" /><Generator name="performance_test" /><Generator name="plugin" /><Generator name="resource" /><Generator name="scaffold" /><Generator name="scaffold_controller" /><Generator name="session_migration" /><Generator name="stylesheets" /><Generator name="test_unit:controller" /><Generator name="test_unit:helper" /><Generator name="test_unit:integration" /><Generator name="test_unit:mailer" /><Generator name="test_unit:model" /><Generator name="test_unit:observer" /><Generator name="test_unit:performance" /><Generator name="test_unit:plugin" /><Generator name="test_unit:scaffold" /></GeneratorsGroup></Settings>
|
||||
--><GeneratorsGroup><Generator name="assets" /><Generator name="cancan:ability" /><Generator name="channel" /><Generator name="coffee:assets" /><Generator name="controller" /><Generator name="factory_girl:model" /><Generator name="generator" /><Generator name="helper" /><Generator name="integration_test" /><Generator name="jbuilder" /><Generator name="job" /><Generator name="js:assets" /><Generator name="kaminari:config" /><Generator name="kaminari:views" /><Generator name="mailer" /><Generator name="migration" /><Generator name="model" /><Generator name="resource" /><Generator name="rspec:controller" /><Generator name="rspec:feature" /><Generator name="rspec:helper" /><Generator name="rspec:install" /><Generator name="rspec:integration" /><Generator name="rspec:job" /><Generator name="rspec:mailer" /><Generator name="rspec:model" /><Generator name="rspec:observer" /><Generator name="rspec:request" /><Generator name="rspec:scaffold" /><Generator name="rspec:view" /><Generator name="scaffold" /><Generator name="scaffold_controller" /><Generator name="sidekiq:worker" /><Generator name="simple_form:install" /><Generator name="system_test" /><Generator name="task" /><Generator name="test_unit:controller" /><Generator name="test_unit:generator" /><Generator name="test_unit:helper" /><Generator name="test_unit:integration" /><Generator name="test_unit:job" /><Generator name="test_unit:mailer" /><Generator name="test_unit:model" /><Generator name="test_unit:plugin" /><Generator name="test_unit:scaffold" /><Generator name="test_unit:system" /></GeneratorsGroup></Settings>
|
||||
|
||||
2
.idea/.rakeTasks
generated
2
.idea/.rakeTasks
generated
File diff suppressed because one or more lines are too long
28
.idea/sxrestaurant.iml
generated
28
.idea/sxrestaurant.iml
generated
@@ -124,14 +124,14 @@
|
||||
</content>
|
||||
<orderEntry type="inheritedJdk" />
|
||||
<orderEntry type="sourceFolder" forTests="false" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="actioncable (v5.1.1, rbenv: 2.3.3) [gem]" level="application" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="actionmailer (v5.1.1, rbenv: 2.3.3) [gem]" level="application" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="actionpack (v5.1.1, rbenv: 2.3.3) [gem]" level="application" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="actionview (v5.1.1, rbenv: 2.3.3) [gem]" level="application" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="activejob (v5.1.1, rbenv: 2.3.3) [gem]" level="application" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="activemodel (v5.1.1, rbenv: 2.3.3) [gem]" level="application" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="activerecord (v5.1.1, rbenv: 2.3.3) [gem]" level="application" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="activesupport (v5.1.1, rbenv: 2.3.3) [gem]" level="application" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="actioncable (v5.1.3, rbenv: 2.3.3) [gem]" level="application" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="actionmailer (v5.1.3, rbenv: 2.3.3) [gem]" level="application" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="actionpack (v5.1.3, rbenv: 2.3.3) [gem]" level="application" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="actionview (v5.1.3, rbenv: 2.3.3) [gem]" level="application" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="activejob (v5.1.3, rbenv: 2.3.3) [gem]" level="application" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="activemodel (v5.1.3, rbenv: 2.3.3) [gem]" level="application" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="activerecord (v5.1.3, rbenv: 2.3.3) [gem]" level="application" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="activesupport (v5.1.3, rbenv: 2.3.3) [gem]" level="application" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="arel (v8.0.0, rbenv: 2.3.3) [gem]" level="application" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="autoprefixer-rails (v7.1.1.2, rbenv: 2.3.3) [gem]" level="application" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="bcrypt (v3.1.11, rbenv: 2.3.3) [gem]" level="application" />
|
||||
@@ -142,6 +142,7 @@
|
||||
<orderEntry type="library" scope="PROVIDED" name="bundler (v1.14.6, rbenv: 2.3.3) [gem]" level="application" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="byebug (v9.0.6, rbenv: 2.3.3) [gem]" level="application" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="cancancan (v1.17.0, rbenv: 2.3.3) [gem]" level="application" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="chronic (v0.10.2, rbenv: 2.3.3) [gem]" level="application" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="coffee-rails (v4.2.2, rbenv: 2.3.3) [gem]" level="application" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="coffee-script (v2.4.1, rbenv: 2.3.3) [gem]" level="application" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="coffee-script-source (v1.12.2, rbenv: 2.3.3) [gem]" level="application" />
|
||||
@@ -150,7 +151,7 @@
|
||||
<orderEntry type="library" scope="PROVIDED" name="cups (v0.0.7, rbenv: 2.3.3) [gem]" level="application" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="database_cleaner (v1.6.1, rbenv: 2.3.3) [gem]" level="application" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="diff-lcs (v1.3, rbenv: 2.3.3) [gem]" level="application" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="erubi (v1.6.0, rbenv: 2.3.3) [gem]" level="application" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="erubi (v1.6.1, rbenv: 2.3.3) [gem]" level="application" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="execjs (v2.7.0, rbenv: 2.3.3) [gem]" level="application" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="factory_girl (v4.8.0, rbenv: 2.3.3) [gem]" level="application" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="factory_girl_rails (v4.8.0, rbenv: 2.3.3) [gem]" level="application" />
|
||||
@@ -160,7 +161,7 @@
|
||||
<orderEntry type="library" scope="PROVIDED" name="font-awesome-rails (v4.7.0.2, rbenv: 2.3.3) [gem]" level="application" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="globalid (v0.4.0, rbenv: 2.3.3) [gem]" level="application" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="httparty (v0.15.5, rbenv: 2.3.3) [gem]" level="application" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="i18n (v0.8.4, rbenv: 2.3.3) [gem]" level="application" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="i18n (v0.8.6, rbenv: 2.3.3) [gem]" level="application" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="jbuilder (v2.7.0, rbenv: 2.3.3) [gem]" level="application" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="jquery-rails (v4.3.1, rbenv: 2.3.3) [gem]" level="application" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="jquery-ui-rails (v6.0.1, rbenv: 2.3.3) [gem]" level="application" />
|
||||
@@ -175,7 +176,7 @@
|
||||
<orderEntry type="library" scope="PROVIDED" name="mime-types (v3.1, rbenv: 2.3.3) [gem]" level="application" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="mime-types-data (v3.2016.0521, rbenv: 2.3.3) [gem]" level="application" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="mini_portile2 (v2.2.0, rbenv: 2.3.3) [gem]" level="application" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="minitest (v5.10.2, rbenv: 2.3.3) [gem]" level="application" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="minitest (v5.10.3, rbenv: 2.3.3) [gem]" level="application" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="multi_json (v1.12.1, rbenv: 2.3.3) [gem]" level="application" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="multi_xml (v0.6.0, rbenv: 2.3.3) [gem]" level="application" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="mysql2 (v0.4.6, rbenv: 2.3.3) [gem]" level="application" />
|
||||
@@ -190,10 +191,10 @@
|
||||
<orderEntry type="library" scope="PROVIDED" name="rack-cors (v0.4.1, rbenv: 2.3.3) [gem]" level="application" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="rack-protection (v2.0.0, rbenv: 2.3.3) [gem]" level="application" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="rack-test (v0.6.3, rbenv: 2.3.3) [gem]" level="application" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="rails (v5.1.1, rbenv: 2.3.3) [gem]" level="application" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="rails (v5.1.3, rbenv: 2.3.3) [gem]" level="application" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="rails-dom-testing (v2.0.3, rbenv: 2.3.3) [gem]" level="application" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="rails-html-sanitizer (v1.0.3, rbenv: 2.3.3) [gem]" level="application" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="railties (v5.1.1, rbenv: 2.3.3) [gem]" level="application" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="railties (v5.1.3, rbenv: 2.3.3) [gem]" level="application" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="rake (v12.0.0, rbenv: 2.3.3) [gem]" level="application" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="rb-fsevent (v0.9.8, rbenv: 2.3.3) [gem]" level="application" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="rb-inotify (v0.9.10, rbenv: 2.3.3) [gem]" level="application" />
|
||||
@@ -228,6 +229,7 @@
|
||||
<orderEntry type="library" scope="PROVIDED" name="web-console (v3.5.1, rbenv: 2.3.3) [gem]" level="application" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="websocket-driver (v0.6.5, rbenv: 2.3.3) [gem]" level="application" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="websocket-extensions (v0.1.2, rbenv: 2.3.3) [gem]" level="application" />
|
||||
<orderEntry type="library" scope="PROVIDED" name="whenever (v0.9.7, rbenv: 2.3.3) [gem]" level="application" />
|
||||
</component>
|
||||
<component name="RModuleSettingsStorage">
|
||||
<LOAD_PATH number="0" />
|
||||
|
||||
986
.idea/workspace.xml
generated
986
.idea/workspace.xml
generated
File diff suppressed because it is too large
Load Diff
@@ -22,10 +22,50 @@ class Origami::VoucherController < BaseOrigamiController
|
||||
def create
|
||||
cash = params[:amount]
|
||||
sale_id = params[:sale_id]
|
||||
sale_id = params[:refnumber]
|
||||
if(Sale.exists?(sale_id))
|
||||
saleObj = Sale.find(sale_id)
|
||||
sale_payment = SalePayment.new
|
||||
@status, @sale = sale_payment.process_payment(saleObj, @user, cash, "voucher")
|
||||
customer_data= Customer.find_by_customer_id(sale_data.customer_id)
|
||||
if customer_data
|
||||
membership_id = customer_data.membership_id
|
||||
membership_setting = MembershipSetting.find_by_membership_type("paypar_url")
|
||||
if membership_setting.gateway_url
|
||||
member_actions =MembershipAction.find_by_membership_type("get_account_balance") #need to modify here
|
||||
if member_actions.gateway_url
|
||||
campaign_type_id = member_actions.additional_parameter["campaign_type_id"]
|
||||
url = membership_setting.gateway_url.to_s + member_actions.gateway_url.to_s
|
||||
merchant_uid= member_actions.merchant_account_id
|
||||
auth_token = member_actions.auth_token.to_s
|
||||
# membership_data = SalePayment.get_paypar_account(url,membership_setting.auth_token,@membership_id,@campaign_type_id,merchant_uid,auth_token)
|
||||
# if membership_data["status"]==true
|
||||
begin
|
||||
response = HTTParty.get(url,
|
||||
:body => { app_token: token,membership_id:membership_id,
|
||||
campaign_type_id:campaign_type_id,merchant_uid:merchant_uid,
|
||||
auth_token:auth_token
|
||||
}.to_json,
|
||||
:headers => {
|
||||
'Content-Type' => 'application/json',
|
||||
'Accept' => 'application/json'
|
||||
}, :timeout => 10
|
||||
)
|
||||
rescue Net::OpenTimeout
|
||||
response = { status: false }
|
||||
|
||||
rescue OpenURI::HTTPError
|
||||
response = { status: false}
|
||||
|
||||
rescue SocketError
|
||||
response = { status: false}
|
||||
end
|
||||
# end
|
||||
end
|
||||
end
|
||||
end
|
||||
if( response["status"]==true )
|
||||
saleObj = Sale.find(sale_id)
|
||||
sale_payment = SalePayment.new
|
||||
@status, @sale = sale_payment.process_payment(saleObj, @user, cash, "voucher")
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
@@ -70,6 +70,6 @@ class PrintSettingsController < ApplicationController
|
||||
|
||||
# Never trust parameters from the scary internet, only allow the white list through.
|
||||
def print_setting_params
|
||||
params.require(:print_setting).permit(:name, :unique_code, :template, :db_name, :db_type, :db_username, :db_password, :printer_name, :api_settings, :page_width, :page_height, :print_copies,:precision,:delimiter,:heading_space)
|
||||
params.require(:print_setting).permit(:name, :unique_code, :template, :printer_name, :api_settings, :page_width, :page_height, :print_copies,:precision,:delimiter,:heading_space)
|
||||
end
|
||||
end
|
||||
|
||||
@@ -16,6 +16,9 @@ class Settings::DiningChargesController < ApplicationController
|
||||
# GET /dining_charges/new
|
||||
def new
|
||||
@dining_charge = DiningCharge.new
|
||||
@dining_charge.minimum_free_time="00:30"
|
||||
@dining_charge.charge_block="02:00"
|
||||
@dining_charge.time_rounding_block="00:15"
|
||||
end
|
||||
|
||||
# GET /dining_charges/1/edit
|
||||
@@ -29,7 +32,11 @@ class Settings::DiningChargesController < ApplicationController
|
||||
@dining_charge.dining_facility_id = @settings_dining_facility.id
|
||||
respond_to do |format|
|
||||
if @dining_charge.save
|
||||
format.html { redirect_to edit_settings_zone_table_path(@zone,@settings_dining_facility), notice: 'Dining charge was successfully created.' }
|
||||
if @table
|
||||
format.html { redirect_to edit_settings_zone_table_path(@zone,@settings_dining_facility), notice: 'Dining charge was successfully created.' }
|
||||
else
|
||||
format.html { redirect_to edit_settings_zone_room_path(@zone,@settings_dining_facility), notice: 'Dining charge was successfully created.' }
|
||||
end
|
||||
format.json { render :show, status: :created, location: @dining_charge }
|
||||
else
|
||||
format.html { render :new }
|
||||
@@ -44,7 +51,11 @@ class Settings::DiningChargesController < ApplicationController
|
||||
respond_to do |format|
|
||||
@dining_charge.dining_facility_id = @settings_dining_facility.id
|
||||
if @dining_charge.update(dining_charge_params)
|
||||
format.html { redirect_to edit_settings_zone_table_path(@zone,@settings_dining_facility), notice: 'Dining charge was successfully updated.' }
|
||||
if @table
|
||||
format.html { redirect_to edit_settings_zone_table_path(@zone,@settings_dining_facility), notice: 'Dining charge was successfully updated.' }
|
||||
else
|
||||
format.html { redirect_to edit_settings_zone_room_path(@zone,@settings_dining_facility), notice: 'Dining charge was successfully updated.' }
|
||||
end
|
||||
format.json { render :show, status: :ok, location: @dining_charge }
|
||||
else
|
||||
format.html { render :edit }
|
||||
|
||||
@@ -4,135 +4,135 @@ class Ability
|
||||
def initialize(user)
|
||||
user ||= Employee.new
|
||||
|
||||
if user.role == "administrator"
|
||||
if user.role == 'administrator'
|
||||
|
||||
can :manage, :all
|
||||
can :manage, :all
|
||||
|
||||
elsif user.role == "manager"
|
||||
elsif user.role == 'manager'
|
||||
|
||||
can :manage, Menu
|
||||
can :manage, MenuCategory
|
||||
can :manage, MenuItemAttribute
|
||||
can :manage, MenuItemInstance
|
||||
can :manage, MenuItemOption
|
||||
can :manage, SetMenuItem
|
||||
can :manage, OrderQueueStation
|
||||
can :manage, Zone
|
||||
can :manage, CashierTerminal
|
||||
can :manage, Employee
|
||||
# can :manage, MembershipSetting
|
||||
# can :manage, MembershipAction
|
||||
# can :manage, PaymentMethodSetting
|
||||
can :manage, TaxProfile
|
||||
can :manage, PrintSetting
|
||||
can :manage, Account
|
||||
can :manage, Menu
|
||||
can :manage, MenuCategory
|
||||
can :manage, MenuItemAttribute
|
||||
can :manage, MenuItemInstance
|
||||
can :manage, MenuItemOption
|
||||
can :manage, SetMenuItem
|
||||
can :manage, OrderQueueStation
|
||||
can :manage, Zone
|
||||
can :manage, CashierTerminal
|
||||
can :manage, Employee
|
||||
# can :manage, MembershipSetting
|
||||
# can :manage, MembershipAction
|
||||
# can :manage, PaymentMethodSetting
|
||||
can :manage, TaxProfile
|
||||
can :manage, PrintSetting
|
||||
can :manage, Account
|
||||
|
||||
can :manage, Order
|
||||
can :manage, Sale
|
||||
can :manage, Order
|
||||
can :manage, Sale
|
||||
|
||||
can :manage, Customer
|
||||
can :manage, DiningQueue
|
||||
can :manage, Customer
|
||||
can :manage, DiningQueue
|
||||
|
||||
can :index, :dailysale
|
||||
can :index, :saleitem
|
||||
can :index, :receipt_no
|
||||
can :index, :shiftsale
|
||||
can :index, :credit_payment
|
||||
can :index, :void_sale
|
||||
can :index, :dailysale
|
||||
can :index, :saleitem
|
||||
can :index, :receipt_no
|
||||
can :index, :shiftsale
|
||||
can :index, :credit_payment
|
||||
can :index, :void_sale
|
||||
|
||||
can :get_customer, Customer
|
||||
can :add_customer, Customer
|
||||
can :update_sale_by_customer, Customer
|
||||
can :get_customer, Customer
|
||||
can :add_customer, Customer
|
||||
can :update_sale_by_customer, Customer
|
||||
|
||||
can :index, :other_charge
|
||||
can :create, :other_charge
|
||||
can :index, :discount
|
||||
can :create, :discount
|
||||
can :remove_discount_items, :discount
|
||||
can :remove_all_discount, :discount
|
||||
can :index, :other_charge
|
||||
can :create, :other_charge
|
||||
can :index, :discount
|
||||
can :create, :discount
|
||||
can :remove_discount_items, :discount
|
||||
can :remove_all_discount, :discount
|
||||
|
||||
can :first_bill, :payment
|
||||
can :show, :payment
|
||||
can :create, :payment
|
||||
can :reprint, :payment
|
||||
can :rounding_adj, :payment
|
||||
can :first_bill, :payment
|
||||
can :show, :payment
|
||||
can :create, :payment
|
||||
can :reprint, :payment
|
||||
can :rounding_adj, :payment
|
||||
|
||||
can :move_dining, :movetable
|
||||
can :moving, :movetable
|
||||
can :move_dining, :movetable
|
||||
can :moving, :movetable
|
||||
|
||||
can :move_dining, :moveroom
|
||||
can :move_dining, :moveroom
|
||||
|
||||
can :edit, :sale_edit
|
||||
can :item_void, :sale_edit
|
||||
can :item_void_cancel, :sale_edit
|
||||
can :cancel_all_void, :sale_edit
|
||||
can :apply_void, :sale_edit
|
||||
can :edit, :sale_edit
|
||||
can :item_void, :sale_edit
|
||||
can :item_void_cancel, :sale_edit
|
||||
can :cancel_all_void, :sale_edit
|
||||
can :apply_void, :sale_edit
|
||||
|
||||
can :overall_void, :void
|
||||
can :overall_void, :void
|
||||
|
||||
elsif user.role == "cashier"
|
||||
|
||||
# can :overall_void, :void
|
||||
elsif user.role == 'cashier'
|
||||
|
||||
can :read, Order
|
||||
can :update, Order
|
||||
|
||||
can :read, Sale
|
||||
can :update, Sale
|
||||
can :get_customer, Customer
|
||||
can :add_customer, Customer
|
||||
can :update_sale_by_customer, Customer
|
||||
# can :overall_void, :void
|
||||
|
||||
can :index, :other_charge
|
||||
can :create, :other_charge
|
||||
can :index, :discount
|
||||
can :create, :discount
|
||||
can :remove_discount_items, :discount
|
||||
can :remove_all_discount, :discount
|
||||
can :member_discount, :discount
|
||||
can :read, Order
|
||||
can :update, Order
|
||||
|
||||
can :first_bill, :payment
|
||||
can :show, :payment
|
||||
can :create, :payment
|
||||
can :reprint, :payment
|
||||
can :rounding_adj, :payment
|
||||
can :read, Sale
|
||||
can :update, Sale
|
||||
can :get_customer, Customer
|
||||
can :add_customer, Customer
|
||||
can :update_sale_by_customer, Customer
|
||||
|
||||
can :move_dining, :movetable
|
||||
can :moving, :movetable
|
||||
can :index, :other_charge
|
||||
can :create, :other_charge
|
||||
can :index, :discount
|
||||
can :create, :discount
|
||||
can :remove_discount_items, :discount
|
||||
can :remove_all_discount, :discount
|
||||
can :member_discount, :discount
|
||||
|
||||
can :move_dining, :moveroom
|
||||
can :first_bill, :payment
|
||||
can :show, :payment
|
||||
can :create, :payment
|
||||
can :reprint, :payment
|
||||
can :rounding_adj, :payment
|
||||
|
||||
can :first_bill, :payment
|
||||
can :show, :payment
|
||||
can :create, :payment
|
||||
can :reprint, :payment
|
||||
can :move_dining, :movetable
|
||||
can :moving, :movetable
|
||||
|
||||
can :manage, DiningQueue
|
||||
|
||||
elsif user.role == "account"
|
||||
can :move_dining, :moveroom
|
||||
|
||||
can :index, :dailysale
|
||||
can :index, :saleitem
|
||||
can :index, :receipt_no
|
||||
can :index, :shiftsale
|
||||
can :index, :credit_payment
|
||||
can :index, :void_sale
|
||||
can :first_bill, :payment
|
||||
can :show, :payment
|
||||
can :create, :payment
|
||||
can :reprint, :payment
|
||||
|
||||
elsif user.role == "supervisour"
|
||||
can :manage, DiningQueue
|
||||
|
||||
can :edit, :sale_edit
|
||||
can :item_void, :sale_edit
|
||||
can :item_edit, :sale_edit
|
||||
can :item_void_cancel, :sale_edit
|
||||
can :cancel_all_void, :sale_edit
|
||||
can :apply_void, :sale_edit
|
||||
can :overall_void, :void
|
||||
elsif user.role == 'account'
|
||||
|
||||
can :first_bill, :payment
|
||||
can :create, :payment
|
||||
can :show, :payment
|
||||
can :reprint, :payment
|
||||
can :rounding_adj, :payment
|
||||
can :index, :dailysale
|
||||
can :index, :saleitem
|
||||
can :index, :receipt_no
|
||||
can :index, :shiftsale
|
||||
can :index, :credit_payment
|
||||
can :index, :void_sale
|
||||
|
||||
elsif user.role == 'supervisour'
|
||||
|
||||
can :edit, :sale_edit
|
||||
can :item_void, :sale_edit
|
||||
can :item_edit, :sale_edit
|
||||
can :item_void_cancel, :sale_edit
|
||||
can :cancel_all_void, :sale_edit
|
||||
can :apply_void, :sale_edit
|
||||
can :overall_void, :void
|
||||
|
||||
can :first_bill, :payment
|
||||
can :create, :payment
|
||||
can :show, :payment
|
||||
can :reprint, :payment
|
||||
can :rounding_adj, :payment
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
class CloseCashierPdf < Prawn::Document
|
||||
attr_accessor :label_width,:price_column_width,:page_width, :page_height, :margin, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_width,:total_width,:item_description_width,:text_width
|
||||
def initialize(printer_settings, shift_sale,shop_details,sale_taxes)
|
||||
self.page_width = 210
|
||||
self.page_height = 7000
|
||||
self.page_width = PrintSetting.where("name = ?","Close Cashier").first.page_width
|
||||
self.page_height = PrintSetting.where("name = ?","Close Cashier").first.page_height
|
||||
self.margin = 5
|
||||
self.price_width = 40
|
||||
self.qty_width = 20
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
class CrmOrderPdf < Prawn::Document
|
||||
attr_accessor :receipt_width,:price_column_width,:p_width, :page_height, :margin, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_column_width,:item_description_width
|
||||
def initialize(booking,order_items,printer_settings)
|
||||
self.p_width = 200
|
||||
self.page_height = 1450
|
||||
self.page_width = PrintSetting.where("name = ?","CRM Order").first.page_width
|
||||
self.page_height = PrintSetting.where("name = ?","CRM Order").first.page_height
|
||||
self.margin = 10
|
||||
# self.price_width = self.p_width / 2
|
||||
self.price_width=80
|
||||
|
||||
@@ -2,8 +2,8 @@ class OrderItemPdf < Prawn::Document
|
||||
include ActionView::Helpers::NumberHelper
|
||||
attr_accessor :label_width,:price_column_width,:page_width, :page_height, :margin, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_width,:total_width,:item_description_width
|
||||
def initialize(print_settings,order_item, print_status, options, alt_name)
|
||||
self.page_width = 185
|
||||
self.page_height = 1450
|
||||
self.page_width = PrintSetting.where("name = ?","OrderItemPdf").first.page_width
|
||||
self.page_height = PrintSetting.where("name = ?","OrderItemPdf").first.page_height
|
||||
self.margin = 0
|
||||
self.price_width = 40 # No Need for item
|
||||
self.qty_width = 40
|
||||
|
||||
@@ -2,8 +2,8 @@ class OrderSummaryPdf < Prawn::Document
|
||||
include ActionView::Helpers::NumberHelper
|
||||
attr_accessor :label_width,:price_column_width,:page_width, :page_height, :margin, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_width,:total_width,:item_description_width
|
||||
def initialize(print_settings,order, print_status, order_items = nil,alt_name)
|
||||
self.page_width = 190
|
||||
self.page_height = 1450
|
||||
self.page_width = PrintSetting.where("name = ?","Order Summary").first.page_width
|
||||
self.page_height = PrintSetting.where("name = ?","Order Summary").first.page_height
|
||||
self.margin = 0
|
||||
self.price_width = 40 # No Need for item
|
||||
self.qty_width = 40
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
class QueueNoPdf < Prawn::Document
|
||||
attr_accessor :label_width,:price_column_width,:page_width, :page_height, :margin, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_width,:total_width,:item_description_width
|
||||
def initialize(printer_settings, queue)
|
||||
self.page_width = 210
|
||||
self.page_height = 1450
|
||||
self.page_width = PrintSetting.where("name = ?","Queue No").first.page_width
|
||||
self.page_height = PrintSetting.where("name = ?","Queue No").first.page_height
|
||||
self.margin = 5
|
||||
self.price_width = 35
|
||||
self.qty_width = 20
|
||||
|
||||
@@ -2,8 +2,8 @@ class ReceiptBillPdf < Prawn::Document
|
||||
include ActionView::Helpers::NumberHelper
|
||||
attr_accessor :label_width,:price_column_width,:page_width, :page_height, :margin, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_width,:total_width,:item_description_width, :description_width, :price_num_width
|
||||
def initialize(printer_settings, sale_items, sale_data, customer_name, item_price_by_accounts, discount_price_by_accounts, member_info = nil,rebate_amount = nil,shop_details, printed_status)
|
||||
self.page_width = 210
|
||||
self.page_height = 1450
|
||||
self.page_width = PrintSetting.where("name = ?","Receipt Bill").first.page_width
|
||||
self.page_height = PrintSetting.where("name = ?","Receipt Bill").first.page_height
|
||||
self.margin = 5
|
||||
self.price_width = 40
|
||||
self.qty_width = 20
|
||||
|
||||
@@ -1,47 +1,291 @@
|
||||
<div class="row">
|
||||
<div class="col-md-4 col-sm-6 col-md-offset-4 col-sm-offset-3">
|
||||
<div class="row">
|
||||
<div class="col-md-4 col-sm-6 col-md-offset-4 col-sm-offset-3">
|
||||
|
||||
<% if current_login_employee.role = "admin" %>
|
||||
<% if current_login_employee.role = "admin" %>
|
||||
|
||||
<% elsif current_login_employee.role = "cashier" %>
|
||||
<%= link_to "Cashier Station", origami_path %>
|
||||
<% elsif current_login_employee.role = "cashier" %>
|
||||
<%= link_to "Cashier Station", origami_path %>
|
||||
|
||||
<% elsif current_login_employee = "account" %>
|
||||
<%= link_to "Cashier Station", oishi_path %>
|
||||
<% elsif current_login_employee = "account" %>
|
||||
<%= link_to "Cashier Station", oishi_path %>
|
||||
|
||||
<% else %>
|
||||
<%= link_to "Cashier Station", oishi_path %>
|
||||
<% else %>
|
||||
<%= link_to "Cashier Station", oishi_path %>
|
||||
|
||||
<% end %>
|
||||
<% shop = Shop.first %>
|
||||
<% end %>
|
||||
<% shop = Shop.first %>
|
||||
|
||||
<!-- -->
|
||||
|
||||
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer">
|
||||
<div class="card">
|
||||
<div class="page-header" style="width:100%;text-align:center;background-color:#ddd;">
|
||||
<h4 style="color : #ef404a;font-weight:bold;font-style:italic;margin-bottom:0px;"><%= shop.name %></h4>
|
||||
</div>
|
||||
<div class="card-block" style="text-align:center;background-color:#ddd;padding:0rem;">
|
||||
<%= shop.address %>
|
||||
</div>
|
||||
<div class="card-block" style="text-align:center;background-color:#ddd;padding:0rem;">
|
||||
<%= shop.phone_no %>
|
||||
</div>
|
||||
|
||||
<div class="col-md-2 container pull-right" style="margin: 0px !important;">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="card" id="oqs" onclick="location.href='<%= oqs_root_path %>'">
|
||||
<div class="card-content">
|
||||
<span class="card-title">OQS</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<style type="text/css">
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="card" id="origami" onclick="location.href='<%= origami_root_path %>'">
|
||||
<div class="card-content">
|
||||
<span class="card-title">Origami</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="card" id="crm" onclick="location.href='<%= crm_root_path %>'">
|
||||
<div class="card-content">
|
||||
<span class="card-title">CRM</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="card" id="backend" onclick="location.href='<%= dashboard_path %>'">
|
||||
<div class="card-content">
|
||||
<span class="card-title">Backend</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-8 col-lg-8">
|
||||
<div class="" style="max-height:550px; overflow:auto;padding: 15px">
|
||||
<h4 class="card-title"><strong>Role Features</strong></h4>
|
||||
<!-- <p><strong>Note:</strong> The <strong>data-parent</strong> attribute makes sure that all collapsible elements under the specified parent will be closed when one of the collapsible item is shown.</p> -->
|
||||
<div class="panel-group" id="accordion">
|
||||
<% if current_user.role == 'administrator' %>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">
|
||||
<a data-toggle="collapse" data-parent="#accordion" href="#admin">Administrator
|
||||
<span class="glyphicon glyphicon-plus"></span></a>
|
||||
</h4>
|
||||
</div>
|
||||
<div id="admin" class="panel-collapse collapse in">
|
||||
<div class="panel-body">
|
||||
<ul class="col-md-4">
|
||||
<li class="">All Settings</li>
|
||||
<ul class="">
|
||||
<li>Zone</li>
|
||||
<li>OQS</li>
|
||||
<li>Menu</li>
|
||||
<li>Cashier Terminal</li>
|
||||
<li>Payment</li>
|
||||
<li>Merbership</li>
|
||||
<li>Print</li>
|
||||
<li>Employees</li>
|
||||
<li>Accounts</li>
|
||||
</ul>
|
||||
</ul>
|
||||
<ul class="col-md-4">
|
||||
<li class="">Transactions</li>
|
||||
<ul class="">
|
||||
<li>Order</li>
|
||||
<li>Sale</li>
|
||||
<li>Credit Note</li>
|
||||
</ul><br>
|
||||
<li>Reports</li>
|
||||
<ul class="">
|
||||
<li>Daily Sale</li>
|
||||
<li>Sale Item</li>
|
||||
<li>Receipt</li>
|
||||
<li>Shift Sale</li>
|
||||
<li>Credit Sale</li>
|
||||
<li>Void Sale</li>
|
||||
</ul>
|
||||
</ul>
|
||||
<ul class="col-md-4">
|
||||
<li>OQS</li><br>
|
||||
<li>Origami</li><br>
|
||||
<li>CRM</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% elsif current_user.role == 'manager' %>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">
|
||||
<a data-toggle="collapse" data-parent="#accordion" href="#manager">Manager
|
||||
<span class="glyphicon glyphicon-plus"></span></a>
|
||||
</h4>
|
||||
</div>
|
||||
<div id="admin" class="panel-collapse collapse in">
|
||||
<div class="panel-body">
|
||||
<ul class="col-md-4">
|
||||
<li class="">All Settings</li>
|
||||
<ul class="">
|
||||
<li>Zone</li>
|
||||
<li>OQS</li>
|
||||
<li>Menu</li>
|
||||
<li>Cashier Terminal</li>
|
||||
<li>Print</li>
|
||||
<li>Employees</li>
|
||||
<li>Accounts</li>
|
||||
</ul>
|
||||
</ul>
|
||||
<ul class="col-md-4">
|
||||
<li class="">Transactions</li>
|
||||
<ul class="">
|
||||
<li>Order</li>
|
||||
<li>Sale</li>
|
||||
<li>Credit Note</li>
|
||||
</ul><br>
|
||||
<li>Reports</li>
|
||||
<ul class="">
|
||||
<li>Daily Sale</li>
|
||||
<li>Sale Item</li>
|
||||
<li>Receipt</li>
|
||||
<li>Shift Sale</li>
|
||||
<li>Credit Sale</li>
|
||||
<li>Void Sale</li>
|
||||
</ul>
|
||||
</ul>
|
||||
<ul class="col-md-4">
|
||||
<li>OQS</li><br>
|
||||
<li>Origami</li><br>
|
||||
<li>CRM</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% elsif current_user.role == 'supervisour' %>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">
|
||||
<a data-toggle="collapse" data-parent="#accordion" href="#supervisor">Supervisor
|
||||
<span class="glyphicon glyphicon-plus"></span></a>
|
||||
</h4>
|
||||
</div>
|
||||
<div id="supervisor" class="panel-collapse collapse in">
|
||||
<div class="panel-body">
|
||||
<ul class="">
|
||||
<li>OQS</li>
|
||||
<ul>
|
||||
<li class="">Void</li>
|
||||
<li class="">FOC</li>
|
||||
<li class="">Edit</li>
|
||||
<li class="">Credit</li>
|
||||
<li class="">Payment</li>
|
||||
</ul>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% elsif current_user.role == 'cashier' %>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">
|
||||
<a data-toggle="collapse" data-parent="#accordion" href="#cashier">Cashier
|
||||
<span class="glyphicon glyphicon-plus"></span></a>
|
||||
</h4>
|
||||
</div>
|
||||
<div id="cashier" class="panel-collapse collapse in">
|
||||
<div class="panel-body">
|
||||
<ul class="">
|
||||
<li class="">Orgami Panel except Edit and Void</li>
|
||||
<li class="">Sale and Order</li>
|
||||
<li class="">and Queue in CRM</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% elsif current_user.role == 'account' %>
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading">
|
||||
<h4 class="panel-title">
|
||||
<a data-toggle="collapse" data-parent="#accordion" href="#accountant">Accountant
|
||||
<span class="glyphicon glyphicon-plus"></span></a>
|
||||
</h4>
|
||||
</div>
|
||||
<div id="accountant" class="panel-collapse collapse in">
|
||||
<div class="panel-body">
|
||||
<ul class="">
|
||||
<li class="">Daily Sale Report</li>
|
||||
<li class="">Sale Item Report</li>
|
||||
<li class="">Receipt No Report</li>
|
||||
<li class="">ShiftSale Report</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div> <!-- end accordion id -->
|
||||
</div>
|
||||
</div> <!-- end col-md-4 -->
|
||||
|
||||
<div class="footer">
|
||||
<div class="card">
|
||||
<div class="page-header" style="width:100%;text-align:center;background-color:#ddd;">
|
||||
<h4 style="color : #ef404a;font-weight:bold;font-style:italic;margin-bottom:0px;"><%= shop.name %></h4>
|
||||
</div>
|
||||
<div class="card-block" style="text-align:center;background-color:#ddd;padding:0rem;">
|
||||
<%= shop.address %>
|
||||
</div>
|
||||
<div class="card-block" style="text-align:center;background-color:#ddd;padding:0rem;">
|
||||
<%= shop.phone_no %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<style type="text/css">
|
||||
|
||||
.footer {
|
||||
position: fixed;
|
||||
bottom: 0;
|
||||
left: 0;
|
||||
height: auto;
|
||||
background-color: #ef404a;
|
||||
width: 100%;
|
||||
}
|
||||
</style>
|
||||
|
||||
.card {
|
||||
margin-top: 10px;
|
||||
box-sizing: border-box;
|
||||
border-radius: 2px;
|
||||
background-clip: padding-box;
|
||||
transition: 0.3s ease;
|
||||
background-color: white;
|
||||
box-shadow: 0 2px 5px 0 rgba(0, 0, 0, 0.16), 0 2px 10px 0 rgba(0, 0, 0, 0.12);
|
||||
}
|
||||
|
||||
.card span.card-title {
|
||||
color: purple;
|
||||
font-size: 28px;
|
||||
font-weight: 400;
|
||||
text-transform: uppercase;
|
||||
transition: color 0.3s ease;
|
||||
line-height: 48px;
|
||||
}
|
||||
|
||||
.card .card-content {
|
||||
padding: 15%;
|
||||
border-radius: 0 0 2px 2px;
|
||||
background-clip: padding-box;
|
||||
box-sizing: border-box;
|
||||
height: 120px;
|
||||
transition: color 0.3s ease;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.card .card-content p {
|
||||
margin: 0;
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
.card:hover {
|
||||
box-shadow: 0 10px 20px 0 rgba(0, 0, 0, 0.16), 0 10px 20px 0 rgba(0, 0, 0, 0.12);
|
||||
}
|
||||
|
||||
</style>
|
||||
|
||||
@@ -1,86 +1,91 @@
|
||||
<style>
|
||||
.pin_pad {
|
||||
width: 30%;
|
||||
height:70px;
|
||||
line-height:70px;
|
||||
text-align:center;
|
||||
background:#54A5AF;
|
||||
font-size:20px;
|
||||
color:white;
|
||||
height: 70px;
|
||||
line-height: 70px;
|
||||
text-align: center;
|
||||
background: #54A5AF;
|
||||
font-size: 20px;
|
||||
color: white;
|
||||
}
|
||||
.bottom{
|
||||
margin-bottom: 1px;
|
||||
|
||||
.bottom {
|
||||
margin-bottom: 1px;
|
||||
}
|
||||
.left{
|
||||
margin-left:1px;
|
||||
|
||||
.left {
|
||||
margin-left: 1px;
|
||||
}
|
||||
.orange{
|
||||
background-color:#FF7F50;
|
||||
|
||||
.orange {
|
||||
background-color: #FF7F50;
|
||||
}
|
||||
|
||||
.purple {
|
||||
background-color:#7a62d3;
|
||||
background-color: #7a62d3;
|
||||
}
|
||||
</style>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-4 col-sm-6 col-md-offset-4 col-sm-offset-3">
|
||||
<%= simple_form_for(@login_form, url: emp_login_update_path, method: "PATCH") do |f| %>
|
||||
<div class="card">
|
||||
<div class="content" style="margin:10px">
|
||||
<div class="form-group">
|
||||
<%= f.input :emp_id,as: :hidden, label: "Access PIN", required: false, class: "form-control" %>
|
||||
<div class="col-md-4 col-sm-6 col-md-offset-4 col-sm-offset-3">
|
||||
<%= simple_form_for(@login_form, url: emp_login_update_path, method: "PATCH") do |f| %>
|
||||
<div class="card">
|
||||
<div class="content" style="margin:10px">
|
||||
<div class="form-group">
|
||||
<%= f.input :emp_id, as: :hidden, label: "Access PIN", required: false, class: "form-control" %>
|
||||
|
||||
<%= f.input :password, label: "Access PIN", required: false, class: "form-control" %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content row" style="padding-left:10px;margin-left:10px; margin-top:0px; text-align:center">
|
||||
<div class='col-md-12'>
|
||||
<div class='row bottom'>
|
||||
<div class="pin_pad " data-value="1">1</div>
|
||||
<div class="pin_pad left" data-value="2">2</div>
|
||||
<div class="pin_pad left" data-value="3">3</div>
|
||||
</div>
|
||||
<div class='row bottom'>
|
||||
<div class="pin_pad" data-value="4">4</div>
|
||||
<div class="pin_pad left" data-value="5">5</div>
|
||||
<div class="pin_pad left" data-value="6">6</div>
|
||||
</div>
|
||||
<div class='row bottom'>
|
||||
<div class="pin_pad" data-value="7">7</div>
|
||||
<div class="pin_pad left" data-value="8">8</div>
|
||||
<div class="pin_pad left" data-value="9">9</div>
|
||||
</div>
|
||||
<div class='row bottom'>
|
||||
<div class="pin_pad orange" data-value="CLR">CLR</div>
|
||||
<div class="pin_pad left" data-value="0">0</div>
|
||||
<div class="pin_pad left purple" data-value="ENT">ENT</div>
|
||||
</div>
|
||||
<%= f.input :password, label: "Access PIN", required: false, class: "form-control" %>
|
||||
</div>
|
||||
</div>
|
||||
<div class="content row" style="padding-left:10px;margin-left:10px; margin-top:0px; text-align:center">
|
||||
<div class='col-md-12'>
|
||||
<div class='row bottom'>
|
||||
<div class="pin_pad " data-value="1">1</div>
|
||||
<div class="pin_pad left" data-value="2">2</div>
|
||||
<div class="pin_pad left" data-value="3">3</div>
|
||||
</div>
|
||||
<div class="footer text-center" style="margin:10px">
|
||||
|
||||
</div>
|
||||
<div class='row bottom'>
|
||||
<div class="pin_pad" data-value="4">4</div>
|
||||
<div class="pin_pad left" data-value="5">5</div>
|
||||
<div class="pin_pad left" data-value="6">6</div>
|
||||
</div>
|
||||
<div class='row bottom'>
|
||||
<div class="pin_pad" data-value="7">7</div>
|
||||
<div class="pin_pad left" data-value="8">8</div>
|
||||
<div class="pin_pad left" data-value="9">9</div>
|
||||
</div>
|
||||
<div class='row bottom'>
|
||||
<div class="pin_pad orange" data-value="CLR">CLR</div>
|
||||
<div class="pin_pad left" data-value="0">0</div>
|
||||
<div class="pin_pad left purple" data-value="ENT">ENT</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="footer text-center" style="margin:10px">
|
||||
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<% end %>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
$(document).on('turbolinks:load', function() {
|
||||
$(".pin_pad").click(function(event){
|
||||
event.preventDefault();
|
||||
console.log($(this).data("value"));
|
||||
var value = $(this).data("value");
|
||||
$(document).on('turbolinks:load', function () {
|
||||
$(".pin_pad").click(function (event) {
|
||||
event.preventDefault();
|
||||
console.log($(this).data("value"));
|
||||
var value = $(this).data("value");
|
||||
|
||||
if (value == "CLR") {
|
||||
$("#login_form_password").val("");
|
||||
} else if(value == "ENT") {
|
||||
$("#new_login_form").submit();
|
||||
} else {
|
||||
var old_value = $("#login_form_password").val();
|
||||
$("#login_form_password").val(old_value + value);
|
||||
}
|
||||
});
|
||||
});
|
||||
if (value == "CLR") {
|
||||
$("#login_form_password").val("");
|
||||
} else if (value == "ENT") {
|
||||
$("#new_login_form").submit();
|
||||
} else {
|
||||
var old_value = $("#login_form_password").val();
|
||||
$("#login_form_password").val(old_value + value);
|
||||
}
|
||||
});
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -28,14 +28,15 @@
|
||||
<div class="row">
|
||||
<div class="form-group col-lg-12 col-md-12 col-sm-12">
|
||||
<label class="col-lg-4 col-md-4 col-sm-4">Reference Number</label>
|
||||
<input type="text" name="valid_amount" id="valid_amount" class="form-control col-lg-7 col-md-7 col-sm-7" value="" data-value="<%=@sale_id %>" data-member-value="">
|
||||
<input type="text" name="valid_amount" id="<%=@sale_id %>" class="form-control col-lg-7 col-md-7 col-sm-7 float-value" value="" data-value="<%=@sale_id %>" data-member-value="">
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="form-group col-lg-12 col-md-12 col-sm-12">
|
||||
<label class="col-lg-4 col-md-4 col-sm-4">Amount</label>
|
||||
<div id="amount" class="form-control col-lg-7 col-md-7 col-sm-7">0.0</div>
|
||||
<!-- <div id="amount" class="form-control col-lg-7 col-md-7 col-sm-7">0.0</div> -->
|
||||
<input type="text" name="" id="amount" class="form-control col-lg-7 col-md-7 col-sm-7 float-value" value="" data-value="amount" data-member-value="">
|
||||
</div>
|
||||
<hr>
|
||||
</div>
|
||||
@@ -103,12 +104,17 @@ $(document).ready(function() {
|
||||
}
|
||||
});
|
||||
// number key pad
|
||||
var float_value = ""
|
||||
var total = 0
|
||||
|
||||
$(document).on('focusout', '.float-value', function(event){
|
||||
float_value = $(this).attr("data-value");
|
||||
$(document).on('click', '.cashier_number', function(event){
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
if(event.handled !== true) {
|
||||
var original_value;
|
||||
original_value = $('#amount').text();
|
||||
original_value = $('#'+float_value).val();
|
||||
|
||||
var input_value = $(this).attr("data-value");
|
||||
|
||||
@@ -116,28 +122,28 @@ $(document).on('click', '.cashier_number', function(event){
|
||||
switch (input_type) {
|
||||
case 'num':
|
||||
if (original_value == "0.0"){
|
||||
$('#amount').text(input_value);
|
||||
$('#'+float_value).val(input_value);
|
||||
}else{
|
||||
$('#amount').append(input_value);
|
||||
$('#'+float_value).val(original_value+input_value);
|
||||
}
|
||||
break;
|
||||
|
||||
case 'add':
|
||||
var input_value = $(this).attr("data-value");
|
||||
amount = parseInt(input_value) + parseInt(original_value);
|
||||
$('#amount').html(amount);
|
||||
$('#'+float_value).val(amount);
|
||||
|
||||
break;
|
||||
case 'clr':
|
||||
$('#amount').html("0.0");
|
||||
$('#'+float_value).val("0.0");
|
||||
break;
|
||||
case 'del' :
|
||||
var cash=$('#amount').text();
|
||||
$('#amount').text(cash.substr(0,cash.length-1));
|
||||
var cash=$('#'+float_value).val();
|
||||
$('#'+float_value).val(cash.substr(0,cash.length-1));
|
||||
break;
|
||||
case 'nett':
|
||||
var remain_amount = $('#validamount').val();
|
||||
$('#amount').text(remain_amount);
|
||||
$('#'+float_value).val(remain_amount);
|
||||
break;
|
||||
|
||||
}
|
||||
@@ -146,15 +152,19 @@ $(document).on('click', '.cashier_number', function(event){
|
||||
return false;
|
||||
}
|
||||
});
|
||||
})
|
||||
|
||||
|
||||
$('#voucher_pay').on('click',function(){
|
||||
var amount = $('#amount').text();
|
||||
var amount = $('#amount').val();
|
||||
var refnumber = $("#<%=@sale_id %>").val();
|
||||
var sale_id = "<%= @sale_id %>";
|
||||
if(parseFloat(amount) <= parseFloat($("#validamount").attr("value")) ){
|
||||
// alert(amount);
|
||||
// alert(refnumber);
|
||||
$.ajax({type: "POST",
|
||||
url: "<%= origami_payment_jcb_path %>",
|
||||
data: "amount="+ amount + "&sale_id="+ sale_id,
|
||||
url: "<%= origami_payment_voucher_path %>",
|
||||
data: "amount="+ amount + "&sale_id="+ sale_id+ "&refnumber="+ refnumber,
|
||||
success:function(result){
|
||||
if(result){
|
||||
alert("Payment success")
|
||||
|
||||
@@ -5,10 +5,6 @@
|
||||
<%= f.input :name %>
|
||||
<%= f.input :unique_code %>
|
||||
<%= f.input :template %>
|
||||
<%= f.input :db_name %>
|
||||
<%= f.input :db_type %>
|
||||
<%= f.input :db_username %>
|
||||
<%= f.input :db_password %>
|
||||
<%= f.input :printer_name %>
|
||||
<%= f.input :api_settings %>
|
||||
<%= f.input :page_width %>
|
||||
|
||||
@@ -16,11 +16,7 @@
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Unique code</th>
|
||||
<!--<th>Template</th>
|
||||
<th>Db name</th>
|
||||
<th>Db type</th>
|
||||
<th>Db username</th>
|
||||
<th>Db password</th> -->
|
||||
<th>Template</th>
|
||||
<th>Printer name</th>
|
||||
<th>Api settings</th>
|
||||
<th>Page width</th>
|
||||
@@ -38,11 +34,7 @@
|
||||
<tr>
|
||||
<td><%= print_setting.name %></td>
|
||||
<td><%= print_setting.unique_code %></td>
|
||||
<!--<td><%= print_setting.template %></td>
|
||||
<td><%= print_setting.db_name %></td>
|
||||
<td><%= print_setting.db_type %></td>
|
||||
<td><%= print_setting.db_username %></td>
|
||||
<td><%= print_setting.db_password %></td> -->
|
||||
<td><%= print_setting.template %></td>
|
||||
<td><%= print_setting.printer_name %></td>
|
||||
<td><%= print_setting.api_settings %></td>
|
||||
<td><%= print_setting.page_width %></td>
|
||||
|
||||
@@ -29,22 +29,6 @@
|
||||
<th>Template</th>
|
||||
<td><%= @print_setting.template %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Db name</th>
|
||||
<td><%= @print_setting.db_name %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Db type</th>
|
||||
<td><%= @print_setting.db_type %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Db username</th>
|
||||
<td><%= @print_setting.db_username %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Db password</th>
|
||||
<td><%= @print_setting.db_password %></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Printer name</th>
|
||||
<td><%= @print_setting.printer_name %></td>
|
||||
|
||||
@@ -2,10 +2,10 @@
|
||||
<%= f.error_notification %>
|
||||
|
||||
<div class="form-inputs">
|
||||
<%= f.input :item_code %>
|
||||
<%= f.input :item_code, :input_html => { :id => 'item_code' } %>
|
||||
<%= f.input :unit_price %>
|
||||
<%= f.input :taxable %>
|
||||
<%= f.input :charge_type %>
|
||||
<%= f.input :charge_type, :collection => [:hr, :day] %>
|
||||
<%= f.input :minimum_free_time %>
|
||||
<%= f.input :charge_block %>
|
||||
<%= f.input :time_rounding %>
|
||||
@@ -16,3 +16,4 @@
|
||||
<%= f.button :submit %>
|
||||
</div>
|
||||
<% end %>
|
||||
|
||||
|
||||
@@ -16,3 +16,17 @@
|
||||
</div>
|
||||
<%= render 'form', dining_charge: @dining_charge %>
|
||||
</div>
|
||||
<script>
|
||||
function randomNumber(len) {
|
||||
var randomNumber;
|
||||
var n = '';
|
||||
|
||||
for(var count = 0; count < len; count++) {
|
||||
randomNumber = Math.floor(Math.random() * 10);
|
||||
n += randomNumber.toString();
|
||||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
document.getElementById("item_code").value = "<%= @zone.id %>"+"<%= @settings_dining_facility.id %>"+"_"+randomNumber(5);
|
||||
</script>
|
||||
@@ -16,6 +16,7 @@
|
||||
<th style="width:20%">Name</th>
|
||||
<th style="width:20%">Role</th>
|
||||
<th style="width:20%">Created At</th>
|
||||
<th style="width:20%">Updated At</th>
|
||||
<th style="width:20%">Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -26,6 +27,7 @@
|
||||
<td><%= link_to employee.name,settings_employee_path(employee) %></td>
|
||||
<td><%= employee.role %></td>
|
||||
<td><%= employee.created_at.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") %></td>
|
||||
<td><%= employee.updated_at.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") %></td>
|
||||
<td>
|
||||
<%= link_to 'Edit', edit_settings_employee_path(employee) %>
|
||||
<%if employee.role != "administrator"%>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<ul class="breadcrumb">
|
||||
<li><a href="<%= root_path %>">Home</a></li>
|
||||
<li><a href="<%= settings_employees_path %>">Employee</a></li>
|
||||
|
||||
|
||||
<span style="float: right">
|
||||
</span>
|
||||
</ul>
|
||||
@@ -15,7 +15,8 @@
|
||||
<tr>
|
||||
<th>Name</th>
|
||||
<th>Role</th>
|
||||
|
||||
<th>Created At</th>
|
||||
<th>Updated At</th>
|
||||
<th>Action</th>
|
||||
</tr>
|
||||
</thead>
|
||||
@@ -24,6 +25,8 @@
|
||||
<tr>
|
||||
<td><%= @employee.name %></td>
|
||||
<td><%= @employee.role %></td>
|
||||
<td><%= @employee.created_at.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") %></td>
|
||||
<td><%= @employee.updated_at.utc.getlocal.strftime("%Y-%m-%d/%I:%M %p") %></td>
|
||||
<td>
|
||||
<%= link_to 'Edit', edit_settings_employee_path(@employee) %>
|
||||
</td>
|
||||
@@ -34,4 +37,3 @@
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
@@ -7,6 +7,28 @@
|
||||
<%= f.input :seater %>
|
||||
<%= f.input :order_by %>
|
||||
<%= f.input :is_active %>
|
||||
<% if @settings_room.dining_charges.length == 0 %>
|
||||
<% if @settings_room.id != nil %>
|
||||
<div class="div-border">
|
||||
<div class="col-md-10">
|
||||
<%= link_to 'Add For Extra Charges', new_settings_zone_room_dining_charge_path(@zone,@settings_room),:class => 'btn btn-primary' %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<% @settings_room.dining_charges.each do |dc| %>
|
||||
<div class="div-border">
|
||||
<div class="col-md-10"><b><u>Dining Charge</u></b></div>
|
||||
<div class="col-md-10">item code : <%= dc.item_code %></div>
|
||||
<div class="col-md-10">Unit price : <%= dc.unit_price %></div>
|
||||
<div class="col-md-10">Charge type : <%= dc.charge_type %></div>
|
||||
<div class="col-md-10">
|
||||
<%= link_to 'Edit Charges', edit_settings_zone_room_dining_charge_path(@zone,@settings_room,dc),:class => 'btn btn-primary' %>
|
||||
<!-- <button class="btn btn-primary" src="<%= edit_settings_zone_room_dining_charge_path(@zone,@settings_room,dc) %>">Edit Charge</button> -->
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<div class="form-actions">
|
||||
|
||||
@@ -8,11 +8,13 @@
|
||||
<%= f.input :order_by %>
|
||||
<%= f.input :is_active %>
|
||||
<% if @settings_table.dining_charges.length == 0 %>
|
||||
<div class="div-border">
|
||||
<div class="col-md-10">
|
||||
<%= link_to 'Add For Extra Charges', new_settings_zone_table_dining_charge_path(@zone,@settings_table),:class => 'btn btn-primary' %>
|
||||
</div>
|
||||
</div>
|
||||
<% if @settings_table.id != nil %>
|
||||
<div class="div-border">
|
||||
<div class="col-md-10">
|
||||
<%= link_to 'Add For Extra Charges', new_settings_zone_table_dining_charge_path(@zone,@settings_table),:class => 'btn btn-primary' %>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
<% else %>
|
||||
<% @settings_table.dining_charges.each do |dc| %>
|
||||
<div class="div-border">
|
||||
|
||||
@@ -137,6 +137,7 @@ Rails.application.routes.draw do
|
||||
post 'payment/visa' => "visa#create"
|
||||
post 'payment/paypar' => 'paypar_payments#create'
|
||||
post 'payment/credit' => 'credit_payments#create'
|
||||
post 'payment/voucher' => 'voucher_payments#create'
|
||||
|
||||
get 'sale/:sale_id/payment/credit_payment' => "credit_payments#index"
|
||||
get 'sale/:sale_id/payment/others_payment' => "others_payments#index"
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
class RemoveDBcolsFromPrintSettings < ActiveRecord::Migration[5.1]
|
||||
def change
|
||||
remove_column :print_settings, :db_name, :string
|
||||
remove_column :print_settings, :db_type, :string
|
||||
remove_column :print_settings, :db_username, :string
|
||||
remove_column :print_settings, :db_password, :string
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user