Topic: Add Items on the Fly. Behavior Changed in FA24

Hello, There is a change in behaviour while adding Items on the Fly while creating invoices in FA24.

When we press F4 the dialog opens. When a New Item is created and then selected to be added as a Line Item in Invoice, the Select Button doesn't appear at the bottom. This is unlike in FA23.

Please do the whole process to reproduce the behavior. Because when you will press F4, you will see the select button, then if you select any other item you will see the select button, but when you create new item and then select it the Select button will disappear.

Thanks

www.boxygen.pk

Re: Add Items on the Fly. Behavior Changed in FA24

@joe: fix?

Lines 532 to 547 in inventory/manage/items.php:

    div_start('controls');
    if (!isset($_POST['NewStockID']) || $new_item) 
    {
        submit_center('addupdate', _("Insert New Item"), true, '', 'default');
    } 
    else 
    {
        if (@$_REQUEST['popup']) hidden('popup', 1);
        submit_center_first('addupdate', _("Update Item"), '', 
            $page_nested ? true : 'default');
        submit_return('select', get_post('stock_id'), 
            _("Select this items and return to document entry."));
        submit('clone', _("Clone This Item"), true, '', true);
        submit('delete', _("Delete This Item"), true, '', true);
        submit_center_last('cancel', _("Cancel"), _("Cancel Edition"), 'cancel');
    }

We need to let the resultant page after insertion know that it came from a popup. Hence move the line:

        if (@$_REQUEST['popup']) hidden('popup', 1);

to be the second line in the snippet above.

Post's attachments

NewItem_Missing_Select.zip 80.6 kb, file has never been downloaded. 

You don't have the permssions to download the attachments of this post.

Re: Add Items on the Fly. Behavior Changed in FA24

My fix works.

@joe: can commit it. Diff attached.

Post's attachments

ItemsPopup_fix.diff 570 b, 4 downloads since 2017-10-26 

You don't have the permssions to download the attachments of this post.

Re: Add Items on the Fly. Behavior Changed in FA24

Ok, willdo later. Fixed.

Joe

Re: Add Items on the Fly. Behavior Changed in FA24

This problem does not arise in FA 2.3.x.

The equivalent in FA 2.3 is placed just before the end_form(); statement like:

hidden('popup', @$_REQUEST['popup']);

In FA 2.4 we have Fixed Assets too as Items and the possibility of @... returning a NULL / false instead of a 0 in current strict syntax of later PHP versions prompted the solution for this commit.

Re: Add Items on the Fly. Behavior Changed in FA24

Both suppliers.php and customers.php also need to be fixed too.

Phuong

Re: Add Items on the Fly. Behavior Changed in FA24

And while digging to this problem I detect the other that after delete of a supplier there is no notification shown.

Phuong

Re: Add Items on the Fly. Behavior Changed in FA24

The sales/manage/customer_branches.php already has     hidden('popup', @$_REQUEST['popup']); in it's line 226 and hence F3 - Select Branch works as expected in Direct Invoice like forms.

Line 303 of sales/manage/customers.php:

    div_start('controls');

should now be:

    div_start('controls');
    if (@$_REQUEST['popup']) hidden('popup', 1);

Similarly for purchasing/manage/suppliers.php at line 169 as well.

The Supplier deletion notification is obtained by making line 281 in purchasing/manage/suppliers.php:

        $Ajax->activate('_page_body');

to be

        $Ajax->activate('_page_body');
        display_notification("#" . $_POST['supplier_id'] . " " . _("Supplier has been deleted."));

@joe: Tested. Can commit.

Post's attachments

changedfiles.zip 23.5 kb, 1 downloads since 2017-10-29 

You don't have the permssions to download the attachments of this post.

Re: Add Items on the Fly. Behavior Changed in FA24

This has been committed to Repo (the Tax Type inactive under investigation).

/Joe