| Line 1387... |
Line 1387... |
| 1387 |
def delete_entity_tag(displayName, catalogId):
|
1387 |
def delete_entity_tag(displayName, catalogId):
|
| 1388 |
session.query(EntityTag.tag).filter_by(tag=displayName,entityId=catalogId).delete()
|
1388 |
session.query(EntityTag.tag).filter_by(tag=displayName,entityId=catalogId).delete()
|
| 1389 |
session.commit()
|
1389 |
session.commit()
|
| 1390 |
return True
|
1390 |
return True
|
| 1391 |
|
1391 |
|
| 1392 |
def get_insurance_amount(itemId, insurerId, quantity):
|
1392 |
def get_insurance_amount(itemId, price, insurerId, quantity):
|
| 1393 |
item = Item.get_by(id = itemId)
|
- |
|
| 1394 |
itemInsurerMapping = ItemInsurerMapping.query.filter(ItemInsurerMapping.itemId == itemId).filter(ItemInsurerMapping.insurerId == insurerId).first()
|
1393 |
itemInsurerMapping = ItemInsurerMapping.query.filter(ItemInsurerMapping.itemId == itemId).filter(ItemInsurerMapping.insurerId == insurerId).first()
|
| 1395 |
if not itemInsurerMapping:
|
1394 |
if not itemInsurerMapping:
|
| 1396 |
#Default insurance premium is 1.5%
|
1395 |
#Default insurance premium is 1.5%
|
| 1397 |
return round(item.sellingPrice * (1.5/100) * quantity)
|
1396 |
return round(price * (1.5/100) * quantity)
|
| 1398 |
insuranceAmount = 0.0
|
1397 |
insuranceAmount = 0.0
|
| 1399 |
if itemInsurerMapping.premiumType == PremiumType._NAMES_TO_VALUES.get("PERCENT"):
|
1398 |
if itemInsurerMapping.premiumType == PremiumType._NAMES_TO_VALUES.get("PERCENT"):
|
| 1400 |
insuranceAmount = item.sellingPrice * (itemInsurerMapping.premiumAmount/100) * quantity
|
1399 |
insuranceAmount = price * (itemInsurerMapping.premiumAmount/100) * quantity
|
| 1401 |
else :
|
1400 |
else :
|
| 1402 |
insuranceAmount = itemInsurerMapping.premiumAmount * quantity
|
1401 |
insuranceAmount = itemInsurerMapping.premiumAmount * quantity
|
| 1403 |
|
1402 |
|
| 1404 |
return insuranceAmount
|
1403 |
return insuranceAmount
|
| 1405 |
|
1404 |
|