mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 10:34:30 -04:00
Fixes for document upload from company
This commit is contained in:
parent
3b02dd56e0
commit
b5807d8d9c
@ -22,9 +22,11 @@ trait SavesDocuments
|
|||||||
if ($entity instanceof Company) {
|
if ($entity instanceof Company) {
|
||||||
$account = $entity->account;
|
$account = $entity->account;
|
||||||
$company = $entity;
|
$company = $entity;
|
||||||
|
$user = auth()->user();
|
||||||
} else {
|
} else {
|
||||||
$account = $entity->company->account;
|
$account = $entity->company->account;
|
||||||
$company = $entity->company;
|
$company = $entity->company;
|
||||||
|
$user = $entity->user;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $account->hasFeature(Account::FEATURE_DOCUMENTS)) {
|
if (! $account->hasFeature(Account::FEATURE_DOCUMENTS)) {
|
||||||
@ -35,8 +37,8 @@ trait SavesDocuments
|
|||||||
$document = UploadFile::dispatchNow(
|
$document = UploadFile::dispatchNow(
|
||||||
$document,
|
$document,
|
||||||
UploadFile::DOCUMENT,
|
UploadFile::DOCUMENT,
|
||||||
$entity->user,
|
$user,
|
||||||
$entity->company,
|
$company,
|
||||||
$entity,
|
$entity,
|
||||||
null,
|
null,
|
||||||
$is_public
|
$is_public
|
||||||
@ -49,9 +51,11 @@ trait SavesDocuments
|
|||||||
if ($entity instanceof Company) {
|
if ($entity instanceof Company) {
|
||||||
$account = $entity->account;
|
$account = $entity->account;
|
||||||
$company = $entity;
|
$company = $entity;
|
||||||
|
$user = auth()->user();
|
||||||
} else {
|
} else {
|
||||||
$account = $entity->company->account;
|
$account = $entity->company->account;
|
||||||
$company = $entity->company;
|
$company = $entity->company;
|
||||||
|
$user = $entity->user;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (! $account->hasFeature(Account::FEATURE_DOCUMENTS)) {
|
if (! $account->hasFeature(Account::FEATURE_DOCUMENTS)) {
|
||||||
@ -61,8 +65,8 @@ trait SavesDocuments
|
|||||||
$document = UploadFile::dispatchNow(
|
$document = UploadFile::dispatchNow(
|
||||||
$document,
|
$document,
|
||||||
UploadFile::DOCUMENT,
|
UploadFile::DOCUMENT,
|
||||||
$entity->user,
|
$user,
|
||||||
$entity->company,
|
$company,
|
||||||
$entity,
|
$entity,
|
||||||
null,
|
null,
|
||||||
$is_public
|
$is_public
|
||||||
|
Loading…
x
Reference in New Issue
Block a user