update complete tab and other issuse

This commit is contained in:
Aung Myo
2018-05-03 09:52:53 +06:30
parent bf00eceba0
commit 28dc5faada
10 changed files with 981 additions and 623 deletions

View File

@@ -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