mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-01 01:04:43 -04:00
Fixes for System Log Filter types
This commit is contained in:
parent
d575fac950
commit
79ef62fefb
@ -34,11 +34,6 @@ class SystemLogFilters extends QueryFilters
|
|||||||
return $this->builder->where('event_id', $event_id);
|
return $this->builder->where('event_id', $event_id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function client_id(int $client_id) :Builder
|
|
||||||
{
|
|
||||||
return $this->builder->where('client_id', $client_id);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Filter based on search text.
|
* Filter based on search text.
|
||||||
*
|
*
|
||||||
|
@ -30,6 +30,7 @@ use App\Providers\MailServiceProvider;
|
|||||||
use App\Utils\Ninja;
|
use App\Utils\Ninja;
|
||||||
use App\Utils\Traits\MakesHash;
|
use App\Utils\Traits\MakesHash;
|
||||||
use Dacastro4\LaravelGmail\Facade\LaravelGmail;
|
use Dacastro4\LaravelGmail\Facade\LaravelGmail;
|
||||||
|
use GuzzleHttp\Exception\ClientException;
|
||||||
use Illuminate\Bus\Queueable;
|
use Illuminate\Bus\Queueable;
|
||||||
use Illuminate\Contracts\Queue\ShouldQueue;
|
use Illuminate\Contracts\Queue\ShouldQueue;
|
||||||
use Illuminate\Foundation\Bus\Dispatchable;
|
use Illuminate\Foundation\Bus\Dispatchable;
|
||||||
@ -118,10 +119,18 @@ class NinjaMailerJob implements ShouldQueue
|
|||||||
|
|
||||||
nlog("error failed with {$e->getMessage()}");
|
nlog("error failed with {$e->getMessage()}");
|
||||||
|
|
||||||
if($this->nmo->entity)
|
$message = $e->getMessage();
|
||||||
$this->entityEmailFailed($e->getMessage());
|
|
||||||
|
|
||||||
if(Ninja::isHosted())
|
if($e instanceof ClientException) { //postmark specific failure
|
||||||
|
|
||||||
|
$response = $e->getResponse();
|
||||||
|
$message = $response->Message;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($this->nmo->entity)
|
||||||
|
$this->entityEmailFailed($message);
|
||||||
|
|
||||||
|
if(Ninja::isHosted() && (!$e instanceof ClientException)) // Don't send postmark failures to Sentry
|
||||||
app('sentry')->captureException($e);
|
app('sentry')->captureException($e);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -241,6 +250,7 @@ class NinjaMailerJob implements ShouldQueue
|
|||||||
|
|
||||||
private function logMailError($errors, $recipient_object)
|
private function logMailError($errors, $recipient_object)
|
||||||
{
|
{
|
||||||
|
|
||||||
SystemLogger::dispatch(
|
SystemLogger::dispatch(
|
||||||
$errors,
|
$errors,
|
||||||
SystemLog::CATEGORY_MAIL,
|
SystemLog::CATEGORY_MAIL,
|
||||||
@ -249,19 +259,18 @@ class NinjaMailerJob implements ShouldQueue
|
|||||||
$recipient_object,
|
$recipient_object,
|
||||||
$this->nmo->company
|
$this->nmo->company
|
||||||
);
|
);
|
||||||
}
|
|
||||||
|
|
||||||
public function failed($exception = null)
|
|
||||||
{
|
|
||||||
nlog('mailer job failed');
|
|
||||||
nlog($exception->getMessage());
|
|
||||||
|
|
||||||
$job_failure = new EmailFailure($this->nmo->company->company_key);
|
$job_failure = new EmailFailure($this->nmo->company->company_key);
|
||||||
$job_failure->string_metric5 = 'failed_email';
|
$job_failure->string_metric5 = 'failed_email';
|
||||||
$job_failure->string_metric6 = substr($exception->getMessage(), 0, 150);
|
$job_failure->string_metric6 = substr($errors, 0, 150);
|
||||||
|
|
||||||
LightLogs::create($job_failure)
|
LightLogs::create($job_failure)
|
||||||
->batch();
|
->batch();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function failed($exception = null)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
@ -301,7 +301,10 @@ trait MakesInvoiceValues
|
|||||||
$data[$key][$table_type . ".{$_table_type}3"] = $helpers->formatCustomFieldValue($this->client->company->custom_fields, "{$_table_type}3", $item->custom_value3, $this->client);
|
$data[$key][$table_type . ".{$_table_type}3"] = $helpers->formatCustomFieldValue($this->client->company->custom_fields, "{$_table_type}3", $item->custom_value3, $this->client);
|
||||||
$data[$key][$table_type . ".{$_table_type}4"] = $helpers->formatCustomFieldValue($this->client->company->custom_fields, "{$_table_type}4", $item->custom_value4, $this->client);
|
$data[$key][$table_type . ".{$_table_type}4"] = $helpers->formatCustomFieldValue($this->client->company->custom_fields, "{$_table_type}4", $item->custom_value4, $this->client);
|
||||||
|
|
||||||
$data[$key][$table_type.'.quantity'] = Number::formatValue($item->quantity, $this->client->currency());
|
//$data[$key][$table_type.'.quantity'] = Number::formatValue($item->quantity, $this->client->currency());
|
||||||
|
|
||||||
|
//change quantity from localized number, to decimal format with no trailing zeroes 06/09/21
|
||||||
|
$data[$key][$table_type.'.quantity'] = rtrim($item->quantity, "0");
|
||||||
|
|
||||||
$data[$key][$table_type.'.unit_cost'] = Number::formatMoney($item->cost, $this->client);
|
$data[$key][$table_type.'.unit_cost'] = Number::formatMoney($item->cost, $this->client);
|
||||||
$data[$key][$table_type.'.cost'] = Number::formatMoney($item->cost, $this->client);
|
$data[$key][$table_type.'.cost'] = Number::formatMoney($item->cost, $this->client);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user