Autonumbering of recurring invoices and invoices following their own numbering pattern

I’ve got daily till sessions being added to QuickFile as invoices and numbered as Z1,Z2,Z3…Z998,Z999 etc via the API. The numbers for the till session are unique and generated by the till application but don’t have to be formatted with the letter “Z”. They can be formatted however I like. I want to use them to ensure the till session are unique and only added once.

I’ve got recurring invoices going out to my clients automagically. Those invoices get auto-numbered as Z1234 and inevitably blocks the next day’s till session.

Is there a way to format the till session numbers so that Quickfile won’t take them into account when autonumbering the recurring invoices? I want to keep the numeric digits for the daily till session to prevent duplication but I don’t want them to be considered when auto-numbering other invoices? Even converting the till session number to A-Z characters doesn’t help as Quickfile still increments them.

Any suggested alternate approaches?

Hi @Nurg

Ideally, all invoices should follow the same sequence, especially if you’re VAT registered (see here - ‘Unique invoice number that follows on from the last invoice’).

This is the behaviour that QuickFile follows to comply with this requirement, by picking up the last invoice number and adding 1. Therefore, 1234 becomes 1235; A111 becomes A112; ABCD becomes ABCE and so on.

What is the purpose of the unique numbering format? Separating these invoices with a project tag or just assigning them to a unique client (‘Till Sales’ for example) could help single these out, if that helps? If not, if you could tell us a bit more about your situation, we may be able to advise on another way of handling this for you.

I think in that case maybe I’m using the invoice number field incorrectly. I’m using the till session number in this field to maintain uniqueness - as an extra layer to prevent them from being added twice. Perhaps I need to use another field or capture the invoice number assigned by Quickfile to prevent duplication.

Is this a script you’ve written yourself? If so, what coding language are you using?
Are you assigning the invoices to a client set up for the till transactions, and recording the sales on a daily basis?

Perhaps the ‘Purchase Reference’ field could be used for the session number. I’ve just checked the API documentation and you can do a search based on this field.

Is this a script you’ve written yourself? If so, what coding language are you using?

I run my own extensive application for POS, stock control and a wide range of business activities. Back end language is PHP.

Are you assigning the invoices to a client set up for the till transactions, and recording the sales on a daily basis?

Yes.

Perhaps the ‘Purchase Reference’ field could be used for the session number.

Is the purchase reference field unique? If so, that would do the trick.

Not necessarily, but if you were to do an Invoice_Search before hand, you could check if this has been used.

For example:

    "Body": {
      "SearchParameters": {
        "ReturnCount": "10",
        "Offset": "0",
        "OrderResultsBy": "InvoiceNumber",
        "OrderDirection": "ASC",
        "InvoiceType": "INVOICE",
        "ClientDetails": {
          "ClientID": "2293817"
        },
        "PurchaseReference": "123456"
      }
    }

In my case, returns:

"Body": {
      "RecordsetCount": 1,
      "ReturnCount": 1,
      "Record": [
        {
          "IssueDate": "2017-08-04T00:00:00",
          "InvoiceID": 8113407,
          "ClientID": 2293817,
          "ClientCompanyName": "Cash Register Sales",
          "ClientContactName": "",
          "InvoiceNumber": "000092",
          "Description": "Sales for 3rd August 2017",
          "Currency": "GBP",
          "Amount": 150.0,
          "Status": "PAIDFULL",
          "ViewHref": "URL REMOVED"
        }
      ]
    }

You could then check if RecordsetCount is 0, and if so, create the new invoice.

Gotcha, that sounds like the right approach. I just hadn’t understood what the invoice number field was for. I did wonder why it was buried in the Scheduling node!

Thanks.

1 Like

This topic was automatically closed after 7 days. New replies are no longer allowed.