Subversion Repositories SmartDukaan

Rev

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

Rev 1308 Rev 1341
Line 2... Line 2...
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,\
6
from shop2020.thriftpy.model.v1.catalog.ttypes import  Item,\
7
    ItemInventory, Warehouse
7
    ItemInventory, Warehouse, VendorItemPricing, Vendor
8
import time
8
import time
9
from shop2020.utils.Utils import to_java_date
9
from shop2020.utils.Utils import to_java_date
10
 
10
 
11
def to_t_item(item):
11
def to_t_item(item):
12
    t_item = Item()
12
    t_item = Item()
Line 81... Line 81...
81
    if warehouse.addedOn:
81
    if warehouse.addedOn:
82
        t_warehouse.addedOn = to_java_date(warehouse.addedOn)
82
        t_warehouse.addedOn = to_java_date(warehouse.addedOn)
83
    if warehouse.lastCheckedOn:
83
    if warehouse.lastCheckedOn:
84
        t_warehouse.lastCheckedOn = to_java_date(warehouse.lastCheckedOn)
84
        t_warehouse.lastCheckedOn = to_java_date(warehouse.lastCheckedOn)
85
    return t_warehouse
85
    return t_warehouse
-
 
86
 
-
 
87
def to_t_vendor(vendor):
-
 
88
    t_vendor = Vendor()
-
 
89
    t_vendor.id = vendor.id
-
 
90
    t_vendor.name = vendor.name
-
 
91
 
-
 
92
def to_t_vendor_item_pricing(vendor_item_pricing):
-
 
93
    t_vendor_item_pricing = VendorItemPricing()
-
 
94
    t_vendor_item_pricing.vendor = to_t_vendor(vendor_item_pricing.vendor)
-
 
95
    t_vendor_item_pricing.item = to_t_item(vendor_item_pricing.item)
-
 
96
    t_vendor_item_pricing.transferPrice = vendor_item_pricing.transfer_price
-
 
97
    t_vendor_item_pricing.dealerPrice = vendor_item_pricing.dealerPrice
-
 
98
    t_vendor_item_pricing.mop = vendor_item_pricing.mop
86
99