Rerun of implemented Selectable Print Orientation (Portrait, Landscape) for all repor...
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Thu, 17 Jan 2013 00:32:00 +0000 (01:32 +0100)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Thu, 17 Jan 2013 00:32:00 +0000 (01:32 +0100)
47 files changed:
includes/current_user.inc
manufacturing/work_order_entry.php
reporting/includes/Workbook.php
reporting/includes/excel_report.inc
reporting/includes/pdf_report.inc
reporting/includes/reporting.inc
reporting/rep101.php
reporting/rep102.php
reporting/rep103.php
reporting/rep104.php
reporting/rep105.php
reporting/rep106.php
reporting/rep107.php
reporting/rep108.php
reporting/rep109.php
reporting/rep110.php
reporting/rep111.php
reporting/rep112.php
reporting/rep113.php
reporting/rep114.php
reporting/rep201.php
reporting/rep202.php
reporting/rep203.php
reporting/rep204.php
reporting/rep209.php
reporting/rep210.php
reporting/rep301.php
reporting/rep302.php
reporting/rep303.php
reporting/rep304.php
reporting/rep305.php
reporting/rep306.php
reporting/rep401.php
reporting/rep409.php
reporting/rep501.php
reporting/rep601.php
reporting/rep602.php
reporting/rep701.php
reporting/rep702.php
reporting/rep704.php
reporting/rep705.php
reporting/rep706.php
reporting/rep707.php
reporting/rep708.php
reporting/rep709.php
reporting/rep710.php
reporting/reports_main.php

index ae0a4d753dcf152924a014a28d8520c7b2c90bf7..e3a28b0617d34e3e8b6fdc89688d50bd4138448e 100644 (file)
@@ -631,6 +631,14 @@ function array_search_key($needle, $haystack, $valuekey=null)
        return @$keys[0];
 }
 
+// Recalculate report columns if orientation is landscape.
+function recalculate_cols(&$cols)
+{
+       $factor = (user_pagesize() == "A4" ? 1.4 : 1.3);
+       foreach($cols as $key => $col)
+               $cols[$key] = intval($col * $factor); 
+}
+
 function flush_dir($path, $wipe = false) 
 {
        $dir = opendir($path);
index 3cdfe39f0aa4fb4135114062ed7c6fe4edd332b7..544e61fec0e1c9f16955f491ab323d4d2675754b 100644 (file)
@@ -62,7 +62,8 @@ if (isset($_GET['AddedID']))
                submenu_print(_("&Print This Work Order"), ST_WORKORDER, $id, 'prtopt');
                submenu_print(_("&Email This Work Order"), ST_WORKORDER, $id, null, 1);
        display_note(get_gl_view_str($stype, $id, _("View the GL Journal Entries for this Work Order")));
-       $ar = array('PARAM_0' => $_GET['date'], 'PARAM_1' => $_GET['date'], 'PARAM_2' => $stype); 
+       $ar = array('PARAM_0' => $_GET['date'], 'PARAM_1' => $_GET['date'], 'PARAM_2' => $stype, 'PARAM_3' => '',
+               'PARAM_4' => (isset($def_print_orientation) && $def_print_orientation == 1 ? 1 : 0)); 
        display_note(print_link(_("Print the GL Journal Entries for this Work Order"), 702, $ar), 1);
                hyperlink_params("$path_to_root/admin/attachments.php", _("Add an Attachment"), "filterType=$stype&trans_no=$id");
        }
