Always set the qos_ptr to the one given instead of only on
ACCT_POLICY_REM_SUBMIT

Originally we had this set things to leave on the highest priority qos_ptr to,
in theory, save time later so this would be the first one evaluated. But in the
coming commits this will change. We plan to have reservations gate on QOS. So
if the highest priority QOS is requested, but the reservation doesn't allow
that QOS it doesn't help to set it to that and could prevent the correct QOS
from being used.

Issue: 50466
Ticket: 23173
diff --git a/src/slurmctld/acct_policy.c b/src/slurmctld/acct_policy.c
index 4ecba1d..9f81c5f 100644
--- a/src/slurmctld/acct_policy.c
+++ b/src/slurmctld/acct_policy.c
@@ -1153,11 +1153,11 @@
 	}
 
 	/*
-	 * When we are removing submit we need to set the pointer back if it was
-	 * changed.
+	 * Now that we are done with accrue set things back to the way
+	 * it was qos wise. Accrue limits are always based on the
+	 * highest priority QOS.
 	 */
-	if ((type == ACCT_POLICY_REM_SUBMIT) &&
-	    (orig_qos_ptr != job_ptr->qos_ptr)) {
+	if (orig_qos_ptr && (orig_qos_ptr != job_ptr->qos_ptr)) {
 		job_ptr->qos_ptr = orig_qos_ptr;
 		job_ptr->qos_id = orig_qos_ptr->id;
 	}