def _get_value_voucher_discount_for_checkout(voucher, checkout):
    """Calculate discount value for a voucher of value type."""
    cart_total = checkout.get_subtotal()
    voucher.validate_limit(cart_total)
    return voucher.get_fixed_discount_for(cart_total)