Topic: How to make comment field bigger?

Hi

Right now FA shows only 245 characters in report (sales quotes, invoices) comments.

How to make it bigger? I need to add more information to sales quote.
I looked the report templates - but it is not related with them.

2 (edited by tclim 03/26/2012 01:40:31 am)

Re: How to make comment field bigger?

Hi Spott,

  I manage to adjust the comments in report form by changing the files below:

reporting/includes/reports_classes.inc

Look for the line below:

case 'TEXTBOX':
                    $value = (isset($_POST[$name]) ? $_POST[$name] : "");
                    return "<textarea rows=4 cols=30 name='$name'>$value</textarea>";


Adjust the return rows and cols value as below (You can change the size according to your need):

                    return "<textarea rows=6 cols=40 name='$name'>$value</textarea>";

Hope it help. Thanks You.

Cheers,

tclim

Re: How to make comment field bigger?

No - it doesn't work.
I think it is related with database. I will look it later.

4 (edited by SimpleTechGuy 03/26/2012 04:32:27 pm)

Re: How to make comment field bigger?

Been working on this all morning and finally gave in and searched the forums just to find someone else is working on the same thing.  What a small world! 

Anyway, I've tried the reporting/includes/reports_classes.inc and it didn't work for me.

Also tried editing /sales/customer_invoice.php and /sales/view/view_invoice to no avail.

I think I may have found the issue after looking in the /sql/en_US-demo.sql file on lines 389-396.  It looks like FA is creating the memo_ field in the Comments table as tinytext which has a maximum length of 255 characters...  I don't know how to fix this yet, but it seems this is def. the problem. 

Maybe somebody who knows a little more about SQL can figure out how to change from Tinytext to something that allows more characters...

EDIT:

Changed memo_ from tinytext to text fixed the problem, but now the text just goes off the screen when you print the invoice.  Now the question is, how to make the bottom of the invoice move down when there is more text in the memo_ column...

Re: How to make comment field bigger?

Hi spott and Simple TechGuy,

  Sorry about that. I was thinking that you are changing the input textarea which is not. Maybe you should look for individual report to change it.

For exampe:
1) reporting/rep107.php (Print Invoices)
2) reporting/rep109.php (Print Sales Order)
3) reporting/rep110.php (Print Delivery Notes)
4) reporting/rep111.php (Print Sales Quotations)
5) and so on...

  Look for the memo fileds at the example code below:


                    $memo = get_comments_string(ST_CUSTDELIVERY, $i);
            if ($memo != "")
            {
                $rep->NewLine();
                $rep->TextColLines(1, 5, $memo, -2);
            }

    You need to understand the report line number. Otherwise, the alignment maybe out of page. 


    Adjusting the database tinytext to text is visible.

   For example:

       ALTER TABLE `0_comments` MODIFY COLUMN `memo_` TEXT DEFAULT NULL;
 
     Hope it help. Thanks.

Cheers,

tclim

Re: How to make comment field bigger?

Thanks for your help tclim, changing from tinytext to text and taking out some spacing in the memo fixed my problem...

Re: How to make comment field bigger?

I think it is better to add these modifications (also sales_orders comments field) to main FA. I think we are not only ones who needs more space sometimes.

8 (edited by p2409 04/09/2012 06:23:15 am)

Re: How to make comment field bigger?

I too added space to the comments field by altering the tables to make them 'mediumtext' instead of 'tinytext'. The tables I updated were:

0_comments
0_purch_orders
0_sales_orders
0_budget_trans
0_gl_trans
0_supp_invoice_items
0_trans_tax_details
0_voided

I also enlarged a few other comment type fields too:
description in 0_debtor_trans_details
description in 0_grn_items

Basically, you can do a search of company SQL that comes with the package and look for tinytext, comments, memo and description.

To enlarge the comments section of things like invoice entry, you might need more room on the screen too:
To do this, update eg. ./sales/includes/ui/sales_order_ui.inc
and change the line that refers to the comments which has

textarea_row(_("Comments:"), "Comments", $order->Comments, 31,5);

to:

textarea_row(_("Comments:"), "Comments", $order->Comments, 61, 20);

You might want to do this for other entry screens eg. for po_ui.inc etc. A global search on the text  '->Comments' should get you started on which files you could modify.

As tclim said, you can also modify your report files eg. Invoice rep107.php. You need to be pretty careful doing this that you don't muck up alignments etc.

Lastly, don't forget you can get more text on your reports if you change the report fonts. I use a font called 'tuffy' (http://www.fontspace.com/thatcher-ulrich/tuffy) which fits alot on the page (it's narrow) and is quite modern looking. It's a technical job to add this font or any other  to FA, but I have documented it in the FA wiki for those with enough technical know-how to use command line utilities and code PHP. You use an external utility ttf2pt1 which converts ttf files into font file the TCPDF framework can use. TCPDF is the framework FA uses for handling PDF files.

Pete