Comments (8)
Thanks for the report @DamienCassou . Adding the --actual
flag to the lookup in ledger seems like a very easy solution to this (thanks, @501st-alpha1). It would also be easy to add a flag to suppress the guessing of accounts.
I know the account guessing algorithm is not very good, but I'm not sure what the best way to improve it is.
from ledger-autosync.
Current workaround
--- /home/cassou/.local/venvs/ledger-autosync/lib/python3.6/site-packages/ledgerautosync/ledgerwrap.orig.py 2018-08-07 12:56:21.059177160 +0200
+++ /home/cassou/.local/venvs/ledger-autosync/lib/python3.6/site-packages/ledgerautosync/ledgerwrap.py 2018-08-07 12:53:02.225141519 +0200
@@ -80,7 +80,10 @@
def filter_accounts(self, accts, exclude):
accts_filtered = [a for a in accts if a != exclude]
if accts_filtered:
- return accts_filtered[-1]
+ pattern = re.compile("^Expenses:")
+ return next(filter(lambda account: pattern.match(account),
+ accts_filtered),
+ accts_filtered[-1])
else:
return None
from ledger-autosync.
Currently the matching accounts are found by asking ledger for all accounts in relation with a payee. This is a problem because ledger returns automatic postings (those that are not in the ledger file). Because ledger-autosync output is supposed to be written in the ledger file, I expect it to ignore postings that are not already written in the ledger file.
One way to solve this issue would be to look inside the ledger file instead of asking ledger to do that.
from ledger-autosync.
I run into this same issue occasionally. (Due to #25 it's not very often, but once that is fixed I will probably see it more.)
This could be fixed by adding the --actual
flag to the command that looks up these accounts. From the docs:
--actual
-L
Display only actual postings, and not those created by automated transactions.
from ledger-autosync.
This bug still annoys me :-).
from ledger-autosync.
I guess #77 did not fix the issue?
from ledger-autosync.
I can confirm that this still happens for me on latest master
, so #77 didn't fix the issue. Looking at the PR again, it looks like the change was only made for the HLedger interface, not the raw Ledger interface (which I use) or LedgerPython
.
from ledger-autosync.
Opened #96 to fix the raw Ledger interface. I'm not familiar enough with the LedgerPython
interface to know if / how to apply the fix there.
from ledger-autosync.
Related Issues (20)
- Add checknum from OFX file into CODE field of ledger entry HOT 3
- How to map transactions to accounts for Fidelity and Vanguard? HOT 5
- Bug in expired short option position from Vanguard HOT 3
- Bug in handling reverse stock splits from vanguard HOT 1
- Question about behaviour of -r flag HOT 3
- Question about offsetting accounts HOT 1
- Need to include commissions/fees HOT 3
- Suggestion: Find offset account by payee *and* AutosyncPayee HOT 1
- Feature request: option to store raw OFX HOT 3
- Need to be able to disable guessing of offset account from payee HOT 1
- Time for a new release? HOT 6
- One test fails HOT 5
- 2 test failures HOT 5
- 'ascii' codec can't decode error HOT 3
- Autosync: looking up payee and offset account happens differently HOT 1
- ledger UUID breaks ofxid matching HOT 6
- Workflow that could include manual entry HOT 1
- Institution provided by OFX is empty and no fid supplied! Erorr with manual download HOT 2
- imp module doesn't exist anymore in python3.12 HOT 3
- Intended way of handling transactions without date in plugin / skipping transactions? HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ledger-autosync.