Subversion Repositories SmartDukaan

Rev

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

Rev 2616 Rev 2628
Line 14... Line 14...
14
    mark_orders_as_delivered, mark_orders_as_failed, add_jacket_number,\
14
    mark_orders_as_delivered, mark_orders_as_failed, add_jacket_number,\
15
    order_outofstock, batch_orders, update_non_delivery_reason, enqueue_transaction_info_email,\
15
    order_outofstock, batch_orders, update_non_delivery_reason, enqueue_transaction_info_email,\
16
    get_undelivered_orders, get_order_for_customer, get_valid_order_count,\
16
    get_undelivered_orders, get_order_for_customer, get_valid_order_count,\
17
    get_cust_count_with_successful_txn, get_valid_orders_amount_range,\
17
    get_cust_count_with_successful_txn, get_valid_orders_amount_range,\
18
    get_valid_orders, toggle_doa_flag, request_pickup_number, authorize_pickup,\
18
    get_valid_orders, toggle_doa_flag, request_pickup_number, authorize_pickup,\
19
    receive_return, validate_doa
19
    receive_return, validate_doa, reship_order, refund_order
20
 
20
 
21
from shop2020.model.v1.order.impl.Convertors import to_t_transaction,\
21
from shop2020.model.v1.order.impl.Convertors import to_t_transaction,\
22
    to_t_alert, to_t_order, to_t_lineitem
22
    to_t_alert, to_t_order, to_t_lineitem
23
from shop2020.thriftpy.model.v1.order.ttypes import Transaction, OrderStatus,\
23
from shop2020.thriftpy.model.v1.order.ttypes import Transaction, OrderStatus,\
24
    LineItem, Order
24
    LineItem, Order
Line 568... Line 568...
568
        """
568
        """
569
        try:
569
        try:
570
            return validate_doa(orderId, isValid)
570
            return validate_doa(orderId, isValid)
571
        finally:
571
        finally:
572
            close_session()
572
            close_session()
-
 
573
 
-
 
574
    def reshipOrder(self, orderId):
-
 
575
        """
-
 
576
        If the order is in SALES_RET_RECEIVED or DOA_CERT_INVALID state, it does the following:
-
 
577
            1. Creates a new order for processing in the BILLED state. All billing information is saved.
-
 
578
            2. Marks the current order as one of the final states SALES_RET_RESHIPPED and DOA_INVALID_RESHIPPED depending on what state the order started in.
-
 
579
            
-
 
580
        If the order is in DOA_CERT_VALID state, it does the following:
-
 
581
            1. Creates a new order for processing in the SUBMITTED_FOR_PROCESSING state.
-
 
582
            2. Creates a return order for the warehouse executive to return the DOA material.
-
 
583
            3. Marks the current order as the final DOA_RESHIPPED state.
-
 
584
        
-
 
585
        Returns the id of the newly created order.
-
 
586
        
-
 
587
        Throws an exception if the order with the given id couldn't be found.
-
 
588
        
-
 
589
        Parameters:
-
 
590
         - orderId
-
 
591
        """
-
 
592
        try:
-
 
593
            return reship_order(orderId)
-
 
594
        finally:
-
 
595
            close_session()
-
 
596
 
-
 
597
    def refundOrder(self, orderId):
-
 
598
        """
-
 
599
        If the order is in SALES_RET_RECEIVED, DOA_CERT_VALID or DOA_CERT_INVALID state, it does the following:
-
 
600
            1. Creates a refund request for batch processing.
-
 
601
            2. Creates a return order for the warehouse executive to return the shipped material.
-
 
602
            3. Marks the current order as SALES_RET_REFUNDED, DOA_VALID_REFUNDED or DOA_INVALID_REFUNDED final states.
-
 
603
        
-
 
604
        If the order is in SUBMITTED_FOR_PROCESSING or INVENTORY_LOW state, it does the following:
-
 
605
            1. Creates a refund request for batch processing.
-
 
606
            2. Marks the current order as the REFUNDED final state.
-
 
607
        
-
 
608
        Returns True if it is successful, False otherwise.
-
 
609
        
-
 
610
        Throws an exception if the order with the given id couldn't be found.
-
 
611
        
-
 
612
        Parameters:
-
 
613
         - orderId
-
 
614
        """
-
 
615
        try:
-
 
616
            return refund_order(orderId)
-
 
617
        finally:
-
 
618
            close_session()
-
 
619
 
573
  
620
  
574
    def closeSession(self, ):
621
    def closeSession(self, ):
575
        close_session()
622
        close_session()