mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-08 23:44:28 -04:00
commit
2a39fee1c6
@ -9,7 +9,7 @@ class DashboardApiController extends BaseAPIController
|
||||
{
|
||||
public function index()
|
||||
{
|
||||
$view_all = !Auth::user()->hasPermission('view_all');
|
||||
$view_all = Auth::user()->hasPermission('view_all');
|
||||
$user_id = Auth::user()->id;
|
||||
|
||||
// total_income, billed_clients, invoice_sent and active_clients
|
||||
@ -157,13 +157,12 @@ class DashboardApiController extends BaseAPIController
|
||||
$hasQuotes = false;
|
||||
foreach ([$upcoming, $pastDue] as $data) {
|
||||
foreach ($data as $invoice) {
|
||||
if ($invoice->isType(INVOICE_TYPE_QUOTE)) {
|
||||
if ($invoice->invoice_type_id == INVOICE_TYPE_QUOTE) {
|
||||
$hasQuotes = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
$data = [
|
||||
'id' => 1,
|
||||
'paidToDate' => $paidToDate[0]->value ? $paidToDate[0]->value : 0,
|
||||
|
@ -33,6 +33,7 @@ class DocumentAPIController extends BaseAPIController
|
||||
|
||||
public function store(CreateDocumentRequest $request)
|
||||
{
|
||||
|
||||
$document = $this->documentRepo->upload($request->all());
|
||||
|
||||
return $this->itemResponse($document);
|
||||
|
@ -14,6 +14,7 @@ class DocumentTransformer extends EntityTransformer
|
||||
'type' => $document->type,
|
||||
'invoice_id' => isset($document->invoice->public_id) ? (int) $document->invoice->public_id : null,
|
||||
'expense_id' => isset($document->expense->public_id) ? (int) $document->expense->public_id : null,
|
||||
'updated_at' => $this->getTimestamp($document->updated_at),
|
||||
]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user