1 (edited by dedode 10/19/2013 07:51:52 pm)

Topic: The entered transaction does not exist or cannot be voided

Hi

When I try to void a transaction I've shown this message:

The entered transaction does not exist or cannot be voided

I have two accounts:
1- 1065 Petty Cash
2- 1060 Checking Account

I am sure that their bank balance is positive not negative.

So what's wrong?

I've seen this info after I set $go_debug in config.php file to 2, while 1 didn't show any extra info!

The entered transaction does not exist or cannot be voided.
/includes/ui/ui_msgs.inc:14:     trigger_error('The entered transaction does not exist or cannot be voided.','256')
/admin/void_transaction.php:297:     display_error('The entered transaction does not exist or cannot be voided.')
/admin/void_transaction.php:322:     handle_void_transaction()


regards

2 (edited by apmuthu 10/20/2013 03:09:56 am)

Re: The entered transaction does not exist or cannot be voided

In the file admin/void_transaction.php, lines 271-302 are:

function handle_void_transaction()
{
    if (check_valid_entries()==true) 
    {
        $void_entry = get_voided_entry($_POST['filterType'], $_POST['trans_no']);
        if ($void_entry != null) 
        {
            display_error(_("The selected transaction has already been voided."), true);
            unset($_POST['trans_no']);
            unset($_POST['memo_']);
            unset($_POST['date_']);
            set_focus('trans_no');
            return;
        }

        $ret = void_transaction($_POST['filterType'], $_POST['trans_no'],
            $_POST['date_'], $_POST['memo_']);

        if ($ret) 
        {
            display_notification_centered(_("Selected transaction has been voided."));
            unset($_POST['trans_no']);
            unset($_POST['memo_']);
            unset($_POST['date_']);
        }
        else {
            display_error(_("The entered transaction does not exist or cannot be voided."));
            set_focus('trans_no');

        }
    }
}

Shouldn't the second if condition have it's logic inverted?
The line above:

        if ($void_entry != null) 

will probably need to become

        if ($void_entry == null) 

This should actually mean that unless there are entries to be voided, do not attempt to void any (since none exist).

However, in @dedode's case, he must find out why a "missing" transaction was sought to be voided in the first place! Possibly attempting to void an already voided transaction - using the back button in the browser and re-submitting it or some browser cache issue.......

Re: The entered transaction does not exist or cannot be voided

Thanks Janusz for the clarification:

Maybe the temporary variable name $void_entry is misleading, but the
codelogic is right. The voiding action is abandoned if the selected
transaction has been voided before.

Janusz

Re: The entered transaction does not exist or cannot be voided

Regarding the thread subject, I guess voiding the bank transaction would result in negative balance on Petty Cash account in some  point of account history, so voiding is forbidden.
Janusz

Re: The entered transaction does not exist or cannot be voided

Thanks apmuthu and Janusz for your suggestions.

I was trying to void the transaction through (Delivery Note)'s type and the message was appeared as:

The entered transaction does not exist or cannot be voided

But, after I play around I try to void it through (Sales Invoice)'s type and it's DONE!
both transactions had been deleted.

The problem was from me and the message:

The entered transaction does not exist or cannot be voided

which didn't lead me to the real mistake.

regards

Adel

6 (edited by dedode 10/21/2013 12:13:40 pm)

Re: The entered transaction does not exist or cannot be voided

itronics wrote:

Regarding the thread subject, I guess voiding the bank transaction would result in negative balance on Petty Cash account in some  point of account history, so voiding is forbidden.
Janusz

I think your guessing is not correct, because my Petty Cash account was in negative balance, and lately I correct the balance to positive then I delete the transaction (which was in the negative history) with no errors.

Adel

Re: The entered transaction does not exist or cannot be voided

Cash account should never have negative balance, so if it has, you will have this kind of errors.
Janusz

Re: The entered transaction does not exist or cannot be voided

Cash Account should always be in debt to every account who provided it the cash in the first place. Hence in FA, is debit balance shown as positive?