mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-05-31 23:24:36 -04:00
Additional query filters for invoices
This commit is contained in:
parent
34f2b04e33
commit
e13d867c7f
@ -183,6 +183,48 @@ class InvoiceFilters extends QueryFilters
|
|||||||
->where('client_id', $this->decodePrimaryKey($client_id));
|
->where('client_id', $this->decodePrimaryKey($client_id));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $date
|
||||||
|
* @return Builder
|
||||||
|
* @throws InvalidArgumentException
|
||||||
|
*/
|
||||||
|
public function date(string $date = ''): Builder
|
||||||
|
{
|
||||||
|
if (strlen($date) == 0) {
|
||||||
|
return $this->builder;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (is_numeric($date)) {
|
||||||
|
$created_at = Carbon::createFromTimestamp((int)$date);
|
||||||
|
} else {
|
||||||
|
$created_at = Carbon::parse($date);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->builder->where('date', '>=', $date);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $date
|
||||||
|
* @return Builder
|
||||||
|
* @throws InvalidArgumentException
|
||||||
|
*/
|
||||||
|
public function due_date(string $date = ''): Builder
|
||||||
|
{
|
||||||
|
if (strlen($date) == 0) {
|
||||||
|
return $this->builder;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (is_numeric($date)) {
|
||||||
|
$created_at = Carbon::createFromTimestamp((int)$date);
|
||||||
|
} else {
|
||||||
|
$created_at = Carbon::parse($date);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $this->builder->where('due_date', '>=', $date);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sorts the list based on $sort.
|
* Sorts the list based on $sort.
|
||||||
*
|
*
|
||||||
|
@ -25,6 +25,7 @@ use App\Models\Subscription;
|
|||||||
use App\Repositories\ClientContactRepository;
|
use App\Repositories\ClientContactRepository;
|
||||||
use App\Repositories\ClientRepository;
|
use App\Repositories\ClientRepository;
|
||||||
use App\Utils\Number;
|
use App\Utils\Number;
|
||||||
|
use App\Utils\Traits\MakesHash;
|
||||||
use Illuminate\Support\Facades\Auth;
|
use Illuminate\Support\Facades\Auth;
|
||||||
use Illuminate\Support\Facades\Cache;
|
use Illuminate\Support\Facades\Cache;
|
||||||
use Illuminate\Support\Str;
|
use Illuminate\Support\Str;
|
||||||
@ -34,6 +35,7 @@ use Livewire\Component;
|
|||||||
|
|
||||||
class BillingPortalPurchasev2 extends Component
|
class BillingPortalPurchasev2 extends Component
|
||||||
{
|
{
|
||||||
|
use MakesHash;
|
||||||
/**
|
/**
|
||||||
* Random hash generated by backend to handle the tracking of state.
|
* Random hash generated by backend to handle the tracking of state.
|
||||||
*
|
*
|
||||||
@ -422,6 +424,7 @@ class BillingPortalPurchasev2 extends Component
|
|||||||
$client_repo = new ClientRepository(new ClientContactRepository());
|
$client_repo = new ClientRepository(new ClientContactRepository());
|
||||||
$data = [
|
$data = [
|
||||||
'name' => '',
|
'name' => '',
|
||||||
|
'group_id' => $this->encodePrimaryKey($this->subscription->group_id),
|
||||||
'contacts' => [
|
'contacts' => [
|
||||||
['email' => $this->email],
|
['email' => $this->email],
|
||||||
],
|
],
|
||||||
|
Loading…
x
Reference in New Issue
Block a user