support multiple invoice repositories (#1084)

This commit is contained in:
Kevin Papst
2019-09-04 22:50:53 +02:00
committed by GitHub
parent 3f27ab1e44
commit 3ea05cb705
29 changed files with 323 additions and 144 deletions

View File

@@ -11,10 +11,21 @@ namespace App\Invoice\Calculator;
use App\Entity\Timesheet;
use App\Invoice\InvoiceItem;
use App\Invoice\InvoiceItemInterface;
abstract class AbstractMergedCalculator extends AbstractCalculator
{
/**
* @deprecated since 1.3 - will be removed with 2.0
*/
protected function mergeTimesheets(InvoiceItem $invoiceItem, Timesheet $entry)
{
@trigger_error('mergeTimesheets() is deprecated and will be removed with 2.0', E_USER_DEPRECATED);
$this->mergeInvoiceItems($invoiceItem, $entry);
}
protected function mergeInvoiceItems(InvoiceItem $invoiceItem, InvoiceItemInterface $entry)
{
$invoiceItem->setAmount($invoiceItem->getAmount() + 1);
$invoiceItem->setUser($entry->getUser());