1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00

Handle restoring a deleted invoice

This commit is contained in:
David Bomba 2020-12-18 07:11:31 +11:00
parent d3cdfd670f
commit adab53ed97
2 changed files with 4 additions and 1 deletions

View File

@ -94,6 +94,9 @@ class HandleRestore extends AbstractService
$new_invoice_number = substr($this->invoice->number, 0, $pos);
if(strlen($new_invoice_number) == 0)
$new_invoice_number = null;
try {
$this->invoice->number = $new_invoice_number;
$this->invoice->save();

View File

@ -48,7 +48,7 @@ class ProjectTransformer extends EntityTransformer
'assigned_user_id' => (string) $this->encodePrimaryKey($project->assigned_user_id),
'client_id' => (string) $this->encodePrimaryKey($project->client_id),
'name' => $project->name ?: '',
'number' => $project->number,
'number' => $project->number ?: '',
'created_at' => (int) $project->created_at,
'updated_at' => (int) $project->updated_at,
'archived_at' => (int) $project->deleted_at,