This commit is contained in:
Myat Zin Wai Maw
2019-12-04 13:33:13 +06:30
parent 15361fe4e1
commit 08f5689841
28 changed files with 314 additions and 100 deletions

View File

@@ -43,7 +43,7 @@ class CloseCashierCustomisePdf < Prawn::Document
stroke_horizontal_rule
shift_detail(shift_sale,sale_taxes,other_payment,total_amount_by_account,total_discount_by_account,total_member_discount,precision,delimiter,total_dinein,total_takeway,total_other_charges,total_waste,total_spoile,total_credit_payments)
shift_detail(shift_sale,sale_taxes,other_payment,total_amount_by_account,total_discount_by_account,total_member_discount,precision,delimiter,total_dinein,total_takeway,total_other_charges,total_waste,total_spoile,total_credit_payments)
end
def header (shop_details)
@@ -322,7 +322,7 @@ class CloseCashierCustomisePdf < Prawn::Document
if other.paymal_amount && other.paymal_amount.to_f > 0
y_position = cursor
bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do
text "Paymal Payment :", :size => self.item_font_size, :align => :right
text "Card 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_format(other.paymal_amount, :precision => precision.to_i, :delimiter => delimiter)}", :size => self.item_font_size, :align => :right

View File

@@ -276,7 +276,7 @@ class CloseCashierPdf < Prawn::Document
if other.paymal_amount && other.paymal_amount.to_f > 0
y_position = cursor
bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do
text "Paymal Payment :", :size => self.item_font_size, :align => :right
text "Card 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_format(other.paymal_amount, :precision => precision.to_i, :delimiter => delimiter)}", :size => self.item_font_size, :align => :right

View File

@@ -43,7 +43,7 @@ class CloseCashierPdf < Prawn::Document
stroke_horizontal_rule
shift_detail(shift_sale,sale_taxes,other_payment,total_amount_by_account,total_discount_by_account,total_member_discount,precision,delimiter,total_waste,total_spoile,total_other_charges,total_credit_payments)
shift_detail(shift_sale,sale_taxes,other_payment,total_amount_by_account,total_discount_by_account,total_member_discount,precision,delimiter,total_waste,total_spoile,total_other_charges,total_credit_payments)
end
@@ -263,7 +263,7 @@ class CloseCashierPdf < Prawn::Document
if other.paymal_amount && other.paymal_amount.to_f > 0
y_position = cursor
bounding_box([0,y_position], :width =>self.item_description_width, :height => 20) do
text "Paymal Payment :", :size => self.item_font_size, :align => :right
text "Card 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_format(other.paymal_amount, :precision => precision.to_i, :delimiter => delimiter)}", :size => self.item_font_size, :align => :right

View File

@@ -34,15 +34,20 @@ class OrderItemCustomisePdf < Prawn::Document
# font "public/fonts/Zawgyi-One.ttf"
# font "public/fonts/padauk.ttf"
#font "public/fonts/Chinese.ttf"
if !order_item.dining.nil?
text "#{ order_item.type + '-' + order_item.dining + print_status }", :size => self.header_font_size,:align => :center, :left_margin => -20
else
text "#{ print_status }", :size => self.header_font_size,:align => :center, :left_margin => -20
end
stroke_horizontal_rule
move_down 3
if order_item.source =='app'
text "Mobile Order", :size => self.header_font_size,:align => :center
move_down 1
text "Customer Ph : #{order_item.contact_no}", :size => self.header_font_size,:align => :center
move_down 1
end
if !order_item.dining.nil?
text "#{ order_item.type + '-' + order_item.dining + print_status }", :size => self.header_font_size,:align => :center, :left_margin => -20
else
text "#{ print_status }", :size => self.header_font_size,:align => :center, :left_margin => -20
end
stroke_horizontal_rule
move_down 3
#order_info
order_info(order_item.order_id, order_item.order_by,order_item.order_at)

View File

