fix some bugs 4

This commit is contained in:
2026-07-21 21:44:06 +03:30
parent 80a2eb207a
commit 55ce5e83b0
+4 -4
View File
@@ -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;
}