fix templates

This commit is contained in:
Dennis Eichhorn 2024-04-17 17:45:07 +00:00
parent 61ed0b1232
commit 379e1151f8
3 changed files with 9 additions and 61 deletions

View File

@ -18,66 +18,6 @@ use phpOMS\Account\PermissionType;
use phpOMS\Router\RouteVerb;
return [
'^/purchase/invoice/create(\?.*$|$)' => [
[
'dest' => '\Modules\Purchase\Controller\BackendController:viewPurchaseInvoiceCreate',
'verb' => RouteVerb::GET,
'active' => true,
'permission' => [
'module' => BackendController::NAME,
'type' => PermissionType::CREATE,
'state' => PermissionCategory::INVOICE,
],
],
],
'^/purchase/invoice/list(\?.*$|$)' => [
[
'dest' => '\Modules\Purchase\Controller\BackendController:viewPurchaseInvoiceList',
'verb' => RouteVerb::GET,
'active' => true,
'permission' => [
'module' => BackendController::NAME,
'type' => PermissionType::READ,
'state' => PermissionCategory::INVOICE,
],
],
],
'^/purchase/article/list(\?.*$|$)' => [
[
'dest' => '\Modules\Purchase\Controller\BackendController:viewPurchaseArticleList',
'verb' => RouteVerb::GET,
'active' => true,
'permission' => [
'module' => BackendController::NAME,
'type' => PermissionType::READ,
'state' => PermissionCategory::ARTICLE,
],
],
],
'^/purchase/article/create(\?.*$|$)' => [
[
'dest' => '\Modules\Purchase\Controller\BackendController:viewPurchaseArticleCreate',
'verb' => RouteVerb::GET,
'active' => true,
'permission' => [
'module' => BackendController::NAME,
'type' => PermissionType::CREATE,
'state' => PermissionCategory::ARTICLE,
],
],
],
'^/purchase/article/view(\?.*$|$)' => [
[
'dest' => '\Modules\Purchase\Controller\BackendController:viewPurchaseArticleView',
'verb' => RouteVerb::GET,
'active' => true,
'permission' => [
'module' => BackendController::NAME,
'type' => PermissionType::READ,
'state' => PermissionCategory::ARTICLE,
],
],
],
'^/purchase/order/suggestion/view(\?.*$|$)' => [
[
'dest' => '\Modules\Purchase\Controller\BackendController:viewPurchaseOrderSuggestion',

View File

@ -17,6 +17,7 @@ namespace Modules\Purchase\Controller;
use Modules\Purchase\Models\OrderSuggestion\OrderSuggestionMapper;
use phpOMS\Contract\RenderableInterface;
use phpOMS\DataStorage\Database\Query\OrderType;
use phpOMS\Message\Http\RequestStatusCode;
use phpOMS\Message\RequestAbstract;
use phpOMS\Message\ResponseAbstract;
use phpOMS\Views\View;
@ -152,6 +153,13 @@ final class BackendController extends Controller
public function viewPurchaseOrderSuggestion(RequestAbstract $request, ResponseAbstract $response, array $data = []) : RenderableInterface
{
$view = new View($this->app->l11nManager, $request, $response);
if (!$request->hasData('id')) {
$response->header->status = RequestStatusCode::R_404;
$view->setTemplate('/Web/Backend/Error/404');
return $view;
}
$view->setTemplate('/Modules/Purchase/Theme/Backend/order-suggestion');
$view->data['nav'] = $this->app->moduleManager->get('Navigation')->createNavigationMid(1002105001, $request, $response);

View File

@ -130,7 +130,7 @@ echo $this->data['nav']->render();
<td><?= $this->data['suggestion_data'][$element->item->id]['singlePrice']->getAmount(); ?>
<td><?= $element->costs->getAmount(); ?>
<?php endforeach; ?>
<?php if (empty($supplier)) : ?>
<?php if (empty($supplier) && !empty($this->data['suggestion']->elements)) : ?>
<tr class="hl-7">
<td colspan="15"><?= $this->printHtml($element->supplier->account->name1); ?> <?= $this->printHtml($element->supplier->account->name2); ?>
<td><?= $subtotal->getAmount(); ?>