New Purchase - default payment account/type

Please could there be a way of setting a default payment type for a supplier.

Many of my suppliers are paid using the same method everytime, eg BACs, cash etc. If I could set this as default when setting the supplier up, it would save having to change the two drop downs on every new purchase I create. I understand that these drop downs don’t affect the accounts in anyway, but always feel I have to complete them if they are there.

Thank you

The “paid from” one does, that’s selecting the bank account that the payment was sent from. The “method” is only for your own records, and the only place it is used for anything is in the “advanced search” when viewing all sales or purchase payments, to let you filter for all items that were paid by a certain method regardless of which account they were paid from. If you don’t use that particular search option then there’s no harm just leaving the “method” always set to the default of bank transfer.

If you aren’t attempting to manage your bank accounts within QF then they don’t really matter.

Having said that it isn’t something that I would normally recommend but what works best for you may not be what works for my business. I find importing my bank transactions on a weekly basis and tagging from there marginally less time consuming than going through them and updating invoices and purchases manually even in slack times when we only have two or three transactions in a week.

This is something you could do with custom scripts, but my test script isn’t working but then I know CSS isn’t working on this page so I’m wondering if the custom scripts aren’t running either? Something someone @QFSupport could confirm (as in actually properly confirm).

You can change the account level default using the following custom script:

$(".purchase-purchaseDetail-aspx #dropMethod").val("CASH");

There’s not really a convenient way to set a payment method at supplier level unfortunately.

@Lurch It should be working, although if you’re still having problems overriding the logo you may need to target the class (.imgHeaderLogo) rather than the ID.

Hi Glenn, that works brilliantly, thanks! One further one…is it possible to default the “Paid From” to “Cash Account (Till)” in a similar manner pls? I tried to bodge (sorry, technically amend!) your script there but couldn’t seem to get the correct syntax. Thanks!

No problem!

To set the paid from account you can use something like this:

$(".purchase-purchaseDetail-aspx #dropPurBank").val("1205-GBP");

When setting the value just update to the nominal code of the bank account and the currency, so in the above example it’s the bank account nominal code 1205 which is in GBP.

Hi Glenn, many thanks once again - although I can’t get this to work… my Custom Scripts now reads as follows:

$(".purchase-purchaseDetail-aspx #dropMethod").val(“CASH”);
$(".purchase-purchaseDetail-aspx #dropPurBank").val(“1230-GBP”);

But the Paid From for a new purchase still shows my Co-Operative bank account (1200) instead of 1230-Cash Account (Till)…any ideas pls?

Thanks!

Sarah

The script is probably running too soon, try

$(function() {
  $(".purchase-purchaseDetail-aspx #dropMethod").val("CASH");
  $(".purchase-purchaseDetail-aspx #dropPurBank").val("1230-GBP");
});

The $(function() { ... }); wrapper delays the script until the complete page has been loaded, without that the script is probably running before the elements it tries to control have been created.

Also make sure the script has real quotes " rather than “smart” or “curly” quotes “” as the latter are not valid JavaScript syntax.

Thanks Ian - hasn’t worked though.

The method correctly populates with Cash, but the Paid From is still defaulting to 1200 not 1230

Try this;

//default account for paying purchase
$(document).ready(function() {
    pay_total = $('#divTotalBalance').text();
    nominal = 1230;
    currency = 'GBP';
    method = 'CASH';
    $('#chkpaid').prop('checked', true);
    $("#txtpay_amount").val(pay_total);
    $('#dropPurBank').val(nominal + '-' + currency);
    $('#dropMethod').val(method);
});

I’m still working on the amount box, it should fill automatically with that script but doesn’t atm for some reason. Should now fill the value with the total balance due.

Ah, I was looking at the CSS as that wasn’t working (as per my other post) but I will look at the override script now too. I’ve delved a but deeper into the error console and I can see that is probably what it is. Seems the custom code was breaking on that error (no matching ID) so nothing else was loading from the custom script, which is why I couldn’t get this working either!

1 Like

Two questions - first I edited my post after I noticed the code I’d copied from yours had curly quotes around the 1230-GBP instead of straight ones, I don’t know if that is a transformation applied by the forum software or if it was the same in your actual code? If you want to include snippets of JavaScript code in a forum post then surround it with triple-backticks:

```js
// code goes here
```

to protect it from being interpreted by the forum.

And second is 1230 definitely the correct nominal code? If you right click the drop down and “inspect element” in your browser you should be able to see the full list of option values and pick the correct one.

Hi Lurch & Ian,

Lurch - thanks for your code - tried this and still no joy, it defaults to Cash but not the correct account.

Ian - 1230 is definitely the correct nominal code (it’s the default Petty Cash account I believe).
Ian - I double checked the quotes and they’re definitely the straight ones.

Thanks!

Sarah

Then I’m afraid I’m at a bit of a loss, I’ve tried exactly the same code in my own QuickFile account and it works correctly, setting both drop down boxes. At this point all I can suggest is to make sure you have your browser developer tools window open when you load the page and see if there are any other JavaScript errors on the console that might explain it? Is there anything else in your custom script or is it just this one tweak, and did you definitely “activate” the custom script snippet in the customisation settings?

There’s something else going on at your end then. Using that code I posted I get this;

Success I think - but no idea why! lol

Following on from it being something at my end, i tried 1203 instead of 1230 and it correctly defaulted to that account, tried 1206 and all good, 1211, still perfect, tried 1230 again and it all works fine! Absolutely no idea why it suddenly worked, but it does - ty both!

3 Likes

Did you logout and back in or clear the cache when refreshing the page at any point (Ctrl+F5)? May have not fully loaded the new custom scripts if not, so you would just be loading the old ones and not your new revisions?

I’ve updated the code above too so it should fill the amount box now.

I actually have no idea - I seem to remember I was logging out/ctrl+F5 etc previously, yet when it started working, I didn’t lol

Many thanks for all your help!

An update to this one…everything seems great…until…I change the supplier - then the PaidFrom account auto changes to my Co-Operative Account (1200) (which is set as my default current account, but I’m not sure if I can change this?) from Cash Account (Till) 1230 - no idea why…