2017-04-04 16:51:01 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace App\Ninja\Intents\WebApp;
|
|
|
|
|
|
|
|
use App\Models\Invoice;
|
|
|
|
use App\Ninja\Intents\BaseIntent;
|
|
|
|
|
|
|
|
class CreateQuoteIntent extends BaseIntent
|
|
|
|
{
|
|
|
|
public function process()
|
|
|
|
{
|
|
|
|
$client = $this->requestClient();
|
|
|
|
$clientPublicId = $client ? $client->public_id : null;
|
|
|
|
|
|
|
|
//$invoiceItems = $this->requestInvoiceItems();
|
|
|
|
|
|
|
|
$url = '/quotes/create/' . $clientPublicId . '?';
|
|
|
|
$url .= $this->requestFieldsAsString(Invoice::$requestFields);
|
|
|
|
|
2017-04-05 21:20:11 +02:00
|
|
|
$url = rtrim($url, '?');
|
|
|
|
$url = rtrim($url, '&');
|
|
|
|
|
2017-04-04 16:51:01 +02:00
|
|
|
return redirect($url);
|
|
|
|
}
|
|
|
|
}
|