Nominal codes alongside nominal code name

When I post an invoice from the hub it gives me a dropdown of the nominal codes but doesn’t show the nominal code number. I prefer to use the number rather than the description how can I get it to show both?

Hi,
As far as I know it is not possible at the moment. I have changed your topping to a feature request. This way other user have the chance to add their vote.

2 Likes

Yes please! I used Sage 50 previously and knew what the nominal codes were for; I use the same structure on QuickFile. It would save a lot of searching.

I’m exactly the same, Sage girl for years! Its so strange not to have them numerical, we’re numbers people it doesn’t make sense. It really helps because from the code you know exactly if its in the right area of the chart of accounts. Can you vote for it please? Thanks

If you have a Power User Subscription then the following “custom script” may do the trick:

jQuery(function($) {
  if($("body.page-receipts-detail").length) { // this is the receipt hub tag page
    // remove the original autocomplete component
    $("#dropPurchaseCategory").combobox("destroy");
    // override autocomplete behaviour
    $.widget("ui.combobox", $.extend({}, $.ui.combobox.prototype, {
      _source: function(request, response) {
        var r = new RegExp($.ui.autocomplete.escapeRegex(request.term),"i");
        response(this.element.children("option").map(function() {
          var text = $(this).text();
          var val = this.value.padStart(4, "0"); // left-pad codes below 1000 with zeros
          if (this.value && (!request.term || r.test(text) || r.test(val))) {
            return {
              label: "(" + val + ") " + text, // prepend the nominal code to the category name
              value: text,
              option: this
            };
          }
        }));
      }
    }));
    // re-attach the monkey-patched auto-completer
    $("#dropPurchaseCategory").combobox();
  }
});

The idea of this snippet is that it should put the nominal code in parentheses at the front of each option in the dropdown, so instead of

Electricity
Equipment Hire
Freehold Property
...

it should show

(7200) Electricity
(7700) Equipment Hire
(0010) Freehold Property
...

and you can search by code as well as by name.

(@QFSupport this is basically a monkey-patch to the acComboInit function in js/common that defines the autocomplete behaviour; if you want to take my modified _source function and integrate it back into your main codebase then please do, I promise not to demand royalties :wink: )

4 Likes

if you want to take my modified _source function and integrate it back into your main codebase then please do, I promise not to demand royalties :wink:

Thanks @ian_roberts, we may just do that. It would be good to have some option to prefix the code on all the nominal dropdowns.

2 Likes

I initially tried the much simpler and more obvious fix of just changing the textContent of each <option> (which is where the normal autocomplete source looks for the values) but that interfered with a few other things in the code where the option content is expected to just be the name. That might be a simpler way to go for your developers who can ripple out the effects across the rest of the module much more easily before it has been webpack-ed.

1 Like

I am pleased to say that there is now an option in Account Settings >> Advanced Settings that when enabled will prefix the nominal code number to all nominal account select menus.

image

image

Hopefully this will make it a little easier to locate and select the right nominal accounts.

4 Likes

Thank you Ian and Glenn for this, making my life so much easier as I learn to use Quickfile!

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.