Release 1.6.2 (#1289)
* include user teams in user entity * prevent unauthorized access via API * improve teamlead permission handling in team timesheets * add team data to user entity * add security tests * highlight menu for invoice template copy * unified handling of invoice data across all templates * access to the current users data in invoice templates * permission improvement in invoice form * allow to skip record rows * allow to add new invoice locations without overwriting the global ones * allow to order user preferences * change permission for normal users with access to view_other_timesheets * properly validate invoice template field length * allow to replace multiple variables in cell values text * upgraded office invoice template * doctrine deprecation fix * upgrade phpoffice/phpword * fix future begin check for default rounding rules * dashboard widget counter: respect visibility and teams - fixes #1161 * fix future begin check for default rounding rules * added new events for pre and post invoice rendering * fix permission issue for users without team seeing all records * prevent error in spreadsheet renderer for empty invoices
This commit is contained in:
@@ -11,14 +11,12 @@ namespace App\Tests\Invoice\Renderer;
|
||||
|
||||
use App\Entity\InvoiceDocument;
|
||||
use App\Invoice\InvoiceModel;
|
||||
use App\Invoice\Renderer\RendererTrait;
|
||||
use App\Invoice\Renderer\AbstractRenderer;
|
||||
use App\Invoice\RendererInterface;
|
||||
use Symfony\Component\HttpFoundation\Response;
|
||||
|
||||
class DebugRenderer implements RendererInterface
|
||||
class DebugRenderer extends AbstractRenderer implements RendererInterface
|
||||
{
|
||||
use RendererTrait;
|
||||
|
||||
/**
|
||||
* @return string[]
|
||||
*/
|
||||
@@ -35,60 +33,6 @@ class DebugRenderer implements RendererInterface
|
||||
return 'array';
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \DateTime $date
|
||||
* @return mixed
|
||||
*/
|
||||
protected function getFormattedDateTime(\DateTime $date)
|
||||
{
|
||||
return $date->format('d.m.Y');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \DateTime $date
|
||||
* @return mixed
|
||||
*/
|
||||
protected function getFormattedTime(\DateTime $date)
|
||||
{
|
||||
return $date->format('H:i');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $amount
|
||||
* @return mixed
|
||||
*/
|
||||
protected function getFormattedMoney($amount)
|
||||
{
|
||||
return $amount;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param \DateTime $date
|
||||
* @return mixed
|
||||
*/
|
||||
protected function getFormattedMonthName(\DateTime $date)
|
||||
{
|
||||
return $date->format('m');
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $seconds
|
||||
* @return mixed
|
||||
*/
|
||||
protected function getFormattedDuration($seconds)
|
||||
{
|
||||
return $seconds;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $seconds
|
||||
* @return mixed
|
||||
*/
|
||||
protected function getFormattedDecimalDuration($seconds)
|
||||
{
|
||||
return $seconds;
|
||||
}
|
||||
|
||||
/**
|
||||
* Render the given InvoiceDocument with the data from the InvoiceModel into a stupid array for testing only.
|
||||
*
|
||||
@@ -99,12 +43,12 @@ class DebugRenderer implements RendererInterface
|
||||
public function render(InvoiceDocument $document, InvoiceModel $model): Response
|
||||
{
|
||||
$result = [
|
||||
'model' => $this->modelToReplacer($model),
|
||||
'model' => $model->toArray(),
|
||||
'entries' => [],
|
||||
];
|
||||
|
||||
foreach ($model->getCalculator()->getEntries() as $entry) {
|
||||
$result['entries'][] = $this->timesheetToArray($entry);
|
||||
$result['entries'][] = $model->itemToArray($entry);
|
||||
}
|
||||
|
||||
return new Response(json_encode($result));
|
||||
|
||||
Reference in New Issue
Block a user