Compatibility fix for commit on 2020-09-28 (php < 5.4)
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Wed, 16 Dec 2020 08:41:11 +0000 (09:41 +0100)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Wed, 16 Dec 2020 08:41:11 +0000 (09:41 +0100)
gl/includes/db/gl_db_bank_accounts.inc

index ee535be7b1eb75302ada063dfc76931d3f89a305..ea9a83ac08ce06ca699cfe2a49c97185f335cf15 100644 (file)
@@ -344,8 +344,8 @@ function get_default_supplier_bank_account($supplier_id)
        $sql = "SELECT curr_code FROM ".TB_PREF."suppliers WHERE supplier_id=".db_escape($supplier_id);
        $result = db_query($sql, "could not retreive default supplier currency code");
        $row = db_fetch_row($result);
-       $id = $row ? get_default_bank_account($row[0])['id'] : 0;
-       return $id;
+       $ba = get_default_bank_account($row[0]);
+       return $ba['id'];
 }
 //---------------------------------------------------------------------------------------------
 //