Subversion Repositories SmartDukaan

Rev

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

Rev 3427 Rev 3451
Line 16... Line 16...
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, reship_order, refund_order, get_return_orders,\
19
    receive_return, validate_doa, reship_order, refund_order, get_return_orders,\
20
    process_return, get_return_order, mark_doas_as_picked_up,\
20
    process_return, get_return_order, mark_doas_as_picked_up,\
21
    create_purchase_order, verify_order, is_alive, get_orders_by_shipping_date
21
    create_purchase_order, verify_order, is_alive, get_orders_by_shipping_date,\
-
 
22
    update_weight
22
 
23
 
23
from shop2020.model.v1.order.impl.Convertors import to_t_transaction,\
24
from shop2020.model.v1.order.impl.Convertors import to_t_transaction,\
24
    to_t_alert, to_t_order, to_t_lineitem
25
    to_t_alert, to_t_order, to_t_lineitem
25
from shop2020.thriftpy.model.v1.order.ttypes import Transaction, OrderStatus,\
26
from shop2020.thriftpy.model.v1.order.ttypes import Transaction, OrderStatus,\
26
    LineItem, Order, TransactionServiceException
27
    LineItem, Order, TransactionServiceException
Line 155... Line 156...
155
            orders = get_orders_by_billing_date(status, current_start_billing_date, current_end_billing_date, warehouse_id)
156
            orders = get_orders_by_billing_date(status, current_start_billing_date, current_end_billing_date, warehouse_id)
156
            return [to_t_order(order) for order in orders]
157
            return [to_t_order(order) for order in orders]
157
        finally:
158
        finally:
158
            close_session()
159
            close_session()
159
    
160
    
160
    def getOrdersByShippingDate(self, fromShippingDate, toShippingDate, providerId, warehouseId):
161
    def getOrdersByShippingDate(self, fromShippingDate, toShippingDate, providerId, warehouseId, cod):
161
        """
162
        """
162
        Returns orders for a particular provider and warehouse which were shipped between the given dates.
163
        Returns orders for a particular provider and warehouse which were shipped between the given dates.
-
 
164
        Returned orders comprise of COD orders if cod parameter is true. It comprises of prepaid orders otherwise.
163
        Pass providerId and warehouseId as -1 to ignore both the parameters.
165
        Pass providerId and warehouseId as -1 to ignore both these parameters.
164
        
166
        
165
        Parameters:
167
        Parameters:
166
         - fromShippingDate
168
         - fromShippingDate
167
         - toShippingDate
169
         - toShippingDate
168
         - providerId
170
         - providerId
169
         - warehouseId
171
         - warehouseId
-
 
172
         - cod
170
        """
173
        """
171
        try:
174
        try:
172
            from_shipping_date, to_shipping_date = get_fdate_tdate(fromShippingDate, toShippingDate)
175
            from_shipping_date, to_shipping_date = get_fdate_tdate(fromShippingDate, toShippingDate)
173
            orders = get_orders_by_shipping_date(from_shipping_date, to_shipping_date, providerId, warehouseId)
176
            orders = get_orders_by_shipping_date(from_shipping_date, to_shipping_date, providerId, warehouseId, cod)
174
            return [to_t_order(order) for order in orders]
177
            return [to_t_order(order) for order in orders]
175
        finally:
178
        finally:
176
            close_session()
179
            close_session()
177
    
180
    
178
    def getReturnableOrdersForCustomer(self, customerId, limit = None):
181
    def getReturnableOrdersForCustomer(self, customerId, limit = None):
Line 745... Line 748...
745
        """
748
        """
746
        try:
749
        try:
747
            return create_purchase_order(warehouseId)
750
            return create_purchase_order(warehouseId)
748
        finally:
751
        finally:
749
            close_session()
752
            close_session()
750
  
753
    
-
 
754
    def updateWeight(self, orderId, weight):
-
 
755
        """
-
 
756
        Set the weight of the given order to the provided value. Will attempt to update the weight of the item in the catalog as well.
-
 
757
        
-
 
758
        Parameters:
-
 
759
         - orderId
-
 
760
         - weight
-
 
761
        """
-
 
762
        try:
-
 
763
            order = update_weight(orderId, weight)
-
 
764
            return to_t_order(order)
-
 
765
        finally:
-
 
766
            close_session()
-
 
767
    
751
    def closeSession(self, ):
768
    def closeSession(self, ):
752
        close_session()
769
        close_session()
753
 
770
 
754
    def isAlive(self, ):
771
    def isAlive(self, ):
755
        """
772
        """