FIX: show correct action buttons in event billing overview
This commit is contained in:
parent
d9bb76e087
commit
9912af7690
|
@ -105,6 +105,9 @@ EventBilling = (function () {
|
||||||
alert("Es ist ein Fehler aufgetreten!");
|
alert("Es ist ein Fehler aufgetreten!");
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
if(typeof res !== 'object'){
|
||||||
|
return res;
|
||||||
|
}
|
||||||
if('error' in res){
|
if('error' in res){
|
||||||
return null;
|
return null;
|
||||||
}else{
|
}else{
|
||||||
|
@ -196,16 +199,14 @@ EventBilling = (function () {
|
||||||
} else if (event.state === 6) {
|
} else if (event.state === 6) {
|
||||||
$(".goto_personnel_billing").show();
|
$(".goto_personnel_billing").show();
|
||||||
} else if (event.state >= 7) {
|
} else if (event.state >= 7) {
|
||||||
let min_billing_state;
|
if (!event_min_billing_state) {
|
||||||
if (!event_min_billing_state.error) {
|
$(".goto_approve_" + billing_states[0].entity_id).show();
|
||||||
min_billing_state = event_min_billing_state;
|
|
||||||
} else {
|
|
||||||
min_billing_state = billing_states[0].entity_id;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
//Show next approval step (billing_state) button
|
//Show next approval step (billing_state) button
|
||||||
for (let i = 0; i < billing_states.length - 1; i++) {
|
for (let i = 0; i < billing_states.length - 1; i++) {
|
||||||
if (billing_states[i].entity_id === min_billing_state) {
|
if (billing_states[i].entity_id === event_min_billing_state) {
|
||||||
$(".goto_approve_" + billing_states[i + 1].entity_id).show();
|
$(".goto_approve_" + billing_states[i+1].entity_id).show();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue