autofixes

This commit is contained in:
Dennis Eichhorn 2020-08-30 20:13:10 +02:00
parent 2a6fb2905e
commit 5650c455f9
9 changed files with 145 additions and 139 deletions

View File

@ -27,5 +27,6 @@ use phpOMS\Stdlib\Base\Enum;
abstract class HelperStatus extends Enum abstract class HelperStatus extends Enum
{ {
public const INACTIVE = 0; public const INACTIVE = 0;
public const ACTIVE = 1; public const ACTIVE = 1;
} }

View File

@ -27,6 +27,8 @@ use phpOMS\Stdlib\Base\Enum;
abstract class PermissionState extends Enum abstract class PermissionState extends Enum
{ {
public const TEMPLATE = 1; public const TEMPLATE = 1;
public const REPORT = 2; public const REPORT = 2;
public const EXPORT = 3; public const EXPORT = 3;
} }

View File

@ -26,7 +26,7 @@ echo $this->getData('nav')->render(); ?>
<ul class="l-1"> <ul class="l-1">
<li> <li>
<a tabindex="0" href="<?= \phpOMS\Uri\UriFactory::build('{/prefix}helper/single?{?}&id=' . $this->getData('name')); ?>" <a tabindex="0" href="<?= \phpOMS\Uri\UriFactory::build('{/prefix}helper/single?{?}&id=' . $this->getData('name')); ?>"
class="button"><?= $this->getHtml('Report') ?></a> class="button"><?= $this->getHtml('Report'); ?></a>
</ul> </ul>
</div> </div>
</div> </div>

View File

@ -28,14 +28,14 @@ echo $this->getData('nav')->render(); ?>
<div class="row"> <div class="row">
<div class="col-xs-12"> <div class="col-xs-12">
<div class="portlet"> <div class="portlet">
<div class="portlet-head"><?= $this->getHtml('Helpers') ?><i class="fa fa-download floatRight download btn"></i></div> <div class="portlet-head"><?= $this->getHtml('Helpers'); ?><i class="fa fa-download floatRight download btn"></i></div>
<table class="default"> <table class="default">
<thead> <thead>
<tr> <tr>
<td class="wf-100"><?= $this->getHtml('Name') ?> <td class="wf-100"><?= $this->getHtml('Name'); ?>
<td><?= $this->getHtml('Tag'); ?> <td><?= $this->getHtml('Tag'); ?>
<td><?= $this->getHtml('Creator') ?> <td><?= $this->getHtml('Creator'); ?>
<td><?= $this->getHtml('Updated') ?> <td><?= $this->getHtml('Updated'); ?>
<tbody> <tbody>
<?php if (\count($templates) == 0) : ?> <?php if (\count($templates) == 0) : ?>
<tr tabindex="0" class="empty"> <tr tabindex="0" class="empty">
@ -44,13 +44,13 @@ echo $this->getData('nav')->render(); ?>
<?php foreach ($templates as $key => $template) : <?php foreach ($templates as $key => $template) :
$url = UriFactory::build('{/prefix}helper/report/view?{?}&id=' . $template->getId()); ?> $url = UriFactory::build('{/prefix}helper/report/view?{?}&id=' . $template->getId()); ?>
<tr tabindex="0" data-href="<?= $url; ?>"> <tr tabindex="0" data-href="<?= $url; ?>">
<td data-label="<?= $this->getHtml('Name') ?>"><a href="<?= $url; ?>"><?= $this->printHtml($template->getName()); ?></a> <td data-label="<?= $this->getHtml('Name'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($template->getName()); ?></a>
<td data-label="<?= $this->getHtml('Tag') ?>"> <td data-label="<?= $this->getHtml('Tag'); ?>">
<?php $tags = $template->getTags(); foreach ($tags as $tag) : ?> <?php $tags = $template->getTags(); foreach ($tags as $tag) : ?>
<span class="tag" style="background: <?= $this->printHtml($tag->getColor()); ?>"><?= $this->printHtml($tag->getTitle()); ?></span> <span class="tag" style="background: <?= $this->printHtml($tag->getColor()); ?>"><?= $this->printHtml($tag->getTitle()); ?></span>
<?php endforeach; ?> <?php endforeach; ?>
<td data-label="<?= $this->getHtml('Creator') ?>"><a href="<?= $url; ?>"><?= $this->printHtml($template->getCreatedBy()->getName1()); ?></a> <td data-label="<?= $this->getHtml('Creator'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($template->getCreatedBy()->getName1()); ?></a>
<td data-label="<?= $this->getHtml('Updated') ?>"><a href="<?= $url; ?>"><?= $this->printHtml($template->getCreatedAt()->format('Y-m-d')); ?></a> <td data-label="<?= $this->getHtml('Updated'); ?>"><a href="<?= $url; ?>"><?= $this->printHtml($template->getCreatedAt()->format('Y-m-d')); ?></a>
<?php endforeach; ?> <?php endforeach; ?>
</table> </table>
<div class="portlet-foot"> <div class="portlet-foot">

