Merged changes from main branch up to release 2.2.1
[fa-stable.git] / reporting / includes / header2.inc
index f98c3ffacd14235f3bb92727a76bb85554c826e1..c3fd180b9baab9f7b6f98efadee875b038390b56 100644 (file)
                $col += $width; 
                if ($doctype == 10)
                {
-                       $deliveries = get_parent_trans(10,$myrow['trans_no']);
+                       $deliveries = get_parent_trans(ST_SALESINVOICE, $myrow['trans_no']);
                        $line = "";
                        foreach ($deliveries as $delivery)
                        {
+                               if ($print_invoice_no == 0)
+                               {
+                                       $ref = get_reference(ST_CUSTDELIVERY, $delivery);
+                                       if ($ref)
+                                               $delivery = $ref;
+                               }               
                                if ($line == "")
                                        $line .= "$delivery";
                                else
                        }               
                        $this->TextWrap($col, $this->row, $width, $line, 'C');
                }
+               elseif ($doctype == 13)
+               {
+                       $ref = $myrow['order_'];
+                       if ($print_invoice_no == 0)
+                       {
+                               $ref = get_reference(ST_SALESORDER, $myrow['order_']);
+                               if (!$ref)
+                                       $ref = $myrow['order_'];
+                       }               
+                       $this->TextWrap($col, $this->row, $width, $ref, 'C');
+               }
                elseif ($doctype == 26)
                        $this->TextWrap($col, $this->row, $width, $myrow["location_name"], 'C');
                elseif (isset($myrow['order_']))