mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-04 04:57:35 -05:00 
			
		
		
		
	QuotesController: Allow approving only quotes with STATUS_SENT
This commit is contained in:
		
							parent
							
								
									f35ed86299
								
							
						
					
					
						commit
						1a5c40d02e
					
				@ -24,6 +24,7 @@ use App\Utils\TempFile;
 | 
			
		||||
use App\Utils\Traits\MakesHash;
 | 
			
		||||
use Illuminate\Contracts\View\Factory;
 | 
			
		||||
use Illuminate\View\View;
 | 
			
		||||
use Symfony\Component\HttpFoundation\BinaryFileResponse;
 | 
			
		||||
use ZipStream\Option\Archive;
 | 
			
		||||
use ZipStream\ZipStream;
 | 
			
		||||
 | 
			
		||||
@ -46,7 +47,7 @@ class QuoteController extends Controller
 | 
			
		||||
     *
 | 
			
		||||
     * @param ShowQuoteRequest $request
 | 
			
		||||
     * @param Quote $quote
 | 
			
		||||
     * @return Factory|View|\Symfony\Component\HttpFoundation\BinaryFileResponse
 | 
			
		||||
     * @return Factory|View|BinaryFileResponse
 | 
			
		||||
     */
 | 
			
		||||
    public function show(ShowQuoteRequest $request, Quote $quote)
 | 
			
		||||
    {
 | 
			
		||||
@ -110,7 +111,9 @@ class QuoteController extends Controller
 | 
			
		||||
    protected function approve(array $ids, $process = false)
 | 
			
		||||
    {
 | 
			
		||||
        $quotes = Quote::whereIn('id', $ids)
 | 
			
		||||
            ->whereClientId(auth()->user()->client->id)
 | 
			
		||||
            ->where('client_id', auth('contact')->user()->client->id)
 | 
			
		||||
            ->where('company_id', auth('contact')->user()->client->company_id)
 | 
			
		||||
            ->where('status_id', Quote::STATUS_SENT)
 | 
			
		||||
            ->get();
 | 
			
		||||
 | 
			
		||||
        if (!$quotes || $quotes->count() == 0) {
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user