fixed conflict

This commit is contained in:
Nweni
2019-12-02 17:43:02 +06:30
118 changed files with 14390 additions and 190 deletions

View File

@@ -2,7 +2,7 @@ class ReceiptBillA5Pdf < Prawn::Document
include NumberFormattable
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, 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,transaction_ref)
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
@@ -62,8 +62,9 @@ class ReceiptBillA5Pdf < Prawn::Document
end
#end card sale trans data
#start card blanace amount
if !card_balance_amount.nil?
if !card_balance_amount.nil? && card_balance_amount >0
card_balance_data(card_balance_amount)
card_transaction_ref(transaction_ref)
end
#end card blanace amount
@@ -259,6 +260,7 @@ class ReceiptBillA5Pdf < Prawn::Document
# bounding_box([self.item_width + self.price_width + 8,y_position], :width =>self.total_width, :height => self.item_height) do
# text "#{number_format(sub_total, :precision => precision.to_i, :delimiter => delimiter)}", :size => self.item_font_size,:align => :right
# end
text_box "#{number_format(total_qty, :precision => precision.to_i)}", :at =>[item_qty_front_width,y_position], :width => item_qty_end_width, :size => self.item_font_size, :align => :center, :overflow => :shrink_to_fix
text_box "#{number_format(sub_total, :precision => precision.to_i, :delimiter => delimiter)}", :at =>[item_total_front_width,y_position], :width =>item_total_end_width, :size => self.item_font_size, :align => :right, :overflow => :shrink_to_fix
@@ -287,10 +289,12 @@ class ReceiptBillA5Pdf < Prawn::Document
text "#{product_name}", :size => self.item_font_size,:align => :left
end
# text_box "#{product_name}", :at =>[0,y_position], :width => self.item_width, :size => self.item_font_size
text_box "#{number_format(price, :precision => precision.to_i, :delimiter => delimiter)}", :at =>[self.item_width,y_position], :width => self.price_width, :size => self.item_font_size, :align => :right, :overflow => :shrink_to_fix
text_box "#{number_format(qty, :precision => precision.to_i)}", :at =>[item_qty_front_width,y_position], :width => item_qty_end_width, :size => self.item_font_size, :align => :center, :overflow => :shrink_to_fix
text_box "#{number_format(total_price, :precision => precision.to_i, :delimiter => delimiter)}", :at =>[item_total_front_width,y_position], :width =>item_total_end_width, :size => self.item_font_size, :align => :right, :overflow => :shrink_to_fix
if show_alt_name
if !(item.product_alt_name).empty?
move_down 2
@@ -543,6 +547,7 @@ class ReceiptBillA5Pdf < Prawn::Document
text "#{ 'Total ' + ipa[:name] + ' Discounts' }", :size => self.item_font_size,:align => :left
end
bounding_box([self.description_width,y_position], :width =>self.label_width) do
text "(" + "#{ number_format(ipa[:price], :precision => precision.to_i, :delimiter => delimiter) }" + ")" , :size => self.item_font_size,:align => :right
end
move_down line_move
@@ -559,7 +564,9 @@ class ReceiptBillA5Pdf < Prawn::Document
text "#{ ipa[:name] }", :size => self.item_font_size,:align => :left
end
bounding_box([self.label_width,y_position], :width =>self.description_width) do
text "#{number_format(ipa[:price], :precision => precision.to_i, :delimiter => delimiter)}" , :size => self.item_font_size,:align => :right
text "#{number_format(ipa[:price], :precision => precision.to_i, :delimiter => delimiter)}" , :size => self.item_font_size,:align => :right
end
move_down line_move
end
@@ -710,7 +717,6 @@ class ReceiptBillA5Pdf < Prawn::Document
#start card balance data
def card_balance_data(card_balance_amount)
if card_balance_amount > 0
move_down line_move
stroke_horizontal_rule
move_down line_move
@@ -722,7 +728,20 @@ class ReceiptBillA5Pdf < Prawn::Document
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
text "#{card_balance_amount}" , :size => self.item_font_size,:align => :right
end
end
end
#start card transaction_ref
def card_transaction_ref(transaction_ref)
move_down line_move
stroke_horizontal_rule
move_down line_move
y_position = cursor
bounding_box([0, y_position], :width =>self.label_width) do
text "Transaction ref: ",:style => :bold, :size => header_font_size,:align => :left
end
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
text "#{transaction_ref}" , :size => self.item_font_size,:align => :right
end
end
#check ReceiptBillAltName included

View File

