Subversion Repositories SmartDukaan

Rev

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

Rev 14974 Rev 19413
Line 1... Line 1...
1
'''
1
'''
2
Created on 23-Mar-2010
2
Created on 23-Mar-2010
3
 
3
 
4
@author: ashish
4
@author: ashish
5
'''
5
'''
6
from shop2020.thriftpy.model.v1.inventory.ttypes import ItemInventory, \
6
from shop2020.thriftpy.model.v1.inventory.ttypes import ItemInventory, Warehouse, \
7
    Warehouse, VendorItemPricing, Vendor, VendorItemMapping, StateInfo,\
7
    VendorItemPricing, Vendor, VendorItemMapping, StateInfo, InventoryType, \
8
    InventoryType, WarehouseType, IgnoredInventoryUpdateItems as TIgnoredinventoryupdateitems ,\
8
    WarehouseType, IgnoredInventoryUpdateItems as TIgnoredinventoryupdateitems, \
-
 
9
    ItemStockPurchaseParams, OOSStatus, \
9
    ItemStockPurchaseParams, OOSStatus, AmazonInventorySnapshot as TAmazonInventorySnapshot,\
10
    AmazonInventorySnapshot as TAmazonInventorySnapshot, \
10
    WarehouseLocation,AmazonFbaInventorySnapshot as TAmazonFbaInventorySnapshot,\
11
    AmazonFbaInventorySnapshot as TAmazonFbaInventorySnapshot, \
11
    SnapdealInventoryItem as TSnapdealInventoryItem, HoldInventoryDetail as THoldInventoryDetail, \
12
    SnapdealInventoryItem as TSnapdealInventoryItem, \
-
 
13
    HoldInventoryDetail as THoldInventoryDetail, \
-
 
14
    ItemLocationAvailability as TItemLocationAvailability, \
12
    FlipkartInventorySnapshot as TFlipkartInventorySnapshot, StockWeightedNlcInfo as TStockWeightedNlcInfo
15
    FlipkartInventorySnapshot as TFlipkartInventorySnapshot, \
-
 
16
    StockWeightedNlcInfo as TStockWeightedNlcInfo
13
from shop2020.utils.Utils import to_java_date
17
from shop2020.utils.Utils import to_java_date
14
 
18
 
15
def to_t_item_inventory(item_inventory_list, item_id):
19
def to_t_item_inventory(item_inventory_list, item_id):
16
    t_item_inventory = ItemInventory()
20
    t_item_inventory = ItemInventory()
17
    t_item_inventory.id = item_id
21
    t_item_inventory.id = item_id
Line 164... Line 168...
164
    t_stock_weighted_nlc_info.stockQuantity = stockWeightedNlcInfo.stockQuantity
168
    t_stock_weighted_nlc_info.stockQuantity = stockWeightedNlcInfo.stockQuantity
165
    t_stock_weighted_nlc_info.grnDetail = stockWeightedNlcInfo.grnDetail
169
    t_stock_weighted_nlc_info.grnDetail = stockWeightedNlcInfo.grnDetail
166
    t_stock_weighted_nlc_info.avgWeightedNlc = stockWeightedNlcInfo.avgWeightedNlc
170
    t_stock_weighted_nlc_info.avgWeightedNlc = stockWeightedNlcInfo.avgWeightedNlc
167
    return t_stock_weighted_nlc_info
171
    return t_stock_weighted_nlc_info
168
 
172
 
-
 
173
def to_t_item_location_availability(itemLocationAvailabilityCache):
-
 
174
    t_item_location_availability = TItemLocationAvailability()
-
 
175
    t_item_location_availability.itemId = itemLocationAvailabilityCache.item_id
-
 
176
    t_item_location_availability.locationId = itemLocationAvailabilityCache.location_id
-
 
177
    t_item_location_availability.physicalQty = itemLocationAvailabilityCache.physical_availability
-
 
178
    t_item_location_availability.virtualQty = itemLocationAvailabilityCache.virtual_availability
-
 
179
    t_item_location_availability.minTransferDelay = itemLocationAvailabilityCache.min_transfer_delay
-
 
180
    t_item_location_availability.virtualQty = itemLocationAvailabilityCache.max_transfer_delay
-
 
181
    return t_item_location_availability
-
 
182