Subversion Repositories SmartDukaan

Rev

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

Rev 921 Rev 995
Line 7... Line 7...
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_all_orders, change_order_status, get_alerts, set_alert, add_billing_details,\
11
 get_all_orders, change_order_status, get_alerts, set_alert, add_billing_details,\
12
    mark_orders_as_manifested, close_session, accept_order, bill_order
12
    mark_orders_as_manifested, close_session, accept_order, bill_order,\
-
 
13
    get_orders_by_billing_date
13
from shop2020.model.v1.order.impl.Convertors import to_t_transaction,\
14
from shop2020.model.v1.order.impl.Convertors import to_t_transaction,\
14
    to_t_lineitem, to_t_alert, to_t_order, to_t_lineitem
15
    to_t_lineitem, to_t_alert, to_t_order, to_t_lineitem
15
from shop2020.thriftpy.model.v1.order.ttypes import Transaction, OrderStatus,\
16
from shop2020.thriftpy.model.v1.order.ttypes import Transaction, OrderStatus,\
16
    LineItem, Order
17
    LineItem, Order
17
from shop2020.utils.Utils import to_py_date, get_fdate_tdate
18
from shop2020.utils.Utils import to_py_date, get_fdate_tdate
Line 126... Line 127...
126
            orders = get_all_orders(status, current_from_date, current_to_date, warehouse_id)
127
            orders = get_all_orders(status, current_from_date, current_to_date, warehouse_id)
127
            return [to_t_order(order) for order in orders]
128
            return [to_t_order(order) for order in orders]
128
        finally:
129
        finally:
129
            close_session()
130
            close_session()
130
            
131
            
-
 
132
    def getOrdersByBillingDate(self, status, start_billing_date, end_billing_date, warehouse_id):
-
 
133
        """
-
 
134
        Parameters:
-
 
135
         - status
-
 
136
         - start_billing_date
-
 
137
         - end_billing_date
-
 
138
         - warehouse_id
-
 
139
        """
-
 
140
        try:
-
 
141
            current_start_billing_date, current_end_billing_date = get_fdate_tdate(start_billing_date, end_billing_date)
-
 
142
            orders = get_orders_by_billing_date(status, current_start_billing_date, current_end_billing_date, warehouse_id)
-
 
143
            return [to_t_order(order) for order in orders]
-
 
144
        finally:
-
 
145
            close_session()
-
 
146
            
131
    def changeOrderStatus(self, orderId, status, description):
147
    def changeOrderStatus(self, orderId, status, description):
132
        """
148
        """
133
        Parameters:
149
        Parameters:
134
         - orderId
150
         - orderId
135
         - status
151
         - status