change pdf func:
This commit is contained in:
@@ -14,13 +14,13 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
|
|||||||
|
|
||||||
filename = "tmp/order_item_#{order_id}_#{order_item_id}" + ".pdf"
|
filename = "tmp/order_item_#{order_id}_#{order_item_id}" + ".pdf"
|
||||||
|
|
||||||
|
pdf = OrderItemPdf.new(print_settings,order_item[0], print_status, options, oqs.use_alternate_name)
|
||||||
order_slim_pdf = Lookup.collection_of("print_settings") #print_settings with name:OrderSlimPdf
|
order_slim_pdf = Lookup.collection_of("print_settings") #print_settings with name:OrderSlimPdf
|
||||||
|
|
||||||
# check for item not to show
|
# check for item not to show
|
||||||
# if order_item[0].price != 0
|
# if order_item[0].price != 0
|
||||||
if !order_slim_pdf.empty?
|
if !order_slim_pdf.empty?
|
||||||
order_slim_pdf.each do |order_item_slim|
|
order_slim_pdf.each do |order_item_slim|
|
||||||
if order_item_slim[0] == 'OrderSlimPdf'
|
if order_item_slim[0] == 'OrderSlimPdf'
|
||||||
if order_item_slim[1] == '1'
|
if order_item_slim[1] == '1'
|
||||||
pdf = OrderItemSlimPdf.new(print_settings,order_item[0], print_status, options, oqs.use_alternate_name)
|
pdf = OrderItemSlimPdf.new(print_settings,order_item[0], print_status, options, oqs.use_alternate_name)
|
||||||
else
|
else
|
||||||
@@ -28,9 +28,8 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
|
||||||
pdf = OrderItemPdf.new(print_settings,order_item[0], print_status, options, oqs.use_alternate_name)
|
|
||||||
end
|
end
|
||||||
|
|
||||||
pdf.render_file filename
|
pdf.render_file filename
|
||||||
|
|
||||||
if oqs.print_copy
|
if oqs.print_copy
|
||||||
@@ -71,6 +70,7 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
|
|||||||
|
|
||||||
# check for item not to show
|
# check for item not to show
|
||||||
#if odi.price != 0
|
#if odi.price != 0
|
||||||
|
pdf = OrderItemPdf.new(print_settings,odi_item[0], print_status, options, oqs.use_alternate_name)
|
||||||
if !order_slim_pdf.empty?
|
if !order_slim_pdf.empty?
|
||||||
order_slim_pdf.each do |order_item_slim|
|
order_slim_pdf.each do |order_item_slim|
|
||||||
if order_item_slim[0] == 'OrderSlimPdf'
|
if order_item_slim[0] == 'OrderSlimPdf'
|
||||||
@@ -81,8 +81,6 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
|
||||||
pdf = OrderItemPdf.new(print_settings,odi_item[0], print_status, options, oqs.use_alternate_name)
|
|
||||||
end
|
end
|
||||||
# pdf.render_file "tmp/order_item.pdf"
|
# pdf.render_file "tmp/order_item.pdf"
|
||||||
pdf.render_file filename
|
pdf.render_file filename
|
||||||
@@ -99,6 +97,7 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
|
|||||||
# For Print Order Summary
|
# For Print Order Summary
|
||||||
else
|
else
|
||||||
filename = "tmp/order_summary_#{order_id}" + ".pdf"
|
filename = "tmp/order_summary_#{order_id}" + ".pdf"
|
||||||
|
pdf = OrderSummaryPdf.new(print_settings,order, print_status, order_items, oqs.use_alternate_name)
|
||||||
if !order_slim_pdf.empty?
|
if !order_slim_pdf.empty?
|
||||||
order_slim_pdf.each do |order_summary_slim|
|
order_slim_pdf.each do |order_summary_slim|
|
||||||
if order_summary_slim[0] == 'OrderSlimPdf'
|
if order_summary_slim[0] == 'OrderSlimPdf'
|
||||||
@@ -109,8 +108,6 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
|
||||||
pdf = OrderSummaryPdf.new(print_settings,order, print_status, order_items, oqs.use_alternate_name)
|
|
||||||
end
|
end
|
||||||
pdf.render_file filename
|
pdf.render_file filename
|
||||||
if oqs.print_copy
|
if oqs.print_copy
|
||||||
@@ -146,6 +143,7 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
|
|||||||
|
|
||||||
# check for item not to show
|
# check for item not to show
|
||||||
#if odi.price != 0
|
#if odi.price != 0
|
||||||
|
pdf = OrderItemPdf.new(print_settings,odi, print_status, options,oqs.use_alternate_name)
|
||||||
if !order_slim_pdf.empty?
|
if !order_slim_pdf.empty?
|
||||||
order_slim_pdf.each do |order_item_slim|
|
order_slim_pdf.each do |order_item_slim|
|
||||||
if order_item_slim[0] == 'OrderSlimPdf'
|
if order_item_slim[0] == 'OrderSlimPdf'
|
||||||
@@ -156,8 +154,6 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
|
||||||
pdf = OrderItemPdf.new(print_settings,odi, print_status, options,oqs.use_alternate_name)
|
|
||||||
end
|
end
|
||||||
pdf.render_file filename
|
pdf.render_file filename
|
||||||
|
|
||||||
@@ -177,6 +173,7 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
|
|||||||
# For Print Order Summary
|
# For Print Order Summary
|
||||||
else
|
else
|
||||||
filename = "tmp/booking_summary_#{booking_id}" + ".pdf"
|
filename = "tmp/booking_summary_#{booking_id}" + ".pdf"
|
||||||
|
pdf = OrderSummaryPdf.new(print_settings,order, print_status,oqs.use_alternate_name)
|
||||||
if !order_slim_pdf.empty?
|
if !order_slim_pdf.empty?
|
||||||
order_slim_pdf.each do |order_summary_slim|
|
order_slim_pdf.each do |order_summary_slim|
|
||||||
if order_summary_slim[0] == 'OrderSlimPdf'
|
if order_summary_slim[0] == 'OrderSlimPdf'
|
||||||
@@ -187,8 +184,6 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
|
||||||
pdf = OrderSummaryPdf.new(print_settings,order, print_status,oqs.use_alternate_name)
|
|
||||||
end
|
end
|
||||||
pdf.render_file filename
|
pdf.render_file filename
|
||||||
if oqs.print_copy
|
if oqs.print_copy
|
||||||
|
|||||||
@@ -141,6 +141,7 @@ class Printer::ReceiptPrinter < Printer::PrinterWorker
|
|||||||
#Use CUPS service
|
#Use CUPS service
|
||||||
#Generate PDF
|
#Generate PDF
|
||||||
#Print
|
#Print
|
||||||
|
pdf = ReceiptBillPdf.new(printer_settings, sale_items, sale_data, customer_name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details,printed_status,balance,card_data)
|
||||||
receipt_bill_a5_pdf = Lookup.collection_of("print_settings") #print_settings with name:ReceiptBillA5Pdf
|
receipt_bill_a5_pdf = Lookup.collection_of("print_settings") #print_settings with name:ReceiptBillA5Pdf
|
||||||
if !receipt_bill_a5_pdf.empty?
|
if !receipt_bill_a5_pdf.empty?
|
||||||
receipt_bill_a5_pdf.each do |receipt_bilA5|
|
receipt_bill_a5_pdf.each do |receipt_bilA5|
|
||||||
@@ -152,8 +153,6 @@ class Printer::ReceiptPrinter < Printer::PrinterWorker
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
else
|
|
||||||
pdf = ReceiptBillPdf.new(printer_settings, sale_items, sale_data, customer_name, item_price_by_accounts, discount_price_by_accounts, member_info,rebate_amount,shop_details,printed_status,balance,card_data)
|
|
||||||
end
|
end
|
||||||
# print as print copies in printer setting
|
# print as print copies in printer setting
|
||||||
count = printer_settings.print_copies
|
count = printer_settings.print_copies
|
||||||
@@ -161,7 +160,7 @@ class Printer::ReceiptPrinter < Printer::PrinterWorker
|
|||||||
# override print copies for print worker loop
|
# override print copies for print worker loop
|
||||||
print_settings.print_copies = 1
|
print_settings.print_copies = 1
|
||||||
print_settings.save!
|
print_settings.save!
|
||||||
|
|
||||||
begin
|
begin
|
||||||
if count == 1
|
if count == 1
|
||||||
pdf.render_file "tmp/receipt_bill_#{sale_data.receipt_no}.pdf"
|
pdf.render_file "tmp/receipt_bill_#{sale_data.receipt_no}.pdf"
|
||||||
|
|||||||
Reference in New Issue
Block a user