From 074f5b55ae369597c70953bc7f9324cc491a6a7e Mon Sep 17 00:00:00 2001 From: Joe Hunt Date: Tue, 17 Nov 2009 21:09:54 +0000 Subject: [PATCH] Moved payment terms in documents for better view. Increased space for legal text. Changed sorting in get_gl_transactions to sort by tran_date, counter Changed period in Journal Entries to one month instead of one year. --- CHANGELOG.txt | 10 +++++++ gl/includes/db/gl_db_trans.inc | 2 +- gl/inquiry/journal_inquiry.php | 2 +- reporting/includes/header2.inc | 50 ++++++++++++++++--------------- reporting/includes/pdf_report.inc | 2 +- 5 files changed, 39 insertions(+), 27 deletions(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 0e1e0e15..0f0b192a 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -19,6 +19,16 @@ Legend: ! -> Note $ -> Affected files +17-Nov-2009 Joe Hunt/Tom Hallman +! Moved payment terms in documents for better view. Increased + space for legal text. +$ /reporting/includes/header2.inc + /reporting/includes/pdf_report.inc +! Changed sorting in get_gl_transactions to sort by tran_date, counter + Changed period in Journal Entries to one month instead of one year. +$ /gl/includes/db/gl_db_trans.inc + /gl/inquiry/journal_inquiry.php + 15-Nov-2009 Janusz Dobrowolski + Added integration of custom and extended reports into reporting module; optimizations. $ /reporting/prn_redirect.php diff --git a/gl/includes/db/gl_db_trans.inc b/gl/includes/db/gl_db_trans.inc index b529bd09..af06cedf 100644 --- a/gl/includes/db/gl_db_trans.inc +++ b/gl/includes/db/gl_db_trans.inc @@ -130,7 +130,7 @@ function get_gl_transactions($from_date, $to_date, $trans_no=0, if ($amount_max != null) $sql .= " AND ABS(".TB_PREF."gl_trans.amount) <= ABS(".db_escape($amount_max).")"; - $sql .= " ORDER BY tran_date"; + $sql .= " ORDER BY tran_date, counter"; return db_query($sql, "The transactions for could not be retrieved"); } diff --git a/gl/inquiry/journal_inquiry.php b/gl/inquiry/journal_inquiry.php index ecde86f4..f2aee15b 100644 --- a/gl/inquiry/journal_inquiry.php +++ b/gl/inquiry/journal_inquiry.php @@ -45,7 +45,7 @@ start_row(); ref_cells(_("Reference:"), 'Ref', '',null, _('Enter reference fragment or leave empty')); journal_types_list_cells(_("Type:"), "filterType"); -date_cells(_("From:"), 'FromDate', '', null, 0, 0, -1); +date_cells(_("From:"), 'FromDate', '', null, 0, -1, 0); date_cells(_("To:"), 'ToDate'); check_cells( _("Show closed:"), 'AlsoClosed', null); diff --git a/reporting/includes/header2.inc b/reporting/includes/header2.inc index b77b0610..f98c3ffa 100644 --- a/reporting/includes/header2.inc +++ b/reporting/includes/header2.inc @@ -16,7 +16,7 @@ $this->row = $this->pageHeight - $this->topMargin; $upper = $this->row - 2 * $this->lineHeight; - $lower = $this->bottomMargin + 6 * $this->lineHeight; + $lower = $this->bottomMargin + 8 * $this->lineHeight; $iline1 = $upper - 7.5 * $this->lineHeight; $iline2 = $iline1 - 8 * $this->lineHeight; $iline3 = $iline2 - 1.5 * $this->lineHeight; @@ -25,7 +25,7 @@ $iline6 = $iline5 - 1.5 * $this->lineHeight; $iline7 = $lower; $right = $this->pageWidth - $this->rightMargin; - $width = ($right - $this->leftMargin) / 6; + $width = ($right - $this->leftMargin) / 5; $icol = $this->pageWidth / 2; $ccol = $this->cols[0] + 4; $c2col = $ccol + 60; @@ -208,8 +208,6 @@ else $this->TextWrap($col, $this->row, $width, $doc_Our_Order_No, 'C'); $col += $width; - $this->TextWrap($col, $this->row, $width, $doc_Payment_Terms, 'C'); - $col += $width; $this->TextWrap($col, $this->row, $width, $doc_Due_Date, 'C'); $this->row = $iline3 - $this->lineHeight - 1; $col = $this->leftMargin; @@ -253,25 +251,30 @@ $this->TextWrap($col, $this->row, $width, $myrow["location_name"], 'C'); elseif (isset($myrow['order_'])) $this->TextWrap($col, $this->row, $width, $myrow['order_'], 'C'); - $col += $width; - if ($doctype == 26) - $this->TextWrap($col, $this->row, $width, sql2date($myrow["required_by"]), 'C'); - elseif (!isset($packing_slip) || $packing_slip == 0) - { - $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->TextWrap($col, $this->row, $width, $row["terms"], 'C'); - } $col += $width; if ($doctype == 9 || $doctype == 7) $this->TextWrap($col, $this->row, $width, sql2date($myrow['delivery_date']), 'C'); elseif ($doctype == 26) $this->TextWrap($col, $this->row, $width, $myrow["units_issued"], 'C'); - else if ($doctype != 8 && $doctype != 11 && isset($myrow['due_date'])) + elseif ($doctype != 8 && $doctype != 11 && isset($myrow['due_date'])) $this->TextWrap($col, $this->row, $width, sql2date($myrow['due_date']), 'C'); - + if (!isset($packing_slip) || $packing_slip == 0) + { + $this->row -= (2 * $this->lineHeight); + if ($doctype == 26) + $str = sql2date($myrow["required_by"]); + else + { + $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); + $str = $row["terms"]; + } + $this->Font('italic'); + $this->TextWrap($ccol, $this->row, $right-$ccol, $doc_Payment_Terms . ": " . $str); + $this->Font(); + } $this->row = $iline5 - $this->lineHeight - 1; $this->Font('bold'); $count = count($this->headers); @@ -283,13 +286,13 @@ $this->row = $iline7 - $this->lineHeight - 6; if ($doctype != 26) $this->TextWrap($ccol, $this->row, $right - $ccol, $doc_Please_Quote . " - " . $myrow['curr_code'], 'C'); - $this->NewLine(); + $this->row -= $this->lineHeight; if (isset($bankaccount['bank_name'])) { $txt = $doc_Bank . ": ".$bankaccount['bank_name']. ", " . $doc_Bank_Account . ": " . $bankaccount['bank_account_number']; $this->TextWrap($ccol, $this->row, $right - $ccol, $txt, 'C'); - $this->NewLine(); + $this->row -= $this->lineHeight; } if ($doctype == 10 && $branch['disable_branch'] > 0) // payment links { @@ -302,24 +305,23 @@ $name . "&amount=" . $amt . "¤cy_code=" . $myrow['curr_code']; $this->fontSize -= 2; $this->TextWrap($ccol, $this->row, $right - $ccol, $txt, 'C'); - $this->NewLine(); + $this->row -= $this->lineHeight; $this->SetTextColor(0, 0, 255); $this->TextWrap($ccol, $this->row, $right - $ccol, $url, 'C'); $this->SetTextColor(0, 0, 0); $this->addLink($url, $ccol, $this->row, $this->pageWidth - $this->rightMargin, $this->row + $this->lineHeight); $this->fontSize += 2; - $this->NewLine(); + $this->row -= $this->lineHeight; } } if ($this->params['comments'] != '') { $this->TextWrap($ccol, $this->row, $right - $ccol, $this->params['comments'], 'C'); - $this->NewLine(); + $this->row -= $this->lineHeight; } if (($doctype == 10 || $doctype == 12) && $this->company['legal_text'] != "") { - $this->TextWrap($ccol, $this->row, $right - $ccol, $this->company['legal_text'], 'C'); -// $this->NewLine(); + $this->TextWrapLines($ccol, $right - $ccol, $this->company['legal_text'], 'C'); } $this->Font(); $temp = $iline6 - $this->lineHeight - 2; diff --git a/reporting/includes/pdf_report.inc b/reporting/includes/pdf_report.inc index 67d23e84..944b4c28 100644 --- a/reporting/includes/pdf_report.inc +++ b/reporting/includes/pdf_report.inc @@ -359,7 +359,7 @@ class FrontReport extends Cpdf do { $l = $this->TextWrap($c, $this->row , $width, $l, $align); - $this->NewLine(); + $this->row -= $this->lineHeight; } while ($l != ''); } -- 2.30.2