SELECT		bagco_order_product.product_id																										AS 'ProductID',
			bagco_order_product.quantity																										AS 'Quantity',
			FORMAT( bagco_order_product.unit_price, 2 )																							AS 'UnitPrice',
			FORMAT( bagco_order_product.total_unit_price, 2 )																					AS 'TotalUnitPrice',
			CONCAT(
					IF ( bagco_order_product.remove_notepad = 1, 'Remove Notepad, ', '' ),
					IF ( bagco_order_product.insert_notepad = 1, 'Insert Notepad, ', '' ),
					IF ( bagco_order_product.insert_pen = 1, 'Insert Pen, ', '' ),
					IF ( bagco_order_product.polybag = 1, 'Polybag, ', '' ),
					GROUP_CONCAT( bagco_order_product_custom_extra.custom_extra_name SEPARATOR ', ' )
				  ) 																															AS 'ExtrasItems',
			bagco_order_product.extras_charge + ( SUM( bagco_order_product_custom_extra.custom_extra_price ) * bagco_order_product.quantity )	AS 'ExtrasCharge',
			CASE IFNULL( bagco_order_product.express_charge, 0 )
				WHEN '30.00' THEN '3 Day Delivery'
				WHEN '50.00' THEN '2 Day Delivery'
				ELSE 'Express Delivery'
			END 																																AS 'ExpressOption',
			bagco_order_product.express_charge																									AS 'ExpressCharge'
FROM		bagco_order_product
LEFT JOIN 	bagco_order_product_custom_extra ON bagco_order_product_custom_extra.bagco_order_product_id = bagco_order_product.bagco_order_product_id
WHERE		bagco_order_product.bagco_order_id = {{{BagcoOrderID}}}
GROUP BY 	bagco_order_product.product_id
ORDER BY 	bagco_order_product.product_id