Subversion Repositories SmartDukaan

Rev

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

Rev 5508 Rev 5514
Line 235... Line 235...
235
                order.airwaybill_no = 'Self Pickup'
235
                order.airwaybill_no = 'Self Pickup'
236
                order.tracking_id = order.airwaybill_no
236
                order.tracking_id = order.airwaybill_no
237
            
237
            
238
            voucherAmount = catalog_client.getVoucherAmount(item_id, VoucherType.SPICEDECK_MOBILE)
238
            voucherAmount = catalog_client.getVoucherAmount(item_id, VoucherType.SPICEDECK_MOBILE)
239
            if voucherAmount:
239
            if voucherAmount:
240
                __create_recharge_voucher_tracker()
240
                __create_recharge_voucher_tracker(order, voucherAmount, VoucherType.SPICEDECK_MOBILE)
241
                                
241
                                
242
    elif new_status == TransactionStatus.COD_IN_PROCESS:
242
    elif new_status == TransactionStatus.COD_IN_PROCESS:
243
        for order in transaction.orders:
243
        for order in transaction.orders:
244
            order.status = OrderStatus.COD_VERIFICATION_PENDING
244
            order.status = OrderStatus.COD_VERIFICATION_PENDING
245
            order.statusDescription = "Verification Pending"
245
            order.statusDescription = "Verification Pending"
Line 273... Line 273...
273
            except:
273
            except:
274
                print "Not able to get transfer price. Skipping"
274
                print "Not able to get transfer price. Skipping"
275
            
275
            
276
            voucherAmount = catalog_client.getVoucherAmount(item_id, VoucherType.SPICEDECK_MOBILE)
276
            voucherAmount = catalog_client.getVoucherAmount(item_id, VoucherType.SPICEDECK_MOBILE)
277
            if voucherAmount:
277
            if voucherAmount:
278
                __create_recharge_voucher_tracker()
278
                __create_recharge_voucher_tracker(order, voucherAmount, VoucherType.SPICEDECK_MOBILE)
279
    session.commit()
279
    session.commit()
280
 
280
 
281
    try:
281
    try:
282
        if new_status == TransactionStatus.COD_IN_PROCESS:
282
        if new_status == TransactionStatus.COD_IN_PROCESS:
283
            transaction_requiring_extra_processing = TransactionRequiringExtraProcessing()
283
            transaction_requiring_extra_processing = TransactionRequiringExtraProcessing()
Line 292... Line 292...
292
    except Exception as e:
292
    except Exception as e:
293
        print "Error inserting transaction Id: " + str(transaction_id) + " due to " + str(e)
293
        print "Error inserting transaction Id: " + str(transaction_id) + " due to " + str(e)
294
 
294
 
295
    return True
295
    return True
296
 
296
 
297
def __create_recharge_voucher_tracker(amount):
297
def __create_recharge_voucher_tracker(order, amount, voucherType):
298
    rvt = RechargeVoucherTracker()
298
    rvt = RechargeVoucherTracker()
299
    rvt.order = order
299
    rvt.order = order
300
    rvt.amount = amount
300
    rvt.amount = amount
301
    rvt.voucherIssued = False
301
    rvt.voucherIssued = False
302
    rvt.voucherType = VoucherType.SPICEDECK_MOBILE
302
    rvt.voucherType = voucherType
303
            
303
            
304
def __get_holidays(start_time=0L, to_time=-1L):
304
def __get_holidays(start_time=0L, to_time=-1L):
305
    '''
305
    '''
306
    Get the list of all public holidays since start time including the
306
    Get the list of all public holidays since start time including the
307
    day of start time if it's a holiday
307
    day of start time if it's a holiday