Set taxable for invoice criteria when app requests a job order. #744
This commit is contained in:
parent
9840ecf633
commit
822bc59c6c
2 changed files with 7 additions and 1 deletions
|
|
@ -2865,6 +2865,9 @@ class APIController extends Controller implements LoggedController
|
||||||
$icrit = new InvoiceCriteria();
|
$icrit = new InvoiceCriteria();
|
||||||
$icrit->setServiceType($stype);
|
$icrit->setServiceType($stype);
|
||||||
|
|
||||||
|
// set taxable
|
||||||
|
$icrit->setIsTaxable(true);
|
||||||
|
|
||||||
// check promo
|
// check promo
|
||||||
$promo_id = $req->request->get('promo_id');
|
$promo_id = $req->request->get('promo_id');
|
||||||
if (!empty($promo_id))
|
if (!empty($promo_id))
|
||||||
|
|
|
||||||
|
|
@ -94,6 +94,8 @@ class InvoiceManager implements InvoiceGeneratorInterface
|
||||||
->setCustomerVehicle($jo->getCustomerVehicle());
|
->setCustomerVehicle($jo->getCustomerVehicle());
|
||||||
|
|
||||||
// set if taxable
|
// set if taxable
|
||||||
|
// NOTE: ideally, this should be a parameter when calling generateInvoiceCriteria. But that
|
||||||
|
// would mean adding it as a parameter to the call, impacting all calls
|
||||||
$criteria->setIsTaxable();
|
$criteria->setIsTaxable();
|
||||||
|
|
||||||
$ierror = $this->validatePromo($criteria, $promo_id);
|
$ierror = $this->validatePromo($criteria, $promo_id);
|
||||||
|
|
@ -152,11 +154,12 @@ class InvoiceManager implements InvoiceGeneratorInterface
|
||||||
}
|
}
|
||||||
|
|
||||||
// this is called by JobOrderController when JS script generateInvoice is called
|
// this is called by JobOrderController when JS script generateInvoice is called
|
||||||
|
// this is also called by the APIController from newRequestJobOrder
|
||||||
// this is also called by generateInvoiceCriteria
|
// this is also called by generateInvoiceCriteria
|
||||||
public function generateInvoice($criteria)
|
public function generateInvoice($criteria)
|
||||||
{
|
{
|
||||||
// no need to validate since generateDraftInvoice was called before this was called
|
// no need to validate since generateDraftInvoice was called before this was called
|
||||||
// generate the invoice
|
// generate the invoice and from APIController, the fields were validated
|
||||||
// check which rules to apply
|
// check which rules to apply
|
||||||
$rules = $this->check($criteria);
|
$rules = $this->check($criteria);
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue