egh / ledger-autosync

Synchronize your ledger-cli files with your bank.
GNU General Public License v3.0
273 stars 42 forks source link

Need to include commissions/fees #109

Closed emin63 closed 4 years ago

emin63 commented 4 years ago

I think l-a needs to somehow include commissions/fees.

Consider OFX like below and note the fees of 0.07. I think l-a either needs to emit a record for the fees separately or use total/units instead of UNITPRICE. Right now it seems like l-a is just using the UNITPRICE and so when I look at a register report the results I get in ledger diverge from the true values because of the fees.

    <SELLSTOCK>
      <INVSELL>
    <INVTRAN>
      <FITID>*REDACTED*
      <DTTRADE>*REDACTED*
      <DTSETTLE>*REDACTED*
      <MEMO>SELL
    </INVTRAN>
    <SECID>
      <UNIQUEID>929042109
      <UNIQUEIDTYPE>CUSIP
    </SECID>
    <UNITS>-100.0
    <UNITPRICE>32.3944
    <FEES>0.07
    <TOTAL>3239.37
    <SUBACCTSEC>CASH
    <SUBACCTFUND>CASH
      </INVSELL>
      <SELLTYPE>SELL
    </SELLSTOCK>
emin63 commented 4 years ago

FYI: see PR #110 for a proposed fix.

egh commented 4 years ago

Thank you for correcting this! I really appreciate it.

emin63 commented 4 years ago

Thank you for correcting this! I really appreciate it.

You're welcome; it was my pleasure. Btw, I just submitted PR #112 to apply a very similar fix for commissions.