diff --git a/app/models/sale.rb b/app/models/sale.rb index c1c81685..037dc8bb 100644 --- a/app/models/sale.rb +++ b/app/models/sale.rb @@ -493,7 +493,7 @@ def self.get_by_range_by_saleitems(from,to,status,report_type) JOIN employees ea ON ea.id = sales.cashier_id") - query = query.where("receipt_date between ? and ? and sale_status=?",from,to,status) + query = query.where("(receipt_date between ? and ? and sale_status=?) AND i.unit_price <> 0",from,to,status) diff --git a/app/pdf/receipt_bill_pdf.rb b/app/pdf/receipt_bill_pdf.rb index bd65ed20..c17fe605 100644 --- a/app/pdf/receipt_bill_pdf.rb +++ b/app/pdf/receipt_bill_pdf.rb @@ -386,10 +386,10 @@ class ReceiptBillPdf < Prawn::Document y_position = cursor item_price_by_accounts.each do |ipa| y_position = cursor - bounding_box([0,y_position], :width =>self.item_description_width, :height => self.item_height) do + bounding_box([0,y_position], :width =>self.label_width) do text "#{ ipa[:name] }", :size => self.item_font_size,:align => :left end - bounding_box([self.item_description_width,y_position], :width =>self.label_width) do + bounding_box([self.label_width,y_position], :width =>self.item_description_width) do text "#{number_with_precision(ipa[:price], :precision => precision.to_i, :delimiter => delimiter)}" , :size => self.item_font_size,:align => :right end end