mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Merge branch 'develop' of github.com:invoiceninja/invoiceninja into develop
This commit is contained in:
commit
1ae25c4ec7
@ -21,6 +21,7 @@ class DashboardApiController extends BaseAPIController
|
|||||||
$viewAll = $user->hasPermission('view_all');
|
$viewAll = $user->hasPermission('view_all');
|
||||||
$userId = $user->id;
|
$userId = $user->id;
|
||||||
$accountId = $user->account->id;
|
$accountId = $user->account->id;
|
||||||
|
$defaultCurrency = $user->account->currency_id;
|
||||||
|
|
||||||
$dashboardRepo = $this->dashboardRepo;
|
$dashboardRepo = $this->dashboardRepo;
|
||||||
$metrics = $dashboardRepo->totals($accountId, $userId, $viewAll);
|
$metrics = $dashboardRepo->totals($accountId, $userId, $viewAll);
|
||||||
@ -44,11 +45,11 @@ class DashboardApiController extends BaseAPIController
|
|||||||
$data = [
|
$data = [
|
||||||
'id' => 1,
|
'id' => 1,
|
||||||
'paidToDate' => $paidToDate->count() && $paidToDate[0]->value ? $paidToDate[0]->value : 0,
|
'paidToDate' => $paidToDate->count() && $paidToDate[0]->value ? $paidToDate[0]->value : 0,
|
||||||
'paidToDateCurrency' => $paidToDate->count() && $paidToDate[0]->currency_id ? $paidToDate[0]->currency_id : 0,
|
'paidToDateCurrency' => $paidToDate->count() && $paidToDate[0]->currency_id ? $paidToDate[0]->currency_id : $defaultCurrency,
|
||||||
'balances' => $balances->count() && $balances[0]->value ? $balances[0]->value : 0,
|
'balances' => $balances->count() && $balances[0]->value ? $balances[0]->value : 0,
|
||||||
'balancesCurrency' => $balances->count() && $balances[0]->currency_id ? $balances[0]->currency_id : 0,
|
'balancesCurrency' => $balances->count() && $balances[0]->currency_id ? $balances[0]->currency_id : $defaultCurrency,
|
||||||
'averageInvoice' => $averageInvoice->count() && $averageInvoice[0]->invoice_avg ? $averageInvoice[0]->invoice_avg : 0,
|
'averageInvoice' => $averageInvoice->count() && $averageInvoice[0]->invoice_avg ? $averageInvoice[0]->invoice_avg : 0,
|
||||||
'averageInvoiceCurrency' => $averageInvoice->count() && $averageInvoice[0]->currency_id ? $averageInvoice[0]->currency_id : 0,
|
'averageInvoiceCurrency' => $averageInvoice->count() && $averageInvoice[0]->currency_id ? $averageInvoice[0]->currency_id : $defaultCurrency,
|
||||||
'invoicesSent' => $metrics ? $metrics->invoices_sent : 0,
|
'invoicesSent' => $metrics ? $metrics->invoices_sent : 0,
|
||||||
'activeClients' => $metrics ? $metrics->active_clients : 0,
|
'activeClients' => $metrics ? $metrics->active_clients : 0,
|
||||||
'activities' => $this->createCollection($activities, new ActivityTransformer(), ENTITY_ACTIVITY),
|
'activities' => $this->createCollection($activities, new ActivityTransformer(), ENTITY_ACTIVITY),
|
||||||
|
@ -149,6 +149,9 @@ class TaskApiController extends BaseAPIController
|
|||||||
*/
|
*/
|
||||||
public function update(UpdateTaskRequest $request)
|
public function update(UpdateTaskRequest $request)
|
||||||
{
|
{
|
||||||
|
if ($request->action) {
|
||||||
|
return $this->handleAction($request);
|
||||||
|
}
|
||||||
|
|
||||||
$task = $request->entity();
|
$task = $request->entity();
|
||||||
|
|
||||||
|
@ -34,6 +34,7 @@ class ProductTransformer extends EntityTransformer
|
|||||||
'archived_at' => $this->getTimestamp($product->deleted_at),
|
'archived_at' => $this->getTimestamp($product->deleted_at),
|
||||||
'custom_value1' => $product->custom_value1,
|
'custom_value1' => $product->custom_value1,
|
||||||
'custom_value2' => $product->custom_value2,
|
'custom_value2' => $product->custom_value2,
|
||||||
|
'is_deleted' => (bool) $product->is_deleted,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user