From 2226d59140327d8aec5bbce95f7d749c6c659311 Mon Sep 17 00:00:00 2001 From: Yan Date: Fri, 7 Jul 2017 20:51:24 +0630 Subject: [PATCH] re-fixed in production --- app/models/sale.rb | 2 +- app/pdf/receipt_bill_pdf.rb | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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