Add MoveTablePdf and FOC update error

This commit is contained in:
San Wai Lwin
2018-04-05 18:23:29 +06:30
parent 39e887c7a5
commit 769698e09e
6 changed files with 93 additions and 23 deletions

View File

@@ -239,11 +239,11 @@ class Printer::ReceiptPrinter < Printer::PrinterWorker
end
#Move Table Print
def print_move_table(printer_settings,to,from,shop_detail,date,type,moved_by)
def print_move_table(printer_settings,to,from,shop_detail,date,type,moved_by,order_items)
#Use CUPS service
#Generate PDF
#Print
pdf = MoveTablePdf.new(printer_settings,to,from,shop_detail,date,type,moved_by)
pdf = MoveTablePdf.new(printer_settings,to,from,shop_detail,date,type,moved_by,order_items)
pdf.render_file "tmp/print_move_table.pdf"
self.print("tmp/print_move_table.pdf")
end

View File

@@ -255,7 +255,7 @@ class SalePayment < ApplicationRecord
payment_status = false
# add to sale item with foc
sale_items = SaleItem.where("sale_id='#{ self.sale.sale_id }' and status is null")
sale_items = SaleItem.where("sale_id='#{ self.sale.sale_id }'")
sale_items.each do|item|
SaleItem.update_existing_item(item.qty, item, self.sale.sale_id, "foc", item.unit_price, item.price)