[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb:[6746] trunk/LedgerSMB/Report.pm



Revision: 6746
          http://sourceforge.net/p/ledger-smb/code/6746
Author:   einhverfr
Date:     2014-02-04 09:37:27 +0000 (Tue, 04 Feb 2014)
Log Message:
-----------
Moving from pure text-order sort to numeric sort followed by text sort where those are equal.  Closing out bug 1033

Modified Paths:
--------------
    trunk/LedgerSMB/Report.pm

Modified: trunk/LedgerSMB/Report.pm
===================================================================
--- trunk/LedgerSMB/Report.pm	2014-02-04 08:53:20 UTC (rev 6745)
+++ trunk/LedgerSMB/Report.pm	2014-02-04 09:37:27 UTC (rev 6746)
@@ -209,7 +209,9 @@
     );
 
     my $rows = $self->rows;
-    @$rows = sort {$a->{$self->order_by} cmp $b->{$self->order_by}} @$rows
+    @$rows = sort {$a->{$self->order_by} <=> $b->{$self->order_by}
+                   or
+                   $a->{$self->order_by} cmp $b->{$self->order_by}} @$rows
       if $self->order_by;
     if (lc($self->order_dir) eq 'desc' and $self->order_by) {
         @$rows = reverse @$rows;

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
Ledger-smb-commits mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-commits