Merge branch 'foodcourt' of gitlab.com:code2lab/SXRestaurant into foodcourt

This commit is contained in:
NyanLinHtut
2020-02-28 11:02:41 +06:30
33 changed files with 152 additions and 125 deletions

View File

@@ -1,8 +1,8 @@
GIT
remote: https://github.com/capistrano/rbenv.git
revision: b8807f3bbb3f424ac42cc8838a38822e028d0aa3
revision: 5e5d655e9b4820adebefb58f760e8d889ed49449
specs:
capistrano-rbenv (2.1.4)
capistrano-rbenv (2.1.6)
capistrano (~> 3.1)
sshkit (~> 1.3)
@@ -62,10 +62,10 @@ GEM
axlsx (>= 2.0.1)
bcrypt (3.1.13)
bindex (0.8.1)
builder (3.2.3)
byebug (11.0.1)
builder (3.2.4)
byebug (11.1.1)
cancancan (1.17.0)
capistrano (3.11.2)
capistrano (3.12.0)
airbrussh (>= 1.0.0)
i18n
rake (>= 10.0.0)
@@ -83,7 +83,7 @@ GEM
activemodel (>= 4.0.0)
activesupport (>= 4.0.0)
mime-types (>= 1.16)
chartkick (3.2.2)
chartkick (3.3.1)
chronic (0.10.2)
chunky_png (1.3.11)
coffee-rails (4.2.2)
@@ -93,11 +93,11 @@ GEM
coffee-script-source
execjs
coffee-script-source (1.12.2)
concurrent-ruby (1.1.5)
concurrent-ruby (1.1.6)
connection_pool (2.2.2)
crass (1.0.5)
crass (1.0.6)
cups (0.0.7)
database_cleaner (1.7.0)
database_cleaner (1.8.3)
diff-lcs (1.3)
erubi (1.9.0)
execjs (2.7.0)
@@ -106,9 +106,9 @@ GEM
factory_girl_rails (4.9.0)
factory_girl (~> 4.9.0)
railties (>= 3.0.0)
faker (2.6.0)
i18n (>= 1.6, < 1.8)
ffi (1.11.1)
faker (2.10.2)
i18n (>= 1.6, < 2)
ffi (1.12.2)
filterrific (5.2.1)
font-awesome-rails (4.7.0.5)
railties (>= 3.2, < 6.1)
@@ -117,10 +117,10 @@ GEM
htmlentities (4.3.4)
httparty (0.15.7)
multi_xml (>= 0.5.2)
i18n (1.7.0)
i18n (1.8.2)
concurrent-ruby (~> 1.0)
jbuilder (2.9.1)
activesupport (>= 4.2.0)
jbuilder (2.10.0)
activesupport (>= 5.0.0)
jquery-fileupload-rails (0.4.7)
actionpack (>= 3.1)
railties (>= 3.1)
@@ -131,7 +131,7 @@ GEM
thor (>= 0.14, < 2.0)
jquery-ui-rails (6.0.1)
railties (>= 3.2.16)
json (2.2.0)
json (2.3.0)
kaminari (1.0.1)
activesupport (>= 4.1.0)
kaminari-actionview (= 1.0.1)
@@ -147,7 +147,7 @@ GEM
listen (3.0.8)
rb-fsevent (~> 0.9, >= 0.9.4)
rb-inotify (~> 0.9, >= 0.9.7)
loofah (2.3.1)
loofah (2.4.0)
crass (~> 1.0.2)
nokogiri (>= 1.5.9)
mail (2.7.1)
@@ -155,42 +155,43 @@ GEM
material_icons (2.2.1)
railties (>= 3.2)
method_source (0.9.2)
mime-types (3.3)
mime-types (3.3.1)
mime-types-data (~> 3.2015)
mime-types-data (3.2019.1009)
mini_magick (4.9.5)
mini_magick (4.10.1)
mini_mime (1.0.2)
mini_portile2 (2.4.0)
minitest (5.12.2)
minitest (5.14.0)
momentjs-rails (2.20.1)
railties (>= 3.1)
multi_xml (0.6.0)
mysql2 (0.5.2)
mysql2 (0.5.3)
nested_form (0.3.2)
net-scp (2.0.0)
net-ssh (>= 2.6.5, < 6.0.0)
net-ssh (5.2.0)
nio4r (2.5.2)
nokogiri (1.10.4)
nokogiri (1.10.8)
mini_portile2 (~> 2.4.0)
pdf-core (0.7.0)
pdfjs_viewer-rails (0.3.1)
json (> 1.8.4)
rails (> 4.2.0)
sass-rails (~> 5.0)
pg (1.1.4)
pg (1.2.2)
prawn (2.2.2)
pdf-core (~> 0.7.0)
ttfunk (~> 1.5)
prawn-qrcode (0.4.0)
prawn-qrcode (0.5.1)
prawn (>= 1)
rqrcode (>= 1.0.0)
prawn-table (0.2.2)
prawn (>= 1.3.0, < 3.0.0)
puma (3.12.1)
rack (2.0.7)
rack-cors (1.0.3)
rack-protection (2.0.7)
puma (3.12.2)
rack (2.0.9)
rack-cors (1.1.1)
rack (>= 2.0.0)
rack-protection (2.0.8.1)
rack
rack-test (1.1.0)
rack (>= 1.0, < 3)
@@ -217,27 +218,27 @@ GEM
method_source
rake (>= 0.8.7)
thor (>= 0.18.1, < 2.0)
rake (13.0.0)
rake (13.0.1)
rb-fsevent (0.10.3)
rb-inotify (0.10.0)
rb-inotify (0.10.1)
ffi (~> 1.0)
redis (3.3.5)
request_store (1.4.1)
request_store (1.5.0)
rack (>= 1.4)
roo (1.13.2)
nokogiri
rubyzip
spreadsheet (> 0.6.4)
rqrcode (1.1.1)
rqrcode (1.1.2)
chunky_png (~> 1.0)
rqrcode_core (~> 0.1.0)
rqrcode_core (0.1.0)
rspec-core (3.9.0)
rspec-support (~> 3.9.0)
rqrcode_core (~> 0.1)
rqrcode_core (0.1.1)
rspec-core (3.9.1)
rspec-support (~> 3.9.1)
rspec-expectations (3.9.0)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.9.0)
rspec-mocks (3.9.0)
rspec-mocks (3.9.1)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.9.0)
rspec-rails (3.9.0)
@@ -248,7 +249,7 @@ GEM
rspec-expectations (~> 3.9.0)
rspec-mocks (~> 3.9.0)
rspec-support (~> 3.9.0)
rspec-support (3.9.0)
rspec-support (3.9.2)
ruby-ole (1.2.12.2)
rubyzip (1.0.0)
sass (3.7.4)
@@ -266,15 +267,15 @@ GEM
activesupport (>= 3.2.1)
shoulda-matchers (3.1.3)
activesupport (>= 4.0.0)
sidekiq (5.2.7)
sidekiq (5.2.8)
connection_pool (~> 2.2, >= 2.2.2)
rack (>= 1.5.0)
rack (< 2.1.0)
rack-protection (>= 1.5.0)
redis (>= 3.3.5, < 5)
simple_form (5.0.1)
simple_form (5.0.2)
actionpack (>= 5.0)
activemodel (>= 5.0)
spreadsheet (1.2.5)
spreadsheet (1.2.6)
ruby-ole (>= 1.0)
spring (2.1.0)
spring-watcher-listen (2.0.1)
@@ -292,16 +293,16 @@ GEM
net-ssh (>= 2.8.0)
tether-rails (1.4.0)
rails (>= 3.1)
thor (0.20.3)
thor (1.0.1)
thread_safe (0.3.6)
tilt (2.0.10)
to_xls-rails (1.3.1)
spreadsheet (>= 0.8.5)
ttfunk (1.5.1)
ttfunk (1.6.2.1)
turbolinks (5.2.1)
turbolinks-source (~> 5.2)
turbolinks-source (5.2.0)
tzinfo (1.2.5)
tzinfo (1.2.6)
thread_safe (~> 0.1)
uglifier (4.2.0)
execjs (>= 0.3.0, < 3)
@@ -381,7 +382,7 @@ DEPENDENCIES
whenever
RUBY VERSION
ruby 2.4.1p111
ruby 2.6.5p114
BUNDLED WITH
2.0.2

