From 94d68c8b64b0891d481b8dea176d0cef9a8581da Mon Sep 17 00:00:00 2001 From: Kevin Papst Date: Sun, 30 Jun 2019 18:38:02 +0200 Subject: [PATCH] fixed short invoice (#891) --- src/Invoice/Calculator/ShortInvoiceCalculator.php | 3 +++ tests/Invoice/Calculator/ShortInvoiceCalculatorTest.php | 2 ++ 2 files changed, 5 insertions(+) diff --git a/src/Invoice/Calculator/ShortInvoiceCalculator.php b/src/Invoice/Calculator/ShortInvoiceCalculator.php index e9b82d60..16339db4 100644 --- a/src/Invoice/Calculator/ShortInvoiceCalculator.php +++ b/src/Invoice/Calculator/ShortInvoiceCalculator.php @@ -34,6 +34,9 @@ class ShortInvoiceCalculator extends AbstractMergedCalculator implements Calcula $this->mergeTimesheets($timesheet, $entry); } + $timesheet->setFixedRate($timesheet->getRate()); + $timesheet->setHourlyRate($timesheet->getRate()); + return [$timesheet]; } diff --git a/tests/Invoice/Calculator/ShortInvoiceCalculatorTest.php b/tests/Invoice/Calculator/ShortInvoiceCalculatorTest.php index d0c0a885..2f9a4519 100644 --- a/tests/Invoice/Calculator/ShortInvoiceCalculatorTest.php +++ b/tests/Invoice/Calculator/ShortInvoiceCalculatorTest.php @@ -102,7 +102,9 @@ class ShortInvoiceCalculatorTest extends AbstractCalculatorTest /** @var Timesheet $result */ $result = $sut->getEntries()[0]; $this->assertEquals('activity description', $result->getDescription()); + $this->assertEquals(488.38, $result->getHourlyRate()); $this->assertEquals(488.38, $result->getRate()); + $this->assertEquals(488.38, $result->getFixedRate()); $this->assertEquals(5800, $result->getDuration()); }