setting changed 2

This commit is contained in:
2026-06-05 17:43:02 +03:30
parent 7776abf6a3
commit c082e5eb42
8 changed files with 152 additions and 234 deletions
@@ -10,7 +10,6 @@ use App\Models\Setting;
use App\Models\ConfigStatic;
use App\Models\Customer;
use App\Services\MontzarService;
use App\Services\EtehadiePriceService;
use App\Services\ZaarboxPriceService;
use App\Models\Price;
use App\Models\PriceCandle;
@@ -331,15 +330,12 @@ class ReportController extends Controller
if ($pr_product && !$closed) {
if ($priceProvider === 'main_product') {
if (Product::hasStoredPriceColumns()) {
app(EtehadiePriceService::class)->syncProductFromApi($pr_product->fresh());
app(ZaarboxPriceService::class)->syncProductFromApi($pr_product->fresh());
$pr_product->refresh();
$pr_price = (float) $pr_product->price + (float) ($pr_product->price_profit ?? 0);
} else {
$apiUrl = $config->getString('zaarbox_api_url', '')
?: $config->getString('etehadie_api_url', 'https://price.zaarbox.ir/api/free');
$live = app(EtehadiePriceService::class)->fetchLiveOrderPrice(
$pr_product->reading_method,
$apiUrl
$live = app(ZaarboxPriceService::class)->fetchLiveOrderPrice(
$pr_product->reading_method
);
$pr_price = (float) ($live['order_price'] ?? 0);
}