Debt tracker

General discussions about Automagic and automation in general

Moderator: Martin

Post Reply
Adib
Posts: 12
Joined: 08 Mar 2016 06:11

Debt tracker

Post by Adib » 02 May 2016 05:31

Looking for a way to keep my debts on track with my customers, especially family and friends. They purchase things through whatsapp and don't bank in right away. They wait until their debt reaches a handful amount before paying it off. The problem is they forget to note it down, and I forget to note down the new and paid debts.

So I had a rough idea to help both parties using whatsapp/telegram.

1. Jane owes $10.50
2. I/he opens whatsapp and sends "JANE OWES 10.50".
3. I copy the line
4. Automagic saves $10.50 in a certain flow.
5. Jane then pays me $6.00 later
6. One of us opens whatsapp and sends "JANE PAID 6".
7. I copy the line
8. Automagic deducts 6 from $10.50 in the same flow.
9. Jane wants to know how much her current debt is, so she sends me the following message, "JANE BALANCE"
10. I copy the line
8. Automagic sends the total balance to the clipboard for me to paste and message back to Jane.

Your help will be greatly appreciated, Martin!

Thanks

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Debt tracker

Post by Martin » 02 May 2016 19:33

Hi,

Sorry, I'm short on time to create the whole flow but I try to give some hints to the triggers/actions that could be used:
You could use trigger Notification on Statusbar Displayed to detect the Whatsapp notifications. Use action Script to extract the text/amount and to add/subtract values from a variable.
You could either store the values in a global variable with a map or you could also save the values to a text file which might be simpler to backup (script functions toJSON and fromJSON could be used to convert the map to text and back to a map).
Action Copy Text to Clipboard can be used to copy the values to the clipboard. You could also try to use action Perform Action on Notification on Statusbar to directly send a reply with Whatsapp.

Regards,
Martin

Adib
Posts: 12
Joined: 08 Mar 2016 06:11

Re: Debt tracker

Post by Adib » 03 May 2016 00:03

Thanks, I'm working on it. I don't think I need to detect the keywords through thr notification but it's worth going on an adventure discovering new things. I was stuck on that part, so I'm trying to focus on how to make the scripts to calculate.

Thanks

Adib
Posts: 12
Joined: 08 Mar 2016 06:11

Re: Debt tracker

Post by Adib » 03 May 2016 05:20

By the way, can I search on google Or wherever on how to learn the script language? I can't seem to figure out how to make the scripts for adding subtracting values.

Adib
Posts: 12
Joined: 08 Mar 2016 06:11

Re: Debt tracker

Post by Adib » 03 May 2016 06:50

This is what I've accomplished so far. Now I'm just trying to figure out how to save it on a backup file
Attachments
flow_Debt_Tracker_20160503_144545.xml
(11.79 KiB) Downloaded 1280 times

Adib
Posts: 12
Joined: 08 Mar 2016 06:11

Re: Debt tracker

Post by Adib » 03 May 2016 10:27

I figured out how to append a certain debt amount into a txt file, and also figured out that I could extract the text into file_text variable.

One thing I can't seem to figure out is creating a script to get the value for the simple math, {AMOUNT} - {file_text}

Adib
Posts: 12
Joined: 08 Mar 2016 06:11

Re: Debt tracker

Post by Adib » 03 May 2016 14:59

This is insane, Martin! I figured it out through trial and error! It took me several hours though but totally worth it! All I wanted to learn is simple maths, and I got it. Did it like so...

TOTAL=getValue("file_text", 0)- getValue("AMOUNT", 0);

From here, it's probably going to be a lot more easier.

Thanks for the great app, Martin!

kamkaran
Posts: 1
Joined: 14 Jun 2016 07:43

Re: Debt tracker

Post by kamkaran » 15 Jun 2016 06:53

I am totally agree with Martin's ideas.follow him
Graduated from Soran University with First Class Degree with Honours in Computer Science.

Post Reply