美國

401k賬戶交換的雙重輸入流程

  • August 6, 2020

我正在為一個 401k 賬戶輸入 hledger 的日記帳分錄,並且對當一個賬戶通過交易所時它應該如何工作有疑問(我不確定它到底是什麼;我猜金融公司正在對賬戶進行內部洗牌) .

Bucket2 Exchanges       $10000.00   995.000
Bucket1 Realized G/L    $100.00 0.000
Bucket1 Exchanges       -$10000.00  -1000.000

每行都有與交易相關聯的桶(賬戶)、交易類型、其價值的美元金額以及與其相關聯的股票數量。我看到股票從 Bucket1 兌現以購買 Bucket2 的股票(成本略有不同)。還有“已實現總賬”交易,我認為這是交易的收益和損失。沒有與之相關的股票。

所有這些都發生在同一天,所以我想將其作為 2 筆交易進行跟踪:一筆用於交易所,另一筆用於 Realized G/L 交易。

這是我現在擁有的:

2019-13-31 * 401k exchange
   acct:401k  995.000 "Bucket2" @@ $10000.00
   acct:401k  -1000.000 "Bucket1" @@ $10000.00

2019-13-31 * Realized G/L
   acct:401k  $100.00
   acct:unknown  ; What should this be?

; Assert that the old account is empty.
2019-13-31 * Post-exchange assertion
   acct:401k  = .00 "Bucket1"

但是,我有幾個問題:

  • 斷言失敗,因為從 Bucket1 中取出的份額與我跟踪到的進入桶中的份額不匹配。我沒有在交易歷史記錄中看到我遺漏的任何交易;他們可能來自哪裡?交易所的每股價格與基於損益金額的缺失股票數量不匹配,因此這不是缺失數據的來源。
  • 總賬交易僅僅是資訊性的嗎?無論哪種方式,我應該如何跟踪它?

所以這對我來說是一個錯誤的錯誤。我終於把歷史交易記錄一一翻了,發現在我之前同步的那天晚些時候,添加了一個條目。因此,當我自己添加條目時,我將日期範圍限制在我上次同步到那一天*之後的那一天。*因此,我只是錯過了一筆交易,因為它介於該日期之間。

(我認為答案是有道理的,所以我可以將其標記為已關閉。隨意(或者我可以)將此位移到問題中,並根據需要以這種方式關閉它。)

您的斷言條目無法平衡,因為它只有一個正常過帳。不平衡的過帳將起作用(將帳戶名括起來)。

我不確定您的範例中到底發生了什麼,但這裡嘗試對類似的完整場景進行建模,最大正確性為#1177

2019-07-01 opening balances, add $10000 cash
   assets:cash                      $10000        = $10000
   equity:opening/closing balances

2019-07-01 purchase 1000 shares of BKT1 for $9900
   assets:bucket1                     1000 "BKT1" =   1000 "BKT1"  ; quotes because of the digit
   assets:cash                      -$9900        =   $100

; all shares cashed out from bucket1 to buy shares in bucket2:

2019-12-31 sell all BKT1 for $10000, and realize capital gains
   assets:bucket1                    -1000 "BKT1" =      0 "BKT1"
   equity:exchange                    1000 "BKT1"
   equity:exchange                 -$10000
   assets:cash                      $10000        = $10100
   revenues:tax-deferred:gains       $-100  ; gain for lot: 1000 BKT1 acquired 2019-07-01
   assets:cash                        $100        = $10200

2019-12-31 buy BKT2 with the proceeds
   assets:bucket2                      995 "BKT2" =    995 "BKT2"
   equity:exchange                    -995 "BKT2"
   equity:exchange                  $10000
   assets:cash                     -$10000        =   $200

我不確定我是否正確。它提供這些報告:

現金交易:

$ hledger reg -w 90,30 cash
2019-07-01 opening balances, add $10000..  assets:cash                $10000        $10000
2019-07-01 purchase 1000 shares of BKT1..  assets:cash                $-9900          $100
2019-12-31 sell all BKT1 for $10000, an..  assets:cash                $10000        $10100
                                          assets:cash                  $100        $10200
2019-12-31 buy BKT2 with the proceeds      assets:cash               $-10000          $200

bucket1 事務:

$ hledger reg -w 90,30 bucket1
2019-07-01 purchase 1000 shares of BKT1..  ..1           1000 "BKT1"           1000 "BKT1"
2019-12-31 sell all BKT1 for $10000, an..  ..1          -1000 "BKT1"                     0

bucket2 事務:

$ hledger reg -w 90,30 bucket2
2019-12-31 buy BKT2 with the proceeds      assets:bucket2         995 "BKT2"    995 "BKT2"

所有期末餘額:

$ hledger bal --flat -E
                  0  assets:bucket1
         995 "BKT2"  assets:bucket2
               $200  assets:cash
        1000 "BKT1"                 
        -995 "BKT2"  equity:exchange
            $-10000  equity:opening balances
              $-100  revenues:tax-deferred:gains
--------------------
             $-9900
        1000 "BKT1"

資產負債表:

$ hledger bs --flat -E
Balance Sheet 2019-12-31

               ||       2019-12-31 
================++==================
Assets         ||                  
----------------++------------------
assets:bucket1 ||                0 
assets:bucket2 ||       995 "BKT2" 
assets:cash    ||             $200 
----------------++------------------
               || $200, 995 "BKT2" 
================++==================
Liabilities    ||                  
----------------++------------------
----------------++------------------
               ||                  
================++==================
Net:           || $200, 995 "BKT2" 

資產負債表,包括(部分)股權:

$ hledger bse --flat -E not:'opening balances'
Balance Sheet With Equity 2019-12-31

                ||               2019-12-31 
=================++==========================
Assets          ||                          
-----------------++--------------------------
assets:bucket1  ||                        0 
assets:bucket2  ||               995 "BKT2" 
assets:cash     ||                     $200 
-----------------++--------------------------
                ||         $200, 995 "BKT2" 
=================++==========================
Liabilities     ||                          
-----------------++--------------------------
-----------------++--------------------------
                ||                          
=================++==========================
Equity          ||                          
-----------------++--------------------------
equity:exchange || -1000 "BKT1", 995 "BKT2" 
-----------------++--------------------------
                || -1000 "BKT1", 995 "BKT2" 
=================++==========================
Net:            ||        $200, 1000 "BKT1" 

收入證明:

$ hledger is --flat 
Income Statement 2019-07-01-2019-12-31

                            || 2019-07-01-2019-12-31 
=============================++=======================
Revenues                    ||                       
-----------------------------++-----------------------
revenues:tax-deferred:gains ||                  $100 
-----------------------------++-----------------------
                            ||                  $100 
=============================++=======================
Expenses                    ||                       
-----------------------------++-----------------------
-----------------------------++-----------------------
                            ||                       
=============================++=======================
Net:                        ||                  $100 

引用自:https://money.stackexchange.com/questions/117489