From 2081731b170dd82a2dfca9dfa52fdb3babaec5f2 Mon Sep 17 00:00:00 2001 From: Joe Hunt Date: Tue, 29 Jan 2013 11:48:17 +0100 Subject: [PATCH] Small bugs in Customer Detail Report and Supplier Detail Report. --- reporting/rep103.php | 16 +++++++++------- reporting/rep205.php | 10 ++++------ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/reporting/rep103.php b/reporting/rep103.php index 84fbd6d6..3b8cceb4 100644 --- a/reporting/rep103.php +++ b/reporting/rep103.php @@ -39,6 +39,7 @@ function get_customer_details_for_report($area=0, $salesid=0) ".TB_PREF."cust_branch.branch_code, ".TB_PREF."cust_branch.br_name, ".TB_PREF."cust_branch.br_address, + ".TB_PREF."cust_branch.br_post_address, ".TB_PREF."cust_branch.contact_name, ".TB_PREF."cust_branch.area, ".TB_PREF."cust_branch.salesman, @@ -215,10 +216,14 @@ function print_customer_details_listing() $rep->TextCol(2, 3, $myrow['br_name']); $rep->NewLine(); $adr = Explode("\n", $myrow['address']); - $adr2 = Explode("\n", $myrow['br_address']); + 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']); @@ -257,14 +262,11 @@ function print_customer_details_listing() $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(0, 1, $adr2[$i]); + $rep->TextCol(3, 4, $adr2[$i]); } - if (isset($contacts[0]) && isset($contacts[0]['email'])) - { - $rep->NewLine(); - $rep->TextCol(2, 4, _('Email') . ": " . $contacts[0]['email']); - } $rep->NewLine(); /* $rep->TextCol(0, 1, $myrow['name']); diff --git a/reporting/rep205.php b/reporting/rep205.php index 25393a39..e7e6255d 100644 --- a/reporting/rep205.php +++ b/reporting/rep205.php @@ -141,6 +141,7 @@ function print_supplier_details_listing() $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']); @@ -179,14 +180,11 @@ function print_supplier_details_listing() $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(0, 1, $adr2[$i]); + $rep->TextCol(3, 4, $adr2[$i]); } - if (isset($contacts[0]) && isset($contacts[0]['email'])) - { - $rep->NewLine(); - $rep->TextCol(2, 4, _('Email') . ": " . $contacts[0]['email']); - } $rep->NewLine(); $rep->Line($rep->row + 8); $rep->NewLine(0, 3); -- 2.30.2