This commit is contained in:
Denis Duliçi 2021-02-26 11:34:34 +03:00
parent 4a6d1b412e
commit 19093668ec
2 changed files with 7 additions and 7 deletions

View File

@ -372,7 +372,7 @@ class Transaction extends Model
*/ */
public function getRouteIdAttribute($value) public function getRouteIdAttribute($value)
{ {
return $value ?? $this->document_id ?? $this->id; return !empty($value) ? $value : (!empty($this->document_id) ? $this->document_id : $this->id);
} }
/** /**

View File

@ -27,7 +27,7 @@ trait Import
$id = $this->getAccountIdFromCurrency($row); $id = $this->getAccountIdFromCurrency($row);
} }
return (int) $id; return is_null($id) ? $id : (int) $id;
} }
public function getCategoryId($row, $type = null) public function getCategoryId($row, $type = null)
@ -40,7 +40,7 @@ trait Import
$id = $this->getCategoryIdFromName($row, $type); $id = $this->getCategoryIdFromName($row, $type);
} }
return (int) $id; return is_null($id) ? $id : (int) $id;
} }
public function getContactId($row, $type = null) public function getContactId($row, $type = null)
@ -57,7 +57,7 @@ trait Import
$id = $this->getContactIdFromName($row, $type); $id = $this->getContactIdFromName($row, $type);
} }
return (int) $id; return is_null($id) ? $id : (int) $id;
} }
public function getDocumentId($row) public function getDocumentId($row)
@ -84,7 +84,7 @@ trait Import
} }
} }
return $id == null ? null : (int) $id; return is_null($id) ? $id : (int) $id;
} }
public function getItemId($row) public function getItemId($row)
@ -95,7 +95,7 @@ trait Import
$id = $this->getItemIdFromName($row); $id = $this->getItemIdFromName($row);
} }
return (int) $id; return is_null($id) ? $id : (int) $id;
} }
public function getTaxId($row) public function getTaxId($row)
@ -110,7 +110,7 @@ trait Import
$id = $this->getTaxIdFromRate($row); $id = $this->getTaxIdFromRate($row);
} }
return (int) $id; return is_null($id) ? $id : (int) $id;
} }
public function getAccountIdFromCurrency($row) public function getAccountIdFromCurrency($row)