Removed the content of function header2 in pdf_report.inc to a separate file, header2...
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Wed, 23 Apr 2008 10:51:15 +0000 (10:51 +0000)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Wed, 23 Apr 2008 10:51:15 +0000 (10:51 +0000)
CHANGELOG.txt
install.html
reporting/includes/header2.inc [new file with mode: 0644]
reporting/includes/pdf_report.inc

index 272ecf19dc222195db25cb1439fd78efca805abb..3e6c33bb19ccd51778a91c31b58e7425fe7033dc 100644 (file)
@@ -19,6 +19,12 @@ Legend:
 ! -> Note
 $ -> Affected files
 
+23-Apr-2008
+! Removed the content of function header2 in pdf_report.inc to a separate file, header2.inc.
+  It will make it easier to design your own document layouts.
+$ /reporting/includes/pdf_report.inc
+  /reporting/includes/header2.inc (new file)
+  
 20-Apr-2008 Janusz Dobrowolski
 # Checking uniqueness of company settings, fixed creating database with prefix 0 when none was selected.
 $ /admin/create_coy.php
index 109082cc0081a9e4c6ce1d2a3be8aaf0d0cbd8c1..94e8529b680eca38d3e74bef931a309a716093b1 100644 (file)
 
 <body>
 
-<div><strong><span style="font-size: 20pt;"><span style="color: rgb(204, 102, 0); font-style: italic;">Front</span>Accounting Installation</span></strong></div>
+<div><strong><span style="FONT-SIZE: 20pt"><span style="COLOR: rgb(204,102,0); FONT-STYLE: italic"  >Front</span>Accounting Installation</span></strong></div>
 
 <h2>Pre-requisites</h2>
 
 
-<ul style="margin-top: 0pt;" type="disc">
+<ul style="MARGIN-TOP: 0pt" type="disc">
 
 
-  <li>A working HTTP web server eg. <em><strong>Apache, IIS</strong></em>. </li>
+  <li>A working HTTP web server eg. <em><strong>Apache, IIS</strong></em>. 
 
 
-  <li><strong><em>PHP</em></strong> installed on the web server. </li>
+  <li><strong><em>PHP</em></strong> installed on the web server. 
 
 
-  <li>A working <strong><em>MySQL</em></strong> server - with <strong><em>innodb</em></strong> tables enabled (see notes below) </li>
+  <li>A working <strong><em>MySQL</em></strong> server - with <strong><em>innodb</em></strong> tables 
+  enabled (see notes below) 
 
 
   <li><strong><em>Adobe Acrobat Reader</em></strong> - for viewing the PDF reports before printing them out. </li>
 <ul>
 
 
-  <li>One critical aspect of the PHP installation is the setting of <strong><em>session.auto_start</em></strong> in the php.ini file. Some rpm distributions of PHP have the default setting of <strong><em>session.auto_start = 1</em></strong>.
+  <li>One critical aspect of the PHP installation is the setting of <strong><em>session.auto_start</em></strong> in the php.ini file. Some rpm distributions of PHP have the default setting of <strong><em>session.auto_start =   1</em></strong>.
 This starts a new session at the beginning of each script. However,
 this makes it impossible to instantiate any class objects that the
 system relies on. Classes are used extensively by this system. When
 sessions are required they are started by the system and this setting
-of <strong><em>session.auto_start</em></strong> can and should be set to 0. </li>
+of <strong><em>session.auto_start</em></strong> 
+  can and should be set to 0. 
 
 
-  <li><strong><em>Innodb</em></strong> tables must be enabled in the
-MySQL server. These tables allow database transactions which are a
-critical component of the software. This is enabled by default in the
-newer versions of MySQL. If you need to enable it yourself, consult the
-MySQL manual. </li>
+  <li><strong><em>Innodb</em></strong> tables must be enabled in the MySQL 
+  server. These tables allow database transactions which are a critical 
+  component of the software. This is enabled by default in the newer versions of 
+  MySQL. If you need to enable it yourself, consult the MySQL manual. 
 
 
   <li>FrontAccounting is implemented and tested with MySQL. Generally
@@ -68,10 +69,12 @@ way at the moment. </li>
 <ul>
 
 
-  <li>You must obviously have downloaded the project archive to be reading this file. </li>
+  <li>You must obviously have downloaded the project 
+  archive to be reading this file. 
 
 
-  <li>All the files inside this archive should be copied to a directory under the web server root directory. </li>
+  <li>All the files inside this archive should be copied to 
+  a directory under the web server root directory. 
 
 
   <li>For example, create a folder called <strong>/account</strong>, and extract the archive into this folder. </li>
