Topic: Cash account cannot be $0?

I have $216.85 in the cash account and i want to transfer all the amount into a saving account. I did it at "Bank Account Transfers"

I get the following error message:
The total bank amount exceeds allowed limit (216.85) for source account.


What happened?

How can i do the transfer correctly?

Re: Cash account cannot be $0?

Someone please help??

Re: Cash account cannot be $0?

It's probably a rounding error (so 216.85- 216.85 is not exactly equal to zero).
add $1 or 1cent  in the cash account (in FA and physically ) it see if it solve the problem.

I know it's not ideal, but that's the only thing you can do at the moment.

/Elax

Re: Cash account cannot be $0?

It shouldn't be a rounding error because all the amount keyed in was in 2 decimal place.
And I have just changed the decimal place to 4, the amount i have is exactly 216.8500

If i transfer 1 cent less: 216.84, it's ok.

this is the code that i extracted from bank_transfer.php, not sure if it helps:

$limit = get_bank_account_limit($_POST['FromBankAccount'], $_POST['DatePaid']);
    if ($limit != null && ($limit < $amnt_tr))
    {
        display_error(sprintf(_("The total bank amount exceeds allowed limit (%s) for source account."), price_format($limit)));
        set_focus('amount');
        return false;
    }

5 (edited by BrianKuehn 05/10/2013 08:52:58 am)

Re: Cash account cannot be $0?

Shouldn't $limit <= $amnt_tr work? There shouldn't be a reason why a transfer can't be the same amount as the $limit

Plus it should be that you can't take out more than you have in your account (unless you have some type of credit maybe)

Brian

Re: Cash account cannot be $0?

@BrianKuehn
Using <=  would just raise the error when amount is equal to limit.

Seems this is rounding error, try change the line to:

if ($limit != null && floatcmp($limit,$amnt_tr)<0)

Janusz

Re: Cash account cannot be $0?

Changing the line works.

Thanks.

But the same thing needs to be changed for "Payment entry" as well  so that paying the exact same amount as the Cash Account has is possible.

Will this be fix in the next release?

Re: Cash account cannot be $0?

Still getting used to PHP and FA's setup...

Re: Cash account cannot be $0?

@twitty1437
Sure, as usually fix will be included in next release.
Janusz