Subversion Repositories SmartDukaan

Rev

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

Rev 7577 Rev 7597
Line 26... Line 26...
26
from shop2020.clients.PaymentClient import PaymentClient
26
from shop2020.clients.PaymentClient import PaymentClient
27
from shop2020.clients.PromotionClient import PromotionClient
27
from shop2020.clients.PromotionClient import PromotionClient
28
from shop2020.clients.UserClient import UserClient
28
from shop2020.clients.UserClient import UserClient
29
from shop2020.clients.WarehouseClient import WarehouseClient
29
from shop2020.clients.WarehouseClient import WarehouseClient
30
from shop2020.config.client.ConfigClient import ConfigClient
30
from shop2020.config.client.ConfigClient import ConfigClient
-
 
31
#Start:- Added By Manish Sharma for Creating a new Ticket: Category- RTO Refund on 21-Jun-2013
-
 
32
from shop2020.clients.CRMClient import CRMClient
-
 
33
#End:- Added By Manish Sharma for Creating a new Ticket: Category- RTO Refund on 21-Jun-2013
31
from shop2020.model.v1 import order
34
from shop2020.model.v1 import order
32
from shop2020.model.v1.order.impl import DataService, RechargeService
35
from shop2020.model.v1.order.impl import DataService, RechargeService
33
from shop2020.model.v1.order.impl.Convertors import to_t_emi_scheme, to_t_order
36
from shop2020.model.v1.order.impl.Convertors import to_t_emi_scheme, to_t_order
34
from shop2020.model.v1.order.impl.DataService import Transaction, LineItem, \
37
from shop2020.model.v1.order.impl.DataService import Transaction, LineItem, \
35
    Order, BatchNoGenerator, InvoiceIDGenerator, TransactionRequiringExtraProcessing, \
38
    Order, BatchNoGenerator, InvoiceIDGenerator, TransactionRequiringExtraProcessing, \
Line 65... Line 68...
65
    HotspotAction, TimeoutSummary, OrderStatusGroups, OrderType, RechargeOrderStatus, \
68
    HotspotAction, TimeoutSummary, OrderStatusGroups, OrderType, RechargeOrderStatus, \
66
    RechargeType, RechargeStatistics, DeviceNumberInfo, EmiChargeType, PayMethod, OrderSource,\
69
    RechargeType, RechargeStatistics, DeviceNumberInfo, EmiChargeType, PayMethod, OrderSource,\
67
    StorePaymentStatus
70
    StorePaymentStatus
68
from shop2020.thriftpy.model.v1.user.ttypes import VoucherType
71
from shop2020.thriftpy.model.v1.user.ttypes import VoucherType
69
from shop2020.thriftpy.payments.ttypes import PaymentException
72
from shop2020.thriftpy.payments.ttypes import PaymentException
-
 
73
#Start:- Added By Manish Sharma for Creating a new Ticket: Category- RTO Refund on 21-Jun-2013
-
 
74
from shop2020.thriftpy.crm.ttypes import *
-
 
75
#End:- Added By Manish Sharma for Creating a new Ticket: Category- RTO Refund on 21-Jun-2013
70
from shop2020.thriftpy.warehouse.ttypes import ScanType, \
76
from shop2020.thriftpy.warehouse.ttypes import ScanType, \
71
    WarehouseServiceException
77
    WarehouseServiceException
72
from shop2020.utils.EmailAttachmentSender import mail, get_attachment_part,\
78
from shop2020.utils.EmailAttachmentSender import mail, get_attachment_part,\
73
    mail_html
79
    mail_html
74
from shop2020.utils.Utils import to_py_date, to_java_date
80
from shop2020.utils.Utils import to_py_date, to_java_date
Line 2584... Line 2590...
2584
        if order.status in [OrderStatus.RTO_RECEIVED_PRESTINE, OrderStatus.RTO_RECEIVED_DAMAGED, OrderStatus.RTO_LOST_IN_TRANSIT] :