View File

@ -36,7 +36,7 @@ echo $this->getData('nav')->render(); ?>
</div> </div>
<div class="col-xs-12 col-md-3"> <div class="col-xs-12 col-md-3">
<div class="portlet"> <div class="portlet">
<div class="portlet-head"><?= $this->getHtml('Reports') ?></div> <div class="portlet-head"><?= $this->getHtml('Reports'); ?></div>
<div class="portlet-body"> <div class="portlet-body">
<form action="<?= UriFactory::build('{/api}helper/template'); ?>" method="post"> <form action="<?= UriFactory::build('{/api}helper/template'); ?>" method="post">
<table class="layout wf-100"> <table class="layout wf-100">
@ -61,7 +61,7 @@ echo $this->getData('nav')->render(); ?>
</div> </div>
<div class="portlet"> <div class="portlet">
<div class="portlet-head"><?= $this->getHtml('Export') ?></div> <div class="portlet-head"><?= $this->getHtml('Export'); ?></div>
<div class="portlet-body"> <div class="portlet-body">
<form> <form>
<table class="layout wf-100"> <table class="layout wf-100">
@ -90,7 +90,7 @@ echo $this->getData('nav')->render(); ?>
<?php if (!empty($settings)) : ?> <?php if (!empty($settings)) : ?>
<div class="portlet"> <div class="portlet">
<form id="iUiSettings"> <form id="iUiSettings">
<div class="portlet-head"><?= $this->getHtml('Settings') ?></div> <div class="portlet-head"><?= $this->getHtml('Settings'); ?></div>
<div class="portlet-body"> <div class="portlet-body">
<table class="layout wf-100"> <table class="layout wf-100">
<tbody> <tbody>
@ -100,19 +100,19 @@ echo $this->getData('nav')->render(); ?>
<?php endforeach; ?> <?php endforeach; ?>
</table> </table>
</div> </div>
<div class="portlet-foot"><a tabindex="0" class="button" href="<?= UriFactory::build('{%}');?>&type={!#iExport}&lang={!#iLang}{#iUiSettings}"><?= $this->getHtml('Load'); ?></a></div> <div class="portlet-foot"><a tabindex="0" class="button" href="<?= UriFactory::build('{%}'); ?>&type={!#iExport}&lang={!#iLang}{#iUiSettings}"><?= $this->getHtml('Load'); ?></a></div>
</form> </form>
</div> </div>
<?php endif; ?> <?php endif; ?>
<div class="portlet"> <div class="portlet">
<div class="portlet-head"><?= $this->getHtml('Info') ?></div> <div class="portlet-head"><?= $this->getHtml('Info'); ?></div>
<div class="portlet-body"> <div class="portlet-body">
<table class="list wf-100"> <table class="list wf-100">
<tbody> <tbody>
<?php if (!$template->isStandalone() && !($report instanceof \Modules\Helper\Models\NullReport)) : ?> <?php if (!$template->isStandalone() && !($report instanceof \Modules\Helper\Models\NullReport)) : ?>
<tr> <tr>
<th colspan="2"><?= $this->getHtml('Report') ?> <th colspan="2"><?= $this->getHtml('Report'); ?>
<tr> <tr>
<td><?= $this->getHtml('Name'); ?> <td><?= $this->getHtml('Name'); ?>
<td><?= $this->printHtml($report->getTitle()); ?> <td><?= $this->printHtml($report->getTitle()); ?>
@ -124,7 +124,7 @@ echo $this->getData('nav')->render(); ?>
<td><?= $report->getCreatedAt()->format('Y-m-d'); ?> <td><?= $report->getCreatedAt()->format('Y-m-d'); ?>
<?php endif; ?> <?php endif; ?>
<tr> <tr>
<th colspan="2"><?= $this->getHtml('Template') ?> <th colspan="2"><?= $this->getHtml('Template'); ?>
<tr> <tr>
<td><?= $this->getHtml('Name'); ?> <td><?= $this->getHtml('Name'); ?>
<td><?= $this->printHtml($template->getName()); ?> <td><?= $this->printHtml($template->getName()); ?>

View File

