Skip to content

Commit

Permalink
fixed show page of recurring transactions
Browse files Browse the repository at this point in the history
  • Loading branch information
denisdulici committed Jun 4, 2022
1 parent 6fd4ab9 commit d91f3c0
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
24 changes: 23 additions & 1 deletion app/Abstracts/View/Components/Transactions/Show.php
Expand Up @@ -276,6 +276,9 @@ abstract class Show extends Component
/** @var string */
public $routeDocumentShow;

/** @var string */
public $routeTransactionShow;

/** @var bool */
public $hideSchedule;

Expand Down Expand Up @@ -321,7 +324,7 @@ public function __construct(
bool $hideContactPhone = false, bool $hideContactEmail = false,
bool $hideRelated = false, bool $hideRelatedDocumentNumber = false, bool $hideRelatedContact = false, bool $hideRelatedDocumentDate = false, bool $hideRelatedDocumentAmount = false, bool $hideRelatedAmount = false,
string $textRelatedTransansaction = '', string $textRelatedDocumentNumber = '', string $textRelatedContact = '', string $textRelatedDocumentDate = '', string $textRelatedDocumentAmount = '', string $textRelatedAmount = '',
string $routeDocumentShow = '', string $textButtonAddNew = '',
string $routeDocumentShow = '', string $routeTransactionShow = '', string $textButtonAddNew = '',

bool $hideSchedule = false, bool $hideChildren = false, bool $hideAttachment = false, $attachment = [],
array $connectTranslations = [], string $textRecurringType = '', bool $hideRecurringMessage = false
Expand Down Expand Up @@ -442,6 +445,7 @@ public function __construct(
$this->textRelatedAmount = $this->getTextRelatedAmount($type, $textRelatedAmount);

$this->routeDocumentShow = $this->routeDocumentShow($type, $routeDocumentShow);
$this->routeTransactionShow = $this->routeTransactionShow($type, $routeTransactionShow);

// Attachment data..
$this->attachment = '';
Expand Down Expand Up @@ -1076,6 +1080,24 @@ protected function routeDocumentShow($type, $routeDocumentShow)
return 'invoices.show';
}

protected function routeTransactionShow($type, $routeTransactionShow)
{
if (! empty($routeTransactionShow)) {
return $routeTransactionShow;
}

//example route parameter.
$parameter = 1;

$route = $this->getRouteFromConfig($type, 'show', $parameter);

if (! empty($route)) {
return $route;
}

return 'transactions.show';
}

protected function getTextRecurringType($type, $textRecurringType)
{
if (! empty($textRecurringType)) {
Expand Down
Expand Up @@ -18,7 +18,7 @@
@php
$recurring_message = trans('recurring.message_parent', [
'type' => mb_strtolower(trans_choice($textRecurringType, 1)),
'link' => '<a href="' . route(mb_strtolower(trans_choice($textRecurringType, 2)) . '.show', $parent->id) . '"><u>' . $parent->document_number . '</u></a>'
'link' => '<a href="' . route($routeTransactionShow, $parent->id) . '"><u>' . $parent->number . '</u></a>'
]);
@endphp

Expand Down

0 comments on commit d91f3c0

Please sign in to comment.