From f762664912adddb355fe9c3bfa80c0891c90e1d3 Mon Sep 17 00:00:00 2001 From: Aung Myo Date: Tue, 27 Jun 2017 14:16:48 +0630 Subject: [PATCH] update bill --- app/controllers/api/bill_controller.rb | 2 +- app/controllers/base_origami_controller.rb | 1 - app/helpers/origami/request_bills_helper.rb | 1 + app/pdf/receipt_bill_pdf.rb | 2 +- app/views/layouts/_header.html.erb | 2 +- config/application.rb | 1 + 6 files changed, 5 insertions(+), 4 deletions(-) diff --git a/app/controllers/api/bill_controller.rb b/app/controllers/api/bill_controller.rb index f7a4070d..1160efcc 100644 --- a/app/controllers/api/bill_controller.rb +++ b/app/controllers/api/bill_controller.rb @@ -32,7 +32,7 @@ class Api::BillController < Api::ApiController #shop detail shop_details = Shop.find(1) - customer= Customer.where('customer_id=' + @sale_data.customer_id) + customer= Customer.find(@sale_data.customer_id) # get member information member_info = Customer.get_member_account(customer) diff --git a/app/controllers/base_origami_controller.rb b/app/controllers/base_origami_controller.rb index 2af895da..be4b4055 100644 --- a/app/controllers/base_origami_controller.rb +++ b/app/controllers/base_origami_controller.rb @@ -14,5 +14,4 @@ class BaseOrigamiController < ActionController::Base @current_user ||= Employee.find_by_token_session(session[:session_token]) if session[:session_token] end - end diff --git a/app/helpers/origami/request_bills_helper.rb b/app/helpers/origami/request_bills_helper.rb index a33f7c3e..2d1f8313 100644 --- a/app/helpers/origami/request_bills_helper.rb +++ b/app/helpers/origami/request_bills_helper.rb @@ -1,2 +1,3 @@ module Origami::RequestBillsHelper + end diff --git a/app/pdf/receipt_bill_pdf.rb b/app/pdf/receipt_bill_pdf.rb index b156e2c2..ad48d457 100644 --- a/app/pdf/receipt_bill_pdf.rb +++ b/app/pdf/receipt_bill_pdf.rb @@ -83,7 +83,7 @@ class ReceiptBillPdf < Prawn::Document y_position = cursor bounding_box([0,y_position], :width =>self.page_width - 10, :height => self.item_height) do - text "Receipt Date : #{ sale_data.receipt_date.strftime('%d-%m-%Y') } ( #{ sale_data.bookings[0].checkin_at.utc.getlocal.strftime('%I:%M %p') } - #{ sale_data.bookings[0].checkin_at.utc.getlocal.strftime('%I:%M %p') } )",:size => self.item_font_size,:align => :left + text "Receipt Date : #{ sale_data.receipt_date.strftime('%d-%m-%Y') } ( #{ sale_data.bookings[0].checkin_at.utc.getlocal.strftime('%I:%M %p') } - #{ sale_data.bookings[0].checkout_at.utc.getlocal.strftime('%I:%M %p') } )",:size => self.item_font_size,:align => :left end diff --git a/app/views/layouts/_header.html.erb b/app/views/layouts/_header.html.erb index 05b74b7a..5a3a03af 100644 --- a/app/views/layouts/_header.html.erb +++ b/app/views/layouts/_header.html.erb @@ -33,7 +33,7 @@