Subversion Repositories SmartDukaan

Rev

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

Rev 5185 Rev 5213
Line 428... Line 428...
428
    itemName = " ".join([str(item.id), str(item.brand), str(item.model_name), str(item.model_number), str(item.color)])
428
    itemName = " ".join([str(item.id), str(item.brand), str(item.model_name), str(item.model_number), str(item.color)])
429
    EmailAttachmentSender.mail('cnc.center@shop2020.in', '5h0p2o2o', 'mandeep.dhir@shop2020.in', 'Negative reserved: ' + str(reserved) + ' for Item Id: ' + itemName + ' warehouse id: ' + str(warehouse.id), None)
429
    EmailAttachmentSender.mail('cnc.center@shop2020.in', '5h0p2o2o', 'mandeep.dhir@shop2020.in', 'Negative reserved: ' + str(reserved) + ' for Item Id: ' + itemName + ' warehouse id: ' + str(warehouse.id), None)
430
 
430
 
431
def __send_alert_for_negative_availability(item, availability, warehouse):
431
def __send_alert_for_negative_availability(item, availability, warehouse):
432
    itemName = " ".join([str(item.id), str(item.brand), str(item.model_name), str(item.model_number), str(item.color)])
432
    itemName = " ".join([str(item.id), str(item.brand), str(item.model_name), str(item.model_number), str(item.color)])
433
    EmailAttachmentSender.mail('cnc.center@shop2020.in', '5h0p2o2o', 'mandeep.dhir@shop2020.in', 'Negative availability ' + str(availability) + ' for Item id: ' + itemName + ' warehouse id: ' + str(warehouse.id), None)
433
    # EmailAttachmentSender.mail('cnc.center@shop2020.in', '5h0p2o2o', 'mandeep.dhir@shop2020.in', 'Negative availability ' + str(availability) + ' for Item id: ' + itemName + ' warehouse id: ' + str(warehouse.id), None)
434
 
-
 
435
    # Let availability be auto-fixed from PLB for Hotspot warehouses
-
 
436
    if warehouse.id in [1, 2, 5]:
-
 
437
        for mapping in get_item_mappings(item.id):
-
 
438
            if mapping.vendor_id == 1:
-
 
439
                item_key = mapping.item_key
-
 
440
                break
-
 
441
 
-
 
442
        missedInventoryUpdate = MissedInventoryUpdate()
-
 
443
        missedInventoryUpdate.itemKey = item_key
-
 
444
        missedInventoryUpdate.quantity = 0
-
 
445
        missedInventoryUpdate.isIgnored = 0
-
 
446
        missedInventoryUpdate.timestamp = datetime.datetime.now()
-
 
447
        missedInventoryUpdate.warehouseId = warehouse.id
-
 
448
        session.commit()
-
 
449
 
434
 
450
def __send_mail_for_missing_key(item_key, quantity, warehouse_id):
435
def __send_mail_for_missing_key(item_key, quantity, warehouse_id):
451
    missedInventoryUpdate = MissedInventoryUpdate.get_by(itemKey = item_key, warehouseId = warehouse_id)
436
    missedInventoryUpdate = MissedInventoryUpdate.get_by(itemKey = item_key, warehouseId = warehouse_id)
452
    # One email per product key mismatch
437
    # One email per product key mismatch
453
    if not missedInventoryUpdate:
438
    if not missedInventoryUpdate: