X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fcust_bill.pm;h=f536c972c9ff934908d7d063d85c03b31e78837a;hp=eafe9307c05bd81fc89c5b1c31b5f37bf5a78d6e;hb=6626dc2a13c809092aa539c5a72bc72a0c56afdc;hpb=ebfc3f058e29e09631112ee355a2c57dce56914f diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm index eafe9307c..f536c972c 100644 --- a/FS/FS/cust_bill.pm +++ b/FS/FS/cust_bill.pm @@ -2486,9 +2486,18 @@ sub _items_pkg { $self->_items_cust_bill_pkg(\@cust_bill_pkg, %options); } +sub _taxsort { + return 0 unless $a cmp $b; + return -1 if $b eq 'Tax'; + return 1 if $a eq 'Tax'; + return -1 if $b eq 'Other surcharges'; + return 1 if $a eq 'Other surcharges'; + $a cmp $b; +} + sub _items_tax { my $self = shift; - my @cust_bill_pkg = grep { ! $_->pkgnum } $self->cust_bill_pkg; + my @cust_bill_pkg = sort _taxsort grep { ! $_->pkgnum } $self->cust_bill_pkg; $self->_items_cust_bill_pkg(\@cust_bill_pkg, @_); }