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)
|
||||||
|
if (order_item.price != 10 || order_item.price != 0)
|
||||||
oqs_order_items.push(order_item)
|
oqs_order_items.push(order_item)
|
||||||
|
end
|
||||||
# end
|
# end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|||||||
@@ -7,6 +7,9 @@ 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"
|
||||||
|
|
||||||
|
# check for item not to show
|
||||||
|
if order_item[0].price == 0 || order_item[0].price == 10
|
||||||
pdf = OrderItemPdf.new(order_item[0], print_status, options)
|
pdf = OrderItemPdf.new(order_item[0], print_status, options)
|
||||||
pdf.render_file filename
|
pdf.render_file filename
|
||||||
|
|
||||||
@@ -20,6 +23,7 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
|
|||||||
self.print(filename, oqs.printer_name)
|
self.print(filename, oqs.printer_name)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
end
|
||||||
|
|
||||||
# Query for per order
|
# Query for per order
|
||||||
def print_order_summary(oqs, order_id, order_items, print_status)
|
def print_order_summary(oqs, order_id, order_items, print_status)
|
||||||
@@ -33,6 +37,9 @@ 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
|
||||||
|
|
||||||
|
# check for item not to show
|
||||||
|
if odi.price == 0 || odi.price == 10
|
||||||
pdf = OrderItemPdf.new(odi, print_status, options)
|
pdf = OrderItemPdf.new(odi, print_status, options)
|
||||||
# pdf.render_file "tmp/order_item.pdf"
|
# pdf.render_file "tmp/order_item.pdf"
|
||||||
pdf.render_file filename
|
pdf.render_file filename
|
||||||
@@ -43,6 +50,7 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
|
|||||||
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
|
||||||
else
|
else
|
||||||
filename = "tmp/order_summary_#{ order_id }" + ".pdf"
|
filename = "tmp/order_summary_#{ order_id }" + ".pdf"
|
||||||
@@ -69,8 +77,10 @@ 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)
|
|
||||||
|
|
||||||
|
# check for item not to show
|
||||||
|
if odi.price == 0 || odi.price == 10
|
||||||
|
pdf = OrderItemPdf.new(odi, print_status, options)
|
||||||
pdf.render_file filename
|
pdf.render_file filename
|
||||||
|
|
||||||
if oqs.print_copy
|
if oqs.print_copy
|
||||||
@@ -83,6 +93,7 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
|
|||||||
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
|
||||||
else
|
else
|
||||||
filename = "tmp/booking_summary_#{ booking_id }" + ".pdf"
|
filename = "tmp/booking_summary_#{ booking_id }" + ".pdf"
|
||||||
|
|||||||
@@ -86,12 +86,10 @@ class OrderSummaryPdf < Prawn::Document
|
|||||||
move_down 5
|
move_down 5
|
||||||
|
|
||||||
order_item.each do|odi|
|
order_item.each do|odi|
|
||||||
|
# check for item not to show
|
||||||
|
if odi.price == 0 || odi.price == 10
|
||||||
y_position = cursor
|
y_position = cursor
|
||||||
|
|
||||||
# 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
|
bounding_box([0,y_position], :width => self.item_width) do
|
||||||
text "#{odi.item_name}", :size => self.item_font_size,:align => :left
|
text "#{odi.item_name}", :size => self.item_font_size,:align => :left
|
||||||
end
|
end
|
||||||
@@ -118,6 +116,6 @@ class OrderSummaryPdf < Prawn::Document
|
|||||||
stroke_horizontal_line 0, (self.page_width - self.margin)
|
stroke_horizontal_line 0, (self.page_width - self.margin)
|
||||||
move_down 5
|
move_down 5
|
||||||
end
|
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