Merge branch 'stable'
[fa-stable.git] / gl / includes / db / gl_db_bank_accounts.inc
index a92195041a9adc3ce3ddb86a57b4e43be10bf888..0850dfe01a8c577cd6e5f45a7adafdf85e065aae 100644 (file)
@@ -327,7 +327,7 @@ function get_bank_account_limit($account, $date, $user=null)
        $bankacc = get_bank_account($account);
        if ($bankacc['account_type'] != BT_CASH)
                return null;
-       return get_balance_before_for_bank_account($account, add_days($date,1));
+       return max(0, get_balance_before_for_bank_account($account, add_days($date,1))); // in case of manco made before the check was implemented
 }
 
 ?>
\ No newline at end of file