Merge branch '753-resq-2-set-invoice-criteria-correctly-in-getestimate' into '746-resq-2-0-final'
Resolve "RESQ 2: Set invoice criteria correctly in getEstimate" See merge request jankstudio/resq!868
This commit is contained in:
commit
18c893cc6e
3 changed files with 27 additions and 4 deletions
|
|
@ -1026,8 +1026,15 @@ class APIController extends Controller implements LoggedController
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 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);
|
$icrit->addEntry($batt, $trade_in, 1);
|
||||||
|
|
||||||
|
// set if taxable
|
||||||
|
$icrit->setIsTaxable();
|
||||||
|
|
||||||
// send to invoice generator
|
// send to invoice generator
|
||||||
$invoice = $ic->generateInvoice($icrit);
|
$invoice = $ic->generateInvoice($icrit);
|
||||||
$jo->setInvoice($invoice);
|
$jo->setInvoice($invoice);
|
||||||
|
|
@ -1307,6 +1314,9 @@ class APIController extends Controller implements LoggedController
|
||||||
$icrit->addBattery($batt);
|
$icrit->addBattery($batt);
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
// set taxable
|
||||||
|
$icrit->setIsTaxable(true);
|
||||||
|
|
||||||
// check trade-in
|
// check trade-in
|
||||||
// only allow motolite, other, none
|
// only allow motolite, other, none
|
||||||
$trade_in = $req->request->get('trade_in');
|
$trade_in = $req->request->get('trade_in');
|
||||||
|
|
@ -1321,6 +1331,10 @@ class APIController extends Controller implements LoggedController
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 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);
|
$icrit->addEntry($batt, $trade_in, 1);
|
||||||
|
|
||||||
// send to invoice generator
|
// send to invoice generator
|
||||||
|
|
|
||||||
|
|
@ -92,6 +92,10 @@ class InvoiceController extends ApiController
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 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);
|
$icrit->addEntry($batt, $trade_in, 1);
|
||||||
|
|
||||||
// set if taxable
|
// set if taxable
|
||||||
|
|
|
||||||
|
|
@ -874,7 +874,12 @@ class ResqRiderAPIHandler implements RiderAPIHandlerInterface
|
||||||
|
|
||||||
if ($battery != null)
|
if ($battery != null)
|
||||||
{
|
{
|
||||||
|
// right now, the app does not include trade-ins but this might change in the future
|
||||||
|
if ($trade_in == null)
|
||||||
|
$crit->addEntry($battery, null, 1);
|
||||||
|
else
|
||||||
$crit->addEntry($battery, $trade_in, 1);
|
$crit->addEntry($battery, $trade_in, 1);
|
||||||
|
|
||||||
// error_log('adding entry for battery - ' . $battery->getID());
|
// error_log('adding entry for battery - ' . $battery->getID());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue