- $rep->TextCol(2, 3, $myrow['contact_name'], 0, $rep->lineHeight);
- $rep->TextCol(2, 3, _('Ph') . ": " . $myrow['phone'], 0, 2 * $rep->lineHeight);
- $rep->TextCol(2, 3, _('Fax') . ": " . $myrow['fax'], 0, 3 * $rep->lineHeight);
+
+ $contacts = get_branch_contacts($myrow['branch_code']);
+ if (isset($contacts[0]))
+ {
+ $rep->TextCol(2, 3, $contacts[0]['name'], 0, $rep->lineHeight);
+ $rep->TextCol(2, 3, _('Ph') . ": " . $contacts[0]['phone'], 0, 2 * $rep->lineHeight);
+ $rep->TextCol(2, 3, _('Fax') . ": " . $contacts[0]['fax'], 0, 3 * $rep->lineHeight);
+ }