2 questions using DT4 for scanning receipts.

Hi, new to DT4 Pro, switched from Paperless. I’m using mainly for organizing receipts for tax purposes. I’ve set up my own custom metadata fields in the Data area under the Info pane of the Inspector window. When I import a receipt I fill in these Data fields so my receipt gets sorted to a Smartgroups I’ve set up inside my Databases. One of these Data fields is Date. Is it possible to set that default date when I import a receipt? It keeps coming up 2000-12-31 so I have to manually change it every time, would be great if I can set it to come up to the current year and month at least.

2nd question - Another Data field I have is Price which I enter a dollar figure into. In Paperless, you could select a bunch of items and it would automatically do a total of those items in dollars. How do you do this in DT4? My apologies if these are total Newb questions but cant seem to find the answers anywhere for this elsewhere.

With a smart rule, yes.

You don’t. There’s no sum function in DT. Nor other mathematical functions. I guess you could use AI for it – or just write a script like this one (JavaScript)

(() => {
  const app = Application("DEVONthink");
  const records = app.selectedRecords();
  let sum;
  let initialValue = 0;
  sum =  records.reduce((sum, r) => {
    const amount = app.getCustomMetaData({for: 'amount', from: r});
    return sum + amount;
  }, initialValue);
  // Do something useful with sum here
})()

This untested code assumes that the amount is stored in the custom metadata field with the same name.

In general, it’s better to ask different questions in different threads, BTW. Easier to search and find for posterity.

I use an AppleScript to assist with processing; filling in Data fields, … and setting default date

Ok thanks, definitely a different beast than Paperless, and I’ve got a lot to learn, not very knowledgeable when it comes to scripts, thanks for the example!

Thanks I’ll look into that!

Welcome @gkm
One of our forum users accomplished a migration from Paperless. Perhaps this will be useful to you as well.

Excellent, thanks for this!

You’re welcome.

I just learned about another way to do ‘Price’ totals of receipts and that is using Create Expense Report under the Tools Menu. Just select the receipts you want to total, select this tool, and this creates a report in your Database Inbox and that totals up your Price column. Perfect!

2 Likes

For better control, I export the data to a spreadsheet (Apple Numbers)
using an Applescript

1 Like

Hi

I thought this looked interesting so selected a bunch of scanned receipts (PDFs) and selected “Create Expense Report” and clicked it and nothing happened :frowning:

Q

It requires custom metadata with a Decimal: Currency on it.

1 Like

Interesting…

Just added a “Price” data field to 5 recent receipts which took no time at all and re-ran it and as you say it just pulls them out, lists and totals them.

That’s neat and even with a few odd errors or omissions it would give quite a handy overall monthly expenditure summary, I like it.

Q

2 Likes

I’m new to DT4 and quite surprised there isn’t a simpler way to total up items with this metadata added. I would imagine a LOT of people use this program to store receipts and records of some sort. Seems like you really need to understand scripting to fully use this program or maybe I’m missing something.

DT brands itself as a document management system. You can store whatever you want in it. There are lawyers, historians, medical professionals and probably people like me using it mostly for administrative tasks.
Getting a total of a bunch of documents is a no-brainer with the DT as explained above. If you want that, you must mark the relevant amounts for the documents somehow. There’s a metadata field available, aptly named amount. Turn it on, set up a smart rules to set that field, and you’re good to go.
So, that’s nice. And it’s also nice that you can do a lot of things in DT with smart rules, batch process and scripting. In case you have a special requirement that can’t be fulfilled with the built-in functions.

Oh, and although I store receipts and records in DT, I don’t sum them up there. That’s what my accounting program is for. So, different people, same goal, different solutions.

5 Likes

I see, fair enough. Maybe not the right program for me. :thinking:

It seems straightforward to me and I don’t understand scripting and don’t want to have to learn all about it.. All I had to do was add the price data to my data records and then click “Tools” and the “Create Expense Report” and that was it, there was all the information from the records and a total. Might not suit if something really complicated was needed but for adding up a series of totals from some records it’s very convenient.

1 Like

You said:

If you want that, you must mark the relevant amounts for the documents somehow. There’s a metadata field available, aptly named amount. Turn it on, set up a smart rules to set that field, and you’re good to go.

Can you point me to this “amount” metadata field please? I can’t find it or do you have to add it in yourself? I found one called “Price” but I may be looking in the wrong place, a regular occurrence!

I’m looking in [Settings] - [Data] - than the [Custom Metadata] list. I could add “amount” into there?

Thanks.

You are right. I have amount, but I probably defined that myself. OTOH, there’s a placeholder for smart rules named identically. I guess, price would work as well.

1 Like

Thank you for the clarification, great feature this.