mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-04 00:17:34 -05:00 
			
		
		
		
	Show 'No quotes avialable for download' instead of blank page
This commit is contained in:
		
							parent
							
								
									7f7120af6b
								
							
						
					
					
						commit
						033e74da7d
					
				@ -85,7 +85,9 @@ class QuoteController extends Controller
 | 
				
			|||||||
            ->get();
 | 
					            ->get();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if (! $quotes || $quotes->count() == 0) {
 | 
					        if (! $quotes || $quotes->count() == 0) {
 | 
				
			||||||
            return;
 | 
					            return redirect()
 | 
				
			||||||
 | 
					                ->route('client.quotes.index')
 | 
				
			||||||
 | 
					                ->with('message', ctrans('texts.no_quotes_available_for_download'));
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        if ($quotes->count() == 1) {
 | 
					        if ($quotes->count() == 1) {
 | 
				
			||||||
 | 
				
			|||||||
@ -4279,6 +4279,7 @@ $LANG = array(
 | 
				
			|||||||
    'recurring_purchases' => 'Recurring purchases',
 | 
					    'recurring_purchases' => 'Recurring purchases',
 | 
				
			||||||
    'you_might_be_interested_in_following' => 'You might be interested in following',
 | 
					    'you_might_be_interested_in_following' => 'You might be interested in following',
 | 
				
			||||||
    'quotes_with_status_sent_can_be_approved' => 'Only quotes with "Sent" status can be approved.',
 | 
					    'quotes_with_status_sent_can_be_approved' => 'Only quotes with "Sent" status can be approved.',
 | 
				
			||||||
 | 
					    'no_quotes_available_for_download' => 'No quotes available for download.',
 | 
				
			||||||
);
 | 
					);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
return $LANG;
 | 
					return $LANG;
 | 
				
			||||||
 | 
				
			|||||||
@ -93,4 +93,14 @@ class QuotesTest extends DuskTestCase
 | 
				
			|||||||
                ->visitRoute('client.logout');
 | 
					                ->visitRoute('client.logout');
 | 
				
			||||||
        });
 | 
					        });
 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    public function testNoQuotesAvailableForDownloadMessage()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        $this->browse(function (Browser $browser) {
 | 
				
			||||||
 | 
					            $browser
 | 
				
			||||||
 | 
					                ->visitRoute('client.quotes.index')
 | 
				
			||||||
 | 
					                ->press('Download')
 | 
				
			||||||
 | 
					                ->assertSee('No quotes available for download.');
 | 
				
			||||||
 | 
					        });
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user