Subversion Repositories SmartDukaan

Rev

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

Rev 1351 Rev 1382
Line 3... Line 3...
3
 
3
 
4
@author: ashish
4
@author: ashish
5
'''
5
'''
6
from shop2020.model.v1.order.impl import DataService
6
from shop2020.model.v1.order.impl import DataService
7
from shop2020.model.v1.order.impl.DataAccessors import create_transaction,\
7
from shop2020.model.v1.order.impl.DataAccessors import create_transaction,\
8
create_order, get_new_transaction, get_transactions_for_customer, get_transaction_status,\
8
    create_order, get_new_transaction, get_transactions_for_customer, get_transaction_status,\
9
 get_line_items_for_order, get_transaction, get_transactions_for_shopping_cart_id,\
9
    get_line_items_for_order, get_transaction, get_transactions_for_shopping_cart_id,\
10
 change_transaction_status, get_orders_for_customer,get_orders_for_transaction, get_order,\
10
    change_transaction_status, get_orders_for_customer,get_orders_for_transaction, get_order,\
-
 
11
    get_returnable_orders_for_customer, get_cancellable_orders_for_customer, get_orders_by_billing_date,\
11
 get_all_orders, change_order_status, get_alerts, set_alert, add_billing_details,\
12
    get_all_orders, change_order_status, get_alerts, set_alert, add_billing_details,\
12
    mark_orders_as_manifested, close_session, accept_order, bill_order,\
13
    mark_orders_as_manifested, close_session, accept_order, bill_order, mark_orders_as_picked_up,\
13
    get_orders_by_billing_date, mark_orders_as_picked_up,\
-
 
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, email_transaction_info_to_user
15
    order_outofstock, batch_orders, update_non_delivery_reason, email_transaction_info_to_user
16
from shop2020.model.v1.order.impl.Convertors import to_t_transaction,\
16
from shop2020.model.v1.order.impl.Convertors import to_t_transaction,\
17
    to_t_alert, to_t_order, to_t_lineitem
17
    to_t_alert, to_t_order, to_t_lineitem
18
from shop2020.thriftpy.model.v1.order.ttypes import Transaction, OrderStatus,\
18
from shop2020.thriftpy.model.v1.order.ttypes import Transaction, OrderStatus,\
Line 143... Line 143...
143
            current_start_billing_date, current_end_billing_date = get_fdate_tdate(start_billing_date, end_billing_date)
143
            current_start_billing_date, current_end_billing_date = get_fdate_tdate(start_billing_date, end_billing_date)
144
            orders = get_orders_by_billing_date(status, current_start_billing_date, current_end_billing_date, warehouse_id)
144
            orders = get_orders_by_billing_date(status, current_start_billing_date, current_end_billing_date, warehouse_id)
145
            return [to_t_order(order) for order in orders]
145
            return [to_t_order(order) for order in orders]
146
        finally:
146
        finally:
147
            close_session()
147
            close_session()
-
 
148
    
-
 
149
    def getReturnableOrdersForCustomer(self, customerId, limit = None):
-
 
150
        """
-
 
151
        Parameters:
-
 
152
         - customerId
-
 
153
         - limit
-
 
154
        """
-
 
155
        try:
-
 
156
            return get_returnable_orders_for_customer(customerId, limit)
-
 
157
        finally:
-
 
158
            close_session()
148
            
159
            
-
 
160
    def getCancellableOrdersForCustomer(self, customerId, limit = None):
-
 
161
        """
-
 
162
        Parameters:
-
 
163
         - customerId
-
 
164
         - limit
-
 
165
        """
-
 
166
        try:
-
 
167
            return get_cancellable_orders_for_customer(customerId, limit)
-
 
168
        finally:
-
 
169
            close_session()
-
 
170
    
149
    def changeOrderStatus(self, orderId, status, description):
171
    def changeOrderStatus(self, orderId, status, description):
150
        """
172
        """
151
        Parameters:
173
        Parameters:
152
         - orderId
174
         - orderId
153
         - status
175
         - status