price last edited 2
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user