diff --git a/Gemfile.lock b/Gemfile.lock index bbcc1085..d780a96d 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -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 diff --git a/app/assets/javascripts/custom.js b/app/assets/javascripts/custom.js index abde0bd5..620b9321 100644 --- a/app/assets/javascripts/custom.js +++ b/app/assets/javascripts/custom.js @@ -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, diff --git a/app/controllers/settings/tax_profiles_controller.rb b/app/controllers/settings/tax_profiles_controller.rb index ddf4781a..9ad0b0fc 100755 --- a/app/controllers/settings/tax_profiles_controller.rb +++ b/app/controllers/settings/tax_profiles_controller.rb @@ -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 diff --git a/app/models/sale.rb b/app/models/sale.rb index dd7cacf5..954674bb 100644 --- a/app/models/sale.rb +++ b/app/models/sale.rb @@ -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 diff --git a/app/models/tax_profile.rb b/app/models/tax_profile.rb index 5d85239d..955d58fa 100755 --- a/app/models/tax_profile.rb +++ b/app/models/tax_profile.rb @@ -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 diff --git a/app/pdf/order_item_customise_pdf.rb b/app/pdf/order_item_customise_pdf.rb index a9681eee..f1a36b98 100644 --- a/app/pdf/order_item_customise_pdf.rb +++ b/app/pdf/order_item_customise_pdf.rb @@ -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? diff --git a/app/pdf/order_item_pdf.rb b/app/pdf/order_item_pdf.rb index aaa034f1..382eafa3 100755 --- a/app/pdf/order_item_pdf.rb +++ b/app/pdf/order_item_pdf.rb @@ -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? diff --git a/app/pdf/order_item_slim_customise_pdf.rb b/app/pdf/order_item_slim_customise_pdf.rb index c27a5bf1..7b1e1140 100644 --- a/app/pdf/order_item_slim_customise_pdf.rb +++ b/app/pdf/order_item_slim_customise_pdf.rb @@ -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? diff --git a/app/pdf/order_item_slim_pdf.rb b/app/pdf/order_item_slim_pdf.rb index 2bb258e0..7e3ec54f 100755 --- a/app/pdf/order_item_slim_pdf.rb +++ b/app/pdf/order_item_slim_pdf.rb @@ -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? diff --git a/app/pdf/order_item_star_pdf.rb b/app/pdf/order_item_star_pdf.rb index 14d78ab3..2d56ee36 100644 --- a/app/pdf/order_item_star_pdf.rb +++ b/app/pdf/order_item_star_pdf.rb @@ -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? diff --git a/app/pdf/order_set_item_customise_pdf.rb b/app/pdf/order_set_item_customise_pdf.rb index 77e850d8..2572c20b 100644 --- a/app/pdf/order_set_item_customise_pdf.rb +++ b/app/pdf/order_set_item_customise_pdf.rb @@ -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? diff --git a/app/pdf/order_set_item_pdf.rb b/app/pdf/order_set_item_pdf.rb index cc783105..cf0b331c 100755 --- a/app/pdf/order_set_item_pdf.rb +++ b/app/pdf/order_set_item_pdf.rb @@ -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? diff --git a/app/pdf/order_summary_customise_pdf.rb b/app/pdf/order_summary_customise_pdf.rb index a8fe66f5..f717989a 100644 --- a/app/pdf/order_summary_customise_pdf.rb +++ b/app/pdf/order_summary_customise_pdf.rb @@ -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? diff --git a/app/pdf/order_summary_pdf.rb b/app/pdf/order_summary_pdf.rb index aff234e3..b8584d1d 100755 --- a/app/pdf/order_summary_pdf.rb +++ b/app/pdf/order_summary_pdf.rb @@ -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? diff --git a/app/pdf/order_summary_set_customise_pdf.rb b/app/pdf/order_summary_set_customise_pdf.rb index 1ac87414..66c36a0c 100644 --- a/app/pdf/order_summary_set_customise_pdf.rb +++ b/app/pdf/order_summary_set_customise_pdf.rb @@ -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? diff --git a/app/pdf/order_summary_set_pdf.rb b/app/pdf/order_summary_set_pdf.rb index f4a4a428..da7b5e84 100755 --- a/app/pdf/order_summary_set_pdf.rb +++ b/app/pdf/order_summary_set_pdf.rb @@ -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? diff --git a/app/pdf/order_summary_slim_customise_pdf.rb b/app/pdf/order_summary_slim_customise_pdf.rb index 6d8c4015..f838cd43 100644 --- a/app/pdf/order_summary_slim_customise_pdf.rb +++ b/app/pdf/order_summary_slim_customise_pdf.rb @@ -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? diff --git a/app/pdf/order_summary_slim_pdf.rb b/app/pdf/order_summary_slim_pdf.rb index a025a337..45541a7c 100755 --- a/app/pdf/order_summary_slim_pdf.rb +++ b/app/pdf/order_summary_slim_pdf.rb @@ -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? diff --git a/app/pdf/receipt_bill_a5_pdf.rb b/app/pdf/receipt_bill_a5_pdf.rb index 9c60cd6b..def21291 100644 --- a/app/pdf/receipt_bill_a5_pdf.rb +++ b/app/pdf/receipt_bill_a5_pdf.rb @@ -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 diff --git a/app/pdf/receipt_bill_order_pdf.rb b/app/pdf/receipt_bill_order_pdf.rb index 4eaf5b2b..acdde592 100644 --- a/app/pdf/receipt_bill_order_pdf.rb +++ b/app/pdf/receipt_bill_order_pdf.rb @@ -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? diff --git a/app/pdf/receipt_bill_pdf.rb b/app/pdf/receipt_bill_pdf.rb index 2f8ba8ed..1d07956f 100755 --- a/app/pdf/receipt_bill_pdf.rb +++ b/app/pdf/receipt_bill_pdf.rb @@ -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 diff --git a/app/pdf/receipt_bill_star_pdf.rb b/app/pdf/receipt_bill_star_pdf.rb index 0670b2f9..0af4ec0d 100644 --- a/app/pdf/receipt_bill_star_pdf.rb +++ b/app/pdf/receipt_bill_star_pdf.rb @@ -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 diff --git a/app/views/api/verifications/new.json.jbuilder b/app/views/api/verifications/new.json.jbuilder index d642e169..59887275 100644 --- a/app/views/api/verifications/new.json.jbuilder +++ b/app/views/api/verifications/new.json.jbuilder @@ -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 diff --git a/app/views/foodcourt/addorders/detail.html.erb b/app/views/foodcourt/addorders/detail.html.erb index 8bc47878..703206a1 100644 --- a/app/views/foodcourt/addorders/detail.html.erb +++ b/app/views/foodcourt/addorders/detail.html.erb @@ -165,7 +165,7 @@