Improve UX for invoice template management (#4121)

change translations and to explain that calculator actually group items by fields
This commit is contained in:
Kevin Papst
2023-06-21 08:17:54 +02:00
committed by GitHub
parent 983bf2c88b
commit dd89363c72
33 changed files with 889 additions and 324 deletions

View File

@@ -15,8 +15,8 @@ use App\Entity\InvoiceTemplate;
use App\Entity\Project;
use App\Entity\Timesheet;
use App\Entity\User;
use App\Invoice\Calculator\DateInvoiceCalculator;
use App\Invoice\Calculator\PriceInvoiceCalculator;
use App\Invoice\CalculatorInterface;
use App\Repository\Query\InvoiceQuery;
use App\Tests\Invoice\DebugFormatter;
use App\Tests\Mocks\InvoiceModelFactoryFactory;
@@ -30,12 +30,12 @@ use DateTime;
*/
class PriceInvoiceCalculatorTest extends AbstractCalculatorTest
{
public function testEmptyModel()
protected function getCalculator(): CalculatorInterface
{
$this->assertEmptyModel(new DateInvoiceCalculator());
return new PriceInvoiceCalculator();
}
public function testWithMultipleEntries()
public function testWithMultipleEntries(): void
{
$customer = new Customer('foo');
$template = new InvoiceTemplate();
@@ -118,7 +118,7 @@ class PriceInvoiceCalculatorTest extends AbstractCalculatorTest
$model->addEntries($entries);
$model->setQuery($query);
$sut = new PriceInvoiceCalculator();
$sut = $this->getCalculator();
$sut->setModel($model);
$this->assertEquals('price', $sut->getId());
@@ -136,8 +136,8 @@ class PriceInvoiceCalculatorTest extends AbstractCalculatorTest
$this->assertEquals(84, $entries[3]->getRate());
}
public function testDescriptionByTimesheet()
public function testDescriptionByTimesheet(): void
{
$this->assertDescription(new PriceInvoiceCalculator(), false, false);
$this->assertDescription($this->getCalculator(), false, false);
}
}