diff --git a/app/Abstracts/View/Components/Documents/Show.php b/app/Abstracts/View/Components/Documents/Show.php index 412df24cd..26d642703 100644 --- a/app/Abstracts/View/Components/Documents/Show.php +++ b/app/Abstracts/View/Components/Documents/Show.php @@ -41,6 +41,9 @@ abstract class Show extends Component /* -- Main End -- */ /* -- Buttons Start -- */ + /** @var string */ + public $textPage; + /** @var bool */ public $hideCreate; @@ -59,6 +62,9 @@ abstract class Show extends Component /** @var string */ public $editRoute; + /** @var string */ + public $showRoute; + /** @var bool */ public $hideMoreActions; @@ -318,8 +324,8 @@ abstract class Show extends Component */ public function __construct( $type, $document, $transactions = [], - string $permissionCreate = '', string $permissionUpdate = '', string $permissionDelete = '', - bool $hideCreate = false, string $createRoute = '', string $textCreate = '', bool $hideButtonStatuses = false, bool $hideEdit = false, string $editRoute = '', + string $permissionCreate = '', string $permissionUpdate = '', string $permissionDelete = '', string $textPage = '', + bool $hideCreate = false, string $createRoute = '', string $textCreate = '', bool $hideButtonStatuses = false, bool $hideEdit = false, string $editRoute = '', string $showRoute = '', bool $hideMoreActions = false, bool $hideDuplicate = false, string $duplicateRoute = '', bool $hidePrint = false, bool $checkCancelled = true, string $printRoute = '', bool $hideShare = false, string $shareRoute = '', string $signedUrl = '', bool $hideEmail = false, string $emailRoute = '', string $textEmail = '', bool $hidePdf = false, string $pdfRoute = '', bool $hideCancel = false, string $cancelledRoute = '', bool $hideCustomize = false, string $permissionCustomize = '', string $customizeRoute = '', @@ -356,6 +362,7 @@ abstract class Show extends Component /* -- Main End -- */ /* -- Buttons Start -- */ + $this->textPage = $this->getTextPage($type, $textPage); $this->hideCreate = $hideCreate; $this->createRoute = $this->getCreateRoute($type, $createRoute); $this->textCreate = $this->getTextCreate($type, $textCreate); @@ -363,6 +370,7 @@ abstract class Show extends Component $this->hideButtonStatuses = $this->getHideButtonStatuses($type, $hideButtonStatuses); $this->hideEdit = $hideEdit; $this->editRoute = $this->getEditRoute($type, $editRoute); + $this->showRoute = $this->getShowRoute($type, $showRoute); $this->hideMoreActions = $hideMoreActions; $this->hideDuplicate = $hideDuplicate; diff --git a/resources/views/components/documents/show/buttons.blade.php b/resources/views/components/documents/show/buttons.blade.php index 391f1c578..2fa549103 100644 --- a/resources/views/components/documents/show/buttons.blade.php +++ b/resources/views/components/documents/show/buttons.blade.php @@ -3,7 +3,7 @@ @if (! $hideCreate) @can($permissionCreate) - {{ trans($textCreate) }} + {{ trans('general.title.new', ['type' => trans_choice($textPage, 1)]) }} @endcan @endif diff --git a/resources/views/components/documents/show/children.blade.php b/resources/views/components/documents/show/children.blade.php index 8668724e3..cc451bcb8 100644 --- a/resources/views/components/documents/show/children.blade.php +++ b/resources/views/components/documents/show/children.blade.php @@ -7,18 +7,18 @@ -
- @if ($document->children()->count()) - @foreach ($document->children() as $child) - @php $url = '' . $child->number . '' @endphp + @if ($document->children()->count()) + @foreach ($document->children()->get() as $child) + @php + $url = '' . $child->document_number . ''; + @endphp -
- {{ trans('recurring.child', ['url' => $url, 'date' => company_date($child->due_at)]) }} -
- @endforeach - @else - {{ trans('general.none') }} - @endif -
+
+ {!! trans('recurring.child', ['url' => $url, 'date' => company_date($child->due_at)]) !!} +
+ @endforeach + @else + {{ trans('general.none') }} + @endif
diff --git a/resources/views/components/transactions/show/children.blade.php b/resources/views/components/transactions/show/children.blade.php index ef91d5449..77741c3c4 100644 --- a/resources/views/components/transactions/show/children.blade.php +++ b/resources/views/components/transactions/show/children.blade.php @@ -20,11 +20,11 @@ x-bind:class="children == 1 ? 'h-auto ' : 'scale-y-0 h-0'" > @if ($transaction->children()->count()) - @foreach ($transaction->children() as $child) + @foreach ($transaction->children()->get() as $child) @php $url = '' . $child->number . '' @endphp
- {{ trans('recurring.child', ['url' => $url, 'date' => company_date($child->paid_at)]) }} + {!! trans('recurring.child', ['url' => $url, 'date' => company_date($child->paid_at)]) !!}
@endforeach @else