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>
Signed-off-by: Jason Etheridge <jason@esilibrary.com>