@@ -86,17 +89,17 @@ way at the moment. </li>
 <ol>
 
 
-  <li>If you have the option to create multiple databases on your host, create one, fi. <strong>frontacc</strong>,
-otherwise write down the database name for your account. At the same
-time look up the username and password for the database. You will need
-these informations during the wizard install. </li>
+  <li>If you have the option to create multiple databases on your host, create one, fi. <strong>frontacc</strong>, 
+  otherwise write down the database name for your account. At the same time look 
+  up the username and password for the database. You will need these 
+  informations during the wizard install. 
 
 
-  <li>Enter <strong><em>your_url/account/install</em></strong> (or
-whatever directory you entered). This will run the install wizard,
-setup a drill company and populating with initial data. You can later
-on create your own real company. It is a good idea to get familiar with
-the system before starting your own company.&nbsp;</li>
+  <li>Enter <strong><em>your_url/account/install</em></strong> (or whatever 
+  directory you entered). This will run the install wizard, setup a drill 
+  company and populating with initial data. You can later on create your own 
+  real company. It is a good idea to get familiar with the system before 
+  starting your own company.&nbsp; 
   <li>After successfully install, remove or rename your install directory for safety reasons. You don't need it any more.</li>
 
 
@@ -106,7 +109,7 @@ the system before starting your own company.&nbsp;</li>
 <h2>Installation Steps (manuel, for advanced users, not recommended)</h2>
 
 
-<p><br />
+<p><br >
 
 </p>
 
@@ -116,25 +119,27 @@ the system before starting your own company.&nbsp;</li>
 
   <li>
 
-    <h3>Creating the Database</h3>
+    <h3>Creating the Database<img height="16" alt="gylle" 
+  hspace=0 src="themes/default/images/cal.gif" width=16 border=0>  </h3>
 
 
 
     <ol>
 
 
-      <li>NOTE : As FrontAccounting is still heavily under development,
-the database structure will ALWAYS change between releases, so if you
-have a database that you created for a previous release of
-FrontAccounting, it WILL NOT WORK after installing a new release. You may run the script, update_db.php and
-select the appropriate script, f.i. alter.sql (from release 1.XX to release 2.0).
-</li>
+      <li>NOTE : As FrontAccounting is still heavily under 
+    development, the database structure will ALWAYS change between releases, so 
+    if you have a database that you created for a previous release of 
+    FrontAccounting, it WILL NOT WORK after installing a new release. You may 
+    run the script, update_db.php and select the appropriate script, f.i. 
+    alter.sql (from release 1.XX to release 2.0). 
 
 
-      <li>We strongly suggest using a GUI to manage your database(s) and database users. If you don&rsquo;t have any, download <a href="http://www.phpmyadmin.net/"><strong>phpMyAdmin</strong></a>. </li>
+      <li>We strongly suggest using a GUI to manage your database(s) and database users. If you don\92t have any, download <a href="http://www.phpmyadmin.net/"><strong>phpMyAdmin</strong></a>. 
 
 
-      <li>Create a database with a name of your choice. The default in config_db.php is &lsquo;<strong><em>frontacc</em></strong>&rsquo;, but of course you can select whatever name you desire. </li>
+      <li>Create a database with a name of your choice. The default in config_db.php is \91<strong><em>frontacc</em></strong>\92, but of course you can select 
+    whatever name you desire. 
 
 
       <li>Populate the database you have created. There are two scripts
@@ -144,7 +149,9 @@ are provided to populate the database (both inside the folder /sql) :
         <ol>
 
 
-          <li><strong><em>en_US-demo.sql</em></strong>. This has a minimal amount of demonstration data set up so that transactions can be tried to see how the system works. </li>
+          <li><strong><em>en_US-demo.sql</em></strong>. This has a minimal 
+      amount of demonstration data set up so that transactions can be tried to 
+      see how the system works. 
 
 
           <li><strong><em>en_US-new.sql</em></strong>. This script has
@@ -157,13 +164,10 @@ to use. </li>
         </ol>
 
 
