Changed so document Sales Invoice now shows delivery notes instead of sales order
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Thu, 11 Dec 2008 23:27:21 +0000 (23:27 +0000)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Thu, 11 Dec 2008 23:27:21 +0000 (23:27 +0000)
CHANGELOG.txt
reporting/includes/header2.inc

index d72a3c8c46507d85f3a3d194bc8d69c30a5a1e2d..629681faad356ff4af89b4c09d47d1dd652fcc07 100644 (file)
@@ -19,6 +19,10 @@ Legend:
 ! -> Note
 $ -> Affected files
 
+12-Dec-2008 Joe Hunt
+! Changed so document Sales Invoice now shows delivery notes instead of sales order
+$ /reporting/includes/header2.inc
+.
 11-Dec-2008 Joe Hunt
 + Two new fields in company table, accumulate_shipping and logal_text
   Accumulat shipping is for accumulating shipping on batch invoice
index f1cadabb2becb31115a859647b389fbb7d2aabd4..ebbbe15536c7b750f1fbabda5dfe1eeef14f5a0e 100644 (file)
                $col += $width;
                $this->TextWrap($col, $this->row, $width, $doc_Your_VAT_no, 'C');
                $col += $width;
-               $this->TextWrap($col, $this->row, $width, $doc_Our_Order_No, 'C');
+               if ($doctype == 10)
+                       $this->TextWrap($col, $this->row, $width, $doc_Delivery_no, 'C');
+               else
+                       $this->TextWrap($col, $this->row, $width, $doc_Our_Order_No, 'C');
                $col += $width;
                $this->TextWrap($col, $this->row, $width, $doc_Payment_Terms, 'C');
                $col += $width;
                if ($doctype != 8 && isset($myrow['tax_id']))
                        $this->TextWrap($col, $this->row, $width, $myrow['tax_id'], 'C');
                $col += $width; 
-               if (isset($myrow['order_']))
+               if ($doctype == 10)
+               {
+                       $deliveries = get_parent_trans(10,$myrow['trans_no']);
+                       $line = "";
+                       foreach ($deliveries as $delivery)
+                       {
+                               if ($line == "")
+                                       $line .= "$delivery";
+                               else
+                                       $line .= ",$delivery";
+                       }               
+                       $this->TextWrap($col, $this->row, $width, $line, 'C');
+               }
+               elseif (isset($myrow['order_']))
                        $this->TextWrap($col, $this->row, $width, $myrow['order_'], 'C');
                $col += $width; 
                $id = $myrow['payment_terms'];