From 6a4d8e6c1e92ff1b8fc5abb3fae76fb1c1968550 Mon Sep 17 00:00:00 2001 From: Joe Hunt Date: Thu, 17 Jan 2013 01:32:00 +0100 Subject: [PATCH] Rerun of implemented Selectable Print Orientation (Portrait, Landscape) for all reports in report centre --- includes/current_user.inc | 8 ++++++++ manufacturing/work_order_entry.php | 3 ++- reporting/includes/Workbook.php | 2 +- reporting/includes/excel_report.inc | 7 ------- reporting/includes/pdf_report.inc | 7 ------- reporting/includes/reporting.inc | 16 ++++++++-------- reporting/rep101.php | 3 +-- reporting/rep102.php | 2 +- reporting/rep103.php | 4 ++-- reporting/rep104.php | 4 ++-- reporting/rep105.php | 2 +- reporting/rep106.php | 2 +- reporting/rep107.php | 10 ++++++---- reporting/rep108.php | 8 +++++--- reporting/rep109.php | 8 +++----- reporting/rep110.php | 27 +++++++++++++++------------ reporting/rep111.php | 20 ++++++++++---------- reporting/rep112.php | 5 ++--- reporting/rep113.php | 10 ++++++---- reporting/rep114.php | 2 +- reporting/rep201.php | 2 +- reporting/rep202.php | 2 +- reporting/rep203.php | 2 +- reporting/rep204.php | 2 +- reporting/rep209.php | 16 ++++++++-------- reporting/rep210.php | 10 ++++++---- reporting/rep301.php | 2 +- reporting/rep302.php | 2 +- reporting/rep303.php | 2 +- reporting/rep304.php | 2 +- reporting/rep305.php | 2 +- reporting/rep306.php | 2 +- reporting/rep401.php | 2 +- reporting/rep409.php | 10 ++++++---- reporting/rep501.php | 2 +- reporting/rep601.php | 2 +- reporting/rep602.php | 6 +++--- reporting/rep701.php | 2 +- reporting/rep702.php | 2 +- reporting/rep704.php | 2 +- reporting/rep705.php | 2 +- reporting/rep706.php | 2 +- reporting/rep707.php | 2 +- reporting/rep708.php | 4 ++-- reporting/rep709.php | 4 ++-- reporting/rep710.php | 2 +- reporting/reports_main.php | 6 ++++++ 47 files changed, 128 insertions(+), 118 deletions(-) diff --git a/includes/current_user.inc b/includes/current_user.inc index ae0a4d75..e3a28b06 100644 --- a/includes/current_user.inc +++ b/includes/current_user.inc @@ -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); diff --git a/manufacturing/work_order_entry.php b/manufacturing/work_order_entry.php index 3cdfe39f..544e61fe 100644 --- a/manufacturing/work_order_entry.php +++ b/manufacturing/work_order_entry.php @@ -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"); } diff --git a/reporting/includes/Workbook.php b/reporting/includes/Workbook.php index 185daefc..56c644f2 100644 --- a/reporting/includes/Workbook.php +++ b/reporting/includes/Workbook.php @@ -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; diff --git a/reporting/includes/excel_report.inc b/reporting/includes/excel_report.inc index 01872157..33ac54a5 100644 --- a/reporting/includes/excel_report.inc +++ b/reporting/includes/excel_report.inc @@ -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; diff --git a/reporting/includes/pdf_report.inc b/reporting/includes/pdf_report.inc index 20b96bd4..682b8af3 100644 --- a/reporting/includes/pdf_report.inc +++ b/reporting/includes/pdf_report.inc @@ -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; diff --git a/reporting/includes/reporting.inc b/reporting/includes/reporting.inc index 7077f83a..9e2ce403 100644 --- a/reporting/includes/reporting.inc +++ b/reporting/includes/reporting.inc @@ -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, diff --git a/reporting/rep101.php b/reporting/rep101.php index 3fee1e8f..2826c94b 100644 --- a/reporting/rep101.php +++ b/reporting/rep101.php @@ -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(); diff --git a/reporting/rep102.php b/reporting/rep102.php index 5940cc51..acbf3624 100644 --- a/reporting/rep102.php +++ b/reporting/rep102.php @@ -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); diff --git a/reporting/rep103.php b/reporting/rep103.php index cccef402..e7fdd317 100644 --- a/reporting/rep103.php +++ b/reporting/rep103.php @@ -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); diff --git a/reporting/rep104.php b/reporting/rep104.php index 72dfb9cc..ebca98df 100644 --- a/reporting/rep104.php +++ b/reporting/rep104.php @@ -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); diff --git a/reporting/rep105.php b/reporting/rep105.php index a8d87931..cccf289f 100644 --- a/reporting/rep105.php +++ b/reporting/rep105.php @@ -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); diff --git a/reporting/rep106.php b/reporting/rep106.php index c1d37466..c8a55385 100644 --- a/reporting/rep106.php +++ b/reporting/rep106.php @@ -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); diff --git a/reporting/rep107.php b/reporting/rep107.php index 798f4265..a1d36e84 100644 --- a/reporting/rep107.php +++ b/reporting/rep107.php @@ -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); diff --git a/reporting/rep108.php b/reporting/rep108.php index 7f2d6069..de5d1940 100644 --- a/reporting/rep108.php +++ b/reporting/rep108.php @@ -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'); diff --git a/reporting/rep109.php b/reporting/rep109.php index 64502e2a..b5acbab7 100644 --- a/reporting/rep109.php +++ b/reporting/rep109.php @@ -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++) { diff --git a/reporting/rep110.php b/reporting/rep110.php index 9e9fee28..31e9f8c5 100644 --- a/reporting/rep110.php +++ b/reporting/rep110.php @@ -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(); diff --git a/reporting/rep111.php b/reporting/rep111.php index be0c16bb..eb973ff5 100644 --- a/reporting/rep111.php +++ b/reporting/rep111.php @@ -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'; diff --git a/reporting/rep112.php b/reporting/rep112.php index d9297b87..d60d56e9 100644 --- a/reporting/rep112.php +++ b/reporting/rep112.php @@ -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(); diff --git a/reporting/rep113.php b/reporting/rep113.php index 8dfb92b1..940b9e14 100644 --- a/reporting/rep113.php +++ b/reporting/rep113.php @@ -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); diff --git a/reporting/rep114.php b/reporting/rep114.php index 6dda958e..302a077a 100644 --- a/reporting/rep114.php +++ b/reporting/rep114.php @@ -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); diff --git a/reporting/rep201.php b/reporting/rep201.php index ee2bbcbc..8131e164 100644 --- a/reporting/rep201.php +++ b/reporting/rep201.php @@ -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); diff --git a/reporting/rep202.php b/reporting/rep202.php index 3a674d89..7efc74c5 100644 --- a/reporting/rep202.php +++ b/reporting/rep202.php @@ -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); diff --git a/reporting/rep203.php b/reporting/rep203.php index 95c3c0e6..c1784e51 100644 --- a/reporting/rep203.php +++ b/reporting/rep203.php @@ -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); diff --git a/reporting/rep204.php b/reporting/rep204.php index cfd7f8df..3dbe96fa 100644 --- a/reporting/rep204.php +++ b/reporting/rep204.php @@ -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); diff --git a/reporting/rep209.php b/reporting/rep209.php index 1340c61b..e5188bc6 100644 --- a/reporting/rep209.php +++ b/reporting/rep209.php @@ -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'); diff --git a/reporting/rep210.php b/reporting/rep210.php index 4b9489c5..0b3f92a4 100644 --- a/reporting/rep210.php +++ b/reporting/rep210.php @@ -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'); diff --git a/reporting/rep301.php b/reporting/rep301.php index 8c154050..5ad1735c 100644 --- a/reporting/rep301.php +++ b/reporting/rep301.php @@ -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(); diff --git a/reporting/rep302.php b/reporting/rep302.php index 5c9584b5..68ad8853 100644 --- a/reporting/rep302.php +++ b/reporting/rep302.php @@ -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); diff --git a/reporting/rep303.php b/reporting/rep303.php index 978810c7..9c2a493b 100644 --- a/reporting/rep303.php +++ b/reporting/rep303.php @@ -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); diff --git a/reporting/rep304.php b/reporting/rep304.php index e54a9759..f9667029 100644 --- a/reporting/rep304.php +++ b/reporting/rep304.php @@ -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); diff --git a/reporting/rep305.php b/reporting/rep305.php index 010fa364..083d73f5 100644 --- a/reporting/rep305.php +++ b/reporting/rep305.php @@ -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); diff --git a/reporting/rep306.php b/reporting/rep306.php index 4a5a4ed7..92eb08fc 100644 --- a/reporting/rep306.php +++ b/reporting/rep306.php @@ -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); diff --git a/reporting/rep401.php b/reporting/rep401.php index a65f35e9..0471486b 100644 --- a/reporting/rep401.php +++ b/reporting/rep401.php @@ -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); diff --git a/reporting/rep409.php b/reporting/rep409.php index d5a66e04..544461de 100644 --- a/reporting/rep409.php +++ b/reporting/rep409.php @@ -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, // ??? diff --git a/reporting/rep501.php b/reporting/rep501.php index bba03cde..e8a21a23 100644 --- a/reporting/rep501.php +++ b/reporting/rep501.php @@ -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); diff --git a/reporting/rep601.php b/reporting/rep601.php index 6f9c41b9..db85e668 100644 --- a/reporting/rep601.php +++ b/reporting/rep601.php @@ -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(); diff --git a/reporting/rep602.php b/reporting/rep602.php index 79b3387b..284bfda8 100644 --- a/reporting/rep602.php +++ b/reporting/rep602.php @@ -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)) { diff --git a/reporting/rep701.php b/reporting/rep701.php index c3dfb3b6..5c7c829e 100644 --- a/reporting/rep701.php +++ b/reporting/rep701.php @@ -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); diff --git a/reporting/rep702.php b/reporting/rep702.php index 6d6f3245..fdc1224a 100644 --- a/reporting/rep702.php +++ b/reporting/rep702.php @@ -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); diff --git a/reporting/rep704.php b/reporting/rep704.php index d3cf9047..45ed714a 100644 --- a/reporting/rep704.php +++ b/reporting/rep704.php @@ -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); diff --git a/reporting/rep705.php b/reporting/rep705.php index 88e1ec6b..7cf8f8fc 100644 --- a/reporting/rep705.php +++ b/reporting/rep705.php @@ -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(); diff --git a/reporting/rep706.php b/reporting/rep706.php index e670e2e8..ebb9cd83 100644 --- a/reporting/rep706.php +++ b/reporting/rep706.php @@ -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(); diff --git a/reporting/rep707.php b/reporting/rep707.php index d38d3c33..846bb9d4 100644 --- a/reporting/rep707.php +++ b/reporting/rep707.php @@ -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(); diff --git a/reporting/rep708.php b/reporting/rep708.php index ff82c89b..17854bca 100644 --- a/reporting/rep708.php +++ b/reporting/rep708.php @@ -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); diff --git a/reporting/rep709.php b/reporting/rep709.php index f5b9dd07..c424dad0 100644 --- a/reporting/rep709.php +++ b/reporting/rep709.php @@ -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')); diff --git a/reporting/rep710.php b/reporting/rep710.php index eb4ea411..b7852d61 100644 --- a/reporting/rep710.php +++ b/reporting/rep710.php @@ -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(); diff --git a/reporting/reports_main.php b/reporting/reports_main.php index 500c7b54..dd35488a 100644 --- a/reporting/reports_main.php +++ b/reporting/reports_main.php @@ -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'), -- 2.30.2