-      </li>
-
-
-      <li>Now that the database is created you will need to set up a
-database user to access this database. DO NOT USE THE USER
-&lsquo;ROOT&rsquo;. Set up a new user and give that user full
-privileges over the database &lsquo;frontacc&rsquo;.</li>
+      <li>Now that the database is created you will need to 
+    set up a database user to access this database. DO NOT USE THE USER \91ROOT\92
+    Set up a new user and give that user full privileges over the database 
+    \91frontacc\92
       <li>After successfully install, remove or rename your install directory <strong><em>your_url/account/install</em></strong> (or
 whatever directory you entered) for safety reasons. You don't need it any more.</li>
 
@@ -172,9 +176,6 @@ whatever directory you entered) for safety reasons. You don't need it any more.<
     </ol>
 
 
-  </li>
-
-
   <li>
 
     <h3>Editing config_db.php</h3>
@@ -184,39 +185,44 @@ whatever directory you entered) for safety reasons. You don't need it any more.<
     <ol>
 
 
-      <li><strong><em>config_db.php</em></strong> contains connection
-information for the database. These must be set to your local settings
-or you will not be able to access FrontAccounting. </li>
+      <li><strong><em>config_db.php</em></strong> contains connection 
+    information for the database. These must be set to your local settings or 
+    you will not be able to access FrontAccounting. 
 
 
-      <li>FrontAccounting allows multiple connections, you can enter as
-many connections as you have separate entities (most people will use
-only one). </li>
+      <li>FrontAccounting allows multiple connections, you 
+    can enter as many connections as you have separate entities (most people 
+    will use only one). 
 
 
-      <li><strong>$db_connections</strong> is an array of connections &ndash; for each connection : </li>
+      <li><strong>$db_connections</strong> is an array of connections \96 
+    for each connection : 
 
 
-      <li>&ldquo;<strong>name</strong>&rdquo; is the name of the connection, this is the name that will be displayed to the user </li>
+      <li>\93<strong>name</strong>\94 is the 
+    name of the connection, this is the name that will be displayed to the user 
 
 
-      <li>&ldquo;<strong>host</strong>&rdquo; is the computer IP
-address or name where the database is. The default is localhost
-assuming that the web server is also the sql server. </li>
+      <li>\93<strong>host</strong>\94 is the 
+    computer IP address or name where the database is. The default is localhost 
+    assuming that the web server is also the sql server. 
 
 
-      <li>&ldquo;<strong>dbuse</strong>r&rdquo; is the user name under
-which the database should be accessed. NB, again, do not use the user
-ROOT. A user with appropriate privileges must be set up. </li>
+      <li>\93<strong>dbuse</strong>r\94 is 
+    the user name under which the database should be accessed. NB, again, do not 
+    use the user ROOT. A user with appropriate privileges must be set up. 
 
 
-      <li>&ldquo;<strong>dbpassword</strong>&rdquo; is the password for &ldquo;dbuser&rdquo;. You would have entered this when you created &ldquo;dbuser&rdquo;. </li>
+      <li>\93<strong>dbpassword</strong>\94 
+    is the password for \93dbuser\94. You would have entered this when you created 
+    \93dbuser\94
 
 
-      <li>&ldquo;<strong>dbname</strong>&rdquo; is the name of the database. The provided scripts use the name OpenAccounting. </li>
+      <li>\93<strong>dbname</strong>\94 is 
+    the name of the database. The provided scripts use the name OpenAccounting. 
 
 
-      <li>&ldquo;<strong>tbpref</strong>&rdquo; is the table prefix for
+      <li>\93<strong>tbpref</strong>\94 is the table prefix for
 the tables. If you only have access to one database, you must use table
 prefix to separate the companies. Table prefix is set by a table prefix
 counter inside config_db.php, fi. 0_ for the first company.</li>
@@ -238,19 +244,20 @@ counter inside config_db.php, fi. 0_ for the first company.</li>
 <ol>
 
 
-  <li>Pleae ensure that the folder <strong>/company/0</strong> on the server is <strong>writable</strong>. </li>
+  <li>Pleae ensure that the folder <strong>/company/0</strong> on the server is <strong>writable</strong>. 
 
 
-  <li>Open a browser and enter the URL for the web server directory where FrontAccounting is installed. </li>
+  <li>Open a browser and enter the URL for the web server 
+  directory where FrontAccounting is installed. 
 
 
-  <li>Enter the user name:&nbsp; '<strong>admin</strong>' </li>
+  <li>Enter the user name:&nbsp; '<strong>admin</strong>' 
 
 
-  <li>Enter the password: '<strong>password</strong>' </li>
+  <li>Enter the password: '<strong>password</strong>' 
 
 
-  <li>(NB : enter without quotation marks). </li>
+  <li>(NB : enter without quotation marks). 
 
 
   <li>
