Topic: Changing dimension reset allocation

Hi

I changed the dimension of some invoices, for some reason it reset all the customer payement allocations.
I can deal with that (except I have 35 allocations to do again manually), even though I just want to set a dimension on the GL.

However , what seems more weird is that the debtor_trans have the opposite amount allocated, meaning when I allocate a payment to an invoice, I still have to allocate the same amount to fillfull it. Is it a bug or an expected behavior ?

Hopefully , I backed up my database before doing that so I'll just restore it (except the gl_trans table which what I want) ;-)

/Elax

Re: Changing dimension reset allocation

I see that you have used the Journal Inquiry for editing the sales invoice. The Journal Inquiry shouldn't have allowed you to edit allocated invoices. This is a bug.
In Customer Transactions you are not allowed to edit allocated invoices.
This bug is fixed in HG repository and come in the next minor release.

You can also replace this function on line 106 in /gl/inquiry/journal_inquiry.php.

function edit_link($row)
{
    global $editors;

    $ok = true;
    if ($row['type'] == ST_SALESINVOICE)
    {
        $myrow = get_customer_trans($row["type_no"], $row["type"]);
        if ($myrow['alloc'] != 0 || get_voided_entry(ST_SALESINVOICE, $row["type_no"]) !== false)
            $ok = false;
    }        
    return isset($editors[$row["type"]]) && !is_closed_trans($row["type"], $row["type_no"]) && $ok ? 
        pager_link(_("Edit"), 
            sprintf($editors[$row["type"]], $row["type_no"], $row["type"]),
            ICON_EDIT) : '';
}

/Joe

Re: Changing dimension reset allocation

Hi Joe
I don't think editing it is a bug as it's a feature I asked for a couple of month ago (the feature was to be able to change the dimension on an invoice or everything else). This why you authorized the editing of it in the journal inquiry. However I agree that the normal editing shouldn't be allowed therefore changing the dimension should use this way. So I understand if you are removing this possibility as it's bugger.

Anyway that would be nice to have a way to edit/modify dimensions on GL transaction or Journal (as that doesn't really change anything to the GL)

/Elax

Re: Changing dimension reset allocation

When we fixed it a couple of months ago, it was only fixed in the customer transactions. I forgot to fix it correctly in Journal Inquiry.
It should only be allowed to edit the sales invoices when there are no allocations. The complexity is too huge for fixing this.

/Joe

Re: Changing dimension reset allocation

Ok

/Elax