Topic: How to remove discount column

I want to remove discount column in all the sales forms and report.

How do i go about it?

Regards,

FRED

2 (edited by apmuthu 01/27/2015 02:06:03 pm)

Re: How to remove discount column

Name the url you see for the forms and the repXXX number you see for the reports - take detailed snapshots and mark the areas you do not want to see, fix a price and put it into the Job/Offers forum topic and wait for someone interested in taking it up.

If however, you wish to attempt it on your own, then here is the info to start you off. The Invoice script is reporting/rep107.php and it's line 128 can be commented out like:

//                    $rep->TextCol(5, 6,    $DisplayDiscount, -2);

or just blanked out like:

                    $rep->TextCol(5, 6,    "", -2);

and the heading for the column is in reporting/includes/doctext.inc in line 30:

        _("Unit"), _("Price"), _("Discount %"), _("Total"));

where the Discount % label may be a blank string or removed out depending on whether you commented out the earlier one or just made it display a blank string as well.

Re: How to remove discount column

While apmuthu's solution works fine, it leaves a large gap between the Price and the Total.

I made the following changes to remove the Discount column:

Edit the file reporting/includes/doctext.inc from (line 28):

    // default item column headers
    $this->headers = array(_("Item Code"), _("Item Description"), _("Quantity"),
        _("Unit"), _("Price"), _("Discount %"), _("Total"));

to:

    // default item column headers
    $this->headers = array(_("Item Code"), _("Item Description"), "", _("Quantity"),
         _("Unit"), _("Price"), _("Total"));

Then in reporting/rep107.php change the following from (line 58):

    $cols = array(4, 60, 225, 300, 325, 385, 450, 515);

    // $headers in doctext.inc
    $aligns = array('left',    'left',    'right', 'left', 'right', 'right', 'right');

to:

    $cols = array(4, 60, 225, 300, 365, 385, 450, 515);

    // $headers in doctext.inc
    $aligns = array('left',    'left',    'right', 'right', 'right', 'right', 'right');

and from (line 119):

                $oldrow = $rep->row;
                $rep->TextColLines(1, 2, $myrow2['StockDescription'], -2);
                $newrow = $rep->row;
                $rep->row = $oldrow;
                if ($Net != 0.0 || !is_service($myrow2['mb_flag']) || !isset($no_zero_lines_amount) || $no_zero_lines_amount == 0)
                {
                    $rep->TextCol(2, 3,    $DisplayQty, -2);
                    $rep->TextCol(3, 4,    $myrow2['units'], -2);
                    $rep->TextCol(4, 5,    $DisplayPrice, -2);
                    $rep->TextCol(5, 6,    $DisplayDiscount, -2);
                    $rep->TextCol(6, 7,    $DisplayNet, -2);
                }    
                $rep->row = $newrow;

to:

                    $oldrow = $rep->row;
                    $rep->TextColLines(1, 3, $myrow2['StockDescription'], -2);
                    $newrow = $rep->row;
                    $rep->row = $oldrow;
                    if ($Net != 0.0 || !is_service($myrow2['mb_flag']) || !isset($no_zero_lines_amount) || $no_zero_lines_amount == 0)
                    {
                        $rep->TextCol(3, 4,    $DisplayQty, -2);
                        $rep->TextCol(4, 5,    $myrow2['units'], -2);
                        $rep->TextCol(5, 6,    $DisplayPrice, -2);
                        //$rep->TextCol(5, 6,    $DisplayDiscount, -2);
                        $rep->TextCol(6, 7,    $DisplayNet, -2);
                    }    
                    $rep->row = $newrow;

With these modifications you will get more space for the item description as well.

Hope this helps.
Carmelo

Re: How to remove discount column

Thanks All

However I have applied the above help on files reporting/rep111.php Sales Quotations

and reporting/includes/doctext.inc

carmelr's method works perfectly ok.

FRED

Re: How to remove discount column

A flag variable that enables / disables discount display would be a nice way to go.