update crm addore
This commit is contained in:
@@ -294,6 +294,7 @@ class ReceiptBillPdf < Prawn::Document
|
||||
balance = 0
|
||||
rebate_balance =0
|
||||
redeem = 0
|
||||
redeem_count = 0
|
||||
rebate_amount["data"].each do |res|
|
||||
total = total + res["balance"]
|
||||
#total redeem amount
|
||||
@@ -318,7 +319,7 @@ class ReceiptBillPdf < Prawn::Document
|
||||
|
||||
end
|
||||
# Total Rebate Amount if birthday
|
||||
if res["receipt_no"]== sale_data.receipt_no && res["account_status"]== "RebateBonusAccount" && res["status"]== "Rebate"
|
||||
if res["receipt_no"]== sale_data.receipt_no && res["account_status"]== "RebatebonusAccount" && res["status"]== "Rebate"
|
||||
rebate_balance = rebate_balance + res["deposit"]
|
||||
move_down 5
|
||||
y_position = cursor
|
||||
@@ -332,20 +333,22 @@ class ReceiptBillPdf < Prawn::Document
|
||||
#end Total rebate if birthday
|
||||
end
|
||||
|
||||
move_down 5
|
||||
move_down 5
|
||||
y_position = cursor
|
||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
|
||||
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
|
||||
end
|
||||
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
|
||||
text "#{number_with_precision(redeem, :precision => precision.to_i, :delimiter => delimiter)}", :size => self.item_font_size,:align => :right
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
if redeem == 0
|
||||
old = total - rebate_balance
|
||||
else
|
||||
old = balance + redeem
|
||||
# if redeem_count == 0
|
||||
old = balance + redeem
|
||||
# end
|
||||
end
|
||||
|
||||
move_down 5
|
||||
|
||||
Reference in New Issue
Block a user