Disable the discount table when any one of the variation has sale price

Disable discount table if any variation has a sale price.

add_filter( 'woo_discount_rules_rule_matches_to_display_in_table', function($status, $product, $rule, $index){
	if($product->get_type() == 'variation'){
		$parent_id = $product->get_parent_id();
		if($parent_id){
			$parent_product = wc_get_product($parent_id);
			if($parent_product->is_on_sale()){
				$status = false;
			}
		}
	} else if($product->get_type() == 'variable'){
		if($parent_product->is_on_sale()){
				$status = false;
			}
	}
	return $status;
}, 10, 4);