assign table ,membership transaction and queue

This commit is contained in:
Aung Myo
2017-06-21 16:22:53 +06:30
parent 6c4c817453
commit 7c5456d712
16 changed files with 502 additions and 311 deletions

View File

@@ -250,43 +250,30 @@ class ReceiptBillPdf < Prawn::Document
end
move_down 5
end
stroke_horizontal_rule
end
# show member information
def member_info(member_info,customer_name,rebate_amount,sale_data)
if rebate_amount != nil
stroke_horizontal_rule
if rebate_amount[1]["status"] == true
total_redeem = 0.0
amount = 0.0
earm_amount = 0.0
SalePayment.where('sale_id = ?', sale_data.sale_id).each do |payment|
if payment.payment_method == "paypar"
total_redeem = total_redeem + payment.payment_amount
end
end
earm_amount = earm_amount + rebate_amount[1]["rebate_earned"].to_f
amount = amount + total_redeem
amount = amount + earm_amount
old = rebate_amount[1]["total_rebate_amount"].to_f - amount
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 "#{old}" , :size => self.item_font_size,:align => :right
end
move_down 5
if rebate_amount["status"] == true
rebate_amount["data"].each do |res|
y_position = cursor
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
text "Earned Balance", :size => self.item_font_size,:align => :left
end
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
text "#{ rebate_amount[1]["rebate_earned"] }" , :size => self.item_font_size,:align => :right
end
if res["receipt_no"]== sale_data.receipt_no
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
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
end
end
end
if member_info["status"] == true
@@ -297,7 +284,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 "Rebate Balance", :size => self.item_font_size,:align => :left
text "Current Balance", :size => self.item_font_size,:align => :left
end
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
text "#{ res["balance"] }" , :size => self.item_font_size,:align => :right