connection between docs or transactions added to recurring messages part #1pbthq3

This commit is contained in:
Sevan Nerse
2021-11-03 18:37:57 +03:00
parent 2087a2de3b
commit b6f5394bbd
7 changed files with 112 additions and 1 deletions

View File

@ -314,6 +314,12 @@ abstract class TransactionShow extends Base
/** @var string */
public $classFooterHistories;
/** @var string */
public $textRecurringType;
/** @var bool */
public $hideRecurringMessage;
/**
* Create a new component instance.
*
@ -346,7 +352,7 @@ abstract class TransactionShow extends Base
bool $hideAttachment = false, $attachment = [],
bool $hideFooter = false, bool $hideFooterHistories = false, $histories = [],
string $textHistories = '', string $classFooterHistories = ''
string $textHistories = '', string $classFooterHistories = '', string $textRecurringType = '', bool $hideRecurringMessage = false
) {
$this->type = $type;
$this->transaction = $transaction;
@ -354,6 +360,8 @@ abstract class TransactionShow extends Base
$this->logo = $this->getLogo($logo);
$this->payment_methods = ($payment_methods) ?: Modules::getPaymentMethods('all');
$this->date_format = $this->getCompanyDateFormat();
$this->textRecurringType = $this->getTextRecurringType($type, $textRecurringType);
$this->hideRecurringMessage = $hideRecurringMessage;
// Navbar Hide
$this->hideButtonAddNew = $hideButtonAddNew;
@ -1276,4 +1284,21 @@ abstract class TransactionShow extends Base
return 'col-sm-6 col-md-6 col-lg-6 col-xl-6';
}
protected function getTextRecurringType($type, $textRecurringType)
{
if (!empty($textRecurringType)) {
return $textRecurringType;
}
$default_key = config('type.' . $type . '.translation.prefix');
$translation = $this->getTextFromConfig($type, 'recurring_tye', $default_key);
if (!empty($translation)) {
return $translation;
}
return 'general.revenues';
}
}