@@ -32,18 +32,23 @@ class OrderItemPdf < Prawn::Document
font "#{print_settings.font}"
fallback_fonts ["Courier", "Helvetica", "Times-Roman"]
end
# font "public/fonts/Zawgyi-One.ttf"
# font "public/fonts/padauk.ttf"
#font "public/fonts/Chinese.ttf"
if !order_item.dining.nil?
text "#{ order_item.type + '-' + order_item.dining + print_status }", :size => self.header_font_size,:align => :center, :left_margin => -20
else
text "#{ print_status }", :size => self.header_font_size,:align => :center, :left_margin => -20
end
stroke_horizontal_rule
move_down 3
# font "public/fonts/Zawgyi-One.ttf"
# font "public/fonts/padauk.ttf"
#font "public/fonts/Chinese.ttf"
if order_item.source =='app'
text "Mobile Order", :size => self.header_font_size,:align => :center
move_down 1
text "Customer Ph : #{order_item.contact_no}", :size => self.header_font_size,:align => :center
move_down 1
end
if !order_item.dining.nil?
text "#{ order_item.type + '-' + order_item.dining + print_status }", :size => self.header_font_size,:align => :center, :left_margin => -20
else
text "#{ print_status }", :size => self.header_font_size,:align => :center, :left_margin => -20
end
stroke_horizontal_rule
move_down 3
#order_info
order_info(order_item.order_id, order_item.order_by,order_item.order_at)

View File

@@ -34,15 +34,20 @@ class OrderItemSlimCustomisePdf < Prawn::Document
# font "public/fonts/Zawgyi-One.ttf"
# font "public/fonts/padauk.ttf"
#font "public/fonts/Chinese.ttf"
if !order_item_slim.dining.nil?
text "#{ order_item_slim.type + '-' + order_item_slim.dining + print_status }", :size => self.header_font_size,:align => :center, :left_margin => -20
else
text "#{ print_status }", :size => self.header_font_size,:align => :center, :left_margin => -20
end
stroke_horizontal_rule
move_down 1
if order_item_slim.source =='app'
text "Mobile Order", :size => self.header_font_size,:align => :center
move_down 1
text "Customer Ph : #{order_item_slim.contact_no}", :size => self.header_font_size,:align => :center
move_down 1
end
if !order_item_slim.dining.nil?
text "#{ order_item_slim.type + '-' + order_item_slim.dining + print_status }", :size => self.header_font_size,:align => :center, :left_margin => -20
else
text "#{ print_status }", :size => self.header_font_size,:align => :center, :left_margin => -20
end
stroke_horizontal_rule
move_down 1
#order_info
order_info(order_item_slim.order_id, order_item_slim.order_by,order_item_slim.order_at)

View File

@@ -34,14 +34,20 @@ class OrderItemSlimPdf < Prawn::Document
# font "public/fonts/Zawgyi-One.ttf"
# font "public/fonts/padauk.ttf"
#font "public/fonts/Chinese.ttf"
if !order_item_slim.dining.nil?
text "#{ order_item_slim.type + '-' + order_item_slim.dining + print_status }", :size => self.header_font_size,:align => :center, :left_margin => -20
else
text "#{ print_status }", :size => self.header_font_size,:align => :center, :left_margin => -20
end
if order_item_slim.source =='app'
text "Mobile Order", :size => self.header_font_size,:align => :center
move_down 1
text "Customer Ph : #{order_item_slim.contact_no}", :size => self.header_font_size,:align => :center
move_down 1
end
if !order_item_slim.dining.nil?
text "#{ order_item_slim.type + '-' + order_item_slim.dining + print_status }", :size => self.header_font_size,:align => :center, :left_margin => -20
else
text "#{ print_status }", :size => self.header_font_size,:align => :center, :left_margin => -20
end
stroke_horizontal_rule
move_down 1
stroke_horizontal_rule
move_down 1
#order_info
order_info(order_item_slim.order_id, order_item_slim.order_by,order_item_slim.order_at)

View File

@@ -35,14 +35,20 @@ class OrderItemStarPdf < Prawn::Document
# font "public/fonts/Zawgyi-One.ttf"
# font "public/fonts/padauk.ttf"
#font "public/fonts/Chinese.ttf"
if !order_item.dining.nil?
text "#{ order_item.type + '-' + order_item.dining + print_status }", :size => self.header_font_size,:align => :center, :left_margin => -20
else
text "#{ print_status }", :size => self.header_font_size,:align => :center, :left_margin => -20
end
if order_item.source =='app'
text "Mobile Order", :size => self.header_font_size,:align => :center
move_down 1
text "Customer Ph : #{order_item.contact_no}", :size => self.header_font_size,:align => :center
move_down 1
end
if !order_item.dining.nil?
text "#{ order_item.type + '-' + order_item.dining + print_status }", :size => self.header_font_size,:align => :center, :left_margin => -20
else
text "#{ print_status }", :size => self.header_font_size,:align => :center, :left_margin => -20
end
stroke_horizontal_rule
move_down 3
stroke_horizontal_rule
move_down 3
#order_info
order_info(order_item.order_id, order_item.order_by,order_item.order_at)

