Add customer product fixed price overrides

This commit is contained in:
Jeppe Bundgaard
2026-07-06 12:52:33 +02:00
parent 94c3654240
commit f02dfd8c9c
23 changed files with 738 additions and 59 deletions
@@ -1733,9 +1733,9 @@ class InvoicingPeriodRoute
$department_price_cache[$department_id][$product_id] = (int)$product_cache[$product_id]->getDepartmentPrice($department_id);
}
if (!array_key_exists($product_id, $discount_cache)) {
$discount_cache[$product_id] = $user->getCustomPrice($product_id, false);
$discount_cache[$product_id] = $user->applyProductCustomerPricing($product_id, (int)$department_price_cache[$department_id][$product_id], false);
}
$post_discount = (int)round($department_price_cache[$department_id][$product_id] * (1 - ($discount_cache[$product_id] / 100))) * $quantity;
$post_discount = (int)$discount_cache[$product_id] * $quantity;
$transaction_original_prices[$order_id] = (int)(($transaction_original_prices[$order_id] ?? 0) + $post_discount);
}