update complete tab and other issuse
This commit is contained in:
@@ -196,6 +196,7 @@ class ReceiptBillPdf < Prawn::Document
|
||||
y_position = cursor
|
||||
move_down line_move
|
||||
sub_total = 0.0
|
||||
total_qty = 0
|
||||
sale_items.each do |item|
|
||||
# check for item not to show
|
||||
if item.price != 0
|
||||
@@ -204,7 +205,7 @@ class ReceiptBillPdf < Prawn::Document
|
||||
total_price = item.price #item.qty*item.unit_price - comment for room charges
|
||||
price = item.unit_price
|
||||
product_name = item.product_name
|
||||
|
||||
total_qty += item.qty
|
||||
|
||||
y_position = cursor
|
||||
|
||||
@@ -238,6 +239,7 @@ class ReceiptBillPdf < Prawn::Document
|
||||
bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do
|
||||
text "Sub Total", :size => self.item_font_size,:align => :left
|
||||
end
|
||||
text_box "#{number_with_precision(total_qty, :precision => precision.to_i)}", :at =>[item_qty_front_width,y_position], :width => item_qty_end_width, :size => self.item_font_size, :align => :center, :overflow => :shrink_to_fix
|
||||
bounding_box([self.item_description_width,y_position], :width =>self.label_width) do
|
||||
text "#{number_with_precision(sub_total, :precision => precision.to_i, :delimiter => delimiter)}" ,:delimiter => ',', :size => self.item_font_size,:align => :right
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user