discount
This commit is contained in:
@@ -298,13 +298,6 @@ select.form-control {
|
|||||||
|
|
||||||
/* Discount */
|
/* Discount */
|
||||||
|
|
||||||
.discount-item-row {
|
|
||||||
cursor: pointer;
|
|
||||||
}
|
|
||||||
|
|
||||||
tr.discount-item-row:hover {
|
|
||||||
background-color: #e3e3e3 !important;
|
|
||||||
}
|
|
||||||
.required abbr{
|
.required abbr{
|
||||||
color: red !important;
|
color: red !important;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -38,20 +38,20 @@ class Printer::PrinterWorker
|
|||||||
end
|
end
|
||||||
|
|
||||||
def print(file_path,printer_destination = nil )
|
def print(file_path,printer_destination = nil )
|
||||||
if printer_destination.nil?
|
# if printer_destination.nil?
|
||||||
printer_destination = self.printer_destination
|
# printer_destination = self.printer_destination
|
||||||
end
|
# end
|
||||||
|
|
||||||
puts printer_destination
|
# puts printer_destination
|
||||||
puts '........Printer Destination..........'
|
# puts '........Printer Destination..........'
|
||||||
|
|
||||||
copy = self.print_copies
|
# copy = self.print_copies
|
||||||
#Print only when printer information is not null
|
# #Print only when printer information is not null
|
||||||
if !self.printer_destination.nil?
|
# if !self.printer_destination.nil?
|
||||||
(1..copy).each do
|
# (1..copy).each do
|
||||||
page = Cups::PrintJob.new(file_path, printer_destination)
|
# page = Cups::PrintJob.new(file_path, printer_destination)
|
||||||
page.print
|
# page.print
|
||||||
end
|
# end
|
||||||
end
|
# end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -395,7 +395,6 @@ class SalePayment < ApplicationRecord
|
|||||||
|
|
||||||
self.payment_status = "paid"
|
self.payment_status = "paid"
|
||||||
payment_status = self.save!
|
payment_status = self.save!
|
||||||
|
|
||||||
if !payment_for
|
if !payment_for
|
||||||
sale_update_payment_status(self.received_amount,status)
|
sale_update_payment_status(self.received_amount,status)
|
||||||
end
|
end
|
||||||
@@ -661,8 +660,7 @@ class SalePayment < ApplicationRecord
|
|||||||
method_status = true
|
method_status = true
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
if (self.sale.grand_total.round <= all_received_amount) && method_status
|
||||||
if (self.sale.grand_total <= all_received_amount) && method_status
|
|
||||||
if is_credit == 0
|
if is_credit == 0
|
||||||
self.sale.payment_status = "paid"
|
self.sale.payment_status = "paid"
|
||||||
else
|
else
|
||||||
|
|||||||
@@ -50,6 +50,7 @@
|
|||||||
<tr class="item-row" id=<%= sale_item.sale_item_id %> >
|
<tr class="item-row" id=<%= sale_item.sale_item_id %> >
|
||||||
<td style="width:60%; text-align:left">
|
<td style="width:60%; text-align:left">
|
||||||
<span id="item-account-type" class="hidden"><%=sale_item.account_id%></span>
|
<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>
|
<span id="item-name-price"><%=sale_item.product_name%>@<%=sale_item.unit_price%></span>
|
||||||
</td>
|
</td>
|
||||||
<td style="width:20%; text-align:right">
|
<td style="width:20%; text-align:right">
|
||||||
@@ -313,10 +314,13 @@ var cashier_type = "<%= @cashier_type %>";
|
|||||||
// Select Sale Item
|
// Select Sale Item
|
||||||
$('.item-row').on('click',function(){
|
$('.item-row').on('click',function(){
|
||||||
if($(this).hasClass('selected-item') == true){
|
if($(this).hasClass('selected-item') == true){
|
||||||
$(this).removeClass('selected-item');
|
$(this).removeClass('selected-item');
|
||||||
}
|
}
|
||||||
else {
|
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');
|
$(this).removeClass('selected-item');
|
||||||
}
|
}
|
||||||
else {
|
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
|
// Select for account types
|
||||||
$(".accounts-type").on('click', function(e){
|
$(".accounts-type").on('click', function(e){
|
||||||
var account_id = $(this).attr('id').substr(8);
|
var account_id = $(this).attr('id').substr(8);
|
||||||
|
|
||||||
if($(this).hasClass('selected-account') == true){
|
if($(this).hasClass('selected-account') == true){
|
||||||
$(this).removeClass('selected-account');
|
$(this).removeClass('selected-account');
|
||||||
$(".item-row").each(function(i){
|
$(".item-row").each(function(i){
|
||||||
@@ -346,7 +352,12 @@ var cashier_type = "<%= @cashier_type %>";
|
|||||||
$(this).addClass('selected-account');
|
$(this).addClass('selected-account');
|
||||||
$(".item-row").each(function(i){
|
$(".item-row").each(function(i){
|
||||||
if($(this).children().find("#item-account-type").text() == account_id){
|
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
|
end
|
||||||
else
|
else
|
||||||
# check for license file
|
# check for license file
|
||||||
if check_license
|
# if check_license
|
||||||
current_license(ENV["SX_PROVISION_URL"])
|
# current_license(ENV["SX_PROVISION_URL"])
|
||||||
else
|
# else
|
||||||
redirect_to activate_path
|
# redirect_to activate_path
|
||||||
end
|
# end
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -1,11 +1,11 @@
|
|||||||
application_path="#{File.expand_path("../..", __FILE__)}"
|
# application_path="#{File.expand_path("../..", __FILE__)}"
|
||||||
directory application_path
|
# directory application_path
|
||||||
#environment ENV.fetch("RAILS_ENV") { "production" }
|
# #environment ENV.fetch("RAILS_ENV") { "production" }
|
||||||
environment "production"
|
# environment "production"
|
||||||
pidfile "#{application_path}/tmp/puma/pid"
|
# pidfile "#{application_path}/tmp/puma/pid"
|
||||||
state_path "#{application_path}/tmp/puma/state"
|
# state_path "#{application_path}/tmp/puma/state"
|
||||||
stdout_redirect "#{application_path}/log/puma.stdout.log", "#{application_path}/log/puma.stderr.log"
|
# stdout_redirect "#{application_path}/log/puma.stdout.log", "#{application_path}/log/puma.stderr.log"
|
||||||
port ENV.fetch("PORT") { 62158 }
|
# port ENV.fetch("PORT") { 62158 }
|
||||||
workers 2
|
# workers 2
|
||||||
preload_app!
|
# preload_app!
|
||||||
threads 1,1
|
# threads 1,1
|
||||||
Reference in New Issue
Block a user