fix wallet

This commit is contained in:
2026-06-10 13:11:51 +03:30
parent fe4d85325e
commit 539e38d034
14 changed files with 957 additions and 293 deletions
+11 -1
View File
@@ -33,7 +33,17 @@ class ProductPriceService
}
$offsetPercent = self::offsetPercent($product);
$data = ['price' => self::adjustedTotal($basePrice, $baseProfit, $offsetPercent)];
$adjustedPrice = self::adjustedTotal($basePrice, $baseProfit, $offsetPercent);
if (
$adjustedPrice <= 0
&& Product::hasUseLastPriceIfZeroColumn()
&& ($product->use_last_price_if_zero ?? false)
) {
return;
}
$data = ['price' => $adjustedPrice];
if (\Illuminate\Support\Facades\Schema::hasColumn($product->getTable(), 'price_profit')) {
$data['price_profit'] = 0;