Subversion Repositories SmartDukaan

Rev

Rev 14072 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
4503 mandeep.dh 1
'''
2
Created on 29-Jul-2011
3
 
4
@author: Chandranshu
5
'''
6
from elixir.entity import Entity
7
from elixir.fields import Field
8
from sqlalchemy.types import Integer, String
9
from elixir.options import using_options, using_table_options
10
 
11
from shop2020.thriftpy.purchase.ttypes import Supplier as TSupplier
12
 
13
class Supplier(Entity):
14
    '''
15
    classdocs
16
    '''
17
    id = Field(Integer, primary_key=True, autoincrement=True)
18
    name = Field(String(30))
19
    phone = Field(String(12))
20
    fax = Field(String(12))
21
    tin = Field(String(10))
21844 amit.gupta 22
    gstin = Field(String(20))
4503 mandeep.dh 23
    pan = Field(String(10))
24
    headName = Field(String(30))
25
    headDesignation = Field(String(20))
26
    headEmail = Field(String(50))
27
    contactName = Field(String(30))
28
    contactPhone = Field(String(12))
29
    contactFax = Field(String(12))
30
    contactEmail = Field(String(50))
31
    registeredAddress = Field(String(100))
32
    communicationAddress = Field(String(100))
10295 amar.kumar 33
    stateId = Field(Integer)
14072 manish.sha 34
    poValidityLimit = Field(Integer)
4503 mandeep.dh 35
    using_options(shortnames=True)
36
    using_table_options(mysql_engine="InnoDB")
37
 
5591 mandeep.dh 38
    def __init__(self):
4503 mandeep.dh 39
        '''
40
        Constructor
41
        '''
42
        pass
43
 
44
    def to_thrift_object(self):
45
        t_supplier = TSupplier()
46
        t_supplier.id = self.id
47
        t_supplier.name = self.name
48
        t_supplier.phone = self.phone
49
        t_supplier.fax = self.fax
50
        t_supplier.tin = self.tin
51
        t_supplier.pan = self.pan
52
        t_supplier.headName = self.headName
53
        t_supplier.headDesignation = self.headDesignation
54
        t_supplier.headEmail = self.headEmail
55
        t_supplier.contactName = self.contactName
56
        t_supplier.contactPhone = self.contactPhone
57
        t_supplier.contactFax = self.contactFax
58
        t_supplier.contactEmail = self.contactEmail
59
        t_supplier.registeredAddress = self.registeredAddress
60
        t_supplier.communicationAddress = self.communicationAddress
10295 amar.kumar 61
        t_supplier.stateId = self.stateId
14072 manish.sha 62
        t_supplier.poValidityLimit = self.poValidityLimit
21844 amit.gupta 63
        t_supplier.gstin = self.gstin
4503 mandeep.dh 64
        return t_supplier