generated from MokoConsulting/Template-Joomla
fix: review #19 — DealHelper trade allowance in gross profit, FinancingHelper negative equity rollover
This commit is contained in:
@@ -57,7 +57,8 @@ class DealHelper
|
||||
}
|
||||
|
||||
$frontGross = (float) $deal->sale_price - (float) $deal->invoice_price
|
||||
- (float) ($deal->reconditioning_cost ?? 0);
|
||||
- (float) ($deal->reconditioning_cost ?? 0)
|
||||
- (float) ($deal->trade_allowance ?? 0);
|
||||
|
||||
// F&I back-end gross
|
||||
$db->setQuery($db->getQuery(true)
|
||||
|
||||
@@ -79,7 +79,8 @@ class FinancingHelper
|
||||
}
|
||||
|
||||
$tradeEquity = (float) $deal->trade_value - (float) $deal->payoff;
|
||||
$effectivePrice = (float) $deal->sale_price - max(0, $tradeEquity);
|
||||
// Negative equity rolls into financed amount (customer owes more than trade value)
|
||||
$effectivePrice = (float) $deal->sale_price - $tradeEquity;
|
||||
|
||||
$scenarios = [];
|
||||
$rates = [3.9, 5.9, 7.9];
|
||||
|
||||
Reference in New Issue
Block a user