View File

@@ -34,13 +34,19 @@ class OrderSetItemCustomisePdf < Prawn::Document
# font "public/fonts/Zawgyi-One.ttf"
# font "public/fonts/padauk.ttf"
#font "public/fonts/Chinese.ttf"
if !order_set_item.dining.nil?
text "#{ order_set_item.type + '-' + order_set_item.dining + print_status }", :size => self.header_font_size,:align => :center, :left_margin => -20
else
text "#{ print_status }", :size => self.header_font_size,:align => :center, :left_margin => -20
end
stroke_horizontal_rule
move_down 3
if order_set_item.source =='app'
text "Mobile Order", :size => self.header_font_size,:align => :center
move_down 1
text "Customer Ph : #{order_set_item.contact_no}", :size => self.header_font_size,:align => :center
move_down 1
end
if !order_set_item.dining.nil?
text "#{ order_set_item.type + '-' + order_set_item.dining + print_status }", :size => self.header_font_size,:align => :center, :left_margin => -20
else
text "#{ print_status }", :size => self.header_font_size,:align => :center, :left_margin => -20
end
stroke_horizontal_rule
move_down 3
#order_info
order_info(order_set_item.order_id, order_set_item.order_by,order_set_item.order_at)

View File

@@ -33,13 +33,19 @@ class OrderSetItemPdf < Prawn::Document
# font "public/fonts/Zawgyi-One.ttf"
# font "public/fonts/padauk.ttf"
#font "public/fonts/Chinese.ttf"
if !order_set_item.dining.nil?
text "#{ order_set_item.type + '-' + order_set_item.dining + print_status }", :size => self.header_font_size,:align => :center, :left_margin => -20
else
text "#{ print_status }", :size => self.header_font_size,:align => :center, :left_margin => -20
end
stroke_horizontal_rule
move_down 3
if order_set_item.source =='app'
text "Mobile Order", :size => self.header_font_size,:align => :center
move_down 1
text "Customer Ph : #{order_set_item.contact_no}", :size => self.header_font_size,:align => :center
move_down 1
end
if !order_set_item.dining.nil?
text "#{ order_set_item.type + '-' + order_set_item.dining + print_status }", :size => self.header_font_size,:align => :center, :left_margin => -20
else
text "#{ print_status }", :size => self.header_font_size,:align => :center, :left_margin => -20
end
stroke_horizontal_rule
move_down 3
#order_info
order_info(order_set_item.order_id, order_set_item.order_by,order_set_item.order_at)

View File

@@ -34,6 +34,12 @@ class OrderSummaryCustomisePdf < Prawn::Document
# font "public/fonts/Zawgyi-One.ttf"
# font "public/fonts/padauk.ttf"
if order[0].source =='app'
text "Mobile Order", :size => self.header_font_size,:align => :center
move_down 1
text "Customer Ph : #{order[0].contact_no}", :size => self.header_font_size,:align => :center
move_down 1
end
if !order[0].dining.nil?
text "#{ order[0].type + '-' + order[0].dining + print_status }", :size => self.header_font_size,:align => :center, :left_margin => -20
else

View File

@@ -32,7 +32,12 @@ class OrderSummaryPdf < Prawn::Document
# font "public/fonts/Zawgyi-One.ttf"
# font "public/fonts/padauk.ttf"
if order[0].source =='app'
text "Mobile Order", :size => self.header_font_size,:align => :center
move_down 1
text "Customer Ph : #{order[0].contact_no}", :size => self.header_font_size,:align => :center
move_down 1
end
if !order[0].dining.nil?
text "#{ order[0].type + '-' + order[0].dining + print_status }", :size => self.header_font_size,:align => :center, :left_margin => -20
else
@@ -41,7 +46,6 @@ class OrderSummaryPdf < Prawn::Document
stroke_horizontal_rule
move_down 5
#order_info
order_info(order[0].order_id, order[0].order_by,order[0].order_at)

View File

