merge with august_spring
This commit is contained in:
3
.gitignore
vendored
3
.gitignore
vendored
@@ -51,3 +51,6 @@ dump.rdb
|
|||||||
|
|
||||||
# Fonts
|
# Fonts
|
||||||
public/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
|
2. Remove generators
|
||||||
3. Add installed generators
|
3. Add installed generators
|
||||||
To add new installed generators automatically delete this file and reload the project.
|
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>
|
</content>
|
||||||
<orderEntry type="inheritedJdk" />
|
<orderEntry type="inheritedJdk" />
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
<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="actioncable (v5.1.3, 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="actionmailer (v5.1.3, 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="actionpack (v5.1.3, 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="actionview (v5.1.3, 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="activejob (v5.1.3, 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="activemodel (v5.1.3, 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="activerecord (v5.1.3, 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="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="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="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" />
|
<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="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="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="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-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 (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" />
|
<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="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="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="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="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 (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" />
|
<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="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="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="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="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-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" />
|
<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 (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="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="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_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="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" />
|
<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-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-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="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-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="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="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-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" />
|
<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="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-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="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>
|
||||||
<component name="RModuleSettingsStorage">
|
<component name="RModuleSettingsStorage">
|
||||||
<LOAD_PATH number="0" />
|
<LOAD_PATH number="0" />
|
||||||
|
|||||||
900
.idea/workspace.xml
generated
900
.idea/workspace.xml
generated
File diff suppressed because it is too large
Load Diff
@@ -27,6 +27,25 @@ class Origami::SaleEditController < BaseOrigamiController
|
|||||||
saleObj.compute_without_void
|
saleObj.compute_without_void
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def item_foc
|
||||||
|
saleitemId = params[:sale_item_id]
|
||||||
|
saleitemObj = SaleItem.find(saleitemId)
|
||||||
|
saleitemObj.remark = 'foc'
|
||||||
|
saleitemObj.save
|
||||||
|
@newsaleitem = SaleItem.new
|
||||||
|
@newsaleitem = saleitemObj.dup
|
||||||
|
@newsaleitem.save
|
||||||
|
@newsaleitem.qty = saleitemObj.qty * -1
|
||||||
|
@newsaleitem.price = saleitemObj.price * -1
|
||||||
|
@newsaleitem.is_taxable = 1
|
||||||
|
@newsaleitem.product_name = saleitemObj.product_name + ' foc'
|
||||||
|
@newsaleitem.save
|
||||||
|
|
||||||
|
# re-calc tax
|
||||||
|
saleObj = Sale.find(saleitemObj.sale_id)
|
||||||
|
saleObj.compute_without_void
|
||||||
|
end
|
||||||
|
|
||||||
# def item_edit
|
# def item_edit
|
||||||
# saleitemId = params[:sale_item_id]
|
# saleitemId = params[:sale_item_id]
|
||||||
# update_qty = params[:update_qty]
|
# update_qty = params[:update_qty]
|
||||||
@@ -71,7 +90,7 @@ class Origami::SaleEditController < BaseOrigamiController
|
|||||||
def item_void_cancel
|
def item_void_cancel
|
||||||
saleitemId = params[:sale_item_id]
|
saleitemId = params[:sale_item_id]
|
||||||
saleitemObj = SaleItem.find(saleitemId)
|
saleitemObj = SaleItem.find(saleitemId)
|
||||||
both = SaleItem.where('product_code=?',saleitemObj.product_code)
|
both = SaleItem.where('product_code=?', saleitemObj.product_code)
|
||||||
both.each do |item|
|
both.each do |item|
|
||||||
if item.qty.to_i > 0
|
if item.qty.to_i > 0
|
||||||
item.remark = nil
|
item.remark = nil
|
||||||
|
|||||||
@@ -70,6 +70,6 @@ class PrintSettingsController < ApplicationController
|
|||||||
|
|
||||||
# Never trust parameters from the scary internet, only allow the white list through.
|
# Never trust parameters from the scary internet, only allow the white list through.
|
||||||
def print_setting_params
|
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
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -16,6 +16,9 @@ class Settings::DiningChargesController < ApplicationController
|
|||||||
# GET /dining_charges/new
|
# GET /dining_charges/new
|
||||||
def new
|
def new
|
||||||
@dining_charge = DiningCharge.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
|
end
|
||||||
|
|
||||||
# GET /dining_charges/1/edit
|
# GET /dining_charges/1/edit
|
||||||
@@ -29,7 +32,11 @@ class Settings::DiningChargesController < ApplicationController
|
|||||||
@dining_charge.dining_facility_id = @settings_dining_facility.id
|
@dining_charge.dining_facility_id = @settings_dining_facility.id
|
||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
if @dining_charge.save
|
if @dining_charge.save
|
||||||
|
if @table
|
||||||
format.html { redirect_to edit_settings_zone_table_path(@zone,@settings_dining_facility), notice: 'Dining charge was successfully created.' }
|
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 }
|
format.json { render :show, status: :created, location: @dining_charge }
|
||||||
else
|
else
|
||||||
format.html { render :new }
|
format.html { render :new }
|
||||||
@@ -44,7 +51,11 @@ class Settings::DiningChargesController < ApplicationController
|
|||||||
respond_to do |format|
|
respond_to do |format|
|
||||||
@dining_charge.dining_facility_id = @settings_dining_facility.id
|
@dining_charge.dining_facility_id = @settings_dining_facility.id
|
||||||
if @dining_charge.update(dining_charge_params)
|
if @dining_charge.update(dining_charge_params)
|
||||||
|
if @table
|
||||||
format.html { redirect_to edit_settings_zone_table_path(@zone,@settings_dining_facility), notice: 'Dining charge was successfully updated.' }
|
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 }
|
format.json { render :show, status: :ok, location: @dining_charge }
|
||||||
else
|
else
|
||||||
format.html { render :edit }
|
format.html { render :edit }
|
||||||
|
|||||||
@@ -5,11 +5,8 @@ class Ability
|
|||||||
user ||= Employee.new
|
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, Menu
|
||||||
can :manage, MenuCategory
|
can :manage, MenuCategory
|
||||||
can :manage, MenuItemAttribute
|
can :manage, MenuItemAttribute
|
||||||
@@ -98,7 +95,6 @@ class Ability
|
|||||||
can :create, :payment
|
can :create, :payment
|
||||||
can :reprint, :payment
|
can :reprint, :payment
|
||||||
can :rounding_adj, :payment
|
can :rounding_adj, :payment
|
||||||
can :foc, :payment
|
|
||||||
|
|
||||||
can :move_dining, :movetable
|
can :move_dining, :movetable
|
||||||
can :moving, :movetable
|
can :moving, :movetable
|
||||||
@@ -132,7 +128,5 @@ class Ability
|
|||||||
can :reprint, :payment
|
can :reprint, :payment
|
||||||
can :rounding_adj, :payment
|
can :rounding_adj, :payment
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -2,40 +2,75 @@ class DiningCharge < ApplicationRecord
|
|||||||
belongs_to :table
|
belongs_to :table
|
||||||
belongs_to :room
|
belongs_to :room
|
||||||
|
|
||||||
def amount_calculate(dining_charges_obj, checkin , checkout)
|
def self.amount_calculate(dining_charges_obj, checkin , checkout)
|
||||||
|
|
||||||
if !checkin.nil? && !checkout.nil? && !dining_charges_obj.nil?
|
if !checkin.nil? && !checkout.nil? && !dining_charges_obj.nil?
|
||||||
|
price = 0
|
||||||
minutes = ((checkin - checkout) * 24 * 60).to_i # stay minutes
|
minutes = DiningCharge.time_diff(checkout, checkin)
|
||||||
dining_minutes = minutes - dining_charges_obj.minimum_free_time # stayminutes - free minutes
|
free_time = DiningCharge.convert_to_minutes(dining_charges_obj.minimum_free_time.strftime('%H:%M'))
|
||||||
|
dining_minutes = minutes - free_time # stayminutes - free minutes
|
||||||
charge_type = dining_charges_obj.charge_type
|
charge_type = dining_charges_obj.charge_type
|
||||||
if charge_type == 'hr'
|
if charge_type == 'hr'
|
||||||
|
price = DiningCharge.charges(dining_charges_obj, dining_minutes, 'hr')
|
||||||
elsif charge_type == 'day'
|
elsif charge_type == 'day'
|
||||||
price = charge_by_day
|
price = charges(dining_charges_obj, dining_minutes, 'day')
|
||||||
end
|
end
|
||||||
|
|
||||||
|
return price
|
||||||
|
else
|
||||||
|
puts "<<<<<<<< NO"
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
def charge_by_hour
|
def self.charges(chargesObj, dining_minutes, type)
|
||||||
|
solid_price = 0
|
||||||
end
|
block = DiningCharge.convert_to_minutes(chargesObj.charge_block.strftime('%H:%M'))
|
||||||
|
result = dining_minutes / block
|
||||||
def charge_by_day(chargesObj, dining_minutes)
|
if result.to_i < 1
|
||||||
minues_per_day = 12 * 60
|
|
||||||
result = dining_minutes / minues_per_day
|
|
||||||
if result < 1
|
|
||||||
return chargesObj.unit_price
|
return chargesObj.unit_price
|
||||||
elsif result > 1
|
elsif result.to_i >= 1
|
||||||
solid_price = result * chargesObj.unit_price
|
solid_price = result * chargesObj.unit_price
|
||||||
|
remain_value = dining_minutes % block
|
||||||
remain_value = dining_minutes % minues_per_day
|
rounding_block = DiningCharge.convert_to_minutes(chargesObj.time_rounding_block.strftime('%H:%M'))
|
||||||
roundingblock = remain_value / chargesObj.time_rounding_block
|
roundingblock = remain_value / rounding_block
|
||||||
if roundingblock > 1
|
if roundingblock.to_i < 1
|
||||||
|
return DiningCharge.check_rounding(chargesObj, solid_price)
|
||||||
|
else
|
||||||
|
solid_price += roundingblock * chargesObj.time_rounding_block_price
|
||||||
|
remain_rounding = dining_minutes % block
|
||||||
|
if remain_rounding.to_i < 1
|
||||||
|
return DiningCharge.check_rounding(chargesObj, solid_price)
|
||||||
|
else
|
||||||
|
return solid_price
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.check_rounding(chargesObj)
|
||||||
|
if chargesObj.time_rounding == "down"
|
||||||
|
return solid_price
|
||||||
|
else
|
||||||
|
return solid_price += chargesObj.time_rounding_block_price
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.time_diff(start_time, end_time)
|
||||||
|
seconds_diff = (start_time - end_time).to_i.abs
|
||||||
|
hours = seconds_diff / 3600
|
||||||
|
seconds_diff -= hours * 3600
|
||||||
|
|
||||||
|
minutes = seconds_diff / 60
|
||||||
|
seconds_diff -= minutes * 60
|
||||||
|
|
||||||
|
seconds = seconds_diff
|
||||||
|
return hours * 60 + minutes
|
||||||
|
end
|
||||||
|
|
||||||
|
def self.convert_to_minutes(time)
|
||||||
|
arr = time.split(":")
|
||||||
|
hour = arr[0].to_i * 60
|
||||||
|
return hour + arr[1].to_i
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -109,6 +109,14 @@ class Sale < ApplicationRecord
|
|||||||
booking.checkout_by = requested_by.name
|
booking.checkout_by = requested_by.name
|
||||||
booking.save
|
booking.save
|
||||||
|
|
||||||
|
# dining charges
|
||||||
|
charges = DiningCharge.where('dining_facility_id=?',booking.dining_facility_id).take
|
||||||
|
if !charges.nil?
|
||||||
|
diningprice = DiningCharge.amount_calculate(charges, booking.checkin_at, booking.checkout_at)
|
||||||
|
dining_time = booking.checkin_at.strftime('%H:%M %p').to_s + " - " + booking.checkout_at.strftime('%H:%M %p').to_s
|
||||||
|
create_saleitem_diningcharges(charges, diningprice, booking.dining_facility.name, dining_time)
|
||||||
|
end
|
||||||
|
|
||||||
return true, self.id
|
return true, self.id
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -162,6 +170,20 @@ class Sale < ApplicationRecord
|
|||||||
self.sale_items << sale_item
|
self.sale_items << sale_item
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def create_saleitem_diningcharges(chargeObj, diningprice, dining_name, dining_time)
|
||||||
|
sale_item = SaleItem.new
|
||||||
|
sale_item.product_code = chargeObj.item_code
|
||||||
|
sale_item.product_name = dining_name.to_s + " ( " + dining_time.to_s + " )"
|
||||||
|
# sale_item.account_id = item.account_id
|
||||||
|
sale_item.product_alt_name = "-"
|
||||||
|
sale_item.qty = 1
|
||||||
|
sale_item.unit_price = chargeObj.unit_price
|
||||||
|
sale_item.taxable_price = diningprice
|
||||||
|
sale_item.is_taxable = chargeObj.taxable
|
||||||
|
sale_item.sale_id = self.id
|
||||||
|
sale_item.price = diningprice
|
||||||
|
sale_item.save
|
||||||
|
end
|
||||||
|
|
||||||
def update_item (item)
|
def update_item (item)
|
||||||
#save sale_audit
|
#save sale_audit
|
||||||
@@ -245,7 +267,7 @@ class Sale < ApplicationRecord
|
|||||||
rounding_adjustment = 0
|
rounding_adjustment = 0
|
||||||
|
|
||||||
sales_items.each do |item|
|
sales_items.each do |item|
|
||||||
if item.remark != 'void'
|
if item.remark != 'void' && item.remark != 'foc'
|
||||||
#compute each item and added to total
|
#compute each item and added to total
|
||||||
subtotal_price = subtotal_price + item.price
|
subtotal_price = subtotal_price + item.price
|
||||||
total_taxable = total_taxable + item.price
|
total_taxable = total_taxable + item.price
|
||||||
@@ -318,7 +340,8 @@ class Sale < ApplicationRecord
|
|||||||
tax_profiles = TaxProfile.all.order("order_by asc")
|
tax_profiles = TaxProfile.all.order("order_by asc")
|
||||||
|
|
||||||
customer = Customer.find(self.customer_id)
|
customer = Customer.find(self.customer_id)
|
||||||
# #Create new tax records
|
|
||||||
|
#Create new tax records
|
||||||
tax_profiles.each do |tax|
|
tax_profiles.each do |tax|
|
||||||
customer.tax_profiles.each do |cus_tax|
|
customer.tax_profiles.each do |cus_tax|
|
||||||
if cus_tax.to_i == tax.id
|
if cus_tax.to_i == tax.id
|
||||||
@@ -575,9 +598,7 @@ def self.get_item_query()
|
|||||||
query = query.group('i.product_code ').order("mi.account_id, mi.menu_category_id")
|
query = query.group('i.product_code ').order("mi.account_id, mi.menu_category_id")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def self.get_by_shift_items(shift_sale_range, shift, from, to, status)
|
||||||
def self.get_by_shift_items(shift_sale_range, shift, from, to, status)
|
|
||||||
|
|
||||||
# date_type_selection = get_sql_function_for_report_type(report_type)
|
# date_type_selection = get_sql_function_for_report_type(report_type)
|
||||||
|
|
||||||
query = self.get_item_query()
|
query = self.get_item_query()
|
||||||
@@ -750,6 +771,15 @@ def self.get_separate_tax(shift_sale_range=nil,shift,from,to,payment_type)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
# def self.get_separate_tax(from,to,payment_method=nil)
|
||||||
|
|
||||||
|
# query = SaleTax.select("SUM(tax_payable_amount) AS st_amount,tax_name")
|
||||||
|
# .joins("INNER JOIN sales ON sales.sale_id = sale_taxes.sale_id")
|
||||||
|
# .group("sale_taxes.tax_name")
|
||||||
|
|
||||||
|
# return query = query.where("sale_status=? and receipt_date between ? and ?","completed",from,to)
|
||||||
|
# end
|
||||||
|
|
||||||
def grand_total_after_rounding
|
def grand_total_after_rounding
|
||||||
return self.old_grand_total.to_f + self.rounding_adjustment.to_f
|
return self.old_grand_total.to_f + self.rounding_adjustment.to_f
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
class CloseCashierPdf < Prawn::Document
|
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
|
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,other_payment,total_amount_by_account,total_discount_by_account,total_member_discount)
|
|
||||||
self.page_width = 210
|
def initialize(printer_settings, shift_sale,shop_details,sale_taxes)
|
||||||
self.page_height = 7000
|
self.page_width = printer_settings.page_width #PrintSetting.where("name = ?","Close Cashier").first.page_width
|
||||||
|
self.page_height = printer_settings.page_height
|
||||||
self.margin = 5
|
self.margin = 5
|
||||||
self.price_width = 40
|
self.price_width = 40
|
||||||
self.qty_width = 20
|
self.qty_width = 20
|
||||||
@@ -170,11 +171,9 @@ class CloseCashierPdf < Prawn::Document
|
|||||||
bounding_box([self.item_description_width,y_position], :width =>self.price_width, :height => 20) do
|
bounding_box([self.item_description_width,y_position], :width =>self.price_width, :height => 20) do
|
||||||
text "#{shift_sale.credit_sales}", :size => self.item_font_size, :align => :right
|
text "#{shift_sale.credit_sales}", :size => self.item_font_size, :align => :right
|
||||||
end
|
end
|
||||||
#start other payment details
|
#start other payment details
|
||||||
if shift_sale.other_sales > 0
|
if shift_sale.other_sales > 0
|
||||||
|
|
||||||
other_payment.each do |other|
|
other_payment.each do |other|
|
||||||
|
|
||||||
y_position = cursor
|
y_position = cursor
|
||||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do
|
bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do
|
||||||
text "Other Payment Details", :size => self.item_font_size, :align => :right
|
text "Other Payment Details", :size => self.item_font_size, :align => :right
|
||||||
@@ -232,9 +231,7 @@ class CloseCashierPdf < Prawn::Document
|
|||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
else
|
else
|
||||||
|
|
||||||
y_position = cursor
|
y_position = cursor
|
||||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do
|
bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do
|
||||||
text "Other Payment :", :size => self.item_font_size, :align => :right
|
text "Other Payment :", :size => self.item_font_size, :align => :right
|
||||||
@@ -242,15 +239,14 @@ class CloseCashierPdf < Prawn::Document
|
|||||||
bounding_box([self.item_description_width,y_position], :width =>self.price_width, :height => 20) do
|
bounding_box([self.item_description_width,y_position], :width =>self.price_width, :height => 20) do
|
||||||
text "#{shift_sale.other_sales}", :size => self.item_font_size, :align => :right
|
text "#{shift_sale.other_sales}", :size => self.item_font_size, :align => :right
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
# end other payment details
|
# end other payment details
|
||||||
move_down -5
|
move_down -5
|
||||||
stroke_horizontal_rule
|
stroke_horizontal_rule
|
||||||
move_down 7
|
move_down 7
|
||||||
#start total amount by Account Like Food / Beverage /..
|
#start total amount by Account Like Food / Beverage /..
|
||||||
total_amount_by_account.each do |amount|
|
total_amount_by_account.each do |amount|
|
||||||
|
|
||||||
y_position = cursor
|
y_position = cursor
|
||||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do
|
bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do
|
||||||
text "Total #{amount.account_name} Amount:", :size => self.item_font_size, :align => :right
|
text "Total #{amount.account_name} Amount:", :size => self.item_font_size, :align => :right
|
||||||
@@ -381,8 +377,6 @@ class CloseCashierPdf < Prawn::Document
|
|||||||
stroke_horizontal_rule
|
stroke_horizontal_rule
|
||||||
move_down 5
|
move_down 5
|
||||||
move_down 5
|
move_down 5
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
class CrmOrderPdf < Prawn::Document
|
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
|
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)
|
def initialize(booking,order_items,printer_settings)
|
||||||
self.p_width = 200
|
self.page_width = PrintSetting.where("name = ?","CRM Order").first.page_width
|
||||||
self.page_height = 1450
|
self.page_height = PrintSetting.where("name = ?","CRM Order").first.page_height
|
||||||
self.margin = 10
|
self.margin = 10
|
||||||
# self.price_width = self.p_width / 2
|
# self.price_width = self.p_width / 2
|
||||||
self.price_width=80
|
self.price_width=80
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ class OrderItemPdf < Prawn::Document
|
|||||||
include ActionView::Helpers::NumberHelper
|
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
|
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)
|
def initialize(print_settings,order_item, print_status, options, alt_name)
|
||||||
self.page_width = 185
|
self.page_width = PrintSetting.where("name = ?","OrderItemPdf").first.page_width
|
||||||
self.page_height = 1450
|
self.page_height = PrintSetting.where("name = ?","OrderItemPdf").first.page_height
|
||||||
self.margin = 0
|
self.margin = 0
|
||||||
self.price_width = 40 # No Need for item
|
self.price_width = 40 # No Need for item
|
||||||
self.qty_width = 40
|
self.qty_width = 40
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ class OrderSummaryPdf < Prawn::Document
|
|||||||
include ActionView::Helpers::NumberHelper
|
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
|
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)
|
def initialize(print_settings,order, print_status, order_items = nil,alt_name)
|
||||||
self.page_width = 190
|
self.page_width = PrintSetting.where("name = ?","Order Summary").first.page_width
|
||||||
self.page_height = 1450
|
self.page_height = PrintSetting.where("name = ?","Order Summary").first.page_height
|
||||||
self.margin = 0
|
self.margin = 0
|
||||||
self.price_width = 40 # No Need for item
|
self.price_width = 40 # No Need for item
|
||||||
self.qty_width = 40
|
self.qty_width = 40
|
||||||
|
|||||||
@@ -1,8 +1,8 @@
|
|||||||
class QueueNoPdf < Prawn::Document
|
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
|
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)
|
def initialize(printer_settings, queue)
|
||||||
self.page_width = 210
|
self.page_width = PrintSetting.where("name = ?","Queue No").first.page_width
|
||||||
self.page_height = 1450
|
self.page_height = PrintSetting.where("name = ?","Queue No").first.page_height
|
||||||
self.margin = 5
|
self.margin = 5
|
||||||
self.price_width = 35
|
self.price_width = 35
|
||||||
self.qty_width = 20
|
self.qty_width = 20
|
||||||
|
|||||||
@@ -2,8 +2,8 @@ class ReceiptBillPdf < Prawn::Document
|
|||||||
include ActionView::Helpers::NumberHelper
|
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
|
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)
|
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_width = PrintSetting.where("name = ?","Receipt Bill").first.page_width
|
||||||
self.page_height = 1450
|
self.page_height = PrintSetting.where("name = ?","Receipt Bill").first.page_height
|
||||||
self.margin = 5
|
self.margin = 5
|
||||||
self.price_width = 40
|
self.price_width = 40
|
||||||
self.qty_width = 20
|
self.qty_width = 20
|
||||||
|
|||||||
@@ -1,21 +1,228 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-md-4 col-sm-6 col-md-offset-4 col-sm-offset-3">
|
<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" %>
|
<% elsif current_login_employee.role = "cashier" %>
|
||||||
<%= link_to "Cashier Station", origami_path %>
|
<%= link_to "Cashier Station", origami_path %>
|
||||||
|
|
||||||
<% elsif current_login_employee = "account" %>
|
<% elsif current_login_employee = "account" %>
|
||||||
<%= link_to "Cashier Station", oishi_path %>
|
<%= link_to "Cashier Station", oishi_path %>
|
||||||
|
|
||||||
<% else %>
|
<% else %>
|
||||||
<%= link_to "Cashier Station", oishi_path %>
|
<%= link_to "Cashier Station", oishi_path %>
|
||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
<% shop = Shop.first %>
|
<% shop = Shop.first %>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</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>
|
||||||
|
</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="footer">
|
||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="page-header center-text">
|
<div class="page-header center-text">
|
||||||
@@ -32,3 +239,44 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<style type="text/css">
|
||||||
|
.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,24 +1,28 @@
|
|||||||
<style>
|
<style>
|
||||||
.pin_pad {
|
.pin_pad {
|
||||||
width: 30%;
|
width: 30%;
|
||||||
height:70px;
|
height: 70px;
|
||||||
line-height:70px;
|
line-height: 70px;
|
||||||
text-align:center;
|
text-align: center;
|
||||||
background:#54A5AF;
|
background: #54A5AF;
|
||||||
font-size:20px;
|
font-size: 20px;
|
||||||
color:white;
|
color: white;
|
||||||
}
|
}
|
||||||
.bottom{
|
|
||||||
|
.bottom {
|
||||||
margin-bottom: 1px;
|
margin-bottom: 1px;
|
||||||
}
|
}
|
||||||
.left{
|
|
||||||
margin-left:1px;
|
.left {
|
||||||
|
margin-left: 1px;
|
||||||
}
|
}
|
||||||
.orange{
|
|
||||||
background-color:#FF7F50;
|
.orange {
|
||||||
|
background-color: #FF7F50;
|
||||||
}
|
}
|
||||||
|
|
||||||
.purple {
|
.purple {
|
||||||
background-color:#7a62d3;
|
background-color: #7a62d3;
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|
||||||
@@ -28,7 +32,7 @@
|
|||||||
<div class="card">
|
<div class="card">
|
||||||
<div class="content" style="margin:10px">
|
<div class="content" style="margin:10px">
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<%= f.input :emp_id,as: :hidden, label: "Access PIN", required: false, class: "form-control" %>
|
<%= 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" %>
|
<%= f.input :password, label: "Access PIN", required: false, class: "form-control" %>
|
||||||
</div>
|
</div>
|
||||||
@@ -64,23 +68,24 @@
|
|||||||
|
|
||||||
<% end %>
|
<% end %>
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(document).on('turbolinks:load', function() {
|
$(document).on('turbolinks:load', function () {
|
||||||
$(".pin_pad").click(function(event){
|
$(".pin_pad").click(function (event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
console.log($(this).data("value"));
|
console.log($(this).data("value"));
|
||||||
var value = $(this).data("value");
|
var value = $(this).data("value");
|
||||||
|
|
||||||
if (value == "CLR") {
|
if (value == "CLR") {
|
||||||
$("#login_form_password").val("");
|
$("#login_form_password").val("");
|
||||||
} else if(value == "ENT") {
|
} else if (value == "ENT") {
|
||||||
$("#new_login_form").submit();
|
$("#new_login_form").submit();
|
||||||
} else {
|
} else {
|
||||||
var old_value = $("#login_form_password").val();
|
var old_value = $("#login_form_password").val();
|
||||||
$("#login_form_password").val(old_value + value);
|
$("#login_form_password").val(old_value + value);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<div class="row">
|
<div class="row">
|
||||||
<!-- Column Two -->
|
<!-- Column Two -->
|
||||||
<div class="col-lg-10 col-md-10 col-sm-10">
|
<div class="col-lg-10 col-md-10 col-sm-10">
|
||||||
<div class="card" >
|
<div class="card">
|
||||||
<div class="card-header">
|
<div class="card-header">
|
||||||
<div><strong id="order-title">INVOICE DETAILS </strong></div>
|
<div><strong id="order-title">INVOICE DETAILS </strong></div>
|
||||||
</div>
|
</div>
|
||||||
@@ -13,7 +13,9 @@
|
|||||||
</span></p>
|
</span></p>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-lg-6 col-md-6 col-sm-6 text-right">
|
<div class="col-lg-6 col-md-6 col-sm-6 text-right">
|
||||||
<p>Date: <span id="receipt_date"><%= @saleobj.created_at.utc.getlocal.strftime("%d/%m/%Y - %I:%M %p") rescue '-'%></span></p>
|
<p>Date:
|
||||||
|
<span id="receipt_date"><%= @saleobj.created_at.utc.getlocal.strftime("%d/%m/%Y - %I:%M %p") rescue '-' %></span>
|
||||||
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="card-title row customer_detail hide">
|
<div class="card-title row customer_detail hide">
|
||||||
@@ -28,10 +30,12 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th width="4%">#</th>
|
<th width="4%">#</th>
|
||||||
<th class="" width="30%">Items</th>
|
<th class="" width="30%">Items</th>
|
||||||
<th style="" width="13%">QTY</td>
|
<th style="" width="13%">QTY
|
||||||
<th class="" width="13%">Price</td>
|
</td>
|
||||||
|
<th class="" width="13%">Price
|
||||||
|
</td>
|
||||||
<!-- <th class='' width="17%"> Total </th> -->
|
<!-- <th class='' width="17%"> Total </th> -->
|
||||||
<th class='' width="17%"> Action </th>
|
<th class='' width="17%"> Action</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@@ -52,41 +56,43 @@
|
|||||||
<td class='' width="30%">
|
<td class='' width="30%">
|
||||||
<%= sale_item.product_name %>
|
<%= sale_item.product_name %>
|
||||||
</td>
|
</td>
|
||||||
<% if sale_item.remark != 'void' && sale_item.remark != 'edit' %>
|
<% if sale_item.remark != 'void' && sale_item.remark != 'edit' && sale_item.remark != 'foc' %>
|
||||||
<td class='' width="13%">
|
<td class='' width="13%">
|
||||||
<input id="<%= sale_item.id%>_qty" data-id ="<%= sale_item.id %>" type="text" value="<%= sale_item.qty %>" class="form-control "/>
|
<input id="<%= sale_item.id %>_qty" data-id="<%= sale_item.id %>" type="text" value="<%= sale_item.qty %>" class="form-control "/>
|
||||||
</td>
|
</td>
|
||||||
<td class='' width="13%">
|
<td class='' width="13%">
|
||||||
<input id="<%= sale_item.id%>_price" data-id ="<%= sale_item.id %>" type="text" value="<%= sale_item.unit_price %>" class="form-control"/>
|
<input id="<%= sale_item.id %>_price" data-id="<%= sale_item.id %>" type="text" value="<%= sale_item.unit_price %>" class="form-control"/>
|
||||||
</td>
|
</td>
|
||||||
<!-- <td class='' width="17%">
|
<!-- <td class='' width="17%">
|
||||||
<input id="<%= sale_item.id%>_price" data-id ="<%= sale_item.id %>" type="text" value="<%= sale_item.price %>" class="form-control"/>
|
<input id="<%= sale_item.id %>_price" data-id ="<%= sale_item.id %>" type="text" value="<%= sale_item.price %>" class="form-control"/>
|
||||||
</td> -->
|
</td> -->
|
||||||
<td class='' width="17%">
|
<td class='' width="17%">
|
||||||
<button data-id ="<%= sale_item.id %>" class='btn btn-primary btn-md update'>Update
|
<button data-id="<%= sale_item.id %>" class='btn btn-primary btn-md update'>Update</button>
|
||||||
</button>
|
<button data-id="<%= sale_item.id %>" class='btn btn-danger btn-md void'>Void</button>
|
||||||
<button data-id ="<%= sale_item.id %>" class='btn btn-danger btn-md void'>Void</button>
|
<button data-id="<%= sale_item.id %>" class='btn btn-info btn-md foc'>FOC</button>
|
||||||
</td>
|
</td>
|
||||||
|
|
||||||
<% elsif sale_item.qty.to_i < 0 || sale_item.remark == 'edit' %>
|
<% elsif sale_item.qty.to_i < 0 || sale_item.remark == 'edit' %>
|
||||||
<td class='' width="13%">
|
<td class='' width="13%">
|
||||||
<input data-id ="<%= sale_item.id %>" type="text" value="<%= sale_item.qty %>" class="form-control" disabled/>
|
<input data-id="<%= sale_item.id %>" type="text" value="<%= sale_item.qty %>" class="form-control" disabled/>
|
||||||
</td>
|
</td>
|
||||||
<td class='' width="13%">
|
<td class='' width="13%">
|
||||||
<input data-id ="<%= sale_item.id %>" type="text" value="<%= sale_item.unit_price %>" class="form-control" disabled/>
|
<input data-id="<%= sale_item.id %>" type="text" value="<%= sale_item.unit_price %>" class="form-control" disabled/>
|
||||||
</td>
|
</td>
|
||||||
<!-- <td class='' width="17%">
|
<!-- <td class='' width="17%">
|
||||||
<input data-id ="<%= sale_item.id %>" type="text" value="<%= sale_item.price %>" class="form-control" disabled/>
|
<input data-id ="<%= sale_item.id %>" type="text" value="<%= sale_item.price %>" class="form-control" disabled/>
|
||||||
</td> -->
|
</td> -->
|
||||||
<td class='' width="17%">
|
<td class='' width="17%">
|
||||||
<button data-id ="<%= sale_item.id %>" class='btn btn-primary btn-md cancel'>Cancel Void/Update</button>
|
<button data-id="<%= sale_item.id %>" class='btn btn-primary btn-md cancel'>Cancel
|
||||||
|
Void/Update
|
||||||
|
</button>
|
||||||
</td>
|
</td>
|
||||||
<% else %>
|
<% else %>
|
||||||
<td class='' width="13%">
|
<td class='' width="13%">
|
||||||
<input data-id ="<%= sale_item.id %>" type="text" value="<%= sale_item.qty %>" class="form-control" disabled/>
|
<input data-id="<%= sale_item.id %>" type="text" value="<%= sale_item.qty %>" class="form-control" disabled/>
|
||||||
</td>
|
</td>
|
||||||
<td class='' width="13%">
|
<td class='' width="13%">
|
||||||
<input data-id ="<%= sale_item.id %>" type="text" value="<%= sale_item.price %>" class="form-control" disabled/>
|
<input data-id="<%= sale_item.id %>" type="text" value="<%= sale_item.price %>" class="form-control" disabled/>
|
||||||
</td>
|
</td>
|
||||||
<td></td>
|
<td></td>
|
||||||
<% end %>
|
<% end %>
|
||||||
@@ -114,26 +120,26 @@
|
|||||||
<!-- Column Three -->
|
<!-- Column Three -->
|
||||||
<div class="col-lg-2 col-md-2 col-sm-2">
|
<div class="col-lg-2 col-md-2 col-sm-2">
|
||||||
<!-- Waiter Buttons -->
|
<!-- Waiter Buttons -->
|
||||||
<button type="button" class="btn btn-primary btn-block" id='back' >Back</button>
|
<button type="button" class="btn btn-primary btn-block" id='back'>Back</button>
|
||||||
<button type="button" class="btn btn-primary btn-block" id='cancel_all_void' >Cancel All Void</button>
|
<button type="button" class="btn btn-primary btn-block" id='cancel_all_void'>Cancel All Void</button>
|
||||||
<button type="button" class="btn btn-primary btn-block" id='apply' >Apply</button>
|
<button type="button" class="btn btn-primary btn-block" id='apply'>Apply</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<script>
|
<script>
|
||||||
// Bill Request
|
// Bill Request
|
||||||
$(document).ready(function(){
|
$(document).ready(function () {
|
||||||
|
|
||||||
$(".update").on('click',function() {
|
$(".update").on('click', function () {
|
||||||
var sale_item_id = $(this).attr('data-id');
|
var sale_item_id = $(this).attr('data-id');
|
||||||
var qty = $('#'+sale_item_id + "_qty").val();
|
var qty = $('#' + sale_item_id + "_qty").val();
|
||||||
var price = $('#'+ sale_item_id + "_price").val();
|
var price = $('#' + sale_item_id + "_price").val();
|
||||||
console.log(qty + "|" + price)
|
console.log(qty + "|" + price)
|
||||||
var ajax_url = "/origami/item_edit";
|
var ajax_url = "/origami/item_edit";
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: ajax_url,
|
url: ajax_url,
|
||||||
data: 'sale_item_id='+ sale_item_id + "&update_qty="+qty + "&update_price="+ price,
|
data: 'sale_item_id=' + sale_item_id + "&update_qty=" + qty + "&update_price=" + price,
|
||||||
success:function(result){
|
success: function (result) {
|
||||||
$.confirm({
|
$.confirm({
|
||||||
title: 'Alert!',
|
title: 'Alert!',
|
||||||
content: 'Qty and Price was successfully Updated',
|
content: 'Qty and Price was successfully Updated',
|
||||||
@@ -142,7 +148,7 @@ $(document).ready(function(){
|
|||||||
confirm: {
|
confirm: {
|
||||||
text: 'Ok',
|
text: 'Ok',
|
||||||
btnClass: 'btn-green btn-lg',
|
btnClass: 'btn-green btn-lg',
|
||||||
action: function(){
|
action: function () {
|
||||||
location.reload();
|
location.reload();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -153,64 +159,77 @@ $(document).ready(function(){
|
|||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.void').on('click',function(){
|
$('.void').on('click', function () {
|
||||||
var sale_item_id = $(this).attr('data-id');
|
var sale_item_id = $(this).attr('data-id');
|
||||||
var ajax_url = "/origami/item_void";
|
var ajax_url = "/origami/item_void";
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: ajax_url,
|
url: ajax_url,
|
||||||
data: 'sale_item_id='+ sale_item_id,
|
data: 'sale_item_id=' + sale_item_id,
|
||||||
success:function(result){
|
success: function (result) {
|
||||||
location.reload();
|
location.reload();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|
||||||
$('.cancel').on('click',function(){
|
$('.foc').on('click', function () {
|
||||||
|
var sale_item_id = $(this).attr('data-id');
|
||||||
|
var ajax_url = "/origami/item_foc";
|
||||||
|
$.ajax({
|
||||||
|
type: "POST",
|
||||||
|
url: ajax_url,
|
||||||
|
data: 'sale_item_id=' + sale_item_id,
|
||||||
|
success: function (result) {
|
||||||
|
location.reload();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})
|
||||||
|
|
||||||
|
$('.cancel').on('click', function () {
|
||||||
var sale_item_id = $(this).attr('data-id');
|
var sale_item_id = $(this).attr('data-id');
|
||||||
var ajax_url = "/origami/item_void_cancel";
|
var ajax_url = "/origami/item_void_cancel";
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: ajax_url,
|
url: ajax_url,
|
||||||
data: 'sale_item_id='+ sale_item_id,
|
data: 'sale_item_id=' + sale_item_id,
|
||||||
success:function(result){
|
success: function (result) {
|
||||||
location.reload();
|
location.reload();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
})
|
})
|
||||||
|
|
||||||
$('#back').on('click',function(){
|
$('#back').on('click', function () {
|
||||||
var table_id = '<%= @table_id %>'
|
var table_id = '<%= @table_id %>'
|
||||||
window.location.href = '/origami/table/'+ table_id;
|
window.location.href = '/origami/table/' + table_id;
|
||||||
})
|
})
|
||||||
|
|
||||||
$('#cancel_all_void').on('click',function(){
|
$('#cancel_all_void').on('click', function () {
|
||||||
var sale_id = "<%= @saleobj.sale_id %>"
|
var sale_id = "<%= @saleobj.sale_id %>"
|
||||||
var ajax_url = "/origami/cancel_all_void";
|
var ajax_url = "/origami/cancel_all_void";
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: ajax_url,
|
url: ajax_url,
|
||||||
data: 'sale_id='+ sale_id,
|
data: 'sale_id=' + sale_id,
|
||||||
success:function(result){
|
success: function (result) {
|
||||||
location.reload();
|
location.reload();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
|
|
||||||
$('#apply').on('click',function(){
|
$('#apply').on('click', function () {
|
||||||
var sale_id = "<%= @saleobj.sale_id %>"
|
var sale_id = "<%= @saleobj.sale_id %>"
|
||||||
var ajax_url = "/origami/apply_void";
|
var ajax_url = "/origami/apply_void";
|
||||||
var table_id = '<%= @table_id %>'
|
var table_id = '<%= @table_id %>'
|
||||||
$.ajax({
|
$.ajax({
|
||||||
type: "POST",
|
type: "POST",
|
||||||
url: ajax_url,
|
url: ajax_url,
|
||||||
data: 'sale_id='+ sale_id,
|
data: 'sale_id=' + sale_id,
|
||||||
success:function(result){
|
success: function (result) {
|
||||||
window.location.href = '/origami/table/'+ table_id ;
|
window.location.href = '/origami/table/' + table_id;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@@ -5,10 +5,6 @@
|
|||||||
<%= f.input :name %>
|
<%= f.input :name %>
|
||||||
<%= f.input :unique_code %>
|
<%= f.input :unique_code %>
|
||||||
<%= f.input :template %>
|
<%= 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 :printer_name %>
|
||||||
<%= f.input :api_settings %>
|
<%= f.input :api_settings %>
|
||||||
<%= f.input :page_width %>
|
<%= f.input :page_width %>
|
||||||
|
|||||||
@@ -16,11 +16,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<th>Name</th>
|
<th>Name</th>
|
||||||
<th>Unique code</th>
|
<th>Unique code</th>
|
||||||
<!--<th>Template</th>
|
<th>Template</th>
|
||||||
<th>Db name</th>
|
|
||||||
<th>Db type</th>
|
|
||||||
<th>Db username</th>
|
|
||||||
<th>Db password</th> -->
|
|
||||||
<th>Printer name</th>
|
<th>Printer name</th>
|
||||||
<th>Api settings</th>
|
<th>Api settings</th>
|
||||||
<th>Page width</th>
|
<th>Page width</th>
|
||||||
@@ -38,11 +34,7 @@
|
|||||||
<tr>
|
<tr>
|
||||||
<td><%= print_setting.name %></td>
|
<td><%= print_setting.name %></td>
|
||||||
<td><%= print_setting.unique_code %></td>
|
<td><%= print_setting.unique_code %></td>
|
||||||
<!--<td><%= print_setting.template %></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.printer_name %></td>
|
<td><%= print_setting.printer_name %></td>
|
||||||
<td><%= print_setting.api_settings %></td>
|
<td><%= print_setting.api_settings %></td>
|
||||||
<td><%= print_setting.page_width %></td>
|
<td><%= print_setting.page_width %></td>
|
||||||
|
|||||||
@@ -29,22 +29,6 @@
|
|||||||
<th>Template</th>
|
<th>Template</th>
|
||||||
<td><%= @print_setting.template %></td>
|
<td><%= @print_setting.template %></td>
|
||||||
</tr>
|
</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>
|
<tr>
|
||||||
<th>Printer name</th>
|
<th>Printer name</th>
|
||||||
<td><%= @print_setting.printer_name %></td>
|
<td><%= @print_setting.printer_name %></td>
|
||||||
|
|||||||
@@ -2,10 +2,10 @@
|
|||||||
<%= f.error_notification %>
|
<%= f.error_notification %>
|
||||||
|
|
||||||
<div class="form-inputs">
|
<div class="form-inputs">
|
||||||
<%= f.input :item_code %>
|
<%= f.input :item_code, :input_html => { :id => 'item_code' } %>
|
||||||
<%= f.input :unit_price %>
|
<%= f.input :unit_price %>
|
||||||
<%= f.input :taxable %>
|
<%= f.input :taxable %>
|
||||||
<%= f.input :charge_type %>
|
<%= f.input :charge_type, :collection => [:hr, :day] %>
|
||||||
<%= f.input :minimum_free_time %>
|
<%= f.input :minimum_free_time %>
|
||||||
<%= f.input :charge_block %>
|
<%= f.input :charge_block %>
|
||||||
<%= f.input :time_rounding %>
|
<%= f.input :time_rounding %>
|
||||||
@@ -16,3 +16,4 @@
|
|||||||
<%= f.button :submit %>
|
<%= f.button :submit %>
|
||||||
</div>
|
</div>
|
||||||
<% end %>
|
<% end %>
|
||||||
|
|
||||||
|
|||||||
@@ -16,3 +16,17 @@
|
|||||||
</div>
|
</div>
|
||||||
<%= render 'form', dining_charge: @dining_charge %>
|
<%= render 'form', dining_charge: @dining_charge %>
|
||||||
</div>
|
</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>
|
||||||
@@ -7,6 +7,28 @@
|
|||||||
<%= f.input :seater %>
|
<%= f.input :seater %>
|
||||||
<%= f.input :order_by %>
|
<%= f.input :order_by %>
|
||||||
<%= f.input :is_active %>
|
<%= 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>
|
||||||
|
|
||||||
<div class="form-actions">
|
<div class="form-actions">
|
||||||
|
|||||||
@@ -8,11 +8,13 @@
|
|||||||
<%= f.input :order_by %>
|
<%= f.input :order_by %>
|
||||||
<%= f.input :is_active %>
|
<%= f.input :is_active %>
|
||||||
<% if @settings_table.dining_charges.length == 0 %>
|
<% if @settings_table.dining_charges.length == 0 %>
|
||||||
|
<% if @settings_table.id != nil %>
|
||||||
<div class="div-border">
|
<div class="div-border">
|
||||||
<div class="col-md-10">
|
<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' %>
|
<%= link_to 'Add For Extra Charges', new_settings_zone_table_dining_charge_path(@zone,@settings_table),:class => 'btn btn-primary' %>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
<% end %>
|
||||||
<% else %>
|
<% else %>
|
||||||
<% @settings_table.dining_charges.each do |dc| %>
|
<% @settings_table.dining_charges.each do |dc| %>
|
||||||
<div class="div-border">
|
<div class="div-border">
|
||||||
|
|||||||
@@ -80,6 +80,7 @@ Rails.application.routes.draw do
|
|||||||
post 'moving' => "movetable#moving"
|
post 'moving' => "movetable#moving"
|
||||||
get "/table/:table_id/sale/:sale_id/edit" => "sale_edit#edit"
|
get "/table/:table_id/sale/:sale_id/edit" => "sale_edit#edit"
|
||||||
post 'item_void' => "sale_edit#item_void"
|
post 'item_void' => "sale_edit#item_void"
|
||||||
|
post 'item_foc' => "sale_edit#item_foc"
|
||||||
post 'item_edit' => "sale_edit#item_edit"
|
post 'item_edit' => "sale_edit#item_edit"
|
||||||
post 'item_void_cancel' => "sale_edit#item_void_cancel"
|
post 'item_void_cancel' => "sale_edit#item_void_cancel"
|
||||||
post 'cancel_all_void' => 'sale_edit#cancel_all_void'
|
post 'cancel_all_void' => 'sale_edit#cancel_all_void'
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ class CreateDiningCharges < ActiveRecord::Migration[5.1]
|
|||||||
t.time :charge_block
|
t.time :charge_block
|
||||||
t.string :time_rounding, :default => "down"
|
t.string :time_rounding, :default => "down"
|
||||||
t.time :time_rounding_block
|
t.time :time_rounding_block
|
||||||
|
t.integer :time_rounding_block_price, :default => 0
|
||||||
t.timestamps
|
t.timestamps
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -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