X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=reporting%2Fincludes%2Fheader2.inc;h=341788040cbf1e052ea78f6d12e89f7573452328;hb=59840905a38c4e08e5b13fdb7af71ea6dea7b1f0;hp=31b0ad2336b0c7c6abb3737a95cb8a08ed64a07c;hpb=be377198601dc01ba28d9f1c10ffdb961d5b7e2c;p=fa-stable.git diff --git a/reporting/includes/header2.inc b/reporting/includes/header2.inc index 31b0ad23..34178804 100644 --- a/reporting/includes/header2.inc +++ b/reporting/includes/header2.inc @@ -84,7 +84,6 @@ if ($doctype == 9) { $this->Text($ccol, $myrow['name'], $icol); - $adr = array(); } else { @@ -92,12 +91,8 @@ $this->Text($ccol, $myrow['supp_name'], $icol); else $this->Text($ccol, $myrow['DebtorName'], $icol); - $adr = explode("\n", $myrow['address']); - } - for ($i = 0; $i < count($adr); $i++) - { $this->NewLine(); - $this->Text($ccol, $adr[$i], $icol); + $this->TextWrapLines($ccol, $icol - $ccol, $myrow['address']); } if ($sales_order != NULL) { @@ -106,12 +101,8 @@ $this->Text($mcol, $this->company['coy_name']); else $this->Text($mcol, $sales_order['deliver_to']); - $adr = explode("\n", $sales_order['delivery_address']); - for ($i = 0; $i < count($adr); $i++) - { - $this->NewLine(); - $this->Text($mcol, $adr[$i]); - } + $this->NewLine(); + $this->TextWrapLines($mcol, $this->rightMargin - $mcol, $sales_order['delivery_address']); } $this->row = $iline2 - 2 * $this->lineHeight; $this->Text($ccol, $doc_Shipping_Company . ":", $ccol2); @@ -157,7 +148,7 @@ // 2008-06-16. Added customer's reference $this->NewLine(); $this->Text($ccol, $doc_Customers_Ref, $ccol2); - if ($sales_order != NULL) + if (isset($sales_order["customer_ref"])) $this->Text($ccol2, $sales_order["customer_ref"], $mcol); $locale = $path_to_root . "lang/" . $_SESSION['language']->code . "/locale.inc"; if (file_exists($locale)) @@ -212,13 +203,7 @@ $this->fontSize += 4; $this->NewLine(); $adrline = $this->row; - - $adr = explode("\n", $this->company['postal_address']); - for ($i = 0; $i < count($adr); $i++) - { - $this->Text($ccol, $adr[$i], $ccol2 + 40); - $this->NewLine(); - } + $this->TextWrapLines($ccol, $ccol2 + 40 - $ccol, $this->company['postal_address']); $this->row = $adrline; $this->Text($ccol2 + 30, $this->company['phone'], $mcol); $this->NewLine(); @@ -229,16 +214,9 @@ $this->row = $adrline; if (isset($bankaccount['bank_name'])) $this->Text($mcol, $bankaccount['bank_name'], $mcol2); + $this->NewLine(); if (isset($bankaccount['bank_address'])) - $adr = explode("\n", $bankaccount['bank_address']); - else - $adr = array(); - for ($i = 0; $i < count($adr); $i++) - { - $this->NewLine(); - $this->Text($mcol, $adr[$i], $mcol2); - } - + $this->TextWrapLines($mcol, $mcol2 - $mcol, $bankaccount['bank_address']); $this->row = $adrline; if (isset($bankaccount['bank_account_name'])) $this->Text($mcol2, $bankaccount['bank_account_name']);