not to show price 0 and 10
This commit is contained in:
@@ -38,7 +38,9 @@ class OrderQueueStation < ApplicationRecord
|
|||||||
# else
|
# else
|
||||||
|
|
||||||
AssignedOrderItem.assigned_order_item(order, order_item.item_code, oqs)
|
AssignedOrderItem.assigned_order_item(order, order_item.item_code, oqs)
|
||||||
oqs_order_items.push(order_item)
|
if (order_item.price != 10 || order_item.price != 0)
|
||||||
|
oqs_order_items.push(order_item)
|
||||||
|
end
|
||||||
# end
|
# end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -7,17 +7,21 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
|
|||||||
order_item = print_query('order_item', item_code) #OrderItem.find_by_item_code(item_code)
|
order_item = print_query('order_item', item_code) #OrderItem.find_by_item_code(item_code)
|
||||||
|
|
||||||
filename = "tmp/order_item_#{order_item[0].item_name}" + ".pdf"
|
filename = "tmp/order_item_#{order_item[0].item_name}" + ".pdf"
|
||||||
pdf = OrderItemPdf.new(order_item[0], print_status, options)
|
|
||||||
pdf.render_file filename
|
|
||||||
|
|
||||||
if oqs.print_copy
|
# check for item not to show
|
||||||
self.print(filename, oqs.printer_name)
|
if order_item[0].price == 0 || order_item[0].price == 10
|
||||||
|
pdf = OrderItemPdf.new(order_item[0], print_status, options)
|
||||||
|
pdf.render_file filename
|
||||||
|
|
||||||
#For print copy
|
if oqs.print_copy
|
||||||
pdf.render_file filename.gsub(".","-copy.")
|
self.print(filename, oqs.printer_name)
|
||||||
self.print(filename.gsub(".","-copy."), oqs.printer_name)
|
|
||||||
else
|
#For print copy
|
||||||
self.print(filename, oqs.printer_name)
|
pdf.render_file filename.gsub(".","-copy.")
|
||||||
|
self.print(filename.gsub(".","-copy."), oqs.printer_name)
|
||||||
|
else
|
||||||
|
self.print(filename, oqs.printer_name)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
@@ -33,14 +37,18 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
|
|||||||
filename = "tmp/order_item_#{odi.item_name}" + ".pdf"
|
filename = "tmp/order_item_#{odi.item_name}" + ".pdf"
|
||||||
# For Item Options
|
# For Item Options
|
||||||
options = odi.options == "[]"? "" : odi.options
|
options = odi.options == "[]"? "" : odi.options
|
||||||
pdf = OrderItemPdf.new(odi, print_status, options)
|
|
||||||
# pdf.render_file "tmp/order_item.pdf"
|
# check for item not to show
|
||||||
pdf.render_file filename
|
if odi.price == 0 || odi.price == 10
|
||||||
if oqs.print_copy
|
pdf = OrderItemPdf.new(odi, print_status, options)
|
||||||
self.print(filename, oqs.printer_name)
|
# pdf.render_file "tmp/order_item.pdf"
|
||||||
self.print(filename.gsub(".","-copy."), oqs.printer_name)
|
pdf.render_file filename
|
||||||
else
|
if oqs.print_copy
|
||||||
self.print(filename, oqs.printer_name)
|
self.print(filename, oqs.printer_name)
|
||||||
|
self.print(filename.gsub(".","-copy."), oqs.printer_name)
|
||||||
|
else
|
||||||
|
self.print(filename, oqs.printer_name)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
# For Print Order Summary
|
# For Print Order Summary
|
||||||
@@ -69,18 +77,21 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
|
|||||||
filename = "tmp/order_item_#{odi.item_name}" + ".pdf"
|
filename = "tmp/order_item_#{odi.item_name}" + ".pdf"
|
||||||
# For Item Options
|
# For Item Options
|
||||||
options = odi.options == "[]"? "" : odi.options
|
options = odi.options == "[]"? "" : odi.options
|
||||||
pdf = OrderItemPdf.new(odi, print_status, options)
|
|
||||||
|
|
||||||
pdf.render_file filename
|
# check for item not to show
|
||||||
|
if odi.price == 0 || odi.price == 10
|
||||||
|
pdf = OrderItemPdf.new(odi, print_status, options)
|
||||||
|
pdf.render_file filename
|
||||||
|
|
||||||
if oqs.print_copy
|
if oqs.print_copy
|
||||||
self.print(filename, oqs.printer_name)
|
self.print(filename, oqs.printer_name)
|
||||||
|
|
||||||
#For print copy
|
#For print copy
|
||||||
pdf.render_file filename.gsub(".","-copy.")
|
pdf.render_file filename.gsub(".","-copy.")
|
||||||
self.print(filename.gsub(".","-copy."), oqs.printer_name)
|
self.print(filename.gsub(".","-copy."), oqs.printer_name)
|
||||||
else
|
else
|
||||||
self.print(filename, oqs.printer_name)
|
self.print(filename, oqs.printer_name)
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
# For Print Order Summary
|
# For Print Order Summary
|
||||||
|
|||||||
@@ -86,38 +86,36 @@ class OrderSummaryPdf < Prawn::Document
|
|||||||
move_down 5
|
move_down 5
|
||||||
|
|
||||||
order_item.each do|odi|
|
order_item.each do|odi|
|
||||||
y_position = cursor
|
# check for item not to show
|
||||||
|
if odi.price == 0 || odi.price == 10
|
||||||
# pad_top(15) {
|
|
||||||
# text_box "#{odi.item_name}", :at =>[0,y_position], :width => self.item_width, :height =>self.item_height, :size => self.item_font_size, :overflow => :shrink_to_fix
|
|
||||||
# text_box "#{odi.qty}", :at =>[self.item_width,y_position], :width => self.qty_width, :height =>self.item_height, :size => self.item_font_size, :align => :center, :overflow => :shrink_to_fix
|
|
||||||
# }
|
|
||||||
bounding_box([0,y_position], :width => self.item_width) do
|
|
||||||
text "#{odi.item_name}", :size => self.item_font_size,:align => :left
|
|
||||||
end
|
|
||||||
|
|
||||||
bounding_box([self.item_width,y_position], :width => self.qty_width) do
|
|
||||||
text "#{odi.qty}", :size => self.item_font_size,:align => :left
|
|
||||||
end
|
|
||||||
|
|
||||||
move_down 5
|
|
||||||
|
|
||||||
# add option
|
|
||||||
options = odi.options == "[]"? "" : odi.options
|
|
||||||
|
|
||||||
if options != ""
|
|
||||||
y_position = cursor
|
y_position = cursor
|
||||||
bounding_box([0,y_position], :width => self.item_width, :height => self.item_height) do
|
|
||||||
text "#{options}", :size => self.item_font_size,:align => :left
|
bounding_box([0,y_position], :width => self.item_width) do
|
||||||
|
text "#{odi.item_name}", :size => self.item_font_size,:align => :left
|
||||||
|
end
|
||||||
|
|
||||||
|
bounding_box([self.item_width,y_position], :width => self.qty_width) do
|
||||||
|
text "#{odi.qty}", :size => self.item_font_size,:align => :left
|
||||||
end
|
end
|
||||||
|
|
||||||
move_down 5
|
move_down 5
|
||||||
|
|
||||||
|
# add option
|
||||||
|
options = odi.options == "[]"? "" : odi.options
|
||||||
|
|
||||||
|
if options != ""
|
||||||
|
y_position = cursor
|
||||||
|
bounding_box([0,y_position], :width => self.item_width, :height => self.item_height) do
|
||||||
|
text "#{options}", :size => self.item_font_size,:align => :left
|
||||||
|
end
|
||||||
|
|
||||||
|
move_down 5
|
||||||
|
end
|
||||||
|
|
||||||
|
dash(1, :space => 1, :phase => 1)
|
||||||
|
stroke_horizontal_line 0, (self.page_width - self.margin)
|
||||||
|
move_down 5
|
||||||
end
|
end
|
||||||
|
|
||||||
dash(1, :space => 1, :phase => 1)
|
|
||||||
stroke_horizontal_line 0, (self.page_width - self.margin)
|
|
||||||
move_down 5
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -163,7 +163,7 @@
|
|||||||
<input type="hidden" id="sale_id" value="<%= @sale_array[0].sale_id %>">
|
<input type="hidden" id="sale_id" value="<%= @sale_array[0].sale_id %>">
|
||||||
<%
|
<%
|
||||||
# Can't check for discount
|
# Can't check for discount
|
||||||
unless sale_item.price == 0
|
unless sale_item.price == 0 || sale_item.price == 10
|
||||||
%>
|
%>
|
||||||
<tr>
|
<tr>
|
||||||
<td><%= count %></td>
|
<td><%= count %></td>
|
||||||
@@ -183,7 +183,7 @@
|
|||||||
count += 1
|
count += 1
|
||||||
sub_total = sub_total + (order_item.price * order_item.qty)
|
sub_total = sub_total + (order_item.price * order_item.qty)
|
||||||
|
|
||||||
unless order_item.price == 0 %>
|
unless order_item.price == 0 || order_item.price == 10 %>
|
||||||
<tr>
|
<tr>
|
||||||
<td><%= count %></td>
|
<td><%= count %></td>
|
||||||
<td class='item-name'><%= order_item.item_name %></td>
|
<td class='item-name'><%= order_item.item_name %></td>
|
||||||
|
|||||||
@@ -158,7 +158,7 @@
|
|||||||
sub_total = sub_total + sale_item.price
|
sub_total = sub_total + sale_item.price
|
||||||
%>
|
%>
|
||||||
<input type="hidden" id="sale_id" value="<%= @obj.sale_id %>">
|
<input type="hidden" id="sale_id" value="<%= @obj.sale_id %>">
|
||||||
<% unless sale_item.price == 0 %>
|
<% unless sale_item.price == 0 || sale_item.price == 10 %>
|
||||||
<tr>
|
<tr>
|
||||||
<td class='item-name'><%= sale_item.product_name %></td>
|
<td class='item-name'><%= sale_item.product_name %></td>
|
||||||
<td class='item-attr'><%= sale_item.qty %></td>
|
<td class='item-attr'><%= sale_item.qty %></td>
|
||||||
@@ -174,7 +174,7 @@
|
|||||||
@order_items.each do |order_item |
|
@order_items.each do |order_item |
|
||||||
sub_total = sub_total + (order_item.price * order_item.qty)
|
sub_total = sub_total + (order_item.price * order_item.qty)
|
||||||
|
|
||||||
unless order_item.price == 0 %>
|
unless order_item.price == 0 || order_item.price == 10 %>
|
||||||
<tr>
|
<tr>
|
||||||
<td class='item-name'><%= order_item.item_name %></td>
|
<td class='item-name'><%= order_item.item_name %></td>
|
||||||
<td class='item-attr'><%= order_item.qty %></td>
|
<td class='item-attr'><%= order_item.qty %></td>
|
||||||
|
|||||||
Reference in New Issue
Block a user