fixes for tests

This commit is contained in:
Benjamin Beganović 2020-12-23 11:41:57 +01:00
parent a907933d57
commit ada4f3065c
6 changed files with 31 additions and 31 deletions

View File

@ -32,7 +32,6 @@ use Illuminate\Support\Facades\Artisan;
use Illuminate\Support\Facades\Request;
use Illuminate\Support\Facades\Schema;
use Illuminate\Support\Facades\Storage;
use Spatie\Browsershot\Browsershot;
/**
* Class SetupController.

View File

@ -113,7 +113,6 @@ class CSVImport implements ShouldQueue
info(print_r($data, 1));
MailRouter::dispatch(new ImportCompleted($data), $this->company, auth()->user());
}
public function failed($exception)
@ -184,7 +183,6 @@ info(print_r($data,1));
if ($validator->fails()) {
$this->error_array['invoices'] = ['invoice' => $invoice, 'error' => json_encode($validator->errors())];
} else {
if ($validator->fails()) {
$this->error_array[] = ['invoice' => $invoice, 'error' => json_encode($validator->errors())];
} else {
@ -195,6 +193,7 @@ info(print_r($data,1));
$this->performInvoiceActions($invoice, $record, $invoice_repository);
}
}
}
private function performInvoiceActions($invoice, $record, $invoice_repository)
{

View File

@ -96,7 +96,6 @@ class BaseMailerJob implements ShouldQueue
public function failed($exception = null)
{
info('the job failed');
info($exception->getMessage());

View File

@ -12,7 +12,6 @@
namespace App\Jobs\Mail;
use App\Libraries\MultiDB;
use App\Models\Client;
use App\Models\ClientContact;
use App\Models\Company;
use App\Models\User;
@ -76,8 +75,9 @@ class MailRouter extends BaseMailerJob implements ShouldQueue
} catch (\Exception $e) {
$this->failed($e);
if($this->to_user instanceof ClientContact)
if ($this->to_user instanceof ClientContact) {
$this->logMailError($e->getMessage(), $this->to_user->client);
}
}
}
}

View File

@ -631,9 +631,12 @@ trait MakesInvoiceValues
$data[$key][$table_type . ".{$_table_type}1"] = $helpers->formatCustomFieldValue($this->client->company->custom_fields, "{$_table_type}1", $item->custom_value1, $this->client);
$data[$key][$table_type . ".{$_table_type}2"] = $helpers->formatCustomFieldValue($this->client->company->custom_fields, "{$_table_type}2", $item->custom_value2, $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}2"] = $helpers->formatCustomFieldValue($this->client->company->custom_fields, "{$_table_type}2", $item->custom_value2, $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.'.quantity'] = $item->quantity;