From 55ce5e83b00bffd807369d32a6442b6e0a7af8d0 Mon Sep 17 00:00:00 2001 From: adonis Date: Tue, 21 Jul 2026 21:44:06 +0330 Subject: [PATCH] fix some bugs 4 --- app/Services/WalletBalanceService.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) 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; }