Subversion Repositories SmartDukaan

Rev

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

Rev 5513 Rev 5518
Line 1523... Line 1523...
1523
def get_voucher_amount(itemId, voucher_type):
1523
def get_voucher_amount(itemId, voucher_type):
1524
    voucher = VoucherItemMapping.query.filter_by(item_id=itemId, voucherType=voucher_type).all()
1524
    voucher = VoucherItemMapping.query.filter_by(item_id=itemId, voucherType=voucher_type).all()
1525
    if len(voucher):
1525
    if len(voucher):
1526
        return voucher[0].amount
1526
        return voucher[0].amount
1527
    else:
1527
    else:
1528
        return None
1528
        return 0
1529
 
1529
 
1530
def add_update_voucher_for_item(catalog_item_id, voucher_type, voucher_amount):
1530
def add_update_voucher_for_item(catalog_item_id, voucher_type, voucher_amount):
1531
    if not catalog_item_id or not voucher_type or not voucher_amount:
1531
    if not catalog_item_id or not voucher_type or not voucher_amount:
1532
        raise InventoryServiceException(101, "Bad catalogItemId or voucherType or voucherAmount in request")
1532
        raise InventoryServiceException(101, "Bad catalogItemId or voucherType or voucherAmount in request")
1533
    
1533