Improve UX for invoice template management (#4121)
change translations and to explain that calculator actually group items by fields
This commit is contained in:
@@ -17,6 +17,7 @@ use App\Entity\Tag;
|
||||
use App\Entity\Timesheet;
|
||||
use App\Entity\User;
|
||||
use App\Invoice\Calculator\ShortInvoiceCalculator;
|
||||
use App\Invoice\CalculatorInterface;
|
||||
use App\Invoice\InvoiceItem;
|
||||
use App\Repository\Query\InvoiceQuery;
|
||||
use App\Tests\Invoice\DebugFormatter;
|
||||
@@ -29,12 +30,12 @@ use App\Tests\Mocks\InvoiceModelFactoryFactory;
|
||||
*/
|
||||
class ShortInvoiceCalculatorTest extends AbstractCalculatorTest
|
||||
{
|
||||
public function testEmptyModel()
|
||||
protected function getCalculator(): CalculatorInterface
|
||||
{
|
||||
$this->assertEmptyModel(new ShortInvoiceCalculator());
|
||||
return new ShortInvoiceCalculator();
|
||||
}
|
||||
|
||||
public function testWithMultipleEntries()
|
||||
public function testWithMultipleEntries(): void
|
||||
{
|
||||
$customer = new Customer('foo');
|
||||
$template = new InvoiceTemplate();
|
||||
@@ -97,7 +98,7 @@ class ShortInvoiceCalculatorTest extends AbstractCalculatorTest
|
||||
$model->addEntries($entries);
|
||||
$model->setQuery($query);
|
||||
|
||||
$sut = new ShortInvoiceCalculator();
|
||||
$sut = $this->getCalculator();
|
||||
$sut->setModel($model);
|
||||
|
||||
$this->assertEquals('short', $sut->getId());
|
||||
@@ -119,7 +120,7 @@ class ShortInvoiceCalculatorTest extends AbstractCalculatorTest
|
||||
$this->assertEquals(['foo', 'bar', 'bar1'], $result->getTags());
|
||||
}
|
||||
|
||||
public function testWithMultipleEntriesDifferentRates()
|
||||
public function testWithMultipleEntriesDifferentRates(): void
|
||||
{
|
||||
$customer = new Customer('foo');
|
||||
$template = new InvoiceTemplate();
|
||||
@@ -179,7 +180,7 @@ class ShortInvoiceCalculatorTest extends AbstractCalculatorTest
|
||||
$model->addEntries($entries);
|
||||
$model->setQuery($query);
|
||||
|
||||
$sut = new ShortInvoiceCalculator();
|
||||
$sut = $this->getCalculator();
|
||||
$sut->setModel($model);
|
||||
|
||||
$this->assertEquals('short', $sut->getId());
|
||||
@@ -200,7 +201,7 @@ class ShortInvoiceCalculatorTest extends AbstractCalculatorTest
|
||||
$this->assertEquals(1, $result->getAmount());
|
||||
}
|
||||
|
||||
public function testWithMixedRateTypes()
|
||||
public function testWithMixedRateTypes(): void
|
||||
{
|
||||
$customer = new Customer('foo');
|
||||
$template = new InvoiceTemplate();
|
||||
@@ -258,7 +259,7 @@ class ShortInvoiceCalculatorTest extends AbstractCalculatorTest
|
||||
$model->addEntries($entries);
|
||||
$model->setQuery($query);
|
||||
|
||||
$sut = new ShortInvoiceCalculator();
|
||||
$sut = $this->getCalculator();
|
||||
$sut->setModel($model);
|
||||
|
||||
$this->assertEquals('short', $sut->getId());
|
||||
@@ -279,8 +280,8 @@ class ShortInvoiceCalculatorTest extends AbstractCalculatorTest
|
||||
$this->assertEquals(1, $result->getAmount());
|
||||
}
|
||||
|
||||
public function testDescriptionByTimesheet()
|
||||
public function testDescriptionByTimesheet(): void
|
||||
{
|
||||
$this->assertDescription(new ShortInvoiceCalculator(), false, false);
|
||||
$this->assertDescription($this->getCalculator(), false, false);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user