kbzpay qrcode
This commit is contained in:
@@ -17,7 +17,7 @@ class OrderItemPdf < Prawn::Document
|
||||
self.item_description_width = self.page_width - (self.price_width + self.qty_width + self.total_width)
|
||||
self.label_width=90
|
||||
|
||||
super(:margin => self.margin_top, self.margin, self.margin, self.margin], :page_size => [self.page_width, self.page_height])
|
||||
super(:margin => [self.margin_top, self.margin, self.margin, self.margin], :page_size => [self.page_width, self.page_height])
|
||||
# super(:margin => [10, 5, 30, 5], :page_size => [200,400])
|
||||
|
||||
# db font setup
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
# require 'prawn/qrcode'
|
||||
class ReceiptBillPdf < Prawn::Document
|
||||
include ActionView::Helpers::NumberHelper
|
||||
|
||||
attr_accessor :label_width,:price_column_width,:page_width, :page_height, :margin, :price_width, :item_width, :header_font_size, :item_font_size,:item_height,:qty_width,:total_width,:item_description_width, :description_width, :price_num_width, :line_move
|
||||
|
||||
def initialize(printer_settings, sale_items, sale_data, customer_name, item_price_by_accounts, discount_price_by_accounts, member_info = nil,rebate_amount = nil,shop_details, printed_status,current_balance,card_data,other_charges_amount,latest_order_no,card_balance_amount)
|
||||
def initialize(printer_settings, kbz_pay_status, qr_code, sale_items, sale_data, customer_name, item_price_by_accounts, discount_price_by_accounts, member_info = nil,rebate_amount = nil,shop_details, printed_status,current_balance,card_data,other_charges_amount,latest_order_no,card_balance_amount)
|
||||
self.page_width = printer_settings.page_width
|
||||
self.page_height = printer_settings.page_height
|
||||
self.header_font_size = printer_settings.header_font_size.to_i
|
||||
@@ -101,6 +102,10 @@ class ReceiptBillPdf < Prawn::Document
|
||||
if shop_details.note && !shop_details.note.nil?
|
||||
shop_note(shop_details)
|
||||
end
|
||||
|
||||
if kbz_pay_status
|
||||
pay_by_kbzpay(printed_status, qr_code)
|
||||
end
|
||||
|
||||
footer(printed_status)
|
||||
end
|
||||
@@ -679,6 +684,14 @@ class ReceiptBillPdf < Prawn::Document
|
||||
move_down line_move
|
||||
end
|
||||
|
||||
def pay_by_kbzpay(status, qr_code)
|
||||
if status == 'Paid'
|
||||
move_down line_move
|
||||
print_qr_code(qr_code, pos: [20, cursor], extent: 200, stroke: true)
|
||||
stroke_horizontal_rule
|
||||
end
|
||||
end
|
||||
|
||||
def footer(printed_status)
|
||||
move_down line_move
|
||||
stroke_horizontal_rule
|
||||
|
||||
Reference in New Issue
Block a user