Subversion Repositories SmartDukaan

Rev

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

Rev 2842 Rev 3014
Line 210... Line 210...
210
        try:
210
        try:
211
            return bill_order(self, orderId)
211
            return bill_order(self, orderId)
212
        finally:
212
        finally:
213
            close_session()
213
            close_session()
214
            
214
            
215
    def getOrdersForCustomer(self, customerId, from_date, to_date, status):
215
    def getOrdersForCustomer(self, customerId, from_date, to_date, statuses):
216
        """
216
        """
-
 
217
        Returns list of orders for the given customer created between the given dates and having the given statuses.
-
 
218
        Pass and empty list to ignore filtering on statuses.
-
 
219
        
217
        Parameters:
220
        Parameters:
218
         - customerId
221
         - customerId
219
         - from_date
222
         - from_date
220
         - to_date
223
         - to_date
221
         - status
224
         - statuses
222
        """
225
        """
223
        try:
226
        try:
224
            current_from_date, current_to_date = get_fdate_tdate(from_date, to_date)
227
            current_from_date, current_to_date = get_fdate_tdate(from_date, to_date)
225
            
228
            
226
            orders = get_orders_for_customer(customerId, current_from_date, current_to_date, status)
229
            orders = get_orders_for_customer(customerId, current_from_date, current_to_date, statuses)
227
            return [to_t_order(order) for order in orders]
230
            return [to_t_order(order) for order in orders]
228
        finally:
231
        finally:
229
            close_session()
232
            close_session()
230
    
233
    
231
    def getOrderForCustomer(self, orderId, customerId):
234
    def getOrderForCustomer(self, orderId, customerId):