From 5e73406405b5c54fb938a4601b913de484aeef03 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Sat, 8 Apr 2023 04:36:25 +0200 Subject: [PATCH 1/2] fix billing process --- .github/user_bug_report.md | 14 ++++++++++---- Controller/ApiController.php | 10 +++++----- Theme/Backend/sales-analysis-dashboard.tpl.php | 4 ++-- 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/.github/user_bug_report.md b/.github/user_bug_report.md index 9e5f2a5..4b92a8e 100755 --- a/.github/user_bug_report.md +++ b/.github/user_bug_report.md @@ -8,9 +8,11 @@ assignees: '' --- # Bug Description + A clear and concise description of what the bug is. # How to Reproduce + Steps to reproduce the behavior: 1. Go to '...' @@ -19,16 +21,20 @@ Steps to reproduce the behavior: 4. See error # Expected Behavior + A clear and concise description of what you expected to happen. # Screenshots + If applicable, add screenshots to help explain your problem. # System Information - - System: [e.g. PC or iPhone11, ...] - - OS: [e.g. iOS] - - Browser [e.g. chrome, safari] - - KarakaVersion [e.g. 22] + +- System: [e.g. PC or iPhone11, ...] +- OS: [e.g. iOS] +- Browser [e.g. chrome, safari] +- KarakaVersion [e.g. 22] # Additional Information + Add any other context about the problem here. diff --git a/Controller/ApiController.php b/Controller/ApiController.php index e7061d0..faa70ab 100755 --- a/Controller/ApiController.php +++ b/Controller/ApiController.php @@ -46,8 +46,8 @@ final class ApiController extends Controller private function validateTaxCodeCreate(RequestAbstract $request) : array { $val = []; - if (($val['abbr'] = empty($request->getData('abbr'))) - || ($val['title'] = empty($request->getData('title'))) + if (($val['abbr'] = !$request->hasData('abbr')) + || ($val['title'] = !$request->hasData('title')) ) { return $val; } @@ -100,7 +100,7 @@ final class ApiController extends Controller $code->percentageSales = $request->getDataInt('percentage_sales_tax') ?? 0; $code->percentageInput = $request->getDataInt('percentage_input_tax') ?? 0; - if (!empty($request->getData('title'))) { + if ($request->hasData('title')) { $code->l11n->title = (string) ($request->getData('title')); $code->l11n->short = $request->getDataString('short') ?? ''; $code->l11n->long = $request->getDataString('long') ?? ''; @@ -122,8 +122,8 @@ final class ApiController extends Controller private function validateTaxCodeL11nCreate(RequestAbstract $request) : array { $val = []; - if (($val['title'] = empty($request->getData('title'))) - || ($val['code'] = empty($request->getData('code'))) + if (($val['title'] = !$request->hasData('title')) + || ($val['code'] = !$request->hasData('code')) ) { return $val; } diff --git a/Theme/Backend/sales-analysis-dashboard.tpl.php b/Theme/Backend/sales-analysis-dashboard.tpl.php index 9037197..c8463d7 100755 --- a/Theme/Backend/sales-analysis-dashboard.tpl.php +++ b/Theme/Backend/sales-analysis-dashboard.tpl.php @@ -223,7 +223,7 @@ echo $this->getData('nav')->render(); ?> - getCurrency(); ?> + getCurrency(); ?> @@ -343,7 +343,7 @@ echo $this->getData('nav')->render(); ?> - getCurrency(); ?> + getCurrency(); ?> From 0de05b1d56b82dd4897d89024dc4fd237262d645 Mon Sep 17 00:00:00 2001 From: Dennis Eichhorn Date: Tue, 11 Apr 2023 00:20:12 +0200 Subject: [PATCH 2/2] fix static analysis --- .github/user_feature_request.md | 3 +++ Models/TaxCodeL11nMapper.php | 3 +++ Models/TaxCodeMapper.php | 3 +++ 3 files changed, 9 insertions(+) diff --git a/.github/user_feature_request.md b/.github/user_feature_request.md index 6eb8ddc..c9595e8 100755 --- a/.github/user_feature_request.md +++ b/.github/user_feature_request.md @@ -8,11 +8,14 @@ assignees: '' --- # What is the feature you request + * A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] * A clear and concise description of what you want to happen. # Alternatives + A clear and concise description of any alternative solutions or features you've considered. # Additional Information + Add any other context or screenshots about the feature request here. diff --git a/Models/TaxCodeL11nMapper.php b/Models/TaxCodeL11nMapper.php index de11929..8d2262a 100755 --- a/Models/TaxCodeL11nMapper.php +++ b/Models/TaxCodeL11nMapper.php @@ -23,6 +23,9 @@ use phpOMS\DataStorage\Database\Mapper\DataMapperFactory; * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 + * + * @template T of BaseStringL11n + * @extends DataMapperFactory */ final class TaxCodeL11nMapper extends DataMapperFactory { diff --git a/Models/TaxCodeMapper.php b/Models/TaxCodeMapper.php index 5219942..b46b5c4 100755 --- a/Models/TaxCodeMapper.php +++ b/Models/TaxCodeMapper.php @@ -23,6 +23,9 @@ use phpOMS\DataStorage\Database\Mapper\DataMapperFactory; * @license OMS License 2.0 * @link https://jingga.app * @since 1.0.0 + * + * @template T of TaxCode + * @extends DataMapperFactory */ final class TaxCodeMapper extends DataMapperFactory {