add order item and order summary slim pdf
This commit is contained in:
@@ -12,7 +12,7 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
|
||||
|
||||
order_item = print_query('order_item', order_item_id) #OrderItem.find_by_item_code(item_code)
|
||||
|
||||
filename = "tmp/order_item.pdf"
|
||||
filename = "tmp/order_item_#{order_id}_#{order_item_id}" + ".pdf"
|
||||
|
||||
# check for item not to show
|
||||
# if order_item[0].price != 0
|
||||
@@ -47,7 +47,7 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
|
||||
# For Print Per Item
|
||||
if oqs.cut_per_item
|
||||
order.each do|odi|
|
||||
filename = "tmp/order_item.pdf"
|
||||
filename = "tmp/order_item_#{order_id}" + ".pdf"
|
||||
# For Item Options
|
||||
options = odi.options == "[]"? "" : odi.options
|
||||
|
||||
@@ -68,7 +68,7 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
|
||||
end
|
||||
# For Print Order Summary
|
||||
else
|
||||
filename = "tmp/order_summary.pdf"
|
||||
filename = "tmp/order_summary_#{order_id}" + ".pdf"
|
||||
pdf = OrderSummaryPdf.new(print_settings,order, print_status, order_items, oqs.use_alternate_name)
|
||||
pdf.render_file filename
|
||||
if oqs.print_copy
|
||||
@@ -96,7 +96,7 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
|
||||
# For Print Per Item
|
||||
if oqs.cut_per_item
|
||||
order.each do|odi|
|
||||
filename = "tmp/order_item.pdf"
|
||||
filename = "tmp/order_item_#{booking_id}" + ".pdf"
|
||||
# For Item Options
|
||||
options = odi.options == "[]"? "" : odi.options
|
||||
|
||||
@@ -120,7 +120,7 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
|
||||
end
|
||||
# For Print Order Summary
|
||||
else
|
||||
filename = "tmp/booking_summary.pdf"
|
||||
filename = "tmp/booking_summary_#{booking_id}" + ".pdf"
|
||||
pdf = OrderSummaryPdf.new(print_settings,order, print_status,oqs.use_alternate_name)
|
||||
pdf.render_file filename
|
||||
if oqs.print_copy
|
||||
|
||||
@@ -198,7 +198,7 @@ class SalePayment < ApplicationRecord
|
||||
self.outstanding_amount = self.sale.grand_total.to_f - self.received_amount.to_f
|
||||
self.payment_status = "paid"
|
||||
payment_method = self.save!
|
||||
sale_update_payment_status(self.received_amount)
|
||||
sale_update_payment_status(self.received_amount,1)
|
||||
|
||||
return payment_status
|
||||
end
|
||||
@@ -290,7 +290,7 @@ class SalePayment < ApplicationRecord
|
||||
|
||||
end
|
||||
|
||||
def sale_update_payment_status(paid_amount)
|
||||
def sale_update_payment_status(paid_amount,check_foc = 0)
|
||||
#update amount_outstanding
|
||||
self.sale.amount_received = self.sale.amount_received.to_f + paid_amount.to_f
|
||||
self.sale.save!
|
||||
@@ -350,9 +350,9 @@ class SalePayment < ApplicationRecord
|
||||
self.sale.save!
|
||||
table_update_status(sObj)
|
||||
|
||||
# if paid_amount != "0.0"
|
||||
if paid_amount != "0.0" || check_foc > 0
|
||||
update_shift
|
||||
# end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user