merge with crm and room fixed

This commit is contained in:
Yan
2017-07-03 17:47:34 +06:30
23 changed files with 141 additions and 106 deletions

View File

@@ -269,20 +269,19 @@ class ReceiptBillPdf < Prawn::Document
if rebate_amount["status"] == true
stroke_horizontal_rule
rebate = 0
balance = 0
redeem = 0
rebate_amount["data"].each do |res|
#total redeem amount
if res["receipt_no"]== sale_data.receipt_no && res["status"]== "Redeem"
redeem = redeem + res["redeem"]
balance = balance + res["balance"]
end
#end Total redem
#total Rebate Earn
if res["receipt_no"]== sale_data.receipt_no && res["account_status"]== "RebateAccount" && res["status"]== "Rebate"
rebate = rebate + res["rebate"]
# balance = balance + res["balance"]
move_down 5
y_position = cursor
@@ -294,11 +293,9 @@ class ReceiptBillPdf < Prawn::Document
end
end
# Total Rebate Amount if birthday
if res["receipt_no"]== sale_data.receipt_no && res["account_status"]== "RebateBonusAccount" && res["status"]== "Rebate"
rebate = rebate + res["rebate"]
# balance = balance + res["balance"]
move_down 5
y_position = cursor
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
@@ -307,21 +304,33 @@ class ReceiptBillPdf < Prawn::Document
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
text "#{number_with_precision(res["balance"], :precision => precision.to_i, :delimiter => delimiter)}" , :size => self.item_font_size,:align => :right
end
end
#end Total rebate if birthday
end
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 "#{number_with_precision(redeem, :precision => precision.to_i, :delimiter => delimiter)}", :size => self.item_font_size,:align => :right
end
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 "#{number_with_precision(redeem, :precision => precision.to_i, :delimiter => delimiter)}", :size => self.item_font_size,:align => :right
end
# old = balance + redeem
# move_down 5
# y_position = cursor
# bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
# text "Old Balance", :size => self.item_font_size,:align => :left
# end
# bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
# text "#{number_with_precision(old, :precision => precision.to_i, :delimiter => delimiter)}", :size => self.item_font_size,:align => :right
# end
end
end
if member_info["status"] == true && member_info["data"].present?
balance = 0
member_info["data"].each do |res|