invoiceninja/app/Ninja/Intents/WebApp/CreateInvoiceIntent.php

28 lines
636 B
PHP
Raw Permalink Normal View History

2017-04-04 12:54:38 +03:00
<?php
namespace App\Ninja\Intents\WebApp;
2017-04-04 16:57:33 +03:00
use App\Models\Invoice;
2017-04-04 12:54:38 +03:00
use App\Models\EntityModel;
use App\Ninja\Intents\InvoiceIntent;
use Exception;
class CreateInvoiceIntent extends InvoiceIntent
{
public function process()
{
$client = $this->requestClient();
2017-04-04 16:57:33 +03:00
$clientPublicId = $client ? $client->public_id : null;
2017-04-04 12:54:38 +03:00
2017-04-04 16:57:33 +03:00
//$invoiceItems = $this->requestInvoiceItems();
$url = '/invoices/create/' . $clientPublicId . '?';
2017-04-04 17:51:01 +03:00
$url .= $this->requestFieldsAsString(Invoice::$requestFields);
2017-04-04 12:54:38 +03:00
2017-04-05 22:20:11 +03:00
$url = rtrim($url, '?');
$url = rtrim($url, '&');
2017-04-04 16:57:33 +03:00
return redirect($url);
2017-04-04 12:54:38 +03:00
}
}