fixed conflit

This commit is contained in:
NyanLinHtut
2019-06-27 14:05:52 +06:30
28 changed files with 405 additions and 97 deletions

View File

@@ -1,9 +1,16 @@
# require 'prawn/qrcode'
require 'prawn/measurement_extensions'
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
<<<<<<< HEAD
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)
>>>>>>> 29ef6c17f910e846500d77b9f91268cb710b3a64
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
@@ -102,6 +109,13 @@ class ReceiptBillPdf < Prawn::Document
shop_note(shop_details)
end
<<<<<<< HEAD
=======
if kbz_pay_status
kbzpay_qr_generator(printed_status, qr_code)
end
>>>>>>> 29ef6c17f910e846500d77b9f91268cb710b3a64
footer(printed_status)
end
@@ -729,6 +743,20 @@ class ReceiptBillPdf < Prawn::Document
move_down line_move
end
def kbzpay_qr_generator(status, qr_code)
if status == 'Frt'
move_down line_move
move_down line_move
text "Scan to pay with KBZ Pay", :size => self.header_font_size, :align => :center
move_down line_move
print_qr_code(qr_code, pos: [39, cursor], extent: 161, stroke: false, dot: 1000)
move_down line_move
text "This QR code will be expired after 20 minutes.", :size => self.item_font_size, :align => :center
move_down line_move
move_down line_move
end
end
def footer(printed_status)
move_down line_move
stroke_horizontal_rule