From 9b6b51b2b532b7d0ce868cb52e236f72f0932e39 Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Sun, 7 Dec 2008 18:58:43 +0000 Subject: [PATCH] Changed branch/customer name/address selection on invoices. --- reporting/includes/doctext.inc | 2 +- reporting/includes/doctext2.inc | 2 +- reporting/includes/header2.inc | 21 +++++++++++++++------ 3 files changed, 17 insertions(+), 8 deletions(-) diff --git a/reporting/includes/doctext.inc b/reporting/includes/doctext.inc index 0208c46b..773c6dea 100644 --- a/reporting/includes/doctext.inc +++ b/reporting/includes/doctext.inc @@ -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) { diff --git a/reporting/includes/doctext2.inc b/reporting/includes/doctext2.inc index 7c33519b..3075db2a 100644 --- a/reporting/includes/doctext2.inc +++ b/reporting/includes/doctext2.inc @@ -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) { diff --git a/reporting/includes/header2.inc b/reporting/includes/header2.inc index 6c4e08a1..5ade3e0e 100644 --- a/reporting/includes/header2.inc +++ b/reporting/includes/header2.inc @@ -135,12 +135,21 @@ } 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) { @@ -167,7 +176,7 @@ $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) -- 2.30.2