Minor Updates
This commit is contained in:
parent
9954ce482e
commit
1e481e051b
|
|
@ -39,6 +39,7 @@ use App\Jobs\Invoice\InvoiceCheckLateWebhook;
|
||||||
use App\Jobs\Subscription\CleanStaleInvoiceOrder;
|
use App\Jobs\Subscription\CleanStaleInvoiceOrder;
|
||||||
use App\PaymentDrivers\Rotessa\Jobs\TransactionReport;
|
use App\PaymentDrivers\Rotessa\Jobs\TransactionReport;
|
||||||
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
|
||||||
|
use App\Console\Commands\CreateElasticIndex;
|
||||||
|
|
||||||
class Kernel extends ConsoleKernel
|
class Kernel extends ConsoleKernel
|
||||||
{
|
{
|
||||||
|
|
@ -155,4 +156,5 @@ class Kernel extends ConsoleKernel
|
||||||
|
|
||||||
require base_path('routes/console.php');
|
require base_path('routes/console.php');
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,63 @@
|
||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Elastic\Index;
|
||||||
|
|
||||||
|
class EntityIndex
|
||||||
|
{
|
||||||
|
|
||||||
|
public array $mapping = [
|
||||||
|
'properties' => [
|
||||||
|
'id' => [ 'type' => 'text' ],
|
||||||
|
'name' => [ 'type' => 'text' ],
|
||||||
|
'hashed_id' => [ 'type' => 'text' ],
|
||||||
|
'number' => [ 'type' => 'text' ],
|
||||||
|
'is_deleted' => [ 'type' => 'boolean' ],
|
||||||
|
'amount' => [ 'type' => 'long' ],
|
||||||
|
'balance' => [ 'type' => 'long' ],
|
||||||
|
'due_date' => [ 'type' => 'date' ],
|
||||||
|
'date' => [ 'type' => 'date' ],
|
||||||
|
'custom_value1' => [ 'type' => 'text' ],
|
||||||
|
'custom_value2' => [ 'type' => 'text' ],
|
||||||
|
'custom_value3' => [ 'type' => 'text' ],
|
||||||
|
'custom_value4' => [ 'type' => 'text' ],
|
||||||
|
'company_key' => [ 'type' => 'text' ],
|
||||||
|
'po_number' => [ 'type' => 'text' ],
|
||||||
|
'line_items' => [
|
||||||
|
'type' => 'nested',
|
||||||
|
'properties' => [
|
||||||
|
'product_key' => [ 'type' => 'text' ],
|
||||||
|
'notes' => [ 'type' => 'text' ],
|
||||||
|
'cost' => [ 'type' => 'long' ],
|
||||||
|
'product_cost' => [ 'type' => 'long' ],
|
||||||
|
'is_amount_discount' => [ 'type' => 'boolean' ],
|
||||||
|
'line_total' => [ 'type' => 'long' ],
|
||||||
|
'gross_line_total' => [ 'type' => 'long' ],
|
||||||
|
'tax_amount' => [ 'type' => 'long' ],
|
||||||
|
'quantity' => [ 'type' => 'float' ],
|
||||||
|
'discount' => [ 'type' => 'float' ],
|
||||||
|
'tax_name1' => [ 'type' => 'text' ],
|
||||||
|
'tax_rate1' => [ 'type' => 'float' ],
|
||||||
|
'tax_name2' => [ 'type' => 'text' ],
|
||||||
|
'tax_rate2' => [ 'type' => 'float' ],
|
||||||
|
'tax_name3' => [ 'type' => 'text' ],
|
||||||
|
'tax_rate3' => [ 'type' => 'float' ],
|
||||||
|
'custom_value1' => [ 'type' => 'text' ],
|
||||||
|
'custom_value2' => [ 'type' => 'text' ],
|
||||||
|
'custom_value3' => [ 'type' => 'text' ],
|
||||||
|
'custom_value4' => [ 'type' => 'text' ],
|
||||||
|
'type_id' => [ 'type' => 'text' ],
|
||||||
|
'tax_id' => [ 'type' => 'text' ],
|
||||||
|
'task_id' => [ 'type' => 'text' ],
|
||||||
|
'expense_id' => [ 'type' => 'text' ],
|
||||||
|
'unit_code' => [ 'type' => 'text' ],
|
||||||
|
]
|
||||||
|
]
|
||||||
|
]
|
||||||
|
];
|
||||||
|
|
||||||
|
public function create(string $index_name): void
|
||||||
|
{
|
||||||
|
\Elastic\Migrations\Facades\Index::createRaw($index_name, $this->mapping);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
@ -22,6 +22,7 @@ class BlackListRule implements ValidationRule
|
||||||
{
|
{
|
||||||
/** Bad domains +/- disposable email domains */
|
/** Bad domains +/- disposable email domains */
|
||||||
private array $blacklist = [
|
private array $blacklist = [
|
||||||
|
"tabletship.com",
|
||||||
"tiktook.lol",
|
"tiktook.lol",
|
||||||
"0-mail.com",
|
"0-mail.com",
|
||||||
"027168.com",
|
"027168.com",
|
||||||
|
|
|
||||||
|
|
@ -43,6 +43,6 @@ class PaymentBalanceActivity implements ShouldQueue
|
||||||
|
|
||||||
public function middleware($event): array
|
public function middleware($event): array
|
||||||
{
|
{
|
||||||
return [(new WithoutOverlapping($event->payment->client->client_hash))->releaseAfter(60)];
|
return [(new WithoutOverlapping($event->payment->client->client_hash))->releaseAfter(60)->expireAfter(60)];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@
|
||||||
namespace App\Models;
|
namespace App\Models;
|
||||||
|
|
||||||
use App\Utils\Ninja;
|
use App\Utils\Ninja;
|
||||||
use Laravel\Scout\Searchable;
|
use Elastic\ScoutDriverPlus\Searchable;
|
||||||
use Illuminate\Support\Carbon;
|
use Illuminate\Support\Carbon;
|
||||||
use App\DataMapper\InvoiceSync;
|
use App\DataMapper\InvoiceSync;
|
||||||
use App\Helpers\Invoice\InvoiceSum;
|
use App\Helpers\Invoice\InvoiceSum;
|
||||||
|
|
@ -149,6 +149,7 @@ class Invoice extends BaseModel
|
||||||
use ActionsInvoice;
|
use ActionsInvoice;
|
||||||
use Searchable;
|
use Searchable;
|
||||||
|
|
||||||
|
|
||||||
protected $presenter = EntityPresenter::class;
|
protected $presenter = EntityPresenter::class;
|
||||||
|
|
||||||
protected $touches = [];
|
protected $touches = [];
|
||||||
|
|
@ -244,6 +245,11 @@ class Invoice extends BaseModel
|
||||||
|
|
||||||
public const STATUS_UNPAID = -2; //status < 4 || < 3 && !is_deleted && !trashed()
|
public const STATUS_UNPAID = -2; //status < 4 || < 3 && !is_deleted && !trashed()
|
||||||
|
|
||||||
|
// public function searchableAs()
|
||||||
|
// {
|
||||||
|
// return 'invoices_index'; // for when we need to rename
|
||||||
|
// }
|
||||||
|
|
||||||
public function toSearchableArray()
|
public function toSearchableArray()
|
||||||
{
|
{
|
||||||
$locale = $this->company->locale();
|
$locale = $this->company->locale();
|
||||||
|
|
@ -265,6 +271,7 @@ class Invoice extends BaseModel
|
||||||
'custom_value4' => (string)$this->custom_value4,
|
'custom_value4' => (string)$this->custom_value4,
|
||||||
'company_key' => $this->company->company_key,
|
'company_key' => $this->company->company_key,
|
||||||
'po_number' => (string)$this->po_number,
|
'po_number' => (string)$this->po_number,
|
||||||
|
'line_items' => $this->line_items,
|
||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -456,6 +463,7 @@ class Invoice extends BaseModel
|
||||||
|
|
||||||
public function getStatusAttribute()
|
public function getStatusAttribute()
|
||||||
{
|
{
|
||||||
|
|
||||||
$due_date = $this->due_date ? Carbon::parse($this->due_date) : false;
|
$due_date = $this->due_date ? Carbon::parse($this->due_date) : false;
|
||||||
$partial_due_date = $this->partial_due_date ? Carbon::parse($this->partial_due_date) : false;
|
$partial_due_date = $this->partial_due_date ? Carbon::parse($this->partial_due_date) : false;
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,9 @@
|
||||||
"authorizenet/authorizenet": "^2.0",
|
"authorizenet/authorizenet": "^2.0",
|
||||||
"awobaz/compoships": "^2.1",
|
"awobaz/compoships": "^2.1",
|
||||||
"aws/aws-sdk-php": "^3.319",
|
"aws/aws-sdk-php": "^3.319",
|
||||||
|
"babenkoivan/elastic-migrations": "^4.0",
|
||||||
"babenkoivan/elastic-scout-driver": "^4.0",
|
"babenkoivan/elastic-scout-driver": "^4.0",
|
||||||
|
"babenkoivan/elastic-scout-driver-plus": "^5.1",
|
||||||
"bacon/bacon-qr-code": "^2.0",
|
"bacon/bacon-qr-code": "^2.0",
|
||||||
"beganovich/snappdf": "dev-master",
|
"beganovich/snappdf": "dev-master",
|
||||||
"braintree/braintree_php": "^6.23",
|
"braintree/braintree_php": "^6.23",
|
||||||
|
|
@ -114,7 +116,8 @@
|
||||||
"twig/twig": "^3.14",
|
"twig/twig": "^3.14",
|
||||||
"twilio/sdk": "^6.40",
|
"twilio/sdk": "^6.40",
|
||||||
"wikimedia/composer-merge-plugin": "^2.1",
|
"wikimedia/composer-merge-plugin": "^2.1",
|
||||||
"wildbit/postmark-php": "^4.0"
|
"wildbit/postmark-php": "^4.0",
|
||||||
|
"invoiceninja/admin-api": "dev-main"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"barryvdh/laravel-debugbar": "^3.6",
|
"barryvdh/laravel-debugbar": "^3.6",
|
||||||
|
|
@ -224,9 +227,8 @@
|
||||||
"url": "https://github.com/turbo124/snappdf"
|
"url": "https://github.com/turbo124/snappdf"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"type": "vcs",
|
"type": "path",
|
||||||
"url": "https://github.com/invoiceninja/admin-api"
|
"url": "../admin-api"
|
||||||
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"minimum-stability": "dev",
|
"minimum-stability": "dev",
|
||||||
|
|
|
||||||
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue