Giter Club home page Giter Club logo

beancount-asset-transfer-plugin's People

Contributors

hoostus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

beancount-asset-transfer-plugin's Issues

You can't sell asset after transfer.

Hello,

There's a bug where you can't sell an asset after transferring if you didn't have enough of that asset before the transfer.

option "operating_currency" "USD"
option "booking_method" "LIFO"
option "insert_pythonpath" "TRUE"

plugin "asset_transfer.transfer"

2021-01-01 open Assets:Bank:USD                 USD
2021-01-01 open Assets:Brokerage:VTI            VTI
2021-01-01 open Assets:Brokerage:VWO            VWO
2021-01-01 open Assets:New-Brokerage:VWO        VWO
2021-01-01 open Assets:New-Brokerage:VTI        VTI

2021-01-02 * "Buy 1 VTI"
    Assets:Brokerage:VTI            1 VTI {100.00 USD}
    Assets:Bank:USD        

2021-01-15 * "Buy 1 VWO"
    Assets:Brokerage:VWO            1 VWO {1.00 USD}
    Assets:Bank:USD

2021-02-02 * "Buy 2 VTI"
    Assets:Brokerage:VTI            2 VTI {200.00 USD}
    Assets:Bank:USD

2021-02-15 * "Buy 2 VWO"
    Assets:Brokerage:VWO            2 VWO {2.00 USD}
    Assets:Bank:USD

2021-03-03 * "Buy 3 VTI"
    Assets:Brokerage:VTI            3 VTI {300.00 USD}
    Assets:Bank:USD

2021-03-15 * "Buy 3 VWO"
    Assets:Brokerage:VWO            3 VWO {3.00 USD}
    Assets:Bank:USD

2021-03-17 * "Buy 2 VTI"
    Assets:New-Brokerage:VTI      1.5 VTI {150.00 USD}
    Assets:Bank:USD

2021-04-03 custom "transfer" 3.2 VTI Assets:Brokerage:VTI Assets:New-Brokerage:VTI

2021-04-04 * "Sell 3 VTI"
    Assets:New-Brokerage:VTI     -2.9 VTI {} @ 100.00 USD
    Assets:Bank:USD           435.000 USD  

The plugin correctly sets the balances but it doesn't work regardless

------------ Balances before transaction

  Assets:Brokerage:VTI                         1 VTI {100.00 USD, 2021-01-02}
  Assets:Brokerage:VTI                         2 VTI {200.00 USD, 2021-02-02}
  Assets:Brokerage:VTI                         3 VTI {300.00 USD, 2021-03-03}

  Assets:New-Brokerage:VTI                   1.5 VTI {150.00 USD, 2021-03-17}


------------ Transaction

2021-04-03 T "Automatically generated by asset transfer plugin" #in-kind-transfer
  Assets:Brokerage:VTI      -3.0 VTI {300.00 USD, 2021-03-03}  ; -900.00 USD
  Assets:New-Brokerage:VTI   3.0 VTI {300.00 USD, 2021-03-03}  ;  900.00 USD
  Assets:Brokerage:VTI      -0.2 VTI {200.00 USD, 2021-02-02}  ; -40.000 USD
  Assets:New-Brokerage:VTI   0.2 VTI {200.00 USD, 2021-02-02}  ;  40.000 USD


Tolerances: VTI=0.05

------------ Balances after transaction

  Assets:Brokerage:VTI                         1 VTI {100.00 USD, 2021-01-02}
* Assets:Brokerage:VTI                       1.8 VTI {200.00 USD, 2021-02-02}

  Assets:New-Brokerage:VTI                   1.5 VTI {150.00 USD, 2021-03-17}
* Assets:New-Brokerage:VTI                     3 VTI {300.00 USD, 2021-03-03}
* Assets:New-Brokerage:VTI                   0.2 VTI {200.00 USD, 2021-02-02}

error:

Not enough lots to reduce "-2.9 VTI {}": 1.5 VTI {150.00 USD, 2021-03-17}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.