index 185daefcc3707f6dd2f7c400391c09705e2570ab..56c644f2efa418f8f5e4e904626cf5d51bede462 100644 (file)
@@ -3118,7 +3118,7 @@ class Spreadsheet_Excel_Writer_Parser
     function _expression()
     {
         // If it's a string return a string node
-        if (ereg("^\"[^\"]{0,255}\"$", $this->_current_token)) {
+        if (preg_match("/^\"[^\"]{0,255}\"$/", $this->_current_token)) {
             $result = $this->_createTree($this->_current_token, '', '');
             $this->_advance();
             return $result;
index 01872157cf3654cb447f89d7bea23befac947dc0..33ac54a529448ee627444c4679e9dd357a41b567 100644 (file)
@@ -693,13 +693,6 @@ class FrontReport extends Spreadsheet_Excel_Writer_Workbook
                return ($px / $unit_offset_length);
        }       
 
-       function recalculate_cols(&$cols)
-       {
-               $factor = (user_pagesize() == "A4" ? 1.4 : 1.3);
-               foreach($cols as $key => $col)
-                       $cols[$key] = intval($col * $factor); 
-       }
-
        function End($email=0, $subject='')
        {
                global $path_to_root;
index 20b96bd4dc117553f39c593fd8e85c50521b2d9a..682b8af319c5a61e644677ce1600f97582cd9eed 100644 (file)
@@ -946,13 +946,6 @@ class FrontReport extends Cpdf
                        $this->{$this->headerTmpl}();
        }
 
-       function recalculate_cols(&$cols)
-       {
-               $factor = (user_pagesize() == "A4" ? 1.4 : 1.3);
-               foreach($cols as $key => $col)
-                       $cols[$key] = intval($col * $factor); 
-       }
-
        function End($email=0, $subject='')
        {
                global $pdf_debug, $path_to_root;
index 7077f83aa214d396cf3af976645601f515ca0379..9e2ce40340666935373e561fa6f43fe9ae1ef2e1 100644 (file)
@@ -26,7 +26,7 @@ function print_document_link($doc_no, $link_text, $link=true, $type_no,
        {
                case ST_SALESQUOTE :
                        $rep = 111;
-                       // from, to, currency, bank acc, email, quote, comments
+                       // from, to, currency, email, comments, orientation
                        $ar = array(
                                'PARAM_0' => $doc_no, 
                                'PARAM_1' => $doc_no, 
@@ -37,7 +37,7 @@ function print_document_link($doc_no, $link_text, $link=true, $type_no,
                        break;
                case ST_SALESORDER :
                        $rep = 109;
-                       // from, to, currency, bank acc, email, quote, comments
+                       // from, to, currency, email, quote, comments, orientation
                        $ar = array(
                                'PARAM_0' => $doc_no, 
                                'PARAM_1' => $doc_no, 
@@ -49,7 +49,7 @@ function print_document_link($doc_no, $link_text, $link=true, $type_no,
                        break;
                case ST_CUSTDELIVERY :
                        $rep = 110;
-                       // from, to, email, comments
+                       // from, to, email, packing slip, comments, orientation
                        $ar = array(
                                'PARAM_0' => $doc_no, 
                                'PARAM_1' => $doc_no, 
@@ -61,7 +61,7 @@ function print_document_link($doc_no, $link_text, $link=true, $type_no,
                case ST_SALESINVOICE : // Sales Invoice
                case ST_CUSTCREDIT : // Customer Credit Note
                        $rep = $type_no==ST_CUSTCREDIT ? 113 : 107;
-                       // from, to, currency, bank acc, email, paylink, comments, type
+                       // from, to, currency, email, paylink, comments, orientation
                        $ar = array(
                                'PARAM_0' => $doc_no, 
                                'PARAM_1' => $doc_no, 
@@ -73,7 +73,7 @@ function print_document_link($doc_no, $link_text, $link=true, $type_no,
                        break;
                case ST_PURCHORDER :
                        $rep = 209;
-                       // from, to, currency, bank acc, email, comments
+                       // from, to, currency, email, comments, orientation
                        $ar = array(
                                'PARAM_0' => $doc_no, 
                                'PARAM_1' => $doc_no, 
@@ -84,7 +84,7 @@ function print_document_link($doc_no, $link_text, $link=true, $type_no,
                        break;
                case ST_CUSTPAYMENT :
                        $rep = 112;
-                       // from, to, currency, bank acc, email, comments
+                       // from, to, currency, email, comments, orientation
                        $ar = array(
                                'PARAM_0' => $doc_no, 
                                'PARAM_1' => $doc_no, 
@@ -94,7 +94,7 @@ function print_document_link($doc_no, $link_text, $link=true, $type_no,
                        break;
                case ST_SUPPAYMENT :
                        $rep = 210;
-                       // from, to, currency, bank acc, email, comments
+                       // from, to, currency, email, comments, orientation
                        $ar = array(
                                'PARAM_0' => $doc_no, 
                                'PARAM_1' => $doc_no, 
@@ -105,7 +105,7 @@ function print_document_link($doc_no, $link_text, $link=true, $type_no,
                        break;
                case ST_WORKORDER :
                        $rep = 409;
-                       // from, to, currency, bank acc, email, comments, orientation
+                       // from, to, email, comments, orientation
                        $ar = array(
                                'PARAM_0' => $doc_no, 
                                'PARAM_1' => $doc_no, 
index 3fee1e8f00c59deefcce79ac951c44d8d697c02c..2826c94be51ab415f49197166e7945e7eabd3daf 100644 (file)
@@ -110,7 +110,6 @@ function print_customer_balances()
                include_once($path_to_root . "/reporting/includes/pdf_report.inc");
 
        $orientation = ($orientation ? 'L' : 'P');
-
        if ($fromcust == ALL_TEXT)
                $cust = _('All');
        else
@@ -143,7 +142,7 @@ function print_customer_balances()
 
     $rep = new FrontReport(_('Customer Balances'), "CustomerBalances", user_pagesize(), 9, $orientation);
     if ($orientation == 'L')
-       $rep->recalculate_cols($cols);
+       recalculate_cols($cols);
     $rep->Font();
     $rep->Info($params, $cols, $headers, $aligns);
     $rep->NewPage();
index 5940cc5102ef4f522c4e879e2f6d4d6c7a96023c..acbf3624c3ceaaf615956b2ad09df7f214a8c834 100644 (file)
@@ -139,7 +139,7 @@ function print_aged_customer_analysis()
                $headers[2] = _('Currency');
     $rep = new FrontReport(_('Aged Customer Analysis'), "AgedCustomerAnalysis", user_pagesize(), 9, $orientation);
     if ($orientation == 'L')
-       $rep->recalculate_cols($cols);
+       recalculate_cols($cols);
 
     $rep->Font();
     $rep->Info($params, $cols, $headers, $aligns);
index cccef402c006e2f2dd9c1f1054657f0b5ffc6307..e7fdd3174421943ece6b9a62ee3bd7be165f536c 100644 (file)
@@ -104,8 +104,8 @@ function print_customer_details_listing()
                include_once($path_to_root . "/reporting/includes/excel_report.inc");
        else
                include_once($path_to_root . "/reporting/includes/pdf_report.inc");
+       
        $orientation = ($orientation ? 'L' : 'P');
-
     $dec = 0;
 
        if ($area == ALL_NUMERIC)
@@ -148,7 +148,7 @@ function print_customer_details_listing()
 
     $rep = new FrontReport(_('Customer Details Listing'), "CustomerDetailsListing", user_pagesize(), 9, $orientation);
     if ($orientation == 'L')
-       $rep->recalculate_cols($cols);
+       recalculate_cols($cols);
 
     $rep->Font();
     $rep->Info($params, $cols, $headers, $aligns);
index 72dfb9cc3fc90258688cebcc6825a4c06b91f819..ebca98df461373b4595d7eeccc504a707b164171 100644 (file)
@@ -80,8 +80,8 @@ function print_price_listing()
                include_once($path_to_root . "/reporting/includes/excel_report.inc");
        else
                include_once($path_to_root . "/reporting/includes/pdf_report.inc");
-       $orientation = ($orientation ? 'L' : 'P');
 
+       $orientation = ($orientation ? 'L' : 'P');
     $dec = user_price_dec();
 
        $home_curr = get_company_pref('curr_default');
@@ -125,7 +125,7 @@ function print_price_listing()
 
     $rep = new FrontReport(_('Price Listing'), "PriceListing", user_pagesize(), 9, $orientation);
     if ($orientation == 'L')
-       $rep->recalculate_cols($cols);
+       recalculate_cols($cols);
 
     $rep->Font();
     $rep->Info($params, $cols, $headers, $aligns);
index a8d879313866eb6ad22e8d58d321284a71257ad2..cccf289f05dcf496eedc139e93672ae9ba43a487 100644 (file)
@@ -124,7 +124,7 @@ function print_order_status_list()
 
        $rep = new FrontReport(_('Order Status Listing'), "OrderStatusListing", user_pagesize(), 9, $orientation);
     if ($orientation == 'L')
-       $rep->recalculate_cols($cols);
+       recalculate_cols($cols);
        $cols2 = $cols;
        $rep->Font();
        $rep->Info($params, $cols, $headers, $aligns, $cols2, $headers2, $aligns2);
index c1d37466b866b89ec053532effa573fb3b527e31..c8a5538533278bb0ad3273d03b28881915256d8d 100644 (file)
@@ -96,7 +96,7 @@ function print_salesman_list()
 
        $rep = new FrontReport(_('Salesman Listing'), "SalesmanListing", user_pagesize(), 9, $orientation);
     if ($orientation == 'L')
-       $rep->recalculate_cols($cols);
+       recalculate_cols($cols);
        $cols2 = $cols;
        $rep->Font();
        $rep->Info($params, $cols, $headers, $aligns, $cols2, $headers2, $aligns2);
index 798f4265cac572edc62658627ddbc335c75b419e..a1d36e845e61ae3a0b6009562d26a1305410973d 100644 (file)
@@ -63,9 +63,9 @@ function print_invoices()
        $comments = $_POST['PARAM_5'];
        $orientation = $_POST['PARAM_6'];
 
-       $orientation = ($orientation ? 'L' : 'P');
        if (!$from || !$to) return;
 
+       $orientation = ($orientation ? 'L' : 'P');
        $dec = user_price_dec();
 
        $fno = explode("-", $from);
@@ -86,7 +86,7 @@ function print_invoices()
        if ($email == 0)
                $rep = new FrontReport(_('INVOICE'), "InvoiceBulk", user_pagesize(), 9, $orientation);
     if ($orientation == 'L')
-       $rep->recalculate_cols($cols);
+       recalculate_cols($cols);
 
        $range = get_invoice_range($from, $to);
        while($row = db_fetch($range))
@@ -102,12 +102,14 @@ function print_invoices()
                        $branch = get_branch($myrow["branch_code"]);
                        $sales_order = get_sales_order_header($myrow["order_"], ST_SALESORDER);
                        if ($email == 1)
+                       {
                                $rep = new FrontReport("", "", user_pagesize(), 9, $orientation);
+                               $rep->title = _('INVOICE');
+                               $rep->filename = "Invoice" . $myrow['reference'] . ".pdf";
+                       }       
                    $rep->SetHeaderType('Header2');
                        $rep->currency = $cur;
                        $rep->Font();
-                       $rep->title = _('INVOICE');
-                       $rep->filename = "Invoice" . $myrow['reference'] . ".pdf";
                        $rep->Info($params, $cols, null, $aligns);
 
                        $contacts = get_branch_contacts($branch['branch_code'], 'invoice', $branch['debtor_no'], false);
index 7f2d6069bade395ef321c7ead7cff0fea3ed3065..de5d19408663409bc8c2a02761a71bb5722e43dc 100644 (file)
@@ -84,7 +84,7 @@ function print_statements()
        if ($email == 0)
                $rep = new FrontReport(_('STATEMENT'), "StatementBulk", user_pagesize(), 9, $orientation);
     if ($orientation == 'L')
-       $rep->recalculate_cols($cols);
+       recalculate_cols($cols);
        $sql = "SELECT debtor_no, name AS DebtorName, address, tax_id, curr_code, curdate() AS tran_date FROM ".TB_PREF."debtors_master";
        if ($customer != ALL_TEXT)
                $sql .= " WHERE debtor_no = ".db_escape($customer);
@@ -104,12 +104,14 @@ function print_statements()
                if (db_num_rows($TransResult) == 0)
                        continue;
                if ($email == 1)
+               {
                        $rep = new FrontReport("", "", user_pagesize(), 9, $orientation);
+                       $rep->title = _('STATEMENT');
+                       $rep->filename = "Statement" . $myrow['debtor_no'] . ".pdf";
+               }       
                $rep->SetHeaderType('Header2');
                $rep->currency = $cur;
                $rep->Font();
-               $rep->title = _('STATEMENT');
-               $rep->filename = "Statement" . $myrow['debtor_no'] . ".pdf";
                $rep->Info($params, $cols, null, $aligns);
 
                $contacts = get_customer_contacts($myrow['debtor_no'], 'invoice');
index 64502e2abd6202f3958b58f739ca347579f95592..b5acbab7050552482d353ebcc2ee41f06b4e39f4 100644 (file)
@@ -45,11 +45,9 @@ function print_sales_orders()
        $comments = $_POST['PARAM_5'];
        $orientation = $_POST['PARAM_6'];
 
+       if (!$from || !$to) return;
+
        $orientation = ($orientation ? 'L' : 'P');
-       if ($from == null)
-               $from = 0;
-       if ($to == null)
-               $to = 0;
        $dec = user_price_dec();
 
        $cols = array(4, 60, 225, 300, 325, 385, 450, 515);
@@ -70,7 +68,7 @@ function print_sales_orders()
                        $rep = new FrontReport(_("QUOTE"), "QuoteBulk", user_pagesize(), 9, $orientation);
        }
     if ($orientation == 'L')
-       $rep->recalculate_cols($cols);
+       recalculate_cols($cols);
 
        for ($i = $from; $i <= $to; $i++)
        {
index 9e9fee28f0ee028ee88d9feba5bca2683a445ecc..31e9f8c50372178d2955515b50016e64eeb9a4c0 100644 (file)
@@ -45,9 +45,9 @@ function print_deliveries()
        $comments = $_POST['PARAM_4'];
        $orientation = $_POST['PARAM_5'];
 
-       $orientation = ($orientation ? 'L' : 'P');
        if (!$from || !$to) return;
 
+       $orientation = ($orientation ? 'L' : 'P');
        $dec = user_price_dec();
 
        $fno = explode("-", $from);
@@ -72,7 +72,7 @@ function print_deliveries()
                        $rep = new FrontReport(_('PACKING SLIP'), "PackingSlipBulk", user_pagesize(), 9, $orientation);
        }
     if ($orientation == 'L')
-       $rep->recalculate_cols($cols);
+       recalculate_cols($cols);
        for ($i = $from; $i <= $to; $i++)
        {
                        if (!exists_customer_trans(ST_CUSTDELIVERY, $i))
@@ -81,21 +81,24 @@ function print_deliveries()
                        $branch = get_branch($myrow["branch_code"]);
                        $sales_order = get_sales_order_header($myrow["order_"], ST_SALESORDER); // ?
                        if ($email == 1)
+                       {
                                $rep = new FrontReport("", "", user_pagesize(), 9, $orientation);
+                               if ($packing_slip == 0)
+                               {
+                                       $rep->title = _('DELIVERY NOTE');
+                                       $rep->filename = "Delivery" . $myrow['reference'] . ".pdf";
+                               }
+                               else
+                               {
+                                       $rep->title = _('PACKING SLIP');
+                                       $rep->filename = "Packing_slip" . $myrow['reference'] . ".pdf";
+                               }
+                       }
                        $rep->SetHeaderType('Header2');
                        $rep->currency = $cur;
                        $rep->Font();
-                       if ($packing_slip == 0)
-                       {
-                               $rep->title = _('DELIVERY NOTE');
-                               $rep->filename = "Delivery" . $myrow['reference'] . ".pdf";
-                       }
-                       else
-                       {
-                               $rep->title = _('PACKING SLIP');
-                               $rep->filename = "Packing_slip" . $myrow['reference'] . ".pdf";
-                       }
                        $rep->Info($params, $cols, null, $aligns);
+
                        $contacts = get_branch_contacts($branch['branch_code'], 'delivery', $branch['debtor_no'], false);
                        $rep->SetCommonData($myrow, $branch, $sales_order, '', ST_CUSTDELIVERY, $contacts);
                        $rep->NewPage();
index be0c16bb459e88fe8d99e5df3f3fb0ba0c9b0705..eb973ff5be9a4a0c2bcf8d9a8d111b42ed384ba2 100644 (file)
@@ -42,11 +42,9 @@ function print_sales_quotations()
        $comments = $_POST['PARAM_4'];
        $orientation = $_POST['PARAM_5'];
 
+       if (!$from || !$to) return;
+
        $orientation = ($orientation ? 'L' : 'P');
-       if ($from == null)
-               $from = 0;
-       if ($to == null)
-               $to = 0;
        $dec = user_price_dec();
 
        $cols = array(4, 60, 225, 300, 325, 385, 450, 515);
@@ -61,7 +59,7 @@ function print_sales_quotations()
        if ($email == 0)
                $rep = new FrontReport(_("SALES QUOTATION"), "SalesQuotationBulk", user_pagesize(), 9, $orientation);
     if ($orientation == 'L')
-       $rep->recalculate_cols($cols);
+       recalculate_cols($cols);
 
        for ($i = $from; $i <= $to; $i++)
        {
@@ -70,16 +68,18 @@ function print_sales_quotations()
                $params['bankaccount'] = $baccount['id'];
                $branch = get_branch($myrow["branch_code"]);
                if ($email == 1)
+               {
                        $rep = new FrontReport("", "", user_pagesize(), 9, $orientation);
+                       if ($print_invoice_no == 1)
+                               $rep->filename = "SalesQuotation" . $i . ".pdf";
+                       else    
+                               $rep->filename = "SalesQuotation" . $myrow['reference'] . ".pdf";
+               }               
                $rep->SetHeaderType('Header2');
                $rep->currency = $cur;
                $rep->Font();
-               if ($print_invoice_no == 1)
-                       $rep->filename = "SalesQuotation" . $i . ".pdf";
-               else    
-                       $rep->filename = "SalesQuotation" . $myrow['reference'] . ".pdf";
                $rep->Info($params, $cols, null, $aligns);
-               $rep->title = _("SALES QUOTATION");
+
                $contacts = get_branch_contacts($branch['branch_code'], 'order', $branch['debtor_no'], false);
                $rep->SetCommonData($myrow, $branch, $myrow, $baccount, ST_SALESQUOTE, $contacts);
                //$rep->headerFunc = 'Header2';
index d9297b870a17afd1bd3a8760fdf6f5b1dcc66081..d60d56e973e20d300413a019f8050115ecf09fc7 100644 (file)
@@ -60,9 +60,9 @@ function print_receipts()
        $comments = $_POST['PARAM_3'];
        $orientation = $_POST['PARAM_4'];
 
-       $orientation = ($orientation ? 'L' : 'P');
        if (!$from || !$to) return;
 
+       $orientation = ($orientation ? 'L' : 'P');
        $dec = user_price_dec();
 
        $fno = explode("-", $from);
@@ -81,7 +81,7 @@ function print_receipts()
 
        $rep = new FrontReport(_('RECEIPT'), "ReceiptBulk", user_pagesize(), 9, $orientation);
     if ($orientation == 'L')
-       $rep->recalculate_cols($cols);
+       recalculate_cols($cols);
        $rep->SetHeaderType('Header2');
        $rep->currency = $cur;
        $rep->Font();
@@ -102,7 +102,6 @@ function print_receipts()
                        $baccount = db_fetch($res);
                        $params['bankaccount'] = $baccount['bank_act'];
 
-                       $rep->title = _('RECEIPT');
                        $contacts = get_branch_contacts($myrow['branch_code'], 'invoice', $myrow['debtor_no']);
                        $rep->SetCommonData($myrow, null, $myrow, $baccount, ST_CUSTPAYMENT, $contacts);
                        $rep->NewPage();
index 8dfb92b139559621b8c88a309319ee8b213ad381..940b9e145260b1ef13010ca9c5d9d5fabff0d22e 100644 (file)
@@ -44,9 +44,9 @@ function print_credits()
        $comments = $_POST['PARAM_5'];
        $orientation = $_POST['PARAM_6'];
 
-       $orientation = ($orientation ? 'L' : 'P');
        if (!$from || !$to) return;
 
+       $orientation = ($orientation ? 'L' : 'P');
        $dec = user_price_dec();
 
        $fno = explode("-", $from);
@@ -66,7 +66,7 @@ function print_credits()
        if ($email == 0)
                $rep = new FrontReport(_('CREDIT NOTE'), "InvoiceBulk", user_pagesize(), 9, $orientation);
     if ($orientation == 'L')
-       $rep->recalculate_cols($cols);
+       recalculate_cols($cols);
 
        for ($i = $from; $i <= $to; $i++)
        {
@@ -81,12 +81,14 @@ function print_credits()
                        $branch['disable_branch'] = $paylink; // helper
                        $sales_order = null;
                        if ($email == 1)
+                       {
                                $rep = new FrontReport("", "", user_pagesize(), 9, $orientation);
+                               $rep->title = _('CREDIT NOTE');
+                               $rep->filename = "CreditNote" . $myrow['reference'] . ".pdf";
+                       }       
                        $rep->SetHeaderType('Header2');
                        $rep->currency = $cur;
                        $rep->Font();
-                       $rep->title = _('CREDIT NOTE');
-                       $rep->filename = "CreditNote" . $myrow['reference'] . ".pdf";
                        $rep->Info($params, $cols, null, $aligns);
 
                        $contacts = get_branch_contacts($branch['branch_code'], 'invoice', $branch['debtor_no'], false);
index 6dda958e599bd18faf141dda90b2b8ea69556d92..302a077a0b07efde0e8da53b44ab91ad6e34f365 100644 (file)
@@ -95,7 +95,7 @@ function print_sales_summary_report()
        $headers = array(_('Customer'), _('Tax Id'), _('Total ex. Tax'), _('Tax'));
        $aligns = array('left', 'left', 'right', 'right');
     if ($orientation == 'L')
-       $rep->recalculate_cols($cols);
+       recalculate_cols($cols);
        
        $rep->Font();
        $rep->Info($params, $cols, $headers, $aligns);
index ee2bbcbcd40e4bc13c054c040e7ebaee31cc7417..8131e164e1daa6eb9450a6e437bf982878068987 100644 (file)
@@ -130,7 +130,7 @@ function print_supplier_balances()
 
     $rep = new FrontReport(_('Supplier Balances'), "SupplierBalances", user_pagesize(), 9, $orientation);
     if ($orientation == 'L')
-       $rep->recalculate_cols($cols);
+       recalculate_cols($cols);
 
     $rep->Font();
     $rep->Info($params, $cols, $headers, $aligns);
index 3a674d89cabce5179352de4fa5cfa33f6414c705..7efc74c5184392c905a7b1b59c583d28fe702d5a 100644 (file)
@@ -144,7 +144,7 @@ function print_aged_supplier_analysis()
                $headers[2] = _('currency');
     $rep = new FrontReport(_('Aged Supplier Analysis'), "AgedSupplierAnalysis", user_pagesize(), 9, $orientation);
     if ($orientation == 'L')
-       $rep->recalculate_cols($cols);
+       recalculate_cols($cols);
 
     $rep->Font();
     $rep->Info($params, $cols, $headers, $aligns);
index 95c3c0e664fe732ba3f2013a542b3981bd1edd85..c1784e51cf6af19d0a05ab0aa3773b3670b45614 100644 (file)
@@ -103,7 +103,7 @@ function print_payment_report()
 
     $rep = new FrontReport(_('Payment Report'), "PaymentReport", user_pagesize(), 9, $orientation);
     if ($orientation == 'L')
-       $rep->recalculate_cols($cols);
+       recalculate_cols($cols);
 
     $rep->Font();
     $rep->Info($params, $cols, $headers, $aligns);
index cfd7f8dfa485f587a04c18ad63f69d044544dc4a..3dbe96fa6a7110f25463d6f61cd19d3931d966eb 100644 (file)
@@ -91,7 +91,7 @@ function print_outstanding_GRN()
 
     $rep = new FrontReport(_('Outstanding GRNs Report'), "OutstandingGRN", user_pagesize(), 9, $orientation);
     if ($orientation == 'L')
-       $rep->recalculate_cols($cols);
+       recalculate_cols($cols);
 
     $rep->Font();
     $rep->Info($params, $cols, $headers, $aligns);
index 1340c61b0623b7ed24ada8a6ec2817604a9fd4ca..e5188bc6e812a28d9cd714259855a0534a82bc15 100644 (file)
@@ -69,11 +69,9 @@ function print_po()
        $comments = $_POST['PARAM_4'];
        $orientation = $_POST['PARAM_5'];
 
+       if (!$from || !$to) return;
+
        $orientation = ($orientation ? 'L' : 'P');
-       if ($from == null)
-               $from = 0;
-       if ($to == null)
-               $to = 0;
        $dec = user_price_dec();
 
        $cols = array(4, 60, 225, 300, 340, 385, 450, 515);
@@ -88,7 +86,7 @@ function print_po()
        if ($email == 0)
                $rep = new FrontReport(_('PURCHASE ORDER'), "PurchaseOrderBulk", user_pagesize(), 9, $orientation);
     if ($orientation == 'L')
-       $rep->recalculate_cols($cols);
+       recalculate_cols($cols);
 
        for ($i = $from; $i <= $to; $i++)
        {
@@ -97,12 +95,14 @@ function print_po()
                $params['bankaccount'] = $baccount['id'];
 
                if ($email == 1)
-                       $rep = new FrontReport("", "", user_pagesize(), $orientation);
+               {
+                       $rep = new FrontReport("", "", user_pagesize(), 9, $orientation);
+                       $rep->title = _('PURCHASE ORDER');
+                       $rep->filename = "PurchaseOrder" . $i . ".pdf";
+               }       
                $rep->SetHeaderType('Header2');
                $rep->currency = $cur;
                $rep->Font();
-               $rep->title = _('PURCHASE ORDER');
-               $rep->filename = "PurchaseOrder" . $i . ".pdf";
                $rep->Info($params, $cols, null, $aligns);
 
                $contacts = get_supplier_contacts($myrow['supplier_id'], 'order');
index 4b9489c53685c00bb38c958ca8c0a1fc9aa14cbd..0b3f92a4463db6bd3962471d38993c54f78e8ac5 100644 (file)
@@ -60,9 +60,9 @@ function print_remittances()
        $comments = $_POST['PARAM_4'];
        $orientation = $_POST['PARAM_5'];
 
-       $orientation = ($orientation ? 'L' : 'P');
        if (!$from || !$to) return;
 
+       $orientation = ($orientation ? 'L' : 'P');
        $dec = user_price_dec();
 
        $fno = explode("-", $from);
@@ -82,7 +82,7 @@ function print_remittances()
        if ($email == 0)
                $rep = new FrontReport(_('REMITTANCE'), "RemittanceBulk", user_pagesize(), 9, $orientation);
     if ($orientation == 'L')
-       $rep->recalculate_cols($cols);
+       recalculate_cols($cols);
 
        for ($i = $from; $i <= $to; $i++)
        {
@@ -100,12 +100,14 @@ function print_remittances()
                        $params['bankaccount'] = $baccount['bank_act'];
 
                        if ($email == 1)
+                       {
                                $rep = new FrontReport("", "", user_pagesize(), 9, $orientation);
+                               $rep->title = _('REMITTANCE');
+                               $rep->filename = "Remittance" . $i . ".pdf";
+                       }       
                        $rep->SetHeaderType('Header2');
                        $rep->currency = $cur;
                        $rep->Font();
-                       $rep->title = _('REMITTANCE');
-                       $rep->filename = "Remittance" . $i . ".pdf";
                        $rep->Info($params, $cols, null, $aligns);
 
                        $contacts = get_supplier_contacts($myrow['supplier_id'], 'invoice');
index 8c154050d0d9ecbee2b1107ee33691c091412503..5ad1735cb31cb5d2630ca1a0207ce6b4d79a775f 100644 (file)
@@ -113,7 +113,7 @@ function print_inventory_valuation_report()
 
     $rep = new FrontReport(_('Inventory Valuation Report'), "InventoryValReport", user_pagesize(), 9, $orientation);
     if ($orientation == 'L')
-       $rep->recalculate_cols($cols);
+       recalculate_cols($cols);
     $rep->Font();
     $rep->Info($params, $cols, $headers, $aligns);
     $rep->NewPage();
index 5c9584b5e8b7ea9efa2d047856f3169627ab7146..68ad88532dc6439bac3720fbe80e908b771696cd 100644 (file)
@@ -133,7 +133,7 @@ function print_inventory_planning()
 
     $rep = new FrontReport(_('Inventory Planning Report'), "InventoryPlanning", user_pagesize(), 9, $orientation);
     if ($orientation == 'L')
-       $rep->recalculate_cols($cols);
+       recalculate_cols($cols);
 
     $rep->Font();
     $rep->Info($params, $cols, $headers, $aligns);
index 978810c7936bc8f049ff691d756a968416dcdc25..9c2a493bdf9831300e726c8a88d6605997358003 100644 (file)
@@ -132,7 +132,7 @@ function print_stock_check()
 
        $rep = new FrontReport(_('Stock Check Sheets'), "StockCheckSheet", user_pagesize(), 9, $orientation);
     if ($orientation == 'L')
-       $rep->recalculate_cols($cols);
+       recalculate_cols($cols);
 
     $rep->Font();
     $rep->Info($params, $cols, $headers, $aligns);
index e54a9759cedbe26579cabc6ff87cba72472f1564..f966702990b6f33287f712e4de4f47df858a4f99 100644 (file)
@@ -125,7 +125,7 @@ function print_inventory_sales()
 
     $rep = new FrontReport(_('Inventory Sales Report'), "InventorySalesReport", user_pagesize(), 9, $orientation);
        if ($orientation == 'L')
-       $rep->recalculate_cols($cols);
+       recalculate_cols($cols);
  
     $rep->Font();
     $rep->Info($params, $cols, $headers, $aligns);
index 010fa364df86eafee18cc641e7d07d7181c9adbd..083d73f537a6adab0c9511cb3e42a0693318dcb8 100644 (file)
@@ -106,7 +106,7 @@ function print_grn_valuation()
 
     $rep = new FrontReport(_('GRN Valuation Report'), "GRNValuationReport", user_pagesize(), 9, $orientation);
     if ($orientation == 'L')
-       $rep->recalculate_cols($cols);
+       recalculate_cols($cols);
 
     $rep->Font();
     $rep->Info($params, $cols, $headers, $aligns);
index 4a5a4ed705945e9e11ac003d49cae61aa1d6bf55..92eb08fc5819000e4ff154de5cb2fbc231e027d0 100644 (file)
@@ -153,7 +153,7 @@ function print_inventory_purchase()
 
     $rep = new FrontReport(_('Inventory Purchasing Report'), "InventoryPurchasingReport", user_pagesize(), 9, $orientation);
     if ($orientation == 'L')
-       $rep->recalculate_cols($cols);
+       recalculate_cols($cols);
 
     $rep->Font();
     $rep->Info($params, $cols, $headers, $aligns);
index a65f35e9190640eeafddfd390ceb9027cfe7eaa5..0471486b577d68f7bbdbb132fa10e4b5c20098af 100644 (file)
@@ -77,7 +77,7 @@ function print_bill_of_material()
 
     $rep = new FrontReport(_('Bill of Material Listing'), "BillOfMaterial", user_pagesize(), 9, $orientation);
     if ($orientation == 'L')
-       $rep->recalculate_cols($cols);
+       recalculate_cols($cols);
 
     $rep->Font();
     $rep->Info($params, $cols, $headers, $aligns);
index d5a66e040652fcb409872ba1421482e131eab4f9..544461de969ad8a27217ee709d33afb7ad721e6a 100644 (file)
@@ -38,9 +38,9 @@ function print_workorders()
        $comments = $_POST['PARAM_3'];
        $orientation = $_POST['PARAM_4'];
 
-       $orientation = ($orientation ? 'L' : 'P');
        if (!$from || !$to) return;
 
+       $orientation = ($orientation ? 'L' : 'P');
        $fno = explode("-", $from);
        $tno = explode("-", $to);
        $from = min($fno[0], $tno[0]);
@@ -58,7 +58,7 @@ function print_workorders()
        if ($email == 0)
                $rep = new FrontReport(_('WORK ORDER'), "WorkOrderBulk", user_pagesize(), 9, $orientation);
        if ($orientation == 'L')
-       $rep->recalculate_cols($cols);
+       recalculate_cols($cols);
  
        for ($i = $from; $i <= $to; $i++)
        {
@@ -67,12 +67,14 @@ function print_workorders()
                        continue;
                $date_ = sql2date($myrow["date_"]);
                if ($email == 1)
+               {
                        $rep = new FrontReport("", "", user_pagesize(), 9, $orientation);
+                       $rep->title = _('WORK ORDER');
+                       $rep->filename = "WorkOrder" . $myrow['wo_ref'] . ".pdf";
+               }       
                $rep->SetHeaderType('Header2');
                $rep->currency = $cur;
                $rep->Font();
-                       $rep->title = _('WORK ORDER');
-                       $rep->filename = "WorkOrder" . $myrow['wo_ref'] . ".pdf";
                $rep->Info($params, $cols, null, $aligns);
 
                $contact = array('email' =>$myrow['email'],'lang' => $dflt_lang, // ???
index bba03cde2be4d1a345c8bd5d5e93923747a65834..e8a21a23cfcc2572df0317ad600965909d4a84dd 100644 (file)
@@ -93,7 +93,7 @@ function print_dimension_summary()
 
     $rep = new FrontReport(_('Dimension Summary'), "DimensionSummary", user_pagesize(), 9, $orientation);
     if ($orientation == 'L')
-       $rep->recalculate_cols($cols);
+       recalculate_cols($cols);
 
     $rep->Font();
     $rep->Info($params, $cols, $headers, $aligns);
index 6f9c41b963e7c4f7babd43846f10784ed980a319..db85e6686015a1f1be3c82e2bb891d88bf1842a9 100644 (file)
@@ -86,7 +86,7 @@ function print_bank_transactions()
            2 => array('text' => _('Bank Account'),'from' => $act,'to' => ''));
 
     if ($orientation == 'L')
-       $rep->recalculate_cols($cols);
+       recalculate_cols($cols);
        $rep->Font();
        $rep->Info($params, $cols, $headers, $aligns);
        $rep->NewPage();
index 79b3387b3a1dbea64463eae9021c41e4c730947a..284bfda82146972e9382f69dd86b37cda72445c7 100644 (file)
@@ -108,11 +108,11 @@ function print_bank_transactions_reconcile()
                $rep->Font();
                $total = $prev_balance;
                $rep->NewLine(2);
+               // Keep a running total as we loop through
+               // the transactions.
+               $total_debit = $total_credit = 0;                       
                if ($rows > 0)
                {
-                       // Keep a running total as we loop through
-                       // the transactions.
-                       $total_debit = $total_credit = 0;                       
                        
                        while ($myrow=db_fetch($trans))
                        {
index c3dfb3b6e4fff30acd341d23fa605a3a3abc8ce1..5c7c829e0c5231f8815745bdcd87a9d2e49c826d 100644 (file)
@@ -116,7 +116,7 @@ function print_Chart_of_Accounts()
 
        $rep = new FrontReport(_('Chart of Accounts'), "ChartOfAccounts", user_pagesize(), 9, $orientation);
     if ($orientation == 'L')
-       $rep->recalculate_cols($cols);
+       recalculate_cols($cols);
        
        $rep->Font();
        $rep->Info($params, $cols, $headers, $aligns);
index 6d6f324533c512cabf1c77971924c6b6e0a001e2..fdc1224a5796318d7f4e28ee2973ae9ea9d5d530 100644 (file)
@@ -63,7 +63,7 @@ function print_list_of_journal_entries()
 
     $rep = new FrontReport(_('List of Journal Entries'), "JournalEntries", user_pagesize(), 9, $orientation);
     if ($orientation == 'L')
-       $rep->recalculate_cols($cols);
+       recalculate_cols($cols);
 
     $rep->Font();
     $rep->Info($params, $cols, $headers, $aligns);
index d3cf9047cac4c5d3c0ba3c01958d90c85a5e9748..45ed714ab2fefdc31dba4353863449810b7d8055 100644 (file)
@@ -114,7 +114,7 @@ function print_GL_transactions()
                                    2 => array('text' => _('Accounts'),'from' => $fromacc,'to' => $toacc));
     }
     if ($orientation == 'L')
-       $rep->recalculate_cols($cols);
+       recalculate_cols($cols);
 
        $rep->Font();
        $rep->Info($params, $cols, $headers, $aligns);
index 88e1ec6b92d17b2126875bbfb21bdc54d343d79d..7cf8f8fc7c2f226c036eba7df04e05b53466811a 100644 (file)
@@ -277,7 +277,7 @@ function print_annual_expense_breakdown()
 
        $rep = new FrontReport(_('Annual Expense Breakdown'), "AnnualBreakDown", user_pagesize(), 9, $orientation);
     if ($orientation == 'L')
-       $rep->recalculate_cols($cols);
+       recalculate_cols($cols);
        $rep->Font();
        $rep->Info($params, $cols, $headers, $aligns);
        $rep->NewPage();
index e670e2e8f8d74d079f08fd7dd23bf33a28699178..ebb9cd8328416852d555f88b0dac053dc731adda 100644 (file)
@@ -214,7 +214,7 @@ function print_balance_sheet()
 
        $rep = new FrontReport(_('Balance Sheet'), "BalanceSheet", user_pagesize(), 9, $orientation);
     if ($orientation == 'L')
-       $rep->recalculate_cols($cols);
+       recalculate_cols($cols);
        $rep->Font();
        $rep->Info($params, $cols, $headers, $aligns);
        $rep->NewPage();
index d38d3c3326f87392e7f24eb06b3a1825da98abd2..846bb9d4f8a75b5eabc57eb5d0d02be9ad2a2346 100644 (file)
@@ -257,7 +257,7 @@ function print_profit_and_loss_statement()
 
        $rep = new FrontReport(_('Profit and Loss Statement'), "ProfitAndLoss", user_pagesize(), 9, $orientation);
     if ($orientation == 'L')
-       $rep->recalculate_cols($cols);
+       recalculate_cols($cols);
        $rep->Font();
        $rep->Info($params, $cols, $headers, $aligns);
        $rep->NewPage();
index ff82c89bc1abec771b94d2dab003a93af3f6e129..17854bca712e68c4c90ea3c3d0fb54004c6f1d5f 100644 (file)
@@ -210,8 +210,8 @@ function print_trial_balance()
        $rep = new FrontReport(_('Trial Balance'), "TrialBalance", user_pagesize(), 9, $orientation);
     if ($orientation == 'L')
     {
-       $rep->recalculate_cols($cols);
-       $rep->recalculate_cols($cols2);
+       recalculate_cols($cols);
+       recalculate_cols($cols2);
        }
        $rep->Font();
        $rep->Info($params, $cols, $headers, $aligns, $cols2, $headers2, $aligns2);
index f5b9dd072f0ff5d9ec86b0a20915358fcdf6961b..c424dad05b5dc48933b141d1c1ffb93ef4e0ef93 100644 (file)
@@ -112,7 +112,7 @@ function print_tax_report()
                _('Net'), _('Rate'), _('Tax'), '', _('Name'));
        $aligns = array('left', 'left', 'left', 'left', 'left', 'right', 'right', 'right', 'right','left');
     if ($orientation == 'L')
-       $rep->recalculate_cols($cols);
+       recalculate_cols($cols);
        
        $rep->Font();
        $rep->Info($params, $cols, $headers, $aligns);
@@ -178,7 +178,7 @@ function print_tax_report()
        // Summary
        $cols2 = array(0, 100, 180,     260, 340, 420, 500);
     if ($orientation == 'L')
-       $rep->recalculate_cols($cols2);
+       recalculate_cols($cols2);
 
        $headers2 = array(_('Tax Rate'), _('Outputs'), _('Output Tax'), _('Inputs'), _('Input Tax'), _('Net Tax'));
 
index eb4ea411a98d9a623c0a5ee812fdcd36a6dc84aa..b7852d61908b8dfe5bd79348f8915ba8444787b7 100644 (file)
@@ -88,7 +88,7 @@ function print_audit_trail()
 
     $rep = new FrontReport(_('Audit Trail'), "AuditTrail", user_pagesize(), 9, $orientation);
     if ($orientation == 'L')
-       $rep->recalculate_cols($cols);
+       recalculate_cols($cols);
     $rep->Font();
     $rep->Info($params, $cols, $headers, $aligns);
     $rep->NewPage();
index 500c7b54e3cde8479cf327170d0e0b543da97b86..dd35488aaf27580aaae80e8abe1cf235307e83a4 100644 (file)
@@ -280,6 +280,12 @@ $reports->addReportClass(_('Banking'), RC_BANKING);
                        _('Comments') => 'TEXTBOX',
                        _('Orientation') => 'ORIENTATION',
                        _('Destination') => 'DESTINATION'));
+       $reports->addReport(RC_BANKING,  602, _('Bank Statement w/ &Reconcile'),
+       array(  _('Bank Accounts') => 'BANK_ACCOUNTS',
+                       _('Start Date') => 'DATEBEGINM',
+                       _('End Date') => 'DATEENDM',
+                       _('Comments') => 'TEXTBOX',
+                       _('Destination') => 'DESTINATION'));
 
 $reports->addReportClass(_('General Ledger'), RC_GL);
 $reports->addReport(RC_GL, 701, _('Chart of &Accounts'),