Subversion Repositories SmartDukaan

Rev

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

Rev 6921 Rev 6962
Line 1248... Line 1248...
1248
    if oos is None:
1248
    if oos is None:
1249
        oos = OOSTracker()
1249
        oos = OOSTracker()
1250
        oos.itemId = item.id
1250
        oos.itemId = item.id
1251
        session.commit()
1251
        session.commit()
1252
        try:
1252
        try:
1253
            EmailAttachmentSender.mail(mail_user, mail_password, to_addresses + ["abhishek.mathur@shop2020.in"], "Item is out of stock. ID: " + str(item.id)  + " " + str(item.brand) +  " " + str(item.model_name) + " " + str(item.model_number)+ " " + str(item.color), None)
1253
            EmailAttachmentSender.mail(mail_user, mail_password, to_addresses + ["pramit.singh@shop2020.in"], "Item is out of stock. ID: " + str(item.id)  + " " + str(item.brand) +  " " + str(item.model_name) + " " + str(item.model_number)+ " " + str(item.color), None)
1254
        except Exception as e:
1254
        except Exception as e:
1255
            print e
1255
            print e
1256
 
1256
 
1257
def __send_mail_for_active_item(itemId, subject, message):
1257
def __send_mail_for_active_item(itemId, subject, message):
1258
    oos = OOSTracker.get_by(itemId = itemId)
1258
    oos = OOSTracker.get_by(itemId = itemId)
Line 1416... Line 1416...
1416
 
1416
 
1417
 
1417
 
1418
def get_all_insurers():
1418
def get_all_insurers():
1419
    print session.query(Insurer).all()
1419
    print session.query(Insurer).all()
1420
    return session.query(Insurer).all()
1420
    return session.query(Insurer).all()
1421
    
-
 
1422
1421
    
-
 
1422
def update_insurance_declared_amount(insurerId, amount):
-
 
1423
    insurer = Insurer.get_by(id = insurerId)
-
 
1424
    insurer.declaredAmount += amount
-
 
1425
    session.commit()
-
 
1426
    if insurer.declaredAmount > 0.9*insurer.creditedAmount:
-
 
1427
        __send_mail("CRITICAL: Declared Insurance Amount is critical (Declared Amount - " + str(insurer.declaredAmount) + " and Credited Amount - " + str(insurer.creditedAmount) +")", "Please top up credited amount")    
-
 
1428
    elif insurer.declaredAmount > 0.8*insurer.creditedAmount:
-
 
1429
        __send_mail("WARNING: Declared Insurance Amount is warning (Declared Amount - " + str(insurer.declaredAmount) + " and Credited Amount - " + str(insurer.creditedAmount) +")", "Please top up credited amount")    
-
 
1430
        
-
 
1431
        
-
 
1432
1423
1433