close #1752 Fixed: Exception in documents "empty" page

This commit is contained in:
Cüneyt Şentürk 2021-01-13 14:01:15 +03:00
parent 61247dd5ae
commit 781ae067e9

View File

@ -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;