[0000806] Branches were repeated in Customer Branches table when more than one genera...
authorJanusz Dobrowolski <janusz@frontaccouting.eu>
Sun, 15 May 2011 18:34:27 +0000 (20:34 +0200)
committerJanusz Dobrowolski <janusz@frontaccouting.eu>
Sun, 15 May 2011 18:34:27 +0000 (20:34 +0200)
sales/includes/db/branches_db.inc

index 2688d1b3e2d341e521db4deebfbfaeb753ec1121..c02b74c2d8ad81747cbbd572c69a099555774e3b 100644 (file)
@@ -164,7 +164,7 @@ function get_sql_for_customer_branches()
                AND b.debtor_no = ".db_escape($_POST['customer_id']);
 
        if (!get_post('show_inactive')) $sql .= " AND !b.inactive";
                AND b.debtor_no = ".db_escape($_POST['customer_id']);
 
        if (!get_post('show_inactive')) $sql .= " AND !b.inactive";
-       $sql .= " ORDER BY branch_ref";
+       $sql .= " GROUP BY b.branch_code ORDER BY branch_ref";
 
        return $sql;
 }
 
        return $sql;
 }