Subversion Repositories SmartDukaan

Rev

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

Rev 3376 Rev 3413
Line 951... Line 951...
951
                     OrderStatus.BILLED : OrderStatus.CANCELED,
951
                     OrderStatus.BILLED : OrderStatus.CANCELED,
952
                     }
952
                     }
953
        if order.status not in status_transition.keys():
953
        if order.status not in status_transition.keys():
954
            raise TransactionServiceException(114, "This order can't be refunded")
954
            raise TransactionServiceException(114, "This order can't be refunded")
955
    
955
    
956
        if order.status <= OrderStatus.BILLED:
956
        if order.status < OrderStatus.BILLED:
957
            __update_inventory_reservation(order)
957
            __update_inventory_reservation(order)
958
            order.statusDescription = "Order Cancelled"
958
            order.statusDescription = "Order Cancelled"
-
 
959
        elif order.status < OrderStatus.BILLED:
-
 
960
            __create_return_order(order)
-
 
961
            order.statusDescription = "Order Cancelled"
959
        elif order.status in [OrderStatus.SALES_RET_RECEIVED, OrderStatus.DOA_CERT_INVALID, OrderStatus.DOA_CERT_VALID] :
962
        elif order.status in [OrderStatus.SALES_RET_RECEIVED, OrderStatus.DOA_CERT_INVALID, OrderStatus.DOA_CERT_VALID] :
960
            __create_return_order(order)
963
            __create_return_order(order)
961
            __create_refund(order)
964
            __create_refund(order)
962
            order.statusDescription = "Order Refunded"
965
            order.statusDescription = "Order Refunded"
963
    else:
966
    else:
Line 1194... Line 1197...
1194
    try:
1197
    try:
1195
        session.query(Transaction.id).limit(1).one()
1198
        session.query(Transaction.id).limit(1).one()
1196
        return True
1199
        return True
1197
    except:
1200
    except:
1198
        return False
1201
        return False
1199
    
-
 
1200
1202
    
-
 
1203