From 2ddd462636f58b0a155ebb3c976cda23ae3f1b13 Mon Sep 17 00:00:00 2001 From: mohammad sedighi Date: Mon, 8 Jun 2026 01:11:49 +0330 Subject: [PATCH] price last edited 2 --- app/Http/Controllers/Site/ReportController.php | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/app/Http/Controllers/Site/ReportController.php b/app/Http/Controllers/Site/ReportController.php index 0e64d25..31476d8 100644 --- a/app/Http/Controllers/Site/ReportController.php +++ b/app/Http/Controllers/Site/ReportController.php @@ -512,13 +512,11 @@ class ReportController extends Controller | main_product / zaarbox: سفارش از Price::latest() — نمایش buy/sell همان منبع. */ if (in_array($priceProvider, ['main_product', 'zaarbox'], true) && !$closed) { - $storedPrice = $lastPrice ?? Price::latest()->first(); - if ($storedPrice && (float) $storedPrice->price > 0) { - $base = (float) $storedPrice->price; - $sell = $open_sell ? (int) ceil($base - $diff_sell) : 0; - $buy = $open_buy ? (int) ceil($base + $diff_buy) : 0; - $priceLast = (int) ceil($base + $diff_buy); - } + $base = (float) $priceValue; + + $sell = $open_sell ? (int) ceil($base - $diff_sell) : 0; + $buy = $open_buy ? (int) ceil($base + $diff_buy) : 0; + $priceLast = (int) ceil($base + $diff_buy); } if (!$closed && $priceValue > 0) {