mirror of
https://github.com/solidtime-io/solidtime.git
synced 2026-08-14 03:02:15 +01:00
Added estimated time to clockify project import
This commit is contained in:
@@ -43,6 +43,7 @@ class ClockifyProjectsImporter extends DefaultImporter
|
|||||||
'color' => $this->colorService->getRandomColor(),
|
'color' => $this->colorService->getRandomColor(),
|
||||||
'is_billable' => $record['Billability'] === 'Yes',
|
'is_billable' => $record['Billability'] === 'Yes',
|
||||||
'billable_rate' => $billableRateKey !== null && $record[$billableRateKey] !== '' ? (int) (((float) $record[$billableRateKey]) * 100) : null,
|
'billable_rate' => $billableRateKey !== null && $record[$billableRateKey] !== '' ? (int) (((float) $record[$billableRateKey]) * 100) : null,
|
||||||
|
'estimated_time' => $record['Estimated (h)'] !== '' && is_numeric($record['Estimated (h)']) ? (int) ($record['Estimated (h)'] * 3600) : null,
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,3 @@
|
|||||||
"Project","Client","Status","Visibility","Billability","Task","Tracked (h)","Estimated (h)","Remaining (h)","Overage (h)","Progress(%)","Billable (h)","Non-billable (h)","Billable Rate (USD)","Amount (USD)","Project members","Project manager","Note"
|
"Project","Client","Status","Visibility","Billability","Task","Tracked (h)","Estimated (h)","Remaining (h)","Overage (h)","Progress(%)","Billable (h)","Non-billable (h)","Billable Rate (USD)","Amount (USD)","Project members","Project manager","Note"
|
||||||
"Project for Big Company","Big Company","Active","Public","Yes","Task 1, Task 2, Task 3","0.00","","","","","0.00","0.00","100.01","0.00","Constantin Graf","",""
|
"Project for Big Company","Big Company","Active","Public","Yes","Task 1, Task 2, Task 3","0.00","1001.11","","","","0.00","0.00","100.01","0.00","Constantin Graf","",""
|
||||||
"Project without Client","","Active","Public","Yes","","0.00","","","","","0.00","0.00","","0.00","Constantin Graf","",""
|
"Project without Client","","Active","Public","Yes","","0.00","","","","","0.00","0.00","","0.00","Constantin Graf","",""
|
||||||
|
|||||||
|
@@ -147,10 +147,12 @@ class ImporterTestAbstract extends TestCase
|
|||||||
$project1 = $projects->firstWhere('name', 'Project without Client');
|
$project1 = $projects->firstWhere('name', 'Project without Client');
|
||||||
$this->assertNotNull($project1);
|
$this->assertNotNull($project1);
|
||||||
$this->assertNull($project1->client_id);
|
$this->assertNull($project1->client_id);
|
||||||
|
$this->assertSame(null, $project1->estimated_time);
|
||||||
$project2 = $projects->firstWhere('name', 'Project for Big Company');
|
$project2 = $projects->firstWhere('name', 'Project for Big Company');
|
||||||
$this->assertNotNull($project2);
|
$this->assertNotNull($project2);
|
||||||
$this->assertSame(10001, $project2->billable_rate);
|
$this->assertSame(10001, $project2->billable_rate);
|
||||||
$this->assertSame($client1->getKey(), $project2->client_id);
|
$this->assertSame($client1->getKey(), $project2->client_id);
|
||||||
|
$this->assertSame(3603996, $project2->estimated_time);
|
||||||
$tasks = Task::all();
|
$tasks = Task::all();
|
||||||
$this->assertCount(3, $tasks);
|
$this->assertCount(3, $tasks);
|
||||||
$task1 = $tasks->firstWhere('name', 'Task 1');
|
$task1 = $tasks->firstWhere('name', 'Task 1');
|
||||||
|
|||||||
Reference in New Issue
Block a user