Subversion Repositories SmartDukaan

Rev

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

Rev 19821 Rev 19832
Line 1925... Line 1925...
1925
        return True
1925
        return True
1926
    else:
1926
    else:
1927
        logging.warning("Verify called for order no." + str(orderId) +" which is not in verification pending state");
1927
        logging.warning("Verify called for order no." + str(orderId) +" which is not in verification pending state");
1928
        return False
1928
        return False
1929
        
1929
        
-
 
1930
def unaccept_order(orderId):
-
 
1931
    logging.info("UnAccepting order no: " + str(orderId))
-
 
1932
    orders = [get_order(orderId)]
-
 
1933
    if orders[0].status != OrderStatus.ACCEPTED:
-
 
1934
        return False
-
 
1935
    logisticsTxnId = order.logisticsTransactionId
-
 
1936
    if logisticsTxnId is None:
-
 
1937
        orders = Order.query.filter(Order.logisticsTransactionId==order.logisticsTransactionId).all()
-
 
1938
    for o in orders:
-
 
1939
        o.status = OrderStatus.SUBMITTED_FOR_PROCESSING 
-
 
1940
        o.statusDescription = 'Submitted For Processing'
-
 
1941
        o.accepted_timestamp = None
-
 
1942
        o.logisticsTransactionId = None
-
 
1943
        o.airwaybill_no = None
-
 
1944
        o.tracking_id = None
-
 
1945
        o.billing_timestamp = None
-
 
1946
        o.invoice_number= None
-
 
1947
        o.jacket_number = None
-
 
1948
        o.refund_timestamp= None
-
 
1949
        o.refunded_by= None 
-
 
1950
        o.refund_reason= None
-
 
1951
    session.commit()
-
 
1952
    return True
-
 
1953
    
-
 
1954
    
1930
def accept_order(orderId):
1955
def accept_order(orderId):
1931
    logging.info("Accepting order no: " + str(orderId))
1956
    logging.info("Accepting order no: " + str(orderId))
1932
    order = get_order(orderId)
1957
    order = get_order(orderId)
1933
    
1958
    
1934
    ordersList = []
1959
    ordersList = []