1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-20 08:21:34 +02:00

Added back API route for quotes

This commit is contained in:
Hillel Coren 2016-06-06 22:17:16 +03:00
parent 3b9b4a049e
commit 7facf518cf
2 changed files with 7 additions and 2 deletions

View File

@ -269,8 +269,7 @@ Route::group(['middleware' => 'api', 'prefix' => 'api/v1'], function()
Route::get('accounts', 'AccountApiController@show');
Route::put('accounts', 'AccountApiController@update');
Route::resource('clients', 'ClientApiController');
//Route::get('quotes', 'QuoteApiController@index');
//Route::resource('quotes', 'QuoteApiController');
Route::get('quotes', 'QuoteApiController@index');
Route::get('invoices', 'InvoiceApiController@index');
Route::get('download/{invoice_id}', 'InvoiceApiController@download');
Route::resource('invoices', 'InvoiceApiController');

View File

@ -234,6 +234,12 @@ class Invoice extends EntityModel implements BalanceAffecting
->where('is_recurring', '=', false);
}
public function scopeQuotes($query)
{
return $query->where('invoice_type_id', '=', INVOICE_TYPE_QUOTE)
->where('is_recurring', '=', false);
}
public function scopeInvoiceType($query, $typeId)
{
return $query->where('invoice_type_id', '=', $typeId);