Subversion Repositories SmartDukaan

Rev

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

Rev 4255 Rev 4572
Line 71... Line 71...
71
                     "This is a system generated email.Please don't reply to it.",\
71
                     "This is a system generated email.Please don't reply to it.",\
72
                     pickup_mismatch_part)
72
                     pickup_mismatch_part)
73
        except Exception:
73
        except Exception:
74
            print "Some issue sending the DOA mismatch report"
74
            print "Some issue sending the DOA mismatch report"
75
            traceback.print_exc()
75
            traceback.print_exc()
-
 
76
    except:
-
 
77
        print "Some issue while processing the Pickup Report"
-
 
78
        traceback.print_exc()
76
    finally:
79
    finally:
77
        os.remove(filename)
80
        os.remove(filename)
78
 
81
 
79
def process_delivery_report(provider):
82
def process_delivery_report(provider):
80
    try:
83
    try:
Line 95... Line 98...
95
                     returned_orders_report)
98
                     returned_orders_report)
96
            except:
99
            except:
97
                print "Some issue sending the returned orders report"
100
                print "Some issue sending the returned orders report"
98
                traceback.print_exc()
101
                traceback.print_exc()
99
    except:
102
    except:
100
        print "Some issue while processing the returned orders"
103
        print "Some issue while processing the Delivery & RTO Report"
101
        traceback.print_exc()
104
        traceback.print_exc()
102
    finally:
105
    finally:
103
        os.remove(filename)
106
        os.remove(filename)
104
 
107
 
105
def process_non_delivery_report(provider):
108
def process_non_delivery_report(provider):
106
    try:
109
    try:
107
        filename = fetch_report(provider.name.upper() + ' UNDELIVERED REPORT')
110
        filename = fetch_report(provider.name.upper() + ' UNDELIVERED REPORT')
108
        undelivered_orders = read_undelivered_report(filename)
111
        undelivered_orders = read_undelivered_report(filename)
109
        update_reason_of_undelivered_orders(provider.id, undelivered_orders)
112
        update_reason_of_undelivered_orders(provider.id, undelivered_orders)
-
 
113
    except:
-
 
114
        print "Some issue while processing the Non-delivery Report"
-
 
115
        traceback.print_exc()
110
    finally:
116
    finally:
111
        os.remove(filename)
117
        os.remove(filename)
112
 
118
 
113
def update_reason_of_undelivered_orders(provider_id, undelivered_orders):
119
def update_reason_of_undelivered_orders(provider_id, undelivered_orders):
114
    txnClient = TransactionClient().get_client()
120
    txnClient = TransactionClient().get_client()