zarbox added 2
This commit is contained in:
@@ -330,10 +330,24 @@ class ReportController extends Controller
|
||||
}
|
||||
if ($pr_product && !$closed) {
|
||||
if ($priceProvider === 'main_product') {
|
||||
app(EtehadiePriceService::class)->syncProductFromApi($pr_product->fresh());
|
||||
$pr_product->refresh();
|
||||
if (Product::hasStoredPriceColumns()) {
|
||||
app(EtehadiePriceService::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
|
||||
);
|
||||
$pr_price = (float) ($live['order_price'] ?? 0);
|
||||
}
|
||||
} else {
|
||||
$pr_price = Product::hasStoredPriceColumns()
|
||||
? (float) $pr_product->price + (float) ($pr_product->price_profit ?? 0)
|
||||
: 0.0;
|
||||
}
|
||||
$pr_price = (float) $pr_product->price + (float) ($pr_product->price_profit ?? 0);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user