Receipt Macros: %SORT()%
authorThomas Berezansky <tsbere@mvlc.org>
Fri, 19 Aug 2011 19:15:48 +0000 (15:15 -0400)
committerThomas Berezansky <tsbere@mvlc.org>
Mon, 22 Aug 2011 22:58:08 +0000 (18:58 -0400)
commit2ed593c217d05a145700ccf0c228a10016197ec6
tree47e2fc2a137fd6b1132c2316e259c93b5bf5d899
parente3592ec729f9750f0a0e9d453e9f0b859ab5a9aa
Receipt Macros: %SORT()%

Added to line item templates.
Takes one or more comma separated parameters:
field AS type ASC/DESC

AS type is optional
ASC/DESC is optional

Field is the field name without % signs.
Type is DATE, INT, FLOAT, NUMBER, LOWER, or UPPER

DATE will sort based on wrapping both sides in "new Date"
INT will sort based on wrapping both sides in parseInt
FLOAT and NUMBER will sort based on wrapping both sides in parseFloat
LOWER will apply .toLowerCase to both sides
UPPER will apply .toUpperCase to both sides

ASC (default) will sort in ascending order.
DESC will sort in descending order.

Can be specified more than once:
%SORT(a,b)% %SORT(c)%
Would sort by a, then b, then c.

Signed-off-by: Thomas Berezansky <tsbere@mvlc.org>
Open-ILS/xul/staff_client/chrome/content/util/print.js