mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Merge branch 'develop' of github.com:hillelcoren/invoice-ninja into develop
This commit is contained in:
commit
ea2f154b1f
@ -166,12 +166,12 @@ class DashboardApiController extends BaseAPIController
|
|||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
'id' => 1,
|
'id' => 1,
|
||||||
'paidToDate' => $paidToDate[0]->value,
|
'paidToDate' => $paidToDate[0]->value ? $paidToDate[0]->value : 0,
|
||||||
'paidToDateCurrency' => $paidToDate[0]->currency_id,
|
'paidToDateCurrency' => $paidToDate[0]->currency_id ? $paidToDate[0]->currency_id : 0,
|
||||||
'balances' => $balances[0]->value,
|
'balances' => $balances[0]->value ? $balances[0]->value : 0,
|
||||||
'balancesCurrency' => $balances[0]->currency_id,
|
'balancesCurrency' => $balances[0]->currency_id ? $balances[0]->currency_id : 0,
|
||||||
'averageInvoice' => $averageInvoice[0]->invoice_avg,
|
'averageInvoice' => $averageInvoice[0]->invoice_avg ? $averageInvoice[0]->invoice_avg : 0,
|
||||||
'averageInvoiceCurrency' => $averageInvoice[0]->currency_id,
|
'averageInvoiceCurrency' => $averageInvoice[0]->currency_id ? $averageInvoice[0]->currency_id : 0,
|
||||||
'invoicesSent' => $metrics ? $metrics->invoices_sent : 0,
|
'invoicesSent' => $metrics ? $metrics->invoices_sent : 0,
|
||||||
'activeClients' => $metrics ? $metrics->active_clients : 0,
|
'activeClients' => $metrics ? $metrics->active_clients : 0,
|
||||||
];
|
];
|
||||||
|
40
app/Http/Controllers/DocumentAPIController.php
Normal file
40
app/Http/Controllers/DocumentAPIController.php
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
<?php namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use App\Models\Document;
|
||||||
|
|
||||||
|
class DocumentAPIController extends BaseAPIController
|
||||||
|
{
|
||||||
|
|
||||||
|
public function __construct()
|
||||||
|
{
|
||||||
|
parent::__construct();
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public function index()
|
||||||
|
{
|
||||||
|
//stub
|
||||||
|
}
|
||||||
|
|
||||||
|
public function show($publicId)
|
||||||
|
{
|
||||||
|
$document = Document::scope($publicId)->firstOrFail();
|
||||||
|
|
||||||
|
return DocumentController::getDownloadResponse($document);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function store()
|
||||||
|
{
|
||||||
|
//stub
|
||||||
|
}
|
||||||
|
|
||||||
|
public function update()
|
||||||
|
{
|
||||||
|
//stub
|
||||||
|
}
|
||||||
|
|
||||||
|
public function destroy($publicId)
|
||||||
|
{
|
||||||
|
//stub
|
||||||
|
}
|
||||||
|
}
|
@ -284,6 +284,7 @@ Route::group(['middleware' => 'api', 'prefix' => 'api/v1'], function()
|
|||||||
Route::post('add_token', 'AccountApiController@addDeviceToken');
|
Route::post('add_token', 'AccountApiController@addDeviceToken');
|
||||||
Route::post('update_notifications', 'AccountApiController@updatePushNotifications');
|
Route::post('update_notifications', 'AccountApiController@updatePushNotifications');
|
||||||
Route::get('dashboard', 'DashboardApiController@index');
|
Route::get('dashboard', 'DashboardApiController@index');
|
||||||
|
Route::resource('documents', 'DocumentAPIController');
|
||||||
|
|
||||||
// Vendor
|
// Vendor
|
||||||
Route::resource('vendors', 'VendorApiController');
|
Route::resource('vendors', 'VendorApiController');
|
||||||
|
Loading…
x
Reference in New Issue
Block a user