Small bugs in Customer Detail Report and Supplier Detail Report.
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Tue, 29 Jan 2013 10:48:17 +0000 (11:48 +0100)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Tue, 29 Jan 2013 10:48:17 +0000 (11:48 +0100)
reporting/rep103.php
reporting/rep205.php

index 84fbd6d6951f00e7e3e8894016090edb42071a88..3b8cceb42812430bb085837a8de4acadd8f0b759 100644 (file)
@@ -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']);
index 25393a39cf5c25e486a049d118f63a0baf14c7c8..e7e6255dadb79ae3db3232aa94edda072b82b132 100644 (file)
@@ -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);