@@ -33,6 +33,13 @@ class OrderSummarySetCustomisePdf < Prawn::Document
# font "public/fonts/Zawgyi-One.ttf"
# font "public/fonts/padauk.ttf"
if order[0].source =='app'
text "Mobile Order", :size => self.header_font_size,:align => :center
move_down 1
text "Customer Ph : #{order[0].contact_no}", :size => self.header_font_size,:align => :center
move_down 1
end
if !order[0].dining.nil?
text "#{ order[0].type + '-' + order[0].dining + print_status }", :size => self.header_font_size,:align => :center, :left_margin => -20
else
@@ -41,7 +48,6 @@ class OrderSummarySetCustomisePdf < Prawn::Document
stroke_horizontal_rule
move_down 5
#order_info
order_info(order[0].order_id, order[0].order_by,order[0].order_at)

View File

@@ -32,6 +32,13 @@ class OrderSummarySetPdf < Prawn::Document
# font "public/fonts/Zawgyi-One.ttf"
# font "public/fonts/padauk.ttf"
if order[0].source =='app'
text "Mobile Order", :size => self.header_font_size,:align => :center
move_down 1
text "Customer Ph : #{order[0].contact_no}", :size => self.header_font_size,:align => :center
move_down 1
end
if !order[0].dining.nil?
text "#{ order[0].type + '-' + order[0].dining + print_status }", :size => self.header_font_size,:align => :center, :left_margin => -20
else
@@ -40,7 +47,6 @@ class OrderSummarySetPdf < Prawn::Document
stroke_horizontal_rule
move_down 5
#order_info
order_info(order[0].order_id, order[0].order_by,order[0].order_at)

View File

@@ -33,6 +33,12 @@ class OrderSummarySlimCustomisePdf < Prawn::Document
# font "public/fonts/Zawgyi-One.ttf"
# font "public/fonts/padauk.ttf"
if order[0].source =='app'
text "Mobile Order", :size => self.header_font_size,:align => :center
move_down 1
text "Customer Ph : #{order[0].contact_no}", :size => self.header_font_size,:align => :center
move_down 1
end
if !order[0].dining.nil?
text "#{ order[0].type + '-' + order[0].dining + print_status }", :size => self.header_font_size,:align => :center, :left_margin => -20
else

View File

@@ -32,6 +32,12 @@ class OrderSummarySlimPdf < Prawn::Document
# font "public/fonts/Zawgyi-One.ttf"
# font "public/fonts/padauk.ttf"
if order[0].source =='app'
text "Mobile Order", :size => self.header_font_size,:align => :center
move_down 1
text "Customer Ph : #{order[0].contact_no}", :size => self.header_font_size,:align => :center
move_down 1
end
if !order[0].dining.nil?
text "#{ order[0].type + '-' + order[0].dining + print_status }", :size => self.header_font_size,:align => :center, :left_margin => -20
else

View File

@@ -405,12 +405,16 @@ class ReceiptBillA5Pdf < Prawn::Document
y_position = cursor
if payment.payment_method == "paypar"
bounding_box([0,y_position], :width =>self.description_width, :height => self.item_height) do
text "Redeem Payment", :size => self.item_font_size,:align => :left
end
text "Redeem Payment", :size => self.item_font_size,:align => :left
end
else
payment_method = payment.payment_method.capitalize
if payment.payment_method == "paymal"
payment_method ='Card'
end
bounding_box([0,y_position], :width =>self.description_width, :height => self.item_height) do
text "#{payment.payment_method.capitalize} Payment", :size => self.item_font_size,:align => :left
end
text "#{payment_method} Payment", :size => self.item_font_size,:align => :left
end
end
bounding_box([self.description_width,y_position], :width =>self.label_width) do

View File

@@ -464,8 +464,12 @@ class ReceiptBillPdf < Prawn::Document
text "Redeem Payment", :size => self.item_font_size,:align => :left
end
else
payment_method = payment.payment_method.capitalize
if payment.payment_method == "paymal"
payment_method ='Card'
end
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
text "#{payment.payment_method.capitalize} Payment", :size => self.item_font_size,:align => :left
text "#{payment_method} Payment", :size => self.item_font_size,:align => :left
end
end

View File

@@ -403,8 +403,12 @@ class ReceiptBillStarPdf < Prawn::Document
text "Redeem Payment", :size => self.item_font_size,:align => :left
end
else
payment_method = payment.payment_method.capitalize
if payment.payment_method == "paymal"
payment_method ='Card'
end
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
text "#{payment.payment_method.capitalize} Payment", :size => self.item_font_size,:align => :left
text "#{payment_method} Payment", :size => self.item_font_size,:align => :left
end
end