- $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);
- $adr = Explode("\n", $myrow['br_address']);
- $count2 = count($adr);
- for ($i = 0; $i < $count2; $i++)
- $rep->TextCol(3, 4, $adr[$i], 0, ($i + 1) * $rep->lineHeight);
- $rep->TextCol(3, 4, $myrow['email'], 0, ($count2 + 1) * $rep->lineHeight);
- $count2++;
- $count1 = Max($count1, $count2);
- $count1 = Max($count1, 4);
- $rep->NewLine($count1);
+ $rep->NewLine();
+ $adr = $myrow['address'] != NULL ? Explode("\n", $myrow['address']) : array();
+ if ($myrow['br_post_address'] == '')
+ $adr2 = Explode("\n", $myrow['br_address']);
+ else
+ $adr2 = Explode("\n", $myrow['br_post_address']);
+ $count1 = count($adr);
+ $count2 = count($adr2);
+ $count1 = max($count1, $count2);
+ $count1 = max($count1, 4);
+ if (isset($adr[0]))
+ $rep->TextCol(0, 1, $adr[0]);
+ $rep->TextCol(1, 2, _('Currency') . ": " . $myrow['curr_code']);
+ if (isset($contacts[0]))
+ $rep->TextCol(2, 3, $contacts[0]['name']. " " .$contacts[0]['name2']);
+ if (isset($adr2[0]))
+ $rep->TextCol(3, 4, $adr2[0]);
+ $rep->NewLine();
+ if (isset($adr[1]))
+ $rep->TextCol(0, 1, $adr[1]);
+ if ($myrow['dimension_id'] != 0)
+ {
+ $dim = get_dimension($myrow['dimension_id']);
+ $rep->TextCol(1, 2, _('Dimension') . ": " . $dim['name']);
+ }
+ if (isset($contacts[0]))
+ $rep->TextCol(2, 3, _('Ph') . ": " . $contacts[0]['phone']);
+ if (isset($adr2[1]))
+ $rep->TextCol(3, 4, $adr2[1]);
+ $rep->NewLine();
+ if (isset($adr[2]))
+ $rep->TextCol(0, 1, $adr[2]);
+ if ($myrow['dimension2_id'] != 0)
+ {
+ $dim = get_dimension($myrow['dimension2_id']);
+ $rep->TextCol(1, 2, _('Dimension') . " 2: " . $dim['name']);
+ }
+ if ($myrow['notes'] != '')
+ {
+ $oldrow = $rep->row;
+ $rep->NewLine();
+ $rep->TextColLines(1, 2, _("General Notes:")." ".$myrow['notes'], -2);
+ $newrow = $rep->row;
+ $rep->row = $oldrow;
+ }
+ if (isset($contacts[0]))
+ $rep->TextCol(2, 3, _('Fax') . ": " . $contacts[0]['fax']);
+ if (isset($adr2[2]))
+ $rep->TextCol(3, 4, $adr2[2]);
+ if ($more != 0.0 || $less != 0.0)
+ $rep->TextCol(1, 2, _('Turnover') . ": " . number_format2($turnover, $dec));
+ for ($i = 3; $i < $count1; $i++)
+ {
+ $rep->NewLine();
+ if (isset($adr[$i]))
+ $rep->TextCol(0, 1, $adr[$i]);
+ if ($i == 3 && isset($contacts[0]) && isset($contacts[0]['email']))
+ $rep->TextCol(2, 3, _('Email') . ": " . $contacts[0]['email']);
+ if (isset($adr2[$i]))
+ $rep->TextCol(3, 4, $adr2[$i]);
+ }
+ if ($newrow != 0 && $newrow < $rep->row)
+ $rep->row = $newrow;
+ $rep->NewLine();