Merge branch 'master' of github.com:akaunting/akaunting

This commit is contained in:
Cüneyt Şentürk 2023-11-03 15:19:23 +03:00
commit c3800a5700
2 changed files with 5 additions and 3 deletions

View File

@ -49,9 +49,7 @@ abstract class Import implements HasLocalePreference, ShouldQueue, SkipsEmptyRow
$row['company_id'] = company_id();
// created_by is equal to the owner id. Therefore, the value in export is owner email.
if (isset($row['created_by'])) {
$row['created_by'] = $this->getCreatedById($row);
}
$row['created_by'] = $this->getCreatedById($row);
$row['created_from'] = $this->getSourcePrefix() . 'import';

View File

@ -113,6 +113,10 @@ trait Import
public function getCreatedById($row)
{
if (empty($row['created_by'])) {
return $this->user->id;
}
$user = user_model_class()::where('email', $row['created_by'])->first();
if (! empty($user)) {