do not include running entries in invoices (#2551)
This commit is contained in:
@@ -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());
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user