2017-04-04 17:51:01 +03:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
namespace App\Ninja\Intents\WebApp;
|
|
|
|
|
|
|
|
|
|
use App\Ninja\Intents\InvoiceIntent;
|
|
|
|
|
|
|
|
|
|
class ListInvoiceIntent extends InvoiceIntent
|
|
|
|
|
{
|
|
|
|
|
public function process()
|
|
|
|
|
{
|
2017-04-05 22:20:11 +03:00
|
|
|
$this->loadStates(ENTITY_INVOICE);
|
|
|
|
|
$this->loadStatuses(ENTITY_INVOICE);
|
|
|
|
|
|
2017-04-06 16:47:37 +03:00
|
|
|
if ($client = $this->requestClient()) {
|
2017-04-05 18:04:44 +03:00
|
|
|
$url = $client->present()->url . '#invoices';
|
|
|
|
|
} else {
|
|
|
|
|
$url = '/invoices';
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return redirect($url);
|
2017-04-04 17:51:01 +03:00
|
|
|
}
|
|
|
|
|
}
|