Fixed showing some orders with termination in special orders in Order/Index

This commit is contained in:
Frank Schubert
2025-10-09 13:55:55 +02:00
parent fe08c5c3c0
commit c5f60f96c3

View File

@@ -225,6 +225,7 @@ class OrderController extends mfBaseController {
$has_bras = false;
$has_voice = false;
$has_term = false;
foreach($order->products as $lop) {
if(is_array($lop->product->attributes) && array_key_exists("bras_type", $lop->product->attributes) && $lop->product->attributes['bras_type']) {
$has_bras = true;
@@ -232,12 +233,20 @@ class OrderController extends mfBaseController {
if(is_array($lop->product->attributes) && array_key_exists("voip_chan", $lop->product->attributes) && $lop->product->attributes['voip_chan']) {
$has_voice = true;
}
if(
is_array($lop->product->attributes)
&& array_key_exists("termination_required", $lop->product->attributes)
&& $lop->product->attributes['termination_required']
&& $lop->termination_id
) {
$has_term = true;
}
}
if(!$has_bras && !$has_voice) {
if(!$has_bras && !$has_voice && !$has_term) {
$special_orders[] = $order;
continue;
}
if($has_voice && !$has_bras) {
if($has_voice && !$has_bras && !$has_term) {
$voice_orders[] = $order;
continue;
}