From eac8d723744d8c4d8445f58e3a32ba77cc7541f8 Mon Sep 17 00:00:00 2001 From: phyusin Date: Mon, 10 Dec 2018 14:37:17 +0630 Subject: [PATCH] receipt bill order --- app/pdf/receipt_bill_order_pdf.rb | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/app/pdf/receipt_bill_order_pdf.rb b/app/pdf/receipt_bill_order_pdf.rb index 40b771cf..eb4a9678 100644 --- a/app/pdf/receipt_bill_order_pdf.rb +++ b/app/pdf/receipt_bill_order_pdf.rb @@ -214,11 +214,15 @@ class ReceiptBillOrderPdf < Prawn::Document if !order_reservation.delivery_type.nil? && order_reservation.delivery_fee.to_f > 0 y_position = cursor - bounding_box([0, y_position], :width =>self.item_description_width + 10, :height => self.item_height) do + bounding_box([0, y_position], :width =>self.item_description_width - 5, :height => self.item_height) do text "Delivery Charges (#{order_reservation.delivery_type}) " , :size => self.item_font_size, :align => :left end - bounding_box([self.item_description_width + 10,y_position], :width =>self.label_width, :height => self.item_height) do + bounding_box([self.item_description_width - 5,y_position], :width =>self.item_description_width + 3, :height => self.item_height) do + text "#{number_with_precision(order_reservation.delivery_fee, :precision => precision.to_i, :delimiter => delimiter)}", :size => self.item_font_size,:align => :right + end + + bounding_box([self.item_description_width + 3,y_position], :width =>self.label_width, :height => self.item_height) do text "#{number_with_precision(order_reservation.delivery_fee, :precision => precision.to_i, :delimiter => delimiter)}", :size => self.item_font_size,:align => :right end end