Merchant Accounts - move most used to top

After few years of using Quckfile I have many Merchant Accounts. Many of them not used any more. It would be nice to have on top of the list the most used. Easier to tag.
Regards

Hi @awariat

Do you mean on the list of bank accounts, or from the list when selecting what account it was paid from?

I believe both lists are connected. And it would be perfect to have possibility to alter both lists. Or maybe hide not used from both places.

To reduce the number of bank accounts in the list after an account has been closed I reuse the account by renaming. OK when looking at older payments they show as the bank account presently used but on the actual bank account there is adequate description showing when one account closes and another opens.

I have put a bit in my “custom scripts” to hide an account I no longer use:

jQuery(function($) {
    // remove dead bank accounts
    $('body.page-bank-index .tblbank .dataRow')
        .filter((i, e) => {
            var nom = $('input.hdnbankNominalID', e).attr('value');
            return (nom == "1200");
        }).remove();
        
    $(document).on('focus', 'select#dropBank', function(e) {
        $('option[value=1200-GBP]', this).remove();
    });
});

The first bit removes the account with nominal code 1200 from the list of bank accounts on the top-level bank management page, the second bit removes the same account from drop-down select boxes. If you want to hide more than one account then you can add alternatives to the “return” in the first bit:

            return (nom == "1200") || (nom == "1253");

and add selectors to the second bit:

        $('option[value=1200-GBP], option[value=1253-GBP]', this).remove();

If you just want to move them to the end of the list rather than delete them entirely then you could change it to

        $('option[value=1200-GBP], option[value=1253-GBP]', this).appendTo(this);
5 Likes

Hi Ian
I tested your code and updated a bit

select#dropBank

should be

select#dropBankAccounts

Thank you very much
My full code for multiply accounts is:

jQuery(function($) {
    // remove dead bank accounts
    $('body.page-bank-index .tblbank .dataRow')
        .filter((i, e) => {
            var nom = $('input.hdnbankNominalID', e).attr('value');
            return (nom == "1257") || (nom == "1258") || (nom == "1259") || (nom == "1260");
        }).remove();
        
    $(document).on('focus', 'select#dropBankAccounts', function(e) {
        $('option[value=1257-GBP], option[value=1258-GBP], option[value=1259-GBP], option[value=1260-GBP]', this).remove();
    });
});
3 Likes

Thanks, it must have changed in a redesign some time. To be honest I hadn’t noticed it in the drop down boxes as I think those are mostly alphabetical and I renamed my dead account to “ZZZ …”