Document and Transaction trait getSettingKey function replace get{Document/Transaction}SettingKey
This commit is contained in:
@@ -763,7 +763,7 @@ abstract class Form extends Component
|
||||
$issuedAt = Date::now()->toDateString();
|
||||
}
|
||||
|
||||
$addDays = setting($this->getSettingKey($type, 'payment_terms'), 0) ?: 0;
|
||||
$addDays = setting($this->getDocumentSettingKey($type, 'payment_terms'), 0) ?: 0;
|
||||
|
||||
$dueAt = Date::parse($issuedAt)->addDays($addDays)->toDateString();
|
||||
|
||||
@@ -875,7 +875,7 @@ abstract class Form extends Component
|
||||
return $hideItemName;
|
||||
}
|
||||
|
||||
$hideItemName = setting($this->getSettingKey($type, 'item_name'), false);
|
||||
$hideItemName = setting($this->getDocumentSettingKey($type, 'item_name'), false);
|
||||
|
||||
// if you use settting translation
|
||||
if ($hideItemName === 'hide') {
|
||||
@@ -898,18 +898,18 @@ abstract class Form extends Component
|
||||
}
|
||||
|
||||
// if you use settting translation
|
||||
if (setting($this->getSettingKey($type, 'item_name'), 'items') === 'custom') {
|
||||
if (empty($textItemName = setting($this->getSettingKey($type, 'item_name_input')))) {
|
||||
if (setting($this->getDocumentSettingKey($type, 'item_name'), 'items') === 'custom') {
|
||||
if (empty($textItemName = setting($this->getDocumentSettingKey($type, 'item_name_input')))) {
|
||||
$textItemName = 'general.items';
|
||||
}
|
||||
|
||||
return $textItemName;
|
||||
}
|
||||
|
||||
if (setting($this->getSettingKey($type, 'item_name')) !== null
|
||||
&& (trans(setting($this->getSettingKey($type, 'item_name'))) != setting($this->getSettingKey($type, 'item_name')))
|
||||
if (setting($this->getDocumentSettingKey($type, 'item_name')) !== null
|
||||
&& (trans(setting($this->getDocumentSettingKey($type, 'item_name'))) != setting($this->getDocumentSettingKey($type, 'item_name')))
|
||||
) {
|
||||
return setting($this->getSettingKey($type, 'item_name'));
|
||||
return setting($this->getDocumentSettingKey($type, 'item_name'));
|
||||
}
|
||||
|
||||
$translation = $this->getTextFromConfig($type, 'items');
|
||||
@@ -930,7 +930,7 @@ abstract class Form extends Component
|
||||
|
||||
|
||||
// if you use settting translation
|
||||
if (setting($this->getSettingKey($type, 'hide_item_description'), false)) {
|
||||
if (setting($this->getDocumentSettingKey($type, 'hide_item_description'), false)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -964,7 +964,7 @@ abstract class Form extends Component
|
||||
return $hideItemQuantity;
|
||||
}
|
||||
|
||||
$hideItemQuantity = setting($this->getSettingKey($type, 'quantity_name'), false);
|
||||
$hideItemQuantity = setting($this->getDocumentSettingKey($type, 'quantity_name'), false);
|
||||
|
||||
// if you use settting translation
|
||||
if ($hideItemQuantity === 'hide') {
|
||||
@@ -987,18 +987,18 @@ abstract class Form extends Component
|
||||
}
|
||||
|
||||
// if you use settting translation
|
||||
if (setting($this->getSettingKey($type, 'quantity_name'), 'quantity') === 'custom') {
|
||||
if (empty($textItemQuantity = setting($this->getSettingKey($type, 'quantity_name_input')))) {
|
||||
if (setting($this->getDocumentSettingKey($type, 'quantity_name'), 'quantity') === 'custom') {
|
||||
if (empty($textItemQuantity = setting($this->getDocumentSettingKey($type, 'quantity_name_input')))) {
|
||||
$textItemQuantity = 'invoices.quantity';
|
||||
}
|
||||
|
||||
return $textItemQuantity;
|
||||
}
|
||||
|
||||
if (setting($this->getSettingKey($type, 'quantity_name')) !== null
|
||||
&& (trans(setting($this->getSettingKey($type, 'quantity_name'))) != setting($this->getSettingKey($type, 'quantity_name')))
|
||||
if (setting($this->getDocumentSettingKey($type, 'quantity_name')) !== null
|
||||
&& (trans(setting($this->getDocumentSettingKey($type, 'quantity_name'))) != setting($this->getDocumentSettingKey($type, 'quantity_name')))
|
||||
) {
|
||||
return setting($this->getSettingKey($type, 'quantity_name'));
|
||||
return setting($this->getDocumentSettingKey($type, 'quantity_name'));
|
||||
}
|
||||
|
||||
$translation = $this->getTextFromConfig($type, 'quantity');
|
||||
@@ -1016,7 +1016,7 @@ abstract class Form extends Component
|
||||
return $hideItemPrice;
|
||||
}
|
||||
|
||||
$hideItemPrice = setting($this->getSettingKey($type, 'price_name'), false);
|
||||
$hideItemPrice = setting($this->getDocumentSettingKey($type, 'price_name'), false);
|
||||
|
||||
// if you use settting translation
|
||||
if ($hideItemPrice === 'hide') {
|
||||
@@ -1039,18 +1039,18 @@ abstract class Form extends Component
|
||||
}
|
||||
|
||||
// if you use settting translation
|
||||
if (setting($this->getSettingKey($type, 'price_name'), 'price') === 'custom') {
|
||||
if (empty($textItemPrice = setting($this->getSettingKey($type, 'price_name_input')))) {
|
||||
if (setting($this->getDocumentSettingKey($type, 'price_name'), 'price') === 'custom') {
|
||||
if (empty($textItemPrice = setting($this->getDocumentSettingKey($type, 'price_name_input')))) {
|
||||
$textItemPrice = 'invoices.price';
|
||||
}
|
||||
|
||||
return $textItemPrice;
|
||||
}
|
||||
|
||||
if (setting($this->getSettingKey($type, 'price_name')) !== null
|
||||
&& (trans(setting($this->getSettingKey($type, 'price_name'))) != setting($this->getSettingKey($type, 'price_name')))
|
||||
if (setting($this->getDocumentSettingKey($type, 'price_name')) !== null
|
||||
&& (trans(setting($this->getDocumentSettingKey($type, 'price_name'))) != setting($this->getDocumentSettingKey($type, 'price_name')))
|
||||
) {
|
||||
return setting($this->getSettingKey($type, 'price_name'));
|
||||
return setting($this->getDocumentSettingKey($type, 'price_name'));
|
||||
}
|
||||
|
||||
$translation = $this->getTextFromConfig($type, 'price');
|
||||
@@ -1069,7 +1069,7 @@ abstract class Form extends Component
|
||||
}
|
||||
|
||||
// if you use settting translation
|
||||
if (setting($this->getSettingKey($type, 'hide_amount'), false)) {
|
||||
if (setting($this->getDocumentSettingKey($type, 'hide_amount'), false)) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -1104,7 +1104,7 @@ abstract class Form extends Component
|
||||
}
|
||||
|
||||
// if you use settting translation
|
||||
if ($hideDiscount = setting($this->getSettingKey($type, 'hide_discount'), false)) {
|
||||
if ($hideDiscount = setting($this->getDocumentSettingKey($type, 'hide_discount'), false)) {
|
||||
return $hideDiscount;
|
||||
}
|
||||
|
||||
@@ -1125,7 +1125,7 @@ abstract class Form extends Component
|
||||
}
|
||||
|
||||
// if you use settting translation
|
||||
if ($settingCharLimit = setting($this->getSettingKey($type, 'item_search_chart_limit'), false)) {
|
||||
if ($settingCharLimit = setting($this->getDocumentSettingKey($type, 'item_search_chart_limit'), false)) {
|
||||
return $settingCharLimit;
|
||||
}
|
||||
|
||||
@@ -1149,7 +1149,7 @@ abstract class Form extends Component
|
||||
return $this->document->notes;
|
||||
}
|
||||
|
||||
return setting($this->getSettingKey($this->type, 'notes'));
|
||||
return setting($this->getDocumentSettingKey($this->type, 'notes'));
|
||||
}
|
||||
|
||||
protected function getTextSectionAdvancedTitle($type, $textSectionAdvancedTitle)
|
||||
@@ -1176,7 +1176,7 @@ abstract class Form extends Component
|
||||
return $titleSetting;
|
||||
}
|
||||
|
||||
return setting($this->getSettingKey($type, 'title'));
|
||||
return setting($this->getDocumentSettingKey($type, 'title'));
|
||||
}
|
||||
|
||||
protected function getSubheadingSettingValue($type, $subheadingSetting)
|
||||
@@ -1185,7 +1185,7 @@ abstract class Form extends Component
|
||||
return $subheadingSetting;
|
||||
}
|
||||
|
||||
return setting($this->getSettingKey($type, 'subheading'));
|
||||
return setting($this->getDocumentSettingKey($type, 'subheading'));
|
||||
}
|
||||
|
||||
protected function getFooterValue($footer)
|
||||
@@ -1198,7 +1198,7 @@ abstract class Form extends Component
|
||||
return $this->document->footer;
|
||||
}
|
||||
|
||||
return setting($this->getSettingKey($this->type, 'footer'));
|
||||
return setting($this->getDocumentSettingKey($this->type, 'footer'));
|
||||
}
|
||||
|
||||
protected function getTypeCategory($type, $typeCategory)
|
||||
|
@@ -909,7 +909,7 @@ abstract class Show extends Component
|
||||
return $template;
|
||||
}
|
||||
|
||||
$documentTemplate = setting($this->getSettingKey($type, 'template'), 'default');
|
||||
$documentTemplate = setting($this->getDocumentSettingKey($type, 'template'), 'default');
|
||||
|
||||
return $documentTemplate;
|
||||
}
|
||||
@@ -975,7 +975,7 @@ abstract class Show extends Component
|
||||
}
|
||||
|
||||
// checking setting color
|
||||
$key = $this->getSettingKey($type, 'color');
|
||||
$key = $this->getDocumentSettingKey($type, 'color');
|
||||
|
||||
if (! empty(setting($key))) {
|
||||
$backgroundColor = setting($key);
|
||||
@@ -1000,7 +1000,7 @@ abstract class Show extends Component
|
||||
return $textDocumentTitle;
|
||||
}
|
||||
|
||||
$key = $this->getSettingKey($type, 'title');
|
||||
$key = $this->getDocumentSettingKey($type, 'title');
|
||||
|
||||
if (! empty(setting($key))) {
|
||||
return setting($key);
|
||||
@@ -1021,7 +1021,7 @@ abstract class Show extends Component
|
||||
return $textDocumentSubheading;
|
||||
}
|
||||
|
||||
$key = $this->getSettingKey($type, 'subheading');
|
||||
$key = $this->getDocumentSettingKey($type, 'subheading');
|
||||
|
||||
if (!empty(setting($key))) {
|
||||
return setting($key);
|
||||
@@ -1151,8 +1151,8 @@ abstract class Show extends Component
|
||||
}
|
||||
|
||||
// if you use settting translation
|
||||
if (setting($this->getSettingKey($type, 'item_name'), 'items') == 'custom') {
|
||||
if (empty($textItems = setting($this->getSettingKey($type, 'item_name_input')))) {
|
||||
if (setting($this->getDocumentSettingKey($type, 'item_name'), 'items') == 'custom') {
|
||||
if (empty($textItems = setting($this->getDocumentSettingKey($type, 'item_name_input')))) {
|
||||
$textItems = 'general.items';
|
||||
}
|
||||
|
||||
@@ -1175,8 +1175,8 @@ abstract class Show extends Component
|
||||
}
|
||||
|
||||
// if you use settting translation
|
||||
if (setting($this->getSettingKey($type, 'quantity_name'), 'quantity') === 'custom') {
|
||||
if (empty($textQuantity = setting($this->getSettingKey($type, 'quantity_name_input')))) {
|
||||
if (setting($this->getDocumentSettingKey($type, 'quantity_name'), 'quantity') === 'custom') {
|
||||
if (empty($textQuantity = setting($this->getDocumentSettingKey($type, 'quantity_name_input')))) {
|
||||
$textQuantity = 'invoices.quantity';
|
||||
}
|
||||
|
||||
@@ -1199,8 +1199,8 @@ abstract class Show extends Component
|
||||
}
|
||||
|
||||
// if you use settting translation
|
||||
if (setting($this->getSettingKey($type, 'price_name'), 'price') === 'custom') {
|
||||
if (empty($textPrice = setting($this->getSettingKey($type, 'price_name_input')))) {
|
||||
if (setting($this->getDocumentSettingKey($type, 'price_name'), 'price') === 'custom') {
|
||||
if (empty($textPrice = setting($this->getDocumentSettingKey($type, 'price_name_input')))) {
|
||||
$textPrice = 'invoices.price';
|
||||
}
|
||||
|
||||
@@ -1255,7 +1255,7 @@ abstract class Show extends Component
|
||||
}
|
||||
|
||||
// if you use settting translation
|
||||
if ($hideName = setting($this->getSettingKey($type, 'item_name'), false) && $hideName == 'hide') {
|
||||
if ($hideName = setting($this->getDocumentSettingKey($type, 'item_name'), false) && $hideName == 'hide') {
|
||||
return $hideName;
|
||||
}
|
||||
|
||||
@@ -1276,7 +1276,7 @@ abstract class Show extends Component
|
||||
}
|
||||
|
||||
// if you use settting translation
|
||||
if ($hideDescription = setting($this->getSettingKey($type, 'hide_item_description'), false)) {
|
||||
if ($hideDescription = setting($this->getDocumentSettingKey($type, 'hide_item_description'), false)) {
|
||||
return $hideDescription;
|
||||
}
|
||||
|
||||
@@ -1297,7 +1297,7 @@ abstract class Show extends Component
|
||||
}
|
||||
|
||||
// if you use settting translation
|
||||
if ($hideQuantity = setting($this->getSettingKey($type, 'hide_quantity'), false) && $hideQuantity == 'hide') {
|
||||
if ($hideQuantity = setting($this->getDocumentSettingKey($type, 'hide_quantity'), false) && $hideQuantity == 'hide') {
|
||||
return $hideQuantity;
|
||||
}
|
||||
|
||||
@@ -1318,7 +1318,7 @@ abstract class Show extends Component
|
||||
}
|
||||
|
||||
// if you use settting translation
|
||||
if ($hidePrice = setting($this->getSettingKey($type, 'hide_price'), false) && $hidePrice == 'hide') {
|
||||
if ($hidePrice = setting($this->getDocumentSettingKey($type, 'hide_price'), false) && $hidePrice == 'hide') {
|
||||
return $hidePrice;
|
||||
}
|
||||
|
||||
@@ -1339,7 +1339,7 @@ abstract class Show extends Component
|
||||
}
|
||||
|
||||
// if you use settting translation
|
||||
if ($hideDiscount = setting($this->getSettingKey($type, 'hide_discount'), false)) {
|
||||
if ($hideDiscount = setting($this->getDocumentSettingKey($type, 'hide_discount'), false)) {
|
||||
return $hideDiscount;
|
||||
}
|
||||
|
||||
@@ -1360,7 +1360,7 @@ abstract class Show extends Component
|
||||
}
|
||||
|
||||
// if you use settting translation
|
||||
if ($hideAmount = setting($this->getSettingKey($type, 'hide_amount'), false)) {
|
||||
if ($hideAmount = setting($this->getDocumentSettingKey($type, 'hide_amount'), false)) {
|
||||
return $hideAmount;
|
||||
}
|
||||
|
||||
|
@@ -209,7 +209,7 @@ abstract class Template extends Component
|
||||
return $template;
|
||||
}
|
||||
|
||||
$documentTemplate = setting($this->getSettingKey($type, 'template'), 'default');
|
||||
$documentTemplate = setting($this->getDocumentSettingKey($type, 'template'), 'default');
|
||||
|
||||
return $documentTemplate;
|
||||
}
|
||||
@@ -275,7 +275,7 @@ abstract class Template extends Component
|
||||
}
|
||||
|
||||
// checking setting color
|
||||
$key = $this->getSettingKey($type, 'color');
|
||||
$key = $this->getDocumentSettingKey($type, 'color');
|
||||
|
||||
if (! empty(setting($key))) {
|
||||
$backgroundColor = setting($key);
|
||||
@@ -300,7 +300,7 @@ abstract class Template extends Component
|
||||
return $textDocumentTitle;
|
||||
}
|
||||
|
||||
$key = $this->getSettingKey($type, 'title');
|
||||
$key = $this->getDocumentSettingKey($type, 'title');
|
||||
|
||||
if (! empty(setting($key))) {
|
||||
return setting($key);
|
||||
@@ -321,7 +321,7 @@ abstract class Template extends Component
|
||||
return $textDocumentSubheading;
|
||||
}
|
||||
|
||||
$key = $this->getSettingKey($type, 'subheading');
|
||||
$key = $this->getDocumentSettingKey($type, 'subheading');
|
||||
|
||||
if (! empty(setting($key))) {
|
||||
return setting($key);
|
||||
@@ -451,18 +451,18 @@ abstract class Template extends Component
|
||||
}
|
||||
|
||||
// if you use settting translation
|
||||
if (setting($this->getSettingKey($type, 'item_name'), 'items') === 'custom') {
|
||||
if (empty($textItems = setting($this->getSettingKey($type, 'item_name_input')))) {
|
||||
if (setting($this->getDocumentSettingKey($type, 'item_name'), 'items') === 'custom') {
|
||||
if (empty($textItems = setting($this->getDocumentSettingKey($type, 'item_name_input')))) {
|
||||
$textItems = 'general.items';
|
||||
}
|
||||
|
||||
return $textItems;
|
||||
}
|
||||
|
||||
if (setting($this->getSettingKey($type, 'item_name')) !== null
|
||||
&& (trans(setting($this->getSettingKey($type, 'item_name'))) != setting($this->getSettingKey($type, 'item_name')))
|
||||
if (setting($this->getDocumentSettingKey($type, 'item_name')) !== null
|
||||
&& (trans(setting($this->getDocumentSettingKey($type, 'item_name'))) != setting($this->getDocumentSettingKey($type, 'item_name')))
|
||||
) {
|
||||
return setting($this->getSettingKey($type, 'item_name'));
|
||||
return setting($this->getDocumentSettingKey($type, 'item_name'));
|
||||
}
|
||||
|
||||
$translation = $this->getTextFromConfig($type, 'items');
|
||||
@@ -481,18 +481,18 @@ abstract class Template extends Component
|
||||
}
|
||||
|
||||
// if you use settting translation
|
||||
if (setting($this->getSettingKey($type, 'quantity_name'), 'quantity') === 'custom') {
|
||||
if (empty($textQuantity = setting($this->getSettingKey($type, 'quantity_name_input')))) {
|
||||
if (setting($this->getDocumentSettingKey($type, 'quantity_name'), 'quantity') === 'custom') {
|
||||
if (empty($textQuantity = setting($this->getDocumentSettingKey($type, 'quantity_name_input')))) {
|
||||
$textQuantity = 'invoices.quantity';
|
||||
}
|
||||
|
||||
return $textQuantity;
|
||||
}
|
||||
|
||||
if (setting($this->getSettingKey($type, 'quantity_name')) !== null
|
||||
&& (trans(setting($this->getSettingKey($type, 'quantity_name'))) != setting($this->getSettingKey($type, 'quantity_name')))
|
||||
if (setting($this->getDocumentSettingKey($type, 'quantity_name')) !== null
|
||||
&& (trans(setting($this->getDocumentSettingKey($type, 'quantity_name'))) != setting($this->getDocumentSettingKey($type, 'quantity_name')))
|
||||
) {
|
||||
return setting($this->getSettingKey($type, 'quantity_name'));
|
||||
return setting($this->getDocumentSettingKey($type, 'quantity_name'));
|
||||
}
|
||||
|
||||
$translation = $this->getTextFromConfig($type, 'quantity');
|
||||
@@ -511,18 +511,18 @@ abstract class Template extends Component
|
||||
}
|
||||
|
||||
// if you use settting translation
|
||||
if (setting($this->getSettingKey($type, 'price_name'), 'price') === 'custom') {
|
||||
if (empty($textPrice = setting($this->getSettingKey($type, 'price_name_input')))) {
|
||||
if (setting($this->getDocumentSettingKey($type, 'price_name'), 'price') === 'custom') {
|
||||
if (empty($textPrice = setting($this->getDocumentSettingKey($type, 'price_name_input')))) {
|
||||
$textPrice = 'invoices.price';
|
||||
}
|
||||
|
||||
return $textPrice;
|
||||
}
|
||||
|
||||
if (setting($this->getSettingKey($type, 'price_name')) !== null
|
||||
&& (trans(setting($this->getSettingKey($type, 'price_name'))) != setting($this->getSettingKey($type, 'price_name')))
|
||||
if (setting($this->getDocumentSettingKey($type, 'price_name')) !== null
|
||||
&& (trans(setting($this->getDocumentSettingKey($type, 'price_name'))) != setting($this->getDocumentSettingKey($type, 'price_name')))
|
||||
) {
|
||||
return setting($this->getSettingKey($type, 'price_name'));
|
||||
return setting($this->getDocumentSettingKey($type, 'price_name'));
|
||||
}
|
||||
|
||||
$translation = $this->getTextFromConfig($type, 'price');
|
||||
@@ -590,7 +590,7 @@ abstract class Template extends Component
|
||||
}
|
||||
|
||||
// if you use settting translation
|
||||
if ($hideName = setting($this->getSettingKey($type, 'item_name'), false) && $hideName == 'hide') {
|
||||
if ($hideName = setting($this->getDocumentSettingKey($type, 'item_name'), false) && $hideName == 'hide') {
|
||||
return $hideName;
|
||||
}
|
||||
|
||||
@@ -611,7 +611,7 @@ abstract class Template extends Component
|
||||
}
|
||||
|
||||
// if you use settting translation
|
||||
if ($hideDescription = setting($this->getSettingKey($type, 'hide_item_description'), false)) {
|
||||
if ($hideDescription = setting($this->getDocumentSettingKey($type, 'hide_item_description'), false)) {
|
||||
return $hideDescription;
|
||||
}
|
||||
|
||||
@@ -632,7 +632,7 @@ abstract class Template extends Component
|
||||
}
|
||||
|
||||
// if you use settting translation
|
||||
if ($hideQuantity = setting($this->getSettingKey($type, 'hide_quantity'), false) && $hideQuantity == 'hide') {
|
||||
if ($hideQuantity = setting($this->getDocumentSettingKey($type, 'hide_quantity'), false) && $hideQuantity == 'hide') {
|
||||
return $hideQuantity;
|
||||
}
|
||||
|
||||
@@ -653,7 +653,7 @@ abstract class Template extends Component
|
||||
}
|
||||
|
||||
// if you use settting translation
|
||||
if ($hidePrice = setting($this->getSettingKey($type, 'hide_price'), false) && $hidePrice == 'hide') {
|
||||
if ($hidePrice = setting($this->getDocumentSettingKey($type, 'hide_price'), false) && $hidePrice == 'hide') {
|
||||
return $hidePrice;
|
||||
}
|
||||
|
||||
@@ -674,7 +674,7 @@ abstract class Template extends Component
|
||||
}
|
||||
|
||||
// if you use settting translation
|
||||
if ($hideDiscount = setting($this->getSettingKey($type, 'hide_discount'), false)) {
|
||||
if ($hideDiscount = setting($this->getDocumentSettingKey($type, 'hide_discount'), false)) {
|
||||
return $hideDiscount;
|
||||
}
|
||||
|
||||
@@ -695,7 +695,7 @@ abstract class Template extends Component
|
||||
}
|
||||
|
||||
// if you use settting translation
|
||||
if ($hideAmount = setting($this->getSettingKey($type, 'hide_amount'), false)) {
|
||||
if ($hideAmount = setting($this->getDocumentSettingKey($type, 'hide_amount'), false)) {
|
||||
return $hideAmount;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user