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

Fixes for demo

This commit is contained in:
David Bomba 2021-01-25 07:46:53 +11:00
parent 6bc2ca470c
commit b54c3a5b22
2 changed files with 20 additions and 4 deletions

View File

@ -307,6 +307,14 @@ class DemoMode extends Command
'client_id' => $client->id,
'company_id' => $client->company_id,
]);
Expense::all()->each(function ($expense){
$expense->number = $this->getNextExpenseNumber($expense);
$expense->save();
});
}
private function createVendor($client, $assigned_user_id = null)
@ -329,15 +337,23 @@ class DemoMode extends Command
'company_id' => $client->company_id,
'is_primary' => 0,
]);
$vendor->id_number = $this->getNextVendorNumber($vendor);
$vendor->save();
}
private function createTask($client, $assigned_user_id = null)
{
$vendor = Task::factory()->create([
$task = Task::factory()->create([
'user_id' => $client->user->id,
'company_id' => $client->company_id,
'client_id' => $client->id
]);
$task->number = $this->getNextTaskNumber($task);
$task->save();
}
private function createProject($client, $assigned_user_id = null)

View File

@ -98,12 +98,12 @@ class VendorTransformer extends EntityTransformer
'custom_value3' => $vendor->custom_value3 ?: '',
'custom_value4' => $vendor->custom_value4 ?: '',
'is_deleted' => (bool) $vendor->is_deleted,
'vat_number' => $vendor->vat_number ?: '',
'id_number' => $vendor->id_number ?: '',
'vat_number' => (string) $vendor->vat_number ?: '',
'id_number' => (string) $vendor->id_number ?: '',
'updated_at' => (int) $vendor->updated_at,
'archived_at' => (int) $vendor->deleted_at,
'created_at' => (int) $vendor->created_at,
'number' => (string)$vendor->number ?: '',
'number' => (string) $vendor->number ?: '',
];
}
}