X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_main%2FPackages.pm;h=9899bd0314323f23282b0433d003408e65a789af;hb=7a486dea647f735a9a1d0381443218ad6affe6e1;hp=a7418f7f0ce31c3054cf1f7f8e48ae580b648b16;hpb=4ad88e4863417a9004b991ffbaffa05d520bf1e9;p=freeside.git diff --git a/FS/FS/cust_main/Packages.pm b/FS/FS/cust_main/Packages.pm index a7418f7f0..9899bd031 100644 --- a/FS/FS/cust_main/Packages.pm +++ b/FS/FS/cust_main/Packages.pm @@ -87,7 +87,7 @@ sub order_pkg { if exists($opt->{'depend_jobnum'}) && $opt->{'depend_jobnum'}; my %insert_params = map { $opt->{$_} ? ( $_ => $opt->{$_} ) : () } - qw( ticket_subject ticket_queue allow_pkgpart import ); + qw( ticket_subject ticket_queue allow_pkgpart ); local $SIG{HUP} = 'IGNORE'; local $SIG{INT} = 'IGNORE'; @@ -226,8 +226,7 @@ Services can be new, in which case they are inserted, or existing unaudited services, in which case they are linked to the newly-created package. Currently available options are: I, I, I, -I, I, I, I, and -I. +I, I, I, and I. If I is set, all provisioning jobs will have a dependancy on the supplied jobnum (they will not run until the specific job completes). @@ -244,7 +243,7 @@ If I, I, I, or I is provided, the scalars (provided by references) will be incremented by the values of the prepaid card.` -I and I are flags passed to L->insert. +I is passed to L->insert. =cut @@ -278,7 +277,7 @@ sub order_pkgs { 'cust_pkg' => $cust_pkg, 'svcs' => $cust_pkgs->{$cust_pkg}, map { $_ => $options{$_} } - qw( seconds_ref upbytes_ref downbytes_ref totalbytes_ref depend_jobnum allow_pkgpart import ) + qw( seconds_ref upbytes_ref downbytes_ref totalbytes_ref depend_jobnum allow_pkgpart ) ); if ( $error ) { $dbh->rollback if $oldAutoCommit; @@ -502,8 +501,9 @@ sub sort_packages { return 0 if !$a_num_cust_svc && !$b_num_cust_svc; return -1 if $a_num_cust_svc && !$b_num_cust_svc; return 1 if !$a_num_cust_svc && $b_num_cust_svc; - my @a_cust_svc = $a->cust_svc; - my @b_cust_svc = $b->cust_svc; + return 0 if $a_num_cust_svc + $b_num_cust_svc > 20; #for perf, just give up + my @a_cust_svc = $a->cust_svc_unsorted; + my @b_cust_svc = $b->cust_svc_unsorted; return 0 if !scalar(@a_cust_svc) && !scalar(@b_cust_svc); return -1 if scalar(@a_cust_svc) && !scalar(@b_cust_svc); return 1 if !scalar(@a_cust_svc) && scalar(@b_cust_svc);