mbts.balance_owed often arrives as a string, so we provide here a custom
comparator function that runs the values through parseFloat() before comparing
them.
Signed-off-by: Mike Rylander <mrylander@gmail.com>
Signed-off-by: Andrea Neiman <abneiman@equinoxinitiative.org>
Signed-off-by: Bill Erickson <berickxx@gmail.com>
path="acp.alert_message"></eg-grid-field>
<eg-grid-field label="[% l('Balance Owed') %]"
- path='mbts.balance_owed'></eg-grid-field>
+ path='mbts.balance_owed' comparator="sort_money"></eg-grid-field>
<eg-grid-field label="[% l('Barcode') %]" path="copy_barcode">
<!-- FIXME: ng-if / ng-disabled not working since the contents
suppress_popups = set['ui.circ.suppress_checkin_popups'];
});
+ $scope.sort_money = function (a,b) {
+ var ma = parseFloat(a);
+ var mb = parseFloat(b);
+ if (ma < mb) return -1;
+ if (ma > mb) return 1;
+ return 0
+ }
+
// checkin & hold capture modifiers
var modifiers = [
'void_overdues',