| Line 2380... |
Line 2380... |
| 2380 |
item.lastUpdatedOnMarketplace = to_py_date(timestamp)
|
2380 |
item.lastUpdatedOnMarketplace = to_py_date(timestamp)
|
| 2381 |
mp_item = get_marketplace_details_for_item(sku,source_id)
|
2381 |
mp_item = get_marketplace_details_for_item(sku,source_id)
|
| 2382 |
if mp_item is not None:
|
2382 |
if mp_item is not None:
|
| 2383 |
mp_item.lastCheckedTimestamp = to_py_date(timestamp)
|
2383 |
mp_item.lastCheckedTimestamp = to_py_date(timestamp)
|
| 2384 |
session.commit()
|
2384 |
session.commit()
|
| 2385 |
|
- |
|
| 2386 |
def update_item_hold_inventory(itemHoldMap):
|
- |
|
| 2387 |
items = get_all_alive_items()
|
- |
|
| 2388 |
for item in items:
|
- |
|
| 2389 |
if item.holdOverride:
|
- |
|
| 2390 |
continue
|
- |
|
| 2391 |
if itemHoldMap.__contains__(item.id):
|
- |
|
| 2392 |
item.holdInventory = itemHoldMap[item.id]
|
- |
|
| 2393 |
else:
|
- |
|
| 2394 |
item.holdInventory = 1
|
- |
|
| 2395 |
session.commit()
|
- |
|
| 2396 |
|
- |
|
| 2397 |
|
2385 |
|
| - |
|
2386 |
def update_nlc_at_marketplaces(itemid,vendor_id,nlc):
|
| - |
|
2387 |
try:
|
| - |
|
2388 |
item = SnapdealItem.get_by(item_id=itemid)
|
| - |
|
2389 |
if item is not None:
|
| - |
|
2390 |
marketplaceitem = MarketplaceItems.get_by(itemId=itemid,source=7)
|
| - |
|
2391 |
ic = InventoryClient().get_client()
|
| - |
|
2392 |
warehouse = ic.getWarehouse(item.warehouseId)
|
| - |
|
2393 |
if(warehouse.vendor.id==vendor_id):
|
| - |
|
2394 |
print 'Inside maxnlc change'
|
| - |
|
2395 |
item.maxNlc = nlc
|
| - |
|
2396 |
vat = (item.sellingPrice/(1+(marketplaceitem.vat/100))-(nlc/(1+(marketplaceitem.vat/100))))*(marketplaceitem.vat/100)
|
| - |
|
2397 |
inHouseCost = 15 + vat + (marketplaceitem.returnProvision/100)*item.sellingPrice + marketplaceitem.otherCost
|
| - |
|
2398 |
marketplaceitem.minimumPossibleTp = nlc + inHouseCost
|
| - |
|
2399 |
marketplaceitem.minimumPossibleSp = (nlc+(item.courierCost+marketplaceitem.closingFee)*(1+(marketplaceitem.serviceTax/100))*(1+(marketplaceitem.vat/100))+(15+marketplaceitem.otherCost)*(1+(marketplaceitem.vat)/100))/(1-(marketplaceitem.commission/100+marketplaceitem.emiFee/100)*(1+(marketplaceitem.serviceTax/100))*(1+(marketplaceitem.vat)/100)-(marketplaceitem.returnProvision/100)*(1+(marketplaceitem.vat)/100))
|
| - |
|
2400 |
session.commit()
|
| - |
|
2401 |
finally:
|
| - |
|
2402 |
close_session()
|
| - |
|
2403 |
|
| 2398 |
|
2404 |
|