mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-04 04:07:32 -05: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) {
 | 
			
		||||
            $account = $entity->account;
 | 
			
		||||
            $company = $entity;
 | 
			
		||||
            $user = auth()->user();
 | 
			
		||||
        } else {
 | 
			
		||||
            $account = $entity->company->account;
 | 
			
		||||
            $company = $entity->company;
 | 
			
		||||
            $user = $entity->user;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (! $account->hasFeature(Account::FEATURE_DOCUMENTS)) {
 | 
			
		||||
@ -35,8 +37,8 @@ trait SavesDocuments
 | 
			
		||||
            $document = UploadFile::dispatchNow(
 | 
			
		||||
                $document,
 | 
			
		||||
                UploadFile::DOCUMENT,
 | 
			
		||||
                $entity->user,
 | 
			
		||||
                $entity->company,
 | 
			
		||||
                $user,
 | 
			
		||||
                $company,
 | 
			
		||||
                $entity,
 | 
			
		||||
                null,
 | 
			
		||||
                $is_public
 | 
			
		||||
@ -49,9 +51,11 @@ trait SavesDocuments
 | 
			
		||||
        if ($entity instanceof Company) {
 | 
			
		||||
            $account = $entity->account;
 | 
			
		||||
            $company = $entity;
 | 
			
		||||
            $user = auth()->user();
 | 
			
		||||
        } else {
 | 
			
		||||
            $account = $entity->company->account;
 | 
			
		||||
            $company = $entity->company;
 | 
			
		||||
            $user = $entity->user;
 | 
			
		||||
        }
 | 
			
		||||
 | 
			
		||||
        if (! $account->hasFeature(Account::FEATURE_DOCUMENTS)) {
 | 
			
		||||
@ -61,8 +65,8 @@ trait SavesDocuments
 | 
			
		||||
        $document = UploadFile::dispatchNow(
 | 
			
		||||
            $document,
 | 
			
		||||
            UploadFile::DOCUMENT,
 | 
			
		||||
            $entity->user,
 | 
			
		||||
            $entity->company,
 | 
			
		||||
            $user,
 | 
			
		||||
            $company,
 | 
			
		||||
            $entity,
 | 
			
		||||
            null,
 | 
			
		||||
            $is_public
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user