diff --git a/Controller/BackendController.php b/Controller/BackendController.php index 2a27415..066c5ab 100755 --- a/Controller/BackendController.php +++ b/Controller/BackendController.php @@ -32,7 +32,7 @@ use phpOMS\Views\View; final class BackendController extends Controller { /** - * Routing end-point for application behaviour. + * Routing end-point for application behavior. * * @param RequestAbstract $request Request * @param ResponseAbstract $response Response @@ -60,7 +60,7 @@ final class BackendController extends Controller } /** - * Routing end-point for application behaviour. + * Routing end-point for application behavior. * * @param RequestAbstract $request Request * @param ResponseAbstract $response Response @@ -80,16 +80,22 @@ final class BackendController extends Controller $expense = ExpenseMapper::get() ->with('from') + ->with('notes') + ->with('elements') + ->with('elements/type') + ->with('elements/type/l11n') ->where('id', (int) $request->getData('id')) ->execute(); $view->data['expense'] = $expense; + $view->data['expense-notes'] = new \Modules\Editor\Theme\Backend\Components\Compound\BaseView($this->app->l11nManager, $request, $response); + return $view; } /** - * Routing end-point for application behaviour. + * Routing end-point for application behavior. * * @param RequestAbstract $request Request * @param ResponseAbstract $response Response @@ -118,7 +124,7 @@ final class BackendController extends Controller } /** - * Routing end-point for application behaviour. + * Routing end-point for application behavior. * * @param RequestAbstract $request Request * @param ResponseAbstract $response Response @@ -147,7 +153,7 @@ final class BackendController extends Controller } /** - * Routing end-point for application behaviour. + * Routing end-point for application behavior. * * @param RequestAbstract $request Request * @param ResponseAbstract $response Response @@ -176,7 +182,7 @@ final class BackendController extends Controller } /** - * Routing end-point for application behaviour. + * Routing end-point for application behavior. * * @param RequestAbstract $request Request * @param ResponseAbstract $response Response diff --git a/Docs/Dev/en/SUMMARY.md b/Docs/Dev/en/SUMMARY.md new file mode 100644 index 0000000..8a97952 --- /dev/null +++ b/Docs/Dev/en/SUMMARY.md @@ -0,0 +1,3 @@ +# Developer Content + +* [Structure]({%}&page=Dev/structure) diff --git a/Docs/Dev/en/structure.md b/Docs/Dev/en/structure.md new file mode 100644 index 0000000..1e1ed19 --- /dev/null +++ b/Docs/Dev/en/structure.md @@ -0,0 +1,5 @@ +# Structure + +## ER + +![ER](Modules/BusinessExpenses/Docs/Dev/img/er.png) \ No newline at end of file diff --git a/Docs/Dev/img/er.png b/Docs/Dev/img/er.png new file mode 100644 index 0000000..55efbd2 Binary files /dev/null and b/Docs/Dev/img/er.png differ diff --git a/Models/PermissionCategory.php b/Models/PermissionCategory.php index 1b6d4fb..29db758 100755 --- a/Models/PermissionCategory.php +++ b/Models/PermissionCategory.php @@ -17,7 +17,7 @@ namespace Modules\BusinessExpenses\Models; use phpOMS\Stdlib\Base\Enum; /** - * Permision state enum. + * Permission category enum. * * @package Modules\BusinessExpenses\Models * @license OMS License 2.0 diff --git a/Theme/Backend/Lang/de.lang.php b/Theme/Backend/Lang/de.lang.php index ad56852..a786e86 100644 --- a/Theme/Backend/Lang/de.lang.php +++ b/Theme/Backend/Lang/de.lang.php @@ -31,4 +31,7 @@ return ['BusinessExpenses' => [ 'Start' => 'Start', 'Status' => 'Status', 'Title' => 'Titel', + 'Overview' => 'Übersicht', + 'Clocking' => 'Zeiterfassung', + 'Type' => 'Typ', ]]; diff --git a/Theme/Backend/Lang/en.lang.php b/Theme/Backend/Lang/en.lang.php index 49ee81a..25e1f31 100644 --- a/Theme/Backend/Lang/en.lang.php +++ b/Theme/Backend/Lang/en.lang.php @@ -31,4 +31,7 @@ return ['BusinessExpenses' => [ 'Start' => 'Start', 'Status' => 'Status', 'Title' => 'Title', + 'Overview' => 'Overview', + 'Clocking' => 'Clocking', + 'Type' => 'Type', ]]; diff --git a/Theme/Backend/expense-single.tpl.php b/Theme/Backend/expense-single.tpl.php index 0a953d1..060e4ab 100644 --- a/Theme/Backend/expense-single.tpl.php +++ b/Theme/Backend/expense-single.tpl.php @@ -14,123 +14,286 @@ declare(strict_types=1); use Modules\BusinessExpenses\Models\NullExpense; +use phpOMS\Uri\UriFactory; /** @var \phpOMS\Views\View $this */ $expense = $this->getData('expense') ?? new NullExpense(); +$sessions = $this->data['sessions'] ?? []; echo $this->data['nav']->render(); ?> - -
-
-
-
- -
getHtml('Net'); ?>: - -
getHtml('Gross'); ?>: - -
-
-
+
+
+
- -
-
-
- -
getHtml('Approved'); ?>: - -
getHtml('Paid'); ?>: - -
-
-
-
-
- -
-
-
-
getHtml('Report'); ?>
-
-
- - +
+ request->uri->fragment === 'c-tab-1' ? ' checked' : ''; ?>> +
+
+
+
+
+ +
getHtml('Net'); ?>: + +
getHtml('Gross'); ?>: + +
+
+
-
- - -
- -
- - -
- -
- - -
- -
- - +
+
+
+ +
getHtml('Approved'); ?>: + +
getHtml('Paid'); ?>: + +
+
+
-
-
-
-
-
-
getHtml('Notes'); ?>download
-
- - - - -
- getHtml('Title'); ?> - - - -
-
-
-
+
+
+
+
getHtml('Report'); ?>
+
+
+ + +
-
-
-
-
getHtml('Expenses'); ?>download
-
- - - - -
- getHtml('ID', '0', '0'); ?> - - - -
-
+
+ + +
+ +
+ + +
+ +
+ + +
+ +
+ + +
+
+
+
+
+
+
+ + request->uri->fragment === 'c-tab-2' ? ' checked' : ''; ?>> +
+ data['expense-notes']->render('expense-notes', '', $expense->notes); ?> +
+ + request->uri->fragment === 'c-tab-3' ? ' checked' : ''; ?>> +
+
+
+
+
getHtml('Expenses'); ?>download
+
+ + + + + elements as $element) : ?> + +
+ getHtml('ID', '0', '0'); ?> + + + + getHtml('Start'); ?> + getHtml('End'); ?> + getHtml('Type'); ?> +
+ id; ?> + start->format('Y-m-d H:i'); ?> + end?->format('Y-m-d H:i'); ?> + printHtml($element->type->l11n); ?> + +
+
+
+
+
+ + request->uri->fragment === 'c-tab-4' ? ' checked' : ''; ?>> +
+
+
+
+
getHtml('Recordings', 'HumanResourceTimeRecording', 'Backend'); ?>download
+ + + + + + + + + +
getHtml('Date', 'HumanResourceTimeRecording', 'Backend'); ?> + + + + getHtml('Type', 'HumanResourceTimeRecording', 'Backend'); ?> + + + + getHtml('Status', 'HumanResourceTimeRecording', 'Backend'); ?> + + + + getHtml('Start', 'HumanResourceTimeRecording', 'Backend'); ?> + + + + getHtml('Break', 'HumanResourceTimeRecording', 'Backend'); ?> + + + + getHtml('End', 'HumanResourceTimeRecording', 'Backend'); ?> + + + + getHtml('Total', 'HumanResourceTimeRecording', 'Backend'); ?> + + + +
+ getStart()->format('Y-m-d') === $lastOpenSession->getStart()->format('Y-m-d') + ) : ?> + Today + + getStart()->format('Y-m-d'); ?> - getHtml('D' . $session->getStart()->format('w')); ?> + + getHtml('CT' . $session->getType()); ?> + getHtml('CS' . $session->getStatus()); ?> + getStart()->format('H:i'); ?> + getBreak() / 3600); ?>h getBreak() / 60) % 60); ?>m + getEnd() !== null ? $session->getEnd()->format('H:i') : ''; ?> + getBusy() / 3600); ?>h getBusy() / 60) % 60); ?>m + getBusy(); + if ($session->getStart()->getTimestamp() < $startWeek->getTimestamp() + || $count === $sessionCount + ) : ?> +
format('Y/m/d'); ?> - format('Y/m/d'); ?> + h m + createModify(0, 0, -7); + $busy['week'] = 0; + endif; + ?> + getBusy(); + if ($session->getStart()->getTimestamp() < $startMonth->getTimestamp() + || $count === $sessionCount + ) : ?> +
format('Y/m/d'); ?> - format('Y/m/d'); ?> + h m + createModify(0, -1, 0); + $busy['month'] = 0; + endif; + ?> + + +
getHtml('Empty', '0', '0'); ?> + +
+
+
+
+
\ No newline at end of file diff --git a/info.json b/info.json index ac52d1b..d0779c5 100644 --- a/info.json +++ b/info.json @@ -14,7 +14,6 @@ "name": "Jingga", "website": "jingga.app" }, - "description": "Accounting module.", "directory": "BusinessExpenses", "dependencies": { "Admin": "1.0.0", diff --git a/tests/Controller/Api/ApiExpenseControllerTrait.php b/tests/Controller/Api/ApiExpenseControllerTrait.php index 57563fa..f4904e5 100644 --- a/tests/Controller/Api/ApiExpenseControllerTrait.php +++ b/tests/Controller/Api/ApiExpenseControllerTrait.php @@ -14,14 +14,10 @@ declare(strict_types=1); namespace Modules\BusinessExpenses\tests\Controller\Api; -use phpOMS\Account\AccountStatus; -use phpOMS\Account\AccountType; use phpOMS\Message\Http\HttpRequest; use phpOMS\Message\Http\HttpResponse; -use phpOMS\Message\Http\RequestStatusCode; use phpOMS\System\File\Local\Directory; use phpOMS\Uri\HttpUri; -use phpOMS\Utils\RnG\DateTime; use phpOMS\Utils\TestUtils; trait ApiExpenseControllerTrait