FIX: show correct action buttons in event billing overview

This commit is contained in:
Keanu D?lle 2022-03-08 16:06:34 +01:00
parent d9bb76e087
commit 9912af7690

View File

@ -105,6 +105,9 @@ EventBilling = (function () {
alert("Es ist ein Fehler aufgetreten!");
}
});
if(typeof res !== 'object'){
return res;
}
if('error' in res){
return null;
}else{
@ -196,16 +199,14 @@ EventBilling = (function () {
} else if (event.state === 6) {
$(".goto_personnel_billing").show();
} else if (event.state >= 7) {
let min_billing_state;
if (!event_min_billing_state.error) {
min_billing_state = event_min_billing_state;
} else {
min_billing_state = billing_states[0].entity_id;
if (!event_min_billing_state) {
$(".goto_approve_" + billing_states[0].entity_id).show();
}
//Show next approval step (billing_state) button
for (let i = 0; i < billing_states.length - 1; i++) {
if (billing_states[i].entity_id === min_billing_state) {
$(".goto_approve_" + billing_states[i + 1].entity_id).show();
if (billing_states[i].entity_id === event_min_billing_state) {
$(".goto_approve_" + billing_states[i+1].entity_id).show();
}
}
}