AND ISNULL(v.date_)
AND trans_date >= '$from'
AND trans_date <= '$to'
+ AND amount != 0
ORDER BY trans_date, t.id";
return db_query($sql,"The transactions for '" . $bank_account . "' could not be retrieved");
return null; // unlimited account
if (floatcmp($balance, -$delta_amount) < 0)
- return array('amount' => $balance - $delta_amount, 'trans_date'=> $date);
+ return array('amount' => $balance + $delta_amount, 'trans_date'=> date2sql($date));
$balance += $delta_amount;
while ($trans = db_fetch($history)) {
$balance += $trans['amount'];
if ($balance < 0)
+ {
+ $trans['amount'] = $balance;
return $trans;
+ }
}
return null;
return true;
}
-?>