Subversion Repositories SmartDukaan

Rev

Rev 8942 | Rev 8957 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 8942 Rev 8943
Line 2633... Line 2633...
2633
    
2633
    
2634
    #if this order is from store and a new order for it has already been reshipped then
2634
    #if this order is from store and a new order for it has already been reshipped then
2635
    #this order cannot be refunded.
2635
    #this order cannot be refunded.
2636
    if order.source == 2 and order.new_order_id:
2636
    if order.source == 2 and order.new_order_id:
2637
        raise TransactionServiceException(112, "This order should be marked reship")
2637
        raise TransactionServiceException(112, "This order should be marked reship")
-
 
2638
    if order.source == 6 or order.source ==7:
-
 
2639
        if order.status == OrderStatus.RTO_RECEIVED_PRESTINE:
-
 
2640
            order.statusDescription = "RTO Refunded"
-
 
2641
            order.status = OrderStatus.RTO_REFUNDED
-
 
2642
            order.refund_timestamp = datetime.datetime.now()
-
 
2643
            order.refunded_by = refunded_by
-
 
2644
            order.refund_reason = reason
-
 
2645
            session.commit()
-
 
2646
            return True
-
 
2647
        
2638
    
2648
    
2639
    if order.cod:
2649
    if order.cod:
2640
        logging.info("Refunding COD order with status " + str(order.status))
2650
        logging.info("Refunding COD order with status " + str(order.status))
2641
        status_transition = { OrderStatus.LOST_IN_TRANSIT : OrderStatus.LOST_IN_TRANSIT_REFUNDED,
2651
        status_transition = { OrderStatus.LOST_IN_TRANSIT : OrderStatus.LOST_IN_TRANSIT_REFUNDED,
2642
                     OrderStatus.RTO_RECEIVED_PRESTINE : OrderStatus.RTO_REFUNDED,
2652
                     OrderStatus.RTO_RECEIVED_PRESTINE : OrderStatus.RTO_REFUNDED,