update receipt bill payment

This commit is contained in:
Aung Myo
2017-06-21 17:37:16 +06:30
parent 7c5456d712
commit d2549df2e9
8 changed files with 22 additions and 13 deletions

View File

@@ -260,17 +260,27 @@ class ReceiptBillPdf < Prawn::Document
if rebate_amount["status"] == true
rebate_amount["data"].each do |res|
if res["receipt_no"]== sale_data.receipt_no
if res["receipt_no"]== sale_data.receipt_no && res["status"]== "Rebate"
move_down 5
y_position = cursor
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
text "Rebate Balance", :size => self.item_font_size,:align => :left
text "Rebate Amount", :size => self.item_font_size,:align => :left
end
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
text "#{ res["rebate"] }" , :size => self.item_font_size,:align => :right
end
end
if res["receipt_no"]== sale_data.receipt_no && res["status"]== "Redeem"
move_down 5
y_position = cursor
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
text "Redeem Amount", :size => self.item_font_size,:align => :left
end
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
text "#{ res["redeem"] }" , :size => self.item_font_size,:align => :right
end
end
end
@@ -301,7 +311,7 @@ class ReceiptBillPdf < Prawn::Document
move_down 5
y_position = cursor
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
text "Customer", :size => self.item_font_size,:align => :left
text "Customer Name", :size => self.item_font_size,:align => :left
end
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
text "#{ customer_name }" , :size => self.item_font_size,:align => :right