Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

amount in transaction bug on withdrawFloat #85

Closed
anthoz69 opened this issue Aug 7, 2019 · 5 comments
Closed

amount in transaction bug on withdrawFloat #85

anthoz69 opened this issue Aug 7, 2019 · 5 comments
Assignees
Labels
bug Something isn't working

Comments

@anthoz69
Copy link

anthoz69 commented Aug 7, 2019

Hi, I found some bug of withdrawFloat

my code:

public function withdraw($amount, ?array $desc = null, $confirmed = 0)
    {
        $user = User::find(Auth::id());
        if ($amount > 0) {
            return $user->withdrawFloat($amount, $desc, $confirmed);
        }

        return $user->balanceFloat;
    }

$this->withdraw(2556.72, [], true);

when I withdraw amount:
2556.72 in db transaction amount is show -255671 // 2556.71 it sholud be 2556.72

Thank you. sorry for my english.

@anthoz69 anthoz69 changed the title bug on withdrawFloat amount in transaction bug on withdrawFloat Aug 7, 2019
@rez1dent3 rez1dent3 added the bug Something isn't working label Aug 7, 2019
@rez1dent3 rez1dent3 self-assigned this Aug 7, 2019
@rez1dent3
Copy link
Member

@anthoz69 Thanks, I'll see in the evening.

image

rez1dent3 pushed a commit that referenced this issue Aug 7, 2019
@rez1dent3
Copy link
Member

rez1dent3 commented Aug 7, 2019

@anthoz69 now everything works, check it. tag 3.1.5

@rez1dent3
Copy link
Member

@anthoz69 https://github.com/bavix/laravel-wallet/blob/master/tests/WalletFloatTest.php#L210
And here’s the unit test

@rez1dent3
Copy link
Member

I close the issue. There are questions open new.

@anthoz69
Copy link
Author

anthoz69 commented Aug 8, 2019

@rez1dent3 thank you so much.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants