| Line 43... |
Line 43... |
| 43 |
CodVerificationAgent, Attribute, RechargeVoucherTracker, EmiScheme, MiscCharges, \
|
43 |
CodVerificationAgent, Attribute, RechargeVoucherTracker, EmiScheme, MiscCharges, \
|
| 44 |
BlockedIpRange, DeniedIpAddress, InsuranceDetailForOrder, DocumentStore, \
|
44 |
BlockedIpRange, DeniedIpAddress, InsuranceDetailForOrder, DocumentStore, \
|
| 45 |
RechargeTransaction, HotspotStore, WalletForCompany, WalletHistoryForCompany, \
|
45 |
RechargeTransaction, HotspotStore, WalletForCompany, WalletHistoryForCompany, \
|
| 46 |
FRC, OperatorSeries, SourceDetail, Company, EbayOrder,AmazonFbaSalesSnapshot, \
|
46 |
FRC, OperatorSeries, SourceDetail, Company, EbayOrder,AmazonFbaSalesSnapshot, \
|
| 47 |
AmazonOrder, StoreOrderDetail, EdcBank, StoreOrderCollection, HotspotServiceMatrix,\
|
47 |
AmazonOrder, StoreOrderDetail, EdcBank, StoreOrderCollection, HotspotServiceMatrix,\
|
| 48 |
SnapdealOrder,FlipkartOrder
|
48 |
SnapdealOrder,FlipkartOrder ,DataInsuranceDetailForOrder
|
| 49 |
from shop2020.model.v1.order.impl.model.BaseOrder import BaseOrder
|
49 |
from shop2020.model.v1.order.impl.model.BaseOrder import BaseOrder
|
| 50 |
from shop2020.model.v1.order.impl.model.DTHRechargeOrder import DTHRechargeOrder
|
50 |
from shop2020.model.v1.order.impl.model.DTHRechargeOrder import DTHRechargeOrder
|
| 51 |
from shop2020.model.v1.order.impl.model.MobileRechargeOrder import \
|
51 |
from shop2020.model.v1.order.impl.model.MobileRechargeOrder import \
|
| 52 |
MobileRechargeOrder
|
52 |
MobileRechargeOrder
|
| 53 |
from shop2020.model.v1.order.impl.model.RechargeDenomination import \
|
53 |
from shop2020.model.v1.order.impl.model.RechargeDenomination import \
|
| Line 1841... |
Line 1841... |
| 1841 |
update_insurance_details(order)
|
1841 |
update_insurance_details(order)
|
| 1842 |
except:
|
1842 |
except:
|
| 1843 |
print "Error generating insurance file for order " + str(order.id)
|
1843 |
print "Error generating insurance file for order " + str(order.id)
|
| 1844 |
session.rollback()
|
1844 |
session.rollback()
|
| 1845 |
return
|
1845 |
return
|
| - |
|
1846 |
|
| - |
|
1847 |
if order.dataInsuranceDetails:
|
| - |
|
1848 |
order.dataInsuranceDetails[0].startDate = order.delivery_timestamp
|
| - |
|
1849 |
order.dataInsuranceDetails[0].expiryDate = order.delivery_timestamp + timedelta(days = 90)
|
| 1846 |
|
1850 |
|
| 1847 |
if enqueue_delivery_success_mail(order) :
|
1851 |
if enqueue_delivery_success_mail(order) :
|
| 1848 |
session.commit()
|
1852 |
session.commit()
|
| 1849 |
else :
|
1853 |
else :
|
| 1850 |
session.rollback()
|
1854 |
session.rollback()
|
| Line 1889... |
Line 1893... |
| 1889 |
update_insurance_details(order)
|
1893 |
update_insurance_details(order)
|
| 1890 |
except:
|
1894 |
except:
|
| 1891 |
print "Error generating insurance file for order " + str(order.id)
|
1895 |
print "Error generating insurance file for order " + str(order.id)
|
| 1892 |
session.rollback()
|
1896 |
session.rollback()
|
| 1893 |
return
|
1897 |
return
|
| - |
|
1898 |
if order.dataInsuranceDetails:
|
| - |
|
1899 |
order.dataInsuranceDetails[0].startDate = order.delivery_timestamp
|
| - |
|
1900 |
order.dataInsuranceDetails[0].expiryDate = order.delivery_timestamp + timedelta(days = 90)
|
| 1894 |
|
1901 |
|
| 1895 |
if order.source == 2:
|
1902 |
if order.source == 2:
|
| 1896 |
sod = StoreOrderDetail.get_by(orderId = order.id)
|
1903 |
sod = StoreOrderDetail.get_by(orderId = order.id)
|
| 1897 |
sod.payStatus = StorePaymentStatus.FULL_PAY_RECEIVED
|
1904 |
sod.payStatus = StorePaymentStatus.FULL_PAY_RECEIVED
|
| 1898 |
session.commit()
|
1905 |
session.commit()
|
| 1899 |
|
1906 |
|
| Line 2973... |
Line 2980... |
| 2973 |
newDetail.order = new_order
|
2980 |
newDetail.order = new_order
|
| 2974 |
|
2981 |
|
| 2975 |
if order.dataProtectionInsurer > 0:
|
2982 |
if order.dataProtectionInsurer > 0:
|
| 2976 |
new_order.dataProtectionInsurer = order.dataProtectionInsurer
|
2983 |
new_order.dataProtectionInsurer = order.dataProtectionInsurer
|
| 2977 |
new_order.dataProtectionAmount = order.dataProtectionAmount
|
2984 |
new_order.dataProtectionAmount = order.dataProtectionAmount
|
| - |
|
2985 |
dataInsuranceDetail = DataInsuranceDetailForOrder()
|
| - |
|
2986 |
dataInsuranceDetail.order = new_order
|
| 2978 |
|
2987 |
|
| 2979 |
logistics_client = LogisticsClient().get_client()
|
2988 |
logistics_client = LogisticsClient().get_client()
|
| 2980 |
item_id = new_order.lineitems[0].item_id
|
2989 |
item_id = new_order.lineitems[0].item_id
|
| 2981 |
logistics_info = logistics_client.getLogisticsInfo(new_order.customer_pincode, item_id, is_cod, PickUpType.COURIER) #TODO: We should be able to pass another flag to suggest ignoring the inventory situation.
|
2990 |
logistics_info = logistics_client.getLogisticsInfo(new_order.customer_pincode, item_id, is_cod, PickUpType.COURIER) #TODO: We should be able to pass another flag to suggest ignoring the inventory situation.
|
| 2982 |
logistics_info.shippingTime = adjust_delivery_time(current_time, logistics_info.shippingTime)
|
2991 |
logistics_info.shippingTime = adjust_delivery_time(current_time, logistics_info.shippingTime)
|