Subversion Repositories SmartDukaan

Rev

Rev 10485 | Rev 10687 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 10485 Rev 10544
Line 14... Line 14...
14
    ItemInventoryHistory, CurrentInventorySnapshot, VendorItemPricing, \
14
    ItemInventoryHistory, CurrentInventorySnapshot, VendorItemPricing, \
15
    VendorItemMapping, Vendor, MissedInventoryUpdate, BadInventorySnapshot, \
15
    VendorItemMapping, Vendor, MissedInventoryUpdate, BadInventorySnapshot, \
16
    VendorHolidays, ItemAvailabilityCache, \
16
    VendorHolidays, ItemAvailabilityCache, \
17
    CurrentReservationSnapshot, IgnoredInventoryUpdateItems, ItemStockPurchaseParams, \
17
    CurrentReservationSnapshot, IgnoredInventoryUpdateItems, ItemStockPurchaseParams, \
18
    OOSStatus, AmazonInventorySnapshot, StateMaster, HoldInventoryDetail, AmazonFbaInventorySnapshot, \
18
    OOSStatus, AmazonInventorySnapshot, StateMaster, HoldInventoryDetail, AmazonFbaInventorySnapshot, \
19
    SnapdealInventorySnapshot, FlipkartInventorySnapshot
19
    SnapdealInventorySnapshot, FlipkartInventorySnapshot, SnapdealStockAtEOD, FlipkartStockAtEOD
20
from shop2020.thriftpy.model.v1.inventory.ttypes import \
20
from shop2020.thriftpy.model.v1.inventory.ttypes import \
21
    InventoryServiceException, HolidayType, InventoryType, WarehouseType
21
    InventoryServiceException, HolidayType, InventoryType, WarehouseType
22
from shop2020.thriftpy.model.v1.order.ttypes import AlertType
22
from shop2020.thriftpy.model.v1.order.ttypes import AlertType
23
from shop2020.thriftpy.purchase.ttypes import PurchaseServiceException
23
from shop2020.thriftpy.purchase.ttypes import PurchaseServiceException
24
from shop2020.utils import EmailAttachmentSender
24
from shop2020.utils import EmailAttachmentSender
Line 1393... Line 1393...
1393
def get_state_master():
1393
def get_state_master():
1394
    stateIdNameMap = {} 
1394
    stateIdNameMap = {} 
1395
    statemaster = StateMaster.query.all()
1395
    statemaster = StateMaster.query.all()
1396
    for state in statemaster:
1396
    for state in statemaster:
1397
        stateIdNameMap[state.id] = state.name
1397
        stateIdNameMap[state.id] = state.name
1398
    return stateIdNameMap    
-
 
1399
1398
    return stateIdNameMap    
-
 
1399
 
-
 
1400
def update_snapdeal_stock_at_eod(allsnapdealstock):
-
 
1401
    for stockitem in allsnapdealstock:
-
 
1402
        snapdealstockateod = SnapdealStockAtEOD()
-
 
1403
        snapdealstockateod.item_id = stockitem.item_id
-
 
1404
        snapdealstockateod.availability = stockitem.availability
-
 
1405
        snapdealstockateod.date =  to_py_date(stockitem.date)
-
 
1406
    session.commit()
-
 
1407
        
-
 
1408
def update_flipkart_stock_at_eod(allflipkartstock):
-
 
1409
    for stockitem in allflipkartstock:
-
 
1410
        snapdealstockateod = FlipkartStockAtEOD()
-
 
1411
        snapdealstockateod.item_id = stockitem.item_id
-
 
1412
        snapdealstockateod.availability = stockitem.availability
-
 
1413
        snapdealstockateod.date =  to_py_date(stockitem.date)
-
 
1414
    session.commit()
-
 
1415
            
-
 
1416
1400
1417