mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-10 21:22:58 +01:00
Merge pull request #8032 from turbo124/v5-develop
Add status to client export
This commit is contained in:
commit
ec74e473e5
@ -76,6 +76,7 @@ class ClientExport extends BaseExport
|
||||
'contact_custom_value3' => 'contact.custom_value3',
|
||||
'contact_custom_value4' => 'contact.custom_value4',
|
||||
'email' => 'contact.email',
|
||||
'status' => 'status'
|
||||
];
|
||||
|
||||
private array $decorate_keys = [
|
||||
@ -173,6 +174,19 @@ class ClientExport extends BaseExport
|
||||
$entity['industry_id'] = $client->industry ? ctrans("texts.industry_{$client->industry->name}") : '';
|
||||
}
|
||||
|
||||
$entity['status'] = $this->calculateStatus($client);
|
||||
|
||||
return $entity;
|
||||
}
|
||||
|
||||
private function calculateStatus($client)
|
||||
{
|
||||
if($client->is_deleted)
|
||||
return ctrans('texts.deleted');
|
||||
|
||||
if($client->deleted_at)
|
||||
return ctrans('texts.arcvived');
|
||||
|
||||
return ctrans('texts.active');
|
||||
}
|
||||
}
|
||||
|
@ -56,8 +56,6 @@ class InvoiceFilters extends QueryFilters
|
||||
if (in_array('unpaid', $status_parameters)) {
|
||||
$this->builder->whereIn('status_id', [Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL]);
|
||||
}
|
||||
//->where('due_date', '>', Carbon::now())
|
||||
//->orWhere('partial_due_date', '>', Carbon::now());
|
||||
|
||||
if (in_array('overdue', $status_parameters)) {
|
||||
$this->builder->whereIn('status_id', [Invoice::STATUS_SENT, Invoice::STATUS_PARTIAL])
|
||||
|
@ -141,7 +141,13 @@ class VendorTemplateEmail extends Mailable
|
||||
// $this->attach($file['path'], ['as' => $file['name'], 'mime' => null]);
|
||||
// }
|
||||
|
||||
$this->attachData(base64_decode($file['file']), $file['name']);
|
||||
// $this->attachData(base64_decode($file['file']), $file['name']);
|
||||
|
||||
if(array_key_exists('file', $file))
|
||||
$this->attachData(base64_decode($file['file']), $file['name']);
|
||||
else
|
||||
$this->attach($file['path'], ['as' => $file['name'], 'mime' => null]);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
@ -302,7 +302,8 @@ class CheckoutComPaymentDriver extends BaseDriver
|
||||
}
|
||||
|
||||
$phone = new Phone();
|
||||
$phone->number = $this->client->present()->phone();
|
||||
// $phone->number = $this->client->present()->phone();
|
||||
$phone->number = substr(str_pad($this->client->present()->phone(),6, "0", STR_PAD_RIGHT), 0 , 24);
|
||||
|
||||
$request->email = $this->client->present()->email();
|
||||
$request->name = $this->client->present()->name();
|
||||
|
@ -33,7 +33,7 @@ class BankMatchingService implements ShouldQueue
|
||||
{
|
||||
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
|
||||
|
||||
public function __construct(protected int $company_id, private string $db){}
|
||||
public function __construct(public int $company_id, private string $db){}
|
||||
|
||||
public function handle() :void
|
||||
{
|
||||
@ -53,6 +53,8 @@ class BankMatchingService implements ShouldQueue
|
||||
|
||||
public function middleware()
|
||||
{
|
||||
return [new WithoutOverlapping("bank_match_rate:{$this->company_id}")];
|
||||
$middleware_key = "bank_match_rate:{$this->company_id}";
|
||||
|
||||
return [new WithoutOverlapping($middleware_key)];
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user