From 781ae067e90f00f283fd0c8818c7c96618962ead Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Wed, 13 Jan 2021 14:01:15 +0300 Subject: [PATCH] close #1752 Fixed: Exception in documents "empty" page --- app/Abstracts/View/Components/DocumentIndex.php | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/app/Abstracts/View/Components/DocumentIndex.php b/app/Abstracts/View/Components/DocumentIndex.php index 5252c8f9c..475788953 100644 --- a/app/Abstracts/View/Components/DocumentIndex.php +++ b/app/Abstracts/View/Components/DocumentIndex.php @@ -293,7 +293,13 @@ abstract class DocumentIndex extends Base return $page; } - return config('type.' . $type . '.route.prefix', 'invoices'); + $page = config('type.' . $type . '.route.prefix', 'invoices'); + + if ($alias = config('type.' . $type . '.alias')) { + $page = $alias . '.' . $page; + } + + return $page; } protected function getDocsPath($type, $docsPath) @@ -309,16 +315,14 @@ abstract class DocumentIndex extends Base } switch ($type) { - case 'sale': - case 'income': - case 'invoice': - $docsPath = 'sales/invoices'; - break; case 'bill': case 'expense': case 'purchase': $docsPath = 'purchases/bills'; break; + default: + $docsPath = 'sales/invoices'; + break; } return $docsPath;