Subversion Repositories SmartDukaan

Rev

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

Rev 6777 Rev 6805
Line 5... Line 5...
5
'''
5
'''
6
from shop2020.thriftpy.model.v1.catalog.ttypes import Item, Category, \
6
from shop2020.thriftpy.model.v1.catalog.ttypes import Item, Category, \
7
    SourceItemPricing, Source, ItemType, \
7
    SourceItemPricing, Source, ItemType, \
8
    ProductNotificationRequest as TProductNotificationRequest, \
8
    ProductNotificationRequest as TProductNotificationRequest, \
9
    ProductNotificationRequestCount as TProductNotificationRequestCount, \
9
    ProductNotificationRequestCount as TProductNotificationRequestCount, \
10
    VoucherItemMapping, EntityTag as TEntityTag
10
    VoucherItemMapping, EntityTag as TEntityTag, \
-
 
11
    Insurer as TInsurer
11
from shop2020.utils.Utils import to_java_date
12
from shop2020.utils.Utils import to_java_date
-
 
13
from shop2020.model.v1.catalog.impl.DataService import Insurer
12
 
14
 
13
def to_t_item(item):
15
def to_t_item(item):
14
    t_item = Item()
16
    t_item = Item()
15
    if item is None:
17
    if item is None:
16
        return t_item
18
        return t_item
Line 62... Line 64...
62
    t_item.preferredVendor = item.preferredVendor
64
    t_item.preferredVendor = item.preferredVendor
63
    t_item.type = ItemType._NAMES_TO_VALUES[item.type]
65
    t_item.type = ItemType._NAMES_TO_VALUES[item.type]
64
    t_item.hasItemNo = item.hasItemNo
66
    t_item.hasItemNo = item.hasItemNo
65
    t_item.clearance = item.clearance
67
    t_item.clearance = item.clearance
66
    t_item.showSellingPrice = item.showSellingPrice
68
    t_item.showSellingPrice = item.showSellingPrice
-
 
69
    t_item.preferredInsurer = item.preferredInsurer
67
    
70
    
68
    return t_item
71
    return t_item
69
 
72
 
-
 
73
def to_t_insurer(insurer):
-
 
74
    t_insurer = TInsurer()
-
 
75
    t_insurer.id = insurer.id
-
 
76
    t_insurer.name = insurer.name 
-
 
77
    t_insurer.address = insurer.address
-
 
78
    return t_insurer
-
 
79
 
70
def to_t_voucher_item_mapping(voucher):
80
def to_t_voucher_item_mapping(voucher):
71
    t_voucher = VoucherItemMapping()
81
    t_voucher = VoucherItemMapping()
72
    t_voucher.voucherType = voucher.voucherType
82
    t_voucher.voucherType = voucher.voucherType
73
    t_voucher.itemId = voucher.item.id
83
    t_voucher.itemId = voucher.item.id
74
    t_voucher.amount = voucher.amount
84
    t_voucher.amount = voucher.amount