close #2153 Added: Making Customer/Vendor clickable on invoice/bill page #mtdg9n
This commit is contained in:
parent
65bad4d6f7
commit
0640fca05f
@ -95,6 +95,9 @@ abstract class DocumentShow extends Base
|
||||
/** @var string */
|
||||
public $routeButtonPaid;
|
||||
|
||||
/** @var string */
|
||||
public $routeContactShow;
|
||||
|
||||
/** @var string */
|
||||
public $permissionCreate;
|
||||
|
||||
@ -373,7 +376,7 @@ abstract class DocumentShow extends Base
|
||||
$type, $document, $documentTemplate = '', $logo = '', $backgroundColor = '', string $signedUrl = '', $histories = [], $transactions = [],
|
||||
string $textRecurringType = '', string $textStatusMessage = '', string $textHistories = '', string $textHistoryStatus = '',
|
||||
string $routeButtonAddNew = '', string $routeButtonEdit = '', string $routeButtonDuplicate = '', string $routeButtonPrint = '', string $routeButtonPdf = '', string $routeButtonCancelled = '', string $routeButtonDelete = '', string $routeButtonCustomize = '', string $routeButtonSent = '',
|
||||
string $routeButtonReceived = '', string $routeButtonEmail = '', string $routeButtonPaid = '',
|
||||
string $routeButtonReceived = '', string $routeButtonEmail = '', string $routeButtonPaid = '', string $routeContactShow = '',
|
||||
bool $checkButtonReconciled = true, bool $checkButtonCancelled = true,
|
||||
string $permissionCreate = '', string $permissionUpdate = '', string $permissionDelete = '', string $permissionTransactionDelete = '', string $permissionButtonCustomize = '',
|
||||
bool $hideButtonGroupDivider1 = false, bool $hideButtonGroupDivider2 = false, bool $hideButtonGroupDivider3 = false,
|
||||
@ -424,6 +427,7 @@ abstract class DocumentShow extends Base
|
||||
$this->routeButtonCustomize = $this->getRouteButtonCustomize($type, $routeButtonCustomize);
|
||||
$this->routeButtonDelete = $this->getRouteButtonDelete($type, $routeButtonDelete);
|
||||
$this->routeButtonPaid = $this->getRouteButtonPaid($type, $routeButtonPaid);
|
||||
$this->routeContactShow = $this->getRouteContactShow($type, $routeContactShow);
|
||||
|
||||
$this->permissionCreate = $this->getPermissionCreate($type, $permissionCreate);
|
||||
$this->permissionUpdate = $this->getPermissionUpdate($type, $permissionUpdate);
|
||||
@ -886,6 +890,36 @@ abstract class DocumentShow extends Base
|
||||
return 'invoices.paid';
|
||||
}
|
||||
|
||||
protected function getRouteContactShow($type, $routeContactShow)
|
||||
{
|
||||
if (!empty($routeContactShow)) {
|
||||
return $routeContactShow;
|
||||
}
|
||||
|
||||
//example route parameter.
|
||||
$parameter = 1;
|
||||
|
||||
$route = Str::plural(config('type.' . $type . '.contact_type'), 2) . '.show';
|
||||
|
||||
try {
|
||||
route($route, $config_parameters);
|
||||
} catch (\Exception $e) {
|
||||
try {
|
||||
$route = Str::plural($type, 2) . '.' . $config_key;
|
||||
|
||||
route($route, $config_parameters);
|
||||
} catch (\Exception $e) {
|
||||
$route = '';
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($route)) {
|
||||
return $route;
|
||||
}
|
||||
|
||||
return 'customers.show';
|
||||
}
|
||||
|
||||
protected function getRouteButtonSent($type, $routeButtonSent)
|
||||
{
|
||||
if (!empty($routeButtonSent)) {
|
||||
|
@ -9,6 +9,7 @@
|
||||
hide-header-contact="{{ $hideHeaderContact }}"
|
||||
text-header-contact="{{ $textHeaderContact }}"
|
||||
class-header-contact="{{ $classHeaderContact }}"
|
||||
route-contact-show="{{ $routeContactShow }}"
|
||||
hide-header-amount="{{ $hideHeaderAmount }}"
|
||||
text-header-amount="{{ $textHeaderAmount }}"
|
||||
class-header-amount="{{ $classHeaderAmount }}"
|
||||
|
@ -25,7 +25,9 @@
|
||||
|
||||
<strong>
|
||||
<span class="float-left">
|
||||
{{ $document->contact_name }}
|
||||
<a href="{{ route($routeContactShow, $document->contact_id) }}">
|
||||
{{ $document->contact_name }}
|
||||
</a>
|
||||
</span>
|
||||
</strong>
|
||||
<br><br>
|
||||
|
Loading…
x
Reference in New Issue
Block a user