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

@@ -244,6 +244,16 @@ class CloseCashierPdf < Prawn::Document
end
end
if other.kbzpay_amount && other.kbzpay_amount.to_f > 0
y_position = cursor
bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do
text "KBZ Payment :", :size => self.item_font_size, :align => :right
end
bounding_box([self.item_description_width,y_position], :width =>self.price_width, :height => 20) do
text "#{ number_with_precision(other.kbzpay_amount, :precision => precision.to_i, :delimiter => delimiter)}", :size => self.item_font_size, :align => :right
end
end
if other.junctionpay_amount && other.junctionpay_amount.to_f > 0
y_position = cursor
bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do

View File

@@ -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

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