not show price 0 fixed

This commit is contained in:
Yan
2017-06-27 11:52:51 +06:30
parent 08e98409a5
commit e38886790c
10 changed files with 61 additions and 37 deletions

View File

@@ -9,7 +9,7 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
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
if order_item[0].price != 0
pdf = OrderItemPdf.new(order_item[0], print_status, options)
pdf.render_file filename
@@ -39,7 +39,7 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
options = odi.options == "[]"? "" : odi.options
# check for item not to show
if odi.price == 0 || odi.price == 10
if odi.price != 0 || odi.price != 10
pdf = OrderItemPdf.new(odi, print_status, options)
# pdf.render_file "tmp/order_item.pdf"
pdf.render_file filename
@@ -79,7 +79,7 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
options = odi.options == "[]"? "" : odi.options
# check for item not to show
if odi.price == 0 || odi.price == 10
if odi.price != 0
pdf = OrderItemPdf.new(odi, print_status, options)
pdf.render_file filename
@@ -120,7 +120,7 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
left join bookings AS b ON b.booking_id = bo.booking_id
left join dining_facilities AS df ON df.id = b.dining_facility_id
left join customers as cus ON cus.customer_id = orders.customer_id")
.where("order_items.item_code = '#{ id }'")
.where("order_items.item_code = '#{ id }' AND order_items.price != 0")
.group("order_items.item_code")
elsif type == "order_summary"
OrderItem.select("order_items.order_id, order_items.item_code, order_items.item_name, order_items.qty, order_items.price, order_items.options, order_items.item_order_by as order_by, order_items.created_at as order_at, cus.name as customer, df.type, df.name as dining")
@@ -129,7 +129,7 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
left join bookings AS b ON b.booking_id = bo.booking_id
left join dining_facilities AS df ON df.id = b.dining_facility_id
left join customers as cus ON cus.customer_id = orders.customer_id")
.where("orders.order_id = '#{ id }'")
.where("orders.order_id = '#{ id }' AND order_items.price != 0")
.group("order_items.order_items_id")
else
# order summary for booking
@@ -139,7 +139,7 @@ class Printer::OrderQueuePrinter < Printer::PrinterWorker
left join bookings AS b ON b.booking_id = bo.booking_id
left join dining_facilities AS df ON df.id = b.dining_facility_id
left join customers as cus ON cus.customer_id = orders.customer_id")
.where("b.booking_id = '#{ id }'")
.where("b.booking_id = '#{ id }' AND order_items.price != 0")
end
end