| Line 40... |
Line 40... |
| 40 |
RechargeTransaction, HotspotStore, WalletForCompany, WalletHistoryForCompany, \
|
40 |
RechargeTransaction, HotspotStore, WalletForCompany, WalletHistoryForCompany, \
|
| 41 |
FRC, OperatorSeries, SourceDetail, Company, EbayOrder, AmazonFbaSalesSnapshot, \
|
41 |
FRC, OperatorSeries, SourceDetail, Company, EbayOrder, AmazonFbaSalesSnapshot, \
|
| 42 |
AmazonOrder, StoreOrderDetail, EdcBank, StoreOrderCollection, \
|
42 |
AmazonOrder, StoreOrderDetail, EdcBank, StoreOrderCollection, \
|
| 43 |
HotspotServiceMatrix, SnapdealOrder, FlipkartOrder, DataInsuranceDetailForOrder, \
|
43 |
HotspotServiceMatrix, SnapdealOrder, FlipkartOrder, DataInsuranceDetailForOrder, \
|
| 44 |
AmazonFbaOrderReturns, FlipkartAdvantageOrder, InvoiceCounterGenerator, \
|
44 |
AmazonFbaOrderReturns, FlipkartAdvantageOrder, InvoiceCounterGenerator, \
|
| 45 |
TransactionShipmentSequence
|
45 |
TransactionShipmentSequence, HsOrder
|
| 46 |
from shop2020.model.v1.order.impl.model.BaseOrder import BaseOrder
|
46 |
from shop2020.model.v1.order.impl.model.BaseOrder import BaseOrder
|
| 47 |
from shop2020.model.v1.order.impl.model.DTHRechargeOrder import DTHRechargeOrder
|
47 |
from shop2020.model.v1.order.impl.model.DTHRechargeOrder import DTHRechargeOrder
|
| 48 |
from shop2020.model.v1.order.impl.model.MobileRechargeOrder import \
|
48 |
from shop2020.model.v1.order.impl.model.MobileRechargeOrder import \
|
| 49 |
MobileRechargeOrder
|
49 |
MobileRechargeOrder
|
| 50 |
from shop2020.model.v1.order.impl.model.RechargeDenomination import \
|
50 |
from shop2020.model.v1.order.impl.model.RechargeDenomination import \
|
| Line 8425... |
Line 8425... |
| 8425 |
|
8425 |
|
| 8426 |
if scans is None:
|
8426 |
if scans is None:
|
| 8427 |
if warehouseDbConnection.open:
|
8427 |
if warehouseDbConnection.open:
|
| 8428 |
warehouseDbConnection.close()
|
8428 |
warehouseDbConnection.close()
|
| 8429 |
raise TransactionServiceException(110, "Item with Item Number:- " + itemNumbers[0]+" never scanned in the system")
|
8429 |
raise TransactionServiceException(110, "Item with Item Number:- " + itemNumbers[0]+" never scanned in the system")
|
| 8430 |
if warehouse.billingType == BillingType.OURS:
|
- |
|
| 8431 |
if not inventory_client.isAlive():
|
- |
|
| 8432 |
inventory_client = InventoryClient().get_client()
|
- |
|
| 8433 |
inventory_client.addInventory(item.id, warehouse.id, long(-1.0*lineitem.quantity))
|
- |
|
| 8434 |
|
8430 |
|
| 8435 |
currentQuantity = invItem[5]
|
8431 |
currentQuantity = invItem[5]
|
| 8436 |
scanQuantity = 0
|
8432 |
scanQuantity = 0
|
| 8437 |
if orderQuantity >0:
|
8433 |
if orderQuantity >0:
|
| 8438 |
if currentQuantity < orderQuantity:
|
8434 |
if currentQuantity < orderQuantity:
|
| Line 8574... |
Line 8570... |
| 8574 |
txnShipSeq = TransactionShipmentSequence.query.filter(TransactionShipmentSequence.transactionId==transactionId).filter(TransactionShipmentSequence.sequence==shipementSeq).order_by(desc(TransactionShipmentSequence.id)).first()
|
8570 |
txnShipSeq = TransactionShipmentSequence.query.filter(TransactionShipmentSequence.transactionId==transactionId).filter(TransactionShipmentSequence.sequence==shipementSeq).order_by(desc(TransactionShipmentSequence.id)).first()
|
| 8575 |
if txnShipSeq.invoiceFormat == 2:
|
8571 |
if txnShipSeq.invoiceFormat == 2:
|
| 8576 |
return 'Bulk'
|
8572 |
return 'Bulk'
|
| 8577 |
else:
|
8573 |
else:
|
| 8578 |
return 'Individual'
|
8574 |
return 'Individual'
|
| - |
|
8575 |
|
| - |
|
8576 |
def create_homeshop_order(hsOrder):
|
| - |
|
8577 |
hs_Order = HsOrder()
|
| - |
|
8578 |
hs_Order.orderId = hsOrder.orderId
|
| - |
|
8579 |
hs_Order.catalogueName = hsOrder.catalogueName
|
| - |
|
8580 |
hs_Order.courierName = hsOrder.courierName
|
| - |
|
8581 |
hs_Order.hsItemId = hsOrder.itemId
|
| - |
|
8582 |
hs_Order.hsOrderDate = to_py_date(hsOrder.hsOrderDate)
|
| - |
|
8583 |
hs_Order.hsOrderNo = hsOrder.hsOrderNo
|
| - |
|
8584 |
hs_Order.hsProductId = hsOrder.hsProductId
|
| - |
|
8585 |
hs_Order.hsSubOrderNo = hsOrder.hsSubOrderNo
|
| - |
|
8586 |
hs_Order.paymentMode = hsOrder.paymentMode
|
| - |
|
8587 |
hs_Order.sellerSku = hsOrder.sellerSku
|
| - |
|
8588 |
hs_Order.slaDays = hsOrder.slaDays
|
| - |
|
8589 |
order = Order.get_by(id=hsOrder.orderId)
|
| - |
|
8590 |
order.status = OrderStatus.ACCEPTED
|
| - |
|
8591 |
session.commit()
|
| - |
|
8592 |
|
| - |
|
8593 |
def get_homeshop_order(order_id, hsOrderNo, hsSubOrderNo):
|
| - |
|
8594 |
query = HsOrder.query
|
| - |
|
8595 |
if order_id:
|
| - |
|
8596 |
query = query.filter(HsOrder.orderId == order_id)
|
| - |
|
8597 |
elif hsOrderNo==hsSubOrderNo:
|
| - |
|
8598 |
if hsOrderNo is None:
|
| - |
|
8599 |
hsOrderNo=''
|
| - |
|
8600 |
query = query.filter(or_(HsOrder.hsOrderNo == hsOrderNo, HsOrder.hsSubOrderNo== hsSubOrderNo))
|
| - |
|
8601 |
else:
|
| - |
|
8602 |
query = query.filter(and_(HsOrder.hsOrderNo == hsOrderNo, HsOrder.hsSubOrderNo== hsSubOrderNo))
|
| - |
|
8603 |
return query.one()
|
| - |
|
8604 |
return query.all()
|
| - |
|
8605 |
|
| - |
|
8606 |
def homeshop_order_exists(hs_OrderNo, hs_SubOrderNo):
|
| - |
|
8607 |
exists = HsOrder.query.filter_by(hsOrderNo=hs_OrderNo,hsSubOrderNo=hs_SubOrderNo).first()
|
| - |
|
8608 |
if exists is not None:
|
| - |
|
8609 |
return True
|
| - |
|
8610 |
else:
|
| - |
|
8611 |
return False
|
| 8579 |
|
8612 |
|
| 8580 |
if __name__ == '__main__':
|
8613 |
if __name__ == '__main__':
|
| 8581 |
print get_orders_by_mobile_number("9650889334")
|
8614 |
print get_orders_by_mobile_number("9650889334")
|