From: mark Date: Fri, 28 Oct 2011 06:44:26 +0000 (+0000) Subject: run exports in weight order, #14924 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=0ec9dd682b7c32335788fd9633cb48b59cd720d4 run exports in weight order, #14924 --- diff --git a/FS/FS/part_export.pm b/FS/FS/part_export.pm index 890c522f6..9a479b7c8 100644 --- a/FS/FS/part_export.pm +++ b/FS/FS/part_export.pm @@ -401,6 +401,18 @@ or hidden by default). =cut +=item weight + +Returns the 'weight' element from the export's %info hash, or 0 if there is +no weight defined. + +=cut + +sub weight { + my $self = shift; + export_info()->{$self->exporttype}->{'weight'} || 0; +} + =back =head1 SUBROUTINES diff --git a/FS/FS/part_svc.pm b/FS/FS/part_svc.pm index 4d56feef2..249a2b4b9 100644 --- a/FS/FS/part_svc.pm +++ b/FS/FS/part_svc.pm @@ -434,6 +434,7 @@ sub part_export { my $self = shift; my %search; $search{'exporttype'} = shift if @_; + sort { $a->weight <=> $b->weight } map { qsearchs('part_export', { 'exportnum' => $_->exportnum, %search } ) } qsearch('export_svc', { 'svcpart' => $self->svcpart } ); }