change item_width in customise pdf
This commit is contained in:
@@ -19,7 +19,7 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
|
|||||||
|
|
||||||
# check for item not to show
|
# check for item not to show
|
||||||
|
|
||||||
if order_item[0].price != 0
|
# if order_item[0].price != 0
|
||||||
if !print_setting.empty?
|
if !print_setting.empty?
|
||||||
print_setting.each do |print_settings|
|
print_setting.each do |print_settings|
|
||||||
if print_settings.unique_code == 'OrderItemPdf'
|
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)
|
pdf = OrderSetItemPdf.new(print_settings,order_item[0], print_status, options, oqs.use_alternate_name, before_updated_qty)
|
||||||
elsif print_settings.unique_code == 'OrderItemCustomisePdf'
|
elsif print_settings.unique_code == 'OrderItemCustomisePdf'
|
||||||
pdf = OrderItemCustomisePdf.new(print_settings,order_item[0], print_status, options, oqs.use_alternate_name, before_updated_qty)
|
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)
|
pdf = OrderSetItemCustomisePdf.new(print_settings,order_item[0], print_status, options, oqs.use_alternate_name, before_updated_qty)
|
||||||
elsif print_settings.unique_code == 'OrderItemSlimCustomisePdf'
|
elsif print_settings.unique_code == 'OrderItemSlimCustomisePdf'
|
||||||
pdf = OrderItemSlimCustomisePdf.new(print_settings,order_item[0], print_status, options, oqs.use_alternate_name, before_updated_qty)
|
pdf = OrderItemSlimCustomisePdf.new(print_settings,order_item[0], print_status, options, oqs.use_alternate_name, before_updated_qty)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
# end
|
||||||
|
|
||||||
pdf.render_file filename
|
pdf.render_file filename
|
||||||
|
|
||||||
if oqs.print_copy
|
if oqs.print_copy
|
||||||
#no print in cloud server
|
#no print in cloud server
|
||||||
|
|||||||
@@ -97,7 +97,7 @@ class OrderItemCustomisePdf < Prawn::Document
|
|||||||
text "#{order_item.item_code} - #{order_item.item_name}", :size => self.item_font_size,:align => :left
|
text "#{order_item.item_code} - #{order_item.item_name}", :size => self.item_font_size,:align => :left
|
||||||
end
|
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
|
text "[#{number_with_precision(order_item.qty.to_i, :precision => precision.to_i)}]", :size => self.item_font_size,:align => :left
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -53,7 +53,7 @@ class OrderItemPdf < Prawn::Document
|
|||||||
def order_info(order_no, order_by, order_at)
|
def order_info(order_no, order_by, order_at)
|
||||||
y_position = cursor
|
y_position = cursor
|
||||||
bounding_box([0,y_position], :width => self.item_width, :height => self.item_height) do
|
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
|
end
|
||||||
|
|
||||||
move_down 2
|
move_down 2
|
||||||
|
|||||||
@@ -98,7 +98,7 @@ class OrderItemSlimCustomisePdf < Prawn::Document
|
|||||||
text "#{order_item_slim.item_name}", :size => self.item_font_size,:align => :left
|
text "#{order_item_slim.item_name}", :size => self.item_font_size,:align => :left
|
||||||
end
|
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
|
text "[#{number_with_precision(order_item_slim.qty.to_i, :precision => precision.to_i)}]", :size => self.item_font_size,:align => :left
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -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
|
text "#{order_set_item.item_code} - #{order_set_item.item_name}", :size => self.item_font_size,:align => :left
|
||||||
end
|
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
|
text "[#{number_with_precision(order_set_item.qty.to_i, :precision => precision.to_i)}]", :size => self.item_font_size,:align => :left
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -103,7 +103,7 @@ class OrderSummaryCustomisePdf < Prawn::Document
|
|||||||
|
|
||||||
end
|
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
|
text " [#{number_with_precision(odi.qty, :precision => precision.to_i)}]", :size => self.item_font_size,:align => :left
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -102,7 +102,7 @@ class OrderSummarySetCustomisePdf < Prawn::Document
|
|||||||
|
|
||||||
end
|
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
|
text "[#{number_with_precision(odi.qty, :precision => precision.to_i)}]", :size => self.item_font_size,:align => :left
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ class OrderSummarySlimCustomisePdf < Prawn::Document
|
|||||||
|
|
||||||
end
|
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
|
text "[#{number_with_precision(odi.qty, :precision => precision.to_i)}]", :size => self.item_font_size,:align => :left
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user