discount
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -50,6 +50,7 @@
|
||||
<tr class="item-row" id=<%= sale_item.sale_item_id %> >
|
||||
<td style="width:60%; text-align:left">
|
||||
<span id="item-account-type" class="hidden"><%=sale_item.account_id%></span>
|
||||
<span id="item-account-qty" class="hidden"><%=sale_item.qty%></span>
|
||||
<span id="item-name-price"><%=sale_item.product_name%>@<%=sale_item.unit_price%></span>
|
||||
</td>
|
||||
<td style="width:20%; text-align:right">
|
||||
@@ -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");
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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
|
||||
# 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
|
||||
Reference in New Issue
Block a user