Moved payment terms in documents for better view. Increased space for legal text.
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Tue, 17 Nov 2009 21:09:54 +0000 (21:09 +0000)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Tue, 17 Nov 2009 21:09:54 +0000 (21:09 +0000)
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
gl/includes/db/gl_db_trans.inc
gl/inquiry/journal_inquiry.php
reporting/includes/header2.inc
reporting/includes/pdf_report.inc

index 0e1e0e1548da94f77b7100d3d1888b8cd6fc350c..0f0b192a1eb903c081b36e1668e1df338492fc80 100644 (file)
@@ -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
index b529bd09a60771ee31569133b149332ac101be07..af06cedf7a4122aaad4554584c79bfb65f635c74 100644 (file)
@@ -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");
 }
index ecde86f46844382829f3e185a0778ff67944868b..f2aee15b2253c3d59cdb31b598511d9d2a9e2ad8 100644 (file)
@@ -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);
index b77b0610609ae1ae6351296052885c8fab4f48f8..f98c3ffacd14235f3bb92727a76bb85554c826e1 100644 (file)
@@ -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;
                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;
                        $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);
                $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
                {
                                        $name . "&amount=" . $amt . "&currency_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;
index 67d23e84cbdca7ce6792646925b5ff888f1ceb96..944b4c28509d38ba5078e93ddbbd7a26e6d57d13 100644 (file)
@@ -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 != '');
                }