Subversion Repositories SmartDukaan

Rev

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

Rev 4762 Rev 5110
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.catalog.ttypes import  Item, ItemInventory, Warehouse, VendorItemPricing, Vendor, Category,\
6
from shop2020.thriftpy.model.v1.catalog.ttypes import Item, ItemInventory, \
-
 
7
    Warehouse, VendorItemPricing, Vendor, Category, VendorItemMapping, \
-
 
8
    SourceItemPricing, Source, ItemType, \
7
    VendorItemMapping, SourceItemPricing, Source, ProductNotificationRequest as TProductNotificationRequest,\
9
    ProductNotificationRequest as TProductNotificationRequest, \
8
    ProductNotificationRequestCount as TProductNotificationRequestCount
10
    ProductNotificationRequestCount as TProductNotificationRequestCount, \
9
import time
11
    InventoryType, WarehouseType
10
from shop2020.utils.Utils import to_java_date
12
from shop2020.utils.Utils import to_java_date
-
 
13
import time
11
 
14
 
12
def to_t_item(item):
15
def to_t_item(item):
13
    t_item = Item()
16
    t_item = Item()
14
    if item is None:
17
    if item is None:
15
        return t_item
18
        return t_item
Line 56... Line 59...
56
    if item.defaultWarehouse:
59
    if item.defaultWarehouse:
57
        t_item.defaultWarehouse = int(item.defaultWarehouse)
60
        t_item.defaultWarehouse = int(item.defaultWarehouse)
58
    t_item.isWarehousePreferenceSticky = item.isWarehousePreferenceSticky
61
    t_item.isWarehousePreferenceSticky = item.isWarehousePreferenceSticky
59
    t_item.warrantyPeriod = item.warranty_period
62
    t_item.warrantyPeriod = item.warranty_period
60
    t_item.preferredVendor = item.preferredVendor
63
    t_item.preferredVendor = item.preferredVendor
-
 
64
    t_item.type = ItemType._NAMES_TO_VALUES[item.type]
61
    
65
    
62
    return t_item
66
    return t_item
63
 
67
 
64
def to_t_other_info(item):
68
def to_t_other_info(item):
65
    t_other_info = {}
69
    t_other_info = {}
Line 82... Line 86...
82
def to_t_warehouse(warehouse):
86
def to_t_warehouse(warehouse):
83
    t_warehouse = Warehouse()
87
    t_warehouse = Warehouse()
84
    t_warehouse.id = warehouse.id
88
    t_warehouse.id = warehouse.id
85
    t_warehouse.displayName = warehouse.displayName
89
    t_warehouse.displayName = warehouse.displayName
86
    t_warehouse.location = warehouse.location
90
    t_warehouse.location = warehouse.location
87
    t_warehouse.warehouseStatus = warehouse.status
-
 
88
    t_warehouse.tinNumber = warehouse.tinNumber
91
    t_warehouse.tinNumber = warehouse.tinNumber
89
    t_warehouse.pincode = warehouse.pincode
92
    t_warehouse.pincode = warehouse.pincode
90
    t_warehouse.billingType = warehouse.billingType
93
    t_warehouse.billingType = warehouse.billingType
-
 
94
    t_warehouse.vendor = to_t_vendor(warehouse.vendor)
-
 
95
    t_warehouse.billingWarehouseId = warehouse.billingWarehouseId
-
 
96
    t_warehouse.shippingWarehouseId = warehouse.shippingWarehouseId
-
 
97
    t_warehouse.isAvailabilityMonitored = warehouse.isAvailabilityMonitored
-
 
98
    t_warehouse.transferDelayInHours = warehouse.transferDelayInHours
-
 
99
    t_warehouse.inventoryType = InventoryType._NAMES_TO_VALUES[warehouse.inventoryType]
-
 
100
    t_warehouse.warehouseType = WarehouseType._NAMES_TO_VALUES[warehouse.warehouseType]
91
    if warehouse.vendorString:
101
    if warehouse.vendorString:
92
        t_warehouse.vendorString = warehouse.vendorString
102
        t_warehouse.vendorString = warehouse.vendorString
93
    if warehouse.addedOn:
103
    if warehouse.addedOn:
94
        t_warehouse.addedOn = to_java_date(warehouse.addedOn)
104
        t_warehouse.addedOn = to_java_date(warehouse.addedOn)
95
    if warehouse.lastCheckedOn:
105
    if warehouse.lastCheckedOn: