summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorivan <ivan>2008-10-10 23:36:17 +0000
committerivan <ivan>2008-10-10 23:36:17 +0000
commit458ee7e44e909197be3754141ee1d3c4a84533cc (patch)
treed16cf062044a4f4e4aac0bcb3d35ed15c838a9a7 /FS
parentb49e5e7944701a9fb65d51fbc3345414622fd1f1 (diff)
quick kludge to eliminate exact duplicates in h_labels_short in an effort to reduce the number of "XXX service listing twice on invoice" incidents, RT#3944. still should be possible to fundamentally do better with the function in the first place
Diffstat (limited to 'FS')
-rw-r--r--FS/FS/cust_pkg.pm3
1 files changed, 2 insertions, 1 deletions
diff --git a/FS/FS/cust_pkg.pm b/FS/FS/cust_pkg.pm
index 606cb5407..bc6e46b61 100644
--- a/FS/FS/cust_pkg.pm
+++ b/FS/FS/cust_pkg.pm
@@ -1380,7 +1380,8 @@ sub h_labels_short {
foreach $self->h_labels(@_);
my @labels;
foreach my $label ( keys %labels ) {
- my @values = @{ $labels{$label} };
+ my %seen = ();
+ my @values = grep { ! $seen{$_}++ } @{ $labels{$label} };
my $num = scalar(@values);
if ( $num > $max_same_services ) {
push @labels, "$label ($num)";