From a9f53cdf8221cbe2817fed92fb6b52818ee64fb1 Mon Sep 17 00:00:00 2001 From: Rene Krenn Date: Mon, 26 Sep 2022 10:30:11 +0200 Subject: [PATCH] MT#55418 hide billing mappings with terminated profiles in AUI Change-Id: Id480f3c0928d8e3d0a29dd3508c08de68e64ce5a --- lib/NGCP/Panel/Utils/BillingMappings.pm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/lib/NGCP/Panel/Utils/BillingMappings.pm b/lib/NGCP/Panel/Utils/BillingMappings.pm index 530692955e..7c21228441 100644 --- a/lib/NGCP/Panel/Utils/BillingMappings.pm +++ b/lib/NGCP/Panel/Utils/BillingMappings.pm @@ -563,6 +563,14 @@ sub resource_from_mappings { ); #validate_forms uses RFC3339 otherwise, which contains the tz offset part foreach my $mapping (billing_mappings_ordered($future_only ? future_billing_mappings($contract->billing_mappings) : $contract->billing_mappings)->all) { + my $profile = $mapping->billing_profile; + if ($profile and 'terminated' eq $profile->status) { + next; + } + my $network = $mapping->network; + if ($network and 'terminated' eq $network->status) { + next; + } my %m = $mapping->get_inflated_columns; delete $m{id}; $m{start} = delete $m{start_date};