change item_width in customise pdf

This commit is contained in:
EikhantMon
2018-06-01 17:13:40 +06:30
parent d14b75dea2
commit 767386e750
8 changed files with 11 additions and 11 deletions

View File

@@ -19,7 +19,7 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
# check for item not to show
if order_item[0].price != 0
# if order_item[0].price != 0
if !print_setting.empty?
print_setting.each do |print_settings|
if print_settings.unique_code == 'OrderItemPdf'
@@ -30,16 +30,16 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
pdf = OrderSetItemPdf.new(print_settings,order_item[0], print_status, options, oqs.use_alternate_name, before_updated_qty)
elsif print_settings.unique_code == 'OrderItemCustomisePdf'
pdf = OrderItemCustomisePdf.new(print_settings,order_item[0], print_status, options, oqs.use_alternate_name, before_updated_qty)
elsif print_settings.unique_code == 'OrderSetItemCustomisePdf'
elsif print_settings.unique_code == 'OrderSetItemCustomisePdf'
pdf = OrderSetItemCustomisePdf.new(print_settings,order_item[0], print_status, options, oqs.use_alternate_name, before_updated_qty)
elsif print_settings.unique_code == 'OrderItemSlimCustomisePdf'
pdf = OrderItemSlimCustomisePdf.new(print_settings,order_item[0], print_status, options, oqs.use_alternate_name, before_updated_qty)
end
end
end
end
# end
pdf.render_file filename
pdf.render_file filename
if oqs.print_copy
#no print in cloud server

View File

@@ -97,7 +97,7 @@ class OrderItemCustomisePdf < Prawn::Document
text "#{order_item.item_code} - #{order_item.item_name}", :size => self.item_font_size,:align => :left
end
bounding_box([self.item_width,y_position], :width => self.qty_width) do
bounding_box([self.item_width - 10,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

View File

@@ -53,7 +53,7 @@ class OrderItemPdf < Prawn::Document
def order_info(order_no, order_by, order_at)
y_position = cursor
bounding_box([0,y_position], :width => self.item_width, :height => self.item_height) do
text "OrderNo: #{order_no} ", :size => self.item_font_size,:align => :left
text "OrderNo: #{order_no}", :size => self.item_font_size,:align => :left
end
move_down 2

View File

@@ -98,7 +98,7 @@ class OrderItemSlimCustomisePdf < Prawn::Document
text "#{order_item_slim.item_name}", :size => self.item_font_size,:align => :left
end
bounding_box([self.item_width,y_position], :width => self.qty_width) do
bounding_box([self.item_width - 5,y_position], :width => self.qty_width) do
text "[#{number_with_precision(order_item_slim.qty.to_i, :precision => precision.to_i)}]", :size => self.item_font_size,:align => :left
end

View File

@@ -96,7 +96,7 @@ class OrderSetItemCustomisePdf < Prawn::Document
text "#{order_set_item.item_code} - #{order_set_item.item_name}", :size => self.item_font_size,:align => :left
end
bounding_box([self.item_width,y_position], :width => self.qty_width) do
bounding_box([self.item_width - 5,y_position], :width => self.qty_width) do
text "[#{number_with_precision(order_set_item.qty.to_i, :precision => precision.to_i)}]", :size => self.item_font_size,:align => :left
end

View File

@@ -103,7 +103,7 @@ class OrderSummaryCustomisePdf < Prawn::Document
end
bounding_box([self.item_width,y_position], :width => self.qty_width) do
bounding_box([self.item_width - 10,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

View File

@@ -102,7 +102,7 @@ class OrderSummarySetCustomisePdf < Prawn::Document
end
bounding_box([self.item_width,y_position], :width => self.qty_width) do
bounding_box([self.item_width - 5,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

View File

@@ -105,7 +105,7 @@ class OrderSummarySlimCustomisePdf < Prawn::Document
end
bounding_box([self.item_width,y_position], :width => self.qty_width) do
bounding_box([self.item_width - 5,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