@@ -289,12 +296,15 @@ implemented and we strongly recommend you to use this approach, see <strong><em>
 <ol>
 
 
-  <li>If FrontAccounting is installed locally, you may have the <strong><em>session save path</em></strong> not set correctly. Normally this is set in your php.ini (for Windows). The entry is called <strong><em>session.save_path</em></strong>. Make sure this is set to a directory that actually exists. The default is set to /tmp, which may not be valid. </li>
+  <li>If FrontAccounting is installed locally, you may have the <strong><em>session save path</em></strong> not set correctly. Normally this is set in your php.ini (for Windows). The entry is called <strong><em>session.save_path</em></strong>. Make sure this is set to 
+  a directory that actually exists. The default is set to /tmp, which may not be 
+  valid. 
 
 
-  <li>If you are installing FrontAccounting onto a shared server, you
-may have to set the session save path within FrontAccounting. At the
-top of config.php (in release 2.0 this has moved to /includes/session.inc) you will find this line : </li>
+  <li>If you are installing FrontAccounting onto a shared 
+  server, you may have to set the session save path within FrontAccounting. At 
+  the top of config.php (in release 2.0 this has moved to /includes/session.inc) 
+  you will find this line : 
 
 
   <li>Uncomment this line and set the path to a directory that exists
diff --git a/reporting/includes/header2.inc b/reporting/includes/header2.inc
new file mode 100644 (file)
index 0000000..5fdf36f
--- /dev/null
@@ -0,0 +1,246 @@
+<?php
+
+               $this->row = $this->pageHeight - $this->topMargin;
+
+               $upper = $this->row - 2 * $this->lineHeight;
+               $lower = $this->bottomMargin + 6 * $this->lineHeight;
+               $iline1 = $upper - 4 * $this->lineHeight;
+               $iline2 = $iline1 - 8 * $this->lineHeight;
+               $iline3 = $iline2 - 8 * $this->lineHeight;
+               $iline4 = $iline3 - 2 * $this->lineHeight;
+               $iline5 = $lower + 4 * $this->lineHeight;
+               $icol = $this->pageWidth / 2;
+               $ccol = $this->cols[0] + 4;
+               $ccol2 = $icol / 2;
+               $mcol = $icol + 8;
+               $mcol2 = $this->pageWidth - $ccol2;
+
+               $this->SetDrawColor(128, 128, 128);
+               $this->LineTo($this->pageWidth - $this->rightMargin, $upper ,$this->leftMargin, $upper);
+               $this->LineTo($this->leftMargin, $upper ,$this->leftMargin, $lower);
+               $this->LineTo($this->pageWidth - $this->rightMargin, $lower ,$this->leftMargin, $lower);
+               $this->LineTo($this->pageWidth - $this->rightMargin, $lower ,$this->pageWidth - $this->rightMargin, $upper);
+               $this->Line($iline1);
+               $this->Line($iline2);
+               $this->Line($iline3);
+               $this->Line($iline4);
+               $this->Line($iline5);
+               $this->LineTo($icol, $upper ,$icol, $iline1);
+               $this->NewLine();
+
+               $this->fontSize += 4;
+               $this->Font('bold');
+               $this->Text($mcol, $this->title);
+               $this->Font();
+               $this->fontSize -= 4;
+               if ($this->pageNumber > 1 && !strstr($this->filename, "Bulk"))
+                       $this->Text($this->endLine - 35, _("Page") . ' ' . $this->pageNumber);
+               $this->fontSize -= 4;
+               $this->row = $upper - 5;
+
+               $this->Text($mcol, $doc_Invoice_no, $mcol + 90);
+               $this->Text($mcol + 90, $doc_Cust_no, $mcol + 180);
+               $this->Text($mcol + 180, $doc_Date);
+               $this->fontSize += 4;
+
+               $this->row = $upper - 2 * $this->lineHeight - 2;
+               if ($this->company['coy_logo'] != '')
+               {
+                       $logo = $comp_path .'/'. user_company() . "/images/" . $this->company['coy_logo'];
+                       $this->AddImage($logo, $ccol, $iline1 + 5, 250, 40);
+               }
+               else
+               {
+                       $this->fontSize += 4;
+                       $this->Font('bold');
+                       $this->Text($ccol, $this->company['coy_name'], $icol);
+                       $this->Font();
+                       $this->fontSize -= 4;
+               }
+               if ($doctype == 8) // PO
+                       $this->Text($mcol, $myrow['order_no'], $mcol + 90);
+               else if ($doctype == 9) // SO
+                       $this->Text($mcol, $myrow['order_no'] ." ".$myrow['customer_ref'], $mcol + 90);
+               else if (isset($myrow['trans_no']) && isset($myrow['reference'])) // INV/CRE/STA
+               {
+                       if ($print_invoice_no == 1)
+                               $this->Text($mcol, $myrow['trans_no'], $mcol + 90);
+                       else
+                               $this->Text($mcol, $myrow['reference'], $mcol + 90);
+               }
+               if (isset($myrow['debtor_no']))
+                       $this->Text($mcol + 90, $myrow['debtor_no'], $mcol + 180);
+               if ($doctype == 8 || $doctype == 9)
+                       $this->Text($mcol + 180, sql2date($myrow['ord_date']));
+               else
+                       $this->Text($mcol + 180, sql2date($myrow['tran_date']));
+
+               $this->fontSize -= 4;
+               $this->row = $iline1 - 5;
+               $this->Text($ccol, $doc_Charge_To, $icol);
+               $this->Text($mcol, $doc_Delivered_To);
+               $this->fontSize += 4;
+
+               $this->NewLine(2);
+               $temp = $this->row;
+               if ($doctype == 9)
+               {
+                       $this->Text($ccol, $myrow['name'], $icol);
+                       $adr = array();
+               }
+               else
+               {
+                       if ($doctype == 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);
+               }
+               if ($sales_order != NULL)
+               {
+                       $this->row = $temp;
+                       if ($doctype == 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->row = $iline2 - 2 * $this->lineHeight;
+               $this->Text($ccol, $doc_Shipping_Company . ":", $ccol2);
+               if ($doctype != 8 && isset($myrow['shipper_name']))
+                       $this->Text($ccol2, $myrow['shipper_name'], $mcol);
+               $this->Text($mcol, $doc_Due_Date . ":", $mcol2);
+               if ($doctype == 9)
+                       $this->Text($mcol2, sql2date($myrow['delivery_date']));
+               else if ($doctype != 8 && isset($myrow['due_date']))
+                       $this->Text($mcol2, sql2date($myrow['due_date']));
+               if ($branch != null)
+               {
+                       $this->NewLine();
+                       $this->Text($ccol, $doc_Your_Ref . ":", $ccol2);
+                       $this->Text($ccol2, $branch['contact_name'], $mcol);
+                       $this->Text($mcol, $doc_Our_Ref . ":", $mcol2);
+
+                       $id = $branch['salesman'];
+                       $sql = "SELECT salesman_name  FROM ".TB_PREF."salesman WHERE salesman_code='$id'";
+                       $result = db_query($sql,"could not get sales person");
+                       $row = db_fetch($result);
+
+                       $this->Text($mcol2, $row['salesman_name']);
+               }
+               $this->NewLine();
+               $this->Text($ccol, $doc_Your_VAT_no . ":", $ccol2);
+               if ($doctype != 8 && isset($myrow['tax_id']))
+                       $this->Text($ccol2, $myrow['tax_id'], $mcol);
+               $this->Text($mcol, $doc_Our_VAT_no . ":", $mcol2);
+               $this->Text($mcol2, $this->company['gst_no']);
+               $this->NewLine();
+               $this->Text($ccol, $doc_Payment_Terms . ":", $ccol2);
+
+               $id = $myrow['payment_terms'];
+               $sql = "SELECT terms FROM ".TB_PREF."payment_terms WHERE terms_indicator='$id'";
+               $result = db_query($sql,"could not get paymentterms");
+               $row = db_fetch($result);
+
+               $this->Text($ccol2, $row["terms"], $mcol);
+               $this->Text($mcol, $doc_Our_Order_No . ":", $mcol2);
+               if (isset($myrow['order_']))
+                       $this->Text($mcol2, $myrow['order_']);
+
+               $locale = $path_to_root . "lang/" . $_SESSION['language']->code . "/locale.inc";
+               if (file_exists($locale))
+               {
+                       $header2include = true;
+                       include($locale);
+               }
+               $this->row = $iline3 - $this->lineHeight - 2;
+               $this->Font('bold');
+               $count = count($this->headers);
+               for ($i = 0; $i < $count; $i++)
+                       $this->TextCol($i, $i + 1, $this->headers[$i], -2);
+               $this->Font();
+               $temp = $this->row - 2 * $this->lineHeight;
+               $this->row = $iline5 - $this->lineHeight - 6;
+               $this->Text($ccol, $doc_Please_Quote . " - " . $myrow['curr_code']);
+               $this->NewLine();
+               if ($doctype == 10 && $branch['disable_branch'] > 0) // payment links
+               {
+                       if ($branch['disable_branch'] == 1)
+                       {
+                               $amt = number_format($myrow["ov_freight"] + $myrow["ov_gst"] +  $myrow["ov_amount"], user_price_dec());
+                               $txt = $doc_Payment_Link . " PayPal: ";
+                               $name = urlencode($this->title . " " . $myrow['reference']);
+                               $url = "https://www.paypal.com/xclick/business=" . $this->company['email'] . "&item_name=" .
+                                       $name . "&amount=" . $amt . "&currency_code=" . $myrow['curr_code'];
+                               $this->fontSize -= 2;
+                               $this->Text($ccol, $txt);
+                               $this->NewLine();
+                               $this->SetTextColor(0, 0, 255);
+                               $this->Text($ccol, $url);
+                               $this->SetTextColor(0, 0, 0);
+                               $this->addLink($url, $ccol, $this->row, $this->pageWidth - $this->rightMargin, $this->row + $this->lineHeight);
+                               $this->fontSize += 2;
+                       }
+               }
+               if ($this->params['comments'] != '')
+               {
+                       $this->NewLine();
+                       $this->Font('bold');
+                       $this->Text($ccol, $this->params['comments']);
+                       $this->Font();
+               }
+
+               $this->row = $lower - 5;
+               $this->fontSize -= 4;
+
+               $this->Text($ccol, $doc_Address, $ccol2 + 40);
+               $this->Text($ccol2 + 30, $doc_Phone_Fax_Email, $mcol);
+               $this->Text($mcol , $doc_Bank, $mcol2);
+               $this->Text($mcol2, $doc_Bank_Account);
+               $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->row = $adrline;
+               $this->Text($ccol2 + 30, $this->company['phone'], $mcol);
+               $this->NewLine();
+               $this->Text($ccol2 + 30, $this->company['fax'], $mcol);
+               $this->NewLine();
+               $this->Text($ccol2 + 30, $this->company['email'], $mcol);
+               // fetch this later
+               $this->row = $adrline;
+               if (isset($bankaccount['bank_name']))
+                       $this->Text($mcol, $bankaccount['bank_name'], $mcol2);
+               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->row = $adrline;
+               if (isset($bankaccount['bank_account_name']))
+                       $this->Text($mcol2, $bankaccount['bank_account_name']);
+               $this->NewLine();
+               if (isset($bankaccount['bank_account_number']))
+                       $this->Text($mcol2, $bankaccount['bank_account_number']);
+?>
\ No newline at end of file
index 98d6f3a5d3b868c9223705617d9a88fa5756c542..a774ad4dfbfd7e9f9a82d235fd8015bdd88b86ec 100644 (file)
@@ -273,249 +273,9 @@ class FrontReport extends Cpdf
                {
                        include($path_to_root . "reporting/includes/doctext.inc");
                }
-               $this->row = $this->pageHeight - $this->topMargin;
-
-               $upper = $this->row - 2 * $this->lineHeight;
-               $lower = $this->bottomMargin + 6 * $this->lineHeight;
-               $iline1 = $upper - 4 * $this->lineHeight;
-               $iline2 = $iline1 - 8 * $this->lineHeight;
-               $iline3 = $iline2 - 8 * $this->lineHeight;
-               $iline4 = $iline3 - 2 * $this->lineHeight;
-               $iline5 = $lower + 5 * $this->lineHeight;
-               $icol = $this->pageWidth / 2;
-               $ccol = $this->cols[0] + 4;
-               $ccol2 = $icol / 2;
-               $mcol = $icol + 8;
-               $mcol2 = $this->pageWidth - $ccol2;
-
-               $this->SetDrawColor(128, 128, 128);
-               $this->LineTo($this->pageWidth - $this->rightMargin, $upper ,$this->leftMargin, $upper);
-               $this->LineTo($this->leftMargin, $upper ,$this->leftMargin, $lower);
-               $this->LineTo($this->pageWidth - $this->rightMargin, $lower ,$this->leftMargin, $lower);
-               $this->LineTo($this->pageWidth - $this->rightMargin, $lower ,$this->pageWidth - $this->rightMargin, $upper);
-               $this->Line($iline1);
-               $this->Line($iline2);
-               $this->Line($iline3);
-               $this->Line($iline4);
-               $this->Line($iline5);
-               $this->LineTo($icol, $upper ,$icol, $iline1);
-               $this->NewLine();
-
-               $this->fontSize += 4;
-               $this->Font('bold');
-               $this->Text($mcol, $this->title);
-               $this->Font();
-               $this->fontSize -= 4;
-               if ($this->pageNumber > 1 && !strstr($this->filename, "Bulk"))
-                       $this->Text($this->endLine - 35, _("Page") . ' ' . $this->pageNumber);
-               $this->fontSize -= 4;
-               $this->row = $upper - 5;
-
-               $this->Text($mcol, $doc_Invoice_no, $mcol + 90);
-               $this->Text($mcol + 90, $doc_Cust_no, $mcol + 180);
-               $this->Text($mcol + 180, $doc_Date);
-               $this->fontSize += 4;
-
-               $this->row = $upper - 2 * $this->lineHeight - 2;
-               if ($this->company['coy_logo'] != '')
-               {
-                       $logo = $comp_path .'/'. user_company() . "/images/" . $this->company['coy_logo'];
-                       $this->AddImage($logo, $ccol, $iline1 + 5, 250, 40);
-               }
-               else
-               {
-                       $this->fontSize += 4;
-                       $this->Font('bold');
-                       $this->Text($ccol, $this->company['coy_name'], $icol);
-                       $this->Font();
-                       $this->fontSize -= 4;
-               }
-               if ($doctype == 8) // PO
-                       $this->Text($mcol, $myrow['order_no'], $mcol + 90);
-               else if ($doctype == 9) // SO
-                       $this->Text($mcol, $myrow['order_no'] ." ".$myrow['customer_ref'], $mcol + 90);
-               else if (isset($myrow['trans_no']) && isset($myrow['reference'])) // INV/CRE/STA
-               {
-                       if ($print_invoice_no == 1)
-                               $this->Text($mcol, $myrow['trans_no'], $mcol + 90);
-                       else
-                               $this->Text($mcol, $myrow['reference'], $mcol + 90);
-               }
-               if (isset($myrow['debtor_no']))
-                       $this->Text($mcol + 90, $myrow['debtor_no'], $mcol + 180);
-               if ($doctype == 8 || $doctype == 9)
-                       $this->Text($mcol + 180, sql2date($myrow['ord_date']));
-               else
-                       $this->Text($mcol + 180, sql2date($myrow['tran_date']));
-
-               $this->fontSize -= 4;
-               $this->row = $iline1 - 5;
-               $this->Text($ccol, $doc_Charge_To, $icol);
-               $this->Text($mcol, $doc_Delivered_To);
-               $this->fontSize += 4;
-
-               $this->NewLine(2);
-               $temp = $this->row;
-               if ($doctype == 9)
-               {
-                       $this->Text($ccol, $myrow['name'], $icol);
-                       $adr = array();
-               }
-               else
-               {
-                       if ($doctype == 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);
-               }
-               if ($sales_order != NULL)
-               {
-                       $this->row = $temp;
-                       if ($doctype == 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->row = $iline2 - 2 * $this->lineHeight;
-               $this->Text($ccol, $doc_Shipping_Company . ":", $ccol2);
-               if ($doctype != 8 && isset($myrow['shipper_name']))
-                       $this->Text($ccol2, $myrow['shipper_name'], $mcol);
-               $this->Text($mcol, $doc_Due_Date . ":", $mcol2);
-               if ($doctype == 9)
-                       $this->Text($mcol2, sql2date($myrow['delivery_date']));
-               else if ($doctype != 8 && isset($myrow['due_date']))
-                       $this->Text($mcol2, sql2date($myrow['due_date']));
-               if ($branch != null)
-               {
-                       $this->NewLine();
-                       $this->Text($ccol, $doc_Your_Ref . ":", $ccol2);
-                       $this->Text($ccol2, $branch['contact_name'], $mcol);
-                       $this->Text($mcol, $doc_Our_Ref . ":", $mcol2);
-
-                       $id = $branch['salesman'];
-                       $sql = "SELECT salesman_name  FROM ".TB_PREF."salesman WHERE salesman_code='$id'";
-                       $result = db_query($sql,"could not get sales person");
-                       $row = db_fetch($result);
-
-                       $this->Text($mcol2, $row['salesman_name']);
-               }
-               $this->NewLine();
-               $this->Text($ccol, $doc_Your_VAT_no . ":", $ccol2);
-               if ($doctype != 8 && isset($myrow['tax_id']))
-                       $this->Text($ccol2, $myrow['tax_id'], $mcol);
-               $this->Text($mcol, $doc_Our_VAT_no . ":", $mcol2);
-               $this->Text($mcol2, $this->company['gst_no']);
-               $this->NewLine();
-               $this->Text($ccol, $doc_Payment_Terms . ":", $ccol2);
-
-               $id = $myrow['payment_terms'];
-               $sql = "SELECT terms FROM ".TB_PREF."payment_terms WHERE terms_indicator='$id'";
-               $result = db_query($sql,"could not get paymentterms");
-               $row = db_fetch($result);
 
-               $this->Text($ccol2, $row["terms"], $mcol);
-               $this->Text($mcol, $doc_Our_Order_No . ":", $mcol2);
-               if (isset($myrow['order_']))
-                       $this->Text($mcol2, $myrow['order_']);
+               include($path_to_root . "reporting/includes/header2a.inc");
 
-               $locale = $path_to_root . "lang/" . $_SESSION['language']->code . "/locale.inc";
-               if (file_exists($locale))
-               {
-                       $header2include = true;
-                       include($locale);
-               }
-               $this->row = $iline3 - $this->lineHeight - 2;
-               $this->Font('bold');
-               $count = count($this->headers);
-               for ($i = 0; $i < $count; $i++)
-                       $this->TextCol($i, $i + 1, $this->headers[$i], -2);
-               $this->Font();
-               $temp = $this->row - 2 * $this->lineHeight;
-               $this->row = $iline5 - $this->lineHeight - 6;
-               $this->Text($ccol, $doc_Please_Quote . " - " . $myrow['curr_code']);
-               $this->NewLine();
-               if ($doctype == 10 && $branch['disable_branch'] > 0) // payment links
-               {
-                       if ($branch['disable_branch'] == 1)
-                       {
-                               $amt = number_format($myrow["ov_freight"] + $myrow["ov_gst"] +  $myrow["ov_amount"], user_price_dec());
-                               $txt = $doc_Payment_Link . " PayPal: ";
-                               $name = urlencode($this->title . " " . $myrow['reference']);
-                               $url = "https://www.paypal.com/xclick/business=" . $this->company['email'] . "&item_name=" .
-                                       $name . "&amount=" . $amt . "&currency_code=" . $myrow['curr_code'];
-                               $this->fontSize -= 2;
-                               $this->Text($ccol, $txt);
-                               $this->NewLine();
-                               $this->SetTextColor(0, 0, 255);
-                               $this->Text($ccol, $url);
-                               $this->SetTextColor(0, 0, 0);
-                               $this->addLink($url, $ccol, $this->row, $this->pageWidth - $this->rightMargin, $this->row + $this->lineHeight);
-                               $this->fontSize += 2;
-                       }
-               }
-               if ($this->params['comments'] != '')
-               {
-                       $this->NewLine();
-                       $this->Font('bold');
-                       $this->Text($ccol, $this->params['comments']);
-                       $this->Font();
-               }
-
-               $this->row = $lower - 5;
-               $this->fontSize -= 4;
-
-               $this->Text($ccol, $doc_Address, $ccol2 + 40);
-               $this->Text($ccol2 + 30, $doc_Phone_Fax_Email, $mcol);
-               $this->Text($mcol , $doc_Bank, $mcol2);
-               $this->Text($mcol2, $doc_Bank_Account);
-               $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->row = $adrline;
-               $this->Text($ccol2 + 30, $this->company['phone'], $mcol);
-               $this->NewLine();
-               $this->Text($ccol2 + 30, $this->company['fax'], $mcol);
-               $this->NewLine();
-               $this->Text($ccol2 + 30, $this->company['email'], $mcol);
-               // fetch this later
-               $this->row = $adrline;
-               if (isset($bankaccount['bank_name']))
-                       $this->Text($mcol, $bankaccount['bank_name'], $mcol2);
-               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->row = $adrline;
-               if (isset($bankaccount['bank_account_name']))
-                       $this->Text($mcol2, $bankaccount['bank_account_name']);
-               $this->NewLine();
-               if (isset($bankaccount['bank_account_number']))
-                       $this->Text($mcol2, $bankaccount['bank_account_number']);
                $this->row = $temp;
        }