From 974995634af92b8c0b62f3af2855ca3413993c8d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Thu, 7 Jul 2022 10:53:26 +0300 Subject: [PATCH] Fixed document information component document show route --- app/View/Components/Documents/Index/Information.php | 5 ++++- .../components/documents/index/information.blade.php | 10 +++++----- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/app/View/Components/Documents/Index/Information.php b/app/View/Components/Documents/Index/Information.php index 194898b24..81f7ef091 100644 --- a/app/View/Components/Documents/Index/Information.php +++ b/app/View/Components/Documents/Index/Information.php @@ -19,6 +19,8 @@ class Information extends Component public $showRoute; + public $showDocumentRoute; + public $placement; /** @@ -27,11 +29,12 @@ class Information extends Component * @return void */ public function __construct( - $document, bool $hideShow = false, string $showRoute = '', string $placement = '' + $document, bool $hideShow = false, string $showRoute = '', string $showDocumentRoute = '', string $placement = '' ) { $this->document = $document; $this->hideShow = $hideShow; $this->showRoute = $this->getShowRoute($document->contact->type, $showRoute); + $this->showDocumentRoute = $this->getShowRoute($document->type, $showDocumentRoute); $this->placement = (! empty($placement)) ? $placement : 'left'; } diff --git a/resources/views/components/documents/index/information.blade.php b/resources/views/components/documents/index/information.blade.php index a2e3fb1a6..eb6bd2a13 100644 --- a/resources/views/components/documents/index/information.blade.php +++ b/resources/views/components/documents/index/information.blade.php @@ -47,6 +47,10 @@ @if ($document->items->count()) @foreach ($document->items as $document_item) + @if ($loop->index > 1) + @break + @endif +
  • sell @@ -66,17 +70,13 @@
  • - - @if ($loop->index >= 2) - @break - @endif @endforeach @endif @if ($document->items->count() > 2)
  • @if (! $hideShow) - + {{ trans('documents.invoice_detail.more_item', ['count' => $document->items->count() - 2]) }} @else