From d28449a9c9f7249aea22208daab8074db7b09180 Mon Sep 17 00:00:00 2001 From: Yan Date: Tue, 6 Jun 2017 14:34:24 +0630 Subject: [PATCH] updated for bill print --- app/controllers/origami/request_bills_controller.rb | 10 +--------- app/models/printer/receipt_printer.rb | 2 +- db/seeds.rb | 6 ++++++ 3 files changed, 8 insertions(+), 10 deletions(-) diff --git a/app/controllers/origami/request_bills_controller.rb b/app/controllers/origami/request_bills_controller.rb index 3fd7ffea..152f0fb0 100644 --- a/app/controllers/origami/request_bills_controller.rb +++ b/app/controllers/origami/request_bills_controller.rb @@ -1,6 +1,6 @@ class Origami::RequestBillsController < BaseOrigamiController - def create + def show @sale = Sale.new @@ -26,12 +26,4 @@ class Origami::RequestBillsController < BaseOrigamiController end - - def show - sale_id = params[:sale_id] - if Sale.exists?(sale_id) - @sale_data = Sale.find_by_id(sale_id) - end - end - end diff --git a/app/models/printer/receipt_printer.rb b/app/models/printer/receipt_printer.rb index 86d43190..93ab277c 100644 --- a/app/models/printer/receipt_printer.rb +++ b/app/models/printer/receipt_printer.rb @@ -69,7 +69,7 @@ class Printer::ReceiptPrinter < Printer::PrinterWorker #Generate PDF #Print pdf = ReceiptBillPdf.new(printer_settings,sale_items,sale,sale_data) - pdf.render_file "tmp/receipt_bill.pdf" + pdf.render_file "tmp/receipt_bill.pdf" self.print("tmp/receipt_bill.pdf") end end diff --git a/db/seeds.rb b/db/seeds.rb index 4d7799db..6ba7d6b2 100644 --- a/db/seeds.rb +++ b/db/seeds.rb @@ -137,3 +137,9 @@ admin_employee = Employee.create({name: "Administrator", role: "Administrator", #Account for Menu Item Type (eg: Food, Beverage) food = Account.create({title: "Food", account_type: "0"}) beverage = Account.create({title: "Beverage", account_type: "1"}) + +shop = Shop.create( + {name: "Beauty In The Pot", address: "address", township: "Yangon", city: "Yangon", state: "Yangon", + country: "Myanmar", phone_no: "09123456789", reservation_no: "bip000001", license: "license", + activated_at: "2017-06-06", license_data: "license_data", base_currency: "Ks", id_prefix: "abc"} + )