2590
        if order.status in [OrderStatus.RTO_RECEIVED_PRESTINE, OrderStatus.RTO_RECEIVED_DAMAGED, OrderStatus.RTO_LOST_IN_TRANSIT] :
2585
            if order.status != OrderStatus.RTO_LOST_IN_TRANSIT:
2591
            if order.status != OrderStatus.RTO_LOST_IN_TRANSIT:
2586
                __create_return_order(order)
2592
                __create_return_order(order)
2587
            __create_refund(order)
2593
            __create_refund(order)
2588
            order.statusDescription = "RTO Refunded"
2594
            order.statusDescription = "RTO Refunded"
-
 
2595
            #Start:- Added By Manish Sharma for Creating a new Ticket: Category- RTO Refund on 21-Jun-2013
-
 
2596
            try: 
-
 
2597
                crmServiceClient = CRMClient().get_client()
-
 
2598
                ticket =Ticket()
-
 
2599
                activity = Activity()
-
 
2600
                
-
 
2601
                description = "Creating Ticket for " + order.statusDescription + " Order"
-
 
2602
                ticket.creatorId = 1
-
 
2603
                ticket.assigneeId = 34
-
 
2604
                ticket.category = TicketCategory.RTO_REFUND
-
 
2605
                ticket.priority = TicketPriority.MEDIUM
-
 
2606
                ticket.status = TicketStatus.OPEN
-
 
2607
                ticket.description = description
-
 
2608
                ticket.orderId = order.id
-
 
2609
                
-
 
2610
                activity.creatorId = 1
-
 
2611
                activity.ticketAssigneeId = ticket.assigneeId
-
 
2612
                activity.type = ActivityType.OTHER
-
 
2613
                activity.description = description
-
 
2614
                activity.ticketCategory = ticket.category
-
 
2615
                activity.ticketDescription = ticket.description
-
 
2616
                activity.ticketPriority = ticket.priority
-
 
2617
                activity.ticketStatus = ticket.status
-
 
2618
                
-
 
2619
                ticket.customerId= order.customer_id
-
 
2620
                ticket.customerEmailId = order.customer_email
-
 
2621
                ticket.customerMobileNumber = order.customer_mobilenumber
-
 
2622
                ticket.customerName = order.customer_name
-
 
2623
                activity.customerId = ticket.customerId
-
 
2624
                activity.customerEmailId = order.customer_email
-
 
2625
                activity.customerMobileNumber = order.customer_mobilenumber
-
 
2626
                activity.customerName = order.customer_name
-
 
2627
                
-
 
2628
                crmServiceClient.insertTicket(ticket, activity)
-
 
2629
                
-
 
2630
            except:
-
 
2631
                print "Ticket for RTO Refund is not created."
-
 
2632
            #End:- Added By Manish Sharma for Creating a new Ticket: Category- RTO Refund on 21-Jun-2013
2589
        elif order.status in [OrderStatus.LOST_IN_TRANSIT]:
2633
        elif order.status in [OrderStatus.LOST_IN_TRANSIT]:
2590
            #__create_return_order(order)
2634
            #__create_return_order(order)
2591
            __create_refund(order)
2635
            __create_refund(order)
2592
            order.statusDescription = "Lost in Transit Refunded"
2636
            order.statusDescription = "Lost in Transit Refunded"
2593
        elif order.status in [OrderStatus.DOA_CERT_INVALID, OrderStatus.DOA_CERT_VALID, OrderStatus.DOA_RECEIVED_DAMAGED, OrderStatus.DOA_LOST_IN_TRANSIT] :
2637
        elif order.status in [OrderStatus.DOA_CERT_INVALID, OrderStatus.DOA_CERT_VALID, OrderStatus.DOA_RECEIVED_DAMAGED, OrderStatus.DOA_LOST_IN_TRANSIT] :