Download pdf data

Hi,

I have developed an application to download Sales and Purchase data using the QuickFile API, and this is working fine.

Next I would like to download the pdf data e.g. for each Purchase, because that contains additional data, not returned from the API.

For example, we have a category in the pdf, that is not in the api data. An example of this is “Sector 1 Management Staff & Costs”.

My goal is to automatically extract the pdf category text and split it into e.g. “Sector 1” and “Management Staff & Costs” in my code, so that it can be held in my database against the Purchase.

Ultimately that will allow a lot of flexibility in auditing, to make sure that the service charges to our apartment complex residents is correct.

It will also allow us to create ad hoc reports that easily show our RTM Company board (I am a director on the board) were we are spending service charge money e.g. maintenance (we are an apartment complex, and employ staff to manage the site).

At the moment our manager uses spreadsheets to collate the data, and I want to reconcile those spreadsheets against the actual QuickFile data. I also want to see the detail because currently we only see summarised totals.

I would like to see us to stop using spreadsheets where we can, or at least generate the spreadsheets directly from QuickFile data, instead of entering it manually into spreadsheets.

So my question is; which is the best way for me to download all the pdf’s. Should I download them in bulk, if so how? Or should I use the API and get them individually?

My preference would be to get them through the API, so I can automate the process, and only download and process new ones as required.

Thanks,

Tony

When you say “category” do you mean the actual purchase category column or just some standard text you’ve been including in the line descriptions? The category column in the PDF is just the human readable name of the nominal code - you have the nominal code from the API, you can cross reference that with your chart of accounts to get the category name.

Thanks for the prompt reply Ian.

Hopefully it wasn’t a silly question, but I am very new to QuickFile, so although I have the API working, maybe I haven’t looked around properly.

The Category and description I am interested in, are on the pdf e.g. for this purchase, they show as
“Sector 2 Cleaning Equipment & Stock supply of gloves for cleaning and black bags”

I just found the chart of accounts, and can see the category (thanks). I assume the description is just manually entered? Because on many of the purchases, it is the description I am interested in. The reason being that e.g. when work is carried out in our apartment complex I would like to identify where the money was spent. It could be a single apartment maintenance work, swimming pool maintenance, footpaths maintenance, tree maintenance etc. etc.

So I am hoping to be able to summarise based on information in the description, although we are going to have to get our maintenance contractor, who does most of the smaller jobs, to summarise the work done in a standard format because at the moment the work is summarised as e.g.
“Sector 2 Building Repairs & Renewals radio basement testing, power isolation, water meter readings, squirrel trap removal and rebait, power check for headlands bulkheads,decorating quotes for 654 and 503 h, roof check, bulkhead painting to main block.”

Part of the reason for attempting to do this is to audit the work done by the contractor, because at the moment our manager only summarises by category. So we want to check the invoices correspond to actual work carried out, and compare to estimates.

Which API method(s) are you calling? If you’re just looking at the list of results from Purchase_Search then you’re right that you only get minimal information about each purchase listed there, but if you take the PurchaseID from each result there and pass that to Purchase_Get then you’ll see the full details.

Each purchase can have multiple lines, and the category and description are at the per-line level (under ItemLines → Item). The NominalCode is the number that you’d cross reference to the chart of accounts, the ItemDescription corresponds to the free text bit in the description column of the PDF.

1 Like

Thanks Ian,

I am really glad I asked the question now, because I think you have given me the solution, and saved me the effort of parsing pdf files to get the information.

At the moment I have got the Purchase_Search working, plus a few others. But I haven’t looked at the Purchase_Get yet, so if that gives me the full description, instead of the abbreviated description returned by the Purchase_Search, then that is exactly what I need and very easy to Automate in my application.

If I get that working I plan on incorporating AI into the application, to try and make sense of the descriptions. I’m hoping that if I can get all of this together, it could help us make better decisions in managing our apartment complexes and grounds.

Thanks for your help Ian!

Tony

Glad to be helpful! The key thing to realise about the API methods is that they always refer to things (purchases, invoices, payments, clients, suppliers, …) by the internal database ID rather than the human-facing reference number. The Purchase_Search gives you the human-facing ReceiptNumber (the QFnnnnn reference) but also the internal PurchaseID, and it’s the latter that you need for Purchase_Get.

If you want to compare what you see in the PDF with what you get from the API, look up a purchase in the web UI and then the internal ID is the pID query string parameter off the URL:

https://yourcompany.quickfile.co.uk/purchases/view?pID=12345678

Pass that pID to Purchase_Get to retrieve the API view of the same purchase.

2 Likes