@@ -208,7 +208,9 @@ class ReceiptBillOrderPdf < Prawn::Document
end
bounding_box([self.description_width - 48,y_position], :width =>self.label_width, :height => self.item_height) do
text "#{number_format(order_reservation.delivery_fee, :precision => precision.to_i, :delimiter => delimiter)}", :size => self.item_font_size,:align => :right
end
end
@@ -219,7 +221,9 @@ class ReceiptBillOrderPdf < Prawn::Document
end
bounding_box([self.item_description_width,y_position], :width =>self.label_width, :height => self.item_height) do
text "#{number_format(order_reservation.total_tax, :precision => precision.to_i, :delimiter => delimiter)}", :size => self.item_font_size,:align => :right
end
end
@@ -238,7 +242,9 @@ class ReceiptBillOrderPdf < Prawn::Document
end
bounding_box([self.item_description_width,y_position], :width =>self.label_width, :height => self.item_height) do
text "#{number_format(order_reservation.discount_amount, :precision => precision.to_i, :delimiter => delimiter)}", :size => self.item_font_size,:align => :right
end
end
end
@@ -267,10 +273,12 @@ class ReceiptBillOrderPdf < Prawn::Document
text "#{product_name}", :size => self.item_font_size,:align => :left
end
# text_box "#{product_name}", :at =>[0,y_position], :width => self.item_width, :size => self.item_font_size
text_box "#{number_format(price, :precision => precision.to_i, :delimiter => delimiter)}", :at =>[self.item_width,y_position], :width => self.price_width, :size => self.item_font_size, :align => :right, :overflow => :shrink_to_fix
text_box "#{number_format(qty, :precision => precision.to_i)}", :at =>[item_qty_front_width,y_position], :width => item_qty_end_width, :size => self.item_font_size, :align => :center, :overflow => :shrink_to_fix
text_box "#{number_format(total_price, :precision => precision.to_i, :delimiter => delimiter)}", :at =>[item_total_front_width,y_position], :width =>item_total_end_width, :size => self.item_font_size, :align => :right, :overflow => :shrink_to_fix
if show_alt_name
if !(item.product_alt_name).empty?
move_down 2
@@ -298,7 +306,9 @@ class ReceiptBillOrderPdf < Prawn::Document
end
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
text "#{number_format(order_reservation.grand_total, :precision => precision.to_i, :delimiter => delimiter)}" , :style => :bold, :size => self.header_font_size,:align => :right
end
move_down line_move

View File

@@ -5,7 +5,7 @@ class ReceiptBillPdf < Prawn::Document
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, 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)
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,transaction_ref)
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
@@ -65,8 +65,9 @@ class ReceiptBillPdf < Prawn::Document
end
#end card sale trans data
#start card blanace amount
if !card_balance_amount.nil?
if !card_balance_amount.nil? && card_balance_amount >0
card_balance_data(card_balance_amount)
card_transaction_ref(transaction_ref)
end
#end card blanace amount
@@ -786,7 +787,6 @@ class ReceiptBillPdf < Prawn::Document
#start card balance data
def card_balance_data(card_balance_amount)
if card_balance_amount > 0
move_down line_move
stroke_horizontal_rule
move_down line_move
@@ -798,6 +798,19 @@ class ReceiptBillPdf < Prawn::Document
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
text "#{card_balance_amount}" , :size => self.item_font_size,:align => :right
end
end
#start card transaction_ref
def card_transaction_ref(transaction_ref)
move_down line_move
stroke_horizontal_rule
move_down line_move
y_position = cursor
bounding_box([0, y_position], :width =>self.label_width) do
text "Transaction ref: ",:style => :bold, :size => header_font_size,:align => :left
end
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
text "#{transaction_ref}" , :size => self.item_font_size,:align => :right
end
end

View File

@@ -3,7 +3,7 @@ class ReceiptBillStarPdf < Prawn::Document
attr_accessor :label_width,:price_column_width,:page_width, :page_height, :margin, :margin_top, :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, status, qr , 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, status, qr , 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,transaction_ref)
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
@@ -64,8 +64,9 @@ class ReceiptBillStarPdf < Prawn::Document
end
#end card sale trans data
#start card blanace amount
if !card_balance_amount.nil?
if !card_balance_amount.nil? && card_balance_amount >0
card_balance_data(card_balance_amount)
card_transaction_ref(transaction_ref)
end
#end card blanace amount
@@ -711,19 +712,32 @@ class ReceiptBillStarPdf < Prawn::Document
#start card balance data
def card_balance_data(card_balance_amount)
if card_balance_amount > 0
move_down line_move
stroke_horizontal_rule
move_down line_move
move_down line_move
stroke_horizontal_rule
move_down line_move
y_position = cursor
bounding_box([0, y_position], :width =>self.label_width) do
text "Card Balance: ",:style => :bold, :size => header_font_size,:align => :left
end
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
text "#{card_balance_amount}" , :size => self.item_font_size,:align => :right
end
end
y_position = cursor
bounding_box([0, y_position], :width =>self.label_width) do
text "Card Balance: ",:style => :bold, :size => header_font_size,:align => :left
end
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
text "#{card_balance_amount}" , :size => self.item_font_size,:align => :right
end
end
#start card balance data
def card_transaction_ref(transaction_ref)
move_down line_move
stroke_horizontal_rule
move_down line_move
y_position = cursor
bounding_box([0, y_position], :width =>self.label_width) do
text "Transaction ref: ",:style => :bold, :size => header_font_size,:align => :left
end
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
text "#{transaction_ref}" , :size => self.item_font_size,:align => :right
end
end
#check ReceiptBillAltName included