Subversion Repositories SmartDukaan

Rev

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

Rev 3187 Rev 3226
Line 642... Line 642...
642
        try:
642
        try:
643
            return reship_order(orderId)
643
            return reship_order(orderId)
644
        finally:
644
        finally:
645
            close_session()
645
            close_session()
646
 
646
 
647
    def refundOrder(self, orderId):
647
    def refundOrder(self, orderId, refundedBy, reason):
648
        """
648
        """
649
        If the order is in SALES_RET_RECEIVED, DOA_CERT_VALID or DOA_CERT_INVALID state, it does the following:
649
        If the order is in SALES_RET_RECEIVED, DOA_CERT_VALID or DOA_CERT_INVALID state, it does the following:
650
            1. Creates a refund request for batch processing.
650
            1. Creates a refund request for batch processing.
651
            2. Creates a return order for the warehouse executive to return the shipped material.
651
            2. Creates a return order for the warehouse executive to return the shipped material.
652
            3. Marks the current order as SALES_RET_REFUNDED, DOA_VALID_REFUNDED or DOA_INVALID_REFUNDED final states.
652
            3. Marks the current order as SALES_RET_REFUNDED, DOA_VALID_REFUNDED or DOA_INVALID_REFUNDED final states.
653
        
653
        
654
        If the order is in SUBMITTED_FOR_PROCESSING or INVENTORY_LOW state, it does the following:
654
        If the order is in SUBMITTED_FOR_PROCESSING or INVENTORY_LOW state, it does the following:
655
            1. Creates a refund request for batch processing.
655
            1. Creates a refund request for batch processing.
-
 
656
            2. Cancels the reservation of the item in the warehouse.
656
            2. Marks the current order as the REFUNDED final state.
657
            3. Marks the current order as the REFUNDED final state.
657
        
658
        
-
 
659
        For all COD orders, if the order is in INIT, SUBMITTED_FOR_PROCESSING or INVENTORY_LOW state, it does the following:
-
 
660
            1. Cancels the reservation of the item in the warehouse.
-
 
661
            2. Marks the current order as CANCELED.
-
 
662
            
-
 
663
        In all cases, it updates the reason for cancellation or refund and the person who performed the action.
-
 
664
         
658
        Returns True if it is successful, False otherwise.
665
        Returns True if it is successful, False otherwise.
659
        
666
        
660
        Throws an exception if the order with the given id couldn't be found.
667
        Throws an exception if the order with the given id couldn't be found.
661
        
668
        
662
        Parameters:
669
        Parameters:
663
         - orderId
670
         - orderId
-
 
671
         - refundedBy
-
 
672
         - reason
664
        """
673
        """
665
        try:
674
        try:
666
            return refund_order(orderId)
675
            return refund_order(orderId, refundedBy, reason)
667
        finally:
676
        finally:
668
            close_session()
677
            close_session()
669
 
678
 
670
    def getReturnOrders(self, warehouseId, fromDate, toDate):
679
    def getReturnOrders(self, warehouseId, fromDate, toDate):
671
        """
680
        """