Pull from master

This commit is contained in:
San Wai Lwin
2018-03-29 18:17:10 +06:30
122 changed files with 4008 additions and 1115 deletions

View File

@@ -176,7 +176,7 @@ class Printer::ReceiptPrinter < Printer::PrinterWorker
def print_receipt_bill(printer_settings,cashier_terminal,sale_items,sale_data, customer_name, item_price_by_accounts, discount_price_by_accounts, member_info = nil,rebate_amount=nil,shop_details, printed_status,balance,card_data)
#Use CUPS service
#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
if !receipt_bill_a5_pdf.empty?
@@ -202,14 +202,14 @@ class Printer::ReceiptPrinter < Printer::PrinterWorker
begin
if count == 1
filename = "/receipts/receipt_bill_#{sale_data.receipt_no}.pdf"
pdf.render_file directory_name + "/receipt_bill_#{sale_data.receipt_no}.pdf"
filename = directory_name + "/receipt_bill_#{sale_data.receipt_no}.pdf"
pdf.render_file filename
if printed_status != 'Paid'
self.print(directory_name + "/receipt_bill_#{sale_data.receipt_no}.pdf", cashier_terminal.printer_name)
end
else
filename = "/receipts/receipt_bill_#{sale_data.receipt_no}_#{count}.pdf"
pdf.render_file directory_name + "/receipt_bill_#{sale_data.receipt_no}_#{count}.pdf"
filename = directory_name + "/receipt_bill_#{sale_data.receipt_no}_#{count}.pdf"
pdf.render_file filename
if printed_status != 'Paid'
self.print(directory_name + "/receipt_bill_#{sale_data.receipt_no}_#{count}.pdf", cashier_terminal.printer_name)
end
@@ -272,11 +272,11 @@ class Printer::ReceiptPrinter < Printer::PrinterWorker
def print_receipt_pdf(filename,receipt_no,print_copies,printer_name)
count = print_copies.to_i
# if count == 0
# self.print("public"+filename, printer_name)
# self.print(filename, printer_name)
# else
begin
if count == 1
self.print("public"+filename, printer_name)
self.print(filename, printer_name)
else
filename = "public/receipts/receipt_bill_#{receipt_no}_#{count}.pdf"
self.print(filename, printer_name)