diff --git a/app/Services/WalletBalanceService.php b/app/Services/WalletBalanceService.php index 134e5a4..fa194af 100644 --- a/app/Services/WalletBalanceService.php +++ b/app/Services/WalletBalanceService.php @@ -95,7 +95,7 @@ class WalletBalanceService $productId = (int) ($this->lineValue($line, 'product_id') ?? 0); $gold = (float) ($this->lineValue($line, 'gold') ?? 0); - if ($gold <= 0) { + if (abs($gold) < 0.0000001) { continue; } @@ -183,7 +183,7 @@ class WalletBalanceService } $goldGrams = $this->walletLineGoldGrams($line); - if ($goldGrams <= 0) { + if (abs($goldGrams) < 0.0000001) { return $map; } @@ -211,7 +211,7 @@ class WalletBalanceService $mainWalletMetalId = $this->resolveMainWalletMetalId(); foreach ($this->walletLines($walletLines) as $line) { $goldGrams = $this->walletLineGoldGrams($line); - if ($goldGrams <= 0) { + if (abs($goldGrams) < 0.0000001) { continue; } @@ -411,7 +411,7 @@ class WalletBalanceService private function walletLineGoldGrams(mixed $line): float { $gold = (float) ($this->lineValue($line, 'gold') ?? 0); - if ($gold <= 0) { + if (abs($gold) < 0.0000001) { return 0.0; }