mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Fixes for find user in import
This commit is contained in:
parent
a6d7584e14
commit
3285eb4862
@ -732,6 +732,15 @@ class BaseImport
|
||||
|
||||
protected function findUser($user_hash)
|
||||
{
|
||||
if(is_numeric($user_hash)) {
|
||||
|
||||
$user = User::query()->find($user_hash);
|
||||
|
||||
}
|
||||
|
||||
if($user)
|
||||
return $user->id;
|
||||
|
||||
$user = User::where('account_id', $this->company->account->id)
|
||||
->where(
|
||||
\DB::raw('CONCAT_WS(" ", first_name, last_name)')->getValue(\DB::connection()->getQueryGrammar()),
|
||||
|
@ -238,14 +238,15 @@ class BaseTransformer
|
||||
*/
|
||||
public function hasClient($name)
|
||||
{
|
||||
nlog("has client");
|
||||
return Client::query()->where('company_id', $this->company->id)
|
||||
->where('is_deleted', false)
|
||||
->whereRaw("LOWER(REPLACE(`name`, ' ' ,'')) = ?", [
|
||||
->whereRaw("LOWER(REPLACE(`name`, ' ' , '')) = ?", [
|
||||
strtolower(str_replace(' ', '', $name)),
|
||||
])
|
||||
->exists();
|
||||
}
|
||||
|
||||
|
||||
public function hasClientIdNumber($id_number)
|
||||
{
|
||||
return Client::query()->where('company_id', $this->company->id)
|
||||
|
@ -903,7 +903,7 @@ class EventTest extends TestCase
|
||||
$response = $this->withHeaders([
|
||||
'X-API-SECRET' => config('ninja.api_secret'),
|
||||
'X-API-TOKEN' => $this->token,
|
||||
])->postJson('/api/v1/purchase_orders/bulk?action=approve', $data)
|
||||
])->postJson('/api/v1/purchase_orders/bulk?action=mark_sent', $data)
|
||||
->assertStatus(200);
|
||||
|
||||
$response = $this->withHeaders([
|
||||
|
Loading…
x
Reference in New Issue
Block a user