diff --git a/app/Abstracts/View/Components/DocumentShow.php b/app/Abstracts/View/Components/DocumentShow.php index 0c2475713..a16b9b626 100644 --- a/app/Abstracts/View/Components/DocumentShow.php +++ b/app/Abstracts/View/Components/DocumentShow.php @@ -41,6 +41,9 @@ abstract class DocumentShow extends Base public $date_format; + /** @var string */ + public $routePrefix; + /** @var string */ public $textRecurringType; @@ -404,6 +407,7 @@ abstract class DocumentShow extends Base $this->logo = $this->getLogo($logo); $this->backgroundColor = $backgroundColor; $this->signedUrl = $this->getSignedUrl($type, $signedUrl); + $this->routePrefix = $this->getRoutePrefix($type); $this->histories = ($histories) ? $histories : $document->histories; $this->transactions = ($transactions) ? $transactions : $document->transactions; @@ -1602,4 +1606,12 @@ abstract class DocumentShow extends Base // @todo what return value invoice or always false?? return setting('invoice.hide_amount', $hideAmount); } + + protected function getRoutePrefix($type) { + if ($prefix = config('type.' . $type . '.route.prefix', false)){ + return 'invoices'; + } + + return $prefix; + } } diff --git a/app/Abstracts/View/Components/TransactionShow.php b/app/Abstracts/View/Components/TransactionShow.php index 277333cfe..21b41d650 100644 --- a/app/Abstracts/View/Components/TransactionShow.php +++ b/app/Abstracts/View/Components/TransactionShow.php @@ -34,6 +34,9 @@ abstract class TransactionShow extends Base public $date_format; + /** @var string */ + public $routePrefix; + /** @var bool */ public $hideButtonAddNew; @@ -362,6 +365,7 @@ abstract class TransactionShow extends Base $this->date_format = $this->getCompanyDateFormat(); $this->textRecurringType = $this->getTextRecurringType($type, $textRecurringType); $this->hideRecurringMessage = $hideRecurringMessage; + $this->routePrefix = $this->getRoutePrefix($type); // Navbar Hide $this->hideButtonAddNew = $hideButtonAddNew; @@ -1297,4 +1301,12 @@ abstract class TransactionShow extends Base return 'general.revenues'; } + + protected function getRoutePrefix($type) { + if ($prefix = config('type.' . $type . '.route.prefix', false)){ + return 'revenues'; + } + + return $prefix; + } } diff --git a/resources/views/components/documents/show/recurring-message.blade.php b/resources/views/components/documents/show/recurring-message.blade.php index db8cdcccd..82892fbce 100644 --- a/resources/views/components/documents/show/recurring-message.blade.php +++ b/resources/views/components/documents/show/recurring-message.blade.php @@ -33,7 +33,7 @@ @stack('recurring_parent_message_body_start')
{!! trans('recurring.message_parent', [ 'type' => mb_strtolower(trans_choice($textRecurringType, 1)), - 'link' => '' . $document->parent->document_number . '' + 'link' => '' . $document->parent->document_number . '' ]) !!}
@stack('recurring_parent_message_body_end') diff --git a/resources/views/components/transactions/show/recurring-message.blade.php b/resources/views/components/transactions/show/recurring-message.blade.php index d02f4e64a..9308c292d 100644 --- a/resources/views/components/transactions/show/recurring-message.blade.php +++ b/resources/views/components/transactions/show/recurring-message.blade.php @@ -33,7 +33,7 @@ @stack('recurring_parent_message_body_start'){!! trans('recurring.message_parent', [ 'type' => mb_strtolower(trans_choice($textRecurringType, 1)), - 'link' => '' . trans_choice($textRecurringType, 1) . '#' . $transaction->parent->id . '' + 'link' => '' . trans_choice($textRecurringType, 1) . '#' . $transaction->parent->id . '' ]) !!}
@stack('recurring_parent_message_body_end')