From: ivan Date: Sat, 3 Jul 2010 01:25:29 +0000 (+0000) Subject: should fix cancellations in rare circumstances where cached _num_cust_svc becomes... X-Git-Tag: freeside_1_9_4~19 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=5d20bb4fedd8fe05883966068eb5e06a5a55898b should fix cancellations in rare circumstances where cached _num_cust_svc becomes inaccurate, RT#8994 --- diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index e22f7eec1..8b366ee72 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -2104,6 +2104,9 @@ sub sort_packages { 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 !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); $a_cust_svc[0]->svc_x->label cmp $b_cust_svc[0]->svc_x->label; }