Merge branch '750-resq-2-fix-computation-issue-for-jo-from-resq-1-app' into '746-resq-2-0-final'

Resolve "RESQ 2: Fix computation issue for JO from Resq 1 app"

See merge request jankstudio/resq!864
This commit is contained in:
Ramon Gutierrez 2023-07-19 07:18:09 +00:00
commit bc47873ed1

View file

@ -2936,7 +2936,11 @@ class APIController extends Controller implements LoggedController
break;
}
$icrit->addEntry($batt, $trade_in, 1);
// right now, the app does not include trade-ins but this might change in the future
if (empty($trade_in))
$icrit->addEntry($batt, null, 1);
else
$icrit->addEntry($batt, $trade_in, 1);
// send to invoice generator
$invoice = $ic->generateInvoice($icrit);