feat(server): store and apply negative special price profits

Keep signed buy/sell extras so discounts work on quotes and orders, and ignore the nested user clone in this repo.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
2026-08-17 13:11:00 +03:30
co-authored by Cursor
parent bd8284e4f8
commit 7d405cb83b
6 changed files with 64 additions and 14 deletions
@@ -1461,7 +1461,7 @@ class SingleOrderController extends Controller
throw new UnprocessableEntityHttpException('این محصول برای شما در دسترس نیست.');
}
$specialAmt = $specialSvc->profitForDirection($specialRule, $direction);
if ($specialAmt > 0) {
if ($specialAmt !== 0) {
$amount += $specialAmt;
$keys[] = 'customer_special_pricing';
$lines[] = [