From 8c2907fafc34e0b30d368b608ad857f28e748dc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Wed, 27 Jan 2021 19:14:48 +0300 Subject: [PATCH] Document column select custom and empty column issue solved.. --- app/Abstracts/View/Components/DocumentForm.php | 18 +++++++++++++++--- .../View/Components/DocumentTemplate.php | 18 +++++++++++++++--- 2 files changed, 30 insertions(+), 6 deletions(-) diff --git a/app/Abstracts/View/Components/DocumentForm.php b/app/Abstracts/View/Components/DocumentForm.php index f97a88c16..cb189baaf 100644 --- a/app/Abstracts/View/Components/DocumentForm.php +++ b/app/Abstracts/View/Components/DocumentForm.php @@ -691,7 +691,11 @@ abstract class DocumentForm extends Base // if you use settting translation if (setting($type . '.item_name', 'items') == 'custom') { - return setting($type . '.item_name_input'); + if (empty($textItems = setting($type . '.item_name_input'))) { + $textItems = 'general.items'; + } + + return $textItems; } $translation = $this->getTextFromConfig($type, 'items'); @@ -711,7 +715,11 @@ abstract class DocumentForm extends Base // if you use settting translation if (setting($type . '.quantity_name', 'quantity') == 'custom') { - return setting($type . '.quantity_name_input'); + if (empty($textQuantity = setting($type . '.quantity_name_input'))) { + $textQuantity = 'invoices.quantity'; + } + + return $textQuantity; } $translation = $this->getTextFromConfig($type, 'quantity'); @@ -731,7 +739,11 @@ abstract class DocumentForm extends Base // if you use settting translation if (setting($type . '.price_name', 'price') == 'custom') { - return setting($type . '.price_name_input'); + if (empty($textPrice = setting($type . '.price_name_input'))) { + $textPrice = 'invoices.price'; + } + + return $textPrice; } $translation = $this->getTextFromConfig($type, 'price'); diff --git a/app/Abstracts/View/Components/DocumentTemplate.php b/app/Abstracts/View/Components/DocumentTemplate.php index 589687f65..798dcdbf8 100644 --- a/app/Abstracts/View/Components/DocumentTemplate.php +++ b/app/Abstracts/View/Components/DocumentTemplate.php @@ -348,7 +348,11 @@ abstract class DocumentTemplate extends Base // if you use settting translation if (setting($type . '.item_name', 'items') == 'custom') { - return setting($type . '.item_name_input'); + if (empty($textItems = setting($type . '.item_name_input'))) { + $textItems = 'general.items'; + } + + return $textItems; } $translation = $this->getTextFromConfig($type, 'items'); @@ -368,7 +372,11 @@ abstract class DocumentTemplate extends Base // if you use settting translation if (setting($type . '.quantity_name', 'quantity') == 'custom') { - return setting($type . '.quantity_name_input'); + if (empty($textQuantity = setting($type . '.quantity_name_input'))) { + $textQuantity = 'invoices.quantity'; + } + + return $textQuantity; } $translation = $this->getTextFromConfig($type, 'quantity'); @@ -388,7 +396,11 @@ abstract class DocumentTemplate extends Base // if you use settting translation if (setting($type . '.price_name', 'price') == 'custom') { - return setting($type . '.price_name_input'); + if (empty($textPrice = setting($type . '.price_name_input'))) { + $textPrice = 'invoices.price'; + } + + return $textPrice; } $translation = $this->getTextFromConfig($type, 'price');