Rerun
[fa-stable.git] / reporting / includes / header2.inc
index ab21d9f22334df2fca8247787e3fc805b40b4c1b..e1ad9af18889bbd11f8c67a7dc4f49a51beafc7a 100644 (file)
                if ($sales_order != NULL)
                {
                        $this->row = $temp;
-                       if ($doctype == ST_PURCHORDER)
-                               $this->Text($mcol, $this->company['coy_name']);
-                       elseif ($doctype != ST_SUPPAYMENT)
+                       if ($doctype != ST_SUPPAYMENT && isset($sales_order['deliver_to']))
+                       {
                                $this->Text($mcol, $sales_order['deliver_to']);
-                       $this->NewLine();
-                       if ($doctype != ST_SUPPAYMENT)
+                               $this->NewLine();
+                       }       
+                       // if you need the company name in purchase order then write it as first line in location addresss.     
+                       if ($doctype != ST_SUPPAYMENT && isset($sales_order['delivery_address']))
                                $this->TextWrapLines($mcol, $this->rightMargin - $mcol, $sales_order['delivery_address']);
                }
                $this->row = $iline2 - $this->lineHeight - 1;
                        $this->TextWrap($col, $this->row, $width, $myrow['wo_ref'], 'C');
                elseif (isset($sales_order["customer_ref"]))
                        $this->TextWrap($col, $this->row, $width, $sales_order["customer_ref"], 'C');
-               else
+               elseif (isset($myrow["debtor_ref"]))
                        $this->TextWrap($col, $this->row, $width, $myrow["debtor_ref"], 'C');
                $col += $width; 
                if ($branch != null)