fix for bill

This commit is contained in:
Yan
2017-07-13 11:34:57 +06:30
parent 3232df44a6
commit 7a036b8c0a

View File

@@ -165,9 +165,14 @@ class ReceiptBillPdf < Prawn::Document
def all_total(sale_data,precision,delimiter)
item_name_width = self.item_width
y_position = cursor
if sale_data.discount_type == 'member_discount'
dis_type = "Member Discount:"
else
dis_type = "Overall Discount:"
end
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
text "Overall Discount", :size => self.item_font_size,:align => :left
text "#{ dis_type }", :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(sale_data.total_discount, :precision => precision.to_i, :delimiter => delimiter)} )" , :size => self.item_font_size,:align => :right