fix(wallet,assets): fix 3 extra zeros in wallet rial value and handle closed market in asset calculations

This commit is contained in:
2026-11-19 11:00:41 +03:30
parent ce9d62ffaa
commit 070acd52e0
5 changed files with 143 additions and 18 deletions
+5 -1
View File
@@ -219,7 +219,11 @@ class ProductPriceSyncService
}
if ($product->reading_method == 'مس' && $CP) {
ProductPriceService::syncFromReference($product, (int) $CP, 0);
$unitCp = (int) $CP;
if ($unitCp > 500_000_000) {
$unitCp = (int) round($unitCp / 1000);
}
ProductPriceService::syncFromReference($product, $unitCp, 0);
Product::where('id', $product->id)->update(['show' => $show]);
$synced = true;
}