Add checking for longitude and latitude when calling getEstimate. #782
This commit is contained in:
parent
213171f4b7
commit
20f5bb08e0
1 changed files with 10 additions and 1 deletions
|
|
@ -41,7 +41,16 @@ class InvoiceController extends ApiController
|
|||
}
|
||||
|
||||
// get customer location from customer_metadata using customer id
|
||||
$coordinates = $this->getCustomerMetadata($cust);
|
||||
$lng = $req->request->get('longitude');
|
||||
$lat = $req->request->get('latitude');
|
||||
|
||||
if ((empty($lng)) || (empty($lat)))
|
||||
{
|
||||
// use customer metadata location as basis
|
||||
$coordinates = $this->getCustomerMetadata($cust);
|
||||
}
|
||||
else
|
||||
$coordinates = new Point($lng, $lat);
|
||||
|
||||
// make invoice criteria
|
||||
$icrit = new InvoiceCriteria();
|
||||
|
|
|
|||
Loading…
Reference in a new issue