From 6f0a77dec82332febe1da0790ec37d049a96b104 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Thu, 24 Nov 2022 18:29:17 +0300 Subject: [PATCH 1/2] Fixed document name, quantity and price hide feature.. --- app/Abstracts/View/Components/Documents/Form.php | 16 ++++++++-------- app/Abstracts/View/Components/Documents/Show.php | 12 ++++++------ .../View/Components/Documents/Template.php | 12 ++++++------ 3 files changed, 20 insertions(+), 20 deletions(-) diff --git a/app/Abstracts/View/Components/Documents/Form.php b/app/Abstracts/View/Components/Documents/Form.php index 606488315..34f2040b4 100644 --- a/app/Abstracts/View/Components/Documents/Form.php +++ b/app/Abstracts/View/Components/Documents/Form.php @@ -874,8 +874,8 @@ abstract class Form extends Component } // if you use settting translation - if ($hideName = setting($this->getSettingKey($type, 'hide_item_name'), false)) { - return $hideName; + if ($hideItemName = setting($this->getSettingKey($type, 'item_name'), false) && $hideItemName == 'hide') { + return $hideItemName; } $hide = $this->getHideFromConfig($type, 'name'); @@ -885,7 +885,7 @@ abstract class Form extends Component } // @todo what return value invoice or always false?? - return setting('invoice.hide_item_name', $hideName); + return setting('invoice.item_name', $hideItemName) == 'hide' ? true : false; } protected function getTextItemName($type, $textItemName) @@ -925,7 +925,7 @@ abstract class Form extends Component } // if you use settting translation - if ($hideItemDescription = setting($this->getSettingKey($type, 'hide_item_description'), false)) { + if ($hideItemDescription = setting($this->getSettingKey($type, 'hide_item_description'), false) && $hideItemDescription == 'hide') { return $hideItemDescription; } @@ -961,7 +961,7 @@ abstract class Form extends Component } // if you use settting translation - if ($hideItemQuantity = setting($this->getSettingKey($type, 'hide_quantity'), false)) { + if ($hideItemQuantity = setting($this->getSettingKey($type, 'hide_quantity'), false) && $hideItemQuantity == 'hide') { return $hideItemQuantity; } @@ -972,7 +972,7 @@ abstract class Form extends Component } // @todo what return value invoice or always false?? - return setting('invoice.hide_quantity', $hideItemQuantity); + return setting('invoice.quantity_name', $hideItemQuantity) == 'hide' ? true : false; } protected function getTextItemQuantity($type, $textItemQuantity) @@ -1012,7 +1012,7 @@ abstract class Form extends Component } // if you use settting translation - if ($hideItemPrice = setting($this->getSettingKey($type, 'hide_price'), false)) { + if ($hideItemPrice = setting($this->getSettingKey($type, 'hide_price'), false) && $hideItemPrice == 'hide') { return $hideItemPrice; } @@ -1023,7 +1023,7 @@ abstract class Form extends Component } // @todo what return value invoice or always false?? - return setting('invoice.hide_price', $hideItemPrice); + return setting('invoice.price_name', $hideItemPrice) == 'hide' ? true : false; } protected function getTextItemPrice($type, $textItemPrice) diff --git a/app/Abstracts/View/Components/Documents/Show.php b/app/Abstracts/View/Components/Documents/Show.php index 36fd828c2..3afcade00 100644 --- a/app/Abstracts/View/Components/Documents/Show.php +++ b/app/Abstracts/View/Components/Documents/Show.php @@ -1253,7 +1253,7 @@ abstract class Show extends Component } // if you use settting translation - if ($hideName = setting($this->getSettingKey($type, 'hide_item_name'), false)) { + if ($hideName = setting($this->getSettingKey($type, 'item_name'), false) && $hideName == 'hide') { return $hideName; } @@ -1264,7 +1264,7 @@ abstract class Show extends Component } // @todo what return value invoice or always false?? - return setting('invoice.hide_item_name', $hideName); + return setting('invoice.item_name', $hideName) == 'hide' ? true : false; } protected function getHideDescription($type, $hideDescription) @@ -1295,7 +1295,7 @@ abstract class Show extends Component } // if you use settting translation - if ($hideQuantity = setting($this->getSettingKey($type, 'hide_quantity'), false)) { + if ($hideQuantity = setting($this->getSettingKey($type, 'hide_quantity'), false) && $hideQuantity == 'hide') { return $hideQuantity; } @@ -1306,7 +1306,7 @@ abstract class Show extends Component } // @todo what return value invoice or always false?? - return setting('invoice.hide_quantity', $hideQuantity); + return setting('invoice.quantity_name', $hideQuantity) == 'hide' ? true : false; } protected function getHidePrice($type, $hidePrice) @@ -1316,7 +1316,7 @@ abstract class Show extends Component } // if you use settting translation - if ($hidePrice = setting($this->getSettingKey($type, 'hide_price'), false)) { + if ($hidePrice = setting($this->getSettingKey($type, 'hide_price'), false) && $hidePrice == 'hide') { return $hidePrice; } @@ -1327,7 +1327,7 @@ abstract class Show extends Component } // @todo what return value invoice or always false?? - return setting('invoice.hide_price', $hidePrice); + return setting('invoice.price_name', $hidePrice) == 'hide' ? true : false; } protected function getHideDiscount($type, $hideDiscount) diff --git a/app/Abstracts/View/Components/Documents/Template.php b/app/Abstracts/View/Components/Documents/Template.php index 15df90aa5..56ac04ebe 100644 --- a/app/Abstracts/View/Components/Documents/Template.php +++ b/app/Abstracts/View/Components/Documents/Template.php @@ -559,7 +559,7 @@ abstract class Template extends Component } // if you use settting translation - if ($hideName = setting($this->getSettingKey($type, 'hide_item_name'), false)) { + if ($hideName = setting($this->getSettingKey($type, 'item_name'), false) && $hideName == 'hide') { return $hideName; } @@ -570,7 +570,7 @@ abstract class Template extends Component } // @todo what return value invoice or always false?? - return setting('invoice.hide_item_name', $hideName); + return setting('invoice.item_name', $hideName) == 'hide' ? true : false; } protected function getHideDescription($type, $hideDescription) @@ -601,7 +601,7 @@ abstract class Template extends Component } // if you use settting translation - if ($hideQuantity = setting($this->getSettingKey($type, 'hide_quantity'), false)) { + if ($hideQuantity = setting($this->getSettingKey($type, 'hide_quantity'), false) && $hideQuantity == 'hide') { return $hideQuantity; } @@ -612,7 +612,7 @@ abstract class Template extends Component } // @todo what return value invoice or always false?? - return setting('invoice.hide_quantity', $hideQuantity); + return setting('invoice.quantity_name', $hideQuantity) == 'hide' ? true : false; } protected function getHidePrice($type, $hidePrice) @@ -622,7 +622,7 @@ abstract class Template extends Component } // if you use settting translation - if ($hidePrice = setting($this->getSettingKey($type, 'hide_price'), false)) { + if ($hidePrice = setting($this->getSettingKey($type, 'hide_price'), false) && $hidePrice == 'hide') { return $hidePrice; } @@ -633,7 +633,7 @@ abstract class Template extends Component } // @todo what return value invoice or always false?? - return setting('invoice.hide_price', $hidePrice); + return setting('invoice.price_name', $hidePrice) == 'hide' ? true : false; } protected function getHideDiscount($type, $hideDiscount) From 26943351e007100fac2d02ab4fb964dc38e4ca89 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Mon, 28 Nov 2022 13:17:36 +0300 Subject: [PATCH 2/2] module pricing changes --- resources/lang/en-GB/general.php | 1 + resources/lang/en-GB/modules.php | 6 +- .../modules/show/information.blade.php | 5 +- .../layouts/modules/show/price.blade.php | 60 ++++++++++++------- .../layouts/modules/show/toggle.blade.php | 18 ++++-- resources/views/modules/item/show.blade.php | 18 +++--- 6 files changed, 69 insertions(+), 39 deletions(-) diff --git a/resources/lang/en-GB/general.php b/resources/lang/en-GB/general.php index 3eaf7196d..07819fa41 100644 --- a/resources/lang/en-GB/general.php +++ b/resources/lang/en-GB/general.php @@ -90,6 +90,7 @@ return [ 'monthly' => 'Monthly', 'quarterly' => 'Quarterly', 'yearly' => 'Yearly', + 'lifetime' => 'Lifetime', 'add' => 'Add', 'add_new' => 'Add New', 'add_income' => 'Add Income', diff --git a/resources/lang/en-GB/modules.php b/resources/lang/en-GB/modules.php index 7883646b8..b6ac0024d 100644 --- a/resources/lang/en-GB/modules.php +++ b/resources/lang/en-GB/modules.php @@ -28,11 +28,13 @@ return [ 'yearly_pricing' => 'Yearly Pricing', 'monthly_price' => 'from :price', 'per_month' => 'per month', - 'billed_yearly' => 'Billed Yearly', + 'once' => 'once', 'billed_monthly' => 'Billed Monthly', + 'billed_yearly' => 'Billed Yearly', + 'billed_once' => 'Billed Once', 'save_year' => 'You save :price a year!', 'if_paid_year' => 'Or :price/mo if paid yearly', - 'information_monthly' => 'This option is valid only for Cloud Service', + 'information_monthly' => 'This option is valid only for Cloud Service', 'install' => 'Install', 'buy_now' => 'Buy Now', 'get_api_key' => 'Click here to get your API key.', diff --git a/resources/views/components/layouts/modules/show/information.blade.php b/resources/views/components/layouts/modules/show/information.blade.php index a568a145a..91fa2c919 100644 --- a/resources/views/components/layouts/modules/show/information.blade.php +++ b/resources/views/components/layouts/modules/show/information.blade.php @@ -7,9 +7,10 @@ @elseif (in_array('onprime', $module->where_to_use)) -
+
- * {!! trans('modules.information_monthly') !!} + * + {!! trans('modules.information_monthly', ['url' => 'https://akaunting.com/features/why-akaunting-cloud?utm_source=software&utm_medium=app_show&utm_campaign=' . str_replace('-', '_', $module->slug)]) !!}
@else diff --git a/resources/views/components/layouts/modules/show/price.blade.php b/resources/views/components/layouts/modules/show/price.blade.php index 202c66d5b..100d2164d 100644 --- a/resources/views/components/layouts/modules/show/price.blade.php +++ b/resources/views/components/layouts/modules/show/price.blade.php @@ -1,28 +1,12 @@ @props(['module']) @if ($module->price != '0.0000') -
+
{!! $module->price_prefix !!} -
+
@if (! empty($module->is_discount)) - - {!! $module->yearly_per_monthly_price !!} - - - - {!! $module->yearly_per_monthly_special_price !!} - - @else - - {!! $module->yearly_per_monthly_price !!} - - @endif -
- -
- @if (! empty($module->is_discount)) - + {!! $module->monthly_price !!} @@ -36,11 +20,47 @@ @endif
+
+ @if (! empty($module->is_discount)) + + {!! $module->yearly_per_monthly_price !!} + + + + {!! $module->yearly_per_monthly_special_price !!} + + @else + + {!! $module->yearly_per_monthly_price !!} + + @endif +
+ +
+ @if (! empty($module->is_discount)) + + {!! $module->lifetime_price !!} + + + + {!! $module->lifetime_special_price !!} + + @else + + {!! $module->lifetime_price !!} + + @endif +
+ {!! $module->price_suffix !!} - + {{ trans('modules.per_month') }} + + + {{ trans('modules.once') }} +
@else diff --git a/resources/views/components/layouts/modules/show/toggle.blade.php b/resources/views/components/layouts/modules/show/toggle.blade.php index b613621f7..2b99cd7b4 100644 --- a/resources/views/components/layouts/modules/show/toggle.blade.php +++ b/resources/views/components/layouts/modules/show/toggle.blade.php @@ -1,20 +1,30 @@ -
+
-
+
+ +
diff --git a/resources/views/modules/item/show.blade.php b/resources/views/modules/item/show.blade.php index fcb7fe31f..122c1d563 100644 --- a/resources/views/modules/item/show.blade.php +++ b/resources/views/modules/item/show.blade.php @@ -14,7 +14,7 @@ -
+
-
+
-
+
@if ($module->vote)
@@ -97,11 +97,11 @@
- @if (! in_array('onprime', $module->where_to_use)) -
- {!! ! empty($module->sort_desc) ? $module->sort_desc : strip_tags($module->description) !!} -
+
+ {!! ! empty($module->sort_desc) ? $module->sort_desc : strip_tags($module->description) !!} +
+ @if (! in_array('onprime', $module->where_to_use)) @if (! empty($module->cloud_information)) {!! $module->cloud_information !!} @else @@ -112,10 +112,6 @@
@endif @else -
- {!! ! empty($module->sort_desc) ? $module->sort_desc : strip_tags($module->description) !!} -
-