1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 20:22:42 +01:00

Merge branch 'master' of github.com:hillelcoren/invoice-ninja

This commit is contained in:
Hillel Coren 2016-01-28 14:05:01 +02:00
commit 9d3d58def1
2 changed files with 10 additions and 0 deletions

View File

@ -316,6 +316,15 @@ class InvoiceApiController extends BaseAPIController
return $this->response($data);
}
else if ($request->action == ACTION_RESTORE) {
$invoice = Invoice::scope($publicId)->withTrashed()->firstOrFail();
$this->invoiceRepo->restore($invoice);
$transformer = new InvoiceTransformer(\Auth::user()->account, Input::get('serializer'));
$data = $this->createItem($invoice, $transformer, 'invoice');
return $this->response($data);
}
$data = $request->input();
$data['public_id'] = $publicId;

View File

@ -88,6 +88,7 @@ class InvoiceTransformer extends EntityTransformer
'custom_taxes1' => (bool) $invoice->custom_taxes1,
'custom_taxes2' => (bool) $invoice->custom_taxes2,
'has_expenses' => (bool) $invoice->has_expenses,
'quote_invoice_id' => (int) $invoice->quote_invoice_id,
];
}
}