| Line 742... |
Line 742... |
| 742 |
order.statusDescription = "Low Inventory"
|
742 |
order.statusDescription = "Low Inventory"
|
| 743 |
order.outofstock_timestamp = datetime.datetime.now()
|
743 |
order.outofstock_timestamp = datetime.datetime.now()
|
| 744 |
session.commit()
|
744 |
session.commit()
|
| 745 |
return True
|
745 |
return True
|
| 746 |
|
746 |
|
| 747 |
def mark_orders_as_manifested(warehouse_id, provider_id, cod):
|
- |
|
| 748 |
try:
|
- |
|
| 749 |
orders = Order.query.filter_by(warehouse_id = warehouse_id, logistics_provider_id = provider_id, status = OrderStatus.BILLED, cod = cod).all()
|
- |
|
| 750 |
for order in orders:
|
- |
|
| 751 |
order.status = OrderStatus.MANIFESTED
|
- |
|
| 752 |
order.statusDescription = "Order manifested"
|
- |
|
| 753 |
session.commit()
|
- |
|
| 754 |
return True
|
- |
|
| 755 |
except:
|
- |
|
| 756 |
return False
|
- |
|
| 757 |
|
- |
|
| 758 |
def mark_orders_as_shipped_from_warehouse(warehouseId, providerId, cod, orderIds):
|
747 |
def mark_orders_as_shipped_from_warehouse(warehouseId, providerId, cod, orderIds):
|
| 759 |
try:
|
748 |
try:
|
| 760 |
current_timestamp = datetime.datetime.now()
|
749 |
current_timestamp = datetime.datetime.now()
|
| 761 |
orders = Order.query.filter_by(warehouse_id = warehouseId, logistics_provider_id = providerId, status = OrderStatus.BILLED, cod = cod).all()
|
750 |
orders = Order.query.filter_by(warehouse_id = warehouseId, logistics_provider_id = providerId, status = OrderStatus.BILLED, cod = cod).all()
|
| 762 |
for order in orders:
|
751 |
for order in orders:
|
| Line 784... |
Line 773... |
| 784 |
order.status = OrderStatus.SHIPPED_TO_LOGST
|
773 |
order.status = OrderStatus.SHIPPED_TO_LOGST
|
| 785 |
order.statusDescription = "Order picked up by Courier Company"
|
774 |
order.statusDescription = "Order picked up by Courier Company"
|
| 786 |
order.pickup_timestamp = pickup_timestamp
|
775 |
order.pickup_timestamp = pickup_timestamp
|
| 787 |
session.commit()
|
776 |
session.commit()
|
| 788 |
|
777 |
|
| - |
|
778 |
def get_orders_not_picked_up(provider_id):
|
| 789 |
current_time = datetime.datetime.now()
|
779 |
current_time = datetime.datetime.now()
|
| 790 |
to_datetime = datetime.datetime(current_time.year, current_time.month, current_time.day)
|
780 |
to_datetime = datetime.datetime(current_time.year, current_time.month, current_time.day)
|
| 791 |
orders_not_picked_up = Order.query.filter_by(logistics_provider_id = provider_id).filter_by(status=OrderStatus.SHIPPED_FROM_WH).filter(Order.shipping_timestamp <= to_datetime).all()
|
781 |
orders_not_picked_up = Order.query.filter_by(logistics_provider_id = provider_id).filter_by(status=OrderStatus.SHIPPED_FROM_WH).filter(Order.shipping_timestamp <= to_datetime).all()
|
| 792 |
return orders_not_picked_up
|
782 |
return orders_not_picked_up
|
| 793 |
|
783 |
|
| 794 |
def mark_orders_as_delivered(provider_id, delivered_orders):
|
784 |
def mark_orders_as_delivered(provider_id, delivered_orders):
|
| 795 |
for awb, detail in delivered_orders.iteritems():
|
785 |
for awb, detail in delivered_orders.iteritems():
|
| 796 |
order = Order.query.filter_by(airwaybill_no=awb, logistics_provider_id = provider_id).first()
|
786 |
order = Order.query.filter_by(airwaybill_no=awb, logistics_provider_id = provider_id).first()
|
| 797 |
if order == None or order.status not in [OrderStatus.SHIPPED_FROM_WH, OrderStatus.SHIPPED_TO_LOGST]:
|
787 |
if order == None or order.status not in [OrderStatus.SHIPPED_FROM_WH, OrderStatus.SHIPPED_TO_LOGST, OrderStatus.SHIPPED_TO_DESTINATION_CITY, OrderStatus.REACHED_DESTINATION_CITY, OrderStatus.FIRST_DELIVERY_ATTEMPT_MADE]:
|
| 798 |
continue
|
788 |
continue
|
| 799 |
#raise TransactionServiceException(103, "No order found for the awb:" + awb)
|
789 |
#raise TransactionServiceException(103, "No order found for the awb:" + awb)
|
| 800 |
order.status = OrderStatus.DELIVERY_SUCCESS
|
790 |
order.status = OrderStatus.DELIVERY_SUCCESS
|
| 801 |
order.statusDescription = "Order delivered"
|
791 |
order.statusDescription = "Order delivered"
|
| 802 |
order.delivery_timestamp, order.receiver = detail.split('|')
|
792 |
timestamp, receiver = detail.split('|')
|
| - |
|
793 |
if order.first_dlvyatmp_timestamp is None:
|
| - |
|
794 |
order.first_dlvyatmp_timestamp = timestamp
|
| - |
|
795 |
order.delivery_timestamp = timestamp
|
| - |
|
796 |
order.receiver = receiver
|
| 803 |
update_trust_level(order)
|
797 |
update_trust_level(order)
|
| 804 |
session.commit()
|
798 |
session.commit()
|
| 805 |
|
799 |
|
| 806 |
def mark_order_as_delivered(orderId, deliveryTimestamp, receiver):
|
800 |
def mark_order_as_delivered(orderId, deliveryTimestamp, receiver):
|
| 807 |
order = Order.get_by(id=orderId)
|
801 |
order = Order.get_by(id=orderId)
|
| 808 |
if order == None or order.status not in [OrderStatus.SHIPPED_FROM_WH, OrderStatus.SHIPPED_TO_LOGST, OrderStatus.DOA_PICKUP_REQUEST_RAISED, OrderStatus.DOA_PICKUP_CONFIRMED, OrderStatus.RET_REQUEST_RECEIVED, OrderStatus.RET_PICKUP_CONFIRMED, OrderStatus.RET_REQUEST_AUTHORIZED, OrderStatus.RTO_IN_TRANSIT]:
|
802 |
if order == None or order.status not in [OrderStatus.SHIPPED_FROM_WH, OrderStatus.SHIPPED_TO_LOGST, OrderStatus.SHIPPED_TO_DESTINATION_CITY, OrderStatus.REACHED_DESTINATION_CITY, OrderStatus.FIRST_DELIVERY_ATTEMPT_MADE, OrderStatus.DOA_PICKUP_REQUEST_RAISED, OrderStatus.DOA_PICKUP_CONFIRMED, OrderStatus.RET_REQUEST_RECEIVED, OrderStatus.RET_PICKUP_CONFIRMED, OrderStatus.RET_REQUEST_AUTHORIZED, OrderStatus.RTO_IN_TRANSIT]:
|
| 809 |
raise TransactionServiceException(101, "Either wrond order id or invalid state " + str(orderId))
|
803 |
raise TransactionServiceException(101, "Either wrond order id or invalid state " + str(orderId))
|
| 810 |
|
804 |
|
| 811 |
if order.status in [OrderStatus.SHIPPED_FROM_WH, OrderStatus.SHIPPED_TO_LOGST, OrderStatus.RTO_IN_TRANSIT]:
|
805 |
if order.status in [OrderStatus.SHIPPED_FROM_WH, OrderStatus.SHIPPED_TO_LOGST, OrderStatus.SHIPPED_TO_DESTINATION_CITY, OrderStatus.REACHED_DESTINATION_CITY, OrderStatus.FIRST_DELIVERY_ATTEMPT_MADE, OrderStatus.RTO_IN_TRANSIT]:
|
| 812 |
order.delivery_timestamp = deliveryTimestamp
|
806 |
order.delivery_timestamp = deliveryTimestamp
|
| 813 |
order.receiver = receiver
|
807 |
order.receiver = receiver
|
| 814 |
order.status = OrderStatus.DELIVERY_SUCCESS
|
808 |
order.status = OrderStatus.DELIVERY_SUCCESS
|
| 815 |
order.statusDescription = "Order delivered"
|
809 |
order.statusDescription = "Order delivered"
|
| 816 |
update_trust_level(order)
|
810 |
update_trust_level(order)
|
| 817 |
session.commit()
|
811 |
session.commit()
|
| 818 |
|
812 |
|
| 819 |
def mark_orders_as_failed(provider_id, returned_orders):
|
813 |
def mark_orders_as_rto(provider_id, returned_orders):
|
| 820 |
for awb, detail in returned_orders.iteritems():
|
814 |
for awb, detail in returned_orders.iteritems():
|
| 821 |
order = Order.query.filter_by(airwaybill_no=awb, logistics_provider_id = provider_id).first()
|
815 |
order = Order.query.filter_by(airwaybill_no=awb, logistics_provider_id = provider_id).first()
|
| 822 |
if order == None or order.status not in [OrderStatus.SHIPPED_FROM_WH, OrderStatus.SHIPPED_TO_LOGST]:
|
816 |
if order == None or order.status not in [OrderStatus.SHIPPED_FROM_WH, OrderStatus.SHIPPED_TO_LOGST, OrderStatus.SHIPPED_TO_DESTINATION_CITY, OrderStatus.REACHED_DESTINATION_CITY, OrderStatus.FIRST_DELIVERY_ATTEMPT_MADE]:
|
| 823 |
continue
|
817 |
continue
|
| 824 |
#raise TransactionServiceException(103, "No order found for the awb:" + awb)
|
818 |
#raise TransactionServiceException(103, "No order found for the awb:" + awb)
|
| 825 |
order.status = OrderStatus.RTO_IN_TRANSIT
|
819 |
order.status = OrderStatus.RTO_IN_TRANSIT
|
| 826 |
order.delivery_timestamp, reason = detail.split('|')
|
820 |
order.delivery_timestamp, reason = detail.split('|')
|
| 827 |
order.statusDescription = "Order Returned to Origin:" + reason
|
821 |
order.statusDescription = "Order Returned to Origin:" + reason
|
| 828 |
update_trust_level(order)
|
822 |
update_trust_level(order)
|
| 829 |
session.commit()
|
823 |
session.commit()
|
| 830 |
|
824 |
|
| - |
|
825 |
def get_rto_orders(provider_id):
|
| - |
|
826 |
current_time = datetime.datetime.now()
|
| - |
|
827 |
to_datetime = datetime.datetime(current_time.year, current_time.month, current_time.day)
|
| - |
|
828 |
rto_orders = Order.query.filter_by(logistics_provider_id = provider_id).filter_by(status=OrderStatus.RTO_IN_TRANSIT).filter(Order.delivery_timestamp <= to_datetime).all()
|
| - |
|
829 |
return rto_orders
|
| - |
|
830 |
|
| 831 |
def update_non_delivery_reason(provider_id, undelivered_orders):
|
831 |
def update_non_delivery_reason(provider_id, undelivered_orders):
|
| 832 |
for awb, reason in undelivered_orders.iteritems():
|
832 |
for awb, reason in undelivered_orders.iteritems():
|
| 833 |
order = Order.query.filter_by(airwaybill_no=awb, logistics_provider_id = provider_id).first()
|
833 |
order = Order.query.filter_by(airwaybill_no=awb, logistics_provider_id = provider_id).first()
|
| 834 |
if order == None:
|
834 |
if order == None:
|
| 835 |
continue
|
835 |
continue
|
| 836 |
#raise TransactionServiceException(103, "No order found for the awb:" + awb)
|
836 |
#raise TransactionServiceException(103, "No order found for the awb:" + awb)
|
| 837 |
order.statusDescription = reason
|
837 |
order.statusDescription = reason
|
| 838 |
session.commit()
|
838 |
session.commit()
|
| 839 |
|
839 |
|
| - |
|
840 |
def get_non_delivered_orders_by_courier(provider_id):
|
| 840 |
current_time = datetime.datetime.now()
|
841 |
current_time = datetime.datetime.now()
|
| 841 |
today_datetime = datetime.datetime(current_time.year, current_time.month, current_time.day)
|
842 |
today_datetime = datetime.datetime(current_time.year, current_time.month, current_time.day)
|
| 842 |
upto_datetime = today_datetime - datetime.timedelta(4)
|
843 |
upto_datetime = today_datetime - datetime.timedelta(4)
|
| 843 |
orders_not_delivered = Order.query.filter_by(logistics_provider_id = provider_id).filter(Order.status.in_((OrderStatus.SHIPPED_FROM_WH, OrderStatus.SHIPPED_TO_LOGST))).filter(or_(Order.shipping_timestamp <= upto_datetime, Order.pickup_timestamp <= upto_datetime)).all()
|
844 |
orders_not_delivered = Order.query.filter_by(logistics_provider_id = provider_id).filter(Order.status.in_((OrderStatus.SHIPPED_FROM_WH, OrderStatus.SHIPPED_TO_LOGST, OrderStatus.SHIPPED_TO_DESTINATION_CITY, OrderStatus.REACHED_DESTINATION_CITY, OrderStatus.FIRST_DELIVERY_ATTEMPT_MADE))).filter(or_(Order.shipping_timestamp <= upto_datetime, Order.pickup_timestamp <= upto_datetime)).all()
|
| 844 |
return orders_not_delivered
|
845 |
return orders_not_delivered
|
| 845 |
|
846 |
|
| - |
|
847 |
def mark_orders_as_local_connected(provider_id, local_connected_orders):
|
| - |
|
848 |
for awb, timestamp in local_connected_orders.iteritems():
|
| - |
|
849 |
order = Order.query.filter_by(airwaybill_no=awb, logistics_provider_id = provider_id).first()
|
| - |
|
850 |
if order == None or order.status not in [OrderStatus.SHIPPED_FROM_WH, OrderStatus.SHIPPED_TO_LOGST]:
|
| - |
|
851 |
#raise TransactionServiceException(102, "No order found for the awb: " + awb)
|
| - |
|
852 |
continue
|
| - |
|
853 |
order.status = OrderStatus.SHIPPED_TO_DESTINATION_CITY
|
| - |
|
854 |
order.statusDescription = "Left Out of Origin City"
|
| - |
|
855 |
order.local_connected_timestamp = timestamp
|
| - |
|
856 |
session.commit()
|
| - |
|
857 |
|
| - |
|
858 |
def get_orders_not_local_connected(provider_id):
|
| - |
|
859 |
current_time = datetime.datetime.now()
|
| - |
|
860 |
to_datetime = datetime.datetime(current_time.year, current_time.month, current_time.day)
|
| - |
|
861 |
orders_pending_local_connection = Order.query.filter_by(logistics_provider_id = provider_id).filter(Order.status.in_((OrderStatus.SHIPPED_FROM_WH, OrderStatus.SHIPPED_TO_LOGST))).filter(or_(Order.shipping_timestamp <= to_datetime, Order.pickup_timestamp <= to_datetime)).all()
|
| - |
|
862 |
return orders_pending_local_connection
|
| - |
|
863 |
|
| - |
|
864 |
def mark_orders_as_destinationCityReached(provider_id, destination_city_reached_orders):
|
| - |
|
865 |
for awb, timestamp in destination_city_reached_orders.iteritems():
|
| - |
|
866 |
order = Order.query.filter_by(airwaybill_no=awb, logistics_provider_id = provider_id).first()
|
| - |
|
867 |
if order == None or order.status not in [OrderStatus.SHIPPED_FROM_WH, OrderStatus.SHIPPED_TO_LOGST, OrderStatus.SHIPPED_TO_DESTINATION_CITY]:
|
| - |
|
868 |
continue
|
| - |
|
869 |
#raise TransactionServiceException(103, "No order found for the awb:" + awb)
|
| - |
|
870 |
order.status = OrderStatus.REACHED_DESTINATION_CITY
|
| - |
|
871 |
order.statusDescription = "Reached Destination City"
|
| - |
|
872 |
order.reached_destination_timestamp = timestamp
|
| - |
|
873 |
session.commit()
|
| - |
|
874 |
|
| - |
|
875 |
def mark_orders_as_firstDeliveryAttempted(provider_id, first_atdl_orders):
|
| - |
|
876 |
for awb, detail in first_atdl_orders.iteritems():
|
| - |
|
877 |
order = Order.query.filter_by(airwaybill_no=awb, logistics_provider_id = provider_id).first()
|
| - |
|
878 |
if order == None or order.status not in [OrderStatus.SHIPPED_FROM_WH, OrderStatus.SHIPPED_TO_LOGST, OrderStatus.SHIPPED_TO_DESTINATION_CITY, OrderStatus.REACHED_DESTINATION_CITY]:
|
| - |
|
879 |
continue
|
| - |
|
880 |
#raise TransactionServiceException(103, "No order found for the awb:" + awb)
|
| - |
|
881 |
order.status = OrderStatus.FIRST_DELIVERY_ATTEMPT_MADE
|
| - |
|
882 |
order.first_dlvyatmp_timestamp, reason = detail.split('|')
|
| - |
|
883 |
order.statusDescription = reason
|
| - |
|
884 |
session.commit()
|
| - |
|
885 |
|
| 846 |
def get_orders_not_met_expected_delivery_date():
|
886 |
def get_orders_not_met_expected_delivery_date():
|
| 847 |
current_time = datetime.datetime.now()
|
887 |
current_time = datetime.datetime.now()
|
| 848 |
today_datetime = datetime.datetime(current_time.year, current_time.month, current_time.day)
|
888 |
today_datetime = datetime.datetime(current_time.year, current_time.month, current_time.day)
|
| 849 |
orders_not_delivered = Order.query.filter(Order.status.in_((OrderStatus.SHIPPED_FROM_WH, OrderStatus.SHIPPED_TO_LOGST))).filter(Order.expected_delivery_time <= today_datetime).all()
|
889 |
orders_not_delivered = Order.query.filter(Order.status.in_((OrderStatus.SHIPPED_FROM_WH, OrderStatus.SHIPPED_TO_LOGST, OrderStatus.SHIPPED_TO_DESTINATION_CITY, OrderStatus.REACHED_DESTINATION_CITY))).filter(Order.expected_delivery_time <= today_datetime).all()
|
| 850 |
return orders_not_delivered
|
890 |
return orders_not_delivered
|
| 851 |
|
891 |
|
| 852 |
def get_alerts(type, warehouseId, status, timestamp):
|
892 |
def get_alerts(type, warehouseId, status, timestamp):
|
| 853 |
query = Alert.query.filter(Alert.warehouseId == warehouseId)
|
893 |
query = Alert.query.filter(Alert.warehouseId == warehouseId)
|
| 854 |
if type != -1 :
|
894 |
if type != -1 :
|
| Line 1148... |
Line 1188... |
| 1148 |
order.status = OrderStatus.DOA_RETURN_IN_TRANSIT
|
1188 |
order.status = OrderStatus.DOA_RETURN_IN_TRANSIT
|
| 1149 |
order.statusDescription = "DOA picked up by Courier Company"
|
1189 |
order.statusDescription = "DOA picked up by Courier Company"
|
| 1150 |
order.doa_pickup_timestamp = doa_pickup_timestamp
|
1190 |
order.doa_pickup_timestamp = doa_pickup_timestamp
|
| 1151 |
session.commit()
|
1191 |
session.commit()
|
| 1152 |
|
1192 |
|
| - |
|
1193 |
def get_doas_not_picked_up(provider_id):
|
| 1153 |
current_time = datetime.datetime.now()
|
1194 |
current_time = datetime.datetime.now()
|
| 1154 |
to_datetime = datetime.datetime(current_time.year, current_time.month, current_time.day)
|
1195 |
to_datetime = datetime.datetime(current_time.year, current_time.month, current_time.day)
|
| 1155 |
orders_not_picked_up = Order.query.filter_by(doa_logistics_provider_id = provider_id).filter_by(status=OrderStatus.DOA_PICKUP_CONFIRMED).filter(Order.doa_auth_timestamp <= to_datetime).all()
|
1196 |
orders_not_picked_up = Order.query.filter_by(doa_logistics_provider_id = provider_id).filter_by(status=OrderStatus.DOA_PICKUP_CONFIRMED).filter(Order.doa_auth_timestamp <= to_datetime).all()
|
| 1156 |
return orders_not_picked_up
|
1197 |
return orders_not_picked_up
|
| 1157 |
|
1198 |
|
| Line 1164... |
Line 1205... |
| 1164 |
order.status = OrderStatus.RET_RETURN_IN_TRANSIT
|
1205 |
order.status = OrderStatus.RET_RETURN_IN_TRANSIT
|
| 1165 |
order.statusDescription = "Return order picked up by Courier Company"
|
1206 |
order.statusDescription = "Return order picked up by Courier Company"
|
| 1166 |
order.doa_pickup_timestamp = return_order_pickup_timestamp
|
1207 |
order.doa_pickup_timestamp = return_order_pickup_timestamp
|
| 1167 |
session.commit()
|
1208 |
session.commit()
|
| 1168 |
|
1209 |
|
| - |
|
1210 |
def get_return_orders_not_picked_up(provider_id):
|
| 1169 |
current_time = datetime.datetime.now()
|
1211 |
current_time = datetime.datetime.now()
|
| 1170 |
to_datetime = datetime.datetime(current_time.year, current_time.month, current_time.day)
|
1212 |
to_datetime = datetime.datetime(current_time.year, current_time.month, current_time.day)
|
| 1171 |
orders_not_picked_up = Order.query.filter_by(doa_logistics_provider_id = provider_id).filter_by(status=OrderStatus.RET_PICKUP_CONFIRMED).filter(Order.doa_auth_timestamp <= to_datetime).all()
|
1213 |
orders_not_picked_up = Order.query.filter_by(doa_logistics_provider_id = provider_id).filter_by(status=OrderStatus.RET_PICKUP_CONFIRMED).filter(Order.doa_auth_timestamp <= to_datetime).all()
|
| 1172 |
return orders_not_picked_up
|
1214 |
return orders_not_picked_up
|
| 1173 |
|
1215 |
|
| Line 1970... |
Line 2012... |
| 1970 |
"""
|
2012 |
"""
|
| 1971 |
Parameters:
|
2013 |
Parameters:
|
| 1972 |
- orderId
|
2014 |
- orderId
|
| 1973 |
"""
|
2015 |
"""
|
| 1974 |
order = get_order(orderId)
|
2016 |
order = get_order(orderId)
|
| 1975 |
if order.status not in [OrderStatus.SHIPPED_FROM_WH, OrderStatus.SHIPPED_TO_LOGST]:
|
2017 |
if order.status not in [OrderStatus.SHIPPED_FROM_WH, OrderStatus.SHIPPED_TO_LOGST, OrderStatus.SHIPPED_TO_DESTINATION_CITY, OrderStatus.REACHED_DESTINATION_CITY, OrderStatus.FIRST_DELIVERY_ATTEMPT_MADE]:
|
| 1976 |
raise TransactionServiceException(115, "This order can't be marked as lost in transit")
|
2018 |
raise TransactionServiceException(115, "This order can't be marked as lost in transit")
|
| 1977 |
order.status = OrderStatus.LOST_IN_TRANSIT
|
2019 |
order.status = OrderStatus.LOST_IN_TRANSIT
|
| 1978 |
order.statusDescription = "Lost in Transit"
|
2020 |
order.statusDescription = "Lost in Transit"
|
| 1979 |
session.commit()
|
2021 |
session.commit()
|
| 1980 |
|
2022 |
|
| Line 2206... |
Line 2248... |
| 2206 |
if not order:
|
2248 |
if not order:
|
| 2207 |
raise TransactionServiceException(108, "no such order")
|
2249 |
raise TransactionServiceException(108, "no such order")
|
| 2208 |
|
2250 |
|
| 2209 |
return order
|
2251 |
return order
|
| 2210 |
|
2252 |
|
| 2211 |
def get_orders_for_provider_for_status(provider_id, order_status):
|
2253 |
def get_orders_for_provider_for_status(provider_id, order_status_list):
|
| 2212 |
if not provider_id or not order_status:
|
2254 |
if not provider_id or not order_status_list:
|
| 2213 |
raise TransactionServiceException(101, "bad provider id or order status")
|
2255 |
raise TransactionServiceException(101, "bad provider id or order status")
|
| - |
|
2256 |
doa_provider = False
|
| - |
|
2257 |
for order_status in order_status_list:
|
| 2214 |
if order_status in [OrderStatus.DOA_PICKUP_CONFIRMED, OrderStatus.RET_PICKUP_CONFIRMED]:
|
2258 |
if order_status in [OrderStatus.DOA_PICKUP_CONFIRMED, OrderStatus.RET_PICKUP_CONFIRMED]:
|
| - |
|
2259 |
doa_provider = True
|
| - |
|
2260 |
if doa_provider:
|
| 2215 |
query = Order.query.filter_by(doa_logistics_provider_id = provider_id, status = order_status)
|
2261 |
query = Order.query.filter_by(doa_logistics_provider_id = provider_id).filter(Order.status.in_(order_status_list))
|
| 2216 |
else:
|
2262 |
else:
|
| 2217 |
query = Order.query.filter_by(logistics_provider_id = provider_id, status = order_status)
|
2263 |
query = Order.query.filter_by(logistics_provider_id = provider_id).filter(Order.status.in_(order_status_list))
|
| 2218 |
return query.all()
|
2264 |
return query.all()
|
| 2219 |
|
2265 |
|
| 2220 |
def get_billed_orders_for_vendor(vendor_id, billing_date_from, billing_date_to):
|
2266 |
def get_billed_orders_for_vendor(vendor_id, billing_date_from, billing_date_to):
|
| 2221 |
query = Order.query.filter_by(vendorId = vendor_id)
|
2267 |
query = Order.query.filter_by(vendorId = vendor_id)
|
| 2222 |
query = query.filter(Order.status != OrderStatus.PAYMENT_PENDING)
|
2268 |
query = query.filter(Order.status != OrderStatus.PAYMENT_PENDING)
|