do not include running entries in invoices (#2551)

This commit is contained in:
Kevin Papst
2021-05-04 12:29:20 +02:00
committed by GitHub
parent dad1b8b772
commit 4fcd97b142
3 changed files with 10 additions and 3 deletions

View File

@@ -192,7 +192,6 @@ final class InvoiceController extends AbstractController
$query->setBegin($begin);
$query->setEnd($end);
$query->setExported(InvoiceQuery::STATE_NOT_EXPORTED);
$query->setState(InvoiceQuery::STATE_STOPPED);
// limit access to data from teams
$query->setCurrentUser($this->getUser());

View File

@@ -28,7 +28,11 @@ class InvoiceQuery extends TimesheetQuery
public function __construct()
{
parent::__construct();
$this->setBillable(true);
$this->setDefaults([
'state' => self::STATE_STOPPED,
'billable' => true,
'markAsExported' => false,
]);
}
public function getTemplate(): ?InvoiceTemplate

View File

@@ -30,7 +30,11 @@ class InvoiceQueryTest extends TimesheetQueryTest
$this->assertCustomer($sut);
$this->assertProject($sut);
$this->assertActivity($sut);
$this->assertState($sut);
self::assertEquals(InvoiceQuery::STATE_STOPPED, $sut->getState());
self::assertFalse($sut->isRunning());
self::assertTrue($sut->isStopped());
$this->assertExported($sut);
$this->assertMarkAsExported($sut);
$this->assertModifiedAfter($sut);