Release 1.20.1 (#3317)

- improved timesheet calculator with changesets and priority
- calculate and include exported stats (e.g. available in export templates)
- added hourly rate column to timesheet listing
This commit is contained in:
Kevin Papst
2022-05-21 13:13:56 +02:00
committed by GitHub
parent 3e6100f368
commit d5f8655827
15 changed files with 277 additions and 43 deletions

View File

@@ -28,17 +28,25 @@ abstract class AbstractTimesheetCountedStatisticTest extends TestCase
self::assertSame(0.0, $sut->getRateBillable());
self::assertSame(0, $sut->getRecordAmountBillable());
self::assertSame(0.0, $sut->getInternalRateBillable());
self::assertSame(0, $sut->getDurationBillableExported());
self::assertSame(0, $sut->getDurationExported());
self::assertSame(0.0, $sut->getRateExported());
self::assertSame(0.0, $sut->getInternalRateExported());
$json = $sut->jsonSerialize();
$expected = [
'duration' => 0,
'duration_billable' => 0,
'duration_exported' => 0,
'duration_billable_exported' => 0,
'rate' => 0.0,
'rate_billable' => 0.0,
'rate_exported' => 0.0,
'rate_internal' => 0.0,
'amount' => 0,
'amount_billable' => 0,
'amount_exported' => 0,
];
foreach ($expected as $key => $value) {
@@ -55,12 +63,22 @@ abstract class AbstractTimesheetCountedStatisticTest extends TestCase
$sut->setRecordAmountBillable(15);
self::assertInstanceOf(TimesheetCountedStatistic::class, $sut->setRecordInternalRate(99.09));
$sut->setDurationBillableExported(199);
$sut->setDurationExported(299);
$sut->setRateExported(456.48);
$sut->setInternalRateExported(27.15);
self::assertSame(23.97, $sut->getRecordRate());
self::assertSame(21, $sut->getRecordDuration());
self::assertSame(5, $sut->getRecordAmount());
self::assertSame(15, $sut->getRecordAmountBillable());
self::assertSame(99.09, $sut->getRecordInternalRate());
self::assertSame(199, $sut->getDurationBillableExported());
self::assertSame(299, $sut->getDurationExported());
self::assertSame(456.48, $sut->getRateExported());
self::assertSame(27.15, $sut->getInternalRateExported());
self::assertSame(21, $sut->getValue());
$sut->setCounter(524);
@@ -93,15 +111,24 @@ abstract class AbstractTimesheetCountedStatisticTest extends TestCase
$sut->setDurationBillable(1234);
$sut->setRecordAmountBillable(4321);
$sut->setDurationBillableExported(199);
$sut->setRateBillableExported(654.23);
$sut->setDurationExported(299);
$sut->setRateExported(456.48);
$sut->setInternalRateExported(27.15);
$json = $sut->jsonSerialize();
foreach (['duration', 'duration_billable', 'rate', 'rate_billable', 'rate_internal', 'amount', 'amount_billable'] as $key) {
foreach (['duration', 'duration_billable', 'duration_exported', 'rate', 'rate_billable', 'rate_billable_exported', 'rate_exported', 'rate_internal', 'amount', 'amount_billable', 'amount_exported'] as $key) {
self::assertArrayHasKey($key, $json);
}
self::assertSame(21, $json['duration']);
self::assertSame(1234, $json['duration_billable']);
self::assertSame(199, $json['duration_billable_exported']);
self::assertSame(299, $json['duration_exported']);
self::assertSame(23.97, $json['rate']);
self::assertSame(123.456, $json['rate_billable']);
self::assertSame(654.23, $json['rate_billable_exported']);
self::assertSame(99.09, $json['rate_internal']);
self::assertSame(5, $json['amount']);
self::assertSame(4321, $json['amount_billable']);