View File

@@ -24,8 +24,8 @@ $(document).ready(function() {
});
$('#order-detail-slimscroll').slimScroll({
height: $('#order-detail-slimscroll').attr('data-height'),
// height: height-$('#order-detail-slimscroll').attr('data-height'),
// height: $('#order-detail-slimscroll').attr('data-height'),
height: height-$('#order-detail-slimscroll').attr('data-height'),
size: '5px',
color: 'rgba(0,0,0,0.5)',
alwaysVisible: false,

View File

@@ -45,7 +45,7 @@ class Settings::TaxProfilesController < ApplicationController
# POST /settings/tax_profiles
# POST /settings/tax_profiles.json
def create
@settings_tax_profile = TaxProfile.new(settings_tax_profile_params)
@settings_tax_profile.created_by = current_login_employee.name
respond_to do |format|
@@ -109,6 +109,6 @@ class Settings::TaxProfilesController < ApplicationController
# Never trust parameters from the scary internet, only allow the white list through.
def settings_tax_profile_params
params.require(:tax_profile).permit(:name, :group_type, :rate, :inclusive, :order_by, :created_by)
params.require(:tax_profile).permit(:name, :group_type, :rate, :inclusive, :order_by, :created_by,:tax_type)
end
end

View File

@@ -486,15 +486,18 @@ class Sale < ApplicationRecord
# substract , to give after discount
total_tax = total_taxable - total_discount
#include or execulive
if tax.inclusive
tax_incl_exec = "inclusive"
rate = tax.rate
divided_value = (100 + rate)/rate
sale_tax.tax_payable_amount = total_tax / divided_value
if tax.tax_type.to_s =="Net"
sale_tax.tax_payable_amount = tax.rate
else
sale_tax.tax_payable_amount = total_tax * tax.rate / 100
if tax.inclusive
tax_incl_exec = "inclusive"
rate = tax.rate
divided_value = (100 + rate)/rate
sale_tax.tax_payable_amount = total_tax / divided_value
else
sale_tax.tax_payable_amount = total_tax * tax.rate / 100
end
end
sale_tax.inclusive = tax.inclusive
sale_tax.save
@@ -609,16 +612,19 @@ class Sale < ApplicationRecord
# substract , to give after discount
total_tax = total_taxable - self.total_discount
#include or execulive
if tax.inclusive
tax_incl_exec = "inclusive"
rate = tax.rate
divided_value = (100 + rate)/rate
sale_tax.tax_payable_amount = total_tax / divided_value
if tax.tax_type.to_s =="Net"
sale_tax.tax_payable_amount = tax.rate
else
sale_tax.tax_payable_amount = total_tax * tax.rate / 100
#include or execulive
if tax.inclusive
tax_incl_exec = "inclusive"
rate = tax.rate
divided_value = (100 + rate)/rate
sale_tax.tax_payable_amount = total_tax / divided_value
else
sale_tax.tax_payable_amount = total_tax * tax.rate / 100
end
end
sale_tax.inclusive = tax.inclusive
sale_tax.save
@@ -2048,7 +2054,6 @@ def self.get_sale_data_for_other_payment_credit(sale_id)
end
def unique_tax_profiles(order_source, customer_id)
puts "unique_tax_profiles unique_tax_profiles"
tax_data = TaxProfile.where(group_type: order_source)
customer_tax_profiles = Customer.select(:tax_profiles).where(customer_id: customer_id).first

View File

@@ -7,7 +7,7 @@ class TaxProfile < ApplicationRecord
def self.calculate_tax(group_type)
divided_value =0.0
exclusive =0.0
tax_profiles = TaxProfile.where(group_type: group_type)
tax_profiles = TaxProfile.where(group_type: group_type,tax_type: 'Percentage')
if !tax_profiles.empty?
tax_profiles.each do |tax|
#include or execulive

View File

@@ -38,7 +38,7 @@ class OrderItemCustomisePdf < Prawn::Document
text "Mobile Order", :size => self.header_font_size,:align => :center, :style=>:bold
move_down 1
y_position = cursor
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
bounding_box([0,y_position], :width =>self.item_description_width) do
text "#{order_item.contact_no}", :size => self.header_font_size,:align => :left
end
if !order_item.dining.nil?

View File

@@ -39,7 +39,7 @@ class OrderItemPdf < Prawn::Document
text "Mobile Order", :size => self.header_font_size,:align => :center, :style=>:bold
move_down 1
y_position = cursor
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
bounding_box([0,y_position], :width =>self.item_description_width) do
text "#{order_item.contact_no}", :size => self.header_font_size,:align => :left
end
if !order_item.dining.nil?

View File

@@ -38,7 +38,7 @@ class OrderItemSlimCustomisePdf < Prawn::Document
text "Mobile Order", :size => self.header_font_size,:align => :center, :style=>:bold
move_down 1
y_position = cursor
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
bounding_box([0,y_position], :width =>self.item_description_width) do
text "#{order_item_slim.contact_no}", :size => self.header_font_size,:align => :left
end
if !order_item_slim.dining.nil?

View File

@@ -38,7 +38,7 @@ class OrderItemSlimPdf < Prawn::Document
text "Mobile Order", :size => self.header_font_size,:align => :center, :style=>:bold
move_down 1
y_position = cursor
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
bounding_box([0,y_position], :width =>self.item_description_width) do
text "#{order_item_slim.contact_no}", :size => self.header_font_size,:align => :left
end
if !order_item.dining.nil?

View File

@@ -39,7 +39,7 @@ class OrderItemStarPdf < Prawn::Document
text "Mobile Order", :size => self.header_font_size,:align => :center, :style=>:bold
move_down 1
y_position = cursor
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
bounding_box([0,y_position], :width =>self.item_description_width) do
text "#{order_item.contact_no}", :size => self.header_font_size,:align => :left
end
if !order_item.dining.nil?

View File

@@ -38,7 +38,7 @@ class OrderSetItemCustomisePdf < Prawn::Document
text "Mobile Order", :size => self.header_font_size,:align => :center, :style=>:bold
move_down 1
y_position = cursor
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
bounding_box([0,y_position], :width =>self.item_description_width) do
text "#{order_set_item.contact_no}", :size => self.header_font_size,:align => :left
end
if !order_set_item.dining.nil?

View File

@@ -37,7 +37,7 @@ class OrderSetItemPdf < Prawn::Document
text "Mobile Order", :size => self.header_font_size,:align => :center, :style=>:bold
move_down 1
y_position = cursor
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
bounding_box([0,y_position], :width =>self.item_description_width) do
text "#{order_set_item.contact_no}", :size => self.header_font_size,:align => :left
end
if !order_set_item.dining.nil?

View File

@@ -37,7 +37,7 @@ class OrderSummaryCustomisePdf < Prawn::Document
text "Mobile Order", :size => self.header_font_size,:align => :center, :style=>:bold
move_down 1
y_position = cursor
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
bounding_box([0,y_position], :width =>self.item_description_width) do
text "#{order[0].contact_no}", :size => self.header_font_size,:align => :left
end
if !order_item.dining.nil?

View File

@@ -36,7 +36,7 @@ class OrderSummaryPdf < Prawn::Document
text "Mobile Order", :size => self.header_font_size,:align => :center, :style=>:bold
move_down 1
y_position = cursor
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
bounding_box([0,y_position], :width =>self.item_description_width) do
text "#{order[0].contact_no}", :size => self.header_font_size,:align => :left
end
if !order[0].dining.nil?

View File

@@ -37,7 +37,7 @@ class OrderSummarySetCustomisePdf < Prawn::Document
text "Mobile Order", :size => self.header_font_size,:align => :center, :style=>:bold
move_down 1
y_position = cursor
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
bounding_box([0,y_position], :width =>self.item_description_width) do
text "#{order[0].contact_no}", :size => self.header_font_size,:align => :left
end
if !order[0].dining.nil?

View File

@@ -37,7 +37,7 @@ class OrderSummarySetPdf < Prawn::Document
text "Mobile Order", :size => self.header_font_size,:align => :center, :style=>:bold
move_down 1
y_position = cursor
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
bounding_box([0,y_position], :width =>self.item_description_width) do
text "#{order[0].contact_no}", :size => self.header_font_size,:align => :left
end
if !order[0].dining.nil?

View File

@@ -37,7 +37,7 @@ class OrderSummarySlimCustomisePdf < Prawn::Document
text "Mobile Order", :size => self.header_font_size,:align => :center, :style=>:bold
move_down 1
y_position = cursor
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
bounding_box([0,y_position], :width =>self.item_description_width) do
text "#{order[0].contact_no}", :size => self.header_font_size,:align => :left
end
if !order[0].dining.nil?

View File

@@ -36,7 +36,7 @@ class OrderSummarySlimPdf < Prawn::Document
text "Mobile Order", :size => self.header_font_size,:align => :center, :style=>:bold
move_down 1
y_position = cursor
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
bounding_box([0,y_position], :width =>self.item_description_width) do
text "#{order[0].contact_no}", :size => self.header_font_size,:align => :left
end
if !order[0].dining.nil?

View File

@@ -43,12 +43,12 @@ class ReceiptBillA5Pdf < Prawn::Document
header(shop_details)
if sale_data.orders[0].source =='app'
move_down 3
move_down 2
y_position = cursor
text "Mobile Order", :size => self.header_font_size,:align => :center, :style=>:bold
move_down 2
y_position = cursor
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
bounding_box([0,y_position], :width =>self.item_description_width) do
text "#{sale_data.customer.contact_no}", :size => self.header_font_size,:align => :left
end
if !sale_data.bookings[0].dining_facility.nil?
@@ -345,9 +345,14 @@ class ReceiptBillA5Pdf < Prawn::Document
sale_data.sale_taxes.each do |st|
move_down line_move
y_position = cursor
bounding_box([0,y_position], :width =>self.description_width, :height => self.item_height) do
text "#{ st.tax_name } (#{incl_tax} #{ st.tax_rate.to_i }%)", :size => self.item_font_size,:align => :left
if st.tax_rate.to_i == st.tax_payable_amount.to_i
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
text "#{ st.tax_name }", :size => self.item_font_size,:align => :left
end
else
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
text "#{ st.tax_name } (#{incl_tax} #{ st.tax_rate.to_i }%)", :size => self.item_font_size,:align => :left
end
end
bounding_box([self.description_width,y_position], :width =>self.label_width) do
text "#{number_format(st.tax_payable_amount, :precision => precision.to_i, :delimiter => delimiter)}" , :size => self.item_font_size,:align => :right

View File

@@ -44,12 +44,12 @@ class ReceiptBillOrderPdf < Prawn::Document
header(shop_details)
if sale_data.orders[0].source =='app'
move_down 3
move_down 2
y_position = cursor
text "Mobile Order", :size => self.header_font_size,:align => :center, :style=>:bold
move_down 2
y_position = cursor
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
bounding_box([0,y_position], :width =>self.item_description_width) do
text "#{sale_data.customer.contact_no}", :size => self.header_font_size,:align => :left
end
if !sale_data.bookings[0].dining_facility.nil?

View File

@@ -47,12 +47,11 @@ class ReceiptBillPdf < Prawn::Document
header(shop_details)
if sale_data.orders[0].source =='app'
move_down 3
y_position = cursor
move_down 2
text "Mobile Order", :size => self.header_font_size,:align => :center, :style=>:bold
move_down 2
y_position = cursor
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
bounding_box([0,y_position], :width =>self.item_description_width) do
text "#{sale_data.customer.contact_no}", :size => self.header_font_size,:align => :left
end
if !sale_data.bookings[0].dining_facility.nil?
@@ -405,9 +404,14 @@ class ReceiptBillPdf < Prawn::Document
sale_data.sale_taxes.each do |st|
move_down line_move
y_position = cursor
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
text "#{ st.tax_name } (#{incl_tax} #{ st.tax_rate.to_i }%)", :size => self.item_font_size,:align => :left
if st.tax_rate.to_i == st.tax_payable_amount.to_i
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
text "#{ st.tax_name }", :size => self.item_font_size,:align => :left
end
else
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
text "#{ st.tax_name } (#{incl_tax} #{ st.tax_rate.to_i }%)", :size => self.item_font_size,:align => :left
end
end
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
text "#{number_format(st.tax_payable_amount, :precision => precision.to_i, :delimiter => delimiter)}" , :size => self.item_font_size,:align => :right

View File

@@ -45,12 +45,12 @@ class ReceiptBillStarPdf < Prawn::Document
header(shop_details)
if sale_data.orders[0].source =='app'
move_down 3
move_down 2
y_position = cursor
text "Mobile Order", :size => self.header_font_size,:align => :center, :style=>:bold
move_down 2
y_position = cursor
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
bounding_box([0,y_position], :width =>self.item_description_width) do
text "#{sale_data.customer.contact_no}", :size => self.header_font_size,:align => :left
end
if !sale_data.bookings[0].dining_facility.nil?
@@ -341,9 +341,14 @@ class ReceiptBillStarPdf < Prawn::Document
sale_data.sale_taxes.each do |st|
move_down line_move
y_position = cursor
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
text "#{ st.tax_name } (#{incl_tax} #{ st.tax_rate.to_i }%)", :size => self.item_font_size,:align => :left
if st.tax_rate.to_i == st.tax_payable_amount.to_i
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
text "#{ st.tax_name }", :size => self.item_font_size,:align => :left
end
else
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
text "#{ st.tax_name } (#{incl_tax} #{ st.tax_rate.to_i }%)", :size => self.item_font_size,:align => :left
end
end
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
text "#{number_format(st.tax_payable_amount, :precision => precision.to_i, :delimiter => delimiter)}" , :size => self.item_font_size,:align => :right

View File

@@ -1,8 +1,9 @@
if @result
if @result
json.status true
json.sent_pin true
elsif @cus
json.status true
json.customer_id @cus.id
elsif @cus
json.status true
json.sent_pin false
json.customer_id @cus.id
else

View File

@@ -165,7 +165,7 @@
</div>
<div class="card-block">
<div class="card-text" id="order-detail-slimscroll" data-height="480">
<div class="card-text" id="order-detail-slimscroll" data-height="140">
<table class="table table-striped summary-items" id="order-items-table" >
<thead>
<tr>

View File

@@ -41,21 +41,21 @@ if (menu.menu_categories)
attr_format = []
# Format for attributes json
if item.item_attributes.count > 0
item_attributes = @item_attributes.select{ |x| item.item_attributes.include?(x.id.to_s) }
attr_format = item_attributes.group_by {|att| att.attribute_type }.map { |type, values| {type: type, values: values.map(&:name)} }
item_attributes = item.item_attributes.map(&:to_s)
attr_format = @item_attributes.select { |x| item_attributes.include?(x.id.to_s) }.group_by {|att| att.attribute_type.strip }.map { |type, values| {type: type, values: values.map { |x| x.name.strip } } }
end
# Format for option json
opt_format = []
# Format for attributes json
if item.item_options.count > 0
item_options = @item_options.select{ |x| item.item_options.include?(x.id.to_s) }
opt_format = item_options.group_by {|opt| opt.option_type }.map { |type, values| {type: type, values: values.map(&:name)} }
item_options = item.item_options.map(&:to_s)
opt_format = @item_options.select { |x| item_options.include?(x.id.to_s) }.group_by {|opt| opt.option_type.strip }.map { |type, values| {type: type, values: values.map { |x| x.name.strip } } }
end
#Menu Item Information
json.id item.id
json.code item.item_code
json.code item.item_code
json.name item.name
json.alt_name item.alt_name
json.image item.image_path.url
@@ -69,15 +69,14 @@ if (menu.menu_categories)
json.unit item.unit
# Item Sets of Menu Item
json.item_sets item.item_sets.map { |its|
{ id: its.id,
name: its.name,
alt_name: its.alt_name,
min_selectable_qty: its.min_selectable_qty,
max_selectable_qty: its.max_selectable_qty,
instances: its.menu_item_instances.map { |i| {id: i.id} }
}
}
json.item_sets item.item_sets do |its|
json.id its.id
json.name its.name
json.alt_name its.alt_name
json.min_selectable_qty its.min_selectable_qty
json.max_selectable_qty its.max_selectable_qty
json.instances its.menu_item_instances.map { |i| {id: i.id} }
end
json.attributes attr_format
json.options opt_format
@@ -85,7 +84,8 @@ if (menu.menu_categories)
json.instances item.menu_item_instances do |is|
if is.is_available
# Convert id to name for attributes
instance_attr = @item_attributes.select{ |x| item.item_attributes.include?(x.id) }.pluck(:name)
item_attributes = is.item_attributes.map(&:to_s)
instance_attr = @item_attributes.select{ |x| item_attributes.include?(x.id.to_s) }.pluck(:name)
json.id is.id
json.code is.item_instance_code

View File

@@ -103,7 +103,7 @@
</div>
</div>
<div class="card-body">
<div class="card-text" id="order-detail-slimscroll" data-height="230">
<div class="card-text" id="order-detail-slimscroll" data-height="335">
<table class="table table-striped summary-items">
<thead>
<tr>

View File

@@ -79,7 +79,7 @@
</button>
<div class="card-block">
<div class="card-text" id="order-detail-slimscroll" data-height="420">
<div class="card-text" id="order-detail-slimscroll" data-height="140">
<table class="table table-striped summary-items" id="order-items-table" >
<thead>
<tr>

View File

@@ -37,7 +37,7 @@
</button>
<br>
<div class="card-block">
<div class="card-text" id="order-detail-slimscroll" data-height="420">
<div class="card-text" id="order-detail-slimscroll" data-height="140">
<table class="table table-striped summary-items" id="order-items-table" >
<thead>
<tr>

View File

@@ -243,7 +243,7 @@
</div>
<div class="card-block">
<div class="card-text" id="order-detail-slimscroll" data-height="420">
<div class="card-text" id="order-detail-slimscroll" data-height="140">
<table class="table table-striped summary-items" id="order-items-table" >
<thead>
<tr>

View File

@@ -276,7 +276,7 @@
</div>
</div>
</div>
<div id="order-detail-slimscroll" data-height="<%= @status_sale=="sale" ? 270 : 415%>">
<div id="order-detail-slimscroll" data-height="<%= @status_sale=="sale" ? 300 : 160%>">
<div class="card-text" >
<table class="table table-striped" id="order-items-table">
<thead>

View File

@@ -131,7 +131,7 @@
</div>
</div>
<div id="order-detail-slimscroll" data-height="430">
<div id="order-detail-slimscroll" data-height="140">
<div class="card-text" style="">
<table class="table table-striped" id="order-items-table">
<thead>

View File

@@ -12,6 +12,8 @@
<%= f.input :group_type, :collection => Lookup.collection_of("tax_profiles"),:input_html=>{:class=>"col-md-10"},:required=>true %>
<%= f.input :name, :input_html=>{:onchange=>"checkDuplicate(this.value);"} %>
<span id="tax_profile_nameErr" style="color:red;"></span>
<%= f.input :tax_type,input_html: { :class => 'form-control select' },
collection: %w{Net Percentage},:label => "Tax Type" %>
<%= f.input :rate %>
<%= f.input :inclusive %>
<%= f.input :order_by %>
@@ -44,7 +46,7 @@
2) <%= t("views.right_panel.button.back") %> - <%= t("views.right_panel.detail.back_txt") %> <%= t("views.right_panel.detail.tax_profiles_txt") %> <br>
</p>
</div>
</div>
</div>
</div>
</div>
@@ -69,4 +71,3 @@
}
}
</script>

View File

@@ -0,0 +1,5 @@
class AddColumnTaxType < ActiveRecord::Migration[5.1]
def change
add_column :tax_profiles, :tax_type, :string, default: "Percentage"
end
end