summaryrefslogtreecommitdiff
path: root/FS
diff options
context:
space:
mode:
authorivan <ivan>2008-10-10 23:30:41 +0000
committerivan <ivan>2008-10-10 23:30:41 +0000
commitc8957643638264651261491fd3b25beeabdbedab (patch)
tree279d4d74fb64ba4136049b352d923a95586eeea0 /FS
parent177001fe6d444a507e2929c416ef3d4f5f108643 (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 fd8b73ae8..b3359ca64 100644
--- a/FS/FS/cust_pkg.pm
+++ b/FS/FS/cust_pkg.pm
@@ -1504,7 +1504,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)";