@ -20,6 +20,7 @@ namespace Modules\Helper\tests\Admin;
class AdminTest extends \PHPUnit\Framework\TestCase class AdminTest extends \PHPUnit\Framework\TestCase
{ {
protected const MODULE_NAME = 'Helper'; protected const MODULE_NAME = 'Helper';
protected const URI_LOAD = 'http://127.0.0.1/en/backend/helper'; protected const URI_LOAD = 'http://127.0.0.1/en/backend/helper';
use \Modules\tests\ModuleTestTrait; use \Modules\tests\ModuleTestTrait;

View File

@ -32,6 +32,7 @@ use phpOMS\Utils\TestUtils;
class ControllerTest extends \PHPUnit\Framework\TestCase class ControllerTest extends \PHPUnit\Framework\TestCase
{ {
protected $app = null; protected $app = null;
protected $module = null; protected $module = null;
protected function setUp() : void protected function setUp() : void

View File

@ -18,15 +18,15 @@ require 'Worker.php';
<div class="tabview tab-2"> <div class="tabview tab-2">
<div class="box"> <div class="box">
<ul class="tab-links"> <ul class="tab-links">
<li><label for="c-tab-1"><?= $lang['Overview'] ?></label></li> <li><label for="c-tab-1"><?= $lang['Overview']; ?></label></li>
<li><label for="c-tab-2"><?= $lang['Type'] ?></label></li> <li><label for="c-tab-2"><?= $lang['Type']; ?></label></li>
<li><label for="c-tab-3"><?= $lang['CostObject'] ?></label></li> <li><label for="c-tab-3"><?= $lang['CostObject']; ?></label></li>
<li><label for="c-tab-4"><?= $lang['CostCenter'] ?></label></li> <li><label for="c-tab-4"><?= $lang['CostCenter']; ?></label></li>
<li><label for="c-tab-5"><?= $lang['Account'] ?></label></li> <li><label for="c-tab-5"><?= $lang['Account']; ?></label></li>
</ul> </ul>
</div> </div>
<div class="tab-content"> <div class="tab-content">
<input type="radio" id="c-tab-1" name="tabular-2"<?= $this->request->getUri()->getFragment() === 'c-tab-1' ? ' checked' : '' ?>> <input type="radio" id="c-tab-1" name="tabular-2"<?= $this->request->getUri()->getFragment() === 'c-tab-1' ? ' checked' : ''; ?>>
<div class="tab"> <div class="tab">
<div class="box"> <div class="box">
<table class="default"> <table class="default">
@ -41,40 +41,40 @@ require 'Worker.php';
<td><?= $lang['DiffBudget%']; ?> <td><?= $lang['DiffBudget%']; ?>
<tbody> <tbody>
<tr> <tr>
<td><?= 'EventCourseInt' ?> <td><?= 'EventCourseInt'; ?>
<td><?= '?' ?> <td><?= '?'; ?>
<td><?= \number_format($type['A'][$fiscal_end->format('Y')]['value'] ?? 0, 2, ',', '.') ?> <td><?= \number_format($type['A'][$fiscal_end->format('Y')]['value'] ?? 0, 2, ',', '.'); ?>
<td><?= \number_format(0.00 / $month * 12, 2) ?> <td><?= \number_format(0.00 / $month * 12, 2); ?>
<td><?= \number_format(0.00, 2) ?> <td><?= \number_format(0.00, 2); ?>
<td><?= '100.00%' ?> <td><?= '100.00%'; ?>
<tr> <tr>
<td><?= 'EventCourse' ?> <td><?= 'EventCourse'; ?>
<td><?= '?' ?> <td><?= '?'; ?>
<td><?= \number_format(($type['K'][$fiscal_end->format('Y')]['value'] ?? 0) + ($type['R'][$fiscal_end->format('Y')]['value'] ?? 0) + ($type['V'][$fiscal_end->format('Y')]['value'] ?? 0), 2, ',', '.') ?> <td><?= \number_format(($type['K'][$fiscal_end->format('Y')]['value'] ?? 0) + ($type['R'][$fiscal_end->format('Y')]['value'] ?? 0) + ($type['V'][$fiscal_end->format('Y')]['value'] ?? 0), 2, ',', '.'); ?>
<td><?= \number_format(0.00 / $month * 12, 2) ?> <td><?= \number_format(0.00 / $month * 12, 2); ?>
<td><?= \number_format(0.00, 2) ?> <td><?= \number_format(0.00, 2); ?>
<td><?= '100.00%' ?> <td><?= '100.00%'; ?>
<tr> <tr>
<td><?= 'Demo' ?> <td><?= 'Demo'; ?>
<td><?= '?' ?> <td><?= '?'; ?>
<td><?= \number_format($type['D'][$fiscal_end->format('Y')]['value'] ?? 0, 2, ',', '.') ?> <td><?= \number_format($type['D'][$fiscal_end->format('Y')]['value'] ?? 0, 2, ',', '.'); ?>
<td><?= \number_format(0.00 / $month * 12, 2) ?> <td><?= \number_format(0.00 / $month * 12, 2); ?>
<td><?= \number_format(0.00, 2) ?> <td><?= \number_format(0.00, 2); ?>
<td><?= '100.00%' ?> <td><?= '100.00%'; ?>
<tr> <tr>
<td><?= 'Briefing' ?> <td><?= 'Briefing'; ?>
<td><?= '?' ?> <td><?= '?'; ?>
<td><?= \number_format($type['E'][$fiscal_end->format('Y')]['value'] ?? 0, 2, ',', '.') ?> <td><?= \number_format($type['E'][$fiscal_end->format('Y')]['value'] ?? 0, 2, ',', '.'); ?>
<td><?= \number_format(0.00 / $month * 12, 2) ?> <td><?= \number_format(0.00 / $month * 12, 2); ?>
<td><?= \number_format(0.00, 2) ?> <td><?= \number_format(0.00, 2); ?>
<td><?= '100.00%' ?> <td><?= '100.00%'; ?>
<tr> <tr>
<td><?= 'Advice' ?> <td><?= 'Advice'; ?>
<td><?= '?' ?> <td><?= '?'; ?>
<td><?= \number_format($type['B'][$fiscal_end->format('Y')]['value'] ?? 0, 2, ',', '.') ?> <td><?= \number_format($type['B'][$fiscal_end->format('Y')]['value'] ?? 0, 2, ',', '.'); ?>
<td><?= \number_format(0.00 / $month * 12, 2) ?> <td><?= \number_format(0.00 / $month * 12, 2); ?>
<td><?= \number_format(0.00, 2) ?> <td><?= \number_format(0.00, 2); ?>
<td><?= '100.00%' ?> <td><?= '100.00%'; ?>
</table> </table>
</div> </div>
@ -96,12 +96,12 @@ require 'Worker.php';
$sum_forecast = 0.0; $sum_forecast = 0.0;
foreach ($types as $key => $stype) : ?> foreach ($types as $key => $stype) : ?>
<tr> <tr>
<td><?= $key ?> <td><?= $key; ?>
<td><?= $stype ?> <td><?= $stype; ?>
<td><?= (\number_format($history = $type[$key][$fiscal_end_prev->format('Y')]['value'] ?? 0.0, 2, ',', '.')) ?> <td><?= (\number_format($history = $type[$key][$fiscal_end_prev->format('Y')]['value'] ?? 0.0, 2, ',', '.')); ?>
<td><?= (\number_format($current = $type[$key][$fiscal_end->format('Y')]['value'] ?? 0.0, 2, ',', '.')) ?> <td><?= (\number_format($current = $type[$key][$fiscal_end->format('Y')]['value'] ?? 0.0, 2, ',', '.')); ?>
<td><?= (\number_format($forecast = ($type[$key][$fiscal_end->format('Y')]['value'] ?? 0.0) / \abs(((int) $fiscal_current->format('m') - ((int) $fiscal_end->format('m') + 1)) % 12 + 1) * 12, 2, ',', '.')) ?> <td><?= (\number_format($forecast = ($type[$key][$fiscal_end->format('Y')]['value'] ?? 0.0) / \abs(((int) $fiscal_current->format('m') - ((int) $fiscal_end->format('m') + 1)) % 12 + 1) * 12, 2, ',', '.')); ?>
<td><?= \number_format($history == 0 ? 0 : 100 * ($forecast - $history) / $history, 2, ',', '.') . '%' ?> <td><?= \number_format($history == 0 ? 0 : 100 * ($forecast - $history) / $history, 2, ',', '.') . '%'; ?>
<?php <?php
$sum_hist += $history; $sum_hist += $history;
$sum_current += $current; $sum_current += $current;
@ -109,11 +109,11 @@ require 'Worker.php';
endforeach; ?> endforeach; ?>
<tr> <tr>
<td> <td>
<td><?= 'Total' ?> <td><?= 'Total'; ?>
<td><?= \number_format($sum_hist, 2, ',', '.') ?> <td><?= \number_format($sum_hist, 2, ',', '.'); ?>
<td><?= \number_format($sum_current, 2, ',', '.') ?> <td><?= \number_format($sum_current, 2, ',', '.'); ?>
<td><?= \number_format($sum_forecast, 2, ',', '.') ?> <td><?= \number_format($sum_forecast, 2, ',', '.'); ?>
<td><?= \number_format($sum_hist === 0.0 ? 0 : (100 * $sum_forecast - $sum_hist) / $sum_hist, 2, ',', '.') . '%' ?> <td><?= \number_format($sum_hist === 0.0 ? 0 : (100 * $sum_forecast - $sum_hist) / $sum_hist, 2, ',', '.') . '%'; ?>
</table> </table>
</div> </div>
@ -135,12 +135,12 @@ require 'Worker.php';
$sum_forecast = 0.0; $sum_forecast = 0.0;
foreach ($costcenter as $key => $stype) : ?> foreach ($costcenter as $key => $stype) : ?>
<tr> <tr>
<td><?= $key ?> <td><?= $key; ?>
<td><?= $ccDef[$key] ?> <td><?= $ccDef[$key]; ?>
<td><?= (\number_format($history = $costcenter[$key][$fiscal_end_prev->format('Y')]['value'] ?? 0.0, 2, ',', '.')) ?> <td><?= (\number_format($history = $costcenter[$key][$fiscal_end_prev->format('Y')]['value'] ?? 0.0, 2, ',', '.')); ?>
<td><?= (\number_format($current = $costcenter[$key][$fiscal_end->format('Y')]['value'] ?? 0.0, 2, ',', '.')) ?> <td><?= (\number_format($current = $costcenter[$key][$fiscal_end->format('Y')]['value'] ?? 0.0, 2, ',', '.')); ?>
<td><?= (\number_format($forecast = ($costcenter[$key][$fiscal_end->format('Y')]['value'] ?? 0.0) / \abs(((int) $fiscal_current->format('m') - ((int) $fiscal_end->format('m') + 1)) % 12 + 1) * 12, 2, ',', '.')) ?> <td><?= (\number_format($forecast = ($costcenter[$key][$fiscal_end->format('Y')]['value'] ?? 0.0) / \abs(((int) $fiscal_current->format('m') - ((int) $fiscal_end->format('m') + 1)) % 12 + 1) * 12, 2, ',', '.')); ?>
<td><?= \number_format($history == 0 ? 0 : 100 * ($forecast - $history) / $history, 2, ',', '.') . '%' ?> <td><?= \number_format($history == 0 ? 0 : 100 * ($forecast - $history) / $history, 2, ',', '.') . '%'; ?>
<?php <?php
$sum_hist += $history; $sum_hist += $history;
$sum_current += $current; $sum_current += $current;
@ -148,11 +148,11 @@ require 'Worker.php';
endforeach; ?> endforeach; ?>
<tr> <tr>
<td> <td>
<td><?= 'Total' ?> <td><?= 'Total'; ?>
<td><?= \number_format($sum_hist, 2, ',', '.') ?> <td><?= \number_format($sum_hist, 2, ',', '.'); ?>
<td><?= \number_format($sum_current, 2, ',', '.') ?> <td><?= \number_format($sum_current, 2, ',', '.'); ?>
<td><?= \number_format($sum_forecast, 2, ',', '.') ?> <td><?= \number_format($sum_forecast, 2, ',', '.'); ?>
<td><?= \number_format($sum_hist === 0.0 ? 0 : 100 * ($sum_forecast - $sum_hist) / $sum_hist, 2, ',', '.') . '%' ?> <td><?= \number_format($sum_hist === 0.0 ? 0 : 100 * ($sum_forecast - $sum_hist) / $sum_hist, 2, ',', '.') . '%'; ?>
</table> </table>
</div> </div>
@ -174,12 +174,12 @@ require 'Worker.php';
$sum_forecast = 0.0; $sum_forecast = 0.0;
foreach ($account as $key => $stype) : ?> foreach ($account as $key => $stype) : ?>
<tr> <tr>
<td><?= $key ?> <td><?= $key; ?>
<td><?= $acDef[$key] ?> <td><?= $acDef[$key]; ?>
<td><?= (\number_format($history = $account[$key][$fiscal_end_prev->format('Y')]['value'] ?? 0.0, 2, ',', '.')) ?> <td><?= (\number_format($history = $account[$key][$fiscal_end_prev->format('Y')]['value'] ?? 0.0, 2, ',', '.')); ?>
<td><?= (\number_format($current = $account[$key][$fiscal_end->format('Y')]['value'] ?? 0.0, 2, ',', '.')) ?> <td><?= (\number_format($current = $account[$key][$fiscal_end->format('Y')]['value'] ?? 0.0, 2, ',', '.')); ?>
<td><?= (\number_format($forecast = ($account[$key][$fiscal_end->format('Y')]['value'] ?? 0.0) / \abs(((int) $fiscal_current->format('m') - ((int) $fiscal_end->format('m') + 1)) % 12 + 1) * 12, 2, ',', '.')) ?> <td><?= (\number_format($forecast = ($account[$key][$fiscal_end->format('Y')]['value'] ?? 0.0) / \abs(((int) $fiscal_current->format('m') - ((int) $fiscal_end->format('m') + 1)) % 12 + 1) * 12, 2, ',', '.')); ?>
<td><?= \number_format($history == 0 ? 0 : 100 * ($forecast - $history) / $history, 2, ',', '.') . '%' ?> <td><?= \number_format($history == 0 ? 0 : 100 * ($forecast - $history) / $history, 2, ',', '.') . '%'; ?>
<?php <?php
$sum_hist += $history; $sum_hist += $history;
$sum_current += $current; $sum_current += $current;
@ -187,15 +187,15 @@ require 'Worker.php';
endforeach; ?> endforeach; ?>
<tr> <tr>
<td> <td>
<td><?= 'Total' ?> <td><?= 'Total'; ?>
<td><?= \number_format($sum_hist, 2, ',', '.') ?> <td><?= \number_format($sum_hist, 2, ',', '.'); ?>
<td><?= \number_format($sum_current, 2, ',', '.') ?> <td><?= \number_format($sum_current, 2, ',', '.'); ?>
<td><?= \number_format($sum_forecast, 2, ',', '.') ?> <td><?= \number_format($sum_forecast, 2, ',', '.'); ?>
<td><?= \number_format($sum_hist === 0.0 ? 0 : 100 * ($sum_forecast - $sum_hist) / $sum_hist, 2, ',', '.') . '%' ?> <td><?= \number_format($sum_hist === 0.0 ? 0 : 100 * ($sum_forecast - $sum_hist) / $sum_hist, 2, ',', '.') . '%'; ?>
</table> </table>
</div> </div>
</div> </div>
<input type="radio" id="c-tab-2" name="tabular-2"<?= $this->request->getUri()->getFragment() === 'c-tab-2' ? ' checked' : '' ?>> <input type="radio" id="c-tab-2" name="tabular-2"<?= $this->request->getUri()->getFragment() === 'c-tab-2' ? ' checked' : ''; ?>>
<div class="tab"> <div class="tab">
<section class="box"> <section class="box">
<table class="default"> <table class="default">
@ -211,16 +211,16 @@ require 'Worker.php';
foreach ($costobject as $key => $co) : foreach ($costobject as $key => $co) :
if (\strrpos($key, 'K', -\strlen($key)) !== false && isset($co[$fiscal_end->format('Y')]['value'])) : ?> if (\strrpos($key, 'K', -\strlen($key)) !== false && isset($co[$fiscal_end->format('Y')]['value'])) : ?>
<tr> <tr>
<td><?= $key ?> <td><?= $key; ?>
<td> <td>
<td><?= $coDef[$key] ?? '' ?> <td><?= $coDef[$key] ?? ''; ?>
<td><?= \number_format($co[$fiscal_end->format('Y')]['value'] ?? 0, 2, ',', '.') ?> <td><?= \number_format($co[$fiscal_end->format('Y')]['value'] ?? 0, 2, ',', '.'); ?>
<?php endif; endforeach; ?> <?php endif; endforeach; ?>
<tr> <tr>
<td> <td>
<td> <td>
<td><?= 'Total' ?> <td><?= 'Total'; ?>
<td><?= \number_format($type['K'][$fiscal_end->format('Y')]['value'] ?? 0, 2, ',', '.') ?> <td><?= \number_format($type['K'][$fiscal_end->format('Y')]['value'] ?? 0, 2, ',', '.'); ?>
</table> </table>
</section> </section>
@ -236,14 +236,14 @@ require 'Worker.php';
<?php $loop = $type['K'][$fiscal_end->format('Y')]['cc'] ?? []; <?php $loop = $type['K'][$fiscal_end->format('Y')]['cc'] ?? [];
foreach ($loop as $key => $stype) : ?> foreach ($loop as $key => $stype) : ?>
<tr> <tr>
<td><?= $key ?> <td><?= $key; ?>
<td><?= $ccDef[$key] ?? '' ?> <td><?= $ccDef[$key] ?? ''; ?>
<td><?= \number_format($stype, 2, ',', '.') ?> <td><?= \number_format($stype, 2, ',', '.'); ?>
<?php endforeach; ?> <?php endforeach; ?>
<tr> <tr>
<td> <td>
<td><?= 'Total' ?> <td><?= 'Total'; ?>
<td><?= \number_format($type['K'][$fiscal_end->format('Y')]['value'] ?? 0, 2, ',', '.') ?> <td><?= \number_format($type['K'][$fiscal_end->format('Y')]['value'] ?? 0, 2, ',', '.'); ?>
</table> </table>
</section> </section>
@ -259,18 +259,18 @@ require 'Worker.php';
<?php $loop = $type['K'][$fiscal_end->format('Y')]['ac'] ?? []; <?php $loop = $type['K'][$fiscal_end->format('Y')]['ac'] ?? [];
foreach ($loop as $key => $stype) : ?> foreach ($loop as $key => $stype) : ?>
<tr> <tr>
<td><?= $key ?> <td><?= $key; ?>
<td><?= $acDef[$key] ?? '' ?> <td><?= $acDef[$key] ?? ''; ?>
<td><?= \number_format($stype, 2, ',', '.') ?> <td><?= \number_format($stype, 2, ',', '.'); ?>
<?php endforeach; ?> <?php endforeach; ?>
<tr> <tr>
<td> <td>
<td><?= 'Total' ?> <td><?= 'Total'; ?>
<td><?= \number_format($type['K'][$fiscal_end->format('Y')]['value'] ?? 0, 2, ',', '.') ?> <td><?= \number_format($type['K'][$fiscal_end->format('Y')]['value'] ?? 0, 2, ',', '.'); ?>
</table> </table>
</section> </section>
</div> </div>
<input type="radio" id="c-tab-3" name="tabular-2"<?= $this->request->getUri()->getFragment() === 'c-tab-3' ? ' checked' : '' ?>> <input type="radio" id="c-tab-3" name="tabular-2"<?= $this->request->getUri()->getFragment() === 'c-tab-3' ? ' checked' : ''; ?>>
<div class="tab"> <div class="tab">
<section class="box"> <section class="box">
<table class="default"> <table class="default">
@ -284,14 +284,14 @@ require 'Worker.php';
<?php $loop = $costobject['K152333'][$fiscal_end->format('Y')]['ac'] ?? []; <?php $loop = $costobject['K152333'][$fiscal_end->format('Y')]['ac'] ?? [];
foreach ($loop as $key => $co) : ?> foreach ($loop as $key => $co) : ?>
<tr> <tr>
<td><?= $key ?> <td><?= $key; ?>
<td><?= $acDef[$key] ?? '' ?> <td><?= $acDef[$key] ?? ''; ?>
<td><?= \number_format($co, 2, ',', '.') ?> <td><?= \number_format($co, 2, ',', '.'); ?>
<?php endforeach; ?> <?php endforeach; ?>
<tr> <tr>
<td> <td>
<td><?= 'Total' ?> <td><?= 'Total'; ?>
<td><?= \number_format($costobject['K152333'][$fiscal_end->format('Y')]['value'] ?? 0, 2, ',', '.') ?> <td><?= \number_format($costobject['K152333'][$fiscal_end->format('Y')]['value'] ?? 0, 2, ',', '.'); ?>
</table> </table>
</section> </section>
@ -307,18 +307,18 @@ require 'Worker.php';
<?php $loop = $costobject['K152333'][$fiscal_end->format('Y')]['cc'] ?? []; <?php $loop = $costobject['K152333'][$fiscal_end->format('Y')]['cc'] ?? [];
foreach ($loop as $key => $co) : ?> foreach ($loop as $key => $co) : ?>
<tr> <tr>
<td><?= $key ?> <td><?= $key; ?>
<td><?= $ccDef[$key] ?? '' ?> <td><?= $ccDef[$key] ?? ''; ?>
<td><?= \number_format($co, 2, ',', '.') ?> <td><?= \number_format($co, 2, ',', '.'); ?>
<?php endforeach; ?> <?php endforeach; ?>
<tr> <tr>
<td> <td>
<td><?= 'Total' ?> <td><?= 'Total'; ?>
<td><?= \number_format($costobject['K152333'][$fiscal_end->format('Y')]['value'] ?? 0, 2, ',', '.') ?> <td><?= \number_format($costobject['K152333'][$fiscal_end->format('Y')]['value'] ?? 0, 2, ',', '.'); ?>
</table> </table>
</section> </section>
</div> </div>
<input type="radio" id="c-tab-4" name="tabular-2"<?= $this->request->getUri()->getFragment() === 'c-tab-4' ? ' checked' : '' ?>> <input type="radio" id="c-tab-4" name="tabular-2"<?= $this->request->getUri()->getFragment() === 'c-tab-4' ? ' checked' : ''; ?>>
<div class="tab"> <div class="tab">
<section class="box"> <section class="box">
<table class="default"> <table class="default">
@ -332,14 +332,14 @@ require 'Worker.php';
<?php $loop = $costcenter[241][$fiscal_end->format('Y')]['ac'] ?? []; <?php $loop = $costcenter[241][$fiscal_end->format('Y')]['ac'] ?? [];
foreach ($loop as $key => $ac) : ?> foreach ($loop as $key => $ac) : ?>
<tr> <tr>
<td><?= $key ?> <td><?= $key; ?>
<td><?= $acDef[$key] ?? '' ?> <td><?= $acDef[$key] ?? ''; ?>
<td><?= \number_format($ac, 2, ',', '.') ?> <td><?= \number_format($ac, 2, ',', '.'); ?>
<?php endforeach; ?> <?php endforeach; ?>
<tr> <tr>
<td> <td>
<td><?= 'Total' ?> <td><?= 'Total'; ?>
<td><?= \number_format($costcenter[241][$fiscal_end->format('Y')]['value'] ?? 0, 2, ',', '.') ?> <td><?= \number_format($costcenter[241][$fiscal_end->format('Y')]['value'] ?? 0, 2, ',', '.'); ?>
</table> </table>
</section> </section>
@ -355,14 +355,14 @@ require 'Worker.php';
<?php $loop = $costcenter[241][$fiscal_end->format('Y')]['type'] ?? []; <?php $loop = $costcenter[241][$fiscal_end->format('Y')]['type'] ?? [];
foreach ($loop as $key => $co) : ?> foreach ($loop as $key => $co) : ?>
<tr> <tr>
<td><?= $key ?> <td><?= $key; ?>
<td><?= $types[$key] ?? '' ?> <td><?= $types[$key] ?? ''; ?>
<td><?= \number_format($co, 2, ',', '.') ?> <td><?= \number_format($co, 2, ',', '.'); ?>
<?php endforeach; ?> <?php endforeach; ?>
<tr> <tr>
<td> <td>
<td><?= 'Total' ?> <td><?= 'Total'; ?>
<td><?= \number_format($costcenter[241][$fiscal_end->format('Y')]['value'] ?? 0, 2, ',', '.') ?> <td><?= \number_format($costcenter[241][$fiscal_end->format('Y')]['value'] ?? 0, 2, ',', '.'); ?>
</table> </table>
</section> </section>
@ -378,18 +378,18 @@ require 'Worker.php';
<?php $loop = $costcenter[241][$fiscal_end->format('Y')]['co'] ?? []; <?php $loop = $costcenter[241][$fiscal_end->format('Y')]['co'] ?? [];
foreach ($loop as $key => $co) : ?> foreach ($loop as $key => $co) : ?>
<tr> <tr>
<td><?= $key ?> <td><?= $key; ?>
<td><?= $coDef[$key] ?? '' ?> <td><?= $coDef[$key] ?? ''; ?>
<td><?= \number_format($co, 2, ',', '.') ?> <td><?= \number_format($co, 2, ',', '.'); ?>
<?php endforeach; ?> <?php endforeach; ?>
<tr> <tr>
<td> <td>
<td><?= 'Total' ?> <td><?= 'Total'; ?>
<td><?= \number_format($costcenter[241][$fiscal_end->format('Y')]['value'] ?? 0, 2, ',', '.') ?> <td><?= \number_format($costcenter[241][$fiscal_end->format('Y')]['value'] ?? 0, 2, ',', '.'); ?>
</table> </table>
</section> </section>
</div> </div>
<input type="radio" id="c-tab-5" name="tabular-2"<?= $this->request->getUri()->getFragment() === 'c-tab-5' ? ' checked' : '' ?>> <input type="radio" id="c-tab-5" name="tabular-2"<?= $this->request->getUri()->getFragment() === 'c-tab-5' ? ' checked' : ''; ?>>
<div class="tab"> <div class="tab">
<section class="box"> <section class="box">
<table class="default"> <table class="default">
@ -403,14 +403,14 @@ require 'Worker.php';
<?php $loop = $account[4480][$fiscal_end->format('Y')]['type'] ?? []; <?php $loop = $account[4480][$fiscal_end->format('Y')]['type'] ?? [];
foreach ($loop as $key => $stype) : ?> foreach ($loop as $key => $stype) : ?>
<tr> <tr>
<td><?= $key ?> <td><?= $key; ?>
<td><?= $types[$key] ?? '' ?> <td><?= $types[$key] ?? ''; ?>
<td><?= \number_format($stype, 2, ',', '.') ?> <td><?= \number_format($stype, 2, ',', '.'); ?>
<?php endforeach; ?> <?php endforeach; ?>
<tr> <tr>
<td> <td>
<td><?= 'Total' ?> <td><?= 'Total'; ?>
<td><?= \number_format($account[4480][$fiscal_end->format('Y')]['value'] ?? 0, 2, ',', '.') ?> <td><?= \number_format($account[4480][$fiscal_end->format('Y')]['value'] ?? 0, 2, ',', '.'); ?>
</table> </table>
</section> </section>
@ -426,14 +426,14 @@ require 'Worker.php';
<?php $loop = $account[4480][$fiscal_end->format('Y')]['cc'] ?? []; <?php $loop = $account[4480][$fiscal_end->format('Y')]['cc'] ?? [];
foreach ($loop as $key => $cc) : ?> foreach ($loop as $key => $cc) : ?>
<tr> <tr>
<td><?= $key ?> <td><?= $key; ?>
<td><?= $ccDef[$key] ?? '' ?> <td><?= $ccDef[$key] ?? ''; ?>
<td><?= \number_format($cc, 2, ',', '.') ?> <td><?= \number_format($cc, 2, ',', '.'); ?>
<?php endforeach; ?> <?php endforeach; ?>
<tr> <tr>
<td> <td>
<td><?= 'Total' ?> <td><?= 'Total'; ?>
<td><?= \number_format($account[4480][$fiscal_end->format('Y')]['value'] ?? 0, 2, ',', '.') ?> <td><?= \number_format($account[4480][$fiscal_end->format('Y')]['value'] ?? 0, 2, ',', '.'); ?>
</table> </table>
</section> </section>
</div> </div>

View File

@ -68,6 +68,7 @@ class TemplateTest extends \PHPUnit\Framework\TestCase
$this->template->setUnit(new NullUnit(1)); $this->template->setUnit(new NullUnit(1));
self::assertEquals(1, $this->template->getUnit()->getId()); self::assertEquals(1, $this->template->getUnit()->getId());
} }
/** /**
* @testdox The creator can be set and returned correctly * @testdox The creator can be set and returned correctly
* @covers Modules\Helper\Models\Template * @covers Modules\Helper\Models\Template