push @orwhere, "(cust_bill_pkg.setup > 0)" if $setup;
push @orwhere, "($recur_sql > 0)" if $recur;
push @orwhere, "($usage_sql > 0)" if $usage;
-push @where, join(' OR ', @orwhere);
+push @where, '('.join(' OR ', @orwhere).')' if @orwhere;
$join_cust = ' JOIN cust_bill USING ( invnum )
LEFT JOIN cust_main USING ( custnum )
# Wrapper for $worksheet->write.
# Do any massaging of the value/format here.
my ($r, $c, $value, $format) = @_;
- if ( $value =~ /^\Q$money_char\E(\d+\.?\d*)$/ ) {
+ if ( $value =~ /^\Q$money_char\E(-?\d+\.?\d*)$/ ) {
# Currency: strip the symbol, clone the requested format,
# and format it for currency
$value = $1;