| Line 19... |
Line 19... |
| 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, change_warehouse, change_product, add_delay_reason,\
|
22 |
update_weight, change_warehouse, change_product, add_delay_reason,\
|
| 23 |
reconcile_cod_collection, get_transactions_requiring_extra_processing,\
|
23 |
reconcile_cod_collection, get_transactions_requiring_extra_processing,\
|
| 24 |
mark_transaction_as_processed, get_item_wise_risky_orders_count
|
24 |
mark_transaction_as_processed, get_item_wise_risky_orders_count,\
|
| - |
|
25 |
get_orders_in_batch, get_order_count
|
| 25 |
|
26 |
|
| 26 |
from shop2020.model.v1.order.impl.Convertors import to_t_transaction,\
|
27 |
from shop2020.model.v1.order.impl.Convertors import to_t_transaction,\
|
| 27 |
to_t_alert, to_t_order, to_t_lineitem
|
28 |
to_t_alert, to_t_order, to_t_lineitem
|
| 28 |
from shop2020.thriftpy.model.v1.order.ttypes import Transaction, OrderStatus,\
|
29 |
from shop2020.thriftpy.model.v1.order.ttypes import Transaction, OrderStatus,\
|
| 29 |
LineItem, Order, TransactionServiceException
|
30 |
LineItem, Order, TransactionServiceException
|
| Line 142... |
Line 143... |
| 142 |
current_from_date, current_to_date = get_fdate_tdate(from_date, to_date)
|
143 |
current_from_date, current_to_date = get_fdate_tdate(from_date, to_date)
|
| 143 |
orders = get_all_orders(status, current_from_date, current_to_date, warehouse_id)
|
144 |
orders = get_all_orders(status, current_from_date, current_to_date, warehouse_id)
|
| 144 |
return [to_t_order(order) for order in orders]
|
145 |
return [to_t_order(order) for order in orders]
|
| 145 |
finally:
|
146 |
finally:
|
| 146 |
close_session()
|
147 |
close_session()
|
| - |
|
148 |
|
| - |
|
149 |
def getOrdersInBatch(self, statuses, offset, limit, warehouse_id):
|
| - |
|
150 |
"""
|
| - |
|
151 |
Returns at most 'limit' orders with the given statuses for the given warehouse starting from the given offset.
|
| - |
|
152 |
Pass the status as null and the limit as 0 to ignore them.
|
| - |
|
153 |
|
| - |
|
154 |
Parameters:
|
| - |
|
155 |
- statuses
|
| - |
|
156 |
- offset
|
| - |
|
157 |
- limit
|
| - |
|
158 |
- warehouse_id
|
| - |
|
159 |
"""
|
| 147 |
|
160 |
try:
|
| - |
|
161 |
orders = get_orders_in_batch(statuses, offset, limit, warehouse_id)
|
| - |
|
162 |
return [to_t_order(order) for order in orders]
|
| - |
|
163 |
finally:
|
| - |
|
164 |
close_session()
|
| - |
|
165 |
|
| - |
|
166 |
def getOrderCount(self, statuses, warehouseId):
|
| - |
|
167 |
"""
|
| - |
|
168 |
Returns the count of orders with the given statuses assigned to the given warehouse.
|
| - |
|
169 |
|
| - |
|
170 |
Parameters:
|
| - |
|
171 |
- statuses
|
| - |
|
172 |
- warehouseId
|
| - |
|
173 |
"""
|
| - |
|
174 |
try:
|
| - |
|
175 |
return get_order_count(statuses, warehouseId)
|
| - |
|
176 |
finally:
|
| - |
|
177 |
close_session()
|
| - |
|
178 |
|
| 148 |
def getOrdersByBillingDate(self, status, start_billing_date, end_billing_date, warehouse_id):
|
179 |
def getOrdersByBillingDate(self, status, start_billing_date, end_billing_date, warehouse_id):
|
| 149 |
"""
|
180 |
"""
|
| 150 |
Parameters:
|
181 |
Parameters:
|
| 151 |
- status
|
182 |
- status
|
| 152 |
- start_billing_date
|
183 |
- start_billing_date
|