From 994e80b89e2ffb0453e6c6e35866bfaa67c395c3 Mon Sep 17 00:00:00 2001 From: Yan Date: Tue, 25 Jul 2017 12:56:11 +0630 Subject: [PATCH] fix order print format --- app/pdf/order_item_pdf.rb | 2 +- app/pdf/order_summary_pdf.rb | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/pdf/order_item_pdf.rb b/app/pdf/order_item_pdf.rb index 61f5f0c2..20a4537c 100644 --- a/app/pdf/order_item_pdf.rb +++ b/app/pdf/order_item_pdf.rb @@ -80,7 +80,7 @@ class OrderItemPdf < Prawn::Document text "#{order_item.item_name}", :size => self.item_font_size,:align => :left end - bounding_box([self.item_width-4,y_position], :width => self.qty_width) do + bounding_box([self.item_width,y_position], :width => self.qty_width) do text "[#{number_with_precision(order_item.qty.to_i, :precision => precision.to_i)}]", :size => self.item_font_size,:align => :left end diff --git a/app/pdf/order_summary_pdf.rb b/app/pdf/order_summary_pdf.rb index 26a89476..244fbdfa 100644 --- a/app/pdf/order_summary_pdf.rb +++ b/app/pdf/order_summary_pdf.rb @@ -6,7 +6,7 @@ class OrderSummaryPdf < Prawn::Document self.page_height = 1450 self.margin = 0 self.price_width = 40 # No Need for item - self.qty_width = 35 + self.qty_width = 40 self.total_width = 40 # No Need for item self.item_width = self.page_width - (self.qty_width - self.margin) self.item_height = 15 @@ -68,8 +68,8 @@ class OrderSummaryPdf < Prawn::Document text "Item", :size => self.item_font_size,:align => :left end - bounding_box([self.item_width-4,y_position], :width => self.qty_width, :height => self.item_height) do - text "Qty", :size => self.item_font_size,:align => :right + bounding_box([self.item_width,y_position], :width => self.qty_width, :height => self.item_height) do + text "Qty", :size => self.item_font_size,:align => :left end stroke_horizontal_rule @@ -96,8 +96,8 @@ class OrderSummaryPdf < Prawn::Document end - bounding_box([self.item_width-4,y_position], :width => self.qty_width) do - text "#{number_with_precision(odi.qty, :precision => precision.to_i)}", :size => self.item_font_size,:align => :right + bounding_box([self.item_width,y_position], :width => self.qty_width) do + text "#{number_with_precision(odi.qty, :precision => precision.to_i)}", :size => self.item_font_size,:align => :left end bounding_box([0,y_position], :width => self.item_width) do