PHP 7.4 bug. Fixed in many files.
[fa-stable.git] / includes / ui / items_cart.inc
index 0e32165b0be23c17dda2b8fc05fcd11cbd26330d..9387558966a576980620164e85250fc6d8b4cb2d 100644 (file)
@@ -144,8 +144,8 @@ class items_cart
            $this->gl_items[$index]->code_id = $code_id;
            $this->gl_items[$index]->person_id = $person_id;
 
-               $gl_type = is_subledger_account($code_id, $person_id);
-               if ($gl_type)
+        $gl_type = is_subledger_account($code_id);
+        if ($person_id != null && $gl_type)
                {
                        $this->gl_items[$index]->person_type_id = $gl_type > 0 ? PT_CUSTOMER : PT_SUPPLIER;
                        $data = get_subaccount_data($code_id, $person_id);
@@ -263,7 +263,7 @@ class items_cart
 
                foreach($this->gl_items as $gl)
                {
-                       if ($person_type = is_subledger_account($gl->code_id, $gl->person_id))
+            if ($person_type = is_subledger_account($gl->code_id))
                        {
                                $tax_info['person_type'] = $person_type < 0 ? PT_SUPPLIER : PT_CUSTOMER;
                                $tax_info['person_id'] = $gl->person_id;
@@ -521,8 +521,8 @@ class gl_item
 
                $this->code_id = $code_id;
                $this->person_id = $person_id;
-               $gl_type = is_subledger_account($code_id, $person_id);
-               if ($gl_type)
+        $gl_type = is_subledger_account($code_id);
+        if ($person_id != null  && $gl_type)
                {
                        $this->person_type_id = $gl_type > 0 ? PT_CUSTOMER : PT_SUPPLIER;
                        $data = get_subaccount_data($code_id, $person_id);