diff --git a/Gemfile b/Gemfile index 63dfa163..73701b6c 100644 --- a/Gemfile +++ b/Gemfile @@ -12,7 +12,7 @@ gem 'rails', '~> 5.1.0' #gem 'mysql2', '>= 0.3.18', '< 0.5' gem 'pg' -gem 'mysql2', '>= 0.3.18', '< 0.5' +gem 'mysql2' #Use PosgreSQL @@ -41,12 +41,13 @@ gem 'rack-cors' # image upload gem 'carrierwave', '~> 1.0' gem 'mini_magick' -gem 'jquery-fileupload-rails' +gem 'jquery-fileupload-rails', '~> 0.4.7' #Report and Printing gems gem 'cups' gem 'prawn' gem 'prawn-table' +gem 'prawn-qrcode' gem 'to_xls-rails' gem 'rubyzip', '= 1.0.0' gem 'axlsx', '= 2.0.1' diff --git a/Gemfile.lock b/Gemfile.lock index a983f5c1..0db34edf 100644 --- a/Gemfile.lock +++ b/Gemfile.lock @@ -1,88 +1,92 @@ GIT remote: https://github.com/capistrano/rbenv.git - revision: c029e4128e4a8f25adda35795f5729bd4f62e51f + revision: b8807f3bbb3f424ac42cc8838a38822e028d0aa3 specs: - capistrano-rbenv (2.1.3) + capistrano-rbenv (2.1.4) capistrano (~> 3.1) sshkit (~> 1.3) GEM remote: https://rubygems.org/ specs: - actioncable (5.1.4) - actionpack (= 5.1.4) + actioncable (5.1.7) + actionpack (= 5.1.7) nio4r (~> 2.0) websocket-driver (~> 0.6.1) - actionmailer (5.1.4) - actionpack (= 5.1.4) - actionview (= 5.1.4) - activejob (= 5.1.4) + actionmailer (5.1.7) + actionpack (= 5.1.7) + actionview (= 5.1.7) + activejob (= 5.1.7) mail (~> 2.5, >= 2.5.4) rails-dom-testing (~> 2.0) - actionpack (5.1.4) - actionview (= 5.1.4) - activesupport (= 5.1.4) + actionpack (5.1.7) + actionview (= 5.1.7) + activesupport (= 5.1.7) rack (~> 2.0) rack-test (>= 0.6.3) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.2) - actionview (5.1.4) - activesupport (= 5.1.4) + actionview (5.1.7) + activesupport (= 5.1.7) builder (~> 3.1) erubi (~> 1.4) rails-dom-testing (~> 2.0) rails-html-sanitizer (~> 1.0, >= 1.0.3) - activejob (5.1.4) - activesupport (= 5.1.4) + activejob (5.1.7) + activesupport (= 5.1.7) globalid (>= 0.3.6) - activemodel (5.1.4) - activesupport (= 5.1.4) - activerecord (5.1.4) - activemodel (= 5.1.4) - activesupport (= 5.1.4) + activemodel (5.1.7) + activesupport (= 5.1.7) + activerecord (5.1.7) + activemodel (= 5.1.7) + activesupport (= 5.1.7) arel (~> 8.0) - activesupport (5.1.4) + activesupport (5.1.7) concurrent-ruby (~> 1.0, >= 1.0.2) - i18n (~> 0.7) + i18n (>= 0.7, < 2) minitest (~> 5.1) tzinfo (~> 1.1) aescrypt (1.0.0) - airbrussh (1.3.0) + airbrussh (1.4.0) sshkit (>= 1.6.1, != 1.7.0) arel (8.0.0) axlsx (2.0.1) htmlentities (~> 4.3.1) nokogiri (>= 1.4.1) rubyzip (~> 1.0.0) - axlsx_rails (0.5.1) + axlsx_rails (0.5.2) actionpack (>= 3.1) axlsx (>= 2.0.1) - bcrypt (3.1.11) - bindex (0.5.0) + bcrypt (3.1.13) + bindex (0.8.1) builder (3.2.3) - byebug (9.1.0) + byebug (11.0.1) cancancan (1.17.0) capistrano (3.10.1) airbrussh (>= 1.0.0) i18n rake (>= 10.0.0) sshkit (>= 1.9.0) - capistrano-bundler (1.3.0) + capistrano-bundler (1.6.0) capistrano (~> 3.1) - sshkit (~> 1.2) - capistrano-rails (1.3.1) + capistrano-rails (1.4.0) capistrano (~> 3.1) capistrano-bundler (~> 1.1) +<<<<<<< HEAD capistrano3-puma (3.1.1) capistrano (~> 3.7) capistrano-bundler puma (~> 3.4) carrierwave (1.2.1) +======= + carrierwave (1.3.1) +>>>>>>> b025cc2cfd2b10df84cc1cee458efa4eef108752 activemodel (>= 4.0.0) activesupport (>= 4.0.0) mime-types (>= 1.16) - chartkick (2.2.5) + chartkick (3.2.1) chronic (0.10.2) + chunky_png (1.3.11) coffee-rails (4.2.2) coffee-script (>= 2.2.0) railties (>= 4.0.0) @@ -90,46 +94,45 @@ GEM coffee-script-source execjs coffee-script-source (1.12.2) - concurrent-ruby (1.0.5) - connection_pool (2.2.1) - crass (1.0.2) + concurrent-ruby (1.1.5) + connection_pool (2.2.2) + crass (1.0.5) cups (0.1.10) - database_cleaner (1.6.2) + database_cleaner (1.7.0) diff-lcs (1.3) - erubi (1.7.0) + erubi (1.9.0) execjs (2.7.0) factory_girl (4.9.0) activesupport (>= 3.0.0) factory_girl_rails (4.9.0) factory_girl (~> 4.9.0) railties (>= 3.0.0) - faker (1.8.4) - i18n (~> 0.5) - ffi (1.9.18) - filterrific (2.1.2) - font-awesome-rails (4.7.0.2) - railties (>= 3.2, < 5.2) - globalid (0.4.1) + faker (2.5.0) + i18n (~> 1.6.0) + ffi (1.11.1) + filterrific (5.2.1) + font-awesome-rails (4.7.0.5) + railties (>= 3.2, < 6.1) + globalid (0.4.2) activesupport (>= 4.2.0) htmlentities (4.3.4) - httparty (0.15.6) + httparty (0.15.7) multi_xml (>= 0.5.2) - i18n (0.9.1) + i18n (1.7.0) concurrent-ruby (~> 1.0) - jbuilder (2.7.0) + jbuilder (2.9.1) activesupport (>= 4.2.0) - multi_json (>= 1.2) jquery-fileupload-rails (0.4.7) actionpack (>= 3.1) railties (>= 3.1) sass (>= 3.2) - jquery-rails (4.3.1) + jquery-rails (4.3.5) rails-dom-testing (>= 1, < 3) railties (>= 4.2.0) thor (>= 0.14, < 2.0) jquery-ui-rails (6.0.1) railties (>= 3.2.16) - json (2.1.0) + json (2.2.0) kaminari (1.0.1) activesupport (>= 4.1.0) kaminari-actionview (= 1.0.1) @@ -145,108 +148,114 @@ GEM listen (3.0.8) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) - loofah (2.1.1) + loofah (2.3.0) crass (~> 1.0.2) nokogiri (>= 1.5.9) - mail (2.7.0) + mail (2.7.1) mini_mime (>= 0.1.1) material_icons (2.2.1) railties (>= 3.2) - method_source (0.9.0) - mime-types (3.1) + method_source (0.9.2) + mime-types (3.3) mime-types-data (~> 3.2015) - mime-types-data (3.2016.0521) - mini_magick (4.8.0) - mini_mime (1.0.0) - mini_portile2 (2.3.0) - minitest (5.10.3) - momentjs-rails (2.17.1) + mime-types-data (3.2019.1009) + mini_magick (4.9.5) + mini_mime (1.0.2) + mini_portile2 (2.4.0) + minitest (5.12.2) + momentjs-rails (2.20.1) railties (>= 3.1) - multi_json (1.12.2) multi_xml (0.6.0) - mysql2 (0.4.10) + mysql2 (0.5.2) nested_form (0.3.2) - net-scp (1.2.1) - net-ssh (>= 2.6.5) - net-ssh (4.2.0) - nio4r (2.1.0) - nokogiri (1.8.1) - mini_portile2 (~> 2.3.0) + 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) + mini_portile2 (~> 2.4.0) pdf-core (0.7.0) - pdfjs_viewer-rails (0.2.0) + pdfjs_viewer-rails (0.3.1) json (> 1.8.4) rails (> 4.2.0) sass-rails (~> 5.0) - pg (0.21.0) + pg (1.1.4) prawn (2.2.2) pdf-core (~> 0.7.0) ttfunk (~> 1.5) + prawn-qrcode (0.4.0) + prawn (>= 1) + rqrcode (>= 1.0.0) prawn-table (0.2.2) prawn (>= 1.3.0, < 3.0.0) - puma (3.10.0) - rack (2.0.3) - rack-cors (1.0.2) - rack-protection (2.0.0) + puma (3.12.1) + rack (2.0.7) + rack-cors (1.0.3) + rack-protection (2.0.7) rack - rack-test (0.7.0) + rack-test (1.1.0) rack (>= 1.0, < 3) - rails (5.1.4) - actioncable (= 5.1.4) - actionmailer (= 5.1.4) - actionpack (= 5.1.4) - actionview (= 5.1.4) - activejob (= 5.1.4) - activemodel (= 5.1.4) - activerecord (= 5.1.4) - activesupport (= 5.1.4) + rails (5.1.7) + actioncable (= 5.1.7) + actionmailer (= 5.1.7) + actionpack (= 5.1.7) + actionview (= 5.1.7) + activejob (= 5.1.7) + activemodel (= 5.1.7) + activerecord (= 5.1.7) + activesupport (= 5.1.7) bundler (>= 1.3.0) - railties (= 5.1.4) + railties (= 5.1.7) sprockets-rails (>= 2.0.0) rails-dom-testing (2.0.3) activesupport (>= 4.2.0) nokogiri (>= 1.6) - rails-html-sanitizer (1.0.3) - loofah (~> 2.0) - railties (5.1.4) - actionpack (= 5.1.4) - activesupport (= 5.1.4) + rails-html-sanitizer (1.3.0) + loofah (~> 2.3) + railties (5.1.7) + actionpack (= 5.1.7) + activesupport (= 5.1.7) method_source rake (>= 0.8.7) thor (>= 0.18.1, < 2.0) - rake (12.2.1) - rb-fsevent (0.10.2) - rb-inotify (0.9.10) - ffi (>= 0.5.0, < 2) + rake (13.0.0) + rb-fsevent (0.10.3) + rb-inotify (0.10.0) + ffi (~> 1.0) redis (3.3.5) roo (1.13.2) nokogiri rubyzip spreadsheet (> 0.6.4) - rspec-core (3.7.0) - rspec-support (~> 3.7.0) - rspec-expectations (3.7.0) + rqrcode (1.1.1) + chunky_png (~> 1.0) + rqrcode_core (~> 0.1.0) + rqrcode_core (0.1.0) + rspec-core (3.8.2) + rspec-support (~> 3.8.0) + rspec-expectations (3.8.5) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.7.0) - rspec-mocks (3.7.0) + rspec-support (~> 3.8.0) + rspec-mocks (3.8.2) diff-lcs (>= 1.2.0, < 2.0) - rspec-support (~> 3.7.0) - rspec-rails (3.7.1) + rspec-support (~> 3.9.0) + rspec-rails (3.9.0) actionpack (>= 3.0) activesupport (>= 3.0) railties (>= 3.0) - rspec-core (~> 3.7.0) - rspec-expectations (~> 3.7.0) - rspec-mocks (~> 3.7.0) - rspec-support (~> 3.7.0) - rspec-support (3.7.0) - ruby-ole (1.2.12.1) + rspec-core (~> 3.8.0) + rspec-expectations (~> 3.8.0) + rspec-mocks (~> 3.8.0) + rspec-support (~> 3.8.0) + rspec-support (3.8.3) + ruby-ole (1.2.12.2) rubyzip (1.0.0) - sass (3.5.3) + sass (3.7.4) sass-listen (~> 4.0.0) sass-listen (4.0.0) rb-fsevent (~> 0.9, >= 0.9.4) rb-inotify (~> 0.9, >= 0.9.7) - sass-rails (5.0.6) + sass-rails (5.0.7) railties (>= 4.0.0, < 6) sass (~> 3.1) sprockets (>= 2.8, < 4.0) @@ -254,57 +263,57 @@ GEM tilt (>= 1.1, < 3) schema_to_scaffold (0.8.0) activesupport (>= 3.2.1) - shoulda-matchers (3.1.2) + shoulda-matchers (3.1.3) activesupport (>= 4.0.0) - sidekiq (5.0.5) - concurrent-ruby (~> 1.0) - connection_pool (~> 2.2, >= 2.2.0) + sidekiq (5.2.7) + connection_pool (~> 2.2, >= 2.2.2) + rack (>= 1.5.0) rack-protection (>= 1.5.0) - redis (>= 3.3.4, < 5) - simple_form (3.5.0) - actionpack (> 4, < 5.2) - activemodel (> 4, < 5.2) - spreadsheet (1.1.4) + redis (>= 3.3.5, < 5) + simple_form (5.0.1) + actionpack (>= 5.0) + activemodel (>= 5.0) + spreadsheet (1.2.4) ruby-ole (>= 1.0) spring (2.0.2) activesupport (>= 4.2) spring-watcher-listen (2.0.1) listen (>= 2.7, < 4.0) spring (>= 1.2, < 3.0) - sprockets (3.7.1) + sprockets (3.7.2) concurrent-ruby (~> 1.0) rack (> 1, < 3) sprockets-rails (3.2.1) actionpack (>= 4.0) activesupport (>= 4.0) sprockets (>= 3.0.0) - sshkit (1.15.1) + sshkit (1.20.0) net-scp (>= 1.1.2) net-ssh (>= 2.8.0) tether-rails (1.4.0) rails (>= 3.1) - thor (0.20.0) + thor (0.20.3) thread_safe (0.3.6) - tilt (2.0.8) + tilt (2.0.10) to_xls-rails (1.3.1) spreadsheet (>= 0.8.5) ttfunk (1.5.1) - turbolinks (5.0.1) - turbolinks-source (~> 5) - turbolinks-source (5.0.3) - tzinfo (1.2.4) + turbolinks (5.2.1) + turbolinks-source (~> 5.2) + turbolinks-source (5.2.0) + tzinfo (1.2.5) thread_safe (~> 0.1) - uglifier (3.2.0) + uglifier (4.2.0) execjs (>= 0.3.0, < 3) - web-console (3.5.1) + web-console (3.7.0) actionview (>= 5.0) activemodel (>= 5.0) bindex (>= 0.4.0) railties (>= 5.0) websocket-driver (0.6.5) websocket-extensions (>= 0.1.0) - websocket-extensions (0.1.2) - whenever (0.9.7) + websocket-extensions (0.1.4) + whenever (1.0.0) chronic (>= 0.6.3) PLATFORMS @@ -333,7 +342,7 @@ DEPENDENCIES font-awesome-rails (~> 4.7, >= 4.7.0.2) httparty (~> 0.15.5) jbuilder (~> 2.5) - jquery-fileupload-rails + jquery-fileupload-rails (~> 0.4.7) jquery-rails jquery-ui-rails kaminari (~> 1.0.1) @@ -341,11 +350,12 @@ DEPENDENCIES material_icons mini_magick momentjs-rails - mysql2 (>= 0.3.18, < 0.5) + mysql2 nested_form pdfjs_viewer-rails pg prawn + prawn-qrcode prawn-table puma (~> 3.0) rack-cors @@ -370,7 +380,7 @@ DEPENDENCIES whenever RUBY VERSION - ruby 2.4.1p111 + ruby 2.3.1p112 BUNDLED WITH 2.0.2 diff --git a/README.md b/README.md index 0621cc43..4d81b144 100755 --- a/README.md +++ b/README.md @@ -17,7 +17,7 @@ Osaka => Campaign Id => {"campaign_type_id": 5} BITP - Auth Token => pZBHXEFbGNj/G => New => V3 + Auth Token => pZBHXEFbGNj/G => New => V3 iua0SjUHzRaQw => rj0MJ0XI5GsKZehE => Old => V2 => code2lab => Old @@ -34,11 +34,11 @@ Person and Extra Time 2) must create Adult and Child in settings/item_attributes 3) must be PSA_[a-z/0-9] for Adult and PSC_[a-z/0-9] for Child in settings/menu_categories/[cat_id]/simple_menu_items 3) must be PSAI_[a-z/0-9] for Adult and PSCI_[a-z/0-9] for Child in settings/simple_menu_items/[item_id]/menu_item_instances - -For Extra Time - item_instance_code + +For Extra Time + item_instance_code * must start with 'Ext'[a..z]'_'[1..100] - * note : don't add character after '_' + * note : don't add character after '_' For Order Printing 1)) ********* Order Pdf ********* @@ -50,18 +50,18 @@ For Order Printing 1) settings/print_settings (a) Unique Code => OrderSetItemPdf & OrderSummarySetPdf (b) Font is present => {Header font size:11, Item Font Size:9} - Font is blank => {Header font size:12, Item Font Size:10} + Font is blank => {Header font size:12, Item Font Size:10} 3)) ********* Order Slim Pdf ********* 1) settings/print_settings (a) Unique Code => OrderItemSlimPdf & OrderSummarySlimPdf (b) Font is present => {Header font size:11, Item Font Size:9} Font is blank => {Header font size:12, Item Font Size:10} 4)) ********* Order Customise PDF ********* - 1) settings/print_settings + 1) settings/print_settings (a) Unique Code => OrderItemCustomisePdf & OrderSummaryCustomisePdf - (b) Can change Header font size and Item Font Size as you like + (b) Can change Header font size and Item Font Size as you like 5)) ********* Order Set Pdf ********* - 1) settings/print_settings + 1) settings/print_settings (a) Unique Code => OrderSetItemCustomisePdf & OrderSummarySetCustomisePdf (b) Can change Header font size and Item Font Size as you like 6)) ********* Order Slim Customise PDF @@ -82,6 +82,23 @@ For ReceiptBillA5Pdf For ReceiptBillAltName options 1) settings/lookups => { type:print_settings, name:ReceiptBillAltName, value:1 } +For Using Star Printer + *** Need to change these print settings + 1) settings/print_settings/unique_code => OrderItemStarPdf + 2) settings/print_settings/unique_code => ReceiptBillStarPdf + 3) settings/print_settings/unique_code => SaleItemsStarPdf + *** Other print settings aren't need to change. + +For Show Sale Items Summary at CloseCashierPrint + 1) settings/print_settings + a) Check => Shift Sale Items + +For Show/Hide AddOrder Button in QuickService + 1) settings/lookups => {type:quickservice_add_order, name: QuickServiceAddOrder, value:1 OR 0} + +For Show Print Button in ReceiptNo Report + 1) settings/lookups => {type:reprint_receipt, name: Reprint Receipt in Report, value:1} + For Bank Integration setting 1) rake db:migrate for card_sale_trans, card_settle_trans 2) settings/lookups => { type:bank_integration, name: Bank Integration, value:1 } @@ -100,20 +117,20 @@ For call waiter pdf i) Name : Calling Waiter ii) Unique Code: CallWaiterPdf iii)Template: ... - iv) Font: Zawgyi-One + iv) Font: Zawgyi-One v) Printer: #printer name Membership Actions SQL * update membership_actions set additional_parameter='{\"campaign_type_id\":5}' where id=10; SQL Update after rake clear:data runned - * update seed_generators + * update seed_generators i) TableBooking, Order, OrderItem, sale, SaleOrder, SaleItem, SaleTax, SalePayment, SaleAudit, AssignedOrderItem => { current:0, next:0 } - ** Note :: do not update Customer + ** Note :: do not update Customer Change type in mysql *run if you got font error for Myanmar, Chinese, etc... - => ALTER TABLE [table_name] CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci #for table + => ALTER TABLE [table_name] CONVERT TO CHARACTER SET utf8 COLLATE utf8_unicode_ci #for table => ALTER DATABASE [database_name] CHARACTER SET utf8 COLLATE utf8_unicode_ci #for database For split bill @@ -124,9 +141,9 @@ For Sidekiq => Create New Lookups => lookup_type = sidekiq, Name = sidekiq , Value = 1 or 0 For Clear Menu - 1) rake clear:menu # menu,menu item,menu category,menu item instance,account,item option,item attribute,item set - -For Check CUp status + 1) rake clear:menu # menu,menu item,menu category,menu item instance,account,item option,item attribute,item set + +For Check CUp status ###please open sudo cat /etc/sudoers ### cope and parse @@ -177,16 +194,16 @@ For CloseCashierCustomisePdf in lookups 1) settings/print_settings 2) settings/lookups => { type:print_settings, name: CloseCashierCustomisePdf, value:1 } -<---- Extra Fields Script -----> -For MoveTablePdf in lookups +<---- Extra Fields Script -----> +For MoveTablePdf in lookups *** Both Table and Room Moving *** 1) settings/lookups => { type:print_settings, name: MoveTablePdf, value:1 } -For MoveTablePdf in print settings - * Backend > Printer > Print Settings > New - i) Name : Move Table - ii) Unique Code: MoveTablePdf - iii)Template: ... +For MoveTablePdf in print settings + * Backend > Printer > Print Settings > New + i) Name : Move Table + ii) Unique Code: MoveTablePdf + iii)Template: ... iv) Font: Zawgyi-One v) Printer: #printer name /* Tax Profile Group Types in lookups */ @@ -200,7 +217,7 @@ For MoveTablePdf in print settings 1) settings/lookups => { type:ReceiptPdfView, name: Receipt Pdf View, value:1 or 0 } => 1 is active and 0 is in-active -Add Kitchen Role of Employee +Add Kitchen Role of Employee => 1) settings/lookups => { type:employee_roles, name: Kitchen, value:kitchen } Add Base URL for DOEMAL @@ -235,12 +252,12 @@ For Login expiry time Menu Image (Import guideline) - => First, check shop_code, is there in shops table and prefix shop_code in image name? + => First, check shop_code, is there in shops table and prefix shop_code in image name? => You all must do this step * If there is shop_code in shops table (mark in one place/ note and set NULL for this record for a while) and prefix shop_code for image name (like (121_ABC.png)), and copy and paste images into Application/[sxrestaurant]/public/image/menu_images. * If there is shop_code/ no shop_code in shops table but no prefix in image name (* skip set NULL step) , copy and paste images into Application/…./image/menu_images. => Second, import [menu].xlsx file in /settings/menus and then checked image is uploaded into Application/[sxrestaurant]/public/image/menu_images and insert into menu_items table in database. - => Last, if shop has shop_code, update marked/noted shop_code into shops table again. + => Last, if shop has shop_code, update marked/noted shop_code into shops table again. For Edit Order Open & Close 1) settings/lookups => {type:edit_order, name:EditOrderOrigami, value: {1 or 0}} @@ -273,13 +290,22 @@ For Online Order Receipt Setting 1) settings/lookups => { type:order_reservation, name:ReceiptBill, value: {0 or 1} } 2) settings/print_settings => {name: ReceiptBillOrder, unique_code: ReceiptBillOrderPdf, ....} +For Close Cashier Print Settings +settings/lookups => {type:close_cashier_print, name:CloseCashierPrint, value: {0 or 1} } + +For Second Display View Setting +settings/lookups => {type:display_type, name: Display Type, value: 2} + +For show total before tax in receipt bill +settings/lookups => {type:show_total_before_tax, name:Show Total Before Tax, value: {0 or 1}} + * ToDo list 1. Migration 2. Quick Service 3. Order & Reservation - + * System Dependencies * Configuration @@ -299,7 +325,7 @@ For Online Order Receipt Setting 1. OQS - 1. Filter + 1. Filter 2. Order Item to each Stations 3. Edit Order Item @@ -313,12 +339,12 @@ For Online Order Receipt Setting 3. CRM - 1. Customer Management + 1. Customer Management 2. Queue Management - + 4. Backend - + 1. Dining Setup 2. Queue Station Setup @@ -355,19 +381,17 @@ For Online Order Receipt Setting 1. 2-Column => Main Content - col-9, Information - col-3 2. 3-Column => Sub Lint - col-2, Main Content - col-7, Information - col-3 - > Pixel + > Pixel Main Header Bar - height => 50 px Side Navigation - Weight => 230 px Main Content Padding => 15 px 2. Color - + > BUTTON 1. Submit/Add/Edit/Confirm buttons => btn-primary (theme color) 2. Show/Detail Buttons => btn-info 3. Delete => btn-delete 4. Cancel/Back => btn-default - - diff --git a/app/assets/images/online_order_icon.png b/app/assets/images/online_order_icon.png new file mode 100644 index 00000000..b9e74994 Binary files /dev/null and b/app/assets/images/online_order_icon.png differ diff --git a/app/assets/images/user_icon.png b/app/assets/images/user_icon.png new file mode 100644 index 00000000..a977c32e Binary files /dev/null and b/app/assets/images/user_icon.png differ diff --git a/app/assets/javascripts/OQS.js b/app/assets/javascripts/OQS.js index 409b5c84..68cf44d7 100755 --- a/app/assets/javascripts/OQS.js +++ b/app/assets/javascripts/OQS.js @@ -37,7 +37,7 @@ $(document).on('turbolinks:load', function() { // oqs_id = $(this).find(".oqs-id").text(); $("#oqs_active").attr('data-id',$('.oqs_click').val()); var url = 'oqs/get_items/'+$('.oqs_click').val(); - + show_details(url,null); } @@ -49,11 +49,11 @@ $(document).on('turbolinks:load', function() { $(".tables").on("click", function(){ active = $(this).hasClass('selected-table'); - if (active) { + if (active) { $(this).removeClass('bg-blue'); $(this).addClass('green'); $(this).removeClass('selected-table'); - }else{ + }else{ $(this).removeClass('green'); $(this).addClass('bg-blue'); $(this).addClass('selected-table'); @@ -63,7 +63,7 @@ $(document).on('turbolinks:load', function() { var table_id =[]; for (i = 0; i < list.length; i++) { table_id.push(list[i].value); - } + } console.log(table_id) $('#table').val(table_id); @@ -75,7 +75,7 @@ $(document).on('turbolinks:load', function() { }else{ var table = null } - + if (oqs_id > 0 || status != "All" || table != null) { $(".oqs_click").removeClass('oqs_active'); $(".queue_station").removeClass('queue_station_box'); @@ -86,7 +86,7 @@ $(document).on('turbolinks:load', function() { // oqs_id = $(this).find(".oqs-id").text(); $("#oqs_active").attr('data-id',oqs_id); var url = 'oqs/get_items/'+oqs_id; - + show_details(url,table,status); }else{ $("#completed").removeClass('hide') @@ -95,7 +95,7 @@ $(document).on('turbolinks:load', function() { }); // $(".oqs_click").on("click", function(){ - $(document).on('change', '.oqs_click', function(event){ + $(document).on('change', '.oqs_click', function(event){ oqs_id = $(this).val(); status = $("#status").val(); var table_id = $('#table_id').val(); @@ -104,7 +104,7 @@ $(document).on('turbolinks:load', function() { }else{ var table = null } - + if (oqs_id > 0 || status != "All" || table_id != null) { $(".oqs_click").removeClass('oqs_active'); $(".queue_station").removeClass('queue_station_box'); @@ -115,7 +115,7 @@ $(document).on('turbolinks:load', function() { // oqs_id = $(this).find(".oqs-id").text(); $("#oqs_active").attr('data-id',oqs_id); var url = 'oqs/get_items/'+oqs_id; - + show_details(url,table,status); }else{ $("#completed").removeClass('hide') @@ -124,7 +124,7 @@ $(document).on('turbolinks:load', function() { }); //End Click // $(".status_click").on("click", function(){ - $(document).on('change', '.status_click', function(event){ + $(document).on('change', '.status_click', function(event){ oqs_id = $("#oqs_id").val(); status = $(this).val(); var table_id = $('#table_id').val(); @@ -144,7 +144,7 @@ $(document).on('turbolinks:load', function() { // oqs_id = $(this).find(".oqs-id").text(); $("#oqs_active").attr('data-id',oqs_id); var url = 'oqs/get_items/'+oqs_id; - + show_details(url,table,status); }else{ $("#completed").removeClass('hide') @@ -152,17 +152,17 @@ $(document).on('turbolinks:load', function() { } }); //End Click - - function show_details(url,table_id,status){ + + function show_details(url,table_id,status){ console.log(table_id) var oqs_append = $('.oqs_append'); oqs_append.empty(); var filter = $('.filter').text(); - + //Start Ajax - $.ajax({ - type: "GET", - url: url, + $.ajax({ + type: "GET", + url: url, data: {'filter':filter,'table_id':table_id,'status':status}, dataType: "json", success: function(data) { @@ -175,7 +175,7 @@ $(document).on('turbolinks:load', function() { var options = data[field]["options"]; } - var date = new Date(data[field]["created_at"]); + var date = new Date(data[field]["created_at"]); // var show_date = date.getDate() + "-" + (date.getMonth()+1) + "-" + date.getFullYear() + ' ' + date.getHours()+ ':' + date.getMinutes(); var show_date =date.getHours()+ ':' + date.getMinutes() +' '+(date.getHours() >= 12 ? 'PM' : 'AM'); var set_menu_items = data[field]["set_menu_items"]; @@ -193,7 +193,7 @@ $(document).on('turbolinks:load', function() { table_type = data[field]["table_type"] +'-'+data[field]["zone"] }else{ table_type = "No Table" - + } var delivery_status = '' if (data[field]["delivery_status"] == true) { @@ -235,24 +235,24 @@ $(document).on('turbolinks:load', function() { +'' +'' - +''; - + +''; + $('.oqs_append').append(row); - } + } } }); - //end Ajax + //end Ajax } - $(document).on('click', '.queue_station', function(event){ + $(document).on('click', '.queue_station', function(event){ $('#print_order_item').removeAttr("disabled",""); $('#print_order_summary').removeAttr("disabled",""); - var orderNo = $(this).attr('data-order-no'); + var orderNo = $(this).attr('data-order-no'); var orderZone=$(this).children().children().children('.order-zone').text().trim(); var orderZoneType=$(this).children().children().children('.order-zone-type').text().trim(); // var orderItem=$(this).children().children().children('.order-item').text(); var assigned_item_id = $(this).children().find(".assigned-order-item").text(); - var orderQty = $(this).children().children().children('.order-qty').text(); + var orderQty = $(this).children().children().children('.order-qty').text(); var orderBy = $(this).children().children().children().children('.order-by').text(); var orderAt = $(this).children().children().children().children('.order-at').text(); var orderCustomer = $(this).children().children('.order-customer').text(); @@ -272,10 +272,10 @@ $(document).on('turbolinks:load', function() { data: { 'status' : order_status }, success: function(res){ // console.log(res); - for (i = 0; i < res["items"].length; i++) { - var data = JSON.stringify(res["items"][i]); - var parse_data = JSON.parse(data); - var assigned_order_items = []; + for (i = 0; i < res["items"].length; i++) { + var data = JSON.stringify(res["items"][i]); + var parse_data = JSON.parse(data); + var assigned_order_items = []; var assigned_order_item_id = ''; if(res["assigned_order_items"]!= undefined && res["assigned_order_items"]!=''){ assigned_order_items = JSON.parse(JSON.stringify(res["assigned_order_items"])); @@ -286,7 +286,7 @@ $(document).on('turbolinks:load', function() { }); } // console.log(assigned_order_item_id); - + var set_menu_items = parse_data.set_menu_items; var set_instance_items = ""; if(set_menu_items!=null){ @@ -309,16 +309,16 @@ $(document).on('turbolinks:load', function() { "" + parse_data.qty + "" + ""; } - + }else{ var order_item_row = "" + "" + parse_data.item_name + set_instance_items + "" + "" + parse_data.qty + "" + ""; } - + $("#oqs-order-details-table").children("tbody").append(order_item_row); - } + } } }) @@ -329,21 +329,21 @@ $(document).on('turbolinks:load', function() { $(this).addClass('selected-item'); }); - $(document).on('click', '.order-item-edit', function(event){ + $(document).on('click', '.order-item-edit', function(event){ var _self = $(this); // To know in ajax return var assigned_item_id=$(this).attr('id').substr(5); window.location.href = '/oqs/'+ assigned_item_id + "/edit/oqs"; }); // complete for queue item - - $(document).on('click', '.order-complete', function(event){ + + $(document).on('click', '.order-complete', function(event){ //e.preventDefault(); var _self = $(this); // To know in ajax return var assigned_item_id=$(this).attr('id').substr(15); var params = { 'id':assigned_item_id }; - - // Call update_delivery_status() for changed delivery and move to delivery + + // Call update_delivery_status() for changed delivery and move to delivery $.ajax({ type: 'POST', url: '/oqs/update_delivery', @@ -383,7 +383,7 @@ $(document).on('turbolinks:load', function() { } else { window.location.href = "/origami/room/" + table_id - } + } }); // Page reload location.reload(); @@ -392,7 +392,7 @@ $(document).on('turbolinks:load', function() { }); // Print Order Item - $(document).on('click', '#print_order_item', function(event){ + $(document).on('click', '#print_order_item', function(event){ $(this).attr("disabled","disabled"); var assigned_item_id = $('.selected-item').children('.card-block').children('.assigned-order-item').text(); var options = $('.selected-item').children('.card-block').find('.item-options').text(); diff --git a/app/assets/javascripts/addorder.js b/app/assets/javascripts/addorder.js index 6ab73e7a..64208520 100755 --- a/app/assets/javascripts/addorder.js +++ b/app/assets/javascripts/addorder.js @@ -1,17 +1,17 @@ -$(function() { +//middle edit +$(function() { var role = $('#role').val(); var second_display_lookup = $("#display_type").val(); - console.log(second_display_lookup); type = window.location.href.indexOf("quick_service") || window.location.href.indexOf("food_court"); modify_order = window.location.href.indexOf("modify_order"); - + //click menu sidebar menu category $(".product").on("click", function(){ var url = $(this).attr('data-ref'); - show_product_list(url); - }); + show_product_list(url); + }); //show menu item list when click menu category - function show_product_list(url_item){ + function show_product_list(url_item){ var menu_list = $('.menu_items_list'); menu_list.empty(); @@ -25,20 +25,19 @@ $(function() { if (type ==-1 && modify_order == -1){ url_item = url_item } - console.log(url_item) //Start Ajax - $.ajax({ - type: "GET", - url: url_item, + $.ajax({ + type: "GET", + url: url_item, data: {}, dataType: "json", success: function(data) { - + var menu_items_list = $('.menu_items_list'); menu_items_list.empty(); product = data; - for(var field in product) { + for(var field in product) { if (product[field].unit_price > 0) { qty = 1; options = []; @@ -54,28 +53,16 @@ $(function() { if (type ==-1 && modify_order == -1){ image_path = product[field].image_path.url; } - }else{ - image_path = "/image/logo.png"; - } - row = '
' + + row = '
' +'
' +'
' +'
'+ product[field].name +'
' - +"' + +'
' - +"
" - - // +"
" - // +"" - // +"
" - - +'' + +'' + + +'
'; + } + else + { + row = '
' + +'
' + +'
' + +"
" + +'
'+ product[field].name +'
' +'
' - +'
'; + + + +'
' + + +"
" + + +'
' + + +'' + + +'
'; + } $('.menu_items_list').append(row); } } } }); - //end Ajax + //end Ajax } //end show list function //click menu sidebar menu category @@ -114,7 +156,7 @@ $(function() { sub_category = $(this).siblings('.sub_category_list'); show_sub_category_list(sub_url,sub_category,menu_id); } - }); + }); //End menu category Click //click menu sidebar menu category @@ -125,19 +167,19 @@ $(function() { var menu_id = $(this).attr("data-id"); var url = "get_menu_category/"+menu_id; show_menu_item_list(url,menu_id); - }); + }); //End menu category Click //show menu item list when click menu category - function show_menu_item_list(url_item,menu_id){ + function show_menu_item_list(url_item,menu_id){ var menu_list = $('.menu_items_list'); menu_list.empty(); menus = JSON.parse(localStorage.getItem("menus")); if (menus != null) { - for(var i in menus) { + for(var i in menus) { var categories = menus[i]["categories"]; - for(var ii in categories) { + for(var ii in categories) { if (categories[ii]["id"] == menu_id) { var menu_items = categories[ii]["items"]; show_menu_list(menu_items); @@ -148,7 +190,7 @@ $(function() { type = window.location.href.indexOf("quick_service") || window.location.href.indexOf("food_court"); modify_order = window.location.href.indexOf("modify_order"); - + if (type != -1 && modify_order != -1) { url_item = '../../../addorders/'+url_item; }if(modify_order == -1 && type != -1){ @@ -159,9 +201,9 @@ $(function() { } //Start Ajax - $.ajax({ - type: "GET", - url: url_item, + $.ajax({ + type: "GET", + url: url_item, data: {}, dataType: "json", success: function(data) { @@ -171,12 +213,12 @@ $(function() { show_menu_list(menu_items); } }); - //end Ajax + //end Ajax } } //end show list function //click item row for item set - $(document).on('click', '.set_item_box', function(event){ + $(document).on('click', '.set_item_box', function(event){ $(".instance-list").empty(); $(".options-list").empty(); $(".selected-set-list").empty(); @@ -189,8 +231,8 @@ $(function() { instances = $(this).data('instances'); item_options = $(this).data('options'); - for(var field in item_sets) { - + for(var field in item_sets) { + $('.set_order').attr('data-min-qty',item_sets[field]["min_selectable_qty"]); value = item_sets[field]["instances"]; @@ -198,9 +240,9 @@ $(function() { $(value).each(function(i){ menus = JSON.parse(localStorage.getItem("menus")); if (menus != null) { - for(var j in menus) { + for(var j in menus) { var categories = menus[j]["categories"]; - for(var ii in categories) { + for(var ii in categories) { var items = categories[ii]["items"]; for(var iii in items) { var result = items[iii]["instances"]; @@ -232,7 +274,7 @@ $(function() { +'
' +'
' +'
' - $(".instance-list").append(row); + $(".instance-list").append(row); } } } @@ -281,22 +323,21 @@ $(function() { +'' +' ' - $(".instance-list").append(row); + $(".instance-list").append(row); } }); } }); } - - for(var j in item_options) { + for(var j in item_options) { value = item_options[j]["values"]; type = item_options[j]["type"]; row = "

