From 7a036b8c0a6f2009ad39dc2edb9702dd85ce1773 Mon Sep 17 00:00:00 2001 From: Yan Date: Thu, 13 Jul 2017 11:34:57 +0630 Subject: [PATCH] fix for bill --- app/pdf/receipt_bill_pdf.rb | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/app/pdf/receipt_bill_pdf.rb b/app/pdf/receipt_bill_pdf.rb index 1bf4b95f..418a33d9 100644 --- a/app/pdf/receipt_bill_pdf.rb +++ b/app/pdf/receipt_bill_pdf.rb @@ -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