| Line 1326... |
Line 1326... |
| 1326 |
__capture_txn(order)
|
1326 |
__capture_txn(order)
|
| 1327 |
order.status = OrderStatus.ACCEPTED
|
1327 |
order.status = OrderStatus.ACCEPTED
|
| 1328 |
order.statusDescription = "Order Accepted"
|
1328 |
order.statusDescription = "Order Accepted"
|
| 1329 |
order.accepted_timestamp = datetime.datetime.now()
|
1329 |
order.accepted_timestamp = datetime.datetime.now()
|
| 1330 |
if order.source == 6 or order.source == 7 or order.source == 8:
|
1330 |
if order.source == 6 or order.source == 7 or order.source == 8:
|
| - |
|
1331 |
if order.source == 8 and order.cod:
|
| - |
|
1332 |
order.cod = False
|
| 1331 |
session.commit()
|
1333 |
session.commit()
|
| 1332 |
return "True"
|
1334 |
return "True"
|
| 1333 |
__amend_fulfilment_warehouse(order)
|
1335 |
__amend_fulfilment_warehouse(order)
|
| 1334 |
__update_transfer_price(order, order.fulfilmentWarehouseId)
|
1336 |
__update_transfer_price(order, order.fulfilmentWarehouseId)
|
| 1335 |
session.commit()
|
1337 |
session.commit()
|
| Line 5609... |
Line 5611... |
| 5609 |
freebieOrderAttribute.orderId = order.id
|
5611 |
freebieOrderAttribute.orderId = order.id
|
| 5610 |
freebieOrderAttribute.name = "freebieOrderId"
|
5612 |
freebieOrderAttribute.name = "freebieOrderId"
|
| 5611 |
freebieOrderAttribute.value = str(freebie_order.id)
|
5613 |
freebieOrderAttribute.value = str(freebie_order.id)
|
| 5612 |
session.commit()
|
5614 |
session.commit()
|
| 5613 |
|
5615 |
|
| - |
|
5616 |
'''
|
| - |
|
5617 |
crmServiceClient = CRMClient().get_client()
|
| - |
|
5618 |
ticket =Ticket()
|
| - |
|
5619 |
activity = Activity()
|
| - |
|
5620 |
description = "Creating Ticket for " + splitReason + " Order"
|
| - |
|
5621 |
ticket.creatorId = 1
|
| - |
|
5622 |
ticket.assigneeId = 34
|
| - |
|
5623 |
ticket.category = TicketCategory.OTHER
|
| - |
|
5624 |
ticket.priority = TicketPriority.HIGH
|
| - |
|
5625 |
ticket.status = TicketStatus.OPEN
|
| - |
|
5626 |
ticket.description = description
|
| - |
|
5627 |
ticket.orderId = order_id
|
| - |
|
5628 |
activity.creatorId = 1
|
| - |
|
5629 |
activity.ticketAssigneeId = ticket.assigneeId
|
| - |
|
5630 |
activity.type = ActivityType.OTHER
|
| - |
|
5631 |
activity.description = description
|
| - |
|
5632 |
activity.ticketCategory = ticket.category
|
| - |
|
5633 |
activity.ticketDescription = ticket.description
|
| - |
|
5634 |
activity.ticketPriority = ticket.priority
|
| - |
|
5635 |
activity.ticketStatus = ticket.status
|
| - |
|
5636 |
ticket.customerId= order.customer_id
|
| - |
|
5637 |
ticket.customerEmailId = order.customer_email
|
| - |
|
5638 |
ticket.customerMobileNumber = order.customer_mobilenumber
|
| - |
|
5639 |
ticket.customerName = order.customer_name
|
| - |
|
5640 |
activity.customerId = ticket.customerId
|
| - |
|
5641 |
activity.customerEmailId = order.customer_email
|
| - |
|
5642 |
activity.customerMobileNumber = order.customer_mobilenumber
|
| - |
|
5643 |
activity.customerName = order.customer_name
|
| - |
|
5644 |
crmServiceClient.insertTicket(ticket, activity)
|
| - |
|
5645 |
'''
|
| - |
|
5646 |
|
| 5614 |
return to_t_order(freebie_order)
|
5647 |
return to_t_order(freebie_order)
|
| 5615 |
|
5648 |
|
| 5616 |
def __printRechargeInvoice(filename, operator, amount, telNum, customerName, invNum, billingTime, payMethod):
|
5649 |
def __printRechargeInvoice(filename, operator, amount, telNum, customerName, invNum, billingTime, payMethod):
|
| 5617 |
PAGE_HEIGHT=defaultPageSize[1];
|
5650 |
PAGE_HEIGHT=defaultPageSize[1];
|
| 5618 |
styles = getSampleStyleSheet()
|
5651 |
styles = getSampleStyleSheet()
|
| Line 6445... |
Line 6478... |
| 6445 |
order.shippingPrice = flipkartorder.shippingPrice
|
6478 |
order.shippingPrice = flipkartorder.shippingPrice
|
| 6446 |
order.octroiFee = flipkartorder.octroiFee
|
6479 |
order.octroiFee = flipkartorder.octroiFee
|
| 6447 |
order.emiFee = flipkartorder.emiFee
|
6480 |
order.emiFee = flipkartorder.emiFee
|
| 6448 |
order.maxNlc = flipkartorder.maxNlc
|
6481 |
order.maxNlc = flipkartorder.maxNlc
|
| 6449 |
s_order = Order.get_by(id=flipkartorder.orderId)
|
6482 |
s_order = Order.get_by(id=flipkartorder.orderId)
|
| - |
|
6483 |
if s_order.cod:
|
| - |
|
6484 |
s_order.status = OrderStatus.COD_VERIFICATION_PENDING
|
| - |
|
6485 |
else:
|
| 6450 |
s_order.status = OrderStatus.ACCEPTED
|
6486 |
s_order.status = OrderStatus.ACCEPTED
|
| 6451 |
user = None
|
6487 |
user = None
|
| 6452 |
try:
|
6488 |
try:
|
| 6453 |
user_client = UserClient().get_client()
|
6489 |
user_client = UserClient().get_client()
|
| 6454 |
user_to_add = User()
|
6490 |
user_to_add = User()
|
| 6455 |
user_to_add.email = 'FK.'+ str(flipkartorder.orderId) + '@mailinator.com'
|
6491 |
user_to_add.email = 'FK.'+ str(flipkartorder.orderId) + '@mailinator.com'
|
| Line 6923... |
Line 6959... |
| 6923 |
return returnAllFbaSkuDetails
|
6959 |
return returnAllFbaSkuDetails
|
| 6924 |
|
6960 |
|
| 6925 |
def get_amazon_fba_sales_latest_snapshot_for_item_location_wise(item_id,location):
|
6961 |
def get_amazon_fba_sales_latest_snapshot_for_item_location_wise(item_id,location):
|
| 6926 |
return AmazonFbaSalesSnapshot.query.filter(AmazonFbaSalesSnapshot.item_id==item_id).filter(AmazonFbaSalesSnapshot.fcLocation==location).order_by(desc(AmazonFbaSalesSnapshot.dateOfSale)).first()
|
6962 |
return AmazonFbaSalesSnapshot.query.filter(AmazonFbaSalesSnapshot.item_id==item_id).filter(AmazonFbaSalesSnapshot.fcLocation==location).order_by(desc(AmazonFbaSalesSnapshot.dateOfSale)).first()
|
| 6927 |
|
6963 |
|
| - |
|
6964 |
def get_verification_pending_orders_fk():
|
| - |
|
6965 |
retOrders = Order.query.filter(Order.source==OrderSource.FLIPKART).filter(Order.status==OrderStatus.COD_VERIFICATION_PENDING).all()
|
| - |
|
6966 |
retFkOrders = []
|
| - |
|
6967 |
order_ids = []
|
| - |
|
6968 |
if not retOrders:
|
| - |
|
6969 |
return retFkOrders
|
| - |
|
6970 |
else:
|
| - |
|
6971 |
for order in retOrders:
|
| - |
|
6972 |
order_ids.append(order.id)
|
| - |
|
6973 |
retFkOrders = FlipkartOrder.query.filter(FlipkartOrder.orderId.in_(tuple(order_ids)))
|
| - |
|
6974 |
if not retFkOrders:
|
| - |
|
6975 |
retFkOrders = []
|
| - |
|
6976 |
return retFkOrders
|
| - |
|
6977 |
|
| 6928 |
if __name__ == '__main__':
|
6978 |
if __name__ == '__main__':
|
| 6929 |
print get_orders_by_mobile_number("9650889334")
|
6979 |
print get_orders_by_mobile_number("9650889334")
|