-
-
Notifications
You must be signed in to change notification settings - Fork 23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
QUESTION: how to break up a transaction/payment? #107
Comments
Hi @ketzacoatl This sounds like something that you would structure with hledger subaccounts, using the normal hledger rules files. And I think tags could also be useful here. |
Thanks for the super fast reply @apauley! If I may ask, could you clarify what that would look like with a small example? |
Sure, I was just looking through my own rules files. This contrived example can be put in a rules file. It has both a subaccount and a tag for
|
One thing I'm not understanding is what the csv entries would look like. Using my example above, ATM I have only one transaction for the top-level interaction with the hardware store, but I'm not sure how to tell hledger-flow about the breakdown for that one transaction into the several smaller ones that make it up. |
You can specify multiple accounts and amounts when you want to do a breakdown of one transaction:
|
That's in the rules file? Ok, that seems a little odd though, no? Eg for each trx that gets a breakdown like this, I'd need to add a unique ID or something, and then add an entry in the rules file.. or am I missing something? |
Yes, this is in the rules file. There are lots of cool options: I don't understand what you mean by "unique ID", are you talking about the regex/matcher? In my rules files I mostly have matchers that match multiple transactions, e.g. one matcher for groceries. And in a few specific cases I match just one unique transaction when I want to do something different with it. I do this kind of multi-account breakdown on my salary, to specify which is spent on taxes and which is allocated to the retirement benefit etc. |
Yes
Nice, can you share a redacted/example csv entry and rule pair that demonstrate this? That would help me understand what pieces are in this puzzle. Thank you! |
hledger seems to have support for accountN/amountN, for 1..9 - simonmichael/hledger#1095. Could that be exposed/used from hledge-flow import csv processing? |
Hi @ketzacoatl - hledger-flow already exposes all of the hledger functionality you mention. hledger-flow just runs hledger with a specific rules file. Here is a fuller example, where someone gets paid 100 gold pieces in total, but just 40 of those gold pieces are paid into the bank account after taxes and benefits are kept back. Given a csv line from the bank:
And a rules file:
You'll get the following generated journal:
Note that this example is 100% hledger, nothing specific to hledger-flow. hledger-flow will guide you into where you should place your rules files for which account etc, but inside the rules file it is just normal hledger stuff. |
Thank you for taking the time to explain these details to me.
Does this mean the account2...N and such are also available in the csv file, if specified as a field in the rules file? I think one thing I've been confused about in your examples have been the 2nd/etc amounts down in the rules file instead of being in the csv data. |
If you are lucky enough to have the information needed for a breakdown in your CSV files, then you can match on that for your accountN and amountN postings. In practice I've only seen that when some institutions report a transaction fee in one of the fields, in addition to the amount. What is in your CSV files? Usually only the net amount is present in my CSV lines. The hledger docs point to some examples.: |
I have a question about how to use hledger-flow with this situation:
For some of my transactions, I would like to break them down into a group of transactions that are together. For example, if I shop at the hardware store and purchase some tools, and then some supplies for different projects, I'd like to be able to see the high-level transaction for all of those items, the taxes, etc, with the hardware store, but then also be able to see that $X was spent for project1 and $Y was spent for project2 while $Z was spent on tools.
AFAICT, this is possible to do in the PTA journal, but is there a way to do this with
hledger-flow'
s csv imports?If this is a new feature, I'd be happy to help contribute code to make it work, but would greatly appreciate some guidance / feedback on the best way to extend
hledger-flow
for this new feature.The text was updated successfully, but these errors were encountered: