From fd1f6b48211a4088eff325f3cd63d8437ce298c0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Wed, 30 Jun 2021 17:59:43 +0300 Subject: [PATCH] Transaction show contact show and contact pages styling.. --- .../View/Components/TransactionShow.php | 48 ++++++++++++++++--- .../transactions/show/header.blade.php | 7 ++- .../views/purchases/vendors/show.blade.php | 2 +- .../views/sales/customers/show.blade.php | 4 +- 4 files changed, 49 insertions(+), 12 deletions(-) diff --git a/app/Abstracts/View/Components/TransactionShow.php b/app/Abstracts/View/Components/TransactionShow.php index 4769544fc..be39a35e7 100644 --- a/app/Abstracts/View/Components/TransactionShow.php +++ b/app/Abstracts/View/Components/TransactionShow.php @@ -94,6 +94,9 @@ abstract class TransactionShow extends Base /** @var string */ public $routeButtonPrint; + /** @var string */ + public $routeContactShow; + /** @var string */ public $signedUrl; @@ -319,17 +322,17 @@ abstract class TransactionShow extends Base public function __construct( $type, $transaction, $transactionTemplate = '', $logo = '', array $payment_methods = [], bool $hideButtonAddNew = false, bool $hideButtonMoreActions = false, bool $hideButtonEdit = false, bool $hideButtonDuplicate = false, bool $hideButtonPrint = false, bool $hideButtonShare = false, - bool $hideButtonEmail = false, bool $hideButtonPdf = false, bool $hideButtonDelete = false, bool $checkButtonReconciled = true, + bool $hideButtonEmail = false, bool $hideButtonPdf = false, bool $hideButtonDelete = false, bool $checkButtonReconciled = true, bool $hideButtonGroupDivider1 = false, bool $hideButtonGroupDivider2 = false, bool $hideButtonGroupDivider3 = false, string $permissionCreate = '', string $permissionUpdate = '', string $permissionDelete = '', string $routeButtonAddNew = '', string $routeButtonEdit = '', string $routeButtonDuplicate = '', string $routeButtonPrint = '', string $signedUrl = '', - string $routeButtonEmail = '', string $routeButtonPdf = '', string $routeButtonDelete = '', + string $routeButtonEmail = '', string $routeButtonPdf = '', string $routeButtonDelete = '', string $routeContactShow = '', string $textDeleteModal = '', bool $hideHeader = false, bool $hideHeaderAccount = false, bool $hideHeaderCategory = false, bool $hideHeaderContact = false, bool $hideHeaderAmount = false, bool $hideHeaderPaidAt = false, string $textHeaderAccount = '', string $textHeaderCategory = '', string $textHeaderContact = '', string $textHeaderAmount = '', string $textHeaderPaidAt = '', string $classHeaderAccount = '', string $classHeaderCategory = '', string $classHeaderContact = '', string $classHeaderAmount = '', string $classHeaderPaidAt = '', - bool $hideCompany = false, bool $hideCompanyLogo = false, bool $hideCompanyDetails = false, bool $hideCompanyName = false, bool $hideCompanyAddress = false, + bool $hideCompany = false, bool $hideCompanyLogo = false, bool $hideCompanyDetails = false, bool $hideCompanyName = false, bool $hideCompanyAddress = false, bool $hideCompanyTaxNumber = false, bool $hideCompanyPhone = false, bool $hideCompanyEmail = false, bool $hideContentTitle = false,bool $hidePaidAt = false, bool $hideAccount = false, bool $hideCategory = false, bool $hidePaymentMethods = false, bool $hideReference = false, bool $hideDescription = false, bool $hideAmount = false, @@ -342,7 +345,7 @@ abstract class TransactionShow extends Base string $routeDocumentShow = '', bool $hideAttachment = false, $attachment = [], - bool $hideFooter = false, bool $hideFooterHistories = false, $histories = [], + bool $hideFooter = false, bool $hideFooterHistories = false, $histories = [], string $textHistories = '', string $classFooterHistories = '' ) { $this->type = $type; @@ -381,11 +384,12 @@ abstract class TransactionShow extends Base $this->routeButtonEmail = $this->getRouteButtonEmail($type, $routeButtonEmail); $this->routeButtonPdf = $this->getRouteButtonPdf($type, $routeButtonPdf); $this->routeButtonDelete = $this->getRouteButtonDelete($type, $routeButtonDelete); + $this->routeContactShow = $this->getRouteContactShow($type, $routeContactShow); // Navbar Text $this->textDeleteModal = $textDeleteModal; - // Header Hide + // Header Hide $this->hideHeader = $hideHeader; $this->hideHeaderAccount = $hideHeaderAccount; @@ -483,7 +487,7 @@ abstract class TransactionShow extends Base $this->hideFooter = $hideFooter; $this->hideFooterHistories = $hideFooterHistories; - // Histories + // Histories $this->histories = $this->getHistories($histories); $this->textHistories = $this->getTextHistories($type, $textHistories); $this->classFooterHistories = $this->getClassFooterHistories($type, $classFooterHistories); @@ -713,6 +717,36 @@ abstract class TransactionShow extends Base return 'revenues.destroy'; } + 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 getPermissionCreate($type, $permissionCreate) { if (!empty($permissionCreate)) { @@ -1242,4 +1276,4 @@ abstract class TransactionShow extends Base return 'col-sm-6 col-md-6 col-lg-6 col-xl-6'; } -} \ No newline at end of file +} diff --git a/resources/views/components/transactions/show/header.blade.php b/resources/views/components/transactions/show/header.blade.php index bc31572be..27c00baf0 100644 --- a/resources/views/components/transactions/show/header.blade.php +++ b/resources/views/components/transactions/show/header.blade.php @@ -39,7 +39,10 @@ - {{ $transaction->contact->name }} + + {{ $transaction->contact->name }} + +

@@ -78,4 +81,4 @@ @endif @stack('header_paid_at_end') - \ No newline at end of file + diff --git a/resources/views/purchases/vendors/show.blade.php b/resources/views/purchases/vendors/show.blade.php index 31b13e734..3fe301339 100644 --- a/resources/views/purchases/vendors/show.blade.php +++ b/resources/views/purchases/vendors/show.blade.php @@ -245,7 +245,7 @@ @foreach($transactions as $item) - @date($item->paid_at) + @date($item->paid_at) @money($item->amount, $item->currency_code, true) {{ $item->category->name }} {{ $item->account->name }} diff --git a/resources/views/sales/customers/show.blade.php b/resources/views/sales/customers/show.blade.php index 8bf89d2b1..e91087631 100644 --- a/resources/views/sales/customers/show.blade.php +++ b/resources/views/sales/customers/show.blade.php @@ -38,7 +38,7 @@ @stack('revenue_button_end') - + @stack('delete_button_start') @can('delete-sales-customers') {!! Form::deleteLink($customer, 'customers.destroy') !!} @@ -254,7 +254,7 @@ @foreach($transactions as $item) - @date($item->paid_at) + @date($item->paid_at) @money($item->amount, $item->currency_code, true) {{ $item->category->name }} {{ $item->account->name }}