Document and Transaction trait getSettingKey function replace get{Document/Transaction}SettingKey
This commit is contained in:
@@ -29,6 +29,21 @@ trait Documents
|
||||
return ! $this->isRecurring();
|
||||
}
|
||||
|
||||
public function getRecurringDocumentTypes() : array
|
||||
{
|
||||
$types = array_keys(config('type.document'));
|
||||
|
||||
$recurring_types = [];
|
||||
|
||||
foreach ($types as $type) {
|
||||
if (Str::endsWith($type, '-recurring')) {
|
||||
$recurring_types[] = $type;
|
||||
}
|
||||
}
|
||||
|
||||
return $recurring_types;
|
||||
}
|
||||
|
||||
public function getNextDocumentNumber(string $type): string
|
||||
{
|
||||
if ($alias = config('type.document.' . $type . '.alias')) {
|
||||
@@ -138,7 +153,13 @@ trait Documents
|
||||
return 'documents.statuses.';
|
||||
}
|
||||
|
||||
// This function will be remoed in the future
|
||||
protected function getSettingKey($type, $setting_key)
|
||||
{
|
||||
return $this->getDocumentSettingKey($type, $setting_key);
|
||||
}
|
||||
|
||||
protected function getDocumentSettingKey($type, $setting_key)
|
||||
{
|
||||
$key = '';
|
||||
$alias = config('type.document.' . $type . '.alias');
|
||||
|
||||
@@ -132,7 +132,7 @@ trait Transactions
|
||||
return Str::slug($transaction->id, $separator, language()->getShortCode());
|
||||
}
|
||||
|
||||
protected function getSettingKey(string $type, string $setting_key): string
|
||||
protected function getTransactionSettingKey(string $type, string $setting_key): string
|
||||
{
|
||||
$key = '';
|
||||
$alias = config('type.transaction.' . $type . '.alias');
|
||||
|
||||
Reference in New Issue
Block a user