"+type+"

" $(value).each(function(i){ - row +=""; + row +=""; }); - $(".options-list").append(row); + $(".options-list").append(row); } $('.set-item').attr('data-code',instances[0]['code']); $('.set-item').attr('data-name',instances[0]['name']); @@ -313,8 +354,8 @@ $(function() { $('#set_unit_price').text($(this).attr('data-price')); // $('#set_unit_price').text(0); }); - // click instance for add item set - $(document).on('click', '.instance_box', function(event){ + // click instance for add item set + $(document).on('click', '.instance_box', function(event){ $(".options-list").empty(); @@ -326,18 +367,18 @@ $(function() { max_qty = $(this).data('max-qty'); code = $(this).data('code'); - + if (rowCount.length+1 <= max_qty) { - for(var field in item_options) { + for(var field in item_options) { value = item_options[field]["values"]; type = item_options[field]["type"]; row = "

"+type+"

" $(value).each(function(i){ - row +=""; + +value[i]+""; }); - $(".options-list").append(row); + $(".options-list").append(row); } } // if($(this).hasClass('selected-instance') == true){ @@ -364,7 +405,7 @@ $(function() { var total_price = +sub_total + +total; $(this).addClass('selected-instance'); - set = "
'+$(this).data('name')+'' +'
' +'
' - + +' ' +'
' // +'