Subversion Repositories SmartDukaan

Rev

Rev 13210 | Rev 18000 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

#set($messages = $action.getActionErrors())
#if($messages && $messages.size() != 0)
    #foreach($message in $messages)
        $message <br/>
    #end
#else
    #set($order = $action.getOrder())
        #set($provider=$action.getProvider())
        #set($amazonOrder=$action.getAmazonOrder())
    #if($action.canEditOrderAddress())
        <a class="change-shipment-address">
            Change shipment address
        </a>
        <div id="addresses">
            <form class="change-address">
                <table >
                    #foreach($address in $action.getAddresses())
                        <tr >
                            <td >
                                <input type="radio" id="address" name="addressId" value="$address.getId()"/>
                            </td>
                            <td >
                                #if($address.getName())
                                    <b>$address.getName()</b><br />
                                #end
                                #if($address.getLine1())
                                    <label>$address.getLine1() </label><br />
                                #end    
                                #if($address.getLine2() != "")
                                    <label>$address.getLine2()</label><br />
                                #end
                                #if($address.getCity()) 
                                    <label>$address.getCity()</label><br />
                                #end
                                #if($address.getState())
                                    <label>$address.getState()</label><br />
                                #end
                                #if($address.getPin())
                                    <label>Pin: $address.getPin()</label>
                                #end
                                </p>
                                #if($address.getPhone())
                                <b>Phone: $address.getPhone() </b>
                                #end
                            </td>
                        </tr>
                        <tr>
                            <td >
                                <input type="submit" value="Change Address"/>
                            </td>
                        </tr>
                    #end
                </table>
            </form>
        </div>
                #end
    #set($ticketId = $action.getCodTicketId())
    #if($ticketId)
        <br />
        <a href="/crm?email=&ticketId=$ticketId">
            COD verification ticket
        </a>
        <br />
    #end
    <br />
        #if($order.getSource() == 2)
                <h3 style="color: #ff8000;font-style: italic;">Store Order - This order was placed from store $action.getStoreDetails($order.getStoreId())</h3>
        #end
        #if($action.getStoreOrderDetail() && ($order.getStatus().getValue() == 15 || $order.getStatus().getValue() == 34))
        <div style="margin: 10px 0;font-size: 15px;">
                Cash Refund Amount : $action.getStoreOrderDetail().getCashRefundAmount()<br>
                Card Refund Amount : $action.getStoreOrderDetail().getCardRefundAmount()
        </div>
        #end
        #if($action.canOrderBeCancelled())
                #set($cancellationClass = "display-cancel-order-popup")
                #set($cancellationButtonId = "orderCancellationButton")
                #if($order.getSource() == 2)
                        #set($cancellationClass = "display-cancel-store-order-popup")
                        #set($cancellationButtonId = "storeOrderCancellationButton")
                        <div id="cancel-store-order-div" class="hidden">
            <form id="cancel-store-order-form">
                                <div style='margin:10px;padding:10px;border-bottom:1px solid black;'>
                                        Cash refund amount: <input name='cashAmount' type='text' style='width:150px;border:1px solid #777777;color:#999999;height:17px;padding:3px 5px;font-size:15px;' value='$action.getCashAmount()'></input><br> 
                                        Card refund amount: <input name='cardAmount' type='text' style='width:150px;border:1px solid #777777;color:#999999;height:17px;padding:3px 5px;font-size:15px;' value='$action.getCardAmount()'></input>
                                </div>
                <table class="display">
                    #foreach($item in $action.getCODCancelMatrix())
                        #if($velocityCount % 2 != 0)
                            <tr >
                        #end
                            <td>
                            #if($item.name().equals("INVALID_CONTACT_DETAILS"))
                                <input type="radio" name="cancelReason" id ="$item.name()" class = "cancelReason" value="$item.name()" checked />
                            #else
                                <input type="radio" name="cancelReason" id ="$item.name()" class = "cancelReason" value="$item.name()" />
                                                        #end
                                                        <label title="$item.getDescription()">$item.name()</label>
                            </td>
                        #if($velocityCount % 2 == 0)
                            </ tr>
                        #end
                    #end
                    <tr >
                        <td id="cancelReasonBox" colspan="2">
                            <textarea name="body" rows="5" cols="80" id="cancel-store-order-body"></textarea>
                        </td>
                    </tr>
                    <tr >
                        <td colspan="2">
                            <input type="submit" value="Cancel Order"/>
                        </td>
                    </tr>
                </table>
            </form>
                        </div>
                #else
                <div id="cancel-div" class="hidden">
            <form id="cancel-form">
                <table class="display">
                    #foreach($item in $action.getCODCancelMatrix())
                        #if($velocityCount % 2 != 0)
                            <tr >
                        #end
                        <td>
                        #if($item.name().equals("INVALID_CONTACT_DETAILS"))
                            <input type="radio" name="cancelReason" id ="$item.name()" class = "cancelReason" value="$item.name()" checked="checked" />
                        #else
                            <input type="radio" name="cancelReason" id ="$item.name()" class = "cancelReason" value="$item.name()" />
                        #end
                                        <label title="$item.getDescription()">$item.name()</label>
                        </td>
                        #if($velocityCount % 2 == 0)
                            </ tr>
                        #end
                    #end
                    <tr >
                        <td id="cancelReasonBox" colspan="2">
                            <textarea name="body" rows="5" cols="80" id="cancel-body"></textarea>
                        </td>
                    </tr>
                    <tr >
                        <td colspan="2">
                            <input type="submit" value="Cancel Order"/>
                        </td>
                    </tr>
                </table>
            </form>
                        </div>
                #end
        <div>
                <select id = "cancellationInitiator" name="cancellationInitiator">
                        <option value="CUSTOMER">CUSTOMER REQUEST</option>
                #if($action.canViewOrderCancellation())
                        <option value="INTERNAL">INTERNAL</option>
                #end
                </select>
                <input type="button" class="$cancellationClass" value="Cancel Order" id="$cancellationButtonId" orderid="$order.getId()">
        </div>
        #end
        
    <label class="heading">Order details: #if($order.getLogisticsTransactionId()) Master Order Id:- $order.getLogisticsTransactionId() #end</label><br />
    <div id="orderTopLeft">
                <span>Status Description :
            $action.getOrderStatusDescription($order)
        </span><br/>
        <span>Invoice No : #if($order.getInvoice_number()) $order.getInvoice_number() #end</span><br/>
        <span>Airway Bill No : #if($order.getAirwaybill_no()) $order.getAirwaybill_no() #end</span><br/>
        <span>Logitics Provider : #if($action.getProviderName()) $action.getProviderName()#else N/A #end</span><br/>
        <span>Receiver : #if($order.getReceiver()) $order.getReceiver() #end</span><br/>
        <span>Out Of Stock Time :
            #if($order.getOutofstock_timestamp() != 0) $action.convertDate($order.getOutofstock_timestamp())
            #end</span><br/>
                #if($action.getDealText())<span>Order Deal Text : $action.getDealText()</span>
                        #if($order.getFreebieItemId() != 0) 
                                <span class="bold">(Freebie Item : $action.getFreebieItem())</span>
                        #elseif($action.getFreebieOrderId())
                                <span>Freebie OrderId : $action.getFreebieOrderId()</span>
                        #elseif($action.getParentOrderIdForFreebieOrder())
                                <span>Parent OrderId : $action.getParentOrderIdForFreebieOrder()</span>
                        #end
                        <br/>
                #end
    </div>
    <div id="orderTopMiddle">
                <span>Source:  $action.getOrderSource($order)&nbsp;/&nbsp;$action.getBillingWarehouseName()</span><br/>
                #if($order.getSource() == 3 || $order.getSource() == 10)
                        <span>Source Order Id : #if($amazonOrder && $amazonOrder.getAmazonOrderCode()) $amazonOrder.getAmazonOrderCode() #else Not Found #end</span><br/>
                        #end
        <span>Accepted :
            #if($order.getAccepted_timestamp() != 0) $action.convertDate($order.getAccepted_timestamp())
            #end</span><br/>
        <span>Billed By :#if($order.getBilled_by()) $order.getBilled_by() #end</span><br/>
        <span>Billed :
            #if($order.getBilling_timestamp() != 0) $action.convertDate($order.getBilling_timestamp())
            #end</span><br/>
        <span>Shipped :
            #if($order.getShipping_timestamp() != 0) $action.convertDate($order.getShipping_timestamp())
            #end</span><br/>
        <span>Pickup :
            #if($order.getPickup_timestamp() != 0) $action.convertDate($order.getPickup_timestamp())
            #end</span><br/>
                #if($order.isSetRefund_timestamp())
                <span>Refund Time :
             $action.convertDate($order.getRefund_timestamp())
        #end</span><br/>
    </div>
    <div id="orderTopRight">
                <span>Verification timestamp :
            #if($order.getVerification_timestamp() != 0) $action.convertDate($order.getVerification_timestamp())
            #end</span><br/>
        <span class="bold">Promised Shipping : </span>
            #if($order.getPromised_shipping_time() != 0) $action.convertDate($order.getPromised_shipping_time())
            #end<br/>
        <span class="bold">Expected Shipping : </span>
            #if($order.getExpected_shipping_time() != 0) $action.convertDate($order.getExpected_shipping_time())
            #end<br/>
        <span class="bold">Promised Delivery : </span>
            #if($order.getPromised_delivery_time() != 0) $action.convertDate($order.getPromised_delivery_time())
            #end<br/>
        <span class="bold">Expected Delivery : </span>
            #if($order.getExpected_delivery_time() != 0) $action.convertDate($order.getExpected_delivery_time())
            #end<br/>
        <span>Delivered : #if($order.getDelivery_timestamp() != 0) $action.convertDate($order.getDelivery_timestamp()) #end</span><br/>
    </div>
        
        <br/>

        
    <div id="orderMiddle">
        <br />
                <div id = "order-confirmation-link-div">
           <a href = "/crm/user-order-info!getOrderConfirmationMail?orderId=$order.getId()" id = "order-confirmation-mail" orderId = "$order.getId()">Get Order Confirmation Mail</a>
                   <a style='margin-left: 10px;' href = "/crm/user-order-info!getOrderDeliveryMail?orderId=$order.getId()" orderId = "$order.getId()">Get Order Delivery Mail</a
            </div><br>
                #if($order.isOtg())
                        <span class='info'>This order is covered under On Time Guarantee</span>
                        <br>
                #end
                #if($order.getInsurer() > 0 && $order.getStatus().toString().equals("DELIVERY_SUCCESS"))
                        <span class='bold'>Insurer: </span>New India Assurance Limited<br>
                        <span class='bold'>Insurance valid upto : </span>$action.getInsuranceExpiryDate($order.getDelivery_timestamp())<br>
                #elseif($order.getInsurer() > 0)
                        <span class='bold'>Insurer: </span>New India Assurance Limited<br>
                #else
                #end
        #set($delayReason = "")
        #if($order.getDelayReason())
            $delayReason = $order.getDelayReason().name()
        #end
                #if($order.getRefundReason())
            <span class="bold" style='color:blue;'>Cancellation Reason : </span><span>$order.getRefundReason()</span></br>
        #end
        #if($action.canViewDelayedDeliveries())
            <span class="bold">Delay Reason: </span>$delayReason <br />
        #end
        #foreach($lineItem in $order.getLineitems())
            <span class="bold">$action.getProductName($lineItem) $lineItem.getTotal_price()($action.convertDouble($lineItem.getQuantity()), $lineItem.getUnit_price())</span><br/>
                #end
                
        #if($order.getPickupStoreId() == 0)
            #if($action.getAddress($order))
                                <span class="bold">Shipping Address: </span>$action.getAddress($order)&nbsp;&nbsp;&nbsp;
                                #if($action.canVerifyCOD()) 
                                        <!--Start:- Added by Manish Sharma on 13 May 2013 for Change Shipping Address functionality -->
                        #if($order.getStatus().toString()== "COD_VERIFICATION_PENDING" || $order.getStatus().toString()=="SUBMITTED_FOR_PROCESSING" || $order.getStatus().toString()=="ACCEPTED" || $order.getStatus().toString()=="INVENTORY_LOW" ||$order.getStatus().toString()=="REJECTED" || $order.getStatus().toString()=="BILLED" )
                                        <!--End:- Added by Manish Sharma on 13 May 2013 for Change Shipping Address functionality -->
                                        <!-- COD_VERIFICATION_PENDING = 2, SUBMITTED_FOR_PROCESSING = 3, ACCEPTED = 4,INVENTORY_LOW = 5, REJECTED = 6, BILLED = 7 -->
                                        <input id='changeShippingAddress' type='button' value='Change Address'><br/>
                                #set($address = $action.getShippingAddress($order))
                                <form id='shippingAddressFrm' style='display:none' action='/crm/user-order-info!changeShippingAddress'>
                                        Address line 1 : <input style='width:350px;' type='text' name='line1' value='$address.getLine1()'><br>
                                        Address line 2 : <input style='width:350px;' type='text' name='line2' value='$address.getLine2()'><br>
                                        City : <input type='text' name='city' value='$address.getCity()'><br>
                                        State : <input type='text' name='state' value='$address.getState()'><br>
                                        Pincode : <input type='text' name='pin' value='$address.getPin()'><br>
                                        <input id='submitNewAddress' orderId='$order.getId()' type='button' value='Change Address'><input id='cancelAddressChange' type='button' value='Cancel'>
                                </form>
                                        <!--Start:- Added/Modified by Manish Sharma on 13 May 2013 for Change Shipping Address functionality -->
                                        #end
                                        <!--End:- Added/Modified by Manish Sharma on 13 May 2013 for Change Shipping Address functionality -->
                                #end
                        #end
                        
        #else
            <span class="bold">Store Shipping Address: </span>$action.getShippingAddressOfStore($order.getPickupStoreId())<br/>
            <span class="bold">Billing Address: </span>$action.getAddress($order)<br/>
                        #if($order.getPickupStoreId() > 0 && $action.canVerifyCOD())
                                <input id='storeToNormal' order_id='$order.getId()' type='button' value='Convert to normal order'></input><br>
                        #end
        #end
        <br />
        <br />
        <label class="heading">Payment details</label><br />
        #set($payments = $action.getPayments())
        #set($count = 1)
        #foreach($payment in $payments)
        <span>Payment No. $count</span><br/>
        #set($count = $count + 1)
        <div id="orderMiddleLeft">
            #if($action.getGvAmount() > 0 )<span style="font-weight: bold;">GV Amount : $action.getGvAmount()</span><br />#end
            #if($payment.getDescription()) <span>Description : $payment.getDescription()</span><br/>#end
            #if($payment.getStatus().name()) <span>Status : $payment.getStatus().name()</span><br/>#end
            #if($payment.getAmount()) <span>Amount : $payment.getAmount()</span><br/>#end
            #if($payment.getAuthCode()) <span>AuthCode : $payment.getAuthCode()</span><br/>#end
                        #set($payMethod = $action.getPaymentMethod($payment.getAttributes()))
                        #if((!$order.isCod()) && $payMethod == "COD")
                                <span>Pay Method : Prepaid</span>
                        #elseif($payMethod) 
                                <span>Pay Method : $payMethod</span>
                        #end
        </div>
        <div id="orderMiddleMiddle">
            #set($gatewayName = $action.getGatewayName($payment))
            #if($gatewayName) <span>Gateway : $gatewayName</span><br/>#end
            #if($payment.getGatewayPaymentId()) <span>Gtwy Payment Id : $payment.getGatewayPaymentId()</span><br/>#end
            #if($payment.getGatewayTxnDate()) <span>Gtwy Txn Date : $payment.getGatewayTxnDate()</span><br/>#end
            #if($payment.getGatewayTxnId()) <span>Gtwy Txn Id : $payment.getGatewayTxnId()</span><br/>#end
            #if($payment.getGatewayTxnStatus()) <span>Gtwy Txn Status : $payment.getGatewayTxnStatus()</span>#end
        </div>
        <div id="orderMiddleRight">
            #if($payment.getErrorCode()) <span>Error Code : $payment.getErrorCode()</span><br/>#end
            #if($payment.getReferenceCode()) <span>Ref Code : $payment.getReferenceCode()</span><br/>#end
            #if($payment.getSessionId()) <span>Session Id : $payment.getSessionId()</span><br/>#end
            #if($payment.getSuccessTimestamp() != 0) <span>Success Time : $action.convertDate($payment.getSuccessTimestamp())</span>#end
        </div>
        #end
    </div>
                <br><br><br><br><br>                                    
                        #if($action.getRefundEnabledStatus()==2)
                                <input id='refundPayment' type='button' value='Refund'><br/>
                        #elseif($action.getRefundEnabledStatus()==0)
                                <span class='info'>Processed Refund Details:</span><br>
                                #set($details = $action.getPhysicalRefundDetails())
                                #foreach($detail in $details)
                                        <span>$detail</span><br>
                                #end
                        #end
                        
                        <form id ="refundPhysicalOrderForm" style="display:none;" action="/crm/user-order-info!refundOrderPayment" type="post">
                                <label class="heading">Refund details</label><br />
                                <span> Select Refund Method : </span> 
                                <br>
                                <input id="orderId" name="orderId" value='$order.getId()' type="hidden" />
                                <input id="orderAmount" name="orderAmount" value='$order.getTotal_amount()' type="hidden"/>
                                <input type = 'radio' id = 'rfdCoupon' name = 'rfdRadio' value = 'rfdCoupon' />Refund by Coupon <br>
                                #if($action.checkForOriginalOrders()==0)
                                #if($order.isCod()) 
                                        <input type = 'radio' id = 'rfdCheque' name = 'rfdRadio' value = 'rfdCheque'>Refund by Cheque <br>
                                #else 
                                        <input type = 'radio' id = 'rfdGateway' name = 'rfdRadio' value = 'rfdGateway'>Refund by Gateway
                                        #end
                                #elseif($action.checkForOriginalOrders()==1)
                                        <input type = 'radio' id = 'rfdCheque' name = 'rfdRadio' value = 'rfdCheque'>Refund by Cheque <br>
                                #else
                                        <input type = 'radio' id = 'rfdGateway' name = 'rfdRadio' value = 'rfdGateway'>Refund by Gateway
                                #end
                                <br>
                                <div id = 'refundByCoupon' class = "hidden">
                                <span>Coupon Details: </span>
                                        <input type="text" id="couponDetails" name="couponDetails"/>
                                                        <br>
                                        <span>Refund Amount: </span>
                                        <input type="text" id="refundAmountCoupon" name="refundAmountCoupon"/><span style='font-size:11px;padding-left:5px;color:red;'>Enter Numeric Value Only</span>
                </div>
                                <div id = 'refundByCheque' class = "hidden">
                                                <span>Cheque Details: </span>
                                        <input type="text" id="chequeDetails"name="chequeDetails"/>
                                                        <br>
                                        <span>Refund Amount: </span>
                                        <input type="text" id="refundAmountCheque" name="refundAmountCheque"/><span style='font-size:11px;padding-left:5px;color:red;'>Enter Numeric Value Only</span>
                </div>
                                <div id = 'refundByGateway' class = "hidden">
                                                <span>Comments: </span>
                                        <input type="text" id="comments" size="30px" name="comments"/>
                                                        <br>
                                                <span>Refund Amount: </span>
                                        <input type="text" id="refundAmountGateway" name="refundAmountGateway"/><span style='font-size:11px;padding-left:5px;color:red;'>Enter Numeric Value Only</span>
               </div>
                                <br>
                                        <div id = 'refundSubmit' >
                                                <input disabled='disabled' type="submit" value = "Submit" id="refundDetailSubmit"/>
                                        <input id='cancelRefundRequest' type='button' value='Cancel'>
                    </div>
                                        
                </form>
                
                
    <div id="orderBottom">
        <br />
        <br />
        <label class="heading">Shipment updates</label><br />
        <table id="shipment-details">
            <thead >
                <tr >
                    <th >Date</th>
                    <th >Time</th>
                    <th >City</th>
                    <th >Description</th>
                </tr>
            </thead>
            <tbody >
                #foreach($shipmentUpdate in $action.getShipmentUpdates())
                #set($trClass = "table-tr-odd")
                #if($velocityCount % 2 == 0)
                    #set($trClass = "table-tr-even")
                #end
                <tr class="$trClass">
                    <td >$shipmentUpdate.getDate()</td>
                    <td >$shipmentUpdate.getTime()</td>
                    <td >$shipmentUpdate.getCity()</td>
                    <td >$shipmentUpdate.getDescription()</td>
                </tr>
                #end
            </tbody>
        </table>
    </div>
#end

<script type='text/javascript'>
$('input[name=refundAmountCoupon]').keypress(function(e) {
        var a = [];
        var k = e.which;

        for (i = 46; i < 58; i++){
                if(i == 47){
                        continue;
                }
                else{
                a.push(i);
                }
        }

        if (!(a.indexOf(k)>=0)){
            e.preventDefault();
        }
    });

$('input[name=refundAmountCheque]').keypress(function(e) {
        var a = [];
        var k = e.which;

        for (i = 46; i < 58; i++){
                if(i == 47){
                        continue;
                }
                else{
                a.push(i);
                }
        }

        if (!(a.indexOf(k)>=0)){
            e.preventDefault();
        }
    });
        
$('input[name=refundAmountGateway]').keypress(function(e) {
        var a = [];
        var k = e.which;

        for (i = 46; i < 58; i++){
                if(i == 47){
                        continue;
                }
                else{
                a.push(i);
                }
        }

        if (!(a.indexOf(k)>=0)){
            e.preventDefault();
        }
    });
        
</script>