diff --git a/app/assets/javascripts/order_reservation.js b/app/assets/javascripts/order_reservation.js index c2942a6f..bffd65fb 100644 --- a/app/assets/javascripts/order_reservation.js +++ b/app/assets/javascripts/order_reservation.js @@ -296,10 +296,6 @@ function show_order_detail(url,sr_no){ // var requested_date = newDate.getFullYear() + '-' + (newDate.getMonth() >= 10? newDate.getMonth() : '0' + (newDate.getMonth() + 1)) +'-'+ (newDate.getDate() >= 10? newDate.getDate() : '0' + newDate.getDate()) +' '+time; var requested_date = getOrderMonth(newDate.getMonth()) +' '+ (newDate.getDate() >= 10? newDate.getDate() : '0' + newDate.getDate()) +', '+newDate.getFullYear()+'('+getOrderDay(newDate.getDay())+')'+' '+time; - var newPickupDate = new Date(data.pickup_time); - var pickup_time = timeFormat(newPickupDate); - var pickup_datetime = getOrderMonth(newPickupDate.getMonth()) +' '+ (newPickupDate.getDate() >= 10? newPickupDate.getDate() : '0' + newPickupDate.getDate()) +', '+newPickupDate.getFullYear()+'('+getOrderDay(newPickupDate.getDay())+')'+' '+pickup_time; - if((data.expected_waiting_time!=undefined) && (data.expected_waiting_time!=null)){ // var expDate = new Date(data.expected_waiting_time); // var exptime = timeFormat(expDate); @@ -311,6 +307,18 @@ function show_order_detail(url,sr_no){ $('#expected_time').text(''); } + if((data.pickup_time!=undefined) && (data.pickup_time!=null)){ + var newPickupDate = new Date(data.pickup_time); + var pickup_time = timeFormat(newPickupDate); + var pickup_datetime = getOrderMonth(newPickupDate.getMonth()) +' '+ (newPickupDate.getDate() >= 10? newPickupDate.getDate() : '0' + newPickupDate.getDate()) +', '+newPickupDate.getFullYear()+'('+getOrderDay(newPickupDate.getDay())+')'+' '+pickup_time; + + $('.pickup-time').show(); + $('#pickup_time').text(pickup_datetime? pickup_datetime : ''); + }else{ + $('.pickup-time').hide(); + $('#pickup_time').text(''); + } + item_list.empty(); if(items!=undefined && items!=""){ @@ -365,7 +373,6 @@ function show_order_detail(url,sr_no){ address += ", (" +delivery.direction_address+")"; } $('#requested_time').text(requested_date); - $('#pickup_time').text(pickup_datetime); $('#customer_name').text(data.customer_name); $('#phone').text(data.phone); $('#address').text(address); diff --git a/app/views/origami/order_reservation/get_order.json.jbuilder b/app/views/origami/order_reservation/get_order.json.jbuilder index 6b0caba2..9ab022ed 100644 --- a/app/views/origami/order_reservation/get_order.json.jbuilder +++ b/app/views/origami/order_reservation/get_order.json.jbuilder @@ -1,7 +1,7 @@ if @order json.(@order, :order_reservation_id,:order_reservation_type,:customer_id, - :requested_time,:expected_waiting_time,:callback_url,:transaction_ref,:item_count,:total_customer,:payment_type, + :requested_time,:pickup_time,:expected_waiting_time,:callback_url,:transaction_ref,:item_count,:total_customer,:payment_type, :payment_status,:payment_ref,:taxes,:total_amount,:total_tax, :discount_amount,:convenience_charge,:grand_total,:status,:order_remark, :remark,:sale_id) diff --git a/app/views/origami/order_reservation/index.html.erb b/app/views/origami/order_reservation/index.html.erb index c82d9ad1..1d7f5615 100644 --- a/app/views/origami/order_reservation/index.html.erb +++ b/app/views/origami/order_reservation/index.html.erb @@ -430,7 +430,7 @@