Switch bank account from First Republic to Citizens
This commit is contained in:
parent
4a45c90446
commit
39198db642
6 changed files with 17 additions and 16 deletions
|
@ -28,8 +28,7 @@ later. If you prefer, you can provide any/all of these explicitly:
|
|||
|
||||
You can test the output in Beancount by adding the following header entries to define the accounts:
|
||||
|
||||
2023-01-01 open Assets:FR:Check2721
|
||||
2023-01-01 open Assets:FR:Check1345
|
||||
2023-01-01 open Assets:Citizens:Check1273
|
||||
2023-01-01 open Expenses:Payroll:Salary
|
||||
2023-01-01 open Expenses:Payroll:Fees
|
||||
2023-01-01 open Expenses:Payroll:Tax
|
||||
|
|
1
TODO.md
1
TODO.md
|
@ -1,5 +1,6 @@
|
|||
# To-do
|
||||
|
||||
* Avoid hard-coding the bank account
|
||||
* Add validation/error handling of required CLI arguments such as csv, date and period
|
||||
* Potentially move employee-name->entity-tag into config
|
||||
* Potentially move cat->payroll-type into config
|
||||
|
|
|
@ -8,5 +8,6 @@
|
|||
"openjdk@21"
|
||||
;; Works fine with clojure-tools from Guix.
|
||||
"clojure-tools"
|
||||
"clj-kondo"
|
||||
"beancount"
|
||||
))
|
||||
|
|
|
@ -278,7 +278,7 @@
|
|||
{:account "Expenses:Payroll:Fees"
|
||||
:amount fee :currency "USD"
|
||||
:meta (assoc-project projects name {:entity name})})
|
||||
asset-postings [{:account "Assets:FR:Check2721"
|
||||
asset-postings [{:account "Assets:Citizens:Check1273"
|
||||
:amount (- total-fees) :currency "USD"}]
|
||||
all-postings (concat expense-postings asset-postings)]
|
||||
[(assoc template :postings all-postings)]))
|
||||
|
@ -300,7 +300,7 @@
|
|||
:amount total-retirement :currency "USD"
|
||||
:meta {:entity name}}))
|
||||
total-liabilities (total liability-postings)
|
||||
asset-postings [{:account "Assets:FR:Check1345"
|
||||
asset-postings [{:account "Assets:Citizens:Check1273"
|
||||
:amount (- total-liabilities) :currency "USD"}]
|
||||
all-postings (concat liability-postings asset-postings)]
|
||||
[(assoc template :postings all-postings)]))
|
||||
|
@ -329,10 +329,10 @@
|
|||
:meta (assoc-project projects name {:entity name})}])))
|
||||
total-net-pay (total-by-type "Net Pay" records)
|
||||
total-reimbursements (total-by-type "Reimbursement" records)
|
||||
total-net-pay-posting {:account "Assets:FR:Check2721"
|
||||
total-net-pay-posting {:account "Assets:Citizens:Check1273"
|
||||
:amount (- (- total-net-pay total-reimbursements)) :currency "USD"
|
||||
:meta {:entity "Paychex" :tax-implication "W2"}}
|
||||
total-reimbursements-posting {:account "Assets:FR:Check2721"
|
||||
total-reimbursements-posting {:account "Assets:Citizens:Check1273"
|
||||
:amount (- total-reimbursements) :currency "USD"
|
||||
:meta {:entity "Paychex" :tax-implication "Reimbursement"}}
|
||||
all-postings (concat employee-postings [total-net-pay-posting total-reimbursements-posting])]
|
||||
|
@ -372,7 +372,7 @@
|
|||
{:account "Liabilities:Payable:Accounts"
|
||||
:amount (- (total insurance-records)) :currency "USD"
|
||||
:meta (assoc-project projects name {:entity name})}])))
|
||||
asset-postings [{:account "Assets:FR:Check2721"
|
||||
asset-postings [{:account "Assets:Citizens:Check1273"
|
||||
:amount (- (+ total-liabilities total-unemploy (total withholding-liability-postings))) :currency "USD"
|
||||
:meta {:entity "Paychex" :tax-implication "Tax-Payment"}}]
|
||||
all-postings (concat withholding-liability-postings liability-postings asset-postings)]
|
||||
|
|
|
@ -246,7 +246,7 @@
|
|||
:amount 103.25M
|
||||
:currency "USD"
|
||||
:meta {:entity "Citizen-Jill"}}
|
||||
{:account "Assets:FR:Check2721" :amount -206.51 :currency "USD"})}]]
|
||||
{:account "Assets:Citizens:Check1273" :amount -206.51 :currency "USD"})}]]
|
||||
(is (= actual expected))))
|
||||
|
||||
(deftest retirement
|
||||
|
@ -272,7 +272,7 @@
|
|||
:amount 820M
|
||||
:currency "USD"
|
||||
:meta {:entity "Citizen-Jill"}}
|
||||
{:account "Assets:FR:Check1345" :amount -1820M :currency "USD"})}]]
|
||||
{:account "Assets:Citizens:Check1273" :amount -1820M :currency "USD"})}]]
|
||||
(is (= actual expected))))
|
||||
|
||||
(deftest net-pay-ach-debit
|
||||
|
@ -303,11 +303,11 @@
|
|||
:amount 50M
|
||||
:currency "USD"
|
||||
:meta {:entity "Citizen-Jill"}}
|
||||
{:account "Assets:FR:Check2721"
|
||||
{:account "Assets:Citizens:Check1273"
|
||||
:amount -8481.88M
|
||||
:currency "USD"
|
||||
:meta {:entity "Paychex" :tax-implication "W2"}}
|
||||
{:account "Assets:FR:Check2721"
|
||||
{:account "Assets:Citizens:Check1273"
|
||||
:amount -100M
|
||||
:currency "USD"
|
||||
:meta {:entity "Paychex" :tax-implication "Reimbursement"}}]}]]
|
||||
|
@ -343,7 +343,7 @@
|
|||
:amount 988.08M
|
||||
:currency "USD"
|
||||
:meta {:entity "Paychex"}}
|
||||
{:account "Assets:FR:Check2721"
|
||||
{:account "Assets:Citizens:Check1273"
|
||||
:amount -3602.31M
|
||||
:currency "USD"
|
||||
:meta {:entity "Paychex" :tax-implication "Tax-Payment"}}]}]]
|
||||
|
@ -370,7 +370,7 @@
|
|||
:amount 103.25M
|
||||
:currency "USD"
|
||||
:meta {:entity "Citizen-Jill"}}
|
||||
{:account "Assets:FR:Check2721" :amount -206.51M :currency "USD"})}
|
||||
{:account "Assets:Citizens:Check1273" :amount -206.51M :currency "USD"})}
|
||||
actual (import/render-transaction transaction)
|
||||
expected (str/triml "
|
||||
DATE txn \"Paychex\" \"Monthly Payroll - PERIOD - Fee\"
|
||||
|
@ -384,7 +384,7 @@ DATE txn \"Paychex\" \"Monthly Payroll - PERIOD - Fee\"
|
|||
entity: \"Citizen-Jack\"
|
||||
Expenses:Payroll:Fees 103.25 USD
|
||||
entity: \"Citizen-Jill\"
|
||||
Assets:FR:Check2721 -206.51 USD
|
||||
Assets:Citizens:Check1273 -206.51 USD
|
||||
")]
|
||||
(is (= actual expected))))
|
||||
|
||||
|
|
|
@ -16,7 +16,7 @@ DATE txn \"Paychex\" \"Monthly Payroll - PERIOD - Fee\"
|
|||
entity: \"Citizen-Jack\"
|
||||
Expenses:Payroll:Fees 103.25 USD
|
||||
entity: \"Citizen-Jill\"
|
||||
Assets:FR:Check2721 -206.51 USD
|
||||
Assets:Citizens:Check1273 -206.51 USD
|
||||
")
|
||||
expected '[{:date "DATE"
|
||||
:payee "Paychex"
|
||||
|
@ -38,5 +38,5 @@ DATE txn \"Paychex\" \"Monthly Payroll - PERIOD - Fee\"
|
|||
:amount 103.25M
|
||||
:currency "USD"
|
||||
:meta {:entity "Citizen-Jill"}}
|
||||
{:account "Assets:FR:Check2721" :amount -206.51M :currency "USD"})}]]
|
||||
{:account "Assets:Citizens:Check1273" :amount -206.51M :currency "USD"})}]]
|
||||
(is (= (parse/parse transaction) expected))))
|
||||
|
|
Loading…
Add table
Reference in a new issue