diff --git a/app/assets/stylesheets/origami.scss b/app/assets/stylesheets/origami.scss index 6bbce5a3..64cc2937 100755 --- a/app/assets/stylesheets/origami.scss +++ b/app/assets/stylesheets/origami.scss @@ -298,13 +298,6 @@ select.form-control { /* Discount */ -.discount-item-row { - cursor: pointer; -} - -tr.discount-item-row:hover { - background-color: #e3e3e3 !important; -} .required abbr{ color: red !important; } diff --git a/app/models/printer/printer_worker.rb b/app/models/printer/printer_worker.rb index fee19a31..8bbf1c6d 100755 --- a/app/models/printer/printer_worker.rb +++ b/app/models/printer/printer_worker.rb @@ -38,20 +38,20 @@ 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 - puts printer_destination - puts '........Printer Destination..........' + # puts printer_destination + # puts '........Printer Destination..........' - 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/models/sale_payment.rb b/app/models/sale_payment.rb index 7050eb25..2574c7f9 100755 --- a/app/models/sale_payment.rb +++ b/app/models/sale_payment.rb @@ -395,7 +395,6 @@ class SalePayment < ApplicationRecord self.payment_status = "paid" payment_status = self.save! - if !payment_for sale_update_payment_status(self.received_amount,status) end @@ -661,8 +660,7 @@ class SalePayment < ApplicationRecord method_status = true end end - - if (self.sale.grand_total <= all_received_amount) && method_status + if (self.sale.grand_total.round <= all_received_amount) && method_status if is_credit == 0 self.sale.payment_status = "paid" else diff --git a/app/views/origami/discounts/index.html.erb b/app/views/origami/discounts/index.html.erb index e23e4e6f..55144c41 100755 --- a/app/views/origami/discounts/index.html.erb +++ b/app/views/origami/discounts/index.html.erb @@ -50,6 +50,7 @@ > + <%=sale_item.product_name%>@<%=sale_item.unit_price%> @@ -313,10 +314,13 @@ var cashier_type = "<%= @cashier_type %>"; // Select Sale Item $('.item-row').on('click',function(){ if($(this).hasClass('selected-item') == true){ - $(this).removeClass('selected-item'); + $(this).removeClass('selected-item'); } else { - $(this).addClass('selected-item'); + if(parseInt($(this).children().find("#item-account-qty").text()) >0 && parseInt($(this).children().find("#item-total-price").text()) >0){ + + $(this).addClass('selected-item'); + } } }); @@ -326,14 +330,16 @@ var cashier_type = "<%= @cashier_type %>"; $(this).removeClass('selected-item'); } else { - $(this).addClass('selected-item'); + if(parseInt($(this).children().find("#item-account-qty").text()) >0 && parseInt($(this).children().find("#item-total-price").text()) >0){ + + $(this).addClass('selected-item'); + } } }); // Select for account types $(".accounts-type").on('click', function(e){ var account_id = $(this).attr('id').substr(8); - if($(this).hasClass('selected-account') == true){ $(this).removeClass('selected-account'); $(".item-row").each(function(i){ @@ -346,7 +352,12 @@ var cashier_type = "<%= @cashier_type %>"; $(this).addClass('selected-account'); $(".item-row").each(function(i){ if($(this).children().find("#item-account-type").text() == account_id){ - $(this).addClass("selected-item"); + if(parseInt($(this).children().find("#item-account-qty").text()) >0 && parseInt($(this).children().find("#item-total-price").text()) >0){ + $(this).addClass("selected-item"); + } + else{ + console.log("discount item"); + } } }); } diff --git a/config/initializers/action_controller.rb b/config/initializers/action_controller.rb index 205c330a..85f38ec5 100644 --- a/config/initializers/action_controller.rb +++ b/config/initializers/action_controller.rb @@ -21,11 +21,11 @@ class ActionController::Base end else # check for license file - if check_license - current_license(ENV["SX_PROVISION_URL"]) - else - redirect_to activate_path - end + # if check_license + # current_license(ENV["SX_PROVISION_URL"]) + # else + # redirect_to activate_path + # end end end diff --git a/config/puma.rb b/config/puma.rb index dcc85b12..66214eff 100755 --- a/config/puma.rb +++ b/config/puma.rb @@ -1,11 +1,11 @@ -application_path="#{File.expand_path("../..", __FILE__)}" -directory application_path -#environment ENV.fetch("RAILS_ENV") { "production" } -environment "production" -pidfile "#{application_path}/tmp/puma/pid" -state_path "#{application_path}/tmp/puma/state" -stdout_redirect "#{application_path}/log/puma.stdout.log", "#{application_path}/log/puma.stderr.log" -port ENV.fetch("PORT") { 62158 } -workers 2 -preload_app! -threads 1,1 \ No newline at end of file +# application_path="#{File.expand_path("../..", __FILE__)}" +# directory application_path +# #environment ENV.fetch("RAILS_ENV") { "production" } +# environment "production" +# pidfile "#{application_path}/tmp/puma/pid" +# state_path "#{application_path}/tmp/puma/state" +# stdout_redirect "#{application_path}/log/puma.stdout.log", "#{application_path}/log/puma.stderr.log" +# port ENV.fetch("PORT") { 62158 } +# workers 2 +# preload_app! +# threads 1,1 \ No newline at end of file