1. cstore expects order_by's to be delineated by object class
2. CStoreEditor requires all params that are passed through to cstore to
be contained within the first parameter to a search_*, etc. calls, so
wrap the query and order_by clauses in an array.
Without these changes, the fine generator would generate duplicate
billings when voided billings were present.
Signed-off-by: Bill Erickson <berickxx@gmail.com>
" (user ".$c->usr.").\n".
"\tItem was due on or before: ".localtime($due)."\n") if $conn;
- my @fines = @{$e->search_money_billing(
+ my @fines = @{$e->search_money_billing([
{ xact => $c->id,
btype => 1,
billing_ts => { '>' => $c->$due_date_method } },
- { order_by => 'billing_ts DESC'}
- )};
+ { order_by => {mb => 'billing_ts DESC'}}
+ ])};
my $f_idx = 0;
my $fine = $fines[$f_idx] if (@fines);