Subversion Repositories SmartDukaan

Rev

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

Rev 13225 Rev 13360
Line 7... Line 7...
7
from email import encoders
7
from email import encoders
8
from email.mime.base import MIMEBase
8
from email.mime.base import MIMEBase
9
from email.mime.multipart import MIMEMultipart
9
from email.mime.multipart import MIMEMultipart
10
from email.mime.text import MIMEText
10
from email.mime.text import MIMEText
11
from shop2020.clients.CatalogClient import CatalogClient
11
from shop2020.clients.CatalogClient import CatalogClient
-
 
12
from shop2020.clients.TransactionClient import TransactionClient
12
from shop2020.helpers.impl import DataService
13
from shop2020.helpers.impl import DataService
13
from shop2020.helpers.impl.DataService import Message, UserEmail, EntitiesShared, \
14
from shop2020.helpers.impl.DataService import Message, UserEmail, EntitiesShared, \
14
    Report, ReportRoleAuthority, CatalogDashboardUser, UserEmailArchive, QuickLink, \
15
    Report, ReportRoleAuthority, CatalogDashboardUser, UserEmailArchive, QuickLink, \
15
    AgentWarehouseMapping, UserSms, UserSmsInfo, UserSmsArchive, DealerAuth, Campaigns
16
    AgentWarehouseMapping, UserSms, UserSmsInfo, UserSmsArchive, DealerAuth, Campaigns
16
from shop2020.helpers.impl.model.Agent import Agent
17
from shop2020.helpers.impl.model.Agent import Agent
Line 258... Line 259...
258
    email = UserEmailArchive.get_by(emailType = 'DeliverySuccess', source = order_id)
259
    email = UserEmailArchive.get_by(emailType = 'DeliverySuccess', source = order_id)
259
    #Start:- Added by Manish Sharma for resolving Exception for getting order delivery and confirmation mail on 27-Jun-2013
260
    #Start:- Added by Manish Sharma for resolving Exception for getting order delivery and confirmation mail on 27-Jun-2013
260
    if email:
261
    if email:
261
        return email.body
262
        return email.body
262
    else:
263
    else:
-
 
264
        tclient = TransactionClient().get_client()
-
 
265
        order = tclient.getOrder(order_id)
-
 
266
        if order.logisticsTransactionId:
-
 
267
            email = UserEmailArchive.get_by(emailType = 'DeliverySuccess', source = order.logisticsTransactionId)
-
 
268
            if email:
-
 
269
                return email.body
-
 
270
            else:
263
        return ''
271
                return ''
264
    #End:- Added by Manish Sharma for resolving Exception for getting order delivery and confirmation mail on 27-Jun-2013
272
    #End:- Added by Manish Sharma for resolving Exception for getting order delivery and confirmation mail on 27-Jun-2013
265
 
273
 
266
def get_warehouseIds_for_agent(agent_emailId):
274
def get_warehouseIds_for_agent(agent_emailId):
267
    agent = Agent.get_by(emailId = agent_emailId)
275
    agent = Agent.get_by(emailId = agent_emailId)
268
    agent_warehouse_mappings = AgentWarehouseMapping.query.filter(AgentWarehouseMapping.agentId == agent.id).all()
276
    agent_warehouse_mappings = AgentWarehouseMapping.query.filter(AgentWarehouseMapping.agentId == agent.id).all()