Topic: Show voided transactions in audit trail

Hi all,

how can I show voided transactions in audit trail? Instead of "CHANGED" and  "CLOSED" in the action section of the audit trail report, how can we have it read "VOIDED" for voided transactions?

Advance thanks.

Re: Show voided transactions in audit trail

And what does this line in config.php do?

    $show_voided_gl_trans = 1;

I changed to 0 and 1 but don't seem to see any difference anywhere.

Re: Show voided transactions in audit trail

I edited reporting/rep710.php

I added a.description to the $sql variable like so...

$sql = "SELECT a.*, 
        SUM(IF(ISNULL(g.amount), NULL, IF(g.amount > 0, g.amount, 0))) AS amount,
        u.user_id, a.description, 
        UNIX_TIMESTAMP(a.stamp) as unix_stamp ...

Changed the columns widths as follows

    //$cols = array(0, 60, 120, 180, 240, 340, 400, 460, 520);
    $cols = array(-10, 40, 80, 120, 170, 250, 280, 500, 560);

altered the "action" column as follows:

        if (!$myrow['description']){
        if ($myrow['gl_seq'] == null)
            $action = _('Updated');
        else
            $action = _('Created');     
        } else {
            $action = $myrow['description'];   
        }
        $rep->TextCol(6, 7, $action);

Also in admin/db/voiding_db.inc, I changed

    //add_audit_trail($type, $type_no, $date_, _("Voided.")."\n".$memo_);
    add_audit_trail($type, $type_no, $date_, _("Voided.")." ".$memo_);

This gave me my desired result - Voided transactions are now lablled "Voided" and any memo also displays.

Re: Show voided transactions in audit trail

$show_voided_gl_trans was used in FA 2.3.x in only one place in the gl/includes/db/gl_db_trans.inc file's function get_gl_transactions() in lines 121-122:

    if (isset($show_voided_gl_trans) && $show_voided_gl_trans == 0)
        $sql .= " AND ".TB_PREF."gl_trans.amount <> 0"; 

The equivalent function of the same name in the same file in FA 2.4.2 (has an extra person_id parameter that defaults to null) does not use the said variable which is not used anywhere in the entire FA 2.4.x codebase and is also not used in any of the extensions in the official repo.

None of the extensions in FA 2.3.x use the said variable too.

Either we incorporate the said variable, $show_voided_gl_trans in it's FA 2.4.x avatar ($SysPrefs->...) or ditch it in it's entirety now.

@joe: which way?

Re: Show voided transactions in audit trail

I will have a look at this.

Joe

Re: Show voided transactions in audit trail

This variable will be removed. It is not used any more. The Audit Trail shows the voided items as zero amounts.

Unfortunately Sourceforge Git is down at present (Works now). But this will be committed asap.
Committed.

/Joe

Re: Show voided transactions in audit trail

Helpful. Thanks.

Re: Show voided transactions in audit trail

i want to remove the transaction itself not only zero it out, because i do not want the voided transaction appear in customer report or any other report .