diff --git a/app/assets/javascripts/custom.js b/app/assets/javascripts/custom.js index 26e6c151..6d8092cc 100644 --- a/app/assets/javascripts/custom.js +++ b/app/assets/javascripts/custom.js @@ -24,7 +24,9 @@ $(document).ready(function() { }); $('#order-detail-slimscroll').slimScroll({ - height: height-$('#order-detail-slimscroll').attr('data-height'), + // height: '250px', + 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/assets/stylesheets/custom.scss b/app/assets/stylesheets/custom.scss new file mode 100644 index 00000000..e1d36dce --- /dev/null +++ b/app/assets/stylesheets/custom.scss @@ -0,0 +1,14 @@ +.home.card { + height: 100%; +} + +#order-detail-slimscroll { + display: block; +} + +.pending-order.card-footer, .home.card-footer, .credit_sale.card-footer .inventory.card-footer{ + width: 100%; + vertical-align: bottom; + position: absolute; + bottom: 0; +} diff --git a/app/assets/stylesheets/origami.scss b/app/assets/stylesheets/origami.scss index 64cc2937..b971b6dd 100755 --- a/app/assets/stylesheets/origami.scss +++ b/app/assets/stylesheets/origami.scss @@ -11,6 +11,7 @@ @import "BSBMaterial/themes/all-themes"; @import "reset"; @import "fileinput.min"; +@import "custom"; /* Reset */ diff --git a/app/controllers/transactions/bookings_controller.rb b/app/controllers/transactions/bookings_controller.rb index 0a6f7cbb..5fe7fc4a 100644 --- a/app/controllers/transactions/bookings_controller.rb +++ b/app/controllers/transactions/bookings_controller.rb @@ -23,6 +23,7 @@ class Transactions::BookingsController < ApplicationController @receipt_no = filter @from = from @to = to + @food_court = Lookup.find_by_lookup_type_and_value("food_court", "1") respond_to do |format| format.html # index.html.erb format.json { render json: @bookings } diff --git a/app/controllers/transactions/orders_controller.rb b/app/controllers/transactions/orders_controller.rb index 5d41439c..4a3ab0ef 100755 --- a/app/controllers/transactions/orders_controller.rb +++ b/app/controllers/transactions/orders_controller.rb @@ -21,8 +21,9 @@ class Transactions::OrdersController < ApplicationController end @receipt_no = filter - @from = from - @to = to + @from = from + @to = to + @food_court = Lookup.find_by_lookup_type_and_value("food_court", "1") respond_to do |format| format.html diff --git a/app/controllers/transactions/sales_controller.rb b/app/controllers/transactions/sales_controller.rb index 98b420ff..7e69ac4b 100755 --- a/app/controllers/transactions/sales_controller.rb +++ b/app/controllers/transactions/sales_controller.rb @@ -35,6 +35,7 @@ class Transactions::SalesController < ApplicationController @receipt_no = receipt_no @from = from @to = to + @food_court = Lookup.find_by_lookup_type_and_value("food_court", "1") if @shift.present? @shift_from = @shift.shift_started_at.nil? ? '-' : @shift.shift_started_at.utc.getlocal.strftime("%e %b %I:%M%p") diff --git a/app/helpers/breadcrumb_helper.rb b/app/helpers/breadcrumb_helper.rb new file mode 100644 index 00000000..91ee1ac3 --- /dev/null +++ b/app/helpers/breadcrumb_helper.rb @@ -0,0 +1,21 @@ +module BreadcrumbHelper + + def ensure_breadcrumb + @breadcrumb ||= [ { :title => t("views.right_panel.button.home"), :url => dashboard_path } ] + end + + def back + @back ||= [] + end + + def breadcrumb_add(title, url, back_url, act_name = nil) + ensure_breadcrumb << { :title => title, :url => url } + ensure_breadcrumb << { :title => act_name, :url => '' } if act_name.present? + + back << {url: back_url} if back_url.present? + end + + def render_breadcrumb + render :partial => 'shared/breadcrumb', :locals => { :nav => ensure_breadcrumb, :back => back } + end +end \ No newline at end of file diff --git a/app/models/customer.rb b/app/models/customer.rb index 29e93341..4f007b88 100755 --- a/app/models/customer.rb +++ b/app/models/customer.rb @@ -109,6 +109,9 @@ class Customer < ApplicationRecord }, :timeout => 10 ) + + rescue Errno::ECONNREFUSED + response = {status: false, message: "Can't open membership server " } rescue HTTParty::Error response = {status: false, message: "Can't open membership server " } diff --git a/app/models/printer/printer_worker.rb b/app/models/printer/printer_worker.rb index d30af42d..5d7cce22 100755 --- a/app/models/printer/printer_worker.rb +++ b/app/models/printer/printer_worker.rb @@ -42,17 +42,17 @@ class Printer::PrinterWorker end def print(file_path, printer_destination = nil ) - if printer_destination.nil? - printer_destination = self.printer_destination - end + # if printer_destination.nil? + # printer_destination = self.printer_destination + # end - copy = self.print_copies - #Print only when printer information is not null - if !self.printer_destination.nil? - (1..copy).each do - page = Cups::PrintJob.new(file_path, printer_destination) - page.print - end - end + # copy = self.print_copies + # #Print only when printer information is not null + # if !self.printer_destination.nil? + # (1..copy).each do + # page = Cups::PrintJob.new(file_path, printer_destination) + # page.print + # end + # end end end diff --git a/app/views/crm/customers/show.html.erb b/app/views/crm/customers/show.html.erb index 646cd06a..d881b73f 100644 --- a/app/views/crm/customers/show.html.erb +++ b/app/views/crm/customers/show.html.erb @@ -1,14 +1,4 @@ -
- +<% breadcrumb_add 'CRM', "", dashboard_path %>
@@ -65,7 +55,7 @@ <%= @customer.date_of_birth rescue '-'%> <% if @customer.membership_type.to_f > 0%> <%lookup= Lookup.find_by_value(@customer.membership_type) %> - <%= lookup.name %> + <%= lookup.try(:name) %> <%else%> - diff --git a/app/views/crm/dining_queues/_form.html.erb b/app/views/crm/dining_queues/_form.html.erb index 7c50a06d..fe7c913c 100755 --- a/app/views/crm/dining_queues/_form.html.erb +++ b/app/views/crm/dining_queues/_form.html.erb @@ -1,3 +1,5 @@ +<% breadcrumb_add t('queue'), crm_dining_queues_path, crm_dining_queues_path, t("views.btn.#{action_name}") %> +
diff --git a/app/views/crm/dining_queues/assign.html.erb b/app/views/crm/dining_queues/assign.html.erb index a6e6c20a..7c78ecc8 100755 --- a/app/views/crm/dining_queues/assign.html.erb +++ b/app/views/crm/dining_queues/assign.html.erb @@ -1,15 +1,6 @@
- -
+<% breadcrumb_add 'Queue', crm_dining_queues_path, dashboard_path, "Assign Queue #{@queue.queue_no}" %> +
diff --git a/app/views/crm/dining_queues/edit.html.erb b/app/views/crm/dining_queues/edit.html.erb index bf0c3b10..0632425a 100755 --- a/app/views/crm/dining_queues/edit.html.erb +++ b/app/views/crm/dining_queues/edit.html.erb @@ -1,11 +1,3 @@ -
- <%= render 'form', dining_queue: @dining_queue %>
diff --git a/app/views/crm/dining_queues/index.html.erb b/app/views/crm/dining_queues/index.html.erb index a935cf38..85450b84 100755 --- a/app/views/crm/dining_queues/index.html.erb +++ b/app/views/crm/dining_queues/index.html.erb @@ -1,13 +1,4 @@ -
- +<% breadcrumb_add t('queue'), "", dashboard_path %>
diff --git a/app/views/crm/dining_queues/new.html.erb b/app/views/crm/dining_queues/new.html.erb index 19a12c5b..e6aa5698 100755 --- a/app/views/crm/dining_queues/new.html.erb +++ b/app/views/crm/dining_queues/new.html.erb @@ -1,15 +1,3 @@
- - - <%= render 'form', dining_queue: @dining_queue %> - + <%= render 'form', dining_queue: @dining_queue %>
\ No newline at end of file diff --git a/app/views/inventory/inventory/index.html.erb b/app/views/inventory/inventory/index.html.erb index 06396dba..3b765c89 100755 --- a/app/views/inventory/inventory/index.html.erb +++ b/app/views/inventory/inventory/index.html.erb @@ -1,12 +1,4 @@ - +<% breadcrumb_add t('inventory'), "", dashboard_path %>
diff --git a/app/views/inventory/inventory/show.html.erb b/app/views/inventory/inventory/show.html.erb index a08110e8..a570277c 100644 --- a/app/views/inventory/inventory/show.html.erb +++ b/app/views/inventory/inventory/show.html.erb @@ -1,13 +1,4 @@ - - +<% breadcrumb_add t('inventory'), '', inventory_path %>
diff --git a/app/views/inventory/inventory_definitions/_form.html.erb b/app/views/inventory/inventory_definitions/_form.html.erb index 66497616..ada37e7b 100644 --- a/app/views/inventory/inventory_definitions/_form.html.erb +++ b/app/views/inventory/inventory_definitions/_form.html.erb @@ -79,7 +79,7 @@
-
+
@@ -96,7 +96,7 @@
-