From 457b97a8e942fc8cd935a549ad232ba360181ab5 Mon Sep 17 00:00:00 2001
From: Henning Leutz <leutz@pcsg.de>
Date: Thu, 6 May 2021 09:49:18 +0200
Subject: [PATCH] fix: quiqqer/invoice#110

---
 bin/backend/controls/panels/Journal.js         |  6 +++---
 .../Invoice/Search/InvoiceSearch.php           | 18 ++++++++----------
 2 files changed, 11 insertions(+), 13 deletions(-)

diff --git a/bin/backend/controls/panels/Journal.js b/bin/backend/controls/panels/Journal.js
index 60af161..ed53f0c 100644
--- a/bin/backend/controls/panels/Journal.js
+++ b/bin/backend/controls/panels/Journal.js
@@ -168,13 +168,13 @@ define('package/quiqqer/invoice/bin/backend/controls/panels/Journal', [
                     switch (parseInt(entry.isbrutto)) {
                         case 1:
                             entry.display_isbrutto = new Element('span', {
-                                'class': 'fa fa-minus'
+                                'class': 'fa fa-check'
                             });
                             break;
 
-                        case 2:
+                        default:
                             entry.display_isbrutto = new Element('span', {
-                                'class': 'fa fa-check'
+                                'class': 'fa fa-minus'
                             });
                             break;
                     }
diff --git a/src/QUI/ERP/Accounting/Invoice/Search/InvoiceSearch.php b/src/QUI/ERP/Accounting/Invoice/Search/InvoiceSearch.php
index baf9f43..a4f9002 100644
--- a/src/QUI/ERP/Accounting/Invoice/Search/InvoiceSearch.php
+++ b/src/QUI/ERP/Accounting/Invoice/Search/InvoiceSearch.php
@@ -212,7 +212,7 @@ public function order($order)
      *
      * @throws QUI\Exception
      */
-    public function search()
+    public function search(): array
     {
         return $this->executeQueryParams($this->getQuery());
     }
@@ -223,7 +223,7 @@ public function search()
      * @return array
      * @throws QUI\Exception
      */
-    public function searchForGrid()
+    public function searchForGrid(): array
     {
         $this->cache = [];
 
@@ -271,7 +271,7 @@ public function searchForGrid()
     /**
      * @return array
      */
-    protected function getQueryCount()
+    protected function getQueryCount(): array
     {
         return $this->getQuery(true);
     }
@@ -280,7 +280,7 @@ protected function getQueryCount()
      * @param bool $count - Use count select, or not
      * @return array
      */
-    protected function getQuery($count = false)
+    protected function getQuery($count = false): array
     {
         $Invoices = Handler::getInstance();
 
@@ -506,7 +506,7 @@ protected function getQuery($count = false)
      * @return array
      * @throws QUI\Exception
      */
-    protected function executeQueryParams($queryData = [])
+    protected function executeQueryParams(array $queryData = []): array
     {
         $PDO   = QUI::getDataBase()->getPDO();
         $binds = $queryData['binds'];
@@ -533,10 +533,8 @@ protected function executeQueryParams($queryData = [])
     /**
      * @param array $data
      * @return array
-     *
-     * @throws QUI\Exception
      */
-    protected function parseListForGrid($data)
+    protected function parseListForGrid(array $data): array
     {
         $Invoices = Handler::getInstance();
         $Locale   = QUI::getLocale();
@@ -708,7 +706,7 @@ protected function parseListForGrid($data)
                 $invoiceAddress['firstname'].' '.
                 $invoiceAddress['lastname']
             );
-            
+
             if (!empty($invoiceAddress['company'])) {
                 $invoiceData['customer_name'] = trim($invoiceData['customer_name']);
 
@@ -785,7 +783,7 @@ protected function parseListForGrid($data)
     /**
      * @return array
      */
-    protected function getAllowedFields()
+    protected function getAllowedFields(): array
     {
         return [
             'id',
-- 
GitLab