Changed branch/customer name/address selection on invoices.
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Sun, 7 Dec 2008 18:58:43 +0000 (18:58 +0000)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Sun, 7 Dec 2008 18:58:43 +0000 (18:58 +0000)
reporting/includes/doctext.inc
reporting/includes/doctext2.inc
reporting/includes/header2.inc

index 0208c46beaf0a2b085d74f53f3c430387f294db5..773c6dea70b6c59d4b400f683bee78754e0bfdf6 100644 (file)
@@ -15,7 +15,7 @@ if (isset($header2type))
        $doc_Your_VAT_no = _("Your VAT no.");
        $doc_Our_VAT_no = _("Our VAT No.");
        $doc_Payment_Terms = _("Payment Terms");
-       $doc_Customers_Ref = _("Customers Reference:");
+       $doc_Customers_Ref = _("Customers Reference");
        $doc_Our_Order_No = _("Our Order No");
        $doc_Domicile = _("Domicile");
        if($doctype == 13 || $doctype == 8 || $doctype == 9) {
index 7c33519b7a5c588cb100b0d2a150d6ac5a5fc704..3075db2a38eba187d05f93c03e188a1c2152b8ab 100644 (file)
@@ -15,7 +15,7 @@ if (isset($header2type))
        $doc_Your_VAT_no = "Your VAT No.";
        $doc_Our_VAT_no = "Our VAT No.";
        $doc_Payment_Terms = "Payment Terms";
-       $doc_Customers_Ref = "Customers Reference:";
+       $doc_Customers_Ref = "Customers Reference";
        $doc_Our_Order_No = "Our Order No";
        $doc_Domicile = "Domicile";
        if($doctype == 13 || $doctype == 8 || $doctype == 9) {
index 6c4e08a1058997d3d34aad6b7573287dfcb53be9..5ade3e0ef08364bb320a78cbfb31d2e422410f77 100644 (file)
                }
                else
                {
-                       if ($doctype == 8)
-                               $this->Text($ccol, $myrow['supp_name'], $icol);
-                       else
-                               $this->Text($ccol, $myrow['DebtorName'], $icol);
+                       if ($doctype == 8) {
+                               $name = $myrow['supp_name'];
+                               $addr = $myrow['address'];
+                       } else {
+                               if (trim($branch['br_address']) != '') {
+                                       $name = $branch['br_name'];
+                                       $addr = $branch['br_address'];
+                               } else {
+                                       $name = $myrow['DebtorName'];
+                                       $addr = $myrow['address'];
+                               }
+                       }
+                       $this->Text($ccol, $name, $icol);
                        $this->NewLine();
-                       $this->TextWrapLines($ccol, $icol - $ccol, $myrow['address']);
+                       $this->TextWrapLines($ccol, $icol - $ccol, $addr);
                }
                if ($sales_order != NULL)
                {
                $this->TextWrap($col, $this->row, $width, $doc_Due_Date, 'C');
                $this->row = $iline3 - $this->lineHeight - 1;
                $col = $this->leftMargin;
-               if ($sales_order != NULL)
+               if (isset($sales_order["customer_ref"]))
                        $this->TextWrap($col, $this->row, $width, $sales_order["customer_ref"], 'C');
                $col += $width; 
                if ($branch != null)